refactoring into clusters
This commit is contained in:
1 parent
042a5a8b58
commit
48deb69379
97 files changed
+186
-198
No files matched your search
+72
@@ -0,0 +1,72 @@
|
||||
<?php
|
||||
|
||||
namespace App\Filament\Clusters\Administration\Inhaltsverzeichnis\Tables;
|
||||
|
||||
use Filament\Actions\DeleteAction;
|
||||
use Filament\Actions\EditAction;
|
||||
use Filament\Tables\Columns\IconColumn;
|
||||
use Filament\Tables\Columns\TextColumn;
|
||||
use Filament\Tables\Columns\TextInputColumn;
|
||||
use Filament\Tables\Enums\FiltersLayout;
|
||||
use Filament\Tables\Filters\SelectFilter;
|
||||
use Filament\Tables\Table;
|
||||
|
||||
class InhaltsverzeichnisTable
|
||||
{
|
||||
public static function configure(Table $table): Table
|
||||
{
|
||||
return $table
|
||||
->heading('Inhaltsverzeichnis')
|
||||
->description('Vorlage zum Erstellen von neuen Projekte. Das Inhaltsverzeichnis ist unterteilt in drei Abschnitte (Filter).')
|
||||
->columns([
|
||||
TextColumn::make('ordnungszahl')
|
||||
->label('Index')
|
||||
->getStateUsing(fn ($record): string => $record->ordnungszahl == '0' ? '' : number_format($record->ordnungszahl, 2)),
|
||||
IconColumn::make('neue_seite')
|
||||
->tooltip('Start neue Seite')
|
||||
->color('primary')
|
||||
->label('Start')
|
||||
->icon(fn (string $state): string => match ($state) {
|
||||
'1' => 'phosphor-file-plus',
|
||||
default => ''
|
||||
}),
|
||||
TextColumn::make('name')
|
||||
->color('primary')
|
||||
->label('Überschrift')
|
||||
->wrap(),
|
||||
TextColumn::make('inhaltselement.name')
|
||||
->label('Element')
|
||||
->wrap(),
|
||||
TextColumn::make('textblock.name')
|
||||
->wrap(),
|
||||
TextInputColumn::make('seite')
|
||||
->extraInputAttributes(['onClick' => 'this.select()'])
|
||||
->alignCenter()
|
||||
->tooltip('Bei 0 wird keine Seitenzahl ausgegeben.')
|
||||
->getStateUsing(fn ($record): string => $record->seite == 0 ? '' : $record->seite),
|
||||
])
|
||||
// ->paginated(false)
|
||||
->defaultPaginationPageOption(5)
|
||||
->persistFiltersInSession()
|
||||
->deferFilters(false)
|
||||
->filtersFormColumns(3)
|
||||
->filters([
|
||||
SelectFilter::make('part')
|
||||
->selectablePlaceholder(false)
|
||||
->default('standard')
|
||||
->label('Gutachten Komponenten')
|
||||
->options([
|
||||
'standard' => 'Gutachten Standard Texte',
|
||||
'nutzwerte' => 'Nutzwerberechnung',
|
||||
'paragraph' => 'Auszug Gutachten gem. §6',
|
||||
]),
|
||||
])
|
||||
// ], layout: FiltersLayout::AboveContent)
|
||||
->defaultSort('sort', direction: 'asc')
|
||||
->reorderable('sort')
|
||||
->recordActions([
|
||||
EditAction::make()->iconButton()->hidden(fn ($record) => (bool) $record->no_edit),
|
||||
DeleteAction::make()->iconButton(),
|
||||
]);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user