Ersetze die Symbolauswahl im CMS durch einen Wähler mit Raster, Gruppen und Suche
Das Feld steht in den Einstellungen aller Widgets und je Karte und Merkmal. Es trägt nur die Zeichnung des gewählten Symbols; der Katalog mit allen Zeichnungen kommt beim Öffnen in einer Anfrage (nur Redaktion und Katalogverwaltung). Mit Tastatur bedienbar. Dazu Katalog-Dokumentation, Tokens und Abnahme mit Screenshots (lokal geprüft, nicht auf luf-test). Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
edca8e864c
commit
1270e2e948
21 files changed
+409
-16
No files matched your search
@@ -15,6 +15,7 @@
|
||||
use Filament\Forms\Components\RichEditor\RichContentRenderer;
|
||||
use Filament\Forms\Components\Select;
|
||||
use Filament\Forms\Components\ToggleButtons;
|
||||
use Filament\Forms\Components\ViewField;
|
||||
use Filament\Notifications\Notification;
|
||||
use Filament\Schemas\Components\Grid;
|
||||
use Filament\Schemas\Components\Group;
|
||||
@@ -125,7 +126,7 @@ public static function slotBuilder(string $name = 'widget'): Builder
|
||||
/**
|
||||
* Erklärung als kleines (i) neben der Bezeichnung: erscheint beim Überfahren und beim Fokussieren.
|
||||
*/
|
||||
private static function withInfo(ToggleButtons|Select $component, ?string $help): ToggleButtons|Select
|
||||
private static function withInfo(ToggleButtons|Select|ViewField $component, ?string $help): ToggleButtons|Select|ViewField
|
||||
{
|
||||
return filled($help)
|
||||
? $component->hintIcon('heroicon-m-information-circle', tooltip: $help)->hintColor('gray')
|
||||
@@ -154,7 +155,7 @@ public static function block(WidgetType $type): Block
|
||||
$labels = $type->settingLabels();
|
||||
$hiddenWhen = $type->settingHiddenWhen();
|
||||
|
||||
$field = function (string $key) use ($options, $labels, $type, $icons, $hiddenWhen): Select|ToggleButtons {
|
||||
$field = function (string $key) use ($options, $labels, $type, $icons, $hiddenWhen): Select|ToggleButtons|ViewField {
|
||||
$help = $labels[$key][1] ?? null;
|
||||
// Gemeinsame Höhe (ADR-38): immer als sichtbare Auswahl mit Vorgabe, nie als freie Eingabe.
|
||||
$component = $key === 'height'
|
||||
@@ -165,11 +166,14 @@ public static function block(WidgetType $type): Block
|
||||
->default($type->defaultHeight())
|
||||
->inline()
|
||||
->live()
|
||||
: Select::make($key)
|
||||
->label($labels[$key][0] ?? Str::headline($key))
|
||||
->placeholder('Vorgabe der Darstellung')
|
||||
->options($options[$key])
|
||||
->live();
|
||||
: ($key === 'symbol'
|
||||
// Symbole stehen in einem durchsuchbaren Raster (Symbolbibliothek), nicht in einer Auswahlliste.
|
||||
? SymbolField::make('symbol', $labels[$key][0] ?? 'Symbol')->live()->columnSpanFull()
|
||||
: Select::make($key)
|
||||
->label($labels[$key][0] ?? Str::headline($key))
|
||||
->placeholder('Vorgabe der Darstellung')
|
||||
->options($options[$key])
|
||||
->live());
|
||||
|
||||
if ($key === 'height') {
|
||||
$help = 'Gestaltungsparameter, keine Begrenzung: Längere Inhalte erhalten immer den nötigen Platz.';
|
||||
|
||||
Reference in new issue
Block a user