startControlsSection( 'section_tabs', [ 'label' => __('Tabs'), ] ); $repeater = new Repeater(); $repeater->addControl( 'tab_title', [ 'label' => __('Title & Description'), 'type' => ControlsManager::TEXT, 'default' => __('Tab Title'), 'placeholder' => __('Tab Title'), 'label_block' => true, ] ); $repeater->addControl( 'tab_content', [ 'label' => __('Content'), 'default' => __('Tab Content'), 'placeholder' => __('Tab Content'), 'type' => ControlsManager::WYSIWYG, 'show_label' => false, ] ); $this->addControl( 'tabs', [ 'label' => __('Tabs Items'), 'type' => ControlsManager::REPEATER, 'fields' => $repeater->getControls(), 'default' => [ [ 'tab_title' => __('Tab #1'), 'tab_content' => __('Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut elit tellus, luctus nec ullamcorper mattis, pulvinar dapibus leo.'), ], [ 'tab_title' => __('Tab #2'), 'tab_content' => __('Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut elit tellus, luctus nec ullamcorper mattis, pulvinar dapibus leo.'), ], ], 'title_field' => '{{{ tab_title }}}', ] ); $this->addControl( 'view', [ 'label' => __('View'), 'type' => ControlsManager::HIDDEN, 'default' => 'traditional', ] ); $this->addControl( 'type', [ 'label' => __('Type'), 'type' => ControlsManager::SELECT, 'default' => 'horizontal', 'options' => [ 'horizontal' => __('Horizontal'), 'vertical' => __('Vertical'), ], 'prefix_class' => 'elementor-tabs-view-', 'separator' => 'before', ] ); $this->endControlsSection(); $this->startControlsSection( 'section_tabs_style', [ 'label' => __('Tabs'), 'tab' => ControlsManager::TAB_STYLE, ] ); $this->addControl( 'navigation_width', [ 'label' => __('Navigation Width'), 'type' => ControlsManager::SLIDER, 'default' => [ 'unit' => '%', ], 'range' => [ '%' => [ 'min' => 10, 'max' => 50, ], ], 'selectors' => [ '{{WRAPPER}} .elementor-tabs-wrapper' => 'width: {{SIZE}}{{UNIT}}', ], 'condition' => [ 'type' => 'vertical', ], ] ); $this->addControl( 'border_width', [ 'label' => __('Border Width'), 'type' => ControlsManager::SLIDER, 'default' => [ 'size' => 1, ], 'range' => [ 'px' => [ 'min' => 0, 'max' => 10, ], ], 'selectors' => [ '{{WRAPPER}} .elementor-tab-title, {{WRAPPER}} .elementor-tab-title:before, {{WRAPPER}} .elementor-tab-title:after, {{WRAPPER}} .elementor-tab-content, {{WRAPPER}} .elementor-tabs-content-wrapper' => 'border-width: {{SIZE}}{{UNIT}};', ], ] ); $this->addControl( 'border_color', [ 'label' => __('Border Color'), 'type' => ControlsManager::COLOR, 'selectors' => [ '{{WRAPPER}} .elementor-tab-mobile-title, {{WRAPPER}} .elementor-tab-desktop-title.elementor-active, {{WRAPPER}} .elementor-tab-title:before, {{WRAPPER}} .elementor-tab-title:after, {{WRAPPER}} .elementor-tab-content, {{WRAPPER}} .elementor-tabs-content-wrapper' => 'border-color: {{VALUE}};', ], ] ); $this->addControl( 'background_color', [ 'label' => __('Background Color'), 'type' => ControlsManager::COLOR, 'selectors' => [ '{{WRAPPER}} .elementor-tab-desktop-title.elementor-active' => 'background-color: {{VALUE}};', '{{WRAPPER}} .elementor-tabs-content-wrapper' => 'background-color: {{VALUE}};', ], ] ); $this->addControl( 'heading_title', [ 'label' => __('Title'), 'type' => ControlsManager::HEADING, 'separator' => 'before', ] ); $this->addControl( 'tab_color', [ 'label' => __('Color'), 'type' => ControlsManager::COLOR, 'selectors' => [ '{{WRAPPER}} .elementor-tab-title, {{WRAPPER}} .elementor-tab-title a' => 'color: {{VALUE}};', ], 'scheme' => [ 'type' => SchemeColor::getType(), 'value' => SchemeColor::COLOR_1, ], ] ); $this->addControl( 'tab_active_color', [ 'label' => __('Active Color'), 'type' => ControlsManager::COLOR, 'selectors' => [ '{{WRAPPER}} .elementor-tab-title.elementor-active a' => 'color: {{VALUE}};', ], 'scheme' => [ 'type' => SchemeColor::getType(), 'value' => SchemeColor::COLOR_4, ], ] ); $this->addGroupControl( GroupControlTypography::getType(), [ 'name' => 'tab_typography', 'selector' => '{{WRAPPER}} .elementor-tab-title', 'scheme' => SchemeTypography::TYPOGRAPHY_1, ] ); $this->addGroupControl( GroupControlTextStroke::getType(), [ 'name' => 'text_stroke', 'selector' => '{{WRAPPER}} .elementor-tab-title', ] ); $this->addGroupControl( GroupControlTextShadow::getType(), [ 'name' => 'title_shadow', 'selector' => '{{WRAPPER}} .elementor-tab-title', ] ); $this->addControl( 'heading_content', [ 'label' => __('Content'), 'type' => ControlsManager::HEADING, 'separator' => 'before', ] ); $this->addControl( 'content_color', [ 'label' => __('Color'), 'type' => ControlsManager::COLOR, 'selectors' => [ '{{WRAPPER}} .elementor-tab-content' => 'color: {{VALUE}};', ], 'scheme' => [ 'type' => SchemeColor::getType(), 'value' => SchemeColor::COLOR_3, ], ] ); $this->addGroupControl( GroupControlTypography::getType(), [ 'name' => 'content_typography', 'selector' => '{{WRAPPER}} .elementor-tab-content', 'scheme' => SchemeTypography::TYPOGRAPHY_3, ] ); $this->addGroupControl( GroupControlTextShadow::getType(), [ 'name' => 'content_shadow', 'selector' => '{{WRAPPER}} .elementor-tab-content', ] ); $this->endControlsSection(); } /** * Render tabs widget output on the frontend. * * Written in PHP and used to generate the final HTML. * * @since 1.0.0 */ protected function render() { $tabs = $this->getSettingsForDisplay('tabs'); $id_int = substr($this->getIdInt(), 0, 3); ?>