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
|
@@ -3,6 +3,8 @@ import type { FieldType } from "viewkitjs/fields";
|
|
|
3
3
|
import type { CategoryColor } from "viewkitjs/fields/design/category-colors";
|
|
4
4
|
import type { StatusSlot } from "viewkitjs/fields/design/status-slots";
|
|
5
5
|
import type { BucketOrderMode, FILTER_OPERATORS, FilterGroup, FilterRelationRule, FilterRule, SetAsideReason, SortDirection } from "viewkitjs/fields/query";
|
|
6
|
+
import type { ViewsConfirmPort, ViewsToastPort } from "./ports.js";
|
|
7
|
+
import type { SelectionBarProps } from "../selection/bar-props.js";
|
|
6
8
|
/** Where a floating part attaches: an element, a ref to one, or a point (a context menu). */
|
|
7
9
|
export type ViewsAnchor = HTMLElement | RefObject<HTMLElement | null> | {
|
|
8
10
|
x: number;
|
|
@@ -738,6 +740,11 @@ export type ViewsSortBodyProps = {
|
|
|
738
740
|
* set-aside sorts back to what they were as it opened) and ✓, for your body's own head. Absent on a computer, and
|
|
739
741
|
* under `head`, where the sheet holds them. */
|
|
740
742
|
actions?: ViewsSheetActions;
|
|
743
|
+
/** On a phone: tell the sheet you stand on a step of your own (Add sort's fields, a rule's direction), and hand `null`
|
|
744
|
+
* once you are back. Under `sheetActions: "head"` the sheet's head shows the step's title and Back in ✕'s place, and
|
|
745
|
+
* ✓; under `bar` your own head does. Escape calls `onBack`; a swipe still closes the whole sheet, keeping the rules.
|
|
746
|
+
* Absent on a computer. */
|
|
747
|
+
onStepChange?: (step: ViewsBodyStep | null) => void;
|
|
741
748
|
};
|
|
742
749
|
/** The quick filters' body, which your app draws (`QuickFiltersBody`): what the quick filters' button opens on a
|
|
743
750
|
* computer and in the phone's Sheet, in place of ViewKit's own panel. A panel's body, as every panel's: handed the
|
|
@@ -757,6 +764,8 @@ export type ViewsQuickFiltersBodyProps = {
|
|
|
757
764
|
key: string;
|
|
758
765
|
label: string;
|
|
759
766
|
searchPlaceholder?: string;
|
|
767
|
+
/** Its options as the app hands them (`QuickFilterField`'s): each value's mark is its option's. */
|
|
768
|
+
options?: readonly ViewsPickerItem[];
|
|
760
769
|
/** Each value: its key as the hold keeps it (an option, an id, "true" or "false", "" for none), its words, how
|
|
761
770
|
* many rows a press on it shows (absent when the app counts none or counts are hidden), and whether it is held. */
|
|
762
771
|
values: readonly {
|
|
@@ -800,6 +809,14 @@ export type ViewsFilterBodyField = {
|
|
|
800
809
|
type: keyof typeof FILTER_OPERATORS;
|
|
801
810
|
/** A relation's far fields, one level in: a rule on one is a relation rule (any, none or every where …). */
|
|
802
811
|
far?: readonly ViewsFilterBodyField[];
|
|
812
|
+
/** A choice field's values (a status's, a select's, a person's, a record's), or a place's country's names (its `countryCode`
|
|
813
|
+
* part, VK-735), each as the Picker draws it, where ViewKit holds
|
|
814
|
+
* them as the list opens: your body may list them in the rule's value box. Absent where its values are read on demand, or the
|
|
815
|
+
* field is no choice: open `ruleValue` there. */
|
|
816
|
+
options?: readonly ViewsPickerItem[];
|
|
817
|
+
/** Why no rule can be made on it, in words (a column the list can't filter); absent, it can. Draw it greyed, in its place,
|
|
818
|
+
* and never write a rule on it, nor put back a set-aside rule on it: ViewKit refuses a level that holds one. */
|
|
819
|
+
disabled?: string;
|
|
803
820
|
};
|
|
804
821
|
/** The filter editor's body, which your app draws (`FilterBody`): what an advanced filter's pill opens on a computer and
|
|
805
822
|
* Filter opens in the phone's Sheet, in place of ViewKit's own. A panel's body, as every panel's: handed the level it is
|
|
@@ -809,7 +826,8 @@ export type ViewsFilterBodyProps = {
|
|
|
809
826
|
/** The filter's name ("Advanced filter" on a computer, "Filter" on a phone): a phone's title, and the rules' name to a
|
|
810
827
|
* screen reader. */
|
|
811
828
|
label: string;
|
|
812
|
-
/** The fields a rule may name, in the person's order,
|
|
829
|
+
/** The fields a rule may name, in the person's order, each column the list can't filter among them in its place (its
|
|
830
|
+
* `disabled` saying why: draw it greyed, never name it), then each relation with its far fields one level in. */
|
|
813
831
|
fields: readonly ViewsFilterBodyField[];
|
|
814
832
|
/** The level it is open on, its items joined by its `op`: on a computer the advanced filter's own group (`and`, `or`,
|
|
815
833
|
* or `not` for one that excludes its matches; a top joined by Or as one group of its own), on a phone the whole
|
|
@@ -848,6 +866,18 @@ export type ViewsFilterBodyProps = {
|
|
|
848
866
|
* it was as the sheet opened) and ✓, for your body's own head. Absent on a computer, and under `head`, where the
|
|
849
867
|
* sheet holds them. */
|
|
850
868
|
actions?: ViewsSheetActions;
|
|
869
|
+
/** ViewKit's own words for a rule, as the filter bar words it: its field, its way and its value (null with none yet). For a
|
|
870
|
+
* rule your body has no words of its own for (set aside, a way you don't draw). `relation`: the relation's field key, for a
|
|
871
|
+
* far rule. */
|
|
872
|
+
ruleWords?: (rule: FilterRule, relation?: string) => {
|
|
873
|
+
field: string;
|
|
874
|
+
way: string;
|
|
875
|
+
value: string | null;
|
|
876
|
+
};
|
|
877
|
+
/** On a phone: tell the sheet you stand on a step of your own (a box's list, Add filter's fields), and hand null once you
|
|
878
|
+
* are back. The sheet's head shows the step's title, Back in ✕'s place and ✓; Escape calls onBack; a swipe still closes
|
|
879
|
+
* the whole sheet, keeping the filter. Absent on a computer. */
|
|
880
|
+
onStepChange?: (step: ViewsBodyStep | null) => void;
|
|
851
881
|
};
|
|
852
882
|
/** A field as the field list's body is handed it (`ViewsFieldsBodyProps.fields`). */
|
|
853
883
|
export type ViewsFieldsBodyField = {
|
|
@@ -959,6 +989,93 @@ export type ViewsViewsListItem = {
|
|
|
959
989
|
/** The view's own verbs (Rename, Duplicate, Delete…), as your app gave them: ViewKit's own list offers them on the
|
|
960
990
|
* view in use. */
|
|
961
991
|
menu?: ViewsMenuItem[];
|
|
992
|
+
/** Its layout, by `ViewsViewVerbs.layouts`' id. */
|
|
993
|
+
layout?: string;
|
|
994
|
+
/** It holds changes not saved. */
|
|
995
|
+
changed?: boolean;
|
|
996
|
+
/** One of the reader's favorites. */
|
|
997
|
+
favorite?: boolean;
|
|
998
|
+
};
|
|
999
|
+
/** A view as a restore hands it back. */
|
|
1000
|
+
export type ViewsViewRecord = {
|
|
1001
|
+
id: string;
|
|
1002
|
+
name: string;
|
|
1003
|
+
layout: string;
|
|
1004
|
+
private?: boolean;
|
|
1005
|
+
favorite?: boolean;
|
|
1006
|
+
changed?: boolean;
|
|
1007
|
+
count?: number;
|
|
1008
|
+
};
|
|
1009
|
+
/** A change a view's menu makes, as the axis's `verbs.onChange` takes it: the views list's own `ViewsListChange` but `open` and
|
|
1010
|
+
* `order`, which go to the axis's `onChange` and `onReorder`. Written out here, since the provider reaches nothing in the controls. */
|
|
1011
|
+
export type ViewsViewChange = {
|
|
1012
|
+
kind: "rename";
|
|
1013
|
+
id: string;
|
|
1014
|
+
name: string;
|
|
1015
|
+
} | {
|
|
1016
|
+
kind: "create";
|
|
1017
|
+
layout: string;
|
|
1018
|
+
name: string;
|
|
1019
|
+
columns?: string;
|
|
1020
|
+
from?: string;
|
|
1021
|
+
} | {
|
|
1022
|
+
kind: "duplicate";
|
|
1023
|
+
id: string;
|
|
1024
|
+
} | {
|
|
1025
|
+
kind: "delete";
|
|
1026
|
+
id: string;
|
|
1027
|
+
} | {
|
|
1028
|
+
kind: "restore";
|
|
1029
|
+
view: ViewsViewRecord;
|
|
1030
|
+
at: number;
|
|
1031
|
+
open: boolean;
|
|
1032
|
+
} | {
|
|
1033
|
+
kind: "save";
|
|
1034
|
+
id: string;
|
|
1035
|
+
} | {
|
|
1036
|
+
kind: "reset";
|
|
1037
|
+
id: string;
|
|
1038
|
+
} | {
|
|
1039
|
+
kind: "edit";
|
|
1040
|
+
id: string;
|
|
1041
|
+
} | {
|
|
1042
|
+
kind: "link";
|
|
1043
|
+
id: string;
|
|
1044
|
+
} | {
|
|
1045
|
+
kind: "favorite";
|
|
1046
|
+
id: string;
|
|
1047
|
+
on: boolean;
|
|
1048
|
+
} | {
|
|
1049
|
+
kind: "private";
|
|
1050
|
+
id: string;
|
|
1051
|
+
on: boolean;
|
|
1052
|
+
};
|
|
1053
|
+
/** A layout a new view can take: its glyph by your own icon's name (AppIcon), its name, its one line; `columns` where it asks
|
|
1054
|
+
* which field makes its columns (a board). */
|
|
1055
|
+
export type ViewsViewLayout = {
|
|
1056
|
+
id: string;
|
|
1057
|
+
name: string;
|
|
1058
|
+
icon: string;
|
|
1059
|
+
line: string;
|
|
1060
|
+
columns?: boolean;
|
|
1061
|
+
};
|
|
1062
|
+
/** A view's verbs, handed where your app lets ViewKit draw a view's menu (CONTROLS: Rename, New view, the delete question, Undo). */
|
|
1063
|
+
export type ViewsViewVerbs = {
|
|
1064
|
+
layouts: readonly ViewsViewLayout[];
|
|
1065
|
+
/** What the list holds, in the delete question's line ("deals"). */
|
|
1066
|
+
records: string;
|
|
1067
|
+
/** The fields a board's columns can follow, and the one filled in. */
|
|
1068
|
+
columns?: {
|
|
1069
|
+
fields: readonly {
|
|
1070
|
+
value: string;
|
|
1071
|
+
label: string;
|
|
1072
|
+
}[];
|
|
1073
|
+
value: string;
|
|
1074
|
+
};
|
|
1075
|
+
/** Each change a view's menu makes. ViewKit moves no view itself: open the right one here (the first listed when the open one
|
|
1076
|
+
* is deleted, the view again on a restore with `open`, the new one on a create or a duplicate, whose ids your app makes).
|
|
1077
|
+
* `viewsAfter` (viewkitjs/views/controls) does all of it over your views. */
|
|
1078
|
+
onChange: (change: ViewsViewChange) => void;
|
|
962
1079
|
};
|
|
963
1080
|
/** The views list's body, which your app draws (`ViewsListBody`): what the view picker's chip opens on a computer and in
|
|
964
1081
|
* the phone's Sheet, in place of ViewKit's own list. A panel's body, as every panel's: handed the axis's views as data,
|
|
@@ -986,8 +1103,17 @@ export type ViewsViewsListBodyProps = {
|
|
|
986
1103
|
/** The job is done and what holds it closes. */
|
|
987
1104
|
onDone: () => void;
|
|
988
1105
|
/** On a phone where the sheet's head doesn't draw it (`sheetActions: "bar"`): its ✕, closing the list, for your
|
|
989
|
-
* body's own head. Absent on a computer, and under `head`,
|
|
1106
|
+
* body's own head, and Back while the body stands on a step (`onStepChange`). Absent on a computer, and under `head`,
|
|
1107
|
+
* where the sheet holds them. */
|
|
990
1108
|
actions?: ViewsSheetActions;
|
|
1109
|
+
/** Handed where the axis hands `verbs`: draw a view's whole menu from them (CONTROLS does), not only `menu`. */
|
|
1110
|
+
verbs?: ViewsViewVerbs;
|
|
1111
|
+
/** On a phone, the body stands on a step of its own (a view's menu, Rename…): its title and Back go to the sheet's head, and
|
|
1112
|
+
* the sheet's Escape goes back a step. Absent on a computer. */
|
|
1113
|
+
onStepChange?: (step: ViewsBodyStep | null) => void;
|
|
1114
|
+
/** While true, a press outside the list and Escape close nothing: the body asks a question outside it (your `confirm` port's
|
|
1115
|
+
* dialog, which stands outside the list's popover), and the list stays when it is answered. On a computer. */
|
|
1116
|
+
onHold?: (holding: boolean) => void;
|
|
991
1117
|
};
|
|
992
1118
|
/** A field a list can be grouped by, as the group body is handed it (`ViewsGroupBodyProps.dimensions`): the panels'
|
|
993
1119
|
* `GroupDimension` (`viewkitjs/views/panels`), written out here, since the provider reaches nothing inside the panels. */
|
|
@@ -1012,12 +1138,14 @@ export type ViewsGroupDimension = {
|
|
|
1012
1138
|
defaultGranularity?: string;
|
|
1013
1139
|
};
|
|
1014
1140
|
/** One group of the field grouped by, as the group body is handed it: its key, its words ("" for the empty group),
|
|
1015
|
-
* whether it is empty (Hide empty groups hides it)
|
|
1141
|
+
* whether it is empty (Hide empty groups hides it), whether the reader hid it, and how many records it holds, where the
|
|
1142
|
+
* list counts them. */
|
|
1016
1143
|
export type ViewsGroupEntry = {
|
|
1017
1144
|
key: string;
|
|
1018
1145
|
label: string;
|
|
1019
1146
|
empty: boolean;
|
|
1020
1147
|
hidden: boolean;
|
|
1148
|
+
count?: number;
|
|
1021
1149
|
};
|
|
1022
1150
|
/** A list's group as one value, what a group body is handed and hands back whole. */
|
|
1023
1151
|
export type ViewsGroupValue = {
|
|
@@ -1060,6 +1188,9 @@ export type ViewsGroupBodyProps = {
|
|
|
1060
1188
|
onDone: () => void;
|
|
1061
1189
|
/** On a phone where the sheet's head doesn't draw it: its ✕. Inside Customize, whose own head holds the ✕, absent. */
|
|
1062
1190
|
actions?: ViewsSheetActions;
|
|
1191
|
+
/** Tell what holds you that you stand on a level of your own (Group by's fields, an order's choices): its head shows the
|
|
1192
|
+
* level's name and its Back calls onBack; hand null once you are back. On a computer and a phone. */
|
|
1193
|
+
onStepChange?: (step: ViewsBodyStep | null) => void;
|
|
1063
1194
|
};
|
|
1064
1195
|
/** Where a Customize body stands: its list, or a section's page. */
|
|
1065
1196
|
export type ViewsCustomizePage = "list" | "layout" | "columns" | "filter" | "sort" | "group";
|
|
@@ -1179,14 +1310,14 @@ export type ViewsCustomizeBodyProps = {
|
|
|
1179
1310
|
columns?: ViewsCustomizeColumns;
|
|
1180
1311
|
/** The filter as and/or groups, as `FilterBody` is handed it on a phone: the whole filter, 3 levels deep. Where a list's
|
|
1181
1312
|
* filter is only per-field values (no filter tree), ViewKit draws its own Customize instead of the body. */
|
|
1182
|
-
filter?: Omit<ViewsFilterBodyProps, "form" | "onDone" | "actions">;
|
|
1313
|
+
filter?: Omit<ViewsFilterBodyProps, "form" | "onDone" | "actions" | "onStepChange">;
|
|
1183
1314
|
/** The sort, as `SortBody` is handed it: a list with one sort as one rule, `max` 1. */
|
|
1184
|
-
sort?: Omit<ViewsSortBodyProps, "form" | "onDone" | "actions">;
|
|
1315
|
+
sort?: Omit<ViewsSortBodyProps, "form" | "onDone" | "actions" | "onStepChange">;
|
|
1185
1316
|
/** The group, as `GroupBody` is handed it. */
|
|
1186
|
-
group?: Omit<ViewsGroupBodyProps, "form" | "onDone" | "actions">;
|
|
1317
|
+
group?: Omit<ViewsGroupBodyProps, "form" | "onDone" | "actions" | "onStepChange">;
|
|
1187
1318
|
/** The list's own toggles, Show counts among them (read from the view). */
|
|
1188
1319
|
toggles: readonly ViewsCustomizeToggle[];
|
|
1189
|
-
/** On a shared view: how far the reader has drifted from it, and Reset and
|
|
1320
|
+
/** On a shared view: how far the reader has drifted from it, and Reset and Save for everyone. */
|
|
1190
1321
|
view?: {
|
|
1191
1322
|
changes: number;
|
|
1192
1323
|
/** Everyone's view moved after the reader's changes began. */
|
|
@@ -1211,6 +1342,19 @@ export type ViewsCustomizeBodyProps = {
|
|
|
1211
1342
|
/** On a phone where the sheet's head doesn't draw it (`sheetActions: "bar"`): its ✕, closing it, for your body's own
|
|
1212
1343
|
* head. Absent on a computer, and under `head`, where the sheet holds it. */
|
|
1213
1344
|
actions?: ViewsSheetActions;
|
|
1345
|
+
/** The view's name, as the app hands it through the toolbar (`viewName`): draw it, renamed in place, only with `onRename`. */
|
|
1346
|
+
name?: string;
|
|
1347
|
+
/** Renames the view (the toolbar's `onRenameView`): handed only where the app can rename it. */
|
|
1348
|
+
onRename?: (name: string) => void;
|
|
1349
|
+
/** Copy link to view, where the app hands it. */
|
|
1350
|
+
onCopyLink?: () => void;
|
|
1351
|
+
/** Export CSV, where the app hands it. */
|
|
1352
|
+
onExport?: () => void;
|
|
1353
|
+
/** What Export CSV takes, in words ("12 deals"), shown beside it. */
|
|
1354
|
+
exportCount?: string;
|
|
1355
|
+
/** On a phone: the level of its own your body stands on inside a section (the group editor's Group by), or `null` once
|
|
1356
|
+
* it is back, so the sheet's Escape goes back a level instead of closing. */
|
|
1357
|
+
onStepChange?: (step: ViewsBodyStep | null) => void;
|
|
1214
1358
|
};
|
|
1215
1359
|
/** Where the editor panel's ✕ and ✓, and a toolbar panel's ✕, stand on a phone: `bar`, the panel's own inside the
|
|
1216
1360
|
* Sheet; `head`, handed to the Sheet as `actions` for its own head, with none drawn inside. */
|
|
@@ -1288,6 +1432,16 @@ export type ViewsRowsWaitProps = {
|
|
|
1288
1432
|
pending: boolean;
|
|
1289
1433
|
children: ReactNode;
|
|
1290
1434
|
};
|
|
1435
|
+
/** What the components map's `PortsHost` is told: which ports the app left out, and where to hand ViewKit's own once they
|
|
1436
|
+
* stand. */
|
|
1437
|
+
export type ViewsPortsHostProps = {
|
|
1438
|
+
toast: boolean;
|
|
1439
|
+
confirm: boolean;
|
|
1440
|
+
onReady: (ports: {
|
|
1441
|
+
toast?: ViewsToastPort;
|
|
1442
|
+
confirm?: ViewsConfirmPort;
|
|
1443
|
+
}) => void;
|
|
1444
|
+
};
|
|
1291
1445
|
export type ViewsComponents = {
|
|
1292
1446
|
Button: ComponentType<ViewsButtonProps>;
|
|
1293
1447
|
Popover: ComponentType<ViewsPopoverProps>;
|
|
@@ -1372,16 +1526,29 @@ export type ViewsComponents = {
|
|
|
1372
1526
|
GroupBody?: ComponentType<ViewsGroupBodyProps>;
|
|
1373
1527
|
/** Optional: Customize's whole body, which your app draws. Handed one, Options opens it on a computer and in the
|
|
1374
1528
|
* phone's Sheet, and so does anything else that draws ViewKit's Customize, handed the view's settings as data; left
|
|
1375
|
-
* out, it opens ViewKit's own Customize.
|
|
1376
|
-
|
|
1529
|
+
* out, it opens ViewKit's own Customize. A body that can't draw everything a list hands carries `stepsAside`: given the
|
|
1530
|
+
* props it would be handed, true, and ViewKit draws its own Customize instead. */
|
|
1531
|
+
CustomizeBody?: ComponentType<ViewsCustomizeBodyProps> & {
|
|
1532
|
+
stepsAside?: (props: ViewsCustomizeBodyProps) => boolean;
|
|
1533
|
+
};
|
|
1377
1534
|
/** Optional: the toolbar's search box, which your app draws. Handed one, the search opens it in place of its own
|
|
1378
1535
|
* field, on a computer and on a phone; left out, ViewKit draws its own. */
|
|
1379
1536
|
SearchField?: ComponentType<ViewsSearchFieldProps>;
|
|
1537
|
+
/** Optional: what draws the ports an app leaves out (CONTROLS: ViewKit's Toast and alert dialog). Mounted once by the
|
|
1538
|
+
* provider, after it first renders in the browser, only when the app hands no `toast` or no `confirm`; left out, a
|
|
1539
|
+
* missing `toast` draws nothing and a missing `confirm` is the browser's. */
|
|
1540
|
+
PortsHost?: ComponentType<ViewsPortsHostProps>;
|
|
1541
|
+
/** Optional: the selection bar, which your app draws (CONTROLS: the Outright bulk bar). Handed one, ViewKit's `SelectionBar`
|
|
1542
|
+
* draws it in its own place, in the box that holds it, at every count (zero included, so it can leave), handed its props;
|
|
1543
|
+
* left out, ViewKit draws its own bar, portalled to the screen's foot. */
|
|
1544
|
+
SelectionBar?: ComponentType<ViewsSelectionBarProps>;
|
|
1380
1545
|
};
|
|
1546
|
+
/** The selection bar's props, as your `SelectionBar` is handed them: ViewKit's `SelectionBar`'s own. */
|
|
1547
|
+
export type ViewsSelectionBarProps = SelectionBarProps;
|
|
1381
1548
|
/** The map as the views read it: `Input`, `Command` and `Calendar` always filled, the app's or the
|
|
1382
1549
|
* package's own; `Picker`, `LinksBody`, `DateBody`, `PartsBody`, `ValuesBody`, `TextBody`, `NumberBody`, `SortBody`, `FilterBody`,
|
|
1383
|
-
* `FieldsBody`, `FilterPartBody`, `RowsWait`, `QuickFiltersBody`, `ViewsListBody`, `GroupBody`, `CustomizeBody
|
|
1384
|
-
* `SearchField` as the app handed them. */
|
|
1550
|
+
* `FieldsBody`, `FilterPartBody`, `RowsWait`, `QuickFiltersBody`, `ViewsListBody`, `GroupBody`, `CustomizeBody`,
|
|
1551
|
+
* `SearchField`, `PortsHost` and `SelectionBar` as the app handed them. */
|
|
1385
1552
|
export type ViewsResolvedComponents = ViewsComponents & {
|
|
1386
1553
|
Input: ComponentType<ViewsInputProps>;
|
|
1387
1554
|
Command: ViewsCommandParts;
|
|
@@ -16,6 +16,12 @@ export type ViewsContextValue = {
|
|
|
16
16
|
icons: ViewsIcons;
|
|
17
17
|
/** The app's ports, with `confirm` always a function (the browser's where the app handed none). */
|
|
18
18
|
ports: ViewsResolvedPorts;
|
|
19
|
+
/** No `confirm` of the app's and no `PortsHost` to draw ViewKit's: `ports.confirm` is the browser's own. A control that can ask
|
|
20
|
+
* in a dialog of its own (a view's menu, VK-823) asks there instead. */
|
|
21
|
+
confirmFallback: boolean;
|
|
22
|
+
/** No `toast` of the app's and no `PortsHost`: `ports.toast` draws nothing. A control that can say it through a Toast of its
|
|
23
|
+
* own standing round it (a view's menu) does so instead. */
|
|
24
|
+
toastFallback: boolean;
|
|
19
25
|
messages: ViewsMessageResolver;
|
|
20
26
|
conventions: FieldConventions;
|
|
21
27
|
/** The app's formatting: given the package's defaults, return the app's. */
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/** The provider's moment (`ViewsProvider`'s `now`, or its read of the clock after mount); null until it has one. */
|
|
2
|
+
export declare const MomentContext: import("react").Context<Date | null>;
|
|
3
|
+
/** Whether the provider has a moment yet. */
|
|
4
|
+
export declare const HasMomentContext: import("react").Context<boolean>;
|
|
5
|
+
export declare function useMoment(): Date | null;
|
|
6
|
+
export declare function useHasMoment(): boolean;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { createContext, useContext } from "react";
|
|
3
|
+
export const MomentContext = createContext(null);
|
|
4
|
+
export const HasMomentContext = createContext(false);
|
|
5
|
+
export function useMoment() {
|
|
6
|
+
return useContext(MomentContext);
|
|
7
|
+
}
|
|
8
|
+
export function useHasMoment() {
|
|
9
|
+
return useContext(HasMomentContext);
|
|
10
|
+
}
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
export type ViewsToastPort = {
|
|
2
|
-
|
|
2
|
+
/** `undo`: the act can be taken back; the toast offers Undo, which calls it. An app's toast may ignore it. */
|
|
3
|
+
success: (message: string, options?: {
|
|
4
|
+
undo?: () => void;
|
|
5
|
+
}) => void;
|
|
3
6
|
error: (message: string) => void;
|
|
4
7
|
info: (message: string) => void;
|
|
5
8
|
/** A change the person did not make — a value someone else wrote — said with a second line. */
|
|
@@ -33,25 +36,34 @@ export type ViewsConfirmRequest = {
|
|
|
33
36
|
confirmLabel: string;
|
|
34
37
|
/** What the act is done to, as the host names it (a row's `deleteLabel`). Absent when it names nothing. */
|
|
35
38
|
subject?: string;
|
|
39
|
+
/** One line under the question, on what follows (a view's delete: `deleteLine`). */
|
|
40
|
+
detail?: string;
|
|
36
41
|
/** The act removes something: the app draws its destructive look. */
|
|
37
42
|
destructive?: boolean;
|
|
38
43
|
};
|
|
39
44
|
/** Resolves to whether the person said yes. */
|
|
40
45
|
export type ViewsConfirmPort = (request: ViewsConfirmRequest) => Promise<boolean>;
|
|
41
46
|
export type ViewsPorts = {
|
|
42
|
-
|
|
47
|
+
/** What ViewKit reports. Absent: ViewKit's Toast where the components map hands `PortsHost` (CONTROLS does), else nothing. */
|
|
48
|
+
toast?: ViewsToastPort;
|
|
43
49
|
haptics: ViewsHapticsPort;
|
|
44
50
|
clipboard: ViewsClipboardPort;
|
|
45
51
|
viewPrefs: ViewsPrefsPort;
|
|
46
|
-
/** Asks before a destructive act (a row's Delete). Absent:
|
|
52
|
+
/** Asks before a destructive act (a row's Delete). Absent: ViewKit's alert dialog where the components map hands
|
|
53
|
+
* `PortsHost` (CONTROLS does), else the browser's own confirm with `message`. */
|
|
47
54
|
confirm?: ViewsConfirmPort;
|
|
48
55
|
};
|
|
49
|
-
/** The ports as the provider hands them on: `confirm` always there,
|
|
50
|
-
*
|
|
56
|
+
/** The ports as the provider hands them on: `toast` and `confirm` always there, `PortsHost`'s where the app handed none,
|
|
57
|
+
* else a toast that draws nothing and the browser's confirm. */
|
|
51
58
|
export type ViewsResolvedPorts = ViewsPorts & {
|
|
59
|
+
toast: ViewsToastPort;
|
|
52
60
|
confirm: ViewsConfirmPort;
|
|
53
61
|
};
|
|
54
62
|
/** The browser's own dialog, read when it is asked, so a server render never reaches `window`. */
|
|
55
63
|
export declare const browserConfirm: ViewsConfirmPort;
|
|
64
|
+
/** A toast that draws nothing: where an app hands none and nothing draws ViewKit's. */
|
|
65
|
+
export declare const NOOP_TOAST: ViewsToastPort;
|
|
56
66
|
/** Ports that do nothing: a server render, a test, an app without a device. */
|
|
57
|
-
export declare const NOOP_PORTS: ViewsPorts
|
|
67
|
+
export declare const NOOP_PORTS: ViewsPorts & {
|
|
68
|
+
toast: ViewsToastPort;
|
|
69
|
+
};
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
export const browserConfirm = async ({ message }) => window.confirm(message);
|
|
2
2
|
const _portsMatchContract = true;
|
|
3
3
|
void _portsMatchContract;
|
|
4
|
+
export const NOOP_TOAST = { success() { }, error() { }, info() { }, warning() { } };
|
|
4
5
|
export const NOOP_PORTS = {
|
|
5
|
-
toast:
|
|
6
|
+
toast: NOOP_TOAST,
|
|
6
7
|
haptics: { selection() { }, impact() { }, notification() { } },
|
|
7
8
|
clipboard: { writeText: async () => false, readText: async () => null },
|
|
8
9
|
viewPrefs: { get: () => undefined, set() { }, subscribe: () => () => { } },
|
package/views/dist/react.d.ts
CHANGED
|
@@ -5,9 +5,9 @@ export type { ViewsOneValueEditors } from "./model/one-value.js";
|
|
|
5
5
|
export type { ViewsBodyFrame, ViewsGridBodyPlace } from "./model/body-frame.js";
|
|
6
6
|
export { DEFAULT_DESKTOP_QUERY } from "./provider/desktop.js";
|
|
7
7
|
export type { ViewsSeveralValues } from "./display/fit-values.js";
|
|
8
|
-
export type { ViewsAlign, ViewsAnchor, ViewsBarPlacement, ViewsButtonProps, ViewsCalendarProps, ViewsCheckboxProps, ViewsCloseReason, ViewsCollapseProps, ViewsCommandParts, ViewsComponents, ViewsCustomizeBodyProps, ViewsCustomizeChoice, ViewsCustomizeColumn, ViewsCustomizeColumns, ViewsCustomizeLayout, ViewsCustomizePage, ViewsCustomizeToggle, ViewsDateBodyProps, ViewsDatePick, ViewsDatePicks, ViewsGridButtons, ViewsSelectionChip, ViewsGridCheckboxes, ViewsFieldRowButtons, ViewsFieldRowCheckboxes, ViewsPanelButtons, ViewsInputProps, ViewsFieldsBodyField, ViewsFieldsBodyProps, ViewsFilterBodyField, ViewsFilterBodyProps, ViewsFilterPartBodyProps, ViewsGroupBodyProps, ViewsGroupDimension, ViewsGroupEntry, ViewsGroupValue, ViewsMenuItem, ViewsMenuProps, ViewsMenuRoute, ViewsNumberBodyProps, ViewsOpenChange, ViewsPartsBodyProps, ViewsPickerAction, ViewsPickerItem, ViewsPickerProps, ViewsLink, ViewsLinkRole, ViewsLinksBodyProps, ViewsPlacePart, ViewsPlaceParts, ViewsPopoverProps, ViewsQuickFiltersBodyProps, ViewsResolvedComponents, ViewsRowsWaitProps, ViewsSearchFieldProps, ViewsSelectionBarSettings, ViewsSheetAction, ViewsSheetActions, ViewsBodyStep, ViewsSheetActionsPlace, ViewsSheetProps, ViewsSide, ViewsSortBodyProps, ViewsTextBodyProps, ViewsTooltipProps, ViewsValueLine, ViewsValuesBodyProps, ViewsViewsListBodyProps, ViewsViewsListItem, } from "./provider/components.js";
|
|
8
|
+
export type { ViewsAlign, ViewsAnchor, ViewsBarPlacement, ViewsButtonProps, ViewsCalendarProps, ViewsCheckboxProps, ViewsCloseReason, ViewsCollapseProps, ViewsCommandParts, ViewsComponents, ViewsCustomizeBodyProps, ViewsCustomizeChoice, ViewsCustomizeColumn, ViewsCustomizeColumns, ViewsCustomizeLayout, ViewsCustomizePage, ViewsCustomizeToggle, ViewsDateBodyProps, ViewsDatePick, ViewsDatePicks, ViewsGridButtons, ViewsSelectionChip, ViewsGridCheckboxes, ViewsFieldRowButtons, ViewsFieldRowCheckboxes, ViewsPanelButtons, ViewsInputProps, ViewsFieldsBodyField, ViewsFieldsBodyProps, ViewsFilterBodyField, ViewsFilterBodyProps, ViewsFilterPartBodyProps, ViewsGroupBodyProps, ViewsGroupDimension, ViewsGroupEntry, ViewsGroupValue, ViewsMenuItem, ViewsMenuProps, ViewsMenuRoute, ViewsNumberBodyProps, ViewsOpenChange, ViewsPartsBodyProps, ViewsPickerAction, ViewsPickerItem, ViewsPickerProps, ViewsLink, ViewsLinkRole, ViewsLinksBodyProps, ViewsPlacePart, ViewsPlaceParts, ViewsPopoverProps, ViewsPortsHostProps, ViewsSelectionBarProps, ViewsQuickFiltersBodyProps, ViewsResolvedComponents, ViewsRowsWaitProps, ViewsSearchFieldProps, ViewsSelectionBarSettings, ViewsSheetAction, ViewsSheetActions, ViewsBodyStep, ViewsSheetActionsPlace, ViewsSheetProps, ViewsSide, ViewsSortBodyProps, ViewsTextBodyProps, ViewsTooltipProps, ViewsValueLine, ViewsValuesBodyProps, ViewsViewsListBodyProps, ViewsViewsListItem, ViewsViewChange, ViewsViewLayout, ViewsViewRecord, ViewsViewVerbs, } from "./provider/components.js";
|
|
9
9
|
export type { ViewsIconProps, ViewsIcons } from "./provider/icons.js";
|
|
10
|
-
export { NOOP_PORTS } from "./provider/ports.js";
|
|
10
|
+
export { NOOP_PORTS, NOOP_TOAST } from "./provider/ports.js";
|
|
11
11
|
export type { ViewsClipboardPort, ViewsConfirmPort, ViewsConfirmRequest, ViewsHapticsPort, ViewsPorts, ViewsPrefsPort, ViewsResolvedPorts, ViewsToastPort, } from "./provider/ports.js";
|
|
12
12
|
export { DEFAULT_VIEWS_ATOMS } from "./atoms/defaults.js";
|
|
13
13
|
export type { ViewsAtoms, ViewsAvatarProps, ViewsCommandMenuProps, ViewsRowMenuItem, ViewsRowMenuProps, ViewsListProps, ViewsRelationLinkProps, ViewsRelationRolesProps, ViewsCellMoreProps, ViewsLoadingProps, ViewsLoadMoreProps, ViewsPlatformMarkProps, ViewsRowContentProps, ViewsRowProps, ViewsSelectionSheetProps, ViewsStatusBadgeProps, ViewsStatusOption, ViewsStatusPlace, ViewsStatusMarkerProps, ViewsTagProps, ViewsTickBoxProps, ViewsChoiceRowProps, ViewsCheckRowProps, ViewsRadioRowProps, ViewsDirectionButtonProps, ViewsMenuRowProps, ViewsToggleRowProps, ViewsPanelSearchProps, ViewsPillProps, ViewsRangeCalendarProps, ViewsToolbarButtonProps, ViewsToolbarButtonPart, } from "./atoms/types.js";
|
package/views/dist/react.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
export { ViewsProvider, useViews } from "./provider/ViewsProvider.js";
|
|
3
3
|
export { DEFAULT_DESKTOP_QUERY } from "./provider/desktop.js";
|
|
4
|
-
export { NOOP_PORTS } from "./provider/ports.js";
|
|
4
|
+
export { NOOP_PORTS, NOOP_TOAST } from "./provider/ports.js";
|
|
5
5
|
export { DEFAULT_VIEWS_ATOMS } from "./atoms/defaults.js";
|
|
@@ -1,18 +1,4 @@
|
|
|
1
1
|
import { type ReactNode } from "react";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
/** How many rows are selected. The bar draws nothing at zero. */
|
|
5
|
-
count: number;
|
|
6
|
-
/** Clears the selection: the count chip, the phone's ✕. */
|
|
7
|
-
onClear: () => void;
|
|
8
|
-
/** What the selection lets a person do, in order: the first four on the bar, the rest in More. */
|
|
9
|
-
verbs: readonly SelectionVerb[];
|
|
10
|
-
/** A batch is running: every control is disabled until it ends. */
|
|
11
|
-
busy?: boolean;
|
|
12
|
-
/** Deletes the selection. The bar's own verb, drawn as the trailing trash in the same place on every list;
|
|
13
|
-
* never a verb in `verbs`. A list with no bulk delete leaves it out. */
|
|
14
|
-
onDelete?: () => void;
|
|
15
|
-
/** The trash's accessible name and tooltip. Default: the `views.selection.delete` message. */
|
|
16
|
-
deleteLabel?: string;
|
|
17
|
-
};
|
|
2
|
+
export type { SelectionBarProps } from "./bar-props.js";
|
|
3
|
+
import type { SelectionBarProps } from "./bar-props.js";
|
|
18
4
|
export declare function SelectionBar(props: SelectionBarProps): ReactNode;
|
|
@@ -14,12 +14,15 @@ import { SelectionBarPhone } from "./SelectionBarPhone.js";
|
|
|
14
14
|
const DEFAULT_BOTTOM = "calc(1rem + env(safe-area-inset-bottom))";
|
|
15
15
|
const DEFAULT_LAYER = 50;
|
|
16
16
|
export function SelectionBar(props) {
|
|
17
|
-
const { selectionBar } = useViews();
|
|
17
|
+
const { selectionBar, components } = useViews();
|
|
18
|
+
const Own = components.SelectionBar;
|
|
18
19
|
const barRoomRef = useContext(BarRoomContext);
|
|
19
20
|
const desktop = useDesktop();
|
|
20
21
|
const phoneQuery = selectionBar?.phoneQuery;
|
|
21
22
|
const phoneByQuery = useMediaQuery(phoneQuery ?? "not all", false);
|
|
22
23
|
const phone = phoneQuery ? phoneByQuery : !desktop;
|
|
24
|
+
if (Own)
|
|
25
|
+
return _jsx(Own, { ...props });
|
|
23
26
|
if (props.count === 0 || typeof document === "undefined")
|
|
24
27
|
return null;
|
|
25
28
|
const placement = phone ? selectionBar?.phone : selectionBar?.desktop;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { ReactNode } from "react";
|
|
2
|
+
import type { SelectionRun, SelectionVerb } from "./verbs.js";
|
|
3
|
+
export type SelectionBarProps = {
|
|
4
|
+
/** How many rows are selected. ViewKit's own bar draws nothing at zero; the components map's stays, leaving. */
|
|
5
|
+
count: number;
|
|
6
|
+
/** What a row is, one and many ("deal", "deals"), for the components map's bar ("3 deals selected"). Left out, its own
|
|
7
|
+
* (the `views.selection.noun-one` and `noun-other` messages). ViewKit's own bar doesn't read it. */
|
|
8
|
+
noun?: {
|
|
9
|
+
one: string;
|
|
10
|
+
other: string;
|
|
11
|
+
};
|
|
12
|
+
/** Clears the selection: the count chip, the phone's ✕. */
|
|
13
|
+
onClear: () => void;
|
|
14
|
+
/** What the selection lets a person do, in order: the first four on the bar, the rest in More. */
|
|
15
|
+
verbs: readonly SelectionVerb[];
|
|
16
|
+
/** A batch is running: every control is disabled until it ends. */
|
|
17
|
+
busy?: boolean;
|
|
18
|
+
/** Deletes the selection. The bar's own verb, drawn as the trailing trash in the same place on every list;
|
|
19
|
+
* never a verb in `verbs`. A list with no bulk delete leaves it out. The components map's bar (CONTROLS') asks first,
|
|
20
|
+
* then calls it, and shows what it hands back; ViewKit's own calls it at once. */
|
|
21
|
+
onDelete?: SelectionRun;
|
|
22
|
+
/** The trash's accessible name and tooltip. Default: the `views.selection.delete` message. */
|
|
23
|
+
deleteLabel?: string;
|
|
24
|
+
/** The line under the components map's question ("They move to the trash."). ViewKit's own bar asks nothing. */
|
|
25
|
+
deleteLine?: ReactNode;
|
|
26
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export type { ListBatchApi, ListSelectionConfig } from "./types.js";
|
|
2
2
|
export { SelectionBar, type SelectionBarProps } from "./SelectionBar.js";
|
|
3
|
-
export type { SelectionOptionsVerb, SelectionVerb, SelectionVerbItem } from "./verbs.js";
|
|
3
|
+
export type { SelectionDone, SelectionOptionsVerb, SelectionRun, SelectionVerb, SelectionVerbItem } from "./verbs.js";
|
|
4
4
|
export { SelectCheckbox } from "./SelectCheckbox.js";
|
|
5
5
|
export { useCheckDragSelect, ROW_CHECK_ATTR } from "./useCheckDragSelect.js";
|
|
6
6
|
export { preventShiftTextSelect, selectFromClick, ROW_INTERACTIVE_SELECTOR, ROW_NO_TEXT_SELECT, ROW_OPEN_STOP_SELECTOR, } from "./row-click.js";
|
|
@@ -1,11 +1,21 @@
|
|
|
1
1
|
import type { ReactNode } from "react";
|
|
2
|
-
import type {
|
|
2
|
+
import type { ViewsPickerItem } from "../provider/components.js";
|
|
3
|
+
/** What a press hands back, for the bar that shows it (CONTROLS.SelectionBar's): what its Toast says, and how it is taken back.
|
|
4
|
+
* Nothing: no Toast. ViewKit's own bar shows none either way. */
|
|
5
|
+
export type SelectionDone = {
|
|
6
|
+
words: string;
|
|
7
|
+
undo?: () => void;
|
|
8
|
+
};
|
|
9
|
+
/** A press: done at once, or once its promise settles; one that throws or rejects is a press that didn't go through. What it
|
|
10
|
+
* hands back is read only where it is a `SelectionDone` (or a promise of one), so a press that returns anything else, as
|
|
11
|
+
* `() => list.push(id)` does, is still one. */
|
|
12
|
+
export type SelectionRun = () => unknown;
|
|
3
13
|
/** One verb, or one row of a `group`. */
|
|
4
14
|
export type SelectionVerbItem = {
|
|
5
15
|
label: string;
|
|
6
16
|
/** The app's glyph, drawn before the words. */
|
|
7
17
|
icon?: ReactNode;
|
|
8
|
-
onClick:
|
|
18
|
+
onClick: SelectionRun;
|
|
9
19
|
/** A verb that undoes or removes something (Cancel, Disconnect): drawn in the danger colour. Delete
|
|
10
20
|
* itself is the bar's own `onDelete`, never a verb. */
|
|
11
21
|
destructive?: boolean;
|
|
@@ -14,7 +24,7 @@ export type SelectionVerbItem = {
|
|
|
14
24
|
disabledReason?: string;
|
|
15
25
|
};
|
|
16
26
|
/** "Set this field on every selected row": the field's values as their badges, the same rows a cell's
|
|
17
|
-
* editor picks from.
|
|
27
|
+
* editor picks from. ViewKit's own bar marks no current value: the rows may already hold several. */
|
|
18
28
|
export type SelectionOptionsVerb = {
|
|
19
29
|
kind: "options";
|
|
20
30
|
label: string;
|
|
@@ -22,17 +32,34 @@ export type SelectionOptionsVerb = {
|
|
|
22
32
|
disabled?: boolean;
|
|
23
33
|
/** Why it is disabled, in the person's words: More's rows, the bar's button and the phone sheet carry it. */
|
|
24
34
|
disabledReason?: string;
|
|
25
|
-
|
|
26
|
-
|
|
35
|
+
/** Its values: a status by its `slot`, a category by its `color`, a person or a company by `avatarUrl` (null: their initials)
|
|
36
|
+
* and `kind`. ViewKit's own bar reads the value, the label, the slot and the colour. */
|
|
37
|
+
options: ViewsPickerItem[];
|
|
38
|
+
/** Kept off the bar, in More (CONTROLS.SelectionBar's bar). */
|
|
39
|
+
more?: boolean;
|
|
40
|
+
/** What every picked row holds, when they hold the same: a value, or null when every one is empty; left out, they differ.
|
|
41
|
+
* CONTROLS.SelectionBar's bar marks it. */
|
|
42
|
+
value?: string | null;
|
|
43
|
+
/** The empty row's words ("No owner"): a pick of it calls `onEmpty`. Left out, the field can't be emptied. */
|
|
44
|
+
empty?: string;
|
|
45
|
+
/** Empties the field on every picked row: the empty row's press, where `empty` is handed. */
|
|
46
|
+
onEmpty?: SelectionRun;
|
|
47
|
+
/** What its search says before anything is typed ("Search people"); left out, no search. */
|
|
48
|
+
search?: string;
|
|
49
|
+
/** A pick sets every picked row to the value picked. What it hands back is read as `SelectionRun`'s is. */
|
|
50
|
+
onSelect: (value: string) => unknown;
|
|
27
51
|
};
|
|
28
52
|
/** A verb on the bar: a direct `action`, a `group` that opens a small menu of related verbs, or an
|
|
29
53
|
* `options` verb whose values are picked as badges. */
|
|
30
54
|
export type SelectionVerb = ({
|
|
31
55
|
kind: "action";
|
|
56
|
+
more?: boolean;
|
|
32
57
|
} & SelectionVerbItem) | {
|
|
33
58
|
kind: "group";
|
|
34
59
|
label: string;
|
|
35
60
|
icon?: ReactNode;
|
|
61
|
+
/** Kept off the bar, in More (CONTROLS.SelectionBar's bar). */
|
|
62
|
+
more?: boolean;
|
|
36
63
|
disabled?: boolean;
|
|
37
64
|
/** Why the group is disabled: its own button and More's row carry it, and so does each of its rows that
|
|
38
65
|
* gives none. */
|