viewkitjs 0.33.0 → 0.34.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 +29 -0
- package/package.json +1 -1
- package/views/dist/contract.d.ts +20 -10
- package/views/dist/contract.js +37 -3
- package/views/dist/controls/alert/alert.js +2 -1
- package/views/dist/controls/alert-dialog/alert-dialog.js +3 -2
- package/views/dist/controls/bulk-bar/bulk-bar.js +25 -22
- package/views/dist/controls/controls.d.ts +2 -0
- package/views/dist/controls/controls.js +2 -0
- package/views/dist/controls/customize/customize.js +8 -6
- package/views/dist/controls/customize/map-customize-body.d.ts +2 -2
- package/views/dist/controls/customize/map-customize-body.js +3 -2
- package/views/dist/controls/date-editor/date-editor.d.ts +3 -0
- package/views/dist/controls/date-editor/date-editor.js +13 -7
- package/views/dist/controls/date-editor/map-calendar.js +2 -0
- package/views/dist/controls/date-editor/map-date-body.d.ts +1 -1
- package/views/dist/controls/date-editor/map-date-body.js +7 -3
- package/views/dist/controls/filter-editor/map-filter-body.d.ts +2 -0
- package/views/dist/controls/filter-editor/map-filter-body.js +7 -4
- package/views/dist/controls/filter-editor/parts.d.ts +3 -1
- package/views/dist/controls/filter-editor/parts.js +7 -6
- package/views/dist/controls/group-editor/group-editor.js +2 -1
- package/views/dist/controls/group-editor/map-group-body.d.ts +1 -0
- package/views/dist/controls/group-editor/map-group-body.js +5 -1
- package/views/dist/controls/input/input.js +2 -1
- package/views/dist/controls/internal/head-button.d.ts +9 -0
- package/views/dist/controls/internal/head-button.js +13 -0
- package/views/dist/controls/internal/panel-controls.d.ts +13 -5
- package/views/dist/controls/internal/panel-controls.js +53 -10
- package/views/dist/controls/menu/menu.d.ts +2 -1
- package/views/dist/controls/menu/menu.js +2 -2
- package/views/dist/controls/modal/modal.js +5 -3
- package/views/dist/controls/number-editor/map-number-body.js +5 -1
- package/views/dist/controls/number-editor/number-editor.js +6 -6
- package/views/dist/controls/pane/map-pane.d.ts +3 -0
- package/views/dist/controls/pane/map-pane.js +5 -0
- package/views/dist/controls/picker/map-fields-body.js +25 -1
- package/views/dist/controls/picker.css +10 -1
- package/views/dist/controls/quick-filters/map-quick-filters-body.d.ts +2 -1
- package/views/dist/controls/quick-filters/map-quick-filters-body.js +7 -3
- package/views/dist/controls/quick-filters/quick-filters.js +5 -3
- package/views/dist/controls/setting-row/looks.js +5 -5
- package/views/dist/controls/setting-row/setting-row.d.ts +3 -1
- package/views/dist/controls/setting-row/setting-row.js +3 -1
- package/views/dist/controls/setting-row.css +3 -2
- package/views/dist/controls/sheet/bottom-sheet.d.ts +3 -1
- package/views/dist/controls/sheet/bottom-sheet.js +2 -2
- package/views/dist/controls/sort-editor/map-sort-body.js +4 -4
- package/views/dist/controls/text-editor/map-text-body.js +5 -1
- package/views/dist/controls/text-editor/text-editor.js +5 -4
- package/views/dist/controls/toolbar/toolbar.d.ts +4 -2
- package/views/dist/controls/toolbar/toolbar.js +2 -2
- package/views/dist/controls/views-list/map-view-menu.d.ts +3 -2
- package/views/dist/controls/views-list/map-view-menu.js +6 -2
- package/views/dist/controls/views-list/map-views-list-body.d.ts +2 -1
- package/views/dist/controls/views-list/map-views-list-body.js +6 -5
- package/views/dist/controls/views-list/view-menu.js +3 -4
- package/views/dist/controls/views-list/views-list.js +2 -2
- package/views/dist/editors/EditorPanel.js +3 -3
- package/views/dist/list/list.d.ts +6 -2
- package/views/dist/list/list.js +6 -2
- package/views/dist/list/parts.js +3 -2
- package/views/dist/list/toolbar.js +9 -3
- package/views/dist/panels/react/toolbar/ReadyToolbar.d.ts +13 -0
- package/views/dist/panels/react/toolbar/Toolbar.d.ts +4 -0
- package/views/dist/panels/react/toolbar/Toolbar.js +8 -3
- package/views/dist/panels/react/toolbar/ToolbarAdvancedFilters.js +3 -2
- package/views/dist/panels/react/toolbar/ToolbarFilterAdd.js +3 -2
- package/views/dist/panels/react/toolbar/ToolbarFilters.js +3 -2
- package/views/dist/panels/react/toolbar/ToolbarSortPill.js +3 -2
- package/views/dist/panels/react/toolbar/context.d.ts +21 -0
- package/views/dist/panels/react/toolbar/context.js +4 -0
- package/views/dist/panels/react/toolbar/pane-host.d.ts +6 -0
- package/views/dist/panels/react/toolbar/pane-host.js +17 -0
- package/views/dist/panels/react/toolbar/panel-part.js +3 -2
- package/views/dist/panels/react.d.ts +1 -1
- package/views/dist/provider/ViewsProvider.d.ts +4 -3
- package/views/dist/provider/components.d.ts +34 -5
- package/views/dist/provider/components.js +1 -1
- package/views/dist/react.d.ts +1 -1
- package/views/dist/styles.css +97 -78
- package/views/dist/styles.unlayered.css +97 -78
- package/views/docs/contract.md +62 -6
- package/views/docs/controls/alert-dialog.md +4 -0
- package/views/docs/controls/alert.md +4 -0
- package/views/docs/controls/bulk-bar.md +4 -0
- package/views/docs/controls/customize.md +3 -1
- package/views/docs/controls/date-editor.md +2 -0
- package/views/docs/controls/filter-editor.md +1 -1
- package/views/docs/controls/group-editor.md +2 -0
- package/views/docs/controls/menu.md +3 -1
- package/views/docs/controls/modal.md +4 -0
- package/views/docs/controls/number-editor.md +2 -0
- package/views/docs/controls/quick-filters.md +3 -1
- package/views/docs/controls/sheet.md +1 -1
- package/views/docs/controls/text-editor.md +2 -0
- package/views/docs/controls/toolbar.md +4 -0
- package/views/docs/controls/views-list.md +2 -0
- package/views/docs/guides/the-provider.md +4 -4
- package/views/docs/reference/controls.md +5 -3
- package/views/docs/reference/list.md +5 -3
- package/views/docs/reference/looks.md +1 -1
- package/views/docs/reference/panels-react.md +6 -5
- package/views/docs/reference/react.md +7 -6
- package/views/docs/reference/views.md +4 -2
- package/views/docs/reshaping.md +16 -5
- package/views/skills/views/SKILL.md +1 -1
package/views/docs/contract.md
CHANGED
|
@@ -106,6 +106,43 @@ The selection bar's parts (`SelectionBar`, `viewkitjs/views/selection`):
|
|
|
106
106
|
| `data-slot="vk-selection-pill"` | the pill inside it: the count, the verbs, the trash, More |
|
|
107
107
|
| `data-slot="vk-selection-chip"` | the count that clears the selection, on the desktop |
|
|
108
108
|
|
|
109
|
+
### The bulk bar's parts (VK-1023)
|
|
110
|
+
|
|
111
|
+
The bulk bar (`CONTROLS.SelectionBar`, the Outright kit's `BulkBar`) names every part it draws, and every part of what it opens,
|
|
112
|
+
with a public `data-slot`, in every form: a computer's bar, the phone's tray and the pill. Dress one part by its name and the rest
|
|
113
|
+
stay as they are. Its names are listed in `BULK_BAR_SLOTS`, and in `SELECTION_SLOTS` too.
|
|
114
|
+
|
|
115
|
+
A part that repeats says which one it is by `data-key`: a verb, on the bar and as a row of More or Actions, its place in the
|
|
116
|
+
verbs you hand, from 0, whether it stands on the bar or is kept off (`more`), so the keys follow the verbs' order; Delete's row
|
|
117
|
+
`delete`; a group's row its place in the group; a field's value its value. The bar measures its verbs out of sight to know how
|
|
118
|
+
many fit, and those hidden copies wear the same names, so a dress that widens a verb is measured as it is drawn. A part's name
|
|
119
|
+
never starts ViewKit's reset: More's menu, standing in the page outside the bar, draws as it did before it was named. Where
|
|
120
|
+
VK-1023's second half hands your own `Button`, `Menu` and `Popover` into the bar, each is handed its part's `data-slot` and
|
|
121
|
+
`data-key` as props: draw them on the element your stylesheet styles.
|
|
122
|
+
|
|
123
|
+
| slot | the part |
|
|
124
|
+
| --- | --- |
|
|
125
|
+
| `data-slot="vk-bulk-bar"` | the bar, every form |
|
|
126
|
+
| `data-slot="vk-bulk-count"` | the count: on a computer the button that clears the selection; on the pill its words |
|
|
127
|
+
| `data-slot="vk-bulk-separator"` | the hairline after the count |
|
|
128
|
+
| `data-slot="vk-bulk-verb"` | a verb's button, `data-key` its place in the verbs |
|
|
129
|
+
| `data-slot="vk-bulk-delete"` | Delete's own button: a computer's red icon (its option `delete`), the tray's Delete |
|
|
130
|
+
| `data-slot="vk-bulk-more"` | More: a computer's, the tray's ⋯ |
|
|
131
|
+
| `data-slot="vk-bulk-clear"` | the pill's ✕ |
|
|
132
|
+
| `data-slot="vk-bulk-actions"` | the pill's Actions |
|
|
133
|
+
| `data-slot="vk-bulk-menu"` | More's menu and the pill's Actions menu: its popup on a computer, its sheet on a phone |
|
|
134
|
+
| `data-slot="vk-bulk-menu-row"` | a row in it: `data-key` its verb's place, or `delete` |
|
|
135
|
+
| `data-slot="vk-bulk-group-menu"` | a group's menu |
|
|
136
|
+
| `data-slot="vk-bulk-group-row"` | a group's row, in its menu or in More's: `data-key` its place in the group |
|
|
137
|
+
| `data-slot="vk-bulk-choice"` | a field's value in More's or Actions' menu: `data-key` its value |
|
|
138
|
+
| `data-slot="vk-bulk-empty"` | that menu's empty row (an options verb's `empty`) |
|
|
139
|
+
| `data-slot="vk-bulk-field"` | a field's popover on a computer; the Picker in it keeps its own names ([the field editors' parts](#the-field-editors-parts-vk-989)) |
|
|
140
|
+
| `data-slot="vk-bulk-field-sheet"` | a field's sheet on a phone, the Picker's names inside it |
|
|
141
|
+
| `data-slot="vk-bulk-toasts"` | where its Toast rises, just above the bar |
|
|
142
|
+
|
|
143
|
+
Delete's question (ViewKit's alert dialog) and the Toast itself are ViewKit's own and carry no part's name, nor does a menu
|
|
144
|
+
level's own ✕ on a phone (the sheet's, as the field editors' are).
|
|
145
|
+
|
|
109
146
|
## States
|
|
110
147
|
|
|
111
148
|
Flags the rendering styles, present as an attribute when true and absent when false, so a skin
|
|
@@ -320,6 +357,13 @@ for the line under every row but the last (`1px`; `0px` draws none), `--vk-field
|
|
|
320
357
|
it always has; declared on a section or any ancestor, every row in it takes them. Inside a Field rows card on a phone the
|
|
321
358
|
row is one of the card's rows, drawn by the card's frame, and none of them apply there.
|
|
322
359
|
|
|
360
|
+
**The toolbar's band is the app's to declare.** On a computer each line of a folding toolbar (the ready toolbar's, or
|
|
361
|
+
`Toolbar`'s `fold`) reads `--vk-toolbar-line-py` for its padding above and below (undeclared `calc(var(--spacing)*2.5)`,
|
|
362
|
+
what `py-2.5` drew), `--vk-toolbar-line-gap` for the room between its tools (`calc(var(--spacing)*2)`) and
|
|
363
|
+
`--vk-toolbar-line-w` for the line under it (`1px`, in `--vk-border-subtle`; `0px` draws none, for an app that draws its
|
|
364
|
+
own line edge to edge). Undeclared, the line draws as it always has; declared on the toolbar or any ancestor, every line
|
|
365
|
+
in it takes them. A phone's one line takes none of them.
|
|
366
|
+
|
|
323
367
|
**Type, lines and timing are the app's to dress, one variable per kind.** Each is optional. Undeclared, every
|
|
324
368
|
place keeps its own value, the one shown here; declared once, on the grid, a panel or an ancestor, every place of
|
|
325
369
|
that kind takes it.
|
|
@@ -437,11 +481,11 @@ peer; the provider and every other door import neither library, so an app that h
|
|
|
437
481
|
|
|
438
482
|
`Checkbox`: `ViewsCheckboxProps`. A yes/no cell in the grid draws it, handed `checked`, the column's name as `aria-label`, `tabIndex` -1 and `onCheckedChange`; a cell the grid can't write is handed `readOnly` and a press that writes nothing. A field row's yes/no draws it, handed `checked`, the field's name as `aria-label` and `onCheckedChange`, and no `tabIndex`, so it stays a Tab stop as a switch is; a row it can't write is handed `readOnly`, and a value inside the row's own button keeps the tick box. Forward `readOnly` to your control.
|
|
439
483
|
|
|
440
|
-
`Input`, optional: a single-line text box, `ViewsInputProps`. The editors' own single-line box (a duration's, the one number no body has a form for) draws through it; without it the editors draw a plain `<input>`. Forward every prop to your element, `ref` included. `chrome` is `bare` (the default: a grid cell, a panel that frames the box) or `field` (your field's frame). `OPTIONAL_COMPONENT_NAMES` lists the ten optional slots apart from `COMPONENT_NAMES`, which lists the slots you must fill.
|
|
484
|
+
`Input`, optional: a single-line text box, `ViewsInputProps`. The editors' own single-line box (a duration's, the one number no body has a form for) draws through it; without it the editors draw a plain `<input>`. Under the provider's `panelControls` the text and date editors' one-line boxes draw through it too (VK-1021), and so do Customize's name and columns search, the view menu's name box, the quick filters' search and the filter bar's typed value (VK-1014), handed ViewKit's autofill-off where the box holds a record's details (an autocomplete word and the password managers' marks: forward them to your element). Forward every prop to your element, `ref` included. `chrome` is `bare` (the default: a grid cell, a panel that frames the box) or `field` (your field's frame). `OPTIONAL_COMPONENT_NAMES` lists the ten optional slots apart from `COMPONENT_NAMES`, which lists the slots you must fill.
|
|
441
485
|
|
|
442
|
-
`Select`, optional: a box that picks one value or several, `ViewsSelectProps`. Only ViewKit's panels draw it, and only where the provider's `panelControls` names `Select
|
|
486
|
+
`Select`, optional: a box that picks one value or several, `ViewsSelectProps`. Only ViewKit's panels draw it, and only where the provider's `panelControls` names `Select`: the sort's field and direction, the filter's field, way, choices and a block's quantifier (VK-1013), and New view's columns box in the view menu (VK-1014). It is handed the rows (`ViewsSelectItem`: a value, its words, an icon, a line, a group, `disabled`, and `level`, rows one level in, which `flatSelectItems` flattens for a Select that draws none), the value and `onValueChange`, `multiple`, a placeholder, `disabled`, `open` and `onOpenChange` (honour both: on a phone a panel holds the box shut and opens a step of its own), `search` (the words of ViewKit's own search), `size` (`sm` or `default`), and the part's `data-slot` and `data-key`, for the box a person presses. `CONTROLS.Select` is ViewKit's own.
|
|
443
487
|
|
|
444
|
-
`panelControls` (the provider): the names among `Button`, `Select`, `Menu`, `Popover` and `
|
|
488
|
+
`panelControls` (the provider): the names among `Button`, `Select`, `Menu`, `Popover`, `Input` and `Calendar` that ViewKit's panels and field editors draw with your own (VK-1013, the sort and filter panels; VK-1014, the group editor, Customize, the views list and view menu, the quick filters' search, the filter bar's typed value and date, and every phone head a panel draws itself; VK-1021, the text, number and date editors, `Calendar` their date's month). Inside a ViewKit box group (a date's line, a phone number's digits) your Input is handed `chrome="bare"`: the group draws the frame; a box that grows over lines and a search list's box stay ViewKit's. Each is handed the map's props, never ViewKit's own look, and the part's `data-slot` and `data-key`; a menu's rows carry theirs as `slot` and `key`, and a menu ViewKit opens from your Button it opens itself, at your Button, and gives the focus back to it. Inside the panels and the editors a ViewKit part may hand your Button, Select or Input more props than these (a tooltip's handlers, `type="tel"`, `inputMode`, `enterKeyHint`, `aria-haspopup`): forward the rest to your element. A box group's button (a phone's country, a money's currency) comes to your Button as `variant="ghost"`, `size="sm"`. A control of `CONTROLS`' stays ViewKit's whatever `panelControls` says; without it, the panels and the editors draw ViewKit's own, as before.
|
|
445
489
|
|
|
446
490
|
`Command`, optional and deprecated: the command list's parts (`ViewsCommandParts`). Nothing reads it: the grid's menus are your `Menu` and the editors' lists your `Picker`. Leave it out; it goes at a later minor.
|
|
447
491
|
|
|
@@ -449,7 +493,7 @@ peer; the provider and every other door import neither library, so an app that h
|
|
|
449
493
|
|
|
450
494
|
`LinksBody`, required: a whole links body your app draws, `ViewsLinksBodyProps`, for a relation holding several records whose field declares `links` (each link may carry roles, and one may lead). The set editor opens it in the grid and in a field row, in a popover on a computer and the sheet on a phone, in place of your `Picker`; a relation with no `links` still opens your `Picker`. It hands the field's name (`label`), the records as `ViewsPickerItem` data (`items`: the linked ones first, in the links' order, then the ones to add, filtered or fetched by the editor as for `Picker`, with `search`, `onSearch`, `doing`, `onRetry`, `onMore` and the create rows as `actions`), the links (`links`: `ViewsLink`s, `{ value, roles }`, in the order they stand), the field's roles in its order (`roles`: `ViewsLinkRole`s, `{ value, label, archived? }`; an archived one is handed so a link holding it shows its words and can let it go, and you offer it on that link alone), where the field leads `lead` (which value leads, `onLead`, and its words: making another lead never moves a line), what was typed on what opened it (`typed`), `autoFocus` and `form`, and in the phone's sheet `onStepChange`. The body hands back `onLinksChange` (the whole list, every change as it is made: a record linked, last and holding no role, or unlinked, a link's roles set) and `onDone` (it closes and saves the set). The editor drops from what comes back a value it never handed, a repeated link, a role the field doesn't declare, an archived role on a link that didn't hold it as the editor opened, and a role repeated; `onLead` with a value no link holds changes nothing. Unlinking the lead passes it to the first link left. The set saves with the lead first and, on each link, its roles in the key it was stored with: a link stored with `role` keeps `role` (its first role, or null), one stored with `roles` keeps `roles`, one stored with `role` alone gains `roles` beside it once it holds two or more, and a new link writes `roles` alone; a link whose roles didn't change is written as it was stored. Escape and Tab from inside your body's element are taken before your body hears them (Escape throws the set away; Tab walks your controls and closes from either end, which saves); a key in a popup your body draws outside its element, or in a level you mark `EDITOR_INNER_ESCAPE` inside it, is your body's. Its popover stands at your `Popover`'s own width, marked `data-vk-body="links"`. `CONTROLS.LinksBody` is ViewKit's own, the Links editor: the search on top, the linked records as rows under the field's name, Roles and Lead (a link's roles ticked in the Picker under its button, the lead a radio, ✕ to unlink), the records to add under Add; on a phone a card per link, its roles a step of the sheet with Back (`onStepChange`). It hands every query back (`onSearch`), draws the records as handed, and draws `doing`, `onMore` and the create rows.
|
|
451
495
|
|
|
452
|
-
`Calendar`, optional: a calendar over ISO days, `ViewsCalendarProps`, which the default `RangeCalendar` atom draws the filter panel's month through (the date filter, its date ranges and its custom time scope). Reached without one, it throws an error naming it. The
|
|
496
|
+
`Calendar`, optional: a calendar over ISO days, `ViewsCalendarProps`, which the default `RangeCalendar` atom draws the filter panel's month through (the date filter, its date ranges and its custom time scope). Reached without one, it throws an error naming it. The filter panel reaches it unless the app hands its own `RangeCalendar` atom. Where the provider's `panelControls` names `Calendar` (VK-1021), `CONTROLS.DateBody` draws its month with it too, in place of its own head and days, handed the day held, the month shown and its change, `locale` and `data-slot="vk-calendar"`; a day pressed in it is a day picked. Otherwise your `DateBody` alone decides. `CONTROLS.Calendar` is ViewKit's own: a month of the Date editor's days, one day a press, so an app that spreads `CONTROLS` needs no `Calendar` of its own.
|
|
453
497
|
|
|
454
498
|
`DateBody`, required: a whole date body your app draws, `ViewsDateBodyProps`. `CONTROLS.DateBody` is ViewKit's own, the Date editor. The date editor opens it in every host, handed the value on the conventions' calendar (a day, or a day and a time; a date-only field's stored instant on the browser's calendar, as its cell shows it), whether it holds a time, whether it may be emptied, the quick picks (`ViewsDatePick`: the provider's `datePicks`, by default today, tomorrow and next Monday, then `none` where it may be emptied; an app asks for a week from today by naming `in-a-week` there), today, what was typed on what opened it, `autoFocus` and `form`. The body hands back `onValueChange` (every change as it is made, a typed day once it reads as one) and `onDone` (a pick that finishes the edit). The editor keeps the draft, what each close means (Escape's keep or throw-away by field type), the save and, on a phone, the panel's ✕ and ✓: at `form: "phone"` your body draws none of its own. Escape is taken before your body hears it, so a popover of your own inside the body never hears Escape either; Tab walks your body's controls and closes from either end. An `onDone` after a plain Enter from inside your body closes the edit as Enter does (in a grid the next key lands the write first, ⌘Z included); after anything else it is a pick.
|
|
455
499
|
|
|
@@ -476,6 +520,8 @@ peer; the provider and every other door import neither library, so an app that h
|
|
|
476
520
|
|
|
477
521
|
`SelectionBar`, optional: the selection bar, which your app draws, `ViewsSelectionBarProps`, the props of ViewKit's `SelectionBar`. Handed one, ViewKit's `SelectionBar`, wherever your `renderBar` calls it, draws yours in its own place, in the box that holds it (a grid's frame), at every count, zero included, so it can leave as it chooses; left out, ViewKit draws its own bar, portalled to the screen's foot, placed by the provider's `selectionBar`. Beside the count, the clear, the verbs, `busy`, `onDelete` and `deleteLabel`, it is handed what ViewKit's own bar doesn't read: `noun` (what a row is, one and many), `deleteLine` (the line under Delete's question), and on each verb `more` (kept off the bar, in More), on an options verb `value` (what every picked row holds, null when every one is empty), `empty` (the empty row's words; a pick of it hands `null`) and `search`, its `options` ViewKit's picker items (a person by `avatarUrl` and `kind`), and a press (`onClick`, `onSelect`, `onDelete`) may hand back a `SelectionDone`, `{ words, undo }`, or a promise of one, which yours shows. `CONTROLS.SelectionBar` is the Outright bulk bar (`BulkBar`): on a computer a surface floating at the foot of the box that holds it, centred, its count (which clears), the verbs as outlined buttons, Delete in More or its own (its option `delete`, `BULK_BAR_LOOKS`), and More, holding what is kept off and what doesn't fit; on a phone, or in a `PhoneHost` screen, the tray, its verbs at 44 with Delete among them, or the pill (its option `phone`); one Tab stop with the arrows; Escape from the box clears; an options verb's values in the Picker (in the one Sheet on a phone); Delete asked first in ViewKit's alert dialog, then called, so your `onDelete` asks nothing of its own; what a press hands back said in its own Toast, just above it, with Undo; a press that throws said as one that didn't go through. It hands the box that holds it the room it takes, which a list that scrolls in it pads its foot by ([its tokens](controls/bulk-bar.md)). The provider's `selectionBar` placement and query are ViewKit's own bar's. Every word is your messages'.
|
|
478
522
|
|
|
523
|
+
`Pane`, optional: a toolbar panel standing at the right edge of the list's box, which your app draws, `ViewsPaneProps`; `CONTROLS.Pane` is ViewKit's own Pane (VK-1026). A toolbar with `customizeIn: "pane"` opens Customize in it on a computer, in the box it is handed (`paneBox`; the ready `<List>` hands its own, `vk-list-box`), under the toolbar and as tall as the list, the list in use beside it. It is handed `open` and `onOpenChange` (it closes from inside: Escape, its ✕), `container` (the list's box: positioned, holding the grid, never scrolling itself; null until it is on the page, when it draws nothing), `opener` (the part's button, ⋯ while the part is folded into it: give it the focus back as it closes from inside), `label` (its name to a screen reader) and `children` (the panel). Left out, Customize opens in the `Popover`, as with nothing set; on a phone it opens in the `Sheet` either way, and an app's own `hosts.options` wins over it.
|
|
524
|
+
|
|
479
525
|
`ViewsListBody`, required: the views list's whole body, which your app draws, `ViewsViewsListBodyProps`; `CONTROLS.ViewsListBody` is ViewKit's own. The view picker's chip opens it: in its popover on a computer and in the Sheet on a phone. The row's pills and its "+N" list stay ViewKit's (a view's menu there is `ViewMenu`'s). It is handed the list's name (`label`), the axis's views in its order (`views`, each its `value`, its words, its `icon`, its `count` (absent while the list's counts are hidden), `private` for one of the reader's own, and `menu`, the view's own verbs as your app gave them), the view in use (`value`), `form`, and, where the axis has them, `onCreate` with its word (`createLabel`; what holds the list closes first, then the axis's own create runs) and `onReorder` with `canDrag`. The body hands back `onViewChange` (a view picked; it closes nothing, so call `onDone` after it, as `CONTROLS.ViewsListBody` closes on a pick), `onReorder` (one whole block, the shared views or the reader's own, in its new order, each once) and `onDone` (what holds it closes). On a phone where the sheet's head doesn't draw it (the provider's `sheetActions` at `bar`), it is handed `actions`, the ✕ (`close`, which closes the list) and, while it stands on a step, Back (`back`); on a computer, and under `head`, it is handed none. On a computer it is handed `onHold`: while the body holds, a press outside the list and Escape close nothing (it asks a question outside the list, your `confirm` port's dialog), so the list stays when the question is answered. On a phone it is handed `onStepChange`: a body standing on a step of its own (a view's menu, Rename) tells it, and the sheet shows the step's title and Back and its Escape goes back a step. Where the axis hands `verbs` (`ViewsViewVerbs`: the `layouts` a new view can take, each its glyph by your `AppIcon`, the `records`' noun, a board's `columns` and `onChange`, which takes every change a view's menu makes, `ViewsViewChange`: rename, create, duplicate, delete, restore, save, reset, edit, link, favorite, private), the body is handed them, and each view its `layout`, `changed` and `favorite`. ViewKit checks each value before it is written: a pick that isn't one of `views`, and an order that isn't one whole block, write nothing. What creating, reordering and a view's verbs mean stays your app's, as the axis says. `CONTROLS.ViewsListBody` is ViewKit's own, the views list: a search over the views (at the Sheet's foot on a phone), each with its glyph, its count and its ⋮ where you hand it a menu, Shared and the reader's own under their headings with a lock on each of the reader's own, a view moved by a drag or ⌥↑ ⌥↓ within its block (never one `canDrag` refuses, nor a view dropped past one), ↓ and ↑ going on from the view in use, and New view where the axis grows. It draws no ✕ of its own: the Sheet's head draws it, and `actions` goes unread but for Back on a step. On a phone a view's ⋯ turns the one Sheet into its menu, with Back, never a sheet on top (VK-823). Handed `verbs`, a view's menu is the Outright kit's (`useViewMenu`): Rename… and New view in the Modal (New view where the axis grows, as without verbs, its create handed to `verbs.onChange`), Edit view, Private view, Save for everyone, Reset and Save as new view, Copy link, Favorite, Duplicate, and Delete, asked on a computer through the `confirm` port (ViewKit's alert dialog where your app hands none and `PortsHost` stands; the menu's own dialog where neither does, never the browser's) and said through the `toast` port's `success` with its `undo`. ViewKit moves no view itself: your `verbs.onChange` opens the right one, the first listed when the open one is deleted, the view again on a restore with `open`, the new one on a create or a duplicate (whose ids your app makes); `viewsAfter`, from `viewkitjs/views/controls`, does all of it over your views; on a phone each a step of the one Sheet, the delete question the Alert in its sheet form. Every word is your messages'.
|
|
480
526
|
|
|
481
527
|
`GroupBody`, optional and deprecated: read by nothing. Only ViewKit's own Customize opened it, and that Customize is gone; a `CustomizeBody` holds its group editor inside it, handed the same props as its `group`. A map that names it still compiles; it leaves in a later release. Its props, `ViewsGroupBodyProps`, are what a `CustomizeBody`'s `group` is handed: it is handed the group's name (`label`), the fields the list can be grouped by (`dimensions`, each its `value`, its words, its `orderOptions` with the direction each opens in, its `defaultOrder`, and a date's `granularities` with its `defaultGranularity`), the group as one value (`group`, a `ViewsGroupValue`: the dimension grouped by or `none`, the active dimension's `order` (`mode` and `dir`), its date step (`granularity`), `hideEmpty` while grouped where the list offers it, and `groups` while grouped where the list hands them, in the order the list shows them, each its `key`, its words, `empty`, `hidden`, and its `count` where the list counts it), `manualOrder` (your own order, `manual`, may be picked) and `form`. The body hands back `onGroupChange` (the whole group, every change as it is made) and `onDone` (inside Customize, back to its list). ViewKit makes one write for each change, in this order: a new Group by, order or date step is written alone, the rest of the value (about the old field's groups) set aside; else Hide empty groups; else the groups: the same groups in a new order (your own order), one group shown or hidden, every group hidden, or every group shown. A new Group by keeps the order and step handed with it only where the new field offers them, else takes the field's own. A value that changes two of those at once, names a field the list doesn't offer, names an order or step the field grouped by doesn't offer, or adds or loses a group writes nothing. It is handed no `actions`. It is handed `onStepChange`, on a computer and a phone: hand it a level of your own (`ViewsBodyStep`, its `title` and `onBack`: Group by's fields, an order's choices) while you stand on one, and `null` once you are back; what holds it shows the level's name in its head and its Back calls `onBack`. `CONTROLS.GroupBody`, kept so a map that names it compiles, is ViewKit's own, the group editor: Group by, Order, Direction, a date field's Date step and Hide empty groups, each opening its choices in place; the groups with their Switch, dragged into your own order, Hide all and Show all; Remove grouping; each change one write, Count ordered by each group's `count`, its level told through `onStepChange`.
|
|
@@ -507,7 +553,7 @@ words, always text; it may carry a `shortcut` hint and an `href`, and a `disable
|
|
|
507
553
|
`disabledReason`, why it can't be used, for you to show (a tooltip, a second line); a `checked` row is checkable and closes the menu like any row, unless it
|
|
508
554
|
carries `keepOpen`, a hint to leave the menu open so several can be ticked in turn; an
|
|
509
555
|
item's `children` are a group, its rows drawn in place under the item's label unless it carries `beside`, a hint to open them one level in, its row showing its label and `detail`, and
|
|
510
|
-
the group's own `onSelect`, `href` and `checked` are ignored, and a group marked `disabled` disables every row under it, at every depth: the provider hands your `Menu` those rows already `disabled`, each one that gives no reason carrying the group's `disabledReason`, so you draw each row by its own flag. Any row may carry `detail`, its current value in words, for its end. An adapter that draws none of the three keeps every row closing and every group in place, and loses nothing it needs. So an adapter needn't guess: a ticked row's `onSelect` fires on every pick, also when it is already ticked (a second pick of the ticked sort flips its direction), so an adapter that draws ticked rows as a radio value still calls it; ticked rows that close, inside a group, are one choice among several (a pick list), and ticked rows with `keepOpen` are separate ticks (checkboxes); a label is always text, so a swatch or a column's mark rides as the row's `icon` beside it. The sheet takes `label`, its title in words whenever the title is words (its accessible name, and the title of a head that takes only text), and, when the provider's `sheetActions` is `head`, `actions`: the editor panel's ✕ (`close`) and ✓ (`done`, absent where the body saves on its pick), or a toolbar panel's ✕ alone (`close`, which closes it), or the sort editor's ✕ (`close`, which takes its rules back to what they were as the sheet opened) and ✓ (`done`), each a `label` and an `
|
|
556
|
+
the group's own `onSelect`, `href` and `checked` are ignored, and a group marked `disabled` disables every row under it, at every depth: the provider hands your `Menu` those rows already `disabled`, each one that gives no reason carrying the group's `disabledReason`, so you draw each row by its own flag. Any row may carry `detail`, its current value in words, for its end. An adapter that draws none of the three keeps every row closing and every group in place, and loses nothing it needs. So an adapter needn't guess: a ticked row's `onSelect` fires on every pick, also when it is already ticked (a second pick of the ticked sort flips its direction), so an adapter that draws ticked rows as a radio value still calls it; ticked rows that close, inside a group, are one choice among several (a pick list), and ticked rows with `keepOpen` are separate ticks (checkboxes); a label is always text, so a swatch or a column's mark rides as the row's `icon` beside it. The sheet takes `label`, its title in words whenever the title is words (its accessible name, and the title of a head that takes only text), and, when the provider's `sheetActions` is `head`, `actions`: the editor panel's ✕ (`close`) and ✓ (`done`, absent where the body saves on its pick), or a toolbar panel's ✕ alone (`close`, which closes it), or the sort editor's ✕ (`close`, which takes its rules back to what they were as the sheet opened) and ✓ (`done`), each a `label`, an `onPress` and, on an editor panel's, a `slot` (`vk-editor-close`, `vk-editor-save`, `vk-editor-back`: draw it on your button as its `data-slot`), for your sheet's own head; with `bar`, the default, the panel draws them itself. `AppIcon` is the app's own icon component by the app's own names, for
|
|
511
557
|
the glyphs a host declares (a row's icon, a binding's icon, an option's icon), drawn on the first paint (rows are measured as they mount); the semantic glyphs the rendering itself
|
|
512
558
|
needs are a port, by meaning (below); `CONTROLS.AppIcon` draws ViewKit's own glyph of each meaning's name. `Markdown` is the
|
|
513
559
|
app's markdown renderer, handed the stored text whole; the package draws rich text through it and parses none, and
|
|
@@ -766,7 +812,7 @@ apart from the rest; each name starts with its panel's: `vk-sort-`, `vk-filter-`
|
|
|
766
812
|
section's, a toggle's, a verb's), and a sort rule or a filter's item its place, `data-index`, from 0. Two filter rules on one field share a
|
|
767
813
|
`data-key`, and a filter's `data-index` counts again from 0 at each level of its groups. Where your own `Menu` draws a part (a
|
|
768
814
|
view's menu), it is handed the part's `data-slot` as a prop (`ViewsMenuProps`), and so are your `Button`, `Select`, `Menu`,
|
|
769
|
-
`Popover` and `Input` inside the
|
|
815
|
+
`Popover` and `Input` inside the panels and the text, number and date editors under the provider's `panelControls` (VK-1013, VK-1014, VK-1021; a menu's rows by their item's `slot`
|
|
770
816
|
and `key`): draw them on the element your stylesheet styles. ViewKit's own Select, Input, Radio,
|
|
771
817
|
Toggle, PaneHead, PaneFoot and Notice draw a name a panel hands them on their box. The Picker's own parts (its search, its rows, its actions) are the Picker's; a panel row the Picker draws carries the
|
|
772
818
|
panel's name. A row drawn from data takes its name from its entry's `slot` (`PartSlot`: `slot`, `key`, `index`), on a Menu list's
|
|
@@ -822,6 +868,16 @@ entry and choice and a Picker's item.
|
|
|
822
868
|
`data-slot="vk-quick-value"` (a value, `data-key` the value, `data-held` while it is held: read it beside the name, since the
|
|
823
869
|
Picker's rows carry a `data-held` of their own), `data-slot="vk-quick-count"` (its
|
|
824
870
|
count), `data-slot="vk-quick-clear"` (a held value's ✕) and `data-slot="vk-quick-none"` (nothing found).
|
|
871
|
+
- The last parts round the panels (VK-1003): the filter bar's own popover names its typed value's box
|
|
872
|
+
`data-slot="vk-filter-part-value"` and a range's two numbers `data-slot="vk-filter-part-pair"` (the row they stand in);
|
|
873
|
+
the quick filters' strip of fields is `data-slot="vk-quick-strip"` and its values' list `data-slot="vk-quick-values"`
|
|
874
|
+
(`data-key` the field's id); Customize's empty line is `data-slot="vk-customize-none"` (`data-key` `columns` where no column
|
|
875
|
+
matches the search, `choices` where a field has nothing to pick), a column's own rows `data-slot="vk-customize-rows"`
|
|
876
|
+
(`data-key` its id) and Columns' foot rows `data-slot="vk-customize-columns-foot"`. A phone menu's sheet carries its menu's name,
|
|
877
|
+
and on a phone the views list's step that holds a view's menu is named `vk-view-menu` too, its rows `vk-view-menu-row`
|
|
878
|
+
whether or not the axis hands `verbs`. A panel's own phone head (the quick filters', the views list's step, Customize's in a
|
|
879
|
+
Sheet of yours) names its ✕ and ‹ `vk-editor-close` and `vk-editor-back`, as the sort's and filter's do (and their ✓
|
|
880
|
+
`vk-editor-save`).
|
|
825
881
|
|
|
826
882
|
Lists that scroll wear the class `scrollbar-overlay`, which an app may define (to show the OS
|
|
827
883
|
overlay scrollbar, say); without it the class does nothing.
|
|
@@ -35,3 +35,7 @@ What it stands in on a phone, its panel or a Sheet, is the Alert's Opens as (`da
|
|
|
35
35
|
| `--vk-radius-lg` | size | `radius-lg` | `10px` |
|
|
36
36
|
| `--vk-radius-xl` | size | `radius-xl` | `15px` |
|
|
37
37
|
| `--vk-radius-3xl` | size | `radius-3xl` | `26.67px` |
|
|
38
|
+
|
|
39
|
+
## Inside a panel
|
|
40
|
+
|
|
41
|
+
Inside a panel under the provider's `panelControls` (the view menu's Rename and New view, and its Delete on a phone) its buttons are the app's own Button, ViewKit's anywhere else (VK-1014). On a computer the view menu's Delete is asked through the `confirm` port: ViewKit's own (`PortsHost`) stays ViewKit's, so hand your own `confirm` to draw that question yourself.
|
|
@@ -28,3 +28,7 @@ How far its words stand from the panel's edge is the alert dialog's (`--alert-pa
|
|
|
28
28
|
| `--vk-warning-subtler` | colour | `background-warning-subtler` | `hsl(19 72% 92.5%)` · dark `hsl(20 29% 13.5%)` |
|
|
29
29
|
| `--vk-warning` | colour | `text-warning` | `hsl(25 92% 41%)` · dark `hsl(25 92% 41%)` |
|
|
30
30
|
| `--vk-danger-subtler` | colour | `background-danger-subtler` | `hsl(6 100% 94%)` · dark `hsl(6 27% 14.5%)` |
|
|
31
|
+
|
|
32
|
+
## Inside a panel
|
|
33
|
+
|
|
34
|
+
Inside a panel under the provider's `panelControls` (the view menu's Rename and New view, and its Delete on a phone) its buttons are the app's own Button, ViewKit's anywhere else (VK-1014). On a computer the view menu's Delete is asked through the `confirm` port: ViewKit's own (`PortsHost`) stays ViewKit's, so hand your own `confirm` to draw that question yourself.
|
|
@@ -39,3 +39,7 @@ The bar draws its surface, its place, its count, the room its Toast rises in, an
|
|
|
39
39
|
| `--vk-shadow-lg` | shadow | `shadow-lg` | `0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1)` · dark `0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1)` |
|
|
40
40
|
| `--vk-shadow-menu` | shadow | `shadow-menu` | `0 6px 18px hsl(0 0% 0% / 0.06), 0 3px 9px hsl(0 0% 0% / 0.05), 0 1px 1px hsl(0 0% 0% / 0.04)` · dark `0 8px 24px hsl(0 0% 0% / 0.5), 0 0 0 1px hsl(0 0% 18%)` |
|
|
41
41
|
| `--vk-spacing` | size | `spacing` | `4px` |
|
|
42
|
+
|
|
43
|
+
## Its parts
|
|
44
|
+
|
|
45
|
+
The bar names every part it draws, and every part of what it opens, with a public `data-slot`: `vk-bulk-bar`, `vk-bulk-count`, `vk-bulk-separator`, `vk-bulk-verb`, `vk-bulk-delete`, `vk-bulk-more`, `vk-bulk-clear`, `vk-bulk-actions`, `vk-bulk-menu`, `vk-bulk-menu-row`, `vk-bulk-group-menu`, `vk-bulk-group-row`, `vk-bulk-choice`, `vk-bulk-empty`, `vk-bulk-field`, `vk-bulk-field-sheet`, `vk-bulk-toasts` (`BULK_BAR_SLOTS`). A verb, on the bar and as a menu's row, says which one it is by `data-key`, its place in the verbs; its measured copy wears the same. Dress a part by its name, never by a class: [the bulk bar's parts](../contract.md#the-bulk-bars-parts-vk-1023).
|
|
@@ -20,4 +20,6 @@ The Menu list, the Radio, the Input, the Button, the Notice, the Pane and the Sh
|
|
|
20
20
|
|
|
21
21
|
Each part inside it carries a public `data-slot` (VK-988), so your stylesheet dresses one part apart from the rest; a part that repeats also says which one it is (`data-key`, and a rule its place, `data-index`). What each names, and its keys: [the panels' parts](../contract.md#the-atoms).
|
|
22
22
|
|
|
23
|
-
`vk-customize`, `vk-customize-head`, `vk-customize-title`, `vk-customize-back`, `vk-customize-close`, `vk-customize-layout-button`, `vk-customize-name`, `vk-customize-heading`, `vk-customize-section`, `vk-customize-field`, `vk-customize-toggle`, `vk-customize-toggle-reset`, `vk-customize-choice`, `vk-customize-option`, `vk-customize-layout`, `vk-customize-column`, `vk-customize-search`, `vk-customize-columns-action`, `vk-customize-foot`, `vk-customize-changes`, `vk-customize-action`, `vk-customize-stale`.
|
|
23
|
+
`vk-customize`, `vk-customize-head`, `vk-customize-title`, `vk-customize-back`, `vk-customize-close`, `vk-customize-layout-button`, `vk-customize-name`, `vk-customize-heading`, `vk-customize-section`, `vk-customize-field`, `vk-customize-toggle`, `vk-customize-toggle-reset`, `vk-customize-choice`, `vk-customize-option`, `vk-customize-layout`, `vk-customize-column`, `vk-customize-search`, `vk-customize-columns-action`, `vk-customize-foot`, `vk-customize-changes`, `vk-customize-action`, `vk-customize-stale`, `vk-customize-none`, `vk-customize-rows`, `vk-customize-columns-foot`.
|
|
24
|
+
|
|
25
|
+
Under the provider's `panelControls` its buttons, boxes that pick and text boxes are the app's own, each handed its part's name (VK-1014). On a phone in a Sheet of the app's, its own head names its ‹ and ✕ `vk-editor-back` and `vk-editor-close`, the app's Button where `panelControls` names it.
|
|
@@ -45,3 +45,5 @@ It also reads other controls' own names where it stands inside them, the Popover
|
|
|
45
45
|
## Its parts
|
|
46
46
|
|
|
47
47
|
The Date editor names every part it draws with a public `data-slot`, the same in the grid, the field row and a phone's sheet, on the box a person sees: `vk-date`, `vk-calendar`, `vk-date-line`, `vk-date-reads`, `vk-date-error`, `vk-date-time`, `vk-date-head`, `vk-date-prev`, `vk-date-next`, `vk-date-month`, `vk-date-year`, `vk-date-days`, `vk-date-weekdays`, `vk-date-day`, `vk-date-choices`, `vk-date-choice`, `vk-date-quarters`, `vk-date-quarter`, `vk-date-parts`, `vk-date-part`, `vk-date-segment`, `vk-date-sep`, `vk-date-picks`, `vk-date-pick`, `vk-date-card`, `vk-date-wheels`, `vk-date-wheel`, `vk-date-wheel-row`. The default Calendar is `vk-calendar`, and its head and days take the same names; a quick pick says which by `data-key` (`today`, `tomorrow`, `none`…). Its ✕, ✓ and a step's ‹ are `vk-editor-close`, `vk-editor-save` and `vk-editor-back`. Dress a part by its name, never by a class: [the field editors' parts](../contract.md#the-field-editors-parts-vk-989).
|
|
48
|
+
|
|
49
|
+
Under the provider's `panelControls` its buttons and one-line boxes are the app's own, handed each part's name (VK-1021). Its month is the app's `Calendar` where `panelControls` names one. What stays ViewKit's: [reshaping](../reshaping.md).
|
|
@@ -33,4 +33,4 @@ Each part inside it carries a public `data-slot` (VK-988), so your stylesheet dr
|
|
|
33
33
|
|
|
34
34
|
`vk-filter`, `vk-filter-rules`, `vk-filter-item`, `vk-filter-rule`, `vk-filter-where`, `vk-filter-joined`, `vk-filter-join`, `vk-filter-field`, `vk-filter-how`, `vk-filter-value`, `vk-filter-rule-more`, `vk-filter-rule-action`, `vk-filter-group`, `vk-filter-group-head`, `vk-filter-quantifier`, `vk-filter-group-more`, `vk-filter-group-action`, `vk-filter-delete`, `vk-filter-add`, `vk-filter-clear`, `vk-filter-foot`, `vk-filter-none`, `vk-filter-excluded`, `vk-filter-head`.
|
|
35
35
|
|
|
36
|
-
Under the provider's `panelControls` its buttons, boxes that pick, menus, popovers and text boxes are the app's own, each handed its part's name (VK-1013).
|
|
36
|
+
Under the provider's `panelControls` its buttons, boxes that pick, menus, popovers and text boxes are the app's own, each handed its part's name (VK-1013). The filter bar's own popover (`FilterPartBody`) names its typed value's box `vk-filter-part-value` and a range's two numbers `vk-filter-part-pair` (VK-1003); its words' box is the app's Input there too, and a date part the date editor with the app's controls (VK-1014, VK-1021); its Number field stays ViewKit's.
|
|
@@ -15,3 +15,5 @@ The Menu list, the Picker, the Button and the Sheet it draws with read their own
|
|
|
15
15
|
Each part inside it carries a public `data-slot` (VK-988), so your stylesheet dresses one part apart from the rest; a part that repeats also says which one it is (`data-key`, and a rule its place, `data-index`). What each names, and its keys: [the panels' parts](../contract.md#the-atoms).
|
|
16
16
|
|
|
17
17
|
`vk-group`, `vk-group-setting`, `vk-group-choice`, `vk-group-heading`, `vk-group-value`, `vk-group-hide-all`, `vk-group-remove`.
|
|
18
|
+
|
|
19
|
+
Under the provider's `panelControls` its Hide all is the app's own Button, handed its part's name (VK-1014); its field list and that list's search are the Picker's.
|
|
@@ -12,4 +12,6 @@ Every name the Menu's stylesheet (`menu.css`) reads, each optional: the ready st
|
|
|
12
12
|
|
|
13
13
|
## Its name in a panel
|
|
14
14
|
|
|
15
|
-
A menu a
|
|
15
|
+
A menu a part names takes `data-slot` (VK-988: `vk-view-menu`; VK-1023: the bulk bar's `vk-bulk-menu`), drawn on its popup on a computer and on its sheet on a phone; its rows take theirs from each entry's `slot` (`PartSlot`). ViewKit's own map Menu (`ViewsMenuProps`) names a named menu's rows `<name>-row`, each by its item's `data-key`; a menu nobody names draws as before.
|
|
16
|
+
|
|
17
|
+
Name a menu under the panels' prefixes (`vk-view-menu`, `vk-bulk-menu`): any other `vk-` name would make its phone sheet a reset root, and ViewKit's reset would reach inside it (VK-1003).
|
|
@@ -53,3 +53,7 @@ Every name `modal.css` reads, each optional: the ready stylesheet declares it at
|
|
|
53
53
|
| `--vk-fg-subtlest` | colour | `text-subtlest` | `hsl(210 1% 53.5%)` · dark `hsl(210 3% 53%)` |
|
|
54
54
|
| `--vk-radius-full` | size | `radius-full` | `9999px` |
|
|
55
55
|
| `--vk-overlay-card` | colour | `surface-overlay-card` | `hsl(0 0% 94%)` · dark `hsl(225 7% 15%)` |
|
|
56
|
+
|
|
57
|
+
## Inside a panel
|
|
58
|
+
|
|
59
|
+
Inside a panel under the provider's `panelControls` (the view menu's Rename and New view, and its Delete on a phone) its buttons are the app's own Button, ViewKit's anywhere else (VK-1014). On a computer the view menu's Delete is asked through the `confirm` port: ViewKit's own (`PortsHost`) stays ViewKit's, so hand your own `confirm` to draw that question yourself.
|
|
@@ -14,3 +14,5 @@ Every name `number-editor.css` reads (beside the stylesheets of the controls it
|
|
|
14
14
|
## Its parts
|
|
15
15
|
|
|
16
16
|
The Number editor names every part it draws with a public `data-slot`, the same in the grid, the field row and a phone's sheet, on the box a person sees: `vk-number`, `vk-number-box`, `vk-number-currency`, `vk-number-unit`. Its ✕, ✓ and a step's ‹ are `vk-editor-close`, `vk-editor-save` and `vk-editor-back`. Dress a part by its name, never by a class: [the field editors' parts](../contract.md#the-field-editors-parts-vk-989).
|
|
17
|
+
|
|
18
|
+
Under the provider's `panelControls` its buttons and popover are the app's own, handed each part's name (VK-1021). What stays ViewKit's: [reshaping](../reshaping.md).
|
|
@@ -38,4 +38,6 @@ The Toggle group, the Input, the Avatar, the Status and the Scrollbar it draws w
|
|
|
38
38
|
|
|
39
39
|
Each part inside it carries a public `data-slot` (VK-988), so your stylesheet dresses one part apart from the rest; a part that repeats also says which one it is (`data-key`, and a rule its place, `data-index`). What each names, and its keys: [the panels' parts](../contract.md#the-atoms).
|
|
40
40
|
|
|
41
|
-
`vk-quick`, `vk-quick-field`, `vk-quick-search`, `vk-quick-value`, `vk-quick-count`, `vk-quick-clear`, `vk-quick-none`, `vk-quick-head`.
|
|
41
|
+
`vk-quick`, `vk-quick-field`, `vk-quick-search`, `vk-quick-value`, `vk-quick-count`, `vk-quick-clear`, `vk-quick-none`, `vk-quick-head`, `vk-quick-strip`, `vk-quick-values`.
|
|
42
|
+
|
|
43
|
+
Under the provider's `panelControls` its search is the app's own Input and its own phone head's ✕ (`vk-editor-close`) the app's Button (VK-1014); its strip of fields (ViewKit's Toggle) and its values stay ViewKit's.
|
|
@@ -42,4 +42,4 @@ Every name the bottom Sheet's stylesheet (`sheet.css`) reads, each optional: the
|
|
|
42
42
|
|
|
43
43
|
## Its buttons' names
|
|
44
44
|
|
|
45
|
-
`SheetButton` draws a handed `data-slot` on both its forms. `SheetHead` draws its `backSlot` on its ‹ (`data-slot`): a field editor's step hands `vk-editor-back`. ViewKit's own Sheet names the ✕, ✓ and ‹ it draws from its `actions` (`sheetActions: "head"`) `vk-editor-close`, `vk-editor-save` and `vk-editor-back`.
|
|
45
|
+
`Sheet` draws a handed `data-slot` on the sheet itself (VK-1023: the bulk bar's field sheet, `vk-bulk-field-sheet`, and a named Menu's sheet on a phone). `SheetButton` draws a handed `data-slot` on both its forms. `SheetHead` draws its `backSlot` on its ‹ (`data-slot`): a field editor's step hands `vk-editor-back`. ViewKit's own Sheet names the ✕, ✓ and ‹ it draws from its `actions` (`sheetActions: "head"`) `vk-editor-close`, `vk-editor-save` and `vk-editor-back`.
|
|
@@ -25,3 +25,5 @@ It also reads the inline input's own `--inline-input-ring` and `--inline-input-c
|
|
|
25
25
|
## Its parts
|
|
26
26
|
|
|
27
27
|
The Text editor names every part it draws with a public `data-slot`, the same in the grid, the field row and a phone's sheet, on the box a person sees: `vk-text`, `vk-text-box`, `vk-text-country`, `vk-text-dial`, `vk-text-note`. Its ✕, ✓ and a step's ‹ are `vk-editor-close`, `vk-editor-save` and `vk-editor-back`. Dress a part by its name, never by a class: [the field editors' parts](../contract.md#the-field-editors-parts-vk-989).
|
|
28
|
+
|
|
29
|
+
Under the provider's `panelControls` its buttons, popover and one-line boxes are the app's own, handed each part's name (VK-1021). What stays ViewKit's: [reshaping](../reshaping.md).
|
|
@@ -12,3 +12,7 @@ The Toolbar draws nothing of its own but its lines, the room between what each h
|
|
|
12
12
|
| `--vk-duration-base` | motion | `duration-base` | `200ms` |
|
|
13
13
|
| `--vk-ease-out` | motion | `ease-out` | `cubic-bezier(0, 0, 0.2, 1)` |
|
|
14
14
|
| `--vk-spacing` | size | `spacing` | `4px` |
|
|
15
|
+
|
|
16
|
+
## A separator's name
|
|
17
|
+
|
|
18
|
+
`ToolbarSeparatorControl` draws a handed `data-slot` on its line, in a toolbar and outside one (VK-1023: the bulk bar's `vk-bulk-separator`).
|
|
@@ -12,3 +12,5 @@ Every name `views-list.css` reads (beside the stylesheets of the controls it dra
|
|
|
12
12
|
Each part inside it carries a public `data-slot` (VK-988), so your stylesheet dresses one part apart from the rest; a part that repeats also says which one it is (`data-key`, and a rule its place, `data-index`). What each names, and its keys: [the panels' parts](../contract.md#the-atoms).
|
|
13
13
|
|
|
14
14
|
`vk-views-list`, `vk-views-list-row`, `vk-views-list-head`, `vk-view-menu`, `vk-view-menu-row`, `vk-view-menu-name`, `vk-view-menu-layout`, `vk-view-menu-columns`, `vk-view-menu-act`.
|
|
15
|
+
|
|
16
|
+
Under the provider's `panelControls` its buttons, boxes that pick and text boxes are the app's own, each handed its part's name (VK-1014). A phone step's own head names its ‹ `vk-editor-back`. The views list's rows, and their ⋯, are the Picker's.
|
|
@@ -4,7 +4,7 @@ Every view reads what it takes from its app, other than its own props, from one
|
|
|
4
4
|
|
|
5
5
|
## Mount it once
|
|
6
6
|
|
|
7
|
-
`ViewsProvider` sits once at your app's client root, above every view. It needs one thing and the children: `components` (your primitives; `components={CONTROLS}` is ViewKit's own, every slot filled). Three more have defaults, so you hand them only to draw your own: `icons` (your glyphs by meaning; absent, each drawn through your `AppIcon` by its name, which `CONTROLS.AppIcon` draws with ViewKit's own glyphs), `ports` (your haptics, clipboard, per-device store, toast and confirm dialog, each optional; [ports](ports.md)) and `conventions` (absent, `en-US` in `UTC`). Eleven more are optional: `atoms`, `messages`, `presentation`, `desktopQuery`, `sheetActions`, `escape`, `oneValue`, `severalValues`, `selectionBar`, `datePicks` and `panelControls` (your own controls inside ViewKit's panels, below).
|
|
7
|
+
`ViewsProvider` sits once at your app's client root, above every view. It needs one thing and the children: `components` (your primitives; `components={CONTROLS}` is ViewKit's own, every slot filled). Three more have defaults, so you hand them only to draw your own: `icons` (your glyphs by meaning; absent, each drawn through your `AppIcon` by its name, which `CONTROLS.AppIcon` draws with ViewKit's own glyphs), `ports` (your haptics, clipboard, per-device store, toast and confirm dialog, each optional; [ports](ports.md)) and `conventions` (absent, `en-US` in `UTC`). Eleven more are optional: `atoms`, `messages`, `presentation`, `desktopQuery`, `sheetActions`, `escape`, `oneValue`, `severalValues`, `selectionBar`, `datePicks` and `panelControls` (your own controls inside ViewKit's panels and field editors, below).
|
|
8
8
|
|
|
9
9
|
`desktopQuery` says which screens are desktops: there an editor opens as a popover, and elsewhere as a sheet; so do the toolbar's panels and the views picker outside a `Toolbar` (inside one, the toolbar's phone form decides), and the grid's own chrome: a row's and a group's ⋯ and the row actions show on hover on a desktop, and a row's and a group's ⋯ always elsewhere, where the row actions don't show. It defaults to `DEFAULT_DESKTOP_QUERY`, `(min-width: 1024px)`; hand in the query your own shell switches on, so the editors and your layout change at the same width. A server render counts as a desktop.
|
|
10
10
|
|
|
@@ -73,7 +73,7 @@ assert.equal(conventions.locale, "en-GB"); // the app's own, untouched
|
|
|
73
73
|
|
|
74
74
|
## The components map
|
|
75
75
|
|
|
76
|
-
The package draws nothing with a UI library of its own. `ViewsComponents`, from `viewkitjs/views/react`, is the map you hand it: `Button`, `Popover`, `Tooltip`, `Checkbox`, `Menu`, `Collapse`, `Sheet`, `AppIcon`, `Markdown`, `TextBody` (a whole body for a text typed as one string), `NumberBody` (a whole body for a number, money or a percent), `Picker` (a whole pick list), `LinksBody` (a whole links body: each link's roles and its lead), `DateBody` (a whole date body), `PartsBody` (a whole body for a name, a place or a range) and `ValuesBody` (a whole body for several emails, phones, links or domains), `SortBody` (the sort editor's whole body), `FilterBody` (the filter editor's whole body), `FilterPartBody` (a filter rule's way and value), `FieldsBody` (the field list's whole body), `QuickFiltersBody` (the quick filters' whole body), `ViewsListBody` (the views list's whole body) and `CustomizeBody` (Customize's whole body), and ten you may leave out: `Input`, `Select` (the panels' boxes that pick, drawn only under `panelControls`), `Command` (the command list's parts, for the grid's menus on the popover route), `Calendar` (the filter panel's month), `RowsWait` (what a grid's rows wait in while new ones load), `GroupBody` (deprecated: read by nothing), `SearchField` (the toolbar's search box), `PortsHost` (what draws the `toast` and `confirm` ports you leave out), `SelectionBar` (the selection bar) and `ViewMenu` (a view's whole menu). The [contract](../contract.md#the-components-map) says what each slot must accept; the [`viewkitjs/views/react` reference](../reference/react.md) lists every prop.
|
|
76
|
+
The package draws nothing with a UI library of its own. `ViewsComponents`, from `viewkitjs/views/react`, is the map you hand it: `Button`, `Popover`, `Tooltip`, `Checkbox`, `Menu`, `Collapse`, `Sheet`, `AppIcon`, `Markdown`, `TextBody` (a whole body for a text typed as one string), `NumberBody` (a whole body for a number, money or a percent), `Picker` (a whole pick list), `LinksBody` (a whole links body: each link's roles and its lead), `DateBody` (a whole date body), `PartsBody` (a whole body for a name, a place or a range) and `ValuesBody` (a whole body for several emails, phones, links or domains), `SortBody` (the sort editor's whole body), `FilterBody` (the filter editor's whole body), `FilterPartBody` (a filter rule's way and value), `FieldsBody` (the field list's whole body), `QuickFiltersBody` (the quick filters' whole body), `ViewsListBody` (the views list's whole body) and `CustomizeBody` (Customize's whole body), and ten you may leave out: `Input`, `Select` (the panels' boxes that pick, drawn only under `panelControls`), `Command` (the command list's parts, for the grid's menus on the popover route), `Calendar` (the filter panel's month, and the date editor's under `panelControls`), `RowsWait` (what a grid's rows wait in while new ones load), `GroupBody` (deprecated: read by nothing), `SearchField` (the toolbar's search box), `PortsHost` (what draws the `toast` and `confirm` ports you leave out), `SelectionBar` (the selection bar) and `ViewMenu` (a view's whole menu). The [contract](../contract.md#the-components-map) says what each slot must accept; the [`viewkitjs/views/react` reference](../reference/react.md) lists every prop.
|
|
77
77
|
|
|
78
78
|
The shapes are Base UI's, and the types promise three things:
|
|
79
79
|
|
|
@@ -96,9 +96,9 @@ export function ViewsWithYourControls({ children }: { children: ReactNode }) {
|
|
|
96
96
|
}
|
|
97
97
|
```
|
|
98
98
|
|
|
99
|
-
`panelControls` takes `true` (all
|
|
99
|
+
`panelControls` takes `true` (all six) or the names you want (`["Button", "Select"]`). The sort and filter panels then draw every button, box that picks, menu, popover and text box with yours (VK-1013), and so do the group editor, Customize, the views list and view menu (with the Modal they open, and on a phone the Delete question: on a computer it goes to your `confirm` port), the quick filters' search, the filter bar's typed value and date and every head a panel draws itself on a phone, its ✕, ‹ and ✓ (VK-1014), and the text, number and date editors, each button, popover and one-line box, with `Calendar` their date's month in place of its own head and days (VK-1021; the Picker, the name, place and range parts, the values and links editors and the bulk bar follow in VK-1022 and VK-1023). Inside a box group of ViewKit's (a date's line, a phone number's digits, Customize's and the quick filters' searches) your Input is handed `chrome="bare"`, the group drawing the frame; a box that grows over lines, a search list's box, the Number field and a duration's box stay ViewKit's ([reshaping](../reshaping.md)). Each is handed the map's props, never ViewKit's own look: your Button a `variant` from what it is (an outlined Add sort `outline`, a quiet × `ghost` at `size="icon"`), its icon and words as its children, `aria-disabled` where it can't be used but keeps its focus; your Select its rows, value and pick, `open` and `onOpenChange`, the search's words; your Menu its rows as data, opened at the button that opens it; your Popover its anchor, its close and its `label`; your Input its typing as `onChange`, in your field's frame (`chrome="field"`). Each part's name rides with it as `data-slot` and `data-key`, so your control and your stylesheet meet on one name. A control of `CONTROLS`' stays ViewKit's whatever `panelControls` says. A `Select` of your own that `panelControls` doesn't name is never drawn, and ViewKit says so once in development.
|
|
100
100
|
|
|
101
|
-
Still ViewKit's inside the panels: the Tooltip, the Picker (the field lists), the menu rows of ViewKit's own menus, the sort's grip, the filter's number and range boxes (ViewKit's Number field), and the
|
|
101
|
+
Still ViewKit's inside the panels: the Tooltip, the Picker (the field lists, the views list's rows), the menu rows of ViewKit's own menus, Radio, Toggle, the quick filters' values, the sort's grip, the filter's number and range boxes (ViewKit's Number field), and the head ViewKit's own `Sheet` draws (Customize's and the views list's on a phone): hand your own `Sheet` and the panels draw their heads with your Button. A filter rule's value box is named by what holds it (`vk-filter-value`), not on the box your Select or Input draws. Not handed: a button's busy state (`loading`): your Button isn't told a Save or a Delete is running; ViewKit still takes no second press.
|
|
102
102
|
|
|
103
103
|
### An adapter over Radix
|
|
104
104
|
|
|
@@ -4,7 +4,7 @@ Import from `viewkitjs/views/controls` to draw ViewKit's default controls: the O
|
|
|
4
4
|
|
|
5
5
|
## The defaults
|
|
6
6
|
|
|
7
|
-
- `CONTROLS` — the components map's defaults, for each control an app leaves out: each control below that fills a slot of the map. An app spreads it first and its own controls after, `components={{ ...CONTROLS, ...own }}`. Handed as it stands, `components={CONTROLS}`, it brings `CONTROL_ATOMS` too, under the provider's `atoms`; a map spread from it brings none. Its `Button` draws ViewKit's buttons (`variant`, `size`) as the kit's Button's kinds and sizes, stands a glyph handed before the words as the Button's icon, and one handed after them as its end icon. Its `AppIcon` draws ViewKit's own glyph of each name (`CONTROL_ICONS`), and nothing for a name it doesn't draw; a provider handed no `icons` draws every meaning through it. Its `Markdown` draws the stored text as it stands, its line breaks kept, with no renderer. Its `Button`, `Select`, `Menu`, `Popover` and `
|
|
7
|
+
- `CONTROLS` — the components map's defaults, for each control an app leaves out: each control below that fills a slot of the map. An app spreads it first and its own controls after, `components={{ ...CONTROLS, ...own }}`. Handed as it stands, `components={CONTROLS}`, it brings `CONTROL_ATOMS` too, under the provider's `atoms`; a map spread from it brings none. Its `Button` draws ViewKit's buttons (`variant`, `size`) as the kit's Button's kinds and sizes, stands a glyph handed before the words as the Button's icon, and one handed after them as its end icon. Its `AppIcon` draws ViewKit's own glyph of each name (`CONTROL_ICONS`), and nothing for a name it doesn't draw; a provider handed no `icons` draws every meaning through it. Its `Markdown` draws the stored text as it stands, its line breaks kept, with no renderer. Its `Button`, `Select`, `Menu`, `Popover`, `Input` and `Calendar` are ViewKit's own: named in the provider's `panelControls`, they still draw the panels and the field editors exactly as without it.
|
|
8
8
|
- `CONTROL_ICONS` — ViewKit's default glyphs by meaning, a `ViewsIcons` over every `ICON_NAMES` meaning, each a Tabler icon as the Outright kit draws it (a line of 2 in the colour of its words; the carets filled; `loading` the Spinner): what `CONTROLS.AppIcon` draws, for an app with an `AppIcon` of its own that keeps ViewKit's glyphs, `icons={CONTROL_ICONS}`.
|
|
9
9
|
- `leadingGlyph` — `leadingGlyph(children, glyphs)`: a glyph before a button's words (an svg, or one of the app's icons or its `AppIcon` in `glyphs`) as `icon`, one after them as `iconEnd`, and the words as `label`; a glyph alone, or another component, stays `{ label }`.
|
|
10
10
|
|
|
@@ -83,7 +83,7 @@ Import from `viewkitjs/views/controls` to draw ViewKit's default controls: the O
|
|
|
83
83
|
|
|
84
84
|
## The bottom Sheet
|
|
85
85
|
|
|
86
|
-
- `Sheet` — what rises from the bottom of the phone, in a `form` (`full`, `floating`, `blend`, `edge`) and at `stops`, on Base UI's drawer: the drag, focus, Escape and the dim, and a settle on a spring that starts from the finger's speed. What it holds is poured in. `standing` keeps it in its `container`, a screen on a page. It says why it closed. `CONTROLS.Sheet` draws ViewKit's sheets with it, the editor's ✕ (or Back) and ✓ in its head; its height is the `snap` asked (`auto` the `edge` form, as tall as its content; `half` the `blend` form, opening at half; `peek` opening at the small stop; `full`, and none, to the top), a title that isn't words is drawn as handed (its name to screen readers still the label), `description` under the title and `className` on the sheet itself, a prop of the Sheet too.
|
|
86
|
+
- `Sheet` — what rises from the bottom of the phone, in a `form` (`full`, `floating`, `blend`, `edge`) and at `stops`, on Base UI's drawer: the drag, focus, Escape and the dim, and a settle on a spring that starts from the finger's speed. What it holds is poured in. `standing` keeps it in its `container`, a screen on a page. It says why it closed. `CONTROLS.Sheet` draws ViewKit's sheets with it, the editor's ✕ (or Back) and ✓ in its head; its height is the `snap` asked (`auto` the `edge` form, as tall as its content; `half` the `blend` form, opening at half; `peek` opening at the small stop; `full`, and none, to the top), a title that isn't words is drawn as handed (its name to screen readers still the label), `description` under the title and `className` on the sheet itself, a prop of the Sheet too; its own `data-slot` is drawn on its popup (a phone menu's sheet carries its menu's name).
|
|
87
87
|
- `SheetProps` — its props.
|
|
88
88
|
- `SheetChangeDetails` — why it opened or closed.
|
|
89
89
|
- `SheetForm` — `full`, `floating`, `blend` or `edge`.
|
|
@@ -116,7 +116,7 @@ Import from `viewkitjs/views/controls` to draw ViewKit's default controls: the O
|
|
|
116
116
|
- `InputGroupButton` — a quiet Button inside the field, an icon-only square when it has no words.
|
|
117
117
|
- `InputGroupSegment` — a segment of a value typed in parts (a day, a month), a spinbutton; `on` draws it on the brand's tint.
|
|
118
118
|
- `InputGroupContext` — the group an Input stands in, for a box that frames its Input as the InputGroup does.
|
|
119
|
-
- `pressGroup` — `pressGroup(event)`: a press on a box holding an Input taken as the InputGroup takes it.
|
|
119
|
+
- `pressGroup` — `pressGroup(event)`: a press on a box holding an Input taken as the InputGroup takes it; where the box holds no Input of ViewKit's (an app's own, bare inside it under `panelControls`), the cursor goes into its typed input.
|
|
120
120
|
- `useAutofill` — a hook: `fill(false)` spreads what turns the browser's and the password managers' filling off on a box; `fill()` adds nothing.
|
|
121
121
|
- `offWord` — `offWord(navigator)`: the word that turns autofill off in a browser, `language` in Chromium and Firefox, `off` in WebKit.
|
|
122
122
|
- `autofillOff` — `autofillOff(word)`: what a box carries with its autofill off.
|
|
@@ -357,6 +357,8 @@ A list's panel at its right edge, on a computer, on Base UI's dialog, not modal:
|
|
|
357
357
|
- `PaneState` — what stands in it, by its key, and what opened it last.
|
|
358
358
|
- `PanePress` — a press on an opener, or a close from inside.
|
|
359
359
|
|
|
360
|
+
`CONTROLS.Pane` is the components map's `Pane` (`ViewsPaneProps`, VK-1026): this shell, where a toolbar with `customizeIn: "pane"` opens Customize on a computer, in the list's box it is handed (as tall as that box: give the list a height of its own, as a flex column, or it is as tall as every row), the focus going back to the part's button as it closes from inside. It is internal: `CONTROLS` is the way in.
|
|
361
|
+
|
|
360
362
|
## The toolbar button
|
|
361
363
|
|
|
362
364
|
What stands in a toolbar: the view switcher, View settings, the sort, each filter on the filter bar, a phone's round buttons. It is the Button, on Base UI's Toolbar button inside a toolbar: its ground picks the Button's kind (ghost the quiet, bordered the outline, filled the soft), its size the Button's height, its words whether it is icon-only, so every Button option an app sets reaches it. Its own options are read off the frame around it (`data-toolbar-button-<option>`), a computer's or a phone's, and change as the frame's attributes change; what it holds can say otherwise for itself. Nothing set, it is bordered, 32, its icon and word on a computer, and filled, 36, round, its icon alone on a phone. Its stylesheet is `viewkitjs/views/controls/toolbar-button.css`, after the Button's; its options and looks are `TOOLBAR_BUTTON_LOOKS`. ViewKit's own toolbar draws its `ToolbarButton` atom, which `CONTROL_ATOMS.ToolbarButton` draws with this control, under `components={CONTROLS}` or `atoms={CONTROL_ATOMS}`; an app with neither keeps ViewKit's own button.
|
|
@@ -91,11 +91,12 @@ export function OrdersFromAnAction() {
|
|
|
91
91
|
- `sortFilter` and `bar`: the toolbar's form on a computer, as `ListRoot` takes them.
|
|
92
92
|
- `menus`: every menu as data ([Menus as data](#menus-as-data)): `column`, `row` and `group` reach the grid, `view`, `add` and `more` the toolbar.
|
|
93
93
|
- `toolbarParts`: where each of the toolbar's parts stands ([Parts as data](#parts-as-data)).
|
|
94
|
+
- `customizeIn`: where Customize opens on a computer (VK-1026). `"popover"`, the default, at its button. `"pane"`: in your map's `Pane` (`CONTROLS.Pane`), at the list's right edge under the toolbar and as tall as the grid, over its edge, the grid scrolling and taking presses beside it; the grid then stands in a box of its own, `data-slot="vk-list-box"` (positioned, a flex column that fills the list: give the list its height as a flex column), the Pane's. On a phone Customize keeps its Sheet. An app on `ListRoot` hands its own box to `ListToolbar` as `paneBox`.
|
|
94
95
|
- `link`: default `true`. The address carries the open view and what changed over it (`view`, `q`, `change`), written in place as it changes, your other parameters and history state kept; an opened link wins over the person's draft; back and forward open what the address says. A link it can't read is said through the toast. Two lists on one page share those parameters: hand the second `link={false}`.
|
|
95
96
|
- `can`: `{ edit: false }` leaves every cell read-only, as with no `save`; `{ share: false }` takes "Save for everyone" away even where the store lets the person share, read as the list mounts, as `defaults` is.
|
|
96
97
|
- `onOpenRow`, `rowHref` and `rowWritable` reach the grid, as `GridTable` takes them; `onAdd`, `addItems` and `quickFilters` the toolbar, as `ReadyToolbar` takes them; the quick filters' hold narrows the rows too.
|
|
97
98
|
- `toolbar`, `grid` and `bulk`: any other prop of `ListToolbar`, `ListGrid` and `ListBulkBar`. A prop handed at the top wins over the same one in these; one not handed leaves theirs. `menus` merges key by key. A `grid.children` of your own (your own bar) stands where `ListBulkBar` would, and wins.
|
|
98
|
-
- `className`: on the `div` around the parts (`data-slot="vk-list"`).
|
|
99
|
+
- `className`: on the `div` around the parts (`data-slot="vk-list"`). With `customizeIn: "pane"` the grid stands in a `div` of its own inside it (`data-slot="vk-list-box"`).
|
|
99
100
|
- A field its key can't bind (a writable `datetime`, whose editor needs your time zone) throws, naming the field: hand its binding in `columns` (`bind`).
|
|
100
101
|
- For another arrangement, write `ListRoot` with the same data props and place the parts yourself.
|
|
101
102
|
- `ListProps` — what `List` takes.
|
|
@@ -162,7 +163,7 @@ export function DealsList({ children }: { children: ReactNode }) {
|
|
|
162
163
|
- `undo()` and `redo()`: take back the list's last edit, and put back the last one taken back, as ⌘Z and ⌘⇧Z do; nothing until there is one.
|
|
163
164
|
- `loadMore()` and `loadGroup(key)`: from a source, the next page, and a group's; nothing in memory, or while a newer request is out.
|
|
164
165
|
- `ListToolbar` — the ready toolbar's parts in their arrangements, reading the root around it: every `ReadyToolbar` prop but those the root holds. `ReadyToolbar` is a `ListRoot` holding no data around it. Place one per root: two would draw the same panels. Handed no `views` in a root that keeps its views, it draws the views row from them, its menu included; a new view takes one of its `layouts` (a table where none are handed).
|
|
165
|
-
- `ListToolbarProps` — what `ListToolbar` takes: `ReadyToolbarProps` without `settings`, `layer`, `onChange`, `onLayerChange`, `view`, `sortFilter` and `bar`; `toolbarParts` among them ([Parts as data](#parts-as-data)). In a root that holds a list's `fields` and its `rows` or `source`, `columns`, `groupHeads` and `filterData` default to the root's; handed, yours win.
|
|
166
|
+
- `ListToolbarProps` — what `ListToolbar` takes: `ReadyToolbarProps` without `settings`, `layer`, `onChange`, `onLayerChange`, `view`, `sortFilter` and `bar`; `toolbarParts` among them ([Parts as data](#parts-as-data)). In a root that holds a list's `fields` and its `rows` or `source`, `columns`, `groupHeads` and `filterData` default to the root's; handed, yours win. With `customizeIn: "pane"`, hand `paneBox`, your box round the grid (positioned, never scrolling itself: a `div` your `ref` callback keeps in state), and Customize opens there in the Pane on a computer (VK-1026).
|
|
166
167
|
|
|
167
168
|
## A list's saved views
|
|
168
169
|
|
|
@@ -315,13 +316,14 @@ export function DealsToolbar(props: ReadyToolbarProps<Deal>) {
|
|
|
315
316
|
```
|
|
316
317
|
|
|
317
318
|
- The function, `(parts, ctx) => parts` ([`ToolbarParts`, `ToolbarPartPlace` and `ToolbarPartsContext`, in `/panels/react`](./panels-react.md#the-toolbar)): handed the form's parts in the order they are placed (the row's start, its end, then the bar's start and end, as they draw on a computer; a kit phone's one line as it reads; in the `row` arrangement's narrow and phone forms the search still moves where the form puts it), it hands back the parts drawn, in their order. A part left out isn't drawn; a key the form doesn't hold is skipped, unless it brings its own `node`; a key handed twice counts once. Handed back as it came, the toolbar is exactly as with nothing handed. It is called as the toolbar draws: keep it pure and cheap, and call no hooks in it. Not `parts`, which is the builder's own (a field's part columns in Customize).
|
|
318
|
-
- A part's place: `{ key, line, side, words, node?, className?, button? }`.
|
|
319
|
+
- A part's place: `{ key, line, side, words, node?, className?, button?, panel? }`.
|
|
319
320
|
- `key`: the part's public name: `views` (and `views-stacked`, a second axis of views on the bar), `options` (Customize), `search`, `sort` (on the row, or the bar's sort in the old form), `sort-pill` (the bar's sort in Mihai's look with `bar: "always"`), `filter` and `filter-add` (Filter), `filters` (the filters on the bar), `advanced-filters`, `sep` (the bar's separator), `quick`, `new`, `save` (Clear and Save).
|
|
320
321
|
- `line`: `"row"`, `"bar"` (the filter bar; in the `row` arrangement, the line below the row) or `"foot"` (a kit phone list's foot, New's place; anywhere else it means the row). On a kit phone the row and the bar are one line, so `"bar"` stands a part on it too, and New stands on the line once you place it anywhere but `"foot"`.
|
|
321
322
|
- `side`: `"start"` or `"end"`.
|
|
322
323
|
- `words`: `"both"`, as the look's words say (icon and word where the buttons on the right show theirs), or `"icon"`, its icon alone whatever the look. It means something for a part whose button has an icon and a word: `search`, `quick`, `sort`, `filter`, `filter-add`, `options`, `new`. The search and, in Mihai's look, the quick filters' button are handed `"icon"`, as they always stood; placed `"both"`, they read their word and give it up first as the line narrows, as Sort and Filter do. A button with no icon (Clear, Save) keeps its words.
|
|
323
324
|
- `node`: a part of your own, under a key of your own, drawn where you place it (it doesn't fold into ⋯). `menu.add` places it. The keys above are the toolbar's, even while a part of theirs isn't handed: don't name your own part by one.
|
|
324
325
|
- `className`: put on every toolbar button the part draws (each handed its `part`, [Default keys](#default-keys)'s table), on the button itself, through your `ToolbarButton` (ViewKit's own puts it on its `<button>`, `CONTROL_ATOMS`' on the toolbar button or New's `Button`).
|
|
326
|
+
- `panel`: where what it opens hangs at its button, `{ side?, align?, offset? }` (`ToolbarPanelPlace`), your `Popover`'s `side`, `align` and `sideOffset`: `{ align: "start" }` opens Sort's panel from its button's start wherever Sort stands. Absent, a part on its line's end side opens its panel aligned to its button's end and one on its start side to its start, 8 px below it; a host of yours (`hosts`) or a phone's sheet takes none of it.
|
|
325
327
|
- `button`: your own button for the part, a component taking `ViewsToolbarButtonProps` ([`/react`](./react.md)), drawn for each of its toolbar buttons in place of your `ToolbarButton` and handed the very props it would get: `part`, `open`, `count`, `onClick`, `ref` and the rest. What it opens stays ViewKit's and hangs at your button through `ref`: put `ref` on the element you draw.
|
|
326
328
|
- Which form: `ctx` is `{ arrangement, phone }` (`"kit"` or `"row"`, and whether it is a phone's), so one function can place each form its own way.
|
|
327
329
|
- A part that comes and goes stays the toolbar's: the bar's `filters`, `save`, `sort-pill` and `sep` are handed only while the bar stands, so find them by key (a move by a key the list doesn't hold changes nothing). A part you place on the bar in Mihai's look at rest brings the bar with it; Clear and Save then still wait in Customize's foot.
|
|
@@ -88,7 +88,7 @@ on a frame round the controls as `data-<piece>-*`, which each control's styleshe
|
|
|
88
88
|
- `StatusLookOptionId` — the Status's option ids.
|
|
89
89
|
- `SWITCH_LOOKS` — the Switch's: 4 options (`shape` a computer's, `phone` a phone's, `mark`, `motion`) and five looks, `slim`, `capsule`, `thin`, `hairline` and `classic`.
|
|
90
90
|
- `SwitchLookOptionId` — the Switch's option ids.
|
|
91
|
-
- `SETTING_ROW_LOOKS` — the setting row's: 3 options, two a computer's (`card`, `outlined` (the default)
|
|
91
|
+
- `SETTING_ROW_LOOKS` — the setting row's: 3 options, two a computer's (`card`, `outlined` or `raised` (the default); `rows`, `snug` or `roomy` (the default), 64 tall) and one a phone's (`icon`, `line` (the default), the glyph alone, or `tile`, a white glyph on a tile of the row's `colour`), and two looks, `outright` (`outlined`, `snug`, `line`: the SwitchRows as they were) and `attio` (`raised`, `roomy`, `line`: every option's default).
|
|
92
92
|
- `SettingRowOptionId` — its option ids.
|
|
93
93
|
- `SettingRowPicks` — one value for each.
|
|
94
94
|
- `MENU_LIST_LOOKS` — the menu list's, each a phone's: 6 options (`rows`, what its rows stand on; `lines`; `height`, a scale from `48` to `56`; `corners`, a scale from `lg` to `2xl`; `close`, a Close row; `tiles`) and five looks, `stack`, `card`, `plain`, `joined` and `words`, which pick the first four and leave the Close row and the tiles to the app.
|
|
@@ -49,7 +49,7 @@ A panel's list keeps `--vk-panel-padding` from its edge ([Tokens](../contract.md
|
|
|
49
49
|
|
|
50
50
|
## Customize
|
|
51
51
|
|
|
52
|
-
The panel a list's Options button opens: your components map's `CustomizeBody` (`CONTROLS.CustomizeBody`, or your own), handed the view's settings as data, wherever the panel hangs ([the components map](../contract.md#the-components-map)). ViewKit draws no Customize of its own. Your app hosts it: in a popover, or in a drawer of its own.
|
|
52
|
+
The panel a list's Options button opens: your components map's `CustomizeBody` (`CONTROLS.CustomizeBody`, or your own), handed the view's settings as data, wherever the panel hangs ([the components map](../contract.md#the-components-map)). ViewKit draws no Customize of its own. Your app hosts it: in a popover, or in a drawer of its own; or, with the toolbar's `customizeIn: "pane"` (VK-1026), in your map's `Pane` (`CONTROLS.Pane`) at the right edge of the list's box under the toolbar, as tall as the list, the list in use beside it, with no host of your own. The Pane is a computer's shell: on a phone Customize keeps its Sheet.
|
|
53
53
|
|
|
54
54
|
- `ViewOptionsPanelContent` — the panel: your `CustomizeBody`, handed the view's settings as data. Takes the list's `filters`, `sort`, `group`, `timeScopeConfig`, `dateRangeConfigs`, `toggles` and `layout` (`ViewOptionInputs`; its `sorts` and `filterTree` reach the body as its sort and filter), `activePanel` and `onOpenPanel` (the body's `page` and `onPageChange`), `anyActive` and `clearAll`, and optionally `view` (`CollectionViewState`), `viewFoot` (the body's `foot`: `kit` for Clear and Save, `none` where they stand elsewhere), `footClear` (with no shared view, the foot's Clear), `foldFilters` (the body's `fields` folded behind one Filter row, on by default; off, each is a row of its own), `onClose` (the body's `onDone`), `closeButton` (whether a phone's body is handed its ✕, default true; false in a sheet whose head draws it), `fieldEditor` (`PanelFieldEditor`), and `viewName`, `onRenameView`, `onCopyLink`, `onExport` and `exportCount`, handed on to the body as `ToolbarOptions` hands them. `fill` is deprecated and read by nothing: the body sizes itself in its host.
|
|
55
55
|
- `ViewOptionsActions` — the actions row: Copy link and Share parked, Export CSV live when `exportCsv` (`CollectionExportCsv`) is handed in, its count on the row and one export at a time behind the `loading` glyph, which your app draws turning.
|
|
@@ -64,15 +64,16 @@ The panel a list's Options button opens: your components map's `CustomizeBody` (
|
|
|
64
64
|
|
|
65
65
|
The frame that holds a list's controls, and the parts that need no list settings. `Toolbar` takes the parts your app hands it, each placed at the start or the end, on the first line or the second, and draws them in one of three forms (`/panels`' [arrangement](panels.md#the-toolbars-arrangement)): `row`, `narrow` (its own box under 700px) or `phone` (your provider's `desktopQuery` says it is not a desktop). Pass `phone` or `narrow` to decide either yourself. A part is any node: the frame tells it where it stands through `useToolbarSlot`, and its buttons draw through the `ToolbarButton` atom at their line's size. A part that opens something (a menu, a panel, a pane your app holds) registers it with `useToolbarPanel`, and opening one closes every other, however it opened. A change of form draws the parts afresh, so keep what must last across it (a search's text, a panel's open state) in your app: a panel part left to hold its own state closes when the box crosses 700px, and one handed its state from `useToolbarPanelState`, held above the `Toolbar`, stays open on its page. The row's end controls float over the views on a fade of `--vk-ground` (`data-toolbar-cluster`), which the folding views row measures. Its look is plain; its pieces carry the `data-slot`s the [contract](../contract.md) lists.
|
|
66
66
|
|
|
67
|
-
- `Toolbar` — the frame (one radio for its parts, or, inside a `ListRoot`, the root's). Takes `parts` (`ToolbarPart[]`), and optionally `phone`, `narrow`, `narrowBelow` (700 by default), `fold`, `more` (`ToolbarMore`, ⋯ as data: handed the folded parts' rows, each keyed by its part, and `{ line }`, `"row"` or `"bar"`, since each line folds into its own ⋯, it returns the rows ⋯ shows; a press on any of them closes ⋯ first) and `className`. Each of its lines is a toolbar of its own (`role="toolbar"`): the filter bar (and the three forms' second line) named `views.panels.toolbar-bar` ("Sort and filters"), every other line `views.panels.toolbar-row` ("List tools"). With `fold` it draws the kit's arrangement (`/panels`' fold arrangement): the row and the filter bar under it, each a band with a line across under it, or a phone's one line, with no narrow form; each line measures itself and gives way as it narrows (it contains its own inline size, so its width comes from where it stands and never from what its lines hold: in a holder sized from its content, a main beside a sidebar, it still gives way, with no wrapper of yours), a part's words turning to its icon (the `ToolbarButton` atom's `iconAlone`), the views folding tabs into "+N", a part's filters folding into "+N filters", then what may fold going behind ⋯ (`data-slot="vk-toolbar-overflow"`, your `Menu`, each row the folded part's `menu`). A folded part keeps its state, and what it opens hangs under ⋯; while ⋯'s menu, a folded part's panel, the views' "+N" list, a filter with a part open (`data-slot="vk-toolbar-filter-rule"` marked `data-open`), an open advanced filter (`data-slot="vk-toolbar-advanced-filter"` marked `data-open`) or "+N filters"' menu (the button in `data-slot="vk-toolbar-more-filters"`, `aria-expanded`) is open, the line holds still. The frame holds the search's open state: open, the line gives way around it, and on a phone the search takes the line beside the views.
|
|
67
|
+
- `Toolbar` — the frame (one radio for its parts, or, inside a `ListRoot`, the root's). Takes `parts` (`ToolbarPart[]`), and optionally `phone`, `narrow`, `narrowBelow` (700 by default), `fold`, `more` (`ToolbarMore`, ⋯ as data: handed the folded parts' rows, each keyed by its part, and `{ line }`, `"row"` or `"bar"`, since each line folds into its own ⋯, it returns the rows ⋯ shows; a press on any of them closes ⋯ first) and `className`. Each of its lines is a toolbar of its own (`role="toolbar"`): the filter bar (and the three forms' second line) named `views.panels.toolbar-bar` ("Sort and filters"), every other line `views.panels.toolbar-row` ("List tools"). With `fold` it draws the kit's arrangement (`/panels`' fold arrangement): the row and the filter bar under it, each a band with a line across under it (on a computer its padding, the room between its tools and the line are `--vk-toolbar-line-py`, `--vk-toolbar-line-gap` and `--vk-toolbar-line-w`, [Tokens](../contract.md)), or a phone's one line, with no narrow form; each line measures itself and gives way as it narrows (it contains its own inline size, so its width comes from where it stands and never from what its lines hold: in a holder sized from its content, a main beside a sidebar, it still gives way, with no wrapper of yours), a part's words turning to its icon (the `ToolbarButton` atom's `iconAlone`), the views folding tabs into "+N", a part's filters folding into "+N filters", then what may fold going behind ⋯ (`data-slot="vk-toolbar-overflow"`, your `Menu`, each row the folded part's `menu`). A folded part keeps its state, and what it opens hangs under ⋯; while ⋯'s menu, a folded part's panel, the views' "+N" list, a filter with a part open (`data-slot="vk-toolbar-filter-rule"` marked `data-open`), an open advanced filter (`data-slot="vk-toolbar-advanced-filter"` marked `data-open`) or "+N filters"' menu (the button in `data-slot="vk-toolbar-more-filters"`, `aria-expanded`) is open, the line holds still. The frame holds the search's open state: open, the line gives way around it, and on a phone the search takes the line beside the views.
|
|
68
68
|
- `ToolbarPart` — a part as your app hands it: a `ToolbarPlacement` (its `key`, `side`, `line`, `role`, in the fold arrangement `shed`, `tabs`, `filters` and `fold`, and `words` and `foot`), its `node`, and for a part that may fold its `menu`: `{ label, icon?, onSelect }`, its row in ⋯. `words`: `"icon"` stands a `ToolbarButton` drawn in it as its icon alone, its words given up (a button with no icon keeps them); `"both"` gives the search's button, and the quick filters' button handed `word={null}`, their word, as the look's words say; absent, each its own. `foot: false` keeps New on a phone's folding line instead of at the list's foot.
|
|
69
69
|
- `ToolbarSeparator` — the line between the sort and the filters on a filter bar (or Filter while there is none), placed with `role: "separator"`: drawn only while a part stands drawn on each side of it, and never on a phone's line.
|
|
70
70
|
- `ToolbarViews` — the views row: `views` (`CollectionViewsInput`) and `viewsLayout`. On the row and in the narrow panel it draws `ViewAxes`, or with `as="picker"` and one axis alone its `ViewPicker`; placed again with `stacked` on the second line, it draws the axes a stacked layout pushes beneath, small. On the phone it draws a `ViewPicker` per axis, every axis, and nothing for `stacked`. With `showCounts` the toolbar owns Show counts (`withCounts`). Place it only when the list has views: the phone's search fills the row when nothing is placed at the start.
|
|
71
71
|
- `ToolbarSearch` — the search, placed with `role: "search"`: `value`, `onChange`, `placeholder` (`views.panels.search` by default) and `searching` (while true, a spinner, worded `views.panels.searching`, stands where its glass is, on the button and in the field, and the field, marked `aria-busy`, keeps its value and its typing; your app decides when it is true). On the row, and beside the phone's views, a button that opens an inline field; in the narrow panel, and on a phone with no views, a field that fills its line. A field that holds a value shows from the start. Escape and its ✕ clear it and close a field the button opened; a blur with nothing typed closes it. The field is your `Input`, or, handed `SearchField` in your components map, your whole search box: it stands in place of the glass, the field and the ✕, handed the value, the clear and its form, while the button, the open state, the caret on a press, Escape and a blur stay ViewKit's ([the components map](../contract.md#the-components-map)). Shut, its button is its glass alone, reading "Search" beside it only where its part is placed `words: "both"`, as the look's words say.
|
|
72
72
|
- `ToolbarNew` — the +: `onAdd` (one way to add, the button fires it) or `items` (several, opened through your `Menu`, one of the toolbar's panels), `label` (`views.panels.toolbar-new` by default) and `icon` (your `add` glyph by default); its word for a dress is its label. With neither, the row draws it disabled, so its place never moves; the narrow panel and the phone draw nothing. In a folding `Toolbar` on a phone it stands at the list's foot instead (`data-at="foot"`): a round + (the atom's `foot`) fixed at the screen's bottom-end corner, over the list, lifted by `--vk-toolbar-foot`, and drawn into the document's body so a page that scrolls inside a transformed box can't carry it away; with no verb, nothing there.
|
|
73
73
|
- `ToolbarButton` — the `ToolbarButton` atom at the size of the line it stands in, for a custom part's buttons.
|
|
74
|
-
- `useToolbarSlot` — where this part stands (`ToolbarSlotState`): `form`, `fill`, `size` and its line's kind; in the fold arrangement also `fold`, `iconAlone`, `tabsFolded`, `filtersFolded` (how many of its filters folded into "+N filters"), `folded`, `more` (⋯'s button) and, for the search, `search` (its open state, held by the frame); `words` and `foot`, as the part was placed (`ToolbarPlacement`, [`/panels`](./panels.md)), which your own frame may set too; `key`, `className` and `button`, its place's key and look (`ToolbarPartPlace`): a part names its buttons after `key`, and draws each with `button` in place of your `ToolbarButton` and with `className` on it, which your own frame may hand too; and `appFrame`, true inside your own frame (`ToolbarSlotProvider`); outside a `Toolbar`, the row's main line at `md`, folding nothing.
|
|
74
|
+
- `useToolbarSlot` — where this part stands (`ToolbarSlotState`): `form`, `fill`, `size` and its line's kind; in the fold arrangement also `fold`, `iconAlone`, `tabsFolded`, `filtersFolded` (how many of its filters folded into "+N filters"), `folded`, `more` (⋯'s button) and, for the search, `search` (its open state, held by the frame); `words` and `foot`, as the part was placed (`ToolbarPlacement`, [`/panels`](./panels.md)), which your own frame may set too; `key`, `className` and `button`, its place's key and look (`ToolbarPartPlace`): a part names its buttons after `key`, and draws each with `button` in place of your `ToolbarButton` and with `className` on it, which your own frame may hand too; `side` and `panel`, its side of its line (folded into ⋯, ⋯'s side) and its place's `panel` (`ToolbarPanelPlace`): what it opens hangs toward `side` unless `panel` says, and your own frame may set either; and `appFrame`, true inside your own frame (`ToolbarSlotProvider`); outside a `Toolbar`, the row's main line at `md`, folding nothing.
|
|
75
75
|
- `ToolbarSlotState` — what `useToolbarSlot` returns.
|
|
76
|
+
- `ToolbarPanelPlace` — where a part's popover hangs at its button: `{ side?, align?, offset? }`, your `Popover`'s `side`, `align` and `sideOffset`. Absent, on a computer a part on its line's end side opens what it opens aligned to its button's end and one on the start side to its start, 8 px below it; a part outside a `Toolbar` with no `side` in its slot opens as it always did (Customize, Sort, Filter and the quick filters at their button's end, the sort pill and Filter on the bar at its start). Read from where the part stands, never from whether it is open, so a closing panel keeps its side.
|
|
76
77
|
- `useToolbarPanel` — a part's open state as one of the toolbar's panels, named by a key: `{ open, onOpenChange }`. Each call is its own panel, so two parts that name the same key still close each other. Hand it `{ open, onOpenChange }` for a panel your app holds; without, it holds its own. Inside a `ListRoot`, one of the root's panels; outside a `Toolbar` and a root, plain open state.
|
|
77
78
|
- `ToolbarSlotProvider` — for your own toolbar frame: tells the part inside it where it stands, as `Toolbar` tells each of its parts. Takes `slot`, a partial `ToolbarSlotState` laid over the outside default (the row's main line at `md`, folding nothing); its `form` defaults to your provider's `desktopQuery` (`"phone"` off a desktop). It sets `appFrame: true` (`slot.appFrame: false` opts out): inside it the Views part (`ToolbarViews`) draws its chip, its view tabs, its "+N" and its "+" through your `ToolbarButton`, and `ToolbarSave` its Clear and Save, each told what it is (`current`, `part`, `onContextMenu`); a tab's status colours (`activeClassName`, `hoverClassName`) stay with ViewKit's own pills and don't reach it, and a `PillGroup`, `ViewTabs`, `ViewPicker` or `ViewCreatePill` you place yourself stays as it is. It replaces any slot above it.
|
|
78
79
|
- `ToolbarRadioProvider` — for your own toolbar frame: the radio, held for its life, as `Toolbar` holds one. Placed around your frame, the parts inside it that open something close each other, and a part's panel opens in your `Sheet` when its slot's `form` is `"phone"`. Inside a `ListRoot` ([`/list`](./list.md)) it is the root's radio, so your frame's panels and every other frame's in that list close each other.
|
|
@@ -154,10 +155,10 @@ Options, Sort and Filter each open their panel from their own button, and each t
|
|
|
154
155
|
- `ToolbarPanelState` — what `useToolbarPanelState` returns.
|
|
155
156
|
- `FilterPanelContent` — the Filter panel standing alone, for a host of your own: the filter list at its root (titled `views.panels.filter`, no back arrow) and the pages it opens, with `filters`, `timeScopeConfig`, `dateRangeConfigs`, `page`, `onPageChange`, `onClose` and `fill`.
|
|
156
157
|
- `ToolbarSave` — Clear and Save, at the end of a filter bar while the list differs (`data-slot="vk-toolbar-save"`): takes `view` (a `CollectionViewState`: Clear is its `onReset`, Save its `onPublish`, shown only where `canPublish`, both waiting while `pending`, nothing while `changes` is 0), or with no shared view `onClear`, Clear alone taking the list back to its default; nothing when neither has anything to do. Clear has no ground and Save wears the field's look, each your `Button`.
|
|
157
|
-
- `ReadyToolbar` — the toolbar for an app that doesn't arrange its own (`ReadyToolbarProps`): the builder's input (`settings`, `layer`, `columns`, `onChange`, `onLayerChange` and the rest of `SettingsPanelsInput`), and optionally `views`, `viewsLayout`, `onAdd` or `addItems` and `addLabel`, `view`, `toggles`, `fieldEditor`, `searchPlaceholder`, `searching` (handed to its search), `hosts` (`{ options, sort, filter, quick }`), `quickFilters` (a `QuickFiltersConfig`: handed, the quick filters' button stands on the row's end before the search, in the row arrangement before Options, folding into ⋯ as the row narrows; its counts follow the toolbar's Show counts unless the config carries its own `showCounts`), `quickFiltersOpen` with `onQuickFiltersOpenChange` (the quick filters' panel open, held by you, so a `QuickFiltersReminder` at your list's foot can open it; absent, the toolbar holds it), `phone`, `narrow`, `severalSorts` (true by default: the sort holds up to 3 rules, the row's Sort opening the sort editor on them, or in the old form the sort pill on the bar; `false` keeps Sort's one rule, which opens its own list whether or not a sort stands), `addAfter` (true by default: the + after the sort pill; `false` draws none, and the pill's editor, or your `SortBody`, has Add sort at its foot, as `ToolbarSortPill`'s), `filterGroups` (true by default: and/or groups, each filter on the filter bar on a computer, in the row arrangement each advanced filter's pill after Filter and Convert to advanced filter on a filter's page, and on a phone Filter opening the filter editor on every rule; `false` keeps Filter, counting what is applied, in either arrangement), `arrangement` (`"kit"` by default, or `"row"`), `sortFilter` (`"right"` by default, or `"bar"`), `bar` (`"added"` by default, or `"always"`: with Sort and Filter on the row's right, the bar then always shows, its empty Sort and Filter included), `viewName`, `onRenameView`, `onCopyLink`, `onExport` and `exportCount` (handed on to Customize, as `ToolbarOptions` takes them), `menus` (`ToolbarMenus`: a view's menu, New's and ⋯ as data), `toolbarParts` (`ToolbarParts`: where each part stands, every form's parts handed as data and drawn as you hand them back, [`/list`'s Parts as data](./list.md#parts-as-data)) and `className`. It calls the builder and draws its parts in the kit's arrangement (`Toolbar`'s `fold`). By default, on a computer, one row at rest: the views with Customize beside them, then on its right Sort and Filter with their words, the quick filters' button and the search, each its icon alone, and New. Sort holds the sort (`ToolbarSortPill`'s `row`): lit while 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 Save for everyone in Customize's foot. Every change comes back as a `ListSettingsChange` or a layer patch: its search writes the settings' search, its ✕s clear in one change (`settingsCleared`), and the active view's menu gains "Edit view…" (`withEditView`), which opens Customize. It is a `ListRoot` around `ListToolbar` ([`/list`](./list.md)): its panels' state is held in that root, above its frame, so a change of form keeps a panel open on its page, in a sheet once the form is the phone's. Show counts is the view's: read from `settings.showCounts` for the views row and the quick filters, absent meaning on, it joins Customize's toggles where the views carry counts and is written back through `onChange`. Group steps aside on a board (`groupShown`).
|
|
158
|
+
- `ReadyToolbar` — the toolbar for an app that doesn't arrange its own (`ReadyToolbarProps`): the builder's input (`settings`, `layer`, `columns`, `onChange`, `onLayerChange` and the rest of `SettingsPanelsInput`), and optionally `views`, `viewsLayout`, `onAdd` or `addItems` and `addLabel`, `view`, `toggles`, `fieldEditor`, `searchPlaceholder`, `searching` (handed to its search), `hosts` (`{ options, sort, filter, quick }`), `customizeIn` (`"popover"` by default; `"pane"`: on a computer Customize opens in your map's `Pane`, `CONTROLS.Pane`, at the right edge of `paneBox`, under the toolbar and as tall as the list, the list in use beside it; on a phone its Sheet either way; a map with no `Pane`, or your own `hosts.options`, keeps theirs) and `paneBox` (the list's box the Pane stands in: positioned, holding the grid under the toolbar, never scrolling itself; null until it is on the page; not handed, the popover), `quickFilters` (a `QuickFiltersConfig`: handed, the quick filters' button stands on the row's end before the search, in the row arrangement before Options, folding into ⋯ as the row narrows; its counts follow the toolbar's Show counts unless the config carries its own `showCounts`), `quickFiltersOpen` with `onQuickFiltersOpenChange` (the quick filters' panel open, held by you, so a `QuickFiltersReminder` at your list's foot can open it; absent, the toolbar holds it), `phone`, `narrow`, `severalSorts` (true by default: the sort holds up to 3 rules, the row's Sort opening the sort editor on them, or in the old form the sort pill on the bar; `false` keeps Sort's one rule, which opens its own list whether or not a sort stands), `addAfter` (true by default: the + after the sort pill; `false` draws none, and the pill's editor, or your `SortBody`, has Add sort at its foot, as `ToolbarSortPill`'s), `filterGroups` (true by default: and/or groups, each filter on the filter bar on a computer, in the row arrangement each advanced filter's pill after Filter and Convert to advanced filter on a filter's page, and on a phone Filter opening the filter editor on every rule; `false` keeps Filter, counting what is applied, in either arrangement), `arrangement` (`"kit"` by default, or `"row"`), `sortFilter` (`"right"` by default, or `"bar"`), `bar` (`"added"` by default, or `"always"`: with Sort and Filter on the row's right, the bar then always shows, its empty Sort and Filter included), `viewName`, `onRenameView`, `onCopyLink`, `onExport` and `exportCount` (handed on to Customize, as `ToolbarOptions` takes them), `menus` (`ToolbarMenus`: a view's menu, New's and ⋯ as data), `toolbarParts` (`ToolbarParts`: where each part stands, every form's parts handed as data and drawn as you hand them back, [`/list`'s Parts as data](./list.md#parts-as-data)) 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 Save for everyone in Customize's foot. Every change comes back as a `ListSettingsChange` or a layer patch: its search writes the settings' search, its ✕s clear in one change (`settingsCleared`), and the active view's menu gains "Edit view…" (`withEditView`), which opens Customize. It is a `ListRoot` around `ListToolbar` ([`/list`](./list.md)): its panels' state is held in that root, above its frame, so a change of form keeps a panel open on its page, in a sheet once the form is the phone's. Show counts is the view's: read from `settings.showCounts` for the views row and the quick filters, absent meaning on, it joins Customize's toggles where the views carry counts and is written back through `onChange`. Group steps aside on a board (`groupShown`).
|
|
158
159
|
- `ReadyToolbarProps` — what `ReadyToolbar` takes.
|
|
159
160
|
- `ToolbarParts` — `ReadyToolbar`'s and `ListToolbar`'s `toolbarParts`: `(parts: ToolbarPartPlace[], ctx: ToolbarPartsContext) => ToolbarPartPlace[]`, handed the form's parts in the order they are placed and handing back the parts drawn, in their order. The rules and an example are [`/list`'s Parts as data](./list.md#parts-as-data).
|
|
160
|
-
- `ToolbarPartPlace` — a part's place: `{ key, line, side, words, node?, className?, button? }`: its public key, its line (`"row"`, `"bar"`, or `"foot"`, New's place at a kit phone list's foot), its side (`"start"` or `"end"`), its words (`"both"` or `"icon"`), `node` for a part of your own under a key of your own, and its look: `className`, put on every toolbar button the part draws, and `button`, your own button drawn for each of them in place of your `ToolbarButton`, handed the same props (`ref` included: put it on your button). [`/list`'s Parts as data](./list.md#parts-as-data) lists each place's buttons and what stays fixed.
|
|
161
|
+
- `ToolbarPartPlace` — a part's place: `{ key, line, side, words, node?, className?, button?, panel? }`: its public key, its line (`"row"`, `"bar"`, or `"foot"`, New's place at a kit phone list's foot), its side (`"start"` or `"end"`), its words (`"both"` or `"icon"`), `node` for a part of your own under a key of your own, and its look: `className`, put on every toolbar button the part draws, and `button`, your own button drawn for each of them in place of your `ToolbarButton`, handed the same props (`ref` included: put it on your button); and `panel` (`ToolbarPanelPlace`), where what it opens hangs at its button. [`/list`'s Parts as data](./list.md#parts-as-data) lists each place's buttons and what stays fixed.
|
|
161
162
|
- `ToolbarPartsContext` — which form the parts are for: `{ arrangement, phone }` (`"kit"` or `"row"`, and whether it is a phone's).
|
|
162
163
|
- `ToolbarMore` — ⋯ as data, `Toolbar`'s `more` and `ToolbarMenus`' `more`: `(items, { line }) => items`.
|
|
163
164
|
- `ToolbarMenus` — the toolbar's menus as data, `ReadyToolbar`'s and `ListToolbar`'s `menus`: `view(items, { view })` (a view's menu: an option's own rows, Edit view… among them, and the menu a views list draws from the axis's verbs), `add(items)` (New's items: `addItems`, or with `onAdd` alone one row keyed `new`; New opens what it returns as a menu) and `more(items, { line })` (⋯'s rows, each keyed by its part, on the row's line or the filter bar's). The helpers, the keys and the rules are [`/list`'s Menus as data](./list.md#menus-as-data).
|