← All changes
|
modules/atomic-widgets/elements/atomic-tabs/atomic-tab/atomic-tab.php
+10
-10
4.0.8
→
4.3.1
View file →
| @@ -2,8 +2,9 @@ | ||
| 2 | 2 | namespace Elementor\Modules\AtomicWidgets\Elements\Atomic_Tabs\Atomic_Tab; |
| 3 | 3 | |
| 4 | 4 | use Elementor\Modules\AtomicWidgets\Elements\Base\Atomic_Element_Base; |
| 5 | 5 | use Elementor\Modules\AtomicWidgets\Elements\Base\Has_Element_Template; |
| 6 | +use Elementor\Modules\AtomicWidgets\Elements\Base\Html_Tag_Computer; | |
| 6 | 7 | use Elementor\Modules\AtomicWidgets\PropTypes\Primitives\String_Prop_Type; |
| 7 | 8 | use Elementor\Modules\AtomicWidgets\PropTypes\Size_Prop_Type; |
| 8 | 9 | use Elementor\Modules\AtomicWidgets\Styles\Style_Definition; |
| 9 | 10 | use Elementor\Modules\AtomicWidgets\Styles\Style_Variant; |
| @@ -9,9 +10,9 @@ | ||
| 9 | 10 | use Elementor\Modules\AtomicWidgets\Styles\Style_Variant; |
| 10 | 11 | use Elementor\Modules\AtomicWidgets\Styles\Style_States; |
| 11 | 12 | use Elementor\Modules\AtomicWidgets\Controls\Section; |
| 12 | 13 | use Elementor\Modules\AtomicWidgets\PropTypes\Classes_Prop_Type; |
| 13 | -use Elementor\Modules\AtomicWidgets\PropTypes\Html_V3_Prop_Type; | |
| 14 | +use Elementor\Modules\AtomicWidgets\PropTypes\Escaped_Html_Prop_Type; | |
| 14 | 15 | use Elementor\Modules\AtomicWidgets\Elements\Atomic_Paragraph\Atomic_Paragraph; |
| 15 | 16 | use Elementor\Modules\AtomicWidgets\PropTypes\Attributes_Prop_Type; |
| 16 | 17 | use Elementor\Modules\AtomicWidgets\PropTypes\Color_Prop_Type; |
| 17 | 18 | use Elementor\Modules\AtomicWidgets\Elements\Base\Render_Context; |
| @@ -27,11 +28,13 @@ | ||
| 27 | 28 | use Has_Element_Template; |
| 28 | 29 | |
| 29 | 30 | const BASE_STYLE_KEY = 'base'; |
| 30 | 31 | |
| 32 | + public static $widget_description = 'A tab trigger element. Contains a single heading or paragraph that serves as the tab label. The index of this e-tab MUST match the index of the corresponding e-tab-content in the e-tabs-content-area.'; | |
| 33 | + | |
| 31 | 34 | public function __construct( $data = [], $args = null ) { |
| 32 | 35 | parent::__construct( $data, $args ); |
| 33 | - $this->meta( 'llm_support', false ); | |
| 36 | + $this->meta( 'permanently_locked', true ); | |
| 34 | 37 | } |
| 35 | 38 | |
| 36 | 39 | public static function get_type() { |
| 37 | 40 | return 'e-tab'; |
| @@ -56,8 +59,12 @@ | ||
| 56 | 59 | public function should_show_in_panel() { |
| 57 | 60 | return false; |
| 58 | 61 | } |
| 59 | 62 | |
| 63 | + public static function get_computed_html_tag( array $settings ): string { | |
| 64 | + return Html_Tag_Computer::compute( $settings, 'button' ); | |
| 65 | + } | |
| 66 | + | |
| 60 | 67 | protected static function define_props_schema(): array { |
| 61 | 68 | return [ |
| 62 | 69 | 'classes' => Classes_Prop_Type::make() |
| 63 | 70 | ->default( [] ), |
| @@ -148,20 +155,13 @@ | ||
| 148 | 155 | 'tabindex' => '-1', |
| 149 | 156 | ]; |
| 150 | 157 | } |
| 151 | 158 | |
| 152 | - protected function define_default_html_tag() { | |
| 153 | - return 'button'; | |
| 154 | - } | |
| 155 | - | |
| 156 | 159 | protected function define_default_children() { |
| 157 | 160 | return [ |
| 158 | 161 | Atomic_Paragraph::generate() |
| 159 | 162 | ->settings( [ |
| 160 | - 'paragraph' => Html_V3_Prop_Type::generate( [ | |
| 161 | - 'content' => String_Prop_Type::generate( 'Tab' ), | |
| 162 | - 'children' => [], | |
| 163 | - ] ), | |
| 163 | + 'paragraph' => Escaped_Html_Prop_Type::generate( 'Tab' ), | |
| 164 | 164 | 'tag' => String_Prop_Type::generate( 'span' ), |
| 165 | 165 | ] ) |
| 166 | 166 | ->build(), |
| 167 | 167 | ]; |