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,21 @@
|
|
|
1
|
+
export const GROUP_EDITOR_WORDS = {
|
|
2
|
+
groupBy: "Group by",
|
|
3
|
+
order: "Order",
|
|
4
|
+
direction: "Direction",
|
|
5
|
+
dateStep: "Date step",
|
|
6
|
+
ascending: "Ascending",
|
|
7
|
+
descending: "Descending",
|
|
8
|
+
name: "Name",
|
|
9
|
+
count: "Count",
|
|
10
|
+
own: "Your own",
|
|
11
|
+
ownNoDirection: "Your own order has no direction",
|
|
12
|
+
hideEmpty: "Hide empty groups",
|
|
13
|
+
groups: "Groups",
|
|
14
|
+
hideAll: "Hide all",
|
|
15
|
+
showAll: "Show all",
|
|
16
|
+
remove: "Remove grouping",
|
|
17
|
+
none: "None",
|
|
18
|
+
search: "Search fields",
|
|
19
|
+
noValue: "No value",
|
|
20
|
+
};
|
|
21
|
+
export const groupWords = (given) => (given ? { ...GROUP_EDITOR_WORDS, ...given } : GROUP_EDITOR_WORDS);
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/* The group editor: a body (KIT-671; ViewKit's since VK-839), as the toolbar's map draws it (step 3, parts 57 and 58) on the canvas's round 12. Every value
|
|
2
|
+
is a public --vk-* name (group-editor/tokens.ts); this file only lays out its own parts: its blocks one under another, and the groups' heading with Hide
|
|
3
|
+
all at its end. The kit's components inside it (the Menu list's rows, the Picker, the Button) are drawn by their own files, as they
|
|
4
|
+
are. On a computer it stands in the Pane's body; on a phone (data-group-form="phone") in the Sheet's body, a step of it.
|
|
5
|
+
The rules sit in the components layer, so a utility class still wins. */
|
|
6
|
+
@layer components {
|
|
7
|
+
|
|
8
|
+
/* ── What it holds, one under another ── */
|
|
9
|
+
.o-group-editor, .o-group-editor-step { display: flex; flex-direction: column; gap: calc(var(--vk-spacing) * 1); min-width: 0; }
|
|
10
|
+
.o-group-editor[data-group-form="phone"], .o-group-editor[data-group-form="phone"] .o-group-editor-step { gap: calc(var(--vk-spacing) * 3); }
|
|
11
|
+
|
|
12
|
+
/* ── The groups' heading, Hide all at its end ── */
|
|
13
|
+
.o-group-editor-heading { display: flex; align-items: center; justify-content: space-between; gap: calc(var(--vk-spacing) * 2); margin-top: calc(var(--vk-spacing) * 1); padding-right: calc(var(--vk-spacing) * 2); }
|
|
14
|
+
.o-group-editor-heading > .o-list-heading { flex: 1; min-width: 0; }
|
|
15
|
+
[data-group-form="phone"] .o-group-editor-heading { margin-top: calc(var(--vk-spacing) * 2); padding: 0 calc(var(--vk-spacing) * 1); }
|
|
16
|
+
[data-group-form="phone"] .o-group-editor-heading > .o-list-heading { padding: 0; font-size: var(--vk-font-size-sm); line-height: calc(var(--vk-font-size-sm) * var(--vk-line-height-sm)); }
|
|
17
|
+
|
|
18
|
+
/* ── Group by's fields, the Picker standing in its place ── */
|
|
19
|
+
.o-group-editor-fields { display: flex; flex-direction: column; min-width: 0; }
|
|
20
|
+
}
|
|
@@ -40,7 +40,7 @@ export { GRIP, GRIP_LOOK, Grip } from "./grip/grip.js";
|
|
|
40
40
|
export { useHoldDrag, type HoldDragProps, type HoldReads } from "./internal/hold.js";
|
|
41
41
|
export { dragAt, gapOf, moved, useReorder, type ReorderDrag, type RowEdges } from "./internal/reorder.js";
|
|
42
42
|
export { rowFor, rowStarting } from "./menu-list/keys.js";
|
|
43
|
-
export { MenuList, MenuListPanelRows, MenuListRow, MenuListRows, MenuListShown, MenuScroll, menuListCloseOf, menuListRowsOf, sheetFormOf, tilesOf, useMenuListOption, useMenuListRows, type MenuChoice, type MenuEntry, type MenuListEntry, type MenuListPanelRowsProps, type MenuListProps, type MenuListTile, } from "./menu-list/menu-list.js";
|
|
43
|
+
export { MENU_LIST_WORDS, MenuList, MenuListPanelRows, MenuListRow, MenuListRows, MenuListShown, MenuScroll, menuListCloseOf, menuListRowsOf, sheetFormOf, tilesOf, useMenuListOption, useMenuListRows, type MenuChoice, type MenuEntry, type MenuListEntry, type MenuListPanelRowsProps, type MenuListProps, type MenuListTile, type MenuListWords, } from "./menu-list/menu-list.js";
|
|
44
44
|
export { COMPUTER_HOST, ComputerHost, PHONE_MARK, PhoneHost, PhoneLine, phoneMark, usePhone, usePhoneForm } from "./internal/phone.js";
|
|
45
45
|
export { drawnAt, focusWhereItStands, focusesInPlace, holdsThePage, keepsToItsList, overflows, scaleOf, scrollInList, scrollTopFor, scrollTopForDrag, staysInView, tapsInPlace, typesInto, } from "./internal/scroll.js";
|
|
46
46
|
export { ContextMenu, Menu, MenuDots, useSheetMenus, type MenuChangeDetails, type MenuProps, type MenuWords, } from "./menu/menu.js";
|
|
@@ -53,11 +53,51 @@ export { Select, SelectShown, toPickerItems, type SelectAloneProps, type SelectI
|
|
|
53
53
|
export { listSide, type ListSide } from "./select/side.js";
|
|
54
54
|
export { chipsThatFit } from "./select/fit.js";
|
|
55
55
|
export { filledMatch } from "./select/filled.js";
|
|
56
|
+
export { Pane, PaneBody, PaneClose, PaneFoot, PaneHead, PaneTitle, paneAfter, usePane, type PaneChangeDetails, type PaneCloseReason, type PanePress, type PaneProps, type PaneState } from "./pane/pane.js";
|
|
57
|
+
export { InToolbar, ToolbarButtonControl, useToolbarButtonWorn, type ToolbarButtonGround, type ToolbarButtonProps, type ToolbarButtonSize, type ToolbarButtonSmoothing, type ToolbarButtonWords, } from "./toolbar-button/toolbar-button.js";
|
|
56
58
|
export { Radio, RadioGroup, type RadioGroupProps, type RadioProps } from "./radio/radio.js";
|
|
59
|
+
export { sortableFields, useSortEditor as useSortEditorParts, type SortEditorOpens, type SortEditorParts, type SortEditorProps } from "./sort-editor/sort-editor.js";
|
|
60
|
+
export { SORT_MAX, addSort, canAddSort, dropAside, openPlaces, putBack, repoint, sortLabel, sortedFields, takenBy, type FieldOf, type SortAside } from "./sort-editor/rules.js";
|
|
61
|
+
export { SORT_EDITOR_WORDS, sortWords, type SortEditorWords } from "./sort-editor/words.js";
|
|
57
62
|
export { LOCK, useViewsList, useViewsListWorn, ViewsList, type ViewsListParts } from "./views-list/views-list.js";
|
|
58
|
-
export { JUST_ME, listed, SHARED, type ListView, type ViewsListChange, type ViewsListLayout } from "./views-list/rules.js";
|
|
63
|
+
export { canDelete, columnsLabel, copyName, deleteLine, JUST_ME, listed, SHARED, viewsAfter, type DeleteLineWords, type ListView, type ViewsListChange, type ViewsListLayout, type ViewsState } from "./views-list/rules.js";
|
|
59
64
|
export { VIEWS_LIST_ATTRS, viewsListWornOf, type ViewsListWorn } from "./views-list/looks.js";
|
|
60
|
-
export { VIEWS_LIST_WORDS, viewsListWords, type ViewsListWords } from "./views-list/words.js";
|
|
65
|
+
export { VIEW_MENU_WORDS, VIEWS_LIST_WORDS, viewsListWords, type ViewMenuWords, type ViewsListWords } from "./views-list/words.js";
|
|
66
|
+
export { useViewMenu, type ViewMenuAsk, type ViewMenuParts, type ViewMenuProps, type ViewMenuShows, type ViewMenuStep } from "./views-list/view-menu.js";
|
|
67
|
+
export { useFilterEditor as useFilterEditorParts, type FilterEditorParts, type FilterEditorProps, type FilterOwn } from "./filter-editor/filter-editor.js";
|
|
68
|
+
export { FILTER_SEARCH, FilterPartBody, PairValue, valuePlaceholder, type FilterPart, type FilterPartProps } from "./filter-editor/parts.js";
|
|
69
|
+
export { CHECKED, HOW, wayOf, type FilterField, type FilterWay, type Takes } from "./filter-editor/how.js";
|
|
70
|
+
export { FILTER_DEPTH, NO_FILTER, OWN_WAY, addRule, barOf, canGroup, changeRule, clearAll, depthOf, fieldOf, idsOf, isAdvanced, isGroup, isOwnWay, isPair, isSetAside, isWhole, itemOf, removeRule, ruleText, rulesOf, setGroup, setJoin, takesOf, toAdvanced, toGroup, valueText, type BarFilter, type FilterAside } from "./filter-editor/rules.js";
|
|
71
|
+
export { FILTER_EDITOR_WORDS, filterWords, type FilterEditorWords } from "./filter-editor/words.js";
|
|
72
|
+
export { useGroupEditor, type GroupEditorLevel, type GroupEditorParts, type GroupEditorProps, type GroupEditorValue } from "./group-editor/group-editor.js";
|
|
73
|
+
export { directionTurns, groupLabel, groupOrders, hideAllGroups, moveGroup, noneShown, orderedGroups, setGroupShown, showAllGroups, startGroup, type GroupDirection, type GroupOrder, type GroupValue } from "./group-editor/rules.js";
|
|
74
|
+
export { GROUP_EDITOR_WORDS, groupWords, type GroupEditorWords } from "./group-editor/words.js";
|
|
75
|
+
export { layoutMark, useCustomize, useCustomizeWorn, type CustomizeChoice, type CustomizeLayout, type CustomizeLayoutSettings, type CustomizeParts, type CustomizeProps, type CustomizeScreen, type CustomizeSection, type CustomizeToggle, type CustomizeView } from "./customize/customize.js";
|
|
76
|
+
export { columnsSay, findColumns, hideAll, moveColumn, setShown, showAll, type CustomizeColumn } from "./customize/rules.js";
|
|
77
|
+
export { reduced, slideTime, useGlide } from "./customize/glide.js";
|
|
78
|
+
export { CUSTOMIZE_ATTRS, customizeWornOf, type CustomizeWorn } from "./customize/looks.js";
|
|
79
|
+
export { CUSTOMIZE_WORDS, customizeWords, type CustomizeWords } from "./customize/words.js";
|
|
80
|
+
export type { CustomizeBodyOwn } from "./customize/map-customize-body.js";
|
|
81
|
+
export { SheetPartsFrom, type SheetParts } from "./sheet/sheet-parts.js";
|
|
82
|
+
export { MODAL_WORDS, Modal, type ModalAction, type ModalFoot, type ModalProps, type ModalSize, type ModalState, type ModalWords } from "./modal/modal.js";
|
|
83
|
+
export { ALERT_DIALOG_WORDS, AlertDialog, AlertDialogHost, AlertDialogPanel, confirm, type AlertDialogPanelProps, type AlertDialogProps, type AlertDialogWords } from "./alert-dialog/alert-dialog.js";
|
|
84
|
+
export { TOAST_WORDS, Toast, ToastShown, createToastManager, useToast, type ToastManager, type ToastOptions, type ToastWords } from "./toast/toast.js";
|
|
85
|
+
export { Collapsible, CollapsiblePanel, CollapsibleTrigger, type CollapsiblePanelProps, type CollapsibleProps, type CollapsibleTriggerProps } from "./collapsible/collapsible.js";
|
|
86
|
+
export { ALERT_WORDS, Alert, type AlertAsk, type AlertKind, type AlertProps, type AlertState, type AlertWords } from "./alert/alert.js";
|
|
87
|
+
export { NOTICE_ICONS, NOTICE_WORDS, Notice, type NoticeAction, type NoticeMeaning, type NoticeProps, type NoticeWords } from "./notice/notice.js";
|
|
88
|
+
export { QuickFilters, type QuickField, type QuickFiltersProps, type QuickHolding, type QuickHolds, type QuickMark, type QuickPress, type QuickValue } from "./quick-filters/quick-filters.js";
|
|
89
|
+
export { QUICK_FILTERS_RULES } from "./quick-filters/rules.js";
|
|
90
|
+
export { QUICK_FILTERS_ATTRS, quickFiltersWornOf } from "./quick-filters/looks.js";
|
|
91
|
+
export { QUICK_FILTERS_WORDS, quickFiltersWords, type QuickFiltersWords } from "./quick-filters/words.js";
|
|
92
|
+
export { quickFiltersFieldsOf, quickHoldsOf, quickListHoldOf, type QuickFiltersFieldIn } from "./quick-filters/map-quick-filters-body.js";
|
|
93
|
+
export { ToolbarControl, ToolbarFolds, ToolbarInput, ToolbarSeparatorControl, ToolbarSpacer, toolbarSteps, useToolbarWorn, type ToolbarAt, type ToolbarFoldsProps, type ToolbarInputProps, type ToolbarPlace, type ToolbarProps, } from "./toolbar/toolbar.js";
|
|
94
|
+
export { TOOLBAR_ATTRS, toolbarWornOf } from "./toolbar/looks.js";
|
|
95
|
+
export { TOOLBAR_WORDS, toolbarWords, type ToolbarWords } from "./toolbar/words.js";
|
|
96
|
+
export { QuickFiltersReminderControl, type QuickFiltersReminderProps } from "./quick-filters/reminder.js";
|
|
97
|
+
export { QUICK_FILTERS_REMINDER_WORDS, quickFiltersReminderWords, type QuickFiltersReminderWords } from "./quick-filters/words.js";
|
|
98
|
+
export { BulkBar, useBulkBarWorn, type BulkBarProps, type BulkDone, type BulkNoun, type BulkRun, type BulkVerb, type BulkVerbItem } from "./bulk-bar/bulk-bar.js";
|
|
99
|
+
export { BULK_BAR_ATTRS, bulkBarWornOf } from "./bulk-bar/looks.js";
|
|
100
|
+
export { BULK_BAR_WORDS, bulkBarWords, type BulkBarWords } from "./bulk-bar/words.js";
|
|
61
101
|
export { useTextEditor, type TextEditorParts } from "./text-editor/text-editor.js";
|
|
62
102
|
export { TEXT_KEYS, enterDoes, kept, lineOf, midWord, ownChange, textRefusal, tidy, type TextKeys, type TextKind } from "./text-editor/check.js";
|
|
63
103
|
export { DIALS, countryName, dialOf, exampleOf, patternOf, phoneHanded, phoneOf, phoneParts, type Dial } from "./text-editor/phone-number.js";
|
|
@@ -89,3 +129,5 @@ export { VALUES_EDITOR_WORDS, valuesWords, type ValuesEditorWords } from "./valu
|
|
|
89
129
|
export { LinksEditor, useLinksEditor, type LinksEditorAction, type LinksEditorLead, type LinksEditorOpens, type LinksEditorParts, type LinksEditorProps, } from "./links-editor/links-editor.js";
|
|
90
130
|
export { found, heldOf, leadAfter, offered, removed, said, saidShort, setValue, ticked, type LinkChoice, type LinkField, type LinkFieldKind, type LinkValue, } from "./links-editor/links.js";
|
|
91
131
|
export { LINKS_EDITOR_WORDS, linksWords, type LinksEditorWords } from "./links-editor/words.js";
|
|
132
|
+
export { TagField, type TagFieldProps } from "./tag-field/tag-field.js";
|
|
133
|
+
export { SwitchRow, SwitchRows, type SwitchRowProps } from "./switch-row/switch-row.js";
|
|
@@ -34,7 +34,7 @@ export { GRIP, GRIP_LOOK, Grip } from "./grip/grip.js";
|
|
|
34
34
|
export { useHoldDrag } from "./internal/hold.js";
|
|
35
35
|
export { dragAt, gapOf, moved, useReorder } from "./internal/reorder.js";
|
|
36
36
|
export { rowFor, rowStarting } from "./menu-list/keys.js";
|
|
37
|
-
export { MenuList, MenuListPanelRows, MenuListRow, MenuListRows, MenuListShown, MenuScroll, menuListCloseOf, menuListRowsOf, sheetFormOf, tilesOf, useMenuListOption, useMenuListRows, } from "./menu-list/menu-list.js";
|
|
37
|
+
export { MENU_LIST_WORDS, MenuList, MenuListPanelRows, MenuListRow, MenuListRows, MenuListShown, MenuScroll, menuListCloseOf, menuListRowsOf, sheetFormOf, tilesOf, useMenuListOption, useMenuListRows, } from "./menu-list/menu-list.js";
|
|
38
38
|
export { COMPUTER_HOST, ComputerHost, PHONE_MARK, PhoneHost, PhoneLine, phoneMark, usePhone, usePhoneForm } from "./internal/phone.js";
|
|
39
39
|
export { drawnAt, focusWhereItStands, focusesInPlace, holdsThePage, keepsToItsList, overflows, scaleOf, scrollInList, scrollTopFor, scrollTopForDrag, staysInView, tapsInPlace, typesInto, } from "./internal/scroll.js";
|
|
40
40
|
export { ContextMenu, Menu, MenuDots, useSheetMenus, } from "./menu/menu.js";
|
|
@@ -47,11 +47,50 @@ export { Select, SelectShown, toPickerItems, } from "./select/select.js";
|
|
|
47
47
|
export { listSide } from "./select/side.js";
|
|
48
48
|
export { chipsThatFit } from "./select/fit.js";
|
|
49
49
|
export { filledMatch } from "./select/filled.js";
|
|
50
|
+
export { Pane, PaneBody, PaneClose, PaneFoot, PaneHead, PaneTitle, paneAfter, usePane } from "./pane/pane.js";
|
|
51
|
+
export { InToolbar, ToolbarButtonControl, useToolbarButtonWorn, } from "./toolbar-button/toolbar-button.js";
|
|
50
52
|
export { Radio, RadioGroup } from "./radio/radio.js";
|
|
53
|
+
export { sortableFields, useSortEditor as useSortEditorParts } from "./sort-editor/sort-editor.js";
|
|
54
|
+
export { SORT_MAX, addSort, canAddSort, dropAside, openPlaces, putBack, repoint, sortLabel, sortedFields, takenBy } from "./sort-editor/rules.js";
|
|
55
|
+
export { SORT_EDITOR_WORDS, sortWords } from "./sort-editor/words.js";
|
|
51
56
|
export { LOCK, useViewsList, useViewsListWorn, ViewsList } from "./views-list/views-list.js";
|
|
52
|
-
export { JUST_ME, listed, SHARED } from "./views-list/rules.js";
|
|
57
|
+
export { canDelete, columnsLabel, copyName, deleteLine, JUST_ME, listed, SHARED, viewsAfter } from "./views-list/rules.js";
|
|
53
58
|
export { VIEWS_LIST_ATTRS, viewsListWornOf } from "./views-list/looks.js";
|
|
54
|
-
export { VIEWS_LIST_WORDS, viewsListWords } from "./views-list/words.js";
|
|
59
|
+
export { VIEW_MENU_WORDS, VIEWS_LIST_WORDS, viewsListWords } from "./views-list/words.js";
|
|
60
|
+
export { useViewMenu } from "./views-list/view-menu.js";
|
|
61
|
+
export { useFilterEditor as useFilterEditorParts } from "./filter-editor/filter-editor.js";
|
|
62
|
+
export { FILTER_SEARCH, FilterPartBody, PairValue, valuePlaceholder } from "./filter-editor/parts.js";
|
|
63
|
+
export { CHECKED, HOW, wayOf } from "./filter-editor/how.js";
|
|
64
|
+
export { FILTER_DEPTH, NO_FILTER, OWN_WAY, addRule, barOf, canGroup, changeRule, clearAll, depthOf, fieldOf, idsOf, isAdvanced, isGroup, isOwnWay, isPair, isSetAside, isWhole, itemOf, removeRule, ruleText, rulesOf, setGroup, setJoin, takesOf, toAdvanced, toGroup, valueText } from "./filter-editor/rules.js";
|
|
65
|
+
export { FILTER_EDITOR_WORDS, filterWords } from "./filter-editor/words.js";
|
|
66
|
+
export { useGroupEditor } from "./group-editor/group-editor.js";
|
|
67
|
+
export { directionTurns, groupLabel, groupOrders, hideAllGroups, moveGroup, noneShown, orderedGroups, setGroupShown, showAllGroups, startGroup } from "./group-editor/rules.js";
|
|
68
|
+
export { GROUP_EDITOR_WORDS, groupWords } from "./group-editor/words.js";
|
|
69
|
+
export { layoutMark, useCustomize, useCustomizeWorn } from "./customize/customize.js";
|
|
70
|
+
export { columnsSay, findColumns, hideAll, moveColumn, setShown, showAll } from "./customize/rules.js";
|
|
71
|
+
export { reduced, slideTime, useGlide } from "./customize/glide.js";
|
|
72
|
+
export { CUSTOMIZE_ATTRS, customizeWornOf } from "./customize/looks.js";
|
|
73
|
+
export { CUSTOMIZE_WORDS, customizeWords } from "./customize/words.js";
|
|
74
|
+
export { SheetPartsFrom } from "./sheet/sheet-parts.js";
|
|
75
|
+
export { MODAL_WORDS, Modal } from "./modal/modal.js";
|
|
76
|
+
export { ALERT_DIALOG_WORDS, AlertDialog, AlertDialogHost, AlertDialogPanel, confirm } from "./alert-dialog/alert-dialog.js";
|
|
77
|
+
export { TOAST_WORDS, Toast, ToastShown, createToastManager, useToast } from "./toast/toast.js";
|
|
78
|
+
export { Collapsible, CollapsiblePanel, CollapsibleTrigger } from "./collapsible/collapsible.js";
|
|
79
|
+
export { ALERT_WORDS, Alert } from "./alert/alert.js";
|
|
80
|
+
export { NOTICE_ICONS, NOTICE_WORDS, Notice } from "./notice/notice.js";
|
|
81
|
+
export { QuickFilters } from "./quick-filters/quick-filters.js";
|
|
82
|
+
export { QUICK_FILTERS_RULES } from "./quick-filters/rules.js";
|
|
83
|
+
export { QUICK_FILTERS_ATTRS, quickFiltersWornOf } from "./quick-filters/looks.js";
|
|
84
|
+
export { QUICK_FILTERS_WORDS, quickFiltersWords } from "./quick-filters/words.js";
|
|
85
|
+
export { quickFiltersFieldsOf, quickHoldsOf, quickListHoldOf } from "./quick-filters/map-quick-filters-body.js";
|
|
86
|
+
export { ToolbarControl, ToolbarFolds, ToolbarInput, ToolbarSeparatorControl, ToolbarSpacer, toolbarSteps, useToolbarWorn, } from "./toolbar/toolbar.js";
|
|
87
|
+
export { TOOLBAR_ATTRS, toolbarWornOf } from "./toolbar/looks.js";
|
|
88
|
+
export { TOOLBAR_WORDS, toolbarWords } from "./toolbar/words.js";
|
|
89
|
+
export { QuickFiltersReminderControl } from "./quick-filters/reminder.js";
|
|
90
|
+
export { QUICK_FILTERS_REMINDER_WORDS, quickFiltersReminderWords } from "./quick-filters/words.js";
|
|
91
|
+
export { BulkBar, useBulkBarWorn } from "./bulk-bar/bulk-bar.js";
|
|
92
|
+
export { BULK_BAR_ATTRS, bulkBarWornOf } from "./bulk-bar/looks.js";
|
|
93
|
+
export { BULK_BAR_WORDS, bulkBarWords } from "./bulk-bar/words.js";
|
|
55
94
|
export { useTextEditor } from "./text-editor/text-editor.js";
|
|
56
95
|
export { TEXT_KEYS, enterDoes, kept, lineOf, midWord, ownChange, textRefusal, tidy } from "./text-editor/check.js";
|
|
57
96
|
export { DIALS, countryName, dialOf, exampleOf, patternOf, phoneHanded, phoneOf, phoneParts } from "./text-editor/phone-number.js";
|
|
@@ -82,3 +121,5 @@ export { VALUES_EDITOR_WORDS, valuesWords } from "./values-editor/words.js";
|
|
|
82
121
|
export { LinksEditor, useLinksEditor, } from "./links-editor/links-editor.js";
|
|
83
122
|
export { found, heldOf, leadAfter, offered, removed, said, saidShort, setValue, ticked, } from "./links-editor/links.js";
|
|
84
123
|
export { LINKS_EDITOR_WORDS, linksWords } from "./links-editor/words.js";
|
|
124
|
+
export { TagField } from "./tag-field/tag-field.js";
|
|
125
|
+
export { SwitchRow, SwitchRows } from "./switch-row/switch-row.js";
|
|
@@ -10,7 +10,7 @@ export const INLINE_INPUT_LOOKS = {
|
|
|
10
10
|
options,
|
|
11
11
|
looks: [
|
|
12
12
|
{ id: "attio", name: "Attio", picks: { edge: "line", corners: "sm", ground: "plain", tint: "3" } },
|
|
13
|
-
{ id: "mihais", name: "
|
|
13
|
+
{ id: "mihais", name: "Outright", picks: { edge: "ring", corners: "md", ground: "plain", tint: "3" } },
|
|
14
14
|
{ id: "tinted", name: "Tinted", picks: { edge: "line", corners: "none", ground: "tint", tint: "3" } },
|
|
15
15
|
],
|
|
16
16
|
};
|
|
@@ -7,6 +7,7 @@ import { Button } from "../button/button.js";
|
|
|
7
7
|
import { phoneMark, usePhoneForm } from "../internal/phone.js";
|
|
8
8
|
import { useAutofill } from "./autofill.js";
|
|
9
9
|
import { inputOwnAttrs, kindLook } from "./looks.js";
|
|
10
|
+
import { keepTypedRun } from "../internal/typed-run.js";
|
|
10
11
|
const sized = (size) => size !== "md" && `o-input-${size}`;
|
|
11
12
|
const InGroup = React.createContext(null);
|
|
12
13
|
export const InputGroupContext = InGroup;
|
|
@@ -82,10 +83,15 @@ export const Input = React.forwardRef(function Input({ size = "md", numeric = fa
|
|
|
82
83
|
const long = multiline && !combobox;
|
|
83
84
|
const bare = grouped || chrome === "bare", field = !bare, set = long && lines != null, grows = long && !set && (field ? grow : bare);
|
|
84
85
|
const own = React.useRef(null);
|
|
85
|
-
const refs = React.useCallback((n) => {
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
86
|
+
const refs = React.useCallback((n) => {
|
|
87
|
+
own.current = n;
|
|
88
|
+
if (n instanceof HTMLTextAreaElement)
|
|
89
|
+
keepTypedRun(n);
|
|
90
|
+
if (typeof ref === "function")
|
|
91
|
+
ref(n);
|
|
92
|
+
else if (ref)
|
|
93
|
+
ref.current = n;
|
|
94
|
+
}, [ref]);
|
|
89
95
|
useGrow(own, grows, "value" in props ? props.value : undefined);
|
|
90
96
|
useKeptCursor(own, props.type);
|
|
91
97
|
const Control = (combobox ? BaseCombobox.Input : BaseInput);
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { ButtonOwnLook } from "../button/own-look.js";
|
|
2
|
-
import { type PickerProps } from "../picker/picker.js";
|
|
2
|
+
import { type PickerItem, type PickerProps } from "../picker/picker.js";
|
|
3
|
+
import type { SelectItem } from "../select/select.js";
|
|
3
4
|
import { type SheetHeadProps } from "../sheet/bottom-sheet.js";
|
|
4
5
|
/** A mark as the editors draw it: its paths on a 24 grid, in the words' colour. */
|
|
5
6
|
export declare const glyph: (paths: string[], className?: string) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -7,8 +8,14 @@ export declare const glyph: (paths: string[], className?: string) => import("rea
|
|
|
7
8
|
export declare const dots: (x: number, y: number) => string;
|
|
8
9
|
export declare const X: string[], PLUS: string[], TICK: string[];
|
|
9
10
|
export declare const DOTS: string[];
|
|
11
|
+
export declare const TRASH: string[];
|
|
10
12
|
/** ⋯ on a phone, 40 × 44, the Button: no edge, its press the card's. */
|
|
11
13
|
export declare const DOTS_LOOK: ButtonOwnLook;
|
|
14
|
+
/** ⋮ in a narrow place (a rule's row in the Pane), 28, quiet and faint. */
|
|
15
|
+
export declare const DOTS_UP: string[];
|
|
16
|
+
export declare const MORE_LOOK: ButtonOwnLook;
|
|
17
|
+
/** A list's rows as the Select takes them: each its mark, its line, "you", greyed where it can't be picked, one level in too. */
|
|
18
|
+
export declare const asSelect: (items: PickerItem[]) => SelectItem[];
|
|
12
19
|
/** A Picker in a full Sheet on top of the editor's, its name the title: a link's field. `onGone` once its Sheet has gone, so what
|
|
13
20
|
* holds it can drop it then. The Picker's words come in its props (`picker.words`), its head's ✕ and ‹ names in `words`. */
|
|
14
21
|
export declare function OnTop({ open, onOpenChange, onGone, title, picker, container, standing, words }: {
|
|
@@ -8,7 +8,12 @@ export const glyph = (paths, className) => (_jsx("svg", { className: className,
|
|
|
8
8
|
export const dots = (x, y) => `M${x} ${y}m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0`;
|
|
9
9
|
export const X = ["M18 6l-12 12", "M6 6l12 12"], PLUS = ["M12 5l0 14", "M5 12l14 0"], TICK = ["M5 12l5 5l10 -10"];
|
|
10
10
|
export const DOTS = [dots(5, 12), dots(12, 12), dots(19, 12)];
|
|
11
|
+
export const TRASH = ["M4 7l16 0", "M10 11l0 6", "M14 11l0 6", "M5 7l1 12a2 2 0 0 0 2 2h8a2 2 0 0 0 2 -2l1 -12", "M9 7v-3a1 1 0 0 1 1 -1h4a1 1 0 0 1 1 1v3"];
|
|
11
12
|
export const DOTS_LOOK = { radius: "md", corner: "round", edge: "none", words: "inherit", icon: "20", hover: "none", press: "card" };
|
|
13
|
+
export const DOTS_UP = [dots(12, 5), dots(12, 12), dots(12, 19)];
|
|
14
|
+
export const MORE_LOOK = { radius: "md", corner: "round", edge: "none", words: "inherit", colour: "faint", icon: "16" };
|
|
15
|
+
export const asSelect = (items) => items.map((i) => ({ value: i.value, label: i.label, line: i.line, disabled: i.disabled, you: i.you,
|
|
16
|
+
mark: i.as && "mark" in i.as ? i.as.mark : undefined, ...(i.level ? { level: asSelect(i.level) } : {}) }));
|
|
12
17
|
export function OnTop({ open, onOpenChange, onGone, title, picker, container, standing, words }) {
|
|
13
18
|
const parts = usePicker({ ...picker, form: "phone", onDone: () => onOpenChange(false) });
|
|
14
19
|
return (_jsxs(Sheet, { open: open, onOpenChange: (o) => onOpenChange(o), onOpenChangeComplete: (o) => { if (!o)
|
|
@@ -9,10 +9,11 @@ export declare const COMPUTER_HOST = "data-computer-host";
|
|
|
9
9
|
/** Inside a computer host: usePhone is false there. A PhoneHost screen inside it is still a phone's. */
|
|
10
10
|
export declare const ComputerHost: React.Context<boolean>;
|
|
11
11
|
/** True where the app's line doesn't match, outside a computer host; false through the server's first draw and where the
|
|
12
|
-
* window can't be asked. */
|
|
13
|
-
export declare const usePhone: () => boolean;
|
|
14
|
-
/** A control's form: the one it is told, else the phone's in a PhoneHost screen or below the line.
|
|
15
|
-
|
|
12
|
+
* window can't be asked. `asked` false: false, the window never asked (a chip that marks a phone only while it is a link). */
|
|
13
|
+
export declare const usePhone: (asked?: boolean) => boolean;
|
|
14
|
+
/** A control's form: the one it is told, else the phone's in a PhoneHost screen or below the line. `asked` false: the
|
|
15
|
+
* computer's, the window never asked. */
|
|
16
|
+
export declare function usePhoneForm(form?: "computer" | "phone", asked?: boolean): boolean;
|
|
16
17
|
/** The attribute a control carries on its root on a phone (usePhoneForm() with no form: the line, a PhoneHost screen, a
|
|
17
18
|
* ComputerHost; a told form changes only its layout), which its stylesheet reads; an app puts it on a box it shows as a
|
|
18
19
|
* phone's screen, and what stands in that box draws the phone's form too. */
|
|
@@ -5,21 +5,21 @@ const canAsk = () => typeof window !== "undefined" && typeof window.matchMedia =
|
|
|
5
5
|
export const PhoneHost = React.createContext(null);
|
|
6
6
|
export const COMPUTER_HOST = "data-computer-host";
|
|
7
7
|
export const ComputerHost = React.createContext(false);
|
|
8
|
-
export const usePhone = () => {
|
|
8
|
+
export const usePhone = (asked = true) => {
|
|
9
9
|
const line = React.useContext(PhoneLine), computer = React.useContext(ComputerHost);
|
|
10
10
|
const subscribe = React.useCallback((change) => {
|
|
11
|
-
if (!canAsk())
|
|
11
|
+
if (!asked || !canAsk())
|
|
12
12
|
return () => { };
|
|
13
13
|
const m = matchMedia(line);
|
|
14
14
|
m.addEventListener("change", change);
|
|
15
15
|
return () => m.removeEventListener("change", change);
|
|
16
|
-
}, [line]);
|
|
17
|
-
const narrow = React.useSyncExternalStore(subscribe, () => canAsk() && !matchMedia(line).matches, () => false);
|
|
16
|
+
}, [line, asked]);
|
|
17
|
+
const narrow = React.useSyncExternalStore(subscribe, () => asked && canAsk() && !matchMedia(line).matches, () => false);
|
|
18
18
|
return narrow && !computer;
|
|
19
19
|
};
|
|
20
|
-
export function usePhoneForm(form) {
|
|
21
|
-
const host = React.useContext(PhoneHost), small = usePhone();
|
|
22
|
-
return form ? form === "phone" : !!host || small;
|
|
20
|
+
export function usePhoneForm(form, asked = true) {
|
|
21
|
+
const host = React.useContext(PhoneHost), small = usePhone(asked);
|
|
22
|
+
return asked && (form ? form === "phone" : !!host || small);
|
|
23
23
|
}
|
|
24
24
|
export const PHONE_MARK = "data-vk-phone";
|
|
25
25
|
export const phoneMark = (phone) => (phone ? { "data-vk-phone": "" } : undefined);
|
|
@@ -136,5 +136,9 @@ export function focusesInPlace(el) {
|
|
|
136
136
|
if (!el)
|
|
137
137
|
return;
|
|
138
138
|
const focus = HTMLElement.prototype.focus;
|
|
139
|
-
|
|
139
|
+
Object.defineProperty(el, "focus", {
|
|
140
|
+
configurable: true,
|
|
141
|
+
writable: true,
|
|
142
|
+
value: (options) => focus.call(el, { ...options, preventScroll: true }),
|
|
143
|
+
});
|
|
140
144
|
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/** A step's opener in its editor's root: a selector, or a finder for one no selector names (a row by its words). */
|
|
2
|
+
export type StepOpener = string | ((root: HTMLElement) => HTMLElement | null);
|
|
3
|
+
/** An opener whose selector is built as the step goes, inside the frame, so nothing (CSS.escape) runs while a server draws. */
|
|
4
|
+
export declare const openerAt: (selector: () => string) => StepOpener;
|
|
5
|
+
/** On a phone, the open steps' openers, the outermost first ([] at rest and on a computer). When the list grows shorter, the
|
|
6
|
+
* opener of the outermost step that went takes the focus on the next frame, found again in `root` as redrawn. */
|
|
7
|
+
export declare function useStepReturn(root: HTMLElement | null | {
|
|
8
|
+
readonly current: HTMLElement | null;
|
|
9
|
+
}, openers: readonly StepOpener[]): void;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
const inOwnHead = (now, root) => !!now.closest(".o-sheet-head") && !!root.closest(".o-sheet")?.contains(now);
|
|
4
|
+
export const openerAt = (selector) => (root) => root.querySelector(selector());
|
|
5
|
+
export function useStepReturn(root, openers) {
|
|
6
|
+
const was = React.useRef(openers);
|
|
7
|
+
React.useLayoutEffect(() => {
|
|
8
|
+
const before = was.current;
|
|
9
|
+
was.current = openers;
|
|
10
|
+
if (openers.length >= before.length)
|
|
11
|
+
return;
|
|
12
|
+
const opener = before[openers.length];
|
|
13
|
+
requestAnimationFrame(() => {
|
|
14
|
+
const el = root == null ? null : "current" in root ? root.current : root;
|
|
15
|
+
if (!el?.isConnected)
|
|
16
|
+
return;
|
|
17
|
+
const now = document.activeElement;
|
|
18
|
+
if (now && now !== document.body && now.isConnected && !now.contains(el) && !now.classList.contains("o-sheet-step") && !inOwnHead(now, el))
|
|
19
|
+
return;
|
|
20
|
+
const to = typeof opener === "string" ? el.querySelector(opener) : opener(el);
|
|
21
|
+
if (!to?.isConnected)
|
|
22
|
+
return;
|
|
23
|
+
to.focus({ preventScroll: true });
|
|
24
|
+
to.scrollIntoView?.({ block: "nearest" });
|
|
25
|
+
});
|
|
26
|
+
});
|
|
27
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
const DEFAULT_VALUE = typeof HTMLTextAreaElement === "undefined" ? undefined : Object.getOwnPropertyDescriptor(HTMLTextAreaElement.prototype, "defaultValue");
|
|
2
|
+
export function keepTypedRun(el) {
|
|
3
|
+
if (DEFAULT_VALUE && !Object.prototype.hasOwnProperty.call(el, "defaultValue"))
|
|
4
|
+
Object.defineProperty(el, "defaultValue", { configurable: true, get: () => DEFAULT_VALUE.get.call(el), set: () => { } });
|
|
5
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import { type PickerItem } from "../picker/picker.js";
|
|
3
|
-
import {
|
|
3
|
+
import type { SheetHeadProps } from "../sheet/bottom-sheet.js";
|
|
4
4
|
import { type Link, type LinkField } from "./links.js";
|
|
5
5
|
import { type LinksEditorWords } from "./words.js";
|
|
6
6
|
export type { Link, LinkField, LinkFieldKind, LinkValue } from "./links.js";
|
|
@@ -69,8 +69,10 @@ export interface LinksEditorAction {
|
|
|
69
69
|
}
|
|
70
70
|
export interface LinksEditorParts {
|
|
71
71
|
body: React.ReactNode;
|
|
72
|
-
/** On a phone, the Sheet head's ✕ and
|
|
73
|
-
head: Pick<SheetHeadProps, "close" | "left" | "right">;
|
|
72
|
+
/** On a phone, the Sheet head's ✕ and ✓, or on a step its Back (`onBack`, `close: false`); {} on a computer. */
|
|
73
|
+
head: Pick<SheetHeadProps, "close" | "left" | "right" | "onBack">;
|
|
74
|
+
/** On a phone, the Sheet's title while it stands on a step: a link's field, or a link's fields by the record's name. */
|
|
75
|
+
title?: string;
|
|
74
76
|
}
|
|
75
77
|
/** The Links editor's state and the parts a shell pours in. */
|
|
76
78
|
export declare function useLinksEditor(props: LinksEditorProps): LinksEditorParts;
|
|
@@ -1,27 +1,29 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import {
|
|
2
|
+
import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
3
|
import * as React from "react";
|
|
4
4
|
import { Avatar } from "../avatar/avatar.js";
|
|
5
5
|
import { Button } from "../button/button.js";
|
|
6
6
|
import { FieldRows, FieldRowsRow as FieldRow } from "../field/field.js";
|
|
7
7
|
import { Input, InputGroup, InputGroupAddon } from "../input/input.js";
|
|
8
|
-
import { DOTS, DOTS_LOOK, glyph,
|
|
8
|
+
import { DOTS, DOTS_LOOK, glyph, PLUS, useDecide, useStandingRoom, X } from "../internal/editor-parts.js";
|
|
9
9
|
import { Icon } from "../internal/icons.js";
|
|
10
10
|
import { PhoneHost, phoneMark, usePhone } from "../internal/phone.js";
|
|
11
|
-
import { usePopupHost } from "../internal/popup-host.js";
|
|
12
11
|
import { spacingPx } from "../internal/read-token.js";
|
|
13
12
|
import { drawnAt, scrollInList } from "../internal/scroll.js";
|
|
13
|
+
import { openerAt, useStepReturn } from "../internal/step-return.js";
|
|
14
14
|
import { Menu } from "../menu/menu.js";
|
|
15
|
-
import { Picker } from "../picker/picker.js";
|
|
15
|
+
import { Picker, usePicker } from "../picker/picker.js";
|
|
16
16
|
import { Popover } from "../popover/popover.js";
|
|
17
17
|
import { Radio, RadioGroup } from "../radio/radio.js";
|
|
18
18
|
import { Select } from "../select/select.js";
|
|
19
|
-
import { Sheet, SheetBody, SheetButton, SheetHead } from "../sheet/bottom-sheet.js";
|
|
20
19
|
import { Spinner } from "../spinner/spinner.js";
|
|
21
20
|
import { Switch } from "../switch/switch.js";
|
|
22
21
|
import { midWord } from "../text-editor/check.js";
|
|
23
22
|
import { added, found, heldOf, leadAfter, offered, removed, said, saidShort, setValue, ticked } from "./links.js";
|
|
24
23
|
import { linksWords } from "./words.js";
|
|
24
|
+
function StepList(props) {
|
|
25
|
+
return _jsx(_Fragment, { children: usePicker(props).body });
|
|
26
|
+
}
|
|
25
27
|
const SEARCH = ["M10 10m-7 0a7 7 0 1 0 14 0a7 7 0 1 0 -14 0", "M21 21l-6 -6"], BACK = ["M15 6l-6 6l6 6"];
|
|
26
28
|
const END_LOOK = { radius: "sm", corner: "round", edge: "none", words: "inherit", colour: "faint", icon: "16" };
|
|
27
29
|
const MORE = ["M9 6l6 6l-6 6"];
|
|
@@ -59,9 +61,10 @@ export function useLinksEditor(props) {
|
|
|
59
61
|
return; leading.current = value; lead.onLead(value); };
|
|
60
62
|
const [query, setQuery] = React.useState(props.typed ?? "");
|
|
61
63
|
const [lit, setLit] = React.useState(props.typed?.trim() ? 0 : null);
|
|
62
|
-
const { linked, rest } = found(records, links, query, !!onSearch);
|
|
64
|
+
const { linked, rest: toAdd } = found(records, links, query, !!onSearch);
|
|
65
|
+
const rest = doing ? [] : toAdd;
|
|
63
66
|
const lights = rest.length + actions.length;
|
|
64
|
-
const litAt = lit == null || !lights ? null : Math.min(lit, lights - 1);
|
|
67
|
+
const litAt = lit == null || !lights || doing === "searching" ? null : Math.min(lit, lights - 1);
|
|
65
68
|
const typeQuery = (v) => { setQuery(v); onSearch?.(v); };
|
|
66
69
|
const asked = React.useRef(onMore);
|
|
67
70
|
asked.current = onMore;
|
|
@@ -184,9 +187,20 @@ export function useLinksEditor(props) {
|
|
|
184
187
|
typedFirst.current = props.typed ?? "";
|
|
185
188
|
const placeRoot = React.useCallback((el) => { setRoot(el); placed(el); if (!el)
|
|
186
189
|
setQuery(typedFirst.current); }, [placed]);
|
|
187
|
-
const [top, setTop] = React.useState(() => (phone && opens && "list" in opens ? { link: opens.link, field: opens.list
|
|
190
|
+
const [top, setTop] = React.useState(() => (phone && opens && "list" in opens ? { link: opens.link, field: opens.list } : null));
|
|
188
191
|
const [fieldsOf, setFieldsOf] = React.useState(() => (phone && opens && "config" in opens ? opens.config : null));
|
|
189
|
-
|
|
192
|
+
React.useEffect(() => {
|
|
193
|
+
if (top && !links.some((l) => l.value === top.link))
|
|
194
|
+
setTop(null);
|
|
195
|
+
if (fieldsOf && !links.some((l) => l.value === fieldsOf))
|
|
196
|
+
setFieldsOf(null);
|
|
197
|
+
}, [links, top, fieldsOf]);
|
|
198
|
+
const fieldsOpen = several && fieldsOf ? fieldsOf : null;
|
|
199
|
+
useStepReturn(root, phone ? [
|
|
200
|
+
...(fieldsOpen ? [openerAt(() => `.o-links-editor-card[data-link="${CSS.escape(fieldsOpen)}"] .o-links-editor-config`)] : []),
|
|
201
|
+
...(top ? [openerAt(() => (fieldsOpen ? `.o-links-editor-fields .o-links-editor-open[data-field="${CSS.escape(top.field)}"]`
|
|
202
|
+
: `.o-links-editor-card[data-link="${CSS.escape(top.link)}"] .o-links-editor-open[data-field="${CSS.escape(top.field)}"]`))] : []),
|
|
203
|
+
] : []);
|
|
190
204
|
const [sheetRoom, setSheetRoom] = React.useState(null);
|
|
191
205
|
React.useLayoutEffect(() => {
|
|
192
206
|
const scroller = root?.parentElement?.closest(".o-sheet-body");
|
|
@@ -208,7 +222,7 @@ export function useLinksEditor(props) {
|
|
|
208
222
|
const holds = (l) => fields.map((f) => (f.kind === "yes-no" ? (l.values[f.id] === true ? f.label : "") : said(f, l.values[f.id], w.yes) === "–" ? "" : said(f, l.values[f.id], w.yes)))
|
|
209
223
|
.filter(Boolean).join(" · ");
|
|
210
224
|
const rowWords = (f, v) => { const s = said(f, v, w.yes); return f.kind === "yes-no" ? (v === true ? w.yes : w.no) : s === "–" ? w.none : s; };
|
|
211
|
-
const openList = (value, field) => setTop({ link: value, field
|
|
225
|
+
const openList = (value, field) => setTop({ link: value, field });
|
|
212
226
|
const fieldRow = (l, name, f) => (f.kind === "yes-no" ? (_jsxs(FieldRow, { className: "o-links-editor-open", "data-field": f.id, children: [_jsx("span", { className: "o-links-editor-open-name", children: f.label }), _jsx(Switch, { size: "lg", className: "o-links-editor-switch", checked: l.values[f.id] === true, "aria-label": w.fieldAt(f.label, name), onCheckedChange: (c) => setField(l.value, f.id, c) })] }, f.id)) : (_jsxs(FieldRow, { as: "button", className: "o-links-editor-open", "data-field": f.id, "aria-label": w.fieldAt(f.label, name), onClick: () => openList(l.value, f.id), children: [_jsx("span", { className: "o-links-editor-open-name", children: f.label }), _jsx("span", { className: "o-links-editor-open-value", children: rowWords(f, l.values[f.id]) }), glyph(MORE, "o-links-editor-open-mark")] }, f.id)));
|
|
213
227
|
const card = (r) => {
|
|
214
228
|
const l = links.find((x) => x.value === r.value), name = r.label, leads = lead != null && lead.value === r.value;
|
|
@@ -220,11 +234,16 @@ export function useLinksEditor(props) {
|
|
|
220
234
|
const topLink = top ? links.find((l) => l.value === top.link) : undefined, topField = top ? fields.find((f) => f.id === top.field) : undefined;
|
|
221
235
|
const fieldsLink = fieldsOf ? links.find((l) => l.value === fieldsOf) : undefined;
|
|
222
236
|
const fieldsName = fieldsOf ? byValue(fieldsOf).label : "";
|
|
223
|
-
const
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
237
|
+
const listStep = top && topLink && topField ? top : null;
|
|
238
|
+
const fieldsStep = several ? fieldsLink ?? null : null;
|
|
239
|
+
const body = (_jsx("div", { ref: placeRoot, className: "o-links-editor", "data-kit": "links-editor", ...mark, "data-links-form": "phone", "data-links-shape": "table", "data-links-fields": several ? "several" : "one", tabIndex: -1, "data-links-step": listStep ? "list" : fieldsStep ? "fields" : undefined, style: sheetRoom ? { "--links-room": `${sheetRoom.height}px`, "--links-under": `${sheetRoom.under}px` } : undefined, children: listStep && topLink && topField ? (_jsx(StepList, { ...listOf(topLink, topField), draft: "shell", form: "phone", onDone: () => setTop(null) }, `${listStep.link}-${listStep.field}`)) : fieldsStep ? _jsxs(_Fragment, { children: [_jsxs(FieldRows, { look: FIELDS, className: "o-links-editor-fields", "data-link": fieldsStep.value, children: [fields.map((f) => f.kind === "yes-no"
|
|
240
|
+
? _jsx(FieldRow, { label: f.label, "data-field": f.id, children: _jsx(Switch, { size: "lg", className: "o-links-editor-switch", checked: fieldsStep.values[f.id] === true, "aria-label": w.fieldAt(f.label, fieldsName), onCheckedChange: (c) => setField(fieldsStep.value, f.id, c) }) }, f.id)
|
|
241
|
+
: _jsxs(FieldRow, { as: "button", label: f.label, className: "o-links-editor-open", "data-field": f.id, "aria-label": w.fieldAt(f.label, fieldsName), onClick: () => openList(fieldsStep.value, f.id), children: [_jsx("span", { className: "o-links-editor-open-value", children: rowWords(f, fieldsStep.values[f.id]) }), glyph(MORE, "o-links-editor-open-mark")] }, f.id)), lead && _jsx(FieldRow, { label: lead.label, "data-field": "lead", children: _jsx(Switch, { size: "lg", className: "o-links-editor-switch", checked: lead.value === fieldsStep.value, "aria-label": w.isLead(fieldsName, lead.label), onCheckedChange: (c) => { if (c)
|
|
242
|
+
setLead(fieldsStep.value); } }) })] }), _jsx(FieldRows, { look: FIELDS, className: "o-links-editor-fields-foot", children: _jsx(FieldRow, { as: "button", className: "o-links-editor-unlink", onClick: () => { const v = fieldsStep.value; setFieldsOf(null); unlink(v); }, children: w.unlink }) })] }) : _jsxs(_Fragment, { children: [linked.length > 0 && _jsx("div", { className: "o-links-editor-cards", role: "list", "aria-label": label, children: linked.map(card) }), (rest.length > 0 || actions.length > 0) && _jsxs(_Fragment, { children: [_jsx("div", { className: "o-links-editor-label", children: addWords }), _jsxs(FieldRows, { look: ADDS, className: "o-links-editor-adds", role: "list", "aria-label": addWords, children: [rest.map((r) => (_jsxs(FieldRow, { as: "button", className: "o-links-editor-add", "data-record": r.value, role: "listitem", "aria-label": w.linkName(r.label), onClick: () => link(r.value), children: [_jsx(Face, { record: r, size: 40 }), _jsx("span", { className: "o-links-editor-add-name", children: r.label }), glyph(PLUS, "o-links-editor-add-mark")] }, r.value))), actions.map((a) => (_jsxs(FieldRow, { as: "button", className: "o-links-editor-add o-links-editor-action", role: "listitem", onClick: a.onSelect, children: [a.icon != null && _jsx("span", { className: "o-links-editor-action-mark", children: a.icon }), _jsx("span", { className: "o-links-editor-add-name", children: a.label })] }, a.key)))] }), more] }), doingNote ? _jsx("div", { className: "o-links-editor-note", children: doingNote }) : _jsxs(_Fragment, { children: [!rest.length && query.trim() && !linked.length && _jsx("div", { className: "o-links-editor-note", children: w.nothingMatchesTyped(query.trim()) }), !rest.length && !query.trim() && linked.length > 0 && _jsx("div", { className: "o-links-editor-note", children: w.everythingLinked })] }), _jsx("div", { className: "o-links-editor-bar", children: _jsxs(InputGroup, { size: "lg", className: "o-links-editor-pill", children: [_jsx(InputGroupAddon, { side: "start", children: glyph(SEARCH) }), _jsx(Input, { autofill: false, ref: searchBox, className: "o-links-editor-input", placeholder: search, "aria-label": search, value: query, onValueChange: (v) => typeQuery(v) })] }) })] }) }));
|
|
243
|
+
if (listStep && topField)
|
|
244
|
+
return { body, head: { onBack: () => setTop(null), close: false }, title: topField.label };
|
|
245
|
+
if (fieldsStep)
|
|
246
|
+
return { body, head: { onBack: () => setFieldsOf(null), close: false }, title: fieldsName };
|
|
228
247
|
return { body, head: decide.head };
|
|
229
248
|
}
|
|
230
249
|
const stepLink = step ? links.find((l) => l.value === step) : undefined;
|
|
@@ -253,6 +272,8 @@ export function useLinksEditor(props) {
|
|
|
253
272
|
const keys = (e) => {
|
|
254
273
|
if ((e.key === "ArrowDown" || e.key === "ArrowUp") && lights) {
|
|
255
274
|
e.preventDefault();
|
|
275
|
+
if (doing === "searching")
|
|
276
|
+
return;
|
|
256
277
|
const next = litAt == null ? (e.key === "ArrowDown" ? 0 : lights - 1) : (litAt + (e.key === "ArrowDown" ? 1 : lights - 1)) % lights;
|
|
257
278
|
setLit(next);
|
|
258
279
|
const row = list.current?.querySelector(`#${CSS.escape(`${ids}-add-${next}`)}`);
|
|
@@ -295,10 +316,10 @@ export function useLinksEditor(props) {
|
|
|
295
316
|
})() : null;
|
|
296
317
|
const body = (_jsxs("div", { ref: setRoot, className: "o-links-editor", "data-kit": "links-editor", ...mark, "data-links-form": "computer", "data-links-shape": "table", "data-links-fields": several ? "several" : "one", role: "group", "aria-label": label, tabIndex: -1, style: room ? { paddingBottom: room } : undefined, children: [_jsxs("div", { className: "o-links-editor-search o-popup-line", children: [glyph(SEARCH), _jsx(Input, { chrome: "bare", autofill: false, ref: searchBox, className: "o-links-editor-input", placeholder: search, "aria-label": search, role: "combobox", "aria-expanded": lights > 0, "aria-autocomplete": "list", "aria-controls": lights ? `${ids}-add` : undefined, "aria-activedescendant": litAt != null ? `${ids}-add-${litAt}` : undefined, value: query, onValueChange: (v) => { typeQuery(v); setLit(v.trim() ? 0 : null); }, onKeyDown: keys })] }), _jsxs("div", { ref: placeList, className: "o-links-editor-list", "data-head": linked.length ? "" : undefined, "data-held": open ? "" : undefined, children: [linked.length > 0 && _jsxs(_Fragment, { children: [_jsxs("div", { className: "o-links-editor-head", "aria-hidden": "true", children: [_jsx("span", { className: "o-links-editor-who", children: kind }), fields.map((f) => _jsx("span", { className: "o-links-editor-cell", "data-field": f.id, "data-kind": f.kind, children: f.label }, f.id)), lead && _jsx("span", { className: "o-links-editor-lead", children: lead.label }), _jsx("span", { className: "o-links-editor-end" })] }), lead
|
|
297
318
|
? _jsx(RadioGroup, { className: "o-links-editor-rows", "aria-label": lead.label, value: lead.value, onValueChange: (v) => setLead(v), children: rows })
|
|
298
|
-
: _jsx("div", { className: "o-links-editor-rows", children: rows })] }), linked.length > 0 && lights > 0 && _jsx("div", { className: "o-list-sep", role: "presentation" }), lights > 0 && _jsxs("div", { id: `${ids}-add`, role: "listbox", "aria-label": w.addTo(label), className: "o-links-editor-adds", onPointerLeave: () => setLit(query.trim() ? 0 : null), children: [linked.length > 0 && _jsx("div", { className: "o-list-heading", "aria-hidden": "true", children: w.add }), rest.map((r, i) => (_jsxs("div", { id: `${ids}-add-${i}`, role: "option", "aria-selected": i === litAt, className: "o-list-row o-smooth o-smooth-ease o-links-editor-add", "data-record": r.value, ...phoneMark(small), "data-highlighted": i === litAt ? "" : undefined, onPointerMove: () => { if (!open && i !== litAt)
|
|
319
|
+
: _jsx("div", { className: "o-links-editor-rows", children: rows })] }), linked.length > 0 && lights > 0 && _jsx("div", { className: "o-list-sep", role: "presentation" }), lights > 0 && _jsxs("div", { id: `${ids}-add`, role: "listbox", "aria-label": w.addTo(label), className: "o-links-editor-adds", onPointerLeave: () => setLit(query.trim() ? 0 : null), children: [linked.length > 0 && _jsx("div", { className: "o-list-heading", "aria-hidden": "true", children: w.add }), rest.map((r, i) => (_jsxs("div", { id: `${ids}-add-${i}`, role: "option", "aria-selected": i === litAt, className: "o-list-row o-smooth o-smooth-ease o-links-editor-add", "data-record": r.value, ...phoneMark(small), "data-highlighted": i === litAt ? "" : undefined, onPointerMove: () => { if (!open && doing !== "searching" && i !== litAt)
|
|
299
320
|
setLit(i); }, onMouseDown: (e) => e.preventDefault(), onClick: () => link(r.value), children: [_jsx(Face, { record: r, size: 20 }), _jsx("span", { className: "o-list-text", children: _jsx("span", { className: "o-list-main", children: r.label }) })] }, r.value))), actions.map((a, j) => {
|
|
300
321
|
const i = rest.length + j;
|
|
301
|
-
return (_jsxs("div", { id: `${ids}-add-${i}`, role: "option", "aria-selected": i === litAt, className: "o-list-row o-smooth o-smooth-ease o-links-editor-add o-links-editor-action", ...phoneMark(small), "data-highlighted": i === litAt ? "" : undefined, onPointerMove: () => { if (!open && i !== litAt)
|
|
322
|
+
return (_jsxs("div", { id: `${ids}-add-${i}`, role: "option", "aria-selected": i === litAt, className: "o-list-row o-smooth o-smooth-ease o-links-editor-add o-links-editor-action", ...phoneMark(small), "data-highlighted": i === litAt ? "" : undefined, onPointerMove: () => { if (!open && doing !== "searching" && i !== litAt)
|
|
302
323
|
setLit(i); }, onMouseDown: (e) => e.preventDefault(), onClick: a.onSelect, children: [a.icon != null && _jsx("span", { className: "o-links-editor-action-mark", children: a.icon }), _jsx("span", { className: "o-list-text", children: _jsx("span", { className: "o-list-main", children: a.label }) })] }, a.key));
|
|
303
324
|
})] }), more, message && _jsx("div", { className: "o-links-editor-message", children: message })] }), shown] }));
|
|
304
325
|
return { body, head: {} };
|
|
@@ -5,6 +5,7 @@ import { resolveViewsMessage } from "../../contract.js";
|
|
|
5
5
|
import { EDITOR_INNER_ESCAPE } from "../../editors/inner-escape.js";
|
|
6
6
|
import { ViewsContext } from "../../provider/context.js";
|
|
7
7
|
import { pickerItemsOf, pickerWordsOf } from "../picker/map-picker.js";
|
|
8
|
+
import { useToldStep } from "../internal/told-step.js";
|
|
8
9
|
import { useLinksEditor } from "./links-editor.js";
|
|
9
10
|
import { heldOf } from "./links.js";
|
|
10
11
|
const ROLES = "roles";
|
|
@@ -67,5 +68,7 @@ export function MapLinksBody(props) {
|
|
|
67
68
|
const makeLead = props.lead?.makeLabel;
|
|
68
69
|
const words = React.useMemo(() => linksEditorWordsOf(messages, makeLead), [messages, makeLead]);
|
|
69
70
|
const rolesWord = messages({ key: "views.editors.links-roles" });
|
|
70
|
-
|
|
71
|
+
const parts = useLinksEditor(linksEditorPropsOf(props, words, rolesWord, views?.components.AppIcon));
|
|
72
|
+
useToldStep(parts, props.onStepChange);
|
|
73
|
+
return _jsx(_Fragment, { children: parts.body });
|
|
71
74
|
}
|
|
@@ -120,7 +120,7 @@
|
|
|
120
120
|
background-image: linear-gradient(to bottom, transparent, var(--vk-overlay) calc(var(--vk-spacing) * 8));
|
|
121
121
|
}
|
|
122
122
|
.o-links-editor-pill { flex: 1; }
|
|
123
|
-
/* A link's fields,
|
|
123
|
+
/* A link's fields, a step of the phone's Sheet: a field's words at its row's end; a switch at its end; Unlink its own card, in red. */
|
|
124
124
|
.o-links-editor-fields .o-links-editor-open-value { flex: 1; }
|
|
125
125
|
.o-links-editor-switch { flex: none; margin-left: auto; }
|
|
126
126
|
.o-links-editor-fields-foot { margin-top: calc(var(--vk-spacing) * 6); }
|