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