This commit is contained in:
salam committed 2026-10-01 15:24:59 +02:00
1 parent 20b53c2878
commit bbda7b478f
1 file changed
+25 -18
+25 -18
View File
@@ -26,6 +26,7 @@ use Filament\Schemas\Components\Grid;
use Filament\Schemas\Components\Utilities\Get; use Filament\Schemas\Components\Utilities\Get;
use Filament\Schemas\Components\Utilities\Set; use Filament\Schemas\Components\Utilities\Set;
use Filament\Schemas\Schema; use Filament\Schemas\Schema;
use Filament\Support\Enums\Size;
use Filament\Support\RawJs; use Filament\Support\RawJs;
use Illuminate\Contracts\Support\Htmlable; use Illuminate\Contracts\Support\Htmlable;
use Illuminate\Support\HtmlString; use Illuminate\Support\HtmlString;
@@ -140,7 +141,7 @@ class Statistic extends BaseDashboard
->preload() ->preload()
->searchable(false) ->searchable(false)
->prefixIconColor(fn(Get $get): string => $get('sofascore_category_id') ? 'success' : 'danger') ->prefixIconColor(fn(Get $get): string => $get('sofascore_category_id') ? 'success' : 'danger')
->prefixIcon('phosphor-globe-fill') ->prefixIcon('phosphor-globe')
->hiddenLabel() ->hiddenLabel()
->options(fn() => LoadSofaScoreCategory::load()) ->options(fn() => LoadSofaScoreCategory::load())
->placeholder('Select Country') ->placeholder('Select Country')
@@ -156,7 +157,7 @@ class Statistic extends BaseDashboard
->live() ->live()
->preload() ->preload()
->prefixIconColor(fn(Get $get): string => $get('league_id') ? 'success' : 'danger') ->prefixIconColor(fn(Get $get): string => $get('league_id') ? 'success' : 'danger')
->prefixIcon('phosphor-trophy-fill') ->prefixIcon('phosphor-trophy')
->hiddenLabel() ->hiddenLabel()
->options(fn(Get $get) => LoadStatisticFixturesLeaguesOptions::load($get('sofascore_category_id'))) ->options(fn(Get $get) => LoadStatisticFixturesLeaguesOptions::load($get('sofascore_category_id')))
->placeholder('Select League') ->placeholder('Select League')
@@ -171,7 +172,7 @@ class Statistic extends BaseDashboard
->hiddenLabel() ->hiddenLabel()
->columnSpan(fn(Get $get) => $get('similar_past_matches') != 'none' ? 2 : 1) ->columnSpan(fn(Get $get) => $get('similar_past_matches') != 'none' ? 2 : 1)
->prefixIconColor(fn(Get $get): string => $get('match_id') ? 'success' : 'danger') ->prefixIconColor(fn(Get $get): string => $get('match_id') ? 'success' : 'danger')
->prefixIcon('phosphor-calendar-check-fill') ->prefixIcon('phosphor-calendar-check')
->options(function (Get $get) { ->options(function (Get $get) {
return LoadStatisticFixturesMatchOptions::load($get('league_id')); return LoadStatisticFixturesMatchOptions::load($get('league_id'));
}) })
@@ -188,6 +189,8 @@ class Statistic extends BaseDashboard
->icon('phosphor-x-circle') ->icon('phosphor-x-circle')
->color('danger') ->color('danger')
->keyBindings(['esc']) ->keyBindings(['esc'])
->size(Size::Medium)
->outlined()
->action('resetFilters'), ->action('resetFilters'),
Select::make('team_id') Select::make('team_id')
@@ -202,7 +205,7 @@ class Statistic extends BaseDashboard
return 'danger'; return 'danger';
} }
}) })
->prefixIcon('phosphor-users-fill') ->prefixIcon('phosphor-users')
->suffixAction(Action::make('reset') ->suffixAction(Action::make('reset')
->icon('phosphor-x-circle') ->icon('phosphor-x-circle')
->tooltip('Clear Team') ->tooltip('Clear Team')
@@ -243,7 +246,7 @@ class Statistic extends BaseDashboard
->prefixAction( ->prefixAction(
Action::make('iconInfo') Action::make('iconInfo')
->color('success') ->color('success')
->icon('phosphor-question-fill') ->icon('phosphor-question')
->tooltip(fn() => 'Team Position') ->tooltip(fn() => 'Team Position')
) )
->hidden(fn(Get $get) => $get('similar_past_matches') != 'none') ->hidden(fn(Get $get) => $get('similar_past_matches') != 'none')
@@ -264,14 +267,14 @@ class Statistic extends BaseDashboard
->prefixIconColor('success') ->prefixIconColor('success')
->prefixIcon(function (Get $get) { ->prefixIcon(function (Get $get) {
return match ($get('statistic_type')) { return match ($get('statistic_type')) {
'gls' => 'phosphor-soccer-ball-fill', 'gls' => 'phosphor-soccer-ball',
'crn' => 'phosphor-angle', 'crn' => 'phosphor-angle',
'fls' => 'phosphor-first-aid-kit', 'fls' => 'phosphor-first-aid-kit',
'ofs' => 'phosphor-arrow-fat-lines-right-fill', 'ofs' => 'phosphor-arrow-fat-lines-right',
'crd' => 'phosphor-cards-fill', 'crd' => 'phosphor-cards',
'snt' => 'phosphor-target-fill', 'snt' => 'phosphor-target',
'tsh' => 'phosphor-chart-polar-fill', 'tsh' => 'phosphor-chart-polar',
default => 'phosphor-soccer-ball-fill', default => 'phosphor-soccer-ball',
}; };
}) })
->default('gls') ->default('gls')
@@ -305,7 +308,7 @@ class Statistic extends BaseDashboard
->prefix('SPM') ->prefix('SPM')
->prefixAction( ->prefixAction(
Action::make('iconInfo') Action::make('iconInfo')
->icon('phosphor-question-fill') ->icon('phosphor-question')
->color(fn(Get $get): string => $get('similar_past_matches') != 'none' ? 'success' : 'danger') ->color(fn(Get $get): string => $get('similar_past_matches') != 'none' ? 'success' : 'danger')
->tooltip(fn() => $this->tooltip_similar_past_matches()) ->tooltip(fn() => $this->tooltip_similar_past_matches())
) )
@@ -359,7 +362,7 @@ class Statistic extends BaseDashboard
]) ])
->suffixAction( ->suffixAction(
Action::make('iconInfo') Action::make('iconInfo')
->icon('phosphor-question-fill') ->icon('phosphor-question')
->color('success') ->color('success')
->tooltip(fn() => $this->tooltip_player_info()) ->tooltip(fn() => $this->tooltip_player_info())
) )
@@ -376,7 +379,7 @@ class Statistic extends BaseDashboard
->live() ->live()
->hiddenLabel() ->hiddenLabel()
->placeholder('Time on field') ->placeholder('Time on field')
->prefixIcon('phosphor-watch-fill') ->prefixIcon('phosphor-watch')
->default('all') ->default('all')
->hidden(fn(Get $get) => ! $get('ss_player_id')) ->hidden(fn(Get $get) => ! $get('ss_player_id'))
->prefixIconColor('success') ->prefixIconColor('success')
@@ -420,7 +423,7 @@ class Statistic extends BaseDashboard
->prefixIconColor('success') ->prefixIconColor('success')
->visible(fn(Get $get) => $get('seasonmode')) ->visible(fn(Get $get) => $get('seasonmode'))
->hidden(fn(Get $get) => $get('seasonmode') == 'halfyear' || $get('season_or_date') == 'date' || $get('similar_past_matches') != 'none') ->hidden(fn(Get $get) => $get('seasonmode') == 'halfyear' || $get('season_or_date') == 'date' || $get('similar_past_matches') != 'none')
->prefixIcon('phosphor-calendar-star-fill') ->prefixIcon('phosphor-calendar-star')
->options([ ->options([
'2026' => '2026', '2026' => '2026',
'2025' => '2025', '2025' => '2025',
@@ -441,7 +444,7 @@ class Statistic extends BaseDashboard
->prefixIconColor('success') ->prefixIconColor('success')
->visible(fn(Get $get) => $get('seasonmode')) ->visible(fn(Get $get) => $get('seasonmode'))
->hidden(fn(Get $get) => $get('seasonmode') == 'fullyear' || $get('season_or_date') == 'date' || $get('similar_past_matches') != 'none') ->hidden(fn(Get $get) => $get('seasonmode') == 'fullyear' || $get('season_or_date') == 'date' || $get('similar_past_matches') != 'none')
->prefixIcon('phosphor-calendar-star-fill') ->prefixIcon('phosphor-calendar-star')
->options([ ->options([
'26/27' => '26/27', '26/27' => '26/27',
'25/26' => '25/26', '25/26' => '25/26',
@@ -459,7 +462,7 @@ class Statistic extends BaseDashboard
->hidden(fn(Get $get) => $get('season_or_date') == 'season') ->hidden(fn(Get $get) => $get('season_or_date') == 'season')
->native(false) ->native(false)
->prefixIconColor(fn(Get $get): string => $get('start_date') ? 'success' : 'primary') ->prefixIconColor(fn(Get $get): string => $get('start_date') ? 'success' : 'primary')
->prefixIcon('phosphor-calendar-fill') ->prefixIcon('phosphor-calendar')
->prefix('Start') ->prefix('Start')
->suffixAction( ->suffixAction(
Action::make('clear_start') Action::make('clear_start')
@@ -473,7 +476,7 @@ class Statistic extends BaseDashboard
->hidden(fn(Get $get) => $get('season_or_date') == 'season') ->hidden(fn(Get $get) => $get('season_or_date') == 'season')
->native(false) ->native(false)
->prefixIconColor(fn(Get $get): string => $get('end_date') ? 'success' : 'primary') ->prefixIconColor(fn(Get $get): string => $get('end_date') ? 'success' : 'primary')
->prefixIcon('phosphor-calendar-fill') ->prefixIcon('phosphor-calendar')
->prefix('End') ->prefix('End')
->suffixAction( ->suffixAction(
Action::make('clear_end') Action::make('clear_end')
@@ -489,6 +492,8 @@ class Statistic extends BaseDashboard
->icon('phosphor-x-circle') ->icon('phosphor-x-circle')
->color(fn(Get $get) => $get('sofascore_category_id') ? 'danger' : 'gray') ->color(fn(Get $get) => $get('sofascore_category_id') ? 'danger' : 'gray')
->keyBindings(['esc']) ->keyBindings(['esc'])
->outlined()
->size(Size::Medium)
->action('resetFilters'), ->action('resetFilters'),
Action::make('copy') Action::make('copy')
->hiddenLabel() ->hiddenLabel()
@@ -496,6 +501,8 @@ class Statistic extends BaseDashboard
->visible(fn(Get $get) => $get('team_id')) ->visible(fn(Get $get) => $get('team_id'))
->tooltip('Copy data for pasting into spreadsheet') ->tooltip('Copy data for pasting into spreadsheet')
->color('success') ->color('success')
->size(Size::Medium)
->outlined()
->icon('phosphor-copy') ->icon('phosphor-copy')
->action(function ($livewire) { ->action(function ($livewire) {
// 1. Call your custom Livewire function to generate the data // 1. Call your custom Livewire function to generate the data