PluginProbe
Fluent Forms – Customizable Contact Forms, Survey, Quiz, & Conversational Form Builder / 6.2.14
Fluent Forms – Customizable Contact Forms, Survey, Quiz, & Conversational Form Builder v6.2.14
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 6.2.14, at app/Modules/Widgets/FluentFormWidget.php

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