PluginProbe
Elementor Website Builder – more than just a page builder / 4.0.4
Elementor Website Builder – more than just a page builder v4.0.4
4.3.0-beta3 4.3.0-beta2 4.3.0-beta1 4.2.4 4.2.3 4.2.2 4.2.1 4.2.0 4.1.5 4.2.0-beta2 4.2.0-dev2 4.2.0-beta1 4.1.4 4.1.3 4.1.2 4.1.1 4.1.0 4.1.0-beta3 4.1.0-dev3 4.0.9 4.1.0-beta2 4.1.0-dev2 4.0.8 4.1.0-beta1 4.1.0-dev1 All 452 releases
elementor / modules / atomic-widgets / elements / atomic-tabs / atomic-tabs-menu / atomic-tabs-menu.php

atomic-tabs-menu.php in Elementor Website Builder – more than just a page builder 4.0.4, at modules/atomic-widgets/elements/atomic-tabs/atomic-tabs-menu/atomic-tabs-menu.php

107 lines 2.7 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 namespace Elementor\Modules\AtomicWidgets\Elements\Atomic_Tabs\Atomic_Tabs_Menu;
3
4 use Elementor\Modules\AtomicWidgets\Elements\Base\Atomic_Element_Base;
5 use Elementor\Modules\AtomicWidgets\Elements\Base\Has_Element_Template;
6 use Elementor\Modules\AtomicWidgets\PropTypes\Primitives\String_Prop_Type;
7 use Elementor\Modules\AtomicWidgets\Styles\Style_Definition;
8 use Elementor\Modules\AtomicWidgets\Styles\Style_Variant;
9 use Elementor\Modules\AtomicWidgets\Controls\Section;
10 use Elementor\Modules\AtomicWidgets\Controls\Types\Text_Control;
11 use Elementor\Modules\AtomicWidgets\PropTypes\Classes_Prop_Type;
12 use Elementor\Modules\AtomicWidgets\PropTypes\Attributes_Prop_Type;
13 use Elementor\Modules\Components\PropTypes\Overridable_Prop_Type;
14
15 if ( ! defined( 'ABSPATH' ) ) {
16 exit; // Exit if accessed directly.
17 }
18
19 class Atomic_Tabs_Menu extends Atomic_Element_Base {
20 use Has_Element_Template;
21
22 const BASE_STYLE_KEY = 'base';
23
24 public function __construct( $data = [], $args = null ) {
25 parent::__construct( $data, $args );
26 $this->meta( 'llm_support', false );
27 }
28
29 public static function get_type() {
30 return 'e-tabs-menu';
31 }
32
33 public static function get_element_type(): string {
34 return 'e-tabs-menu';
35 }
36
37 public function get_title() {
38 return esc_html__( 'Tabs menu', 'elementor' );
39 }
40
41 public function get_keywords() {
42 return [ 'ato', 'atom', 'atoms', 'atomic' ];
43 }
44
45 public function get_icon() {
46 return 'eicon-tab-menu';
47 }
48
49 public function should_show_in_panel() {
50 return false;
51 }
52
53 public function define_initial_attributes(): array {
54 return [
55 'role' => 'tablist',
56 ];
57 }
58
59 protected static function define_props_schema(): array {
60 return [
61 'classes' => Classes_Prop_Type::make()
62 ->default( [] ),
63 'attributes' => Attributes_Prop_Type::make()->meta( Overridable_Prop_Type::ignore() ),
64 ];
65 }
66
67 protected function define_atomic_controls(): array {
68 return [
69 Section::make()
70 ->set_label( __( 'Settings', 'elementor' ) )
71 ->set_id( 'settings' )
72 ->set_items( [
73 Text_Control::bind_to( '_cssid' )
74 ->set_label( __( 'ID', 'elementor' ) )
75 ->set_meta( [
76 'layout' => 'two-columns',
77 ] ),
78 ] ),
79 ];
80 }
81
82 protected function define_base_styles(): array {
83 $styles = [
84 'display' => String_Prop_Type::generate( 'flex' ),
85 'justify-content' => String_Prop_Type::generate( 'center' ),
86 ];
87
88 return [
89 static::BASE_STYLE_KEY => Style_Definition::make()
90 ->add_variant(
91 Style_Variant::make()
92 ->add_props( $styles )
93 ),
94 ];
95 }
96
97 protected function get_templates(): array {
98 return [
99 'elementor/elements/atomic-tabs-menu' => __DIR__ . '/atomic-tabs-menu.html.twig',
100 ];
101 }
102
103 protected function define_allowed_child_types() {
104 return [ 'e-tab', 'container' ];
105 }
106 }
107