wip icons

This commit is contained in:
salam committed 2026-06-25 16:26:14 +02:00
1 parent e9823b1a68
commit aeea5f731b
1 file changed
+35 -43
+35 -43
View File
@@ -63,12 +63,11 @@ class Statistic extends BaseDashboard
->columnSpanFull() ->columnSpanFull()
->schema([ ->schema([
Select::make('league_id') Select::make('league_id')
// ->prefixIconColor('primary') ->live()
->prefixIconColor(fn(Get $get): string => $get('league_id') ? 'success' : 'danger') ->prefixIconColor(fn(Get $get): string => $get('league_id') ? 'success' : 'danger')
->prefixIcon('phosphor-trophy') ->prefixIcon('phosphor-trophy-fill')
->hiddenLabel() ->hiddenLabel()
->options(fn() => LoadStatisticFixturesLeaguesOptions::load(1)) ->options(fn() => LoadStatisticFixturesLeaguesOptions::load(1))
->live()
->placeholder('League') ->placeholder('League')
->afterStateUpdated(function (callable $set, $state) { ->afterStateUpdated(function (callable $set, $state) {
$set('match_id', null); $set('match_id', null);
@@ -77,9 +76,10 @@ class Statistic extends BaseDashboard
$set('season', null); $set('season', null);
}), }),
Select::make('match_id') Select::make('match_id')
->live()
->hiddenLabel() ->hiddenLabel()
->prefixIconColor(fn(Get $get): string => $get('match_id') ? 'success' : 'danger') ->prefixIconColor(fn(Get $get): string => $get('match_id') ? 'success' : 'danger')
->prefixIcon('phosphor-calendar-check') ->prefixIcon('phosphor-calendar-check-fill')
->options(function (Get $get) { ->options(function (Get $get) {
return LoadStatisticFixturesMatchOptions::load($get('league_id')); return LoadStatisticFixturesMatchOptions::load($get('league_id'));
}) })
@@ -87,10 +87,10 @@ class Statistic extends BaseDashboard
$set('team_id', null); $set('team_id', null);
$set('tm_player_id', null); $set('tm_player_id', null);
}) })
->live()
->placeholder('Events'), ->placeholder('Events'),
Select::make('team_id') Select::make('team_id')
->live()
->hiddenLabel() ->hiddenLabel()
->prefixIconColor(function (Get $get): string { ->prefixIconColor(function (Get $get): string {
if ($get('team_id')) { if ($get('team_id')) {
@@ -101,7 +101,7 @@ class Statistic extends BaseDashboard
return 'danger'; return 'danger';
} }
}) })
->prefixIcon('phosphor-users-three') ->prefixIcon('phosphor-users-three-fill')
->hidden(fn(Get $get) => $get('similar_past_matches') != 'none') ->hidden(fn(Get $get) => $get('similar_past_matches') != 'none')
->options(function (Get $get) { ->options(function (Get $get) {
if ($get('match_id')) { if ($get('match_id')) {
@@ -117,16 +117,16 @@ class Statistic extends BaseDashboard
->afterStateUpdated(function (callable $set) { ->afterStateUpdated(function (callable $set) {
$set('tm_player_id', null); $set('tm_player_id', null);
}) })
->live()
->placeholder('Team'), ->placeholder('Team'),
Select::make('team_position') Select::make('team_position')
->live()
->hiddenLabel() ->hiddenLabel()
->placeholder('Team Position') ->placeholder('Team Position')
->prefix('TP') ->prefix('TP')
->prefixAction( ->prefixAction(
Action::make('iconInfo') Action::make('iconInfo')
->icon('phosphor-question') ->icon('phosphor-question-fill')
->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')
@@ -136,8 +136,7 @@ class Statistic extends BaseDashboard
'all' => 'All', 'all' => 'All',
'home' => 'Home', 'home' => 'Home',
'away' => 'Away', 'away' => 'Away',
]) ]),
->live(),
]), ]),
Grid::make([ Grid::make([
'default' => 1, 'default' => 1,
@@ -147,20 +146,21 @@ class Statistic extends BaseDashboard
->columnSpanFull() ->columnSpanFull()
->schema([ ->schema([
Select::make('statistic_type') Select::make('statistic_type')
->live()
->hiddenLabel() ->hiddenLabel()
->allowHtml() ->allowHtml()
->placeholder('Statistic Type') ->placeholder('Statistic Type')
->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', 'gls' => 'phosphor-soccer-ball-fill',
'crn' => 'phosphor-angle', 'crn' => 'phosphor-angle',
'fls' => 'phosphor-first-aid-kit', 'fls' => 'phosphor-first-aid-kit',
'ofs' => 'phosphor-arrow-fat-lines-right', 'ofs' => 'phosphor-arrow-fat-lines-right-fill',
'crd' => 'phosphor-cards', 'crd' => 'phosphor-cards-fill',
'snt' => 'phosphor-target', 'snt' => 'phosphor-target-fill',
'tsh' => 'phosphor-chart-polar', 'tsh' => 'phosphor-chart-polar-fill',
default => 'phosphor-soccer-ball', default => 'phosphor-soccer-ball-fill',
}; };
}) })
->default('gls') ->default('gls')
@@ -173,20 +173,19 @@ class Statistic extends BaseDashboard
'crd' => 'Cards', 'crd' => 'Cards',
'snt' => 'Shots On Target', 'snt' => 'Shots On Target',
'tsh' => 'Total Shots', 'tsh' => 'Total Shots',
]) ]),
->live(),
Select::make('similar_past_matches') Select::make('similar_past_matches')
->live()
->hiddenLabel() ->hiddenLabel()
->placeholder('Similar Past Matches') ->placeholder('Similar Past Matches')
->prefixIconColor('primary') ->prefixIconColor('primary')
->suffix(fn(Get $get): string|HtmlString => $get('similar_past_matches') != 'none' ? new HtmlString('<div class="text-center w-24 font-bold rounded p-1 bg-blue-600 dark:bg-blue-700 text-white dark:text-gray-300">± ' . $get('accuracy') . '</div>') : '') ->suffix(fn(Get $get): string|HtmlString => $get('similar_past_matches') != 'none' ? new HtmlString('<div class="text-center w-24 font-bold rounded p-1 bg-blue-600 dark:bg-blue-700 text-white dark:text-gray-300">± ' . $get('accuracy') . '</div>') : '')
->prefixAction( ->prefixAction(
Action::make('iconInfo') Action::make('iconInfo')
->icon('phosphor-question') ->icon('phosphor-question-fill')
->tooltip(fn() => $this->tooltip_similar_past_matches()) ->tooltip(fn() => $this->tooltip_similar_past_matches())
) )
->default('none') ->default('none')
->live()
->selectablePlaceholder(false) ->selectablePlaceholder(false)
->afterStateUpdated(function (callable $set) { ->afterStateUpdated(function (callable $set) {
$set('team_id', null); $set('team_id', null);
@@ -199,7 +198,7 @@ class Statistic extends BaseDashboard
'all' => 'SPM: All Database', 'all' => 'SPM: All Database',
]), ]),
Slider::make('accuracy') Slider::make('accuracy')
// ->label('Accuracy min: 0, max: 0.25, steps: 0.025') ->live()
->hiddenLabel() ->hiddenLabel()
->hidden(fn(Get $get) => $get('similar_past_matches') == 'none') ->hidden(fn(Get $get) => $get('similar_past_matches') == 'none')
->fillTrack() ->fillTrack()
@@ -208,17 +207,12 @@ class Statistic extends BaseDashboard
->default(0.125) ->default(0.125)
->step(0.025) ->step(0.025)
->decimalPlaces(3) ->decimalPlaces(3)
// ->tooltips()
// ->columnSpan([
// 'default' => 1,
// 'xl' => 2,
// ])
->pips() ->pips()
->pipsFormatter(RawJs::make(<<<'JS' ->pipsFormatter(RawJs::make(<<<'JS'
`${$value.toFixed(2)}` `${$value.toFixed(2)}`
JS)) JS)),
->live(),
Select::make('tm_player_id') Select::make('tm_player_id')
->live()
->hiddenLabel() ->hiddenLabel()
->allowHtml() ->allowHtml()
->placeholder('Player') ->placeholder('Player')
@@ -238,23 +232,26 @@ class Statistic extends BaseDashboard
->searchable() ->searchable()
->options(function (Get $get) { ->options(function (Get $get) {
return LoadPlayer::load($get('team_id')); return LoadPlayer::load($get('team_id'));
}) }),
->live(),
Select::make('player_on_field') Select::make('player_on_field')
->live()
->hiddenLabel() ->hiddenLabel()
->placeholder('Time on field') ->placeholder('Time on field')
->prefixIcon('phosphor-watch') ->prefixIcon('phosphor-watch-fill')
->default('all') ->default('all')
->hidden(fn(Get $get) => ! $get('tm_player_id')) ->hidden(fn(Get $get) => ! $get('tm_player_id'))
->prefixIconColor(fn(Get $get): string => ($get('tm_player_id') and $get('similar_past_matches') == 'none') ? 'primary' : '') ->prefixIconColor('primary')
->selectablePlaceholder(false) ->selectablePlaceholder(false)
// ->afterStateUpdated(function (callable $set) {
// // $set('team_id', null);
// $set('tm_player_id', null);
// })
->options([ ->options([
'all' => 'All', 'all' => 'All',
'lineup' => 'Lineup', 'lineup' => 'Lineup',
'substituted' => 'Substituted', 'substituted' => 'Substituted',
'notplayed' => 'Not Played', 'notplayed' => 'Not Played',
]) ]),
->live(),
]), ]),
Grid::make([ Grid::make([
'default' => 4, 'default' => 4,
@@ -262,6 +259,7 @@ class Statistic extends BaseDashboard
]) ])
->schema([ ->schema([
Radio::make('season_or_date') Radio::make('season_or_date')
->live()
->extraAttributes([ ->extraAttributes([
'class' => 'radio-statistic-group', 'class' => 'radio-statistic-group',
]) ])
@@ -270,7 +268,6 @@ class Statistic extends BaseDashboard
'sm' => 4, 'sm' => 4,
]) ])
->inline() ->inline()
->live()
->default('season') ->default('season')
->hiddenLabel() ->hiddenLabel()
->options([ ->options([
@@ -286,23 +283,18 @@ class Statistic extends BaseDashboard
->placeholder('Season') ->placeholder('Season')
->prefixIconColor(fn(Get $get): string => $get('season') ? 'success' : 'danger') ->prefixIconColor(fn(Get $get): string => $get('season') ? 'success' : 'danger')
->hidden(fn(Get $get) => $get('season_or_date') == 'date') ->hidden(fn(Get $get) => $get('season_or_date') == 'date')
->prefixIcon('phosphor-calendar-star') ->prefixIcon('phosphor-calendar-star-fill')
->prefixIconColor('primary')
->preload() ->preload()
->options(function (Get $get) { ->options(function (Get $get) {
return LoadSeasons::load($get('league_id')); return LoadSeasons::load($get('league_id'));
})
->afterStateUpdated(function (callable $set) {
// $set('team_id', null);
$set('tm_player_id', null);
}), }),
DatePicker::make('start_date') DatePicker::make('start_date')
->live()
->hiddenLabel() ->hiddenLabel()
->hidden(fn(Get $get) => $get('season_or_date') == 'season') ->hidden(fn(Get $get) => $get('season_or_date') == 'season')
->native(false) ->native(false)
->prefixIconColor('primary') ->prefixIconColor('primary')
->prefixIcon('phosphor-calendar') ->prefixIcon('phosphor-calendar')
->live()
->prefix('Start') ->prefix('Start')
->suffixAction( ->suffixAction(
Action::make('clear_start') Action::make('clear_start')
@@ -311,12 +303,12 @@ class Statistic extends BaseDashboard
->action(fn(Set $set) => $set('start_date', null)) ->action(fn(Set $set) => $set('start_date', null))
), ),
DatePicker::make('end_date') DatePicker::make('end_date')
->live()
->hiddenLabel() ->hiddenLabel()
->hidden(fn(Get $get) => $get('season_or_date') == 'season') ->hidden(fn(Get $get) => $get('season_or_date') == 'season')
->native(false) ->native(false)
->prefixIconColor('primary') ->prefixIconColor('primary')
->prefixIcon('phosphor-calendar') ->prefixIcon('phosphor-calendar')
->live()
->prefix('End') ->prefix('End')
->suffixAction( ->suffixAction(
Action::make('clear_end') Action::make('clear_end')