| 1 |
<?php |
| 2 |
namespace Elementor\Modules\AtomicWidgets\Elements\Flexbox; |
| 3 |
|
| 4 |
use Elementor\Modules\AtomicWidgets\Elements\Div_Block\Div_Block; |
| 5 |
use Elementor\Modules\AtomicWidgets\PropTypes\Primitives\String_Prop_Type; |
| 6 |
use Elementor\Modules\AtomicWidgets\Styles\Style_Definition; |
| 7 |
use Elementor\Modules\AtomicWidgets\Styles\Style_Variant; |
| 8 |
|
| 9 |
if ( ! defined( 'ABSPATH' ) ) { |
| 10 |
exit; // Exit if accessed directly. |
| 11 |
} |
| 12 |
|
| 13 |
class Flexbox extends Div_Block { |
| 14 |
public static function get_type() { |
| 15 |
return 'e-flexbox'; |
| 16 |
} |
| 17 |
|
| 18 |
public static function get_element_type(): string { |
| 19 |
return 'e-flexbox'; |
| 20 |
} |
| 21 |
|
| 22 |
public function get_title() { |
| 23 |
return esc_html__( 'Flexbox', 'elementor' ); |
| 24 |
} |
| 25 |
|
| 26 |
public function get_keywords() { |
| 27 |
return [ 'ato', 'atom', 'atoms', 'atomic' ]; |
| 28 |
} |
| 29 |
|
| 30 |
public function get_icon() { |
| 31 |
return 'eicon-flexbox'; |
| 32 |
} |
| 33 |
|
| 34 |
protected function define_base_styles(): array { |
| 35 |
$display = String_Prop_Type::generate( 'flex' ); |
| 36 |
$flex_direction = String_Prop_Type::generate( 'row' ); |
| 37 |
|
| 38 |
return [ |
| 39 |
static::BASE_STYLE_KEY => Style_Definition::make() |
| 40 |
->add_variant( |
| 41 |
Style_Variant::make() |
| 42 |
->add_prop( 'display', $display ) |
| 43 |
->add_prop( 'flex-direction', $flex_direction ) |
| 44 |
->add_prop( 'padding', $this->get_base_padding() ) |
| 45 |
), |
| 46 |
]; |
| 47 |
} |
| 48 |
} |
| 49 |
|