wip chart in tab
This commit is contained in:
1 parent
527280a670
commit
095a4ffd41
12 files changed
+109
-86
No files matched your search
@@ -4,15 +4,6 @@ namespace App\Filament\Pages;
|
||||
|
||||
use App\Actions\LoadStatisticFixturesLeaguesOptions;
|
||||
use App\Actions\LoadStatisticFixturesMatchOptions;
|
||||
use App\Filament\Widgets\ChartEvent;
|
||||
use App\Filament\Widgets\ChartEventMoAv;
|
||||
use App\Filament\Widgets\ChartEventPerf;
|
||||
use App\Filament\Widgets\ChartEventPerfMoAv;
|
||||
use App\Filament\Widgets\ChartPlayer;
|
||||
use App\Filament\Widgets\ChartPlayerMoAv;
|
||||
use App\Filament\Widgets\ChartPlayerPerf;
|
||||
use App\Filament\Widgets\ChartPlayerPerfMoAv;
|
||||
use App\Filament\Widgets\StatsMedianAverage;
|
||||
use App\Models\Element;
|
||||
use App\Models\StatisticFixtures;
|
||||
use App\Models\StatistikoDetail;
|
||||
@@ -36,6 +27,10 @@ class Statistic extends BaseDashboard
|
||||
|
||||
protected static string|BackedEnum|null $navigationIcon = 'phosphor-chart-line-up';
|
||||
|
||||
protected string $view = 'filament.pages.statistic';
|
||||
|
||||
protected string $activeTab = 'tab1';
|
||||
|
||||
protected ?string $pollingInterval = null;
|
||||
|
||||
protected static ?string $title = 'Statistic';
|
||||
@@ -45,24 +40,34 @@ class Statistic extends BaseDashboard
|
||||
'xl' => 3,
|
||||
];
|
||||
|
||||
public function getActiveTab()
|
||||
{
|
||||
return $this->activeTab;
|
||||
}
|
||||
|
||||
public function getHeading(): string|Htmlable|null
|
||||
{
|
||||
return '';
|
||||
}
|
||||
|
||||
protected function getHeaderActions(): array
|
||||
public function updatedFilter($value) // Or whatever your property name is
|
||||
{
|
||||
return [
|
||||
Action::make('collapseAll')
|
||||
->label('Collapse All Charts')
|
||||
->icon('heroicon-m-chevron-up')
|
||||
->color('gray')
|
||||
->action(function ($record, $livewire) {
|
||||
$livewire->dispatch('collapse-all-charts');
|
||||
}),
|
||||
];
|
||||
$this->dispatch('filterChanged', filterValue: $value);
|
||||
}
|
||||
|
||||
// protected function getHeaderActions(): array
|
||||
// {
|
||||
// return [
|
||||
// Action::make('collapseAll')
|
||||
// ->label('Collapse All Charts')
|
||||
// ->icon('heroicon-m-chevron-up')
|
||||
// ->color('gray')
|
||||
// ->action(function ($record, $livewire) {
|
||||
// $livewire->dispatch('collapse-all-charts');
|
||||
// }),
|
||||
// ];
|
||||
// }
|
||||
|
||||
public function filtersForm(Schema $schema): Schema
|
||||
{
|
||||
return $schema
|
||||
@@ -84,8 +89,9 @@ class Statistic extends BaseDashboard
|
||||
->options(fn () => LoadStatisticFixturesLeaguesOptions::load(1))
|
||||
->live()
|
||||
->label('League')
|
||||
->afterStateUpdated(function (callable $set) {
|
||||
->afterStateUpdated(function (callable $set, $state) {
|
||||
$set('match_id', null);
|
||||
$this->dispatch('filterChanged', filterValue: $state);
|
||||
}),
|
||||
Select::make('match_id')
|
||||
->prefixIconColor('primary')
|
||||
@@ -247,25 +253,6 @@ class Statistic extends BaseDashboard
|
||||
return [
|
||||
'default' => 1,
|
||||
'md' => 2,
|
||||
'lg' => 4,
|
||||
];
|
||||
}
|
||||
|
||||
protected function getFooterWidgets(): array
|
||||
{
|
||||
return [
|
||||
StatsMedianAverage::make(),
|
||||
|
||||
// Events
|
||||
ChartEvent::make(),
|
||||
ChartEventMoAv::make(),
|
||||
ChartEventPerf::make(),
|
||||
ChartEventPerfMoAv::make(),
|
||||
// Players
|
||||
ChartPlayer::make(),
|
||||
ChartPlayerMoAv::make(),
|
||||
ChartPlayerPerf::make(),
|
||||
ChartPlayerPerfMoAv::make(),
|
||||
];
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user