Skip to content

Commit

Permalink
feat: Update maps column view to allow the use of placeholders
Browse files Browse the repository at this point in the history
See Pull Request cheesegrits#119 on original repo from ryanmortier
  • Loading branch information
Heyian committed Aug 28, 2024
1 parent 3c1767b commit b566f67
Showing 1 changed file with 28 additions and 7 deletions.
35 changes: 28 additions & 7 deletions resources/views/columns/filament-google-maps-column.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,25 +3,46 @@
'px-4 py-3' => ! $isInline(),
]) }}>
@php
$height = $getHeight();
$width = $getWidth();
use Filament\Support\Enums\Alignment;
$height = $getHeight();
$width = $getWidth();
$alignment = $getAlignment();
if (! $alignment instanceof Alignment) {
$alignment = filled($alignment) ? (Alignment::tryFrom($alignment) ?? $alignment) : null;
}
@endphp

<div
style="
@class([
'flex items-center',
match ($alignment) {
Alignment::Start, Alignment::Left => 'text-start justify-start',
Alignment::Center => 'text-center justify-center',
Alignment::End, Alignment::Right => 'text-end justify-end',
Alignment::Between, Alignment::Justify => 'text-justify justify-between',
default => $alignment,
},
])
style="
{!! $height !== null ? "height: {$height}px;" : null !!}
{!! $width !== null ? "width: {$width}px;" : null !!}
"
>
@if ($path = $getImagePath())
<img
src="{{ $path }}"
style="
src="{{ $path }}"
style="
{!! $height !== null ? "height: {$height}px;" : null !!}
{!! $width !== null ? "width: {$width}px;" : null !!}
"
{{ $getExtraImgAttributeBag() }}
{{ $getExtraImgAttributeBag() }}
>
@endif
@elseif (($placeholder = $getPlaceholder()) !== null)
<x-filament-tables::columns.placeholder>
{{ $placeholder }}
</x-filament-tables::columns.placeholder>
@endif
</div>
</div>

0 comments on commit b566f67

Please sign in to comment.