viewkitjs 0.28.0 → 0.29.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +107 -0
- package/MIGRATION.md +85 -4
- package/fields/dist/derived.d.ts +2 -1
- package/fields/dist/derived.js +9 -3
- package/fields/dist/entities.js +41 -3
- package/fields/dist/index.d.ts +1 -1
- package/fields/dist/index.js +1 -1
- package/fields/dist/messages.d.ts +8 -2
- package/fields/dist/messages.js +3 -0
- package/fields/dist/range.d.ts +6 -0
- package/fields/dist/range.js +8 -0
- package/fields/dist/registry.js +11 -1
- package/fields/dist/spec-changes.js +1 -0
- package/fields/dist/types.d.ts +23 -1
- package/fields/docs/guides/derived-fields.md +7 -5
- package/fields/docs/guides/field-types.md +2 -2
- package/fields/docs/guides/the-index.md +1 -1
- package/fields/docs/reference/fields.md +3 -1
- package/fields/docs/reference/types.md +3 -1
- package/fields/skills/viewkit/SKILL.md +1 -1
- package/package.json +2 -1
- package/postgres/dist/definitions/build.js +29 -5
- package/postgres/dist/definitions/label.d.ts +7 -0
- package/postgres/dist/definitions/label.js +9 -1
- package/postgres/dist/definitions/lookup.js +6 -2
- package/postgres/dist/definitions/place.d.ts +6 -3
- package/postgres/dist/definitions/rollup.js +5 -1
- package/postgres/dist/definitions/storage.d.ts +15 -0
- package/postgres/dist/definitions/storage.js +52 -1
- package/postgres/dist/definitions/stored.js +21 -0
- package/postgres/dist/phone.d.ts +13 -1
- package/postgres/dist/phone.js +23 -3
- package/postgres/dist/search-indexes.d.ts +6 -1
- package/postgres/dist/search-indexes.js +71 -25
- package/postgres/dist/search.js +3 -3
- package/postgres/docs/guides/definitions.md +22 -5
- package/postgres/docs/guides/field-map.md +5 -4
- package/postgres/docs/reference/definitions.md +3 -3
- package/postgres/docs/reference/postgres.md +1 -1
- package/views/dist/cells/cell-format.js +2 -2
- package/views/dist/cells/cell-values.js +9 -10
- package/views/dist/contract.d.ts +149 -3
- package/views/dist/contract.js +157 -1
- package/views/dist/controls/bulk-bar/bulk-bar-of.d.ts +66 -0
- package/views/dist/controls/bulk-bar/bulk-bar-of.js +22 -0
- package/views/dist/controls/bulk-bar/bulk-bar.d.ts +40 -0
- package/views/dist/controls/bulk-bar/bulk-bar.js +278 -0
- package/views/dist/controls/bulk-bar/looks.d.ts +10 -0
- package/views/dist/controls/bulk-bar/looks.js +14 -0
- package/views/dist/controls/bulk-bar/map-selection-bar.d.ts +19 -0
- package/views/dist/controls/bulk-bar/map-selection-bar.js +57 -0
- package/views/dist/controls/bulk-bar/tokens.d.ts +136 -0
- package/views/dist/controls/bulk-bar/tokens.js +36 -0
- package/views/dist/controls/bulk-bar/words.d.ts +50 -0
- package/views/dist/controls/bulk-bar/words.js +19 -0
- package/views/dist/controls/bulk-bar.css +96 -0
- package/views/dist/controls/button/button.js +3 -1
- package/views/dist/controls/button.css +5 -4
- package/views/dist/controls/checkbox/checkbox.js +3 -1
- package/views/dist/controls/checkbox.css +1 -1
- package/views/dist/controls/choice/tokens.d.ts +79 -0
- package/views/dist/controls/choice/tokens.js +22 -0
- package/views/dist/controls/choice.css +31 -0
- package/views/dist/controls/compound-editor/looks.js +1 -1
- package/views/dist/controls/controls.d.ts +10 -0
- package/views/dist/controls/controls.js +8 -0
- package/views/dist/controls/customize/customize.d.ts +125 -0
- package/views/dist/controls/customize/customize.js +243 -0
- package/views/dist/controls/customize/glide.d.ts +10 -0
- package/views/dist/controls/customize/glide.js +55 -0
- package/views/dist/controls/customize/looks.d.ts +13 -0
- package/views/dist/controls/customize/looks.js +11 -0
- package/views/dist/controls/customize/map-customize-body.d.ts +18 -0
- package/views/dist/controls/customize/map-customize-body.js +160 -0
- package/views/dist/controls/customize/rules.d.ts +23 -0
- package/views/dist/controls/customize/rules.js +19 -0
- package/views/dist/controls/customize/tokens.d.ts +40 -0
- package/views/dist/controls/customize/tokens.js +12 -0
- package/views/dist/controls/customize/words.d.ts +58 -0
- package/views/dist/controls/customize/words.js +37 -0
- package/views/dist/controls/customize.css +54 -0
- package/views/dist/controls/date-editor/looks.js +1 -1
- package/views/dist/controls/filter-editor/block.d.ts +31 -0
- package/views/dist/controls/filter-editor/block.js +27 -0
- package/views/dist/controls/filter-editor/filter-editor.d.ts +2 -0
- package/views/dist/controls/filter-editor/filter-editor.js +85 -43
- package/views/dist/controls/filter-editor/how.d.ts +1 -1
- package/views/dist/controls/filter-editor/how.js +1 -0
- package/views/dist/controls/filter-editor/map-filter-body.d.ts +16 -1
- package/views/dist/controls/filter-editor/map-filter-body.js +39 -13
- package/views/dist/controls/filter-editor/map-rules.d.ts +27 -11
- package/views/dist/controls/filter-editor/map-rules.js +73 -42
- package/views/dist/controls/filter-editor/rules.d.ts +43 -5
- package/views/dist/controls/filter-editor/rules.js +55 -2
- package/views/dist/controls/filter-editor/words.d.ts +15 -0
- package/views/dist/controls/filter-editor/words.js +6 -0
- package/views/dist/controls/filter-editor.css +18 -0
- package/views/dist/controls/index.d.ts +26 -2
- package/views/dist/controls/index.js +25 -2
- package/views/dist/controls/inline-input/looks.js +1 -1
- package/views/dist/controls/input/input.js +10 -4
- package/views/dist/controls/internal/phone.d.ts +5 -4
- package/views/dist/controls/internal/phone.js +7 -7
- package/views/dist/controls/internal/scroll.js +5 -1
- package/views/dist/controls/internal/typed-run.d.ts +2 -0
- package/views/dist/controls/internal/typed-run.js +5 -0
- package/views/dist/controls/menu/map-menu.js +2 -2
- package/views/dist/controls/number-editor/looks.js +1 -1
- package/views/dist/controls/option/option.js +3 -1
- package/views/dist/controls/option.css +1 -1
- package/views/dist/controls/pane/pane.d.ts +4 -0
- package/views/dist/controls/pane/pane.js +2 -1
- package/views/dist/controls/picker/looks.js +1 -1
- package/views/dist/controls/picker/map-picker.d.ts +6 -2
- package/views/dist/controls/picker/map-picker.js +4 -2
- package/views/dist/controls/picker/picker.d.ts +7 -0
- package/views/dist/controls/picker/picker.js +57 -8
- package/views/dist/controls/popover/map-popover.d.ts +1 -1
- package/views/dist/controls/popover/map-popover.js +2 -2
- package/views/dist/controls/popover/popover.js +2 -1
- package/views/dist/controls/popover.css +3 -0
- package/views/dist/controls/ports-host/map-ports-host.d.ts +7 -0
- package/views/dist/controls/ports-host/map-ports-host.js +43 -0
- package/views/dist/controls/press/tokens.d.ts +8 -0
- package/views/dist/controls/press/tokens.js +4 -0
- package/views/dist/controls/press.css +44 -0
- package/views/dist/controls/quick-filters/looks.d.ts +11 -0
- package/views/dist/controls/quick-filters/looks.js +9 -0
- package/views/dist/controls/quick-filters/map-quick-filters-body.d.ts +31 -0
- package/views/dist/controls/quick-filters/map-quick-filters-body.js +56 -0
- package/views/dist/controls/quick-filters/quick-filters.d.ts +37 -0
- package/views/dist/controls/quick-filters/quick-filters.js +89 -0
- package/views/dist/controls/quick-filters/reminder.d.ts +18 -0
- package/views/dist/controls/quick-filters/reminder.js +41 -0
- package/views/dist/controls/quick-filters/rules.d.ts +89 -0
- package/views/dist/controls/quick-filters/rules.js +52 -0
- package/views/dist/controls/quick-filters/tokens.d.ts +112 -0
- package/views/dist/controls/quick-filters/tokens.js +30 -0
- package/views/dist/controls/quick-filters/words.d.ts +25 -0
- package/views/dist/controls/quick-filters/words.js +13 -0
- package/views/dist/controls/quick-filters.css +118 -0
- package/views/dist/controls/sheet/bottom-sheet.d.ts +9 -4
- package/views/dist/controls/sheet/bottom-sheet.js +4 -4
- package/views/dist/controls/sheet/map-sheet.d.ts +4 -1
- package/views/dist/controls/sheet/map-sheet.js +19 -6
- package/views/dist/controls/sheet/sheet-parts.d.ts +10 -0
- package/views/dist/controls/sheet/sheet-parts.js +2 -0
- package/views/dist/controls/switch-row/switch-row.d.ts +15 -0
- package/views/dist/controls/switch-row/switch-row.js +9 -0
- package/views/dist/controls/switch-row/tokens.d.ts +51 -0
- package/views/dist/controls/switch-row/tokens.js +15 -0
- package/views/dist/controls/switch-row.css +39 -0
- package/views/dist/controls/switch.css +1 -1
- package/views/dist/controls/tag/tag.js +3 -1
- package/views/dist/controls/tag-field/tag-field.d.ts +20 -0
- package/views/dist/controls/tag-field/tag-field.js +19 -0
- package/views/dist/controls/tag-field/tokens.d.ts +7 -0
- package/views/dist/controls/tag-field/tokens.js +4 -0
- package/views/dist/controls/tag-field.css +13 -0
- package/views/dist/controls/text-editor/looks.js +1 -1
- package/views/dist/controls/text-editor/text-editor.js +1 -5
- package/views/dist/controls/toast/toast.d.ts +5 -1
- package/views/dist/controls/toast/toast.js +5 -3
- package/views/dist/controls/tokens.js +18 -0
- package/views/dist/controls/toolbar/keys.d.ts +3 -0
- package/views/dist/controls/toolbar/keys.js +11 -0
- package/views/dist/controls/toolbar/looks.d.ts +10 -0
- package/views/dist/controls/toolbar/looks.js +40 -0
- package/views/dist/controls/toolbar/tokens.d.ts +28 -0
- package/views/dist/controls/toolbar/tokens.js +9 -0
- package/views/dist/controls/toolbar/toolbar.d.ts +111 -0
- package/views/dist/controls/toolbar/toolbar.js +370 -0
- package/views/dist/controls/toolbar/words.d.ts +28 -0
- package/views/dist/controls/toolbar/words.js +17 -0
- package/views/dist/controls/toolbar-button/looks.d.ts +4 -0
- package/views/dist/controls/toolbar-button/looks.js +21 -0
- package/views/dist/controls/toolbar-button/tokens.d.ts +103 -0
- package/views/dist/controls/toolbar-button/tokens.js +28 -0
- package/views/dist/controls/toolbar-button/toolbar-button.d.ts +66 -0
- package/views/dist/controls/toolbar-button/toolbar-button.js +51 -0
- package/views/dist/controls/toolbar-button.css +75 -0
- package/views/dist/controls/toolbar.css +65 -0
- package/views/dist/controls/tooltip/map-tooltip.d.ts +1 -1
- package/views/dist/controls/tooltip/map-tooltip.js +2 -2
- package/views/dist/controls/tooltip/tooltip.d.ts +3 -1
- package/views/dist/controls/tooltip/tooltip.js +2 -2
- package/views/dist/controls/values-editor/looks.js +1 -1
- package/views/dist/controls/views-list/map-views-list-body.d.ts +4 -1
- package/views/dist/controls/views-list/map-views-list-body.js +128 -4
- package/views/dist/controls/views-list/rules.d.ts +26 -0
- package/views/dist/controls/views-list/rules.js +63 -0
- package/views/dist/controls/views-list/view-menu.d.ts +84 -0
- package/views/dist/controls/views-list/view-menu.js +201 -0
- package/views/dist/controls/views-list/views-list.d.ts +8 -1
- package/views/dist/controls/views-list/views-list.js +18 -3
- package/views/dist/controls/views-list/words.d.ts +54 -0
- package/views/dist/controls/views-list/words.js +10 -1
- package/views/dist/controls/views-list.css +5 -1
- package/views/dist/display/date.js +3 -3
- package/views/dist/display/format.d.ts +6 -0
- package/views/dist/display/format.js +3 -0
- package/views/dist/display/index.d.ts +1 -1
- package/views/dist/display/index.js +1 -1
- package/views/dist/display/range.d.ts +2 -1
- package/views/dist/display/range.js +4 -1
- package/views/dist/grid/chrome/GridHeader.js +2 -1
- package/views/dist/grid/chrome/GridNumberEditor.js +2 -2
- package/views/dist/grid/chrome/GridRowCells.js +2 -1
- package/views/dist/grid/chrome/GridTextEditor.js +2 -2
- package/views/dist/grid/chrome/grid-editor-layer.d.ts +5 -1
- package/views/dist/grid/chrome/grid-editor-layer.js +1 -0
- package/views/dist/grid/chrome/grid-fitted-box.d.ts +7 -1
- package/views/dist/grid/chrome/grid-fitted-box.js +4 -4
- package/views/dist/grid/core/clipboard-model.js +9 -4
- package/views/dist/grid/grid.css +240 -0
- package/views/dist/grid/looks.d.ts +5 -1
- package/views/dist/grid/looks.js +20 -12
- package/views/dist/grid-tokens.d.ts +109 -0
- package/views/dist/grid-tokens.js +29 -0
- package/views/dist/looks/index.d.ts +5 -0
- package/views/dist/looks/index.js +5 -0
- package/views/dist/looks/pieces.js +10 -0
- package/views/dist/model/column-capabilities.d.ts +2 -0
- package/views/dist/model/column-filters.d.ts +2 -1
- package/views/dist/model/column-from.js +2 -2
- package/views/dist/model/relation-filters.d.ts +2 -0
- package/views/dist/panels/index.d.ts +2 -2
- package/views/dist/panels/index.js +2 -2
- package/views/dist/panels/labels.d.ts +4 -0
- package/views/dist/panels/labels.js +8 -0
- package/views/dist/panels/model.d.ts +10 -2
- package/views/dist/panels/quick/model.d.ts +4 -0
- package/views/dist/panels/react/customize-body.d.ts +9 -4
- package/views/dist/panels/react/customize-body.js +39 -11
- package/views/dist/panels/react/customize.d.ts +8 -1
- package/views/dist/panels/react/customize.js +9 -6
- package/views/dist/panels/react/filter/FilterEditor.js +4 -4
- package/views/dist/panels/react/filter/FilterFieldList.js +10 -2
- package/views/dist/panels/react/filter/PhoneFilterEditor.js +3 -3
- package/views/dist/panels/react/filter/filter-body.js +5 -2
- package/views/dist/panels/react/panel-step.d.ts +3 -0
- package/views/dist/panels/react/panel-step.js +2 -1
- package/views/dist/panels/react/quick/QuickFiltersPanel.js +1 -0
- package/views/dist/panels/react/toolbar/ReadyToolbar.d.ts +13 -3
- package/views/dist/panels/react/toolbar/ReadyToolbar.js +10 -3
- package/views/dist/panels/react/toolbar/Toolbar.js +1 -1
- package/views/dist/panels/react/toolbar/ToolbarAsideFilter.js +2 -2
- package/views/dist/panels/react/toolbar/ToolbarBarFilter.js +13 -3
- package/views/dist/panels/react/toolbar/ToolbarFilterAdd.js +2 -1
- package/views/dist/panels/react/toolbar/ToolbarFilters.js +3 -3
- package/views/dist/panels/react/toolbar/ToolbarOptions.d.ts +12 -4
- package/views/dist/panels/react/toolbar/ToolbarOptions.js +6 -2
- package/views/dist/panels/react/view-footer.d.ts +1 -1
- package/views/dist/panels/react/views-row/ViewPicker.js +25 -4
- package/views/dist/panels/settings/filter-groups.d.ts +3 -0
- package/views/dist/panels/settings/filter-groups.js +40 -9
- package/views/dist/panels/settings/filters.d.ts +5 -0
- package/views/dist/panels/settings/filters.js +12 -6
- package/views/dist/panels/views-row/model.d.ts +10 -1
- package/views/dist/provider/ViewsProvider.js +29 -5
- package/views/dist/provider/components.d.ts +149 -8
- package/views/dist/provider/context.d.ts +6 -0
- package/views/dist/provider/ports.d.ts +18 -6
- package/views/dist/provider/ports.js +2 -1
- package/views/dist/react.d.ts +2 -2
- package/views/dist/react.js +1 -1
- package/views/dist/selection/SelectionBar.d.ts +2 -16
- package/views/dist/selection/SelectionBar.js +4 -1
- package/views/dist/selection/bar-props.d.ts +26 -0
- package/views/dist/selection/bar-props.js +1 -0
- package/views/dist/selection/index.d.ts +1 -1
- package/views/dist/selection/verbs.d.ts +32 -5
- package/views/dist/styles.css +656 -25
- package/views/dist/styles.unlayered.css +653 -22
- package/views/docs/contract.md +44 -17
- package/views/docs/controls/bulk-bar.md +41 -0
- package/views/docs/controls/choice.md +25 -0
- package/views/docs/controls/customize.md +17 -0
- package/views/docs/controls/popover.md +2 -0
- package/views/docs/controls/press.md +9 -0
- package/views/docs/controls/quick-filters.md +35 -0
- package/views/docs/controls/radio.md +1 -1
- package/views/docs/controls/switch-row.md +18 -0
- package/views/docs/controls/tag-field.md +7 -0
- package/views/docs/controls/toolbar-button.md +31 -0
- package/views/docs/controls/toolbar.md +14 -0
- package/views/docs/guides/atoms.md +2 -2
- package/views/docs/guides/cells.md +2 -2
- package/views/docs/guides/display.md +2 -2
- package/views/docs/guides/looks.md +8 -2
- package/views/docs/guides/ports.md +6 -6
- package/views/docs/guides/selection.md +5 -1
- package/views/docs/guides/the-grid.md +1 -1
- package/views/docs/guides/the-provider.md +2 -2
- package/views/docs/install.md +4 -1
- package/views/docs/reference/cells.md +1 -1
- package/views/docs/reference/controls.md +194 -13
- package/views/docs/reference/display.md +1 -0
- package/views/docs/reference/looks.md +25 -11
- package/views/docs/reference/panels-react.md +7 -7
- package/views/docs/reference/panels.md +8 -6
- package/views/docs/reference/react.md +13 -6
- package/views/docs/reference/selection.md +4 -2
- package/views/docs/reference/views.md +7 -6
- package/views/skills/views/SKILL.md +2 -2
|
@@ -198,13 +198,13 @@ In your app it is your own Avatar component, its tone read from the label. What
|
|
|
198
198
|
|
|
199
199
|
## A command cell's verbs
|
|
200
200
|
|
|
201
|
-
A `command` field offers verbs instead of an editor: moving a deal to Lost asks for a reason, so the cell opens your verbs rather than a picker. The cell draws the trigger (the value with a chevron, or a chevron beside a value that is already a control, such as a chip or a link) and hands it to `CommandMenu` with `trigger`, `items`, `align` and `label`, the field's name. Each item has a `label`, an optional `icon`, its `onClick`, `destructive` and `disabled` flags, and a `disabledReason` for a disabled one; while the record loads, every verb arrives disabled, with your reason or else "Wait for current data before editing" (`views.menus.loading`). The default names your components map's `Menu` after the field ("Actions for Stage"), anchors it on the trigger and keeps the click off the row, so opening the verbs neither selects the cell nor opens the row. Swap it when your app has its own action menu, or a sheet on a phone. [The contract](../contract.md#a-command-field) says how a command field is declared.
|
|
201
|
+
A `command` field offers verbs instead of an editor: moving a deal to Lost asks for a reason, so the cell opens your verbs rather than a picker. The cell draws the trigger (the value with a chevron, a chevron alone where the value is empty, or a chevron beside a value that is already a control, such as a record's chip or a link; a member's chip is drawn inside the trigger) and hands it to `CommandMenu` with `trigger`, `items`, `align` and `label`, the field's name. Each item has a `label`, an optional `icon`, its `onClick`, `destructive` and `disabled` flags, and a `disabledReason` for a disabled one; while the record loads, every verb arrives disabled, with your reason or else "Wait for current data before editing" (`views.menus.loading`). The default names your components map's `Menu` after the field ("Actions for Stage"), anchors it on the trigger and keeps the click off the row, so opening the verbs neither selects the cell nor opens the row. Swap it when your app has its own action menu, or a sheet on a phone. [The contract](../contract.md#a-command-field) says how a command field is declared.
|
|
202
202
|
|
|
203
203
|
## The row's menu
|
|
204
204
|
|
|
205
205
|
`RowMenu` wraps a section's rows: the grid mounts it once around each section's rows' container, never around each row, and aims it at the row a press or a right-click came from. Its props are that row's, set in the same event your menu opens on; `children` is the rows' container, which takes the props and `ref` your trigger hands it (a `Slot`, `asChild`) and passes them to its element; a right-click on no row arrives already prevented and opens nothing. The rendering builds its `items` (the clicked cell's clipboard rows, Select, your verbs for the row), and the menu adds an Open page row before them when the row has a page (`openHref`, opened in a new tab) and a Delete row after them when the row can be deleted (`onDelete`). Its props are `ViewsRowMenuProps`; each item is a `ViewsRowMenuItem`, a rule (`{ separator: true }`) or a labelled row with its `onClick`, optional `icon`, `destructive`, `disabled` with its `disabledReason` (the grid's own Cut, Paste and Clear carry one whenever they are disabled), and a `shortcut` hint the menu draws but never binds. The default names your `Menu` "Row actions" (`views.menus.row-menu`).
|
|
206
206
|
|
|
207
|
-
The default opens your `Menu` at the pointer on a right-click, or from the row's ⋯ (`data-slot="vk-grid-row-more"`). On a touch screen a long-press opens nothing: the ⋯ is the way in there. Its Delete asks first, through the `confirm` port, with the message `views.menus.row-delete-confirm` and the row's `deleteLabel` as the `subject`; an app that hands no `confirm` gets the browser's own, and a confirm that rejects or throws counts as no. A delete that then rejects leaves the row where it was and says so through the toast port's `error`, with `views.menus.row-delete-failed`. [Ports](ports.md) covers `confirm` and the toast.
|
|
207
|
+
The default opens your `Menu` at the pointer on a right-click, or from the row's ⋯ (`data-slot="vk-grid-row-more"`). On a touch screen a long-press opens nothing: the ⋯ is the way in there. Its Delete asks first, through the `confirm` port, with the message `views.menus.row-delete-confirm` and the row's `deleteLabel` as the `subject`; an app that hands no `confirm` gets the browser's own where your components map holds no `PortsHost`, ViewKit's alert dialog where it does (`CONTROLS`), and a confirm that rejects or throws counts as no. A delete that then rejects leaves the row where it was and says so through the toast port's `error`, with `views.menus.row-delete-failed`. [Ports](ports.md) covers `confirm` and the toast.
|
|
208
208
|
|
|
209
209
|
Swap it for a menu of your own, or for a long-press that selects: `onToggleSelect`, there from the first render wherever rows can be selected, flips the selection of the row last pressed. With `GridTable`'s `phonePicking` on, a call that answers a long press still held ticks the pressed row once with the grid's own, never flipping it back; with no press held it flips the row last pressed, as without the option. The default doesn't use it. The default opens your `Menu` at the pointer, so make your `Menu` a popover: one drawn in the page flow would draw after the section's rows.
|
|
210
210
|
|
|
@@ -71,10 +71,10 @@ assert.equal(columns.stage.command, true); // a command field's column
|
|
|
71
71
|
|
|
72
72
|
What it does with a column depends on what the column is:
|
|
73
73
|
|
|
74
|
-
- An empty value draws nothing, `null`, so a card can leave the line out. A boolean draws its off state instead, which is what a person clicks to turn it on.
|
|
74
|
+
- An empty value draws nothing, `null`, so a card can leave the line out. A boolean draws its off state instead, which is what a person clicks to turn it on, and a `command` column handed `commandItems` draws its chevron alone, so its verbs are still one click away.
|
|
75
75
|
- A `title` column draws the row's title cell, the hotspot that opens the row (`data-cell-open`), with the column's `indicator` beside the name. A title whose field is a number, a percent, a currency, a date, a datetime or a name draws through that field, so a dated identity reads as a date; any other title draws as its text.
|
|
76
76
|
- A relation chip goes where your `RelationLink` atom says, the app-wide answer for each kind of record. `onOpenRelation` overrides it for one surface and is handed the chip that was pressed, which matters when a cell holds several.
|
|
77
|
-
- A `command` column handed `commandItems` opens your `CommandMenu` atom: the verbs for this row in place of an editor. The trigger is the value itself, or a chevron beside it where the value is a control of its own (a relation, a
|
|
77
|
+
- A `command` column handed `commandItems` opens your `CommandMenu` atom: the verbs for this row in place of an editor. The trigger is the value itself, or a chevron beside it where the value is a control of its own (a relation, a link, an email, a phone or a domain). A member is no control there: its chip is drawn inert inside the trigger, so a click on the name opens the verbs, not the member. Without `commandItems` the cell is a plain value. [A command field](../contract.md#a-command-field) in the contract says where the verbs come from.
|
|
78
78
|
- Any other column draws its field's display, in the code `resolveRowCurrency` finds for a money value. A money figure the column reads converted from the row's own currency (`convertedFromOf`) comes back marked: ≈ before it and a title naming the currency it came from (`ConvertedFigure`).
|
|
79
79
|
|
|
80
80
|
```tsx
|
|
@@ -73,7 +73,7 @@ assert.equal(DISPLAY_CORES.date, DISPLAY_CORES.datetime);
|
|
|
73
73
|
- **number**: plain or a duration, in tabular figures. An integer field draws whole numbers whatever the reader's decimals. A `suffix` trails in the small subtle unit style. A `signed` format shows the sign and tints a positive figure as a success, unless its `signedTone` is `neutral`; a field's `bands` tint the figure by the band it falls in, ahead of the sign. A value that is not a number draws as its own text.
|
|
74
74
|
- **currency**: in the field's fixed code, or the code you hand in `currency` (the row's own, for a field whose code comes from the row), which wins. Two decimals unless the field says otherwise or holds whole amounts.
|
|
75
75
|
- **percent**: stored as 0 to 100 and drawn as it is, never multiplied, with its `%` in the unit style. The field's `format.display`, or the reader's `percentDisplay`, adds a bar or a ring.
|
|
76
|
-
- **date** and **datetime**: in the reader's `dateStyle`, else the field's, else `short`; `withTime`
|
|
76
|
+
- **date** and **datetime**: in the reader's `dateStyle`, else the field's, else `short`; an instant shows its time unless `withTime` says `false`, the options' answer winning over the field's (`timeShown`), and only an instant has a time. Hovering for a second shows the full date (and time, for an instant) through your components map's `Tooltip`, so a relative "3d ago" can be pinned to a moment. A value that doesn't parse draws as its own text.
|
|
77
77
|
- **boolean**: four looks, the field's `format.style`. `checkbox` (the default) draws the `TickBox` atom, and `icon` your `booleanIcon(on)`; either becomes a real switch only when you hand `onToggle`, and is a plain glyph otherwise. `text` draws the option's label for the value, or the package's words. `marker` draws only when true, as the `StatusMarker` atom with your `marker` words, `markerReason` and `onResolve`.
|
|
78
78
|
- **select**, **status** and **multiselect**: a select is a category and draws the `Tag` atom in its colour (a reader's `optionColors` first, then the option's declared colour, then one derived from the value). A status is a state and draws the `StatusBadge` atom in its option's slot. A multiselect draws a tag per value, through the several-values layout. A value no option names draws as the raw value, muted, with a hover saying it is not an option, unless you hand a `labelFallback`; an open (`custom-values`) vocabulary's values are their own labels. An option's `icon` is drawn through your `AppIcon`.
|
|
79
79
|
- **relation** and **user**: a chip, the record's avatar when it has one, else your `entityIcon(kind)`, else the relation glyph, then its label, then, on a `many` relation that declares `links`, the link's roles, drawn by the `RelationRoles` atom ([atoms](atoms.md)). Where it goes is yours (`relationWrap`); without one the chip is inert. Several draw through the several-values layout, the lead link first. A user is drawn as a relation to a member, so the two never differ.
|
|
@@ -82,7 +82,7 @@ assert.equal(DISPLAY_CORES.date, DISPLAY_CORES.datetime);
|
|
|
82
82
|
- **name**: the full name as written, else the given and family names, else `nameFallback`, else nothing.
|
|
83
83
|
- **actor**: a chip like a relation's that opens nothing, since an actor records who did something rather than pointing at a record: a member's avatar when your value carries an `avatarUrl` beside it, and your glyph for an automation, an API key or the system.
|
|
84
84
|
- **rich_text**: the first line with words in it, on one line; with `wrap: true`, its plain lines, clamped; with `wrap: "full"`, your components map's `Markdown`, folded past 160px behind Show more.
|
|
85
|
-
- **range**: its two ends as text ("11–50", "10,001+", "up to 50"), then its unit (`%`, its currency code or its suffix) and its period ("/mo").
|
|
85
|
+
- **range**: its two ends as text ("11–50", "10,001+", "up to 50"), then its unit (`%`, its currency code or its suffix) and its period ("/mo"); a value whose ends are exactly one of the field's `presets` reads as that preset's label alone, the whole value on hover.
|
|
86
86
|
- **lookup** and **formula**: as the field their result is. A **rollup** grouped by an option draws a segmented bar beside its headline, and one grouped by time a sparkline, the current bucket faded.
|
|
87
87
|
|
|
88
88
|
A value that holds several, of any of these types, uses `MultiValueCell`: as many as fit on one line, or three when wrapped, then a `+N` count that opens all of them in a list. It is exported for your own cells; [the display reference](../reference/display.md) has its props.
|
|
@@ -4,7 +4,7 @@ A piece's look is what an app sets once for every copy of the piece it draws: th
|
|
|
4
4
|
|
|
5
5
|
## Options and looks
|
|
6
6
|
|
|
7
|
-
An option is a closed set of values with a default: the grid's `columns` is `all`, `none` or `pinned`. A look is a named set of picks, one value for every option: the grid's `attio` look
|
|
7
|
+
An option is a closed set of values with a default: the grid's `columns` is `all`, `none` or `pinned`. A look is a named set of picks, one value for every option: the grid's `attio` look is Attio's table, its `portal` look ViewKit's own grid as the portal draws it. Nothing picked wears each option's default, the Outright look's (My preset's), which no look matches whole. The ids are public and stay as they are, since an app saves picks by them; the words beside them (`name`) may change.
|
|
8
8
|
|
|
9
9
|
## Picking the grid's look
|
|
10
10
|
|
|
@@ -22,7 +22,13 @@ console.log(frame["data-grid-columns"], props.verticalBorders, props.fillWidth);
|
|
|
22
22
|
|
|
23
23
|
A pick its option doesn't have (one saved by an older version, say) wears the option's default, so saved picks never break a grid. Where the picks live on the page rather than in your state, `gridLookWornOf(element)` reads them back from the closest frame.
|
|
24
24
|
|
|
25
|
-
Fourteen of the grid's options are read by its code. Eleven become its props through `gridLookProps`; three you wire yourself, as the Showcase does: `more` (`"pages"`: hand `GridTable` its `pages`), `figures` (`"value"`: the footer's figure words through your provider's messages) and `wait` (`"kept"`: hand the components map a `RowsWait`). The other eleven (the header's words, the rows' lines, the pinned edge, picked rows and cells, the cells' frames, names and phones) are its look stylesheet's alone
|
|
25
|
+
Fourteen of the grid's options are read by its code. Eleven become its props through `gridLookProps`; three you wire yourself, as the Showcase does: `more` (`"pages"`: hand `GridTable` its `pages`), `figures` (`"value"`: the footer's figure words through your provider's messages) and `wait` (`"kept"`: hand the components map a `RowsWait`). The other eleven (the header's words, the rows' lines, the pinned edge, picked rows and cells, the cells' frames, names and phones) are its look stylesheet's alone: `viewkitjs/views/grid.css`, already inside the ready stylesheet (`viewkitjs/views/styles.css`). An app that imports ViewKit's stylesheets one by one adds it after ViewKit's own classes:
|
|
26
|
+
|
|
27
|
+
```css
|
|
28
|
+
@import "viewkitjs/views/grid.css";
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
It reads the grid's look tokens (`VK_GRID_TOKENS`), which the ready stylesheet declares at the Outright look's values; an app on its own tokens declares each once. A grid with no frame round it wears each option's default.
|
|
26
32
|
|
|
27
33
|
## A piece of your own
|
|
28
34
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Ports
|
|
2
2
|
|
|
3
|
-
A port is a runtime service your app hands the provider: the narrowest surface the rendering needs, named for what it does, so your own toast library, haptics, clipboard helper, storage and dialog each map onto it in a few lines. There are five: `toast`, `haptics`, `clipboard`, `viewPrefs` and
|
|
3
|
+
A port is a runtime service your app hands the provider: the narrowest surface the rendering needs, named for what it does, so your own toast library, haptics, clipboard helper, storage and dialog each map onto it in a few lines. There are five: `toast`, `haptics`, `clipboard`, `viewPrefs` and `confirm`; `toast` and `confirm` are optional, and an app that spreads `CONTROLS` and hands neither reports in ViewKit's Toast and asks in ViewKit's alert dialog (`CONTROLS.PortsHost`). This page covers what calls each and when, the do-nothing ports to start with, and a port over each of your services.
|
|
4
4
|
|
|
5
5
|
## Start with nothing
|
|
6
6
|
|
|
@@ -47,7 +47,7 @@ declare function openConfirmDialog(options: {
|
|
|
47
47
|
|
|
48
48
|
## `toast`
|
|
49
49
|
|
|
50
|
-
`success(message)`, `error(message)`, `info(message)` and `warning(message, { description })`, each handed a sentence the package has already worded through your `messages`.
|
|
50
|
+
`success(message, { undo })`, `error(message)`, `info(message)` and `warning(message, { description })`, each handed a sentence the package has already worded through your `messages`. `undo`, where handed, takes the act back (a view's delete in `CONTROLS.ViewsListBody`): offer it as your toast's Undo, or ignore it and the report shows without one. Hand no `toast` and, with `CONTROLS` spread, ViewKit's Toast says them, Undo included; without `CONTROLS`, nothing does.
|
|
51
51
|
|
|
52
52
|
The grid speaks through two of them:
|
|
53
53
|
|
|
@@ -193,9 +193,9 @@ unsubscribe();
|
|
|
193
193
|
|
|
194
194
|
## `confirm`
|
|
195
195
|
|
|
196
|
-
`confirm(request)` asks a question before an act and resolves to whether the person said yes. The request carries the question as `message`, the yes button's words as `confirmLabel`, what the act is done to as `subject` when the host names it, and `destructive` when the act removes something, so your dialog draws its destructive look.
|
|
196
|
+
`confirm(request)` asks a question before an act and resolves to whether the person said yes. The request carries the question as `message`, the yes button's words as `confirmLabel`, what the act is done to as `subject` when the host names it, one line on what follows as `detail` where there is one, and `destructive` when the act removes something, so your dialog draws its destructive look.
|
|
197
197
|
|
|
198
|
-
A row's Delete asks it. The default row menu's Delete words the question with `views.menus.row-delete-confirm` ("Delete this row?") and the button with `views.menus.row-delete`, and hands the `deleteLabel` you give the grid, when you give one, as `subject`. A yes runs your delete; a rejection or a throw from your port counts as no, and nothing is deleted.
|
|
198
|
+
A row's Delete asks it, and so does a view's Delete in `CONTROLS.ViewsListBody` on a computer ("Delete Q3?", its line saying who the view goes for and that the records stay). The default row menu's Delete words the question with `views.menus.row-delete-confirm` ("Delete this row?") and the button with `views.menus.row-delete`, and hands the `deleteLabel` you give the grid, when you give one, as `subject`. A yes runs your delete; a rejection or a throw from your port counts as no, and nothing is deleted.
|
|
199
199
|
|
|
200
200
|
```tsx
|
|
201
201
|
const confirm: ViewsConfirmPort = ({ message, confirmLabel, subject, destructive }) =>
|
|
@@ -207,7 +207,7 @@ const confirm: ViewsConfirmPort = ({ message, confirmLabel, subject, destructive
|
|
|
207
207
|
});
|
|
208
208
|
```
|
|
209
209
|
|
|
210
|
-
`confirm`
|
|
210
|
+
Hand no `confirm` and, with `CONTROLS` spread, the provider asks in ViewKit's alert dialog (`CONTROLS.PortsHost`, mounted once in the browser); without `CONTROLS`, with the browser's own confirm dialog, showing `message`. Neither is reached by a server render. Two providers that both spread `CONTROLS` each mount their own Toast and dialog: mount one provider.
|
|
211
211
|
|
|
212
212
|
## All five together
|
|
213
213
|
|
|
@@ -221,7 +221,7 @@ assert.deepEqual(Object.keys(viewsPorts), ["toast", "haptics", "clipboard", "vie
|
|
|
221
221
|
|
|
222
222
|
## What a view reads
|
|
223
223
|
|
|
224
|
-
Inside a view, or an atom or component of your own beneath the provider, `useViews().ports` is a `ViewsResolvedPorts`: the ports you handed in, with `confirm` always
|
|
224
|
+
Inside a view, or an atom or component of your own beneath the provider, `useViews().ports` is a `ViewsResolvedPorts`: the ports you handed in, with `toast` and `confirm` always there: yours, ViewKit's through `PortsHost`, or a toast that draws nothing and the browser's confirm. Your own code can ask the same question the package does, without checking whether a dialog was handed in. The package counts a rejection as no; in your own code that choice is yours to make:
|
|
225
225
|
|
|
226
226
|
```tsx
|
|
227
227
|
export function ArchiveButton({ onArchive }: { onArchive: () => Promise<void> }) {
|
|
@@ -205,7 +205,7 @@ What a selection lets a person do (move twelve deals to a stage, export them, de
|
|
|
205
205
|
|
|
206
206
|
- `action`: a button, with its `label`, an optional `icon` and `onClick`; `destructive` paints it in the danger colour;
|
|
207
207
|
- `group`: a button opening a small menu of `items`, each an action;
|
|
208
|
-
- `options`: one field set on every selected row, its `options` drawn as the badges a cell shows (a `PickerOption`
|
|
208
|
+
- `options`: one field set on every selected row, its `options` drawn as the badges a cell shows (a `PickerOption`, or a `ViewsPickerItem` with a person's `avatarUrl` and `kind`), `onSelect` handed the value picked.
|
|
209
209
|
|
|
210
210
|
Any of the three can be `disabled`, and say why with `disabledReason`, in the person's words: More's rows hand it to your `Menu`, the bar's own button shows it in your `Tooltip`, and the phone's sheet draws it under the row. A group's rows that give no reason of their own carry the group's.
|
|
211
211
|
|
|
@@ -238,6 +238,10 @@ function DealsBar({ sel, batch }: { sel: UseListSelectionResult; batch?: ListBat
|
|
|
238
238
|
|
|
239
239
|
Where the bar sits is yours, set once on the provider's `selectionBar`: its `bottom`, `zIndex` and `className` on each form, a `phoneQuery` when your shell's phone layout starts at another width, and a `chip: "button"` when your `Button` should draw the count chip (an app with a bottom nav lifts the pill above it). The phone's sheet is the `SelectionSheet` atom: its default is your `Sheet` holding plain rows, and you swap in your own action sheet through the provider's `atoms`.
|
|
240
240
|
|
|
241
|
+
### The Outright bulk bar
|
|
242
|
+
|
|
243
|
+
An app that spreads `CONTROLS` gets the Outright bulk bar wherever it calls `SelectionBar` (`CONTROLS.SelectionBar`): the same call, the same verbs. It stands in the box that holds it (the grid's frame), at its foot, centred, rather than at the screen's; on a phone it is the tray. It reads what ViewKit's own bar doesn't, each optional: a `noun` (`{ one: "deal", other: "deals" }`: "3 deals selected"), `deleteLine` (the line under its question), `more` on a verb (kept off the bar, in More), and on an options verb `value` (what every picked row holds, which it marks), `empty` with `onEmpty` (an empty row that clears the field) and `search`. Its Delete asks first, in ViewKit's alert dialog, then calls your `onDelete`, so yours asks nothing of its own. A press (`onClick`, `onSelect`, `onEmpty`, `onDelete`) may hand back `{ words, undo }`, a `SelectionDone`, or a promise of one: the bar says it in its own Toast, with Undo. The provider's `selectionBar` placement, `phoneQuery` and `chip` are ViewKit's own bar's. An app that wants ViewKit's own bar while spreading `CONTROLS` leaves the slot out: `{ ...CONTROLS, SelectionBar: undefined }`.
|
|
244
|
+
|
|
241
245
|
## The grid takes a selection
|
|
242
246
|
|
|
243
247
|
`GridTable` wires the selection itself when you pass `selection`, a `ListSelectionConfig`: its checkbox rail (Shift on a checkbox extends the range), the drag down the lane (rows in collapsed groups left out), a plain click toggling a row while rows are selected, Escape, and a group's checkbox. One rule differs from a plain list: in the grid a modifier click on a cell is a cell-range gesture, as in a spreadsheet (Shift extends the active range, Cmd or Ctrl adds the cell), so rows are picked from the rail. You give it:
|
|
@@ -688,7 +688,7 @@ The grid styles through attributes, never class names: each part carries a `data
|
|
|
688
688
|
A surface of your own beside the grid reads values the way the grid does with these.
|
|
689
689
|
|
|
690
690
|
- `cellEditBaseline(column, row)` is a cell's value as an editor and a copy see it: the column's raw edit value where it declares one, else what it draws.
|
|
691
|
-
- `cellCopyText(column, value)` is that value as the clipboard writes it: a relation by its label, an option by its label, several values joined with commas, a name or a place as its cell writes it, a range as "11–50". A CSV export reuses the two, so its cells read as a copy from the grid does.
|
|
691
|
+
- `cellCopyText(column, value)` is that value as the clipboard writes it: a relation by its label, an option by its label, several values joined with commas, a name or a place as its cell writes it, a range as "11–50", or as its band's name when its ends are exactly a preset's. A CSV export reuses the two, so its cells read as a copy from the grid does.
|
|
692
692
|
- `deriveGridSelectValues(columns, rows)` is the values each option column offers, by column id: its active options in declared order, then any other value its rows hold. `{ includeArchived: true }` keeps archived options, for a filter that must still find a row holding one.
|
|
693
693
|
- `deriveGridRelationValues(columns, rows)` is the records each relation column's rows point at, by column id, as `{ id, label }` in alphabetical order: what a filter offers is what the list holds, never every record that could be linked.
|
|
694
694
|
- `GRID_TITLE_LINK_CLASS` is the class a title cell wears: the element marked `data-cell-open` inside it, the text that opens the row, takes the brand colour and an underline on its own hover. A title you draw beside the grid wears it to read the same. In the grid that element is also the part `vk-grid-title`, which your app styles at rest and under the pointer (the contract's Slots).
|
|
@@ -4,7 +4,7 @@ Every view reads what it takes from its app, other than its own props, from one
|
|
|
4
4
|
|
|
5
5
|
## Mount it once
|
|
6
6
|
|
|
7
|
-
`ViewsProvider` sits once at your app's client root, above every view. It takes four things and the children: `components` (your primitives), `icons` (your glyphs by meaning), `ports` (your
|
|
7
|
+
`ViewsProvider` sits once at your app's client root, above every view. It takes four things and the children: `components` (your primitives), `icons` (your glyphs by meaning), `ports` (your haptics, clipboard and per-device store, and, optionally, a toast and a confirm dialog; [ports](ports.md)) and `conventions`. Nineteen more are optional: `atoms`, `messages`, `presentation`, `desktopQuery`, `sheetActions`, `escape`, `oneValue`, `sayRefusals`, `menus`, `gridButtons`, `gridCheckboxes`, `fieldRowButtons`, `fieldRowCheckboxes`, `panelButtons`, `severalValues`, `bodyFrame`, `gridBodyPlace`, `selectionBar` and `datePicks`.
|
|
8
8
|
|
|
9
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.
|
|
10
10
|
|
|
@@ -79,7 +79,7 @@ assert.equal(conventions.locale, "en-GB"); // the app's own, untouched
|
|
|
79
79
|
|
|
80
80
|
## The components map
|
|
81
81
|
|
|
82
|
-
The package draws nothing with a UI library of its own. `ViewsComponents`, from `viewkitjs/views/react`, is the map you hand it: `Button`, `Popover`, `Tooltip`, `Checkbox`, `Menu`, `Collapse`, `Sheet`, `AppIcon` and `Markdown`, and twenty you may leave out: `Input`, `Command` (the command list's parts), `Picker` (a whole pick list your app draws), `LinksBody` (a whole links body: each link's roles and its lead), `Calendar` (the date editor's month), `DateBody` (a whole date body your app draws), `PartsBody` (a whole body for a name, a place or a range), `ValuesBody` (a whole body for several emails, phones, links or domains), `TextBody` (a whole body for a text typed as one string), `NumberBody` (a whole body for a number, money or a percent), `SortBody` (the sort editor's whole body), `FilterBody` (the filter editor's whole body), `FieldsBody` (the field list's whole body), `FilterPartBody` (a filter rule's way and value), `RowsWait` (what a grid's rows wait in while new ones load), `QuickFiltersBody` (the quick filters' whole body), `ViewsListBody` (the views list's whole body), `GroupBody` (the group editor's whole body), `CustomizeBody` (Customize's whole body) and `SearchField` (the toolbar's search box). The [contract](../contract.md#the-components-map) says what each slot must accept; the [`viewkitjs/views/react` reference](../reference/react.md) lists every prop.
|
|
82
|
+
The package draws nothing with a UI library of its own. `ViewsComponents`, from `viewkitjs/views/react`, is the map you hand it: `Button`, `Popover`, `Tooltip`, `Checkbox`, `Menu`, `Collapse`, `Sheet`, `AppIcon` and `Markdown`, and twenty-one you may leave out: `Input`, `Command` (the command list's parts), `Picker` (a whole pick list your app draws), `LinksBody` (a whole links body: each link's roles and its lead), `Calendar` (the date editor's month), `DateBody` (a whole date body your app draws), `PartsBody` (a whole body for a name, a place or a range), `ValuesBody` (a whole body for several emails, phones, links or domains), `TextBody` (a whole body for a text typed as one string), `NumberBody` (a whole body for a number, money or a percent), `SortBody` (the sort editor's whole body), `FilterBody` (the filter editor's whole body), `FieldsBody` (the field list's whole body), `FilterPartBody` (a filter rule's way and value), `RowsWait` (what a grid's rows wait in while new ones load), `QuickFiltersBody` (the quick filters' whole body), `ViewsListBody` (the views list's whole body), `GroupBody` (the group editor's whole body), `CustomizeBody` (Customize's whole body) and `SearchField` (the toolbar's search box), `PortsHost` (what draws the `toast` and `confirm` ports you leave out). The [contract](../contract.md#the-components-map) says what each slot must accept; the [`viewkitjs/views/react` reference](../reference/react.md) lists every prop.
|
|
83
83
|
|
|
84
84
|
The shapes are Base UI's, and the types promise three things:
|
|
85
85
|
|
package/views/docs/install.md
CHANGED
|
@@ -45,7 +45,10 @@
|
|
|
45
45
|
(Adjust the relative path to where your stylesheet sits.) A missing line shows unstyled values and editors.
|
|
46
46
|
This way the rendering needs no base reset (Tailwind's preflight or any other): every button, input,
|
|
47
47
|
textarea and link it draws itself resets itself, at zero specificity, so it looks the same with or without
|
|
48
|
-
one, and your own classes and base styles elsewhere are untouched.
|
|
48
|
+
one, and your own classes and base styles elsewhere are untouched. The grid's look (its header's words, its
|
|
49
|
+
frames, its pinned edge, its names and phones: the grid's options, `docs/guides/looks.md`) is plain CSS of its
|
|
50
|
+
own this way: import it after your Tailwind, `@import "viewkitjs/views/grid.css";`, and declare the grid's look
|
|
51
|
+
tokens (`VK_GRID_TOKENS`) with the colours below.
|
|
49
52
|
|
|
50
53
|
3. **Make the colours yours (optional).** The rendering paints through its own names. The stylesheet
|
|
51
54
|
already declares every one with the Outright look's value, light, and dark under `.dark` or `[data-theme="dark"]`;
|
|
@@ -6,7 +6,7 @@ Import from `viewkitjs/views/cells` to draw a column's cell: a column, its row a
|
|
|
6
6
|
|
|
7
7
|
Guide: [cells](../guides/cells.md).
|
|
8
8
|
|
|
9
|
-
- `renderTypedCellValue` — draws one typed cell: takes a column (`ListColumn`), its row and optional `GridCellOptions`. The value is `valueOverride` when it is defined, else the column's accessor. An empty value draws `null` (a boolean draws its off state; a name draws the column's `nameFallback` words), and so does a column with no type. A `title` column draws the list's title cell, the hotspot that opens the row, with the column's `indicator` beside the name. Any other column hands its `field`, or one `legacyFieldFromColumn` builds, to `renderFieldValue`. A `command` column handed `commandItems` opens your `CommandMenu` atom: one trigger around the value, or a chevron beside a relation,
|
|
9
|
+
- `renderTypedCellValue` — draws one typed cell: takes a column (`ListColumn`), its row and optional `GridCellOptions`. The value is `valueOverride` when it is defined, else the column's accessor. An empty value draws `null` (a boolean draws its off state; a name draws the column's `nameFallback` words; a `command` column handed `commandItems` draws its chevron alone, the trigger to its verbs), and so does a column with no type. A `title` column draws the list's title cell, the hotspot that opens the row, with the column's `indicator` beside the name. Any other column hands its `field`, or one `legacyFieldFromColumn` builds, to `renderFieldValue`. A `command` column handed `commandItems` opens your `CommandMenu` atom: one trigger around the value (a member's chip drawn inert inside it), or a chevron beside a relation, link, email, phone or domain, which stay their own control. A relation chip goes where `onOpenRelation` says, else where your `RelationLink` atom says, and is inert under `slotOwnsClick`.
|
|
10
10
|
- `renderIdentityValue` — draws an identity's value without the title cell, for a host that draws the name in its own chrome. A number, percent, currency, date, datetime or name draws through its field; anything else as its text. It returns `null` for an empty value unless the column gives the row a name fallback.
|
|
11
11
|
- `GridCellOptions` — what a surface tells a cell, all optional.
|
|
12
12
|
- The formatting: `presentation` and `viewer`.
|