viewkitjs 0.27.0 → 0.28.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 +71 -0
- package/MIGRATION.md +40 -3
- package/package.json +1 -1
- package/views/dist/cells/cell-format.d.ts +3 -1
- package/views/dist/cells/cell-format.js +2 -2
- package/views/dist/cells/use-cell-format.d.ts +8 -1
- package/views/dist/cells/use-cell-format.js +13 -2
- package/views/dist/contract.d.ts +70 -3
- package/views/dist/contract.js +76 -0
- package/views/dist/controls/alert/alert.d.ts +46 -0
- package/views/dist/controls/alert/alert.js +11 -0
- package/views/dist/controls/alert/looks.d.ts +4 -0
- package/views/dist/controls/alert/looks.js +19 -0
- package/views/dist/controls/alert/tokens.d.ts +92 -0
- package/views/dist/controls/alert/tokens.js +25 -0
- package/views/dist/controls/alert-dialog/alert-dialog.d.ts +50 -0
- package/views/dist/controls/alert-dialog/alert-dialog.js +67 -0
- package/views/dist/controls/alert-dialog/confirm.d.ts +13 -0
- package/views/dist/controls/alert-dialog/confirm.js +11 -0
- package/views/dist/controls/alert-dialog/looks.d.ts +4 -0
- package/views/dist/controls/alert-dialog/looks.js +17 -0
- package/views/dist/controls/alert-dialog/tokens.d.ts +119 -0
- package/views/dist/controls/alert-dialog/tokens.js +32 -0
- package/views/dist/controls/alert-dialog.css +95 -0
- package/views/dist/controls/alert.css +51 -0
- package/views/dist/controls/collapsible/collapsible.d.ts +39 -0
- package/views/dist/controls/collapsible/collapsible.js +18 -0
- package/views/dist/controls/collapsible/looks.d.ts +4 -0
- package/views/dist/controls/collapsible/looks.js +5 -0
- package/views/dist/controls/collapsible/map-collapse.d.ts +2 -0
- package/views/dist/controls/collapsible/map-collapse.js +6 -0
- package/views/dist/controls/collapsible/tokens.d.ts +68 -0
- package/views/dist/controls/collapsible/tokens.js +19 -0
- package/views/dist/controls/collapsible.css +83 -0
- package/views/dist/controls/compound-editor/place-parts.js +5 -1
- package/views/dist/controls/controls.d.ts +9 -0
- package/views/dist/controls/controls.js +9 -0
- package/views/dist/controls/date-editor/date-editor.d.ts +2 -1
- package/views/dist/controls/date-editor/map-calendar.js +3 -1
- package/views/dist/controls/filter-editor/filter-editor.d.ts +56 -0
- package/views/dist/controls/filter-editor/filter-editor.js +208 -0
- package/views/dist/controls/filter-editor/how.d.ts +23 -0
- package/views/dist/controls/filter-editor/how.js +13 -0
- package/views/dist/controls/filter-editor/map-filter-body.d.ts +18 -0
- package/views/dist/controls/filter-editor/map-filter-body.js +164 -0
- package/views/dist/controls/filter-editor/map-rules.d.ts +85 -0
- package/views/dist/controls/filter-editor/map-rules.js +273 -0
- package/views/dist/controls/filter-editor/parts.d.ts +46 -0
- package/views/dist/controls/filter-editor/parts.js +75 -0
- package/views/dist/controls/filter-editor/rules.d.ts +104 -0
- package/views/dist/controls/filter-editor/rules.js +148 -0
- package/views/dist/controls/filter-editor/tokens.d.ts +83 -0
- package/views/dist/controls/filter-editor/tokens.js +23 -0
- package/views/dist/controls/filter-editor/words.d.ts +59 -0
- package/views/dist/controls/filter-editor/words.js +40 -0
- package/views/dist/controls/filter-editor.css +124 -0
- package/views/dist/controls/group-editor/group-editor.d.ts +56 -0
- package/views/dist/controls/group-editor/group-editor.js +126 -0
- package/views/dist/controls/group-editor/map-group-body.d.ts +19 -0
- package/views/dist/controls/group-editor/map-group-body.js +106 -0
- package/views/dist/controls/group-editor/rules.d.ts +48 -0
- package/views/dist/controls/group-editor/rules.js +41 -0
- package/views/dist/controls/group-editor/tokens.d.ts +15 -0
- package/views/dist/controls/group-editor/tokens.js +6 -0
- package/views/dist/controls/group-editor/words.d.ts +39 -0
- package/views/dist/controls/group-editor/words.js +21 -0
- package/views/dist/controls/group-editor.css +20 -0
- package/views/dist/controls/index.d.ts +19 -1
- package/views/dist/controls/index.js +19 -1
- package/views/dist/controls/internal/editor-parts.d.ts +8 -1
- package/views/dist/controls/internal/editor-parts.js +5 -0
- package/views/dist/controls/internal/step-return.d.ts +9 -0
- package/views/dist/controls/internal/step-return.js +27 -0
- package/views/dist/controls/links-editor/links-editor.d.ts +5 -3
- package/views/dist/controls/links-editor/links-editor.js +38 -17
- package/views/dist/controls/links-editor/map-links-body.js +4 -1
- package/views/dist/controls/links-editor.css +1 -1
- package/views/dist/controls/menu-list/menu-list.d.ts +17 -2
- package/views/dist/controls/menu-list/menu-list.js +25 -16
- package/views/dist/controls/modal/looks.d.ts +4 -0
- package/views/dist/controls/modal/looks.js +25 -0
- package/views/dist/controls/modal/modal.d.ts +69 -0
- package/views/dist/controls/modal/modal.js +62 -0
- package/views/dist/controls/modal/tokens.d.ts +192 -0
- package/views/dist/controls/modal/tokens.js +50 -0
- package/views/dist/controls/modal.css +130 -0
- package/views/dist/controls/notice/notice.d.ts +49 -0
- package/views/dist/controls/notice/notice.js +35 -0
- package/views/dist/controls/notice/tokens.d.ts +99 -0
- package/views/dist/controls/notice/tokens.js +27 -0
- package/views/dist/controls/notice.css +100 -0
- package/views/dist/controls/number-editor/number-editor.js +1 -1
- package/views/dist/controls/pane/looks.d.ts +4 -0
- package/views/dist/controls/pane/looks.js +11 -0
- package/views/dist/controls/pane/pane.d.ts +63 -0
- package/views/dist/controls/pane/pane.js +98 -0
- package/views/dist/controls/pane/state.d.ts +14 -0
- package/views/dist/controls/pane/state.js +7 -0
- package/views/dist/controls/pane/tokens.d.ts +79 -0
- package/views/dist/controls/pane/tokens.js +22 -0
- package/views/dist/controls/pane.css +104 -0
- package/views/dist/controls/picker/rows.d.ts +4 -2
- package/views/dist/controls/picker/rows.js +4 -3
- package/views/dist/controls/sort-editor/map-sort-body.d.ts +9 -0
- package/views/dist/controls/sort-editor/map-sort-body.js +81 -0
- package/views/dist/controls/sort-editor/rules.d.ts +48 -0
- package/views/dist/controls/sort-editor/rules.js +24 -0
- package/views/dist/controls/sort-editor/sort-editor.d.ts +58 -0
- package/views/dist/controls/sort-editor/sort-editor.js +180 -0
- package/views/dist/controls/sort-editor/tokens.d.ts +79 -0
- package/views/dist/controls/sort-editor/tokens.js +22 -0
- package/views/dist/controls/sort-editor/words.d.ts +48 -0
- package/views/dist/controls/sort-editor/words.js +25 -0
- package/views/dist/controls/sort-editor.css +96 -0
- package/views/dist/controls/toast/toast.d.ts +75 -0
- package/views/dist/controls/toast/toast.js +99 -0
- package/views/dist/controls/toast/tokens.d.ts +100 -0
- package/views/dist/controls/toast/tokens.js +27 -0
- package/views/dist/controls/toast.css +93 -0
- package/views/dist/controls/tokens.js +20 -0
- package/views/dist/controls/values-editor/values-editor.js +7 -1
- package/views/dist/display/date.js +2 -2
- package/views/dist/display/format.js +10 -2
- package/views/dist/display/options.d.ts +3 -1
- package/views/dist/display/use-display-options.d.ts +3 -0
- package/views/dist/display/use-display-options.js +10 -2
- package/views/dist/display/viewer.d.ts +1 -1
- package/views/dist/display/viewer.js +1 -1
- package/views/dist/editors/DateEditor.js +11 -9
- package/views/dist/editors/relation-panel.js +7 -1
- package/views/dist/editors/relation-picker.d.ts +2 -1
- package/views/dist/editors/relation-picker.js +4 -3
- package/views/dist/editors/relation-source.d.ts +4 -1
- package/views/dist/editors/relation-source.js +5 -2
- package/views/dist/field-row/editors/RowNumberEditor.js +2 -2
- package/views/dist/fields/number-edit.d.ts +6 -0
- package/views/dist/fields/number-edit.js +8 -1
- package/views/dist/grid/chrome/GridCellEditors.js +2 -2
- package/views/dist/grid/chrome/GridColumnDateSection.d.ts +4 -3
- package/views/dist/grid/chrome/GridColumnDateSection.js +4 -4
- package/views/dist/grid/chrome/GridColumnDurationSection.js +2 -2
- package/views/dist/grid/chrome/GridColumnMenu.js +6 -4
- package/views/dist/grid/chrome/GridFooter.js +2 -2
- package/views/dist/grid/chrome/grid-column-menu-items.js +4 -2
- package/views/dist/grid/chrome/useGridBandFigures.js +2 -2
- package/views/dist/grid/chrome/useGridFittedWidths.d.ts +3 -0
- package/views/dist/grid/chrome/useGridFittedWidths.js +9 -3
- package/views/dist/grid/chrome/useGridKeyboard.d.ts +4 -1
- package/views/dist/grid/chrome/useGridKeyboard.js +5 -2
- package/views/dist/grid/chrome/useGridTableInteractionModel.js +2 -1
- package/views/dist/grid/core/commit-model.d.ts +7 -0
- package/views/dist/grid/core/commit-model.js +5 -1
- package/views/dist/grid/core/editing-controller.js +10 -2
- package/views/dist/grid/core/editing-model.js +3 -7
- package/views/dist/grid/core/undo-owner.d.ts +6 -0
- package/views/dist/grid/core/undo-owner.js +13 -0
- package/views/dist/grid/core/useGridEditing.d.ts +2 -0
- package/views/dist/grid/core/useGridEditing.js +4 -0
- package/views/dist/looks/index.d.ts +5 -0
- package/views/dist/looks/index.js +5 -0
- package/views/dist/looks/pieces.js +10 -0
- package/views/dist/panels/model.d.ts +6 -1
- package/views/dist/panels/react/customize-body.d.ts +4 -2
- package/views/dist/panels/react/customize-body.js +3 -3
- package/views/dist/panels/react/customize.js +4 -2
- package/views/dist/panels/react/filter/FilterEditor.js +2 -2
- package/views/dist/panels/react/filter/PhoneFilterEditor.d.ts +8 -2
- package/views/dist/panels/react/filter/PhoneFilterEditor.js +9 -6
- package/views/dist/panels/react/filter/filter-body.d.ts +8 -5
- package/views/dist/panels/react/filter/filter-body.js +17 -6
- package/views/dist/panels/react/filter/filter-part-body.d.ts +4 -1
- package/views/dist/panels/react/filter/filter-part-body.js +3 -1
- package/views/dist/panels/react/panel-sheet.d.ts +5 -1
- package/views/dist/panels/react/panel-sheet.js +6 -2
- package/views/dist/panels/react/panel-step.d.ts +12 -0
- package/views/dist/panels/react/panel-step.js +26 -0
- package/views/dist/panels/react/sort/SortEditor.d.ts +4 -0
- package/views/dist/panels/react/sort/SortEditor.js +5 -2
- package/views/dist/panels/react/toolbar/ReadyToolbar.d.ts +8 -0
- package/views/dist/panels/react/toolbar/ReadyToolbar.js +84 -2
- package/views/dist/panels/react/toolbar/ToolbarBarFilter.js +2 -2
- package/views/dist/panels/react/toolbar/ToolbarFilterAdd.d.ts +16 -0
- package/views/dist/panels/react/toolbar/ToolbarFilterAdd.js +49 -0
- package/views/dist/panels/react/toolbar/ToolbarFilterSheet.js +3 -1
- package/views/dist/panels/react/toolbar/ToolbarFilters.d.ts +4 -1
- package/views/dist/panels/react/toolbar/ToolbarFilters.js +36 -21
- package/views/dist/panels/react/toolbar/ToolbarQuickFilters.d.ts +4 -1
- package/views/dist/panels/react/toolbar/ToolbarQuickFilters.js +2 -2
- package/views/dist/panels/react/toolbar/ToolbarSortPill.d.ts +5 -0
- package/views/dist/panels/react/toolbar/ToolbarSortPill.js +15 -6
- package/views/dist/panels/react/toolbar/panel-part.d.ts +5 -1
- package/views/dist/panels/react/toolbar/panel-part.js +2 -2
- package/views/dist/panels/react/toolbar/use-filter-add.d.ts +16 -0
- package/views/dist/panels/react/toolbar/use-filter-add.js +32 -0
- package/views/dist/panels/react.d.ts +1 -0
- package/views/dist/panels/react.js +1 -0
- package/views/dist/panels/settings/filter-groups.js +35 -1
- package/views/dist/panels/settings/group-buckets.js +1 -0
- package/views/dist/provider/ViewsProvider.d.ts +7 -1
- package/views/dist/provider/ViewsProvider.js +23 -3
- package/views/dist/provider/components.d.ts +30 -4
- package/views/dist/provider/moment.d.ts +6 -0
- package/views/dist/provider/moment.js +10 -0
- package/views/dist/styles.css +847 -52
- package/views/dist/styles.unlayered.css +848 -52
- package/views/docs/contract.md +15 -9
- package/views/docs/controls/alert-dialog.md +37 -0
- package/views/docs/controls/alert.md +30 -0
- package/views/docs/controls/collapsible.md +22 -0
- package/views/docs/controls/filter-editor.md +28 -0
- package/views/docs/controls/group-editor.md +11 -0
- package/views/docs/controls/modal.md +55 -0
- package/views/docs/controls/notice.md +32 -0
- package/views/docs/controls/pane.md +25 -0
- package/views/docs/controls/sort-editor.md +27 -0
- package/views/docs/controls/toast.md +32 -0
- package/views/docs/guides/cells.md +1 -1
- package/views/docs/guides/display.md +1 -1
- package/views/docs/guides/the-grid.md +1 -1
- package/views/docs/guides/the-provider.md +19 -0
- package/views/docs/reference/cells.md +2 -2
- package/views/docs/reference/controls.md +213 -7
- package/views/docs/reference/display.md +2 -2
- package/views/docs/reference/editors-relation.md +1 -1
- package/views/docs/reference/looks.md +10 -0
- package/views/docs/reference/panels-react.md +7 -6
- package/views/docs/reference/panels.md +1 -1
- package/views/docs/reference/react.md +7 -7
- package/views/docs/reference/views.md +1 -0
|
@@ -466,6 +466,25 @@ assert.equal(printed.duration({ milliseconds: 150_000, context: viewer }), "2:30
|
|
|
466
466
|
assert.equal(printed.duration({ milliseconds: 150_000, style: "units", context: viewer }), "2m 30s"); // a chosen style wins
|
|
467
467
|
```
|
|
468
468
|
|
|
469
|
+
## The moment
|
|
470
|
+
|
|
471
|
+
Relative dates ("today", "3d ago"), a short date's year, the column menu's date samples and the date editors' quick days and today all count from one moment, the provider's `now`. Hand it the moment your server rendered at, and the server and the browser draw the same text on first load:
|
|
472
|
+
|
|
473
|
+
```tsx
|
|
474
|
+
// The moment your server rendered at, carried to the browser with the page (a prop, a data attribute).
|
|
475
|
+
export function MomentViews({ children, renderedAt }: { children: ReactNode; renderedAt: Date }) {
|
|
476
|
+
return (
|
|
477
|
+
<ViewsProvider components={viewsComponents} icons={viewsIcons} ports={viewsPorts} conventions={conventions} now={renderedAt}>
|
|
478
|
+
{children}
|
|
479
|
+
</ViewsProvider>
|
|
480
|
+
);
|
|
481
|
+
}
|
|
482
|
+
```
|
|
483
|
+
|
|
484
|
+
With none, the provider reads the clock just after the page loads, then once a minute and whenever the tab comes back into view, and never while rendering, so a framework that refuses a render reading the clock (a Next.js prerender) builds the grid as it is. Until the first read, a date that needs the moment draws its full form (`01 Dec 2026`, `01 Dec 2026, 14:05`), then its short or relative form; after that "5m ago" moves about once a minute, and a row saved after the page loaded reads "just now". A moment you hand is kept as it is: it moves only when you hand a new one. To keep a fixed moment, hand it here, not through `presentation`.
|
|
485
|
+
|
|
486
|
+
Your `presentation`'s `calendarDay` and `instant` may meet a viewer with no `now` (before the moment is read); its relative formatters are only called with one. A date editor or calendar drawn open in the first render, before the moment is read, takes today from the browser's clock; one opened by a press, after the page loads, counts from the moment. The provider compares the moment's time, so a new `Date` for the same moment redraws nothing.
|
|
487
|
+
|
|
469
488
|
## Atoms
|
|
470
489
|
|
|
471
490
|
The rows, tick boxes, badges, tags, menus and waits every view is built from ship as defaults drawn from your theme; swap any of them through `atoms`, a module-level object such as `atoms={{ Tag: MyTag }}`. [Atoms](atoms.md) covers each.
|
|
@@ -17,9 +17,9 @@ Guide: [cells](../guides/cells.md).
|
|
|
17
17
|
|
|
18
18
|
## Column-shaped text
|
|
19
19
|
|
|
20
|
-
- `formatDate` — a date column's value as text: takes the value, the column, a date style override, a show-time override and the viewer. The overrides win over the column's `format`. A date column, or a derived field whose result is a day, reads as a calendar day; anything else as an instant.
|
|
20
|
+
- `formatDate` — a date column's value as text: takes the value, the column, a date style override, a show-time override and the viewer, and optionally the app's presentation (`useCellFormat`'s), so it reads as the cells do. The overrides win over the column's `format`. A date column, or a derived field whose result is a day, reads as a calendar day; anything else as an instant.
|
|
21
21
|
- `formatNumber` — a number as a column prints it, for a footer total that must match its cells: takes the value, the column and options that include the viewer. The column's format is read through `legacyNumberLikeFormat`, so a percent or currency column prints as one.
|
|
22
|
-
- `useCellFormat` — reads what the two formatters need from the provider: `{ viewer, presentation }`. The viewer is built from the provider's conventions and
|
|
22
|
+
- `useCellFormat` — reads what the two formatters need from the provider: `{ viewer, presentation }`. The viewer is built from the provider's conventions, wording and moment (`now`, absent until the provider has one), and kept while they stay the same; `presentation` is the provider's `presentation` applied to the defaults, or `undefined` when it has none.
|
|
23
23
|
- `resolveRowCurrency` — returns the options with `currency` set to the code this row's money value is in: the column's `currencyAccessor` answer for the row, else, for a column a currency field backs, the code its format names. The options come back unchanged when neither gives one.
|
|
24
24
|
|
|
25
25
|
## A column no registry field backs
|
|
@@ -204,6 +204,8 @@ Their stylesheets are `input.css`, `inline-input.css`, `field.css`, `toggle.css`
|
|
|
204
204
|
- `MenuListShown` — the same rows standing still on a page: `open` shows a level's rows beside it, `on` a row as under the pointer.
|
|
205
205
|
- `MenuListPanelRows` — a menu's rows in a panel that is no menu (a pane, a popover): one tab stop, ↑ ↓ wrapping, Home, End and a typed letter, Enter and Space press, → presses a row one level in, which `onOpen` hands its holder; `ticks` `box`, `switch` or `eye`; rows with a `grip` moved by it, the pointer or ↑ ↓ on it.
|
|
206
206
|
- `MenuListPanelRowsProps` — its props.
|
|
207
|
+
- `MenuListWords` — the words its rows with a grip and its Switches say: a grip's name, how the rows move on a computer and on a phone, a move said, a Switch's two words; handed as `words` to `MenuList` and `MenuListPanelRows`.
|
|
208
|
+
- `MENU_LIST_WORDS` — those words in English.
|
|
207
209
|
- `MenuListRow` — a name and its value as one row standing alone, at the list's own height and inset.
|
|
208
210
|
- `MenuScroll` — what scrolls in a menu's panel: its rows alone, the Scrollbar over them.
|
|
209
211
|
- `MenuEntry` — a row of a menu: an action, a link, a tick, a choice or actions one level in, a pick under a heading, a group, a separator.
|
|
@@ -300,7 +302,7 @@ Their stylesheets are `input.css`, `inline-input.css`, `field.css`, `toggle.css`
|
|
|
300
302
|
- `PickerDoing` — what its list is doing: `searching` or `failed`.
|
|
301
303
|
- `PickerLead` — the row that leads, where its field leads several.
|
|
302
304
|
- `PickerBoxSearch` — what a box that is its search is handed: its keys and what it holds.
|
|
303
|
-
- `PickerItem` — a row handed to it: its value, words, second line, group, level, menu, count.
|
|
305
|
+
- `PickerItem` — a row handed to it: its value, words, second line, group, level, menu, count, and the words its search also finds (`also`).
|
|
304
306
|
- `PickerAs` — what a row is drawn as: an Option, a Status, an Avatar, a sign or a mark.
|
|
305
307
|
- `PickerRow` — a row its list shows.
|
|
306
308
|
- `RowsInput` — what its rows are worked out from.
|
|
@@ -331,7 +333,25 @@ Their stylesheets are `input.css`, `inline-input.css`, `field.css`, `toggle.css`
|
|
|
331
333
|
- `chipsThatFit` — how many chips stand on its one line.
|
|
332
334
|
- `filledMatch` — the choice a browser's fill names.
|
|
333
335
|
|
|
334
|
-
<!-- The panels' block: the Pane, the toolbar button, the Radio, the sort editor, the views list, the Modal, the alert dialog, the Toast, the Collapsible, the Alert, the Notice -->
|
|
336
|
+
<!-- The panels' block: the Pane, the toolbar button, the Radio, the sort editor, the views list, the filter editor, the group editor, the Modal, the alert dialog, the Toast, the Collapsible, the Alert, the Notice -->
|
|
337
|
+
|
|
338
|
+
## The Pane
|
|
339
|
+
|
|
340
|
+
A list's panel at its right edge, on a computer, on Base UI's dialog, not modal: nothing is dimmed, the list stays in use beside it, and a press outside or the focus leaving never closes it. Escape closes it, unless it was pressed inside another popup over the list (a Menu, a Popover, a Select's list), or a control took the key; with two Panes open, an Escape outside both closes the one nearest the focus, else the one opened last. The focus lands on it as it opens and goes back to what opened it as it closes. Its stylesheet is `viewkitjs/views/controls/pane.css`; its options are `PANE_LOOKS`.
|
|
341
|
+
|
|
342
|
+
- `Pane` — the shell: `open`, `onOpenChange` (with `PaneChangeDetails`), `container` (the list's box it stands in: positioned, never scrolling; nothing is drawn while it is null), `opener`, `initialFocus`, `aria-label`, `className`, and what stands in it.
|
|
343
|
+
- `PaneProps` — its props.
|
|
344
|
+
- `PaneChangeDetails` — why it closed (`reason`) and the event.
|
|
345
|
+
- `PaneCloseReason` — `escape-key`, `close-press` or `none`.
|
|
346
|
+
- `PaneHead` — its head, at its top: what stands in it draws its title and ✕.
|
|
347
|
+
- `PaneBody` — what it holds, scrolling between its head and its foot, with its scrollbar.
|
|
348
|
+
- `PaneFoot` — its foot, under a line across the whole Pane.
|
|
349
|
+
- `PaneTitle` — its title, which names it to a screen reader.
|
|
350
|
+
- `PaneClose` — what closes it from inside (`render`, a Button), with the reason `close-press`.
|
|
351
|
+
- `usePane` — its holder: one thing in it at a time, `opens(key)` spread on each opener, `pane` spread on the Pane, `shown`, `close`.
|
|
352
|
+
- `paneAfter` — the holder's state after a press: an opener's key, or a close.
|
|
353
|
+
- `PaneState` — what stands in it, by its key, and what opened it last.
|
|
354
|
+
- `PanePress` — a press on an opener, or a close from inside.
|
|
335
355
|
|
|
336
356
|
## The Radio
|
|
337
357
|
|
|
@@ -342,6 +362,33 @@ One of a few choices, all of them in sight, on Base UI's radio group: the arrow
|
|
|
342
362
|
- `Radio` — one choice: its `value`, its `label` and `note` beside it, `card` drawn as a card, `mark` a mark in place of the ring on a marked card.
|
|
343
363
|
- `RadioProps` — its props.
|
|
344
364
|
|
|
365
|
+
## The sort editor
|
|
366
|
+
|
|
367
|
+
What a list's sort opens, Attio's: the view's rules in order, the first sorting first, three at most, one per field (a place by one of its parts). Every change is handed on as it is made, so the list sorts again at once. Its stylesheet is `viewkitjs/views/controls/sort-editor.css`; its root marks a phone from the device (`data-vk-phone`).
|
|
368
|
+
|
|
369
|
+
- `useSortEditorParts` — the editor's state and its parts (`SortEditorParts`): the `body`, and on a phone the Sheet head's ✕ and ✓, or on a step its Back (`head.onBack`) and its `title`. Its props (`SortEditorProps`): `label`, the `fields` (Picker rows, each with its mark; one leading one level in holds its own), the `rules`, `onRulesChange` (the whole rules, and the set-aside sorts left when one of them is written), `max`, `form` (`computer`, `phone`, or `narrow`: the phone's structure at a computer's sizes, for a narrow place), `onDone`, the fields' `search` words, `aside` (the sorts set aside, `SortAside`s), `fieldOf` (the field a sort key sorts, so a place sorts once by one of its parts), `addSort` (Add sort at a computer's foot, true unless said), `words`, and for a page standing still `lifted`, `opens` (`SortEditorOpens`) and `level`. On a computer each rule is its grip, its field's and its direction's Select, and ×, with Add sort and Clear all sorts at the foot; the set-aside sorts follow, each its field's box dashed in the warning colour with why, its direction greyed, ⋯ holding why, Put back and Delete. On a phone each rule is a card row, its direction under its name; a press turns the body to its direction, Add sort to the fields, a set-aside sort's row to the fields to point it at one: steps of the same sheet, never a sheet on top. The body answers no Escape: its holder's sheet does. Its hook joins this door as `useSortEditor`, and the body alone as `SortEditor`, once VK-727 retires the panels' older sort editor of those names.
|
|
370
|
+
- `SortEditorProps` — its props.
|
|
371
|
+
- `SortEditorParts` — its parts: the body, the head's buttons, and on a phone's step its title and Back.
|
|
372
|
+
- `SortEditorOpens` — what a page shows standing open: a rule's field or direction, by its place.
|
|
373
|
+
- `sortableFields` — the fields as the list's Sort offers them to add a rule: those another rule sorts greyed with "Sorted", one level in too.
|
|
374
|
+
- `SORT_MAX` — how many rules a view sorts by, at most: three.
|
|
375
|
+
- `addSort` — the rules with one more at their end, sorting by a field, ascending.
|
|
376
|
+
- `canAddSort` — whether another rule can be added: fewer than its `max`.
|
|
377
|
+
- `sortedFields` — the fields the rules sort by already, each as `fieldOf` names it.
|
|
378
|
+
- `takenBy` — whether another rule than the one on `own` already sorts a field.
|
|
379
|
+
- `sortLabel` — the sort as the bar names it: its first rule's field, by its path ("Company › Region"), and how many follow.
|
|
380
|
+
- `SortAside` — a sort set aside: its stored field key, its words, its direction, why in words, and the key it sorts by once put back.
|
|
381
|
+
- `openPlaces` — how many rules fit: `max` less the sorts set aside.
|
|
382
|
+
- `repoint` — a set-aside sort pointed at a field: a rule on it, in its direction, at the end; null where another rule sorts that field.
|
|
383
|
+
- `putBack` — a set-aside sort put back on its own field; null while it doesn't fit.
|
|
384
|
+
- `dropAside` — the sorts set aside without one.
|
|
385
|
+
- `FieldOf` — the field a sort key sorts: a place's part key sorts its place.
|
|
386
|
+
- `SORT_EDITOR_WORDS` — its words in English.
|
|
387
|
+
- `sortWords` — its words: the handed ones over the English.
|
|
388
|
+
- `SortEditorWords` — its words' shape.
|
|
389
|
+
|
|
390
|
+
`CONTROLS.SortBody` draws ViewKit's sort body with it: the rules as data, every change handed back whole, the set-aside sorts as rows of their own, `addSort` honoured, a place's parts sorted once, a phone's step told to the sheet (`onStepChange`), and under `sheetActions: "bar"` its own head (✕, the title, ✓; on a step Back and the step's title). Every word is the app's, from its messages.
|
|
391
|
+
|
|
345
392
|
## The views list
|
|
346
393
|
|
|
347
394
|
What the view switcher opens: the Picker over a list's views, each its layout's mark, its name and its count where handed, the open one held (in its place on a phone too), ↓ and ↑ going on from it. A press opens a view and closes the list; a press and drag (on a phone after a hold) or ⌥↑ ⌥↓ moves one among the views under its heading. Its holder hands each view's menu and New view. Where private views are on, Shared and Just me head the views and a private view wears a lock. Its stylesheet is `viewkitjs/views/controls/views-list.css`; its root marks a phone from the device (`data-vk-phone`). Its options are on `viewkitjs/views/looks` (`VIEWS_LIST_LOOKS`). Its props, `ViewsListProps`, stay inside the controls part until VK-727: `viewkitjs/views/react` already exports an atom by that name.
|
|
@@ -366,6 +413,165 @@ What the view switcher opens: the Picker over a list's views, each its layout's
|
|
|
366
413
|
|
|
367
414
|
`CONTROLS.ViewsListBody` draws it where the view switcher opens: the axis's views, each its glyph by your `AppIcon`, its count and its menu rows as the Menu's (a row with no reason it can't be used says your `views.menus.not-now`), New view from `onCreate` in the axis's word, an order handed to `onReorder` as one whole block and never one that moves a view `canDrag` refuses, Shared and the reader's own wherever a view is private, and every word your messages'. It is internal: `CONTROLS` is the way in.
|
|
368
415
|
|
|
416
|
+
## The filter editor
|
|
417
|
+
|
|
418
|
+
What an advanced filter opens on a computer and Filter on a phone, Attio's: the view's rules, each Where or its level's join, its field, how it compares and its value in its type's own box, joined by And or Or, in groups three deep; and the filter part, what a filter's way and value open on the bar. A body, as the sort editor is: the Popover holds it on a computer and the Sheet on a phone. Every word is handed (`words`). Its stylesheet is `viewkitjs/views/controls/filter-editor.css`; its root marks a phone from the device (`data-vk-phone`).
|
|
419
|
+
|
|
420
|
+
- `useFilterEditorParts` — the editor's state and its parts (`FilterEditorParts`): the `body`, and on a phone the Sheet head's ✕ and ✓, or on a step its Back (`head.onBack`) and its `title`. Its props (`FilterEditorProps`): `label`, the `fields` (each typed, a choice's values with it; one leading one level in holds its own), the `filter`, `onFilterChange`, `at`, `ids`, `levels`, `form` (`computer`, `phone`, or `narrow`), `onDone`, `standing`, `own` (ViewKit's own words and value body for a rule the kit has no box for) and `words`. On a phone each box's list, a date, a value ViewKit draws and Add filter turn the body to a step of the same sheet, never a sheet on top; the body answers no Escape: its holder's sheet does. Its hook joins this door as `useFilterEditor`, and the body alone as `FilterEditor`, once VK-727 retires the panels' older filter editor of that name.
|
|
421
|
+
- `FilterEditorProps` — its props.
|
|
422
|
+
- `FilterEditorParts` — its parts: the body, the head's buttons, and on a phone's step its title and Back.
|
|
423
|
+
- `FilterOwn` — ViewKit's own words and value body for a rule: its field's words, its way's word, its value's words, its value body.
|
|
424
|
+
- `FilterPartBody` — what a part of a filter on the bar opens: the fields, its type's ways, or its value in its type's own.
|
|
425
|
+
- `FilterPartProps` — its props: `part`, `rule`, `label`, `fields`, `filter`, `onFilterChange`, `onDone`, `own`, `form` and `words`.
|
|
426
|
+
- `FilterPart` — which part was pressed: `field`, `how` or `value`.
|
|
427
|
+
- `PairValue` — a range's From and To: two Number fields, an en dash between.
|
|
428
|
+
- `valuePlaceholder` — what a filter's value says while it has none, by its field's type.
|
|
429
|
+
- `FILTER_SEARCH` — the fields' search, in English.
|
|
430
|
+
- `HOW` — each type's ways, in the order they are offered, the first a new rule's.
|
|
431
|
+
- `CHECKED` — a yes/no's two values, Checked and Unchecked.
|
|
432
|
+
- `wayOf` — a type's way by its value.
|
|
433
|
+
- `FilterField` — a field a list filters by: a Picker row with its type, a choice's values, a related record's fields one level in.
|
|
434
|
+
- `FilterWay` — one way a type compares: its value, its words, what it takes.
|
|
435
|
+
- `Takes` — what a way takes: one value, several, two, or none.
|
|
436
|
+
- `FILTER_DEPTH` — how many levels deep rules stand at most: three.
|
|
437
|
+
- `NO_FILTER` — the filter with nothing in it.
|
|
438
|
+
- `OWN_WAY` — the prefix of a way only ViewKit words (`vk:<operator>`).
|
|
439
|
+
- `isOwnWay` — whether a rule's way is one only ViewKit words.
|
|
440
|
+
- `addRule` — a rule on a field, its type's first way and no value, added at a group's end.
|
|
441
|
+
- `removeRule` — the filter with a rule or group taken away, any group left empty with it.
|
|
442
|
+
- `changeRule` — a rule changed: its field, its way, or its value.
|
|
443
|
+
- `clearAll` — the filter with nothing in it, its id and join kept.
|
|
444
|
+
- `setJoin` — a level's join, which is every join at its level.
|
|
445
|
+
- `toGroup` — a rule turned into a group of its own.
|
|
446
|
+
- `canGroup` — whether a rule can become a group.
|
|
447
|
+
- `depthOf` — how many levels hold an item.
|
|
448
|
+
- `idsOf` — every id in the filter.
|
|
449
|
+
- `itemOf` — a rule or group by its id.
|
|
450
|
+
- `fieldOf` — the field a rule reads.
|
|
451
|
+
- `rulesOf` — every rule, in order, groups opened.
|
|
452
|
+
- `takesOf` — what a rule's way takes.
|
|
453
|
+
- `isWhole` — whether a rule narrows the list.
|
|
454
|
+
- `isSetAside` — whether a rule is set aside.
|
|
455
|
+
- `isPair` — whether a value is a range's From and To.
|
|
456
|
+
- `isGroup` — whether an item is a group.
|
|
457
|
+
- `isAdvanced` — whether the filter is advanced: an Or between its rules, or a group in it.
|
|
458
|
+
- `barOf` — the filter as the bar reads it: each rule at its own level plain, each group there advanced.
|
|
459
|
+
- `BarFilter` — a filter as the bar shows it.
|
|
460
|
+
- `toAdvanced` — a plain filter turned advanced.
|
|
461
|
+
- `setGroup` — an advanced filter put back, as its editor changed it.
|
|
462
|
+
- `valueText` — a rule's value in words.
|
|
463
|
+
- `ruleText` — a rule in words.
|
|
464
|
+
- `FilterAside` — a rule ViewKit set aside, in words: its field's name, why, and whether it can be put back.
|
|
465
|
+
- `FILTER_EDITOR_WORDS` — its words in English.
|
|
466
|
+
- `filterWords` — its words: the handed ones over the English.
|
|
467
|
+
- `FilterEditorWords` — its words' shape.
|
|
468
|
+
|
|
469
|
+
`CONTROLS.FilterBody` draws ViewKit's filter body with it: the level as data, every change handed back whole, a choice's values from each field's `options`, a set-aside rule in its place saying why, ViewKit's own words and value body for a way the kit has no word for, a field it doesn't list or a choice with no values, a phone's step told to the sheet (`onStepChange`), and under `sheetActions: "bar"` its own head (✕, the title, ✓; on a step Back and the step's title). `CONTROLS.FilterPartBody` draws a filter's way and value with the filter part, ViewKit's ways and own value body for a rule the kit draws no part of. Every word is the app's, from its messages. Both are internal: `CONTROLS` is the way in.
|
|
470
|
+
|
|
471
|
+
## The group editor
|
|
472
|
+
|
|
473
|
+
What Customize's Group opens: the list's group as the Menu list's rows. Group by, Order, Direction, a date field's Date step and Hide empty groups, each saying what it is and opening its choices in place; then the groups under their heading, each its grip, its name and its Switch, dragged into your own order, Hide all (Show all once none shows) at the heading; Remove grouping at its foot. A body: Customize holds it, a screen in its panel on a computer and a step of its sheet on a phone. A setting's choices stand in place of the settings, and the editor hands their name and the way back to its holder (`level`), whose head shows them. Every word is handed (`words`). Its stylesheet is `viewkitjs/views/controls/group-editor.css`; its root marks a phone from the device (`data-vk-phone`).
|
|
474
|
+
|
|
475
|
+
- `useGroupEditor` — the editor's state and its parts (`GroupEditorParts`): the `body`, and the `level` it stands on. Its props (`GroupEditorProps`): `label`, the `fields` (Picker rows; one leading one level in holds its own), `ownOrders` (a field's own order, in its words), `orders` (the orders each field offers), `manualOrder` (whether Your own may be picked), `steps` (each date field's steps), the `group`, the groups as `values` (each with its count), `onGroupChange` (the whole group, null once taken off), `search`, `form`, `words`, and for a page standing still `opens` and `opensLevel`. The body alone, `GroupEditor`, joins this door with VK-727, beside the other panels' bodies.
|
|
476
|
+
- `GroupEditorProps` — its props.
|
|
477
|
+
- `GroupEditorParts` — its parts: the body, and the level it stands on (its name and the way back), null at the settings.
|
|
478
|
+
- `GroupEditorValue` — a group as the editor draws it: its value, its name, its mark, its count.
|
|
479
|
+
- `GroupEditorLevel` — a setting's choices: Group by's fields, Order's, Direction's or a date's steps.
|
|
480
|
+
- `GroupOrder` — an order: the field's own, by name, by count, your own.
|
|
481
|
+
- `GroupDirection` — ascending or descending.
|
|
482
|
+
- `GroupValue` — a group: its value, its name, how many records it holds.
|
|
483
|
+
- `startGroup` — a new group by a field: its own order where it has one, else by name; ascending; a date's step held.
|
|
484
|
+
- `groupOrders` — the orders a field offers: its own first, then Name, Count and Your own; only those offered.
|
|
485
|
+
- `orderedGroups` — the groups in the order the list shows them.
|
|
486
|
+
- `moveGroup` — a group moved among the groups as the list shows them: the order becomes your own.
|
|
487
|
+
- `setGroupShown` — a group shown or hidden by its Switch.
|
|
488
|
+
- `hideAllGroups` — every group hidden.
|
|
489
|
+
- `showAllGroups` — every group shown.
|
|
490
|
+
- `noneShown` — whether no group shows.
|
|
491
|
+
- `directionTurns` — whether Direction turns the order: every order but your own.
|
|
492
|
+
- `groupLabel` — the group as its row names it: its field, one level in by its path; none, None.
|
|
493
|
+
- `GROUP_EDITOR_WORDS` — its words in English.
|
|
494
|
+
- `groupWords` — its words: the handed ones over the English.
|
|
495
|
+
- `GroupEditorWords` — its words' shape.
|
|
496
|
+
|
|
497
|
+
`CONTROLS.GroupBody` draws ViewKit's group body with it: the group as one value, every change handed back as one write, the orders each field offers, Your own where the list offers it, a date field's steps, each group's count (`ViewsGroupEntry.count`) for its Count order, and its level told to what holds it (`onStepChange`), which ViewKit's Customize shows in its head. Every word is the app's, from its messages. It is internal: `CONTROLS` is the way in.
|
|
498
|
+
|
|
499
|
+
## The Modal
|
|
500
|
+
|
|
501
|
+
What holds a form, a quick create or a long read in the middle of the screen, on Base UI's dialog: it traps the focus, which starts on the first box it holds, and Escape, its X, Cancel and a press outside are its ways out. With unsaved changes every way out asks first, in an alert dialog over it; while its action works nothing closes it, and if the work throws it stays open and says what went wrong in a Notice. Opened from inside a Popover, it stands over it. On a phone it is the Sheet at full height, Cancel and its action in the head. Its stylesheet is `viewkitjs/views/controls/modal.css`; its options and looks are `MODAL_LOOKS`.
|
|
502
|
+
|
|
503
|
+
- `Modal` — `open`, `onOpenChange`, `title`, `mark`, `path`, `onOpenAsPage`, `size` (`sm`, `md`, `lg` or `xl`), `foot` (`both`, `action` or `none`), `action` (`ModalAction`), `cancel` ("Cancel" unless said), `footStart`, `dirty`, `state` and `failed` (shown as they stand, on a page that shows one), `container`, `standing`, what it holds, and `words`.
|
|
504
|
+
- `ModalProps` — its props.
|
|
505
|
+
- `ModalAction` — what its foot confirms: `label`, `kind` (`primary` or `danger`), `disabled`, and the work it starts (`run`).
|
|
506
|
+
- `ModalSize` — how wide it stands.
|
|
507
|
+
- `ModalFoot` — what its foot holds.
|
|
508
|
+
- `ModalState` — `rest`, `saving` or `failed`.
|
|
509
|
+
- `MODAL_WORDS` — its words in English: its head's Close and Open as a page, what a failure says when its work threw no words, and the discard question's title, line and answers.
|
|
510
|
+
- `ModalWords` — its words' shape.
|
|
511
|
+
|
|
512
|
+
## The alert dialog
|
|
513
|
+
|
|
514
|
+
The panel an Alert stands in, over the page, on Base UI's alert dialog: it traps the focus, which starts on Cancel; a press outside does nothing; Escape is its way out, answering no; only the Alert's action confirms. While its action's work runs nothing else can be pressed; if it throws, it stays open and says what went wrong. On a phone it is its panel, with an X of its own where the frame shows one, or a Sheet where the Alert's Opens as is `sheet` (`data-alert-phone`). Its stylesheet is `viewkitjs/views/controls/alert-dialog.css`; its options are `ALERT_DIALOG_LOOKS`.
|
|
515
|
+
|
|
516
|
+
- `AlertDialog` — what it asks (an `AlertAsk`), `open`, `onAnswer` (true for the action, false for every way out), `state` and `failed` (shown as they stand, on a page that shows one), `container`, `standing`, and `words`.
|
|
517
|
+
- `AlertDialogProps` — its props.
|
|
518
|
+
- `AlertDialogPanel` — the panel alone, round what it holds: what's behind it, the panel in the middle of the screen, and its X on a phone, named by its `close` ("Close" unless said).
|
|
519
|
+
- `AlertDialogPanelProps` — its props.
|
|
520
|
+
- `confirm` — asks from anywhere, through the one `AlertDialogHost`: a promise, true for its action, false for every way out. One question at a time: a newer one takes the place of the open one, whose asker hears false.
|
|
521
|
+
- `AlertDialogHost` — where `confirm()` shows: put it in the app once. Its `words`.
|
|
522
|
+
- `ALERT_DIALOG_WORDS` — its words in English: Close, what a failure says when its work threw no words, and Try again.
|
|
523
|
+
- `AlertDialogWords` — its words' shape.
|
|
524
|
+
|
|
525
|
+
## The Toast
|
|
526
|
+
|
|
527
|
+
What just happened, said for a moment at the bottom of the screen, on Base UI's toast: announced without taking the focus, it leaves after its time (`--vk-toast-duration`, four seconds where nothing declares it), and the pointer or the keyboard on it holds the time. One at a time: a new toast takes the place of the one showing, and a working one turns into its result where it stands. Undo puts the thing back and closes it at once; ⌘Z does the same while it shows, unless the keys are typing into a field; Escape closes it. Its stylesheet is `viewkitjs/views/controls/toast.css`.
|
|
528
|
+
|
|
529
|
+
- `Toast` — where toasts are made and rise: put it round the app once. `inside` (at the bottom of the element round it instead), `manager` (show what a `ToastManager` sends), `stack` (several, the newest in front), and `words`.
|
|
530
|
+
- `useToast` — shows a toast (`ToastOptions`), and hands back its id.
|
|
531
|
+
- `ToastOptions` — `words` (what just happened), `title`, `undo`, `action` with `onAction`, `working`, `failed`, `meaning` (a Notice's), `closable` and `duration`.
|
|
532
|
+
- `createToastManager` — toasts called from anywhere, outside React: `show`, `update`, `close`, `promise`; give it to the `Toast` that shows them. It takes the words too.
|
|
533
|
+
- `ToastManager` — its shape.
|
|
534
|
+
- `ToastShown` — a toast standing still on a page that shows how it looks: it never times out or moves. Its words are its `said`, since its `words` are what it says.
|
|
535
|
+
- `TOAST_WORDS` — its words in English: Undo, Close.
|
|
536
|
+
- `ToastWords` — its words' shape.
|
|
537
|
+
|
|
538
|
+
## The Collapsible
|
|
539
|
+
|
|
540
|
+
One part that opens and closes in place, under its trigger or set open from outside, on Base UI's collapsible: the trigger says whether its part is open and which part it opens, Enter and Space press it, and a closed part leaves the page unless it is kept for the browser's find. Its height moves from nothing to what it holds, easing out both ways, its time following its height; under reduced motion it opens and closes at once. Its stylesheet is `viewkitjs/views/controls/collapsible.css`; its root marks a phone from the device (`data-vk-phone`), where its trigger is 44 high; its options are `COLLAPSIBLE_LOOKS`.
|
|
541
|
+
|
|
542
|
+
- `Collapsible` — the part and its trigger: `open` with `onOpenChange` when set from outside, `defaultOpen` when it keeps its own state, `disabled`, `className`.
|
|
543
|
+
- `CollapsibleProps` — its props.
|
|
544
|
+
- `CollapsibleTrigger` — what opens and closes it, plain: its name after a chevron, which turns down while the part is open; `render` hands your own element, which keeps its look and gains the behaviour.
|
|
545
|
+
- `CollapsibleTriggerProps` — its props.
|
|
546
|
+
- `CollapsiblePanel` — the part: the box that crops it while its height moves (`clipClassName`), and what it holds inside (`className`); `durationMs` an app's own time, both ways; `hiddenUntilFound` keeps it on the page for the browser's find.
|
|
547
|
+
- `CollapsiblePanelProps` — its props.
|
|
548
|
+
|
|
549
|
+
`CONTROLS.Collapse` draws ViewKit's folds (a grid's group, a field's note, the selection sheet's groups) as the Collapsible's part, set open from outside, so an app that spreads `CONTROLS` hands no `Collapse`.
|
|
550
|
+
|
|
551
|
+
## The Alert
|
|
552
|
+
|
|
553
|
+
What an app asks before something happens: its title says what it asks, a line what follows, and its two answers are the way out and the action, the only one that confirms. It knows no shell: the alert dialog stands it in its panel, or on a phone in a Sheet. Its stylesheet is `viewkitjs/views/controls/alert.css`; its options are `ALERT_LOOKS`.
|
|
554
|
+
|
|
555
|
+
- `Alert` — `title`, `line`, `action` (its word), `kind` (its colour: `primary`, `information`, `success`, `warning` or `danger`), `cancel` ("Cancel" unless said), `icon`, `onAnswer` (true for the action, false for the way out), `state`, `failed` (what went wrong, in its line's place), `phone`, `shell` (`panel` or `sheet`), `cancelRef`, `Title` and `Line` (the elements its title and line are drawn as), and `words`.
|
|
556
|
+
- `AlertProps` — its props.
|
|
557
|
+
- `AlertAsk` — what one asks: its title, line, action, kind, cancel, icon and the work its action starts (`run`).
|
|
558
|
+
- `AlertKind` — its action's colour.
|
|
559
|
+
- `AlertState` — `rest`, `working` (nothing else can be pressed) or `failed` (it stays open and says so).
|
|
560
|
+
- `ALERT_WORDS` — its words in English: Try again.
|
|
561
|
+
- `AlertWords` — its words' shape.
|
|
562
|
+
|
|
563
|
+
## The Notice
|
|
564
|
+
|
|
565
|
+
A sentence set into the page on its meaning's ground: worth knowing, done, careful, wrong, or a plain fact with no colour of its own. It is part of the page, there when the page is, fading in only when it arrives because of something just done; put away or resolved, it fades out and its space closes. Its stylesheet is `viewkitjs/views/controls/notice.css`; its root marks a phone from the device (`data-vk-phone`), where its actions drop under the sentence.
|
|
566
|
+
|
|
567
|
+
- `Notice` — `meaning` (`information`, the default, `success`, `warning`, `danger` or `neutral`), `icon` (its own, or false for none), `title`, the sentence as its children, `actions` (at most two: `{ label, onClick }` for the text Button, or any element), `onRetry` (Retry first among them, Retrying… while it works, the notice going once it does), `dismissible` with `onDismiss` (× at its end), `urgent` (read out at once, `role="alert"`), `arrived` (it fades in), `className`, and `words`.
|
|
568
|
+
- `NoticeProps` — its props.
|
|
569
|
+
- `NoticeMeaning` — `information`, `success`, `warning` or `danger`.
|
|
570
|
+
- `NoticeAction` — an action drawn from its words: `{ label, onClick }`.
|
|
571
|
+
- `NOTICE_ICONS` — each meaning's icon, as its paths: the Alert and the Toast draw their marks with them too.
|
|
572
|
+
- `NOTICE_WORDS` — its words in English: Retry, Retrying…, Dismiss.
|
|
573
|
+
- `NoticeWords` — its words' shape.
|
|
574
|
+
|
|
369
575
|
<!-- The editors' block: the Text editor, the Picker, the Date editor, the Compound editor, the Number editor, the Values editor, the Links editor -->
|
|
370
576
|
|
|
371
577
|
## The Text editor
|
|
@@ -445,7 +651,7 @@ Its stylesheet is `viewkitjs/views/controls/text-editor.css`, beside the inline
|
|
|
445
651
|
- `addDays` — a day moved by a number of days.
|
|
446
652
|
- `addMonths` — a day moved by a number of months, kept inside the month it lands in.
|
|
447
653
|
- `weekday` — 0 for Monday to 6 for Sunday.
|
|
448
|
-
- `todayOf` — today, in the browser's own day.
|
|
654
|
+
- `todayOf` — today, in the browser's own day, or at the moment handed.
|
|
449
655
|
- `DateSegment` — a part: `day`, `month`, `year`, `hour`, `minute`.
|
|
450
656
|
- `DateSegments` — the parts' values, each a number or null.
|
|
451
657
|
- `segmentRange` — a part's least and greatest.
|
|
@@ -512,7 +718,7 @@ A name's `NameValue` and `sameName`, and a range's `rangeText`, stay inside the
|
|
|
512
718
|
|
|
513
719
|
## The Number editor
|
|
514
720
|
|
|
515
|
-
`CONTROLS` fills its `NumberBody` with the Number editor: ViewKit's number, money and percent bodies, held as a shell that keeps the draft. A number types into the number field inline, over its cell, its up and down arrows at its end while it is edited; money's code stands before the amount, a press away from a
|
|
721
|
+
`CONTROLS` fills its `NumberBody` with the Number editor: ViewKit's number, money and percent bodies, held as a shell that keeps the draft. A number types into the number field inline, over its cell, its up and down arrows at its end while it is edited; money's code stands before the amount, a press away from a list of each currency's sign and name in the conventions' language, found by its name or its code, ↓ there going on from the currency held; a number's unit the same; a percent shows its %. Home and End move the cursor. On a phone the Sheet holds the number field with the number pad, the currencies a step of the Sheet (`onStepChange`). ViewKit's number editor keeps the draft, the rounding to the field's decimals, Escape, Tab, the check, the empty rule and the save; a refusal is the host's to show. A duration keeps ViewKit's own box.
|
|
516
722
|
|
|
517
723
|
- `useNumberEditor` — the Number editor, as the parts a shell pours in: its `body`, and on a phone the Sheet head's buttons (`head`) and the currencies' step `title`. Standing alone (`draft: "own"`, the default) it keeps on Enter or a press elsewhere and leaves on Escape, and on a phone hands its head ✕ and ✓; held (`draft: "shell"`) it hands every change as it is read and keeps nothing.
|
|
518
724
|
- `useNumberEditorWorn` — the options worn round the body, read again as they change: a ref for its root, and what it wears.
|
|
@@ -563,12 +769,12 @@ The body alone, as `NumberEditor`, stays inside the editor until the editors' ol
|
|
|
563
769
|
The grip's `moved` and `dragAt`, the list a shell is handed (`handedList`) and the shapes of the label words and the line's read stay inside it. Its stylesheet is `viewkitjs/views/controls/values-editor.css`, beside those of the controls it draws with; its names are on [its page](../controls/values-editor.md).
|
|
564
770
|
## The Links editor
|
|
565
771
|
|
|
566
|
-
`CONTROLS` fills its `LinksBody` with the Links editor: ViewKit's links body, for a relation holding several records whose field declares `links`. On a computer the search stands on top, the linked records under the field's name, Roles and Lead (a link's roles in a short button opening the Picker to tick them, the lead a radio, ✕ to unlink), then a line and the records to add under Add, ↑ ↓ lighting one and Enter linking it last; on a phone a card per link (its roles a row opening them
|
|
772
|
+
`CONTROLS` fills its `LinksBody` with the Links editor: ViewKit's links body, for a relation holding several records whose field declares `links`. On a computer the search stands on top, the linked records under the field's name, Roles and Lead (a link's roles in a short button opening the Picker to tick them, the lead a radio, ✕ to unlink), then a line and the records to add under Add, ↑ ↓ lighting one and Enter linking it last; on a phone a card per link (its roles a row opening them as a step of the Sheet, with Back, told to ViewKit as `onStepChange`, its ⋯ making it the lead or unlinking it), the records to add in a card under it and the search at the Sheet's foot. ViewKit keeps the set, the lead first on save, Escape, Tab, the save on close and the phone's ✕ and ✓; the editor hands every change as it is made, every query back to ViewKit (which filters or fetches), and draws its searching and failed lines, more records as the list's end comes into sight, and the create rows. A field that declares no roles has no Roles column. Its stylesheet is `viewkitjs/views/controls/links-editor.css`; its words are the app's, from its messages. With several fields on a link (an app's own use of the body), each column reads as words and a link's fields open as a step on a computer, and as a step of the Sheet on a phone.
|
|
567
773
|
|
|
568
774
|
- `LinksEditor` — the body alone, for a shell that holds only a body.
|
|
569
|
-
- `useLinksEditor` — its state and the parts a shell pours in: the body, and on a phone the Sheet head's ✕ and
|
|
775
|
+
- `useLinksEditor` — its state and the parts a shell pours in: the body, and on a phone the Sheet head's ✕ and ✓, or a step's Back, and a step's `title`; a shell that draws its own Sheet takes Escape on a step as Back (`head.onBack`).
|
|
570
776
|
- `LinksEditorProps` — its props (a link's own type, `Link`, stays inside the editor, named `LinksEditorProps["links"][number]`): the field's name (`label`), its records' kind (`kind`, the first column's name), the records (`records`, Picker rows), the fields a link holds (`fields`), the links (`links`), each change (`onLinksChange`), the lead (`lead`), the search's words (`search`), `form`, `onDone`, `autoFocus`, a page's state (`typed`, `opens`), its `words`, and a list its editor finds (`onSearch`, `doing`, `onRetry`, `onMore`, `actions`).
|
|
571
|
-
- `LinksEditorParts` — what it hands a shell
|
|
777
|
+
- `LinksEditorParts` — what it hands a shell: its `body`, its phone `head` and a step's `title`.
|
|
572
778
|
- `LinksEditorLead` — which link leads, a way to set it, and its column's name.
|
|
573
779
|
- `LinksEditorOpens` — what a page shows standing open: a field's list on a link, or a link's fields.
|
|
574
780
|
- `LinksEditorAction` — a row that does something rather than link: its key, its words, a mark, and what it does.
|
|
@@ -33,8 +33,8 @@ Guide: [display](../guides/display.md).
|
|
|
33
33
|
|
|
34
34
|
## The viewer and the presentation
|
|
35
35
|
|
|
36
|
-
- `FieldViewerContext` — who is reading: `locale`, `now
|
|
37
|
-
- `viewerFrom` — builds a `FieldViewerContext` from your conventions: their locale, names language, zone, region and messages, with the package's words (`resolveViewsMessage` unless you pass a resolver) and `now` (the current moment unless you pass one).
|
|
36
|
+
- `FieldViewerContext` — who is reading: `locale`, and optionally `now` (the moment relative dates count from; absent before the provider has one), `language` (the names language a place's country is written in; `locale` when absent), `timeZone`, `region` (a phone of that country is written as at home), `fieldMessages` (fields' words, fields' English by default) and `messages` (the package's words, its English by default).
|
|
37
|
+
- `viewerFrom` — builds a `FieldViewerContext` from your conventions: their locale, names language, zone, region and messages, with the package's words (`resolveViewsMessage` unless you pass a resolver) and `now` (the current moment unless you pass one; `null`, a viewer with no moment yet, whose relative dates draw in full).
|
|
38
38
|
- `FieldPresentation` — every formatter a value is printed through, so your app can replace how numbers, durations and dates read: `message`, `number`, `duration`, `calendarDay`, `instant`, `relativeCalendarDay` and `relativeInstant`, each handed the viewer. The provider's `presentation` option returns one, given the defaults.
|
|
39
39
|
- `DEFAULT_FIELD_PRESENTATION` — the package's own `FieldPresentation`. Numbers print through `Intl.NumberFormat` in the viewer's locale; a percent, stored as 0 to 100, prints as it is with `%`; a currency defaults to `EUR` with two decimals. Days print `short` ("27 Sep", the year added when it is not the current one), `long` ("27 September 2026") or `numeric` ("27/09/2026"), a time ("14:05") after a comma, in the viewer's zone. Relative styles say "just now", "5m ago", "in 1d", and "today", "yesterday" or "tomorrow" for a day. Month names and relative words come from the viewer's messages.
|
|
40
40
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# `viewkitjs/views/editors/relation`
|
|
2
2
|
|
|
3
|
-
Import from `viewkitjs/views/editors/relation` in a client component: the door opens with the client directive. It holds the picker for a link, the editor of a `relation` and a `user` field: search the candidates, pick one, and it replaces the link; and the editor of a relation holding several records, which adds and removes links with the list open. The candidates are the host's, through a `RelationSource`: a static list the panel filters on its labels, or a remote search your function answers a page at a time. The panel owns the search box, the rows, the paging (it waits before a typed query searches, drops an answer a newer query superseded, asks for the next page as the end of the list scrolls into view, and says
|
|
3
|
+
Import from `viewkitjs/views/editors/relation` in a client component: the door opens with the client directive. It holds the picker for a link, the editor of a `relation` and a `user` field: search the candidates, pick one, and it replaces the link; and the editor of a relation holding several records, which adds and removes links with the list open. The candidates are the host's, through a `RelationSource`: a static list the panel filters on its labels, or a remote search your function answers a page at a time. The panel owns the search box, the rows, the paging (it waits before a typed query searches, drops an answer a newer query superseded, asks for the next page as the end of the list scrolls into view, and says it is searching from the keystroke until the typed query answers, so an Enter meanwhile picks nothing, and when it failed or found nothing) and, in `RelationEditor`, what a close means: a pick is the commit, every other close discards (`RelationSetEditor` saves on every close but Escape). It never does the asking itself, so access stays in your function's closure. Its host owns the popover, the anchor and the write. It commits the picked id, or null for None. The door also re-exports `RelationCandidate`, `RelationSearch` and `RelationSource`, which are documented with the root door. Guide: [editors](../guides/editors.md).
|
|
4
4
|
|
|
5
5
|
- `RelationEditor` — the relation-picking panel, built from your app's command list, or opened in your app's `Picker` when the provider has one (the list filtered or fetched by the editor, the create rows as its `actions`); its ref is a `RelationEditorHandle`. It takes `candidates` (the `RelationSource`), `initial` (the linked id, or null), `clearable` (a None row for a link the surface says is optional, hidden while a query is typed), `onRequestClose` (called with `pick` when someone chooses), `kindGlyph` (the glyph worn by every candidate with no icon of its own; given, every row keeps a glyph lane so the labels line up), `noneLabel` (the surface's words for the None row), `message` (the fields message resolver, defaulting to the provider's conventions), `creates` (`RelationCreate` rows pinned under the list), `seed` (the text the search opens with, such as a letter typed on the cell that opened it), `label` (the field's name, for your `Picker`; default the search's words) and `focusSearch` (put the caret in the search as the panel opens, without scrolling; off by default, and left off on a phone so its sheet opens with the keyboard down). The list opens with the linked record highlighted, so an Enter pressed at once changes nothing; when a remote page doesn't hold it, nothing is highlighted until a key or typed text moves the highlight; with nothing linked, None or the first candidate; opened with a `seed`, the first match. It asks your command list for that through its root's `defaultValue`; a list that ignores it opens on its first row. A candidate's `sublabel` draws as a muted second line and its `badge` as a small chip at the row's end.
|
|
6
6
|
- `RelationEditorHandle` — what the host's ref reads: `resolveClose(reason)`, synchronous and safe to ask twice. It answers `commit` with the picked id, or null for None, only for `pick` and only when it differs from `initial`; `noop` for a `pick` with nothing picked or the link already held; `cancel` for every other reason.
|
|
@@ -104,8 +104,18 @@ on a frame round the controls as `data-<piece>-*`, which each control's styleshe
|
|
|
104
104
|
|
|
105
105
|
<!-- The panels' block: the Pane, the toolbar button, the Radio, the sort editor, the views list, the Modal, the alert dialog, the Toast, the Collapsible, the Alert, the Notice -->
|
|
106
106
|
|
|
107
|
+
- `PANE_LOOKS` — the Pane's: 7 options, each a computer's (`place`, `list` or `fit`; `corners`, `lg`, `xl` or `2xl`; `smoothing`, `round` or `smooth`; `shadow`, `none`, `menu`, `lg` or `xl`; `edge`, `outline`, `subtle` or `none`; `gap`, `0` to `16`, `8` the default (My preset's); `padding`, `0` to `16`), and no looks.
|
|
108
|
+
- `PaneOptionId` — its option ids.
|
|
107
109
|
- `VIEWS_LIST_LOOKS` — the views list's: 2 options (`private`, Private views: Shared and Just me, a private view's lock, and a view's menu's Private view; `favorites`, a view's menu's Favorite), each `off` (the default, My preset's) or `on`, and no looks.
|
|
108
110
|
- `ViewsListOptionId` — its option ids.
|
|
111
|
+
- `MODAL_LOOKS` — the Modal's: 12 options, each a computer's (`edge`, `lines`, `buttons`, `head`, `size`, `corners`, `smoothing`, `padding`, `behind`, `strength`, `blur`, `shadow`), and two looks, `framed` (every option's default) and `outlined`.
|
|
112
|
+
- `ModalOptionId` — its option ids.
|
|
113
|
+
- `ALERT_DIALOG_LOOKS` — the alert dialog's: 11 options (`close`, the X, a phone's; `padding`; `behind`, `dim` or `veil`; `strength`; `blur`, a computer's, and `blurphone`; `shadow`, a computer's, and `shadowphone`; `margin`, a phone's; `corners`; `smoothing`, `round` or `smooth` (the default, My preset's)), and no looks.
|
|
114
|
+
- `AlertDialogOptionId` — its option ids.
|
|
115
|
+
- `COLLAPSIBLE_LOOKS` — the Collapsible's: 2 options (`content`, `still`, `fade` (the default, My preset's) or `slide`: how what it holds comes and goes; `curve`, `soft` or `sharp`), and no looks.
|
|
116
|
+
- `CollapsibleOptionId` — its option ids.
|
|
117
|
+
- `ALERT_LOOKS` — the Alert's: 5 options (`buttons`, `end` (the default, My preset's) or `full`, a computer's; `size`, `32`, `36` or `44`, a computer's; `pair`, `side` or `stacked`, a phone's; `mark`, `none` or `shown`; `phone`, `panel` or `sheet`, what it opens as on a phone) and three looks, `even`, `plain` and `marked`.
|
|
118
|
+
- `AlertOptionId` — its option ids.
|
|
109
119
|
|
|
110
120
|
<!-- The editors' block: the Text editor, the Picker, the Date editor, the Compound editor, the Number editor, the Values editor, the Links editor -->
|
|
111
121
|
|
|
@@ -61,7 +61,7 @@ A panel's list keeps `--vk-panel-padding` from its edge ([Tokens](../contract.md
|
|
|
61
61
|
|
|
62
62
|
The panel a list's Options button opens, put together from the panels above: one header frame (a back arrow only when deep, the title, Clear all at the root without a shared view, a ✕ when the host can close it) over the root list or the page a row opened, and, at the root of a shared view, its footer. Its root is a `data-vs-detail` list, its header `data-vs-header`, its footer `data-vs-footer` with `data-vs-inset` and each actions row a `data-vs-row`, so a drawer of your own insets them through those; the root's rows carry `data-vs-row` when your `MenuRow` and `ToggleRow` atoms do. Your app hosts it: in a popover, or in a full-height drawer with `fill`.
|
|
63
63
|
|
|
64
|
-
- `ViewOptionsPanelContent` — the panel. Takes the list's `filters`, `sort`, `group`, `timeScopeConfig`, `dateRangeConfigs`, `toggles` and `layout` (`ViewOptionInputs`; its `sorts` and `filterTree` reach a `CustomizeBody` as its sort and filter), `activePanel` and `onOpenPanel`, `anyActive` and `clearAll`, and optionally `view` (`CollectionViewState`), `foldFilters` (one Filter row, on by default; off, every filter is a root row), `onClose`, `closeButton` (whether its header draws the ✕, default true; false in a sheet whose head draws it, `onClose` still closing it from inside, as a column's Done does), `fill` and `fieldEditor` (`PanelFieldEditor`). Back walks one level: a relation's Where field to its filter, a folded filter to the Filter list, a column to the Columns list, Group's own Group by, Sort and Date by pages to Group, anything else to the root. Handed a `GroupBody` in your components map, Group (and its own pages) draws it, handed the group as data; handed a `CustomizeBody`, the whole panel is it, handed the view's settings as data, wherever the panel hangs, except for a list whose filter is only per-field values, with no `filterTree`, which keeps the panel ([the components map](../contract.md#the-components-map)).
|
|
64
|
+
- `ViewOptionsPanelContent` — the panel. Takes the list's `filters`, `sort`, `group`, `timeScopeConfig`, `dateRangeConfigs`, `toggles` and `layout` (`ViewOptionInputs`; its `sorts` and `filterTree` reach a `CustomizeBody` as its sort and filter), `activePanel` and `onOpenPanel`, `anyActive` and `clearAll`, and optionally `view` (`CollectionViewState`), `foldFilters` (one Filter row, on by default; off, every filter is a root row), `onClose`, `closeButton` (whether its header draws the ✕, default true; false in a sheet whose head draws it, `onClose` still closing it from inside, as a column's Done does), `fill` and `fieldEditor` (`PanelFieldEditor`). Back walks one level: a relation's Where field to its filter, a folded filter to the Filter list, a column to the Columns list, Group's own Group by, Sort and Date by pages to Group (with an app's `GroupBody`, a level it tells goes back to its settings first, its name in the head), anything else to the root. Handed a `GroupBody` in your components map, Group (and its own pages) draws it, handed the group as data; handed a `CustomizeBody`, the whole panel is it, handed the view's settings as data, wherever the panel hangs, except for a list whose filter is only per-field values, with no `filterTree`, which keeps the panel ([the components map](../contract.md#the-components-map)).
|
|
65
65
|
- `PopoverRootList` — the root: Layout, Columns (`views.panels.columns-shown`), Filter (or each filter, unfolded), Sort, Group and the toggles, each opening its page through `onOpenPanel`.
|
|
66
66
|
- `ViewFooter` — Reset · Set default for everyone on a shared view this person has drifted from; a member sees Reset alone, and nothing draws while `changes` is 0. `words: "kit"` says Clear and Save instead. With no `view` and an `onClear`, Clear alone, which takes the list back to its default. `className` replaces its side inset. `ToolbarOptions` and `ViewOptionsPanelContent` take `viewFoot` (`"kit"` for those words, `"none"` for no foot) and `footClear` (the foot's Clear with no shared view).
|
|
67
67
|
- `ViewOptionsActions` — the actions row: Copy link and Share parked, Export CSV live when `exportCsv` (`CollectionExportCsv`) is handed in, its count on the row and one export at a time behind the `loading` glyph, which your app draws turning.
|
|
@@ -144,17 +144,18 @@ Options, Sort and Filter each open their panel from their own button, and each t
|
|
|
144
144
|
|
|
145
145
|
- `ToolbarOptions` — Customize behind its own button, named and worded `views.panels.toolbar-options`: the builder's `filters`, `sort`, `group` and `layout` (and its `filterTree`, with and/or groups: its count and default Clear then read the advanced filters), your `toggles`, `timeScopeConfig` and `dateRangeConfigs` (a `ViewOptionInputs`), and optionally `view` (a shared view: the drift dot on the button instead of a count, and the panel's footer), `fieldEditor`, `foldFilters` (true by default), `onClear` (the ✕ and the panel's Clear all; by default each active option cleared through its own `onChange`, the builder's filter rows adding up so every filter clears, or Reset on a shared view; for one change, `settingsCleared(…, "options")`), `widthClassName` and `host`. Its button counts the active options (`countActiveViewOptions`) with a ✕ that clears them. Draws nothing when there is nothing to customize. A `CustomizeBody` in your components map opens in place of the panel, in the same popover, `host` or phone `Sheet`.
|
|
146
146
|
- `ToolbarSort` — the sort panel behind its own button, named `views.panels.sort`: the builder's `sort`, lit (`changed`) while the list sorts other than its default. Draws nothing when nothing sorts. Handed the builder's `sorts` too (with `severalSorts`), it is Sort on the row's right as the kit draws it there: "Sort", counted once there are two rules, opening the fields (`SortFieldList`), a pick adding a rule at the end, ascending; at three it can't be used, saying why (`views.panels.sort-max`).
|
|
147
|
-
- `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. The fields are your `FieldsBody` where you hand one. × on the editor's last rule closes it. On a phone, "Sort" with its rules counted, opening the sort editor in your `Sheet`, its ✕ taking back what changed since it opened and its ✓ keeping it; a swipe, the dim or Escape close it and keep the changes. Its popovers, or its sheet, are one of the toolbar's panels.
|
|
147
|
+
- `ToolbarSortPill` — the sort as up to 3 rules, the kit's sort on its filter bar, in `data-slot="vk-toolbar-sort-pill"`: takes the builder's `sorts`, and optionally `open` and `onOpenChange` (to hold its state yourself), `host` and `addAfter` (default true). On a computer, "Sorted by" its first rule's field, in weight, with the rest counted (+1), opening the sort editor in your `Popover`; after it a + (`data-slot="vk-toolbar-sort-add"`, named `views.panels.sort-add-one`) while there are fewer than three, opening the fields, a pick adding a rule; with no rule, an empty place, "Sort", opening the fields. Handed `addAfter={false}` (the kit's bar), it draws no +, and its editor, or your `SortBody` (handed `addSort`), has Add sort at its foot. Handed `row`, it is Sort on a toolbar row (`data-slot="vk-toolbar-sort-row"`, as `ReadyToolbar`'s default stands it): its word "Sort", lit while a rule stands and counted from two; however it opens (a press, or ⋯ when it folded) it shows the sort editor, Add sort at its foot, while a rule or a set-aside sort stands, else the fields; it draws no + and `addAfter` means nothing to it. The fields are your `FieldsBody` where you hand one. × on the editor's last rule closes it. On a phone, "Sort" with its rules counted, opening the sort editor in your `Sheet`, its ✕ taking back what changed since it opened and its ✓ keeping it; a swipe, the dim or Escape close it and keep the changes; while your `SortBody` stands on a step of its own (`onStepChange`), Escape goes back a step instead, and under `sheetActions: "head"` your sheet's head shows the step's title. Its popovers, or its sheet, are one of the toolbar's panels.
|
|
148
148
|
- `SortEditor` — the sort editor's body alone, for a holder of your own (a popover): `sorts`, `form` (`"computer"` or `"phone"`), and optionally `open`, `onDone` and `addSort`. On a computer each rule (`data-slot="vk-sort-rule"`) is its grip, its field, its direction (Ascending, Descending, your `Menu`) and ×, inside `data-slot="vk-sort-editor"`, with no Add sort unless handed `addSort`: then Add sort (`data-slot="vk-sort-add"`) stands at its foot, after the set-aside sorts, opening the fields in your `Popover`, a pick adding a rule at the end, ascending, and at three, a set-aside sort holding one of the places, it can't be used and says why (`views.panels.sort-max`); on a phone each rule is a row, its direction under its field, a press opening its directions and ⋯ holding Delete, then Add sort (which turns the body to the fields, never a sheet on top; three at most) and Clear all, and "No sorting set up yet" with none. Every change goes out through `sorts.onChange` as it is made. A rule moves by its grip: dragged by the mouse after 8 px or a long press of 250 ms (a phone's row moves by itself), or ↑ and ↓ on its grip, the focus staying on that grip; the grip carries `data-base-ui-swipe-ignore`.
|
|
149
|
-
- `useSortEditor` — the sort editor's state for a sheet's holder (`SortEditorOptions`: `sorts`, `form`, `open`, `onDone`, `addSort`): `{ body, head }`. `body(closeButton)` draws it, on a phone with its own ✕ and ✓ 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. Handed a `SortBody` in your components map, `SortEditor` and `useSortEditor`'s `body` open it in place of their own rows, in every holder: it is handed the rules as data, its whole list is written once it fits the rules, its `onDone` calls the `onDone` you hand, and on a phone it gets `head` as its `actions` only when `closeButton` is true ([the components map](../contract.md#the-components-map)).
|
|
149
|
+
- `useSortEditor` — the sort editor's state for a sheet's holder (`SortEditorOptions`: `sorts`, `form`, `open`, `onDone`, `addSort`): `{ body, head, title, escapeBack }`. `body(closeButton)` draws it, on a phone with its own ✕ and ✓ 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. Handed a `SortBody` in your components map, `SortEditor` and `useSortEditor`'s `body` open it in place of their own rows, in every holder: it is handed the rules as data, its whole list is written once it fits the rules, its `onDone` calls the `onDone` you hand, and on a phone it gets `head` as its `actions` only when `closeButton` is true ([the components map](../contract.md#the-components-map)). On a phone it 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.
|
|
150
150
|
- `SortEditorOptions` — what `useSortEditor` takes.
|
|
151
|
-
- `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
|
|
151
|
+
- `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). It opens `QuickFiltersPanel` in your `Popover` (`data-slot="vk-toolbar-quick-panel"`), in `host`, or on a phone in your `Sheet`, and is one of the toolbar's panels. With no field to offer it draws nothing.
|
|
152
152
|
- `QuickFiltersPanel` — the quick filters' panel alone, for a holder of your own: `quickFilters`, `form` (`"computer"` or `"phone"`), and optionally `onDone`, `closeButton` (its own ✕; false where your sheet's head draws one) and `fill` (it fills a host, its values scrolling). Handed a `QuickFiltersBody` in your components map, it opens that, handed the fields as the strip shows them (`quickFieldsShown`) with their values as they show (`quickValuesShown`, worded by the config's `heldLabels`) and writing its hold once `quickHoldFits` takes it ([the components map](../contract.md#the-components-map)). Without, it draws its own (`data-slot="vk-quick-filters"`): a header with the panel's name; a strip of the fields (`data-slot="vk-quick-filters-field"`, `aria-pressed` on the open one), then each other field holding a value, named by the config's `heldLabels` (it leaves the strip once its last value is let go, the focus moving to the field open in its place), the first holding a value open first; the open field's values as a list box (`data-slot="vk-quick-filters-value"`, `aria-selected` and `data-chosen` while held), with Show counts the most first and each count drawn and read with its value (`views.panels.quick-value`), a held value no value lists drawn from the hold, worded by the config's `heldLabels` else its key; a press holds a value, and a press on a held one lets it go (with `several`, each press adds or lets go one value); one Tab stop, ↑ ↓ Home End between the values, Enter or Space holding; past eight values a search (`views.panels.quick-search`, or the field's `searchPlaceholder`), ↓ from it reaching the first value and ↑ from the first going back, a search of its own for each field, and "Nothing matches." (`views.panels.quick-none`, `data-slot="vk-quick-filters-none"`) when it finds none; a field with nothing to hold says "Nothing to pick.". At `form: "phone"` (in a phone's Sheet) it carries `data-form="phone"`, its values take the phone sheet's taller rows, and with one value held at a time a press, by touch or by key, holds it and closes the Sheet through `onDone` (`quickPressCloses`); with `several` the Sheet stays open.
|
|
153
153
|
- `QuickFiltersReminder` — on a phone, the reminder that a hold stands while the quick filters are closed: takes `quickFilters` (the same `QuickFiltersConfig`), `onOpen` (a press on its names: open the quick filters, whose open state you hold through `ToolbarQuickFilters`' `open`, or `ReadyToolbar`'s `quickFiltersOpen`) and optionally `hidden` (it steps aside: hand whether rows are selected or the quick filters are open, so it never stands with your selection bar or over the open quick filters), and `holder` (a ref to your list's box: leaving with the focus in it, by its ✕ or by stepping aside as the quick filters open, it hands the focus there, giving a box that takes no focus `tabindex="-1"`, so the focus never falls to the page and a sheet opened from its names hands it back into the box; with none, the focus goes where the browser drops it; it never searches the page for one). Place it once at your list's foot. It is portalled to the body where the selection bar's phone pill stands (the provider's `selectionBar.phone`: its `bottom`, `zIndex` and `className`), a pill (`data-slot="vk-quick-filters-reminder"`) holding the held values' names, each by its words and never its key (`quickHeldNames`), the first two and "+N" for the rest (`quickReminderWords`, `views.panels.quick-more`), a press on them (`data-slot="vk-quick-filters-reminder-open"`, named `views.panels.quick-reminder` with every name once) calling `onOpen`; then ✕ (`data-slot="vk-quick-filters-reminder-clear"`, `views.panels.quick-clear`), letting every hold go. It draws nothing on a computer, while nothing is held, or while `hidden`. An app that wears its own reminder places that one instead, fed by `quickHeldNames`.
|
|
154
154
|
- `SortFieldList` — the fields a rule is picked from (`data-slot="vk-sort-fields"`): `sorts`, `onPick`, and optionally `own` (a rule whose field it changes, ticked), `onDone` (done with no pick) and `form`. A field already sorted, but `own`, is greyed and says "Sorted"; a search past eight. Handed a `FieldsBody` in your components map, it opens that in place of its rows, in every holder, handed the options as data, each marked as the grid's header marks its column, a sorted one `disabled` with why; a pick of a key it didn't offer, or offered disabled, writes nothing ([the components map](../contract.md#the-components-map)).
|
|
155
155
|
- `ToolbarAdvancedFilters` — the advanced filters' pills, with and/or groups (`data-slot="vk-toolbar-advanced-filter"`): takes the builder's `filterTree`, and optionally `host`. One pill for each advanced filter (each group at the filter's top, or the whole of a top joined by Or), "Advanced filter" with its rules counted (one whose rules are all set aside drawn set aside instead, the button's `aside` with no count, naming why in your `Tooltip`: `views.panels.advanced-filter-set-aside`), its words kept however tight the row, opening the filter editor on its own rules in your `Popover` (`data-slot="vk-toolbar-advanced-filter-panel"`) or in `host`. A pill whose filter empties leaves the row; the others keep their own state. Each is one of the toolbar's panels; in a folding line its place carries `data-open` while it is open, so the line holds still. On a phone it draws nothing.
|
|
156
|
-
- `ToolbarFilters` — each filter on a filter bar, as the kit's draws them (`data-slot="vk-toolbar-filters"`): takes the builder's `filterTree` (with `filterGroups`), and optionally `open` and `onOpenChange` (whether Filter and + list the fields: hold it to open them from ⋯), `held` and `onHeldChange` (the rule held until whole: hold it to count it as the bar folds) and `host`. Every filter at the view's own level, in its order: a filter as four joined parts (`data-slot="vk-toolbar-filter-rule"`, named by its sentence), its field, how it compares in lower case, its value (capped at 240 and cut with "…", saying what it waits for until it is picked) and ⋯ (Convert to advanced filter, Delete filter), each opening its own list; a related record's field drawn as one ("Company › Industry"); an advanced filter as its pill (`ToolbarAdvancedFilters`'); then + (`data-slot="vk-toolbar-filter-add"`, `views.panels.filter-add-one`). Filter, + and a filter's field open your `FieldsBody` where you hand one, its way and value your `FilterPartBody` ([the components map](../contract.md#the-components-map)). While nothing filters and nothing is held, Filter, an empty place (`data-slot="vk-toolbar-filter"`). Filter and + open the fields; a pick adds a filter at the end (`addOnBar`, wrapping a top joined by Or into one advanced filter first), a related record's field among them, waiting for its value, or, for a yes/no, the list's own or a related record's, holds it on the bar saying what it waits for, writing nothing until its value is picked; where nothing more can be added they are disabled with why (`barAddRefusal`). In a folding line its last filters fold into "+N filters" (`data-slot="vk-toolbar-more-filters"`, as its slot's `filtersFolded` says), which names each and opens what a pick opens under itself; a held rule, the filter it stands in place of and a filter with a part open never fold. Each filter and "+N filters"' menu is one of the toolbar's panels. Delete filter and Convert move the focus to what stands after the filter: the next filter, "+N filters", + or Filter. An app placing it in a `Toolbar` of its own places it with `filters: foldableFilters(…)` and never with `shed` while a filter stands: its parts read the slot's `iconAlone`, and would draw no words. A held rule is compared with the tree as written, so your `filterTree.onChange` must hand the tree back unchanged (the same keys in the same order), or the held rule counts as dropped by a write from elsewhere. On a phone it draws nothing.
|
|
156
|
+
- `ToolbarFilters` — each filter on a filter bar, as the kit's draws them (`data-slot="vk-toolbar-filters"`): takes the builder's `filterTree` (with `filterGroups`), and optionally `open` and `onOpenChange` (whether Filter and + list the fields: hold it to open them from ⋯), `held` and `onHeldChange` (the rule held until whole: hold it to count it as the bar folds) and `host`. Every filter at the view's own level, in its order: a filter as four joined parts (`data-slot="vk-toolbar-filter-rule"`, named by its sentence), its field, how it compares in lower case, its value (capped at 240 and cut with "…", saying what it waits for until it is picked) and ⋯ (Convert to advanced filter, Delete filter), each opening its own list; a related record's field drawn as one ("Company › Industry"); an advanced filter as its pill (`ToolbarAdvancedFilters`'); then + (`data-slot="vk-toolbar-filter-add"`, `views.panels.filter-add-one`). Filter, + and a filter's field open your `FieldsBody` where you hand one, its way and value your `FilterPartBody` ([the components map](../contract.md#the-components-map)). While nothing filters and nothing is held, Filter, an empty place (`data-slot="vk-toolbar-filter"`); handed `emptyPlace={false}`, where Filter stands on the row (`ToolbarFilterAdd`), nothing at all until a filter is set or held. Filter and + open the fields; a pick adds a filter at the end (`addOnBar`, wrapping a top joined by Or into one advanced filter first), a related record's field among them, waiting for its value, or, for a yes/no, the list's own or a related record's, holds it on the bar saying what it waits for, writing nothing until its value is picked; where nothing more can be added they are disabled with why (`barAddRefusal`). In a folding line its last filters fold into "+N filters" (`data-slot="vk-toolbar-more-filters"`, as its slot's `filtersFolded` says), which names each and opens what a pick opens under itself; a held rule, the filter it stands in place of and a filter with a part open never fold. Each filter and "+N filters"' menu is one of the toolbar's panels. Delete filter and Convert move the focus to what stands after the filter: the next filter, "+N filters", + or Filter, or, where Filter stands on the row's right and nothing is left on the bar, that Filter (`ToolbarFilterAdd`). An app placing it in a `Toolbar` of its own places it with `filters: foldableFilters(…)` and never with `shed` while a filter stands: its parts read the slot's `iconAlone`, and would draw no words. A held rule is compared with the tree as written, so your `filterTree.onChange` must hand the tree back unchanged (the same keys in the same order), or the held rule counts as dropped by a write from elsewhere. On a phone it draws nothing.
|
|
157
157
|
- `foldableFilters` — how many of the bar's filters may fold, for its placement's `filters`: `(tree, held)`, the tree's top-level items less the one a held rule stands in place of; a held rule no longer standing (`held`'s tree changed by a write from elsewhere) counts as gone.
|
|
158
|
+
- `ToolbarFilterAdd` — Filter on a toolbar row's right (`data-slot="vk-toolbar-filter-add-row"`, named `views.panels.filter`), as `ReadyToolbar` stands it by default: takes the builder's `filterTree`, and optionally `onHeldChange` (hand the toolbar's held rule's writer, the one you hand `ToolbarFilters`, so a yes/no it holds stands on the bar), `open` and `onOpenChange`, and `host`. It opens the fields as Filter on the bar does (your `FieldsBody` where you hand one), and a pick adds a filter at the bar's end and opens nothing else, or holds a yes/no until its value is picked, which `ToolbarFilters` takes in as its own; where nothing more can be added it is disabled with why. It is one of the toolbar's panels. On a phone, or with no fields, it draws nothing.
|
|
158
159
|
- `Pending` — the rule held until whole, as `ToolbarFilters` hands it to `onHeldChange`: its `container`, its `node`, the filter it `replaces`, and what it was held `over`.
|
|
159
160
|
- `FilterEditor` — the filter editor on a computer (`data-slot="vk-filter-editor"`): `filterTree`, `at` (the advanced filter's path: a group's, or `[]` for a top joined by Or), and optionally `onDone` (its filter emptied, Clear all filters) and `onRemoved` (a delete took a node away: the outermost that went). Each rule (`data-slot="vk-filter-rule"`) is Where or its level's join, its field, how it compares and its value, each a box of your `Button` opening its list, then ⋮ (Convert to group where it stays within 3 levels, Delete condition); the second rule's join is a button turning every join at its level. A group (`data-slot="vk-filter-group"`) stands on its own ground with its level, Add filter, Delete group and ⋮ (Exclude matches, on a group joined by And; an excluded group is headed "Not all of these" and its join reads And). A relation rule (`data-slot="vk-filter-relation"`) is a block, its relation and Any, None or Every where, its rules on the far fields inside. Add filter opens the fields; a pick adds a rule and opens its value; a far field makes a relation block, written the same way and waiting for its far value; a yes/no, the list's own or a far one, is held in the editor until its value is picked. Each value opens its type's own body with its operator left out (`FilterValueBody`); its box says the value alone, as the bar's value part does, or, until it is whole, what it waits for by its type ("Type a value", "Type a number", "Choose a date", "Choose"). 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: its relation and Any, None or Every where head the editor, and its rules and Add filter name the relation's far fields. Every change goes out through `filterTree.onChange` as it is made. Handed a `FilterBody` in your components map, `FilterEditor`, `PhoneFilterEditor` and `usePhoneFilterEditor`'s `body` open it in place of their own rows, in every holder: it is handed the level they stand on as data, its whole level is written once it fits the rules, its `onDone` calls the `onDone` you hand, and on a phone it gets `head` as its `actions` only when `closeButton` is true ([the components map](../contract.md#the-components-map)). Handed a `FilterPartBody` in your components map, a rule's way and value open it in place of its ways menu and value body, never inside a `FilterBody`'s `ruleValue`; its field lists open your `FieldsBody` where you hand one.
|
|
160
161
|
- `usePhoneFilterEditor` — the filter editor on a phone, for a sheet's holder (`filterTree`, `open`, `onDone`): `{ body, head }`, as `useSortEditor`'s. `body(closeButton)` draws it on every rule of the view, with its own ✕ and ✓ when `closeButton` is true; `head` is the ✕ (`views.panels.close`) and ✓ (`views.panels.filter-done`) for your sheet's head. Each rule is Where or its join over its boxes, then ⋯ (Convert to group, Delete condition); a group stands on its own ground with Add filter, Delete group and ⋯ (Exclude matches). Each box's list (the field, how it compares, the value), a relation's Any, None or Every and Add filter's fields turn the body behind a back row, never a sheet on top. With no rule it reads `views.panels.filter-empty` and `views.panels.filter-empty-line`, with Add filter; Clear all (`views.panels.filter-clear-all`) empties it and keeps it open. It edits the whole tree in place (`editWhole`). ✕ takes the tree back, in one change, to what it was when `open` last turned true, and drops any write that lands after it (a box writing what was typed as the sheet closes) until `open` turns true again, so close the sheet on its `onDone`; ✓, and your sheet's swipe, dim and Escape, keep it, a value typed just before included. A held rule (a yes/no, the list's own or a relation block's) written from its value page is followed there when your `filterTree.onChange` reaches the tree in the same event, as `useListSettingsState` does; written a render later, the page turns back to the rules.
|
|
@@ -167,6 +168,6 @@ Options, Sort and Filter each open their panel from their own button, and each t
|
|
|
167
168
|
- `ToolbarPanelState` — what `useToolbarPanelState` returns.
|
|
168
169
|
- `FilterPanelContent` — the Filter panel standing alone, for a host of your own: the filter list at its root (titled `views.panels.filter`, no back arrow) and the pages it opens, with `filters`, `timeScopeConfig`, `dateRangeConfigs`, `page`, `onPageChange`, `onClose` and `fill`.
|
|
169
170
|
- `ToolbarSave` — Clear and Save, at the end of a filter bar while the list differs (`data-slot="vk-toolbar-save"`): takes `view` (a `CollectionViewState`: Clear is its `onReset`, Save its `onPublish`, shown only where `canPublish`, both waiting while `pending`, nothing while `changes` is 0), or with no shared view `onClear`, Clear alone taking the list back to its default; nothing when neither has anything to do. Clear has no ground and Save wears the field's look, ViewKit's own buttons or your `Button` with `panelButtons` at `button`.
|
|
170
|
-
- `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
|
|
171
|
+
- `ReadyToolbar` — the toolbar for an app that doesn't arrange its own (`ReadyToolbarProps`): the builder's input (`settings`, `layer`, `columns`, `onChange`, `onLayerChange` and the rest of `SettingsPanelsInput`), and optionally `views`, `viewsLayout`, `onAdd` or `addItems` and `addLabel`, `view`, `toggles`, `fieldEditor`, `searchPlaceholder`, `searching` (handed to its search), `hosts` (`{ options, sort, filter, quick }`), `quickFilters` (a `QuickFiltersConfig`: handed, the quick filters' button stands on the row's end before the search, in the row arrangement before Options, folding into ⋯ as the row narrows; its counts follow the toolbar's Show counts unless the config carries its own `showCounts`), `quickFiltersOpen` with `onQuickFiltersOpenChange` (the quick filters' panel open, held by you, so a `QuickFiltersReminder` at your list's foot can open it; absent, the toolbar holds it), `phone`, `narrow`, `severalSorts` (true by default: the sort holds up to 3 rules, the row's Sort opening the sort editor on them, or in the old form the sort pill on the bar; `false` keeps Sort's one rule, which opens its own list whether or not a sort stands), `addAfter` (true by default: the + after the sort pill; `false` draws none, and the pill's editor, or your `SortBody`, has Add sort at its foot, as `ToolbarSortPill`'s), `filterGroups` (true by default: and/or groups, each filter on the filter bar on a computer, in the row arrangement each advanced filter's pill after Filter and Convert to advanced filter on a filter's page, and on a phone Filter opening the filter editor on every rule; `false` keeps Filter, counting what is applied, in either arrangement), `arrangement` (`"kit"` by default, or `"row"`), `sortFilter` (`"right"` by default, or `"bar"`), `bar` (`"added"` by default, or `"always"`: with Sort and Filter on the row's right, the bar then always shows, its empty Sort and Filter included) and `className`. It calls the builder and draws its parts in the kit's arrangement (`Toolbar`'s `fold`). By default, on a computer, one row at rest: the views with Customize beside them, then on its right Sort and Filter with their words, the quick filters' button and the search, each its icon alone, and New. Sort holds the sort (`ToolbarSortPill`'s `row`): lit while one stands (a view's saved sort included), counted from two, it opens the sort editor to change or remove the rules, Add sort at its foot; with none, the fields. Filter (`ToolbarFilterAdd`) adds a filter to the bar. Under the row the filter bar, a step smaller, is the filters' line: it comes only while a filter stands or is held (or one of its parts is open, or a second axis of views stands there), holding the filters (each as below, + after the last, no empty Filter) and Clear and Save at its end. While it doesn't stand, an unsaved change (a sort, a removed last filter) waits in Customize's foot, Clear and Save (on a shared view Customize also carries its dot), as on a phone. Each of the row's Sort and Filter is a panel of its own, apart from the bar's, so a press opens one list. `sortFilter: "bar"` with `bar: "always"` draws the kit arrangement's old form: the row, the views with Customize beside them and the search and New at its end, and under it the filter bar, always shown, a step smaller: the sort pill first, a separator, the filters (`ToolbarFilters`: each filter as its four joined parts, each advanced filter's pill, + after the last; while there is none, Filter, an empty place; the rule held until whole is held by the toolbar, so the bar counts it as it folds; with `filterGroups` false, Filter as before, with what is applied counted), and at its end Clear and Save (`ToolbarSave`) while the list differs: on a shared view (`view`) Clear takes it back and Save, where `canPublish`, keeps it for everyone; with no shared view, Clear alone takes the list back to its default (nothing filtered, the default sort, no group: so a list that starts grouped or filtered shows Clear at once); Customize's foot then draws neither. A row with no room folds as the kit's does (words to icons, the view tabs into "+N", the bar's last filters into "+N filters", then into ⋯: by default Customize and the row's Sort and Filter, whatever is set; in the old form Customize, and the sort and Filter while no filter stands), with no narrow form. On a phone one line in either form (the views, the sort, Filter, the quick filters' button when handed, Customize, then the search, which opens across the line), Clear and Save in Customize's foot (`views.panels.view-clear`, `views.panels.view-save`; with no shared view, Clear alone), and New a round + at the list's foot, lifted by `--vk-toolbar-foot`. `arrangement: "row"` draws the order of 12 Nov instead: the views on the left; search, sort, filter, options and new on the right, the narrow form under 700px, and Reset and Set default for everyone in Customize's foot. Every change comes back as a `ListSettingsChange` or a layer patch: its search writes the settings' search, its ✕s clear in one change (`settingsCleared`), and the active view's menu gains "Edit view…" (`withEditView`), which opens Customize. It holds its panels' state above its frame, so a change of form keeps a panel open on its page, in a sheet once the form is the phone's. Show counts is the view's: read from `settings.showCounts` for the views row and the quick filters, absent meaning on, it joins Customize's toggles where the views carry counts and is written back through `onChange`. Group steps aside on a board (`groupShown`).
|
|
171
172
|
- `ReadyToolbarProps` — what `ReadyToolbar` takes.
|
|
172
173
|
- `useListSettingsState` — a list's settings and layer held in memory, for an app that keeps none yet (a proof page, a test): `{ settings, layer? }` in, `{ settings, layer, onChange, onLayerChange }` out, ready to spread into `ReadyToolbar` beside its `columns`. Each change is applied to the latest settings (`applySettingsChange`), each patch merged into the latest layer.
|
|
@@ -9,7 +9,7 @@ Import from `viewkitjs/views/panels` for what a list's panels read and say: the
|
|
|
9
9
|
- `GroupConfig` — a list's group: its `dimensions`, the `value` (or `"none"`), each dimension's `order` and `granularity`, `onChange`, `hideEmpty` and, while grouped, the `groups` to show, hide and drag.
|
|
10
10
|
- `GroupDimension` — one field a list groups by: its `orderOptions`, `defaultOrder`, and a date's `granularities` and `defaultGranularity`.
|
|
11
11
|
- `GroupOrderOption` — one way a dimension's groups are ordered, with the `defaultDir` it opens in.
|
|
12
|
-
- `GroupListEntry` — one group as the Group panel lists it: its `key`, `label`,
|
|
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
14
|
- `ToggleConfig` — a boolean the panel flips in place: `key`, `label`, `value`, `onChange`, an `icon`, `desktopOnly`, a `reset` back to the reader's default, and the `section` it sits under.
|
|
15
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 reader's own section (`personal`) and the phone's own layout.
|