Skip to content

Commit

Permalink
Update asset dependencies.
Browse files Browse the repository at this point in the history
  • Loading branch information
terabytesoftw committed Feb 28, 2024
1 parent f9630f7 commit ab9b9c4
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 7 deletions.
5 changes: 1 addition & 4 deletions src/Asset/DateTimePickerAsset.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,7 @@ final class DateTimePickerAsset extends AssetBundle
/**
* @phpstan-var array<array-key, mixed>
*/
public $depends = [
PopperAsset::class,
JQueryProviderAsset::class,
];
public $depends = [PopperAsset::class];

public function __construct()
{
Expand Down
5 changes: 5 additions & 0 deletions src/Asset/JQueryProviderAsset.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,11 @@ final class JQueryProviderAsset extends AssetBundle
{
public $sourcePath = '@npm/eonasdan--tempus-dominus/dist/js';

/**
* @phpstan-var array<array-key, mixed>
*/
public $depends = [DateTimePickerAsset::class];

public function __construct()
{
parent::__construct();
Expand Down
2 changes: 1 addition & 1 deletion src/DateTimePicker.php
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ private function registerClientScript(): void

match ($this->cdn) {
true => Asset\DateTimePickerCdnAsset::register($view),
default => Asset\DateTimePickerAsset::register($view),
default => Asset\JQueryProviderAsset::register($view),
};

$view->registerJs($this->getScript());
Expand Down
4 changes: 2 additions & 2 deletions tests/AssetTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public function testDateTimePickerAssetSimpleDependency(): void
{
$this->assertEmpty($this->view->assetBundles);

DateTimePickerAsset::register($this->view);
JQueryProviderAsset::register($this->view);

$this->assertCount(3, $this->view->assetBundles);

Expand All @@ -43,7 +43,7 @@ public function testDateTimePickerAssetRegister(): void
{
$this->assertEmpty($this->view->assetBundles);

DateTimePickerAsset::register($this->view);
JQueryProviderAsset::register($this->view);

$this->assertCount(3, $this->view->assetBundles);

Expand Down

0 comments on commit ab9b9c4

Please sign in to comment.