viewkitjs 0.31.0 → 0.33.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 +198 -0
- package/MIGRATION.md +40 -6
- package/README.md +1 -1
- package/fields/dist/index.d.ts +1 -1
- package/fields/dist/index.js +1 -1
- package/fields/dist/query/evaluate.d.ts +7 -0
- package/fields/dist/query/exact-number.d.ts +8 -2
- package/fields/dist/query/exact-number.js +14 -1
- package/fields/dist/query/index.d.ts +2 -0
- package/fields/dist/query/index.js +2 -0
- package/fields/dist/query/list-request.d.ts +148 -0
- package/fields/dist/query/list-request.js +125 -0
- package/fields/dist/query/saved-view.d.ts +15 -0
- package/fields/dist/query/saved-view.js +11 -0
- package/fields/dist/query/settings.d.ts +9 -0
- package/fields/dist/query/settings.js +9 -0
- package/fields/dist/query/sort.js +13 -10
- package/fields/dist/registry.js +5 -1
- package/fields/dist/types.d.ts +4 -1
- package/fields/dist/zod.d.ts +5 -0
- package/fields/dist/zod.js +10 -1
- package/fields/docs/guides/contact-values.md +12 -0
- package/fields/docs/guides/field-types.md +1 -1
- package/fields/docs/guides/queries.md +3 -1
- package/fields/docs/reference/fields.md +1 -0
- package/fields/docs/reference/query.md +66 -0
- package/package.json +5 -1
- package/postgres/README.md +1 -0
- package/postgres/dist/check.js +4 -1
- package/postgres/dist/definitions/formula-forms.js +3 -1
- package/postgres/dist/definitions/money.js +2 -1
- package/postgres/dist/handler.d.ts +53 -0
- package/postgres/dist/handler.js +211 -0
- package/postgres/dist/ids.d.ts +1 -1
- package/postgres/dist/ids.js +19 -1
- package/postgres/dist/index.d.ts +1 -0
- package/postgres/dist/index.js +1 -0
- package/postgres/dist/limits.d.ts +3 -1
- package/postgres/dist/limits.js +1 -1
- package/postgres/dist/list-fields.d.ts +10 -0
- package/postgres/dist/list-fields.js +36 -0
- package/postgres/dist/page.js +6 -3
- package/postgres/dist/readable.d.ts +4 -0
- package/postgres/dist/readable.js +4 -0
- package/postgres/dist/refusals.d.ts +9 -2
- package/postgres/dist/refusals.js +6 -0
- package/postgres/dist/rules.d.ts +15 -1
- package/postgres/dist/rules.js +16 -0
- package/postgres/dist/sort.js +7 -2
- package/postgres/docs/guides/definitions.md +1 -1
- package/postgres/docs/guides/field-map.md +3 -3
- package/postgres/docs/guides/list-handler.md +99 -0
- package/postgres/docs/index.md +1 -0
- package/postgres/docs/reference/definitions.md +1 -1
- package/postgres/docs/reference/postgres.md +12 -4
- package/views/README.md +2 -2
- package/views/dist/atoms/RowMenu.d.ts +7 -0
- package/views/dist/atoms/RowMenu.js +18 -16
- package/views/dist/atoms/ToolbarButton.d.ts +1 -1
- package/views/dist/atoms/ToolbarButton.js +4 -3
- package/views/dist/atoms/carried.d.ts +5 -0
- package/views/dist/atoms/carried.js +7 -0
- package/views/dist/atoms/frame-parts.d.ts +6 -0
- package/views/dist/atoms/frame-parts.js +15 -0
- package/views/dist/atoms/types.d.ts +19 -7
- package/views/dist/cells/cell-title.d.ts +3 -1
- package/views/dist/cells/cell-title.js +2 -2
- package/views/dist/cells/cell-values.js +2 -2
- package/views/dist/contract.d.ts +56 -11
- package/views/dist/contract.js +148 -0
- package/views/dist/controls/alert-dialog/alert-dialog.js +2 -1
- package/views/dist/controls/atoms.d.ts +2 -0
- package/views/dist/controls/atoms.js +2 -0
- package/views/dist/controls/avatar/avatar.d.ts +3 -3
- package/views/dist/controls/avatar/avatar.js +1 -1
- package/views/dist/controls/avatar/tokens.d.ts +44 -0
- package/views/dist/controls/avatar/tokens.js +11 -0
- package/views/dist/controls/avatar.css +22 -5
- package/views/dist/controls/button/map-button.js +2 -0
- package/views/dist/controls/checkbox/checkbox.d.ts +3 -2
- package/views/dist/controls/checkbox/checkbox.js +2 -2
- package/views/dist/controls/choice/tokens.d.ts +0 -4
- package/views/dist/controls/choice/tokens.js +0 -1
- package/views/dist/controls/choice.css +3 -3
- package/views/dist/controls/compound-editor/compound-editor.d.ts +1 -1
- package/views/dist/controls/compound-editor/name-parts.js +4 -4
- package/views/dist/controls/compound-editor/place-parts.js +19 -19
- package/views/dist/controls/compound-editor/range-parts.js +14 -14
- package/views/dist/controls/compound-editor/row.d.ts +3 -1
- package/views/dist/controls/compound-editor/row.js +2 -2
- package/views/dist/controls/controls.d.ts +8 -0
- package/views/dist/controls/controls.js +12 -2
- package/views/dist/controls/customize/customize.js +37 -35
- package/views/dist/controls/customize/map-customize-body.d.ts +2 -0
- package/views/dist/controls/customize/map-customize-body.js +5 -1
- package/views/dist/controls/date-editor/date-days.js +2 -2
- package/views/dist/controls/date-editor/date-editor.js +18 -18
- package/views/dist/controls/date-editor/date-parts.js +6 -6
- package/views/dist/controls/date-editor/map-calendar.js +1 -1
- package/views/dist/controls/date-editor.css +2 -2
- package/views/dist/controls/field/field.d.ts +22 -4
- package/views/dist/controls/field/field.js +63 -5
- package/views/dist/controls/field/tokens.d.ts +4 -0
- package/views/dist/controls/field/tokens.js +1 -0
- package/views/dist/controls/field.css +41 -16
- package/views/dist/controls/filter-editor/block.d.ts +2 -2
- package/views/dist/controls/filter-editor/block.js +5 -5
- package/views/dist/controls/filter-editor/filter-editor.js +31 -33
- package/views/dist/controls/filter-editor/how.d.ts +3 -1
- package/views/dist/controls/filter-editor/map-filter-body.d.ts +1 -0
- package/views/dist/controls/filter-editor/map-filter-body.js +7 -3
- package/views/dist/controls/filter-editor/map-rules.js +1 -1
- package/views/dist/controls/filter-editor/parts.js +2 -1
- package/views/dist/controls/glyphs/glyphs.d.ts +10 -0
- package/views/dist/controls/glyphs/glyphs.js +173 -0
- package/views/dist/controls/group-editor/group-editor.js +15 -13
- package/views/dist/controls/index.d.ts +4 -1
- package/views/dist/controls/index.js +3 -1
- package/views/dist/controls/input/input.js +6 -3
- package/views/dist/controls/input/map-input.js +2 -0
- package/views/dist/controls/input/tokens.d.ts +4 -0
- package/views/dist/controls/input/tokens.js +1 -0
- package/views/dist/controls/input.css +31 -3
- package/views/dist/controls/internal/editor-parts.js +1 -1
- package/views/dist/controls/internal/icons.js +10 -0
- package/views/dist/controls/internal/keep-focus.d.ts +2 -0
- package/views/dist/controls/internal/keep-focus.js +17 -0
- package/views/dist/controls/internal/map-panel-controls.d.ts +8 -0
- package/views/dist/controls/internal/map-panel-controls.js +20 -0
- package/views/dist/controls/internal/panel-controls.d.ts +50 -0
- package/views/dist/controls/internal/panel-controls.js +197 -0
- package/views/dist/controls/internal/part-slot.d.ts +12 -0
- package/views/dist/controls/internal/part-slot.js +5 -0
- package/views/dist/controls/internal/watch-frame.d.ts +2 -0
- package/views/dist/controls/internal/watch-frame.js +33 -0
- package/views/dist/controls/links-editor/links-editor.d.ts +1 -1
- package/views/dist/controls/links-editor/links-editor.js +27 -27
- package/views/dist/controls/markdown/map-markdown.d.ts +4 -0
- package/views/dist/controls/markdown/map-markdown.js +5 -0
- package/views/dist/controls/menu/map-menu.d.ts +2 -2
- package/views/dist/controls/menu/map-menu.js +15 -12
- package/views/dist/controls/menu/menu.d.ts +2 -0
- package/views/dist/controls/menu/menu.js +3 -3
- package/views/dist/controls/menu-list/menu-list.d.ts +17 -4
- package/views/dist/controls/menu-list/menu-list.js +27 -25
- package/views/dist/controls/modal/modal.js +5 -1
- package/views/dist/controls/notice/notice.d.ts +3 -1
- package/views/dist/controls/notice/notice.js +2 -2
- package/views/dist/controls/number-editor/number-editor.d.ts +1 -1
- package/views/dist/controls/number-editor/number-editor.js +13 -13
- package/views/dist/controls/number-field/number-field.js +5 -3
- package/views/dist/controls/pane/pane.d.ts +4 -2
- package/views/dist/controls/pane/pane.js +6 -5
- package/views/dist/controls/phone-header/header-bar.d.ts +5 -1
- package/views/dist/controls/phone-header/header-bar.js +2 -2
- package/views/dist/controls/phone-header.css +11 -1
- package/views/dist/controls/picker/map-picker.js +3 -0
- package/views/dist/controls/picker/picker.d.ts +16 -0
- package/views/dist/controls/picker/picker.js +61 -40
- package/views/dist/controls/picker/rows.d.ts +4 -0
- package/views/dist/controls/picker.css +2 -0
- package/views/dist/controls/popover/map-popover.d.ts +1 -1
- package/views/dist/controls/popover/map-popover.js +4 -2
- package/views/dist/controls/popover/popover.js +2 -1
- package/views/dist/controls/quick-filters/quick-filters.js +4 -4
- package/views/dist/controls/radio/radio.d.ts +8 -3
- package/views/dist/controls/radio/radio.js +22 -5
- package/views/dist/controls/radio/tokens.d.ts +44 -0
- package/views/dist/controls/radio/tokens.js +11 -0
- package/views/dist/controls/radio.css +79 -1
- package/views/dist/controls/select/map-select.d.ts +3 -0
- package/views/dist/controls/select/map-select.js +8 -0
- package/views/dist/controls/select/select.d.ts +7 -0
- package/views/dist/controls/select/select.js +12 -6
- package/views/dist/controls/select/tokens.d.ts +8 -0
- package/views/dist/controls/select/tokens.js +2 -0
- package/views/dist/controls/select.css +17 -0
- package/views/dist/controls/setting-row/looks.d.ts +1 -1
- package/views/dist/controls/setting-row/looks.js +9 -4
- package/views/dist/controls/setting-row/setting-row.d.ts +45 -10
- package/views/dist/controls/setting-row/setting-row.js +82 -15
- package/views/dist/controls/setting-row/tokens.d.ts +74 -2
- package/views/dist/controls/setting-row/tokens.js +19 -1
- package/views/dist/controls/setting-row.css +135 -14
- package/views/dist/controls/sheet/bottom-sheet.d.ts +14 -2
- package/views/dist/controls/sheet/bottom-sheet.js +6 -3
- package/views/dist/controls/sheet/map-sheet.js +1 -1
- package/views/dist/controls/sheet.css +4 -1
- package/views/dist/controls/sort-editor/map-sort-body.d.ts +1 -0
- package/views/dist/controls/sort-editor/map-sort-body.js +7 -3
- package/views/dist/controls/sort-editor/sort-editor.js +25 -26
- package/views/dist/controls/sort-editor.css +13 -2
- package/views/dist/controls/switch-row/tokens.d.ts +0 -12
- package/views/dist/controls/switch-row/tokens.js +0 -3
- package/views/dist/controls/switch-row.css +3 -7
- package/views/dist/controls/switch.css +17 -7
- package/views/dist/controls/tag/tag.d.ts +3 -1
- package/views/dist/controls/tag/tag.js +2 -2
- package/views/dist/controls/tag/tokens.d.ts +4 -0
- package/views/dist/controls/tag/tokens.js +1 -0
- package/views/dist/controls/tag-field/tag-field.d.ts +5 -1
- package/views/dist/controls/tag-field/tag-field.js +11 -5
- package/views/dist/controls/tag-field/tokens.d.ts +16 -0
- package/views/dist/controls/tag-field/tokens.js +4 -0
- package/views/dist/controls/tag-field.css +19 -0
- package/views/dist/controls/tag.css +2 -0
- package/views/dist/controls/text-editor/text-editor.d.ts +1 -1
- package/views/dist/controls/text-editor/text-editor.js +8 -8
- package/views/dist/controls/toolbar/toolbar.d.ts +15 -3
- package/views/dist/controls/toolbar/toolbar.js +22 -15
- package/views/dist/controls/toolbar-button/atom-toolbar-button.d.ts +14 -0
- package/views/dist/controls/toolbar-button/atom-toolbar-button.js +52 -0
- package/views/dist/controls/toolbar-button/toolbar-button.d.ts +1 -1
- package/views/dist/controls/toolbar-button/toolbar-button.js +2 -3
- package/views/dist/controls/toolbar-button.css +4 -0
- package/views/dist/controls/toolbar.css +5 -0
- package/views/dist/controls/values-editor/values-editor.d.ts +1 -1
- package/views/dist/controls/values-editor/values-editor.js +22 -22
- package/views/dist/controls/views-list/map-view-menu.d.ts +3 -0
- package/views/dist/controls/views-list/map-view-menu.js +25 -0
- package/views/dist/controls/views-list/map-views-list-body.d.ts +28 -1
- package/views/dist/controls/views-list/map-views-list-body.js +39 -21
- package/views/dist/controls/views-list/rules.d.ts +2 -0
- package/views/dist/controls/views-list/view-menu.d.ts +7 -0
- package/views/dist/controls/views-list/view-menu.js +33 -29
- package/views/dist/controls/views-list/views-list.js +4 -4
- package/views/dist/controls/views-list/words.d.ts +2 -0
- package/views/dist/controls/views-list/words.js +1 -1
- package/views/dist/editors/EditorPanel.js +3 -2
- package/views/dist/editors/edit-session.js +2 -5
- package/views/dist/field-row/FieldRow.d.ts +4 -2
- package/views/dist/field-row/FieldRow.js +80 -20
- package/views/dist/field-row/FieldRowLane.d.ts +7 -2
- package/views/dist/field-row/FieldRowLane.js +4 -3
- package/views/dist/field-row/editors/RowEditor.d.ts +12 -0
- package/views/dist/field-row/editors/RowEditor.js +31 -1
- package/views/dist/field-row/editors/RowValueListEditor.d.ts +5 -1
- package/views/dist/field-row/editors/RowValueListEditor.js +4 -1
- package/views/dist/field-row/field-row-button.d.ts +5 -0
- package/views/dist/field-row/field-row-button.js +2 -0
- package/views/dist/fields/binding.d.ts +3 -2
- package/views/dist/fields/binding.js +38 -5
- package/views/dist/fields/money.d.ts +5 -2
- package/views/dist/fields/money.js +14 -2
- package/views/dist/grid/chrome/GridColumnMenu.d.ts +4 -2
- package/views/dist/grid/chrome/GridColumnMenu.js +3 -2
- package/views/dist/grid/chrome/GridGroupMenu.d.ts +4 -1
- package/views/dist/grid/chrome/GridGroupMenu.js +4 -3
- package/views/dist/grid/chrome/GridHeader.d.ts +4 -1
- package/views/dist/grid/chrome/GridHeader.js +2 -2
- package/views/dist/grid/chrome/GridRow.js +6 -5
- package/views/dist/grid/chrome/GridRowCells.js +6 -9
- package/views/dist/grid/chrome/GridStructure.d.ts +4 -1
- package/views/dist/grid/chrome/GridStructure.js +4 -4
- package/views/dist/grid/chrome/GridTable.js +9 -3
- package/views/dist/grid/chrome/cell-clipboard.d.ts +4 -2
- package/views/dist/grid/chrome/cell-clipboard.js +2 -2
- package/views/dist/grid/chrome/cells.js +3 -1
- package/views/dist/grid/chrome/grid-column-menu-items.js +1 -1
- package/views/dist/grid/chrome/grid-row-menu-items.d.ts +27 -3
- package/views/dist/grid/chrome/grid-row-menu-items.js +93 -7
- package/views/dist/grid/chrome/grid-row-props.d.ts +7 -2
- package/views/dist/grid/chrome/grid-rows-menu.js +34 -6
- package/views/dist/grid/chrome/grid-table-props.d.ts +38 -7
- package/views/dist/grid/chrome/useGridBatchApi.d.ts +3 -1
- package/views/dist/grid/chrome/useGridBatchApi.js +4 -2
- package/views/dist/grid/chrome/useGridKeyboard.d.ts +7 -2
- package/views/dist/grid/chrome/useGridKeyboard.js +43 -14
- package/views/dist/grid/chrome/useGridPendingReconciliation.js +1 -2
- package/views/dist/grid/chrome/useGridTableInteractionModel.d.ts +1 -1
- package/views/dist/grid/chrome/useGridTableInteractionModel.js +20 -7
- package/views/dist/grid/core/clipboard-model.d.ts +3 -1
- package/views/dist/grid/core/clipboard-model.js +9 -8
- package/views/dist/grid/core/commit-model.d.ts +20 -2
- package/views/dist/grid/core/editing-controller.d.ts +21 -0
- package/views/dist/grid/core/editing-controller.js +194 -42
- package/views/dist/grid/core/editing-model.d.ts +3 -0
- package/views/dist/grid/core/editing-model.js +3 -0
- package/views/dist/grid/core/edits-sink.d.ts +19 -0
- package/views/dist/grid/core/edits-sink.js +2 -0
- package/views/dist/grid/core/save-path.d.ts +24 -0
- package/views/dist/grid/core/save-path.js +122 -0
- package/views/dist/grid/core/spreadsheet-operations.d.ts +3 -0
- package/views/dist/grid/core/spreadsheet-operations.js +24 -1
- package/views/dist/grid/core/useGridEditing.d.ts +5 -0
- package/views/dist/grid/core/useGridEditing.js +6 -0
- package/views/dist/grid/index.d.ts +3 -2
- package/views/dist/grid/index.js +1 -0
- package/views/dist/internal/field-rows.d.ts +26 -0
- package/views/dist/internal/field-rows.js +8 -0
- package/views/dist/internal/page-close.d.ts +7 -0
- package/views/dist/internal/page-close.js +43 -0
- package/views/dist/list/answer.d.ts +40 -0
- package/views/dist/list/answer.js +43 -0
- package/views/dist/list/browser-views-store.d.ts +10 -0
- package/views/dist/list/browser-views-store.js +182 -0
- package/views/dist/list/bulk-bar.d.ts +7 -0
- package/views/dist/list/bulk-bar.js +10 -0
- package/views/dist/list/columns.d.ts +24 -0
- package/views/dist/list/columns.js +27 -0
- package/views/dist/list/edits.d.ts +19 -0
- package/views/dist/list/edits.js +56 -0
- package/views/dist/list/grid.d.ts +11 -0
- package/views/dist/list/grid.js +76 -0
- package/views/dist/list/index.d.ts +36 -0
- package/views/dist/list/index.js +11 -0
- package/views/dist/list/link.d.ts +8 -0
- package/views/dist/list/link.js +78 -0
- package/views/dist/list/list.d.ts +70 -0
- package/views/dist/list/list.js +14 -0
- package/views/dist/list/menu.d.ts +31 -0
- package/views/dist/list/menu.js +76 -0
- package/views/dist/list/parts.d.ts +6 -0
- package/views/dist/list/parts.js +66 -0
- package/views/dist/list/registry.d.ts +11 -0
- package/views/dist/list/registry.js +31 -0
- package/views/dist/list/root-base.d.ts +46 -0
- package/views/dist/list/root-base.js +137 -0
- package/views/dist/list/root.d.ts +41 -0
- package/views/dist/list/root.js +168 -0
- package/views/dist/list/slot.d.ts +14 -0
- package/views/dist/list/slot.js +22 -0
- package/views/dist/list/source-answers.d.ts +39 -0
- package/views/dist/list/source-answers.js +225 -0
- package/views/dist/list/source.d.ts +11 -0
- package/views/dist/list/source.js +31 -0
- package/views/dist/list/store.d.ts +119 -0
- package/views/dist/list/store.js +146 -0
- package/views/dist/list/toolbar.d.ts +7 -0
- package/views/dist/list/toolbar.js +371 -0
- package/views/dist/list/views-axis.d.ts +5 -0
- package/views/dist/list/views-axis.js +98 -0
- package/views/dist/list/views-store.d.ts +41 -0
- package/views/dist/list/views-store.js +1 -0
- package/views/dist/list/views.d.ts +72 -0
- package/views/dist/list/views.js +411 -0
- package/views/dist/model/column-capabilities.d.ts +13 -0
- package/views/dist/model/column-capabilities.js +23 -2
- package/views/dist/model/column-schema.d.ts +11 -1
- package/views/dist/model/preferences.js +1 -1
- package/views/dist/model/prefs-buckets.js +1 -1
- package/views/dist/model/view-rules.js +1 -0
- package/views/dist/panels/index.d.ts +3 -1
- package/views/dist/panels/index.js +1 -0
- package/views/dist/panels/model.d.ts +2 -0
- package/views/dist/panels/react/customize-body.js +1 -0
- package/views/dist/panels/react/toolbar/ReadyToolbar.d.ts +47 -4
- package/views/dist/panels/react/toolbar/ReadyToolbar.js +6 -326
- package/views/dist/panels/react/toolbar/Toolbar.d.ts +17 -2
- package/views/dist/panels/react/toolbar/Toolbar.js +43 -23
- package/views/dist/panels/react/toolbar/ToolbarAdvancedFilters.js +1 -1
- package/views/dist/panels/react/toolbar/ToolbarAsideFilter.js +2 -2
- package/views/dist/panels/react/toolbar/ToolbarBarFilter.js +4 -4
- package/views/dist/panels/react/toolbar/ToolbarButton.js +7 -1
- package/views/dist/panels/react/toolbar/ToolbarFilter.js +1 -1
- package/views/dist/panels/react/toolbar/ToolbarFilterAdd.js +1 -1
- package/views/dist/panels/react/toolbar/ToolbarFilterSheet.js +1 -1
- package/views/dist/panels/react/toolbar/ToolbarFilters.js +2 -2
- package/views/dist/panels/react/toolbar/ToolbarNew.js +2 -2
- package/views/dist/panels/react/toolbar/ToolbarOptions.js +1 -1
- package/views/dist/panels/react/toolbar/ToolbarQuickFilters.d.ts +2 -2
- package/views/dist/panels/react/toolbar/ToolbarQuickFilters.js +3 -1
- package/views/dist/panels/react/toolbar/ToolbarSearch.js +1 -1
- package/views/dist/panels/react/toolbar/ToolbarSort.js +2 -2
- package/views/dist/panels/react/toolbar/ToolbarSortPill.js +6 -4
- package/views/dist/panels/react/toolbar/context.d.ts +20 -3
- package/views/dist/panels/react/toolbar/context.js +3 -1
- package/views/dist/panels/react/toolbar/panel-part.d.ts +4 -1
- package/views/dist/panels/react/toolbar/panel-part.js +5 -3
- package/views/dist/panels/react/views-row/FoldingViewRow.d.ts +1 -1
- package/views/dist/panels/react/views-row/FoldingViewRow.js +15 -4
- package/views/dist/panels/react/views-row/PillGroup.d.ts +5 -2
- package/views/dist/panels/react/views-row/PillGroup.js +16 -7
- package/views/dist/panels/react/views-row/ViewPicker.js +2 -12
- package/views/dist/panels/react/views-row/ViewPickerRow.d.ts +4 -2
- package/views/dist/panels/react/views-row/ViewPickerRow.js +9 -5
- package/views/dist/panels/react.d.ts +2 -2
- package/views/dist/panels/settings/filter-groups.js +6 -1
- package/views/dist/panels/toolbar/edit-view.d.ts +7 -1
- package/views/dist/panels/toolbar/edit-view.js +14 -0
- package/views/dist/panels/toolbar/model.d.ts +5 -0
- package/views/dist/panels/toolbar/model.js +7 -3
- package/views/dist/panels/view-state.d.ts +5 -3
- package/views/dist/panels/views-row/model.d.ts +19 -2
- package/views/dist/panels/views-row/model.js +14 -0
- package/views/dist/provider/ViewsProvider.d.ts +21 -8
- package/views/dist/provider/ViewsProvider.js +40 -5
- package/views/dist/provider/components.d.ts +102 -2
- package/views/dist/provider/components.js +1 -1
- package/views/dist/provider/context.d.ts +6 -2
- package/views/dist/provider/context.js +1 -1
- package/views/dist/provider/own-control.d.ts +4 -0
- package/views/dist/provider/own-control.js +7 -0
- package/views/dist/provider/ports.d.ts +19 -12
- package/views/dist/provider/ports.js +69 -1
- package/views/dist/provider/select-items.d.ts +3 -0
- package/views/dist/provider/select-items.js +6 -0
- package/views/dist/react.d.ts +4 -2
- package/views/dist/react.js +2 -0
- package/views/dist/styles.css +503 -136
- package/views/dist/styles.unlayered.css +503 -136
- package/views/docs/contract.md +292 -34
- package/views/docs/controls/avatar.md +11 -0
- package/views/docs/controls/choice.md +0 -1
- package/views/docs/controls/compound-editor.md +4 -0
- package/views/docs/controls/customize.md +6 -0
- package/views/docs/controls/date-editor.md +4 -0
- package/views/docs/controls/field.md +7 -0
- package/views/docs/controls/filter-editor.md +8 -0
- package/views/docs/controls/group-editor.md +6 -0
- package/views/docs/controls/input.md +5 -0
- package/views/docs/controls/links-editor.md +4 -0
- package/views/docs/controls/menu-list.md +8 -0
- package/views/docs/controls/menu.md +4 -0
- package/views/docs/controls/notice.md +4 -0
- package/views/docs/controls/number-editor.md +4 -0
- package/views/docs/controls/pane.md +4 -0
- package/views/docs/controls/picker.md +8 -0
- package/views/docs/controls/quick-filters.md +6 -0
- package/views/docs/controls/radio.md +20 -1
- package/views/docs/controls/select.md +10 -0
- package/views/docs/controls/setting-row.md +18 -0
- package/views/docs/controls/sheet.md +4 -0
- package/views/docs/controls/sort-editor.md +8 -0
- package/views/docs/controls/switch-row.md +0 -3
- package/views/docs/controls/tag-field.md +4 -0
- package/views/docs/controls/tag.md +1 -0
- package/views/docs/controls/text-editor.md +4 -0
- package/views/docs/controls/values-editor.md +4 -0
- package/views/docs/controls/views-list.md +6 -0
- package/views/docs/getting-started.md +2 -2
- package/views/docs/guides/atoms.md +2 -2
- package/views/docs/guides/columns.md +1 -1
- package/views/docs/guides/ports.md +1 -1
- package/views/docs/guides/the-grid.md +36 -9
- package/views/docs/guides/the-provider.md +22 -3
- package/views/docs/index.md +1 -0
- package/views/docs/reference/controls.md +41 -29
- package/views/docs/reference/editors-session.md +1 -1
- package/views/docs/reference/field-row.md +9 -1
- package/views/docs/reference/grid.md +15 -9
- package/views/docs/reference/list.md +357 -0
- package/views/docs/reference/looks.md +1 -1
- package/views/docs/reference/panels-react.md +17 -12
- package/views/docs/reference/panels.md +8 -5
- package/views/docs/reference/react.md +24 -16
- package/views/docs/reference/views.md +10 -6
- package/views/docs/reshaping.md +6 -1
- package/views/skills/views/SKILL.md +9 -6
package/views/docs/contract.md
CHANGED
|
@@ -4,8 +4,7 @@ The names the rendering speaks to the engine through, and the names an app hands
|
|
|
4
4
|
is public; nothing outside this list is. `src/contract.ts` holds the slots, states, tokens, component
|
|
5
5
|
names, port names, icon names and message namespaces as typed constants, and `src/contract.test.ts`
|
|
6
6
|
pins them to this file: a constant this file does not name, and a slot, state or `--vk-*` token this
|
|
7
|
-
file names that no constant holds, fail the package's tests. The
|
|
8
|
-
named here only, until the engine that implements them lands. Renaming a name
|
|
7
|
+
file names that no constant holds, fail the package's tests. The ports' methods are named here only. Renaming a name
|
|
9
8
|
after a second app holds a copy is a codemod across every app, so a rename is a changelog line and a
|
|
10
9
|
codemod, never a quiet edit.
|
|
11
10
|
|
|
@@ -155,17 +154,6 @@ pending value, else the row's): nothing, a blank text or an empty list; a value
|
|
|
155
154
|
parts are all empty (a money, a range) does not count as empty, and a column with no value of its
|
|
156
155
|
own (an action column) never is.
|
|
157
156
|
|
|
158
|
-
## Getters
|
|
159
|
-
|
|
160
|
-
The engine's functions the rendering calls. They return only stable structure — role, ARIA indices,
|
|
161
|
-
`data-*` identifiers, geometry — and carry no per-cell handlers; they are pure functions of their
|
|
162
|
-
arguments, created once per engine.
|
|
163
|
-
|
|
164
|
-
- `getGridProps()`
|
|
165
|
-
- `getHeaderProps(colId)`
|
|
166
|
-
- `getRowProps(rowKey, index)`
|
|
167
|
-
- `getCellProps(rowKey, colId, colIndex)`
|
|
168
|
-
|
|
169
157
|
## Row state
|
|
170
158
|
|
|
171
159
|
A row is the grid's own component, handed flat props; no hook hands a row its state, and an app reads none of them.
|
|
@@ -323,6 +311,15 @@ or an ancestor, or on one group: to stand the group after a folded one right und
|
|
|
323
311
|
no layer. A `margin-top` rule on the slot still works where it wins over the class (outside any layer, or in one
|
|
324
312
|
after `utilities`).
|
|
325
313
|
|
|
314
|
+
**The field row's frame is the app's to declare.** A record's field row (`viewkitjs/views/field-row`) reads
|
|
315
|
+
`--vk-field-row-label-w` for its label column on a desktop (undeclared `calc(var(--spacing)*32)`, what `w-32` drew), `--vk-field-row-gap` for the gap
|
|
316
|
+
between its glyph, label, value and lane (`calc(var(--spacing)*3)`), `--vk-field-row-h` for its least height, its one line standing
|
|
317
|
+
in the middle of it (`auto`), `--vk-field-row-py` for its padding above and below (`calc(var(--spacing)*2.5)`), `--vk-field-row-line-w`
|
|
318
|
+
for the line under every row but the last (`1px`; `0px` draws none), `--vk-field-row-line` for that line's colour
|
|
319
|
+
(`--vk-border`) and `--vk-field-row-label-fg` for its label's colour (`--vk-fg-subtle`). Undeclared, the row draws as
|
|
320
|
+
it always has; declared on a section or any ancestor, every row in it takes them. Inside a Field rows card on a phone the
|
|
321
|
+
row is one of the card's rows, drawn by the card's frame, and none of them apply there.
|
|
322
|
+
|
|
326
323
|
**Type, lines and timing are the app's to dress, one variable per kind.** Each is optional. Undeclared, every
|
|
327
324
|
place keeps its own value, the one shown here; declared once, on the grid, a panel or an ancestor, every place of
|
|
328
325
|
that kind takes it.
|
|
@@ -430,17 +427,21 @@ grid's editors and menus use, each in Base UI's shape, and an adapter on Radix a
|
|
|
430
427
|
both fill every one.
|
|
431
428
|
|
|
432
429
|
**Defaults for an app that hands none:** `CONTROLS`, from `viewkitjs/views/controls`, holds ViewKit's default controls,
|
|
433
|
-
the Outright kit's, on Base UI: its controls (the Button, the Popover, the Sheet, the Input, the Checkbox, the Tooltip, the Menu), the Text editor as its `TextBody`, the Picker as its `Picker` and `FieldsBody`, the Date editor as its `DateBody`, the Date editor's days as its `Calendar`, the Compound editor as its `PartsBody`, the Number editor as its `NumberBody`, the Values editor as its `ValuesBody`, the Links editor as its `LinksBody`, and of the panels the sort editor as its `SortBody`, the views list as its `ViewsListBody`, the filter editor as its `FilterBody` and `FilterPartBody` and the group editor as its `GroupBody`, Customize as its `CustomizeBody`, the quick filters as its `QuickFiltersBody`, the bulk bar as its `SelectionBar`; and of the panels' controls the Collapsible as its `Collapse`; and `PortsHost`, ViewKit's Toast and alert dialog for the `toast` and `confirm` ports an app leaves out. An app spreads it first and its own after
|
|
430
|
+
the Outright kit's, on Base UI: its controls (the Button, the Popover, the Sheet, the Input, the Checkbox, the Tooltip, the Menu, the Select), the Text editor as its `TextBody`, the Picker as its `Picker` and `FieldsBody`, the Date editor as its `DateBody`, the Date editor's days as its `Calendar`, the Compound editor as its `PartsBody`, the Number editor as its `NumberBody`, the Values editor as its `ValuesBody`, the Links editor as its `LinksBody`, and of the panels the sort editor as its `SortBody`, the views list as its `ViewsListBody` and a view's menu as its `ViewMenu`, the filter editor as its `FilterBody` and `FilterPartBody` and the group editor as its `GroupBody`, Customize as its `CustomizeBody`, the quick filters as its `QuickFiltersBody`, the bulk bar as its `SelectionBar`; and of the panels' controls the Collapsible as its `Collapse`; and `PortsHost`, ViewKit's Toast and alert dialog for the `toast` and `confirm` ports an app leaves out; and `AppIcon`, ViewKit's own glyphs by name (`CONTROL_ICONS`), and `Markdown`, the stored text as it stands with its line breaks kept. So it fills every required slot, and `components={CONTROLS}` is the one line an app must write; handed as it stands it brings `CONTROL_ATOMS` too, the atoms drawn with those controls, under the app's own `atoms`. An app spreads it first and its own after
|
|
434
431
|
(`components={{ ...CONTROLS, ...own }}`), so whatever it hands wins. That door alone needs `@base-ui/react`, an optional
|
|
435
432
|
peer; the provider and every other door import neither library, so an app that hands every control never installs it.
|
|
436
433
|
|
|
437
434
|
`Button` · `Popover` · `Tooltip` · `Checkbox` · `Menu` · `Collapse` · `Sheet` · `AppIcon` · `Markdown` · `TextBody` · `NumberBody` · `Picker` · `LinksBody` · `DateBody` · `PartsBody` · `ValuesBody`
|
|
438
435
|
|
|
439
|
-
`Button`: `ViewsButtonProps`, its children, `onClick`, `disabled`, `variant`, `size`, `type`, a class, `aria-label` and `title`. It draws every button ViewKit draws itself, handed ViewKit's box in its one class. The grid's own buttons are handed a `ref`, `tabIndex`, `aria-haspopup`, `aria-expanded`, `data-slot` and `data-open`, each forwarded to your element; a command cell's ▾ and trigger, and the selection chip, only the props named first, the chip also `data-slot`. A field row's own buttons are handed `type`, `variant`, `size`, `className`, `aria-label`, `disabled` and `onClick` (the ▾ and the verb trigger no `onClick`: the menu opens on them), Show more also `data-slot`, and the edit target also a ref and `aria-disabled` while its write is pending, each forwarded to your element. The panels' own buttons are handed `type`, `variant` (`ghost`, `outline` or `secondary`), `size`, `className` and their children, each with what it needs of `onClick`, `disabled`, `aria-label`, `title`, a ref, `aria-haspopup`, `aria-expanded`, `aria-pressed`, `role`, `aria-selected`, `aria-disabled` and `aria-describedby` (a button that can't be used, described by why), `data-slot`, `data-state="open"` or `data-state="closed"` and `data-vs-row="true"`, each forwarded to your element.
|
|
436
|
+
`Button`: `ViewsButtonProps`, its children, `onClick`, `disabled`, `variant`, `size`, `type`, a class, `aria-label` and `title`. It draws every button ViewKit draws itself, handed ViewKit's box in its one class. The grid's own buttons are handed a `ref`, `tabIndex`, `aria-haspopup`, `aria-expanded`, `data-slot` and `data-open`, each forwarded to your element; a command cell's ▾ and trigger, and the selection chip, only the props named first, the chip also `data-slot`. A field row's own buttons are handed `type`, `variant`, `size`, `className`, `aria-label`, `disabled` and `onClick` (the ▾ and the verb trigger no `onClick`: the menu opens on them), Show more also `data-slot`, and the edit target also a ref and `aria-disabled` while its write is pending, each forwarded to your element. The panels' own buttons are handed `type`, `variant` (`ghost`, `outline` or `secondary`), `size`, `className` and their children, each with what it needs of `onClick`, `disabled`, `aria-label`, `title`, a ref, `aria-haspopup`, `aria-expanded`, `aria-pressed`, `role`, `aria-selected`, `aria-disabled` and `aria-describedby` (a button that can't be used, described by why), `data-slot`, `data-state="open"` or `data-state="closed"` and `data-vs-row="true"`, each forwarded to your element. Inside the sort and filter panels under the provider's `panelControls` (VK-1013), each button is handed `type="button"`, a `variant` from what it is (`default` for a primary one, an empty filter's Add filter; `destructive` for a danger one), `size` `icon` for one drawn as its glyph alone, its icon and words as its children, its part's `data-slot` and `data-key`, and `aria-disabled` where it can't be used but keeps its focus; forward the rest to your element.
|
|
440
437
|
|
|
441
438
|
`Checkbox`: `ViewsCheckboxProps`. A yes/no cell in the grid draws it, handed `checked`, the column's name as `aria-label`, `tabIndex` -1 and `onCheckedChange`; a cell the grid can't write is handed `readOnly` and a press that writes nothing. A field row's yes/no draws it, handed `checked`, the field's name as `aria-label` and `onCheckedChange`, and no `tabIndex`, so it stays a Tab stop as a switch is; a row it can't write is handed `readOnly`, and a value inside the row's own button keeps the tick box. Forward `readOnly` to your control.
|
|
442
439
|
|
|
443
|
-
`Input`, optional: a single-line text box, `ViewsInputProps`. The editors' own single-line box (a duration's, the one number no body has a form for) draws through it; without it the editors draw a plain `<input>`. Forward every prop to your element, `ref` included. `chrome` is `bare` (the default: a grid cell, a panel that frames the box) or `field` (your field's frame). `OPTIONAL_COMPONENT_NAMES` lists the
|
|
440
|
+
`Input`, optional: a single-line text box, `ViewsInputProps`. The editors' own single-line box (a duration's, the one number no body has a form for) draws through it; without it the editors draw a plain `<input>`. Forward every prop to your element, `ref` included. `chrome` is `bare` (the default: a grid cell, a panel that frames the box) or `field` (your field's frame). `OPTIONAL_COMPONENT_NAMES` lists the ten optional slots apart from `COMPONENT_NAMES`, which lists the slots you must fill.
|
|
441
|
+
|
|
442
|
+
`Select`, optional: a box that picks one value or several, `ViewsSelectProps`. Only ViewKit's panels draw it, and only where the provider's `panelControls` names `Select` (VK-1013): the sort's field and direction, the filter's field, way, choices and a block's quantifier. It is handed the rows (`ViewsSelectItem`: a value, its words, an icon, a line, a group, `disabled`, and `level`, rows one level in, which `flatSelectItems` flattens for a Select that draws none), the value and `onValueChange`, `multiple`, a placeholder, `disabled`, `open` and `onOpenChange` (honour both: on a phone a panel holds the box shut and opens a step of its own), `search` (the words of ViewKit's own search), `size` (`sm` or `default`), and the part's `data-slot` and `data-key`, for the box a person presses. `CONTROLS.Select` is ViewKit's own.
|
|
443
|
+
|
|
444
|
+
`panelControls` (the provider): the names among `Button`, `Select`, `Menu`, `Popover` and `Input` that ViewKit's panels draw with your own (VK-1013, the sort and filter panels so far). Each is handed the map's props, never ViewKit's own look, and the part's `data-slot` and `data-key`; a menu's rows carry theirs as `slot` and `key`, and a menu ViewKit opens from your Button it opens itself, at your Button, and gives the focus back to it. Inside the panels a ViewKit part may hand your Button, Select or Input more props than these: forward the rest to your element. A control of `CONTROLS`' stays ViewKit's whatever `panelControls` says; without it, the panels draw ViewKit's own, as before.
|
|
444
445
|
|
|
445
446
|
`Command`, optional and deprecated: the command list's parts (`ViewsCommandParts`). Nothing reads it: the grid's menus are your `Menu` and the editors' lists your `Picker`. Leave it out; it goes at a later minor.
|
|
446
447
|
|
|
@@ -471,9 +472,11 @@ peer; the provider and every other door import neither library, so an app that h
|
|
|
471
472
|
|
|
472
473
|
`PortsHost`, optional: what draws the ports an app leaves out, `ViewsPortsHostProps`: `toast` and `confirm` (which of them to draw) and `onReady` (hand it the ports once they stand). The provider mounts it once, after it first renders in the browser, so a server render draws neither, and only when the app hands no `toast` or no `confirm`; an app's own port always wins. Left out, a missing `toast` draws nothing and a missing `confirm` is the browser's. `CONTROLS.PortsHost` reports in ViewKit's Toast (Undo where `success` hands one) and asks in ViewKit's alert dialog, the question held in its own state, so an app's own `AlertDialogHost` never shows it twice; its words are your messages' (`views.panels.toast-undo`, `views.panels.close`, `views.panels.toast-region`, `views.panels.alert-failed`, `views.picker.retry`, `views.picker.cancel`).
|
|
473
474
|
|
|
475
|
+
`ViewMenu`, optional: one view's whole menu at an anchor, which your app draws, `ViewsViewMenuProps`; `CONTROLS.ViewMenu` is ViewKit's own (VK-947). A views row's pill (the open one on a click on it again or a right-click, another on a right-click) and a folded view's `⋮` in the "+N" list open it, on a computer, where the axis hands `verbs`; left out, they open the view's `menu` rows through `Menu`, and the row's + calls the axis's `onCreate`, as an axis without `verbs` does. It is handed `open`, `onOpenChange`, `anchor` and `align`, as `Menu` is; the view whose menu it is (`view`; left out, it stands on New view's Modal in place of a menu, as the row's + opens it where the axis grows, and tells `onOpenChange(false)` once the Modal has closed, VK-971), every view of the axis in its order (`views`, as `ViewsListBody` is handed them), the view in use (`value`) and `verbs`; `onDone` (a change opened a view, ended in the Toast, or asked for Customize: what holds it closes) and, in the "+N" list's popover, `onHold` (while it asks your `confirm` port, a press outside and Escape close nothing). `CONTROLS.ViewMenu` draws the views list's view menu (`useViewMenu`), its items reshaped by `verbs.menu`, through your `Menu`: Rename… and Save as new view… in the Modal, Delete asked through the `confirm` port and said through the `toast` port with its `undo`, each change handed to `verbs.onChange`.
|
|
476
|
+
|
|
474
477
|
`SelectionBar`, optional: the selection bar, which your app draws, `ViewsSelectionBarProps`, the props of ViewKit's `SelectionBar`. Handed one, ViewKit's `SelectionBar`, wherever your `renderBar` calls it, draws yours in its own place, in the box that holds it (a grid's frame), at every count, zero included, so it can leave as it chooses; left out, ViewKit draws its own bar, portalled to the screen's foot, placed by the provider's `selectionBar`. Beside the count, the clear, the verbs, `busy`, `onDelete` and `deleteLabel`, it is handed what ViewKit's own bar doesn't read: `noun` (what a row is, one and many), `deleteLine` (the line under Delete's question), and on each verb `more` (kept off the bar, in More), on an options verb `value` (what every picked row holds, null when every one is empty), `empty` (the empty row's words; a pick of it hands `null`) and `search`, its `options` ViewKit's picker items (a person by `avatarUrl` and `kind`), and a press (`onClick`, `onSelect`, `onDelete`) may hand back a `SelectionDone`, `{ words, undo }`, or a promise of one, which yours shows. `CONTROLS.SelectionBar` is the Outright bulk bar (`BulkBar`): on a computer a surface floating at the foot of the box that holds it, centred, its count (which clears), the verbs as outlined buttons, Delete in More or its own (its option `delete`, `BULK_BAR_LOOKS`), and More, holding what is kept off and what doesn't fit; on a phone, or in a `PhoneHost` screen, the tray, its verbs at 44 with Delete among them, or the pill (its option `phone`); one Tab stop with the arrows; Escape from the box clears; an options verb's values in the Picker (in the one Sheet on a phone); Delete asked first in ViewKit's alert dialog, then called, so your `onDelete` asks nothing of its own; what a press hands back said in its own Toast, just above it, with Undo; a press that throws said as one that didn't go through. It hands the box that holds it the room it takes, which a list that scrolls in it pads its foot by ([its tokens](controls/bulk-bar.md)). The provider's `selectionBar` placement and query are ViewKit's own bar's. Every word is your messages'.
|
|
475
478
|
|
|
476
|
-
`ViewsListBody`, required: the views list's whole body, which your app draws, `ViewsViewsListBodyProps`; `CONTROLS.ViewsListBody` is ViewKit's own. The view picker's chip opens it: in its popover on a computer and in the Sheet on a phone. The row's pills and its "+N" list stay ViewKit's. It is handed the list's name (`label`), the axis's views in its order (`views`, each its `value`, its words, its `icon`, its `count` (absent while the list's counts are hidden), `private` for one of the reader's own, and `menu`, the view's own verbs as your app gave them), the view in use (`value`), `form`, and, where the axis has them, `onCreate` with its word (`createLabel`; what holds the list closes first, then the axis's own create runs) and `onReorder` with `canDrag`. The body hands back `onViewChange` (a view picked; it closes nothing, so call `onDone` after it, as `CONTROLS.ViewsListBody` closes on a pick), `onReorder` (one whole block, the shared views or the reader's own, in its new order, each once) and `onDone` (what holds it closes). On a phone where the sheet's head doesn't draw it (the provider's `sheetActions` at `bar`), it is handed `actions`, the ✕ (`close`, which closes the list) and, while it stands on a step, Back (`back`); on a computer, and under `head`, it is handed none. On a computer it is handed `onHold`: while the body holds, a press outside the list and Escape close nothing (it asks a question outside the list, your `confirm` port's dialog), so the list stays when the question is answered. On a phone it is handed `onStepChange`: a body standing on a step of its own (a view's menu, Rename) tells it, and the sheet shows the step's title and Back and its Escape goes back a step. Where the axis hands `verbs` (`ViewsViewVerbs`: the `layouts` a new view can take, each its glyph by your `AppIcon`, the `records`' noun, a board's `columns` and `onChange`, which takes every change a view's menu makes, `ViewsViewChange`: rename, create, duplicate, delete, restore, save, reset, edit, link, favorite, private), the body is handed them, and each view its `layout`, `changed` and `favorite`. ViewKit checks each value before it is written: a pick that isn't one of `views`, and an order that isn't one whole block, write nothing. What creating, reordering and a view's verbs mean stays your app's, as the axis says. `CONTROLS.ViewsListBody` is ViewKit's own, the views list: a search over the views (at the Sheet's foot on a phone), each with its glyph, its count and its ⋮ where you hand it a menu, Shared and the reader's own under their headings with a lock on each of the reader's own, a view moved by a drag or ⌥↑ ⌥↓ within its block (never one `canDrag` refuses, nor a view dropped past one), ↓ and ↑ going on from the view in use, and New view where the axis grows. It draws no ✕ of its own: the Sheet's head draws it, and `actions` goes unread but for Back on a step. On a phone a view's ⋯ turns the one Sheet into its menu, with Back, never a sheet on top (VK-823). Handed `verbs`, a view's menu is the Outright kit's (`useViewMenu`): Rename… and New view in the Modal (New view where the axis grows, as without verbs, its create handed to `verbs.onChange`), Edit view, Private view, Save for everyone, Reset and Save as new view, Copy link, Favorite, Duplicate, and Delete, asked on a computer through the `confirm` port (ViewKit's alert dialog where your app hands none and `PortsHost` stands; the menu's own dialog where neither does, never the browser's) and said through the `toast` port's `success` with its `undo`. ViewKit moves no view itself: your `verbs.onChange` opens the right one, the first listed when the open one is deleted, the view again on a restore with `open`, the new one on a create or a duplicate (whose ids your app makes); `viewsAfter`, from `viewkitjs/views/controls`, does all of it over your views; on a phone each a step of the one Sheet, the delete question the Alert in its sheet form. Every word is your messages'.
|
|
479
|
+
`ViewsListBody`, required: the views list's whole body, which your app draws, `ViewsViewsListBodyProps`; `CONTROLS.ViewsListBody` is ViewKit's own. The view picker's chip opens it: in its popover on a computer and in the Sheet on a phone. The row's pills and its "+N" list stay ViewKit's (a view's menu there is `ViewMenu`'s). It is handed the list's name (`label`), the axis's views in its order (`views`, each its `value`, its words, its `icon`, its `count` (absent while the list's counts are hidden), `private` for one of the reader's own, and `menu`, the view's own verbs as your app gave them), the view in use (`value`), `form`, and, where the axis has them, `onCreate` with its word (`createLabel`; what holds the list closes first, then the axis's own create runs) and `onReorder` with `canDrag`. The body hands back `onViewChange` (a view picked; it closes nothing, so call `onDone` after it, as `CONTROLS.ViewsListBody` closes on a pick), `onReorder` (one whole block, the shared views or the reader's own, in its new order, each once) and `onDone` (what holds it closes). On a phone where the sheet's head doesn't draw it (the provider's `sheetActions` at `bar`), it is handed `actions`, the ✕ (`close`, which closes the list) and, while it stands on a step, Back (`back`); on a computer, and under `head`, it is handed none. On a computer it is handed `onHold`: while the body holds, a press outside the list and Escape close nothing (it asks a question outside the list, your `confirm` port's dialog), so the list stays when the question is answered. On a phone it is handed `onStepChange`: a body standing on a step of its own (a view's menu, Rename) tells it, and the sheet shows the step's title and Back and its Escape goes back a step. Where the axis hands `verbs` (`ViewsViewVerbs`: the `layouts` a new view can take, each its glyph by your `AppIcon`, the `records`' noun, a board's `columns` and `onChange`, which takes every change a view's menu makes, `ViewsViewChange`: rename, create, duplicate, delete, restore, save, reset, edit, link, favorite, private), the body is handed them, and each view its `layout`, `changed` and `favorite`. ViewKit checks each value before it is written: a pick that isn't one of `views`, and an order that isn't one whole block, write nothing. What creating, reordering and a view's verbs mean stays your app's, as the axis says. `CONTROLS.ViewsListBody` is ViewKit's own, the views list: a search over the views (at the Sheet's foot on a phone), each with its glyph, its count and its ⋮ where you hand it a menu, Shared and the reader's own under their headings with a lock on each of the reader's own, a view moved by a drag or ⌥↑ ⌥↓ within its block (never one `canDrag` refuses, nor a view dropped past one), ↓ and ↑ going on from the view in use, and New view where the axis grows. It draws no ✕ of its own: the Sheet's head draws it, and `actions` goes unread but for Back on a step. On a phone a view's ⋯ turns the one Sheet into its menu, with Back, never a sheet on top (VK-823). Handed `verbs`, a view's menu is the Outright kit's (`useViewMenu`): Rename… and New view in the Modal (New view where the axis grows, as without verbs, its create handed to `verbs.onChange`), Edit view, Private view, Save for everyone, Reset and Save as new view, Copy link, Favorite, Duplicate, and Delete, asked on a computer through the `confirm` port (ViewKit's alert dialog where your app hands none and `PortsHost` stands; the menu's own dialog where neither does, never the browser's) and said through the `toast` port's `success` with its `undo`. ViewKit moves no view itself: your `verbs.onChange` opens the right one, the first listed when the open one is deleted, the view again on a restore with `open`, the new one on a create or a duplicate (whose ids your app makes); `viewsAfter`, from `viewkitjs/views/controls`, does all of it over your views; on a phone each a step of the one Sheet, the delete question the Alert in its sheet form. Every word is your messages'.
|
|
477
480
|
|
|
478
481
|
`GroupBody`, optional and deprecated: read by nothing. Only ViewKit's own Customize opened it, and that Customize is gone; a `CustomizeBody` holds its group editor inside it, handed the same props as its `group`. A map that names it still compiles; it leaves in a later release. Its props, `ViewsGroupBodyProps`, are what a `CustomizeBody`'s `group` is handed: it is handed the group's name (`label`), the fields the list can be grouped by (`dimensions`, each its `value`, its words, its `orderOptions` with the direction each opens in, its `defaultOrder`, and a date's `granularities` with its `defaultGranularity`), the group as one value (`group`, a `ViewsGroupValue`: the dimension grouped by or `none`, the active dimension's `order` (`mode` and `dir`), its date step (`granularity`), `hideEmpty` while grouped where the list offers it, and `groups` while grouped where the list hands them, in the order the list shows them, each its `key`, its words, `empty`, `hidden`, and its `count` where the list counts it), `manualOrder` (your own order, `manual`, may be picked) and `form`. The body hands back `onGroupChange` (the whole group, every change as it is made) and `onDone` (inside Customize, back to its list). ViewKit makes one write for each change, in this order: a new Group by, order or date step is written alone, the rest of the value (about the old field's groups) set aside; else Hide empty groups; else the groups: the same groups in a new order (your own order), one group shown or hidden, every group hidden, or every group shown. A new Group by keeps the order and step handed with it only where the new field offers them, else takes the field's own. A value that changes two of those at once, names a field the list doesn't offer, names an order or step the field grouped by doesn't offer, or adds or loses a group writes nothing. It is handed no `actions`. It is handed `onStepChange`, on a computer and a phone: hand it a level of your own (`ViewsBodyStep`, its `title` and `onBack`: Group by's fields, an order's choices) while you stand on one, and `null` once you are back; what holds it shows the level's name in its head and its Back calls `onBack`. `CONTROLS.GroupBody`, kept so a map that names it compiles, is ViewKit's own, the group editor: Group by, Order, Direction, a date field's Date step and Hide empty groups, each opening its choices in place; the groups with their Switch, dragged into your own order, Hide all and Show all; Remove grouping; each change one write, Count ordered by each group's `count`, its level told through `onStepChange`.
|
|
479
482
|
|
|
@@ -506,8 +509,9 @@ carries `keepOpen`, a hint to leave the menu open so several can be ticked in tu
|
|
|
506
509
|
item's `children` are a group, its rows drawn in place under the item's label unless it carries `beside`, a hint to open them one level in, its row showing its label and `detail`, and
|
|
507
510
|
the group's own `onSelect`, `href` and `checked` are ignored, and a group marked `disabled` disables every row under it, at every depth: the provider hands your `Menu` those rows already `disabled`, each one that gives no reason carrying the group's `disabledReason`, so you draw each row by its own flag. Any row may carry `detail`, its current value in words, for its end. An adapter that draws none of the three keeps every row closing and every group in place, and loses nothing it needs. So an adapter needn't guess: a ticked row's `onSelect` fires on every pick, also when it is already ticked (a second pick of the ticked sort flips its direction), so an adapter that draws ticked rows as a radio value still calls it; ticked rows that close, inside a group, are one choice among several (a pick list), and ticked rows with `keepOpen` are separate ticks (checkboxes); a label is always text, so a swatch or a column's mark rides as the row's `icon` beside it. The sheet takes `label`, its title in words whenever the title is words (its accessible name, and the title of a head that takes only text), and, when the provider's `sheetActions` is `head`, `actions`: the editor panel's ✕ (`close`) and ✓ (`done`, absent where the body saves on its pick), or a toolbar panel's ✕ alone (`close`, which closes it), or the sort editor's ✕ (`close`, which takes its rules back to what they were as the sheet opened) and ✓ (`done`), each a `label` and an `onPress`, for your sheet's own head; with `bar`, the default, the panel draws them itself. `AppIcon` is the app's own icon component by the app's own names, for
|
|
508
511
|
the glyphs a host declares (a row's icon, a binding's icon, an option's icon), drawn on the first paint (rows are measured as they mount); the semantic glyphs the rendering itself
|
|
509
|
-
needs are a port, by meaning (below)
|
|
510
|
-
package draws rich text through it and parses none
|
|
512
|
+
needs are a port, by meaning (below); `CONTROLS.AppIcon` draws ViewKit's own glyph of each meaning's name. `Markdown` is the
|
|
513
|
+
app's markdown renderer, handed the stored text whole; the package draws rich text through it and parses none, and
|
|
514
|
+
`CONTROLS.Markdown` draws the text as it stands, its line breaks kept.
|
|
511
515
|
|
|
512
516
|
A popup reports why it closed through `onOpenChange`'s `details.reason`: `trigger-press`,
|
|
513
517
|
`outside-press`, `escape-key`, `focus-out`, `item-press`, `close-press` (a close button inside it) or
|
|
@@ -598,7 +602,7 @@ container: the inset a run of rows sits in, inside a panel or a command list's g
|
|
|
598
602
|
a button or, with `interactive={false}`, a static line), `RowContent` (a row's inside, for inside a
|
|
599
603
|
command list's item, which owns the element and the highlight), `TickBox` (a paint-only tick box), `Avatar` (a person's or a record's picture, `ViewsAvatarProps`: a user's, a relation's and an actor's chip draw it at `size="chip"`, and the name draws it at `size="glyph"`, sized by `--vk-glyph`, when the list's `rowIcon` hands the row's `avatar`; it is handed `label`, whose picture it is, `avatarUrl`, `kind`, the record's kind as the app names it (a relation's `entity`, `user` for a member, an actor's type), and `fallback`, the glyph the chip or the name draws without a picture; the default draws the picture, marked `data-slot="vk-avatar"`, and the fallback when there is none or it fails to load, so an app that hands none sees its chips and names as before; yours draws initials on a tone, a record in its own shape, or the fallback for a kind it doesn't dress),
|
|
600
604
|
`StatusBadge` (a pill by status slot), `StatusMarker` (an attention badge that opens its reason) and
|
|
601
|
-
`Tag` (a category chip, removable, with an optional leading glyph), `CommandMenu` (a `command` cell's verb menu, opened from the trigger the cell drew; the default is the components map's `Menu`), `RowMenu` (the rows' right-click menu, once around each section's rows' container and aimed at the row a press or a right-click came from, its props that row's: Open page, the rows the rendering builds, Delete; the default is the components map's `Menu` at the pointer, opened by a right-click or the row's ⋯ (`data-slot="vk-grid-row-more"`), wrapped in `data-slot="vk-row-menu"`; the grid's row-menu keys send a cell the same right-click, with no press before it, so a `RowMenu` of your own opens on any `contextmenu` and doesn't wait for a press; its Delete asks the `confirm` port with `views.menus.row-delete-confirm` (the browser's own confirm when you hand none), and a delete that rejects says so through the toast port's `error` with `views.menus.row-delete-failed`; a long-press on a phone opens nothing, and with `GridTable`'s `phonePicking` on the grid's own long press picks the row, an `onToggleSelect` that answers the same held press ticking it with the grid's, once) and `RelationLink` (where a relation chip goes, around the chip the display drew; the default goes nowhere), `RelationRoles` (a link's roles, inside its chip after the record's name, on a `many` relation that declares `links`; the default draws their labels in the subtle colour after a middle dot, wrapped in `data-slot="vk-relation-roles"`, and in a narrow cell cuts them, down to nothing, before the name loses a letter), `Loading` (a wait: the list reloading, or more rows arriving; the default is a plain ring) `LoadMore` (how a list asks for its next page; the default watches a sentinel past the last row) and `PlatformMark` (a link's platform, drawn before it, read from its address with the conventions' platforms; the default draws nothing, so a link looks plain, and the package ships no brand art, so an app that wants marks draws its own by the platform's key into `data-slot="vk-platform"`), and the rows the panels (`/panels`) draw with: `ChoiceRow` (picks a value: its label, a second line, a right-hand meta, the check when chosen), `CheckRow` (toggles one of many, a tick box on the left), `RadioRow` (picks one of a set, its mark a check or, with `mark="box"`, a tick box; a disabled row's reason in your `Tooltip`), `DirectionButton` (a sort's direction arrow, named `views.panels.direction`), `MenuRow` (a drill-in row: a glyph, the section, where it stands, a chevron; a disabled row's reason in your `Tooltip`), `ToggleRow` (a boolean flipped in place, with a way back named `views.panels.toggle-reset`; a disabled row's reason in your `Tooltip`) and `PanelSearch` (a panel's text box, a filled well with a magnifier), and `Pill` (one option of a row of pills, the views row's and any tab row's: `active`, a `solid` or `plain` variant, a `default` or `sm` size, a leading glyph, the app's own active and hover classes for a status colour; with `menuOpen` it says it opens a menu, `aria-haspopup="menu"` and `aria-expanded`), and `ToolbarButton` (a toolbar's button, the one every toolbar part draws with: its glyph, its name, its word for a dress that shows words, a count in its corner, which becomes a ✕ badge that clears what it counts when handed `onClear`, a dot that says something is applied with no number, `open`, `changed`, `edge` for the row's outermost button, `disabled`, a `md` or `sm` size, and `popup` when it opens one; and, for the sort (VK-188), its own words shown whatever the dress, with their weight, in `data-slot="vk-toolbar-words"` (`children`: "Sorted by **Amount**"), a count in words after them in `data-slot="vk-toolbar-more"` (`more`: "+1"), an empty place with its edge dashed and `data-empty` (`empty`), and a reason it can't be used, `disabledReason` with `disabled`, in your `Tooltip`, the button then `aria-disabled` and still a Tab stop, a press doing nothing; its own words are then its name, with `more` after them, in place of `label`; and, in a folding toolbar line with no room, `iconAlone`, its words given up for its icon, `data-icon-alone`, which you draw as the icon alone whatever your dress says of words; `aside`, what it names left the list, its edge dashed in the warning's colour, `data-aside`; `foot`, New's + standing alone at a phone list's foot, round, a finger's size, on the brand's ground, `data-foot`; `joined` (`start`, `middle` or `end`), one of buttons joined as one (a filter's field, how it compares, its value, its menu), its corners on the outer side alone, no gap, the shared edge drawn once, `data-joined` with the value; and `waits`, its words saying what it waits for (a filter's value not yet picked), drawn in `--vk-fg-subtlest`, the placeholder's colour, `data-waits`; its own words keep to one line and give way to a holder that caps its width, cut with "…", where an icon button keeps its size; and, told what it is where your own toolbar frame draws it (VK-629), `current` (a view tab, `data-tab`; `true` the open one, `data-current` and `aria-current="true"`), `part` (which of the toolbar's own buttons it stands for, drawn as its `data-slot`: `views-chip` `vk-views-chip`, `views-tab` `vk-views-tab`, `views-more` `vk-views-more`, `views-add` `vk-views-add`, `clear` `vk-toolbar-clear`, `save` `vk-toolbar-save-button`; the default draws the chip and "+N" with a chevron after their words, `data-slot="vk-toolbar-chevron"`, and Save on an edge) and `onContextMenu` (a right-click: a tab's verbs open on it)). Each ships as a default, exported as `DEFAULT_VIEWS_ATOMS`, drawn
|
|
605
|
+
`Tag` (a category chip, removable, with an optional leading glyph), `CommandMenu` (a `command` cell's verb menu, opened from the trigger the cell drew; the default is the components map's `Menu`), `RowMenu` (the rows' right-click menu, once around each section's rows' container and aimed at the row a press or a right-click came from, its props that row's: Open page, the rows the rendering builds, Delete, where the grid's `menus.row` makes the first and last rows of `items` instead (`row-open`, `row-delete`), with one disabled `loading` row while it answers; the default is the components map's `Menu` at the pointer, opened by a right-click or the row's ⋯ (`data-slot="vk-grid-row-more"`), wrapped in `data-slot="vk-row-menu"`; the grid's row-menu keys send a cell the same right-click, with no press before it, so a `RowMenu` of your own opens on any `contextmenu` and doesn't wait for a press; its Delete asks the `confirm` port with `views.menus.row-delete-confirm` (the browser's own confirm when you hand none), and a delete that rejects says so through the toast port's `error` with `views.menus.row-delete-failed`; a long-press on a phone opens nothing, and with `GridTable`'s `phonePicking` on the grid's own long press picks the row, an `onToggleSelect` that answers the same held press ticking it with the grid's, once) and `RelationLink` (where a relation chip goes, around the chip the display drew; the default goes nowhere), `RelationRoles` (a link's roles, inside its chip after the record's name, on a `many` relation that declares `links`; the default draws their labels in the subtle colour after a middle dot, wrapped in `data-slot="vk-relation-roles"`, and in a narrow cell cuts them, down to nothing, before the name loses a letter), `Loading` (a wait: the list reloading, or more rows arriving; the default is a plain ring) `LoadMore` (how a list asks for its next page; the default watches a sentinel past the last row) and `PlatformMark` (a link's platform, drawn before it, read from its address with the conventions' platforms; the default draws nothing, so a link looks plain, and the package ships no brand art, so an app that wants marks draws its own by the platform's key into `data-slot="vk-platform"`), and the rows the panels (`/panels`) draw with: `ChoiceRow` (picks a value: its label, a second line, a right-hand meta, the check when chosen), `CheckRow` (toggles one of many, a tick box on the left), `RadioRow` (picks one of a set, its mark a check or, with `mark="box"`, a tick box; a disabled row's reason in your `Tooltip`), `DirectionButton` (a sort's direction arrow, named `views.panels.direction`), `MenuRow` (a drill-in row: a glyph, the section, where it stands, a chevron; a disabled row's reason in your `Tooltip`), `ToggleRow` (a boolean flipped in place, with a way back named `views.panels.toggle-reset`; a disabled row's reason in your `Tooltip`) and `PanelSearch` (a panel's text box, a filled well with a magnifier), and `Pill` (one option of a row of pills, the views row's and any tab row's: `active`, a `solid` or `plain` variant, a `default` or `sm` size, a leading glyph, the app's own active and hover classes for a status colour; with `menuOpen` it says it opens a menu, `aria-haspopup="menu"` and `aria-expanded`), and `ToolbarButton` (a toolbar's button, the one every toolbar part draws with: its glyph, its name, its word for a dress that shows words, a count in its corner, which becomes a ✕ badge that clears what it counts when handed `onClear`, a dot that says something is applied with no number, `open`, `changed`, `edge` for the row's outermost button, `disabled`, a `md` or `sm` size, and `popup` when it opens one; and, for the sort (VK-188), its own words shown whatever the dress, with their weight, in `data-slot="vk-toolbar-words"` (`children`: "Sorted by **Amount**"), a count in words after them in `data-slot="vk-toolbar-more"` (`more`: "+1"), an empty place with its edge dashed and `data-empty` (`empty`), and a reason it can't be used, `disabledReason` with `disabled`, in your `Tooltip`, the button then `aria-disabled` and still a Tab stop, a press doing nothing; its own words are then its name, with `more` after them, in place of `label`; and, in a folding toolbar line with no room, `iconAlone`, its words given up for its icon, `data-icon-alone`, which you draw as the icon alone whatever your dress says of words; `aside`, what it names left the list, its edge dashed in the warning's colour, `data-aside`; `foot`, New's + standing alone at a phone list's foot, round, a finger's size, on the brand's ground, `data-foot`; `joined` (`start`, `middle` or `end`), one of buttons joined as one (a filter's field, how it compares, its value, its menu), its corners on the outer side alone, no gap, the shared edge drawn once, `data-joined` with the value; and `waits`, its words saying what it waits for (a filter's value not yet picked), drawn in `--vk-fg-subtlest`, the placeholder's colour, `data-waits`; its own words keep to one line and give way to a holder that caps its width, cut with "…", where an icon button keeps its size; and, told what it is where your own toolbar frame draws it (VK-629), `current` (a view tab, `data-tab`; `true` the open one, `data-current` and `aria-current="true"`), `part` (which of the toolbar's own buttons it stands for, drawn as its `data-slot`: `views-chip` `vk-views-chip`, `views-tab` `vk-views-tab`, `views-more` `vk-views-more`, `views-add` `vk-views-add`, `clear` `vk-toolbar-clear`, `save` `vk-toolbar-save-button`; the default draws the chip and "+N" with a chevron after their words, `data-slot="vk-toolbar-chevron"`, and Save on an edge) and `onContextMenu` (a right-click: a tab's verbs open on it); and wherever it stands (VK-984), `part` naming every other button after its toolbar place (`sort`, `filter`, `options`, `search`, `quick`, `new`, `filters`, `filter-add`, `sort-pill`, `sort-add`, `advanced-filters`, `more-filters`, ⋯ `more`), which the default draws as it always did, and `className`, its place's class, put on the button). Each ships as a default, exported as `DEFAULT_VIEWS_ATOMS`, drawn
|
|
602
606
|
from the app's colours; an app swaps any of them through the provider's `atoms`, and the rest
|
|
603
607
|
stay the defaults. `SelectionSheet` is the phone's sheet of a selection's verbs, opened by the
|
|
604
608
|
selection bar's Actions: the default is the components map's `Sheet` holding the atoms' rows, a group's
|
|
@@ -700,8 +704,17 @@ places), each one's popover handed `data-slot="vk-toolbar-options-panel"`, `data
|
|
|
700
704
|
`data-slot="vk-toolbar-filter-panel"` through your `Popover`'s `panelData`; on a phone, where the panel opens in your
|
|
701
705
|
`Sheet`, the same slot marks the panel's box inside it.
|
|
702
706
|
|
|
707
|
+
These slots mark the places ViewKit draws around your buttons. The button itself is told which it is: every button the
|
|
708
|
+
toolbar draws hands your `ToolbarButton` its `part` (`sort`, `filter`, `options`, `search`, `quick`, `new`, the filter
|
|
709
|
+
bar's `filters`, `filter-add`, `sort-pill`, `sort-add`, `advanced-filters`, `more-filters`, and ⋯ `more`; `/list`'s
|
|
710
|
+
Default keys has the whole table), and a place the ready toolbar's `toolbarParts` dresses hands its `className` on to
|
|
711
|
+
each of its buttons, or draws your own `button` for them, handed the same props. Your atom puts `className` on the
|
|
712
|
+
button, and dresses by `part` only the six of an app's own frame (`ViewsFramePart`) as their slots say.
|
|
713
|
+
|
|
703
714
|
In the fold arrangement (`Toolbar`'s `fold`, the ready toolbar's default) the frame carries `data-fold`, a line's
|
|
704
|
-
kind is `main` or `bar` (the filter bar under the row), each part stands in an item of its own,
|
|
715
|
+
kind is `main` or `bar` (the filter bar under the row), each part stands in an item of its own, marked
|
|
716
|
+
`data-toolbar-item` with its place's key (yours included, so an app dresses a place of its own by it; the fold hides an item
|
|
717
|
+
that gives way with `hidden`, so a rule of yours that sets `display` on `[data-toolbar-item]` breaks the folding), and as a line
|
|
705
718
|
narrows its parts give way: a toolbar button standing as its icon alone carries `data-icon-alone`, the views fold
|
|
706
719
|
tabs into "+N", the bar's last filters fold into "+N filters" (`data-slot="vk-toolbar-more-filters"`) one at a time,
|
|
707
720
|
and what may fold goes behind `data-slot="vk-toolbar-overflow"` (⋯, its folded parts' rows in your `Menu`). A line
|
|
@@ -747,6 +760,69 @@ with why; its ⋯ holding why, Put back once it fits, and Delete filter), `data-
|
|
|
747
760
|
folded, standing where the last of them stood, its menu naming each) and `data-slot="vk-toolbar-filters-panel"` (the fields' popover, handed through your
|
|
748
761
|
`Popover`'s `panelData`).
|
|
749
762
|
|
|
763
|
+
The panels' parts (VK-988). Every part inside the default panels carries a name of its own, so a stylesheet dresses one part
|
|
764
|
+
apart from the rest; each name starts with its panel's: `vk-sort-`, `vk-filter-`, `vk-group-`, `vk-customize-`, `vk-views-list-`,
|
|
765
|
+
`vk-view-menu-` and `vk-quick-`. A part that repeats says which one it is: `data-key`, by the key you handed (a field's, a view's, a
|
|
766
|
+
section's, a toggle's, a verb's), and a sort rule or a filter's item its place, `data-index`, from 0. Two filter rules on one field share a
|
|
767
|
+
`data-key`, and a filter's `data-index` counts again from 0 at each level of its groups. Where your own `Menu` draws a part (a
|
|
768
|
+
view's menu), it is handed the part's `data-slot` as a prop (`ViewsMenuProps`), and so are your `Button`, `Select`, `Menu`,
|
|
769
|
+
`Popover` and `Input` inside the sort and filter panels under the provider's `panelControls` (VK-1013; a menu's rows by their item's `slot`
|
|
770
|
+
and `key`): draw them on the element your stylesheet styles. ViewKit's own Select, Input, Radio,
|
|
771
|
+
Toggle, PaneHead, PaneFoot and Notice draw a name a panel hands them on their box. The Picker's own parts (its search, its rows, its actions) are the Picker's; a panel row the Picker draws carries the
|
|
772
|
+
panel's name. A row drawn from data takes its name from its entry's `slot` (`PartSlot`: `slot`, `key`, `index`), on a Menu list's
|
|
773
|
+
entry and choice and a Picker's item.
|
|
774
|
+
|
|
775
|
+
- The sort editor (`CONTROLS.SortBody`): `data-slot="vk-sort"` (the editor), `data-slot="vk-sort-rules"` (its rules' list),
|
|
776
|
+
`data-slot="vk-sort-rule"` (one rule, `data-key` its field and `data-index` its place; a set-aside sort keeps `data-aside`, its
|
|
777
|
+
key in `data-key` and no place), `data-slot="vk-sort-grip"` (its grip), `data-slot="vk-sort-field"` and
|
|
778
|
+
`data-slot="vk-sort-direction"` (its two boxes), `data-slot="vk-sort-remove"` (its ×), `data-slot="vk-sort-rule-open"` (a phone's
|
|
779
|
+
or the narrow form's row, pressed to turn its direction), `data-slot="vk-sort-rule-more"` (its ⋯), `data-slot="vk-sort-rule-action"`
|
|
780
|
+
(a row of that menu, `data-key` `delete`, `why` or `put-back`), `data-slot="vk-sort-direction-option"` (a direction to pick on a
|
|
781
|
+
phone's step or the narrow form's list, `data-key` `ascending` or `descending`), `data-slot="vk-sort-add"` (Add sort),
|
|
782
|
+
`data-slot="vk-sort-clear"` (Clear all), `data-slot="vk-sort-foot"` (the row they stand in) and `data-slot="vk-sort-none"`
|
|
783
|
+
(nothing sorted).
|
|
784
|
+
- The filter editor (`CONTROLS.FilterBody`): `data-slot="vk-filter"` (the editor), `data-slot="vk-filter-rules"` (a level's list),
|
|
785
|
+
`data-slot="vk-filter-item"` (a rule's or a group's place in it, `data-index`), `data-slot="vk-filter-rule"` (one rule, `data-key`
|
|
786
|
+
its field; a set-aside keeps `data-aside`), `data-slot="vk-filter-where"` (Where), `data-slot="vk-filter-join"` (the And/Or that
|
|
787
|
+
turns its level), `data-slot="vk-filter-joined"` (a later rule's And/Or words), `data-slot="vk-filter-field"` and
|
|
788
|
+
`data-slot="vk-filter-how"` (its field's and way's boxes, on the box itself, the Select's), `data-slot="vk-filter-value"` (what
|
|
789
|
+
holds its value's box, its wrapper), `data-slot="vk-filter-rule-more"` (its ⋮),
|
|
790
|
+
`data-slot="vk-filter-rule-action"` (a row of that menu: Convert to group, the ways a several-values rule matches, Delete, a
|
|
791
|
+
set-aside's why and Put back, `data-key` `convert`, `any`, `none`, `every`, `delete`, `why`, `put-back`),
|
|
792
|
+
`data-slot="vk-filter-group"` (a group's well), `data-slot="vk-filter-group-head"` and `data-slot="vk-filter-group-more"` (its head
|
|
793
|
+
and ⋮), `data-slot="vk-filter-quantifier"` (a related record's group's Any, None or Every, in its head),
|
|
794
|
+
`data-slot="vk-filter-group-action"` (a row of a group's menu, `data-key` `exclude`), `data-slot="vk-filter-delete"` (Delete at a group's foot), `data-slot="vk-filter-add"` (Add filter),
|
|
795
|
+
`data-slot="vk-filter-clear"` (Clear all), `data-slot="vk-filter-foot"` (a foot they stand in), `data-slot="vk-filter-none"`
|
|
796
|
+
(nothing filtered) and `data-slot="vk-filter-excluded"` (the note over a filter that leaves records out).
|
|
797
|
+
- The group editor (Customize's Group): `data-slot="vk-group"` (the editor), `data-slot="vk-group-setting"` (a setting's row,
|
|
798
|
+
`data-key` `field`, `order`, `direction`, `step` or `empty`), `data-slot="vk-group-choice"` (one of a setting's choices, `data-key`
|
|
799
|
+
its value), `data-slot="vk-group-heading"` (the groups' heading), `data-slot="vk-group-hide-all"` (its Hide all or Show all),
|
|
800
|
+
`data-slot="vk-group-value"` (a group's row, `data-key` its value) and `data-slot="vk-group-remove"` (Remove grouping).
|
|
801
|
+
- Customize (`CONTROLS.CustomizeBody`): `data-slot="vk-customize"` (its body), `data-slot="vk-customize-head"` (its head),
|
|
802
|
+
`data-slot="vk-customize-title"`, `data-slot="vk-customize-back"`, `data-slot="vk-customize-close"`,
|
|
803
|
+
`data-slot="vk-customize-name"` (the view's name) and `data-slot="vk-customize-layout-button"` (its layout's mark beside it),
|
|
804
|
+
`data-slot="vk-customize-section"` (a section's row, `data-key` `layout`, `columns`, `filter`, `sort` or `group`),
|
|
805
|
+
`data-slot="vk-customize-field"` (a field's own filter row, `data-key` its field), `data-slot="vk-customize-toggle"` (a toggle's row,
|
|
806
|
+
`data-key` its key; Show counts `counts`), `data-slot="vk-customize-toggle-reset"` (its way back), `data-slot="vk-customize-choice"`
|
|
807
|
+
(a pick-one setting's row, `data-key` its key) and `data-slot="vk-customize-option"` (one of its options, `data-key` its value),
|
|
808
|
+
`data-slot="vk-customize-heading"` (a heading, `data-key` where it has one), `data-slot="vk-customize-layout"` (a layout's card,
|
|
809
|
+
`data-key` its id), `data-slot="vk-customize-search"` (Columns' search), `data-slot="vk-customize-column"` (a column's row,
|
|
810
|
+
`data-key` its id), `data-slot="vk-customize-columns-action"` (Hide all, Show all, Reset columns, `data-key` `hide-all`,
|
|
811
|
+
`show-all`, `reset`), `data-slot="vk-customize-foot"` (its foot), `data-slot="vk-customize-changes"` (Reset and Save for everyone, over it), `data-slot="vk-customize-action"` (a foot button, `data-key`
|
|
812
|
+
`copy-link`, `export`, `reset` or `save`) and `data-slot="vk-customize-stale"` (the note that the shared view moved).
|
|
813
|
+
- The views list (`CONTROLS.ViewsListBody`): `data-slot="vk-views-list"` (the list), `data-slot="vk-views-list-row"` (a view's row,
|
|
814
|
+
`data-key` its id) and `data-slot="vk-views-list-head"` (a phone's step head). A view's menu: `data-slot="vk-view-menu"` (the
|
|
815
|
+
menu), `data-slot="vk-view-menu-row"` (a row, `data-key` its item's key: `rename`, `edit`, `copy-link`, …),
|
|
816
|
+
`data-slot="vk-view-menu-name"` (the name box of Rename and New view), `data-slot="vk-view-menu-layout"` (New view's layout
|
|
817
|
+
card, `data-key` its id), `data-slot="vk-view-menu-columns"` (a board's columns' box) and `data-slot="vk-view-menu-act"` (a step's
|
|
818
|
+
Save or Create). Your `Menu` is handed the view menu's name as `data-slot` (`ViewsMenuProps`); ViewKit's own names each row
|
|
819
|
+
`vk-view-menu-row` by its item's key.
|
|
820
|
+
- The quick filters (`CONTROLS.QuickFiltersBody`): `data-slot="vk-quick"` (the body), `data-slot="vk-quick-head"` (a phone's head),
|
|
821
|
+
`data-slot="vk-quick-field"` (a field's pill, `data-key` its id), `data-slot="vk-quick-search"` (the search),
|
|
822
|
+
`data-slot="vk-quick-value"` (a value, `data-key` the value, `data-held` while it is held: read it beside the name, since the
|
|
823
|
+
Picker's rows carry a `data-held` of their own), `data-slot="vk-quick-count"` (its
|
|
824
|
+
count), `data-slot="vk-quick-clear"` (a held value's ✕) and `data-slot="vk-quick-none"` (nothing found).
|
|
825
|
+
|
|
750
826
|
Lists that scroll wear the class `scrollbar-overlay`, which an app may define (to show the OS
|
|
751
827
|
overlay scrollbar, say); without it the class does nothing.
|
|
752
828
|
|
|
@@ -762,20 +838,197 @@ a desktop and its `Sheet` on a phone, and marks its parts with these slots:
|
|
|
762
838
|
| `data-slot="vk-editor-refusal"` | the reason a refused value gave, under the editor; in a popover that scrolls, pinned to its bottom edge |
|
|
763
839
|
| `data-slot="vk-text-editor"` | a read-only text's box (`viewkitjs/views/editors/text`), unless its host names its own |
|
|
764
840
|
|
|
841
|
+
The frames an editor stands in keep their own names, apart from the parts inside: `data-slot="vk-date-editor"` wraps the date
|
|
842
|
+
editor's body in the grid (it draws as nothing, `display: contents`), and an app's own body stands in
|
|
843
|
+
`data-slot="vk-text-body"`, `data-slot="vk-number-body"`, `data-slot="vk-parts-body"`, `data-slot="vk-values-body"` or
|
|
844
|
+
`data-slot="vk-links-body"`. So `[data-slot^="vk-date"]` reaches the frame as well as the date editor's parts: name the part.
|
|
845
|
+
|
|
846
|
+
### The field editors' parts (VK-989)
|
|
847
|
+
|
|
848
|
+
Every part inside ViewKit's default field editors carries a public name, the same in the grid, the field row and the phone's
|
|
849
|
+
sheet, on the box a person sees (not the input inside it). Dress one part by its name and the rest stay as they are.
|
|
850
|
+
|
|
851
|
+
A part that repeats says which one it is: `data-key`, by its own key (a quick pick's, a part's, a field's, a record's, an item's
|
|
852
|
+
value), and a values row its place, `data-index`, from 0. A date day carries no `data-key`; it is told by its label, and a day,
|
|
853
|
+
month, year or quarter picked by `data-picked`, today's day and year by `data-today`. A Picker row lit by the keys or the pointer
|
|
854
|
+
carries `data-highlighted`. Where VK-991 hands your own control into a part (your `Button`, `Input`, `Select`, `Menu`,
|
|
855
|
+
`Calendar`), it is handed the part's `data-slot` and `data-key` as props: draw them on the element your stylesheet styles. A part's
|
|
856
|
+
name never starts ViewKit's reset: an editor you draw on your own, outside ViewKit's frames, draws as it did before it was named.
|
|
857
|
+
|
|
858
|
+
Every editor's ✕, ✓, a step's ‹ and the Picker's Cancel: `data-slot="vk-editor-close"`, `data-slot="vk-editor-save"`,
|
|
859
|
+
`data-slot="vk-editor-back"` and `data-slot="vk-editor-cancel"`, wherever ViewKit draws them: an editor's own phone head, the
|
|
860
|
+
sheet's bar (`vk-editor-bar`), and ViewKit's own Sheet when it holds them in its head (`sheetActions: "head"`). The sort and
|
|
861
|
+
filter sheets' own ✕, ✓ and ‹ carry the same names, in either place. An app's own Sheet draws its head's buttons itself, and a
|
|
862
|
+
sheet's own ✕, the one its head draws where the editor hands it none (a Picker of one value), is the sheet's: it carries no part's
|
|
863
|
+
name.
|
|
864
|
+
|
|
865
|
+
The date editor and its calendar:
|
|
866
|
+
|
|
867
|
+
| slot | the part |
|
|
868
|
+
| --- | --- |
|
|
869
|
+
| `data-slot="vk-date"` | the date editor, every form |
|
|
870
|
+
| `data-slot="vk-calendar"` | the default calendar (the components map's `Calendar`); its head and days take the date editor's names |
|
|
871
|
+
| `data-slot="vk-date-line"` | the typed line's box |
|
|
872
|
+
| `data-slot="vk-date-reads"` | what the typed line reads as |
|
|
873
|
+
| `data-slot="vk-date-error"` | why the typed line isn't a date |
|
|
874
|
+
| `data-slot="vk-date-time"` | the time's button beside the line, and a phone's time row |
|
|
875
|
+
| `data-slot="vk-date-head"` | the month's head |
|
|
876
|
+
| `data-slot="vk-date-prev"` | the last month's ‹ |
|
|
877
|
+
| `data-slot="vk-date-next"` | the next month's › |
|
|
878
|
+
| `data-slot="vk-date-month"` | the month's name, pressed for the months |
|
|
879
|
+
| `data-slot="vk-date-year"` | the year, pressed (or typed into) for the years |
|
|
880
|
+
| `data-slot="vk-date-days"` | the days' grid |
|
|
881
|
+
| `data-slot="vk-date-weekdays"` | the weekdays' row |
|
|
882
|
+
| `data-slot="vk-date-day"` | each day |
|
|
883
|
+
| `data-slot="vk-date-choices"` | the twelve months, or the twelve years |
|
|
884
|
+
| `data-slot="vk-date-choice"` | each month or year |
|
|
885
|
+
| `data-slot="vk-date-quarters"` | the quarter-hours |
|
|
886
|
+
| `data-slot="vk-date-quarter"` | each quarter-hour |
|
|
887
|
+
| `data-slot="vk-date-parts"` | the date and the time in boxes of their own |
|
|
888
|
+
| `data-slot="vk-date-part"` | the date's box, or the time's |
|
|
889
|
+
| `data-slot="vk-date-segment"` | each of a box's parts: day, month, year, hour, minute |
|
|
890
|
+
| `data-slot="vk-date-sep"` | the line over the quick picks |
|
|
891
|
+
| `data-slot="vk-date-picks"` | the quick picks |
|
|
892
|
+
| `data-slot="vk-date-pick"` | each quick pick (Today, Tomorrow, No date…) |
|
|
893
|
+
| `data-slot="vk-date-card"` | each card on a phone |
|
|
894
|
+
| `data-slot="vk-date-wheels"` | a phone's wheels |
|
|
895
|
+
| `data-slot="vk-date-wheel"` | each wheel |
|
|
896
|
+
| `data-slot="vk-date-wheel-row"` | each row of a wheel |
|
|
897
|
+
|
|
898
|
+
The text and number editors:
|
|
899
|
+
|
|
900
|
+
| slot | the part |
|
|
901
|
+
| --- | --- |
|
|
902
|
+
| `data-slot="vk-text"` | the text editor, every form |
|
|
903
|
+
| `data-slot="vk-text-box"` | its box (a phone number's: the box round the country, the dial code and the number) |
|
|
904
|
+
| `data-slot="vk-text-country"` | a phone number's country, pressed for the countries |
|
|
905
|
+
| `data-slot="vk-text-dial"` | a phone number's dial code |
|
|
906
|
+
| `data-slot="vk-text-note"` | why what was typed can't be kept |
|
|
907
|
+
| `data-slot="vk-number"` | the number editor, every form |
|
|
908
|
+
| `data-slot="vk-number-box"` | its box |
|
|
909
|
+
| `data-slot="vk-number-currency"` | the currency, pressed for the currencies |
|
|
910
|
+
| `data-slot="vk-number-unit"` | a unit that stays as it is: `%`, a currency's sign or code |
|
|
911
|
+
|
|
912
|
+
The name, place and range editors (one editor of parts; which part each box is, its key, says: given, family, shown, country,
|
|
913
|
+
line1, line2, postalCode, city, region, low, high):
|
|
914
|
+
|
|
915
|
+
| slot | the part |
|
|
916
|
+
| --- | --- |
|
|
917
|
+
| `data-slot="vk-parts"` | the editor, every form |
|
|
918
|
+
| `data-slot="vk-parts-field"` | each part's whole field: its label and its box |
|
|
919
|
+
| `data-slot="vk-parts-box"` | each part's box |
|
|
920
|
+
| `data-slot="vk-parts-line"` | a name's one line, as it is shown |
|
|
921
|
+
| `data-slot="vk-parts-own"` | the mark of a line written by hand |
|
|
922
|
+
| `data-slot="vk-parts-card"` | each card on a phone |
|
|
923
|
+
| `data-slot="vk-parts-pair"` | two parts side by side (first and last name; from and to) |
|
|
924
|
+
| `data-slot="vk-parts-note"` | a note under the parts: a range's unit, why it can't be empty |
|
|
925
|
+
| `data-slot="vk-parts-bands"` | a range's bands, picked whole |
|
|
926
|
+
|
|
927
|
+
The values editor (several emails, phones, links or domains):
|
|
928
|
+
|
|
929
|
+
| slot | the part |
|
|
930
|
+
| --- | --- |
|
|
931
|
+
| `data-slot="vk-values"` | the editor, every form |
|
|
932
|
+
| `data-slot="vk-values-rows"` | its rows, or its cards on a phone |
|
|
933
|
+
| `data-slot="vk-values-row"` | each value's row or card |
|
|
934
|
+
| `data-slot="vk-values-value"` | a value, pressed to change it (a phone card's box) |
|
|
935
|
+
| `data-slot="vk-values-edit"` | the box a value is changed in |
|
|
936
|
+
| `data-slot="vk-values-label"` | a value's label (Work, Mobile), pressed to change it where it can be |
|
|
937
|
+
| `data-slot="vk-values-main"` | the main one's mark |
|
|
938
|
+
| `data-slot="vk-values-pill"` | a value and its copy button together |
|
|
939
|
+
| `data-slot="vk-values-acts"` | a row's call, write or open and its remove, on a phone |
|
|
940
|
+
| `data-slot="vk-values-grip"` | the grip a value is moved by |
|
|
941
|
+
| `data-slot="vk-values-copy"` | copy |
|
|
942
|
+
| `data-slot="vk-values-open"` | call, write or open |
|
|
943
|
+
| `data-slot="vk-values-remove"` | remove |
|
|
944
|
+
| `data-slot="vk-values-line"` | the line a new value is typed in |
|
|
945
|
+
| `data-slot="vk-values-code"` | a phone number's country, pressed for the countries |
|
|
946
|
+
| `data-slot="vk-values-prefix"` | the dial code or the + before the line |
|
|
947
|
+
| `data-slot="vk-values-add"` | a phone's Add |
|
|
948
|
+
| `data-slot="vk-values-back"` | the head of a step (a label's, a country's) on a computer, its ‹ inside |
|
|
949
|
+
| `data-slot="vk-values-error"` | why a value can't be kept |
|
|
950
|
+
|
|
951
|
+
The links editor (the records a record is linked to, and what each link says):
|
|
952
|
+
|
|
953
|
+
| slot | the part |
|
|
954
|
+
| --- | --- |
|
|
955
|
+
| `data-slot="vk-links"` | the editor, every form |
|
|
956
|
+
| `data-slot="vk-links-search"` | the search's box |
|
|
957
|
+
| `data-slot="vk-links-list"` | the list of links and of what can be linked |
|
|
958
|
+
| `data-slot="vk-links-head"` | the table's head row |
|
|
959
|
+
| `data-slot="vk-links-rows"` | the links, or their cards on a phone |
|
|
960
|
+
| `data-slot="vk-links-row"` | each link: its row, or its card on a phone |
|
|
961
|
+
| `data-slot="vk-links-name"` | a link's record: its face and name; on a computer, its column's head too |
|
|
962
|
+
| `data-slot="vk-links-field"` | each field of a link (its cell, or its row on a phone or a step); on a computer, its column's head too |
|
|
963
|
+
| `data-slot="vk-links-value"` | a field's value, pressed to change it |
|
|
964
|
+
| `data-slot="vk-links-control"` | the switch, box or choice a field is changed with in place, and the lead's |
|
|
965
|
+
| `data-slot="vk-links-pop"` | a field's list, opened under it |
|
|
966
|
+
| `data-slot="vk-links-lead"` | which link leads; on a computer, its column's head too. Scope a rule under `vk-links-row` to leave the head out |
|
|
967
|
+
| `data-slot="vk-links-remove"` | a link's ✕ |
|
|
968
|
+
| `data-slot="vk-links-config"` | a link's fields, pressed to open them |
|
|
969
|
+
| `data-slot="vk-links-more"` | a phone card's ⋯ |
|
|
970
|
+
| `data-slot="vk-links-action"` | each row of that ⋯'s menu: `lead` (make it lead), `unlink` |
|
|
971
|
+
| `data-slot="vk-links-step"` | the head of a link's step on a computer |
|
|
972
|
+
| `data-slot="vk-links-back"` | that step's ‹ |
|
|
973
|
+
| `data-slot="vk-links-unlink"` | Unlink |
|
|
974
|
+
| `data-slot="vk-links-offers"` | the records offered to link |
|
|
975
|
+
| `data-slot="vk-links-offer"` | each record offered |
|
|
976
|
+
| `data-slot="vk-links-offer-action"` | each action among them (New company) |
|
|
977
|
+
| `data-slot="vk-links-note"` | what the list is doing, or why it is empty |
|
|
978
|
+
| `data-slot="vk-links-retry"` | Retry, when the search failed |
|
|
979
|
+
|
|
980
|
+
The Picker (every pick list: a select's, a status's, a relation's, a Select's list, and the lists inside the other editors):
|
|
981
|
+
|
|
982
|
+
| slot | the part |
|
|
983
|
+
| --- | --- |
|
|
984
|
+
| `data-slot="vk-picker"` | the Picker, both forms |
|
|
985
|
+
| `data-slot="vk-picker-search"` | the search's box |
|
|
986
|
+
| `data-slot="vk-picker-list"` | the list of rows |
|
|
987
|
+
| `data-slot="vk-picker-chips"` | the chips of what is held, beside the search |
|
|
988
|
+
| `data-slot="vk-picker-chip"` | each chip |
|
|
989
|
+
| `data-slot="vk-picker-option"` | each row (a panel's own row wears the panel's name instead) |
|
|
990
|
+
| `data-slot="vk-picker-parent"` | an open level's own row, on top |
|
|
991
|
+
| `data-slot="vk-picker-empty"` | the row that leaves the field empty |
|
|
992
|
+
| `data-slot="vk-picker-add"` | + Add: the row, or a phone's button, that asks the app to add what was typed |
|
|
993
|
+
| `data-slot="vk-picker-create"` | Create: the row, or a phone's button, that makes a new value |
|
|
994
|
+
| `data-slot="vk-picker-action"` | each of its actions (the views list's New view, a field's first action) |
|
|
995
|
+
| `data-slot="vk-picker-group"` | each group of rows under a heading |
|
|
996
|
+
| `data-slot="vk-picker-heading"` | each heading |
|
|
997
|
+
| `data-slot="vk-picker-card"` | each card of rows on a phone |
|
|
998
|
+
| `data-slot="vk-picker-selected"` | a phone's card of what is held |
|
|
999
|
+
| `data-slot="vk-picker-tick"` | a held row's mark: its tick, its box where several are held, or a phone's circle |
|
|
1000
|
+
| `data-slot="vk-picker-row-more"` | a row's ⋯ |
|
|
1001
|
+
| `data-slot="vk-picker-more"` | a phone's ⋯ for its actions |
|
|
1002
|
+
| `data-slot="vk-picker-back"` | the ‹ out of a level |
|
|
1003
|
+
| `data-slot="vk-picker-count"` | how many are held, with Clear |
|
|
1004
|
+
| `data-slot="vk-picker-clear"` | Clear all |
|
|
1005
|
+
| `data-slot="vk-picker-lead"` | the leading value's word |
|
|
1006
|
+
| `data-slot="vk-picker-lead-make"` | Make lead |
|
|
1007
|
+
| `data-slot="vk-picker-message"` | what the list says: searching, failed, nothing matches, nothing yet |
|
|
1008
|
+
| `data-slot="vk-picker-retry"` | Retry |
|
|
1009
|
+
| `data-slot="vk-picker-loading"` | Loading more |
|
|
1010
|
+
| `data-slot="vk-picker-foot"` | its foot: Create or + Add, and its actions |
|
|
1011
|
+
|
|
765
1012
|
## Ports
|
|
766
1013
|
|
|
767
|
-
Runtime services the app
|
|
1014
|
+
Runtime services the app may hand in through the provider, typed in `src/provider/ports.ts`. Each is optional, and
|
|
1015
|
+
`useViews().ports` always carries every one, the app's own or its default; each default reads the browser only when it is
|
|
1016
|
+
called, so a server render reaches none:
|
|
768
1017
|
|
|
769
1018
|
- `toast` — `success(message, { undo })`, `error(message)`, `info(message)`, `warning(message, { description })` (a change the person did not make). `undo`, where handed, takes the act back: offer it as the toast's Undo (an app's toast may ignore it, and then shows no Undo). Optional: an app that hands none sees ViewKit's Toast where the components map hands `PortsHost` (`CONTROLS` does), and nothing elsewhere. `useViews().ports.toast` is always there.
|
|
770
|
-
- `haptics` — `selection()`, `impact(style)`, `notification(type)
|
|
771
|
-
- `clipboard` — `writeText(text)` resolving to whether it succeeded; `readText()` resolving to the text or `null`.
|
|
772
|
-
- `viewPrefs` — `get(key)`, `set(key, value)`, `subscribe(key, listener)`: a per-device store for state a view keeps between visits. No view in this release reads it; the grid's preferences come in through `useGridTablePrefs`, from wherever the host keeps them.
|
|
773
|
-
- `confirm` — `confirm({ message, confirmLabel, subject, detail, destructive })` resolving to whether the person said yes; asked before a row's Delete, `subject` being the host's `deleteLabel`, and before a view's delete in `CONTROLS.ViewsListBody` on a computer, `detail` its one line on what follows. Optional: an app that hands none asks in ViewKit's alert dialog where the components map hands `PortsHost` (`CONTROLS` does), and elsewhere gets the browser's own confirm with `message`, and a rejection or a throw counts as no. `useViews().ports.confirm` is always a function.
|
|
1019
|
+
- `haptics` — `selection()`, `impact(style)`, `notification(type)`. Absent: haptics that do nothing.
|
|
1020
|
+
- `clipboard` — `writeText(text)` resolving to whether it succeeded; `readText()` resolving to the text or `null`. Absent: the browser's own clipboard, `false` and `null` where it refuses.
|
|
1021
|
+
- `viewPrefs` — `get(key)`, `set(key, value)`, `subscribe(key, listener)`: a per-device store for state a view keeps between visits. No view in this release reads it; the grid's preferences come in through `useGridTablePrefs`, from wherever the host keeps them. Absent: a store on the browser's `localStorage`, each value as JSON at the package's own `vk:` key, keeping nothing where storage is refused.
|
|
1022
|
+
- `confirm` — `confirm({ message, confirmLabel, subject, detail, destructive })` resolving to whether the person said yes; asked before a row's Delete, `subject` being the host's `deleteLabel`, and before a view's delete in `CONTROLS.ViewsListBody` and `CONTROLS.ViewMenu` on a computer, `detail` its one line on what follows. Optional: an app that hands none asks in ViewKit's alert dialog where the components map hands `PortsHost` (`CONTROLS` does), and elsewhere gets the browser's own confirm with `message`, and a rejection or a throw counts as no. `useViews().ports.confirm` is always a function.
|
|
1023
|
+
|
|
1024
|
+
The provider's `conventions` (the `FieldConventions` every value is read with) are optional too: absent, `en-US` in
|
|
1025
|
+
`UTC`, one object, the same on the server and in the browser.
|
|
774
1026
|
|
|
775
1027
|
## Icons
|
|
776
1028
|
|
|
777
1029
|
The glyphs the rendering asks for, by meaning. The app maps each name to a component taking
|
|
778
|
-
`className
|
|
1030
|
+
`className`, as the provider's `icons`; handed none, the provider draws each meaning through the map's `AppIcon` by its
|
|
1031
|
+
name, and `CONTROLS.AppIcon` draws ViewKit's own (`CONTROL_ICONS`, Tabler's as the Outright kit draws them). Field types: `text` `longText` `number` `percent` `currency` `date` `datetime` `duration`
|
|
779
1032
|
`boolean` `select` `status` `multiselect` `relation` `user` `url` `domain` `email` `phone` `location` `name` `actor`
|
|
780
1033
|
`rich_text` `range` `lookup` `rollup` `formula` `computed`. Who did it: `automation` `apiKey` `system` (a member wears `user`). Actions: `add` `edit` `delete` `copy` `cut` `paste` `clear` `hide` `show` `lock`
|
|
781
1034
|
`pin` `wrap` `more` `close` `check` `warning` `drag` `resize` `open` `selectRow`. Navigation and order: `chevronDown`
|
|
@@ -828,7 +1081,8 @@ and the plain row menu's `views.menus.row-open` ("Open page"), `views.menus.row-
|
|
|
828
1081
|
"Deselect", as text for a catalog's `select`), `views.menus.row-delete`, `views.menus.row-delete-confirm` (the
|
|
829
1082
|
browser's confirm before a delete: "Delete this row?") and `views.menus.row-delete-failed` (the error toast when the
|
|
830
1083
|
delete the host ran rejects: "Failed to delete the row"), and `views.menus.row-menu` (its name, handed to your `Menu` as
|
|
831
|
-
`label`: "Row actions")
|
|
1084
|
+
`label`: "Row actions"), and `views.menus.row-waiting` (the greyed row a row's menu holds while your `menus.row`
|
|
1085
|
+
answers: "Loading…"); a `command` field's verb menu's name: `views.menus.commands` (`{ field }`: "Actions for Stage")
|
|
832
1086
|
and `views.menus.commands-unnamed` ("Actions", when its opener hands no field); `views.menus.figure-menu`
|
|
833
1087
|
(`{ field }`: "Calculate Amount", the figure picker's name) and `views.menus.column-menu`
|
|
834
1088
|
(`{ field }`: "Options for Amount", a column menu's name);
|
|
@@ -875,7 +1129,9 @@ a batch, once, with the first refusal's words when it has any); and the warnings
|
|
|
875
1129
|
title on a money figure shown in another currency than its record's) and `views.display.as-shown` ("as shown",
|
|
876
1130
|
after that figure under a money editor).
|
|
877
1131
|
A field row's own word is under `views.field-row.*`: `views.field-row.empty` ("Empty", what a row the viewer may
|
|
878
|
-
edit draws when it holds nothing, muted; a row they can't edit draws "—").
|
|
1132
|
+
edit draws when it holds nothing, muted; a row they can't edit draws "—") and `views.field-row.set` (`{ label }`, "Set" and
|
|
1133
|
+
the label, each word lower-cased unless a capital stands inside it: "Set lost reason", "Set VAT number"; what the same row draws in
|
|
1134
|
+
a Field rows card on a phone).
|
|
879
1135
|
And the panels' words: the "For you" heading, `views.panels.for-you`; the Group
|
|
880
1136
|
panel's orders, `views.panels.group-order-most` ("Most first"), `views.panels.group-order-fewest`,
|
|
881
1137
|
`views.panels.group-order-newest`, `views.panels.group-order-oldest`, `views.panels.group-order-alphabetical`,
|
|
@@ -917,10 +1173,12 @@ picker's chip), `views.panels.view-fallback` ("View", the chip with no active vi
|
|
|
917
1173
|
`views.panels.view-create-row` (`{ label }`, "New view…", the picker's last row) and
|
|
918
1174
|
`views.panels.view-menu` ("View menu", a picker row's `⋮`).
|
|
919
1175
|
The ports' own (`CONTROLS.PortsHost`): `views.panels.toast-undo` ("Undo", a toast's way back) and `views.panels.alert-failed` ("That didn't go through. Nothing changed.", the alert dialog's failure with no words of its own).
|
|
920
|
-
A view's menu and what it opens (`CONTROLS.ViewsListBody` where the axis hands `verbs`, and `useViewMenu`): `views.panels.view-rename` ("Rename…") and `views.panels.view-rename-short` ("Rename", a phone's tile), `views.panels.view-edit` ("Edit view…"), `views.panels.view-private-toggle` ("Private view"), `views.panels.view-save-everyone` ("Save for everyone"), `views.panels.view-save-new` ("Save as new view…"), `views.panels.view-copy-link-short` ("Copy link", a phone's tile; a computer's is `views.panels.copy-link`), `views.panels.view-favorite` ("Favorite") and `views.panels.view-unfavorite` ("Unfavorite"), `views.panels.view-duplicate` ("Duplicate view") and `views.panels.view-duplicate-short` ("Duplicate", a phone's tile), `views.panels.view-delete` ("Delete view"), `views.panels.view-keep-one` ("A list keeps one view", why Delete can't be pressed), `views.panels.view-unsaved` ("Unsaved changes") and `views.panels.view-this` ("This view"), a phone's two headings, `views.panels.view-rename-title` ("Rename view"), `views.panels.view-name` ("Name"), `views.panels.view-create-action` ("Create view"), `views.panels.view-delete-title` (`{ name }`, "Delete Q3?"), `views.panels.view-deleted` (`{ name }`, "Q3 was deleted", the toast), `views.panels.view-copy-name` (`{ name }`, "Copy of Q3", a duplicate's name), `views.panels.view-delete-stays` (`{ records }`, "The deals in it stay as they are.") and `views.panels.view-delete-goes` ("The view goes for everyone who uses it."), the delete question's line, and `views.panels.view-columns` (`{ layout }`, "Board columns", the field a board's columns follow).
|
|
1176
|
+
A view's menu and what it opens (`CONTROLS.ViewsListBody` where the axis hands `verbs`, `CONTROLS.ViewMenu`, and `useViewMenu`): `views.panels.view-rename` ("Rename…") and `views.panels.view-rename-short` ("Rename", a phone's tile), `views.panels.view-edit` ("Edit view…"), `views.panels.view-private-toggle` ("Private view"), `views.panels.view-save-everyone` ("Save for everyone"), `views.panels.view-save-own` ("Save", a private view's Save, in its menu and Customize's foot), `views.panels.view-save-new` ("Save as new view…"), `views.panels.view-copy-link-short` ("Copy link", a phone's tile; a computer's is `views.panels.copy-link`), `views.panels.view-favorite` ("Favorite") and `views.panels.view-unfavorite` ("Unfavorite"), `views.panels.view-duplicate` ("Duplicate view") and `views.panels.view-duplicate-short` ("Duplicate", a phone's tile), `views.panels.view-delete` ("Delete view"), `views.panels.view-keep-one` ("A list keeps one view", why Delete can't be pressed), `views.panels.view-unsaved` ("Unsaved changes") and `views.panels.view-this` ("This view"), a phone's two headings, `views.panels.view-rename-title` ("Rename view"), `views.panels.view-name` ("Name"), `views.panels.view-create-action` ("Create view"), `views.panels.view-delete-title` (`{ name }`, "Delete Q3?"), `views.panels.view-deleted` (`{ name }`, "Q3 was deleted", the toast), `views.panels.view-copy-name` (`{ name }`, "Copy of Q3", a duplicate's name), `views.panels.view-delete-stays` (`{ records }`, "The deals in it stay as they are.") and `views.panels.view-delete-goes` ("The view goes for everyone who uses it."), the delete question's line, and `views.panels.view-columns` (`{ layout }`, "Board columns", the field a board's columns follow).
|
|
921
1177
|
The toolbar's words: `views.panels.show-counts` ("Show counts", the toolbar's toggle over the views' and the quick filters' counts,
|
|
922
1178
|
writing the view's `showCounts`),
|
|
923
|
-
`views.panels.toolbar-more` ("More", ⋯'s name in a folding toolbar line), `views.panels.
|
|
1179
|
+
`views.panels.toolbar-more` ("More", ⋯'s name in a folding toolbar line), `views.panels.toolbar-row` ("List tools",
|
|
1180
|
+
the name of a toolbar's row, each line a `role="toolbar"` of its own) and `views.panels.toolbar-bar` ("Sort and
|
|
1181
|
+
filters", the filter bar's name), `views.panels.view-clear` ("Clear") and
|
|
924
1182
|
`views.panels.view-save` ("Save") (the bar's Clear and Save, and the ready toolbar's Customize foot),
|
|
925
1183
|
`views.panels.toolbar-new` ("New", the New button's name and word), `views.panels.toolbar-options` ("Customize",
|
|
926
1184
|
the Options button's name and word), `views.panels.edit-view` ("Edit view…", the row the ready toolbar puts at the
|
|
@@ -957,8 +1215,8 @@ rows' and pages' names where the list names none, `views.panels.filter` ("Filter
|
|
|
957
1215
|
("Layout"), `views.panels.columns` ("Columns"), `views.panels.column` ("Column") and `views.panels.group`
|
|
958
1216
|
("Group"), with `views.panels.sort`, `views.panels.group-by`, `views.panels.date-by`,
|
|
959
1217
|
`views.panels.time-scope-label` and `views.panels.date-range-label` above, and the Columns row's value,
|
|
960
|
-
`views.panels.columns-shown` (`{ count }`, "3 shown"); its footer on a
|
|
961
|
-
("Save for everyone"), `views.panels.view-reset` ("Reset") and `views.panels.view-stale` ("Everyone's view
|
|
1218
|
+
`views.panels.columns-shown` (`{ count }`, "3 shown"); its footer on a saved view, `views.panels.view-publish`
|
|
1219
|
+
("Save for everyone"; `views.panels.view-save-own`, "Save", on the reader's own), `views.panels.view-reset` ("Reset") and `views.panels.view-stale` ("Everyone's view
|
|
962
1220
|
changed since you started."); and its actions, `views.panels.copy-link` ("Copy link to view"),
|
|
963
1221
|
`views.panels.export-csv` ("Export CSV"), `views.panels.share` ("Share"), `views.panels.coming-soon` ("Coming
|
|
964
1222
|
soon", a parked action's hint) and `views.panels.loading` ("Loading", the export's spinner).
|
|
@@ -1258,7 +1516,7 @@ opening its panel from its own button over the builder's panels (`ToolbarOptions
|
|
|
1258
1516
|
giving it back on the panel's own ✕, `useToolbarPanelState`, `ToolbarPanelState`, `FilterPanelContent`); the sort as up to three rules
|
|
1259
1517
|
(`ToolbarSortPill`, the sort editor's host `SortEditorHost` with `useSortEditorHost` and `SortEditorOptions`, and `SortFieldList`); the
|
|
1260
1518
|
and/or groups (`ToolbarAdvancedFilters`, the filter editor's host `FilterEditorHost`, `FilterFieldList` and `FilterValueBody`); and the ready toolbar over a
|
|
1261
|
-
list's settings (`ReadyToolbar`, `ReadyToolbarProps`) with a list held in memory (`useListSettingsState`). It is the one door that may reach dnd-kit (`@dnd-kit/core`,
|
|
1519
|
+
list's settings (`ReadyToolbar`, `ReadyToolbarProps`) with a list held in memory (`useListSettingsState`). It is the one door that may reach dnd-kit, with `/list`, whose `ListToolbar` draws its parts (`@dnd-kit/core`,
|
|
1262
1520
|
`@dnd-kit/sortable`, `@dnd-kit/utilities`), the package's optional peers, which the Columns list, the group
|
|
1263
1521
|
order, the view pills and the sort editor's rules drag with. It reaches them only through `import()`, started
|
|
1264
1522
|
as it loads (`loadPanelsDrag`), so the door itself loads in plain Node without them: an app that renders a part that drags installs
|
|
@@ -10,6 +10,7 @@ Every name the Avatar's stylesheet (`avatar.css`) reads, each optional: the read
|
|
|
10
10
|
| `--vk-fg-on-brand` | colour | `text-brand-inverse` | `hsl(0 0% 100%)` · dark `hsl(210 8% 5%)` |
|
|
11
11
|
| `--vk-fg-subtle` | colour | `text-subtle` | `hsl(0 0% 35%)` · dark `hsl(258 4% 72%)` |
|
|
12
12
|
| `--vk-fg-subtlest` | colour | `text-subtlest` | `hsl(210 1% 53.5%)` · dark `hsl(210 3% 53%)` |
|
|
13
|
+
| `--vk-fg-inverse` | colour | `text-inverse` | `hsl(0 0% 100%)` · dark `hsl(210 8% 95%)` |
|
|
13
14
|
| `--vk-label-amber-fill` | colour | `label-amber-fill` | `hsl(19 72% 92.5%)` · dark `hsl(20 42% 18.5%)` |
|
|
14
15
|
| `--vk-label-amber-strong` | colour | `label-amber-strong` | `hsl(23 85% 29%)` · dark `hsl(20 90% 76.5%)` |
|
|
15
16
|
| `--vk-label-blue-fill` | colour | `label-blue-fill` | `hsl(218 100% 94%)` · dark `hsl(219 46% 21%)` |
|
|
@@ -24,6 +25,13 @@ Every name the Avatar's stylesheet (`avatar.css`) reads, each optional: the read
|
|
|
24
25
|
| `--vk-label-red-strong` | colour | `label-red-strong` | `hsl(0 59% 39%)` · dark `hsl(6 100% 83%)` |
|
|
25
26
|
| `--vk-label-teal-fill` | colour | `label-teal-fill` | `hsl(196 52% 91.5%)` · dark `hsl(196 32% 17.5%)` |
|
|
26
27
|
| `--vk-label-teal-strong` | colour | `label-teal-strong` | `hsl(193 82% 26%)` · dark `hsl(196 67% 75.5%)` |
|
|
28
|
+
| `--vk-label-blue` | colour | `label-blue` | `hsl(219 87% 54%)` · dark `hsl(219 87% 59.5%)` |
|
|
29
|
+
| `--vk-label-green` | colour | `label-green` | `hsl(158 98% 26%)` · dark `hsl(158 98% 34%)` |
|
|
30
|
+
| `--vk-label-amber` | colour | `label-amber` | `hsl(25 92% 41%)` |
|
|
31
|
+
| `--vk-label-red` | colour | `label-red` | `hsl(0 81% 58%)` |
|
|
32
|
+
| `--vk-label-purple` | colour | `label-purple` | `hsl(260 100% 64.5%)` · dark `hsl(260 100% 69%)` |
|
|
33
|
+
| `--vk-label-pink` | colour | `label-pink` | `hsl(335 73% 49.5%)` · dark `hsl(335 73% 57.5%)` |
|
|
34
|
+
| `--vk-label-teal` | colour | `label-teal` | `hsl(192 87% 32%)` · dark `hsl(192 87% 40%)` |
|
|
27
35
|
| `--vk-neutral` | colour | `background-neutral` | `hsl(0 0% 94%)` · dark `hsl(225 7% 11%)` |
|
|
28
36
|
| `--vk-person-1` | colour | `person-1` | `#d7a77e` |
|
|
29
37
|
| `--vk-person-2` | colour | `person-2` | `#93b6ce` |
|
|
@@ -38,11 +46,14 @@ Every name the Avatar's stylesheet (`avatar.css`) reads, each optional: the read
|
|
|
38
46
|
| `--vk-font-size-2xl` | size | `text-2xl` | `24px` |
|
|
39
47
|
| `--vk-font-size-2xs` | size | `text-2xs` | `10px` |
|
|
40
48
|
| `--vk-font-size-3xs` | size | `text-3xs` | `8px` |
|
|
49
|
+
| `--vk-font-size-4xl` | size | `text-4xl` | `36px` |
|
|
41
50
|
| `--vk-font-size-sm` | size | `text-sm` | `14px` |
|
|
42
51
|
| `--vk-font-size-xl` | size | `text-xl` | `20px` |
|
|
43
52
|
| `--vk-font-size-xs` | size | `text-xs` | `12px` |
|
|
44
53
|
| `--vk-font-weight-semibold` | size | `font-weight-semibold` | `600` |
|
|
45
54
|
| `--vk-radius-2xl` | size | `radius-2xl` | `20px` |
|
|
55
|
+
| `--vk-radius-3xl` | size | `radius-3xl` | `26.67px` |
|
|
56
|
+
| `--vk-radius-4xl` | size | `radius-4xl` | `33.33px` |
|
|
46
57
|
| `--vk-radius-full` | size | `radius-full` | `9999px` |
|
|
47
58
|
| `--vk-radius-lg` | size | `radius-lg` | `10px` |
|
|
48
59
|
| `--vk-radius-md` | size | `radius-md` | `7.5px` |
|
|
@@ -12,7 +12,6 @@ Every name the stylesheet of the words beside a choice (`choice.css`) reads, eac
|
|
|
12
12
|
| `--vk-fg-subtle` | colour | `text-subtle` | `hsl(0 0% 35%)` · dark `hsl(258 4% 72%)` |
|
|
13
13
|
| `--vk-ground` | colour | `surface` | `hsl(0 0% 100%)` · dark `hsl(210 6% 7%)` |
|
|
14
14
|
| `--vk-hovered` | colour | `surface-hovered` | `hsl(0 0% 96.5%)` · dark `hsl(210 4% 9.5%)` |
|
|
15
|
-
| `--vk-selected` | colour | `surface-selected` | `hsl(0 0% 94.5%)` · dark `hsl(225 7% 15%)` |
|
|
16
15
|
| `--vk-border-width` | size | `border-width` | `1px` |
|
|
17
16
|
| `--vk-font-size-sm` | size | `text-sm` | `14px` |
|
|
18
17
|
| `--vk-font-size-xs` | size | `text-xs` | `12px` |
|
|
@@ -17,3 +17,7 @@ It also sets the popup line's own `--popup-line-more` and `--popup-line-under` o
|
|
|
17
17
|
| `--vk-line-height-sm` | size | `text-sm--line-height` | `1.4286` |
|
|
18
18
|
| `--vk-line-height-xs` | size | `text-xs--line-height` | `1.3333` |
|
|
19
19
|
| `--vk-spacing` | size | `spacing` | `4px` |
|
|
20
|
+
|
|
21
|
+
## Its parts
|
|
22
|
+
|
|
23
|
+
The Name, Place and Range editor names every part it draws with a public `data-slot`, the same in the grid, the field row and a phone's sheet, on the box a person sees: `vk-parts`, `vk-parts-field`, `vk-parts-box`, `vk-parts-line`, `vk-parts-own`, `vk-parts-card`, `vk-parts-pair`, `vk-parts-note`, `vk-parts-bands`. Each part's field and box say which part they are by `data-key` (`given`, `city`, `low`…). Its ✕, ✓ and a step's ‹ are `vk-editor-close`, `vk-editor-save` and `vk-editor-back`. Dress a part by its name, never by a class: [the field editors' parts](../contract.md#the-field-editors-parts-vk-989).
|