viewkitjs 0.35.0 → 0.37.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 +112 -0
- package/MIGRATION.md +7 -0
- package/package.json +1 -1
- package/views/dist/atoms/types.d.ts +32 -4
- package/views/dist/contract.d.ts +32 -9
- package/views/dist/contract.js +35 -1
- package/views/dist/controls/avatar/avatar.d.ts +3 -1
- package/views/dist/controls/avatar/avatar.js +2 -2
- package/views/dist/controls/button/own-look-moved.d.ts +11 -0
- package/views/dist/controls/button/own-look-moved.js +3 -0
- package/views/dist/controls/compound-editor/map-parts-body.js +2 -0
- package/views/dist/controls/compound-editor/name-parts.js +1 -1
- package/views/dist/controls/compound-editor/place-parts.js +1 -1
- package/views/dist/controls/compound-editor/range-parts.js +1 -1
- package/views/dist/controls/compound-editor/words.d.ts +3 -0
- package/views/dist/controls/compound-editor/words.js +2 -0
- package/views/dist/controls/customize/customize.d.ts +10 -3
- package/views/dist/controls/customize/customize.js +147 -63
- package/views/dist/controls/customize/items.d.ts +49 -0
- package/views/dist/controls/customize/items.js +104 -0
- package/views/dist/controls/customize/map-customize-body.js +7 -4
- package/views/dist/controls/customize/words.d.ts +2 -0
- package/views/dist/controls/customize/words.js +1 -0
- package/views/dist/controls/date-editor/date-behaviour.d.ts +80 -0
- package/views/dist/controls/date-editor/date-behaviour.js +187 -0
- package/views/dist/controls/date-editor/date-editor.d.ts +3 -2
- package/views/dist/controls/date-editor/date-editor.js +29 -166
- package/views/dist/controls/field/field.d.ts +3 -2
- package/views/dist/controls/field/field.js +7 -2
- package/views/dist/controls/field/looks.d.ts +1 -1
- package/views/dist/controls/field/looks.js +5 -4
- package/views/dist/controls/field.css +4 -0
- package/views/dist/controls/filter-editor/block.js +5 -2
- package/views/dist/controls/filter-editor/filter-editor.d.ts +14 -1
- package/views/dist/controls/filter-editor/filter-editor.js +21 -13
- package/views/dist/controls/filter-editor/map-filter-body.d.ts +3 -2
- package/views/dist/controls/filter-editor/map-filter-body.js +16 -2
- package/views/dist/controls/filter-editor/map-rules.d.ts +9 -2
- package/views/dist/controls/filter-editor/map-rules.js +18 -13
- package/views/dist/controls/filter-editor/parts.d.ts +2 -0
- package/views/dist/controls/filter-editor/parts.js +13 -12
- package/views/dist/controls/filter-editor/rules.d.ts +4 -4
- package/views/dist/controls/filter-editor/rules.js +6 -3
- package/views/dist/controls/filter-editor/words.d.ts +2 -0
- package/views/dist/controls/filter-editor/words.js +1 -0
- package/views/dist/controls/group-editor/group-editor.d.ts +3 -0
- package/views/dist/controls/group-editor/group-editor.js +21 -15
- package/views/dist/controls/group-editor/map-group-body.js +1 -0
- package/views/dist/controls/index.d.ts +4 -2
- package/views/dist/controls/index.js +3 -1
- package/views/dist/controls/inline-input.css +9 -0
- package/views/dist/controls/internal/kit-words.d.ts +11 -0
- package/views/dist/controls/internal/kit-words.js +7 -0
- package/views/dist/controls/internal/map-panel-controls.d.ts +4 -1
- package/views/dist/controls/internal/map-panel-controls.js +14 -1
- package/views/dist/controls/internal/menu-items.d.ts +9 -0
- package/views/dist/controls/internal/menu-items.js +97 -0
- package/views/dist/controls/internal/panel-controls.js +1 -1
- package/views/dist/controls/internal/phone.d.ts +1 -1
- package/views/dist/controls/internal/phone.js +3 -2
- package/views/dist/controls/list/tokens.d.ts +1 -1
- package/views/dist/controls/list/tokens.js +1 -1
- package/views/dist/controls/list.css +5 -2
- package/views/dist/controls/menu/menu.d.ts +1 -1
- package/views/dist/controls/menu/menu.js +1 -1
- package/views/dist/controls/menu-list/menu-list.js +3 -2
- package/views/dist/controls/menu.css +4 -4
- package/views/dist/controls/number-editor/map-number-body.js +2 -0
- package/views/dist/controls/number-editor/number-editor.js +1 -1
- package/views/dist/controls/number-editor/words.d.ts +3 -0
- package/views/dist/controls/number-editor/words.js +2 -0
- package/views/dist/controls/pane.css +1 -1
- package/views/dist/controls/picker/fields-frame.d.ts +5 -0
- package/views/dist/controls/picker/fields-frame.js +30 -0
- package/views/dist/controls/picker/map-fields-body.js +3 -26
- package/views/dist/controls/picker/map-picker.d.ts +2 -1
- package/views/dist/controls/picker/map-picker.js +4 -2
- package/views/dist/controls/picker/picker.js +9 -2
- package/views/dist/controls/picker/rows.d.ts +3 -1
- package/views/dist/controls/picker.css +7 -3
- package/views/dist/controls/popover/looks.d.ts +1 -1
- package/views/dist/controls/popover/looks.js +5 -0
- package/views/dist/controls/popover/tokens.d.ts +13 -1
- package/views/dist/controls/popover/tokens.js +4 -1
- package/views/dist/controls/popover.css +59 -8
- package/views/dist/controls/select/map-select.d.ts +1 -1
- package/views/dist/controls/select/map-select.js +4 -1
- package/views/dist/controls/select/select.d.ts +2 -0
- package/views/dist/controls/select/select.js +4 -2
- package/views/dist/controls/sheet/bottom-sheet.d.ts +6 -1
- package/views/dist/controls/sheet/bottom-sheet.js +3 -3
- package/views/dist/controls/sort-editor/map-sort-body.js +1 -0
- package/views/dist/controls/sort-editor/sort-editor.d.ts +3 -1
- package/views/dist/controls/sort-editor/sort-editor.js +6 -4
- package/views/dist/controls/sort-editor.css +4 -2
- package/views/dist/controls/tag/tag.js +4 -2
- package/views/dist/controls/text-editor/map-text-body.js +4 -1
- package/views/dist/controls/text-editor/text-editor.js +2 -2
- package/views/dist/controls/text-editor/words.d.ts +3 -0
- package/views/dist/controls/text-editor/words.js +1 -1
- package/views/dist/controls/text-editor.css +6 -0
- package/views/dist/controls/toolbar/toolbar.d.ts +12 -4
- package/views/dist/controls/toolbar/toolbar.js +7 -2
- package/views/dist/controls/toolbar-button/atom-toolbar-button.js +1 -1
- package/views/dist/controls/toolbar.css +5 -0
- package/views/dist/controls/tooltip/tokens.d.ts +1 -1
- package/views/dist/controls/tooltip/tokens.js +1 -1
- package/views/dist/controls/tooltip.css +5 -3
- package/views/dist/controls/values-editor.css +20 -5
- package/views/dist/controls/views-list/map-views-list-body.js +9 -1
- package/views/dist/controls/views-list/rules.d.ts +1 -0
- package/views/dist/controls/views-list/rules.js +2 -2
- package/views/dist/controls/views-list/view-menu.js +2 -2
- package/views/dist/controls/views-list/words.d.ts +4 -0
- package/views/dist/controls/views-list/words.js +2 -1
- package/views/dist/display/entity-chip.d.ts +7 -1
- package/views/dist/display/entity-chip.js +2 -1
- package/views/dist/display/option-badges.d.ts +3 -2
- package/views/dist/display/option-badges.js +2 -2
- package/views/dist/field-row/FieldRow.js +12 -8
- package/views/dist/grid/chrome/GridAddColumn.d.ts +7 -2
- package/views/dist/grid/chrome/GridAddColumn.js +5 -4
- package/views/dist/grid/chrome/GridCellEditors.d.ts +4 -1
- package/views/dist/grid/chrome/GridCellEditors.js +3 -2
- package/views/dist/grid/chrome/GridCellOutline.d.ts +3 -5
- package/views/dist/grid/chrome/GridCellOutline.js +3 -5
- package/views/dist/grid/chrome/GridChipsEditor.js +1 -1
- package/views/dist/grid/chrome/GridDateEditor.d.ts +1 -1
- package/views/dist/grid/chrome/GridDateEditor.js +1 -1
- package/views/dist/grid/chrome/GridHeader.js +3 -1
- package/views/dist/grid/chrome/GridLongTextEditor.d.ts +1 -1
- package/views/dist/grid/chrome/GridLongTextEditor.js +8 -5
- package/views/dist/grid/chrome/GridNameEditor.d.ts +1 -1
- package/views/dist/grid/chrome/GridNameEditor.js +1 -1
- package/views/dist/grid/chrome/GridNumberEditor.d.ts +1 -1
- package/views/dist/grid/chrome/GridNumberEditor.js +2 -2
- package/views/dist/grid/chrome/GridPlaceEditor.d.ts +1 -1
- package/views/dist/grid/chrome/GridPlaceEditor.js +1 -1
- package/views/dist/grid/chrome/GridRangeEditor.d.ts +2 -2
- package/views/dist/grid/chrome/GridRangeEditor.js +1 -1
- package/views/dist/grid/chrome/GridRelationEditor.js +2 -2
- package/views/dist/grid/chrome/GridRow.js +7 -1
- package/views/dist/grid/chrome/GridRowCells.js +6 -5
- package/views/dist/grid/chrome/GridSelectEditor.js +1 -1
- package/views/dist/grid/chrome/GridTable.d.ts +2 -1
- package/views/dist/grid/chrome/GridTable.js +7 -2
- package/views/dist/grid/chrome/GridTableSurface.js +2 -1
- package/views/dist/grid/chrome/GridTextEditor.d.ts +1 -1
- package/views/dist/grid/chrome/GridTextEditor.js +2 -2
- package/views/dist/grid/chrome/GridValueListEditor.d.ts +1 -1
- package/views/dist/grid/chrome/GridValueListEditor.js +1 -1
- package/views/dist/grid/chrome/grid-body-place.d.ts +7 -2
- package/views/dist/grid/chrome/grid-body-place.js +8 -4
- package/views/dist/grid/chrome/grid-cell-classes.js +2 -2
- package/views/dist/grid/chrome/grid-edit-session.d.ts +4 -0
- package/views/dist/grid/chrome/grid-edit-session.js +10 -1
- package/views/dist/grid/chrome/grid-editor-layer.d.ts +10 -0
- package/views/dist/grid/chrome/grid-editor-layer.js +1 -0
- package/views/dist/grid/chrome/grid-fitted-box.d.ts +9 -6
- package/views/dist/grid/chrome/grid-fitted-box.js +15 -7
- package/views/dist/grid/chrome/grid-hover.d.ts +3 -3
- package/views/dist/grid/chrome/grid-hover.js +2 -3
- package/views/dist/grid/chrome/grid-row-props.d.ts +6 -2
- package/views/dist/grid/chrome/grid-styles.d.ts +1 -5
- package/views/dist/grid/chrome/grid-styles.js +0 -1
- package/views/dist/grid/chrome/grid-table-props.d.ts +6 -2
- package/views/dist/grid/chrome/useGridKeyboard.d.ts +0 -1
- package/views/dist/grid/chrome/useGridKeyboard.js +2 -10
- package/views/dist/grid/chrome/useGridScaleStyles.d.ts +9 -1
- package/views/dist/grid/chrome/useGridScaleStyles.js +1 -4
- package/views/dist/grid/chrome/useGridTableInteractionModel.d.ts +3 -1
- package/views/dist/grid/chrome/useGridTableInteractionModel.js +24 -1
- package/views/dist/grid/core/useGridEditing.d.ts +3 -0
- package/views/dist/grid/core/useGridEditing.js +2 -0
- package/views/dist/grid/grid-format-props.d.ts +1 -1
- package/views/dist/grid/grid-format-props.js +18 -5
- package/views/dist/grid/grid.css +9 -20
- package/views/dist/grid/useGridTablePrefs.d.ts +1 -1
- package/views/dist/grid/useGridTableSettings.d.ts +1 -1
- package/views/dist/internal/screen-forms.d.ts +11 -0
- package/views/dist/internal/screen-forms.js +31 -0
- package/views/dist/list/list.js +4 -3
- package/views/dist/list/menu.d.ts +5 -4
- package/views/dist/list/parts.d.ts +8 -2
- package/views/dist/list/parts.js +31 -7
- package/views/dist/list/toolbar.js +11 -5
- package/views/dist/looks/index.d.ts +1 -0
- package/views/dist/looks/index.js +1 -0
- package/views/dist/panels/customize-body.d.ts +1 -1
- package/views/dist/panels/customize-body.js +8 -1
- package/views/dist/panels/model.d.ts +5 -0
- package/views/dist/panels/react/customize-body.js +11 -2
- package/views/dist/panels/react/customize.d.ts +3 -0
- package/views/dist/panels/react/filter/FilterFieldList.d.ts +3 -1
- package/views/dist/panels/react/filter/FilterFieldList.js +2 -2
- package/views/dist/panels/react/filter/filter-body.js +3 -1
- package/views/dist/panels/react/filter/filter-part-body.d.ts +3 -1
- package/views/dist/panels/react/filter/filter-part-body.js +2 -2
- package/views/dist/panels/react/popover.d.ts +3 -1
- package/views/dist/panels/react/popover.js +2 -2
- package/views/dist/panels/react/sort/SortEditor.js +3 -1
- package/views/dist/panels/react/toolbar/ReadyToolbar.d.ts +15 -4
- package/views/dist/panels/react/toolbar/Toolbar.d.ts +12 -1
- package/views/dist/panels/react/toolbar/Toolbar.js +5 -1
- package/views/dist/panels/react/toolbar/ToolbarAdvancedFilters.js +1 -1
- package/views/dist/panels/react/toolbar/ToolbarBarFilter.js +5 -3
- package/views/dist/panels/react/toolbar/ToolbarButton.js +3 -2
- package/views/dist/panels/react/toolbar/ToolbarFilterAdd.js +1 -3
- package/views/dist/panels/react/toolbar/ToolbarOptions.d.ts +4 -1
- package/views/dist/panels/react/toolbar/ToolbarOptions.js +2 -2
- package/views/dist/panels/react/toolbar/ToolbarQuickFilters.d.ts +1 -1
- package/views/dist/panels/react/toolbar/ToolbarQuickFilters.js +1 -1
- package/views/dist/panels/react/toolbar/ToolbarSave.d.ts +3 -1
- package/views/dist/panels/react/toolbar/ToolbarSave.js +28 -20
- package/views/dist/panels/react/toolbar/ToolbarSearch.js +1 -1
- package/views/dist/panels/react/toolbar/context.d.ts +3 -2
- package/views/dist/panels/react/toolbar/editor-menus.d.ts +8 -0
- package/views/dist/panels/react/toolbar/editor-menus.js +3 -0
- package/views/dist/panels/react/views-row/FoldingViewRow.js +26 -11
- package/views/dist/panels/react/views-row/HScrollRow.d.ts +4 -2
- package/views/dist/panels/react/views-row/HScrollRow.js +6 -2
- package/views/dist/panels/react/views-row/ViewAxes.js +6 -1
- package/views/dist/panels/react/views-row/ViewPicker.js +7 -10
- package/views/dist/panels/react/views-row/more-views.d.ts +2 -0
- package/views/dist/panels/react/views-row/more-views.js +3 -0
- package/views/dist/panels/react/views-row/new-view.d.ts +11 -0
- package/views/dist/panels/react/views-row/new-view.js +21 -0
- package/views/dist/panels/react.d.ts +1 -1
- package/views/dist/panels/toolbar/model.d.ts +2 -2
- package/views/dist/provider/components.d.ts +88 -8
- package/views/dist/provider/desktop.d.ts +2 -1
- package/views/dist/provider/desktop.js +5 -2
- package/views/dist/react.d.ts +1 -1
- package/views/dist/styles.css +198 -84
- package/views/dist/styles.unlayered.css +198 -84
- package/views/docs/contract.md +87 -32
- package/views/docs/controls/list.md +2 -0
- package/views/docs/controls/menu.md +2 -0
- package/views/docs/controls/picker.md +2 -0
- package/views/docs/controls/popover.md +7 -0
- package/views/docs/controls/tooltip.md +2 -0
- package/views/docs/guides/atoms.md +11 -10
- package/views/docs/guides/the-grid.md +7 -5
- package/views/docs/guides/the-provider.md +2 -2
- package/views/docs/reference/controls.md +24 -18
- package/views/docs/reference/display.md +1 -1
- package/views/docs/reference/field-row.md +1 -1
- package/views/docs/reference/grid.md +4 -4
- package/views/docs/reference/list.md +30 -11
- package/views/docs/reference/looks.md +4 -1
- package/views/docs/reference/panels-react.md +7 -6
- package/views/docs/reference/panels.md +2 -2
- package/views/docs/reference/react.md +22 -10
- package/views/docs/reference/views.md +2 -2
- package/views/docs/reshaping.md +2 -2
- package/views/skills/views/SKILL.md +1 -1
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
Every name the list's stylesheet (`list.css`) reads, each optional: the ready stylesheet declares it at the Outright look's value, and your app declares it to change it. Each stands for one Outright token, which an app on the Outright tokens declares it as. How the names are made, and the controls' other pages: [the controls' tokens](../contract.md#the-controls-tokens).
|
|
4
4
|
|
|
5
|
+
How it moves as it opens and closes is every popup's, by the contract's popup motion names beside these (`--vk-popup-open-duration`, `--vk-popup-close-duration`, `--vk-popup-open-ease`, `--vk-popup-close-ease`, `--vk-popup-nudge`, `--vk-popup-scale`), each read with today's motion (a fade and a 4px drop in 150ms each way, easing out both ways) where none is declared, and set on a frame by the Popover's picks: [a popup's motion](../contract.md#tokens).
|
|
6
|
+
|
|
5
7
|
| name | kind | the Outright token | default |
|
|
6
8
|
| ---- | ---- | ------------------ | ------- |
|
|
7
9
|
| `--vk-border` | colour | `border` | `hsl(220 7% 90%)` · dark `hsl(225 7% 15%)` |
|
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
Every name the Menu's stylesheet (`menu.css`) reads, each optional: the ready stylesheet declares it at the Outright look's value, and your app declares it to change it. Each stands for one Outright token, which an app on the Outright tokens declares it as. How the names are made, and the controls' other pages: [the controls' tokens](../contract.md#the-controls-tokens).
|
|
4
4
|
|
|
5
|
+
Its size is the app's too, beside these names: `--vk-menu-w` its width and `--vk-menu-max-h` its height at the most, its rows scrolling. The ready stylesheet declares neither, so it fits its widest row, 208 to 320, and stands no taller than the room on screen: [a panel's, an editor's and a menu's size](../contract.md#tokens).
|
|
6
|
+
|
|
5
7
|
| name | kind | the Outright token | default |
|
|
6
8
|
| ---- | ---- | ------------------ | ------- |
|
|
7
9
|
| `--vk-fg` | colour | `text` | `hsl(210 6% 7%)` · dark `hsl(210 8% 95%)` |
|
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
Every name the Picker's stylesheet (`picker.css`) reads, each optional: the ready stylesheet declares it at the Outright look's value, and your app declares it to change it. Each stands for one Outright token, which an app on the Outright tokens declares it as. One is a time its script reads, which the stylesheet hands it on the Picker, round every row: `--vk-hold-delay`, how long a finger rests on a phone's row before it lifts to be moved. How the names are made, and the controls' other pages: [the controls' tokens](../contract.md#the-controls-tokens).
|
|
4
4
|
|
|
5
|
+
How many rows a computer's list stands before it scrolls is the app's too, beside these names: `--vk-list-rows`, which the ready stylesheet leaves undeclared, so it stands 8½ (its old name, list-rows, is still read). Declared on one panel's slot, that panel's list alone takes it: [a panel's, an editor's and a menu's size](../contract.md#tokens).
|
|
6
|
+
|
|
5
7
|
| name | kind | the Outright token | default |
|
|
6
8
|
| ---- | ---- | ------------------ | ------- |
|
|
7
9
|
| `--vk-border` | colour | `border` | `hsl(220 7% 90%)` · dark `hsl(225 7% 15%)` |
|
|
@@ -4,6 +4,10 @@ Every name the Popover's stylesheet (`popover.css`) reads, each optional: the re
|
|
|
4
4
|
|
|
5
5
|
A popup that holds a list (the components map's `chrome` `menu`) is marked `data-popover-chrome="menu"` on the popover itself: the Outright look draws it as its card, and your styles may draw it otherwise.
|
|
6
6
|
|
|
7
|
+
Its size is the app's too, by what it holds, beside these names: a toolbar panel's popover (its slot `vk-toolbar-…-panel`) reads `--vk-panel-w` and `--vk-panel-max-h`, a field editor's (`vk-grid-editor`, `vk-editor-panel`) `--vk-editor-w` and `--vk-editor-max-h`. The ready stylesheet declares none of them, so each keeps its own size: [a panel's, an editor's and a menu's size](../contract.md#tokens).
|
|
8
|
+
|
|
9
|
+
How it moves as it opens and closes is every popup's, by the contract's popup motion names beside these (`--vk-popup-open-duration`, `--vk-popup-close-duration`, `--vk-popup-open-ease`, `--vk-popup-close-ease`, `--vk-popup-nudge`, `--vk-popup-scale`), each read with today's motion (a fade and a 4px nudge in 150ms each way, easing out as it opens and in as it closes) where none is declared, and set on a frame by the Popover's picks: [a popup's motion](../contract.md#tokens).
|
|
10
|
+
|
|
7
11
|
| name | kind | the Outright token | default |
|
|
8
12
|
| ---- | ---- | ------------------ | ------- |
|
|
9
13
|
| `--vk-border` | colour | `border` | `hsl(220 7% 90%)` · dark `hsl(225 7% 15%)` |
|
|
@@ -26,3 +30,6 @@ A popup that holds a list (the components map's `chrome` `menu`) is marked `data
|
|
|
26
30
|
| `--vk-duration-fast` | motion | `duration-fast` | `150ms` |
|
|
27
31
|
| `--vk-ease-out` | motion | `ease-out` | `cubic-bezier(0, 0, 0.2, 1)` |
|
|
28
32
|
| `--vk-ease-in` | motion | `ease-in` | `cubic-bezier(0.4, 0, 1, 1)` |
|
|
33
|
+
| `--vk-ease-out-sharp` | motion | `ease-out-sharp` | `cubic-bezier(0.23, 1, 0.32, 1)` |
|
|
34
|
+
| `--vk-ease-in-out` | motion | `ease-in-out` | `cubic-bezier(0.4, 0, 0.2, 1)` |
|
|
35
|
+
| `--vk-ease-spring` | motion | `ease-spring` | `cubic-bezier(0.34, 1.56, 0.64, 1)` |
|
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
Every name the Tooltip's stylesheet (`tooltip.css`) reads, each optional: the ready stylesheet declares it at the Outright look's value, and your app declares it to change it. Each stands for one Outright token, which an app on the Outright tokens declares it as. How the names are made, and the controls' other pages: [the controls' tokens](../contract.md#the-controls-tokens).
|
|
4
4
|
|
|
5
|
+
How it moves as it opens and closes is every popup's, by the contract's popup motion names beside these (`--vk-popup-open-duration`, `--vk-popup-close-duration`, `--vk-popup-open-ease`, `--vk-popup-close-ease`, `--vk-popup-nudge`, `--vk-popup-scale`), each read with today's motion (a fade and a 2px rise, half a popup's nudge, in 150ms each way, easing out both ways) where none is declared, and set on a frame by the Popover's picks: [a popup's motion](../contract.md#tokens).
|
|
6
|
+
|
|
5
7
|
| name | kind | the Outright token | default |
|
|
6
8
|
| ---- | ---- | ------------------ | ------- |
|
|
7
9
|
| `--vk-fg` | colour | `text` | `hsl(210 6% 7%)` · dark `hsl(210 8% 95%)` |
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Atoms
|
|
2
2
|
|
|
3
|
-
The components map hands the package your primitives: a button, a popover, a menu. The atoms sit one level up. They are the small pieces the rendering is built from (a row, a tag, a status badge), and the pieces of your app it cannot draw itself (where a relation chip goes, a command cell's verbs, the row's right-click menu). Every atom ships with a default drawn from your colours, so an app that swaps nothing still gets a complete rendering. This page covers every atom, swapping any of them, and drawing your own panels with the same rows the rendering uses.
|
|
3
|
+
The components map hands the package your primitives: a button, a popover, a menu. The atoms sit one level up. They are the small pieces the rendering is built from (a row, a tag, a status badge), and the pieces of your app it cannot draw itself (where a relation chip goes, a command cell's verbs, the row's right-click menu). Every atom ships with a default drawn from your colours, so an app that swaps nothing still gets a complete rendering. This page covers every atom, swapping any of them, and drawing your own panels with the same rows the rendering uses. Three atoms are deprecated: ViewKit draws nothing with them ([Deprecated atoms](#deprecated-atoms)).
|
|
4
4
|
|
|
5
5
|
## The atoms and their defaults
|
|
6
6
|
|
|
@@ -8,7 +8,6 @@ The components map hands the package your primitives: a button, a popover, a men
|
|
|
8
8
|
|
|
9
9
|
- `List`: the inset a run of rows sits in, inside a panel or a command list's group.
|
|
10
10
|
- `Row`: a whole row, a button or, with `interactive={false}`, a static line.
|
|
11
|
-
- `RowContent`: a row's inside, for inside a command list's item, which owns the element, the highlight and the keyboard.
|
|
12
11
|
- `TickBox`: a tick box that only paints; the control around it is yours.
|
|
13
12
|
- `StatusBadge`: a status value's dot and label, in its slot's hue.
|
|
14
13
|
- `StatusMarker`: an attention badge that opens its reason in a popover, with an optional resolve button.
|
|
@@ -23,12 +22,12 @@ The components map hands the package your primitives: a button, a popover, a men
|
|
|
23
22
|
- `PlatformMark`: a link's platform mark, drawn before the link.
|
|
24
23
|
- `RowMenu`: the row's right-click menu.
|
|
25
24
|
- `Avatar`: a person's or a record's picture, in a user's, a relation's and an actor's chip, and before the name when the list hands a row's picture; and every record's mark ViewKit's panels draw, where the provider's `panelControls` names `Avatar`. The default draws the picture, else the glyph the chip would draw.
|
|
26
|
-
- `
|
|
25
|
+
- `CheckRow`, `RadioRow`, `DirectionButton`, `MenuRow` and `PanelSearch`: a tick row, a one-of-a-set row, a sort's direction arrow, a drill-in row and a panel's text box. Only ViewKit's own filter and sort bodies draw them: the older panels a list keeps with `severalSorts: false` or `filterGroups: false`, and the value body a filter rule falls back to where your `FilterPartBody` or `FilterBody` doesn't draw its type. The panels a list opens by default are your bodies (`CustomizeBody`, `SortBody`, `FilterBody` and the rest), handed their rows as data, so swapping these changes only those places.
|
|
27
26
|
- `Pill`: one option of a row of pills, the views row's (`/panels/react`) and any tab row's.
|
|
28
27
|
- `RangeCalendar`: the filter panel's month, a day or a range in ISO days. The default is your components map's one-day `Calendar` on the end being picked, and paints no range; hand your own to paint one.
|
|
29
28
|
- `ToolbarButton`: the toolbar's button (`/panels/react`), a glyph in a circle with its word for a dress that shows words, a count that becomes a ✕ badge when it can clear what it counts, and a dot. Hand your own to give the toolbar your buttons' look. `CONTROL_ATOMS.ToolbarButton`, the kit's, draws the count as a count, never that ✕: under it, a part's filters clear from their own panel.
|
|
30
29
|
|
|
31
|
-
The names are `ATOM_NAMES` from `viewkitjs/views`, and the defaults hold exactly those.
|
|
30
|
+
The names are `ATOM_NAMES` from `viewkitjs/views`, and the defaults hold exactly those, the deprecated three included.
|
|
32
31
|
|
|
33
32
|
```tsx
|
|
34
33
|
import assert from "node:assert/strict";
|
|
@@ -38,7 +37,7 @@ import { DEFAULT_VIEWS_ATOMS, type ViewsAtoms } from "viewkitjs/views/react";
|
|
|
38
37
|
assert.deepEqual(Object.keys(DEFAULT_VIEWS_ATOMS).sort(), [...ATOM_NAMES].sort());
|
|
39
38
|
```
|
|
40
39
|
|
|
41
|
-
The first
|
|
40
|
+
The first six are the rendering's own look, and their defaults are usually all an app needs. The next eight are where your app comes in: the package can't know where a record opens, which menu your app opens verbs in, what a LinkedIn mark looks like, or how your app draws a person. Their defaults are deliberately plain: a relation chip that goes nowhere, a command menu and a row menu on your components map's `Menu`, a ring for a wait, no platform mark at all, and a chip's picture or glyph as the package has always drawn it.
|
|
42
41
|
|
|
43
42
|
## Swapping an atom
|
|
44
43
|
|
|
@@ -301,7 +300,7 @@ export function AppViews({ children }: { children: ReactNode }) {
|
|
|
301
300
|
|
|
302
301
|
The atoms the rendering builds its menus and pickers from are yours to use too, so a panel of your own reads like the package's. Read them from `useViews().atoms`, which holds your swaps over the defaults.
|
|
303
302
|
|
|
304
|
-
A row's label truncates to one line when it is text, and is laid out in a row when it is a node (a badge, a link), so a chip sits on the row's centre; `wrap` breaks a long label instead. `size` is `compact` (13px: a command list's rows, a list of values) or `regular` (your menu size, the default). `detail` is what the row says at its right edge in the subtle colour, a setting's current choice or a live sample; a chosen row draws its detail in the brand colour instead of a check, so a column of samples stays in line.
|
|
303
|
+
A row's label truncates to one line when it is text, and is laid out in a row when it is a node (a badge, a link), so a chip sits on the row's centre; `wrap` breaks a long label instead. `size` is `compact` (13px: a command list's rows, a list of values) or `regular` (your menu size, the default). `detail` is what the row says at its right edge in the subtle colour, a setting's current choice or a live sample; a chosen row draws its detail in the brand colour instead of a check, so a column of samples stays in line. `tone="muted"` is for a row that offers rather than lists: none, create, add.
|
|
305
304
|
|
|
306
305
|
```tsx
|
|
307
306
|
import { useViews } from "viewkitjs/views/react";
|
|
@@ -320,25 +319,27 @@ function DensityPicker({ current, onPick }: { current: Density; onPick: (density
|
|
|
320
319
|
);
|
|
321
320
|
}
|
|
322
321
|
|
|
323
|
-
function SettingsMenu({ density,
|
|
322
|
+
function SettingsMenu({ density, onOpenDensity }: { density: Density; onOpenDensity: () => void }) {
|
|
324
323
|
const { List, Row } = useViews().atoms;
|
|
325
324
|
return (
|
|
326
325
|
<List>
|
|
327
|
-
<Row label="Density" detail={density}
|
|
326
|
+
<Row label="Density" detail={density} onClick={onOpenDensity} />
|
|
328
327
|
<Row label="Row height" detail="32px" interactive={false} size="compact" />
|
|
329
328
|
</List>
|
|
330
329
|
);
|
|
331
330
|
}
|
|
332
331
|
```
|
|
333
332
|
|
|
334
|
-
|
|
333
|
+
## Deprecated atoms
|
|
334
|
+
|
|
335
|
+
Three atoms are read by nothing, so handing one changes nothing on screen: `RowContent` (the default `Row` draws its own inside), `ChoiceRow` and `ToggleRow` (Customize's and the editors' rows come to your bodies as data). The `Row`'s `opens` and `open`, for a row that opened a flyout beside its menu, are handed by nothing in ViewKit either; the default still reads them for a caller of your own. Each carries `@deprecated`, so your editor strikes it through, and still compiles: an app that hands them needn't change anything now. They go in a later release that breaks something anyway, with a migration line.
|
|
335
336
|
|
|
336
337
|
## Styling the defaults
|
|
337
338
|
|
|
338
339
|
The defaults mark themselves with a `data-slot` each, `vk-list`, `vk-row`, `vk-row-content`, `vk-tick`, `vk-status`, `vk-marker`, `vk-tag`, `vk-command-menu`, `vk-relation-link`, `vk-loading`, `vk-load-more`, `vk-platform`, `vk-row-menu`, and the panels' `vk-choice-row`, `vk-check-row`, `vk-radio-row`, `vk-direction`, `vk-menu-row`, `vk-toggle-row` and `vk-panel-search` (`ATOM_SLOTS`), and with the states `data-chosen`, `data-disabled`, `data-muted`, `data-checked` and `data-open` (present when true), `data-status` (the status slot's name) and `data-platform` (a link's platform key). A stylesheet reaches a default through them, never through a class the package happens to use:
|
|
339
340
|
|
|
340
341
|
```css
|
|
341
|
-
[data-slot="vk-row"][data-
|
|
342
|
+
[data-slot="vk-row"][data-chosen] {
|
|
342
343
|
outline: 1px solid var(--vk-border);
|
|
343
344
|
}
|
|
344
345
|
[data-slot="vk-status"][data-status="error"] {
|
|
@@ -660,25 +660,27 @@ assert.deepEqual(gridNormalizeWrite(titleColumn, " Acme renewal ", conventions)
|
|
|
660
660
|
assert.equal(gridNormalizeWrite(stageColumn, "maybe", conventions).ok, false);
|
|
661
661
|
```
|
|
662
662
|
|
|
663
|
+
**While a cell's editor is open** the cell draws nothing of its own: no ring, no lift and no tint, so under a popover it stays as it was, and a cell typed in shows only the caret. It wears `data-editing` until the editor starts to close, not until its exit is over. Escape, a pick, or Enter after typing closes the editor and keeps the cell selected, its ring back; a second Escape lets it go. A click away closes the editor and lets the cell go (a pick your app holds, `cellPick`, stays); a click on another cell closes it and selects that one, its editor not opened.
|
|
664
|
+
|
|
663
665
|
**One of a set.** A `select` or a `status` opens the select editor in your `Picker`: its options, the cell's value held, and a pick saves. A column that may be emptied (`clearable`) offers the Picker's empty row, None, while the cell holds a value; a required status offers none. Delete still clears a column that may be emptied. A closed list offers its options, and the cell's own value when no option names it, so a stray value shows on the row that holds it and on no other; an open select offers the values its records hold and creates the typed text. A list of more than 8 options shows the Picker's search, and a letter typed on the cell opens it already filtered by that letter; a shorter list shows its rows alone.
|
|
664
666
|
|
|
665
667
|
**A set of values.** A `multiselect` opens the chips editor in your `Picker`, with `multiple`: the values it holds held, the candidates with them. It is a draft: adds and removes commit as one write when the panel closes or Tab moves on (Shift-Tab to the cell before), closing it unchanged writes nothing, and Escape discards it. A pick adds or removes a value and keeps the panel open. A letter typed on the cell opens it with the letter in its search, the values it holds kept. A closed multiselect offers its options alone and filters them as you type, with no row to add what was typed; a value the cell already holds that no option names stays as a chip and is saved as it is. An open one offers the values on screen and adds what is typed. A vocabulary that is not free-form declares `chips: { normalize }` on its column, the rule that turns what somebody typed into what the field stores.
|
|
666
668
|
|
|
667
669
|
**A day or a moment.** A date cell opens the date editor, which opens your `DateBody` (`CONTROLS.DateBody`, the Date editor, for an app that spreads `CONTROLS`) over the cell. A `date` has no time: a day picked saves it. A `datetime` keeps its time (an empty time starts at 00:00) and stays open after a day is picked, so the time can be set; a click away or Enter saves both. The quick days (`datePicks`) set their day, a datetime's time kept. A column that may be emptied (`clearable`) offers No date, which empties the date; a required date offers none, and Delete still clears. A character typed on the cell opens the editor with it in the body's line, and Enter saves the date it reads. On a phone the day and the time are in one sheet, and ✓ saves both.
|
|
668
670
|
|
|
669
|
-
**A text cell** (text, a link, an email, a phone, a domain) types in the cell through the text editor (`viewkitjs/views/editors/text`), which opens your `TextBody` over its cell on a computer, in a layer over the whole cell, on its lines, the cell keeping its padding, and in the sheet on a phone: what was typed is trimmed, an unchanged value writes nothing, and each type brings its own phone keyboard. Enter writes and
|
|
671
|
+
**A text cell** (text, a link, an email, a phone, a domain) types in the cell through the text editor (`viewkitjs/views/editors/text`), which opens your `TextBody` over its cell on a computer, in a layer over the whole cell, on its lines, the cell keeping its padding, and in the sheet on a phone: what was typed is trimmed, an unchanged value writes nothing, and each type brings its own phone keyboard. In the grid the box is the cell itself, with no edge, ground or lift of its own, and grows from the cell as the text editor's In the cell look grows it, whatever the page's look; past the cell it lies on the plain ground (`--vk-overlay`). Enter writes and keeps the cell, Tab writes and moves on, Escape cancels (or writes, where the provider's `escape` keeps the column's type).
|
|
670
672
|
|
|
671
|
-
**A long text** (a `text` field with `format: { long: true }`, or rich text) edits in the same body, as a paragraph: Enter is a newline, ⌘ or Ctrl Enter commits and
|
|
673
|
+
**A long text** (a `text` field with `format: { long: true }`, or rich text) edits in the same body, as a paragraph: Enter is a newline, ⌘ or Ctrl Enter commits and keeps the cell, Tab commits and moves on, Escape cancels (or commits, where the column's type keeps), and a click away commits. Where it cannot be written, a read-only panel opens on the cell instead (`gridColumnInspectable`), selectable, never written.
|
|
672
674
|
|
|
673
|
-
**A cut-off text** (a plain text, or a title that is text) opens whole when its cell cuts it off: a second click, a double-click or Enter shows all of it, in the body (its box grows over the rows below) where the cell can be written and in the read-only panel where it can't. It stays a line: Enter writes and
|
|
675
|
+
**A cut-off text** (a plain text, or a title that is text) opens whole when its cell cuts it off: a second click, a double-click or Enter shows all of it, in the body (its box grows over the rows below) where the cell can be written and in the read-only panel where it can't. It stays a line: Enter writes and keeps the cell, and a newline is written as a space. Typing a character still replaces the value in the cell. Links, emails, phones and domains keep a one-line box.
|
|
674
676
|
|
|
675
|
-
**A number, money or percent cell** opens your `NumberBody` over its cell on a computer, in a layer over the whole cell, on its lines, the cell keeping its padding,
|
|
677
|
+
**A number, money or percent cell** opens your `NumberBody` over its cell on a computer, in a layer over the whole cell, on its lines, the cell keeping its padding, the box with no edge, ground or lift of its own (past a cell too narrow for it, on the plain ground), and in the sheet on a phone; the keys stay as the number editor's own. A duration keeps ViewKit's own box.
|
|
676
678
|
|
|
677
679
|
**On a phone** (narrower than the provider's `desktopQuery`, `(min-width: 1024px)` unless you hand in your own), a text cell and a long text open in a sheet titled with the column's header instead: ✕ and a swipe change nothing, ✓ saves and closes without moving the selection, and the save lands once the sheet has slid away.
|
|
678
680
|
|
|
679
681
|
**The write gate** is `gridNormalizeWrite`, which every write the grid starts passes once: a key, the row's menu, a fill, a paste, a boolean's button. It coerces the value by the column's type, then has the column's field accept it, so a type's write rules are stated once: a marker boolean refuses any write but clear, an email or a url must look like one, a multiselect commits its whole set, trimmed and without duplicates. An emptied value passes unchecked, since `clearable` decides whether a clear may run; a clear reaches you as `""`, except a relation's `null`, a multiselect's `[]` and a boolean's `false` (Writes, above). A refusal is said in a toast and nothing is sent. Undo and redo do not pass the gate: they put a recorded value back as it was.
|
|
680
682
|
|
|
681
|
-
**A select, status, date, tags, relation, number, range, place or list-of-values editor** opens through the same panel: your `Popover` on a desktop and your `Sheet` below your `desktopQuery`. Each asks the same gate before it closes, and the list's settings too, so a column locked while its editor is open says the lock in the editor. A value the gate refuses keeps the editor open with its reason, and nothing is sent until the value changes or Escape throws the edit away (where the column's type keeps on Escape, the first Escape keeps and shows the refusal, and a second throws the edit away). Leaving the cell while the reason stands writes nothing, and says the reason in a toast. These editors share the edit session's rules: Escape discards (or keeps, where the provider's `escape` keeps the column's type), and a refused value stays open with its reason. In the place editor's country or region list, Escape first closes the list, back to its boxes. On a desktop a picker opens your `Popover` over its cell,
|
|
683
|
+
**A select, status, date, tags, relation, number, range, place or list-of-values editor** opens through the same panel: your `Popover` on a desktop and your `Sheet` below your `desktopQuery`. Each asks the same gate before it closes, and the list's settings too, so a column locked while its editor is open says the lock in the editor. A value the gate refuses keeps the editor open with its reason, and nothing is sent until the value changes or Escape throws the edit away (where the column's type keeps on Escape, the first Escape keeps and shows the refusal, and a second throws the edit away). Leaving the cell while the reason stands writes nothing, and says the reason in a toast. These editors share the edit session's rules: Escape discards (or keeps, where the provider's `escape` keeps the column's type), and a refused value stays open with its reason. In the place editor's country or region list, Escape first closes the list, back to its boxes. On a desktop a picker opens your `Popover` over its cell, a spacing step above and left of it, covering its lines, and a number or a range is typed in the cell. Below your provider's `desktopQuery`, each opens in your `Sheet`, a number or a range included, titled with the column's header, with ✕ and ✓, while the cell behind it keeps showing its value. ✕, a swipe and Escape change nothing. ✓ saves, and so does a pick. A value is sent once its popover or sheet has played out; a number or a range typed in the cell is sent at once. A list of values whose every value was removed, or a place whose every part was emptied, on a column that isn't `clearable`, stays open saying the field can't be emptied (the column's `reasons.clearable` when it declares one); Escape still throws the edit away, unless the column's type keeps on Escape. The name editor still closes and says a refusal in a toast.
|
|
682
684
|
|
|
683
685
|
**The row's country.** A column's `region` (a binding's, carried by `columnFrom`) reads the record's country off the row, and a phone typed, pasted or filled without its country code is read in it, at the gate and in the editors' own check. Absent, the conventions' region reads it.
|
|
684
686
|
|
|
@@ -6,7 +6,7 @@ Every view reads what it takes from its app, other than its own props, from one
|
|
|
6
6
|
|
|
7
7
|
`ViewsProvider` sits once at your app's client root, above every view. It needs one thing and the children: `components` (your primitives; `components={CONTROLS}` is ViewKit's own, every slot filled). Three more have defaults, so you hand them only to draw your own: `icons` (your glyphs by meaning; absent, each drawn through your `AppIcon` by its name, which `CONTROLS.AppIcon` draws with ViewKit's own glyphs), `ports` (your haptics, clipboard, per-device store, toast and confirm dialog, each optional; [ports](ports.md)) and `conventions` (absent, `en-US` in `UTC`). Eleven more are optional: `atoms`, `messages`, `presentation`, `desktopQuery`, `sheetActions`, `escape`, `oneValue`, `severalValues`, `selectionBar`, `datePicks` and `panelControls` (your own controls inside ViewKit's panels and field editors, below).
|
|
8
8
|
|
|
9
|
-
`desktopQuery` says which screens are desktops: there an editor opens as a popover, and elsewhere as a sheet; so do the toolbar's panels and the views picker outside a `Toolbar` (inside one, the toolbar's phone form decides), and the grid's own chrome: a row's and a group's ⋯ and the row actions show on hover on a desktop, and a row's and a group's ⋯ always elsewhere, where the row actions don't show. It defaults to `DEFAULT_DESKTOP_QUERY`, `(min-width: 1024px)`; hand in the query your own shell switches on, so the editors and your layout change at the same width. A server render counts as a desktop.
|
|
9
|
+
`desktopQuery` says which screens are desktops: there an editor opens as a popover, and elsewhere as a sheet; so do the toolbar's panels and the views picker outside a `Toolbar` (inside one, the toolbar's phone form decides), and the grid's own chrome: a row's and a group's ⋯ and the row actions show on hover on a desktop, and a row's and a group's ⋯ always elsewhere, where the row actions don't show. It defaults to `DEFAULT_DESKTOP_QUERY`, `(min-width: 1024px)`; hand in the query your own shell switches on, so the editors and your layout change at the same width. A server render draws a list's toolbar and grid, and a record's field rows, in both forms, and CSS shows the one your `desktopQuery` picks, so a phone's first paint is already the phone's; once the page comes alive, the screen's form alone stays, the very elements the person saw (each in a `display: contents` box). Anything else that reads it counts a server render as a desktop.
|
|
10
10
|
|
|
11
11
|
`escape` says what Escape does in an editor, per field type: `{ date: "keep", location: "keep" }` keeps what was typed in a date's and a place's editor and closes it, as a press outside does, and a value the editor or your app refuses on the spot stays open with its reason, until a second Escape throws the edit away. A refusal your server sends after the save arrives once the editor has closed, as it does after Enter: on the cell in the grid, and under the row in a field row, whose editor, pressed again, opens on the refused value with your server's reason until the value changes. A type you leave out throws the edit away, which is the default for every type. It holds on a desktop: on a phone, every way out of the sheet throws the edit away. Pass a module-level object.
|
|
12
12
|
|
|
@@ -18,7 +18,7 @@ The grid says why your app refused an edit it sent, through your toast's `error`
|
|
|
18
18
|
|
|
19
19
|
The popover around a whole body your app hands, its `Picker`, `PartsBody`, `ValuesBody` or `LinksBody`, takes no width and no padding of ViewKit's, only its layer, so your `Popover` stands at its own width; it is marked with the body it holds: `data-vk-body` is `picker`, `parts`, `values` or `links`. A phone's sheet is unchanged. Give the popover that opens with `chrome: "menu"` a width that doesn't follow its content (or it widens and narrows as a list filters), cap it by the room on screen, and pad it as you want; a body that needs more room, a place's parts on one line, is reached by `[data-vk-body="parts"]`.
|
|
20
20
|
|
|
21
|
-
A grid editor opens the popover around a whole body you hand, your `Picker`, `DateBody`, `PartsBody`, `ValuesBody` or `LinksBody`,
|
|
21
|
+
A grid editor opens the popover around a whole body you hand, your `Picker`, `DateBody`, `PartsBody`, `ValuesBody` or `LinksBody`, one spacing step above and one step left of the cell, covering the cell and its lines, as Attio's editors and long text open. Give that popover at least the cell's width and two steps, so it covers the cell's far line too and a press where the cell was lands inside it. A field row opens its body under the value, unchanged.
|
|
22
22
|
|
|
23
23
|
`selectionBar` says where the selection bar sits: its `bottom`, its `zIndex` and your `className` on the desktop and on the phone, and a `phoneQuery` when your shell switches to its phone layout at another width than `desktopQuery`. An app with a bottom nav lifts the phone's pill above it; pass a module-level object.
|
|
24
24
|
|
|
@@ -23,9 +23,8 @@ Import from `viewkitjs/views/controls` to draw ViewKit's default controls: the O
|
|
|
23
23
|
- `ButtonGroup` — Buttons joined in a row or a column, the corners between them square and the edges shared.
|
|
24
24
|
- `ButtonGroupText` — words inside a group: a unit, a count.
|
|
25
25
|
- `ButtonGroupSeparator` — a line between two Buttons of a group that have no edge of their own.
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
- `buttonOwnAttrs` — `buttonOwnAttrs(look)`: the attributes of an own look.
|
|
26
|
+
|
|
27
|
+
A Button's own look (`ButtonOwnLook`, `buttonOwnOptions`, `buttonOwnAttrs`) is read from `viewkitjs/views/looks`, beside the Input's, without React ([the looks reference](looks.md)). This door still exports the three, deprecated, so an app that reads them here compiles; they go from here in a later release that breaks something anyway.
|
|
29
28
|
|
|
30
29
|
## The Spinner
|
|
31
30
|
|
|
@@ -83,7 +82,7 @@ Import from `viewkitjs/views/controls` to draw ViewKit's default controls: the O
|
|
|
83
82
|
|
|
84
83
|
## The bottom Sheet
|
|
85
84
|
|
|
86
|
-
- `Sheet` — what rises from the bottom of the phone, in a `form` (`full`, `floating`, `blend`, `edge`) and at `stops`, on Base UI's drawer: the drag, focus, Escape and the dim, and a settle on a spring that starts from the finger's speed. What it holds is poured in. `standing` keeps it in its `container`, a screen on a page. It says why it closed. `CONTROLS.Sheet` draws ViewKit's sheets with it, the editor's ✕ (or Back) and ✓ in its head; its height is the `snap` asked (`auto` the `edge` form, as tall as its content; `half` the `blend` form, opening at half; `peek` opening at the small stop; `full`, and none, to the top), a title that isn't words is drawn as handed (its name to screen readers still the label), `description` under the title and `className` on the sheet itself, a prop of the Sheet too; its own `data-slot` is drawn on its popup (a phone menu's sheet carries its menu's name).
|
|
85
|
+
- `Sheet` — what rises from the bottom of the phone, in a `form` (`full`, `floating`, `blend`, `edge`) and at `stops`, on Base UI's drawer: the drag, focus, Escape and the dim, and a settle on a spring that starts from the finger's speed. What it holds is poured in. `standing` keeps it in its `container`, a screen on a page. `risen`, mounted open, stands at its stop from its first frame with no rise, for an app drawing a sheet again where one already stood (a window redrawn in another form); closed and opened again, it rises as any does. It says why it closed. `CONTROLS.Sheet` draws ViewKit's sheets with it, the editor's ✕ (or Back) and ✓ in its head; its height is the `snap` asked (`auto` the `edge` form, as tall as its content; `half` the `blend` form, opening at half; `peek` opening at the small stop; `full`, and none, to the top), a title that isn't words is drawn as handed (its name to screen readers still the label), `description` under the title and `className` on the sheet itself, a prop of the Sheet too; its own `data-slot` is drawn on its popup (a phone menu's sheet carries its menu's name).
|
|
87
86
|
- `SheetProps` — its props.
|
|
88
87
|
- `SheetChangeDetails` — why it opened or closed.
|
|
89
88
|
- `SheetForm` — `full`, `floating`, `blend` or `edge`.
|
|
@@ -135,7 +134,7 @@ Import from `viewkitjs/views/controls` to draw ViewKit's default controls: the O
|
|
|
135
134
|
- `FieldSet` — fields or choices that answer one question under their own `legend`, with their own note and error; `disabled` reaches every choice in it.
|
|
136
135
|
- `FieldSetProps` — its props.
|
|
137
136
|
- `FieldSeparator` — a line between fields, with a word on it.
|
|
138
|
-
- `FieldRows` — Field rows' card: fields as rows of one card on a phone, or each its own card; `look` its own, whole. A `Field` placed in it is the card's row: its label in the row's column, its Input or InputGroup typed in place beside it (no box, the caret in the brand, an InputGroup's start words its prefix and its end button in the brand), `saving` and `saved` at the row's end; its note and error stand under the card, in a foot it draws while any Field in it has one (`o-field-rows-foot`), an error in place of every note, each still describing its control. A Field inside a `FieldRowsRow` is not a row. A `FieldRow` inside it draws as one of its rows on a phone.
|
|
137
|
+
- `FieldRows` — Field rows' card: fields as rows of one card on a phone, or each its own card; `look` its own, whole. A `Field` placed in it is the card's row: its label in the row's column, its Input or InputGroup typed in place beside it (no box, the caret in the brand, an InputGroup's start words its prefix and its end button in the brand), `saving` and `saved` at the row's end; its note and error stand under the card, in a foot it draws while any Field in it has one (`o-field-rows-foot`), an error in place of every note, each still describing its control. A Field inside a `FieldRowsRow` is not a row. A `FieldRow` inside it draws as one of its rows on a phone. Server-rendered, outside a PhoneHost and a ComputerHost, the card stands whole in both forms, CSS showing the one your `desktopQuery` picks until the page comes alive, so a phone's first paint holds the phone's rows.
|
|
139
138
|
- `FieldRowsProps` — its props.
|
|
140
139
|
- `FieldRowsRow` — a row of Field rows: its label beside its control (`as`: `label`, `button`, `div`).
|
|
141
140
|
- `FieldRowsRowProps` — its props.
|
|
@@ -149,7 +148,7 @@ Import from `viewkitjs/views/controls` to draw ViewKit's default controls: the O
|
|
|
149
148
|
- `CheckboxList` — checkboxes in rows in a bordered box, Base UI's checkbox group.
|
|
150
149
|
- `CheckboxListProps` — its props.
|
|
151
150
|
|
|
152
|
-
Their stylesheets are `input.css`, `inline-input.css`, `field.css`, `toggle.css`, `number-field.css` and `checkbox.css`; the Checkbox's words (`o-choice-*`) are drawn by `choice.css` and the phone's larger pressing area by `press.css` (below). Their phone rules hold on an element marked `data-vk-phone` and inside it: each control marks its own root on a phone, by the line the app hands the provider (`desktopQuery`), a PhoneHost screen or a ComputerHost, and an app marks a box it shows as a phone's screen the same way. A control told its `form` changes only its layout; its sizes stay the device's. On the server and before the page comes alive a control draws the computer's form. `input.css` keeps one Outright Showcase hook, `[data-computer-host]`: a box marked so keeps typable words at 16px, so iOS never zooms into a field drawn at a computer's size on a phone.
|
|
151
|
+
Their stylesheets are `input.css`, `inline-input.css`, `field.css`, `toggle.css`, `number-field.css` and `checkbox.css`; the Checkbox's words (`o-choice-*`) are drawn by `choice.css` and the phone's larger pressing area by `press.css` (below). Their phone rules hold on an element marked `data-vk-phone` and inside it: each control marks its own root on a phone, by the line the app hands the provider (`desktopQuery`), a PhoneHost screen or a ComputerHost, and an app marks a box it shows as a phone's screen the same way. A control told its `form` changes only its layout; its sizes stay the device's. On the server and before the page comes alive a control draws the computer's form, unless it stands in a toolbar (`ToolbarControl`), a grid or Field rows' card (`FieldRows`), which a server render draws in both forms, CSS showing the screen's. `input.css` keeps one Outright Showcase hook, `[data-computer-host]`: a box marked so keeps typable words at 16px, so iOS never zooms into a field drawn at a computer's size on a phone.
|
|
153
152
|
|
|
154
153
|
|
|
155
154
|
<!-- The rows: the Option, the Tag, the Status, the Switch, the menu list -->
|
|
@@ -286,7 +285,7 @@ Their stylesheets are `input.css`, `inline-input.css`, `field.css`, `toggle.css`
|
|
|
286
285
|
- `AvatarSize` — its sizes, 16, 20, 24, 32, 40, 56 and 64; a stack takes neither 16 nor 56.
|
|
287
286
|
- `AvatarColour` — a square's own colour: blue, green, amber, red, purple, pink, teal or grey, the Option's list; the square on the hue's fill, what it holds in its strong ink, with no edge.
|
|
288
287
|
- `AvatarPresence` — whether a person is here now: `here` or `away`.
|
|
289
|
-
- `AvatarStack` — several people on one thing, overlapping, the rest a count; with `onPick` one button opening everyone in a Menu (its card rows pinned on a phone), with `addButton` a dashed + after it.
|
|
288
|
+
- `AvatarStack` — several people on one thing, overlapping, the rest a count; with `onPick` one button opening everyone in a Menu (its card rows pinned on a phone), with `addButton` a dashed + after it, named `addLabel` ("Add someone" by default: no map draws the stack, so hand it in your words).
|
|
290
289
|
- `AvatarStackProps` — its props.
|
|
291
290
|
- `AvatarStackPerson` — one person on it.
|
|
292
291
|
- `initials` — a name's initials: the first letters of the first and last names.
|
|
@@ -307,7 +306,7 @@ Their stylesheets are `input.css`, `inline-input.css`, `field.css`, `toggle.css`
|
|
|
307
306
|
- `PickerLead` — the row that leads, where its field leads several.
|
|
308
307
|
- `PickerBoxSearch` — what a box that is its search is handed: its keys and what it holds.
|
|
309
308
|
- `PickerItem` — a row handed to it: its value, words, second line, group, level, menu, count, the words its search also finds (`also`), and its public name (`slot`, a `PartSlot`, VK-988).
|
|
310
|
-
- `PickerAs` — what a row is drawn as: an Option, a Status, an Avatar (its `kind` the record's kind as the app names it, handed to the app's Avatar atom, VK-1044), a sign, a mark, or a chip drawn in place of its words (`{ chip }`: a field's option as its cell draws it).
|
|
309
|
+
- `PickerAs` — what a row is drawn as: an Option, a Status, an Avatar (its `kind` the record's kind as the app names it, handed to the app's Avatar atom, VK-1044), a sign, a mark, or a chip drawn in place of its words (`{ chip }`: a field's option as its cell draws it; with `removable`, a function of a remove, how it stands held among the search's chips under the look Chips, its × removing it, else the plain Option there).
|
|
311
310
|
- `PickerRow` — a row its list shows.
|
|
312
311
|
- `RowsInput` — what its rows are worked out from.
|
|
313
312
|
- `pickerRows` — what its list shows: the empty row, the headings, the matches, Create, loading more.
|
|
@@ -325,7 +324,7 @@ Their stylesheets are `input.css`, `inline-input.css`, `field.css`, `toggle.css`
|
|
|
325
324
|
## The Select
|
|
326
325
|
|
|
327
326
|
- `Select` — a field to pick one or several from a closed list: the Input's box, its list the Picker under it on a computer and in the full Sheet on a phone; typed into (`searchIn="field"`), with chips, a search, Create, a server search, a clear row; or alone (`opens`), owning no list; its label over the box, or inside it before its value on the outline Button (`labelAt`).
|
|
328
|
-
- `SelectProps` — its props.
|
|
327
|
+
- `SelectProps` — its props, `clearLabel` among them: the × that empties a typed Select, by default the kit's word, which inside ViewKit's panels is your `views.menus.clear` (its chips' × and its chevron likewise say `views.editors.tag-remove` or `views.picker.remove`, and `views.picker.show-every` or `views.picker.show-all`).
|
|
329
328
|
- `SelectListProps` — its props with a list of its own.
|
|
330
329
|
- `SelectAloneProps` — its props alone, owning no list.
|
|
331
330
|
- `SelectItem` — a choice; `avatar` says its mark is the app's own Avatar atom, which a typed field's chip draws again at `chip` (ViewKit's own Avatar is drawn again at 16 with no flag, VK-1044).
|
|
@@ -388,7 +387,7 @@ One of a few choices, all of them in sight, on Base UI's radio group: the arrow
|
|
|
388
387
|
What a list's sort opens, Attio's: the view's rules in order, the first sorting first, three at most, one per field (a place by one of its parts). Every change is handed on as it is made, so the list sorts again at once. Its stylesheet is `viewkitjs/views/controls/sort-editor.css`; its root marks a phone from the device (`data-vk-phone`).
|
|
389
388
|
|
|
390
389
|
- `SortEditor` — the body alone, for a shell that holds only a body (the Popover, Customize's Sort): its props are `SortEditorProps`.
|
|
391
|
-
- `useSortEditor` — the editor's state and its parts (`SortEditorParts`): the `body`, and on a phone the Sheet head's ✕ and ✓, or on a step its Back (`head.onBack`) and its `title`. Its props (`SortEditorProps`): `label`, the `fields` (Picker rows, each with its mark; one leading one level in holds its own), the `rules`, `onRulesChange` (the whole rules, and the set-aside sorts left when one of them is written), `max`, `form` (`computer`, `phone`, or `narrow`: the phone's structure at a computer's sizes, for a narrow place), `onDone`, the fields' `search` words, `aside` (the sorts set aside, `SortAside`s), `fieldOf` (the field a sort key sorts, so a place sorts once by one of its parts), `addSort` (Add sort at a computer's foot, true unless said), `words`, and for a page standing still `lifted`, `opens` (`SortEditorOpens`) and `level`. On a computer each rule is its grip, its field's and its direction's Select, and ×, with Add sort and Clear all sorts at the foot; the set-aside sorts follow, each its field's box dashed in the warning colour with why, its direction greyed, ⋯ holding why, Put back and Delete. On a phone each rule is a card row, its direction under its name; a press turns the body to its direction, Add sort to the fields, a set-aside sort's row to the fields to point it at one: steps of the same sheet, never a sheet on top. The body answers no Escape: its holder's sheet does. Its hook joins this door as `useSortEditor`, and the body alone as `SortEditor`, once VK-727 retires the panels' older sort editor of those names.
|
|
390
|
+
- `useSortEditor` — the editor's state and its parts (`SortEditorParts`): the `body`, and on a phone the Sheet head's ✕ and ✓, or on a step its Back (`head.onBack`) and its `title`. Its props (`SortEditorProps`): `label`, the `fields` (Picker rows, each with its mark; one leading one level in holds its own), the `rules`, `onRulesChange` (the whole rules, and the set-aside sorts left when one of them is written), `max`, `form` (`computer`, `phone`, or `narrow`: the phone's structure at a computer's sizes, for a narrow place), `onDone`, the fields' `search` words, `aside` (the sorts set aside, `SortAside`s), `fieldOf` (the field a sort key sorts, so a place sorts once by one of its parts), `addSort` (Add sort at a computer's foot, true unless said), `words`, and for a page standing still `lifted`, `opens` (`SortEditorOpens`) and `level`. On a computer each rule is its grip, its field's and its direction's Select, and ×, with Add sort and Clear all sorts at the foot; the set-aside sorts follow, each its field's box dashed in the warning colour with why, its direction greyed, ⋯ holding why, Put back and Delete. On a phone each rule is a card row, its direction under its name; a press turns the body to its direction, Add sort to the fields, a set-aside sort's row to the fields to point it at one: steps of the same sheet, never a sheet on top. The body answers no Escape: its holder's sheet does. Its hook joins this door as `useSortEditor`, and the body alone as `SortEditor`, once VK-727 retires the panels' older sort editor of those names. Its props take `items` (its menus as data, `menus.sortEditor`, VK-1063).
|
|
392
391
|
- `useSortEditorParts` — `useSortEditor`, under its name before the body took the plain one; kept.
|
|
393
392
|
- `SortEditorProps` — its props; `clearAll` (default on) draws Clear all at its foot, off inside Customize.
|
|
394
393
|
- `SortEditorParts` — its parts: the body, the head's buttons, and on a phone's step its title and Back.
|
|
@@ -463,7 +462,7 @@ A view's menu and what it opens (VK-823), for an app that draws its own menu or
|
|
|
463
462
|
What an advanced filter opens on a computer and Filter on a phone, Attio's: the view's rules, each Where or its level's join, its field, how it compares and its value in its type's own box, joined by And or Or, in groups three deep; a relation rule's block (its relation, Any, None or Every where, its rules on that relation's fields inside, Add filter and Delete condition), which a rule on a related field's ⋮ makes with None or Every, Every waiting until a rule in it narrows; a group's ⋮ with Exclude matches (a group joined by And), an excluded group saying so; and the filter part, what a filter's way and value open on the bar. A body, as the sort editor is: the Popover holds it on a computer and the Sheet on a phone. Every word is handed (`words`). Its stylesheet is `viewkitjs/views/controls/filter-editor.css`; its root marks a phone from the device (`data-vk-phone`).
|
|
464
463
|
|
|
465
464
|
- `FilterEditor` — the body alone, for a shell that holds only a body (the Popover): its props are `FilterEditorProps`.
|
|
466
|
-
- `useFilterEditor` — the editor's state and its parts (`FilterEditorParts`): the `body`, and on a phone the Sheet head's ✕ and ✓, or on a step its Back (`head.onBack`) and its `title`. Its props (`FilterEditorProps`): `label`, the `fields` (each typed, a choice's values with it; one leading one level in holds its own), the `filter`, `onFilterChange`, `at`, `ids`, `levels`, `form` (`computer`, `phone`, or `narrow`), `onDone`, `standing`, `own` (ViewKit's own words and value body for a rule the kit has no box for), `excludable` (whether the filter itself may exclude its matches: an advanced filter's own group, its foot then holding a group's ⋮ too) and `words`. On a phone each box's list, a date, a value ViewKit draws, Add filter, a block's quantifier and a rule's or a group's ⋯ turn the body to a step of the same sheet, never a sheet on top; the body answers no Escape: its holder's sheet does. Its hook joins this door as `useFilterEditor`, and the body alone as `FilterEditor`, once VK-727 retires the panels' older filter editor of that name.
|
|
465
|
+
- `useFilterEditor` — the editor's state and its parts (`FilterEditorParts`): the `body`, and on a phone the Sheet head's ✕ and ✓, or on a step its Back (`head.onBack`) and its `title`. Its props (`FilterEditorProps`): `label`, the `fields` (each typed, a choice's values with it; one leading one level in holds its own), the `filter`, `onFilterChange`, `at`, `ids`, `levels`, `form` (`computer`, `phone`, or `narrow`), `onDone`, `standing`, `own` (ViewKit's own words and value body for a rule the kit has no box for), `excludable` (whether the filter itself may exclude its matches: an advanced filter's own group, its foot then holding a group's ⋮ too) and `words`. On a phone each box's list, a date, a value ViewKit draws, Add filter, a block's quantifier and a rule's or a group's ⋯ turn the body to a step of the same sheet, never a sheet on top; the body answers no Escape: its holder's sheet does. Its hook joins this door as `useFilterEditor`, and the body alone as `FilterEditor`, once VK-727 retires the panels' older filter editor of that name. Its props take `items` (its menus as data, by its own rule and group ids; its map hands the app public terms instead, VK-1063).
|
|
467
466
|
- `useFilterEditorParts` — deprecated: `useFilterEditor`, under its name before the body took the plain one.
|
|
468
467
|
- `FilterEditorProps` — its props; `clearAll` (default on) draws Clear all at its foot, off inside Customize.
|
|
469
468
|
- `FilterEditorParts` — its parts: the body, the head's buttons, and on a phone's step its title and Back.
|
|
@@ -522,7 +521,7 @@ What an advanced filter opens on a computer and Filter on a phone, Attio's: the
|
|
|
522
521
|
What Customize's Group opens: the list's group as the Menu list's rows. Group by, Order, Direction, a date field's Date step and Hide empty groups, each saying what it is and opening its choices in place; then the groups under their heading, each its grip, its name and its Switch, dragged into your own order, Hide all (Show all once none shows) at the heading; Remove grouping at its foot. A body: Customize holds it, a screen in its panel on a computer and a step of its sheet on a phone. A setting's choices stand in place of the settings, and the editor hands their name and the way back to its holder (`level`), whose head shows them. Every word is handed (`words`). Its stylesheet is `viewkitjs/views/controls/group-editor.css`; its root marks a phone from the device (`data-vk-phone`).
|
|
523
522
|
|
|
524
523
|
- `GroupEditor` — the body alone, for a shell that holds only a body: its props are `GroupEditorProps`.
|
|
525
|
-
- `useGroupEditor` — the editor's state and its parts (`GroupEditorParts`): the `body`, and the `level` it stands on. Its props (`GroupEditorProps`): `label`, the `fields` (Picker rows; one leading one level in holds its own), `ownOrders` (a field's own order, in its words), `orders` (the orders each field offers), `manualOrder` (whether Your own may be picked), `steps` (each date field's steps), the `group`, the groups as `values` (each with its count), `onGroupChange` (the whole group, null once taken off), `search`, `form`, `words`, and for a page standing still `opens` and `opensLevel`. The body alone, `GroupEditor`, joins this door with VK-727, beside the other panels' bodies.
|
|
524
|
+
- `useGroupEditor` — the editor's state and its parts (`GroupEditorParts`): the `body`, and the `level` it stands on. Its props (`GroupEditorProps`): `label`, the `fields` (Picker rows; one leading one level in holds its own), `ownOrders` (a field's own order, in its words), `orders` (the orders each field offers), `manualOrder` (whether Your own may be picked), `steps` (each date field's steps), the `group`, the groups as `values` (each with its count), `onGroupChange` (the whole group, null once taken off), `search`, `form`, `words`, and for a page standing still `opens` and `opensLevel`. The body alone, `GroupEditor`, joins this door with VK-727, beside the other panels' bodies. Its props take `items` (its rows as data, `menus.groupEditor`, VK-1063; its settings open and take the focus back by key).
|
|
526
525
|
- `GroupEditorProps` — its props.
|
|
527
526
|
- `GroupEditorParts` — its parts: the body, and the level it stands on (its name and the way back), null at the settings.
|
|
528
527
|
- `GroupEditorValue` — a group as the editor draws it: its value, its name, its mark, its count.
|
|
@@ -551,7 +550,7 @@ What Customize's Group opens: the list's group as the Menu list's rows. Group by
|
|
|
551
550
|
What View settings opens: the view's sections as the Menu list's rows, Layout, Columns, then each of Filter, Sort and Group it is handed, each saying where it stands and opening its screen in place, then its toggles (Show counts among them). Layout is the layout cards (none on a phone offered one layout) and the layout's own settings: its pick-one settings (a density, a board's field) each opening its choices in place, and its toggles under their sections, with nothing after them. A section that differs from the view as saved shows its value in the brand (`differs`, and the sections' own `inForce`), a section at rest in the normal colour. Each section's screen (Layout, Columns, Filter, Sort, Group) carries its own Reset while it is handed one (`resets`), in the first page's Reset's word and look and place, never on a level the screen opened in place; inside Customize the sort's and the filter's own Clear all give way to it. Columns is a search, the shown columns, each its grip, its mark, its name and its Switch, dragged into place, the first one locked, the hidden ones under Hidden, Hide all and Show all at the headings. A column with settings of its own or the app's rows for its field carries a › after its Switch, opening its level in Columns' place: Shown, its pick-one settings each opening in place, its toggles under their sections, then the app's rows; on a card layout each field carries its new-line Toggle, refused with its reason on the card's first field and a hidden one; and the app's rows under Columns' rows (Add field) stand at its foot. A list's per-field filters stand as rows after Columns and its time range and date ranges after Group, each saying what it holds and opening its screen (choices to pick one of, choices to check, or a body of its own with its level), or, folded, all behind one Filter row. Its head is the view's name renamed in place, or a title, as its options say; its footer, Copy link and Export CSV, each where handed; Reset and Save over it once something changed, with the shared view's stale note. A body: on a computer the Pane holds it where an app hands a Pane, and elsewhere (the toolbar's popover) it draws the same head, body and foot in a frame of its own; on a phone it hands the Sheet its head and foot, each section's step under that one head. Every word is handed (`words`). Its stylesheet is `viewkitjs/views/controls/customize.css`; its options are `CUSTOMIZE_LOOKS`; its root marks a phone from the device (`data-vk-phone`).
|
|
552
551
|
|
|
553
552
|
- `Customize` — the body alone, for a shell that holds only a body: its props are `CustomizeProps`.
|
|
554
|
-
- `useCustomize` — its state and its parts (`CustomizeParts`): the `body`, the `level` it stands on (a layout's choice, a column's settings, a section's level) or `null`, and on a phone the Sheet's `title`, `head` (Back and ✕) and `foot`. Its props (`CustomizeProps`): the `view`, `onViewChange` (the whole view, each change as it is made), the `layouts`, the `filter`, `sort` and `group` sections, `changed` with `onReset` and `onSave`, `pending`, `stale`, `exportCount` with `onCopyLink` and `onExport`, `toggles`, `layoutSettings`, `resets` (each section's own Reset), `differs` (a section that differs from the view as saved, its value in the brand: Layout and Columns marked only where handed, VK-1048), `columnsReset` (deprecated: read as `resets.columns`), `onLineChange` (a card's field starting a new line, turned on or off), `columnsFoot` (the app's rows under Columns' rows), `fields` and `foldFields` (a list's per-field filters, its time range and date ranges, `CustomizeField`), `onClose` (outside a Pane, the title head's ✕), `onScreenChange`, `words`, `form`, and for a page standing still `screen`. The body alone, `Customize`, joins this door with VK-727, beside the other panels' bodies.
|
|
553
|
+
- `useCustomize` — its state and its parts (`CustomizeParts`): the `body`, the `level` it stands on (a layout's choice, a column's settings, a section's level) or `null`, and on a phone the Sheet's `title`, `head` (Back and ✕) and `foot`. Its props (`CustomizeProps`): the `view`, `onViewChange` (the whole view, each change as it is made), the `layouts`, the `filter`, `sort` and `group` sections, `changed` with `onReset` and `onSave`, `pending`, `stale`, `exportCount` with `onCopyLink` and `onExport`, `toggles`, `layoutSettings`, `resets` (each section's own Reset), `differs` (a section that differs from the view as saved, its value in the brand: Layout and Columns marked only where handed, VK-1048), `items` (its rows as data, `ViewsCustomizeItems`: handed each page's default rows, its list's, Layout's and Columns', it hands back the rows drawn, VK-1062; a disabled row with no reason says `words.unavailable`, "Not available"), `columnsReset` (deprecated: read as `resets.columns`), `onLineChange` (a card's field starting a new line, turned on or off), `columnsFoot` (the app's rows under Columns' rows), `fields` and `foldFields` (a list's per-field filters, its time range and date ranges, `CustomizeField`), `onClose` (outside a Pane, the title head's ✕), `onScreenChange`, `words`, `form`, and for a page standing still `screen`. The body alone, `Customize`, joins this door with VK-727, beside the other panels' bodies.
|
|
555
554
|
- `useCustomizeWorn` — its options as the frame round it wears them, kept up to date as they change.
|
|
556
555
|
- `layoutMark` — a layout's mark by its id: table, board, list, calendar, timeline.
|
|
557
556
|
- `CustomizeProps` — its props.
|
|
@@ -711,6 +710,7 @@ Its frame and its separator are `ToolbarControl` and `ToolbarSeparatorControl`:
|
|
|
711
710
|
- `ToolbarProps` — its props.
|
|
712
711
|
- `ToolbarOverflowControl` — ⋯ as you draw it: `icon` (your glyph over ViewKit's dots), `className` (put on it) and `button` (your button, drawn in its place and handed the very props the Toolbar button would get, `ref` and what its Menu sets to open from it included: spread them on yours). Absent, ViewKit's own ⋯.
|
|
713
712
|
- `ToolbarMoreControl` — "+N" or "+N filters" as you draw it: `className` (put on it) and `button` (your button, drawn in its place and handed the very props the Toolbar button would get, `ref`, its words and what its Menu, or `onMoreViews`, sets to open from it included: spread them on yours). Absent, ViewKit's own.
|
|
713
|
+
- `ToolbarOwnButtonProps` — what the Toolbar hands your own ⋯, "+N" or "+N filters" button: a Toolbar button's props (`ToolbarButtonProps`), its `style` a plain one, never Base UI's state function. Type your button with it and spread what is left after the props you draw yourself onto a plain `<button>`, with no cast; a button typed with `ToolbarButtonProps` is still taken.
|
|
714
714
|
- `ToolbarPlace` — a place: what it draws, or a function of where it stands.
|
|
715
715
|
- `ToolbarAt` — where a place stands: `row`, `right`, `bar` or `phone`.
|
|
716
716
|
- `ToolbarSeparatorControl` — a line between what belongs together and what doesn't.
|
|
@@ -751,7 +751,7 @@ What picked rows bring, the Outright kit's (after Attio's): on a computer a surf
|
|
|
751
751
|
|
|
752
752
|
## The Text editor
|
|
753
753
|
|
|
754
|
-
`CONTROLS` fills its `TextBody` with the Text editor: ViewKit's text bodies, held as a shell that keeps the draft. A line, an email, a phone, a link and a domain type into the inline input over the cell, growing over the rows below a row at a time to eight; long text and rich text are its long text, as plain lines; a url is a link. A phone opens with its country first (its country, its dial code and its country's pattern, the countries the Picker's list in a Popover, on a phone a step of the Sheet), its extension after its digits and kept. In a field row (`place: "row"`) it stands in the row's flow instead: a line one list row high (28px), long text growing with its text to 320px, then scrolling, so the row grows with it. ViewKit's text editor keeps the draft, Escape, Tab, ⌘ or Ctrl Enter, the check and the save; a refusal is the host's to show.
|
|
754
|
+
`CONTROLS` fills its `TextBody` with the Text editor: ViewKit's text bodies, held as a shell that keeps the draft. A line, an email, a phone, a link and a domain type into the inline input over the cell, growing over the rows below a row at a time to eight (in a grid's cell they grow from the cell, as its In the cell look does); long text and rich text are its long text, as plain lines; a url is a link. A phone opens with its country first (its country, its dial code and its country's pattern, the countries the Picker's list in a Popover, on a phone a step of the Sheet), its extension after its digits and kept. In a field row (`place: "row"`) it stands in the row's flow instead: a line one list row high (28px), long text growing with its text to 320px, then scrolling, so the row grows with it. ViewKit's text editor keeps the draft, Escape, Tab, ⌘ or Ctrl Enter, the check and the save; a refusal is the host's to show.
|
|
755
755
|
|
|
756
756
|
- `useTextEditor` — the Text editor, as the parts a shell pours in: its `body` (on a computer what stands in the cell, on a phone what the Sheet's body holds), and on a phone the Sheet head's buttons (`head`) and a step's `title`. Standing alone (`draft: "own"`, the default) it keeps on Enter or a press elsewhere and leaves on Escape, says why a value is refused just under the box, and on a phone hands its head ✕ and ✓; held (`draft: "shell"`) it hands every change, the whole text each time, and keeps nothing. Its props are `TextEditorProps`.
|
|
757
757
|
- `TextEditor` — the body alone, for a shell that holds only a body.
|
|
@@ -780,7 +780,7 @@ What picked rows bring, the Outright kit's (after Attio's): on a computer a surf
|
|
|
780
780
|
- `TEXT_EDITOR_ATTRS` — the attributes it watches, so a look changed while it is open reaches it.
|
|
781
781
|
- `TextEditorWorn` — its options as worn.
|
|
782
782
|
- `TEXT_EDITOR_WORDS` — its words, in English: a phone's country button and its list's search. `CONTROLS.TextBody` hands the app's (`views.editors.place-country`, `views.editors.place-country-search` and the Picker's), and names a phone's countries in the conventions' `language`.
|
|
783
|
-
- `TextEditorWords` — those words, and its list's own (`picker`).
|
|
783
|
+
- `TextEditorWords` — those words, `close` and `save` (a phone's ✕ and ✓ where no holder keeps the draft; the map hands `views.panels.close` and `views.editors.save`), and its list's own (`picker`).
|
|
784
784
|
- `textWords` — the words handed, over the English.
|
|
785
785
|
|
|
786
786
|
Its stylesheet is `viewkitjs/views/controls/text-editor.css`, beside the inline input's, the Input's, the Field's, the Button's, the Popover's, the Picker's and the list's; its names are on [its page](../controls/text-editor.md).
|
|
@@ -789,7 +789,7 @@ Its stylesheet is `viewkitjs/views/controls/text-editor.css`, beside the inline
|
|
|
789
789
|
|
|
790
790
|
`CONTROLS` fills its `Picker` with the Picker: ViewKit's select, status, several-values, relation and set editors open it, handed their rows as data, the panel round it keeping the draft and, on a phone, its ✕ and ✓, so the Picker is told the shell keeps them and hands every change. Its words are ViewKit's `views.picker.*` messages, so an app's own words reach it. A status field's steps come as `steps`: an archived option held stands outside them, as its cell draws it. It fills its `FieldsBody` with the Picker too: the sort's and the filter's field lists, each field its column's glyph, one that can't be picked greyed with why, a relation under Related records with its far fields one level in. The Picker's stylesheet, `viewkitjs/views/controls/picker.css`, stands on the Avatar's, the Button's, the Checkbox's, the Glass button's, the Input's, the Kbd's, the Menu's, the Option's, the Spinner's, the Status's, the Sheet's, the scrollbar's, the list's and the popup line's.
|
|
791
791
|
|
|
792
|
-
- `pickerItemsOf` — ViewKit's rows (`ViewsPickerItem`) as the Picker's: an avatar, the record's glyph, a status at its place (its quarters among `steps` when handed), an option, or the app's icon (handed `AppIcon`). Handed `cells: true`, as `CONTROLS.Picker` hands it, a status and an option are drawn as their cells draw them: your `StatusBadge` and `Tag` atoms, in the option's colour (a chip row, `as: { chip }`). For an app's own list in the Picker; the editors' own `pickerItemOf` is another, internal one.
|
|
792
|
+
- `pickerItemsOf` — ViewKit's rows (`ViewsPickerItem`) as the Picker's: an avatar, the record's glyph, a status at its place (its quarters among `steps` when handed), an option, or the app's icon (handed `AppIcon`). Handed `cells: true`, as `CONTROLS.Picker` hands it, a status and an option are drawn as their cells draw them: your `StatusBadge` and `Tag` atoms, in the option's colour (a chip row, `as: { chip }`); an option in its colour stands held among the search's chips (the look Chips) as your `Tag` too, with its remove (`removable`). For an app's own list in the Picker; the editors' own `pickerItemOf` is another, internal one.
|
|
793
793
|
|
|
794
794
|
## The Date editor
|
|
795
795
|
|
|
@@ -799,6 +799,12 @@ Its stylesheet is `viewkitjs/views/controls/text-editor.css`, beside the inline
|
|
|
799
799
|
|
|
800
800
|
- `useDateEditor` — the Date editor, as the parts a shell pours in: its `body`, and on a phone the Sheet head's ✕ and ✓ (`head`). Standing alone (`draft: "own"`, the default) it keeps on Enter, Escape or a press elsewhere and, on a phone, hands its head ✕ and ✓; held (`draft: "shell"`) it hands every change as it is made and keeps nothing. Its `words` and `language` say what it writes.
|
|
801
801
|
- `DateEditor` — the body alone, for a shell that holds only a body.
|
|
802
|
+
- `useDateEditorBehaviour` — the Date editor's behaviour with no drawing, for your own date body (handed as `DateBody`) or editor: what it holds, what the line reads and why it is refused, its quick picks with their days and words, its actions (`pick`, `enterDay`, `moveKey`, `moveMonth`, `type`, `setDay`, `setTime`, `keep`, `leave`) and the props to spread on its root (`root`) and its line (`line`). Enter keeps and closes, a refused line stays open, a day on a date and time stays open for the time; standing alone on a computer a press elsewhere and Escape keep. In a `DateBody`, pass `draft: "shell"` yourself (and `words: dateEditorWordsOf(conventions.messages)` and the conventions' `language`, as ViewKit's own body does): held, it hands every change, and ViewKit's date editor keeps the draft, Escape, Tab out, the save and the undo. ViewKit's own Date editor is drawn on it.
|
|
803
|
+
- `DateEditorBehaviourProps` — its props: the Date editor's `value`, `onValueChange`, `onDone`, `time`, `empty`, `days`, `picks`, `today`, `typed`, `autoFocus`, `form`, `draft`, `words` and `language`, and `line`: `box` (the default, empty at rest) or `written` (the day held written out, the first key or a delete starting over).
|
|
804
|
+
- `DateEditorBehaviour` — what `useDateEditorBehaviour` hands back.
|
|
805
|
+
- `dateEditorWordsOf` — the Date editor's words in your conventions' messages (`date.*` and `time.*`), as ViewKit's own date body takes them: hand them to `useDateEditorBehaviour` or the Date editor as `words`.
|
|
806
|
+
- `DateEditorRootProps` — the props for the element that holds it: `ref`, `onBlur`, `onFocus`, `onKeyDown`.
|
|
807
|
+
- `DateEditorLineProps` — the props for its line: `ref`, `value`, `aria-invalid`, `onChange`, `onKeyDown`, `onBeforeInput`.
|
|
802
808
|
- `DateEditorProps` — its props: the field's `label`, its `value` (`"2026-11-12"`, `"2026-11-12T14:30"` or null), `onValueChange`, `onDone`, `time`, `empty`, `days`, `picks`, `today`, `typed`, `opens`, `autoFocus`, `form`, `worn`, `draft`, `words` and `language`.
|
|
803
809
|
- `DateEditorParts` — what `useDateEditor` hands back: its `body` and its phone `head`.
|
|
804
810
|
- `useDateEditorWorn` — the options worn round an element, as a ref callback and what it wears, read again as a frame's attributes change.
|
|
@@ -881,7 +887,7 @@ Its stylesheet is `viewkitjs/views/controls/date-editor.css`, beside the Button'
|
|
|
881
887
|
- `regionFor` — a region typed, read against a country.
|
|
882
888
|
- `placeOf` — what a place's draft keeps: its country and its parts, trimmed; null when nothing is left.
|
|
883
889
|
- `COMPOUND_EDITOR_WORDS` — its words, in English: a name's boxes and what is said under the full name, a place's country, its lists' searches and empty rows, a range's ends and its number boxes' names. `CONTROLS.PartsBody` hands the app's (`views.editors.*`, listed in the contract) and, with no country held, each box's words for none.
|
|
884
|
-
- `CompoundEditorWords` — those words, a word naming a region taking the region's own word, and its lists' own (`picker`).
|
|
890
|
+
- `CompoundEditorWords` — those words, a word naming a region taking the region's own word, `close` and `save` (as the Text editor's), and its lists' own (`picker`).
|
|
885
891
|
- `compoundWords` — the words handed, over the English.
|
|
886
892
|
- `placeText` — what a cell shows of a place: an address its street and city, a person's place its city and country.
|
|
887
893
|
- `placeLine` — what a cell shows of a place in Attio's look: every part held, joined by commas.
|
|
@@ -915,7 +921,7 @@ A name's `NameValue` and `sameName`, and a range's `rangeText`, stay inside the
|
|
|
915
921
|
- `NumberEditorWorn` — its options as worn.
|
|
916
922
|
- `NUMBER_EDITOR_WORDS` — its words, in English: its lists' names and searches, the code button's name and the number field's steps. `CONTROLS.NumberBody` hands the app's (`views.menus.currency`, `views.editors.number-*`, listed in the contract).
|
|
917
923
|
- `numberWords` — the words handed over the English.
|
|
918
|
-
- `NumberEditorWords` — those words, and its lists' own (`picker`).
|
|
924
|
+
- `NumberEditorWords` — those words, `close` and `save` (as the Text editor's), and its lists' own (`picker`).
|
|
919
925
|
|
|
920
926
|
Its stylesheet is `viewkitjs/views/controls/number-editor.css`, beside those of the controls it draws with; its names are on [its page](../controls/number-editor.md).
|
|
921
927
|
## The Values editor
|
|
@@ -16,7 +16,7 @@ Guide: [display](../guides/display.md).
|
|
|
16
16
|
- A boolean's: `booleanIcon` (the two-state glyph), `marker`, `markerReason` and `onResolve` (the marker style's words, reason and clearing verb), `onToggle` (its presence makes a checkbox or icon boolean clickable; without it the glyph is plain), `booleanDisabled` (keeps the control's shape, disabled) and `booleanCheckbox` (a checkbox control, `ViewsCheckboxProps`, the checkbox style draws alone in place of the tick box and its switch: handed `checked`, the field's label, `tabIndex` -1 and `onCheckedChange`, or `readOnly` without `onToggle`).
|
|
17
17
|
- A relation's: `entityIcon` (your glyph for an entity kind) and `relationWrap` (where a chip goes; absent, the chip is inert).
|
|
18
18
|
- The host's slot: `slotOwnsClick`, set by a host whose own element is the button, such as a calendar card. Every core then draws bare content: an overflow count as plain text, a boolean with no toggle. `hostOwnsPlainClick`, set by a host whose plain click on a value is its own, such as the grid: an email, phone, url or domain stays a link, marked `data-cell-link`, not draggable, and lets its click through for the host to decide.
|
|
19
|
-
- `RelationWrap` — the type of `relationWrap`: `(relation, chip) => ReactNode`. The core draws the chip (its picture or glyph, through your `Avatar` atom, and its label); your function wraps it in your own link or button, since where a record opens is your app's.
|
|
19
|
+
- `RelationWrap` — the type of `relationWrap`: `(relation, chip) => ReactNode`. The core draws the chip (its picture or glyph, through your `Avatar` atom, in one slot the photo's size, 16px, a smaller glyph centred in it, so every chip's label starts at the same place; and its label); your function wraps it in your own link or button, since where a record opens is your app's.
|
|
20
20
|
- `MultiValueCell` — the layout for a value that holds several: several emails, phones, links or domains, a multiselect, the far side of a relation. It takes `items` (one drawn node per value), and optionally `details` (a word beside each value in the list, never in the cell), `wrap`, `title` (the native hover text) and `slotOwnsClick`. On one line it shows as many whole values as fit its width (at most 20 are measured), or three when wrapped, then a `+N` count that opens every value in a read-only list in the components map's `Popover`, drawn with the `List` and `Row` atoms. With `slotOwnsClick` the count is plain text and nothing opens. No items draws nothing.
|
|
21
21
|
It follows its width, and the first shows cut when even it doesn't fit. With the provider's `severalValues: "first"`, on one line it shows its first value and the count instead, at any width. The count is drawn by the `CellMore` atom inside `data-slot="vk-cell-more"`, with `data-open` while the list is open.
|
|
22
22
|
- `ConvertedFigure` — a money figure shown in another currency than its record's own, marked: ≈ before its `children`, and a title naming the currency it came `from` ("Converted from USD", the `views.display.converted-from` message). `renderTypedCellValue` draws it around a converted cell, and a field row around a figure its host reads in another currency; an app draws it on a surface of its own.
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Import from `viewkitjs/views/field-row` in a client component, under your `ViewsProvider`: the door opens with the client directive. It holds a record's field row: one field drawn as its label, its value and, on a click, its type's editor in place, and the write path that admits each edit at once, queues one record's writes, settles each on the save's receipt and rolls a failure back. The row knows no entity, only a binding, a value and a commit, so your app builds its record's panel (its sections, its related records) around the rows. It draws with your provider's `Popover`, `Sheet`, `Collapse`, `AppIcon`, icons, `CommandMenu` atom and toast port. The shapes its writes go through (the write target, the receipt, the admission, a value's note, the reconciliation error) are the root door's, described under [A write's target](views.md#a-writes-target), and this door re-exports them. Guide: [editors](../guides/editors.md).
|
|
4
4
|
|
|
5
|
-
- `FieldRow` — one field of a record: a glyph (the binding's `icon` through your `AppIcon`, else the type's icon), the label, and the value drawn by the display. Outside a Field rows card (below), below the provider's `desktopQuery` the label stands above the value, which then takes the row's width; at it and above, glyph, label and value share one line. A writable row holding nothing draws your `views.field-row.empty` word, muted; a read-only one draws "—". A writable row's edit button is named by the label, then the value as it is drawn ("Stage, Won"; "Terms, Empty" for a row holding nothing); a row still loading, and a rich text laid over its button, are named by the label alone. A writable row opens its type's editor on a click, through the editor panel and one edit session: a picker (a select, a date, several tags, a relation or a set of records, several values, a place) anchored under the value in your `Popover` on a desktop and in your `Sheet` on a phone, by the provider's `desktopQuery`; a typed value (text, a number, money) in its own box on every width; a name and a range open your `PartsBody` anchored under the value, as a place does; and a single email or domain opens the value list holding one value, anchored, where the provider's `oneValue` says `list` for its type. Escape throws the edit away, unless the provider's `escape` keeps the field's type, on a desktop, where it keeps what was typed and a refusal stays open until a second Escape throws the edit away; a sheet's swipe or ✕ changes nothing. On a desktop the date editor opens with the keyboard in your `DateBody`, as a place's or a long select's does; and with an editor open in its popover, an Escape heard from the page itself or from an element holding the row closes that editor and goes no further, so a drawer around the row hears only the next one. On a desktop, a select gives your Picker the keys however it opened, by Enter, Space or a pointer: the focus in its search, the arrows going on from the value it holds, and Enter picking the one lit (opened by a key, an Enter at once changes nothing). As the editor takes the place of the row's button, the row holds the focus the button held until the editor takes it, so the focus never falls to the page: a dialog around the row that takes such a focus back to itself (Base UI's) leaves a text's or a number's editor open. On a desktop, an editor closed by Tab, Shift-Tab, Escape, Enter or a pick puts the focus back on the row's own button, once its exit has played out and a write still saving has saved, so the next Tab moves on from that row; a press or a focus outside an editor's panel since the close lets that go, so a row opened meanwhile keeps its editor, and an outside press leaves the focus where it put it. A Tab pressed while that exit plays (a Tab at once after a pick by the keys) is the person going on: it is taken from the row's button once the button is back, so the focus lands on the next control after the row (Shift-Tab, the one before), as a later Tab does. A relation saves what its row stores (an id, a ref with the picked record's kind, or a set of records with its lead); a date field has no time and offers No date where it may be empty; several values read a phone typed without its code in the binding's `region`. A value of several parts inside a writable row draws its count as plain text: the row's press opens the editor, which lists them all. A single email, phone, link or domain in a writable row reads as plain text too, with an open action beside the row's button (a mail, a call, the site), and a writable rich text lies over its button, so its links and "Show more" keep their own press while a press on its text edits. A money figure its host reads in another currency than the record's own (it hands the converted figure as `value` and that currency as `opts.currency`) is marked ≈ with the currency it came from, and its editor names it under the record's own amount. A boolean commits from its own control, a `command` field opens its verbs, and a read-only row draws a lock with its reason. A refused commit keeps the editor open with the reason under it, a saved value shows at once and stays until the receipt settles it, and a failed save rolls back with a retry. A text, an email, a phone, a link, a domain, long or rich text edits in place in the row; handed the components map's `TextBody`, the row opens it there, at every width, with the field's own check and the record's country. A number, money or a percent edits in place too; handed `NumberBody`, the row opens it there, at every width, with the field's own check and its limits (a duration keeps the editor's own box).
|
|
5
|
+
- `FieldRow` — one field of a record: a glyph (the binding's `icon` through your `AppIcon`, else the type's icon), the label, and the value drawn by the display. Outside a Field rows card (below), below the provider's `desktopQuery` the label stands above the value, which then takes the row's width; at it and above, glyph, label and value share one line. The row says its form in `data-form`: `computer` (one line), `phone` (the label above the value) or `rows` (a Field rows card's row on a phone); outside a card the two forms differ only by what reads it. A server render can't ask the screen, so a row outside a card stands in both forms, and a card stands whole in both, CSS showing the one your `desktopQuery` picks: a phone's first paint is the phone's, and as the page comes alive the screen's form is the one kept, the very elements the person saw. A writable row holding nothing draws your `views.field-row.empty` word, muted; a read-only one draws "—". A writable row's edit button is named by the label, then the value as it is drawn ("Stage, Won"; "Terms, Empty" for a row holding nothing); a row still loading, and a rich text laid over its button, are named by the label alone. A writable row opens its type's editor on a click, through the editor panel and one edit session: a picker (a select, a date, several tags, a relation or a set of records, several values, a place) anchored under the value in your `Popover` on a desktop and in your `Sheet` on a phone, by the provider's `desktopQuery`; a typed value (text, a number, money) in its own box on every width; a name and a range open your `PartsBody` anchored under the value, as a place does; and a single email or domain opens the value list holding one value, anchored, where the provider's `oneValue` says `list` for its type. Escape throws the edit away, unless the provider's `escape` keeps the field's type, on a desktop, where it keeps what was typed and a refusal stays open until a second Escape throws the edit away; a sheet's swipe or ✕ changes nothing. On a desktop the date editor opens with the keyboard in your `DateBody`, as a place's or a long select's does; and with an editor open in its popover, an Escape heard from the page itself or from an element holding the row closes that editor and goes no further, so a drawer around the row hears only the next one. On a desktop, a select gives your Picker the keys however it opened, by Enter, Space or a pointer: the focus in its search, the arrows going on from the value it holds, and Enter picking the one lit (opened by a key, an Enter at once changes nothing). As the editor takes the place of the row's button, the row holds the focus the button held until the editor takes it, so the focus never falls to the page: a dialog around the row that takes such a focus back to itself (Base UI's) leaves a text's or a number's editor open. On a desktop, an editor closed by Tab, Shift-Tab, Escape, Enter or a pick puts the focus back on the row's own button, once its exit has played out and a write still saving has saved, so the next Tab moves on from that row; a press or a focus outside an editor's panel since the close lets that go, so a row opened meanwhile keeps its editor, and an outside press leaves the focus where it put it. A Tab pressed while that exit plays (a Tab at once after a pick by the keys) is the person going on: it is taken from the row's button once the button is back, so the focus lands on the next control after the row (Shift-Tab, the one before), as a later Tab does. A relation saves what its row stores (an id, a ref with the picked record's kind, or a set of records with its lead); a date field has no time and offers No date where it may be empty; several values read a phone typed without its code in the binding's `region`. A value of several parts inside a writable row draws its count as plain text: the row's press opens the editor, which lists them all. A single email, phone, link or domain in a writable row reads as plain text too, with an open action beside the row's button (a mail, a call, the site), and a writable rich text lies over its button, so its links and "Show more" keep their own press while a press on its text edits. A money figure its host reads in another currency than the record's own (it hands the converted figure as `value` and that currency as `opts.currency`) is marked ≈ with the currency it came from, and its editor names it under the record's own amount. A boolean commits from its own control, a `command` field opens its verbs, and a read-only row draws a lock with its reason. A refused commit keeps the editor open with the reason under it, a saved value shows at once and stays until the receipt settles it, and a failed save rolls back with a retry. A text, an email, a phone, a link, a domain, long or rich text edits in place in the row; handed the components map's `TextBody`, the row opens it there, at every width, with the field's own check and the record's country. A number, money or a percent edits in place too; handed `NumberBody`, the row opens it there, at every width, with the field's own check and its limits (a duration keeps the editor's own box).
|
|
6
6
|
- `FieldRowProps` — the row's props: `binding`, `row`, `value` (the display value), `editValue` (the stored value the editor opens on), `writable`, `ready` (false refuses gestures while the record loads), `unread` (the value isn't read yet, drawn blank), `refusal` (why it's read-only here), `onCommit` (admits or refuses a draft, then settles; an editor still open when the page or the row goes is asked as for a press outside, so it can be called inside `pagehide`), `opts` (display options), `menu` (a `command` field's verbs), `meta` (a few words in the value's line), `note` (a sentence under the value, with an optional quote a tap opens) and `kindIcon` (your icon name for a record kind, the glyph a relation's candidates wear; unanswered, they wear the type's glyph).
|
|
7
7
|
- `RowEditor` — the editor a row mounts for its field's type, picked from `ROW_HOSTS`.
|
|
8
8
|
- `ROW_HOSTS` — the host each field type mounts in a row, or `null` for a type the row never opens (a boolean, a derived or system field).
|
|
@@ -4,7 +4,7 @@ The spreadsheet. The door carries no client directive; every rendering file behi
|
|
|
4
4
|
|
|
5
5
|
## The grid
|
|
6
6
|
|
|
7
|
-
- `GridTable` — draws the spreadsheet: rows in their groups under a header whose column menus sort, group, format and hide, a checkbox rail and a ⋯ tail on each row, editors opened over cells, a selected range with copy, paste and undo, and a footer of figures per column. An edit shows in its cell at once and goes to `onCellCommit` (a batch to `onCellsCommit`); a failed write rolls the cell back. An undo or a redo shows its value, and takes the focus to its cell, as it is pressed; it is sent once the edit it takes back has answered, or at once when the page closes (`pagehide`), an editor still open writing its draft first. Back from the back-forward cache, an undo sent at the close may have reached the server before the edit it takes back: the cell then ends on the edit's stored value while redo still offers the undo. While `transitionPending` is true, or for one commit after `transitionKey` changes, it draws your app's loading atom instead of the rows, or, handed the components map's `RowsWait` and already showing rows, keeps them, inert, as that slot's children, its column names and footer standing outside the slot, as they are. It takes a `GridTableProps`.
|
|
7
|
+
- `GridTable` — draws the spreadsheet: rows in their groups under a header whose column menus sort, group, format and hide, a checkbox rail and a ⋯ tail on each row (its ⋯ drawn only where the grid was handed something it opens: `selection`, `contextMenu`, `rowMenu`, `menus.row`, `rowHref`, `onRowDelete` or a name action), editors opened over cells, a selected range with copy, paste and undo, and a footer of figures per column. An edit shows in its cell at once and goes to `onCellCommit` (a batch to `onCellsCommit`); a failed write rolls the cell back. An undo or a redo shows its value, and takes the focus to its cell, as it is pressed; it is sent once the edit it takes back has answered, or at once when the page closes (`pagehide`), an editor still open writing its draft first. Back from the back-forward cache, an undo sent at the close may have reached the server before the edit it takes back: the cell then ends on the edit's stored value while redo still offers the undo. While `transitionPending` is true, or for one commit after `transitionKey` changes, it draws your app's loading atom instead of the rows, or, handed the components map's `RowsWait` and already showing rows, keeps them, inert, as that slot's children, its column names and footer standing outside the slot, as they are. It takes a `GridTableProps`.
|
|
8
8
|
- `GridTableProps` — what `GridTable` takes, flat, typed over your row. Five are required: `groups` (the rows, as the model's `ListGroup`s), `grouped` (whether they draw as group bands), `getRowId`, `columns` (the model's `ListColumn`s) and `onOpenRow` (what opening a row does: the title's text opens it; it receives the row and a `GridRowOpenedFrom`, which brings the focus back to the row's cell once what it opened closes). The rest are optional:
|
|
9
9
|
- Rows and groups: `rowHref`, `onPrefetchRow` (warm a row's detail on a pointer's intent), `rowClassName`, `rowIcon` and `showRowIcon` (the title cell's glyph, as a descriptor the grid sizes and colours, or the row's picture through your `Avatar` atom when the descriptor hands an `avatar`), `onOpenRelation` and `entityIcon` (opening the record a relation cell points at, and the glyph for a kind; without `onOpenRelation`, relation cells are inert), `isCollapsed` and `onToggleGroup` (your group collapse), `oneHeader` (a grouped grid draws one row of column names, pinned at the top over every group, in place of each group's own; each group's bar pins under it, and the row's checkbox picks every row; off by default, when each group draws its own with the box that picks its rows), `pinFooter` (the footer pins at the foot of the grid's scroll area, `--vk-scroll-inset-bottom` above its edge and, while rows are selected, a step above the bar `renderBar` draws, on a phone the rows then ending at the footer's bottom (measured where it stands; on the foot when it draws none), the rows passing under it, painted the ground and `data-stuck` only while they do; an ungrouped grid's stands at the foot even when its rows don't fill the area, in pages just above the pager, and a grouped grid's each pin while their group's rows run past the foot and close their group otherwise; off by default, when the footer stands after the last row), `renderGroupLabel`, `renderGroupFooter` (a group's paged continuation after its loaded rows), `onHideGroup`, `countOf`, `loadMore` (`hasMore`, `onReveal` and a `label`), `pages` (`GridPages`: `page` from 1, `size`, `total`, the view's count, `exact`, false for a capped count, `sizes`, the page-size pick's choices, default 25, 50 and 100, and `onPage` and `onSize`: an ungrouped grid draws the page you hand and the pager part `vk-grid-pager` under it, `loadMore` is then not drawn, picks clear on a page or size change, and the footer shows only the figures a group carries in `figures`; a grouped grid draws no pager; absent by default), `emptyState`, and `transitionKey`, `transitionPending` and `transitionLabel` (a view change: the wait paints before the new rows mount).
|
|
10
10
|
- Row actions and menus: `rowMenu` (a row's items, on right-click and in its ⋯ tail; the same builder a list takes), `contextMenu` (a right-click menu that differs from it), `rowActions` (buttons in the title cell's action lane, before the grid's own Edit), `onRowDelete` and `deleteLabel` (a delete row in the row's menu), `menus` (`GridMenus`: each of the grid's menus as data, reshaped by your function; `menus.row` is asked as a row's menu opens and may answer a promise, the menu waiting on one greyed row until it does, and holds Open page and Delete as `row-open` and `row-delete`, so a row's Delete is offered per row; the ready `<List>` (VK-742) hands the same `menus.row` through), `commands` (the verbs a `command` column's cell opens, by field key; without it a command column is a read-only badge) and `selection` (the list's selection; its optional `renderBar` draws the bar it opens, `SelectionBar` with your verbs, and without one the rows still tick and no bar is drawn).
|
|
@@ -16,9 +16,9 @@ The spreadsheet. The door carries no client directive; every rendering file behi
|
|
|
16
16
|
- States held from outside, each off when left out, as a page that shows the grid's states side by side needs them: `hoveredRow` (a row, by its id, drawn as under the pointer: its tint, its rail's box, its ⋯ and the name's actions, and `data-hovered`, while a real pointer still hovers any row beside it; drawn, as a hover is, only on a screen whose pointer hovers) and `onHoveredRowChange` (the row a person's pointer moves onto, or null off it); `cellPick` (a `GridCellPick` drawn as picked, placed each time its value changes without taking the page's focus; while it is given, null included, a press outside the grid lets go of nothing, and a person's click, drag, keys and Escape move it as always) and `onCellPickChange` (each change a person makes, or null); `openColumnMenu` (the column, by its id, whose menu stands open on the first row of column names, its header cell `data-open`; while it is given, null included, the menus open and close only as it says) and `onOpenColumnMenuChange` (the column a person's press opens, or null when a press, a row of the menu or a press outside closes it, for you to answer).
|
|
17
17
|
- List config: `listConfig` (the settings layer every user of the list inherits, which may only take away from what the columns declare: the table read-only, per-column locks; a constraint on the screen, while your API guards its own writes). The grid only reads it: a surface of your own changes it.
|
|
18
18
|
- Per row: `rowWritable` (`(row) => boolean`, whether a row's cells write, for a reader who may edit some records and not others; a row it answers false for opens no editor, takes no typing, paste, fill, clear, cut or bulk-bar write, says "Cell is read-only" (`views.grid.cell-read-only`) when a person tries, and marks its cells `aria-readonly`; it only takes away from what the columns and `listConfig` allow; absent, every row writes as its columns say; called while the grid renders, so keep it pure and cheap; a constraint on the screen, while your API guards its own writes).
|
|
19
|
-
- `GridMenus` — the grid's menus as data, `GridTable`'s `menus`, typed over your row: `column(items, { field, column })`, `row(items, { row })` and `
|
|
20
|
-
- `useGridTablePrefs` — wires a list's view preferences to the grid. It takes `prefs` (the list's `ListViewPrefs`), `setPrefs` (stores a patch of them), `columns` (whose money reading the number formats read) and `viewBacked`, and returns `{ gridProps }` to spread on `GridTable`: the borders, row icon, frozen identity, checkboxes and scale, the format overrides, the column state, the group figures and the footer figures, each with the handler that writes it back through `setPrefs`.
|
|
21
|
-
- `useGridTableSettings` — wires a list's settings and a person's layer to the grid, for a list kept as `viewkitjs/fields/query`'s `ListSettings`. It takes `settings`, `layer` (the person's `ListPersonalLayer`), `columns` (the declared ones), `parts` (the same `parts` the grid takes, so a part column the settings place is drawn and moved as the grid draws it), `onChange` (a `ListSettingsChange`, never empty), `onLayerChange` (a layer patch), `defaults` (the reader's `ListDefaults`) and `formats` with `setFormats`, and returns `{ gridProps }` to spread on `GridTable`, as `useGridTablePrefs` does: a column hidden, moved, given a line break or a figure, and a group header's figures, come back through `onChange`; a resize through `onLayerChange` as the person's width (a width taken back by a double-click leaves it); a format through `setFormats
|
|
19
|
+
- `GridMenus` — the grid's menus as data, `GridTable`'s `menus`, typed over your row: `column(items, { field, column })`, `row(items, { row })`, `group(items, { group })` and `addColumn(items, { columns })`, each handed its menu's default items (`ViewsMenuItem[]`, every row keyed) and returning the items it shows. A menu with no function is as before. The helpers, the keys and the rules are [`/list`'s Menus as data](./list.md#menus-as-data).
|
|
20
|
+
- `useGridTablePrefs` — wires a list's view preferences to the grid. It takes `prefs` (the list's `ListViewPrefs`), `setPrefs` (stores a patch of them), `columns` (whose money reading the number formats read) and `viewBacked`, and returns `{ gridProps }` to spread on `GridTable`: the borders, row icon, frozen identity, checkboxes and scale, the format overrides, the column state, the group figures and the footer figures, each with the handler that writes it back through `setPrefs`. A format's patch hands its whole map with the field it changes present: its new setting, or `null` where it has none left (Automatic, Reset colors). A store that writes only the fields a patch names reads `null` as the clear; one that keeps the map as handed keeps the `null`, which the grid reads as no setting.
|
|
21
|
+
- `useGridTableSettings` — wires a list's settings and a person's layer to the grid, for a list kept as `viewkitjs/fields/query`'s `ListSettings`. It takes `settings`, `layer` (the person's `ListPersonalLayer`), `columns` (the declared ones), `parts` (the same `parts` the grid takes, so a part column the settings place is drawn and moved as the grid draws it), `onChange` (a `ListSettingsChange`, never empty), `onLayerChange` (a layer patch), `defaults` (the reader's `ListDefaults`) and `formats` with `setFormats`, and returns `{ gridProps }` to spread on `GridTable`, as `useGridTablePrefs` does: a column hidden, moved, given a line break or a figure, and a group header's figures, come back through `onChange`; a resize through `onLayerChange` as the person's width (a width taken back by a double-click leaves it); a format through `setFormats`, its patch shaped as `useGridTablePrefs`' is.
|
|
22
22
|
- `GridFormatPrefs` — how a list's fields read, which `useGridTableSettings` takes apart from its settings: `gridOptionColors`, `gridDateStyles`, `gridDurationStyles`, `gridShowTime`, `gridPercentDisplays`, `gridDecimals` and `gridCurrencies`, each keyed by field key.
|
|
23
23
|
|
|
24
24
|
## Sort, group and figures
|