Merge remote-tracking branch 'origin/develop' into feature/videoplayer-marken
This commit is contained in:
commit
8ffcf0fa33
6 files changed
+95
-2
No files matched your search
@@ -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
|
||||
*/
|
||||
|
||||
Reference in new issue
Block a user