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/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,204 @@ Until 0.19.0 ViewKit shipped as three packages; their changes are in [fields/CHA
|
|
|
5
5
|
|
|
6
6
|
## [Unreleased]
|
|
7
7
|
|
|
8
|
+
## [0.33.0] — 2026-12-03
|
|
9
|
+
|
|
10
|
+
### Added
|
|
11
|
+
|
|
12
|
+
- `viewkitjs/views/react`: the provider's `panelControls` draws your own `Button`, `Select`, `Menu`, `Popover` and `Input` inside the sort and filter panels (`true`, or the names you want), each handed the components map's props and the part's `data-slot` and `data-key`. Nothing changes without it, and a control of `CONTROLS`' stays ViewKit's whatever it says. `PanelControlName`, `PANEL_CONTROL_NAMES` and `flatSelectItems` (a Select's rows one level in, flattened and named by their path) are exported.
|
|
13
|
+
- The components map takes an optional `Select` (`ViewsSelectProps`, `ViewsSelectItem`), drawn only inside the panels under `panelControls`; `CONTROLS.Select` (`MapSelect`, from `viewkitjs/views/controls`) is ViewKit's own. A `Select` of your own that `panelControls` doesn't name is never drawn, and the provider says so once in development.
|
|
14
|
+
- `ViewsButtonProps` takes `data-key`, `ViewsMenuItem` takes `slot` (a row's public name, which ViewKit's own Menu draws too), and `ViewsPopoverProps` takes `label` (its name to a screen reader).
|
|
15
|
+
- `viewkitjs/fields`: a url field can say `bareHost: "https"`. A host typed with no scheme (`acme.ro`, `acme.ro/work`) is then stored as `https://` and the host, where it was refused for naming no scheme. Every place a value is committed does it the same way: a grid cell, a paste, a field row, `acceptFieldCommit` and `zodFor` on your route. An address that names its scheme is kept as typed, text that is no host is still refused in the same words, the ceiling (`validation.maxLength`) counts what is stored, and a url kept as stored comes back as it was. Absent, nothing changes.
|
|
16
|
+
- `viewkitjs/fields`: `withUrlScheme(text)` is that rule: trimmed text naming no scheme, whose host holds a dot, with `https://` before it; anything else trimmed and unchanged.
|
|
17
|
+
- `viewkitjs/views`: `ViewsFilterBodyField.integer` is `true` on a number field that holds whole numbers only, so your own filter body's box can take whole numbers.
|
|
18
|
+
- `viewkitjs/views/model`: `withEditThroughLocks(config, fields)` gives a list's locks with each edit-through pair locked together: a lock stored under a worked-out field edited through a stored one (`editThrough`), or under that stored field, holds under both keys. The stored config is untouched, so each field keeps its own lock toggle. A surface that checks a lock by field key, such as a record's `LockedResolver`, passes its fields through it to agree with the grid.
|
|
19
|
+
- `viewkitjs/views/grid`: `cellCopyText(column, value, language?)` takes the names language a place's country is written in; without it, English, as before.
|
|
20
|
+
- `viewkitjs/postgres`: `FilterContext.sortCurrency`, the currency a money field that converts is sorted in when `currencies` names none for it, your app's own, say. The rows then order by each amount converted into it, so amounts in different currencies change places when the direction flips, while each row still reads in its own currency. A page's cursor is bound to it; one that is no currency is refused.
|
|
21
|
+
- `viewkitjs/fields/query`: `ViewFieldReader.sortAmountOf(row, key)`, the amount a money field sorts by when its cells show each row's own currency, converted into one currency for the whole list. `compareBy` orders by it, with no code clusters, where it answers both rows.
|
|
22
|
+
- `viewkitjs/views`: `ListColumn.sortAccessor`, set by `readMoneyColumns` on a convertible column read in Original: each row's figure in the reader's default currency. The grid's reader answers `sortAmountOf` from it, so an in-memory sort agrees with a server's sorted by `sortCurrency`. `readMoneyColumn` takes the currency as an optional third argument.
|
|
23
|
+
- `viewkitjs/views/list`: `List`, a whole list in one component. Hand it `id`, your fields (`defineFields`), your rows and one `save`, and it draws the toolbar, the grid, saved views, edits with undo and redo, and the bulk bar, in the Outright look, on a computer and a phone. Columns come from the fields, changed by key (`columns`, with `bind` for a field its key can't bind); the address carries the open view (`link`, on by default); `can` takes away editing or sharing; `menus`, `toolbarParts`, and `toolbar`, `grid` and `bulk` reach every part.
|
|
24
|
+
- `viewkitjs/views/list`: `ListGrid` (the grid reading its list root) and `ListBulkBar` (the selection bar over the root's picks), for an arrangement of your own inside `ListRoot`.
|
|
25
|
+
- `viewkitjs/views/list`: `ListRoot` takes a list's data in either mode: `fields`, `rows`, `columns`, `save` and `can`; in store mode `link={true}` carries the open view in the address, and the open view is kept on the device. `ListState` gains `columns`, `answer`, `edits` and `redo()`; `ListViewsState.openView` takes a change to lay over the view.
|
|
26
|
+
- `viewkitjs/views/list`: `ListToolbar` takes its `columns`, group heads and filter values from a root that holds a list's fields and rows.
|
|
27
|
+
- `viewkitjs/views/list`: the types `ListProps`, `ListGridProps`, `ListBulkBarProps`, `ListColumnOverride`, `ListColumnsOverride`, `ListFieldsRegistry`, `ListAnswerState` and `ListData`; `ListChange` and `ListSave` are named here too.
|
|
28
|
+
- `viewkitjs/views/list`: `List` and `ListRoot` take their rows from a `source` in place of `rows`: `fetchSource(url)`, or your server action as it stands. The list asks one list request per part it draws, each answer through `answerFor`. It asks for the first page as the settings or the quick filters' hold change, the next page and a group's next page as their ends come near, every matching row's ids as your app calls `select("all")`, each saved view's count while Show counts is on, the quick filters' counts while their panel is open, and each text field's values while a filter panel is open. An answer a newer request has outrun is dropped, and no page is asked with a cursor from older settings. While the first page is out the grid shows its wait; a group the source sends unnamed takes its field's name. A refusal shows in the grid's empty state in your server's words; a throw is said through the toast, and the rows shown stay. Picks clear as the quick filters' hold changes, as they do for the search, filter and group. `pageSize` sets a page, 50 by default, held between 1 and 1000.
|
|
29
|
+
- `viewkitjs/views/list`: `ListRoot` and `List` take `quickFilters`, whose hold narrows the rows, held in memory or from a source. `ListState` gains `loadMore()` and `loadGroup(key)`; `ListAnswerState` gains `more`, `paged`, `viewCounts` and `holdCounts`.
|
|
30
|
+
- `viewkitjs/views/react`: every button the toolbar draws now hands your `ToolbarButton` its `part`, named after the `toolbarParts` place it stands in: `options`, `search`, `quick`, `new`, `sort`, `filter`, `filter-add`, `filters` (each of a rule's four joined buttons), `advanced-filters` and `sort-pill`; a place's second kind of button by a name of its own, `sort-add` (the + after the sort) and `more-filters` ("+N filters"); and ⋯ `more`. Before, only the views row's parts, Clear and Save in an app's own frame were named. New type: `ViewsFramePart`, those six.
|
|
31
|
+
- `viewkitjs/views/react`: `ViewsToolbarButtonProps` takes `className`, the class its toolbar place hands: put it on the button. ViewKit's own button and `CONTROL_ATOMS`' put it there.
|
|
32
|
+
- `viewkitjs/views/panels/react`: a `toolbarParts` place (`ToolbarPartPlace`) takes `className`, put on every toolbar button the part draws, and `button`, your own button for the part, drawn in place of your `ToolbarButton` and handed the same props, `ref` included, so what it opens still hangs at it. Hand neither and every toolbar draws exactly as before.
|
|
33
|
+
- `viewkitjs/views`: every part inside the default panels has a public name. The sort, filter and group editors, Customize, the views list, a view's menu and the quick filters mark each part with a `data-slot` of its own (`vk-sort-rule`, `vk-sort-add`, `vk-filter-rule`, `vk-customize-section` …, listed in `PANEL_SLOTS` and the contract), and a part that repeats says which one it is (`data-key`; a rule its place, `data-index`), so an app's stylesheet dresses one sort rule, Add sort or one Customize section on its own. An app that styles nothing draws as before.
|
|
34
|
+
- `viewkitjs/views/controls`: a Menu list's entry and choice and a Picker's item take `slot` (`PartSlot`), drawn on the row in every form; the Select's box, the Radio's label, `PaneHead`, `PaneFoot`, `Notice` and a Menu's popup take a handed `data-slot`; the Picker's `menuSlot` names its rows' menus.
|
|
35
|
+
- `ViewsMenuProps` takes `data-slot`: ViewKit's own Menu draws it on its popup and names that menu's rows by their items' keys.
|
|
36
|
+
- `data-toolbar-item`, the folding toolbar's mark of each place (its key, an app's own included), is public.
|
|
37
|
+
- `viewkitjs/views/controls`: every part inside the default field editors has a public `data-slot`, the same in the grid, the field row and a phone's sheet, on the box a person sees: the date editor and its calendar (`vk-date-*`, `vk-calendar`: its quick picks, line, time, head, days, months, years, quarters, parts, wheels), the text and number editors (`vk-text-*`, `vk-number-*`), the name, place and range editor (`vk-parts-*`, each part by `data-key`), the values editor (`vk-values-*`, each row by `data-index`) and the links editor (`vk-links-*`, each link by its record, each field by its id); every editor's ✕, ✓ and a step's ‹ are `vk-editor-close`, `vk-editor-save` and `vk-editor-back`. Listed in `EDITOR_PART_SLOTS` and `docs/contract.md`. An app dresses one part by its name; with nothing dressed, every editor draws as it did.
|
|
38
|
+
- `Input` draws a handed `data-slot` and `data-key` on its box; `Field` on its root in every form; `SheetButton` and `SheetHead` (`backSlot`) on their buttons.
|
|
39
|
+
|
|
40
|
+
### Changed
|
|
41
|
+
|
|
42
|
+
- The filter editor's field and how boxes carry `vk-filter-field` and `vk-filter-how` on the box itself (the Select's, `data-kit="select"`), as the sort's do, no longer on the box's wrapper. A stylesheet that dressed the wrapper by those names now dresses the box.
|
|
43
|
+
- `viewkitjs/views/react`'s size budget rises from 25 to 30 kB gzipped: the provider's `panelControls`, `PANEL_CONTROL_NAMES`, `flatSelectItems` and the own-control mark brought it to 25.0 kB.
|
|
44
|
+
- `viewkitjs/views`: a column's `indicator` is handed the value its cell shows beside the row, as `render` is: `indicator?: (row, cell?: { value })`. While a write saves (a paste, a fill, an edit), `cell.value` is the value being saved, which the cell already draws; otherwise it is what `accessor` reads. An indicator read from `cell.value` agrees with the value beside it from the moment it shows, and goes back with it if the save fails. An indicator that reads only the row works as before.
|
|
45
|
+
- A money column read in each row's own currency, sorted in memory after `readMoneyColumns`, now orders by its amount in the reader's default currency instead of clustering by code first. Hand `context.sortCurrency` to `viewkitjs/postgres` for the same order from the server.
|
|
46
|
+
- `viewkitjs/views/list`'s size budget rises to 360 kB gzipped: the door now carries the grid, the save path and the in-memory answers `List` draws with. `ReadyToolbar` and `ListToolbar` don't load them.
|
|
47
|
+
- The tarball's unpacked budget rises from 10500 kB to 11560 kB: with the ready List and this release's other additions the package unpacks to 10505 kB. The new budget is that measure plus 10%, rounded up to the next 5 kB, the rule a first budget takes.
|
|
48
|
+
- `viewkitjs/views/react`: `ViewsToolbarButtonPart` now names every toolbar button, so an atom that dressed any `part` as the views row's, Clear's or Save's dresses Sort, New and the rest that way too. Dress by the six alone, and key a record by `ViewsFramePart`:
|
|
49
|
+
|
|
50
|
+
```tsx
|
|
51
|
+
// Before
|
|
52
|
+
const SLOT: Record<ViewsToolbarButtonPart, string> = { /* the six */ };
|
|
53
|
+
if (part) return <FrameButton data-slot={SLOT[part]} />;
|
|
54
|
+
|
|
55
|
+
// After
|
|
56
|
+
const SLOT: Record<ViewsFramePart, string> = { /* the six */ };
|
|
57
|
+
const FRAME = new Set<string>(Object.keys(SLOT));
|
|
58
|
+
if (part && FRAME.has(part)) return <FrameButton data-slot={SLOT[part as ViewsFramePart]} />;
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
- `viewkitjs/views/react`: an atom that spreads its leftover props onto its element now spreads `part` too (`part="sort"` on the button): take `part` out of the props first, as you take `icon` and `label`.
|
|
62
|
+
- The reset ViewKit's stylesheet holds to its own elements starts at no part's name: an editor an app draws on its own, outside ViewKit's frames, draws as before.
|
|
63
|
+
- The date editor's roving day is marked `data-stop` (was an internal `data-key`), so a public `data-key` rule never catches it.
|
|
64
|
+
|
|
65
|
+
### Fixed
|
|
66
|
+
|
|
67
|
+
- `viewkitjs/views/field-row`: one click on a text, email, phone, link or number row inside a dialog that takes back a focus fallen to the page (Base UI's Dialog, which returns it to its popup) opens the row's editor and keeps it open. The row now holds the focus while its editor takes the button's place, so the focus never falls to the page; a click away, Escape and Tab close the editor as before.
|
|
68
|
+
- `viewkitjs/views/grid`: a value whose field has commands (its ▾) no longer loses its last 8px to an ellipsis when its column has room; in a narrow column it still ends in "…", with the ▾ inside the cell.
|
|
69
|
+
- `viewkitjs/views/grid`: a fraction pasted into a whole-number column is rounded, as typing it is, instead of being refused when it is saved.
|
|
70
|
+
- `viewkitjs/views`: the filter editor's number box on a whole-number column rounds what is typed to a whole number.
|
|
71
|
+
- `viewkitjs/views/grid`: a lock on a stored field now locks the worked-out field edited through it, and a lock on the worked-out field locks the stored field it writes, through every write route (editor, Delete, fill, paste, the selection bar).
|
|
72
|
+
- `viewkitjs/views/grid`: copying a place cell names its country in the names language (`conventions.language`), as the cell shows it: "Budapest, Ungaria" under Romanian, where it always wrote English. A paste of that country into the place's Country part still reads it back.
|
|
73
|
+
- `viewkitjs/fields/query`: a number sort in memory places NaN and the infinities where Postgres orders a numeric or a float8: -Infinity below every number, then Infinity, then NaN, whether the value is a JavaScript number or decimal text ("NaN", "Infinity"). A list sorted in memory and the same list sorted by the database now agree. The number filter still reads them as empty.
|
|
74
|
+
- `viewkitjs/postgres`: a formula that concatenates text is written in functions an index can hold, with the same answers, so `searchIndexes` prints its trigram index (a first and last name joined with `concat`, say) instead of naming it unserved. A concat of a day, an instant or a number is still unserved.
|
|
75
|
+
- `viewkitjs/views/controls`: on a computer, ViewKit's own Popover holding the sort editor (the ready toolbar's Sort, with a rule) is as wide as its rows, so each rule's grip, field, direction and × stand inside it; it was 288 px and cut them off. It never goes under 288 px nor past the room on screen, and with no rule Add sort's fields open at 288 px as before. An app's own Popover, or its own width on this one, is unchanged.
|
|
76
|
+
|
|
77
|
+
## [0.32.0] — 2026-12-03
|
|
78
|
+
|
|
79
|
+
### Added
|
|
80
|
+
|
|
81
|
+
- `viewkitjs/views/grid`: `GridTable`'s `menus.row` may answer a promise, for a host whose verbs depend on the row and its server. It is asked once each time a row's menu opens (a right-click, the row's ⋯, the menu key), never for a row drawn or pressed; until it answers, the menu holds one greyed row with the `loading` glyph, "Loading…" (`row-waiting`, the new message `views.menus.row-waiting`), and none of the rows the answer may take away. An answer a later opening has outrun is dropped; one that fails draws the grid's own rows. A `menus.row` that answers at once draws as before.
|
|
82
|
+
- `viewkitjs/views/grid`: under `menus.row`, a row's Open page and Delete are among its items, `row-open` and `row-delete` (Delete still asking the `confirm` port), so a host offers Delete on some rows and not others by dropping `row-delete`; the `RowMenu` atom is then handed no `openHref` or `onDelete`. Without `menus.row`, the atom draws them as before.
|
|
83
|
+
- `viewkitjs/views/list`: a list's saved views behind a store ViewKit owns. A `ListRoot` handed no `settings` keeps the list's saved views, each person's draft over a view and their own layer through a `ViewsStore`: `browserViewsStore()` by default, in `localStorage` and followed across tabs, or your app's own store over its API. Hand your own views as `views={{ seed }}` (listed first, read-only), the list's start as `defaults`, and the address's reading as `link`. `ListToolbar` draws the views row from it: open, save, save as new view, rename, duplicate, delete with Undo through ViewKit's toast, reorder by dragging. New on the door: `browserViewsStore`, `BrowserViewsStoreOptions`, `ListViewsOptions`, `ListViewsState`, `SavedViewInput`, `ViewDraft`, `ViewSeed`, `ViewsStore`; `ListState.views`.
|
|
84
|
+
- A new word, `views.panels.view-save-own` ("Save"): a person's own view's Save, in its menu and Customize's foot.
|
|
85
|
+
- `viewkitjs/views/react`: `ViewsProvider` needs only `components`. `<ViewsProvider components={CONTROLS}>` draws every list with ViewKit's own glyphs, the browser's clipboard, a per-device store on `localStorage` and `en-US` in `UTC`. `icons`, `ports` and `conventions` are optional, and each port is optional on its own: hand only what your app does its own way, and what you hand wins.
|
|
86
|
+
- `viewkitjs/views/react`: a provider handed no `icons` draws each meaning through your components map's `AppIcon` by its name.
|
|
87
|
+
- `viewkitjs/views/react`: the ports' defaults: `haptics` that do nothing; the browser's own `clipboard`, resolving `false` and `null` where it refuses; a `viewPrefs` store keeping each value as JSON on `localStorage` at the package's own `vk:` key. Each reads the browser only when it is called, so a server render reaches none.
|
|
88
|
+
- `viewkitjs/views/react`: `conventions` default to `en-US` in `UTC`, one object, so the server and the browser draw the same.
|
|
89
|
+
- `viewkitjs/views/controls`: `CONTROLS.AppIcon` draws ViewKit's own glyph of each meaning's name (a Tabler icon as the Outright kit draws it), and `CONTROLS.Markdown` draws rich text as it stands, its line breaks kept, with no renderer. `CONTROLS` now fills every required slot.
|
|
90
|
+
- `viewkitjs/views/controls`: `CONTROL_ICONS`, ViewKit's default glyphs by meaning, for an app with its own `AppIcon` that keeps them: `icons={CONTROL_ICONS}`.
|
|
91
|
+
- `viewkitjs/views/grid`: `gridSave(save, { getRowId, values?, read? })`, the grid's two commit functions over one save your app gives, and its types `ListChange` and `ListSave`. Every write (an edit, a paste, a fill, an undo, a redo) is one `save` call per record with its cells' values merged, one call in flight per record, and what still waits is sent at once, marked `closing`, when the page closes. A cell whose `values` throws is refused alone; a save that rejects rolls back that record's cells; `stored` shows in the cells whose keys it holds.
|
|
92
|
+
- `viewkitjs/views/list`: `ListRoot` and `useList`. A list root holds one list's state (its settings, its open panel, its selection) in a store outside React, for every part inside it, wherever it stands. A part reads it with `useList(select)` and re-renders only when what it selected changes.
|
|
93
|
+
- `viewkitjs/views/list`: `ListToolbar`, the ready toolbar's parts reading the root around them, and the types `ListRootProps`, `ListState` and `ListToolbarProps`.
|
|
94
|
+
- `viewkitjs/views/list`: `ListSlot` and `ListFill`. Put `<ListSlot name="header" />` where you want it (your page header), and `<ListFill name="header">…</ListFill>` inside a `ListRoot`: what the fill holds draws in the slot and still reads and changes that list, as if it stood inside. With no slot of its name standing, a fill draws nothing. `ListSlotProps` and `ListFillProps` with them.
|
|
95
|
+
- `viewkitjs/views/list`: `useList(id, select, equal?)` reads a list by its root's `id` from anywhere under the `ViewsProvider` (a count in a page header, a drawer, a sidebar); `undefined` while no root of that id stands. `useList(select, equal?)` inside a root is unchanged.
|
|
96
|
+
- Each line of a `Toolbar` (the ready toolbar's row and its filter bar) draws `role="toolbar"` with its own name, from two new words: `views.panels.toolbar-row` ("List tools") and `views.panels.toolbar-bar` ("Sort and filters").
|
|
97
|
+
- `viewkitjs/views/list`: a list's menus hand you their default items as data (+ Add column takes no function yet). `ListMenus` holds a function per menu (`column`, `row`, `group`, `view`, `add`, `more`), each handed the menu's items, every row keyed, and returning the items it shows; a menu with no function is as before. `menu.drop`, `menu.rename`, `menu.add` and `menu.move` make the usual changes, pure, keeping dividers whole; `MenuPlace` says where a row goes (`{ after: key }` or `{ before: key }`). Every default key is listed in the reference ("Default keys").
|
|
98
|
+
- `viewkitjs/views/grid`: `GridTable`'s `menus` (`GridMenus`): `column(items, { field, column })`, `row(items, { row })` and `group(items, { group })` reshape a column's menu, a row's and a group band's.
|
|
99
|
+
- `viewkitjs/views/panels/react`: `ReadyToolbar`'s and `ListToolbar`'s `menus` (`ToolbarMenus`): `view(items, { view })` reshapes a view's menu, `add(items)` New's items (your `addItems`, or with `onAdd` alone one row keyed `new`), `more(items, { line })` the folded parts' ⋯, told which line's (`row` or `bar`). `Toolbar` takes `more` (`ToolbarMore`).
|
|
100
|
+
- `viewkitjs/views/panels`: `withViewMenu(views, fn)` sets a view's menu function on every axis, beside `withEditView`; `ViewMenuFn` is its type.
|
|
101
|
+
- `viewkitjs/views`: `ViewsMenuItem.render` draws a plain row's inside yourself, its `label` still its name; `ViewsViewVerbs.menu` is a view's menu as data; `ViewsRowMenuItem.key` names a row of the row's menu.
|
|
102
|
+
- `viewkitjs/postgres`: `listHandler({ map, run, access })` answers every list request a page makes, from a Fetch Request to a Response (Next, Hono, a Worker): 200 with the answer, 400 with a refusal, 401 when `access` finds no reader. `answerList(request, { map, run, access, readable })` is the same answer called directly, for a server action. The map, the permission condition and the readable fields are always the server's, never the request's. A search reads the fields you name in `search`, or every field the reader may read that a search answers.
|
|
103
|
+
- `viewkitjs/postgres`: the refusal codes `bad-request` (the body is no list request) and `reserved-id` (a field map holding a field keyed `id`, the key a list's answer keeps for the record's id).
|
|
104
|
+
- `viewkitjs/views/grid`: `GridTable` takes `rowWritable`, `(row) => boolean`, a per-row answer to whether a row's cells write, for a reader who may edit some records and not others. A row it refuses opens no editor, takes no typing, paste, fill, clear, cut or bulk-bar write, marks its cells `aria-readonly`, and answers a person's try with the existing `views.grid.cell-read-only` ("Cell is read-only"); a paste, fill or clear over it writes the other rows and says how many cells it refused. It only takes away from what the columns and `listConfig` allow. Left out, the grid is unchanged.
|
|
105
|
+
- `viewkitjs/fields/query`: one list request and its answer, the same in the browser and on a server.
|
|
106
|
+
- `listRequestSchema` is version 1, by part: `rows`, `group`, `ids`, `counts`, `values` and `view-counts`. Its settings are the settings' own parts.
|
|
107
|
+
- `listAnswerSchema` has one answer per part, plus a refusal as a value. A row is your own flat row, `{ id, ...values }`.
|
|
108
|
+
- With them: `answerFor`, `isRefused`, and their types.
|
|
109
|
+
- `viewkitjs/fields/query`: `savedViewSchema` and `SavedView`, a saved view whose settings never keep the search. Also `listRequestSettingsSchema` and `savedSettingsSchema`.
|
|
110
|
+
- `viewkitjs/views/list`, a new entry: `ListSource`, one function from a list request to its answer, so a server action is a source as it stands; and `fetchSource(url)`, a source that POSTs the request to a route.
|
|
111
|
+
- `viewkitjs/views/controls`: `CONTROL_ATOMS.ToolbarButton` draws the ready toolbar's buttons with the toolbar button control, in the Outright look. The search's button, New, the sort, Filter, View settings and a filter's joined parts get it. In your own toolbar frame, so do the views chip, the view tabs, "+N", "+", Clear and Save. New takes the form the Toolbar's New option picks (nothing set: primary, with its word), and the view tabs take the Toolbar's tabs option. An app that doesn't spread `CONTROL_ATOMS` keeps ViewKit's own button.
|
|
112
|
+
- `viewkitjs/views/controls`: the Picker draws + Add. Handed `onAdd`, it offers a row after the matches, "Add “word”", while the word is typed and no option names it; a press or Enter on it calls `onAdd` with the word and picks nothing. Handed `adding`, the row reads "Adding “word”…", greyed with a spinner, and can't be pressed; handed `addRefused`, those words stand where the row was until something else is typed. On a phone the bar's Add does the same. `PickerWords` gains `add`, `adding` and `addButton` (English: "Add “word”", "Adding “word”…", "Add").
|
|
113
|
+
- `viewkitjs/postgres`: `REQUEST_LIMITS.ids` (100,000), which a field map lowers with `limits: { ids }` like the other caps.
|
|
114
|
+
- `viewkitjs/views/controls`: a setting row's action takes its kind, `SettingAction.kind` (`"outline"` or `"danger"`); left out it is what it was, danger in the danger zone and outline elsewhere, so a danger zone can hold an undoable action outlined (Leave) beside a final one in red (VK-942).
|
|
115
|
+
- `viewkitjs/views/controls`: `SettingRow` takes `state` (`SettingState`: `label`, `colour`), a word of state before its control on a computer, drawn as the Option in its colour (Connected, green), before the locked reason; a phone draws none yet. An app drawing it loads the Option's stylesheets (`tag.css`, `option.css`) beside the setting row's (VK-943).
|
|
116
|
+
- `viewkitjs/views/controls`: the Select takes `labelAt: "inside"`. Its label stands inside its box, before its value, in the quieter words; the box is the outline Button's own (its ground, edge, depth and states) at the Select's size, as wide as what it holds and never wider than its place: a filter, Person Anyone ⌄. It is named by its label and its value, as with the label above. A field typed into (`searchIn="field"`) keeps its label above.
|
|
117
|
+
- `viewkitjs/views/controls`: `Icon` draws `archive`, `key`, `user-plus`, `bot`, `layers`, `sliders`, `lock` and `dots-vertical`, Tabler's at stroke 2, like the rest.
|
|
118
|
+
- `viewkitjs/views`: the components map takes `ViewMenu` (`ViewsViewMenuProps`), optional: one view's whole menu at an anchor, handed `open`, `onOpenChange`, `anchor`, `align`, the view (`view`), the axis's views (`views`), the view in use (`value`), `verbs`, `onDone` and `onHold`. On a computer, where the axis hands `verbs`, a views row's pill opens it (the open pill on a click on it again or a right-click, another on a right-click) and so does a folded view's ⋮ in the "+N" list; left out, they open the view's `menu` rows, as before.
|
|
119
|
+
- `viewkitjs/views/controls`: `CONTROLS.ViewMenu`, the views list's own view menu at a pill: Rename…, Edit view…, Save, Reset, Save as new view…, Copy link, Duplicate and Delete, its items reshaped by `verbs.menu` and drawn by your `Menu`; Rename and New view ask in the Modal, Delete asks through your `confirm` port and says so through your `toast` port, with Undo.
|
|
120
|
+
- `viewkitjs/views/panels/react`: `PillGroup` and `ViewPickerRow` take `viewMenu` (`PillViewMenu`, from `viewkitjs/views/panels`); `FoldingViewRow` hands it where the axis hands `verbs` and your map draws `ViewMenu`.
|
|
121
|
+
- `viewkitjs/views`: the TagField takes `fixed` (tags that stay first, with no remove button, which Backspace passes by) and `asides` (a quiet word after a tag's name, by its name); the Tag takes `aside`. The Tag's stylesheet reads `--vk-font-weight-normal`.
|
|
122
|
+
- `viewkitjs/views/controls`: `--field-rows-line-end`, a length a place sets round its Field rows cards: the rule between two rows then ends that far short of the row's right edge. Unset, 0, as before.
|
|
123
|
+
- `viewkitjs/views/controls`: `SettingRow` takes `colour`, a label colour for its icon's tile, and `SettingIcon` draws a row's icon on its own, for a list that draws its names itself.
|
|
124
|
+
- `viewkitjs/views/looks`: the setting row's `icon` option, a phone's: `line` (the default), the glyph alone in the subtle text, or `tile`, a white glyph on a tile of the row's `colour` (grey when none), set by `data-setting-row-icon`.
|
|
125
|
+
- `viewkitjs/views/field-row`: the field row's frame is yours to set, by seven variables declared on a section or any ancestor of its rows: `--vk-field-row-label-w` (the label column on a desktop, undeclared what `w-32` drew), `--vk-field-row-gap` (the gap between glyph, label, value and lane, what `gap-3` drew), `--vk-field-row-h` (the row's least height, its content standing in the middle, `auto`), `--vk-field-row-py` (its padding above and below, what `py-2.5` drew), `--vk-field-row-line-w` (the line under every row but the last, `1px`; `0px` draws none), `--vk-field-row-line` (that line's colour, `--vk-border`) and `--vk-field-row-label-fg` (the label's colour, `--vk-fg-subtle`). Undeclared, every row draws as before. Inside a `FieldRows` card on a phone the row is drawn by the card's frame instead, and none of them apply.
|
|
126
|
+
- `viewkitjs/views/field-row`: on a phone, a field row inside a `FieldRows` card is one of the card's rows: its glyph in the card's glyph lane, its label in the card's label column and its value on the same line, in the card's height, insets and line. A `›` in its lane says where its press opens a sheet (a pick, a date, a record, several values), and a press anywhere on the row opens what its edit button opens (never on a control of its own, a row whose value is a verb menu, while its write is pending or while the record loads). On a computer, and outside a card, the row is unchanged; ViewKit's own editor panel, `Sheet` and `Modal` opened from a card's row draw their rows as rows outside any card (an app's own dialog drawn inside the card keeps the card's form). A row's padding gives a value that wraps room above and below it; a one-line row keeps the card's height.
|
|
127
|
+
- A new message key, `views.field-row.set` (`{ label }`): what a writable empty row in a card reads, "Set" and its label, each word lower-cased unless a capital stands inside it ("Set source", "Set VAT number", "Set LinkedIn URL"). A resolver that words every key words this one too.
|
|
128
|
+
- `FieldRows`: a row may open with a glyph lane (`o-field-row-glyph`), 20 wide, its glyph centred; a row holding one starts the line above it from the words, after the lane; a label's one long word breaks inside its column.
|
|
129
|
+
- `viewkitjs/views`: the Avatar draws at 96 (`size={96}`, a photo on a phone), its initials at `--vk-font-size-4xl`, a square's corner two steps past 64's (`--vk-radius-2xl` at Medium; `--vk-radius-xl`, `--vk-radius-3xl`, `--vk-radius-4xl` at Small, Large and Extra large). The Avatar reads three new names: `--vk-font-size-4xl`, `--vk-radius-3xl`, `--vk-radius-4xl`.
|
|
130
|
+
- `viewkitjs/views`: on a phone (`data-vk-phone`), the Radio's swatches stand 28 across, 13 apart, on a card of their own (`--vk-overlay-card`, `--vk-radius-xl`), the chosen one ringed in the text colour, grey keeping the field's edge; its pictured cards stand as three phones, 46 × 88, spaced round on a card of their own, each over its name, the chosen one framed in the brand and its name a pill in the brand, the mark out of sight. On a computer nothing changes.
|
|
131
|
+
- `viewkitjs/views/controls`: `HeaderBar` and `SheetHead` take `mark`, a record's mark (an `Avatar`, 24 suits the bar) drawn before the title. It never shrinks while a long title cuts with … beside it; the two stand together, centred, or at the left after the left place when `titleAt` is `left`; with a description the mark stands beside both lines. It is hidden from screen readers, since the title says the name, and the sheet keeps its title as its name. A bar with no `mark` renders and draws as before.
|
|
132
|
+
- `viewkitjs/views/controls`: `ToolbarControl` takes `fill`: its row's worded buttons grow to share the row's width while its square ones keep theirs, and as the row narrows the first worded button with an icon keeps its words until the rest have given theirs up and folded into ⋯. The filter bar under it draws as before.
|
|
133
|
+
- `viewkitjs/views/controls`: `ToolbarControl` takes `more`, a list of Menu entries: ⋯ then stands at the row's end holding them, and what folds joins them in the row's order (an empty list: ⋯ stands there once something folds). A Toolbar handed neither draws as before.
|
|
134
|
+
- `viewkitjs/views/controls`: a `Field` placed in `FieldRows` draws as the card's row, as iOS's Settings draws a field: its label in the row's column, its `Input` or `InputGroup` typed in place beside it (no box in any state, the text colour, the caret in the brand, cut with "…" at rest; read-only in the quietest text with no caret), an `InputGroup`'s start words its prefix and its end button in the brand, and `saving` and `saved` at the row's end, the end button out of their way. Its note and error stand under the card, in a foot `FieldRows` draws after it while any Field in it has one (`.o-field-rows-foot`): the notes as one in the order their Fields came (the rows' order, unless a row came later), an error in their place, each still tied to its control by `aria-describedby`; a disabled value in the disabled text. A Field inside a `FieldRowsRow`, and every `FieldRowsRow`, draws as before, and so does a Field in a place of its own under the card: a `Popover`, a `Sheet`, a `Pane`, a `Modal`, an `AlertDialog`, an editor's panel, a record's `FieldRow`. The Input reads `--vk-fg-brand`, the Field `--vk-fg-subtlest`.
|
|
135
|
+
- `viewkitjs/views`: `SheetHead` takes `step` (`{ id: string; back?: boolean }`), the step it heads, as its body's `SheetStep` names it. Its row is drawn afresh for each step id and says `data-step="in"` or `"back"`, and what stands in it (its buttons and its title, never its soft edge) slides in with the step as `SheetStep` does, from the left going back, and not under reduced motion. A sheet whose steps each have their own head (settings in a sheet) now moves its head with its body. A head with no step changes in place, as before.
|
|
136
|
+
- `viewkitjs/views/panels/react`: `ReadyToolbar` (and `ListToolbar`, `viewkitjs/views/list`) take `toolbarParts`, a function handed every form's parts as data (`ToolbarPartPlace`: `key`, `line`, `side`, `words`, and `node` for a part of your own) that hands back where each one stands, in your order: the row and the filter bar on a computer, a phone's one line (New at the list's foot or on the line), the row arrangement and its line below. Handed nothing, every arrangement draws as before. New types: `ToolbarParts`, `ToolbarPartPlace`, `ToolbarPartsContext`.
|
|
137
|
+
- `viewkitjs/views/panels/react`: a part's `words` (`"both"` or `"icon"`): `"icon"` stands its button as its icon alone; `"both"` gives the search's button its word, "Search", where the look's words show, as Sort and Filter show theirs. `foot: false` keeps New on a phone's line.
|
|
138
|
+
- `viewkitjs/views/controls`: `ToolbarInput` takes `words`: `"both"` shows "Search" beside the shut search's icon as the buttons on the right show their words.
|
|
139
|
+
- `viewkitjs/views/list`: `menu.drop`, `menu.add` and `menu.move` take any list of keyed rows, the toolbar's parts included.
|
|
140
|
+
- `viewkitjs/views/controls`: on a phone, a Select with its label inside (`labelAt="inside"`) is a pill: the Glass button's worded pill at its small size, its value and ⌄, the label kept for a screen reader and titling the Sheet it opens. It wears `glass-button.css`, so an app that draws one on a phone loads that stylesheet too.
|
|
141
|
+
- `viewkitjs/views/controls`: on a phone, a group of card Radios (`card`) is iOS's ✓ rows on one card: a rule between each row, the chosen one's ✓ at its end in `--vk-fg-accent`. The Radio reads `--vk-border-overlay-card`, `--vk-font-size-base` and `--vk-line-height-base` for it.
|
|
142
|
+
- `viewkitjs/views/controls`: the Icon has `share`, iOS's box with its arrow up.
|
|
143
|
+
- `viewkitjs/views/controls`: a `TagField` placed in `FieldRows` draws as the card's row, as iOS draws a To field: its tags fill the row as tokens (30 tall, a pill on the neutral fill, no edge, no icon, the row's words), 6 apart and wrapping as they grow, the caret after the last and the placeholder only while it holds none. Its label still names the box but stands out of sight, for its place to title the group; its note and error stand under the card as every Field row's. Outside Field rows it draws as before. The TagField reads `--vk-border-width`, `--vk-font-weight-normal`, `--vk-neutral` and `--vk-radius-full`.
|
|
144
|
+
- `viewkitjs/views/controls`: on a phone `SettingRows` is Field rows' card for a `Field` placed in it: the Field draws as its row beside the setting rows, a rule between them, its note and error in a foot after the card, as in `FieldRows`. On a computer a Field in it stays a box. What a `SettingRow` holds is never a row of its card.
|
|
145
|
+
- `viewkitjs/views/controls`: `SettingChevron`, the setting row's phone ›, 9 × 15, for a list's row that stands beside setting rows, so every › on a phone's settings page is one glyph.
|
|
146
|
+
- `viewkitjs/views/controls`: `--vk-opacity-off`, what a locked setting row's control fades to (0.45 by default).
|
|
147
|
+
- `viewkitjs/views/looks`: the setting row has a third look, Linear, and four values to make it: the Card option's Edged (the card on its ground with a firm edge, the danger zone's card plain, a lone row a card of its own, an icon on a grey tile), the Rows option's Inset (60 tall at least, the line between rows inset at both ends), and two new options, End (Buttons, the default; or Words: an action as its words, a state as a dot and its words, a locked row's reason in its control's place) and Fields (Boxes, the default; or At the end). Nothing picked draws as before.
|
|
148
|
+
- `viewkitjs/views/controls`: under the Fields option's At the end, a `Field` placed in a computer's `SettingRows` is one of its rows, its label and note on the left, its error in the note's place and its control at the row's end; a `RadioGroup` standing there draws as a Select of its Radios (a group of swatches stays swatches); every select at a row's end is as wide as its value.
|
|
149
|
+
- `viewkitjs/views/controls`: a setting row's action may stand after a `value` and be its icon alone (`SettingAction.iconOnly`, its `label` naming it).
|
|
150
|
+
- `viewkitjs/views/controls`: `useSettingRowWorn(el)` reads the setting row's options off the frame round an element, kept up to date; `useSettingRowsRow()` tells a part of an app's own that it stands as a row of such a card.
|
|
151
|
+
- `viewkitjs/views/controls`: `Icon` draws `arrow-down`, a single arrow pointing down.
|
|
152
|
+
|
|
153
|
+
### Changed
|
|
154
|
+
|
|
155
|
+
- `viewkitjs/views`: an untouched list's identity columns (everything through the title) start pinned at the left edge, whichever way your grid is drawn. `LIST_VIEW_PREF_DEFAULTS.gridFreezeIdentity` is `true`, and a view's look (`seenLook`) and a view's layout (`readViewLayout`) default to pinned, as the bare `GridTable`'s `freezeIdentity` and the grid's look ("Name column": Pinned) already did. A list whose stored preferences, view or person's layer say `false` keeps it; preferences your app saved whole, defaults included, hold `false` and stay unpinned. To open a list unpinned, start your prefs with `gridFreezeIdentity: false`, or hand `freezeIdentity={false}`.
|
|
156
|
+
- A view's menu hides Rename, Delete, Private view and Save for everyone on a view the reader can't change: `readOnly` on a views axis's option (`ViewTabOption.readOnly`, `ViewsViewsListItem.readOnly`). Reset, Save as new view, Copy link and Duplicate stay.
|
|
157
|
+
- A person's own view's Save says "Save" (in its menu for a private view, and in Customize's foot where the view state says `own`); shared views keep "Save for everyone".
|
|
158
|
+
- `viewkitjs/views/react`: `ViewsResolvedPorts` is `Required<ViewsPorts>`: `useViews().ports` carries every port, your own or its default.
|
|
159
|
+
- `viewkitjs/views/grid`: ⌘Z and ⌘⇧Z show their value, and take the focus to their cell, as they are pressed, after a fill or a text save too; the write still waits for the edit it takes back to answer. An undo or a redo still waiting is sent at `pagehide`, after any open editor's draft. Back from the back-forward cache, an undo sent at the close may have reached the server before the edit it takes back: the cell then ends on the edit's stored value while redo still offers the undo.
|
|
160
|
+
- `viewkitjs/views/grid`: `GridCommitContext` may carry `closing: true`, on a commit or a restore sent while the page goes; send it so it outlives the page (`fetch(…, { keepalive: true })`). A commit sent then carries `{ kind: "commit", closing: true }` where it carried no context before.
|
|
161
|
+
- `viewkitjs/views/grid`: a `stored` answer to an undo or a redo now shows in its cell until the rows carry it.
|
|
162
|
+
- `viewkitjs/views/grid`: a single cell's write that `onCellCommit` answers with `{ status: "failed" }` now rolls its cell back, as a rejection did; it kept the refused value on screen before.
|
|
163
|
+
- `ReadyToolbar` is a `ListRoot` around `ListToolbar`. It takes every prop it took before and draws the same.
|
|
164
|
+
- Inside a `ListRoot`, `Toolbar` and `ToolbarRadioProvider` share the root's radio, so one panel is open per list, whichever frame opened it. Outside a root, each frame keeps its own radio as before.
|
|
165
|
+
- `size-budget.json`: `viewkitjs/views/list` goes from 75 to 165 kB gzipped (146.0 kB measured). The door now carries the ready toolbar's parts (`ListToolbar`), the same parts `viewkitjs/views/panels/react` carries within its own 165 kB. An app that imports only `fetchSource` from it pays for the whole door until the source moves to a door of its own.
|
|
166
|
+
- `viewkitjs/views/grid`: a column's menu offers Group by and Ungroup wherever you hand `groupBy`, saved view or not. `viewBacked` no longer decides them: it keeps Sort on every bound column and figures for field-backed columns. A grid that hands `groupBy` without `viewBacked` now offers Group by.
|
|
167
|
+
- `viewkitjs/views/controls`: `CONTROLS.Menu` draws the icon of a row that ticks and keeps the menu open (`checked` with `keepOpen`), as it draws every other row's.
|
|
168
|
+
- `viewkitjs/views`: `bindFields(registry, specs?)` binds a field you give no spec by its key, where it used to throw "registry field is not bound": it reads `row[key]` and, where anyone may write the field, writes `{ [key]: value }`; a number, a percent or an amount writes the number its editor commits (decimal text under `storage: "decimal"`). Write specs only for the fields that differ, or none: `bindFields(registry)`. A field its key can't bind still throws `FieldBindingError`, its message `binding: "<key>": not bound, and its key can't bind it: <why>`: a writable relation (its candidates), a writable amount whose currency is the row's (its `unit`), a ratio formula (its `ratio` readers) and a writable datetime (its editor commits a local time, which only your time zone turns into an instant).
|
|
169
|
+
- `viewkitjs/views/controls`: an app that spreads `CONTROL_ATOMS` now gets its toolbar buttons too. Its count is a count: the ✕ badge that cleared what it counted is not drawn. To keep your own button, spread yours after it: `atoms={{ ...CONTROL_ATOMS, ToolbarButton: Own }}`.
|
|
170
|
+
- `viewkitjs/views/controls`: the toolbar button and the Toolbar read their frame's options through one observer for the whole page, not one per button.
|
|
171
|
+
- `viewkitjs/postgres`: an `ids` request answers at most 100,000 ids. A list that keeps more is refused `too-big` (`ids: a list answers at most 100,000 ids; narrow the list first`, 400 from `listHandler`) after one capped count, before any id is read; that includes the ids a drag reads in a list in manual order. `idsQuery` reads that count as its first step.
|
|
172
|
+
- `viewkitjs/views/controls`: a switch row (`SettingRow switch`, `SwitchRow`) switches only from its Switch: its root is a `div`, not a `label`, so a press on its name, line or mark does nothing, and the row takes no pointer cursor or hovered ground (`setting-row.css`, `switch-row.css`); the Switch no longer reads the row under the pointer as its own hover (`switch.css`). The Switch is named by the row's name (`aria-labelledby`) and described by its line (`aria-describedby`). `switch-row.css` no longer reads `--vk-hovered`, `--vk-duration-fast` or `--vk-ease-out`. Classes and props are unchanged (VK-941).
|
|
173
|
+
- `viewkitjs/views/controls`: a read-only Input, or an InputGroup holding one, stands on `--vk-sunken` with its words `--vk-fg-subtle`, in focus too; one that opens something (`aria-haspopup`) keeps a resting field's ground (`input.css`) (VK-944).
|
|
174
|
+
|
|
175
|
+
What an app changes: nothing.
|
|
176
|
+
- `viewkitjs/views/controls`: Field rows' options (`data-field-rows-edge`, `-cards`, `-height`, `-label`, `-lines`) are declared again on every Field rows card that carries no pick of its own, so the card resolves its ground, rule, edge and corners where it stands. A place that sets the card's colours again round it (`--vk-overlay-card`, `--vk-border-overlay-card`, `--vk-radius-xl`) now reaches the card under every option. A card that carries its own look keeps it. Nothing changes where nothing is set again.
|
|
177
|
+
- `viewkitjs/views/controls`: on a phone the setting row stands as iOS's Settings draws it. A value is in the quietest grey, the name's size, before a 9 × 15 › at the row's end (a select's row stopped short of it); a button's words stand in the link colour at the row's end, a press of their own, where the whole row was the button; a word of state (`state`) shows as the grey value before ›, the row the press of its action; in a danger card each row is the press, its action's `icon` first, in red; a lone row (`alone`) is a card of its own, its name in the link colour, where it fell back to the computer's bare row; a locked row fades but for its line; and a card's rows stand one way: where any row has an icon or a mark, every row keeps its room, the words in one line, each rule starting at the words (a row says what starts it, `data-setting-row-start`).
|
|
178
|
+
- `viewkitjs/views/controls`: on a phone the Switch's Capsule, what nothing picked draws, is 28 × 63 with a 24 × 37 thumb (it was 31 × 71, 27 × 41), its thumb is white on or off in both themes (it took the darkest ground when on in dark), and a locked Switch is faded with no lock in its thumb. A computer's `sm` and `md` switches are unchanged; `lg` with nothing picked draws the same Capsule anywhere, so it is 28 × 63 on a computer too.
|
|
179
|
+
- The setting row reads `--vk-fg-brand`, `--vk-border-brand`, `--vk-focus-width`, `--vk-focus-offset`, `--vk-label-*`, `--vk-fg-inverse` (a tile's white glyph) and `--vk-icon-disclosure` (a phone's ›).
|
|
180
|
+
- `viewkitjs/views`: on a phone (`data-vk-phone`), the Radio's swatches stand in their colour's bold shade, as round 3 of the settings canvas draws them: `--vk-label-<colour>`, grey `--vk-fg-subtlest`, where a computer's keep the label's pale fill. Grey no longer carries the field's edge on a phone. The Radio reads eight more names, each already in the ready stylesheet: `--vk-label-amber`, `--vk-label-blue`, `--vk-label-green`, `--vk-label-pink`, `--vk-label-purple`, `--vk-label-red`, `--vk-label-teal`, `--vk-fg-subtlest`. On a computer nothing changes.
|
|
181
|
+
- `viewkitjs/views/panels/react`: a phone's folding `Toolbar` line keeps the order its parts are handed in, the filter bar's start going in right after the views; before, the views were pulled to the front. A toolbar that hands the views first draws as before.
|
|
182
|
+
- `viewkitjs/views`: `ViewsViewMenuProps.view` is optional. Left out, the slot stands on New view's Modal in place of a menu, as the row's + opens it, and tells `onOpenChange(false)` once the Modal has closed. `CONTROLS.ViewMenu` does.
|
|
183
|
+
- `viewkitjs/views/controls`: `CONTROLS` brings `CONTROL_ATOMS` with it, so `<ViewsProvider components={CONTROLS}>` alone draws the ready toolbar's buttons as the toolbar button, a select's value as the Option's tag, a status as the Status and a cell's "+N" as the Tag's count. The provider's `atoms` still win, atom by atom, over CONTROL_ATOMS'. An app that hands `components={CONTROLS}` and no `atoms` sees those pieces change look; one that already hands `atoms={CONTROL_ATOMS}` draws as before, and so does one that hands a map spread from `CONTROLS` (`{ ...CONTROLS, ...own }`), which brings no atoms: it hands `atoms={{ ...CONTROL_ATOMS, ...own }}` for them.
|
|
184
|
+
- `viewkitjs/views/controls`: on a phone an agent's Avatar on its own `colour` stands bold, the hue under a white letter, as an app's tile; a thing's and the workspace's keep the hue's pale fill, and a computer draws every Avatar as before. The Avatar reads `--vk-label-<hue>` and `--vk-fg-inverse` for it.
|
|
185
|
+
|
|
186
|
+
### Fixed
|
|
187
|
+
|
|
188
|
+
- `viewkitjs/views`: in the Sheet, and in the Modal on a computer, a field row edited in place keeps its box: pressing the row opens its editor with the focus in it, ready to type, instead of the popup taking the focus back and the editor closing as it opened.
|
|
189
|
+
- `viewkitjs/views/controls`: `CONTROLS.Picker` draws + Add, so a select or multiselect whose binding carries `addOption` offers a way to add an option at ViewKit's defaults. Its words are the existing messages `views.editors.add-option`, `views.editors.adding-option` and, for a phone's button, `views.editors.values-add`. An app that hands its own `Picker` keeps drawing its own add row.
|
|
190
|
+
- `viewkitjs/views`: a chosen choice card (a card Radio or a card Checkbox) keeps the card's ground, its edge and a hairline ring just outside it in the selected colour, as a marked card does; a disabled one draws no ring. The choice's stylesheet no longer reads `--vk-selected`.
|
|
191
|
+
- `viewkitjs/views/panels/react`: on a computer, the views row's + of an axis that hands `verbs` (a `ListRoot` that keeps its views) opens New view's Modal, the layouts and the name, and creates through `verbs.onChange`, where your map draws `ViewMenu`. It did nothing: the root's axis hands an `onCreate` that waits for a views list. An axis without `verbs`, or a map without `ViewMenu`, still calls its `onCreate`.
|
|
192
|
+
- `viewkitjs/views/controls`: the sort editor's direction box on a computer is as wide as the longer of the app's two words for Ascending and Descending, so a longer word (Romanian's "Descrescător") reads whole instead of ending in "…". It keeps one width whichever is picked, never narrower than before (152 px, so English draws as it did) nor wider than 240 px, where a longer word still ends in "…". An app's own width on `.o-sort-editor-direction` still wins.
|
|
193
|
+
|
|
194
|
+
### Removed
|
|
195
|
+
|
|
196
|
+
- The rendering contract no longer names the four getters (`getGridProps`, `getHeaderProps`, `getRowProps`, `getCellProps`): nothing defined them.
|
|
197
|
+
- `viewkitjs/views/grid`: `GridTableProps.renderColumnMenuRows`, deprecated and read by nothing since 0.30. Hand the same rows as data through `columnMenuItems`, or reshape the whole menu with `menus.column`:
|
|
198
|
+
|
|
199
|
+
```tsx
|
|
200
|
+
// before
|
|
201
|
+
<GridTable {...grid} renderColumnMenuRows={(key, close) => <EditFieldRow onClick={() => { close(); openEdit(key); }} />} />
|
|
202
|
+
// after
|
|
203
|
+
<GridTable {...grid} columnMenuItems={(key) => [{ key: "edit-field", label: "Edit field", onSelect: () => openEdit(key) }]} />
|
|
204
|
+
```
|
|
205
|
+
|
|
8
206
|
## [0.31.0] — 2026-12-02
|
|
9
207
|
|
|
10
208
|
### Added
|
package/MIGRATION.md
CHANGED
|
@@ -69,7 +69,7 @@ installs none of them.
|
|
|
69
69
|
| `@viewkitjs/postgres/definitions` | `viewkitjs/postgres/definitions` |
|
|
70
70
|
|
|
71
71
|
There is no `viewkitjs` entry on its own: every path names its part. A door added since, such as
|
|
72
|
-
`viewkitjs/views/looks` or `viewkitjs/views/
|
|
72
|
+
`viewkitjs/views/looks`, `viewkitjs/views/controls` or `viewkitjs/views/list`, has no old path: an app starts on it under `viewkitjs`. The three `package.json` entries move the
|
|
73
73
|
same way (`@viewkitjs/fields/package.json` is `viewkitjs/package.json`, one manifest for all three parts).
|
|
74
74
|
|
|
75
75
|
## The names your app narrows
|
|
@@ -227,17 +227,27 @@ Nothing was removed except what is below.
|
|
|
227
227
|
app body's popover is your `Popover` at its own width, a grid body opens over its cell, and the grid says a refused
|
|
228
228
|
edit through your toast's `error`, so stop toasting your own (step 8). `GRID_SLOTS` loses `vk-grid-column-menu`,
|
|
229
229
|
`vk-grid-flyout`, `vk-grid-group-menu` and `vk-grid-aggregate-menu`: style the grid's menus as your `Menu`.
|
|
230
|
-
`Command` is deprecated and read by nothing: leave it out. The grid's `renderColumnMenuRows
|
|
231
|
-
by nothing
|
|
232
|
-
`columnMenuItems` (outright-base's Edit field row, say).
|
|
230
|
+
`Command` is deprecated and read by nothing: leave it out. The grid's `renderColumnMenuRows`, deprecated and read
|
|
231
|
+
by nothing since 0.30, is gone since 0.32 (below).
|
|
233
232
|
|
|
234
233
|
```tsx
|
|
235
234
|
// before
|
|
236
235
|
<ViewsProvider {...rest} menus="menu" bodyFrame="popover" gridBodyPlace="over" sayRefusals />
|
|
237
|
-
<GridTable {...grid} renderColumnMenuRows={(key, close) => (edits[key] ? <EditFieldRow onClick={() => { close(); openEdit(key); }} /> : null)} />
|
|
238
236
|
// after
|
|
239
237
|
<ViewsProvider {...rest} />
|
|
238
|
+
```
|
|
239
|
+
|
|
240
|
+
- **The grid's `renderColumnMenuRows` is gone** (0.32): a row drawn as a node had nowhere to stand in your `Menu`. Hand
|
|
241
|
+
the same rows as data through `columnMenuItems` (outright-base's Edit field row, say), or reshape the whole menu,
|
|
242
|
+
the grid's own rows too, with `menus.column`.
|
|
243
|
+
|
|
244
|
+
```tsx
|
|
245
|
+
// before
|
|
246
|
+
<GridTable {...grid} renderColumnMenuRows={(key, close) => (edits[key] ? <EditFieldRow onClick={() => { close(); openEdit(key); }} /> : null)} />
|
|
247
|
+
// after
|
|
240
248
|
<GridTable {...grid} columnMenuItems={(key) => (edits[key] ? [{ key: "edit-field", label: "Edit field", onSelect: () => openEdit(key) }] : null)} />
|
|
249
|
+
// or, the whole menu as data
|
|
250
|
+
<GridTable {...grid} menus={{ column: (items, { field, column }) => (field && !column.partOf && edits[field.key] ? menu.add(items, { key: "edit-field", label: "Edit field", onSelect: () => openEdit(field.key) }, { before: "hide-column" }) : items) }} />
|
|
241
251
|
```
|
|
242
252
|
|
|
243
253
|
- **The older hosts that open your bodies take host names** (0.30), with no alias: `TextEditor` and `TextEditorProps`
|
|
@@ -334,7 +344,7 @@ It holds `Button`, `Tooltip`, `Popover`, `Sheet`, `Input`, `Checkbox` and `Menu`
|
|
|
334
344
|
a name, a place and a range; the Number editor (`NumberBody`) for a number, money or a percent; the Values editor (`ValuesBody`) for several emails, phones, links or domains; the Links editor (`LinksBody`) for a relation whose field declares `links`; the views list (`ViewsListBody`), what the view switcher opens; and the group editor (`GroupBody`), what Customize's Group opens, where an app that hands none keeps ViewKit's own group pages; and the Collapsible (`Collapse`), the fold a grid's group, a field's note and the selection sheet open in; and `PortsHost`, which answers the `toast` and `confirm` ports an app leaves out with ViewKit's Toast and alert dialog. **An app that spreads it hands no `Calendar`:** the filter panel's date, its date
|
|
335
345
|
ranges and its custom time scope open ViewKit's own month. An app's own `Calendar` or `RangeCalendar` atom is
|
|
336
346
|
kept. You still hand `AppIcon` and `Markdown`. `CONTROL_ATOMS` (0.23) does the same for the atoms
|
|
337
|
-
(`Tag`, `StatusBadge`, `CellMore`): `atoms={{ ...CONTROL_ATOMS, ...ownAtoms }}`.
|
|
347
|
+
(`Tag`, `StatusBadge`, `CellMore`, and since 0.32 `ToolbarButton`): `atoms={{ ...CONTROL_ATOMS, ...ownAtoms }}`.
|
|
338
348
|
|
|
339
349
|
The controls' stylesheet is in `viewkitjs/views/styles.css` (step 9). An app that imports the controls'
|
|
340
350
|
stylesheets one by one instead imports `smooth.css` first, then each control's own, and now adds
|
|
@@ -431,6 +441,20 @@ hydrates.
|
|
|
431
441
|
`PartsBody`, `ValuesBody`, `LinksBody`) takes none of ViewKit's width or padding and is marked `data-vk-body`; in
|
|
432
442
|
the grid it opens over its cell. The grid says a refused edit through your toast's `error`. An app that set
|
|
433
443
|
`menus="menu"`, `bodyFrame="popover"`, `gridBodyPlace="over"` and `sayRefusals` sees no change.
|
|
444
|
+
- An untouched list's identity columns start pinned at the left edge (0.32): `LIST_VIEW_PREF_DEFAULTS` holds
|
|
445
|
+
`gridFreezeIdentity: true`, and a view's look and a view's layout default to pinned, as the bare `GridTable` and
|
|
446
|
+
the grid's look already did. A list whose stored preferences, view or person's layer say `false` keeps it. To
|
|
447
|
+
open unpinned, start your prefs with `gridFreezeIdentity: false`.
|
|
448
|
+
- `bindFields` binds a field you give no spec by its key, reading `row[key]` and writing `{ [key]: value }`, where
|
|
449
|
+
it used to throw (0.32). A field its key can't bind still throws, naming why: a writable relation, a writable
|
|
450
|
+
amount whose currency is the row's, a ratio formula and a writable datetime.
|
|
451
|
+
- ⌘Z and ⌘⇧Z show their value, and take the focus to their cell, as they are pressed, after a fill or a text save
|
|
452
|
+
too; the write still waits for the edit it takes back to answer (0.32).
|
|
453
|
+
- A write the grid sends while the page goes (`pagehide`) carries `closing: true` in its context: an editor still
|
|
454
|
+
open then writes its draft with `{ kind: "commit", closing: true }`, where it passed no context before, and an
|
|
455
|
+
undo still waiting is sent then too (0.32).
|
|
456
|
+
- One cell's write that `onCellCommit` answers with `{ status: "failed" }` rolls the cell back, as a rejection
|
|
457
|
+
does (0.32); it kept the refused value on screen before.
|
|
434
458
|
|
|
435
459
|
**Toolbar and panels**
|
|
436
460
|
|
|
@@ -539,6 +563,7 @@ The Compound editor, the Number editor, the Menu and the number box (`CONTROLS.P
|
|
|
539
563
|
| `views.editors.number-search-unit` | Search for a unit |
|
|
540
564
|
| `views.editors.number-unit-named` | {unit}: {name} (the code button's name: "Currency: Euro") |
|
|
541
565
|
| `views.menus.not-now` | Not now |
|
|
566
|
+
| `views.menus.row-waiting` | Loading… |
|
|
542
567
|
|
|
543
568
|
The Picker (`CONTROLS.Picker`, `CONTROLS.FieldsBody`):
|
|
544
569
|
|
|
@@ -654,6 +679,7 @@ A view's menu and what it opens (`CONTROLS.ViewsListBody` where the axis hands `
|
|
|
654
679
|
| `views.panels.view-edit` | Edit view… |
|
|
655
680
|
| `views.panels.view-private-toggle` | Private view |
|
|
656
681
|
| `views.panels.view-save-everyone` | Save for everyone |
|
|
682
|
+
| `views.panels.view-save-own` | Save |
|
|
657
683
|
| `views.panels.view-save-new` | Save as new view… |
|
|
658
684
|
| `views.panels.view-copy-link-short` | Copy link |
|
|
659
685
|
| `views.panels.view-favorite` | Favorite |
|
|
@@ -768,6 +794,14 @@ The panels: quick filters, set-aside rules, dragging:
|
|
|
768
794
|
| `views.panels.drag-dropped` | Draggable item {label} was dropped. |
|
|
769
795
|
| `views.panels.drag-cancelled` | Dragging was cancelled. Draggable item {label} was dropped. |
|
|
770
796
|
| `views.panels.filter-fieldless` | Not a field of this list; a view cannot filter on it. |
|
|
797
|
+
| `views.panels.toolbar-row` | List tools |
|
|
798
|
+
| `views.panels.toolbar-bar` | Sort and filters |
|
|
799
|
+
|
|
800
|
+
The field row in a Field rows card, holding nothing:
|
|
801
|
+
|
|
802
|
+
| Key | English |
|
|
803
|
+
| --- | --- |
|
|
804
|
+
| `views.field-row.set` | Set {label}, each word lower-cased unless a capital stands inside it |
|
|
771
805
|
|
|
772
806
|
`viewkitjs/fields` (the conventions' `messages`):
|
|
773
807
|
|
package/README.md
CHANGED
|
@@ -8,7 +8,7 @@ ViewKit: typed fields, the grid and its editors, and a list's SQL, for record li
|
|
|
8
8
|
pnpm add viewkitjs zod
|
|
9
9
|
```
|
|
10
10
|
|
|
11
|
-
Add `react` and `react-dom` 19 for `viewkitjs/views/*`, and `@dnd-kit/core`, `@dnd-kit/sortable` and `@dnd-kit/utilities` for the panels' parts that drag in `viewkitjs/views/panels/react
|
|
11
|
+
Add `react` and `react-dom` 19 for `viewkitjs/views/*`, and `@dnd-kit/core`, `@dnd-kit/sortable` and `@dnd-kit/utilities` for the panels' parts that drag in `viewkitjs/views/panels/react` (and `viewkitjs/views/list`'s toolbar), and `@base-ui/react` (1.6 or later) only to take ViewKit's default controls from `viewkitjs/views/controls`. All six are optional peers: an app that uses only fields or postgres installs none of them. ESM only, Node 20 or later.
|
|
12
12
|
|
|
13
13
|
## The parts
|
|
14
14
|
|
package/fields/dist/index.d.ts
CHANGED
|
@@ -27,7 +27,7 @@ export { isOpenVocabulary, optionFor, optionValues, optionsOf, statusOptionOrder
|
|
|
27
27
|
export { sameListValue, sameStoredValue } from "./equality.js";
|
|
28
28
|
export { optimisticDisplay, sameFieldValue } from "./optimistic.js";
|
|
29
29
|
export * from "./relation.js";
|
|
30
|
-
export { zodFor } from "./zod.js";
|
|
30
|
+
export { withUrlScheme, zodFor } from "./zod.js";
|
|
31
31
|
export { acceptFieldCommit, acceptStoredFieldValue, fieldClearRefusal, type FieldAcceptance, } from "./accept.js";
|
|
32
32
|
export * from "./codecs.js";
|
|
33
33
|
export { dateOfDay, dateOfInstant, dayOf, instantOf, type DateReading, } from "./date-codec.js";
|
package/fields/dist/index.js
CHANGED
|
@@ -24,7 +24,7 @@ export { isOpenVocabulary, optionFor, optionValues, optionsOf, statusOptionOrder
|
|
|
24
24
|
export { sameListValue, sameStoredValue } from "./equality.js";
|
|
25
25
|
export { optimisticDisplay, sameFieldValue } from "./optimistic.js";
|
|
26
26
|
export * from "./relation.js";
|
|
27
|
-
export { zodFor } from "./zod.js";
|
|
27
|
+
export { withUrlScheme, zodFor } from "./zod.js";
|
|
28
28
|
export { acceptFieldCommit, acceptStoredFieldValue, fieldClearRefusal, } from "./accept.js";
|
|
29
29
|
export * from "./codecs.js";
|
|
30
30
|
export { dateOfDay, dateOfInstant, dayOf, instantOf, } from "./date-codec.js";
|
|
@@ -36,6 +36,13 @@ export type ViewFieldReader<Row> = {
|
|
|
36
36
|
* blank in the sibling) is its own cluster and sorts after every known code.
|
|
37
37
|
* The library converts nothing itself. */
|
|
38
38
|
codeOf?: (row: Row, key: string) => string | null | undefined;
|
|
39
|
+
/** The number a money field SORTS by when its cells show each row's own
|
|
40
|
+
* currency: the row's amount converted into one currency for the whole list
|
|
41
|
+
* (`null` when it has none, or no rate: last both ways). A host that answers
|
|
42
|
+
* it for two rows has them ordered by these numbers, with no code clusters,
|
|
43
|
+
* so the order flips with the direction; `undefined` (or no hook) sorts by
|
|
44
|
+
* what `read` returns, clustered by code as `codeOf` says. */
|
|
45
|
+
sortAmountOf?: (row: Row, key: string) => number | null | undefined;
|
|
39
46
|
/** The records a row's relation holds, each read as a record of its own (`recordReaderFor` over the far rows and
|
|
40
47
|
* their reader), so a rule across the relation ("any / none / every of its records where …") is answered in
|
|
41
48
|
* memory. Absent, or `undefined` for a row, the rule has no opinion and the row stays. */
|
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
/** `value` as canonical decimal text, or null when it reads as no number: absent, blank, malformed or not finite. */
|
|
2
2
|
export declare function exactNumberText(value: unknown): string | null;
|
|
3
|
-
/**
|
|
4
|
-
*
|
|
3
|
+
/**
|
|
4
|
+
* Where a non-finite number sorts, as postgres orders a numeric or a float8: -1 for -Infinity, below every number; 1
|
|
5
|
+
* for Infinity, above them; 2 for NaN, above Infinity. 0 for anything else. A JS number or decimal text spelling one.
|
|
6
|
+
* Only the sort reads it: to a filter, `exactNumberText` still reads these as no number.
|
|
7
|
+
*/
|
|
8
|
+
export declare function nonFiniteSide(value: unknown): -1 | 0 | 1 | 2;
|
|
9
|
+
/** Whether `value` reads as no number to the sort: a JS number never does, and a non-finite one in text sorts as a
|
|
10
|
+
* value too, as postgres sorts it (`nonFiniteSide`); anything else as `exactNumberText` reads it. */
|
|
5
11
|
export declare function readsAsNoNumber(value: unknown): boolean;
|
|
@@ -13,6 +13,19 @@ export function exactNumberText(value) {
|
|
|
13
13
|
const read = MACHINE_NUMBER.test(text) ? Number(text) : parseNumber(text);
|
|
14
14
|
return read == null ? null : decimalTextOf(read);
|
|
15
15
|
}
|
|
16
|
+
const INFINITY_TEXT = /^([+-]?)inf(inity)?$/i;
|
|
17
|
+
const NAN_TEXT = /^nan$/i;
|
|
18
|
+
export function nonFiniteSide(value) {
|
|
19
|
+
if (typeof value === "number")
|
|
20
|
+
return Number.isNaN(value) ? 2 : value === Infinity ? 1 : value === -Infinity ? -1 : 0;
|
|
21
|
+
if (typeof value !== "string")
|
|
22
|
+
return 0;
|
|
23
|
+
const text = value.trim();
|
|
24
|
+
if (NAN_TEXT.test(text))
|
|
25
|
+
return 2;
|
|
26
|
+
const infinity = INFINITY_TEXT.exec(text);
|
|
27
|
+
return infinity === null ? 0 : infinity[1] === "-" ? -1 : 1;
|
|
28
|
+
}
|
|
16
29
|
export function readsAsNoNumber(value) {
|
|
17
|
-
return typeof value === "number" ? false : exactNumberText(value) === null;
|
|
30
|
+
return typeof value === "number" || nonFiniteSide(value) !== 0 ? false : exactNumberText(value) === null;
|
|
18
31
|
}
|