PluginProbe
Master Addons for Elementor – Elementor Addons, Widgets, Mega Menu Builder, Popup Builder, Widget Builder & Template Kits / 1.0.8
Master Addons for Elementor – Elementor Addons, Widgets, Mega Menu Builder, Popup Builder, Widget Builder & Template Kits v1.0.8
3.2.2 3.2.3 3.2.1 3.2.0 3.1.9 3.1.8 3.1.7 3.1.6 3.1.5 3.1.4 3.1.3 3.1.2 3.1.1 3.1.0 3.0.9 trunk 1.0.6 1.0.7 1.0.8 1.0.9 1.1.0 1.1.1 1.1.3 1.1.4 1.1.5 All 174 releases
master-addons / addons / gravity-forms / gravity-forms.php

gravity-forms.php in Master Addons for Elementor – Elementor Addons, Widgets, Mega Menu Builder, Popup Builder, Widget Builder & Template Kits 1.0.8, at addons/gravity-forms/gravity-forms.php

1,941 lines 60.3 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 namespace Elementor;
3 use Elementor\Widget_Base;
4
5 /**
6 * Author Name: Liton Arefin
7 * Author URL: https://jeweltheme.com
8 * Date: 6/27/19
9 */
10 if ( ! defined( 'ABSPATH' ) ) exit; // If this file is called directly, abort.
11
12
13 class Master_Addons_Gravity_Forms extends Widget_Base {
14
15 public function get_name() {
16 return 'ma-gravity-forms';
17 }
18
19 public function get_title() {
20 return esc_html__( 'Gravity Forms', MELA_TD);
21 }
22
23 public function get_icon() {
24 return 'ma-el-icon fa fa-envelope-o';
25 }
26
27 public function get_categories() {
28 return [ 'master-addons' ];
29 }
30
31 protected function _register_controls() {
32
33 if ( ma_el_fs()->can_use_premium_code__premium_only() ) {
34
35
36 $this->start_controls_section(
37 'maad_el_section_pro',
38 [
39 'label' => esc_html__( 'Upgrade to Pro Version for More Features', MELA_TD )
40 ]
41 );
42
43 $this->add_control(
44 'maad_el_control_get_pro',
45 [
46 'label' => esc_html__( 'Unlock more possibilities', MELA_TD ),
47 'type' => Controls_Manager::CHOOSE,
48 'options' => [
49 '1' => [
50 'title' => esc_html__( '', MELA_TD ),
51 'icon' => 'fa fa-unlock-alt',
52 ],
53 ],
54 'default' => '1',
55 'description' => '<span class="pro-feature"> Upgrade to <a href="' . admin_url('admin.php?page=master-addons-settings-pricing') . '" target="_blank">Pro Version</a> for more Elements with
56 Customization Options.</span>'
57 ]
58 );
59
60 $this->end_controls_section();
61 } else{
62
63
64
65 /**
66 * Master Addons: Gravity Form
67 * -------------------------------------------------
68 */
69 $this->start_controls_section(
70 'section_gravity_form',
71 [
72 'label' => __( 'Gravity Forms', MELA_TD ),
73 ]
74 );
75
76
77
78 $this->add_control(
79 'contact_form_list',
80 [
81 'label' => esc_html__( 'Contact Form', MELA_TD ),
82 'type' => Controls_Manager::SELECT,
83 'label_block' => true,
84 'options' => Master_Addons_Helper::ma_el_get_gravity_forms(),
85 'default' => '0',
86 ]
87 );
88
89 $this->add_control(
90 'custom_title_description',
91 [
92 'label' => __( 'Custom Title & Description', MELA_TD ),
93 'type' => Controls_Manager::SWITCHER,
94 'label_on' => __( 'Yes', MELA_TD ),
95 'label_off' => __( 'No', MELA_TD ),
96 'return_value' => 'yes',
97 ]
98 );
99
100 $this->add_control(
101 'form_title',
102 [
103 'label' => __( 'Title', MELA_TD ),
104 'type' => Controls_Manager::SWITCHER,
105 'default' => 'yes',
106 'label_on' => __( 'Show', MELA_TD ),
107 'label_off' => __( 'Hide', MELA_TD ),
108 'return_value' => 'yes',
109 'condition' => [
110 'custom_title_description!' => 'yes',
111 ],
112 ]
113 );
114
115 $this->add_control(
116 'form_description',
117 [
118 'label' => __( 'Description', MELA_TD ),
119 'type' => Controls_Manager::SWITCHER,
120 'default' => 'yes',
121 'label_on' => __( 'Show', MELA_TD ),
122 'label_off' => __( 'Hide', MELA_TD ),
123 'return_value' => 'yes',
124 'condition' => [
125 'custom_title_description!' => 'yes',
126 ],
127 ]
128 );
129
130 $this->add_control(
131 'form_title_custom',
132 [
133 'label' => esc_html__( 'Title', MELA_TD ),
134 'type' => Controls_Manager::TEXT,
135 'label_block' => true,
136 'default' => '',
137 'condition' => [
138 'custom_title_description' => 'yes',
139 ],
140 ]
141 );
142
143 $this->add_control(
144 'form_description_custom',
145 [
146 'label' => esc_html__( 'Description', MELA_TD ),
147 'type' => Controls_Manager::TEXTAREA,
148 'default' => '',
149 'condition' => [
150 'custom_title_description' => 'yes',
151 ],
152 ]
153 );
154
155 $this->add_control(
156 'labels_switch',
157 [
158 'label' => __( 'Labels', MELA_TD ),
159 'type' => Controls_Manager::SWITCHER,
160 'default' => 'yes',
161 'label_on' => __( 'Show', MELA_TD ),
162 'label_off' => __( 'Hide', MELA_TD ),
163 'return_value' => 'yes',
164 ]
165 );
166
167 $this->add_control(
168 'placeholder_switch',
169 [
170 'label' => __( 'Placeholder', MELA_TD ),
171 'type' => Controls_Manager::SWITCHER,
172 'default' => 'yes',
173 'label_on' => __( 'Show', MELA_TD ),
174 'label_off' => __( 'Hide', MELA_TD ),
175 'return_value' => 'yes',
176 ]
177 );
178
179 $this->add_control(
180 'form_ajax',
181 [
182 'label' => __( 'Use Ajax', MELA_TD ),
183 'type' => Controls_Manager::SWITCHER,
184 'description' => __( 'Use ajax to submit the form', MELA_TD ),
185 'label_on' => __( 'Yes', MELA_TD ),
186 'label_off' => __( 'No', MELA_TD ),
187 'return_value' => 'yes',
188 ]
189 );
190
191 $this->end_controls_section();
192
193 /**
194 * Content Tab: Errors
195 * -------------------------------------------------
196 */
197 $this->start_controls_section(
198 'section_errors',
199 [
200 'label' => __( 'Errors', MELA_TD ),
201 ]
202 );
203
204 $this->add_control(
205 'error_messages',
206 [
207 'label' => __( 'Error Messages', MELA_TD ),
208 'type' => Controls_Manager::SELECT,
209 'default' => 'show',
210 'options' => [
211 'show' => __( 'Show', MELA_TD ),
212 'hide' => __( 'Hide', MELA_TD ),
213 ],
214 'selectors_dictionary' => [
215 'show' => 'block',
216 'hide' => 'none',
217 ],
218 'selectors' => [
219 '{{WRAPPER}} .ma-el-gravity-form .validation_message' => 'display: {{VALUE}} !important;',
220 ],
221 ]
222 );
223
224 $this->add_control(
225 'validation_errors',
226 [
227 'label' => __( 'Validation Errors', MELA_TD ),
228 'type' => Controls_Manager::SELECT,
229 'default' => 'show',
230 'options' => [
231 'show' => __( 'Show', MELA_TD ),
232 'hide' => __( 'Hide', MELA_TD ),
233 ],
234 'selectors_dictionary' => [
235 'show' => 'block',
236 'hide' => 'none',
237 ],
238 'selectors' => [
239 '{{WRAPPER}} .ma-el-gravity-form .validation_error' => 'display: {{VALUE}} !important;',
240 ],
241 ]
242 );
243
244 $this->end_controls_section();
245
246 /*-----------------------------------------------------------------------------------*/
247 /* STYLE TAB
248 /*-----------------------------------------------------------------------------------*/
249
250 /**
251 * Style Tab: Title and Description
252 * -------------------------------------------------
253 */
254 $this->start_controls_section(
255 'section_general_style',
256 [
257 'label' => __( 'Title & Description', MELA_TD ),
258 'tab' => Controls_Manager::TAB_STYLE,
259 ]
260 );
261
262 $this->add_responsive_control(
263 'heading_alignment',
264 [
265 'label' => __( 'Alignment', MELA_TD ),
266 'type' => Controls_Manager::CHOOSE,
267 'options' => [
268 'left' => [
269 'title' => __( 'Left', MELA_TD ),
270 'icon' => 'fa fa-align-left',
271 ],
272 'center' => [
273 'title' => __( 'Center', MELA_TD ),
274 'icon' => 'fa fa-align-center',
275 ],
276 'right' => [
277 'title' => __( 'Right', MELA_TD ),
278 'icon' => 'fa fa-align-right',
279 ],
280 ],
281 'default' => '',
282 'selectors' => [
283 '{{WRAPPER}} .ma-el-gravity-form .gform_wrapper .gform_heading, {{WRAPPER}} .ma-el-gravity-form .ma-el-gravity-form-heading' => 'text-align: {{VALUE}};',
284 ],
285 ]
286 );
287
288 $this->add_control(
289 'title_heading',
290 [
291 'label' => __( 'Title', MELA_TD ),
292 'type' => Controls_Manager::HEADING,
293 'separator' => 'before',
294 ]
295 );
296
297 $this->add_control(
298 'title_text_color',
299 [
300 'label' => __( 'Text Color', MELA_TD ),
301 'type' => Controls_Manager::COLOR,
302 'default' => '',
303 'selectors' => [
304 '{{WRAPPER}} .ma-el-gravity-form .gform_wrapper .gform_title, {{WRAPPER}} .ma-el-gravity-form .ma-el-gravity-form-title' => 'color: {{VALUE}}',
305 ],
306 ]
307 );
308
309 $this->add_group_control(
310 Group_Control_Typography::get_type(),
311 [
312 'name' => 'title_typography',
313 'label' => __( 'Typography', MELA_TD ),
314 'scheme' => Scheme_Typography::TYPOGRAPHY_4,
315 'selector' => '{{WRAPPER}} .ma-el-gravity-form .gform_wrapper .gform_title, {{WRAPPER}} .ma-el-gravity-form .ma-el-gravity-form-title',
316 ]
317 );
318
319 $this->add_control(
320 'description_heading',
321 [
322 'label' => __( 'Description', MELA_TD ),
323 'type' => Controls_Manager::HEADING,
324 'separator' => 'before',
325 ]
326 );
327
328 $this->add_control(
329 'description_text_color',
330 [
331 'label' => __( 'Text Color', MELA_TD ),
332 'type' => Controls_Manager::COLOR,
333 'default' => '',
334 'selectors' => [
335 '{{WRAPPER}} .ma-el-gravity-form .gform_wrapper .gform_description, {{WRAPPER}} .ma-el-gravity-form .ma-el-gravity-form-description' => 'color: {{VALUE}}',
336 ],
337 ]
338 );
339
340 $this->add_group_control(
341 Group_Control_Typography::get_type(),
342 [
343 'name' => 'description_typography',
344 'label' => __( 'Typography', MELA_TD ),
345 'scheme' => Scheme_Typography::TYPOGRAPHY_4,
346 'selector' => '{{WRAPPER}} .ma-el-gravity-form .gform_wrapper .gform_description, {{WRAPPER}} .ma-el-gravity-form .ma-el-gravity-form-description',
347 ]
348 );
349
350 $this->end_controls_section();
351
352 /**
353 * Style Tab: Labels
354 * -------------------------------------------------
355 */
356 $this->start_controls_section(
357 'section_label_style',
358 [
359 'label' => __( 'Labels', MELA_TD ),
360 'tab' => Controls_Manager::TAB_STYLE,
361 'condition' => [
362 'labels_switch' => 'yes',
363 ],
364 ]
365 );
366
367 $this->add_control(
368 'text_color_label',
369 [
370 'label' => __( 'Text Color', MELA_TD ),
371 'type' => Controls_Manager::COLOR,
372 'selectors' => [
373 '{{WRAPPER}} .ma-el-gravity-form .gfield label' => 'color: {{VALUE}}',
374 ],
375 'condition' => [
376 'labels_switch' => 'yes',
377 ],
378 ]
379 );
380
381 $this->add_group_control(
382 Group_Control_Typography::get_type(),
383 [
384 'name' => 'typography_label',
385 'label' => __( 'Typography', MELA_TD ),
386 'selector' => '{{WRAPPER}} .ma-el-gravity-form .gfield label',
387 'condition' => [
388 'labels_switch' => 'yes',
389 ],
390 ]
391 );
392
393 $this->end_controls_section();
394
395 /**
396 * Style Tab: Input & Textarea
397 * -------------------------------------------------
398 */
399 $this->start_controls_section(
400 'section_fields_style',
401 [
402 'label' => __( 'Input & Textarea', MELA_TD ),
403 'tab' => Controls_Manager::TAB_STYLE,
404 ]
405 );
406
407 $this->add_responsive_control(
408 'input_alignment',
409 [
410 'label' => __( 'Alignment', MELA_TD ),
411 'type' => Controls_Manager::CHOOSE,
412 'options' => [
413 'left' => [
414 'title' => __( 'Left', MELA_TD ),
415 'icon' => 'fa fa-align-left',
416 ],
417 'center' => [
418 'title' => __( 'Center', MELA_TD ),
419 'icon' => 'fa fa-align-center',
420 ],
421 'right' => [
422 'title' => __( 'Right', MELA_TD ),
423 'icon' => 'fa fa-align-right',
424 ],
425 ],
426 'default' => '',
427 'selectors' => [
428 '{{WRAPPER}} .ma-el-gravity-form .gfield input[type="text"], {{WRAPPER}} .ma-el-gravity-form .gfield textarea' => 'text-align: {{VALUE}};',
429 ],
430 ]
431 );
432
433 $this->start_controls_tabs( 'tabs_fields_style' );
434
435 $this->start_controls_tab(
436 'tab_fields_normal',
437 [
438 'label' => __( 'Normal', MELA_TD ),
439 ]
440 );
441
442 $this->add_control(
443 'field_bg_color',
444 [
445 'label' => __( 'Background Color', MELA_TD ),
446 'type' => Controls_Manager::COLOR,
447 'default' => '#f9f9f9',
448 'selectors' => [
449 '{{WRAPPER}} .ma-el-gravity-form .gform_wrapper input:not([type=radio]):not([type=checkbox]):not([type=submit]):not([type=button]):not([type=image]):not([type=file]), {{WRAPPER}} .ma-el-gravity-form .gfield textarea, {{WRAPPER}} .ma-el-gravity-form .gfield select' => 'background-color: {{VALUE}}',
450 ],
451 ]
452 );
453
454 $this->add_control(
455 'field_text_color',
456 [
457 'label' => __( 'Text Color', MELA_TD ),
458 'type' => Controls_Manager::COLOR,
459 'default' => '',
460 'selectors' => [
461 '{{WRAPPER}} .ma-el-gravity-form .gform_wrapper input:not([type=radio]):not([type=checkbox]):not([type=submit]):not([type=button]):not([type=image]):not([type=file]), {{WRAPPER}} .ma-el-gravity-form .gfield textarea, {{WRAPPER}} .ma-el-gravity-form .gfield select' => 'color: {{VALUE}}',
462 ],
463 ]
464 );
465
466 $this->add_responsive_control(
467 'field_spacing',
468 [
469 'label' => __( 'Spacing', MELA_TD ),
470 'type' => Controls_Manager::SLIDER,
471 'range' => [
472 'px' => [
473 'min' => 0,
474 'max' => 100,
475 'step' => 1,
476 ],
477 ],
478 'size_units' => [ 'px', 'em', '%' ],
479 'selectors' => [
480 '{{WRAPPER}} .ma-el-gravity-form .gfield' => 'margin-bottom: {{SIZE}}{{UNIT}}',
481 ],
482 ]
483 );
484
485 $this->add_responsive_control(
486 'field_padding',
487 [
488 'label' => __( 'Padding', MELA_TD ),
489 'type' => Controls_Manager::DIMENSIONS,
490 'size_units' => [ 'px', 'em', '%' ],
491 'default' => [
492 'top' => '10',
493 'right' => '10',
494 'bottom' => '10',
495 'left' => '10',
496 'unit' => '',
497 'isLinked' => true,
498 ],
499 'selectors' => [
500 '{{WRAPPER}} .ma-el-gravity-form .gform_wrapper input:not([type=radio]):not([type=checkbox]):not([type=submit]):not([type=button]):not([type=image]):not([type=file]), {{WRAPPER}} .ma-el-gravity-form .gfield textarea' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
501 ],
502 ]
503 );
504
505 $this->add_responsive_control(
506 'text_indent',
507 [
508 'label' => __( 'Text Indent', MELA_TD ),
509 'type' => Controls_Manager::SLIDER,
510 'range' => [
511 'px' => [
512 'min' => 0,
513 'max' => 60,
514 'step' => 1,
515 ],
516 '%' => [
517 'min' => 0,
518 'max' => 30,
519 'step' => 1,
520 ],
521 ],
522 'size_units' => [ 'px', 'em', '%' ],
523 'selectors' => [
524 '{{WRAPPER}} .ma-el-gravity-form .gform_wrapper input:not([type=radio]):not([type=checkbox]):not([type=submit]):not([type=button]):not([type=image]):not([type=file]), {{WRAPPER}} .ma-el-gravity-form .gfield textarea, {{WRAPPER}} .ma-el-gravity-form .gfield select' => 'text-indent: {{SIZE}}{{UNIT}}',
525 ],
526 ]
527 );
528
529 $this->add_responsive_control(
530 'input_width',
531 [
532 'label' => __( 'Input Width', MELA_TD ),
533 'type' => Controls_Manager::SLIDER,
534 'range' => [
535 'px' => [
536 'min' => 0,
537 'max' => 1200,
538 'step' => 1,
539 ],
540 ],
541 'size_units' => [ 'px', 'em', '%' ],
542 'selectors' => [
543 '{{WRAPPER}} .ma-el-gravity-form .gform_wrapper input:not([type=radio]):not([type=checkbox]):not([type=submit]):not([type=button]):not([type=image]):not([type=file]), {{WRAPPER}} .ma-el-gravity-form .gfield select' => 'width: {{SIZE}}{{UNIT}}',
544 ],
545 ]
546 );
547
548 $this->add_responsive_control(
549 'input_height',
550 [
551 'label' => __( 'Input Height', MELA_TD ),
552 'type' => Controls_Manager::SLIDER,
553 'range' => [
554 'px' => [
555 'min' => 0,
556 'max' => 80,
557 'step' => 1,
558 ],
559 ],
560 'size_units' => [ 'px', 'em', '%' ],
561 'selectors' => [
562 '{{WRAPPER}} .ma-el-gravity-form .gform_wrapper input:not([type=radio]):not([type=checkbox]):not([type=submit]):not([type=button]):not([type=image]):not([type=file]), {{WRAPPER}} .ma-el-gravity-form .gfield select' => 'height: {{SIZE}}{{UNIT}}',
563 ],
564 ]
565 );
566
567 $this->add_responsive_control(
568 'textarea_width',
569 [
570 'label' => __( 'Textarea Width', MELA_TD ),
571 'type' => Controls_Manager::SLIDER,
572 'range' => [
573 'px' => [
574 'min' => 0,
575 'max' => 1200,
576 'step' => 1,
577 ],
578 ],
579 'size_units' => [ 'px', 'em', '%' ],
580 'selectors' => [
581 '{{WRAPPER}} .ma-el-gravity-form .gfield textarea' => 'width: {{SIZE}}{{UNIT}}',
582 ],
583 ]
584 );
585
586 $this->add_responsive_control(
587 'textarea_height',
588 [
589 'label' => __( 'Textarea Height', MELA_TD ),
590 'type' => Controls_Manager::SLIDER,
591 'range' => [
592 'px' => [
593 'min' => 0,
594 'max' => 400,
595 'step' => 1,
596 ],
597 ],
598 'size_units' => [ 'px', 'em', '%' ],
599 'selectors' => [
600 '{{WRAPPER}} .ma-el-gravity-form .gfield textarea' => 'height: {{SIZE}}{{UNIT}}',
601 ],
602 ]
603 );
604
605 $this->add_group_control(
606 Group_Control_Border::get_type(),
607 [
608 'name' => 'field_border',
609 'label' => __( 'Border', MELA_TD ),
610 'placeholder' => '1px',
611 'default' => '1px',
612 'selector' => '{{WRAPPER}} .ma-el-gravity-form .gform_wrapper input:not([type=radio]):not([type=checkbox]):not([type=submit]):not([type=button]):not([type=image]):not([type=file]), {{WRAPPER}} .ma-el-gravity-form .gfield textarea, {{WRAPPER}} .ma-el-gravity-form .gfield select',
613 'separator' => 'before',
614 ]
615 );
616
617 $this->add_control(
618 'field_radius',
619 [
620 'label' => __( 'Border Radius', MELA_TD ),
621 'type' => Controls_Manager::DIMENSIONS,
622 'size_units' => [ 'px', 'em', '%' ],
623 'selectors' => [
624 '{{WRAPPER}} .ma-el-gravity-form .gform_wrapper input:not([type=radio]):not([type=checkbox]):not([type=submit]):not([type=button]):not([type=image]):not([type=file]), {{WRAPPER}} .ma-el-gravity-form .gfield textarea' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
625 ],
626 ]
627 );
628
629 $this->add_group_control(
630 Group_Control_Typography::get_type(),
631 [
632 'name' => 'field_typography',
633 'label' => __( 'Typography', MELA_TD ),
634 'scheme' => Scheme_Typography::TYPOGRAPHY_4,
635 'selector' => '{{WRAPPER}} .ma-el-gravity-form .gform_wrapper input:not([type=radio]):not([type=checkbox]):not([type=submit]):not([type=button]):not([type=image]):not([type=file]), {{WRAPPER}} .ma-el-gravity-form .gfield textarea, {{WRAPPER}} .ma-el-gravity-form .gfield select',
636 'separator' => 'before',
637 ]
638 );
639
640 $this->add_group_control(
641 Group_Control_Box_Shadow::get_type(),
642 [
643 'name' => 'field_box_shadow',
644 'selector' => '{{WRAPPER}} .ma-el-gravity-form .gform_wrapper input:not([type=radio]):not([type=checkbox]):not([type=submit]):not([type=button]):not([type=image]):not([type=file]), {{WRAPPER}} .ma-el-gravity-form .gfield textarea, {{WRAPPER}} .ma-el-gravity-form .gfield select',
645 'separator' => 'before',
646 ]
647 );
648
649 $this->end_controls_tab();
650
651 $this->start_controls_tab(
652 'tab_fields_focus',
653 [
654 'label' => __( 'Focus', MELA_TD ),
655 ]
656 );
657
658 $this->add_control(
659 'field_bg_color_focus',
660 [
661 'label' => __( 'Background Color', MELA_TD ),
662 'type' => Controls_Manager::COLOR,
663 'default' => '',
664 'selectors' => [
665 '{{WRAPPER}} .ma-el-gravity-form .gfield input:focus, {{WRAPPER}} .ma-el-gravity-form .gfield textarea:focus' => 'background-color: {{VALUE}}',
666 ],
667 ]
668 );
669
670 $this->add_group_control(
671 Group_Control_Border::get_type(),
672 [
673 'name' => 'focus_input_border',
674 'label' => __( 'Border', MELA_TD ),
675 'placeholder' => '1px',
676 'default' => '1px',
677 'selector' => '{{WRAPPER}} .ma-el-gravity-form .gfield input:focus, {{WRAPPER}} .ma-el-gravity-form .gfield textarea:focus',
678 ]
679 );
680
681 $this->add_group_control(
682 Group_Control_Box_Shadow::get_type(),
683 [
684 'name' => 'focus_box_shadow',
685 'selector' => '{{WRAPPER}} .ma-el-gravity-form .gfield input:focus, {{WRAPPER}} .ma-el-gravity-form .gfield textarea:focus',
686 'separator' => 'before',
687 ]
688 );
689
690 $this->end_controls_tab();
691
692 $this->end_controls_tabs();
693
694 $this->end_controls_section();
695
696 /**
697 * Style Tab: Field Description
698 * -------------------------------------------------
699 */
700 $this->start_controls_section(
701 'section_field_description_style',
702 [
703 'label' => __( 'Field Description', MELA_TD ),
704 'tab' => Controls_Manager::TAB_STYLE,
705 ]
706 );
707
708 $this->add_control(
709 'field_description_text_color',
710 [
711 'label' => __( 'Text Color', MELA_TD ),
712 'type' => Controls_Manager::COLOR,
713 'selectors' => [
714 '{{WRAPPER}} .ma-el-gravity-form .gfield .gfield_description' => 'color: {{VALUE}}',
715 ],
716 ]
717 );
718
719 $this->add_group_control(
720 Group_Control_Typography::get_type(),
721 [
722 'name' => 'field_description_typography',
723 'label' => __( 'Typography', MELA_TD ),
724 'selector' => '{{WRAPPER}} .ma-el-gravity-form .gfield .gfield_description',
725 ]
726 );
727
728 $this->add_responsive_control(
729 'field_description_spacing',
730 [
731 'label' => __( 'Spacing', MELA_TD ),
732 'type' => Controls_Manager::SLIDER,
733 'range' => [
734 'px' => [
735 'min' => 0,
736 'max' => 100,
737 'step' => 1,
738 ],
739 ],
740 'size_units' => [ 'px', 'em', '%' ],
741 'selectors' => [
742 '{{WRAPPER}} .ma-el-gravity-form .gfield .gfield_description' => 'padding-top: {{SIZE}}{{UNIT}}',
743 ],
744 ]
745 );
746
747 $this->end_controls_section();
748
749 /**
750 * Style Tab: Section Field
751 * -------------------------------------------------
752 */
753 $this->start_controls_section(
754 'section_field_style',
755 [
756 'label' => __( 'Section Field', MELA_TD ),
757 'tab' => Controls_Manager::TAB_STYLE,
758 ]
759 );
760
761 $this->add_control(
762 'section_field_text_color',
763 [
764 'label' => __( 'Text Color', MELA_TD ),
765 'type' => Controls_Manager::COLOR,
766 'default' => '',
767 'selectors' => [
768 '{{WRAPPER}} .ma-el-gravity-form .gfield.gsection .gsection_title' => 'color: {{VALUE}}',
769 ],
770 ]
771 );
772
773 $this->add_group_control(
774 Group_Control_Typography::get_type(),
775 [
776 'name' => 'section_field_typography',
777 'label' => __( 'Typography', MELA_TD ),
778 'scheme' => Scheme_Typography::TYPOGRAPHY_4,
779 'selector' => '{{WRAPPER}} .ma-el-gravity-form .gfield.gsection .gsection_title',
780 'separator' => 'before',
781 ]
782 );
783
784 $this->add_control(
785 'section_field_border_type',
786 [
787 'label' => __( 'Border Type', MELA_TD ),
788 'type' => Controls_Manager::SELECT,
789 'default' => 'solid',
790 'options' => [
791 'none' => __( 'None', MELA_TD ),
792 'solid' => __( 'Solid', MELA_TD ),
793 'double' => __( 'Double', MELA_TD ),
794 'dotted' => __( 'Dotted', MELA_TD ),
795 'dashed' => __( 'Dashed', MELA_TD ),
796 ],
797 'selectors' => [
798 '{{WRAPPER}} .ma-el-gravity-form .gfield.gsection' => 'border-bottom-style: {{VALUE}}',
799 ],
800 'separator' => 'before',
801 ]
802 );
803
804 $this->add_responsive_control(
805 'section_field_border_height',
806 [
807 'label' => __( 'Border Height', MELA_TD ),
808 'type' => Controls_Manager::SLIDER,
809 'default' => [
810 'size' => 1,
811 ],
812 'range' => [
813 'px' => [
814 'min' => 1,
815 'max' => 20,
816 'step' => 1,
817 ],
818 ],
819 'size_units' => [ 'px' ],
820 'selectors' => [
821 '{{WRAPPER}} .ma-el-gravity-form .gfield.gsection' => 'border-bottom-width: {{SIZE}}{{UNIT}}',
822 ],
823 'condition' => [
824 'section_field_border_type!' => 'none',
825 ],
826 ]
827 );
828
829 $this->add_control(
830 'section_field_border_color',
831 [
832 'label' => __( 'Border Color', MELA_TD ),
833 'type' => Controls_Manager::COLOR,
834 'default' => '',
835 'selectors' => [
836 '{{WRAPPER}} .ma-el-gravity-form .gfield.gsection' => 'border-bottom-color: {{VALUE}}',
837 ],
838 'condition' => [
839 'section_field_border_type!' => 'none',
840 ],
841 ]
842 );
843
844 $this->add_responsive_control(
845 'section_field_margin',
846 [
847 'label' => __( 'Margin', MELA_TD ),
848 'type' => Controls_Manager::DIMENSIONS,
849 'size_units' => [ 'px', 'em', '%' ],
850 'selectors' => [
851 '{{WRAPPER}} .ma-el-gravity-form .gfield.gsection' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
852 ],
853 'separator' => 'before',
854 ]
855 );
856
857 $this->end_controls_section();
858
859 /**
860 * Style Tab: Section Field
861 * -------------------------------------------------
862 */
863 $this->start_controls_section(
864 'section_price_style',
865 [
866 'label' => __( 'Price', MELA_TD ),
867 'tab' => Controls_Manager::TAB_STYLE,
868 ]
869 );
870
871 $this->add_control(
872 'price_label_color',
873 [
874 'label' => __( 'Price Label Color', MELA_TD ),
875 'type' => Controls_Manager::COLOR,
876 'default' => '',
877 'selectors' => [
878 '{{WRAPPER}} .ma-el-gravity-form .gform_wrapper .ginput_product_price_label' => 'color: {{VALUE}}',
879 ],
880 ]
881 );
882
883 $this->add_control(
884 'price_text_color',
885 [
886 'label' => __( 'Price Color', MELA_TD ),
887 'type' => Controls_Manager::COLOR,
888 'default' => '',
889 'selectors' => [
890 '{{WRAPPER}} .ma-el-gravity-form .gform_wrapper .ginput_product_price' => 'color: {{VALUE}}',
891 ],
892 ]
893 );
894
895 $this->end_controls_section();
896
897 /**
898 * Style Tab: Placeholder
899 * -------------------------------------------------
900 */
901 $this->start_controls_section(
902 'section_placeholder_style',
903 [
904 'label' => __( 'Placeholder', MELA_TD ),
905 'tab' => Controls_Manager::TAB_STYLE,
906 'condition' => [
907 'placeholder_switch' => 'yes',
908 ],
909 ]
910 );
911
912 $this->add_control(
913 'text_color_placeholder',
914 [
915 'label' => __( 'Text Color', MELA_TD ),
916 'type' => Controls_Manager::COLOR,
917 'selectors' => [
918 '{{WRAPPER}} .ma-el-gravity-form .gfield input::-webkit-input-placeholder, {{WRAPPER}} .ma-el-gravity-form .gfield textarea::-webkit-input-placeholder' => 'color: {{VALUE}}',
919 ],
920 'condition' => [
921 'placeholder_switch' => 'yes',
922 ],
923 ]
924 );
925
926 $this->end_controls_section();
927
928 /**
929 * Style Tab: Radio & Checkbox
930 * -------------------------------------------------
931 */
932 $this->start_controls_section(
933 'section_radio_checkbox_style',
934 [
935 'label' => __( 'Radio & Checkbox', MELA_TD ),
936 'tab' => Controls_Manager::TAB_STYLE,
937 ]
938 );
939
940 $this->add_control(
941 'custom_radio_checkbox',
942 [
943 'label' => __( 'Custom Styles', MELA_TD ),
944 'type' => Controls_Manager::SWITCHER,
945 'label_on' => __( 'Yes', MELA_TD ),
946 'label_off' => __( 'No', MELA_TD ),
947 'return_value' => 'yes',
948 ]
949 );
950
951 $this->add_responsive_control(
952 'radio_checkbox_size',
953 [
954 'label' => __( 'Size', MELA_TD ),
955 'type' => Controls_Manager::SLIDER,
956 'default' => [
957 'size' => '15',
958 'unit' => 'px'
959 ],
960 'range' => [
961 'px' => [
962 'min' => 0,
963 'max' => 80,
964 'step' => 1,
965 ],
966 ],
967 'size_units' => [ 'px', 'em', '%' ],
968 'selectors' => [
969 '{{WRAPPER}} .ma-el-custom-radio-checkbox input[type="checkbox"], {{WRAPPER}} .ma-el-custom-radio-checkbox input[type="radio"]' => 'width: {{SIZE}}{{UNIT}} !important; height: {{SIZE}}{{UNIT}}',
970 ],
971 'condition' => [
972 'custom_radio_checkbox' => 'yes',
973 ],
974 ]
975 );
976
977 $this->start_controls_tabs( 'tabs_radio_checkbox_style' );
978
979 $this->start_controls_tab(
980 'radio_checkbox_normal',
981 [
982 'label' => __( 'Normal', MELA_TD ),
983 'condition' => [
984 'custom_radio_checkbox' => 'yes',
985 ],
986 ]
987 );
988
989 $this->add_control(
990 'radio_checkbox_color',
991 [
992 'label' => __( 'Color', MELA_TD ),
993 'type' => Controls_Manager::COLOR,
994 'default' => '',
995 'selectors' => [
996 '{{WRAPPER}} .ma-el-custom-radio-checkbox input[type="checkbox"], {{WRAPPER}} .ma-el-custom-radio-checkbox input[type="radio"]' => 'background: {{VALUE}}',
997 ],
998 'condition' => [
999 'custom_radio_checkbox' => 'yes',
1000 ],
1001 ]
1002 );
1003
1004 $this->add_responsive_control(
1005 'radio_checkbox_border_width',
1006 [
1007 'label' => __( 'Border Width', MELA_TD ),
1008 'type' => Controls_Manager::SLIDER,
1009 'range' => [
1010 'px' => [
1011 'min' => 0,
1012 'max' => 15,
1013 'step' => 1,
1014 ],
1015 ],
1016 'size_units' => [ 'px' ],
1017 'selectors' => [
1018 '{{WRAPPER}} .ma-el-custom-radio-checkbox input[type="checkbox"], {{WRAPPER}} .ma-el-custom-radio-checkbox input[type="radio"]' => 'border-width: {{SIZE}}{{UNIT}}',
1019 ],
1020 'condition' => [
1021 'custom_radio_checkbox' => 'yes',
1022 ],
1023 ]
1024 );
1025
1026 $this->add_control(
1027 'radio_checkbox_border_color',
1028 [
1029 'label' => __( 'Border Color', MELA_TD ),
1030 'type' => Controls_Manager::COLOR,
1031 'default' => '',
1032 'selectors' => [
1033 '{{WRAPPER}} .ma-el-custom-radio-checkbox input[type="checkbox"], {{WRAPPER}} .ma-el-custom-radio-checkbox input[type="radio"]' => 'border-color: {{VALUE}}',
1034 ],
1035 'condition' => [
1036 'custom_radio_checkbox' => 'yes',
1037 ],
1038 ]
1039 );
1040
1041 $this->add_control(
1042 'checkbox_heading',
1043 [
1044 'label' => __( 'Checkbox', MELA_TD ),
1045 'type' => Controls_Manager::HEADING,
1046 'separator' => 'before',
1047 'condition' => [
1048 'custom_radio_checkbox' => 'yes',
1049 ],
1050 ]
1051 );
1052
1053 $this->add_control(
1054 'checkbox_border_radius',
1055 [
1056 'label' => __( 'Border Radius', MELA_TD ),
1057 'type' => Controls_Manager::DIMENSIONS,
1058 'size_units' => [ 'px', 'em', '%' ],
1059 'selectors' => [
1060 '{{WRAPPER}} .ma-el-custom-radio-checkbox input[type="checkbox"], {{WRAPPER}} .ma-el-custom-radio-checkbox input[type="checkbox"]:before' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
1061 ],
1062 'condition' => [
1063 'custom_radio_checkbox' => 'yes',
1064 ],
1065 ]
1066 );
1067
1068 $this->add_control(
1069 'radio_heading',
1070 [
1071 'label' => __( 'Radio Buttons', MELA_TD ),
1072 'type' => Controls_Manager::HEADING,
1073 'separator' => 'before',
1074 'condition' => [
1075 'custom_radio_checkbox' => 'yes',
1076 ],
1077 ]
1078 );
1079
1080 $this->add_control(
1081 'radio_border_radius',
1082 [
1083 'label' => __( 'Border Radius', MELA_TD ),
1084 'type' => Controls_Manager::DIMENSIONS,
1085 'size_units' => [ 'px', 'em', '%' ],
1086 'selectors' => [
1087 '{{WRAPPER}} .ma-el-custom-radio-checkbox input[type="radio"], {{WRAPPER}} .ma-el-custom-radio-checkbox input[type="radio"]:before' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
1088 ],
1089 'condition' => [
1090 'custom_radio_checkbox' => 'yes',
1091 ],
1092 ]
1093 );
1094
1095 $this->end_controls_tab();
1096
1097 $this->start_controls_tab(
1098 'radio_checkbox_checked',
1099 [
1100 'label' => __( 'Checked', MELA_TD ),
1101 'condition' => [
1102 'custom_radio_checkbox' => 'yes',
1103 ],
1104 ]
1105 );
1106
1107 $this->add_control(
1108 'radio_checkbox_color_checked',
1109 [
1110 'label' => __( 'Color', MELA_TD ),
1111 'type' => Controls_Manager::COLOR,
1112 'default' => '',
1113 'selectors' => [
1114 '{{WRAPPER}} .ma-el-custom-radio-checkbox input[type="checkbox"]:checked:before, {{WRAPPER}} .ma-el-custom-radio-checkbox input[type="radio"]:checked:before' => 'background: {{VALUE}}',
1115 ],
1116 'condition' => [
1117 'custom_radio_checkbox' => 'yes',
1118 ],
1119 ]
1120 );
1121
1122 $this->end_controls_tab();
1123
1124 $this->end_controls_tabs();
1125
1126 $this->end_controls_section();
1127
1128 /**
1129 * Style Tab: Submit Button
1130 * -------------------------------------------------
1131 */
1132 $this->start_controls_section(
1133 'section_submit_button_style',
1134 [
1135 'label' => __( 'Submit Button', MELA_TD ),
1136 'tab' => Controls_Manager::TAB_STYLE,
1137 ]
1138 );
1139
1140 $this->add_responsive_control(
1141 'button_align',
1142 [
1143 'label' => __( 'Alignment', MELA_TD ),
1144 'type' => Controls_Manager::CHOOSE,
1145 'options' => [
1146 'left' => [
1147 'title' => __( 'Left', MELA_TD ),
1148 'icon' => 'eicon-h-align-left',
1149 ],
1150 'center' => [
1151 'title' => __( 'Center', MELA_TD ),
1152 'icon' => 'eicon-h-align-center',
1153 ],
1154 'right' => [
1155 'title' => __( 'Right', MELA_TD ),
1156 'icon' => 'eicon-h-align-right',
1157 ],
1158 ],
1159 'default' => '',
1160 'selectors' => [
1161 '{{WRAPPER}} .ma-el-gravity-form .gform_footer,
1162 {{WRAPPER}} .ma-el-gravity-form .gform_page_footer' => 'text-align: {{VALUE}};',
1163 ],
1164 'condition' => [
1165 'button_width_type!' => 'full-width',
1166 ],
1167 ]
1168 );
1169
1170 $this->add_control(
1171 'button_width_type',
1172 [
1173 'label' => __( 'Width', MELA_TD ),
1174 'type' => Controls_Manager::SELECT,
1175 'default' => 'custom',
1176 'options' => [
1177 'auto' => __( 'Auto', MELA_TD ),
1178 'full-width' => __( 'Full Width', MELA_TD ),
1179 'custom' => __( 'Custom', MELA_TD ),
1180 ],
1181 'prefix_class' => 'ma-el-gravity-form-button-',
1182 ]
1183 );
1184
1185 $this->add_responsive_control(
1186 'button_width',
1187 [
1188 'label' => __( 'Width', MELA_TD ),
1189 'type' => Controls_Manager::SLIDER,
1190 'default' => [
1191 'size' => '100',
1192 'unit' => 'px'
1193 ],
1194 'range' => [
1195 'px' => [
1196 'min' => 0,
1197 'max' => 1200,
1198 'step' => 1,
1199 ],
1200 ],
1201 'size_units' => [ 'px', '%' ],
1202 'selectors' => [
1203 '{{WRAPPER}} .ma-el-gravity-form .gform_footer input[type="submit"], {{WRAPPER}} .ma-el-gravity-form .gform_page_footer input[type="submit"]' => 'width: {{SIZE}}{{UNIT}}',
1204 ],
1205 'condition' => [
1206 'button_width_type' => 'custom',
1207 ],
1208 ]
1209 );
1210
1211 $this->start_controls_tabs( 'tabs_button_style' );
1212
1213 $this->start_controls_tab(
1214 'tab_button_normal',
1215 [
1216 'label' => __( 'Normal', MELA_TD ),
1217 ]
1218 );
1219
1220 $this->add_control(
1221 'button_bg_color_normal',
1222 [
1223 'label' => __( 'Background Color', MELA_TD ),
1224 'type' => Controls_Manager::COLOR,
1225 'default' => '',
1226 'selectors' => [
1227 '{{WRAPPER}} .ma-el-gravity-form .gform_footer input[type="submit"],
1228 {{WRAPPER}} .ma-el-gravity-form .gform_page_footer input[type="submit"]' => 'background-color: {{VALUE}}',
1229 ],
1230 ]
1231 );
1232
1233 $this->add_control(
1234 'button_text_color_normal',
1235 [
1236 'label' => __( 'Text Color', MELA_TD ),
1237 'type' => Controls_Manager::COLOR,
1238 'default' => '',
1239 'selectors' => [
1240 '{{WRAPPER}} .ma-el-gravity-form .gform_footer input[type="submit"],
1241 {{WRAPPER}} .ma-el-gravity-form .gform_page_footer input[type="submit"]' => 'color: {{VALUE}}',
1242 ],
1243 ]
1244 );
1245
1246 $this->add_group_control(
1247 Group_Control_Border::get_type(),
1248 [
1249 'name' => 'button_border_normal',
1250 'label' => __( 'Border', MELA_TD ),
1251 'placeholder' => '1px',
1252 'default' => '1px',
1253 'selector' => '{{WRAPPER}} .ma-el-gravity-form .gform_footer input[type="submit"], {{WRAPPER}} .ma-el-gravity-form .gform_page_footer input[type="submit"]',
1254 ]
1255 );
1256
1257 $this->add_control(
1258 'button_border_radius',
1259 [
1260 'label' => __( 'Border Radius', MELA_TD ),
1261 'type' => Controls_Manager::DIMENSIONS,
1262 'size_units' => [ 'px', 'em', '%' ],
1263 'selectors' => [
1264 '{{WRAPPER}} .ma-el-gravity-form .gform_footer input[type="submit"], {{WRAPPER}} .ma-el-gravity-form .gform_page_footer input[type="submit"]' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
1265 ],
1266 ]
1267 );
1268
1269 $this->add_responsive_control(
1270 'button_padding',
1271 [
1272 'label' => __( 'Padding', MELA_TD ),
1273 'type' => Controls_Manager::DIMENSIONS,
1274 'size_units' => [ 'px', 'em', '%' ],
1275 'selectors' => [
1276 '{{WRAPPER}} .ma-el-gravity-form .gform_footer input[type="submit"], {{WRAPPER}} .ma-el-gravity-form .gform_page_footer input[type="submit"]' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
1277 ],
1278 ]
1279 );
1280
1281 $this->add_responsive_control(
1282 'button_margin',
1283 [
1284 'label' => __( 'Margin Top', MELA_TD ),
1285 'type' => Controls_Manager::SLIDER,
1286 'range' => [
1287 'px' => [
1288 'min' => 0,
1289 'max' => 100,
1290 'step' => 1,
1291 ],
1292 ],
1293 'size_units' => [ 'px', 'em', '%' ],
1294 'selectors' => [
1295 '{{WRAPPER}} .ma-el-gravity-form .gform_footer input[type="submit"], {{WRAPPER}} .ma-el-gravity-form .gform_page_footer input[type="submit"]' => 'margin-top: {{SIZE}}{{UNIT}}',
1296 ],
1297 ]
1298 );
1299
1300 $this->add_group_control(
1301 Group_Control_Typography::get_type(),
1302 [
1303 'name' => 'button_typography',
1304 'label' => __( 'Typography', MELA_TD ),
1305 'scheme' => Scheme_Typography::TYPOGRAPHY_4,
1306 'selector' => '{{WRAPPER}} .ma-el-gravity-form .gform_footer input[type="submit"], {{WRAPPER}} .ma-el-gravity-form .gform_page_footer input[type="submit"]',
1307 'separator' => 'before',
1308 ]
1309 );
1310
1311 $this->add_group_control(
1312 Group_Control_Box_Shadow::get_type(),
1313 [
1314 'name' => 'button_box_shadow',
1315 'selector' => '{{WRAPPER}} .ma-el-gravity-form .gform_footer input[type="submit"], {{WRAPPER}} .ma-el-gravity-form .gform_page_footer input[type="submit"]',
1316 'separator' => 'before',
1317 ]
1318 );
1319
1320 $this->end_controls_tab();
1321
1322 $this->start_controls_tab(
1323 'tab_button_hover',
1324 [
1325 'label' => __( 'Hover', MELA_TD ),
1326 ]
1327 );
1328
1329 $this->add_control(
1330 'button_bg_color_hover',
1331 [
1332 'label' => __( 'Background Color', MELA_TD ),
1333 'type' => Controls_Manager::COLOR,
1334 'default' => '',
1335 'selectors' => [
1336 '{{WRAPPER}} .ma-el-gravity-form .gform_footer input[type="submit"]:hover, {{WRAPPER}} .ma-el-gravity-form .gform_page_footer input[type="submit"]:hover' => 'background-color: {{VALUE}}',
1337 ],
1338 ]
1339 );
1340
1341 $this->add_control(
1342 'button_text_color_hover',
1343 [
1344 'label' => __( 'Text Color', MELA_TD ),
1345 'type' => Controls_Manager::COLOR,
1346 'default' => '',
1347 'selectors' => [
1348 '{{WRAPPER}} .ma-el-gravity-form .gform_footer input[type="submit"]:hover, {{WRAPPER}} .ma-el-gravity-form .gform_page_footer input[type="submit"]:hover' => 'color: {{VALUE}}',
1349 ],
1350 ]
1351 );
1352
1353 $this->add_control(
1354 'button_border_color_hover',
1355 [
1356 'label' => __( 'Border Color', MELA_TD ),
1357 'type' => Controls_Manager::COLOR,
1358 'default' => '',
1359 'selectors' => [
1360 '{{WRAPPER}} .ma-el-gravity-form .gform_footer input[type="submit"]:hover, {{WRAPPER}} .ma-el-gravity-form .gform_page_footer input[type="submit"]:hover' => 'border-color: {{VALUE}}',
1361 ],
1362 ]
1363 );
1364
1365 $this->end_controls_tab();
1366
1367 $this->end_controls_tabs();
1368
1369 $this->end_controls_section();
1370
1371 /**
1372 * Style Tab: Pagination
1373 * -------------------------------------------------
1374 */
1375 $this->start_controls_section(
1376 'section_pagination_style',
1377 [
1378 'label' => __( 'Pagination', MELA_TD ),
1379 'tab' => Controls_Manager::TAB_STYLE,
1380 ]
1381 );
1382
1383 $this->add_control(
1384 'pagination_buttons_width_type',
1385 [
1386 'label' => __( 'Width', MELA_TD ),
1387 'type' => Controls_Manager::SELECT,
1388 'default' => 'auto',
1389 'options' => [
1390 'auto' => __( 'Auto', MELA_TD ),
1391 'full-width' => __( 'Full Width', MELA_TD ),
1392 'custom' => __( 'Custom', MELA_TD ),
1393 ],
1394 'prefix_class' => 'ma-el-gravity-form-pagination-buttons-',
1395 ]
1396 );
1397
1398 $this->add_responsive_control(
1399 'pagination_buttons_width',
1400 [
1401 'label' => __( 'Width', MELA_TD ),
1402 'type' => Controls_Manager::SLIDER,
1403 'default' => [
1404 'size' => '100',
1405 'unit' => 'px'
1406 ],
1407 'range' => [
1408 'px' => [
1409 'min' => 0,
1410 'max' => 1200,
1411 'step' => 1,
1412 ],
1413 ],
1414 'size_units' => [ 'px', '%' ],
1415 'selectors' => [
1416 '{{WRAPPER}} .ma-el-gravity-form .gform_page_footer input[type="button"]' => 'width: {{SIZE}}{{UNIT}}',
1417 ],
1418 'condition' => [
1419 'pagination_buttons_width_type' => 'custom',
1420 ],
1421 ]
1422 );
1423
1424 $this->start_controls_tabs( 'tabs_pagination_buttons_style' );
1425
1426 $this->start_controls_tab(
1427 'tab_pagination_buttons_normal',
1428 [
1429 'label' => __( 'Normal', MELA_TD ),
1430 ]
1431 );
1432
1433 $this->add_control(
1434 'pagination_buttons_bg_color_normal',
1435 [
1436 'label' => __( 'Background Color', MELA_TD ),
1437 'type' => Controls_Manager::COLOR,
1438 'default' => '',
1439 'selectors' => [
1440 '{{WRAPPER}} .ma-el-gravity-form .gform_page_footer input[type="button"]' => 'background-color: {{VALUE}}',
1441 ],
1442 ]
1443 );
1444
1445 $this->add_control(
1446 'pagination_buttons_text_color_normal',
1447 [
1448 'label' => __( 'Text Color', MELA_TD ),
1449 'type' => Controls_Manager::COLOR,
1450 'default' => '',
1451 'selectors' => [
1452 '{{WRAPPER}} .ma-el-gravity-form .gform_page_footer input[type="button"]' => 'color: {{VALUE}}',
1453 ],
1454 ]
1455 );
1456
1457 $this->add_group_control(
1458 Group_Control_Border::get_type(),
1459 [
1460 'name' => 'pagination_buttons_border_normal',
1461 'label' => __( 'Border', MELA_TD ),
1462 'placeholder' => '1px',
1463 'default' => '1px',
1464 'selector' => '{{WRAPPER}} .ma-el-gravity-form .gform_page_footer input[type="button"]',
1465 ]
1466 );
1467
1468 $this->add_control(
1469 'pagination_buttons_border_radius',
1470 [
1471 'label' => __( 'Border Radius', MELA_TD ),
1472 'type' => Controls_Manager::DIMENSIONS,
1473 'size_units' => [ 'px', 'em', '%' ],
1474 'selectors' => [
1475 '{{WRAPPER}} .ma-el-gravity-form .gform_page_footer input[type="button"]' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
1476 ],
1477 ]
1478 );
1479
1480 $this->add_responsive_control(
1481 'pagination_buttons_padding',
1482 [
1483 'label' => __( 'Padding', MELA_TD ),
1484 'type' => Controls_Manager::DIMENSIONS,
1485 'size_units' => [ 'px', 'em', '%' ],
1486 'selectors' => [
1487 '{{WRAPPER}} .ma-el-gravity-form .gform_page_footer input[type="button"]' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
1488 ],
1489 ]
1490 );
1491
1492 $this->add_responsive_control(
1493 'pagination_buttons_margin',
1494 [
1495 'label' => __( 'Margin Top', MELA_TD ),
1496 'type' => Controls_Manager::SLIDER,
1497 'range' => [
1498 'px' => [
1499 'min' => 0,
1500 'max' => 100,
1501 'step' => 1,
1502 ],
1503 ],
1504 'size_units' => [ 'px', 'em', '%' ],
1505 'selectors' => [
1506 '{{WRAPPER}} .ma-el-gravity-form .gform_page_footer input[type="button"]' => 'margin-top: {{SIZE}}{{UNIT}}',
1507 ],
1508 ]
1509 );
1510
1511 $this->add_group_control(
1512 Group_Control_Typography::get_type(),
1513 [
1514 'name' => 'pagination_buttons_typography',
1515 'label' => __( 'Typography', MELA_TD ),
1516 'scheme' => Scheme_Typography::TYPOGRAPHY_4,
1517 'selector' => '{{WRAPPER}} .ma-el-gravity-form .gform_page_footer input[type="button"]',
1518 'separator' => 'before',
1519 ]
1520 );
1521
1522 $this->add_group_control(
1523 Group_Control_Box_Shadow::get_type(),
1524 [
1525 'name' => 'pagination_buttons_box_shadow',
1526 'selector' => '{{WRAPPER}} .ma-el-gravity-form .gform_page_footer input[type="button"]',
1527 'separator' => 'before',
1528 ]
1529 );
1530
1531 $this->end_controls_tab();
1532
1533 $this->start_controls_tab(
1534 'tab_pagination_buttons_hover',
1535 [
1536 'label' => __( 'Hover', MELA_TD ),
1537 ]
1538 );
1539
1540 $this->add_control(
1541 'pagination_buttons_bg_color_hover',
1542 [
1543 'label' => __( 'Background Color', MELA_TD ),
1544 'type' => Controls_Manager::COLOR,
1545 'default' => '',
1546 'selectors' => [
1547 '{{WRAPPER}} .ma-el-gravity-form .gform_page_footer input[type="button"]:hover' => 'background-color: {{VALUE}}',
1548 ],
1549 ]
1550 );
1551
1552 $this->add_control(
1553 'pagination_buttons_text_color_hover',
1554 [
1555 'label' => __( 'Text Color', MELA_TD ),
1556 'type' => Controls_Manager::COLOR,
1557 'default' => '',
1558 'selectors' => [
1559 '{{WRAPPER}} .ma-el-gravity-form .gform_page_footer input[type="button"]:hover' => 'color: {{VALUE}}',
1560 ],
1561 ]
1562 );
1563
1564 $this->add_control(
1565 'pagination_buttons_border_color_hover',
1566 [
1567 'label' => __( 'Border Color', MELA_TD ),
1568 'type' => Controls_Manager::COLOR,
1569 'default' => '',
1570 'selectors' => [
1571 '{{WRAPPER}} .ma-el-gravity-form .gform_page_footer input[type="button"]:hover' => 'border-color: {{VALUE}}',
1572 ],
1573 ]
1574 );
1575
1576 $this->end_controls_tab();
1577
1578 $this->end_controls_tabs();
1579
1580 $this->end_controls_section();
1581
1582 /**
1583 * Style Tab: Progress Bar
1584 * -------------------------------------------------
1585 */
1586 $this->start_controls_section(
1587 'section_progress_bar_style',
1588 [
1589 'label' => __( 'Progress Bar', MELA_TD ),
1590 'tab' => Controls_Manager::TAB_STYLE,
1591 ]
1592 );
1593
1594 $this->start_controls_tabs( 'tabs_progress_bar_style' );
1595
1596 $this->start_controls_tab(
1597 'tab_progress_bar_default',
1598 [
1599 'label' => __( 'Default', MELA_TD ),
1600 ]
1601 );
1602
1603 $this->add_control(
1604 'progress_bar_default_bg',
1605 [
1606 'label' => __( 'Background Color', MELA_TD ),
1607 'type' => Controls_Manager::COLOR,
1608 'default' => '',
1609 'selectors' => [
1610 '{{WRAPPER}} .ma-el-gravity-form .gform_wrapper .gf_progressbar' => 'background-color: {{VALUE}}',
1611 ],
1612 ]
1613 );
1614
1615 $this->add_control(
1616 'progress_bar_text_color',
1617 [
1618 'label' => __( 'Text Color', MELA_TD ),
1619 'type' => Controls_Manager::COLOR,
1620 'default' => '',
1621 'selectors' => [
1622 '{{WRAPPER}} .ma-el-gravity-form .gform_wrapper .gf_progressbar_percentage span' => 'color: {{VALUE}}',
1623 ],
1624 ]
1625 );
1626
1627 $this->add_group_control(
1628 Group_Control_Typography::get_type(),
1629 [
1630 'name' => 'progress_bar_typography',
1631 'label' => __( 'Typography', MELA_TD ),
1632 'selector' => '{{WRAPPER}} .ma-el-gravity-form .gform_wrapper .gf_progressbar_percentage span',
1633 ]
1634 );
1635
1636 $this->add_group_control(
1637 Group_Control_Border::get_type(),
1638 [
1639 'name' => 'progress_bar_default_border',
1640 'label' => __( 'Border', MELA_TD ),
1641 'placeholder' => '1px',
1642 'default' => '1px',
1643 'selector' => '{{WRAPPER}} .ma-el-gravity-form .gform_wrapper .gf_progressbar',
1644 ]
1645 );
1646
1647 $this->add_control(
1648 'progress_bar_border_radius',
1649 [
1650 'label' => __( 'Border Radius', MELA_TD ),
1651 'type' => Controls_Manager::DIMENSIONS,
1652 'size_units' => [ 'px', '%' ],
1653 'selectors' => [
1654 '{{WRAPPER}} .ma-el-gravity-form .gform_wrapper .gf_progressbar, {{WRAPPER}} .ma-el-gravity-form .gform_wrapper .gf_progressbar_percentage, {{WRAPPER}} .ma-el-gravity-form .gform_wrapper .gf_progressbar:after' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
1655 ],
1656 ]
1657 );
1658
1659 $this->add_responsive_control(
1660 'progress_bar_default_padding',
1661 [
1662 'label' => __( 'Padding', MELA_TD ),
1663 'type' => Controls_Manager::DIMENSIONS,
1664 'size_units' => [ 'px' ],
1665 'selectors' => [
1666 '{{WRAPPER}} .ma-el-gravity-form .gform_wrapper .gf_progressbar' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};',
1667 ],
1668 ]
1669 );
1670
1671 $this->add_group_control(
1672 Group_Control_Box_Shadow::get_type(),
1673 [
1674 'name' => 'progress_bar_default_box_shadow',
1675 'selector' => '{{WRAPPER}} .ma-el-gravity-form .gform_wrapper .gf_progressbar',
1676 ]
1677 );
1678
1679 $this->end_controls_tab();
1680
1681 $this->start_controls_tab(
1682 'tab_progress_bar_progress',
1683 [
1684 'label' => __( 'Progress', MELA_TD ),
1685 ]
1686 );
1687
1688 $this->add_group_control(
1689 Group_Control_Background::get_type(),
1690 [
1691 'name' => 'progress_bar_bg',
1692 'label' => __( 'Background', MELA_TD ),
1693 'types' => [ 'classic', 'gradient' ],
1694 'selector' => '{{WRAPPER}} .ma-el-gravity-form .gform_wrapper .gf_progressbar_percentage',
1695 'exclude' => [ 'image' ],
1696 ]
1697 );
1698
1699 $this->add_responsive_control(
1700 'progress_bar_height',
1701 [
1702 'label' => __( 'Height', MELA_TD ),
1703 'type' => Controls_Manager::SLIDER,
1704 'range' => [
1705 'px' => [
1706 'min' => 0,
1707 'max' => 100,
1708 'step' => 1,
1709 ],
1710 ],
1711 'size_units' => [ 'px' ],
1712 'selectors' => [
1713 '{{WRAPPER}} .ma-el-gravity-form .gform_wrapper .gf_progressbar_percentage, {{WRAPPER}} .ma-el-gravity-form .gform_wrapper .gf_progressbar:after' => 'height: {{SIZE}}{{UNIT}}',
1714 '{{WRAPPER}} .ma-el-gravity-form .gform_wrapper .gf_progressbar:after' => 'margin-top: -{{SIZE}}{{UNIT}}',
1715 ],
1716 ]
1717 );
1718
1719 $this->add_group_control(
1720 Group_Control_Box_Shadow::get_type(),
1721 [
1722 'name' => 'progress_bar_progress_box_shadow',
1723 'selector' => '{{WRAPPER}} .ma-el-gravity-form .gform_wrapper .gf_progressbar:after',
1724 ]
1725 );
1726
1727 $this->end_controls_tab();
1728
1729 $this->end_controls_tabs();
1730
1731 $this->add_control(
1732 'progress_bar_label_heading',
1733 [
1734 'label' => __( 'Label', MELA_TD ),
1735 'type' => Controls_Manager::HEADING,
1736 'separator' => 'before',
1737 ]
1738 );
1739
1740 $this->add_control(
1741 'progress_bar_label_color',
1742 [
1743 'label' => __( 'Color', MELA_TD ),
1744 'type' => Controls_Manager::COLOR,
1745 'default' => '',
1746 'selectors' => [
1747 '{{WRAPPER}} .ma-el-gravity-form .gform_wrapper .gf_progressbar_wrapper .gf_progressbar_title, {{WRAPPER}} .ma-el-gravity-form .gform_wrapper .gf_step' => 'color: {{VALUE}}',
1748 ],
1749 ]
1750 );
1751
1752 $this->add_group_control(
1753 Group_Control_Typography::get_type(),
1754 [
1755 'name' => 'progress_bar_label_typography',
1756 'label' => __( 'Typography', MELA_TD ),
1757 'selector' => '{{WRAPPER}} .ma-el-gravity-form .gform_wrapper .gf_progressbar_wrapper .gf_progressbar_title, {{WRAPPER}} .ma-el-gravity-form .gform_wrapper .gf_step',
1758 ]
1759 );
1760
1761 $this->end_controls_section();
1762
1763 /**
1764 * Style Tab: Errors
1765 * -------------------------------------------------
1766 */
1767 $this->start_controls_section(
1768 'section_error_style',
1769 [
1770 'label' => __( 'Errors', MELA_TD ),
1771 'tab' => Controls_Manager::TAB_STYLE,
1772 ]
1773 );
1774
1775 $this->add_control(
1776 'error_messages_heading',
1777 [
1778 'label' => __( 'Error Messages', MELA_TD ),
1779 'type' => Controls_Manager::HEADING,
1780 'condition' => [
1781 'error_messages' => 'show',
1782 ],
1783 ]
1784 );
1785
1786 $this->add_control(
1787 'error_message_text_color',
1788 [
1789 'label' => __( 'Text Color', MELA_TD ),
1790 'type' => Controls_Manager::COLOR,
1791 'default' => '',
1792 'selectors' => [
1793 '{{WRAPPER}} .ma-el-gravity-form .gfield .validation_message' => 'color: {{VALUE}}',
1794 ],
1795 'condition' => [
1796 'error_messages' => 'show',
1797 ],
1798 ]
1799 );
1800
1801 $this->add_control(
1802 'validation_errors_heading',
1803 [
1804 'label' => __( 'Validation Errors', MELA_TD ),
1805 'type' => Controls_Manager::HEADING,
1806 'separator' => 'before',
1807 'condition' => [
1808 'validation_errors' => 'show',
1809 ],
1810 ]
1811 );
1812
1813 $this->add_control(
1814 'validation_error_description_color',
1815 [
1816 'label' => __( 'Error Description Color', MELA_TD ),
1817 'type' => Controls_Manager::COLOR,
1818 'default' => '',
1819 'selectors' => [
1820 '{{WRAPPER}} .ma-el-gravity-form .gform_wrapper .validation_error' => 'color: {{VALUE}}',
1821 ],
1822 'condition' => [
1823 'validation_errors' => 'show',
1824 ],
1825 ]
1826 );
1827
1828 $this->add_control(
1829 'validation_error_border_color',
1830 [
1831 'label' => __( 'Error Border Color', MELA_TD ),
1832 'type' => Controls_Manager::COLOR,
1833 'default' => '',
1834 'selectors' => [
1835 '{{WRAPPER}} .ma-el-gravity-form .gform_wrapper .validation_error' => 'border-top-color: {{VALUE}}; border-bottom-color: {{VALUE}}',
1836 '{{WRAPPER}} .ma-el-gravity-form .gfield_error' => 'border-top-color: {{VALUE}}; border-bottom-color: {{VALUE}}',
1837 ],
1838 'condition' => [
1839 'validation_errors' => 'show',
1840 ],
1841 ]
1842 );
1843
1844 $this->add_control(
1845 'validation_errors_bg_color',
1846 [
1847 'label' => __( 'Error Field Background Color', MELA_TD ),
1848 'type' => Controls_Manager::COLOR,
1849 'default' => '',
1850 'selectors' => [
1851 '{{WRAPPER}} .ma-el-gravity-form .gfield_error' => 'background: {{VALUE}}',
1852 ],
1853 'condition' => [
1854 'validation_errors' => 'show',
1855 ],
1856 ]
1857 );
1858
1859 $this->add_control(
1860 'validation_error_field_label_color',
1861 [
1862 'label' => __( 'Error Field Label Color', MELA_TD ),
1863 'type' => Controls_Manager::COLOR,
1864 'default' => '',
1865 'selectors' => [
1866 '{{WRAPPER}} .ma-el-gravity-form .gfield_error .gfield_label' => 'color: {{VALUE}}',
1867 ],
1868 'condition' => [
1869 'validation_errors' => 'show',
1870 ],
1871 ]
1872 );
1873
1874 $this->add_control(
1875 'validation_error_field_input_border_color',
1876 [
1877 'label' => __( 'Error Field Input Border Color', MELA_TD ),
1878 'type' => Controls_Manager::COLOR,
1879 'default' => '',
1880 'selectors' => [
1881 '{{WRAPPER}} .ma-el-gravity-form .gform_wrapper li.gfield_error input:not([type=radio]):not([type=checkbox]):not([type=submit]):not([type=button]):not([type=image]):not([type=file]), {{WRAPPER}} .gform_wrapper li.gfield_error textarea' => 'border-color: {{VALUE}}',
1882 ],
1883 'condition' => [
1884 'validation_errors' => 'show',
1885 ],
1886 ]
1887 );
1888
1889 $this->add_control(
1890 'validation_error_field_input_border_width',
1891 [
1892 'label' => __( 'Error Field Input Border Width', MELA_TD ),
1893 'type' => Controls_Manager::NUMBER,
1894 'default' => 1,
1895 'min' => 1,
1896 'max' => 10,
1897 'step' => 1,
1898 'selectors' => [
1899 '{{WRAPPER}} .ma-el-gravity-form .gform_wrapper li.gfield_error input:not([type=radio]):not([type=checkbox]):not([type=submit]):not([type=button]):not([type=image]):not([type=file]), {{WRAPPER}} .gform_wrapper li.gfield_error textarea' => 'border-width: {{VALUE}}px',
1900 ],
1901 'condition' => [
1902 'validation_errors' => 'show',
1903 ],
1904 ]
1905 );
1906
1907 $this->end_controls_section();
1908
1909 /**
1910 * Style Tab: Thank You Message
1911 * -------------------------------------------------
1912 */
1913 $this->start_controls_section(
1914 'section_ty_style',
1915 [
1916 'label' => __( 'Thank You Message', MELA_TD ),
1917 'tab' => Controls_Manager::TAB_STYLE,
1918 ]
1919 );
1920
1921 $this->add_control(
1922 'ty_message_text_color',
1923 [
1924 'label' => __( 'Text Color', MELA_TD ),
1925 'type' => Controls_Manager::COLOR,
1926 'default' => '',
1927 'selectors' => [
1928 '{{WRAPPER}} .ma-el-gravity-form .gform_confirmation_wrapper .gform_confirmation_message' => 'color: {{VALUE}}',
1929 ],
1930 ]
1931 );
1932
1933 $this->end_controls_section();
1934
1935 } //Premium Code use block end
1936 }
1937
1938 protected function _content_template() {}
1939 }
1940
1941 Plugin::instance()->widgets_manager->register_widget_type( new Master_Addons_Gravity_Forms() );