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,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
3
|
import { useRef } from "react";
|
|
4
|
-
import {
|
|
4
|
+
import { DateEditorHost } from "../../editors/DateEditor.js";
|
|
5
5
|
import { EditorPanel } from "../../editors/EditorPanel.js";
|
|
6
6
|
import { EditorClockContext } from "../../internal/zone-clock.js";
|
|
7
7
|
import { temporalKindOf } from "../../model/field-type-of.js";
|
|
@@ -13,7 +13,7 @@ export function dayColumnKeepsBrowserClock(col) {
|
|
|
13
13
|
export function GridDateEditor({ title, initial, dayOnly = false, browserClock = false, clearable = false, seed, refuse, onCommit, onCancel, onTab, onEnter, }) {
|
|
14
14
|
const editorRef = useRef(null);
|
|
15
15
|
const anchorRef = useRef(null);
|
|
16
|
-
const place = useGridBodyPlace(
|
|
16
|
+
const place = useGridBodyPlace(anchorRef);
|
|
17
17
|
const { session, close, sheet } = useGridEditSession({
|
|
18
18
|
editorRef,
|
|
19
19
|
mapPayload: dayOnly ? (payload) => payload.slice(0, 10) : undefined,
|
|
@@ -23,5 +23,5 @@ export function GridDateEditor({ title, initial, dayOnly = false, browserClock =
|
|
|
23
23
|
onTab,
|
|
24
24
|
onEnter,
|
|
25
25
|
});
|
|
26
|
-
return (_jsxs(_Fragment, { children: [_jsx("span", { ref: anchorRef, "aria-hidden": true, className: "pointer-events-none absolute inset-0" }), _jsx(EditorPanel, { session: session, title: title, anchor: anchorRef, align: "start", sideOffset: place, initialFocus: false, panelData: { "data-slot": "vk-grid-editor" }, onPanelClick: (e) => e.stopPropagation(), chrome: "menu", className: "z-90 w-auto", children: _jsx(EditorClockContext.Provider, { value: browserClock ? "browser" : "conventions", children: _jsx(
|
|
26
|
+
return (_jsxs(_Fragment, { children: [_jsx("span", { ref: anchorRef, "aria-hidden": true, className: "pointer-events-none absolute inset-0" }), _jsx(EditorPanel, { session: session, title: title, anchor: anchorRef, align: "start", sideOffset: place, initialFocus: false, panelData: { "data-slot": "vk-grid-editor" }, onPanelClick: (e) => e.stopPropagation(), chrome: "menu", className: "z-90 w-auto", children: _jsx(EditorClockContext.Provider, { value: browserClock ? "browser" : "conventions", children: _jsx(DateEditorHost, { ref: editorRef, label: typeof title === "string" ? title : undefined, initial: initial, dayOnly: dayOnly, clearable: clearable, seed: seed, focusDate: !sheet, onRequestClose: close }) }) })] }));
|
|
27
27
|
}
|
|
@@ -13,17 +13,15 @@ export type GridGroupSortOption = {
|
|
|
13
13
|
/**
|
|
14
14
|
* The group-header `…` menu — a second remote for the list's row sort (all
|
|
15
15
|
* groups at once), surfaced on the group band. Reveals on hover of the group
|
|
16
|
-
* label; opens the map's
|
|
17
|
-
* view-options Sort panel drives,
|
|
18
|
-
*
|
|
19
|
-
* stop propagation so the group's collapse toggle stays put.
|
|
16
|
+
* label; opens the map's Menu, handed its rows as data: the same sortable
|
|
17
|
+
* columns the view-options Sort panel drives, beside it. Clicks stop
|
|
18
|
+
* propagation so the group's collapse toggle stays put.
|
|
20
19
|
*/
|
|
21
20
|
export declare function GridGroupMenu({ sort, sortOptions, summary, onSummaryChange, figures, onHide, groupMenu, select, }: {
|
|
22
21
|
/** The group's Select all in group, where the grid selects rows: whether all its rows are picked, and the pick.
|
|
23
22
|
* Drawn only when `groupMenu` names `"select"`. */
|
|
24
23
|
select?: GridGroupMenuSelect;
|
|
25
|
-
/** Which parts the menu holds (`groupMenuParts`). Absent: sort and Hide as given, the figure toggles with them
|
|
26
|
-
* and, on the `popover` route, a search past eight sort choices. */
|
|
24
|
+
/** Which parts the menu holds (`groupMenuParts`). Absent: sort and Hide as given, the figure toggles with them. */
|
|
27
25
|
groupMenu?: readonly GridGroupMenuPart[];
|
|
28
26
|
/** Absent when the list offers no row sort here — the menu then carries only
|
|
29
27
|
* what else it has (Hide group). */
|
|
@@ -1,34 +1,23 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
-
import {
|
|
3
|
+
import { useState } from "react";
|
|
4
4
|
import { useViews } from "../../provider/context.js";
|
|
5
5
|
import { cx } from "../../internal/cx.js";
|
|
6
6
|
import { drawGridButton } from "./grid-button.js";
|
|
7
|
-
import { GridMenuRow, GridMenuSeparator } from "./GridMenuRow.js";
|
|
8
|
-
import { matchMenuOptions } from "./grid-menu-search.js";
|
|
9
7
|
import { groupMenuParts } from "./grid-group-menu-parts.js";
|
|
10
|
-
import {
|
|
11
|
-
import { gridMenuArrows, gridMenuSearchArrows, useGridMenuFocus, useGridMenuPress } from "./grid-menu-focus.js";
|
|
8
|
+
import { useGridMenuFocus, useGridMenuPress } from "./grid-menu-focus.js";
|
|
12
9
|
import { gridGroupMenuItems } from "./grid-group-menu-items.js";
|
|
13
10
|
const GROUP_MORE_REVEAL = "group-data-desktop/gridtable:opacity-0 group-data-desktop/gridtable:group-hover/gridlabel:opacity-100 aria-expanded:opacity-100 group-data-desktop/gridtable:focus-visible:opacity-100";
|
|
14
|
-
const EYEBROW = "px-2 pb-1 pt-2 text-(length:--vk-caption-text,11px) font-medium uppercase tracking-wide text-(color:--vk-fg-subtle)";
|
|
15
11
|
export function GridGroupMenu({ sort, sortOptions, summary, onSummaryChange, figures = [], onHide, groupMenu, select, }) {
|
|
16
12
|
const [open, setOpen] = useState(false);
|
|
17
13
|
const [anchor, setAnchor] = useState(null);
|
|
18
|
-
|
|
14
|
+
useGridMenuFocus(open, anchor);
|
|
19
15
|
const press = useGridMenuPress(open);
|
|
20
|
-
const rowsBox = useRef(null);
|
|
21
|
-
const searchField = useRef(null);
|
|
22
16
|
const views = useViews();
|
|
23
|
-
const {
|
|
24
|
-
const {
|
|
25
|
-
const { List, Row, RowContent } = atoms;
|
|
17
|
+
const { components, icons, messages } = views;
|
|
18
|
+
const { Menu } = components;
|
|
26
19
|
const More = icons.more;
|
|
27
|
-
const
|
|
28
|
-
const close = () => {
|
|
29
|
-
setOpen(false);
|
|
30
|
-
setQuery("");
|
|
31
|
-
};
|
|
20
|
+
const close = () => setOpen(false);
|
|
32
21
|
const parts = groupMenuParts({
|
|
33
22
|
groupMenu,
|
|
34
23
|
hasSort: !!sort,
|
|
@@ -39,63 +28,33 @@ export function GridGroupMenu({ sort, sortOptions, summary, onSummaryChange, fig
|
|
|
39
28
|
canSelect: !!select,
|
|
40
29
|
});
|
|
41
30
|
const offered = parts.sort ? sortOptions : [];
|
|
42
|
-
const searchable = parts.command;
|
|
43
|
-
const sorts = matchMenuOptions(offered, query);
|
|
44
|
-
const pick = (opt) => {
|
|
45
|
-
if (!sort)
|
|
46
|
-
return;
|
|
47
|
-
const active = sort.value === opt.value;
|
|
48
|
-
const dir = active
|
|
49
|
-
? sort.dir === "asc"
|
|
50
|
-
? "desc"
|
|
51
|
-
: "asc"
|
|
52
|
-
: (opt.defaultDir ?? "asc");
|
|
53
|
-
sort.onChange({ value: opt.value, dir });
|
|
54
|
-
close();
|
|
55
|
-
};
|
|
56
|
-
const sortGlyph = (opt) => {
|
|
57
|
-
const active = sort.value === opt.value;
|
|
58
|
-
const Glyph = active && sort.dir === "desc" ? icons.sortRowsDown : icons.sortRowsUp;
|
|
59
|
-
return (_jsx(Glyph, { className: cx("size-3.5", active ? "text-(color:--vk-fg-brand)" : "text-(color:--vk-fg-subtlest)") }));
|
|
60
|
-
};
|
|
61
|
-
const menuRoute = (menus ?? "popover") === "menu";
|
|
62
31
|
return (_jsxs(_Fragment, { children: [drawGridButton(views, {
|
|
63
32
|
ref: setAnchor,
|
|
64
33
|
tabIndex: -1,
|
|
65
34
|
"aria-label": messages({ key: "views.menus.group-options" }),
|
|
66
|
-
"aria-haspopup":
|
|
35
|
+
"aria-haspopup": "menu",
|
|
67
36
|
"aria-expanded": open,
|
|
68
|
-
onPointerDownCapture:
|
|
37
|
+
onPointerDownCapture: press.notePress,
|
|
69
38
|
onClick: (e) => {
|
|
70
39
|
e.stopPropagation();
|
|
71
|
-
if (
|
|
40
|
+
if (press.pressedOpen(e) || open)
|
|
72
41
|
close();
|
|
73
|
-
else
|
|
74
|
-
menuFocus.noteOpen(e);
|
|
42
|
+
else
|
|
75
43
|
setOpen(true);
|
|
76
|
-
}
|
|
77
44
|
},
|
|
78
|
-
own: cx("inline-flex h-6 w-6 shrink-0 items-center justify-center rounded-md text-(color:--vk-fg-subtle)", "transition-opacity hover:bg-(color:--vk-hovered) hover:text-(color:--vk-fg)", GROUP_MORE_REVEAL, GRID_CHROME_FOCUS),
|
|
79
45
|
frame: cx("h-6 w-6 shrink-0 transition-opacity", GROUP_MORE_REVEAL),
|
|
80
46
|
variant: "ghost",
|
|
81
47
|
size: "icon",
|
|
82
48
|
children: _jsx(More, { className: "h-3.5 w-3.5" }),
|
|
83
|
-
}),
|
|
84
|
-
? gridGroupMenuItems(parts, {
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
}) }) })] })) : (sorts.map((opt) => (_jsx(Row, { chosen: sort.value === opt.value, label: opt.label, leading: sortGlyph(opt), onClick: () => pick(opt) }, opt.value)))), parts.figures && onSummaryChange && (_jsxs(_Fragment, { children: [offered.length > 0 && _jsx(GridMenuSeparator, {}), _jsx("div", { className: EYEBROW, children: messages({ key: "views.menus.group-show" }) }), [
|
|
95
|
-
{ part: "count", label: messages({ key: "views.menus.group-count" }) },
|
|
96
|
-
...figures,
|
|
97
|
-
].map((s) => (_jsx(Row, { chosen: (summary ?? []).includes(s.part), label: s.label, onClick: () => onSummaryChange(s.part, !(summary ?? []).includes(s.part)) }, s.part)))] })), parts.hide && onHide && (_jsxs(_Fragment, { children: [(parts.sort || parts.figures) && _jsx(GridMenuSeparator, {}), _jsx(GridMenuRow, { label: messages({ key: "views.menus.group-hide" }), icon: "hide", onClick: () => {
|
|
98
|
-
onHide();
|
|
99
|
-
close();
|
|
100
|
-
} })] }))] }) }) }))] }));
|
|
49
|
+
}), _jsx("span", { className: "contents", onClick: (e) => e.stopPropagation(), children: _jsx(Menu, { open: open, onOpenChange: (next) => (next ? setOpen(true) : close()), anchor: anchor, side: "bottom", align: "start", label: messages({ key: "views.menus.group-options" }), items: open
|
|
50
|
+
? gridGroupMenuItems(parts, {
|
|
51
|
+
...(sort && { sort }),
|
|
52
|
+
sortOptions: offered,
|
|
53
|
+
...(summary && { summary }),
|
|
54
|
+
...(onSummaryChange && { onSummaryChange }),
|
|
55
|
+
figures,
|
|
56
|
+
...(onHide && { onHide }),
|
|
57
|
+
...(select && { select }),
|
|
58
|
+
}, { messages, icons, close })
|
|
59
|
+
: [] }) })] }));
|
|
101
60
|
}
|
|
@@ -8,7 +8,7 @@ import { type GridGroupByState, type GridSortState } from "./GridColumnMenu.js";
|
|
|
8
8
|
import type { ViewsMenuItem } from "../../provider/components.js";
|
|
9
9
|
import type { useHeaderDragReorder } from "./useHeaderDragReorder.js";
|
|
10
10
|
type HeaderDrag = ReturnType<typeof useHeaderDragReorder>;
|
|
11
|
-
export declare function GridHeader<Row>({ showAddColumn, addColumnAt, checkbox, checkColumnId, groupKey, ariaRowIndex, ariaLevel, ariaColOffset, ariaTailIndex, columns, columnManager, minWidth, sort, sortMark, selectValues, optionColors, onOptionColorChange, dateStyles, onDateStyleChange, durationStyles, onDurationStyleChange, numberFormats, onNumberFormatChange, showTimeOverrides, onShowTimeChange, percentDisplays, onPercentDisplayChange, columnStateEnabled, listConfig, groupBy, resizingId, startResize, moveResize, endResize, resetColumnWidth, hideColumn, moveColumn, headerDrag, frozenCount, frozenLeft, verticalBorders, headerVerticalBorders, viewBacked, formatsWritable, renderAddColumn,
|
|
11
|
+
export declare function GridHeader<Row>({ showAddColumn, addColumnAt, checkbox, checkColumnId, groupKey, ariaRowIndex, ariaLevel, ariaColOffset, ariaTailIndex, columns, columnManager, minWidth, sort, sortMark, selectValues, optionColors, onOptionColorChange, dateStyles, onDateStyleChange, durationStyles, onDurationStyleChange, numberFormats, onNumberFormatChange, showTimeOverrides, onShowTimeChange, percentDisplays, onPercentDisplayChange, columnStateEnabled, listConfig, groupBy, resizingId, startResize, moveResize, endResize, resetColumnWidth, hideColumn, moveColumn, headerDrag, frozenCount, frozenLeft, verticalBorders, headerVerticalBorders, viewBacked, formatsWritable, renderAddColumn, columnMenuItems, openColumnMenu, onOpenColumnMenuChange, }: {
|
|
12
12
|
/** The table sized the tail for "+ Add column": the desktop strip of a grid with column state. */
|
|
13
13
|
showAddColumn?: boolean;
|
|
14
14
|
/** Where "+ Add column" stands, as the table resolved it: `"title"` only where a title column is shown. */
|
|
@@ -73,7 +73,6 @@ export declare function GridHeader<Row>({ showAddColumn, addColumnAt, checkbox,
|
|
|
73
73
|
/** The host's rules and slots, passed on from the grid's props (grid-table-props). */
|
|
74
74
|
formatsWritable?: boolean;
|
|
75
75
|
renderAddColumn?: (columns: ListColumnsConfig) => ReactNode;
|
|
76
|
-
renderColumnMenuRows?: (fieldKey: string, close: () => void) => ReactNode;
|
|
77
76
|
columnMenuItems?: (fieldKey: string) => ViewsMenuItem[] | null;
|
|
78
77
|
/** The column whose menu this row of names holds open (`openColumnMenu`); null: none; absent: each menu holds its
|
|
79
78
|
* own. */
|
|
@@ -15,7 +15,8 @@ import { gridColumnGlyph } from "./column-glyph.js";
|
|
|
15
15
|
import { gridFocusOnPress } from "./useGridFocus.js";
|
|
16
16
|
import { columnSortParts, effectiveSortKey, sortPartOf } from "../../model/column-sort.js";
|
|
17
17
|
import { columnPlacedByView } from "../../model/column-capabilities.js";
|
|
18
|
-
|
|
18
|
+
import { timeShown } from "../../display/format.js";
|
|
19
|
+
export function GridHeader({ showAddColumn = false, addColumnAt = "end", checkbox, checkColumnId, groupKey, ariaRowIndex, ariaLevel, ariaColOffset = 0, ariaTailIndex, columns, columnManager, minWidth, sort, sortMark = false, selectValues, optionColors, onOptionColorChange, dateStyles, onDateStyleChange, durationStyles, onDurationStyleChange, numberFormats, onNumberFormatChange, showTimeOverrides, onShowTimeChange, percentDisplays, onPercentDisplayChange, columnStateEnabled, listConfig, groupBy, resizingId, startResize, moveResize, endResize, resetColumnWidth, hideColumn, moveColumn, headerDrag, frozenCount = 0, frozenLeft, verticalBorders = true, headerVerticalBorders = false, viewBacked = false, formatsWritable, renderAddColumn, columnMenuItems, openColumnMenu, onOpenColumnMenuChange, }) {
|
|
19
20
|
const { icons, components, messages } = useViews();
|
|
20
21
|
const headId = useId();
|
|
21
22
|
const addColumnNode = columnManager && showAddColumn ? gridAddColumnNode(renderAddColumn, columnManager, addColumnAt) : null;
|
|
@@ -52,7 +53,7 @@ export function GridHeader({ showAddColumn = false, addColumnAt = "end", checkbo
|
|
|
52
53
|
: "relative"), children: [withCheck && checkbox, gridColumnGlyph({ icons, AppIcon: components.AppIcon }, column, "h-(--vk-head-glyph) w-(--vk-head-glyph) shrink-0 text-(color:--vk-head-glyph-fg,currentColor) opacity-70"), column.header ? (_jsx("span", { id: nameId, className: "truncate", children: column.header })) : null, sortMark && sortedAs && (_jsx("span", { "aria-hidden": true, className: "inline-flex shrink-0", children: _jsx(Mark, { className: "h-(--vk-head-glyph) w-(--vk-head-glyph)" }) })), withAddColumn && titleAddColumn, columnStateEnabled && (_jsx(GridResizeHandle, { active: resizingId === column.id, onResizeStart: (event) => startResize(column, event), onResizeMove: moveResize, onResizeEnd: endResize, onReset: () => resetColumnWidth(column) }))] }, column.id));
|
|
53
54
|
if (!menuEnabled)
|
|
54
55
|
return cell;
|
|
55
|
-
return (_jsx(GridColumnMenu, { column: column, values: selectValues[column.id] ?? [], viewBacked: viewBacked, sort: sort, groupBy: groupBy, optionColors: optionColors?.[fieldKeyOf(column)], onOptionColorChange: onOptionColorChange, dateStyle: dateStyles?.[fieldKeyOf(column)], onDateStyleChange: onDateStyleChange, durationStyle: durationStyles?.[fieldKeyOf(column)], onDurationStyleChange: onDurationStyleChange, numberFormat: numberFormats?.[fieldKeyOf(column)], onNumberFormatChange: onNumberFormatChange, showTime: showTimeOverrides?.[fieldKeyOf(column)]
|
|
56
|
+
return (_jsx(GridColumnMenu, { column: column, values: selectValues[column.id] ?? [], viewBacked: viewBacked, sort: sort, groupBy: groupBy, optionColors: optionColors?.[fieldKeyOf(column)], onOptionColorChange: onOptionColorChange, dateStyle: dateStyles?.[fieldKeyOf(column)], onDateStyleChange: onDateStyleChange, durationStyle: durationStyles?.[fieldKeyOf(column)], onDurationStyleChange: onDurationStyleChange, numberFormat: numberFormats?.[fieldKeyOf(column)], onNumberFormatChange: onNumberFormatChange, showTime: timeShown(column.format?.withTime, showTimeOverrides?.[fieldKeyOf(column)]), onShowTimeChange: column.type === "datetime" ? onShowTimeChange : undefined, percentDisplay: percentDisplays?.[fieldKeyOf(column)], onPercentDisplayChange: onPercentDisplayChange, onMoveLeft: canMove && index > 0 ? () => moveColumn(column, -1) : undefined, onMoveRight: canMove && index < columns.length - 1 ? () => moveColumn(column, 1) : undefined, onHide: canHide ? () => hideColumn(column) : undefined, formatsWritable: formatsWritable, columnMenuItems: column.partOf ? undefined : columnMenuItems, open: openColumnMenu === undefined ? undefined : openColumnMenu === column.id, onOpenChange: onOpenColumnMenuChange ? (next) => onOpenColumnMenuChange(next ? column.id : null) : undefined, children: cell }, column.id));
|
|
56
57
|
}), _jsxs("div", { "data-slot": "vk-grid-tail", role: "columnheader", "aria-colindex": ariaTailIndex, style: GRID_TAIL_PLACE, className: cx("flex h-(--vk-head-h) min-w-0 items-center gap-2 border-b border-(color:--vk-border-subtle)", addColumn ? "pl-0" : "pl-(--vk-px)"), children: [listConfig?.readOnly && (_jsxs("span", { title: messages({ key: "views.grid.read-only-why" }), className: cx("inline-flex shrink-0 items-center gap-1 whitespace-nowrap text-(length:--vk-head-text) text-(color:--vk-fg-subtle)", !!addColumn && "pl-(--vk-px)"), children: [_jsx(icons.lock, { className: "h-3 w-3" }), messages({ key: "views.grid.read-only" })] })), addColumn && _jsx("div", { className: "flex h-full min-w-0 flex-1 items-stretch", children: addColumn })] })] }));
|
|
57
58
|
return (_jsx("div", { "data-slot": "vk-grid-header", "data-group-key": groupKey, role: "row", "aria-rowindex": ariaRowIndex, "aria-level": ariaLevel, className: cx("group/gridhead grid grid-cols-(--vk-cols)", GRID_ONE_LINE, GRID_CONTENT_PAD), style: { minWidth }, children: cells }));
|
|
58
59
|
}
|
|
@@ -1,55 +1,34 @@
|
|
|
1
1
|
import { type ReactNode } from "react";
|
|
2
2
|
import { type TextEditorType } from "../../editors/TextEditor.js";
|
|
3
3
|
/**
|
|
4
|
-
* The GRID's
|
|
4
|
+
* The GRID's read-only text panel — reading a paragraph, or a line its cell cut off, in ONE surface.
|
|
5
5
|
*
|
|
6
|
-
* A
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
* top-left, the column's width) holding the whole value in the shared
|
|
10
|
-
* `TextEditor` as a paragraph, the caret at the end — Attio's model.
|
|
11
|
-
* Inspection is the same panel read-only: the value is selectable, copyable,
|
|
12
|
-
* and never written.
|
|
6
|
+
* A text the person may write edits in its cell, in the app's `TextBody`. A text opened only to be read (a read-only
|
|
7
|
+
* cell inspected) has no body form, so it opens this panel ON the cell (top-left on the cell's top-left, the column's
|
|
8
|
+
* width) holding the whole value in the editor's own textarea, selectable and copyable, never written — Attio's model.
|
|
13
9
|
*
|
|
14
|
-
* Anchored like the select and date editors: the cell's own content stays on
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
* room below the panel opens above the cell. On a phone it opens in the sheet
|
|
18
|
-
* instead (`EditorPanel`), titled with the column's header; the answer waits
|
|
19
|
-
* for the sheet to slide away, and ✓ never moves the selection.
|
|
10
|
+
* Anchored like the select and date editors: the cell's own content stays on screen behind the popover, and the app's
|
|
11
|
+
* popover owns the viewport — with no room below the panel opens above the cell. On a phone it opens in the sheet
|
|
12
|
+
* instead (`EditorPanel`), titled with the column's header.
|
|
20
13
|
*
|
|
21
|
-
* It
|
|
22
|
-
*
|
|
23
|
-
*
|
|
24
|
-
*
|
|
25
|
-
* Keys are a paragraph's: Enter is a newline; ⌘ or Ctrl Enter commits and
|
|
26
|
-
* advances; Tab commits and moves; Escape cancels; an outside click commits.
|
|
27
|
-
* The host grid's click-away listener clears the cell's focus after that commit.
|
|
14
|
+
* It opens a LINE whole too (`paragraph={false}`): a plain text or a text name its cell cut off. The box wraps so all
|
|
15
|
+
* of it shows. Every close writes nothing: Escape, Enter (⌘ or Ctrl Enter in a paragraph), Tab and an outside click
|
|
16
|
+
* close it, and Tab and Enter still move the grid's focus as they would from an edit.
|
|
28
17
|
*/
|
|
29
|
-
export declare function GridLongTextEditor({ initial,
|
|
30
|
-
/** The stored value the
|
|
18
|
+
export declare function GridLongTextEditor({ initial, markdown, paragraph, type, title, onCancel, onTab, onEnter, }: {
|
|
19
|
+
/** The stored value the panel shows ("" when unset). */
|
|
31
20
|
initial: string;
|
|
32
|
-
/**
|
|
33
|
-
seed?: string;
|
|
34
|
-
/** Inspection: the panel shows the value, selectable, and never commits. */
|
|
35
|
-
readOnly?: boolean;
|
|
36
|
-
/** Markdown keeps its first line's indent: it is tidied only at its edges
|
|
37
|
-
* (`normalizeMarkdown`), where plain long text is trimmed. */
|
|
21
|
+
/** Rich text: the value is markdown, shown as it is stored. */
|
|
38
22
|
markdown?: boolean;
|
|
39
|
-
/** A paragraph (default)
|
|
23
|
+
/** A paragraph (default). False: a line shown whole, where Enter closes. */
|
|
40
24
|
paragraph?: boolean;
|
|
41
|
-
/** The text
|
|
42
|
-
* `markdown`, else text. */
|
|
25
|
+
/** The text's type for a line. Default: rich text when `markdown`, else text. */
|
|
43
26
|
type?: TextEditorType;
|
|
44
27
|
/** The sheet's title on a phone: the column's header. */
|
|
45
28
|
title?: ReactNode;
|
|
46
|
-
onCommit: (value: string) => void;
|
|
47
29
|
onCancel: () => void;
|
|
48
|
-
/**
|
|
30
|
+
/** Closed via Tab — move to the next cell in reading order. */
|
|
49
31
|
onTab?: (backwards: boolean) => void;
|
|
50
|
-
/**
|
|
32
|
+
/** Closed via Enter (⌘ or Ctrl Enter in a paragraph) — advance one row down. */
|
|
51
33
|
onEnter?: () => void;
|
|
52
|
-
/** The grid's judgement of a value before it is written: its reason when it would refuse it.
|
|
53
|
-
* A refused value stays open in the panel with that reason. */
|
|
54
|
-
refuse?: (value: string) => string | null;
|
|
55
34
|
}): import("react/jsx-runtime").JSX.Element;
|
|
@@ -2,13 +2,13 @@
|
|
|
2
2
|
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
3
|
import { useLayoutEffect, useRef, useState } from "react";
|
|
4
4
|
import { EditorPanel } from "../../editors/EditorPanel.js";
|
|
5
|
-
import {
|
|
5
|
+
import { TextEditorHost, } from "../../editors/TextEditor.js";
|
|
6
6
|
import { useViews } from "../../provider/context.js";
|
|
7
7
|
import { cx } from "../../internal/cx.js";
|
|
8
8
|
import { useGridEditSession } from "./grid-edit-session.js";
|
|
9
9
|
const MIN_W = 320;
|
|
10
10
|
const MAX_W = 512;
|
|
11
|
-
export function GridLongTextEditor({ initial,
|
|
11
|
+
export function GridLongTextEditor({ initial, markdown = false, paragraph = true, type, title, onCancel, onTab, onEnter, }) {
|
|
12
12
|
const { messages } = useViews();
|
|
13
13
|
const anchorRef = useRef(null);
|
|
14
14
|
const editorRef = useRef(null);
|
|
@@ -20,17 +20,16 @@ export function GridLongTextEditor({ initial, seed, readOnly = false, markdown =
|
|
|
20
20
|
}, []);
|
|
21
21
|
const { session, close } = useGridEditSession({
|
|
22
22
|
editorRef,
|
|
23
|
-
|
|
24
|
-
onCommit: (payload) => onCommit(payload),
|
|
23
|
+
onCommit: () => { },
|
|
25
24
|
onCancel,
|
|
26
25
|
onTab,
|
|
27
26
|
onEnter,
|
|
28
27
|
});
|
|
29
28
|
const width = cell ? Math.min(MAX_W, Math.max(MIN_W, cell.width)) : MIN_W;
|
|
30
29
|
const padY = cell ? Math.max(0, (cell.height - cell.lineHeight) / 2 - 1) : 8;
|
|
31
|
-
return (_jsxs(_Fragment, { children: [_jsx("span", { ref: anchorRef, "aria-hidden": true, className: "pointer-events-none absolute inset-0" }), _jsx(EditorPanel, { session: session, title: title ?? "", anchor: anchorRef, align: "start", sideOffset: cell ? -cell.height : 0, initialFocus: false, panelData: { "data-slot": "vk-grid-editor" }, onPanelClick: (e) => e.stopPropagation(), chrome: "menu", className:
|
|
30
|
+
return (_jsxs(_Fragment, { children: [_jsx("span", { ref: anchorRef, "aria-hidden": true, className: "pointer-events-none absolute inset-0" }), _jsx(EditorPanel, { session: session, title: title ?? "", anchor: anchorRef, align: "start", sideOffset: cell ? -cell.height : 0, initialFocus: false, panelData: { "data-slot": "vk-grid-editor" }, onPanelClick: (e) => e.stopPropagation(), chrome: "menu", className: "z-90 rounded-sm border-(color:--vk-border) p-0", style: { width }, children: (surface) => {
|
|
32
31
|
const framed = surface === "sheet" && paragraph;
|
|
33
|
-
const editor = (_jsx(
|
|
32
|
+
const editor = (_jsx(TextEditorHost, { ref: editorRef, type: type ?? (markdown ? "rich_text" : "text"), multiline: paragraph, initial: initial, readOnly: true, ...(framed ? { rows: 3 } : {}), closeOnBlur: false, label: messages({ key: "views.grid.value" }), boxData: { "data-grid-editor": "" }, onRequestClose: close, style: cell && surface === "popover"
|
|
34
33
|
? {
|
|
35
34
|
paddingLeft: cell.paddingX,
|
|
36
35
|
paddingRight: cell.paddingX,
|
|
@@ -39,7 +38,7 @@ export function GridLongTextEditor({ initial, seed, readOnly = false, markdown =
|
|
|
39
38
|
fontSize: cell.fontSize,
|
|
40
39
|
lineHeight: `${cell.lineHeight}px`,
|
|
41
40
|
}
|
|
42
|
-
: undefined, className: cx("block w-full resize-none select-text bg-transparent text-(color:--vk-fg) outline-hidden", "overflow-y-auto overscroll-contain", surface === "sheet" && !framed && "px-4 py-2", framed && "rounded-md px-3 py-2 ring ring-(color:--vk-border)"
|
|
41
|
+
: undefined, className: cx("block w-full resize-none select-text bg-transparent text-(color:--vk-fg) outline-hidden", "overflow-y-auto overscroll-contain", surface === "sheet" && !framed && "px-4 py-2", framed && "rounded-md px-3 py-2 ring ring-(color:--vk-border)") }));
|
|
43
42
|
return framed ? _jsx("div", { className: "px-4 pb-4", children: editor }) : editor;
|
|
44
43
|
} })] }));
|
|
45
44
|
}
|
|
@@ -4,12 +4,12 @@ import { useRef } from "react";
|
|
|
4
4
|
import { EditorPanel } from "../../editors/EditorPanel.js";
|
|
5
5
|
import { NameEditor } from "../../editors/NameEditor.js";
|
|
6
6
|
import { useGridEditSession } from "./grid-edit-session.js";
|
|
7
|
-
import {
|
|
7
|
+
import { bodyPanel } from "../../editors/body-panel.js";
|
|
8
8
|
import { useGridBodyPlace } from "./grid-body-place.js";
|
|
9
9
|
export function GridNameEditor({ title, initial, seed, allowEmpty = false, onCommit, onCancel, onTab, onEnter, }) {
|
|
10
|
-
const panel =
|
|
10
|
+
const panel = bodyPanel("parts", "z-90");
|
|
11
11
|
const anchorRef = useRef(null);
|
|
12
|
-
const place = useGridBodyPlace(
|
|
12
|
+
const place = useGridBodyPlace(anchorRef);
|
|
13
13
|
const editorRef = useRef(null);
|
|
14
14
|
const { session, close } = useGridEditSession({
|
|
15
15
|
editorRef,
|
|
@@ -19,7 +19,7 @@ export function GridNameEditor({ title, initial, seed, allowEmpty = false, onCom
|
|
|
19
19
|
onEnter,
|
|
20
20
|
});
|
|
21
21
|
return (_jsxs(_Fragment, { children: [_jsx("span", { ref: anchorRef, "aria-hidden": true, className: "pointer-events-none absolute inset-0" }), _jsx(EditorPanel, { session: session, title: title, anchor: anchorRef, align: "start", sideOffset: place, initialFocus: false, panelData: { "data-slot": "vk-grid-editor", ...panel.data }, onPanelClick: (e) => e.stopPropagation(), chrome: "menu", className: panel.className, children: (surface) => {
|
|
22
|
-
const editor = (_jsx(NameEditor, { ref: editorRef, initial: initial, seed: seed, allowEmpty: allowEmpty,
|
|
22
|
+
const editor = (_jsx(NameEditor, { ref: editorRef, initial: initial, seed: seed, allowEmpty: allowEmpty, label: typeof title === "string" ? title : undefined, onRequestClose: close }));
|
|
23
23
|
return surface === "sheet" ? _jsx("div", { className: "px-4 pb-4", children: editor }) : editor;
|
|
24
24
|
} })] }));
|
|
25
25
|
}
|
|
@@ -2,7 +2,7 @@ import { type ReactNode } from "react";
|
|
|
2
2
|
import type { DurationUnit } from "viewkitjs/fields/query";
|
|
3
3
|
import type { GridNumberEditValue } from "../core/edit-values.js";
|
|
4
4
|
/**
|
|
5
|
-
* The GRID's host around the shared `
|
|
5
|
+
* The GRID's host around the shared `NumberEditorHost` (`viewkitjs/views/editors/number`) —
|
|
6
6
|
* the typed field and its unit chip are one component across every surface;
|
|
7
7
|
* the edit session owns the one-answer guard, and the editor panel decides where
|
|
8
8
|
* it opens. This host owns the grid's part: the write, and the focus move that
|
|
@@ -32,8 +32,7 @@ export declare function GridNumberEditor({ title, initial, seed, unit, unitOptio
|
|
|
32
32
|
/** A duration column's STORED unit — the core edits it as human text. */
|
|
33
33
|
durationUnit?: DurationUnit;
|
|
34
34
|
allowEmpty?: boolean;
|
|
35
|
-
/**
|
|
36
|
-
* with the column's right edge. */
|
|
35
|
+
/** A right-aligned column: the body's box grows leftward, so the number stays flush with the column's right edge. */
|
|
37
36
|
unitLeft?: boolean;
|
|
38
37
|
/** The figure the cell showed, when it showed the row's amount converted into another currency: named under
|
|
39
38
|
* the editor, which opens on the row's own amount. */
|
|
@@ -46,9 +45,9 @@ export declare function GridNumberEditor({ title, initial, seed, unit, unitOptio
|
|
|
46
45
|
/** The grid's judgement of a value before it is written: its reason when it would refuse it.
|
|
47
46
|
* A refused value keeps the editor open with that reason. */
|
|
48
47
|
refuse?: (value: GridNumberEditValue) => string | null;
|
|
49
|
-
/** The field's type:
|
|
48
|
+
/** The field's type: the `NumberBody` is handed it as its kind. Default `number`. */
|
|
50
49
|
type?: "number" | "percent" | "currency";
|
|
51
|
-
/** The field's limits (`numberBounds`): the
|
|
50
|
+
/** The field's limits (`numberBounds`): the `NumberBody` is handed them. */
|
|
52
51
|
bounds?: {
|
|
53
52
|
min?: number;
|
|
54
53
|
max?: number;
|
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
3
|
import { useRef } from "react";
|
|
4
|
-
import {
|
|
4
|
+
import { NumberEditorHost } from "../../editors/NumberEditor.js";
|
|
5
5
|
import { EditorPanel } from "../../editors/EditorPanel.js";
|
|
6
6
|
import { ConversionLine } from "../../display/converted.js";
|
|
7
7
|
import { useKeepInside } from "../../editors/keep-inside.js";
|
|
8
8
|
import { cx } from "../../internal/cx.js";
|
|
9
|
-
import {
|
|
10
|
-
import { GRID_EDITOR_LAYER } from "./grid-editor-layer.js";
|
|
9
|
+
import { BODY_FIGURE_ROOM_PX, GRID_EDITOR_LAYER } from "./grid-editor-layer.js";
|
|
11
10
|
import { GridFittedBox } from "./grid-fitted-box.js";
|
|
12
11
|
import { GridRefusal, UNDER_CELL_CLASS, useGridEditSession } from "./grid-edit-session.js";
|
|
13
12
|
export function GridNumberEditor({ title, initial, seed, unit, unitOptions, code, decimals = 2, durationUnit, allowEmpty = false, unitLeft = false, conversion, onCommit, onCancel, onTab, onEnter, refuse, type, bounds, }) {
|
|
@@ -22,8 +21,8 @@ export function GridNumberEditor({ title, initial, seed, unit, unitOptions, code
|
|
|
22
21
|
onTab,
|
|
23
22
|
onEnter,
|
|
24
23
|
});
|
|
25
|
-
const body =
|
|
26
|
-
const editor = (surface) => (_jsx(
|
|
24
|
+
const body = !durationUnit;
|
|
25
|
+
const editor = (surface) => (_jsx(NumberEditorHost, { ref: editorRef, initial: initial, seed: seed, unit: unit, unitOptions: unitOptions, code: code, decimals: decimals, durationUnit: durationUnit, allowEmpty: allowEmpty, ...bounds, ...(body
|
|
27
26
|
? {
|
|
28
27
|
type,
|
|
29
28
|
label: typeof title === "string" ? title : undefined,
|
|
@@ -33,7 +32,7 @@ export function GridNumberEditor({ title, initial, seed, unit, unitOptions, code
|
|
|
33
32
|
form: surface === "sheet" ? "phone" : "computer",
|
|
34
33
|
}
|
|
35
34
|
: {}), onRequestClose: close }));
|
|
36
|
-
return (_jsx(EditorPanel, { session: session, title: title, anchor: anchorRef, inPlace: true, sheetOnPhone: true, children: (surface) => body ? (surface === "sheet" ? (_jsxs("div", { className: "px-2 pb-3", children: [editor(surface), conversion ? _jsx(ConversionLine, { figure: conversion, className: "pt-1.5" }) : null] })) : (_jsxs("span", {
|
|
35
|
+
return (_jsx(EditorPanel, { session: session, title: title, anchor: anchorRef, inPlace: true, sheetOnPhone: true, children: (surface) => body ? (surface === "sheet" ? (_jsxs("div", { className: "px-2 pb-3", children: [editor(surface), conversion ? _jsx(ConversionLine, { figure: conversion, className: "pt-1.5" }) : null] })) : (_jsxs("span", { "data-slot": "vk-grid-editor", "data-grown": "", className: cx(GRID_EDITOR_LAYER, unitLeft && "justify-end"), children: [_jsx(GridFittedBox, { boxRef: anchorRef, edge: false, room: BODY_FIGURE_ROOM_PX, children: editor(surface) }), _jsx(GridRefusal, { reason: session.refusal }), conversion && !session.refusal ? _jsx(UnderCellConversion, { figure: conversion }) : null] }))) : surface === "sheet" ? (_jsxs("div", { className: "px-2 pb-3", children: [_jsx("div", { className: "flex h-10 min-w-0 items-center rounded-md border border-(color:--vk-border) px-2", children: editor(surface) }), conversion ? _jsx(ConversionLine, { figure: conversion, className: "pt-1.5" }) : null] })) : (_jsxs("span", { "data-slot": "vk-grid-editor", className: cx("relative flex h-full w-full min-w-0", unitLeft && "justify-end"), children: [_jsx(GridFittedBox, { boxRef: anchorRef, children: editor(surface) }), _jsx(GridRefusal, { reason: session.refusal }), conversion && !session.refusal ? _jsx(UnderCellConversion, { figure: conversion }) : null] })) }));
|
|
37
36
|
}
|
|
38
37
|
function UnderCellConversion({ figure }) {
|
|
39
38
|
const ref = useRef(null);
|
|
@@ -7,11 +7,10 @@ import type { FieldDefOf, LocationValue } from "viewkitjs/fields";
|
|
|
7
7
|
* session owns the one-answer guard and the exit gap; the editor panel opens the
|
|
8
8
|
* popover on a desktop and the sheet on a phone, titled with the column's
|
|
9
9
|
* header. An emptied place always reaches `refuse`, so a field that can't be
|
|
10
|
-
* emptied says so in the editor rather than closing on nothing
|
|
11
|
-
* may be emptied (`clearable`) ends the editor with a Clear row. No seed: a key
|
|
10
|
+
* emptied says so in the editor rather than closing on nothing. No seed: a key
|
|
12
11
|
* typed on a place cell opens the place as it is.
|
|
13
12
|
*/
|
|
14
|
-
export declare function GridPlaceEditor({ field, title, initial, refuse, onCommit, onCancel, onTab, onEnter,
|
|
13
|
+
export declare function GridPlaceEditor({ field, title, initial, refuse, onCommit, onCancel, onTab, onEnter, }: {
|
|
15
14
|
field: FieldDefOf<"location">;
|
|
16
15
|
/** The field's name: the sheet's title on a phone. */
|
|
17
16
|
title: ReactNode;
|
|
@@ -24,6 +23,4 @@ export declare function GridPlaceEditor({ field, title, initial, refuse, onCommi
|
|
|
24
23
|
onTab?: (backwards: boolean) => void;
|
|
25
24
|
/** Commit happened via Enter — advance one row down. */
|
|
26
25
|
onEnter?: () => void;
|
|
27
|
-
/** The column may be emptied: the editor ends with a Clear row, which commits null. Default false. */
|
|
28
|
-
clearable?: boolean;
|
|
29
26
|
}): import("react/jsx-runtime").JSX.Element;
|
|
@@ -4,12 +4,12 @@ import { useRef } from "react";
|
|
|
4
4
|
import { EditorPanel } from "../../editors/EditorPanel.js";
|
|
5
5
|
import { LocationEditor } from "../../editors/LocationEditor.js";
|
|
6
6
|
import { useGridEditSession } from "./grid-edit-session.js";
|
|
7
|
-
import {
|
|
7
|
+
import { bodyPanel } from "../../editors/body-panel.js";
|
|
8
8
|
import { useGridBodyPlace } from "./grid-body-place.js";
|
|
9
|
-
export function GridPlaceEditor({ field, title, initial, refuse, onCommit, onCancel, onTab, onEnter,
|
|
10
|
-
const panel =
|
|
9
|
+
export function GridPlaceEditor({ field, title, initial, refuse, onCommit, onCancel, onTab, onEnter, }) {
|
|
10
|
+
const panel = bodyPanel("parts", "z-90");
|
|
11
11
|
const anchorRef = useRef(null);
|
|
12
|
-
const place = useGridBodyPlace(
|
|
12
|
+
const place = useGridBodyPlace(anchorRef);
|
|
13
13
|
const editorRef = useRef(null);
|
|
14
14
|
const { session, close } = useGridEditSession({
|
|
15
15
|
editorRef,
|
|
@@ -20,7 +20,7 @@ export function GridPlaceEditor({ field, title, initial, refuse, onCommit, onCan
|
|
|
20
20
|
onEnter,
|
|
21
21
|
});
|
|
22
22
|
return (_jsxs(_Fragment, { children: [_jsx("span", { ref: anchorRef, "aria-hidden": true, className: "pointer-events-none absolute inset-0" }), _jsx(EditorPanel, { session: session, title: title, anchor: anchorRef, align: "start", sideOffset: place, initialFocus: false, panelData: { "data-slot": "vk-grid-editor", ...panel.data }, onPanelClick: (e) => e.stopPropagation(), chrome: "menu", className: panel.className, children: (surface) => {
|
|
23
|
-
const editor = (_jsx(LocationEditor, { ref: editorRef, field: field, initial: initial, allowEmpty: true,
|
|
23
|
+
const editor = (_jsx(LocationEditor, { ref: editorRef, field: field, initial: initial, allowEmpty: true, label: typeof title === "string" ? title : undefined, onRequestClose: close }));
|
|
24
24
|
return surface === "sheet" ? _jsx("div", { className: "px-4 pb-4", children: editor }) : editor;
|
|
25
25
|
} })] }));
|
|
26
26
|
}
|
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
import { type ReactNode } from "react";
|
|
2
2
|
import type { RangePreset, RangeValue } from "viewkitjs/fields";
|
|
3
3
|
/**
|
|
4
|
-
* The GRID's host around the shared `RangeEditor
|
|
5
|
-
*
|
|
6
|
-
* opens
|
|
7
|
-
*
|
|
8
|
-
* the answer waits for the sheet to slide away.
|
|
4
|
+
* The GRID's host around the shared `RangeEditor`: the edit session owns the
|
|
5
|
+
* one-answer guard and the editor panel decides where it opens. On a desktop the
|
|
6
|
+
* app's parts body opens in a popover over the cell, its top on the cell's top;
|
|
7
|
+
* on a phone it opens in the sheet and the answer waits for the sheet to slide away.
|
|
9
8
|
*/
|
|
10
|
-
export declare function GridRangeEditor({ title, initial, seed, decimals, allowEmpty, suffix, bands,
|
|
9
|
+
export declare function GridRangeEditor({ title, initial, seed, decimals, allowEmpty, suffix, bands, onCommit, onCancel, onTab, onEnter, refuse, }: {
|
|
11
10
|
/** The field's name: the sheet's title on a phone. */
|
|
12
11
|
title: ReactNode;
|
|
13
12
|
initial: RangeValue | null;
|
|
@@ -17,13 +16,8 @@ export declare function GridRangeEditor({ title, initial, seed, decimals, allowE
|
|
|
17
16
|
allowEmpty?: boolean;
|
|
18
17
|
/** "%", a currency code — drawn after the high box. */
|
|
19
18
|
suffix?: string;
|
|
20
|
-
/** The field's bands:
|
|
19
|
+
/** The field's bands: the body lists them. */
|
|
21
20
|
bands?: readonly RangePreset[];
|
|
22
|
-
/** The field's limits for each end (`numberBounds`): the editor's own boxes step within them. */
|
|
23
|
-
bounds?: {
|
|
24
|
-
min?: number;
|
|
25
|
-
max?: number;
|
|
26
|
-
};
|
|
27
21
|
onCommit: (payload: RangeValue) => void;
|
|
28
22
|
onCancel: () => void;
|
|
29
23
|
onTab?: (backwards: boolean) => void;
|
|
@@ -3,30 +3,22 @@ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-run
|
|
|
3
3
|
import { useRef } from "react";
|
|
4
4
|
import { RangeEditor } from "../../editors/RangeEditor.js";
|
|
5
5
|
import { EditorPanel } from "../../editors/EditorPanel.js";
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import { useBodyPanel } from "../../editors/body-panel.js";
|
|
6
|
+
import { useGridEditSession } from "./grid-edit-session.js";
|
|
7
|
+
import { bodyPanel } from "../../editors/body-panel.js";
|
|
9
8
|
import { useGridBodyPlace } from "./grid-body-place.js";
|
|
10
|
-
export function GridRangeEditor({ title, initial, seed, decimals = 0, allowEmpty = false, suffix, bands,
|
|
11
|
-
const panel =
|
|
9
|
+
export function GridRangeEditor({ title, initial, seed, decimals = 0, allowEmpty = false, suffix, bands, onCommit, onCancel, onTab, onEnter, refuse, }) {
|
|
10
|
+
const panel = bodyPanel("parts", "z-90");
|
|
12
11
|
const editorRef = useRef(null);
|
|
13
12
|
const anchorRef = useRef(null);
|
|
14
|
-
const place = useGridBodyPlace(
|
|
15
|
-
const { PartsBody } = useViews().components;
|
|
16
|
-
const inPlace = !PartsBody;
|
|
13
|
+
const place = useGridBodyPlace(anchorRef);
|
|
17
14
|
const { session, close } = useGridEditSession({
|
|
18
15
|
editorRef,
|
|
19
|
-
inPlace,
|
|
20
16
|
refuse: refuse && ((value) => refuse(value)),
|
|
21
17
|
onCommit: (payload) => onCommit(payload),
|
|
22
18
|
onCancel,
|
|
23
19
|
onTab,
|
|
24
20
|
onEnter,
|
|
25
21
|
});
|
|
26
|
-
const
|
|
27
|
-
|
|
28
|
-
if (!inPlace) {
|
|
29
|
-
return (_jsxs(_Fragment, { children: [_jsx("span", { ref: anchorRef, "aria-hidden": true, className: "pointer-events-none absolute inset-0" }), _jsx(EditorPanel, { session: session, title: title, anchor: anchorRef, align: "start", sideOffset: place, initialFocus: false, panelData: { "data-slot": "vk-grid-editor", ...panel.data }, onPanelClick: (e) => e.stopPropagation(), chrome: "menu", className: panel.className, children: (surface) => (surface === "sheet" ? _jsx("div", { className: "px-4 pb-4", children: editor(true) }) : editor(false)) })] }));
|
|
30
|
-
}
|
|
31
|
-
return (_jsx(EditorPanel, { session: session, title: title, anchor: anchorRef, inPlace: true, sheetOnPhone: true, editorDrawsRefusal: banded, children: (surface) => surface === "sheet" ? (_jsx("div", { className: "px-2 pb-3", children: editor(true) })) : (_jsxs("span", { ref: anchorRef, "data-slot": "vk-grid-editor", className: "relative flex h-full w-full min-w-0", children: [editor(false), !banded && _jsx(GridRefusal, { reason: session.refusal })] })) }));
|
|
22
|
+
const editor = (_jsx(RangeEditor, { ref: editorRef, initial: initial, seed: seed, decimals: decimals, allowEmpty: allowEmpty, suffix: suffix, bands: bands, label: typeof title === "string" ? title : undefined, onRequestClose: close }));
|
|
23
|
+
return (_jsxs(_Fragment, { children: [_jsx("span", { ref: anchorRef, "aria-hidden": true, className: "pointer-events-none absolute inset-0" }), _jsx(EditorPanel, { session: session, title: title, anchor: anchorRef, align: "start", sideOffset: place, initialFocus: false, panelData: { "data-slot": "vk-grid-editor", ...panel.data }, onPanelClick: (e) => e.stopPropagation(), chrome: "menu", className: panel.className, children: (surface) => (surface === "sheet" ? _jsx("div", { className: "px-4 pb-4", children: editor }) : editor) })] }));
|
|
32
24
|
}
|