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