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
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
import { Dialog } from "@base-ui/react/dialog";
|
|
4
|
+
import { cx } from "../../internal/cx.js";
|
|
5
|
+
import { closeReasonOf } from "../internal/close-reason.js";
|
|
6
|
+
import { Scrollbar } from "../scrollbar/scrollbar.js";
|
|
7
|
+
import { paneAfter } from "./state.js";
|
|
8
|
+
export { paneAfter } from "./state.js";
|
|
9
|
+
const REASONS = ["escape-key", "close-press"];
|
|
10
|
+
const reasonOf = (reason) => { const r = closeReasonOf(reason); return REASONS.find((x) => x === r) ?? "none"; };
|
|
11
|
+
const POPUP = "[role='menu'], [role='listbox'], [role='dialog'], [role='alertdialog'], [role='combobox'][aria-expanded='true']";
|
|
12
|
+
const opened = new Set();
|
|
13
|
+
let count = 0;
|
|
14
|
+
const inSight = (el) => !el.closest("[inert]") && (el.checkVisibility?.({ visibilityProperty: true }) ?? el.getClientRects().length > 0);
|
|
15
|
+
const depth = (el) => { let d = 0; for (let n = el; n; n = n.parentNode)
|
|
16
|
+
d++; return d; };
|
|
17
|
+
const nearness = (at, container) => { let n = container; while (n && !n.contains(at))
|
|
18
|
+
n = n.parentNode; return depth(n); };
|
|
19
|
+
function chosen(at, may) {
|
|
20
|
+
const all = [...opened].filter((o) => o.popup.current && may(o));
|
|
21
|
+
const seen = all.filter((o) => inSight(o.popup.current));
|
|
22
|
+
return (seen.length ? seen : all).reduce((best, o) => {
|
|
23
|
+
if (!best)
|
|
24
|
+
return o;
|
|
25
|
+
const a = nearness(at, o.container), b = nearness(at, best.container);
|
|
26
|
+
return a > b || (a === b && o.order > best.order) ? o : best;
|
|
27
|
+
}, undefined);
|
|
28
|
+
}
|
|
29
|
+
export function Pane({ open, onOpenChange, container, opener, initialFocus = true, "aria-label": label, className, children }) {
|
|
30
|
+
const popup = React.useRef(null);
|
|
31
|
+
const self = React.useRef(null);
|
|
32
|
+
React.useEffect(() => {
|
|
33
|
+
if (!open || !container)
|
|
34
|
+
return;
|
|
35
|
+
const entry = { popup, container, order: ++count };
|
|
36
|
+
self.current = entry;
|
|
37
|
+
opened.add(entry);
|
|
38
|
+
return () => { opened.delete(entry); self.current = null; };
|
|
39
|
+
}, [open, container]);
|
|
40
|
+
const change = (next, details) => {
|
|
41
|
+
if (next)
|
|
42
|
+
return;
|
|
43
|
+
if (details.reason === "escape-key") {
|
|
44
|
+
const at = details.event?.target instanceof Node ? details.event.target : document.activeElement ?? document.body;
|
|
45
|
+
const other = at instanceof Element ? at.closest(POPUP) : at.parentElement?.closest(POPUP) ?? null;
|
|
46
|
+
const mayClose = (box, list) => !other || other === box || !!box?.contains(other) || !!list && other.contains(list);
|
|
47
|
+
if (!mayClose(popup.current, container))
|
|
48
|
+
return details.cancel();
|
|
49
|
+
if (!popup.current?.contains(at) && chosen(at, (o) => mayClose(o.popup.current, o.container)) !== (self.current ?? undefined))
|
|
50
|
+
return details.cancel();
|
|
51
|
+
if (details.event?.defaultPrevented)
|
|
52
|
+
return details.cancel();
|
|
53
|
+
}
|
|
54
|
+
onOpenChange(false, { reason: reasonOf(details.reason), event: details.event });
|
|
55
|
+
};
|
|
56
|
+
const backTo = () => {
|
|
57
|
+
const now = document.activeElement;
|
|
58
|
+
if (now && now !== document.body && !popup.current?.contains(now))
|
|
59
|
+
return false;
|
|
60
|
+
return opener?.isConnected ? opener : true;
|
|
61
|
+
};
|
|
62
|
+
if (!container)
|
|
63
|
+
return null;
|
|
64
|
+
return (_jsx(Dialog.Root, { open: open, onOpenChange: change, modal: false, disablePointerDismissal: true, children: _jsx(Dialog.Portal, { container: container, className: "o-pane-portal", children: _jsx(Dialog.Popup, { ref: popup, className: cx("o-pane", className), "data-kit": "pane", "aria-label": label, initialFocus: initialFocus ? popup : false, finalFocus: backTo, children: _jsx("div", { className: "o-pane-cut o-smooth", children: _jsx(InPane.Provider, { value: true, children: children }) }) }) }) }));
|
|
65
|
+
}
|
|
66
|
+
export const InPane = React.createContext(false);
|
|
67
|
+
export function PaneHead({ children, className }) {
|
|
68
|
+
return _jsx("div", { className: cx("o-pane-head", className), children: children });
|
|
69
|
+
}
|
|
70
|
+
export function PaneBody({ children, className }) {
|
|
71
|
+
return _jsxs(_Fragment, { children: [_jsx("div", { className: cx("o-pane-body", className), children: children }), _jsx(Scrollbar, {})] });
|
|
72
|
+
}
|
|
73
|
+
export function PaneFoot({ children, className }) {
|
|
74
|
+
return _jsx("div", { className: cx("o-pane-foot", className), children: children });
|
|
75
|
+
}
|
|
76
|
+
export function PaneTitle({ children, className }) {
|
|
77
|
+
return _jsx(Dialog.Title, { className: cx("o-pane-title", className), children: children });
|
|
78
|
+
}
|
|
79
|
+
export function PaneClose({ render, children }) {
|
|
80
|
+
return _jsx(Dialog.Close, { render: render, children: children });
|
|
81
|
+
}
|
|
82
|
+
export function usePane(start = null) {
|
|
83
|
+
const [state, setState] = React.useState({ shown: start, opener: null });
|
|
84
|
+
const step = (press) => setState((now) => paneAfter(now, press));
|
|
85
|
+
return {
|
|
86
|
+
shown: state.shown,
|
|
87
|
+
pane: {
|
|
88
|
+
open: state.shown !== null,
|
|
89
|
+
opener: state.opener,
|
|
90
|
+
onOpenChange: (next) => { if (!next)
|
|
91
|
+
step({ close: true }); },
|
|
92
|
+
},
|
|
93
|
+
opens: (key) => ({
|
|
94
|
+
onClick: (e) => step({ key, at: e.currentTarget }),
|
|
95
|
+
"aria-expanded": state.shown === key,
|
|
96
|
+
}),
|
|
97
|
+
close: () => step({ close: true }),
|
|
98
|
+
};
|
|
99
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/** What stands in the Pane, by its key, or nothing; and what opened it last. */
|
|
2
|
+
export type PaneState<E = HTMLElement> = {
|
|
3
|
+
shown: string | null;
|
|
4
|
+
opener: E | null;
|
|
5
|
+
};
|
|
6
|
+
/** A press on an opener (its thing's key, and the opener itself), or a close from inside the Pane (its ✕, Escape). */
|
|
7
|
+
export type PanePress<E = HTMLElement> = {
|
|
8
|
+
key: string;
|
|
9
|
+
at: E | null;
|
|
10
|
+
} | {
|
|
11
|
+
close: true;
|
|
12
|
+
};
|
|
13
|
+
/** The state after a press. */
|
|
14
|
+
export declare function paneAfter<E>(state: PaneState<E>, press: PanePress<E>): PaneState<E>;
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
export declare const PANE_TOKENS: readonly [{
|
|
2
|
+
readonly name: "--vk-radius-xl";
|
|
3
|
+
readonly kind: "size";
|
|
4
|
+
readonly outright: "--radius-xl";
|
|
5
|
+
}, {
|
|
6
|
+
readonly name: "--vk-shadow-menu";
|
|
7
|
+
readonly kind: "shadow";
|
|
8
|
+
readonly outright: "--shadow-menu";
|
|
9
|
+
}, {
|
|
10
|
+
readonly name: "--vk-border";
|
|
11
|
+
readonly kind: "colour";
|
|
12
|
+
readonly outright: "--border";
|
|
13
|
+
}, {
|
|
14
|
+
readonly name: "--vk-spacing";
|
|
15
|
+
readonly kind: "size";
|
|
16
|
+
readonly outright: "--spacing";
|
|
17
|
+
}, {
|
|
18
|
+
readonly name: "--vk-layer-drawer";
|
|
19
|
+
readonly kind: "size";
|
|
20
|
+
readonly outright: "--layer-drawer";
|
|
21
|
+
}, {
|
|
22
|
+
readonly name: "--vk-overlay";
|
|
23
|
+
readonly kind: "colour";
|
|
24
|
+
readonly outright: "--surface-overlay";
|
|
25
|
+
}, {
|
|
26
|
+
readonly name: "--vk-fg";
|
|
27
|
+
readonly kind: "colour";
|
|
28
|
+
readonly outright: "--text";
|
|
29
|
+
}, {
|
|
30
|
+
readonly name: "--vk-font-size-sm";
|
|
31
|
+
readonly kind: "size";
|
|
32
|
+
readonly outright: "--text-sm";
|
|
33
|
+
}, {
|
|
34
|
+
readonly name: "--vk-line-height-sm";
|
|
35
|
+
readonly kind: "size";
|
|
36
|
+
readonly outright: "--text-sm--line-height";
|
|
37
|
+
}, {
|
|
38
|
+
readonly name: "--vk-duration-fast";
|
|
39
|
+
readonly kind: "motion";
|
|
40
|
+
readonly outright: "--duration-fast";
|
|
41
|
+
}, {
|
|
42
|
+
readonly name: "--vk-ease-out";
|
|
43
|
+
readonly kind: "motion";
|
|
44
|
+
readonly outright: "--ease-out";
|
|
45
|
+
}, {
|
|
46
|
+
readonly name: "--vk-border-width";
|
|
47
|
+
readonly kind: "size";
|
|
48
|
+
readonly outright: "--border-width";
|
|
49
|
+
}, {
|
|
50
|
+
readonly name: "--vk-border-subtle";
|
|
51
|
+
readonly kind: "colour";
|
|
52
|
+
readonly outright: "--border-subtle";
|
|
53
|
+
}, {
|
|
54
|
+
readonly name: "--vk-font-weight-medium";
|
|
55
|
+
readonly kind: "size";
|
|
56
|
+
readonly outright: "--font-weight-medium";
|
|
57
|
+
}, {
|
|
58
|
+
readonly name: "--vk-ease-in";
|
|
59
|
+
readonly kind: "motion";
|
|
60
|
+
readonly outright: "--ease-in";
|
|
61
|
+
}, {
|
|
62
|
+
readonly name: "--vk-radius-lg";
|
|
63
|
+
readonly kind: "size";
|
|
64
|
+
readonly outright: "--radius-lg";
|
|
65
|
+
}, {
|
|
66
|
+
readonly name: "--vk-radius-2xl";
|
|
67
|
+
readonly kind: "size";
|
|
68
|
+
readonly outright: "--radius-2xl";
|
|
69
|
+
}, {
|
|
70
|
+
readonly name: "--vk-shadow-lg";
|
|
71
|
+
readonly kind: "shadow";
|
|
72
|
+
readonly outright: "--shadow-lg";
|
|
73
|
+
}, {
|
|
74
|
+
readonly name: "--vk-shadow-xl";
|
|
75
|
+
readonly kind: "shadow";
|
|
76
|
+
readonly outright: "--shadow-xl";
|
|
77
|
+
}];
|
|
78
|
+
/** The Pane's own machinery: its corners, shadow, edge, gap and padding as its options set them, and its edge's corner. */
|
|
79
|
+
export declare const PANE_PRIVATE: readonly ["--pane-"];
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export const PANE_TOKENS = [
|
|
2
|
+
{ name: "--vk-radius-xl", kind: "size", outright: "--radius-xl" },
|
|
3
|
+
{ name: "--vk-shadow-menu", kind: "shadow", outright: "--shadow-menu" },
|
|
4
|
+
{ name: "--vk-border", kind: "colour", outright: "--border" },
|
|
5
|
+
{ name: "--vk-spacing", kind: "size", outright: "--spacing" },
|
|
6
|
+
{ name: "--vk-layer-drawer", kind: "size", outright: "--layer-drawer" },
|
|
7
|
+
{ name: "--vk-overlay", kind: "colour", outright: "--surface-overlay" },
|
|
8
|
+
{ name: "--vk-fg", kind: "colour", outright: "--text" },
|
|
9
|
+
{ name: "--vk-font-size-sm", kind: "size", outright: "--text-sm" },
|
|
10
|
+
{ name: "--vk-line-height-sm", kind: "size", outright: "--text-sm--line-height" },
|
|
11
|
+
{ name: "--vk-duration-fast", kind: "motion", outright: "--duration-fast" },
|
|
12
|
+
{ name: "--vk-ease-out", kind: "motion", outright: "--ease-out" },
|
|
13
|
+
{ name: "--vk-border-width", kind: "size", outright: "--border-width" },
|
|
14
|
+
{ name: "--vk-border-subtle", kind: "colour", outright: "--border-subtle" },
|
|
15
|
+
{ name: "--vk-font-weight-medium", kind: "size", outright: "--font-weight-medium" },
|
|
16
|
+
{ name: "--vk-ease-in", kind: "motion", outright: "--ease-in" },
|
|
17
|
+
{ name: "--vk-radius-lg", kind: "size", outright: "--radius-lg" },
|
|
18
|
+
{ name: "--vk-radius-2xl", kind: "size", outright: "--radius-2xl" },
|
|
19
|
+
{ name: "--vk-shadow-lg", kind: "shadow", outright: "--shadow-lg" },
|
|
20
|
+
{ name: "--vk-shadow-xl", kind: "shadow", outright: "--shadow-xl" },
|
|
21
|
+
];
|
|
22
|
+
export const PANE_PRIVATE = ["--pane-"];
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
/* The Pane: a shell. Every value it draws with is a public name (controls/pane/tokens.ts); this file only says which
|
|
2
|
+
name each part takes. It
|
|
3
|
+
stands in the list's box it is handed (positioned, never scrolling), at its top right, a gap in from its edges. Base UI marks
|
|
4
|
+
it data-open, data-starting-style and data-ending-style as it comes and goes. What an app sets once is a data attribute on
|
|
5
|
+
the frame around it (looks.ts):
|
|
6
|
+
|
|
7
|
+
data-pane-place list · fit as tall as the list, or fitting what it holds
|
|
8
|
+
data-pane-corners lg · xl · 2xl which radius it takes
|
|
9
|
+
data-pane-smoothing round · smooth how its corners bend
|
|
10
|
+
data-pane-shadow none · menu · lg · xl its shadow
|
|
11
|
+
data-pane-edge outline · subtle · none one clear edge, a quieter one, or none
|
|
12
|
+
data-pane-gap 0 · 4 · 8 · 12 · 16 how far in from the list's top, right and bottom it stands
|
|
13
|
+
data-pane-padding 0 · 4 · 8 · 12 · 16 how far what it holds stands from its edge
|
|
14
|
+
|
|
15
|
+
300 wide, as Customize stands at the list's edge. The rules sit in the components layer, so a
|
|
16
|
+
utility class on it still wins. */
|
|
17
|
+
@layer components {
|
|
18
|
+
|
|
19
|
+
/* Its portal, in the list's box, takes no room there, whatever the box lays out. */
|
|
20
|
+
.o-pane-portal { display: contents; }
|
|
21
|
+
|
|
22
|
+
/* ── The shell: over the list and under every popup (layer-popup), a Drawer or a Modal opened later standing over it ── */
|
|
23
|
+
.o-pane {
|
|
24
|
+
--pane-corners: var(--vk-radius-xl); --pane-shadow: var(--vk-shadow-menu); --pane-edge: var(--vk-border);
|
|
25
|
+
--pane-gap: calc(var(--vk-spacing) * 2); --pane-pad: calc(var(--vk-spacing) * 2);
|
|
26
|
+
position: absolute; z-index: var(--vk-layer-drawer); top: var(--pane-gap); right: var(--pane-gap); bottom: var(--pane-gap);
|
|
27
|
+
box-sizing: border-box; display: flex; flex-direction: column;
|
|
28
|
+
width: calc(var(--vk-spacing) * 75); max-width: calc(100% - var(--pane-gap) * 2);
|
|
29
|
+
border-radius: var(--pane-corners); background-color: var(--vk-overlay); box-shadow: var(--pane-shadow); color: var(--vk-fg);
|
|
30
|
+
font-size: var(--vk-font-size-sm); line-height: calc(var(--vk-font-size-sm) * var(--vk-line-height-sm)); outline: none;
|
|
31
|
+
transition: opacity var(--vk-duration-fast) var(--vk-ease-out), translate var(--vk-duration-fast) var(--vk-ease-out);
|
|
32
|
+
}
|
|
33
|
+
/* Fitting what it holds: as tall as that, never past a gap over the list's foot. */
|
|
34
|
+
[data-pane-place="fit"] .o-pane { bottom: auto; max-height: calc(100% - var(--pane-gap) * 2); }
|
|
35
|
+
|
|
36
|
+
/* What it holds, inside its edge. The edge is drawn as two shapes, never a border, as the Popover's is: its colour (::before),
|
|
37
|
+
and the ground just inside it (::after), one line narrower, each with its own corner, so the edge follows the corners
|
|
38
|
+
exactly, round or smooth. */
|
|
39
|
+
.o-pane-cut { position: relative; isolation: isolate; box-sizing: border-box; display: flex; flex-direction: column; flex: 1 1 auto; min-height: 0; overflow: hidden; padding: var(--pane-pad); border-radius: inherit; }
|
|
40
|
+
.o-pane-cut::before, .o-pane-cut::after { content: ""; position: absolute; z-index: -1; border-radius: var(--pane-c); pointer-events: none; }
|
|
41
|
+
.o-pane-cut::before { --pane-c: var(--pane-corners); inset: 0; background-color: var(--pane-edge); }
|
|
42
|
+
.o-pane-cut::after { --pane-c: calc(var(--pane-corners) - var(--vk-border-width)); inset: var(--vk-border-width); background-color: var(--vk-overlay); }
|
|
43
|
+
|
|
44
|
+
/* Its head stays at its top, its body scrolls, its foot stays at its foot under a line across the whole Pane. The body scrolls up and
|
|
45
|
+
down only: a control's press area standing past its edge (a Switch's, at a row's end) made it scroll sideways, and where
|
|
46
|
+
scrollbars take room that bar stood at its foot. What it holds is clipped at its sides, where the body clips it anyway, so nothing
|
|
47
|
+
overhangs it to scroll to. */
|
|
48
|
+
.o-pane-head { flex: none; }
|
|
49
|
+
.o-pane-body { flex: 1 1 auto; min-height: 0; overflow: hidden auto; }
|
|
50
|
+
.o-pane-body > * { overflow-x: clip; }
|
|
51
|
+
/* What scrolls runs right to the foot's line: the foot has no margin over
|
|
52
|
+
it, and a body with a foot after it takes the Pane's padding at its end, inside what scrolls, so that room shows only at the scroll's
|
|
53
|
+
end. */
|
|
54
|
+
.o-pane-foot { flex: none; margin: 0 calc(var(--pane-pad) * -1) calc(var(--pane-pad) * -1); padding: var(--pane-pad); border-top: var(--vk-border-width) solid var(--pane-edge); }
|
|
55
|
+
.o-pane-body:has(~ .o-pane-foot) { padding-bottom: var(--pane-pad); }
|
|
56
|
+
[data-pane-edge="none"] .o-pane-foot { border-top-color: var(--vk-border-subtle); }
|
|
57
|
+
|
|
58
|
+
/* Its title, when what stands in it has one: text-sm at medium weight. */
|
|
59
|
+
.o-pane-title { margin: 0; font-size: var(--vk-font-size-sm); line-height: calc(var(--vk-font-size-sm) * var(--vk-line-height-sm)); font-weight: var(--vk-font-weight-medium); color: var(--vk-fg); }
|
|
60
|
+
|
|
61
|
+
/* It fades in and moves a step in from the right; it leaves faster than it came. */
|
|
62
|
+
.o-pane[data-ending-style] { transition-timing-function: var(--vk-ease-in); }
|
|
63
|
+
.o-pane:is([data-starting-style], [data-ending-style]) { opacity: 0; translate: var(--vk-spacing) 0; }
|
|
64
|
+
|
|
65
|
+
/* ── What an app sets once ───────────────────────────────────────────────────────────────────────────────────── */
|
|
66
|
+
[data-pane-corners="lg"] .o-pane { --pane-corners: var(--vk-radius-lg); }
|
|
67
|
+
[data-pane-corners="2xl"] .o-pane { --pane-corners: var(--vk-radius-2xl); }
|
|
68
|
+
[data-pane-shadow="none"] .o-pane { --pane-shadow: none; }
|
|
69
|
+
[data-pane-shadow="lg"] .o-pane { --pane-shadow: var(--vk-shadow-lg); }
|
|
70
|
+
[data-pane-shadow="xl"] .o-pane { --pane-shadow: var(--vk-shadow-xl); }
|
|
71
|
+
[data-pane-edge="subtle"] .o-pane { --pane-edge: var(--vk-border-subtle); }
|
|
72
|
+
[data-pane-edge="none"] .o-pane { --pane-edge: var(--vk-overlay); }
|
|
73
|
+
[data-pane-gap="0"] .o-pane { --pane-gap: 0px; }
|
|
74
|
+
[data-pane-gap="4"] .o-pane { --pane-gap: var(--vk-spacing); }
|
|
75
|
+
[data-pane-gap="12"] .o-pane { --pane-gap: calc(var(--vk-spacing) * 3); }
|
|
76
|
+
[data-pane-gap="16"] .o-pane { --pane-gap: calc(var(--vk-spacing) * 4); }
|
|
77
|
+
[data-pane-padding="0"] .o-pane { --pane-pad: 0px; }
|
|
78
|
+
[data-pane-padding="4"] .o-pane { --pane-pad: var(--vk-spacing); }
|
|
79
|
+
[data-pane-padding="12"] .o-pane { --pane-pad: calc(var(--vk-spacing) * 3); }
|
|
80
|
+
[data-pane-padding="16"] .o-pane { --pane-pad: calc(var(--vk-spacing) * 4); }
|
|
81
|
+
|
|
82
|
+
/* ── Its corners smooth: the smooth outline (smooth.css), as the Popover's. A cut would take the shadow with it, so
|
|
83
|
+
.o-pane-cut inside it is cut instead, and the edge's two shapes each by the same outline. The shadow is cast from a layer under
|
|
84
|
+
the cut that stands wholly inside the outline: cast by the shell's own round box, whose corner stands up to 0.02 of a
|
|
85
|
+
radius outside the smooth one, its edge and the cut's met in a light rim round the bend. Its corner a quarter
|
|
86
|
+
circle of 1.2 radii, which lies inside the smooth curve (from 1.2 radii on, by smooth.css's numbers; a larger one stands further
|
|
87
|
+
in and lightens the shadow at the corner), and half a line in, so the cut covers its edge everywhere and the shadow runs on from
|
|
88
|
+
under the edge, as dark as Round's ────── */
|
|
89
|
+
@supports (clip-path: shape(from 0 0, curve by 1px 1px with 1px 0 / 1px 0, close)) {
|
|
90
|
+
[data-pane-smoothing="smooth"] .o-pane { background-color: transparent; box-shadow: none; }
|
|
91
|
+
[data-pane-smoothing="smooth"] .o-pane::before {
|
|
92
|
+
content: ""; position: absolute; z-index: -1; inset: calc(var(--vk-border-width) / 2); border-radius: calc(var(--pane-corners) * 1.2);
|
|
93
|
+
box-shadow: var(--pane-shadow); pointer-events: none;
|
|
94
|
+
}
|
|
95
|
+
[data-pane-smoothing="smooth"] .o-pane-cut { --pane-c: var(--pane-corners); background-color: var(--vk-overlay); }
|
|
96
|
+
[data-pane-smoothing="smooth"] .o-pane-cut::before, [data-pane-smoothing="smooth"] .o-pane-cut::after { border-radius: 0; }
|
|
97
|
+
[data-pane-smoothing="smooth"] .o-pane-cut, [data-pane-smoothing="smooth"] .o-pane-cut::before, [data-pane-smoothing="smooth"] .o-pane-cut::after {
|
|
98
|
+
--smooth-t: var(--pane-c); clip-path: shape(var(--smooth-outline));
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
/* Under reduced motion it just appears. */
|
|
103
|
+
@media (prefers-reduced-motion: reduce) { .o-pane { transition: none; } }
|
|
104
|
+
}
|
|
@@ -15,7 +15,7 @@ export const PICKER_LOOKS = {
|
|
|
15
15
|
options,
|
|
16
16
|
looks: [
|
|
17
17
|
{ id: "attio", name: "Attio", picks: { search: "always", picked: "first", mark: "check", line: "beside", create: "apart", doing: "centred", heading: "hidden", kind: "badge", face: "32" } },
|
|
18
|
-
{ id: "mihai", name: "
|
|
18
|
+
{ id: "mihai", name: "Outright", picks: { search: "needed", picked: "count", mark: "tick", line: "below", create: "last", doing: "start", heading: "shown", kind: "end", face: "32" } },
|
|
19
19
|
],
|
|
20
20
|
};
|
|
21
21
|
const READ = ["search", "picked", "mark", "line", "create", "heading", "kind", "face"];
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { ComponentType } from "react";
|
|
2
2
|
import type { ViewsPickerItem, ViewsPickerProps } from "../../provider/components.js";
|
|
3
3
|
import type { ViewsMessageResolver } from "../../contract.js";
|
|
4
|
+
import type { MenuWords } from "../menu/menu.js";
|
|
4
5
|
import { type PickerItem, type PickerProps, type PickerWords } from "./picker.js";
|
|
5
6
|
type AppIcon = ComponentType<{
|
|
6
7
|
name: string;
|
|
@@ -20,8 +21,11 @@ export declare function pickerItemsOf(items: readonly ViewsPickerItem[], { AppIc
|
|
|
20
21
|
}): PickerItem[];
|
|
21
22
|
/** The Picker's words in the app's: each from its `views.picker.*` message. */
|
|
22
23
|
export declare function pickerWordsOf(say: ViewsMessageResolver): PickerWords;
|
|
23
|
-
/**
|
|
24
|
-
|
|
24
|
+
/** A menu's own words in the app's messages: a level's search, a sheet's ✕ and Back, the Close row, and a level's list (the
|
|
25
|
+
* Picker's). ViewKit's menu and the Picker's own menus are handed them. */
|
|
26
|
+
export declare const menuWordsOf: (say: ViewsMessageResolver) => MenuWords;
|
|
27
|
+
/** What the Picker is handed for ViewKit's props: its rows read as the Picker's, an action's key its id, the shell's draft, its words and its menus'. */
|
|
28
|
+
export declare function pickerPropsOf({ items, actions, steps, ...rest }: ViewsPickerProps, AppIcon?: AppIcon, words?: PickerWords, menuWords?: MenuWords): PickerProps;
|
|
25
29
|
/** ViewKit's pick list, drawn as the Picker. */
|
|
26
30
|
export declare function MapPicker(props: ViewsPickerProps): import("react/jsx-runtime").JSX.Element;
|
|
27
31
|
export {};
|
|
@@ -56,10 +56,12 @@ export function pickerWordsOf(say) {
|
|
|
56
56
|
you: say({ key: "views.picker.you" }),
|
|
57
57
|
};
|
|
58
58
|
}
|
|
59
|
-
export
|
|
59
|
+
export const menuWordsOf = (say) => ({ search: say({ key: "views.menus.search" }), close: say({ key: "views.panels.close" }), back: say({ key: "views.panels.back" }), picker: pickerWordsOf(say) });
|
|
60
|
+
export function pickerPropsOf({ items, actions, steps, ...rest }, AppIcon, words, menuWords) {
|
|
60
61
|
return {
|
|
61
62
|
...rest,
|
|
62
63
|
...(words ? { words } : {}),
|
|
64
|
+
...(menuWords ? { menuWords } : {}),
|
|
63
65
|
items: pickerItemsOf(items, { ...(AppIcon ? { AppIcon } : {}), ...(steps ? { steps } : {}) }),
|
|
64
66
|
...(actions ? { actions: actions.map((a) => ({ id: a.key, label: a.label, icon: a.icon ?? null, onSelect: a.onSelect })) } : {}),
|
|
65
67
|
draft: "shell",
|
|
@@ -67,5 +69,5 @@ export function pickerPropsOf({ items, actions, steps, ...rest }, AppIcon, words
|
|
|
67
69
|
}
|
|
68
70
|
export function MapPicker(props) {
|
|
69
71
|
const { components, messages } = useViews();
|
|
70
|
-
return _jsx(Picker, { ...pickerPropsOf(props, components.AppIcon, pickerWordsOf(messages)) });
|
|
72
|
+
return _jsx(Picker, { ...pickerPropsOf(props, components.AppIcon, pickerWordsOf(messages), menuWordsOf(messages)) });
|
|
71
73
|
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
+
import { type MenuWords } from "../menu/menu.js";
|
|
2
3
|
import { type SheetHeadProps } from "../sheet/bottom-sheet.js";
|
|
3
4
|
import { type PickerItem } from "./rows.js";
|
|
4
5
|
export type { PickerItem, PickerAs } from "./rows.js";
|
|
@@ -135,6 +136,12 @@ export interface PickerProps {
|
|
|
135
136
|
/** On a phone, a frame of their own round its rows' menus' rows (the Menu's `frame`, MENU_LIST_CARD_FRAME): what a list whose
|
|
136
137
|
* rows' menus are no menu's own sheet (a list of views) keeps, whatever the app picked round it. */
|
|
137
138
|
menuFrame?: Readonly<Record<string, string>>;
|
|
139
|
+
/** On a phone, a row's ⋯ hands its value here and opens no Menu of its own: its holder turns its Sheet into the row's menu (a
|
|
140
|
+
* list of views; one sheet, never a sheet on top). On a computer it changes nothing. */
|
|
141
|
+
onRowMenu?: (value: string) => void;
|
|
142
|
+
/** Its menus' own words (a row's own menu, and on a phone the ⋯ beside its search): a level's search, a sheet's ✕ and Back, the Close
|
|
143
|
+
* row, each the app's where handed, else English; a level's list takes the Picker's own `words`. */
|
|
144
|
+
menuWords?: Omit<MenuWords, "picker">;
|
|
138
145
|
/** Its rows can be put in order: a row pressed and dragged, with no grip (on a phone after a hold), or ⌥↑ ⌥↓ on the lit
|
|
139
146
|
* row, only among the rows under its own heading and never while something is typed; handed every value in its new order at each
|
|
140
147
|
* move. Left out, no row moves. */
|
|
@@ -180,6 +180,7 @@ export function usePicker(props) {
|
|
|
180
180
|
function usePickerAt(props, under) {
|
|
181
181
|
const { label, items, multiple, value, onDone, empty, search, onSearch, doing, onRetry, onMore, nothingYet, actions = [], readOnly, none: noneWords } = props;
|
|
182
182
|
const w = { ...PICKER_WORDS, ...props.words };
|
|
183
|
+
const menuWords = { ...props.menuWords, ...(props.words ? { picker: props.words } : {}) };
|
|
183
184
|
const onValueChange = readOnly ? () => { } : props.onValueChange, onCreate = readOnly ? undefined : props.onCreate;
|
|
184
185
|
const host = React.useContext(PhoneHost), small = usePhone();
|
|
185
186
|
const form = props.form ?? (host || small ? "phone" : "computer");
|
|
@@ -427,7 +428,10 @@ function usePickerAt(props, under) {
|
|
|
427
428
|
return false;
|
|
428
429
|
e.preventDefault();
|
|
429
430
|
e.preventBaseUIHandler?.();
|
|
430
|
-
|
|
431
|
+
if (form === "phone" && props.onRowMenu)
|
|
432
|
+
props.onRowMenu(row.item.value);
|
|
433
|
+
else
|
|
434
|
+
setRowMenu({ value: row.item.value, anchor: dots });
|
|
431
435
|
return true;
|
|
432
436
|
};
|
|
433
437
|
const backKey = (e) => {
|
|
@@ -452,11 +456,34 @@ function usePickerAt(props, under) {
|
|
|
452
456
|
lightRow(at >= 0 ? open[(at + (down ? 1 : -1) + open.length) % open.length] : down ? open[0] : open[open.length - 1]);
|
|
453
457
|
return true;
|
|
454
458
|
};
|
|
459
|
+
const passKey = (e) => {
|
|
460
|
+
if (form !== "computer" || e.altKey || e.metaKey || e.ctrlKey || e.shiftKey || (e.key !== "ArrowDown" && e.key !== "ArrowUp"))
|
|
461
|
+
return false;
|
|
462
|
+
const rows = optionRows(), n = rows.length, step = e.key === "ArrowDown" ? 1 : -1;
|
|
463
|
+
if (!n)
|
|
464
|
+
return false;
|
|
465
|
+
const at = rows.findIndex((r) => r.hasAttribute("data-highlighted"));
|
|
466
|
+
const next = at < 0 ? (step > 0 ? 0 : n - 1) : (at + step + n) % n;
|
|
467
|
+
if (!rows[next].hasAttribute("data-disabled"))
|
|
468
|
+
return false;
|
|
469
|
+
e.preventDefault();
|
|
470
|
+
e.preventBaseUIHandler?.();
|
|
471
|
+
for (let k = 1; k < n; k++) {
|
|
472
|
+
const row = rows[(next + k * step + n * n) % n];
|
|
473
|
+
if (!row.hasAttribute("data-disabled")) {
|
|
474
|
+
lightRow(row);
|
|
475
|
+
break;
|
|
476
|
+
}
|
|
477
|
+
}
|
|
478
|
+
return true;
|
|
479
|
+
};
|
|
455
480
|
const ends = (e) => {
|
|
456
481
|
if (backKey(e))
|
|
457
482
|
return;
|
|
458
483
|
if (restKey(e))
|
|
459
484
|
return;
|
|
485
|
+
if (passKey(e))
|
|
486
|
+
return;
|
|
460
487
|
if (menuKey(e))
|
|
461
488
|
return;
|
|
462
489
|
if (orderKey(e))
|
|
@@ -472,17 +499,33 @@ function usePickerAt(props, under) {
|
|
|
472
499
|
lightRow(e.key === "Home" ? open[0] : open[open.length - 1]);
|
|
473
500
|
};
|
|
474
501
|
const searchBox = React.useCallback((el) => { input.current = el; focusesInPlace(el); }, []);
|
|
502
|
+
const firstPickable = () => {
|
|
503
|
+
const rows = optionRows();
|
|
504
|
+
return rows.find((r) => r.dataset.name != null && !r.hasAttribute("data-disabled")) ?? rows.find((r) => r.classList.contains("o-picker-create"));
|
|
505
|
+
};
|
|
475
506
|
const answer = items.map((i) => i.value).join("\u0000");
|
|
476
507
|
React.useEffect(() => {
|
|
477
508
|
if (!server || form === "phone" || !find.trim() || doing)
|
|
478
509
|
return;
|
|
479
|
-
|
|
480
|
-
if (rows.some((r) => r.hasAttribute("data-highlighted")))
|
|
510
|
+
if (optionRows().some((r) => r.hasAttribute("data-highlighted")))
|
|
481
511
|
return;
|
|
482
|
-
const first =
|
|
512
|
+
const first = firstPickable();
|
|
483
513
|
if (first)
|
|
484
514
|
lightRow(first);
|
|
485
515
|
}, [answer, doing]);
|
|
516
|
+
React.useEffect(() => {
|
|
517
|
+
if (form === "phone" || !find.trim() || doing)
|
|
518
|
+
return;
|
|
519
|
+
const frame = requestAnimationFrame(() => {
|
|
520
|
+
const lit = optionRows().find((r) => r.hasAttribute("data-highlighted"));
|
|
521
|
+
if (lit && (!lit.hasAttribute("data-disabled") || litByPerson.current))
|
|
522
|
+
return;
|
|
523
|
+
const first = firstPickable();
|
|
524
|
+
if (first)
|
|
525
|
+
lightRow(first);
|
|
526
|
+
});
|
|
527
|
+
return () => cancelAnimationFrame(frame);
|
|
528
|
+
}, [find, doing]);
|
|
486
529
|
const openedNow = under ? under.open : true;
|
|
487
530
|
React.useEffect(() => {
|
|
488
531
|
if (form === "phone" || !openedNow || !opening.current.trim())
|
|
@@ -553,7 +596,13 @@ function usePickerAt(props, under) {
|
|
|
553
596
|
const stopKeys = (e) => { if (e.key === "Enter" || e.key === " ")
|
|
554
597
|
e.stopPropagation(); };
|
|
555
598
|
const rowTrigger = (item) => {
|
|
556
|
-
const open = (e) => {
|
|
599
|
+
const open = (e) => {
|
|
600
|
+
e.stopPropagation();
|
|
601
|
+
if (form === "phone" && props.onRowMenu)
|
|
602
|
+
props.onRowMenu(item.value);
|
|
603
|
+
else
|
|
604
|
+
setRowMenu({ value: item.value, anchor: e.currentTarget });
|
|
605
|
+
};
|
|
557
606
|
return form === "phone"
|
|
558
607
|
? _jsx(MenuDots, { label: w.rowActions(item.label), className: "o-picker-row-menu", onClick: open, onKeyDown: stopKeys })
|
|
559
608
|
: _jsx(Button, { kind: "quiet", shape: "icon", size: "20", tabIndex: -1, className: "o-picker-row-menu", "data-shown": props.rowMenus ?? "always", "aria-label": w.rowActions(item.label), icon: glyph(DOTS_V), onClick: open, onKeyDown: stopKeys });
|
|
@@ -562,7 +611,7 @@ function usePickerAt(props, under) {
|
|
|
562
611
|
const menuItem = rowMenu ? itemOf(rowMenu.value) : undefined;
|
|
563
612
|
const rowMenuEl = items.some(hasMenu)
|
|
564
613
|
? _jsx(Menu, { label: menuItem?.label ?? label, entries: menuItem?.menu ?? [], anchor: rowMenu?.anchor ?? null, align: rowMenu?.anchor instanceof HTMLElement ? "end" : "start", open: !!rowMenu?.open, onOpenChange: (o) => { if (!o)
|
|
565
|
-
setMenuAt((m) => m && { ...m, open: false }); }, frame: props.menuFrame })
|
|
614
|
+
setMenuAt((m) => m && { ...m, open: false }); }, frame: props.menuFrame, words: menuWords })
|
|
566
615
|
: null;
|
|
567
616
|
const ordering = !!props.onOrderChange && !find.trim() && !level;
|
|
568
617
|
const keptNow = multiple && own ? draft : held;
|
|
@@ -740,7 +789,7 @@ function usePickerAt(props, under) {
|
|
|
740
789
|
const showBar = !none && (pill || creatable || menu.length > 0 || (!!level && !byHolder));
|
|
741
790
|
const bar = showBar && (_jsxs("div", { className: "o-picker-bar", children: [level && !byHolder && _jsx(GlassButton, { "aria-label": w.back(level.label), icon: glyph(BACK), className: "o-picker-round", "data-back": "", onMouseDown: (e) => e.preventDefault(), onClick: () => back() }), pill && (_jsxs(InputGroup, { size: "lg", className: "o-picker-pill", ...pillTap, children: [_jsx(InputGroupAddon, { side: "start", children: glyph(SEARCH) }), _jsx(Input, { combobox: true, autofill: false, ref: pillInput, placeholder: search, "aria-label": search ?? label, onKeyDown: (e) => { if (!backKey(e))
|
|
742
791
|
enter(e); } })] })), creatable ? _jsx(Button, { kind: "primary", size: "lg", icon: glyph(PLUS), className: "o-picker-create-button", onClick: createTyped, children: w.createButton })
|
|
743
|
-
: menu.length > 0 && _jsx(Menu, { label: label, entries: menu, trigger: _jsx(GlassButton, { "aria-label": w.actions, icon: glyph(DOTS), className: "o-picker-round" }) })] }));
|
|
792
|
+
: menu.length > 0 && _jsx(Menu, { label: label, entries: menu, words: menuWords, trigger: _jsx(GlassButton, { "aria-label": w.actions, icon: glyph(DOTS), className: "o-picker-round" }) })] }));
|
|
744
793
|
const menuOpen = (item) => (menuOpenFor(item.value) ? { "data-menu-open": "" } : {});
|
|
745
794
|
const heldHere = (v) => inPlace && kept.includes(v);
|
|
746
795
|
const rowValue = (item) => (heldHere(item.value) && !changing ? { key: `unpick:${item.value}`, kind: "unpick", item } : itemEntry(item));
|
|
@@ -804,7 +853,7 @@ function usePickerAt(props, under) {
|
|
|
804
853
|
}, modal: true, disabled: under.disabled, multiple: multiple, value: value_, onValueChange: (v, d) => {
|
|
805
854
|
if (d.reason !== "escape-key")
|
|
806
855
|
take(v, d);
|
|
807
|
-
}, inputValue: query, onInputValueChange: (q, d) => (d.reason === "escape-key" && heldName ? setQuery(heldName) : ask(q)), autoHighlight: true, onItemHighlighted: highlighted, itemToStringValue: (e) => e.key, itemToStringLabel: (e) => entryLabel(e), isItemEqualToValue: (a, b) => a.key === b.key, children: [typeof under.box === "function" ? under.box({ onKeyDown: (e) => { if (!backKey(e) && !restKey(e) && !menuKey(e) && !orderKey(e))
|
|
856
|
+
}, inputValue: query, onInputValueChange: (q, d) => (d.reason === "escape-key" && heldName ? setQuery(heldName) : ask(q)), autoHighlight: true, onItemHighlighted: highlighted, itemToStringValue: (e) => e.key, itemToStringLabel: (e) => entryLabel(e), isItemEqualToValue: (a, b) => a.key === b.key, children: [typeof under.box === "function" ? under.box({ onKeyDown: (e) => { if (!backKey(e) && !restKey(e) && !passKey(e) && !menuKey(e) && !orderKey(e))
|
|
808
857
|
guard(e); }, typed: query, attrs: restAttrs }) : under.box, under.panel(list), _jsx("span", { ref: mark, hidden: true }), rowMenuEl] })) : (_jsxs(BaseCombobox.Root, { inline: true, open: true, multiple: multiple, value: value_, onValueChange: (v, d) => take(v, d), inputValue: query, onInputValueChange: ask, autoHighlight: true, onItemHighlighted: highlighted, itemToStringValue: (e) => e.key, itemToStringLabel: (e) => entryLabel(e), isItemEqualToValue: (a, b) => a.key === b.key, children: [list, rowMenuEl] }));
|
|
809
858
|
return { body, head: {}, step: null };
|
|
810
859
|
}
|
|
@@ -23,11 +23,13 @@ export type PickerAs = {
|
|
|
23
23
|
* rows it leads one level in (a deal's Company, its Name, Industry and Region), which it opens and never picks; and its
|
|
24
24
|
* own menu, what can be done to that one row (a view's Rename…, Delete view…), ⋮ at its end opening it, never picking; and its
|
|
25
25
|
* count, how many records hold it (a quick filter's value), at its end, right before what says it is held.
|
|
26
|
-
* A row that leads one level in keeps its level's count and ›. And a mark after its name (a private view's lock), quieter.
|
|
26
|
+
* A row that leads one level in keeps its level's count and ›. And a mark after its name (a private view's lock), quieter. And
|
|
27
|
+
* `also`, words its search finds it by besides its name (a currency's code), never drawn.
|
|
27
28
|
*/
|
|
28
29
|
export interface PickerItem {
|
|
29
30
|
value: string;
|
|
30
31
|
label: string;
|
|
32
|
+
also?: readonly string[];
|
|
31
33
|
as?: PickerAs;
|
|
32
34
|
line?: string;
|
|
33
35
|
you?: boolean;
|
|
@@ -99,7 +101,7 @@ export interface RowsInput {
|
|
|
99
101
|
/** The levels open, by their rows' values, outermost first, as far as the items still hold them. */
|
|
100
102
|
export declare function openLevels(items: PickerItem[], values: string[]): PickerItem[];
|
|
101
103
|
export declare const fold: (s: string) => string;
|
|
102
|
-
/** The item whose name is what was typed, whatever its case and the spaces round it. */
|
|
104
|
+
/** The item whose name, or one of its `also` words, is what was typed, whatever its case and the spaces round it. */
|
|
103
105
|
export declare function exactMatch(items: PickerItem[], query: string): PickerItem | undefined;
|
|
104
106
|
export declare function pickerRows({ items, known, query, picked, empty, create, server, more, first, open, levelRow }: RowsInput): PickerRow[];
|
|
105
107
|
/** Every item's value in its order after `value` moved to where `target` stands: before it, moving up; after it, moving
|
|
@@ -10,9 +10,10 @@ export function openLevels(items, values) {
|
|
|
10
10
|
return out;
|
|
11
11
|
}
|
|
12
12
|
export const fold = (s) => s.normalize("NFD").replace(/\p{M}/gu, "").trim().toLowerCase();
|
|
13
|
+
const found = (i) => [i.label, ...(i.also ?? [])].map(fold);
|
|
13
14
|
export function exactMatch(items, query) {
|
|
14
15
|
const q = fold(query);
|
|
15
|
-
return q ? items.find((i) =>
|
|
16
|
+
return q ? items.find((i) => found(i).includes(q)) : undefined;
|
|
16
17
|
}
|
|
17
18
|
const itemRow = (item, held) => (item.level ? { kind: "item", item, picked: held.has(item.value), opens: true, count: item.level.length } : { kind: "item", item, picked: held.has(item.value) });
|
|
18
19
|
export function pickerRows({ items, known = items, query, picked, empty, create, server, more, first = [], open = [], levelRow = true }) {
|
|
@@ -25,12 +26,12 @@ export function pickerRows({ items, known = items, query, picked, empty, create,
|
|
|
25
26
|
return [{ kind: "parent", item: level }, ...rows.map((r) => (r.kind === "item" ? { ...r, indent: true } : r))];
|
|
26
27
|
}
|
|
27
28
|
const q = fold(query), held = new Set(picked);
|
|
28
|
-
const matching = server || !q ? items : items.filter((i) =>
|
|
29
|
+
const matching = server || !q ? items : items.filter((i) => found(i).some((w) => w.includes(q)));
|
|
29
30
|
const exact = q ? exactMatch(matching, query) : undefined;
|
|
30
31
|
const ahead = new Set(q ? [] : first), top = matching.filter((i) => ahead.has(i.value));
|
|
31
32
|
const shown = (exact ? matching.filter((i) => i !== exact) : matching).filter((i) => !ahead.has(i.value));
|
|
32
33
|
const ranked = (list) => (server || !q ? list
|
|
33
|
-
: [...list.filter((i) =>
|
|
34
|
+
: [...list.filter((i) => found(i).some((w) => w.startsWith(q))), ...list.filter((i) => !found(i).some((w) => w.startsWith(q)))]);
|
|
34
35
|
const rows = [];
|
|
35
36
|
if (empty !== undefined && !q && held.size)
|
|
36
37
|
rows.push({ kind: "empty", label: empty });
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import type { ViewsPopoverProps } from "../../provider/components.js";
|
|
2
2
|
/** ViewKit's popup, drawn as the kit's Popover. */
|
|
3
|
-
export declare function MapPopover({ open, onOpenChange, anchor, side, align, sideOffset, alignOffset, initialFocus, onOutsidePress, onEscape, onPanelClick, panelData, style, className, children }: ViewsPopoverProps): import("react/jsx-runtime").JSX.Element;
|
|
3
|
+
export declare function MapPopover({ open, onOpenChange, anchor, side, align, sideOffset, alignOffset, initialFocus, onOutsidePress, onEscape, chrome, onPanelClick, panelData, style, className, children }: ViewsPopoverProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { Popover } from "./popover.js";
|
|
3
|
-
export function MapPopover({ open, onOpenChange, anchor, side, align, sideOffset, alignOffset, initialFocus, onOutsidePress, onEscape, onPanelClick, panelData, style, className, children }) {
|
|
4
|
-
return (_jsx(Popover, { open: open, onOpenChange: (next, d) => onOpenChange(next, { reason: d.reason }), anchor: anchor, side: side, align: align, sideOffset: sideOffset, alignOffset: alignOffset, initialFocus: initialFocus, onOutsidePress: onOutsidePress, onEscape: onEscape, style: style, onPopupClick: onPanelClick, popupData: panelData, className: className, children: children }));
|
|
3
|
+
export function MapPopover({ open, onOpenChange, anchor, side, align, sideOffset, alignOffset, initialFocus, onOutsidePress, onEscape, chrome, onPanelClick, panelData, style, className, children }) {
|
|
4
|
+
return (_jsx(Popover, { open: open, onOpenChange: (next, d) => onOpenChange(next, { reason: d.reason }), anchor: anchor, side: side, align: align, sideOffset: sideOffset, alignOffset: alignOffset, initialFocus: initialFocus, onOutsidePress: onOutsidePress, onEscape: onEscape, style: style, onPopupClick: onPanelClick, popupData: chrome === "menu" ? { ...panelData, "data-popover-chrome": "menu" } : panelData, className: className, children: children }));
|
|
5
5
|
}
|