| 1 |
<?php |
| 2 |
namespace Elementor\Modules\AtomicWidgets\Elements\Atomic_List; |
| 3 |
|
| 4 |
use Elementor\Modules\AtomicWidgets\Elements\Base\Atomic_Element_Base; |
| 5 |
use Elementor\Modules\AtomicWidgets\Elements\Base\Has_Element_Template; |
| 6 |
use Elementor\Modules\AtomicWidgets\Elements\Base\Html_Tag_Computer; |
| 7 |
use Elementor\Modules\AtomicWidgets\PropTypes\Attributes_Prop_Type; |
| 8 |
use Elementor\Modules\AtomicWidgets\PropTypes\Classes_Prop_Type; |
| 9 |
use Elementor\Modules\Components\PropTypes\Overridable_Prop_Type; |
| 10 |
|
| 11 |
if ( ! defined( 'ABSPATH' ) ) { |
| 12 |
exit; // Exit if accessed directly. |
| 13 |
} |
| 14 |
|
| 15 |
class Atomic_List extends Atomic_Element_Base { |
| 16 |
use Has_Element_Template; |
| 17 |
|
| 18 |
public function __construct( $data = [], $args = null ) { |
| 19 |
parent::__construct( $data, $args ); |
| 20 |
$this->meta( 'is_container', true ); |
| 21 |
} |
| 22 |
|
| 23 |
public static function get_type() { |
| 24 |
return 'e-list'; |
| 25 |
} |
| 26 |
|
| 27 |
public static function get_element_type(): string { |
| 28 |
return self::get_type(); |
| 29 |
} |
| 30 |
|
| 31 |
public function get_title() { |
| 32 |
return esc_html__( 'List', 'elementor' ); |
| 33 |
} |
| 34 |
|
| 35 |
public function get_icon() { |
| 36 |
return 'eicon-bullet-list'; |
| 37 |
} |
| 38 |
|
| 39 |
public static function get_computed_html_tag( array $settings ): string { |
| 40 |
return Html_Tag_Computer::compute( $settings, 'ul' ); |
| 41 |
} |
| 42 |
|
| 43 |
protected static function define_props_schema(): array { |
| 44 |
return [ |
| 45 |
'classes' => Classes_Prop_Type::make() |
| 46 |
->default( [] ), |
| 47 |
'attributes' => Attributes_Prop_Type::make()->meta( Overridable_Prop_Type::ignore() ), |
| 48 |
]; |
| 49 |
} |
| 50 |
|
| 51 |
protected function define_atomic_controls(): array { |
| 52 |
return []; |
| 53 |
} |
| 54 |
|
| 55 |
protected function define_allowed_child_types() { |
| 56 |
return [ 'e-list-item' ]; |
| 57 |
} |
| 58 |
|
| 59 |
protected function get_templates(): array { |
| 60 |
return [ |
| 61 |
'elementor/elements/atomic-list' => __DIR__ . '/atomic-list.html.twig', |
| 62 |
]; |
| 63 |
} |
| 64 |
} |
| 65 |
|