viewkitjs 0.33.0 → 0.35.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 +139 -0
- package/package.json +1 -1
- package/views/README.md +1 -1
- package/views/dist/atoms/Avatar.js +2 -1
- package/views/dist/atoms/RelationChip.d.ts +2 -0
- package/views/dist/atoms/RelationChip.js +5 -0
- package/views/dist/atoms/RowMenu.d.ts +1 -1
- package/views/dist/atoms/RowMenu.js +15 -3
- package/views/dist/atoms/defaults.js +2 -0
- package/views/dist/atoms/types.d.ts +40 -4
- package/views/dist/cells/relation-wrap.js +9 -2
- package/views/dist/contract.d.ts +27 -14
- package/views/dist/contract.js +40 -4
- package/views/dist/controls/alert/alert.js +2 -1
- package/views/dist/controls/alert-dialog/alert-dialog.js +3 -2
- package/views/dist/controls/avatar/avatar-mark.d.ts +4 -0
- package/views/dist/controls/avatar/avatar-mark.js +5 -0
- package/views/dist/controls/avatar/avatar.d.ts +7 -4
- package/views/dist/controls/avatar/avatar.js +10 -4
- package/views/dist/controls/avatar/looks.d.ts +1 -1
- package/views/dist/controls/avatar/looks.js +3 -0
- package/views/dist/controls/avatar/record-mark.d.ts +16 -0
- package/views/dist/controls/avatar/record-mark.js +13 -0
- package/views/dist/controls/avatar/tokens.d.ts +12 -0
- package/views/dist/controls/avatar/tokens.js +3 -0
- package/views/dist/controls/avatar.css +54 -17
- package/views/dist/controls/bulk-bar/bulk-bar.js +29 -27
- package/views/dist/controls/bulk-bar/map-selection-bar.js +2 -1
- package/views/dist/controls/compound-editor/compound-editor.d.ts +3 -0
- package/views/dist/controls/compound-editor/map-parts-body.d.ts +1 -1
- package/views/dist/controls/compound-editor/map-parts-body.js +6 -1
- package/views/dist/controls/compound-editor/name-parts.js +2 -1
- package/views/dist/controls/compound-editor/place-parts.js +2 -2
- package/views/dist/controls/compound-editor/range-parts.js +10 -9
- package/views/dist/controls/controls.d.ts +2 -0
- package/views/dist/controls/controls.js +2 -0
- package/views/dist/controls/customize/customize.d.ts +14 -5
- package/views/dist/controls/customize/customize.js +19 -20
- package/views/dist/controls/customize/map-customize-body.d.ts +2 -2
- package/views/dist/controls/customize/map-customize-body.js +15 -13
- package/views/dist/controls/customize/words.d.ts +3 -3
- package/views/dist/controls/date-editor/date-editor.d.ts +3 -0
- package/views/dist/controls/date-editor/date-editor.js +13 -7
- package/views/dist/controls/date-editor/map-calendar.js +2 -0
- package/views/dist/controls/date-editor/map-date-body.d.ts +1 -1
- package/views/dist/controls/date-editor/map-date-body.js +7 -3
- package/views/dist/controls/filter-editor/filter-editor.d.ts +2 -0
- package/views/dist/controls/filter-editor/filter-editor.js +4 -6
- package/views/dist/controls/filter-editor/map-filter-body.d.ts +2 -0
- package/views/dist/controls/filter-editor/map-filter-body.js +7 -4
- package/views/dist/controls/filter-editor/parts.d.ts +4 -2
- package/views/dist/controls/filter-editor/parts.js +8 -7
- package/views/dist/controls/group-editor/group-editor.js +2 -1
- package/views/dist/controls/group-editor/map-group-body.d.ts +1 -0
- package/views/dist/controls/group-editor/map-group-body.js +5 -1
- package/views/dist/controls/index.d.ts +1 -1
- package/views/dist/controls/input/input.js +2 -1
- package/views/dist/controls/internal/head-button.d.ts +9 -0
- package/views/dist/controls/internal/head-button.js +13 -0
- package/views/dist/controls/internal/map-panel-controls.js +9 -5
- package/views/dist/controls/internal/panel-controls.d.ts +38 -6
- package/views/dist/controls/internal/panel-controls.js +191 -19
- package/views/dist/controls/links-editor/links-editor.js +5 -7
- package/views/dist/controls/links-editor/map-links-body.d.ts +1 -1
- package/views/dist/controls/links-editor/map-links-body.js +5 -1
- package/views/dist/controls/menu/menu.d.ts +5 -1
- package/views/dist/controls/menu/menu.js +4 -3
- package/views/dist/controls/modal/modal.js +5 -3
- package/views/dist/controls/number-editor/map-number-body.js +5 -1
- package/views/dist/controls/number-editor/number-editor.js +6 -6
- package/views/dist/controls/pane/map-pane.d.ts +3 -0
- package/views/dist/controls/pane/map-pane.js +5 -0
- package/views/dist/controls/picker/map-fields-body.d.ts +2 -2
- package/views/dist/controls/picker/map-fields-body.js +30 -2
- package/views/dist/controls/picker/map-picker.d.ts +8 -3
- package/views/dist/controls/picker/map-picker.js +14 -3
- package/views/dist/controls/picker/picker.js +11 -8
- package/views/dist/controls/picker/rows.d.ts +7 -2
- package/views/dist/controls/picker.css +10 -1
- package/views/dist/controls/quick-filters/map-quick-filters-body.d.ts +2 -1
- package/views/dist/controls/quick-filters/map-quick-filters-body.js +9 -4
- package/views/dist/controls/quick-filters/quick-filters.js +8 -6
- package/views/dist/controls/quick-filters/reminder.js +2 -2
- package/views/dist/controls/quick-filters/rules.d.ts +4 -1
- package/views/dist/controls/quick-filters/words.d.ts +2 -0
- package/views/dist/controls/quick-filters/words.js +1 -0
- package/views/dist/controls/select/select.d.ts +3 -0
- package/views/dist/controls/select/select.js +9 -3
- package/views/dist/controls/setting-row/looks.js +5 -5
- package/views/dist/controls/setting-row/setting-row.d.ts +3 -1
- package/views/dist/controls/setting-row/setting-row.js +3 -1
- package/views/dist/controls/setting-row.css +3 -2
- package/views/dist/controls/sheet/bottom-sheet.d.ts +3 -1
- package/views/dist/controls/sheet/bottom-sheet.js +2 -2
- package/views/dist/controls/sort-editor/map-sort-body.js +4 -4
- package/views/dist/controls/sort-editor/sort-editor.d.ts +2 -0
- package/views/dist/controls/sort-editor/sort-editor.js +4 -5
- package/views/dist/controls/text-editor/map-text-body.js +5 -1
- package/views/dist/controls/text-editor/text-editor.js +5 -4
- package/views/dist/controls/toolbar/toolbar.d.ts +29 -14
- package/views/dist/controls/toolbar/toolbar.js +17 -22
- package/views/dist/controls/toolbar.css +0 -5
- package/views/dist/controls/tooltip/map-tooltip.d.ts +1 -1
- package/views/dist/controls/tooltip/map-tooltip.js +4 -2
- package/views/dist/controls/values-editor/map-values-body.d.ts +1 -2
- package/views/dist/controls/values-editor/map-values-body.js +5 -1
- package/views/dist/controls/values-editor/values-editor.js +8 -7
- package/views/dist/controls/views-list/map-view-menu.d.ts +3 -2
- package/views/dist/controls/views-list/map-view-menu.js +6 -2
- package/views/dist/controls/views-list/map-views-list-body.d.ts +2 -1
- package/views/dist/controls/views-list/map-views-list-body.js +6 -5
- package/views/dist/controls/views-list/view-menu.js +3 -4
- package/views/dist/controls/views-list/views-list.js +2 -2
- package/views/dist/display/option-badges.d.ts +16 -0
- package/views/dist/display/option-badges.js +11 -0
- package/views/dist/display/relation-link.d.ts +12 -0
- package/views/dist/display/relation-link.js +17 -0
- package/views/dist/display/relation.d.ts +1 -1
- package/views/dist/display/relation.js +10 -3
- package/views/dist/display/select.js +1 -8
- package/views/dist/editors/EditorPanel.js +4 -4
- package/views/dist/editors/RangeEditor.d.ts +3 -0
- package/views/dist/editors/RangeEditor.js +2 -2
- package/views/dist/editors/SelectEditor.d.ts +2 -2
- package/views/dist/editors/SelectEditor.js +1 -1
- package/views/dist/editors/TextEditor.js +4 -2
- package/views/dist/editors/ValueListEditor.js +2 -1
- package/views/dist/field-row/FieldRow.js +32 -5
- package/views/dist/field-row/editors/RowRangeEditor.js +2 -1
- package/views/dist/grid/chrome/GridAddColumn.js +9 -6
- package/views/dist/grid/chrome/GridCellEditors.js +1 -1
- package/views/dist/grid/chrome/GridCellOutline.d.ts +3 -1
- package/views/dist/grid/chrome/GridCellOutline.js +16 -6
- package/views/dist/grid/chrome/GridChipsEditor.js +3 -2
- package/views/dist/grid/chrome/GridColumnMenu.js +7 -4
- package/views/dist/grid/chrome/GridFooter.d.ts +4 -1
- package/views/dist/grid/chrome/GridFooter.js +4 -4
- package/views/dist/grid/chrome/GridGroupMenu.js +39 -14
- package/views/dist/grid/chrome/GridHeader.d.ts +1 -1
- package/views/dist/grid/chrome/GridHeader.js +1 -2
- package/views/dist/grid/chrome/GridRangeEditor.d.ts +4 -1
- package/views/dist/grid/chrome/GridRangeEditor.js +2 -2
- package/views/dist/grid/chrome/GridRow.js +5 -3
- package/views/dist/grid/chrome/GridRowActions.d.ts +4 -1
- package/views/dist/grid/chrome/GridRowActions.js +2 -2
- package/views/dist/grid/chrome/GridRowCells.js +3 -2
- package/views/dist/grid/chrome/GridStructure.js +1 -1
- package/views/dist/grid/chrome/GridTable.js +32 -20
- package/views/dist/grid/chrome/checks.d.ts +1 -1
- package/views/dist/grid/chrome/checks.js +4 -1
- package/views/dist/grid/chrome/grid-cell-classes.d.ts +6 -2
- package/views/dist/grid/chrome/grid-cell-classes.js +10 -5
- package/views/dist/grid/chrome/grid-hover.d.ts +10 -2
- package/views/dist/grid/chrome/grid-hover.js +14 -4
- package/views/dist/grid/chrome/grid-row-props.d.ts +4 -0
- package/views/dist/grid/chrome/grid-rows-menu.js +9 -4
- package/views/dist/grid/chrome/grid-table-props.d.ts +10 -2
- package/views/dist/grid/grid.css +6 -0
- package/views/dist/grid/looks.d.ts +3 -1
- package/views/dist/grid/looks.js +10 -4
- package/views/dist/list/layer.d.ts +8 -0
- package/views/dist/list/layer.js +7 -0
- package/views/dist/list/list.d.ts +6 -2
- package/views/dist/list/list.js +6 -2
- package/views/dist/list/parts.js +3 -2
- package/views/dist/list/store.d.ts +1 -1
- package/views/dist/list/toolbar.js +51 -20
- package/views/dist/list/views.js +1 -0
- package/views/dist/panels/availability.d.ts +5 -0
- package/views/dist/panels/availability.js +4 -5
- package/views/dist/panels/customize-body.d.ts +4 -0
- package/views/dist/panels/customize-body.js +13 -11
- package/views/dist/panels/model.d.ts +9 -4
- package/views/dist/panels/react/customize-body.js +5 -2
- package/views/dist/panels/react/customize.d.ts +5 -0
- package/views/dist/panels/react/filter/FilterEditor.d.ts +6 -0
- package/views/dist/panels/react/filter/FilterEditor.js +7 -0
- package/views/dist/panels/react/quick/QuickFiltersPanel.d.ts +3 -1
- package/views/dist/panels/react/quick/QuickFiltersPanel.js +7 -3
- package/views/dist/panels/react/toolbar/ReadyToolbar.d.ts +17 -1
- package/views/dist/panels/react/toolbar/Toolbar.d.ts +15 -1
- package/views/dist/panels/react/toolbar/Toolbar.js +24 -9
- package/views/dist/panels/react/toolbar/ToolbarAdvancedFilters.js +3 -2
- package/views/dist/panels/react/toolbar/ToolbarFilterAdd.d.ts +6 -1
- package/views/dist/panels/react/toolbar/ToolbarFilterAdd.js +14 -6
- package/views/dist/panels/react/toolbar/ToolbarFilters.d.ts +7 -3
- package/views/dist/panels/react/toolbar/ToolbarFilters.js +21 -10
- package/views/dist/panels/react/toolbar/ToolbarOptions.d.ts +6 -1
- package/views/dist/panels/react/toolbar/ToolbarOptions.js +2 -2
- 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 +5 -4
- package/views/dist/panels/react/toolbar/ToolbarSort.d.ts +7 -1
- package/views/dist/panels/react/toolbar/ToolbarSort.js +6 -3
- package/views/dist/panels/react/toolbar/ToolbarSortPill.d.ts +3 -0
- package/views/dist/panels/react/toolbar/ToolbarSortPill.js +7 -6
- package/views/dist/panels/react/toolbar/context.d.ts +21 -0
- package/views/dist/panels/react/toolbar/context.js +4 -0
- package/views/dist/panels/react/toolbar/pane-host.d.ts +6 -0
- package/views/dist/panels/react/toolbar/pane-host.js +17 -0
- package/views/dist/panels/react/toolbar/panel-part.js +3 -2
- package/views/dist/panels/react/views-row/ViewPicker.js +13 -5
- package/views/dist/panels/react.d.ts +2 -2
- package/views/dist/panels/settings/layout.js +6 -38
- package/views/dist/panels/toolbar/page-resets.d.ts +17 -0
- package/views/dist/panels/toolbar/page-resets.js +62 -0
- package/views/dist/panels/toolbar/same-item.d.ts +7 -0
- package/views/dist/panels/toolbar/same-item.js +9 -0
- package/views/dist/panels/view-state.d.ts +4 -0
- package/views/dist/provider/ViewsProvider.d.ts +9 -3
- package/views/dist/provider/ViewsProvider.js +13 -2
- package/views/dist/provider/components.d.ts +59 -8
- package/views/dist/provider/components.js +1 -1
- package/views/dist/react.d.ts +2 -2
- package/views/dist/styles.css +194 -100
- package/views/dist/styles.unlayered.css +194 -100
- package/views/docs/contract.md +96 -27
- package/views/docs/controls/alert-dialog.md +4 -0
- package/views/docs/controls/alert.md +4 -0
- package/views/docs/controls/avatar.md +3 -0
- package/views/docs/controls/bulk-bar.md +7 -1
- package/views/docs/controls/compound-editor.md +2 -0
- package/views/docs/controls/customize.md +3 -1
- package/views/docs/controls/date-editor.md +2 -0
- package/views/docs/controls/filter-editor.md +1 -1
- package/views/docs/controls/group-editor.md +2 -0
- package/views/docs/controls/links-editor.md +2 -0
- package/views/docs/controls/menu.md +3 -1
- package/views/docs/controls/modal.md +4 -0
- package/views/docs/controls/number-editor.md +2 -0
- package/views/docs/controls/pane.md +1 -1
- package/views/docs/controls/picker.md +2 -0
- package/views/docs/controls/quick-filters.md +4 -2
- package/views/docs/controls/sheet.md +1 -1
- package/views/docs/controls/text-editor.md +3 -1
- package/views/docs/controls/toolbar.md +4 -0
- package/views/docs/controls/values-editor.md +2 -0
- package/views/docs/controls/views-list.md +2 -0
- package/views/docs/guides/atoms.md +54 -3
- package/views/docs/guides/display.md +1 -1
- package/views/docs/guides/looks.md +1 -1
- package/views/docs/guides/the-grid.md +4 -2
- package/views/docs/guides/the-provider.md +4 -4
- package/views/docs/index.md +2 -2
- package/views/docs/install.md +198 -104
- package/views/docs/reference/controls.md +21 -17
- package/views/docs/reference/editors-range.md +1 -1
- package/views/docs/reference/field-row.md +1 -1
- package/views/docs/reference/grid.md +2 -1
- package/views/docs/reference/list.md +7 -5
- package/views/docs/reference/looks.md +6 -6
- package/views/docs/reference/panels-react.md +17 -15
- package/views/docs/reference/panels.md +4 -4
- package/views/docs/reference/react.md +15 -12
- package/views/docs/reference/views.md +6 -4
- package/views/docs/reshaping.md +32 -5
- package/views/skills/views/SKILL.md +3 -3
|
@@ -91,11 +91,12 @@ export function OrdersFromAnAction() {
|
|
|
91
91
|
- `sortFilter` and `bar`: the toolbar's form on a computer, as `ListRoot` takes them.
|
|
92
92
|
- `menus`: every menu as data ([Menus as data](#menus-as-data)): `column`, `row` and `group` reach the grid, `view`, `add` and `more` the toolbar.
|
|
93
93
|
- `toolbarParts`: where each of the toolbar's parts stands ([Parts as data](#parts-as-data)).
|
|
94
|
+
- `customizeIn`: where Customize opens on a computer (VK-1026). `"popover"`, the default, at its button. `"pane"`: in your map's `Pane` (`CONTROLS.Pane`), at the list's right edge under the toolbar and as tall as the grid, over its edge, the grid scrolling and taking presses beside it; the grid then stands in a box of its own, `data-slot="vk-list-box"` (positioned, a flex column that fills the list: give the list its height as a flex column), the Pane's. On a phone Customize keeps its Sheet. An app on `ListRoot` hands its own box to `ListToolbar` as `paneBox`.
|
|
94
95
|
- `link`: default `true`. The address carries the open view and what changed over it (`view`, `q`, `change`), written in place as it changes, your other parameters and history state kept; an opened link wins over the person's draft; back and forward open what the address says. A link it can't read is said through the toast. Two lists on one page share those parameters: hand the second `link={false}`.
|
|
95
96
|
- `can`: `{ edit: false }` leaves every cell read-only, as with no `save`; `{ share: false }` takes "Save for everyone" away even where the store lets the person share, read as the list mounts, as `defaults` is.
|
|
96
97
|
- `onOpenRow`, `rowHref` and `rowWritable` reach the grid, as `GridTable` takes them; `onAdd`, `addItems` and `quickFilters` the toolbar, as `ReadyToolbar` takes them; the quick filters' hold narrows the rows too.
|
|
97
98
|
- `toolbar`, `grid` and `bulk`: any other prop of `ListToolbar`, `ListGrid` and `ListBulkBar`. A prop handed at the top wins over the same one in these; one not handed leaves theirs. `menus` merges key by key. A `grid.children` of your own (your own bar) stands where `ListBulkBar` would, and wins.
|
|
98
|
-
- `className`: on the `div` around the parts (`data-slot="vk-list"`).
|
|
99
|
+
- `className`: on the `div` around the parts (`data-slot="vk-list"`). With `customizeIn: "pane"` the grid stands in a `div` of its own inside it (`data-slot="vk-list-box"`).
|
|
99
100
|
- A field its key can't bind (a writable `datetime`, whose editor needs your time zone) throws, naming the field: hand its binding in `columns` (`bind`).
|
|
100
101
|
- For another arrangement, write `ListRoot` with the same data props and place the parts yourself.
|
|
101
102
|
- `ListProps` — what `List` takes.
|
|
@@ -148,7 +149,7 @@ export function DealsList({ children }: { children: ReactNode }) {
|
|
|
148
149
|
- `ListState` — one list's state, as a part selects it:
|
|
149
150
|
- `id`: the root's.
|
|
150
151
|
- `view`: `settings` (the view as the person edits it), `layer` (their own layer over it) and `shared` (the shared view, or `null`; kept by ViewKit, the open view, the person's own included).
|
|
151
|
-
- `panels`: `open` (the one open panel's key, or `null`), `pages` (each panel's page by its key), `held` (the filter rule held until whole), `barShown` (the filter bar shows), `footHere` (Clear and Save stand in Customize's foot,
|
|
152
|
+
- `panels`: `open` (the one open panel's key, or `null`), `pages` (each panel's page by its key), `held` (the filter rule held until whole), `barShown` (the filter bar shows), `footHere` (Clear and Save stand in Customize's foot: on a phone, and in Mihai's look beside the bar's own), `sortFilter` and `bar`. `ListToolbar` says `barShown` and `footHere` as it draws.
|
|
152
153
|
- `views`: the list's saved views where the root keeps them (a `ListViewsState`); `null` in memory mode.
|
|
153
154
|
- `columns`: the list's columns from its `fields`; `null` with none.
|
|
154
155
|
- `answer`: the rows the list shows (a `ListAnswerState`); `null` with no `fields`, or with neither `rows` nor a `source`.
|
|
@@ -162,7 +163,7 @@ export function DealsList({ children }: { children: ReactNode }) {
|
|
|
162
163
|
- `undo()` and `redo()`: take back the list's last edit, and put back the last one taken back, as ⌘Z and ⌘⇧Z do; nothing until there is one.
|
|
163
164
|
- `loadMore()` and `loadGroup(key)`: from a source, the next page, and a group's; nothing in memory, or while a newer request is out.
|
|
164
165
|
- `ListToolbar` — the ready toolbar's parts in their arrangements, reading the root around it: every `ReadyToolbar` prop but those the root holds. `ReadyToolbar` is a `ListRoot` holding no data around it. Place one per root: two would draw the same panels. Handed no `views` in a root that keeps its views, it draws the views row from them, its menu included; a new view takes one of its `layouts` (a table where none are handed).
|
|
165
|
-
- `ListToolbarProps` — what `ListToolbar` takes: `ReadyToolbarProps` without `settings`, `layer`, `onChange`, `onLayerChange`, `view`, `sortFilter` and `bar`; `toolbarParts` among them ([Parts as data](#parts-as-data)). In a root that holds a list's `fields` and its `rows` or `source`, `columns`, `groupHeads` and `filterData` default to the root's; handed, yours win.
|
|
166
|
+
- `ListToolbarProps` — what `ListToolbar` takes: `ReadyToolbarProps` without `settings`, `layer`, `onChange`, `onLayerChange`, `view`, `sortFilter` and `bar`; `toolbarParts` among them ([Parts as data](#parts-as-data)). In a root that holds a list's `fields` and its `rows` or `source`, `columns`, `groupHeads` and `filterData` default to the root's; handed, yours win. With `customizeIn: "pane"`, hand `paneBox`, your box round the grid (positioned, never scrolling itself: a `div` your `ref` callback keeps in state), and Customize opens there in the Pane on a computer (VK-1026).
|
|
166
167
|
|
|
167
168
|
## A list's saved views
|
|
168
169
|
|
|
@@ -315,13 +316,14 @@ export function DealsToolbar(props: ReadyToolbarProps<Deal>) {
|
|
|
315
316
|
```
|
|
316
317
|
|
|
317
318
|
- The function, `(parts, ctx) => parts` ([`ToolbarParts`, `ToolbarPartPlace` and `ToolbarPartsContext`, in `/panels/react`](./panels-react.md#the-toolbar)): handed the form's parts in the order they are placed (the row's start, its end, then the bar's start and end, as they draw on a computer; a kit phone's one line as it reads; in the `row` arrangement's narrow and phone forms the search still moves where the form puts it), it hands back the parts drawn, in their order. A part left out isn't drawn; a key the form doesn't hold is skipped, unless it brings its own `node`; a key handed twice counts once. Handed back as it came, the toolbar is exactly as with nothing handed. It is called as the toolbar draws: keep it pure and cheap, and call no hooks in it. Not `parts`, which is the builder's own (a field's part columns in Customize).
|
|
318
|
-
- A part's place: `{ key, line, side, words, node?, className?, button? }`.
|
|
319
|
+
- A part's place: `{ key, line, side, words, node?, className?, button?, panel? }`.
|
|
319
320
|
- `key`: the part's public name: `views` (and `views-stacked`, a second axis of views on the bar), `options` (Customize), `search`, `sort` (on the row, or the bar's sort in the old form), `sort-pill` (the bar's sort in Mihai's look with `bar: "always"`), `filter` and `filter-add` (Filter), `filters` (the filters on the bar), `advanced-filters`, `sep` (the bar's separator), `quick`, `new`, `save` (Clear and Save).
|
|
320
321
|
- `line`: `"row"`, `"bar"` (the filter bar; in the `row` arrangement, the line below the row) or `"foot"` (a kit phone list's foot, New's place; anywhere else it means the row). On a kit phone the row and the bar are one line, so `"bar"` stands a part on it too, and New stands on the line once you place it anywhere but `"foot"`.
|
|
321
322
|
- `side`: `"start"` or `"end"`.
|
|
322
323
|
- `words`: `"both"`, as the look's words say (icon and word where the buttons on the right show theirs), or `"icon"`, its icon alone whatever the look. It means something for a part whose button has an icon and a word: `search`, `quick`, `sort`, `filter`, `filter-add`, `options`, `new`. The search and, in Mihai's look, the quick filters' button are handed `"icon"`, as they always stood; placed `"both"`, they read their word and give it up first as the line narrows, as Sort and Filter do. A button with no icon (Clear, Save) keeps its words.
|
|
323
324
|
- `node`: a part of your own, under a key of your own, drawn where you place it (it doesn't fold into ⋯). `menu.add` places it. The keys above are the toolbar's, even while a part of theirs isn't handed: don't name your own part by one.
|
|
324
325
|
- `className`: put on every toolbar button the part draws (each handed its `part`, [Default keys](#default-keys)'s table), on the button itself, through your `ToolbarButton` (ViewKit's own puts it on its `<button>`, `CONTROL_ATOMS`' on the toolbar button or New's `Button`).
|
|
326
|
+
- `panel`: where what it opens hangs at its button, `{ side?, align?, offset? }` (`ToolbarPanelPlace`), your `Popover`'s `side`, `align` and `sideOffset`: `{ align: "start" }` opens Sort's panel from its button's start wherever Sort stands. Absent, a part on its line's end side opens its panel aligned to its button's end and one on its start side to its start, 8 px below it; a host of yours (`hosts`) or a phone's sheet takes none of it.
|
|
325
327
|
- `button`: your own button for the part, a component taking `ViewsToolbarButtonProps` ([`/react`](./react.md)), drawn for each of its toolbar buttons in place of your `ToolbarButton` and handed the very props it would get: `part`, `open`, `count`, `onClick`, `ref` and the rest. What it opens stays ViewKit's and hangs at your button through `ref`: put `ref` on the element you draw.
|
|
326
328
|
- Which form: `ctx` is `{ arrangement, phone }` (`"kit"` or `"row"`, and whether it is a phone's), so one function can place each form its own way.
|
|
327
329
|
- A part that comes and goes stays the toolbar's: the bar's `filters`, `save`, `sort-pill` and `sep` are handed only while the bar stands, so find them by key (a move by a key the list doesn't hold changes nothing). A part you place on the bar in Mihai's look at rest brings the bar with it; Clear and Save then still wait in Customize's foot.
|
|
@@ -351,7 +353,7 @@ const dressedParts: ToolbarParts = (parts) =>
|
|
|
351
353
|
- What stays fixed:
|
|
352
354
|
- Clear and Save move as one part (`save`); a part's words are `both` or `icon`, never its word alone.
|
|
353
355
|
- The views row (its chip, tabs, "+N" and "+", and `views-stacked`) and Clear and Save draw ViewKit's own pills and your `Button` in the ready toolbar: they take no `part`, and their place's `className` and `button` don't reach them (in your own frame they draw through your `ToolbarButton`, [`/panels/react`](./panels-react.md#the-toolbar)).
|
|
354
|
-
- ⋯ is named (`more`) but has no place,
|
|
356
|
+
- ⋯ is named (`more`) but has no place: its look comes through the toolbar's `overflow` (`ToolbarOverflow`, [`/panels/react`](./panels-react.md)), your glyph, your class or your whole button, handed the props your `ToolbarButton` would get; or dress it in your `ToolbarButton` by its `part`.
|
|
355
357
|
- A place's second buttons (Sort's +, the bar's Filter and +, "+N filters", a rule's four) share their place's one `className` and one `button`; tell them apart by `part` and `joined`.
|
|
356
358
|
- The kit's own `Toolbar` control ([`/controls`](./controls.md)) still places its parts from its look options, `settings: "right"` included, while the ready toolbar never reads `settings`: Customize's side comes through `toolbarParts`.
|
|
357
359
|
|
|
@@ -88,7 +88,7 @@ on a frame round the controls as `data-<piece>-*`, which each control's styleshe
|
|
|
88
88
|
- `StatusLookOptionId` — the Status's option ids.
|
|
89
89
|
- `SWITCH_LOOKS` — the Switch's: 4 options (`shape` a computer's, `phone` a phone's, `mark`, `motion`) and five looks, `slim`, `capsule`, `thin`, `hairline` and `classic`.
|
|
90
90
|
- `SwitchLookOptionId` — the Switch's option ids.
|
|
91
|
-
- `SETTING_ROW_LOOKS` — the setting row's: 3 options, two a computer's (`card`, `outlined` (the default)
|
|
91
|
+
- `SETTING_ROW_LOOKS` — the setting row's: 3 options, two a computer's (`card`, `outlined` or `raised` (the default); `rows`, `snug` or `roomy` (the default), 64 tall) and one a phone's (`icon`, `line` (the default), the glyph alone, or `tile`, a white glyph on a tile of the row's `colour`), and two looks, `outright` (`outlined`, `snug`, `line`: the SwitchRows as they were) and `attio` (`raised`, `roomy`, `line`: every option's default).
|
|
92
92
|
- `SettingRowOptionId` — its option ids.
|
|
93
93
|
- `SettingRowPicks` — one value for each.
|
|
94
94
|
- `MENU_LIST_LOOKS` — the menu list's, each a phone's: 6 options (`rows`, what its rows stand on; `lines`; `height`, a scale from `48` to `56`; `corners`, a scale from `lg` to `2xl`; `close`, a Close row; `tiles`) and five looks, `stack`, `card`, `plain`, `joined` and `words`, which pick the first four and leave the Close row and the tiles to the app.
|
|
@@ -100,7 +100,7 @@ on a frame round the controls as `data-<piece>-*`, which each control's styleshe
|
|
|
100
100
|
- `ListOptionId` — the list's option ids.
|
|
101
101
|
- `PICKER_LOOKS` — the Picker's: 9 options (`search`; `picked`, `create`, `doing`, `heading` and `face` a computer's; `mark`; `line`; `kind`) and two looks, `attio` (Attio's picks) and `mihai` (named Outright); with nothing picked, a second line below, the list's message at the start and a face of 24 (My preset's).
|
|
102
102
|
- `PickerOptionId` — the Picker's option ids.
|
|
103
|
-
- `AVATAR_LOOKS` — the Avatar's
|
|
103
|
+
- `AVATAR_LOOKS` — the Avatar's: 5 options and no looks. For its squares, `corners` (a scale from `small` to `xlarge`) and `smoothing`; for a record's mark, a person's or a thing's handed its object's `icon` with no picture, `mark` (`icon` or `initials`), `ground` (`quiet`, `grey`, `outline` or `colour`, the object's colour) and `icon-colour` (`grey` or `colour`). An Avatar handed no icon draws its letters as before.
|
|
104
104
|
- `AvatarLookOptionId` — the Avatar's option ids.
|
|
105
105
|
- `MENU_LIST_CARD_FRAME` — the menu list's options as a frame's data attributes, the Stack look's (Card rows, inset lines, 52, xl): a piece whose menu lists are no menu's own sheet (a panel's settings, a list of people) puts it round them, and keeps them whatever the app picks, since with nothing picked a menu's own sheet draws My preset's Words and the nearest frame wins.
|
|
106
106
|
|
|
@@ -149,11 +149,11 @@ on a frame round the controls as `data-<piece>-*`, which each control's styleshe
|
|
|
149
149
|
|
|
150
150
|
## The grid's
|
|
151
151
|
|
|
152
|
-
- `GRID_LOOKS` — the grid's options and looks:
|
|
152
|
+
- `GRID_LOOKS` — the grid's options and looks: 27 options (`header`, `lines`, `columns`, `density`, `phone`, `name`, `edge`, `boxes`, `icon`, `picked`, `cell`, `corners`, `hover`, `highlight`, `frame`, `groups`, `names`, `phones`, `typed`, `figures`, `offer`, `width`, `more`, `wait`, `foot`, `add`, `picking`) and two looks, `attio` and `portal` (ViewKit's own grid, as the portal draws it). Every default is My preset's, which differs from `attio` in ten options (`columns` `all`, `edge` `line`, `boxes` `always`, `picked` `line`, `corners` `round`, `hover` `strong`, `groups` `titles`, `names` `hover`, `phones` `text`, `figures` `word`). `highlight` (Row highlight: `hover`, the default, or `active`, the active row alone, `GridTable`'s `rowHighlight`) and `offer` (Add calculation: `hover`, the default, or `always`, every empty footer cell's offer shown at rest) are `hover` in both looks.
|
|
153
153
|
- `GridLookOptionId` — the grid's option ids.
|
|
154
|
-
- `GridLookWorn` — what the grid's code reads of its options: `columns`, `density`, `phone`, `name`, `boxes`, `icon`, `groups`, `figures`, `width`, `more`, `wait`, `foot`, `add` and `
|
|
155
|
-
- `GRID_LOOK_READ` — those
|
|
154
|
+
- `GridLookWorn` — what the grid's code reads of its options: `columns`, `density`, `phone`, `name`, `boxes`, `icon`, `groups`, `figures`, `width`, `more`, `wait`, `foot`, `add`, `picking` and `highlight`. The others are its look stylesheet's alone, `viewkitjs/views/grid.css`.
|
|
155
|
+
- `GRID_LOOK_READ` — those fifteen option ids, in that order. Twelve reach `GridTable` through `gridLookProps`; `more`, `figures` and `wait` the app wires itself (the [guide](../guides/looks.md)).
|
|
156
156
|
- `gridLookWorn` — `gridLookWorn(picks?)`: a `GridLookWorn` from a set of picks.
|
|
157
157
|
- `gridLookWornOf` — `gridLookWornOf(element)`: a `GridLookWorn` read from the frame round `element`.
|
|
158
158
|
- `gridLookProps` — `gridLookProps(worn, phone)`: the `GridTable` props a look sets, on a phone or a computer, as a `GridLookProps`.
|
|
159
|
-
- `GridLookProps` — `verticalBorders`, `headerVerticalBorders`, `scale` (the density's, times 1.25 on a phone under `phone: "attio"`), `freezeIdentity`, `alwaysCheckboxes`, `showRowIcon`, `oneHeader`, `groupMenu`, `fillWidth`, and the phone's three, `pinFooter`, `addColumnAt` and `phonePicking`, which on a computer are always ViewKit's own.
|
|
159
|
+
- `GridLookProps` — `verticalBorders`, `headerVerticalBorders`, `scale` (the density's, times 1.25 on a phone under `phone: "attio"`), `freezeIdentity`, `alwaysCheckboxes`, `showRowIcon`, `oneHeader`, `groupMenu`, `fillWidth`, `rowHighlight`, and the phone's three, `pinFooter`, `addColumnAt` and `phonePicking`, which on a computer are always ViewKit's own.
|
|
@@ -32,7 +32,7 @@ The row of views over a list, and any row of pills: each pill is your `Pill` ato
|
|
|
32
32
|
- `ViewTabs` — one axis as plain pills on a scroll rail.
|
|
33
33
|
- `toPillOptions` — views turned into pill options: the label and count joined by `views.panels.view-count`, a slot's colours, the glyph by your `AppIcon`.
|
|
34
34
|
- `FoldingViewRow` — the saved-views row that folds what doesn't fit into a "+N" chip, never folding the active view, and closes with the + when the axis grows. Handed `folded`, as a folding toolbar line hands it, it folds that many tabs and measures nothing of its own. Where the axis hands `verbs` and your map draws `ViewMenu`, its pills and each folded view's `⋮` in the "+N" list open the view's whole menu through it (VK-947), and its + opens New view's Modal through it, in place of the axis's `onCreate` (VK-971).
|
|
35
|
-
- `ViewPicker` — the same axis as one chip naming the active view, opening your `ViewsListBody` (`CONTROLS.ViewsListBody` is ViewKit's own) in your `Popover` at the chip; on a phone (in a `Toolbar`, its phone form; elsewhere your provider's `desktopQuery`) in your `Sheet` (`snap: "auto"`, titled `views.panels.views-list`). The body is handed the views as data, a pick or an order is written once it fits the axis, its `onDone` closes the list, and on a phone it gets the ✕ (and Back on a step) as its `actions` only where your sheet's head doesn't draw it, and `onStepChange`, whose step's title and Back the sheet shows; the axis's `verbs`, where it hands them, reach it as they are ([the components map](../contract.md#the-components-map)).
|
|
35
|
+
- `ViewPicker` — the same axis as one chip naming the active view, opening your `ViewsListBody` (`CONTROLS.ViewsListBody` is ViewKit's own) in your `Popover` at the chip; on a phone (in a `Toolbar`, its phone form; elsewhere your provider's `desktopQuery`) in your `Sheet` (`snap: "auto"`, titled `views.panels.views-list`). The body is handed the views as data, a pick or an order is written once it fits the axis, its `onDone` closes the list, and on a phone it gets the ✕ (and Back on a step) as its `actions` only where your sheet's head doesn't draw it, and `onStepChange`, whose step's title and Back the sheet shows; the axis's `verbs`, where it hands them, reach it as they are ([the components map](../contract.md#the-components-map)). With no view yet it draws only the axis's +, which opens New view's Modal through your `ViewMenu` where the axis hands `verbs` and your map draws one, as the row's + does, and otherwise calls the axis's `onCreate`.
|
|
36
36
|
- `ViewPickerRow` — one view as a row of a list, with the active view's `⋮`; handed `viewMenu`, every row's `⋮` opens the view's whole menu through your `ViewMenu`.
|
|
37
37
|
- `ViewCreatePill` — the + that creates a view.
|
|
38
38
|
- `ViewAxes` — an axis or several on one row: one axis at the row's size folds, peer axes share one rail, each in its own track. `folded` is handed on to the one axis's `FoldingViewRow`.
|
|
@@ -49,9 +49,9 @@ A panel's list keeps `--vk-panel-padding` from its edge ([Tokens](../contract.md
|
|
|
49
49
|
|
|
50
50
|
## Customize
|
|
51
51
|
|
|
52
|
-
The panel a list's Options button opens: your components map's `CustomizeBody` (`CONTROLS.CustomizeBody`, or your own), handed the view's settings as data, wherever the panel hangs ([the components map](../contract.md#the-components-map)). ViewKit draws no Customize of its own. Your app hosts it: in a popover, or in a drawer of its own.
|
|
52
|
+
The panel a list's Options button opens: your components map's `CustomizeBody` (`CONTROLS.CustomizeBody`, or your own), handed the view's settings as data, wherever the panel hangs ([the components map](../contract.md#the-components-map)). ViewKit draws no Customize of its own. Your app hosts it: in a popover, or in a drawer of its own; or, with the toolbar's `customizeIn: "pane"` (VK-1026), in your map's `Pane` (`CONTROLS.Pane`) at the right edge of the list's box under the toolbar, as tall as the list, the list in use beside it, with no host of your own. The Pane is a computer's shell: on a phone Customize keeps its Sheet.
|
|
53
53
|
|
|
54
|
-
- `ViewOptionsPanelContent` — the panel: your `CustomizeBody`, handed the view's settings as data. Takes the list's `filters`, `sort`, `group`, `timeScopeConfig`, `dateRangeConfigs`, `toggles` and `layout` (`ViewOptionInputs`; its `sorts` and `filterTree` reach the body as its sort and filter), `activePanel` and `onOpenPanel` (the body's `page` and `onPageChange`), `anyActive` and `clearAll`, and optionally `view` (`CollectionViewState`), `viewFoot` (the body's `foot`: `kit` for Clear and Save, `none` where they stand elsewhere), `footClear` (with no shared view, the foot's Clear), `foldFilters` (the body's `fields` folded behind one Filter row, on by default; off, each is a row of its own), `onClose` (the body's `onDone`), `closeButton` (whether a phone's body is handed its ✕, default true; false in a sheet whose head draws it), `fieldEditor` (`PanelFieldEditor`), and `viewName`, `onRenameView`, `onCopyLink`, `onExport` and `exportCount`, handed on to the body as `ToolbarOptions` hands them. `fill` is deprecated and read by nothing: the body sizes itself in its host.
|
|
54
|
+
- `ViewOptionsPanelContent` — the panel: your `CustomizeBody`, handed the view's settings as data. Takes the list's `filters`, `sort`, `group`, `timeScopeConfig`, `dateRangeConfigs`, `toggles` and `layout` (`ViewOptionInputs`; its `sorts` and `filterTree` reach the body as its sort and filter), `activePanel` and `onOpenPanel` (the body's `page` and `onPageChange`), `anyActive` and `clearAll`, and optionally `view` (`CollectionViewState`), `viewFoot` (the body's `foot`: `kit` for Clear and Save, `none` where they stand elsewhere), `footClear` (with no shared view, the foot's Clear), `resets` (each Customize page's own Reset while that page differs, handed to the body as its `resets`), `layered` (the reader's own layer holds something: the foot's Reset stands for it, Save doesn't), `foldFilters` (the body's `fields` folded behind one Filter row, on by default; off, each is a row of its own), `onClose` (the body's `onDone`), `closeButton` (whether a phone's body is handed its ✕, default true; false in a sheet whose head draws it), `fieldEditor` (`PanelFieldEditor`), and `viewName`, `onRenameView`, `onCopyLink`, `onExport` and `exportCount`, handed on to the body as `ToolbarOptions` hands them. `fill` is deprecated and read by nothing: the body sizes itself in its host.
|
|
55
55
|
- `ViewOptionsActions` — the actions row: Copy link and Share parked, Export CSV live when `exportCsv` (`CollectionExportCsv`) is handed in, its count on the row and one export at a time behind the `loading` glyph, which your app draws turning.
|
|
56
56
|
- `ViewOptionsPopoverPanel` — the panel for a popover: `ViewOptionsPanelContent` with `setActivePanel` for `onOpenPanel`, its `sorts` and `filterTree` handed on; a `CustomizeBody` in your map opens in its place.
|
|
57
57
|
- `useViewOptionsPopover` — the state the trigger and the popover share (`ViewOptionsPopoverState`): `open`, the page it is on, the trigger's `badge` (the drift from everyone's view on a shared view, else the active options) and its `clearAll` (Reset, else clear them), and `handleOpenChange`, which forgets the page on a close. The trigger's own look is yours.
|
|
@@ -64,15 +64,16 @@ The panel a list's Options button opens: your components map's `CustomizeBody` (
|
|
|
64
64
|
|
|
65
65
|
The frame that holds a list's controls, and the parts that need no list settings. `Toolbar` takes the parts your app hands it, each placed at the start or the end, on the first line or the second, and draws them in one of three forms (`/panels`' [arrangement](panels.md#the-toolbars-arrangement)): `row`, `narrow` (its own box under 700px) or `phone` (your provider's `desktopQuery` says it is not a desktop). Pass `phone` or `narrow` to decide either yourself. A part is any node: the frame tells it where it stands through `useToolbarSlot`, and its buttons draw through the `ToolbarButton` atom at their line's size. A part that opens something (a menu, a panel, a pane your app holds) registers it with `useToolbarPanel`, and opening one closes every other, however it opened. A change of form draws the parts afresh, so keep what must last across it (a search's text, a panel's open state) in your app: a panel part left to hold its own state closes when the box crosses 700px, and one handed its state from `useToolbarPanelState`, held above the `Toolbar`, stays open on its page. The row's end controls float over the views on a fade of `--vk-ground` (`data-toolbar-cluster`), which the folding views row measures. Its look is plain; its pieces carry the `data-slot`s the [contract](../contract.md) lists.
|
|
66
66
|
|
|
67
|
-
- `Toolbar` — the frame (one radio for its parts, or, inside a `ListRoot`, the root's). Takes `parts` (`ToolbarPart[]`), and optionally `phone`, `narrow`, `narrowBelow` (700 by default), `fold`, `more` (`ToolbarMore`, ⋯ as data: handed the folded parts' rows, each keyed by its part, and `{ line }`, `"row"` or `"bar"`, since each line folds into its own ⋯, it returns the rows ⋯ shows; a press on any of them closes ⋯ first) and `className`. Each of its lines is a toolbar of its own (`role="toolbar"`): the filter bar (and the three forms' second line) named `views.panels.toolbar-bar` ("Sort and filters"), every other line `views.panels.toolbar-row` ("List tools"). With `fold` it draws the kit's arrangement (`/panels`' fold arrangement): the row and the filter bar under it, each a band with a line across under it, or a phone's one line, with no narrow form; each line measures itself and gives way as it narrows (it contains its own inline size, so its width comes from where it stands and never from what its lines hold: in a holder sized from its content, a main beside a sidebar, it still gives way, with no wrapper of yours), a part's words turning to its icon (the `ToolbarButton` atom's `iconAlone`), the views folding tabs into "+N", a part's filters folding into "+N filters", then what may fold going behind ⋯ (`data-slot="vk-toolbar-overflow"`, your `Menu`, each row the folded part's `menu`). A folded part keeps its state, and what it opens hangs under ⋯; while ⋯'s menu, a folded part's panel, the views' "+N" list, a filter with a part open (`data-slot="vk-toolbar-filter-rule"` marked `data-open`), an open advanced filter (`data-slot="vk-toolbar-advanced-filter"` marked `data-open`) or "+N filters"' menu (the button in `data-slot="vk-toolbar-more-filters"`, `aria-expanded`) is open, the line holds still. The frame holds the search's open state: open, the line gives way around it, and on a phone the search takes the line beside the views.
|
|
67
|
+
- `Toolbar` — the frame (one radio for its parts, or, inside a `ListRoot`, the root's). Takes `parts` (`ToolbarPart[]`), and optionally `phone`, `narrow`, `narrowBelow` (700 by default), `fold`, `more` (`ToolbarMore`, ⋯ as data: handed the folded parts' rows, each keyed by its part, and `{ line }`, `"row"` or `"bar"`, since each line folds into its own ⋯, it returns the rows ⋯ shows; a press on any of them closes ⋯ first), `overflow` (`ToolbarOverflow`, ⋯ as you draw it) and `className`. Each of its lines is a toolbar of its own (`role="toolbar"`): the filter bar (and the three forms' second line) named `views.panels.toolbar-bar` ("Sort and filters"), every other line `views.panels.toolbar-row` ("List tools"). With `fold` it draws the kit's arrangement (`/panels`' fold arrangement): the row and the filter bar under it, each a band with a line across under it (on a computer its padding, the room between its tools and the line are `--vk-toolbar-line-py`, `--vk-toolbar-line-gap` and `--vk-toolbar-line-w`, [Tokens](../contract.md)), or a phone's one line, with no narrow form; each line measures itself and gives way as it narrows (it contains its own inline size, so its width comes from where it stands and never from what its lines hold: in a holder sized from its content, a main beside a sidebar, it still gives way, with no wrapper of yours), a part's words turning to its icon (the `ToolbarButton` atom's `iconAlone`), the views folding tabs into "+N", a part's filters folding into "+N filters", then what may fold going behind ⋯ (`data-slot="vk-toolbar-overflow"`, your `Menu`, each row the folded part's `menu`). A folded part keeps its state, and what it opens hangs under ⋯; while ⋯'s menu, a folded part's panel, the views' "+N" list, a filter with a part open (`data-slot="vk-toolbar-filter-rule"` marked `data-open`), an open advanced filter (`data-slot="vk-toolbar-advanced-filter"` marked `data-open`) or "+N filters"' menu (the button in `data-slot="vk-toolbar-more-filters"`, `aria-expanded`) is open, the line holds still. The frame holds the search's open state: open, the line gives way around it, and on a phone the search takes the line beside the views.
|
|
68
68
|
- `ToolbarPart` — a part as your app hands it: a `ToolbarPlacement` (its `key`, `side`, `line`, `role`, in the fold arrangement `shed`, `tabs`, `filters` and `fold`, and `words` and `foot`), its `node`, and for a part that may fold its `menu`: `{ label, icon?, onSelect }`, its row in ⋯. `words`: `"icon"` stands a `ToolbarButton` drawn in it as its icon alone, its words given up (a button with no icon keeps them); `"both"` gives the search's button, and the quick filters' button handed `word={null}`, their word, as the look's words say; absent, each its own. `foot: false` keeps New on a phone's folding line instead of at the list's foot.
|
|
69
69
|
- `ToolbarSeparator` — the line between the sort and the filters on a filter bar (or Filter while there is none), placed with `role: "separator"`: drawn only while a part stands drawn on each side of it, and never on a phone's line.
|
|
70
70
|
- `ToolbarViews` — the views row: `views` (`CollectionViewsInput`) and `viewsLayout`. On the row and in the narrow panel it draws `ViewAxes`, or with `as="picker"` and one axis alone its `ViewPicker`; placed again with `stacked` on the second line, it draws the axes a stacked layout pushes beneath, small. On the phone it draws a `ViewPicker` per axis, every axis, and nothing for `stacked`. With `showCounts` the toolbar owns Show counts (`withCounts`). Place it only when the list has views: the phone's search fills the row when nothing is placed at the start.
|
|
71
71
|
- `ToolbarSearch` — the search, placed with `role: "search"`: `value`, `onChange`, `placeholder` (`views.panels.search` by default) and `searching` (while true, a spinner, worded `views.panels.searching`, stands where its glass is, on the button and in the field, and the field, marked `aria-busy`, keeps its value and its typing; your app decides when it is true). On the row, and beside the phone's views, a button that opens an inline field; in the narrow panel, and on a phone with no views, a field that fills its line. A field that holds a value shows from the start. Escape and its ✕ clear it and close a field the button opened; a blur with nothing typed closes it. The field is your `Input`, or, handed `SearchField` in your components map, your whole search box: it stands in place of the glass, the field and the ✕, handed the value, the clear and its form, while the button, the open state, the caret on a press, Escape and a blur stay ViewKit's ([the components map](../contract.md#the-components-map)). Shut, its button is its glass alone, reading "Search" beside it only where its part is placed `words: "both"`, as the look's words say.
|
|
72
72
|
- `ToolbarNew` — the +: `onAdd` (one way to add, the button fires it) or `items` (several, opened through your `Menu`, one of the toolbar's panels), `label` (`views.panels.toolbar-new` by default) and `icon` (your `add` glyph by default); its word for a dress is its label. With neither, the row draws it disabled, so its place never moves; the narrow panel and the phone draw nothing. In a folding `Toolbar` on a phone it stands at the list's foot instead (`data-at="foot"`): a round + (the atom's `foot`) fixed at the screen's bottom-end corner, over the list, lifted by `--vk-toolbar-foot`, and drawn into the document's body so a page that scrolls inside a transformed box can't carry it away; with no verb, nothing there.
|
|
73
73
|
- `ToolbarButton` — the `ToolbarButton` atom at the size of the line it stands in, for a custom part's buttons.
|
|
74
|
-
- `useToolbarSlot` — where this part stands (`ToolbarSlotState`): `form`, `fill`, `size` and its line's kind; in the fold arrangement also `fold`, `iconAlone`, `tabsFolded`, `filtersFolded` (how many of its filters folded into "+N filters"), `folded`, `more` (⋯'s button) and, for the search, `search` (its open state, held by the frame); `words` and `foot`, as the part was placed (`ToolbarPlacement`, [`/panels`](./panels.md)), which your own frame may set too; `key`, `className` and `button`, its place's key and look (`ToolbarPartPlace`): a part names its buttons after `key`, and draws each with `button` in place of your `ToolbarButton` and with `className` on it, which your own frame may hand too; and `appFrame`, true inside your own frame (`ToolbarSlotProvider`); outside a `Toolbar`, the row's main line at `md`, folding nothing.
|
|
74
|
+
- `useToolbarSlot` — where this part stands (`ToolbarSlotState`): `form`, `fill`, `size` and its line's kind; in the fold arrangement also `fold`, `iconAlone`, `tabsFolded`, `filtersFolded` (how many of its filters folded into "+N filters"), `folded`, `more` (⋯'s button) and, for the search, `search` (its open state, held by the frame); `words` and `foot`, as the part was placed (`ToolbarPlacement`, [`/panels`](./panels.md)), which your own frame may set too; `key`, `className` and `button`, its place's key and look (`ToolbarPartPlace`): a part names its buttons after `key`, and draws each with `button` in place of your `ToolbarButton` and with `className` on it, which your own frame may hand too; `side` and `panel`, its side of its line (folded into ⋯, ⋯'s side) and its place's `panel` (`ToolbarPanelPlace`): what it opens hangs toward `side` unless `panel` says, and your own frame may set either; and `appFrame`, true inside your own frame (`ToolbarSlotProvider`); outside a `Toolbar`, the row's main line at `md`, folding nothing.
|
|
75
75
|
- `ToolbarSlotState` — what `useToolbarSlot` returns.
|
|
76
|
+
- `ToolbarPanelPlace` — where a part's popover hangs at its button: `{ side?, align?, offset? }`, your `Popover`'s `side`, `align` and `sideOffset`. Absent, on a computer a part on its line's end side opens what it opens aligned to its button's end and one on the start side to its start, 8 px below it; a part outside a `Toolbar` with no `side` in its slot opens as it always did (Customize, Sort, Filter and the quick filters at their button's end, the sort pill and Filter on the bar at its start). Read from where the part stands, never from whether it is open, so a closing panel keeps its side.
|
|
76
77
|
- `useToolbarPanel` — a part's open state as one of the toolbar's panels, named by a key: `{ open, onOpenChange }`. Each call is its own panel, so two parts that name the same key still close each other. Hand it `{ open, onOpenChange }` for a panel your app holds; without, it holds its own. Inside a `ListRoot`, one of the root's panels; outside a `Toolbar` and a root, plain open state.
|
|
77
78
|
- `ToolbarSlotProvider` — for your own toolbar frame: tells the part inside it where it stands, as `Toolbar` tells each of its parts. Takes `slot`, a partial `ToolbarSlotState` laid over the outside default (the row's main line at `md`, folding nothing); its `form` defaults to your provider's `desktopQuery` (`"phone"` off a desktop). It sets `appFrame: true` (`slot.appFrame: false` opts out): inside it the Views part (`ToolbarViews`) draws its chip, its view tabs, its "+N" and its "+" through your `ToolbarButton`, and `ToolbarSave` its Clear and Save, each told what it is (`current`, `part`, `onContextMenu`); a tab's status colours (`activeClassName`, `hoverClassName`) stay with ViewKit's own pills and don't reach it, and a `PillGroup`, `ViewTabs`, `ViewPicker` or `ViewCreatePill` you place yourself stays as it is. It replaces any slot above it.
|
|
78
79
|
- `ToolbarRadioProvider` — for your own toolbar frame: the radio, held for its life, as `Toolbar` holds one. Placed around your frame, the parts inside it that open something close each other, and a part's panel opens in your `Sheet` when its slot's `form` is `"phone"`. Inside a `ListRoot` ([`/list`](./list.md)) it is the root's radio, so your frame's panels and every other frame's in that list close each other.
|
|
@@ -131,19 +132,19 @@ export function ListToolbar({
|
|
|
131
132
|
Options, Sort and Filter each open their panel from their own button, and each takes the builder's panels ([`settingsPanels`](panels.md#built-from-a-lists-settings)): an app that arranges its own parts calls the builder and hands them in. A panel hangs in your `Popover` at its button (`chrome="menu"`, aligned to its end), or in a host you hand in, your side drawer or your sheet, where it draws full height. On a phone (in a `Toolbar`, its phone form; elsewhere your provider's `desktopQuery`) it opens in your `Sheet` instead (`snap: "full"`, named `label` with the part's name, its own header titling it), full height, with every page the popover has; a host you hand still takes it. With your provider's `sheetActions: "head"`, the sheet's head draws the panel's ✕ (`actions.close`, no `done`, unless the panel hands its own ✕ and ✓, as the sort pill's editor does) and the panel draws none. Each is one of the toolbar's panels, so opening one closes the others. Hand `open` and `onOpenChange` (and `page` and `onPageChange` where it drills in) to hold its state yourself; without, it holds its own, forgetting its page when it closes.
|
|
132
133
|
|
|
133
134
|
- `ToolbarOptions` — Customize behind its own button, named and worded `views.panels.toolbar-options`: the builder's `filters`, `sort`, `group` and `layout` (and its `filterTree`, with and/or groups: its count and default Clear then read the advanced filters), your `toggles`, `timeScopeConfig` and `dateRangeConfigs` (a `ViewOptionInputs`), and optionally `view` (a shared view: the drift dot on the button instead of a count, and the panel's footer), `fieldEditor`, `foldFilters` (true by default), `onClear` (the ✕ and the panel's Clear all; by default each active option cleared through its own `onChange`, the builder's filter rows adding up so every filter clears, or Reset on a shared view; for one change, `settingsCleared(…, "options")`), `widthClassName` (`w-75` by default: 300 px, the Pane Customize was designed in), `host`, and what your `CustomizeBody` draws only where you hand it: `viewName` with `onRenameView` (the view's name, renamed in place), `onCopyLink`, and `onExport` with `exportCount` (what it takes, in words). On a phone, while your body stands on a level of its own inside a section (`onStepChange`), the sheet's Escape goes back a level instead of closing. Its button counts the active options (`countActiveViewOptions`) with a ✕ that clears them. Draws nothing when there is nothing to customize. A `CustomizeBody` in your components map opens in place of the panel, in the same popover, `host` or phone `Sheet`.
|
|
134
|
-
- `ToolbarSort` — the sort panel behind its own button, named `views.panels.sort`: the builder's `sort`, lit
|
|
135
|
-
- `ToolbarSortPill` — the sort as up to 3 rules, the kit's sort on its filter bar, in `data-slot="vk-toolbar-sort-pill"`: takes the builder's `sorts`, and optionally `open` and `onOpenChange` (to hold its state yourself), `host` and `addAfter` (default true). On a computer, "Sorted by" its first rule's field, in weight, with the rest counted (+1), opening the sort editor in your `Popover`; after it a + (`data-slot="vk-toolbar-sort-add"`, named `views.panels.sort-add-one`) while there are fewer than three, opening the fields, a pick adding a rule; with no rule, an empty place, "Sort", opening the fields. Handed `addAfter={false}` (the kit's bar), it draws no +, and its editor, or your `SortBody` (handed `addSort`), has Add sort at its foot. Handed `row`, it is Sort on a toolbar row (`data-slot="vk-toolbar-sort-row"`, as `ReadyToolbar`'s default stands it): its word "Sort", lit while a rule stands and counted from two; however it opens (a press, or ⋯ when it folded) it shows the sort editor, Add sort at its foot, while a rule or a set-aside sort stands, else the fields; it draws no + and `addAfter` means nothing to it. The fields are your `FieldsBody`. × on the editor's last rule closes it. On a phone, "Sort" with its rules counted, opening the sort editor in your `Sheet`, its ✕ taking back what changed since it opened and its ✓ keeping it; a swipe, the dim or Escape close it and keep the changes; while your `SortBody` stands on a step of its own (`onStepChange`), Escape goes back a step instead, and under `sheetActions: "head"` your sheet's head shows the step's title. Its popovers, or its sheet, are one of the toolbar's panels.
|
|
135
|
+
- `ToolbarSort` — the sort panel behind its own button, named `views.panels.sort`: the builder's `sort`, lit while the list sorts other than its default, or, handed `changed`, as that says (the ready toolbar hands it while the sort differs from the saved view). Draws nothing when nothing sorts. Handed `bar`, it is the one-rule sort on the filter bar, as a several-sorts list's pill reads there: "Sorted by **Name**" (`views.panels.sorted-by` and the sort's field), in the bar's sort place (`data-slot="vk-toolbar-sort-pill"`), opening the same panel. Handed the builder's `sorts` too (with `severalSorts`), it is Sort on the row's right as the kit draws it there: "Sort", counted once there are two rules, opening the fields (`SortFieldList`), a pick adding a rule at the end, ascending; at three it can't be used, saying why (`views.panels.sort-max`).
|
|
136
|
+
- `ToolbarSortPill` — the sort as up to 3 rules, the kit's sort on its filter bar, in `data-slot="vk-toolbar-sort-pill"`: takes the builder's `sorts`, and optionally `open` and `onOpenChange` (to hold its state yourself), `host` and `addAfter` (default true). On a computer, "Sorted by" its first rule's field, in weight, with the rest counted (+1), opening the sort editor in your `Popover`; after it a + (`data-slot="vk-toolbar-sort-add"`, named `views.panels.sort-add-one`) while there are fewer than three, opening the fields, a pick adding a rule; with no rule, an empty place, "Sort", opening the fields. Handed `addAfter={false}` (the kit's bar), it draws no +, and its editor, or your `SortBody` (handed `addSort`), has Add sort at its foot. Handed `row`, it is Sort on a toolbar row (`data-slot="vk-toolbar-sort-row"`, as `ReadyToolbar`'s default stands it): its word "Sort", lit while a rule stands (handed `changed`, lit by it instead, on the row and as a pill: the ready toolbar hands it while the sort differs from the saved view) and counted from two; however it opens (a press, or ⋯ when it folded) it shows the sort editor, Add sort at its foot, while a rule or a set-aside sort stands, else the fields; it draws no + and `addAfter` means nothing to it. The fields are your `FieldsBody`. × on the editor's last rule closes it. On a phone, "Sort" with its rules counted, opening the sort editor in your `Sheet`, its ✕ taking back what changed since it opened and its ✓ keeping it; a swipe, the dim or Escape close it and keep the changes; while your `SortBody` stands on a step of its own (`onStepChange`), Escape goes back a step instead, and under `sheetActions: "head"` your sheet's head shows the step's title. Its popovers, or its sheet, are one of the toolbar's panels.
|
|
136
137
|
- `SortEditorHost` — the host of your sort body alone, for a holder of your own (a popover; ViewKit's own body is `SortEditor`, on `viewkitjs/views/controls`): `sorts`, `form` (`"computer"` or `"phone"`), and optionally `open`, `onDone` and `addSort` (Add sort at a computer's body's foot, for a holder with no + of its own). It opens your `SortBody` (`CONTROLS.SortBody` is ViewKit's own), handed the rules as data, its whole list written once it fits the rules; every change goes out through `sorts.onChange` as it is made.
|
|
137
138
|
- `useSortEditorHost` — the sort editor's state for a sheet's holder (`SortEditorOptions`: `sorts`, `form`, `open`, `onDone`, `addSort`): `{ body, head, title, escapeBack }`. `body(closeButton)` draws your `SortBody`, on a phone handed `head` as its `actions` when `closeButton` is true (no head of your sheet draws them: your provider's `sheetActions` is `bar`, or a host of yours holds it); `head` is the ✕ (named `views.panels.close`) and ✓ (`views.panels.sort-done`) for your sheet's head, as its `actions`. ✕ takes the rules back, in one change, to what they were when `open` last turned true; the body's `onDone` calls the `onDone` you hand ([the components map](../contract.md#the-components-map)). On a phone the body is also handed `onStepChange`: while it stands on a step of its own, `title` is the step's (your sheet's title in place of the sort's), `head` gains `back` (Back, for `close`'s place), and `escapeBack()` goes back a step and says it did, so your sheet's Escape calls it first and closes only when it returns false.
|
|
138
139
|
- `SortEditorOptions` — what `useSortEditorHost` takes.
|
|
139
|
-
- `ToolbarQuickFilters` — the quick filters' button (`data-slot="vk-toolbar-quick"`), named `views.panels.quick-filters` (or the config's `label`), lit (`changed`) while a value is held: takes `quickFilters` (a `QuickFiltersConfig`, [`/panels`](./panels.md#quick-filters)), and optionally `open` and `onOpenChange` (to hold its state yourself), `host`, `icon` (its glyph; the `filterCategory` icon when absent) and `word` (`null`: its icon alone, its name its label to a screen reader, as `ReadyToolbar`'s default draws it on a computer, unless its part is placed `words: "both"`). It opens your `QuickFiltersBody` (through `QuickFiltersPanel`) in your `Popover` (`data-slot="vk-toolbar-quick-panel"`), in `host
|
|
140
|
-
- `QuickFiltersPanel` — the quick filters' panel alone, for a holder of your own: `quickFilters`, `form` (`"computer"` or `"phone"`), and optionally `onDone
|
|
140
|
+
- `ToolbarQuickFilters` — the quick filters' button (`data-slot="vk-toolbar-quick"`), named `views.panels.quick-filters` (or the config's `label`), lit (`changed`) while a value is held: takes `quickFilters` (a `QuickFiltersConfig`, [`/panels`](./panels.md#quick-filters)), and optionally `open` and `onOpenChange` (to hold its state yourself), `host`, `icon` (its glyph; the `filterCategory` icon when absent) and `word` (`null`: its icon alone, its name its label to a screen reader, as `ReadyToolbar`'s default draws it on a computer, unless its part is placed `words: "both"`). It opens your `QuickFiltersBody` (through `QuickFiltersPanel`) in your `Popover` (`data-slot="vk-toolbar-quick-panel"`), in `host` (on a computer under the panels' header, its name and ✕, since a host draws no head), or on a phone in your `Sheet`, and is one of the toolbar's panels. With no field to offer it draws nothing.
|
|
141
|
+
- `QuickFiltersPanel` — the quick filters' panel alone, for a holder of your own: `quickFilters`, `form` (`"computer"` or `"phone"`), and optionally `onDone`, `closeButton` (false where your sheet's head draws the ✕) and `inHost` (it stands in a host of yours that draws no head: on a computer, the panels' header over it, its name and its ✕). It opens your `QuickFiltersBody` (`CONTROLS.QuickFiltersBody` is ViewKit's own), handed the fields as the strip shows them (`quickFieldsShown`) with their values as they show (`quickValuesShown`, worded by the config's `heldLabels`), and writes its hold once `quickHoldFits` takes it; on a phone the body gets the ✕ as its `actions` when `closeButton` is true ([the components map](../contract.md#the-components-map)).
|
|
141
142
|
- `QuickFiltersReminder` — on a phone, the reminder that a hold stands while the quick filters are closed: takes `quickFilters` (the same `QuickFiltersConfig`), `onOpen` (a press on its names: open the quick filters, whose open state you hold through `ToolbarQuickFilters`' `open`, or `ReadyToolbar`'s `quickFiltersOpen`) and optionally `hidden` (it steps aside: hand whether rows are selected or the quick filters are open, so it never stands with your selection bar or over the open quick filters), and `holder` (a ref to your list's box: leaving with the focus in it, by its ✕ or by stepping aside as the quick filters open, it hands the focus there, giving a box that takes no focus `tabindex="-1"`, so the focus never falls to the page and a sheet opened from its names hands it back into the box; with none, the focus goes where the browser drops it; it never searches the page for one). Place it once at your list's foot. It is portalled to the body where the selection bar's phone pill stands (the provider's `selectionBar.phone`: its `bottom`, `zIndex` and `className`), a pill (`data-slot="vk-quick-filters-reminder"`) holding the held values' names, each by its words and never its key (`quickHeldNames`), the first two and "+N" for the rest (`quickReminderWords`, `views.panels.quick-more`), a press on them (`data-slot="vk-quick-filters-reminder-open"`, named `views.panels.quick-reminder` with every name once) calling `onOpen`; then ✕ (`data-slot="vk-quick-filters-reminder-clear"`, `views.panels.quick-clear`), letting every hold go. It draws nothing on a computer, while nothing is held, or while `hidden`. An app that wears its own reminder places that one instead, fed by `quickHeldNames`.
|
|
142
143
|
- `SortFieldList` — the fields a rule is picked from: `sorts`, `onPick`, and optionally `own` (a rule whose field it changes), `onDone` (done with no pick) and `form`. It opens your `FieldsBody` (`CONTROLS.FieldsBody` is ViewKit's own), in every holder, handed the options as data, each marked as the grid's header marks its column, a field already sorted, but `own`, `disabled` with why ("Sorted"); a pick of a key it didn't offer, or offered disabled, writes nothing ([the components map](../contract.md#the-components-map)).
|
|
143
144
|
- `ToolbarAdvancedFilters` — the advanced filters' pills, with and/or groups (`data-slot="vk-toolbar-advanced-filter"`): takes the builder's `filterTree`, and optionally `host`. One pill for each advanced filter (each group at the filter's top, or the whole of a top joined by Or), "Advanced filter" with its rules counted (one whose rules are all set aside drawn set aside instead, the button's `aside` with no count, naming why in your `Tooltip`: `views.panels.advanced-filter-set-aside`), its words kept however tight the row, opening the filter editor on its own rules in your `Popover` (`data-slot="vk-toolbar-advanced-filter-panel"`) or in `host`. A pill whose filter empties leaves the row; the others keep their own state. Each is one of the toolbar's panels; in a folding line its place carries `data-open` while it is open, so the line holds still. On a phone it draws nothing.
|
|
144
|
-
- `ToolbarFilters` — each filter on a filter bar, as the kit's draws them (`data-slot="vk-toolbar-filters"`): takes the builder's `filterTree` (with `filterGroups`), and optionally `open` and `onOpenChange` (whether Filter and + list the fields: hold it to open them from ⋯), `held` and `onHeldChange` (the rule held until whole: hold it to count it as the bar folds) and `
|
|
145
|
-
- `foldableFilters` — how many of the bar's filters may fold, for its placement's `filters`: `(tree, held)`, the tree's top-level items less the one a held rule stands in place of; a held rule no longer standing (`held`'s tree changed by a write from elsewhere) counts as gone.
|
|
146
|
-
- `ToolbarFilterAdd` — Filter on a toolbar row's right (`data-slot="vk-toolbar-filter-add-row"`, named `views.panels.filter`), as `ReadyToolbar` stands it by default: takes the builder's `filterTree`, and optionally `onHeldChange` (hand the toolbar's held rule's writer, the one you hand `ToolbarFilters`, so a yes/no it holds stands on the bar), `open` and `onOpenChange`,
|
|
145
|
+
- `ToolbarFilters` — each filter on a filter bar, as the kit's draws them (`data-slot="vk-toolbar-filters"`): takes the builder's `filterTree` (with `filterGroups`), and optionally `open` and `onOpenChange` (whether Filter and + list the fields: hold it to open them from ⋯), `held` and `onHeldChange` (the rule held until whole: hold it to count it as the bar folds), `host`, and `saved` (the saved view's filter: its own top-level items stand in Customize, not on the bar, an edited one standing as edited; every write is still the whole filter's). Every filter at the view's own level, in its order: a filter as four joined parts (`data-slot="vk-toolbar-filter-rule"`, named by its sentence), its field, how it compares in lower case, its value (capped at 240 and cut with "…", saying what it waits for until it is picked) and ⋯ (Convert to advanced filter, Delete filter), each opening its own list; a related record's field drawn as one ("Company › Industry"); an advanced filter as its pill (`ToolbarAdvancedFilters`'); then + (`data-slot="vk-toolbar-filter-add"`, `views.panels.filter-add-one`). Filter, + and a filter's field open your `FieldsBody`, its way and value your `FilterPartBody` ([the components map](../contract.md#the-components-map)); their lists show a column the list can't filter greyed with its reason, in its place, never picked (`filterTree.listed`). A filter whose one value is a key your app hasn't named (a person after a reload) asks that field's `onValuesWanted` once (a related record's field, `farValues.onWanted`), and draws the name once you hand the value in `knownValues` and its name in `knownLabels`. While nothing filters and nothing is held, Filter, an empty place (`data-slot="vk-toolbar-filter"`); handed `emptyPlace={false}`, where Filter stands on the row (`ToolbarFilterAdd`), nothing at all until a filter is set or held. Filter and + open the fields; a pick adds a filter at the end (`addOnBar`, wrapping a top joined by Or into one advanced filter first), a related record's field among them, waiting for its value, or, for a yes/no, the list's own or a related record's, holds it on the bar saying what it waits for, writing nothing until its value is picked; where nothing more can be added they are disabled with why (`barAddRefusal`). With no field a rule may name (every column one the list can't filter: `filterTree.fields` empty), neither Filter nor + stands: a set-aside filter still does. In a folding line its last filters fold into "+N filters" (`data-slot="vk-toolbar-more-filters"`, as its slot's `filtersFolded` says), which names each and opens what a pick opens under itself; a held rule, the filter it stands in place of and a filter with a part open never fold. Each filter and "+N filters"' menu is one of the toolbar's panels. Delete filter and Convert move the focus to what stands after the filter: the next filter, "+N filters", + or Filter, or, where Filter stands on the row's right and nothing is left on the bar, that Filter (`ToolbarFilterAdd`). An app placing it in a `Toolbar` of its own places it with `filters: foldableFilters(…)` and never with `shed` while a filter stands: its parts read the slot's `iconAlone`, and would draw no words. A held rule is compared with the tree as written, so your `filterTree.onChange` must hand the tree back unchanged (the same keys in the same order), or the held rule counts as dropped by a write from elsewhere. On a phone it draws nothing.
|
|
146
|
+
- `foldableFilters` — how many of the bar's filters may fold, for its placement's `filters`: `(tree, held, saved?)`, the tree's top-level items less the one a held rule stands in place of, and less the saved filter's own where `saved` is handed; a held rule no longer standing (`held`'s tree changed by a write from elsewhere) counts as gone.
|
|
147
|
+
- `ToolbarFilterAdd` — Filter on a toolbar row's right (`data-slot="vk-toolbar-filter-add-row"`, named `views.panels.filter`), as `ReadyToolbar` stands it by default: takes the builder's `filterTree`, and optionally `onHeldChange` (hand the toolbar's held rule's writer, the one you hand `ToolbarFilters`, so a yes/no it holds stands on the bar), `open` and `onOpenChange`, `host`, `changed` (lit: the ready toolbar hands it while the filter differs from the saved view), and `opens` (`"fields"`, the default, or `"filters"`: the whole filter editor, your `FilterBody` on every rule of the view, edited as Customize's Filter edits it, in a panel as wide as the editor; the ready toolbar hands `"filters"`). With the fields, it opens them as Filter on the bar does (your `FieldsBody`), and a pick adds a filter at the bar's end and opens nothing else, or holds a yes/no until its value is picked, which `ToolbarFilters` takes in as its own; where nothing more can be added it is disabled with why. It is one of the toolbar's panels. On a phone, or with no fields, it draws nothing.
|
|
147
148
|
- `Pending` — the rule held until whole, as `ToolbarFilters` hands it to `onHeldChange`: its `container`, its `node`, the filter it `replaces`, and what it was held `over`.
|
|
148
149
|
- `FilterEditorHost` — the host of your filter body on a computer (ViewKit's own body is `FilterEditor`, on `viewkitjs/views/controls`): `filterTree`, `at` (the advanced filter's path: a group's, or `[]` for a top joined by Or), and optionally `onDone` (its filter emptied) and `onRemoved` (a delete took a node away: the outermost that went). It opens your `FilterBody` (`CONTROLS.FilterBody` is ViewKit's own), handed the level it stands on as data, its whole level written once it fits the rules, its `onDone` calling the `onDone` you hand ([the components map](../contract.md#the-components-map)). The first edit in a top joined by Or wraps it into one advanced filter. At a top-level relation rule (`at` `[i]`) it edits the relation wrapped in a group of its own; where that would pass 3 levels, it edits the relation in place, the body handed the relation. Every change goes out through `filterTree.onChange` as it is made.
|
|
149
150
|
- `FilterFieldList` — the fields a rule names: `fields`, `onPick(field, far?)`, and optionally `own`, `relations` (false leaves a relation's far fields out), `onDone` (done with no pick) and `form`. It opens your `FieldsBody` (`CONTROLS.FieldsBody` is ViewKit's own), in every holder, handed the list's own fields and, where `relations`, each relation with its `far` fields, each marked as the grid's header marks its column; a pick of a key it didn't offer, or a column the list can't filter, writes nothing ([the components map](../contract.md#the-components-map)).
|
|
@@ -153,12 +154,13 @@ Options, Sort and Filter each open their panel from their own button, and each t
|
|
|
153
154
|
- `useToolbarPanelState` — a panel part's state for your app to hold (`ToolbarPanelState`): `open`, `onOpenChange`, `page` and `onPageChange`; closing forgets the page.
|
|
154
155
|
- `ToolbarPanelState` — what `useToolbarPanelState` returns.
|
|
155
156
|
- `FilterPanelContent` — the Filter panel standing alone, for a host of your own: the filter list at its root (titled `views.panels.filter`, no back arrow) and the pages it opens, with `filters`, `timeScopeConfig`, `dateRangeConfigs`, `page`, `onPageChange`, `onClose` and `fill`.
|
|
156
|
-
- `ToolbarSave` — Clear and Save, at the end of a filter bar while the list differs (`data-slot="vk-toolbar-save"`): takes `view` (a `CollectionViewState`: Clear is its `onReset`, Save its `onPublish`, shown only where `canPublish`, both waiting while `pending`, nothing while `changes` is 0), or with no shared view `onClear`, Clear alone taking the list back to its default; nothing when neither has anything to do. Clear has no ground and Save wears the field's look, each your `Button`.
|
|
157
|
-
- `ReadyToolbar` — the toolbar for an app that doesn't arrange its own (`ReadyToolbarProps`): the builder's input (`settings`, `layer`, `columns`, `onChange`, `onLayerChange` and the rest of `SettingsPanelsInput`), and optionally `views`, `viewsLayout`, `onAdd` or `addItems` and `addLabel`, `view`, `toggles`, `fieldEditor`, `searchPlaceholder`, `searching` (handed to its search), `hosts` (`{ options, sort, filter, quick }`), `quickFilters` (a `QuickFiltersConfig`: handed, the quick filters' button stands on the row's end before the search, in the row arrangement before Options, folding into ⋯ as the row narrows; its counts follow the toolbar's Show counts unless the config carries its own `showCounts`), `quickFiltersOpen` with `onQuickFiltersOpenChange` (the quick filters' panel open, held by you, so a `QuickFiltersReminder` at your list's foot can open it; absent, the toolbar holds it), `phone`, `narrow`, `severalSorts` (true by default: the sort holds up to 3 rules, the row's Sort opening the sort editor on them, or in the old form the sort pill on the bar; `false` keeps Sort's one rule, which opens its own list whether or not a sort stands), `addAfter` (true by default: the + after the sort pill; `false` draws none, and the pill's editor, or your `SortBody`, has Add sort at its foot, as `ToolbarSortPill`'s), `filterGroups` (true by default: and/or groups, each filter on the filter bar on a computer, in the row arrangement each advanced filter's pill after Filter and Convert to advanced filter on a filter's page, and on a phone Filter opening the filter editor on every rule; `false` keeps Filter, counting what is applied, in either arrangement), `arrangement` (`"kit"` by default, or `"row"`), `sortFilter` (`"right"` by default, or `"bar"`), `bar` (`"added"` by default, or `"always"`: with Sort and Filter on the row's right, the bar then always shows, its empty Sort and Filter included), `viewName`, `onRenameView`, `onCopyLink`, `onExport` and `exportCount` (handed on to Customize, as `ToolbarOptions` takes them), `menus` (`ToolbarMenus`: a view's menu, New's and ⋯ as data), `toolbarParts` (`ToolbarParts`: where each part stands, every form's parts handed as data and drawn as you hand them back, [`/list`'s Parts as data](./list.md#parts-as-data)) and `className`. It calls the builder and draws its parts in the kit's arrangement (`Toolbar`'s `fold`). By default, on a computer, one row at rest: the views with Customize beside them, then on its right Sort and Filter with their words, the quick filters' button and the search, each its icon alone, and New. Sort holds the sort (`ToolbarSortPill`'s `row`): lit while
|
|
157
|
+
- `ToolbarSave` — Clear and Save, at the end of a filter bar while the list differs (`data-slot="vk-toolbar-save"`): takes `view` (a `CollectionViewState`: Clear is its `onReset`, Save its `onPublish`, shown only where `canPublish`, both waiting while `pending`, nothing while `changes` is 0 unless `layered`, the reader's own layer holding something, when Clear stands alone to empty it), or with no shared view `onClear`, Clear alone taking the list back to its default; nothing when neither has anything to do. Clear has no ground and Save wears the field's look, each your `Button`.
|
|
158
|
+
- `ReadyToolbar` — the toolbar for an app that doesn't arrange its own (`ReadyToolbarProps`): the builder's input (`settings`, `layer`, `columns`, `onChange`, `onLayerChange` and the rest of `SettingsPanelsInput`), and optionally `views`, `viewsLayout`, `onAdd` or `addItems` and `addLabel`, `view`, `toggles`, `fieldEditor`, `searchPlaceholder`, `searching` (handed to its search), `hosts` (`{ options, sort, filter, quick }`), `customizeIn` (`"popover"` by default; `"pane"`: on a computer Customize opens in your map's `Pane`, `CONTROLS.Pane`, at the right edge of `paneBox`, under the toolbar and as tall as the list, the list in use beside it; on a phone its Sheet either way; a map with no `Pane`, or your own `hosts.options`, keeps theirs) and `paneBox` (the list's box the Pane stands in: positioned, holding the grid under the toolbar, never scrolling itself; null until it is on the page; not handed, the popover), `quickFilters` (a `QuickFiltersConfig`: handed, the quick filters' button stands on the row's end before the search, in the row arrangement before Options, folding into ⋯ as the row narrows; its counts follow the toolbar's Show counts unless the config carries its own `showCounts`), `quickFiltersOpen` with `onQuickFiltersOpenChange` (the quick filters' panel open, held by you, so a `QuickFiltersReminder` at your list's foot can open it; absent, the toolbar holds it), `phone`, `narrow`, `severalSorts` (true by default: the sort holds up to 3 rules, the row's Sort opening the sort editor on them, or in the old form the sort pill on the bar; `false` keeps Sort's one rule, which opens its own list whether or not a sort stands), `addAfter` (true by default: the + after the sort pill; `false` draws none, and the pill's editor, or your `SortBody`, has Add sort at its foot, as `ToolbarSortPill`'s), `filterGroups` (true by default: and/or groups, each filter on the filter bar on a computer, in the row arrangement each advanced filter's pill after Filter and Convert to advanced filter on a filter's page, and on a phone Filter opening the filter editor on every rule; `false` keeps Filter, counting what is applied, in either arrangement), `arrangement` (`"kit"` by default, or `"row"`), `sortFilter` (`"right"` by default, or `"bar"`), `bar` (`"added"` by default, or `"always"`: with Sort and Filter on the row's right, the bar then always shows, its empty Sort and Filter included), `viewName`, `onRenameView`, `onCopyLink`, `onExport` and `exportCount` (handed on to Customize, as `ToolbarOptions` takes them), `menus` (`ToolbarMenus`: a view's menu, New's and ⋯ as data), `toolbarParts` (`ToolbarParts`: where each part stands, every form's parts handed as data and drawn as you hand them back, [`/list`'s Parts as data](./list.md#parts-as-data)), `overflow` (`ToolbarOverflow`: ⋯ as you draw it where the parts don't fit) and `className`. It calls the builder and draws its parts in the kit's arrangement (`Toolbar`'s `fold`). By default, on a computer, one row at rest: the views with Customize beside them, then on its right Sort and Filter with their words, the quick filters' button and the search, each its icon alone, and New. The toolbar shows only what differs from the saved view (the open view's `saved`, or with no view the list's defaults; a view handed without `saved` keeps the older lighting, lit while a sort stands, the bar for every filter). Sort holds the sort (`ToolbarSortPill`'s `row`): lit while it differs, counted from two, it opens the sort editor to change or remove the rules, Add sort at its foot; with none, the fields. Filter (`ToolbarFilterAdd`, `opens="filters"`), lit while the filter differs, opens the view's filters, editable, with Add filter under them, as Sort opens its rules (with no filter, the editor's fields); the bar's + adds one filter to the bar. Under the row the filter bar, a step smaller, holds what changed: it comes while the sort or the filter differs, a filter is held (or one of its parts is open), or a second axis of views stands there, holding the changed sort ("Sorted by", a list with one sort's included: `ToolbarSort`'s `bar`), the filters that aren't the saved view's own (an edited one as edited; each as below, + after the last, no empty Filter) and Clear and Save at its end. Something taken away (a saved rule removed) brings Clear and Save alone. Customize's foot holds Reset and Save too while anything differs, the bar standing or not (on a shared view Customize also carries its dot), as on a phone. Each of the row's Sort and Filter is a panel of its own, apart from the bar's, so a press opens one list. `sortFilter: "bar"` with `bar: "always"` draws the kit arrangement's old form: the row, the views with Customize beside them and the search and New at its end, and under it the filter bar, always shown, a step smaller: the sort pill first, a separator, the filters (`ToolbarFilters`: each filter as its four joined parts, each advanced filter's pill, + after the last; while there is none, Filter, an empty place; the rule held until whole is held by the toolbar, so the bar counts it as it folds; with `filterGroups` false, Filter as before, with what is applied counted), and at its end Clear and Save (`ToolbarSave`) while the list differs: on a shared view (`view`) Clear takes it back and Save, where `canPublish`, keeps it for everyone; with no shared view, Clear alone takes the list back to its default (nothing filtered, the default sort, no group: so a list that starts grouped or filtered shows Clear at once); Customize's foot then draws neither. A row with no room folds as the kit's does (words to icons, the view tabs into "+N", the bar's last filters into "+N filters", then into ⋯: by default Customize and the row's Sort and Filter, whatever is set; in the old form Customize, and the sort and Filter while no filter stands), with no narrow form. On a phone one line in either form (the views, the sort, Filter, the quick filters' button when handed, Customize, then the search, which opens across the line), Clear and Save in Customize's foot (`views.panels.view-clear`, `views.panels.view-save`; with no shared view, Clear alone), and New a round + at the list's foot, lifted by `--vk-toolbar-foot`. `arrangement: "row"` draws the order of 12 Nov instead: the views on the left; search, sort, filter, options and new on the right, the narrow form under 700px, and Reset and Save for everyone in Customize's foot. Every change comes back as a `ListSettingsChange` or a layer patch: its search writes the settings' search, its ✕s clear in one change (`settingsCleared`), and the active view's menu gains "Edit view…" (`withEditView`), which opens Customize. It is a `ListRoot` around `ListToolbar` ([`/list`](./list.md)): its panels' state is held in that root, above its frame, so a change of form keeps a panel open on its page, in a sheet once the form is the phone's. Show counts is the view's: read from `settings.showCounts` for the views row and the quick filters, absent meaning on, it joins Customize's toggles where the views carry counts and is written back through `onChange`. Group steps aside on a board (`groupShown`).
|
|
158
159
|
- `ReadyToolbarProps` — what `ReadyToolbar` takes.
|
|
159
160
|
- `ToolbarParts` — `ReadyToolbar`'s and `ListToolbar`'s `toolbarParts`: `(parts: ToolbarPartPlace[], ctx: ToolbarPartsContext) => ToolbarPartPlace[]`, handed the form's parts in the order they are placed and handing back the parts drawn, in their order. The rules and an example are [`/list`'s Parts as data](./list.md#parts-as-data).
|
|
160
|
-
- `ToolbarPartPlace` — a part's place: `{ key, line, side, words, node?, className?, button? }`: its public key, its line (`"row"`, `"bar"`, or `"foot"`, New's place at a kit phone list's foot), its side (`"start"` or `"end"`), its words (`"both"` or `"icon"`), `node` for a part of your own under a key of your own, and its look: `className`, put on every toolbar button the part draws, and `button`, your own button drawn for each of them in place of your `ToolbarButton`, handed the same props (`ref` included: put it on your button). [`/list`'s Parts as data](./list.md#parts-as-data) lists each place's buttons and what stays fixed.
|
|
161
|
+
- `ToolbarPartPlace` — a part's place: `{ key, line, side, words, node?, className?, button?, panel? }`: its public key, its line (`"row"`, `"bar"`, or `"foot"`, New's place at a kit phone list's foot), its side (`"start"` or `"end"`), its words (`"both"` or `"icon"`), `node` for a part of your own under a key of your own, and its look: `className`, put on every toolbar button the part draws, and `button`, your own button drawn for each of them in place of your `ToolbarButton`, handed the same props (`ref` included: put it on your button); and `panel` (`ToolbarPanelPlace`), where what it opens hangs at its button. [`/list`'s Parts as data](./list.md#parts-as-data) lists each place's buttons and what stays fixed.
|
|
161
162
|
- `ToolbarPartsContext` — which form the parts are for: `{ arrangement, phone }` (`"kit"` or `"row"`, and whether it is a phone's).
|
|
162
163
|
- `ToolbarMore` — ⋯ as data, `Toolbar`'s `more` and `ToolbarMenus`' `more`: `(items, { line }) => items`.
|
|
164
|
+
- `ToolbarOverflow` — ⋯ as you draw it, `Toolbar`'s, `ReadyToolbar`'s and `ListToolbar`'s `overflow`, as a `toolbarParts` place's look is handed: `icon` (your glyph over your `icons.more`), `className` (put on it) and `button` (your own button in place of your `ToolbarButton`, handed the very props it would get, `part: "more"` and `ref` included: put `ref` on your button, so ⋯'s menu hangs at it). Absent, ⋯ is your `ToolbarButton` with `icons.more`, as before.
|
|
163
165
|
- `ToolbarMenus` — the toolbar's menus as data, `ReadyToolbar`'s and `ListToolbar`'s `menus`: `view(items, { view })` (a view's menu: an option's own rows, Edit view… among them, and the menu a views list draws from the axis's verbs), `add(items)` (New's items: `addItems`, or with `onAdd` alone one row keyed `new`; New opens what it returns as a menu) and `more(items, { line })` (⋯'s rows, each keyed by its part, on the row's line or the filter bar's). The helpers, the keys and the rules are [`/list`'s Menus as data](./list.md#menus-as-data).
|
|
164
166
|
- `useListSettingsState` — a list's settings and layer held in memory, for an app that keeps none yet (a proof page, a test): `{ settings, layer? }` in, `{ settings, layer, onChange, onLayerChange }` out, ready to spread into `ReadyToolbar` beside its `columns`, or into a `ListRoot` ([`/list`](./list.md)): it is the root's memory mode. Each change is applied to the latest settings (`applySettingsChange`), each patch merged into the latest layer.
|
|
@@ -11,8 +11,8 @@ Import from `viewkitjs/views/panels` for what a list's panels read and say: the
|
|
|
11
11
|
- `GroupOrderOption` — one way a dimension's groups are ordered, with the `defaultDir` it opens in.
|
|
12
12
|
- `GroupListEntry` — one group as the Group panel lists it: its `key`, `label`, whether it is `empty` or `hidden`, and its `count` where the list counts it.
|
|
13
13
|
- `groupOrderFor` — the order a dimension opens in under a mode: that choice's own direction, else the mode's.
|
|
14
|
-
- `ToggleConfig` — a boolean the panel flips in place: `key`, `label`, `value`, `onChange`, an `icon`, `desktopOnly
|
|
15
|
-
- `LayoutConfig` — the layouts a list can draw and the active one, with the layouts it refuses and why, its toggles, columns, per-view choices, density, the
|
|
14
|
+
- `ToggleConfig` — a boolean the panel flips in place: `key`, `label`, `value`, `onChange`, an `icon`, `desktopOnly` (absent from Customize on a phone), and the `section` it sits under; its `reset` is deprecated and drawn nowhere.
|
|
15
|
+
- `LayoutConfig` — the layouts a list can draw and the active one, with the layouts it refuses and why, its toggles, columns, per-view choices, density, and the phone's own layout (`mobileValue`, `onMobileChange`, `mobileOptions`, `mobileRefused`), which Customize's Layout picker names and writes on a phone; `personal` is deprecated and drawn nowhere.
|
|
16
16
|
- `LayoutColumnsConfig` — the Columns drill-in: the views package's columns, with each column's settings and the card layout's line breaks (`newLine`).
|
|
17
17
|
- `LayoutColumnItem` — one column, with the `settings` its drill-in shows.
|
|
18
18
|
- `LayoutColumnChoice` — a pick-one setting on a column (a currency, decimals).
|
|
@@ -24,7 +24,7 @@ Import from `viewkitjs/views/panels` for what a list's panels read and say: the
|
|
|
24
24
|
- `DateRangeValue` — a range's two ends, each a `Date` or `null`.
|
|
25
25
|
- `ActivePanel` — which drill-in is open: a filter (and a Where field inside a relation's), group, sort, time scope, a date range, a toggle, layout, the Filter list, Columns, one column, or Group's by, sort and date-by pages.
|
|
26
26
|
- `ViewOptionInputs` — everything a Customize panel is handed: filters, sort, group, time scope, date ranges, toggles and layout; with and/or groups, the builder's `filterTree` too.
|
|
27
|
-
- `CollectionViewState` — the view on screen, shared or the person's own (`own`): how far what this person sees drifted from it (`changes`, `stale`), whether they may publish, a write in flight,
|
|
27
|
+
- `CollectionViewState` — the view on screen, shared or the person's own (`own`): how far what this person sees drifted from it (`changes`, `stale`), whether they may publish, a write in flight, the two verbs that settle the drift, and `saved`, the view's settings as saved, what each Customize page's own Reset goes back to (absent, its pages carry none).
|
|
28
28
|
- `CollectionExportCsv` — a list's export, when it offers one: `count`, the rows it would take, which the Export CSV row shows, and `run`, which builds and downloads the file and says how it went.
|
|
29
29
|
- `isSortActive` — whether a sort differs from its default.
|
|
30
30
|
- `isGroupActive` — whether a list is grouped.
|
|
@@ -36,7 +36,7 @@ Import from `viewkitjs/views/panels` for what a list's panels read and say: the
|
|
|
36
36
|
## Which sections exist
|
|
37
37
|
|
|
38
38
|
- `getViewOptionAvailability` — whether a Customize panel has anything to show on the desktop and on the phone.
|
|
39
|
-
- `resolvePersonalSection` — the "For you" section
|
|
39
|
+
- `resolvePersonalSection` — deprecated, read by nothing: the "For you" section a layout's `personal` would have drawn, or `null`.
|
|
40
40
|
|
|
41
41
|
## The Group panel's orders
|
|
42
42
|
|
|
@@ -7,12 +7,12 @@ Import from `viewkitjs/views/react` in a client component: the door opens with t
|
|
|
7
7
|
Guide: [the provider](../guides/the-provider.md).
|
|
8
8
|
|
|
9
9
|
- `ViewsProvider` — the provider every view reads: mount it once at your app's client root, above every view: `<ViewsProvider components={CONTROLS}>` at the least, and whatever of its icons, ports and conventions your app draws its own. It lays your atoms over the defaults (handed `CONTROLS` as it stands, over `CONTROL_ATOMS`, which it carries), hands your `Menu` its items with every row under a disabled group already disabled, and fills in the browser's own confirm where your ports carry no `confirm`. It hands its views one context value per distinct set of inputs, so pass module-level objects: a new one on each render re-renders every view.
|
|
10
|
-
- `ViewsProviderProps` — what the provider takes. Its optional `desktopQuery` is the media query that means a desktop, so an editor opens as a popover there and as a sheet elsewhere, the default controls take their phone form below it (`PhoneLine`), as do the toolbar's panels and the views picker outside a `Toolbar`, and the grid's own chrome takes its desktop form there (the grid's frame carries `data-desktop`); hand in the one your own shell switches on. Default `DEFAULT_DESKTOP_QUERY`. Its optional `sheetActions` (`ViewsSheetActionsPlace`, default `bar`) says where an editor's ✕ and ✓, and a toolbar panel's ✕, stand in that sheet. Its optional `escape` (`ViewsEscapeRules`) says what Escape does in an editor of each field type on a desktop, `"keep"` or `"cancel"`, a type left out cancelling. Its optional `selectionBar` (`ViewsSelectionBarSettings`) says where the selection bar sits. Its optional `oneValue` (`ViewsOneValueEditors`) says whether a single email or domain opens the text box in its cell (the default) or the value list holding one value, in the grid and a field row alike. Its optional `datePicks` (`ViewsDatePicks`) names the quick days the date editors offer, in order; absent, today, tomorrow and next Monday. Its optional `now` (a `Date`) is the moment every date counts from; absent, the provider reads the clock after mount, then once a minute and when the tab comes back into view, never while rendering, and a date that needs it draws its full form until the first read. Its optional `panelControls` (`true`, or the names among `Button`, `Select`, `Menu`, `Popover` and `
|
|
10
|
+
- `ViewsProviderProps` — what the provider takes. Its optional `desktopQuery` is the media query that means a desktop, so an editor opens as a popover there and as a sheet elsewhere, the default controls take their phone form below it (`PhoneLine`), as do the toolbar's panels and the views picker outside a `Toolbar`, and the grid's own chrome takes its desktop form there (the grid's frame carries `data-desktop`); hand in the one your own shell switches on. Default `DEFAULT_DESKTOP_QUERY`. Its optional `sheetActions` (`ViewsSheetActionsPlace`, default `bar`) says where an editor's ✕ and ✓, and a toolbar panel's ✕, stand in that sheet. Its optional `escape` (`ViewsEscapeRules`) says what Escape does in an editor of each field type on a desktop, `"keep"` or `"cancel"`, a type left out cancelling. Its optional `selectionBar` (`ViewsSelectionBarSettings`) says where the selection bar sits. Its optional `oneValue` (`ViewsOneValueEditors`) says whether a single email or domain opens the text box in its cell (the default) or the value list holding one value, in the grid and a field row alike. Its optional `datePicks` (`ViewsDatePicks`) names the quick days the date editors offer, in order; absent, today, tomorrow and next Monday. Its optional `now` (a `Date`) is the moment every date counts from; absent, the provider reads the clock after mount, then once a minute and when the tab comes back into view, never while rendering, and a date that needs it draws its full form until the first read. Its optional `panelControls` (`true`, or the names among `Button`, `Select`, `Menu`, `Popover`, `Input` and `Calendar`, `PanelControlName`) says which of your own controls ViewKit's sort and filter panels (VK-1013) and its text, number and date editors (VK-1021; `Calendar` is the date editor's month) draw inside them, each handed the map's props and the part's `data-slot` and `data-key`; a control of `CONTROLS`' stays ViewKit's whatever it says, and without it they draw ViewKit's own, as before.
|
|
11
11
|
- `EditEscape` — `"cancel" | "keep"`: what Escape does in an edit session (`viewkitjs/views/editors/session` hands it on too).
|
|
12
12
|
- `ViewsEscapeRules` — the provider's `escape`: an `EditEscape` per field type, and for `email`, `phone`, `url` and `domain` either one `EditEscape`, which covers both of their editors, or an `EditEscapeByEditor`.
|
|
13
13
|
- `EditEscapeByEditor` — `{ box?: EditEscape; list?: EditEscape }`: what Escape does in an email, phone, link or domain field by the editor it opens, `box` its text box (a single value) and `list` the value list (several values, or a single one `oneValue` opens as a list of one). One left out throws the edit away.
|
|
14
14
|
- `ViewsOneValueEditors` — `Partial<Record<"email" | "domain", "text" | "list">>`, the provider's `oneValue`.
|
|
15
|
-
- `PANEL_CONTROL_NAMES` — `Button`, `Select`, `Menu`, `Popover` and `
|
|
15
|
+
- `PANEL_CONTROL_NAMES` — `Button`, `Select`, `Menu`, `Popover`, `Input`, `Calendar` and `Avatar` (your `atoms.Avatar`, VK-1044): the controls the provider's `panelControls` can name.
|
|
16
16
|
- `PanelControlName` — one member of `PANEL_CONTROL_NAMES`.
|
|
17
17
|
- `flatSelectItems` — a Select's rows (`ViewsSelectItem[]`) with every `level` flattened, each row one level in standing in its parent's place, named by its path ("Company › Region"), its value as handed: for a `Select` of yours that draws no levels.
|
|
18
18
|
- `DEFAULT_DESKTOP_QUERY` — `(min-width: 1024px)`: the width a desktop starts at when the provider is handed no `desktopQuery`, the default controls' phone line too (`PhoneLine`, in controls.md). Where the screen can't be asked (a server render, a browser with no `matchMedia`), it is a desktop.
|
|
@@ -28,7 +28,7 @@ Guide: [the provider](../guides/the-provider.md).
|
|
|
28
28
|
|
|
29
29
|
The primitives your app hands in, modelled on Base UI's shapes: a controlled `open` with `onOpenChange(open, details)`, an `anchor` rather than a trigger child on the popover and the menu, and no `asChild`. An adapter on Base UI wraps its copies thinly; one on Radix absorbs the difference. The package ships none of them and depends on neither library. The [contract](../contract.md) says what each slot promises and how to write an adapter.
|
|
30
30
|
|
|
31
|
-
- `ViewsComponents` — the map itself, one key per name of the contract's components: `Button`, `Popover`, `Tooltip`, `Checkbox`, `Menu`, `Collapse`, `Sheet`, `AppIcon`, `Markdown`, `TextBody` (a whole body for a text typed as one string: the text editors open it; `CONTROLS.TextBody` is ViewKit's), `NumberBody` (a whole body for a number, money or a percent: the number editors open it, a duration excepted; `CONTROLS.NumberBody` is ViewKit's), `Picker` (a whole pick list: the select, several-values and relation editors open it; `CONTROLS.Picker` is ViewKit's), `LinksBody` (a whole links body: the set editor of a relation whose field declares `links` opens it, handed each link's roles, the lead and the field's roles; `CONTROLS.LinksBody` is ViewKit's), `DateBody` (a whole date body: the date editors open it; `CONTROLS.DateBody` is ViewKit's), `PartsBody` (a whole body for a name, a place or a range: the name, place and range editors open it; `CONTROLS.PartsBody` is ViewKit's), `ValuesBody` (a whole body for several emails, phones, links or domains: the value list editors open it; `CONTROLS.ValuesBody` is ViewKit's), and the toolbar panels' bodies: `SortBody` (the sort editor's whole body: the sort pill opens it on a computer and in the phone's Sheet; `CONTROLS.SortBody` is ViewKit's), `FilterBody` (the filter editor's whole body: an advanced filter's pill opens it on a computer and Filter in the phone's Sheet; `CONTROLS.FilterBody` is ViewKit's), `FilterPartBody` (a filter rule's way and value: a filter on the bar opens it; `CONTROLS.FilterPartBody` is ViewKit's), `FieldsBody` (the field list's whole body: every sort and filter field list opens it; `CONTROLS.FieldsBody` is ViewKit's), `QuickFiltersBody` (the quick filters' whole body: the quick filters' button opens it on a computer and in the phone's Sheet; `CONTROLS.QuickFiltersBody` is ViewKit's), `ViewsListBody` (the views list's whole body: the view picker's chip opens it on a computer and in the phone's Sheet; `CONTROLS.ViewsListBody` is ViewKit's) and `CustomizeBody` (Customize's whole body: Options and everything else that draws Customize open it on a computer and in the phone's Sheet; `CONTROLS.CustomizeBody` is ViewKit's). `AppIcon` is your own icon component, taking `name` and `className`, for the glyphs a host declares (a row's icon, a binding's icon); it draws on the first paint, because rows are measured as they mount, so map its names from a static record. `Markdown` is your markdown renderer, handed the stored text whole as `source`; the package parses no markdown itself. Eight keys are optional: `Input` (leave it out and the editors draw a plain `<input>`), `Command` (deprecated: the command list's parts, read by nothing), `Calendar` (the filter panel's month; reached without one, it throws an error naming it; `CONTROLS.Calendar` is ViewKit's), `RowsWait` (wraps a grid's rows; handed one, a grid that already shows rows keeps them, inert, as its children while new ones load, its column names and footer outside; left out, the grid draws Loading in place of its body), `GroupBody` (deprecated: read by nothing; a `CustomizeBody` holds its own group editor), `SearchField` (the toolbar's search box; handed one, the search opens it in place of its own field on a computer and on a phone), `PortsHost` (what draws the `toast` and `confirm` ports an app leaves out)
|
|
31
|
+
- `ViewsComponents` — the map itself, one key per name of the contract's components: `Button`, `Popover`, `Tooltip`, `Checkbox`, `Menu`, `Collapse`, `Sheet`, `AppIcon`, `Markdown`, `TextBody` (a whole body for a text typed as one string: the text editors open it; `CONTROLS.TextBody` is ViewKit's), `NumberBody` (a whole body for a number, money or a percent: the number editors open it, a duration excepted; `CONTROLS.NumberBody` is ViewKit's), `Picker` (a whole pick list: the select, several-values and relation editors open it; `CONTROLS.Picker` is ViewKit's), `LinksBody` (a whole links body: the set editor of a relation whose field declares `links` opens it, handed each link's roles, the lead and the field's roles; `CONTROLS.LinksBody` is ViewKit's), `DateBody` (a whole date body: the date editors open it; `CONTROLS.DateBody` is ViewKit's), `PartsBody` (a whole body for a name, a place or a range: the name, place and range editors open it; `CONTROLS.PartsBody` is ViewKit's), `ValuesBody` (a whole body for several emails, phones, links or domains: the value list editors open it; `CONTROLS.ValuesBody` is ViewKit's), and the toolbar panels' bodies: `SortBody` (the sort editor's whole body: the sort pill opens it on a computer and in the phone's Sheet; `CONTROLS.SortBody` is ViewKit's), `FilterBody` (the filter editor's whole body: an advanced filter's pill opens it on a computer and Filter in the phone's Sheet; `CONTROLS.FilterBody` is ViewKit's), `FilterPartBody` (a filter rule's way and value: a filter on the bar opens it; `CONTROLS.FilterPartBody` is ViewKit's), `FieldsBody` (the field list's whole body: every sort and filter field list opens it; `CONTROLS.FieldsBody` is ViewKit's), `QuickFiltersBody` (the quick filters' whole body: the quick filters' button opens it on a computer and in the phone's Sheet; `CONTROLS.QuickFiltersBody` is ViewKit's), `ViewsListBody` (the views list's whole body: the view picker's chip opens it on a computer and in the phone's Sheet; `CONTROLS.ViewsListBody` is ViewKit's) and `CustomizeBody` (Customize's whole body: Options and everything else that draws Customize open it on a computer and in the phone's Sheet; `CONTROLS.CustomizeBody` is ViewKit's). `AppIcon` is your own icon component, taking `name` and `className`, for the glyphs a host declares (a row's icon, a binding's icon); it draws on the first paint, because rows are measured as they mount, so map its names from a static record. `Markdown` is your markdown renderer, handed the stored text whole as `source`; the package parses no markdown itself. Eight keys are optional: `Input` (leave it out and the editors draw a plain `<input>`), `Command` (deprecated: the command list's parts, read by nothing), `Calendar` (the filter panel's month; reached without one, it throws an error naming it; `CONTROLS.Calendar` is ViewKit's), `RowsWait` (wraps a grid's rows; handed one, a grid that already shows rows keeps them, inert, as its children while new ones load, its column names and footer outside; left out, the grid draws Loading in place of its body), `GroupBody` (deprecated: read by nothing; a `CustomizeBody` holds its own group editor), `SearchField` (the toolbar's search box; handed one, the search opens it in place of its own field on a computer and on a phone), `PortsHost` (what draws the `toast` and `confirm` ports an app leaves out), `SelectionBar` (the selection bar; handed one, ViewKit draws it in its own place) and `Pane` (a toolbar panel at the right edge of the list's box: a toolbar with `customizeIn: "pane"` opens Customize in it on a computer; left out, the `Popover`; `CONTROLS.Pane` is ViewKit's).
|
|
32
32
|
- `ViewsResolvedComponents` — the map as `useViews()` hands it on: yours, with `Input` always there, your own or the plain one, and `Calendar` always there, yours or a stand-in that throws an error naming the slot when it is reached.
|
|
33
33
|
- `ViewsButtonProps` — a button: its `children`, `onClick`, `disabled`, a `variant` (`default`, `secondary`, `ghost`, `outline`, `destructive`; `secondary` only for the views picker's chip), a `size` (`default`, `sm`, `icon`), its `type`, a class, `aria-label` and `title`; and a `ref`, `tabIndex`, `aria-haspopup`, `aria-expanded`, `data-slot` and `data-open`, which the grid hands its own buttons: forward each to your element; and `aria-disabled`, which a field row's edit target is handed while its write is pending; and `aria-pressed`, `role`, `aria-selected`, `data-state` and `data-vs-row`, which the panels' own buttons are handed (the new-line mark, a view's row in the picker, the views row's chips and a view's ⋯, Export); and `data-key`, which one of a part that repeats, beside its `data-slot`, inside the sort and filter panels under `panelControls`. There a ViewKit part may hand it more props than these (a tooltip's handlers, a `data-*` the panel finds it by again): forward the rest to your element.
|
|
34
34
|
- `ViewsPopoverProps` — a popover opened at an `anchor`, controlled by `open` and `onOpenChange`, placed by `side`, `align`, `sideOffset` and `alignOffset`; its `label`, where ViewKit names it (a panel's popover under `panelControls`), is its name to a screen reader, your popup's `aria-label`.
|
|
@@ -37,7 +37,7 @@ The primitives your app hands in, modelled on Base UI's shapes: a controlled `op
|
|
|
37
37
|
- Look: `chrome` is `panel` (your card popover, the default) or `menu` (your menu panel's surface, for a popover that holds a list: no inset, no card width). `onPanelClick` takes a click inside the popup, `panelData` sets `data-*` attributes on it, and `style` carries what a class cannot say, such as a width that follows a cell.
|
|
38
38
|
- `ViewsPortsHostProps` — what the components map's `PortsHost` is told: `toast` and `confirm` (which ports the app left out) and `onReady` (hand it the ports once they stand).
|
|
39
39
|
- `ViewsSelectionBarProps` — what the components map's `SelectionBar` is handed: `SelectionBar`'s own props, at every count.
|
|
40
|
-
- `ViewsTooltipProps` — a tooltip around the element it wraps (`children`), showing `content`, with `side`, `align`, `delayMs` and a class. Your app mounts one tooltip provider above the views; a tooltip never mounts its own.
|
|
40
|
+
- `ViewsTooltipProps` — a tooltip around the element it wraps (`children`), showing `content`, with `side`, `align`, `delayMs` and a class; `reason`, handed inside ViewKit's panels under `panelControls` (VK-1015), says its content is why what it names can't be used, a longer line to wrap. Your app mounts one tooltip provider above the views; a tooltip never mounts its own.
|
|
41
41
|
- `ViewsCheckboxProps` — a checkbox: `checked`, and `indeterminate` for a box ticked partly, whose press hands `true` while `checked` is false. `onCheckedChange` hands the new value and, where your library reports it, `{ event }`, the press that changed it (a list reads its shift key for a range). `partialTone` colours the partial mark, `muted` by default or `brand` for a select-all with a live selection; with `disabled`, `readOnly` (shown as it is and not pressable: a yes/no the grid or a field row can't write), a class, `tabIndex` and `aria-label`.
|
|
42
42
|
- `ViewsMenuProps` — a menu opened at an `anchor`, with no trigger child (a group opens beside it only where it asks to and your menu can), controlled by `open` and `onOpenChange`, drawing its `items`, placed by `side` and `align`, and named by `label`, its accessible name, which every menu the package opens hands; `data-slot`, its public name where ViewKit names it (a view's menu, `vk-view-menu`, VK-988), for your menu to draw on its popup. On Base UI it is the menu's root, positioner and popup, the anchor handed to the positioner.
|
|
43
43
|
- `ViewsMenuItem` — one row of a menu, as data your `Menu` draws: its `key`, `label` (always words), `icon`, `onSelect`, `disabled` with an optional `disabledReason` (why, for you to show), and `destructive`, a `separatorBefore`, a `shortcut` hint drawn at its end and never bound, and an `href` that makes it a link (with `onSelect` still firing). A `checked` row is checkable and closes the menu like any row, unless it carries `keepOpen`. A row with `children` is a group: its rows drawn in place under its label, unless it carries `beside` (open them one level in), its own `onSelect`, `href` and `checked` ignored; a disabled group's rows reach your `Menu` already `disabled`, with the group's reason where they give none. Any row may carry `detail`, its current value in words, for its end. A plain row may carry `render`, which draws its inside in place of its icon, words, keys and count (`label` still its name; called while the menu draws, so it may call no hooks). All three are hints: a menu that draws none of them keeps every group in place and every row closing. A row's `slot`, where ViewKit names it (a panel's menu under `panelControls`: `vk-sort-rule-action`), is its public name, `key` saying which: draw them on your row as `data-slot` and `data-key`.
|
|
@@ -45,7 +45,7 @@ The primitives your app hands in, modelled on Base UI's shapes: a controlled `op
|
|
|
45
45
|
- `ViewsPickerProps` — a whole pick list your app draws, its search, rows, empty row and create row: its `label` (the field's name), `items`, `multiple`, `value` (one value or `null`; several, a list), `onValueChange` (the pick, `null` for the empty row, or the whole new list on every change; nothing is saved until the editor closes), `onDone` (a pick of one is made), `empty` (the empty row's words; absent, a value of one can't be emptied), `search` (its words before anything is typed), `onCreate` (handed what was typed, returns the value it makes, which you then pick or add), `typed` (what was typed on what opened it: on a computer, light its first match, so Enter picks it), `autoFocus`, `keyed` (opened by a key: on a computer, light the held row as it opens and let ↓ go on from it to the next), `fromHeld` (opened by a press, before a row is lit: ↓ and ↑ go on from the held row, to the next or the one before, nothing drawn lit until then), `form`, `computer` or `phone` (on a phone, draw no ✕, ✓ or Cancel of your own and hand every change as it is made), and for a relation `onSearch` (the editor filters or fetches: hand it every typed query and draw `items` as handed), `doing` (`searching` or `failed`; `searching` from the keystroke until the typed query answers, its `items` meanwhile the held records that match it alone), `onRetry`, `onMore`, `actions` (`ViewsPickerAction` rows after the rows) and `lead` (which held value leads, `onLead`, `label` and `makeLabel`); and, where your app adds options to a select's or multiselect's list, `onAdd` (draw an add row after the matches and call it with the typed text; handed instead of `onCreate`), `adding` (the text being added: draw its row as waiting, not pressable) and `addRefused` (your app's refusal, or the failure's words, to show where the add row was). A body that draws none of them offers no add. A status field's `steps`: its active steps by value, in order, so a held archived option is placed nowhere, as its cell places it.
|
|
46
46
|
- `ViewsPickerItem` — one row of a picker body, as data: its `value` and `label`, a status `slot` (draw your status badge) or a category `color` (draw your option chip), an `icon` (your glyph's name, as `AppIcon` draws it), a quieter `line`, the `group` it stands under, `disabled`, and for a relation's record a `badge` (a word telling kinds apart), a `glyph` (the record's own, unsized), an `avatarUrl` and its `kind`.
|
|
47
47
|
- `ViewsPickerAction` — a row of a picker body that does something rather than pick (create a record with what was typed): its `key`, `label`, an optional `icon`, and `onSelect`; picking it closes the editor, then runs it.
|
|
48
|
-
- `ViewsCalendarProps` — a calendar over ISO days (`YYYY-MM-DD`): its `value` and `onChange`, `min` and `max`, a `month` (`YYYY-MM`) controlled with `onMonthChange`, a `captionLayout` of `label` or `dropdown`, the `startMonth` and `endMonth` its pickers offer, and `locale`, the conventions' locale, in which it draws its month and weekday names and starts its week (an adapter may keep its calendar's own). Your date library stays your own.
|
|
48
|
+
- `ViewsCalendarProps` — a calendar over ISO days (`YYYY-MM-DD`): its `value` and `onChange`, `min` and `max`, a `month` (`YYYY-MM`) controlled with `onMonthChange`, a `captionLayout` of `label` or `dropdown`, the `startMonth` and `endMonth` its pickers offer, and `locale`, the conventions' locale, in which it draws its month and weekday names and starts its week (an adapter may keep its calendar's own); and `data-slot`, its public name where ViewKit names it (`vk-calendar`, the date editor's month under `panelControls`), to draw on its root. Your date library stays your own.
|
|
49
49
|
- `ViewsDateBodyProps` — a whole date body your app draws, its typed line, days, quick picks and time: its `label` (the field's name), `value` (on the conventions' calendar and clock, the zone the cell shows, and a date-only field's stored instant on the browser's calendar, as its cell shows it: a day `YYYY-MM-DD`, a day and time `YYYY-MM-DDTHH:MM`, or `null`), `onValueChange` (every change as it is made, a typed day once it reads as one, `null` for the empty pick; nothing is saved until the editor closes), `onDone` (the edit is finished: a pick that finishes it, as a day on a field with no time or the empty pick, or an Enter that keeps; after a plain Enter the editor closes as Enter, so a grid's next key lands the write first), `time`, `empty`, `picks` (`ViewsDatePick`s, in order: the provider's `datePicks`, then `none` where it may be emptied), `today` (`YYYY-MM-DD`, today in the conventions' zone), `typed` (what was typed on what opened it), `autoFocus` and `form` (`phone`: draw no ✕, ✓ or Cancel of your own, and hand every change as it is made). The editor around it keeps the draft, Tab, Escape, the save and the phone's ✕ and ✓.
|
|
50
50
|
- `ViewsDatePick` — a quick pick a date body offers: `today`, `tomorrow`, `next-monday` (the Monday after today, a week on when today is one), `in-a-week` (today + 7 on the conventions' calendar) or `none`, which empties the field.
|
|
51
51
|
- `ViewsDatePicks` — the provider's `datePicks`: the quick days the date editors offer, in order, any `ViewsDatePick` but `none`. The date editor hands exactly these to your `DateBody` and its own panel draws the same; absent, `today`, `tomorrow` and `next-monday`.
|
|
@@ -68,7 +68,8 @@ The primitives your app hands in, modelled on Base UI's shapes: a controlled `op
|
|
|
68
68
|
- `ViewsSearchFieldProps` — the toolbar's search box your app draws: `value`, `onChange` (every keystroke), `placeholder`, `label` (its name to a screen reader), `searching` and `searchingLabel` (draw a spinner where your glass is, the box still usable), `onClear` (empties the search, and closes it where `closes`), `clearLabel` (your clear's name: "Close search" where it closes, "Clear" where it only clears), `closes` (opened from its button: your clear stands while it is open, empty or not; filling its line: show it only with a value), `form` (`computer` or `phone`) and `fill` (it fills its line).
|
|
69
69
|
- `ViewsViewsListBodyProps` — the views list's whole body your app draws: `label`, `views` (each a `ViewsViewsListItem`), `value` (the view in use), `form`, `onViewChange` (a view picked; written when it is one of `views`; it closes nothing), `onCreate` and `createLabel` where the axis grows (what holds it closes first), `onReorder` and `canDrag` where the axis reorders (one whole block, shared or the reader's own, each once; any other order writes nothing), `onDone` (what holds it closes), on a phone where the sheet's head doesn't draw it `actions` (the ✕, and Back while the body stands on a step), on a computer `onHold` (while true, a press outside and Escape close nothing: the body asks outside the list), on a phone `onStepChange` (the body stands on a step of its own: the sheet shows its title and Back), and, where the axis hands them, `verbs` (a view's whole menu's data, `ViewsViewVerbs`).
|
|
70
70
|
- `ViewsViewsListItem` — one view as the views list's body is handed it: `value`, `label`, `icon`, `count` (absent while counts are hidden), `private`, `menu` (the view's own verbs), and for a view's whole menu `layout`, `changed`, `favorite` and `readOnly` (nothing that changes it).
|
|
71
|
-
- `ViewsViewMenuProps` — one view's whole menu your app may draw (`ViewMenu`, optional; `CONTROLS.ViewMenu` is ViewKit's own), opened on a computer by a views row's pill and a folded view's `⋮` where the axis hands `verbs`: `open`, `onOpenChange`, `anchor` and `align`, as `Menu` is; `view` (whose menu it is; left out, New view's Modal stands in place of a menu, as the row's + opens it, and `onOpenChange(false)` is told once it has closed), `views` (every view of the axis, each a `ViewsViewsListItem`), `value` (the view in use), `verbs`, `onDone` (what holds it closes) and `onHold` (while true, a press outside and Escape close nothing: the menu asks outside what holds it).
|
|
71
|
+
- `ViewsViewMenuProps` — one view's whole menu your app may draw (`ViewMenu`, optional; `CONTROLS.ViewMenu` is ViewKit's own), opened on a computer by a views row's pill and a folded view's `⋮` where the axis hands `verbs`: `open`, `onOpenChange`, `anchor` and `align`, as `Menu` is; `view` (whose menu it is; left out, New view's Modal stands in place of a menu, as the row's + opens it and the picker's + with no view yet, and `onOpenChange(false)` is told once it has closed), `views` (every view of the axis, each a `ViewsViewsListItem`), `value` (the view in use), `verbs`, `onDone` (what holds it closes) and `onHold` (while true, a press outside and Escape close nothing: the menu asks outside what holds it).
|
|
72
|
+
- `ViewsPaneProps` — what your map's `Pane` is handed (VK-1026; `CONTROLS.Pane` is ViewKit's own Pane): `open`, `onOpenChange` (it closes from inside: Escape, its ✕), `container` (the list's box it stands in: positioned, holding the grid, never scrolling itself; null until it is on the page, when it draws nothing), `opener` (the part's button, ⋯ while folded: give it the focus back as it closes from inside), `label` (its name to a screen reader) and `children` (the panel). A toolbar with `customizeIn: "pane"` opens Customize in it on a computer, in the box handed as `paneBox`.
|
|
72
73
|
- `ViewsViewVerbs` — a view's verbs, handed on the axis where your app lets ViewKit draw a view's whole menu: `layouts`, `records` (the noun in the delete question's line), a board's `columns`, and `onChange`, which takes each `ViewsViewChange` and opens the right view itself (ViewKit moves none: `viewsAfter` does it); optionally `menu`, the view's menu as data, handed its default items and the view and returning the items drawn ([`/list`'s Menus as data](./list.md#menus-as-data)).
|
|
73
74
|
- `ViewsViewChange` — a change a view's menu makes: rename, create (with its layout, name, a board's columns and the view it was made from), duplicate, delete, restore (Undo: the view, its place, whether it was open), save, reset, edit, link, favorite, private.
|
|
74
75
|
- `ViewsViewLayout` — a layout a new view can take: `id`, `name`, `icon` (your `AppIcon`'s name), `line`, and `columns` where it asks which field makes its columns.
|
|
@@ -77,7 +78,7 @@ The primitives your app hands in, modelled on Base UI's shapes: a controlled `op
|
|
|
77
78
|
- `ViewsGroupDimension` — a field a list can be grouped by: `value`, `label`, `orderOptions` (each its mode, words and `defaultDir`), `defaultOrder`, and a date's `granularities` with `defaultGranularity`.
|
|
78
79
|
- `ViewsGroupValue` — a list's group as one value: `value` (the field grouped by, or `none`), `order` (the active field's `mode` and `dir`), `granularity`, `hideEmpty` and `groups` (each a `ViewsGroupEntry`, in the order the list shows them).
|
|
79
80
|
- `ViewsGroupEntry` — one group: `key`, `label`, `empty`, `hidden`, and its `count` where the list counts it.
|
|
80
|
-
- `ViewsCustomizeBodyProps` — Customize's whole body your app draws: `label`, `page` and `onPageChange` (a `ViewsCustomizePage`), `layout` (a `ViewsCustomizeLayout`), `columns` (`ViewsCustomizeColumns`), `filter` (`FilterBody`'s props on the whole filter, without `form`, `onDone` and `actions`), `sort` (`SortBody`'s, likewise), `group` (`GroupBody`'s, likewise), `toggles` (each a `ViewsCustomizeToggle`, Show counts among them), `view` (on a shared view, or the person's own with `own`: `changes`, `stale`, `canPublish`, `pending`, `onReset`, `onPublish`), `foot`, `onClear`, `clearAll`, `form`, `onDone` and, on a phone where the sheet's head doesn't draw it, `actions` (the ✕). `fields` (`ViewsCustomizeFields`): a list's per-field filters, its time range and its date ranges.
|
|
81
|
+
- `ViewsCustomizeBodyProps` — Customize's whole body your app draws: `label`, `page` and `onPageChange` (a `ViewsCustomizePage`), `layout` (a `ViewsCustomizeLayout`), `columns` (`ViewsCustomizeColumns`), `filter` (`FilterBody`'s props on the whole filter, without `form`, `onDone` and `actions`), `sort` (`SortBody`'s, likewise), `group` (`GroupBody`'s, likewise), `toggles` (each a `ViewsCustomizeToggle`, Show counts among them), `view` (on a shared view, or the person's own with `own`: `changes`, `stale`, `canPublish`, `pending`, `onReset`, `onPublish`, and `layered` while the reader's own layer holds something), `resets` (each page's own Reset, while that page differs), `foot`, `onClear`, `clearAll`, `form`, `onDone` and, on a phone where the sheet's head doesn't draw it, `actions` (the ✕). `fields` (`ViewsCustomizeFields`): a list's per-field filters, its time range and its date ranges.
|
|
81
82
|
- `ViewsCustomizePage` — where a Customize body stands: `list`, `layout`, `columns`, `filter`, `sort` or `group`.
|
|
82
83
|
- `ViewsCustomizeLayout` — the layouts (`options`, `refused` with reasons, `value`, `onLayoutChange`) and the layout in use's `toggles`, `choices`, `density` and the reader's own `personal` settings.
|
|
83
84
|
- `ViewsCustomizeFields` — a list's per-field filters, its time range and its date ranges: `folded` (behind one Filter row, or each its own row) and `items`, each a `ViewsCustomizeField`.
|
|
@@ -91,7 +92,7 @@ The primitives your app hands in, modelled on Base UI's shapes: a controlled `op
|
|
|
91
92
|
- `ViewsCollapseProps` — a box that opens and closes its `children` with `open`, over `durationMs`, with a class and a `clipClassName` on the box that crops the content.
|
|
92
93
|
- `ViewsSheetProps` — a phone sheet, controlled by `open` and `onOpenChange`, with a `title`, a `label` (the title in words whenever the title is words: its accessible name, and the title of a head that takes only text), a `description`, a class, its `children`, and `snap` (`full`, `half`, `peek`, `auto`), a hint a sheet with no snap points ignores. With the provider's `sheetActions` at `head` it is handed `actions` to draw in its own head: the editor panel's ✕ and ✓ (and Back, on a body's step), a toolbar panel's ✕ alone, or the sort editor's ✕ (which takes its rules back) and ✓.
|
|
93
94
|
- `ViewsSheetActions` — the editor panel's ✕ and ✓, handed to a sheet that draws them in its head: `close`, which throws the edit away as a swipe does, and `done`, which closes it as done, absent where the body saves on its pick. A toolbar panel's sheet is handed `close` alone, which closes it; the sort editor's is handed both, its `close` taking the rules back to what they were as the sheet opened and its `done` keeping them. While an editor's body stands on a step of its own it carries `back` too, to draw in `close`'s place: Back, returning the body to where it was; `close` stays handed, for a head that draws no Back.
|
|
94
|
-
- `ViewsSheetAction` — one of them: its `label` (the accessible name) and `onPress`. The glyph is yours.
|
|
95
|
+
- `ViewsSheetAction` — one of them: its `label` (the accessible name) and `onPress`, and its `slot`, its public name on an editor panel's ✕, ✓ and Back (`vk-editor-close`, `vk-editor-save`, `vk-editor-back`), to draw on your button as its `data-slot`. The glyph is yours.
|
|
95
96
|
- `ViewsBodyStep` — `{ title, onBack }`: a step of an editor body's own on a phone (a list of countries, a label's list), which a `TextBody`, `NumberBody`, `PartsBody`, `ValuesBody` or `LinksBody`, or the sort's `SortBody` (Add sort's fields, a rule's direction), hands the sheet through its `onStepChange`. The sheet's head shows `title` in place of the field's name, and Back and the sheet's Escape call `onBack`; the body hands `null` once it is back. A `GroupBody` hands its level the same way to ViewKit's Customize, on a computer and a phone: Customize's head shows its title and Back calls `onBack` (Escape there still closes the panel).
|
|
96
97
|
- `ViewsSeveralValues` — `"first" | "fit"`, the provider's `severalValues`: how a cell of several values draws on one line. `fit` (the default) draws as many whole values as fit its width, then the count, following a column resize; `first` draws its first value and a count at any width, as on 0.5.0.
|
|
97
98
|
- `ViewsSelectionBarSettings` — the provider's `selectionBar`: `phoneQuery` (the media query under which the bar is the phone's pill; without it, wherever `desktopQuery` does not match), and `desktop` and `phone`, each a `ViewsBarPlacement`.
|
|
@@ -99,7 +100,7 @@ The primitives your app hands in, modelled on Base UI's shapes: a controlled `op
|
|
|
99
100
|
- `ViewsSheetActionsPlace` — where the ✕ and ✓ stand on a phone, the provider's `sheetActions`: `bar` (the default, the panel's own bar, or a toolbar panel's own ✕, inside your sheet) or `head` (handed to your sheet as `actions`, and none drawn inside; a toolbar panel hands `close` alone, but the sort editor hands `close`, which takes its rules back, and `done`).
|
|
100
101
|
- `ViewsInputProps` — a single-line text box: every prop of an `<input>`, `ref` included, which your element must receive, and `chrome`, `bare` (the default: a grid cell, a panel that frames the box) or `field` (your field's frame).
|
|
101
102
|
- `ViewsSelectItem` — one row of a `Select`'s list: its `value`, `label`, an `icon`, a second `line`, the `group` it stands under, `disabled`, and `level`, the rows one level in under a row never picked itself (draw them in place, or flatten them with `flatSelectItems`).
|
|
102
|
-
- `ViewsSelectProps` — the components map's `Select`, which ViewKit's
|
|
103
|
+
- `ViewsSelectProps` — the components map's `Select`, which ViewKit's panels and field editors draw under `panelControls` for their boxes that pick (the sort's and the filter's, New view's columns, the place editor's on a computer and the links editor's fields; a clear the box offers comes as its first row, a pick of it handing `null`): its `items`, its `value` (one, several with `multiple`, or none) and `onValueChange`, a `placeholder`, `disabled`, `open` and `onOpenChange` (on a phone a panel holds it shut and turns its sheet to a step of its own on `onOpenChange(true)`: honour both when handed), `search` (the words of the search ViewKit's own shows over a long list), `size` (`sm` or `default`), a class, `aria-label`, `id` (inside a ViewKit field, the id its label names, VK-1022), and the part's `data-slot` and `data-key`, to draw on the box a person presses. Forward any other prop to your box.
|
|
103
104
|
- `ViewsAnchor` — where a floating part attaches: an element, a ref to one, a point `{ x, y }` (a context menu), or `null`.
|
|
104
105
|
- `ViewsSide` — the side a floating part opens on: `top`, `right`, `bottom` or `left`.
|
|
105
106
|
- `ViewsAlign` — how a floating part lines up along that side: `start`, `center` or `end`.
|
|
@@ -135,7 +136,7 @@ Guide: [atoms](../guides/atoms.md).
|
|
|
135
136
|
The pieces the rendering is built from, and your app's own pieces it cannot draw itself. Each ships as a default, drawn from your app's colours and marked with its own `data-slot`; your app swaps any of them through the provider's `atoms`, and the rest stay the defaults. A swapped atom marks itself as your app does. The [contract](../contract.md) lists their slots and states.
|
|
136
137
|
|
|
137
138
|
- `DEFAULT_VIEWS_ATOMS` — the atoms every app starts with, one default per name of `ViewsAtoms`; the provider lays your `atoms` over it.
|
|
138
|
-
- `ViewsAtoms` — the full set, one component per atom: `List`, `Row`, `RowContent`, `TickBox`, `Avatar`, `StatusBadge`, `StatusMarker`, `Tag`, `CommandMenu`, `RelationLink`, `RelationRoles`, `CellMore`, `Loading`, `LoadMore`, `PlatformMark`, `RowMenu`, and the panels' rows `ChoiceRow`, `CheckRow`, `RadioRow`, `DirectionButton`, `MenuRow`, `ToggleRow` and `PanelSearch`, the selection's `SelectionSheet`, the filter panel's month `RangeCalendar`, the views row's `Pill`, and the toolbar's `ToolbarButton`. The provider's `atoms` takes any part of it.
|
|
139
|
+
- `ViewsAtoms` — the full set, one component per atom: `List`, `Row`, `RowContent`, `TickBox`, `Avatar`, `StatusBadge`, `StatusMarker`, `Tag`, `CommandMenu`, `RelationLink`, `RelationRoles`, `RelationChip`, `CellMore`, `Loading`, `LoadMore`, `PlatformMark`, `RowMenu`, and the panels' rows `ChoiceRow`, `CheckRow`, `RadioRow`, `DirectionButton`, `MenuRow`, `ToggleRow` and `PanelSearch`, the selection's `SelectionSheet`, the filter panel's month `RangeCalendar`, the views row's `Pill`, and the toolbar's `ToolbarButton`. The provider's `atoms` takes any part of it.
|
|
139
140
|
- `ViewsChoiceRowProps` — a panel's value row: `label`, a `description` under it, a right-hand `meta` (a sample, a count; a row with one draws no check), `leading`, `trailing`, `selected`, `onClick`, `onMouseDown`, `disabled`, `role` and `aria-selected`.
|
|
140
141
|
- `ViewsCheckRowProps` — toggles one of many, a tick box on the left: `checked`, `onClick`, its `children`, `leading`, `trailing`, `disabled`.
|
|
141
142
|
- `ViewsRadioRowProps` — picks one of a set: `selected`, `label`, `onClick`, `leading`, `trailing`, `mark` (`"check"` or `"box"`), `disabled` and the `disabledReason` your `Tooltip` shows, and class hooks for the check and the label.
|
|
@@ -153,7 +154,7 @@ The pieces the rendering is built from, and your app's own pieces it cannot draw
|
|
|
153
154
|
- How it reads: `chosen` draws a trailing check (a chosen row with a `detail` draws the detail in the brand colour and no check), `chosenTint` false keeps a badge label's own colour, `tone` `muted` for a row that offers rather than lists (none, create, add), and `size` `compact` (13px) or `regular` (your menu size, the default).
|
|
154
155
|
- `ViewsRowProps` — a whole row: everything `ViewsRowContentProps` takes, as a button, or with `interactive` false a static line. It adds `onClick`, `onMouseDown` (for a row inside an editor that keeps its input focused), `disabled`, `title`, a `role` with `aria-selected`, and `opens` and `open` for a row that opens a flyout beside its menu.
|
|
155
156
|
- `ViewsTickBoxProps` — a paint-only tick box: `checked` and a class. The control around it is the caller's.
|
|
156
|
-
- `ViewsAvatarProps` — a person's or a record's picture, drawn in a user's, a relation's and an actor's chip (`size: "chip"`) and before the name when the list's `rowIcon` hands the row's `avatar` (`size: "glyph"`, sized by `--vk-glyph`): `label` (whose picture it is, for initials), `avatarUrl` (the picture, when there is one), `kind` (the record's kind as your app names it: a relation's `entity`, `user` for a member, an actor's type) and `fallback` (the glyph the chip or the name draws without a picture). The default draws the picture while it loads and the fallback otherwise; yours may hand back the fallback for a kind it doesn't dress. It only paints: what wraps the chip owns the click.
|
|
157
|
+
- `ViewsAvatarProps` — a person's or a record's picture, drawn in a user's, a relation's and an actor's chip (`size: "chip"`) and before the name when the list's `rowIcon` hands the row's `avatar` (`size: "glyph"`, sized by `--vk-glyph`): `label` (whose picture it is, for initials), `avatarUrl` (the picture, when there is one), `kind` (the record's kind as your app names it: a relation's `entity`, `user` for a member, an actor's type) and `fallback` (the glyph the chip or the name draws without a picture). Where the provider's `panelControls` names `Avatar`, it also draws every record's mark ViewKit's panels draw (the Picker's rows, the links editor's, the bulk bar's choices, the quick filters' values), its `size` then a number in pixels (20, 24, 32 or 40) and its `fallback` ViewKit's own Avatar (VK-1044). The default draws the picture while it loads and the fallback otherwise; yours may hand back the fallback for a kind it doesn't dress. It only paints: what wraps the chip owns the click.
|
|
157
158
|
- `ViewsStatusBadgeProps` — a pill coloured by a status slot of `viewkitjs/fields`: its `slot` and `label`, a `leading` mark that replaces the slot's own, a `title`, a `size` (`compact`, 11px, the default; `regular`; or `row`, the text size of the row it sits in, which a cell's status value hands) and a class. It is handed `place` wherever a field's option is drawn (a cell, the select editor, the selection bar): where the status stands among the field's steps.
|
|
158
159
|
- `ViewsStatusPlace` — a status's `place`: `options`, the field's active options in their order (the same array for every cell of a field), and `index`, this one's place in them. A stray or archived value, and a badge that is no option, are handed none.
|
|
159
160
|
- `ViewsStatusOption` — one of those options as a badge is handed it: `value`, `label` and its `slot`.
|
|
@@ -162,10 +163,12 @@ The pieces the rendering is built from, and your app's own pieces it cannot draw
|
|
|
162
163
|
- `ViewsCommandMenuProps` — a `command` cell's verb menu: the `trigger` the cell drew (a button), the host's `items` as `FieldRowMenuItem`s, and `align`. The default is your components map's `Menu`; your app may swap in its own action menu.
|
|
163
164
|
- `ViewsRangeCalendarProps` — the filter panel's month, in ISO days: `mode` (`single` or `range`), `from`, `to`, `onSelect` (the selection a press makes, and the day pressed), `armed` (the end the next press sets), `limit`, a painted `window`, `minNights`, a `footer`, `cellSize`, `locale` and `className`. The default is the map's one-day `Calendar` on the end being picked; hand your own to paint a range.
|
|
164
165
|
- `ViewsSelectionSheetProps` — the phone's sheet of a selection's verbs, opened by the selection bar's Actions: `open`, `onOpenChange`, `title` ("3 selected"), the `verbs`, `onDelete` and `deleteLabel` for the bar's own delete, drawn last, and `busy`. The default draws a disabled verb's `disabledReason` as its row's second line, none while `busy`. Picking a row closes the sheet, then runs it.
|
|
165
|
-
- `ViewsRowMenuProps` — the row's right-click menu, around the row it opens on (`children`): opened by a right-click on the row or by its ⋯, it lists an Open page row for `openHref` (a new tab), the `items` the rendering built, and a Delete row when `onDelete` is given, called with `rowId` once the confirm port says yes, with `deleteLabel` as its `subject`. A delete that rejects says so through the toast port's `error`. `onToggleSelect` flips the row's selection, for an app whose long-press selects; 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, and with no press held it flips the row last pressed. The default doesn't use it, and without `phonePicking` a long-press on a phone opens nothing.
|
|
166
|
+
- `ViewsRowMenuProps` — the row's right-click menu, around the row it opens on (`children`): opened by a right-click on the row or by its ⋯, it lists an Open page row for `openHref` (a new tab), the `items` the rendering built, and a Delete row when `onDelete` is given, called with `rowId` once the confirm port says yes, with `deleteLabel` as its `subject`. A delete that rejects says so through the toast port's `error`. `onToggleSelect` flips the row's selection, for an app whose long-press selects; 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, and with no press held it flips the row last pressed. The default doesn't use it, and without `phonePicking` a long-press on a phone opens nothing. Call `onOpenChange` with `true` as the menu opens and `false` as it closes: while it is open the grid draws the row it is aimed at as under the pointer (`data-hovered`, its tint, its ⋯), wherever the pointer goes. The default calls it; an atom that doesn't leaves the row to the real pointer.
|
|
166
167
|
- `ViewsRowMenuItem` — one row of the row's menu, the shape a host's own row-menu items already have: a rule (`{ separator: true }`), or a row with its `label`, `icon`, `onClick`, `destructive`, `disabled`, a `shortcut` hint drawn at its end and never bound, and an optional `key`, by which `menus.row` finds it (its words, without one).
|
|
167
168
|
- `ViewsRelationLinkProps` — where a relation chip goes: the `relation` value and the chip the display drew as `children`, for your app's own link around it. The default goes nowhere, since a relation is a fact as often as a destination.
|
|
168
169
|
- `ViewsRelationRolesProps` — a link's roles, drawn inside its chip after the record's name, on a `many` relation that declares `links`: the `relation` value and its `roles` in order, each its stored `value` and its `label` (the field's, else the value). Handed only when the link holds one or more. The default draws the labels in the subtle colour after a middle dot, cut before the name in a narrow cell, and names the record and every role on hover.
|
|
170
|
+
- `ViewsRelationChipProps` — a mentioned record (VK-1053), drawn where the provider's `panelControls` names `RelationChip`: every relation ViewKit draws, in a table's cell (one and many, and the +N list), a field row's value, `renderFieldValue` (a highlight) and a user field's chip. ViewKit places a mentioned record and hands its data; your app draws it. It is handed `relation` (`id`, `label`, `entity`, `avatarUrl`), `roles` (each its `value` and `label`; none but on a `many` relation that declares `links`), `size` (`chip` in a cell or a highlight, `row` in a field row), `render`, the host's link where it has one, and `fallback`, ViewKit's own chip as it would draw it there. The default draws its `fallback`.
|
|
171
|
+
- `ViewsRelationChipLinkProps` — what a mentioned record hands the host's link it draws itself through (`render`): its own element's props, its words and mark as `children`, its class, its `data-*`, its ref. The host's link draws its own element with them: a cell whose host opens its relations a bare `<button data-slot="vk-relation-link" data-no-nav>` whose press opens the record, the app's `RelationLink` or a host's `relationWrap` around a `<span>` holding them.
|
|
169
172
|
- `ViewsCellMoreProps` — the count after a cell's shown values: `count`, how many are not shown, and `inert`, true where the host owns the click (the count is plain text, and nothing opens). Drawn inside `data-slot="vk-cell-more"`, a button that opens the whole list. The default, `DefaultCellMore`, draws "+" and the number, and ViewKit keeps its own frame on that element only for it; yours draws inside a bare button (or span), so a count tag of yours stands there alone.
|
|
170
173
|
- `ViewsLoadingProps` — a wait: `placement` `body` (the whole list reloading) or `footer` (more rows arriving), and the `label` read to assistive technology. The default is a plain ring, larger in the body.
|
|
171
174
|
- `ViewsLoadMoreProps` — how a list asks for its next page once its end comes near: `onReveal`, and an optional `label` drawn while it waits. The default watches a sentinel past the last row, calls `onReveal` as it comes within 600px of the end of what it scrolls in (the grid's own scroll area, else the viewport), and draws your `Loading` (or the label) meanwhile.
|