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

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