phases one of time logged now with log display
This commit is contained in:
+24
-68
@@ -10,102 +10,65 @@
|
||||
'reorderAnimationDuration' => 300,
|
||||
])
|
||||
|
||||
<div
|
||||
@if ($hasReorderableColumns)
|
||||
x-sortable
|
||||
<div @if ($hasReorderableColumns) x-sortable
|
||||
x-on:end.stop="reorderColumns($event.target.sortable.toArray())"
|
||||
data-sortable-animation-duration="{{ $reorderAnimationDuration }}"
|
||||
@endif
|
||||
{{
|
||||
(new ComponentAttributeBag)
|
||||
->grid($columns, GridDirection::Column)
|
||||
->class(['fi-ta-col-manager-items'])
|
||||
}}
|
||||
>
|
||||
<template
|
||||
x-for="(column, index) in columns.filter((column) => ! column.isHidden && column.label)"
|
||||
x-bind:key="(column.type === 'group' ? 'group::' : 'column::') + column.name + '_' + index"
|
||||
>
|
||||
data-sortable-animation-duration="{{ $reorderAnimationDuration }}" @endif
|
||||
{{ new ComponentAttributeBag()->grid($columns, GridDirection::Column)->class(['fi-ta-col-manager-items']) }}>
|
||||
<template x-for="(column, index) in columns.filter((column) => ! column.isHidden && column.label)"
|
||||
x-bind:key="(column.type === 'group' ? 'group::' : 'column::') + column.name + '_' + index">
|
||||
<div
|
||||
@if ($hasReorderableColumns)
|
||||
x-bind:x-sortable-item="column.type === 'group' ? 'group::' + column.name : 'column::' + column.name"
|
||||
@endif
|
||||
>
|
||||
@if ($hasReorderableColumns) x-bind:x-sortable-item="column.type === 'group' ? 'group::' + column.name : 'column::' + column.name" @endif>
|
||||
<template x-if="column.type === 'group'">
|
||||
<div class="fi-ta-col-manager-group">
|
||||
<div class="fi-ta-col-manager-item">
|
||||
<label class="fi-ta-col-manager-label">
|
||||
@if ($hasToggleableColumns)
|
||||
<input
|
||||
type="checkbox"
|
||||
class="fi-checkbox-input fi-valid"
|
||||
<input type="checkbox" class="fi-checkbox-input fi-valid"
|
||||
x-bind:id="'group-' + column.name"
|
||||
x-bind:checked="(groupedColumns[column.name] || {}).checked || false"
|
||||
x-bind:disabled="(groupedColumns[column.name] || {}).disabled || false"
|
||||
x-effect="$el.indeterminate = (groupedColumns[column.name] || {}).indeterminate || false"
|
||||
x-on:change="toggleGroup(column.name)"
|
||||
/>
|
||||
x-on:change="toggleGroup(column.name)" />
|
||||
@endif
|
||||
|
||||
<span x-html="column.label"></span>
|
||||
</label>
|
||||
|
||||
@if ($hasReorderableColumns)
|
||||
<button
|
||||
x-sortable-handle
|
||||
x-on:click.stop
|
||||
class="fi-ta-col-manager-reorder-handle fi-icon-btn"
|
||||
type="button"
|
||||
>
|
||||
<button x-sortable-handle x-on:click.stop
|
||||
class="fi-ta-col-manager-reorder-handle fi-icon-btn" type="button">
|
||||
{{ \Filament\Support\generate_icon_html(\Filament\Support\Icons\Heroicon::Bars2, alias: \Filament\Tables\View\TablesIconAlias::REORDER_HANDLE) }}
|
||||
</button>
|
||||
@endif
|
||||
</div>
|
||||
<div
|
||||
@if ($hasReorderableColumns)
|
||||
x-sortable
|
||||
<div @if ($hasReorderableColumns) x-sortable
|
||||
x-on:end.stop="reorderGroupColumns($event.target.sortable.toArray(), column.name)"
|
||||
data-sortable-animation-duration="{{ $reorderAnimationDuration }}"
|
||||
@endif
|
||||
class="fi-ta-col-manager-group-items"
|
||||
>
|
||||
data-sortable-animation-duration="{{ $reorderAnimationDuration }}" @endif
|
||||
class="fi-ta-col-manager-group-items">
|
||||
<template
|
||||
x-for="
|
||||
(groupColumn, index) in
|
||||
column.columns.filter((column) => ! column.isHidden && column.label)
|
||||
"
|
||||
x-bind:key="'column::' + groupColumn.name + '_' + index"
|
||||
>
|
||||
x-bind:key="'column::' + groupColumn.name + '_' + index">
|
||||
<div
|
||||
@if ($hasReorderableColumns)
|
||||
x-bind:x-sortable-item="'column::' + groupColumn.name"
|
||||
@endif
|
||||
>
|
||||
@if ($hasReorderableColumns) x-bind:x-sortable-item="'column::' + groupColumn.name" @endif>
|
||||
<div class="fi-ta-col-manager-item">
|
||||
<label class="fi-ta-col-manager-label">
|
||||
@if ($hasToggleableColumns)
|
||||
<input
|
||||
type="checkbox"
|
||||
class="fi-checkbox-input fi-valid"
|
||||
<input type="checkbox" class="fi-checkbox-input fi-valid"
|
||||
x-bind:id="'column-' + groupColumn.name.replace('.', '-')"
|
||||
x-bind:checked="(getColumn(groupColumn.name, column.name) || {}).isToggled || false"
|
||||
x-bind:disabled="(getColumn(groupColumn.name, column.name) || {}).isToggleable === false"
|
||||
x-on:change="toggleColumn(groupColumn.name, column.name)"
|
||||
/>
|
||||
x-on:change="toggleColumn(groupColumn.name, column.name)" />
|
||||
@endif
|
||||
|
||||
<span
|
||||
x-html="groupColumn.label"
|
||||
></span>
|
||||
<span x-html="groupColumn.label"></span>
|
||||
</label>
|
||||
|
||||
@if ($hasReorderableColumns)
|
||||
<button
|
||||
x-sortable-handle
|
||||
x-on:click.stop
|
||||
class="fi-ta-col-manager-reorder-handle fi-icon-btn"
|
||||
type="button"
|
||||
>
|
||||
<button x-sortable-handle x-on:click.stop
|
||||
class="fi-ta-col-manager-reorder-handle fi-icon-btn" type="button">
|
||||
{{ \Filament\Support\generate_icon_html(\Filament\Support\Icons\Heroicon::Bars2, alias: \Filament\Tables\View\TablesIconAlias::REORDER_HANDLE) }}
|
||||
</button>
|
||||
@endif
|
||||
@@ -119,26 +82,19 @@
|
||||
<div class="fi-ta-col-manager-item">
|
||||
<label class="fi-ta-col-manager-label">
|
||||
@if ($hasToggleableColumns)
|
||||
<input
|
||||
type="checkbox"
|
||||
class="fi-checkbox-input fi-valid"
|
||||
<input type="checkbox" class="fi-checkbox-input fi-valid"
|
||||
x-bind:id="'column-' + column.name.replace('.', '-')"
|
||||
x-bind:checked="(getColumn(column.name, null) || {}).isToggled || false"
|
||||
x-bind:disabled="(getColumn(column.name, null) || {}).isToggleable === false"
|
||||
x-on:change="toggleColumn(column.name)"
|
||||
/>
|
||||
x-on:change="toggleColumn(column.name)" />
|
||||
@endif
|
||||
|
||||
<span x-html="column.label"></span>
|
||||
</label>
|
||||
|
||||
@if ($hasReorderableColumns)
|
||||
<button
|
||||
x-sortable-handle
|
||||
x-on:click.stop
|
||||
class="fi-ta-col-manager-reorder-handle fi-icon-btn"
|
||||
type="button"
|
||||
>
|
||||
<button x-sortable-handle x-on:click.stop class="fi-ta-col-manager-reorder-handle fi-icon-btn"
|
||||
type="button">
|
||||
{{ \Filament\Support\generate_icon_html(\Filament\Support\Icons\Heroicon::Bars2, alias: \Filament\Tables\View\TablesIconAlias::REORDER_HANDLE) }}
|
||||
</button>
|
||||
@endif
|
||||
|
||||
+24
-39
@@ -13,46 +13,35 @@
|
||||
'resetActionPosition' => ColumnManagerResetActionPosition::Header,
|
||||
])
|
||||
|
||||
<div
|
||||
x-data="filamentTableColumnManager({
|
||||
columns: $wire.entangle('tableColumns'),
|
||||
isLive: {{ $applyAction->isVisible() ? 'false' : 'true' }},
|
||||
})"
|
||||
class="fi-ta-col-manager"
|
||||
>
|
||||
<div x-data="filamentTableColumnManager({
|
||||
columns: $wire.entangle('tableColumns'),
|
||||
isLive: {{ $applyAction->isVisible() ? 'false' : 'true' }},
|
||||
})" class="fi-ta-col-manager">
|
||||
<div class="fi-ta-col-manager-header">
|
||||
<{{ $headingTag }} class="fi-ta-col-manager-heading">
|
||||
{{ __('filament-tables::table.column_manager.heading') }}
|
||||
</{{ $headingTag }}>
|
||||
</{{ $headingTag }}>
|
||||
|
||||
@if ($resetActionPosition === ColumnManagerResetActionPosition::Header)
|
||||
<div>
|
||||
<x-filament::link
|
||||
:attributes="
|
||||
\Filament\Support\prepare_inherited_attributes(
|
||||
new ComponentAttributeBag([
|
||||
'color' => 'danger',
|
||||
'tag' => 'button',
|
||||
'wire:click' => 'resetTableColumnManager',
|
||||
'wire:loading.remove.delay.' . config('filament.livewire_loading_delay', 'default') => '',
|
||||
'wire:target' => 'resetTableColumnManager',
|
||||
'x-on:click' => 'resetDeferredColumns',
|
||||
])
|
||||
)
|
||||
"
|
||||
>
|
||||
{{ __('filament-tables::table.column_manager.actions.reset.label') }}
|
||||
</x-filament::link>
|
||||
</div>
|
||||
@endif
|
||||
@if ($resetActionPosition === ColumnManagerResetActionPosition::Header)
|
||||
<div>
|
||||
<x-filament::link :attributes="\Filament\Support\prepare_inherited_attributes(
|
||||
new ComponentAttributeBag([
|
||||
'color' => 'danger',
|
||||
'tag' => 'button',
|
||||
'wire:click' => 'resetTableColumnManager',
|
||||
'wire:loading.remove.delay.' . config('filament.livewire_loading_delay', 'default') => '',
|
||||
'wire:target' => 'resetTableColumnManager',
|
||||
'x-on:click' => 'resetDeferredColumns',
|
||||
]),
|
||||
)">
|
||||
{{ __('filament-tables::table.column_manager.actions.reset.label') }}
|
||||
</x-filament::link>
|
||||
</div>
|
||||
@endif
|
||||
</div>
|
||||
|
||||
<x-filament-tables::column-manager.content
|
||||
:columns="$columns"
|
||||
:has-reorderable-columns="$hasReorderableColumns"
|
||||
:has-toggleable-columns="$hasToggleableColumns"
|
||||
:reorder-animation-duration="$reorderAnimationDuration"
|
||||
/>
|
||||
<x-filament-tables::column-manager.content :columns="$columns" :has-reorderable-columns="$hasReorderableColumns" :has-toggleable-columns="$hasToggleableColumns"
|
||||
:reorder-animation-duration="$reorderAnimationDuration" />
|
||||
|
||||
@if ($applyAction->isVisible() || $resetActionPosition === ColumnManagerResetActionPosition::Footer)
|
||||
<div class="fi-ta-col-manager-actions-ctn">
|
||||
@@ -61,11 +50,7 @@
|
||||
@endif
|
||||
|
||||
@if ($resetActionPosition === ColumnManagerResetActionPosition::Footer)
|
||||
<x-filament::button
|
||||
color="danger"
|
||||
wire:click="resetTableColumnManager"
|
||||
x-on:click="resetDeferredColumns"
|
||||
>
|
||||
<x-filament::button color="danger" wire:click="resetTableColumnManager" x-on:click="resetDeferredColumns">
|
||||
{{ __('filament-tables::table.column_manager.actions.reset.label') }}
|
||||
</x-filament::button>
|
||||
@endif
|
||||
|
||||
+2
-13
@@ -1,18 +1,7 @@
|
||||
{{-- @deprecated Copy the code from this view directly into your own view to improve performance. --}}
|
||||
|
||||
@props([
|
||||
'components',
|
||||
'record',
|
||||
'recordKey' => null,
|
||||
'rowLoop' => null,
|
||||
])
|
||||
@props(['components', 'record', 'recordKey' => null, 'rowLoop' => null])
|
||||
|
||||
@foreach ($components as $layoutComponent)
|
||||
{{
|
||||
$layoutComponent
|
||||
->record($record)
|
||||
->recordKey($recordKey)
|
||||
->rowLoop($rowLoop)
|
||||
->renderInLayout()
|
||||
}}
|
||||
{{ $layoutComponent->record($record)->recordKey($recordKey)->rowLoop($rowLoop)->renderInLayout() }}
|
||||
@endforeach
|
||||
|
||||
@@ -2,38 +2,29 @@
|
||||
use Filament\Tables\Enums\FiltersResetActionPosition;
|
||||
@endphp
|
||||
|
||||
@props([
|
||||
'applyAction',
|
||||
'form',
|
||||
'headingTag' => 'h3',
|
||||
'resetActionPosition' => FiltersResetActionPosition::Header,
|
||||
])
|
||||
@props(['applyAction', 'form', 'headingTag' => 'h3', 'resetActionPosition' => FiltersResetActionPosition::Header])
|
||||
|
||||
<div {{ $attributes->class(['fi-ta-filters']) }}>
|
||||
<div class="fi-ta-filters-header">
|
||||
<{{ $headingTag }} class="fi-ta-filters-heading">
|
||||
{{ __('filament-tables::table.filters.heading') }}
|
||||
</{{ $headingTag }}>
|
||||
</{{ $headingTag }}>
|
||||
|
||||
@if ($resetActionPosition === FiltersResetActionPosition::Header)
|
||||
<div>
|
||||
<x-filament::link
|
||||
:attributes="
|
||||
\Filament\Support\prepare_inherited_attributes(
|
||||
new \Illuminate\View\ComponentAttributeBag([
|
||||
'color' => 'danger',
|
||||
'tag' => 'button',
|
||||
'wire:click' => 'resetTableFiltersForm',
|
||||
'wire:loading.remove.delay.' . config('filament.livewire_loading_delay', 'default') => '',
|
||||
'wire:target' => 'resetTableFiltersForm',
|
||||
])
|
||||
)
|
||||
"
|
||||
>
|
||||
{{ __('filament-tables::table.filters.actions.reset.label') }}
|
||||
</x-filament::link>
|
||||
</div>
|
||||
@endif
|
||||
@if ($resetActionPosition === FiltersResetActionPosition::Header)
|
||||
<div>
|
||||
<x-filament::link :attributes="\Filament\Support\prepare_inherited_attributes(
|
||||
new \Illuminate\View\ComponentAttributeBag([
|
||||
'color' => 'danger',
|
||||
'tag' => 'button',
|
||||
'wire:click' => 'resetTableFiltersForm',
|
||||
'wire:loading.remove.delay.' . config('filament.livewire_loading_delay', 'default') => '',
|
||||
'wire:target' => 'resetTableFiltersForm',
|
||||
]),
|
||||
)">
|
||||
{{ __('filament-tables::table.filters.actions.reset.label') }}
|
||||
</x-filament::link>
|
||||
</div>
|
||||
@endif
|
||||
</div>
|
||||
|
||||
{{ $form }}
|
||||
@@ -45,10 +36,7 @@
|
||||
@endif
|
||||
|
||||
@if ($resetActionPosition === FiltersResetActionPosition::Footer)
|
||||
<x-filament::button
|
||||
color="danger"
|
||||
wire:click="resetTableFiltersForm"
|
||||
>
|
||||
<x-filament::button color="danger" wire:click="resetTableFiltersForm">
|
||||
{{ __('filament-tables::table.filters.actions.reset.label') }}
|
||||
</x-filament::button>
|
||||
@endif
|
||||
|
||||
@@ -13,34 +13,25 @@
|
||||
$wireModelAttribute = $onBlur ? 'wire:model.live.blur' : "wire:model.live.debounce.{$debounce}";
|
||||
@endphp
|
||||
|
||||
<div
|
||||
x-id="['input']"
|
||||
{{ $attributes->class(['fi-ta-search-field']) }}
|
||||
>
|
||||
<div x-id="['input']" {{ $attributes->class(['fi-ta-search-field']) }}>
|
||||
<label x-bind:for="$id('input')" class="fi-sr-only">
|
||||
{{ __('filament-tables::table.fields.search.label') }}
|
||||
</label>
|
||||
|
||||
<x-filament::input.wrapper
|
||||
inline-prefix
|
||||
:prefix-icon="\Filament\Support\Icons\Heroicon::MagnifyingGlass"
|
||||
:prefix-icon-alias="\Filament\Tables\View\TablesIconAlias::SEARCH_FIELD"
|
||||
:wire:target="$wireModel"
|
||||
>
|
||||
<x-filament::input
|
||||
:attributes="
|
||||
(new ComponentAttributeBag)->merge([
|
||||
'autocomplete' => 'off',
|
||||
'inlinePrefix' => true,
|
||||
'maxlength' => 1000,
|
||||
'placeholder' => $placeholder,
|
||||
'type' => 'search',
|
||||
'wire:key' => $this->getId() . '.table.' . $wireModel . '.field.input',
|
||||
$wireModelAttribute => $wireModel,
|
||||
'x-bind:id' => '$id(\'input\')',
|
||||
'x-on:keyup' => 'if ($event.key === \'Enter\') { $wire.$refresh() }',
|
||||
], escape: false)
|
||||
"
|
||||
/>
|
||||
<x-filament::input.wrapper inline-prefix :prefix-icon="\Filament\Support\Icons\Heroicon::MagnifyingGlass" :prefix-icon-alias="\Filament\Tables\View\TablesIconAlias::SEARCH_FIELD" :wire:target="$wireModel">
|
||||
<x-filament::input :attributes="new ComponentAttributeBag()->merge(
|
||||
[
|
||||
'autocomplete' => 'off',
|
||||
'inlinePrefix' => true,
|
||||
'maxlength' => 1000,
|
||||
'placeholder' => $placeholder,
|
||||
'type' => 'search',
|
||||
'wire:key' => $this->getId() . '.table.' . $wireModel . '.field.input',
|
||||
$wireModelAttribute => $wireModel,
|
||||
'x-bind:id' => '$id(\'input\')',
|
||||
'x-on:keyup' => 'if ($event.key === \'Enter\') { $wire.$refresh() }',
|
||||
],
|
||||
escape: false,
|
||||
)" />
|
||||
</x-filament::input.wrapper>
|
||||
</div>
|
||||
|
||||
+37
-45
@@ -21,12 +21,14 @@
|
||||
use Filament\Tables\Enums\RecordCheckboxPosition;
|
||||
|
||||
if ($groupsOnly && $groupColumn) {
|
||||
$columns = collect($columns)
|
||||
->reject(fn (Column $column): bool => $column->getName() === $groupColumn)
|
||||
->all();
|
||||
$columns = collect($columns)->reject(fn(Column $column): bool => $column->getName() === $groupColumn)->all();
|
||||
}
|
||||
|
||||
$hasPageSummary = $pageSummary && (! $groupsOnly) && $records instanceof \Illuminate\Contracts\Pagination\Paginator && $records->hasPages();
|
||||
$hasPageSummary =
|
||||
$pageSummary &&
|
||||
!$groupsOnly &&
|
||||
$records instanceof \Illuminate\Contracts\Pagination\Paginator &&
|
||||
$records->hasPages();
|
||||
|
||||
$pageTableSummaryQuery = $hasPageSummary ? $this->getPageTableSummaryQuery() : null;
|
||||
$allTableSummaryQuery = $allTableSummary ? $this->getAllTableSummaryQuery() : null;
|
||||
@@ -34,7 +36,10 @@
|
||||
|
||||
@if ($hasPageSummary)
|
||||
<tr class="fi-ta-row fi-ta-summary-header-row fi-striped">
|
||||
@if ($placeholderColumns && $actions && in_array($actionsPosition, [RecordActionsPosition::BeforeCells, RecordActionsPosition::BeforeColumns]))
|
||||
@if (
|
||||
$placeholderColumns &&
|
||||
$actions &&
|
||||
in_array($actionsPosition, [RecordActionsPosition::BeforeCells, RecordActionsPosition::BeforeColumns]))
|
||||
<td></td>
|
||||
@endif
|
||||
|
||||
@@ -50,30 +55,30 @@
|
||||
|
||||
@foreach ($columns as $column)
|
||||
@php
|
||||
$columnHasSummary = ($pageTableSummaryQuery && $column->hasSummary($pageTableSummaryQuery)) || $column->hasSummary($allTableSummaryQuery);
|
||||
$columnHasSummary =
|
||||
($pageTableSummaryQuery && $column->hasSummary($pageTableSummaryQuery)) ||
|
||||
$column->hasSummary($allTableSummaryQuery);
|
||||
@endphp
|
||||
|
||||
@if ($placeholderColumns || $columnHasSummary)
|
||||
@php
|
||||
$alignment = $column->getAlignment() ?? Alignment::Start;
|
||||
|
||||
if (! $alignment instanceof Alignment) {
|
||||
$alignment = filled($alignment) ? (Alignment::tryFrom($alignment) ?? $alignment) : null;
|
||||
if (!$alignment instanceof Alignment) {
|
||||
$alignment = filled($alignment) ? Alignment::tryFrom($alignment) ?? $alignment : null;
|
||||
}
|
||||
|
||||
$hasColumnHeaderLabel = (! $placeholderColumns) || $columnHasSummary;
|
||||
$hasColumnHeaderLabel = !$placeholderColumns || $columnHasSummary;
|
||||
@endphp
|
||||
|
||||
<td
|
||||
{{
|
||||
$column->getExtraHeaderAttributeBag()->class([
|
||||
{{ $column->getExtraHeaderAttributeBag()->class([
|
||||
'fi-ta-cell fi-ta-summary-header-cell',
|
||||
'fi-wrapped' => $column->canHeaderWrap(),
|
||||
(($alignment instanceof Alignment) ? "fi-align-{$alignment->value}" : (is_string($alignment) ? $alignment : '')) => (! ($loop->first && (! $extraHeadingColumn))) && $hasColumnHeaderLabel,
|
||||
])
|
||||
}}
|
||||
>
|
||||
@if ($loop->first && (! $extraHeadingColumn))
|
||||
$alignment instanceof Alignment ? "fi-align-{$alignment->value}" : (is_string($alignment) ? $alignment : '') =>
|
||||
!($loop->first && !$extraHeadingColumn) && $hasColumnHeaderLabel,
|
||||
]) }}>
|
||||
@if ($loop->first && !$extraHeadingColumn)
|
||||
{{ __('filament-tables::table.summary.heading', ['label' => $pluralModelLabel]) }}
|
||||
@elseif ($hasColumnHeaderLabel)
|
||||
{{ $column->getLabel() }}
|
||||
@@ -82,7 +87,10 @@
|
||||
@endif
|
||||
@endforeach
|
||||
|
||||
@if ($placeholderColumns && $actions && in_array($actionsPosition, [RecordActionsPosition::AfterColumns, RecordActionsPosition::AfterCells]))
|
||||
@if (
|
||||
$placeholderColumns &&
|
||||
$actions &&
|
||||
in_array($actionsPosition, [RecordActionsPosition::AfterColumns, RecordActionsPosition::AfterCells]))
|
||||
<td></td>
|
||||
@endif
|
||||
|
||||
@@ -95,18 +103,8 @@
|
||||
$selectedState = $this->getTableSummarySelectedState($pageTableSummaryQuery)[0] ?? [];
|
||||
@endphp
|
||||
|
||||
<x-filament-tables::summary.row
|
||||
:actions="$actions"
|
||||
:actions-position="$actionsPosition"
|
||||
:columns="$columns"
|
||||
:extra-heading-column="$extraHeadingColumn"
|
||||
:heading="__('filament-tables::table.summary.subheadings.page', ['label' => $pluralModelLabel])"
|
||||
:placeholder-columns="$placeholderColumns"
|
||||
:query="$pageTableSummaryQuery"
|
||||
:record-checkbox-position="$recordCheckboxPosition"
|
||||
:selected-state="$selectedState"
|
||||
:selection-enabled="$selectionEnabled"
|
||||
/>
|
||||
<x-filament-tables::summary.row :actions="$actions" :actions-position="$actionsPosition" :columns="$columns" :extra-heading-column="$extraHeadingColumn"
|
||||
:heading="__('filament-tables::table.summary.subheadings.page', ['label' => $pluralModelLabel])" :placeholder-columns="$placeholderColumns" :query="$pageTableSummaryQuery" :record-checkbox-position="$recordCheckboxPosition" :selected-state="$selectedState" :selection-enabled="$selectionEnabled" />
|
||||
@endif
|
||||
|
||||
@if ($allTableSummary)
|
||||
@@ -114,20 +112,14 @@
|
||||
$selectedState = $this->getTableSummarySelectedState($allTableSummaryQuery)[0] ?? [];
|
||||
@endphp
|
||||
|
||||
<x-filament-tables::summary.row
|
||||
:actions="$actions"
|
||||
:actions-position="$actionsPosition"
|
||||
:columns="$columns"
|
||||
:extra-heading-column="$extraHeadingColumn"
|
||||
:groups-only="$groupsOnly"
|
||||
:heading="__(($hasPageSummary ? 'filament-tables::table.summary.subheadings.all' : 'filament-tables::table.summary.heading'), ['label' => $pluralModelLabel])"
|
||||
:placeholder-columns="$placeholderColumns"
|
||||
:query="$allTableSummaryQuery"
|
||||
:record-checkbox-position="$recordCheckboxPosition"
|
||||
:selected-state="$selectedState"
|
||||
:selection-enabled="$selectionEnabled"
|
||||
@class([
|
||||
'fi-striped' => ! $hasPageSummary,
|
||||
])
|
||||
/>
|
||||
<x-filament-tables::summary.row :actions="$actions" :actions-position="$actionsPosition" :columns="$columns" :extra-heading-column="$extraHeadingColumn"
|
||||
:groups-only="$groupsOnly" :heading="__(
|
||||
$hasPageSummary
|
||||
? 'filament-tables::table.summary.subheadings.all'
|
||||
: 'filament-tables::table.summary.heading',
|
||||
['label' => $pluralModelLabel],
|
||||
)" :placeholder-columns="$placeholderColumns" :query="$allTableSummaryQuery" :record-checkbox-position="$recordCheckboxPosition"
|
||||
:selected-state="$selectedState" :selection-enabled="$selectionEnabled" @class([
|
||||
'fi-striped' => !$hasPageSummary,
|
||||
]) />
|
||||
@endif
|
||||
|
||||
@@ -20,14 +20,15 @@
|
||||
use Filament\Tables\Enums\RecordCheckboxPosition;
|
||||
|
||||
if ($groupsOnly && $groupColumn) {
|
||||
$columns = collect($columns)
|
||||
->reject(fn (Column $column): bool => $column->getName() === $groupColumn)
|
||||
->all();
|
||||
$columns = collect($columns)->reject(fn(Column $column): bool => $column->getName() === $groupColumn)->all();
|
||||
}
|
||||
@endphp
|
||||
|
||||
<tr {{ $attributes->class(['fi-ta-row fi-ta-summary-row']) }}>
|
||||
@if ($placeholderColumns && $actions && in_array($actionsPosition, [RecordActionsPosition::BeforeCells, RecordActionsPosition::BeforeColumns]))
|
||||
@if (
|
||||
$placeholderColumns &&
|
||||
$actions &&
|
||||
in_array($actionsPosition, [RecordActionsPosition::BeforeCells, RecordActionsPosition::BeforeColumns]))
|
||||
<td></td>
|
||||
@endif
|
||||
|
||||
@@ -58,26 +59,31 @@
|
||||
@endif
|
||||
|
||||
@foreach ($columns as $column)
|
||||
@if (($loop->first || $extraHeadingColumn || $groupsOnly || ($loop->iteration > $headingColumnSpan)) && ($placeholderColumns || $column->hasSummary($query)))
|
||||
@if (
|
||||
($loop->first || $extraHeadingColumn || $groupsOnly || $loop->iteration > $headingColumnSpan) &&
|
||||
($placeholderColumns || $column->hasSummary($query)))
|
||||
@php
|
||||
$alignment = $column->getAlignment() ?? Alignment::Start;
|
||||
|
||||
if (! $alignment instanceof Alignment) {
|
||||
$alignment = filled($alignment) ? (Alignment::tryFrom($alignment) ?? $alignment) : null;
|
||||
if (!$alignment instanceof Alignment) {
|
||||
$alignment = filled($alignment) ? Alignment::tryFrom($alignment) ?? $alignment : null;
|
||||
}
|
||||
@endphp
|
||||
|
||||
<td
|
||||
colspan="{{ ($loop->first && (! $extraHeadingColumn) && (! $groupsOnly) && ($headingColumnSpan > 1)) ? $headingColumnSpan : null }}"
|
||||
<td colspan="{{ $loop->first && !$extraHeadingColumn && !$groupsOnly && $headingColumnSpan > 1 ? $headingColumnSpan : null }}"
|
||||
@class([
|
||||
'fi-ta-cell',
|
||||
($alignment instanceof Alignment) ? "fi-align-{$alignment->value}" : (is_string($alignment) ? $alignment : ''),
|
||||
'fi-ta-summary-row-heading-cell' => $loop->first && (! $extraHeadingColumn) && (! $groupsOnly),
|
||||
])
|
||||
>
|
||||
@if ($loop->first && (! $extraHeadingColumn) && (! $groupsOnly))
|
||||
$alignment instanceof Alignment
|
||||
? "fi-align-{$alignment->value}"
|
||||
: (is_string($alignment)
|
||||
? $alignment
|
||||
: ''),
|
||||
'fi-ta-summary-row-heading-cell' =>
|
||||
$loop->first && !$extraHeadingColumn && !$groupsOnly,
|
||||
])>
|
||||
@if ($loop->first && !$extraHeadingColumn && !$groupsOnly)
|
||||
{{ $heading }}
|
||||
@elseif ((! $placeholderColumns) || $column->hasSummary($query))
|
||||
@elseif (!$placeholderColumns || $column->hasSummary($query))
|
||||
@foreach ($column->getSummarizers($query) as $summarizer)
|
||||
{{ $summarizer->query($query)->selectedState($selectedState) }}
|
||||
@endforeach
|
||||
@@ -86,7 +92,10 @@
|
||||
@endif
|
||||
@endforeach
|
||||
|
||||
@if ($placeholderColumns && $actions && in_array($actionsPosition, [RecordActionsPosition::AfterColumns, RecordActionsPosition::AfterCells]))
|
||||
@if (
|
||||
$placeholderColumns &&
|
||||
$actions &&
|
||||
in_array($actionsPosition, [RecordActionsPosition::AfterColumns, RecordActionsPosition::AfterCells]))
|
||||
<td></td>
|
||||
@endif
|
||||
|
||||
|
||||
Reference in New Issue
Block a user