← All changes
|
modules/atomic-widgets/elements/flexbox/flexbox.php
+18
-3
4.1.0-dev3
→
4.3.0-beta3
View file →
| @@ -2,8 +2,9 @@ | ||
| 2 | 2 | namespace Elementor\Modules\AtomicWidgets\Elements\Flexbox; |
| 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\PropDependencies\Manager as Dependency_Manager; |
| 7 | 8 | use Elementor\Modules\AtomicWidgets\PropTypes\Primitives\String_Prop_Type; |
| 8 | 9 | use Elementor\Modules\AtomicWidgets\PropTypes\Size_Prop_Type; |
| 9 | 10 | use Elementor\Modules\AtomicWidgets\Styles\Style_Definition; |
| @@ -34,8 +35,10 @@ | ||
| 34 | 35 | public static function get_type() { |
| 35 | 36 | return 'e-flexbox'; |
| 36 | 37 | } |
| 37 | 38 | |
| 39 | + public static $widget_description = 'A container (div) with flex display and flex-direction row by default.'; | |
| 40 | + | |
| 38 | 41 | public static function get_element_type(): string { |
| 39 | 42 | return 'e-flexbox'; |
| 40 | 43 | } |
| 41 | 44 | |
| @@ -43,9 +46,9 @@ | ||
| 43 | 46 | return esc_html__( 'Flexbox', 'elementor' ); |
| 44 | 47 | } |
| 45 | 48 | |
| 46 | 49 | public function get_keywords() { |
| 47 | - return [ 'ato', 'atom', 'atoms', 'atomic' ]; | |
| 50 | + return [ 'ato', 'atom', 'atoms', 'atomic', 'container', 'wrapper', 'section', 'row', 'column', 'flex', 'layout' ]; | |
| 48 | 51 | } |
| 49 | 52 | |
| 50 | 53 | public function get_icon() { |
| 51 | 54 | return 'eicon-flexbox'; |
| @@ -50,8 +53,12 @@ | ||
| 50 | 53 | public function get_icon() { |
| 51 | 54 | return 'eicon-flexbox'; |
| 52 | 55 | } |
| 53 | 56 | |
| 57 | + public static function get_computed_html_tag( array $settings ): string { | |
| 58 | + return Html_Tag_Computer::compute( $settings, 'div' ); | |
| 59 | + } | |
| 60 | + | |
| 54 | 61 | protected static function define_props_schema(): array { |
| 55 | 62 | $tag_dependencies = Dependency_Manager::make( Dependency_Manager::RELATION_AND ) |
| 56 | 63 | ->where( [ |
| 57 | 64 | 'operator' => 'ne', |
| @@ -74,11 +81,11 @@ | ||
| 74 | 81 | return [ |
| 75 | 82 | 'classes' => Classes_Prop_Type::make() |
| 76 | 83 | ->default( [] ), |
| 77 | 84 | 'tag' => String_Prop_Type::make() |
| 78 | - ->enum( [ 'div', 'header', 'section', 'article', 'aside', 'footer', 'a', 'button' ] ) | |
| 85 | + ->enum( [ 'div', 'header', 'section', 'article', 'aside', 'footer', 'a', 'button', 'main', 'nav' ] ) | |
| 79 | 86 | ->default( 'div' ) |
| 80 | - ->description( 'The HTML tag for the flexbox container. Could be div, header, section, article, aside, footer, or a (link).' ) | |
| 87 | + ->description( 'The HTML tag for the flexbox container. One of: div, header, section, article, aside, footer, main, nav, a (link), or button.' ) | |
| 81 | 88 | ->set_dependencies( $tag_dependencies ), |
| 82 | 89 | 'link' => Link_Prop_Type::make(), |
| 83 | 90 | 'attributes' => Attributes_Prop_Type::make()->meta( Overridable_Prop_Type::ignore() ), |
| 84 | 91 | ]; |
| @@ -116,8 +123,16 @@ | ||
| 116 | 123 | ], |
| 117 | 124 | [ |
| 118 | 125 | 'value' => 'footer', |
| 119 | 126 | 'label' => 'Footer', |
| 127 | + ], | |
| 128 | + [ | |
| 129 | + 'value' => 'main', | |
| 130 | + 'label' => 'Main', | |
| 131 | + ], | |
| 132 | + [ | |
| 133 | + 'value' => 'nav', | |
| 134 | + 'label' => 'Nav', | |
| 120 | 135 | ], |
| 121 | 136 | ]) |
| 122 | 137 | ->set_label( esc_html__( 'HTML Tag', 'elementor' ) ) |
| 123 | 138 | ->set_fallback_labels( [ |