PluginProbe ʕ •ᴥ•ʔ
JetFormBuilder — Dynamic Blocks Form Builder / 3.5.6.3
JetFormBuilder — Dynamic Blocks Form Builder v3.5.6.3
3.6.3.1 3.6.3 3.6.2.2 3.6.2.1 3.6.2 3.6.1.1 3.6.1 3.6.0.1 trunk 1.0.0 1.0.1 1.0.2 1.0.3 1.1.0 1.1.1 1.1.2 1.1.3 1.1.4 1.1.5 1.1.6 1.1.7 1.2.0 1.2.1 1.2.2 1.2.3 1.2.4 1.2.5 1.2.6 1.2.7 1.3.0 1.3.1 1.3.2 1.3.3 1.4.0 1.4.1 1.4.2 1.4.3 1.5.0 1.5.1 1.5.2 1.5.3 1.5.4 1.5.5 2.0.0 2.0.1 2.0.2 2.0.3 2.0.4 2.0.5 2.0.6 2.1.0 2.1.1 2.1.10 2.1.11 2.1.2 2.1.3 2.1.4 2.1.5 2.1.6 2.1.7 2.1.8 2.1.9 3.0.0 3.0.0.1 3.0.0.2 3.0.0.3 3.0.1 3.0.1.1 3.0.2 3.0.3 3.0.4 3.0.5 3.0.6 3.0.7 3.0.8 3.0.9 3.1.0 3.1.0.1 3.1.1 3.1.2 3.1.3 3.1.4 3.1.5 3.1.6 3.1.7 3.1.8 3.1.9 3.2.0 3.2.1 3.2.2 3.2.3 3.3.0 3.3.1 3.3.2 3.3.3 3.3.3.1 3.3.4 3.3.4.1 3.3.4.2 3.4.0 3.4.1 3.4.2 3.4.3 3.4.4 3.4.5 3.4.5.1 3.4.5.2 3.4.6 3.4.7 3.4.7.1 3.5.0 3.5.1 3.5.1.1 3.5.1.2 3.5.2 3.5.2.1 3.5.3 3.5.4 3.5.5 3.5.6 3.5.6.1 3.5.6.2 3.5.6.3 3.6.0
jetformbuilder / compatibility / elementor / widgets / form.php
jetformbuilder / compatibility / elementor / widgets Last commit date
form.php 8 months ago widget-base-it.php 2 years ago
form.php
3861 lines
1 <?php
2
3
4 namespace JFB_Compatibility\Elementor\Widgets;
5
6 use Elementor\Controls_Manager;
7 use Elementor\Group_Control_Border;
8 use Elementor\Group_Control_Box_Shadow;
9 use Elementor\Group_Control_Typography;
10 use Elementor\Widget_Base;
11 use Jet_Form_Builder\Admin\Tabs_Handlers\Tab_Handler_Manager;
12 use Jet_Form_Builder\Blocks\Modules\General_Style_Functions;
13 use Jet_Form_Builder\Classes\Arguments\Form_Arguments;
14 use Jet_Form_Builder\Classes\Tools;
15
16 // If this file is called directly, abort.
17 if ( ! defined( 'WPINC' ) ) {
18 die;
19 }
20
21 class Form extends Widget_Base implements Widget_Base_It {
22
23 use General_Style_Functions;
24
25 public function init_hooks() {
26 add_filter(
27 'jet-engine/booking-form/combine-selector',
28 array( $this, 'combine_selector' ),
29 10,
30 3
31 );
32
33 add_filter(
34 'jet-engine/forms/pre-render-form',
35 array( $this, 'booking_form_render' ),
36 10,
37 2
38 );
39
40 add_action(
41 'elementor/element/jet-engine-booking-form/section_general/after_section_start',
42 array( $this, 'after_general_section_start' ),
43 10,
44 2
45 );
46
47 add_action(
48 'elementor/element/jet-engine-booking-form/section_general/before_section_end',
49 array( $this, 'update_general_form_controls' ),
50 10,
51 2
52 );
53
54 add_action(
55 'elementor/element/jet-engine-booking-form/section_range_fields_style/before_section_end',
56 array( $this, 'update_section_range_fields_style' ),
57 10,
58 2
59 );
60
61 add_action(
62 'elementor/element/jet-engine-booking-form/form_submit_style/before_section_end',
63 array( $this, 'update_form_submit_style' ),
64 10,
65 2
66 );
67
68 add_action(
69 'elementor/element/jet-engine-booking-form/section_rows_style/before_section_end',
70 array( $this, 'update_section_rows_style' ),
71 10,
72 2
73 );
74
75 add_action(
76 'elementor/element/jet-engine-booking-form/section_fields_style/before_section_end',
77 array( $this, 'update_section_fields_style' ),
78 10,
79 2
80 );
81
82 add_action(
83 'elementor/element/jet-engine-booking-form/section_checkradio_fields_style/before_section_end',
84 array( $this, 'update_section_checkradio_fields_style' ),
85 10,
86 2
87 );
88 add_action(
89 'elementor/element/jet-engine-booking-form/section_checkradio_fields_style/after_section_end',
90 array( $this, 'after_section_checkradio_fields_style' ),
91 10,
92 2
93 );
94 // form_prev_page_style
95 add_action(
96 'elementor/element/jet-engine-booking-form/form_prev_page_style/after_section_end',
97 array( $this, 'after_form_prev_page_style' ),
98 10,
99 2
100 );
101 }
102
103
104 /**
105 * @return string
106 */
107 public function get_name() {
108 return 'jet-form-builder-form';
109 }
110
111 public function get_title() {
112 return __( 'JetForm', 'jet-form-builder' );
113 }
114
115 public function get_icon() {
116 return 'jet-form-builder-icon--form';
117 }
118
119 public function get_categories() {
120 return array( 'jet-form-builder' );
121 }
122
123 public function get_style_depends() {
124 return array( 'jet-form-builder-frontend' );
125 }
126
127 private function jet_form_builder_slug() {
128 return jet_form_builder()->post_type->slug();
129 }
130
131 private function jet_engine_form_slug() {
132 return jet_engine()->forms->slug();
133 }
134
135 public function combine_selector( $additional, $engine_selector, $control_id ) {
136 if ( ! $control_id ) {
137 return $this->selector( $engine_selector );
138 }
139
140 switch ( $control_id ) {
141 case 'labels_v_alignment':
142 return $this->selector( '-row' );
143 case 'fields_background_color':
144 return $this->selector( '__field:not(.checkradio-field):not(.range-field):not(.%s-repeater)' );
145 case 'field_messages_font_size':
146 case 'field_messages_color':
147 case 'field_messages_margin':
148 case 'field_messages_alignment':
149 return $this->selector( '-file-upload__errors' );
150 }
151
152 return '';
153 }
154
155
156 public function after_general_section_start( $element, $args ) {
157 $element->add_control(
158 'form_provider',
159 array(
160 'label' => __( 'Choose Provider', 'jet-form-builder' ),
161 'type' => Controls_Manager::SELECT,
162 'options' => array(
163 $this->jet_form_builder_slug() => __( 'JetFormBuilder', 'jet-form-builder' ),
164 $this->jet_engine_form_slug() => __( 'JetEngine', 'jet-form-builder' ),
165 ),
166 'default' => $this->jet_engine_form_slug(),
167 )
168 );
169
170 $element->add_control(
171 'form_id',
172 array(
173 'label' => __( 'Select JetForm', 'jet-form-builder' ),
174 'type' => 'jet-query',
175 'query_type' => 'post',
176 'query' => array(
177 'post_type' => $this->jet_form_builder_slug(),
178 ),
179 'condition' => array( 'form_provider' => $this->jet_form_builder_slug() ),
180 )
181 );
182 }
183
184 public function update_general_form_controls( $element, $args ) {
185 $element->update_control(
186 '_form_id',
187 array(
188 'condition' => array( 'form_provider' => $this->jet_engine_form_slug() ),
189 )
190 );
191 $element->update_control(
192 'fields_label_tag',
193 array(
194 'condition' => array( 'form_provider' => $this->jet_engine_form_slug() ),
195 )
196 );
197 $element->update_control(
198 'cache_form',
199 array(
200 'condition' => array( 'form_provider' => $this->jet_engine_form_slug() ),
201 )
202 );
203 $element->add_control(
204 'enable_progress',
205 array(
206 'label' => __( 'Enable form pages progress', 'jet-form-builder' ),
207 'type' => Controls_Manager::SWITCHER,
208 'condition' => array( 'form_provider' => $this->jet_form_builder_slug() ),
209 )
210 );
211 }
212
213 public function update_section_rows_style( $element, $args ) {
214 $element->update_control(
215 'rows_divider',
216 array(
217 'condition' => array( 'form_provider' => $this->jet_engine_form_slug() ),
218 )
219 );
220 $element->update_control(
221 'rows_divider_height',
222 array(
223 'condition' => array( 'form_provider' => $this->jet_engine_form_slug() ),
224 ),
225 array( 'recursive' => true )
226 );
227 $element->update_control(
228 'rows_divider_color',
229 array(
230 'condition' => array( 'form_provider' => $this->jet_engine_form_slug() ),
231 ),
232 array( 'recursive' => true )
233 );
234 $element->update_control(
235 'cols_gap',
236 array(
237 'selectors' => array(
238 $this->selector( ' .wp-block-column:not(:first-child)' ) => 'margin-left: {{SIZE}}{{UNIT}};',
239 ),
240 ),
241 array( 'recursive' => true )
242 );
243 }
244
245 public function update_section_fields_style( $element, $args ) {
246 $element->update_control(
247 'fields_placeholder_color',
248 array(
249 'selectors' => array(
250 $this->selector( ' ::-webkit-input-placeholder' ) => 'color: {{VALUE}};',
251 $this->selector( ' ::-ms-input-placeholder' ) => 'color: {{VALUE}};',
252 $this->selector( ' ::-moz-placeholder' ) => 'color: {{VALUE}};',
253 $this->selector( ' :-moz-placeholder' ) => 'color: {{VALUE}};',
254 ),
255 ),
256 array( 'recursive' => true )
257 );
258 }
259
260 public function update_section_checkradio_fields_style( $element, $args ) {
261 $element->update_control(
262 'checkradio_fields_gap',
263 array(
264 'selectors' => array(
265 'body:not(.rtl) ' . $this->selector( '__field-wrap.checkradio-wrap span::before' ) => 'margin-right: {{SIZE}}{{UNIT}};',
266 'body.rtl ' . $this->selector( '__field-wrap.checkradio-wrap span::before' ) => 'margin-left: {{SIZE}}{{UNIT}};',
267 ),
268 ),
269 array( 'recursive' => true )
270 );
271 }
272
273 public function after_section_checkradio_fields_style( $booking_form, $args ) {
274 $booking_form->start_controls_section(
275 'builder__checkbox_field_style_section',
276 $this->on_fb(
277 array(
278 'label' => __( 'JetForm Checkbox', 'jet-form-builder' ),
279 'tab' => Controls_Manager::TAB_STYLE,
280 )
281 )
282 );
283
284 $booking_form->add_control(
285 'builder__checkbox_show_decorator',
286 array(
287 'label' => __( 'Show Checkbox', 'jet-form-builder' ),
288 'type' => Controls_Manager::CHOOSE,
289 'options' => array(
290 'inline-block' => array(
291 'title' => __( 'Yes', 'jet-form-builder' ),
292 'icon' => 'fa fa-check',
293 ),
294 'none' => array(
295 'title' => __( 'No', 'jet-form-builder' ),
296 'icon' => 'fa fa-times',
297 ),
298 ),
299 'default' => 'inline-block',
300 'selectors' => array(
301 $this->selector( '__field-wrap .for-checkbox span::before' ) => 'display:{{VALUE}};',
302 ),
303 )
304 );
305
306 $booking_form->add_responsive_control(
307 'builder__checkbox_size',
308 array(
309 'label' => __( 'Checkbox Size', 'jet-form-builder' ),
310 'type' => Controls_Manager::SLIDER,
311 'size_units' => array( 'px', 'em', 'rem', 'custom' ),
312 'range' => array(
313 'px' => array(
314 'min' => 0,
315 'max' => 50,
316 ),
317 ),
318 'selectors' => array(
319 $this->selector( '__field-wrap .for-checkbox span::before' ) => 'font-size: {{SIZE}}{{UNIT}};',
320 ),
321 'condition' => array(
322 'builder__checkbox_show_decorator' => 'inline-block',
323 ),
324 )
325 );
326
327 $booking_form->start_controls_tabs( 'builder__checkbox_state_styles' );
328
329 $booking_form->start_controls_tab(
330 'builder__checkbox_state--normal',
331 array(
332 'label' => esc_html__( 'Normal', 'jet-form-builder' ),
333 )
334 );
335 $this->add_border(
336 $booking_form,
337 'builder__checkbox_state--normal__border',
338 $this->selector( '__field-wrap .for-checkbox span::before' )
339 );
340
341 $booking_form->add_control(
342 'builder__checkbox_state--normal__bg_color',
343 array(
344 'label' => __( 'Background Color', 'jet-form-builder' ),
345 'type' => Controls_Manager::COLOR,
346 'selectors' => array(
347 $this->selector( '__field-wrap .for-checkbox span::before' ) => 'background-color: {{VALUE}}',
348 ),
349 )
350 );
351
352 $booking_form->end_controls_tab();
353
354 $booking_form->start_controls_tab(
355 'builder__checkbox_state--checked',
356 array(
357 'label' => esc_html__( 'Checked', 'jet-form-builder' ),
358 )
359 );
360
361 $this->add_border(
362 $booking_form,
363 'builder__checkbox_state--checked__border',
364 $this->selector( '__field-wrap label.for-checkbox :checked + span::before' )
365 );
366 $booking_form->add_control(
367 'builder__checkbox_state--checked__bg_color',
368 array(
369 'label' => __( 'Background Color', 'jet-form-builder' ),
370 'type' => Controls_Manager::COLOR,
371 'selectors' => array(
372 $this->selector( '__field-wrap label.for-checkbox :checked + span::before' ) => 'background-color: {{VALUE}}',
373 ),
374 )
375 );
376
377 $booking_form->end_controls_tab();
378 $booking_form->end_controls_tabs();
379 $booking_form->end_controls_section();
380
381 $booking_form->start_controls_section(
382 'builder__radio_field_style_section',
383 $this->on_fb(
384 array(
385 'label' => __( 'JetForm Radio', 'jet-form-builder' ),
386 'tab' => Controls_Manager::TAB_STYLE,
387 )
388 )
389 );
390 $booking_form->add_control(
391 'builder__radio_show_decorator',
392 array(
393 'label' => __( 'Show Radio', 'jet-form-builder' ),
394 'type' => Controls_Manager::CHOOSE,
395 'default' => 'inline-block',
396 'options' => array(
397 'inline-block' => array(
398 'title' => __( 'Yes', 'jet-form-builder' ),
399 'icon' => 'fa fa-check',
400 ),
401 'none' => array(
402 'title' => __( 'No', 'jet-form-builder' ),
403 'icon' => 'fa fa-times',
404 ),
405 ),
406 'selectors' => array(
407 $this->selector( '__field-wrap .for-radio span::before' ) => 'display:{{VALUE}};',
408 ),
409 )
410 );
411
412 $booking_form->add_responsive_control(
413 'builder__radio_size',
414 array(
415 'label' => __( 'Radio Size', 'jet-form-builder' ),
416 'type' => Controls_Manager::SLIDER,
417 'size_units' => array( 'px', 'em', 'rem', 'custom' ),
418 'range' => array(
419 'px' => array(
420 'min' => 0,
421 'max' => 50,
422 ),
423 ),
424 'selectors' => array(
425 $this->selector( '__field-wrap .for-radio span::before' ) => 'font-size: {{SIZE}}{{UNIT}};',
426 ),
427 'condition' => array(
428 'builder__radio_show_decorator' => 'inline-block',
429 ),
430 )
431 );
432
433 $booking_form->start_controls_tabs( 'builder__radio_state_styles' );
434
435 $booking_form->start_controls_tab(
436 'builder__radio_state--normal',
437 array(
438 'label' => esc_html__( 'Normal', 'jet-form-builder' ),
439 )
440 );
441 $this->add_border(
442 $booking_form,
443 'builder__radio_state--normal__border',
444 $this->selector( '__field-wrap .for-radio span::before' )
445 );
446 $booking_form->add_control(
447 'builder__radio_state--normal__bg_color',
448 array(
449 'label' => __( 'Background Color', 'jet-form-builder' ),
450 'type' => Controls_Manager::COLOR,
451 'selectors' => array(
452 $this->selector( '__field-wrap .for-radio span::before' ) => 'background-color: {{VALUE}}',
453 ),
454 )
455 );
456
457 $booking_form->end_controls_tab();
458
459 $booking_form->start_controls_tab(
460 'builder__radio_state--checked',
461 array(
462 'label' => esc_html__( 'Checked', 'jet-form-builder' ),
463 )
464 );
465 $this->add_border(
466 $booking_form,
467 'builder__radio_state--checked__border',
468 $this->selector( '__field-wrap label.for-radio :checked + span::before' )
469 );
470 $booking_form->add_control(
471 'builder__radio_state--checked__bg_color',
472 array(
473 'label' => __( 'Background Color', 'jet-form-builder' ),
474 'type' => Controls_Manager::COLOR,
475 'selectors' => array(
476 $this->selector( '__field-wrap label.for-radio :checked + span::before' ) => 'background-color: {{VALUE}}',
477 ),
478 )
479 );
480
481 $booking_form->end_controls_tab();
482 $booking_form->end_controls_tabs();
483 $booking_form->end_controls_section();
484 }
485
486 public function after_form_prev_page_style( $element, $args ) {
487 $this->run_form_progress_controls(
488 $element,
489 array( $this, 'selector' ),
490 array( $this, 'on_fb' )
491 );
492 }
493
494 public function update_section_range_fields_style( $element, $args ) {
495 $range_obj = jet_form_builder()->blocks->get_field_by_name( 'range-field' );
496
497 $element->update_control(
498 'track_height',
499 array(
500 'selectors' => array(
501 $this->selector() => $range_obj::CSS_VAR_RANGE_HEIGHT . ': {{SIZE}}{{UNIT}};',
502 ),
503 ),
504 array( 'recursive' => true )
505 );
506 $element->update_control(
507 'thumb_size',
508 array(
509 'selectors' => array(
510 $this->selector() => $range_obj::CSS_VAR_SLIDER_SIZE . ': {{SIZE}}{{UNIT}};',
511 ),
512 ),
513 array( 'recursive' => true )
514 );
515
516 $element->update_control(
517 'track_border_radius',
518 array(
519 'selectors' => array(
520 $this->selector( '__field.range-field::-webkit-slider-runnable-track' ) => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
521 $this->selector( '__field.range-field::-moz-range-track' ) => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
522 $this->selector( '__field.range-field::-ms-track' ) => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
523 ),
524 ),
525 array( 'recursive' => true )
526 );
527 $element->update_control(
528 'thumb_border_radius',
529 array(
530 'selectors' => array(
531 $this->selector( '__field.range-field::-webkit-slider-thumb' ) => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
532 $this->selector( '__field.range-field::-moz-range-thumb' ) => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
533 $this->selector( '__field.range-field::-ms-thumb' ) => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
534 ),
535 ),
536 array( 'recursive' => true )
537 );
538
539 $element->update_control(
540 'track_bg_color',
541 array(
542 'selectors' => array(
543 $this->selector( '__field.range-field::-webkit-slider-runnable-track' ) => 'background-color: {{VALUE}};',
544 $this->selector( '__field.range-field::-moz-range-track' ) => 'background-color: {{VALUE}};',
545 $this->selector( '__field.range-field::-ms-track' ) => 'background-color: {{VALUE}};',
546 ),
547 ),
548 array( 'recursive' => true )
549 );
550 $element->update_control(
551 'thumb_bg_color',
552 array(
553 'selectors' => array(
554 $this->selector( '__field.range-field::-webkit-slider-thumb' ) => 'background-color: {{VALUE}};',
555 $this->selector( '__field.range-field::-moz-range-thumb' ) => 'background-color: {{VALUE}};',
556 $this->selector( '__field.range-field::-ms-thumb' ) => 'background-color: {{VALUE}};',
557 ),
558 ),
559 array( 'recursive' => true )
560 );
561 }
562
563 public function update_form_submit_style( $element, $args ) {
564 $element->update_control(
565 'booking_form_submit_alignment',
566 array(
567 'selectors' => array(
568 $this->selector( '__submit' ) => 'justify-content: center;',
569 ),
570 ),
571 array( 'recursive' => true )
572 );
573 }
574
575
576 private function on_fb( $args ) {
577 return array_merge(
578 $args,
579 array(
580 'condition' => array(
581 'form_provider' => jet_form_builder()->post_type->slug(),
582 ),
583 )
584 );
585 }
586
587 public function on_jet_engine( $args ) {
588 return array_merge_recursive(
589 $args,
590 array(
591 'condition' => array(
592 'form_provider' => jet_engine()->forms->slug(),
593 ),
594 )
595 );
596 }
597
598
599 public function run_form_progress_controls( $instance, $selector_callable, $add_section_condition ) {
600 $instance->start_controls_section(
601 'jet_fb_progress_wrapper_section',
602 $add_section_condition(
603 array(
604 'label' => __( 'Form Progress - Wrapper', 'jet-form-builder' ),
605 'tab' => Controls_Manager::TAB_STYLE,
606 )
607 )
608 );
609 $instance->add_responsive_control(
610 'jet_fb_progress_wrapper_margin',
611 array(
612 'label' => __( 'Margin', 'jet-form-builder' ),
613 'type' => Controls_Manager::DIMENSIONS,
614 'size_units' => array( 'px', '%', 'em', 'rem', 'custom' ),
615 'selectors' => array(
616 $selector_callable( '-progress-pages' ) => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
617 ),
618 )
619 );
620 $instance->add_responsive_control(
621 'jet_fb_progress_wrapper_padding',
622 array(
623 'label' => __( 'Padding', 'jet-form-builder' ),
624 'type' => Controls_Manager::DIMENSIONS,
625 'size_units' => array( 'px', '%', 'em', 'rem', 'custom' ),
626 'selectors' => array(
627 $selector_callable( '-progress-pages' ) => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
628 ),
629 )
630 );
631 $instance->add_group_control(
632 Group_Control_Typography::get_type(),
633 array(
634 'name' => 'jet_fb_progress_wrapper_typography',
635 'selector' => $selector_callable( '-progress-pages' ),
636 )
637 );
638 $this->add_border(
639 $instance,
640 'jet_fb_progress_wrapper_border',
641 $selector_callable( '-progress-pages' )
642 );
643 $instance->add_control(
644 'jet_fb_progress_wrapper_color',
645 array(
646 'label' => __( 'Text Color', 'jet-form-builder' ),
647 'type' => Controls_Manager::COLOR,
648 'selectors' => array(
649 $selector_callable( '-progress-pages' ) => 'color: {{VALUE}}',
650 ),
651 )
652 );
653 $instance->add_control(
654 'jet_fb_progress_wrapper_bg_color',
655 array(
656 'label' => __( 'Background Color', 'jet-form-builder' ),
657 'type' => Controls_Manager::COLOR,
658 'selectors' => array(
659 $selector_callable( '-progress-pages' ) => 'background-color: {{VALUE}}',
660 ),
661 )
662 );
663 $instance->end_controls_section();
664
665 $instance->start_controls_section(
666 'jet_fb_progress_pages_section',
667 $add_section_condition(
668 array(
669 'label' => __( 'Form Progress - Pages', 'jet-form-builder' ),
670 'tab' => Controls_Manager::TAB_STYLE,
671 )
672 )
673 );
674 $instance->start_controls_tabs( 'jet_fb_progress_pages_tabs' );
675
676 $wrapper = '-progress-pages__item--wrapper';
677 $item = '-progress-pages__item';
678
679 $scheme = array(
680 'active-wrapper' => "$wrapper.active-page",
681 'active-item' => "$wrapper.active-page .%s$item",
682 'active-separator' => "$wrapper.active-page .%s-progress-pages__separator",
683 'active-circle' => "$wrapper.active-page .%s$item--circle",
684
685 'next-wrapper' => "$wrapper:not(.passed-page):not(.active-page)",
686 'next-item' => "$wrapper:not(.passed-page):not(.active-page) .%s$item",
687 'next-separator' => "$wrapper:not(.passed-page):not(.active-page) .%s-progress-pages__separator",
688 'next-circle' => "$wrapper:not(.passed-page):not(.active-page) .%s$item--circle",
689
690 'prev-wrapper' => "$wrapper.passed-page",
691 'prev-item' => "$wrapper.passed-page .%s$item",
692 'prev-separator' => "$wrapper.passed-page .%s-progress-pages__separator",
693 'prev-circle' => "$wrapper.passed-page .%s$item--circle",
694 );
695
696 $instance->start_controls_tab(
697 'jet_fb_progress_pages_tab--current',
698 array(
699 'label' => esc_html__( 'Current', 'jet-form-builder' ),
700 )
701 );
702 $instance->add_responsive_control(
703 'jet_fb_progress_pages_tab--current_padding',
704 array(
705 'label' => __( 'Padding', 'jet-form-builder' ),
706 'type' => Controls_Manager::DIMENSIONS,
707 'size_units' => array( 'px', '%', 'em', 'rem', 'custom' ),
708 'selectors' => array(
709 $selector_callable( $scheme['active-item'] ) => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
710 ),
711 )
712 );
713 $instance->add_responsive_control(
714 'jet_fb_progress_pages_tab--current_margin',
715 array(
716 'label' => __( 'Margin', 'jet-form-builder' ),
717 'type' => Controls_Manager::DIMENSIONS,
718 'size_units' => array( 'px', '%', 'em', 'rem', 'custom' ),
719 'selectors' => array(
720 $selector_callable( $scheme['active-item'] ) => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
721 ),
722 )
723 );
724 $instance->add_group_control(
725 Group_Control_Typography::get_type(),
726 array(
727 'name' => 'jet_fb_progress_pages_tab--current_typography',
728 'selector' => $selector_callable( $scheme['active-item'] ),
729 )
730 );
731 $this->add_border(
732 $instance,
733 'jet_fb_progress_pages_tab--current_item_border',
734 $selector_callable( $scheme['active-item'] )
735 );
736 $instance->add_control(
737 'jet_fb_progress_pages_tab--current_color',
738 array(
739 'label' => __( 'Text Color', 'jet-form-builder' ),
740 'type' => Controls_Manager::COLOR,
741 'selectors' => array(
742 $selector_callable( $scheme['active-item'] ) => 'color: {{VALUE}}',
743 ),
744 )
745 );
746 $instance->add_control(
747 'jet_fb_progress_pages_tab--current_bg_color',
748 array(
749 'label' => __( 'Background Color', 'jet-form-builder' ),
750 'type' => Controls_Manager::COLOR,
751 'selectors' => array(
752 $selector_callable( $scheme['active-item'] ) => 'background-color: {{VALUE}}',
753 ),
754 )
755 );
756 $instance->add_control(
757 'jet_fb_separator_active_separator',
758 array(
759 'label' => esc_html__( 'Separator', 'jet-form-builder' ),
760 'type' => Controls_Manager::HEADING,
761 'separator' => 'before',
762 )
763 );
764 $instance->add_responsive_control(
765 'jet_fb_progress_pages_tab--current_separator_height',
766 array(
767 'label' => __( 'Height', 'jet-form-builder' ),
768 'type' => Controls_Manager::SLIDER,
769 'size_units' => array( 'px', 'em', 'rem', 'custom' ),
770 'range' => array(
771 'px' => array(
772 'min' => 1,
773 'max' => 100,
774 ),
775 ),
776 'selectors' => array(
777 $selector_callable( $scheme['active-separator'] ) => 'height: {{SIZE}}{{UNIT}}; min-height: {{SIZE}}{{UNIT}};',
778 ),
779 )
780 );
781 $instance->add_control(
782 'jet_fb_progress_pages_tab--current_separator_color',
783 array(
784 'label' => __( 'Color', 'jet-form-builder' ),
785 'type' => Controls_Manager::COLOR,
786 'selectors' => array(
787 $selector_callable( $scheme['active-separator'] ) => 'background-color: {{VALUE}}',
788 ),
789 )
790 );
791 $instance->add_control(
792 'jet_fb_separator_active_circle',
793 array(
794 'label' => esc_html__( 'Circle', 'jet-form-builder' ),
795 'type' => Controls_Manager::HEADING,
796 'separator' => 'before',
797 )
798 );
799 $this->add_border(
800 $instance,
801 'jet_fb_progress_pages_tab--current_separator_border',
802 $selector_callable( $scheme['active-circle'] )
803 );
804 $instance->end_controls_tab();
805
806 $instance->start_controls_tab(
807 'jet_fb_progress_pages_tab--next',
808 array(
809 'label' => esc_html__( 'Next', 'jet-form-builder' ),
810 )
811 );
812 $instance->add_responsive_control(
813 'jet_fb_progress_pages_tab--next_padding',
814 array(
815 'label' => __( 'Padding', 'jet-form-builder' ),
816 'type' => Controls_Manager::DIMENSIONS,
817 'size_units' => array( 'px', '%', 'em', 'rem', 'custom' ),
818 'selectors' => array(
819 $selector_callable( $scheme['next-item'] ) => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
820 ),
821 )
822 );
823 $instance->add_responsive_control(
824 'jet_fb_progress_pages_tab--next_margin',
825 array(
826 'label' => __( 'Margin', 'jet-form-builder' ),
827 'type' => Controls_Manager::DIMENSIONS,
828 'size_units' => array( 'px', '%', 'em', 'rem', 'custom' ),
829 'selectors' => array(
830 $selector_callable( $scheme['next-item'] ) => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
831 ),
832 )
833 );
834 $instance->add_group_control(
835 Group_Control_Typography::get_type(),
836 array(
837 'name' => 'jet_fb_progress_pages_tab--next_typography',
838 'selector' => $selector_callable( $scheme['next-item'] ),
839 )
840 );
841 $this->add_border(
842 $instance,
843 'jet_fb_progress_pages_tab--next_item_border',
844 $selector_callable( $scheme['next-item'] )
845 );
846 $instance->add_control(
847 'jet_fb_progress_pages_tab--next_color',
848 array(
849 'label' => __( 'Text Color', 'jet-form-builder' ),
850 'type' => Controls_Manager::COLOR,
851 'selectors' => array(
852 $selector_callable( $scheme['next-item'] ) => 'color: {{VALUE}}',
853 ),
854 )
855 );
856 $instance->add_control(
857 'jet_fb_progress_pages_tab--next_bg_color',
858 array(
859 'label' => __( 'Background Color', 'jet-form-builder' ),
860 'type' => Controls_Manager::COLOR,
861 'selectors' => array(
862 $selector_callable( $scheme['next-item'] ) => 'background-color: {{VALUE}}',
863 ),
864 )
865 );
866 $instance->add_control(
867 'jet_fb_separator_next_separator',
868 array(
869 'label' => esc_html__( 'Separator', 'jet-form-builder' ),
870 'type' => Controls_Manager::HEADING,
871 'separator' => 'before',
872 )
873 );
874 $instance->add_responsive_control(
875 'jet_fb_progress_pages_tab--next_separator_height',
876 array(
877 'label' => __( 'Height', 'jet-form-builder' ),
878 'type' => Controls_Manager::SLIDER,
879 'size_units' => array( 'px', 'em', 'rem', 'custom' ),
880 'range' => array(
881 'px' => array(
882 'min' => 1,
883 'max' => 100,
884 ),
885 ),
886 'selectors' => array(
887 $selector_callable( $scheme['next-separator'] ) => 'height: {{SIZE}}{{UNIT}}; min-height: {{SIZE}}{{UNIT}};',
888 ),
889 )
890 );
891 $instance->add_control(
892 'jet_fb_progress_pages_tab--next_separator_color',
893 array(
894 'label' => __( 'Color', 'jet-form-builder' ),
895 'type' => Controls_Manager::COLOR,
896 'selectors' => array(
897 $selector_callable( $scheme['next-separator'] ) => 'background-color: {{VALUE}}',
898 ),
899 )
900 );
901 $instance->add_control(
902 'jet_fb_separator_next_circle',
903 array(
904 'label' => esc_html__( 'Circle', 'jet-form-builder' ),
905 'type' => Controls_Manager::HEADING,
906 'separator' => 'before',
907 )
908 );
909 $this->add_border(
910 $instance,
911 'jet_fb_progress_pages_tab--next_separator_border',
912 $selector_callable( $scheme['next-circle'] )
913 );
914 $instance->end_controls_tab();
915
916 $instance->start_controls_tab(
917 'jet_fb_progress_pages_tab--prev',
918 array(
919 'label' => esc_html__( 'Prev', 'jet-form-builder' ),
920 )
921 );
922 $instance->add_responsive_control(
923 'jet_fb_progress_pages_tab--prev_padding',
924 array(
925 'label' => __( 'Padding', 'jet-form-builder' ),
926 'type' => Controls_Manager::DIMENSIONS,
927 'size_units' => array( 'px', '%', 'em', 'rem', 'custom' ),
928 'selectors' => array(
929 $selector_callable( $scheme['prev-item'] ) => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
930 ),
931 )
932 );
933 $instance->add_responsive_control(
934 'jet_fb_progress_pages_tab--prev_margin',
935 array(
936 'label' => __( 'Margin', 'jet-form-builder' ),
937 'type' => Controls_Manager::DIMENSIONS,
938 'size_units' => array( 'px', '%', 'em', 'rem', 'custom' ),
939 'selectors' => array(
940 $selector_callable( $scheme['prev-item'] ) => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
941 ),
942 )
943 );
944 $instance->add_group_control(
945 Group_Control_Typography::get_type(),
946 array(
947 'name' => 'jet_fb_progress_pages_tab--prev_typography',
948 'selector' => $selector_callable( $scheme['prev-item'] ),
949 )
950 );
951 $this->add_border(
952 $instance,
953 'jet_fb_progress_pages_tab--prev_item_border',
954 $selector_callable( $scheme['prev-item'] )
955 );
956 $instance->add_control(
957 'jet_fb_progress_pages_tab--prev_color',
958 array(
959 'label' => __( 'Text Color', 'jet-form-builder' ),
960 'type' => Controls_Manager::COLOR,
961 'selectors' => array(
962 $selector_callable( $scheme['prev-item'] ) => 'color: {{VALUE}}',
963 ),
964 )
965 );
966 $instance->add_control(
967 'jet_fb_progress_pages_tab--prev_bg_color',
968 array(
969 'label' => __( 'Background Color', 'jet-form-builder' ),
970 'type' => Controls_Manager::COLOR,
971 'selectors' => array(
972 $selector_callable( $scheme['prev-item'] ) => 'background-color: {{VALUE}}',
973 ),
974 )
975 );
976 $instance->add_control(
977 'jet_fb_separator_prev_separator',
978 array(
979 'label' => esc_html__( 'Separator', 'jet-form-builder' ),
980 'type' => Controls_Manager::HEADING,
981 'separator' => 'before',
982 )
983 );
984 $instance->add_responsive_control(
985 'jet_fb_progress_pages_tab--prev_separator_height',
986 array(
987 'label' => __( 'Height', 'jet-form-builder' ),
988 'type' => Controls_Manager::SLIDER,
989 'size_units' => array( 'px', 'em', 'rem', 'custom' ),
990 'range' => array(
991 'px' => array(
992 'min' => 1,
993 'max' => 100,
994 ),
995 ),
996 'selectors' => array(
997 $selector_callable( $scheme['prev-separator'] ) => 'height: {{SIZE}}{{UNIT}}; min-height: {{SIZE}}{{UNIT}};',
998 ),
999 )
1000 );
1001 $instance->add_control(
1002 'jet_fb_progress_pages_tab--prev_separator_color',
1003 array(
1004 'label' => __( 'Color', 'jet-form-builder' ),
1005 'type' => Controls_Manager::COLOR,
1006 'selectors' => array(
1007 $selector_callable( $scheme['prev-separator'] ) => 'background-color: {{VALUE}}',
1008 ),
1009 )
1010 );
1011 $instance->add_control(
1012 'jet_fb_separator_prev_circle',
1013 array(
1014 'label' => esc_html__( 'Circle', 'jet-form-builder' ),
1015 'type' => Controls_Manager::HEADING,
1016 'separator' => 'before',
1017 )
1018 );
1019 $this->add_border(
1020 $instance,
1021 'jet_fb_progress_pages_tab--prev_separator_border',
1022 $selector_callable( $scheme['prev-circle'] )
1023 );
1024 $instance->end_controls_tab();
1025 $instance->end_controls_tabs();
1026 $instance->end_controls_section();
1027 }
1028
1029 public function booking_form_render( $result, $settings ) {
1030 $slug = $this->jet_form_builder_slug();
1031
1032 if ( empty( $settings['form_provider'] ) || $slug !== $settings['form_provider'] ) {
1033 return false;
1034 }
1035 if ( empty( $settings['form_id'] ) ) {
1036 return __( 'Please, select JetForm to show', 'jet-form-builder' );
1037 }
1038
1039 return jet_fb_render_form( $settings );
1040 }
1041
1042 /**
1043 * Register the widget controls.
1044 *
1045 * Adds different input fields to allow the user to change and customize the widget settings.
1046 *
1047 * @since 1.1.0
1048 *
1049 * @access protected
1050 */
1051 protected function register_controls() {
1052
1053 $this->section_form_settings();
1054
1055 /** Form Row */
1056 $this->section_form_style();
1057
1058 /** Label */
1059 $this->section_label_style();
1060
1061 /** Description */
1062 $this->section_description_style();
1063
1064 /** Checkbox & Radio Fields */
1065 $this->section_checkradio_fields_style();
1066
1067 /** Input Fields */
1068 $this->section_form_input_fields();
1069
1070 /** Calculated Fields */
1071 $this->section_calc_fields_style();
1072
1073 /** Range Fields */
1074 $this->section_range_fields_style();
1075
1076 /** Heading Fields */
1077 $this->section_headings_style();
1078
1079 /** Repeater */
1080 $this->section_repeater_style();
1081
1082 /** Conditional block */
1083 $this->conditional_style();
1084
1085 /** Submit */
1086 $this->form_submit_style();
1087
1088 /** Form Break Row */
1089 $this->section_form_break_style();
1090
1091 /** Form Break Buttons */
1092 $this->section_form_break_next_style();
1093
1094 /** Form Break Disabled Message */
1095 $this->section_form_break_disabled_style();
1096
1097 $this->run_form_progress_controls(
1098 $this,
1099 array( $this, 'selector' ),
1100 function ( $args ) {
1101 return $args;
1102 }
1103 );
1104
1105 /** Messages */
1106 $this->section_message_error_style();
1107 }
1108
1109 private function section_form_settings() {
1110 $options = Form_Arguments::get_options( true );
1111
1112 $this->start_controls_section(
1113 'section_ form_settings',
1114 array(
1115 'label' => __( 'Form Settings', 'jet-form-builder' ),
1116 )
1117 );
1118
1119 $this->add_control(
1120 'form_id',
1121 array(
1122 'label' => __( 'Choose Form', 'jet-form-builder' ),
1123 'type' => Controls_Manager::SELECT,
1124 'default' => '',
1125 'label_block' => false,
1126 'options' => Tools::get_forms_list_for_js( true ),
1127 )
1128 );
1129
1130 $this->add_control(
1131 'form_id_custom',
1132 array(
1133 'label' => __( 'Form ID', 'jet-form-builder' ),
1134 'type' => Controls_Manager::TEXT,
1135 'default' => '',
1136 'label_block' => false,
1137 'dynamic' => array( 'active' => true ),
1138 'condition' => array(
1139 'form_id' => 'manual_form_id',
1140 ),
1141 )
1142 );
1143
1144 $this->add_control(
1145 'fields_layout',
1146 array(
1147 'label' => __( 'Fields Layout', 'jet-form-builder' ),
1148 'type' => Controls_Manager::SELECT,
1149 'default' => '',
1150 'options' => $options['fields_layout'],
1151 )
1152 );
1153
1154 $this->add_control(
1155 'required_mark',
1156 array(
1157 'label' => __( 'Required Mark', 'jet-form-builder' ),
1158 'type' => Controls_Manager::TEXT,
1159 'default' => '',
1160 )
1161 );
1162
1163 $this->add_control(
1164 'fields_label_tag',
1165 array(
1166 'label' => __( 'Fields label HTML tag', 'jet-form-builder' ),
1167 'type' => Controls_Manager::SELECT,
1168 'default' => '',
1169 'options' => array( '' => 'Default' ) + $options['fields_label_tag'],
1170 )
1171 );
1172
1173 $this->add_control(
1174 'markup_type',
1175 array(
1176 'label' => __( 'Markup type', 'jet-form-builder' ),
1177 'type' => Controls_Manager::SELECT,
1178 'default' => '',
1179 'options' => array( '' => 'Default' ) + ( $options['markup_type'] ?? array() ),
1180 )
1181 );
1182
1183 $this->add_control(
1184 'submit_type',
1185 array(
1186 'label' => __( 'Submit Type', 'jet-form-builder' ),
1187 'type' => Controls_Manager::SELECT,
1188 'default' => '',
1189 'options' => $options['submit_type'],
1190 )
1191 );
1192
1193 $this->add_control(
1194 'enable_progress',
1195 array(
1196 'label' => __( 'Enable form pages progress', 'jet-form-builder' ),
1197 'type' => Controls_Manager::SWITCHER,
1198 'label_on' => __( 'Yes', 'jet-form-builder' ),
1199 'label_off' => __( 'No', 'jet-form-builder' ),
1200 'return_value' => 'yes',
1201 'default' => '',
1202 )
1203 );
1204
1205 $this->add_control(
1206 'clear',
1207 array(
1208 'label' => __( 'Clear data on success submit', 'jet-form-builder' ),
1209 'type' => Controls_Manager::SWITCHER,
1210 'label_on' => __( 'Yes', 'jet-form-builder' ),
1211 'label_off' => __( 'No', 'jet-form-builder' ),
1212 'return_value' => 'yes',
1213 'default' => '',
1214 )
1215 );
1216
1217 $this->end_controls_section();
1218 }
1219
1220 private function section_form_style() {
1221 $this->start_controls_section(
1222 'section_form_style',
1223 array(
1224 'label' => __( 'Form Row', 'jet-form-builder' ),
1225 'tab' => Controls_Manager::TAB_STYLE,
1226 )
1227 );
1228
1229 $this->add_responsive_control(
1230 'form_row_gap_before',
1231 array(
1232
1233 'type' => Controls_Manager::SLIDER,
1234 'label' => __( 'Gap Before', 'jet-form-builder' ),
1235 'size_units' => array( 'px', 'em', 'rem', 'custom' ),
1236 'range' => array(
1237 'px' => array(
1238 'min' => 0,
1239 'max' => 100,
1240 ),
1241 ),
1242 'selectors' => array(
1243 $this->selector( '-row' ) => 'margin-top: {{SIZE}}{{UNIT}};',
1244 ),
1245 )
1246 );
1247
1248 $this->add_responsive_control(
1249 'form_row_gap_after',
1250 array(
1251
1252 'type' => Controls_Manager::SLIDER,
1253 'label' => __( 'Gap After', 'jet-form-builder' ),
1254 'size_units' => array( 'px', 'em', 'rem', 'custom' ),
1255 'range' => array(
1256 'px' => array(
1257 'min' => 0,
1258 'max' => 100,
1259 ),
1260 ),
1261 'selectors' => array(
1262 $this->selector( '-row' ) => 'margin-bottom: {{SIZE}}{{UNIT}};',
1263 ),
1264 )
1265 );
1266
1267 $this->end_controls_section();
1268 }
1269
1270 private function section_label_style() {
1271 $this->start_controls_section(
1272 'section_label_style',
1273 array(
1274 'label' => __( 'Label', 'jet-form-builder' ),
1275 'tab' => Controls_Manager::TAB_STYLE,
1276 )
1277 );
1278
1279 $this->add_responsive_control(
1280 'form_label_margin',
1281 array(
1282 'label' => __( 'Margin', 'jet-form-builder' ),
1283 'type' => Controls_Manager::DIMENSIONS,
1284 'size_units' => array( 'px', '%', 'em', 'rem', 'custom' ),
1285 'selectors' => array(
1286 $this->selector( '__label' ) => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
1287 ),
1288 )
1289 );
1290
1291 $this->add_responsive_control(
1292 'form_label_padding',
1293 array(
1294 'label' => __( 'Padding', 'jet-form-builder' ),
1295 'type' => Controls_Manager::DIMENSIONS,
1296 'size_units' => array( 'px', '%', 'em', 'rem', 'custom' ),
1297 'selectors' => array(
1298 $this->selector( '__label' ) => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
1299 ),
1300 )
1301 );
1302
1303 $this->add_responsive_control(
1304 'form_label_alignment',
1305 array(
1306 'label' => __( 'Alignment', 'jet-form-builder' ),
1307 'type' => Controls_Manager::CHOOSE,
1308 'label_block' => false,
1309 'default' => 'left',
1310 'separator' => 'before',
1311 'options' => array(
1312 'left' => array(
1313 'title' => __( 'Left', 'jet-form-builder' ),
1314 'icon' => 'eicon-h-align-left',
1315 ),
1316 'center' => array(
1317 'title' => __( 'Center', 'jet-form-builder' ),
1318 'icon' => 'eicon-h-align-center',
1319 ),
1320 'right' => array(
1321 'title' => __( 'Right', 'jet-form-builder' ),
1322 'icon' => 'eicon-h-align-right',
1323 ),
1324 ),
1325 'selectors' => array(
1326 $this->selector( '__label' ) => 'text-align: {{VALUE}};',
1327 ),
1328 )
1329 );
1330
1331 $this->add_group_control(
1332 Group_Control_Typography::get_type(),
1333 array(
1334 'name' => 'form_label_typography',
1335 'selector' => $this->selector( '__label' ),
1336 )
1337 );
1338
1339 $this->add_control(
1340 'form_label_color',
1341 array(
1342 'label' => __( 'Color', 'jet-form-builder' ),
1343 'type' => Controls_Manager::COLOR,
1344 'selectors' => array(
1345 $this->selector( '__label' ) => 'color: {{VALUE}};',
1346 ),
1347 )
1348 );
1349 $this->add_control(
1350 'form_label_bg_color',
1351 array(
1352 'label' => __( 'Background Color', 'jet-form-builder' ),
1353 'type' => Controls_Manager::COLOR,
1354 'selectors' => array(
1355 $this->selector( '__label' ) => 'background-color: {{VALUE}};',
1356 ),
1357 )
1358 );
1359 $this->add_border(
1360 $this,
1361 'form_label_border',
1362 $this->selector( '__label' )
1363 );
1364
1365 $this->add_control(
1366 'divider__label__required_mark',
1367 array(
1368 'label' => __( 'Required Mark', 'jet-form-builder' ),
1369 'type' => Controls_Manager::HEADING,
1370 'separator' => 'before',
1371 )
1372 );
1373
1374 $this->add_group_control(
1375 Group_Control_Typography::get_type(),
1376 array(
1377 'name' => 'form_required_typography',
1378 'selector' => $this->selector( '__label .%s__required' ),
1379 )
1380 );
1381 $this->add_control(
1382 'form_required_color',
1383 array(
1384 'label' => __( 'Color', 'jet-form-builder' ),
1385 'type' => Controls_Manager::COLOR,
1386 'selectors' => array(
1387 $this->selector( '__label .%s__required' ) => 'color: {{VALUE}};',
1388 ),
1389 )
1390 );
1391 $this->end_controls_section();
1392 }
1393
1394 private function section_description_style() {
1395 $this->start_controls_section(
1396 'section_description_style',
1397 array(
1398 'label' => __( 'Description', 'jet-form-builder' ),
1399 'tab' => Controls_Manager::TAB_STYLE,
1400 )
1401 );
1402 $this->add_responsive_control(
1403 'form_description_margin',
1404 array(
1405 'label' => __( 'Margin', 'jet-form-builder' ),
1406 'type' => Controls_Manager::DIMENSIONS,
1407 'size_units' => array( 'px', '%', 'em', 'rem', 'custom' ),
1408 'selectors' => array(
1409 $this->selector( '__desc' ) => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
1410 ),
1411 )
1412 );
1413
1414 $this->add_responsive_control(
1415 'form_description_padding',
1416 array(
1417 'label' => __( 'Padding', 'jet-form-builder' ),
1418 'type' => Controls_Manager::DIMENSIONS,
1419 'size_units' => array( 'px', '%', 'em', 'rem', 'custom' ),
1420 'selectors' => array(
1421 $this->selector( '__desc' ) => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
1422 ),
1423 )
1424 );
1425
1426 $this->add_responsive_control(
1427 'form_description_alignment',
1428 array(
1429 'label' => __( 'Alignment', 'jet-form-builder' ),
1430 'type' => Controls_Manager::CHOOSE,
1431 'label_block' => false,
1432 'default' => 'left',
1433 'separator' => 'before',
1434 'options' => array(
1435 'left' => array(
1436 'title' => __( 'Left', 'jet-form-builder' ),
1437 'icon' => 'eicon-h-align-left',
1438 ),
1439 'center' => array(
1440 'title' => __( 'Center', 'jet-form-builder' ),
1441 'icon' => 'eicon-h-align-center',
1442 ),
1443 'right' => array(
1444 'title' => __( 'Right', 'jet-form-builder' ),
1445 'icon' => 'eicon-h-align-right',
1446 ),
1447 ),
1448 'selectors' => array(
1449 $this->selector( '__desc' ) => 'text-align: {{VALUE}};',
1450 ),
1451 )
1452 );
1453
1454 $this->add_group_control(
1455 Group_Control_Typography::get_type(),
1456 array(
1457 'name' => 'form_description_typography',
1458 'selector' => $this->selector( '__desc' ),
1459 )
1460 );
1461
1462 $this->add_control(
1463 'form_description_color',
1464 array(
1465 'label' => __( 'Color', 'jet-form-builder' ),
1466 'type' => Controls_Manager::COLOR,
1467 'selectors' => array(
1468 $this->selector( '__desc' ) => 'color: {{VALUE}};',
1469 ),
1470 )
1471 );
1472 $this->add_control(
1473 'form_description_bg_color',
1474 array(
1475 'label' => __( 'Background Color', 'jet-form-builder' ),
1476 'type' => Controls_Manager::COLOR,
1477 'selectors' => array(
1478 $this->selector( '__desc' ) => 'background-color: {{VALUE}};',
1479 ),
1480 )
1481 );
1482 $this->add_border(
1483 $this,
1484 'form_description_border',
1485 $this->selector( '__desc' )
1486 );
1487 $this->end_controls_section();
1488 }
1489
1490 private function section_checkradio_fields_style() {
1491 $this->start_controls_section(
1492 'section_checkradio_fields_style',
1493 array(
1494 'label' => __( 'Checkbox & Radio Fields', 'jet-form-builder' ),
1495 'tab' => Controls_Manager::TAB_STYLE,
1496 'show_label' => false,
1497 )
1498 );
1499
1500 $this->add_responsive_control(
1501 'checkradio_fields_layout',
1502 array(
1503 'label' => __( 'Layout', 'jet-form-builder' ),
1504 'type' => Controls_Manager::CHOOSE,
1505 'label_block' => false,
1506 'options' => array(
1507 'inline-block' => array(
1508 'title' => __( 'Horizontal', 'jet-form-builder' ),
1509 'icon' => 'eicon-ellipsis-h',
1510 ),
1511 'block' => array(
1512 'title' => __( 'Vertical', 'jet-form-builder' ),
1513 'icon' => 'eicon-editor-list-ul',
1514 ),
1515 ),
1516 'selectors_dictionary' => array(
1517 'inline-block' => 'row',
1518 'block' => 'column',
1519 ),
1520 'selectors' => array(
1521 $this->selector( '__fields-group' ) => 'flex-direction: {{VALUE}};',
1522 ),
1523 )
1524 );
1525
1526 $this->add_responsive_control(
1527 'checkradio_fields_gaps',
1528 array(
1529 'label' => __( 'Gaps', 'jet-form-builder' ),
1530 'type' => Controls_Manager::GAPS,
1531 'size_units' => array( 'px', 'em', 'rem', 'custom' ),
1532 'default' => array(
1533 'row' => '0.7',
1534 'column' => '0.7',
1535 'unit' => 'em',
1536 ),
1537 'validators' => array(
1538 'Number' => array(
1539 'min' => 0,
1540 ),
1541 ),
1542 'selectors' => array(
1543 $this->selector( '__fields-group' ) => 'gap: {{ROW}}{{UNIT}} {{COLUMN}}{{UNIT}};',
1544 ),
1545 )
1546 );
1547
1548 $this->add_group_control(
1549 Group_Control_Typography::get_type(),
1550 array(
1551 'name' => 'checkradio_fields_typography',
1552 'selector' => $this->selector( '__field-wrap label' ),
1553 )
1554 );
1555
1556 $this->add_responsive_control(
1557 'checkradio_fields_gap',
1558 array(
1559 'label' => __( 'Gap between control and label', 'jet-form-builder' ),
1560 'type' => Controls_Manager::SLIDER,
1561 'size_units' => array( 'px', 'em', 'rem', 'custom' ),
1562 'default' => array(
1563 'size' => 8,
1564 ),
1565 'range' => array(
1566 'px' => array(
1567 'min' => 0,
1568 'max' => 50,
1569 ),
1570 ),
1571 'selectors' => array(
1572 $this->selector( '__field-wrap.checkradio-wrap span' ) => 'gap: {{SIZE}}{{UNIT}};',
1573 ),
1574 )
1575 );
1576 $this->add_responsive_control(
1577 'checkradio_fields_control_size',
1578 array(
1579 'label' => __( 'Control Size', 'jet-form-builder' ),
1580 'type' => Controls_Manager::SLIDER,
1581 'size_units' => array( 'px', 'em', 'rem', 'custom' ),
1582 'range' => array(
1583 'px' => array(
1584 'min' => 0,
1585 'max' => 50,
1586 ),
1587 ),
1588 'selectors' => array(
1589 $this->selector( '__field-wrap span::before' ) => 'font-size: {{SIZE}}{{UNIT}};',
1590 ),
1591 )
1592 );
1593
1594 $this->add_control(
1595 'checkradio_fields_option_label_heading',
1596 array(
1597 'label' => __( 'Option label', 'jet-form-builder' ),
1598 'type' => Controls_Manager::HEADING,
1599 'separator' => 'before',
1600 )
1601 );
1602
1603 $this->add_control(
1604 'checkradio_fields_color',
1605 array(
1606 'label' => __( 'Color', 'jet-form-builder' ),
1607 'type' => Controls_Manager::COLOR,
1608 'selectors' => array(
1609 $this->selector( '__field-wrap label' ) => 'color: {{VALUE}}',
1610 ),
1611 )
1612 );
1613
1614 $this->add_control(
1615 'checkradio_fields_background_color',
1616 array(
1617 'label' => __( 'Background color', 'jet-form-builder' ),
1618 'type' => Controls_Manager::COLOR,
1619 'selectors' => array(
1620 $this->selector( '__field-wrap label' ) => 'background-color: {{VALUE}}',
1621 ),
1622 )
1623 );
1624
1625 $this->start_controls_tabs(
1626 'tab__checkradio_tabs_items',
1627 array(
1628 'separator' => 'before',
1629 )
1630 );
1631
1632 $this->start_controls_tab(
1633 'tab__checkradio_control_color__normal',
1634 array(
1635 'label' => __( 'Normal', 'jet-form-builder' ),
1636 )
1637 );
1638
1639 $this->add_border(
1640 $this,
1641 'tab__checkradio_control_border__normal',
1642 $this->selector( '__field-wrap span::before' )
1643 );
1644
1645 $this->add_control(
1646 'tab__checkradio_control_bg_color__normal',
1647 array(
1648 'label' => esc_html__( 'Background Color', 'jet-form-builder' ),
1649 'type' => Controls_Manager::COLOR,
1650 'selectors' => array(
1651 $this->selector( '__field-wrap label > span::before' ) => 'background-color: {{VALUE}};',
1652 ),
1653 )
1654 );
1655
1656 $this->end_controls_tab();
1657
1658 $this->start_controls_tab(
1659 'tab__checkradio_control_border__hover',
1660 array(
1661 'label' => __( 'Hover', 'jet-form-builder' ),
1662 )
1663 );
1664
1665 $this->add_border(
1666 $this,
1667 'tab__checkradio_control_border__hover',
1668 $this->selector( '__field-wrap label :not(:disabled):not(:checked):hover + span::before' )
1669 );
1670
1671 $this->add_control(
1672 'tab__checkradio_control_bg_color__hover',
1673 array(
1674 'label' => esc_html__( 'Background Color', 'jet-form-builder' ),
1675 'type' => Controls_Manager::COLOR,
1676 'selectors' => array(
1677 $this->selector( '__field-wrap label :not(:disabled):not(:checked):hover + span::before' ) => 'background-color: {{VALUE}};',
1678 ),
1679 )
1680 );
1681
1682 $this->end_controls_tab();
1683
1684 $this->start_controls_tab(
1685 'tab__checkradio_control_border__focus',
1686 array(
1687 'label' => __( 'Focus', 'jet-form-builder' ),
1688 )
1689 );
1690
1691 $this->add_border(
1692 $this,
1693 'tab__checkradio_control_border__focus',
1694 $this->selector( '__field-wrap label :focus:not(:checked) + span::before' )
1695 );
1696
1697 $this->add_control(
1698 'tab__checkradio_control_bg_color__focus',
1699 array(
1700 'label' => esc_html__( 'Background Color', 'jet-form-builder' ),
1701 'type' => Controls_Manager::COLOR,
1702 'selectors' => array(
1703 $this->selector( '__field-wrap label :focus:not(:checked) + span::before' ) => 'background-color: {{VALUE}};',
1704 ),
1705 )
1706 );
1707
1708 $this->end_controls_tab();
1709
1710 $this->start_controls_tab(
1711 'tab__checkradio_control_border__checked',
1712 array(
1713 'label' => __( 'Checked', 'jet-form-builder' ),
1714 )
1715 );
1716
1717 $this->add_border(
1718 $this,
1719 'tab__checkradio_control_border__checked',
1720 $this->selector( '__field-wrap label :checked + span::before' )
1721 );
1722
1723 $this->add_control(
1724 'tab__checkradio_control_bg_color__checked',
1725 array(
1726 'label' => esc_html__( 'Background Color', 'jet-form-builder' ),
1727 'type' => Controls_Manager::COLOR,
1728 'selectors' => array(
1729 $this->selector( '__field-wrap label :checked + span::before' ) => 'background-color: {{VALUE}};',
1730 ),
1731 )
1732 );
1733
1734 $this->end_controls_tab();
1735 $this->end_controls_tabs();
1736 $this->end_controls_section();
1737 }
1738
1739 private function section_form_input_fields() {
1740 $simple_input = '__field:not(.checkradio-field):not(.range-field):not(.%s-repeater):not(.wysiwyg-field):not([role="switch"])';
1741
1742 $this->start_controls_section(
1743 'section_form_input_fields',
1744 array(
1745 'label' => __( 'Input Fields', 'jet-form-builder' ),
1746 'tab' => Controls_Manager::TAB_STYLE,
1747 )
1748 );
1749
1750 $this->add_group_control(
1751 Group_Control_Typography::get_type(),
1752 array(
1753 'name' => 'fields_typography',
1754 'selector' => $this->selector( $simple_input ),
1755 )
1756 );
1757
1758 $this->add_control(
1759 'fields_color',
1760 array(
1761 'label' => __( 'Color', 'jet-form-builder' ),
1762 'type' => Controls_Manager::COLOR,
1763 'selectors' => array(
1764 $this->selector( $simple_input ) => 'color: {{VALUE}};',
1765 ),
1766 )
1767 );
1768
1769 $this->add_control(
1770 'fields_placeholder_color',
1771 array(
1772 'label' => __( 'Placeholder Color', 'jet-form-builder' ),
1773 'type' => Controls_Manager::COLOR,
1774 'selectors' => array(
1775 $this->selector( ' ::-webkit-input-placeholder' ) => 'color: {{VALUE}};',
1776 $this->selector( ' ::-ms-input-placeholder' ) => 'color: {{VALUE}};',
1777 $this->selector( ' ::-moz-placeholder' ) => 'color: {{VALUE}};',
1778 $this->selector( ' :-moz-placeholder' ) => 'color: {{VALUE}};',
1779 ),
1780 )
1781 );
1782
1783 $this->add_control(
1784 'fields_background_color',
1785 array(
1786 'label' => __( 'Background Color', 'jet-form-builder' ),
1787 'type' => Controls_Manager::COLOR,
1788 'selectors' => array(
1789 $this->selector( $simple_input ) => 'background-color: {{VALUE}};',
1790 ),
1791 )
1792 );
1793
1794 $this->add_responsive_control(
1795 'fields_padding',
1796 array(
1797 'label' => __( 'Padding', 'jet-form-builder' ),
1798 'type' => Controls_Manager::DIMENSIONS,
1799 'size_units' => array( 'px', '%', 'em', 'rem', 'custom' ),
1800 'selectors' => array(
1801 $this->selector( $simple_input ) => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
1802 ),
1803 )
1804 );
1805
1806 $this->add_responsive_control(
1807 'fields_margin',
1808 array(
1809 'label' => __( 'Margin', 'jet-form-builder' ),
1810 'type' => Controls_Manager::DIMENSIONS,
1811 'size_units' => array( 'px', '%', 'em', 'rem', 'custom' ),
1812 'selectors' => array(
1813 $this->selector( $simple_input ) => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
1814 ),
1815 )
1816 );
1817
1818 $this->add_group_control(
1819 Group_Control_Border::get_type(),
1820 array(
1821 'name' => 'fields_border',
1822 'label' => __( 'Border', 'jet-form-builder' ),
1823 'placeholder' => '1px',
1824 'selector' => $this->selector( $simple_input ),
1825 )
1826 );
1827
1828 $this->add_responsive_control(
1829 'fields_border_radius',
1830 array(
1831 'label' => __( 'Border Radius', 'jet-form-builder' ),
1832 'type' => Controls_Manager::DIMENSIONS,
1833 'size_units' => array( 'px', '%', 'em', 'rem', 'custom' ),
1834 'selectors' => array(
1835 $this->selector( $simple_input ) => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
1836 ),
1837 )
1838 );
1839
1840 $this->add_group_control(
1841 Group_Control_Box_Shadow::get_type(),
1842 array(
1843 'name' => 'fields_box_shadow',
1844 'selector' => $this->selector( $simple_input ),
1845 )
1846 );
1847
1848 $this->add_responsive_control(
1849 'fields_width',
1850 array(
1851 'label' => __( 'Fields width', 'jet-form-builder' ),
1852 'type' => Controls_Manager::SLIDER,
1853 'size_units' => array( 'px', '%', 'em', 'rem', 'custom' ),
1854 'range' => array(
1855 'px' => array(
1856 'min' => 50,
1857 'max' => 1000,
1858 ),
1859 ),
1860 'selectors' => array(
1861 $this->selector( $simple_input ) => 'max-width: {{SIZE}}{{UNIT}};',
1862 ),
1863 )
1864 );
1865
1866 $this->add_responsive_control(
1867 'fields_textarea_height',
1868 array(
1869 'label' => __( 'Textarea Height', 'jet-form-builder' ),
1870 'type' => Controls_Manager::SLIDER,
1871 'size_units' => array( 'px', 'em', 'rem', 'custom' ),
1872 'range' => array(
1873 'px' => array(
1874 'min' => 10,
1875 'max' => 500,
1876 ),
1877 ),
1878 'selectors' => array(
1879 $this->selector( '__field.textarea-field' ) => 'height:{{SIZE}}{{UNIT}}; min-height:{{SIZE}}{{UNIT}};',
1880 ),
1881 )
1882 );
1883
1884 $this->add_control(
1885 'fields_color_scheme',
1886 array(
1887 'label' => __( 'Color Scheme', 'jet-form-builder' ),
1888 'type' => Controls_Manager::SELECT,
1889 'description' => __( 'Affects default browser UI elements like date and time icons, UI etc.', 'jet-form-builder' ),
1890 'default' => 'normal',
1891 'options' => array(
1892 'normal' => __( 'Normal', 'jet-form-builder' ),
1893 'light' => __( 'Light', 'jet-form-builder' ),
1894 'dark' => __( 'Dark', 'jet-form-builder' ),
1895 ),
1896 'selectors' => array(
1897 $this->selector( ' input' ) => 'color-scheme: {{VALUE}};',
1898 ),
1899 )
1900 );
1901
1902 $this->end_controls_section();
1903 }
1904
1905 private function section_calc_fields_style() {
1906 $this->start_controls_section(
1907 'section_calc_fields_style',
1908 array(
1909 'label' => __( 'Calculated Fields', 'jet-form-builder' ),
1910 'tab' => Controls_Manager::TAB_STYLE,
1911 'show_label' => false,
1912 )
1913 );
1914
1915 $this->add_group_control(
1916 Group_Control_Typography::get_type(),
1917 array(
1918 'name' => 'calc_fields_typography',
1919 'selector' => $this->selector( '__calculated-field' ),
1920 )
1921 );
1922
1923 $this->add_control(
1924 'calc_fields_color',
1925 array(
1926 'label' => __( 'Color', 'jet-form-builder' ),
1927 'type' => Controls_Manager::COLOR,
1928 'selectors' => array(
1929 $this->selector( '__calculated-field' ) => 'color: {{VALUE}}',
1930 ),
1931 )
1932 );
1933
1934 $this->add_control(
1935 'calc_fields_prefix_color',
1936 array(
1937 'label' => __( 'Prefix Color', 'jet-form-builder' ),
1938 'type' => Controls_Manager::COLOR,
1939 'selectors' => array(
1940 $this->selector( '__calculated-field-prefix' ) => 'color: {{VALUE}}',
1941 ),
1942 )
1943 );
1944
1945 $this->add_responsive_control(
1946 'calc_fields_prefix_size',
1947 array(
1948 'label' => __( 'Prefix size', 'jet-form-builder' ),
1949 'type' => Controls_Manager::SLIDER,
1950 'size_units' => array( 'px', 'em', 'rem', 'custom' ),
1951 'range' => array(
1952 'px' => array(
1953 'min' => 10,
1954 'max' => 50,
1955 ),
1956 ),
1957 'selectors' => array(
1958 $this->selector( '__calculated-field-prefix' ) => 'font-size: {{SIZE}}{{UNIT}};',
1959 ),
1960 )
1961 );
1962
1963 $this->add_control(
1964 'calc_fields_suffix_color',
1965 array(
1966 'label' => __( 'Suffix Color', 'jet-form-builder' ),
1967 'type' => Controls_Manager::COLOR,
1968 'selectors' => array(
1969 $this->selector( '__calculated-field-suffix' ) => 'color: {{VALUE}}',
1970 ),
1971 )
1972 );
1973
1974 $this->add_responsive_control(
1975 'calc_fields_suffix_size',
1976 array(
1977 'label' => __( 'Suffix size', 'jet-form-builder' ),
1978 'type' => Controls_Manager::SLIDER,
1979 'size_units' => array( 'px', 'em', 'rem', 'custom' ),
1980 'range' => array(
1981 'px' => array(
1982 'min' => 10,
1983 'max' => 50,
1984 ),
1985 ),
1986 'selectors' => array(
1987 $this->selector( '__calculated-field-suffix' ) => 'font-size: {{SIZE}}{{UNIT}};',
1988 ),
1989 )
1990 );
1991
1992 $this->add_control(
1993 'calc_fields_background_color',
1994 array(
1995 'label' => __( 'Background Color', 'jet-form-builder' ),
1996 'type' => Controls_Manager::COLOR,
1997 'selectors' => array(
1998 $this->selector( '__calculated-field' ) => 'background-color: {{VALUE}}',
1999 ),
2000 )
2001 );
2002
2003 $this->add_responsive_control(
2004 'calc_fields_padding',
2005 array(
2006 'label' => __( 'Padding', 'jet-form-builder' ),
2007 'type' => Controls_Manager::DIMENSIONS,
2008 'size_units' => array( 'px', '%', 'em', 'rem', 'custom' ),
2009 'selectors' => array(
2010 $this->selector( '__calculated-field' ) => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
2011 ),
2012 )
2013 );
2014
2015 $this->add_responsive_control(
2016 'calc_fields_margin',
2017 array(
2018 'label' => __( 'Margin', 'jet-form-builder' ),
2019 'type' => Controls_Manager::DIMENSIONS,
2020 'size_units' => array( 'px', '%', 'em', 'rem', 'custom' ),
2021 'selectors' => array(
2022 $this->selector( '__calculated-field' ) => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
2023 ),
2024 )
2025 );
2026
2027 $this->add_group_control(
2028 Group_Control_Border::get_type(),
2029 array(
2030 'name' => 'calc_fields_border',
2031 'label' => __( 'Border', 'jet-form-builder' ),
2032 'placeholder' => '1px',
2033 'selector' => $this->selector( '__calculated-field' ),
2034 )
2035 );
2036
2037 $this->add_responsive_control(
2038 'calc_fields_border_radius',
2039 array(
2040 'label' => __( 'Border Radius', 'jet-form-builder' ),
2041 'type' => Controls_Manager::DIMENSIONS,
2042 'size_units' => array( 'px', '%', 'em', 'rem', 'custom' ),
2043 'selectors' => array(
2044 $this->selector( '__calculated-field' ) => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
2045 ),
2046 )
2047 );
2048
2049 $this->add_responsive_control(
2050 'calc_fields_flex_align',
2051 array(
2052 'label' => __( 'Content Align', 'jet-form-builder' ),
2053 'type' => Controls_Manager::SELECT,
2054 'options' => array(
2055 '' => __( 'Default', 'jet-form-builder' ),
2056 'start' => __( 'Left', 'jet-form-builder' ),
2057 'center' => __( 'Center', 'jet-form-builder' ),
2058 'end' => __( 'Right', 'jet-form-builder' ),
2059 'space-between' => __( 'Space Between', 'jet-form-builder' ),
2060 'space-evenly' => __( 'Space Evenly', 'jet-form-builder' ),
2061 'space-around' => __( 'Space Around', 'jet-form-builder' ),
2062 ),
2063 'selectors' => array(
2064 $this->selector( '__calculated-field' ) => 'justify-content: {{VALUE}};',
2065 ),
2066 )
2067 );
2068
2069 $this->end_controls_section();
2070 }
2071
2072 private function section_range_fields_style() {
2073 $this->start_controls_section(
2074 'section_range_fields_style',
2075 array(
2076 'label' => __( 'Range Fields', 'jet-form-builder' ),
2077 'tab' => Controls_Manager::TAB_STYLE,
2078 )
2079 );
2080
2081 $this->add_responsive_control(
2082 'range_max_width',
2083 array(
2084 'label' => esc_html__( 'Max Width', 'jet-form-builder' ),
2085 'type' => Controls_Manager::SLIDER,
2086 'size_units' => array( 'px', 'em', 'rem', 'custom' ),
2087 'range' => array(
2088 'px' => array(
2089 'min' => 1,
2090 'max' => 1000,
2091 ),
2092 ),
2093 'selectors' => array(
2094 $this->selector( '__field-wrap.range-wrap' ) => 'max-width: {{SIZE}}{{UNIT}};',
2095 ),
2096 )
2097 );
2098
2099 $this->add_control(
2100 'range_slider_heading',
2101 array(
2102 'label' => esc_html__( 'Slider', 'jet-form-builder' ),
2103 'type' => Controls_Manager::HEADING,
2104 'separator' => 'before',
2105 )
2106 );
2107
2108 $this->add_responsive_control(
2109 'track_height',
2110 array(
2111 'label' => esc_html__( 'Track Height', 'jet-form-builder' ),
2112 'type' => Controls_Manager::SLIDER,
2113 'size_units' => array( 'px', 'em', 'rem', 'custom' ),
2114 'range' => array(
2115 'px' => array(
2116 'min' => 1,
2117 'max' => 20,
2118 ),
2119 ),
2120 'selectors' => array(
2121 $this->selector( ' .range-field::-webkit-slider-runnable-track' ) => 'height: {{SIZE}}{{UNIT}};',
2122 $this->selector( ' .range-field::-moz-range-track' ) => 'height: {{SIZE}}{{UNIT}};',
2123 $this->selector( ' .range-field::-ms-track' ) => 'height: {{SIZE}}{{UNIT}};',
2124 $this->selector( ' .range-field::-webkit-slider-thumb' ) => 'margin-top: calc( (18px - {{SIZE}}{{UNIT}})/-2 )',
2125 ),
2126 )
2127 );
2128
2129 $this->add_responsive_control(
2130 'thumb_size',
2131 array(
2132 'label' => esc_html__( 'Thumb Size', 'jet-form-builder' ),
2133 'type' => Controls_Manager::SLIDER,
2134 'size_units' => array( 'px', 'em', 'rem', 'custom' ),
2135 'range' => array(
2136 'px' => array(
2137 'min' => 1,
2138 'max' => 50,
2139 ),
2140 ),
2141 'selectors' => array(
2142 $this->selector( '__field.range-field' ) => 'min-height: {{SIZE}}{{UNIT}};',
2143 $this->selector( '__field.range-field::-webkit-slider-thumb' ) => 'width: {{SIZE}}{{UNIT}}; height: {{SIZE}}{{UNIT}}; margin-top: calc( ({{SIZE}}{{UNIT}} - 4px)/-2 )',
2144 $this->selector( '__field.range-field::-moz-range-thumb' ) => 'width: {{SIZE}}{{UNIT}}; height: {{SIZE}}{{UNIT}};',
2145 $this->selector( '__field.range-field::-ms-thumb' ) => 'width: {{SIZE}}{{UNIT}}; height: {{SIZE}}{{UNIT}};',
2146 ),
2147 )
2148 );
2149
2150 $this->add_control(
2151 'thumb_indent',
2152 array(
2153 'type' => Controls_Manager::HIDDEN,
2154 'default' => 'style',
2155 'selectors' => array(
2156 $this->selector( '__field.range-field::-webkit-slider-thumb' ) => 'margin-top: calc( ({{thumb_size.SIZE}}{{thumb_size.UNIT}} - {{track_height.SIZE}}{{track_height.UNIT}})/-2 )',
2157 ),
2158 )
2159 );
2160
2161 $this->add_control(
2162 'track_border_radius',
2163 array(
2164 'label' => esc_html__( 'Track Border Radius', 'jet-form-builder' ),
2165 'type' => Controls_Manager::DIMENSIONS,
2166 'size_units' => array( 'px', '%', 'em', 'rem', 'custom' ),
2167 'selectors' => array(
2168 $this->selector( '__field.range-field::-webkit-slider-runnable-track' ) => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
2169 $this->selector( '__field.range-field::-moz-range-track' ) => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
2170 $this->selector( '__field.range-field::-ms-track' ) => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
2171 ),
2172 )
2173 );
2174
2175 $this->add_control(
2176 'thumb_border_radius',
2177 array(
2178 'label' => esc_html__( 'Thumb Border Radius', 'jet-form-builder' ),
2179 'type' => Controls_Manager::DIMENSIONS,
2180 'size_units' => array( 'px', '%', 'em', 'rem', 'custom' ),
2181 'selectors' => array(
2182 $this->selector( '__field.range-field::-webkit-slider-thumb' ) => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
2183 $this->selector( '__field.range-field::-moz-range-thumb' ) => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
2184 $this->selector( '__field.range-field::-ms-thumb' ) => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
2185 ),
2186 )
2187 );
2188
2189 $this->add_control(
2190 'track_bg_color',
2191 array(
2192 'label' => esc_html__( 'Track Color', 'jet-form-builder' ),
2193 'type' => Controls_Manager::COLOR,
2194 'selectors' => array(
2195 $this->selector( '__field.range-field::-webkit-slider-runnable-track' ) => 'background-color: {{VALUE}};',
2196 $this->selector( '__field.range-field::-moz-range-track' ) => 'background-color: {{VALUE}};',
2197 $this->selector( '__field.range-field::-ms-track' ) => 'background-color: {{VALUE}};',
2198 ),
2199 )
2200 );
2201
2202 $this->add_control(
2203 'thumb_bg_color',
2204 array(
2205 'label' => esc_html__( 'Thumb Color', 'jet-form-builder' ),
2206 'type' => Controls_Manager::COLOR,
2207 'selectors' => array(
2208 $this->selector( '__field.range-field::-webkit-slider-thumb' ) => 'background-color: {{VALUE}};',
2209 $this->selector( '__field.range-field::-moz-range-thumb' ) => 'background-color: {{VALUE}};',
2210 $this->selector( '__field.range-field::-ms-thumb' ) => 'background-color: {{VALUE}};',
2211 ),
2212 )
2213 );
2214
2215 $this->add_control(
2216 'range_value_heading',
2217 array(
2218 'label' => esc_html__( 'Value', 'jet-form-builder' ),
2219 'type' => Controls_Manager::HEADING,
2220 'separator' => 'before',
2221 )
2222 );
2223
2224 $this->add_group_control(
2225 Group_Control_Typography::get_type(),
2226 array(
2227 'name' => 'range_value_typography',
2228 'selector' => $this->selector( '__field-value.range-value' ),
2229 )
2230 );
2231
2232 $this->add_control(
2233 'range_value_color',
2234 array(
2235 'label' => esc_html__( 'Color', 'jet-form-builder' ),
2236 'type' => Controls_Manager::COLOR,
2237 'selectors' => array(
2238 $this->selector( '__field-value.range-value' ) => 'color: {{VALUE}};',
2239 ),
2240 )
2241 );
2242
2243 $this->add_responsive_control(
2244 'range_prefix_value_size',
2245 array(
2246 'label' => __( 'Prefix size', 'jet-form-builder' ),
2247 'type' => Controls_Manager::SLIDER,
2248 'size_units' => array( 'px', 'em', 'rem', 'custom' ),
2249 'range' => array(
2250 'px' => array(
2251 'min' => 10,
2252 'max' => 50,
2253 ),
2254 ),
2255 'selectors' => array(
2256 $this->selector( '__field-value.range-value .%s__field-value-prefix' ) => 'font-size: {{SIZE}}{{UNIT}};',
2257 ),
2258 'separator' => 'before',
2259 )
2260 );
2261
2262 $this->add_control(
2263 'range_prefix_value_color',
2264 array(
2265 'label' => __( 'Prefix Color', 'jet-form-builder' ),
2266 'type' => Controls_Manager::COLOR,
2267 'selectors' => array(
2268 $this->selector( '__field-value.range-value .%s__field-value-prefix' ) => 'color: {{VALUE}};',
2269 ),
2270 )
2271 );
2272
2273 $this->add_responsive_control(
2274 'range_suffix_value_size',
2275 array(
2276 'label' => __( 'Suffix size', 'jet-form-builder' ),
2277 'type' => Controls_Manager::SLIDER,
2278 'size_units' => array( 'px', 'em', 'rem', 'custom' ),
2279 'range' => array(
2280 'px' => array(
2281 'min' => 10,
2282 'max' => 50,
2283 ),
2284 ),
2285 'selectors' => array(
2286 $this->selector( '__field-value.range-value .%s__field-value-suffix' ) => 'font-size: {{SIZE}}{{UNIT}};',
2287 ),
2288 'separator' => 'before',
2289 )
2290 );
2291
2292 $this->add_control(
2293 'range_suffix_value_color',
2294 array(
2295 'label' => __( 'Suffix Color', 'jet-form-builder' ),
2296 'type' => Controls_Manager::COLOR,
2297 'selectors' => array(
2298 $this->selector( '__field-value.range-value .%s__field-value-suffix' ) => 'color: {{VALUE}};',
2299 ),
2300 )
2301 );
2302
2303 $this->end_controls_section();
2304 }
2305
2306 private function section_headings_style() {
2307 $this->start_controls_section(
2308 'section_headings_style',
2309 array(
2310 'label' => __( 'Heading', 'jet-form-builder' ),
2311 'tab' => Controls_Manager::TAB_STYLE,
2312 'show_label' => false,
2313 )
2314 );
2315
2316 $this->add_control(
2317 'field_heading_styles_heading',
2318 array(
2319 'label' => esc_html__( 'Label', 'jet-form-builder' ),
2320 'type' => Controls_Manager::HEADING,
2321 'separator' => 'before',
2322 )
2323 );
2324
2325 $this->add_group_control(
2326 Group_Control_Typography::get_type(),
2327 array(
2328 'name' => 'field_heading_typography',
2329 'selector' => $this->selector( '__heading' ),
2330 )
2331 );
2332
2333 $this->add_control(
2334 'fields_heading_color',
2335 array(
2336 'label' => __( 'Color', 'jet-form-builder' ),
2337 'type' => Controls_Manager::COLOR,
2338 'selectors' => array(
2339 $this->selector( '__heading' ) => 'color: {{VALUE}}',
2340 ),
2341 )
2342 );
2343
2344 $this->add_responsive_control(
2345 'fields_heading_gap',
2346 array(
2347 'label' => __( 'Gap', 'jet-form-builder' ),
2348 'type' => Controls_Manager::DIMENSIONS,
2349 'size_units' => array( 'px', '%', 'em', 'rem', 'custom' ),
2350 'selectors' => array(
2351 $this->selector( '__heading' ) => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
2352 ),
2353 )
2354 );
2355
2356 $this->add_control(
2357 'field_heading_styles_desc',
2358 array(
2359 'label' => esc_html__( 'Description', 'jet-form-builder' ),
2360 'type' => Controls_Manager::HEADING,
2361 'separator' => 'before',
2362 )
2363 );
2364
2365 $this->add_group_control(
2366 Group_Control_Typography::get_type(),
2367 array(
2368 'name' => 'field_desc_typography',
2369 'selector' => $this->selector( '__heading-desc' ),
2370 )
2371 );
2372
2373 $this->add_control(
2374 'fields_desc_color',
2375 array(
2376 'label' => __( 'Color', 'jet-form-builder' ),
2377 'type' => Controls_Manager::COLOR,
2378 'selectors' => array(
2379 $this->selector( '__heading-desc' ) => 'color: {{VALUE}}',
2380 ),
2381 )
2382 );
2383
2384 $this->add_responsive_control(
2385 'fields_heading_desc_gap',
2386 array(
2387 'label' => __( 'Gap', 'jet-form-builder' ),
2388 'type' => Controls_Manager::DIMENSIONS,
2389 'size_units' => array( 'px', '%', 'em', 'rem', 'custom' ),
2390 'selectors' => array(
2391 $this->selector( '__heading-desc' ) => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
2392 ),
2393 )
2394 );
2395
2396 $this->end_controls_section();
2397 }
2398
2399 private function section_repeater_style() {
2400 $this->start_controls_section(
2401 'section_repeater_style',
2402 array(
2403 'label' => __( 'Repeater', 'jet-form-builder' ),
2404 'tab' => Controls_Manager::TAB_STYLE,
2405 'show_label' => false,
2406 )
2407 );
2408
2409 $this->add_control(
2410 'field_repeater_row_desc',
2411 array(
2412 'label' => esc_html__( 'Repeater row', 'jet-form-builder' ),
2413 'type' => Controls_Manager::HEADING,
2414 'separator' => 'before',
2415 )
2416 );
2417
2418 $this->add_responsive_control(
2419 'booking_form_repeater_row_padding',
2420 array(
2421 'label' => esc_html__( 'Padding', 'jet-form-builder' ),
2422 'type' => Controls_Manager::DIMENSIONS,
2423 'size_units' => array( 'px', '%', 'em', 'rem', 'custom' ),
2424 'selectors' => array(
2425 $this->selector( '-repeater__row' ) => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
2426 ),
2427 )
2428 );
2429
2430 $this->add_control(
2431 'field_repeater_new_desc',
2432 array(
2433 'label' => esc_html__( 'New item button', 'jet-form-builder' ),
2434 'type' => Controls_Manager::HEADING,
2435 'separator' => 'before',
2436 )
2437 );
2438
2439 $this->start_controls_tabs( 'tabs_booking_form_repeater_style' );
2440
2441 $this->start_controls_tab(
2442 'booking_form_repeater_normal',
2443 array(
2444 'label' => esc_html__( 'Normal', 'jet-form-builder' ),
2445 )
2446 );
2447
2448 $this->add_control(
2449 'booking_form_repeater_bg_color',
2450 array(
2451 'label' => esc_html__( 'Background Color', 'jet-form-builder' ),
2452 'type' => Controls_Manager::COLOR,
2453 'selectors' => array(
2454 $this->selector( '-repeater__new' ) => 'background-color: {{VALUE}};',
2455 ),
2456 )
2457 );
2458
2459 $this->add_control(
2460 'booking_form_repeater_color',
2461 array(
2462 'label' => esc_html__( 'Text Color', 'jet-form-builder' ),
2463 'type' => Controls_Manager::COLOR,
2464 'selectors' => array(
2465 $this->selector( '-repeater__new' ) => 'color: {{VALUE}};',
2466 ),
2467 )
2468 );
2469
2470 $this->end_controls_tab();
2471
2472 $this->start_controls_tab(
2473 'booking_form_repeater_hover',
2474 array(
2475 'label' => esc_html__( 'Hover', 'jet-form-builder' ),
2476 )
2477 );
2478
2479 $this->add_control(
2480 'booking_form_repeater_bg_color_hover',
2481 array(
2482 'label' => esc_html__( 'Background Color', 'jet-form-builder' ),
2483 'type' => Controls_Manager::COLOR,
2484 'selectors' => array(
2485 $this->selector( '-repeater__new:hover' ) => 'background-color: {{VALUE}};',
2486 ),
2487 )
2488 );
2489
2490 $this->add_control(
2491 'booking_form_repeater_color_hover',
2492 array(
2493 'label' => esc_html__( 'Text Color', 'jet-form-builder' ),
2494 'type' => Controls_Manager::COLOR,
2495 'selectors' => array(
2496 $this->selector( '-repeater__new:hover' ) => 'color: {{VALUE}}',
2497 ),
2498 )
2499 );
2500
2501 $this->add_control(
2502 'booking_form_repeater_hover_border_color',
2503 array(
2504 'label' => esc_html__( 'Border Color', 'jet-form-builder' ),
2505 'type' => Controls_Manager::COLOR,
2506 'condition' => array(
2507 'booking_form_repeater_border_border!' => '',
2508 ),
2509 'selectors' => array(
2510 $this->selector( '-repeater__new:hover' ) => 'border-color: {{VALUE}};',
2511 ),
2512 )
2513 );
2514
2515 $this->end_controls_tab();
2516
2517 $this->end_controls_tabs();
2518
2519 $this->add_group_control(
2520 Group_Control_Typography::get_type(),
2521 array(
2522 'name' => 'booking_form_repeater_typography',
2523 'selector' => $this->selector( '-repeater__new' ),
2524 'fields_options' => array(
2525 'typography' => array(
2526 'separator' => 'before',
2527 ),
2528 ),
2529 )
2530 );
2531
2532 $this->add_responsive_control(
2533 'booking_form_repeater_padding',
2534 array(
2535 'label' => esc_html__( 'Padding', 'jet-form-builder' ),
2536 'type' => Controls_Manager::DIMENSIONS,
2537 'size_units' => array( 'px', '%', 'em', 'rem', 'custom' ),
2538 'selectors' => array(
2539 $this->selector( '-repeater__new' ) => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
2540 ),
2541 )
2542 );
2543
2544 $this->add_responsive_control(
2545 'booking_form_repeater_margin',
2546 array(
2547 'label' => esc_html__( 'Margin', 'jet-form-builder' ),
2548 'type' => Controls_Manager::DIMENSIONS,
2549 'size_units' => array( 'px', '%', 'em', 'rem', 'custom' ),
2550 'selectors' => array(
2551 $this->selector( '-repeater__new' ) => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
2552 ),
2553 )
2554 );
2555
2556 $this->add_group_control(
2557 Group_Control_Border::get_type(),
2558 array(
2559 'name' => 'booking_form_repeater_border',
2560 'label' => esc_html__( 'Border', 'jet-form-builder' ),
2561 'placeholder' => '1px',
2562 'selector' => $this->selector( '-repeater__new' ),
2563 )
2564 );
2565
2566 $this->add_responsive_control(
2567 'booking_form_repeater_border_radius',
2568 array(
2569 'label' => esc_html__( 'Border Radius', 'jet-form-builder' ),
2570 'type' => Controls_Manager::DIMENSIONS,
2571 'size_units' => array( 'px', '%', 'em', 'rem', 'custom' ),
2572 'selectors' => array(
2573 $this->selector( '-repeater__new' ) => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
2574 ),
2575 )
2576 );
2577
2578 $this->add_group_control(
2579 Group_Control_Box_Shadow::get_type(),
2580 array(
2581 'name' => 'booking_form_repeater_box_shadow',
2582 'selector' => $this->selector( '-repeater__new' ),
2583 )
2584 );
2585
2586 $this->add_responsive_control(
2587 'booking_form_repeater_alignment',
2588 array(
2589 'label' => esc_html__( 'Alignment', 'jet-form-builder' ),
2590 'type' => Controls_Manager::CHOOSE,
2591 'options' => array(
2592 'flex-start' => array(
2593 'title' => esc_html__( 'Start', 'jet-form-builder' ),
2594 'icon' => ! is_rtl() ? 'eicon-h-align-left' : 'eicon-h-align-right',
2595 ),
2596 'center' => array(
2597 'title' => esc_html__( 'Center', 'jet-form-builder' ),
2598 'icon' => 'eicon-h-align-center',
2599 ),
2600 'flex-end' => array(
2601 'title' => esc_html__( 'End', 'jet-form-builder' ),
2602 'icon' => ! is_rtl() ? 'eicon-h-align-right' : 'eicon-h-align-left',
2603 ),
2604 ),
2605 'selectors' => array(
2606 $this->selector( '-repeater__actions' ) => 'justify-content: {{VALUE}};',
2607 ),
2608 )
2609 );
2610
2611 $this->add_control(
2612 'field_repeater_del_desc',
2613 array(
2614 'label' => esc_html__( 'Remove item button', 'jet-form-builder' ),
2615 'type' => Controls_Manager::HEADING,
2616 'separator' => 'before',
2617 )
2618 );
2619
2620 $this->start_controls_tabs( 'tabs_booking_form_repeater_del_style' );
2621
2622 $this->start_controls_tab(
2623 'booking_form_repeater_del_normal',
2624 array(
2625 'label' => esc_html__( 'Normal', 'jet-form-builder' ),
2626 )
2627 );
2628
2629 $this->add_control(
2630 'booking_form_repeater_del_bg_color',
2631 array(
2632 'label' => esc_html__( 'Background Color', 'jet-form-builder' ),
2633 'type' => Controls_Manager::COLOR,
2634 'selectors' => array(
2635 $this->selector( '-repeater__remove' ) => 'background-color: {{VALUE}}',
2636 ),
2637 )
2638 );
2639
2640 $this->add_control(
2641 'booking_form_repeater_del_color',
2642 array(
2643 'label' => esc_html__( 'Text Color', 'jet-form-builder' ),
2644 'type' => Controls_Manager::COLOR,
2645 'selectors' => array(
2646 $this->selector( '-repeater__remove' ) => 'color: {{VALUE}}',
2647 ),
2648 )
2649 );
2650
2651 $this->end_controls_tab();
2652
2653 $this->start_controls_tab(
2654 'booking_form_repeater_del_hover',
2655 array(
2656 'label' => esc_html__( 'Hover', 'jet-form-builder' ),
2657 )
2658 );
2659
2660 $this->add_control(
2661 'booking_form_repeater_del_bg_color_hover',
2662 array(
2663 'label' => esc_html__( 'Background Color', 'jet-form-builder' ),
2664 'type' => Controls_Manager::COLOR,
2665 'selectors' => array(
2666 $this->selector( '-repeater__remove:hover' ) => 'background-color: {{VALUE}}',
2667 ),
2668 )
2669 );
2670
2671 $this->add_control(
2672 'booking_form_repeater_del_color_hover',
2673 array(
2674 'label' => esc_html__( 'Text Color', 'jet-form-builder' ),
2675 'type' => Controls_Manager::COLOR,
2676 'selectors' => array(
2677 $this->selector( '-repeater__remove:hover' ) => 'color: {{VALUE}}',
2678 ),
2679 )
2680 );
2681
2682 $this->add_control(
2683 'booking_form_repeater_del_hover_border_color',
2684 array(
2685 'label' => esc_html__( 'Border Color', 'jet-form-builder' ),
2686 'type' => Controls_Manager::COLOR,
2687 'condition' => array(
2688 'booking_form_repeater_del_border_border!' => '',
2689 ),
2690 'selectors' => array(
2691 $this->selector( '-repeater__remove:hover' ) => 'border-color: {{VALUE}};',
2692 ),
2693 )
2694 );
2695
2696 $this->end_controls_tab();
2697
2698 $this->end_controls_tabs();
2699
2700 $this->add_responsive_control(
2701 'booking_form_repeater_del_padding',
2702 array(
2703 'label' => esc_html__( 'Padding', 'jet-form-builder' ),
2704 'type' => Controls_Manager::DIMENSIONS,
2705 'size_units' => array( 'px', '%', 'em', 'rem', 'custom' ),
2706 'separator' => 'before',
2707 'selectors' => array(
2708 $this->selector( '-repeater__remove' ) => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
2709 ),
2710 )
2711 );
2712
2713 $this->add_responsive_control(
2714 'booking_form_repeater_del_margin',
2715 array(
2716 'label' => esc_html__( 'Margin', 'jet-form-builder' ),
2717 'type' => Controls_Manager::DIMENSIONS,
2718 'size_units' => array( 'px', '%', 'em', 'rem', 'custom' ),
2719 'selectors' => array(
2720 $this->selector( '-repeater__remove' ) => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
2721 ),
2722 )
2723 );
2724
2725 $this->add_group_control(
2726 Group_Control_Border::get_type(),
2727 array(
2728 'name' => 'booking_form_repeater_del_border',
2729 'label' => esc_html__( 'Border', 'jet-form-builder' ),
2730 'placeholder' => '1px',
2731 'selector' => $this->selector( '-repeater__remove' ),
2732 )
2733 );
2734
2735 $this->add_responsive_control(
2736 'booking_form_repeater_del_border_radius',
2737 array(
2738 'label' => esc_html__( 'Border Radius', 'jet-form-builder' ),
2739 'type' => Controls_Manager::DIMENSIONS,
2740 'size_units' => array( 'px', '%', 'em', 'rem', 'custom' ),
2741 'selectors' => array(
2742 $this->selector( '-repeater__remove' ) => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
2743 ),
2744 )
2745 );
2746
2747 $this->add_responsive_control(
2748 'booking_form_repeater_del_size',
2749 array(
2750 'label' => esc_html__( 'Icon Size', 'jet-form-builder' ),
2751 'type' => Controls_Manager::SLIDER,
2752 'size_units' => array( 'px', 'em', 'rem', 'custom' ),
2753 'range' => array(
2754 'px' => array(
2755 'min' => 12,
2756 'max' => 90,
2757 ),
2758 ),
2759 'selectors' => array(
2760 $this->selector( '-repeater__remove' ) => 'font-size: {{SIZE}}{{UNIT}};line-height: {{SIZE}}{{UNIT}};',
2761 ),
2762 )
2763 );
2764
2765 $this->add_group_control(
2766 Group_Control_Box_Shadow::get_type(),
2767 array(
2768 'name' => 'booking_form_repeater_del_box_shadow',
2769 'selector' => $this->selector( '-repeater__remove' ),
2770 )
2771 );
2772
2773 $this->add_responsive_control(
2774 'booking_form_repeater_del_alignment',
2775 array(
2776 'label' => esc_html__( 'Alignment', 'jet-form-builder' ),
2777 'type' => Controls_Manager::CHOOSE,
2778 'default' => 'flex-start',
2779 'options' => array(
2780 'flex-start' => array(
2781 'title' => esc_html__( 'Top', 'jet-form-builder' ),
2782 'icon' => 'eicon-v-align-top',
2783 ),
2784 'center' => array(
2785 'title' => esc_html__( 'Middle', 'jet-form-builder' ),
2786 'icon' => 'eicon-v-align-middle',
2787 ),
2788 'flex-end' => array(
2789 'title' => esc_html__( 'Bottom', 'jet-form-builder' ),
2790 'icon' => 'eicon-v-align-bottom',
2791 ),
2792 ),
2793 'selectors' => array(
2794 $this->selector( '-repeater__row-remove' ) => 'align-self: {{VALUE}};',
2795 ),
2796 )
2797 );
2798
2799 $this->end_controls_section();
2800 }
2801
2802 private function conditional_style() {
2803 $this->start_controls_section(
2804 'conditional_style',
2805 array(
2806 'label' => esc_html__( 'Conditional block', 'jet-form-builder' ),
2807 'tab' => Controls_Manager::TAB_STYLE,
2808 'show_label' => false,
2809 )
2810 );
2811
2812 $this->add_responsive_control(
2813 'conditional_padding',
2814 array(
2815 'label' => esc_html__( 'Padding', 'jet-form-builder' ),
2816 'type' => Controls_Manager::DIMENSIONS,
2817 'size_units' => array( 'px', '%', 'em', 'rem', 'custom' ),
2818 'selectors' => array(
2819 $this->selector( '__conditional' ) => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
2820 ),
2821 )
2822 );
2823
2824 $this->add_responsive_control(
2825 'conditional_margin',
2826 array(
2827 'label' => esc_html__( 'Margin', 'jet-form-builder' ),
2828 'type' => Controls_Manager::DIMENSIONS,
2829 'size_units' => array( 'px', '%', 'em', 'rem', 'custom' ),
2830 'selectors' => array(
2831 $this->selector( '__conditional' ) => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
2832 ),
2833 )
2834 );
2835
2836 $this->add_group_control(
2837 Group_Control_Border::get_type(),
2838 array(
2839 'name' => 'conditional_border',
2840 'label' => esc_html__( 'Border', 'jet-form-builder' ),
2841 'placeholder' => '1px',
2842 'selector' => $this->selector( '__conditional' ),
2843 )
2844 );
2845
2846 $this->add_responsive_control(
2847 'conditional_border_radius',
2848 array(
2849 'label' => esc_html__( 'Border Radius', 'jet-form-builder' ),
2850 'type' => Controls_Manager::DIMENSIONS,
2851 'size_units' => array( 'px', '%', 'em', 'rem', 'custom' ),
2852 'selectors' => array(
2853 $this->selector( '__conditional' ) => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
2854 ),
2855 )
2856 );
2857
2858 $this->add_group_control(
2859 Group_Control_Box_Shadow::get_type(),
2860 array(
2861 'name' => 'conditional_box_shadow',
2862 'selector' => $this->selector( '__conditional' ),
2863 )
2864 );
2865
2866 $this->add_control(
2867 'conditional_bg_color',
2868 array(
2869 'label' => esc_html__( 'Background Color', 'jet-form-builder' ),
2870 'type' => Controls_Manager::COLOR,
2871 'selectors' => array(
2872 $this->selector( '__conditional' ) => 'background-color: {{VALUE}}',
2873 ),
2874 )
2875 );
2876
2877 $this->end_controls_section();
2878 }
2879
2880 private function form_submit_style() {
2881 $this->start_controls_section(
2882 'form_submit_style',
2883 array(
2884 'label' => esc_html__( 'Submit', 'jet-form-builder' ),
2885 'tab' => Controls_Manager::TAB_STYLE,
2886 'show_label' => false,
2887 )
2888 );
2889
2890 $this->start_controls_tabs( 'tabs_booking_form_submit_style' );
2891
2892 $this->start_controls_tab(
2893 'booking_form_submit_normal',
2894 array(
2895 'label' => esc_html__( 'Normal', 'jet-form-builder' ),
2896 )
2897 );
2898
2899 $this->add_control(
2900 'booking_form_submit_bg_color',
2901 array(
2902 'label' => esc_html__( 'Background Color', 'jet-form-builder' ),
2903 'type' => Controls_Manager::COLOR,
2904 'selectors' => array(
2905 $this->selector( '__action-button' ) => 'background-color: {{VALUE}}',
2906 ),
2907 )
2908 );
2909
2910 $this->add_control(
2911 'booking_form_submit_color',
2912 array(
2913 'label' => esc_html__( 'Text Color', 'jet-form-builder' ),
2914 'type' => Controls_Manager::COLOR,
2915 'selectors' => array(
2916 $this->selector( '__action-button' ) => 'color: {{VALUE}}',
2917 ),
2918 )
2919 );
2920
2921 $this->end_controls_tab();
2922
2923 $this->start_controls_tab(
2924 'booking_form_submit_hover',
2925 array(
2926 'label' => esc_html__( 'Hover', 'jet-form-builder' ),
2927 )
2928 );
2929
2930 $this->add_control(
2931 'booking_form_submit_bg_color_hover',
2932 array(
2933 'label' => esc_html__( 'Background Color', 'jet-form-builder' ),
2934 'type' => Controls_Manager::COLOR,
2935 'selectors' => array(
2936 $this->selector( '__action-button:hover' ) => 'background-color: {{VALUE}}',
2937 ),
2938 )
2939 );
2940
2941 $this->add_control(
2942 'booking_form_submit_color_hover',
2943 array(
2944 'label' => esc_html__( 'Text Color', 'jet-form-builder' ),
2945 'type' => Controls_Manager::COLOR,
2946 'selectors' => array(
2947 $this->selector( '__action-button:hover' ) => 'color: {{VALUE}}',
2948 ),
2949 )
2950 );
2951
2952 $this->add_control(
2953 'booking_form_submit_hover_border_color',
2954 array(
2955 'label' => esc_html__( 'Border Color', 'jet-form-builder' ),
2956 'type' => Controls_Manager::COLOR,
2957 'condition' => array(
2958 'booking_form_submit_border_border!' => '',
2959 ),
2960 'selectors' => array(
2961 $this->selector( '__action-button:hover' ) => 'border-color: {{VALUE}};',
2962 ),
2963 )
2964 );
2965
2966 $this->add_responsive_control(
2967 'booking_form_submit_hover_transition',
2968 array(
2969
2970 'type' => Controls_Manager::SLIDER,
2971 'label' => __( 'Transition Duration', 'jet-form-builder' ),
2972 'size_units' => array( 's', 'ms', 'custom' ),
2973 'default' => array(
2974 'unit' => 's',
2975 'size' => 0.3,
2976 ),
2977 'selectors' => array(
2978 $this->selector( '__action-button' ) => 'transition: all {{SIZE}}{{UNIT}};',
2979 ),
2980 )
2981 );
2982
2983 $this->end_controls_tab();
2984
2985 $this->end_controls_tabs();
2986
2987 $this->add_group_control(
2988 Group_Control_Typography::get_type(),
2989 array(
2990 'name' => 'booking_form_submit_typography',
2991 'selector' => $this->selector( '__action-button' ),
2992 )
2993 );
2994
2995 $this->add_responsive_control(
2996 'booking_form_submit_padding',
2997 array(
2998 'label' => esc_html__( 'Padding', 'jet-form-builder' ),
2999 'type' => Controls_Manager::DIMENSIONS,
3000 'size_units' => array( 'px', '%', 'em', 'rem', 'custom' ),
3001 'separator' => 'before',
3002 'selectors' => array(
3003 $this->selector( '__action-button' ) => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
3004 ),
3005 )
3006 );
3007
3008 $this->add_responsive_control(
3009 'booking_form_submit_margin',
3010 array(
3011 'label' => esc_html__( 'Margin', 'jet-form-builder' ),
3012 'type' => Controls_Manager::DIMENSIONS,
3013 'size_units' => array( 'px', '%', 'em', 'rem', 'custom' ),
3014 'selectors' => array(
3015 $this->selector( '__action-button' ) => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
3016 ),
3017 )
3018 );
3019
3020 $this->add_group_control(
3021 Group_Control_Border::get_type(),
3022 array(
3023 'name' => 'booking_form_submit_border',
3024 'label' => esc_html__( 'Border', 'jet-form-builder' ),
3025 'placeholder' => '1px',
3026 'selector' => $this->selector( '__action-button' ),
3027 )
3028 );
3029
3030 $this->add_responsive_control(
3031 'booking_form_submit_border_radius',
3032 array(
3033 'label' => esc_html__( 'Border Radius', 'jet-form-builder' ),
3034 'type' => Controls_Manager::DIMENSIONS,
3035 'size_units' => array( 'px', '%', 'em', 'rem', 'custom' ),
3036 'selectors' => array(
3037 $this->selector( '__action-button' ) => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
3038 ),
3039 )
3040 );
3041
3042 $this->add_group_control(
3043 Group_Control_Box_Shadow::get_type(),
3044 array(
3045 'name' => 'booking_form_submit_box_shadow',
3046 'selector' => $this->selector( '__action-button' ),
3047 )
3048 );
3049
3050 $this->add_responsive_control(
3051 'booking_form_submit_alignment',
3052 array(
3053 'label' => esc_html__( 'Alignment', 'jet-form-builder' ),
3054 'type' => Controls_Manager::CHOOSE,
3055 'options' => array(
3056 'flex-start' => array(
3057 'title' => esc_html__( 'Start', 'jet-form-builder' ),
3058 'icon' => ! is_rtl() ? 'eicon-h-align-left' : 'eicon-h-align-right',
3059 ),
3060 'center' => array(
3061 'title' => esc_html__( 'Center', 'jet-form-builder' ),
3062 'icon' => 'eicon-h-align-center',
3063 ),
3064 'flex-end' => array(
3065 'title' => esc_html__( 'End', 'jet-form-builder' ),
3066 'icon' => ! is_rtl() ? 'eicon-h-align-right' : 'eicon-h-align-left',
3067 ),
3068 'stretch' => array(
3069 'title' => esc_html__( 'Fullwidth', 'jet-form-builder' ),
3070 'icon' => 'eicon-h-align-stretch',
3071 ),
3072 ),
3073 'selectors' => array(
3074 $this->selector( '__submit-wrap' ) => 'justify-content: {{VALUE}}; align-items: {{VALUE}};',
3075 ),
3076 )
3077 );
3078
3079 $this->add_control(
3080 'booking_form_submit_alignment_hidden',
3081 array(
3082 'type' => Controls_Manager::HIDDEN,
3083 'default' => 'style',
3084 'selectors' => array(
3085 $this->selector( '__submit-wrap > .%s__submit' ) => 'width: 100%',
3086 ),
3087 'condition' => array(
3088 'booking_form_submit_alignment' => 'stretch',
3089 ),
3090 )
3091 );
3092
3093 $this->add_responsive_control(
3094 'booking_form_submit_alignment_text',
3095 array(
3096 'label' => esc_html__( 'Button Text Alignment', 'jet-form-builder' ),
3097 'type' => Controls_Manager::CHOOSE,
3098 'options' => array(
3099 'flex-start' => array(
3100 'title' => esc_html__( 'Start', 'jet-form-builder' ),
3101 'icon' => ! is_rtl() ? 'eicon-h-align-left' : 'eicon-h-align-right',
3102 ),
3103 'center' => array(
3104 'title' => esc_html__( 'Center', 'jet-form-builder' ),
3105 'icon' => 'eicon-h-align-center',
3106 ),
3107 'flex-end' => array(
3108 'title' => esc_html__( 'End', 'jet-form-builder' ),
3109 'icon' => ! is_rtl() ? 'eicon-h-align-right' : 'eicon-h-align-left',
3110 ),
3111 ),
3112 'selectors' => array(
3113 $this->selector( '__submit' ) => 'justify-content: {{VALUE}};',
3114 ),
3115 )
3116 );
3117
3118 $this->end_controls_section();
3119 }
3120
3121 private function section_form_break_style() {
3122 $this->start_controls_section(
3123 'section_form_break_style',
3124 array(
3125 'label' => __( 'Form Break Row', 'jet-form-builder' ),
3126 'tab' => Controls_Manager::TAB_STYLE,
3127 )
3128 );
3129
3130 $this->add_control(
3131 'form_break_notice',
3132 array(
3133 'type' => 'notice',
3134 'notice_type' => 'info',
3135 'dismissible' => false,
3136 'content' => esc_html__( 'Styles from this tab apply to the Next Page and Prev Page controls added through the Form Page Break block.', 'jet-form-builder' ),
3137 )
3138 );
3139
3140 $this->add_responsive_control(
3141 'form_break_gap',
3142 array(
3143 'label' => __( 'Gap', 'jet-form-builder' ),
3144 'type' => Controls_Manager::DIMENSIONS,
3145 'size_units' => array( 'px', '%', 'em', 'rem', 'custom' ),
3146 'selectors' => array(
3147 $this->selector( '__next-page-wrap' ) => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
3148 ),
3149 )
3150 );
3151
3152 $this->add_responsive_control(
3153 'form_break_alignment',
3154 array(
3155 'label' => __( 'Alignment', 'jet-form-builder' ),
3156 'type' => Controls_Manager::CHOOSE,
3157 'label_block' => false,
3158 'default' => 'left',
3159 'separator' => 'before',
3160 'options' => array(
3161 'left' => array(
3162 'title' => __( 'Left', 'jet-form-builder' ),
3163 'icon' => 'eicon-h-align-left',
3164 ),
3165 'center' => array(
3166 'title' => __( 'Center', 'jet-form-builder' ),
3167 'icon' => 'eicon-h-align-center',
3168 ),
3169 'right' => array(
3170 'title' => __( 'Right', 'jet-form-builder' ),
3171 'icon' => 'eicon-h-align-right',
3172 ),
3173 ),
3174 'selectors' => array(
3175 $this->selector( '__next-page-wrap' ) => 'text-align: {{VALUE}};',
3176 ),
3177 )
3178 );
3179
3180 $this->add_border(
3181 $this,
3182 'form_break_border',
3183 $this->selector( '__next-page-wrap' )
3184 );
3185
3186 $this->end_controls_section();
3187 }
3188
3189 private function section_form_break_next_style() {
3190 $this->start_controls_section(
3191 'section_form_break_next_style',
3192 array(
3193 'label' => __( 'Form Break Buttons', 'jet-form-builder' ),
3194 'tab' => Controls_Manager::TAB_STYLE,
3195 )
3196 );
3197
3198 $this->add_control(
3199 'form_break_next_notice',
3200 array(
3201 'type' => 'notice',
3202 'notice_type' => 'info',
3203 'dismissible' => false,
3204 'content' => esc_html__( 'The styles from this tab apply to the Next Page and Prev Page added as separate blocks in the form.', 'jet-form-builder' ),
3205 )
3206 );
3207
3208 $this->add_control(
3209 'form_break_next_button__error_heading',
3210 array(
3211 'label' => __( 'Next Button', 'jet-form-builder' ),
3212 'type' => Controls_Manager::HEADING,
3213 'separator' => 'after',
3214 )
3215 );
3216
3217 $this->add_responsive_control(
3218 'form_break_next_margin',
3219 array(
3220 'label' => __( 'Margin', 'jet-form-builder' ),
3221 'type' => Controls_Manager::DIMENSIONS,
3222 'size_units' => array( 'px', '%', 'em', 'rem', 'custom' ),
3223 'selectors' => array(
3224 $this->selector( '__next-page' ) => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
3225 ),
3226 )
3227 );
3228
3229 $this->add_responsive_control(
3230 'form_break_next_padding',
3231 array(
3232 'label' => __( 'Padding', 'jet-form-builder' ),
3233 'type' => Controls_Manager::DIMENSIONS,
3234 'size_units' => array( 'px', '%', 'em', 'rem', 'custom' ),
3235 'selectors' => array(
3236 $this->selector( '__next-page' ) => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
3237 ),
3238 )
3239 );
3240
3241 $this->add_responsive_control(
3242 'form_break_next_justify',
3243 array(
3244 'label' => __( 'Alignment', 'jet-form-builder' ),
3245 'type' => Controls_Manager::CHOOSE,
3246 'label_block' => false,
3247 'options' => array(
3248 'flex-start' => array(
3249 'title' => __( 'Left', 'jet-form-builder' ),
3250 'icon' => 'eicon-h-align-left',
3251 ),
3252 'center' => array(
3253 'title' => __( 'Center', 'jet-form-builder' ),
3254 'icon' => 'eicon-h-align-center',
3255 ),
3256 'flex-end' => array(
3257 'title' => __( 'Right', 'jet-form-builder' ),
3258 'icon' => 'eicon-h-align-right',
3259 ),
3260 ),
3261 'selectors' => array(
3262 $this->selector( '-row .%s__action-button-wrapper[data-type="next"]' ) => 'justify-content: {{VALUE}};',
3263 ),
3264 )
3265 );
3266
3267 $this->start_controls_tabs( 'form_break_next_styles' );
3268
3269 $this->start_controls_tab(
3270 'form_break_next--normal',
3271 array(
3272 'label' => __( 'Normal', 'jet-form-builder' ),
3273 )
3274 );
3275
3276 $this->add_group_control(
3277 Group_Control_Typography::get_type(),
3278 array(
3279 'name' => 'form_break_next_typography',
3280 'selector' => $this->selector( '__next-page' ),
3281 )
3282 );
3283
3284 $this->add_border(
3285 $this,
3286 'form_break_next_border',
3287 $this->selector( '__next-page' )
3288 );
3289
3290 $this->add_control(
3291 'form_break_next_color--normal',
3292 array(
3293 'label' => __( 'Color', 'jet-form-builder' ),
3294 'type' => Controls_Manager::COLOR,
3295 'selectors' => array(
3296 $this->selector( '__next-page' ) => 'color: {{VALUE}};',
3297 ),
3298 )
3299 );
3300
3301 $this->add_control(
3302 'form_break_next_bg_color--normal',
3303 array(
3304 'label' => __( 'Background Color', 'jet-form-builder' ),
3305 'type' => Controls_Manager::COLOR,
3306 'selectors' => array(
3307 $this->selector( '__next-page' ) => 'background-color: {{VALUE}};',
3308 ),
3309 )
3310 );
3311
3312 $this->end_controls_tab();
3313
3314 $this->start_controls_tab(
3315 'form_break_next--hover',
3316 array(
3317 'label' => __( 'Hover', 'jet-form-builder' ),
3318 )
3319 );
3320
3321 $this->add_group_control(
3322 Group_Control_Typography::get_type(),
3323 array(
3324 'name' => 'form_break_next_typography--hover',
3325 'selector' => $this->selector( '__next-page:hover' ),
3326 )
3327 );
3328
3329 $this->add_border(
3330 $this,
3331 'form_break_next_border--hover',
3332 $this->selector( '__next-page:hover' )
3333 );
3334
3335 $this->add_control(
3336 'form_break_next_color--hover',
3337 array(
3338 'label' => __( 'Color', 'jet-form-builder' ),
3339 'type' => Controls_Manager::COLOR,
3340 'selectors' => array(
3341 $this->selector( '__next-page:hover' ) => 'color: {{VALUE}};',
3342 ),
3343 )
3344 );
3345 $this->add_control(
3346 'form_break_next_bg_color--hover',
3347 array(
3348 'label' => __( 'Background Color', 'jet-form-builder' ),
3349 'type' => Controls_Manager::COLOR,
3350 'selectors' => array(
3351 $this->selector( '__next-page:hover' ) => 'background-color: {{VALUE}};',
3352 ),
3353 )
3354 );
3355
3356 $this->end_controls_tab();
3357
3358 $options = Tab_Handler_Manager::get_options( 'options-tab' );
3359
3360 if ( $options['disable_next_button'] ?? false ) {
3361 $this->start_controls_tab(
3362 'form_break_next--disabled',
3363 array(
3364 'label' => __( 'Disabled', 'jet-form-builder' ),
3365 )
3366 );
3367
3368 $this->add_group_control(
3369 Group_Control_Typography::get_type(),
3370 array(
3371 'name' => 'form_break_next_typography--disabled',
3372 'selector' => $this->selector( '__next-page:disabled' ),
3373 )
3374 );
3375
3376 $this->add_border(
3377 $this,
3378 'form_break_next_border--disabled',
3379 $this->selector( '__next-page:disabled' )
3380 );
3381
3382 $this->add_control(
3383 'form_break_next_color--disabled',
3384 array(
3385 'label' => __( 'Color', 'jet-form-builder' ),
3386 'type' => Controls_Manager::COLOR,
3387 'selectors' => array(
3388 $this->selector( '__next-page:disabled' ) => 'color: {{VALUE}};',
3389 ),
3390 )
3391 );
3392 $this->add_control(
3393 'form_break_next_bg_color--disabled',
3394 array(
3395 'label' => __( 'Background Color', 'jet-form-builder' ),
3396 'type' => Controls_Manager::COLOR,
3397 'selectors' => array(
3398 $this->selector( '__next-page:disabled' ) => 'background-color: {{VALUE}};',
3399 ),
3400 )
3401 );
3402
3403 $this->end_controls_tab();
3404 }
3405
3406 $this->end_controls_tabs();
3407
3408 $this->add_control(
3409 'form_break_prev_button__error_heading',
3410 array(
3411 'label' => __( 'Prev Button', 'jet-form-builder' ),
3412 'type' => Controls_Manager::HEADING,
3413 'separator' => 'before',
3414 )
3415 );
3416
3417 $this->add_responsive_control(
3418 'form_break_prev_margin',
3419 array(
3420 'label' => __( 'Margin', 'jet-form-builder' ),
3421 'type' => Controls_Manager::DIMENSIONS,
3422 'size_units' => array( 'px', '%', 'em', 'rem', 'custom' ),
3423 'selectors' => array(
3424 $this->selector( '__prev-page' ) => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
3425 ),
3426 )
3427 );
3428
3429 $this->add_responsive_control(
3430 'form_break_prev_padding',
3431 array(
3432 'label' => __( 'Padding', 'jet-form-builder' ),
3433 'type' => Controls_Manager::DIMENSIONS,
3434 'size_units' => array( 'px', '%', 'em', 'rem', 'custom' ),
3435 'selectors' => array(
3436 $this->selector( '__prev-page' ) => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
3437 ),
3438 )
3439 );
3440
3441 $this->add_responsive_control(
3442 'form_break_prev_justify',
3443 array(
3444 'label' => __( 'Alignment', 'jet-form-builder' ),
3445 'type' => Controls_Manager::CHOOSE,
3446 'label_block' => false,
3447 'options' => array(
3448 'flex-start' => array(
3449 'title' => __( 'Left', 'jet-form-builder' ),
3450 'icon' => 'eicon-h-align-left',
3451 ),
3452 'center' => array(
3453 'title' => __( 'Center', 'jet-form-builder' ),
3454 'icon' => 'eicon-h-align-center',
3455 ),
3456 'flex-end' => array(
3457 'title' => __( 'Right', 'jet-form-builder' ),
3458 'icon' => 'eicon-h-align-right',
3459 ),
3460 ),
3461 'selectors' => array(
3462 $this->selector( '-row .%s__action-button-wrapper[data-type="prev"]' ) => 'justify-content: {{VALUE}};',
3463 ),
3464 )
3465 );
3466
3467 $this->start_controls_tabs( 'form_break_prev_styles' );
3468
3469 $this->start_controls_tab(
3470 'form_break_prev--normal',
3471 array(
3472 'label' => __( 'Normal', 'jet-form-builder' ),
3473 )
3474 );
3475
3476 $this->add_group_control(
3477 Group_Control_Typography::get_type(),
3478 array(
3479 'name' => 'form_break_prev_typography',
3480 'selector' => $this->selector( '__prev-page' ),
3481 )
3482 );
3483
3484 $this->add_border(
3485 $this,
3486 'form_break_prev_border',
3487 $this->selector( '__prev-page' )
3488 );
3489
3490 $this->add_control(
3491 'form_break_prev_color--normal',
3492 array(
3493 'label' => __( 'Color', 'jet-form-builder' ),
3494 'type' => Controls_Manager::COLOR,
3495 'selectors' => array(
3496 $this->selector( '__prev-page' ) => 'color: {{VALUE}};',
3497 ),
3498 )
3499 );
3500
3501 $this->add_control(
3502 'form_break_prev_bg_color--normal',
3503 array(
3504 'label' => __( 'Background Color', 'jet-form-builder' ),
3505 'type' => Controls_Manager::COLOR,
3506 'selectors' => array(
3507 $this->selector( '__prev-page' ) => 'background-color: {{VALUE}};',
3508 ),
3509 )
3510 );
3511
3512 $this->end_controls_tab();
3513
3514 $this->start_controls_tab(
3515 'form_break_prev--hover',
3516 array(
3517 'label' => __( 'Hover', 'jet-form-builder' ),
3518 )
3519 );
3520
3521 $this->add_group_control(
3522 Group_Control_Typography::get_type(),
3523 array(
3524 'name' => 'form_break_prev_typography--hover',
3525 'selector' => $this->selector( '__prev-page:hover' ),
3526 )
3527 );
3528
3529 $this->add_border(
3530 $this,
3531 'form_break_prev_border--hover',
3532 $this->selector( '__prev-page:hover' )
3533 );
3534
3535 $this->add_control(
3536 'form_break_prev_color--hover',
3537 array(
3538 'label' => __( 'Color', 'jet-form-builder' ),
3539 'type' => Controls_Manager::COLOR,
3540 'selectors' => array(
3541 $this->selector( '__prev-page:hover' ) => 'color: {{VALUE}};',
3542 ),
3543 )
3544 );
3545 $this->add_control(
3546 'form_break_prev_bg_color--hover',
3547 array(
3548 'label' => __( 'Background Color', 'jet-form-builder' ),
3549 'type' => Controls_Manager::COLOR,
3550 'selectors' => array(
3551 $this->selector( '__prev-page:hover' ) => 'background-color: {{VALUE}};',
3552 ),
3553 )
3554 );
3555
3556 $this->end_controls_tab();
3557 $this->end_controls_tabs();
3558
3559 $this->end_controls_section();
3560 }
3561
3562 private function section_form_break_disabled_style() {
3563 $this->start_controls_section(
3564 'section_form_break_disabled_style',
3565 array(
3566 'label' => __( 'Form Break Disabled Message', 'jet-form-builder' ),
3567 'tab' => Controls_Manager::TAB_STYLE,
3568 )
3569 );
3570
3571 $this->add_responsive_control(
3572 'form_break_disabled_margin',
3573 array(
3574 'label' => __( 'Margin', 'jet-form-builder' ),
3575 'type' => Controls_Manager::DIMENSIONS,
3576 'size_units' => array( 'px', '%', 'em', 'rem', 'custom' ),
3577 'selectors' => array(
3578 $this->selector( '__next-page-msg' ) => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
3579 ),
3580 )
3581 );
3582
3583 $this->add_responsive_control(
3584 'form_break_disabled_padding',
3585 array(
3586 'label' => __( 'Padding', 'jet-form-builder' ),
3587 'type' => Controls_Manager::DIMENSIONS,
3588 'size_units' => array( 'px', '%', 'em', 'rem', 'custom' ),
3589 'selectors' => array(
3590 $this->selector( '__next-page-msg' ) => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
3591 ),
3592 )
3593 );
3594
3595 $this->add_group_control(
3596 Group_Control_Typography::get_type(),
3597 array(
3598 'name' => 'form_break_disabled_typography',
3599 'selector' => $this->selector( '__next-page-msg' ),
3600 )
3601 );
3602
3603 $this->add_border(
3604 $this,
3605 'form_break_disabled_border',
3606 $this->selector( '__next-page-msg' )
3607 );
3608
3609 $this->end_controls_section();
3610 }
3611
3612 private function section_message_error_style() {
3613 $this->start_controls_section(
3614 'section_message_error_style',
3615 array(
3616 'label' => __( 'Messages', 'jet-form-builder' ),
3617 'tab' => Controls_Manager::TAB_STYLE,
3618 )
3619 );
3620
3621 $this->start_controls_tabs( 'section_messages_tabs' );
3622
3623 $this->start_controls_tab(
3624 'messages_success_tab',
3625 array(
3626 'label' => __( 'Success Message', 'jet-form-builder' ),
3627 )
3628 );
3629
3630 $this->add_responsive_control(
3631 'form_success_margin',
3632 array(
3633 'label' => __( 'Margin', 'jet-form-builder' ),
3634 'type' => Controls_Manager::DIMENSIONS,
3635 'size_units' => array( 'px', '%', 'em', 'rem', 'custom' ),
3636 'selectors' => array(
3637 $this->selector( '-message--success' ) => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
3638 ),
3639 )
3640 );
3641
3642 $this->add_responsive_control(
3643 'form_success_padding',
3644 array(
3645 'label' => __( 'Padding', 'jet-form-builder' ),
3646 'type' => Controls_Manager::DIMENSIONS,
3647 'size_units' => array( 'px', '%', 'em', 'rem', 'custom' ),
3648 'selectors' => array(
3649 $this->selector( '-message--success' ) => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
3650 ),
3651 )
3652 );
3653
3654 $this->add_responsive_control(
3655 'form_success_alignment',
3656 array(
3657 'label' => __( 'Alignment', 'jet-form-builder' ),
3658 'type' => Controls_Manager::CHOOSE,
3659 'label_block' => false,
3660 'default' => 'center',
3661 'separator' => 'before',
3662 'options' => array(
3663 'left' => array(
3664 'title' => __( 'Left', 'jet-form-builder' ),
3665 'icon' => 'eicon-h-align-left',
3666 ),
3667 'center' => array(
3668 'title' => __( 'Center', 'jet-form-builder' ),
3669 'icon' => 'eicon-h-align-center',
3670 ),
3671 'right' => array(
3672 'title' => __( 'Right', 'jet-form-builder' ),
3673 'icon' => 'eicon-h-align-right',
3674 ),
3675 ),
3676 'selectors' => array(
3677 $this->selector( '-message--success' ) => 'text-align: {{VALUE}};',
3678 ),
3679 )
3680 );
3681
3682 $this->add_group_control(
3683 Group_Control_Typography::get_type(),
3684 array(
3685 'name' => 'form_success_typography',
3686 'selector' => $this->selector( '-message--success' ),
3687 )
3688 );
3689
3690 $this->add_control(
3691 'form_success_color',
3692 array(
3693 'label' => __( 'Color', 'jet-form-builder' ),
3694 'type' => Controls_Manager::COLOR,
3695 'selectors' => array(
3696 $this->selector( '-message--success' ) => 'color: {{VALUE}};',
3697 ),
3698 )
3699 );
3700 $this->add_control(
3701 'form_success_bg_color',
3702 array(
3703 'label' => __( 'Background Color', 'jet-form-builder' ),
3704 'type' => Controls_Manager::COLOR,
3705 'selectors' => array(
3706 $this->selector( '-message--success' ) => 'background-color: {{VALUE}};',
3707 ),
3708 )
3709 );
3710
3711 $this->add_border(
3712 $this,
3713 'form_success_border',
3714 $this->selector( '-message--success' )
3715 );
3716
3717 $this->end_controls_tab();
3718
3719 $this->start_controls_tab(
3720 'messages_error_tab',
3721 array(
3722 'label' => __( 'Error Message', 'jet-form-builder' ),
3723 )
3724 );
3725
3726 $this->add_responsive_control(
3727 'form_error_margin',
3728 array(
3729 'label' => __( 'Margin', 'jet-form-builder' ),
3730 'type' => Controls_Manager::DIMENSIONS,
3731 'size_units' => array( 'px', '%', 'em', 'rem', 'custom' ),
3732 'selectors' => array(
3733 $this->selector( '-message--error' ) => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
3734 ),
3735 )
3736 );
3737
3738 $this->add_responsive_control(
3739 'form_error_padding',
3740 array(
3741 'label' => __( 'Padding', 'jet-form-builder' ),
3742 'type' => Controls_Manager::DIMENSIONS,
3743 'size_units' => array( 'px', '%', 'em', 'rem', 'custom' ),
3744 'selectors' => array(
3745 $this->selector( '-message--error' ) => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
3746 ),
3747 )
3748 );
3749
3750 $this->add_responsive_control(
3751 'form_error_alignment',
3752 array(
3753 'label' => __( 'Alignment', 'jet-form-builder' ),
3754 'type' => Controls_Manager::CHOOSE,
3755 'label_block' => false,
3756 'default' => 'center',
3757 'separator' => 'before',
3758 'options' => array(
3759 'left' => array(
3760 'title' => __( 'Left', 'jet-form-builder' ),
3761 'icon' => 'eicon-h-align-left',
3762 ),
3763 'center' => array(
3764 'title' => __( 'Center', 'jet-form-builder' ),
3765 'icon' => 'eicon-h-align-center',
3766 ),
3767 'right' => array(
3768 'title' => __( 'Right', 'jet-form-builder' ),
3769 'icon' => 'eicon-h-align-right',
3770 ),
3771 ),
3772 'selectors' => array(
3773 $this->selector( '-message--error' ) => 'text-align: {{VALUE}};',
3774 ),
3775 )
3776 );
3777
3778 $this->add_group_control(
3779 Group_Control_Typography::get_type(),
3780 array(
3781 'name' => 'form_error_typography',
3782 'selector' => $this->selector( '-message--error' ),
3783 )
3784 );
3785
3786 $this->add_control(
3787 'form_error_color',
3788 array(
3789 'label' => __( 'Color', 'jet-form-builder' ),
3790 'type' => Controls_Manager::COLOR,
3791 'selectors' => array(
3792 $this->selector( '-message--error' ) => 'color: {{VALUE}};',
3793 ),
3794 )
3795 );
3796 $this->add_control(
3797 'form_error_bg_color',
3798 array(
3799 'label' => __( 'Background Color', 'jet-form-builder' ),
3800 'type' => Controls_Manager::COLOR,
3801 'selectors' => array(
3802 $this->selector( '-message--error' ) => 'background-color: {{VALUE}};',
3803 ),
3804 )
3805 );
3806
3807 $this->add_border(
3808 $this,
3809 'form_error_border',
3810 $this->selector( '-message--error' )
3811 );
3812
3813 $this->end_controls_tab();
3814 $this->end_controls_tabs();
3815 $this->end_controls_section();
3816 }
3817
3818
3819 private function add_border( $instance, $control_id, $selector ) {
3820 $instance->add_group_control(
3821 Group_Control_Border::get_type(),
3822 array(
3823 'name' => $control_id,
3824 'label' => __( 'Border', 'jet-form-builder' ),
3825 'placeholder' => '1px',
3826 'selector' => $selector,
3827 )
3828 );
3829 $instance->add_responsive_control(
3830 $control_id . '_radius',
3831 array(
3832 'label' => __( 'Border Radius', 'jet-form-builder' ),
3833 'type' => Controls_Manager::DIMENSIONS,
3834 'size_units' => array( 'px', '%', 'em', 'rem', 'custom' ),
3835 'selectors' => array(
3836 $selector => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
3837 ),
3838 )
3839 );
3840 }
3841
3842 /**
3843 * Render the widget output on the frontend.
3844 *
3845 * Written in PHP and used to generate the final HTML.
3846 *
3847 * @since 1.1.0
3848 *
3849 * @access protected
3850 */
3851 protected function render() {
3852 wp_print_styles( 'wp-block-library' );
3853 $settings = $this->get_settings_for_display();
3854
3855 // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
3856 echo jet_fb_render_form( $settings );
3857 }
3858
3859
3860 }
3861