viewkitjs 0.27.0 → 0.29.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +178 -0
- package/MIGRATION.md +123 -5
- package/fields/dist/derived.d.ts +2 -1
- package/fields/dist/derived.js +9 -3
- package/fields/dist/entities.js +41 -3
- package/fields/dist/index.d.ts +1 -1
- package/fields/dist/index.js +1 -1
- package/fields/dist/messages.d.ts +8 -2
- package/fields/dist/messages.js +3 -0
- package/fields/dist/range.d.ts +6 -0
- package/fields/dist/range.js +8 -0
- package/fields/dist/registry.js +11 -1
- package/fields/dist/spec-changes.js +1 -0
- package/fields/dist/types.d.ts +23 -1
- package/fields/docs/guides/derived-fields.md +7 -5
- package/fields/docs/guides/field-types.md +2 -2
- package/fields/docs/guides/the-index.md +1 -1
- package/fields/docs/reference/fields.md +3 -1
- package/fields/docs/reference/types.md +3 -1
- package/fields/skills/viewkit/SKILL.md +1 -1
- package/package.json +2 -1
- package/postgres/dist/definitions/build.js +29 -5
- package/postgres/dist/definitions/label.d.ts +7 -0
- package/postgres/dist/definitions/label.js +9 -1
- package/postgres/dist/definitions/lookup.js +6 -2
- package/postgres/dist/definitions/place.d.ts +6 -3
- package/postgres/dist/definitions/rollup.js +5 -1
- package/postgres/dist/definitions/storage.d.ts +15 -0
- package/postgres/dist/definitions/storage.js +52 -1
- package/postgres/dist/definitions/stored.js +21 -0
- package/postgres/dist/phone.d.ts +13 -1
- package/postgres/dist/phone.js +23 -3
- package/postgres/dist/search-indexes.d.ts +6 -1
- package/postgres/dist/search-indexes.js +71 -25
- package/postgres/dist/search.js +3 -3
- package/postgres/docs/guides/definitions.md +22 -5
- package/postgres/docs/guides/field-map.md +5 -4
- package/postgres/docs/reference/definitions.md +3 -3
- package/postgres/docs/reference/postgres.md +1 -1
- package/views/dist/cells/cell-format.d.ts +3 -1
- package/views/dist/cells/cell-format.js +3 -3
- package/views/dist/cells/cell-values.js +9 -10
- package/views/dist/cells/use-cell-format.d.ts +8 -1
- package/views/dist/cells/use-cell-format.js +13 -2
- package/views/dist/contract.d.ts +218 -5
- package/views/dist/contract.js +233 -1
- package/views/dist/controls/alert/alert.d.ts +46 -0
- package/views/dist/controls/alert/alert.js +11 -0
- package/views/dist/controls/alert/looks.d.ts +4 -0
- package/views/dist/controls/alert/looks.js +19 -0
- package/views/dist/controls/alert/tokens.d.ts +92 -0
- package/views/dist/controls/alert/tokens.js +25 -0
- package/views/dist/controls/alert-dialog/alert-dialog.d.ts +50 -0
- package/views/dist/controls/alert-dialog/alert-dialog.js +67 -0
- package/views/dist/controls/alert-dialog/confirm.d.ts +13 -0
- package/views/dist/controls/alert-dialog/confirm.js +11 -0
- package/views/dist/controls/alert-dialog/looks.d.ts +4 -0
- package/views/dist/controls/alert-dialog/looks.js +17 -0
- package/views/dist/controls/alert-dialog/tokens.d.ts +119 -0
- package/views/dist/controls/alert-dialog/tokens.js +32 -0
- package/views/dist/controls/alert-dialog.css +95 -0
- package/views/dist/controls/alert.css +51 -0
- package/views/dist/controls/bulk-bar/bulk-bar-of.d.ts +66 -0
- package/views/dist/controls/bulk-bar/bulk-bar-of.js +22 -0
- package/views/dist/controls/bulk-bar/bulk-bar.d.ts +40 -0
- package/views/dist/controls/bulk-bar/bulk-bar.js +278 -0
- package/views/dist/controls/bulk-bar/looks.d.ts +10 -0
- package/views/dist/controls/bulk-bar/looks.js +14 -0
- package/views/dist/controls/bulk-bar/map-selection-bar.d.ts +19 -0
- package/views/dist/controls/bulk-bar/map-selection-bar.js +57 -0
- package/views/dist/controls/bulk-bar/tokens.d.ts +136 -0
- package/views/dist/controls/bulk-bar/tokens.js +36 -0
- package/views/dist/controls/bulk-bar/words.d.ts +50 -0
- package/views/dist/controls/bulk-bar/words.js +19 -0
- package/views/dist/controls/bulk-bar.css +96 -0
- package/views/dist/controls/button/button.js +3 -1
- package/views/dist/controls/button.css +5 -4
- package/views/dist/controls/checkbox/checkbox.js +3 -1
- package/views/dist/controls/checkbox.css +1 -1
- package/views/dist/controls/choice/tokens.d.ts +79 -0
- package/views/dist/controls/choice/tokens.js +22 -0
- package/views/dist/controls/choice.css +31 -0
- package/views/dist/controls/collapsible/collapsible.d.ts +39 -0
- package/views/dist/controls/collapsible/collapsible.js +18 -0
- package/views/dist/controls/collapsible/looks.d.ts +4 -0
- package/views/dist/controls/collapsible/looks.js +5 -0
- package/views/dist/controls/collapsible/map-collapse.d.ts +2 -0
- package/views/dist/controls/collapsible/map-collapse.js +6 -0
- package/views/dist/controls/collapsible/tokens.d.ts +68 -0
- package/views/dist/controls/collapsible/tokens.js +19 -0
- package/views/dist/controls/collapsible.css +83 -0
- package/views/dist/controls/compound-editor/looks.js +1 -1
- package/views/dist/controls/compound-editor/place-parts.js +5 -1
- package/views/dist/controls/controls.d.ts +19 -0
- package/views/dist/controls/controls.js +17 -0
- package/views/dist/controls/customize/customize.d.ts +125 -0
- package/views/dist/controls/customize/customize.js +243 -0
- package/views/dist/controls/customize/glide.d.ts +10 -0
- package/views/dist/controls/customize/glide.js +55 -0
- package/views/dist/controls/customize/looks.d.ts +13 -0
- package/views/dist/controls/customize/looks.js +11 -0
- package/views/dist/controls/customize/map-customize-body.d.ts +18 -0
- package/views/dist/controls/customize/map-customize-body.js +160 -0
- package/views/dist/controls/customize/rules.d.ts +23 -0
- package/views/dist/controls/customize/rules.js +19 -0
- package/views/dist/controls/customize/tokens.d.ts +40 -0
- package/views/dist/controls/customize/tokens.js +12 -0
- package/views/dist/controls/customize/words.d.ts +58 -0
- package/views/dist/controls/customize/words.js +37 -0
- package/views/dist/controls/customize.css +54 -0
- package/views/dist/controls/date-editor/date-editor.d.ts +2 -1
- package/views/dist/controls/date-editor/looks.js +1 -1
- package/views/dist/controls/date-editor/map-calendar.js +3 -1
- package/views/dist/controls/filter-editor/block.d.ts +31 -0
- package/views/dist/controls/filter-editor/block.js +27 -0
- package/views/dist/controls/filter-editor/filter-editor.d.ts +58 -0
- package/views/dist/controls/filter-editor/filter-editor.js +250 -0
- package/views/dist/controls/filter-editor/how.d.ts +23 -0
- package/views/dist/controls/filter-editor/how.js +14 -0
- package/views/dist/controls/filter-editor/map-filter-body.d.ts +33 -0
- package/views/dist/controls/filter-editor/map-filter-body.js +190 -0
- package/views/dist/controls/filter-editor/map-rules.d.ts +101 -0
- package/views/dist/controls/filter-editor/map-rules.js +304 -0
- package/views/dist/controls/filter-editor/parts.d.ts +46 -0
- package/views/dist/controls/filter-editor/parts.js +75 -0
- package/views/dist/controls/filter-editor/rules.d.ts +142 -0
- package/views/dist/controls/filter-editor/rules.js +201 -0
- package/views/dist/controls/filter-editor/tokens.d.ts +83 -0
- package/views/dist/controls/filter-editor/tokens.js +23 -0
- package/views/dist/controls/filter-editor/words.d.ts +74 -0
- package/views/dist/controls/filter-editor/words.js +46 -0
- package/views/dist/controls/filter-editor.css +142 -0
- package/views/dist/controls/group-editor/group-editor.d.ts +56 -0
- package/views/dist/controls/group-editor/group-editor.js +126 -0
- package/views/dist/controls/group-editor/map-group-body.d.ts +19 -0
- package/views/dist/controls/group-editor/map-group-body.js +106 -0
- package/views/dist/controls/group-editor/rules.d.ts +48 -0
- package/views/dist/controls/group-editor/rules.js +41 -0
- package/views/dist/controls/group-editor/tokens.d.ts +15 -0
- package/views/dist/controls/group-editor/tokens.js +6 -0
- package/views/dist/controls/group-editor/words.d.ts +39 -0
- package/views/dist/controls/group-editor/words.js +21 -0
- package/views/dist/controls/group-editor.css +20 -0
- package/views/dist/controls/index.d.ts +45 -3
- package/views/dist/controls/index.js +44 -3
- package/views/dist/controls/inline-input/looks.js +1 -1
- package/views/dist/controls/input/input.js +10 -4
- package/views/dist/controls/internal/editor-parts.d.ts +8 -1
- package/views/dist/controls/internal/editor-parts.js +5 -0
- package/views/dist/controls/internal/phone.d.ts +5 -4
- package/views/dist/controls/internal/phone.js +7 -7
- package/views/dist/controls/internal/scroll.js +5 -1
- package/views/dist/controls/internal/step-return.d.ts +9 -0
- package/views/dist/controls/internal/step-return.js +27 -0
- package/views/dist/controls/internal/typed-run.d.ts +2 -0
- package/views/dist/controls/internal/typed-run.js +5 -0
- package/views/dist/controls/links-editor/links-editor.d.ts +5 -3
- package/views/dist/controls/links-editor/links-editor.js +38 -17
- package/views/dist/controls/links-editor/map-links-body.js +4 -1
- package/views/dist/controls/links-editor.css +1 -1
- package/views/dist/controls/menu/map-menu.js +2 -2
- package/views/dist/controls/menu-list/menu-list.d.ts +17 -2
- package/views/dist/controls/menu-list/menu-list.js +25 -16
- package/views/dist/controls/modal/looks.d.ts +4 -0
- package/views/dist/controls/modal/looks.js +25 -0
- package/views/dist/controls/modal/modal.d.ts +69 -0
- package/views/dist/controls/modal/modal.js +62 -0
- package/views/dist/controls/modal/tokens.d.ts +192 -0
- package/views/dist/controls/modal/tokens.js +50 -0
- package/views/dist/controls/modal.css +130 -0
- package/views/dist/controls/notice/notice.d.ts +49 -0
- package/views/dist/controls/notice/notice.js +35 -0
- package/views/dist/controls/notice/tokens.d.ts +99 -0
- package/views/dist/controls/notice/tokens.js +27 -0
- package/views/dist/controls/notice.css +100 -0
- package/views/dist/controls/number-editor/looks.js +1 -1
- package/views/dist/controls/number-editor/number-editor.js +1 -1
- package/views/dist/controls/option/option.js +3 -1
- package/views/dist/controls/option.css +1 -1
- package/views/dist/controls/pane/looks.d.ts +4 -0
- package/views/dist/controls/pane/looks.js +11 -0
- package/views/dist/controls/pane/pane.d.ts +67 -0
- package/views/dist/controls/pane/pane.js +99 -0
- package/views/dist/controls/pane/state.d.ts +14 -0
- package/views/dist/controls/pane/state.js +7 -0
- package/views/dist/controls/pane/tokens.d.ts +79 -0
- package/views/dist/controls/pane/tokens.js +22 -0
- package/views/dist/controls/pane.css +104 -0
- package/views/dist/controls/picker/looks.js +1 -1
- package/views/dist/controls/picker/map-picker.d.ts +6 -2
- package/views/dist/controls/picker/map-picker.js +4 -2
- package/views/dist/controls/picker/picker.d.ts +7 -0
- package/views/dist/controls/picker/picker.js +57 -8
- package/views/dist/controls/picker/rows.d.ts +4 -2
- package/views/dist/controls/picker/rows.js +4 -3
- package/views/dist/controls/popover/map-popover.d.ts +1 -1
- package/views/dist/controls/popover/map-popover.js +2 -2
- package/views/dist/controls/popover/popover.js +2 -1
- package/views/dist/controls/popover.css +3 -0
- package/views/dist/controls/ports-host/map-ports-host.d.ts +7 -0
- package/views/dist/controls/ports-host/map-ports-host.js +43 -0
- package/views/dist/controls/press/tokens.d.ts +8 -0
- package/views/dist/controls/press/tokens.js +4 -0
- package/views/dist/controls/press.css +44 -0
- package/views/dist/controls/quick-filters/looks.d.ts +11 -0
- package/views/dist/controls/quick-filters/looks.js +9 -0
- package/views/dist/controls/quick-filters/map-quick-filters-body.d.ts +31 -0
- package/views/dist/controls/quick-filters/map-quick-filters-body.js +56 -0
- package/views/dist/controls/quick-filters/quick-filters.d.ts +37 -0
- package/views/dist/controls/quick-filters/quick-filters.js +89 -0
- package/views/dist/controls/quick-filters/reminder.d.ts +18 -0
- package/views/dist/controls/quick-filters/reminder.js +41 -0
- package/views/dist/controls/quick-filters/rules.d.ts +89 -0
- package/views/dist/controls/quick-filters/rules.js +52 -0
- package/views/dist/controls/quick-filters/tokens.d.ts +112 -0
- package/views/dist/controls/quick-filters/tokens.js +30 -0
- package/views/dist/controls/quick-filters/words.d.ts +25 -0
- package/views/dist/controls/quick-filters/words.js +13 -0
- package/views/dist/controls/quick-filters.css +118 -0
- package/views/dist/controls/sheet/bottom-sheet.d.ts +9 -4
- package/views/dist/controls/sheet/bottom-sheet.js +4 -4
- package/views/dist/controls/sheet/map-sheet.d.ts +4 -1
- package/views/dist/controls/sheet/map-sheet.js +19 -6
- package/views/dist/controls/sheet/sheet-parts.d.ts +10 -0
- package/views/dist/controls/sheet/sheet-parts.js +2 -0
- package/views/dist/controls/sort-editor/map-sort-body.d.ts +9 -0
- package/views/dist/controls/sort-editor/map-sort-body.js +81 -0
- package/views/dist/controls/sort-editor/rules.d.ts +48 -0
- package/views/dist/controls/sort-editor/rules.js +24 -0
- package/views/dist/controls/sort-editor/sort-editor.d.ts +58 -0
- package/views/dist/controls/sort-editor/sort-editor.js +180 -0
- package/views/dist/controls/sort-editor/tokens.d.ts +79 -0
- package/views/dist/controls/sort-editor/tokens.js +22 -0
- package/views/dist/controls/sort-editor/words.d.ts +48 -0
- package/views/dist/controls/sort-editor/words.js +25 -0
- package/views/dist/controls/sort-editor.css +96 -0
- package/views/dist/controls/switch-row/switch-row.d.ts +15 -0
- package/views/dist/controls/switch-row/switch-row.js +9 -0
- package/views/dist/controls/switch-row/tokens.d.ts +51 -0
- package/views/dist/controls/switch-row/tokens.js +15 -0
- package/views/dist/controls/switch-row.css +39 -0
- package/views/dist/controls/switch.css +1 -1
- package/views/dist/controls/tag/tag.js +3 -1
- package/views/dist/controls/tag-field/tag-field.d.ts +20 -0
- package/views/dist/controls/tag-field/tag-field.js +19 -0
- package/views/dist/controls/tag-field/tokens.d.ts +7 -0
- package/views/dist/controls/tag-field/tokens.js +4 -0
- package/views/dist/controls/tag-field.css +13 -0
- package/views/dist/controls/text-editor/looks.js +1 -1
- package/views/dist/controls/text-editor/text-editor.js +1 -5
- package/views/dist/controls/toast/toast.d.ts +79 -0
- package/views/dist/controls/toast/toast.js +101 -0
- package/views/dist/controls/toast/tokens.d.ts +100 -0
- package/views/dist/controls/toast/tokens.js +27 -0
- package/views/dist/controls/toast.css +93 -0
- package/views/dist/controls/tokens.js +38 -0
- package/views/dist/controls/toolbar/keys.d.ts +3 -0
- package/views/dist/controls/toolbar/keys.js +11 -0
- package/views/dist/controls/toolbar/looks.d.ts +10 -0
- package/views/dist/controls/toolbar/looks.js +40 -0
- package/views/dist/controls/toolbar/tokens.d.ts +28 -0
- package/views/dist/controls/toolbar/tokens.js +9 -0
- package/views/dist/controls/toolbar/toolbar.d.ts +111 -0
- package/views/dist/controls/toolbar/toolbar.js +370 -0
- package/views/dist/controls/toolbar/words.d.ts +28 -0
- package/views/dist/controls/toolbar/words.js +17 -0
- package/views/dist/controls/toolbar-button/looks.d.ts +4 -0
- package/views/dist/controls/toolbar-button/looks.js +21 -0
- package/views/dist/controls/toolbar-button/tokens.d.ts +103 -0
- package/views/dist/controls/toolbar-button/tokens.js +28 -0
- package/views/dist/controls/toolbar-button/toolbar-button.d.ts +66 -0
- package/views/dist/controls/toolbar-button/toolbar-button.js +51 -0
- package/views/dist/controls/toolbar-button.css +75 -0
- package/views/dist/controls/toolbar.css +65 -0
- package/views/dist/controls/tooltip/map-tooltip.d.ts +1 -1
- package/views/dist/controls/tooltip/map-tooltip.js +2 -2
- package/views/dist/controls/tooltip/tooltip.d.ts +3 -1
- package/views/dist/controls/tooltip/tooltip.js +2 -2
- package/views/dist/controls/values-editor/looks.js +1 -1
- package/views/dist/controls/values-editor/values-editor.js +7 -1
- package/views/dist/controls/views-list/map-views-list-body.d.ts +4 -1
- package/views/dist/controls/views-list/map-views-list-body.js +128 -4
- package/views/dist/controls/views-list/rules.d.ts +26 -0
- package/views/dist/controls/views-list/rules.js +63 -0
- package/views/dist/controls/views-list/view-menu.d.ts +84 -0
- package/views/dist/controls/views-list/view-menu.js +201 -0
- package/views/dist/controls/views-list/views-list.d.ts +8 -1
- package/views/dist/controls/views-list/views-list.js +18 -3
- package/views/dist/controls/views-list/words.d.ts +54 -0
- package/views/dist/controls/views-list/words.js +10 -1
- package/views/dist/controls/views-list.css +5 -1
- package/views/dist/display/date.js +5 -5
- package/views/dist/display/format.d.ts +6 -0
- package/views/dist/display/format.js +13 -2
- package/views/dist/display/index.d.ts +1 -1
- package/views/dist/display/index.js +1 -1
- package/views/dist/display/options.d.ts +3 -1
- package/views/dist/display/range.d.ts +2 -1
- package/views/dist/display/range.js +4 -1
- package/views/dist/display/use-display-options.d.ts +3 -0
- package/views/dist/display/use-display-options.js +10 -2
- package/views/dist/display/viewer.d.ts +1 -1
- package/views/dist/display/viewer.js +1 -1
- package/views/dist/editors/DateEditor.js +11 -9
- package/views/dist/editors/relation-panel.js +7 -1
- package/views/dist/editors/relation-picker.d.ts +2 -1
- package/views/dist/editors/relation-picker.js +4 -3
- package/views/dist/editors/relation-source.d.ts +4 -1
- package/views/dist/editors/relation-source.js +5 -2
- package/views/dist/field-row/editors/RowNumberEditor.js +2 -2
- package/views/dist/fields/number-edit.d.ts +6 -0
- package/views/dist/fields/number-edit.js +8 -1
- package/views/dist/grid/chrome/GridCellEditors.js +2 -2
- package/views/dist/grid/chrome/GridColumnDateSection.d.ts +4 -3
- package/views/dist/grid/chrome/GridColumnDateSection.js +4 -4
- package/views/dist/grid/chrome/GridColumnDurationSection.js +2 -2
- package/views/dist/grid/chrome/GridColumnMenu.js +6 -4
- package/views/dist/grid/chrome/GridFooter.js +2 -2
- package/views/dist/grid/chrome/GridHeader.js +2 -1
- package/views/dist/grid/chrome/GridNumberEditor.js +2 -2
- package/views/dist/grid/chrome/GridRowCells.js +2 -1
- package/views/dist/grid/chrome/GridTextEditor.js +2 -2
- package/views/dist/grid/chrome/grid-column-menu-items.js +4 -2
- package/views/dist/grid/chrome/grid-editor-layer.d.ts +5 -1
- package/views/dist/grid/chrome/grid-editor-layer.js +1 -0
- package/views/dist/grid/chrome/grid-fitted-box.d.ts +7 -1
- package/views/dist/grid/chrome/grid-fitted-box.js +4 -4
- package/views/dist/grid/chrome/useGridBandFigures.js +2 -2
- package/views/dist/grid/chrome/useGridFittedWidths.d.ts +3 -0
- package/views/dist/grid/chrome/useGridFittedWidths.js +9 -3
- package/views/dist/grid/chrome/useGridKeyboard.d.ts +4 -1
- package/views/dist/grid/chrome/useGridKeyboard.js +5 -2
- package/views/dist/grid/chrome/useGridTableInteractionModel.js +2 -1
- package/views/dist/grid/core/clipboard-model.js +9 -4
- package/views/dist/grid/core/commit-model.d.ts +7 -0
- package/views/dist/grid/core/commit-model.js +5 -1
- package/views/dist/grid/core/editing-controller.js +10 -2
- package/views/dist/grid/core/editing-model.js +3 -7
- package/views/dist/grid/core/undo-owner.d.ts +6 -0
- package/views/dist/grid/core/undo-owner.js +13 -0
- package/views/dist/grid/core/useGridEditing.d.ts +2 -0
- package/views/dist/grid/core/useGridEditing.js +4 -0
- package/views/dist/grid/grid.css +240 -0
- package/views/dist/grid/looks.d.ts +5 -1
- package/views/dist/grid/looks.js +20 -12
- package/views/dist/grid-tokens.d.ts +109 -0
- package/views/dist/grid-tokens.js +29 -0
- package/views/dist/looks/index.d.ts +10 -0
- package/views/dist/looks/index.js +10 -0
- package/views/dist/looks/pieces.js +20 -0
- package/views/dist/model/column-capabilities.d.ts +2 -0
- package/views/dist/model/column-filters.d.ts +2 -1
- package/views/dist/model/column-from.js +2 -2
- package/views/dist/model/relation-filters.d.ts +2 -0
- package/views/dist/panels/index.d.ts +2 -2
- package/views/dist/panels/index.js +2 -2
- package/views/dist/panels/labels.d.ts +4 -0
- package/views/dist/panels/labels.js +8 -0
- package/views/dist/panels/model.d.ts +14 -1
- package/views/dist/panels/quick/model.d.ts +4 -0
- package/views/dist/panels/react/customize-body.d.ts +12 -5
- package/views/dist/panels/react/customize-body.js +41 -13
- package/views/dist/panels/react/customize.d.ts +8 -1
- package/views/dist/panels/react/customize.js +11 -6
- package/views/dist/panels/react/filter/FilterEditor.js +6 -6
- package/views/dist/panels/react/filter/FilterFieldList.js +10 -2
- package/views/dist/panels/react/filter/PhoneFilterEditor.d.ts +8 -2
- package/views/dist/panels/react/filter/PhoneFilterEditor.js +12 -9
- package/views/dist/panels/react/filter/filter-body.d.ts +8 -5
- package/views/dist/panels/react/filter/filter-body.js +21 -7
- package/views/dist/panels/react/filter/filter-part-body.d.ts +4 -1
- package/views/dist/panels/react/filter/filter-part-body.js +3 -1
- package/views/dist/panels/react/panel-sheet.d.ts +5 -1
- package/views/dist/panels/react/panel-sheet.js +6 -2
- package/views/dist/panels/react/panel-step.d.ts +15 -0
- package/views/dist/panels/react/panel-step.js +27 -0
- package/views/dist/panels/react/quick/QuickFiltersPanel.js +1 -0
- package/views/dist/panels/react/sort/SortEditor.d.ts +4 -0
- package/views/dist/panels/react/sort/SortEditor.js +5 -2
- package/views/dist/panels/react/toolbar/ReadyToolbar.d.ts +18 -0
- package/views/dist/panels/react/toolbar/ReadyToolbar.js +93 -4
- package/views/dist/panels/react/toolbar/Toolbar.js +1 -1
- package/views/dist/panels/react/toolbar/ToolbarAsideFilter.js +2 -2
- package/views/dist/panels/react/toolbar/ToolbarBarFilter.js +15 -5
- package/views/dist/panels/react/toolbar/ToolbarFilterAdd.d.ts +16 -0
- package/views/dist/panels/react/toolbar/ToolbarFilterAdd.js +50 -0
- package/views/dist/panels/react/toolbar/ToolbarFilterSheet.js +3 -1
- package/views/dist/panels/react/toolbar/ToolbarFilters.d.ts +4 -1
- package/views/dist/panels/react/toolbar/ToolbarFilters.js +38 -23
- package/views/dist/panels/react/toolbar/ToolbarOptions.d.ts +12 -4
- package/views/dist/panels/react/toolbar/ToolbarOptions.js +6 -2
- package/views/dist/panels/react/toolbar/ToolbarQuickFilters.d.ts +4 -1
- package/views/dist/panels/react/toolbar/ToolbarQuickFilters.js +2 -2
- package/views/dist/panels/react/toolbar/ToolbarSortPill.d.ts +5 -0
- package/views/dist/panels/react/toolbar/ToolbarSortPill.js +15 -6
- package/views/dist/panels/react/toolbar/panel-part.d.ts +5 -1
- package/views/dist/panels/react/toolbar/panel-part.js +2 -2
- package/views/dist/panels/react/toolbar/use-filter-add.d.ts +16 -0
- package/views/dist/panels/react/toolbar/use-filter-add.js +32 -0
- package/views/dist/panels/react/view-footer.d.ts +1 -1
- package/views/dist/panels/react/views-row/ViewPicker.js +25 -4
- package/views/dist/panels/react.d.ts +1 -0
- package/views/dist/panels/react.js +1 -0
- package/views/dist/panels/settings/filter-groups.d.ts +3 -0
- package/views/dist/panels/settings/filter-groups.js +72 -7
- package/views/dist/panels/settings/filters.d.ts +5 -0
- package/views/dist/panels/settings/filters.js +12 -6
- package/views/dist/panels/settings/group-buckets.js +1 -0
- package/views/dist/panels/views-row/model.d.ts +10 -1
- package/views/dist/provider/ViewsProvider.d.ts +7 -1
- package/views/dist/provider/ViewsProvider.js +50 -6
- package/views/dist/provider/components.d.ts +178 -11
- package/views/dist/provider/context.d.ts +6 -0
- package/views/dist/provider/moment.d.ts +6 -0
- package/views/dist/provider/moment.js +10 -0
- package/views/dist/provider/ports.d.ts +18 -6
- package/views/dist/provider/ports.js +2 -1
- package/views/dist/react.d.ts +2 -2
- package/views/dist/react.js +1 -1
- package/views/dist/selection/SelectionBar.d.ts +2 -16
- package/views/dist/selection/SelectionBar.js +4 -1
- package/views/dist/selection/bar-props.d.ts +26 -0
- package/views/dist/selection/bar-props.js +1 -0
- package/views/dist/selection/index.d.ts +1 -1
- package/views/dist/selection/verbs.d.ts +32 -5
- package/views/dist/styles.css +1499 -73
- package/views/dist/styles.unlayered.css +1497 -70
- package/views/docs/contract.md +56 -23
- package/views/docs/controls/alert-dialog.md +37 -0
- package/views/docs/controls/alert.md +30 -0
- package/views/docs/controls/bulk-bar.md +41 -0
- package/views/docs/controls/choice.md +25 -0
- package/views/docs/controls/collapsible.md +22 -0
- package/views/docs/controls/customize.md +17 -0
- package/views/docs/controls/filter-editor.md +28 -0
- package/views/docs/controls/group-editor.md +11 -0
- package/views/docs/controls/modal.md +55 -0
- package/views/docs/controls/notice.md +32 -0
- package/views/docs/controls/pane.md +25 -0
- package/views/docs/controls/popover.md +2 -0
- package/views/docs/controls/press.md +9 -0
- package/views/docs/controls/quick-filters.md +35 -0
- package/views/docs/controls/radio.md +1 -1
- package/views/docs/controls/sort-editor.md +27 -0
- package/views/docs/controls/switch-row.md +18 -0
- package/views/docs/controls/tag-field.md +7 -0
- package/views/docs/controls/toast.md +32 -0
- package/views/docs/controls/toolbar-button.md +31 -0
- package/views/docs/controls/toolbar.md +14 -0
- package/views/docs/guides/atoms.md +2 -2
- package/views/docs/guides/cells.md +3 -3
- package/views/docs/guides/display.md +3 -3
- package/views/docs/guides/looks.md +8 -2
- package/views/docs/guides/ports.md +6 -6
- package/views/docs/guides/selection.md +5 -1
- package/views/docs/guides/the-grid.md +2 -2
- package/views/docs/guides/the-provider.md +21 -2
- package/views/docs/install.md +4 -1
- package/views/docs/reference/cells.md +3 -3
- package/views/docs/reference/controls.md +403 -16
- package/views/docs/reference/display.md +3 -2
- package/views/docs/reference/editors-relation.md +1 -1
- package/views/docs/reference/looks.md +35 -11
- package/views/docs/reference/panels-react.md +11 -10
- package/views/docs/reference/panels.md +9 -7
- package/views/docs/reference/react.md +20 -13
- package/views/docs/reference/selection.md +4 -2
- package/views/docs/reference/views.md +8 -6
- package/views/skills/views/SKILL.md +2 -2
|
@@ -6,7 +6,7 @@ import { DisabledReason } from "../../../atoms/DisabledReason.js";
|
|
|
6
6
|
import { canExcludeAt, canGroupAt, groupAt, nodeAt, putBackAt, setExcludedAt, setJoinAt, } from "../../../filters/filter-tree.js";
|
|
7
7
|
import { cx } from "../../../internal/cx.js";
|
|
8
8
|
import { useViews } from "../../../provider/context.js";
|
|
9
|
-
import { filterWaysOf, setAsideFits, takesValue } from "../../settings/filter-groups.js";
|
|
9
|
+
import { filterWaysOf, listedFieldsOf, setAsideFits, takesValue } from "../../settings/filter-groups.js";
|
|
10
10
|
import { asideFilterWords, ruleValueWords } from "../../toolbar/filter-words.js";
|
|
11
11
|
import { abs, fieldOfRule, keyOf, relationOf, samePath, useEditorCtx, } from "./editor-ctx.js";
|
|
12
12
|
import { addPicked, addState, everyBlocked, pickField, pickQuantifier, pickWay, writeRule, } from "./rule-writes.js";
|
|
@@ -225,7 +225,7 @@ function RuleRow({ ctx, rule, rel, relation, inPending, }) {
|
|
|
225
225
|
turn();
|
|
226
226
|
else
|
|
227
227
|
setOpens(opens === "field" ? null : "field");
|
|
228
|
-
}, children: [_jsx("span", { className: "truncate", children: asideName }), _jsx(Down, { className: "h-3.5 w-3.5 shrink-0" })] }), _jsx("span", { id: whyNote, hidden: true, children: words.why })] }) }), ctx.form === "computer" && !orphan && (_jsx(Popover, { open: opens === "field", onOpenChange: (next) => setOpens(next ? "field" : null), anchor: fieldBox, align: "start", sideOffset: 4, chrome: "menu", children: _jsx(FilterFieldList, { fields: relation?.far ?? ctx.filterTree
|
|
228
|
+
}, children: [_jsx("span", { className: "truncate", children: asideName }), _jsx(Down, { className: "h-3.5 w-3.5 shrink-0" })] }), _jsx("span", { id: whyNote, hidden: true, children: words.why })] }) }), ctx.form === "computer" && !orphan && (_jsx(Popover, { open: opens === "field", onOpenChange: (next) => setOpens(next ? "field" : null), anchor: fieldBox, align: "start", sideOffset: 4, chrome: "menu", children: _jsx(FilterFieldList, { fields: relation?.far ?? listedFieldsOf(ctx.filterTree), relations: false, onPick: (picked) => {
|
|
229
229
|
setOpens(null);
|
|
230
230
|
pickField(ctx, ruleAtHere, rule, undefined, picked);
|
|
231
231
|
}, onDone: () => setOpens(null) }) })), _jsx(DisabledReason, { reason: words.why, className: "inline-flex min-w-0", children: _jsx(Button, { variant: "outline", size: size, ...OFF_BOX, className: cx("min-w-0 justify-start", OFF_LOOK), children: _jsx("span", { className: "truncate", children: words.way }) }) }), words.value !== null && (_jsx(DisabledReason, { reason: words.why, className: "inline-flex min-w-0", children: _jsx(Button, { variant: "outline", size: size, ...OFF_BOX, className: cx("min-w-0 justify-start", OFF_LOOK), children: _jsx("span", { className: "truncate", children: words.value }) }) }))] }), _jsx(RuleMenu, { ctx: ctx, rel: rel, name: asideName, anchor: moreBox, open: opens === "more", setOpen: (o) => setOpens(o ? "more" : null), grouping: false, why: words.why, putBack: fits && rel
|
|
@@ -241,7 +241,7 @@ function RuleRow({ ctx, rule, rel, relation, inPending, }) {
|
|
|
241
241
|
const ways = filterWaysOf(field, conventions);
|
|
242
242
|
const wayWords = ways.find((way) => way.value === rule.operator)?.label ?? rule.operator;
|
|
243
243
|
const box = (open) => ({ "aria-expanded": open, className: "min-w-0 justify-between" });
|
|
244
|
-
const fields = relation?.far ?? ctx.filterTree
|
|
244
|
+
const fields = relation?.far ?? listedFieldsOf(ctx.filterTree);
|
|
245
245
|
const grouping = !!rel && canGroupAt(ctx.view, abs(ctx.base, rel));
|
|
246
246
|
if (ctx.form === "phone") {
|
|
247
247
|
const turn = (to) => ctx.openPage?.({
|
|
@@ -254,7 +254,7 @@ function RuleRow({ ctx, rule, rel, relation, inPending, }) {
|
|
|
254
254
|
return (_jsxs("div", { "data-slot": "vk-filter-rule", className: "flex min-w-0 flex-1 flex-wrap items-center gap-1.5", children: [_jsxs(Button, { ref: fieldBox, variant: "outline", size: "sm", "aria-label": `${messages({ key: "views.panels.filter-field" })}: ${name}`, "aria-haspopup": "dialog", ...box(opens === "field"), onClick: () => setOpens(opens === "field" ? null : "field"), children: [_jsx("span", { className: "truncate", children: name }), _jsx(Down, { className: "h-3.5 w-3.5 shrink-0" })] }), _jsx(Popover, { open: opens === "field", onOpenChange: (next) => setOpens(next ? "field" : null), anchor: fieldBox, align: "start", sideOffset: 4, chrome: "menu", children: _jsx(FilterFieldList, { fields: fields, own: field.key, relations: false, onPick: (picked) => {
|
|
255
255
|
setOpens(null);
|
|
256
256
|
pickField(ctx, ruleAtHere, rule, field, picked);
|
|
257
|
-
}, onDone: () => setOpens(null) }) }), _jsxs(Button, { ref: wayBox, variant: "outline", size: "sm", "aria-label": `${messages({ key: "views.panels.filter-way" })}: ${wayWords}`, "aria-haspopup": partBody ? "dialog" : "menu", ...box(opens === "way"), onClick: () => setOpens(opens === "way" ? null : "way"), children: [_jsx("span", { className: "truncate", children: wayWords }), _jsx(Down, { className: "h-3.5 w-3.5 shrink-0" })] }), partBody ? (_jsx(Popover, { open: opens === "way", onOpenChange: (next) => setOpens(next ? "way" : null), anchor: wayBox, align: "start", sideOffset: 4, chrome: "menu", children: _jsx(AppFilterPart, { part: "way", rule: rule, field: field, own: null, form: "computer", onWay: (operator) => {
|
|
257
|
+
}, onDone: () => setOpens(null) }) }), _jsxs(Button, { ref: wayBox, variant: "outline", size: "sm", "aria-label": `${messages({ key: "views.panels.filter-way" })}: ${wayWords}`, "aria-haspopup": partBody ? "dialog" : "menu", ...box(opens === "way"), onClick: () => setOpens(opens === "way" ? null : "way"), children: [_jsx("span", { className: "truncate", children: wayWords }), _jsx(Down, { className: "h-3.5 w-3.5 shrink-0" })] }), partBody ? (_jsx(Popover, { open: opens === "way", onOpenChange: (next) => setOpens(next ? "way" : null), anchor: wayBox, align: "start", sideOffset: 4, chrome: "menu", children: _jsx(AppFilterPart, { part: "way", rule: rule, field: field, options: ctx.filterTree.optionsOf?.(rule.fieldKey, rule.part, relation?.fieldKey), own: null, form: "computer", onWay: (operator) => {
|
|
258
258
|
setOpens(null);
|
|
259
259
|
pickWay(ctx, ruleAtHere, rule, field, operator);
|
|
260
260
|
}, onValue: write, onDone: () => setOpens(null) }) })) : (_jsx(Menu, { open: opens === "way", onOpenChange: (next) => setOpens(next ? "way" : null), anchor: wayBox, align: "start", label: messages({ key: "views.panels.filter-way" }), items: ways.map((way) => ({
|
|
@@ -266,7 +266,7 @@ function RuleRow({ ctx, rule, rel, relation, inPending, }) {
|
|
|
266
266
|
setOpens(null);
|
|
267
267
|
pickWay(ctx, ruleAtHere, rule, field, way.value);
|
|
268
268
|
},
|
|
269
|
-
})) })), config && (_jsxs(_Fragment, { children: [_jsxs(Button, { ref: valueBox, variant: "outline", size: "sm", "aria-label": `${messages({ key: "views.panels.filter-value" })}: ${valueWords}`, "aria-haspopup": "dialog", ...box(opens === "value"), onClick: () => setOpens(opens === "value" ? null : "value"), children: [_jsx("span", { className: "truncate", children: valueWords }), _jsx(Down, { className: "h-3.5 w-3.5 shrink-0" })] }), _jsx(Popover, { open: opens === "value", onOpenChange: (next) => setOpens(next ? "value" : null), anchor: valueBox, align: "start", sideOffset: 4, chrome: "menu", initialFocus: false, children: partBody ? (_jsx(AppFilterPart, { part: "value", rule: rule, field: field, own: _jsx(FilterValueBody, { filter: config }), form: "computer", onWay: (operator) => pickWay(ctx, ruleAtHere, rule, field, operator), onValue: write, onDone: () => setOpens(null) })) : (_jsx(FilterValueBody, { filter: config })) })] })), _jsx(RuleMenu, { ctx: ctx, rel: rel, name: name, anchor: moreBox, open: opens === "more", setOpen: (o) => setOpens(o ? "more" : null), grouping: grouping, className: "ml-auto" })] }));
|
|
269
|
+
})) })), config && (_jsxs(_Fragment, { children: [_jsxs(Button, { ref: valueBox, variant: "outline", size: "sm", "aria-label": `${messages({ key: "views.panels.filter-value" })}: ${valueWords}`, "aria-haspopup": "dialog", ...box(opens === "value"), onClick: () => setOpens(opens === "value" ? null : "value"), children: [_jsx("span", { className: "truncate", children: valueWords }), _jsx(Down, { className: "h-3.5 w-3.5 shrink-0" })] }), _jsx(Popover, { open: opens === "value", onOpenChange: (next) => setOpens(next ? "value" : null), anchor: valueBox, align: "start", sideOffset: 4, chrome: "menu", initialFocus: false, children: partBody ? (_jsx(AppFilterPart, { part: "value", rule: rule, field: field, options: ctx.filterTree.optionsOf?.(rule.fieldKey, rule.part, relation?.fieldKey), own: _jsx(FilterValueBody, { filter: config }), form: "computer", onWay: (operator) => pickWay(ctx, ruleAtHere, rule, field, operator), onValue: write, onDone: () => setOpens(null) })) : (_jsx(FilterValueBody, { filter: config })) })] })), _jsx(RuleMenu, { ctx: ctx, rel: rel, name: name, anchor: moreBox, open: opens === "more", setOpen: (o) => setOpens(o ? "more" : null), grouping: grouping, className: "ml-auto" })] }));
|
|
270
270
|
}
|
|
271
271
|
function RuleMenu({ ctx, rel, name, anchor, open, setOpen, grouping, className, why, putBack, }) {
|
|
272
272
|
const { components, icons, messages } = useViews();
|
|
@@ -320,7 +320,7 @@ function AddFilter({ ctx, rel, relation, onAdded, }) {
|
|
|
320
320
|
const anchor = useRef(null);
|
|
321
321
|
const [open, setOpen] = useState(false);
|
|
322
322
|
const { full: tooMany, relations, gone } = addState(ctx, rel, relation);
|
|
323
|
-
const fields = relation?.far ?? ctx.filterTree
|
|
323
|
+
const fields = relation?.far ?? listedFieldsOf(ctx.filterTree);
|
|
324
324
|
const full = tooMany || gone;
|
|
325
325
|
const reason = gone
|
|
326
326
|
? messages({ key: "views.panels.filter-relation-gone" })
|
|
@@ -24,6 +24,7 @@ export function FilterFieldList({ fields, own, relations = true, onPick, onDone,
|
|
|
24
24
|
label: field.label,
|
|
25
25
|
...(field.mark ? { type: field.mark.type, glyph: markGlyph(glyphs, field.mark) } : {}),
|
|
26
26
|
...(field.part !== undefined ? { part: field.part } : {}),
|
|
27
|
+
...(field.disabled !== undefined ? { disabled: field.disabled } : {}),
|
|
27
28
|
});
|
|
28
29
|
return (_jsx(FieldsBody, { purpose: "filter", label: messages({ key: "views.panels.filter" }), search: messages({ key: "views.panels.filter-search" }), fields: [
|
|
29
30
|
...listOwn.map(asData),
|
|
@@ -31,7 +32,7 @@ export function FilterFieldList({ fields, own, relations = true, onPick, onDone,
|
|
|
31
32
|
], ...(own !== undefined ? { own } : {}), form: form, onPick: (key, farKey) => {
|
|
32
33
|
if (farKey === undefined) {
|
|
33
34
|
const picked = listOwn.find((field) => field.key === key);
|
|
34
|
-
if (picked)
|
|
35
|
+
if (picked && picked.disabled === undefined)
|
|
35
36
|
onPick(picked);
|
|
36
37
|
return;
|
|
37
38
|
}
|
|
@@ -50,7 +51,14 @@ export function FilterFieldList({ fields, own, relations = true, onPick, onDone,
|
|
|
50
51
|
return (_jsxs("div", { "data-slot": "vk-filter-fields", "data-vs-detail": true, className: cx("max-h-72", PANEL_LIST_CLASS), children: [opened && (_jsx(PanelHeader, { title: opened.label, onBack: () => {
|
|
51
52
|
setOpened(null);
|
|
52
53
|
setQuery("");
|
|
53
|
-
} })), searchable && (_jsx("div", { "data-vs-inset": true, className: FIELD_PADDING, children: _jsx(PanelSearch, { value: query, onChange: setQuery, placeholder: messages({ key: "views.panels.filter-search" }), autoFocus: true }) })), shown.filter(matches).map((field) => (_jsx(RadioRow, { mark: "box", selected: !opened && field.key === own, label: field.label,
|
|
54
|
+
} })), searchable && (_jsx("div", { "data-vs-inset": true, className: FIELD_PADDING, children: _jsx(PanelSearch, { value: query, onChange: setQuery, placeholder: messages({ key: "views.panels.filter-search" }), autoFocus: true }) })), shown.filter(matches).map((field) => (_jsx(RadioRow, { mark: "box", selected: !opened && field.key === own, label: field.label, ...(field.disabled !== undefined ? { disabled: true, disabledReason: field.disabled } : {}), onClick: () => {
|
|
55
|
+
if (field.disabled !== undefined)
|
|
56
|
+
return;
|
|
57
|
+
if (opened)
|
|
58
|
+
onPick(opened, field);
|
|
59
|
+
else
|
|
60
|
+
onPick(field);
|
|
61
|
+
} }, field.key))), related.filter(matches).length > 0 && (_jsxs(_Fragment, { children: [_jsx(FilterSectionHeading, { children: messages({ key: "views.panels.related-records" }) }), related.filter(matches).map((relation) => (_jsx(MenuRow, { icon: _jsx(Relation, { className: "h-3.5 w-3.5" }), label: relation.label, value: "", active: false, onClick: () => {
|
|
54
62
|
setOpened(relation);
|
|
55
63
|
setQuery("");
|
|
56
64
|
} }, relation.key)))] }))] }));
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type ReactNode } from "react";
|
|
2
|
-
import type { ViewsSheetActions } from "../../../provider/components.js";
|
|
2
|
+
import type { ViewsFilterBodyProps, ViewsSheetActions } from "../../../provider/components.js";
|
|
3
3
|
import type { FilterTreeConfig } from "../../model.js";
|
|
4
4
|
/** The filter editor's ✕ and ✓ for a phone's sheet, and its body (told whether it draws its own ✕ and ✓). */
|
|
5
5
|
export declare function usePhoneFilterEditor(o: {
|
|
@@ -11,12 +11,18 @@ export declare function usePhoneFilterEditor(o: {
|
|
|
11
11
|
}): {
|
|
12
12
|
body: (closeButton?: boolean) => ReactNode;
|
|
13
13
|
head: ViewsSheetActions;
|
|
14
|
+
/** An app's body's step (VK-720), for the sheet's title while it stands. */
|
|
15
|
+
title: string | undefined;
|
|
16
|
+
/** The sheet's Escape: goes back a step where one stands. Whether it is spent. */
|
|
17
|
+
escapeBack: () => boolean;
|
|
14
18
|
};
|
|
15
19
|
/** The phone's body: the rules, or one box's list in their place. */
|
|
16
|
-
export declare function PhoneFilterEditor({ filterTree, head, onDone, }: {
|
|
20
|
+
export declare function PhoneFilterEditor({ filterTree, head, onDone, onStepChange, }: {
|
|
17
21
|
filterTree: FilterTreeConfig;
|
|
18
22
|
/** The ✕ and ✓ the body draws in its own head, where the sheet's head draws none; null where it does. */
|
|
19
23
|
head: ViewsSheetActions | null;
|
|
20
24
|
/** The job is done and what holds it closes: an app's own `FilterBody` calls it. */
|
|
21
25
|
onDone?: () => void;
|
|
26
|
+
/** An app's own `FilterBody`'s step, told to the sheet (VK-720). */
|
|
27
|
+
onStepChange?: ViewsFilterBodyProps["onStepChange"];
|
|
22
28
|
}): ReactNode;
|
|
@@ -4,10 +4,11 @@ import { useLayoutEffect, useRef, useState } from "react";
|
|
|
4
4
|
import { DisabledReason } from "../../../atoms/DisabledReason.js";
|
|
5
5
|
import { useViews } from "../../../provider/context.js";
|
|
6
6
|
import { itemsAt, shownRuleCount } from "../../../filters/filter-tree.js";
|
|
7
|
-
import { filterWaysOf, takesValue } from "../../settings/filter-groups.js";
|
|
7
|
+
import { filterWaysOf, listedFieldsOf, takesValue } from "../../settings/filter-groups.js";
|
|
8
8
|
import { PanelHeader } from "../panel-header.js";
|
|
9
9
|
import { fieldOfRule, relationOf, useEditorCtx, } from "./editor-ctx.js";
|
|
10
10
|
import { AppFilterBody } from "./filter-body.js";
|
|
11
|
+
import { usePanelStep } from "../panel-step.js";
|
|
11
12
|
import { Excluded, Level } from "./FilterEditor.js";
|
|
12
13
|
import { FilterFieldList } from "./FilterFieldList.js";
|
|
13
14
|
import { AppFilterPart, useFilterPartBody } from "./filter-part-body.js";
|
|
@@ -16,6 +17,7 @@ import { addPicked, addState, everyBlocked, pickField, pickQuantifier, pickWay,
|
|
|
16
17
|
export function usePhoneFilterEditor(o) {
|
|
17
18
|
const { filterTree, open, onDone } = o;
|
|
18
19
|
const { messages } = useViews();
|
|
20
|
+
const step = usePanelStep();
|
|
19
21
|
const latest = useRef(filterTree.tree);
|
|
20
22
|
useLayoutEffect(() => {
|
|
21
23
|
latest.current = filterTree.tree;
|
|
@@ -48,11 +50,12 @@ export function usePhoneFilterEditor(o) {
|
|
|
48
50
|
},
|
|
49
51
|
},
|
|
50
52
|
done: { label: messages({ key: "views.panels.filter-done" }), onPress: () => onDone?.() },
|
|
53
|
+
...(step.back && { back: { label: messages({ key: "views.panels.back" }), onPress: step.back } }),
|
|
51
54
|
};
|
|
52
|
-
const body = (closeButton = true) => (_jsx(PhoneFilterEditor, { filterTree: tracked, head: closeButton ? head : null, onDone: onDone }));
|
|
53
|
-
return { body, head };
|
|
55
|
+
const body = (closeButton = true) => (_jsx(PhoneFilterEditor, { filterTree: tracked, head: closeButton ? head : null, onDone: onDone, onStepChange: step.onStepChange }));
|
|
56
|
+
return { body, head, title: step.title, escapeBack: step.escapeBack };
|
|
54
57
|
}
|
|
55
|
-
export function PhoneFilterEditor({ filterTree, head, onDone, }) {
|
|
58
|
+
export function PhoneFilterEditor({ filterTree, head, onDone, onStepChange, }) {
|
|
56
59
|
const { components, icons, messages } = useViews();
|
|
57
60
|
const { Button } = components;
|
|
58
61
|
const [page, setPage] = useState({ to: "rules" });
|
|
@@ -64,7 +67,7 @@ export function PhoneFilterEditor({ filterTree, head, onDone, }) {
|
|
|
64
67
|
openPage: setPage,
|
|
65
68
|
});
|
|
66
69
|
if (components.FilterBody)
|
|
67
|
-
return group ? (_jsx(AppFilterBody, { ctx: ctx, level: group, relation: null, excludable: false, label: filterTree.label ?? messages({ key: "views.panels.filter" }), onDone: onDone, actions: head ?? undefined })) : null;
|
|
70
|
+
return group ? (_jsx(AppFilterBody, { ctx: ctx, level: group, relation: null, excludable: false, label: filterTree.label ?? messages({ key: "views.panels.filter" }), onDone: onDone, actions: head ?? undefined, onStepChange: onStepChange })) : null;
|
|
68
71
|
const back = () => setPage({ to: "rules" });
|
|
69
72
|
if (!pageResolves(ctx, page))
|
|
70
73
|
setPage({ to: "rules" });
|
|
@@ -90,7 +93,7 @@ function Turned({ ctx, page, setPage, back, }) {
|
|
|
90
93
|
if (page.to === "add") {
|
|
91
94
|
const relation = relationOf(ctx, page.relation);
|
|
92
95
|
const { relations } = addState(ctx, page.rel, relation);
|
|
93
|
-
return (_jsxs(_Fragment, { children: [_jsx(PanelHeader, { title: messages({ key: "views.panels.filter-add" }), onBack: back }), _jsx("div", { className: scroll, children: _jsx(FilterFieldList, { fields: relation?.far ?? ctx.filterTree
|
|
96
|
+
return (_jsxs(_Fragment, { children: [_jsx(PanelHeader, { title: messages({ key: "views.panels.filter-add" }), onBack: back }), _jsx("div", { className: scroll, children: _jsx(FilterFieldList, { fields: relation?.far ?? listedFieldsOf(ctx.filterTree), relations: relations, form: "phone", onPick: (picked, far) => {
|
|
94
97
|
const added = addPicked(ctx, page.rel, picked, far, relation);
|
|
95
98
|
setPage(added ? { to: "value", rule: added } : { to: "rules" });
|
|
96
99
|
}, onDone: back }) })] }));
|
|
@@ -127,7 +130,7 @@ function Turned({ ctx, page, setPage, back, }) {
|
|
|
127
130
|
return null;
|
|
128
131
|
const { rule, at } = found;
|
|
129
132
|
if (page.to === "field")
|
|
130
|
-
return (_jsxs(_Fragment, { children: [_jsx(PanelHeader, { title: messages({ key: "views.panels.filter-field" }), onBack: back }), _jsx("div", { className: scroll, children: _jsx(FilterFieldList, { fields: at.relation?.far ?? ctx.filterTree
|
|
133
|
+
return (_jsxs(_Fragment, { children: [_jsx(PanelHeader, { title: messages({ key: "views.panels.filter-field" }), onBack: back }), _jsx("div", { className: scroll, children: _jsx(FilterFieldList, { fields: at.relation?.far ?? listedFieldsOf(ctx.filterTree), own: field?.key, relations: false, form: "phone", onPick: (picked) => {
|
|
131
134
|
pickField(ctx, at, rule, field, picked);
|
|
132
135
|
back();
|
|
133
136
|
}, onDone: back }) })] }));
|
|
@@ -140,7 +143,7 @@ function Turned({ ctx, page, setPage, back, }) {
|
|
|
140
143
|
};
|
|
141
144
|
if (page.to === "way") {
|
|
142
145
|
const ways = filterWaysOf(field, conventions);
|
|
143
|
-
return (_jsxs(_Fragment, { children: [_jsx(PanelHeader, { title: messages({ key: "views.panels.filter-way" }), onBack: back }), _jsxs("div", { className: scroll, children: [partBody ? (_jsx(AppFilterPart, { part: "way", rule: rule, field: field, own: null, form: "phone", onWay: (operator) => {
|
|
146
|
+
return (_jsxs(_Fragment, { children: [_jsx(PanelHeader, { title: messages({ key: "views.panels.filter-way" }), onBack: back }), _jsxs("div", { className: scroll, children: [partBody ? (_jsx(AppFilterPart, { part: "way", rule: rule, field: field, options: ctx.filterTree.optionsOf?.(rule.fieldKey, rule.part, at.relation?.fieldKey), own: null, form: "phone", onWay: (operator) => {
|
|
144
147
|
pickWay(ctx, at, rule, field, operator);
|
|
145
148
|
back();
|
|
146
149
|
}, onValue: write, onDone: back })) : null, partBody ? null : ways.map((way) => (_jsxs("div", { children: [way.value === "is_empty" && (_jsx("div", { role: "separator", className: "my-1 border-t border-solid border-(color:--vk-border)" })), _jsx(RadioRow, { mark: "box", selected: way.value === rule.operator, label: way.label, onClick: () => {
|
|
@@ -153,7 +156,7 @@ function Turned({ ctx, page, setPage, back, }) {
|
|
|
153
156
|
: null;
|
|
154
157
|
if (!config)
|
|
155
158
|
return null;
|
|
156
|
-
return (_jsxs(_Fragment, { children: [_jsx(PanelHeader, { title: field.label, onBack: back }), _jsx("div", { className: scroll, children: partBody ? (_jsx(AppFilterPart, { part: "value", rule: rule, field: field, own: _jsx(FilterValueBody, { filter: config }), form: "phone", onWay: (operator) => {
|
|
159
|
+
return (_jsxs(_Fragment, { children: [_jsx(PanelHeader, { title: field.label, onBack: back }), _jsx("div", { className: scroll, children: partBody ? (_jsx(AppFilterPart, { part: "value", rule: rule, field: field, options: ctx.filterTree.optionsOf?.(rule.fieldKey, rule.part, at.relation?.fieldKey), own: _jsx(FilterValueBody, { filter: config }), form: "phone", onWay: (operator) => {
|
|
157
160
|
pickWay(ctx, at, rule, field, operator);
|
|
158
161
|
if (!at.rel)
|
|
159
162
|
back();
|
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
import { type ReactNode } from "react";
|
|
2
2
|
import { type FilterGroup, type FilterRelationRule } from "viewkitjs/fields/query";
|
|
3
|
-
import type { ViewsFilterBodyField, ViewsSheetActions } from "../../../provider/components.js";
|
|
4
|
-
import type { FilterEditorField } from "../../model.js";
|
|
3
|
+
import type { ViewsFilterBodyField, ViewsFilterBodyProps, ViewsSheetActions } from "../../../provider/components.js";
|
|
4
|
+
import type { FilterEditorField, FilterTreeConfig } from "../../model.js";
|
|
5
5
|
import { type Ctx } from "./editor-ctx.js";
|
|
6
6
|
/** The fields as an app's body is handed them: each without its `mark` (the field lists' own, `FieldsBody`), its far
|
|
7
|
-
* fields the same, so `ViewsFilterBodyField` stays what it says
|
|
8
|
-
|
|
7
|
+
* fields the same, so `ViewsFilterBodyField` stays what it says; each choice field with its values where ViewKit holds them
|
|
8
|
+
* (`optionsOf`, VK-720), a far field's by its relation. */
|
|
9
|
+
export declare function filterBodyFields(fields: readonly FilterEditorField[], optionsOf?: FilterTreeConfig["optionsOf"], relation?: string): ViewsFilterBodyField[];
|
|
9
10
|
/** The app's `FilterBody` over the editor's state: `level` the container it stands on, `relation` the relation rule
|
|
10
11
|
* edited in place whose where it is. */
|
|
11
|
-
export declare function AppFilterBody({ ctx, level, relation, excludable, label, onDone, actions, }: {
|
|
12
|
+
export declare function AppFilterBody({ ctx, level, relation, excludable, label, onDone, actions, onStepChange, }: {
|
|
12
13
|
ctx: Ctx;
|
|
13
14
|
level: FilterGroup;
|
|
14
15
|
relation: FilterRelationRule | null;
|
|
@@ -16,4 +17,6 @@ export declare function AppFilterBody({ ctx, level, relation, excludable, label,
|
|
|
16
17
|
label: string;
|
|
17
18
|
onDone?: () => void;
|
|
18
19
|
actions?: ViewsSheetActions;
|
|
20
|
+
/** On a phone, the body's own step told to the sheet (`usePanelStep`). */
|
|
21
|
+
onStepChange?: ViewsFilterBodyProps["onStepChange"];
|
|
19
22
|
}): ReactNode;
|
|
@@ -4,7 +4,8 @@ import { useMemo } from "react";
|
|
|
4
4
|
import { FILTER_TREE_MAX_UI_DEPTH, isRelationRule, } from "viewkitjs/fields/query";
|
|
5
5
|
import { nodeAt, replaceAt, shownRuleCount } from "../../../filters/filter-tree.js";
|
|
6
6
|
import { useViews } from "../../../provider/context.js";
|
|
7
|
-
import { filterBodyChangeFits, takesValue } from "../../settings/filter-groups.js";
|
|
7
|
+
import { filterBodyChangeFits, listedFieldsOf, takesValue } from "../../settings/filter-groups.js";
|
|
8
|
+
import { asideFilterWords, barFilterWords } from "../../toolbar/filter-words.js";
|
|
8
9
|
import { relationOf } from "./editor-ctx.js";
|
|
9
10
|
import { FilterValueBody } from "./FilterValueBody.js";
|
|
10
11
|
const QUANTIFIERS = ["any", "none", "every"];
|
|
@@ -22,13 +23,21 @@ function putLevel(tree, at, next, quantifier) {
|
|
|
22
23
|
});
|
|
23
24
|
return replaceAt(tree, at, { op: next.op, items });
|
|
24
25
|
}
|
|
25
|
-
export function filterBodyFields(fields) {
|
|
26
|
-
return fields.map(({ mark: _mark, far, ...field }) =>
|
|
26
|
+
export function filterBodyFields(fields, optionsOf, relation) {
|
|
27
|
+
return fields.map(({ mark: _mark, far, ...field }) => {
|
|
28
|
+
if (far)
|
|
29
|
+
return { ...field, far: filterBodyFields(far, optionsOf, field.fieldKey) };
|
|
30
|
+
if (field.disabled !== undefined)
|
|
31
|
+
return field;
|
|
32
|
+
const options = optionsOf?.(field.fieldKey, field.part, relation);
|
|
33
|
+
return options ? { ...field, options } : field;
|
|
34
|
+
});
|
|
27
35
|
}
|
|
28
|
-
export function AppFilterBody({ ctx, level, relation, excludable, label, onDone, actions, }) {
|
|
29
|
-
const { components, messages } = useViews();
|
|
36
|
+
export function AppFilterBody({ ctx, level, relation, excludable, label, onDone, actions, onStepChange, }) {
|
|
37
|
+
const { components, conventions, messages } = useViews();
|
|
30
38
|
const FilterBody = components.FilterBody;
|
|
31
|
-
const fields
|
|
39
|
+
const { listed, fields: named, optionsOf } = ctx.filterTree;
|
|
40
|
+
const fields = useMemo(() => filterBodyFields(listedFieldsOf({ listed, fields: named }), optionsOf), [listed, named, optionsOf]);
|
|
32
41
|
if (!FilterBody)
|
|
33
42
|
return null;
|
|
34
43
|
const far = relation ? relationOf(ctx, relation.fieldKey) : undefined;
|
|
@@ -59,6 +68,11 @@ export function AppFilterBody({ ctx, level, relation, excludable, label, onDone,
|
|
|
59
68
|
const config = ctx.filterTree.valueOf(rule, onRuleChange, at);
|
|
60
69
|
return config ? _jsx(FilterValueBody, { filter: config }) : null;
|
|
61
70
|
};
|
|
71
|
+
const ruleWords = (rule, at) => {
|
|
72
|
+
const node = at !== undefined ? { fieldKey: at, quantifier: "any", where: { op: "and", items: [rule] } } : rule;
|
|
73
|
+
const words = rule.setAside ? asideFilterWords(rule, ctx.filterTree, conventions, messages, at) : barFilterWords({ kind: "held", node }, ctx.filterTree, conventions, messages);
|
|
74
|
+
return { field: words.field, way: words.way, value: words.value };
|
|
75
|
+
};
|
|
62
76
|
return (_jsx(FilterBody, { label: label, fields: fields, filter: level, levels: levels, excludable: excludable, relation: relation
|
|
63
77
|
? {
|
|
64
78
|
fieldKey: relation.fieldKey,
|
|
@@ -68,5 +82,5 @@ export function AppFilterBody({ ctx, level, relation, excludable, label, onDone,
|
|
|
68
82
|
quantifier: relation.quantifier,
|
|
69
83
|
...(gone ? { gone: messages({ key: "views.panels.filter-relation-gone" }) } : {}),
|
|
70
84
|
}
|
|
71
|
-
: undefined, form: ctx.form, onFilterChange: onFilterChange, ruleValue: ruleValue, onDone: () => onDone?.(), actions: actions }));
|
|
85
|
+
: undefined, form: ctx.form, onFilterChange: onFilterChange, ruleValue: ruleValue, onDone: () => onDone?.(), actions: actions, ruleWords: ruleWords, ...(onStepChange ? { onStepChange } : {}) }));
|
|
72
86
|
}
|
|
@@ -1,14 +1,17 @@
|
|
|
1
1
|
import type { FilterOperator, FilterRule } from "viewkitjs/fields/query";
|
|
2
2
|
import type { ReactNode } from "react";
|
|
3
|
+
import type { ViewsPickerItem } from "../../../provider/components.js";
|
|
3
4
|
import type { FilterEditorField } from "../../model.js";
|
|
4
5
|
/** Whether the app handed a `FilterPartBody`: a holder then opens a popover for the way in place of its menu. */
|
|
5
6
|
export declare function useFilterPartBody(): boolean;
|
|
6
7
|
/** The app's `FilterPartBody` for a rule's way or value, over the holder's own writes; null when the app handed none,
|
|
7
8
|
* so the holder draws ViewKit's own. */
|
|
8
|
-
export declare function AppFilterPart({ part, rule, field, own, form, onWay, onValue, onDone, }: {
|
|
9
|
+
export declare function AppFilterPart({ part, rule, field, own, options, form, onWay, onValue, onDone, }: {
|
|
9
10
|
part: "way" | "value";
|
|
10
11
|
rule: FilterRule;
|
|
11
12
|
field: FilterEditorField;
|
|
13
|
+
/** The field's values as the Picker draws them, where ViewKit holds them (`FilterTreeConfig.optionsOf`). */
|
|
14
|
+
options?: readonly ViewsPickerItem[];
|
|
12
15
|
/** ViewKit's own value body for the rule (`<FilterValueBody filter={config} />`), null at `way`. */
|
|
13
16
|
own: ReactNode;
|
|
14
17
|
form: "computer" | "phone";
|
|
@@ -6,13 +6,15 @@ import { filterBodyFields } from "./filter-body.js";
|
|
|
6
6
|
export function useFilterPartBody() {
|
|
7
7
|
return !!useViews().components.FilterPartBody;
|
|
8
8
|
}
|
|
9
|
-
export function AppFilterPart({ part, rule, field, own, form, onWay, onValue, onDone, }) {
|
|
9
|
+
export function AppFilterPart({ part, rule, field, own, options, form, onWay, onValue, onDone, }) {
|
|
10
10
|
const { components, conventions, messages } = useViews();
|
|
11
11
|
const FilterPartBody = components.FilterPartBody;
|
|
12
12
|
if (!FilterPartBody)
|
|
13
13
|
return null;
|
|
14
14
|
const [shown] = filterBodyFields([field]);
|
|
15
15
|
const { far: _far, ...bodyField } = shown;
|
|
16
|
+
if (options)
|
|
17
|
+
bodyField.options = options;
|
|
16
18
|
return (_jsx(FilterPartBody, { part: part, label: messages({ key: part === "way" ? "views.panels.filter-way" : "views.panels.filter-value" }), rule: rule, field: bodyField, ways: filterWaysOf(field, conventions), own: own, form: form, onRuleChange: (next) => {
|
|
17
19
|
const fits = filterPartChangeFits(field, rule, next);
|
|
18
20
|
if (fits === "way")
|
|
@@ -5,7 +5,7 @@ import type { ViewsSheetActions } from "../../provider/components.js";
|
|
|
5
5
|
export declare function useSheetPanels(): boolean;
|
|
6
6
|
/** Whether the sheet's head draws the panel's ✕ (`sheetActions: "head"`), so the panel draws none of its own. */
|
|
7
7
|
export declare function useSheetDrawsClose(): boolean;
|
|
8
|
-
export declare function PanelSheet({ open, onOpenChange, title, snap, slot, headed, actions, children, }: {
|
|
8
|
+
export declare function PanelSheet({ open, onOpenChange, title, snap, slot, headed, actions, sheetTitle, onSheetEscape, children, }: {
|
|
9
9
|
open: boolean;
|
|
10
10
|
onOpenChange: (open: boolean) => void;
|
|
11
11
|
/** The panel's name in words: the sheet's accessible name, and its title unless the panel heads itself. */
|
|
@@ -19,5 +19,9 @@ export declare function PanelSheet({ open, onOpenChange, title, snap, slot, head
|
|
|
19
19
|
/** The panel's own ✕ and ✓ (the sort editor's, VK-188): with `sheetActions: "head"` handed to the Sheet in place
|
|
20
20
|
* of its ✕ alone; with `bar` the panel draws them, and the Sheet is handed none. */
|
|
21
21
|
actions?: ViewsSheetActions;
|
|
22
|
+
/** The sheet's title and name while the panel stands on a step of its own, in place of `title` (VK-721). */
|
|
23
|
+
sheetTitle?: string;
|
|
24
|
+
/** The sheet's Escape, asked first: true when the panel answered it (a step gone back), and the sheet stays open. */
|
|
25
|
+
onSheetEscape?: () => boolean;
|
|
22
26
|
children: ReactNode;
|
|
23
27
|
}): ReactNode;
|
|
@@ -13,12 +13,16 @@ export function useSheetPanels() {
|
|
|
13
13
|
export function useSheetDrawsClose() {
|
|
14
14
|
return useViews().sheetActions === "head";
|
|
15
15
|
}
|
|
16
|
-
export function PanelSheet({ open, onOpenChange, title, snap, slot, headed = false, actions, children, }) {
|
|
16
|
+
export function PanelSheet({ open, onOpenChange, title, snap, slot, headed = false, actions, sheetTitle, onSheetEscape, children, }) {
|
|
17
17
|
const { components, messages } = useViews();
|
|
18
18
|
const { Sheet } = components;
|
|
19
19
|
const head = useSheetDrawsClose();
|
|
20
20
|
const keep = (event) => event.stopPropagation();
|
|
21
|
-
return (_jsx("span", { className: "contents", onClick: keep, onDoubleClick: keep, onContextMenu: keep, children: _jsx(Sheet, { open: open, onOpenChange: (next
|
|
21
|
+
return (_jsx("span", { className: "contents", onClick: keep, onDoubleClick: keep, onContextMenu: keep, children: _jsx(Sheet, { open: open, onOpenChange: (next, details) => {
|
|
22
|
+
if (!next && details?.reason === "escape-key" && onSheetEscape?.())
|
|
23
|
+
return;
|
|
24
|
+
onOpenChange(next);
|
|
25
|
+
}, ...(!headed && { title: sheetTitle ?? title }), label: sheetTitle ?? title, snap: snap, ...(head && {
|
|
22
26
|
actions: actions ?? { close: { label: messages({ key: "views.panels.close" }), onPress: () => onOpenChange(false) } },
|
|
23
27
|
}), children: _jsx("div", { "data-slot": slot, className: "flex h-full min-h-0 flex-col", children: children }) }) }));
|
|
24
28
|
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { ViewsBodyStep } from "../../provider/components.js";
|
|
2
|
+
export type PanelStep = {
|
|
3
|
+
/** Handed to the body: the step it stands on, or `null` once it is back. */
|
|
4
|
+
onStepChange: (step: ViewsBodyStep | null) => void;
|
|
5
|
+
/** The step's title while one stands. */
|
|
6
|
+
title: string | undefined;
|
|
7
|
+
/** Back, while a step stands: the body's own. */
|
|
8
|
+
back: (() => void) | undefined;
|
|
9
|
+
/** The sheet's Escape: goes back when a step stands (or reports one this key already answered). Whether it is spent. */
|
|
10
|
+
escapeBack: () => boolean;
|
|
11
|
+
};
|
|
12
|
+
export declare function usePanelStep(): PanelStep;
|
|
13
|
+
/** The step a toolbar panel's sheet holds (`ToolbarOptions`), handed to what stands in it so a body's level of its own is told
|
|
14
|
+
* there and the sheet's Escape goes back a level; null where nothing holds one, and the panel holds its own. */
|
|
15
|
+
export declare const PanelStepHold: import("react").Context<PanelStep | null>;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { createContext, useCallback, useMemo, useRef, useState } from "react";
|
|
3
|
+
export function usePanelStep() {
|
|
4
|
+
const [step, setStep] = useState(null);
|
|
5
|
+
const held = useRef(null);
|
|
6
|
+
const answered = useRef(false);
|
|
7
|
+
const onStepChange = useCallback((next) => {
|
|
8
|
+
held.current = next;
|
|
9
|
+
setStep((now) => (next === null ? null : now?.title === next.title ? now : { title: next.title }));
|
|
10
|
+
}, []);
|
|
11
|
+
const goBack = useCallback(() => held.current?.onBack(), []);
|
|
12
|
+
const escapeBack = useCallback(() => {
|
|
13
|
+
if (answered.current)
|
|
14
|
+
return true;
|
|
15
|
+
const now = held.current;
|
|
16
|
+
if (!now)
|
|
17
|
+
return false;
|
|
18
|
+
answered.current = true;
|
|
19
|
+
window.setTimeout(() => {
|
|
20
|
+
answered.current = false;
|
|
21
|
+
}, 0);
|
|
22
|
+
now.onBack();
|
|
23
|
+
return true;
|
|
24
|
+
}, []);
|
|
25
|
+
return useMemo(() => ({ onStepChange, title: step?.title, back: step ? goBack : undefined, escapeBack }), [onStepChange, step, goBack, escapeBack]);
|
|
26
|
+
}
|
|
27
|
+
export const PanelStepHold = createContext(null);
|
|
@@ -24,6 +24,7 @@ export function QuickFiltersPanel({ quickFilters, form, onDone, closeButton = tr
|
|
|
24
24
|
key: field.key,
|
|
25
25
|
label: field.label,
|
|
26
26
|
searchPlaceholder: searchWords(field, messages),
|
|
27
|
+
...(field.options ? { options: field.options } : {}),
|
|
27
28
|
values: quickValuesShown(field, quickFilters.hold, showCounts, emptyLabel, quickFilters.heldLabels?.[field.key]?.values),
|
|
28
29
|
})), hold: quickFilters.hold, several: several, showCounts: showCounts, form: form, onHoldChange: (next) => {
|
|
29
30
|
if (quickHoldFits(quickFilters, next))
|
|
@@ -17,6 +17,10 @@ export type SortEditorOptions = {
|
|
|
17
17
|
export declare function useSortEditor(o: SortEditorOptions): {
|
|
18
18
|
body: (closeButton?: boolean) => ReactNode;
|
|
19
19
|
head: ViewsSheetActions;
|
|
20
|
+
/** An app's body's step on a phone, for the sheet's title while it stands. */
|
|
21
|
+
title: string | undefined;
|
|
22
|
+
/** The sheet's Escape: goes back a step where one stands. Whether it is spent. */
|
|
23
|
+
escapeBack: () => boolean;
|
|
20
24
|
};
|
|
21
25
|
/** The body alone, for a holder that holds only a body (a popover). */
|
|
22
26
|
export declare function SortEditor({ sorts, form, open, onDone, addSort, }: Omit<SortEditorOptions, "open"> & {
|
|
@@ -9,6 +9,7 @@ import { ASIDE_CLASS, DRAGGING_CLASS, PANEL_ROW_CLASS, SHEET_ROW_CLASS, SHEET_RO
|
|
|
9
9
|
import { sortBodyOptions } from "../../sort-body-options.js";
|
|
10
10
|
import { SortableFrame, useDragKit, useSortableItem } from "../drag-kit.js";
|
|
11
11
|
import { PanelHeader } from "../panel-header.js";
|
|
12
|
+
import { usePanelStep } from "../panel-step.js";
|
|
12
13
|
import { SortFieldList } from "./SortFieldList.js";
|
|
13
14
|
import { useSortDrag } from "./use-sort-drag.js";
|
|
14
15
|
const same = (a, b) => a.length === b.length &&
|
|
@@ -25,6 +26,7 @@ export function useSortEditor(o) {
|
|
|
25
26
|
const { sorts, form, open, onDone, addSort = false } = o;
|
|
26
27
|
const { messages, components, icons } = useViews();
|
|
27
28
|
const SortBody = components.SortBody;
|
|
29
|
+
const step = usePanelStep();
|
|
28
30
|
const latest = useRef(sorts.rules);
|
|
29
31
|
const latestAside = useRef(sorts.setAside ?? []);
|
|
30
32
|
useLayoutEffect(() => {
|
|
@@ -55,12 +57,13 @@ export function useSortEditor(o) {
|
|
|
55
57
|
},
|
|
56
58
|
},
|
|
57
59
|
done: { label: messages({ key: "views.panels.sort-done" }), onPress: () => onDone?.() },
|
|
60
|
+
...(step.back && { back: { label: messages({ key: "views.panels.back" }), onPress: step.back } }),
|
|
58
61
|
};
|
|
59
62
|
const body = (closeButton = true) => SortBody ? (_jsx(SortBody, { label: sorts.label ?? messages({ key: "views.panels.sort" }), options: sortBodyOptions(sorts.options, { icons, AppIcon: components.AppIcon }), rules: sorts.rules, setAside: sorts.setAside ?? [], max: sorts.max, form: form, addSort: addSort, onRulesChange: (rules, setAside) => {
|
|
60
63
|
if (sortBodyChangeFits(sorts, rules, setAside))
|
|
61
64
|
change(rules, setAside);
|
|
62
|
-
}, onDone: () => onDone?.(), actions: form === "phone" && closeButton ? head : undefined })) : form === "phone" ? (_jsx(PhoneEditor, { sorts: sorts, latest: latest, latestAside: latestAside, change: change, head: closeButton ? head : null })) : (_jsx(ComputerEditor, { sorts: sorts, latest: latest, latestAside: latestAside, change: change, addSort: addSort }));
|
|
63
|
-
return { body, head };
|
|
65
|
+
}, onDone: () => onDone?.(), actions: form === "phone" && closeButton ? head : undefined, ...(form === "phone" && { onStepChange: step.onStepChange }) })) : form === "phone" ? (_jsx(PhoneEditor, { sorts: sorts, latest: latest, latestAside: latestAside, change: change, head: closeButton ? head : null })) : (_jsx(ComputerEditor, { sorts: sorts, latest: latest, latestAside: latestAside, change: change, addSort: addSort }));
|
|
66
|
+
return { body, head, title: step.title, escapeBack: step.escapeBack };
|
|
64
67
|
}
|
|
65
68
|
export function SortEditor({ sorts, form, open = true, onDone, addSort, }) {
|
|
66
69
|
return useSortEditor({ sorts, form, open, onDone, addSort }).body();
|
|
@@ -57,6 +57,24 @@ export type ReadyToolbarProps<Row> = SettingsPanelsInput<Row> & {
|
|
|
57
57
|
* one line with New at the list's foot. `row`: the order of 12 Nov, every part but the views on the row's right,
|
|
58
58
|
* with the narrow form under 700px. */
|
|
59
59
|
arrangement?: "kit" | "row";
|
|
60
|
+
/** Where the sort and Filter stand in the kit arrangement on a computer, as the kit's Toolbar option "Sort and
|
|
61
|
+
* filters": on the row's right, Sort and Filter adding from the fields and the bar holding what is set (Mihai's look,
|
|
62
|
+
* the default), or on the bar, the bar's own empty Sort and Filter adding. */
|
|
63
|
+
sortFilter?: "right" | "bar";
|
|
64
|
+
/** When the kit arrangement's filter bar shows on a computer: while a filter stands or is held until whole, or a second
|
|
65
|
+
* axis of views stands there (the default: the bar is the filters' line, and a sort, a change to save or a panel open
|
|
66
|
+
* never bring it), or always.
|
|
67
|
+
* Means nothing while `sortFilter` is "bar", which always shows it. */
|
|
68
|
+
bar?: "added" | "always";
|
|
69
|
+
/** The view's name, drawn in Customize's head (where its head is the view's name) and renamed in place where
|
|
70
|
+
* `onRenameView` is handed too. */
|
|
71
|
+
viewName?: string;
|
|
72
|
+
onRenameView?: (name: string) => void;
|
|
73
|
+
/** Copy link to view, in Customize's foot, where handed. */
|
|
74
|
+
onCopyLink?: () => void;
|
|
75
|
+
/** Export CSV, in Customize's foot, where handed, with what it takes in words (`exportCount`, "12 deals"). */
|
|
76
|
+
onExport?: () => void;
|
|
77
|
+
exportCount?: string;
|
|
60
78
|
className?: string;
|
|
61
79
|
};
|
|
62
80
|
export declare function ReadyToolbar<Row>(props: ReadyToolbarProps<Row>): ReactNode;
|