diff --git a/src/Support/src/DTOs/FileItem.php b/src/Support/src/DTOs/FileItem.php index bc36a18e2..01d70f571 100644 --- a/src/Support/src/DTOs/FileItem.php +++ b/src/Support/src/DTOs/FileItem.php @@ -15,6 +15,7 @@ public function __construct( private string $rawValue, private string $name, private ComponentAttributesBagContract $attributes = new MoonShineComponentAttributeBag(), + private ?FileItemExtra $extra = null, ) { } @@ -33,6 +34,11 @@ public function getName(): string return $this->name; } + public function getExtra(): ?FileItemExtra + { + return $this->extra; + } + public function getAttributes(): ComponentAttributesBagContract { return $this->attributes; @@ -45,6 +51,7 @@ public function toArray(): array 'raw_value' => $this->getRawValue(), 'name' => $this->getName(), 'attributes' => $this->getAttributes(), + 'extra' => $this->getExtra()?->toArray(), ]; } } diff --git a/src/Support/src/DTOs/FileItemExtra.php b/src/Support/src/DTOs/FileItemExtra.php new file mode 100644 index 000000000..93223a19f --- /dev/null +++ b/src/Support/src/DTOs/FileItemExtra.php @@ -0,0 +1,26 @@ + $this->wide, + 'auto' => $this->auto, + 'content_styles' => $this->styles ?? '', + ]; + } +} diff --git a/src/UI/resources/views/components/thumbnails.blade.php b/src/UI/resources/views/components/thumbnails.blade.php index 705fe9c8a..74b2cdd66 100644 --- a/src/UI/resources/views/components/thumbnails.blade.php +++ b/src/UI/resources/views/components/thumbnails.blade.php @@ -11,7 +11,13 @@ {{ $value['name'] ?? $alt }} @@ -25,7 +31,13 @@ class="h-full w-full object-cover" src="{{ $value['full_path'] }}" alt="{{ $value['name'] ?? $alt }}" - @click.stop="$dispatch('img-popup', {open: true, src: '{{ $value['full_path'] }}' })" + @click.stop="$dispatch('img-popup', { + open: true, + src: '{{ $value['full_path'] }}', + wide: {{ isset($value['extra']['wide']) && $value['extra']['wide'] ? 'true' : 'false' }}, + auto: {{ isset($value['extra']['auto']) && $value['extra']['auto'] ? 'true' : 'false' }}, + styles: '{{ $value['extra']['content_styles'] ?? '' }}' + })" /> @endforeach diff --git a/src/UI/resources/views/shared/img-popup.blade.php b/src/UI/resources/views/shared/img-popup.blade.php index c89fe3969..9ff8ed55a 100644 --- a/src/UI/resources/views/shared/img-popup.blade.php +++ b/src/UI/resources/views/shared/img-popup.blade.php @@ -1,6 +1,6 @@ -
+