Skip to content

Commit

Permalink
Merge pull request #4853 from AAbosham/2.x
Browse files Browse the repository at this point in the history
  • Loading branch information
danharrin committed Nov 6, 2022
2 parents b7e0a81 + 2297a6a commit 3e82250
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,12 @@
'filament-tables-badge-column flex',
'px-4 py-3' => ! $isInline(),
match ($getAlignment()) {
'left' => 'justify-start',
'start' => 'justify-start',
'center' => 'justify-center',
'right' => 'justify-end',
'end' => 'justify-end',
'left' => 'justify-start rtl:flex-row-reverse',
'center' => 'justify-center',
'right' => 'justify-end rtl:flex-row-reverse',
default => null,
},
]) }}>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,10 @@
->class([
'flex flex-col',
match ($getAlignment()) {
'start' => 'items-start',
'center' => 'items-center',
'end' => 'items-end',
'left' => 'items-start',
'right' => 'items-end',
default => 'items-start',
},
Expand Down
9 changes: 6 additions & 3 deletions packages/tables/resources/views/columns/tags-column.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,12 @@
'filament-tables-tags-column flex flex-wrap items-center gap-1',
'px-4 py-3' => ! $isInline(),
match ($getAlignment()) {
'left' => 'justify-start',
'start' => 'justify-start',
'center' => 'justify-center',
'right' => 'justify-end',
'end' => 'justify-end',
'left' => 'justify-start rtl:flex-row-reverse',
'center' => 'justify-center',
'right' => 'justify-end rtl:flex-row-reverse',
default => null,
},
]) }}>
Expand All @@ -22,7 +25,7 @@
@endforeach

@if ($hasActiveLimit())
<span class="text-xs ml-1">
<span class="ml-1 text-xs">
{{ trans_choice('tables::table.columns.tags.more', count($getTags()) - $getLimit()) }}
</span>
@endif
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,11 @@
{{ $attributes->class([
'filament-tables-column-wrapper',
match ($alignment) {
'start', 'left' => 'text-start',
'start' => 'text-start',
'center' => 'text-center',
'end', 'right' => 'text-end',
'end' => 'text-end',
'left' => 'text-left',
'right' => 'text-right',
'justify' => 'text-justify',
default => null,
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,12 @@
'dark:text-gray-300' => config('tables.dark_mode'),
'cursor-default' => ! $sortable,
match ($alignment) {
'left' => 'justify-start',
'start' => 'justify-start',
'center' => 'justify-center',
'right' => 'justify-end',
'end' => 'justify-end',
'left' => 'justify-start rtl:flex-row-reverse',
'center' => 'justify-center',
'right' => 'justify-end rtl:flex-row-reverse',
default => null,
},
])
Expand Down
4 changes: 2 additions & 2 deletions packages/tables/src/Columns/Concerns/HasAlignment.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,12 @@ public function alignJustify(bool | Closure $condition = true): static

public function alignLeft(bool | Closure $condition = true): static
{
return $this->alignStart($condition);
return $this->alignment(static fn (): ?string => $condition ? 'left' : null);
}

public function alignRight(bool | Closure $condition = true): static
{
return $this->alignEnd($condition);
return $this->alignment(static fn (): ?string => $condition ? 'right' : null);
}

public function getAlignment(): ?string
Expand Down

0 comments on commit 3e82250

Please sign in to comment.