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