Eael_Adv_Accordion.php
7 years ago
Eael_Adv_Tabs.php
7 years ago
Eael_Caldera_Forms.php
7 years ago
Eael_Contact_Form_7.php
7 years ago
Eael_Content_Ticker.php
7 years ago
Eael_Countdown.php
7 years ago
Eael_Creative_Button.php
7 years ago
Eael_Cta_Box.php
7 years ago
Eael_Data_Table.php
7 years ago
Eael_Dual_Color_Header.php
7 years ago
Eael_Fancy_Text.php
7 years ago
Eael_Feature_List.php
7 years ago
Eael_Filterable_Gallery.php
7 years ago
Eael_Flip_Box.php
7 years ago
Eael_GravityForms.php
7 years ago
Eael_Image_Accordion.php
7 years ago
Eael_Info_Box.php
7 years ago
Eael_NinjaForms.php
7 years ago
Eael_Post_Grid.php
7 years ago
Eael_Post_Timeline.php
7 years ago
Eael_Pricing_Table.php
7 years ago
Eael_Product_Grid.php
7 years ago
Eael_Progress_Bar.php
7 years ago
Eael_Team_Member.php
7 years ago
Eael_Testimonial.php
7 years ago
Eael_Tooltip.php
7 years ago
Eael_Twitter_Feed.php
7 years ago
Eael_WeForms.php
7 years ago
Eael_WpForms.php
7 years ago
Eael_WpForms.php
1454 lines
| 1 | <?php |
| 2 | namespace Essential_Addons_Elementor\Elements; |
| 3 | |
| 4 | // If this file is called directly, abort. |
| 5 | if (!defined('ABSPATH')) { |
| 6 | exit; |
| 7 | } |
| 8 | |
| 9 | use \Elementor\Controls_Manager as Controls_Manager; |
| 10 | use \Elementor\Group_Control_Border as Group_Control_Border; |
| 11 | use \Elementor\Group_Control_Box_Shadow as Group_Control_Box_Shadow; |
| 12 | use \Elementor\Group_Control_Typography as Group_Control_Typography; |
| 13 | use \Elementor\Scheme_Typography as Scheme_Typography; |
| 14 | use \Elementor\Widget_Base as Widget_Base; |
| 15 | |
| 16 | class Eael_WpForms extends Widget_Base { |
| 17 | use \Essential_Addons_Elementor\Traits\Helper; |
| 18 | |
| 19 | public function get_name() { |
| 20 | return 'eael-wpforms'; |
| 21 | } |
| 22 | |
| 23 | public function get_title() { |
| 24 | return __( 'EA WPForms', 'essential-addons-elementor' ); |
| 25 | } |
| 26 | |
| 27 | public function get_categories() { |
| 28 | return [ 'essential-addons-elementor' ]; |
| 29 | } |
| 30 | |
| 31 | public function get_icon() { |
| 32 | return 'fa fa-envelope-o'; |
| 33 | } |
| 34 | |
| 35 | protected function _register_controls() { |
| 36 | |
| 37 | /*-----------------------------------------------------------------------------------*/ |
| 38 | /* Content Tab |
| 39 | /*-----------------------------------------------------------------------------------*/ |
| 40 | |
| 41 | $this->start_controls_section( |
| 42 | 'section_info_box', |
| 43 | [ |
| 44 | 'label' => __( 'WPForms', 'essential-addons-elementor' ), |
| 45 | ] |
| 46 | ); |
| 47 | |
| 48 | $this->add_control( |
| 49 | 'contact_form_list', |
| 50 | [ |
| 51 | 'label' => esc_html__( 'Select Form', 'essential-addons-elementor' ), |
| 52 | 'type' => Controls_Manager::SELECT, |
| 53 | 'label_block' => true, |
| 54 | 'options' => $this->eael_select_wpforms_forms(), |
| 55 | 'default' => '0', |
| 56 | ] |
| 57 | ); |
| 58 | |
| 59 | $this->add_control( |
| 60 | 'custom_title_description', |
| 61 | [ |
| 62 | 'label' => __( 'Custom Title & Description', 'essential-addons-elementor' ), |
| 63 | 'type' => Controls_Manager::SWITCHER, |
| 64 | 'label_on' => __( 'Yes', 'essential-addons-elementor' ), |
| 65 | 'label_off' => __( 'No', 'essential-addons-elementor' ), |
| 66 | 'return_value' => 'yes', |
| 67 | ] |
| 68 | ); |
| 69 | |
| 70 | $this->add_control( |
| 71 | 'form_title', |
| 72 | [ |
| 73 | 'label' => __( 'Title', 'essential-addons-elementor' ), |
| 74 | 'type' => Controls_Manager::SWITCHER, |
| 75 | 'default' => 'yes', |
| 76 | 'label_on' => __( 'Show', 'essential-addons-elementor' ), |
| 77 | 'label_off' => __( 'Hide', 'essential-addons-elementor' ), |
| 78 | 'return_value' => 'yes', |
| 79 | 'condition' => [ |
| 80 | 'custom_title_description!' => 'yes', |
| 81 | ], |
| 82 | ] |
| 83 | ); |
| 84 | |
| 85 | $this->add_control( |
| 86 | 'form_description', |
| 87 | [ |
| 88 | 'label' => __( 'Description', 'essential-addons-elementor' ), |
| 89 | 'type' => Controls_Manager::SWITCHER, |
| 90 | 'default' => 'yes', |
| 91 | 'label_on' => __( 'Show', 'essential-addons-elementor' ), |
| 92 | 'label_off' => __( 'Hide', 'essential-addons-elementor' ), |
| 93 | 'return_value' => 'yes', |
| 94 | 'condition' => [ |
| 95 | 'custom_title_description!' => 'yes', |
| 96 | ], |
| 97 | ] |
| 98 | ); |
| 99 | |
| 100 | $this->add_control( |
| 101 | 'form_title_custom', |
| 102 | [ |
| 103 | 'label' => esc_html__( 'Title', 'essential-addons-elementor' ), |
| 104 | 'type' => Controls_Manager::TEXT, |
| 105 | 'label_block' => true, |
| 106 | 'default' => '', |
| 107 | 'condition' => [ |
| 108 | 'custom_title_description' => 'yes', |
| 109 | ], |
| 110 | ] |
| 111 | ); |
| 112 | |
| 113 | $this->add_control( |
| 114 | 'form_description_custom', |
| 115 | [ |
| 116 | 'label' => esc_html__( 'Description', 'essential-addons-elementor' ), |
| 117 | 'type' => Controls_Manager::TEXTAREA, |
| 118 | 'default' => '', |
| 119 | 'condition' => [ |
| 120 | 'custom_title_description' => 'yes', |
| 121 | ], |
| 122 | ] |
| 123 | ); |
| 124 | |
| 125 | $this->add_control( |
| 126 | 'labels_switch', |
| 127 | [ |
| 128 | 'label' => __( 'Labels', 'essential-addons-elementor' ), |
| 129 | 'type' => Controls_Manager::SWITCHER, |
| 130 | 'default' => 'yes', |
| 131 | 'label_on' => __( 'Show', 'essential-addons-elementor' ), |
| 132 | 'label_off' => __( 'Hide', 'essential-addons-elementor' ), |
| 133 | 'return_value' => 'yes', |
| 134 | 'prefix_class' => 'eael-wpforms-labels-', |
| 135 | ] |
| 136 | ); |
| 137 | |
| 138 | $this->add_control( |
| 139 | 'placeholder_switch', |
| 140 | [ |
| 141 | 'label' => __( 'Placeholder', 'essential-addons-elementor' ), |
| 142 | 'type' => Controls_Manager::SWITCHER, |
| 143 | 'default' => 'yes', |
| 144 | 'label_on' => __( 'Show', 'essential-addons-elementor' ), |
| 145 | 'label_off' => __( 'Hide', 'essential-addons-elementor' ), |
| 146 | 'return_value' => 'yes', |
| 147 | ] |
| 148 | ); |
| 149 | |
| 150 | $this->end_controls_section(); |
| 151 | |
| 152 | /** |
| 153 | * Content Tab: Errors |
| 154 | * ------------------------------------------------- |
| 155 | */ |
| 156 | $this->start_controls_section( |
| 157 | 'section_errors', |
| 158 | [ |
| 159 | 'label' => __( 'Errors', 'essential-addons-elementor' ), |
| 160 | ] |
| 161 | ); |
| 162 | |
| 163 | $this->add_control( |
| 164 | 'error_messages', |
| 165 | [ |
| 166 | 'label' => __( 'Error Messages', 'essential-addons-elementor' ), |
| 167 | 'type' => Controls_Manager::SELECT, |
| 168 | 'default' => 'show', |
| 169 | 'options' => [ |
| 170 | 'show' => __( 'Show', 'essential-addons-elementor' ), |
| 171 | 'hide' => __( 'Hide', 'essential-addons-elementor' ), |
| 172 | ], |
| 173 | 'selectors_dictionary' => [ |
| 174 | 'show' => 'block', |
| 175 | 'hide' => 'none', |
| 176 | ], |
| 177 | 'selectors' => [ |
| 178 | '{{WRAPPER}} .eael-wpforms label.wpforms-error' => 'display: {{VALUE}} !important;', |
| 179 | ], |
| 180 | ] |
| 181 | ); |
| 182 | |
| 183 | $this->end_controls_section(); |
| 184 | |
| 185 | /*-----------------------------------------------------------------------------------*/ |
| 186 | /* STYLE TAB |
| 187 | /*-----------------------------------------------------------------------------------*/ |
| 188 | |
| 189 | /** |
| 190 | * Style Tab: Form Container |
| 191 | * ------------------------------------------------- |
| 192 | */ |
| 193 | $this->start_controls_section( |
| 194 | 'section_container_style', |
| 195 | [ |
| 196 | 'label' => __( 'Form Container', 'essential-addons-elementor' ), |
| 197 | 'tab' => Controls_Manager::TAB_STYLE, |
| 198 | ] |
| 199 | ); |
| 200 | |
| 201 | $this->add_control( |
| 202 | 'eael_contact_form_background', |
| 203 | [ |
| 204 | 'label' => esc_html__( 'Form Background Color', 'essential-addons-elementor' ), |
| 205 | 'type' => Controls_Manager::COLOR, |
| 206 | 'selectors' => [ |
| 207 | '{{WRAPPER}} .eael-contact-form' => 'background: {{VALUE}};', |
| 208 | ], |
| 209 | ] |
| 210 | ); |
| 211 | |
| 212 | $this->add_responsive_control( |
| 213 | 'eael_contact_form_alignment', |
| 214 | [ |
| 215 | 'label' => esc_html__( 'Form Alignment', 'essential-addons-elementor' ), |
| 216 | 'type' => Controls_Manager::CHOOSE, |
| 217 | 'label_block' => true, |
| 218 | 'options' => [ |
| 219 | 'default' => [ |
| 220 | 'title' => __( 'Default', 'essential-addons-elementor' ), |
| 221 | 'icon' => 'fa fa-ban', |
| 222 | ], |
| 223 | 'left' => [ |
| 224 | 'title' => esc_html__( 'Left', 'essential-addons-elementor' ), |
| 225 | 'icon' => 'eicon-h-align-left', |
| 226 | ], |
| 227 | 'center' => [ |
| 228 | 'title' => esc_html__( 'Center', 'essential-addons-elementor' ), |
| 229 | 'icon' => 'eicon-h-align-center', |
| 230 | ], |
| 231 | 'right' => [ |
| 232 | 'title' => esc_html__( 'Right', 'essential-addons-elementor' ), |
| 233 | 'icon' => 'eicon-h-align-right', |
| 234 | ], |
| 235 | ], |
| 236 | 'default' => 'default', |
| 237 | ] |
| 238 | ); |
| 239 | |
| 240 | $this->add_responsive_control( |
| 241 | 'eael_contact_form_width', |
| 242 | [ |
| 243 | 'label' => esc_html__( 'Form Width', 'essential-addons-elementor' ), |
| 244 | 'type' => Controls_Manager::SLIDER, |
| 245 | 'size_units' => [ 'px', 'em', '%' ], |
| 246 | 'range' => [ |
| 247 | 'px' => [ |
| 248 | 'min' => 10, |
| 249 | 'max' => 1500, |
| 250 | ], |
| 251 | 'em' => [ |
| 252 | 'min' => 1, |
| 253 | 'max' => 80, |
| 254 | ], |
| 255 | ], |
| 256 | 'selectors' => [ |
| 257 | '{{WRAPPER}} .eael-contact-form' => 'width: {{SIZE}}{{UNIT}};', |
| 258 | ], |
| 259 | ] |
| 260 | ); |
| 261 | |
| 262 | $this->add_responsive_control( |
| 263 | 'eael_contact_form_max_width', |
| 264 | [ |
| 265 | 'label' => esc_html__( 'Form Max Width', 'essential-addons-elementor' ), |
| 266 | 'type' => Controls_Manager::SLIDER, |
| 267 | 'size_units' => [ 'px', 'em', '%' ], |
| 268 | 'range' => [ |
| 269 | 'px' => [ |
| 270 | 'min' => 10, |
| 271 | 'max' => 1500, |
| 272 | ], |
| 273 | 'em' => [ |
| 274 | 'min' => 1, |
| 275 | 'max' => 80, |
| 276 | ], |
| 277 | ], |
| 278 | 'selectors' => [ |
| 279 | '{{WRAPPER}} .eael-contact-form' => 'max-width: {{SIZE}}{{UNIT}};', |
| 280 | ], |
| 281 | ] |
| 282 | ); |
| 283 | |
| 284 | |
| 285 | $this->add_responsive_control( |
| 286 | 'eael_contact_form_margin', |
| 287 | [ |
| 288 | 'label' => esc_html__( 'Form Margin', 'essential-addons-elementor' ), |
| 289 | 'type' => Controls_Manager::DIMENSIONS, |
| 290 | 'size_units' => [ 'px', 'em', '%' ], |
| 291 | 'selectors' => [ |
| 292 | '{{WRAPPER}} .eael-contact-form' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 293 | ], |
| 294 | ] |
| 295 | ); |
| 296 | |
| 297 | $this->add_responsive_control( |
| 298 | 'eael_contact_form_padding', |
| 299 | [ |
| 300 | 'label' => esc_html__( 'Form Padding', 'essential-addons-elementor' ), |
| 301 | 'type' => Controls_Manager::DIMENSIONS, |
| 302 | 'size_units' => [ 'px', 'em', '%' ], |
| 303 | 'selectors' => [ |
| 304 | '{{WRAPPER}} .eael-contact-form' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 305 | ], |
| 306 | ] |
| 307 | ); |
| 308 | |
| 309 | |
| 310 | $this->add_control( |
| 311 | 'eael_contact_form_border_radius', |
| 312 | [ |
| 313 | 'label' => esc_html__( 'Border Radius', 'essential-addons-elementor' ), |
| 314 | 'type' => Controls_Manager::DIMENSIONS, |
| 315 | 'separator' => 'before', |
| 316 | 'size_units' => [ 'px' ], |
| 317 | 'selectors' => [ |
| 318 | '{{WRAPPER}} .eael-contact-form' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 319 | ], |
| 320 | ] |
| 321 | ); |
| 322 | |
| 323 | |
| 324 | $this->add_group_control( |
| 325 | Group_Control_Border::get_type(), |
| 326 | [ |
| 327 | 'name' => 'eael_contact_form_border', |
| 328 | 'selector' => '{{WRAPPER}} .eael-contact-form', |
| 329 | ] |
| 330 | ); |
| 331 | |
| 332 | |
| 333 | $this->add_group_control( |
| 334 | Group_Control_Box_Shadow::get_type(), |
| 335 | [ |
| 336 | 'name' => 'eael_contact_form_box_shadow', |
| 337 | 'selector' => '{{WRAPPER}} .eael-contact-form', |
| 338 | ] |
| 339 | ); |
| 340 | |
| 341 | $this->end_controls_section(); |
| 342 | |
| 343 | |
| 344 | /** |
| 345 | * Style Tab: Form Title & Description |
| 346 | * ------------------------------------------------- |
| 347 | */ |
| 348 | $this->start_controls_section( |
| 349 | 'section_form_title_style', |
| 350 | [ |
| 351 | 'label' => __( 'Title & Description', 'essential-addons-elementor' ), |
| 352 | 'tab' => Controls_Manager::TAB_STYLE, |
| 353 | ] |
| 354 | ); |
| 355 | |
| 356 | $this->add_responsive_control( |
| 357 | 'heading_alignment', |
| 358 | [ |
| 359 | 'label' => __( 'Alignment', 'essential-addons-elementor' ), |
| 360 | 'type' => Controls_Manager::CHOOSE, |
| 361 | 'options' => [ |
| 362 | 'left' => [ |
| 363 | 'title' => __( 'Left', 'essential-addons-elementor' ), |
| 364 | 'icon' => 'fa fa-align-left', |
| 365 | ], |
| 366 | 'center' => [ |
| 367 | 'title' => __( 'Center', 'essential-addons-elementor' ), |
| 368 | 'icon' => 'fa fa-align-center', |
| 369 | ], |
| 370 | 'right' => [ |
| 371 | 'title' => __( 'Right', 'essential-addons-elementor' ), |
| 372 | 'icon' => 'fa fa-align-right', |
| 373 | ], |
| 374 | ], |
| 375 | 'default' => '', |
| 376 | 'selectors' => [ |
| 377 | '{{WRAPPER}} .wpforms-head-container, {{WRAPPER}} .eael-wpforms-heading' => 'text-align: {{VALUE}};', |
| 378 | ], |
| 379 | ] |
| 380 | ); |
| 381 | |
| 382 | $this->add_control( |
| 383 | 'title_heading', |
| 384 | [ |
| 385 | 'label' => __( 'Title', 'essential-addons-elementor' ), |
| 386 | 'type' => Controls_Manager::HEADING, |
| 387 | 'separator' => 'before', |
| 388 | ] |
| 389 | ); |
| 390 | |
| 391 | $this->add_control( |
| 392 | 'form_title_text_color', |
| 393 | [ |
| 394 | 'label' => __( 'Text Color', 'essential-addons-elementor' ), |
| 395 | 'type' => Controls_Manager::COLOR, |
| 396 | 'default' => '', |
| 397 | 'selectors' => [ |
| 398 | '{{WRAPPER}} .eael-contact-form-title, {{WRAPPER}} .wpforms-title' => 'color: {{VALUE}}', |
| 399 | ], |
| 400 | ] |
| 401 | ); |
| 402 | |
| 403 | $this->add_group_control( |
| 404 | Group_Control_Typography::get_type(), |
| 405 | [ |
| 406 | 'name' => 'form_title_typography', |
| 407 | 'label' => __( 'Typography', 'essential-addons-elementor' ), |
| 408 | 'selector' => '{{WRAPPER}} .eael-contact-form-title, {{WRAPPER}} .wpforms-title', |
| 409 | ] |
| 410 | ); |
| 411 | |
| 412 | $this->add_responsive_control( |
| 413 | 'form_title_margin', |
| 414 | [ |
| 415 | 'label' => __( 'Margin', 'essential-addons-elementor' ), |
| 416 | 'type' => Controls_Manager::DIMENSIONS, |
| 417 | 'size_units' => [ 'px', 'em', '%' ], |
| 418 | 'allowed_dimensions' => 'vertical', |
| 419 | 'placeholder' => [ |
| 420 | 'top' => '', |
| 421 | 'right' => 'auto', |
| 422 | 'bottom' => '', |
| 423 | 'left' => 'auto', |
| 424 | ], |
| 425 | 'selectors' => [ |
| 426 | '{{WRAPPER}} .eael-contact-form-title, {{WRAPPER}} .wpforms-title' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 427 | ], |
| 428 | ] |
| 429 | ); |
| 430 | |
| 431 | $this->add_control( |
| 432 | 'description_heading', |
| 433 | [ |
| 434 | 'label' => __( 'Description', 'essential-addons-elementor' ), |
| 435 | 'type' => Controls_Manager::HEADING, |
| 436 | 'separator' => 'before', |
| 437 | ] |
| 438 | ); |
| 439 | |
| 440 | $this->add_control( |
| 441 | 'form_description_text_color', |
| 442 | [ |
| 443 | 'label' => __( 'Text Color', 'essential-addons-elementor' ), |
| 444 | 'type' => Controls_Manager::COLOR, |
| 445 | 'default' => '', |
| 446 | 'selectors' => [ |
| 447 | '{{WRAPPER}} .eael-contact-form-description, {{WRAPPER}} .wpforms-description' => 'color: {{VALUE}}', |
| 448 | ], |
| 449 | ] |
| 450 | ); |
| 451 | |
| 452 | $this->add_group_control( |
| 453 | Group_Control_Typography::get_type(), |
| 454 | [ |
| 455 | 'name' => 'form_description_typography', |
| 456 | 'label' => __( 'Typography', 'essential-addons-elementor' ), |
| 457 | 'scheme' => Scheme_Typography::TYPOGRAPHY_4, |
| 458 | 'selector' => '{{WRAPPER}} .eael-contact-form-description, {{WRAPPER}} .wpforms-description', |
| 459 | ] |
| 460 | ); |
| 461 | |
| 462 | $this->add_responsive_control( |
| 463 | 'form_description_margin', |
| 464 | [ |
| 465 | 'label' => __( 'Margin', 'essential-addons-elementor' ), |
| 466 | 'type' => Controls_Manager::DIMENSIONS, |
| 467 | 'size_units' => [ 'px', 'em', '%' ], |
| 468 | 'allowed_dimensions' => 'vertical', |
| 469 | 'placeholder' => [ |
| 470 | 'top' => '', |
| 471 | 'right' => 'auto', |
| 472 | 'bottom' => '', |
| 473 | 'left' => 'auto', |
| 474 | ], |
| 475 | 'selectors' => [ |
| 476 | '{{WRAPPER}} .eael-contact-form-description, {{WRAPPER}} .wpforms-description' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 477 | ], |
| 478 | ] |
| 479 | ); |
| 480 | |
| 481 | $this->end_controls_section(); |
| 482 | |
| 483 | /** |
| 484 | * Style Tab: Labels |
| 485 | * ------------------------------------------------- |
| 486 | */ |
| 487 | $this->start_controls_section( |
| 488 | 'section_label_style', |
| 489 | [ |
| 490 | 'label' => __( 'Labels', 'essential-addons-elementor' ), |
| 491 | 'tab' => Controls_Manager::TAB_STYLE, |
| 492 | ] |
| 493 | ); |
| 494 | |
| 495 | $this->add_control( |
| 496 | 'text_color_label', |
| 497 | [ |
| 498 | 'label' => __( 'Text Color', 'essential-addons-elementor' ), |
| 499 | 'type' => Controls_Manager::COLOR, |
| 500 | 'selectors' => [ |
| 501 | '{{WRAPPER}} .eael-wpforms .wpforms-field label' => 'color: {{VALUE}}', |
| 502 | ], |
| 503 | ] |
| 504 | ); |
| 505 | |
| 506 | $this->add_group_control( |
| 507 | Group_Control_Typography::get_type(), |
| 508 | [ |
| 509 | 'name' => 'typography_label', |
| 510 | 'label' => __( 'Typography', 'essential-addons-elementor' ), |
| 511 | 'scheme' => Scheme_Typography::TYPOGRAPHY_4, |
| 512 | 'selector' => '{{WRAPPER}} .eael-wpforms .wpforms-field label', |
| 513 | ] |
| 514 | ); |
| 515 | |
| 516 | $this->end_controls_section(); |
| 517 | |
| 518 | /** |
| 519 | * Style Tab: Input & Textarea |
| 520 | * ------------------------------------------------- |
| 521 | */ |
| 522 | $this->start_controls_section( |
| 523 | 'section_fields_style', |
| 524 | [ |
| 525 | 'label' => __( 'Input & Textarea', 'essential-addons-elementor' ), |
| 526 | 'tab' => Controls_Manager::TAB_STYLE, |
| 527 | ] |
| 528 | ); |
| 529 | |
| 530 | $this->add_responsive_control( |
| 531 | 'input_alignment', |
| 532 | [ |
| 533 | 'label' => __( 'Alignment', 'essential-addons-elementor' ), |
| 534 | 'type' => Controls_Manager::CHOOSE, |
| 535 | 'options' => [ |
| 536 | 'left' => [ |
| 537 | 'title' => __( 'Left', 'essential-addons-elementor' ), |
| 538 | 'icon' => 'fa fa-align-left', |
| 539 | ], |
| 540 | 'center' => [ |
| 541 | 'title' => __( 'Center', 'essential-addons-elementor' ), |
| 542 | 'icon' => 'fa fa-align-center', |
| 543 | ], |
| 544 | 'right' => [ |
| 545 | 'title' => __( 'Right', 'essential-addons-elementor' ), |
| 546 | 'icon' => 'fa fa-align-right', |
| 547 | ], |
| 548 | ], |
| 549 | 'default' => '', |
| 550 | 'selectors' => [ |
| 551 | '{{WRAPPER}} .eael-wpforms .wpforms-field input:not([type=radio]):not([type=checkbox]):not([type=submit]):not([type=button]):not([type=image]):not([type=file]), {{WRAPPER}} .eael-wpforms .wpforms-field textarea, {{WRAPPER}} .eael-wpforms .wpforms-field select' => 'text-align: {{VALUE}};', |
| 552 | ], |
| 553 | ] |
| 554 | ); |
| 555 | |
| 556 | $this->start_controls_tabs( 'tabs_fields_style' ); |
| 557 | |
| 558 | $this->start_controls_tab( |
| 559 | 'tab_fields_normal', |
| 560 | [ |
| 561 | 'label' => __( 'Normal', 'essential-addons-elementor' ), |
| 562 | ] |
| 563 | ); |
| 564 | |
| 565 | $this->add_control( |
| 566 | 'field_bg_color', |
| 567 | [ |
| 568 | 'label' => __( 'Background Color', 'essential-addons-elementor' ), |
| 569 | 'type' => Controls_Manager::COLOR, |
| 570 | 'default' => '', |
| 571 | 'selectors' => [ |
| 572 | '{{WRAPPER}} .eael-wpforms .wpforms-field input:not([type=radio]):not([type=checkbox]):not([type=submit]):not([type=button]):not([type=image]):not([type=file]), {{WRAPPER}} .eael-wpforms .wpforms-field textarea, {{WRAPPER}} .eael-wpforms .wpforms-field select' => 'background-color: {{VALUE}}', |
| 573 | ], |
| 574 | ] |
| 575 | ); |
| 576 | |
| 577 | $this->add_control( |
| 578 | 'field_text_color', |
| 579 | [ |
| 580 | 'label' => __( 'Text Color', 'essential-addons-elementor' ), |
| 581 | 'type' => Controls_Manager::COLOR, |
| 582 | 'default' => '', |
| 583 | 'selectors' => [ |
| 584 | '{{WRAPPER}} .eael-wpforms .wpforms-field input:not([type=radio]):not([type=checkbox]):not([type=submit]):not([type=button]):not([type=image]):not([type=file]), {{WRAPPER}} .eael-wpforms .wpforms-field textarea, {{WRAPPER}} .eael-wpforms .wpforms-field select' => 'color: {{VALUE}}', |
| 585 | ], |
| 586 | ] |
| 587 | ); |
| 588 | |
| 589 | $this->add_group_control( |
| 590 | Group_Control_Border::get_type(), |
| 591 | [ |
| 592 | 'name' => 'field_border', |
| 593 | 'label' => __( 'Border', 'essential-addons-elementor' ), |
| 594 | 'placeholder' => '1px', |
| 595 | 'default' => '1px', |
| 596 | 'selector' => '{{WRAPPER}} .eael-wpforms .wpforms-field input:not([type=radio]):not([type=checkbox]):not([type=submit]):not([type=button]):not([type=image]):not([type=file]), {{WRAPPER}} .eael-wpforms .wpforms-field textarea, {{WRAPPER}} .eael-wpforms .wpforms-field select', |
| 597 | 'separator' => 'before', |
| 598 | ] |
| 599 | ); |
| 600 | |
| 601 | $this->add_control( |
| 602 | 'field_radius', |
| 603 | [ |
| 604 | 'label' => __( 'Border Radius', 'essential-addons-elementor' ), |
| 605 | 'type' => Controls_Manager::DIMENSIONS, |
| 606 | 'size_units' => [ 'px', 'em', '%' ], |
| 607 | 'selectors' => [ |
| 608 | '{{WRAPPER}} .eael-wpforms .wpforms-field input:not([type=radio]):not([type=checkbox]):not([type=submit]):not([type=button]):not([type=image]):not([type=file]), {{WRAPPER}} .eael-wpforms .wpforms-field textarea, {{WRAPPER}} .eael-wpforms .wpforms-field select' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 609 | ], |
| 610 | ] |
| 611 | ); |
| 612 | |
| 613 | $this->add_responsive_control( |
| 614 | 'text_indent', |
| 615 | [ |
| 616 | 'label' => __( 'Text Indent', 'essential-addons-elementor' ), |
| 617 | 'type' => Controls_Manager::SLIDER, |
| 618 | 'range' => [ |
| 619 | 'px' => [ |
| 620 | 'min' => 0, |
| 621 | 'max' => 60, |
| 622 | 'step' => 1, |
| 623 | ], |
| 624 | '%' => [ |
| 625 | 'min' => 0, |
| 626 | 'max' => 30, |
| 627 | 'step' => 1, |
| 628 | ], |
| 629 | ], |
| 630 | 'size_units' => [ 'px', 'em', '%' ], |
| 631 | 'selectors' => [ |
| 632 | '{{WRAPPER}} .eael-wpforms .wpforms-field input:not([type=radio]):not([type=checkbox]):not([type=submit]):not([type=button]):not([type=image]):not([type=file]), {{WRAPPER}} .eael-wpforms .wpforms-field textarea, {{WRAPPER}} .eael-wpforms .wpforms-field select' => 'text-indent: {{SIZE}}{{UNIT}}', |
| 633 | ], |
| 634 | 'separator' => 'before', |
| 635 | ] |
| 636 | ); |
| 637 | |
| 638 | $this->add_responsive_control( |
| 639 | 'input_width', |
| 640 | [ |
| 641 | 'label' => __( 'Input Width', 'essential-addons-elementor' ), |
| 642 | 'type' => Controls_Manager::SLIDER, |
| 643 | 'range' => [ |
| 644 | 'px' => [ |
| 645 | 'min' => 0, |
| 646 | 'max' => 1200, |
| 647 | 'step' => 1, |
| 648 | ], |
| 649 | ], |
| 650 | 'size_units' => [ 'px', 'em', '%' ], |
| 651 | 'selectors' => [ |
| 652 | '{{WRAPPER}} .eael-wpforms .wpforms-field input:not([type=radio]):not([type=checkbox]):not([type=submit]):not([type=button]):not([type=image]):not([type=file]), {{WRAPPER}} .eael-wpforms .wpforms-field select' => 'width: {{SIZE}}{{UNIT}}', |
| 653 | ], |
| 654 | ] |
| 655 | ); |
| 656 | |
| 657 | $this->add_responsive_control( |
| 658 | 'input_height', |
| 659 | [ |
| 660 | 'label' => __( 'Input Height', 'essential-addons-elementor' ), |
| 661 | 'type' => Controls_Manager::SLIDER, |
| 662 | 'range' => [ |
| 663 | 'px' => [ |
| 664 | 'min' => 0, |
| 665 | 'max' => 80, |
| 666 | 'step' => 1, |
| 667 | ], |
| 668 | ], |
| 669 | 'size_units' => [ 'px', 'em', '%' ], |
| 670 | 'selectors' => [ |
| 671 | '{{WRAPPER}} .eael-wpforms .wpforms-field input:not([type=radio]):not([type=checkbox]):not([type=submit]):not([type=button]):not([type=image]):not([type=file]), {{WRAPPER}} .eael-wpforms .wpforms-field select' => 'height: {{SIZE}}{{UNIT}}', |
| 672 | ], |
| 673 | ] |
| 674 | ); |
| 675 | |
| 676 | $this->add_responsive_control( |
| 677 | 'textarea_width', |
| 678 | [ |
| 679 | 'label' => __( 'Textarea Width', 'essential-addons-elementor' ), |
| 680 | 'type' => Controls_Manager::SLIDER, |
| 681 | 'range' => [ |
| 682 | 'px' => [ |
| 683 | 'min' => 0, |
| 684 | 'max' => 1200, |
| 685 | 'step' => 1, |
| 686 | ], |
| 687 | ], |
| 688 | 'size_units' => [ 'px', 'em', '%' ], |
| 689 | 'selectors' => [ |
| 690 | '{{WRAPPER}} .eael-wpforms .wpforms-field textarea' => 'width: {{SIZE}}{{UNIT}}', |
| 691 | ], |
| 692 | ] |
| 693 | ); |
| 694 | |
| 695 | $this->add_responsive_control( |
| 696 | 'textarea_height', |
| 697 | [ |
| 698 | 'label' => __( 'Textarea Height', 'essential-addons-elementor' ), |
| 699 | 'type' => Controls_Manager::SLIDER, |
| 700 | 'range' => [ |
| 701 | 'px' => [ |
| 702 | 'min' => 0, |
| 703 | 'max' => 400, |
| 704 | 'step' => 1, |
| 705 | ], |
| 706 | ], |
| 707 | 'size_units' => [ 'px', 'em', '%' ], |
| 708 | 'selectors' => [ |
| 709 | '{{WRAPPER}} .eael-wpforms .wpforms-field textarea' => 'height: {{SIZE}}{{UNIT}}', |
| 710 | ], |
| 711 | ] |
| 712 | ); |
| 713 | |
| 714 | $this->add_responsive_control( |
| 715 | 'field_padding', |
| 716 | [ |
| 717 | 'label' => __( 'Padding', 'essential-addons-elementor' ), |
| 718 | 'type' => Controls_Manager::DIMENSIONS, |
| 719 | 'size_units' => [ 'px', 'em', '%' ], |
| 720 | 'selectors' => [ |
| 721 | '{{WRAPPER}} .eael-wpforms .wpforms-field input:not([type=radio]):not([type=checkbox]):not([type=submit]):not([type=button]):not([type=image]):not([type=file]), {{WRAPPER}} .eael-wpforms .wpforms-field textarea, {{WRAPPER}} .eael-wpforms .wpforms-field select' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 722 | ], |
| 723 | 'separator' => 'before', |
| 724 | ] |
| 725 | ); |
| 726 | |
| 727 | $this->add_responsive_control( |
| 728 | 'field_spacing', |
| 729 | [ |
| 730 | 'label' => __( 'Spacing', 'essential-addons-elementor' ), |
| 731 | 'type' => Controls_Manager::SLIDER, |
| 732 | 'range' => [ |
| 733 | 'px' => [ |
| 734 | 'min' => 0, |
| 735 | 'max' => 100, |
| 736 | 'step' => 1, |
| 737 | ], |
| 738 | ], |
| 739 | 'size_units' => [ 'px', 'em', '%' ], |
| 740 | 'selectors' => [ |
| 741 | '{{WRAPPER}} .eael-wpforms .wpforms-field' => 'margin-bottom: {{SIZE}}{{UNIT}}', |
| 742 | ], |
| 743 | ] |
| 744 | ); |
| 745 | |
| 746 | $this->add_group_control( |
| 747 | Group_Control_Typography::get_type(), |
| 748 | [ |
| 749 | 'name' => 'field_typography', |
| 750 | 'label' => __( 'Typography', 'essential-addons-elementor' ), |
| 751 | 'scheme' => Scheme_Typography::TYPOGRAPHY_4, |
| 752 | 'selector' => '{{WRAPPER}} .eael-wpforms .wpforms-field input:not([type=radio]):not([type=checkbox]):not([type=submit]):not([type=button]):not([type=image]):not([type=file]), {{WRAPPER}} .eael-wpforms .wpforms-field textarea, {{WRAPPER}} .eael-wpforms .wpforms-field select', |
| 753 | 'separator' => 'before', |
| 754 | ] |
| 755 | ); |
| 756 | |
| 757 | $this->add_group_control( |
| 758 | Group_Control_Box_Shadow::get_type(), |
| 759 | [ |
| 760 | 'name' => 'field_box_shadow', |
| 761 | 'selector' => '{{WRAPPER}} .eael-wpforms .wpforms-field input:not([type=radio]):not([type=checkbox]):not([type=submit]):not([type=button]):not([type=image]):not([type=file]), {{WRAPPER}} .eael-wpforms .wpforms-field textarea, {{WRAPPER}} .eael-wpforms .wpforms-field select', |
| 762 | 'separator' => 'before', |
| 763 | ] |
| 764 | ); |
| 765 | |
| 766 | $this->end_controls_tab(); |
| 767 | |
| 768 | $this->start_controls_tab( |
| 769 | 'tab_fields_focus', |
| 770 | [ |
| 771 | 'label' => __( 'Focus', 'essential-addons-elementor' ), |
| 772 | ] |
| 773 | ); |
| 774 | |
| 775 | $this->add_group_control( |
| 776 | Group_Control_Border::get_type(), |
| 777 | [ |
| 778 | 'name' => 'focus_input_border', |
| 779 | 'label' => __( 'Border', 'essential-addons-elementor' ), |
| 780 | 'placeholder' => '1px', |
| 781 | 'default' => '1px', |
| 782 | 'selector' => '{{WRAPPER}} .eael-wpforms .wpforms-field input:focus, {{WRAPPER}} .eael-wpforms .wpforms-field textarea:focus', |
| 783 | ] |
| 784 | ); |
| 785 | |
| 786 | $this->add_group_control( |
| 787 | Group_Control_Box_Shadow::get_type(), |
| 788 | [ |
| 789 | 'name' => 'focus_box_shadow', |
| 790 | 'selector' => '{{WRAPPER}} .eael-wpforms .wpforms-field input:focus, {{WRAPPER}} .eael-wpforms .wpforms-field textarea:focus', |
| 791 | 'separator' => 'before', |
| 792 | ] |
| 793 | ); |
| 794 | |
| 795 | $this->end_controls_tab(); |
| 796 | |
| 797 | $this->end_controls_tabs(); |
| 798 | |
| 799 | $this->end_controls_section(); |
| 800 | |
| 801 | /** |
| 802 | * Style Tab: Field Description |
| 803 | * ------------------------------------------------- |
| 804 | */ |
| 805 | $this->start_controls_section( |
| 806 | 'section_field_description_style', |
| 807 | [ |
| 808 | 'label' => __( 'Field Description', 'essential-addons-elementor' ), |
| 809 | 'tab' => Controls_Manager::TAB_STYLE, |
| 810 | ] |
| 811 | ); |
| 812 | |
| 813 | $this->add_control( |
| 814 | 'field_description_text_color', |
| 815 | [ |
| 816 | 'label' => __( 'Text Color', 'essential-addons-elementor' ), |
| 817 | 'type' => Controls_Manager::COLOR, |
| 818 | 'selectors' => [ |
| 819 | '{{WRAPPER}} .eael-wpforms .wpforms-field .wpforms-field-description, {{WRAPPER}} .eael-wpforms .wpforms-field .wpforms-field-sublabel' => 'color: {{VALUE}}', |
| 820 | ], |
| 821 | ] |
| 822 | ); |
| 823 | |
| 824 | $this->add_group_control( |
| 825 | Group_Control_Typography::get_type(), |
| 826 | [ |
| 827 | 'name' => 'field_description_typography', |
| 828 | 'label' => __( 'Typography', 'essential-addons-elementor' ), |
| 829 | 'selector' => '{{WRAPPER}} .eael-wpforms .wpforms-field .wpforms-field-description, {{WRAPPER}} .eael-wpforms .wpforms-field .wpforms-field-sublabel', |
| 830 | ] |
| 831 | ); |
| 832 | |
| 833 | $this->add_responsive_control( |
| 834 | 'field_description_spacing', |
| 835 | [ |
| 836 | 'label' => __( 'Spacing', 'essential-addons-elementor' ), |
| 837 | 'type' => Controls_Manager::SLIDER, |
| 838 | 'range' => [ |
| 839 | 'px' => [ |
| 840 | 'min' => 0, |
| 841 | 'max' => 100, |
| 842 | 'step' => 1, |
| 843 | ], |
| 844 | ], |
| 845 | 'size_units' => [ 'px', 'em', '%' ], |
| 846 | 'selectors' => [ |
| 847 | '{{WRAPPER}} .eael-wpforms .wpforms-field .wpforms-field-description, {{WRAPPER}} .eael-wpforms .wpforms-field .wpforms-field-sublabel' => 'padding-top: {{SIZE}}{{UNIT}}', |
| 848 | ], |
| 849 | ] |
| 850 | ); |
| 851 | |
| 852 | $this->end_controls_section(); |
| 853 | |
| 854 | /** |
| 855 | * Style Tab: Placeholder |
| 856 | * ------------------------------------------------- |
| 857 | */ |
| 858 | $this->start_controls_section( |
| 859 | 'section_placeholder_style', |
| 860 | [ |
| 861 | 'label' => __( 'Placeholder', 'essential-addons-elementor' ), |
| 862 | 'tab' => Controls_Manager::TAB_STYLE, |
| 863 | 'condition' => [ |
| 864 | 'placeholder_switch' => 'yes', |
| 865 | ], |
| 866 | ] |
| 867 | ); |
| 868 | |
| 869 | $this->add_control( |
| 870 | 'text_color_placeholder', |
| 871 | [ |
| 872 | 'label' => __( 'Text Color', 'essential-addons-elementor' ), |
| 873 | 'type' => Controls_Manager::COLOR, |
| 874 | 'selectors' => [ |
| 875 | '{{WRAPPER}} .eael-wpforms .wpforms-field input::-webkit-input-placeholder, {{WRAPPER}} .eael-wpforms .wpforms-field textarea::-webkit-input-placeholder' => 'color: {{VALUE}}', |
| 876 | ], |
| 877 | 'condition' => [ |
| 878 | 'placeholder_switch' => 'yes', |
| 879 | ], |
| 880 | ] |
| 881 | ); |
| 882 | |
| 883 | $this->end_controls_section(); |
| 884 | |
| 885 | /** |
| 886 | * Style Tab: Radio & Checkbox |
| 887 | * ------------------------------------------------- |
| 888 | */ |
| 889 | $this->start_controls_section( |
| 890 | 'section_radio_checkbox_style', |
| 891 | [ |
| 892 | 'label' => __( 'Radio & Checkbox', 'essential-addons-elementor' ), |
| 893 | 'tab' => Controls_Manager::TAB_STYLE, |
| 894 | ] |
| 895 | ); |
| 896 | |
| 897 | $this->add_control( |
| 898 | 'custom_radio_checkbox', |
| 899 | [ |
| 900 | 'label' => __( 'Custom Styles', 'essential-addons-elementor' ), |
| 901 | 'type' => Controls_Manager::SWITCHER, |
| 902 | 'label_on' => __( 'Yes', 'essential-addons-elementor' ), |
| 903 | 'label_off' => __( 'No', 'essential-addons-elementor' ), |
| 904 | 'return_value' => 'yes', |
| 905 | ] |
| 906 | ); |
| 907 | |
| 908 | $this->add_responsive_control( |
| 909 | 'radio_checkbox_size', |
| 910 | [ |
| 911 | 'label' => __( 'Size', 'essential-addons-elementor' ), |
| 912 | 'type' => Controls_Manager::SLIDER, |
| 913 | 'default' => [ |
| 914 | 'size' => '15', |
| 915 | 'unit' => 'px' |
| 916 | ], |
| 917 | 'range' => [ |
| 918 | 'px' => [ |
| 919 | 'min' => 0, |
| 920 | 'max' => 80, |
| 921 | 'step' => 1, |
| 922 | ], |
| 923 | ], |
| 924 | 'size_units' => [ 'px', 'em', '%' ], |
| 925 | 'selectors' => [ |
| 926 | '{{WRAPPER}} .eael-custom-radio-checkbox input[type="checkbox"], {{WRAPPER}} .eael-custom-radio-checkbox input[type="radio"]' => 'width: {{SIZE}}{{UNIT}} !important; height: {{SIZE}}{{UNIT}}', |
| 927 | ], |
| 928 | 'condition' => [ |
| 929 | 'custom_radio_checkbox' => 'yes', |
| 930 | ], |
| 931 | ] |
| 932 | ); |
| 933 | |
| 934 | $this->start_controls_tabs( 'tabs_radio_checkbox_style' ); |
| 935 | |
| 936 | $this->start_controls_tab( |
| 937 | 'radio_checkbox_normal', |
| 938 | [ |
| 939 | 'label' => __( 'Normal', 'essential-addons-elementor' ), |
| 940 | 'condition' => [ |
| 941 | 'custom_radio_checkbox' => 'yes', |
| 942 | ], |
| 943 | ] |
| 944 | ); |
| 945 | |
| 946 | $this->add_control( |
| 947 | 'radio_checkbox_color', |
| 948 | [ |
| 949 | 'label' => __( 'Color', 'essential-addons-elementor' ), |
| 950 | 'type' => Controls_Manager::COLOR, |
| 951 | 'default' => '', |
| 952 | 'selectors' => [ |
| 953 | '{{WRAPPER}} .eael-custom-radio-checkbox input[type="checkbox"], {{WRAPPER}} .eael-custom-radio-checkbox input[type="radio"]' => 'background: {{VALUE}}', |
| 954 | ], |
| 955 | 'condition' => [ |
| 956 | 'custom_radio_checkbox' => 'yes', |
| 957 | ], |
| 958 | ] |
| 959 | ); |
| 960 | |
| 961 | $this->add_responsive_control( |
| 962 | 'radio_checkbox_border_width', |
| 963 | [ |
| 964 | 'label' => __( 'Border Width', 'essential-addons-elementor' ), |
| 965 | 'type' => Controls_Manager::SLIDER, |
| 966 | 'range' => [ |
| 967 | 'px' => [ |
| 968 | 'min' => 0, |
| 969 | 'max' => 15, |
| 970 | 'step' => 1, |
| 971 | ], |
| 972 | ], |
| 973 | 'size_units' => [ 'px' ], |
| 974 | 'selectors' => [ |
| 975 | '{{WRAPPER}} .eael-custom-radio-checkbox input[type="checkbox"], {{WRAPPER}} .eael-custom-radio-checkbox input[type="radio"]' => 'border-width: {{SIZE}}{{UNIT}}', |
| 976 | ], |
| 977 | 'condition' => [ |
| 978 | 'custom_radio_checkbox' => 'yes', |
| 979 | ], |
| 980 | ] |
| 981 | ); |
| 982 | |
| 983 | $this->add_control( |
| 984 | 'radio_checkbox_border_color', |
| 985 | [ |
| 986 | 'label' => __( 'Border Color', 'essential-addons-elementor' ), |
| 987 | 'type' => Controls_Manager::COLOR, |
| 988 | 'default' => '', |
| 989 | 'selectors' => [ |
| 990 | '{{WRAPPER}} .eael-custom-radio-checkbox input[type="checkbox"], {{WRAPPER}} .eael-custom-radio-checkbox input[type="radio"]' => 'border-color: {{VALUE}}', |
| 991 | ], |
| 992 | 'condition' => [ |
| 993 | 'custom_radio_checkbox' => 'yes', |
| 994 | ], |
| 995 | ] |
| 996 | ); |
| 997 | |
| 998 | $this->add_control( |
| 999 | 'checkbox_heading', |
| 1000 | [ |
| 1001 | 'label' => __( 'Checkbox', 'essential-addons-elementor' ), |
| 1002 | 'type' => Controls_Manager::HEADING, |
| 1003 | 'condition' => [ |
| 1004 | 'custom_radio_checkbox' => 'yes', |
| 1005 | ], |
| 1006 | ] |
| 1007 | ); |
| 1008 | |
| 1009 | $this->add_control( |
| 1010 | 'checkbox_border_radius', |
| 1011 | [ |
| 1012 | 'label' => __( 'Border Radius', 'essential-addons-elementor' ), |
| 1013 | 'type' => Controls_Manager::DIMENSIONS, |
| 1014 | 'size_units' => [ 'px', 'em', '%' ], |
| 1015 | 'selectors' => [ |
| 1016 | '{{WRAPPER}} .eael-custom-radio-checkbox input[type="checkbox"], {{WRAPPER}} .eael-custom-radio-checkbox input[type="checkbox"]:before' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 1017 | ], |
| 1018 | 'condition' => [ |
| 1019 | 'custom_radio_checkbox' => 'yes', |
| 1020 | ], |
| 1021 | ] |
| 1022 | ); |
| 1023 | |
| 1024 | $this->add_control( |
| 1025 | 'radio_heading', |
| 1026 | [ |
| 1027 | 'label' => __( 'Radio Buttons', 'essential-addons-elementor' ), |
| 1028 | 'type' => Controls_Manager::HEADING, |
| 1029 | 'condition' => [ |
| 1030 | 'custom_radio_checkbox' => 'yes', |
| 1031 | ], |
| 1032 | ] |
| 1033 | ); |
| 1034 | |
| 1035 | $this->add_control( |
| 1036 | 'radio_border_radius', |
| 1037 | [ |
| 1038 | 'label' => __( 'Border Radius', 'essential-addons-elementor' ), |
| 1039 | 'type' => Controls_Manager::DIMENSIONS, |
| 1040 | 'size_units' => [ 'px', 'em', '%' ], |
| 1041 | 'selectors' => [ |
| 1042 | '{{WRAPPER}} .eael-custom-radio-checkbox input[type="radio"], {{WRAPPER}} .eael-custom-radio-checkbox input[type="radio"]:before' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 1043 | ], |
| 1044 | 'condition' => [ |
| 1045 | 'custom_radio_checkbox' => 'yes', |
| 1046 | ], |
| 1047 | ] |
| 1048 | ); |
| 1049 | |
| 1050 | $this->end_controls_tab(); |
| 1051 | |
| 1052 | $this->start_controls_tab( |
| 1053 | 'radio_checkbox_checked', |
| 1054 | [ |
| 1055 | 'label' => __( 'Checked', 'essential-addons-elementor' ), |
| 1056 | 'condition' => [ |
| 1057 | 'custom_radio_checkbox' => 'yes', |
| 1058 | ], |
| 1059 | ] |
| 1060 | ); |
| 1061 | |
| 1062 | $this->add_control( |
| 1063 | 'radio_checkbox_color_checked', |
| 1064 | [ |
| 1065 | 'label' => __( 'Color', 'essential-addons-elementor' ), |
| 1066 | 'type' => Controls_Manager::COLOR, |
| 1067 | 'default' => '', |
| 1068 | 'selectors' => [ |
| 1069 | '{{WRAPPER}} .eael-custom-radio-checkbox input[type="checkbox"]:checked:before, {{WRAPPER}} .eael-custom-radio-checkbox input[type="radio"]:checked:before' => 'background: {{VALUE}}', |
| 1070 | ], |
| 1071 | 'condition' => [ |
| 1072 | 'custom_radio_checkbox' => 'yes', |
| 1073 | ], |
| 1074 | ] |
| 1075 | ); |
| 1076 | |
| 1077 | $this->end_controls_tab(); |
| 1078 | |
| 1079 | $this->end_controls_tabs(); |
| 1080 | |
| 1081 | $this->end_controls_section(); |
| 1082 | |
| 1083 | /** |
| 1084 | * Style Tab: Submit Button |
| 1085 | * ------------------------------------------------- |
| 1086 | */ |
| 1087 | $this->start_controls_section( |
| 1088 | 'section_submit_button_style', |
| 1089 | [ |
| 1090 | 'label' => __( 'Submit Button', 'essential-addons-elementor' ), |
| 1091 | 'tab' => Controls_Manager::TAB_STYLE, |
| 1092 | ] |
| 1093 | ); |
| 1094 | |
| 1095 | $this->add_responsive_control( |
| 1096 | 'button_align', |
| 1097 | [ |
| 1098 | 'label' => __( 'Alignment', 'essential-addons-elementor' ), |
| 1099 | 'type' => Controls_Manager::CHOOSE, |
| 1100 | 'options' => [ |
| 1101 | 'left' => [ |
| 1102 | 'title' => __( 'Left', 'essential-addons-elementor' ), |
| 1103 | 'icon' => 'eicon-h-align-left', |
| 1104 | ], |
| 1105 | 'center' => [ |
| 1106 | 'title' => __( 'Center', 'essential-addons-elementor' ), |
| 1107 | 'icon' => 'eicon-h-align-center', |
| 1108 | ], |
| 1109 | 'right' => [ |
| 1110 | 'title' => __( 'Right', 'essential-addons-elementor' ), |
| 1111 | 'icon' => 'eicon-h-align-right', |
| 1112 | ], |
| 1113 | ], |
| 1114 | 'default' => '', |
| 1115 | 'selectors' => [ |
| 1116 | '{{WRAPPER}} .eael-wpforms .wpforms-submit-container' => 'text-align: {{VALUE}};', |
| 1117 | '{{WRAPPER}} .eael-wpforms .wpforms-submit-container .wpforms-submit' => 'display:inline-block;' |
| 1118 | ], |
| 1119 | 'condition' => [ |
| 1120 | 'button_width_type' => 'custom', |
| 1121 | ], |
| 1122 | ] |
| 1123 | ); |
| 1124 | |
| 1125 | $this->add_control( |
| 1126 | 'button_width_type', |
| 1127 | [ |
| 1128 | 'label' => __( 'Width', 'essential-addons-elementor' ), |
| 1129 | 'type' => Controls_Manager::SELECT, |
| 1130 | 'default' => 'custom', |
| 1131 | 'options' => [ |
| 1132 | 'full-width' => __( 'Full Width', 'essential-addons-elementor' ), |
| 1133 | 'custom' => __( 'Custom', 'essential-addons-elementor' ), |
| 1134 | ], |
| 1135 | 'prefix_class' => 'eael-wpforms-form-button-', |
| 1136 | ] |
| 1137 | ); |
| 1138 | |
| 1139 | $this->add_responsive_control( |
| 1140 | 'button_width', |
| 1141 | [ |
| 1142 | 'label' => __( 'Width', 'essential-addons-elementor' ), |
| 1143 | 'type' => Controls_Manager::SLIDER, |
| 1144 | 'range' => [ |
| 1145 | 'px' => [ |
| 1146 | 'min' => 0, |
| 1147 | 'max' => 1200, |
| 1148 | 'step' => 1, |
| 1149 | ], |
| 1150 | ], |
| 1151 | 'size_units' => [ 'px', '%' ], |
| 1152 | 'selectors' => [ |
| 1153 | '{{WRAPPER}} .eael-wpforms .wpforms-submit-container .wpforms-submit' => 'width: {{SIZE}}{{UNIT}}', |
| 1154 | ], |
| 1155 | 'condition' => [ |
| 1156 | 'button_width_type' => 'custom', |
| 1157 | ], |
| 1158 | ] |
| 1159 | ); |
| 1160 | |
| 1161 | $this->start_controls_tabs( 'tabs_button_style' ); |
| 1162 | |
| 1163 | $this->start_controls_tab( |
| 1164 | 'tab_button_normal', |
| 1165 | [ |
| 1166 | 'label' => __( 'Normal', 'essential-addons-elementor' ), |
| 1167 | ] |
| 1168 | ); |
| 1169 | |
| 1170 | $this->add_control( |
| 1171 | 'button_bg_color_normal', |
| 1172 | [ |
| 1173 | 'label' => __( 'Background Color', 'essential-addons-elementor' ), |
| 1174 | 'type' => Controls_Manager::COLOR, |
| 1175 | 'default' => '', |
| 1176 | 'selectors' => [ |
| 1177 | '{{WRAPPER}} .eael-wpforms .wpforms-submit-container .wpforms-submit' => 'background-color: {{VALUE}}', |
| 1178 | ], |
| 1179 | ] |
| 1180 | ); |
| 1181 | |
| 1182 | $this->add_control( |
| 1183 | 'button_text_color_normal', |
| 1184 | [ |
| 1185 | 'label' => __( 'Text Color', 'essential-addons-elementor' ), |
| 1186 | 'type' => Controls_Manager::COLOR, |
| 1187 | 'default' => '', |
| 1188 | 'selectors' => [ |
| 1189 | '{{WRAPPER}} .eael-wpforms .wpforms-submit-container .wpforms-submit' => 'color: {{VALUE}}', |
| 1190 | ], |
| 1191 | ] |
| 1192 | ); |
| 1193 | |
| 1194 | $this->add_group_control( |
| 1195 | Group_Control_Border::get_type(), |
| 1196 | [ |
| 1197 | 'name' => 'button_border_normal', |
| 1198 | 'label' => __( 'Border', 'essential-addons-elementor' ), |
| 1199 | 'placeholder' => '1px', |
| 1200 | 'default' => '1px', |
| 1201 | 'selector' => '{{WRAPPER}} .eael-wpforms .wpforms-submit-container .wpforms-submit', |
| 1202 | ] |
| 1203 | ); |
| 1204 | |
| 1205 | $this->add_control( |
| 1206 | 'button_border_radius', |
| 1207 | [ |
| 1208 | 'label' => __( 'Border Radius', 'essential-addons-elementor' ), |
| 1209 | 'type' => Controls_Manager::DIMENSIONS, |
| 1210 | 'size_units' => [ 'px', 'em', '%' ], |
| 1211 | 'selectors' => [ |
| 1212 | '{{WRAPPER}} .eael-wpforms .wpforms-submit-container .wpforms-submit' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 1213 | ], |
| 1214 | ] |
| 1215 | ); |
| 1216 | |
| 1217 | $this->add_responsive_control( |
| 1218 | 'button_padding', |
| 1219 | [ |
| 1220 | 'label' => __( 'Padding', 'essential-addons-elementor' ), |
| 1221 | 'type' => Controls_Manager::DIMENSIONS, |
| 1222 | 'size_units' => [ 'px', 'em', '%' ], |
| 1223 | 'selectors' => [ |
| 1224 | '{{WRAPPER}} .eael-wpforms .wpforms-submit-container .wpforms-submit' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', |
| 1225 | ], |
| 1226 | ] |
| 1227 | ); |
| 1228 | |
| 1229 | $this->add_responsive_control( |
| 1230 | 'button_margin', |
| 1231 | [ |
| 1232 | 'label' => __( 'Margin Top', 'essential-addons-elementor' ), |
| 1233 | 'type' => Controls_Manager::SLIDER, |
| 1234 | 'range' => [ |
| 1235 | 'px' => [ |
| 1236 | 'min' => 0, |
| 1237 | 'max' => 100, |
| 1238 | 'step' => 1, |
| 1239 | ], |
| 1240 | ], |
| 1241 | 'size_units' => [ 'px', 'em', '%' ], |
| 1242 | 'selectors' => [ |
| 1243 | '{{WRAPPER}} .eael-wpforms .wpforms-submit-container' => 'margin-top: {{SIZE}}{{UNIT}}', |
| 1244 | ], |
| 1245 | ] |
| 1246 | ); |
| 1247 | |
| 1248 | $this->add_group_control( |
| 1249 | Group_Control_Typography::get_type(), |
| 1250 | [ |
| 1251 | 'name' => 'button_typography', |
| 1252 | 'label' => __( 'Typography', 'essential-addons-elementor' ), |
| 1253 | 'scheme' => Scheme_Typography::TYPOGRAPHY_4, |
| 1254 | 'selector' => '{{WRAPPER}} .eael-wpforms .wpforms-submit-container .wpforms-submit', |
| 1255 | 'separator' => 'before', |
| 1256 | ] |
| 1257 | ); |
| 1258 | |
| 1259 | $this->add_group_control( |
| 1260 | Group_Control_Box_Shadow::get_type(), |
| 1261 | [ |
| 1262 | 'name' => 'button_box_shadow', |
| 1263 | 'selector' => '{{WRAPPER}} .eael-wpforms .wpforms-submit-container .wpforms-submit', |
| 1264 | 'separator' => 'before', |
| 1265 | ] |
| 1266 | ); |
| 1267 | |
| 1268 | $this->end_controls_tab(); |
| 1269 | |
| 1270 | $this->start_controls_tab( |
| 1271 | 'tab_button_hover', |
| 1272 | [ |
| 1273 | 'label' => __( 'Hover', 'essential-addons-elementor' ), |
| 1274 | ] |
| 1275 | ); |
| 1276 | |
| 1277 | $this->add_control( |
| 1278 | 'button_bg_color_hover', |
| 1279 | [ |
| 1280 | 'label' => __( 'Background Color', 'essential-addons-elementor' ), |
| 1281 | 'type' => Controls_Manager::COLOR, |
| 1282 | 'default' => '', |
| 1283 | 'selectors' => [ |
| 1284 | '{{WRAPPER}} .eael-wpforms .wpforms-submit-container .wpforms-submit:hover' => 'background-color: {{VALUE}}', |
| 1285 | ], |
| 1286 | ] |
| 1287 | ); |
| 1288 | |
| 1289 | $this->add_control( |
| 1290 | 'button_text_color_hover', |
| 1291 | [ |
| 1292 | 'label' => __( 'Text Color', 'essential-addons-elementor' ), |
| 1293 | 'type' => Controls_Manager::COLOR, |
| 1294 | 'default' => '', |
| 1295 | 'selectors' => [ |
| 1296 | '{{WRAPPER}} .eael-wpforms .wpforms-submit-container .wpforms-submit:hover' => 'color: {{VALUE}}', |
| 1297 | ], |
| 1298 | ] |
| 1299 | ); |
| 1300 | |
| 1301 | $this->add_control( |
| 1302 | 'button_border_color_hover', |
| 1303 | [ |
| 1304 | 'label' => __( 'Border Color', 'essential-addons-elementor' ), |
| 1305 | 'type' => Controls_Manager::COLOR, |
| 1306 | 'default' => '', |
| 1307 | 'selectors' => [ |
| 1308 | '{{WRAPPER}} .eael-wpforms .wpforms-submit-container .wpforms-submit:hover' => 'border-color: {{VALUE}}', |
| 1309 | ], |
| 1310 | ] |
| 1311 | ); |
| 1312 | |
| 1313 | $this->end_controls_tab(); |
| 1314 | |
| 1315 | $this->end_controls_tabs(); |
| 1316 | |
| 1317 | $this->end_controls_section(); |
| 1318 | |
| 1319 | /** |
| 1320 | * Style Tab: Errors |
| 1321 | * ------------------------------------------------- |
| 1322 | */ |
| 1323 | $this->start_controls_section( |
| 1324 | 'section_error_style', |
| 1325 | [ |
| 1326 | 'label' => __( 'Errors', 'essential-addons-elementor' ), |
| 1327 | 'tab' => Controls_Manager::TAB_STYLE, |
| 1328 | 'condition' => [ |
| 1329 | 'error_messages' => 'show', |
| 1330 | ], |
| 1331 | ] |
| 1332 | ); |
| 1333 | |
| 1334 | $this->add_control( |
| 1335 | 'error_message_text_color', |
| 1336 | [ |
| 1337 | 'label' => __( 'Text Color', 'essential-addons-elementor' ), |
| 1338 | 'type' => Controls_Manager::COLOR, |
| 1339 | 'default' => '', |
| 1340 | 'selectors' => [ |
| 1341 | '{{WRAPPER}} .eael-wpforms label.wpforms-error' => 'color: {{VALUE}}', |
| 1342 | ], |
| 1343 | 'condition' => [ |
| 1344 | 'error_messages' => 'show', |
| 1345 | ], |
| 1346 | ] |
| 1347 | ); |
| 1348 | |
| 1349 | $this->add_control( |
| 1350 | 'error_field_input_border_color', |
| 1351 | [ |
| 1352 | 'label' => __( 'Error Field Input Border Color', 'essential-addons-elementor' ), |
| 1353 | 'type' => Controls_Manager::COLOR, |
| 1354 | 'default' => '', |
| 1355 | 'selectors' => [ |
| 1356 | '{{WRAPPER}} .eael-wpforms input.wpforms-error, {{WRAPPER}} .eael-wpforms textarea.wpforms-error' => 'border-color: {{VALUE}}', |
| 1357 | ], |
| 1358 | 'condition' => [ |
| 1359 | 'error_messages' => 'show', |
| 1360 | ], |
| 1361 | ] |
| 1362 | ); |
| 1363 | |
| 1364 | $this->add_control( |
| 1365 | 'error_field_input_border_width', |
| 1366 | [ |
| 1367 | 'label' => __( 'Error Field Input Border Width', 'essential-addons-elementor' ), |
| 1368 | 'type' => Controls_Manager::NUMBER, |
| 1369 | 'default' => 1, |
| 1370 | 'min' => 1, |
| 1371 | 'max' => 10, |
| 1372 | 'step' => 1, |
| 1373 | 'selectors' => [ |
| 1374 | '{{WRAPPER}} .eael-wpforms input.wpforms-error, {{WRAPPER}} .eael-wpforms textarea.wpforms-error' => 'border-width: {{VALUE}}px', |
| 1375 | ], |
| 1376 | 'condition' => [ |
| 1377 | 'error_messages' => 'show', |
| 1378 | ], |
| 1379 | ] |
| 1380 | ); |
| 1381 | |
| 1382 | $this->end_controls_section(); |
| 1383 | } |
| 1384 | |
| 1385 | protected function render() { |
| 1386 | $settings = $this->get_settings(); |
| 1387 | |
| 1388 | $this->add_render_attribute( 'contact-form', 'class', [ |
| 1389 | 'eael-contact-form', |
| 1390 | 'eael-wpforms', |
| 1391 | ] |
| 1392 | ); |
| 1393 | |
| 1394 | if ( $settings['placeholder_switch'] != 'yes' ) { |
| 1395 | $this->add_render_attribute( 'contact-form', 'class', 'placeholder-hide' ); |
| 1396 | } |
| 1397 | |
| 1398 | if ( $settings['custom_title_description'] == 'yes' ) { |
| 1399 | $this->add_render_attribute( 'contact-form', 'class', 'title-description-hide' ); |
| 1400 | } |
| 1401 | |
| 1402 | if ( $settings['custom_radio_checkbox'] == 'yes' ) { |
| 1403 | $this->add_render_attribute( 'contact-form', 'class', 'eael-custom-radio-checkbox' ); |
| 1404 | } |
| 1405 | if ( $settings['eael_contact_form_alignment'] == 'left' ) { |
| 1406 | $this->add_render_attribute( 'contact-form', 'class', 'eael-contact-form-align-left' ); |
| 1407 | } |
| 1408 | elseif ( $settings['eael_contact_form_alignment'] == 'center' ) { |
| 1409 | $this->add_render_attribute( 'contact-form', 'class', 'eael-contact-form-align-center' ); |
| 1410 | } |
| 1411 | elseif ( $settings['eael_contact_form_alignment'] == 'right' ) { |
| 1412 | $this->add_render_attribute( 'contact-form', 'class', 'eael-contact-form-align-right' ); |
| 1413 | } |
| 1414 | else { |
| 1415 | $this->add_render_attribute( 'contact-form', 'class', 'eael-contact-form-align-default' ); |
| 1416 | } |
| 1417 | |
| 1418 | if ( class_exists( '\WPForms\WPForms' ) ) { |
| 1419 | if ( ! empty( $settings['contact_form_list'] ) ) { ?> |
| 1420 | <div <?php echo $this->get_render_attribute_string( 'contact-form' ); ?>> |
| 1421 | <?php if ( $settings['custom_title_description'] == 'yes' ) { ?> |
| 1422 | <div class="eael-wpforms-heading"> |
| 1423 | <?php if ( $settings['form_title_custom'] != '' ) { ?> |
| 1424 | <h3 class="eael-contact-form-title eael-wpforms-title"> |
| 1425 | <?php echo esc_attr( $settings['form_title_custom'] ); ?> |
| 1426 | </h3> |
| 1427 | <?php } ?> |
| 1428 | <?php if ( $settings['form_description_custom'] != '' ) { ?> |
| 1429 | <div class="eael-contact-form-description eael-wpforms-description"> |
| 1430 | <?php echo $this->parse_text_editor( $settings['form_description_custom'] ); ?> |
| 1431 | </div> |
| 1432 | <?php } ?> |
| 1433 | </div> |
| 1434 | <?php } ?> |
| 1435 | <?php |
| 1436 | $eael_form_title = $settings['form_title']; |
| 1437 | $eael_form_description = $settings['form_description']; |
| 1438 | |
| 1439 | if ( $settings['custom_title_description'] == 'yes' ) { |
| 1440 | $eael_form_title = false; |
| 1441 | $eael_form_description = false; |
| 1442 | } |
| 1443 | |
| 1444 | echo wpforms_display( $settings['contact_form_list'], $eael_form_title, $eael_form_description ); |
| 1445 | ?> |
| 1446 | </div> |
| 1447 | <?php |
| 1448 | } |
| 1449 | } |
| 1450 | } |
| 1451 | |
| 1452 | protected function _content_template() {} |
| 1453 | |
| 1454 | } |