mapper new
This commit is contained in:
1 parent
3a289dd776
commit
c5118a4fd0
12 files changed
+94
-119
No files matched your search
@@ -17,14 +17,12 @@ use Filament\Schemas\Components\Utilities\Get;
|
||||
use Filament\Schemas\Concerns\InteractsWithSchemas;
|
||||
use Filament\Schemas\Contracts\HasSchemas;
|
||||
use Filament\Support\Enums\Alignment;
|
||||
use Filament\Support\Enums\FontWeight;
|
||||
use Filament\Support\Enums\Size;
|
||||
use Filament\Tables\Columns\IconColumn;
|
||||
use Filament\Tables\Columns\TextColumn;
|
||||
use Filament\Tables\Concerns\InteractsWithTable;
|
||||
use Filament\Tables\Contracts\HasTable;
|
||||
use Filament\Tables\Enums\FiltersLayout;
|
||||
use Filament\Tables\Enums\RecordActionsPosition;
|
||||
use Filament\Tables\Filters\Filter;
|
||||
use Filament\Tables\Filters\Indicator;
|
||||
use Filament\Tables\Table;
|
||||
@@ -72,14 +70,11 @@ class MapperRight extends Component implements HasActions, HasSchemas, HasTable
|
||||
->query(LoadProvider::load($this->search_right, auth()->user()))
|
||||
->columns([
|
||||
MapperRightColumn::make('right')->label(''),
|
||||
TextColumn::make('home')
|
||||
->color('home')
|
||||
->weight(FontWeight::Bold)
|
||||
->alignRight(),
|
||||
IconColumn::make('id')->icon('phosphor-minus')->label('')->color('black'),
|
||||
TextColumn::make('away')
|
||||
->color('away')
|
||||
->weight(FontWeight::Bold),
|
||||
TextColumn::make('starttime')
|
||||
->sortable()
|
||||
->time('H:i')
|
||||
->alignCenter()
|
||||
->description(fn ($record): string => Carbon::parse($record->starttime)->format('d. M. y')),
|
||||
TextColumn::make('group')
|
||||
->wrap()
|
||||
->tooltip('Click to filter by this group')
|
||||
@@ -91,28 +86,7 @@ class MapperRight extends Component implements HasActions, HasSchemas, HasTable
|
||||
}
|
||||
}),
|
||||
IconColumn::make('group_cc')->icon(fn (string $state): string => 'flag-country-'.$state)->label(''),
|
||||
TextColumn::make('starttime')
|
||||
->sortable()
|
||||
->time('H:i')
|
||||
->alignCenter()
|
||||
->description(fn ($record): string => Carbon::parse($record->starttime)->format('d. M. y')),
|
||||
])->searchable(['home', 'away'])
|
||||
->recordActions([
|
||||
Action::make('search_home')
|
||||
->iconButton()
|
||||
->icon('phosphor-magnifying-glass')
|
||||
->color('home')
|
||||
->action(function ($record) {
|
||||
$this->dispatch('search_left', $record->home);
|
||||
}),
|
||||
Action::make('search_away')
|
||||
->icon('phosphor-magnifying-glass')
|
||||
->iconButton()
|
||||
->color('away')
|
||||
->action(function ($record) {
|
||||
$this->dispatch('search_left', $record->away);
|
||||
}),
|
||||
], position: RecordActionsPosition::BeforeColumns)
|
||||
->filters([
|
||||
Filter::make('events')
|
||||
->schema([
|
||||
@@ -223,7 +197,7 @@ class MapperRight extends Component implements HasActions, HasSchemas, HasTable
|
||||
if ($this->search_right) {
|
||||
$searchValues = preg_split('/\s+/', $this->search_right, -1, PREG_SPLIT_NO_EMPTY);
|
||||
foreach ($searchValues as $value) {
|
||||
$indicators[] = Indicator::make($value)->removeField($value);
|
||||
$indicators[] = Indicator::make($value)->removeField($value)->color('info');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -273,6 +247,7 @@ class MapperRight extends Component implements HasActions, HasSchemas, HasTable
|
||||
{
|
||||
return Action::make('right')
|
||||
->modalHeading('Event Mapper')
|
||||
->modalDescription('Keyboard: "enter" Save, "c" Close')
|
||||
->modalContent(function (array $arguments) {
|
||||
|
||||
$event = Event::where('id', $arguments['id'])->first();
|
||||
@@ -289,12 +264,16 @@ class MapperRight extends Component implements HasActions, HasSchemas, HasTable
|
||||
})
|
||||
->closeModalByEscaping(false)
|
||||
->modalCloseButton(false)
|
||||
->modalCancelAction(fn (Action $action) => $action->keyBindings(['c'])->tooltip('keyboard: "c"'))
|
||||
->closeModalByClickingAway(false)
|
||||
->modalAlignment(Alignment::Center)
|
||||
->modalFooterActionsAlignment(Alignment::Center)
|
||||
->modalWidth('2xl')
|
||||
->modalSubmitActionLabel('Confirm')
|
||||
->modalSubmitAction();
|
||||
->modalSubmitActionLabel('Save')
|
||||
->modalSubmitAction()
|
||||
->modalSubmitAction(
|
||||
fn (Action $action) => $action->keyBindings(['return'])->tooltip('keyboard: "return"')
|
||||
);
|
||||
}
|
||||
|
||||
public function render()
|
||||
|
||||
Reference in new issue
Block a user