viewkitjs 0.27.0 → 0.29.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +178 -0
- package/MIGRATION.md +123 -5
- package/fields/dist/derived.d.ts +2 -1
- package/fields/dist/derived.js +9 -3
- package/fields/dist/entities.js +41 -3
- package/fields/dist/index.d.ts +1 -1
- package/fields/dist/index.js +1 -1
- package/fields/dist/messages.d.ts +8 -2
- package/fields/dist/messages.js +3 -0
- package/fields/dist/range.d.ts +6 -0
- package/fields/dist/range.js +8 -0
- package/fields/dist/registry.js +11 -1
- package/fields/dist/spec-changes.js +1 -0
- package/fields/dist/types.d.ts +23 -1
- package/fields/docs/guides/derived-fields.md +7 -5
- package/fields/docs/guides/field-types.md +2 -2
- package/fields/docs/guides/the-index.md +1 -1
- package/fields/docs/reference/fields.md +3 -1
- package/fields/docs/reference/types.md +3 -1
- package/fields/skills/viewkit/SKILL.md +1 -1
- package/package.json +2 -1
- package/postgres/dist/definitions/build.js +29 -5
- package/postgres/dist/definitions/label.d.ts +7 -0
- package/postgres/dist/definitions/label.js +9 -1
- package/postgres/dist/definitions/lookup.js +6 -2
- package/postgres/dist/definitions/place.d.ts +6 -3
- package/postgres/dist/definitions/rollup.js +5 -1
- package/postgres/dist/definitions/storage.d.ts +15 -0
- package/postgres/dist/definitions/storage.js +52 -1
- package/postgres/dist/definitions/stored.js +21 -0
- package/postgres/dist/phone.d.ts +13 -1
- package/postgres/dist/phone.js +23 -3
- package/postgres/dist/search-indexes.d.ts +6 -1
- package/postgres/dist/search-indexes.js +71 -25
- package/postgres/dist/search.js +3 -3
- package/postgres/docs/guides/definitions.md +22 -5
- package/postgres/docs/guides/field-map.md +5 -4
- package/postgres/docs/reference/definitions.md +3 -3
- package/postgres/docs/reference/postgres.md +1 -1
- package/views/dist/cells/cell-format.d.ts +3 -1
- package/views/dist/cells/cell-format.js +3 -3
- package/views/dist/cells/cell-values.js +9 -10
- package/views/dist/cells/use-cell-format.d.ts +8 -1
- package/views/dist/cells/use-cell-format.js +13 -2
- package/views/dist/contract.d.ts +218 -5
- package/views/dist/contract.js +233 -1
- package/views/dist/controls/alert/alert.d.ts +46 -0
- package/views/dist/controls/alert/alert.js +11 -0
- package/views/dist/controls/alert/looks.d.ts +4 -0
- package/views/dist/controls/alert/looks.js +19 -0
- package/views/dist/controls/alert/tokens.d.ts +92 -0
- package/views/dist/controls/alert/tokens.js +25 -0
- package/views/dist/controls/alert-dialog/alert-dialog.d.ts +50 -0
- package/views/dist/controls/alert-dialog/alert-dialog.js +67 -0
- package/views/dist/controls/alert-dialog/confirm.d.ts +13 -0
- package/views/dist/controls/alert-dialog/confirm.js +11 -0
- package/views/dist/controls/alert-dialog/looks.d.ts +4 -0
- package/views/dist/controls/alert-dialog/looks.js +17 -0
- package/views/dist/controls/alert-dialog/tokens.d.ts +119 -0
- package/views/dist/controls/alert-dialog/tokens.js +32 -0
- package/views/dist/controls/alert-dialog.css +95 -0
- package/views/dist/controls/alert.css +51 -0
- package/views/dist/controls/bulk-bar/bulk-bar-of.d.ts +66 -0
- package/views/dist/controls/bulk-bar/bulk-bar-of.js +22 -0
- package/views/dist/controls/bulk-bar/bulk-bar.d.ts +40 -0
- package/views/dist/controls/bulk-bar/bulk-bar.js +278 -0
- package/views/dist/controls/bulk-bar/looks.d.ts +10 -0
- package/views/dist/controls/bulk-bar/looks.js +14 -0
- package/views/dist/controls/bulk-bar/map-selection-bar.d.ts +19 -0
- package/views/dist/controls/bulk-bar/map-selection-bar.js +57 -0
- package/views/dist/controls/bulk-bar/tokens.d.ts +136 -0
- package/views/dist/controls/bulk-bar/tokens.js +36 -0
- package/views/dist/controls/bulk-bar/words.d.ts +50 -0
- package/views/dist/controls/bulk-bar/words.js +19 -0
- package/views/dist/controls/bulk-bar.css +96 -0
- package/views/dist/controls/button/button.js +3 -1
- package/views/dist/controls/button.css +5 -4
- package/views/dist/controls/checkbox/checkbox.js +3 -1
- package/views/dist/controls/checkbox.css +1 -1
- package/views/dist/controls/choice/tokens.d.ts +79 -0
- package/views/dist/controls/choice/tokens.js +22 -0
- package/views/dist/controls/choice.css +31 -0
- package/views/dist/controls/collapsible/collapsible.d.ts +39 -0
- package/views/dist/controls/collapsible/collapsible.js +18 -0
- package/views/dist/controls/collapsible/looks.d.ts +4 -0
- package/views/dist/controls/collapsible/looks.js +5 -0
- package/views/dist/controls/collapsible/map-collapse.d.ts +2 -0
- package/views/dist/controls/collapsible/map-collapse.js +6 -0
- package/views/dist/controls/collapsible/tokens.d.ts +68 -0
- package/views/dist/controls/collapsible/tokens.js +19 -0
- package/views/dist/controls/collapsible.css +83 -0
- package/views/dist/controls/compound-editor/looks.js +1 -1
- package/views/dist/controls/compound-editor/place-parts.js +5 -1
- package/views/dist/controls/controls.d.ts +19 -0
- package/views/dist/controls/controls.js +17 -0
- package/views/dist/controls/customize/customize.d.ts +125 -0
- package/views/dist/controls/customize/customize.js +243 -0
- package/views/dist/controls/customize/glide.d.ts +10 -0
- package/views/dist/controls/customize/glide.js +55 -0
- package/views/dist/controls/customize/looks.d.ts +13 -0
- package/views/dist/controls/customize/looks.js +11 -0
- package/views/dist/controls/customize/map-customize-body.d.ts +18 -0
- package/views/dist/controls/customize/map-customize-body.js +160 -0
- package/views/dist/controls/customize/rules.d.ts +23 -0
- package/views/dist/controls/customize/rules.js +19 -0
- package/views/dist/controls/customize/tokens.d.ts +40 -0
- package/views/dist/controls/customize/tokens.js +12 -0
- package/views/dist/controls/customize/words.d.ts +58 -0
- package/views/dist/controls/customize/words.js +37 -0
- package/views/dist/controls/customize.css +54 -0
- package/views/dist/controls/date-editor/date-editor.d.ts +2 -1
- package/views/dist/controls/date-editor/looks.js +1 -1
- package/views/dist/controls/date-editor/map-calendar.js +3 -1
- package/views/dist/controls/filter-editor/block.d.ts +31 -0
- package/views/dist/controls/filter-editor/block.js +27 -0
- package/views/dist/controls/filter-editor/filter-editor.d.ts +58 -0
- package/views/dist/controls/filter-editor/filter-editor.js +250 -0
- package/views/dist/controls/filter-editor/how.d.ts +23 -0
- package/views/dist/controls/filter-editor/how.js +14 -0
- package/views/dist/controls/filter-editor/map-filter-body.d.ts +33 -0
- package/views/dist/controls/filter-editor/map-filter-body.js +190 -0
- package/views/dist/controls/filter-editor/map-rules.d.ts +101 -0
- package/views/dist/controls/filter-editor/map-rules.js +304 -0
- package/views/dist/controls/filter-editor/parts.d.ts +46 -0
- package/views/dist/controls/filter-editor/parts.js +75 -0
- package/views/dist/controls/filter-editor/rules.d.ts +142 -0
- package/views/dist/controls/filter-editor/rules.js +201 -0
- package/views/dist/controls/filter-editor/tokens.d.ts +83 -0
- package/views/dist/controls/filter-editor/tokens.js +23 -0
- package/views/dist/controls/filter-editor/words.d.ts +74 -0
- package/views/dist/controls/filter-editor/words.js +46 -0
- package/views/dist/controls/filter-editor.css +142 -0
- package/views/dist/controls/group-editor/group-editor.d.ts +56 -0
- package/views/dist/controls/group-editor/group-editor.js +126 -0
- package/views/dist/controls/group-editor/map-group-body.d.ts +19 -0
- package/views/dist/controls/group-editor/map-group-body.js +106 -0
- package/views/dist/controls/group-editor/rules.d.ts +48 -0
- package/views/dist/controls/group-editor/rules.js +41 -0
- package/views/dist/controls/group-editor/tokens.d.ts +15 -0
- package/views/dist/controls/group-editor/tokens.js +6 -0
- package/views/dist/controls/group-editor/words.d.ts +39 -0
- package/views/dist/controls/group-editor/words.js +21 -0
- package/views/dist/controls/group-editor.css +20 -0
- package/views/dist/controls/index.d.ts +45 -3
- package/views/dist/controls/index.js +44 -3
- package/views/dist/controls/inline-input/looks.js +1 -1
- package/views/dist/controls/input/input.js +10 -4
- package/views/dist/controls/internal/editor-parts.d.ts +8 -1
- package/views/dist/controls/internal/editor-parts.js +5 -0
- package/views/dist/controls/internal/phone.d.ts +5 -4
- package/views/dist/controls/internal/phone.js +7 -7
- package/views/dist/controls/internal/scroll.js +5 -1
- package/views/dist/controls/internal/step-return.d.ts +9 -0
- package/views/dist/controls/internal/step-return.js +27 -0
- package/views/dist/controls/internal/typed-run.d.ts +2 -0
- package/views/dist/controls/internal/typed-run.js +5 -0
- package/views/dist/controls/links-editor/links-editor.d.ts +5 -3
- package/views/dist/controls/links-editor/links-editor.js +38 -17
- package/views/dist/controls/links-editor/map-links-body.js +4 -1
- package/views/dist/controls/links-editor.css +1 -1
- package/views/dist/controls/menu/map-menu.js +2 -2
- package/views/dist/controls/menu-list/menu-list.d.ts +17 -2
- package/views/dist/controls/menu-list/menu-list.js +25 -16
- package/views/dist/controls/modal/looks.d.ts +4 -0
- package/views/dist/controls/modal/looks.js +25 -0
- package/views/dist/controls/modal/modal.d.ts +69 -0
- package/views/dist/controls/modal/modal.js +62 -0
- package/views/dist/controls/modal/tokens.d.ts +192 -0
- package/views/dist/controls/modal/tokens.js +50 -0
- package/views/dist/controls/modal.css +130 -0
- package/views/dist/controls/notice/notice.d.ts +49 -0
- package/views/dist/controls/notice/notice.js +35 -0
- package/views/dist/controls/notice/tokens.d.ts +99 -0
- package/views/dist/controls/notice/tokens.js +27 -0
- package/views/dist/controls/notice.css +100 -0
- package/views/dist/controls/number-editor/looks.js +1 -1
- package/views/dist/controls/number-editor/number-editor.js +1 -1
- package/views/dist/controls/option/option.js +3 -1
- package/views/dist/controls/option.css +1 -1
- package/views/dist/controls/pane/looks.d.ts +4 -0
- package/views/dist/controls/pane/looks.js +11 -0
- package/views/dist/controls/pane/pane.d.ts +67 -0
- package/views/dist/controls/pane/pane.js +99 -0
- package/views/dist/controls/pane/state.d.ts +14 -0
- package/views/dist/controls/pane/state.js +7 -0
- package/views/dist/controls/pane/tokens.d.ts +79 -0
- package/views/dist/controls/pane/tokens.js +22 -0
- package/views/dist/controls/pane.css +104 -0
- package/views/dist/controls/picker/looks.js +1 -1
- package/views/dist/controls/picker/map-picker.d.ts +6 -2
- package/views/dist/controls/picker/map-picker.js +4 -2
- package/views/dist/controls/picker/picker.d.ts +7 -0
- package/views/dist/controls/picker/picker.js +57 -8
- package/views/dist/controls/picker/rows.d.ts +4 -2
- package/views/dist/controls/picker/rows.js +4 -3
- package/views/dist/controls/popover/map-popover.d.ts +1 -1
- package/views/dist/controls/popover/map-popover.js +2 -2
- package/views/dist/controls/popover/popover.js +2 -1
- package/views/dist/controls/popover.css +3 -0
- package/views/dist/controls/ports-host/map-ports-host.d.ts +7 -0
- package/views/dist/controls/ports-host/map-ports-host.js +43 -0
- package/views/dist/controls/press/tokens.d.ts +8 -0
- package/views/dist/controls/press/tokens.js +4 -0
- package/views/dist/controls/press.css +44 -0
- package/views/dist/controls/quick-filters/looks.d.ts +11 -0
- package/views/dist/controls/quick-filters/looks.js +9 -0
- package/views/dist/controls/quick-filters/map-quick-filters-body.d.ts +31 -0
- package/views/dist/controls/quick-filters/map-quick-filters-body.js +56 -0
- package/views/dist/controls/quick-filters/quick-filters.d.ts +37 -0
- package/views/dist/controls/quick-filters/quick-filters.js +89 -0
- package/views/dist/controls/quick-filters/reminder.d.ts +18 -0
- package/views/dist/controls/quick-filters/reminder.js +41 -0
- package/views/dist/controls/quick-filters/rules.d.ts +89 -0
- package/views/dist/controls/quick-filters/rules.js +52 -0
- package/views/dist/controls/quick-filters/tokens.d.ts +112 -0
- package/views/dist/controls/quick-filters/tokens.js +30 -0
- package/views/dist/controls/quick-filters/words.d.ts +25 -0
- package/views/dist/controls/quick-filters/words.js +13 -0
- package/views/dist/controls/quick-filters.css +118 -0
- package/views/dist/controls/sheet/bottom-sheet.d.ts +9 -4
- package/views/dist/controls/sheet/bottom-sheet.js +4 -4
- package/views/dist/controls/sheet/map-sheet.d.ts +4 -1
- package/views/dist/controls/sheet/map-sheet.js +19 -6
- package/views/dist/controls/sheet/sheet-parts.d.ts +10 -0
- package/views/dist/controls/sheet/sheet-parts.js +2 -0
- package/views/dist/controls/sort-editor/map-sort-body.d.ts +9 -0
- package/views/dist/controls/sort-editor/map-sort-body.js +81 -0
- package/views/dist/controls/sort-editor/rules.d.ts +48 -0
- package/views/dist/controls/sort-editor/rules.js +24 -0
- package/views/dist/controls/sort-editor/sort-editor.d.ts +58 -0
- package/views/dist/controls/sort-editor/sort-editor.js +180 -0
- package/views/dist/controls/sort-editor/tokens.d.ts +79 -0
- package/views/dist/controls/sort-editor/tokens.js +22 -0
- package/views/dist/controls/sort-editor/words.d.ts +48 -0
- package/views/dist/controls/sort-editor/words.js +25 -0
- package/views/dist/controls/sort-editor.css +96 -0
- package/views/dist/controls/switch-row/switch-row.d.ts +15 -0
- package/views/dist/controls/switch-row/switch-row.js +9 -0
- package/views/dist/controls/switch-row/tokens.d.ts +51 -0
- package/views/dist/controls/switch-row/tokens.js +15 -0
- package/views/dist/controls/switch-row.css +39 -0
- package/views/dist/controls/switch.css +1 -1
- package/views/dist/controls/tag/tag.js +3 -1
- package/views/dist/controls/tag-field/tag-field.d.ts +20 -0
- package/views/dist/controls/tag-field/tag-field.js +19 -0
- package/views/dist/controls/tag-field/tokens.d.ts +7 -0
- package/views/dist/controls/tag-field/tokens.js +4 -0
- package/views/dist/controls/tag-field.css +13 -0
- package/views/dist/controls/text-editor/looks.js +1 -1
- package/views/dist/controls/text-editor/text-editor.js +1 -5
- package/views/dist/controls/toast/toast.d.ts +79 -0
- package/views/dist/controls/toast/toast.js +101 -0
- package/views/dist/controls/toast/tokens.d.ts +100 -0
- package/views/dist/controls/toast/tokens.js +27 -0
- package/views/dist/controls/toast.css +93 -0
- package/views/dist/controls/tokens.js +38 -0
- package/views/dist/controls/toolbar/keys.d.ts +3 -0
- package/views/dist/controls/toolbar/keys.js +11 -0
- package/views/dist/controls/toolbar/looks.d.ts +10 -0
- package/views/dist/controls/toolbar/looks.js +40 -0
- package/views/dist/controls/toolbar/tokens.d.ts +28 -0
- package/views/dist/controls/toolbar/tokens.js +9 -0
- package/views/dist/controls/toolbar/toolbar.d.ts +111 -0
- package/views/dist/controls/toolbar/toolbar.js +370 -0
- package/views/dist/controls/toolbar/words.d.ts +28 -0
- package/views/dist/controls/toolbar/words.js +17 -0
- package/views/dist/controls/toolbar-button/looks.d.ts +4 -0
- package/views/dist/controls/toolbar-button/looks.js +21 -0
- package/views/dist/controls/toolbar-button/tokens.d.ts +103 -0
- package/views/dist/controls/toolbar-button/tokens.js +28 -0
- package/views/dist/controls/toolbar-button/toolbar-button.d.ts +66 -0
- package/views/dist/controls/toolbar-button/toolbar-button.js +51 -0
- package/views/dist/controls/toolbar-button.css +75 -0
- package/views/dist/controls/toolbar.css +65 -0
- package/views/dist/controls/tooltip/map-tooltip.d.ts +1 -1
- package/views/dist/controls/tooltip/map-tooltip.js +2 -2
- package/views/dist/controls/tooltip/tooltip.d.ts +3 -1
- package/views/dist/controls/tooltip/tooltip.js +2 -2
- package/views/dist/controls/values-editor/looks.js +1 -1
- package/views/dist/controls/values-editor/values-editor.js +7 -1
- package/views/dist/controls/views-list/map-views-list-body.d.ts +4 -1
- package/views/dist/controls/views-list/map-views-list-body.js +128 -4
- package/views/dist/controls/views-list/rules.d.ts +26 -0
- package/views/dist/controls/views-list/rules.js +63 -0
- package/views/dist/controls/views-list/view-menu.d.ts +84 -0
- package/views/dist/controls/views-list/view-menu.js +201 -0
- package/views/dist/controls/views-list/views-list.d.ts +8 -1
- package/views/dist/controls/views-list/views-list.js +18 -3
- package/views/dist/controls/views-list/words.d.ts +54 -0
- package/views/dist/controls/views-list/words.js +10 -1
- package/views/dist/controls/views-list.css +5 -1
- package/views/dist/display/date.js +5 -5
- package/views/dist/display/format.d.ts +6 -0
- package/views/dist/display/format.js +13 -2
- package/views/dist/display/index.d.ts +1 -1
- package/views/dist/display/index.js +1 -1
- package/views/dist/display/options.d.ts +3 -1
- package/views/dist/display/range.d.ts +2 -1
- package/views/dist/display/range.js +4 -1
- package/views/dist/display/use-display-options.d.ts +3 -0
- package/views/dist/display/use-display-options.js +10 -2
- package/views/dist/display/viewer.d.ts +1 -1
- package/views/dist/display/viewer.js +1 -1
- package/views/dist/editors/DateEditor.js +11 -9
- package/views/dist/editors/relation-panel.js +7 -1
- package/views/dist/editors/relation-picker.d.ts +2 -1
- package/views/dist/editors/relation-picker.js +4 -3
- package/views/dist/editors/relation-source.d.ts +4 -1
- package/views/dist/editors/relation-source.js +5 -2
- package/views/dist/field-row/editors/RowNumberEditor.js +2 -2
- package/views/dist/fields/number-edit.d.ts +6 -0
- package/views/dist/fields/number-edit.js +8 -1
- package/views/dist/grid/chrome/GridCellEditors.js +2 -2
- package/views/dist/grid/chrome/GridColumnDateSection.d.ts +4 -3
- package/views/dist/grid/chrome/GridColumnDateSection.js +4 -4
- package/views/dist/grid/chrome/GridColumnDurationSection.js +2 -2
- package/views/dist/grid/chrome/GridColumnMenu.js +6 -4
- package/views/dist/grid/chrome/GridFooter.js +2 -2
- package/views/dist/grid/chrome/GridHeader.js +2 -1
- package/views/dist/grid/chrome/GridNumberEditor.js +2 -2
- package/views/dist/grid/chrome/GridRowCells.js +2 -1
- package/views/dist/grid/chrome/GridTextEditor.js +2 -2
- package/views/dist/grid/chrome/grid-column-menu-items.js +4 -2
- package/views/dist/grid/chrome/grid-editor-layer.d.ts +5 -1
- package/views/dist/grid/chrome/grid-editor-layer.js +1 -0
- package/views/dist/grid/chrome/grid-fitted-box.d.ts +7 -1
- package/views/dist/grid/chrome/grid-fitted-box.js +4 -4
- package/views/dist/grid/chrome/useGridBandFigures.js +2 -2
- package/views/dist/grid/chrome/useGridFittedWidths.d.ts +3 -0
- package/views/dist/grid/chrome/useGridFittedWidths.js +9 -3
- package/views/dist/grid/chrome/useGridKeyboard.d.ts +4 -1
- package/views/dist/grid/chrome/useGridKeyboard.js +5 -2
- package/views/dist/grid/chrome/useGridTableInteractionModel.js +2 -1
- package/views/dist/grid/core/clipboard-model.js +9 -4
- package/views/dist/grid/core/commit-model.d.ts +7 -0
- package/views/dist/grid/core/commit-model.js +5 -1
- package/views/dist/grid/core/editing-controller.js +10 -2
- package/views/dist/grid/core/editing-model.js +3 -7
- package/views/dist/grid/core/undo-owner.d.ts +6 -0
- package/views/dist/grid/core/undo-owner.js +13 -0
- package/views/dist/grid/core/useGridEditing.d.ts +2 -0
- package/views/dist/grid/core/useGridEditing.js +4 -0
- package/views/dist/grid/grid.css +240 -0
- package/views/dist/grid/looks.d.ts +5 -1
- package/views/dist/grid/looks.js +20 -12
- package/views/dist/grid-tokens.d.ts +109 -0
- package/views/dist/grid-tokens.js +29 -0
- package/views/dist/looks/index.d.ts +10 -0
- package/views/dist/looks/index.js +10 -0
- package/views/dist/looks/pieces.js +20 -0
- package/views/dist/model/column-capabilities.d.ts +2 -0
- package/views/dist/model/column-filters.d.ts +2 -1
- package/views/dist/model/column-from.js +2 -2
- package/views/dist/model/relation-filters.d.ts +2 -0
- package/views/dist/panels/index.d.ts +2 -2
- package/views/dist/panels/index.js +2 -2
- package/views/dist/panels/labels.d.ts +4 -0
- package/views/dist/panels/labels.js +8 -0
- package/views/dist/panels/model.d.ts +14 -1
- package/views/dist/panels/quick/model.d.ts +4 -0
- package/views/dist/panels/react/customize-body.d.ts +12 -5
- package/views/dist/panels/react/customize-body.js +41 -13
- package/views/dist/panels/react/customize.d.ts +8 -1
- package/views/dist/panels/react/customize.js +11 -6
- package/views/dist/panels/react/filter/FilterEditor.js +6 -6
- package/views/dist/panels/react/filter/FilterFieldList.js +10 -2
- package/views/dist/panels/react/filter/PhoneFilterEditor.d.ts +8 -2
- package/views/dist/panels/react/filter/PhoneFilterEditor.js +12 -9
- package/views/dist/panels/react/filter/filter-body.d.ts +8 -5
- package/views/dist/panels/react/filter/filter-body.js +21 -7
- package/views/dist/panels/react/filter/filter-part-body.d.ts +4 -1
- package/views/dist/panels/react/filter/filter-part-body.js +3 -1
- package/views/dist/panels/react/panel-sheet.d.ts +5 -1
- package/views/dist/panels/react/panel-sheet.js +6 -2
- package/views/dist/panels/react/panel-step.d.ts +15 -0
- package/views/dist/panels/react/panel-step.js +27 -0
- package/views/dist/panels/react/quick/QuickFiltersPanel.js +1 -0
- package/views/dist/panels/react/sort/SortEditor.d.ts +4 -0
- package/views/dist/panels/react/sort/SortEditor.js +5 -2
- package/views/dist/panels/react/toolbar/ReadyToolbar.d.ts +18 -0
- package/views/dist/panels/react/toolbar/ReadyToolbar.js +93 -4
- package/views/dist/panels/react/toolbar/Toolbar.js +1 -1
- package/views/dist/panels/react/toolbar/ToolbarAsideFilter.js +2 -2
- package/views/dist/panels/react/toolbar/ToolbarBarFilter.js +15 -5
- package/views/dist/panels/react/toolbar/ToolbarFilterAdd.d.ts +16 -0
- package/views/dist/panels/react/toolbar/ToolbarFilterAdd.js +50 -0
- package/views/dist/panels/react/toolbar/ToolbarFilterSheet.js +3 -1
- package/views/dist/panels/react/toolbar/ToolbarFilters.d.ts +4 -1
- package/views/dist/panels/react/toolbar/ToolbarFilters.js +38 -23
- package/views/dist/panels/react/toolbar/ToolbarOptions.d.ts +12 -4
- package/views/dist/panels/react/toolbar/ToolbarOptions.js +6 -2
- package/views/dist/panels/react/toolbar/ToolbarQuickFilters.d.ts +4 -1
- package/views/dist/panels/react/toolbar/ToolbarQuickFilters.js +2 -2
- package/views/dist/panels/react/toolbar/ToolbarSortPill.d.ts +5 -0
- package/views/dist/panels/react/toolbar/ToolbarSortPill.js +15 -6
- package/views/dist/panels/react/toolbar/panel-part.d.ts +5 -1
- package/views/dist/panels/react/toolbar/panel-part.js +2 -2
- package/views/dist/panels/react/toolbar/use-filter-add.d.ts +16 -0
- package/views/dist/panels/react/toolbar/use-filter-add.js +32 -0
- package/views/dist/panels/react/view-footer.d.ts +1 -1
- package/views/dist/panels/react/views-row/ViewPicker.js +25 -4
- package/views/dist/panels/react.d.ts +1 -0
- package/views/dist/panels/react.js +1 -0
- package/views/dist/panels/settings/filter-groups.d.ts +3 -0
- package/views/dist/panels/settings/filter-groups.js +72 -7
- package/views/dist/panels/settings/filters.d.ts +5 -0
- package/views/dist/panels/settings/filters.js +12 -6
- package/views/dist/panels/settings/group-buckets.js +1 -0
- package/views/dist/panels/views-row/model.d.ts +10 -1
- package/views/dist/provider/ViewsProvider.d.ts +7 -1
- package/views/dist/provider/ViewsProvider.js +50 -6
- package/views/dist/provider/components.d.ts +178 -11
- package/views/dist/provider/context.d.ts +6 -0
- package/views/dist/provider/moment.d.ts +6 -0
- package/views/dist/provider/moment.js +10 -0
- package/views/dist/provider/ports.d.ts +18 -6
- package/views/dist/provider/ports.js +2 -1
- package/views/dist/react.d.ts +2 -2
- package/views/dist/react.js +1 -1
- package/views/dist/selection/SelectionBar.d.ts +2 -16
- package/views/dist/selection/SelectionBar.js +4 -1
- package/views/dist/selection/bar-props.d.ts +26 -0
- package/views/dist/selection/bar-props.js +1 -0
- package/views/dist/selection/index.d.ts +1 -1
- package/views/dist/selection/verbs.d.ts +32 -5
- package/views/dist/styles.css +1499 -73
- package/views/dist/styles.unlayered.css +1497 -70
- package/views/docs/contract.md +56 -23
- package/views/docs/controls/alert-dialog.md +37 -0
- package/views/docs/controls/alert.md +30 -0
- package/views/docs/controls/bulk-bar.md +41 -0
- package/views/docs/controls/choice.md +25 -0
- package/views/docs/controls/collapsible.md +22 -0
- package/views/docs/controls/customize.md +17 -0
- package/views/docs/controls/filter-editor.md +28 -0
- package/views/docs/controls/group-editor.md +11 -0
- package/views/docs/controls/modal.md +55 -0
- package/views/docs/controls/notice.md +32 -0
- package/views/docs/controls/pane.md +25 -0
- package/views/docs/controls/popover.md +2 -0
- package/views/docs/controls/press.md +9 -0
- package/views/docs/controls/quick-filters.md +35 -0
- package/views/docs/controls/radio.md +1 -1
- package/views/docs/controls/sort-editor.md +27 -0
- package/views/docs/controls/switch-row.md +18 -0
- package/views/docs/controls/tag-field.md +7 -0
- package/views/docs/controls/toast.md +32 -0
- package/views/docs/controls/toolbar-button.md +31 -0
- package/views/docs/controls/toolbar.md +14 -0
- package/views/docs/guides/atoms.md +2 -2
- package/views/docs/guides/cells.md +3 -3
- package/views/docs/guides/display.md +3 -3
- package/views/docs/guides/looks.md +8 -2
- package/views/docs/guides/ports.md +6 -6
- package/views/docs/guides/selection.md +5 -1
- package/views/docs/guides/the-grid.md +2 -2
- package/views/docs/guides/the-provider.md +21 -2
- package/views/docs/install.md +4 -1
- package/views/docs/reference/cells.md +3 -3
- package/views/docs/reference/controls.md +403 -16
- package/views/docs/reference/display.md +3 -2
- package/views/docs/reference/editors-relation.md +1 -1
- package/views/docs/reference/looks.md +35 -11
- package/views/docs/reference/panels-react.md +11 -10
- package/views/docs/reference/panels.md +9 -7
- package/views/docs/reference/react.md +20 -13
- package/views/docs/reference/selection.md +4 -2
- package/views/docs/reference/views.md +8 -6
- package/views/skills/views/SKILL.md +2 -2
|
@@ -24,6 +24,7 @@ Guide: [display](../guides/display.md).
|
|
|
24
24
|
|
|
25
25
|
## Formatting a value as text
|
|
26
26
|
|
|
27
|
+
- `timeShown` — whether a date-and-time shows its time: the reader's choice, else the field's or column's `withTime`, else yes. Takes the declared answer, then the chosen one.
|
|
27
28
|
- `formatDateValue` — prints a date or an instant: takes the value, the date style (`short` when none), whether to show the time, the kind (`"datetime"` by default; `"date"` reads a `YYYY-MM-DD` day key) and options carrying `presentation` and `viewer`. A `Date` handed for a day is read as its calendar day. A value that does not parse comes back as its own text, never "Invalid Date".
|
|
28
29
|
- `formatNumberValue` — prints a number in the style its format names (plain, duration, percent or currency): takes the value, a `NumberLikeFormat` (plain when none) and options (`decimals`, `currency`, `durationStyle`, `presentation`, `viewer`), which win over the format. A duration reads the value in its stored unit (milliseconds, or seconds when the format says so) and picks its own precision. A currency code comes from the options, then the format, then `EUR`. A `signed` format prints `+ ` or `− ` before the absolute value.
|
|
29
30
|
- `formatMoney` — writes an amount in its own currency, as a money cell does: takes the amount, the currency, the decimals (two by default) and options carrying `presentation` and `viewer`, and prints through `formatNumberValue`, so the amount reads in the viewer's locale and your presentation's look. With no options it takes the default presentation and the neutral conventions (`en-GB`). An absent currency is read as EUR and an absent amount as zero; a code `Intl` refuses is written as the code before the number.
|
|
@@ -33,8 +34,8 @@ Guide: [display](../guides/display.md).
|
|
|
33
34
|
|
|
34
35
|
## The viewer and the presentation
|
|
35
36
|
|
|
36
|
-
- `FieldViewerContext` — who is reading: `locale`, `now
|
|
37
|
-
- `viewerFrom` — builds a `FieldViewerContext` from your conventions: their locale, names language, zone, region and messages, with the package's words (`resolveViewsMessage` unless you pass a resolver) and `now` (the current moment unless you pass one).
|
|
37
|
+
- `FieldViewerContext` — who is reading: `locale`, and optionally `now` (the moment relative dates count from; absent before the provider has one), `language` (the names language a place's country is written in; `locale` when absent), `timeZone`, `region` (a phone of that country is written as at home), `fieldMessages` (fields' words, fields' English by default) and `messages` (the package's words, its English by default).
|
|
38
|
+
- `viewerFrom` — builds a `FieldViewerContext` from your conventions: their locale, names language, zone, region and messages, with the package's words (`resolveViewsMessage` unless you pass a resolver) and `now` (the current moment unless you pass one; `null`, a viewer with no moment yet, whose relative dates draw in full).
|
|
38
39
|
- `FieldPresentation` — every formatter a value is printed through, so your app can replace how numbers, durations and dates read: `message`, `number`, `duration`, `calendarDay`, `instant`, `relativeCalendarDay` and `relativeInstant`, each handed the viewer. The provider's `presentation` option returns one, given the defaults.
|
|
39
40
|
- `DEFAULT_FIELD_PRESENTATION` — the package's own `FieldPresentation`. Numbers print through `Intl.NumberFormat` in the viewer's locale; a percent, stored as 0 to 100, prints as it is with `%`; a currency defaults to `EUR` with two decimals. Days print `short` ("27 Sep", the year added when it is not the current one), `long` ("27 September 2026") or `numeric` ("27/09/2026"), a time ("14:05") after a comma, in the viewer's zone. Relative styles say "just now", "5m ago", "in 1d", and "today", "yesterday" or "tomorrow" for a day. Month names and relative words come from the viewer's messages.
|
|
40
41
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# `viewkitjs/views/editors/relation`
|
|
2
2
|
|
|
3
|
-
Import from `viewkitjs/views/editors/relation` in a client component: the door opens with the client directive. It holds the picker for a link, the editor of a `relation` and a `user` field: search the candidates, pick one, and it replaces the link; and the editor of a relation holding several records, which adds and removes links with the list open. The candidates are the host's, through a `RelationSource`: a static list the panel filters on its labels, or a remote search your function answers a page at a time. The panel owns the search box, the rows, the paging (it waits before a typed query searches, drops an answer a newer query superseded, asks for the next page as the end of the list scrolls into view, and says
|
|
3
|
+
Import from `viewkitjs/views/editors/relation` in a client component: the door opens with the client directive. It holds the picker for a link, the editor of a `relation` and a `user` field: search the candidates, pick one, and it replaces the link; and the editor of a relation holding several records, which adds and removes links with the list open. The candidates are the host's, through a `RelationSource`: a static list the panel filters on its labels, or a remote search your function answers a page at a time. The panel owns the search box, the rows, the paging (it waits before a typed query searches, drops an answer a newer query superseded, asks for the next page as the end of the list scrolls into view, and says it is searching from the keystroke until the typed query answers, so an Enter meanwhile picks nothing, and when it failed or found nothing) and, in `RelationEditor`, what a close means: a pick is the commit, every other close discards (`RelationSetEditor` saves on every close but Escape). It never does the asking itself, so access stays in your function's closure. Its host owns the popover, the anchor and the write. It commits the picked id, or null for None. The door also re-exports `RelationCandidate`, `RelationSearch` and `RelationSource`, which are documented with the root door. Guide: [editors](../guides/editors.md).
|
|
4
4
|
|
|
5
5
|
- `RelationEditor` — the relation-picking panel, built from your app's command list, or opened in your app's `Picker` when the provider has one (the list filtered or fetched by the editor, the create rows as its `actions`); its ref is a `RelationEditorHandle`. It takes `candidates` (the `RelationSource`), `initial` (the linked id, or null), `clearable` (a None row for a link the surface says is optional, hidden while a query is typed), `onRequestClose` (called with `pick` when someone chooses), `kindGlyph` (the glyph worn by every candidate with no icon of its own; given, every row keeps a glyph lane so the labels line up), `noneLabel` (the surface's words for the None row), `message` (the fields message resolver, defaulting to the provider's conventions), `creates` (`RelationCreate` rows pinned under the list), `seed` (the text the search opens with, such as a letter typed on the cell that opened it), `label` (the field's name, for your `Picker`; default the search's words) and `focusSearch` (put the caret in the search as the panel opens, without scrolling; off by default, and left off on a phone so its sheet opens with the keyboard down). The list opens with the linked record highlighted, so an Enter pressed at once changes nothing; when a remote page doesn't hold it, nothing is highlighted until a key or typed text moves the highlight; with nothing linked, None or the first candidate; opened with a `seed`, the first match. It asks your command list for that through its root's `defaultValue`; a list that ignores it opens on its first row. A candidate's `sublabel` draws as a muted second line and its `badge` as a small chip at the row's end.
|
|
6
6
|
- `RelationEditorHandle` — what the host's ref reads: `resolveClose(reason)`, synchronous and safe to ask twice. It answers `commit` with the picked id, or null for None, only for `pick` and only when it differs from `initial`; `noop` for a `pick` with nothing picked or the link already held; `cancel` for every other reason.
|
|
@@ -65,7 +65,7 @@ on a frame round the controls as `data-<piece>-*`, which each control's styleshe
|
|
|
65
65
|
- `inputFrameAttrs` — `inputFrameAttrs(look)`: the same, on a frame, so every field inside draws as that look draws its own box.
|
|
66
66
|
- `kindLook` — `kindLook(chrome, look)`: a box's own look under its kind (Soft lays the Soft look under it).
|
|
67
67
|
- `attioBox` — `attioBox(phone)`: the labelled box's own look, its computer form keeping its own size on a phone.
|
|
68
|
-
- `INLINE_INPUT_LOOKS` — the inline input's: 4 options (`edge`, `corners` from `none` to `full`, `ground`, `tint` from 10% to 100% under the tint ground) and three looks, `attio`, `mihais` and `tinted`. Nothing picked is the line, `md` corners, on a 20% tint, which no look matches.
|
|
68
|
+
- `INLINE_INPUT_LOOKS` — the inline input's: 4 options (`edge`, `corners` from `none` to `full`, `ground`, `tint` from 10% to 100% under the tint ground) and three looks, `attio`, `mihais` (named Outright) and `tinted`. Nothing picked is the line, `md` corners, on a 20% tint, which no look matches.
|
|
69
69
|
- `InlineInputLookOptionId` — its option ids.
|
|
70
70
|
- `FIELD_LOOKS` — Field rows', the phone's: 5 options (`rows-cards`, `rows-edge`, `rows-height`, `rows-label`, `rows-lines`) and three looks, `card` (every option's default), `each` and `rows`.
|
|
71
71
|
- `FieldLookOptionId` — its option ids.
|
|
@@ -76,7 +76,6 @@ on a frame round the controls as `data-<piece>-*`, which each control's styleshe
|
|
|
76
76
|
- `CHECKBOX_LOOKS` — the Checkbox's: 1 option (`smoothing`) and no looks.
|
|
77
77
|
- `CheckboxLookOptionId` — its option ids.
|
|
78
78
|
|
|
79
|
-
|
|
80
79
|
<!-- The rows: the Option, the Tag, the Status, the Switch, the menu list -->
|
|
81
80
|
|
|
82
81
|
- `OPTION_LOOKS` — the Option's: 5 options (`colour`, how a coloured Option draws its colour; `height`, a scale from `20` to `24`; `radius`, a scale from `xs` to `full`; `smoothing`; `edge`) and five looks, `none`, `dot`, `pill`, `flat` and `shadcn`.
|
|
@@ -96,35 +95,60 @@ on a frame round the controls as `data-<piece>-*`, which each control's styleshe
|
|
|
96
95
|
|
|
97
96
|
- `LIST_LOOKS` — the list's, every list that floats (the Select's, the Menu's panel, the Picker on a computer): 9 options (`smoothing`; `edge`; `shadow`, a scale from `none` to `xl`; `padding`, from `0` to `8`; `rows`, a computer's row height from `28` to `40`; `highlight`; `intensity`, from `1` to `3`; `row-corners`, from `input` to `full`; `dividers`) and no looks.
|
|
98
97
|
- `ListOptionId` — the list's option ids.
|
|
99
|
-
- `PICKER_LOOKS` — the Picker's: 9 options (`search`; `picked`, `create`, `doing`, `heading` and `face` a computer's; `mark`; `line`; `kind`) and two looks, `attio` (Attio's picks) and `mihai
|
|
98
|
+
- `PICKER_LOOKS` — the Picker's: 9 options (`search`; `picked`, `create`, `doing`, `heading` and `face` a computer's; `mark`; `line`; `kind`) and two looks, `attio` (Attio's picks) and `mihai` (named Outright); with nothing picked, a second line below, the list's message at the start and a face of 24 (My preset's).
|
|
100
99
|
- `PickerOptionId` — the Picker's option ids.
|
|
101
100
|
- `AVATAR_LOOKS` — the Avatar's, for its squares: 2 options (`corners`, a scale from `small` to `xlarge`; `smoothing`) and no looks.
|
|
102
101
|
- `AvatarLookOptionId` — the Avatar's option ids.
|
|
103
102
|
- `MENU_LIST_CARD_FRAME` — the menu list's options as a frame's data attributes, the Stack look's (Card rows, inset lines, 52, xl): a piece whose menu lists are no menu's own sheet (a panel's settings, a list of people) puts it round them, and keeps them whatever the app picks, since with nothing picked a menu's own sheet draws My preset's Words and the nearest frame wins.
|
|
104
103
|
|
|
105
|
-
<!-- The panels' block: the Pane, the toolbar button, the Radio, the sort editor, the views list, the Modal, the alert dialog, the Toast, the Collapsible, the Alert, the Notice -->
|
|
104
|
+
<!-- The panels' block: the Pane, the toolbar button, the Radio, the sort editor, the views list, the filter editor, the group editor, Customize, the Modal, the alert dialog, the Toast, the Collapsible, the Alert, the Notice -->
|
|
106
105
|
|
|
106
|
+
- `PANE_LOOKS` — the Pane's: 7 options, each a computer's (`place`, `list` or `fit`; `corners`, `lg`, `xl` or `2xl`; `smoothing`, `round` or `smooth`; `shadow`, `none`, `menu`, `lg` or `xl`; `edge`, `outline`, `subtle` or `none`; `gap`, `0` to `16`, `8` the default (My preset's); `padding`, `0` to `16`), and no looks.
|
|
107
|
+
- `PaneOptionId` — its option ids.
|
|
108
|
+
- `TOOLBAR_BUTTON_LOOKS` — the toolbar button's: 10 options, a computer's `ground` (`ghost`, `bordered` the default, `filled`), `words` (`both` the default, `icon`, `word`), `size` (`28`, `32` the default, `36`) and `corners` (`button` the default, the Button's, then `xs` to `full`); a phone's `groundphone` (`filled` the default), `wordsphone` (`icon` the default, `both`), `sizephone` (`36` the default, `44`) and `cornersphone` (`full` the default); and on both `smoothing` (`app` the default, `smooth`, `round`) and `weight` (`button` the default, `medium`, `semibold`). Every default is My preset's. 2 looks: `attio`, every default, and `portal`, ghost with its icon alone.
|
|
109
|
+
- `ToolbarButtonOptionId` — its option ids.
|
|
107
110
|
- `VIEWS_LIST_LOOKS` — the views list's: 2 options (`private`, Private views: Shared and Just me, a private view's lock, and a view's menu's Private view; `favorites`, a view's menu's Favorite), each `off` (the default, My preset's) or `on`, and no looks.
|
|
108
111
|
- `ViewsListOptionId` — its option ids.
|
|
112
|
+
- `CUSTOMIZE_LOOKS` — Customize's: 2 options (`head`, Its head: `title`, a title (the default, My preset's), or `name`, the view's name renamed in place; `columns`, Columns: `switch`, Switches (the default, My preset's), or `eye`, Eyes), for a computer and a phone alike, and no looks.
|
|
113
|
+
- `CustomizeOptionId` — its option ids.
|
|
114
|
+
- `MODAL_LOOKS` — the Modal's: 12 options, each a computer's (`edge`, `lines`, `buttons`, `head`, `size`, `corners`, `smoothing`, `padding`, `behind`, `strength`, `blur`, `shadow`), and two looks, `framed` (every option's default) and `outlined`.
|
|
115
|
+
- `ModalOptionId` — its option ids.
|
|
116
|
+
- `ALERT_DIALOG_LOOKS` — the alert dialog's: 11 options (`close`, the X, a phone's; `padding`; `behind`, `dim` or `veil`; `strength`; `blur`, a computer's, and `blurphone`; `shadow`, a computer's, and `shadowphone`; `margin`, a phone's; `corners`; `smoothing`, `round` or `smooth` (the default, My preset's)), and no looks.
|
|
117
|
+
- `AlertDialogOptionId` — its option ids.
|
|
118
|
+
- `COLLAPSIBLE_LOOKS` — the Collapsible's: 2 options (`content`, `still`, `fade` (the default, My preset's) or `slide`: how what it holds comes and goes; `curve`, `soft` or `sharp`), and no looks.
|
|
119
|
+
- `CollapsibleOptionId` — its option ids.
|
|
120
|
+
- `ALERT_LOOKS` — the Alert's: 5 options (`buttons`, `end` (the default, My preset's) or `full`, a computer's; `size`, `32`, `36` or `44`, a computer's; `pair`, `side` or `stacked`, a phone's; `mark`, `none` or `shown`; `phone`, `panel` or `sheet`, what it opens as on a phone) and three looks, `even`, `plain` and `marked`.
|
|
121
|
+
- `AlertOptionId` — its option ids.
|
|
122
|
+
|
|
123
|
+
<!-- The toolbar's block: the quick filters (VK-724), the Toolbar (VK-858), the bulk bar (VK-725) -->
|
|
124
|
+
|
|
125
|
+
- `QUICK_FILTERS_LOOKS` — the quick filters': 1 option (`holds`, Holds: `one`, one at a time in all (the default), or `several`, several at once), for a computer and a phone alike, and no looks.
|
|
126
|
+
- `QuickFiltersOptionId` — its option ids.
|
|
127
|
+
- `TOOLBAR_LOOKS` — the Toolbar's: 14 options, a computer's ten (`search`, `button` or `input`; `words`, `icon` or `both`; `sortfilter`, `bar` or `right`; `settings`, `beside` or `right`; `bar`, `always` or `added`; `lines`, `across` or `none`; `save`, `bar` or `settings`; `add`, `primary`, `primary-icon`, `outline`, `outline-icon`, `like` or `like-icon`; `views`, `button` or `tabs`; `tabs`, `ghost`, `bordered` or `filled`), two for both (`sortfilterat`, `bar`, `pane` or `both`; `quick`, `none` or `button`) and a phone's two (`searchphone`, `button` or `line`; `sortfilterphone`, `beside` or `right`); and four looks, `mihai`, named Outright (every option's default: one row at rest, the sort and Filter on its right with their words, the filter bar once a filter is added, the quick filters' button), `attio`, `attio-right` and `portal`.
|
|
128
|
+
- `ToolbarOptionId` — its option ids.
|
|
129
|
+
- `ToolbarPicks` — one value for every option.
|
|
130
|
+
- `BULK_BAR_LOOKS` — the bulk bar's: 3 options (`delete`, `more` (the default, My preset's) or `own`; `phone`, `tray` (the default) or `pill`, a phone's; `picked`, `plain` (the default) or `ground`, a phone's, which the list holding it reads for its picked rows) and one look, `attio` (every option's default).
|
|
131
|
+
- `BulkBarOptionId` — its option ids.
|
|
132
|
+
- `BulkBarPicks` — one value for every option.
|
|
109
133
|
|
|
110
134
|
<!-- The editors' block: the Text editor, the Picker, the Date editor, the Compound editor, the Number editor, the Values editor, the Links editor -->
|
|
111
135
|
|
|
112
|
-
- `TEXT_EDITOR_LOOKS` — the Text editor's: 3 options (`box`, `over` or `cell`, a computer's; `long`, `enter` or `mod`, a computer's; `phone`, `country` or `line`) and two looks, `attio` (every option's default) and `mihais
|
|
136
|
+
- `TEXT_EDITOR_LOOKS` — the Text editor's: 3 options (`box`, `over` or `cell`, a computer's; `long`, `enter` or `mod`, a computer's; `phone`, `country` or `line`) and two looks, `attio` (every option's default) and `mihais` (named Outright).
|
|
113
137
|
- `TextEditorLookOptionId` — its option ids.
|
|
114
|
-
- `DATE_EDITOR_LOOKS` — the Date editor's: 6 options (`line`, `box` or `edge`, a computer's; `time`, `parts` or `beside`, a computer's; `days`, `outlined` or `filled`, a computer's; `year`, `typed` or `twelve`, a computer's; `picks`, `row` or `two`, a computer's; `calendar`, `plain` or `cards`, a phone's) and two looks, `attio` (every option's default) and `mihai
|
|
138
|
+
- `DATE_EDITOR_LOOKS` — the Date editor's: 6 options (`line`, `box` or `edge`, a computer's; `time`, `parts` or `beside`, a computer's; `days`, `outlined` or `filled`, a computer's; `year`, `typed` or `twelve`, a computer's; `picks`, `row` or `two`, a computer's; `calendar`, `plain` or `cards`, a phone's) and two looks, `attio` (every option's default) and `mihai` (named Outright).
|
|
115
139
|
- `DateEditorLookOptionId` — its option ids.
|
|
116
|
-
- `COMPOUND_EDITOR_LOOKS` — the Compound editor's: 4 options (`boxes`, `boxes` or `fields`; `shown`, `hidden` or `shown`; `country`, `last` or `first`; `arrows`, `editing` or `none`, a computer's) and two looks, `attio` (every option's default) and `mihai
|
|
140
|
+
- `COMPOUND_EDITOR_LOOKS` — the Compound editor's: 4 options (`boxes`, `boxes` or `fields`; `shown`, `hidden` or `shown`; `country`, `last` or `first`; `arrows`, `editing` or `none`, a computer's) and two looks, `attio` (every option's default) and `mihai` (named Outright).
|
|
117
141
|
- `CompoundEditorOptionId` — its option ids.
|
|
118
|
-
- `NUMBER_EDITOR_LOOKS` — the Number editor's: 3 options (`arrows`, `editing` or `none`, a computer's; `units`, `code` or `sign`; `sheet`, `line` or `field`, a phone's) and two looks, `attio` (every option's default) and `mihai
|
|
142
|
+
- `NUMBER_EDITOR_LOOKS` — the Number editor's: 3 options (`arrows`, `editing` or `none`, a computer's; `units`, `code` or `sign`; `sheet`, `line` or `field`, a phone's) and two looks, `attio` (every option's default) and `mihai` (named Outright).
|
|
119
143
|
- `NumberEditorOptionId` — its option ids.
|
|
120
|
-
- `VALUES_EDITOR_LOOKS` — the Values editor's: 5 options (`rows`, `copy` or `fill`, a computer's; `main`, `none` or `pill`, a computer's; `line`, `plus` or `icon`; `lists`, `under` or `inplace`, a computer's; `phone`, `rows` or `cards`, a phone's) and two looks, `attio` (every option's default) and `mihai
|
|
144
|
+
- `VALUES_EDITOR_LOOKS` — the Values editor's: 5 options (`rows`, `copy` or `fill`, a computer's; `main`, `none` or `pill`, a computer's; `line`, `plus` or `icon`; `lists`, `under` or `inplace`, a computer's; `phone`, `rows` or `cards`, a phone's) and two looks, `attio` (every option's default) and `mihai` (named Outright).
|
|
121
145
|
- `ValuesEditorOptionId` — its option ids.
|
|
122
146
|
|
|
123
147
|
## The grid's
|
|
124
148
|
|
|
125
|
-
- `GRID_LOOKS` — the grid's options and looks: 25 options (`header`, `lines`, `columns`, `density`, `phone`, `name`, `edge`, `boxes`, `icon`, `picked`, `cell`, `corners`, `hover`, `frame`, `groups`, `names`, `phones`, `typed`, `figures`, `width`, `more`, `wait`, `foot`, `add`, `picking`) and two looks, `attio`
|
|
149
|
+
- `GRID_LOOKS` — the grid's options and looks: 25 options (`header`, `lines`, `columns`, `density`, `phone`, `name`, `edge`, `boxes`, `icon`, `picked`, `cell`, `corners`, `hover`, `frame`, `groups`, `names`, `phones`, `typed`, `figures`, `width`, `more`, `wait`, `foot`, `add`, `picking`) and two looks, `attio` and `portal` (ViewKit's own grid, as the portal draws it). Every default is My preset's, which differs from `attio` in ten options (`columns` `all`, `edge` `line`, `boxes` `always`, `picked` `line`, `corners` `round`, `hover` `strong`, `groups` `titles`, `names` `hover`, `phones` `text`, `figures` `word`).
|
|
126
150
|
- `GridLookOptionId` — the grid's option ids.
|
|
127
|
-
- `GridLookWorn` — what the grid's code reads of its options: `columns`, `density`, `phone`, `name`, `boxes`, `icon`, `groups`, `figures`, `width`, `more`, `wait`, `foot`, `add` and `picking`. The others are its look stylesheet's alone,
|
|
151
|
+
- `GridLookWorn` — what the grid's code reads of its options: `columns`, `density`, `phone`, `name`, `boxes`, `icon`, `groups`, `figures`, `width`, `more`, `wait`, `foot`, `add` and `picking`. The others are its look stylesheet's alone, `viewkitjs/views/grid.css`.
|
|
128
152
|
- `GRID_LOOK_READ` — those fourteen option ids, in that order. Eleven reach `GridTable` through `gridLookProps`; `more`, `figures` and `wait` the app wires itself (the [guide](../guides/looks.md)).
|
|
129
153
|
- `gridLookWorn` — `gridLookWorn(picks?)`: a `GridLookWorn` from a set of picks.
|
|
130
154
|
- `gridLookWornOf` — `gridLookWornOf(element)`: a `GridLookWorn` read from the frame round `element`.
|
|
@@ -34,7 +34,7 @@ The row of views over a list, and any row of pills: each pill is your `Pill` ato
|
|
|
34
34
|
- `ViewTabs` — one axis as plain pills on a scroll rail.
|
|
35
35
|
- `toPillOptions` — views turned into pill options: the label and count joined by `views.panels.view-count`, a slot's colours, the glyph by your `AppIcon`.
|
|
36
36
|
- `FoldingViewRow` — the saved-views row that folds what doesn't fit into a "+N" chip, never folding the active view, and closes with the + when the axis grows. Handed `folded`, as a folding toolbar line hands it, it folds that many tabs and measures nothing of its own.
|
|
37
|
-
- `ViewPicker` — the same axis as one chip naming the active view, its views in a list: shared, then personal, a search past five, and "New view…" last. The list opens in your `Popover` at the chip; on a phone (in a `Toolbar`, its phone form; elsewhere your provider's `desktopQuery`) in your `Sheet` (`snap: "auto"`, titled `views.panels.views-list`), its search not taking the focus. Handed a `ViewsListBody` in your components map, the chip opens it in place of its own list, in the same `Popover` and `Sheet`: it is handed the views as data, a pick or an order is written once it fits the axis, its `onDone` closes the list, and on a phone it gets the ✕ as its `actions` only where your sheet's head doesn't draw it ([the components map](../contract.md#the-components-map)).
|
|
37
|
+
- `ViewPicker` — the same axis as one chip naming the active view, its views in a list: shared, then personal, a search past five, and "New view…" last. The list opens in your `Popover` at the chip; on a phone (in a `Toolbar`, its phone form; elsewhere your provider's `desktopQuery`) in your `Sheet` (`snap: "auto"`, titled `views.panels.views-list`), its search not taking the focus. Handed a `ViewsListBody` in your components map, the chip opens it in place of its own list, in the same `Popover` and `Sheet`: it is handed the views as data, a pick or an order is written once it fits the axis, its `onDone` closes the list, and on a phone it gets the ✕ (and Back on a step) as its `actions` only where your sheet's head doesn't draw it, and `onStepChange`, whose step's title and Back the sheet shows; the axis's `verbs`, where it hands them, reach it as they are ([the components map](../contract.md#the-components-map)).
|
|
38
38
|
- `ViewPickerRow` — one view as a row of a list, with the active view's `⋮`.
|
|
39
39
|
- `ViewCreatePill` — the + that creates a view.
|
|
40
40
|
- `ViewAxes` — an axis or several on one row: one axis at the row's size folds, peer axes share one rail, each in its own track. `folded` is handed on to the one axis's `FoldingViewRow`.
|
|
@@ -61,9 +61,9 @@ A panel's list keeps `--vk-panel-padding` from its edge ([Tokens](../contract.md
|
|
|
61
61
|
|
|
62
62
|
The panel a list's Options button opens, put together from the panels above: one header frame (a back arrow only when deep, the title, Clear all at the root without a shared view, a ✕ when the host can close it) over the root list or the page a row opened, and, at the root of a shared view, its footer. Its root is a `data-vs-detail` list, its header `data-vs-header`, its footer `data-vs-footer` with `data-vs-inset` and each actions row a `data-vs-row`, so a drawer of your own insets them through those; the root's rows carry `data-vs-row` when your `MenuRow` and `ToggleRow` atoms do. Your app hosts it: in a popover, or in a full-height drawer with `fill`.
|
|
63
63
|
|
|
64
|
-
- `ViewOptionsPanelContent` — the panel. Takes the list's `filters`, `sort`, `group`, `timeScopeConfig`, `dateRangeConfigs`, `toggles` and `layout` (`ViewOptionInputs`; its `sorts` and `filterTree` reach a `CustomizeBody` as its sort and filter), `activePanel` and `onOpenPanel`, `anyActive` and `clearAll`, and optionally `view` (`CollectionViewState`), `foldFilters` (one Filter row, on by default; off, every filter is a root row), `onClose`, `closeButton` (whether its header draws the ✕, default true; false in a sheet whose head draws it, `onClose` still closing it from inside, as a column's Done does), `fill
|
|
64
|
+
- `ViewOptionsPanelContent` — the panel. Takes the list's `filters`, `sort`, `group`, `timeScopeConfig`, `dateRangeConfigs`, `toggles` and `layout` (`ViewOptionInputs`; its `sorts` and `filterTree` reach a `CustomizeBody` as its sort and filter), `activePanel` and `onOpenPanel`, `anyActive` and `clearAll`, and optionally `view` (`CollectionViewState`), `foldFilters` (one Filter row, on by default; off, every filter is a root row), `onClose`, `closeButton` (whether its header draws the ✕, default true; false in a sheet whose head draws it, `onClose` still closing it from inside, as a column's Done does), `fill`, `fieldEditor` (`PanelFieldEditor`), and `viewName`, `onRenameView`, `onCopyLink`, `onExport` and `exportCount`, handed on to a `CustomizeBody` as `ToolbarOptions` hands them. Back walks one level: a relation's Where field to its filter, a folded filter to the Filter list, a column to the Columns list, Group's own Group by, Sort and Date by pages to Group (with an app's `GroupBody`, a level it tells goes back to its settings first, its name in the head), anything else to the root. Handed a `GroupBody` in your components map, Group (and its own pages) draws it, handed the group as data; handed a `CustomizeBody`, the whole panel is it, handed the view's settings as data, wherever the panel hangs, except for a list whose filter is only per-field values, with no `filterTree`, which keeps the panel ([the components map](../contract.md#the-components-map)).
|
|
65
65
|
- `PopoverRootList` — the root: Layout, Columns (`views.panels.columns-shown`), Filter (or each filter, unfolded), Sort, Group and the toggles, each opening its page through `onOpenPanel`.
|
|
66
|
-
- `ViewFooter` — Reset ·
|
|
66
|
+
- `ViewFooter` — Reset · Save for everyone on a shared view this person has drifted from; a member sees Reset alone, and nothing draws while `changes` is 0. `words: "kit"` says Clear and Save instead. With no `view` and an `onClear`, Clear alone, which takes the list back to its default. `className` replaces its side inset. `ToolbarOptions` and `ViewOptionsPanelContent` take `viewFoot` (`"kit"` for those words, `"none"` for no foot) and `footClear` (the foot's Clear with no shared view).
|
|
67
67
|
- `ViewOptionsActions` — the actions row: Copy link and Share parked, Export CSV live when `exportCsv` (`CollectionExportCsv`) is handed in, its count on the row and one export at a time behind the `loading` glyph, which your app draws turning.
|
|
68
68
|
- `ViewOptionsPopoverPanel` — the panel for a popover: `ViewOptionsPanelContent` with `setActivePanel` for `onOpenPanel`, its `sorts` and `filterTree` handed on; a `CustomizeBody` in your map opens in its place.
|
|
69
69
|
- `useViewOptionsPopover` — the state the trigger and the popover share (`ViewOptionsPopoverState`): `open`, the page it is on, the trigger's `badge` (the drift from everyone's view on a shared view, else the active options) and its `clearAll` (Reset, else clear them), and `handleOpenChange`, which forgets the page on a close. The trigger's own look is yours.
|
|
@@ -76,7 +76,7 @@ The panel a list's Options button opens, put together from the panels above: one
|
|
|
76
76
|
|
|
77
77
|
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.
|
|
78
78
|
|
|
79
|
-
- `Toolbar` — the frame. Takes `parts` (`ToolbarPart[]`), and optionally `phone`, `narrow`, `narrowBelow` (700 by default), `fold` and `className`. 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, 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.
|
|
79
|
+
- `Toolbar` — the frame. Takes `parts` (`ToolbarPart[]`), and optionally `phone`, `narrow`, `narrowBelow` (700 by default), `fold` and `className`. 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.
|
|
80
80
|
- `ToolbarPart` — a part as your app hands it: a `ToolbarPlacement` (its `key`, `side`, `line`, `role`, and in the fold arrangement `shed`, `tabs`, `filters` and `fold`), its `node`, and for a part that may fold its `menu`: `{ label, icon?, onSelect }`, its row in ⋯.
|
|
81
81
|
- `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.
|
|
82
82
|
- `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.
|
|
@@ -142,19 +142,20 @@ export function ListToolbar({
|
|
|
142
142
|
|
|
143
143
|
Options, Sort and Filter each open their panel from their own button, and each takes the builder's panels ([`settingsPanels`](panels.md#built-from-a-lists-settings)): an app that arranges its own parts calls the builder and hands them in. A panel hangs in your `Popover` at its button (`chrome="menu"`, aligned to its end), or in a host you hand in, your side drawer or your sheet, where it draws full height. On a phone (in a `Toolbar`, its phone form; elsewhere your provider's `desktopQuery`) it opens in your `Sheet` instead (`snap: "full"`, named `label` with the part's name, its own header titling it), full height, with every page the popover has; a host you hand still takes it. With your provider's `sheetActions: "head"`, the sheet's head draws the panel's ✕ (`actions.close`, no `done`, unless the panel hands its own ✕ and ✓, as the sort pill's editor does) and the panel draws none. Each is one of the toolbar's panels, so opening one closes the others. Hand `open` and `onOpenChange` (and `page` and `onPageChange` where it drills in) to hold its state yourself; without, it holds its own, forgetting its page when it closes.
|
|
144
144
|
|
|
145
|
-
- `ToolbarOptions` — Customize behind its own button, named and worded `views.panels.toolbar-options`: the builder's `filters`, `sort`, `group` and `layout` (and its `filterTree`, with and/or groups: its count and default Clear then read the advanced filters), your `toggles`, `timeScopeConfig` and `dateRangeConfigs` (a `ViewOptionInputs`), and optionally `view` (a shared view: the drift dot on the button instead of a count, and the panel's footer), `fieldEditor`, `foldFilters` (true by default), `onClear` (the ✕ and the panel's Clear all; by default each active option cleared through its own `onChange`, the builder's filter rows adding up so every filter clears, or Reset on a shared view; for one change, `settingsCleared(…, "options")`), `widthClassName`
|
|
145
|
+
- `ToolbarOptions` — Customize behind its own button, named and worded `views.panels.toolbar-options`: the builder's `filters`, `sort`, `group` and `layout` (and its `filterTree`, with and/or groups: its count and default Clear then read the advanced filters), your `toggles`, `timeScopeConfig` and `dateRangeConfigs` (a `ViewOptionInputs`), and optionally `view` (a shared view: the drift dot on the button instead of a count, and the panel's footer), `fieldEditor`, `foldFilters` (true by default), `onClear` (the ✕ and the panel's Clear all; by default each active option cleared through its own `onChange`, the builder's filter rows adding up so every filter clears, or Reset on a shared view; for one change, `settingsCleared(…, "options")`), `widthClassName` (`w-75` by default: 300 px, the Pane Customize was designed in), `host`, and what your `CustomizeBody` draws only where you hand it: `viewName` with `onRenameView` (the view's name, renamed in place), `onCopyLink`, and `onExport` with `exportCount` (what it takes, in words). On a phone, while your body stands on a level of its own inside a section (`onStepChange`), the sheet's Escape goes back a level instead of closing. Its button counts the active options (`countActiveViewOptions`) with a ✕ that clears them. Draws nothing when there is nothing to customize. A `CustomizeBody` in your components map opens in place of the panel, in the same popover, `host` or phone `Sheet`.
|
|
146
146
|
- `ToolbarSort` — the sort panel behind its own button, named `views.panels.sort`: the builder's `sort`, lit (`changed`) while the list sorts other than its default. Draws nothing when nothing sorts. Handed the builder's `sorts` too (with `severalSorts`), it is Sort on the row's right as the kit draws it there: "Sort", counted once there are two rules, opening the fields (`SortFieldList`), a pick adding a rule at the end, ascending; at three it can't be used, saying why (`views.panels.sort-max`).
|
|
147
|
-
- `ToolbarSortPill` — the sort as up to 3 rules, the kit's sort on its filter bar, in `data-slot="vk-toolbar-sort-pill"`: takes the builder's `sorts`, and optionally `open` and `onOpenChange` (to hold its state yourself), `host` and `addAfter` (default true). On a computer, "Sorted by" its first rule's field, in weight, with the rest counted (+1), opening the sort editor in your `Popover`; after it a + (`data-slot="vk-toolbar-sort-add"`, named `views.panels.sort-add-one`) while there are fewer than three, opening the fields, a pick adding a rule; with no rule, an empty place, "Sort", opening the fields. Handed `addAfter={false}` (the kit's bar), it draws no +, and its editor, or your `SortBody` (handed `addSort`), has Add sort at its foot. The fields are your `FieldsBody` where you hand one. × on the editor's last rule closes it. On a phone, "Sort" with its rules counted, opening the sort editor in your `Sheet`, its ✕ taking back what changed since it opened and its ✓ keeping it; a swipe, the dim or Escape close it and keep the changes. Its popovers, or its sheet, are one of the toolbar's panels.
|
|
147
|
+
- `ToolbarSortPill` — the sort as up to 3 rules, the kit's sort on its filter bar, in `data-slot="vk-toolbar-sort-pill"`: takes the builder's `sorts`, and optionally `open` and `onOpenChange` (to hold its state yourself), `host` and `addAfter` (default true). On a computer, "Sorted by" its first rule's field, in weight, with the rest counted (+1), opening the sort editor in your `Popover`; after it a + (`data-slot="vk-toolbar-sort-add"`, named `views.panels.sort-add-one`) while there are fewer than three, opening the fields, a pick adding a rule; with no rule, an empty place, "Sort", opening the fields. Handed `addAfter={false}` (the kit's bar), it draws no +, and its editor, or your `SortBody` (handed `addSort`), has Add sort at its foot. Handed `row`, it is Sort on a toolbar row (`data-slot="vk-toolbar-sort-row"`, as `ReadyToolbar`'s default stands it): its word "Sort", lit while a rule stands and counted from two; however it opens (a press, or ⋯ when it folded) it shows the sort editor, Add sort at its foot, while a rule or a set-aside sort stands, else the fields; it draws no + and `addAfter` means nothing to it. The fields are your `FieldsBody` where you hand one. × on the editor's last rule closes it. On a phone, "Sort" with its rules counted, opening the sort editor in your `Sheet`, its ✕ taking back what changed since it opened and its ✓ keeping it; a swipe, the dim or Escape close it and keep the changes; while your `SortBody` stands on a step of its own (`onStepChange`), Escape goes back a step instead, and under `sheetActions: "head"` your sheet's head shows the step's title. Its popovers, or its sheet, are one of the toolbar's panels.
|
|
148
148
|
- `SortEditor` — the sort editor's body alone, for a holder of your own (a popover): `sorts`, `form` (`"computer"` or `"phone"`), and optionally `open`, `onDone` and `addSort`. On a computer each rule (`data-slot="vk-sort-rule"`) is its grip, its field, its direction (Ascending, Descending, your `Menu`) and ×, inside `data-slot="vk-sort-editor"`, with no Add sort unless handed `addSort`: then Add sort (`data-slot="vk-sort-add"`) stands at its foot, after the set-aside sorts, opening the fields in your `Popover`, a pick adding a rule at the end, ascending, and at three, a set-aside sort holding one of the places, it can't be used and says why (`views.panels.sort-max`); on a phone each rule is a row, its direction under its field, a press opening its directions and ⋯ holding Delete, then Add sort (which turns the body to the fields, never a sheet on top; three at most) and Clear all, and "No sorting set up yet" with none. Every change goes out through `sorts.onChange` as it is made. A rule moves by its grip: dragged by the mouse after 8 px or a long press of 250 ms (a phone's row moves by itself), or ↑ and ↓ on its grip, the focus staying on that grip; the grip carries `data-base-ui-swipe-ignore`.
|
|
149
|
-
- `useSortEditor` — the sort editor's state for a sheet's holder (`SortEditorOptions`: `sorts`, `form`, `open`, `onDone`, `addSort`): `{ body, head }`. `body(closeButton)` draws it, on a phone with its own ✕ and ✓ when `closeButton` is true (no head of your sheet draws them: your provider's `sheetActions` is `bar`, or a host of yours holds it); `head` is the ✕ (named `views.panels.close`) and ✓ (`views.panels.sort-done`) for your sheet's head, as its `actions`. ✕ takes the rules back, in one change, to what they were when `open` last turned true. Handed a `SortBody` in your components map, `SortEditor` and `useSortEditor`'s `body` open it in place of their own rows, in every holder: it is handed the rules as data, its whole list is written once it fits the rules, its `onDone` calls the `onDone` you hand, and on a phone it gets `head` as its `actions` only when `closeButton` is true ([the components map](../contract.md#the-components-map)).
|
|
149
|
+
- `useSortEditor` — the sort editor's state for a sheet's holder (`SortEditorOptions`: `sorts`, `form`, `open`, `onDone`, `addSort`): `{ body, head, title, escapeBack }`. `body(closeButton)` draws it, on a phone with its own ✕ and ✓ when `closeButton` is true (no head of your sheet draws them: your provider's `sheetActions` is `bar`, or a host of yours holds it); `head` is the ✕ (named `views.panels.close`) and ✓ (`views.panels.sort-done`) for your sheet's head, as its `actions`. ✕ takes the rules back, in one change, to what they were when `open` last turned true. Handed a `SortBody` in your components map, `SortEditor` and `useSortEditor`'s `body` open it in place of their own rows, in every holder: it is handed the rules as data, its whole list is written once it fits the rules, its `onDone` calls the `onDone` you hand, and on a phone it gets `head` as its `actions` only when `closeButton` is true ([the components map](../contract.md#the-components-map)). On a phone it is also handed `onStepChange`: while it stands on a step of its own, `title` is the step's (your sheet's title in place of the sort's), `head` gains `back` (Back, for `close`'s place), and `escapeBack()` goes back a step and says it did, so your sheet's Escape calls it first and closes only when it returns false.
|
|
150
150
|
- `SortEditorOptions` — what `useSortEditor` takes.
|
|
151
|
-
- `ToolbarQuickFilters` — the quick filters' button (`data-slot="vk-toolbar-quick"`), named `views.panels.quick-filters` (or the config's `label`), lit (`changed`) while a value is held: takes `quickFilters` (a `QuickFiltersConfig`, [`/panels`](./panels.md#quick-filters)), and optionally `open` and `onOpenChange` (to hold its state yourself), `host
|
|
151
|
+
- `ToolbarQuickFilters` — the quick filters' button (`data-slot="vk-toolbar-quick"`), named `views.panels.quick-filters` (or the config's `label`), lit (`changed`) while a value is held: takes `quickFilters` (a `QuickFiltersConfig`, [`/panels`](./panels.md#quick-filters)), and optionally `open` and `onOpenChange` (to hold its state yourself), `host`, `icon` (its glyph; the `filterCategory` icon when absent) and `word` (`null`: its icon alone, its name its label to a screen reader, as `ReadyToolbar`'s default draws it on a computer). It opens `QuickFiltersPanel` in your `Popover` (`data-slot="vk-toolbar-quick-panel"`), in `host`, or on a phone in your `Sheet`, and is one of the toolbar's panels. With no field to offer it draws nothing.
|
|
152
152
|
- `QuickFiltersPanel` — the quick filters' panel alone, for a holder of your own: `quickFilters`, `form` (`"computer"` or `"phone"`), and optionally `onDone`, `closeButton` (its own ✕; false where your sheet's head draws one) and `fill` (it fills a host, its values scrolling). Handed a `QuickFiltersBody` in your components map, it opens that, handed the fields as the strip shows them (`quickFieldsShown`) with their values as they show (`quickValuesShown`, worded by the config's `heldLabels`) and writing its hold once `quickHoldFits` takes it ([the components map](../contract.md#the-components-map)). Without, it draws its own (`data-slot="vk-quick-filters"`): a header with the panel's name; a strip of the fields (`data-slot="vk-quick-filters-field"`, `aria-pressed` on the open one), then each other field holding a value, named by the config's `heldLabels` (it leaves the strip once its last value is let go, the focus moving to the field open in its place), the first holding a value open first; the open field's values as a list box (`data-slot="vk-quick-filters-value"`, `aria-selected` and `data-chosen` while held), with Show counts the most first and each count drawn and read with its value (`views.panels.quick-value`), a held value no value lists drawn from the hold, worded by the config's `heldLabels` else its key; a press holds a value, and a press on a held one lets it go (with `several`, each press adds or lets go one value); one Tab stop, ↑ ↓ Home End between the values, Enter or Space holding; past eight values a search (`views.panels.quick-search`, or the field's `searchPlaceholder`), ↓ from it reaching the first value and ↑ from the first going back, a search of its own for each field, and "Nothing matches." (`views.panels.quick-none`, `data-slot="vk-quick-filters-none"`) when it finds none; a field with nothing to hold says "Nothing to pick.". At `form: "phone"` (in a phone's Sheet) it carries `data-form="phone"`, its values take the phone sheet's taller rows, and with one value held at a time a press, by touch or by key, holds it and closes the Sheet through `onDone` (`quickPressCloses`); with `several` the Sheet stays open.
|
|
153
153
|
- `QuickFiltersReminder` — on a phone, the reminder that a hold stands while the quick filters are closed: takes `quickFilters` (the same `QuickFiltersConfig`), `onOpen` (a press on its names: open the quick filters, whose open state you hold through `ToolbarQuickFilters`' `open`, or `ReadyToolbar`'s `quickFiltersOpen`) and optionally `hidden` (it steps aside: hand whether rows are selected or the quick filters are open, so it never stands with your selection bar or over the open quick filters), and `holder` (a ref to your list's box: leaving with the focus in it, by its ✕ or by stepping aside as the quick filters open, it hands the focus there, giving a box that takes no focus `tabindex="-1"`, so the focus never falls to the page and a sheet opened from its names hands it back into the box; with none, the focus goes where the browser drops it; it never searches the page for one). Place it once at your list's foot. It is portalled to the body where the selection bar's phone pill stands (the provider's `selectionBar.phone`: its `bottom`, `zIndex` and `className`), a pill (`data-slot="vk-quick-filters-reminder"`) holding the held values' names, each by its words and never its key (`quickHeldNames`), the first two and "+N" for the rest (`quickReminderWords`, `views.panels.quick-more`), a press on them (`data-slot="vk-quick-filters-reminder-open"`, named `views.panels.quick-reminder` with every name once) calling `onOpen`; then ✕ (`data-slot="vk-quick-filters-reminder-clear"`, `views.panels.quick-clear`), letting every hold go. It draws nothing on a computer, while nothing is held, or while `hidden`. An app that wears its own reminder places that one instead, fed by `quickHeldNames`.
|
|
154
154
|
- `SortFieldList` — the fields a rule is picked from (`data-slot="vk-sort-fields"`): `sorts`, `onPick`, and optionally `own` (a rule whose field it changes, ticked), `onDone` (done with no pick) and `form`. A field already sorted, but `own`, is greyed and says "Sorted"; a search past eight. Handed a `FieldsBody` in your components map, it opens that in place of its rows, in every holder, handed the options as data, each marked as the grid's header marks its column, a sorted one `disabled` with why; a pick of a key it didn't offer, or offered disabled, writes nothing ([the components map](../contract.md#the-components-map)).
|
|
155
155
|
- `ToolbarAdvancedFilters` — the advanced filters' pills, with and/or groups (`data-slot="vk-toolbar-advanced-filter"`): takes the builder's `filterTree`, and optionally `host`. One pill for each advanced filter (each group at the filter's top, or the whole of a top joined by Or), "Advanced filter" with its rules counted (one whose rules are all set aside drawn set aside instead, the button's `aside` with no count, naming why in your `Tooltip`: `views.panels.advanced-filter-set-aside`), its words kept however tight the row, opening the filter editor on its own rules in your `Popover` (`data-slot="vk-toolbar-advanced-filter-panel"`) or in `host`. A pill whose filter empties leaves the row; the others keep their own state. Each is one of the toolbar's panels; in a folding line its place carries `data-open` while it is open, so the line holds still. On a phone it draws nothing.
|
|
156
|
-
- `ToolbarFilters` — each filter on a filter bar, as the kit's draws them (`data-slot="vk-toolbar-filters"`): takes the builder's `filterTree` (with `filterGroups`), and optionally `open` and `onOpenChange` (whether Filter and + list the fields: hold it to open them from ⋯), `held` and `onHeldChange` (the rule held until whole: hold it to count it as the bar folds) and `host`. Every filter at the view's own level, in its order: a filter as four joined parts (`data-slot="vk-toolbar-filter-rule"`, named by its sentence), its field, how it compares in lower case, its value (capped at 240 and cut with "…", saying what it waits for until it is picked) and ⋯ (Convert to advanced filter, Delete filter), each opening its own list; a related record's field drawn as one ("Company › Industry"); an advanced filter as its pill (`ToolbarAdvancedFilters`'); then + (`data-slot="vk-toolbar-filter-add"`, `views.panels.filter-add-one`). Filter, + and a filter's field open your `FieldsBody` where you hand one, its way and value your `FilterPartBody` ([the components map](../contract.md#the-components-map)). While nothing filters and nothing is held, Filter, an empty place (`data-slot="vk-toolbar-filter"`). Filter and + open the fields; a pick adds a filter at the end (`addOnBar`, wrapping a top joined by Or into one advanced filter first), a related record's field among them, waiting for its value, or, for a yes/no, the list's own or a related record's, holds it on the bar saying what it waits for, writing nothing until its value is picked; where nothing more can be added they are disabled with why (`barAddRefusal`). In a folding line its last filters fold into "+N filters" (`data-slot="vk-toolbar-more-filters"`, as its slot's `filtersFolded` says), which names each and opens what a pick opens under itself; a held rule, the filter it stands in place of and a filter with a part open never fold. Each filter and "+N filters"' menu is one of the toolbar's panels. Delete filter and Convert move the focus to what stands after the filter: the next filter, "+N filters", + or Filter. An app placing it in a `Toolbar` of its own places it with `filters: foldableFilters(…)` and never with `shed` while a filter stands: its parts read the slot's `iconAlone`, and would draw no words. A held rule is compared with the tree as written, so your `filterTree.onChange` must hand the tree back unchanged (the same keys in the same order), or the held rule counts as dropped by a write from elsewhere. On a phone it draws nothing.
|
|
156
|
+
- `ToolbarFilters` — each filter on a filter bar, as the kit's draws them (`data-slot="vk-toolbar-filters"`): takes the builder's `filterTree` (with `filterGroups`), and optionally `open` and `onOpenChange` (whether Filter and + list the fields: hold it to open them from ⋯), `held` and `onHeldChange` (the rule held until whole: hold it to count it as the bar folds) and `host`. Every filter at the view's own level, in its order: a filter as four joined parts (`data-slot="vk-toolbar-filter-rule"`, named by its sentence), its field, how it compares in lower case, its value (capped at 240 and cut with "…", saying what it waits for until it is picked) and ⋯ (Convert to advanced filter, Delete filter), each opening its own list; a related record's field drawn as one ("Company › Industry"); an advanced filter as its pill (`ToolbarAdvancedFilters`'); then + (`data-slot="vk-toolbar-filter-add"`, `views.panels.filter-add-one`). Filter, + and a filter's field open your `FieldsBody` where you hand one, its way and value your `FilterPartBody` ([the components map](../contract.md#the-components-map)); their lists show a column the list can't filter greyed with its reason, in its place, never picked (`filterTree.listed`). A filter whose one value is a key your app hasn't named (a person after a reload) asks that field's `onValuesWanted` once (a related record's field, `farValues.onWanted`), and draws the name once you hand the value in `knownValues` and its name in `knownLabels`. While nothing filters and nothing is held, Filter, an empty place (`data-slot="vk-toolbar-filter"`); handed `emptyPlace={false}`, where Filter stands on the row (`ToolbarFilterAdd`), nothing at all until a filter is set or held. Filter and + open the fields; a pick adds a filter at the end (`addOnBar`, wrapping a top joined by Or into one advanced filter first), a related record's field among them, waiting for its value, or, for a yes/no, the list's own or a related record's, holds it on the bar saying what it waits for, writing nothing until its value is picked; where nothing more can be added they are disabled with why (`barAddRefusal`). In a folding line its last filters fold into "+N filters" (`data-slot="vk-toolbar-more-filters"`, as its slot's `filtersFolded` says), which names each and opens what a pick opens under itself; a held rule, the filter it stands in place of and a filter with a part open never fold. Each filter and "+N filters"' menu is one of the toolbar's panels. Delete filter and Convert move the focus to what stands after the filter: the next filter, "+N filters", + or Filter, or, where Filter stands on the row's right and nothing is left on the bar, that Filter (`ToolbarFilterAdd`). An app placing it in a `Toolbar` of its own places it with `filters: foldableFilters(…)` and never with `shed` while a filter stands: its parts read the slot's `iconAlone`, and would draw no words. A held rule is compared with the tree as written, so your `filterTree.onChange` must hand the tree back unchanged (the same keys in the same order), or the held rule counts as dropped by a write from elsewhere. On a phone it draws nothing.
|
|
157
157
|
- `foldableFilters` — how many of the bar's filters may fold, for its placement's `filters`: `(tree, held)`, the tree's top-level items less the one a held rule stands in place of; a held rule no longer standing (`held`'s tree changed by a write from elsewhere) counts as gone.
|
|
158
|
+
- `ToolbarFilterAdd` — Filter on a toolbar row's right (`data-slot="vk-toolbar-filter-add-row"`, named `views.panels.filter`), as `ReadyToolbar` stands it by default: takes the builder's `filterTree`, and optionally `onHeldChange` (hand the toolbar's held rule's writer, the one you hand `ToolbarFilters`, so a yes/no it holds stands on the bar), `open` and `onOpenChange`, and `host`. It opens the fields as Filter on the bar does (your `FieldsBody` where you hand one), and a pick adds a filter at the bar's end and opens nothing else, or holds a yes/no until its value is picked, which `ToolbarFilters` takes in as its own; where nothing more can be added it is disabled with why. It is one of the toolbar's panels. On a phone, or with no fields, it draws nothing.
|
|
158
159
|
- `Pending` — the rule held until whole, as `ToolbarFilters` hands it to `onHeldChange`: its `container`, its `node`, the filter it `replaces`, and what it was held `over`.
|
|
159
160
|
- `FilterEditor` — the filter editor on a computer (`data-slot="vk-filter-editor"`): `filterTree`, `at` (the advanced filter's path: a group's, or `[]` for a top joined by Or), and optionally `onDone` (its filter emptied, Clear all filters) and `onRemoved` (a delete took a node away: the outermost that went). Each rule (`data-slot="vk-filter-rule"`) is Where or its level's join, its field, how it compares and its value, each a box of your `Button` opening its list, then ⋮ (Convert to group where it stays within 3 levels, Delete condition); the second rule's join is a button turning every join at its level. A group (`data-slot="vk-filter-group"`) stands on its own ground with its level, Add filter, Delete group and ⋮ (Exclude matches, on a group joined by And; an excluded group is headed "Not all of these" and its join reads And). A relation rule (`data-slot="vk-filter-relation"`) is a block, its relation and Any, None or Every where, its rules on the far fields inside. Add filter opens the fields; a pick adds a rule and opens its value; a far field makes a relation block, written the same way and waiting for its far value; a yes/no, the list's own or a far one, is held in the editor until its value is picked. Each value opens its type's own body with its operator left out (`FilterValueBody`); its box says the value alone, as the bar's value part does, or, until it is whole, what it waits for by its type ("Type a value", "Type a number", "Choose a date", "Choose"). The first edit in a top joined by Or wraps it into one advanced filter. At a top-level relation rule (`at` `[i]`) it edits the relation wrapped in a group of its own; where that would pass 3 levels, it edits the relation in place: its relation and Any, None or Every where head the editor, and its rules and Add filter name the relation's far fields. Every change goes out through `filterTree.onChange` as it is made. Handed a `FilterBody` in your components map, `FilterEditor`, `PhoneFilterEditor` and `usePhoneFilterEditor`'s `body` open it in place of their own rows, in every holder: it is handed the level they stand on as data, its whole level is written once it fits the rules, its `onDone` calls the `onDone` you hand, and on a phone it gets `head` as its `actions` only when `closeButton` is true ([the components map](../contract.md#the-components-map)). Handed a `FilterPartBody` in your components map, a rule's way and value open it in place of its ways menu and value body, never inside a `FilterBody`'s `ruleValue`; its field lists open your `FieldsBody` where you hand one.
|
|
160
161
|
- `usePhoneFilterEditor` — the filter editor on a phone, for a sheet's holder (`filterTree`, `open`, `onDone`): `{ body, head }`, as `useSortEditor`'s. `body(closeButton)` draws it on every rule of the view, with its own ✕ and ✓ when `closeButton` is true; `head` is the ✕ (`views.panels.close`) and ✓ (`views.panels.filter-done`) for your sheet's head. Each rule is Where or its join over its boxes, then ⋯ (Convert to group, Delete condition); a group stands on its own ground with Add filter, Delete group and ⋯ (Exclude matches). Each box's list (the field, how it compares, the value), a relation's Any, None or Every and Add filter's fields turn the body behind a back row, never a sheet on top. With no rule it reads `views.panels.filter-empty` and `views.panels.filter-empty-line`, with Add filter; Clear all (`views.panels.filter-clear-all`) empties it and keeps it open. It edits the whole tree in place (`editWhole`). ✕ takes the tree back, in one change, to what it was when `open` last turned true, and drops any write that lands after it (a box writing what was typed as the sheet closes) until `open` turns true again, so close the sheet on its `onDone`; ✓, and your sheet's swipe, dim and Escape, keep it, a value typed just before included. A held rule (a yes/no, the list's own or a relation block's) written from its value page is followed there when your `filterTree.onChange` reaches the tree in the same event, as `useListSettingsState` does; written a render later, the page turns back to the rules.
|
|
@@ -167,6 +168,6 @@ Options, Sort and Filter each open their panel from their own button, and each t
|
|
|
167
168
|
- `ToolbarPanelState` — what `useToolbarPanelState` returns.
|
|
168
169
|
- `FilterPanelContent` — the Filter panel standing alone, for a host of your own: the filter list at its root (titled `views.panels.filter`, no back arrow) and the pages it opens, with `filters`, `timeScopeConfig`, `dateRangeConfigs`, `page`, `onPageChange`, `onClose` and `fill`.
|
|
169
170
|
- `ToolbarSave` — Clear and Save, at the end of a filter bar while the list differs (`data-slot="vk-toolbar-save"`): takes `view` (a `CollectionViewState`: Clear is its `onReset`, Save its `onPublish`, shown only where `canPublish`, both waiting while `pending`, nothing while `changes` is 0), or with no shared view `onClear`, Clear alone taking the list back to its default; nothing when neither has anything to do. Clear has no ground and Save wears the field's look, ViewKit's own buttons or your `Button` with `panelButtons` at `button`.
|
|
170
|
-
- `ReadyToolbar` — the toolbar for an app that doesn't arrange its own (`ReadyToolbarProps`): the builder's input (`settings`, `layer`, `columns`, `onChange`, `onLayerChange` and the rest of `SettingsPanelsInput`), and optionally `views`, `viewsLayout`, `onAdd` or `addItems` and `addLabel`, `view`, `toggles`, `fieldEditor`, `searchPlaceholder`, `searching` (handed to its search), `hosts` (`{ options, sort, filter, quick }`), `quickFilters` (a `QuickFiltersConfig`: handed, the quick filters' button stands on the row's end before the search, in the row arrangement before Options, folding into ⋯ as the row narrows; its counts follow the toolbar's Show counts unless the config carries its own `showCounts`), `quickFiltersOpen` with `onQuickFiltersOpenChange` (the quick filters' panel open, held by you, so a `QuickFiltersReminder` at your list's foot can open it; absent, the toolbar holds it), `phone`, `narrow`, `severalSorts` (true by default: the sort holds up to 3 rules
|
|
171
|
+
- `ReadyToolbar` — the toolbar for an app that doesn't arrange its own (`ReadyToolbarProps`): the builder's input (`settings`, `layer`, `columns`, `onChange`, `onLayerChange` and the rest of `SettingsPanelsInput`), and optionally `views`, `viewsLayout`, `onAdd` or `addItems` and `addLabel`, `view`, `toggles`, `fieldEditor`, `searchPlaceholder`, `searching` (handed to its search), `hosts` (`{ options, sort, filter, quick }`), `quickFilters` (a `QuickFiltersConfig`: handed, the quick filters' button stands on the row's end before the search, in the row arrangement before Options, folding into ⋯ as the row narrows; its counts follow the toolbar's Show counts unless the config carries its own `showCounts`), `quickFiltersOpen` with `onQuickFiltersOpenChange` (the quick filters' panel open, held by you, so a `QuickFiltersReminder` at your list's foot can open it; absent, the toolbar holds it), `phone`, `narrow`, `severalSorts` (true by default: the sort holds up to 3 rules, the row's Sort opening the sort editor on them, or in the old form the sort pill on the bar; `false` keeps Sort's one rule, which opens its own list whether or not a sort stands), `addAfter` (true by default: the + after the sort pill; `false` draws none, and the pill's editor, or your `SortBody`, has Add sort at its foot, as `ToolbarSortPill`'s), `filterGroups` (true by default: and/or groups, each filter on the filter bar on a computer, in the row arrangement each advanced filter's pill after Filter and Convert to advanced filter on a filter's page, and on a phone Filter opening the filter editor on every rule; `false` keeps Filter, counting what is applied, in either arrangement), `arrangement` (`"kit"` by default, or `"row"`), `sortFilter` (`"right"` by default, or `"bar"`), `bar` (`"added"` by default, or `"always"`: with Sort and Filter on the row's right, the bar then always shows, its empty Sort and Filter included), `viewName`, `onRenameView`, `onCopyLink`, `onExport` and `exportCount` (handed on to Customize, as `ToolbarOptions` takes them) 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 holds its panels' state above its frame, so a change of form keeps a panel open on its page, in a sheet once the form is the phone's. Show counts is the view's: read from `settings.showCounts` for the views row and the quick filters, absent meaning on, it joins Customize's toggles where the views carry counts and is written back through `onChange`. Group steps aside on a board (`groupShown`).
|
|
171
172
|
- `ReadyToolbarProps` — what `ReadyToolbar` takes.
|
|
172
173
|
- `useListSettingsState` — a list's settings and layer held in memory, for an app that keeps none yet (a proof page, a test): `{ settings, layer? }` in, `{ settings, layer, onChange, onLayerChange }` out, ready to spread into `ReadyToolbar` beside its `columns`. Each change is applied to the latest settings (`applySettingsChange`), each patch merged into the latest layer.
|
|
@@ -9,7 +9,7 @@ Import from `viewkitjs/views/panels` for what a list's panels read and say: the
|
|
|
9
9
|
- `GroupConfig` — a list's group: its `dimensions`, the `value` (or `"none"`), each dimension's `order` and `granularity`, `onChange`, `hideEmpty` and, while grouped, the `groups` to show, hide and drag.
|
|
10
10
|
- `GroupDimension` — one field a list groups by: its `orderOptions`, `defaultOrder`, and a date's `granularities` and `defaultGranularity`.
|
|
11
11
|
- `GroupOrderOption` — one way a dimension's groups are ordered, with the `defaultDir` it opens in.
|
|
12
|
-
- `GroupListEntry` — one group as the Group panel lists it: its `key`, `label`,
|
|
12
|
+
- `GroupListEntry` — one group as the Group panel lists it: its `key`, `label`, whether it is `empty` or `hidden`, and its `count` where the list counts it.
|
|
13
13
|
- `groupOrderFor` — the order a dimension opens in under a mode: that choice's own direction, else the mode's.
|
|
14
14
|
- `ToggleConfig` — a boolean the panel flips in place: `key`, `label`, `value`, `onChange`, an `icon`, `desktopOnly`, a `reset` back to the reader's default, and the `section` it sits under.
|
|
15
15
|
- `LayoutConfig` — the layouts a list can draw and the active one, with the layouts it refuses and why, its toggles, columns, per-view choices, density, the reader's own section (`personal`) and the phone's own layout.
|
|
@@ -47,6 +47,7 @@ Import from `viewkitjs/views/panels` for what a list's panels read and say: the
|
|
|
47
47
|
## Every row's words
|
|
48
48
|
|
|
49
49
|
- `filterValueLabel` — a filter row's value: the conventions it reads ranges and dates with, then your resolver.
|
|
50
|
+
- `drawsUnnamedValue` — whether `filterValueLabel` draws a filter's value by its stored key: a choice whose one picked value its options don't name. A filter on the bar that does asks the field's `onOpen` once (your `onValuesWanted`), so the name you hand back replaces the id.
|
|
50
51
|
- `relationSentence` — what a relation's filter keeps, in one sentence: "Clients with at least one campaign where status is Active."
|
|
51
52
|
- `dateRangeValueLabel` — a date range's value: "All time", "Jan 1 — Jan 9", "From …", "Until …". Its days are written in the conventions' locale, its optional third argument.
|
|
52
53
|
- `timeScopeRowValueLabel` — a time range's value, a custom range's ends or its label; the ends in the conventions' locale, its optional third argument.
|
|
@@ -66,8 +67,8 @@ Import from `viewkitjs/views/panels` for what a list's panels read and say: the
|
|
|
66
67
|
|
|
67
68
|
What a list hands the views row ([`viewkitjs/views/panels/react`](panels-react.md) draws it).
|
|
68
69
|
|
|
69
|
-
- `ViewTabOption` — one view: its `value`, `label`, `count`, a status `slot` or your own `activeClassName`, its `icon` by your own glyph's name, whether it is `private`, and its verbs as `menu` (the package's menu rows, reached from the active view only).
|
|
70
|
-
- `CollectionViewsConfig` — one axis of views: its `value`, `options`, `onChange`, `hideCounts`, `onCreate` and its `createLabel`, `onReorder` (one block in its new order, folded views included) and `canDrag
|
|
70
|
+
- `ViewTabOption` — one view: its `value`, `label`, `count`, a status `slot` or your own `activeClassName`, its `icon` by your own glyph's name, whether it is `private`, and its verbs as `menu` (the package's menu rows, reached from the active view only); and, for a view's whole menu, its `layout` (by the axis's `verbs.layouts`), `changed` (it holds unsaved changes) and `favorite`.
|
|
71
|
+
- `CollectionViewsConfig` — one axis of views: its `value`, `options`, `onChange`, `hideCounts`, `onCreate` and its `createLabel`, `onReorder` (one block in its new order, folded views included) and `canDrag`; and `verbs` (`ViewsViewVerbs`: `layouts`, `records`, a board's `columns` and one `onChange` taking every `ViewsViewChange` a view's menu makes), handed where your app lets a views list that can draw a view's whole menu (`CONTROLS.ViewsListBody`) draw it.
|
|
71
72
|
- `CollectionViewsInput` — one axis, or an array of peer axes.
|
|
72
73
|
- `ViewsLayout` — how peer axes lay out: `stacked` (each after the first on a row of its own) or `inline`.
|
|
73
74
|
- `CollectionChildAxis` — a child axis whose options depend on the primary selection, as data, for a phone's sheet.
|
|
@@ -109,7 +110,7 @@ A quick filter holds values on top of the view: fields' `ListHold` (`viewkitjs/f
|
|
|
109
110
|
|
|
110
111
|
- `QuickFiltersConfig` — what the quick filters take: `fields`, `hold`, `onHoldChange` (the whole new hold), and optionally `label` (the button's and the panel's name; `views.panels.quick-filters` when absent), `several` (several held at once; false by default, one in all), `showCounts` (the toolbar's Show counts; true by default) and `heldLabels` (the words of what the hold holds that the fields don't list, by field key, each a `QuickHeldLabels`: keep them with your hold, so a deleted record shows by its name, not its id).
|
|
111
112
|
- `QuickHeldLabels` — a held field's words: optionally `label` (the field's, used where the strip doesn't offer it; absent, its key) and `values` (each held value's by its key; a value the field lists keeps its own words, and one this lacks shows by its key).
|
|
112
|
-
- `QuickFilterField` — a field offered: `key` (as the hold names it), `label`, `values` (in its own order) and optionally `counts` (each value's count by its key, as `countHoldValues` answers; a value it lacks counts 0; absent, no counts) and `
|
|
113
|
+
- `QuickFilterField` — a field offered: `key` (as the hold names it), `label`, `values` (in its own order) and optionally `counts` (each value's count by its key, as `countHoldValues` answers; a value it lacks counts 0; absent, no counts), `searchPlaceholder` and `options` (a choice field's every option as `ViewsPickerItem`s, where the app holds them: a value draws its option's mark, a status's step or a face).
|
|
113
114
|
- `QuickFilterValue` — a value offered: `value` (its key as the hold keeps it: an option, an id, `"true"` or `"false"`, `""` for none) and `label`.
|
|
114
115
|
- `QuickShownValue` — a value as the panel shows it: `value`, `label`, `count` where counts show, and `held`.
|
|
115
116
|
- `QUICK_SEARCH_AFTER` — 8: a field's values past this many show a search.
|
|
@@ -160,10 +161,11 @@ Every panel's config from one value: a list's `ListSettings` (`viewkitjs/fields/
|
|
|
160
161
|
With `filterGroups`, a list's filter is a tree of and/or groups the filter editor changes, to the 3 levels and 50 items a group the settings allow. `settingsPanels` hands `filterTree`; a Filter row whose rule stands at the top, narrows something and can be wrapped within 3 levels carries `convert`, which turns it into an advanced filter of its own, in its place. A top joined by Or that shows a rule is one advanced filter: the Filter rows show none of its rules, and a filter added from them first wraps the Or level into an advanced filter under an And top (refused, every row disabled with `views.panels.filter-or-full`, when that would pass 3 levels). An Or that shows no rule reads and writes as And. With groups, Options' count counts each advanced filter, and its Clear (`settingsCleared(…, "options")`) empties every rule and group, keeping the top's set-aside rules; Filter's ✕ (`"filters"`) clears its rows alone on a computer; on a phone, where Filter opens the filter editor on every rule, it empties the advanced filters too.
|
|
161
162
|
|
|
162
163
|
- `settingsFilterTree` — the builder's filter tree (`FilterTreeConfig`), what the filter editor reads, written through the build's shared writer.
|
|
163
|
-
- `FilterTreeConfig` — `tree`, `fields` (`FilterEditorField`s), `onChange(tree)` (the whole tree, as each change is made), `valueOf(rule, write, relation?)` (the rule's value as the Filter panel's own body for its field edits it, its way kept: a choice's and a place's country's Is none of stay; a yes/no is one pick of two that can't be unticked; null for a set-aside rule or a way that takes no value), `label` and `gone` (the builder's `goneFields`).
|
|
164
|
+
- `FilterTreeConfig` — `tree`, `fields` (`FilterEditorField`s, the ones a rule may name), `listed` (what a field list shows: `fields` and, in their places in the column order, each column the list can't filter, its `disabled` saying why), `onChange(tree)` (the whole tree, as each change is made), `valueOf(rule, write, relation?)` (the rule's value as the Filter panel's own body for its field edits it, its way kept: a choice's and a place's country's Is none of stay; a yes/no is one pick of two that can't be unticked; null for a set-aside rule or a way that takes no value), `label` and `gone` (the builder's `goneFields`).
|
|
164
165
|
- `FilterGoneField` — a field the list no longer shows: `fieldKey`, `label` and its `options`' labels (`{ value, label }`), and, for a related list's field, `relation`, the relation's field key (the relation rule's `fieldKey`). A set-aside filter on it reads them, on the bar, in its sentence and in the filter editor's set-aside row (`asideFilterWords`): "Client status is any of Active", a value no option lists as it is stored. One with a `relation` names only a rule inside that relation's where, and one without names only the list's own, so a far field never takes the name of a list field with the same key. Nothing is stored in the rule.
|
|
165
|
-
- `FilterEditorField` — a field a rule names: `key` (the Filter row's), `label`, `fieldKey`, `part`, `type`, and for a relation `far`, its usable far fields one level in.
|
|
166
|
-
- `filterEditorFields` — the fields a rule can name: the Filter panel's own rows that open, in the person's column order, a place's kept parts among them, then each relation the list filters across with its far fields.
|
|
166
|
+
- `FilterEditorField` — a field a rule names: `key` (the Filter row's), `label`, `fieldKey`, `part`, `type`, and for a relation `far`, its usable far fields one level in; in `listed` only, `disabled` on a column the list can't filter, why in your words (your capability's reason, a column with no field's `views.panels.filter-fieldless`, else `views.panels.filter-not-offered`).
|
|
167
|
+
- `filterEditorFields` — the fields a rule can name: the Filter panel's own rows that open, in the person's column order, a place's kept parts among them, then each relation the list filters across with its far fields. Its words for a place's parts are `filterData.messages`, else your resolver.
|
|
168
|
+
- `listedFieldsOf` — what a field list shows: `filterTree.listed`, else its `fields`. Every field list ViewKit draws reads it: a greyed field is drawn greyed with its reason and never picked.
|
|
167
169
|
- `newRuleFor` — a new rule on a field, narrowing nothing until its value is picked: Contains with nothing typed for text, Is with no day for a date, else its type's first way with an empty value.
|
|
168
170
|
- `newRelationRuleFor` — a new relation rule, Any where the far field's new rule holds.
|
|
169
171
|
- `heldUntilWhole` — whether a new rule on a field is held in the editor until it is whole: a yes/no's, whose rule with no value the settings refuse.
|
|
@@ -7,7 +7,7 @@ Import from `viewkitjs/views/react` in a client component: the door opens with t
|
|
|
7
7
|
Guide: [the provider](../guides/the-provider.md).
|
|
8
8
|
|
|
9
9
|
- `ViewsProvider` — the provider every view reads: mount it once at your app's client root, above every view, with its components, icons, ports and conventions. It lays your atoms over the defaults, hands your `Menu` its items with every row under a disabled group already disabled, and fills in the browser's own confirm where your ports carry no `confirm`. It hands its views one context value per distinct set of inputs, so pass module-level objects: a new one on each render re-renders every view.
|
|
10
|
-
- `ViewsProviderProps` — what the provider takes. Its optional `desktopQuery` is the media query that means a desktop, so an editor opens as a popover there and as a sheet elsewhere, the default controls take their phone form below it (`PhoneLine`), as do the toolbar's panels and the views picker outside a `Toolbar`, and the grid's own chrome takes its desktop form there (the grid's frame carries `data-desktop`); hand in the one your own shell switches on. Default `DEFAULT_DESKTOP_QUERY`. Its optional `sheetActions` (`ViewsSheetActionsPlace`, default `bar`) says where an editor's ✕ and ✓, and a toolbar panel's ✕, stand in that sheet. Its optional `escape` (`ViewsEscapeRules`) says what Escape does in an editor of each field type on a desktop, `"keep"` or `"cancel"`, a type left out cancelling. Its optional `sayRefusals` (default false) has the grid say, through the toast port's `error`, why your app refused an edit it sent. Its optional `menus` (`ViewsMenuRoute`, default `popover`) says how the grid opens its own menus: in your `Popover` with ViewKit's rows, or through your `Menu`. Its optional `gridButtons` (`ViewsGridButtons`, default `own`) says who draws the buttons the grid draws itself: ViewKit, or your `Button`. Its optional `gridCheckboxes` (`ViewsGridCheckboxes`, default `own`) says who draws a yes/no cell's box in the grid: ViewKit's tick box, or your `Checkbox`. Its optional `fieldRowButtons` (`ViewsFieldRowButtons`, default `own`) and `fieldRowCheckboxes` (`ViewsFieldRowCheckboxes`, default `own`) say the same for a field row's own buttons and its yes/no. Its optional `panelButtons` (`ViewsPanelButtons`, default `own`) says who draws the buttons the toolbar's panels, the search's ✕ and the views row draw themselves: ViewKit, or your `Button`. Its optional `selectionBar` (`ViewsSelectionBarSettings`) says where the selection bar sits. Its optional `oneValue` (`ViewsOneValueEditors`) says whether a single email or domain opens the text box in its cell (the default) or the value list holding one value, in the grid and a field row alike. Its optional `bodyFrame` (`ViewsBodyFrame`, default `views`) says who sets the width and padding of the popover around a whole body your app hands: ViewKit, or, at `popover`, your `Popover`, the popover marked `data-vk-body`. Its optional `gridBodyPlace` (`ViewsGridBodyPlace`, default `under`) says whether a grid editor opens the popover around a body your app hands under the cell or over it. Its optional `datePicks` (`ViewsDatePicks`) names the quick days the date editors offer, in order; absent, today, tomorrow and next Monday.
|
|
10
|
+
- `ViewsProviderProps` — what the provider takes. Its optional `desktopQuery` is the media query that means a desktop, so an editor opens as a popover there and as a sheet elsewhere, the default controls take their phone form below it (`PhoneLine`), as do the toolbar's panels and the views picker outside a `Toolbar`, and the grid's own chrome takes its desktop form there (the grid's frame carries `data-desktop`); hand in the one your own shell switches on. Default `DEFAULT_DESKTOP_QUERY`. Its optional `sheetActions` (`ViewsSheetActionsPlace`, default `bar`) says where an editor's ✕ and ✓, and a toolbar panel's ✕, stand in that sheet. Its optional `escape` (`ViewsEscapeRules`) says what Escape does in an editor of each field type on a desktop, `"keep"` or `"cancel"`, a type left out cancelling. Its optional `sayRefusals` (default false) has the grid say, through the toast port's `error`, why your app refused an edit it sent. Its optional `menus` (`ViewsMenuRoute`, default `popover`) says how the grid opens its own menus: in your `Popover` with ViewKit's rows, or through your `Menu`. Its optional `gridButtons` (`ViewsGridButtons`, default `own`) says who draws the buttons the grid draws itself: ViewKit, or your `Button`. Its optional `gridCheckboxes` (`ViewsGridCheckboxes`, default `own`) says who draws a yes/no cell's box in the grid: ViewKit's tick box, or your `Checkbox`. Its optional `fieldRowButtons` (`ViewsFieldRowButtons`, default `own`) and `fieldRowCheckboxes` (`ViewsFieldRowCheckboxes`, default `own`) say the same for a field row's own buttons and its yes/no. Its optional `panelButtons` (`ViewsPanelButtons`, default `own`) says who draws the buttons the toolbar's panels, the search's ✕ and the views row draw themselves: ViewKit, or your `Button`. Its optional `selectionBar` (`ViewsSelectionBarSettings`) says where the selection bar sits. Its optional `oneValue` (`ViewsOneValueEditors`) says whether a single email or domain opens the text box in its cell (the default) or the value list holding one value, in the grid and a field row alike. Its optional `bodyFrame` (`ViewsBodyFrame`, default `views`) says who sets the width and padding of the popover around a whole body your app hands: ViewKit, or, at `popover`, your `Popover`, the popover marked `data-vk-body`. Its optional `gridBodyPlace` (`ViewsGridBodyPlace`, default `under`) says whether a grid editor opens the popover around a body your app hands under the cell or over it. Its optional `datePicks` (`ViewsDatePicks`) names the quick days the date editors offer, in order; absent, today, tomorrow and next Monday. Its optional `now` (a `Date`) is the moment every date counts from; absent, the provider reads the clock after mount, then once a minute and when the tab comes back into view, never while rendering, and a date that needs it draws its full form until the first read.
|
|
11
11
|
- `EditEscape` — `"cancel" | "keep"`: what Escape does in an edit session (`viewkitjs/views/editors/session` hands it on too).
|
|
12
12
|
- `ViewsEscapeRules` — the provider's `escape`: an `EditEscape` per field type, and for `email`, `phone`, `url` and `domain` either one `EditEscape`, which covers both of their editors, or an `EditEscapeByEditor`.
|
|
13
13
|
- `EditEscapeByEditor` — `{ box?: EditEscape; list?: EditEscape }`: what Escape does in an email, phone, link or domain field by the editor it opens, `box` its text box (a single value) and `list` the value list (several values, or a single one `oneValue` opens as a list of one). One left out throws the edit away.
|
|
@@ -18,8 +18,9 @@ Guide: [the provider](../guides/the-provider.md).
|
|
|
18
18
|
- Required: `components` (your primitives, `ViewsComponents`), `icons` (your glyphs by meaning, `ViewsIcons`), `ports` (your runtime services, `ViewsPorts`), `conventions` (the `FieldConventions` of `viewkitjs/fields` every value is read with) and `children`.
|
|
19
19
|
- Optional: `atoms`, any of your own atoms, each laid over the default of its name; `messages`, your wording for the package's own messages, defaulting to `resolveViewsMessage` (the package's English); `presentation`, `(defaults: FieldPresentation) => FieldPresentation`, how your numbers, dates and durations read: given the package's defaults in the conventions' locale, return yours. It is called where a value is drawn, so your provider imports none of the display.
|
|
20
20
|
- `useViews` — reads the nearest provider's value inside a view or an atom of your own. It throws an error that says where to mount one when no `ViewsProvider` is above it.
|
|
21
|
-
- `ViewsContextValue` — what `useViews` returns: the `components` (your `Menu` wrapped to settle disabled groups), the merged `atoms`, the `icons`, the `ports` as `ViewsResolvedPorts` (`confirm` always a function), the `messages` resolver, the `conventions`, your `presentation` when you handed one, and the `desktopQuery` in force (yours or `DEFAULT_DESKTOP_QUERY`); `escape`, `oneValue` and `sayRefusals` when you handed them; and `menus`, how the grid opens its own menus (absent means `popover`); `gridButtons`, who draws the grid's own buttons (absent means `own`); `gridCheckboxes`, who draws a yes/no cell's box (absent means `own`); `fieldRowButtons` and `fieldRowCheckboxes`, the same for a field row (absent means `own`); `panelButtons`, who draws the panels' own buttons (absent means `own`); `selectionBar` and `datePicks` when you handed them.
|
|
22
|
-
- `NOOP_PORTS` — ports that do nothing, for a server render, a test or an app without a device: the toasts and haptics are empty, the clipboard writes nothing (resolving `false`) and reads `null`, and the prefs store keeps nothing. It carries no `confirm`, so the provider falls back to the browser's.
|
|
21
|
+
- `ViewsContextValue` — what `useViews` returns: the `components` (your `Menu` wrapped to settle disabled groups), the merged `atoms`, the `icons`, the `ports` as `ViewsResolvedPorts` (`confirm` always a function), the `messages` resolver, the `conventions`, your `presentation` when you handed one, and the `desktopQuery` in force (yours or `DEFAULT_DESKTOP_QUERY`); `escape`, `oneValue` and `sayRefusals` when you handed them; and `menus`, how the grid opens its own menus (absent means `popover`); `gridButtons`, who draws the grid's own buttons (absent means `own`); `gridCheckboxes`, who draws a yes/no cell's box (absent means `own`); `fieldRowButtons` and `fieldRowCheckboxes`, the same for a field row (absent means `own`); `panelButtons`, who draws the panels' own buttons (absent means `own`); `selectionBar` and `datePicks` when you handed them. The provider's moment (`now`) isn't in it: what draws a date reads it, so a new moment redraws only those.
|
|
22
|
+
- `NOOP_PORTS` — ports that do nothing, for a server render, a test or an app without a device: the toasts and haptics are empty, the clipboard writes nothing (resolving `false`) and reads `null`, and the prefs store keeps nothing. It carries no `confirm`, so the provider falls back to `PortsHost`'s or the browser's.
|
|
23
|
+
- `NOOP_TOAST` — the toast that draws nothing, `NOOP_PORTS`' own: what `useViews().ports.toast` is where an app hands no toast and no `PortsHost` stands.
|
|
23
24
|
|
|
24
25
|
## The components map
|
|
25
26
|
|
|
@@ -32,12 +33,14 @@ The primitives your app hands in, modelled on Base UI's shapes: a controlled `op
|
|
|
32
33
|
- Focus: `initialFocus` false keeps focus where it was when the popup opens, for an editor that focuses its own input (with `preventScroll`). Default true.
|
|
33
34
|
- Vetoes: `onOutsidePress` is handed the pointer press, its `target` where it landed, and returns `false` to keep the popup open, also against the focus that press moves; focus leaving by keyboard closes without asking. `onEscape` does the same for Escape.
|
|
34
35
|
- Look: `chrome` is `panel` (your card popover, the default) or `menu` (your menu panel's surface, for a popover that holds a list: no inset, no card width). `onPanelClick` takes a click inside the popup, `panelData` sets `data-*` attributes on it, and `style` carries what a class cannot say, such as a width that follows a cell.
|
|
36
|
+
- `ViewsPortsHostProps` — what the components map's `PortsHost` is told: `toast` and `confirm` (which ports the app left out) and `onReady` (hand it the ports once they stand).
|
|
37
|
+
- `ViewsSelectionBarProps` — what the components map's `SelectionBar` is handed: `SelectionBar`'s own props, at every count.
|
|
35
38
|
- `ViewsTooltipProps` — a tooltip around the element it wraps (`children`), showing `content`, with `side`, `align`, `delayMs` and a class. Your app mounts one tooltip provider above the views; a tooltip never mounts its own.
|
|
36
39
|
- `ViewsCheckboxProps` — a checkbox: `checked`, and `indeterminate` for a box ticked partly, whose press hands `true` while `checked` is false. `onCheckedChange` hands the new value and, where your library reports it, `{ event }`, the press that changed it (a list reads its shift key for a range). `partialTone` colours the partial mark, `muted` by default or `brand` for a select-all with a live selection; with `disabled`, `readOnly` (shown as it is and not pressable: a yes/no the grid or a field row can't write while the provider's `gridCheckboxes` or `fieldRowCheckboxes` is `checkbox`), a class, `tabIndex` and `aria-label`.
|
|
37
40
|
- `ViewsMenuProps` — a menu opened at an `anchor`, with no trigger child (a group opens beside it only where it asks to and your menu can), controlled by `open` and `onOpenChange`, drawing its `items`, placed by `side` and `align`, and named by `label`, its accessible name, which every menu the package opens hands. On Base UI it is the menu's root, positioner and popup, the anchor handed to the positioner.
|
|
38
41
|
- `ViewsMenuItem` — one row of a menu, as data your `Menu` draws: its `key`, `label` (always words), `icon`, `onSelect`, `disabled` with an optional `disabledReason` (why, for you to show), and `destructive`, a `separatorBefore`, a `shortcut` hint drawn at its end and never bound, and an `href` that makes it a link (with `onSelect` still firing). A `checked` row is checkable and closes the menu like any row, unless it carries `keepOpen`. A row with `children` is a group: its rows drawn in place under its label, unless it carries `beside` (open them one level in), its own `onSelect`, `href` and `checked` ignored; a disabled group's rows reach your `Menu` already `disabled`, with the group's reason where they give none. Any row may carry `detail`, its current value in words, for its end. All three are hints: a menu that draws none of them keeps every group in place and every row closing.
|
|
39
42
|
- `ViewsCommandParts` — the command list's parts, the shape cmdk-based copies already have: `Root` (taking `label`, `shouldFilter` false to hand filtering to the host, a scoring `filter`, `loop` to wrap the arrows, and `defaultValue`, the value of the item highlighted as the list opens, none while no item has it), `Input` (a controlled `value` with `onValueChange`, a `placeholder`, `autoFocus`, a `ref`, `onKeyDown`, and `chrome` `search` for your search row or `bare` for the input alone), `List`, `Empty`, `Group` (with a `heading`) and `Item` (a `value`, `onSelect`, `disabled`, and `chosen`, which you colour as your chosen row while the package's row inside draws the check).
|
|
40
|
-
- `ViewsPickerProps` — a whole pick list your app draws, its search, rows, empty row and create row: its `label` (the field's name), `items`, `multiple`, `value` (one value or `null`; several, a list), `onValueChange` (the pick, `null` for the empty row, or the whole new list on every change; nothing is saved until the editor closes), `onDone` (a pick of one is made), `empty` (the empty row's words; absent, a value of one can't be emptied), `search` (its words before anything is typed), `onCreate` (handed what was typed, returns the value it makes, which you then pick or add), `typed` (what was typed on what opened it: on a computer, light its first match, so Enter picks it), `autoFocus`, `keyed` (opened by a key: on a computer, light the held row as it opens and let ↓ go on from it to the next), `fromHeld` (opened by a press, before a row is lit: ↓ and ↑ go on from the held row, to the next or the one before, nothing drawn lit until then), `form`, `computer` or `phone` (on a phone, draw no ✕, ✓ or Cancel of your own and hand every change as it is made), and for a relation `onSearch` (the editor filters or fetches: hand it every typed query and draw `items` as handed), `doing` (`searching` or `failed`), `onRetry`, `onMore`, `actions` (`ViewsPickerAction` rows after the rows) and `lead` (which held value leads, `onLead`, `label` and `makeLabel`); and, where your app adds options to a select's or multiselect's list, `onAdd` (draw an add row after the matches and call it with the typed text; handed instead of `onCreate`), `adding` (the text being added: draw its row as waiting, not pressable) and `addRefused` (your app's refusal, or the failure's words, to show where the add row was). A body that draws none of them offers no add. A status field's `steps`: its active steps by value, in order, so a held archived option is placed nowhere, as its cell places it.
|
|
43
|
+
- `ViewsPickerProps` — a whole pick list your app draws, its search, rows, empty row and create row: its `label` (the field's name), `items`, `multiple`, `value` (one value or `null`; several, a list), `onValueChange` (the pick, `null` for the empty row, or the whole new list on every change; nothing is saved until the editor closes), `onDone` (a pick of one is made), `empty` (the empty row's words; absent, a value of one can't be emptied), `search` (its words before anything is typed), `onCreate` (handed what was typed, returns the value it makes, which you then pick or add), `typed` (what was typed on what opened it: on a computer, light its first match, so Enter picks it), `autoFocus`, `keyed` (opened by a key: on a computer, light the held row as it opens and let ↓ go on from it to the next), `fromHeld` (opened by a press, before a row is lit: ↓ and ↑ go on from the held row, to the next or the one before, nothing drawn lit until then), `form`, `computer` or `phone` (on a phone, draw no ✕, ✓ or Cancel of your own and hand every change as it is made), and for a relation `onSearch` (the editor filters or fetches: hand it every typed query and draw `items` as handed), `doing` (`searching` or `failed`; `searching` from the keystroke until the typed query answers, its `items` meanwhile the held records that match it alone), `onRetry`, `onMore`, `actions` (`ViewsPickerAction` rows after the rows) and `lead` (which held value leads, `onLead`, `label` and `makeLabel`); and, where your app adds options to a select's or multiselect's list, `onAdd` (draw an add row after the matches and call it with the typed text; handed instead of `onCreate`), `adding` (the text being added: draw its row as waiting, not pressable) and `addRefused` (your app's refusal, or the failure's words, to show where the add row was). A body that draws none of them offers no add. A status field's `steps`: its active steps by value, in order, so a held archived option is placed nowhere, as its cell places it.
|
|
41
44
|
- `ViewsPickerItem` — one row of a picker body, as data: its `value` and `label`, a status `slot` (draw your status badge) or a category `color` (draw your option chip), an `icon` (your glyph's name, as `AppIcon` draws it), a quieter `line`, the `group` it stands under, `disabled`, and for a relation's record a `badge` (a word telling kinds apart), a `glyph` (the record's own, unsized), an `avatarUrl` and its `kind`.
|
|
42
45
|
- `ViewsPickerAction` — a row of a picker body that does something rather than pick (create a record with what was typed): its `key`, `label`, an optional `icon`, and `onSelect`; picking it closes the editor, then runs it.
|
|
43
46
|
- `ViewsCalendarProps` — a calendar over ISO days (`YYYY-MM-DD`): its `value` and `onChange`, `min` and `max`, a `month` (`YYYY-MM`) controlled with `onMonthChange`, a `captionLayout` of `label` or `dropdown`, the `startMonth` and `endMonth` its pickers offer, and `locale`, the conventions' locale, in which it draws its month and weekday names and starts its week (an adapter may keep its calendar's own). Your date library stays your own.
|
|
@@ -53,20 +56,24 @@ The primitives your app hands in, modelled on Base UI's shapes: a controlled `op
|
|
|
53
56
|
- `ViewsLinkRole` — `{ value, label, archived? }`: a role a link may hold, as a links body offers it.
|
|
54
57
|
- `ViewsTextBodyProps` — a whole body for a field typed as one string your app draws: `label`, `kind` (`text`, `url`, `domain`, `email`, `phone` or `rich_text`), `paragraph`, `value` and `onValueChange` (the whole text, every change as it is made), `onDone` (closes as Enter does), `check` (a value's reason, or null), `region` (a phone's country), `typed`, `autoFocus` and `form` (`phone`: draw no ✕, ✓ or Cancel of your own), and, in the phone's sheet, `onStepChange` (a `ViewsBodyStep` while it stands on a step of its own, `null` once back). The editor keeps the draft, Tab, Escape, ⌘ or Ctrl Enter, the close's tidy, the write check, the save and the phone's ✕ and ✓.
|
|
55
58
|
- `ViewsNumberBodyProps` — a whole body for a number, money or a percent your app draws: `label`, `kind` (`number`, `money` or `percent`), `value` (a number, `null` empty, `NaN` unreadable) and `onValueChange` (the number and, when it is one of `units`, the unit; every change as it is made), `unit` and `units`, `onDone` (closes as Enter does), `check` (a value's reason, or null), `decimals`, `min`, `max`, `locale`, `decimal`, `empty`, `align`, `typed`, `autoFocus`, `form` (`phone`: draw no ✕, ✓ or Cancel of your own) and, in the phone's sheet, `onStepChange` (a step of its own, money's currencies). The editor keeps the draft, the rounding, Tab, Escape, ⌘ or Ctrl Enter, the write check, the save and the phone's ✕ and ✓.
|
|
56
|
-
- `ViewsSortBodyProps` — the sort editor's whole body your app draws: `label`, `options` (the fields it sorts by, each its `value`, `label` and `defaultDir`, and, as the grid's header marks its column, its field's `type`, its `part` and the header's `glyph`), `rules` (in order, the first sorting first), `setAside` (the set-aside sorts, `[]` when none), `max`, `form`, `addSort` (on a computer, Add sort at its foot), `onRulesChange` (the whole rules and, when handed, the set-aside sorts kept; every change as it is made; a list that breaks the rules writes nothing), `onDone` (what holds it closes) and, on a phone where the sheet's head doesn't draw them, `actions` (the ✕, taking the rules back to what they were as it opened, and ✓). ViewKit keeps the check, the latest rules between renders, the close on the last rule and what ✕ takes back to.
|
|
57
|
-
- `ViewsQuickFiltersBodyProps` — the quick filters' whole body your app draws: `label`, `fields` (each its `key`, `label`, `searchPlaceholder` and `values` in the order to show them, each value its key, its words, its `count` where counts show and whether it is `held`; a held value no count lists is among them, drawn from the hold and worded by the config's `heldLabels` else its key; after the fields offered, each other field holding a value, its held values alone), `hold` (each held field once, its values), `several`, `showCounts`, `form`, `onHoldChange` (the whole hold, every change as it is made; one that holds a field twice, more than one value where `several` is false, or a value added on a field the strip doesn't offer writes nothing), `onDone` (what holds it closes) and, on a phone where the sheet's head doesn't draw it, `actions` (the ✕, closing it).
|
|
58
|
-
- `ViewsFilterBodyProps` — the filter editor's whole body your app draws: `label`, `fields` (the fields a rule may name, `ViewsFilterBodyField`s), `filter` (the level it is open on, a `FilterGroup`: an advanced filter's group on a computer, the whole filter on a phone), `levels` (how deep its rules may stand, its own the first), `excludable` (whether it may be `not`), `relation` (where the level is a relation's where edited in place: its field key, words and quantifier, and `gone`, why in words, where the list no longer lists the relation: there a level that adds or changes a rule writes nothing), `form`, `onFilterChange` (the whole level and, at a relation, its quantifier; every change as it is made; a level that breaks the rules writes nothing; an empty one on a computer takes its advanced filter away), `ruleValue` (a rule's value in ViewKit's own body for its type, each change handed back as the rule), `onDone` (what holds it closes) and, on a phone where the sheet's head doesn't draw them, `actions` (the ✕, taking the filter back to what it was as it opened, and ✓). ViewKit keeps the check, the Or top's wrap, the pills' keys and what ✕ takes back to.
|
|
59
|
-
- `ViewsFilterBodyField` — a field a filter body's rule may name: `key`, `label`, `fieldKey`, `part`, `type` (its value type, which says its ways)
|
|
59
|
+
- `ViewsSortBodyProps` — the sort editor's whole body your app draws: `label`, `options` (the fields it sorts by, each its `value`, `label` and `defaultDir`, and, as the grid's header marks its column, its field's `type`, its `part` and the header's `glyph`), `rules` (in order, the first sorting first), `setAside` (the set-aside sorts, `[]` when none), `max`, `form`, `addSort` (on a computer, Add sort at its foot), `onStepChange` (on a phone: a step of your body's own, its title and Back, `null` once back), `onRulesChange` (the whole rules and, when handed, the set-aside sorts kept; every change as it is made; a list that breaks the rules writes nothing), `onDone` (what holds it closes) and, on a phone where the sheet's head doesn't draw them, `actions` (the ✕, taking the rules back to what they were as it opened, and ✓). ViewKit keeps the check, the latest rules between renders, the close on the last rule and what ✕ takes back to.
|
|
60
|
+
- `ViewsQuickFiltersBodyProps` — the quick filters' whole body your app draws: `label`, `fields` (each its `key`, `label`, `searchPlaceholder`, its `options` as the quick filter field hands them (each value's mark is its option's), and `values` in the order to show them, each value its key, its words, its `count` where counts show and whether it is `held`; a held value no count lists is among them, drawn from the hold and worded by the config's `heldLabels` else its key; after the fields offered, each other field holding a value, its held values alone), `hold` (each held field once, its values), `several`, `showCounts`, `form`, `onHoldChange` (the whole hold, every change as it is made; one that holds a field twice, more than one value where `several` is false, or a value added on a field the strip doesn't offer writes nothing), `onDone` (what holds it closes) and, on a phone where the sheet's head doesn't draw it, `actions` (the ✕, closing it).
|
|
61
|
+
- `ViewsFilterBodyProps` — the filter editor's whole body your app draws: `label`, `fields` (the fields a rule may name, `ViewsFilterBodyField`s, each column the list can't filter among them in its place, greyed by its `disabled`), `filter` (the level it is open on, a `FilterGroup`: an advanced filter's group on a computer, the whole filter on a phone), `levels` (how deep its rules may stand, its own the first), `excludable` (whether it may be `not`), `relation` (where the level is a relation's where edited in place: its field key, words and quantifier, and `gone`, why in words, where the list no longer lists the relation: there a level that adds or changes a rule writes nothing), `form`, `onFilterChange` (the whole level and, at a relation, its quantifier; every change as it is made; a level that breaks the rules writes nothing; an empty one on a computer takes its advanced filter away), `ruleValue` (a rule's value in ViewKit's own body for its type, each change handed back as the rule), `onDone` (what holds it closes) and, on a phone where the sheet's head doesn't draw them, `actions` (the ✕, taking the filter back to what it was as it opened, and ✓). ViewKit keeps the check, the Or top's wrap, the pills' keys and what ✕ takes back to.
|
|
62
|
+
- `ViewsFilterBodyField` — a field a filter body's rule may name: `key`, `label`, `fieldKey`, `part`, `type` (its value type, which says its ways), `far` (a relation's fields one level in) and `disabled` (on a column the list can't filter, why in words: draw it greyed and never name it in a rule).
|
|
60
63
|
- `ViewsFieldsBodyProps` — the field list's whole body your app draws: `purpose` (`sort` or `filter`), `label`, `search` (its search's words), `fields` (each a `ViewsFieldsBodyField`), `own` (the field being changed; absent where a pick adds), `form`, `onPick` (the key picked, and a far field's key for a far field; a key not handed, or handed `disabled`, writes nothing) and `onDone` (what holds it closes, or on a phone the page turns back).
|
|
61
64
|
- `ViewsFieldsBodyField` — a field as the field list's body is handed it: `key`, `label`, `type` and `part` (its field's type and the part it reads, as the grid's header reads them), `glyph` (its column's glyph, drawn as the header draws it), `disabled` (why it can't be picked) and, for a filter's relation, `far` (its far fields, one level in).
|
|
62
65
|
- `ViewsFilterPartBodyProps` — a filter rule's way or value your app draws: `part` (`way` or `value`), `label`, `rule` (the rule as data), `field` (the field it names, a `ViewsFilterBodyField` with no `far`), `ways` (each its operator and its words), `own` (ViewKit's own value body; null at `way`), `form`, `onRuleChange` (the rule with its new way, written as ViewKit's own writes one, or its new value; another field or part, a way its field doesn't offer or a value its way can't hold writes nothing) and `onDone` (what holds it closes).
|
|
63
66
|
- `ViewsSearchFieldProps` — the toolbar's search box your app draws: `value`, `onChange` (every keystroke), `placeholder`, `label` (its name to a screen reader), `searching` and `searchingLabel` (draw a spinner where your glass is, the box still usable), `onClear` (empties the search, and closes it where `closes`), `clearLabel` (your clear's name: "Close search" where it closes, "Clear" where it only clears), `closes` (opened from its button: your clear stands while it is open, empty or not; filling its line: show it only with a value), `form` (`computer` or `phone`) and `fill` (it fills its line).
|
|
64
|
-
- `ViewsViewsListBodyProps` — the views list's whole body your app draws: `label`, `views` (each a `ViewsViewsListItem`), `value` (the view in use), `form`, `onViewChange` (a view picked; written when it is one of `views`; it closes nothing), `onCreate` and `createLabel` where the axis grows (what holds it closes first), `onReorder` and `canDrag` where the axis reorders (one whole block, shared or the reader's own, each once; any other order writes nothing), `onDone` (what holds it closes)
|
|
65
|
-
- `ViewsViewsListItem` — one view as the views list's body is handed it: `value`, `label`, `icon`, `count` (absent while counts are hidden), `private
|
|
66
|
-
- `
|
|
67
|
+
- `ViewsViewsListBodyProps` — the views list's whole body your app draws: `label`, `views` (each a `ViewsViewsListItem`), `value` (the view in use), `form`, `onViewChange` (a view picked; written when it is one of `views`; it closes nothing), `onCreate` and `createLabel` where the axis grows (what holds it closes first), `onReorder` and `canDrag` where the axis reorders (one whole block, shared or the reader's own, each once; any other order writes nothing), `onDone` (what holds it closes), on a phone where the sheet's head doesn't draw it `actions` (the ✕, and Back while the body stands on a step), on a computer `onHold` (while true, a press outside and Escape close nothing: the body asks outside the list), on a phone `onStepChange` (the body stands on a step of its own: the sheet shows its title and Back), and, where the axis hands them, `verbs` (a view's whole menu's data, `ViewsViewVerbs`).
|
|
68
|
+
- `ViewsViewsListItem` — one view as the views list's body is handed it: `value`, `label`, `icon`, `count` (absent while counts are hidden), `private`, `menu` (the view's own verbs), and for a view's whole menu `layout`, `changed` and `favorite`.
|
|
69
|
+
- `ViewsViewVerbs` — a view's verbs, handed on the axis where your app lets ViewKit draw a view's whole menu: `layouts`, `records` (the noun in the delete question's line), a board's `columns`, and `onChange`, which takes each `ViewsViewChange` and opens the right view itself (ViewKit moves none: `viewsAfter` does it).
|
|
70
|
+
- `ViewsViewChange` — a change a view's menu makes: rename, create (with its layout, name, a board's columns and the view it was made from), duplicate, delete, restore (Undo: the view, its place, whether it was open), save, reset, edit, link, favorite, private.
|
|
71
|
+
- `ViewsViewLayout` — a layout a new view can take: `id`, `name`, `icon` (your `AppIcon`'s name), `line`, and `columns` where it asks which field makes its columns.
|
|
72
|
+
- `ViewsViewRecord` — a view as a restore hands it back: `id`, `name`, `layout`, and `private`, `favorite`, `changed`, `count` where it has them.
|
|
73
|
+
- `ViewsGroupBodyProps` — the group editor's whole body your app draws: `label`, `dimensions` (each a `ViewsGroupDimension`), `group` (a `ViewsGroupValue`), `manualOrder` (your own order may be picked), `form`, `onGroupChange` (the whole group, every change as it is made; one write for each: a new Group by, order or date step alone, else Hide empty groups, else the groups; a new Group by keeps the order and step handed with it only where the new field offers them; a value that changes two at once, names a field the list doesn't offer, or names an order or step the field grouped by doesn't offer writes nothing), `onDone` (inside Customize, back to its list), `actions` (none inside Customize, whose head holds the ✕) and `onStepChange` (a level of the body's own, Group by's fields or an order's choices, whose name and Back Customize's head shows).
|
|
67
74
|
- `ViewsGroupDimension` — a field a list can be grouped by: `value`, `label`, `orderOptions` (each its mode, words and `defaultDir`), `defaultOrder`, and a date's `granularities` with `defaultGranularity`.
|
|
68
75
|
- `ViewsGroupValue` — a list's group as one value: `value` (the field grouped by, or `none`), `order` (the active field's `mode` and `dir`), `granularity`, `hideEmpty` and `groups` (each a `ViewsGroupEntry`, in the order the list shows them).
|
|
69
|
-
- `ViewsGroupEntry` — one group: `key`, `label`, `empty` and `
|
|
76
|
+
- `ViewsGroupEntry` — one group: `key`, `label`, `empty`, `hidden`, and its `count` where the list counts it.
|
|
70
77
|
- `ViewsCustomizeBodyProps` — Customize's whole body your app draws: `label`, `page` and `onPageChange` (a `ViewsCustomizePage`), `layout` (a `ViewsCustomizeLayout`), `columns` (`ViewsCustomizeColumns`), `filter` (`FilterBody`'s props on the whole filter, without `form`, `onDone` and `actions`), `sort` (`SortBody`'s, likewise), `group` (`GroupBody`'s, likewise), `toggles` (each a `ViewsCustomizeToggle`, Show counts among them), `view` (on a shared view: `changes`, `stale`, `canPublish`, `pending`, `onReset`, `onPublish`), `foot`, `onClear`, `clearAll`, `form`, `onDone` and, on a phone where the sheet's head doesn't draw it, `actions` (the ✕). No per-field filters: where a list's filter is only per-field values (no filter tree), ViewKit draws its own Customize even with a body handed.
|
|
71
78
|
- `ViewsCustomizePage` — where a Customize body stands: `list`, `layout`, `columns`, `filter`, `sort` or `group`.
|
|
72
79
|
- `ViewsCustomizeLayout` — the layouts (`options`, `refused` with reasons, `value`, `onLayoutChange`) and the layout in use's `toggles`, `choices`, `density` and the reader's own `personal` settings.
|
|
@@ -80,7 +87,7 @@ The primitives your app hands in, modelled on Base UI's shapes: a controlled `op
|
|
|
80
87
|
- `ViewsSheetProps` — a phone sheet, controlled by `open` and `onOpenChange`, with a `title`, a `label` (the title in words whenever the title is words: its accessible name, and the title of a head that takes only text), a `description`, a class, its `children`, and `snap` (`full`, `half`, `peek`, `auto`), a hint a sheet with no snap points ignores. With the provider's `sheetActions` at `head` it is handed `actions` to draw in its own head: the editor panel's ✕ and ✓ (and Back, on a body's step), a toolbar panel's ✕ alone, or the sort editor's ✕ (which takes its rules back) and ✓.
|
|
81
88
|
- `ViewsSheetActions` — the editor panel's ✕ and ✓, handed to a sheet that draws them in its head: `close`, which throws the edit away as a swipe does, and `done`, which closes it as done, absent where the body saves on its pick. A toolbar panel's sheet is handed `close` alone, which closes it; the sort editor's is handed both, its `close` taking the rules back to what they were as the sheet opened and its `done` keeping them. While an editor's body stands on a step of its own it carries `back` too, to draw in `close`'s place: Back, returning the body to where it was; `close` stays handed, for a head that draws no Back.
|
|
82
89
|
- `ViewsSheetAction` — one of them: its `label` (the accessible name) and `onPress`. The glyph is yours.
|
|
83
|
-
- `ViewsBodyStep` — `{ title, onBack }`: a step of an editor body's own on a phone (a list of countries, a label's list), which a `TextBody`, `NumberBody`, `PartsBody`, `ValuesBody` or `LinksBody` hands the sheet through its `onStepChange`. The sheet's head shows `title` in place of the field's name, and Back and the sheet's Escape call `onBack`; the body hands `null` once it is back.
|
|
90
|
+
- `ViewsBodyStep` — `{ title, onBack }`: a step of an editor body's own on a phone (a list of countries, a label's list), which a `TextBody`, `NumberBody`, `PartsBody`, `ValuesBody` or `LinksBody`, or the sort's `SortBody` (Add sort's fields, a rule's direction), hands the sheet through its `onStepChange`. The sheet's head shows `title` in place of the field's name, and Back and the sheet's Escape call `onBack`; the body hands `null` once it is back. A `GroupBody` hands its level the same way to ViewKit's Customize, on a computer and a phone: Customize's head shows its title and Back calls `onBack` (Escape there still closes the panel).
|
|
84
91
|
- `ViewsMenuRoute` — `"popover" | "menu"`, the provider's `menus`: how the grid opens its own menus (a column's, a footer's figure picker, a group's ⋯, Add column). `popover` (the default) draws ViewKit's rows in your `Popover`; `menu` hands your `Menu` its rows as data. The row menu and a command cell's menu always go through your `Menu`.
|
|
85
92
|
- `ViewsSeveralValues` — `"first" | "fit"`, the provider's `severalValues`: how a cell of several values draws on one line. `fit` (the default) draws as many whole values as fit its width, then the count, following a column resize; `first` draws its first value and a count at any width, as on 0.5.0.
|
|
86
93
|
- `ViewsGridButtons` — `"own" | "button"`, the provider's `gridButtons`: who draws the buttons the grid draws itself (a group's fold and ⋯, "+ Add column", a row's ⋯, the name's actions, an action column's buttons, a pick-list cell's ▾, a command cell's ▾ and trigger). `own` (the default) draws ViewKit's own, as on 0.5.0; `button` draws your `Button`, handed the grid's box in `className`.
|
|
@@ -15,11 +15,13 @@ Guide: [selection](../guides/selection.md).
|
|
|
15
15
|
|
|
16
16
|
## The bar
|
|
17
17
|
|
|
18
|
-
- `SelectionBar` — the bar a selection opens, portalled to the body and placed by the provider's `selectionBar`. On a desktop, an island: the count chip (a press clears the selection; its tooltip names Escape; ViewKit's own, or your `Button` with `selectionBar`'s `chip: "button"`), the first four verbs, the trash when `onDelete` is handed, a hairline and More, always drawn (when nothing spills into it, a Tab stop that opens nothing, `aria-disabled`, saying why in your `Tooltip`: `views.selection.more-none`), holding the rest (a group or an options verb opening its rows beside it). On a phone, a pill reading the count, Actions and ✕; Actions opens the `SelectionSheet` atom. It draws nothing while `count` is zero.
|
|
18
|
+
- `SelectionBar` — the bar a selection opens, portalled to the body and placed by the provider's `selectionBar`. On a desktop, an island: the count chip (a press clears the selection; its tooltip names Escape; ViewKit's own, or your `Button` with `selectionBar`'s `chip: "button"`), the first four verbs, the trash when `onDelete` is handed, a hairline and More, always drawn (when nothing spills into it, a Tab stop that opens nothing, `aria-disabled`, saying why in your `Tooltip`: `views.selection.more-none`), holding the rest (a group or an options verb opening its rows beside it). On a phone, a pill reading the count, Actions and ✕; Actions opens the `SelectionSheet` atom. It draws nothing while `count` is zero. Handed a `SelectionBar` in the components map (`CONTROLS`: the Outright bulk bar), it draws that one in its place instead, in the box that holds it, at every count; `noun` and `deleteLine` are for that bar.
|
|
19
19
|
- `SelectionBarProps` — what `SelectionBar` takes: `count`, `onClear`, `verbs` (`SelectionVerb`s, in order), optional `busy` (disables every control), `onDelete` (the bar's own verb, the trailing trash; never a verb in `verbs`) and `deleteLabel` (the trash's name; default the `views.selection.delete` message).
|
|
20
20
|
- `SelectionVerb` — one verb, as data: `{ kind: "action" }` with a `SelectionVerbItem`'s fields; `{ kind: "group", label, icon?, disabled?, disabledReason?, items }`, a button opening a menu of `SelectionVerbItem`s, whose rows that give no reason carry the group's; or a `SelectionOptionsVerb`.
|
|
21
21
|
- `SelectionVerbItem` — an action: `label`, optional `icon` (your glyph), `onClick`, `destructive` (the danger colour), `disabled`, and `disabledReason`, why it is disabled: More's row, the bar's button and the phone's sheet carry it.
|
|
22
|
-
- `SelectionOptionsVerb` — one field set on every selected row: `{ kind: "options", label, icon?, disabled?, disabledReason?, options, onSelect }`, its `options` `PickerOption`s drawn as the badges a cell shows, `onSelect` handed the value picked. It closes, then runs.
|
|
22
|
+
- `SelectionOptionsVerb` — one field set on every selected row: `{ kind: "options", label, icon?, disabled?, disabledReason?, options, onSelect }`, its `options` `PickerOption`s (or `ViewsPickerItem`s, a person by `avatarUrl` and `kind`) drawn as the badges a cell shows, `onSelect` handed the value picked. It closes, then runs. For the components map's bar (`CONTROLS.SelectionBar`) it may carry `value` (what every picked row holds), `empty` with `onEmpty` (an empty row that clears the field) and `search`; any verb may carry `more`, kept off that bar, in More.
|
|
23
|
+
- `SelectionDone` — what a press may hand back for the components map's bar: `{ words, undo? }`, what its Toast says and how it is taken back.
|
|
24
|
+
- `SelectionRun` — a press (`onClick`, `onEmpty`, `onDelete`): whatever it returns, read as a `SelectionDone` (or a promise of one) where it is one.
|
|
23
25
|
|
|
24
26
|
## Picking rows with the pointer
|
|
25
27
|
|