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,51 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
import { Toolbar as BaseToolbar } from "@base-ui/react/toolbar";
|
|
5
|
+
import { cx } from "../../internal/cx.js";
|
|
6
|
+
import { Button } from "../button/button.js";
|
|
7
|
+
import { PhoneHost, usePhone } from "../internal/phone.js";
|
|
8
|
+
import { TOOLBAR_BUTTON_LOOKS } from "./looks.js";
|
|
9
|
+
const KIND = { ghost: "quiet", bordered: "outline", filled: "soft" };
|
|
10
|
+
const SIZE = { "28": "xs", "32": "sm", "36": "md", "44": "44" };
|
|
11
|
+
const ATTRS = TOOLBAR_BUTTON_LOOKS.options.map((o) => `data-toolbar-button-${o.id}`);
|
|
12
|
+
const DEF = Object.fromEntries(TOOLBAR_BUTTON_LOOKS.options.map((o) => [o.id, o.def]));
|
|
13
|
+
const optionOf = (el, id) => el?.closest(`[data-toolbar-button-${id}]`)?.getAttribute(`data-toolbar-button-${id}`) ?? DEF[id];
|
|
14
|
+
const wornOf = (el, phone) => {
|
|
15
|
+
const at = (id) => optionOf(el, (phone ? `${id}phone` : id));
|
|
16
|
+
return { ground: at("ground"), words: at("words"), size: at("size"), corners: at("corners"),
|
|
17
|
+
smoothing: optionOf(el, "smoothing") };
|
|
18
|
+
};
|
|
19
|
+
const same = (a, b) => a.ground === b.ground && a.words === b.words && a.size === b.size && a.corners === b.corners && a.smoothing === b.smoothing;
|
|
20
|
+
export const InToolbar = React.createContext(null);
|
|
21
|
+
export function useToolbarButtonWorn(el, phone) {
|
|
22
|
+
const [worn, setWorn] = React.useState(() => wornOf(null, phone));
|
|
23
|
+
React.useLayoutEffect(() => {
|
|
24
|
+
const read = () => setWorn((was) => { const now = wornOf(el, phone); return same(was, now) ? was : now; });
|
|
25
|
+
read();
|
|
26
|
+
const watch = new MutationObserver(read);
|
|
27
|
+
watch.observe(document.documentElement, { attributes: true, subtree: true, attributeFilter: ATTRS });
|
|
28
|
+
return () => watch.disconnect();
|
|
29
|
+
}, [el, phone]);
|
|
30
|
+
return worn;
|
|
31
|
+
}
|
|
32
|
+
export const ToolbarButtonControl = React.forwardRef(function ToolbarButtonControl({ label, children, count, dot, empty, lit, aside, filter: _filter, joined, current, ground, words, size, corners, smoothing, form, stays: _stays, focusableWhenDisabled = false, icon, iconEnd, className, ...props }, ref) {
|
|
33
|
+
const host = React.useContext(PhoneHost), narrow = usePhone(), row = React.useContext(InToolbar);
|
|
34
|
+
const phone = (form ?? row?.form) ? (form ?? row?.form) === "phone" : host != null || narrow;
|
|
35
|
+
const [el, setEl] = React.useState(null);
|
|
36
|
+
const worn = useToolbarButtonWorn(el, phone);
|
|
37
|
+
const g = ground ?? worn.ground, w = words ?? worn.words, z = size ?? row?.size ?? worn.size, c = corners ?? worn.corners, m = smoothing ?? worn.smoothing;
|
|
38
|
+
const own = React.useCallback((node) => {
|
|
39
|
+
setEl(node);
|
|
40
|
+
if (typeof ref === "function")
|
|
41
|
+
ref(node);
|
|
42
|
+
else if (ref)
|
|
43
|
+
ref.current = node;
|
|
44
|
+
}, [ref]);
|
|
45
|
+
const alone = w === "icon" && icon != null && count == null;
|
|
46
|
+
const said = w === "icon" && icon != null ? null : (children ?? label);
|
|
47
|
+
const look = { open: "hovered" };
|
|
48
|
+
const named = said == null ? [label, typeof count === "string" || typeof count === "number" ? String(count) : null].filter(Boolean).join(", ") : undefined;
|
|
49
|
+
const button = (_jsx(Button, { ref: own, kind: KIND[g], size: SIZE[z], shape: alone ? "icon" : "default", icon: w === "word" ? undefined : icon, iconEnd: alone ? undefined : iconEnd, look: look, "aria-label": named, focusableWhenDisabled: focusableWhenDisabled, className: cx("o-toolbar-button", className), "data-kit": "toolbar-button", "data-corners": c === "button" ? undefined : c, "data-smoothing": m === "app" ? undefined : m, "data-screen": phone ? "phone" : "computer", "data-empty": empty ? "" : undefined, "data-lit": lit ? "" : undefined, "data-aside": aside ? "" : undefined, "data-joined": joined, "data-dot": dot && count == null ? "" : undefined, "data-tab": current !== undefined ? "" : undefined, "data-current": current ? "" : undefined, "aria-current": current ? "true" : undefined, ...props, children: said != null || count != null ? _jsxs(_Fragment, { children: [said, count != null && _jsx("span", { className: "o-toolbar-button-count", "data-alone": said == null ? "" : undefined, children: count })] }) : null }));
|
|
50
|
+
return row ? _jsx(BaseToolbar.Button, { render: button, disabled: props.disabled, focusableWhenDisabled: focusableWhenDisabled }) : button;
|
|
51
|
+
});
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
/* The toolbar button. It is the Button (button.css draws its kind, size, corners, depth, hover and press); this file draws
|
|
2
|
+
only what the Toolbar button adds, every value a token:
|
|
3
|
+
|
|
4
|
+
data-toolbar-button-weight button · medium · semibold its label's weight, the Button's until set
|
|
5
|
+
|
|
6
|
+
and, on the button itself, what the component read off the frame (or what holds it said): its corners when set apart from the
|
|
7
|
+
Button's (data-corners, a radius step or full), its corner smoothing when round (data-smoothing), its count, an empty place
|
|
8
|
+
(data-empty), the brand once used (data-lit), set aside (data-aside), its dot (data-dot) and where it stands joined to its neighbours (data-joined). Its ground, words and size pick the Button's kind, form and
|
|
9
|
+
height. Each rule here is a step more specific than the Button's own (0,3,0), so what is set for it alone wins over the frame's
|
|
10
|
+
Button picks. */
|
|
11
|
+
@layer components {
|
|
12
|
+
|
|
13
|
+
/* Its corners, one slider: the Button's (nothing here), then each radius step to Full, the pill and, its icon alone, the circle. */
|
|
14
|
+
.o-button.o-toolbar-button.o-toolbar-button[data-corners="xs"] { --button-r: var(--vk-radius-xs); }
|
|
15
|
+
.o-button.o-toolbar-button.o-toolbar-button[data-corners="sm"] { --button-r: var(--vk-radius-sm); }
|
|
16
|
+
.o-button.o-toolbar-button.o-toolbar-button[data-corners="md"] { --button-r: var(--vk-radius-md); }
|
|
17
|
+
.o-button.o-toolbar-button.o-toolbar-button[data-corners="lg"] { --button-r: var(--vk-radius-lg); }
|
|
18
|
+
.o-button.o-toolbar-button.o-toolbar-button[data-corners="xl"] { --button-r: var(--vk-radius-xl); }
|
|
19
|
+
.o-button.o-toolbar-button.o-toolbar-button[data-corners="2xl"] { --button-r: var(--vk-radius-2xl); }
|
|
20
|
+
.o-button.o-toolbar-button.o-toolbar-button[data-corners="full"] { --button-r: var(--vk-radius-full); }
|
|
21
|
+
|
|
22
|
+
/* Its corner smoothing (data-smoothing): The app's follows the Button's (nothing set); Smooth and Round set it apart, which the
|
|
23
|
+
Button's own Corner smoothing section draws (button.css). */
|
|
24
|
+
|
|
25
|
+
/* Its label's weight, set for it alone. */
|
|
26
|
+
[data-toolbar-button-weight="medium"] .o-button.o-toolbar-button { font-weight: var(--vk-font-weight-medium); }
|
|
27
|
+
[data-toolbar-button-weight="semibold"] .o-button.o-toolbar-button { font-weight: var(--vk-font-weight-semibold); }
|
|
28
|
+
|
|
29
|
+
/* Joined to its neighbours (data-joined): a filter's parts drawn one at a time, ViewKit's on the bar, which no ButtonGroup can
|
|
30
|
+
stand round; drawn as button.css draws a horizontal group's buttons, its inner corners square and the edge between two drawn once
|
|
31
|
+
(focus lifts it over its neighbours there, beside the group's own lift). */
|
|
32
|
+
.o-button.o-toolbar-button:is([data-joined="start"], [data-joined="middle"]) { border-top-right-radius: 0; border-bottom-right-radius: 0; }
|
|
33
|
+
.o-button.o-toolbar-button:is([data-joined="middle"], [data-joined="end"]) { border-top-left-radius: 0; border-bottom-left-radius: 0; border-left-width: 0; }
|
|
34
|
+
|
|
35
|
+
/* Its count at its end, quieter than its words, its digits lined up; in the brand once used. */
|
|
36
|
+
.o-toolbar-button-count { margin-left: var(--vk-spacing); color: var(--vk-fg-subtle); font-variant-numeric: tabular-nums; }
|
|
37
|
+
.o-toolbar-button-count[data-alone] { margin-left: 0; }
|
|
38
|
+
|
|
39
|
+
/* A dot at its top end corner, in the brand: something applied with no number. Drawn with ::before, since the pressing area takes
|
|
40
|
+
::after on a phone (its pressing area). */
|
|
41
|
+
.o-button.o-toolbar-button[data-dot]::before {
|
|
42
|
+
content: ""; position: absolute; top: var(--vk-spacing); right: var(--vk-spacing); width: var(--vk-dot-size); height: var(--vk-dot-size);
|
|
43
|
+
border-radius: var(--vk-radius-full); background-color: var(--vk-brand); pointer-events: none;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
/* In the brand once used: its words, its icon and its count. */
|
|
47
|
+
.o-button.o-toolbar-button[data-lit]:not(:disabled, [data-disabled]),
|
|
48
|
+
.o-button.o-toolbar-button[data-lit]:not(:disabled, [data-disabled]) .o-toolbar-button-count { color: var(--vk-fg-accent); }
|
|
49
|
+
/* Open and in the brand (the quick filters' button with a value held, its Pane open): the brand wins over the open look's
|
|
50
|
+
words, (0,6,0) over the Button's open "hovered" (0,5,0), which keeps its ground. */
|
|
51
|
+
.o-button.o-toolbar-button.o-toolbar-button[data-lit][aria-expanded="true"]:not(:disabled, [data-disabled]) { color: var(--vk-fg-accent); }
|
|
52
|
+
|
|
53
|
+
/* A view tab (data-tab), the portal's way: the unopened ones in the subtle words, coming up to the text under the pointer; the open
|
|
54
|
+
one (data-current) on its ground's selected step (ghost the surface's, bordered the raised surface's with no edge or depth,
|
|
55
|
+
filled the sunken surface's), its words the selected text's, unmoved by the pointer; in the brand (data-lit), a phone's view
|
|
56
|
+
chip, on the brand's subtlest ground. */
|
|
57
|
+
.o-button.o-toolbar-button[data-tab]:not([data-current]) { color: var(--vk-fg-subtle); }
|
|
58
|
+
.o-button.o-toolbar-button[data-tab]:not([data-current]):is([data-force="hover"], :active, [data-force="press"]) { color: var(--vk-fg); }
|
|
59
|
+
@media (hover: hover) { .o-button.o-toolbar-button[data-tab]:not([data-current]):hover { color: var(--vk-fg); } }
|
|
60
|
+
.o-button.o-toolbar-button.o-toolbar-button[data-current] { --button-ground: var(--vk-selected); color: var(--vk-fg-selected); }
|
|
61
|
+
.o-button.o-toolbar-button.o-toolbar-button.o-button-outline[data-current] { --button-ground: var(--vk-raised-selected); --button-edge: transparent; --button-edge-foot: transparent; --button-depth: none; }
|
|
62
|
+
.o-button.o-toolbar-button.o-toolbar-button.o-button-soft[data-current] { --button-ground: var(--vk-sunken-selected); }
|
|
63
|
+
.o-button.o-toolbar-button.o-toolbar-button[data-current][data-lit] { --button-ground: var(--vk-brand-subtlest); color: var(--vk-fg-accent); }
|
|
64
|
+
|
|
65
|
+
/* An empty place: its edge dashed on the ground it stands on, its words quieter, no depth; under the pointer the ground's hover. */
|
|
66
|
+
.o-button.o-toolbar-button[data-empty] { border-style: dashed; --button-edge: var(--vk-border-bold); --button-edge-foot: var(--vk-border-bold); --button-ground: transparent; --button-depth: none; color: var(--vk-fg-subtle); }
|
|
67
|
+
.o-button.o-toolbar-button[data-empty]:is([data-force="hover"], :active, [data-force="press"]):not(:disabled, [data-disabled]) { --button-ground: var(--vk-hovered); color: var(--vk-fg); }
|
|
68
|
+
@media (hover: hover) { .o-button.o-toolbar-button[data-empty]:hover:not(:disabled, [data-disabled]) { --button-ground: var(--vk-hovered); color: var(--vk-fg); } }
|
|
69
|
+
|
|
70
|
+
/* Set aside: what it names left the list (a filter whose field is gone). Its edge dashed in the warning's, its words the
|
|
71
|
+
warning's, no depth; under the pointer the warning's palest ground. */
|
|
72
|
+
.o-button.o-toolbar-button[data-aside] { border-style: dashed; --button-edge: var(--vk-border-warning); --button-edge-foot: var(--vk-border-warning); --button-depth: none; color: var(--vk-warning); }
|
|
73
|
+
.o-button.o-toolbar-button[data-aside]:is([data-force="hover"], :active, [data-force="press"]):not(:disabled, [data-disabled]) { --button-ground: var(--vk-warning-subtlest); }
|
|
74
|
+
@media (hover: hover) { .o-button.o-toolbar-button[data-aside]:hover:not(:disabled, [data-disabled]) { --button-ground: var(--vk-warning-subtlest); } }
|
|
75
|
+
}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
/* The Toolbar (the Outright kit's, KIT-138; ViewKit's since VK-858, as ToolbarControl): the row and, under it, the filter bar, as
|
|
2
|
+
the toolbar's map draws them. Every value it draws with is a name ViewKit's controls read (docs/controls/toolbar.md). It draws
|
|
3
|
+
nothing of its own but its lines, the room between what each holds, and its separators; what it holds draws itself. Every value a token:
|
|
4
|
+
|
|
5
|
+
.o-toolbar-line a line: the row (data-line="row"), the filter bar (data-line="bar"), 12 under the row, or a phone's
|
|
6
|
+
search on its own line (data-line="search"), above it
|
|
7
|
+
data-screen computer · phone the room between what a line holds; a phone's is one line
|
|
8
|
+
data-lines across · none a list's lines in bands with a line across under each, or not
|
|
9
|
+
--toolbar-spacing how far apart what a line holds stands, in spacing steps, when what holds it says so
|
|
10
|
+
--toolbar-inset the room at each side of each line, when what holds it gives one (0 unless said)
|
|
11
|
+
|
|
12
|
+
Each line is one line, never wrapping: what doesn't fit gives way (toolbar.tsx), and a text box gives some of its width. Its
|
|
13
|
+
width is its holder's to give: sized from what it holds in a pill (the bulk bar, the quick filters' reminder), given its width
|
|
14
|
+
as a list's toolbar, so it never contains its own (VK-882; ViewKit's ready toolbar, always a list's, contains its own). */
|
|
15
|
+
@layer components {
|
|
16
|
+
|
|
17
|
+
.o-toolbar { display: flex; flex-direction: column; align-items: stretch; gap: calc(var(--vk-spacing) * 3); box-sizing: border-box; min-width: 0; --toolbar-inset: 0; }
|
|
18
|
+
.o-toolbar-line { display: flex; align-items: center; flex-wrap: nowrap; min-width: 0; gap: calc(var(--vk-spacing) * var(--toolbar-spacing, 2)); padding-inline: var(--toolbar-inset); }
|
|
19
|
+
|
|
20
|
+
/* Lines across (data-lines="across", a computer's list, Attio's way; Mihai, 16 Nov 2026): each line its own band, a line across
|
|
21
|
+
under it the Toolbar's whole width, the room inside it 10 above and below. What holds the Toolbar gives its room at each side
|
|
22
|
+
(--toolbar-inset, a list's page edge), so the lines run edge to edge and what they hold stands in from them. None: the lines
|
|
23
|
+
12 apart, nothing between. */
|
|
24
|
+
.o-toolbar[data-lines="across"] { gap: 0; }
|
|
25
|
+
.o-toolbar[data-lines="across"] > .o-toolbar-line { padding-block: calc(var(--vk-spacing) * 2.5); border-bottom: var(--vk-border-width) solid var(--vk-border-subtle); }
|
|
26
|
+
/* On a phone the row a step closer (the map's phone row). */
|
|
27
|
+
.o-toolbar[data-screen="phone"] .o-toolbar-line { gap: calc(var(--vk-spacing) * var(--toolbar-spacing, 1.5)); }
|
|
28
|
+
|
|
29
|
+
/* What a line holds keeps its width; only a text box gives some up, from its own width down to its narrowest. */
|
|
30
|
+
.o-toolbar-line > * { flex: none; }
|
|
31
|
+
.o-toolbar-line > :is(.o-toolbar-input, .o-input-group:has(.o-toolbar-input)) { flex: 0 1 calc(var(--vk-spacing) * 55); min-width: calc(var(--vk-spacing) * 30); }
|
|
32
|
+
|
|
33
|
+
/* A list's search: on a phone's line of its own it fills it; open on a phone's one line it takes the room the others left. */
|
|
34
|
+
.o-toolbar .o-toolbar-line[data-line="search"] > :is(.o-toolbar-input, .o-input-group) { flex: 1 1 0; min-width: 0; }
|
|
35
|
+
.o-toolbar[data-screen="phone"] .o-toolbar-line > .o-input-group[data-open] { flex: 1 1 0; min-width: 0; }
|
|
36
|
+
|
|
37
|
+
/* A text box keeps its line's height (data-size, the height the line gives what it holds): under the phone switch the Input
|
|
38
|
+
stands 44 so iOS never zooms in, which in a line of 36 or 32 stood taller than the buttons beside it and pushed the line down
|
|
39
|
+
(Mihai, 16 Nov 2026). Its words stay 16 there; only its height is the line's, and its side (--input-side), which its smooth corner fits (KIT-619). A box in a group fills the
|
|
40
|
+
group. */
|
|
41
|
+
.o-toolbar-line[data-size="28"] > :is(.o-toolbar-input, .o-input-group).o-input { height: calc(var(--vk-spacing) * 7); --input-side: calc(var(--vk-spacing) * 7); }
|
|
42
|
+
.o-toolbar-line[data-size="32"] > :is(.o-toolbar-input, .o-input-group).o-input { height: calc(var(--vk-spacing) * 8); --input-side: calc(var(--vk-spacing) * 8); }
|
|
43
|
+
.o-toolbar-line[data-size="36"] > :is(.o-toolbar-input, .o-input-group).o-input { height: calc(var(--vk-spacing) * 9); --input-side: calc(var(--vk-spacing) * 9); }
|
|
44
|
+
.o-toolbar-line[data-size="44"] > :is(.o-toolbar-input, .o-input-group).o-input { height: calc(var(--vk-spacing) * 11); --input-side: calc(var(--vk-spacing) * 11); }
|
|
45
|
+
.o-toolbar-line > .o-input-group.o-input > .o-toolbar-input.o-input { height: auto; align-self: stretch; }
|
|
46
|
+
|
|
47
|
+
/* The search opens out of its button: the box grows from the button's place to its own width, or on a phone across the line,
|
|
48
|
+
rather than standing there at once. Still where the person asks for less motion. */
|
|
49
|
+
@media (prefers-reduced-motion: no-preference) {
|
|
50
|
+
.o-toolbar-line > .o-input-group[data-open] {
|
|
51
|
+
transition: flex-basis var(--vk-duration-base) var(--vk-ease-out), flex-grow var(--vk-duration-base) var(--vk-ease-out);
|
|
52
|
+
@starting-style { flex-basis: calc(var(--vk-spacing) * 8); flex-grow: 0; }
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
/* A separator: a line across the row, as tall as a Toolbar button's icon. */
|
|
57
|
+
.o-toolbar-sep { flex: none; align-self: center; width: var(--vk-border-width); height: calc(var(--vk-spacing) * 4); background-color: var(--vk-border); }
|
|
58
|
+
|
|
59
|
+
/* Room that pushes what follows to its line's far end. */
|
|
60
|
+
.o-toolbar-line > .o-toolbar-spacer { flex: 1 1 0; min-width: 0; align-self: stretch; }
|
|
61
|
+
|
|
62
|
+
/* A holder's own filters or view tabs (ToolbarFolds, KIT-858): a box keeping the whole width of what it holds, so the line measures it
|
|
63
|
+
as it draws, and folds them a step at a time. */
|
|
64
|
+
.o-toolbar-folds { display: inline-flex; flex: none; min-width: max-content; align-items: center; }
|
|
65
|
+
}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import type { ViewsTooltipProps } from "../../provider/components.js";
|
|
2
2
|
/** ViewKit's tooltip, drawn as the kit's Tooltip: what it names is its child itself, no element round it. */
|
|
3
|
-
export declare function MapTooltip({ content, children, side }: ViewsTooltipProps): import("react/jsx-runtime").JSX.Element;
|
|
3
|
+
export declare function MapTooltip({ content, children, side, align, delayMs, className }: ViewsTooltipProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { Tooltip } from "./tooltip.js";
|
|
3
|
-
export function MapTooltip({ content, children, side }) {
|
|
4
|
-
return _jsx(Tooltip, { label: content, side: side, children: children });
|
|
3
|
+
export function MapTooltip({ content, children, side, align, delayMs, className }) {
|
|
4
|
+
return _jsx(Tooltip, { label: content, side: side, align: align, delay: delayMs, className: className, children: children });
|
|
5
5
|
}
|
|
@@ -33,13 +33,15 @@ export interface TooltipProps {
|
|
|
33
33
|
disabled?: boolean;
|
|
34
34
|
/** How long the pointer rests on what it names before it shows, in ms: read from what it names unless said. */
|
|
35
35
|
delay?: number;
|
|
36
|
+
/** A class on the tooltip itself (its words' figures, say), after its own. */
|
|
37
|
+
className?: string;
|
|
36
38
|
/** What it names: one element that takes a ref (a Button). A button that is off keeps its focus and
|
|
37
39
|
* pointer for its reason (the Button's focusableWhenDisabled). */
|
|
38
40
|
children: React.ReactElement;
|
|
39
41
|
}
|
|
40
42
|
/** The name of a button that shows only an icon, or why something can't be used: on hover and on keyboard
|
|
41
43
|
* focus, and on a touch screen a reason on a tap on what's off. The button keeps its own aria-label; the tooltip is tied to it with aria-describedby. */
|
|
42
|
-
export declare function Tooltip({ label, keys, reason, side, align, sideOffset, alignOffset, open, defaultOpen, onOpenChange, disabled, delay, children }: TooltipProps): import("react/jsx-runtime").JSX.Element;
|
|
44
|
+
export declare function Tooltip({ label, keys, reason, side, align, sideOffset, alignOffset, open, defaultOpen, onOpenChange, disabled, delay, className, children }: TooltipProps): import("react/jsx-runtime").JSX.Element;
|
|
43
45
|
export interface TooltipGroupProps {
|
|
44
46
|
/** How long after one has shown the next shows at once, in ms: read off the first of its tooltips unless said. */
|
|
45
47
|
warm?: number;
|
|
@@ -12,7 +12,7 @@ function readMs(el, name, fallback) {
|
|
|
12
12
|
const GroupWarm = React.createContext(null);
|
|
13
13
|
const Box = ({ label, keys }) => _jsxs(_Fragment, { children: [label, keys && _jsx(Kbd, { keys: keys })] });
|
|
14
14
|
const gap = (trigger, popup) => (parseFloat(popup ? getComputedStyle(popup).getPropertyValue("--vk-spacing") : "") || 4) * (trigger?.closest('[data-tooltip-arrow="soft"]') ? 2.5 : 1.5);
|
|
15
|
-
export function Tooltip({ label, keys, reason, side = "top", align = "center", sideOffset, alignOffset = 0, open, defaultOpen, onOpenChange, disabled, delay, children }) {
|
|
15
|
+
export function Tooltip({ label, keys, reason, side = "top", align = "center", sideOffset, alignOffset = 0, open, defaultOpen, onOpenChange, disabled, delay, className, children }) {
|
|
16
16
|
const ref = React.useRef(null), popup = React.useRef(null), host = usePopupHost(ref), id = React.useId();
|
|
17
17
|
const [wait, setWait] = React.useState(TOOLTIP_TIMING.delay), tellWarm = React.useContext(GroupWarm);
|
|
18
18
|
React.useLayoutEffect(() => {
|
|
@@ -59,7 +59,7 @@ export function Tooltip({ label, keys, reason, side = "top", align = "center", s
|
|
|
59
59
|
return () => { document.removeEventListener("pointerdown", away, true); clearTimeout(timer); };
|
|
60
60
|
}, [shown, set]);
|
|
61
61
|
return (_jsxs(BaseTooltip.Root, { disabled: disabled, open: shown, onOpenChange: (o, details) => { if (!o && tapped.current && (details?.reason === "trigger-press" || details?.reason === "trigger-hover"))
|
|
62
|
-
return; set(o); }, children: [_jsx(BaseTooltip.Trigger, { ref: ref, render: children, className: "o-tooltip-trigger", delay: delay ?? wait, closeDelay: 0, "aria-describedby": id }), _jsx(BaseTooltip.Portal, { container: host, children: _jsx(BaseTooltip.Positioner, { className: "o-tooltip-positioner", side: side, align: align, alignOffset: alignOffset, sideOffset: () => sideOffset ?? gap(ref.current, popup.current), children: _jsxs(BaseTooltip.Popup, { ref: popup, id: id, className: cx("o-tooltip o-smooth o-smooth-ease", reason && "o-tooltip-reason"), "data-kit": "tooltip", children: [_jsx(Box, { label: label, keys: keys }), _jsx(BaseTooltip.Arrow, { className: "o-tooltip-arrow" })] }) }) })] }));
|
|
62
|
+
return; set(o); }, children: [_jsx(BaseTooltip.Trigger, { ref: ref, render: children, className: "o-tooltip-trigger", delay: delay ?? wait, closeDelay: 0, "aria-describedby": id }), _jsx(BaseTooltip.Portal, { container: host, children: _jsx(BaseTooltip.Positioner, { className: "o-tooltip-positioner", side: side, align: align, alignOffset: alignOffset, sideOffset: () => sideOffset ?? gap(ref.current, popup.current), children: _jsxs(BaseTooltip.Popup, { ref: popup, id: id, className: cx("o-tooltip o-smooth o-smooth-ease", reason && "o-tooltip-reason", className), "data-kit": "tooltip", children: [_jsx(Box, { label: label, keys: keys }), _jsx(BaseTooltip.Arrow, { className: "o-tooltip-arrow" })] }) }) })] }));
|
|
63
63
|
}
|
|
64
64
|
export function TooltipGroup({ warm, children }) {
|
|
65
65
|
const [read, setRead] = React.useState(TOOLTIP_TIMING.warm), first = React.useRef(false);
|
|
@@ -12,7 +12,7 @@ export const VALUES_EDITOR_LOOKS = {
|
|
|
12
12
|
options,
|
|
13
13
|
looks: [
|
|
14
14
|
{ id: "attio", name: "Attio", picks: { rows: "copy", main: "none", line: "plus", lists: "under", phone: "rows" } },
|
|
15
|
-
{ id: "mihai", name: "
|
|
15
|
+
{ id: "mihai", name: "Outright", picks: { rows: "fill", main: "pill", line: "icon", lists: "inplace", phone: "cards" } },
|
|
16
16
|
],
|
|
17
17
|
};
|
|
18
18
|
export const valuesEditorWornOf = (el) => lookWornOf(VALUES_EDITOR_LOOKS, el, ["rows", "main", "line", "lists", "phone"]);
|
|
@@ -19,6 +19,7 @@ import { cx } from "../../internal/cx.js";
|
|
|
19
19
|
import { moved, useReorder } from "../internal/reorder.js";
|
|
20
20
|
import { useShellHand } from "../internal/shell-hand.js";
|
|
21
21
|
import { spacingPx } from "../internal/read-token.js";
|
|
22
|
+
import { openerAt, useStepReturn } from "../internal/step-return.js";
|
|
22
23
|
import { EDITOR_INNER_ESCAPE } from "../../editors/inner-escape.js";
|
|
23
24
|
const ROW_28 = { "--inline-input-row": "calc(var(--vk-spacing) * 7)" };
|
|
24
25
|
const ROW_40 = { "--inline-input-row": "calc(var(--vk-spacing) * 10)" };
|
|
@@ -243,10 +244,15 @@ export function useValuesEditor(props) {
|
|
|
243
244
|
hold();
|
|
244
245
|
if (row != null)
|
|
245
246
|
setLabelOf(row);
|
|
247
|
+
if (phone && to === "rows")
|
|
248
|
+
requestAnimationFrame(() => { swapping.current = false; });
|
|
246
249
|
setView(to);
|
|
247
|
-
setFocusTo(to === "rows" ? (editing != null ? ".o-values-editor-edit input" : ".o-values-editor-line-input") : ".o-picker-input, [role='option']");
|
|
250
|
+
setFocusTo(to === "rows" ? (phone ? null : editing != null ? ".o-values-editor-edit input" : ".o-values-editor-line-input") : ".o-picker-input, [role='option']");
|
|
248
251
|
};
|
|
249
252
|
const back = () => go("rows");
|
|
253
|
+
const labelRow = labelOf != null ? rows[labelOf] : undefined;
|
|
254
|
+
useStepReturn(root, !phone ? [] : view === "label" && labelRow ? [openerAt(() => `[data-row="${CSS.escape(String(labelRow.id))}"] :is(.o-values-editor-label, .o-values-editor-edit-label)`)]
|
|
255
|
+
: view === "dial" ? [".o-values-editor-code"] : []);
|
|
250
256
|
const labelItems = [...labels, ...(labelOf != null && rows[labelOf]?.label && !labels.includes(rows[labelOf].label) ? [rows[labelOf].label] : [])].map((l) => ({ value: l, label: l }));
|
|
251
257
|
const setLabel = (l) => { if (typeof l === "string" && labelOf != null)
|
|
252
258
|
setRows((rs) => rs.map((r, i) => (i === labelOf ? { ...r, label: l } : r))); };
|
|
@@ -1,19 +1,22 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import { type ViewsMessageResolver } from "../../contract.js";
|
|
3
3
|
import type { ViewsViewsListBodyProps, ViewsViewsListItem } from "../../provider/components.js";
|
|
4
|
+
import type { ViewMenuWords } from "./words.js";
|
|
4
5
|
import { type ViewsListProps } from "./views-list.js";
|
|
5
6
|
import type { ViewsListWords } from "./words.js";
|
|
6
7
|
type AppIcon = React.ComponentType<{
|
|
7
8
|
name: string;
|
|
8
9
|
className?: string;
|
|
9
10
|
}>;
|
|
10
|
-
/** The views list's words in the app's messages: ViewKit's own list's keys, the Picker's, and New view the axis's own word. */
|
|
11
|
+
/** The views list's words in the app's messages: ViewKit's own list's keys, the Picker's, a view's menu's, and New view the axis's own word. */
|
|
11
12
|
export declare function viewsListWordsOf(say: ViewsMessageResolver, createLabel?: string): ViewsListWords;
|
|
12
13
|
/** The block an order changed, the shared views or the reader's own, in its new order; null when neither changed, or when a
|
|
13
14
|
* view whose place in it changed is one `canDrag` refuses. */
|
|
14
15
|
export declare function orderToWrite(views: readonly Pick<ViewsViewsListItem, "value" | "private">[], order: string[], canDrag?: (value: string) => boolean): string[] | null;
|
|
15
16
|
/** The slot's props as the views list's. */
|
|
16
17
|
export declare function viewsListPropsOf(p: ViewsViewsListBodyProps, words: ViewsListWords, notNow: string, AppIcon?: AppIcon): ViewsListProps;
|
|
18
|
+
/** A view's menu's words in the app's messages. */
|
|
19
|
+
export declare function viewMenuWordsOf(say: ViewsMessageResolver): ViewMenuWords;
|
|
17
20
|
/** ViewKit's views list body, drawn as the views list. */
|
|
18
21
|
export declare function MapViewsListBody(props: ViewsViewsListBodyProps): import("react/jsx-runtime").JSX.Element;
|
|
19
22
|
export {};
|
|
@@ -1,11 +1,19 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsx as _jsx, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
3
|
import * as React from "react";
|
|
4
4
|
import { resolveViewsMessage } from "../../contract.js";
|
|
5
5
|
import { ViewsContext } from "../../provider/context.js";
|
|
6
|
+
import { HeaderBar } from "../phone-header/header-bar.js";
|
|
7
|
+
import { useToldStep } from "../internal/told-step.js";
|
|
8
|
+
import { useViewMenu } from "./view-menu.js";
|
|
9
|
+
import { MENU_LIST_CARD_FRAME } from "../menu-list/looks.js";
|
|
10
|
+
import { MenuList, tilesOf, useMenuListOption, useMenuListRows } from "../menu-list/menu-list.js";
|
|
6
11
|
import { menuEntries } from "../menu/map-menu.js";
|
|
7
|
-
import { pickerWordsOf } from "../picker/map-picker.js";
|
|
12
|
+
import { menuWordsOf, pickerWordsOf } from "../picker/map-picker.js";
|
|
8
13
|
import { useViewsList } from "./views-list.js";
|
|
14
|
+
import { SheetButton } from "../sheet/bottom-sheet.js";
|
|
15
|
+
import { SheetPartsFrom } from "../sheet/sheet-parts.js";
|
|
16
|
+
import { Icon } from "../internal/icons.js";
|
|
9
17
|
export function viewsListWordsOf(say, createLabel) {
|
|
10
18
|
return {
|
|
11
19
|
label: say({ key: "views.panels.views-list" }),
|
|
@@ -16,6 +24,7 @@ export function viewsListWordsOf(say, createLabel) {
|
|
|
16
24
|
justMe: say({ key: "views.panels.views-personal" }),
|
|
17
25
|
none: say({ key: "views.panels.views-none" }),
|
|
18
26
|
picker: pickerWordsOf(say),
|
|
27
|
+
menu: menuWordsOf(say),
|
|
19
28
|
};
|
|
20
29
|
}
|
|
21
30
|
export function orderToWrite(views, order, canDrag) {
|
|
@@ -57,9 +66,124 @@ export function viewsListPropsOf(p, words, notNow, AppIcon) {
|
|
|
57
66
|
words,
|
|
58
67
|
};
|
|
59
68
|
}
|
|
69
|
+
export function viewMenuWordsOf(say) {
|
|
70
|
+
return {
|
|
71
|
+
rename: say({ key: "views.panels.view-rename" }),
|
|
72
|
+
renameShort: say({ key: "views.panels.view-rename-short" }),
|
|
73
|
+
edit: say({ key: "views.panels.view-edit" }),
|
|
74
|
+
privateView: say({ key: "views.panels.view-private-toggle" }),
|
|
75
|
+
saveEveryone: say({ key: "views.panels.view-save-everyone" }),
|
|
76
|
+
reset: say({ key: "views.panels.view-reset" }),
|
|
77
|
+
saveNew: say({ key: "views.panels.view-save-new" }),
|
|
78
|
+
copyLink: say({ key: "views.panels.copy-link" }),
|
|
79
|
+
copyLinkShort: say({ key: "views.panels.view-copy-link-short" }),
|
|
80
|
+
favorite: say({ key: "views.panels.view-favorite" }),
|
|
81
|
+
unfavorite: say({ key: "views.panels.view-unfavorite" }),
|
|
82
|
+
duplicate: say({ key: "views.panels.view-duplicate" }),
|
|
83
|
+
duplicateShort: say({ key: "views.panels.view-duplicate-short" }),
|
|
84
|
+
delete: say({ key: "views.panels.view-delete" }),
|
|
85
|
+
keepOne: say({ key: "views.panels.view-keep-one" }),
|
|
86
|
+
unsaved: say({ key: "views.panels.view-unsaved" }),
|
|
87
|
+
thisView: say({ key: "views.panels.view-this" }),
|
|
88
|
+
renameTitle: say({ key: "views.panels.view-rename-title" }),
|
|
89
|
+
save: say({ key: "views.panels.view-save" }),
|
|
90
|
+
newView: say({ key: "views.panels.view-create" }),
|
|
91
|
+
createView: say({ key: "views.panels.view-create-action" }),
|
|
92
|
+
layout: say({ key: "views.panels.layout" }),
|
|
93
|
+
name: say({ key: "views.panels.view-name" }),
|
|
94
|
+
cancel: say({ key: "views.picker.cancel" }),
|
|
95
|
+
close: say({ key: "views.panels.close" }),
|
|
96
|
+
failed: say({ key: "views.panels.alert-failed" }),
|
|
97
|
+
tryAgain: say({ key: "views.picker.retry" }),
|
|
98
|
+
deleteTitle: (name) => say({ key: "views.panels.view-delete-title", values: { name } }),
|
|
99
|
+
deleted: (name) => say({ key: "views.panels.view-deleted", values: { name } }),
|
|
100
|
+
copyOf: (name) => say({ key: "views.panels.view-copy-name", values: { name } }),
|
|
101
|
+
stay: (records) => say({ key: "views.panels.view-delete-stays", values: { records } }),
|
|
102
|
+
goes: say({ key: "views.panels.view-delete-goes" }),
|
|
103
|
+
columns: (layout) => say({ key: "views.panels.view-columns", values: { layout } }),
|
|
104
|
+
};
|
|
105
|
+
}
|
|
60
106
|
export function MapViewsListBody(props) {
|
|
107
|
+
return props.verbs ? _jsx(WithVerbs, { ...props, verbs: props.verbs }) : _jsx(Plain, { ...props });
|
|
108
|
+
}
|
|
109
|
+
const _menuChangeIsTheSlots = true;
|
|
110
|
+
const _menuAskIsTheConfirmPort = true;
|
|
111
|
+
void _menuChangeIsTheSlots;
|
|
112
|
+
void _menuAskIsTheConfirmPort;
|
|
113
|
+
function useStepHead(step, props) {
|
|
114
|
+
useToldStep({ head: { ...(step ? { onBack: step.onBack } : {}) }, ...(step ? { title: step.title } : {}) }, props.onStepChange);
|
|
115
|
+
const setParts = React.useContext(SheetPartsFrom);
|
|
116
|
+
React.useLayoutEffect(() => { setParts?.(step ? { title: step.title, head: { onBack: step.onBack } } : null); });
|
|
117
|
+
React.useLayoutEffect(() => () => setParts?.(null), [setParts]);
|
|
118
|
+
return step && props.actions?.back && !setParts ? (_jsx("div", { className: "o-sheet-head", "data-slot": "vk-views-list-head", children: _jsx(HeaderBar, { className: "o-sheet-row", "data-sides": "", title: _jsx("h2", { className: "o-sheet-title", children: step.title }), right: _jsx("span", {}), left: _jsx(SheetButton, { "aria-label": props.actions.back.label, className: "o-sheet-back", icon: _jsx(Icon, { name: "left" }), onClick: props.actions.back.onPress }) }) })) : null;
|
|
119
|
+
}
|
|
120
|
+
function Plain(props) {
|
|
61
121
|
const context = React.useContext(ViewsContext);
|
|
62
122
|
const say = context?.messages ?? resolveViewsMessage;
|
|
63
|
-
const words = React.useMemo(() => viewsListWordsOf(say, props.createLabel), [say, props.createLabel]);
|
|
64
|
-
|
|
123
|
+
const words = React.useMemo(() => ({ ...viewsListWordsOf(say, props.createLabel), back: say({ key: "views.panels.back" }) }), [say, props.createLabel]);
|
|
124
|
+
const base = viewsListPropsOf(props, words, say({ key: "views.menus.not-now" }), context?.components.AppIcon);
|
|
125
|
+
const [menuFor, setMenuFor] = React.useState(null);
|
|
126
|
+
const [mark, setMark] = React.useState(null);
|
|
127
|
+
const closeShown = useMenuListOption(mark, "close"), rowsAre = useMenuListRows(mark), closeRow = closeShown === "shown" && rowsAre !== "words";
|
|
128
|
+
const shown = props.form === "phone" ? props.views.find((v) => v.value === menuFor) : undefined;
|
|
129
|
+
const step = shown ? {
|
|
130
|
+
title: shown.label, onBack: () => setMenuFor(null),
|
|
131
|
+
body: _jsx("div", { style: { display: "contents" }, ...MENU_LIST_CARD_FRAME, children: _jsx(MenuList, { label: shown.label, ...tilesOf(leavingFirst(base.entries(shown.value), () => setMenuFor(null))), ...(closeRow ? { onClose: () => setMenuFor(null) } : {}), closeWord: words.menu?.close ?? say({ key: "views.panels.close" }) }) }),
|
|
132
|
+
} : null;
|
|
133
|
+
const list = useViewsList({ ...base, onMenu: setMenuFor, step });
|
|
134
|
+
const head = useStepHead(step, props);
|
|
135
|
+
return _jsxs(_Fragment, { children: [_jsx("span", { ref: setMark, hidden: true }), head, list.body] });
|
|
136
|
+
}
|
|
137
|
+
function leavingFirst(list, leave) {
|
|
138
|
+
return list.map((e) => e.kind === undefined || e.kind === "action" ? { ...e, onSelect: () => { leave(); e.onSelect?.(); } } : e.kind === "group" ? { ...e, entries: leavingFirst(e.entries, leave) } : e);
|
|
139
|
+
}
|
|
140
|
+
function WithVerbs(props) {
|
|
141
|
+
const { verbs } = props;
|
|
142
|
+
const context = React.useContext(ViewsContext);
|
|
143
|
+
const say = context?.messages ?? resolveViewsMessage;
|
|
144
|
+
const AppIcon = context?.components.AppIcon;
|
|
145
|
+
const words = React.useMemo(() => ({ ...viewsListWordsOf(say, props.createLabel), back: say({ key: "views.panels.back" }) }), [say, props.createLabel]);
|
|
146
|
+
const menuWords = React.useMemo(() => viewMenuWordsOf(say), [say]);
|
|
147
|
+
const base = viewsListPropsOf(props, words, say({ key: "views.menus.not-now" }), AppIcon);
|
|
148
|
+
const layouts = [
|
|
149
|
+
...verbs.layouts.map((l) => ({ id: l.id, name: l.name, line: l.line, ...(l.columns ? { columns: true } : {}), mark: AppIcon ? _jsx(AppIcon, { name: l.icon }) : null })),
|
|
150
|
+
...base.layouts.filter((l) => !verbs.layouts.some((v) => v.id === l.id)),
|
|
151
|
+
];
|
|
152
|
+
const views = props.views.map((v) => ({
|
|
153
|
+
id: v.value, name: v.label, layout: v.layout ?? v.icon ?? "",
|
|
154
|
+
...(v.private ? { private: true } : {}), ...(v.favorite ? { favorite: true } : {}), ...(v.changed ? { changed: true } : {}),
|
|
155
|
+
...(typeof v.count === "number" ? { count: v.count } : {}),
|
|
156
|
+
}));
|
|
157
|
+
const ports = context?.ports;
|
|
158
|
+
const computer = props.form === "computer";
|
|
159
|
+
const menu = useViewMenu({
|
|
160
|
+
views, open: props.value, layouts,
|
|
161
|
+
...(verbs.columns ? { columns: { fields: verbs.columns.fields.map((f) => ({ value: f.value, label: f.label })), value: verbs.columns.value } } : {}),
|
|
162
|
+
records: verbs.records,
|
|
163
|
+
onChange: (c) => {
|
|
164
|
+
if (c.kind === "open")
|
|
165
|
+
props.onViewChange(c.id);
|
|
166
|
+
else if (c.kind === "order") {
|
|
167
|
+
const block = orderToWrite(props.views, c.ids, props.canDrag);
|
|
168
|
+
if (block)
|
|
169
|
+
props.onReorder?.(block);
|
|
170
|
+
}
|
|
171
|
+
else
|
|
172
|
+
verbs.onChange(c);
|
|
173
|
+
},
|
|
174
|
+
onDone: props.onDone, form: props.form, steps: true, words: menuWords,
|
|
175
|
+
...(computer && ports && !context.confirmFallback ? { ask: async (request) => {
|
|
176
|
+
props.onHold?.(true);
|
|
177
|
+
try {
|
|
178
|
+
return await ports.confirm(request);
|
|
179
|
+
}
|
|
180
|
+
finally {
|
|
181
|
+
requestAnimationFrame(() => props.onHold?.(false));
|
|
182
|
+
}
|
|
183
|
+
} } : {}),
|
|
184
|
+
...(ports && !context.toastFallback ? { report: (message, options) => ports.toast.success(message, options) } : {}),
|
|
185
|
+
});
|
|
186
|
+
const list = useViewsList({ ...base, layouts, views, entries: menu.entries, ...(props.onCreate ? { onNew: () => menu.startNew() } : {}), onMenu: menu.openMenu, step: menu.step });
|
|
187
|
+
const head = useStepHead(menu.step, props);
|
|
188
|
+
return _jsxs(_Fragment, { children: [head, list.body, menu.dialogs] });
|
|
65
189
|
}
|
|
@@ -70,3 +70,29 @@ export type ViewsListChange = {
|
|
|
70
70
|
export declare const SHARED = "Shared", JUST_ME = "Just me";
|
|
71
71
|
/** The views as the list shows them: as they are; with private views on, the shared ones, then the private ones, each in its order. */
|
|
72
72
|
export declare function listed(views: ListView[], privateViews: boolean): ListView[];
|
|
73
|
+
/** The views and the one open. */
|
|
74
|
+
export interface ViewsState {
|
|
75
|
+
views: ListView[];
|
|
76
|
+
open: string;
|
|
77
|
+
}
|
|
78
|
+
/** A copy's name: "Copy of <name>", then "Copy of <name> 2", 3… while the name is taken. `copyOf`: the words, given the name. */
|
|
79
|
+
export declare function copyName(name: string, names: string[], copyOf?: (name: string) => string): string;
|
|
80
|
+
/** Whether a view can be deleted: a list keeps one view. */
|
|
81
|
+
export declare const canDelete: (views: ListView[]) => boolean;
|
|
82
|
+
/** The delete question's line's words: the records staying, given their noun, and the view going for everyone. */
|
|
83
|
+
export type DeleteLineWords = {
|
|
84
|
+
stay: (records: string) => string;
|
|
85
|
+
goes: string;
|
|
86
|
+
};
|
|
87
|
+
/** The delete question's line: the view goes for everyone who uses it (a private view only for its maker), and the records stay. */
|
|
88
|
+
export declare function deleteLine(view: ListView, records: string, words?: DeleteLineWords): string;
|
|
89
|
+
/** The label of the field a layout's columns follow, after the layout's name ("Board columns"). */
|
|
90
|
+
export declare const columnsLabel: (layoutName: string, words?: (layoutName: string) => string) => string;
|
|
91
|
+
/** The views and the open one after a change. `newId` names the view a change makes (create, duplicate): with none, they make
|
|
92
|
+
* nothing. `privateViews` says how the list stands its views, for the first listed. `copyOf`: a duplicate's name's words. What
|
|
93
|
+
* changes nothing hands back the same state. */
|
|
94
|
+
export declare function viewsAfter(state: ViewsState, change: ViewsListChange, o?: {
|
|
95
|
+
newId?: string;
|
|
96
|
+
privateViews?: boolean;
|
|
97
|
+
copyOf?: (name: string) => string;
|
|
98
|
+
}): ViewsState;
|
|
@@ -2,3 +2,66 @@ export const SHARED = "Shared", JUST_ME = "Just me";
|
|
|
2
2
|
export function listed(views, privateViews) {
|
|
3
3
|
return privateViews ? [...views.filter((v) => !v.private), ...views.filter((v) => v.private)] : views;
|
|
4
4
|
}
|
|
5
|
+
export function copyName(name, names, copyOf = (n) => `Copy of ${n}`) {
|
|
6
|
+
const base = copyOf(name), taken = new Set(names);
|
|
7
|
+
if (!taken.has(base))
|
|
8
|
+
return base;
|
|
9
|
+
let n = 2;
|
|
10
|
+
while (taken.has(`${base} ${n}`))
|
|
11
|
+
n++;
|
|
12
|
+
return `${base} ${n}`;
|
|
13
|
+
}
|
|
14
|
+
export const canDelete = (views) => views.length > 1;
|
|
15
|
+
const DELETE_LINE = { stay: (records) => `The ${records} in it stay as they are.`, goes: "The view goes for everyone who uses it." };
|
|
16
|
+
export function deleteLine(view, records, words = DELETE_LINE) {
|
|
17
|
+
const stay = words.stay(records);
|
|
18
|
+
return view.private ? stay : `${words.goes} ${stay}`;
|
|
19
|
+
}
|
|
20
|
+
export const columnsLabel = (layoutName, words = (l) => `${l} columns`) => words(layoutName);
|
|
21
|
+
const set = (views, id, change) => views.map((v) => (v.id === id ? { ...v, ...change } : v));
|
|
22
|
+
const has = (views, id) => views.some((v) => v.id === id);
|
|
23
|
+
export function viewsAfter(state, change, o = {}) {
|
|
24
|
+
const { views, open } = state;
|
|
25
|
+
switch (change.kind) {
|
|
26
|
+
case "open": return has(views, change.id) ? { views, open: change.id } : state;
|
|
27
|
+
case "order": {
|
|
28
|
+
const by = new Map(views.map((v) => [v.id, v])), first = change.ids.flatMap((id) => (by.has(id) ? [by.get(id)] : []));
|
|
29
|
+
return { views: [...first, ...views.filter((v) => !change.ids.includes(v.id))], open };
|
|
30
|
+
}
|
|
31
|
+
case "rename": {
|
|
32
|
+
const name = change.name.trim();
|
|
33
|
+
return name && has(views, change.id) ? { views: set(views, change.id, { name }), open } : state;
|
|
34
|
+
}
|
|
35
|
+
case "create": {
|
|
36
|
+
const name = change.name.trim();
|
|
37
|
+
if (!o.newId || !name)
|
|
38
|
+
return state;
|
|
39
|
+
const from = change.from && has(views, change.from) ? set(views, change.from, { changed: false }) : views;
|
|
40
|
+
return { views: [...from, { id: o.newId, name, layout: change.layout }], open: o.newId };
|
|
41
|
+
}
|
|
42
|
+
case "duplicate": {
|
|
43
|
+
const at = views.findIndex((v) => v.id === change.id);
|
|
44
|
+
if (!o.newId || at < 0)
|
|
45
|
+
return state;
|
|
46
|
+
const copy = { ...views[at], id: o.newId, name: copyName(views[at].name, views.map((v) => v.name), o.copyOf), changed: false, favorite: false };
|
|
47
|
+
return { views: [...views.slice(0, at + 1), copy, ...views.slice(at + 1)], open: o.newId };
|
|
48
|
+
}
|
|
49
|
+
case "delete": {
|
|
50
|
+
if (!canDelete(views) || !has(views, change.id))
|
|
51
|
+
return state;
|
|
52
|
+
const rest = views.filter((v) => v.id !== change.id);
|
|
53
|
+
return { views: rest, open: open === change.id ? listed(rest, !!o.privateViews)[0].id : open };
|
|
54
|
+
}
|
|
55
|
+
case "restore": {
|
|
56
|
+
if (has(views, change.view.id))
|
|
57
|
+
return state;
|
|
58
|
+
const at = Math.max(0, Math.min(change.at, views.length));
|
|
59
|
+
return { views: [...views.slice(0, at), change.view, ...views.slice(at)], open: change.open ? change.view.id : open };
|
|
60
|
+
}
|
|
61
|
+
case "save":
|
|
62
|
+
case "reset": return has(views, change.id) ? { views: set(views, change.id, { changed: false }), open } : state;
|
|
63
|
+
case "favorite": return has(views, change.id) ? { views: set(views, change.id, { favorite: change.on }), open } : state;
|
|
64
|
+
case "private": return has(views, change.id) ? { views: set(views, change.id, { private: change.on }), open } : state;
|
|
65
|
+
default: return state;
|
|
66
|
+
}
|
|
67
|
+
}
|