register_content_section(); $this->register_settings_section(); $this->register_style_nav_section(); $this->register_style_content_section(); // Entrance animation — inherited from base $this->eppro_register_entrance_animation_controls(); } // ── Content ────────────────────────────────────────────────────────────── private function register_content_section(): void { $this->start_controls_section( 'section_tabs', [ 'label' => __( 'Tabs', 'admore-widgets-suite' ), 'tab' => Controls_Manager::TAB_CONTENT, ] ); $r = new Repeater(); $r->add_control( 'tab_title', [ 'label' => __( 'Title', 'admore-widgets-suite' ), 'type' => Controls_Manager::TEXT, 'default' => __( 'Tab', 'admore-widgets-suite' ), ] ); $r->add_control( 'tab_icon', [ 'label' => __( 'Icon', 'admore-widgets-suite' ), 'type' => Controls_Manager::ICONS, ] ); $r->add_control( 'content_type', [ 'label' => __( 'Content Type', 'admore-widgets-suite' ), 'type' => Controls_Manager::SELECT, 'default' => 'editor', 'options' => [ 'editor' => __( 'Text / Editor', 'admore-widgets-suite' ), 'template' => __( 'Elementor Template', 'admore-widgets-suite' ), ], ] ); $r->add_control( 'tab_content', [ 'label' => __( 'Content', 'admore-widgets-suite' ), 'type' => Controls_Manager::WYSIWYG, 'default' => __( 'Add tab content here.', 'admore-widgets-suite' ), 'condition' => [ 'content_type' => 'editor' ], ] ); $r->add_control( 'template_id', [ 'label' => __( 'Choose Template', 'admore-widgets-suite' ), 'type' => Controls_Manager::SELECT2, 'options' => $this->get_elementor_templates(), 'label_block' => true, 'condition' => [ 'content_type' => 'template' ], ] ); $this->add_control( 'tabs', [ 'type' => Controls_Manager::REPEATER, 'fields' => $r->get_controls(), 'default' => [ [ 'tab_title' => __( 'Overview', 'admore-widgets-suite' ), 'tab_content' => __( 'Add your overview content here. Describe the key features, benefits, or summary of this section.', 'admore-widgets-suite' ) ], [ 'tab_title' => __( 'Features', 'admore-widgets-suite' ), 'tab_content' => __( 'List your key features here. Each tab can contain rich text, images, or even an Elementor template.', 'admore-widgets-suite' ) ], [ 'tab_title' => __( 'Details', 'admore-widgets-suite' ), 'tab_content' => __( 'Include additional details, specifications, or any supporting information in this tab.', 'admore-widgets-suite' ) ], ], 'title_field' => '{{{ tab_title }}}', ] ); $this->end_controls_section(); } // ── Settings ───────────────────────────────────────────────────────────── private function register_settings_section(): void { $this->start_controls_section( 'section_settings', [ 'label' => __( 'Settings', 'admore-widgets-suite' ), 'tab' => Controls_Manager::TAB_CONTENT, ] ); $this->add_control( 'layout', [ 'label' => __( 'Layout', 'admore-widgets-suite' ), 'type' => Controls_Manager::SELECT, 'default' => 'horizontal', 'options' => [ 'horizontal' => __( 'Horizontal', 'admore-widgets-suite' ), 'vertical' => __( 'Vertical', 'admore-widgets-suite' ), ], ] ); $this->add_control( 'active_tab', [ 'label' => __( 'Default Active Tab (1-based)', 'admore-widgets-suite' ), 'type' => Controls_Manager::NUMBER, 'default' => 1, 'min' => 1, ] ); $this->add_control( 'icon_position', [ 'label' => __( 'Icon Position', 'admore-widgets-suite' ), 'type' => Controls_Manager::SELECT, 'default' => 'left', 'options' => [ 'left' => __( 'Left', 'admore-widgets-suite' ), 'right' => __( 'Right', 'admore-widgets-suite' ), 'top' => __( 'Top', 'admore-widgets-suite' ), ], ] ); $this->add_control( 'tab_alignment', [ 'label' => __( 'Tab Alignment', 'admore-widgets-suite' ), 'type' => Controls_Manager::CHOOSE, 'options' => [ 'flex-start' => [ 'title' => __( 'Start', 'admore-widgets-suite' ), 'icon' => 'eicon-text-align-left' ], 'center' => [ 'title' => __( 'Center', 'admore-widgets-suite' ), 'icon' => 'eicon-text-align-center' ], 'flex-end' => [ 'title' => __( 'End', 'admore-widgets-suite' ), 'icon' => 'eicon-text-align-right' ], 'stretch' => [ 'title' => __( 'Stretch','admore-widgets-suite' ), 'icon' => 'eicon-text-align-justify'], ], 'default' => 'flex-start', 'selectors' => [ '{{WRAPPER}} .eppro-tabs-nav' => 'justify-content: {{VALUE}};' ], 'condition' => [ 'layout' => 'horizontal' ], ] ); $this->add_control( 'url_hash', [ 'label' => __( 'URL Hash Support', 'admore-widgets-suite' ), 'type' => Controls_Manager::SWITCHER, 'default' => 'yes', 'description' => __( 'Enables linking directly to a tab via #tab-1', 'admore-widgets-suite' ), ] ); $this->add_control( 'mobile_accordion', [ 'label' => __( 'Mobile: Switch to Accordion', 'admore-widgets-suite' ), 'type' => Controls_Manager::SWITCHER, 'default' => 'yes', ] ); $this->add_control( 'content_animation', [ 'label' => __( 'Content Transition', 'admore-widgets-suite' ), 'type' => Controls_Manager::SELECT, 'default' => 'fade', 'options' => [ 'none' => __( 'None', 'admore-widgets-suite' ), 'fade' => __( 'Fade', 'admore-widgets-suite' ), 'slide-up' => __( 'Slide Up', 'admore-widgets-suite' ), 'slide-left' => __( 'Slide Left', 'admore-widgets-suite' ), ], 'separator' => 'before', ] ); $this->add_control( 'active_indicator', [ 'label' => __( 'Active Tab Indicator', 'admore-widgets-suite' ), 'type' => Controls_Manager::SELECT, 'default' => 'background', 'options' => [ 'background' => __( 'Filled Background', 'admore-widgets-suite' ), 'underline' => __( 'Underline', 'admore-widgets-suite' ), 'top-line' => __( 'Top Line', 'admore-widgets-suite' ), 'left-border' => __( 'Left Border (vertical layout)', 'admore-widgets-suite' ), ], 'separator' => 'before', ] ); $this->add_control( 'active_indicator_color', [ 'label' => __( 'Indicator Color', 'admore-widgets-suite' ), 'type' => Controls_Manager::COLOR, 'default' => EPPRO_Elementor_Helper::brand_color(), 'selectors' => [ '{{WRAPPER}} .eppro-ind-underline .eppro-tab-btn.active' => 'border-bottom: 3px solid {{VALUE}}; background: transparent;', '{{WRAPPER}} .eppro-ind-top-line .eppro-tab-btn.active' => 'border-top: 3px solid {{VALUE}}; background: transparent;', '{{WRAPPER}} .eppro-ind-left-border .eppro-tab-btn.active'=> 'border-left: 3px solid {{VALUE}}; background: transparent;', ], 'condition' => [ 'active_indicator!' => 'background' ], ] ); $this->add_control( 'active_indicator_thickness', [ 'label' => __( 'Indicator Thickness (px)', 'admore-widgets-suite' ), 'type' => Controls_Manager::SLIDER, 'size_units' => [ 'px' ], 'range' => [ 'px' => [ 'min' => 1, 'max' => 8 ] ], 'default' => [ 'size' => 3 ], 'selectors' => [ '{{WRAPPER}} .eppro-ind-underline .eppro-tab-btn.active' => 'border-bottom-width: {{SIZE}}{{UNIT}};', '{{WRAPPER}} .eppro-ind-top-line .eppro-tab-btn.active' => 'border-top-width: {{SIZE}}{{UNIT}};', '{{WRAPPER}} .eppro-ind-left-border .eppro-tab-btn.active'=> 'border-left-width: {{SIZE}}{{UNIT}};', ], 'condition' => [ 'active_indicator!' => 'background' ], ] ); $this->end_controls_section(); } // ── Style: Nav ─────────────────────────────────────────────────────────── private function register_style_nav_section(): void { $this->start_controls_section( 'style_nav', [ 'label' => __( 'Tab Navigation', 'admore-widgets-suite' ), 'tab' => Controls_Manager::TAB_STYLE, ] ); $this->add_control( 'tab_gap', [ 'label' => __( 'Tab Gap', 'admore-widgets-suite' ), 'type' => Controls_Manager::SLIDER, 'size_units' => [ 'px' ], 'range' => [ 'px' => [ 'min' => 0, 'max' => 40 ] ], 'default' => [ 'size' => 4 ], 'selectors' => [ '{{WRAPPER}} .eppro-tabs-nav' => 'gap: {{SIZE}}{{UNIT}};' ], ] ); $this->start_controls_tabs( 'tab_button_tabs' ); // Normal $this->start_controls_tab( 'tab_btn_normal', [ 'label' => __( 'Normal', 'admore-widgets-suite' ) ] ); $this->add_control( 'tab_bg', [ 'label' => __( 'Background', 'admore-widgets-suite' ), 'type' => Controls_Manager::COLOR, 'default' => '#f1f5f9', 'selectors' => [ '{{WRAPPER}} .eppro-tab-btn' => 'background: {{VALUE}};' ] ] ); $this->add_control( 'tab_color', [ 'label' => __( 'Text Color', 'admore-widgets-suite' ), 'type' => Controls_Manager::COLOR, 'default' => '#374151', 'selectors' => [ '{{WRAPPER}} .eppro-tab-btn' => 'color: {{VALUE}};', '{{WRAPPER}} .eppro-tab-btn i' => 'color: {{VALUE}};', '{{WRAPPER}} .eppro-tab-btn svg' => 'fill: {{VALUE}};' ] ] ); $this->end_controls_tab(); // Hover $this->start_controls_tab( 'tab_btn_hover', [ 'label' => __( 'Hover', 'admore-widgets-suite' ) ] ); $this->add_control( 'tab_bg_hover', [ 'label' => __( 'Background', 'admore-widgets-suite' ), 'type' => Controls_Manager::COLOR, 'default' => '#e2e8f0', 'selectors' => [ '{{WRAPPER}} .eppro-tab-btn:hover' => 'background: {{VALUE}};' ] ] ); $this->add_control( 'tab_color_hover', [ 'label' => __( 'Text Color', 'admore-widgets-suite' ), 'type' => Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} .eppro-tab-btn:hover' => 'color: {{VALUE}};' ] ] ); $this->end_controls_tab(); // Active $this->start_controls_tab( 'tab_btn_active', [ 'label' => __( 'Active', 'admore-widgets-suite' ) ] ); $this->add_control( 'tab_bg_active', [ 'label' => __( 'Background', 'admore-widgets-suite' ), 'type' => Controls_Manager::COLOR, 'default' => EPPRO_Elementor_Helper::brand_color(), 'selectors' => [ '{{WRAPPER}} .eppro-tab-btn.active' => 'background: {{VALUE}};' ] ] ); $this->add_control( 'tab_color_active', [ 'label' => __( 'Text Color', 'admore-widgets-suite' ), 'type' => Controls_Manager::COLOR, 'default' => '#ffffff', 'selectors' => [ '{{WRAPPER}} .eppro-tab-btn.active' => 'color: {{VALUE}};', '{{WRAPPER}} .eppro-tab-btn.active i' => 'color: {{VALUE}};', '{{WRAPPER}} .eppro-tab-btn.active svg' => 'fill: {{VALUE}};' ] ] ); $this->end_controls_tab(); $this->end_controls_tabs(); $this->add_group_control( Group_Control_Typography::get_type(), [ 'name' => 'tab_typography', 'selector' => '{{WRAPPER}} .eppro-tab-btn', 'separator' => 'before', ] ); $this->add_responsive_control( 'tab_icon_size', [ 'label' => __( 'Icon Size', 'admore-widgets-suite' ), 'type' => Controls_Manager::SLIDER, 'size_units' => [ 'px', 'em' ], 'range' => [ 'px' => [ 'min' => 10, 'max' => 60 ] ], 'selectors' => [ '{{WRAPPER}} .eppro-tab-btn i' => 'font-size: {{SIZE}}{{UNIT}};', '{{WRAPPER}} .eppro-tab-btn svg' => 'width: {{SIZE}}{{UNIT}}; height: {{SIZE}}{{UNIT}};', ], ] ); $this->add_responsive_control( 'tab_icon_gap', [ 'label' => __( 'Icon Gap', 'admore-widgets-suite' ), 'type' => Controls_Manager::SLIDER, 'size_units' => [ 'px' ], 'range' => [ 'px' => [ 'min' => 0, 'max' => 24 ] ], 'default' => [ 'size' => 6 ], 'selectors' => [ '{{WRAPPER}} .eppro-tab-btn' => 'gap: {{SIZE}}{{UNIT}};' ], ] ); $this->add_group_control( Group_Control_Border::get_type(), [ 'name' => 'tab_border', 'selector' => '{{WRAPPER}} .eppro-tab-btn', 'separator' => 'before', ] ); $this->add_responsive_control( 'tab_padding', [ 'label' => __( 'Padding', 'admore-widgets-suite' ), 'type' => Controls_Manager::DIMENSIONS, 'size_units' => [ 'px', 'em' ], 'default' => [ 'top' => '10', 'right' => '20', 'bottom' => '10', 'left' => '20', 'unit' => 'px', 'isLinked' => false ], 'selectors' => [ '{{WRAPPER}} .eppro-tab-btn' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};' ], ] ); $this->add_control( 'tab_border_radius', [ 'label' => __( 'Border Radius', 'admore-widgets-suite' ), 'type' => Controls_Manager::DIMENSIONS, 'size_units' => [ 'px', '%' ], 'default' => [ 'top' => '6', 'right' => '6', 'bottom' => '6', 'left' => '6', 'unit' => 'px', 'isLinked' => true ], 'selectors' => [ '{{WRAPPER}} .eppro-tab-btn' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};' ], ] ); $this->end_controls_section(); } // ── Style: Content ──────────────────────────────────────────────────────── private function register_style_content_section(): void { $this->start_controls_section( 'style_content', [ 'label' => __( 'Content Panel', 'admore-widgets-suite' ), 'tab' => Controls_Manager::TAB_STYLE, ] ); $this->add_control( 'content_bg', [ 'label' => __( 'Background', 'admore-widgets-suite' ), 'type' => Controls_Manager::COLOR, 'default' => '#ffffff', 'selectors' => [ '{{WRAPPER}} .eppro-tab-panel' => 'background: {{VALUE}};' ], ] ); $this->add_control( 'content_color', [ 'label' => __( 'Text Color', 'admore-widgets-suite' ), 'type' => Controls_Manager::COLOR, 'selectors' => [ '{{WRAPPER}} .eppro-tab-panel' => 'color: {{VALUE}};' ], ] ); $this->add_group_control( Group_Control_Typography::get_type(), [ 'name' => 'content_typography', 'selector' => '{{WRAPPER}} .eppro-tab-panel', ] ); $this->add_group_control( Group_Control_Border::get_type(), [ 'name' => 'content_border', 'selector' => '{{WRAPPER}} .eppro-tab-panel', ] ); $this->add_control( 'content_border_radius', [ 'label' => __( 'Border Radius', 'admore-widgets-suite' ), 'type' => Controls_Manager::DIMENSIONS, 'size_units' => [ 'px', '%' ], 'selectors' => [ '{{WRAPPER}} .eppro-tab-panel' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};' ], ] ); $this->add_responsive_control( 'content_padding', [ 'label' => __( 'Padding', 'admore-widgets-suite' ), 'type' => Controls_Manager::DIMENSIONS, 'size_units' => [ 'px', 'em' ], 'default' => [ 'top' => '24', 'right' => '24', 'bottom' => '24', 'left' => '24', 'unit' => 'px', 'isLinked' => true ], 'selectors' => [ '{{WRAPPER}} .eppro-tab-panel' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};' ], ] ); $this->add_group_control( Group_Control_Box_Shadow::get_type(), [ 'name' => 'content_shadow', 'selector' => '{{WRAPPER}} .eppro-tab-panel', ] ); $this->end_controls_section(); } // ========================================================================= // Render // ========================================================================= protected function render(): void { $s = $this->get_settings_for_display(); $tabs = $s['tabs'] ?? []; $layout = $s['layout'] ?? 'horizontal'; $icon_pos = $s['icon_position'] ?? 'left'; $active_idx = max( 0, ( absint( $s['active_tab'] ) - 1 ) ); $use_hash = ( $s['url_hash'] ?? 'yes' ) === 'yes'; $mobile_acc = ( $s['mobile_accordion'] ?? 'yes' ) === 'yes'; $widget_id = $this->get_id(); if ( empty( $tabs ) ) { if ( \Elementor\Plugin::$instance->editor->is_edit_mode() ) { echo '
' . esc_html__( 'Advanced Tabs', 'admore-widgets-suite' ) . '
' . esc_html__( 'Add tab items in the Content tab.', 'admore-widgets-suite' ) . '