PluginProbe ʕ •ᴥ•ʔ
JetFormBuilder — Dynamic Blocks Form Builder / 3.5.6.3
JetFormBuilder — Dynamic Blocks Form Builder v3.5.6.3
3.6.3.1 3.6.3 3.6.2.2 3.6.2.1 3.6.2 3.6.1.1 3.6.1 3.6.0.1 trunk 1.0.0 1.0.1 1.0.2 1.0.3 1.1.0 1.1.1 1.1.2 1.1.3 1.1.4 1.1.5 1.1.6 1.1.7 1.2.0 1.2.1 1.2.2 1.2.3 1.2.4 1.2.5 1.2.6 1.2.7 1.3.0 1.3.1 1.3.2 1.3.3 1.4.0 1.4.1 1.4.2 1.4.3 1.5.0 1.5.1 1.5.2 1.5.3 1.5.4 1.5.5 2.0.0 2.0.1 2.0.2 2.0.3 2.0.4 2.0.5 2.0.6 2.1.0 2.1.1 2.1.10 2.1.11 2.1.2 2.1.3 2.1.4 2.1.5 2.1.6 2.1.7 2.1.8 2.1.9 3.0.0 3.0.0.1 3.0.0.2 3.0.0.3 3.0.1 3.0.1.1 3.0.2 3.0.3 3.0.4 3.0.5 3.0.6 3.0.7 3.0.8 3.0.9 3.1.0 3.1.0.1 3.1.1 3.1.2 3.1.3 3.1.4 3.1.5 3.1.6 3.1.7 3.1.8 3.1.9 3.2.0 3.2.1 3.2.2 3.2.3 3.3.0 3.3.1 3.3.2 3.3.3 3.3.3.1 3.3.4 3.3.4.1 3.3.4.2 3.4.0 3.4.1 3.4.2 3.4.3 3.4.4 3.4.5 3.4.5.1 3.4.5.2 3.4.6 3.4.7 3.4.7.1 3.5.0 3.5.1 3.5.1.1 3.5.1.2 3.5.2 3.5.2.1 3.5.3 3.5.4 3.5.5 3.5.6 3.5.6.1 3.5.6.2 3.5.6.3 3.6.0
jetformbuilder / compatibility / bricks / widgets / form.php
jetformbuilder / compatibility / bricks / widgets Last commit date
base.php 1 year ago form.php 8 months ago widget-base-it.php 2 years ago
form.php
2694 lines
1 <?php
2
3
4 namespace JFB_Compatibility\Bricks\Widgets;
5
6 use Jet_Form_Builder\Blocks;
7 use Jet_Form_Builder\Plugin;
8 use Jet_Form_Builder\Classes\Tools;
9 use Jet_Form_Builder\Classes\Arguments\Form_Arguments;
10
11 // If this file is called directly, abort.
12 if ( ! defined( 'WPINC' ) ) {
13 die;
14 }
15
16 class Form extends Base {
17
18 /**
19 * Use predefined element category 'general'
20 *
21 * @var string
22 */
23 public $category = 'jet-form-builder';
24 /**
25 * Make sure to prefix your elements
26 *
27 * @var string
28 */
29 public $name = 'jet-form-builder-form';
30 /**
31 * Themify icon font class
32 *
33 * @var string
34 */
35 public $icon = 'jet-form-builder-icon-forms';
36 /**
37 * Default CSS selector
38 *
39 * @var string
40 */
41 public $css_selector = '';
42 /**
43 * Script(s) run when element is rendered on frontend or updated in builder
44 *
45 * @var array
46 */
47 public $scripts = array();
48
49 // Return localised element label
50 public function get_label() {
51 return esc_html__( 'JetForm', 'jet-form-builder' );
52 }
53
54 // Set builder control groups
55 public function set_control_groups() {
56 $this->control_group_form_settings();
57 $this->control_group_form_style();
58 $this->control_group_label_style();
59 $this->control_group_description_style();
60 $this->control_group_input_style();
61 $this->control_group_checkradio_style();
62 $this->control_group_calc_fields_style();
63 $this->control_group_range_fields_style();
64 $this->control_group_heading_style();
65 $this->control_group_repeater_style();
66 $this->control_group_conditional_style();
67 $this->control_group_submit_style();
68 $this->control_group_form_break_style();
69 $this->control_group_form_break_buttons_style();
70 $this->control_group_form_break_message_style();
71 $this->control_group_form_progress_wrap_style();
72 $this->control_group_form_progress_pages_style();
73 $this->control_group_message_style();
74 }
75
76 // Set builder controls
77 public function set_controls() {
78 $this->controls_form_settings();
79 $this->controls_form_style();
80 $this->controls_label_style();
81 $this->controls_description_style();
82 $this->controls_input_style();
83 $this->controls_checkradio_style();
84 $this->controls_calc_fields_style();
85 $this->controls_range_fields_style();
86 $this->controls_heading_style();
87 $this->controls_repeater_style();
88 $this->controls_conditional_style();
89 $this->controls_submit_style();
90 $this->controls_form_break_style();
91 $this->controls_form_break_buttons_style();
92 $this->controls_form_break_message_style();
93 $this->controls_form_progress_wrap_style();
94 $this->controls_form_progress_pages_style();
95 $this->controls_message_style();
96 }
97
98 // Start form settings
99 public function control_group_form_settings() {
100 $this->register_jet_control_group(
101 'form_settings',
102 array(
103 'title' => esc_html__( 'Form settings', 'jet-form-builder' ),
104 'tab' => 'content',
105 )
106 );
107 }
108
109 public function controls_form_settings() {
110 $options = Form_Arguments::get_options( true );
111
112 $this->start_jet_control_group( 'form_settings' );
113
114 $this->register_jet_control(
115 'form_id',
116 array(
117 'tab' => 'content',
118 'label' => esc_html__( 'Choose Form', 'jet-form-builder' ),
119 'type' => 'select',
120 'options' => Tools::get_forms_list_for_js( true ),
121 'searchable' => true,
122 )
123 );
124
125 $this->register_jet_control(
126 'form_id_custom',
127 array(
128 'tab' => 'content',
129 'label' => esc_html__( 'Form ID', 'jet-form-builder' ),
130 'type' => 'text',
131 'default' => '',
132 'hasDynamicData' => true,
133 'required' => array( 'form_id', '=', 'manual_form_id' ),
134 )
135 );
136
137 $this->register_jet_control(
138 'fields_layout',
139 array(
140 'tab' => 'content',
141 'label' => esc_html__( 'Fields Layout', 'jet-form-builder' ),
142 'type' => 'select',
143 'options' => $options['fields_layout'],
144 )
145 );
146
147 $this->register_jet_control(
148 'required_mark',
149 array(
150 'tab' => 'content',
151 'label' => esc_html__( 'Required Mark', 'jet-form-builder' ),
152 'type' => 'text',
153 'default' => esc_html__( '*', 'jet-form-builder' ),
154 'hasDynamicData' => false,
155 )
156 );
157
158 $this->register_jet_control(
159 'fields_label_tag',
160 array(
161 'tab' => 'content',
162 'label' => esc_html__( 'Fields label HTML tag', 'jet-form-builder' ),
163 'type' => 'select',
164 'options' => $options['fields_label_tag'],
165 )
166 );
167
168 $this->register_jet_control(
169 'markup_type',
170 array(
171 'tab' => 'content',
172 'label' => esc_html__( 'Markup type', 'jet-form-builder' ),
173 'type' => 'select',
174 'options' => $options['markup_type'],
175 )
176 );
177
178 $this->register_jet_control(
179 'submit_type',
180 array(
181 'tab' => 'content',
182 'label' => esc_html__( 'Submit Type', 'jet-form-builder' ),
183 'type' => 'select',
184 'options' => $options['submit_type'],
185 )
186 );
187
188 $this->register_jet_control(
189 'enable_progress',
190 array(
191 'tab' => 'content',
192 'label' => esc_html__( 'Enable form pages progress', 'jet-form-builder' ),
193 'type' => 'checkbox',
194 'default' => false,
195 )
196 );
197
198 $this->register_jet_control(
199 'clear',
200 array(
201 'tab' => 'content',
202 'label' => esc_html__( 'Clear data on success submit', 'jet-form-builder' ),
203 'type' => 'checkbox',
204 'default' => false,
205 )
206 );
207
208 $this->end_jet_control_group();
209 }
210 // End form settings
211
212 // Start form style
213 public function control_group_form_style() {
214 $this->register_jet_control_group(
215 'form_style',
216 array(
217 'title' => esc_html__( 'Form Row', 'jet-form-builder' ),
218 'tab' => 'style',
219 )
220 );
221 }
222
223 public function controls_form_style() {
224 $this->start_jet_control_group( 'form_style' );
225
226 $this->register_jet_control(
227 'form_row_gap_before',
228 array(
229 'tab' => 'style',
230 'label' => esc_html__( 'Gap Before', 'jet-form-builder' ),
231 'type' => 'number',
232 'units' => true,
233 'min' => 1,
234 'max' => 100,
235 'css' => array( array( 'property' => '--jfb-row-mt' ) ),
236 )
237 );
238
239 $this->register_jet_control(
240 'form_row_gap_after',
241 array(
242 'tab' => 'style',
243 'label' => esc_html__( 'Gap After', 'jet-form-builder' ),
244 'type' => 'number',
245 'units' => true,
246 'min' => 1,
247 'max' => 100,
248 'css' => array( array( 'property' => '--jfb-row-mb' ) ),
249 )
250 );
251
252 $this->end_jet_control_group();
253 }
254 // End form style
255
256 // Start label style
257 public function control_group_label_style() {
258 $this->register_jet_control_group(
259 'section_label_style',
260 array(
261 'title' => esc_html__( 'Label', 'jet-form-builder' ),
262 'tab' => 'style',
263 )
264 );
265 }
266
267 public function controls_label_style() {
268 $this->start_jet_control_group( 'section_label_style' );
269
270 $css_selectors = array(
271 'label' => $this->css_selector( '__label' ),
272 'label-text' => $this->css_selector( '__label' ) . ' ' . $this->css_selector( '__label-text' ),
273 );
274
275 $this->register_jet_control(
276 'label_typography',
277 array(
278 'tab' => 'style',
279 'label' => esc_html__( 'Typography', 'jet-form-builder' ),
280 'type' => 'typography',
281 'css' => array(
282 array(
283 'property' => 'typography',
284 'selector' => $css_selectors['label-text'],
285 ),
286 ),
287 )
288 );
289
290 $this->register_jet_control(
291 'label_bg_color',
292 array(
293 'tab' => 'style',
294 'label' => esc_html__( 'Background color', 'jet-form-builder' ),
295 'type' => 'color',
296 'css' => array( array( 'property' => '--jfb-label-bgc' ) ),
297 )
298 );
299
300 $this->register_jet_control(
301 'label_margin',
302 array(
303 'tab' => 'style',
304 'label' => esc_html__( 'Margin', 'jet-form-builder' ),
305 'type' => 'dimensions',
306 'css' => array(
307 array(
308 'property' => 'margin',
309 'selector' => $css_selectors['label'],
310 ),
311 ),
312 )
313 );
314
315 $this->register_jet_control(
316 'label_padding',
317 array(
318 'tab' => 'style',
319 'label' => esc_html__( 'Padding', 'jet-form-builder' ),
320 'type' => 'dimensions',
321 'css' => array(
322 array(
323 'property' => 'padding',
324 'selector' => $css_selectors['label'],
325 ),
326 ),
327 )
328 );
329
330 $this->register_jet_control(
331 'label_border',
332 array(
333 'tab' => 'style',
334 'label' => esc_html__( 'Border', 'jet-form-builder' ),
335 'type' => 'border',
336 'css' => array(
337 array(
338 'property' => 'border',
339 'selector' => $css_selectors['label'],
340 ),
341 ),
342 )
343 );
344
345 $this->register_jet_control(
346 'form_required_mark',
347 array(
348 'tab' => 'style',
349 'type' => 'separator',
350 'label' => esc_html__( 'Required Mark', 'jet-form-builder' ),
351 )
352 );
353
354 $this->register_jet_control(
355 'form_required_typography',
356 array(
357 'tab' => 'style',
358 'label' => esc_html__( 'Typography', 'jet-form-builder' ),
359 'type' => 'typography',
360 'css' => array(
361 array(
362 'property' => 'typography',
363 'selector' => $this->css_selector( '__required' ),
364 ),
365 ),
366 )
367 );
368
369 $this->end_jet_control_group();
370 }
371 // End label style
372
373 // Start description style
374 public function control_group_description_style() {
375 $this->register_jet_control_group(
376 'section_description_style',
377 array(
378 'title' => esc_html__( 'Description', 'jet-form-builder' ),
379 'tab' => 'style',
380 )
381 );
382 }
383
384 public function controls_description_style() {
385 $this->start_jet_control_group( 'section_description_style' );
386
387 $css_selector = $this->css_selector( '__desc' );
388
389 $this->register_jet_control(
390 'description_typography',
391 array(
392 'tab' => 'style',
393 'label' => esc_html__( 'Typography', 'jet-form-builder' ),
394 'type' => 'typography',
395 'css' => array(
396 array(
397 'property' => 'typography',
398 'selector' => $css_selector,
399 ),
400 ),
401 )
402 );
403
404 $this->register_jet_control(
405 'description_bg_color',
406 array(
407 'tab' => 'style',
408 'label' => esc_html__( 'Background color', 'jet-form-builder' ),
409 'type' => 'color',
410 'css' => array( array( 'property' => '--jfb-desc-bgc' ) ),
411 )
412 );
413
414 $this->register_jet_control(
415 'description_margin',
416 array(
417 'tab' => 'style',
418 'label' => esc_html__( 'Margin', 'jet-form-builder' ),
419 'type' => 'dimensions',
420 'css' => array(
421 array(
422 'property' => 'margin',
423 'selector' => $css_selector,
424 ),
425 ),
426 )
427 );
428
429 $this->register_jet_control(
430 'description_padding',
431 array(
432 'tab' => 'style',
433 'label' => esc_html__( 'Padding', 'jet-form-builder' ),
434 'type' => 'dimensions',
435 'css' => array(
436 array(
437 'property' => 'padding',
438 'selector' => $css_selector,
439 ),
440 ),
441 )
442 );
443
444 $this->register_jet_control(
445 'description_border',
446 array(
447 'tab' => 'style',
448 'label' => esc_html__( 'Border', 'jet-form-builder' ),
449 'type' => 'border',
450 'css' => array(
451 array(
452 'property' => 'border',
453 'selector' => $css_selector,
454 ),
455 ),
456 )
457 );
458
459 $this->end_jet_control_group();
460 }
461 // End description style
462
463 // Start input style
464 public function control_group_input_style() {
465 $this->register_jet_control_group(
466 'section_input_style',
467 array(
468 'title' => esc_html__( 'Input fields', 'jet-form-builder' ),
469 'tab' => 'style',
470 )
471 );
472 }
473
474 public function controls_input_style() {
475 $repeater_class = $this->css_selector( '-repeater' );
476 $css_selector = $this->css_selector( "__field:not(.checkradio-field):not(.range-field):not($repeater_class):not(.wysiwyg-field):not([role=\"switch\"])" );
477 $this->start_jet_control_group( 'section_input_style' );
478
479 $this->register_jet_control(
480 'input_typography',
481 array(
482 'tab' => 'style',
483 'label' => esc_html__( 'Typography', 'jet-form-builder' ),
484 'type' => 'typography',
485 'css' => array(
486 array(
487 'property' => 'typography',
488 'selector' => $css_selector,
489 ),
490 ),
491 )
492 );
493
494 $this->register_jet_control(
495 'input_placeholder_color',
496 array(
497 'tab' => 'style',
498 'label' => esc_html__( 'Placeholder color', 'jet-form-builder' ),
499 'type' => 'color',
500 'css' => array( array( 'property' => '--jfb-input-phc' ) ),
501 )
502 );
503
504 $this->register_jet_control(
505 'input_bg_color',
506 array(
507 'tab' => 'style',
508 'label' => esc_html__( 'Background color', 'jet-form-builder' ),
509 'type' => 'color',
510 'css' => array(
511 array(
512 'property' => 'background-color',
513 'selector' => $css_selector,
514 ),
515 ),
516 )
517 );
518
519 $this->register_jet_control(
520 'input_margin',
521 array(
522 'tab' => 'style',
523 'label' => esc_html__( 'Margin', 'jet-form-builder' ),
524 'type' => 'dimensions',
525 'css' => array(
526 array(
527 'property' => 'margin',
528 'selector' => $css_selector,
529 ),
530 ),
531 )
532 );
533
534 $this->register_jet_control(
535 'input_padding',
536 array(
537 'tab' => 'style',
538 'label' => esc_html__( 'Padding', 'jet-form-builder' ),
539 'type' => 'dimensions',
540 'css' => array(
541 array(
542 'property' => 'padding',
543 'selector' => $css_selector,
544 ),
545 ),
546 )
547 );
548
549 $this->register_jet_control(
550 'input_border',
551 array(
552 'tab' => 'style',
553 'label' => esc_html__( 'Border', 'jet-form-builder' ),
554 'type' => 'border',
555 'css' => array(
556 array(
557 'property' => 'border',
558 'selector' => $css_selector,
559 ),
560 ),
561 )
562 );
563
564 $this->register_jet_control(
565 'input_box_shadow',
566 array(
567 'tab' => 'style',
568 'label' => esc_html__( 'Box shadow', 'jet-form-builder' ),
569 'type' => 'box-shadow',
570 'css' => array(
571 array(
572 'property' => 'box-shadow',
573 'selector' => $css_selector,
574 ),
575 ),
576 )
577 );
578
579 $this->register_jet_control(
580 'input_width',
581 array(
582 'tab' => 'style',
583 'label' => esc_html__( 'Fields width', 'jet-form-builder' ),
584 'type' => 'number',
585 'units' => true,
586 'min' => 50,
587 'max' => 1000,
588 'css' => array( array( 'property' => '--jfb-input-w' ) ),
589 )
590 );
591
592 $this->register_jet_control(
593 'input_textarea_height',
594 array(
595 'tab' => 'style',
596 'label' => esc_html__( 'Textarea height', 'jet-form-builder' ),
597 'type' => 'number',
598 'units' => true,
599 'min' => 10,
600 'max' => 500,
601 'css' => array( array( 'property' => '--jfb-input-h' ) ),
602 )
603 );
604
605 $this->register_jet_control(
606 'input_color_scheme',
607 array(
608 'tab' => 'style',
609 'label' => esc_html__( 'Color scheme', 'jet-form-builder' ),
610 'type' => 'select',
611 'options' => array(
612 'normal' => esc_html__( 'Normal', 'jet-form-builder' ),
613 'light' => esc_html__( 'Light', 'jet-form-builder' ),
614 'dark' => esc_html__( 'Dark', 'jet-form-builder' ),
615 ),
616 'default' => 'normal',
617 'description' => esc_html__( 'Affects default browser UI elements like date and time icons, UI etc.', 'jet-form-builder' ),
618 'css' => array( array( 'property' => '--jfb-input-color-scheme' ) ),
619 )
620 );
621
622 $this->end_jet_control_group();
623 }
624 // End input style
625
626 // Start checkbox & radio fields style
627 public function control_group_checkradio_style() {
628 $this->register_jet_control_group(
629 'section_checkradio_style',
630 array(
631 'title' => esc_html__( 'Checkbox & Radio fields', 'jet-form-builder' ),
632 'tab' => 'style',
633 )
634 );
635 }
636
637 public function controls_checkradio_style() {
638 $this->start_jet_control_group( 'section_checkradio_style' );
639
640 $this->register_jet_control(
641 'checkradio_fields_layout',
642 array(
643 'tab' => 'style',
644 'label' => esc_html__( 'Layout', 'jet-form-builder' ),
645 'type' => 'select',
646 'options' => array(
647 'row' => esc_html__( 'Horizontal', 'jet-form-builder' ),
648 'columns' => esc_html__( 'Vertical', 'jet-form-builder' ),
649 ),
650 'default' => 'column',
651 'css' => array(
652 array(
653 'property' => 'flex-direction',
654 'selector' => $this->css_selector( '__fields-group' ),
655 ),
656 ),
657 )
658 );
659
660 $this->register_jet_control(
661 'checkradio_fields_gaps',
662 array(
663 'tab' => 'style',
664 'label' => esc_html__( 'Gaps', 'jet-form-builder' ),
665 'type' => 'dimensions',
666 'directions' => array(
667 'row' => esc_html__( 'Row', 'jet-form-builder' ),
668 'column' => esc_html__( 'Column', 'jet-form-builder' ),
669 ),
670 'css' => array(
671 array(
672 'property' => '{key}-gap',
673 'selector' => $this->css_selector( '__fields-group' ),
674 ),
675 ),
676 )
677 );
678
679 $this->register_jet_control(
680 'checkradio_fields_gap',
681 array(
682 'tab' => 'style',
683 'label' => esc_html__( 'Gap between control and label', 'jet-form-builder' ),
684 'type' => 'number',
685 'units' => true,
686 'min' => 0,
687 'max' => 50,
688 'css' => array(
689 array(
690 'property' => 'gap',
691 'selector' => $this->css_selector( '__field-wrap.checkradio-wrap span' ),
692 ),
693 ),
694 )
695 );
696
697 $this->register_jet_control(
698 'checkradio_fields_control_size',
699 array(
700 'tab' => 'style',
701 'label' => esc_html__( 'Control size', 'jet-form-builder' ),
702 'type' => 'number',
703 'units' => true,
704 'min' => 0,
705 'max' => 50,
706 'css' => array( array( 'property' => '--jfb-checkradio-fz' ) ),
707 )
708 );
709
710 $this->register_jet_control(
711 'checkradio_fields_typography',
712 array(
713 'tab' => 'style',
714 'label' => esc_html__( 'Typography', 'jet-form-builder' ),
715 'type' => 'typography',
716 'css' => array(
717 array(
718 'property' => 'typography',
719 'selector' => $this->css_selector( '__field-label' ),
720 ),
721 ),
722 )
723 );
724
725 $this->register_jet_control(
726 'checkradio_fields_box_heading',
727 array(
728 'tab' => 'style',
729 'type' => 'separator',
730 'label' => esc_html__( 'Box', 'jet-form-builder' ),
731 )
732 );
733
734 $this->register_jet_control(
735 'checkradio_fields_box_border',
736 array(
737 'tab' => 'style',
738 'label' => esc_html__( 'Border', 'jet-form-builder' ),
739 'type' => 'border',
740 'css' => array(
741 array(
742 'property' => 'border',
743 'selector' => $this->css_selector( '__field-label > span::before' ),
744 ),
745 ),
746 )
747 );
748
749 $this->register_jet_control(
750 'checkradio_fields_box_bg_color',
751 array(
752 'tab' => 'style',
753 'label' => esc_html__( 'Background color', 'jet-form-builder' ),
754 'type' => 'color',
755 'css' => array( array( 'property' => '--jfb-checkradio-input-bgc' ) ),
756 )
757 );
758
759 $this->register_jet_control(
760 'checkradio_fields_box_checked_heading',
761 array(
762 'tab' => 'style',
763 'type' => 'separator',
764 'label' => esc_html__( 'Checked state', 'jet-form-builder' ),
765 )
766 );
767
768 $this->register_jet_control(
769 'checkradio_fields_box_checked_bg',
770 array(
771 'tab' => 'style',
772 'label' => esc_html__( 'Background color', 'jet-form-builder' ),
773 'type' => 'color',
774 'css' => array( array( 'property' => '--jfb-checkradio-input-checked-bgc' ) ),
775 )
776 );
777
778 $this->register_jet_control(
779 'checkradio_fields_box_checked_border_color',
780 array(
781 'tab' => 'style',
782 'label' => esc_html__( 'Border color', 'jet-form-builder' ),
783 'type' => 'color',
784 'css' => array(
785 array(
786 'property' => 'border-color',
787 'selector' => $this->css_selector( '__field-label :checked + span::before' ),
788 ),
789 ),
790 )
791 );
792
793 $this->end_jet_control_group();
794 }
795 // End checkbox & radio fields style
796
797 // Start calculated fields
798 public function control_group_calc_fields_style() {
799 $this->register_jet_control_group(
800 'section_calc_fields_style',
801 array(
802 'title' => esc_html__( 'Calculated fields', 'jet-form-builder' ),
803 'tab' => 'style',
804 )
805 );
806 }
807
808 public function controls_calc_fields_style() {
809 $this->start_jet_control_group( 'section_calc_fields_style' );
810
811 $this->register_jet_control(
812 'calc_fields_align_main_axis',
813 array(
814 'tab' => 'style',
815 'label' => esc_html__( 'Align main axis', 'jet-form-builder' ),
816 'type' => 'justify-content',
817 'css' => array( array( 'property' => '--jfb-calc-justify-content' ) ),
818 )
819 );
820
821 $this->register_jet_control(
822 'calc_fields_gap',
823 array(
824 'tab' => 'style',
825 'label' => esc_html__( 'Gap', 'jet-form-builder' ),
826 'type' => 'number',
827 'units' => true,
828 'min' => 0,
829 'max' => 40,
830 'css' => array( array( 'property' => '--jfb-calc-gap' ) ),
831 )
832 );
833
834 $css_selector = $this->css_selector( '__calculated-field' );
835
836 $this->register_jet_control(
837 'calc_fields_typography',
838 array(
839 'tab' => 'style',
840 'label' => esc_html__( 'Typography', 'jet-form-builder' ),
841 'type' => 'typography',
842 'css' => array(
843 array(
844 'property' => 'typography',
845 'selector' => $css_selector,
846 ),
847 ),
848 )
849 );
850
851 $this->register_jet_control(
852 'calc_fields_prefix_size',
853 array(
854 'tab' => 'style',
855 'label' => esc_html__( 'Prefix size', 'jet-form-builder' ),
856 'type' => 'number',
857 'units' => true,
858 'min' => 10,
859 'max' => 50,
860 'css' => array( array( 'property' => '--jfb-calc-prefix-fz' ) ),
861 )
862 );
863
864 $this->register_jet_control(
865 'calc_fields_prefix_color',
866 array(
867 'tab' => 'style',
868 'label' => esc_html__( 'Prefix color', 'jet-form-builder' ),
869 'type' => 'color',
870 'css' => array( array( 'property' => '--jfb-calc-prefix-color' ) ),
871 )
872 );
873
874 $this->register_jet_control(
875 'calc_fields_suffix_size',
876 array(
877 'tab' => 'style',
878 'label' => esc_html__( 'Suffix size', 'jet-form-builder' ),
879 'type' => 'number',
880 'units' => true,
881 'min' => 10,
882 'max' => 50,
883 'css' => array( array( 'property' => '--jfb-calc-suffix-fz' ) ),
884 )
885 );
886
887 $this->register_jet_control(
888 'calc_fields_suffix_color',
889 array(
890 'tab' => 'style',
891 'label' => esc_html__( 'Suffix color', 'jet-form-builder' ),
892 'type' => 'color',
893 'css' => array( array( 'property' => '--jfb-calc-suffix-color' ) ),
894 )
895 );
896
897 $this->register_jet_control(
898 'calc_fields_bg_color',
899 array(
900 'tab' => 'style',
901 'label' => esc_html__( 'Background color', 'jet-form-builder' ),
902 'type' => 'color',
903 'css' => array( array( 'property' => '--jfb-calc-bgc' ) ),
904 )
905 );
906
907 $this->register_jet_control(
908 'calc_fields_margin',
909 array(
910 'tab' => 'style',
911 'label' => esc_html__( 'Margin', 'jet-form-builder' ),
912 'type' => 'dimensions',
913 'css' => array(
914 array(
915 'property' => 'margin',
916 'selector' => $css_selector,
917 ),
918 ),
919 )
920 );
921
922 $this->register_jet_control(
923 'calc_fields_padding',
924 array(
925 'tab' => 'style',
926 'label' => esc_html__( 'Padding', 'jet-form-builder' ),
927 'type' => 'dimensions',
928 'css' => array(
929 array(
930 'property' => 'padding',
931 'selector' => $css_selector,
932 ),
933 ),
934 )
935 );
936
937 $this->register_jet_control(
938 'calc_fields_border',
939 array(
940 'tab' => 'style',
941 'label' => esc_html__( 'Border', 'jet-form-builder' ),
942 'type' => 'border',
943 'css' => array(
944 array(
945 'property' => 'border',
946 'selector' => $css_selector,
947 ),
948 ),
949 )
950 );
951
952 $this->end_jet_control_group();
953 }
954 // End calculated fields
955
956 // Start range fields
957 public function control_group_range_fields_style() {
958 $this->register_jet_control_group(
959 'section_range_fields_style',
960 array(
961 'title' => esc_html__( 'Range fields', 'jet-form-builder' ),
962 'tab' => 'style',
963 )
964 );
965 }
966
967 public function controls_range_fields_style() {
968 $this->start_jet_control_group( 'section_range_fields_style' );
969
970 $this->register_jet_control(
971 'range_max_width',
972 array(
973 'tab' => 'style',
974 'label' => esc_html__( 'Max width', 'jet-form-builder' ),
975 'type' => 'number',
976 'units' => true,
977 'min' => 1,
978 'max' => 1000,
979 'css' => array( array( 'property' => '--jfb-range-mw' ) ),
980 )
981 );
982
983 $this->register_jet_control(
984 'range_slider_heading',
985 array(
986 'tab' => 'style',
987 'type' => 'separator',
988 'label' => esc_html__( 'Slider', 'jet-form-builder' ),
989 )
990 );
991
992 $this->register_jet_control(
993 'track_height',
994 array(
995 'tab' => 'style',
996 'label' => esc_html__( 'Track height', 'jet-form-builder' ),
997 'type' => 'number',
998 'units' => true,
999 'min' => 1,
1000 'max' => 20,
1001 'css' => array( array( 'property' => '--jet-fb__range-field-range--height' ) ),
1002 )
1003 );
1004
1005 $this->register_jet_control(
1006 'thumb_size',
1007 array(
1008 'tab' => 'style',
1009 'label' => esc_html__( 'Thumb size', 'jet-form-builder' ),
1010 'type' => 'number',
1011 'units' => true,
1012 'min' => 1,
1013 'max' => 20,
1014 'css' => array( array( 'property' => '--jet-fb__range-field-slider--size' ) ),
1015 )
1016 );
1017
1018 $this->register_jet_control(
1019 'track_border_radius',
1020 array(
1021 'tab' => 'style',
1022 'label' => esc_html__( 'Track border radius', 'jet-form-builder' ),
1023 'type' => 'number',
1024 'units' => true,
1025 'min' => 1,
1026 'max' => 50,
1027 'css' => array( array( 'property' => '--jet-fb__range-field-range--br' ) ),
1028 )
1029 );
1030
1031 $this->register_jet_control(
1032 'thumb_border_radius',
1033 array(
1034 'tab' => 'style',
1035 'label' => esc_html__( 'Thumb border radius', 'jet-form-builder' ),
1036 'type' => 'number',
1037 'units' => true,
1038 'min' => 1,
1039 'max' => 50,
1040 'css' => array( array( 'property' => '--jet-fb__range-field-slider--br' ) ),
1041 )
1042 );
1043
1044 $this->register_jet_control(
1045 'track_bg_color',
1046 array(
1047 'tab' => 'style',
1048 'label' => esc_html__( 'Track color', 'jet-form-builder' ),
1049 'type' => 'color',
1050 'css' => array( array( 'property' => '--jet-fb__range-field-range--bgc' ) ),
1051 )
1052 );
1053
1054 $this->register_jet_control(
1055 'thumb_bg_color',
1056 array(
1057 'tab' => 'style',
1058 'label' => esc_html__( 'Thumb color', 'jet-form-builder' ),
1059 'type' => 'color',
1060 'css' => array( array( 'property' => '--jet-fb__range-field-slider--bgc' ) ),
1061 )
1062 );
1063
1064 $this->register_jet_control(
1065 'range_value_heading',
1066 array(
1067 'tab' => 'style',
1068 'type' => 'separator',
1069 'label' => esc_html__( 'Value', 'jet-form-builder' ),
1070 )
1071 );
1072
1073 $this->register_jet_control(
1074 'range_value_gap',
1075 array(
1076 'tab' => 'style',
1077 'label' => esc_html__( 'Gap', 'jet-form-builder' ),
1078 'type' => 'number',
1079 'units' => true,
1080 'min' => 0,
1081 'max' => 40,
1082 'css' => array( array( 'property' => '--jfb-range-value-gap' ) ),
1083 )
1084 );
1085
1086 $this->register_jet_control(
1087 'range_value_typography',
1088 array(
1089 'tab' => 'style',
1090 'label' => esc_html__( 'Typography', 'jet-form-builder' ),
1091 'type' => 'typography',
1092 'css' => array(
1093 array(
1094 'property' => 'typography',
1095 'selector' => $this->css_selector( '__field-value.range-value' ),
1096 ),
1097 ),
1098 )
1099 );
1100
1101 $this->register_jet_control(
1102 'range_prefix_value_size',
1103 array(
1104 'tab' => 'style',
1105 'label' => esc_html__( 'Prefix size', 'jet-form-builder' ),
1106 'type' => 'number',
1107 'units' => true,
1108 'min' => 10,
1109 'max' => 50,
1110 'css' => array( array( 'property' => '--jfb-range-value-prefix-fz' ) ),
1111 )
1112 );
1113
1114 $this->register_jet_control(
1115 'range_prefix_value_color',
1116 array(
1117 'tab' => 'style',
1118 'label' => esc_html__( 'Prefix color', 'jet-form-builder' ),
1119 'type' => 'color',
1120 'css' => array( array( 'property' => '--jfb-range-value-prefix-color' ) ),
1121 )
1122 );
1123
1124 $this->register_jet_control(
1125 'range_suffix_value_size',
1126 array(
1127 'tab' => 'style',
1128 'label' => esc_html__( 'Suffix size', 'jet-form-builder' ),
1129 'type' => 'number',
1130 'units' => true,
1131 'min' => 10,
1132 'max' => 50,
1133 'css' => array( array( 'property' => '--jfb-range-value-suffix-fz' ) ),
1134 )
1135 );
1136
1137 $this->register_jet_control(
1138 'range_suffix_value_color',
1139 array(
1140 'tab' => 'style',
1141 'label' => esc_html__( 'Suffix color', 'jet-form-builder' ),
1142 'type' => 'color',
1143 'css' => array( array( 'property' => '--jfb-range-value-suffix-color' ) ),
1144 )
1145 );
1146
1147 $this->end_jet_control_group();
1148 }
1149 // End range fields
1150
1151 // Start heading style
1152 public function control_group_heading_style() {
1153 $this->register_jet_control_group(
1154 'section_headings_style',
1155 array(
1156 'title' => esc_html__( 'Heading', 'jet-form-builder' ),
1157 'tab' => 'style',
1158 )
1159 );
1160 }
1161
1162 public function controls_heading_style() {
1163 $this->start_jet_control_group( 'section_headings_style' );
1164
1165 $this->register_jet_control(
1166 'heading_label_heading',
1167 array(
1168 'tab' => 'style',
1169 'type' => 'separator',
1170 'label' => esc_html__( 'Label', 'jet-form-builder' ),
1171 )
1172 );
1173
1174 $css_selectors = array(
1175 'label' => $this->css_selector( '__heading' ),
1176 'label-text' => $this->css_selector( '__heading' ) . ' ' . $this->css_selector( '__label-text' ),
1177 'desc' => $this->css_selector( '__heading-desc' ),
1178 );
1179
1180 $this->register_jet_control(
1181 'heading_label_typography',
1182 array(
1183 'tab' => 'style',
1184 'label' => esc_html__( 'Typography', 'jet-form-builder' ),
1185 'type' => 'typography',
1186 'css' => array(
1187 array(
1188 'property' => 'typography',
1189 'selector' => $css_selectors['label-text'],
1190 ),
1191 ),
1192 )
1193 );
1194
1195 $this->register_jet_control(
1196 'heading_label_bg_color',
1197 array(
1198 'tab' => 'style',
1199 'label' => esc_html__( 'Background color', 'jet-form-builder' ),
1200 'type' => 'color',
1201 'css' => array( array( 'property' => '--jfb-heading-bgc' ) ),
1202 )
1203 );
1204
1205 $this->register_jet_control(
1206 'heading_label_margin',
1207 array(
1208 'tab' => 'style',
1209 'label' => esc_html__( 'Margin', 'jet-form-builder' ),
1210 'type' => 'dimensions',
1211 'css' => array(
1212 array(
1213 'property' => 'margin',
1214 'selector' => $css_selectors['label'],
1215 ),
1216 ),
1217 )
1218 );
1219
1220 $this->register_jet_control(
1221 'heading_label_padding',
1222 array(
1223 'tab' => 'style',
1224 'label' => esc_html__( 'Padding', 'jet-form-builder' ),
1225 'type' => 'dimensions',
1226 'css' => array(
1227 array(
1228 'property' => 'padding',
1229 'selector' => $css_selectors['label'],
1230 ),
1231 ),
1232 )
1233 );
1234
1235 $this->register_jet_control(
1236 'heading_label_border',
1237 array(
1238 'tab' => 'style',
1239 'label' => esc_html__( 'Border', 'jet-form-builder' ),
1240 'type' => 'border',
1241 'css' => array(
1242 array(
1243 'property' => 'border',
1244 'selector' => $css_selectors['label'],
1245 ),
1246 ),
1247 )
1248 );
1249
1250 $this->register_jet_control(
1251 'heading_desc_heading',
1252 array(
1253 'tab' => 'style',
1254 'type' => 'separator',
1255 'label' => esc_html__( 'Description', 'jet-form-builder' ),
1256 )
1257 );
1258
1259 $this->register_jet_control(
1260 'heading_desc_typography',
1261 array(
1262 'tab' => 'style',
1263 'label' => esc_html__( 'Typography', 'jet-form-builder' ),
1264 'type' => 'typography',
1265 'css' => array(
1266 array(
1267 'property' => 'typography',
1268 'selector' => $css_selectors['desc'],
1269 ),
1270 ),
1271 )
1272 );
1273
1274 $this->register_jet_control(
1275 'heading_desc_bg_color',
1276 array(
1277 'tab' => 'style',
1278 'label' => esc_html__( 'Background color', 'jet-form-builder' ),
1279 'type' => 'color',
1280 'css' => array( array( 'property' => '--jfb-heading-desc-bgc' ) ),
1281 )
1282 );
1283
1284 $this->register_jet_control(
1285 'heading_desc_margin',
1286 array(
1287 'tab' => 'style',
1288 'label' => esc_html__( 'Margin', 'jet-form-builder' ),
1289 'type' => 'dimensions',
1290 'css' => array(
1291 array(
1292 'property' => 'margin',
1293 'selector' => $css_selectors['desc'],
1294 ),
1295 ),
1296 )
1297 );
1298
1299 $this->register_jet_control(
1300 'heading_desc_padding',
1301 array(
1302 'tab' => 'style',
1303 'label' => esc_html__( 'Padding', 'jet-form-builder' ),
1304 'type' => 'dimensions',
1305 'css' => array(
1306 array(
1307 'property' => 'padding',
1308 'selector' => $css_selectors['desc'],
1309 ),
1310 ),
1311 )
1312 );
1313
1314 $this->register_jet_control(
1315 'heading_desc_border',
1316 array(
1317 'tab' => 'style',
1318 'label' => esc_html__( 'Border', 'jet-form-builder' ),
1319 'type' => 'border',
1320 'css' => array(
1321 array(
1322 'property' => 'border',
1323 'selector' => $css_selectors['desc'],
1324 ),
1325 ),
1326 )
1327 );
1328
1329 $this->end_jet_control_group();
1330 }
1331 // End heading style
1332
1333 // Start repeater style
1334 public function control_group_repeater_style() {
1335 $this->register_jet_control_group(
1336 'section_repeater_style',
1337 array(
1338 'title' => esc_html__( 'Repeater', 'jet-form-builder' ),
1339 'tab' => 'style',
1340 )
1341 );
1342 }
1343
1344 public function controls_repeater_style() {
1345 $this->start_jet_control_group( 'section_repeater_style' );
1346
1347 $this->register_jet_control(
1348 'repeater_row_heading',
1349 array(
1350 'tab' => 'style',
1351 'type' => 'separator',
1352 'label' => esc_html__( 'Repeater row', 'jet-form-builder' ),
1353 )
1354 );
1355
1356 $css_selectors = array(
1357 'row' => $this->css_selector( '-repeater__row' ),
1358 'new' => $this->css_selector( '-repeater__new' ),
1359 'remove' => $this->css_selector( '-repeater__remove' ),
1360 );
1361
1362 $this->register_jet_control(
1363 'booking_form_repeater_row_padding',
1364 array(
1365 'tab' => 'style',
1366 'label' => esc_html__( 'Padding', 'jet-form-builder' ),
1367 'type' => 'dimensions',
1368 'css' => array(
1369 array(
1370 'property' => 'padding',
1371 'selector' => $css_selectors['row'],
1372 ),
1373 ),
1374 )
1375 );
1376
1377 $this->register_jet_control(
1378 'repeater_add_button_heading',
1379 array(
1380 'tab' => 'style',
1381 'type' => 'separator',
1382 'label' => esc_html__( 'New item button', 'jet-form-builder' ),
1383 )
1384 );
1385
1386 $this->register_jet_control(
1387 'booking_form_repeater_align_main_axis',
1388 array(
1389 'tab' => 'style',
1390 'label' => esc_html__( 'Align main axis', 'jet-form-builder' ),
1391 'type' => 'justify-content',
1392 'exclude' => array(
1393 'space-between',
1394 'space-around',
1395 'space-evenly',
1396 ),
1397 'css' => array( array( 'property' => '--jfb-repeater-add-button-justify-content' ) ),
1398 )
1399 );
1400
1401 $this->register_jet_control(
1402 'booking_form_repeater_typography',
1403 array(
1404 'tab' => 'style',
1405 'label' => esc_html__( 'Typography', 'jet-form-builder' ),
1406 'type' => 'typography',
1407 'css' => array(
1408 array(
1409 'property' => 'typography',
1410 'selector' => $css_selectors['new'],
1411 ),
1412 ),
1413 )
1414 );
1415
1416 $this->register_jet_control(
1417 'booking_form_repeater_bg_color',
1418 array(
1419 'tab' => 'style',
1420 'label' => esc_html__( 'Background color', 'jet-form-builder' ),
1421 'type' => 'color',
1422 'css' => array(
1423 array(
1424 'property' => 'background-color',
1425 'selector' => $css_selectors['new'],
1426 ),
1427 ),
1428 )
1429 );
1430
1431 $this->register_jet_control(
1432 'booking_form_repeater_margin',
1433 array(
1434 'tab' => 'style',
1435 'label' => esc_html__( 'Margin', 'jet-form-builder' ),
1436 'type' => 'dimensions',
1437 'css' => array(
1438 array(
1439 'property' => 'margin',
1440 'selector' => $css_selectors['new'],
1441 ),
1442 ),
1443 )
1444 );
1445
1446 $this->register_jet_control(
1447 'booking_form_repeater_padding',
1448 array(
1449 'tab' => 'style',
1450 'label' => esc_html__( 'Padding', 'jet-form-builder' ),
1451 'type' => 'dimensions',
1452 'css' => array(
1453 array(
1454 'property' => 'padding',
1455 'selector' => $css_selectors['new'],
1456 ),
1457 ),
1458 )
1459 );
1460
1461 $this->register_jet_control(
1462 'booking_form_repeater_border',
1463 array(
1464 'tab' => 'style',
1465 'label' => esc_html__( 'Border', 'jet-form-builder' ),
1466 'type' => 'border',
1467 'css' => array(
1468 array(
1469 'property' => 'border',
1470 'selector' => $css_selectors['new'],
1471 ),
1472 ),
1473 )
1474 );
1475
1476 $this->register_jet_control(
1477 'booking_form_repeater_box_shadow',
1478 array(
1479 'tab' => 'style',
1480 'label' => esc_html__( 'Box shadow', 'jet-form-builder' ),
1481 'type' => 'box-shadow',
1482 'css' => array(
1483 array(
1484 'property' => 'box-shadow',
1485 'selector' => $css_selectors['new'],
1486 ),
1487 ),
1488 )
1489 );
1490
1491 $this->register_jet_control(
1492 'repeater_rem_button_heading',
1493 array(
1494 'tab' => 'style',
1495 'type' => 'separator',
1496 'label' => esc_html__( 'Remove item button', 'jet-form-builder' ),
1497 )
1498 );
1499
1500 $this->register_jet_control(
1501 'booking_form_repeater_rem_size',
1502 array(
1503 'tab' => 'style',
1504 'label' => esc_html__( 'Icon size', 'jet-form-builder' ),
1505 'type' => 'number',
1506 'units' => true,
1507 'min' => 12,
1508 'max' => 90,
1509 'css' => array( array( 'property' => '--jfb-repeater-rem-button-fz' ) ),
1510 )
1511 );
1512
1513 $this->register_jet_control(
1514 'booking_form_repeater_rem_color',
1515 array(
1516 'tab' => 'style',
1517 'label' => esc_html__( 'Color', 'jet-form-builder' ),
1518 'type' => 'color',
1519 'css' => array( array( 'property' => '--jfb-repeater-rem-button-color' ) ),
1520 )
1521 );
1522
1523 $this->register_jet_control(
1524 'booking_form_repeater_rem_bg_color',
1525 array(
1526 'tab' => 'style',
1527 'label' => esc_html__( 'Background color', 'jet-form-builder' ),
1528 'type' => 'color',
1529 'css' => array( array( 'property' => '--jfb-repeater-rem-button-bgc' ) ),
1530 )
1531 );
1532
1533 $this->register_jet_control(
1534 'booking_form_repeater_rem_margin',
1535 array(
1536 'tab' => 'style',
1537 'label' => esc_html__( 'Margin', 'jet-form-builder' ),
1538 'type' => 'dimensions',
1539 'css' => array(
1540 array(
1541 'property' => 'margin',
1542 'selector' => $css_selectors['remove'],
1543 ),
1544 ),
1545 )
1546 );
1547
1548 $this->register_jet_control(
1549 'booking_form_repeater_rem_padding',
1550 array(
1551 'tab' => 'style',
1552 'label' => esc_html__( 'Padding', 'jet-form-builder' ),
1553 'type' => 'dimensions',
1554 'css' => array(
1555 array(
1556 'property' => 'padding',
1557 'selector' => $css_selectors['remove'],
1558 ),
1559 ),
1560 )
1561 );
1562
1563 $this->register_jet_control(
1564 'booking_form_repeater_rem_border',
1565 array(
1566 'tab' => 'style',
1567 'label' => esc_html__( 'Border', 'jet-form-builder' ),
1568 'type' => 'border',
1569 'css' => array(
1570 array(
1571 'property' => 'border',
1572 'selector' => $css_selectors['remove'],
1573 ),
1574 ),
1575 )
1576 );
1577
1578 $this->register_jet_control(
1579 'booking_form_repeater_rem_box_shadow',
1580 array(
1581 'tab' => 'style',
1582 'label' => esc_html__( 'Box shadow', 'jet-form-builder' ),
1583 'type' => 'box-shadow',
1584 'css' => array(
1585 array(
1586 'property' => 'box-shadow',
1587 'selector' => $css_selectors['remove'],
1588 ),
1589 ),
1590 )
1591 );
1592
1593 $this->end_jet_control_group();
1594 }
1595 // End repeater style
1596
1597 // Start conditional style
1598 public function control_group_conditional_style() {
1599 $this->register_jet_control_group(
1600 'section_conditional_style',
1601 array(
1602 'title' => esc_html__( 'Conditional', 'jet-form-builder' ),
1603 'tab' => 'style',
1604 )
1605 );
1606 }
1607
1608 public function controls_conditional_style() {
1609 $this->start_jet_control_group( 'section_conditional_style' );
1610
1611 $this->register_jet_control(
1612 'conditional_bg_color',
1613 array(
1614 'tab' => 'style',
1615 'label' => esc_html__( 'Background color', 'jet-form-builder' ),
1616 'type' => 'color',
1617 'css' => array( array( 'property' => '--jfb-conditional-bgc' ) ),
1618 )
1619 );
1620
1621 $css_selector = $this->css_selector( '__conditional' );
1622
1623 $this->register_jet_control(
1624 'conditional_margin',
1625 array(
1626 'tab' => 'style',
1627 'label' => esc_html__( 'Margin', 'jet-form-builder' ),
1628 'type' => 'dimensions',
1629 'css' => array(
1630 array(
1631 'property' => 'margin',
1632 'selector' => $css_selector,
1633 ),
1634 ),
1635 )
1636 );
1637
1638 $this->register_jet_control(
1639 'conditional_padding',
1640 array(
1641 'tab' => 'style',
1642 'label' => esc_html__( 'Padding', 'jet-form-builder' ),
1643 'type' => 'dimensions',
1644 'css' => array(
1645 array(
1646 'property' => 'padding',
1647 'selector' => $css_selector,
1648 ),
1649 ),
1650 )
1651 );
1652
1653 $this->register_jet_control(
1654 'conditional_border',
1655 array(
1656 'tab' => 'style',
1657 'label' => esc_html__( 'Border', 'jet-form-builder' ),
1658 'type' => 'border',
1659 'css' => array(
1660 array(
1661 'property' => 'border',
1662 'selector' => $css_selector,
1663 ),
1664 ),
1665 )
1666 );
1667
1668 $this->end_jet_control_group();
1669 }
1670 // End conditional style
1671
1672 // Start submit style
1673 public function control_group_submit_style() {
1674 $this->register_jet_control_group(
1675 'section_submit_style',
1676 array(
1677 'title' => esc_html__( 'Submit', 'jet-form-builder' ),
1678 'tab' => 'style',
1679 )
1680 );
1681 }
1682
1683 public function controls_submit_style() {
1684 $this->start_jet_control_group( 'section_submit_style' );
1685
1686 $this->register_jet_control(
1687 'booking_form_submit_align_main_axis',
1688 array(
1689 'tab' => 'style',
1690 'label' => esc_html__( 'Align main axis', 'jet-form-builder' ),
1691 'type' => 'justify-content',
1692 'exclude' => array(
1693 'space-between',
1694 'space-around',
1695 'space-evenly',
1696 ),
1697 'css' => array( array( 'property' => '--jfb-submit-justify-content' ) ),
1698 )
1699 );
1700
1701 $this->register_jet_control(
1702 'booking_form_submit_width',
1703 array(
1704 'tab' => 'style',
1705 'label' => esc_html__( 'Width', 'jet-form-builder' ),
1706 'type' => 'number',
1707 'units' => true,
1708 'min' => 1,
1709 'max' => 1000,
1710 'css' => array( array( 'property' => '--jfb-submit-w' ) ),
1711 )
1712 );
1713
1714 $css_selector = $this->css_selector( '__submit' );
1715
1716 $this->register_jet_control(
1717 'booking_form_submit_typography',
1718 array(
1719 'tab' => 'style',
1720 'label' => esc_html__( 'Typography', 'jet-form-builder' ),
1721 'type' => 'typography',
1722 'css' => array(
1723 array(
1724 'property' => 'typography',
1725 'selector' => $css_selector,
1726 ),
1727 ),
1728 )
1729 );
1730
1731 $this->register_jet_control(
1732 'booking_form_submit_bg_color',
1733 array(
1734 'tab' => 'style',
1735 'label' => esc_html__( 'Background color', 'jet-form-builder' ),
1736 'type' => 'color',
1737 'css' => array(
1738 array(
1739 'property' => 'background-color',
1740 'selector' => $css_selector,
1741 ),
1742 ),
1743 )
1744 );
1745
1746 $this->register_jet_control(
1747 'booking_form_submit_margin',
1748 array(
1749 'tab' => 'style',
1750 'label' => esc_html__( 'Margin', 'jet-form-builder' ),
1751 'type' => 'dimensions',
1752 'css' => array(
1753 array(
1754 'property' => 'margin',
1755 'selector' => $css_selector,
1756 ),
1757 ),
1758 )
1759 );
1760
1761 $this->register_jet_control(
1762 'booking_form_submit_padding',
1763 array(
1764 'tab' => 'style',
1765 'label' => esc_html__( 'Padding', 'jet-form-builder' ),
1766 'type' => 'dimensions',
1767 'css' => array(
1768 array(
1769 'property' => 'padding',
1770 'selector' => $css_selector,
1771 ),
1772 ),
1773 )
1774 );
1775
1776 $this->register_jet_control(
1777 'booking_form_submit_border',
1778 array(
1779 'tab' => 'style',
1780 'label' => esc_html__( 'Border', 'jet-form-builder' ),
1781 'type' => 'border',
1782 'css' => array(
1783 array(
1784 'property' => 'border',
1785 'selector' => $css_selector,
1786 ),
1787 ),
1788 )
1789 );
1790
1791 $this->register_jet_control(
1792 'booking_form_submit_box_shadow',
1793 array(
1794 'tab' => 'style',
1795 'label' => esc_html__( 'Box shadow', 'jet-form-builder' ),
1796 'type' => 'box-shadow',
1797 'css' => array(
1798 array(
1799 'property' => 'box-shadow',
1800 'selector' => $css_selector,
1801 ),
1802 ),
1803 )
1804 );
1805
1806 $this->end_jet_control_group();
1807 }
1808 // End label style
1809
1810 // Start form break style
1811 public function control_group_form_break_style() {
1812 $this->register_jet_control_group(
1813 'section_form_break_style',
1814 array(
1815 'title' => esc_html__( 'Form Break Row', 'jet-form-builder' ),
1816 'tab' => 'style',
1817 )
1818 );
1819 }
1820
1821 public function controls_form_break_style() {
1822 $this->start_jet_control_group( 'section_form_break_style' );
1823
1824 $this->register_jet_control(
1825 'form_break_notice',
1826 array(
1827 'tab' => 'content',
1828 'content' => esc_html__( 'Styles from this tab apply to the Next Page and Prev Page controls added through the Form Page Break block.', 'jet-form-builder' ),
1829 'type' => 'info',
1830 )
1831 );
1832
1833 $this->register_jet_control(
1834 'form_break_alignment',
1835 array(
1836 'tab' => 'style',
1837 'label' => esc_html__( 'Text align', 'jet-form-builder' ),
1838 'type' => 'text-align',
1839 'css' => array( array( 'property' => '--jfb-break-text-align' ) ),
1840 )
1841 );
1842
1843 $css_selector = $this->css_selector( '__next-page-wrap' );
1844
1845 $this->register_jet_control(
1846 'form_break_padding',
1847 array(
1848 'tab' => 'style',
1849 'label' => esc_html__( 'Padding', 'jet-form-builder' ),
1850 'type' => 'dimensions',
1851 'css' => array(
1852 array(
1853 'property' => 'padding',
1854 'selector' => $css_selector,
1855 ),
1856 ),
1857 )
1858 );
1859
1860 $this->register_jet_control(
1861 'form_break_border',
1862 array(
1863 'tab' => 'style',
1864 'label' => esc_html__( 'Border', 'jet-form-builder' ),
1865 'type' => 'border',
1866 'css' => array(
1867 array(
1868 'property' => 'border',
1869 'selector' => $css_selector,
1870 ),
1871 ),
1872 )
1873 );
1874
1875 $this->end_jet_control_group();
1876 }
1877 // End form break style
1878
1879 // Start form break buttons style
1880 public function control_group_form_break_buttons_style() {
1881 $this->register_jet_control_group(
1882 'section_form_break_next_style',
1883 array(
1884 'title' => esc_html__( 'Form Break Buttons', 'jet-form-builder' ),
1885 'tab' => 'style',
1886 )
1887 );
1888 }
1889
1890 public function controls_form_break_buttons_style() {
1891 $this->start_jet_control_group( 'section_form_break_next_style' );
1892
1893 $css_selectors = array(
1894 'prev' => $this->css_selector( '__prev-page' ),
1895 'next' => $this->css_selector( '__next-page' ),
1896 );
1897
1898 $this->register_jet_control(
1899 'form_break_next_notice',
1900 array(
1901 'tab' => 'content',
1902 'content' => esc_html__( 'The styles from this tab apply to the Next Page and Prev Page added as separate blocks in the form.', 'jet-form-builder' ),
1903 'type' => 'info',
1904 )
1905 );
1906
1907 $this->register_jet_control(
1908 'form_break_button_typography',
1909 array(
1910 'tab' => 'style',
1911 'label' => esc_html__( 'Typography', 'jet-form-builder' ),
1912 'type' => 'typography',
1913 'css' => array(
1914 array(
1915 'property' => 'typography',
1916 'selector' => $css_selectors['prev'],
1917 ),
1918 array(
1919 'property' => 'typography',
1920 'selector' => $css_selectors['next'],
1921 ),
1922 ),
1923 )
1924 );
1925
1926 $this->register_jet_control(
1927 'form_break_button_bg_color',
1928 array(
1929 'tab' => 'style',
1930 'label' => esc_html__( 'Background color', 'jet-form-builder' ),
1931 'type' => 'color',
1932 'css' => array(
1933 array(
1934 'property' => 'background-color',
1935 'selector' => $css_selectors['prev'],
1936 ),
1937 array(
1938 'property' => 'background-color',
1939 'selector' => $css_selectors['next'],
1940 ),
1941 ),
1942 )
1943 );
1944
1945 $this->register_jet_control(
1946 'form_break_button_margin',
1947 array(
1948 'tab' => 'style',
1949 'label' => esc_html__( 'Margin', 'jet-form-builder' ),
1950 'type' => 'dimensions',
1951 'css' => array(
1952 array(
1953 'property' => 'margin',
1954 'selector' => $css_selectors['prev'],
1955 ),
1956 array(
1957 'property' => 'margin',
1958 'selector' => $css_selectors['next'],
1959 ),
1960 ),
1961 )
1962 );
1963
1964 $this->register_jet_control(
1965 'form_break_button_padding',
1966 array(
1967 'tab' => 'style',
1968 'label' => esc_html__( 'Padding', 'jet-form-builder' ),
1969 'type' => 'dimensions',
1970 'css' => array(
1971 array(
1972 'property' => 'padding',
1973 'selector' => $css_selectors['prev'],
1974 ),
1975 array(
1976 'property' => 'padding',
1977 'selector' => $css_selectors['next'],
1978 ),
1979 ),
1980 )
1981 );
1982
1983 $this->register_jet_control(
1984 'form_break_button_border',
1985 array(
1986 'tab' => 'style',
1987 'label' => esc_html__( 'Border', 'jet-form-builder' ),
1988 'type' => 'border',
1989 'css' => array(
1990 array(
1991 'property' => 'border',
1992 'selector' => $css_selectors['prev'],
1993 ),
1994 array(
1995 'property' => 'border',
1996 'selector' => $css_selectors['next'],
1997 ),
1998 ),
1999 )
2000 );
2001
2002 $this->end_jet_control_group();
2003 }
2004 // End form break buttons style
2005
2006 // Start form break disabled message style
2007 public function control_group_form_break_message_style() {
2008 $this->register_jet_control_group(
2009 'section_form_break_message_style',
2010 array(
2011 'title' => esc_html__( 'Form Break Disabled Message', 'jet-form-builder' ),
2012 'tab' => 'style',
2013 )
2014 );
2015 }
2016
2017 public function controls_form_break_message_style() {
2018 $this->start_jet_control_group( 'section_form_break_message_style' );
2019
2020 $css_selector = $this->css_selector( '__next-page-msg' );
2021
2022 $this->register_jet_control(
2023 'form_break_message_typography',
2024 array(
2025 'tab' => 'style',
2026 'label' => esc_html__( 'Typography', 'jet-form-builder' ),
2027 'type' => 'typography',
2028 'css' => array(
2029 array(
2030 'property' => 'typography',
2031 'selector' => $css_selector,
2032 ),
2033 ),
2034 )
2035 );
2036
2037 $this->register_jet_control(
2038 'form_break_message_bg_color',
2039 array(
2040 'tab' => 'style',
2041 'label' => esc_html__( 'Background color', 'jet-form-builder' ),
2042 'type' => 'color',
2043 'css' => array( array( 'property' => '--jfb-break-message-bgc' ) ),
2044 )
2045 );
2046
2047 $this->register_jet_control(
2048 'form_break_message_margin',
2049 array(
2050 'tab' => 'style',
2051 'label' => esc_html__( 'Margin', 'jet-form-builder' ),
2052 'type' => 'dimensions',
2053 'css' => array(
2054 array(
2055 'property' => 'margin',
2056 'selector' => $css_selector,
2057 ),
2058 ),
2059 )
2060 );
2061
2062 $this->register_jet_control(
2063 'form_break_message_padding',
2064 array(
2065 'tab' => 'style',
2066 'label' => esc_html__( 'Padding', 'jet-form-builder' ),
2067 'type' => 'dimensions',
2068 'css' => array(
2069 array(
2070 'property' => 'padding',
2071 'selector' => $css_selector,
2072 ),
2073 ),
2074 )
2075 );
2076
2077 $this->register_jet_control(
2078 'form_break_message_border',
2079 array(
2080 'tab' => 'style',
2081 'label' => esc_html__( 'Border', 'jet-form-builder' ),
2082 'type' => 'border',
2083 'css' => array(
2084 array(
2085 'property' => 'border',
2086 'selector' => $css_selector,
2087 ),
2088 ),
2089 )
2090 );
2091
2092 $this->end_jet_control_group();
2093 }
2094 // End form break disabled message style
2095
2096 // Start progress wrap
2097 public function control_group_form_progress_wrap_style() {
2098 $this->register_jet_control_group(
2099 'jet_fb_progress_wrapper_section',
2100 array(
2101 'title' => esc_html__( 'Form Progress - Wrapper', 'jet-form-builder' ),
2102 'tab' => 'style',
2103 )
2104 );
2105 }
2106
2107 public function controls_form_progress_wrap_style() {
2108 $this->start_jet_control_group( 'jet_fb_progress_wrapper_section' );
2109
2110 $this->register_jet_control(
2111 'jet_fb_progress_wrapper_bg_color',
2112 array(
2113 'tab' => 'style',
2114 'label' => esc_html__( 'Background color', 'jet-form-builder' ),
2115 'type' => 'color',
2116 'css' => array( array( 'property' => '--jfb-progress-wrapper-bgc' ) ),
2117 )
2118 );
2119
2120 $css_selector = $this->css_selector( '-progress-pages' );
2121
2122 $this->register_jet_control(
2123 'jet_fb_progress_wrapper_margin',
2124 array(
2125 'tab' => 'style',
2126 'label' => esc_html__( 'Margin', 'jet-form-builder' ),
2127 'type' => 'dimensions',
2128 'css' => array(
2129 array(
2130 'property' => 'margin',
2131 'selector' => $css_selector,
2132 ),
2133 ),
2134 )
2135 );
2136
2137 $this->register_jet_control(
2138 'jet_fb_progress_wrapper_padding',
2139 array(
2140 'tab' => 'style',
2141 'label' => esc_html__( 'Padding', 'jet-form-builder' ),
2142 'type' => 'dimensions',
2143 'css' => array(
2144 array(
2145 'property' => 'padding',
2146 'selector' => $css_selector,
2147 ),
2148 ),
2149 )
2150 );
2151
2152 $this->register_jet_control(
2153 'jet_fb_progress_wrapper_border',
2154 array(
2155 'tab' => 'style',
2156 'label' => esc_html__( 'Border', 'jet-form-builder' ),
2157 'type' => 'border',
2158 'css' => array(
2159 array(
2160 'property' => 'border',
2161 'selector' => $css_selector,
2162 ),
2163 ),
2164 )
2165 );
2166
2167 $this->end_jet_control_group();
2168 }
2169 // End progress wrap
2170
2171 // Start progress pages
2172 public function control_group_form_progress_pages_style() {
2173 $this->register_jet_control_group(
2174 'jet_fb_progress_pages_section',
2175 array(
2176 'title' => esc_html__( 'Form Progress - Pages', 'jet-form-builder' ),
2177 'tab' => 'style',
2178 )
2179 );
2180 }
2181
2182 public function controls_form_progress_pages_style() {
2183 $this->start_jet_control_group( 'jet_fb_progress_pages_section' );
2184
2185 $css_selectors = array(
2186 'wrapper' => $this->css_selector( '-progress-pages__item--wrapper' ),
2187 'item' => $this->css_selector( '-progress-pages__item' ),
2188 'circle' => $this->css_selector( '-progress-pages__item--circle' ),
2189 'passed-page' => $this->css_selector( '-progress-pages__item--wrapper.passed-page' ),
2190 'active-page' => $this->css_selector( '-progress-pages__item--wrapper.active-page' ),
2191 );
2192
2193 $this->register_jet_control(
2194 'jet_fb_progress_wrapper_typography',
2195 array(
2196 'tab' => 'style',
2197 'label' => esc_html__( 'Typography', 'jet-form-builder' ),
2198 'type' => 'typography',
2199 'css' => array(
2200 array(
2201 'property' => 'typography',
2202 'selector' => $css_selectors['wrapper'],
2203 ),
2204 ),
2205 )
2206 );
2207
2208 $this->register_jet_control(
2209 'jet_fb_progress_pages_bg_color',
2210 array(
2211 'tab' => 'style',
2212 'label' => esc_html__( 'Background color', 'jet-form-builder' ),
2213 'type' => 'color',
2214 'css' => array( array( 'property' => '--jfb-progress-default-page-bgc' ) ),
2215 )
2216 );
2217
2218 $this->register_jet_control(
2219 'jet_fb_progress_pages_margin',
2220 array(
2221 'tab' => 'style',
2222 'label' => esc_html__( 'Margin', 'jet-form-builder' ),
2223 'type' => 'dimensions',
2224 'css' => array(
2225 array(
2226 'property' => 'margin',
2227 'selector' => $css_selectors['item'],
2228 ),
2229 ),
2230 )
2231 );
2232
2233 $this->register_jet_control(
2234 'jet_fb_progress_pages_padding',
2235 array(
2236 'tab' => 'style',
2237 'label' => esc_html__( 'Padding', 'jet-form-builder' ),
2238 'type' => 'dimensions',
2239 'css' => array(
2240 array(
2241 'property' => 'padding',
2242 'selector' => $css_selectors['item'],
2243 ),
2244 ),
2245 )
2246 );
2247
2248 $this->register_jet_control(
2249 'jet_fb_progress_pages_border',
2250 array(
2251 'tab' => 'style',
2252 'label' => esc_html__( 'Border', 'jet-form-builder' ),
2253 'type' => 'border',
2254 'css' => array(
2255 array(
2256 'property' => 'border',
2257 'selector' => $css_selectors['item'],
2258 ),
2259 ),
2260 )
2261 );
2262
2263 $this->register_jet_control(
2264 'jet_fb_progress_separator_height',
2265 array(
2266 'tab' => 'style',
2267 'label' => esc_html__( 'Separator height', 'jet-form-builder' ),
2268 'type' => 'number',
2269 'units' => true,
2270 'min' => 1,
2271 'max' => 100,
2272 'css' => array( array( 'property' => '--jfb-progress-default-page-separator-h' ) ),
2273 )
2274 );
2275
2276 $this->register_jet_control(
2277 'jet_fb_progress_separator_color',
2278 array(
2279 'tab' => 'style',
2280 'label' => esc_html__( 'Separator color', 'jet-form-builder' ),
2281 'type' => 'color',
2282 'css' => array( array( 'property' => '--jfb-progress-default-page-separator-color' ) ),
2283 )
2284 );
2285
2286 $this->register_jet_control(
2287 'jet_fb_progress_circle_border',
2288 array(
2289 'tab' => 'style',
2290 'label' => esc_html__( 'Circle border', 'jet-form-builder' ),
2291 'type' => 'border',
2292 'css' => array(
2293 array(
2294 'property' => 'border',
2295 'selector' => $css_selectors['circle'],
2296 ),
2297 ),
2298 )
2299 );
2300
2301 $this->register_jet_control(
2302 'jet_fb_progress_passed_page_heading',
2303 array(
2304 'tab' => 'style',
2305 'type' => 'separator',
2306 'label' => esc_html__( 'Passed page', 'jet-form-builder' ),
2307 )
2308 );
2309
2310 $this->register_jet_control(
2311 'jet_fb_progress_passed_page_color',
2312 array(
2313 'tab' => 'style',
2314 'label' => esc_html__( 'Color', 'jet-form-builder' ),
2315 'type' => 'color',
2316 'css' => array(
2317 array(
2318 'property' => 'color',
2319 'selector' => $css_selectors['passed-page'],
2320 ),
2321 ),
2322 )
2323 );
2324
2325 $this->register_jet_control(
2326 'jet_fb_progress_passed_page_bg_color',
2327 array(
2328 'tab' => 'style',
2329 'label' => esc_html__( 'Background color', 'jet-form-builder' ),
2330 'type' => 'color',
2331 'css' => array( array( 'property' => '--jfb-progress-passed-page-bgc' ) ),
2332 )
2333 );
2334
2335 $this->register_jet_control(
2336 'jet_fb_progress_passed_page_border_color',
2337 array(
2338 'tab' => 'style',
2339 'label' => esc_html__( 'Border color', 'jet-form-builder' ),
2340 'type' => 'color',
2341 'css' => array(
2342 array(
2343 'property' => 'border-color',
2344 'selector' => '.passed-page ' . $css_selectors['item'],
2345 ),
2346 ),
2347 )
2348 );
2349
2350 $this->register_jet_control(
2351 'jet_fb_progress_passed_page_separator_height',
2352 array(
2353 'tab' => 'style',
2354 'label' => esc_html__( 'Separator height', 'jet-form-builder' ),
2355 'type' => 'number',
2356 'units' => true,
2357 'min' => 1,
2358 'max' => 100,
2359 'css' => array( array( 'property' => '--jfb-progress-passed-page-separator-h' ) ),
2360 )
2361 );
2362
2363 $this->register_jet_control(
2364 'jet_fb_progress_passed_page_separator_color',
2365 array(
2366 'tab' => 'style',
2367 'label' => esc_html__( 'Separator color', 'jet-form-builder' ),
2368 'type' => 'color',
2369 'css' => array( array( 'property' => '--jfb-progress-passed-page-separator-color' ) ),
2370 )
2371 );
2372
2373 $this->register_jet_control(
2374 'jet_fb_progress_passed_page_circle_border_color',
2375 array(
2376 'tab' => 'style',
2377 'label' => esc_html__( 'Circle border color', 'jet-form-builder' ),
2378 'type' => 'color',
2379 'css' => array(
2380 array(
2381 'property' => 'border-color',
2382 'selector' => '.passed-page ' . $css_selectors['circle'],
2383 ),
2384 ),
2385 )
2386 );
2387
2388 $this->register_jet_control(
2389 'jet_fb_progress_active_page_heading',
2390 array(
2391 'tab' => 'style',
2392 'type' => 'separator',
2393 'label' => esc_html__( 'Active page', 'jet-form-builder' ),
2394 )
2395 );
2396
2397 $this->register_jet_control(
2398 'jet_fb_progress_active_page_color',
2399 array(
2400 'tab' => 'style',
2401 'label' => esc_html__( 'Color', 'jet-form-builder' ),
2402 'type' => 'color',
2403 'css' => array(
2404 array(
2405 'property' => 'color',
2406 'selector' => $css_selectors['active-page'],
2407 ),
2408 ),
2409 )
2410 );
2411
2412 $this->register_jet_control(
2413 'jet_fb_progress_active_page_bg_color',
2414 array(
2415 'tab' => 'style',
2416 'label' => esc_html__( 'Background color', 'jet-form-builder' ),
2417 'type' => 'color',
2418 'css' => array( array( 'property' => '--jfb-progress-active-page-bgc' ) ),
2419 )
2420 );
2421
2422 $this->register_jet_control(
2423 'jet_fb_progress_active_page_border_color',
2424 array(
2425 'tab' => 'style',
2426 'label' => esc_html__( 'Border color', 'jet-form-builder' ),
2427 'type' => 'color',
2428 'css' => array(
2429 array(
2430 'property' => 'border-color',
2431 'selector' => '.active-page ' . $css_selectors['item'],
2432 ),
2433 ),
2434 )
2435 );
2436
2437 $this->register_jet_control(
2438 'jet_fb_progress_active_page_separator_height',
2439 array(
2440 'tab' => 'style',
2441 'label' => esc_html__( 'Separator height', 'jet-form-builder' ),
2442 'type' => 'number',
2443 'units' => true,
2444 'min' => 1,
2445 'max' => 100,
2446 'css' => array( array( 'property' => '--jfb-progress-active-page-separator-h' ) ),
2447 )
2448 );
2449
2450 $this->register_jet_control(
2451 'jet_fb_progress_active_page_separator_color',
2452 array(
2453 'tab' => 'style',
2454 'label' => esc_html__( 'Separator color', 'jet-form-builder' ),
2455 'type' => 'color',
2456 'css' => array( array( 'property' => '--jfb-progress-active-page-separator-color' ) ),
2457 )
2458 );
2459
2460 $this->register_jet_control(
2461 'jet_fb_progress_active_page_circle_border_color',
2462 array(
2463 'tab' => 'style',
2464 'label' => esc_html__( 'Circle border color', 'jet-form-builder' ),
2465 'type' => 'color',
2466 'css' => array(
2467 array(
2468 'property' => 'border-color',
2469 'selector' => '.active-page ' . $css_selectors['circle'],
2470 ),
2471 ),
2472 )
2473 );
2474
2475 $this->end_jet_control_group();
2476 }
2477 // End progress pages
2478
2479 // Start message style
2480 public function control_group_message_style() {
2481 $this->register_jet_control_group(
2482 'section_message_style',
2483 array(
2484 'title' => esc_html__( 'Messages', 'jet-form-builder' ),
2485 'tab' => 'style',
2486 )
2487 );
2488 }
2489
2490 public function controls_message_style() {
2491 $this->start_jet_control_group( 'section_message_style' );
2492
2493 $css_selectors = array(
2494 'success' => $this->css_selector( '-message--success' ),
2495 'error' => $this->css_selector( '-message--error' ),
2496 );
2497
2498 $this->register_jet_control(
2499 'message_margin',
2500 array(
2501 'tab' => 'style',
2502 'label' => esc_html__( 'Margin', 'jet-form-builder' ),
2503 'type' => 'dimensions',
2504 'css' => array(
2505 array(
2506 'property' => 'margin',
2507 'selector' => $css_selectors['success'],
2508 ),
2509 array(
2510 'property' => 'margin',
2511 'selector' => $css_selectors['error'],
2512 ),
2513 ),
2514 )
2515 );
2516
2517 $this->register_jet_control(
2518 'message_padding',
2519 array(
2520 'tab' => 'style',
2521 'label' => esc_html__( 'Padding', 'jet-form-builder' ),
2522 'type' => 'dimensions',
2523 'css' => array(
2524 array(
2525 'property' => 'padding',
2526 'selector' => $css_selectors['success'],
2527 ),
2528 array(
2529 'property' => 'padding',
2530 'selector' => $css_selectors['error'],
2531 ),
2532 ),
2533 )
2534 );
2535
2536 $this->register_jet_control(
2537 'message_success_heading',
2538 array(
2539 'tab' => 'style',
2540 'type' => 'separator',
2541 'label' => esc_html__( 'Success message', 'jet-form-builder' ),
2542 )
2543 );
2544
2545 $this->register_jet_control(
2546 'message_success_typography',
2547 array(
2548 'tab' => 'style',
2549 'label' => esc_html__( 'Typography', 'jet-form-builder' ),
2550 'type' => 'typography',
2551 'css' => array(
2552 array(
2553 'property' => 'typography',
2554 'selector' => $css_selectors['success'],
2555 ),
2556 ),
2557 )
2558 );
2559
2560 $this->register_jet_control(
2561 'message_success_bg_color',
2562 array(
2563 'tab' => 'style',
2564 'label' => esc_html__( 'Background color', 'jet-form-builder' ),
2565 'type' => 'color',
2566 'css' => array( array( 'property' => '--jfb-message-success-bgc' ) ),
2567 )
2568 );
2569
2570 $this->register_jet_control(
2571 'message_success_border',
2572 array(
2573 'tab' => 'style',
2574 'label' => esc_html__( 'Border', 'jet-form-builder' ),
2575 'type' => 'border',
2576 'css' => array(
2577 array(
2578 'property' => 'border',
2579 'selector' => $css_selectors['success'],
2580 ),
2581 ),
2582 )
2583 );
2584
2585 $this->register_jet_control(
2586 'message_error_heading',
2587 array(
2588 'tab' => 'style',
2589 'type' => 'separator',
2590 'label' => esc_html__( 'Error message', 'jet-form-builder' ),
2591 )
2592 );
2593
2594 $this->register_jet_control(
2595 'message_error_typography',
2596 array(
2597 'tab' => 'style',
2598 'label' => esc_html__( 'Typography', 'jet-form-builder' ),
2599 'type' => 'typography',
2600 'css' => array(
2601 array(
2602 'property' => 'typography',
2603 'selector' => $css_selectors['error'],
2604 ),
2605 ),
2606 )
2607 );
2608
2609 $this->register_jet_control(
2610 'message_error_bg_color',
2611 array(
2612 'tab' => 'style',
2613 'label' => esc_html__( 'Background color', 'jet-form-builder' ),
2614 'type' => 'color',
2615 'css' => array( array( 'property' => '--jfb-message-error-bgc' ) ),
2616 )
2617 );
2618
2619 $this->register_jet_control(
2620 'message_error_border',
2621 array(
2622 'tab' => 'style',
2623 'label' => esc_html__( 'Border', 'jet-form-builder' ),
2624 'type' => 'border',
2625 'css' => array(
2626 array(
2627 'property' => 'border',
2628 'selector' => $css_selectors['error'],
2629 ),
2630 ),
2631 )
2632 );
2633
2634 $this->end_jet_control_group();
2635 }
2636 // End message style
2637
2638
2639 /**
2640 * Enqueue element styles and scripts
2641 *
2642 * @noinspection PhpUnhandledExceptionInspection
2643 */
2644 public function enqueue_scripts() {
2645 $module = jet_form_builder()->compat( 'bricks' );
2646
2647 wp_enqueue_style(
2648 $module->get_handle( 'frontend' ),
2649 $module->get_url( 'assets/build/frontend.css' ),
2650 array( 'jet-form-builder-frontend' ),
2651 Plugin::instance()->get_version()
2652 );
2653 }
2654
2655 /**
2656 * Render element HTML
2657 *
2658 * @noinspection PhpUnhandledExceptionInspection
2659 */
2660 public function render() {
2661
2662 $settings = $this->parse_jet_render_attributes( $this->get_jet_settings() );
2663
2664 // STEP: Form field is empty: Show placeholder text
2665 if ( empty( $settings['form_id'] ) && empty( $settings['form_id_custom'] ) ) {
2666 return $this->render_element_placeholder(
2667 array(
2668 'title' => esc_html__( 'Please select form to show.', 'jet-form-builder' ),
2669 )
2670 );
2671 }
2672
2673 $this->enqueue_scripts();
2674
2675 /** @var Blocks\Module $blocks */
2676 $blocks = jet_form_builder()->module( \Jet_Form_Builder\Blocks\Module::class );
2677
2678 if ( ! empty( $settings['form_id_custom'] ) ) {
2679 $settings['form_id_custom'] = bricks_render_dynamic_data( $settings['form_id_custom'] );
2680 }
2681
2682 // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
2683 echo "<div {$this->render_attributes( '_root' )}>";
2684 $content = do_shortcode( $blocks->get_form_class()->render_callback_field( $settings ) );
2685 // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
2686 echo $content;
2687 echo '</div>';
2688 }
2689
2690 public function css_selector( $mod = null ) {
2691 return sprintf( '%1$s%2$s', '.jet-form-builder', $mod );
2692 }
2693 }
2694