Merge remote-tracking branch 'origin/develop' into feature/videoplayer-marken
CI Feature / test (push) Successful in 6m30s
Deploy Test / test (push) Successful in 7m39s
Deploy Test / deploy (push) Successful in 36s

This commit is contained in:
Stommer committed 2026-12-01 21:13:16 +01:00
commit 8ffcf0fa33
6 files changed
+95 -2

No files matched your search

+16 -2
View File
@@ -44,7 +44,7 @@ public static function repeater(string $name = 'sections'): Repeater
->hiddenLabel()
->schema(self::sectionSchema())
->columns(['default' => 1, 'xl' => 2])
->itemLabel(fn (array $state, ?int $index): HtmlString => self::sectionLabel($state, $index))
->itemLabel(fn (Repeater $component, string $key, ?int $index): HtmlString => self::sectionLabel(self::rawItem($component, $key), $index))
->addActionLabel('Abschnitt hinzufügen')
->addBetweenActionLabel('Abschnitt hier einfügen')
->defaultItems(0)
@@ -170,7 +170,7 @@ private static function sectionSchema(): array
->reorderableWithDragAndDrop()
->reorderableWithButtons(false)
->reorderAction(fn (Action $action): Action => $action->label('Baustein auf einen anderen Platz ziehen')->tooltip('Baustein auf einen anderen Platz ziehen'))
->itemLabel(fn (array $state, ?int $index, Get $get): HtmlString => self::slotLabel($state, $index, $get('layout')))
->itemLabel(fn (Repeater $component, string $key, ?int $index, Get $get): HtmlString => self::slotLabel(self::rawItem($component, $key), $index, $get('layout')))
->default(fn (): array => self::arrangeSlots([], SectionLayouts::DEFAULT))
->extraAttributes(function (Get $get): array {
// Die eingestellte Hintergrundfarbe steht schon im Seitenaufbau hinter den Plätzen (nur bei eigener Fläche).
@@ -761,6 +761,20 @@ private static function editorColumns(mixed $layout): string
return implode(' ', array_map(fn (int $unit): string => "minmax(0, {$unit}fr)", $units));
}
/**
* Zustand eines Eintrags aus dem Rohzustand des Repeaters. Filaments `$state` im Beschriftungsausdruck verdichtet den
* ganzen Eintrag samt aller Felder der Widgets (je Abschnitt und Platz einmal je Anfrage); die Beschriftung braucht
* nur Werte, die schon im Rohzustand stehen.
*
* @return array<string, mixed>
*/
private static function rawItem(Repeater $component, string $key): array
{
$state = $component->getRawState();
return is_array($state) && is_array($state[$key] ?? null) ? $state[$key] : [];
}
/**
* @param array<string, mixed> $state
*/