wip
This commit is contained in:
1 parent
5615c59044
commit
fb48d5d321
1 file changed
+31
-31
@@ -93,14 +93,14 @@ class Statistic extends BaseDashboard
|
|||||||
->label('Calculate')
|
->label('Calculate')
|
||||||
->icon('icon-player')
|
->icon('icon-player')
|
||||||
->color('indigo')
|
->color('indigo')
|
||||||
->color(fn (): string => $this->filters['team_id'] ? 'primary' : 'gray')
|
->color(fn(): string => $this->filters['team_id'] ? 'primary' : 'gray')
|
||||||
->disabled(fn (): string => $this->filters['team_id'] ? false : true)
|
->disabled(fn(): string => $this->filters['team_id'] ? false : true)
|
||||||
->slideOver()
|
->slideOver()
|
||||||
->slideOverPosition(SlideOverPosition::Start)
|
->slideOverPosition(SlideOverPosition::Start)
|
||||||
->modalWidth(Width::SixExtraLarge)
|
->modalWidth(Width::Screen)
|
||||||
->modalSubmitAction(false)
|
->modalSubmitAction(false)
|
||||||
->modalCancelAction(false)
|
->modalCancelAction(false)
|
||||||
->modalContent(fn (): View => view('livewire.board-dispatcher-modal-wrapper', ['filters' => $this->filters])),
|
->modalContent(fn(): View => view('livewire.board-dispatcher-modal-wrapper', ['filters' => $this->filters])),
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -138,10 +138,10 @@ class Statistic extends BaseDashboard
|
|||||||
->live()
|
->live()
|
||||||
->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-fill')
|
||||||
->hiddenLabel()
|
->hiddenLabel()
|
||||||
->options(fn () => LoadSofaScoreCategory::load())
|
->options(fn() => LoadSofaScoreCategory::load())
|
||||||
->placeholder('Country')
|
->placeholder('Country')
|
||||||
->afterStateUpdated(function (callable $set, $state) {
|
->afterStateUpdated(function (callable $set, $state) {
|
||||||
$set('seasonmode', SofaScoreCategory::where('id', $state)->value('season_mode'));
|
$set('seasonmode', SofaScoreCategory::where('id', $state)->value('season_mode'));
|
||||||
@@ -154,10 +154,10 @@ class Statistic extends BaseDashboard
|
|||||||
Select::make('league_id')
|
Select::make('league_id')
|
||||||
->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-fill')
|
||||||
->hiddenLabel()
|
->hiddenLabel()
|
||||||
->options(fn (Get $get) => LoadStatisticFixturesLeaguesOptions::load($get('sofascore_category_id')))
|
->options(fn(Get $get) => LoadStatisticFixturesLeaguesOptions::load($get('sofascore_category_id')))
|
||||||
->placeholder('League')
|
->placeholder('League')
|
||||||
->afterStateUpdated(function (callable $set) {
|
->afterStateUpdated(function (callable $set) {
|
||||||
$set('match_id', null);
|
$set('match_id', null);
|
||||||
@@ -168,7 +168,7 @@ class Statistic extends BaseDashboard
|
|||||||
Select::make('match_id')
|
Select::make('match_id')
|
||||||
->live()
|
->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-fill')
|
->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'));
|
||||||
@@ -193,7 +193,7 @@ class Statistic extends BaseDashboard
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
->prefixIcon('phosphor-users-three-fill')
|
->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')) {
|
||||||
$res = StatisticFixtures::where('id', $get('match_id'))->first();
|
$res = StatisticFixtures::where('id', $get('match_id'))->first();
|
||||||
@@ -222,9 +222,9 @@ class Statistic extends BaseDashboard
|
|||||||
Action::make('iconInfo')
|
Action::make('iconInfo')
|
||||||
->color('success')
|
->color('success')
|
||||||
->icon('phosphor-question-fill')
|
->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')
|
||||||
->default('all')
|
->default('all')
|
||||||
->selectablePlaceholder(false)
|
->selectablePlaceholder(false)
|
||||||
->options([
|
->options([
|
||||||
@@ -280,17 +280,17 @@ class Statistic extends BaseDashboard
|
|||||||
->hiddenLabel()
|
->hiddenLabel()
|
||||||
->suffixAction(Action::make('reset')
|
->suffixAction(Action::make('reset')
|
||||||
->icon('phosphor-x-circle')
|
->icon('phosphor-x-circle')
|
||||||
->action(fn (callable $set) => $set('similar_past_matches', 'none'))
|
->action(fn(callable $set) => $set('similar_past_matches', 'none'))
|
||||||
->color(fn (Get $get): string => $get('similar_past_matches') != 'none' ? 'info' : 'gray'))
|
->color(fn(Get $get): string => $get('similar_past_matches') != 'none' ? 'info' : 'gray'))
|
||||||
->placeholder('Similar Past Matches')
|
->placeholder('Similar Past Matches')
|
||||||
->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>') : '')
|
||||||
->prefix('SPM')
|
->prefix('SPM')
|
||||||
->prefixAction(
|
->prefixAction(
|
||||||
Action::make('iconInfo')
|
Action::make('iconInfo')
|
||||||
->icon('phosphor-question-fill')
|
->icon('phosphor-question-fill')
|
||||||
// ->color(fn(Get $get): string => $get('similar_past_matches') != 'none' ? 'success' : 'primary')
|
// ->color(fn(Get $get): string => $get('similar_past_matches') != 'none' ? 'success' : 'primary')
|
||||||
->color('success')
|
->color('success')
|
||||||
->tooltip(fn () => $this->tooltip_similar_past_matches())
|
->tooltip(fn() => $this->tooltip_similar_past_matches())
|
||||||
)
|
)
|
||||||
->default('none')
|
->default('none')
|
||||||
->selectablePlaceholder(false)
|
->selectablePlaceholder(false)
|
||||||
@@ -310,7 +310,7 @@ class Statistic extends BaseDashboard
|
|||||||
Slider::make('accuracy')
|
Slider::make('accuracy')
|
||||||
->live()
|
->live()
|
||||||
->hiddenLabel()
|
->hiddenLabel()
|
||||||
->hidden(fn (Get $get) => $get('similar_past_matches') == 'none')
|
->hidden(fn(Get $get) => $get('similar_past_matches') == 'none')
|
||||||
->fillTrack()
|
->fillTrack()
|
||||||
->minValue(0)
|
->minValue(0)
|
||||||
->maxValue(0.25)
|
->maxValue(0.25)
|
||||||
@@ -329,17 +329,17 @@ class Statistic extends BaseDashboard
|
|||||||
->hiddenLabel()
|
->hiddenLabel()
|
||||||
->allowHtml()
|
->allowHtml()
|
||||||
->placeholder('Player')
|
->placeholder('Player')
|
||||||
->hidden(fn (Get $get) => $get('similar_past_matches') != 'none')
|
->hidden(fn(Get $get) => $get('similar_past_matches') != 'none')
|
||||||
->prefixIconColor(fn (Get $get): string => $get('similar_past_matches') == 'none' ? 'success' : '')
|
->prefixIconColor(fn(Get $get): string => $get('similar_past_matches') == 'none' ? 'success' : '')
|
||||||
->prefixIcon('icon-player')
|
->prefixIcon('icon-player')
|
||||||
->preload()
|
->preload()
|
||||||
->searchable()
|
->searchable()
|
||||||
->extraAttributes(fn () => ['id' => 'player_selector'])
|
->extraAttributes(fn() => ['id' => 'player_selector'])
|
||||||
->suffixAction(
|
->suffixAction(
|
||||||
Action::make('iconInfo')
|
Action::make('iconInfo')
|
||||||
->icon('phosphor-question-fill')
|
->icon('phosphor-question-fill')
|
||||||
->color('success')
|
->color('success')
|
||||||
->tooltip(fn () => $this->tooltip_player_info())
|
->tooltip(fn() => $this->tooltip_player_info())
|
||||||
)
|
)
|
||||||
->options(function (Get $get) {
|
->options(function (Get $get) {
|
||||||
$team_id = $get('team_id');
|
$team_id = $get('team_id');
|
||||||
@@ -356,7 +356,7 @@ class Statistic extends BaseDashboard
|
|||||||
->placeholder('Time on field')
|
->placeholder('Time on field')
|
||||||
->prefixIcon('phosphor-watch-fill')
|
->prefixIcon('phosphor-watch-fill')
|
||||||
->default('all')
|
->default('all')
|
||||||
->hidden(fn (Get $get) => ! $get('ss_player_id'))
|
->hidden(fn(Get $get) => ! $get('ss_player_id'))
|
||||||
->prefixIconColor('success')
|
->prefixIconColor('success')
|
||||||
->selectablePlaceholder(false)
|
->selectablePlaceholder(false)
|
||||||
->options([
|
->options([
|
||||||
@@ -376,7 +376,7 @@ class Statistic extends BaseDashboard
|
|||||||
->extraAttributes([
|
->extraAttributes([
|
||||||
'class' => 'radio-statistic-group',
|
'class' => 'radio-statistic-group',
|
||||||
])
|
])
|
||||||
->hidden(fn (Get $get) => $get('similar_past_matches') != 'none')
|
->hidden(fn(Get $get) => $get('similar_past_matches') != 'none')
|
||||||
->columnSpan([
|
->columnSpan([
|
||||||
'default' => 4,
|
'default' => 4,
|
||||||
'sm' => 4,
|
'sm' => 4,
|
||||||
@@ -400,7 +400,7 @@ class Statistic extends BaseDashboard
|
|||||||
->multiple()
|
->multiple()
|
||||||
->placeholder('Current Season')
|
->placeholder('Current Season')
|
||||||
->prefixIconColor('success')
|
->prefixIconColor('success')
|
||||||
->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-fill')
|
||||||
->options([
|
->options([
|
||||||
'2026' => '2026',
|
'2026' => '2026',
|
||||||
@@ -420,7 +420,7 @@ class Statistic extends BaseDashboard
|
|||||||
->multiple()
|
->multiple()
|
||||||
->placeholder('Current Season')
|
->placeholder('Current Season')
|
||||||
->prefixIconColor('success')
|
->prefixIconColor('success')
|
||||||
->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-fill')
|
||||||
->options([
|
->options([
|
||||||
'26/27' => '26/27',
|
'26/27' => '26/27',
|
||||||
@@ -436,30 +436,30 @@ class Statistic extends BaseDashboard
|
|||||||
DatePicker::make('start_date')
|
DatePicker::make('start_date')
|
||||||
->live()
|
->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(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-fill')
|
||||||
->prefix('Start')
|
->prefix('Start')
|
||||||
->suffixAction(
|
->suffixAction(
|
||||||
Action::make('clear_start')
|
Action::make('clear_start')
|
||||||
->icon('phosphor-x')
|
->icon('phosphor-x')
|
||||||
->color('gray')
|
->color('gray')
|
||||||
->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()
|
->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(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-fill')
|
||||||
->prefix('End')
|
->prefix('End')
|
||||||
->suffixAction(
|
->suffixAction(
|
||||||
Action::make('clear_end')
|
Action::make('clear_end')
|
||||||
->icon('phosphor-x')
|
->icon('phosphor-x')
|
||||||
->color('gray')
|
->color('gray')
|
||||||
->action(fn (Set $set) => $set('end_date', null))
|
->action(fn(Set $set) => $set('end_date', null))
|
||||||
),
|
),
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user