design changes to save space
This commit is contained in:
1 parent
4b06f98bee
commit
fcbf718492
10 files changed
+319
-304
No files matched your search
@@ -73,10 +73,9 @@ class Statistic extends BaseDashboard
|
||||
return $schema
|
||||
->components([
|
||||
Grid::make([
|
||||
'default' => 2,
|
||||
'default' => 1,
|
||||
'sm' => 2,
|
||||
'md' => 3,
|
||||
'lg' => 4,
|
||||
'md' => 4,
|
||||
])
|
||||
->columnSpanFull()
|
||||
->extraAttributes([
|
||||
@@ -84,17 +83,21 @@ class Statistic extends BaseDashboard
|
||||
])
|
||||
->schema([
|
||||
Select::make('league_id')
|
||||
->prefixIconColor('primary')
|
||||
// ->prefixIconColor('primary')
|
||||
->prefixIconColor(fn (Get $get): string => $get('league_id') ? 'success' : 'danger')
|
||||
->prefixIcon('phosphor-trophy')
|
||||
->hiddenLabel()
|
||||
->options(fn () => LoadStatisticFixturesLeaguesOptions::load(1))
|
||||
->live()
|
||||
->label('League')
|
||||
->placeholder('League')
|
||||
->afterStateUpdated(function (callable $set, $state) {
|
||||
$set('match_id', null);
|
||||
$set('team_id', null);
|
||||
$this->dispatch('filterChanged', filterValue: $state);
|
||||
}),
|
||||
Select::make('match_id')
|
||||
->prefixIconColor('primary')
|
||||
->hiddenLabel()
|
||||
->prefixIconColor(fn (Get $get): string => $get('match_id') ? 'success' : 'danger')
|
||||
->prefixIcon('phosphor-calendar-check')
|
||||
->options(function (Get $get) {
|
||||
return LoadStatisticFixturesMatchOptions::load($get('league_id'));
|
||||
@@ -104,9 +107,20 @@ class Statistic extends BaseDashboard
|
||||
$set('tm_player_id', null);
|
||||
})
|
||||
->live()
|
||||
->label('Events'),
|
||||
->placeholder('Events'),
|
||||
|
||||
Select::make('team_id')
|
||||
->prefixIconColor(fn (Get $get): string => $get('similar_past_matches') == 'none' ? 'primary' : '')
|
||||
->hiddenLabel()
|
||||
->prefixIconColor(function (Get $get): string {
|
||||
if ($get('team_id')) {
|
||||
return 'success';
|
||||
} elseif ($get('similar_past_matches') != 'none') {
|
||||
return 'gray';
|
||||
} else {
|
||||
return 'danger';
|
||||
}
|
||||
})
|
||||
// ->prefixIconColor(fn (Get $get): string => $get('similar_past_matches') == 'none' ? 'primary' : '')
|
||||
->prefixIcon('phosphor-users-three')
|
||||
->disabled(fn (Get $get) => $get('similar_past_matches') != 'none')
|
||||
->options(function (Get $get) {
|
||||
@@ -125,10 +139,13 @@ class Statistic extends BaseDashboard
|
||||
$set('tm_player_id', null);
|
||||
})
|
||||
->live()
|
||||
->label('Team'),
|
||||
->placeholder('Team'),
|
||||
|
||||
Select::make('team_position')
|
||||
->prefixIconColor(fn (Get $get): string => $get('similar_past_matches') == 'none' ? 'primary' : '')
|
||||
->hiddenLabel()
|
||||
->placeholder('Positiom')
|
||||
->prefix('Positiom')
|
||||
// ->prefixIconColor(fn (Get $get): string => $get('similar_past_matches') == 'none' ? 'primary' : '')
|
||||
->prefixIcon('phosphor-map-pin')
|
||||
->disabled(fn (Get $get) => $get('similar_past_matches') != 'none')
|
||||
->default('all')
|
||||
@@ -140,10 +157,12 @@ class Statistic extends BaseDashboard
|
||||
]),
|
||||
|
||||
DatePicker::make('start_date')
|
||||
->hiddenLabel()
|
||||
->native(false)
|
||||
->prefixIconColor('primary')
|
||||
// ->prefixIconColor('primary')
|
||||
->prefixIcon('phosphor-calendar')
|
||||
->live()
|
||||
->prefix('Start')
|
||||
->suffixAction(
|
||||
Action::make('clear_start')
|
||||
->icon('phosphor-x')
|
||||
@@ -151,10 +170,12 @@ class Statistic extends BaseDashboard
|
||||
->action(fn (Set $set) => $set('start_date', null))
|
||||
),
|
||||
DatePicker::make('end_date')
|
||||
->hiddenLabel()
|
||||
->native(false)
|
||||
->prefixIconColor('primary')
|
||||
// ->prefixIconColor('primary')
|
||||
->prefixIcon('phosphor-calendar')
|
||||
->live()
|
||||
->prefix('End')
|
||||
->suffixAction(
|
||||
Action::make('clear_end')
|
||||
->icon('phosphor-x')
|
||||
@@ -162,12 +183,10 @@ class Statistic extends BaseDashboard
|
||||
->action(fn (Set $set) => $set('end_date', null))
|
||||
),
|
||||
Select::make('statistic_type')
|
||||
->columnSpan([
|
||||
'default' => 1,
|
||||
'xl' => 2,
|
||||
])
|
||||
->prefixIconColor('primary')
|
||||
->prefixIcon('phosphor-dots-three-outline')
|
||||
->hiddenLabel()
|
||||
->placeholder('Statistic Type')
|
||||
->prefixIconColor('success')
|
||||
->prefixIcon('phosphor-arrows-out-line-vertical')
|
||||
->default('none')
|
||||
->selectablePlaceholder(false)
|
||||
->options([
|
||||
@@ -180,8 +199,14 @@ class Statistic extends BaseDashboard
|
||||
'tsh' => 'Total shots',
|
||||
]),
|
||||
Select::make('similar_past_matches')
|
||||
->hiddenLabel()
|
||||
->placeholder('Similar Past Matches')
|
||||
->prefixIconColor('primary')
|
||||
->prefixIcon('phosphor-approximate-equals')
|
||||
->columnSpan([
|
||||
'default' => 1,
|
||||
'xl' => 2,
|
||||
])
|
||||
->suffixAction(
|
||||
Action::make('iconInfo')
|
||||
->color('gray')
|
||||
@@ -196,25 +221,30 @@ class Statistic extends BaseDashboard
|
||||
$set('tm_player_id', null);
|
||||
})
|
||||
->options([
|
||||
'none' => 'None',
|
||||
'league' => 'League',
|
||||
'all' => 'All Database',
|
||||
'none' => 'Similar Past Matches: None',
|
||||
'league' => 'Similar Past Matches: League',
|
||||
'all' => 'Similar Past Matches All: Database',
|
||||
]),
|
||||
Slider::make('accuracy')
|
||||
->label('Accuracy max: 0.25, steps: 0.025')
|
||||
->hiddenLabel()
|
||||
->disabled(fn (Get $get) => $get('similar_past_matches') == 'none')
|
||||
->hidden(fn (Get $get) => $get('similar_past_matches') == 'none')
|
||||
// ->fillTrack()
|
||||
->range(minValue: 0, maxValue: 0.25)
|
||||
->step(0.025)
|
||||
->decimalPlaces(1)
|
||||
->decimalPlaces(3)
|
||||
->tooltips()
|
||||
->columnSpan([
|
||||
'default' => 1,
|
||||
'xl' => 2,
|
||||
])
|
||||
// ->pips()
|
||||
->live(),
|
||||
Select::make('tm_player_id')
|
||||
->label('Player')
|
||||
->disabled(fn (Get $get) => $get('similar_past_matches') != 'none')
|
||||
->hiddenLabel()
|
||||
->placeholder('Player')
|
||||
->hidden(fn (Get $get) => $get('similar_past_matches') != 'none')
|
||||
->prefixIconColor(fn (Get $get): string => $get('similar_past_matches') == 'none' ? 'primary' : '')
|
||||
->prefixIcon('icon-player')
|
||||
->suffixAction(
|
||||
@@ -232,10 +262,11 @@ class Statistic extends BaseDashboard
|
||||
})
|
||||
->live(),
|
||||
Select::make('player_on_field')
|
||||
->label('Time on field')
|
||||
->hiddenLabel()
|
||||
->placeholder('Time on field')
|
||||
->prefixIcon('phosphor-watch')
|
||||
->default('all')
|
||||
->disabled(fn (Get $get) => ! $get('tm_player_id') or $get('similar_past_matches') != 'none')
|
||||
->hidden(fn (Get $get) => ! $get('tm_player_id') or $get('similar_past_matches') != 'none')
|
||||
->prefixIconColor(fn (Get $get): string => ($get('tm_player_id') and $get('similar_past_matches') == 'none') ? 'primary' : '')
|
||||
->selectablePlaceholder(false)
|
||||
->options([
|
||||
@@ -248,14 +279,6 @@ class Statistic extends BaseDashboard
|
||||
]);
|
||||
}
|
||||
|
||||
public function getFooterWidgetsColumns(): int|array
|
||||
{
|
||||
return [
|
||||
'default' => 1,
|
||||
'md' => 2,
|
||||
];
|
||||
}
|
||||
|
||||
protected function tooltip_similar_past_matches(): HtmlString
|
||||
{
|
||||
$str = '<div class="grid grid-cols-4 gap-4 max-w-lg">';
|
||||
|
||||
Reference in new issue
Block a user