viewkitjs 0.28.0 → 0.30.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 +218 -0
- package/MIGRATION.md +181 -11
- 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 +2 -2
- package/views/dist/cells/cell-format.js +2 -2
- package/views/dist/cells/cell-values.js +9 -12
- package/views/dist/contract.d.ts +161 -18
- package/views/dist/contract.js +170 -28
- 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 +8 -0
- package/views/dist/controls/controls.js +8 -0
- package/views/dist/controls/customize/customize.d.ts +176 -0
- package/views/dist/controls/customize/customize.js +348 -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 +15 -0
- package/views/dist/controls/customize/map-customize-body.js +195 -0
- package/views/dist/controls/customize/map-ranges.d.ts +23 -0
- package/views/dist/controls/customize/map-ranges.js +41 -0
- package/views/dist/controls/customize/rules.d.ts +39 -0
- package/views/dist/controls/customize/rules.js +21 -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 +65 -0
- package/views/dist/controls/customize/words.js +42 -0
- package/views/dist/controls/customize.css +57 -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 +4 -0
- package/views/dist/controls/filter-editor/filter-editor.js +86 -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 +42 -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 +33 -9
- package/views/dist/controls/index.js +32 -9
- 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/menu-list/menu-list.d.ts +16 -1
- package/views/dist/controls/menu-list/menu-list.js +26 -8
- package/views/dist/controls/menu-list.css +8 -0
- 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 +59 -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/map-text-body.d.ts +1 -1
- package/views/dist/controls/text-editor/map-text-body.js +2 -2
- package/views/dist/controls/text-editor/text-editor.d.ts +3 -0
- package/views/dist/controls/text-editor/text-editor.js +17 -7
- package/views/dist/controls/text-editor.css +11 -0
- 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/values-editor/values.js +6 -2
- 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/options.d.ts +1 -1
- package/views/dist/display/range.d.ts +2 -1
- package/views/dist/display/range.js +4 -1
- package/views/dist/display/rich-text.js +0 -1
- package/views/dist/editors/ChipsEditor.d.ts +4 -5
- package/views/dist/editors/ChipsEditor.js +12 -78
- package/views/dist/editors/DateEditor.d.ts +12 -16
- package/views/dist/editors/DateEditor.js +40 -191
- package/views/dist/editors/EditorPanel.d.ts +2 -6
- package/views/dist/editors/EditorPanel.js +2 -2
- package/views/dist/editors/LocationEditor.d.ts +11 -19
- package/views/dist/editors/LocationEditor.js +19 -211
- package/views/dist/editors/NameEditor.d.ts +8 -16
- package/views/dist/editors/NameEditor.js +11 -100
- package/views/dist/editors/NumberEditor.d.ts +14 -21
- package/views/dist/editors/NumberEditor.js +22 -49
- package/views/dist/editors/RangeEditor.d.ts +9 -33
- package/views/dist/editors/RangeEditor.js +12 -97
- package/views/dist/editors/RelationEditor.d.ts +6 -9
- package/views/dist/editors/RelationEditor.js +11 -30
- package/views/dist/editors/RelationSetEditor.d.ts +13 -24
- package/views/dist/editors/RelationSetEditor.js +33 -101
- package/views/dist/editors/SelectEditor.d.ts +15 -17
- package/views/dist/editors/SelectEditor.js +15 -94
- package/views/dist/editors/TextEditor.d.ts +23 -26
- package/views/dist/editors/TextEditor.js +11 -48
- package/views/dist/editors/ValueListEditor.d.ts +14 -23
- package/views/dist/editors/ValueListEditor.js +16 -202
- package/views/dist/editors/body-panel.d.ts +13 -7
- package/views/dist/editors/body-panel.js +3 -7
- package/views/dist/editors/edit-cores.d.ts +15 -15
- package/views/dist/editors/edit-cores.js +14 -14
- package/views/dist/editors/number-body.d.ts +1 -1
- package/views/dist/editors/number-step.d.ts +0 -34
- package/views/dist/editors/number-step.js +0 -37
- package/views/dist/editors/option-add-flow.d.ts +1 -13
- package/views/dist/editors/option-add-flow.js +0 -22
- package/views/dist/editors/relation-links-body.d.ts +2 -3
- package/views/dist/editors/relation-picker.d.ts +13 -3
- package/views/dist/editors/relation-source.d.ts +0 -22
- package/views/dist/editors/relation-source.js +0 -21
- package/views/dist/field-row/FieldRow.js +5 -6
- package/views/dist/field-row/FieldRowLane.js +0 -1
- package/views/dist/field-row/editors/RowChipsEditor.js +2 -2
- package/views/dist/field-row/editors/RowDateEditor.d.ts +2 -2
- package/views/dist/field-row/editors/RowDateEditor.js +2 -2
- package/views/dist/field-row/editors/RowNameEditor.d.ts +2 -5
- package/views/dist/field-row/editors/RowNameEditor.js +7 -12
- package/views/dist/field-row/editors/RowNumberEditor.d.ts +1 -1
- package/views/dist/field-row/editors/RowNumberEditor.js +4 -4
- package/views/dist/field-row/editors/RowPlaceEditor.js +3 -3
- package/views/dist/field-row/editors/RowRangeEditor.d.ts +2 -5
- package/views/dist/field-row/editors/RowRangeEditor.js +7 -14
- package/views/dist/field-row/editors/RowRelationEditor.js +3 -3
- package/views/dist/field-row/editors/RowSelectEditor.js +2 -2
- package/views/dist/field-row/editors/RowTextEditor.d.ts +1 -1
- package/views/dist/field-row/editors/RowTextEditor.js +3 -4
- package/views/dist/field-row/editors/RowValueListEditor.js +5 -5
- package/views/dist/field-row/field-row-button.d.ts +6 -9
- package/views/dist/field-row/field-row-button.js +1 -6
- package/views/dist/field-row/field-row-checkbox.d.ts +1 -1
- package/views/dist/field-row/row-target.d.ts +0 -7
- package/views/dist/field-row/row-target.js +0 -2
- package/views/dist/grid/chrome/GridAddColumn.d.ts +2 -1
- package/views/dist/grid/chrome/GridAddColumn.js +8 -66
- package/views/dist/grid/chrome/GridAggregateMenu.d.ts +5 -7
- package/views/dist/grid/chrome/GridAggregateMenu.js +20 -39
- package/views/dist/grid/chrome/GridCellEditors.d.ts +2 -2
- package/views/dist/grid/chrome/GridCellEditors.js +12 -12
- package/views/dist/grid/chrome/GridChipsEditor.js +3 -3
- package/views/dist/grid/chrome/GridColumnMenu.d.ts +11 -12
- package/views/dist/grid/chrome/GridColumnMenu.js +32 -93
- package/views/dist/grid/chrome/GridDateEditor.d.ts +6 -6
- package/views/dist/grid/chrome/GridDateEditor.js +3 -3
- package/views/dist/grid/chrome/GridGroupMenu.d.ts +4 -6
- package/views/dist/grid/chrome/GridGroupMenu.js +21 -62
- package/views/dist/grid/chrome/GridHeader.d.ts +1 -2
- package/views/dist/grid/chrome/GridHeader.js +3 -2
- package/views/dist/grid/chrome/GridLongTextEditor.d.ts +17 -38
- package/views/dist/grid/chrome/GridLongTextEditor.js +6 -7
- package/views/dist/grid/chrome/GridNameEditor.js +4 -4
- package/views/dist/grid/chrome/GridNumberEditor.d.ts +4 -5
- package/views/dist/grid/chrome/GridNumberEditor.js +5 -6
- package/views/dist/grid/chrome/GridPlaceEditor.d.ts +2 -5
- package/views/dist/grid/chrome/GridPlaceEditor.js +5 -5
- package/views/dist/grid/chrome/GridRangeEditor.d.ts +6 -12
- package/views/dist/grid/chrome/GridRangeEditor.js +7 -15
- package/views/dist/grid/chrome/GridRelationEditor.js +5 -5
- package/views/dist/grid/chrome/GridRow.js +0 -3
- package/views/dist/grid/chrome/GridRowActions.d.ts +1 -1
- package/views/dist/grid/chrome/GridRowActions.js +0 -5
- package/views/dist/grid/chrome/GridRowCells.js +11 -7
- package/views/dist/grid/chrome/GridSelectEditor.js +3 -3
- package/views/dist/grid/chrome/GridStructure.js +0 -1
- package/views/dist/grid/chrome/GridTable.js +1 -1
- package/views/dist/grid/chrome/GridTextEditor.d.ts +5 -7
- package/views/dist/grid/chrome/GridTextEditor.js +5 -18
- package/views/dist/grid/chrome/GridValueListEditor.js +4 -4
- package/views/dist/grid/chrome/grid-body-place.d.ts +2 -3
- package/views/dist/grid/chrome/grid-body-place.js +4 -8
- package/views/dist/grid/chrome/grid-button.d.ts +7 -10
- package/views/dist/grid/chrome/grid-button.js +1 -6
- package/views/dist/grid/chrome/grid-cell-classes.js +1 -1
- package/views/dist/grid/chrome/grid-column-menu-items.d.ts +4 -4
- package/views/dist/grid/chrome/grid-column-menu-items.js +10 -6
- 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/grid-group-menu-parts.d.ts +5 -9
- package/views/dist/grid/chrome/grid-group-menu-parts.js +1 -3
- package/views/dist/grid/chrome/grid-hover.js +0 -1
- package/views/dist/grid/chrome/grid-menu-focus.d.ts +7 -31
- package/views/dist/grid/chrome/grid-menu-focus.js +7 -47
- package/views/dist/grid/chrome/grid-styles.d.ts +0 -3
- package/views/dist/grid/chrome/grid-styles.js +0 -1
- package/views/dist/grid/chrome/grid-table-props.d.ts +6 -10
- package/views/dist/grid/chrome/useGridTableInteractionModel.js +2 -4
- package/views/dist/grid/core/clipboard-model.js +9 -4
- package/views/dist/grid/core/editing-controller.d.ts +2 -1
- package/views/dist/grid/core/editing-controller.js +10 -2
- package/views/dist/grid/core/refusal-sentence.d.ts +3 -0
- package/views/dist/grid/core/refusal-sentence.js +2 -2
- package/views/dist/grid/core/write-states.d.ts +3 -1
- package/views/dist/grid/core/write-states.js +6 -2
- 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/body-frame.d.ts +0 -32
- package/views/dist/model/body-frame.js +1 -15
- 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/column-inspect.d.ts +5 -5
- package/views/dist/model/column-inspect.js +2 -2
- package/views/dist/model/relation-filters.d.ts +2 -0
- package/views/dist/panels/customize-body.d.ts +1 -10
- package/views/dist/panels/customize-body.js +0 -3
- package/views/dist/panels/filter/MenuSelect.js +0 -5
- package/views/dist/panels/filter/RangeFilterBody.js +0 -1
- package/views/dist/panels/filter/details.d.ts +1 -5
- package/views/dist/panels/filter/details.js +0 -13
- package/views/dist/panels/filter/filter-list.d.ts +0 -1
- package/views/dist/panels/filter/filter-list.js +1 -1
- 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/panel-button.d.ts +10 -12
- package/views/dist/panels/panel-button.js +1 -6
- package/views/dist/panels/quick/model.d.ts +4 -0
- package/views/dist/panels/react/chrome.d.ts +0 -17
- package/views/dist/panels/react/chrome.js +0 -8
- package/views/dist/panels/react/customize-body.d.ts +14 -12
- package/views/dist/panels/react/customize-body.js +93 -19
- package/views/dist/panels/react/customize.d.ts +16 -12
- package/views/dist/panels/react/customize.js +4 -110
- package/views/dist/panels/react/filter/FilterEditor.d.ts +4 -18
- package/views/dist/panels/react/filter/FilterEditor.js +6 -330
- package/views/dist/panels/react/filter/FilterFieldList.d.ts +1 -1
- package/views/dist/panels/react/filter/FilterFieldList.js +27 -51
- package/views/dist/panels/react/filter/PhoneFilterEditor.d.ts +1 -11
- package/views/dist/panels/react/filter/PhoneFilterEditor.js +8 -144
- package/views/dist/panels/react/filter/editor-ctx.d.ts +1 -33
- package/views/dist/panels/react/filter/editor-ctx.js +5 -33
- package/views/dist/panels/react/filter/filter-body.js +5 -2
- package/views/dist/panels/react/filter/filter-part-body.d.ts +3 -6
- package/views/dist/panels/react/filter/filter-part-body.js +0 -5
- package/views/dist/panels/react/filter/rule-writes.d.ts +1 -26
- package/views/dist/panels/react/filter/rule-writes.js +4 -95
- package/views/dist/panels/react/order-details.d.ts +1 -26
- package/views/dist/panels/react/order-details.js +3 -69
- package/views/dist/panels/react/panel-header.js +0 -1
- 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/popover.d.ts +4 -7
- package/views/dist/panels/react/quick/QuickFiltersPanel.d.ts +2 -4
- package/views/dist/panels/react/quick/QuickFiltersPanel.js +16 -136
- package/views/dist/panels/react/sort/SortEditor.d.ts +4 -4
- package/views/dist/panels/react/sort/SortEditor.js +8 -245
- package/views/dist/panels/react/sort/SortFieldList.d.ts +1 -1
- package/views/dist/panels/react/sort/SortFieldList.js +11 -25
- 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/ToolbarAdvancedFilters.js +2 -2
- package/views/dist/panels/react/toolbar/ToolbarAsideFilter.js +2 -2
- package/views/dist/panels/react/toolbar/ToolbarBarFilter.js +16 -18
- 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/toolbar/ToolbarQuickFilters.js +1 -1
- package/views/dist/panels/react/toolbar/ToolbarSave.js +0 -4
- package/views/dist/panels/react/toolbar/ToolbarSearch.js +0 -1
- package/views/dist/panels/react/toolbar/ToolbarSortPill.js +3 -3
- package/views/dist/panels/react/view-actions.js +0 -1
- package/views/dist/panels/react/views-row/FoldingViewRow.js +2 -5
- package/views/dist/panels/react/views-row/ViewCreatePill.js +0 -1
- package/views/dist/panels/react/views-row/ViewPicker.js +30 -45
- package/views/dist/panels/react/views-row/ViewPickerRow.js +0 -2
- package/views/dist/panels/react/views-row/menu-classes.d.ts +0 -4
- package/views/dist/panels/react/views-row/menu-classes.js +0 -2
- package/views/dist/panels/react.d.ts +5 -12
- package/views/dist/panels/react.js +5 -12
- 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.d.ts +2 -46
- package/views/dist/provider/ViewsProvider.js +31 -27
- package/views/dist/provider/components.d.ts +295 -107
- package/views/dist/provider/context.d.ts +7 -21
- package/views/dist/provider/missing-slot.d.ts +3 -7
- package/views/dist/provider/missing-slot.js +2 -9
- package/views/dist/provider/ports.d.ts +18 -6
- package/views/dist/provider/ports.js +2 -1
- package/views/dist/react.d.ts +2 -3
- package/views/dist/react.js +1 -1
- package/views/dist/selection/SelectionBar.d.ts +2 -16
- package/views/dist/selection/SelectionBar.js +6 -4
- 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 +694 -191
- package/views/dist/styles.unlayered.css +691 -188
- package/views/docs/contract.md +133 -130
- 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/getting-started.md +222 -2
- package/views/docs/guides/atoms.md +2 -2
- package/views/docs/guides/cells.md +224 -4
- package/views/docs/guides/display.md +3 -3
- package/views/docs/guides/editors.md +235 -20
- package/views/docs/guides/looks.md +8 -2
- package/views/docs/guides/ports.md +7 -7
- package/views/docs/guides/selection.md +5 -1
- package/views/docs/guides/the-grid.md +15 -17
- package/views/docs/guides/the-provider.md +9 -15
- package/views/docs/install.md +4 -1
- package/views/docs/reference/cells.md +2 -2
- package/views/docs/reference/controls.md +215 -21
- package/views/docs/reference/display.md +1 -0
- package/views/docs/reference/editors-chips.md +2 -2
- package/views/docs/reference/editors-date.md +4 -4
- package/views/docs/reference/editors-location.md +4 -7
- package/views/docs/reference/editors-name.md +3 -5
- package/views/docs/reference/editors-number.md +10 -10
- package/views/docs/reference/editors-panel.md +3 -3
- package/views/docs/reference/editors-range.md +3 -5
- package/views/docs/reference/editors-relation.md +4 -4
- package/views/docs/reference/editors-select.md +3 -3
- package/views/docs/reference/editors-text.md +3 -4
- package/views/docs/reference/editors-value-list.md +3 -3
- package/views/docs/reference/field-row.md +1 -1
- package/views/docs/reference/grid.md +2 -2
- package/views/docs/reference/looks.md +25 -11
- package/views/docs/reference/panels-react.md +23 -37
- package/views/docs/reference/panels.md +8 -6
- package/views/docs/reference/react.md +24 -24
- package/views/docs/reference/selection.md +4 -2
- package/views/docs/reference/views.md +12 -11
- package/views/skills/views/SKILL.md +2 -2
- package/views/dist/editors/relation-panel.d.ts +0 -69
- package/views/dist/editors/relation-panel.js +0 -46
- package/views/dist/grid/chrome/GridColumnColorSection.d.ts +0 -13
- package/views/dist/grid/chrome/GridColumnColorSection.js +0 -40
- package/views/dist/grid/chrome/GridColumnDateSection.d.ts +0 -28
- package/views/dist/grid/chrome/GridColumnDateSection.js +0 -23
- package/views/dist/grid/chrome/GridColumnDurationSection.d.ts +0 -23
- package/views/dist/grid/chrome/GridColumnDurationSection.js +0 -24
- package/views/dist/grid/chrome/GridColumnNumberSection.d.ts +0 -29
- package/views/dist/grid/chrome/GridColumnNumberSection.js +0 -27
- package/views/dist/grid/chrome/GridColumnPercentSection.d.ts +0 -16
- package/views/dist/grid/chrome/GridColumnPercentSection.js +0 -16
- package/views/dist/grid/chrome/GridColumnSortSection.d.ts +0 -38
- package/views/dist/grid/chrome/GridColumnSortSection.js +0 -33
- package/views/dist/grid/chrome/GridFlyout.d.ts +0 -44
- package/views/dist/grid/chrome/GridFlyout.js +0 -80
- package/views/dist/grid/chrome/GridMenuRow.d.ts +0 -15
- package/views/dist/grid/chrome/GridMenuRow.js +0 -15
- package/views/dist/grid/chrome/grid-menu-search.d.ts +0 -7
- package/views/dist/grid/chrome/grid-menu-search.js +0 -7
- package/views/dist/panels/react/GroupBucketsList.d.ts +0 -16
- package/views/dist/panels/react/GroupBucketsList.js +0 -44
- package/views/dist/panels/react/LayoutColumnsList.d.ts +0 -24
- package/views/dist/panels/react/LayoutColumnsList.js +0 -101
- package/views/dist/panels/react/PopoverColumnDetail.d.ts +0 -11
- package/views/dist/panels/react/PopoverColumnDetail.js +0 -24
- package/views/dist/panels/react/drag.d.ts +0 -2
- package/views/dist/panels/react/drag.js +0 -5
- package/views/dist/panels/react/layout-detail.d.ts +0 -4
- package/views/dist/panels/react/layout-detail.js +0 -29
- package/views/dist/panels/react/root-list.d.ts +0 -6
- package/views/dist/panels/react/root-list.js +0 -31
- package/views/dist/panels/react/sort/use-sort-drag.d.ts +0 -17
- package/views/dist/panels/react/sort/use-sort-drag.js +0 -39
- package/views/dist/panels/react/view-footer.d.ts +0 -20
- package/views/dist/panels/react/view-footer.js +0 -41
|
@@ -48,35 +48,56 @@ 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
|
-
export { sortableFields, useSortEditor as useSortEditorParts } from "./sort-editor/sort-editor.js";
|
|
53
|
+
export { SortEditor, sortableFields, useSortEditor, 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 {
|
|
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 { FilterEditor, useFilterEditor, 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";
|
|
62
|
-
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";
|
|
64
|
+
export { FILTER_DEPTH, NO_FILTER, OWN_WAY, addRule, barOf, canGroup, changeRule, clearAll, depthOf, fieldOf, idsOf, isAdvanced, isGroup, isOwnWay, isPair, isSetAside, isWhole, itemOf, putBack as putFilterBack, removeRule, ruleText, rulesOf, setGroup, setJoin, takesOf, toAdvanced, toGroup, valueText } from "./filter-editor/rules.js";
|
|
63
65
|
export { FILTER_EDITOR_WORDS, filterWords } from "./filter-editor/words.js";
|
|
64
|
-
export { useGroupEditor } from "./group-editor/group-editor.js";
|
|
66
|
+
export { GroupEditor, 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 { Customize, 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";
|
|
73
|
-
export {
|
|
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";
|
|
94
|
+
export { TextEditor, 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";
|
|
76
97
|
export { TEXT_EDITOR_ATTRS, textEditorWornOf } from "./text-editor/looks.js";
|
|
77
98
|
export { TEXT_EDITOR_WORDS, textWords } from "./text-editor/words.js";
|
|
78
99
|
export { pickerItemsOf } from "./picker/map-picker.js";
|
|
79
|
-
export { useDateEditor, useDateEditorWorn } from "./date-editor/date-editor.js";
|
|
100
|
+
export { DateEditor, useDateEditor, useDateEditorWorn } from "./date-editor/date-editor.js";
|
|
80
101
|
export { DateParts } from "./date-editor/date-parts.js";
|
|
81
102
|
export { DateDays } from "./date-editor/date-days.js";
|
|
82
103
|
export { DATE_ERROR_WORDS, MONTH_NAMES, QUARTERS, WEEK, addDays, addMonths, cellText, dateNames, iso, lineDay, lineText, monthGrid, parts, quickPick, readDate, readTime, todayOf, weekday } from "./date-editor/calendar.js";
|
|
@@ -89,7 +110,7 @@ export { ATTIO_ROWS, PLACE_PARTS, countriesOf, placeLine, placeOf, placeText, re
|
|
|
89
110
|
export { compoundEditorRead, compoundEditorWornOf } from "./compound-editor/looks.js";
|
|
90
111
|
export { COMPOUND_EDITOR_WORDS, compoundWords } from "./compound-editor/words.js";
|
|
91
112
|
export { Flag } from "./flag/flag.js";
|
|
92
|
-
export { useNumberEditor, useNumberEditorWorn } from "./number-editor/number-editor.js";
|
|
113
|
+
export { NumberEditor, useNumberEditor, useNumberEditorWorn } from "./number-editor/number-editor.js";
|
|
93
114
|
export { boxLocale, numberText, readTyped } from "./number-editor/format.js";
|
|
94
115
|
export { NUMBER_EDITOR_ATTRS, numberEditorWornOf } from "./number-editor/looks.js";
|
|
95
116
|
export { NUMBER_EDITOR_WORDS, numberWords } from "./number-editor/words.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
|
}
|
|
@@ -38,6 +38,20 @@ MenuAction
|
|
|
38
38
|
defaultChecked?: boolean;
|
|
39
39
|
onCheckedChange?: (checked: boolean) => void;
|
|
40
40
|
disabled?: string;
|
|
41
|
+
/** It opens a level of its own too (a column's settings, VK-890): the name of the › after its tick, which opens it, as → on
|
|
42
|
+
* the row does; Enter and Space still tick it. Its holder shows the level, handed the entry through `onOpen`. Drawn by
|
|
43
|
+
* `MenuListPanelRows` and `MenuList`; a menu's rows (`MenuListRows`, `MenuListShown`) leave it and `toggle` out. */
|
|
44
|
+
opens?: string;
|
|
45
|
+
/** One Toggle of its own before its tick (a card's field starting a new line, VK-890): its mark, its name, whether it is on
|
|
46
|
+
* and its press; `disabled` says why it can't be pressed, its tooltip, and a press writes nothing. The Toggle and the › keep
|
|
47
|
+
* working on a row that can't be ticked (`disabled`): a locked column's settings still open. */
|
|
48
|
+
toggle?: {
|
|
49
|
+
icon: React.ReactNode;
|
|
50
|
+
label: string;
|
|
51
|
+
on: boolean;
|
|
52
|
+
onPress: () => void;
|
|
53
|
+
disabled?: string;
|
|
54
|
+
};
|
|
41
55
|
}
|
|
42
56
|
/** A choice one level in: what it sets and what it is now; its choices open against the menu's edge. `detail` says what it is
|
|
43
57
|
* now in words of its own, in place of its choice's name (a colour's "Blue" while Automatic is ticked). */
|
|
@@ -137,7 +151,8 @@ export interface MenuListPanelRowsProps {
|
|
|
137
151
|
label: string;
|
|
138
152
|
/** Its rows, in the Menu's order. */
|
|
139
153
|
entries: MenuListEntry[];
|
|
140
|
-
/** A row one level in (a choice or actions row) was pressed: what it opens is its holder's to
|
|
154
|
+
/** A row one level in (a choice or actions row, or a tick row's › by `opens`) was pressed: what it opens is its holder's to
|
|
155
|
+
* show, in place. */
|
|
141
156
|
onOpen?: (entry: MenuListEntry) => void;
|
|
142
157
|
/** How a tick is drawn: the tick box before its name, as in a menu (the default), the Switch at its end, or an eye at its end,
|
|
143
158
|
* crossed while it is off. */
|
|
@@ -10,8 +10,10 @@ import { Icon, iconPaths } from "../internal/icons.js";
|
|
|
10
10
|
import { phoneMark, usePhoneForm } from "../internal/phone.js";
|
|
11
11
|
import { msOf, pxOf, spacingPx } from "../internal/read-token.js";
|
|
12
12
|
import { useReorder } from "../internal/reorder.js";
|
|
13
|
+
import { Button } from "../button/button.js";
|
|
13
14
|
import { Scrollbar } from "../scrollbar/scrollbar.js";
|
|
14
15
|
import { Switch } from "../switch/switch.js";
|
|
16
|
+
import { Toggle } from "../toggle/toggle.js";
|
|
15
17
|
import { rowFor, rowStarting } from "./keys.js";
|
|
16
18
|
import { MENU_LIST_LOOKS } from "./looks.js";
|
|
17
19
|
const optionOf = (el, id) => el?.closest(`[data-menu-list-${id}]`)?.getAttribute(`data-menu-list-${id}`) ?? MENU_LIST_LOOKS.options.find((o) => o.id === id).def;
|
|
@@ -42,6 +44,13 @@ function Eye({ on, className }) {
|
|
|
42
44
|
const eyeOf = (on, className) => _jsx(Eye, { on: on, className: className });
|
|
43
45
|
const MORE = ["M9 6l6 6l-6 6"], TICK = ["M5 12l5 5l10 -10"], AWAY = ["M17 7l-10 10", "M8 7l9 0l0 9"];
|
|
44
46
|
const strokeGlyph = (paths, className, strokeWidth = 2) => (_jsx("svg", { className: className, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: strokeWidth, strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": "true", children: paths.map((d) => _jsx("path", { d: d }, d)) }));
|
|
47
|
+
const keepRow = (ev) => {
|
|
48
|
+
ev.preventDefault();
|
|
49
|
+
const row = ev.currentTarget.closest("[data-item], .o-menu-list-row");
|
|
50
|
+
(row?.tagName === "LABEL" ? row.querySelector('[role="switch"]') : row)?.focus({ preventScroll: true });
|
|
51
|
+
};
|
|
52
|
+
const rowToggle = (t) => t ? (_jsx(Toggle, { kind: "quiet", shape: "icon", size: "xs", className: "o-menu-toggle", tabIndex: -1, "aria-label": t.label, icon: t.icon, pressed: t.on, readOnly: !!t.disabled, ...(t.disabled ? { title: t.disabled } : {}), onPressedChange: () => t.onPress(), onMouseDown: keepRow, onClick: (ev) => ev.stopPropagation() })) : null;
|
|
53
|
+
const rowOpen = (name, glyphOf, onOpen) => name ? (_jsx(Button, { kind: "quiet", shape: "icon", size: "xs", className: "o-menu-open", tabIndex: -1, "aria-label": name, icon: glyphOf, onMouseDown: keepRow, onClick: (ev) => { ev.stopPropagation(); onOpen?.(); } })) : null;
|
|
45
54
|
const part = (id, p) => (id ? `${id}-${p}` : undefined);
|
|
46
55
|
const named = (id) => ["n", "v", "k", "c"].map((p) => `${id}-${p}`).join(" ");
|
|
47
56
|
const actionBody = (e, id) => (_jsxs(_Fragment, { children: [e.icon, _jsx("span", { className: "o-menu-name", id: part(id, "n"), children: e.label }), e.keys && _jsx("span", { className: "o-menu-keys", id: part(id, "k"), children: e.keys.map((k) => _jsx("kbd", { children: k }, k)) }), e.count != null && _jsx("span", { className: "o-menu-count", id: part(id, "c"), children: e.count })] }));
|
|
@@ -123,14 +132,16 @@ export function MenuListShown({ entries, label, open, on = [], className }) {
|
|
|
123
132
|
}
|
|
124
133
|
const grippedOf = (list) => list.flatMap((e) => (e.kind === "group" ? grippedOf(e.entries) : e.kind !== "separator" && e.kind !== "pick" && e.grip && !("disabled" in e && e.disabled) ? [e] : []));
|
|
125
134
|
const disabledProps = (why) => (why ? { "aria-disabled": true, "data-disabled": "", title: why } : {});
|
|
126
|
-
function PanelCheck({ e, item, ticks, grip, id, words = MENU_LIST_WORDS }) {
|
|
135
|
+
function PanelCheck({ e, item, ticks, grip, id, words = MENU_LIST_WORDS, onOpen }) {
|
|
127
136
|
const [own, setOwn] = React.useState(!!e.defaultChecked), on = e.checked ?? own;
|
|
128
137
|
const press = () => { if (e.disabled)
|
|
129
138
|
return; const next = !on; if (e.checked === undefined)
|
|
130
139
|
setOwn(next); e.onCheckedChange?.(next); };
|
|
140
|
+
const level = e.opens ? { "data-level": "" } : {}, toggle = rowToggle(e.toggle), open = rowOpen(e.opens, strokeGlyph(MORE, "o-menu-more"), onOpen);
|
|
141
|
+
const off = e.opens && e.disabled ? { "data-disabled": "", title: e.disabled } : disabledProps(e.disabled);
|
|
131
142
|
if (ticks === "eye")
|
|
132
|
-
return (_jsxs("div", { role: "menuitemcheckbox", "aria-checked": on, ...
|
|
133
|
-
return ticks === "switch" ? (_jsxs("div", { role: "menuitemcheckbox", "aria-checked": on, ...
|
|
143
|
+
return (_jsxs("div", { role: "menuitemcheckbox", "aria-checked": on, ...off, ...level, ...item, onClick: press, className: "o-list-row o-smooth o-smooth-ease o-menu-row o-menu-eyed", children: [grip, e.icon, _jsx("span", { className: "o-menu-name", id: part(id, "n"), children: e.label }), toggle, eyeOf(on, "o-menu-eye"), open] }));
|
|
144
|
+
return ticks === "switch" ? (_jsxs("div", { role: "menuitemcheckbox", "aria-checked": on, ...off, ...level, ...item, onClick: press, className: "o-list-row o-smooth o-smooth-ease o-menu-row o-menu-switch", children: [grip, e.icon, _jsx("span", { className: "o-menu-name", id: part(id, "n"), children: e.label }), toggle, _jsx(Switch, { size: "sm", checked: on, onCheckedChange: () => { }, disabled: !!e.disabled, tabIndex: -1, "aria-hidden": true, words: [words.on, words.off], onMouseDown: (ev) => { ev.preventDefault(); ev.currentTarget.closest("[data-item]")?.focus({ preventScroll: true }); } }), open] })) : (_jsxs("div", { role: "menuitemcheckbox", "aria-checked": on, ...off, ...level, ...item, onClick: press, className: "o-list-row o-smooth o-smooth-ease o-menu-row o-menu-check", children: [grip, checkBody(e, id), toggle, open] }));
|
|
134
145
|
}
|
|
135
146
|
export function MenuListPanelRows({ label, entries, onOpen, ticks = "box", onMove, className, words: given }) {
|
|
136
147
|
const w = listWords(given);
|
|
@@ -188,6 +199,12 @@ export function MenuListPanelRows({ label, entries, onOpen, ticks = "box", onMov
|
|
|
188
199
|
}
|
|
189
200
|
return;
|
|
190
201
|
}
|
|
202
|
+
const opener = ev.key === "ArrowRight" ? row.querySelector(":scope > .o-menu-open") : null;
|
|
203
|
+
if (opener) {
|
|
204
|
+
ev.preventDefault();
|
|
205
|
+
opener.click();
|
|
206
|
+
return;
|
|
207
|
+
}
|
|
191
208
|
if (ev.key === "Enter" || ev.key === " " || (ev.key === "ArrowRight" && row.hasAttribute("data-level"))) {
|
|
192
209
|
if (ev.key === "Enter" && row.tagName === "A")
|
|
193
210
|
return;
|
|
@@ -260,7 +277,7 @@ export function MenuListPanelRows({ label, entries, onOpen, ticks = "box", onMov
|
|
|
260
277
|
if (e.kind === "pick")
|
|
261
278
|
return (_jsxs("div", { role: "group", "aria-label": e.heading, children: [e.heading && _jsx("p", { className: "o-list-heading", children: e.heading }), e.choices.map((c) => _jsx("div", { role: "menuitemradio", "aria-checked": c.value === e.value, ...item(), onClick: () => e.onChoose?.(c.value), className: ROW, children: choiceBody(c) }, c.value))] }, k));
|
|
262
279
|
if (e.kind === "check")
|
|
263
|
-
return _jsx(PanelCheck, { e: e, item: item(e), ticks: ticks, grip: gripFor(e), id: idOf(e), words: w }, k);
|
|
280
|
+
return _jsx(PanelCheck, { e: e, item: item(e), ticks: ticks, grip: gripFor(e), id: idOf(e), words: w, onOpen: () => onOpen?.(e) }, k);
|
|
264
281
|
if (e.kind === "link") {
|
|
265
282
|
const attrs = { role: "menuitem", ...item(e), className: ROW, onClick: e.onSelect, ...(e.external ? { target: "_blank", rel: "noreferrer" } : {}) };
|
|
266
283
|
return e.render ? React.cloneElement(e.render, { key: k, ...attrs }, gripFor(e), linkBody(e, idOf(e))) : _jsxs("a", { href: e.href, ...attrs, children: [gripFor(e), linkBody(e, idOf(e))] }, k);
|
|
@@ -314,10 +331,11 @@ function PhoneRow({ row, onOpen, move, room, ticks = "switch", words = MENU_LIST
|
|
|
314
331
|
const mv = move ? { "data-row": move.at, ...(move.lifted ? { "data-lifted": "" } : {}), style: move.style, ...move.drag } : {};
|
|
315
332
|
const how = move ? { "aria-describedby": move.how } : {};
|
|
316
333
|
const lead = move ? glyph(GRIP, "o-menu-list-grip") : room ? React.cloneElement(glyph(GRIP, "o-menu-list-grip"), { "data-room": "" }) : null;
|
|
334
|
+
const tickId = React.useId(), named = row.kind === "check" && row.toggle ? { label: { htmlFor: tickId }, tick: { id: tickId } } : { label: {}, tick: {} };
|
|
317
335
|
if (row.kind === "check" && ticks === "eye")
|
|
318
|
-
return _jsx(PhoneEye, { row: row, lead: lead, mv: mv, how: how });
|
|
336
|
+
return _jsx(PhoneEye, { row: row, lead: lead, mv: mv, how: how, onOpen: onOpen && (() => onOpen(row)) });
|
|
319
337
|
if (row.kind === "check")
|
|
320
|
-
return (_jsxs("label", { className: "o-menu-list-row", ...mv, children: [lead, row.icon && _jsx("span", { className: "o-menu-list-mark", children: row.icon }), _jsxs("span", { className: "o-menu-list-name", children: [_jsx("span", { children: row.label }), (row.disabled ?? row.note) != null && _jsx("span", { className: "o-menu-list-note", children: row.disabled ?? row.note })] }), _jsx(Switch, { size: "lg", checked: row.checked, defaultChecked: row.defaultChecked, onCheckedChange: (c) => row.onCheckedChange?.(c), disabled: !!row.disabled, words: [words.on, words.off], ...how })] }));
|
|
338
|
+
return (_jsxs("label", { className: "o-menu-list-row", ...mv, ...named.label, children: [lead, row.icon && _jsx("span", { className: "o-menu-list-mark", children: row.icon }), _jsxs("span", { className: "o-menu-list-name", children: [_jsx("span", { children: row.label }), (row.disabled ?? row.note) != null && _jsx("span", { className: "o-menu-list-note", children: row.disabled ?? row.note })] }), rowToggle(row.toggle), _jsx(Switch, { size: "lg", checked: row.checked, defaultChecked: row.defaultChecked, onCheckedChange: (c) => row.onCheckedChange?.(c), disabled: !!row.disabled, words: [words.on, words.off], ...how, ...named.tick }), rowOpen(row.opens, glyph(MORE, "o-menu-list-more"), onOpen && (() => onOpen(row)))] }));
|
|
321
339
|
if (row.kind === "link") {
|
|
322
340
|
const attrs = { className: "o-menu-list-row", ...mv, ...how, ...(row.external ? { target: "_blank", rel: "noreferrer" } : {}) };
|
|
323
341
|
const inside = _jsxs(_Fragment, { children: [lead, body(row), endOf(row), row.external ? glyph(AWAY, "o-menu-list-more") : glyph(MORE, "o-menu-list-more")] });
|
|
@@ -334,11 +352,11 @@ function PhoneRow({ row, onOpen, move, room, ticks = "switch", words = MENU_LIST
|
|
|
334
352
|
export function MenuListRow({ label, value, onSelect, className }) {
|
|
335
353
|
return _jsxs(BaseButton, { className: cx("o-menu-list-row", className), onClick: onSelect, children: [_jsx("span", { className: "o-menu-list-name", children: _jsx("span", { children: label }) }), _jsx("span", { className: "o-menu-list-value", children: value })] });
|
|
336
354
|
}
|
|
337
|
-
function PhoneEye({ row, lead, mv, how }) {
|
|
355
|
+
function PhoneEye({ row, lead, mv, how, onOpen }) {
|
|
338
356
|
const [own, setOwn] = React.useState(!!row.defaultChecked), on = row.checked ?? own;
|
|
339
357
|
const press = () => { const next = !on; if (row.checked === undefined)
|
|
340
358
|
setOwn(next); row.onCheckedChange?.(next); };
|
|
341
|
-
return (_jsxs(BaseButton, { className: "o-menu-list-row", ...mv, ...how, role: "switch", "aria-checked": on, disabled: !!row.disabled, focusableWhenDisabled: true, onClick: press, children: [lead, row.icon && _jsx("span", { className: "o-menu-list-mark", children: row.icon }), _jsxs("span", { className: "o-menu-list-name", children: [_jsx("span", { children: row.label }), (row.disabled ?? row.note) != null && _jsx("span", { className: "o-menu-list-note", children: row.disabled ?? row.note })] }), eyeOf(on, "o-menu-list-eye")] }));
|
|
359
|
+
return (_jsxs(BaseButton, { className: "o-menu-list-row", ...mv, ...how, role: "switch", "aria-checked": on, disabled: !!row.disabled, focusableWhenDisabled: true, onClick: press, ...(row.toggle || row.opens ? { nativeButton: false, render: _jsx("div", {}) } : {}), children: [lead, row.icon && _jsx("span", { className: "o-menu-list-mark", children: row.icon }), _jsxs("span", { className: "o-menu-list-name", children: [_jsx("span", { children: row.label }), (row.disabled ?? row.note) != null && _jsx("span", { className: "o-menu-list-note", children: row.disabled ?? row.note })] }), rowToggle(row.toggle), eyeOf(on, "o-menu-list-eye"), rowOpen(row.opens, glyph(MORE, "o-menu-list-more"), onOpen)] }));
|
|
342
360
|
}
|
|
343
361
|
export function MenuList({ label, entries, tiles, onOpen, onClose, closeWord = "Close", onMove, ticks, className, words: given }) {
|
|
344
362
|
const w = listWords(given);
|
|
@@ -232,6 +232,14 @@
|
|
|
232
232
|
.o-menu-rows .o-list-row { --list-row-rad: var(--list-row-corners-in); --list-row-pill-in: var(--list-row-corners-pill, var(--list-row-pill, var(--list-box-pill, 0))); }
|
|
233
233
|
/* A tick as the Switch, at its end. */
|
|
234
234
|
.o-menu-switch > .o-switch { flex: none; margin-left: calc(var(--vk-spacing) * 4); }
|
|
235
|
+
/* A tick row's own Toggle before its tick (a card's field starting a new line) and its › after it, opening its level (VK-890): each a
|
|
236
|
+
quiet icon Button at the row's end, its tick nearer the Toggle than the name, the › as near the row's end as a level row's ›. */
|
|
237
|
+
:is(.o-menu-row, .o-menu-list-row) > .o-menu-toggle { flex: none; margin-left: calc(var(--vk-spacing) * 2); }
|
|
238
|
+
:is(.o-menu-row, .o-menu-list-row) > .o-menu-toggle + :is(.o-switch, .o-menu-eye, .o-menu-list-eye) { margin-left: calc(var(--vk-spacing) * 2); }
|
|
239
|
+
/* A Toggle that can't be pressed here (a card's first field, a hidden one) is drawn quieter, its reason its tooltip. */
|
|
240
|
+
:is(.o-menu-row, .o-menu-list-row) > .o-menu-toggle[aria-disabled="true"] { color: var(--vk-fg-disabled); }
|
|
241
|
+
:is(.o-menu-row, .o-menu-list-row) > .o-menu-open { flex: none; margin-left: calc(var(--vk-spacing) * 1); margin-right: calc(var(--vk-spacing) * -1); color: var(--vk-fg-subtlest); }
|
|
242
|
+
.o-menu-row > .o-menu-open > .o-menu-more { margin-right: 0; }
|
|
235
243
|
/* A value in force (a filter's "1", a sort's "Amount +1"): in the brand. */
|
|
236
244
|
.o-menu-value[data-on] { color: var(--vk-fg-accent); }
|
|
237
245
|
/* A tick as an eye, at its end: open while it is on, crossed while off, quieter; greyed on a row that can't be used. */
|
|
@@ -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. */
|