← All changes
|
modules/atomic-widgets/elements/atomic-form/atomic-form.php
+17
-10
4.3.0-beta3
→
4.2.1
View file →
| @@ -12,9 +12,8 @@ | ||
| 12 | 12 | use Elementor\Modules\AtomicWidgets\Elements\Atomic_Form\Form_Error_Message\Form_Error_Message; |
| 13 | 13 | use Elementor\Modules\AtomicWidgets\Elements\Base\Atomic_Element_Base; |
| 14 | 14 | use Elementor\Modules\AtomicWidgets\Elements\Base\Element_Builder; |
| 15 | 15 | use Elementor\Modules\AtomicWidgets\Elements\Base\Has_Element_Template; |
| 16 | -use Elementor\Modules\AtomicWidgets\Elements\Base\Html_Tag_Computer; | |
| 17 | 16 | use Elementor\Modules\AtomicWidgets\Elements\Base\Widget_Builder; |
| 18 | 17 | use Elementor\Modules\AtomicWidgets\PropDependencies\Manager as Dependency_Manager; |
| 19 | 18 | use Elementor\Modules\AtomicWidgets\PropTypes\Attributes_Prop_Type; |
| 20 | 19 | use Elementor\Modules\AtomicWidgets\PropTypes\Classes_Prop_Type; |
| @@ -22,9 +21,9 @@ | ||
| 22 | 21 | use Elementor\Modules\AtomicWidgets\PropTypes\Key_Value_Prop_Type; |
| 23 | 22 | use Elementor\Modules\AtomicWidgets\PropTypes\Primitives\Boolean_Prop_Type; |
| 24 | 23 | use Elementor\Modules\AtomicWidgets\PropTypes\Primitives\Number_Prop_Type; |
| 25 | 24 | use Elementor\Modules\AtomicWidgets\PropTypes\Size_Prop_Type; |
| 26 | -use Elementor\Modules\AtomicWidgets\PropTypes\Escaped_Html_Prop_Type; | |
| 25 | +use Elementor\Modules\AtomicWidgets\PropTypes\Html_V3_Prop_Type; | |
| 27 | 26 | use Elementor\Modules\AtomicWidgets\PropTypes\Primitives\String_Array_Prop_Type; |
| 28 | 27 | use Elementor\Modules\AtomicWidgets\PropTypes\Primitives\String_Prop_Type; |
| 29 | 28 | use Elementor\Modules\AtomicWidgets\Styles\Style_Definition; |
| 30 | 29 | use Elementor\Modules\AtomicWidgets\Styles\Style_Variant; |
| @@ -53,9 +52,8 @@ | ||
| 53 | 52 | |
| 54 | 53 | public function __construct( $data = [], $args = null ) { |
| 55 | 54 | parent::__construct( $data, $args ); |
| 56 | 55 | $this->meta( 'is_container', true ); |
| 57 | - $this->meta( 'is_compound', true ); | |
| 58 | 56 | } |
| 59 | 57 | |
| 60 | 58 | public static function get_default_recipient_email(): string { |
| 61 | 59 | return sanitize_email( (string) get_option( 'admin_email', '' ) ); |
| @@ -84,12 +82,8 @@ | ||
| 84 | 82 | public function get_icon() { |
| 85 | 83 | return 'eicon-atomic-form'; |
| 86 | 84 | } |
| 87 | 85 | |
| 88 | - public static function get_computed_html_tag( array $settings ): string { | |
| 89 | - return Html_Tag_Computer::compute( $settings, 'form' ); | |
| 90 | - } | |
| 91 | - | |
| 92 | 86 | public static function get_base_props_schema(): array { |
| 93 | 87 | return self::define_props_schema(); |
| 94 | 88 | } |
| 95 | 89 | |
| @@ -289,8 +283,12 @@ | ||
| 289 | 283 | protected function define_panel_categories(): array { |
| 290 | 284 | return [ 'atomic-form' ]; |
| 291 | 285 | } |
| 292 | 286 | |
| 287 | + protected function define_default_html_tag() { | |
| 288 | + return 'form'; | |
| 289 | + } | |
| 290 | + | |
| 293 | 291 | protected function define_default_children() { |
| 294 | 292 | |
| 295 | 293 | $prefix = 'e-form-'; |
| 296 | 294 | |
| @@ -311,9 +309,12 @@ | ||
| 311 | 309 | $children[] = $this->build_checkbox_row( __( 'Checkbox', 'elementor' ), $prefix . 'checkbox' ); |
| 312 | 310 | |
| 313 | 311 | $children[] = Widget_Builder::make( 'e-form-submit-button' ) |
| 314 | 312 | ->settings( [ |
| 315 | - 'text' => Escaped_Html_Prop_Type::generate( __( 'Submit', 'elementor' ) ), | |
| 313 | + 'text' => Html_V3_Prop_Type::generate( [ | |
| 314 | + 'content' => String_Prop_Type::generate( __( 'Submit', 'elementor' ) ), | |
| 315 | + 'children' => [], | |
| 316 | + ] ), | |
| 316 | 317 | ] ) |
| 317 | 318 | ->build(); |
| 318 | 319 | $children[] = $this->build_status_message( |
| 319 | 320 | __( 'Great! We’ve received your information.', 'elementor' ), |
| @@ -348,9 +349,12 @@ | ||
| 348 | 349 | |
| 349 | 350 | private function build_label( string $text, string $input_id ): array { |
| 350 | 351 | return Widget_Builder::make( 'e-form-label' ) |
| 351 | 352 | ->settings( [ |
| 352 | - 'text' => Escaped_Html_Prop_Type::generate( $text ), | |
| 353 | + 'text' => Html_V3_Prop_Type::generate( [ | |
| 354 | + 'content' => String_Prop_Type::generate( $text ), | |
| 355 | + 'children' => [], | |
| 356 | + ] ), | |
| 353 | 357 | 'input-id' => String_Prop_Type::generate( $input_id ), |
| 354 | 358 | ] ) |
| 355 | 359 | ->build(); |
| 356 | 360 | } |
| @@ -375,9 +379,12 @@ | ||
| 375 | 379 | ->build(); |
| 376 | 380 | } |
| 377 | 381 | |
| 378 | 382 | private function build_status_message( string $message, string $state, string $title ): array { |
| 379 | - $paragraph_value = Escaped_Html_Prop_Type::generate( $message ); | |
| 383 | + $paragraph_value = Html_V3_Prop_Type::generate( [ | |
| 384 | + 'content' => String_Prop_Type::generate( $message ), | |
| 385 | + 'children' => [], | |
| 386 | + ] ); | |
| 380 | 387 | |
| 381 | 388 | $element_type = 'success' === $state |
| 382 | 389 | ? Form_Success_Message::get_element_type() |
| 383 | 390 | : Form_Error_Message::get_element_type(); |