-
-
Notifications
You must be signed in to change notification settings - Fork 312
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[TwigComponent][LiveComponent] Fix DataModelPropsSubscriber for embed…
…ded components
- Loading branch information
Showing
10 changed files
with
136 additions
and
15 deletions.
There are no files selected for viewing
22 changes: 22 additions & 0 deletions
22
src/LiveComponent/tests/Fixtures/Component/InputComponent.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<?php | ||
|
||
/* | ||
* This file is part of the Symfony package. | ||
* | ||
* (c) Fabien Potencier <[email protected]> | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
|
||
namespace Symfony\UX\LiveComponent\Tests\Fixtures\Component; | ||
|
||
use Symfony\UX\TwigComponent\Attribute\AsTwigComponent; | ||
|
||
/** | ||
* @author Bart Vanderstukken <[email protected]> | ||
*/ | ||
#[AsTwigComponent('input_component')] | ||
final class InputComponent | ||
{ | ||
} |
24 changes: 24 additions & 0 deletions
24
src/LiveComponent/tests/Fixtures/Component/ParentComponentDataModel.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
<?php | ||
|
||
/* | ||
* This file is part of the Symfony package. | ||
* | ||
* (c) Fabien Potencier <[email protected]> | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
|
||
namespace Symfony\UX\LiveComponent\Tests\Fixtures\Component; | ||
|
||
use Symfony\UX\LiveComponent\Attribute\AsLiveComponent; | ||
use Symfony\UX\LiveComponent\DefaultActionTrait; | ||
|
||
/** | ||
* @author Bart Vanderstukken <[email protected]> | ||
*/ | ||
#[AsLiveComponent('parent_component_data_model')] | ||
final class ParentComponentDataModel | ||
{ | ||
use DefaultActionTrait; | ||
} |
27 changes: 27 additions & 0 deletions
27
src/LiveComponent/tests/Fixtures/Component/ParentComponentDataModel2.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
<?php | ||
|
||
/* | ||
* This file is part of the Symfony package. | ||
* | ||
* (c) Fabien Potencier <[email protected]> | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
|
||
namespace Symfony\UX\LiveComponent\Tests\Fixtures\Component; | ||
|
||
use Symfony\UX\LiveComponent\Attribute\AsLiveComponent; | ||
use Symfony\UX\LiveComponent\Attribute\LiveProp; | ||
use Symfony\UX\LiveComponent\DefaultActionTrait; | ||
|
||
/** | ||
* @author Bart Vanderstukken <[email protected]> | ||
*/ | ||
#[AsLiveComponent('parent_component_data_model_2')] | ||
final class ParentComponentDataModel2 | ||
{ | ||
use DefaultActionTrait; | ||
|
||
#[LiveProp(writable: true)] public string $content; | ||
} |
1 change: 1 addition & 0 deletions
1
src/LiveComponent/tests/Fixtures/templates/components/input_component.html.twig
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
<input{{ attributes }} /> |
2 changes: 2 additions & 0 deletions
2
src/LiveComponent/tests/Fixtures/templates/components/parent_component_data_model.html.twig
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
{% component parent_component_data_model_2 with { content: 'default content on mount' } %} | ||
{% endcomponent %} |
2 changes: 2 additions & 0 deletions
2
...LiveComponent/tests/Fixtures/templates/components/parent_component_data_model_2.html.twig
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
{{ component('textarea_component', { dataModel: 'content' }) }} | ||
{% component input_component with { dataModel: 'content' } %}{% endcomponent %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters