diff --git a/resources/views/infolists/components/swiper-image-entry.blade.php b/resources/views/infolists/components/swiper-image-entry.blade.php index eda8c27..5984036 100644 --- a/resources/views/infolists/components/swiper-image-entry.blade.php +++ b/resources/views/infolists/components/swiper-image-entry.blade.php @@ -1,66 +1,65 @@ @php - $limit = $getLimit(); - $state = \Illuminate\Support\Arr::wrap($getState()); - $limitedState = array_slice($state, 0, $limit); - $isCircular = $isCircular(); - $isSquare = $isSquare(); - $isStacked = $isStacked(); - $overlap = $isStacked ? ($getOverlap() ?? 2) : null; - $ring = $isStacked ? ($getRing() ?? 2) : null; - $height = $getHeight() ?? ($isStacked ? '2.5rem' : '8rem'); - $width = $getWidth() ?? (($isCircular || $isSquare) ? $height : null); - $defaultImageUrl = $getDefaultImageUrl(); - $pagination = $getPagination(); - $navigation = $getNavigation(); - $slidesPerView = $getSlidesPerView(); - $paginationType = $getPaginationType(); - $autoplay = $getAutoplay(); - $autoplayDelay = $getAutoplayDelay(); - $paginationClickable = $getPaginationClickable(); - $paginationDynamicBullets = $getPaginationDynamicBullets(); - $paginationDynamicMainBullets = $getPaginationDynamicMainBullets(); - $paginationHideOnClick = $getPaginationHideOnClick(); - - $scrollbar = $getScrollbar(); - $scrollbarDraggable = $getScrollbarDraggable(); - $scrollbarHide = $getScrollbarHide(); - $scrollbarSnapOnRelease = $getScrollbarSnapOnRelease(); - $scrollbarDragSize = $getScrollbarDragSize(); - - $effect = $getEffect(); - -// dd($slidesPerView); - - if ((! count($limitedState)) && filled($defaultImageUrl)) { - $limitedState = [null]; - } - - $ringClasses = \Illuminate\Support\Arr::toCssClasses([ - 'ring-white dark:ring-gray-900', - match ($ring) { - 0 => null, - 1 => 'ring-1', - 2 => 'ring-2', - 3 => 'ring', - 4 => 'ring-4', - default => $ring, - }, - ]); - - $hasLimitedRemainingText = $hasLimitedRemainingText(); - $isLimitedRemainingTextSeparate = $isLimitedRemainingTextSeparate(); - - $limitedRemainingTextSizeClasses = match ($getLimitedRemainingTextSize()) { - 'xs' => 'text-xs', - 'sm', null => 'text-sm', - 'base', 'md' => 'text-base', - 'lg' => 'text-lg', - default => $size, - }; +$limit = $getLimit(); +$state = \Illuminate\Support\Arr::wrap($getState()); +$limitedState = array_slice($state, 0, $limit); +$isCircular = $isCircular(); +$isSquare = $isSquare(); +$isStacked = $isStacked(); +$overlap = $isStacked ? ($getOverlap() ?? 2) : null; +$ring = $isStacked ? ($getRing() ?? 2) : null; +$height = $getHeight() ?? ($isStacked ? '2.5rem' : '8rem'); +$width = $getWidth() ?? (($isCircular || $isSquare) ? $height : null); +$defaultImageUrl = $getDefaultImageUrl(); +$pagination = $getPagination(); +$navigation = $getNavigation(); +$slidesPerView = $getSlidesPerView(); +$paginationType = $getPaginationType(); +$autoplay = $getAutoplay(); +$autoplayDelay = $getAutoplayDelay(); +$paginationClickable = $getPaginationClickable(); +$paginationDynamicBullets = $getPaginationDynamicBullets(); +$paginationDynamicMainBullets = $getPaginationDynamicMainBullets(); +$paginationHideOnClick = $getPaginationHideOnClick(); + +$scrollbar = $getScrollbar(); +$scrollbarDraggable = $getScrollbarDraggable(); +$scrollbarHide = $getScrollbarHide(); +$scrollbarSnapOnRelease = $getScrollbarSnapOnRelease(); +$scrollbarDragSize = $getScrollbarDragSize(); + +$effect = $getEffect(); + +// dd($slidesPerView); + +if ((! count($limitedState)) && filled($defaultImageUrl)) { +$limitedState = [null]; +} + +$ringClasses = \Illuminate\Support\Arr::toCssClasses([ +'ring-white dark:ring-gray-900', +match ($ring) { +0 => null, +1 => 'ring-1', +2 => 'ring-2', +3 => 'ring', +4 => 'ring-4', +default => $ring, +}, +]); + +$hasLimitedRemainingText = $hasLimitedRemainingText(); +$isLimitedRemainingTextSeparate = $isLimitedRemainingTextSeparate(); + +$limitedRemainingTextSizeClasses = match ($getLimitedRemainingTextSize()) { +'xs' => 'text-xs', +'sm', null => 'text-sm', +'base', 'md' => 'text-base', +'lg' => 'text-lg', +default => $size, +}; @endphp -
merge($getExtraAttributes(), escape: false) ->class([ 'fi-in-image flex items-center gap-x-2.5', ]) - }} - - ax-load - ax-load-src="{{\Filament\Support\Facades\FilamentAsset::getScriptSrc('filament-swiper-scripts', - 'rupadana/filament-swiper')}}" -> + }} ax-load ax-load-src="{{\Filament\Support\Facades\FilamentAsset::getScriptSrc('filament-swiper-scripts', + 'rupadana/filament-swiper')}}"> @if (count($limitedState)) - - @foreach ($limitedState as $stateItem) - - + @foreach ($limitedState as $stateItem) + + class([ 'max-w-none object-cover object-center', @@ -165,48 +108,36 @@ "height: {$height}" => $height, "width: {$width}" => $width, ]) - }} - /> - - @endforeach + }} /> + + @endforeach - @if ($hasLimitedRemainingText && ($loop->iteration < count($limitedState)) && (! $isLimitedRemainingTextSeparate) && $isCircular) -
$isCircular, - $limitedRemainingTextSizeClasses, - $ringClasses, - ]) - @style([ - "height: {$height}" => $height, - "width: {$width}" => $width, - ]) - > - - +{{ count($state) - count($limitedState) }} - -
- @endif -
- - @if ($hasLimitedRemainingText && ($loop->iteration < count($limitedState)) && ($isLimitedRemainingTextSeparate || (! $isCircular))) -
$isCircular, + $limitedRemainingTextSizeClasses, + $ringClasses, + ]) + @style([ + "height: {$height}" => $height, + "width: {$width}" => $width, + ]) > + +{{ count($state) - count($limitedState) }} -
- @endif + +
+@endif + + +@if ($hasLimitedRemainingText && ($loop->iteration < count($limitedState)) && ($isLimitedRemainingTextSeparate || (! $isCircular)))
+ +{{ count($state) - count($limitedState) }} +
+ @endif @elseif (($placeholder = $getPlaceholder()) !== null) - - {{ $placeholder }} - + + {{ $placeholder }} + @endif - + \ No newline at end of file diff --git a/resources/views/infolists/components/swiper.blade.php b/resources/views/infolists/components/swiper.blade.php index ed1ecfc..8e769a6 100644 --- a/resources/views/infolists/components/swiper.blade.php +++ b/resources/views/infolists/components/swiper.blade.php @@ -1,6 +1,4 @@ -