new mapper new colors

This commit is contained in:
salam committed 2026-02-15 12:33:43 +01:00
1 parent d077b6a429
commit f1b0f43ded
14 files changed
+152 -143

No files matched your search

+22 -13
View File
@@ -46,10 +46,14 @@ class MapperLeft extends Component implements HasActions, HasSchemas, HasTable
public $search_values = [];
public $search_color = 'info';
protected $listeners = [
'refreshMapperLeft' => '$refresh',
];
public function isRemovingAllFilters() {}
public function removeTableFilter(string $filterName, ?string $field = null, bool $shouldTriggerUpdatedFiltersHook = true): void
{
if (($key = array_search($field, $this->search_values)) !== false) {
@@ -68,7 +72,8 @@ class MapperLeft extends Component implements HasActions, HasSchemas, HasTable
IconColumn::make('country.icon')->icon(fn (string $state): string => $state)->label(''),
TextColumn::make('competition_group.name')->label('Group')
->wrap()
->tooltip('Click to filter by this group')
->color('primary')
->tooltip('Filter by group')
->description(fn ($record): string => $record->country?->name ?? '')
->action(function ($record) {
if ($record?->competition_group_id ?? null && ! in_array($record->competition_group_id, $this->tableFilters['events']['competition_group_id'])) {
@@ -78,10 +83,9 @@ class MapperLeft extends Component implements HasActions, HasSchemas, HasTable
}),
TextColumn::make('starttime')
->sortable()
->time('H:i')
->alignCenter()
->description(fn ($record): string => Carbon::parse($record->starttime)->format('d. M. y')),
MapperLeftColumn::make('left')->label(''),
->time('d. M. y H:i')
->alignCenter(),
MapperLeftColumn::make('left')->label('Event')->alignCenter(),
])
->defaultSort('starttime')
->searchable(['home.name', 'away.name'])
@@ -234,7 +238,7 @@ class MapperLeft extends Component implements HasActions, HasSchemas, HasTable
$indicators = [];
if ($this->search_values) {
foreach ($this->search_values as $value) {
$indicators[] = Indicator::make($value)->removeField($value)->color('info');
$indicators[] = Indicator::make($value)->removeField($value)->color($this->search_color);
}
}
@@ -246,9 +250,15 @@ class MapperLeft extends Component implements HasActions, HasSchemas, HasTable
->persistFiltersInSession()
->deferFilters(false)
->toolbarActions([
Action::make('refreshMapperLeft')
Action::make('refresh_left')
->hiddenLabel()
->icon('phosphor-arrows-counter-clockwise')
->size(Size::Small)
->action(function (Component $livewire) {
$this->dispatch('refreshMapperLeft');
}),
Action::make('reload_left')
->hiddenLabel()
->color('gray')
->icon('phosphor-x')
->size(Size::Small)
->action(function (Component $livewire) {
@@ -267,13 +277,12 @@ class MapperLeft extends Component implements HasActions, HasSchemas, HasTable
}
#[On('search_left')]
public function searchLeft($str)
public function searchLeft($string)
{
$this->search_values = SearchString::explode($str);
$t = explode('|', $string);
$this->search_values = SearchString::explode($t[0]);
// foreach ($this->search_values as $key => $value) {
// $this->tableFilters['events'][$key] = null;
// }
$this->search_color = $t[1];
$this->dispatch('refreshMapperLeft');
}