PluginProbe
Elementor Website Builder – more than just a page builder / 4.3.0
Elementor Website Builder – more than just a page builder v4.3.0
4.3.1 4.3.0 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 All 454 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.3.0, at modules/atomic-widgets/elements/atomic-tabs/atomic-tabs-menu/atomic-tabs-menu.php

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