viewkitjs 0.28.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 +107 -0
- package/MIGRATION.md +85 -4
- 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.js +2 -2
- package/views/dist/cells/cell-values.js +9 -10
- package/views/dist/contract.d.ts +149 -3
- package/views/dist/contract.js +157 -1
- 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/compound-editor/looks.js +1 -1
- package/views/dist/controls/controls.d.ts +10 -0
- package/views/dist/controls/controls.js +8 -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/looks.js +1 -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 +2 -0
- package/views/dist/controls/filter-editor/filter-editor.js +85 -43
- package/views/dist/controls/filter-editor/how.d.ts +1 -1
- package/views/dist/controls/filter-editor/how.js +1 -0
- package/views/dist/controls/filter-editor/map-filter-body.d.ts +16 -1
- package/views/dist/controls/filter-editor/map-filter-body.js +39 -13
- package/views/dist/controls/filter-editor/map-rules.d.ts +27 -11
- package/views/dist/controls/filter-editor/map-rules.js +73 -42
- package/views/dist/controls/filter-editor/rules.d.ts +43 -5
- package/views/dist/controls/filter-editor/rules.js +55 -2
- package/views/dist/controls/filter-editor/words.d.ts +15 -0
- package/views/dist/controls/filter-editor/words.js +6 -0
- package/views/dist/controls/filter-editor.css +18 -0
- package/views/dist/controls/index.d.ts +26 -2
- package/views/dist/controls/index.js +25 -2
- package/views/dist/controls/inline-input/looks.js +1 -1
- package/views/dist/controls/input/input.js +10 -4
- 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/typed-run.d.ts +2 -0
- package/views/dist/controls/internal/typed-run.js +5 -0
- package/views/dist/controls/menu/map-menu.js +2 -2
- package/views/dist/controls/number-editor/looks.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/pane.d.ts +4 -0
- package/views/dist/controls/pane/pane.js +2 -1
- 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/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/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 +5 -1
- package/views/dist/controls/toast/toast.js +5 -3
- package/views/dist/controls/tokens.js +18 -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/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 +3 -3
- package/views/dist/display/format.d.ts +6 -0
- package/views/dist/display/format.js +3 -0
- package/views/dist/display/index.d.ts +1 -1
- package/views/dist/display/index.js +1 -1
- package/views/dist/display/range.d.ts +2 -1
- package/views/dist/display/range.js +4 -1
- 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-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/core/clipboard-model.js +9 -4
- 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 +5 -0
- package/views/dist/looks/index.js +5 -0
- package/views/dist/looks/pieces.js +10 -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 +10 -2
- package/views/dist/panels/quick/model.d.ts +4 -0
- package/views/dist/panels/react/customize-body.d.ts +9 -4
- package/views/dist/panels/react/customize-body.js +39 -11
- package/views/dist/panels/react/customize.d.ts +8 -1
- package/views/dist/panels/react/customize.js +9 -6
- package/views/dist/panels/react/filter/FilterEditor.js +4 -4
- package/views/dist/panels/react/filter/FilterFieldList.js +10 -2
- package/views/dist/panels/react/filter/PhoneFilterEditor.js +3 -3
- package/views/dist/panels/react/filter/filter-body.js +5 -2
- package/views/dist/panels/react/panel-step.d.ts +3 -0
- package/views/dist/panels/react/panel-step.js +2 -1
- package/views/dist/panels/react/quick/QuickFiltersPanel.js +1 -0
- package/views/dist/panels/react/toolbar/ReadyToolbar.d.ts +13 -3
- package/views/dist/panels/react/toolbar/ReadyToolbar.js +10 -3
- 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 +13 -3
- package/views/dist/panels/react/toolbar/ToolbarFilterAdd.js +2 -1
- package/views/dist/panels/react/toolbar/ToolbarFilters.js +3 -3
- 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/view-footer.d.ts +1 -1
- package/views/dist/panels/react/views-row/ViewPicker.js +25 -4
- package/views/dist/panels/settings/filter-groups.d.ts +3 -0
- package/views/dist/panels/settings/filter-groups.js +40 -9
- package/views/dist/panels/settings/filters.d.ts +5 -0
- package/views/dist/panels/settings/filters.js +12 -6
- package/views/dist/panels/views-row/model.d.ts +10 -1
- package/views/dist/provider/ViewsProvider.js +29 -5
- package/views/dist/provider/components.d.ts +149 -8
- package/views/dist/provider/context.d.ts +6 -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 +656 -25
- package/views/dist/styles.unlayered.css +653 -22
- package/views/docs/contract.md +44 -17
- package/views/docs/controls/bulk-bar.md +41 -0
- package/views/docs/controls/choice.md +25 -0
- package/views/docs/controls/customize.md +17 -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/switch-row.md +18 -0
- package/views/docs/controls/tag-field.md +7 -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 +2 -2
- package/views/docs/guides/display.md +2 -2
- 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 +1 -1
- package/views/docs/guides/the-provider.md +2 -2
- package/views/docs/install.md +4 -1
- package/views/docs/reference/cells.md +1 -1
- package/views/docs/reference/controls.md +194 -13
- package/views/docs/reference/display.md +1 -0
- package/views/docs/reference/looks.md +25 -11
- package/views/docs/reference/panels-react.md +7 -7
- package/views/docs/reference/panels.md +8 -6
- package/views/docs/reference/react.md +13 -6
- package/views/docs/reference/selection.md +4 -2
- package/views/docs/reference/views.md +7 -6
- package/views/skills/views/SKILL.md +2 -2
|
@@ -48,14 +48,16 @@ export { listSide } from "./select/side.js";
|
|
|
48
48
|
export { chipsThatFit } from "./select/fit.js";
|
|
49
49
|
export { filledMatch } from "./select/filled.js";
|
|
50
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";
|
|
51
52
|
export { Radio, RadioGroup } from "./radio/radio.js";
|
|
52
53
|
export { sortableFields, useSortEditor as useSortEditorParts } from "./sort-editor/sort-editor.js";
|
|
53
54
|
export { SORT_MAX, addSort, canAddSort, dropAside, openPlaces, putBack, repoint, sortLabel, sortedFields, takenBy } from "./sort-editor/rules.js";
|
|
54
55
|
export { SORT_EDITOR_WORDS, sortWords } from "./sort-editor/words.js";
|
|
55
56
|
export { LOCK, useViewsList, useViewsListWorn, ViewsList } from "./views-list/views-list.js";
|
|
56
|
-
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";
|
|
57
58
|
export { VIEWS_LIST_ATTRS, viewsListWornOf } from "./views-list/looks.js";
|
|
58
|
-
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";
|
|
59
61
|
export { useFilterEditor as useFilterEditorParts } from "./filter-editor/filter-editor.js";
|
|
60
62
|
export { FILTER_SEARCH, FilterPartBody, PairValue, valuePlaceholder } from "./filter-editor/parts.js";
|
|
61
63
|
export { CHECKED, HOW, wayOf } from "./filter-editor/how.js";
|
|
@@ -64,12 +66,31 @@ export { FILTER_EDITOR_WORDS, filterWords } from "./filter-editor/words.js";
|
|
|
64
66
|
export { useGroupEditor } from "./group-editor/group-editor.js";
|
|
65
67
|
export { directionTurns, groupLabel, groupOrders, hideAllGroups, moveGroup, noneShown, orderedGroups, setGroupShown, showAllGroups, startGroup } from "./group-editor/rules.js";
|
|
66
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";
|
|
67
75
|
export { MODAL_WORDS, Modal } from "./modal/modal.js";
|
|
68
76
|
export { ALERT_DIALOG_WORDS, AlertDialog, AlertDialogHost, AlertDialogPanel, confirm } from "./alert-dialog/alert-dialog.js";
|
|
69
77
|
export { TOAST_WORDS, Toast, ToastShown, createToastManager, useToast } from "./toast/toast.js";
|
|
70
78
|
export { Collapsible, CollapsiblePanel, CollapsibleTrigger } from "./collapsible/collapsible.js";
|
|
71
79
|
export { ALERT_WORDS, Alert } from "./alert/alert.js";
|
|
72
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";
|
|
73
94
|
export { useTextEditor } from "./text-editor/text-editor.js";
|
|
74
95
|
export { TEXT_KEYS, enterDoes, kept, lineOf, midWord, ownChange, textRefusal, tidy } from "./text-editor/check.js";
|
|
75
96
|
export { DIALS, countryName, dialOf, exampleOf, patternOf, phoneHanded, phoneOf, phoneParts } from "./text-editor/phone-number.js";
|
|
@@ -100,3 +121,5 @@ export { VALUES_EDITOR_WORDS, valuesWords } from "./values-editor/words.js";
|
|
|
100
121
|
export { LinksEditor, useLinksEditor, } from "./links-editor/links-editor.js";
|
|
101
122
|
export { found, heldOf, leadAfter, offered, removed, said, saidShort, setValue, ticked, } from "./links-editor/links.js";
|
|
102
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);
|
|
@@ -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,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
|
+
}
|
|
@@ -2,7 +2,7 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
2
2
|
import * as React from "react";
|
|
3
3
|
import { resolveViewsMessage } from "../../contract.js";
|
|
4
4
|
import { ViewsContext } from "../../provider/context.js";
|
|
5
|
-
import {
|
|
5
|
+
import { menuWordsOf } from "../picker/map-picker.js";
|
|
6
6
|
import { Menu } from "./menu.js";
|
|
7
7
|
const NO_REASON = "Not now";
|
|
8
8
|
const closingTick = (item) => item.checked !== undefined && !item.keepOpen && !item.children && !item.href && !item.disabled;
|
|
@@ -48,6 +48,6 @@ export function menuEntries(items, notNow = NO_REASON) {
|
|
|
48
48
|
}
|
|
49
49
|
export function MapMenu({ open, onOpenChange, anchor, items, side, align, label }) {
|
|
50
50
|
const say = React.useContext(ViewsContext)?.messages ?? resolveViewsMessage;
|
|
51
|
-
const words = React.useMemo(() => (
|
|
51
|
+
const words = React.useMemo(() => menuWordsOf(say), [say]);
|
|
52
52
|
return _jsx(Menu, { words: words, entries: menuEntries(items, say({ key: "views.menus.not-now" })), label: label ?? "", open: open, onOpenChange: (next, d) => onOpenChange(next, { reason: d.reason }), anchor: anchor, side: side, align: align === "center" || align === undefined ? "start" : align });
|
|
53
53
|
}
|
|
@@ -10,7 +10,7 @@ export const NUMBER_EDITOR_LOOKS = {
|
|
|
10
10
|
options,
|
|
11
11
|
looks: [
|
|
12
12
|
{ id: "attio", name: "Attio", picks: { arrows: "editing", units: "code", sheet: "line" } },
|
|
13
|
-
{ id: "mihai", name: "
|
|
13
|
+
{ id: "mihai", name: "Outright", picks: { arrows: "none", units: "sign", sheet: "field" } },
|
|
14
14
|
],
|
|
15
15
|
};
|
|
16
16
|
export const numberEditorWornOf = (el) => lookWornOf(NUMBER_EDITOR_LOOKS, el, ["arrows", "units", "sheet"]);
|
|
@@ -2,17 +2,19 @@ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-run
|
|
|
2
2
|
import { useRender } from "@base-ui/react/use-render";
|
|
3
3
|
import * as React from "react";
|
|
4
4
|
import { cx } from "../../internal/cx.js";
|
|
5
|
+
import { phoneMark, usePhoneForm } from "../internal/phone.js";
|
|
5
6
|
import { TagCut, TagRemove } from "../tag/tag.js";
|
|
6
7
|
import { optionColours } from "./looks.js";
|
|
7
8
|
export const Option = React.forwardRef(function Option({ children, colour, count, onRemove, size, icon, iconEnd, render, className, ...props }, ref) {
|
|
8
9
|
const word = typeof children === "string" ? children : undefined;
|
|
9
10
|
const shown = onRemove ? undefined : render;
|
|
10
11
|
const link = React.isValidElement(shown) && shown.props.href != null;
|
|
12
|
+
const phone = usePhoneForm(undefined, link && count == null);
|
|
11
13
|
const element = useRender({
|
|
12
14
|
defaultTagName: "span", render: shown, ref, enabled: count == null,
|
|
13
15
|
props: {
|
|
14
16
|
className: cx("o-tag o-option", size === "lg" && "o-option-lg", className), title: word, "data-kit": "option",
|
|
15
|
-
"data-colour": colour && optionColours.includes(colour) ? colour : undefined, ...(link ? { "data-link": "" } : {}), ...props,
|
|
17
|
+
"data-colour": colour && optionColours.includes(colour) ? colour : undefined, ...(link ? { "data-link": "" } : {}), ...phoneMark(phone), ...props,
|
|
16
18
|
children: _jsxs(_Fragment, { children: [_jsx(TagCut, {}), icon != null && _jsx("span", { className: "o-option-icon", "data-side": "start", "aria-hidden": "true", children: icon }), _jsx("span", { className: "o-tag-word", children: children }), iconEnd != null && !onRemove && _jsx("span", { className: "o-option-icon", "data-side": "end", "aria-hidden": "true", children: iconEnd }), onRemove && _jsx(TagRemove, { word: word, onRemove: onRemove })] }),
|
|
17
19
|
},
|
|
18
20
|
});
|
|
@@ -74,7 +74,7 @@
|
|
|
74
74
|
/* ── A link (after Attio's record chips): at rest the chip as it is, its words the Option's and never
|
|
75
75
|
underlined; under the pointer the hover fill (under Grey fill a step darker; a coloured pill or flat fill its colour's fill, a
|
|
76
76
|
pill's edge its hue), pressed the pressed fill (Grey fill and a coloured fill keep their hover's) at 98%; from the keys the focus
|
|
77
|
-
ring. The states weigh (0,4,0) and more, over the colour looks' grounds. On the phone it takes taps from 44 (
|
|
77
|
+
ring. The states weigh (0,4,0) and more, over the colour looks' grounds. On the phone it takes taps from 44 (press.css's pressing area). ── */
|
|
78
78
|
.o-option[data-link] {
|
|
79
79
|
--o-option-hover: var(--vk-hovered); --o-option-pressed: var(--vk-pressed);
|
|
80
80
|
cursor: pointer; text-decoration: none; outline: none; -webkit-tap-highlight-color: transparent;
|
|
@@ -28,6 +28,10 @@ export interface PaneProps {
|
|
|
28
28
|
}
|
|
29
29
|
/** A list's panel at its right edge, the list in use beside it. */
|
|
30
30
|
export declare function Pane({ open, onOpenChange, container, opener, initialFocus, "aria-label": label, className, children }: PaneProps): import("react/jsx-runtime").JSX.Element | null;
|
|
31
|
+
/** Whether what draws stands inside a Pane: its title and close are the Pane's Dialog's, which a body outside one (the toolbar's
|
|
32
|
+
* popover) draws plain instead (Customize, VK-840). A Popover opened from inside a Pane sets it back to false round what it holds.
|
|
33
|
+
* The package's own; no entry point exports it. */
|
|
34
|
+
export declare const InPane: React.Context<boolean>;
|
|
31
35
|
type Slot = {
|
|
32
36
|
children: React.ReactNode;
|
|
33
37
|
className?: string;
|
|
@@ -61,8 +61,9 @@ export function Pane({ open, onOpenChange, container, opener, initialFocus = tru
|
|
|
61
61
|
};
|
|
62
62
|
if (!container)
|
|
63
63
|
return null;
|
|
64
|
-
return (_jsx(Dialog.Root, { open: open, onOpenChange: change, modal: false, disablePointerDismissal: true, children: _jsx(Dialog.Portal, { container: container, className: "o-pane-portal", children: _jsx(Dialog.Popup, { ref: popup, className: cx("o-pane", className), "data-kit": "pane", "aria-label": label, initialFocus: initialFocus ? popup : false, finalFocus: backTo, children: _jsx("div", { className: "o-pane-cut o-smooth", children: children }) }) }) }));
|
|
64
|
+
return (_jsx(Dialog.Root, { open: open, onOpenChange: change, modal: false, disablePointerDismissal: true, children: _jsx(Dialog.Portal, { container: container, className: "o-pane-portal", children: _jsx(Dialog.Popup, { ref: popup, className: cx("o-pane", className), "data-kit": "pane", "aria-label": label, initialFocus: initialFocus ? popup : false, finalFocus: backTo, children: _jsx("div", { className: "o-pane-cut o-smooth", children: _jsx(InPane.Provider, { value: true, children: children }) }) }) }) }));
|
|
65
65
|
}
|
|
66
|
+
export const InPane = React.createContext(false);
|
|
66
67
|
export function PaneHead({ children, className }) {
|
|
67
68
|
return _jsx("div", { className: cx("o-pane-head", className), children: children });
|
|
68
69
|
}
|
|
@@ -15,7 +15,7 @@ export const PICKER_LOOKS = {
|
|
|
15
15
|
options,
|
|
16
16
|
looks: [
|
|
17
17
|
{ id: "attio", name: "Attio", picks: { search: "always", picked: "first", mark: "check", line: "beside", create: "apart", doing: "centred", heading: "hidden", kind: "badge", face: "32" } },
|
|
18
|
-
{ id: "mihai", name: "
|
|
18
|
+
{ id: "mihai", name: "Outright", picks: { search: "needed", picked: "count", mark: "tick", line: "below", create: "last", doing: "start", heading: "shown", kind: "end", face: "32" } },
|
|
19
19
|
],
|
|
20
20
|
};
|
|
21
21
|
const READ = ["search", "picked", "mark", "line", "create", "heading", "kind", "face"];
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { ComponentType } from "react";
|
|
2
2
|
import type { ViewsPickerItem, ViewsPickerProps } from "../../provider/components.js";
|
|
3
3
|
import type { ViewsMessageResolver } from "../../contract.js";
|
|
4
|
+
import type { MenuWords } from "../menu/menu.js";
|
|
4
5
|
import { type PickerItem, type PickerProps, type PickerWords } from "./picker.js";
|
|
5
6
|
type AppIcon = ComponentType<{
|
|
6
7
|
name: string;
|
|
@@ -20,8 +21,11 @@ export declare function pickerItemsOf(items: readonly ViewsPickerItem[], { AppIc
|
|
|
20
21
|
}): PickerItem[];
|
|
21
22
|
/** The Picker's words in the app's: each from its `views.picker.*` message. */
|
|
22
23
|
export declare function pickerWordsOf(say: ViewsMessageResolver): PickerWords;
|
|
23
|
-
/**
|
|
24
|
-
|
|
24
|
+
/** A menu's own words in the app's messages: a level's search, a sheet's ✕ and Back, the Close row, and a level's list (the
|
|
25
|
+
* Picker's). ViewKit's menu and the Picker's own menus are handed them. */
|
|
26
|
+
export declare const menuWordsOf: (say: ViewsMessageResolver) => MenuWords;
|
|
27
|
+
/** What the Picker is handed for ViewKit's props: its rows read as the Picker's, an action's key its id, the shell's draft, its words and its menus'. */
|
|
28
|
+
export declare function pickerPropsOf({ items, actions, steps, ...rest }: ViewsPickerProps, AppIcon?: AppIcon, words?: PickerWords, menuWords?: MenuWords): PickerProps;
|
|
25
29
|
/** ViewKit's pick list, drawn as the Picker. */
|
|
26
30
|
export declare function MapPicker(props: ViewsPickerProps): import("react/jsx-runtime").JSX.Element;
|
|
27
31
|
export {};
|
|
@@ -56,10 +56,12 @@ export function pickerWordsOf(say) {
|
|
|
56
56
|
you: say({ key: "views.picker.you" }),
|
|
57
57
|
};
|
|
58
58
|
}
|
|
59
|
-
export
|
|
59
|
+
export const menuWordsOf = (say) => ({ search: say({ key: "views.menus.search" }), close: say({ key: "views.panels.close" }), back: say({ key: "views.panels.back" }), picker: pickerWordsOf(say) });
|
|
60
|
+
export function pickerPropsOf({ items, actions, steps, ...rest }, AppIcon, words, menuWords) {
|
|
60
61
|
return {
|
|
61
62
|
...rest,
|
|
62
63
|
...(words ? { words } : {}),
|
|
64
|
+
...(menuWords ? { menuWords } : {}),
|
|
63
65
|
items: pickerItemsOf(items, { ...(AppIcon ? { AppIcon } : {}), ...(steps ? { steps } : {}) }),
|
|
64
66
|
...(actions ? { actions: actions.map((a) => ({ id: a.key, label: a.label, icon: a.icon ?? null, onSelect: a.onSelect })) } : {}),
|
|
65
67
|
draft: "shell",
|
|
@@ -67,5 +69,5 @@ export function pickerPropsOf({ items, actions, steps, ...rest }, AppIcon, words
|
|
|
67
69
|
}
|
|
68
70
|
export function MapPicker(props) {
|
|
69
71
|
const { components, messages } = useViews();
|
|
70
|
-
return _jsx(Picker, { ...pickerPropsOf(props, components.AppIcon, pickerWordsOf(messages)) });
|
|
72
|
+
return _jsx(Picker, { ...pickerPropsOf(props, components.AppIcon, pickerWordsOf(messages), menuWordsOf(messages)) });
|
|
71
73
|
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
+
import { type MenuWords } from "../menu/menu.js";
|
|
2
3
|
import { type SheetHeadProps } from "../sheet/bottom-sheet.js";
|
|
3
4
|
import { type PickerItem } from "./rows.js";
|
|
4
5
|
export type { PickerItem, PickerAs } from "./rows.js";
|
|
@@ -135,6 +136,12 @@ export interface PickerProps {
|
|
|
135
136
|
/** On a phone, a frame of their own round its rows' menus' rows (the Menu's `frame`, MENU_LIST_CARD_FRAME): what a list whose
|
|
136
137
|
* rows' menus are no menu's own sheet (a list of views) keeps, whatever the app picked round it. */
|
|
137
138
|
menuFrame?: Readonly<Record<string, string>>;
|
|
139
|
+
/** On a phone, a row's ⋯ hands its value here and opens no Menu of its own: its holder turns its Sheet into the row's menu (a
|
|
140
|
+
* list of views; one sheet, never a sheet on top). On a computer it changes nothing. */
|
|
141
|
+
onRowMenu?: (value: string) => void;
|
|
142
|
+
/** Its menus' own words (a row's own menu, and on a phone the ⋯ beside its search): a level's search, a sheet's ✕ and Back, the Close
|
|
143
|
+
* row, each the app's where handed, else English; a level's list takes the Picker's own `words`. */
|
|
144
|
+
menuWords?: Omit<MenuWords, "picker">;
|
|
138
145
|
/** Its rows can be put in order: a row pressed and dragged, with no grip (on a phone after a hold), or ⌥↑ ⌥↓ on the lit
|
|
139
146
|
* row, only among the rows under its own heading and never while something is typed; handed every value in its new order at each
|
|
140
147
|
* move. Left out, no row moves. */
|
|
@@ -180,6 +180,7 @@ export function usePicker(props) {
|
|
|
180
180
|
function usePickerAt(props, under) {
|
|
181
181
|
const { label, items, multiple, value, onDone, empty, search, onSearch, doing, onRetry, onMore, nothingYet, actions = [], readOnly, none: noneWords } = props;
|
|
182
182
|
const w = { ...PICKER_WORDS, ...props.words };
|
|
183
|
+
const menuWords = { ...props.menuWords, ...(props.words ? { picker: props.words } : {}) };
|
|
183
184
|
const onValueChange = readOnly ? () => { } : props.onValueChange, onCreate = readOnly ? undefined : props.onCreate;
|
|
184
185
|
const host = React.useContext(PhoneHost), small = usePhone();
|
|
185
186
|
const form = props.form ?? (host || small ? "phone" : "computer");
|
|
@@ -427,7 +428,10 @@ function usePickerAt(props, under) {
|
|
|
427
428
|
return false;
|
|
428
429
|
e.preventDefault();
|
|
429
430
|
e.preventBaseUIHandler?.();
|
|
430
|
-
|
|
431
|
+
if (form === "phone" && props.onRowMenu)
|
|
432
|
+
props.onRowMenu(row.item.value);
|
|
433
|
+
else
|
|
434
|
+
setRowMenu({ value: row.item.value, anchor: dots });
|
|
431
435
|
return true;
|
|
432
436
|
};
|
|
433
437
|
const backKey = (e) => {
|
|
@@ -452,11 +456,34 @@ function usePickerAt(props, under) {
|
|
|
452
456
|
lightRow(at >= 0 ? open[(at + (down ? 1 : -1) + open.length) % open.length] : down ? open[0] : open[open.length - 1]);
|
|
453
457
|
return true;
|
|
454
458
|
};
|
|
459
|
+
const passKey = (e) => {
|
|
460
|
+
if (form !== "computer" || e.altKey || e.metaKey || e.ctrlKey || e.shiftKey || (e.key !== "ArrowDown" && e.key !== "ArrowUp"))
|
|
461
|
+
return false;
|
|
462
|
+
const rows = optionRows(), n = rows.length, step = e.key === "ArrowDown" ? 1 : -1;
|
|
463
|
+
if (!n)
|
|
464
|
+
return false;
|
|
465
|
+
const at = rows.findIndex((r) => r.hasAttribute("data-highlighted"));
|
|
466
|
+
const next = at < 0 ? (step > 0 ? 0 : n - 1) : (at + step + n) % n;
|
|
467
|
+
if (!rows[next].hasAttribute("data-disabled"))
|
|
468
|
+
return false;
|
|
469
|
+
e.preventDefault();
|
|
470
|
+
e.preventBaseUIHandler?.();
|
|
471
|
+
for (let k = 1; k < n; k++) {
|
|
472
|
+
const row = rows[(next + k * step + n * n) % n];
|
|
473
|
+
if (!row.hasAttribute("data-disabled")) {
|
|
474
|
+
lightRow(row);
|
|
475
|
+
break;
|
|
476
|
+
}
|
|
477
|
+
}
|
|
478
|
+
return true;
|
|
479
|
+
};
|
|
455
480
|
const ends = (e) => {
|
|
456
481
|
if (backKey(e))
|
|
457
482
|
return;
|
|
458
483
|
if (restKey(e))
|
|
459
484
|
return;
|
|
485
|
+
if (passKey(e))
|
|
486
|
+
return;
|
|
460
487
|
if (menuKey(e))
|
|
461
488
|
return;
|
|
462
489
|
if (orderKey(e))
|
|
@@ -472,17 +499,33 @@ function usePickerAt(props, under) {
|
|
|
472
499
|
lightRow(e.key === "Home" ? open[0] : open[open.length - 1]);
|
|
473
500
|
};
|
|
474
501
|
const searchBox = React.useCallback((el) => { input.current = el; focusesInPlace(el); }, []);
|
|
502
|
+
const firstPickable = () => {
|
|
503
|
+
const rows = optionRows();
|
|
504
|
+
return rows.find((r) => r.dataset.name != null && !r.hasAttribute("data-disabled")) ?? rows.find((r) => r.classList.contains("o-picker-create"));
|
|
505
|
+
};
|
|
475
506
|
const answer = items.map((i) => i.value).join("\u0000");
|
|
476
507
|
React.useEffect(() => {
|
|
477
508
|
if (!server || form === "phone" || !find.trim() || doing)
|
|
478
509
|
return;
|
|
479
|
-
|
|
480
|
-
if (rows.some((r) => r.hasAttribute("data-highlighted")))
|
|
510
|
+
if (optionRows().some((r) => r.hasAttribute("data-highlighted")))
|
|
481
511
|
return;
|
|
482
|
-
const first =
|
|
512
|
+
const first = firstPickable();
|
|
483
513
|
if (first)
|
|
484
514
|
lightRow(first);
|
|
485
515
|
}, [answer, doing]);
|
|
516
|
+
React.useEffect(() => {
|
|
517
|
+
if (form === "phone" || !find.trim() || doing)
|
|
518
|
+
return;
|
|
519
|
+
const frame = requestAnimationFrame(() => {
|
|
520
|
+
const lit = optionRows().find((r) => r.hasAttribute("data-highlighted"));
|
|
521
|
+
if (lit && (!lit.hasAttribute("data-disabled") || litByPerson.current))
|
|
522
|
+
return;
|
|
523
|
+
const first = firstPickable();
|
|
524
|
+
if (first)
|
|
525
|
+
lightRow(first);
|
|
526
|
+
});
|
|
527
|
+
return () => cancelAnimationFrame(frame);
|
|
528
|
+
}, [find, doing]);
|
|
486
529
|
const openedNow = under ? under.open : true;
|
|
487
530
|
React.useEffect(() => {
|
|
488
531
|
if (form === "phone" || !openedNow || !opening.current.trim())
|
|
@@ -553,7 +596,13 @@ function usePickerAt(props, under) {
|
|
|
553
596
|
const stopKeys = (e) => { if (e.key === "Enter" || e.key === " ")
|
|
554
597
|
e.stopPropagation(); };
|
|
555
598
|
const rowTrigger = (item) => {
|
|
556
|
-
const open = (e) => {
|
|
599
|
+
const open = (e) => {
|
|
600
|
+
e.stopPropagation();
|
|
601
|
+
if (form === "phone" && props.onRowMenu)
|
|
602
|
+
props.onRowMenu(item.value);
|
|
603
|
+
else
|
|
604
|
+
setRowMenu({ value: item.value, anchor: e.currentTarget });
|
|
605
|
+
};
|
|
557
606
|
return form === "phone"
|
|
558
607
|
? _jsx(MenuDots, { label: w.rowActions(item.label), className: "o-picker-row-menu", onClick: open, onKeyDown: stopKeys })
|
|
559
608
|
: _jsx(Button, { kind: "quiet", shape: "icon", size: "20", tabIndex: -1, className: "o-picker-row-menu", "data-shown": props.rowMenus ?? "always", "aria-label": w.rowActions(item.label), icon: glyph(DOTS_V), onClick: open, onKeyDown: stopKeys });
|
|
@@ -562,7 +611,7 @@ function usePickerAt(props, under) {
|
|
|
562
611
|
const menuItem = rowMenu ? itemOf(rowMenu.value) : undefined;
|
|
563
612
|
const rowMenuEl = items.some(hasMenu)
|
|
564
613
|
? _jsx(Menu, { label: menuItem?.label ?? label, entries: menuItem?.menu ?? [], anchor: rowMenu?.anchor ?? null, align: rowMenu?.anchor instanceof HTMLElement ? "end" : "start", open: !!rowMenu?.open, onOpenChange: (o) => { if (!o)
|
|
565
|
-
setMenuAt((m) => m && { ...m, open: false }); }, frame: props.menuFrame })
|
|
614
|
+
setMenuAt((m) => m && { ...m, open: false }); }, frame: props.menuFrame, words: menuWords })
|
|
566
615
|
: null;
|
|
567
616
|
const ordering = !!props.onOrderChange && !find.trim() && !level;
|
|
568
617
|
const keptNow = multiple && own ? draft : held;
|
|
@@ -740,7 +789,7 @@ function usePickerAt(props, under) {
|
|
|
740
789
|
const showBar = !none && (pill || creatable || menu.length > 0 || (!!level && !byHolder));
|
|
741
790
|
const bar = showBar && (_jsxs("div", { className: "o-picker-bar", children: [level && !byHolder && _jsx(GlassButton, { "aria-label": w.back(level.label), icon: glyph(BACK), className: "o-picker-round", "data-back": "", onMouseDown: (e) => e.preventDefault(), onClick: () => back() }), pill && (_jsxs(InputGroup, { size: "lg", className: "o-picker-pill", ...pillTap, children: [_jsx(InputGroupAddon, { side: "start", children: glyph(SEARCH) }), _jsx(Input, { combobox: true, autofill: false, ref: pillInput, placeholder: search, "aria-label": search ?? label, onKeyDown: (e) => { if (!backKey(e))
|
|
742
791
|
enter(e); } })] })), creatable ? _jsx(Button, { kind: "primary", size: "lg", icon: glyph(PLUS), className: "o-picker-create-button", onClick: createTyped, children: w.createButton })
|
|
743
|
-
: menu.length > 0 && _jsx(Menu, { label: label, entries: menu, trigger: _jsx(GlassButton, { "aria-label": w.actions, icon: glyph(DOTS), className: "o-picker-round" }) })] }));
|
|
792
|
+
: menu.length > 0 && _jsx(Menu, { label: label, entries: menu, words: menuWords, trigger: _jsx(GlassButton, { "aria-label": w.actions, icon: glyph(DOTS), className: "o-picker-round" }) })] }));
|
|
744
793
|
const menuOpen = (item) => (menuOpenFor(item.value) ? { "data-menu-open": "" } : {});
|
|
745
794
|
const heldHere = (v) => inPlace && kept.includes(v);
|
|
746
795
|
const rowValue = (item) => (heldHere(item.value) && !changing ? { key: `unpick:${item.value}`, kind: "unpick", item } : itemEntry(item));
|
|
@@ -804,7 +853,7 @@ function usePickerAt(props, under) {
|
|
|
804
853
|
}, modal: true, disabled: under.disabled, multiple: multiple, value: value_, onValueChange: (v, d) => {
|
|
805
854
|
if (d.reason !== "escape-key")
|
|
806
855
|
take(v, d);
|
|
807
|
-
}, inputValue: query, onInputValueChange: (q, d) => (d.reason === "escape-key" && heldName ? setQuery(heldName) : ask(q)), autoHighlight: true, onItemHighlighted: highlighted, itemToStringValue: (e) => e.key, itemToStringLabel: (e) => entryLabel(e), isItemEqualToValue: (a, b) => a.key === b.key, children: [typeof under.box === "function" ? under.box({ onKeyDown: (e) => { if (!backKey(e) && !restKey(e) && !menuKey(e) && !orderKey(e))
|
|
856
|
+
}, inputValue: query, onInputValueChange: (q, d) => (d.reason === "escape-key" && heldName ? setQuery(heldName) : ask(q)), autoHighlight: true, onItemHighlighted: highlighted, itemToStringValue: (e) => e.key, itemToStringLabel: (e) => entryLabel(e), isItemEqualToValue: (a, b) => a.key === b.key, children: [typeof under.box === "function" ? under.box({ onKeyDown: (e) => { if (!backKey(e) && !restKey(e) && !passKey(e) && !menuKey(e) && !orderKey(e))
|
|
808
857
|
guard(e); }, typed: query, attrs: restAttrs }) : under.box, under.panel(list), _jsx("span", { ref: mark, hidden: true }), rowMenuEl] })) : (_jsxs(BaseCombobox.Root, { inline: true, open: true, multiple: multiple, value: value_, onValueChange: (v, d) => take(v, d), inputValue: query, onInputValueChange: ask, autoHighlight: true, onItemHighlighted: highlighted, itemToStringValue: (e) => e.key, itemToStringLabel: (e) => entryLabel(e), isItemEqualToValue: (a, b) => a.key === b.key, children: [list, rowMenuEl] }));
|
|
809
858
|
return { body, head: {}, step: null };
|
|
810
859
|
}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import type { ViewsPopoverProps } from "../../provider/components.js";
|
|
2
2
|
/** ViewKit's popup, drawn as the kit's Popover. */
|
|
3
|
-
export declare function MapPopover({ open, onOpenChange, anchor, side, align, sideOffset, alignOffset, initialFocus, onOutsidePress, onEscape, onPanelClick, panelData, style, className, children }: ViewsPopoverProps): import("react/jsx-runtime").JSX.Element;
|
|
3
|
+
export declare function MapPopover({ open, onOpenChange, anchor, side, align, sideOffset, alignOffset, initialFocus, onOutsidePress, onEscape, chrome, onPanelClick, panelData, style, className, children }: ViewsPopoverProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { Popover } from "./popover.js";
|
|
3
|
-
export function MapPopover({ open, onOpenChange, anchor, side, align, sideOffset, alignOffset, initialFocus, onOutsidePress, onEscape, onPanelClick, panelData, style, className, children }) {
|
|
4
|
-
return (_jsx(Popover, { open: open, onOpenChange: (next, d) => onOpenChange(next, { reason: d.reason }), anchor: anchor, side: side, align: align, sideOffset: sideOffset, alignOffset: alignOffset, initialFocus: initialFocus, onOutsidePress: onOutsidePress, onEscape: onEscape, style: style, onPopupClick: onPanelClick, popupData: panelData, className: className, children: children }));
|
|
3
|
+
export function MapPopover({ open, onOpenChange, anchor, side, align, sideOffset, alignOffset, initialFocus, onOutsidePress, onEscape, chrome, onPanelClick, panelData, style, className, children }) {
|
|
4
|
+
return (_jsx(Popover, { open: open, onOpenChange: (next, d) => onOpenChange(next, { reason: d.reason }), anchor: anchor, side: side, align: align, sideOffset: sideOffset, alignOffset: alignOffset, initialFocus: initialFocus, onOutsidePress: onOutsidePress, onEscape: onEscape, style: style, onPopupClick: onPanelClick, popupData: chrome === "menu" ? { ...panelData, "data-popover-chrome": "menu" } : panelData, className: className, children: children }));
|
|
5
5
|
}
|
|
@@ -6,6 +6,7 @@ import { anchorElement, isElement, positionerAnchor } from "../internal/anchor.j
|
|
|
6
6
|
import { closeReasonOf } from "../internal/close-reason.js";
|
|
7
7
|
import { phoneMark, usePhoneForm } from "../internal/phone.js";
|
|
8
8
|
import { popupHostOf } from "../internal/popup-host.js";
|
|
9
|
+
import { InPane } from "../pane/pane.js";
|
|
9
10
|
import { Scrollbar } from "../scrollbar/scrollbar.js";
|
|
10
11
|
const reasonOf = (reason) => { const r = closeReasonOf(reason); return r === "swipe" ? "none" : r; };
|
|
11
12
|
function useLastPress(open) {
|
|
@@ -94,7 +95,7 @@ export function Popover({ open, defaultOpen, onOpenChange, trigger, anchor, side
|
|
|
94
95
|
setShown(next);
|
|
95
96
|
onOpenChange?.(next, { reason: reasonOf(details.reason), event: details.event });
|
|
96
97
|
};
|
|
97
|
-
return (_jsxs(BasePopover.Root, { open: isOpen, onOpenChange: change, children: [trigger && _jsx(BasePopover.Trigger, { ref: holdOpener, render: trigger }), _jsx(BasePopover.Portal, { container: host, children: _jsx(BasePopover.Positioner, { ref: setPositioner, className: "o-popover-positioner", anchor: placed, positionMethod: "fixed", side: side, align: align, sideOffset: sideOffset, alignOffset: alignOffset, children: _jsxs(BasePopover.Popup, { ref: popup, className: cx("o-popover", className), "data-kit": "popover", "aria-label": label, initialFocus: initialFocus, finalFocus: finalFocus, style: style, onClick: onPopupClick, "data-over": sideOffset < 0 ? "" : undefined, ...phoneMark(phone), ...popupData, children: [_jsx("div", { className: "o-popover-cut o-smooth", children: children }), _jsx(Scrollbar, {})] }) }) })] }));
|
|
98
|
+
return (_jsxs(BasePopover.Root, { open: isOpen, onOpenChange: change, children: [trigger && _jsx(BasePopover.Trigger, { ref: holdOpener, render: trigger }), _jsx(BasePopover.Portal, { container: host, children: _jsx(BasePopover.Positioner, { ref: setPositioner, className: "o-popover-positioner", anchor: placed, positionMethod: "fixed", side: side, align: align, sideOffset: sideOffset, alignOffset: alignOffset, children: _jsxs(BasePopover.Popup, { ref: popup, className: cx("o-popover", className), "data-kit": "popover", "aria-label": label, initialFocus: initialFocus, finalFocus: finalFocus, style: style, onClick: onPopupClick, "data-over": sideOffset < 0 ? "" : undefined, ...phoneMark(phone), ...popupData, children: [_jsx("div", { className: "o-popover-cut o-smooth", children: _jsx(InPane.Provider, { value: false, children: children }) }), _jsx(Scrollbar, {})] }) }) })] }));
|
|
98
99
|
}
|
|
99
100
|
export function PopoverTitle({ children, className }) {
|
|
100
101
|
return _jsx(BasePopover.Title, { className: cx("o-popover-title", className), children: children });
|
|
@@ -12,6 +12,9 @@
|
|
|
12
12
|
data-popover-padding 0 · 4 · 8 · 12 · 16 how far what it holds stands from its edge
|
|
13
13
|
data-popover-gap 0 · 4 · 8 how far it stands from what opened it (none laid over it)
|
|
14
14
|
|
|
15
|
+
On the popup itself, `data-popover-chrome="menu"` marks a popup that holds a list (the components map's `chrome`): the Outright
|
|
16
|
+
look draws it as its card, as its editors were approved; an app's own styles may draw it otherwise.
|
|
17
|
+
|
|
15
18
|
The rules sit in the components layer, so a utility class on it still wins. */
|
|
16
19
|
@layer components {
|
|
17
20
|
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { ViewsPortsHostProps } from "../../provider/components.js";
|
|
2
|
+
import type { ViewsToastPort } from "../../provider/ports.js";
|
|
3
|
+
import { type ToastManager } from "../toast/toast.js";
|
|
4
|
+
/** The toast port on a manager: success with its Undo, error as failed, info plain, warning with its second line. */
|
|
5
|
+
export declare function toastPortOf(manager: ToastManager): ViewsToastPort;
|
|
6
|
+
/** ViewKit's ports host. */
|
|
7
|
+
export declare function MapPortsHost({ toast, confirm, onReady }: ViewsPortsHostProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,43 @@
|
|
|
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 { ViewsContext } from "../../provider/context.js";
|
|
5
|
+
import { resolveViewsMessage } from "../../contract.js";
|
|
6
|
+
import { AlertDialog } from "../alert-dialog/alert-dialog.js";
|
|
7
|
+
import { createToastManager, Toast } from "../toast/toast.js";
|
|
8
|
+
export function toastPortOf(manager) {
|
|
9
|
+
return {
|
|
10
|
+
success: (message, options) => void manager.show({ words: message, ...(options?.undo && { undo: options.undo }) }),
|
|
11
|
+
error: (message) => void manager.show({ words: message, failed: true }),
|
|
12
|
+
info: (message) => void manager.show({ words: message }),
|
|
13
|
+
warning: (message, options) => void manager.show(options?.description ? { title: message, words: options.description, meaning: "warning" } : { words: message, meaning: "warning" }),
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
export function MapPortsHost({ toast, confirm, onReady }) {
|
|
17
|
+
const say = React.useContext(ViewsContext)?.messages ?? resolveViewsMessage;
|
|
18
|
+
const toastWords = React.useMemo(() => ({ undo: say({ key: "views.panels.toast-undo" }), close: say({ key: "views.panels.close" }), region: say({ key: "views.panels.toast-region" }) }), [say]);
|
|
19
|
+
const dialogWords = React.useMemo(() => ({ close: say({ key: "views.panels.close" }), failed: say({ key: "views.panels.alert-failed" }), tryAgain: say({ key: "views.picker.retry" }) }), [say]);
|
|
20
|
+
const { undo: undoWord, close: closeWord } = toastWords;
|
|
21
|
+
const manager = React.useMemo(() => createToastManager({ undo: undoWord, close: closeWord }), [undoWord, closeWord]);
|
|
22
|
+
const [asking, setAsking] = React.useState(null);
|
|
23
|
+
const standing = React.useRef(null);
|
|
24
|
+
const ask = React.useCallback((request) => new Promise((resolve) => {
|
|
25
|
+
standing.current?.answer(false);
|
|
26
|
+
const now = { request, open: true, answer: (yes) => { if (standing.current === now)
|
|
27
|
+
standing.current = null; resolve(yes); } };
|
|
28
|
+
standing.current = now;
|
|
29
|
+
setAsking(now);
|
|
30
|
+
}), []);
|
|
31
|
+
React.useEffect(() => {
|
|
32
|
+
onReady({ ...(toast && { toast: toastPortOf(manager) }), ...(confirm && { confirm: ask }) });
|
|
33
|
+
return () => { onReady({}); standing.current?.answer(false); };
|
|
34
|
+
}, [onReady, toast, confirm, manager, ask]);
|
|
35
|
+
const answered = (yes) => {
|
|
36
|
+
const now = asking;
|
|
37
|
+
if (!now)
|
|
38
|
+
return;
|
|
39
|
+
setAsking({ ...now, open: false });
|
|
40
|
+
now.answer(yes);
|
|
41
|
+
};
|
|
42
|
+
return (_jsxs(_Fragment, { children: [toast && (_jsx(Toast, { manager: manager, words: toastWords, children: null })), confirm && asking && (_jsx(AlertDialog, { open: asking.open, onAnswer: answered, title: asking.request.message, ...(asking.request.detail ? { line: asking.request.detail } : {}), action: asking.request.confirmLabel, kind: asking.request.destructive ? "danger" : "primary", cancel: say({ key: "views.picker.cancel" }), words: dialogWords }))] }));
|
|
43
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export declare const PRESS_TOKENS: readonly [{
|
|
2
|
+
readonly name: "--vk-spacing";
|
|
3
|
+
readonly kind: "size";
|
|
4
|
+
readonly outright: "--spacing";
|
|
5
|
+
}];
|
|
6
|
+
/** The pressing area's machinery, how far a packed control lets a target's area reach (`--pressing-room-x`, `-y`), is every
|
|
7
|
+
* control's family already (VK_CONTROL_PRIVATE_FAMILIES): nothing of its own. */
|
|
8
|
+
export declare const PRESS_PRIVATE: readonly [];
|