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
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { MenuWords } from "../menu/menu.js";
|
|
1
2
|
import type { PickerWords } from "../picker/picker.js";
|
|
2
3
|
export interface ViewsListWords {
|
|
3
4
|
/** What it lists: the list's name to a screen reader. */
|
|
@@ -16,7 +17,60 @@ export interface ViewsListWords {
|
|
|
16
17
|
none?: string;
|
|
17
18
|
/** The words of the list itself. */
|
|
18
19
|
picker?: Partial<PickerWords>;
|
|
20
|
+
/** A phone's step's way back to the list (a view's menu, Rename…); left out, "Back". */
|
|
21
|
+
back?: string;
|
|
22
|
+
/** A view's menu's own words (a sheet's ✕ and Back, the Close row, a level's search). */
|
|
23
|
+
menu?: MenuWords;
|
|
19
24
|
}
|
|
20
25
|
export declare const VIEWS_LIST_WORDS: ViewsListWords;
|
|
21
26
|
/** The words handed over the English. */
|
|
22
27
|
export declare const viewsListWords: (given?: Partial<ViewsListWords>) => ViewsListWords;
|
|
28
|
+
/** A view's menu's words (VK-823): its entries (a computer's, a phone's shorter tiles and its two headings), Rename's and New view's
|
|
29
|
+
* Modals, the delete question, the Toast's report, a copy's name, the delete question's line and a board's columns. English unless
|
|
30
|
+
* handed, the Outright kit's as drawn; CONTROLS.ViewsListBody hands them in the app's words, from its messages. */
|
|
31
|
+
export interface ViewMenuWords {
|
|
32
|
+
rename: string;
|
|
33
|
+
/** A phone's tile. */
|
|
34
|
+
renameShort: string;
|
|
35
|
+
edit: string;
|
|
36
|
+
privateView: string;
|
|
37
|
+
saveEveryone: string;
|
|
38
|
+
reset: string;
|
|
39
|
+
saveNew: string;
|
|
40
|
+
copyLink: string;
|
|
41
|
+
/** A phone's tile. */
|
|
42
|
+
copyLinkShort: string;
|
|
43
|
+
favorite: string;
|
|
44
|
+
unfavorite: string;
|
|
45
|
+
duplicate: string;
|
|
46
|
+
/** A phone's tile. */
|
|
47
|
+
duplicateShort: string;
|
|
48
|
+
delete: string;
|
|
49
|
+
/** Why Delete can't be pressed: the list's last view. */
|
|
50
|
+
keepOne: string;
|
|
51
|
+
/** A phone's heading over Save for everyone, Reset and Save as new view. */
|
|
52
|
+
unsaved: string;
|
|
53
|
+
/** A phone's heading over Private view and Edit view. */
|
|
54
|
+
thisView: string;
|
|
55
|
+
renameTitle: string;
|
|
56
|
+
save: string;
|
|
57
|
+
newView: string;
|
|
58
|
+
createView: string;
|
|
59
|
+
layout: string;
|
|
60
|
+
name: string;
|
|
61
|
+
/** Each Modal's way out, the delete question's too. */
|
|
62
|
+
cancel: string;
|
|
63
|
+
/** A Modal's and the alert dialog's X. */
|
|
64
|
+
close: string;
|
|
65
|
+
/** What a failure says when its work threw no words; its action, once it failed. */
|
|
66
|
+
failed: string;
|
|
67
|
+
tryAgain: string;
|
|
68
|
+
deleteTitle: (name: string) => string;
|
|
69
|
+
deleted: (name: string) => string;
|
|
70
|
+
copyOf: (name: string) => string;
|
|
71
|
+
stay: (records: string) => string;
|
|
72
|
+
goes: string;
|
|
73
|
+
columns: (layout: string) => string;
|
|
74
|
+
}
|
|
75
|
+
/** A view's menu's words in English. */
|
|
76
|
+
export declare const VIEW_MENU_WORDS: ViewMenuWords;
|
|
@@ -1,3 +1,12 @@
|
|
|
1
1
|
import { JUST_ME, SHARED } from "./rules.js";
|
|
2
|
-
export const VIEWS_LIST_WORDS = { label: "Views", search: "Search views", find: "Find a view", newView: "New view", shared: SHARED, justMe: JUST_ME };
|
|
2
|
+
export const VIEWS_LIST_WORDS = { label: "Views", search: "Search views", find: "Find a view", newView: "New view", shared: SHARED, justMe: JUST_ME, back: "Back" };
|
|
3
3
|
export const viewsListWords = (given) => (given ? { ...VIEWS_LIST_WORDS, ...given } : VIEWS_LIST_WORDS);
|
|
4
|
+
export const VIEW_MENU_WORDS = {
|
|
5
|
+
rename: "Rename…", renameShort: "Rename", edit: "Edit view…", privateView: "Private view", saveEveryone: "Save for everyone", reset: "Reset",
|
|
6
|
+
saveNew: "Save as new view…", copyLink: "Copy link to view", copyLinkShort: "Copy link", favorite: "Favorite", unfavorite: "Unfavorite",
|
|
7
|
+
duplicate: "Duplicate view", duplicateShort: "Duplicate", delete: "Delete view", keepOne: "A list keeps one view", unsaved: "Unsaved changes",
|
|
8
|
+
thisView: "This view", renameTitle: "Rename view", save: "Save", newView: "New view", createView: "Create view", layout: "Layout", name: "Name",
|
|
9
|
+
cancel: "Cancel", close: "Close", failed: "That didn't go through. Nothing changed.", tryAgain: "Try again",
|
|
10
|
+
deleteTitle: (name) => `Delete ${name}?`, deleted: (name) => `${name} was deleted`, copyOf: (name) => `Copy of ${name}`,
|
|
11
|
+
stay: (records) => `The ${records} in it stay as they are.`, goes: "The view goes for everyone who uses it.", columns: (layout) => `${layout} columns`,
|
|
12
|
+
};
|
|
@@ -1,8 +1,12 @@
|
|
|
1
1
|
/* The views list (VK-723, from the Outright kit's KIT-678): only what is its own. Its list is the Picker, its menus the Menu, each as
|
|
2
|
-
it is. Here: a view's layout mark at a row's icon size (16 on a computer, 20 on a phone, the subtle text)
|
|
2
|
+
it is. Here: a view's layout mark at a row's icon size (16 on a computer, 20 on a phone, the subtle text); a view's menu's own (VK-823):
|
|
3
|
+
New view's and Rename's form, its fields one under another, 16 apart, and on a phone's step its action the step's width under them. */
|
|
3
4
|
@layer components {
|
|
4
5
|
.o-views-list { display: contents; }
|
|
5
6
|
.o-views-list-mark { display: inline-grid; place-items: center; color: var(--vk-fg-subtle); }
|
|
6
7
|
.o-views-list-mark > svg { width: calc(var(--vk-spacing) * 4); height: calc(var(--vk-spacing) * 4); }
|
|
7
8
|
.o-picker[data-picker-form="phone"] .o-views-list-mark > svg { width: calc(var(--vk-spacing) * 5); height: calc(var(--vk-spacing) * 5); }
|
|
9
|
+
.o-views-list-form { display: grid; gap: calc(var(--vk-spacing) * 4); }
|
|
10
|
+
.o-views-list-step-foot { margin-top: calc(var(--vk-spacing) * 4); }
|
|
11
|
+
:where([data-vk-phone], [data-vk-phone] *).o-views-list-step-act { width: 100%; }
|
|
8
12
|
}
|
|
@@ -4,7 +4,7 @@ import { useState } from "react";
|
|
|
4
4
|
import { fromDayKey } from "viewkitjs/fields/query";
|
|
5
5
|
import { cx } from "../internal/cx.js";
|
|
6
6
|
import { useViews } from "../provider/context.js";
|
|
7
|
-
import { formatDateValue } from "./format.js";
|
|
7
|
+
import { formatDateValue, timeShown } from "./format.js";
|
|
8
8
|
import { cellTextClass } from "./text-class.js";
|
|
9
9
|
import { useDateDisplayOptions } from "./use-display-options.js";
|
|
10
10
|
export function renderDate(field, value, opts) {
|
|
@@ -25,10 +25,10 @@ function DateValue({ field, value, opts: given, }) {
|
|
|
25
25
|
window.addEventListener("pointerup", release, true);
|
|
26
26
|
window.addEventListener("pointercancel", release, true);
|
|
27
27
|
};
|
|
28
|
-
const withTime =
|
|
28
|
+
const withTime = field.type === "datetime" ? timeShown(field.format?.withTime, opts.withTime) : false;
|
|
29
29
|
const cell = (_jsx("span", { className: cx(cellTextClass(opts.wrap), "tabular-nums text-(color:--vk-fg)"), onPointerMove: pointed
|
|
30
30
|
? undefined
|
|
31
|
-
: (event) => event.pointerType !== "touch" && event.buttons === 0 && setPointed(true),
|
|
31
|
+
: (event) => event.pointerType !== "touch" && event.buttons === 0 && setPointed(true), onPointerDownCapture: pointed || pressed ? undefined : (event) => event.pointerType !== "touch" && hold(), children: formatDateValue(value, opts.dateStyle ?? field.format?.dateStyle, withTime, field.type, opts) }));
|
|
32
32
|
const d = field.type === "date" && typeof value === "string"
|
|
33
33
|
? fromDayKey(value)
|
|
34
34
|
: value instanceof Date
|
|
@@ -28,6 +28,12 @@ export declare const DEFAULT_FIELD_PRESENTATION: FieldPresentation;
|
|
|
28
28
|
* the caller's answer, then the field's single declared code.
|
|
29
29
|
*/
|
|
30
30
|
export declare function formatNumberValue(value: number, format: NumberLikeFormat | undefined, opts?: NumberOverrides): string;
|
|
31
|
+
/**
|
|
32
|
+
* Whether a date-and-time shows its time: the reader's choice, else what its field or column declares, else yes. A
|
|
33
|
+
* date-and-time is one because its time matters, and a time typed then not shown reads as lost. A calendar day has no
|
|
34
|
+
* time, whatever this says.
|
|
35
|
+
*/
|
|
36
|
+
export declare function timeShown(declared?: boolean, chosen?: boolean): boolean;
|
|
31
37
|
/**
|
|
32
38
|
* A date or an instant, in the style asked for.
|
|
33
39
|
*
|
|
@@ -166,6 +166,9 @@ export function formatNumberValue(value, format, opts) {
|
|
|
166
166
|
return formatted;
|
|
167
167
|
return `${value >= 0 ? "+" : "−"} ${formatted}`;
|
|
168
168
|
}
|
|
169
|
+
export function timeShown(declared, chosen) {
|
|
170
|
+
return chosen ?? declared ?? true;
|
|
171
|
+
}
|
|
169
172
|
export function formatDateValue(value, dateStyle, withTime, kind = "datetime", opts) {
|
|
170
173
|
const d = kind === "date" && typeof value === "string"
|
|
171
174
|
? fromDayKey(value)
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export { DISPLAY_CORES, renderFieldValue, type DisplayCore } from "./display-cores.js";
|
|
2
2
|
export { emailHref, webHref } from "./web-href.js";
|
|
3
3
|
export type { DisplayOptions, FieldPresentation, FieldViewerContext, NumberLikeFormat, RelationWrap, } from "./options.js";
|
|
4
|
-
export { CellSuffix, DEFAULT_FIELD_PRESENTATION, formatDateValue, formatMoney, formatNumberValue, } from "./format.js";
|
|
4
|
+
export { CellSuffix, DEFAULT_FIELD_PRESENTATION, formatDateValue, timeShown, formatMoney, formatNumberValue, } from "./format.js";
|
|
5
5
|
export { viewerFrom } from "./viewer.js";
|
|
6
6
|
export { cellTextClass } from "./text-class.js";
|
|
7
7
|
export { MultiValueCell } from "./multi-value.js";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export { DISPLAY_CORES, renderFieldValue } from "./display-cores.js";
|
|
2
2
|
export { emailHref, webHref } from "./web-href.js";
|
|
3
|
-
export { CellSuffix, DEFAULT_FIELD_PRESENTATION, formatDateValue, formatMoney, formatNumberValue, } from "./format.js";
|
|
3
|
+
export { CellSuffix, DEFAULT_FIELD_PRESENTATION, formatDateValue, timeShown, formatMoney, formatNumberValue, } from "./format.js";
|
|
4
4
|
export { viewerFrom } from "./viewer.js";
|
|
5
5
|
export { cellTextClass } from "./text-class.js";
|
|
6
6
|
export { MultiValueCell } from "./multi-value.js";
|
|
@@ -147,7 +147,7 @@ export type DisplayOptions = {
|
|
|
147
147
|
booleanDisabled?: boolean;
|
|
148
148
|
/** boolean `checkbox` style: the control that draws the box, handed `checked`, the field's label, `tabIndex` -1 and
|
|
149
149
|
* `onCheckedChange` (or `readOnly` without `onToggle`). Absent: ViewKit's `TickBox`, in its own switch button when
|
|
150
|
-
* `onToggle` is handed. The grid hands the components map's `Checkbox
|
|
150
|
+
* `onToggle` is handed. The grid hands the components map's `Checkbox`, and a field row its own wrapper of it. */
|
|
151
151
|
booleanCheckbox?: ComponentType<ViewsCheckboxProps>;
|
|
152
152
|
/** relation: the caller's glyph for a kind. The field core has no app registry. */
|
|
153
153
|
entityIcon?: (kind: string | undefined) => ReactNode;
|
|
@@ -2,5 +2,6 @@ import type { ReactNode } from "react";
|
|
|
2
2
|
import { type FieldDefOf } from "viewkitjs/fields";
|
|
3
3
|
import type { DisplayOptions } from "./options.js";
|
|
4
4
|
/** A low and a high end — "11–50", "10,001+", "up to 50" — then the code and
|
|
5
|
-
* the period of an amount range
|
|
5
|
+
* the period of an amount range; or the band's name when the ends are exactly a preset's ("Small"), its numbers on
|
|
6
|
+
* hover. */
|
|
6
7
|
export declare function renderRange(field: FieldDefOf<"range">, value: unknown, opts?: DisplayOptions): ReactNode;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
-
import { rangeText } from "viewkitjs/fields";
|
|
3
|
+
import { exactPresetOf, rangeText } from "viewkitjs/fields";
|
|
4
4
|
import { rangePeriodShort, rangeUnit } from "../fields/range-unit.js";
|
|
5
5
|
import { useViews } from "../provider/context.js";
|
|
6
6
|
import { CellSuffix } from "./format.js";
|
|
@@ -15,5 +15,8 @@ function RangeValueCell({ field, value, opts, }) {
|
|
|
15
15
|
return null;
|
|
16
16
|
const unit = rangeUnit(field);
|
|
17
17
|
const period = rangePeriodShort(field);
|
|
18
|
+
const band = exactPresetOf(field, value);
|
|
19
|
+
if (band)
|
|
20
|
+
return _jsx("span", { className: cellTextClass(opts?.wrap), title: [text, unit, period].filter(Boolean).join(" "), children: band.label });
|
|
18
21
|
return (_jsxs("span", { className: cellTextClass(opts?.wrap), title: text, children: [_jsx("span", { className: "tabular-nums", children: text }), unit && _jsx(CellSuffix, { children: unit }), period && _jsx(CellSuffix, { children: period })] }));
|
|
19
22
|
}
|
|
@@ -31,7 +31,6 @@ function RichTextBlock({ source }) {
|
|
|
31
31
|
}, [source]);
|
|
32
32
|
return (_jsxs("div", { className: "min-w-0", children: [_jsxs("div", { ref: boxRef, className: cx("relative min-w-0 overflow-hidden", !open && tall && "max-h-40"), children: [_jsx(Markdown, { source: source }), !open && tall && (_jsx("div", { className: "pointer-events-none absolute inset-x-0 bottom-0 h-10 bg-linear-to-t from-(color:--vk-ground) to-transparent" }))] }), tall &&
|
|
33
33
|
drawFieldRowButton(views, {
|
|
34
|
-
own: "mt-1 text-xs text-(color:--vk-fg-subtle) hover:text-(color:--vk-fg)",
|
|
35
34
|
frame: "mt-1 -mx-1 h-auto px-1 py-0.5 text-xs",
|
|
36
35
|
variant: "ghost",
|
|
37
36
|
size: "sm",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type CloseReason, type CloseResolution, type FieldMessageResolver } from "viewkitjs/fields";
|
|
2
2
|
import type { PickerOption } from "./SelectEditor.js";
|
|
3
|
-
import {
|
|
3
|
+
import type { OptionAdd } from "../fields/option-add.js";
|
|
4
4
|
/**
|
|
5
5
|
* THE editor for a value that is SEVERAL values.
|
|
6
6
|
*
|
|
@@ -8,9 +8,8 @@ import { type OptionAdd } from "../fields/option-add.js";
|
|
|
8
8
|
*
|
|
9
9
|
* A multi-value cell is not a select that happens to allow two answers. What
|
|
10
10
|
* you are editing is a SET, so the set has to be on screen while you edit it:
|
|
11
|
-
* the
|
|
12
|
-
*
|
|
13
|
-
* inline among them. You add and remove in the same place you can see them.
|
|
11
|
+
* the app's Picker is handed it whole (`multiple`, the values held) and draws it
|
|
12
|
+
* beside its search, so you add and remove where you can see them.
|
|
14
13
|
*
|
|
15
14
|
* A tick in a list is what this must NOT be. A tick reports the state of the
|
|
16
15
|
* row you are looking at; it does not show you the set you have built, and on a
|
|
@@ -56,7 +55,7 @@ export declare const ChipsEditor: import("react").ForwardRefExoticComponent<{
|
|
|
56
55
|
* applies, so `Ops Team` and `ops-team` cannot come apart. */
|
|
57
56
|
normalize?: (raw: string) => string;
|
|
58
57
|
/** The core saw a key that means "done" (Escape, Tab, Shift-Tab), or an app's own `Picker` said it is done.
|
|
59
|
-
*
|
|
58
|
+
* The Picker's picks never close it. */
|
|
60
59
|
onRequestClose: (reason: CloseReason) => void;
|
|
61
60
|
/** The host's words for this panel (fields' messages); default: the provider's conventions. */
|
|
62
61
|
message?: FieldMessageResolver;
|
|
@@ -1,29 +1,24 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsx as _jsx
|
|
3
|
-
import { forwardRef,
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import { forwardRef, useImperativeHandle, useMemo, useRef, useState } from "react";
|
|
4
4
|
import { sameListValue, } from "viewkitjs/fields";
|
|
5
5
|
import { useViews } from "../provider/context.js";
|
|
6
6
|
import { PickerFrame, pickerItemOf, typedPick, usePickerForm } from "./picker-slot.js";
|
|
7
|
-
import {
|
|
8
|
-
import { AddRows, bodyAdd, useOptionAdd } from "./option-add-flow.js";
|
|
7
|
+
import { bodyAdd, useOptionAdd } from "./option-add-flow.js";
|
|
9
8
|
export const ChipsEditor = forwardRef(function ChipsEditor({ values, suggestions, resolve: resolveValue, normalize, onRequestClose: closeAsked, message, creatable = true, label, addOption, seed, }, ref) {
|
|
10
9
|
const [draft, setDraft] = useState(values);
|
|
11
|
-
const [search, setSearch] = useState(seed ?? "");
|
|
12
|
-
const inputRef = useRef(null);
|
|
13
10
|
const draftRef = useRef(values);
|
|
14
11
|
const views = useViews();
|
|
15
12
|
const words = message ?? views.conventions.messages;
|
|
16
|
-
const {
|
|
13
|
+
const { Picker } = views.components;
|
|
17
14
|
const form = usePickerForm();
|
|
18
|
-
const { List, RowContent, Tag } = views.atoms;
|
|
19
|
-
const Add = views.icons.add;
|
|
20
15
|
const carried = useMemo(() => [...suggestions, ...draft], [suggestions, draft]);
|
|
21
16
|
const adding = useOptionAdd({
|
|
22
17
|
addOption,
|
|
23
18
|
offered: carried.map((value) => resolveValue(value)),
|
|
24
19
|
carried,
|
|
25
20
|
open: creatable,
|
|
26
|
-
onPick: (value) =>
|
|
21
|
+
onPick: (value) => setBoth(draftRef.current.includes(value) ? draftRef.current : [...draftRef.current, value]),
|
|
27
22
|
});
|
|
28
23
|
const resolve = (value) => {
|
|
29
24
|
const returned = suggestions.includes(value) ? undefined : adding.added(value);
|
|
@@ -46,73 +41,12 @@ export const ChipsEditor = forwardRef(function ChipsEditor({ values, suggestions
|
|
|
46
41
|
draftRef.current = next;
|
|
47
42
|
setDraft(next);
|
|
48
43
|
};
|
|
49
|
-
useEffect(() => {
|
|
50
|
-
if (Picker)
|
|
51
|
-
return;
|
|
52
|
-
const box = inputRef.current;
|
|
53
|
-
box?.focus({ preventScroll: true });
|
|
54
|
-
if (seed)
|
|
55
|
-
box?.setSelectionRange(seed.length, seed.length);
|
|
56
|
-
}, []);
|
|
57
44
|
const clean = (raw) => (normalize ? normalize(raw) : raw.trim());
|
|
58
|
-
const
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
:
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
const canAdd = !addOption && creatable && typed !== "" && ![...draft, ...rows].some((value) => value.toLowerCase() === needle);
|
|
66
|
-
const word = search.trim();
|
|
67
|
-
const named = addOption ? namedOption(word, carried.map((value) => resolveValue(value))) : undefined;
|
|
68
|
-
const addRow = !!addOption && word !== "" && !named;
|
|
69
|
-
const listed = named && rows.includes(named.value) ? [named.value, ...visible.filter((value) => value !== named.value)] : visible;
|
|
70
|
-
const add = (value) => {
|
|
71
|
-
if (!draftRef.current.includes(value))
|
|
72
|
-
setBoth([...draftRef.current, value]);
|
|
73
|
-
setSearch("");
|
|
74
|
-
inputRef.current?.focus();
|
|
75
|
-
};
|
|
76
|
-
const remove = (value) => {
|
|
77
|
-
setBoth(draftRef.current.filter((entry) => entry !== value));
|
|
78
|
-
inputRef.current?.focus();
|
|
79
|
-
};
|
|
80
|
-
const onFieldKeyDown = (event) => {
|
|
81
|
-
if (event.key === "Backspace" && search === "" && draft.length > 0) {
|
|
82
|
-
event.preventDefault();
|
|
83
|
-
remove(draft[draft.length - 1]);
|
|
84
|
-
}
|
|
85
|
-
};
|
|
86
|
-
if (Picker) {
|
|
87
|
-
const offered = [...suggestions, ...draft.filter((value) => !suggestions.includes(value))];
|
|
88
|
-
return (_jsx(PickerFrame, { onTab: (reason) => onRequestClose(reason), onKey: (event) => {
|
|
89
|
-
if (event.key === "Escape")
|
|
90
|
-
onRequestClose("escape");
|
|
91
|
-
}, children: _jsx(Picker, { label: label ?? words({ key: "chips.add-placeholder" }), items: offered.map((value) => pickerItemOf(resolve(value))), multiple: true, value: draft, onValueChange: (next) => setBoth([...new Set(Array.isArray(next) ? next : [])].filter((value) => value !== "" && ((creatable && !addOption) || offered.includes(value)))), onDone: () => onRequestClose("pick"), search: words({ key: "chips.add-placeholder" }), onCreate: creatable && !addOption
|
|
92
|
-
? (typed) => typedPick(clean(typed), [...draftRef.current, ...suggestions], "")
|
|
93
|
-
: undefined, typed: seed, autoFocus: true, form: form, ...bodyAdd(adding, !!addOption) }) }));
|
|
94
|
-
}
|
|
95
|
-
return (_jsxs(Command.Root, { shouldFilter: false, loop: true, children: [_jsxs("div", { className: "flex flex-wrap items-center gap-1 border-b border-(color:--vk-border) px-2 py-2", onMouseDown: (event) => {
|
|
96
|
-
if (event.target === event.currentTarget) {
|
|
97
|
-
event.preventDefault();
|
|
98
|
-
inputRef.current?.focus();
|
|
99
|
-
}
|
|
100
|
-
}, children: [draft.map((value) => {
|
|
101
|
-
const option = resolve(value);
|
|
102
|
-
return (_jsx(Tag, { label: option.label, color: option.color ?? "gray", onRemove: () => remove(value) }, value));
|
|
103
|
-
}), _jsx(Command.Input, { chrome: "bare", ref: inputRef, value: search, onValueChange: (next) => {
|
|
104
|
-
setSearch(next);
|
|
105
|
-
adding.clear();
|
|
106
|
-
}, onKeyDown: (event) => {
|
|
107
|
-
onFieldKeyDown(event);
|
|
108
|
-
if (event.key === "Escape")
|
|
109
|
-
onRequestClose("escape");
|
|
110
|
-
if (event.key === "Tab") {
|
|
111
|
-
event.preventDefault();
|
|
112
|
-
onRequestClose(event.shiftKey ? "shift-tab" : "tab");
|
|
113
|
-
}
|
|
114
|
-
}, placeholder: draft.length === 0 ? words({ key: "chips.add-placeholder" }) : "", className: "h-5 min-w-20 flex-1 bg-transparent text-(length:--vk-input-text,13px) outline-hidden placeholder:text-(color:--vk-fg-subtlest)" })] }), _jsxs(Command.List, { className: "max-h-64 overscroll-contain scrollbar-overlay", children: [listed.length === 0 && !canAdd && !addRow && !adding.state && (_jsx(Command.Empty, { className: "py-4 text-center text-xs text-(color:--vk-fg-subtle)", children: rows.length === 0 ? words({ key: "chips.everything-picked" }) : words({ key: "editor.nothing-matches" }) })), _jsx(Command.Group, { className: "p-0", children: _jsxs(List, { children: [listed.map((value) => {
|
|
115
|
-
const option = resolve(value);
|
|
116
|
-
return (_jsx(Command.Item, { value: value, onSelect: () => add(value), children: _jsx(RowContent, { size: "compact", label: _jsx(Tag, { label: option.label, color: option.color ?? "gray" }) }) }, value));
|
|
117
|
-
}), canAdd && (_jsx(Command.Item, { value: `__add__${typed}`, onSelect: () => add(typed), children: _jsx(RowContent, { size: "compact", tone: "muted", leading: _jsx(Add, { className: "h-4 w-4 shrink-0 text-(color:--vk-fg-subtle)" }), label: words({ key: "chips.add", values: { value: typed } }) }) })), addOption && _jsx(AddRows, { adding: adding, typed: addRow ? word : "" })] }) })] })] }));
|
|
45
|
+
const offered = [...suggestions, ...draft.filter((value) => !suggestions.includes(value))];
|
|
46
|
+
return (_jsx(PickerFrame, { onTab: (reason) => onRequestClose(reason), onKey: (event) => {
|
|
47
|
+
if (event.key === "Escape")
|
|
48
|
+
onRequestClose("escape");
|
|
49
|
+
}, children: _jsx(Picker, { label: label ?? words({ key: "chips.add-placeholder" }), items: offered.map((value) => pickerItemOf(resolve(value))), multiple: true, value: draft, onValueChange: (next) => setBoth([...new Set(Array.isArray(next) ? next : [])].filter((value) => value !== "" && ((creatable && !addOption) || offered.includes(value)))), onDone: () => onRequestClose("pick"), search: words({ key: "chips.add-placeholder" }), onCreate: creatable && !addOption
|
|
50
|
+
? (typed) => typedPick(clean(typed), [...draftRef.current, ...suggestions], "")
|
|
51
|
+
: undefined, typed: seed, autoFocus: true, form: form, ...bodyAdd(adding, !!addOption) }) }));
|
|
118
52
|
});
|
|
@@ -9,34 +9,30 @@ export type DateEditorHandle = {
|
|
|
9
9
|
*/
|
|
10
10
|
resolveClose: (reason: CloseReason) => CloseResolution<string>;
|
|
11
11
|
};
|
|
12
|
-
export declare const
|
|
12
|
+
export declare const DateEditorHost: import("react").ForwardRefExoticComponent<{
|
|
13
13
|
/** The stored value — full ISO or "YYYY-MM-DD"; selects day + opening month. */
|
|
14
14
|
initial?: string;
|
|
15
|
-
/**
|
|
16
|
-
* mode). Without it, the
|
|
15
|
+
/** The time starts empty and stays out of the commit until set (form
|
|
16
|
+
* mode). Without it, the time is the stored one or 00:00 and every
|
|
17
17
|
* commit includes one. */
|
|
18
18
|
timeOptional?: boolean;
|
|
19
|
-
/** A calendar-day field: no time
|
|
20
|
-
* day click or a quick day asks the host to close with `pick`. Default false. */
|
|
19
|
+
/** A calendar-day field: no time, the commit is "YYYY-MM-DD". Default false. */
|
|
21
20
|
dayOnly?: boolean;
|
|
22
|
-
/** The date may be emptied:
|
|
23
|
-
*
|
|
21
|
+
/** The date may be emptied: the body offers No date, which asks the host
|
|
22
|
+
* to close with `pick` and commits "" (nothing when there was no date). */
|
|
24
23
|
clearable?: boolean;
|
|
25
|
-
/** The text the date
|
|
26
|
-
* opened the panel)
|
|
24
|
+
/** The text the date line opens with (a character typed on the cell that
|
|
25
|
+
* opened the panel), read as a typed date. */
|
|
27
26
|
seed?: string;
|
|
28
|
-
/** Put the
|
|
27
|
+
/** Put the focus in the body as the panel opens, without scrolling, so the keyboard is in the panel and Tab
|
|
29
28
|
* walks its controls. Default false: a host whose surface puts focus there itself, or never should (a phone's
|
|
30
|
-
* sheet opens with the keyboard down), leaves it off. A seed focuses
|
|
29
|
+
* sheet opens with the keyboard down), leaves it off. A seed focuses it either way. */
|
|
31
30
|
focusDate?: boolean;
|
|
32
31
|
/** The panel saw a key that means "done" (Enter) or "leave" (Escape), or a
|
|
33
|
-
* pick
|
|
34
|
-
* host closes, then asks `resolveClose`. */
|
|
32
|
+
* pick. It never closes itself — the host closes, then asks `resolveClose`. */
|
|
35
33
|
onRequestClose: (reason: CloseReason) => void;
|
|
36
34
|
/** The host's words for this panel (fields' messages); default: the provider's conventions. */
|
|
37
35
|
message?: FieldMessageResolver;
|
|
38
|
-
/** The
|
|
39
|
-
fill?: boolean;
|
|
40
|
-
/** The field's name, for an app's `DateBody`. Default: the date box's words. */
|
|
36
|
+
/** The field's name, for the app's `DateBody`. Default: the date's words. */
|
|
41
37
|
label?: string;
|
|
42
38
|
} & import("react").RefAttributes<DateEditorHandle>>;
|