viewkitjs 0.28.0 → 0.29.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 +107 -0
- package/MIGRATION.md +85 -4
- package/fields/dist/derived.d.ts +2 -1
- package/fields/dist/derived.js +9 -3
- package/fields/dist/entities.js +41 -3
- package/fields/dist/index.d.ts +1 -1
- package/fields/dist/index.js +1 -1
- package/fields/dist/messages.d.ts +8 -2
- package/fields/dist/messages.js +3 -0
- package/fields/dist/range.d.ts +6 -0
- package/fields/dist/range.js +8 -0
- package/fields/dist/registry.js +11 -1
- package/fields/dist/spec-changes.js +1 -0
- package/fields/dist/types.d.ts +23 -1
- package/fields/docs/guides/derived-fields.md +7 -5
- package/fields/docs/guides/field-types.md +2 -2
- package/fields/docs/guides/the-index.md +1 -1
- package/fields/docs/reference/fields.md +3 -1
- package/fields/docs/reference/types.md +3 -1
- package/fields/skills/viewkit/SKILL.md +1 -1
- package/package.json +2 -1
- package/postgres/dist/definitions/build.js +29 -5
- package/postgres/dist/definitions/label.d.ts +7 -0
- package/postgres/dist/definitions/label.js +9 -1
- package/postgres/dist/definitions/lookup.js +6 -2
- package/postgres/dist/definitions/place.d.ts +6 -3
- package/postgres/dist/definitions/rollup.js +5 -1
- package/postgres/dist/definitions/storage.d.ts +15 -0
- package/postgres/dist/definitions/storage.js +52 -1
- package/postgres/dist/definitions/stored.js +21 -0
- package/postgres/dist/phone.d.ts +13 -1
- package/postgres/dist/phone.js +23 -3
- package/postgres/dist/search-indexes.d.ts +6 -1
- package/postgres/dist/search-indexes.js +71 -25
- package/postgres/dist/search.js +3 -3
- package/postgres/docs/guides/definitions.md +22 -5
- package/postgres/docs/guides/field-map.md +5 -4
- package/postgres/docs/reference/definitions.md +3 -3
- package/postgres/docs/reference/postgres.md +1 -1
- package/views/dist/cells/cell-format.js +2 -2
- package/views/dist/cells/cell-values.js +9 -10
- package/views/dist/contract.d.ts +149 -3
- package/views/dist/contract.js +157 -1
- package/views/dist/controls/bulk-bar/bulk-bar-of.d.ts +66 -0
- package/views/dist/controls/bulk-bar/bulk-bar-of.js +22 -0
- package/views/dist/controls/bulk-bar/bulk-bar.d.ts +40 -0
- package/views/dist/controls/bulk-bar/bulk-bar.js +278 -0
- package/views/dist/controls/bulk-bar/looks.d.ts +10 -0
- package/views/dist/controls/bulk-bar/looks.js +14 -0
- package/views/dist/controls/bulk-bar/map-selection-bar.d.ts +19 -0
- package/views/dist/controls/bulk-bar/map-selection-bar.js +57 -0
- package/views/dist/controls/bulk-bar/tokens.d.ts +136 -0
- package/views/dist/controls/bulk-bar/tokens.js +36 -0
- package/views/dist/controls/bulk-bar/words.d.ts +50 -0
- package/views/dist/controls/bulk-bar/words.js +19 -0
- package/views/dist/controls/bulk-bar.css +96 -0
- package/views/dist/controls/button/button.js +3 -1
- package/views/dist/controls/button.css +5 -4
- package/views/dist/controls/checkbox/checkbox.js +3 -1
- package/views/dist/controls/checkbox.css +1 -1
- package/views/dist/controls/choice/tokens.d.ts +79 -0
- package/views/dist/controls/choice/tokens.js +22 -0
- package/views/dist/controls/choice.css +31 -0
- package/views/dist/controls/compound-editor/looks.js +1 -1
- package/views/dist/controls/controls.d.ts +10 -0
- package/views/dist/controls/controls.js +8 -0
- package/views/dist/controls/customize/customize.d.ts +125 -0
- package/views/dist/controls/customize/customize.js +243 -0
- package/views/dist/controls/customize/glide.d.ts +10 -0
- package/views/dist/controls/customize/glide.js +55 -0
- package/views/dist/controls/customize/looks.d.ts +13 -0
- package/views/dist/controls/customize/looks.js +11 -0
- package/views/dist/controls/customize/map-customize-body.d.ts +18 -0
- package/views/dist/controls/customize/map-customize-body.js +160 -0
- package/views/dist/controls/customize/rules.d.ts +23 -0
- package/views/dist/controls/customize/rules.js +19 -0
- package/views/dist/controls/customize/tokens.d.ts +40 -0
- package/views/dist/controls/customize/tokens.js +12 -0
- package/views/dist/controls/customize/words.d.ts +58 -0
- package/views/dist/controls/customize/words.js +37 -0
- package/views/dist/controls/customize.css +54 -0
- package/views/dist/controls/date-editor/looks.js +1 -1
- package/views/dist/controls/filter-editor/block.d.ts +31 -0
- package/views/dist/controls/filter-editor/block.js +27 -0
- package/views/dist/controls/filter-editor/filter-editor.d.ts +2 -0
- package/views/dist/controls/filter-editor/filter-editor.js +85 -43
- package/views/dist/controls/filter-editor/how.d.ts +1 -1
- package/views/dist/controls/filter-editor/how.js +1 -0
- package/views/dist/controls/filter-editor/map-filter-body.d.ts +16 -1
- package/views/dist/controls/filter-editor/map-filter-body.js +39 -13
- package/views/dist/controls/filter-editor/map-rules.d.ts +27 -11
- package/views/dist/controls/filter-editor/map-rules.js +73 -42
- package/views/dist/controls/filter-editor/rules.d.ts +43 -5
- package/views/dist/controls/filter-editor/rules.js +55 -2
- package/views/dist/controls/filter-editor/words.d.ts +15 -0
- package/views/dist/controls/filter-editor/words.js +6 -0
- package/views/dist/controls/filter-editor.css +18 -0
- package/views/dist/controls/index.d.ts +26 -2
- package/views/dist/controls/index.js +25 -2
- package/views/dist/controls/inline-input/looks.js +1 -1
- package/views/dist/controls/input/input.js +10 -4
- package/views/dist/controls/internal/phone.d.ts +5 -4
- package/views/dist/controls/internal/phone.js +7 -7
- package/views/dist/controls/internal/scroll.js +5 -1
- package/views/dist/controls/internal/typed-run.d.ts +2 -0
- package/views/dist/controls/internal/typed-run.js +5 -0
- package/views/dist/controls/menu/map-menu.js +2 -2
- package/views/dist/controls/number-editor/looks.js +1 -1
- package/views/dist/controls/option/option.js +3 -1
- package/views/dist/controls/option.css +1 -1
- package/views/dist/controls/pane/pane.d.ts +4 -0
- package/views/dist/controls/pane/pane.js +2 -1
- package/views/dist/controls/picker/looks.js +1 -1
- package/views/dist/controls/picker/map-picker.d.ts +6 -2
- package/views/dist/controls/picker/map-picker.js +4 -2
- package/views/dist/controls/picker/picker.d.ts +7 -0
- package/views/dist/controls/picker/picker.js +57 -8
- 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/popover/popover.js +2 -1
- package/views/dist/controls/popover.css +3 -0
- package/views/dist/controls/ports-host/map-ports-host.d.ts +7 -0
- package/views/dist/controls/ports-host/map-ports-host.js +43 -0
- package/views/dist/controls/press/tokens.d.ts +8 -0
- package/views/dist/controls/press/tokens.js +4 -0
- package/views/dist/controls/press.css +44 -0
- package/views/dist/controls/quick-filters/looks.d.ts +11 -0
- package/views/dist/controls/quick-filters/looks.js +9 -0
- package/views/dist/controls/quick-filters/map-quick-filters-body.d.ts +31 -0
- package/views/dist/controls/quick-filters/map-quick-filters-body.js +56 -0
- package/views/dist/controls/quick-filters/quick-filters.d.ts +37 -0
- package/views/dist/controls/quick-filters/quick-filters.js +89 -0
- package/views/dist/controls/quick-filters/reminder.d.ts +18 -0
- package/views/dist/controls/quick-filters/reminder.js +41 -0
- package/views/dist/controls/quick-filters/rules.d.ts +89 -0
- package/views/dist/controls/quick-filters/rules.js +52 -0
- package/views/dist/controls/quick-filters/tokens.d.ts +112 -0
- package/views/dist/controls/quick-filters/tokens.js +30 -0
- package/views/dist/controls/quick-filters/words.d.ts +25 -0
- package/views/dist/controls/quick-filters/words.js +13 -0
- package/views/dist/controls/quick-filters.css +118 -0
- package/views/dist/controls/sheet/bottom-sheet.d.ts +9 -4
- package/views/dist/controls/sheet/bottom-sheet.js +4 -4
- package/views/dist/controls/sheet/map-sheet.d.ts +4 -1
- package/views/dist/controls/sheet/map-sheet.js +19 -6
- package/views/dist/controls/sheet/sheet-parts.d.ts +10 -0
- package/views/dist/controls/sheet/sheet-parts.js +2 -0
- package/views/dist/controls/switch-row/switch-row.d.ts +15 -0
- package/views/dist/controls/switch-row/switch-row.js +9 -0
- package/views/dist/controls/switch-row/tokens.d.ts +51 -0
- package/views/dist/controls/switch-row/tokens.js +15 -0
- package/views/dist/controls/switch-row.css +39 -0
- package/views/dist/controls/switch.css +1 -1
- package/views/dist/controls/tag/tag.js +3 -1
- package/views/dist/controls/tag-field/tag-field.d.ts +20 -0
- package/views/dist/controls/tag-field/tag-field.js +19 -0
- package/views/dist/controls/tag-field/tokens.d.ts +7 -0
- package/views/dist/controls/tag-field/tokens.js +4 -0
- package/views/dist/controls/tag-field.css +13 -0
- package/views/dist/controls/text-editor/looks.js +1 -1
- package/views/dist/controls/text-editor/text-editor.js +1 -5
- package/views/dist/controls/toast/toast.d.ts +5 -1
- package/views/dist/controls/toast/toast.js +5 -3
- package/views/dist/controls/tokens.js +18 -0
- package/views/dist/controls/toolbar/keys.d.ts +3 -0
- package/views/dist/controls/toolbar/keys.js +11 -0
- package/views/dist/controls/toolbar/looks.d.ts +10 -0
- package/views/dist/controls/toolbar/looks.js +40 -0
- package/views/dist/controls/toolbar/tokens.d.ts +28 -0
- package/views/dist/controls/toolbar/tokens.js +9 -0
- package/views/dist/controls/toolbar/toolbar.d.ts +111 -0
- package/views/dist/controls/toolbar/toolbar.js +370 -0
- package/views/dist/controls/toolbar/words.d.ts +28 -0
- package/views/dist/controls/toolbar/words.js +17 -0
- package/views/dist/controls/toolbar-button/looks.d.ts +4 -0
- package/views/dist/controls/toolbar-button/looks.js +21 -0
- package/views/dist/controls/toolbar-button/tokens.d.ts +103 -0
- package/views/dist/controls/toolbar-button/tokens.js +28 -0
- package/views/dist/controls/toolbar-button/toolbar-button.d.ts +66 -0
- package/views/dist/controls/toolbar-button/toolbar-button.js +51 -0
- package/views/dist/controls/toolbar-button.css +75 -0
- package/views/dist/controls/toolbar.css +65 -0
- package/views/dist/controls/tooltip/map-tooltip.d.ts +1 -1
- package/views/dist/controls/tooltip/map-tooltip.js +2 -2
- package/views/dist/controls/tooltip/tooltip.d.ts +3 -1
- package/views/dist/controls/tooltip/tooltip.js +2 -2
- package/views/dist/controls/values-editor/looks.js +1 -1
- package/views/dist/controls/views-list/map-views-list-body.d.ts +4 -1
- package/views/dist/controls/views-list/map-views-list-body.js +128 -4
- package/views/dist/controls/views-list/rules.d.ts +26 -0
- package/views/dist/controls/views-list/rules.js +63 -0
- package/views/dist/controls/views-list/view-menu.d.ts +84 -0
- package/views/dist/controls/views-list/view-menu.js +201 -0
- package/views/dist/controls/views-list/views-list.d.ts +8 -1
- package/views/dist/controls/views-list/views-list.js +18 -3
- package/views/dist/controls/views-list/words.d.ts +54 -0
- package/views/dist/controls/views-list/words.js +10 -1
- package/views/dist/controls/views-list.css +5 -1
- package/views/dist/display/date.js +3 -3
- package/views/dist/display/format.d.ts +6 -0
- package/views/dist/display/format.js +3 -0
- package/views/dist/display/index.d.ts +1 -1
- package/views/dist/display/index.js +1 -1
- package/views/dist/display/range.d.ts +2 -1
- package/views/dist/display/range.js +4 -1
- package/views/dist/grid/chrome/GridHeader.js +2 -1
- package/views/dist/grid/chrome/GridNumberEditor.js +2 -2
- package/views/dist/grid/chrome/GridRowCells.js +2 -1
- package/views/dist/grid/chrome/GridTextEditor.js +2 -2
- package/views/dist/grid/chrome/grid-editor-layer.d.ts +5 -1
- package/views/dist/grid/chrome/grid-editor-layer.js +1 -0
- package/views/dist/grid/chrome/grid-fitted-box.d.ts +7 -1
- package/views/dist/grid/chrome/grid-fitted-box.js +4 -4
- package/views/dist/grid/core/clipboard-model.js +9 -4
- package/views/dist/grid/grid.css +240 -0
- package/views/dist/grid/looks.d.ts +5 -1
- package/views/dist/grid/looks.js +20 -12
- package/views/dist/grid-tokens.d.ts +109 -0
- package/views/dist/grid-tokens.js +29 -0
- package/views/dist/looks/index.d.ts +5 -0
- package/views/dist/looks/index.js +5 -0
- package/views/dist/looks/pieces.js +10 -0
- package/views/dist/model/column-capabilities.d.ts +2 -0
- package/views/dist/model/column-filters.d.ts +2 -1
- package/views/dist/model/column-from.js +2 -2
- package/views/dist/model/relation-filters.d.ts +2 -0
- package/views/dist/panels/index.d.ts +2 -2
- package/views/dist/panels/index.js +2 -2
- package/views/dist/panels/labels.d.ts +4 -0
- package/views/dist/panels/labels.js +8 -0
- package/views/dist/panels/model.d.ts +10 -2
- package/views/dist/panels/quick/model.d.ts +4 -0
- package/views/dist/panels/react/customize-body.d.ts +9 -4
- package/views/dist/panels/react/customize-body.js +39 -11
- package/views/dist/panels/react/customize.d.ts +8 -1
- package/views/dist/panels/react/customize.js +9 -6
- package/views/dist/panels/react/filter/FilterEditor.js +4 -4
- package/views/dist/panels/react/filter/FilterFieldList.js +10 -2
- package/views/dist/panels/react/filter/PhoneFilterEditor.js +3 -3
- package/views/dist/panels/react/filter/filter-body.js +5 -2
- package/views/dist/panels/react/panel-step.d.ts +3 -0
- package/views/dist/panels/react/panel-step.js +2 -1
- package/views/dist/panels/react/quick/QuickFiltersPanel.js +1 -0
- package/views/dist/panels/react/toolbar/ReadyToolbar.d.ts +13 -3
- package/views/dist/panels/react/toolbar/ReadyToolbar.js +10 -3
- package/views/dist/panels/react/toolbar/Toolbar.js +1 -1
- package/views/dist/panels/react/toolbar/ToolbarAsideFilter.js +2 -2
- package/views/dist/panels/react/toolbar/ToolbarBarFilter.js +13 -3
- package/views/dist/panels/react/toolbar/ToolbarFilterAdd.js +2 -1
- package/views/dist/panels/react/toolbar/ToolbarFilters.js +3 -3
- package/views/dist/panels/react/toolbar/ToolbarOptions.d.ts +12 -4
- package/views/dist/panels/react/toolbar/ToolbarOptions.js +6 -2
- package/views/dist/panels/react/view-footer.d.ts +1 -1
- package/views/dist/panels/react/views-row/ViewPicker.js +25 -4
- package/views/dist/panels/settings/filter-groups.d.ts +3 -0
- package/views/dist/panels/settings/filter-groups.js +40 -9
- package/views/dist/panels/settings/filters.d.ts +5 -0
- package/views/dist/panels/settings/filters.js +12 -6
- package/views/dist/panels/views-row/model.d.ts +10 -1
- package/views/dist/provider/ViewsProvider.js +29 -5
- package/views/dist/provider/components.d.ts +149 -8
- package/views/dist/provider/context.d.ts +6 -0
- package/views/dist/provider/ports.d.ts +18 -6
- package/views/dist/provider/ports.js +2 -1
- package/views/dist/react.d.ts +2 -2
- package/views/dist/react.js +1 -1
- package/views/dist/selection/SelectionBar.d.ts +2 -16
- package/views/dist/selection/SelectionBar.js +4 -1
- package/views/dist/selection/bar-props.d.ts +26 -0
- package/views/dist/selection/bar-props.js +1 -0
- package/views/dist/selection/index.d.ts +1 -1
- package/views/dist/selection/verbs.d.ts +32 -5
- package/views/dist/styles.css +656 -25
- package/views/dist/styles.unlayered.css +653 -22
- package/views/docs/contract.md +44 -17
- package/views/docs/controls/bulk-bar.md +41 -0
- package/views/docs/controls/choice.md +25 -0
- package/views/docs/controls/customize.md +17 -0
- package/views/docs/controls/popover.md +2 -0
- package/views/docs/controls/press.md +9 -0
- package/views/docs/controls/quick-filters.md +35 -0
- package/views/docs/controls/radio.md +1 -1
- package/views/docs/controls/switch-row.md +18 -0
- package/views/docs/controls/tag-field.md +7 -0
- package/views/docs/controls/toolbar-button.md +31 -0
- package/views/docs/controls/toolbar.md +14 -0
- package/views/docs/guides/atoms.md +2 -2
- package/views/docs/guides/cells.md +2 -2
- package/views/docs/guides/display.md +2 -2
- package/views/docs/guides/looks.md +8 -2
- package/views/docs/guides/ports.md +6 -6
- package/views/docs/guides/selection.md +5 -1
- package/views/docs/guides/the-grid.md +1 -1
- package/views/docs/guides/the-provider.md +2 -2
- package/views/docs/install.md +4 -1
- package/views/docs/reference/cells.md +1 -1
- package/views/docs/reference/controls.md +194 -13
- package/views/docs/reference/display.md +1 -0
- package/views/docs/reference/looks.md +25 -11
- package/views/docs/reference/panels-react.md +7 -7
- package/views/docs/reference/panels.md +8 -6
- package/views/docs/reference/react.md +13 -6
- package/views/docs/reference/selection.md +4 -2
- package/views/docs/reference/views.md +7 -6
- package/views/skills/views/SKILL.md +2 -2
|
@@ -34,7 +34,7 @@ The row of views over a list, and any row of pills: each pill is your `Pill` ato
|
|
|
34
34
|
- `ViewTabs` — one axis as plain pills on a scroll rail.
|
|
35
35
|
- `toPillOptions` — views turned into pill options: the label and count joined by `views.panels.view-count`, a slot's colours, the glyph by your `AppIcon`.
|
|
36
36
|
- `FoldingViewRow` — the saved-views row that folds what doesn't fit into a "+N" chip, never folding the active view, and closes with the + when the axis grows. Handed `folded`, as a folding toolbar line hands it, it folds that many tabs and measures nothing of its own.
|
|
37
|
-
- `ViewPicker` — the same axis as one chip naming the active view, its views in a list: shared, then personal, a search past five, and "New view…" last. The list opens in your `Popover` at the chip; on a phone (in a `Toolbar`, its phone form; elsewhere your provider's `desktopQuery`) in your `Sheet` (`snap: "auto"`, titled `views.panels.views-list`), its search not taking the focus. Handed a `ViewsListBody` in your components map, the chip opens it in place of its own list, in the same `Popover` and `Sheet`: it is handed the views as data, a pick or an order is written once it fits the axis, its `onDone` closes the list, and on a phone it gets the ✕ as its `actions` only where your sheet's head doesn't draw it ([the components map](../contract.md#the-components-map)).
|
|
37
|
+
- `ViewPicker` — the same axis as one chip naming the active view, its views in a list: shared, then personal, a search past five, and "New view…" last. The list opens in your `Popover` at the chip; on a phone (in a `Toolbar`, its phone form; elsewhere your provider's `desktopQuery`) in your `Sheet` (`snap: "auto"`, titled `views.panels.views-list`), its search not taking the focus. Handed a `ViewsListBody` in your components map, the chip opens it in place of its own list, in the same `Popover` and `Sheet`: it is handed the views as data, a pick or an order is written once it fits the axis, its `onDone` closes the list, and on a phone it gets the ✕ (and Back on a step) as its `actions` only where your sheet's head doesn't draw it, and `onStepChange`, whose step's title and Back the sheet shows; the axis's `verbs`, where it hands them, reach it as they are ([the components map](../contract.md#the-components-map)).
|
|
38
38
|
- `ViewPickerRow` — one view as a row of a list, with the active view's `⋮`.
|
|
39
39
|
- `ViewCreatePill` — the + that creates a view.
|
|
40
40
|
- `ViewAxes` — an axis or several on one row: one axis at the row's size folds, peer axes share one rail, each in its own track. `folded` is handed on to the one axis's `FoldingViewRow`.
|
|
@@ -61,9 +61,9 @@ A panel's list keeps `--vk-panel-padding` from its edge ([Tokens](../contract.md
|
|
|
61
61
|
|
|
62
62
|
The panel a list's Options button opens, put together from the panels above: one header frame (a back arrow only when deep, the title, Clear all at the root without a shared view, a ✕ when the host can close it) over the root list or the page a row opened, and, at the root of a shared view, its footer. Its root is a `data-vs-detail` list, its header `data-vs-header`, its footer `data-vs-footer` with `data-vs-inset` and each actions row a `data-vs-row`, so a drawer of your own insets them through those; the root's rows carry `data-vs-row` when your `MenuRow` and `ToggleRow` atoms do. Your app hosts it: in a popover, or in a full-height drawer with `fill`.
|
|
63
63
|
|
|
64
|
-
- `ViewOptionsPanelContent` — the panel. Takes the list's `filters`, `sort`, `group`, `timeScopeConfig`, `dateRangeConfigs`, `toggles` and `layout` (`ViewOptionInputs`; its `sorts` and `filterTree` reach a `CustomizeBody` as its sort and filter), `activePanel` and `onOpenPanel`, `anyActive` and `clearAll`, and optionally `view` (`CollectionViewState`), `foldFilters` (one Filter row, on by default; off, every filter is a root row), `onClose`, `closeButton` (whether its header draws the ✕, default true; false in a sheet whose head draws it, `onClose` still closing it from inside, as a column's Done does), `fill
|
|
64
|
+
- `ViewOptionsPanelContent` — the panel. Takes the list's `filters`, `sort`, `group`, `timeScopeConfig`, `dateRangeConfigs`, `toggles` and `layout` (`ViewOptionInputs`; its `sorts` and `filterTree` reach a `CustomizeBody` as its sort and filter), `activePanel` and `onOpenPanel`, `anyActive` and `clearAll`, and optionally `view` (`CollectionViewState`), `foldFilters` (one Filter row, on by default; off, every filter is a root row), `onClose`, `closeButton` (whether its header draws the ✕, default true; false in a sheet whose head draws it, `onClose` still closing it from inside, as a column's Done does), `fill`, `fieldEditor` (`PanelFieldEditor`), and `viewName`, `onRenameView`, `onCopyLink`, `onExport` and `exportCount`, handed on to a `CustomizeBody` as `ToolbarOptions` hands them. Back walks one level: a relation's Where field to its filter, a folded filter to the Filter list, a column to the Columns list, Group's own Group by, Sort and Date by pages to Group (with an app's `GroupBody`, a level it tells goes back to its settings first, its name in the head), anything else to the root. Handed a `GroupBody` in your components map, Group (and its own pages) draws it, handed the group as data; handed a `CustomizeBody`, the whole panel is it, handed the view's settings as data, wherever the panel hangs, except for a list whose filter is only per-field values, with no `filterTree`, which keeps the panel ([the components map](../contract.md#the-components-map)).
|
|
65
65
|
- `PopoverRootList` — the root: Layout, Columns (`views.panels.columns-shown`), Filter (or each filter, unfolded), Sort, Group and the toggles, each opening its page through `onOpenPanel`.
|
|
66
|
-
- `ViewFooter` — Reset ·
|
|
66
|
+
- `ViewFooter` — Reset · Save for everyone on a shared view this person has drifted from; a member sees Reset alone, and nothing draws while `changes` is 0. `words: "kit"` says Clear and Save instead. With no `view` and an `onClear`, Clear alone, which takes the list back to its default. `className` replaces its side inset. `ToolbarOptions` and `ViewOptionsPanelContent` take `viewFoot` (`"kit"` for those words, `"none"` for no foot) and `footClear` (the foot's Clear with no shared view).
|
|
67
67
|
- `ViewOptionsActions` — the actions row: Copy link and Share parked, Export CSV live when `exportCsv` (`CollectionExportCsv`) is handed in, its count on the row and one export at a time behind the `loading` glyph, which your app draws turning.
|
|
68
68
|
- `ViewOptionsPopoverPanel` — the panel for a popover: `ViewOptionsPanelContent` with `setActivePanel` for `onOpenPanel`, its `sorts` and `filterTree` handed on; a `CustomizeBody` in your map opens in its place.
|
|
69
69
|
- `useViewOptionsPopover` — the state the trigger and the popover share (`ViewOptionsPopoverState`): `open`, the page it is on, the trigger's `badge` (the drift from everyone's view on a shared view, else the active options) and its `clearAll` (Reset, else clear them), and `handleOpenChange`, which forgets the page on a close. The trigger's own look is yours.
|
|
@@ -76,7 +76,7 @@ The panel a list's Options button opens, put together from the panels above: one
|
|
|
76
76
|
|
|
77
77
|
The frame that holds a list's controls, and the parts that need no list settings. `Toolbar` takes the parts your app hands it, each placed at the start or the end, on the first line or the second, and draws them in one of three forms (`/panels`' [arrangement](panels.md#the-toolbars-arrangement)): `row`, `narrow` (its own box under 700px) or `phone` (your provider's `desktopQuery` says it is not a desktop). Pass `phone` or `narrow` to decide either yourself. A part is any node: the frame tells it where it stands through `useToolbarSlot`, and its buttons draw through the `ToolbarButton` atom at their line's size. A part that opens something (a menu, a panel, a pane your app holds) registers it with `useToolbarPanel`, and opening one closes every other, however it opened. A change of form draws the parts afresh, so keep what must last across it (a search's text, a panel's open state) in your app: a panel part left to hold its own state closes when the box crosses 700px, and one handed its state from `useToolbarPanelState`, held above the `Toolbar`, stays open on its page. The row's end controls float over the views on a fade of `--vk-ground` (`data-toolbar-cluster`), which the folding views row measures. Its look is plain; its pieces carry the `data-slot`s the [contract](../contract.md) lists.
|
|
78
78
|
|
|
79
|
-
- `Toolbar` — the frame. Takes `parts` (`ToolbarPart[]`), and optionally `phone`, `narrow`, `narrowBelow` (700 by default), `fold` and `className`. With `fold` it draws the kit's arrangement (`/panels`' fold arrangement): the row and the filter bar under it, each a band with a line across under it, or a phone's one line, with no narrow form; each line measures itself and gives way as it narrows, a part's words turning to its icon (the `ToolbarButton` atom's `iconAlone`), the views folding tabs into "+N", a part's filters folding into "+N filters", then what may fold going behind ⋯ (`data-slot="vk-toolbar-overflow"`, your `Menu`, each row the folded part's `menu`). A folded part keeps its state, and what it opens hangs under ⋯; while ⋯'s menu, a folded part's panel, the views' "+N" list, a filter with a part open (`data-slot="vk-toolbar-filter-rule"` marked `data-open`), an open advanced filter (`data-slot="vk-toolbar-advanced-filter"` marked `data-open`) or "+N filters"' menu (the button in `data-slot="vk-toolbar-more-filters"`, `aria-expanded`) is open, the line holds still. The frame holds the search's open state: open, the line gives way around it, and on a phone the search takes the line beside the views.
|
|
79
|
+
- `Toolbar` — the frame. Takes `parts` (`ToolbarPart[]`), and optionally `phone`, `narrow`, `narrowBelow` (700 by default), `fold` and `className`. With `fold` it draws the kit's arrangement (`/panels`' fold arrangement): the row and the filter bar under it, each a band with a line across under it, or a phone's one line, with no narrow form; each line measures itself and gives way as it narrows (it contains its own inline size, so its width comes from where it stands and never from what its lines hold: in a holder sized from its content, a main beside a sidebar, it still gives way, with no wrapper of yours), a part's words turning to its icon (the `ToolbarButton` atom's `iconAlone`), the views folding tabs into "+N", a part's filters folding into "+N filters", then what may fold going behind ⋯ (`data-slot="vk-toolbar-overflow"`, your `Menu`, each row the folded part's `menu`). A folded part keeps its state, and what it opens hangs under ⋯; while ⋯'s menu, a folded part's panel, the views' "+N" list, a filter with a part open (`data-slot="vk-toolbar-filter-rule"` marked `data-open`), an open advanced filter (`data-slot="vk-toolbar-advanced-filter"` marked `data-open`) or "+N filters"' menu (the button in `data-slot="vk-toolbar-more-filters"`, `aria-expanded`) is open, the line holds still. The frame holds the search's open state: open, the line gives way around it, and on a phone the search takes the line beside the views.
|
|
80
80
|
- `ToolbarPart` — a part as your app hands it: a `ToolbarPlacement` (its `key`, `side`, `line`, `role`, and in the fold arrangement `shed`, `tabs`, `filters` and `fold`), its `node`, and for a part that may fold its `menu`: `{ label, icon?, onSelect }`, its row in ⋯.
|
|
81
81
|
- `ToolbarSeparator` — the line between the sort and the filters on a filter bar (or Filter while there is none), placed with `role: "separator"`: drawn only while a part stands drawn on each side of it, and never on a phone's line.
|
|
82
82
|
- `ToolbarViews` — the views row: `views` (`CollectionViewsInput`) and `viewsLayout`. On the row and in the narrow panel it draws `ViewAxes`, or with `as="picker"` and one axis alone its `ViewPicker`; placed again with `stacked` on the second line, it draws the axes a stacked layout pushes beneath, small. On the phone it draws a `ViewPicker` per axis, every axis, and nothing for `stacked`. With `showCounts` the toolbar owns Show counts (`withCounts`). Place it only when the list has views: the phone's search fills the row when nothing is placed at the start.
|
|
@@ -142,7 +142,7 @@ export function ListToolbar({
|
|
|
142
142
|
|
|
143
143
|
Options, Sort and Filter each open their panel from their own button, and each takes the builder's panels ([`settingsPanels`](panels.md#built-from-a-lists-settings)): an app that arranges its own parts calls the builder and hands them in. A panel hangs in your `Popover` at its button (`chrome="menu"`, aligned to its end), or in a host you hand in, your side drawer or your sheet, where it draws full height. On a phone (in a `Toolbar`, its phone form; elsewhere your provider's `desktopQuery`) it opens in your `Sheet` instead (`snap: "full"`, named `label` with the part's name, its own header titling it), full height, with every page the popover has; a host you hand still takes it. With your provider's `sheetActions: "head"`, the sheet's head draws the panel's ✕ (`actions.close`, no `done`, unless the panel hands its own ✕ and ✓, as the sort pill's editor does) and the panel draws none. Each is one of the toolbar's panels, so opening one closes the others. Hand `open` and `onOpenChange` (and `page` and `onPageChange` where it drills in) to hold its state yourself; without, it holds its own, forgetting its page when it closes.
|
|
144
144
|
|
|
145
|
-
- `ToolbarOptions` — Customize behind its own button, named and worded `views.panels.toolbar-options`: the builder's `filters`, `sort`, `group` and `layout` (and its `filterTree`, with and/or groups: its count and default Clear then read the advanced filters), your `toggles`, `timeScopeConfig` and `dateRangeConfigs` (a `ViewOptionInputs`), and optionally `view` (a shared view: the drift dot on the button instead of a count, and the panel's footer), `fieldEditor`, `foldFilters` (true by default), `onClear` (the ✕ and the panel's Clear all; by default each active option cleared through its own `onChange`, the builder's filter rows adding up so every filter clears, or Reset on a shared view; for one change, `settingsCleared(…, "options")`), `widthClassName`
|
|
145
|
+
- `ToolbarOptions` — Customize behind its own button, named and worded `views.panels.toolbar-options`: the builder's `filters`, `sort`, `group` and `layout` (and its `filterTree`, with and/or groups: its count and default Clear then read the advanced filters), your `toggles`, `timeScopeConfig` and `dateRangeConfigs` (a `ViewOptionInputs`), and optionally `view` (a shared view: the drift dot on the button instead of a count, and the panel's footer), `fieldEditor`, `foldFilters` (true by default), `onClear` (the ✕ and the panel's Clear all; by default each active option cleared through its own `onChange`, the builder's filter rows adding up so every filter clears, or Reset on a shared view; for one change, `settingsCleared(…, "options")`), `widthClassName` (`w-75` by default: 300 px, the Pane Customize was designed in), `host`, and what your `CustomizeBody` draws only where you hand it: `viewName` with `onRenameView` (the view's name, renamed in place), `onCopyLink`, and `onExport` with `exportCount` (what it takes, in words). On a phone, while your body stands on a level of its own inside a section (`onStepChange`), the sheet's Escape goes back a level instead of closing. Its button counts the active options (`countActiveViewOptions`) with a ✕ that clears them. Draws nothing when there is nothing to customize. A `CustomizeBody` in your components map opens in place of the panel, in the same popover, `host` or phone `Sheet`.
|
|
146
146
|
- `ToolbarSort` — the sort panel behind its own button, named `views.panels.sort`: the builder's `sort`, lit (`changed`) while the list sorts other than its default. Draws nothing when nothing sorts. Handed the builder's `sorts` too (with `severalSorts`), it is Sort on the row's right as the kit draws it there: "Sort", counted once there are two rules, opening the fields (`SortFieldList`), a pick adding a rule at the end, ascending; at three it can't be used, saying why (`views.panels.sort-max`).
|
|
147
147
|
- `ToolbarSortPill` — the sort as up to 3 rules, the kit's sort on its filter bar, in `data-slot="vk-toolbar-sort-pill"`: takes the builder's `sorts`, and optionally `open` and `onOpenChange` (to hold its state yourself), `host` and `addAfter` (default true). On a computer, "Sorted by" its first rule's field, in weight, with the rest counted (+1), opening the sort editor in your `Popover`; after it a + (`data-slot="vk-toolbar-sort-add"`, named `views.panels.sort-add-one`) while there are fewer than three, opening the fields, a pick adding a rule; with no rule, an empty place, "Sort", opening the fields. Handed `addAfter={false}` (the kit's bar), it draws no +, and its editor, or your `SortBody` (handed `addSort`), has Add sort at its foot. Handed `row`, it is Sort on a toolbar row (`data-slot="vk-toolbar-sort-row"`, as `ReadyToolbar`'s default stands it): its word "Sort", lit while a rule stands and counted from two; however it opens (a press, or ⋯ when it folded) it shows the sort editor, Add sort at its foot, while a rule or a set-aside sort stands, else the fields; it draws no + and `addAfter` means nothing to it. The fields are your `FieldsBody` where you hand one. × on the editor's last rule closes it. On a phone, "Sort" with its rules counted, opening the sort editor in your `Sheet`, its ✕ taking back what changed since it opened and its ✓ keeping it; a swipe, the dim or Escape close it and keep the changes; while your `SortBody` stands on a step of its own (`onStepChange`), Escape goes back a step instead, and under `sheetActions: "head"` your sheet's head shows the step's title. Its popovers, or its sheet, are one of the toolbar's panels.
|
|
148
148
|
- `SortEditor` — the sort editor's body alone, for a holder of your own (a popover): `sorts`, `form` (`"computer"` or `"phone"`), and optionally `open`, `onDone` and `addSort`. On a computer each rule (`data-slot="vk-sort-rule"`) is its grip, its field, its direction (Ascending, Descending, your `Menu`) and ×, inside `data-slot="vk-sort-editor"`, with no Add sort unless handed `addSort`: then Add sort (`data-slot="vk-sort-add"`) stands at its foot, after the set-aside sorts, opening the fields in your `Popover`, a pick adding a rule at the end, ascending, and at three, a set-aside sort holding one of the places, it can't be used and says why (`views.panels.sort-max`); on a phone each rule is a row, its direction under its field, a press opening its directions and ⋯ holding Delete, then Add sort (which turns the body to the fields, never a sheet on top; three at most) and Clear all, and "No sorting set up yet" with none. Every change goes out through `sorts.onChange` as it is made. A rule moves by its grip: dragged by the mouse after 8 px or a long press of 250 ms (a phone's row moves by itself), or ↑ and ↓ on its grip, the focus staying on that grip; the grip carries `data-base-ui-swipe-ignore`.
|
|
@@ -153,7 +153,7 @@ Options, Sort and Filter each open their panel from their own button, and each t
|
|
|
153
153
|
- `QuickFiltersReminder` — on a phone, the reminder that a hold stands while the quick filters are closed: takes `quickFilters` (the same `QuickFiltersConfig`), `onOpen` (a press on its names: open the quick filters, whose open state you hold through `ToolbarQuickFilters`' `open`, or `ReadyToolbar`'s `quickFiltersOpen`) and optionally `hidden` (it steps aside: hand whether rows are selected or the quick filters are open, so it never stands with your selection bar or over the open quick filters), and `holder` (a ref to your list's box: leaving with the focus in it, by its ✕ or by stepping aside as the quick filters open, it hands the focus there, giving a box that takes no focus `tabindex="-1"`, so the focus never falls to the page and a sheet opened from its names hands it back into the box; with none, the focus goes where the browser drops it; it never searches the page for one). Place it once at your list's foot. It is portalled to the body where the selection bar's phone pill stands (the provider's `selectionBar.phone`: its `bottom`, `zIndex` and `className`), a pill (`data-slot="vk-quick-filters-reminder"`) holding the held values' names, each by its words and never its key (`quickHeldNames`), the first two and "+N" for the rest (`quickReminderWords`, `views.panels.quick-more`), a press on them (`data-slot="vk-quick-filters-reminder-open"`, named `views.panels.quick-reminder` with every name once) calling `onOpen`; then ✕ (`data-slot="vk-quick-filters-reminder-clear"`, `views.panels.quick-clear`), letting every hold go. It draws nothing on a computer, while nothing is held, or while `hidden`. An app that wears its own reminder places that one instead, fed by `quickHeldNames`.
|
|
154
154
|
- `SortFieldList` — the fields a rule is picked from (`data-slot="vk-sort-fields"`): `sorts`, `onPick`, and optionally `own` (a rule whose field it changes, ticked), `onDone` (done with no pick) and `form`. A field already sorted, but `own`, is greyed and says "Sorted"; a search past eight. Handed a `FieldsBody` in your components map, it opens that in place of its rows, in every holder, handed the options as data, each marked as the grid's header marks its column, a sorted one `disabled` with why; a pick of a key it didn't offer, or offered disabled, writes nothing ([the components map](../contract.md#the-components-map)).
|
|
155
155
|
- `ToolbarAdvancedFilters` — the advanced filters' pills, with and/or groups (`data-slot="vk-toolbar-advanced-filter"`): takes the builder's `filterTree`, and optionally `host`. One pill for each advanced filter (each group at the filter's top, or the whole of a top joined by Or), "Advanced filter" with its rules counted (one whose rules are all set aside drawn set aside instead, the button's `aside` with no count, naming why in your `Tooltip`: `views.panels.advanced-filter-set-aside`), its words kept however tight the row, opening the filter editor on its own rules in your `Popover` (`data-slot="vk-toolbar-advanced-filter-panel"`) or in `host`. A pill whose filter empties leaves the row; the others keep their own state. Each is one of the toolbar's panels; in a folding line its place carries `data-open` while it is open, so the line holds still. On a phone it draws nothing.
|
|
156
|
-
- `ToolbarFilters` — each filter on a filter bar, as the kit's draws them (`data-slot="vk-toolbar-filters"`): takes the builder's `filterTree` (with `filterGroups`), and optionally `open` and `onOpenChange` (whether Filter and + list the fields: hold it to open them from ⋯), `held` and `onHeldChange` (the rule held until whole: hold it to count it as the bar folds) and `host`. Every filter at the view's own level, in its order: a filter as four joined parts (`data-slot="vk-toolbar-filter-rule"`, named by its sentence), its field, how it compares in lower case, its value (capped at 240 and cut with "…", saying what it waits for until it is picked) and ⋯ (Convert to advanced filter, Delete filter), each opening its own list; a related record's field drawn as one ("Company › Industry"); an advanced filter as its pill (`ToolbarAdvancedFilters`'); then + (`data-slot="vk-toolbar-filter-add"`, `views.panels.filter-add-one`). Filter, + and a filter's field open your `FieldsBody` where you hand one, its way and value your `FilterPartBody` ([the components map](../contract.md#the-components-map)). While nothing filters and nothing is held, Filter, an empty place (`data-slot="vk-toolbar-filter"`); handed `emptyPlace={false}`, where Filter stands on the row (`ToolbarFilterAdd`), nothing at all until a filter is set or held. Filter and + open the fields; a pick adds a filter at the end (`addOnBar`, wrapping a top joined by Or into one advanced filter first), a related record's field among them, waiting for its value, or, for a yes/no, the list's own or a related record's, holds it on the bar saying what it waits for, writing nothing until its value is picked; where nothing more can be added they are disabled with why (`barAddRefusal`). In a folding line its last filters fold into "+N filters" (`data-slot="vk-toolbar-more-filters"`, as its slot's `filtersFolded` says), which names each and opens what a pick opens under itself; a held rule, the filter it stands in place of and a filter with a part open never fold. Each filter and "+N filters"' menu is one of the toolbar's panels. Delete filter and Convert move the focus to what stands after the filter: the next filter, "+N filters", + or Filter, or, where Filter stands on the row's right and nothing is left on the bar, that Filter (`ToolbarFilterAdd`). An app placing it in a `Toolbar` of its own places it with `filters: foldableFilters(…)` and never with `shed` while a filter stands: its parts read the slot's `iconAlone`, and would draw no words. A held rule is compared with the tree as written, so your `filterTree.onChange` must hand the tree back unchanged (the same keys in the same order), or the held rule counts as dropped by a write from elsewhere. On a phone it draws nothing.
|
|
156
|
+
- `ToolbarFilters` — each filter on a filter bar, as the kit's draws them (`data-slot="vk-toolbar-filters"`): takes the builder's `filterTree` (with `filterGroups`), and optionally `open` and `onOpenChange` (whether Filter and + list the fields: hold it to open them from ⋯), `held` and `onHeldChange` (the rule held until whole: hold it to count it as the bar folds) and `host`. Every filter at the view's own level, in its order: a filter as four joined parts (`data-slot="vk-toolbar-filter-rule"`, named by its sentence), its field, how it compares in lower case, its value (capped at 240 and cut with "…", saying what it waits for until it is picked) and ⋯ (Convert to advanced filter, Delete filter), each opening its own list; a related record's field drawn as one ("Company › Industry"); an advanced filter as its pill (`ToolbarAdvancedFilters`'); then + (`data-slot="vk-toolbar-filter-add"`, `views.panels.filter-add-one`). Filter, + and a filter's field open your `FieldsBody` where you hand one, its way and value your `FilterPartBody` ([the components map](../contract.md#the-components-map)); their lists show a column the list can't filter greyed with its reason, in its place, never picked (`filterTree.listed`). A filter whose one value is a key your app hasn't named (a person after a reload) asks that field's `onValuesWanted` once (a related record's field, `farValues.onWanted`), and draws the name once you hand the value in `knownValues` and its name in `knownLabels`. While nothing filters and nothing is held, Filter, an empty place (`data-slot="vk-toolbar-filter"`); handed `emptyPlace={false}`, where Filter stands on the row (`ToolbarFilterAdd`), nothing at all until a filter is set or held. Filter and + open the fields; a pick adds a filter at the end (`addOnBar`, wrapping a top joined by Or into one advanced filter first), a related record's field among them, waiting for its value, or, for a yes/no, the list's own or a related record's, holds it on the bar saying what it waits for, writing nothing until its value is picked; where nothing more can be added they are disabled with why (`barAddRefusal`). In a folding line its last filters fold into "+N filters" (`data-slot="vk-toolbar-more-filters"`, as its slot's `filtersFolded` says), which names each and opens what a pick opens under itself; a held rule, the filter it stands in place of and a filter with a part open never fold. Each filter and "+N filters"' menu is one of the toolbar's panels. Delete filter and Convert move the focus to what stands after the filter: the next filter, "+N filters", + or Filter, or, where Filter stands on the row's right and nothing is left on the bar, that Filter (`ToolbarFilterAdd`). An app placing it in a `Toolbar` of its own places it with `filters: foldableFilters(…)` and never with `shed` while a filter stands: its parts read the slot's `iconAlone`, and would draw no words. A held rule is compared with the tree as written, so your `filterTree.onChange` must hand the tree back unchanged (the same keys in the same order), or the held rule counts as dropped by a write from elsewhere. On a phone it draws nothing.
|
|
157
157
|
- `foldableFilters` — how many of the bar's filters may fold, for its placement's `filters`: `(tree, held)`, the tree's top-level items less the one a held rule stands in place of; a held rule no longer standing (`held`'s tree changed by a write from elsewhere) counts as gone.
|
|
158
158
|
- `ToolbarFilterAdd` — Filter on a toolbar row's right (`data-slot="vk-toolbar-filter-add-row"`, named `views.panels.filter`), as `ReadyToolbar` stands it by default: takes the builder's `filterTree`, and optionally `onHeldChange` (hand the toolbar's held rule's writer, the one you hand `ToolbarFilters`, so a yes/no it holds stands on the bar), `open` and `onOpenChange`, and `host`. It opens the fields as Filter on the bar does (your `FieldsBody` where you hand one), and a pick adds a filter at the bar's end and opens nothing else, or holds a yes/no until its value is picked, which `ToolbarFilters` takes in as its own; where nothing more can be added it is disabled with why. It is one of the toolbar's panels. On a phone, or with no fields, it draws nothing.
|
|
159
159
|
- `Pending` — the rule held until whole, as `ToolbarFilters` hands it to `onHeldChange`: its `container`, its `node`, the filter it `replaces`, and what it was held `over`.
|
|
@@ -168,6 +168,6 @@ Options, Sort and Filter each open their panel from their own button, and each t
|
|
|
168
168
|
- `ToolbarPanelState` — what `useToolbarPanelState` returns.
|
|
169
169
|
- `FilterPanelContent` — the Filter panel standing alone, for a host of your own: the filter list at its root (titled `views.panels.filter`, no back arrow) and the pages it opens, with `filters`, `timeScopeConfig`, `dateRangeConfigs`, `page`, `onPageChange`, `onClose` and `fill`.
|
|
170
170
|
- `ToolbarSave` — Clear and Save, at the end of a filter bar while the list differs (`data-slot="vk-toolbar-save"`): takes `view` (a `CollectionViewState`: Clear is its `onReset`, Save its `onPublish`, shown only where `canPublish`, both waiting while `pending`, nothing while `changes` is 0), or with no shared view `onClear`, Clear alone taking the list back to its default; nothing when neither has anything to do. Clear has no ground and Save wears the field's look, ViewKit's own buttons or your `Button` with `panelButtons` at `button`.
|
|
171
|
-
- `ReadyToolbar` — the toolbar for an app that doesn't arrange its own (`ReadyToolbarProps`): the builder's input (`settings`, `layer`, `columns`, `onChange`, `onLayerChange` and the rest of `SettingsPanelsInput`), and optionally `views`, `viewsLayout`, `onAdd` or `addItems` and `addLabel`, `view`, `toggles`, `fieldEditor`, `searchPlaceholder`, `searching` (handed to its search), `hosts` (`{ options, sort, filter, quick }`), `quickFilters` (a `QuickFiltersConfig`: handed, the quick filters' button stands on the row's end before the search, in the row arrangement before Options, folding into ⋯ as the row narrows; its counts follow the toolbar's Show counts unless the config carries its own `showCounts`), `quickFiltersOpen` with `onQuickFiltersOpenChange` (the quick filters' panel open, held by you, so a `QuickFiltersReminder` at your list's foot can open it; absent, the toolbar holds it), `phone`, `narrow`, `severalSorts` (true by default: the sort holds up to 3 rules, the row's Sort opening the sort editor on them, or in the old form the sort pill on the bar; `false` keeps Sort's one rule, which opens its own list whether or not a sort stands), `addAfter` (true by default: the + after the sort pill; `false` draws none, and the pill's editor, or your `SortBody`, has Add sort at its foot, as `ToolbarSortPill`'s), `filterGroups` (true by default: and/or groups, each filter on the filter bar on a computer, in the row arrangement each advanced filter's pill after Filter and Convert to advanced filter on a filter's page, and on a phone Filter opening the filter editor on every rule; `false` keeps Filter, counting what is applied, in either arrangement), `arrangement` (`"kit"` by default, or `"row"`), `sortFilter` (`"right"` by default, or `"bar"`), `bar` (`"added"` by default, or `"always"`: with Sort and Filter on the row's right, the bar then always shows, its empty Sort and Filter included) and `className`. It calls the builder and draws its parts in the kit's arrangement (`Toolbar`'s `fold`). By default, on a computer, one row at rest: the views with Customize beside them, then on its right Sort and Filter with their words, the quick filters' button and the search, each its icon alone, and New. Sort holds the sort (`ToolbarSortPill`'s `row`): lit while one stands (a view's saved sort included), counted from two, it opens the sort editor to change or remove the rules, Add sort at its foot; with none, the fields. Filter (`ToolbarFilterAdd`) adds a filter to the bar. Under the row the filter bar, a step smaller, is the filters' line: it comes only while a filter stands or is held (or one of its parts is open, or a second axis of views stands there), holding the filters (each as below, + after the last, no empty Filter) and Clear and Save at its end. While it doesn't stand, an unsaved change (a sort, a removed last filter) waits in Customize's foot, Clear and Save (on a shared view Customize also carries its dot), as on a phone. Each of the row's Sort and Filter is a panel of its own, apart from the bar's, so a press opens one list. `sortFilter: "bar"` with `bar: "always"` draws the kit arrangement's old form: the row, the views with Customize beside them and the search and New at its end, and under it the filter bar, always shown, a step smaller: the sort pill first, a separator, the filters (`ToolbarFilters`: each filter as its four joined parts, each advanced filter's pill, + after the last; while there is none, Filter, an empty place; the rule held until whole is held by the toolbar, so the bar counts it as it folds; with `filterGroups` false, Filter as before, with what is applied counted), and at its end Clear and Save (`ToolbarSave`) while the list differs: on a shared view (`view`) Clear takes it back and Save, where `canPublish`, keeps it for everyone; with no shared view, Clear alone takes the list back to its default (nothing filtered, the default sort, no group: so a list that starts grouped or filtered shows Clear at once); Customize's foot then draws neither. A row with no room folds as the kit's does (words to icons, the view tabs into "+N", the bar's last filters into "+N filters", then into ⋯: by default Customize and the row's Sort and Filter, whatever is set; in the old form Customize, and the sort and Filter while no filter stands), with no narrow form. On a phone one line in either form (the views, the sort, Filter, the quick filters' button when handed, Customize, then the search, which opens across the line), Clear and Save in Customize's foot (`views.panels.view-clear`, `views.panels.view-save`; with no shared view, Clear alone), and New a round + at the list's foot, lifted by `--vk-toolbar-foot`. `arrangement: "row"` draws the order of 12 Nov instead: the views on the left; search, sort, filter, options and new on the right, the narrow form under 700px, and Reset and
|
|
171
|
+
- `ReadyToolbar` — the toolbar for an app that doesn't arrange its own (`ReadyToolbarProps`): the builder's input (`settings`, `layer`, `columns`, `onChange`, `onLayerChange` and the rest of `SettingsPanelsInput`), and optionally `views`, `viewsLayout`, `onAdd` or `addItems` and `addLabel`, `view`, `toggles`, `fieldEditor`, `searchPlaceholder`, `searching` (handed to its search), `hosts` (`{ options, sort, filter, quick }`), `quickFilters` (a `QuickFiltersConfig`: handed, the quick filters' button stands on the row's end before the search, in the row arrangement before Options, folding into ⋯ as the row narrows; its counts follow the toolbar's Show counts unless the config carries its own `showCounts`), `quickFiltersOpen` with `onQuickFiltersOpenChange` (the quick filters' panel open, held by you, so a `QuickFiltersReminder` at your list's foot can open it; absent, the toolbar holds it), `phone`, `narrow`, `severalSorts` (true by default: the sort holds up to 3 rules, the row's Sort opening the sort editor on them, or in the old form the sort pill on the bar; `false` keeps Sort's one rule, which opens its own list whether or not a sort stands), `addAfter` (true by default: the + after the sort pill; `false` draws none, and the pill's editor, or your `SortBody`, has Add sort at its foot, as `ToolbarSortPill`'s), `filterGroups` (true by default: and/or groups, each filter on the filter bar on a computer, in the row arrangement each advanced filter's pill after Filter and Convert to advanced filter on a filter's page, and on a phone Filter opening the filter editor on every rule; `false` keeps Filter, counting what is applied, in either arrangement), `arrangement` (`"kit"` by default, or `"row"`), `sortFilter` (`"right"` by default, or `"bar"`), `bar` (`"added"` by default, or `"always"`: with Sort and Filter on the row's right, the bar then always shows, its empty Sort and Filter included), `viewName`, `onRenameView`, `onCopyLink`, `onExport` and `exportCount` (handed on to Customize, as `ToolbarOptions` takes them) and `className`. It calls the builder and draws its parts in the kit's arrangement (`Toolbar`'s `fold`). By default, on a computer, one row at rest: the views with Customize beside them, then on its right Sort and Filter with their words, the quick filters' button and the search, each its icon alone, and New. Sort holds the sort (`ToolbarSortPill`'s `row`): lit while one stands (a view's saved sort included), counted from two, it opens the sort editor to change or remove the rules, Add sort at its foot; with none, the fields. Filter (`ToolbarFilterAdd`) adds a filter to the bar. Under the row the filter bar, a step smaller, is the filters' line: it comes only while a filter stands or is held (or one of its parts is open, or a second axis of views stands there), holding the filters (each as below, + after the last, no empty Filter) and Clear and Save at its end. While it doesn't stand, an unsaved change (a sort, a removed last filter) waits in Customize's foot, Clear and Save (on a shared view Customize also carries its dot), as on a phone. Each of the row's Sort and Filter is a panel of its own, apart from the bar's, so a press opens one list. `sortFilter: "bar"` with `bar: "always"` draws the kit arrangement's old form: the row, the views with Customize beside them and the search and New at its end, and under it the filter bar, always shown, a step smaller: the sort pill first, a separator, the filters (`ToolbarFilters`: each filter as its four joined parts, each advanced filter's pill, + after the last; while there is none, Filter, an empty place; the rule held until whole is held by the toolbar, so the bar counts it as it folds; with `filterGroups` false, Filter as before, with what is applied counted), and at its end Clear and Save (`ToolbarSave`) while the list differs: on a shared view (`view`) Clear takes it back and Save, where `canPublish`, keeps it for everyone; with no shared view, Clear alone takes the list back to its default (nothing filtered, the default sort, no group: so a list that starts grouped or filtered shows Clear at once); Customize's foot then draws neither. A row with no room folds as the kit's does (words to icons, the view tabs into "+N", the bar's last filters into "+N filters", then into ⋯: by default Customize and the row's Sort and Filter, whatever is set; in the old form Customize, and the sort and Filter while no filter stands), with no narrow form. On a phone one line in either form (the views, the sort, Filter, the quick filters' button when handed, Customize, then the search, which opens across the line), Clear and Save in Customize's foot (`views.panels.view-clear`, `views.panels.view-save`; with no shared view, Clear alone), and New a round + at the list's foot, lifted by `--vk-toolbar-foot`. `arrangement: "row"` draws the order of 12 Nov instead: the views on the left; search, sort, filter, options and new on the right, the narrow form under 700px, and Reset and Save for everyone in Customize's foot. Every change comes back as a `ListSettingsChange` or a layer patch: its search writes the settings' search, its ✕s clear in one change (`settingsCleared`), and the active view's menu gains "Edit view…" (`withEditView`), which opens Customize. It holds its panels' state above its frame, so a change of form keeps a panel open on its page, in a sheet once the form is the phone's. Show counts is the view's: read from `settings.showCounts` for the views row and the quick filters, absent meaning on, it joins Customize's toggles where the views carry counts and is written back through `onChange`. Group steps aside on a board (`groupShown`).
|
|
172
172
|
- `ReadyToolbarProps` — what `ReadyToolbar` takes.
|
|
173
173
|
- `useListSettingsState` — a list's settings and layer held in memory, for an app that keeps none yet (a proof page, a test): `{ settings, layer? }` in, `{ settings, layer, onChange, onLayerChange }` out, ready to spread into `ReadyToolbar` beside its `columns`. Each change is applied to the latest settings (`applySettingsChange`), each patch merged into the latest layer.
|
|
@@ -47,6 +47,7 @@ Import from `viewkitjs/views/panels` for what a list's panels read and say: the
|
|
|
47
47
|
## Every row's words
|
|
48
48
|
|
|
49
49
|
- `filterValueLabel` — a filter row's value: the conventions it reads ranges and dates with, then your resolver.
|
|
50
|
+
- `drawsUnnamedValue` — whether `filterValueLabel` draws a filter's value by its stored key: a choice whose one picked value its options don't name. A filter on the bar that does asks the field's `onOpen` once (your `onValuesWanted`), so the name you hand back replaces the id.
|
|
50
51
|
- `relationSentence` — what a relation's filter keeps, in one sentence: "Clients with at least one campaign where status is Active."
|
|
51
52
|
- `dateRangeValueLabel` — a date range's value: "All time", "Jan 1 — Jan 9", "From …", "Until …". Its days are written in the conventions' locale, its optional third argument.
|
|
52
53
|
- `timeScopeRowValueLabel` — a time range's value, a custom range's ends or its label; the ends in the conventions' locale, its optional third argument.
|
|
@@ -66,8 +67,8 @@ Import from `viewkitjs/views/panels` for what a list's panels read and say: the
|
|
|
66
67
|
|
|
67
68
|
What a list hands the views row ([`viewkitjs/views/panels/react`](panels-react.md) draws it).
|
|
68
69
|
|
|
69
|
-
- `ViewTabOption` — one view: its `value`, `label`, `count`, a status `slot` or your own `activeClassName`, its `icon` by your own glyph's name, whether it is `private`, and its verbs as `menu` (the package's menu rows, reached from the active view only).
|
|
70
|
-
- `CollectionViewsConfig` — one axis of views: its `value`, `options`, `onChange`, `hideCounts`, `onCreate` and its `createLabel`, `onReorder` (one block in its new order, folded views included) and `canDrag
|
|
70
|
+
- `ViewTabOption` — one view: its `value`, `label`, `count`, a status `slot` or your own `activeClassName`, its `icon` by your own glyph's name, whether it is `private`, and its verbs as `menu` (the package's menu rows, reached from the active view only); and, for a view's whole menu, its `layout` (by the axis's `verbs.layouts`), `changed` (it holds unsaved changes) and `favorite`.
|
|
71
|
+
- `CollectionViewsConfig` — one axis of views: its `value`, `options`, `onChange`, `hideCounts`, `onCreate` and its `createLabel`, `onReorder` (one block in its new order, folded views included) and `canDrag`; and `verbs` (`ViewsViewVerbs`: `layouts`, `records`, a board's `columns` and one `onChange` taking every `ViewsViewChange` a view's menu makes), handed where your app lets a views list that can draw a view's whole menu (`CONTROLS.ViewsListBody`) draw it.
|
|
71
72
|
- `CollectionViewsInput` — one axis, or an array of peer axes.
|
|
72
73
|
- `ViewsLayout` — how peer axes lay out: `stacked` (each after the first on a row of its own) or `inline`.
|
|
73
74
|
- `CollectionChildAxis` — a child axis whose options depend on the primary selection, as data, for a phone's sheet.
|
|
@@ -109,7 +110,7 @@ A quick filter holds values on top of the view: fields' `ListHold` (`viewkitjs/f
|
|
|
109
110
|
|
|
110
111
|
- `QuickFiltersConfig` — what the quick filters take: `fields`, `hold`, `onHoldChange` (the whole new hold), and optionally `label` (the button's and the panel's name; `views.panels.quick-filters` when absent), `several` (several held at once; false by default, one in all), `showCounts` (the toolbar's Show counts; true by default) and `heldLabels` (the words of what the hold holds that the fields don't list, by field key, each a `QuickHeldLabels`: keep them with your hold, so a deleted record shows by its name, not its id).
|
|
111
112
|
- `QuickHeldLabels` — a held field's words: optionally `label` (the field's, used where the strip doesn't offer it; absent, its key) and `values` (each held value's by its key; a value the field lists keeps its own words, and one this lacks shows by its key).
|
|
112
|
-
- `QuickFilterField` — a field offered: `key` (as the hold names it), `label`, `values` (in its own order) and optionally `counts` (each value's count by its key, as `countHoldValues` answers; a value it lacks counts 0; absent, no counts) and `
|
|
113
|
+
- `QuickFilterField` — a field offered: `key` (as the hold names it), `label`, `values` (in its own order) and optionally `counts` (each value's count by its key, as `countHoldValues` answers; a value it lacks counts 0; absent, no counts), `searchPlaceholder` and `options` (a choice field's every option as `ViewsPickerItem`s, where the app holds them: a value draws its option's mark, a status's step or a face).
|
|
113
114
|
- `QuickFilterValue` — a value offered: `value` (its key as the hold keeps it: an option, an id, `"true"` or `"false"`, `""` for none) and `label`.
|
|
114
115
|
- `QuickShownValue` — a value as the panel shows it: `value`, `label`, `count` where counts show, and `held`.
|
|
115
116
|
- `QUICK_SEARCH_AFTER` — 8: a field's values past this many show a search.
|
|
@@ -160,10 +161,11 @@ Every panel's config from one value: a list's `ListSettings` (`viewkitjs/fields/
|
|
|
160
161
|
With `filterGroups`, a list's filter is a tree of and/or groups the filter editor changes, to the 3 levels and 50 items a group the settings allow. `settingsPanels` hands `filterTree`; a Filter row whose rule stands at the top, narrows something and can be wrapped within 3 levels carries `convert`, which turns it into an advanced filter of its own, in its place. A top joined by Or that shows a rule is one advanced filter: the Filter rows show none of its rules, and a filter added from them first wraps the Or level into an advanced filter under an And top (refused, every row disabled with `views.panels.filter-or-full`, when that would pass 3 levels). An Or that shows no rule reads and writes as And. With groups, Options' count counts each advanced filter, and its Clear (`settingsCleared(…, "options")`) empties every rule and group, keeping the top's set-aside rules; Filter's ✕ (`"filters"`) clears its rows alone on a computer; on a phone, where Filter opens the filter editor on every rule, it empties the advanced filters too.
|
|
161
162
|
|
|
162
163
|
- `settingsFilterTree` — the builder's filter tree (`FilterTreeConfig`), what the filter editor reads, written through the build's shared writer.
|
|
163
|
-
- `FilterTreeConfig` — `tree`, `fields` (`FilterEditorField`s), `onChange(tree)` (the whole tree, as each change is made), `valueOf(rule, write, relation?)` (the rule's value as the Filter panel's own body for its field edits it, its way kept: a choice's and a place's country's Is none of stay; a yes/no is one pick of two that can't be unticked; null for a set-aside rule or a way that takes no value), `label` and `gone` (the builder's `goneFields`).
|
|
164
|
+
- `FilterTreeConfig` — `tree`, `fields` (`FilterEditorField`s, the ones a rule may name), `listed` (what a field list shows: `fields` and, in their places in the column order, each column the list can't filter, its `disabled` saying why), `onChange(tree)` (the whole tree, as each change is made), `valueOf(rule, write, relation?)` (the rule's value as the Filter panel's own body for its field edits it, its way kept: a choice's and a place's country's Is none of stay; a yes/no is one pick of two that can't be unticked; null for a set-aside rule or a way that takes no value), `label` and `gone` (the builder's `goneFields`).
|
|
164
165
|
- `FilterGoneField` — a field the list no longer shows: `fieldKey`, `label` and its `options`' labels (`{ value, label }`), and, for a related list's field, `relation`, the relation's field key (the relation rule's `fieldKey`). A set-aside filter on it reads them, on the bar, in its sentence and in the filter editor's set-aside row (`asideFilterWords`): "Client status is any of Active", a value no option lists as it is stored. One with a `relation` names only a rule inside that relation's where, and one without names only the list's own, so a far field never takes the name of a list field with the same key. Nothing is stored in the rule.
|
|
165
|
-
- `FilterEditorField` — a field a rule names: `key` (the Filter row's), `label`, `fieldKey`, `part`, `type`, and for a relation `far`, its usable far fields one level in.
|
|
166
|
-
- `filterEditorFields` — the fields a rule can name: the Filter panel's own rows that open, in the person's column order, a place's kept parts among them, then each relation the list filters across with its far fields.
|
|
166
|
+
- `FilterEditorField` — a field a rule names: `key` (the Filter row's), `label`, `fieldKey`, `part`, `type`, and for a relation `far`, its usable far fields one level in; in `listed` only, `disabled` on a column the list can't filter, why in your words (your capability's reason, a column with no field's `views.panels.filter-fieldless`, else `views.panels.filter-not-offered`).
|
|
167
|
+
- `filterEditorFields` — the fields a rule can name: the Filter panel's own rows that open, in the person's column order, a place's kept parts among them, then each relation the list filters across with its far fields. Its words for a place's parts are `filterData.messages`, else your resolver.
|
|
168
|
+
- `listedFieldsOf` — what a field list shows: `filterTree.listed`, else its `fields`. Every field list ViewKit draws reads it: a greyed field is drawn greyed with its reason and never picked.
|
|
167
169
|
- `newRuleFor` — a new rule on a field, narrowing nothing until its value is picked: Contains with nothing typed for text, Is with no day for a date, else its type's first way with an empty value.
|
|
168
170
|
- `newRelationRuleFor` — a new relation rule, Any where the far field's new rule holds.
|
|
169
171
|
- `heldUntilWhole` — whether a new rule on a field is held in the editor until it is whole: a yes/no's, whose rule with no value the settings refuse.
|
|
@@ -19,7 +19,8 @@ Guide: [the provider](../guides/the-provider.md).
|
|
|
19
19
|
- Optional: `atoms`, any of your own atoms, each laid over the default of its name; `messages`, your wording for the package's own messages, defaulting to `resolveViewsMessage` (the package's English); `presentation`, `(defaults: FieldPresentation) => FieldPresentation`, how your numbers, dates and durations read: given the package's defaults in the conventions' locale, return yours. It is called where a value is drawn, so your provider imports none of the display.
|
|
20
20
|
- `useViews` — reads the nearest provider's value inside a view or an atom of your own. It throws an error that says where to mount one when no `ViewsProvider` is above it.
|
|
21
21
|
- `ViewsContextValue` — what `useViews` returns: the `components` (your `Menu` wrapped to settle disabled groups), the merged `atoms`, the `icons`, the `ports` as `ViewsResolvedPorts` (`confirm` always a function), the `messages` resolver, the `conventions`, your `presentation` when you handed one, and the `desktopQuery` in force (yours or `DEFAULT_DESKTOP_QUERY`); `escape`, `oneValue` and `sayRefusals` when you handed them; and `menus`, how the grid opens its own menus (absent means `popover`); `gridButtons`, who draws the grid's own buttons (absent means `own`); `gridCheckboxes`, who draws a yes/no cell's box (absent means `own`); `fieldRowButtons` and `fieldRowCheckboxes`, the same for a field row (absent means `own`); `panelButtons`, who draws the panels' own buttons (absent means `own`); `selectionBar` and `datePicks` when you handed them. The provider's moment (`now`) isn't in it: what draws a date reads it, so a new moment redraws only those.
|
|
22
|
-
- `NOOP_PORTS` — ports that do nothing, for a server render, a test or an app without a device: the toasts and haptics are empty, the clipboard writes nothing (resolving `false`) and reads `null`, and the prefs store keeps nothing. It carries no `confirm`, so the provider falls back to the browser's.
|
|
22
|
+
- `NOOP_PORTS` — ports that do nothing, for a server render, a test or an app without a device: the toasts and haptics are empty, the clipboard writes nothing (resolving `false`) and reads `null`, and the prefs store keeps nothing. It carries no `confirm`, so the provider falls back to `PortsHost`'s or the browser's.
|
|
23
|
+
- `NOOP_TOAST` — the toast that draws nothing, `NOOP_PORTS`' own: what `useViews().ports.toast` is where an app hands no toast and no `PortsHost` stands.
|
|
23
24
|
|
|
24
25
|
## The components map
|
|
25
26
|
|
|
@@ -32,6 +33,8 @@ The primitives your app hands in, modelled on Base UI's shapes: a controlled `op
|
|
|
32
33
|
- Focus: `initialFocus` false keeps focus where it was when the popup opens, for an editor that focuses its own input (with `preventScroll`). Default true.
|
|
33
34
|
- 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.
|
|
34
35
|
- 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.
|
|
36
|
+
- `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).
|
|
37
|
+
- `ViewsSelectionBarProps` — what the components map's `SelectionBar` is handed: `SelectionBar`'s own props, at every count.
|
|
35
38
|
- `ViewsTooltipProps` — a tooltip around the element it wraps (`children`), showing `content`, with `side`, `align`, `delayMs` and a class. Your app mounts one tooltip provider above the views; a tooltip never mounts its own.
|
|
36
39
|
- `ViewsCheckboxProps` — a checkbox: `checked`, and `indeterminate` for a box ticked partly, whose press hands `true` while `checked` is false. `onCheckedChange` hands the new value and, where your library reports it, `{ event }`, the press that changed it (a list reads its shift key for a range). `partialTone` colours the partial mark, `muted` by default or `brand` for a select-all with a live selection; with `disabled`, `readOnly` (shown as it is and not pressable: a yes/no the grid or a field row can't write while the provider's `gridCheckboxes` or `fieldRowCheckboxes` is `checkbox`), a class, `tabIndex` and `aria-label`.
|
|
37
40
|
- `ViewsMenuProps` — a menu opened at an `anchor`, with no trigger child (a group opens beside it only where it asks to and your menu can), controlled by `open` and `onOpenChange`, drawing its `items`, placed by `side` and `align`, and named by `label`, its accessible name, which every menu the package opens hands. On Base UI it is the menu's root, positioner and popup, the anchor handed to the positioner.
|
|
@@ -54,15 +57,19 @@ The primitives your app hands in, modelled on Base UI's shapes: a controlled `op
|
|
|
54
57
|
- `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` and `form` (`phone`: draw no ✕, ✓ or Cancel of your own), 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 ✓.
|
|
55
58
|
- `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 ✓.
|
|
56
59
|
- `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.
|
|
57
|
-
- `ViewsQuickFiltersBodyProps` — the quick filters' whole body your app draws: `label`, `fields` (each its `key`, `label`, `searchPlaceholder` 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).
|
|
58
|
-
- `ViewsFilterBodyProps` — the filter editor's whole body your app draws: `label`, `fields` (the fields a rule may name, `ViewsFilterBodyField`s), `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.
|
|
59
|
-
- `ViewsFilterBodyField` — a field a filter body's rule may name: `key`, `label`, `fieldKey`, `part`, `type` (its value type, which says its ways)
|
|
60
|
+
- `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).
|
|
61
|
+
- `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.
|
|
62
|
+
- `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) and `disabled` (on a column the list can't filter, why in words: draw it greyed and never name it in a rule).
|
|
60
63
|
- `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), `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).
|
|
61
64
|
- `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).
|
|
62
65
|
- `ViewsFilterPartBodyProps` — a filter rule's way or value your app draws: `part` (`way` or `value`), `label`, `rule` (the rule as data), `field` (the field it names, a `ViewsFilterBodyField` with no `far`), `ways` (each its operator and its words), `own` (ViewKit's own value body; null at `way`), `form`, `onRuleChange` (the rule with its new way, written as ViewKit's own writes one, or its new value; another field or part, a way its field doesn't offer or a value its way can't hold writes nothing) and `onDone` (what holds it closes).
|
|
63
66
|
- `ViewsSearchFieldProps` — the toolbar's search box your app draws: `value`, `onChange` (every keystroke), `placeholder`, `label` (its name to a screen reader), `searching` and `searchingLabel` (draw a spinner where your glass is, the box still usable), `onClear` (empties the search, and closes it where `closes`), `clearLabel` (your clear's name: "Close search" where it closes, "Clear" where it only clears), `closes` (opened from its button: your clear stands while it is open, empty or not; filling its line: show it only with a value), `form` (`computer` or `phone`) and `fill` (it fills its line).
|
|
64
|
-
- `ViewsViewsListBodyProps` — the views list's whole body your app draws: `label`, `views` (each a `ViewsViewsListItem`), `value` (the view in use), `form`, `onViewChange` (a view picked; written when it is one of `views`; it closes nothing), `onCreate` and `createLabel` where the axis grows (what holds it closes first), `onReorder` and `canDrag` where the axis reorders (one whole block, shared or the reader's own, each once; any other order writes nothing), `onDone` (what holds it closes)
|
|
65
|
-
- `ViewsViewsListItem` — one view as the views list's body is handed it: `value`, `label`, `icon`, `count` (absent while counts are hidden), `private
|
|
67
|
+
- `ViewsViewsListBodyProps` — the views list's whole body your app draws: `label`, `views` (each a `ViewsViewsListItem`), `value` (the view in use), `form`, `onViewChange` (a view picked; written when it is one of `views`; it closes nothing), `onCreate` and `createLabel` where the axis grows (what holds it closes first), `onReorder` and `canDrag` where the axis reorders (one whole block, shared or the reader's own, each once; any other order writes nothing), `onDone` (what holds it closes), on a phone where the sheet's head doesn't draw it `actions` (the ✕, and Back while the body stands on a step), on a computer `onHold` (while true, a press outside and Escape close nothing: the body asks outside the list), on a phone `onStepChange` (the body stands on a step of its own: the sheet shows its title and Back), and, where the axis hands them, `verbs` (a view's whole menu's data, `ViewsViewVerbs`).
|
|
68
|
+
- `ViewsViewsListItem` — one view as the views list's body is handed it: `value`, `label`, `icon`, `count` (absent while counts are hidden), `private`, `menu` (the view's own verbs), and for a view's whole menu `layout`, `changed` and `favorite`.
|
|
69
|
+
- `ViewsViewVerbs` — a view's verbs, handed on the axis where your app lets ViewKit draw a view's whole menu: `layouts`, `records` (the noun in the delete question's line), a board's `columns`, and `onChange`, which takes each `ViewsViewChange` and opens the right view itself (ViewKit moves none: `viewsAfter` does it).
|
|
70
|
+
- `ViewsViewChange` — a change a view's menu makes: rename, create (with its layout, name, a board's columns and the view it was made from), duplicate, delete, restore (Undo: the view, its place, whether it was open), save, reset, edit, link, favorite, private.
|
|
71
|
+
- `ViewsViewLayout` — a layout a new view can take: `id`, `name`, `icon` (your `AppIcon`'s name), `line`, and `columns` where it asks which field makes its columns.
|
|
72
|
+
- `ViewsViewRecord` — a view as a restore hands it back: `id`, `name`, `layout`, and `private`, `favorite`, `changed`, `count` where it has them.
|
|
66
73
|
- `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).
|
|
67
74
|
- `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`.
|
|
68
75
|
- `ViewsGroupValue` — a list's group as one value: `value` (the field grouped by, or `none`), `order` (the active field's `mode` and `dir`), `granularity`, `hideEmpty` and `groups` (each a `ViewsGroupEntry`, in the order the list shows them).
|
|
@@ -15,11 +15,13 @@ Guide: [selection](../guides/selection.md).
|
|
|
15
15
|
|
|
16
16
|
## The bar
|
|
17
17
|
|
|
18
|
-
- `SelectionBar` — the bar a selection opens, portalled to the body and placed by the provider's `selectionBar`. On a desktop, an island: the count chip (a press clears the selection; its tooltip names Escape; ViewKit's own, or your `Button` with `selectionBar`'s `chip: "button"`), the first four verbs, the trash when `onDelete` is handed, a hairline and More, always drawn (when nothing spills into it, a Tab stop that opens nothing, `aria-disabled`, saying why in your `Tooltip`: `views.selection.more-none`), holding the rest (a group or an options verb opening its rows beside it). On a phone, a pill reading the count, Actions and ✕; Actions opens the `SelectionSheet` atom. It draws nothing while `count` is zero.
|
|
18
|
+
- `SelectionBar` — the bar a selection opens, portalled to the body and placed by the provider's `selectionBar`. On a desktop, an island: the count chip (a press clears the selection; its tooltip names Escape; ViewKit's own, or your `Button` with `selectionBar`'s `chip: "button"`), the first four verbs, the trash when `onDelete` is handed, a hairline and More, always drawn (when nothing spills into it, a Tab stop that opens nothing, `aria-disabled`, saying why in your `Tooltip`: `views.selection.more-none`), holding the rest (a group or an options verb opening its rows beside it). On a phone, a pill reading the count, Actions and ✕; Actions opens the `SelectionSheet` atom. It draws nothing while `count` is zero. Handed a `SelectionBar` in the components map (`CONTROLS`: the Outright bulk bar), it draws that one in its place instead, in the box that holds it, at every count; `noun` and `deleteLine` are for that bar.
|
|
19
19
|
- `SelectionBarProps` — what `SelectionBar` takes: `count`, `onClear`, `verbs` (`SelectionVerb`s, in order), optional `busy` (disables every control), `onDelete` (the bar's own verb, the trailing trash; never a verb in `verbs`) and `deleteLabel` (the trash's name; default the `views.selection.delete` message).
|
|
20
20
|
- `SelectionVerb` — one verb, as data: `{ kind: "action" }` with a `SelectionVerbItem`'s fields; `{ kind: "group", label, icon?, disabled?, disabledReason?, items }`, a button opening a menu of `SelectionVerbItem`s, whose rows that give no reason carry the group's; or a `SelectionOptionsVerb`.
|
|
21
21
|
- `SelectionVerbItem` — an action: `label`, optional `icon` (your glyph), `onClick`, `destructive` (the danger colour), `disabled`, and `disabledReason`, why it is disabled: More's row, the bar's button and the phone's sheet carry it.
|
|
22
|
-
- `SelectionOptionsVerb` — one field set on every selected row: `{ kind: "options", label, icon?, disabled?, disabledReason?, options, onSelect }`, its `options` `PickerOption`s drawn as the badges a cell shows, `onSelect` handed the value picked. It closes, then runs.
|
|
22
|
+
- `SelectionOptionsVerb` — one field set on every selected row: `{ kind: "options", label, icon?, disabled?, disabledReason?, options, onSelect }`, its `options` `PickerOption`s (or `ViewsPickerItem`s, a person by `avatarUrl` and `kind`) drawn as the badges a cell shows, `onSelect` handed the value picked. It closes, then runs. For the components map's bar (`CONTROLS.SelectionBar`) it may carry `value` (what every picked row holds), `empty` with `onEmpty` (an empty row that clears the field) and `search`; any verb may carry `more`, kept off that bar, in More.
|
|
23
|
+
- `SelectionDone` — what a press may hand back for the components map's bar: `{ words, undo? }`, what its Toast says and how it is taken back.
|
|
24
|
+
- `SelectionRun` — a press (`onClick`, `onEmpty`, `onDelete`): whatever it returns, read as a `SelectionDone` (or a promise of one) where it is one.
|
|
23
25
|
|
|
24
26
|
## Picking rows with the pointer
|
|
25
27
|
|
|
@@ -29,6 +29,7 @@ Guide: [the provider](../guides/the-provider.md).
|
|
|
29
29
|
- `VK_CONTROL_TOKENS` — every name ViewKit's default controls (`viewkitjs/views/controls`) read, each with its `kind` (`colour`, `shadow`, `size` or `motion`): all optional, the ready stylesheet declaring each at the Outright look's value, and each standing for the Outright token [the controls' tokens](../contract.md#the-controls-tokens) names.
|
|
30
30
|
- `VkControlToken` — one name of `VK_CONTROL_TOKENS`.
|
|
31
31
|
- `VK_CONTROL_TOKENS_BY_PIECE` — each control's own list, by its piece: the names its stylesheet reads, a name two controls read in both, one kind and one token.
|
|
32
|
+
- `VK_GRID_TOKENS` — every name the grid's look stylesheet (`viewkitjs/views/grid.css`) reads beside the grid's own geometry, each with its `kind` and its Outright token: all optional, the ready stylesheet declaring each at the Outright look's value; all but `--vk-frozen-fade` are the controls' names too ([the grid's look tokens](../contract.md#the-grids-look-tokens)).
|
|
32
33
|
- `ControlToken` — one name a control reads: `name`, `kind` and `outright`, the Outright token it stands for.
|
|
33
34
|
- `VK_CONTROL_PRIVATE_FAMILIES` — the prefixes of the controls' own machinery, set and read by a control alone (the smooth corner's, the pressing room's, and each control's own): not public, and your app neither sets nor reads them.
|
|
34
35
|
- `COMPONENT_NAMES` — the primitives your app hands in through the provider: `Button`, `Popover`, `Tooltip`, `Checkbox`, `Menu`, `Collapse`, `Sheet`, `AppIcon` and `Markdown` ([the components map](../contract.md#the-components-map)).
|
|
@@ -100,7 +101,7 @@ Guide: [columns](../guides/columns.md).
|
|
|
100
101
|
|
|
101
102
|
## How a column's value reads
|
|
102
103
|
|
|
103
|
-
- `ListColumnFormat` — how a column's value is drawn. Numbers: `style` (`plain`, or `duration`, a number stored in `unit`, milliseconds by default, and drawn as a span), `decimals`, `suffix`, `signed` and `signedTone` (`positive-good`, the default, tints a positive figure as good; `neutral` does not), `currency` (one code for the whole column). Dates: `dateStyle`, `withTime
|
|
104
|
+
- `ListColumnFormat` — how a column's value is drawn. Numbers: `style` (`plain`, or `duration`, a number stored in `unit`, milliseconds by default, and drawn as a span), `decimals`, `suffix`, `signed` and `signedTone` (`positive-good`, the default, tints a positive figure as good; `neutral` does not), `currency` (one code for the whole column). Dates: `dateStyle`, `withTime` (a date-and-time shows its time unless it is `false`); durations: `durationStyle`; percents: `percentDisplay`; text: `long` (a paragraph, read and edited in a panel). Booleans: `booleanDisplay`, which is a write policy as much as a look: `checkbox` (the default, a two-way flip), `icon` (a flip drawn with the column's own `icon(on)` glyph), `text` (the column's two words from its options, read-only) or `marker` (an exception raised elsewhere: nothing drawn when false, and the only write is resolving it to false). `ignoresOverrides` says a custom `render` does not read the format settings, so the menus withhold knobs it would ignore.
|
|
104
105
|
- `ListDateStyle` — how a date reads: `short`, `long`, `numeric` or `relative`.
|
|
105
106
|
- `ListDurationStyle` — how a duration reads: `adaptive`, `clock` or `units`; the same union the duration formatter in `viewkitjs/fields` implements.
|
|
106
107
|
- `ListNumberFormatState` — one field's number setting: `decimals` and, on a convertible money column, the `currency` reading in force and the `currencyOptions` the header menu offers.
|
|
@@ -122,7 +123,7 @@ What the machinery may do with each column type, declared once per type so a new
|
|
|
122
123
|
- `typeRule` — the rule for a type, or `null` for a column that declares no type.
|
|
123
124
|
- `GridEditorId` — which editor a writable column mounts when clicked, Entered or typed into: `text`, `select`, `number`, `date`, `relation`, `chips`, `range`, `name`, `values` (several emails, phones, links or domains, each with its label and a main one) or `place` (the country first, then its parts).
|
|
124
125
|
- `ListFilterEditor` — which editor a column opens in the filter panel: `options`, `text`, `number`, `date`, `boolean`, `range`, or `none` (listed, opens nothing).
|
|
125
|
-
- `GridPasteKind` — how a pasted clipboard cell becomes a commit: `text`, `option` (the pasted text matched against an offered option's label or key, exact before ignoring case, an in-grid copy landing on the exact option it copied, a label two options share refused), `number`, `date` (a day; a date and time with an offset or `Z` is the instant it names, one with none the wall clock in the conventions' `timeZone`, as typed, a day alone that zone's first instant, a time the zone skips or a day that doesn't exist refused), `boolean`, `relation` (the pasted label matched against the candidates, committing the id; on a relation of several, a copy of a relation cell lands its links whole, and text names records by their labels between commas, the set replacing the cell's links, a label no candidate has refused by name), `list` (the text split into several values, each read as an `option` is on a column of options), `range` (an in-grid pair, or text read as a range is written: "11–50", "10,001+", "up to 50"), or `none` (the type refuses paste).
|
|
126
|
+
- `GridPasteKind` — how a pasted clipboard cell becomes a commit: `text`, `option` (the pasted text matched against an offered option's label or key, exact before ignoring case, an in-grid copy landing on the exact option it copied, a label two options share refused), `number`, `date` (a day; a date and time with an offset or `Z` is the instant it names, one with none the wall clock in the conventions' `timeZone`, as typed, a day alone that zone's first instant, a time the zone skips or a day that doesn't exist refused), `boolean`, `relation` (the pasted label matched against the candidates, committing the id; on a relation of several, a copy of a relation cell lands its links whole, and text names records by their labels between commas, the set replacing the cell's links, a label no candidate has refused by name), `list` (the text split into several values, each read as an `option` is on a column of options), `range` (an in-grid pair, a band's name in any case, a name two bands share refused, or text read as a range is written: "11–50", "10,001+", "up to 50"), or `none` (the type refuses paste).
|
|
126
127
|
- `GridValueKind` — what a written value must look like for a type: `any`, `email`, `url`, `boolean`, `relation` or `list`. `gridNormalizeWrite` holds a value to it.
|
|
127
128
|
- `gridPasteKind` — how a paste becomes this column's value. A `multiple` column pastes as a `list` when it presents a field of a type that keeps several values, and takes no paste otherwise; any other column answers with its type's rule. Returns `null` for a column with no type.
|
|
128
129
|
- `gridRelationSource` — the candidates the relation picker offers for a column: its `relation.source`, or a static list of its `relation.options`. Given an `entityIcon` resolver, each candidate without an icon of its own wears its kind's glyph, both in a static list and in each page a remote search returns; without one, the candidates come back untouched.
|
|
@@ -183,7 +184,7 @@ What a person changes about the columns (which are shown, in what order, at what
|
|
|
183
184
|
|
|
184
185
|
- `columnManagedByView` — whether a saved view can store a column's filters, sorts and totals: only a column that presents a field.
|
|
185
186
|
- `columnPlacedByView` — whether a saved view can place a column (its position, width and visibility): a column that presents a field, a computed (`custom`) column, which the view stores under its id, or a part column (`partOf`), placed as its whole is. A computed column still never filters, sorts, groups or totals.
|
|
186
|
-
- `VIEW_FIELDLESS_FILTER_REASON` — the English
|
|
187
|
+
- `VIEW_FIELDLESS_FILTER_REASON` — the English of `views.panels.filter-fieldless`, why a saved view cannot filter on a column that presents no field; the builder words it through your messages.
|
|
187
188
|
- `resolveViewColumnOrder` — the column ids in the order a saved view draws them: the columns the view places take the view's requested order among their own slots (an unknown or repeated id dropped); a field column it does not name follows the ones it does; a computed column it does not name, and every column it cannot place, keeps its declared slot; a part column it does not name sits right after its whole.
|
|
188
189
|
- `baseColumnOrder` — the complete order a Move or a header drag rewrites, which is the order the grid draws: `resolveViewColumnOrder` on a saved view, `resolveColumnOrder` off one. Returns column ids.
|
|
189
190
|
|
|
@@ -205,7 +206,7 @@ What a person changes about the columns (which are shown, in what order, at what
|
|
|
205
206
|
The filter panel's rows come from the columns themselves: every column is listed, in the person's column order, and its type decides what its row opens.
|
|
206
207
|
|
|
207
208
|
- `buildColumnFilters` — builds the filter panel's rows from a list's columns and returns them as filter configs. Each column gives one row in the person's `order`, opening its type's editor and reading and writing `rules` through `onRuleChange`; a column with no `accessor` is listed but opens nothing. A `declared` filter whose `key` matches a column id takes that column's row in place, and one matching no column is appended. A column `capabilities` marks unavailable is listed with its reason. A hidden column keeps its row and its rule under `HIDDEN_COLUMN_SECTION`. The other inputs:
|
|
208
|
-
- Options: `selectValues` (the values a select's editor offers), `relationValues` (the relations present in the rows), `knownValues` and `knownLabels` (the values and names your host read for an open field, a relation, a user or an actor, offered ahead of those on screen), and `onValuesWanted`, called when such a row opens so your host can fetch them.
|
|
209
|
+
- Options: `selectValues` (the values a select's editor offers), `relationValues` (the relations present in the rows), `knownValues` and `knownLabels` (the values and names your host read for an open field, a relation, a user or an actor, offered ahead of those on screen), and `onValuesWanted`, called when such a row opens, or once by a filter on the bar that holds a value of it you haven't named, so your host can fetch them (their names in `knownValues` and `knownLabels`).
|
|
209
210
|
- The order a Filter row offers: a fixed select or status, its declared options in their order, then the values the rows hold; an open select or tag list, `knownValues` in the order your host handed them, then those on screen; a relation, a user or an actor, the named `knownValues` in the order your host handed them (`viewkitjs/postgres` hands them most held first), then those on screen it didn't name, A to Z in the conventions' locale; a place's country, by the country's name.
|
|
210
211
|
- Reading: `decimals` (what each number cell shows, so equality rounds as the eye does), `columnState` and `viewId` (what "hidden" means for this view), `icon` (each row's glyph), `messages` and `conventions`.
|
|
211
212
|
- `parts: true` adds one row per part of a value right under its column ("Location · Country"), keyed `partKey(columnId, part)`; a location's whole-value row gives way to its parts.
|
|
@@ -490,7 +491,7 @@ One Filter panel row per relation the list's source can look across, under the s
|
|
|
490
491
|
- `farWhereInputs` — a relation's far fields as the filter builder reads them: `{ columns, knownValues, knownLabels, onValuesWanted }`, each far field a column (greyed, with no accessor, where it has nothing to pick from: a far person, record or actor the target doesn't name with `farValues` handed, an option field with no options), the far values for the fields the target names. The Related records rows and the filter editor's far rules are built from it.
|
|
491
492
|
- `buildRelationFilters` — builds the Related records rows, one `FilterConfigRelation` per target. It takes `targets` keyed by the relation's field key, the current `rules`, `onRuleChange(fieldKey, rule)`, the `subject` (what the list's rows are, plural and lower case), optionally an `icon` for the rows and a `fieldIcon` for each Where row, `farValues`, and `messages` and `conventions`, which word its Related records heading (`views.panels.related-records`) and reach its Where rows. A far relation, user or actor is offered only when its target names it and `farValues` answers it; without, it is listed greyed, as is a place and an option field that declares no options.
|
|
492
493
|
- `RelationFilterTarget` — one relation the list can filter across: the far entity's `kind` ("campaign"), the relation's own `label` on the list's entity ("Campaigns"), the far `fields` a Where rule may name, `named`, the far relations, users or actors whose values the host answers by name, and an optional `noun` (`{ one, many }`), the far record's noun in your words; absent, the kind with its hyphens as spaces and the label lower-cased in the conventions' locale. A far field it leaves out stays greyed.
|
|
493
|
-
- `FarValues` — the far values a host hands as `farValues`, keyed by `farPathOf`: `values`, each path's values; optionally `labels`, each path's values to their names; and `onWanted(path)`, called when a named far field's row opens, so the host can fetch its values.
|
|
494
|
+
- `FarValues` — the far values a host hands as `farValues`, keyed by `farPathOf`: `values`, each path's values; optionally `labels`, each path's values to their names; and `onWanted(path)`, called when a named far field's row opens, or once by a filter on the bar that holds a value of it the host hasn't named, so the host can fetch its values.
|
|
494
495
|
- `farPathOf` — a far field's path, as the host keys its values: the relation's key (itself a two-hop path, `a.b`, for a rollup's second hop), `FAR_PATH_SEPARATOR` and the far field's key, such as `deals.owner`.
|
|
495
496
|
- `FAR_PATH_SEPARATOR` — `.`, what separates a far path's hops and its far field; a field key never holds one.
|
|
496
497
|
- `relationFilterKey` — a Related records row's key, from the relation's field key: the key with `relation:` before it.
|
|
@@ -572,7 +573,7 @@ A saved view's filter is a tree of rules keyed by field key; the Filter panel ed
|
|
|
572
573
|
|
|
573
574
|
## A value's parts as rows
|
|
574
575
|
|
|
575
|
-
One part of a value can have a row of its own in the Filter, Sort and Group menus: "Location · Country", "Name · First name". A host turns these rows on with `parts: true`; the tables say which parts of which types get one.
|
|
576
|
+
One part of a value can have a row of its own in the Filter, Sort and Group menus: "Location · Country", "Name · First name". A host turns these rows on with `parts: true`; the tables say which parts of which types get one. A place has no whole filter: it is filtered only through its parts, so an app offers a place's filter with `parts: true` (its country, region, city and postal code; VK-735).
|
|
576
577
|
|
|
577
578
|
- `partKey` — a part row's key: a column id (Filter) or a field key (Sort, Group), `::`, then the part.
|
|
578
579
|
- `parsePartKey` — splits a key at its last separator: `{ id }` for a whole value, `{ id, part }` for a part.
|
|
@@ -59,7 +59,7 @@ export function AppViews({ children }: { children: ReactNode }) {
|
|
|
59
59
|
|
|
60
60
|
## Write the adapter against the contract
|
|
61
61
|
|
|
62
|
-
`views/docs/contract.md` lists the nine required components and the optional `Input`, `Command`, `Picker`, `LinksBody`, `Calendar`, `DateBody`, `PartsBody`, `ValuesBody`, `TextBody`, `NumberBody`, `SortBody`, `FilterBody`, `FieldsBody`, `FilterPartBody`, `RowsWait`, `QuickFiltersBody`, `ViewsListBody`, `GroupBody`, `CustomizeBody` and `
|
|
62
|
+
`views/docs/contract.md` lists the nine required components and the optional `Input`, `Command`, `Picker`, `LinksBody`, `Calendar`, `DateBody`, `PartsBody`, `ValuesBody`, `TextBody`, `NumberBody`, `SortBody`, `FilterBody`, `FieldsBody`, `FilterPartBody`, `RowsWait`, `QuickFiltersBody`, `ViewsListBody`, `GroupBody`, `CustomizeBody`, `SearchField` and `PortsHost`, the five ports (`toast` and `confirm` optional: with `CONTROLS` spread, a missing one is ViewKit's Toast or alert dialog) and the icon names. Implement
|
|
63
63
|
`ViewsComponents` over your own shadcn copies: a controlled `open` with `onOpenChange(open, details)`,
|
|
64
64
|
an `anchor` element or ref on the popover and the menu, and no `asChild`; `AppIcon` is your own
|
|
65
65
|
icon component by your own names. The shapes are Base UI's; `views/docs/contract.md`'s "Writing an
|
|
@@ -80,7 +80,7 @@ The atoms — `List`, `Row`, `RowContent`, `TickBox`, `StatusBadge`, `StatusMark
|
|
|
80
80
|
`RelationLink`, `RelationRoles`, `Loading`, `LoadMore`, `PlatformMark`, `RowMenu` — ship as defaults drawn from your theme. Swap any of them through `atoms` so the views wear
|
|
81
81
|
your own menus and pills. `CommandMenu`, `RowMenu` and `RelationLink` are your app's own pieces — the verb menu a
|
|
82
82
|
command cell opens, the row's right-click menu, and where a relation chip goes; their defaults are the map's menu,
|
|
83
|
-
the map's menu at the pointer (its Delete asks the `confirm` port
|
|
83
|
+
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
|
|
84
84
|
defaults are a plain ring and a sentinel past the last row. `PlatformMark` is a link's platform, drawn before
|
|
85
85
|
it: the package ships no brand art, so its default draws nothing and a link looks plain; you draw your own
|
|
86
86
|
marks by `platform.key`.
|