viewkitjs 0.38.0 → 0.40.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 +134 -0
- package/MIGRATION.md +32 -0
- package/fields/dist/derived.d.ts +7 -0
- package/fields/dist/derived.js +4 -0
- package/fields/dist/index.d.ts +1 -1
- package/fields/dist/index.js +1 -1
- package/fields/dist/messages.d.ts +5 -1
- package/fields/dist/messages.js +3 -0
- package/fields/dist/query/evaluate.d.ts +7 -1
- package/fields/dist/query/evaluate.js +8 -5
- package/fields/dist/query/figure-kinds.d.ts +2 -2
- package/fields/dist/query/figure-kinds.js +3 -0
- package/fields/dist/query/figures.d.ts +5 -3
- package/fields/dist/query/figures.js +13 -0
- package/fields/dist/query/filter.d.ts +7 -0
- package/fields/dist/query/filter.js +7 -1
- package/fields/dist/query/kit.d.ts +3 -2
- package/fields/dist/query/kit.js +1 -1
- package/fields/dist/query/layer.d.ts +6 -0
- package/fields/dist/query/layer.js +3 -0
- package/fields/dist/query/number.d.ts +3 -2
- package/fields/dist/query/number.js +5 -3
- package/fields/dist/query/read-rule.d.ts +1 -1
- package/fields/dist/query/read-rule.js +3 -0
- package/fields/docs/guides/queries.md +28 -24
- package/fields/docs/reference/fields.md +1 -0
- package/fields/docs/reference/query.md +9 -7
- package/package.json +2 -4
- package/postgres/dist/check.js +3 -1
- package/postgres/dist/definitions/storage.d.ts +3 -1
- package/postgres/dist/definitions/storage.js +3 -1
- package/postgres/dist/definitions/stored.js +13 -2
- package/postgres/dist/map.d.ts +5 -1
- package/postgres/dist/map.js +4 -0
- package/postgres/dist/records.js +6 -1
- package/postgres/docs/guides/definitions.md +1 -1
- package/postgres/docs/guides/field-map.md +3 -3
- package/postgres/docs/reference/postgres.md +1 -1
- package/views/dist/atoms/HeaderChrome.d.ts +7 -0
- package/views/dist/atoms/HeaderChrome.js +15 -0
- package/views/dist/atoms/ToolbarButton.d.ts +1 -1
- package/views/dist/atoms/ToolbarButton.js +2 -2
- package/views/dist/atoms/defaults.js +4 -0
- package/views/dist/atoms/types.d.ts +39 -2
- package/views/dist/contract.d.ts +38 -9
- package/views/dist/contract.js +64 -6
- package/views/dist/controls/avatar.css +1 -1
- package/views/dist/controls/customize/map-customize-body.js +1 -1
- package/views/dist/controls/field/field.d.ts +2 -14
- package/views/dist/controls/field/field.js +4 -9
- package/views/dist/controls/field/looks.d.ts +1 -1
- package/views/dist/controls/field/looks.js +7 -3
- package/views/dist/controls/field/tokens.d.ts +4 -0
- package/views/dist/controls/field/tokens.js +1 -0
- package/views/dist/controls/field.css +33 -0
- package/views/dist/controls/filter-editor/block.d.ts +3 -1
- package/views/dist/controls/filter-editor/block.js +4 -3
- package/views/dist/controls/filter-editor/filter-editor.d.ts +15 -2
- package/views/dist/controls/filter-editor/filter-editor.js +49 -16
- package/views/dist/controls/filter-editor/how.d.ts +11 -1
- package/views/dist/controls/filter-editor/map-filter-body.d.ts +4 -2
- package/views/dist/controls/filter-editor/map-filter-body.js +21 -11
- package/views/dist/controls/filter-editor/map-rules.d.ts +6 -4
- package/views/dist/controls/filter-editor/map-rules.js +7 -4
- package/views/dist/controls/filter-editor/parts.d.ts +14 -1
- package/views/dist/controls/filter-editor/parts.js +14 -0
- package/views/dist/controls/filter-editor.css +4 -1
- package/views/dist/controls/index.d.ts +0 -3
- package/views/dist/controls/index.js +0 -3
- package/views/dist/controls/input.css +1 -1
- package/views/dist/controls/internal/menu-items.d.ts +2 -0
- package/views/dist/controls/internal/menu-items.js +1 -1
- package/views/dist/controls/internal/part-slot.d.ts +1 -1
- package/views/dist/controls/internal/part-slot.js +1 -1
- package/views/dist/controls/internal/row-actions.d.ts +33 -0
- package/views/dist/controls/internal/row-actions.js +28 -0
- package/views/dist/controls/menu/map-menu.js +1 -1
- package/views/dist/controls/menu-list.css +1 -1
- package/views/dist/controls/picker/looks.d.ts +1 -1
- package/views/dist/controls/picker.css +2 -2
- 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/press.css +0 -1
- package/views/dist/controls/radio/radio.d.ts +1 -1
- package/views/dist/controls/radio/radio.js +1 -16
- package/views/dist/controls/sheet/bottom-sheet.d.ts +2 -2
- package/views/dist/controls/sheet/bottom-sheet.js +31 -24
- package/views/dist/controls/sheet/map-sheet.js +9 -6
- package/views/dist/controls/sort-editor/map-sort-body.js +1 -0
- package/views/dist/controls/sort-editor/sort-editor.d.ts +5 -1
- package/views/dist/controls/sort-editor/sort-editor.js +41 -13
- package/views/dist/controls/text-editor.css +22 -0
- package/views/dist/controls/tokens.js +0 -6
- package/views/dist/controls/toolbar/toolbar.js +2 -2
- package/views/dist/controls/toolbar-button/atom-toolbar-button.d.ts +1 -1
- package/views/dist/controls/toolbar-button/atom-toolbar-button.js +2 -2
- package/views/dist/editors/EditorPanel.js +1 -1
- package/views/dist/field-row/FieldRow.js +38 -16
- package/views/dist/field-row/editors/RowChipsEditor.js +3 -1
- package/views/dist/field-row/editors/RowDateEditor.js +3 -1
- package/views/dist/field-row/editors/RowNameEditor.js +3 -1
- package/views/dist/field-row/editors/RowPlaceEditor.js +4 -2
- package/views/dist/field-row/editors/RowRangeEditor.js +3 -1
- package/views/dist/field-row/editors/RowRelationEditor.js +5 -2
- package/views/dist/field-row/editors/RowSelectEditor.js +3 -1
- package/views/dist/field-row/editors/RowTextEditor.d.ts +7 -1
- package/views/dist/field-row/editors/RowTextEditor.js +28 -4
- package/views/dist/field-row/editors/RowValueListEditor.js +4 -4
- package/views/dist/field-row/editors/row-place.d.ts +33 -0
- package/views/dist/field-row/editors/row-place.js +141 -0
- package/views/dist/field-row/field-row-button.d.ts +9 -6
- package/views/dist/field-row/field-row-button.js +3 -3
- package/views/dist/field-row/row-target.d.ts +4 -1
- package/views/dist/field-row/row-target.js +1 -1
- package/views/dist/filters/duration-bound.d.ts +7 -0
- package/views/dist/filters/duration-bound.js +9 -0
- package/views/dist/filters/filter-model.d.ts +4 -0
- package/views/dist/filters/number-refused.d.ts +8 -0
- package/views/dist/filters/number-refused.js +4 -0
- package/views/dist/grid/chrome/GridAggregateMenu.d.ts +12 -11
- package/views/dist/grid/chrome/GridAggregateMenu.js +4 -3
- package/views/dist/grid/chrome/GridFooter.d.ts +12 -4
- package/views/dist/grid/chrome/GridFooter.js +11 -9
- package/views/dist/grid/chrome/GridHeader.js +4 -3
- package/views/dist/grid/chrome/GridResizeHandle.d.ts +7 -3
- package/views/dist/grid/chrome/GridResizeHandle.js +2 -3
- package/views/dist/grid/chrome/GridTable.js +1 -1
- package/views/dist/grid/chrome/GridTableSurface.js +1 -1
- package/views/dist/grid/chrome/grid-body-place.d.ts +2 -4
- package/views/dist/grid/chrome/grid-body-place.js +4 -5
- package/views/dist/grid/chrome/grid-figure-value.js +10 -4
- package/views/dist/grid/chrome/grid-table-props.d.ts +15 -4
- package/views/dist/grid/chrome/useGridTableInteractionModel.js +12 -2
- package/views/dist/grid/core/clipboard-model.js +42 -8
- package/views/dist/grid/core/commit-model.d.ts +3 -0
- package/views/dist/grid/core/editing-controller.d.ts +29 -1
- package/views/dist/grid/core/editing-controller.js +142 -12
- package/views/dist/grid/core/pending-reconciliation.d.ts +14 -0
- package/views/dist/grid/core/pending-reconciliation.js +20 -8
- package/views/dist/grid/core/save-path.d.ts +4 -2
- package/views/dist/grid/core/save-path.js +1 -1
- package/views/dist/grid/core/spreadsheet-operations.js +43 -5
- package/views/dist/grid/core/useGridEditing.d.ts +5 -1
- package/views/dist/grid/core/useGridEditing.js +4 -4
- package/views/dist/grid/core/written-alongside.d.ts +16 -0
- package/views/dist/grid/core/written-alongside.js +30 -0
- package/views/dist/grid/grid.css +8 -4
- package/views/dist/grid/index.d.ts +1 -1
- package/views/dist/grid/looks.d.ts +2 -2
- package/views/dist/internal/before-paint.d.ts +5 -0
- package/views/dist/internal/before-paint.js +17 -0
- package/views/dist/internal/field-rows.d.ts +0 -8
- package/views/dist/internal/field-rows.js +1 -3
- package/views/dist/internal/over-cell.d.ts +8 -0
- package/views/dist/internal/over-cell.js +5 -0
- package/views/dist/list/bar-keys.d.ts +8 -0
- package/views/dist/list/bar-keys.js +3 -0
- package/views/dist/list/bar-parts.d.ts +27 -0
- package/views/dist/list/bar-parts.js +38 -0
- package/views/dist/list/buttons/clear-save.d.ts +7 -0
- package/views/dist/list/buttons/clear-save.js +19 -0
- package/views/dist/list/buttons/customize.d.ts +28 -0
- package/views/dist/list/buttons/customize.js +31 -0
- package/views/dist/list/buttons/filter.d.ts +32 -0
- package/views/dist/list/buttons/filter.js +60 -0
- package/views/dist/list/buttons/new.d.ts +18 -0
- package/views/dist/list/buttons/new.js +21 -0
- package/views/dist/list/buttons/quick.d.ts +15 -0
- package/views/dist/list/buttons/quick.js +24 -0
- package/views/dist/list/buttons/search.d.ts +18 -0
- package/views/dist/list/buttons/search.js +17 -0
- package/views/dist/list/buttons/shared.d.ts +97 -0
- package/views/dist/list/buttons/shared.js +137 -0
- package/views/dist/list/buttons/sort-filter.d.ts +6 -0
- package/views/dist/list/buttons/sort-filter.js +16 -0
- package/views/dist/list/buttons/sort.d.ts +17 -0
- package/views/dist/list/buttons/sort.js +34 -0
- package/views/dist/list/buttons/views.d.ts +21 -0
- package/views/dist/list/buttons/views.js +38 -0
- package/views/dist/list/editor-menus.d.ts +13 -0
- package/views/dist/list/editor-menus.js +13 -0
- package/views/dist/list/edits.d.ts +3 -1
- package/views/dist/list/index.d.ts +41 -0
- package/views/dist/list/index.js +19 -0
- package/views/dist/list/layer.d.ts +13 -3
- package/views/dist/list/layer.js +13 -3
- package/views/dist/list/line.d.ts +58 -0
- package/views/dist/list/line.js +229 -0
- package/views/dist/list/list.d.ts +7 -1
- package/views/dist/list/list.js +2 -2
- package/views/dist/list/pane-box.d.ts +6 -0
- package/views/dist/list/pane-box.js +15 -0
- package/views/dist/list/panels/customize.d.ts +8 -0
- package/views/dist/list/panels/customize.js +23 -0
- package/views/dist/list/panels/filter-bar.d.ts +12 -0
- package/views/dist/list/panels/filter-bar.js +73 -0
- package/views/dist/list/panels/filter.d.ts +8 -0
- package/views/dist/list/panels/filter.js +23 -0
- package/views/dist/list/panels/quick.d.ts +7 -0
- package/views/dist/list/panels/quick.js +16 -0
- package/views/dist/list/panels/shared.d.ts +26 -0
- package/views/dist/list/panels/shared.js +36 -0
- package/views/dist/list/panels/sort.d.ts +8 -0
- package/views/dist/list/panels/sort.js +19 -0
- package/views/dist/list/panels/views.d.ts +13 -0
- package/views/dist/list/panels/views.js +27 -0
- package/views/dist/list/ready.d.ts +35 -0
- package/views/dist/list/ready.js +7 -0
- package/views/dist/list/root-base.d.ts +19 -1
- package/views/dist/list/root-base.js +13 -3
- package/views/dist/list/root.d.ts +1 -1
- package/views/dist/list/root.js +2 -2
- package/views/dist/list/store.d.ts +29 -0
- package/views/dist/list/store.js +48 -2
- package/views/dist/list/toolbar-model.d.ts +99 -0
- package/views/dist/list/toolbar-model.js +195 -0
- package/views/dist/list/toolbar.js +142 -329
- package/views/dist/list/views-axis.js +15 -4
- package/views/dist/list/views.d.ts +1 -1
- package/views/dist/list/views.js +4 -1
- package/views/dist/looks/index.d.ts +0 -1
- package/views/dist/looks/index.js +0 -1
- package/views/dist/looks/looks.d.ts +1 -1
- package/views/dist/looks/pieces.js +0 -2
- package/views/dist/model/aggregates.d.ts +18 -8
- package/views/dist/model/aggregates.js +16 -22
- package/views/dist/model/column-filters.js +10 -3
- package/views/dist/model/view-rules.js +1 -0
- package/views/dist/panels/filter/NumberFilterBody.js +6 -8
- package/views/dist/panels/labels.js +7 -2
- package/views/dist/panels/model.d.ts +3 -0
- package/views/dist/panels/react/filter/FilterEditor.d.ts +3 -1
- package/views/dist/panels/react/filter/FilterEditor.js +2 -2
- package/views/dist/panels/react/filter/filter-body.d.ts +3 -1
- package/views/dist/panels/react/filter/filter-body.js +7 -3
- package/views/dist/panels/react/sort/SortEditor.d.ts +3 -1
- package/views/dist/panels/react/sort/SortEditor.js +4 -4
- package/views/dist/panels/react/toolbar/Toolbar.d.ts +80 -3
- package/views/dist/panels/react/toolbar/Toolbar.js +85 -52
- package/views/dist/panels/react/toolbar/ToolbarBarSorts.d.ts +9 -0
- package/views/dist/panels/react/toolbar/ToolbarBarSorts.js +84 -0
- package/views/dist/panels/react/toolbar/ToolbarButton.d.ts +1 -1
- package/views/dist/panels/react/toolbar/ToolbarButton.js +5 -3
- package/views/dist/panels/react/toolbar/ToolbarFilterAdd.d.ts +4 -1
- package/views/dist/panels/react/toolbar/ToolbarFilterAdd.js +2 -2
- package/views/dist/panels/react/toolbar/ToolbarOptions.d.ts +30 -0
- package/views/dist/panels/react/toolbar/ToolbarOptions.js +6 -1
- package/views/dist/panels/react/toolbar/ToolbarSortPill.d.ts +5 -0
- package/views/dist/panels/react/toolbar/ToolbarSortPill.js +6 -4
- package/views/dist/panels/react/toolbar/ToolbarViews.d.ts +7 -1
- package/views/dist/panels/react/toolbar/ToolbarViews.js +4 -4
- package/views/dist/panels/react/toolbar/context.d.ts +4 -0
- package/views/dist/panels/react/toolbar/context.js +1 -0
- package/views/dist/panels/react/toolbar/sheet-host.d.ts +3 -0
- package/views/dist/panels/react/toolbar/sheet-host.js +6 -0
- package/views/dist/panels/react/toolbar/use-give-way.d.ts +6 -0
- package/views/dist/panels/react/toolbar/use-give-way.js +10 -3
- package/views/dist/panels/react/views-row/ViewPicker.d.ts +8 -1
- package/views/dist/panels/react/views-row/ViewPicker.js +12 -7
- package/views/dist/panels/settings/filter-groups.js +12 -0
- package/views/dist/panels/settings/input.d.ts +11 -0
- package/views/dist/panels/settings/layout.js +26 -0
- package/views/dist/panels/settings/person.d.ts +15 -0
- package/views/dist/panels/settings/person.js +6 -0
- package/views/dist/panels/toolbar/page-resets.js +14 -3
- package/views/dist/provider/components.d.ts +47 -4
- package/views/dist/react.d.ts +1 -1
- package/views/dist/styles.css +116 -257
- package/views/dist/styles.unlayered.css +116 -257
- package/views/docs/contract.md +28 -18
- package/views/docs/controls/field.md +2 -1
- package/views/docs/controls/filter-editor.md +1 -1
- package/views/docs/controls/menu.md +1 -1
- package/views/docs/controls/sort-editor.md +1 -1
- package/views/docs/guides/atoms.md +1 -0
- package/views/docs/guides/looks.md +1 -1
- package/views/docs/guides/the-grid.md +6 -4
- package/views/docs/guides/toolbar-parts.md +337 -0
- package/views/docs/index.md +4 -0
- package/views/docs/reference/controls.md +6 -44
- package/views/docs/reference/field-row.md +1 -1
- package/views/docs/reference/grid.md +8 -7
- package/views/docs/reference/list.md +184 -11
- package/views/docs/reference/looks.md +13 -16
- package/views/docs/reference/panels-react.md +7 -7
- package/views/docs/reference/panels.md +1 -1
- package/views/docs/reference/react.md +14 -11
- package/views/docs/reference/views.md +9 -7
- package/views/skills/views/SKILL.md +2 -1
- package/views/dist/controls/setting-row/looks.d.ts +0 -10
- package/views/dist/controls/setting-row/looks.js +0 -22
- package/views/dist/controls/setting-row/setting-row.d.ts +0 -102
- package/views/dist/controls/setting-row/setting-row.js +0 -135
- package/views/dist/controls/setting-row/tokens.d.ts +0 -156
- package/views/dist/controls/setting-row/tokens.js +0 -41
- package/views/dist/controls/setting-row.css +0 -216
- package/views/dist/controls/switch-row/switch-row.d.ts +0 -1
- package/views/dist/controls/switch-row/switch-row.js +0 -1
- package/views/dist/controls/switch-row/tokens.d.ts +0 -39
- package/views/dist/controls/switch-row/tokens.js +0 -12
- package/views/dist/controls/switch-row.css +0 -35
- package/views/dist/controls/tag-field/tag-field.d.ts +0 -24
- package/views/dist/controls/tag-field/tag-field.js +0 -25
- package/views/dist/controls/tag-field/tokens.d.ts +0 -23
- package/views/dist/controls/tag-field/tokens.js +0 -8
- package/views/dist/controls/tag-field.css +0 -32
- package/views/docs/controls/setting-row.md +0 -44
- package/views/docs/controls/switch-row.md +0 -15
- package/views/docs/controls/tag-field.md +0 -11
|
@@ -89,7 +89,8 @@ export function OrdersFromAnAction() {
|
|
|
89
89
|
- `views`: a `ViewsStore`, or `{ seed }` (your own views, read-only), `{ records }` (what the delete question calls the rows), `{ store }`.
|
|
90
90
|
- `defaults`: what a list with no saved view shows; by default the fields' columns over `LIST_SETTINGS_DEFAULTS`.
|
|
91
91
|
- `sortFilter` and `bar`: the toolbar's form on a computer, as `ListRoot` takes them.
|
|
92
|
-
- `
|
|
92
|
+
- `personSettings`: what the person may set in their own Customize, as `ListRoot` takes it ([The person's own toolbar](#the-persons-own-toolbar)).
|
|
93
|
+
- `menus`: every menu as data ([Menus as data](#menus-as-data)): `column`, `row`, `group`, `addColumn` and `figure` reach the grid, `view`, `add`, `more`, `customize`, `sortEditor`, `filterEditor` and `groupEditor` the toolbar.
|
|
93
94
|
- `toolbarParts`: where each of the toolbar's parts stands ([Parts as data](#parts-as-data)).
|
|
94
95
|
- `customizeIn`: where Customize opens on a computer (VK-1026). `"popover"`, the default, at its button. `"pane"`: in your map's `Pane` (`CONTROLS.Pane`), at the list's right edge under the toolbar and as tall as the grid, over its edge, the grid scrolling and taking presses beside it; the grid then stands in a box of its own, `data-slot="vk-list-box"` (positioned, a flex column that fills the list: give the list its height as a flex column), the Pane's. On a phone Customize keeps its Sheet. An app on `ListRoot` hands its own box to `ListToolbar` as `paneBox`.
|
|
95
96
|
- `link`: default `true`. The address carries the open view and what changed over it (`view`, `q`, `change`), written in place as it changes, your other parameters and history state kept; an opened link wins over the person's draft; back and forward open what the address says. A link it can't read is said through the toast. Two lists on one page share those parameters: hand the second `link={false}`.
|
|
@@ -98,7 +99,7 @@ export function OrdersFromAnAction() {
|
|
|
98
99
|
- `toolbar`, `grid` and `bulk`: any other prop of `ListToolbar`, `ListGrid` and `ListBulkBar`. A prop handed at the top wins over the same one in these; one not handed leaves theirs. `menus` merges key by key. A `grid.children` of your own (your own bar) stands where `ListBulkBar` would, and wins.
|
|
99
100
|
- `className`: on the `div` around the parts (`data-slot="vk-list"`). With `customizeIn: "pane"` the grid stands in a `div` of its own inside it (`data-slot="vk-list-box"`).
|
|
100
101
|
- A field its key can't bind (a writable `datetime`, whose editor needs your time zone) throws, naming the field: hand its binding in `columns` (`bind`).
|
|
101
|
-
- For another arrangement, write `ListRoot` with the same data props and place the parts yourself.
|
|
102
|
+
- For another arrangement, write `ListRoot` with the same data props and place the parts yourself ([The toolbar's parts](../guides/toolbar-parts.md): every part, its settings, how these props map onto them, and six layouts).
|
|
102
103
|
- `ListProps` — what `List` takes.
|
|
103
104
|
- `ListColumnOverride` — one column's change by its field's key: `width`, `header`, `hidden` (the column starts hidden in the defaults), `editable: false` (an edit only ever taken away), and `bind`, the field's binding where its key doesn't say (a `bindFields` spec: `read`, and `write` handing back `{ body }` or `{ skip, reason }`).
|
|
104
105
|
- `ListColumnsOverride` — the columns changed, by field key.
|
|
@@ -124,8 +125,8 @@ export function DealsList({ children }: { children: ReactNode }) {
|
|
|
124
125
|
```
|
|
125
126
|
|
|
126
127
|
- `ListRoot` — holds one list's state in a store outside React, for every part inside it, wherever it stands. It has two modes, fixed by its first render:
|
|
127
|
-
- **Yours (memory mode):** it takes `id`, and the list's settings and layer as you hold them: `settings`, `layer`, `onChange` and `onLayerChange`, exactly as `useListSettingsState` returns them, or your own saved view's. Optionally `view` (the shared view this list shows, a `CollectionViewState`), `sortFilter` and `bar` (as `ReadyToolbar` takes them).
|
|
128
|
-
- **Kept by ViewKit:** handed no `settings`, it keeps the list's saved views, the person's draft and their layer itself, through a `ViewsStore`: below, "A list's saved views". It takes `id`, and optionally `views`, `defaults`, `link`, `sortFilter` and `
|
|
128
|
+
- **Yours (memory mode):** it takes `id`, and the list's settings and layer as you hold them: `settings`, `layer`, `onChange` and `onLayerChange`, exactly as `useListSettingsState` returns them, or your own saved view's. Optionally `view` (the shared view this list shows, a `CollectionViewState`), `sortFilter` and `bar` (as `ReadyToolbar` takes them), and `personSettings` ([The person's own toolbar](#the-persons-own-toolbar)).
|
|
129
|
+
- **Kept by ViewKit:** handed no `settings`, it keeps the list's saved views, the person's draft and their layer itself, through a `ViewsStore`: below, "A list's saved views". It takes `id`, and optionally `views`, `defaults`, `link`, `sortFilter`, `bar` and `personSettings`. `link={true}` carries the open view in the address, as `List`'s `link` does; a `readListLink` reading is opened and never written. Either way the open view is kept on the device (`ports.viewPrefs`), opened again where no link names one.
|
|
129
130
|
- **A list's data, in either mode** (`ListData`): `fields` (its columns, and in store mode its defaults), `rows` (worked out as the settings ask, into `answer`) or `source` and `pageSize` (answered a page at a time), `quickFilters` (their hold narrows the rows, in memory and from a source), `columns`, `save` and `can`, as `List` takes them. A grid under the root (`ListGrid`) saves through `save`, and hands the root its undo, redo and edits.
|
|
130
131
|
- A change a part makes goes to your `onChange` or `onLayerChange`; your next `settings` and `layer` are what every part reads. A change you refuse never shows.
|
|
131
132
|
- One panel is open per root, whichever frame opened it: every `Toolbar` inside it, every frame of your own under a `ToolbarRadioProvider` and every part standing in no frame share the root's radio. Outside a root, each frame keeps its own. Two roots never close each other's panels.
|
|
@@ -149,7 +150,7 @@ export function DealsList({ children }: { children: ReactNode }) {
|
|
|
149
150
|
- `ListState` — one list's state, as a part selects it:
|
|
150
151
|
- `id`: the root's.
|
|
151
152
|
- `view`: `settings` (the view as the person edits it), `layer` (their own layer over it) and `shared` (the shared view, or `null`; kept by ViewKit, the open view, the person's own included).
|
|
152
|
-
- `panels`: `open` (the one open panel's key, or `null`), `pages` (each panel's page by its key), `held` (the filter rule held until whole), `barShown` (the filter bar shows), `footHere` (Clear and Save stand in Customize's foot: on a phone, and in Mihai's look beside the bar's own), `sortFilter` and `bar
|
|
153
|
+
- `panels`: `open` (the one open panel's key, or `null`), `pages` (each panel's page by its key), `held` (the filter rule held until whole), `barShown` (the filter bar shows), `footHere` (Clear and Save stand in Customize's foot: on a phone, and in Mihai's look beside the bar's own), `sortFilter` and `bar`, `personBar` and `personWords` (what `personSettings` turns on, as two flags), `placed` (what stands under the root, by key, counted: `ListToolbar` and `ListFilterBar` place `bar` while they draw a filter bar on a computer, `ListFilterBar` its own `list-filter-bar` too, and `list-filter-bar-button` or `list-filter-bar-always` as its own `shows` says, and each placed panel its button's key; on a phone each placed button `button:<name>` (`button:sort`, `button:filter`, `button:customize`, `button:quick`, `button:views`), the ready toolbar's too, so a placed panel of the same folds behind it), `barOpen` (the filter bar asked open by `ListSortFilter`: what `ListFilterBar shows="button"` reads), `shown` (a placed panel asked to stand by its button, by its key; apart from `open`, so a popover opening elsewhere leaves it standing) and `standing` (each placed panel standing now, by its key: `alone`, or `shown`, only because its button showed it). `ListToolbar` says `barShown` and `footHere` as it draws.
|
|
153
154
|
- `views`: the list's saved views where the root keeps them (a `ListViewsState`); `null` in memory mode.
|
|
154
155
|
- `columns`: the list's columns from its `fields`; `null` with none.
|
|
155
156
|
- `answer`: the rows the list shows (a `ListAnswerState`); `null` with no `fields`, or with neither `rows` nor a `source`.
|
|
@@ -158,13 +159,180 @@ export function DealsList({ children }: { children: ReactNode }) {
|
|
|
158
159
|
- `setSettings(change)` and `setLayer(patch)`: hand a change to the root's `onChange` and `onLayerChange`.
|
|
159
160
|
- `openPanel(key, page?)`: opens a panel and closes any other, on `page` where handed, else on the page it holds. `closePanel(key)`: closes it if it is the one open, forgetting its page. `setPage(key, page)`: a panel's page; set on a panel that isn't open, it waits for it, until another opens.
|
|
160
161
|
- `hold(rule)`: holds a filter rule until whole, or `null`.
|
|
162
|
+
- `place(key)`: counts one more of `key` as placed, and hands back the function that takes that one back, once. `setBarOpen(open)`: asks the filter bar open, or lets it go (`ListSortFilter`'s). `setShown(key, shown)`: asks a placed panel to stand, or lets it go (its button's). `stand(key, stands)`: a placed panel says whether it stands, `alone`, `shown` or `null` (the panels call it themselves).
|
|
161
163
|
- `select(ids)`: picks these rows; `select("all")` picks every matching row (from a source, it asks for their `ids` first, `all` and the total's `count` while they come); `select([])` picks none.
|
|
162
164
|
- `saveView()` and `resetView()`: the shared view's Save for everyone and Reset (kept by ViewKit, the open view's Save and Reset); nothing without one.
|
|
163
165
|
- `undo()` and `redo()`: take back the list's last edit, and put back the last one taken back, as ⌘Z and ⌘⇧Z do; nothing until there is one.
|
|
164
166
|
- `loadMore()` and `loadGroup(key)`: from a source, the next page, and a group's; nothing in memory, or while a newer request is out.
|
|
165
|
-
- `ListToolbar` — the ready toolbar's parts in their arrangements, reading the root around it: every `ReadyToolbar` prop but those the root holds. `ReadyToolbar` is a `ListRoot` holding no data around it. Place one per root: two would draw the same panels. Handed no `views` in a root that keeps its views, it draws the views row from them, its menu included; a new view takes one of its `layouts` (a table where none are handed).
|
|
167
|
+
- `ListToolbar` — the ready toolbar's parts in their arrangements, reading the root around it: every `ReadyToolbar` prop but those the root holds. `ReadyToolbar` is a `ListRoot` holding no data around it. Place one per root: two would draw the same panels. Handed no `views` in a root that keeps its views, it draws the views row from them, its menu included; a new view takes one of its `layouts` (a table where none are handed). It is put together from the parts below (`ListViews`, `ListCustomize`, `ListSort`, `ListFilter`, `ListQuickFilters`, `ListSearch`, `ListNew`, `ListFilterBar`'s pieces, `ListClearSave`): in the kit's arrangement each in a `ListLine`, a `ListGap` between each line's start and end; the row arrangement keeps its own frame. It draws as it always has, so a fix to a part reaches it; where it draws a part otherwise (its phone's and its bar form's Sort, Customize's foot, the quick filters' word, its hosts and its own panel keys) it says so to the part itself, never through your props. A part inside your own `toolbarParts` node is a placed part, keyed as one.
|
|
166
168
|
- `ListToolbarProps` — what `ListToolbar` takes: `ReadyToolbarProps` without `settings`, `layer`, `onChange`, `onLayerChange`, `view`, `sortFilter` and `bar`; `toolbarParts` among them ([Parts as data](#parts-as-data)). In a root that holds a list's `fields` and its `rows` or `source`, `columns`, `groupHeads` and `filterData` default to the root's; handed, yours win. With `customizeIn: "pane"`, hand `paneBox`, your box round the grid (positioned, never scrolling itself: a `div` your `ref` callback keeps in state), and Customize opens there in the Pane on a computer (VK-1026).
|
|
167
169
|
|
|
170
|
+
## A list's buttons, placed anywhere
|
|
171
|
+
|
|
172
|
+
```tsx
|
|
173
|
+
// With the imports above.
|
|
174
|
+
import type { ListRow } from "viewkitjs/fields/query";
|
|
175
|
+
import { ListCustomize, ListFill, ListFilter, ListGrid, ListNew, ListSearch, ListSlot, ListSort, ListViews, type ListFieldsRegistry } from "viewkitjs/views/list";
|
|
176
|
+
|
|
177
|
+
// Your page's header, outside the list's tree, and a line of your own inside it: each button reads the list around it.
|
|
178
|
+
export function DealsPage({ dealFields, deals, addDeal }: { dealFields: ListFieldsRegistry; deals: readonly ListRow[]; addDeal: () => void }) {
|
|
179
|
+
return (
|
|
180
|
+
<>
|
|
181
|
+
<header>
|
|
182
|
+
<h1>Deals</h1>
|
|
183
|
+
<ListSlot name="deals-header" />
|
|
184
|
+
</header>
|
|
185
|
+
<ListRoot id="deals" fields={dealFields} rows={deals}>
|
|
186
|
+
<ListFill name="deals-header">
|
|
187
|
+
<ListViews />
|
|
188
|
+
<ListSearch shows="input" />
|
|
189
|
+
<ListNew onAdd={addDeal} />
|
|
190
|
+
</ListFill>
|
|
191
|
+
<div className="my-line">
|
|
192
|
+
<ListSort />
|
|
193
|
+
<ListFilter empty="editor" />
|
|
194
|
+
<ListCustomize words="word" />
|
|
195
|
+
</div>
|
|
196
|
+
<ListGrid />
|
|
197
|
+
</ListRoot>
|
|
198
|
+
</>
|
|
199
|
+
);
|
|
200
|
+
}
|
|
201
|
+
```
|
|
202
|
+
|
|
203
|
+
The ready toolbar's buttons, each a part of its own (all of the parts on one page, with six layouts: [The toolbar's parts](../guides/toolbar-parts.md)): written anywhere under a `ListRoot`, or through a `ListFill` outside its tree, it reads and changes the list with nothing wired, as `ListToolbar`'s own button does. A part has no side and no line: it stands where you write it. Place each one once per root. Sort, Filter and Customize need a root holding the list's `fields`; without them they draw nothing.
|
|
204
|
+
|
|
205
|
+
- Each panel a button opens is its own in the root's radio (one panel open per root), under a key of its own, apart from `ListToolbar`'s, so a button placed beside the ready toolbar never opens with its twin: `list-sort`, `list-filter`, `list-customize` and `list-quick`, for your `openPanel(key)`.
|
|
206
|
+
- What a placed button doesn't take from `ListToolbar`: `hosts`; the Pane's box comes from `ListPaneBox`. The editors' menus as data come from a `ListEditorMenus` around it ([Menus as data](#menus-as-data)), a view's menu and the views' "+N" from `ListViews`' `menu` and `moreViews`, Customize's rows from `ListCustomize`'s `menu`. On a phone each keeps today's phone, wherever you place it (VK-1094): every button opens its panel in your map's Sheet, Sort the sort editor and Filter the filter editor as the ready toolbar's phone line does; `ListNew` is the round + at the list's foot (`data-at="foot"`, lifted by `--vk-toolbar-foot`), unless a `toolbarParts` place says `foot: false`; `ListClearSave` draws nothing, Clear and Save waiting in Customize's foot. A `ListLine` takes the phone's form there, so a phone layout of your own is written from the same parts. `ListToolbar` and `<List />` on a phone draw today's one line unchanged.
|
|
207
|
+
- `ListViews` — the root's saved views (or `views`, your own), Show counts the view's. `shows`: `tabs` (the default), each view a tab, or `button`, one button naming the open view and opening the rest (one axis; several still draw as tabs). `layouts`: what a new view takes one of. `menu`: a view's menu as data, as the ready toolbar's `menus.view`. `moreViews`: the views' "+N" as you draw it (`ToolbarMoreViews`), as the ready toolbar's `moreViews`. No "Edit view…" row, unlike the ready toolbar's.
|
|
208
|
+
- `ListViewsProps` — what `ListViews` takes: `views`, `layouts`, `shows`, `menu` and `moreViews`.
|
|
209
|
+
- `ListSearch` — the root's search. `shows`: `button` (the default), its glass opening a field, or `input`, standing as a field. `words` (its glass alone by default), `placeholder`, `searching`.
|
|
210
|
+
- `ListSearchProps` — what `ListSearch` takes.
|
|
211
|
+
- `ListSort` — the root's sort, as the ready toolbar's row Sort: lit while the sort differs, opening the sort editor while a rule stands and the fields while none does; a list with one sort rule, the one-rule Sort (lit while it differs too, which the ready toolbar's one-rule Sort isn't). `opens` (below), `empty`: `fields` (the default) or `editor`, the sort editor saying "No sorting set up yet" (`views.panels.sort-empty`) with Add sort, which stays open as its last rule goes. `words`.
|
|
212
|
+
- `ListSortProps` — what `ListSort` takes: `opens`, `empty` and `words`.
|
|
213
|
+
- `ListFilter` — the root's filter, as the ready toolbar's row Filter: lit while the filter differs, opening the view's filters, editable, Add filter under them, and the fields while none stands. `opens`, `empty` (`editor`: "No filtering set up yet", `views.panels.filter-empty`, with Add filter, staying open as its last rule goes), `words`. On a phone, Filter and its sheet.
|
|
214
|
+
- `ListFilterProps` — what `ListFilter` takes: `opens`, `empty` and `words`.
|
|
215
|
+
- `ListQuickFilters` — the quick filters the root was handed (`quickFilters`), their counts following Show counts; nothing without them. Its icon alone by default. `opens`, `words`.
|
|
216
|
+
- `ListQuickFiltersProps` — what `ListQuickFilters` takes: `opens` and `words`.
|
|
217
|
+
- `ListCustomize` — the root's Customize, its pages over the settings and the person's layer, its foot Reset and Save for everyone on a shared view, else the kit's Clear while the list differs. `opens`, `words`, and `viewName`, `onRenameView`, `onCopyLink`, `onExport`, `exportCount` and `fieldEditor`, as `ReadyToolbar` hands them. `menu`: Customize's rows as data (`ViewsCustomizeItems`), as the ready toolbar's `menus.customize`.
|
|
218
|
+
- `ListCustomizeProps` — what `ListCustomize` takes.
|
|
219
|
+
- `ListSortFilter` — Sort and filter (`views.panels.sort-filter`): one button showing and hiding the filter bar, lit and `aria-expanded` while the root's `panels.barOpen` holds it open; a press flips it (`setBarOpen`). `ListFilterBar shows="button"` stands while it does; with no such bar it changes nothing in the list. Not `sortFilter`, which says where the ready toolbar stands its sort and Filter (`right` or `bar`). `words`.
|
|
220
|
+
- `ListSortFilterProps` — what `ListSortFilter` takes: `words`.
|
|
221
|
+
- `ListClearSave` — Clear and Save while the list differs from its view: Clear back to the view as saved (or the list's default, the person's layer emptied), Save where the view can be saved; nothing while it doesn't differ.
|
|
222
|
+
- `ListClearSaveProps` — what `ListClearSave` takes: nothing.
|
|
223
|
+
- `ListNew` — New: `onAdd` (one way to add) or `items` (several, as a menu), `label`, `words`. Hand it one or the other: alone it draws a button that does nothing.
|
|
224
|
+
- `ListNewProps` — what `ListNew` takes.
|
|
225
|
+
- `ListOpens` — where a button's panel opens: `popover` (the default, at its button), `pane` (your map's `Pane`, at the right edge of the root's `ListPaneBox`, the grid in use beside it; with no box or no `Pane`, the popover), `sheet` (your map's `Sheet`, on a computer too), or a function, your own: ViewKit draws the button alone and calls it with the button on a press, opening nothing. `ListSort` and `ListFilter` also take `bar`: the fields every time, a picked rule standing on the filter bar placed under the root (`ListToolbar`'s, while it draws one: `panels.placed.bar`), which opens its value; with no bar placed, the popover, said once in development at its press. With a `ListFilterBar shows="button"` placed, a press asks that bar open too (`setBarOpen`); with only `ListToolbar`'s bar, Sort and filter stays as it is. An app that leaves the bar's filters out of `ListToolbar`'s `toolbarParts` still counts its bar as placed.
|
|
226
|
+
- `ListWords` — a button's words: `both` (its icon and its word), `icon` (its icon alone) or `word` (its word alone). Each part's default is today's: Search and Quick filters their icon alone, the rest both.
|
|
227
|
+
- `ListPaneBox` — the box where a placed button's Pane stands: put it round your grid under the root. It draws a `div` (`data-slot="vk-list-box"`, positioned, its own stack, a flex column filling its place), the ready `List`'s own box with `customizeIn="pane"`; your `className` joins it. Place one per root: a second would take the Pane from the first. Outside a `ListRoot`, it throws.
|
|
228
|
+
- `ListPaneBoxProps` — what `ListPaneBox` takes: `className` and `children`.
|
|
229
|
+
- A button whose panel is placed under the root (below) opens no popover: it shows the panel, points to it, or hides it.
|
|
230
|
+
|
|
231
|
+
## A list's panels, placed anywhere
|
|
232
|
+
|
|
233
|
+
```tsx
|
|
234
|
+
// With the imports above.
|
|
235
|
+
import { ListFilterBar, ListFilterPanel, ListSortFilter, ListViewsPanel } from "viewkitjs/views/list";
|
|
236
|
+
|
|
237
|
+
// The views in your app's sidebar, the filter panel in a column beside the table, the filter bar behind Sort and filter, its
|
|
238
|
+
// sorts edited right on it: each panel stands where you write it.
|
|
239
|
+
export function DealsWithPanels({ dealFields, deals }: { dealFields: ListFieldsRegistry; deals: readonly ListRow[] }) {
|
|
240
|
+
return (
|
|
241
|
+
<div className="my-app">
|
|
242
|
+
<nav className="my-sidebar">
|
|
243
|
+
<ListSlot name="deals-nav" />
|
|
244
|
+
</nav>
|
|
245
|
+
<ListRoot id="deals" fields={dealFields} rows={deals}>
|
|
246
|
+
<ListFill name="deals-nav">
|
|
247
|
+
<ListViewsPanel />
|
|
248
|
+
</ListFill>
|
|
249
|
+
<div className="my-line">
|
|
250
|
+
<ListViews shows="button" />
|
|
251
|
+
<ListFilter />
|
|
252
|
+
<ListSortFilter />
|
|
253
|
+
</div>
|
|
254
|
+
<ListFilterBar shows="button" sorts="yes" />
|
|
255
|
+
<div className="my-row">
|
|
256
|
+
<ListGrid />
|
|
257
|
+
<aside className="my-column">
|
|
258
|
+
<ListFilterPanel />
|
|
259
|
+
</aside>
|
|
260
|
+
</div>
|
|
261
|
+
</ListRoot>
|
|
262
|
+
</div>
|
|
263
|
+
);
|
|
264
|
+
}
|
|
265
|
+
```
|
|
266
|
+
|
|
267
|
+
The ready toolbar's panels, each a part of its own: written anywhere under a `ListRoot`, or through a `ListFill`, it stands open there, reading and changing the list as its button's popover does. Each stands in a region of its own (`role="region"`, named, `data-slot="vk-list-panel"`); your layout gives it its room. Place each one once per root: a panel says whether it stands by its key, one per key.
|
|
268
|
+
|
|
269
|
+
- When a panel stands, its `shows` (`ListPanelShows`): `always`, standing open (every panel's default but the filter bar's); `filled`, once it holds something (the filter bar's default, the ready toolbar's "once added"; the filter bar, the filter panel and the sort panel take it); `button`, while its button shows it, with a ✕ that lets it go. A panel shown by its button stays as a popover opens elsewhere: one popover is open per root, but a standing panel is part of the page. Gone from the page, its button's ask to show it goes too.
|
|
270
|
+
- Its button, placed under the same root, shows that panel instead of opening a popover: a press shows it (a panel that doesn't stand), points to it (the focus moves into it and it scrolls into view, for a panel standing on its own), or hides it (a panel standing only because the button showed it); `aria-expanded` while it stands. `ListViews` does so only with `shows="button"`: its tabs open nothing. `ListToolbar`'s own buttons don't see placed panels yet.
|
|
271
|
+
- A panel that can't draw (a root with no `fields`, no quick filters, no saved views, no and/or groups) draws nothing and places nothing, so its button opens its popover as before.
|
|
272
|
+
- On a phone a placed panel folds behind its button (VK-1094): while a button of the same stands under the root (a placed `ListSort`, `ListFilter`, `ListCustomize`, `ListQuickFilters` or `ListViews`, or `ListToolbar`'s own), the panel isn't placed and draws nothing, and the button opens it as a sheet (`ListViews shows="button"` its own list). With no such button under the root it keeps standing, so a phone layout of your own may stand one. A column you keep for it is yours to hide while it is empty (`:empty`). `ListFilterBar` draws nothing on a phone, as the bar's filters don't (Filter's sheet edits there).
|
|
273
|
+
- `ListViewsPanel` — the views as a standing list, as a sidebar's nav: your map's `ViewsListBody` (the one the view picker opens), a pick opening the view, New view, reordering and a view's verbs as the views hand them. `views` (your own, else the root's saved views), `layouts`, `shows` (`always` or `button`), `className`.
|
|
274
|
+
- `ListViewsPanelProps` — what `ListViewsPanel` takes.
|
|
275
|
+
- `ListFilterPanel` — the filter standing: every rule editable, Add filter under them, "No filtering set up yet" with nothing set. `shows` (`filled`: once a filter stands or a rule is held), `className`. Placed, `ListFilter` shows or points to it.
|
|
276
|
+
- `ListFilterPanelProps` — what `ListFilterPanel` takes.
|
|
277
|
+
- `ListSortPanel` — the sort standing: every rule editable, Add sort under them, "No sorting set up yet" with nothing set. `shows` (`filled`: once a rule stands), `className`. Placed, `ListSort` shows or points to it. Nothing without several sorts.
|
|
278
|
+
- `ListSortPanelProps` — what `ListSortPanel` takes.
|
|
279
|
+
- `ListQuickFiltersPanel` — the quick filters the root was handed, standing, their counts following Show counts, under their own head. `shows` (`always` or `button`), `className`. Placed, `ListQuickFilters` shows or points to it.
|
|
280
|
+
- `ListQuickFiltersPanelProps` — what `ListQuickFiltersPanel` takes.
|
|
281
|
+
- `ListCustomizePanel` — Customize standing, its own head, its pages and foot as `ListCustomize`'s. `shows` (`always` or `button`), `className`, and `viewName`, `onRenameView`, `onCopyLink`, `onExport`, `exportCount` and `fieldEditor`, as `ListCustomize` takes them. Placed, `ListCustomize` shows or points to it.
|
|
282
|
+
- `ListCustomizePanelProps` — what `ListCustomizePanel` takes.
|
|
283
|
+
- `ListFilterBar` — the filter bar: the standing rules, each edited right where it stands, and its +, as the ready toolbar's bar draws them (the sort on the bar, a separator, the filters), in a wrapping line of its own (`role="region"` named "Sort and filter", `data-slot="vk-list-filter-bar"`). `shows`: `filled` (the default: a filter standing beyond the saved view's own, a rule held, or its sort drawn; a saved filter taken away, or a second axis of views, doesn't bring it: `ListClearSave` and `ListViews` are their own parts), `always` (its empty Filter with nothing set) or `button` (while `ListSortFilter` holds it open). Where `personSettings.bar` is on, the person's own pick stands over `filled` and `always` ([The person's own toolbar](#the-persons-own-toolbar)). `sorts`: `no` (the default, the sort pill while the sort differs) or `yes`, each sort rule standing on the bar as its field, its direction and ×, edited in place, and + (Add sort, with its word, while none stands): the field and + open the fields, on the menu's surface, and no sort editor opens; a list without several sorts keeps `no`'s one-rule sort. It places `bar` (a button's `opens="bar"` adds its rule here) and `list-filter-bar`: while it is placed, `ListToolbar` leaves the filters to it, so one bar edits per root. In the ready toolbar's default form its bar keeps only its stacked views and Clear and Save, and stands only for those; with `sortFilter="bar"` its line keeps its Sort and Filter alone. A rule held for the bar until whole (a yes/no, a related record's field, picked from a Filter with `opens="bar"` or the bar's +) stands on this bar, which with `shows="button"` opens for it while it is hidden; a Filter with its own panel holds the rule in its editor. Written in a `ListLine`, its pieces stand as the line's items (no region), its filters folding into "+N filters" as the line narrows; outside one they wrap and never fold, and `className` goes on the region. Nothing without the root's fields or and/or groups.
|
|
284
|
+
- `ListFilterBarProps` — what `ListFilterBar` takes: `shows`, `sorts` and `className`.
|
|
285
|
+
- `ListPanelShows` — when a placed panel stands: `always`, `filled` or `button`.
|
|
286
|
+
|
|
287
|
+
## A list's lines
|
|
288
|
+
|
|
289
|
+
```tsx
|
|
290
|
+
// With the imports above.
|
|
291
|
+
import { ListClearSave, ListGap, ListLine } from "viewkitjs/views/list";
|
|
292
|
+
|
|
293
|
+
// Lines of your own from the toolbar's parts: each in the order you write it, a gap pushing what follows it to the line's end,
|
|
294
|
+
// folding as the ready toolbar's line folds as it narrows.
|
|
295
|
+
export function DealsWithLines({ dealFields, deals }: { dealFields: ListFieldsRegistry; deals: readonly ListRow[] }) {
|
|
296
|
+
return (
|
|
297
|
+
<ListRoot id="deals" fields={dealFields} rows={deals}>
|
|
298
|
+
<ListLine>
|
|
299
|
+
<ListSort />
|
|
300
|
+
<ListFilter />
|
|
301
|
+
<ListGap />
|
|
302
|
+
<ListCustomize />
|
|
303
|
+
<ListSearch />
|
|
304
|
+
<ListNew onAdd={() => {}} />
|
|
305
|
+
</ListLine>
|
|
306
|
+
<ListLine kind="bar">
|
|
307
|
+
<ListFilterBar />
|
|
308
|
+
<ListGap />
|
|
309
|
+
<ListClearSave />
|
|
310
|
+
</ListLine>
|
|
311
|
+
<ListGrid />
|
|
312
|
+
</ListRoot>
|
|
313
|
+
);
|
|
314
|
+
}
|
|
315
|
+
```
|
|
316
|
+
|
|
317
|
+
A line of your own, written with the toolbar's parts under a `ListRoot` (or through a `ListFill`): it stands them in the order you write them and folds them as the ready toolbar's line folds as it narrows. No part has a start or an end of its own: its place is its position, and a gap does the pushing.
|
|
318
|
+
|
|
319
|
+
- `ListLine` — a toolbar line (`role="toolbar"`, `data-slot="vk-toolbar-line"`). `kind`: `row` (the default: a toolbar row, its buttons full size, named "List tools") or `bar` (a filter bar's line, a step smaller, named "Sort and filters"); `className`. What stands before its first `ListGap` is its start, what follows it its end: what opens from the end hangs toward it. A line with no gap is all start, and a second gap is room too, nothing more. As it narrows it folds from its end, in today's order: each part that has words turns to its icon, then the views' tabs fold into "+N" (the open one never), then the filter bar's filters into "+N filters", then each part that may fold goes into ⋯, which stands after the last folded part and lists them in the line's order, each row doing what the part's press does. Your own nodes and the panels written in a line stand as written and never fold. While none of its parts draws anything (a bar's `ListFilterBar` with nothing standing and `ListClearSave` with nothing to clear), the line takes no room, as the ready toolbar draws no bar at rest, and it stands again as soon as one does; your own node or text in it keeps it standing. ⋯ stays one element as the parts change, open while the part it stood after goes. On a phone, off the provider's desktop query, a line takes the phone's form (VK-1094): no band, its parts opening sheets, a `ListNew` in it at the list's foot, its search opening across the line. The server draws its computer form, as it draws every placed part.
|
|
320
|
+
- `ListLineProps` — what `ListLine` takes: `kind`, `className`, `children`; `more`, ⋯'s rows as data (`ToolbarMore`: handed the folded parts' rows, each keyed by its part, and `{ line }`, `row` or `bar` as its `kind`, it hands back the rows ⋯ shows), as the ready toolbar's `menus.more`; `overflow`, ⋯ as you draw it (`ToolbarOverflow`), as the ready toolbar's `overflow`.
|
|
321
|
+
- `ListGap` — empty room: in a line it pushes what follows it to the line's end (the first one splitting the line's start from its end); anywhere else, the same room in a row of your own (a page header). As many as you like.
|
|
322
|
+
- `ListGapProps` — what `ListGap` takes: nothing.
|
|
323
|
+
- How each part folds in a line, keyed as the ready toolbar keys it (`data-toolbar-item`): `ListViews` (`views`, its tabs into "+N", one axis as tabs), `ListCustomize` (`options`), `ListSort` (`sort`), `ListFilter` (`filter-add`; `filter` on a phone or without and/or groups), `ListQuickFilters` (`quick`) and `ListSortFilter` (`sort-filter`) give up their words, then fold into ⋯; `ListNew` (`new`) gives up its words; `ListSearch` (`search`) is the line's search; `ListClearSave` (`save`) never folds; `ListFilterBar` stands its pieces (`sort-pill`, `sep`, `filters`).
|
|
324
|
+
- Every part placed under one root reads one model of the list, built once for each change of what it reads, whatever the number of parts.
|
|
325
|
+
|
|
326
|
+
## The person's own toolbar
|
|
327
|
+
|
|
328
|
+
Where you let them, a person picks two things about the toolbar in their own Customize, kept in their layer (`ListPersonalLayer.toolbar`) beside their widths, folds and look, never in the shared view (VK-1095). Where its parts sit stays yours.
|
|
329
|
+
|
|
330
|
+
- The switch, `personSettings` on `List` and `ListRoot`: `{ bar?: boolean; words?: boolean }`, each off by default. With neither, Customize and the toolbar are as they always were, whatever the person's layer holds.
|
|
331
|
+
- Its `bar`: Customize's Layout page offers **Filter bar** (`choice:bar`): Once added (`added`) or Always (`always`). The pick stands over the ready toolbar's `bar` and over a placed `ListFilterBar`'s `shows` where that is `filled` or `always`; a bar written `shows="button"` keeps its button, and while one is placed the row is left out. Before the person picks, the row reads a placed bar's own `shows`, else the toolbar's `bar`. A computer's alone: a phone draws no filter bar, so its Layout has no such row and its Reset leaves the pick.
|
|
332
|
+
- Its `words`: Layout offers **Button words** (`choice:words`): Icon and word (`both`), Icon (`icon`) or Word (`word`), on a computer and a phone. It stands over every toolbar button's own words under the root, as you placed them (`words` on a part, a `toolbarParts` place): with `both`, a button you placed as its icon draws its word too. A button with no word of its own (the search's, the quick filters') stays its icon. Before the person picks, it reads Icon and word.
|
|
333
|
+
- Both are written by `onLayerChange` alone and never change the view. Customize's first page's Reset (Clear, with no saved view) empties them with the rest of the layer, and Layout's own Reset takes back the ones the person can set there; a layer key the switch doesn't turn on counts for neither.
|
|
334
|
+
- An app that keeps the layer in its own storage keeps `toolbar` with it; a reader on an older ViewKit refuses a layer holding it (its schema is strict), so take this release everywhere a layer is read before turning either on.
|
|
335
|
+
|
|
168
336
|
## A list's saved views
|
|
169
337
|
|
|
170
338
|
```tsx
|
|
@@ -227,6 +395,9 @@ Your app's own store implements `ViewsStore` over its API, a server checking eac
|
|
|
227
395
|
|
|
228
396
|
Each of a list's menus below hands you its default items as data, and draws the items your function hands back: drop a row, rename it, move it, add your own, or draw a row's inside yourself.
|
|
229
397
|
|
|
398
|
+
- `ListEditorMenus` — the editors' menus as data for every part under it: `sortEditor`, `filterEditor` and `groupEditor`, as the ready toolbar's `menus` names them, reaching a placed Sort's, Filter's and Customize's editors, the placed panels' and the filter bar's own sort rules (`sorts="yes"`: each pill's ×, VK-1107). Each it hands takes over that editor from an outer one; the rest stay the outer's. `ListToolbar` stands its own `menus` in one, over yours.
|
|
399
|
+
- `ListEditorMenusProps` — what `ListEditorMenus` takes: `sortEditor`, `filterEditor`, `groupEditor`, `children`.
|
|
400
|
+
|
|
230
401
|
```tsx
|
|
231
402
|
import { GridTable, type GridTableProps } from "viewkitjs/views/grid";
|
|
232
403
|
import { menu, type ListMenus } from "viewkitjs/views/list";
|
|
@@ -270,6 +441,7 @@ const filterEditor: ListMenus<Deal>["filterEditor"] = (items, ctx) =>
|
|
|
270
441
|
- `more(items, { line })`: ⋯, the folded parts' rows, each keyed by its part. Each line folds into its own ⋯, so it is handed which: `"row"` or `"bar"` (the filter bar). A press on any row closes ⋯ first.
|
|
271
442
|
- `customize(items, { page, form, layout })`: Customize's rows (VK-1062), each page's handed in turn: `page` is `"list"` (its sections, a list's per-field filters unless they fold behind Filter, where they aren't handed, and its toggles), `"layout"` (Layout's page: the layout's own settings, under the layout cards, which are your `layouts`) or `"columns"` (Columns' page: none of its own, as the columns are the view's, set by your columns' `hideable` and `fixed`; the rows you hand draw after the columns, before your field editor's rows). Its items are `ViewsCustomizeItem`s ([`/react`](./react.md)): a row keyed by one of Customize's own (below) is ViewKit's row, opening its page, its choices or its field as before, with your item's words, icon, value (`detail`), mark (`inForce`) and divider; its own `onSelect` and `checked` are set aside. A section's rows are always the item's `children`, so `menu.drop` and `menu.add` reach inside it; a section handed back with none draws nothing. Any other key is your row: `checked` with `onSelect` a check, `onSelect` an action (`destructive` drawn as danger), `children` a section of your own, and on the list `page` a page of your own, opened by its row, titled by its `label`, with Back (a function is handed Back, so the page can close itself); the page's place is told as `page:<key>` and held across a change of form. `disabled` draws a row that can't be used, saying `disabledReason`, else "Not available" (`views.panels.customize-unavailable`), and opens nothing. A page whose row you drop, disable or hand back as a section doesn't open, its layout button goes with Layout's row, and a screen whose row goes while it stands is the list again. `beside`, `keepOpen`, `href`, `render` and `shortcut` are set aside here. Layout's and Columns' rows are asked only while their page stands. An app's own `CustomizeBody` is handed the function as `items`; the older popover route (`ViewOptionsPopoverPanel`) hands none.
|
|
272
443
|
- `sortEditor(items, ctx)`, `filterEditor(items, ctx)`, `groupEditor(items, ctx)` (VK-1063): the editors' menus, wherever the toolbar draws them (its Sort and Filter panels, Customize's Sort, Filter and Group pages; the toolbar's Group has no panel of its own, so `groupEditor` reaches Customize's Group page). `ctx.menu` says which: the sort editor's `rule` (a rule's ⋯, on a phone and in the narrow form: a computer's rule has × and no ⋯) and `aside` (a set-aside rule's ⋯); the filter editor's `rule`, `aside` and `group` (a group's actions); the group editor's `settings` and `foot` (Remove grouping). The groups themselves (each group's row) are the list's values, not reshaped. `ctx` names a rule in your terms only, `field` across the three: the sort's key (on `aside`, the rule's stored `fieldKey`), or the filter's `fieldKey` with its `part` and `relation`, and a filter rule or group by its `path` in the filter (`[]` the whole filter, indices through `items` and a relation rule's `where.items`) (the `ViewsSortEditorItemsContext`, `ViewsFilterEditorItemsContext` and `ViewsGroupEditorItemsContext` of [`/react`](./react.md)). A row keyed by one of the menu's own (below) is ViewKit's row with your words and icon, its own `onSelect` set aside; `disabled` greys it, saying `disabledReason`. A default ViewKit doesn't offer this time (Put back while it doesn't fit) draws nothing. The filter's any/none/every is one item, `relation` (its label `views.panels.filter-relation-rows`, "Which related records"), its choices its `children` (`relation:any`, `relation:none`, `relation:every`; the choices' own `data-key` stays `any`, `none`, `every`): drop one, rename one, or hand back none to drop the choice. Any other key is your row: an action (`destructive` drawn as danger), a check (`checked` with `onSelect`) or a group of rows, drawn with the menu's own slot (`vk-sort-rule-action`, `vk-filter-rule-action`, `vk-filter-group-action`, the group editor's `vk-group-row`). No line stands first, last or twice in a row. `beside`, `keepOpen`, `href`, `render`, `shortcut` and `detail` are set aside here. An app with its own toolbar frame (`ToolbarSlotProvider`) can't hand these yet: draw a `SortBody` or `FilterBody` of your own that hands `CONTROLS`' its `items`.
|
|
444
|
+
- The sort and filter editors' rule ends and feet (VK-1065), through the same `sortEditor` and `filterEditor`: `ctx.menu` `row`, the buttons a rule ends in (the sort's × on a computer, its ⋯ on a phone, in the narrow form and on a set-aside rule; the filter's ⋮, or ⋯ on a phone), and `foot`, the buttons at a foot (Add sort and Clear; Add filter, Clear, a group's or a relation's Delete, and the ⋮ of a group or of a filter that may exclude). `ctx` names a sort rule by its `field` and `index` (`aside: true`, and no `index`, on a set-aside rule), a filter rule as `rule` does (with `aside: true` on a set-aside one), and a filter's foot by its group's `path` (`[]` the filter's own); the sort's foot is `{ menu: "foot" }`. A row keyed by one of the place's own (below) is ViewKit's button with your words (a text button's text, an icon button's name), your icon (on ×, Add sort and Add filter; ⋯, ⋮ and the words buttons keep their own) and your greying (`disabled`, saying `disabledReason`, else its own reason, else its words); its own `onSelect` is set aside, and one ViewKit greys this time (Add sort at the most, Add filter on a relation the list no longer lists) is handed to you already `disabled` with its reason. A default ViewKit doesn't offer this time (Clear with nothing to clear, Add sort where what holds the editor has its own +) draws nothing. Any other key is your button, quiet, at the place's size: with an `icon`, an icon button named by its `label`; without, its words; `disabled` greys it, saying why; drawn as `data-slot` `vk-sort-row-action`, `vk-sort-foot-action`, `vk-filter-row-action` or `vk-filter-foot-action`, with `data-key` its key. Only plain actions: `children`, `checked`, `beside`, `keepOpen`, `href`, `render`, `shortcut`, `detail`, `destructive` and `separatorBefore` are set aside here. A rule's boxes, its grip, Where and the joins are not data: rename them through the messages. The sort's × and its ⋯'s Delete share the key `delete`, so `menu.drop(items, "delete")` over every `ctx` makes a rule unremovable in the editor in every form; a function that drops `delete` (or `more`, `add`, `clear`) without checking `ctx.menu` reaches these buttons too, and one that adds or renames rows without checking it now adds a button at every rule's end and foot, or renames each rule's ×: check `ctx.menu`. The sort editor's foot on a computer, handed back nothing, isn't drawn; the filter editor's feet stand, empty. The filter bar's sort pills (`ListFilterBar sorts="yes"`, VK-1107) are reached as the editor's rows: each pill's × is handed as `delete` with `{ menu: "row", field, index, form: "computer", place: "bar" }`, so dropping `delete` takes the × off the pill too; your own item draws as one more part of the pill (its icon alone, named by its label, else its words), the pill's last part its end; the field and the direction stay the pill's.
|
|
273
445
|
- `List` takes `menus` whole and hands each part its own: `GridTable` (and `ListGrid`) takes `column`, `row`, `group` and `addColumn` as `menus` ([`/grid`](./grid.md)), and `ReadyToolbar` and `ListToolbar` take `view`, `add`, `more`, `customize`, `sortEditor`, `filterEditor` and `groupEditor` as `menus` ([`/panels/react`](./panels-react.md)).
|
|
274
446
|
- A menu ViewKit doesn't open stays closed: ⋯ stands only while a part has folded, whatever `more` adds, and New stays a button while `add` hands back its one `new` row. A menu ViewKit opens stays openable: a function that returns `[]` opens an empty menu, so drop what you don't want rather than everything.
|
|
275
447
|
- Each function is called as ViewKit draws (`view` on every toolbar render, the rest as their menus draw): keep it pure and cheap, and call no hooks in it. `row` alone may answer later, with a promise, asked once per opening.
|
|
@@ -285,17 +457,18 @@ const filterEditor: ListMenus<Deal>["filterEditor"] = (items, ctx) =>
|
|
|
285
457
|
|
|
286
458
|
### Default keys
|
|
287
459
|
|
|
288
|
-
Every default row's key is a public name: your function finds rows by it. A key that ends in a value is written here with that value as `<…>`.
|
|
460
|
+
Every default row's key is a public name: your function finds rows by it, and every row ViewKit's own `Menu` draws carries it as `data-key`, for a stylesheet. A key that ends in a value is written here with that value as `<…>`.
|
|
289
461
|
|
|
290
462
|
- A column's menu: `sort-asc`, `sort-desc`, and on a place column `sort-asc:<part>` and `sort-desc:<part>` under them; `sort-clear`; `group-by`, `ungroup`; `percent-display` and `percent-display:<display>`; `date-format` and `date-format:<style>`; `show-time`; `duration-format` and `duration-format:<style>`; `decimals` and `decimals:<decimals>` (`decimals:auto` the field's own); `currency` and `currency:<code>`; `colour:<value>`, under it `colour:<value>:auto` and `colour:<value>:<colour>`, and `colours-reset`; `move-left`, `move-right`; `hide-column`. Your `columnMenuItems` rows keep their keys.
|
|
291
463
|
- "+ Add column": `add:<id>` for each hidden column, `field:<id>` for a field with parts (its level, holding its own `add:<id>` rows), and `all-shown`, the one greyed row when nothing is hidden.
|
|
464
|
+
- A footer cell's calculation picker (`figure`, the grid's `menus`): its figures, `none`, `count` (the first column alone), `empty`, `filled`, `percentEmpty`, `percentFilled`, `sum`, `avg`, `min`, `max`, `ratio`, as the column offers them.
|
|
292
465
|
- A group band's ⋯: `group-select`; `group-sort` and `group-sort:<value>`; `group-show` and `group-show:<part>`; `group-hide`.
|
|
293
466
|
- A row's menu: `copy`, `cut`, `paste`, `clear`; `row-select`; `action:<id>` for each of a name column's actions. Your `contextMenu` rows keep their keys, or are keyed by their words. With `row`, also `row-open` (first) and `row-delete` (last), and `row-waiting`, the greyed row drawn while a promise from `row` waits (never handed to `row`).
|
|
294
467
|
- A view's menu, from the axis's verbs: `rename`, `edit`, `private`, `save`, `reset`, `save-new`, `copy-link`, `favorite`, `duplicate`, `delete`; on a phone `save`, `reset` and `save-new` are under `unsaved`, and `private` and `edit` under `this-view`. A view's own rows keep their keys, `edit-view` (Edit view…) at the head of the open view's.
|
|
295
468
|
- New: your `addItems`' keys, or `new`.
|
|
296
|
-
- Customize (`customize`): on its list `layout`, `columns`, `filter`, `sort`, `group`; a per-field filter `field:<key>` and a section of them `fields:<section>` (not handed while they fold behind Filter); a toggle `toggle:<key>` (`toggle:show_counts`; Show counts from the view, with no toggles handed, `toggle:counts`) and a section of toggles `toggles:<section>`. On Layout's page a pick-one setting `choice:<key
|
|
297
|
-
- The sort editor (`sortEditor`): a rule's ⋯ `delete`; a set-aside rule's `why`, `put-back`, `delete`.
|
|
298
|
-
- The filter editor (`filterEditor`): a rule's ⋮ `convert`, `relation` (with `relation:any`, `relation:none`, `relation:every`), `delete`; a set-aside rule's `why`, `put-back`, `delete`; a group's `exclude
|
|
469
|
+
- Customize (`customize`): on its list `layout`, `columns`, `filter`, `sort`, `group`; a per-field filter `field:<key>` and a section of them `fields:<section>` (not handed while they fold behind Filter); a toggle `toggle:<key>` (`toggle:show_counts`; Show counts from the view, with no toggles handed, `toggle:counts`) and a section of toggles `toggles:<section>`. On Layout's page a pick-one setting `choice:<key>` (the person's own toolbar rows `choice:bar` and `choice:words`, where `personSettings` turns them on), a toggle `toggle:<key>` and a section `toggles:<section>` (with no settings handed, a table's `toggle:freeze` and `toggle:wrap`, from the kit's own `Customize` alone). Columns' page has none. A section's key is its heading's words, so a translated heading is another key, and one heading names one section (a heading among the filter fields and again after Group shares one key: handed any function, the second goes). A `fields:` or `toggles:` key handed back with no rows draws nothing. Your rows draw as `data-slot="vk-customize-row"`, a page of yours as `vk-customize-page`, each with `data-key` its key; ViewKit's rows keep their own names (`vk-customize-section`, `-field`, `-toggle`, `-choice`).
|
|
470
|
+
- The sort editor (`sortEditor`): a rule's ⋯ `delete`; a set-aside rule's `why`, `put-back`, `delete`; a rule's end (`row`) `delete` (×, a computer's) and `more` (⋯); its foot (`foot`) `add`, `clear`.
|
|
471
|
+
- The filter editor (`filterEditor`): a rule's ⋮ `convert`, `relation` (with `relation:any`, `relation:none`, `relation:every`), `delete`; a set-aside rule's `why`, `put-back`, `delete`; a group's `exclude`; a rule's end (`row`) `more` (⋮); a foot (`foot`) `add`, `clear`, `delete` (Delete group, or a relation's Delete condition), `more` (a group's ⋮, or the ⋮ of a filter that may exclude).
|
|
299
472
|
- The group editor (`groupEditor`): its settings `field`, `order`, `direction`, `step`, `empty`; its foot `remove`.
|
|
300
473
|
- ⋯: the folded parts' keys: `options`, `sort`, `filter`, `filters`, `filter-add`, `quick`.
|
|
301
474
|
|
|
@@ -340,7 +513,7 @@ export function DealsToolbar(props: ReadyToolbarProps<Deal>) {
|
|
|
340
513
|
- `key`: the part's public name: `views` (and `views-stacked`, a second axis of views on the bar), `options` (Customize), `search`, `sort` (on the row, or the bar's sort in the old form), `sort-pill` (the bar's sort in Mihai's look with `bar: "always"`), `filter` and `filter-add` (Filter), `filters` (the filters on the bar), `advanced-filters`, `sep` (the bar's separator), `quick`, `new`, `clear` and `save` (the bar's Clear and Save, handed side by side: back side by side, `clear` first, on one line and side, they draw as one item, as they always stood; parted, reordered or with one left out, each draws on its own where you place it).
|
|
341
514
|
- `line`: `"row"`, `"bar"` (the filter bar; in the `row` arrangement, the line below the row) or `"foot"` (a kit phone list's foot, New's place; anywhere else it means the row). On a kit phone the row and the bar are one line, so `"bar"` stands a part on it too, and New stands on the line once you place it anywhere but `"foot"`.
|
|
342
515
|
- `side`: `"start"` or `"end"`.
|
|
343
|
-
- `words`: `"both"`, as the look's words say (icon and word where the buttons on the right show theirs), `"icon"`, its icon alone whatever the look, or `"word"`, its word alone, no icon, whatever the look. It means something for a part whose button has an icon and a word: `search`, `quick`, `sort`, `filter`, `filter-add`, `options`, `new`. The search and, in Mihai's look, the quick filters' button are handed `"icon"`, as they always stood; placed `"both"`, they read their word and give it up first as the line narrows, as Sort and Filter do. Placed `"word"`, every button of the part that has a word draws it with no icon (your `ToolbarButton` handed `icon: null` and the word as its `children`), and never gives it up as the line narrows: the part folds into ⋯ instead. A button whose glyph is its word (Sort's +, the bar's +) and New's round + at a phone list's foot keep their glyph; a button with no icon (Clear, Save) keeps its words.
|
|
516
|
+
- `words`: `"both"`, as the look's words say (icon and word where the buttons on the right show theirs), `"icon"`, its icon alone whatever the look, or `"word"`, its word alone, no icon, whatever the look. It means something for a part whose button has an icon and a word: `search`, `quick`, `sort`, `filter`, `filter-add`, `options`, `new`. The search and, in Mihai's look, the quick filters' button are handed `"icon"`, as they always stood; placed `"both"`, they read their word and give it up first as the line narrows, as Sort and Filter do. Placed `"word"`, every button of the part that has a word draws it with no icon (your `ToolbarButton` handed `icon: null` and the word as its `children`), and never gives it up as the line narrows: the part folds into ⋯ instead. A button whose glyph is its word (Sort's +, the bar's +) and New's round + at a phone list's foot keep their glyph; a button with no icon (Clear, Save) keeps its words. Where `personSettings.words` is on, the person's own pick stands over each place's `words` ([The person's own toolbar](#the-persons-own-toolbar)).
|
|
344
517
|
- `node`: a part of your own, under a key of your own, drawn where you place it (it doesn't fold into ⋯). `menu.add` places it. The keys above are the toolbar's, even while a part of theirs isn't handed: don't name your own part by one.
|
|
345
518
|
- `className`: put on every toolbar button the part draws (each handed its `part`, [Default keys](#default-keys)'s table), on the button itself, through your `ToolbarButton` (ViewKit's own puts it on its `<button>`, `CONTROL_ATOMS`' on the toolbar button or New's `Button`).
|
|
346
519
|
- `panel`: where what it opens hangs at its button, `{ side?, align?, offset? }` (`ToolbarPanelPlace`), your `Popover`'s `side`, `align` and `sideOffset`: `{ align: "start" }` opens Sort's panel from its button's start wherever Sort stands. Absent, a part on its line's end side opens its panel aligned to its button's end and one on its start side to its start, 8 px below it; a host of yours (`hosts`) or a phone's sheet takes none of it.
|
|
@@ -4,7 +4,7 @@ Import from `viewkitjs/views/looks` to pick a piece's look by name: each piece's
|
|
|
4
4
|
|
|
5
5
|
## The shape
|
|
6
6
|
|
|
7
|
-
- `PieceLooks` — a piece's options and looks: `id` (the piece's, the middle of its attributes' names), `name`, `options` (`LookOption`s, in the order a picker shows them) and `looks` (`Look`s, each picking every option, or only those its second type names, `PieceLooks<Id, Picked>`, the rest an app's own say). Nothing picked wears each option's `def`,
|
|
7
|
+
- `PieceLooks` — a piece's options and looks: `id` (the piece's, the middle of its attributes' names), `name`, `options` (`LookOption`s, in the order a picker shows them) and `looks` (`Look`s, each picking every option, or only those its second type names, `PieceLooks<Id, Picked>`, the rest an app's own say). Nothing picked wears each option's `def`, ViewKit's own, which no look need match whole.
|
|
8
8
|
- `LookOption` — one option: `id`, `name`, `def` (the value worn when nothing is picked, or when the pick is a value it doesn't have), `values` (`LookValue`s), and optionally `device` (a `LookDevice`), `kind` (`"steps"` for an ordered scale, `"list"` for a long list), `unless` (an option and a value, or several, under which this one means nothing) and `demo: false` (it changes nothing a whole list draws, so a list-wide picker may leave it out).
|
|
9
9
|
- `LookValue` — one value an option can hold: `id` and `name`.
|
|
10
10
|
- `Look` — a named set of picks: `id`, `name`, `picks` (one value for every option) and optionally `device`.
|
|
@@ -70,7 +70,7 @@ on a frame round the controls as `data-<piece>-*`, which each control's styleshe
|
|
|
70
70
|
- `attioBox` — `attioBox(phone)`: the labelled box's own look, its computer form keeping its own size on a phone.
|
|
71
71
|
- `INLINE_INPUT_LOOKS` — the inline input's: 4 options (`edge`, `corners` from `none` to `full`, `ground`, `tint` from 10% to 100% under the tint ground) and three looks, `attio`, `mihais` (named Outright) and `tinted`. Nothing picked is the line, `md` corners, on a 20% tint, which no look matches.
|
|
72
72
|
- `InlineInputLookOptionId` — its option ids.
|
|
73
|
-
- `FIELD_LOOKS` — Field rows', the phone's: 5 options (`rows-cards`, `rows-edge`, `rows-height`, `rows-label`, `rows-lines`) and three looks, `card` (every option's default), `each` and `rows`; and a computer's field row's: `row-icon` (`on`, `off`), every look keeping it on: off (`data-field-row-icon="off"` on a section or any ancestor), each row draws its label, value and lane with no type icon, the label at the row's start; and `row-box` (`target`, `box`), every look keeping today's `target`: box (`data-field-row-box="box"`), a computer's row draws one rectangle for its hover, its press, its in-place text and number input and the place a picker opens from, so its words never move and it keeps its height, no press scale; in a narrow window, outside a card, the stacked row takes the same box at rest, hovered and pressed, and its editor stays the phone's (`--vk-field-row-box-h`, `-x`, `-r`, docs/contract.md); and `row-action` (`none`, `icon`), every look keeping today's `none`: icon (`data-field-row-action="icon"`), a row outside a card shows one icon at its box's right end on the box's hover and keyboard focus, saying what a click does: `edit` where its editor opens in a popover (a select, a person, a date, several values), `expand` for a long text or a rich text, and none where the box is the input (a text, a number, one link); a binding's `action` says otherwise for its field. The icon is your `icons.edit` or `icons.expand`, 15 in a 24 square 4 in from the box's end, and the box keeps its room at its end, so a value ends there (cut with its "…" on one line) and the words never move. The lock, ⋯ and › stay in the row's lane.
|
|
73
|
+
- `FIELD_LOOKS` — Field rows', the phone's: 5 options (`rows-cards`, `rows-edge`, `rows-height`, `rows-label`, `rows-lines`) and three phone looks, `card` (every option's default), `each` and `rows`; one look worn on both, `attio`, below; and a computer's field row's: `row-icon` (`on`, `off`), every look keeping it on: off (`data-field-row-icon="off"` on a section or any ancestor), each row draws its label, value and lane with no type icon, the label at the row's start; and `row-box` (`target`, `box`), every look keeping today's `target`: box (`data-field-row-box="box"`), a computer's row draws one rectangle for its hover, its press, its in-place text and number input and the place a picker opens from, so its words never move and it keeps its height, no press scale; in a narrow window, outside a card, the stacked row takes the same box at rest, hovered and pressed, and its editor stays the phone's (`--vk-field-row-box-h`, `-x`, `-r`, docs/contract.md); and `row-action` (`none`, `icon`), every look keeping today's `none`: icon (`data-field-row-action="icon"`), a row outside a card shows one icon at its box's right end on the box's hover and keyboard focus, saying what a click does: `edit` where its editor opens in a popover (a select, a person, a date, several values), `expand` for a long text or a rich text, and none where the box is the input (a text, a number, one link); a binding's `action` says otherwise for its field. The icon is your `icons.edit` or `icons.expand`, 15 in a 24 square 4 in from the box's end, and the box keeps its room at its end, so a value ends there (cut with its "…" on one line) and the words never move. The lock, ⋯ and › stay in the row's lane. And `row-open` (`below`, `over`), every look keeping today's `below`: over (`data-field-row-open="over"`), on a computer every popover editor a row opens (a select, a status, a person or a record, a date, tags, a place, a name, a range, several values) stands on top of the row's box, its first line (the search, the typed date, the first value, the first box) where the value's words were, at least as wide as the box and covering it, nothing under it moving; a phone keeps its sheets (docs/contract.md, the Popover). And `row-long` (`full`, `line`), every look keeping today's `full`: line (`data-field-row-long="line"`), a row outside a card draws a writable long text or rich text as one line at rest, its end fading (never "…"), and a writable text that would wrap as one line ending in "…", so it keeps its height as it is typed in; on a computer a long text's editor opens on top of the row's box, a textarea in your `Popover` placed as `row-open: over` places a body whatever that option says, its first line where the words were, growing down over the rows below to `--vk-editor-max-h` (undeclared, 320), then scrolling, nothing under it moving; a phone keeps its box in place, and a read-only long text reads in full. And `row-link` (`beside`, `words`), every look keeping today's `beside`: words (`data-field-row-link="words"`), a writable row outside a Field rows card on a phone holding one url, email, phone or domain draws its words as the link itself (a url in a new page, an email a mail, a phone a call), and a press on the rest of its box edits it in place; the open action beside the box isn't drawn, the box (its edit button, named by the field alone) is one Tab stop and the link the next, and under `row-action: icon` its icon is `edit`; the pointer on the words keeps the box's hover and its icon (the hover ground ViewKit's own Button reads, `--button-ground`; an app's own Button shows its hover past the words). The row reads the option once it stands on the page, so a server-rendered row draws `beside` until it is alive. Under either, a long link wraps, or ends in its "…" on one line, before what stands at its box's end. And the look `attio` picks Attio's record rows whole: the card's own picks (`one`, `on`, `52`, `104`, `words`) and `row-icon: off`, `row-box: box`, `row-action: icon`, `row-open: over`, `row-long: line`, `row-link: words`. Every other look keeps today's row. An app wears it with one call on the frame round its rows, its Details section say, so every record drawer and record page changes together: `<section {...lookAttrs(FIELD_LOOKS, lookPicks(FIELD_LOOKS, "attio"))}>` (both from `viewkitjs/views/looks`). On a phone a Field rows card keeps its rows and every picker its sheet; outside a card the stacked row takes the box, the long text's one line and the link's words. Under `row-open: over` the row hands your `Popover` the offsets that put it on top of the box (a negative `sideOffset`, an `alignOffset`, and a `minWidth` in its `style`), so your own Popover passes them on to stand there.
|
|
74
74
|
- `FieldLookOptionId` — its option ids.
|
|
75
75
|
- `FieldRowsLook` — a card's own look, each option without its `rows-`.
|
|
76
76
|
- `fieldRowsAttrs` — `fieldRowsAttrs(look)`: a card's own look as its attributes.
|
|
@@ -91,9 +91,6 @@ on a frame round the controls as `data-<piece>-*`, which each control's styleshe
|
|
|
91
91
|
- `StatusLookOptionId` — the Status's option ids.
|
|
92
92
|
- `SWITCH_LOOKS` — the Switch's: 4 options (`shape` a computer's, `phone` a phone's, `mark`, `motion`) and five looks, `slim`, `capsule`, `thin`, `hairline` and `classic`.
|
|
93
93
|
- `SwitchLookOptionId` — the Switch's option ids.
|
|
94
|
-
- `SETTING_ROW_LOOKS` — the setting row's: 3 options, two a computer's (`card`, `outlined` or `raised` (the default); `rows`, `snug` or `roomy` (the default), 64 tall) and one a phone's (`icon`, `line` (the default), the glyph alone, or `tile`, a white glyph on a tile of the row's `colour`), and two looks, `outright` (`outlined`, `snug`, `line`: the SwitchRows as they were) and `attio` (`raised`, `roomy`, `line`: every option's default).
|
|
95
|
-
- `SettingRowOptionId` — its option ids.
|
|
96
|
-
- `SettingRowPicks` — one value for each.
|
|
97
94
|
- `MENU_LIST_LOOKS` — the menu list's, each a phone's: 6 options (`rows`, what its rows stand on; `lines`; `height`, a scale from `48` to `56`; `corners`, a scale from `lg` to `2xl`; `close`, a Close row; `tiles`) and five looks, `stack`, `card`, `plain`, `joined` and `words`, which pick the first four and leave the Close row and the tiles to the app.
|
|
98
95
|
- `MenuListLookOptionId` — the menu list's option ids.
|
|
99
96
|
|
|
@@ -101,29 +98,29 @@ on a frame round the controls as `data-<piece>-*`, which each control's styleshe
|
|
|
101
98
|
|
|
102
99
|
- `LIST_LOOKS` — the list's, every list that floats (the Select's, the Menu's panel, the Picker on a computer): 9 options (`smoothing`; `edge`; `shadow`, a scale from `none` to `xl`; `padding`, from `0` to `8`; `rows`, a computer's row height from `28` to `40`; `highlight`; `intensity`, from `1` to `3`; `row-corners`, from `input` to `full`; `dividers`) and no looks.
|
|
103
100
|
- `ListOptionId` — the list's option ids.
|
|
104
|
-
- `PICKER_LOOKS` — the Picker's: 9 options (`search`; `picked`, `create`, `doing`, `heading` and `face` a computer's; `mark`; `line`; `kind`) and two looks, `attio` (Attio's picks) and `mihai` (named Outright); with nothing picked, a second line below, the list's message at the start and a face of 24 (
|
|
101
|
+
- `PICKER_LOOKS` — the Picker's: 9 options (`search`; `picked`, `create`, `doing`, `heading` and `face` a computer's; `mark`; `line`; `kind`) and two looks, `attio` (Attio's picks) and `mihai` (named Outright); with nothing picked, a second line below, the list's message at the start and a face of 24 (ViewKit's own).
|
|
105
102
|
- `PickerOptionId` — the Picker's option ids.
|
|
106
103
|
- `AVATAR_LOOKS` — the Avatar's: 5 options and no looks. For its squares, `corners` (a scale from `small` to `xlarge`) and `smoothing`; for a record's mark, a person's or a thing's handed its object's `icon` with no picture, `mark` (`icon` or `initials`), `ground` (`quiet`, `grey`, `outline` or `colour`, the object's colour) and `icon-colour` (`grey` or `colour`). An Avatar handed no icon draws its letters as before.
|
|
107
104
|
- `AvatarLookOptionId` — the Avatar's option ids.
|
|
108
|
-
- `MENU_LIST_CARD_FRAME` — the menu list's options as a frame's data attributes, the Stack look's (Card rows, inset lines, 52, xl): a piece whose menu lists are no menu's own sheet (a panel's settings, a list of people) puts it round them, and keeps them whatever the app picks, since with nothing picked a menu's own sheet draws
|
|
105
|
+
- `MENU_LIST_CARD_FRAME` — the menu list's options as a frame's data attributes, the Stack look's (Card rows, inset lines, 52, xl): a piece whose menu lists are no menu's own sheet (a panel's settings, a list of people) puts it round them, and keeps them whatever the app picks, since with nothing picked a menu's own sheet draws the Words and the nearest frame wins.
|
|
109
106
|
|
|
110
107
|
<!-- The panels' block: the Pane, the toolbar button, the Radio, the sort editor, the views list, the filter editor, the group editor, Customize, the Modal, the alert dialog, the Toast, the Collapsible, the Alert, the Notice -->
|
|
111
108
|
|
|
112
|
-
- `PANE_LOOKS` — the Pane's: 7 options, each a computer's (`place`, `list` or `fit`; `corners`, `lg`, `xl` or `2xl`; `smoothing`, `round` or `smooth`; `shadow`, `none`, `menu`, `lg` or `xl`; `edge`, `outline`, `subtle` or `none`; `gap`, `0` to `16`, `8` the default
|
|
109
|
+
- `PANE_LOOKS` — the Pane's: 7 options, each a computer's (`place`, `list` or `fit`; `corners`, `lg`, `xl` or `2xl`; `smoothing`, `round` or `smooth`; `shadow`, `none`, `menu`, `lg` or `xl`; `edge`, `outline`, `subtle` or `none`; `gap`, `0` to `16`, `8` the default; `padding`, `0` to `16`), and no looks.
|
|
113
110
|
- `PaneOptionId` — its option ids.
|
|
114
|
-
- `TOOLBAR_BUTTON_LOOKS` — the toolbar button's: 10 options, a computer's `ground` (`ghost`, `bordered` the default, `filled`), `words` (`both` the default, `icon`, `word`), `size` (`28`, `32` the default, `36`) and `corners` (`button` the default, the Button's, then `xs` to `full`); a phone's `groundphone` (`filled` the default), `wordsphone` (`icon` the default, `both`), `sizephone` (`36` the default, `44`) and `cornersphone` (`full` the default); and on both `smoothing` (`app` the default, `smooth`, `round`) and `weight` (`button` the default, `medium`, `semibold`). Every default is
|
|
111
|
+
- `TOOLBAR_BUTTON_LOOKS` — the toolbar button's: 10 options, a computer's `ground` (`ghost`, `bordered` the default, `filled`), `words` (`both` the default, `icon`, `word`), `size` (`28`, `32` the default, `36`) and `corners` (`button` the default, the Button's, then `xs` to `full`); a phone's `groundphone` (`filled` the default), `wordsphone` (`icon` the default, `both`), `sizephone` (`36` the default, `44`) and `cornersphone` (`full` the default); and on both `smoothing` (`app` the default, `smooth`, `round`) and `weight` (`button` the default, `medium`, `semibold`). Every default is ViewKit's own. 2 looks: `attio`, every default, and `portal`, ghost with its icon alone.
|
|
115
112
|
- `ToolbarButtonOptionId` — its option ids.
|
|
116
|
-
- `VIEWS_LIST_LOOKS` — the views list's: 2 options (`private`, Private views: Shared and Just me, a private view's lock, and a view's menu's Private view; `favorites`, a view's menu's Favorite), each `off` (the default
|
|
113
|
+
- `VIEWS_LIST_LOOKS` — the views list's: 2 options (`private`, Private views: Shared and Just me, a private view's lock, and a view's menu's Private view; `favorites`, a view's menu's Favorite), each `off` (the default) or `on`, and no looks.
|
|
117
114
|
- `ViewsListOptionId` — its option ids.
|
|
118
|
-
- `CUSTOMIZE_LOOKS` — Customize's: 2 options (`head`, Its head: `title`, a title (the default
|
|
115
|
+
- `CUSTOMIZE_LOOKS` — Customize's: 2 options (`head`, Its head: `title`, a title (the default), or `name`, the view's name renamed in place; `columns`, Columns: `switch`, Switches (the default), or `eye`, Eyes), for a computer and a phone alike, and no looks.
|
|
119
116
|
- `CustomizeOptionId` — its option ids.
|
|
120
117
|
- `MODAL_LOOKS` — the Modal's: 12 options, each a computer's (`edge`, `lines`, `buttons`, `head`, `size`, `corners`, `smoothing`, `padding`, `behind`, `strength`, `blur`, `shadow`), and two looks, `framed` (every option's default) and `outlined`.
|
|
121
118
|
- `ModalOptionId` — its option ids.
|
|
122
|
-
- `ALERT_DIALOG_LOOKS` — the alert dialog's: 11 options (`close`, the X, a phone's; `padding`; `behind`, `dim` or `veil`; `strength`; `blur`, a computer's, and `blurphone`; `shadow`, a computer's, and `shadowphone`; `margin`, a phone's; `corners`; `smoothing`, `round` or `smooth` (the default
|
|
119
|
+
- `ALERT_DIALOG_LOOKS` — the alert dialog's: 11 options (`close`, the X, a phone's; `padding`; `behind`, `dim` or `veil`; `strength`; `blur`, a computer's, and `blurphone`; `shadow`, a computer's, and `shadowphone`; `margin`, a phone's; `corners`; `smoothing`, `round` or `smooth` (the default)), and no looks.
|
|
123
120
|
- `AlertDialogOptionId` — its option ids.
|
|
124
|
-
- `COLLAPSIBLE_LOOKS` — the Collapsible's: 2 options (`content`, `still`, `fade` (the default
|
|
121
|
+
- `COLLAPSIBLE_LOOKS` — the Collapsible's: 2 options (`content`, `still`, `fade` (the default) or `slide`: how what it holds comes and goes; `curve`, `soft` or `sharp`), and no looks.
|
|
125
122
|
- `CollapsibleOptionId` — its option ids.
|
|
126
|
-
- `ALERT_LOOKS` — the Alert's: 5 options (`buttons`, `end` (the default
|
|
123
|
+
- `ALERT_LOOKS` — the Alert's: 5 options (`buttons`, `end` (the default) or `full`, a computer's; `size`, `32`, `36` or `44`, a computer's; `pair`, `side` or `stacked`, a phone's; `mark`, `none` or `shown`; `phone`, `panel` or `sheet`, what it opens as on a phone) and three looks, `even`, `plain` and `marked`.
|
|
127
124
|
- `AlertOptionId` — its option ids.
|
|
128
125
|
|
|
129
126
|
<!-- The toolbar's block: the quick filters (VK-724), the Toolbar (VK-858), the bulk bar (VK-725) -->
|
|
@@ -133,7 +130,7 @@ on a frame round the controls as `data-<piece>-*`, which each control's styleshe
|
|
|
133
130
|
- `TOOLBAR_LOOKS` — the Toolbar's: 14 options, a computer's ten (`search`, `button` or `input`; `words`, `icon` or `both`; `sortfilter`, `bar` or `right`; `settings`, `beside` or `right`; `bar`, `always` or `added`; `lines`, `across` or `none`; `save`, `bar` or `settings`; `add`, `primary`, `primary-icon`, `outline`, `outline-icon`, `like` or `like-icon`; `views`, `button` or `tabs`; `tabs`, `ghost`, `bordered` or `filled`), two for both (`sortfilterat`, `bar`, `pane` or `both`; `quick`, `none` or `button`) and a phone's two (`searchphone`, `button` or `line`; `sortfilterphone`, `beside` or `right`); and four looks, `mihai`, named Outright (every option's default: one row at rest, the sort and Filter on its right with their words, the filter bar once a filter is added, the quick filters' button), `attio`, `attio-right` and `portal`.
|
|
134
131
|
- `ToolbarOptionId` — its option ids.
|
|
135
132
|
- `ToolbarPicks` — one value for every option.
|
|
136
|
-
- `BULK_BAR_LOOKS` — the bulk bar's: 3 options (`delete`, `more` (the default
|
|
133
|
+
- `BULK_BAR_LOOKS` — the bulk bar's: 3 options (`delete`, `more` (the default) or `own`; `phone`, `tray` (the default) or `pill`, a phone's; `picked`, `plain` (the default) or `ground`, a phone's, which the list holding it reads for its picked rows) and one look, `attio` (every option's default).
|
|
137
134
|
- `BulkBarOptionId` — its option ids.
|
|
138
135
|
- `BulkBarPicks` — one value for every option.
|
|
139
136
|
|
|
@@ -152,7 +149,7 @@ on a frame round the controls as `data-<piece>-*`, which each control's styleshe
|
|
|
152
149
|
|
|
153
150
|
## The grid's
|
|
154
151
|
|
|
155
|
-
- `GRID_LOOKS` — the grid's options and looks: 27 options (`header`, `lines`, `columns`, `density`, `phone`, `name`, `edge`, `boxes`, `icon`, `picked`, `cell`, `corners`, `hover`, `highlight`, `frame`, `groups`, `names`, `phones`, `typed`, `figures`, `offer`, `width`, `more`, `wait`, `foot`, `add`, `picking`) and two looks, `attio` and `portal` (ViewKit's own grid, as the portal draws it). Every default is
|
|
152
|
+
- `GRID_LOOKS` — the grid's options and looks: 27 options (`header`, `lines`, `columns`, `density`, `phone`, `name`, `edge`, `boxes`, `icon`, `picked`, `cell`, `corners`, `hover`, `highlight`, `frame`, `groups`, `names`, `phones`, `typed`, `figures`, `offer`, `width`, `more`, `wait`, `foot`, `add`, `picking`) and two looks, `attio` and `portal` (ViewKit's own grid, as the portal draws it). Every default is ViewKit's own, which differs from `attio` in ten options (`columns` `all`, `edge` `line`, `boxes` `always`, `picked` `line`, `corners` `round`, `hover` `strong`, `groups` `titles`, `names` `hover`, `phones` `text`, `figures` `word`). `highlight` (Row highlight: `hover`, the default, or `active`, the active row alone, `GridTable`'s `rowHighlight`) and `offer` (Add calculation: `hover`, the default, or `always`, every empty footer cell's offer shown at rest) are `hover` in both looks.
|
|
156
153
|
- `GridLookOptionId` — the grid's option ids.
|
|
157
154
|
- `GridLookWorn` — what the grid's code reads of its options: `columns`, `density`, `phone`, `name`, `boxes`, `icon`, `groups`, `figures`, `width`, `more`, `wait`, `foot`, `add`, `picking` and `highlight`. The others are its look stylesheet's alone, `viewkitjs/views/grid.css`.
|
|
158
155
|
- `GRID_LOOK_READ` — those fifteen option ids, in that order. Twelve reach `GridTable` through `gridLookProps`; `more`, `figures` and `wait` the app wires itself (the [guide](../guides/looks.md)).
|