PluginProbe
Fluent Forms – Customizable Contact Forms, Survey, Quiz, & Conversational Form Builder / 5.2.9
Fluent Forms – Customizable Contact Forms, Survey, Quiz, & Conversational Form Builder v5.2.9
6.2.14 6.2.13 6.2.12 6.2.10 6.2.11 6.2.9 6.2.8 6.2.7 6.2.6 6.2.5 6.2.4 6.2.3 6.2.2 3.6.22 3.6.31 3.6.40 3.6.41 3.6.42 3.6.50 3.6.51 3.6.60 3.6.61 3.6.62 3.6.64 3.6.65 All 196 releases
fluentform / app / Modules / Widgets / FluentFormWidget.php

FluentFormWidget.php in Fluent Forms – Customizable Contact Forms, Survey, Quiz, & Conversational Form Builder 5.2.9, at app/Modules/Widgets/FluentFormWidget.php

2,517 lines 91.4 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace FluentForm\App\Modules\Widgets;
4
5 use Elementor\Widget_Base;
6 use Elementor\Controls_Manager;
7 use Elementor\Group_Control_Border;
8 use Elementor\Group_Control_Box_Shadow;
9 use Elementor\Group_Control_Typography;
10 use Elementor\Group_Control_Background;
11 use FluentForm\App\Helpers\Helper;
12 use Elementor\Core\Kits\Documents\Tabs\Global_Typography;
13 use Elementor\Core\Kits\Documents\Tabs\Global_Colors;
14
15 if (!defined('ABSPATH')) {
16 exit;
17 } // Exit if accessed directly
18
19 class FluentFormWidget extends Widget_Base
20 {
21 public function get_name()
22 {
23 return 'fluent-form-widget';
24 }
25
26 public function get_title()
27 {
28 return __('Fluent Forms', 'fluentform');
29 }
30
31 public function get_icon()
32 {
33 return 'eicon-form-horizontal';
34 }
35
36 public function get_keywords()
37 {
38 return [
39 'fluentform',
40 'fluentforms',
41 'fluent form',
42 'fluent forms',
43 'contact form',
44 'form',
45 'elementor form',
46 ];
47 }
48
49 public function get_categories()
50 {
51 return ['general'];
52 }
53
54 public function get_style_depends()
55 {
56 return [
57 'fluent-form-styles',
58 'fluentform-public-default',
59 ];
60 }
61
62 public function get_script_depends()
63 {
64 return ['fluentform-elementor'];
65 }
66
67 protected function register_controls()
68 {
69 $this->register_general_controls();
70 $this->register_error_controls();
71 $this->register_title_description_style_controls();
72 $this->register_form_container_style_controls();
73 $this->register_label_style_controls();
74 $this->register_input_textarea_style_controls();
75 $this->register_placeholder_style_controls();
76 $this->register_radio_checkbox_style_controls();
77 $this->register_terms_gdpr_style_controls();
78 $this->register_section_break_style_controls();
79 $this->register_checkbox_grid_style_controls();
80 $this->register_address_line_style_controls();
81 $this->register_image_upload_style_controls();
82 $this->register_pagination_style_controls();
83 $this->register_submit_button_style_controls();
84 $this->register_success_message_style_controls();
85 $this->register_errors_style_controls();
86 }
87
88 protected function register_general_controls()
89 {
90 $this->start_controls_section(
91 'section_fluent_form',
92 [
93 'label' => __('Fluent Forms', 'fluentform'),
94 ]
95 );
96
97 $this->add_control(
98 'form_list',
99 [
100 'label' => esc_html__('Fluent Forms', 'fluentform'),
101 'type' => Controls_Manager::SELECT2,
102 'label_block' => true,
103 'multiple' => false,
104 'options' => Helper::getForms(),
105 'default' => '0',
106 ]
107 );
108
109 $this->add_control(
110 'custom_title_description',
111 [
112 'label' => __('Custom Title & Description', 'fluentform'),
113 'type' => Controls_Manager::SWITCHER,
114 'label_on' => __('Yes', 'fluentform'),
115 'label_off' => __('No', 'fluentform'),
116 'return_value' => 'yes',
117 ]
118 );
119
120 $this->add_control(
121 'form_title_custom',
122 [
123 'label' => esc_html__('Title', 'fluentform'),
124 'type' => Controls_Manager::TEXT,
125 'label_block' => true,
126 'default' => '',
127 'condition' => [
128 'custom_title_description' => 'yes',
129 ],
130 ]
131 );
132
133 $this->add_control(
134 'form_description_custom',
135 [
136 'label' => esc_html__('Description', 'fluentform'),
137 'type' => Controls_Manager::TEXTAREA,
138 'default' => '',
139 'condition' => [
140 'custom_title_description' => 'yes',
141 ],
142 ]
143 );
144
145 $this->add_control(
146 'labels_switch',
147 [
148 'label' => __('Labels ', 'fluentform'),
149 'type' => Controls_Manager::SWITCHER,
150 'default' => 'yes',
151 'label_on' => __('Show', 'fluentform'),
152 'label_off' => __('Hide', 'fluentform'),
153 'return_value' => 'yes',
154 ]
155 );
156
157 $this->add_control(
158 'placeholder_switch',
159 [
160 'label' => __('Placeholder', 'fluentform'),
161 'type' => Controls_Manager::SWITCHER,
162 'default' => 'yes',
163 'label_on' => __('Show', 'fluentform'),
164 'label_off' => __('Hide', 'fluentform'),
165 'return_value' => 'yes',
166 ]
167 );
168
169 $this->end_controls_section();
170 }
171
172 protected function register_error_controls()
173 {
174 $this->start_controls_section(
175 'section_errors',
176 [
177 'label' => __('Errors', 'fluentform'),
178 ]
179 );
180
181 $this->add_control(
182 'error_messages',
183 [
184 'label' => __('Error Messages', 'fluentform'),
185 'type' => Controls_Manager::SWITCHER,
186 'default' => 'yes',
187 'label_on' => __('Show', 'fluentform'),
188 'label_off' => __('Hide', 'fluentform'),
189 'return_value' => 'yes',
190 ]
191 );
192
193 $this->end_controls_section();
194 }
195
196 protected function register_title_description_style_controls()
197 {
198 $this->start_controls_section(
199 'section_form_title_style',
200 [
201 'label' => __('Title & Description', 'fluentform'),
202 'tab' => Controls_Manager::TAB_STYLE,
203 'condition' => [
204 'custom_title_description' => 'yes',
205 ],
206 ]
207 );
208
209 $this->add_responsive_control(
210 'heading_alignment',
211 [
212 'label' => __('Alignment', 'fluentform'),
213 'type' => Controls_Manager::CHOOSE,
214 'options' => [
215 'left' => [
216 'title' => __('Left', 'fluentform'),
217 'icon' => 'fa fa-align-left',
218 ],
219 'center' => [
220 'title' => __('Center', 'fluentform'),
221 'icon' => 'fa fa-align-center',
222 ],
223 'right' => [
224 'title' => __('Right', 'fluentform'),
225 'icon' => 'fa fa-align-right',
226 ],
227 ],
228 'default' => '',
229 'selectors' => [
230 '{{WRAPPER}} .fluentform-widget-title' => 'text-align: {{VALUE}};',
231 '{{WRAPPER}} .fluentform-widget-description' => 'text-align: {{VALUE}};',
232 ],
233 'condition' => [
234 'custom_title_description' => 'yes',
235 ],
236 ]
237 );
238
239 $this->add_control(
240 'heading_title',
241 [
242 'label' => __('Title', 'fluentform'),
243 'type' => Controls_Manager::HEADING,
244 'separator' => 'before',
245 'condition' => [
246 'custom_title_description' => 'yes',
247 ],
248 ]
249 );
250
251 $this->add_control(
252 'form_title_text_color',
253 [
254 'label' => __('Color', 'fluentform'),
255 'type' => Controls_Manager::COLOR,
256 'default' => '',
257 'selectors' => [
258 '{{WRAPPER}} .fluentform-widget-title' => 'color: {{VALUE}}',
259 ],
260 'condition' => [
261 'custom_title_description' => 'yes',
262 ],
263 ]
264 );
265
266 $this->add_group_control(
267 Group_Control_Typography::get_type(),
268 [
269 'name' => 'form_title_typography',
270 'label' => __('Typography', 'fluentform'),
271 'selector' => '{{WRAPPER}} .fluentform-widget-title',
272 'condition' => [
273 'custom_title_description' => 'yes',
274 ],
275 ]
276 );
277
278 $this->add_responsive_control(
279 'form_title_margin',
280 [
281 'label' => __('Margin', 'fluentform'),
282 'type' => Controls_Manager::DIMENSIONS,
283 'size_units' => ['px', 'em', '%'],
284 'allowed_dimensions' => 'vertical',
285 'placeholder' => [
286 'top' => '',
287 'right' => 'auto',
288 'bottom' => '',
289 'left' => 'auto',
290 ],
291 'selectors' => [
292 '{{WRAPPER}} .fluentform-widget-title' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
293 ],
294 'condition' => [
295 'custom_title_description' => 'yes',
296 ],
297 ]
298 );
299
300 $this->add_responsive_control(
301 'form_title_padding',
302 [
303 'label' => esc_html__('Padding', 'fluentform'),
304 'type' => Controls_Manager::DIMENSIONS,
305 'size_units' => ['px', 'em', '%'],
306 'selectors' => [
307 '{{WRAPPER}} .fluentform-widget-title' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
308 ],
309 ]
310 );
311
312 $this->add_control(
313 'heading_description',
314 [
315 'label' => __('Description', 'fluentform'),
316 'type' => Controls_Manager::HEADING,
317 'separator' => 'before',
318 'condition' => [
319 'custom_title_description' => 'yes',
320 ],
321 ]
322 );
323
324 $this->add_control(
325 'heading_description_text_color',
326 [
327 'label' => __('Color', 'fluentform'),
328 'type' => Controls_Manager::COLOR,
329 'default' => '',
330 'selectors' => [
331 '{{WRAPPER}} .fluentform-widget-description' => 'color: {{VALUE}}',
332 ],
333 'condition' => [
334 'custom_title_description' => 'yes',
335 ],
336 ]
337 );
338
339 $this->add_group_control(
340 Group_Control_Typography::get_type(),
341 [
342 'name' => 'heading_description_typography',
343 'label' => __('Typography', 'fluentform'),
344 'selector' => '{{WRAPPER}} .fluentform-widget-description',
345 'global' => [
346 'default' => Global_Typography::TYPOGRAPHY_ACCENT,
347 ],
348 'condition' => [
349 'custom_title_description' => 'yes',
350 ],
351 ]
352 );
353
354 $this->add_responsive_control(
355 'heading_description_margin',
356 [
357 'label' => __('Margin', 'fluentform'),
358 'type' => Controls_Manager::DIMENSIONS,
359 'size_units' => ['px', 'em', '%'],
360 'allowed_dimensions' => 'vertical',
361 'placeholder' => [
362 'top' => '',
363 'right' => 'auto',
364 'bottom' => '',
365 'left' => 'auto',
366 ],
367 'selectors' => [
368 '{{WRAPPER}} .fluentform-widget-description' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
369 ],
370 'condition' => [
371 'custom_title_description' => 'yes',
372 ],
373 ]
374 );
375
376 $this->add_responsive_control(
377 'heading_description_padding',
378 [
379 'label' => esc_html__('Padding', 'fluentform'),
380 'type' => Controls_Manager::DIMENSIONS,
381 'size_units' => ['px', 'em', '%'],
382 'selectors' => [
383 '{{WRAPPER}} .fluentform-widget-description' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
384 ],
385 ]
386 );
387
388 $this->end_controls_section();
389 }
390
391 protected function register_form_container_style_controls()
392 {
393 $this->start_controls_section(
394 'section_form_container_style',
395 [
396 'label' => __('Form Container', 'fluentform'),
397 'tab' => Controls_Manager::TAB_STYLE,
398 ]
399 );
400
401 $this->add_group_control(
402 Group_Control_Background::get_type(),
403 [
404 'name' => 'form_container_background',
405 'label' => __('Background', 'fluentform'),
406 'types' => ['classic', 'gradient'],
407 'selector' => '{{WRAPPER}} .fluentform-widget-wrapper',
408 ]
409 );
410
411 $this->add_control(
412 'form_container_link_color',
413 [
414 'label' => __('Link Color', 'fluentform'),
415 'type' => Controls_Manager::COLOR,
416 'default' => '',
417 'selectors' => [
418 '{{WRAPPER}} .fluentform-widget-wrapper .ff-el-group a' => 'color: {{VALUE}};',
419 ],
420 ]
421 );
422
423 $this->add_responsive_control(
424 'form_container_max_width',
425 [
426 'label' => esc_html__('Max Width', 'fluentform'),
427 'type' => Controls_Manager::SLIDER,
428 'size_units' => ['px', 'em', '%'],
429 'range' => [
430 'px' => [
431 'min' => 10,
432 'max' => 1500,
433 ],
434 'em' => [
435 'min' => 1,
436 'max' => 80,
437 ],
438 ],
439 'selectors' => [
440 '{{WRAPPER}} .fluentform-widget-wrapper' => 'width: {{SIZE}}{{UNIT}};',
441 ],
442 ]
443 );
444
445 $this->add_responsive_control(
446 'form_container_alignment',
447 [
448 'label' => esc_html__('Alignment', 'fluentform'),
449 'type' => Controls_Manager::CHOOSE,
450 'label_block' => true,
451 'options' => [
452 'default' => [
453 'title' => __('Default', 'fluentform'),
454 'icon' => 'fa fa-ban',
455 ],
456 'left' => [
457 'title' => esc_html__('Left', 'fluentform'),
458 'icon' => 'eicon-h-align-left',
459 ],
460 'center' => [
461 'title' => esc_html__('Center', 'fluentform'),
462 'icon' => 'eicon-h-align-center',
463 ],
464 'right' => [
465 'title' => esc_html__('Right', 'fluentform'),
466 'icon' => 'eicon-h-align-right',
467 ],
468 ],
469 'default' => 'default',
470 ]
471 );
472
473 $this->add_responsive_control(
474 'form_container_margin',
475 [
476 'label' => esc_html__('Margin', 'fluentform'),
477 'type' => Controls_Manager::DIMENSIONS,
478 'size_units' => ['px', 'em', '%'],
479 'selectors' => [
480 '{{WRAPPER}} .fluentform-widget-wrapper' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
481 ],
482 ]
483 );
484
485 $this->add_responsive_control(
486 'form_container_padding',
487 [
488 'label' => esc_html__('Padding', 'fluentform'),
489 'type' => Controls_Manager::DIMENSIONS,
490 'size_units' => ['px', 'em', '%'],
491 'selectors' => [
492 '{{WRAPPER}} .fluentform-widget-wrapper' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
493 ],
494 ]
495 );
496
497 $this->add_group_control(
498 Group_Control_Border::get_type(),
499 [
500 'name' => 'form_container_border',
501 'selector' => '{{WRAPPER}} .fluentform-widget-wrapper',
502 ]
503 );
504
505 $this->add_control(
506 'form_container_border_radius',
507 [
508 'label' => esc_html__('Border Radius', 'fluentform'),
509 'type' => Controls_Manager::DIMENSIONS,
510 'separator' => 'before',
511 'size_units' => ['px'],
512 'selectors' => [
513 '{{WRAPPER}} .fluentform-widget-wrapper' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
514 ],
515 ]
516 );
517
518 $this->add_group_control(
519 Group_Control_Box_Shadow::get_type(),
520 [
521 'name' => 'form_container_box_shadow',
522 'selector' => '{{WRAPPER}} .fluentform-widget-wrapper',
523 ]
524 );
525
526 $this->end_controls_section();
527 }
528
529 protected function register_label_style_controls()
530 {
531 $this->start_controls_section(
532 'section_form_label_style',
533 [
534 'label' => __('Labels', 'fluentform'),
535 'tab' => Controls_Manager::TAB_STYLE,
536 ]
537 );
538 $this->add_control(
539 'form_label_text_color',
540 [
541 'label' => __('Text Color', 'fluentform'),
542 'type' => Controls_Manager::COLOR,
543 'selectors' => [
544 '{{WRAPPER}} .fluentform-widget-wrapper .ff-el-input--label label' => 'color: {{VALUE}}',
545 ],
546 ]
547 );
548
549 $this->add_group_control(
550 Group_Control_Typography::get_type(),
551 [
552 'name' => 'form_label_typography',
553 'label' => __('Typography', 'fluentform'),
554 'selector' => '{{WRAPPER}} .fluentform-widget-wrapper .ff-el-input--label label',
555 ]
556 );
557
558 $this->add_control(
559 'form_label_asterisk_color',
560 [
561 'label' => __('Asterisk Color', 'fluentform'),
562 'type' => Controls_Manager::COLOR,
563 'selectors' => [
564 '{{WRAPPER}} .ff-el-is-required.asterisk-right label:after' => 'color: {{VALUE}} !important',
565 ],
566 ]
567 );
568 $this->add_control(
569 'form_label_asterisk_size',
570 [
571 'label' => __('Asterisk Size', 'fluentform'),
572 'type' => Controls_Manager::SLIDER,
573 'range' => [
574 'px' => [
575 'min' => 0,
576 'max' => 30,
577 'step' => 1,
578 ],
579 '%' => [
580 'min' => 0,
581 'max' => 30,
582 'step' => 1,
583 ],
584 ],
585 'size_units' => ['px', 'em', '%'],
586 'selectors' => [
587 '{{WRAPPER}} .ff-el-is-required.asterisk-right label:after' => 'font-size: {{SIZE}}{{UNIT}}',
588 ],
589 'separator' => 'before',
590 ]
591 );
592
593
594 $this->end_controls_section();
595 }
596
597 protected function register_input_textarea_style_controls()
598 {
599 $this->start_controls_section(
600 'section_form_fields_style',
601 [
602 'label' => __('Input & Textarea', 'fluentform'),
603 'tab' => Controls_Manager::TAB_STYLE,
604 ]
605 );
606
607 $this->add_responsive_control(
608 'input_alignment',
609 [
610 'label' => __('Alignment', 'fluentform'),
611 'type' => Controls_Manager::CHOOSE,
612 'options' => [
613 'left' => [
614 'title' => __('Left', 'fluentform'),
615 'icon' => 'fa fa-align-left',
616 ],
617 'center' => [
618 'title' => __('Center', 'fluentform'),
619 'icon' => 'fa fa-align-center',
620 ],
621 'right' => [
622 'title' => __('Right', 'fluentform'),
623 'icon' => 'fa fa-align-right',
624 ],
625 ],
626 'default' => '',
627 'selectors' => [
628 '{{WRAPPER}} .fluentform-widget-wrapper input:not([type=radio]):not([type=checkbox]):not([type=submit]):not([type=button]):not([type=image]):not([type=file]), {{WRAPPER}} .fluentform-widget-wrapper .ff-el-group textarea, {{WRAPPER}} .fluentform-widget-wrapper .ff-el-group select' => 'text-align: {{VALUE}};',
629 ],
630 ]
631 );
632
633 $this->start_controls_tabs('tabs_form_fields_style');
634
635 $this->start_controls_tab(
636 'tab_form_fields_normal',
637 [
638 'label' => __('Normal', 'fluentform'),
639 ]
640 );
641
642 $this->add_control(
643 'form_field_bg_color',
644 [
645 'label' => __('Background Color', 'fluentform'),
646 'type' => Controls_Manager::COLOR,
647 'default' => '',
648 'selectors' => [
649 '{{WRAPPER}} .fluentform-widget-wrapper input:not([type=radio]):not([type=checkbox]):not([type=submit]):not([type=button]):not([type=image]):not([type=file]):not(.select2-search__field), {{WRAPPER}} .fluentform-widget-wrapper .ff-el-group textarea, {{WRAPPER}} .fluentform-widget-wrapper .ff-el-group select, {{WRAPPER}} .fluentform-widget-wrapper .ff-el-group .select2-container--default .select2-selection--multiple' => 'background-color: {{VALUE}}',
650 ],
651 ]
652 );
653
654 $this->add_control(
655 'form_field_text_color',
656 [
657 'label' => __('Text Color', 'fluentform'),
658 'type' => Controls_Manager::COLOR,
659 'default' => '',
660 'selectors' => [
661 '{{WRAPPER}} .fluentform-widget-wrapper input:not([type=radio]):not([type=checkbox]):not([type=submit]):not([type=button]):not([type=image]):not([type=file]), {{WRAPPER}} .fluentform-widget-wrapper .ff-el-group textarea, {{WRAPPER}} .fluentform-widget-wrapper .ff-el-group select' => 'color: {{VALUE}}',
662 ],
663 ]
664 );
665
666 $this->add_group_control(
667 Group_Control_Border::get_type(),
668 [
669 'name' => 'form_field_border',
670 'label' => __('Border', 'fluentform'),
671 'placeholder' => '1px',
672 'default' => '1px',
673 'selector' => '{{WRAPPER}} .fluentform-widget-wrapper input:not([type=radio]):not([type=checkbox]):not([type=submit]):not([type=button]):not([type=image]):not([type=file]):not(.select2-search__field), {{WRAPPER}} .fluentform-widget-wrapper .ff-el-group textarea, {{WRAPPER}} .fluentform-widget-wrapper .ff-el-group select, {{WRAPPER}} .fluentform-widget-wrapper .ff-el-group .select2-container--default .select2-selection--multiple',
674 'separator' => 'before',
675 ]
676 );
677
678 $this->add_control(
679 'form_field_radius',
680 [
681 'label' => __('Border Radius', 'fluentform'),
682 'type' => Controls_Manager::DIMENSIONS,
683 'size_units' => ['px', 'em', '%'],
684 'selectors' => [
685 '{{WRAPPER}} .fluentform-widget-wrapper input:not([type=radio]):not([type=checkbox]):not([type=submit]):not([type=button]):not([type=image]):not([type=file]), {{WRAPPER}} .fluentform-widget-wrapper .ff-el-group textarea, {{WRAPPER}} .fluentform-widget-wrapper .ff-el-group select, {{WRAPPER}} .fluentform-widget-wrapper .ff-el-group .select2-container--default .select2-selection--multiple' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
686 ],
687 ]
688 );
689
690 $this->add_responsive_control(
691 'form_field_text_indent',
692 [
693 'label' => __('Text Indent', 'fluentform'),
694 'type' => Controls_Manager::SLIDER,
695 'range' => [
696 'px' => [
697 'min' => 0,
698 'max' => 60,
699 'step' => 1,
700 ],
701 '%' => [
702 'min' => 0,
703 'max' => 30,
704 'step' => 1,
705 ],
706 ],
707 'size_units' => ['px', 'em', '%'],
708 'selectors' => [
709 '{{WRAPPER}} .fluentform-widget-wrapper input:not([type=radio]):not([type=checkbox]):not([type=submit]):not([type=button]):not([type=image]):not([type=file]), {{WRAPPER}} .fluentform-widget-wrapper .ff-el-group textarea, {{WRAPPER}} .fluentform-widget-wrapper .ff-el-group select' => 'text-indent: {{SIZE}}{{UNIT}}',
710 ],
711 'separator' => 'before',
712 ]
713 );
714
715 $this->add_responsive_control(
716 'form_input_width',
717 [
718 'label' => __('Input Width', 'fluentform'),
719 'type' => Controls_Manager::SLIDER,
720 'range' => [
721 'px' => [
722 'min' => 0,
723 'max' => 1200,
724 'step' => 1,
725 ],
726 ],
727 'size_units' => ['px', 'em', '%'],
728 'selectors' => [
729 '{{WRAPPER}} .fluentform-widget-wrapper input:not([type=radio]):not([type=checkbox]):not([type=submit]):not([type=button]):not([type=image]):not([type=file]), {{WRAPPER}} .fluentform-widget-wrapper .ff-el-group select' => 'width: {{SIZE}}{{UNIT}}',
730 ],
731 ]
732 );
733
734 $this->add_responsive_control(
735 'form_input_height',
736 [
737 'label' => __('Input Height', 'fluentform'),
738 'type' => Controls_Manager::SLIDER,
739 'range' => [
740 'px' => [
741 'min' => 0,
742 'max' => 80,
743 'step' => 1,
744 ],
745 ],
746 'size_units' => ['px', 'em', '%'],
747 'selectors' => [
748 '{{WRAPPER}} .fluentform-widget-wrapper input:not([type=radio]):not([type=checkbox]):not([type=submit]):not([type=button]):not([type=image]):not([type=file]), {{WRAPPER}} .fluentform-widget-wrapper .ff-el-group select' => 'height: {{SIZE}}{{UNIT}}',
749 ],
750 ]
751 );
752
753 $this->add_responsive_control(
754 'form_textarea_width',
755 [
756 'label' => __('Textarea Width', 'fluentform'),
757 'type' => Controls_Manager::SLIDER,
758 'range' => [
759 'px' => [
760 'min' => 0,
761 'max' => 1200,
762 'step' => 1,
763 ],
764 ],
765 'size_units' => ['px', 'em', '%'],
766 'selectors' => [
767 '{{WRAPPER}} .fluentform-widget-wrapper .ff-el-group textarea' => 'width: {{SIZE}}{{UNIT}}',
768 ],
769 ]
770 );
771
772 $this->add_responsive_control(
773 'form_textarea_height',
774 [
775 'label' => __('Textarea Height', 'fluentform'),
776 'type' => Controls_Manager::SLIDER,
777 'range' => [
778 'px' => [
779 'min' => 0,
780 'max' => 400,
781 'step' => 1,
782 ],
783 ],
784 'size_units' => ['px', 'em', '%'],
785 'selectors' => [
786 '{{WRAPPER}} .fluentform-widget-wrapper .ff-el-group textarea' => 'height: {{SIZE}}{{UNIT}}',
787 ],
788 ]
789 );
790
791 $this->add_responsive_control(
792 'form_field_padding',
793 [
794 'label' => __('Padding', 'fluentform'),
795 'type' => Controls_Manager::DIMENSIONS,
796 'size_units' => ['px', 'em', '%'],
797 'selectors' => [
798 '{{WRAPPER}} .fluentform-widget-wrapper input:not([type=radio]):not([type=checkbox]):not([type=submit]):not([type=button]):not([type=image]):not([type=file]), {{WRAPPER}} .fluentform-widget-wrapper .ff-el-group textarea, {{WRAPPER}} .fluentform-widget-wrapper .ff-el-group select' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
799 ],
800 ]
801 );
802
803 $this->add_responsive_control(
804 'form_field_spacing',
805 [
806 'label' => __('Spacing', 'fluentform'),
807 'type' => Controls_Manager::SLIDER,
808 'range' => [
809 'px' => [
810 'min' => 0,
811 'max' => 100,
812 'step' => 1,
813 ],
814 ],
815 'size_units' => ['px', 'em', '%'],
816 'selectors' => [
817 '{{WRAPPER}} .fluentform-widget-wrapper .ff-el-group' => 'margin-bottom: {{SIZE}}{{UNIT}}',
818 ],
819 ]
820 );
821
822 $this->add_group_control(
823 Group_Control_Typography::get_type(),
824 [
825 'name' => 'form_field_typography',
826 'label' => __('Typography', 'fluentform'),
827 'selector' => '{{WRAPPER}} .fluentform-widget-wrapper input:not([type=radio]):not([type=checkbox]):not([type=submit]):not([type=button]):not([type=image]):not([type=file]), {{WRAPPER}} .fluentform-widget-wrapper .ff-el-group textarea, {{WRAPPER}} .fluentform-widget-wrapper .ff-el-group select',
828 'separator' => 'before',
829 ]
830 );
831
832 $this->add_group_control(
833 Group_Control_Box_Shadow::get_type(),
834 [
835 'name' => 'form_field_box_shadow',
836 'selector' => '{{WRAPPER}} .fluentform-widget-wrapper input:not([type=radio]):not([type=checkbox]):not([type=submit]):not([type=button]):not([type=image]):not([type=file]), {{WRAPPER}} .fluentform-widget-wrapper .ff-el-group textarea, {{WRAPPER}} .fluentform-widget-wrapper .ff-el-group select',
837 'separator' => 'before',
838 ]
839 );
840
841 $this->end_controls_tab();
842
843 $this->start_controls_tab(
844 'tab_form_fields_focus',
845 [
846 'label' => __('Focus', 'fluentform'),
847 ]
848 );
849
850 $this->add_control(
851 'form_field_bg_color_focus',
852 [
853 'label' => __('Background Color', 'fluentform'),
854 'type' => Controls_Manager::COLOR,
855 'default' => '',
856 'selectors' => [
857 '{{WRAPPER}} .fluentform-widget-wrapper input:not([type=radio]):not([type=checkbox]):not([type=submit]):not([type=button]):not([type=image]):not([type=file]):focus, {{WRAPPER}} .fluentform-widget-wrapper .ff-el-group textarea:focus' => 'background-color: {{VALUE}}',
858 ],
859 ]
860 );
861
862 $this->add_group_control(
863 Group_Control_Border::get_type(),
864 [
865 'name' => 'form_input_focus_border',
866 'label' => __('Border', 'fluentform'),
867 'placeholder' => '1px',
868 'default' => '1px',
869 'selector' => '{{WRAPPER}} .fluentform-widget-wrapper input:not([type=radio]):not([type=checkbox]):not([type=submit]):not([type=button]):not([type=image]):not([type=file]):focus, {{WRAPPER}} .fluentform-widget-wrapper .ff-el-group textarea:focus',
870 ]
871 );
872
873 $this->add_group_control(
874 Group_Control_Box_Shadow::get_type(),
875 [
876 'name' => 'form_input_focus_box_shadow',
877 'selector' => '{{WRAPPER}} .fluentform-widget-wrapper input:not([type=radio]):not([type=checkbox]):not([type=submit]):not([type=button]):not([type=image]):not([type=file]):focus, {{WRAPPER}} .fluentform-widget-wrapper .ff-el-group textarea:focus',
878 'separator' => 'before',
879 ]
880 );
881
882 $this->end_controls_tab();
883
884 $this->end_controls_tabs();
885
886 $this->end_controls_section();
887 }
888
889 protected function register_terms_gdpr_style_controls()
890 {
891 $this->start_controls_section(
892 'section_form_terms_gdpr_style',
893 [
894 'label' => __('GDPR , Terms & Condition ', 'fluentform'),
895 'tab' => Controls_Manager::TAB_STYLE,
896 ]
897 );
898
899 $this->add_responsive_control(
900 'form_terms_gdpr_alignment',
901 [
902 'label' => __('Alignment', 'fluentform'),
903 'type' => Controls_Manager::CHOOSE,
904 'options' => [
905 'left' => [
906 'title' => __('Left', 'fluentform'),
907 'icon' => 'fa fa-align-left',
908 ],
909 'center' => [
910 'title' => __('Center', 'fluentform'),
911 'icon' => 'fa fa-align-center',
912 ],
913 'right' => [
914 'title' => __('Right', 'fluentform'),
915 'icon' => 'fa fa-align-right',
916 ],
917 ],
918 'default' => '',
919 'selectors' => ['{{WRAPPER}} .fluentform-widget-wrapper .ff_t_c' => 'text-align: {{VALUE}};'],
920 ]
921 );
922
923 $this->add_group_control(
924 Group_Control_Typography::get_type(),
925 [
926 'name' => 'form_terms_gdpr_typography',
927 'label' => __('Typography', 'fluentform'),
928 'selector' => '{{WRAPPER}} .fluentform-widget-wrapper .ff_t_c ',
929
930 ]
931 );
932 $this->add_control(
933 'form_terms_gdpr_color',
934 [
935 'label' => __('Color', 'fluentform'),
936 'type' => Controls_Manager::COLOR,
937 'default' => '',
938 'selectors' => ['{{WRAPPER}} .fluentform-widget-wrapper .ff_t_c ' => 'color: {{VALUE}};'],
939 ]
940 );
941
942 $this->end_controls_section();
943 }
944
945 protected function register_placeholder_style_controls()
946 {
947 $this->start_controls_section(
948 'section_placeholder_style',
949 [
950 'label' => __('Placeholder', 'fluentform'),
951 'tab' => Controls_Manager::TAB_STYLE,
952 'condition' => [
953 'placeholder_switch' => 'yes',
954 ],
955 ]
956 );
957
958 $this->add_control(
959 'form_placeholder_text_color',
960 [
961 'label' => __('Text Color', 'fluentform'),
962 'type' => Controls_Manager::COLOR,
963 'selectors' => [
964 '{{WRAPPER}} .fluentform-widget-wrapper .ff-el-group input::-webkit-input-placeholder, {{WRAPPER}} .fluentform-widget-wrapper .ff-el-group textarea::-webkit-input-placeholder' => 'color: {{VALUE}}',
965 ],
966 'condition' => [
967 'placeholder_switch' => 'yes',
968 ],
969 ]
970 );
971
972 $this->end_controls_section();
973 }
974
975 protected function register_radio_checkbox_style_controls()
976 {
977 $this->start_controls_section(
978 'section_form_radio_checkbox_style',
979 [
980 'label' => __('Radio & Checkbox', 'fluentform'),
981 'tab' => Controls_Manager::TAB_STYLE,
982 ]
983 );
984
985 $this->add_control(
986 'form_custom_radio_checkbox',
987 [
988 'label' => __('Custom Styles', 'fluentform'),
989 'type' => Controls_Manager::SWITCHER,
990 'label_on' => __('Yes', 'fluentform'),
991 'label_off' => __('No', 'fluentform'),
992 'return_value' => 'yes',
993 ]
994 );
995
996 $this->add_responsive_control(
997 'form_radio_checkbox_size',
998 [
999 'label' => __('Size', 'fluentform'),
1000 'type' => Controls_Manager::SLIDER,
1001 'default' => [
1002 'size' => '15',
1003 'unit' => 'px',
1004 ],
1005 'range' => [
1006 'px' => [
1007 'min' => 0,
1008 'max' => 80,
1009 'step' => 1,
1010 ],
1011 ],
1012 'size_units' => ['px', 'em', '%'],
1013 'selectors' => [
1014 '{{WRAPPER}} .fluentform-widget-custom-radio-checkbox input[type="checkbox"], {{WRAPPER}} .fluentform-widget-custom-radio-checkbox input[type="radio"]' => 'width: {{SIZE}}{{UNIT}}; height: {{SIZE}}{{UNIT}}',
1015 ],
1016 'condition' => [
1017 'form_custom_radio_checkbox' => 'yes',
1018 ],
1019 ]
1020 );
1021
1022 $this->add_responsive_control(
1023 'form_radio_checkbox_text_indent',
1024 [
1025 'label' => __('Text Indent', 'fluentform'),
1026 'type' => Controls_Manager::SLIDER,
1027 'range' => [
1028 'px' => [
1029 'min' => 0,
1030 'max' => 60,
1031 'step' => 1,
1032 ],
1033 '%' => [
1034 'min' => 0,
1035 'max' => 30,
1036 'step' => 1,
1037 ],
1038 ],
1039 'size_units' => ['px', 'em', '%'],
1040 'selectors' => [
1041 '{{WRAPPER}} .fluentform-widget-custom-radio-checkbox input[type="checkbox"], {{WRAPPER}} .fluentform-widget-custom-radio-checkbox input[type="radio"]' => 'margin-right: {{SIZE}}{{UNIT}}',
1042 ],
1043 'condition' => [
1044 'form_custom_radio_checkbox' => 'yes',
1045 ],
1046 ]
1047 );
1048
1049 $this->start_controls_tabs('tabs_radio_checkbox_style');
1050
1051 $this->start_controls_tab(
1052 'form_radio_checkbox_normal',
1053 [
1054 'label' => __('Normal', 'fluentform'),
1055 'condition' => [
1056 'form_custom_radio_checkbox' => 'yes',
1057 ],
1058 ]
1059 );
1060
1061 $this->add_control(
1062 'form_radio_checkbox_bg_color',
1063 [
1064 'label' => __('Background Color', 'fluentform'),
1065 'type' => Controls_Manager::COLOR,
1066 'default' => '',
1067 'selectors' => [
1068 '{{WRAPPER}} .fluentform-widget-custom-radio-checkbox input[type="checkbox"]:after, {{WRAPPER}} .fluentform-widget-custom-radio-checkbox input[type="radio"]:after' => 'background-color: {{VALUE}}',
1069 ],
1070 'condition' => [
1071 'form_custom_radio_checkbox' => 'yes',
1072 ],
1073 ]
1074 );
1075
1076 $this->add_responsive_control(
1077 'form_checkbox_border_width',
1078 [
1079 'label' => __('Border Width', 'fluentform'),
1080 'type' => Controls_Manager::SLIDER,
1081 'range' => [
1082 'px' => [
1083 'min' => 0,
1084 'max' => 15,
1085 'step' => 1,
1086 ],
1087 ],
1088 'size_units' => ['px'],
1089 'selectors' => [
1090 '{{WRAPPER}} .fluentform-widget-custom-radio-checkbox input[type="checkbox"]:after, {{WRAPPER}} .fluentform-widget-custom-radio-checkbox input[type="radio"]:after' => 'border-width: {{SIZE}}{{UNIT}}',
1091 ],
1092 'condition' => [
1093 'form_custom_radio_checkbox' => 'yes',
1094 ],
1095 ]
1096 );
1097
1098 $this->add_control(
1099 'form_checkbox_border_color',
1100 [
1101 'label' => __('Border Color', 'fluentform'),
1102 'type' => Controls_Manager::COLOR,
1103 'default' => '',
1104 'selectors' => [
1105 '{{WRAPPER}} .fluentform-widget-custom-radio-checkbox input[type="checkbox"]:after, {{WRAPPER}} .fluentform-widget-custom-radio-checkbox input[type="radio"]:after' => 'border-color: {{VALUE}}',
1106 ],
1107 'condition' => [
1108 'form_custom_radio_checkbox' => 'yes',
1109 ],
1110 ]
1111 );
1112
1113 $this->add_control(
1114 'form_checkbox_heading',
1115 [
1116 'label' => __('Checkbox', 'fluentform'),
1117 'type' => Controls_Manager::HEADING,
1118 'condition' => [
1119 'form_custom_radio_checkbox' => 'yes',
1120 ],
1121 ]
1122 );
1123
1124 $this->add_control(
1125 'form_checkbox_border_radius',
1126 [
1127 'label' => __('Border Radius', 'fluentform'),
1128 'type' => Controls_Manager::DIMENSIONS,
1129 'size_units' => ['px', 'em', '%'],
1130 'selectors' => [
1131 '{{WRAPPER}} .fluentform-widget-custom-radio-checkbox input[type="checkbox"]:after, {{WRAPPER}} .fluentform-widget-custom-radio-checkbox input[type="radio"]:after' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
1132 ],
1133 'condition' => [
1134 'form_custom_radio_checkbox' => 'yes',
1135 ],
1136 ]
1137 );
1138
1139 $this->add_control(
1140 'form_radio_heading',
1141 [
1142 'label' => __('Radio Buttons', 'fluentform'),
1143 'type' => Controls_Manager::HEADING,
1144 'condition' => [
1145 'form_custom_radio_checkbox' => 'yes',
1146 ],
1147 ]
1148 );
1149
1150 $this->add_control(
1151 'form_radio_border_radius',
1152 [
1153 'label' => __('Border Radius', 'fluentform'),
1154 'type' => Controls_Manager::DIMENSIONS,
1155 'size_units' => ['px', 'em', '%'],
1156 'selectors' => [
1157 '{{WRAPPER}} .fluentform-widget-custom-radio-checkbox input[type="radio"]:after, {{WRAPPER}} .fluentform-widget-custom-radio-checkbox input[type="radio"]:after' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
1158 ],
1159 'condition' => [
1160 'form_custom_radio_checkbox' => 'yes',
1161 ],
1162 ]
1163 );
1164
1165 $this->end_controls_tab();
1166
1167 $this->start_controls_tab(
1168 'form_radio_checkbox_checked',
1169 [
1170 'label' => __('Checked', 'fluentform'),
1171 'condition' => [
1172 'form_custom_radio_checkbox' => 'yes',
1173 ],
1174 ]
1175 );
1176
1177 $this->add_control(
1178 'form_radio_checkbox_bg_color_checked',
1179 [
1180 'label' => __('Background Color', 'fluentform'),
1181 'type' => Controls_Manager::COLOR,
1182 'default' => '',
1183 'selectors' => [
1184 '{{WRAPPER}} .fluentform-widget-custom-radio-checkbox input[type="checkbox"]:checked:after, {{WRAPPER}} .fluentform-widget-custom-radio-checkbox input[type="radio"]:checked:after' => 'background-color: {{VALUE}}',
1185 ],
1186 'condition' => [
1187 'form_custom_radio_checkbox' => 'yes',
1188 ],
1189 ]
1190 );
1191
1192 $this->add_control(
1193 'form_radio_checkbox_border_checked',
1194 [
1195 'label' => __('Border Color', 'fluentform'),
1196 'type' => Controls_Manager::COLOR,
1197 'default' => '',
1198 'selectors' => [
1199 '{{WRAPPER}} .fluentform-widget-custom-radio-checkbox input[type="checkbox"]:checked:after, {{WRAPPER}} .fluentform-widget-custom-radio-checkbox input[type="radio"]:checked:after' => 'border-color: {{VALUE}}',
1200 ],
1201 'condition' => [
1202 'form_custom_radio_checkbox' => 'yes',
1203 ],
1204 ]
1205 );
1206
1207 $this->end_controls_tab();
1208
1209 $this->end_controls_tabs();
1210
1211 $this->end_controls_section();
1212 }
1213
1214 protected function register_section_break_style_controls()
1215 {
1216 $this->start_controls_section(
1217 'form_section_break_style',
1218 [
1219 'label' => __('Section Break', 'fluentform'),
1220 'tab' => Controls_Manager::TAB_STYLE,
1221 ]
1222 );
1223
1224 $this->add_control(
1225 'form_section_break_label',
1226 [
1227 'label' => __('Label', 'fluentform'),
1228 'type' => Controls_Manager::HEADING,
1229 ]
1230 );
1231
1232 $this->add_control(
1233 'form_section_break_label_color',
1234 [
1235 'label' => __('Color', 'fluentform'),
1236 'type' => Controls_Manager::COLOR,
1237 'default' => '',
1238 'selectors' => [
1239 '{{WRAPPER}} .fluentform-widget-wrapper .ff-el-section-break .ff-el-section-title' => 'color: {{VALUE}};',
1240 ],
1241 ]
1242 );
1243
1244 $this->add_group_control(
1245 Group_Control_Typography::get_type(),
1246 [
1247 'name' => 'form_section_break_label_typography',
1248 'label' => __('Typography', 'fluentform'),
1249 'selector' => '.fluentform-widget-wrapper .ff-el-section-break .ff-el-section-title',
1250 'separator' => 'before',
1251 ]
1252 );
1253
1254 $this->add_responsive_control(
1255 'form_section_break_label_padding',
1256 [
1257 'label' => __('Padding', 'fluentform'),
1258 'type' => Controls_Manager::DIMENSIONS,
1259 'size_units' => ['px', 'em', '%'],
1260 'selectors' => [
1261 '{{WRAPPER}} .fluentform-widget-wrapper .ff-el-section-break .ff-el-section-title' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
1262 ],
1263 ]
1264 );
1265
1266 $this->add_responsive_control(
1267 'form_section_break_label_margin',
1268 [
1269 'label' => __('Margin', 'fluentform'),
1270 'type' => Controls_Manager::DIMENSIONS,
1271 'size_units' => ['px', 'em', '%'],
1272 'selectors' => [
1273 '{{WRAPPER}} .fluentform-widget-wrapper .ff-el-section-break .ff-el-section-title' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
1274 ],
1275 ]
1276 );
1277
1278 $this->add_control(
1279 'form_section_break_description',
1280 [
1281 'label' => __('Description', 'fluentform'),
1282 'type' => Controls_Manager::HEADING,
1283 'separator' => 'before',
1284 ]
1285 );
1286
1287 $this->add_control(
1288 'form_section_break_description_color',
1289 [
1290 'label' => __('Color', 'fluentform'),
1291 'type' => Controls_Manager::COLOR,
1292 'default' => '',
1293 'selectors' => [
1294 '{{WRAPPER}} .fluentform-widget-wrapper .ff-el-section-break .ff-section_break_desk' => 'color: {{VALUE}};',
1295 ],
1296 ]
1297 );
1298
1299 $this->add_group_control(
1300 Group_Control_Typography::get_type(),
1301 [
1302 'name' => 'form_section_break_description_typography',
1303 'label' => __('Typography', 'fluentform'),
1304 'selector' => '{{WRAPPER}} .fluentform-widget-wrapper .ff-el-section-break div',
1305 'separator' => 'before',
1306 ]
1307 );
1308
1309 $this->add_responsive_control(
1310 'form_section_break_description_padding',
1311 [
1312 'label' => __('Padding', 'fluentform'),
1313 'type' => Controls_Manager::DIMENSIONS,
1314 'size_units' => ['px', 'em', '%'],
1315 'selectors' => [
1316 '{{WRAPPER}} .fluentform-widget-wrapper .ff-el-section-break .ff-section_break_desk' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
1317 ],
1318 ]
1319 );
1320
1321 $this->add_responsive_control(
1322 'form_section_break_description_margin',
1323 [
1324 'label' => __('Margin', 'fluentform'),
1325 'type' => Controls_Manager::DIMENSIONS,
1326 'size_units' => ['px', 'em', '%'],
1327 'selectors' => [
1328 '{{WRAPPER}} .fluentform-widget-wrapper .ff-el-section-break .ff-section_break_desk' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
1329 ],
1330 ]
1331 );
1332
1333 $this->add_responsive_control(
1334 'form_section_break_alignment',
1335 [
1336 'label' => __('Alignment', 'fluentform'),
1337 'type' => Controls_Manager::CHOOSE,
1338 'options' => [
1339 'left' => [
1340 'title' => __('Left', 'fluentform'),
1341 'icon' => 'eicon-h-align-left',
1342 ],
1343 'center' => [
1344 'title' => __('Center', 'fluentform'),
1345 'icon' => 'eicon-h-align-center',
1346 ],
1347 'right' => [
1348 'title' => __('Right', 'fluentform'),
1349 'icon' => 'eicon-h-align-right',
1350 ],
1351 ],
1352 'prefix_class' => 'fluentform-widget-section-break-content-',
1353 ]
1354 );
1355
1356 $this->end_controls_section();
1357 }
1358
1359 protected function register_checkbox_grid_style_controls()
1360 {
1361 $this->start_controls_section(
1362 'section_form_checkbox_grid',
1363 [
1364 'label' => __('Checkbox Grid', 'fluentform'),
1365 'tab' => Controls_Manager::TAB_STYLE,
1366 ]
1367 );
1368
1369 $this->add_control(
1370 'section_form_checkbox_grid_head',
1371 [
1372 'label' => __('Grid Table Head', 'fluentform'),
1373 'type' => Controls_Manager::HEADING,
1374 'separator' => 'before',
1375 ]
1376 );
1377
1378 $this->add_control(
1379 'form_checkbox_grid_table_head_text_color',
1380 [
1381 'label' => __('Color', 'fluentform'),
1382 'type' => Controls_Manager::COLOR,
1383 'default' => '',
1384 'selectors' => [
1385 '{{WRAPPER}} .fluentform-widget-wrapper .ff-table thead th' => 'color: {{VALUE}};',
1386 ],
1387 ]
1388 );
1389
1390 $this->add_control(
1391 'form_checkbox_grid_table_head_color',
1392 [
1393 'label' => __('Background Color', 'fluentform'),
1394 'type' => Controls_Manager::COLOR,
1395 'default' => '',
1396 'selectors' => [
1397 '{{WRAPPER}} .fluentform-widget-wrapper .ff-table thead th' => 'background-color: {{VALUE}};',
1398 ],
1399 ]
1400 );
1401
1402 $this->add_group_control(
1403 Group_Control_Typography::get_type(),
1404 [
1405 'name' => 'form_checkbox_grid_table_head_typography',
1406 'label' => __('Typography', 'fluentform'),
1407 'selector' => '{{WRAPPER}} .fluentform-widget-wrapper .ff-table thead th',
1408 'separator' => 'before',
1409 ]
1410 );
1411
1412 $this->add_responsive_control(
1413 'form_checkbox_grid_table_head_height',
1414 [
1415 'label' => __('Height', 'fluentform'),
1416 'type' => Controls_Manager::SLIDER,
1417 'range' => [
1418 'px' => [
1419 'min' => 0,
1420 'max' => 1200,
1421 'step' => 1,
1422 ],
1423 ],
1424 'size_units' => ['px', '%'],
1425 'selectors' => [
1426 '{{WRAPPER}} .fluentform-widget-wrapper .ff-table thead th' => 'height: {{SIZE}}{{UNIT}}',
1427 ],
1428 ]
1429 );
1430
1431 $this->add_group_control(
1432 Group_Control_Border::get_type(),
1433 [
1434 'name' => 'form_checkbox_grid_table_head_border',
1435 'label' => __('Border', 'fluentform'),
1436 'default' => '',
1437 'selector' => '{{WRAPPER}} .fluentform-widget-wrapper .ff-table thead tr',
1438 ]
1439 );
1440
1441 $this->add_responsive_control(
1442 'form_checkbox_grid_table_head_padding',
1443 [
1444 'label' => __('Padding', 'fluentform'),
1445 'type' => Controls_Manager::DIMENSIONS,
1446 'size_units' => ['px', 'em', '%'],
1447 'selectors' => [
1448 '{{WRAPPER}} .fluentform-widget-wrapper .ff-table thead th' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
1449 ],
1450 ]
1451 );
1452
1453 $this->add_control(
1454 'form_checkbox_grid_table_item',
1455 [
1456 'label' => __('Grid Table Item', 'fluentform'),
1457 'type' => Controls_Manager::HEADING,
1458 'separator' => 'before',
1459 ]
1460 );
1461
1462 $this->add_control(
1463 'form_checkbox_grid_table_item_color',
1464 [
1465 'label' => __('Color', 'fluentform'),
1466 'type' => Controls_Manager::COLOR,
1467 'default' => '',
1468 'selectors' => [
1469 '{{WRAPPER}} .fluentform-widget-wrapper .ff-table tbody tr td' => 'color: {{VALUE}} !important;',
1470 ],
1471 ]
1472 );
1473
1474 $this->add_control(
1475 'form_checkbox_grid_table_item_bg_color',
1476 [
1477 'label' => __('Background Color', 'fluentform'),
1478 'type' => Controls_Manager::COLOR,
1479 'default' => '',
1480 'selectors' => [
1481 '{{WRAPPER}} .fluentform-widget-wrapper .ff-table tbody tr td' => 'background-color: {{VALUE}};',
1482 ],
1483 ]
1484 );
1485
1486 $this->add_control(
1487 'form_checkbox_grid_table_item_odd_bg_color',
1488 [
1489 'label' => __('Odd Item Background Color', 'fluentform'),
1490 'type' => Controls_Manager::COLOR,
1491 'default' => '',
1492 'selectors' => [
1493 '{{WRAPPER}} .fluentform-widget-wrapper tbody>tr:nth-child(2n)>td' => 'background-color: {{VALUE}} !important;',
1494 ],
1495 ]
1496 );
1497
1498 $this->add_group_control(
1499 Group_Control_Typography::get_type(),
1500 [
1501 'name' => 'form_checkbox_grid_table_item_typography',
1502 'label' => __('Typography', 'fluentform'),
1503 'selector' => '{{WRAPPER}} .fluentform-widget-wrapper .ff-table tbody tr td',
1504 ]
1505 );
1506
1507 $this->add_responsive_control(
1508 'form_checkbox_grid_table_item_height',
1509 [
1510 'label' => __('Height', 'fluentform'),
1511 'type' => Controls_Manager::SLIDER,
1512 'range' => [
1513 'px' => [
1514 'min' => 0,
1515 'max' => 1200,
1516 'step' => 1,
1517 ],
1518 ],
1519 'size_units' => ['px', '%'],
1520 'selectors' => [
1521 '{{WRAPPER}} .fluentform-widget-wrapper .ff-table tbody tr td' => 'height: {{SIZE}}{{UNIT}}',
1522 ],
1523 ]
1524 );
1525
1526 $this->add_group_control(
1527 Group_Control_Border::get_type(),
1528 [
1529 'name' => 'form_checkbox_grid_table_item_border',
1530 'label' => __('Border', 'fluentform'),
1531 'default' => '',
1532 'selector' => '{{WRAPPER}} .fluentform-widget-wrapper .ff-table tbody tr',
1533 ]
1534 );
1535
1536 $this->add_responsive_control(
1537 'form_checkbox_grid_table_item_padding',
1538 [
1539 'label' => __('Padding', 'fluentform'),
1540 'type' => Controls_Manager::DIMENSIONS,
1541 'size_units' => ['px', 'em', '%'],
1542 'selectors' => [
1543 '{{WRAPPER}} .fluentform-widget-wrapper .ff-table tbody tr td' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
1544 ],
1545 ]
1546 );
1547
1548 $this->end_controls_section();
1549 }
1550
1551 protected function register_address_line_style_controls()
1552 {
1553 $this->start_controls_section(
1554 'section_form_address_line_style',
1555 [
1556 'label' => __('Address Line', 'fluentform'),
1557 'tab' => Controls_Manager::TAB_STYLE,
1558 ]
1559 );
1560
1561 $this->add_control(
1562 'address_line_label_color',
1563 [
1564 'label' => __('Label Color', 'fluentform'),
1565 'type' => Controls_Manager::COLOR,
1566 'default' => '',
1567 'selectors' => [
1568 '{{WRAPPER}} .fluentform-widget-wrapper .fluent-address label' => 'color: {{VALUE}};',
1569 ],
1570 ]
1571 );
1572
1573 $this->add_group_control(
1574 Group_Control_Typography::get_type(),
1575 [
1576 'name' => 'address_line_label_typography',
1577 'label' => __('Typography', 'fluentform'),
1578 'selector' => '{{WRAPPER}} .fluentform-widget-wrapper .fluent-address label',
1579 ]
1580 );
1581
1582 $this->end_controls_section();
1583 }
1584
1585 protected function register_image_upload_style_controls()
1586 {
1587 $this->start_controls_section(
1588 'section_form_image_upload_style',
1589 [
1590 'label' => __('Image Upload', 'fluentform'),
1591 'tab' => Controls_Manager::TAB_STYLE,
1592 ]
1593 );
1594
1595 $this->start_controls_tabs('tabs_form_image_upload_button_style');
1596
1597 $this->start_controls_tab(
1598 'tab_form_image_upload_button_normal',
1599 [
1600 'label' => __('Normal', 'fluentform'),
1601 ]
1602 );
1603
1604 $this->add_control(
1605 'form_image_upload_bg_color',
1606 [
1607 'label' => __('Background Color', 'fluentform'),
1608 'type' => Controls_Manager::COLOR,
1609 'default' => '',
1610 'selectors' => [
1611 '{{WRAPPER}} .fluentform-widget-wrapper .ff_upload_btn.ff-btn' => 'background-color: {{VALUE}};',
1612 ],
1613 ]
1614 );
1615
1616 $this->add_group_control(
1617 Group_Control_Border::get_type(),
1618 [
1619 'name' => 'form_image_upload_button_border_normal',
1620 'label' => __('Border', 'fluentform'),
1621 'default' => '',
1622 'selector' => '{{WRAPPER}} .fluentform-widget-wrapper .ff_upload_btn.ff-btn',
1623 ]
1624 );
1625
1626 $this->add_control(
1627 'form_image_upload_button_border_radius',
1628 [
1629 'label' => __('Border Radius', 'fluentform'),
1630 'type' => Controls_Manager::DIMENSIONS,
1631 'size_units' => ['px', 'em', '%'],
1632 'selectors' => [
1633 '{{WRAPPER}} .fluentform-widget-wrapper .ff_upload_btn.ff-btn' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
1634 ],
1635 ]
1636 );
1637
1638 $this->add_responsive_control(
1639 'form_image_upload_button_padding',
1640 [
1641 'label' => __('Padding', 'fluentform'),
1642 'type' => Controls_Manager::DIMENSIONS,
1643 'size_units' => ['px', 'em', '%'],
1644 'selectors' => [
1645 '{{WRAPPER}} .fluentform-widget-wrapper .ff_upload_btn.ff-btn' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
1646 ],
1647 ]
1648 );
1649
1650 $this->add_group_control(
1651 Group_Control_Typography::get_type(),
1652 [
1653 'name' => 'form_image_upload_typography',
1654 'label' => __('Typography', 'fluentform'),
1655 'selector' => '{{WRAPPER}} .fluentform-widget-wrapper .ff_upload_btn.ff-btn',
1656 ]
1657 );
1658
1659 $this->add_group_control(
1660 Group_Control_Box_Shadow::get_type(),
1661 [
1662 'name' => 'form_image_upload_button_box_shadow',
1663 'selector' => '{{WRAPPER}} .fluentform-widget-wrapper .ff_upload_btn.ff-btn',
1664 ]
1665 );
1666
1667 $this->end_controls_tab();
1668
1669 $this->start_controls_tab(
1670 'tab_form_image_upload_button_hover',
1671 [
1672 'label' => __('Hover', 'fluentform'),
1673 ]
1674 );
1675
1676 $this->add_control(
1677 'form_image_upload_button_bg_color_hover',
1678 [
1679 'label' => __('Background Color', 'fluentform'),
1680 'type' => Controls_Manager::COLOR,
1681 'default' => '',
1682 'selectors' => [
1683 '{{WRAPPER}} .fluentform-widget-wrapper .ff_upload_btn.ff-btn:hover' => 'background-color: {{VALUE}} !important;',
1684 ],
1685 ]
1686 );
1687
1688 $this->add_control(
1689 'form_image_upload_button_text_color_hover',
1690 [
1691 'label' => __('Text Color', 'fluentform'),
1692 'type' => Controls_Manager::COLOR,
1693 'default' => '',
1694 'selectors' => [
1695 '{{WRAPPER}} .fluentform-widget-wrapper .ff_upload_btn.ff-btn:hover' => 'color: {{VALUE}} !important;',
1696 ],
1697 ]
1698 );
1699
1700 $this->add_control(
1701 'form_image_upload_button_border_color_hover',
1702 [
1703 'label' => __('Border Color', 'fluentform'),
1704 'type' => Controls_Manager::COLOR,
1705 'default' => '',
1706 'selectors' => [
1707 '{{WRAPPER}} .fluentform-widget-wrapper .ff_upload_btn.ff-btn:hover' => 'border-color: {{VALUE}}',
1708 ],
1709 ]
1710 );
1711
1712 $this->end_controls_tab();
1713
1714 $this->end_controls_tabs();
1715 $this->end_controls_section();
1716 }
1717
1718 protected function register_pagination_style_controls()
1719 {
1720 if (defined('FLUENTFORMPRO')) {
1721 $this->start_controls_section(
1722 'section_form_pagination_style',
1723 [
1724 'label' => __('Pagination', 'fluentform'),
1725 'tab' => Controls_Manager::TAB_STYLE,
1726 ]
1727 );
1728
1729 $this->add_control(
1730 'form_pagination_progressbar_label',
1731 [
1732 'label' => __('Progressbar Label', 'fluentform'),
1733 'type' => Controls_Manager::HEADING,
1734 ]
1735 );
1736
1737 $this->add_control(
1738 'show_label',
1739 [
1740 'label' => __('Show Label', 'fluentform'),
1741 'type' => Controls_Manager::SWITCHER,
1742 'label_on' => __('Show', 'fluentform'),
1743 'label_off' => __('Hide', 'fluentform'),
1744 'return_value' => 'yes',
1745 'default' => 'yes',
1746 'prefix_class' => 'fluent-form-widget-step-header-',
1747 ]
1748 );
1749
1750 $this->add_control(
1751 'form_progressbar_label_color',
1752 [
1753 'label' => __('Label Color', 'fluentform'),
1754 'type' => Controls_Manager::COLOR,
1755 'selectors' => [
1756 '{{WRAPPER}} .ff-el-progress-status' => 'color: {{VALUE}}',
1757 ],
1758 'global' => [
1759 'default' => Global_Colors::COLOR_PRIMARY,
1760 ],
1761 'condition' => [
1762 'show_label' => 'yes',
1763 ],
1764 ]
1765 );
1766
1767 $this->add_group_control(
1768 Group_Control_Typography::get_type(),
1769 [
1770 'name' => 'form_progressbar_label_typography',
1771 'label' => __('Typography', 'fluentform'),
1772 'selector' => '{{WRAPPER}} .ff-el-progress-status',
1773 'global' => [
1774 'default' => Global_Typography::TYPOGRAPHY_PRIMARY
1775 ],
1776 'condition' => [
1777 'show_label' => 'yes',
1778 ],
1779 ]
1780 );
1781
1782 $this->add_control(
1783 'form_progressbar_label_space',
1784 [
1785 'label' => __('Spacing', 'fluentform'),
1786 'type' => Controls_Manager::DIMENSIONS,
1787 'size_units' => ['px', '%', 'em'],
1788 'selectors' => [
1789 '{{WRAPPER}} .ff-el-progress-status' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
1790 ],
1791 'condition' => [
1792 'show_label' => 'yes',
1793 ],
1794 'separator' => 'after',
1795 ]
1796 );
1797
1798 $this->add_control(
1799 'form_pagination_progressbar',
1800 [
1801 'label' => __('Progressbar', 'fluentform'),
1802 'type' => Controls_Manager::HEADING,
1803 ]
1804 );
1805
1806 $this->add_control(
1807 'show_form_progressbar',
1808 [
1809 'label' => __('Show Progressbar', 'fluentform'),
1810 'type' => Controls_Manager::SWITCHER,
1811 'label_on' => __('Show', 'fluentform'),
1812 'label_off' => __('Hide', 'fluentform'),
1813 'return_value' => 'yes',
1814 'default' => 'yes',
1815 'prefix_class' => 'fluent-form-widget-step-progressbar-',
1816 ]
1817 );
1818
1819 $this->start_controls_tabs('form_progressbar_style_tabs');
1820
1821 $this->start_controls_tab(
1822 'form_progressbar_normal',
1823 [
1824 'label' => __('Normal', 'fluentform'),
1825 'condition' => [
1826 'show_form_progressbar' => 'yes',
1827 ],
1828 ]
1829 );
1830
1831 $this->add_group_control(
1832 Group_Control_Background::get_type(),
1833 [
1834 'name' => 'form_progressbar_bg',
1835 'label' => __('Background', 'fluentform'),
1836 'types' => ['classic', 'gradient'],
1837 'selector' => '{{WRAPPER}} .ff-el-progress',
1838 'condition' => [
1839 'show_form_progressbar' => 'yes',
1840 ],
1841 'exclude' => [
1842 'image',
1843 ],
1844 ]
1845 );
1846
1847 $this->add_control(
1848 'form_progressbar_color',
1849 [
1850 'label' => __('Text Color', 'fluentform'),
1851 'type' => Controls_Manager::COLOR,
1852 'selectors' => [
1853 '{{WRAPPER}} .ff-el-progress-bar span' => 'color: {{VALUE}};',
1854 ],
1855 'global' => [
1856 'default' => Global_Colors::COLOR_PRIMARY
1857 ],
1858 'condition' => [
1859 'show_form_progressbar' => 'yes',
1860 ],
1861 ]
1862 );
1863
1864 $this->add_control(
1865 'form_progressbar_height',
1866 [
1867 'label' => __('Height', 'fluentform'),
1868 'type' => Controls_Manager::SLIDER,
1869 'size_units' => ['px'],
1870 'range' => [
1871 'px' => [
1872 'min' => 0,
1873 'max' => 100,
1874 'step' => 1,
1875 ],
1876 ],
1877 'selectors' => [
1878 '{{WRAPPER}} .ff-el-progress' => 'height: {{SIZE}}{{UNIT}};',
1879 ],
1880 'condition' => [
1881 'show_form_progressbar' => 'yes',
1882 ],
1883 ]
1884 );
1885
1886 $this->add_group_control(
1887 Group_Control_Border::get_type(),
1888 [
1889 'name' => 'form_progressbar_border',
1890 'label' => __('Border', 'fluentform'),
1891 'selector' => '{{WRAPPER}} .ff-el-progress',
1892 'condition' => [
1893 'show_form_progressbar' => 'yes',
1894 ],
1895 ]
1896 );
1897
1898 $this->add_control(
1899 'form_progressbar_border_radius',
1900 [
1901 'label' => __('Border Radius', 'fluentform'),
1902 'type' => Controls_Manager::DIMENSIONS,
1903 'size_units' => ['px', '%', 'em'],
1904 'selectors' => [
1905 '{{WRAPPER}} .ff-el-progress' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
1906 ],
1907 'condition' => [
1908 'show_form_progressbar' => 'yes',
1909 ],
1910 ]
1911 );
1912
1913 $this->end_controls_tab();
1914
1915 $this->start_controls_tab(
1916 'form_progressbar_filled',
1917 [
1918 'label' => __('Filled', 'fluentform'),
1919 'condition' => [
1920 'show_form_progressbar' => 'yes',
1921 ],
1922 ]
1923 );
1924
1925 $this->add_group_control(
1926 Group_Control_Background::get_type(),
1927 [
1928 'name' => 'form_progressbar_bg_filled',
1929 'label' => __('Background', 'fluentform'),
1930 'types' => ['classic', 'gradient'],
1931 'selector' => '{{WRAPPER}} .ff-el-progress-bar',
1932 'condition' => [
1933 'show_form_progressbar' => 'yes',
1934 ],
1935 'exclude' => [
1936 'image',
1937 ],
1938 ]
1939 );
1940
1941 $this->end_controls_tab();
1942
1943 $this->end_controls_tabs();
1944
1945 $this->add_control(
1946 'form_pagination_button_style',
1947 [
1948 'label' => __('Button', 'fluentform'),
1949 'type' => Controls_Manager::HEADING,
1950 'separator' => 'before',
1951 ]
1952 );
1953
1954 $this->start_controls_tabs(
1955 'form_pagination_button_style_tabs'
1956 );
1957
1958 $this->start_controls_tab(
1959 'form_pagination_button',
1960 [
1961 'label' => __('Normal', 'fluentform'),
1962 ]
1963 );
1964
1965 $this->add_control(
1966 'form_pagination_button_color',
1967 [
1968 'label' => __('Color', 'fluentform'),
1969 'type' => Controls_Manager::COLOR,
1970 'selectors' => [
1971 '{{WRAPPER}} .step-nav button' => 'color: {{VALUE}};',
1972 ],
1973 ]
1974 );
1975
1976 $this->add_group_control(
1977 Group_Control_Typography::get_type(),
1978 [
1979 'name' => 'form_pagination_button_typography',
1980 'label' => __('Typography', 'fluentform'),
1981 'selector' => '{{WRAPPER}} .step-nav button',
1982 'global' => [
1983 'default' => Global_Typography::TYPOGRAPHY_PRIMARY,
1984 ]
1985 ]
1986 );
1987
1988 $this->add_group_control(
1989 Group_Control_Background::get_type(),
1990 [
1991 'name' => 'form_pagination_button_bg',
1992 'label' => __('Background', 'fluentform'),
1993 'types' => ['classic', 'gradient'],
1994 'selector' => '{{WRAPPER}} .step-nav button',
1995 ]
1996 );
1997
1998 $this->add_group_control(
1999 Group_Control_Border::get_type(),
2000 [
2001 'name' => 'form_pagination_button_border',
2002 'label' => __('Border', 'fluentform'),
2003 'selector' => '{{WRAPPER}} .step-nav button',
2004 ]
2005 );
2006
2007 $this->add_control(
2008 'form_pagination_button_border_radius',
2009 [
2010 'label' => __('Border Radius', 'fluentform'),
2011 'type' => Controls_Manager::DIMENSIONS,
2012 'size_units' => ['px', '%', 'em'],
2013 'selectors' => [
2014 '{{WRAPPER}} .step-nav button' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
2015 ],
2016 ]
2017 );
2018
2019 $this->add_control(
2020 'form_pagination_button_padding',
2021 [
2022 'label' => __('Padding', 'fluentform'),
2023 'type' => Controls_Manager::DIMENSIONS,
2024 'size_units' => ['px', '%', 'em'],
2025 'selectors' => [
2026 '{{WRAPPER}} .step-nav button' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
2027 ],
2028 ]
2029 );
2030
2031 $this->end_controls_tab();
2032
2033 $this->start_controls_tab(
2034 'form_pagination_button_hover',
2035 [
2036 'label' => __('Hover', 'fluentform'),
2037 ]
2038 );
2039
2040 $this->add_control(
2041 'form_pagination_button_hover_color',
2042 [
2043 'label' => __('Color', 'fluentform'),
2044 'type' => Controls_Manager::COLOR,
2045 'selectors' => [
2046 '{{WRAPPER}} .step-nav button:hover' => 'color: {{VALUE}};',
2047 ],
2048 ]
2049 );
2050
2051 $this->add_group_control(
2052 Group_Control_Background::get_type(),
2053 [
2054 'name' => 'form_pagination_button_hover_bg',
2055 'label' => __('Background', 'fluentform'),
2056 'types' => ['classic', 'gradient'],
2057 'selector' => '{{WRAPPER}} .step-nav button:hover',
2058 ]
2059 );
2060
2061 $this->add_control(
2062 'form_pagination_button_border_hover_color',
2063 [
2064 'label' => __('Border Color', 'fluentform'),
2065 'type' => Controls_Manager::COLOR,
2066 'selectors' => [
2067 '{{WRAPPER}} .step-nav button:hover' => 'border-color: {{VALUE}};',
2068 ],
2069 ]
2070 );
2071
2072 $this->add_control(
2073 'form_pagination_button_border_hover_radius',
2074 [
2075 'label' => __('Border Radius', 'fluentform'),
2076 'type' => Controls_Manager::DIMENSIONS,
2077 'size_units' => ['px', '%', 'em'],
2078 'selectors' => [
2079 '{{WRAPPER}} .step-nav button:hover' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
2080 ],
2081 ]
2082 );
2083
2084 $this->end_controls_tab();
2085
2086 $this->end_controls_tabs();
2087
2088 $this->end_controls_section();
2089 }
2090 }
2091
2092 protected function register_submit_button_style_controls()
2093 {
2094 $this->start_controls_section(
2095 'section_form_submit_button_style',
2096 [
2097 'label' => __('Submit Button', 'fluentform'),
2098 'tab' => Controls_Manager::TAB_STYLE,
2099 ]
2100 );
2101
2102 $this->add_responsive_control(
2103 'form_submit_button_align',
2104 [
2105 'label' => __('Alignment', 'fluentform'),
2106 'type' => Controls_Manager::CHOOSE,
2107 'options' => [
2108 'left' => [
2109 'title' => __('Left', 'fluentform'),
2110 'icon' => 'eicon-h-align-left',
2111 ],
2112 'center' => [
2113 'title' => __('Center', 'fluentform'),
2114 'icon' => 'eicon-h-align-center',
2115 ],
2116 'right' => [
2117 'title' => __('Right', 'fluentform'),
2118 'icon' => 'eicon-h-align-right',
2119 ],
2120 ],
2121 'default' => '',
2122 'prefix_class' => 'fluentform-widget-submit-button-',
2123 'condition' => [
2124 'form_submit_button_width_type' => 'custom',
2125 ],
2126 ]
2127 );
2128
2129 $this->add_control(
2130 'form_submit_button_width_type',
2131 [
2132 'label' => __('Width', 'fluentform'),
2133 'type' => Controls_Manager::SELECT,
2134 'default' => 'custom',
2135 'options' => [
2136 'full-width' => __('Full Width', 'fluentform'),
2137 'custom' => __('Custom', 'fluentform'),
2138 ],
2139 'prefix_class' => 'fluentform-widget-submit-button-',
2140 ]
2141 );
2142
2143 $this->add_responsive_control(
2144 'form_submit_button_width',
2145 [
2146 'label' => __('Width', 'fluentform'),
2147 'type' => Controls_Manager::SLIDER,
2148 'range' => [
2149 'px' => [
2150 'min' => 0,
2151 'max' => 1200,
2152 'step' => 1,
2153 ],
2154 ],
2155 'size_units' => ['px', '%'],
2156 'selectors' => [
2157 '{{WRAPPER}} .fluentform-widget-wrapper .ff-el-group .ff-btn-submit' => 'width: {{SIZE}}{{UNIT}}', ],
2158 'condition' => [
2159 'form_submit_button_width_type' => 'custom',
2160 ],
2161 ]
2162 );
2163
2164 $this->start_controls_tabs('tabs_submit_button_style');
2165
2166 $this->start_controls_tab(
2167 'tab_submit_button_normal',
2168 [
2169 'label' => __('Normal', 'fluentform'),
2170 ]
2171 );
2172
2173 $this->add_control(
2174 'form_submit_button_bg_color_normal',
2175 [
2176 'label' => __('Background Color', 'fluentform'),
2177 'type' => Controls_Manager::COLOR,
2178 'default' => '#1a7efb',
2179 'selectors' => [
2180 '{{WRAPPER}} .fluentform-widget-wrapper .ff-el-group .ff-btn-submit' => 'background-color: {{VALUE}} !important;',
2181 ],
2182 ]
2183 );
2184
2185 $this->add_control(
2186 'form_submit_button_text_color_normal',
2187 [
2188 'label' => __('Text Color', 'fluentform'),
2189 'type' => Controls_Manager::COLOR,
2190 'default' => '#ffffff',
2191 'selectors' => [
2192 '{{WRAPPER}} .fluentform-widget-wrapper .ff-el-group .ff-btn-submit' => 'color: {{VALUE}} !important;',
2193 ],
2194 ]
2195 );
2196
2197 $this->add_group_control(
2198 Group_Control_Border::get_type(),
2199 [
2200 'name' => 'form_submit_button_border_normal',
2201 'label' => __('Border', 'fluentform'),
2202 'placeholder' => '1px',
2203 'default' => '1px',
2204 'selector' => '{{WRAPPER}} .fluentform-widget-wrapper .ff-el-group .ff-btn-submit',
2205 ]
2206 );
2207
2208 $this->add_control(
2209 'form_submit_button_border_radius',
2210 [
2211 'label' => __('Border Radius', 'fluentform'),
2212 'type' => Controls_Manager::DIMENSIONS,
2213 'size_units' => ['px', 'em', '%'],
2214 'selectors' => [
2215 '{{WRAPPER}} .fluentform-widget-wrapper .ff-el-group .ff-btn-submit' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
2216 ],
2217 ]
2218 );
2219
2220 $this->add_responsive_control(
2221 'form_submit_button_padding',
2222 [
2223 'label' => __('Padding', 'fluentform'),
2224 'type' => Controls_Manager::DIMENSIONS,
2225 'size_units' => ['px', 'em', '%'],
2226 'selectors' => [
2227 '{{WRAPPER}} .fluentform-widget-wrapper .ff-el-group .ff-btn-submit' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
2228 ],
2229 ]
2230 );
2231
2232 $this->add_responsive_control(
2233 'form_submit_button_margin',
2234 [
2235 'label' => __('Margin Top', 'fluentform'),
2236 'type' => Controls_Manager::SLIDER,
2237 'range' => [
2238 'px' => [
2239 'min' => 0,
2240 'max' => 150,
2241 'step' => 1,
2242 ],
2243 ],
2244 'size_units' => ['px', 'em', '%'],
2245 'selectors' => [
2246 '{{WRAPPER}} .fluentform-widget-wrapper .ff-el-group .ff-btn-submit' => 'margin-top: {{SIZE}}{{UNIT}}',
2247 ],
2248 ]
2249 );
2250
2251 $this->add_group_control(
2252 Group_Control_Typography::get_type(),
2253 [
2254 'name' => 'form_submit_button_typography',
2255 'label' => __('Typography', 'fluentform'),
2256 'selector' => '{{WRAPPER}} .fluentform-widget-wrapper .ff-el-group .ff-btn-submit',
2257 'separator' => 'before',
2258 ]
2259 );
2260
2261 $this->add_group_control(
2262 Group_Control_Box_Shadow::get_type(),
2263 [
2264 'name' => 'form_submit_button_box_shadow',
2265 'selector' => '{{WRAPPER}} .fluentform-widget-wrapper .ff-el-group .ff-btn-submit',
2266 'separator' => 'before',
2267 ]
2268 );
2269
2270 $this->end_controls_tab();
2271
2272 $this->start_controls_tab(
2273 'tab_submit_button_hover',
2274 [
2275 'label' => __('Hover', 'fluentform'),
2276 ]
2277 );
2278
2279 $this->add_control(
2280 'form_submit_button_bg_color_hover',
2281 [
2282 'label' => __('Background Color', 'fluentform'),
2283 'type' => Controls_Manager::COLOR,
2284 'default' => '',
2285 'selectors' => [
2286 '{{WRAPPER}} .fluentform-widget-wrapper .ff-el-group .ff-btn-submit:hover' => 'background-color: {{VALUE}} !important;',
2287 ],
2288 ]
2289 );
2290
2291 $this->add_control(
2292 'form_submit_button_text_color_hover',
2293 [
2294 'label' => __('Text Color', 'fluentform'),
2295 'type' => Controls_Manager::COLOR,
2296 'default' => '',
2297 'selectors' => [
2298 '{{WRAPPER}} .fluentform-widget-wrapper .ff-el-group .ff-btn-submit:hover' => 'color: {{VALUE}} !important;',
2299 ],
2300 ]
2301 );
2302
2303 $this->add_control(
2304 'form_submit_button_border_color_hover',
2305 [
2306 'label' => __('Border Color', 'fluentform'),
2307 'type' => Controls_Manager::COLOR,
2308 'default' => '',
2309 'selectors' => [
2310 '{{WRAPPER}} .fluentform-widget-wrapper .ff-el-group .ff-btn-submit:hover' => 'border-color: {{VALUE}}',
2311 ],
2312 ]
2313 );
2314
2315 $this->end_controls_tab();
2316
2317 $this->end_controls_tabs();
2318
2319 $this->end_controls_section();
2320 }
2321
2322 protected function register_success_message_style_controls()
2323 {
2324 $this->start_controls_section(
2325 'section_form_success_message_style',
2326 [
2327 'label' => __('Success Message', 'fluentform'),
2328 'tab' => Controls_Manager::TAB_STYLE,
2329 ]
2330 );
2331
2332 $this->add_control(
2333 'form_success_message_bg_color',
2334 [
2335 'label' => __('Background Color', 'fluentform'),
2336 'type' => Controls_Manager::COLOR,
2337 'selectors' => [
2338 '{{WRAPPER}} .fluentform-widget-wrapper .ff-message-success' => 'background-color: {{VALUE}}',
2339 ],
2340 ]
2341 );
2342
2343 $this->add_control(
2344 'form_success_message_text_color',
2345 [
2346 'label' => __('Text Color', 'fluentform'),
2347 'type' => Controls_Manager::COLOR,
2348 'selectors' => [
2349 '{{WRAPPER}} .fluentform-widget-wrapper .ff-message-success' => 'color: {{VALUE}}',
2350 ],
2351 ]
2352 );
2353
2354 $this->add_group_control(
2355 Group_Control_Border::get_type(),
2356 [
2357 'name' => 'form_success_message_border',
2358 'label' => __('Border', 'fluentform'),
2359 'placeholder' => '1px',
2360 'default' => '1px',
2361 'selector' => '{{WRAPPER}} .fluentform-widget-wrapper .ff-message-success',
2362 ]
2363 );
2364
2365 $this->add_group_control(
2366 Group_Control_Typography::get_type(),
2367 [
2368 'name' => 'form_success_message_typography',
2369 'label' => __('Typography', 'fluentform'),
2370 'selector' => '{{WRAPPER}} .fluentform-widget-wrapper .ff-message-success',
2371 ]
2372 );
2373
2374 $this->end_controls_section();
2375 }
2376
2377 protected function register_errors_style_controls()
2378 {
2379 $this->start_controls_section(
2380 'section_form_error_style',
2381 [
2382 'label' => __('Error Message', 'fluentform'),
2383 'tab' => Controls_Manager::TAB_STYLE,
2384 ]
2385 );
2386
2387 $this->add_control(
2388 'form_error_message_text_color',
2389 [
2390 'label' => __('Color', 'fluentform'),
2391 'type' => Controls_Manager::COLOR,
2392 'default' => '',
2393 'selectors' => [
2394 '{{WRAPPER}} .fluentform-widget-wrapper .error.text-danger' => 'color: {{VALUE}}',
2395 ],
2396 ]
2397 );
2398
2399 $this->add_group_control(
2400 Group_Control_Typography::get_type(),
2401 [
2402 'name' => 'form_error_message_typography',
2403 'label' => __('Typography', 'fluentform'),
2404 'selector' => '{{WRAPPER}} .fluentform-widget-wrapper .error.text-danger',
2405 ]
2406 );
2407
2408 $this->add_responsive_control(
2409 'form_error_message_padding',
2410 [
2411 'label' => __('Padding', 'fluentform'),
2412 'type' => Controls_Manager::DIMENSIONS,
2413 'size_units' => ['px', 'em', '%'],
2414 'selectors' => [
2415 '{{WRAPPER}} .fluentform-widget-wrapper .error.text-danger' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
2416 ],
2417 ]
2418 );
2419
2420 $this->add_responsive_control(
2421 'form_error_message_margin',
2422 [
2423 'label' => __('Margin', 'fluentform'),
2424 'type' => Controls_Manager::DIMENSIONS,
2425 'size_units' => ['px', 'em', '%'],
2426 'selectors' => [
2427 '{{WRAPPER}} .fluentform-widget-wrapper .error.text-danger' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
2428 ],
2429 ]
2430 );
2431
2432 $this->end_controls_section();
2433 }
2434
2435 /**
2436 * Render the widget output on the frontend.
2437 *
2438 * Written in PHP and used to generate the final HTML.
2439 *
2440 * @since 1.0.0
2441 *
2442 * @access protected
2443 */
2444 protected function render()
2445 {
2446 $settings = $this->get_settings_for_display();
2447 extract($settings);
2448
2449 $this->add_render_attribute(
2450 'fluentform_widget_wrapper',
2451 [
2452 'class' => [
2453 'fluentform-widget-wrapper',
2454 ],
2455 ]
2456 );
2457
2458 if ('yes' != $placeholder_switch) {
2459 $this->add_render_attribute('fluentform_widget_wrapper', 'class', 'hide-placeholder');
2460 }
2461
2462 if ('yes' != $labels_switch) {
2463 $this->add_render_attribute('fluentform_widget_wrapper', 'class', 'hide-fluent-form-labels');
2464 }
2465
2466 if ('no' == $error_messages) {
2467 $this->add_render_attribute('fluentform_widget_wrapper', 'class', 'hide-error-message');
2468 }
2469
2470 if ('yes' == $form_custom_radio_checkbox) {
2471 $this->add_render_attribute('fluentform_widget_wrapper', 'class', 'fluentform-widget-custom-radio-checkbox');
2472 }
2473
2474 if ($form_container_alignment) {
2475 $this->add_render_attribute('fluentform_widget_wrapper', 'class', 'fluentform-widget-align-' . $form_container_alignment . '');
2476 }
2477
2478 if (!empty($form_list)) { ?>
2479
2480 <div <?php echo wp_kses_post($this->get_render_attribute_string('fluentform_widget_wrapper')); ?>>
2481
2482 <?php if ('yes' == $custom_title_description) { ?>
2483 <div class="fluentform-widget-heading">
2484 <?php if ('' != $form_title_custom) { ?>
2485 <h3 class="fluentform-widget-title">
2486 <?php echo esc_attr($form_title_custom); ?>
2487 </h3>
2488 <?php } ?>
2489 <?php if ('' != $form_description_custom) { ?>
2490 <p class="fluentform-widget-description">
2491 <?php echo wp_kses_post($this->parse_text_editor($form_description_custom)); ?>
2492 </p>
2493 <?php } ?>
2494 </div>
2495 <?php } ?>
2496
2497 <?php echo do_shortcode('[fluentform id="' . $form_list . '"]'); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- $form_list is escaped before being passed in.?>
2498 </div>
2499
2500 <?php
2501 }
2502 }
2503
2504 /**
2505 * Render the widget output in the editor.
2506 *
2507 * Written as a Backbone JavaScript template and used to generate the live preview.
2508 *
2509 * @since 1.0.0
2510 *
2511 * @access protected
2512 */
2513 protected function content_template()
2514 {
2515 }
2516 }
2517