viewkitjs 0.38.0 → 0.39.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +69 -0
- package/MIGRATION.md +7 -0
- package/fields/dist/query/figure-kinds.d.ts +2 -2
- package/fields/dist/query/figure-kinds.js +3 -0
- package/fields/dist/query/figures.d.ts +5 -3
- package/fields/dist/query/figures.js +13 -0
- package/fields/docs/reference/query.md +3 -3
- package/package.json +1 -1
- package/postgres/docs/guides/field-map.md +1 -1
- package/views/dist/atoms/HeaderChrome.d.ts +7 -0
- package/views/dist/atoms/HeaderChrome.js +15 -0
- package/views/dist/atoms/ToolbarButton.d.ts +1 -1
- package/views/dist/atoms/ToolbarButton.js +2 -2
- package/views/dist/atoms/defaults.js +4 -0
- package/views/dist/atoms/types.d.ts +39 -2
- package/views/dist/contract.d.ts +19 -8
- package/views/dist/contract.js +37 -6
- package/views/dist/controls/field/looks.d.ts +1 -1
- package/views/dist/controls/field/looks.js +7 -3
- package/views/dist/controls/field/tokens.d.ts +4 -0
- package/views/dist/controls/field/tokens.js +1 -0
- package/views/dist/controls/field.css +33 -0
- package/views/dist/controls/filter-editor/block.d.ts +3 -1
- package/views/dist/controls/filter-editor/block.js +4 -3
- package/views/dist/controls/filter-editor/filter-editor.d.ts +13 -2
- package/views/dist/controls/filter-editor/filter-editor.js +45 -15
- package/views/dist/controls/filter-editor/how.d.ts +3 -1
- package/views/dist/controls/filter-editor/map-filter-body.js +5 -4
- package/views/dist/controls/filter-editor/map-rules.d.ts +2 -1
- package/views/dist/controls/filter-editor/map-rules.js +3 -3
- package/views/dist/controls/internal/menu-items.d.ts +2 -0
- package/views/dist/controls/internal/menu-items.js +1 -1
- package/views/dist/controls/internal/part-slot.d.ts +1 -1
- package/views/dist/controls/internal/part-slot.js +1 -1
- package/views/dist/controls/internal/row-actions.d.ts +33 -0
- package/views/dist/controls/internal/row-actions.js +28 -0
- package/views/dist/controls/menu/map-menu.js +1 -1
- package/views/dist/controls/popover/map-popover.d.ts +1 -1
- package/views/dist/controls/popover/map-popover.js +2 -2
- package/views/dist/controls/sheet/map-sheet.js +9 -6
- package/views/dist/controls/sort-editor/map-sort-body.js +1 -0
- package/views/dist/controls/sort-editor/sort-editor.d.ts +5 -1
- package/views/dist/controls/sort-editor/sort-editor.js +41 -13
- package/views/dist/controls/text-editor.css +20 -0
- package/views/dist/controls/toolbar-button/atom-toolbar-button.d.ts +1 -1
- package/views/dist/controls/toolbar-button/atom-toolbar-button.js +2 -2
- package/views/dist/editors/EditorPanel.js +1 -1
- package/views/dist/field-row/FieldRow.js +38 -16
- package/views/dist/field-row/editors/RowChipsEditor.js +3 -1
- package/views/dist/field-row/editors/RowDateEditor.js +3 -1
- package/views/dist/field-row/editors/RowNameEditor.js +3 -1
- package/views/dist/field-row/editors/RowPlaceEditor.js +4 -2
- package/views/dist/field-row/editors/RowRangeEditor.js +3 -1
- package/views/dist/field-row/editors/RowRelationEditor.js +5 -2
- package/views/dist/field-row/editors/RowSelectEditor.js +3 -1
- package/views/dist/field-row/editors/RowTextEditor.d.ts +7 -1
- package/views/dist/field-row/editors/RowTextEditor.js +25 -4
- package/views/dist/field-row/editors/RowValueListEditor.js +4 -4
- package/views/dist/field-row/editors/row-place.d.ts +33 -0
- package/views/dist/field-row/editors/row-place.js +141 -0
- package/views/dist/field-row/field-row-button.d.ts +9 -6
- package/views/dist/field-row/field-row-button.js +3 -3
- package/views/dist/field-row/row-target.d.ts +4 -1
- package/views/dist/field-row/row-target.js +1 -1
- package/views/dist/grid/chrome/GridAggregateMenu.d.ts +12 -11
- package/views/dist/grid/chrome/GridAggregateMenu.js +4 -3
- package/views/dist/grid/chrome/GridFooter.d.ts +12 -4
- package/views/dist/grid/chrome/GridFooter.js +11 -9
- package/views/dist/grid/chrome/GridHeader.js +4 -3
- package/views/dist/grid/chrome/GridResizeHandle.d.ts +7 -3
- package/views/dist/grid/chrome/GridResizeHandle.js +2 -3
- package/views/dist/grid/chrome/GridTable.js +1 -1
- package/views/dist/grid/chrome/GridTableSurface.js +1 -1
- package/views/dist/grid/chrome/grid-body-place.d.ts +2 -4
- package/views/dist/grid/chrome/grid-body-place.js +4 -5
- package/views/dist/grid/chrome/grid-figure-value.js +10 -4
- package/views/dist/grid/chrome/grid-table-props.d.ts +11 -3
- package/views/dist/grid/grid.css +7 -3
- package/views/dist/internal/over-cell.d.ts +8 -0
- package/views/dist/internal/over-cell.js +5 -0
- package/views/dist/list/bar-keys.d.ts +5 -0
- package/views/dist/list/bar-keys.js +2 -0
- package/views/dist/list/bar-parts.d.ts +27 -0
- package/views/dist/list/bar-parts.js +38 -0
- package/views/dist/list/buttons/clear-save.d.ts +7 -0
- package/views/dist/list/buttons/clear-save.js +15 -0
- package/views/dist/list/buttons/customize.d.ts +28 -0
- package/views/dist/list/buttons/customize.js +31 -0
- package/views/dist/list/buttons/filter.d.ts +32 -0
- package/views/dist/list/buttons/filter.js +60 -0
- package/views/dist/list/buttons/new.d.ts +18 -0
- package/views/dist/list/buttons/new.js +9 -0
- package/views/dist/list/buttons/quick.d.ts +15 -0
- package/views/dist/list/buttons/quick.js +24 -0
- package/views/dist/list/buttons/search.d.ts +18 -0
- package/views/dist/list/buttons/search.js +17 -0
- package/views/dist/list/buttons/shared.d.ts +91 -0
- package/views/dist/list/buttons/shared.js +131 -0
- package/views/dist/list/buttons/sort-filter.d.ts +6 -0
- package/views/dist/list/buttons/sort-filter.js +16 -0
- package/views/dist/list/buttons/sort.d.ts +17 -0
- package/views/dist/list/buttons/sort.js +34 -0
- package/views/dist/list/buttons/views.d.ts +21 -0
- package/views/dist/list/buttons/views.js +36 -0
- package/views/dist/list/editor-menus.d.ts +13 -0
- package/views/dist/list/editor-menus.js +13 -0
- package/views/dist/list/index.d.ts +41 -0
- package/views/dist/list/index.js +19 -0
- package/views/dist/list/line.d.ts +55 -0
- package/views/dist/list/line.js +221 -0
- package/views/dist/list/pane-box.d.ts +6 -0
- package/views/dist/list/pane-box.js +15 -0
- package/views/dist/list/panels/customize.d.ts +8 -0
- package/views/dist/list/panels/customize.js +23 -0
- package/views/dist/list/panels/filter-bar.d.ts +12 -0
- package/views/dist/list/panels/filter-bar.js +67 -0
- package/views/dist/list/panels/filter.d.ts +8 -0
- package/views/dist/list/panels/filter.js +23 -0
- package/views/dist/list/panels/quick.d.ts +7 -0
- package/views/dist/list/panels/quick.js +16 -0
- package/views/dist/list/panels/shared.d.ts +25 -0
- package/views/dist/list/panels/shared.js +33 -0
- package/views/dist/list/panels/sort.d.ts +8 -0
- package/views/dist/list/panels/sort.js +19 -0
- package/views/dist/list/panels/views.d.ts +13 -0
- package/views/dist/list/panels/views.js +27 -0
- package/views/dist/list/ready.d.ts +35 -0
- package/views/dist/list/ready.js +7 -0
- package/views/dist/list/root-base.d.ts +17 -0
- package/views/dist/list/root-base.js +9 -1
- package/views/dist/list/root.js +2 -2
- package/views/dist/list/store.d.ts +19 -0
- package/views/dist/list/store.js +40 -1
- package/views/dist/list/toolbar-model.d.ts +95 -0
- package/views/dist/list/toolbar-model.js +177 -0
- package/views/dist/list/toolbar.js +140 -328
- package/views/dist/list/views-axis.js +15 -4
- package/views/dist/model/aggregates.d.ts +18 -8
- package/views/dist/model/aggregates.js +16 -22
- package/views/dist/panels/react/filter/FilterEditor.d.ts +3 -1
- package/views/dist/panels/react/filter/FilterEditor.js +2 -2
- package/views/dist/panels/react/filter/filter-body.d.ts +3 -1
- package/views/dist/panels/react/filter/filter-body.js +2 -2
- package/views/dist/panels/react/sort/SortEditor.d.ts +3 -1
- package/views/dist/panels/react/sort/SortEditor.js +4 -4
- package/views/dist/panels/react/toolbar/Toolbar.d.ts +80 -3
- package/views/dist/panels/react/toolbar/Toolbar.js +85 -52
- package/views/dist/panels/react/toolbar/ToolbarBarSorts.d.ts +9 -0
- package/views/dist/panels/react/toolbar/ToolbarBarSorts.js +57 -0
- package/views/dist/panels/react/toolbar/ToolbarFilterAdd.d.ts +4 -1
- package/views/dist/panels/react/toolbar/ToolbarFilterAdd.js +2 -2
- package/views/dist/panels/react/toolbar/ToolbarOptions.d.ts +30 -0
- package/views/dist/panels/react/toolbar/ToolbarOptions.js +6 -1
- package/views/dist/panels/react/toolbar/ToolbarSortPill.d.ts +5 -0
- package/views/dist/panels/react/toolbar/ToolbarSortPill.js +6 -4
- package/views/dist/panels/react/toolbar/ToolbarViews.d.ts +7 -1
- package/views/dist/panels/react/toolbar/ToolbarViews.js +4 -4
- package/views/dist/panels/react/toolbar/sheet-host.d.ts +3 -0
- package/views/dist/panels/react/toolbar/sheet-host.js +6 -0
- package/views/dist/panels/react/toolbar/use-give-way.d.ts +6 -0
- package/views/dist/panels/react/toolbar/use-give-way.js +8 -1
- package/views/dist/panels/react/views-row/ViewPicker.d.ts +8 -1
- package/views/dist/panels/react/views-row/ViewPicker.js +12 -7
- package/views/dist/panels/settings/filter-groups.js +7 -0
- package/views/dist/provider/components.d.ts +36 -2
- package/views/dist/react.d.ts +1 -1
- package/views/dist/styles.css +104 -1
- package/views/dist/styles.unlayered.css +104 -1
- package/views/docs/contract.md +20 -12
- package/views/docs/controls/field.md +1 -0
- package/views/docs/controls/filter-editor.md +1 -1
- package/views/docs/controls/menu.md +1 -1
- package/views/docs/controls/sort-editor.md +1 -1
- package/views/docs/guides/atoms.md +1 -0
- package/views/docs/guides/the-grid.md +2 -2
- package/views/docs/reference/controls.md +3 -3
- package/views/docs/reference/field-row.md +1 -1
- package/views/docs/reference/grid.md +4 -4
- package/views/docs/reference/list.md +168 -6
- package/views/docs/reference/looks.md +1 -1
- package/views/docs/reference/panels-react.md +7 -7
- package/views/docs/reference/react.md +13 -10
- package/views/docs/reference/views.md +8 -6
- package/views/skills/views/SKILL.md +2 -1
|
@@ -32,7 +32,7 @@ The primitives your app hands in, modelled on Base UI's shapes: a controlled `op
|
|
|
32
32
|
- `ViewsResolvedComponents` — the map as `useViews()` hands it on: yours, with `Input` always there, your own or the plain one, and `Calendar` always there, yours or a stand-in that throws an error naming the slot when it is reached.
|
|
33
33
|
- `ViewsButtonProps` — a button: its `children`, `onClick`, `disabled`, a `variant` (`default`, `secondary`, `ghost`, `outline`, `destructive`; `secondary` only for the views picker's chip), a `size` (`default`, `sm`, `icon`), its `type`, a class, `aria-label` and `title`; and a `ref`, `tabIndex`, `aria-haspopup`, `aria-expanded`, `data-slot` and `data-open`, which the grid hands its own buttons: forward each to your element; and `aria-disabled`, which a field row's edit target is handed while its write is pending; and `aria-pressed`, `role`, `aria-selected`, `data-state` and `data-vs-row`, which the panels' own buttons are handed (the new-line mark, a view's row in the picker, the views row's chips and a view's ⋯, Export); and `data-key`, which one of a part that repeats, beside its `data-slot`, inside the sort and filter panels under `panelControls`. There a ViewKit part may hand it more props than these (a tooltip's handlers, a `data-*` the panel finds it by again): forward the rest to your element.
|
|
34
34
|
- `ViewsPopoverProps` — a popover opened at an `anchor`, controlled by `open` and `onOpenChange`, placed by `side`, `align`, `sideOffset` and `alignOffset`; its `label`, where ViewKit names it (a panel's popover under `panelControls`), is its name to a screen reader, your popup's `aria-label`.
|
|
35
|
-
- Focus: `initialFocus` false keeps focus where it was when the popup opens, for an editor that focuses its own input (with `preventScroll`). Default true.
|
|
35
|
+
- Focus: `initialFocus` false keeps focus where it was when the popup opens, for an editor that focuses its own input (with `preventScroll`). Default true. `finalFocus` false moves no focus as it closes, for what hands the focus back itself (a field row's editor, to its row): forward it to your popup's return of focus. Default true.
|
|
36
36
|
- Vetoes: `onOutsidePress` is handed the pointer press, its `target` where it landed, and returns `false` to keep the popup open, also against the focus that press moves; focus leaving by keyboard closes without asking. `onEscape` does the same for Escape.
|
|
37
37
|
- Look: `chrome` is `panel` (your card popover, the default) or `menu` (your menu panel's surface, for a popover that holds a list: no inset, no card width). `onPanelClick` takes a click inside the popup, `panelData` sets `data-*` attributes on it, and `style` carries what a class cannot say, such as a width that follows a cell.
|
|
38
38
|
- `ViewsPortsHostProps` — what the components map's `PortsHost` is told: `toast` and `confirm` (which ports the app left out) and `onReady` (hand it the ports once they stand).
|
|
@@ -58,11 +58,11 @@ The primitives your app hands in, modelled on Base UI's shapes: a controlled `op
|
|
|
58
58
|
- `ViewsLinkRole` — `{ value, label, archived? }`: a role a link may hold, as a links body offers it.
|
|
59
59
|
- `ViewsTextBodyProps` — a whole body for a field typed as one string your app draws: `label`, `kind` (`text`, `url`, `domain`, `email`, `phone` or `rich_text`), `paragraph`, `value` and `onValueChange` (the whole text, every change as it is made), `onDone` (closes as Enter does), `check` (a value's reason, or null), `region` (a phone's country), `typed`, `autoFocus`, `form` (`phone`: draw no ✕, ✓ or Cancel of your own) and `place` (`cell` in a grid cell, `row` in a field row, where it stands in the row's flow; absent, `cell`), and, in the phone's sheet, `onStepChange` (a `ViewsBodyStep` while it stands on a step of its own, `null` once back). The editor keeps the draft, Tab, Escape, ⌘ or Ctrl Enter, the close's tidy, the write check, the save and the phone's ✕ and ✓.
|
|
60
60
|
- `ViewsNumberBodyProps` — a whole body for a number, money or a percent your app draws: `label`, `kind` (`number`, `money` or `percent`), `value` (a number, `null` empty, `NaN` unreadable) and `onValueChange` (the number and, when it is one of `units`, the unit; every change as it is made), `unit` and `units`, `onDone` (closes as Enter does), `check` (a value's reason, or null), `decimals`, `min`, `max`, `locale`, `decimal`, `empty`, `align`, `typed`, `autoFocus`, `form` (`phone`: draw no ✕, ✓ or Cancel of your own) and, in the phone's sheet, `onStepChange` (a step of its own, money's currencies). The editor keeps the draft, the rounding, Tab, Escape, ⌘ or Ctrl Enter, the write check, the save and the phone's ✕ and ✓.
|
|
61
|
-
- `ViewsSortBodyProps` — the sort editor's whole body your app draws: `label`, `options` (the fields it sorts by, each its `value`, `label` and `defaultDir`, and, as the grid's header marks its column, its field's `type`, its `part` and the header's `glyph`), `rules` (in order, the first sorting first), `setAside` (the set-aside sorts, `[]` when none), `max`, `form`, `addSort` (on a computer, Add sort at its foot), `onStepChange` (on a phone: a step of your body's own, its title and Back, `null` once back), `onRulesChange` (the whole rules and, when handed, the set-aside sorts kept; every change as it is made; a list that breaks the rules writes nothing), `onDone` (what holds it closes) and, on a phone where the sheet's head doesn't draw them, `actions` (the ✕, taking the rules back to what they were as it opened, and ✓). ViewKit keeps the check, the latest rules between renders, the close on the last rule and what ✕ takes back to.
|
|
62
|
-
- Its `items` (`ViewsSortEditorItems`, from `menus.sortEditor`, VK-1063): its menus as data, `(items, ctx) => items`, `ctx` a `ViewsSortEditorItemsContext`: `{ menu: "rule", field, index }` (a rule's ⋯; `field` the sort's key) or `{ menu: "aside", field }` (a set-aside rule's ⋯; `field` its stored `fieldKey`), with `form`. `CONTROLS.SortBody` draws what it hands back; a body of your own may honour it.
|
|
61
|
+
- `ViewsSortBodyProps` — the sort editor's whole body your app draws: `label`, `options` (the fields it sorts by, each its `value`, `label` and `defaultDir`, and, as the grid's header marks its column, its field's `type`, its `part` and the header's `glyph`), `rules` (in order, the first sorting first), `setAside` (the set-aside sorts, `[]` when none), `max`, `form`, `addSort` (on a computer, Add sort at its foot), `onStepChange` (on a phone: a step of your body's own, its title and Back, `null` once back), `onRulesChange` (the whole rules and, when handed, the set-aside sorts kept; every change as it is made; a list that breaks the rules writes nothing), `onDone` (what holds it closes) and, on a phone where the sheet's head doesn't draw them, `actions` (the ✕, taking the rules back to what they were as it opened, and ✓). ViewKit keeps the check, the latest rules between renders, the close on the last rule (unless `empty="editor"`) and what ✕ takes back to. `empty` (VK-1091): `"editor"` where a placed Sort asks a computer's body with no rule to say nothing sorts yet over Add sort (`views.panels.sort-empty`), staying open as its last rule goes; absent, as before.
|
|
62
|
+
- Its `items` (`ViewsSortEditorItems`, from `menus.sortEditor`, VK-1063): its menus as data, `(items, ctx) => items`, `ctx` a `ViewsSortEditorItemsContext`: `{ menu: "rule", field, index }` (a rule's ⋯; `field` the sort's key) or `{ menu: "aside", field }` (a set-aside rule's ⋯; `field` its stored `fieldKey`); and (VK-1065) `{ menu: "row", field, index }` or `{ menu: "row", field, aside: true }` (the buttons at a rule's end: × `delete` on a computer, ⋯ `more`) or `{ menu: "foot" }` (Add sort and Clear: `add`, `clear`), with `form`. `CONTROLS.SortBody` draws what it hands back; a body of your own may honour it.
|
|
63
63
|
- `ViewsQuickFiltersBodyProps` — the quick filters' whole body your app draws: `label`, `fields` (each its `key`, `label`, `searchPlaceholder`, its `options` as the quick filter field hands them (each value's mark is its option's), and `values` in the order to show them, each value its key, its words, its `count` where counts show and whether it is `held`; a held value no count lists is among them, drawn from the hold and worded by the config's `heldLabels` else its key; after the fields offered, each other field holding a value, its held values alone), `hold` (each held field once, its values), `several`, `showCounts`, `form`, `onHoldChange` (the whole hold, every change as it is made; one that holds a field twice, more than one value where `several` is false, or a value added on a field the strip doesn't offer writes nothing), `onDone` (what holds it closes) and, on a phone where the sheet's head doesn't draw it, `actions` (the ✕, closing it).
|
|
64
|
-
- `ViewsFilterBodyProps` — the filter editor's whole body your app draws: `label`, `fields` (the fields a rule may name, `ViewsFilterBodyField`s, each column the list can't filter among them in its place, greyed by its `disabled`), `filter` (the level it is open on, a `FilterGroup`: an advanced filter's group on a computer, the whole filter on a phone), `levels` (how deep its rules may stand, its own the first), `excludable` (whether it may be `not`), `relation` (where the level is a relation's where edited in place: its field key, words and quantifier, and `gone`, why in words, where the list no longer lists the relation: there a level that adds or changes a rule writes nothing), `form`, `onFilterChange` (the whole level and, at a relation, its quantifier; every change as it is made; a level that breaks the rules writes nothing; an empty one on a computer takes its advanced filter away), `ruleValue` (a rule's value in ViewKit's own body for its type, each change handed back as the rule), `onDone` (what holds it closes) and, on a phone where the sheet's head doesn't draw them, `actions` (the ✕, taking the filter back to what it was as it opened, and ✓). ViewKit keeps the check, the Or top's wrap, the pills' keys and what ✕ takes back to.
|
|
65
|
-
- Its `items` (`ViewsFilterEditorItems`, from `menus.filterEditor`, VK-1063): its menus as data, `ctx` a `ViewsFilterEditorItemsContext`: `{ menu: "rule" | "aside", field, part?, relation?, path }` (a rule's ⋮ or a set-aside rule's: its `fieldKey`, its part, the relation it stands under) or `{ menu: "group", path }` (a group's actions), each with its `path` in the filter the body is handed (indices through `items` and a relation rule's `where.items`; the whole filter `[]`), with `form`.
|
|
64
|
+
- `ViewsFilterBodyProps` — the filter editor's whole body your app draws: `label`, `fields` (the fields a rule may name, `ViewsFilterBodyField`s, each column the list can't filter among them in its place, greyed by its `disabled`), `filter` (the level it is open on, a `FilterGroup`: an advanced filter's group on a computer, the whole filter on a phone), `levels` (how deep its rules may stand, its own the first), `empty` (VK-1091: `"editor"` where a placed Filter asks a computer's top level with nothing filtered to say so over Add filter, `views.panels.filter-empty`, staying open as its last rule goes; absent, the fields), `excludable` (whether it may be `not`), `relation` (where the level is a relation's where edited in place: its field key, words and quantifier, and `gone`, why in words, where the list no longer lists the relation: there a level that adds or changes a rule writes nothing), `form`, `onFilterChange` (the whole level and, at a relation, its quantifier; every change as it is made; a level that breaks the rules writes nothing; an empty one on a computer takes its advanced filter away), `ruleValue` (a rule's value in ViewKit's own body for its type, each change handed back as the rule), `onDone` (what holds it closes) and, on a phone where the sheet's head doesn't draw them, `actions` (the ✕, taking the filter back to what it was as it opened, and ✓). ViewKit keeps the check, the Or top's wrap, the pills' keys and what ✕ takes back to.
|
|
65
|
+
- Its `items` (`ViewsFilterEditorItems`, from `menus.filterEditor`, VK-1063): its menus as data, `ctx` a `ViewsFilterEditorItemsContext`: `{ menu: "rule" | "aside", field, part?, relation?, path }` (a rule's ⋮ or a set-aside rule's: its `fieldKey`, its part, the relation it stands under) or `{ menu: "group", path }` (a group's actions); and (VK-1065) `{ menu: "row", field, part?, relation?, path, aside? }` (a rule's ⋮, `more`) or `{ menu: "foot", path }` (a foot's buttons: `add`, `clear`, `delete`, `more`), each with its `path` in the filter the body is handed (indices through `items` and a relation rule's `where.items`; the whole filter `[]`), with `form`.
|
|
66
66
|
- `ViewsFilterBodyField` — a field a filter body's rule may name: `key`, `label`, `fieldKey`, `part`, `type` (its value type, which says its ways), `far` (a relation's fields one level in), `integer` (`true` on a number field that holds whole numbers only: its box takes whole numbers) and `disabled` (on a column the list can't filter, why in words: draw it greyed and never name it in a rule).
|
|
67
67
|
- `ViewsFieldsBodyProps` — the field list's whole body your app draws: `purpose` (`sort` or `filter`), `label`, `search` (its search's words), `fields` (each a `ViewsFieldsBodyField`), `own` (the field being changed; absent where a pick adds), `ownRelation` (for a rule on a related record's field, the relation `own` stands under, its key as `onPick` hands it back), `form`, `onPick` (the key picked, and a far field's key for a far field; a key not handed, or handed `disabled`, writes nothing) and `onDone` (what holds it closes, or on a phone the page turns back).
|
|
68
68
|
- `ViewsFieldsBodyField` — a field as the field list's body is handed it: `key`, `label`, `type` and `part` (its field's type and the part it reads, as the grid's header reads them), `glyph` (its column's glyph, drawn as the header draws it), `disabled` (why it can't be picked) and, for a filter's relation, `far` (its far fields, one level in).
|
|
@@ -79,9 +79,9 @@ The primitives your app hands in, modelled on Base UI's shapes: a controlled `op
|
|
|
79
79
|
- `ViewsGroupBodyProps` — the group editor's whole body your app draws: `label`, `dimensions` (each a `ViewsGroupDimension`), `group` (a `ViewsGroupValue`), `manualOrder` (your own order may be picked), `form`, `onGroupChange` (the whole group, every change as it is made; one write for each: a new Group by, order or date step alone, else Hide empty groups, else the groups; a new Group by keeps the order and step handed with it only where the new field offers them; a value that changes two at once, names a field the list doesn't offer, or names an order or step the field grouped by doesn't offer writes nothing), `onDone` (inside Customize, back to its list), `actions` (none inside Customize, whose head holds the ✕) and `onStepChange` (a level of the body's own, Group by's fields or an order's choices, whose name and Back Customize's head shows).
|
|
80
80
|
- Its `items` (`ViewsGroupEditorItems`, from `menus.groupEditor`, VK-1063): its rows as data, `ctx` a `ViewsGroupEditorItemsContext`: `{ menu: "settings", field? }` (Group by, Order, Direction, Date step, Hide empty groups; `field` the field grouped by) or `{ menu: "foot" }` (Remove grouping), with `form`.
|
|
81
81
|
- `ViewsSortEditorItems` — the sort editor's menus reshaped (`menus.sortEditor`, VK-1063): `(items: ViewsMenuItem[], ctx: ViewsSortEditorItemsContext) => ViewsMenuItem[]`.
|
|
82
|
-
- `ViewsSortEditorItemsContext` — which of the sort editor's menus: `{ menu: "rule", field, index }` or `{ menu: "aside", field }`, with `form`.
|
|
82
|
+
- `ViewsSortEditorItemsContext` — which of the sort editor's menus: `{ menu: "rule", field, index }` or `{ menu: "aside", field }`; or which of its rule ends and its foot (VK-1065): `{ menu: "row", field, index }`, `{ menu: "row", field, aside: true }` or `{ menu: "foot" }`; with `form`.
|
|
83
83
|
- `ViewsFilterEditorItems` — the filter editor's menus reshaped (`menus.filterEditor`): `(items, ctx: ViewsFilterEditorItemsContext) => items`.
|
|
84
|
-
- `ViewsFilterEditorItemsContext` — which of the filter editor's menus: `{ menu: "rule" | "aside", field, part?, relation?, path }` or `{ menu: "group", path }
|
|
84
|
+
- `ViewsFilterEditorItemsContext` — which of the filter editor's menus: `{ menu: "rule" | "aside", field, part?, relation?, path }` or `{ menu: "group", path }`; or which of its rule ends and feet (VK-1065): `{ menu: "row", field, part?, relation?, path, aside? }` or `{ menu: "foot", path }`; with `form`.
|
|
85
85
|
- `ViewsGroupEditorItems` — the group editor's rows reshaped (`menus.groupEditor`): `(items, ctx: ViewsGroupEditorItemsContext) => items`.
|
|
86
86
|
- `ViewsGroupEditorItemsContext` — which of the group editor's rows: `{ menu: "settings", field? }` or `{ menu: "foot" }`, with `form`.
|
|
87
87
|
- `ViewsGroupDimension` — a field a list can be grouped by: `value`, `label`, `orderOptions` (each its mode, words and `defaultDir`), `defaultOrder`, and a date's `granularities` with `defaultGranularity`.
|
|
@@ -148,7 +148,7 @@ Guide: [atoms](../guides/atoms.md).
|
|
|
148
148
|
The pieces the rendering is built from, and your app's own pieces it cannot draw itself. Each ships as a default, drawn from your app's colours and marked with its own `data-slot`; your app swaps any of them through the provider's `atoms`, and the rest stay the defaults. A swapped atom marks itself as your app does. The [contract](../contract.md) lists their slots and states.
|
|
149
149
|
|
|
150
150
|
- `DEFAULT_VIEWS_ATOMS` — the atoms every app starts with, one default per name of `ViewsAtoms`; the provider lays your `atoms` over it.
|
|
151
|
-
- `ViewsAtoms` — the full set, one component per atom: `List`, `Row`, `RowContent` (deprecated, drawn by nothing), `TickBox`, `Avatar`, `StatusBadge`, `StatusMarker`, `Tag`, `CommandMenu`, `RelationLink`, `RelationRoles`, `RelationChip`, `CellMore`, `Loading`, `LoadMore`, `PlatformMark`, `RowMenu`, and the rows ViewKit's own filter and sort bodies draw, `CheckRow`, `RadioRow`, `DirectionButton`, `MenuRow` and `PanelSearch` (the older panels, `severalSorts: false` or `filterGroups: false`, and the value body a filter rule falls back to), with `ChoiceRow` and `ToggleRow` (deprecated, drawn by nothing), the selection's `SelectionSheet`, the filter panel's month `RangeCalendar`, the views row's `Pill`,
|
|
151
|
+
- `ViewsAtoms` — the full set, one component per atom: `List`, `Row`, `RowContent` (deprecated, drawn by nothing), `TickBox`, `Avatar`, `StatusBadge`, `StatusMarker`, `Tag`, `CommandMenu`, `RelationLink`, `RelationRoles`, `RelationChip`, `CellMore`, `Loading`, `LoadMore`, `PlatformMark`, `RowMenu`, and the rows ViewKit's own filter and sort bodies draw, `CheckRow`, `RadioRow`, `DirectionButton`, `MenuRow` and `PanelSearch` (the older panels, `severalSorts: false` or `filterGroups: false`, and the value body a filter rule falls back to), with `ChoiceRow` and `ToggleRow` (deprecated, drawn by nothing), the selection's `SelectionSheet`, the filter panel's month `RangeCalendar`, the views row's `Pill`, the toolbar's `ToolbarButton`, and a grid header cell's `HeaderGlyph`, `HeaderSortMark` and `HeaderResizeHandle`. The provider's `atoms` takes any part of it.
|
|
152
152
|
- `ViewsChoiceRowProps` — deprecated with the `ChoiceRow` atom, which nothing draws; a panel's value row: `label`, a `description` under it, a right-hand `meta` (a sample, a count; a row with one draws no check), `leading`, `trailing`, `selected`, `onClick`, `onMouseDown`, `disabled`, `role` and `aria-selected`.
|
|
153
153
|
- `ViewsCheckRowProps` — toggles one of many, a tick box on the left: `checked`, `onClick`, its `children`, `leading`, `trailing`, `disabled`.
|
|
154
154
|
- `ViewsRadioRowProps` — picks one of a set: `selected`, `label`, `onClick`, `leading`, `trailing`, `mark` (`"check"` or `"box"`), `disabled` and the `disabledReason` your `Tooltip` shows, and class hooks for the check and the label.
|
|
@@ -157,8 +157,8 @@ The pieces the rendering is built from, and your app's own pieces it cannot draw
|
|
|
157
157
|
- `ViewsToggleRowProps` — deprecated with the `ToggleRow` atom, which nothing draws; a boolean flipped in place: `icon`, `label`, `active`, `disabled` and the `disabledReason` your `Tooltip` shows, `onClick`, and `reset` (`{ onReset }`), the way back to the reader's default.
|
|
158
158
|
- `ViewsPanelSearchProps` — a panel's text box: `value`, `onChange`, `onClear`, `placeholder`, `autoFocus`, `onKeyDown`, `onFocus`, `inputRef`, `leading` (`null` drops the magnifier), `suffix` and `inputMode`.
|
|
159
159
|
- `ViewsPillProps` — one option of a row of pills: `active`, `variant` (`solid` or `plain`), `size` (`default` or `sm`), `leading` and `leadingSlot`, your own `activeClassName` and `hoverClassName`, `onClick`, `onContextMenu`, `onPointerDown`, `menuOpen` (it opens a menu) and `ref`.
|
|
160
|
-
- `ViewsToolbarButtonProps` — a toolbar's button: its `icon`, its `label` (its name, and the word a dress shows unless `word` says another, or `null` for none), a `count` in its corner that becomes a ✕ badge clearing what it counts when handed `onClear`, a `dot` drawn instead of a count, `open`, `changed`, `edge` (the row's outermost button), `disabled`, `size` (`md` or `sm`), `popup` (`menu` or `dialog`, with `aria-expanded` from `open`), `joined` (`start`, `middle` or `end`: one of buttons joined as one, its outer corners alone rounded, `data-joined`), `waits` (its words say what it waits for, in the placeholder's colour, `data-waits`), `part` (which button it is, below), `className` (its toolbar place's class: put it on the button), `onClick`, `onPointerDown` and `ref`; its own words (`children`) keep to one line, cut with "…" where a holder caps its width.
|
|
161
|
-
- `ViewsToolbarButtonPart` — which of the toolbar's buttons a `ToolbarButton` stands for, handed as `part` by every button the toolbar draws: named after the `toolbarParts` place it stands in (`options`, `search`, `quick`, `new`, `sort`, `filter`, `filter-add`, `filters`, `advanced-filters`, `sort-pill`), a place's second kind of button by a name of its own (`sort-add`, Sort's +; `more-filters`, "+N filters"), ⋯ `more`, and the frame's parts (`ViewsFramePart`). Which place draws which is [`/list`'s Default keys](./list.md#default-keys). An atom that spreads its leftover props onto its element takes `part` out first.
|
|
160
|
+
- `ViewsToolbarButtonProps` — a toolbar's button: its `icon`, its `label` (its name, and the word a dress shows unless `word` says another, or `null` for none), a `count` in its corner that becomes a ✕ badge clearing what it counts when handed `onClear`, a `dot` drawn instead of a count, `open`, `changed`, `edge` (the row's outermost button), `disabled`, `size` (`md` or `sm`), `popup` (`menu` or `dialog`, with `aria-expanded` from `open`), `expanded` (VK-1091: it shows and hides a part of the page rather than opening a popup, Sort and filter: `aria-expanded` from it), `joined` (`start`, `middle` or `end`: one of buttons joined as one, its outer corners alone rounded, `data-joined`), `waits` (its words say what it waits for, in the placeholder's colour, `data-waits`), `part` (which button it is, below), `className` (its toolbar place's class: put it on the button), `onClick`, `onPointerDown` and `ref`; its own words (`children`) keep to one line, cut with "…" where a holder caps its width.
|
|
161
|
+
- `ViewsToolbarButtonPart` — which of the toolbar's buttons a `ToolbarButton` stands for, handed as `part` by every button the toolbar draws: named after the `toolbarParts` place it stands in (`options`, `search`, `quick`, `new`, `sort`, `filter`, `filter-add`, `filters`, `advanced-filters`, `sort-pill`), a place's second kind of button by a name of its own (`sort-add`, Sort's +; `more-filters`, "+N filters"), ⋯ `more`, a placed Sort and filter `sort-filter` (VK-1091), and the frame's parts (`ViewsFramePart`). Which place draws which is [`/list`'s Default keys](./list.md#default-keys). An atom that spreads its leftover props onto its element takes `part` and `expanded` out first.
|
|
162
162
|
- `ViewsFramePart` — the six a `ToolbarButton` is handed only where your own toolbar frame draws them: `views-chip`, `views-tab`, `views-more`, `views-add`, `clear` or `save`, with `current` (a view tab; `true`, the open one) and `onContextMenu` (a tab's verbs); draw each as its `data-slot` (`vk-views-chip`, `vk-views-tab`, `vk-views-more`, `vk-views-add`, `vk-toolbar-clear`, `vk-toolbar-save-button`). Dress by these, not by any `part`: `if (part && FRAME.has(part))`.
|
|
163
163
|
- `ViewsListProps` — the rows' container, the inset a run of rows sits in inside a panel or a command list's group: its `children` and a class.
|
|
164
164
|
- `ViewsRowContentProps` — a row's inside, what `ViewsRowProps` is built on (the `RowContent` atom that took it alone is deprecated).
|
|
@@ -181,6 +181,9 @@ The pieces the rendering is built from, and your app's own pieces it cannot draw
|
|
|
181
181
|
- `ViewsRelationRolesProps` — a link's roles, drawn inside its chip after the record's name, on a `many` relation that declares `links`: the `relation` value and its `roles` in order, each its stored `value` and its `label` (the field's, else the value). Handed only when the link holds one or more. The default draws the labels in the subtle colour after a middle dot, cut before the name in a narrow cell, and names the record and every role on hover.
|
|
182
182
|
- `ViewsRelationChipProps` — a mentioned record (VK-1053), drawn where the provider's `panelControls` names `RelationChip`: every relation ViewKit draws, in a table's cell (one and many, and the +N list), a field row's value, `renderFieldValue` (a highlight) and a user field's chip. ViewKit places a mentioned record and hands its data; your app draws it. It is handed `relation` (`id`, `label`, `entity`, `avatarUrl`), `roles` (each its `value` and `label`; none but on a `many` relation that declares `links`), `size` (`chip` in a cell or a highlight, `row` in a field row), `render`, the host's link where it has one, and `fallback`, ViewKit's own chip as it would draw it there. The default draws its `fallback`.
|
|
183
183
|
- `ViewsRelationChipLinkProps` — what a mentioned record hands the host's link it draws itself through (`render`): its own element's props, its words and mark as `children`, its class, its `data-*`, its ref. The host's link draws its own element with them: a cell whose host opens its relations a bare `<button data-slot="vk-relation-link" data-no-nav>` whose press opens the record, the app's `RelationLink` or a host's `relationWrap` around a `<span>` holding them.
|
|
184
|
+
- `ViewsHeaderGlyphProps` — a grid header cell's type glyph, the `HeaderGlyph` atom: `columnId`, `type` (its list type, where it has one), `fieldKey` (the field it draws, where it draws one), `fallback` (ViewKit's own glyph for the column, null where it has none; the default draws it) and `className` (what ViewKit's own draws with: its size, `--vk-head-glyph`, its colour and its opacity).
|
|
185
|
+
- `ViewsHeaderSortMarkProps` — a sorted column's mark in its header, the `HeaderSortMark` atom, drawn where the grid's `sortMark` is on inside ViewKit's `aria-hidden` box: `columnId`, `dir` (`asc` or `desc`) and `className`; the default draws `icons.sortAsc` or `icons.sortDesc`.
|
|
186
|
+
- `ViewsHeaderResizeHandleProps` — what a header cell's resize handle shows, the `HeaderResizeHandle` atom, inside ViewKit's grab zone (`vk-grid-resize-handle`), which keeps the press, the drag and the double-click's reset: `columnId` and `active`, true while the column is resized; the default is a hairline in `--vk-brand`.
|
|
184
187
|
- `ViewsCellMoreProps` — the count after a cell's shown values: `count`, how many are not shown, and `inert`, true where the host owns the click (the count is plain text, and nothing opens). Drawn inside `data-slot="vk-cell-more"`, a button that opens the whole list. The default, `DefaultCellMore`, draws "+" and the number, and ViewKit keeps its own frame on that element only for it; yours draws inside a bare button (or span), so a count tag of yours stands there alone.
|
|
185
188
|
- `ViewsLoadingProps` — a wait: `placement` `body` (the whole list reloading) or `footer` (more rows arriving), and the `label` read to assistive technology. The default is a plain ring, larger in the body.
|
|
186
189
|
- `ViewsLoadMoreProps` — how a list asks for its next page once its end comes near: `onReveal`, and an optional `label` drawn while it waits. The default watches a sentinel past the last row, calls `onReveal` as it comes within 600px of the end of what it scrolls in (the grid's own scroll area, else the viewport), and draws your `Loading` (or the label) meanwhile.
|
|
@@ -94,7 +94,7 @@ A column is plain data: what a list shows in one place for every row, how it rea
|
|
|
94
94
|
- `ListRelationValue` — one relation value, already resolved by your host: the contract's `RelationValue` (`id` compared and committed but never shown, `label` shown, sorted and copied, `entity` handed back when the chip is opened, `avatarUrl`) plus an optional per-value `icon`, for a column whose rows point at different kinds. The grid never turns an id into a label itself.
|
|
95
95
|
- `ListCellAction` — a button drawn in a cell: its `id`, an `icon` for the row, and optionally a `label`, an `onClick` handed the row and the click, and a `status` slot that tints it.
|
|
96
96
|
- `ListCardZone` — where a column lands on a card: `title`, `chips`, `figures`, `footer` or `body`. The board's type defaults decide it for almost every column; `card.zone` overrides it. `body` is prose, never a default, and draws only on a card laid out roomy enough for a sentence.
|
|
97
|
-
- `ListAggregateKind` — a footer figure: `none`, `sum`, `avg`, `min`, `max`, `count`, `filled`, `unique` or `ratio`. `ratio` is sum over sum as a percent, offered only by a column that carries `ratio`.
|
|
97
|
+
- `ListAggregateKind` — a footer figure: `none`, `sum`, `avg`, `min`, `max`, `count`, `filled`, `empty`, `percentEmpty`, `percentFilled`, `unique` or `ratio`. `ratio` is sum over sum as a percent, offered only by a column that carries `ratio`.
|
|
98
98
|
|
|
99
99
|
## A column from a field binding
|
|
100
100
|
|
|
@@ -599,10 +599,12 @@ Guide: [the grid](../guides/the-grid.md).
|
|
|
599
599
|
|
|
600
600
|
A column's footer shows one figure, the pick the reader made from the ones the column offers. A list whose rows come a page at a time (a source list) has its figures counted by the database instead; `SourcedAggregates` tells these functions which ones it answered.
|
|
601
601
|
|
|
602
|
-
- `aggregateLabel` — a pick's name, through `views.grid.figure`. Messages default to `resolveViewsMessage`.
|
|
603
|
-
- `
|
|
604
|
-
- `
|
|
605
|
-
- `
|
|
602
|
+
- `aggregateLabel` — a pick's name, a row of the footer's picker ("Count empty"), through `views.grid.figure`. Messages default to `resolveViewsMessage`.
|
|
603
|
+
- `aggregateWord` — a pick's word after its value in the footer ("count", "empty"), through `views.grid.figure-word`.
|
|
604
|
+
- `AggregatePlace` — where a column stands in the footer, `{ first }`: the first (visible) column offers Count alone.
|
|
605
|
+
- `aggregateOptions` — the picks a column offers, `none` first, its place third (`AggregatePlace`). The first column offers count alone. Every other offers empty, filled, percentEmpty and percentFilled; a numeric column adds sum, average, min and max after them; a percent never sums, and offers ratio, right after none, only when the column carries its two parts. On a source list it offers what the database can answer: the four counts on a column bound to a field (a pick asks for its key) or whose figure carries `filled`, the numeric picks where it can total the column; never unique. A column that names its picks (`footerKinds`) offers only those.
|
|
606
|
+
- `resolveAggregateKind` — the pick a column's footer shows, its place fourth: the reader's, when the column offers it (a saved pick it no longer offers reads none and stays saved); else ratio for a ratio column; else the column's declared default, when offered (on a source list, a default other than count only when the database totalled it); else `none`.
|
|
607
|
+
- `computeAggregate` — a pick's figure over the rows in hand, or `null` for nothing to show. Count is the rows; empty is the rows not filled, and percentEmpty and percentFilled each as a whole percent of the rows (`null` over none); filled and unique read a place, a name and a phone by their text, a range by its two ends, a person, a related record or an actor by its key, and several values as a set; ratio is sum over sum as a whole percent, `null` on an empty denominator; the numeric picks skip blanks and are `null` over no values.
|
|
606
608
|
- `MoneyTotal` — one money figure and its currency code, `{ amount, code }`.
|
|
607
609
|
- `moneyTotal` — one figure for a money column, never one per currency. A column read in a currency totals in it; a column read in its original currencies totals each row converted into the reader's default currency. Returns `null` for a column whose rows keep their own currency with no rates to convert them, and `undefined` for a column that is not money or a pick that is not numeric (that one is `computeAggregate`'s).
|
|
608
610
|
- `moneyFigureCode` — the currency a money column's database figure is drawn in: the reader's default under the original currencies, else the column's code (`undefined` when it has no single one), `null` for a column nothing can convert.
|
|
@@ -635,7 +637,7 @@ A source list holds a page, not the list, so its footer and its group headers re
|
|
|
635
637
|
- `EMPTY_FIGURE` — the figure of no values: count 0, the rest `null`.
|
|
636
638
|
- `combineFigure` — two parts' figures as the figure of both. A `null` is a value absent, never a zero.
|
|
637
639
|
- `figureOf` — the figure of some numbers, a blank or `NaN` not counted.
|
|
638
|
-
- `figureFor` — the number a pick shows for one key, or `null`: count is the group's rows, filled the values present, sum, average, min and max `null` over no values. Unique and ratio are not the database's to answer, and give `null`.
|
|
640
|
+
- `figureFor` — the number a pick shows for one key, or `null`: count is the group's rows, filled the values present, empty the rows less `filled`, and percentEmpty and percentFilled that count over the rows, whole (none of the three from an answer that carries no `filled`), sum, average, min and max `null` over no values. Unique and ratio are not the database's to answer, and give `null`.
|
|
639
641
|
- `ratioFigure` — a ratio column's figure from its two parts' keys: sum over sum as a whole percent, `null` when either part was not totalled or the denominator is empty.
|
|
640
642
|
- `isGroupFigures` — says whether a value has the shape of `GroupFigures`.
|
|
641
643
|
|
|
@@ -80,7 +80,8 @@ typed catalog can overflow TypeScript) and read each key without its `views.` pr
|
|
|
80
80
|
`(m) => { const key = m.key.slice("views.".length); return t.has(key) ? t(key, "values" in m ? m.values : undefined) : resolveViewsMessage(m); }`.
|
|
81
81
|
|
|
82
82
|
The atoms — `List`, `Row`, `TickBox`, `StatusBadge`, `StatusMarker`, `Tag`, `CommandMenu`,
|
|
83
|
-
`RelationLink`, `RelationRoles`, `RelationChip`, `Loading`, `LoadMore`, `PlatformMark`, `RowMenu
|
|
83
|
+
`RelationLink`, `RelationRoles`, `RelationChip`, `Loading`, `LoadMore`, `PlatformMark`, `RowMenu`, and a grid header cell's
|
|
84
|
+
`HeaderGlyph`, `HeaderSortMark` and `HeaderResizeHandle` — ship as defaults drawn from your theme. Swap any of them through `atoms` so the views wear
|
|
84
85
|
your own menus and pills. `CommandMenu`, `RowMenu` and `RelationLink` are your app's own pieces — the verb menu a
|
|
85
86
|
command cell opens, the row's right-click menu, and where a relation chip goes; their defaults are the map's menu,
|
|
86
87
|
the map's menu at the pointer (its Delete asks the `confirm` port: ViewKit's alert dialog when you hand none and spread `CONTROLS`, else the browser's own confirm), and a chip that goes nowhere. `Loading` and `LoadMore` are your waits — the list reloading, and how it asks for more rows; their
|