Skip to content

Commit 5107395

Browse files
committed
Based AlpineJS elementId upon GetElementId logic
1 parent 0aa2c58 commit 5107395

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

Util/Component/JsDataProvider.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
namespace Loki\Components\Util\Component;
44

5+
use Loki\Components\Util\Block\GetElementId;
56
use Magento\Framework\View\Element\Block\ArgumentInterface;
67
use Loki\Components\Component\ComponentInterface;
78
use Loki\Components\Util\CamelCaseConvertor;
@@ -12,6 +13,7 @@ class JsDataProvider implements ArgumentInterface
1213
{
1314
public function __construct(
1415
private readonly ComponentUtil $componentUtil,
16+
private readonly GetElementId $getElementId,
1517
private readonly IdConvertor $idConvertor,
1618
private readonly CamelCaseConvertor $camelCaseConvertor,
1719
) {
@@ -26,7 +28,7 @@ public function getComponentData(ComponentInterface $component): array
2628

2729
$block = $component->getBlock();
2830
$data['blockId'] = $block->getNameInLayout();
29-
$data['elementId'] = $this->componentUtil->convertToElementId($block->getNameInLayout());
31+
$data['elementId'] = $this->getElementId->execute($block);
3032
$data['validators'] = $component->getValidators();
3133
$data['filters'] = $component->getFilters();
3234

0 commit comments

Comments
 (0)