diff --git a/app/Livewire/MapperLeft.php b/app/Livewire/MapperLeft.php index 35e850b5..14f93052 100644 --- a/app/Livewire/MapperLeft.php +++ b/app/Livewire/MapperLeft.php @@ -19,7 +19,6 @@ 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; @@ -72,11 +71,6 @@ class MapperLeft extends Component implements HasActions, HasSchemas, HasTable return $table ->query(LoadEvents::load($this->search_left, auth()->user()->sport_id)) ->columns([ - TextColumn::make('starttime') - ->sortable() - ->time('H:i') - ->alignCenter() - ->description(fn ($record): string => Carbon::parse($record->starttime)->format('d. M. y')), IconColumn::make('country.icon')->icon(fn (string $state): string => $state)->label(''), TextColumn::make('competition_group.name')->label('Group') ->wrap() @@ -88,54 +82,12 @@ class MapperLeft extends Component implements HasActions, HasSchemas, HasTable $this->dispatch('refreshMapperRight'); } }), - TextColumn::make('home.name') - ->label('Home') - ->color('home') - ->weight(FontWeight::Bold) - ->alignRight(), - IconColumn::make('id')->icon('phosphor-minus')->label('')->color('black'), - TextColumn::make('away.name') - ->color('away') - ->label('Away') - ->weight(FontWeight::Bold), + TextColumn::make('starttime') + ->sortable() + ->time('H:i') + ->alignCenter() + ->description(fn ($record): string => Carbon::parse($record->starttime)->format('d. M. y')), MapperLeftColumn::make('left')->label(''), - ])->recordActions([ - Action::make('search_home') - ->iconButton() - ->icon('phosphor-magnifying-glass') - ->color('home') - ->action(function ($record) { - $this->dispatch('search_right', $record->home->name); - }), - Action::make('search_away') - ->icon('phosphor-magnifying-glass') - ->iconButton() - ->color('away') - ->action(function ($record) { - $this->dispatch('search_right', $record->away->name); - }), - // Action::make('drag_left') - // ->icon('phosphor-arrows-out') - // ->iconButton() - // ->extraAttributes([ - // 'x-data' => '{ moveoverleft: false }', - // 'x-on' => '{ - // dragstart = { - // self: dragging = true; - // event.dataTransfer.effectAllowed = "move; - // event.dataTransfer.setData("text/plain", event.target.id) - // }, - // dragover = { - // prevent: "moveoverleft = true" - // }, - // dragleave = { - // prevent: "moveoverleft = false" - // } - // }', - // ]) - // ->action(function ($record) { - // $this->dispatch('search_right', $record->away->name); - // }), ]) ->defaultSort('starttime') ->searchable(['home.name', 'away.name']) @@ -146,7 +98,6 @@ class MapperLeft extends Component implements HasActions, HasSchemas, HasTable Select::make('country_id') ->placeholder('Country') ->hiddenLabel() - // ->multiple() ->searchable() ->preload() ->options(function () { @@ -225,7 +176,7 @@ class MapperLeft extends Component implements HasActions, HasSchemas, HasTable if ($this->search_left) { $searchValues = preg_split('/\s+/', $this->search_left, -1, PREG_SPLIT_NO_EMPTY); foreach ($searchValues as $value) { - $indicators[] = Indicator::make($value)->removeField($value); + $indicators[] = Indicator::make($value)->removeField($value)->color('info'); } } @@ -287,12 +238,15 @@ class MapperLeft 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( + fn (Action $action) => $action->keyBindings(['return'])->tooltip('keyboard: "return"') + ); } public function render() diff --git a/app/Livewire/MapperRight.php b/app/Livewire/MapperRight.php index 0a17eb62..24fe0871 100644 --- a/app/Livewire/MapperRight.php +++ b/app/Livewire/MapperRight.php @@ -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() diff --git a/app/Livewire/SportSwitcher.php b/app/Livewire/SportSwitcher.php index b2e6f2f1..3f846a9f 100644 --- a/app/Livewire/SportSwitcher.php +++ b/app/Livewire/SportSwitcher.php @@ -43,19 +43,19 @@ class SportSwitcher extends Component $this->iconcolor = Sport::where('id', $this->sport_id)->pluck('color')->first(); - // $this->js('window.location.reload()'); - $this->dispatch('filterClearFilter'); - $this->dispatch('refreshSportSwitcher'); + $this->js('window.location.reload()'); - $this->dispatch('refreshBettypeMenu'); + // $this->dispatch('refreshSportSwitcher'); - $this->dispatch('refreshMultilineBookmaker'); + // $this->dispatch('refreshBettypeMenu'); - $this->dispatch('refreshComparingBookmakerMenu'); + // $this->dispatch('refreshMultilineBookmaker'); - $this->dispatch('refreshAlarmBookmaker'); + // $this->dispatch('refreshComparingBookmakerMenu'); + + // $this->dispatch('refreshAlarmBookmaker'); } diff --git a/composer.lock b/composer.lock index 4c68483a..6f5fe273 100644 --- a/composer.lock +++ b/composer.lock @@ -12982,12 +12982,12 @@ ], "aliases": [], "minimum-stability": "stable", - "stability-flags": {}, + "stability-flags": [], "prefer-stable": true, "prefer-lowest": false, "platform": { "php": "^8.3" }, - "platform-dev": {}, - "plugin-api-version": "2.9.0" + "platform-dev": [], + "plugin-api-version": "2.6.0" } diff --git a/resources/css/filament/admin/theme.css b/resources/css/filament/admin/theme.css index f0f81843..069b1490 100644 --- a/resources/css/filament/admin/theme.css +++ b/resources/css/filament/admin/theme.css @@ -30,6 +30,12 @@ button[wire\:click="resetTableFiltersForm"] { } } +.drag-and-drop__item:active { + @apply rounded; + background-color: rgba(43, 127, 255, 0.1); +} + + /* .fi-ta-header-toolbar { @apply flex-row-reverse; } */ diff --git a/resources/views/filament/tables/columns/mapper-left-column.blade.php b/resources/views/filament/tables/columns/mapper-left-column.blade.php index e0f8bd09..0b4eac21 100644 --- a/resources/views/filament/tables/columns/mapper-left-column.blade.php +++ b/resources/views/filament/tables/columns/mapper-left-column.blade.php @@ -1,17 +1,32 @@ -