PluginProbe ʕ •ᴥ•ʔ
JetFormBuilder — Dynamic Blocks Form Builder / 3.4.2
JetFormBuilder — Dynamic Blocks Form Builder v3.4.2
3.6.3.1 3.6.3 3.6.2.2 3.6.2.1 3.6.2 3.6.1.1 3.6.1 3.6.0.1 trunk 1.0.0 1.0.1 1.0.2 1.0.3 1.1.0 1.1.1 1.1.2 1.1.3 1.1.4 1.1.5 1.1.6 1.1.7 1.2.0 1.2.1 1.2.2 1.2.3 1.2.4 1.2.5 1.2.6 1.2.7 1.3.0 1.3.1 1.3.2 1.3.3 1.4.0 1.4.1 1.4.2 1.4.3 1.5.0 1.5.1 1.5.2 1.5.3 1.5.4 1.5.5 2.0.0 2.0.1 2.0.2 2.0.3 2.0.4 2.0.5 2.0.6 2.1.0 2.1.1 2.1.10 2.1.11 2.1.2 2.1.3 2.1.4 2.1.5 2.1.6 2.1.7 2.1.8 2.1.9 3.0.0 3.0.0.1 3.0.0.2 3.0.0.3 3.0.1 3.0.1.1 3.0.2 3.0.3 3.0.4 3.0.5 3.0.6 3.0.7 3.0.8 3.0.9 3.1.0 3.1.0.1 3.1.1 3.1.2 3.1.3 3.1.4 3.1.5 3.1.6 3.1.7 3.1.8 3.1.9 3.2.0 3.2.1 3.2.2 3.2.3 3.3.0 3.3.1 3.3.2 3.3.3 3.3.3.1 3.3.4 3.3.4.1 3.3.4.2 3.4.0 3.4.1 3.4.2 3.4.3 3.4.4 3.4.5 3.4.5.1 3.4.5.2 3.4.6 3.4.7 3.4.7.1 3.5.0 3.5.1 3.5.1.1 3.5.1.2 3.5.2 3.5.2.1 3.5.3 3.5.4 3.5.5 3.5.6 3.5.6.1 3.5.6.2 3.5.6.3 3.6.0
jetformbuilder / compatibility / elementor / widgets / form.php
jetformbuilder / compatibility / elementor / widgets Last commit date
form.php 1 year ago widget-base-it.php 2 years ago
form.php
3817 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 'fields_layout',
1132 array(
1133 'label' => __( 'Fields Layout', 'jet-form-builder' ),
1134 'type' => Controls_Manager::SELECT,
1135 'default' => '',
1136 'options' => $options['fields_layout'],
1137 )
1138 );
1139
1140 $this->add_control(
1141 'required_mark',
1142 array(
1143 'label' => __( 'Required Mark', 'jet-form-builder' ),
1144 'type' => Controls_Manager::TEXT,
1145 'default' => '',
1146 )
1147 );
1148
1149 $this->add_control(
1150 'fields_label_tag',
1151 array(
1152 'label' => __( 'Fields label HTML tag', 'jet-form-builder' ),
1153 'type' => Controls_Manager::SELECT,
1154 'default' => '',
1155 'options' => $options['fields_label_tag'],
1156 )
1157 );
1158
1159 $this->add_control(
1160 'submit_type',
1161 array(
1162 'label' => __( 'Submit Type', 'jet-form-builder' ),
1163 'type' => Controls_Manager::SELECT,
1164 'default' => '',
1165 'options' => $options['submit_type'],
1166 )
1167 );
1168
1169 $this->add_control(
1170 'enable_progress',
1171 array(
1172 'label' => __( 'Enable form pages progress', 'jet-form-builder' ),
1173 'type' => Controls_Manager::SWITCHER,
1174 'label_on' => __( 'Yes', 'jet-form-builder' ),
1175 'label_off' => __( 'No', 'jet-form-builder' ),
1176 'return_value' => true,
1177 'default' => false,
1178 )
1179 );
1180
1181 $this->add_control(
1182 'clear',
1183 array(
1184 'label' => __( 'Clear data on success submit', 'jet-form-builder' ),
1185 'type' => Controls_Manager::SWITCHER,
1186 'label_on' => __( 'Yes', 'jet-form-builder' ),
1187 'label_off' => __( 'No', 'jet-form-builder' ),
1188 'return_value' => true,
1189 'default' => false,
1190 )
1191 );
1192
1193 $this->end_controls_section();
1194 }
1195
1196 private function section_form_style() {
1197 $this->start_controls_section(
1198 'section_form_style',
1199 array(
1200 'label' => __( 'Form Row', 'jet-form-builder' ),
1201 'tab' => Controls_Manager::TAB_STYLE,
1202 )
1203 );
1204
1205 $this->add_responsive_control(
1206 'form_row_gap_before',
1207 array(
1208
1209 'type' => Controls_Manager::SLIDER,
1210 'label' => __( 'Gap Before', 'jet-form-builder' ),
1211 'size_units' => array( 'px', 'em', 'rem', 'custom' ),
1212 'range' => array(
1213 'px' => array(
1214 'min' => 0,
1215 'max' => 100,
1216 ),
1217 ),
1218 'selectors' => array(
1219 $this->selector( '-row' ) => 'margin-top: {{SIZE}}{{UNIT}};',
1220 ),
1221 )
1222 );
1223
1224 $this->add_responsive_control(
1225 'form_row_gap_after',
1226 array(
1227
1228 'type' => Controls_Manager::SLIDER,
1229 'label' => __( 'Gap After', 'jet-form-builder' ),
1230 'size_units' => array( 'px', 'em', 'rem', 'custom' ),
1231 'range' => array(
1232 'px' => array(
1233 'min' => 0,
1234 'max' => 100,
1235 ),
1236 ),
1237 'selectors' => array(
1238 $this->selector( '-row' ) => 'margin-bottom: {{SIZE}}{{UNIT}};',
1239 ),
1240 )
1241 );
1242
1243 $this->end_controls_section();
1244 }
1245
1246 private function section_label_style() {
1247 $this->start_controls_section(
1248 'section_label_style',
1249 array(
1250 'label' => __( 'Label', 'jet-form-builder' ),
1251 'tab' => Controls_Manager::TAB_STYLE,
1252 )
1253 );
1254
1255 $this->add_responsive_control(
1256 'form_label_margin',
1257 array(
1258 'label' => __( 'Margin', 'jet-form-builder' ),
1259 'type' => Controls_Manager::DIMENSIONS,
1260 'size_units' => array( 'px', '%', 'em', 'rem', 'custom' ),
1261 'selectors' => array(
1262 $this->selector( '__label' ) => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
1263 ),
1264 )
1265 );
1266
1267 $this->add_responsive_control(
1268 'form_label_padding',
1269 array(
1270 'label' => __( 'Padding', 'jet-form-builder' ),
1271 'type' => Controls_Manager::DIMENSIONS,
1272 'size_units' => array( 'px', '%', 'em', 'rem', 'custom' ),
1273 'selectors' => array(
1274 $this->selector( '__label' ) => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
1275 ),
1276 )
1277 );
1278
1279 $this->add_responsive_control(
1280 'form_label_alignment',
1281 array(
1282 'label' => __( 'Alignment', 'jet-form-builder' ),
1283 'type' => Controls_Manager::CHOOSE,
1284 'label_block' => false,
1285 'default' => 'left',
1286 'separator' => 'before',
1287 'options' => array(
1288 'left' => array(
1289 'title' => __( 'Left', 'jet-form-builder' ),
1290 'icon' => 'eicon-h-align-left',
1291 ),
1292 'center' => array(
1293 'title' => __( 'Center', 'jet-form-builder' ),
1294 'icon' => 'eicon-h-align-center',
1295 ),
1296 'right' => array(
1297 'title' => __( 'Right', 'jet-form-builder' ),
1298 'icon' => 'eicon-h-align-right',
1299 ),
1300 ),
1301 'selectors' => array(
1302 $this->selector( '__label' ) => 'text-align: {{VALUE}};',
1303 ),
1304 )
1305 );
1306
1307 $this->add_group_control(
1308 Group_Control_Typography::get_type(),
1309 array(
1310 'name' => 'form_label_typography',
1311 'selector' => $this->selector( '__label' ),
1312 )
1313 );
1314
1315 $this->add_control(
1316 'form_label_color',
1317 array(
1318 'label' => __( 'Color', 'jet-form-builder' ),
1319 'type' => Controls_Manager::COLOR,
1320 'selectors' => array(
1321 $this->selector( '__label' ) => 'color: {{VALUE}};',
1322 ),
1323 )
1324 );
1325 $this->add_control(
1326 'form_label_bg_color',
1327 array(
1328 'label' => __( 'Background Color', 'jet-form-builder' ),
1329 'type' => Controls_Manager::COLOR,
1330 'selectors' => array(
1331 $this->selector( '__label' ) => 'background-color: {{VALUE}};',
1332 ),
1333 )
1334 );
1335 $this->add_border(
1336 $this,
1337 'form_label_border',
1338 $this->selector( '__label' )
1339 );
1340
1341 $this->add_control(
1342 'divider__label__required_mark',
1343 array(
1344 'label' => __( 'Required Mark', 'jet-form-builder' ),
1345 'type' => Controls_Manager::HEADING,
1346 'separator' => 'before',
1347 )
1348 );
1349
1350 $this->add_group_control(
1351 Group_Control_Typography::get_type(),
1352 array(
1353 'name' => 'form_required_typography',
1354 'selector' => $this->selector( '__label .%s__required' ),
1355 )
1356 );
1357 $this->add_control(
1358 'form_required_color',
1359 array(
1360 'label' => __( 'Color', 'jet-form-builder' ),
1361 'type' => Controls_Manager::COLOR,
1362 'selectors' => array(
1363 $this->selector( '__label .%s__required' ) => 'color: {{VALUE}};',
1364 ),
1365 )
1366 );
1367 $this->end_controls_section();
1368 }
1369
1370 private function section_description_style() {
1371 $this->start_controls_section(
1372 'section_description_style',
1373 array(
1374 'label' => __( 'Description', 'jet-form-builder' ),
1375 'tab' => Controls_Manager::TAB_STYLE,
1376 )
1377 );
1378 $this->add_responsive_control(
1379 'form_description_margin',
1380 array(
1381 'label' => __( 'Margin', 'jet-form-builder' ),
1382 'type' => Controls_Manager::DIMENSIONS,
1383 'size_units' => array( 'px', '%', 'em', 'rem', 'custom' ),
1384 'selectors' => array(
1385 $this->selector( '__desc' ) => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
1386 ),
1387 )
1388 );
1389
1390 $this->add_responsive_control(
1391 'form_description_padding',
1392 array(
1393 'label' => __( 'Padding', 'jet-form-builder' ),
1394 'type' => Controls_Manager::DIMENSIONS,
1395 'size_units' => array( 'px', '%', 'em', 'rem', 'custom' ),
1396 'selectors' => array(
1397 $this->selector( '__desc' ) => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
1398 ),
1399 )
1400 );
1401
1402 $this->add_responsive_control(
1403 'form_description_alignment',
1404 array(
1405 'label' => __( 'Alignment', 'jet-form-builder' ),
1406 'type' => Controls_Manager::CHOOSE,
1407 'label_block' => false,
1408 'default' => 'left',
1409 'separator' => 'before',
1410 'options' => array(
1411 'left' => array(
1412 'title' => __( 'Left', 'jet-form-builder' ),
1413 'icon' => 'eicon-h-align-left',
1414 ),
1415 'center' => array(
1416 'title' => __( 'Center', 'jet-form-builder' ),
1417 'icon' => 'eicon-h-align-center',
1418 ),
1419 'right' => array(
1420 'title' => __( 'Right', 'jet-form-builder' ),
1421 'icon' => 'eicon-h-align-right',
1422 ),
1423 ),
1424 'selectors' => array(
1425 $this->selector( '__desc' ) => 'text-align: {{VALUE}};',
1426 ),
1427 )
1428 );
1429
1430 $this->add_group_control(
1431 Group_Control_Typography::get_type(),
1432 array(
1433 'name' => 'form_description_typography',
1434 'selector' => $this->selector( '__desc' ),
1435 )
1436 );
1437
1438 $this->add_control(
1439 'form_description_color',
1440 array(
1441 'label' => __( 'Color', 'jet-form-builder' ),
1442 'type' => Controls_Manager::COLOR,
1443 'selectors' => array(
1444 $this->selector( '__desc' ) => 'color: {{VALUE}};',
1445 ),
1446 )
1447 );
1448 $this->add_control(
1449 'form_description_bg_color',
1450 array(
1451 'label' => __( 'Background Color', 'jet-form-builder' ),
1452 'type' => Controls_Manager::COLOR,
1453 'selectors' => array(
1454 $this->selector( '__desc' ) => 'background-color: {{VALUE}};',
1455 ),
1456 )
1457 );
1458 $this->add_border(
1459 $this,
1460 'form_description_border',
1461 $this->selector( '__desc' )
1462 );
1463 $this->end_controls_section();
1464 }
1465
1466 private function section_checkradio_fields_style() {
1467 $this->start_controls_section(
1468 'section_checkradio_fields_style',
1469 array(
1470 'label' => __( 'Checkbox & Radio Fields', 'jet-form-builder' ),
1471 'tab' => Controls_Manager::TAB_STYLE,
1472 'show_label' => false,
1473 )
1474 );
1475
1476 $this->add_responsive_control(
1477 'checkradio_fields_layout',
1478 array(
1479 'label' => __( 'Layout', 'jet-form-builder' ),
1480 'type' => Controls_Manager::CHOOSE,
1481 'label_block' => false,
1482 'options' => array(
1483 'inline-block' => array(
1484 'title' => __( 'Horizontal', 'jet-form-builder' ),
1485 'icon' => 'eicon-ellipsis-h',
1486 ),
1487 'block' => array(
1488 'title' => __( 'Vertical', 'jet-form-builder' ),
1489 'icon' => 'eicon-editor-list-ul',
1490 ),
1491 ),
1492 'selectors_dictionary' => array(
1493 'inline-block' => 'row',
1494 'block' => 'column',
1495 ),
1496 'selectors' => array(
1497 $this->selector( '__fields-group' ) => 'flex-direction: {{VALUE}};',
1498 ),
1499 )
1500 );
1501
1502 $this->add_responsive_control(
1503 'checkradio_fields_gaps',
1504 array(
1505 'label' => __( 'Gaps', 'jet-form-builder' ),
1506 'type' => Controls_Manager::GAPS,
1507 'size_units' => array( 'px', 'em', 'rem', 'custom' ),
1508 'default' => array(
1509 'row' => '0.7',
1510 'column' => '0.7',
1511 'unit' => 'em',
1512 ),
1513 'validators' => array(
1514 'Number' => array(
1515 'min' => 0,
1516 ),
1517 ),
1518 'selectors' => array(
1519 $this->selector( '__fields-group' ) => 'gap: {{ROW}}{{UNIT}} {{COLUMN}}{{UNIT}};',
1520 ),
1521 )
1522 );
1523
1524 $this->add_group_control(
1525 Group_Control_Typography::get_type(),
1526 array(
1527 'name' => 'checkradio_fields_typography',
1528 'selector' => $this->selector( '__field-wrap label' ),
1529 )
1530 );
1531
1532 $this->add_responsive_control(
1533 'checkradio_fields_gap',
1534 array(
1535 'label' => __( 'Gap between control and label', 'jet-form-builder' ),
1536 'type' => Controls_Manager::SLIDER,
1537 'size_units' => array( 'px', 'em', 'rem', 'custom' ),
1538 'default' => array(
1539 'size' => 8,
1540 ),
1541 'range' => array(
1542 'px' => array(
1543 'min' => 0,
1544 'max' => 50,
1545 ),
1546 ),
1547 'selectors' => array(
1548 $this->selector( '__field-wrap.checkradio-wrap span' ) => 'gap: {{SIZE}}{{UNIT}};',
1549 ),
1550 )
1551 );
1552 $this->add_responsive_control(
1553 'checkradio_fields_control_size',
1554 array(
1555 'label' => __( 'Control Size', 'jet-form-builder' ),
1556 'type' => Controls_Manager::SLIDER,
1557 'size_units' => array( 'px', 'em', 'rem', 'custom' ),
1558 'range' => array(
1559 'px' => array(
1560 'min' => 0,
1561 'max' => 50,
1562 ),
1563 ),
1564 'selectors' => array(
1565 $this->selector( '__field-wrap span::before' ) => 'font-size: {{SIZE}}{{UNIT}};',
1566 ),
1567 )
1568 );
1569
1570 $this->add_control(
1571 'checkradio_fields_option_label_heading',
1572 array(
1573 'label' => __( 'Option label', 'jet-form-builder' ),
1574 'type' => Controls_Manager::HEADING,
1575 'separator' => 'before',
1576 )
1577 );
1578
1579 $this->add_control(
1580 'checkradio_fields_color',
1581 array(
1582 'label' => __( 'Color', 'jet-form-builder' ),
1583 'type' => Controls_Manager::COLOR,
1584 'selectors' => array(
1585 $this->selector( '__field-wrap label' ) => 'color: {{VALUE}}',
1586 ),
1587 )
1588 );
1589
1590 $this->add_control(
1591 'checkradio_fields_background_color',
1592 array(
1593 'label' => __( 'Background color', 'jet-form-builder' ),
1594 'type' => Controls_Manager::COLOR,
1595 'selectors' => array(
1596 $this->selector( '__field-wrap label' ) => 'background-color: {{VALUE}}',
1597 ),
1598 )
1599 );
1600
1601 $this->start_controls_tabs(
1602 'tab__checkradio_tabs_items',
1603 array(
1604 'separator' => 'before',
1605 )
1606 );
1607
1608 $this->start_controls_tab(
1609 'tab__checkradio_control_color__normal',
1610 array(
1611 'label' => __( 'Normal', 'jet-form-builder' ),
1612 )
1613 );
1614
1615 $this->add_border(
1616 $this,
1617 'tab__checkradio_control_border__normal',
1618 $this->selector( '__field-wrap span::before' )
1619 );
1620
1621 $this->add_control(
1622 'tab__checkradio_control_bg_color__normal',
1623 array(
1624 'label' => esc_html__( 'Background Color', 'jet-form-builder' ),
1625 'type' => Controls_Manager::COLOR,
1626 'selectors' => array(
1627 $this->selector( '__field-wrap label > span::before' ) => 'background-color: {{VALUE}};',
1628 ),
1629 )
1630 );
1631
1632 $this->end_controls_tab();
1633
1634 $this->start_controls_tab(
1635 'tab__checkradio_control_border__hover',
1636 array(
1637 'label' => __( 'Hover', 'jet-form-builder' ),
1638 )
1639 );
1640
1641 $this->add_border(
1642 $this,
1643 'tab__checkradio_control_border__hover',
1644 $this->selector( '__field-wrap label :not(:disabled):not(:checked):hover + span::before' )
1645 );
1646
1647 $this->add_control(
1648 'tab__checkradio_control_bg_color__hover',
1649 array(
1650 'label' => esc_html__( 'Background Color', 'jet-form-builder' ),
1651 'type' => Controls_Manager::COLOR,
1652 'selectors' => array(
1653 $this->selector( '__field-wrap label :not(:disabled):not(:checked):hover + span::before' ) => 'background-color: {{VALUE}};',
1654 ),
1655 )
1656 );
1657
1658 $this->end_controls_tab();
1659
1660 $this->start_controls_tab(
1661 'tab__checkradio_control_border__focus',
1662 array(
1663 'label' => __( 'Focus', 'jet-form-builder' ),
1664 )
1665 );
1666
1667 $this->add_border(
1668 $this,
1669 'tab__checkradio_control_border__focus',
1670 $this->selector( '__field-wrap label :focus:not(:checked) + span::before' )
1671 );
1672
1673 $this->add_control(
1674 'tab__checkradio_control_bg_color__focus',
1675 array(
1676 'label' => esc_html__( 'Background Color', 'jet-form-builder' ),
1677 'type' => Controls_Manager::COLOR,
1678 'selectors' => array(
1679 $this->selector( '__field-wrap label :focus:not(:checked) + span::before' ) => 'background-color: {{VALUE}};',
1680 ),
1681 )
1682 );
1683
1684 $this->end_controls_tab();
1685
1686 $this->start_controls_tab(
1687 'tab__checkradio_control_border__checked',
1688 array(
1689 'label' => __( 'Checked', 'jet-form-builder' ),
1690 )
1691 );
1692
1693 $this->add_border(
1694 $this,
1695 'tab__checkradio_control_border__checked',
1696 $this->selector( '__field-wrap label :checked + span::before' )
1697 );
1698
1699 $this->add_control(
1700 'tab__checkradio_control_bg_color__checked',
1701 array(
1702 'label' => esc_html__( 'Background Color', 'jet-form-builder' ),
1703 'type' => Controls_Manager::COLOR,
1704 'selectors' => array(
1705 $this->selector( '__field-wrap label :checked + span::before' ) => 'background-color: {{VALUE}};',
1706 ),
1707 )
1708 );
1709
1710 $this->end_controls_tab();
1711 $this->end_controls_tabs();
1712 $this->end_controls_section();
1713 }
1714
1715 private function section_form_input_fields() {
1716 $simple_input = '__field:not(.checkradio-field):not(.range-field):not(.%s-repeater):not(.wysiwyg-field)';
1717
1718 $this->start_controls_section(
1719 'section_form_input_fields',
1720 array(
1721 'label' => __( 'Input Fields', 'jet-form-builder' ),
1722 'tab' => Controls_Manager::TAB_STYLE,
1723 )
1724 );
1725
1726 $this->add_group_control(
1727 Group_Control_Typography::get_type(),
1728 array(
1729 'name' => 'fields_typography',
1730 'selector' => $this->selector( $simple_input ),
1731 )
1732 );
1733
1734 $this->add_control(
1735 'fields_color',
1736 array(
1737 'label' => __( 'Color', 'jet-form-builder' ),
1738 'type' => Controls_Manager::COLOR,
1739 'selectors' => array(
1740 $this->selector( $simple_input ) => 'color: {{VALUE}};',
1741 ),
1742 )
1743 );
1744
1745 $this->add_control(
1746 'fields_placeholder_color',
1747 array(
1748 'label' => __( 'Placeholder Color', 'jet-form-builder' ),
1749 'type' => Controls_Manager::COLOR,
1750 'selectors' => array(
1751 $this->selector( ' ::-webkit-input-placeholder' ) => 'color: {{VALUE}};',
1752 $this->selector( ' ::-ms-input-placeholder' ) => 'color: {{VALUE}};',
1753 $this->selector( ' ::-moz-placeholder' ) => 'color: {{VALUE}};',
1754 $this->selector( ' :-moz-placeholder' ) => 'color: {{VALUE}};',
1755 ),
1756 )
1757 );
1758
1759 $this->add_control(
1760 'fields_background_color',
1761 array(
1762 'label' => __( 'Background Color', 'jet-form-builder' ),
1763 'type' => Controls_Manager::COLOR,
1764 'selectors' => array(
1765 $this->selector( $simple_input ) => 'background-color: {{VALUE}};',
1766 ),
1767 )
1768 );
1769
1770 $this->add_responsive_control(
1771 'fields_padding',
1772 array(
1773 'label' => __( 'Padding', 'jet-form-builder' ),
1774 'type' => Controls_Manager::DIMENSIONS,
1775 'size_units' => array( 'px', '%', 'em', 'rem', 'custom' ),
1776 'selectors' => array(
1777 $this->selector( $simple_input ) => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
1778 ),
1779 )
1780 );
1781
1782 $this->add_responsive_control(
1783 'fields_margin',
1784 array(
1785 'label' => __( 'Margin', 'jet-form-builder' ),
1786 'type' => Controls_Manager::DIMENSIONS,
1787 'size_units' => array( 'px', '%', 'em', 'rem', 'custom' ),
1788 'selectors' => array(
1789 $this->selector( $simple_input ) => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
1790 ),
1791 )
1792 );
1793
1794 $this->add_group_control(
1795 Group_Control_Border::get_type(),
1796 array(
1797 'name' => 'fields_border',
1798 'label' => __( 'Border', 'jet-form-builder' ),
1799 'placeholder' => '1px',
1800 'selector' => $this->selector( $simple_input ),
1801 )
1802 );
1803
1804 $this->add_responsive_control(
1805 'fields_border_radius',
1806 array(
1807 'label' => __( 'Border Radius', 'jet-form-builder' ),
1808 'type' => Controls_Manager::DIMENSIONS,
1809 'size_units' => array( 'px', '%', 'em', 'rem', 'custom' ),
1810 'selectors' => array(
1811 $this->selector( $simple_input ) => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
1812 ),
1813 )
1814 );
1815
1816 $this->add_group_control(
1817 Group_Control_Box_Shadow::get_type(),
1818 array(
1819 'name' => 'fields_box_shadow',
1820 'selector' => $this->selector( $simple_input ),
1821 )
1822 );
1823
1824 $this->add_responsive_control(
1825 'fields_width',
1826 array(
1827 'label' => __( 'Fields width', 'jet-form-builder' ),
1828 'type' => Controls_Manager::SLIDER,
1829 'size_units' => array( 'px', '%', 'em', 'rem', 'custom' ),
1830 'range' => array(
1831 'px' => array(
1832 'min' => 50,
1833 'max' => 1000,
1834 ),
1835 ),
1836 'selectors' => array(
1837 $this->selector( $simple_input ) => 'max-width: {{SIZE}}{{UNIT}};',
1838 ),
1839 )
1840 );
1841
1842 $this->add_responsive_control(
1843 'fields_textarea_height',
1844 array(
1845 'label' => __( 'Textarea Height', 'jet-form-builder' ),
1846 'type' => Controls_Manager::SLIDER,
1847 'size_units' => array( 'px', 'em', 'rem', 'custom' ),
1848 'range' => array(
1849 'px' => array(
1850 'min' => 10,
1851 'max' => 500,
1852 ),
1853 ),
1854 'selectors' => array(
1855 $this->selector( '__field.textarea-field' ) => 'height:{{SIZE}}{{UNIT}}; min-height:{{SIZE}}{{UNIT}};',
1856 ),
1857 )
1858 );
1859
1860 $this->add_control(
1861 'fields_color_scheme',
1862 array(
1863 'label' => __( 'Color Scheme', 'jet-form-builder' ),
1864 'type' => Controls_Manager::SELECT,
1865 'description' => __( 'Affects default browser UI elements like date and time icons, UI etc.', 'jet-form-builder' ),
1866 'default' => 'normal',
1867 'options' => array(
1868 'normal' => __( 'Normal', 'jet-form-builder' ),
1869 'light' => __( 'Light', 'jet-form-builder' ),
1870 'dark' => __( 'Dark', 'jet-form-builder' ),
1871 ),
1872 'selectors' => array(
1873 $this->selector( ' input' ) => 'color-scheme: {{VALUE}};',
1874 ),
1875 )
1876 );
1877
1878 $this->end_controls_section();
1879 }
1880
1881 private function section_calc_fields_style() {
1882 $this->start_controls_section(
1883 'section_calc_fields_style',
1884 array(
1885 'label' => __( 'Calculated Fields', 'jet-form-builder' ),
1886 'tab' => Controls_Manager::TAB_STYLE,
1887 'show_label' => false,
1888 )
1889 );
1890
1891 $this->add_group_control(
1892 Group_Control_Typography::get_type(),
1893 array(
1894 'name' => 'calc_fields_typography',
1895 'selector' => $this->selector( '__calculated-field' ),
1896 )
1897 );
1898
1899 $this->add_control(
1900 'calc_fields_color',
1901 array(
1902 'label' => __( 'Color', 'jet-form-builder' ),
1903 'type' => Controls_Manager::COLOR,
1904 'selectors' => array(
1905 $this->selector( '__calculated-field' ) => 'color: {{VALUE}}',
1906 ),
1907 )
1908 );
1909
1910 $this->add_control(
1911 'calc_fields_prefix_color',
1912 array(
1913 'label' => __( 'Prefix Color', 'jet-form-builder' ),
1914 'type' => Controls_Manager::COLOR,
1915 'selectors' => array(
1916 $this->selector( '__calculated-field-prefix' ) => 'color: {{VALUE}}',
1917 ),
1918 )
1919 );
1920
1921 $this->add_responsive_control(
1922 'calc_fields_prefix_size',
1923 array(
1924 'label' => __( 'Prefix size', 'jet-form-builder' ),
1925 'type' => Controls_Manager::SLIDER,
1926 'size_units' => array( 'px', 'em', 'rem', 'custom' ),
1927 'range' => array(
1928 'px' => array(
1929 'min' => 10,
1930 'max' => 50,
1931 ),
1932 ),
1933 'selectors' => array(
1934 $this->selector( '__calculated-field-prefix' ) => 'font-size: {{SIZE}}{{UNIT}};',
1935 ),
1936 )
1937 );
1938
1939 $this->add_control(
1940 'calc_fields_suffix_color',
1941 array(
1942 'label' => __( 'Suffix Color', 'jet-form-builder' ),
1943 'type' => Controls_Manager::COLOR,
1944 'selectors' => array(
1945 $this->selector( '__calculated-field-suffix' ) => 'color: {{VALUE}}',
1946 ),
1947 )
1948 );
1949
1950 $this->add_responsive_control(
1951 'calc_fields_suffix_size',
1952 array(
1953 'label' => __( 'Suffix size', 'jet-form-builder' ),
1954 'type' => Controls_Manager::SLIDER,
1955 'size_units' => array( 'px', 'em', 'rem', 'custom' ),
1956 'range' => array(
1957 'px' => array(
1958 'min' => 10,
1959 'max' => 50,
1960 ),
1961 ),
1962 'selectors' => array(
1963 $this->selector( '__calculated-field-suffix' ) => 'font-size: {{SIZE}}{{UNIT}};',
1964 ),
1965 )
1966 );
1967
1968 $this->add_control(
1969 'calc_fields_background_color',
1970 array(
1971 'label' => __( 'Background Color', 'jet-form-builder' ),
1972 'type' => Controls_Manager::COLOR,
1973 'selectors' => array(
1974 $this->selector( '__calculated-field' ) => 'background-color: {{VALUE}}',
1975 ),
1976 )
1977 );
1978
1979 $this->add_responsive_control(
1980 'calc_fields_padding',
1981 array(
1982 'label' => __( 'Padding', 'jet-form-builder' ),
1983 'type' => Controls_Manager::DIMENSIONS,
1984 'size_units' => array( 'px', '%', 'em', 'rem', 'custom' ),
1985 'selectors' => array(
1986 $this->selector( '__calculated-field' ) => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
1987 ),
1988 )
1989 );
1990
1991 $this->add_responsive_control(
1992 'calc_fields_margin',
1993 array(
1994 'label' => __( 'Margin', 'jet-form-builder' ),
1995 'type' => Controls_Manager::DIMENSIONS,
1996 'size_units' => array( 'px', '%', 'em', 'rem', 'custom' ),
1997 'selectors' => array(
1998 $this->selector( '__calculated-field' ) => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
1999 ),
2000 )
2001 );
2002
2003 $this->add_group_control(
2004 Group_Control_Border::get_type(),
2005 array(
2006 'name' => 'calc_fields_border',
2007 'label' => __( 'Border', 'jet-form-builder' ),
2008 'placeholder' => '1px',
2009 'selector' => $this->selector( '__calculated-field' ),
2010 )
2011 );
2012
2013 $this->add_responsive_control(
2014 'calc_fields_border_radius',
2015 array(
2016 'label' => __( 'Border Radius', 'jet-form-builder' ),
2017 'type' => Controls_Manager::DIMENSIONS,
2018 'size_units' => array( 'px', '%', 'em', 'rem', 'custom' ),
2019 'selectors' => array(
2020 $this->selector( '__calculated-field' ) => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
2021 ),
2022 )
2023 );
2024
2025 $this->add_responsive_control(
2026 'calc_fields_flex_align',
2027 array(
2028 'label' => __( 'Content Align', 'jet-form-builder' ),
2029 'type' => Controls_Manager::SELECT,
2030 'options' => array(
2031 '' => __( 'Default', 'jet-form-builder' ),
2032 'start' => __( 'Left', 'jet-form-builder' ),
2033 'center' => __( 'Center', 'jet-form-builder' ),
2034 'end' => __( 'Right', 'jet-form-builder' ),
2035 'space-between' => __( 'Space Between', 'jet-form-builder' ),
2036 'space-evenly' => __( 'Space Evenly', 'jet-form-builder' ),
2037 'space-around' => __( 'Space Around', 'jet-form-builder' ),
2038 ),
2039 'selectors' => array(
2040 $this->selector( '__calculated-field' ) => 'justify-content: {{VALUE}};',
2041 ),
2042 )
2043 );
2044
2045 $this->end_controls_section();
2046 }
2047
2048 private function section_range_fields_style() {
2049 $this->start_controls_section(
2050 'section_range_fields_style',
2051 array(
2052 'label' => __( 'Range Fields', 'jet-form-builder' ),
2053 'tab' => Controls_Manager::TAB_STYLE,
2054 )
2055 );
2056
2057 $this->add_responsive_control(
2058 'range_max_width',
2059 array(
2060 'label' => esc_html__( 'Max Width', 'jet-form-builder' ),
2061 'type' => Controls_Manager::SLIDER,
2062 'size_units' => array( 'px', 'em', 'rem', 'custom' ),
2063 'range' => array(
2064 'px' => array(
2065 'min' => 1,
2066 'max' => 1000,
2067 ),
2068 ),
2069 'selectors' => array(
2070 $this->selector( '__field-wrap.range-wrap' ) => 'max-width: {{SIZE}}{{UNIT}};',
2071 ),
2072 )
2073 );
2074
2075 $this->add_control(
2076 'range_slider_heading',
2077 array(
2078 'label' => esc_html__( 'Slider', 'jet-form-builder' ),
2079 'type' => Controls_Manager::HEADING,
2080 'separator' => 'before',
2081 )
2082 );
2083
2084 $this->add_responsive_control(
2085 'track_height',
2086 array(
2087 'label' => esc_html__( 'Track Height', 'jet-form-builder' ),
2088 'type' => Controls_Manager::SLIDER,
2089 'size_units' => array( 'px', 'em', 'rem', 'custom' ),
2090 'range' => array(
2091 'px' => array(
2092 'min' => 1,
2093 'max' => 20,
2094 ),
2095 ),
2096 'selectors' => array(
2097 $this->selector( ' .range-field::-webkit-slider-runnable-track' ) => 'height: {{SIZE}}{{UNIT}};',
2098 $this->selector( ' .range-field::-moz-range-track' ) => 'height: {{SIZE}}{{UNIT}};',
2099 $this->selector( ' .range-field::-ms-track' ) => 'height: {{SIZE}}{{UNIT}};',
2100 $this->selector( ' .range-field::-webkit-slider-thumb' ) => 'margin-top: calc( (18px - {{SIZE}}{{UNIT}})/-2 )',
2101 ),
2102 )
2103 );
2104
2105 $this->add_responsive_control(
2106 'thumb_size',
2107 array(
2108 'label' => esc_html__( 'Thumb Size', 'jet-form-builder' ),
2109 'type' => Controls_Manager::SLIDER,
2110 'size_units' => array( 'px', 'em', 'rem', 'custom' ),
2111 'range' => array(
2112 'px' => array(
2113 'min' => 1,
2114 'max' => 50,
2115 ),
2116 ),
2117 'selectors' => array(
2118 $this->selector( '__field.range-field' ) => 'min-height: {{SIZE}}{{UNIT}};',
2119 $this->selector( '__field.range-field::-webkit-slider-thumb' ) => 'width: {{SIZE}}{{UNIT}}; height: {{SIZE}}{{UNIT}}; margin-top: calc( ({{SIZE}}{{UNIT}} - 4px)/-2 )',
2120 $this->selector( '__field.range-field::-moz-range-thumb' ) => 'width: {{SIZE}}{{UNIT}}; height: {{SIZE}}{{UNIT}};',
2121 $this->selector( '__field.range-field::-ms-thumb' ) => 'width: {{SIZE}}{{UNIT}}; height: {{SIZE}}{{UNIT}};',
2122 ),
2123 )
2124 );
2125
2126 $this->add_control(
2127 'thumb_indent',
2128 array(
2129 'type' => Controls_Manager::HIDDEN,
2130 'default' => 'style',
2131 'selectors' => array(
2132 $this->selector( '__field.range-field::-webkit-slider-thumb' ) => 'margin-top: calc( ({{thumb_size.SIZE}}{{thumb_size.UNIT}} - {{track_height.SIZE}}{{track_height.UNIT}})/-2 )',
2133 ),
2134 )
2135 );
2136
2137 $this->add_control(
2138 'track_border_radius',
2139 array(
2140 'label' => esc_html__( 'Track Border Radius', 'jet-form-builder' ),
2141 'type' => Controls_Manager::DIMENSIONS,
2142 'size_units' => array( 'px', '%', 'em', 'rem', 'custom' ),
2143 'selectors' => array(
2144 $this->selector( '__field.range-field::-webkit-slider-runnable-track' ) => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
2145 $this->selector( '__field.range-field::-moz-range-track' ) => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
2146 $this->selector( '__field.range-field::-ms-track' ) => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
2147 ),
2148 )
2149 );
2150
2151 $this->add_control(
2152 'thumb_border_radius',
2153 array(
2154 'label' => esc_html__( 'Thumb Border Radius', 'jet-form-builder' ),
2155 'type' => Controls_Manager::DIMENSIONS,
2156 'size_units' => array( 'px', '%', 'em', 'rem', 'custom' ),
2157 'selectors' => array(
2158 $this->selector( '__field.range-field::-webkit-slider-thumb' ) => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
2159 $this->selector( '__field.range-field::-moz-range-thumb' ) => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
2160 $this->selector( '__field.range-field::-ms-thumb' ) => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
2161 ),
2162 )
2163 );
2164
2165 $this->add_control(
2166 'track_bg_color',
2167 array(
2168 'label' => esc_html__( 'Track Color', 'jet-form-builder' ),
2169 'type' => Controls_Manager::COLOR,
2170 'selectors' => array(
2171 $this->selector( '__field.range-field::-webkit-slider-runnable-track' ) => 'background-color: {{VALUE}};',
2172 $this->selector( '__field.range-field::-moz-range-track' ) => 'background-color: {{VALUE}};',
2173 $this->selector( '__field.range-field::-ms-track' ) => 'background-color: {{VALUE}};',
2174 ),
2175 )
2176 );
2177
2178 $this->add_control(
2179 'thumb_bg_color',
2180 array(
2181 'label' => esc_html__( 'Thumb Color', 'jet-form-builder' ),
2182 'type' => Controls_Manager::COLOR,
2183 'selectors' => array(
2184 $this->selector( '__field.range-field::-webkit-slider-thumb' ) => 'background-color: {{VALUE}};',
2185 $this->selector( '__field.range-field::-moz-range-thumb' ) => 'background-color: {{VALUE}};',
2186 $this->selector( '__field.range-field::-ms-thumb' ) => 'background-color: {{VALUE}};',
2187 ),
2188 )
2189 );
2190
2191 $this->add_control(
2192 'range_value_heading',
2193 array(
2194 'label' => esc_html__( 'Value', 'jet-form-builder' ),
2195 'type' => Controls_Manager::HEADING,
2196 'separator' => 'before',
2197 )
2198 );
2199
2200 $this->add_group_control(
2201 Group_Control_Typography::get_type(),
2202 array(
2203 'name' => 'range_value_typography',
2204 'selector' => $this->selector( '__field-value.range-value' ),
2205 )
2206 );
2207
2208 $this->add_control(
2209 'range_value_color',
2210 array(
2211 'label' => esc_html__( 'Color', 'jet-form-builder' ),
2212 'type' => Controls_Manager::COLOR,
2213 'selectors' => array(
2214 $this->selector( '__field-value.range-value' ) => 'color: {{VALUE}};',
2215 ),
2216 )
2217 );
2218
2219 $this->add_responsive_control(
2220 'range_prefix_value_size',
2221 array(
2222 'label' => __( 'Prefix size', 'jet-form-builder' ),
2223 'type' => Controls_Manager::SLIDER,
2224 'size_units' => array( 'px', 'em', 'rem', 'custom' ),
2225 'range' => array(
2226 'px' => array(
2227 'min' => 10,
2228 'max' => 50,
2229 ),
2230 ),
2231 'selectors' => array(
2232 $this->selector( '__field-value.range-value .%s__field-value-prefix' ) => 'font-size: {{SIZE}}{{UNIT}};',
2233 ),
2234 'separator' => 'before',
2235 )
2236 );
2237
2238 $this->add_control(
2239 'range_prefix_value_color',
2240 array(
2241 'label' => __( 'Prefix Color', 'jet-form-builder' ),
2242 'type' => Controls_Manager::COLOR,
2243 'selectors' => array(
2244 $this->selector( '__field-value.range-value .%s__field-value-prefix' ) => 'color: {{VALUE}};',
2245 ),
2246 )
2247 );
2248
2249 $this->add_responsive_control(
2250 'range_suffix_value_size',
2251 array(
2252 'label' => __( 'Suffix size', 'jet-form-builder' ),
2253 'type' => Controls_Manager::SLIDER,
2254 'size_units' => array( 'px', 'em', 'rem', 'custom' ),
2255 'range' => array(
2256 'px' => array(
2257 'min' => 10,
2258 'max' => 50,
2259 ),
2260 ),
2261 'selectors' => array(
2262 $this->selector( '__field-value.range-value .%s__field-value-suffix' ) => 'font-size: {{SIZE}}{{UNIT}};',
2263 ),
2264 'separator' => 'before',
2265 )
2266 );
2267
2268 $this->add_control(
2269 'range_suffix_value_color',
2270 array(
2271 'label' => __( 'Suffix Color', 'jet-form-builder' ),
2272 'type' => Controls_Manager::COLOR,
2273 'selectors' => array(
2274 $this->selector( '__field-value.range-value .%s__field-value-suffix' ) => 'color: {{VALUE}};',
2275 ),
2276 )
2277 );
2278
2279 $this->end_controls_section();
2280 }
2281
2282 private function section_headings_style() {
2283 $this->start_controls_section(
2284 'section_headings_style',
2285 array(
2286 'label' => __( 'Heading', 'jet-form-builder' ),
2287 'tab' => Controls_Manager::TAB_STYLE,
2288 'show_label' => false,
2289 )
2290 );
2291
2292 $this->add_control(
2293 'field_heading_styles_heading',
2294 array(
2295 'label' => esc_html__( 'Label', 'jet-form-builder' ),
2296 'type' => Controls_Manager::HEADING,
2297 'separator' => 'before',
2298 )
2299 );
2300
2301 $this->add_group_control(
2302 Group_Control_Typography::get_type(),
2303 array(
2304 'name' => 'field_heading_typography',
2305 'selector' => $this->selector( '__heading' ),
2306 )
2307 );
2308
2309 $this->add_control(
2310 'fields_heading_color',
2311 array(
2312 'label' => __( 'Color', 'jet-form-builder' ),
2313 'type' => Controls_Manager::COLOR,
2314 'selectors' => array(
2315 $this->selector( '__heading' ) => 'color: {{VALUE}}',
2316 ),
2317 )
2318 );
2319
2320 $this->add_responsive_control(
2321 'fields_heading_gap',
2322 array(
2323 'label' => __( 'Gap', 'jet-form-builder' ),
2324 'type' => Controls_Manager::DIMENSIONS,
2325 'size_units' => array( 'px', '%', 'em', 'rem', 'custom' ),
2326 'selectors' => array(
2327 $this->selector( '__heading' ) => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
2328 ),
2329 )
2330 );
2331
2332 $this->add_control(
2333 'field_heading_styles_desc',
2334 array(
2335 'label' => esc_html__( 'Description', 'jet-form-builder' ),
2336 'type' => Controls_Manager::HEADING,
2337 'separator' => 'before',
2338 )
2339 );
2340
2341 $this->add_group_control(
2342 Group_Control_Typography::get_type(),
2343 array(
2344 'name' => 'field_desc_typography',
2345 'selector' => $this->selector( '__heading-desc' ),
2346 )
2347 );
2348
2349 $this->add_control(
2350 'fields_desc_color',
2351 array(
2352 'label' => __( 'Color', 'jet-form-builder' ),
2353 'type' => Controls_Manager::COLOR,
2354 'selectors' => array(
2355 $this->selector( '__heading-desc' ) => 'color: {{VALUE}}',
2356 ),
2357 )
2358 );
2359
2360 $this->add_responsive_control(
2361 'fields_heading_desc_gap',
2362 array(
2363 'label' => __( 'Gap', 'jet-form-builder' ),
2364 'type' => Controls_Manager::DIMENSIONS,
2365 'size_units' => array( 'px', '%', 'em', 'rem', 'custom' ),
2366 'selectors' => array(
2367 $this->selector( '__heading-desc' ) => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
2368 ),
2369 )
2370 );
2371
2372 $this->end_controls_section();
2373 }
2374
2375 private function section_repeater_style() {
2376 $this->start_controls_section(
2377 'section_repeater_style',
2378 array(
2379 'label' => __( 'Repeater', 'jet-form-builder' ),
2380 'tab' => Controls_Manager::TAB_STYLE,
2381 'show_label' => false,
2382 )
2383 );
2384
2385 $this->add_control(
2386 'field_repeater_row_desc',
2387 array(
2388 'label' => esc_html__( 'Repeater row', 'jet-form-builder' ),
2389 'type' => Controls_Manager::HEADING,
2390 'separator' => 'before',
2391 )
2392 );
2393
2394 $this->add_responsive_control(
2395 'booking_form_repeater_row_padding',
2396 array(
2397 'label' => esc_html__( 'Padding', 'jet-form-builder' ),
2398 'type' => Controls_Manager::DIMENSIONS,
2399 'size_units' => array( 'px', '%', 'em', 'rem', 'custom' ),
2400 'selectors' => array(
2401 $this->selector( '-repeater__row' ) => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
2402 ),
2403 )
2404 );
2405
2406 $this->add_control(
2407 'field_repeater_new_desc',
2408 array(
2409 'label' => esc_html__( 'New item button', 'jet-form-builder' ),
2410 'type' => Controls_Manager::HEADING,
2411 'separator' => 'before',
2412 )
2413 );
2414
2415 $this->start_controls_tabs( 'tabs_booking_form_repeater_style' );
2416
2417 $this->start_controls_tab(
2418 'booking_form_repeater_normal',
2419 array(
2420 'label' => esc_html__( 'Normal', 'jet-form-builder' ),
2421 )
2422 );
2423
2424 $this->add_control(
2425 'booking_form_repeater_bg_color',
2426 array(
2427 'label' => esc_html__( 'Background Color', 'jet-form-builder' ),
2428 'type' => Controls_Manager::COLOR,
2429 'selectors' => array(
2430 $this->selector( '-repeater__new' ) => 'background-color: {{VALUE}};',
2431 ),
2432 )
2433 );
2434
2435 $this->add_control(
2436 'booking_form_repeater_color',
2437 array(
2438 'label' => esc_html__( 'Text Color', 'jet-form-builder' ),
2439 'type' => Controls_Manager::COLOR,
2440 'selectors' => array(
2441 $this->selector( '-repeater__new' ) => 'color: {{VALUE}};',
2442 ),
2443 )
2444 );
2445
2446 $this->end_controls_tab();
2447
2448 $this->start_controls_tab(
2449 'booking_form_repeater_hover',
2450 array(
2451 'label' => esc_html__( 'Hover', 'jet-form-builder' ),
2452 )
2453 );
2454
2455 $this->add_control(
2456 'booking_form_repeater_bg_color_hover',
2457 array(
2458 'label' => esc_html__( 'Background Color', 'jet-form-builder' ),
2459 'type' => Controls_Manager::COLOR,
2460 'selectors' => array(
2461 $this->selector( '-repeater__new:hover' ) => 'background-color: {{VALUE}};',
2462 ),
2463 )
2464 );
2465
2466 $this->add_control(
2467 'booking_form_repeater_color_hover',
2468 array(
2469 'label' => esc_html__( 'Text Color', 'jet-form-builder' ),
2470 'type' => Controls_Manager::COLOR,
2471 'selectors' => array(
2472 $this->selector( '-repeater__new:hover' ) => 'color: {{VALUE}}',
2473 ),
2474 )
2475 );
2476
2477 $this->add_control(
2478 'booking_form_repeater_hover_border_color',
2479 array(
2480 'label' => esc_html__( 'Border Color', 'jet-form-builder' ),
2481 'type' => Controls_Manager::COLOR,
2482 'condition' => array(
2483 'booking_form_repeater_border_border!' => '',
2484 ),
2485 'selectors' => array(
2486 $this->selector( '-repeater__new:hover' ) => 'border-color: {{VALUE}};',
2487 ),
2488 )
2489 );
2490
2491 $this->end_controls_tab();
2492
2493 $this->end_controls_tabs();
2494
2495 $this->add_group_control(
2496 Group_Control_Typography::get_type(),
2497 array(
2498 'name' => 'booking_form_repeater_typography',
2499 'selector' => $this->selector( '-repeater__new' ),
2500 'fields_options' => array(
2501 'typography' => array(
2502 'separator' => 'before',
2503 ),
2504 ),
2505 )
2506 );
2507
2508 $this->add_responsive_control(
2509 'booking_form_repeater_padding',
2510 array(
2511 'label' => esc_html__( 'Padding', 'jet-form-builder' ),
2512 'type' => Controls_Manager::DIMENSIONS,
2513 'size_units' => array( 'px', '%', 'em', 'rem', 'custom' ),
2514 'selectors' => array(
2515 $this->selector( '-repeater__new' ) => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
2516 ),
2517 )
2518 );
2519
2520 $this->add_responsive_control(
2521 'booking_form_repeater_margin',
2522 array(
2523 'label' => esc_html__( 'Margin', 'jet-form-builder' ),
2524 'type' => Controls_Manager::DIMENSIONS,
2525 'size_units' => array( 'px', '%', 'em', 'rem', 'custom' ),
2526 'selectors' => array(
2527 $this->selector( '-repeater__new' ) => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
2528 ),
2529 )
2530 );
2531
2532 $this->add_group_control(
2533 Group_Control_Border::get_type(),
2534 array(
2535 'name' => 'booking_form_repeater_border',
2536 'label' => esc_html__( 'Border', 'jet-form-builder' ),
2537 'placeholder' => '1px',
2538 'selector' => $this->selector( '-repeater__new' ),
2539 )
2540 );
2541
2542 $this->add_responsive_control(
2543 'booking_form_repeater_border_radius',
2544 array(
2545 'label' => esc_html__( 'Border Radius', 'jet-form-builder' ),
2546 'type' => Controls_Manager::DIMENSIONS,
2547 'size_units' => array( 'px', '%', 'em', 'rem', 'custom' ),
2548 'selectors' => array(
2549 $this->selector( '-repeater__new' ) => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
2550 ),
2551 )
2552 );
2553
2554 $this->add_group_control(
2555 Group_Control_Box_Shadow::get_type(),
2556 array(
2557 'name' => 'booking_form_repeater_box_shadow',
2558 'selector' => $this->selector( '-repeater__new' ),
2559 )
2560 );
2561
2562 $this->add_responsive_control(
2563 'booking_form_repeater_alignment',
2564 array(
2565 'label' => esc_html__( 'Alignment', 'jet-form-builder' ),
2566 'type' => Controls_Manager::CHOOSE,
2567 'options' => array(
2568 'flex-start' => array(
2569 'title' => esc_html__( 'Start', 'jet-form-builder' ),
2570 'icon' => ! is_rtl() ? 'eicon-h-align-left' : 'eicon-h-align-right',
2571 ),
2572 'center' => array(
2573 'title' => esc_html__( 'Center', 'jet-form-builder' ),
2574 'icon' => 'eicon-h-align-center',
2575 ),
2576 'flex-end' => array(
2577 'title' => esc_html__( 'End', 'jet-form-builder' ),
2578 'icon' => ! is_rtl() ? 'eicon-h-align-right' : 'eicon-h-align-left',
2579 ),
2580 ),
2581 'selectors' => array(
2582 $this->selector( '-repeater__actions' ) => 'justify-content: {{VALUE}};',
2583 ),
2584 )
2585 );
2586
2587 $this->add_control(
2588 'field_repeater_del_desc',
2589 array(
2590 'label' => esc_html__( 'Remove item button', 'jet-form-builder' ),
2591 'type' => Controls_Manager::HEADING,
2592 'separator' => 'before',
2593 )
2594 );
2595
2596 $this->start_controls_tabs( 'tabs_booking_form_repeater_del_style' );
2597
2598 $this->start_controls_tab(
2599 'booking_form_repeater_del_normal',
2600 array(
2601 'label' => esc_html__( 'Normal', 'jet-form-builder' ),
2602 )
2603 );
2604
2605 $this->add_control(
2606 'booking_form_repeater_del_bg_color',
2607 array(
2608 'label' => esc_html__( 'Background Color', 'jet-form-builder' ),
2609 'type' => Controls_Manager::COLOR,
2610 'selectors' => array(
2611 $this->selector( '-repeater__remove' ) => 'background-color: {{VALUE}}',
2612 ),
2613 )
2614 );
2615
2616 $this->add_control(
2617 'booking_form_repeater_del_color',
2618 array(
2619 'label' => esc_html__( 'Text Color', 'jet-form-builder' ),
2620 'type' => Controls_Manager::COLOR,
2621 'selectors' => array(
2622 $this->selector( '-repeater__remove' ) => 'color: {{VALUE}}',
2623 ),
2624 )
2625 );
2626
2627 $this->end_controls_tab();
2628
2629 $this->start_controls_tab(
2630 'booking_form_repeater_del_hover',
2631 array(
2632 'label' => esc_html__( 'Hover', 'jet-form-builder' ),
2633 )
2634 );
2635
2636 $this->add_control(
2637 'booking_form_repeater_del_bg_color_hover',
2638 array(
2639 'label' => esc_html__( 'Background Color', 'jet-form-builder' ),
2640 'type' => Controls_Manager::COLOR,
2641 'selectors' => array(
2642 $this->selector( '-repeater__remove:hover' ) => 'background-color: {{VALUE}}',
2643 ),
2644 )
2645 );
2646
2647 $this->add_control(
2648 'booking_form_repeater_del_color_hover',
2649 array(
2650 'label' => esc_html__( 'Text Color', 'jet-form-builder' ),
2651 'type' => Controls_Manager::COLOR,
2652 'selectors' => array(
2653 $this->selector( '-repeater__remove:hover' ) => 'color: {{VALUE}}',
2654 ),
2655 )
2656 );
2657
2658 $this->add_control(
2659 'booking_form_repeater_del_hover_border_color',
2660 array(
2661 'label' => esc_html__( 'Border Color', 'jet-form-builder' ),
2662 'type' => Controls_Manager::COLOR,
2663 'condition' => array(
2664 'booking_form_repeater_del_border_border!' => '',
2665 ),
2666 'selectors' => array(
2667 $this->selector( '-repeater__remove:hover' ) => 'border-color: {{VALUE}};',
2668 ),
2669 )
2670 );
2671
2672 $this->end_controls_tab();
2673
2674 $this->end_controls_tabs();
2675
2676 $this->add_responsive_control(
2677 'booking_form_repeater_del_padding',
2678 array(
2679 'label' => esc_html__( 'Padding', 'jet-form-builder' ),
2680 'type' => Controls_Manager::DIMENSIONS,
2681 'size_units' => array( 'px', '%', 'em', 'rem', 'custom' ),
2682 'separator' => 'before',
2683 'selectors' => array(
2684 $this->selector( '-repeater__remove' ) => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
2685 ),
2686 )
2687 );
2688
2689 $this->add_responsive_control(
2690 'booking_form_repeater_del_margin',
2691 array(
2692 'label' => esc_html__( 'Margin', 'jet-form-builder' ),
2693 'type' => Controls_Manager::DIMENSIONS,
2694 'size_units' => array( 'px', '%', 'em', 'rem', 'custom' ),
2695 'selectors' => array(
2696 $this->selector( '-repeater__remove' ) => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
2697 ),
2698 )
2699 );
2700
2701 $this->add_group_control(
2702 Group_Control_Border::get_type(),
2703 array(
2704 'name' => 'booking_form_repeater_del_border',
2705 'label' => esc_html__( 'Border', 'jet-form-builder' ),
2706 'placeholder' => '1px',
2707 'selector' => $this->selector( '-repeater__remove' ),
2708 )
2709 );
2710
2711 $this->add_responsive_control(
2712 'booking_form_repeater_del_border_radius',
2713 array(
2714 'label' => esc_html__( 'Border Radius', 'jet-form-builder' ),
2715 'type' => Controls_Manager::DIMENSIONS,
2716 'size_units' => array( 'px', '%', 'em', 'rem', 'custom' ),
2717 'selectors' => array(
2718 $this->selector( '-repeater__remove' ) => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
2719 ),
2720 )
2721 );
2722
2723 $this->add_responsive_control(
2724 'booking_form_repeater_del_size',
2725 array(
2726 'label' => esc_html__( 'Icon Size', 'jet-form-builder' ),
2727 'type' => Controls_Manager::SLIDER,
2728 'size_units' => array( 'px', 'em', 'rem', 'custom' ),
2729 'range' => array(
2730 'px' => array(
2731 'min' => 12,
2732 'max' => 90,
2733 ),
2734 ),
2735 'selectors' => array(
2736 $this->selector( '-repeater__remove' ) => 'font-size: {{SIZE}}{{UNIT}};line-height: {{SIZE}}{{UNIT}};',
2737 ),
2738 )
2739 );
2740
2741 $this->add_group_control(
2742 Group_Control_Box_Shadow::get_type(),
2743 array(
2744 'name' => 'booking_form_repeater_del_box_shadow',
2745 'selector' => $this->selector( '-repeater__remove' ),
2746 )
2747 );
2748
2749 $this->add_responsive_control(
2750 'booking_form_repeater_del_alignment',
2751 array(
2752 'label' => esc_html__( 'Alignment', 'jet-form-builder' ),
2753 'type' => Controls_Manager::CHOOSE,
2754 'default' => 'flex-start',
2755 'options' => array(
2756 'flex-start' => array(
2757 'title' => esc_html__( 'Top', 'jet-form-builder' ),
2758 'icon' => 'eicon-v-align-top',
2759 ),
2760 'center' => array(
2761 'title' => esc_html__( 'Middle', 'jet-form-builder' ),
2762 'icon' => 'eicon-v-align-middle',
2763 ),
2764 'flex-end' => array(
2765 'title' => esc_html__( 'Bottom', 'jet-form-builder' ),
2766 'icon' => 'eicon-v-align-bottom',
2767 ),
2768 ),
2769 'selectors' => array(
2770 $this->selector( '-repeater__row-remove' ) => 'align-self: {{VALUE}};',
2771 ),
2772 )
2773 );
2774
2775 $this->end_controls_section();
2776 }
2777
2778 private function conditional_style() {
2779 $this->start_controls_section(
2780 'conditional_style',
2781 array(
2782 'label' => esc_html__( 'Conditional block', 'jet-form-builder' ),
2783 'tab' => Controls_Manager::TAB_STYLE,
2784 'show_label' => false,
2785 )
2786 );
2787
2788 $this->add_responsive_control(
2789 'conditional_padding',
2790 array(
2791 'label' => esc_html__( 'Padding', 'jet-form-builder' ),
2792 'type' => Controls_Manager::DIMENSIONS,
2793 'size_units' => array( 'px', '%', 'em', 'rem', 'custom' ),
2794 'selectors' => array(
2795 $this->selector( '__conditional' ) => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
2796 ),
2797 )
2798 );
2799
2800 $this->add_responsive_control(
2801 'conditional_margin',
2802 array(
2803 'label' => esc_html__( 'Margin', 'jet-form-builder' ),
2804 'type' => Controls_Manager::DIMENSIONS,
2805 'size_units' => array( 'px', '%', 'em', 'rem', 'custom' ),
2806 'selectors' => array(
2807 $this->selector( '__conditional' ) => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
2808 ),
2809 )
2810 );
2811
2812 $this->add_group_control(
2813 Group_Control_Border::get_type(),
2814 array(
2815 'name' => 'conditional_border',
2816 'label' => esc_html__( 'Border', 'jet-form-builder' ),
2817 'placeholder' => '1px',
2818 'selector' => $this->selector( '__conditional' ),
2819 )
2820 );
2821
2822 $this->add_responsive_control(
2823 'conditional_border_radius',
2824 array(
2825 'label' => esc_html__( 'Border Radius', 'jet-form-builder' ),
2826 'type' => Controls_Manager::DIMENSIONS,
2827 'size_units' => array( 'px', '%', 'em', 'rem', 'custom' ),
2828 'selectors' => array(
2829 $this->selector( '__conditional' ) => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
2830 ),
2831 )
2832 );
2833
2834 $this->add_group_control(
2835 Group_Control_Box_Shadow::get_type(),
2836 array(
2837 'name' => 'conditional_box_shadow',
2838 'selector' => $this->selector( '__conditional' ),
2839 )
2840 );
2841
2842 $this->add_control(
2843 'conditional_bg_color',
2844 array(
2845 'label' => esc_html__( 'Background Color', 'jet-form-builder' ),
2846 'type' => Controls_Manager::COLOR,
2847 'selectors' => array(
2848 $this->selector( '__conditional' ) => 'background-color: {{VALUE}}',
2849 ),
2850 )
2851 );
2852
2853 $this->end_controls_section();
2854 }
2855
2856 private function form_submit_style() {
2857 $this->start_controls_section(
2858 'form_submit_style',
2859 array(
2860 'label' => esc_html__( 'Submit', 'jet-form-builder' ),
2861 'tab' => Controls_Manager::TAB_STYLE,
2862 'show_label' => false,
2863 )
2864 );
2865
2866 $this->start_controls_tabs( 'tabs_booking_form_submit_style' );
2867
2868 $this->start_controls_tab(
2869 'booking_form_submit_normal',
2870 array(
2871 'label' => esc_html__( 'Normal', 'jet-form-builder' ),
2872 )
2873 );
2874
2875 $this->add_control(
2876 'booking_form_submit_bg_color',
2877 array(
2878 'label' => esc_html__( 'Background Color', 'jet-form-builder' ),
2879 'type' => Controls_Manager::COLOR,
2880 'selectors' => array(
2881 $this->selector( '__action-button' ) => 'background-color: {{VALUE}}',
2882 ),
2883 )
2884 );
2885
2886 $this->add_control(
2887 'booking_form_submit_color',
2888 array(
2889 'label' => esc_html__( 'Text Color', 'jet-form-builder' ),
2890 'type' => Controls_Manager::COLOR,
2891 'selectors' => array(
2892 $this->selector( '__action-button' ) => 'color: {{VALUE}}',
2893 ),
2894 )
2895 );
2896
2897 $this->end_controls_tab();
2898
2899 $this->start_controls_tab(
2900 'booking_form_submit_hover',
2901 array(
2902 'label' => esc_html__( 'Hover', 'jet-form-builder' ),
2903 )
2904 );
2905
2906 $this->add_control(
2907 'booking_form_submit_bg_color_hover',
2908 array(
2909 'label' => esc_html__( 'Background Color', 'jet-form-builder' ),
2910 'type' => Controls_Manager::COLOR,
2911 'selectors' => array(
2912 $this->selector( '__action-button:hover' ) => 'background-color: {{VALUE}}',
2913 ),
2914 )
2915 );
2916
2917 $this->add_control(
2918 'booking_form_submit_color_hover',
2919 array(
2920 'label' => esc_html__( 'Text Color', 'jet-form-builder' ),
2921 'type' => Controls_Manager::COLOR,
2922 'selectors' => array(
2923 $this->selector( '__action-button:hover' ) => 'color: {{VALUE}}',
2924 ),
2925 )
2926 );
2927
2928 $this->add_control(
2929 'booking_form_submit_hover_border_color',
2930 array(
2931 'label' => esc_html__( 'Border Color', 'jet-form-builder' ),
2932 'type' => Controls_Manager::COLOR,
2933 'condition' => array(
2934 'booking_form_submit_border_border!' => '',
2935 ),
2936 'selectors' => array(
2937 $this->selector( '__action-button:hover' ) => 'border-color: {{VALUE}};',
2938 ),
2939 )
2940 );
2941
2942 $this->add_responsive_control(
2943 'booking_form_submit_hover_transition',
2944 array(
2945
2946 'type' => Controls_Manager::SLIDER,
2947 'label' => __( 'Transition Duration', 'jet-form-builder' ),
2948 'size_units' => array( 's', 'ms', 'custom' ),
2949 'default' => array(
2950 'unit' => 's',
2951 'size' => 0.3,
2952 ),
2953 'selectors' => array(
2954 $this->selector( '__action-button' ) => 'transition: all {{SIZE}}{{UNIT}};',
2955 ),
2956 )
2957 );
2958
2959 $this->end_controls_tab();
2960
2961 $this->end_controls_tabs();
2962
2963 $this->add_group_control(
2964 Group_Control_Typography::get_type(),
2965 array(
2966 'name' => 'booking_form_submit_typography',
2967 'selector' => $this->selector( '__action-button' ),
2968 )
2969 );
2970
2971 $this->add_responsive_control(
2972 'booking_form_submit_padding',
2973 array(
2974 'label' => esc_html__( 'Padding', 'jet-form-builder' ),
2975 'type' => Controls_Manager::DIMENSIONS,
2976 'size_units' => array( 'px', '%', 'em', 'rem', 'custom' ),
2977 'separator' => 'before',
2978 'selectors' => array(
2979 $this->selector( '__action-button' ) => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
2980 ),
2981 )
2982 );
2983
2984 $this->add_responsive_control(
2985 'booking_form_submit_margin',
2986 array(
2987 'label' => esc_html__( 'Margin', 'jet-form-builder' ),
2988 'type' => Controls_Manager::DIMENSIONS,
2989 'size_units' => array( 'px', '%', 'em', 'rem', 'custom' ),
2990 'selectors' => array(
2991 $this->selector( '__action-button' ) => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
2992 ),
2993 )
2994 );
2995
2996 $this->add_group_control(
2997 Group_Control_Border::get_type(),
2998 array(
2999 'name' => 'booking_form_submit_border',
3000 'label' => esc_html__( 'Border', 'jet-form-builder' ),
3001 'placeholder' => '1px',
3002 'selector' => $this->selector( '__action-button' ),
3003 )
3004 );
3005
3006 $this->add_responsive_control(
3007 'booking_form_submit_border_radius',
3008 array(
3009 'label' => esc_html__( 'Border Radius', 'jet-form-builder' ),
3010 'type' => Controls_Manager::DIMENSIONS,
3011 'size_units' => array( 'px', '%', 'em', 'rem', 'custom' ),
3012 'selectors' => array(
3013 $this->selector( '__action-button' ) => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
3014 ),
3015 )
3016 );
3017
3018 $this->add_group_control(
3019 Group_Control_Box_Shadow::get_type(),
3020 array(
3021 'name' => 'booking_form_submit_box_shadow',
3022 'selector' => $this->selector( '__action-button' ),
3023 )
3024 );
3025
3026 $this->add_responsive_control(
3027 'booking_form_submit_alignment',
3028 array(
3029 'label' => esc_html__( 'Alignment', 'jet-form-builder' ),
3030 'type' => Controls_Manager::CHOOSE,
3031 'options' => array(
3032 'flex-start' => array(
3033 'title' => esc_html__( 'Start', 'jet-form-builder' ),
3034 'icon' => ! is_rtl() ? 'eicon-h-align-left' : 'eicon-h-align-right',
3035 ),
3036 'center' => array(
3037 'title' => esc_html__( 'Center', 'jet-form-builder' ),
3038 'icon' => 'eicon-h-align-center',
3039 ),
3040 'flex-end' => array(
3041 'title' => esc_html__( 'End', 'jet-form-builder' ),
3042 'icon' => ! is_rtl() ? 'eicon-h-align-right' : 'eicon-h-align-left',
3043 ),
3044 'stretch' => array(
3045 'title' => esc_html__( 'Fullwidth', 'jet-form-builder' ),
3046 'icon' => 'eicon-h-align-stretch',
3047 ),
3048 ),
3049 'selectors' => array(
3050 $this->selector( '__submit-wrap' ) => 'justify-content: {{VALUE}}; align-items: {{VALUE}};',
3051 ),
3052 )
3053 );
3054
3055 $this->add_control(
3056 'booking_form_submit_alignment_hidden',
3057 array(
3058 'type' => Controls_Manager::HIDDEN,
3059 'default' => 'style',
3060 'selectors' => array(
3061 $this->selector( '__submit-wrap > .%s__submit' ) => 'width: 100%',
3062 ),
3063 'condition' => array(
3064 'booking_form_submit_alignment' => 'stretch',
3065 ),
3066 )
3067 );
3068
3069 $this->add_responsive_control(
3070 'booking_form_submit_alignment_text',
3071 array(
3072 'label' => esc_html__( 'Button Text Alignment', 'jet-form-builder' ),
3073 'type' => Controls_Manager::CHOOSE,
3074 'options' => array(
3075 'flex-start' => array(
3076 'title' => esc_html__( 'Start', 'jet-form-builder' ),
3077 'icon' => ! is_rtl() ? 'eicon-h-align-left' : 'eicon-h-align-right',
3078 ),
3079 'center' => array(
3080 'title' => esc_html__( 'Center', 'jet-form-builder' ),
3081 'icon' => 'eicon-h-align-center',
3082 ),
3083 'flex-end' => array(
3084 'title' => esc_html__( 'End', 'jet-form-builder' ),
3085 'icon' => ! is_rtl() ? 'eicon-h-align-right' : 'eicon-h-align-left',
3086 ),
3087 ),
3088 'selectors' => array(
3089 $this->selector( '__submit' ) => 'justify-content: {{VALUE}};',
3090 ),
3091 )
3092 );
3093
3094 $this->end_controls_section();
3095 }
3096
3097 private function section_form_break_style() {
3098 $this->start_controls_section(
3099 'section_form_break_style',
3100 array(
3101 'label' => __( 'Form Break Row', 'jet-form-builder' ),
3102 'tab' => Controls_Manager::TAB_STYLE,
3103 )
3104 );
3105
3106 $this->add_responsive_control(
3107 'form_break_gap',
3108 array(
3109 'label' => __( 'Gap', 'jet-form-builder' ),
3110 'type' => Controls_Manager::DIMENSIONS,
3111 'size_units' => array( 'px', '%', 'em', 'rem', 'custom' ),
3112 'selectors' => array(
3113 $this->selector( '__next-page-wrap' ) => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
3114 ),
3115 )
3116 );
3117
3118 $this->add_responsive_control(
3119 'form_break_alignment',
3120 array(
3121 'label' => __( 'Alignment', 'jet-form-builder' ),
3122 'type' => Controls_Manager::CHOOSE,
3123 'label_block' => false,
3124 'default' => 'left',
3125 'separator' => 'before',
3126 'options' => array(
3127 'left' => array(
3128 'title' => __( 'Left', 'jet-form-builder' ),
3129 'icon' => 'eicon-h-align-left',
3130 ),
3131 'center' => array(
3132 'title' => __( 'Center', 'jet-form-builder' ),
3133 'icon' => 'eicon-h-align-center',
3134 ),
3135 'right' => array(
3136 'title' => __( 'Right', 'jet-form-builder' ),
3137 'icon' => 'eicon-h-align-right',
3138 ),
3139 ),
3140 'selectors' => array(
3141 $this->selector( '__next-page-wrap' ) => 'text-align: {{VALUE}};',
3142 ),
3143 )
3144 );
3145
3146 $this->add_border(
3147 $this,
3148 'form_break_border',
3149 $this->selector( '__next-page-wrap' )
3150 );
3151
3152 $this->end_controls_section();
3153 }
3154
3155 private function section_form_break_next_style() {
3156 $this->start_controls_section(
3157 'section_form_break_next_style',
3158 array(
3159 'label' => __( 'Form Break Buttons', 'jet-form-builder' ),
3160 'tab' => Controls_Manager::TAB_STYLE,
3161 )
3162 );
3163
3164 $this->add_control(
3165 'form_break_next_button__error_heading',
3166 array(
3167 'label' => __( 'Next Button', 'jet-form-builder' ),
3168 'type' => Controls_Manager::HEADING,
3169 'separator' => 'after',
3170 )
3171 );
3172
3173 $this->add_responsive_control(
3174 'form_break_next_margin',
3175 array(
3176 'label' => __( 'Margin', 'jet-form-builder' ),
3177 'type' => Controls_Manager::DIMENSIONS,
3178 'size_units' => array( 'px', '%', 'em', 'rem', 'custom' ),
3179 'selectors' => array(
3180 $this->selector( '__next-page' ) => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
3181 ),
3182 )
3183 );
3184
3185 $this->add_responsive_control(
3186 'form_break_next_padding',
3187 array(
3188 'label' => __( 'Padding', 'jet-form-builder' ),
3189 'type' => Controls_Manager::DIMENSIONS,
3190 'size_units' => array( 'px', '%', 'em', 'rem', 'custom' ),
3191 'selectors' => array(
3192 $this->selector( '__next-page' ) => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
3193 ),
3194 )
3195 );
3196
3197 $this->add_responsive_control(
3198 'form_break_next_justify',
3199 array(
3200 'label' => __( 'Alignment', 'jet-form-builder' ),
3201 'type' => Controls_Manager::CHOOSE,
3202 'label_block' => false,
3203 'options' => array(
3204 'flex-start' => array(
3205 'title' => __( 'Left', 'jet-form-builder' ),
3206 'icon' => 'eicon-h-align-left',
3207 ),
3208 'center' => array(
3209 'title' => __( 'Center', 'jet-form-builder' ),
3210 'icon' => 'eicon-h-align-center',
3211 ),
3212 'flex-end' => array(
3213 'title' => __( 'Right', 'jet-form-builder' ),
3214 'icon' => 'eicon-h-align-right',
3215 ),
3216 ),
3217 'selectors' => array(
3218 $this->selector( '-row .%s__action-button-wrapper[data-type="next"]' ) => 'justify-content: {{VALUE}};',
3219 ),
3220 )
3221 );
3222
3223 $this->start_controls_tabs( 'form_break_next_styles' );
3224
3225 $this->start_controls_tab(
3226 'form_break_next--normal',
3227 array(
3228 'label' => __( 'Normal', 'jet-form-builder' ),
3229 )
3230 );
3231
3232 $this->add_group_control(
3233 Group_Control_Typography::get_type(),
3234 array(
3235 'name' => 'form_break_next_typography',
3236 'selector' => $this->selector( '__next-page' ),
3237 )
3238 );
3239
3240 $this->add_border(
3241 $this,
3242 'form_break_next_border',
3243 $this->selector( '__next-page' )
3244 );
3245
3246 $this->add_control(
3247 'form_break_next_color--normal',
3248 array(
3249 'label' => __( 'Color', 'jet-form-builder' ),
3250 'type' => Controls_Manager::COLOR,
3251 'selectors' => array(
3252 $this->selector( '__next-page' ) => 'color: {{VALUE}};',
3253 ),
3254 )
3255 );
3256
3257 $this->add_control(
3258 'form_break_next_bg_color--normal',
3259 array(
3260 'label' => __( 'Background Color', 'jet-form-builder' ),
3261 'type' => Controls_Manager::COLOR,
3262 'selectors' => array(
3263 $this->selector( '__next-page' ) => 'background-color: {{VALUE}};',
3264 ),
3265 )
3266 );
3267
3268 $this->end_controls_tab();
3269
3270 $this->start_controls_tab(
3271 'form_break_next--hover',
3272 array(
3273 'label' => __( 'Hover', 'jet-form-builder' ),
3274 )
3275 );
3276
3277 $this->add_group_control(
3278 Group_Control_Typography::get_type(),
3279 array(
3280 'name' => 'form_break_next_typography--hover',
3281 'selector' => $this->selector( '__next-page:hover' ),
3282 )
3283 );
3284
3285 $this->add_border(
3286 $this,
3287 'form_break_next_border--hover',
3288 $this->selector( '__next-page:hover' )
3289 );
3290
3291 $this->add_control(
3292 'form_break_next_color--hover',
3293 array(
3294 'label' => __( 'Color', 'jet-form-builder' ),
3295 'type' => Controls_Manager::COLOR,
3296 'selectors' => array(
3297 $this->selector( '__next-page:hover' ) => 'color: {{VALUE}};',
3298 ),
3299 )
3300 );
3301 $this->add_control(
3302 'form_break_next_bg_color--hover',
3303 array(
3304 'label' => __( 'Background Color', 'jet-form-builder' ),
3305 'type' => Controls_Manager::COLOR,
3306 'selectors' => array(
3307 $this->selector( '__next-page:hover' ) => 'background-color: {{VALUE}};',
3308 ),
3309 )
3310 );
3311
3312 $this->end_controls_tab();
3313
3314 $options = Tab_Handler_Manager::get_options( 'options-tab' );
3315
3316 if ( $options['disable_next_button'] ?? false ) {
3317 $this->start_controls_tab(
3318 'form_break_next--disabled',
3319 array(
3320 'label' => __( 'Disabled', 'jet-form-builder' ),
3321 )
3322 );
3323
3324 $this->add_group_control(
3325 Group_Control_Typography::get_type(),
3326 array(
3327 'name' => 'form_break_next_typography--disabled',
3328 'selector' => $this->selector( '__next-page:disabled' ),
3329 )
3330 );
3331
3332 $this->add_border(
3333 $this,
3334 'form_break_next_border--disabled',
3335 $this->selector( '__next-page:disabled' )
3336 );
3337
3338 $this->add_control(
3339 'form_break_next_color--disabled',
3340 array(
3341 'label' => __( 'Color', 'jet-form-builder' ),
3342 'type' => Controls_Manager::COLOR,
3343 'selectors' => array(
3344 $this->selector( '__next-page:disabled' ) => 'color: {{VALUE}};',
3345 ),
3346 )
3347 );
3348 $this->add_control(
3349 'form_break_next_bg_color--disabled',
3350 array(
3351 'label' => __( 'Background Color', 'jet-form-builder' ),
3352 'type' => Controls_Manager::COLOR,
3353 'selectors' => array(
3354 $this->selector( '__next-page:disabled' ) => 'background-color: {{VALUE}};',
3355 ),
3356 )
3357 );
3358
3359 $this->end_controls_tab();
3360 }
3361
3362 $this->end_controls_tabs();
3363
3364 $this->add_control(
3365 'form_break_prev_button__error_heading',
3366 array(
3367 'label' => __( 'Prev Button', 'jet-form-builder' ),
3368 'type' => Controls_Manager::HEADING,
3369 'separator' => 'before',
3370 )
3371 );
3372
3373 $this->add_responsive_control(
3374 'form_break_prev_margin',
3375 array(
3376 'label' => __( 'Margin', 'jet-form-builder' ),
3377 'type' => Controls_Manager::DIMENSIONS,
3378 'size_units' => array( 'px', '%', 'em', 'rem', 'custom' ),
3379 'selectors' => array(
3380 $this->selector( '__prev-page' ) => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
3381 ),
3382 )
3383 );
3384
3385 $this->add_responsive_control(
3386 'form_break_prev_padding',
3387 array(
3388 'label' => __( 'Padding', 'jet-form-builder' ),
3389 'type' => Controls_Manager::DIMENSIONS,
3390 'size_units' => array( 'px', '%', 'em', 'rem', 'custom' ),
3391 'selectors' => array(
3392 $this->selector( '__prev-page' ) => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
3393 ),
3394 )
3395 );
3396
3397 $this->add_responsive_control(
3398 'form_break_prev_justify',
3399 array(
3400 'label' => __( 'Alignment', 'jet-form-builder' ),
3401 'type' => Controls_Manager::CHOOSE,
3402 'label_block' => false,
3403 'options' => array(
3404 'flex-start' => array(
3405 'title' => __( 'Left', 'jet-form-builder' ),
3406 'icon' => 'eicon-h-align-left',
3407 ),
3408 'center' => array(
3409 'title' => __( 'Center', 'jet-form-builder' ),
3410 'icon' => 'eicon-h-align-center',
3411 ),
3412 'flex-end' => array(
3413 'title' => __( 'Right', 'jet-form-builder' ),
3414 'icon' => 'eicon-h-align-right',
3415 ),
3416 ),
3417 'selectors' => array(
3418 $this->selector( '-row .%s__action-button-wrapper[data-type="prev"]' ) => 'justify-content: {{VALUE}};',
3419 ),
3420 )
3421 );
3422
3423 $this->start_controls_tabs( 'form_break_prev_styles' );
3424
3425 $this->start_controls_tab(
3426 'form_break_prev--normal',
3427 array(
3428 'label' => __( 'Normal', 'jet-form-builder' ),
3429 )
3430 );
3431
3432 $this->add_group_control(
3433 Group_Control_Typography::get_type(),
3434 array(
3435 'name' => 'form_break_prev_typography',
3436 'selector' => $this->selector( '__prev-page' ),
3437 )
3438 );
3439
3440 $this->add_border(
3441 $this,
3442 'form_break_prev_border',
3443 $this->selector( '__prev-page' )
3444 );
3445
3446 $this->add_control(
3447 'form_break_prev_color--normal',
3448 array(
3449 'label' => __( 'Color', 'jet-form-builder' ),
3450 'type' => Controls_Manager::COLOR,
3451 'selectors' => array(
3452 $this->selector( '__prev-page' ) => 'color: {{VALUE}};',
3453 ),
3454 )
3455 );
3456
3457 $this->add_control(
3458 'form_break_prev_bg_color--normal',
3459 array(
3460 'label' => __( 'Background Color', 'jet-form-builder' ),
3461 'type' => Controls_Manager::COLOR,
3462 'selectors' => array(
3463 $this->selector( '__prev-page' ) => 'background-color: {{VALUE}};',
3464 ),
3465 )
3466 );
3467
3468 $this->end_controls_tab();
3469
3470 $this->start_controls_tab(
3471 'form_break_prev--hover',
3472 array(
3473 'label' => __( 'Hover', 'jet-form-builder' ),
3474 )
3475 );
3476
3477 $this->add_group_control(
3478 Group_Control_Typography::get_type(),
3479 array(
3480 'name' => 'form_break_prev_typography--hover',
3481 'selector' => $this->selector( '__prev-page:hover' ),
3482 )
3483 );
3484
3485 $this->add_border(
3486 $this,
3487 'form_break_prev_border--hover',
3488 $this->selector( '__prev-page:hover' )
3489 );
3490
3491 $this->add_control(
3492 'form_break_prev_color--hover',
3493 array(
3494 'label' => __( 'Color', 'jet-form-builder' ),
3495 'type' => Controls_Manager::COLOR,
3496 'selectors' => array(
3497 $this->selector( '__prev-page:hover' ) => 'color: {{VALUE}};',
3498 ),
3499 )
3500 );
3501 $this->add_control(
3502 'form_break_prev_bg_color--hover',
3503 array(
3504 'label' => __( 'Background Color', 'jet-form-builder' ),
3505 'type' => Controls_Manager::COLOR,
3506 'selectors' => array(
3507 $this->selector( '__prev-page:hover' ) => 'background-color: {{VALUE}};',
3508 ),
3509 )
3510 );
3511
3512 $this->end_controls_tab();
3513 $this->end_controls_tabs();
3514
3515 $this->end_controls_section();
3516 }
3517
3518 private function section_form_break_disabled_style() {
3519 $this->start_controls_section(
3520 'section_form_break_disabled_style',
3521 array(
3522 'label' => __( 'Form Break Disabled Message', 'jet-form-builder' ),
3523 'tab' => Controls_Manager::TAB_STYLE,
3524 )
3525 );
3526
3527 $this->add_responsive_control(
3528 'form_break_disabled_margin',
3529 array(
3530 'label' => __( 'Margin', 'jet-form-builder' ),
3531 'type' => Controls_Manager::DIMENSIONS,
3532 'size_units' => array( 'px', '%', 'em', 'rem', 'custom' ),
3533 'selectors' => array(
3534 $this->selector( '__next-page-msg' ) => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
3535 ),
3536 )
3537 );
3538
3539 $this->add_responsive_control(
3540 'form_break_disabled_padding',
3541 array(
3542 'label' => __( 'Padding', 'jet-form-builder' ),
3543 'type' => Controls_Manager::DIMENSIONS,
3544 'size_units' => array( 'px', '%', 'em', 'rem', 'custom' ),
3545 'selectors' => array(
3546 $this->selector( '__next-page-msg' ) => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
3547 ),
3548 )
3549 );
3550
3551 $this->add_group_control(
3552 Group_Control_Typography::get_type(),
3553 array(
3554 'name' => 'form_break_disabled_typography',
3555 'selector' => $this->selector( '__next-page-msg' ),
3556 )
3557 );
3558
3559 $this->add_border(
3560 $this,
3561 'form_break_disabled_border',
3562 $this->selector( '__next-page-msg' )
3563 );
3564
3565 $this->end_controls_section();
3566 }
3567
3568 private function section_message_error_style() {
3569 $this->start_controls_section(
3570 'section_message_error_style',
3571 array(
3572 'label' => __( 'Messages', 'jet-form-builder' ),
3573 'tab' => Controls_Manager::TAB_STYLE,
3574 )
3575 );
3576
3577 $this->start_controls_tabs( 'section_messages_tabs' );
3578
3579 $this->start_controls_tab(
3580 'messages_success_tab',
3581 array(
3582 'label' => __( 'Success Message', 'jet-form-builder' ),
3583 )
3584 );
3585
3586 $this->add_responsive_control(
3587 'form_success_margin',
3588 array(
3589 'label' => __( 'Margin', 'jet-form-builder' ),
3590 'type' => Controls_Manager::DIMENSIONS,
3591 'size_units' => array( 'px', '%', 'em', 'rem', 'custom' ),
3592 'selectors' => array(
3593 $this->selector( '-message--success' ) => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
3594 ),
3595 )
3596 );
3597
3598 $this->add_responsive_control(
3599 'form_success_padding',
3600 array(
3601 'label' => __( 'Padding', 'jet-form-builder' ),
3602 'type' => Controls_Manager::DIMENSIONS,
3603 'size_units' => array( 'px', '%', 'em', 'rem', 'custom' ),
3604 'selectors' => array(
3605 $this->selector( '-message--success' ) => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
3606 ),
3607 )
3608 );
3609
3610 $this->add_responsive_control(
3611 'form_success_alignment',
3612 array(
3613 'label' => __( 'Alignment', 'jet-form-builder' ),
3614 'type' => Controls_Manager::CHOOSE,
3615 'label_block' => false,
3616 'default' => 'center',
3617 'separator' => 'before',
3618 'options' => array(
3619 'left' => array(
3620 'title' => __( 'Left', 'jet-form-builder' ),
3621 'icon' => 'eicon-h-align-left',
3622 ),
3623 'center' => array(
3624 'title' => __( 'Center', 'jet-form-builder' ),
3625 'icon' => 'eicon-h-align-center',
3626 ),
3627 'right' => array(
3628 'title' => __( 'Right', 'jet-form-builder' ),
3629 'icon' => 'eicon-h-align-right',
3630 ),
3631 ),
3632 'selectors' => array(
3633 $this->selector( '-message--success' ) => 'text-align: {{VALUE}};',
3634 ),
3635 )
3636 );
3637
3638 $this->add_group_control(
3639 Group_Control_Typography::get_type(),
3640 array(
3641 'name' => 'form_success_typography',
3642 'selector' => $this->selector( '-message--success' ),
3643 )
3644 );
3645
3646 $this->add_control(
3647 'form_success_color',
3648 array(
3649 'label' => __( 'Color', 'jet-form-builder' ),
3650 'type' => Controls_Manager::COLOR,
3651 'selectors' => array(
3652 $this->selector( '-message--success' ) => 'color: {{VALUE}};',
3653 ),
3654 )
3655 );
3656 $this->add_control(
3657 'form_success_bg_color',
3658 array(
3659 'label' => __( 'Background Color', 'jet-form-builder' ),
3660 'type' => Controls_Manager::COLOR,
3661 'selectors' => array(
3662 $this->selector( '-message--success' ) => 'background-color: {{VALUE}};',
3663 ),
3664 )
3665 );
3666
3667 $this->add_border(
3668 $this,
3669 'form_success_border',
3670 $this->selector( '-message--success' )
3671 );
3672
3673 $this->end_controls_tab();
3674
3675 $this->start_controls_tab(
3676 'messages_error_tab',
3677 array(
3678 'label' => __( 'Error Message', 'jet-form-builder' ),
3679 )
3680 );
3681
3682 $this->add_responsive_control(
3683 'form_error_margin',
3684 array(
3685 'label' => __( 'Margin', 'jet-form-builder' ),
3686 'type' => Controls_Manager::DIMENSIONS,
3687 'size_units' => array( 'px', '%', 'em', 'rem', 'custom' ),
3688 'selectors' => array(
3689 $this->selector( '-message--error' ) => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
3690 ),
3691 )
3692 );
3693
3694 $this->add_responsive_control(
3695 'form_error_padding',
3696 array(
3697 'label' => __( 'Padding', 'jet-form-builder' ),
3698 'type' => Controls_Manager::DIMENSIONS,
3699 'size_units' => array( 'px', '%', 'em', 'rem', 'custom' ),
3700 'selectors' => array(
3701 $this->selector( '-message--error' ) => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
3702 ),
3703 )
3704 );
3705
3706 $this->add_responsive_control(
3707 'form_error_alignment',
3708 array(
3709 'label' => __( 'Alignment', 'jet-form-builder' ),
3710 'type' => Controls_Manager::CHOOSE,
3711 'label_block' => false,
3712 'default' => 'center',
3713 'separator' => 'before',
3714 'options' => array(
3715 'left' => array(
3716 'title' => __( 'Left', 'jet-form-builder' ),
3717 'icon' => 'eicon-h-align-left',
3718 ),
3719 'center' => array(
3720 'title' => __( 'Center', 'jet-form-builder' ),
3721 'icon' => 'eicon-h-align-center',
3722 ),
3723 'right' => array(
3724 'title' => __( 'Right', 'jet-form-builder' ),
3725 'icon' => 'eicon-h-align-right',
3726 ),
3727 ),
3728 'selectors' => array(
3729 $this->selector( '-message--error' ) => 'text-align: {{VALUE}};',
3730 ),
3731 )
3732 );
3733
3734 $this->add_group_control(
3735 Group_Control_Typography::get_type(),
3736 array(
3737 'name' => 'form_error_typography',
3738 'selector' => $this->selector( '-message--error' ),
3739 )
3740 );
3741
3742 $this->add_control(
3743 'form_error_color',
3744 array(
3745 'label' => __( 'Color', 'jet-form-builder' ),
3746 'type' => Controls_Manager::COLOR,
3747 'selectors' => array(
3748 $this->selector( '-message--error' ) => 'color: {{VALUE}};',
3749 ),
3750 )
3751 );
3752 $this->add_control(
3753 'form_error_bg_color',
3754 array(
3755 'label' => __( 'Background Color', 'jet-form-builder' ),
3756 'type' => Controls_Manager::COLOR,
3757 'selectors' => array(
3758 $this->selector( '-message--error' ) => 'background-color: {{VALUE}};',
3759 ),
3760 )
3761 );
3762
3763 $this->add_border(
3764 $this,
3765 'form_error_border',
3766 $this->selector( '-message--error' )
3767 );
3768
3769 $this->end_controls_tab();
3770 $this->end_controls_tabs();
3771 $this->end_controls_section();
3772 }
3773
3774
3775 private function add_border( $instance, $control_id, $selector ) {
3776 $instance->add_group_control(
3777 Group_Control_Border::get_type(),
3778 array(
3779 'name' => $control_id,
3780 'label' => __( 'Border', 'jet-form-builder' ),
3781 'placeholder' => '1px',
3782 'selector' => $selector,
3783 )
3784 );
3785 $instance->add_responsive_control(
3786 $control_id . '_radius',
3787 array(
3788 'label' => __( 'Border Radius', 'jet-form-builder' ),
3789 'type' => Controls_Manager::DIMENSIONS,
3790 'size_units' => array( 'px', '%', 'em', 'rem', 'custom' ),
3791 'selectors' => array(
3792 $selector => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
3793 ),
3794 )
3795 );
3796 }
3797
3798 /**
3799 * Render the widget output on the frontend.
3800 *
3801 * Written in PHP and used to generate the final HTML.
3802 *
3803 * @since 1.1.0
3804 *
3805 * @access protected
3806 */
3807 protected function render() {
3808 wp_print_styles( 'wp-block-library' );
3809 $settings = $this->get_settings_for_display();
3810
3811 // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
3812 echo jet_fb_render_form( $settings );
3813 }
3814
3815
3816 }
3817