ox input[type="radio"]' => 'border-color: {{VALUE}}', ], 'condition' => [ 'custom_radio_checkbox' => 'yes', ], ] ); $this->add_control( 'checkbox_heading', [ 'label' => __('Checkbox', 'essential-addons-for-elementor-lite'), 'type' => Controls_Manager::HEADING, 'condition' => [ 'custom_radio_checkbox' => 'yes', ], ] ); $this->add_control( 'checkbox_border_radius', [ 'label' => __('Border Radius', 'essential-addons-for-elementor-lite'), 'type' => Controls_Manager::DIMENSIONS, 'size_units' => ['px', 'em', '%'], 'selectors' => [ '{{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}};', ], 'condition' => [ 'custom_radio_checkbox' => 'yes', ], ] ); $this->add_control( 'radio_heading', [ 'label' => __('Radio Buttons', 'essential-addons-for-elementor-lite'), 'type' => Controls_Manager::HEADING, 'condition' => [ 'custom_radio_checkbox' => 'yes', ], ] ); $this->add_control( 'radio_border_radius', [ 'label' => __('Border Radius', 'essential-addons-for-elementor-lite'), 'type' => Controls_Manager::DIMENSIONS, 'size_units' => ['px', 'em', '%'], 'selectors' => [ '{{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}};', ], 'condition' => [ 'custom_radio_checkbox' => 'yes', ], ] ); $this->end_controls_tab(); $this->start_controls_tab( 'radio_checkbox_checked', [ 'label' => __('Checked', 'essential-addons-for-elementor-lite'), 'condition' => [ 'custom_radio_checkbox' => 'yes', ], ] ); $this->add_control( 'radio_checkbox_color_checked', [ 'label' => __('Color', 'essential-addons-for-elementor-lite'), 'type' => Controls_Manager::COLOR, 'default' => '', 'selectors' => [ '{{WRAPPER}} .eael-custom-radio-checkbox input[type="checkbox"]:checked:before, {{WRAPPER}} .eael-custom-radio-checkbox input[type="radio"]:checked:before' => 'background: {{VALUE}}', ], 'condition' => [ 'custom_radio_checkbox' => 'yes', ], ] ); $this->end_controls_tab(); $this->end_controls_tabs(); $this->end_controls_section(); /** * Style Tab: Submit Button */ $this->start_controls_section( 'section_submit_button_style', [ 'label' => __('Submit Button', 'essential-addons-for-elementor-lite'), 'tab' => Controls_Manager::TAB_STYLE, ] ); $this->add_responsive_control( 'button_align', [ 'label' => __('Alignment', 'essential-addons-for-elementor-lite'), 'type' => Controls_Manager::CHOOSE, 'default' => 'left', 'options' => [ 'left' => [ 'title' => __('Left', 'essential-addons-for-elementor-lite'), 'icon' => 'eicon-h-align-left', ], 'center' => [ 'title' => __('Center', 'essential-addons-for-elementor-lite'), 'icon' => 'eicon-h-align-center', ], 'right' => [ 'title' => __('Right', 'essential-addons-for-elementor-lite'), 'icon' => 'eicon-h-align-right', ], ], 'prefix_class' => 'eael-contact-form-7-button-align-', 'condition' => [ 'button_width_type' => 'custom', ], ] ); $this->add_control( 'button_width_type', [ 'label' => __('Width', 'essential-addons-for-elementor-lite'), 'type' => Controls_Manager::SELECT, 'default' => 'custom', 'options' => [ 'full-width' => __('Full Width', 'essential-addons-for-elementor-lite'), 'custom' => __('Custom', 'essential-addons-for-elementor-lite'), ], 'prefix_class' => 'eael-contact-form-7-button-', ] ); $this->add_responsive_control( 'button_width', [ 'label' => __('Width', 'essential-addons-for-elementor-lite'), 'type' => Controls_Manager::SLIDER, 'range' => [ 'px' => [ 'min' => 0, 'max' => 1200, 'step' => 1, ], ], 'size_units' => ['px', 'em', '%'], 'selectors' => [ '{{WRAPPER}} .eael-contact-form-7 .wpcf7-form input[type="submit"]' => 'width: {{SIZE}}{{UNIT}}', ], 'condition' => [ 'button_width_type' => 'custom', ], ] ); $this->start_controls_tabs('tabs_button_style'); $this->start_controls_tab( 'tab_button_normal', [ 'label' => __('Normal', 'essential-addons-for-elementor-lite'), ] ); $this->add_control( 'button_bg_color_normal', [ 'label' => __('Background Color', 'essential-addons-for-elementor-lite'), 'type' => Controls_Manager::COLOR, 'default' => '', 'selectors' => [ '{{WRAPPER}} .eael-contact-form-7 .wpcf7-form input[type="submit"]' => 'background-color: {{VALUE}}', ], ] ); $this->add_control( 'button_text_color_normal', [ 'label' => __('Text Color', 'essential-addons-for-elementor-lite'), 'type' => Controls_Manager::COLOR, 'default' => '', 'selectors' => [ '{{WRAPPER}} .eael-contact-form-7 .wpcf7-form input[type="submit"]' => 'color: {{VALUE}}', ], ] ); $this->add_group_control( Group_Control_Border::get_type(), [ 'name' => 'button_border_normal', 'label' => __('Border', 'essential-addons-for-elementor-lite'), 'default' => '1px', 'selector' => '{{WRAPPER}} .eael-contact-form-7 .wpcf7-form input[type="submit"]', ] ); $this->add_control( 'button_border_radius', [ 'label' => __('Border Radius', 'essential-addons-for-elementor-lite'), 'type' => Controls_Manager::DIMENSIONS, 'size_units' => ['px', 'em', '%'], 'selectors' => [ '{{WRAPPER}} .eael-contact-form-7 .wpcf7-form input[type="submit"]' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ], ] ); $this->add_responsive_control( 'button_padding', [ 'label' => __('Padding', 'essential-addons-for-elementor-lite'), 'type' => Controls_Manager::DIMENSIONS, 'size_units' => ['px', 'em', '%'], 'selectors' => [ '{{WRAPPER}} .eael-contact-form-7 .wpcf7-form input[type="submit"]' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ], ] ); $this->add_responsive_control( 'button_margin', [ 'label' => __('Margin Top', 'essential-addons-for-elementor-lite'), 'type' => Controls_Manager::SLIDER, 'range' => [ 'px' => [ 'min' => 0, 'max' => 100, 'step' => 1, ], ], 'size_units' => ['px', 'em', '%'], 'selectors' => [ '{{WRAPPER}} .eael-contact-form-7 .wpcf7-form input[type="submit"]' => 'margin-top: {{SIZE}}{{UNIT}}', ], ] ); $this->add_group_control( Group_Control_Typography::get_type(), [ 'name' => 'button_typography', 'label' => __('Typography', 'essential-addons-for-elementor-lite'), 'scheme' => Typography::TYPOGRAPHY_4, 'selector' => '{{WRAPPER}} .eael-contact-form-7 .wpcf7-form input[type="submit"]', 'separator' => 'before', ] ); $this->add_group_control( Group_Control_Box_Shadow::get_type(), [ 'name' => 'button_box_shadow', 'selector' => '{{WRAPPER}} .eael-contact-form-7 .wpcf7-form input[type="submit"]', 'separator' => 'before', ] ); $this->end_controls_tab(); $this->start_controls_tab( 'tab_button_hover', [ 'label' => __('Hover', 'essential-addons-for-elementor-lite'), ] ); $this->add_control( 'button_bg_color_hover', [ 'label' => __('Background Color', 'essential-addons-for-elementor-lite'), 'type' => Controls_Manager::COLOR, 'default' => '', 'selectors' => [ '{{WRAPPER}} .eael-contact-form-7 .wpcf7-form input[type="submit"]:hover' => 'background-color: {{VALUE}}', ], ] ); $this->add_control( 'button_text_color_hover', [ 'label' => __('Text Color', 'essential-addons-for-elementor-lite'), 'type' => Controls_Manager::COLOR, 'default' => '', 'selectors' => [ '{{WRAPPER}} .eael-contact-form-7 .wpcf7-form input[type="submit"]:hover' => 'color: {{VALUE}}', ], ] ); $this->add_control( 'button_border_color_hover', [ 'label' => __('Border Color', 'essential-addons-for-elementor-lite'), 'type' => Controls_Manager::COLOR, 'default' => '', 'selectors' => [ '{{WRAPPER}} .eael-contact-form-7 .wpcf7-form input[type="submit"]:hover' => 'border-color: {{VALUE}}', ], ] ); $this->end_controls_tab(); $this->end_controls_tabs(); $this->end_controls_section(); /** * Style Tab: Errors */ $this->start_controls_section( 'section_error_style', [ 'label' => __('Errors', 'essential-addons-for-elementor-lite'), 'tab' => Controls_Manager::TAB_STYLE, ] ); $this->add_control( 'error_messages_heading', [ 'label' => __('Error Messages', 'essential-addons-for-elementor-lite'), 'type' => Controls_Manager::HEADING, 'condition' => [ 'error_messages' => 'show', ], ] ); $this->start_controls_tabs('tabs_error_messages_style'); $this->start_controls_tab( 'tab_error_messages_alert', [ 'label' => __('Alert', 'essential-addons-for-elementor-lite'), 'condition' => [ 'error_messages' => 'show', ], ] ); $this->add_control( 'error_alert_text_color', [ 'label' => __('Text Color', 'essential-addons-for-elementor-lite'), 'type' => Controls_Manager::COLOR, 'default' => '', 'selectors' => [ '{{WRAPPER}} .eael-contact-form-7 .wpcf7-not-valid-tip' => 'color: {{VALUE}}', ], 'condition' => [ 'error_messages' => 'show', ], ] ); $this->add_control( 'error_alert_bg_color', [ 'label' => __('Background Color', 'essential-addons-for-elementor-lite'), 'type' => Controls_Manager::COLOR, 'default' => '', 'selectors' => [ '{{WRAPPER}} .eael-contact-form-7 .wpcf7-not-valid-tip' => 'background: {{VALUE}}', ], 'condition' => [ 'error_messages' => 'show', ], ] ); $this->add_group_control( Group_Control_Typography::get_type(), [ 'name' => 'error_alert_typography', 'label' => __('Typography', 'essential-addons-for-elementor-lite'), 'scheme' => Typography::TYPOGRAPHY_4, 'selector' => '{{WRAPPER}} .eael-contact-form-7 .wpcf7-not-valid-tip', 'separator' => 'before', 'condition' => [ 'error_messages' => 'show', ], ] ); $this->add_group_control( Group_Control_Border::get_type(), [ 'name' => 'error_alert_border', 'label' => __('Border', 'essential-addons-for-elementor-lite'), 'placeholder' => '1px', 'default' => '1px', 'selector' => '{{WRAPPER}} .eael-contact-form-7 .wpcf7-not-valid-tip', 'separator' => 'before', 'condition' => [ 'error_messages' => 'show', ], ] ); $this->add_responsive_control( 'error_alert_padding', [ 'label' => __('Padding', 'essential-addons-for-elementor-lite'), 'type' => Controls_Manager::DIMENSIONS, 'size_units' => ['px', 'em', '%'], 'selectors' => [ '{{WRAPPER}} .eael-contact-form-7 .wpcf7-not-valid-tip' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ], 'condition' => [ 'error_messages' => 'show', ], ] ); $this->add_responsive_control( 'error_alert_spacing', [ 'label' => __('Spacing', 'essential-addons-for-elementor-lite'), 'type' => Controls_Manager::SLIDER, 'range' => [ 'px' => [ 'min' => 0, 'max' => 100, 'step' => 1, ], ], 'size_units' => ['px', 'em', '%'], 'selectors' => [ '{{WRAPPER}} .eael-contact-form-7 .wpcf7-not-valid-tip' => 'margin-top: {{SIZE}}{{UNIT}}', ], 'condition' => [ 'error_messages' => 'show', ], ] ); $this->end_controls_tab(); $this->start_controls_tab( 'tab_error_messages_fields', [ 'label' => __('Fields', 'essential-addons-for-elementor-lite'), 'condition' => [ 'error_messages' => 'show', ], ] ); $this->add_control( 'error_field_bg_color', [ 'label' => __('Background Color', 'essential-addons-for-elementor-lite'), 'type' => Controls_Manager::COLOR, 'default' => '', 'selectors' => [ '{{WRAPPER}} .eael-contact-form-7 .wpcf7-not-valid' => 'background: {{VALUE}}', ], 'condition' => [ 'error_messages' => 'show', ], ] ); $this->add_control( 'error_field_color', [ 'label' => __('Text Color', 'essential-addons-for-elementor-lite'), 'type' => Controls_Manager::COLOR, 'default' => '', 'selectors' => [ '{{WRAPPER}} .eael-contact-form-7 .wpcf7-not-valid.wpcf7-text' => 'color: {{VALUE}}', ], 'condition' => [ 'error_messages' => 'show', ], ] ); $this->add_group_control( Group_Control_Border::get_type(), [ 'name' => 'error_field_border', 'label' => __('Border', 'essential-addons-for-elementor-lite'), 'placeholder' => '1px', 'default' => '1px', 'selector' => '{{WRAPPER}} .eael-contact-form-7 .wpcf7-not-valid', 'separator' => 'before', 'condition' => [ 'error_messages' => 'show', ], ] ); $this->end_controls_tab(); $this->end_controls_tabs(); $this->end_controls_section(); /** * Style Tab: After Submit Feedback */ $this->start_controls_section( 'section_after_submit_feedback_style', [ 'label' => __('After Submit Feedback', 'essential-addons-for-elementor-lite'), 'tab' => Controls_Manager::TAB_STYLE, ] ); $this->add_group_control( Group_Control_Typography::get_type(), [ 'name' => 'contact_form_after_submit_feedback_typography', 'label' => __('Typography', 'essential-addons-for-elementor-lite'), 'selector' => '{{WRAPPER}} .eael-contact-form-7 .wpcf7-mail-sent-ng, {{WRAPPER}} .eael-contact-form-7 .wpcf7-mail-sent-ok, {{WRAPPER}} .eael-contact-form-7 .wpcf7-response-output', 'separator' => 'before', ] ); $this->add_control( 'contact_form_after_submit_feedback_color', [ 'label' => __('Text Color', 'essential-addons-for-elementor-lite'), 'type' => Controls_Manager::COLOR, 'default' => '', 'selectors' => [ '{{WRAPPER}} .eael-contact-form-7 .wpcf7-mail-sent-ng' => 'color: {{VALUE}}', '{{WRAPPER}} .eael-contact-form-7 .wpcf7-mail-sent-ok' => 'color: {{VALUE}}', '{{WRAPPER}} .eael-contact-form-7 .wpcf7-response-output' => 'color: {{VALUE}}', ], ] ); $this->add_group_control( Group_Control_Background::get_type(), [ 'name' => 'contact_form_after_submit_feedback_background', 'label' => __('Background', 'essential-addons-for-elementor-lite'), 'types' => ['classic', 'gradient'], 'selector' => '{{WRAPPER}} .eael-contact-form-7 .wpcf7-mail-sent-ng, {{WRAPPER}} .eael-contact-form-7 .wpcf7-mail-sent-ok, {{WRAPPER}} .eael-contact-form-7 .wpcf7-response-output', 'separator' => 'before', ] ); $this->add_group_control( Group_Control_Border::get_type(), [ 'name' => 'contact_form_after_submit_feedback_border', 'label' => __('Border', 'essential-addons-for-elementor-lite'), 'placeholder' => '1px', 'default' => '1px', 'selector' => '{{WRAPPER}} .eael-contact-form-7 .wpcf7-mail-sent-ng, {{WRAPPER}} .eael-contact-form-7 .wpcf7-mail-sent-ok, {{WRAPPER}} .eael-contact-form-7 .wpcf7-response-output', 'separator' => 'before', ] ); $this->add_responsive_control( 'contact_form_after_submit_feedback_border_radius', [ 'label' => esc_html__('Radius', 'essential-addons-for-elementor-lite'), 'type' => Controls_Manager::SLIDER, 'size_units' => ['px', 'em', '%'], 'range' => [ 'px' => [ 'min' => 10, 'max' => 1500, ], 'em' => [ 'min' => 1, 'max' => 80, ], ], 'selectors' => [ '{{WRAPPER}} .eael-contact-form-7 .wpcf7-mail-sent-ng' => 'border-radius: {{SIZE}}{{UNIT}};', '{{WRAPPER}} .eael-contact-form-7 .wpcf7-mail-sent-ok' => 'border-radius: {{SIZE}}{{UNIT}};', '{{WRAPPER}} .eael-contact-form-7 .wpcf7-response-output' => 'border-radius: {{SIZE}}{{UNIT}};', ], ] ); $this->add_responsive_control( 'contact_form_after_submit_feedback_border_margin', [ 'label' => esc_html__('Margin', 'essential-addons-for-elementor-lite'), 'type' => Controls_Manager::DIMENSIONS, 'size_units' => ['px', 'em', '%'], 'selectors' => [ '{{WRAPPER}} .eael-contact-form-7 .wpcf7-mail-sent-ng' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', '{{WRAPPER}} .eael-contact-form-7 .wpcf7-mail-sent-ok' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', '{{WRAPPER}} .eael-contact-form-7 .wpcf7-response-output' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ], 'separator' => 'before', ] ); $this->add_responsive_control( 'contact_form_after_submit_feedback_border_padding', [ 'label' => esc_html__('Padding', 'essential-addons-for-elementor-lite'), 'type' => Controls_Manager::DIMENSIONS, 'size_units' => ['px', 'em', '%'], 'selectors' => [ '{{WRAPPER}} .eael-contact-form-7 .wpcf7-mail-sent-ng' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', '{{WRAPPER}} .eael-contact-form-7 .wpcf7-mail-sent-ok' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', '{{WRAPPER}} .eael-contact-form-7 .wpcf7-response-output' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', ], 'separator' => 'before', ] ); $this->end_controls_section(); } /** * @access protected */ protected function render() { if (!function_exists('wpcf7')) { return; } $settings = $this->get_settings_for_display(); $this->add_render_attribute('contact-form', 'class', [ 'eael-contact-form', 'eael-contact-form-7', 'eael-contact-form-' . esc_attr($this->get_id()), ]); if ($settings['labels_switch'] != 'yes') { $this->add_render_attribute('contact-form', 'class', 'labels-hide'); } if ($settings['placeholder_switch'] == 'yes') { $this->add_render_attribute('contact-form', 'class', 'placeholder-show'); } if ($settings['custom_radio_checkbox'] == 'yes') { $this->add_render_attribute('contact-form', 'class', 'eael-custom-radio-checkbox'); } if ($settings['eael_contact_form_alignment'] == 'left') { $this->add_render_attribute('contact-form', 'class', 'eael-contact-form-align-left'); } elseif ($settings['eael_contact_form_alignment'] == 'center') { $this->add_render_attribute('contact-form', 'class', 'eael-contact-form-align-center'); } elseif ($settings['eael_contact_form_alignment'] == 'right') { $this->add_render_attribute('contact-form', 'class', 'eael-contact-form-align-right'); } else { $this->add_render_attribute('contact-form', 'class', 'eael-contact-form-align-default'); } if (!empty($settings['contact_form_list'])) { echo '