PluginProbe
Elementor Website Builder – more than just a page builder / 3.35.0-dev1
Elementor Website Builder – more than just a page builder v3.35.0-dev1
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-content-area.php

atomic-tabs-content-area.php in Elementor Website Builder – more than just a page builder 3.35.0-dev1, at modules/atomic-widgets/elements/atomic-tabs/atomic-tabs-content-area.php

111 lines 3.0 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;
3
4 use Elementor\Modules\AtomicWidgets\Elements\Base\Atomic_Element_Base;
5 use Elementor\Modules\AtomicWidgets\PropTypes\Primitives\Boolean_Prop_Type;
6 use Elementor\Modules\AtomicWidgets\PropTypes\Primitives\String_Prop_Type;
7 use Elementor\Modules\AtomicWidgets\PropTypes\Size_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_Content_Area extends Atomic_Element_Base {
21 const BASE_STYLE_KEY = 'base';
22
23 public function __construct( $data = [], $args = null ) {
24 parent::__construct( $data, $args );
25 $this->meta( 'llm_support', false );
26 }
27
28 public static function get_type() {
29 return 'e-tabs-content-area';
30 }
31
32 public static function get_element_type(): string {
33 return 'e-tabs-content-area';
34 }
35
36 public function get_title() {
37 return esc_html__( 'Tabs content area', 'elementor' );
38 }
39
40 public function get_keywords() {
41 return [ 'ato', 'atom', 'atoms', 'atomic' ];
42 }
43
44 public function get_icon() {
45 return 'eicon-tab-content';
46 }
47
48 public function should_show_in_panel() {
49 return false;
50 }
51
52 protected static function define_props_schema(): array {
53 return [
54 'classes' => Classes_Prop_Type::make()
55 ->default( [] ),
56 'attributes' => Attributes_Prop_Type::make()->meta( Overridable_Prop_Type::ignore() ),
57 ];
58 }
59
60 protected function define_atomic_controls(): array {
61 return [
62 Section::make()
63 ->set_label( __( 'Settings', 'elementor' ) )
64 ->set_id( 'settings' )
65 ->set_items( [
66 Text_Control::bind_to( '_cssid' )
67 ->set_label( __( 'ID', 'elementor' ) )
68 ->set_meta( [
69 'layout' => 'two-columns',
70 ] ),
71 ] ),
72 ];
73 }
74
75 protected function define_base_styles(): array {
76 $styles = [
77 'display' => String_Prop_Type::generate( 'block' ),
78 ];
79
80 return [
81 static::BASE_STYLE_KEY => Style_Definition::make()
82 ->add_variant(
83 Style_Variant::make()
84 ->add_props( $styles )
85 ),
86 ];
87 }
88
89 protected function add_render_attributes() {
90 parent::add_render_attributes();
91 $settings = $this->get_atomic_settings();
92 $base_style_class = $this->get_base_styles_dictionary()[ static::BASE_STYLE_KEY ];
93 $initial_attributes = $this->define_initial_attributes();
94
95 $attributes = [
96 'class' => [
97 'e-con',
98 'e-atomic-element',
99 $base_style_class,
100 ...( $settings['classes'] ?? [] ),
101 ],
102 ];
103
104 if ( ! empty( $settings['_cssid'] ) ) {
105 $attributes['id'] = esc_attr( $settings['_cssid'] );
106 }
107
108 $this->add_render_attribute( '_wrapper', array_merge( $initial_attributes, $attributes ) );
109 }
110 }
111