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