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