View
in package
Row view state of form instances, kept outside the record data.
A view is ['collapsed' => list<string>]: the row paths {collection}.{key} rendered collapsed, in the order the
rows were collapsed and without duplicates. Every function returns a new view and changes none that it receives.
Table of Contents
Methods
- collapsibleRows() : array<string|int, mixed>
- The row paths of every collapsible row of the evaluated nodes, depth first in node order.
- initial() : array<string|int, mixed>
- The view with no collapsed row.
- rekeyRow() : array<string|int, mixed>
- Move the collapsed state of a rekeyed row and of the rows inside it to the new row path.
- removeRow() : array<string|int, mixed>
- Drop the collapsed state of a removed row and of the rows inside it.
- setAllExpanded() : array<string|int, mixed>
- The view with no collapsed row, or the view that collapses every collapsible row of the nodes.
- toggle() : array<string|int, mixed>
- Expand a collapsed row or collapse an expanded one, appending a collapsed row last.
- inside() : bool
- Whether `$path` is the row path `$rowPath` or lies inside that row.
Methods
collapsibleRows()
The row paths of every collapsible row of the evaluated nodes, depth first in node order.
public
static collapsibleRows(array<string|int, mixed> $nodes) : array<string|int, mixed>
Parameters
- $nodes : array<string|int, mixed>
Return values
array<string|int, mixed>initial()
The view with no collapsed row.
public
static initial() : array<string|int, mixed>
Return values
array<string|int, mixed>rekeyRow()
Move the collapsed state of a rekeyed row and of the rows inside it to the new row path.
public
static rekeyRow(array<string|int, mixed> $view, string $oldPath, string $newPath) : array<string|int, mixed>
Parameters
- $view : array<string|int, mixed>
- $oldPath : string
- $newPath : string
Return values
array<string|int, mixed>removeRow()
Drop the collapsed state of a removed row and of the rows inside it.
public
static removeRow(array<string|int, mixed> $view, string $rowPath) : array<string|int, mixed>
Parameters
- $view : array<string|int, mixed>
- $rowPath : string
Return values
array<string|int, mixed>setAllExpanded()
The view with no collapsed row, or the view that collapses every collapsible row of the nodes.
public
static setAllExpanded(array<string|int, mixed> $nodes, bool $expanded) : array<string|int, mixed>
Parameters
- $nodes : array<string|int, mixed>
- $expanded : bool
Return values
array<string|int, mixed>toggle()
Expand a collapsed row or collapse an expanded one, appending a collapsed row last.
public
static toggle(array<string|int, mixed> $view, string $rowPath) : array<string|int, mixed>
Parameters
- $view : array<string|int, mixed>
- $rowPath : string
Return values
array<string|int, mixed>inside()
Whether `$path` is the row path `$rowPath` or lies inside that row.
private
static inside(string $rowPath, string $path) : bool
Parameters
- $rowPath : string
- $path : string