Skip to content

Commit

Permalink
Finish refactoring table view
Browse files Browse the repository at this point in the history
  • Loading branch information
danharrin committed Oct 14, 2024
1 parent 785753c commit 2a6fcfa
Show file tree
Hide file tree
Showing 8 changed files with 62 additions and 72 deletions.
2 changes: 1 addition & 1 deletion docs-assets/app/public/css/filament/support/support.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion packages/support/dist/index.css

Large diffs are not rendered by default.

27 changes: 27 additions & 0 deletions packages/support/resources/css/components/tables/empty-state.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
.fi-ta-empty-state {
@apply px-6 py-12;

& .fi-ta-empty-state-content {
@apply mx-auto grid max-w-lg justify-items-center text-center;

& .fi-ta-empty-state-icon-ctn {
@apply mb-4 rounded-full bg-gray-100 p-3 dark:bg-gray-500/20;

& .fi-icon {
@apply size-6 text-gray-500 dark:text-gray-400;
}
}

& .fi-ta-empty-state-heading {
@apply text-base font-semibold leading-6 text-gray-950 dark:text-white;
}

& .fi-ta-empty-state-description {
@apply mt-1 text-sm text-gray-500 dark:text-gray-400;
}

& .fi-ta-actions {
@apply mt-6;
}
}
}
1 change: 1 addition & 0 deletions packages/support/resources/js/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import '../css/components/tables/columns/image.css'
import '../css/components/tables/columns/text.css'
import '../css/components/tables/container.css'
import '../css/components/tables/content.css'
import '../css/components/tables/empty-state.css'
import '../css/components/tables/header-cell.css'
import '../css/components/tables/row.css'
import '../css/components/tables/table.css'
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

47 changes: 32 additions & 15 deletions packages/tables/resources/views/index.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -1764,21 +1764,38 @@ class="fi-ta-record-checkbox fi-checkbox-input"
@elseif ($emptyState = $getEmptyState())
{{ $emptyState }}
@else
<tr>
<td colspan="{{ $columnsCount }}">
<x-filament-tables::empty-state
:actions="
array_filter(
$getEmptyStateActions(),
fn (\Filament\Actions\Action | \Filament\Actions\ActionGroup $action): bool => $action->isVisible(),
)
"
:description="$getEmptyStateDescription()"
:heading="$getEmptyStateHeading()"
:icon="$getEmptyStateIcon()"
/>
</td>
</tr>
<div class="fi-ta-empty-state">
<div
class="fi-ta-empty-state-content"
>
<div
class="fi-ta-empty-state-icon-ctn"
>
{{ \Filament\Support\generate_icon_html($getEmptyStateIcon()) }}
</div>

<h4 class="fi-ta-empty-state-heading">
{{ $getEmptyStateHeading() }}
</h4>

@if ($emptyStateDescription = $getEmptyStateDescription())
<p class="fi-ta-empty-state-description">
{{ $description }}
</p>
@endif

@if ($emptyStateActions = array_filter(
$getEmptyStateActions(),
fn (\Filament\Actions\Action | \Filament\Actions\ActionGroup $action): bool => $action->isVisible(),
))
<div class="fi-ta-actions fi-align-center fi-wrapped">
@foreach ($emptyStateActions as $action)
{{ $action }}
@endforeach
</div>
@endif
</div>
</div>
@endif
</div>

Expand Down

0 comments on commit 2a6fcfa

Please sign in to comment.