← All changes
|
modules/atomic-widgets/elements/atomic-divider/atomic-divider.php
+11
-0
4.2.0
→
4.3.0-beta3
View file →
| @@ -3,8 +3,9 @@ | ||
| 3 | 3 | namespace Elementor\Modules\AtomicWidgets\Elements\Atomic_Divider; |
| 4 | 4 | |
| 5 | 5 | use Elementor\Modules\AtomicWidgets\Elements\Base\Atomic_Widget_Base; |
| 6 | 6 | use Elementor\Modules\AtomicWidgets\Elements\Base\Has_Template; |
| 7 | +use Elementor\Modules\AtomicWidgets\Elements\Base\Html_Tag_Computer; | |
| 7 | 8 | use Elementor\Modules\AtomicWidgets\PropTypes\Background_Prop_Type; |
| 8 | 9 | use Elementor\Modules\AtomicWidgets\PropTypes\Attributes_Prop_Type; |
| 9 | 10 | use Elementor\Modules\AtomicWidgets\PropTypes\Classes_Prop_Type; |
| 10 | 11 | use Elementor\Modules\AtomicWidgets\PropTypes\Color_Prop_Type; |
| @@ -45,8 +46,12 @@ | ||
| 45 | 46 | public function get_icon() { |
| 46 | 47 | return 'eicon-e-divider'; |
| 47 | 48 | } |
| 48 | 49 | |
| 50 | + public static function get_computed_html_tag( array $settings ): string { | |
| 51 | + return Html_Tag_Computer::compute( $settings, 'hr' ); | |
| 52 | + } | |
| 53 | + | |
| 49 | 54 | protected static function define_props_schema(): array { |
| 50 | 55 | return [ |
| 51 | 56 | 'classes' => Classes_Prop_Type::make() |
| 52 | 57 | ->default( [] ), |
| @@ -86,8 +91,13 @@ | ||
| 86 | 91 | $background_value = Background_Prop_Type::generate([ |
| 87 | 92 | 'color' => Color_Prop_Type::generate( '#000' ), |
| 88 | 93 | ]); |
| 89 | 94 | |
| 95 | + $width_value = Size_Prop_Type::generate([ | |
| 96 | + 'size' => 100, | |
| 97 | + 'unit' => '%', | |
| 98 | + ]); | |
| 99 | + | |
| 90 | 100 | return [ |
| 91 | 101 | 'base' => Style_Definition::make() |
| 92 | 102 | ->add_variant( |
| 93 | 103 | Style_Variant::make() |
| @@ -95,8 +105,9 @@ | ||
| 95 | 105 | ->add_prop( 'border-color', 'transparent' ) |
| 96 | 106 | ->add_prop( 'border-style', 'none' ) |
| 97 | 107 | ->add_prop( 'background', $background_value ) |
| 98 | 108 | ->add_prop( 'height', $height_value ) |
| 109 | + ->add_prop( 'width', $width_value ) | |
| 99 | 110 | ), |
| 100 | 111 | ]; |
| 101 | 112 | } |
| 102 | 113 | |