PluginProbe ʕ •ᴥ•ʔ
JetFormBuilder — Dynamic Blocks Form Builder / 3.5.2
JetFormBuilder — Dynamic Blocks Form Builder v3.5.2
3.6.5.1 3.6.5 3.6.4.2 3.6.4.1 3.6.4 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 2 years ago form.php 1 year ago widget-base-it.php 2 years ago
form.php
2695 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)" );
477
478 $this->start_jet_control_group( 'section_input_style' );
479
480 $this->register_jet_control(
481 'input_typography',
482 array(
483 'tab' => 'style',
484 'label' => esc_html__( 'Typography', 'jet-form-builder' ),
485 'type' => 'typography',
486 'css' => array(
487 array(
488 'property' => 'typography',
489 'selector' => $css_selector,
490 ),
491 ),
492 )
493 );
494
495 $this->register_jet_control(
496 'input_placeholder_color',
497 array(
498 'tab' => 'style',
499 'label' => esc_html__( 'Placeholder color', 'jet-form-builder' ),
500 'type' => 'color',
501 'css' => array( array( 'property' => '--jfb-input-phc' ) ),
502 )
503 );
504
505 $this->register_jet_control(
506 'input_bg_color',
507 array(
508 'tab' => 'style',
509 'label' => esc_html__( 'Background color', 'jet-form-builder' ),
510 'type' => 'color',
511 'css' => array(
512 array(
513 'property' => 'background-color',
514 'selector' => $css_selector,
515 ),
516 ),
517 )
518 );
519
520 $this->register_jet_control(
521 'input_margin',
522 array(
523 'tab' => 'style',
524 'label' => esc_html__( 'Margin', 'jet-form-builder' ),
525 'type' => 'dimensions',
526 'css' => array(
527 array(
528 'property' => 'margin',
529 'selector' => $css_selector,
530 ),
531 ),
532 )
533 );
534
535 $this->register_jet_control(
536 'input_padding',
537 array(
538 'tab' => 'style',
539 'label' => esc_html__( 'Padding', 'jet-form-builder' ),
540 'type' => 'dimensions',
541 'css' => array(
542 array(
543 'property' => 'padding',
544 'selector' => $css_selector,
545 ),
546 ),
547 )
548 );
549
550 $this->register_jet_control(
551 'input_border',
552 array(
553 'tab' => 'style',
554 'label' => esc_html__( 'Border', 'jet-form-builder' ),
555 'type' => 'border',
556 'css' => array(
557 array(
558 'property' => 'border',
559 'selector' => $css_selector,
560 ),
561 ),
562 )
563 );
564
565 $this->register_jet_control(
566 'input_box_shadow',
567 array(
568 'tab' => 'style',
569 'label' => esc_html__( 'Box shadow', 'jet-form-builder' ),
570 'type' => 'box-shadow',
571 'css' => array(
572 array(
573 'property' => 'box-shadow',
574 'selector' => $css_selector,
575 ),
576 ),
577 )
578 );
579
580 $this->register_jet_control(
581 'input_width',
582 array(
583 'tab' => 'style',
584 'label' => esc_html__( 'Fields width', 'jet-form-builder' ),
585 'type' => 'number',
586 'units' => true,
587 'min' => 50,
588 'max' => 1000,
589 'css' => array( array( 'property' => '--jfb-input-w' ) ),
590 )
591 );
592
593 $this->register_jet_control(
594 'input_textarea_height',
595 array(
596 'tab' => 'style',
597 'label' => esc_html__( 'Textarea height', 'jet-form-builder' ),
598 'type' => 'number',
599 'units' => true,
600 'min' => 10,
601 'max' => 500,
602 'css' => array( array( 'property' => '--jfb-input-h' ) ),
603 )
604 );
605
606 $this->register_jet_control(
607 'input_color_scheme',
608 array(
609 'tab' => 'style',
610 'label' => esc_html__( 'Color scheme', 'jet-form-builder' ),
611 'type' => 'select',
612 'options' => array(
613 'normal' => esc_html__( 'Normal', 'jet-form-builder' ),
614 'light' => esc_html__( 'Light', 'jet-form-builder' ),
615 'dark' => esc_html__( 'Dark', 'jet-form-builder' ),
616 ),
617 'default' => 'normal',
618 'description' => esc_html__( 'Affects default browser UI elements like date and time icons, UI etc.', 'jet-form-builder' ),
619 'css' => array( array( 'property' => '--jfb-input-color-scheme' ) ),
620 )
621 );
622
623 $this->end_jet_control_group();
624 }
625 // End input style
626
627 // Start checkbox & radio fields style
628 public function control_group_checkradio_style() {
629 $this->register_jet_control_group(
630 'section_checkradio_style',
631 array(
632 'title' => esc_html__( 'Checkbox & Radio fields', 'jet-form-builder' ),
633 'tab' => 'style',
634 )
635 );
636 }
637
638 public function controls_checkradio_style() {
639 $this->start_jet_control_group( 'section_checkradio_style' );
640
641 $this->register_jet_control(
642 'checkradio_fields_layout',
643 array(
644 'tab' => 'style',
645 'label' => esc_html__( 'Layout', 'jet-form-builder' ),
646 'type' => 'select',
647 'options' => array(
648 'row' => esc_html__( 'Horizontal', 'jet-form-builder' ),
649 'columns' => esc_html__( 'Vertical', 'jet-form-builder' ),
650 ),
651 'default' => 'column',
652 'css' => array(
653 array(
654 'property' => 'flex-direction',
655 'selector' => $this->css_selector( '__fields-group' ),
656 ),
657 ),
658 )
659 );
660
661 $this->register_jet_control(
662 'checkradio_fields_gaps',
663 array(
664 'tab' => 'style',
665 'label' => esc_html__( 'Gaps', 'jet-form-builder' ),
666 'type' => 'dimensions',
667 'directions' => array(
668 'row' => esc_html__( 'Row', 'jet-form-builder' ),
669 'column' => esc_html__( 'Column', 'jet-form-builder' ),
670 ),
671 'css' => array(
672 array(
673 'property' => '{key}-gap',
674 'selector' => $this->css_selector( '__fields-group' ),
675 ),
676 ),
677 )
678 );
679
680 $this->register_jet_control(
681 'checkradio_fields_gap',
682 array(
683 'tab' => 'style',
684 'label' => esc_html__( 'Gap between control and label', 'jet-form-builder' ),
685 'type' => 'number',
686 'units' => true,
687 'min' => 0,
688 'max' => 50,
689 'css' => array(
690 array(
691 'property' => 'gap',
692 'selector' => $this->css_selector( '__field-wrap.checkradio-wrap span' ),
693 ),
694 ),
695 )
696 );
697
698 $this->register_jet_control(
699 'checkradio_fields_control_size',
700 array(
701 'tab' => 'style',
702 'label' => esc_html__( 'Control size', 'jet-form-builder' ),
703 'type' => 'number',
704 'units' => true,
705 'min' => 0,
706 'max' => 50,
707 'css' => array( array( 'property' => '--jfb-checkradio-fz' ) ),
708 )
709 );
710
711 $this->register_jet_control(
712 'checkradio_fields_typography',
713 array(
714 'tab' => 'style',
715 'label' => esc_html__( 'Typography', 'jet-form-builder' ),
716 'type' => 'typography',
717 'css' => array(
718 array(
719 'property' => 'typography',
720 'selector' => $this->css_selector( '__field-label' ),
721 ),
722 ),
723 )
724 );
725
726 $this->register_jet_control(
727 'checkradio_fields_box_heading',
728 array(
729 'tab' => 'style',
730 'type' => 'separator',
731 'label' => esc_html__( 'Box', 'jet-form-builder' ),
732 )
733 );
734
735 $this->register_jet_control(
736 'checkradio_fields_box_border',
737 array(
738 'tab' => 'style',
739 'label' => esc_html__( 'Border', 'jet-form-builder' ),
740 'type' => 'border',
741 'css' => array(
742 array(
743 'property' => 'border',
744 'selector' => $this->css_selector( '__field-label > span::before' ),
745 ),
746 ),
747 )
748 );
749
750 $this->register_jet_control(
751 'checkradio_fields_box_bg_color',
752 array(
753 'tab' => 'style',
754 'label' => esc_html__( 'Background color', 'jet-form-builder' ),
755 'type' => 'color',
756 'css' => array( array( 'property' => '--jfb-checkradio-input-bgc' ) ),
757 )
758 );
759
760 $this->register_jet_control(
761 'checkradio_fields_box_checked_heading',
762 array(
763 'tab' => 'style',
764 'type' => 'separator',
765 'label' => esc_html__( 'Checked state', 'jet-form-builder' ),
766 )
767 );
768
769 $this->register_jet_control(
770 'checkradio_fields_box_checked_bg',
771 array(
772 'tab' => 'style',
773 'label' => esc_html__( 'Background color', 'jet-form-builder' ),
774 'type' => 'color',
775 'css' => array( array( 'property' => '--jfb-checkradio-input-checked-bgc' ) ),
776 )
777 );
778
779 $this->register_jet_control(
780 'checkradio_fields_box_checked_border_color',
781 array(
782 'tab' => 'style',
783 'label' => esc_html__( 'Border color', 'jet-form-builder' ),
784 'type' => 'color',
785 'css' => array(
786 array(
787 'property' => 'border-color',
788 'selector' => $this->css_selector( '__field-label :checked + span::before' ),
789 ),
790 ),
791 )
792 );
793
794 $this->end_jet_control_group();
795 }
796 // End checkbox & radio fields style
797
798 // Start calculated fields
799 public function control_group_calc_fields_style() {
800 $this->register_jet_control_group(
801 'section_calc_fields_style',
802 array(
803 'title' => esc_html__( 'Calculated fields', 'jet-form-builder' ),
804 'tab' => 'style',
805 )
806 );
807 }
808
809 public function controls_calc_fields_style() {
810 $this->start_jet_control_group( 'section_calc_fields_style' );
811
812 $this->register_jet_control(
813 'calc_fields_align_main_axis',
814 array(
815 'tab' => 'style',
816 'label' => esc_html__( 'Align main axis', 'jet-form-builder' ),
817 'type' => 'justify-content',
818 'css' => array( array( 'property' => '--jfb-calc-justify-content' ) ),
819 )
820 );
821
822 $this->register_jet_control(
823 'calc_fields_gap',
824 array(
825 'tab' => 'style',
826 'label' => esc_html__( 'Gap', 'jet-form-builder' ),
827 'type' => 'number',
828 'units' => true,
829 'min' => 0,
830 'max' => 40,
831 'css' => array( array( 'property' => '--jfb-calc-gap' ) ),
832 )
833 );
834
835 $css_selector = $this->css_selector( '__calculated-field' );
836
837 $this->register_jet_control(
838 'calc_fields_typography',
839 array(
840 'tab' => 'style',
841 'label' => esc_html__( 'Typography', 'jet-form-builder' ),
842 'type' => 'typography',
843 'css' => array(
844 array(
845 'property' => 'typography',
846 'selector' => $css_selector,
847 ),
848 ),
849 )
850 );
851
852 $this->register_jet_control(
853 'calc_fields_prefix_size',
854 array(
855 'tab' => 'style',
856 'label' => esc_html__( 'Prefix size', 'jet-form-builder' ),
857 'type' => 'number',
858 'units' => true,
859 'min' => 10,
860 'max' => 50,
861 'css' => array( array( 'property' => '--jfb-calc-prefix-fz' ) ),
862 )
863 );
864
865 $this->register_jet_control(
866 'calc_fields_prefix_color',
867 array(
868 'tab' => 'style',
869 'label' => esc_html__( 'Prefix color', 'jet-form-builder' ),
870 'type' => 'color',
871 'css' => array( array( 'property' => '--jfb-calc-prefix-color' ) ),
872 )
873 );
874
875 $this->register_jet_control(
876 'calc_fields_suffix_size',
877 array(
878 'tab' => 'style',
879 'label' => esc_html__( 'Suffix size', 'jet-form-builder' ),
880 'type' => 'number',
881 'units' => true,
882 'min' => 10,
883 'max' => 50,
884 'css' => array( array( 'property' => '--jfb-calc-suffix-fz' ) ),
885 )
886 );
887
888 $this->register_jet_control(
889 'calc_fields_suffix_color',
890 array(
891 'tab' => 'style',
892 'label' => esc_html__( 'Suffix color', 'jet-form-builder' ),
893 'type' => 'color',
894 'css' => array( array( 'property' => '--jfb-calc-suffix-color' ) ),
895 )
896 );
897
898 $this->register_jet_control(
899 'calc_fields_bg_color',
900 array(
901 'tab' => 'style',
902 'label' => esc_html__( 'Background color', 'jet-form-builder' ),
903 'type' => 'color',
904 'css' => array( array( 'property' => '--jfb-calc-bgc' ) ),
905 )
906 );
907
908 $this->register_jet_control(
909 'calc_fields_margin',
910 array(
911 'tab' => 'style',
912 'label' => esc_html__( 'Margin', 'jet-form-builder' ),
913 'type' => 'dimensions',
914 'css' => array(
915 array(
916 'property' => 'margin',
917 'selector' => $css_selector,
918 ),
919 ),
920 )
921 );
922
923 $this->register_jet_control(
924 'calc_fields_padding',
925 array(
926 'tab' => 'style',
927 'label' => esc_html__( 'Padding', 'jet-form-builder' ),
928 'type' => 'dimensions',
929 'css' => array(
930 array(
931 'property' => 'padding',
932 'selector' => $css_selector,
933 ),
934 ),
935 )
936 );
937
938 $this->register_jet_control(
939 'calc_fields_border',
940 array(
941 'tab' => 'style',
942 'label' => esc_html__( 'Border', 'jet-form-builder' ),
943 'type' => 'border',
944 'css' => array(
945 array(
946 'property' => 'border',
947 'selector' => $css_selector,
948 ),
949 ),
950 )
951 );
952
953 $this->end_jet_control_group();
954 }
955 // End calculated fields
956
957 // Start range fields
958 public function control_group_range_fields_style() {
959 $this->register_jet_control_group(
960 'section_range_fields_style',
961 array(
962 'title' => esc_html__( 'Range fields', 'jet-form-builder' ),
963 'tab' => 'style',
964 )
965 );
966 }
967
968 public function controls_range_fields_style() {
969 $this->start_jet_control_group( 'section_range_fields_style' );
970
971 $this->register_jet_control(
972 'range_max_width',
973 array(
974 'tab' => 'style',
975 'label' => esc_html__( 'Max width', 'jet-form-builder' ),
976 'type' => 'number',
977 'units' => true,
978 'min' => 1,
979 'max' => 1000,
980 'css' => array( array( 'property' => '--jfb-range-mw' ) ),
981 )
982 );
983
984 $this->register_jet_control(
985 'range_slider_heading',
986 array(
987 'tab' => 'style',
988 'type' => 'separator',
989 'label' => esc_html__( 'Slider', 'jet-form-builder' ),
990 )
991 );
992
993 $this->register_jet_control(
994 'track_height',
995 array(
996 'tab' => 'style',
997 'label' => esc_html__( 'Track height', 'jet-form-builder' ),
998 'type' => 'number',
999 'units' => true,
1000 'min' => 1,
1001 'max' => 20,
1002 'css' => array( array( 'property' => '--jet-fb__range-field-range--height' ) ),
1003 )
1004 );
1005
1006 $this->register_jet_control(
1007 'thumb_size',
1008 array(
1009 'tab' => 'style',
1010 'label' => esc_html__( 'Thumb size', 'jet-form-builder' ),
1011 'type' => 'number',
1012 'units' => true,
1013 'min' => 1,
1014 'max' => 20,
1015 'css' => array( array( 'property' => '--jet-fb__range-field-slider--size' ) ),
1016 )
1017 );
1018
1019 $this->register_jet_control(
1020 'track_border_radius',
1021 array(
1022 'tab' => 'style',
1023 'label' => esc_html__( 'Track border radius', 'jet-form-builder' ),
1024 'type' => 'number',
1025 'units' => true,
1026 'min' => 1,
1027 'max' => 50,
1028 'css' => array( array( 'property' => '--jet-fb__range-field-range--br' ) ),
1029 )
1030 );
1031
1032 $this->register_jet_control(
1033 'thumb_border_radius',
1034 array(
1035 'tab' => 'style',
1036 'label' => esc_html__( 'Thumb border radius', 'jet-form-builder' ),
1037 'type' => 'number',
1038 'units' => true,
1039 'min' => 1,
1040 'max' => 50,
1041 'css' => array( array( 'property' => '--jet-fb__range-field-slider--br' ) ),
1042 )
1043 );
1044
1045 $this->register_jet_control(
1046 'track_bg_color',
1047 array(
1048 'tab' => 'style',
1049 'label' => esc_html__( 'Track color', 'jet-form-builder' ),
1050 'type' => 'color',
1051 'css' => array( array( 'property' => '--jet-fb__range-field-range--bgc' ) ),
1052 )
1053 );
1054
1055 $this->register_jet_control(
1056 'thumb_bg_color',
1057 array(
1058 'tab' => 'style',
1059 'label' => esc_html__( 'Thumb color', 'jet-form-builder' ),
1060 'type' => 'color',
1061 'css' => array( array( 'property' => '--jet-fb__range-field-slider--bgc' ) ),
1062 )
1063 );
1064
1065 $this->register_jet_control(
1066 'range_value_heading',
1067 array(
1068 'tab' => 'style',
1069 'type' => 'separator',
1070 'label' => esc_html__( 'Value', 'jet-form-builder' ),
1071 )
1072 );
1073
1074 $this->register_jet_control(
1075 'range_value_gap',
1076 array(
1077 'tab' => 'style',
1078 'label' => esc_html__( 'Gap', 'jet-form-builder' ),
1079 'type' => 'number',
1080 'units' => true,
1081 'min' => 0,
1082 'max' => 40,
1083 'css' => array( array( 'property' => '--jfb-range-value-gap' ) ),
1084 )
1085 );
1086
1087 $this->register_jet_control(
1088 'range_value_typography',
1089 array(
1090 'tab' => 'style',
1091 'label' => esc_html__( 'Typography', 'jet-form-builder' ),
1092 'type' => 'typography',
1093 'css' => array(
1094 array(
1095 'property' => 'typography',
1096 'selector' => $this->css_selector( '__field-value.range-value' ),
1097 ),
1098 ),
1099 )
1100 );
1101
1102 $this->register_jet_control(
1103 'range_prefix_value_size',
1104 array(
1105 'tab' => 'style',
1106 'label' => esc_html__( 'Prefix size', 'jet-form-builder' ),
1107 'type' => 'number',
1108 'units' => true,
1109 'min' => 10,
1110 'max' => 50,
1111 'css' => array( array( 'property' => '--jfb-range-value-prefix-fz' ) ),
1112 )
1113 );
1114
1115 $this->register_jet_control(
1116 'range_prefix_value_color',
1117 array(
1118 'tab' => 'style',
1119 'label' => esc_html__( 'Prefix color', 'jet-form-builder' ),
1120 'type' => 'color',
1121 'css' => array( array( 'property' => '--jfb-range-value-prefix-color' ) ),
1122 )
1123 );
1124
1125 $this->register_jet_control(
1126 'range_suffix_value_size',
1127 array(
1128 'tab' => 'style',
1129 'label' => esc_html__( 'Suffix size', 'jet-form-builder' ),
1130 'type' => 'number',
1131 'units' => true,
1132 'min' => 10,
1133 'max' => 50,
1134 'css' => array( array( 'property' => '--jfb-range-value-suffix-fz' ) ),
1135 )
1136 );
1137
1138 $this->register_jet_control(
1139 'range_suffix_value_color',
1140 array(
1141 'tab' => 'style',
1142 'label' => esc_html__( 'Suffix color', 'jet-form-builder' ),
1143 'type' => 'color',
1144 'css' => array( array( 'property' => '--jfb-range-value-suffix-color' ) ),
1145 )
1146 );
1147
1148 $this->end_jet_control_group();
1149 }
1150 // End range fields
1151
1152 // Start heading style
1153 public function control_group_heading_style() {
1154 $this->register_jet_control_group(
1155 'section_headings_style',
1156 array(
1157 'title' => esc_html__( 'Heading', 'jet-form-builder' ),
1158 'tab' => 'style',
1159 )
1160 );
1161 }
1162
1163 public function controls_heading_style() {
1164 $this->start_jet_control_group( 'section_headings_style' );
1165
1166 $this->register_jet_control(
1167 'heading_label_heading',
1168 array(
1169 'tab' => 'style',
1170 'type' => 'separator',
1171 'label' => esc_html__( 'Label', 'jet-form-builder' ),
1172 )
1173 );
1174
1175 $css_selectors = array(
1176 'label' => $this->css_selector( '__heading' ),
1177 'label-text' => $this->css_selector( '__heading' ) . ' ' . $this->css_selector( '__label-text' ),
1178 'desc' => $this->css_selector( '__heading-desc' ),
1179 );
1180
1181 $this->register_jet_control(
1182 'heading_label_typography',
1183 array(
1184 'tab' => 'style',
1185 'label' => esc_html__( 'Typography', 'jet-form-builder' ),
1186 'type' => 'typography',
1187 'css' => array(
1188 array(
1189 'property' => 'typography',
1190 'selector' => $css_selectors['label-text'],
1191 ),
1192 ),
1193 )
1194 );
1195
1196 $this->register_jet_control(
1197 'heading_label_bg_color',
1198 array(
1199 'tab' => 'style',
1200 'label' => esc_html__( 'Background color', 'jet-form-builder' ),
1201 'type' => 'color',
1202 'css' => array( array( 'property' => '--jfb-heading-bgc' ) ),
1203 )
1204 );
1205
1206 $this->register_jet_control(
1207 'heading_label_margin',
1208 array(
1209 'tab' => 'style',
1210 'label' => esc_html__( 'Margin', 'jet-form-builder' ),
1211 'type' => 'dimensions',
1212 'css' => array(
1213 array(
1214 'property' => 'margin',
1215 'selector' => $css_selectors['label'],
1216 ),
1217 ),
1218 )
1219 );
1220
1221 $this->register_jet_control(
1222 'heading_label_padding',
1223 array(
1224 'tab' => 'style',
1225 'label' => esc_html__( 'Padding', 'jet-form-builder' ),
1226 'type' => 'dimensions',
1227 'css' => array(
1228 array(
1229 'property' => 'padding',
1230 'selector' => $css_selectors['label'],
1231 ),
1232 ),
1233 )
1234 );
1235
1236 $this->register_jet_control(
1237 'heading_label_border',
1238 array(
1239 'tab' => 'style',
1240 'label' => esc_html__( 'Border', 'jet-form-builder' ),
1241 'type' => 'border',
1242 'css' => array(
1243 array(
1244 'property' => 'border',
1245 'selector' => $css_selectors['label'],
1246 ),
1247 ),
1248 )
1249 );
1250
1251 $this->register_jet_control(
1252 'heading_desc_heading',
1253 array(
1254 'tab' => 'style',
1255 'type' => 'separator',
1256 'label' => esc_html__( 'Description', 'jet-form-builder' ),
1257 )
1258 );
1259
1260 $this->register_jet_control(
1261 'heading_desc_typography',
1262 array(
1263 'tab' => 'style',
1264 'label' => esc_html__( 'Typography', 'jet-form-builder' ),
1265 'type' => 'typography',
1266 'css' => array(
1267 array(
1268 'property' => 'typography',
1269 'selector' => $css_selectors['desc'],
1270 ),
1271 ),
1272 )
1273 );
1274
1275 $this->register_jet_control(
1276 'heading_desc_bg_color',
1277 array(
1278 'tab' => 'style',
1279 'label' => esc_html__( 'Background color', 'jet-form-builder' ),
1280 'type' => 'color',
1281 'css' => array( array( 'property' => '--jfb-heading-desc-bgc' ) ),
1282 )
1283 );
1284
1285 $this->register_jet_control(
1286 'heading_desc_margin',
1287 array(
1288 'tab' => 'style',
1289 'label' => esc_html__( 'Margin', 'jet-form-builder' ),
1290 'type' => 'dimensions',
1291 'css' => array(
1292 array(
1293 'property' => 'margin',
1294 'selector' => $css_selectors['desc'],
1295 ),
1296 ),
1297 )
1298 );
1299
1300 $this->register_jet_control(
1301 'heading_desc_padding',
1302 array(
1303 'tab' => 'style',
1304 'label' => esc_html__( 'Padding', 'jet-form-builder' ),
1305 'type' => 'dimensions',
1306 'css' => array(
1307 array(
1308 'property' => 'padding',
1309 'selector' => $css_selectors['desc'],
1310 ),
1311 ),
1312 )
1313 );
1314
1315 $this->register_jet_control(
1316 'heading_desc_border',
1317 array(
1318 'tab' => 'style',
1319 'label' => esc_html__( 'Border', 'jet-form-builder' ),
1320 'type' => 'border',
1321 'css' => array(
1322 array(
1323 'property' => 'border',
1324 'selector' => $css_selectors['desc'],
1325 ),
1326 ),
1327 )
1328 );
1329
1330 $this->end_jet_control_group();
1331 }
1332 // End heading style
1333
1334 // Start repeater style
1335 public function control_group_repeater_style() {
1336 $this->register_jet_control_group(
1337 'section_repeater_style',
1338 array(
1339 'title' => esc_html__( 'Repeater', 'jet-form-builder' ),
1340 'tab' => 'style',
1341 )
1342 );
1343 }
1344
1345 public function controls_repeater_style() {
1346 $this->start_jet_control_group( 'section_repeater_style' );
1347
1348 $this->register_jet_control(
1349 'repeater_row_heading',
1350 array(
1351 'tab' => 'style',
1352 'type' => 'separator',
1353 'label' => esc_html__( 'Repeater row', 'jet-form-builder' ),
1354 )
1355 );
1356
1357 $css_selectors = array(
1358 'row' => $this->css_selector( '-repeater__row' ),
1359 'new' => $this->css_selector( '-repeater__new' ),
1360 'remove' => $this->css_selector( '-repeater__remove' ),
1361 );
1362
1363 $this->register_jet_control(
1364 'booking_form_repeater_row_padding',
1365 array(
1366 'tab' => 'style',
1367 'label' => esc_html__( 'Padding', 'jet-form-builder' ),
1368 'type' => 'dimensions',
1369 'css' => array(
1370 array(
1371 'property' => 'padding',
1372 'selector' => $css_selectors['row'],
1373 ),
1374 ),
1375 )
1376 );
1377
1378 $this->register_jet_control(
1379 'repeater_add_button_heading',
1380 array(
1381 'tab' => 'style',
1382 'type' => 'separator',
1383 'label' => esc_html__( 'New item button', 'jet-form-builder' ),
1384 )
1385 );
1386
1387 $this->register_jet_control(
1388 'booking_form_repeater_align_main_axis',
1389 array(
1390 'tab' => 'style',
1391 'label' => esc_html__( 'Align main axis', 'jet-form-builder' ),
1392 'type' => 'justify-content',
1393 'exclude' => array(
1394 'space-between',
1395 'space-around',
1396 'space-evenly',
1397 ),
1398 'css' => array( array( 'property' => '--jfb-repeater-add-button-justify-content' ) ),
1399 )
1400 );
1401
1402 $this->register_jet_control(
1403 'booking_form_repeater_typography',
1404 array(
1405 'tab' => 'style',
1406 'label' => esc_html__( 'Typography', 'jet-form-builder' ),
1407 'type' => 'typography',
1408 'css' => array(
1409 array(
1410 'property' => 'typography',
1411 'selector' => $css_selectors['new'],
1412 ),
1413 ),
1414 )
1415 );
1416
1417 $this->register_jet_control(
1418 'booking_form_repeater_bg_color',
1419 array(
1420 'tab' => 'style',
1421 'label' => esc_html__( 'Background color', 'jet-form-builder' ),
1422 'type' => 'color',
1423 'css' => array(
1424 array(
1425 'property' => 'background-color',
1426 'selector' => $css_selectors['new'],
1427 ),
1428 ),
1429 )
1430 );
1431
1432 $this->register_jet_control(
1433 'booking_form_repeater_margin',
1434 array(
1435 'tab' => 'style',
1436 'label' => esc_html__( 'Margin', 'jet-form-builder' ),
1437 'type' => 'dimensions',
1438 'css' => array(
1439 array(
1440 'property' => 'margin',
1441 'selector' => $css_selectors['new'],
1442 ),
1443 ),
1444 )
1445 );
1446
1447 $this->register_jet_control(
1448 'booking_form_repeater_padding',
1449 array(
1450 'tab' => 'style',
1451 'label' => esc_html__( 'Padding', 'jet-form-builder' ),
1452 'type' => 'dimensions',
1453 'css' => array(
1454 array(
1455 'property' => 'padding',
1456 'selector' => $css_selectors['new'],
1457 ),
1458 ),
1459 )
1460 );
1461
1462 $this->register_jet_control(
1463 'booking_form_repeater_border',
1464 array(
1465 'tab' => 'style',
1466 'label' => esc_html__( 'Border', 'jet-form-builder' ),
1467 'type' => 'border',
1468 'css' => array(
1469 array(
1470 'property' => 'border',
1471 'selector' => $css_selectors['new'],
1472 ),
1473 ),
1474 )
1475 );
1476
1477 $this->register_jet_control(
1478 'booking_form_repeater_box_shadow',
1479 array(
1480 'tab' => 'style',
1481 'label' => esc_html__( 'Box shadow', 'jet-form-builder' ),
1482 'type' => 'box-shadow',
1483 'css' => array(
1484 array(
1485 'property' => 'box-shadow',
1486 'selector' => $css_selectors['new'],
1487 ),
1488 ),
1489 )
1490 );
1491
1492 $this->register_jet_control(
1493 'repeater_rem_button_heading',
1494 array(
1495 'tab' => 'style',
1496 'type' => 'separator',
1497 'label' => esc_html__( 'Remove item button', 'jet-form-builder' ),
1498 )
1499 );
1500
1501 $this->register_jet_control(
1502 'booking_form_repeater_rem_size',
1503 array(
1504 'tab' => 'style',
1505 'label' => esc_html__( 'Icon size', 'jet-form-builder' ),
1506 'type' => 'number',
1507 'units' => true,
1508 'min' => 12,
1509 'max' => 90,
1510 'css' => array( array( 'property' => '--jfb-repeater-rem-button-fz' ) ),
1511 )
1512 );
1513
1514 $this->register_jet_control(
1515 'booking_form_repeater_rem_color',
1516 array(
1517 'tab' => 'style',
1518 'label' => esc_html__( 'Color', 'jet-form-builder' ),
1519 'type' => 'color',
1520 'css' => array( array( 'property' => '--jfb-repeater-rem-button-color' ) ),
1521 )
1522 );
1523
1524 $this->register_jet_control(
1525 'booking_form_repeater_rem_bg_color',
1526 array(
1527 'tab' => 'style',
1528 'label' => esc_html__( 'Background color', 'jet-form-builder' ),
1529 'type' => 'color',
1530 'css' => array( array( 'property' => '--jfb-repeater-rem-button-bgc' ) ),
1531 )
1532 );
1533
1534 $this->register_jet_control(
1535 'booking_form_repeater_rem_margin',
1536 array(
1537 'tab' => 'style',
1538 'label' => esc_html__( 'Margin', 'jet-form-builder' ),
1539 'type' => 'dimensions',
1540 'css' => array(
1541 array(
1542 'property' => 'margin',
1543 'selector' => $css_selectors['remove'],
1544 ),
1545 ),
1546 )
1547 );
1548
1549 $this->register_jet_control(
1550 'booking_form_repeater_rem_padding',
1551 array(
1552 'tab' => 'style',
1553 'label' => esc_html__( 'Padding', 'jet-form-builder' ),
1554 'type' => 'dimensions',
1555 'css' => array(
1556 array(
1557 'property' => 'padding',
1558 'selector' => $css_selectors['remove'],
1559 ),
1560 ),
1561 )
1562 );
1563
1564 $this->register_jet_control(
1565 'booking_form_repeater_rem_border',
1566 array(
1567 'tab' => 'style',
1568 'label' => esc_html__( 'Border', 'jet-form-builder' ),
1569 'type' => 'border',
1570 'css' => array(
1571 array(
1572 'property' => 'border',
1573 'selector' => $css_selectors['remove'],
1574 ),
1575 ),
1576 )
1577 );
1578
1579 $this->register_jet_control(
1580 'booking_form_repeater_rem_box_shadow',
1581 array(
1582 'tab' => 'style',
1583 'label' => esc_html__( 'Box shadow', 'jet-form-builder' ),
1584 'type' => 'box-shadow',
1585 'css' => array(
1586 array(
1587 'property' => 'box-shadow',
1588 'selector' => $css_selectors['remove'],
1589 ),
1590 ),
1591 )
1592 );
1593
1594 $this->end_jet_control_group();
1595 }
1596 // End repeater style
1597
1598 // Start conditional style
1599 public function control_group_conditional_style() {
1600 $this->register_jet_control_group(
1601 'section_conditional_style',
1602 array(
1603 'title' => esc_html__( 'Conditional', 'jet-form-builder' ),
1604 'tab' => 'style',
1605 )
1606 );
1607 }
1608
1609 public function controls_conditional_style() {
1610 $this->start_jet_control_group( 'section_conditional_style' );
1611
1612 $this->register_jet_control(
1613 'conditional_bg_color',
1614 array(
1615 'tab' => 'style',
1616 'label' => esc_html__( 'Background color', 'jet-form-builder' ),
1617 'type' => 'color',
1618 'css' => array( array( 'property' => '--jfb-conditional-bgc' ) ),
1619 )
1620 );
1621
1622 $css_selector = $this->css_selector( '__conditional' );
1623
1624 $this->register_jet_control(
1625 'conditional_margin',
1626 array(
1627 'tab' => 'style',
1628 'label' => esc_html__( 'Margin', 'jet-form-builder' ),
1629 'type' => 'dimensions',
1630 'css' => array(
1631 array(
1632 'property' => 'margin',
1633 'selector' => $css_selector,
1634 ),
1635 ),
1636 )
1637 );
1638
1639 $this->register_jet_control(
1640 'conditional_padding',
1641 array(
1642 'tab' => 'style',
1643 'label' => esc_html__( 'Padding', 'jet-form-builder' ),
1644 'type' => 'dimensions',
1645 'css' => array(
1646 array(
1647 'property' => 'padding',
1648 'selector' => $css_selector,
1649 ),
1650 ),
1651 )
1652 );
1653
1654 $this->register_jet_control(
1655 'conditional_border',
1656 array(
1657 'tab' => 'style',
1658 'label' => esc_html__( 'Border', 'jet-form-builder' ),
1659 'type' => 'border',
1660 'css' => array(
1661 array(
1662 'property' => 'border',
1663 'selector' => $css_selector,
1664 ),
1665 ),
1666 )
1667 );
1668
1669 $this->end_jet_control_group();
1670 }
1671 // End conditional style
1672
1673 // Start submit style
1674 public function control_group_submit_style() {
1675 $this->register_jet_control_group(
1676 'section_submit_style',
1677 array(
1678 'title' => esc_html__( 'Submit', 'jet-form-builder' ),
1679 'tab' => 'style',
1680 )
1681 );
1682 }
1683
1684 public function controls_submit_style() {
1685 $this->start_jet_control_group( 'section_submit_style' );
1686
1687 $this->register_jet_control(
1688 'booking_form_submit_align_main_axis',
1689 array(
1690 'tab' => 'style',
1691 'label' => esc_html__( 'Align main axis', 'jet-form-builder' ),
1692 'type' => 'justify-content',
1693 'exclude' => array(
1694 'space-between',
1695 'space-around',
1696 'space-evenly',
1697 ),
1698 'css' => array( array( 'property' => '--jfb-submit-justify-content' ) ),
1699 )
1700 );
1701
1702 $this->register_jet_control(
1703 'booking_form_submit_width',
1704 array(
1705 'tab' => 'style',
1706 'label' => esc_html__( 'Width', 'jet-form-builder' ),
1707 'type' => 'number',
1708 'units' => true,
1709 'min' => 1,
1710 'max' => 1000,
1711 'css' => array( array( 'property' => '--jfb-submit-w' ) ),
1712 )
1713 );
1714
1715 $css_selector = $this->css_selector( '__submit' );
1716
1717 $this->register_jet_control(
1718 'booking_form_submit_typography',
1719 array(
1720 'tab' => 'style',
1721 'label' => esc_html__( 'Typography', 'jet-form-builder' ),
1722 'type' => 'typography',
1723 'css' => array(
1724 array(
1725 'property' => 'typography',
1726 'selector' => $css_selector,
1727 ),
1728 ),
1729 )
1730 );
1731
1732 $this->register_jet_control(
1733 'booking_form_submit_bg_color',
1734 array(
1735 'tab' => 'style',
1736 'label' => esc_html__( 'Background color', 'jet-form-builder' ),
1737 'type' => 'color',
1738 'css' => array(
1739 array(
1740 'property' => 'background-color',
1741 'selector' => $css_selector,
1742 ),
1743 ),
1744 )
1745 );
1746
1747 $this->register_jet_control(
1748 'booking_form_submit_margin',
1749 array(
1750 'tab' => 'style',
1751 'label' => esc_html__( 'Margin', 'jet-form-builder' ),
1752 'type' => 'dimensions',
1753 'css' => array(
1754 array(
1755 'property' => 'margin',
1756 'selector' => $css_selector,
1757 ),
1758 ),
1759 )
1760 );
1761
1762 $this->register_jet_control(
1763 'booking_form_submit_padding',
1764 array(
1765 'tab' => 'style',
1766 'label' => esc_html__( 'Padding', 'jet-form-builder' ),
1767 'type' => 'dimensions',
1768 'css' => array(
1769 array(
1770 'property' => 'padding',
1771 'selector' => $css_selector,
1772 ),
1773 ),
1774 )
1775 );
1776
1777 $this->register_jet_control(
1778 'booking_form_submit_border',
1779 array(
1780 'tab' => 'style',
1781 'label' => esc_html__( 'Border', 'jet-form-builder' ),
1782 'type' => 'border',
1783 'css' => array(
1784 array(
1785 'property' => 'border',
1786 'selector' => $css_selector,
1787 ),
1788 ),
1789 )
1790 );
1791
1792 $this->register_jet_control(
1793 'booking_form_submit_box_shadow',
1794 array(
1795 'tab' => 'style',
1796 'label' => esc_html__( 'Box shadow', 'jet-form-builder' ),
1797 'type' => 'box-shadow',
1798 'css' => array(
1799 array(
1800 'property' => 'box-shadow',
1801 'selector' => $css_selector,
1802 ),
1803 ),
1804 )
1805 );
1806
1807 $this->end_jet_control_group();
1808 }
1809 // End label style
1810
1811 // Start form break style
1812 public function control_group_form_break_style() {
1813 $this->register_jet_control_group(
1814 'section_form_break_style',
1815 array(
1816 'title' => esc_html__( 'Form Break Row', 'jet-form-builder' ),
1817 'tab' => 'style',
1818 )
1819 );
1820 }
1821
1822 public function controls_form_break_style() {
1823 $this->start_jet_control_group( 'section_form_break_style' );
1824
1825 $this->register_jet_control(
1826 'form_break_notice',
1827 array(
1828 'tab' => 'content',
1829 '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' ),
1830 'type' => 'info',
1831 )
1832 );
1833
1834 $this->register_jet_control(
1835 'form_break_alignment',
1836 array(
1837 'tab' => 'style',
1838 'label' => esc_html__( 'Text align', 'jet-form-builder' ),
1839 'type' => 'text-align',
1840 'css' => array( array( 'property' => '--jfb-break-text-align' ) ),
1841 )
1842 );
1843
1844 $css_selector = $this->css_selector( '__next-page-wrap' );
1845
1846 $this->register_jet_control(
1847 'form_break_padding',
1848 array(
1849 'tab' => 'style',
1850 'label' => esc_html__( 'Padding', 'jet-form-builder' ),
1851 'type' => 'dimensions',
1852 'css' => array(
1853 array(
1854 'property' => 'padding',
1855 'selector' => $css_selector,
1856 ),
1857 ),
1858 )
1859 );
1860
1861 $this->register_jet_control(
1862 'form_break_border',
1863 array(
1864 'tab' => 'style',
1865 'label' => esc_html__( 'Border', 'jet-form-builder' ),
1866 'type' => 'border',
1867 'css' => array(
1868 array(
1869 'property' => 'border',
1870 'selector' => $css_selector,
1871 ),
1872 ),
1873 )
1874 );
1875
1876 $this->end_jet_control_group();
1877 }
1878 // End form break style
1879
1880 // Start form break buttons style
1881 public function control_group_form_break_buttons_style() {
1882 $this->register_jet_control_group(
1883 'section_form_break_next_style',
1884 array(
1885 'title' => esc_html__( 'Form Break Buttons', 'jet-form-builder' ),
1886 'tab' => 'style',
1887 )
1888 );
1889 }
1890
1891 public function controls_form_break_buttons_style() {
1892 $this->start_jet_control_group( 'section_form_break_next_style' );
1893
1894 $css_selectors = array(
1895 'prev' => $this->css_selector( '__prev-page' ),
1896 'next' => $this->css_selector( '__next-page' ),
1897 );
1898
1899 $this->register_jet_control(
1900 'form_break_next_notice',
1901 array(
1902 'tab' => 'content',
1903 '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' ),
1904 'type' => 'info',
1905 )
1906 );
1907
1908 $this->register_jet_control(
1909 'form_break_button_typography',
1910 array(
1911 'tab' => 'style',
1912 'label' => esc_html__( 'Typography', 'jet-form-builder' ),
1913 'type' => 'typography',
1914 'css' => array(
1915 array(
1916 'property' => 'typography',
1917 'selector' => $css_selectors['prev'],
1918 ),
1919 array(
1920 'property' => 'typography',
1921 'selector' => $css_selectors['next'],
1922 ),
1923 ),
1924 )
1925 );
1926
1927 $this->register_jet_control(
1928 'form_break_button_bg_color',
1929 array(
1930 'tab' => 'style',
1931 'label' => esc_html__( 'Background color', 'jet-form-builder' ),
1932 'type' => 'color',
1933 'css' => array(
1934 array(
1935 'property' => 'background-color',
1936 'selector' => $css_selectors['prev'],
1937 ),
1938 array(
1939 'property' => 'background-color',
1940 'selector' => $css_selectors['next'],
1941 ),
1942 ),
1943 )
1944 );
1945
1946 $this->register_jet_control(
1947 'form_break_button_margin',
1948 array(
1949 'tab' => 'style',
1950 'label' => esc_html__( 'Margin', 'jet-form-builder' ),
1951 'type' => 'dimensions',
1952 'css' => array(
1953 array(
1954 'property' => 'margin',
1955 'selector' => $css_selectors['prev'],
1956 ),
1957 array(
1958 'property' => 'margin',
1959 'selector' => $css_selectors['next'],
1960 ),
1961 ),
1962 )
1963 );
1964
1965 $this->register_jet_control(
1966 'form_break_button_padding',
1967 array(
1968 'tab' => 'style',
1969 'label' => esc_html__( 'Padding', 'jet-form-builder' ),
1970 'type' => 'dimensions',
1971 'css' => array(
1972 array(
1973 'property' => 'padding',
1974 'selector' => $css_selectors['prev'],
1975 ),
1976 array(
1977 'property' => 'padding',
1978 'selector' => $css_selectors['next'],
1979 ),
1980 ),
1981 )
1982 );
1983
1984 $this->register_jet_control(
1985 'form_break_button_border',
1986 array(
1987 'tab' => 'style',
1988 'label' => esc_html__( 'Border', 'jet-form-builder' ),
1989 'type' => 'border',
1990 'css' => array(
1991 array(
1992 'property' => 'border',
1993 'selector' => $css_selectors['prev'],
1994 ),
1995 array(
1996 'property' => 'border',
1997 'selector' => $css_selectors['next'],
1998 ),
1999 ),
2000 )
2001 );
2002
2003 $this->end_jet_control_group();
2004 }
2005 // End form break buttons style
2006
2007 // Start form break disabled message style
2008 public function control_group_form_break_message_style() {
2009 $this->register_jet_control_group(
2010 'section_form_break_message_style',
2011 array(
2012 'title' => esc_html__( 'Form Break Disabled Message', 'jet-form-builder' ),
2013 'tab' => 'style',
2014 )
2015 );
2016 }
2017
2018 public function controls_form_break_message_style() {
2019 $this->start_jet_control_group( 'section_form_break_message_style' );
2020
2021 $css_selector = $this->css_selector( '__next-page-msg' );
2022
2023 $this->register_jet_control(
2024 'form_break_message_typography',
2025 array(
2026 'tab' => 'style',
2027 'label' => esc_html__( 'Typography', 'jet-form-builder' ),
2028 'type' => 'typography',
2029 'css' => array(
2030 array(
2031 'property' => 'typography',
2032 'selector' => $css_selector,
2033 ),
2034 ),
2035 )
2036 );
2037
2038 $this->register_jet_control(
2039 'form_break_message_bg_color',
2040 array(
2041 'tab' => 'style',
2042 'label' => esc_html__( 'Background color', 'jet-form-builder' ),
2043 'type' => 'color',
2044 'css' => array( array( 'property' => '--jfb-break-message-bgc' ) ),
2045 )
2046 );
2047
2048 $this->register_jet_control(
2049 'form_break_message_margin',
2050 array(
2051 'tab' => 'style',
2052 'label' => esc_html__( 'Margin', 'jet-form-builder' ),
2053 'type' => 'dimensions',
2054 'css' => array(
2055 array(
2056 'property' => 'margin',
2057 'selector' => $css_selector,
2058 ),
2059 ),
2060 )
2061 );
2062
2063 $this->register_jet_control(
2064 'form_break_message_padding',
2065 array(
2066 'tab' => 'style',
2067 'label' => esc_html__( 'Padding', 'jet-form-builder' ),
2068 'type' => 'dimensions',
2069 'css' => array(
2070 array(
2071 'property' => 'padding',
2072 'selector' => $css_selector,
2073 ),
2074 ),
2075 )
2076 );
2077
2078 $this->register_jet_control(
2079 'form_break_message_border',
2080 array(
2081 'tab' => 'style',
2082 'label' => esc_html__( 'Border', 'jet-form-builder' ),
2083 'type' => 'border',
2084 'css' => array(
2085 array(
2086 'property' => 'border',
2087 'selector' => $css_selector,
2088 ),
2089 ),
2090 )
2091 );
2092
2093 $this->end_jet_control_group();
2094 }
2095 // End form break disabled message style
2096
2097 // Start progress wrap
2098 public function control_group_form_progress_wrap_style() {
2099 $this->register_jet_control_group(
2100 'jet_fb_progress_wrapper_section',
2101 array(
2102 'title' => esc_html__( 'Form Progress - Wrapper', 'jet-form-builder' ),
2103 'tab' => 'style',
2104 )
2105 );
2106 }
2107
2108 public function controls_form_progress_wrap_style() {
2109 $this->start_jet_control_group( 'jet_fb_progress_wrapper_section' );
2110
2111 $this->register_jet_control(
2112 'jet_fb_progress_wrapper_bg_color',
2113 array(
2114 'tab' => 'style',
2115 'label' => esc_html__( 'Background color', 'jet-form-builder' ),
2116 'type' => 'color',
2117 'css' => array( array( 'property' => '--jfb-progress-wrapper-bgc' ) ),
2118 )
2119 );
2120
2121 $css_selector = $this->css_selector( '-progress-pages' );
2122
2123 $this->register_jet_control(
2124 'jet_fb_progress_wrapper_margin',
2125 array(
2126 'tab' => 'style',
2127 'label' => esc_html__( 'Margin', 'jet-form-builder' ),
2128 'type' => 'dimensions',
2129 'css' => array(
2130 array(
2131 'property' => 'margin',
2132 'selector' => $css_selector,
2133 ),
2134 ),
2135 )
2136 );
2137
2138 $this->register_jet_control(
2139 'jet_fb_progress_wrapper_padding',
2140 array(
2141 'tab' => 'style',
2142 'label' => esc_html__( 'Padding', 'jet-form-builder' ),
2143 'type' => 'dimensions',
2144 'css' => array(
2145 array(
2146 'property' => 'padding',
2147 'selector' => $css_selector,
2148 ),
2149 ),
2150 )
2151 );
2152
2153 $this->register_jet_control(
2154 'jet_fb_progress_wrapper_border',
2155 array(
2156 'tab' => 'style',
2157 'label' => esc_html__( 'Border', 'jet-form-builder' ),
2158 'type' => 'border',
2159 'css' => array(
2160 array(
2161 'property' => 'border',
2162 'selector' => $css_selector,
2163 ),
2164 ),
2165 )
2166 );
2167
2168 $this->end_jet_control_group();
2169 }
2170 // End progress wrap
2171
2172 // Start progress pages
2173 public function control_group_form_progress_pages_style() {
2174 $this->register_jet_control_group(
2175 'jet_fb_progress_pages_section',
2176 array(
2177 'title' => esc_html__( 'Form Progress - Pages', 'jet-form-builder' ),
2178 'tab' => 'style',
2179 )
2180 );
2181 }
2182
2183 public function controls_form_progress_pages_style() {
2184 $this->start_jet_control_group( 'jet_fb_progress_pages_section' );
2185
2186 $css_selectors = array(
2187 'wrapper' => $this->css_selector( '-progress-pages__item--wrapper' ),
2188 'item' => $this->css_selector( '-progress-pages__item' ),
2189 'circle' => $this->css_selector( '-progress-pages__item--circle' ),
2190 'passed-page' => $this->css_selector( '-progress-pages__item--wrapper.passed-page' ),
2191 'active-page' => $this->css_selector( '-progress-pages__item--wrapper.active-page' ),
2192 );
2193
2194 $this->register_jet_control(
2195 'jet_fb_progress_wrapper_typography',
2196 array(
2197 'tab' => 'style',
2198 'label' => esc_html__( 'Typography', 'jet-form-builder' ),
2199 'type' => 'typography',
2200 'css' => array(
2201 array(
2202 'property' => 'typography',
2203 'selector' => $css_selectors['wrapper'],
2204 ),
2205 ),
2206 )
2207 );
2208
2209 $this->register_jet_control(
2210 'jet_fb_progress_pages_bg_color',
2211 array(
2212 'tab' => 'style',
2213 'label' => esc_html__( 'Background color', 'jet-form-builder' ),
2214 'type' => 'color',
2215 'css' => array( array( 'property' => '--jfb-progress-default-page-bgc' ) ),
2216 )
2217 );
2218
2219 $this->register_jet_control(
2220 'jet_fb_progress_pages_margin',
2221 array(
2222 'tab' => 'style',
2223 'label' => esc_html__( 'Margin', 'jet-form-builder' ),
2224 'type' => 'dimensions',
2225 'css' => array(
2226 array(
2227 'property' => 'margin',
2228 'selector' => $css_selectors['item'],
2229 ),
2230 ),
2231 )
2232 );
2233
2234 $this->register_jet_control(
2235 'jet_fb_progress_pages_padding',
2236 array(
2237 'tab' => 'style',
2238 'label' => esc_html__( 'Padding', 'jet-form-builder' ),
2239 'type' => 'dimensions',
2240 'css' => array(
2241 array(
2242 'property' => 'padding',
2243 'selector' => $css_selectors['item'],
2244 ),
2245 ),
2246 )
2247 );
2248
2249 $this->register_jet_control(
2250 'jet_fb_progress_pages_border',
2251 array(
2252 'tab' => 'style',
2253 'label' => esc_html__( 'Border', 'jet-form-builder' ),
2254 'type' => 'border',
2255 'css' => array(
2256 array(
2257 'property' => 'border',
2258 'selector' => $css_selectors['item'],
2259 ),
2260 ),
2261 )
2262 );
2263
2264 $this->register_jet_control(
2265 'jet_fb_progress_separator_height',
2266 array(
2267 'tab' => 'style',
2268 'label' => esc_html__( 'Separator height', 'jet-form-builder' ),
2269 'type' => 'number',
2270 'units' => true,
2271 'min' => 1,
2272 'max' => 100,
2273 'css' => array( array( 'property' => '--jfb-progress-default-page-separator-h' ) ),
2274 )
2275 );
2276
2277 $this->register_jet_control(
2278 'jet_fb_progress_separator_color',
2279 array(
2280 'tab' => 'style',
2281 'label' => esc_html__( 'Separator color', 'jet-form-builder' ),
2282 'type' => 'color',
2283 'css' => array( array( 'property' => '--jfb-progress-default-page-separator-color' ) ),
2284 )
2285 );
2286
2287 $this->register_jet_control(
2288 'jet_fb_progress_circle_border',
2289 array(
2290 'tab' => 'style',
2291 'label' => esc_html__( 'Circle border', 'jet-form-builder' ),
2292 'type' => 'border',
2293 'css' => array(
2294 array(
2295 'property' => 'border',
2296 'selector' => $css_selectors['circle'],
2297 ),
2298 ),
2299 )
2300 );
2301
2302 $this->register_jet_control(
2303 'jet_fb_progress_passed_page_heading',
2304 array(
2305 'tab' => 'style',
2306 'type' => 'separator',
2307 'label' => esc_html__( 'Passed page', 'jet-form-builder' ),
2308 )
2309 );
2310
2311 $this->register_jet_control(
2312 'jet_fb_progress_passed_page_color',
2313 array(
2314 'tab' => 'style',
2315 'label' => esc_html__( 'Color', 'jet-form-builder' ),
2316 'type' => 'color',
2317 'css' => array(
2318 array(
2319 'property' => 'color',
2320 'selector' => $css_selectors['passed-page'],
2321 ),
2322 ),
2323 )
2324 );
2325
2326 $this->register_jet_control(
2327 'jet_fb_progress_passed_page_bg_color',
2328 array(
2329 'tab' => 'style',
2330 'label' => esc_html__( 'Background color', 'jet-form-builder' ),
2331 'type' => 'color',
2332 'css' => array( array( 'property' => '--jfb-progress-passed-page-bgc' ) ),
2333 )
2334 );
2335
2336 $this->register_jet_control(
2337 'jet_fb_progress_passed_page_border_color',
2338 array(
2339 'tab' => 'style',
2340 'label' => esc_html__( 'Border color', 'jet-form-builder' ),
2341 'type' => 'color',
2342 'css' => array(
2343 array(
2344 'property' => 'border-color',
2345 'selector' => '.passed-page ' . $css_selectors['item'],
2346 ),
2347 ),
2348 )
2349 );
2350
2351 $this->register_jet_control(
2352 'jet_fb_progress_passed_page_separator_height',
2353 array(
2354 'tab' => 'style',
2355 'label' => esc_html__( 'Separator height', 'jet-form-builder' ),
2356 'type' => 'number',
2357 'units' => true,
2358 'min' => 1,
2359 'max' => 100,
2360 'css' => array( array( 'property' => '--jfb-progress-passed-page-separator-h' ) ),
2361 )
2362 );
2363
2364 $this->register_jet_control(
2365 'jet_fb_progress_passed_page_separator_color',
2366 array(
2367 'tab' => 'style',
2368 'label' => esc_html__( 'Separator color', 'jet-form-builder' ),
2369 'type' => 'color',
2370 'css' => array( array( 'property' => '--jfb-progress-passed-page-separator-color' ) ),
2371 )
2372 );
2373
2374 $this->register_jet_control(
2375 'jet_fb_progress_passed_page_circle_border_color',
2376 array(
2377 'tab' => 'style',
2378 'label' => esc_html__( 'Circle border color', 'jet-form-builder' ),
2379 'type' => 'color',
2380 'css' => array(
2381 array(
2382 'property' => 'border-color',
2383 'selector' => '.passed-page ' . $css_selectors['circle'],
2384 ),
2385 ),
2386 )
2387 );
2388
2389 $this->register_jet_control(
2390 'jet_fb_progress_active_page_heading',
2391 array(
2392 'tab' => 'style',
2393 'type' => 'separator',
2394 'label' => esc_html__( 'Active page', 'jet-form-builder' ),
2395 )
2396 );
2397
2398 $this->register_jet_control(
2399 'jet_fb_progress_active_page_color',
2400 array(
2401 'tab' => 'style',
2402 'label' => esc_html__( 'Color', 'jet-form-builder' ),
2403 'type' => 'color',
2404 'css' => array(
2405 array(
2406 'property' => 'color',
2407 'selector' => $css_selectors['active-page'],
2408 ),
2409 ),
2410 )
2411 );
2412
2413 $this->register_jet_control(
2414 'jet_fb_progress_active_page_bg_color',
2415 array(
2416 'tab' => 'style',
2417 'label' => esc_html__( 'Background color', 'jet-form-builder' ),
2418 'type' => 'color',
2419 'css' => array( array( 'property' => '--jfb-progress-active-page-bgc' ) ),
2420 )
2421 );
2422
2423 $this->register_jet_control(
2424 'jet_fb_progress_active_page_border_color',
2425 array(
2426 'tab' => 'style',
2427 'label' => esc_html__( 'Border color', 'jet-form-builder' ),
2428 'type' => 'color',
2429 'css' => array(
2430 array(
2431 'property' => 'border-color',
2432 'selector' => '.active-page ' . $css_selectors['item'],
2433 ),
2434 ),
2435 )
2436 );
2437
2438 $this->register_jet_control(
2439 'jet_fb_progress_active_page_separator_height',
2440 array(
2441 'tab' => 'style',
2442 'label' => esc_html__( 'Separator height', 'jet-form-builder' ),
2443 'type' => 'number',
2444 'units' => true,
2445 'min' => 1,
2446 'max' => 100,
2447 'css' => array( array( 'property' => '--jfb-progress-active-page-separator-h' ) ),
2448 )
2449 );
2450
2451 $this->register_jet_control(
2452 'jet_fb_progress_active_page_separator_color',
2453 array(
2454 'tab' => 'style',
2455 'label' => esc_html__( 'Separator color', 'jet-form-builder' ),
2456 'type' => 'color',
2457 'css' => array( array( 'property' => '--jfb-progress-active-page-separator-color' ) ),
2458 )
2459 );
2460
2461 $this->register_jet_control(
2462 'jet_fb_progress_active_page_circle_border_color',
2463 array(
2464 'tab' => 'style',
2465 'label' => esc_html__( 'Circle border color', 'jet-form-builder' ),
2466 'type' => 'color',
2467 'css' => array(
2468 array(
2469 'property' => 'border-color',
2470 'selector' => '.active-page ' . $css_selectors['circle'],
2471 ),
2472 ),
2473 )
2474 );
2475
2476 $this->end_jet_control_group();
2477 }
2478 // End progress pages
2479
2480 // Start message style
2481 public function control_group_message_style() {
2482 $this->register_jet_control_group(
2483 'section_message_style',
2484 array(
2485 'title' => esc_html__( 'Messages', 'jet-form-builder' ),
2486 'tab' => 'style',
2487 )
2488 );
2489 }
2490
2491 public function controls_message_style() {
2492 $this->start_jet_control_group( 'section_message_style' );
2493
2494 $css_selectors = array(
2495 'success' => $this->css_selector( '-message--success' ),
2496 'error' => $this->css_selector( '-message--error' ),
2497 );
2498
2499 $this->register_jet_control(
2500 'message_margin',
2501 array(
2502 'tab' => 'style',
2503 'label' => esc_html__( 'Margin', 'jet-form-builder' ),
2504 'type' => 'dimensions',
2505 'css' => array(
2506 array(
2507 'property' => 'margin',
2508 'selector' => $css_selectors['success'],
2509 ),
2510 array(
2511 'property' => 'margin',
2512 'selector' => $css_selectors['error'],
2513 ),
2514 ),
2515 )
2516 );
2517
2518 $this->register_jet_control(
2519 'message_padding',
2520 array(
2521 'tab' => 'style',
2522 'label' => esc_html__( 'Padding', 'jet-form-builder' ),
2523 'type' => 'dimensions',
2524 'css' => array(
2525 array(
2526 'property' => 'padding',
2527 'selector' => $css_selectors['success'],
2528 ),
2529 array(
2530 'property' => 'padding',
2531 'selector' => $css_selectors['error'],
2532 ),
2533 ),
2534 )
2535 );
2536
2537 $this->register_jet_control(
2538 'message_success_heading',
2539 array(
2540 'tab' => 'style',
2541 'type' => 'separator',
2542 'label' => esc_html__( 'Success message', 'jet-form-builder' ),
2543 )
2544 );
2545
2546 $this->register_jet_control(
2547 'message_success_typography',
2548 array(
2549 'tab' => 'style',
2550 'label' => esc_html__( 'Typography', 'jet-form-builder' ),
2551 'type' => 'typography',
2552 'css' => array(
2553 array(
2554 'property' => 'typography',
2555 'selector' => $css_selectors['success'],
2556 ),
2557 ),
2558 )
2559 );
2560
2561 $this->register_jet_control(
2562 'message_success_bg_color',
2563 array(
2564 'tab' => 'style',
2565 'label' => esc_html__( 'Background color', 'jet-form-builder' ),
2566 'type' => 'color',
2567 'css' => array( array( 'property' => '--jfb-message-success-bgc' ) ),
2568 )
2569 );
2570
2571 $this->register_jet_control(
2572 'message_success_border',
2573 array(
2574 'tab' => 'style',
2575 'label' => esc_html__( 'Border', 'jet-form-builder' ),
2576 'type' => 'border',
2577 'css' => array(
2578 array(
2579 'property' => 'border',
2580 'selector' => $css_selectors['success'],
2581 ),
2582 ),
2583 )
2584 );
2585
2586 $this->register_jet_control(
2587 'message_error_heading',
2588 array(
2589 'tab' => 'style',
2590 'type' => 'separator',
2591 'label' => esc_html__( 'Error message', 'jet-form-builder' ),
2592 )
2593 );
2594
2595 $this->register_jet_control(
2596 'message_error_typography',
2597 array(
2598 'tab' => 'style',
2599 'label' => esc_html__( 'Typography', 'jet-form-builder' ),
2600 'type' => 'typography',
2601 'css' => array(
2602 array(
2603 'property' => 'typography',
2604 'selector' => $css_selectors['error'],
2605 ),
2606 ),
2607 )
2608 );
2609
2610 $this->register_jet_control(
2611 'message_error_bg_color',
2612 array(
2613 'tab' => 'style',
2614 'label' => esc_html__( 'Background color', 'jet-form-builder' ),
2615 'type' => 'color',
2616 'css' => array( array( 'property' => '--jfb-message-error-bgc' ) ),
2617 )
2618 );
2619
2620 $this->register_jet_control(
2621 'message_error_border',
2622 array(
2623 'tab' => 'style',
2624 'label' => esc_html__( 'Border', 'jet-form-builder' ),
2625 'type' => 'border',
2626 'css' => array(
2627 array(
2628 'property' => 'border',
2629 'selector' => $css_selectors['error'],
2630 ),
2631 ),
2632 )
2633 );
2634
2635 $this->end_jet_control_group();
2636 }
2637 // End message style
2638
2639
2640 /**
2641 * Enqueue element styles and scripts
2642 *
2643 * @noinspection PhpUnhandledExceptionInspection
2644 */
2645 public function enqueue_scripts() {
2646 $module = jet_form_builder()->compat( 'bricks' );
2647
2648 wp_enqueue_style(
2649 $module->get_handle( 'frontend' ),
2650 $module->get_url( 'assets/build/frontend.css' ),
2651 array( 'jet-form-builder-frontend' ),
2652 Plugin::instance()->get_version()
2653 );
2654 }
2655
2656 /**
2657 * Render element HTML
2658 *
2659 * @noinspection PhpUnhandledExceptionInspection
2660 */
2661 public function render() {
2662
2663 $settings = $this->parse_jet_render_attributes( $this->get_jet_settings() );
2664
2665 // STEP: Form field is empty: Show placeholder text
2666 if ( empty( $settings['form_id'] ) && empty( $settings['form_id_custom'] ) ) {
2667 return $this->render_element_placeholder(
2668 array(
2669 'title' => esc_html__( 'Please select form to show.', 'jet-form-builder' ),
2670 )
2671 );
2672 }
2673
2674 $this->enqueue_scripts();
2675
2676 /** @var Blocks\Module $blocks */
2677 $blocks = jet_form_builder()->module( \Jet_Form_Builder\Blocks\Module::class );
2678
2679 if ( ! empty( $settings['form_id_custom'] ) ) {
2680 $settings['form_id_custom'] = bricks_render_dynamic_data( $settings['form_id_custom'] );
2681 }
2682
2683 // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
2684 echo "<div {$this->render_attributes( '_root' )}>";
2685 $content = do_shortcode( $blocks->get_form_class()->render_callback_field( $settings ) );
2686 // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
2687 echo $content;
2688 echo '</div>';
2689 }
2690
2691 public function css_selector( $mod = null ) {
2692 return sprintf( '%1$s%2$s', '.jet-form-builder', $mod );
2693 }
2694 }
2695