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