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
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { acceptFieldCommit, isMultipleType, lockReason, relationIdOf, valueTypeOf, } from "viewkitjs/fields";
|
|
1
|
+
import { acceptFieldCommit, isMultipleType, lockReason, relationIdOf, valueTypeOf, withUrlScheme, } from "viewkitjs/fields";
|
|
2
2
|
import { resolveViewsMessage } from "../contract.js";
|
|
3
3
|
import { opensAsList } from "./one-value.js";
|
|
4
4
|
import { prettifyOptionValue, resolveColumnOrder } from "./column-state.js";
|
|
@@ -116,6 +116,27 @@ export function baseColumnOrder(columns, order, viewBacked) {
|
|
|
116
116
|
export function lockKeyOf(col) {
|
|
117
117
|
return col.partOf?.field.key ?? fieldKeyOf(col);
|
|
118
118
|
}
|
|
119
|
+
export function withEditThroughLocks(config, fields) {
|
|
120
|
+
const locked = config?.columns;
|
|
121
|
+
if (!locked)
|
|
122
|
+
return config;
|
|
123
|
+
let widened;
|
|
124
|
+
for (const field of fields) {
|
|
125
|
+
const through = field?.editThrough;
|
|
126
|
+
if (!field || !through)
|
|
127
|
+
continue;
|
|
128
|
+
const pairLocked = !!locked[field.key]?.locked || !!locked[through]?.locked;
|
|
129
|
+
if (!pairLocked)
|
|
130
|
+
continue;
|
|
131
|
+
for (const key of [field.key, through]) {
|
|
132
|
+
if (locked[key]?.locked || widened?.[key]?.locked)
|
|
133
|
+
continue;
|
|
134
|
+
widened ??= { ...locked };
|
|
135
|
+
widened[key] = { ...locked[key], locked: true };
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
return widened ? { ...config, columns: widened } : config;
|
|
139
|
+
}
|
|
119
140
|
export function gridColumnLocked(col, config) {
|
|
120
141
|
if (!config)
|
|
121
142
|
return false;
|
|
@@ -210,7 +231,7 @@ export function coerceWrite(col, next, messages) {
|
|
|
210
231
|
return { ok: true, value: next };
|
|
211
232
|
if (typeof next !== "string")
|
|
212
233
|
return { ok: true, value: next };
|
|
213
|
-
const trimmed = next.trim();
|
|
234
|
+
const trimmed = col.field?.type === "url" && col.field.bareHost === "https" ? withUrlScheme(next) : next.trim();
|
|
214
235
|
if (!URL_SHAPE.test(trimmed)) {
|
|
215
236
|
return { ok: false, reason: messages({ key: "views.grid.write-not-url" }) };
|
|
216
237
|
}
|
|
@@ -113,7 +113,10 @@ export type ListColumn<Row> = {
|
|
|
113
113
|
* custom money cell draws the chassis's reading and converts nothing. */
|
|
114
114
|
render?: (row: Row, cell?: RenderedValue) => ReactNode;
|
|
115
115
|
actions?: ListCellAction<Row>[];
|
|
116
|
-
|
|
116
|
+
/** An adornment beside the cell's value, drawn by the app. Handed the row and, beside it, the value the cell
|
|
117
|
+
* shows: a write still saving (a paste, a fill, an edit) while it saves, else what `accessor` reads, so a cue
|
|
118
|
+
* read from it agrees with the value beside it from the moment it shows, and goes back with it if the save fails. */
|
|
119
|
+
indicator?: (row: Row, cell?: RenderedValue) => ReactNode;
|
|
117
120
|
accessor?: (row: Row) => unknown;
|
|
118
121
|
/** Raw field used for editing when display accessor contains fallbacks. */
|
|
119
122
|
editAccessor?: (row: Row) => unknown;
|
|
@@ -153,6 +156,13 @@ export type ListColumn<Row> = {
|
|
|
153
156
|
money?: MoneyDeclaration<Row>;
|
|
154
157
|
/** The reading in force on a convertible column — set by `readMoneyColumn`. */
|
|
155
158
|
reading?: MoneyReading;
|
|
159
|
+
/** What a convertible money column SORTS by when it shows each row's own
|
|
160
|
+
* currency: the row's figure converted into the reader's default currency
|
|
161
|
+
* (`null`: no figure, or no rate), so rows in different currencies order as
|
|
162
|
+
* one number that flips with the direction. Set by `readMoneyColumns` under
|
|
163
|
+
* the Original reading; absent, the column sorts by `accessor`, clustered by
|
|
164
|
+
* code. */
|
|
165
|
+
sortAccessor?: (row: Row) => number | null;
|
|
156
166
|
defaultAggregate?: ListAggregateKind;
|
|
157
167
|
/** The field whose database figures this column's footer reads, when it is
|
|
158
168
|
* not the column's own (Transactions' Amount totals its paid figure). A
|
|
@@ -296,5 +296,6 @@ export function viewReaderFrom(columns, decimals = {}) {
|
|
|
296
296
|
return decimals[key] ?? col.format?.decimals ?? fallback;
|
|
297
297
|
},
|
|
298
298
|
codeOf: (row, key) => denominationOf(byKey.get(key), row),
|
|
299
|
+
sortAmountOf: (row, key) => byKey.get(key)?.sortAccessor?.(row),
|
|
299
300
|
};
|
|
300
301
|
}
|
|
@@ -5,7 +5,7 @@ export { getViewOptionAvailability, resolvePersonalSection } from "./availabilit
|
|
|
5
5
|
export { groupSortChoices, groupSortValue, offersManualOrder } from "./group-sort.js";
|
|
6
6
|
export { useFilterOpened } from "./use-filter-opened.js";
|
|
7
7
|
export { GROUP_BY_SEARCH_AFTER, activeGroupDimension, dateRangeValueLabel, drawsUnnamedValue, filterRowValueLabel, filterValueLabel, groupDateByLabel, groupSortLabel, groupValueLabel, layoutValueLabel, matchGroupDimensions, matchSortOptions, relationSentence, sortValueLabel, timeScopeRowValueLabel, } from "./labels.js";
|
|
8
|
-
export type { CollectionChildAxis, CollectionViewsConfig, CollectionViewsInput, PillOption, ViewTabOption, ViewsLayout, } from "./views-row/model.js";
|
|
8
|
+
export type { CollectionChildAxis, CollectionViewsConfig, CollectionViewsInput, PillOption, PillViewMenu, ViewTabOption, ViewsLayout, } from "./views-row/model.js";
|
|
9
9
|
export { splitViewAxes, toViewAxes } from "./views-row/model.js";
|
|
10
10
|
export { settingsPanels } from "./settings/settings-panels.js";
|
|
11
11
|
export type { SettingsPanels } from "./settings/settings-panels.js";
|
|
@@ -24,6 +24,8 @@ export { TOOLBAR_NARROW_BELOW, arrangeToolbar, foldState, foldSteps, toolbarForm
|
|
|
24
24
|
export type { FoldStep, ToolbarForm, ToolbarLine, ToolbarPlacement, ToolbarSlot } from "./toolbar/model.js";
|
|
25
25
|
export { SHOW_COUNTS_KEY, countsToggle, groupShown, showCountsChange, showCountsOf, withCounts, } from "./toolbar/counts.js";
|
|
26
26
|
export { withEditView } from "./toolbar/edit-view.js";
|
|
27
|
+
export { withViewMenu } from "./toolbar/edit-view.js";
|
|
28
|
+
export type { ViewMenuFn } from "./toolbar/edit-view.js";
|
|
27
29
|
export { settingsCleared } from "./toolbar/clear.js";
|
|
28
30
|
export { asideFilterWords, barFilterWords } from "./toolbar/filter-words.js";
|
|
29
31
|
export type { BarFilterWords } from "./toolbar/filter-words.js";
|
|
@@ -17,6 +17,7 @@ export { boardFieldOf, calendarFieldOf } from "./settings/axes.js";
|
|
|
17
17
|
export { TOOLBAR_NARROW_BELOW, arrangeToolbar, foldState, foldSteps, toolbarForm } from "./toolbar/model.js";
|
|
18
18
|
export { SHOW_COUNTS_KEY, countsToggle, groupShown, showCountsChange, showCountsOf, withCounts, } from "./toolbar/counts.js";
|
|
19
19
|
export { withEditView } from "./toolbar/edit-view.js";
|
|
20
|
+
export { withViewMenu } from "./toolbar/edit-view.js";
|
|
20
21
|
export { settingsCleared } from "./toolbar/clear.js";
|
|
21
22
|
export { asideFilterWords, barFilterWords } from "./toolbar/filter-words.js";
|
|
22
23
|
export { QUICK_SEARCH_AFTER, holdAfterPress, holdStands, quickFieldsShown, quickFirstOpen, quickHeldNames, quickHoldFits, quickPressCloses, quickReminderWords, quickValuesFound, quickValuesShown, } from "./quick/model.js";
|
|
@@ -79,6 +79,8 @@ export type FilterEditorField = {
|
|
|
79
79
|
far?: readonly FilterEditorField[];
|
|
80
80
|
/** How its field is marked, as the grid's header marks its column (`columnMark`); a relation has none. */
|
|
81
81
|
mark?: FieldMark;
|
|
82
|
+
/** A number field that holds whole numbers only (`isIntegerField`): its box takes whole numbers. */
|
|
83
|
+
integer?: true;
|
|
82
84
|
/** Why no rule can be made on it, in the app's words (an unavailable capability's reason, else
|
|
83
85
|
* `views.panels.filter-not-offered`); absent, it can. Only in `FilterTreeConfig.listed`: a field list draws it greyed. */
|
|
84
86
|
disabled?: string;
|
|
@@ -112,6 +112,7 @@ export function customizeBodyPropsOf(props, { components, icons, messages, conve
|
|
|
112
112
|
pending: view.pending,
|
|
113
113
|
onReset: view.onReset,
|
|
114
114
|
onPublish: view.onPublish,
|
|
115
|
+
...(view.own && { own: true }),
|
|
115
116
|
},
|
|
116
117
|
}),
|
|
117
118
|
...(viewFoot && { foot: viewFoot }),
|
|
@@ -1,12 +1,48 @@
|
|
|
1
1
|
import { type ReactNode } from "react";
|
|
2
|
-
import type { ViewsMenuItem } from "../../../provider/components.js";
|
|
2
|
+
import type { ViewsMenuItem, ViewsViewVerbs } from "../../../provider/components.js";
|
|
3
3
|
import type { ToggleConfig } from "../../model.js";
|
|
4
|
-
import type { SettingsPanelsInput } from "../../settings/input.js";
|
|
5
4
|
import type { QuickFiltersConfig } from "../../quick/model.js";
|
|
5
|
+
import type { SettingsPanelsInput } from "../../settings/input.js";
|
|
6
6
|
import type { CollectionViewState } from "../../view-state.js";
|
|
7
|
-
import {
|
|
7
|
+
import type { CollectionViewsInput, ViewsLayout } from "../../views-row/model.js";
|
|
8
8
|
import type { PanelFieldEditor } from "../field-editor.js";
|
|
9
9
|
import type { ToolbarPanelHost } from "./panel-part.js";
|
|
10
|
+
import type { ToolbarMore, ToolbarPartButton } from "./Toolbar.js";
|
|
11
|
+
/** The toolbar's menus as data (VK-741): each handed its default items, each item keyed, and handing back the items it shows.
|
|
12
|
+
* `view`, a view's menu, handed the view too: the rows an option hands (`menu`, Edit view… among them) and the menu a views
|
|
13
|
+
* list draws from an axis's verbs. `add`, New's items: `addItems`, or, with `onAdd` alone, one row keyed `new` that runs it;
|
|
14
|
+
* what it hands back New opens as a menu. `more`, the folded parts' ⋯, each row keyed by its part, handed which line's ⋯ it is (`row` or `bar`). */
|
|
15
|
+
export type ToolbarMenus = {
|
|
16
|
+
view?: ViewsViewVerbs["menu"];
|
|
17
|
+
add?: (items: ViewsMenuItem[]) => ViewsMenuItem[];
|
|
18
|
+
more?: ToolbarMore;
|
|
19
|
+
};
|
|
20
|
+
/** A part of the ready toolbar as the app places it (VK-967): its key (list.md, Default keys); the line it stands on: `row`,
|
|
21
|
+
* `bar` (the filter bar; in `row`, the line below the row) or `foot` (a kit phone list's foot, New's place: anywhere else, the
|
|
22
|
+
* row); on a kit phone the row and the bar are one line. Its side, and its words (`both`, as the look's words say; `icon`, its
|
|
23
|
+
* icon alone), meaningful for a part whose button has a word: `search`, `quick`, `sort`, `filter`, `filter-add`, `options`,
|
|
24
|
+
* `new`. `node`: a part of the app's own, under a key of its own (a key the form holds keeps its own node).
|
|
25
|
+
* Its look (VK-984): `className`, put on every toolbar button the part draws (each handed its `part`, list.md's table), and
|
|
26
|
+
* `button`, your own button drawn for each of them in place of your `ToolbarButton`, handed the very props it would get, `ref`
|
|
27
|
+
* included: put `ref` on your button, so what it opens hangs at it. A part that draws ViewKit's own pills (the views row, Clear
|
|
28
|
+
* and Save, outside your own frame) takes neither. */
|
|
29
|
+
export type ToolbarPartPlace = {
|
|
30
|
+
key: string;
|
|
31
|
+
line: "row" | "bar" | "foot";
|
|
32
|
+
side: "start" | "end";
|
|
33
|
+
words: "both" | "icon";
|
|
34
|
+
node?: ReactNode;
|
|
35
|
+
className?: string;
|
|
36
|
+
button?: ToolbarPartButton;
|
|
37
|
+
};
|
|
38
|
+
/** Which form's parts these are. */
|
|
39
|
+
export type ToolbarPartsContext = {
|
|
40
|
+
arrangement: "kit" | "row";
|
|
41
|
+
phone: boolean;
|
|
42
|
+
};
|
|
43
|
+
/** Handed the form's parts in their drawn order, it hands back the parts drawn, in their order, each on its line and side with
|
|
44
|
+
* its words. A part left out isn't drawn; a key the form doesn't hold is skipped, unless it brings its own `node`. */
|
|
45
|
+
export type ToolbarParts = (parts: ToolbarPartPlace[], ctx: ToolbarPartsContext) => ToolbarPartPlace[];
|
|
10
46
|
export type ReadyToolbarProps<Row> = SettingsPanelsInput<Row> & {
|
|
11
47
|
/** The list's views; absent, no views row (the phone's search then fills its row). */
|
|
12
48
|
views?: CollectionViewsInput<string>;
|
|
@@ -75,6 +111,13 @@ export type ReadyToolbarProps<Row> = SettingsPanelsInput<Row> & {
|
|
|
75
111
|
/** Export CSV, in Customize's foot, where handed, with what it takes in words (`exportCount`, "12 deals"). */
|
|
76
112
|
onExport?: () => void;
|
|
77
113
|
exportCount?: string;
|
|
114
|
+
/** The toolbar's menus as data (VK-741): a view's, New's and the folded ⋯. */
|
|
115
|
+
menus?: ToolbarMenus;
|
|
116
|
+
/** Where each part stands (VK-967): handed every form's parts as data, as `menus` hands a menu's items, it hands back the
|
|
117
|
+
* parts drawn, each on its line and side, in its order, with its words; absent, the arrangement's own. `menu.move`,
|
|
118
|
+
* `menu.drop` and `menu.add` (`viewkitjs/views/list`) take them too. Not `parts`, which lists a field's part columns in
|
|
119
|
+
* Customize. */
|
|
120
|
+
toolbarParts?: ToolbarParts;
|
|
78
121
|
className?: string;
|
|
79
122
|
};
|
|
80
|
-
export declare function ReadyToolbar<Row>(
|
|
123
|
+
export declare function ReadyToolbar<Row>({ settings, layer, onChange, onLayerChange, view, sortFilter, bar, ...rest }: ReadyToolbarProps<Row>): ReactNode;
|
|
@@ -1,329 +1,9 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
import { settingsPanels } from "../../settings/settings-panels.js";
|
|
10
|
-
import { settingsCleared } from "../../toolbar/clear.js";
|
|
11
|
-
import { countsToggle, groupShown, showCountsChange, showCountsOf } from "../../toolbar/counts.js";
|
|
12
|
-
import { withEditView } from "../../toolbar/edit-view.js";
|
|
13
|
-
import { splitViewAxes } from "../../views-row/model.js";
|
|
14
|
-
import { heldStands } from "../filter/editor-ctx.js";
|
|
15
|
-
import { useToolbarPanelState } from "./panel-state.js";
|
|
16
|
-
import { Toolbar, ToolbarSeparator } from "./Toolbar.js";
|
|
17
|
-
import { ToolbarFilter } from "./ToolbarFilter.js";
|
|
18
|
-
import { ToolbarFilterAdd } from "./ToolbarFilterAdd.js";
|
|
19
|
-
import { ToolbarFilters, foldableFilters } from "./ToolbarFilters.js";
|
|
20
|
-
import { ToolbarNew } from "./ToolbarNew.js";
|
|
21
|
-
import { ToolbarOptions } from "./ToolbarOptions.js";
|
|
22
|
-
import { ToolbarQuickFilters } from "./ToolbarQuickFilters.js";
|
|
23
|
-
import { ToolbarSave } from "./ToolbarSave.js";
|
|
24
|
-
import { ToolbarSearch } from "./ToolbarSearch.js";
|
|
25
|
-
import { ToolbarSort } from "./ToolbarSort.js";
|
|
26
|
-
import { ToolbarSortPill } from "./ToolbarSortPill.js";
|
|
27
|
-
import { ToolbarAdvancedFilters } from "./ToolbarAdvancedFilters.js";
|
|
28
|
-
import { ToolbarViews } from "./ToolbarViews.js";
|
|
29
|
-
export function ReadyToolbar(props) {
|
|
30
|
-
const { settings, onChange, views, viewsLayout, onAdd, addItems, addLabel, view, fieldEditor, searchPlaceholder, searching, hosts, narrow, className, viewName, onRenameView, onCopyLink, onExport, exportCount, } = props;
|
|
31
|
-
const customizeOwn = {
|
|
32
|
-
...(viewName !== undefined && { viewName }),
|
|
33
|
-
...(onRenameView && { onRenameView }),
|
|
34
|
-
...(onCopyLink && { onCopyLink }),
|
|
35
|
-
...(onExport && { onExport }),
|
|
36
|
-
...(exportCount !== undefined && { exportCount }),
|
|
37
|
-
};
|
|
38
|
-
const { icons, messages, conventions } = useViews();
|
|
39
|
-
const desktop = useDesktop();
|
|
40
|
-
const phone = props.phone ?? !desktop;
|
|
41
|
-
const options = useToolbarPanelState();
|
|
42
|
-
const sortState = useToolbarPanelState();
|
|
43
|
-
const filterState = useToolbarPanelState();
|
|
44
|
-
const sortAdd = useToolbarPanelState();
|
|
45
|
-
const filterAdd = useToolbarPanelState();
|
|
46
|
-
const quickOwn = useToolbarPanelState();
|
|
47
|
-
const quickState = props.quickFiltersOpen !== undefined && props.onQuickFiltersOpenChange
|
|
48
|
-
? { open: props.quickFiltersOpen, onOpenChange: props.onQuickFiltersOpenChange }
|
|
49
|
-
: quickOwn;
|
|
50
|
-
const [held, setHeld] = useState(null);
|
|
51
|
-
const show = showCountsOf(settings);
|
|
52
|
-
const setShow = (next) => {
|
|
53
|
-
const change = showCountsChange(settings, next);
|
|
54
|
-
if (Object.keys(change).length > 0)
|
|
55
|
-
onChange(change);
|
|
56
|
-
};
|
|
57
|
-
const several = props.severalSorts ?? true;
|
|
58
|
-
const input = {
|
|
59
|
-
...props,
|
|
60
|
-
severalSorts: several,
|
|
61
|
-
filterGroups: props.filterGroups ?? true,
|
|
62
|
-
resolve: props.resolve ?? messages,
|
|
63
|
-
conventions: props.conventions ?? conventions,
|
|
64
|
-
};
|
|
65
|
-
const panels = settingsPanels(input);
|
|
66
|
-
const counts = countsToggle(views, props.toggles, show, setShow, messages);
|
|
67
|
-
const toggles = counts ? [...(props.toggles ?? []), counts] : props.toggles;
|
|
68
|
-
const inputs = {
|
|
69
|
-
filters: panels.filters,
|
|
70
|
-
sort: panels.sort,
|
|
71
|
-
sorts: panels.sorts,
|
|
72
|
-
filterTree: panels.filterTree,
|
|
73
|
-
group: groupShown(panels.group, panels.layout, phone),
|
|
74
|
-
layout: panels.layout,
|
|
75
|
-
toggles,
|
|
76
|
-
};
|
|
77
|
-
const clear = (scope) => () => {
|
|
78
|
-
const change = settingsCleared(input, scope, { phone });
|
|
79
|
-
if (change)
|
|
80
|
-
onChange(change);
|
|
81
|
-
};
|
|
82
|
-
const Edit = icons.options;
|
|
83
|
-
const shownViews = getViewOptionAvailability(inputs).desktop
|
|
84
|
-
? withEditView(views, {
|
|
85
|
-
key: "edit-view",
|
|
86
|
-
label: messages({ key: "views.panels.edit-view" }),
|
|
87
|
-
icon: _jsx(Edit, { className: "h-4 w-4" }),
|
|
88
|
-
onSelect: () => options.onOpenChange(true),
|
|
89
|
-
})
|
|
90
|
-
: views;
|
|
91
|
-
const search = settings.search ?? "";
|
|
92
|
-
const searchNode = (_jsx(ToolbarSearch, { value: search, placeholder: searchPlaceholder, searching: searching, onChange: (next) => {
|
|
93
|
-
const change = settingsChange(settings, { ...settings, search: next === "" ? undefined : next });
|
|
94
|
-
if (Object.keys(change).length > 0)
|
|
95
|
-
onChange(change);
|
|
96
|
-
} }));
|
|
97
|
-
const sortNode = several && panels.sorts ? (_jsx(ToolbarSortPill, { sorts: panels.sorts, open: sortState.open, onOpenChange: sortState.onOpenChange, host: hosts?.sort, addAfter: props.addAfter })) : (_jsx(ToolbarSort, { sort: panels.sort, open: sortState.open, onOpenChange: sortState.onOpenChange, host: hosts?.sort }));
|
|
98
|
-
const filterNode = (_jsx(ToolbarFilter, { filters: panels.filters, filterTree: panels.filterTree, onClear: clear("filters"), open: filterState.open, onOpenChange: filterState.onOpenChange, page: filterState.page, onPageChange: filterState.onPageChange, host: hosts?.filter }));
|
|
99
|
-
const quick = props.quickFilters?.fields.length
|
|
100
|
-
? { ...props.quickFilters, showCounts: props.quickFilters.showCounts ?? show }
|
|
101
|
-
: null;
|
|
102
|
-
const quickNode = quick ? (_jsx(ToolbarQuickFilters, { quickFilters: quick, open: quickState.open, onOpenChange: quickState.onOpenChange, host: hosts?.quick })) : null;
|
|
103
|
-
if ((props.arrangement ?? "kit") === "kit") {
|
|
104
|
-
const clearable = !view && settingsCleared(input, "options", { phone }) !== null;
|
|
105
|
-
const { viewAxes, stackedAxes } = splitViewAxes(shownViews, viewsLayout);
|
|
106
|
-
const tabs = !phone && viewAxes?.length === 1 ? Math.max(0, viewAxes[0].options.length - 1) : 0;
|
|
107
|
-
const Sort = icons.sort;
|
|
108
|
-
const Filter = icons.filter;
|
|
109
|
-
const QuickGlyph = icons.filterCategory;
|
|
110
|
-
const hasFilter = panels.filters.length > 0;
|
|
111
|
-
const filterMenu = {
|
|
112
|
-
label: messages({ key: "views.panels.filter" }),
|
|
113
|
-
icon: _jsx(Filter, { className: "h-4 w-4" }),
|
|
114
|
-
onSelect: () => filterState.onOpenChange(true),
|
|
115
|
-
};
|
|
116
|
-
const tree = panels.filterTree;
|
|
117
|
-
const mihais = (props.sortFilter ?? "right") === "right" && !phone;
|
|
118
|
-
const always = props.bar === "always";
|
|
119
|
-
const filtered = tree ? barItemsOf(tree.tree).length > 0 || !!heldStands(held, tree.tree) : false;
|
|
120
|
-
const barShown = always || !!stackedAxes || filtered;
|
|
121
|
-
const footHere = phone || (mihais && !barShown);
|
|
122
|
-
const filterParts = tree && !phone
|
|
123
|
-
? [
|
|
124
|
-
{
|
|
125
|
-
key: "filters",
|
|
126
|
-
line: 2,
|
|
127
|
-
...(barItemsOf(tree.tree).length === 0 && !heldStands(held, tree.tree)
|
|
128
|
-
? { shed: true, fold: true, menu: filterMenu }
|
|
129
|
-
: { filters: foldableFilters(tree.tree, held) }),
|
|
130
|
-
node: (_jsx(ToolbarFilters, { filterTree: tree, open: filterState.open, onOpenChange: filterState.onOpenChange, held: held, onHeldChange: setHeld, host: hosts?.filter })),
|
|
131
|
-
},
|
|
132
|
-
]
|
|
133
|
-
: [
|
|
134
|
-
{ key: "filter", line: 2, shed: true, fold: true, menu: filterMenu, node: filterNode },
|
|
135
|
-
...(tree
|
|
136
|
-
? [
|
|
137
|
-
{
|
|
138
|
-
key: "advanced-filters",
|
|
139
|
-
line: 2,
|
|
140
|
-
node: _jsx(ToolbarAdvancedFilters, { filterTree: tree, host: hosts?.filter }),
|
|
141
|
-
},
|
|
142
|
-
]
|
|
143
|
-
: []),
|
|
144
|
-
];
|
|
145
|
-
const kitParts = [
|
|
146
|
-
...(shownViews
|
|
147
|
-
? [{ key: "views", tabs, node: _jsx(ToolbarViews, { views: shownViews, viewsLayout: viewsLayout, showCounts: show }) }]
|
|
148
|
-
: []),
|
|
149
|
-
...(shownViews && stackedAxes && !phone
|
|
150
|
-
? [
|
|
151
|
-
{
|
|
152
|
-
key: "views-stacked",
|
|
153
|
-
line: 2,
|
|
154
|
-
node: _jsx(ToolbarViews, { views: shownViews, viewsLayout: viewsLayout, showCounts: show, stacked: true }),
|
|
155
|
-
},
|
|
156
|
-
]
|
|
157
|
-
: []),
|
|
158
|
-
{
|
|
159
|
-
key: "options",
|
|
160
|
-
shed: true,
|
|
161
|
-
fold: true,
|
|
162
|
-
menu: {
|
|
163
|
-
label: messages({ key: "views.panels.toolbar-options" }),
|
|
164
|
-
icon: _jsx(Edit, { className: "h-4 w-4" }),
|
|
165
|
-
onSelect: () => options.onOpenChange(true),
|
|
166
|
-
},
|
|
167
|
-
node: (_jsx(ToolbarOptions, { ...inputs, view: view, viewFoot: !footHere ? "none" : view ? undefined : "kit", footClear: footHere && clearable ? clear("options") : undefined, fieldEditor: fieldEditor, onClear: view ? view.onReset : clear("options"), open: options.open, onOpenChange: options.onOpenChange, page: options.page, onPageChange: options.onPageChange, host: hosts?.options, ...customizeOwn })),
|
|
168
|
-
},
|
|
169
|
-
...(quickNode
|
|
170
|
-
? [
|
|
171
|
-
{
|
|
172
|
-
key: "quick",
|
|
173
|
-
side: "end",
|
|
174
|
-
shed: true,
|
|
175
|
-
fold: true,
|
|
176
|
-
menu: {
|
|
177
|
-
label: quick?.label ?? messages({ key: "views.panels.quick-filters" }),
|
|
178
|
-
icon: _jsx(QuickGlyph, { className: "h-4 w-4" }),
|
|
179
|
-
onSelect: () => quickState.onOpenChange(true),
|
|
180
|
-
},
|
|
181
|
-
node: quickNode,
|
|
182
|
-
},
|
|
183
|
-
]
|
|
184
|
-
: []),
|
|
185
|
-
{ key: "search", side: "end", role: "search", node: searchNode },
|
|
186
|
-
{ key: "new", side: "end", shed: true, node: _jsx(ToolbarNew, { onAdd: onAdd, items: addItems, label: addLabel }) },
|
|
187
|
-
{
|
|
188
|
-
key: "sort",
|
|
189
|
-
line: 2,
|
|
190
|
-
shed: true,
|
|
191
|
-
fold: true,
|
|
192
|
-
menu: {
|
|
193
|
-
label: messages({ key: "views.panels.sort" }),
|
|
194
|
-
icon: _jsx(Sort, { className: "h-4 w-4" }),
|
|
195
|
-
onSelect: () => sortState.onOpenChange(true),
|
|
196
|
-
},
|
|
197
|
-
node: sortNode,
|
|
198
|
-
},
|
|
199
|
-
...(hasFilter ? [{ key: "sep", line: 2, role: "separator", node: _jsx(ToolbarSeparator, {}) }] : []),
|
|
200
|
-
...filterParts,
|
|
201
|
-
...(!phone
|
|
202
|
-
? [
|
|
203
|
-
{
|
|
204
|
-
key: "save",
|
|
205
|
-
line: 2,
|
|
206
|
-
side: "end",
|
|
207
|
-
node: _jsx(ToolbarSave, { view: view, onClear: clearable ? clear("options") : undefined }),
|
|
208
|
-
},
|
|
209
|
-
]
|
|
210
|
-
: []),
|
|
211
|
-
];
|
|
212
|
-
if (phone) {
|
|
213
|
-
const quickHere = kitParts.find((part) => part.key === "quick");
|
|
214
|
-
const phoneParts = quickHere
|
|
215
|
-
? [...kitParts.filter((part) => part !== quickHere), { ...quickHere, line: 2, side: "start" }]
|
|
216
|
-
: kitParts;
|
|
217
|
-
return _jsx(Toolbar, { parts: phoneParts, phone: true, fold: true, className: className });
|
|
218
|
-
}
|
|
219
|
-
if ((props.sortFilter ?? "right") === "bar")
|
|
220
|
-
return _jsx(Toolbar, { parts: kitParts, phone: phone, fold: true, className: className });
|
|
221
|
-
const rowSort = {
|
|
222
|
-
key: "sort",
|
|
223
|
-
side: "end",
|
|
224
|
-
shed: true,
|
|
225
|
-
fold: true,
|
|
226
|
-
menu: {
|
|
227
|
-
label: messages({ key: "views.panels.sort" }),
|
|
228
|
-
icon: _jsx(Sort, { className: "h-4 w-4" }),
|
|
229
|
-
onSelect: () => sortAdd.onOpenChange(true),
|
|
230
|
-
},
|
|
231
|
-
node: panels.sorts ? (_jsx(ToolbarSortPill, { row: true, sorts: panels.sorts, open: sortAdd.open, onOpenChange: sortAdd.onOpenChange, host: hosts?.sort })) : (_jsx(ToolbarSort, { sort: panels.sort, open: sortAdd.open, onOpenChange: sortAdd.onOpenChange, host: hosts?.sort })),
|
|
232
|
-
};
|
|
233
|
-
const rowFilter = tree
|
|
234
|
-
? {
|
|
235
|
-
key: "filter-add",
|
|
236
|
-
side: "end",
|
|
237
|
-
shed: true,
|
|
238
|
-
fold: true,
|
|
239
|
-
menu: { ...filterMenu, onSelect: () => filterAdd.onOpenChange(true) },
|
|
240
|
-
node: (_jsx(ToolbarFilterAdd, { filterTree: tree, onHeldChange: setHeld, open: filterAdd.open, onOpenChange: filterAdd.onOpenChange, host: hosts?.filter })),
|
|
241
|
-
}
|
|
242
|
-
: { key: "filter", side: "end", shed: true, fold: true, menu: filterMenu, node: filterNode };
|
|
243
|
-
const pill = always && panels.sorts ? (_jsx(ToolbarSortPill, { sorts: panels.sorts, open: sortState.open, onOpenChange: sortState.onOpenChange, host: hosts?.sort, addAfter: false })) : null;
|
|
244
|
-
const stackedPart = kitParts.find((part) => part.key === "views-stacked");
|
|
245
|
-
const barParts = barShown
|
|
246
|
-
? [
|
|
247
|
-
...(stackedPart ? [stackedPart] : []),
|
|
248
|
-
...(pill ? [{ key: "sort-pill", line: 2, node: pill }] : []),
|
|
249
|
-
...(pill && (filtered || always) ? [{ key: "sep", line: 2, role: "separator", node: _jsx(ToolbarSeparator, {}) }] : []),
|
|
250
|
-
...(tree
|
|
251
|
-
? [
|
|
252
|
-
{
|
|
253
|
-
key: "filters",
|
|
254
|
-
line: 2,
|
|
255
|
-
filters: foldableFilters(tree.tree, held),
|
|
256
|
-
node: (_jsx(ToolbarFilters, { filterTree: tree, open: filterState.open, onOpenChange: filterState.onOpenChange, held: held, onHeldChange: setHeld, host: hosts?.filter, emptyPlace: always })),
|
|
257
|
-
},
|
|
258
|
-
]
|
|
259
|
-
: []),
|
|
260
|
-
{
|
|
261
|
-
key: "save",
|
|
262
|
-
line: 2,
|
|
263
|
-
side: "end",
|
|
264
|
-
node: _jsx(ToolbarSave, { view: view, onClear: clearable ? clear("options") : undefined }),
|
|
265
|
-
},
|
|
266
|
-
]
|
|
267
|
-
: [];
|
|
268
|
-
const at = (key) => kitParts.find((part) => part.key === key);
|
|
269
|
-
const quickPart = at("quick");
|
|
270
|
-
const mihaisParts = [
|
|
271
|
-
...kitParts.filter((part) => (part.line ?? 1) === 1 && !["quick", "search", "new", "sort", "filter", "filters"].includes(part.key)),
|
|
272
|
-
rowSort,
|
|
273
|
-
rowFilter,
|
|
274
|
-
...(quickPart && quick
|
|
275
|
-
? [
|
|
276
|
-
{
|
|
277
|
-
...quickPart,
|
|
278
|
-
node: (_jsx(ToolbarQuickFilters, { quickFilters: quick, open: quickState.open, onOpenChange: quickState.onOpenChange, host: hosts?.quick, word: null })),
|
|
279
|
-
},
|
|
280
|
-
]
|
|
281
|
-
: []),
|
|
282
|
-
at("search"),
|
|
283
|
-
at("new"),
|
|
284
|
-
...barParts,
|
|
285
|
-
];
|
|
286
|
-
return _jsx(Toolbar, { parts: mihaisParts, phone: phone, fold: true, className: className });
|
|
287
|
-
}
|
|
288
|
-
const parts = [
|
|
289
|
-
...(shownViews
|
|
290
|
-
? [
|
|
291
|
-
{ key: "views", node: _jsx(ToolbarViews, { views: shownViews, viewsLayout: viewsLayout, showCounts: show }) },
|
|
292
|
-
{ key: "views-stacked", line: 2, node: _jsx(ToolbarViews, { views: shownViews, viewsLayout: viewsLayout, showCounts: show, stacked: true }) },
|
|
293
|
-
]
|
|
294
|
-
: []),
|
|
295
|
-
{
|
|
296
|
-
key: "search",
|
|
297
|
-
side: "end",
|
|
298
|
-
role: "search",
|
|
299
|
-
node: searchNode,
|
|
300
|
-
},
|
|
301
|
-
{
|
|
302
|
-
key: "sort",
|
|
303
|
-
side: "end",
|
|
304
|
-
node: sortNode,
|
|
305
|
-
},
|
|
306
|
-
{
|
|
307
|
-
key: "filter",
|
|
308
|
-
side: "end",
|
|
309
|
-
node: filterNode,
|
|
310
|
-
},
|
|
311
|
-
...(panels.filterTree
|
|
312
|
-
? [
|
|
313
|
-
{
|
|
314
|
-
key: "advanced-filters",
|
|
315
|
-
side: "end",
|
|
316
|
-
node: _jsx(ToolbarAdvancedFilters, { filterTree: panels.filterTree, host: hosts?.filter }),
|
|
317
|
-
},
|
|
318
|
-
]
|
|
319
|
-
: []),
|
|
320
|
-
...(quickNode ? [{ key: "quick", side: "end", node: quickNode }] : []),
|
|
321
|
-
{
|
|
322
|
-
key: "options",
|
|
323
|
-
side: "end",
|
|
324
|
-
node: (_jsx(ToolbarOptions, { ...inputs, view: view, fieldEditor: fieldEditor, onClear: view ? view.onReset : clear("options"), open: options.open, onOpenChange: options.onOpenChange, page: options.page, onPageChange: options.onPageChange, host: hosts?.options, ...customizeOwn })),
|
|
325
|
-
},
|
|
326
|
-
{ key: "new", side: "end", node: _jsx(ToolbarNew, { onAdd: onAdd, items: addItems, label: addLabel }) },
|
|
327
|
-
];
|
|
328
|
-
return _jsx(Toolbar, { parts: parts, phone: phone, narrow: narrow, className: className });
|
|
3
|
+
import { useId } from "react";
|
|
4
|
+
import { ListRootBase } from "../../../list/root-base.js";
|
|
5
|
+
import { ListToolbar } from "../../../list/toolbar.js";
|
|
6
|
+
export function ReadyToolbar({ settings, layer, onChange, onLayerChange, view, sortFilter, bar, ...rest }) {
|
|
7
|
+
const id = useId();
|
|
8
|
+
return (_jsx(ListRootBase, { id: id, settings: settings, layer: layer, onChange: onChange, onLayerChange: onLayerChange, view: view, sortFilter: sortFilter, bar: bar, children: _jsx(ListToolbar, { ...rest }) }));
|
|
329
9
|
}
|
|
@@ -1,5 +1,11 @@
|
|
|
1
|
-
import { type ReactNode } from "react";
|
|
1
|
+
import { type ComponentType, type ReactNode } from "react";
|
|
2
|
+
import type { ViewsToolbarButtonProps } from "../../../atoms/types.js";
|
|
3
|
+
import type { ViewsMenuItem } from "../../../provider/components.js";
|
|
2
4
|
import { type ToolbarPlacement } from "../../toolbar/model.js";
|
|
5
|
+
/** ⋯ as data (VK-741): the folded parts' rows, each keyed by its part, and which line's ⋯ they are in. */
|
|
6
|
+
export type ToolbarMore = (items: ViewsMenuItem[], ctx: {
|
|
7
|
+
line: "row" | "bar";
|
|
8
|
+
}) => ViewsMenuItem[];
|
|
3
9
|
/** A part as an app hands it: where it stands, and what it draws. `menu` is its row in ⋯, for a part placed
|
|
4
10
|
* with `fold`: its words, its glyph, and what picking it does (open what the part opens). */
|
|
5
11
|
export type ToolbarPart = ToolbarPlacement & {
|
|
@@ -9,8 +15,14 @@ export type ToolbarPart = ToolbarPlacement & {
|
|
|
9
15
|
icon?: ReactNode;
|
|
10
16
|
onSelect: () => void;
|
|
11
17
|
};
|
|
18
|
+
/** Handed to every toolbar button the part draws (VK-984): its place's class. */
|
|
19
|
+
className?: string;
|
|
20
|
+
/** Drawn for every toolbar button the part draws, in place of the app's `ToolbarButton`, handed the same props (VK-984). */
|
|
21
|
+
button?: ToolbarPartButton;
|
|
12
22
|
};
|
|
13
|
-
|
|
23
|
+
/** A place's own button (VK-984): a `ToolbarButton` of the app's, for one place. */
|
|
24
|
+
export type ToolbarPartButton = ComponentType<ViewsToolbarButtonProps>;
|
|
25
|
+
export declare function Toolbar({ parts, phone, narrow, narrowBelow, fold, more, className, }: {
|
|
14
26
|
parts: readonly ToolbarPart[];
|
|
15
27
|
/** The phone's one row; absent, the provider's answer (`desktopQuery`). */
|
|
16
28
|
phone?: boolean;
|
|
@@ -23,6 +35,9 @@ export declare function Toolbar({ parts, phone, narrow, narrowBelow, fold, class
|
|
|
23
35
|
* filters into "+N filters", then ⋯).
|
|
24
36
|
* Default false: the three forms as they always were. */
|
|
25
37
|
fold?: boolean;
|
|
38
|
+
/** ⋯ as data (VK-741): handed the folded parts' rows, each keyed by its part, and which line's ⋯ it is (each line folds into
|
|
39
|
+
* its own: the row's, or the filter bar's), it hands back the rows ⋯ shows. A press on any of them closes ⋯ first. */
|
|
40
|
+
more?: ToolbarMore;
|
|
26
41
|
className?: string;
|
|
27
42
|
}): ReactNode;
|
|
28
43
|
/** A line between what belongs together and what doesn't: placed with `role: "separator"`, drawn in the fold
|