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,12 +1,11 @@
|
|
|
1
1
|
import type { ComponentType, ReactNode } from "react";
|
|
2
2
|
import type { CloseReason } from "viewkitjs/fields";
|
|
3
3
|
import type { ViewsLink, ViewsLinkRole, ViewsLinksBodyProps } from "../provider/components.js";
|
|
4
|
-
import { type RelationHeld } from "./relation-picker.js";
|
|
5
|
-
import type { RelationCreate } from "./relation-panel.js";
|
|
4
|
+
import { type RelationCreate, type RelationHeld } from "./relation-picker.js";
|
|
6
5
|
import type { RelationCandidate, RelationSource } from "./relation-source.js";
|
|
7
6
|
/**
|
|
8
7
|
* A SET'S LINKS THROUGH THE APP'S OWN LINKS BODY — what stands where `RelationPickerBody` stands when the field declares
|
|
9
|
-
* `links
|
|
8
|
+
* `links`. The rows are the Picker's (`useRelationRows`); the body is handed each link's
|
|
10
9
|
* roles, the field's roles and the lead, and hands back the whole list. A link whose record it never handed, or a
|
|
11
10
|
* repeat, is dropped here; what a role and the lead may be is the core's. Framed as every app body is (`BodyFrame`):
|
|
12
11
|
* Escape and Tab are the editor's, a marked level's or a popup's Escape the body's. The package's own.
|
|
@@ -1,7 +1,18 @@
|
|
|
1
1
|
import type { ComponentType, ReactNode } from "react";
|
|
2
2
|
import type { ViewsPickerAction, ViewsPickerItem, ViewsPickerProps } from "../provider/components.js";
|
|
3
|
-
import type { RelationCreate } from "./relation-panel.js";
|
|
4
3
|
import { type RelationCandidate, type RelationSource } from "./relation-source.js";
|
|
4
|
+
/**
|
|
5
|
+
* A create row for "it isn't in the list yet": the host opens its own create
|
|
6
|
+
* form with what was typed already filled. The app's body draws it as an action
|
|
7
|
+
* after the rows (`ViewsPickerAction`). A press asks the host to close (the core
|
|
8
|
+
* says what that close means), then `onCreate` runs.
|
|
9
|
+
*/
|
|
10
|
+
export type RelationCreate = {
|
|
11
|
+
/** The row's words; receives the trimmed query. */
|
|
12
|
+
label: (query: string) => string;
|
|
13
|
+
/** Runs AFTER the host has been asked to close, with the trimmed query. */
|
|
14
|
+
onCreate: (query: string) => void;
|
|
15
|
+
};
|
|
5
16
|
/** A held record as the body shows it: from its candidate where the page has it, else from its link. */
|
|
6
17
|
export type RelationHeld = {
|
|
7
18
|
id: string;
|
|
@@ -30,8 +41,7 @@ export declare function useRelationRows({ candidates, query, held, kindGlyph, cr
|
|
|
30
41
|
actions?: ViewsPickerAction[];
|
|
31
42
|
};
|
|
32
43
|
/**
|
|
33
|
-
* A RELATION'S LIST THROUGH THE APP'S OWN PICKER
|
|
34
|
-
* a `Picker`. ViewKit still filters a static source (by label, as its own list does) and fetches a remote one
|
|
44
|
+
* A RELATION'S LIST THROUGH THE APP'S OWN PICKER. ViewKit filters a static source (by label, as its own list does) and fetches a remote one
|
|
35
45
|
* (`useRemotePage`: the debounce, the abort, the paging), so the body draws the rows it is handed and reports
|
|
36
46
|
* each typed query back. Held records come first, by the same search rule; the host's create rows become the
|
|
37
47
|
* body's actions. What a pick means is the core's: this hands it ids it handed out, nothing else.
|
|
@@ -46,25 +46,3 @@ export declare function useRemotePage(source: RelationSource, query: string): Re
|
|
|
46
46
|
loadMore: () => void;
|
|
47
47
|
retry: () => void;
|
|
48
48
|
};
|
|
49
|
-
/**
|
|
50
|
-
* The end of the list came into view — ask for the next page.
|
|
51
|
-
*
|
|
52
|
-
* `shared/list`'s `LazyLoadSentinel` is the house version of this and it is
|
|
53
|
-
* deliberately NOT reused: a core may not import from the list (the field
|
|
54
|
-
* folder compiles on its own, `tsconfig.fields.json`), so the discipline is
|
|
55
|
-
* copied rather than the file.
|
|
56
|
-
*
|
|
57
|
-
* The copied part that matters: the handler is read through a ref so the
|
|
58
|
-
* observer is built ONCE. Every host writes its search inline, so a re-render
|
|
59
|
-
* would otherwise disconnect and rebuild the observer — and an
|
|
60
|
-
* IntersectionObserver delivers its first callback on a later frame, so a
|
|
61
|
-
* panel that re-renders steadily can lose that race indefinitely and simply
|
|
62
|
-
* never load a second page, with no error and no symptom beyond "it stops at
|
|
63
|
-
* page one". The long version of that reasoning is in `LazyLoadSentinel.tsx`.
|
|
64
|
-
*
|
|
65
|
-
* No `root`: the observer resolves against the viewport, clipped by the
|
|
66
|
-
* scrolling ancestor — which here is the panel's own list.
|
|
67
|
-
*/
|
|
68
|
-
export declare function EndOfListSentinel({ onReveal }: {
|
|
69
|
-
onReveal: () => void;
|
|
70
|
-
}): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
2
|
import { useCallback, useEffect, useRef, useState } from "react";
|
|
4
3
|
export const RELATION_SEARCH_DEBOUNCE_MS = 200;
|
|
5
4
|
export const RELATION_PAGE_SIZE = 20;
|
|
@@ -89,23 +88,3 @@ export function useRemotePage(source, query) {
|
|
|
89
88
|
}, [remote, run]);
|
|
90
89
|
return { ...page, searching: remote && (page.searching || query !== page.asked), loadMore, retry };
|
|
91
90
|
}
|
|
92
|
-
export function EndOfListSentinel({ onReveal }) {
|
|
93
|
-
const ref = useRef(null);
|
|
94
|
-
const onRevealRef = useRef(onReveal);
|
|
95
|
-
useEffect(() => {
|
|
96
|
-
onRevealRef.current = onReveal;
|
|
97
|
-
});
|
|
98
|
-
useEffect(() => {
|
|
99
|
-
const el = ref.current;
|
|
100
|
-
if (!el)
|
|
101
|
-
return;
|
|
102
|
-
const observer = new IntersectionObserver((entries) => {
|
|
103
|
-
for (const entry of entries)
|
|
104
|
-
if (entry.isIntersecting)
|
|
105
|
-
onRevealRef.current();
|
|
106
|
-
}, { rootMargin: "80px 0px" });
|
|
107
|
-
observer.observe(el);
|
|
108
|
-
return () => observer.disconnect();
|
|
109
|
-
}, []);
|
|
110
|
-
return _jsx("div", { ref: ref, "aria-hidden": true, className: "h-px" });
|
|
111
|
-
}
|
|
@@ -16,7 +16,7 @@ import { FIELD_ROW_FRAME, FIELD_ROW_FRAME_BESIDE, FIELD_ROW_FRAME_UNDER, FieldRo
|
|
|
16
16
|
import { FieldRowLane } from "./FieldRowLane.js";
|
|
17
17
|
import { FieldWriteReconciliationRequired, } from "../fields/write-target.js";
|
|
18
18
|
import { OpenValueAction, isOpenableType } from "../editors/open-value.js";
|
|
19
|
-
import { FIELD_ROW_TARGET as TARGET
|
|
19
|
+
import { FIELD_ROW_TARGET as TARGET } from "./row-target.js";
|
|
20
20
|
import { settlementAttributes, useRowSettlement } from "./useRowSettlement.js";
|
|
21
21
|
import { EditLeaveContext, useEditLeaveScope } from "../editors/leave-scope.js";
|
|
22
22
|
const EDITOR_PANEL = '[data-slot="vk-editor-panel"]';
|
|
@@ -36,7 +36,7 @@ function FieldRowImpl({ binding, row, value, editValue, writable, ready = true,
|
|
|
36
36
|
const { field } = binding;
|
|
37
37
|
const views = useViews();
|
|
38
38
|
const desktop = useDesktop();
|
|
39
|
-
const { atoms, components, conventions, icons, messages
|
|
39
|
+
const { atoms, components, conventions, icons, messages } = views;
|
|
40
40
|
const { CommandMenu } = atoms;
|
|
41
41
|
const { AppIcon } = components;
|
|
42
42
|
const [editing, setEditing] = useState(false);
|
|
@@ -158,7 +158,7 @@ function FieldRowImpl({ binding, row, value, editValue, writable, ready = true,
|
|
|
158
158
|
...opts,
|
|
159
159
|
currency: opts?.currency ?? (fieldOwnsCurrency || unread ? undefined : binding.unit?.read(row)),
|
|
160
160
|
...(valueInButton ? { slotOwnsClick: true } : {}),
|
|
161
|
-
|
|
161
|
+
booleanCheckbox: FieldRowCheckbox,
|
|
162
162
|
};
|
|
163
163
|
const editsInPlace = writable && shownDef.type !== "boolean" && !hasMenu && !unread && !isEmpty;
|
|
164
164
|
const openType = editsInPlace && singleLink && isOpenableType(shownDef.type) ? shownDef.type : null;
|
|
@@ -198,7 +198,7 @@ function FieldRowImpl({ binding, row, value, editValue, writable, ready = true,
|
|
|
198
198
|
const glyph = binding.icon ? (_jsx(AppIcon, { name: binding.icon, className: "h-3.5 w-3.5 text-(color:--vk-fg-subtlest)" })) : (_jsx(TypeGlyph, { className: "h-3.5 w-3.5 text-(color:--vk-fg-subtlest)" }));
|
|
199
199
|
const menuItems = fieldRowMenuItems(menu, ready, messages);
|
|
200
200
|
const valueNode = (_jsxs("span", { ref: valueRef, className: "flex min-w-0 flex-1 items-center gap-2", children: [_jsx("span", { className: "min-w-0 wrap-break-word", children: body }), meta ? _jsx("span", { className: "shrink-0 text-xs text-(color:--vk-fg-subtle)", children: meta }) : null] }));
|
|
201
|
-
const editButton = (shape,
|
|
201
|
+
const editButton = (shape, children) => (_jsx(FieldRowButton, { views: views, frame: cx(shape === "under"
|
|
202
202
|
? FIELD_ROW_FRAME_UNDER
|
|
203
203
|
: shape === "beside"
|
|
204
204
|
? FIELD_ROW_FRAME_BESIDE
|
|
@@ -215,14 +215,13 @@ function FieldRowImpl({ binding, row, value, editValue, writable, ready = true,
|
|
|
215
215
|
watchLeaving();
|
|
216
216
|
return attempt(resolution);
|
|
217
217
|
}, onClose: closed, message: message, kindIcon: kindIcon, openedByKey: byKey }) })) : hasMenu && !verbsInLane ? (_jsx(CommandMenu, { trigger: drawFieldRowButton(views, {
|
|
218
|
-
own: TARGET,
|
|
219
218
|
frame: FIELD_ROW_FRAME,
|
|
220
219
|
variant: "ghost",
|
|
221
220
|
size: "sm",
|
|
222
221
|
"aria-label": field.label,
|
|
223
222
|
disabled: !ready,
|
|
224
223
|
children: valueNode,
|
|
225
|
-
}), items: menuItems, align: "start" })) : writable && shownDef.type !== "boolean" ? (valueOverButton ? (_jsxs("div", { className: "relative min-w-0", children: [editButton("under"
|
|
224
|
+
}), items: menuItems, align: "start" })) : writable && shownDef.type !== "boolean" ? (valueOverButton ? (_jsxs("div", { className: "relative min-w-0", children: [editButton("under"), _jsx("span", { "data-slot": "vk-row-value-layer", className: cx("pointer-events-none relative block min-w-0 [&_a]:pointer-events-auto [&_button]:pointer-events-auto", pending && "opacity-70"), children: valueNode })] })) : openType ? (_jsxs("div", { className: "flex min-w-0 items-center gap-1", children: [editButton("beside", valueNode), _jsx(OpenValueAction, { type: openType, value: openValue, label: openLabel, compact: true })] })) : (editButton("target", valueNode))) : (_jsx("span", { className: "block min-w-0", children: valueNode })), !editing && note ? (_jsx(FieldNoteLine, { note: typeof note === "string" ? { text: note } : note })) : null, !editing && error && retryDraft ? (_jsx("div", { role: "alert", className: "mt-1 text-xs text-(color:--vk-danger)", children: _jsx("button", { type: "button", "data-slot": "vk-field-retry", onClick: () => {
|
|
226
225
|
setError(null);
|
|
227
226
|
const retried = attempt({ kind: "commit", payload: retryDraft.commit });
|
|
228
227
|
if (!retried.accepted)
|
|
@@ -10,7 +10,6 @@ export function FieldRowLane({ label, verbsInLane, hasMenu, items, ready, writab
|
|
|
10
10
|
const More = icons.more;
|
|
11
11
|
const Lock = icons.lock;
|
|
12
12
|
return (_jsx("span", { className: "flex h-5 w-3 shrink-0 items-center justify-center", children: verbsInLane ? (_jsx(CommandMenu, { trigger: drawFieldRowButton(views, {
|
|
13
|
-
own: "group -m-1 p-1",
|
|
14
13
|
frame: "group -m-1 size-5 shrink-0",
|
|
15
14
|
variant: "ghost",
|
|
16
15
|
size: "icon",
|
|
@@ -8,9 +8,9 @@ import { EditorPanel } from "../../editors/EditorPanel.js";
|
|
|
8
8
|
import { offeredValues, takesNewValues, useOpenValues } from "../../editors/open-values.js";
|
|
9
9
|
import { OPTION_ROW_INSET } from "./host.js";
|
|
10
10
|
import { useRowEditSession } from "./row-session.js";
|
|
11
|
-
import {
|
|
11
|
+
import { bodyPanel } from "../../editors/body-panel.js";
|
|
12
12
|
export function RowChipsEditor({ binding, field, initial, anchor, onAttempt, onClose, message, }) {
|
|
13
|
-
const panel =
|
|
13
|
+
const panel = bodyPanel("picker", "z-90");
|
|
14
14
|
const editorRef = useRef(null);
|
|
15
15
|
const anchorRef = useRef(null);
|
|
16
16
|
const { session, close } = useRowEditSession({ editorRef, onAttempt, onClose });
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import type { RowHostProps } from "./host.js";
|
|
2
2
|
/**
|
|
3
|
-
* The FIELD ROW's host around the shared `
|
|
3
|
+
* The FIELD ROW's host around the shared `DateEditorHost` — the same date body the
|
|
4
4
|
* grid cell and the form field open: a popover on a desktop, the sheet on a
|
|
5
5
|
* phone (`EditorPanel`).
|
|
6
6
|
*
|
|
7
7
|
* TWO field types, one panel. They differ in what the row HOLDS, so they differ
|
|
8
8
|
* only in what this host does with the answer: a `date` is a calendar day, so
|
|
9
|
-
* the time the panel may have collected is trimmed off the payload and the
|
|
9
|
+
* the time the panel may have collected is trimmed off the payload and the time
|
|
10
10
|
* starts empty (`timeOptional`); a `datetime` is an instant, so the commit
|
|
11
11
|
* always carries one — the grid's mode, preserved.
|
|
12
12
|
*
|
|
@@ -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 { useRowEditSession } from "./row-session.js";
|
|
7
7
|
export function RowDateEditor({ field, initial, anchor, onAttempt, onClose, message, }) {
|
|
@@ -14,5 +14,5 @@ export function RowDateEditor({ field, initial, anchor, onAttempt, onClose, mess
|
|
|
14
14
|
onClose,
|
|
15
15
|
mapPayload: (payload) => (payload === "" ? null : dayOnly ? payload.slice(0, 10) : payload),
|
|
16
16
|
});
|
|
17
|
-
return (_jsxs(_Fragment, { children: [_jsx("span", { ref: anchorRef, className: "block min-w-0", children: anchor }), _jsx(EditorPanel, { session: session, title: field.label, anchor: anchorRef, align: "start", sideOffset: 4, initialFocus: false, chrome: "menu", className: "z-90 w-auto", children: (
|
|
17
|
+
return (_jsxs(_Fragment, { children: [_jsx("span", { ref: anchorRef, className: "block min-w-0", children: anchor }), _jsx(EditorPanel, { session: session, title: field.label, anchor: anchorRef, align: "start", sideOffset: 4, initialFocus: false, chrome: "menu", className: "z-90 w-auto", children: () => (_jsx(DateEditorHost, { ref: editorRef, label: field.label, initial: typeof initial === "string" && initial !== "" ? initial : undefined, timeOptional: dayOnly, dayOnly: dayOnly, clearable: !!field.nullable, focusDate: !sheet, onRequestClose: close, message: message })) })] }));
|
|
18
18
|
}
|
|
@@ -1,7 +1,4 @@
|
|
|
1
1
|
import type { RowHostProps } from "./host.js";
|
|
2
|
-
/** The FIELD ROW's host around the shared `NameEditor
|
|
3
|
-
*
|
|
4
|
-
* With an app's parts body it opens anchored instead, as the place host does:
|
|
5
|
-
* a popover under the value on a desktop, the sheet on a phone, the value on
|
|
6
|
-
* screen. */
|
|
2
|
+
/** The FIELD ROW's host around the shared `NameEditor`: the app's parts body opens anchored, as the place host does:
|
|
3
|
+
* a popover under the value on a desktop, the sheet on a phone, the value on screen. */
|
|
7
4
|
export declare function RowNameEditor<Row>({ field, initial, anchor, onAttempt, onClose, }: RowHostProps<Row, "name">): import("react/jsx-runtime").JSX.Element;
|
|
@@ -5,19 +5,14 @@ import { isNameValue } from "viewkitjs/fields";
|
|
|
5
5
|
import { EditorPanel } from "../../editors/EditorPanel.js";
|
|
6
6
|
import { NameEditor } from "../../editors/NameEditor.js";
|
|
7
7
|
import { useViews } from "../../provider/context.js";
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import { useBodyPanel } from "../../editors/body-panel.js";
|
|
8
|
+
import { useRowEditSession } from "./row-session.js";
|
|
9
|
+
import { bodyPanel } from "../../editors/body-panel.js";
|
|
11
10
|
export function RowNameEditor({ field, initial, anchor, onAttempt, onClose, }) {
|
|
12
|
-
const panel =
|
|
13
|
-
const { conventions
|
|
14
|
-
const inPlace = !components.PartsBody;
|
|
11
|
+
const panel = bodyPanel("parts", "z-90 max-w-[calc(100vw-2rem)]");
|
|
12
|
+
const { conventions } = useViews();
|
|
15
13
|
const editorRef = useRef(null);
|
|
16
14
|
const anchorRef = useRef(null);
|
|
17
|
-
const { session, close } = useRowEditSession({ editorRef,
|
|
18
|
-
const editor = (_jsx(NameEditor, { ref: editorRef, initial: isNameValue(initial) ? initial : null, allowEmpty: !!field.nullable, conventions: conventions, label: field.label,
|
|
19
|
-
|
|
20
|
-
return (_jsxs(_Fragment, { children: [_jsx("span", { ref: anchorRef, className: "block min-w-0", children: anchor }), _jsx(EditorPanel, { panelData: panel.data, session: session, title: field.label, anchor: anchorRef, align: "start", sideOffset: 4, initialFocus: false, chrome: "menu", className: panel.className, children: (surface) => (surface === "sheet" ? _jsx("div", { className: "px-4 pb-4", children: editor }) : editor) })] }));
|
|
21
|
-
}
|
|
22
|
-
return (_jsxs(EditorPanel, { session: session, title: field.label, anchor: anchorRef, inPlace: true, children: [editor, _jsx(RowRefusal, { text: session.refusal })] }));
|
|
15
|
+
const { session, close } = useRowEditSession({ editorRef, onAttempt, onClose });
|
|
16
|
+
const editor = (_jsx(NameEditor, { ref: editorRef, initial: isNameValue(initial) ? initial : null, allowEmpty: !!field.nullable, conventions: conventions, label: field.label, onRequestClose: close }));
|
|
17
|
+
return (_jsxs(_Fragment, { children: [_jsx("span", { ref: anchorRef, className: "block min-w-0", children: anchor }), _jsx(EditorPanel, { panelData: panel.data, session: session, title: field.label, anchor: anchorRef, align: "start", sideOffset: 4, initialFocus: false, chrome: "menu", className: panel.className, children: (surface) => (surface === "sheet" ? _jsx("div", { className: "px-4 pb-4", children: editor }) : editor) })] }));
|
|
23
18
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { RowHostProps } from "./host.js";
|
|
2
2
|
/**
|
|
3
|
-
* The FIELD ROW's host around the shared `
|
|
3
|
+
* The FIELD ROW's host around the shared `NumberEditorHost` — in place, on every
|
|
4
4
|
* width: the core replaces the row's value rather than opening a panel over it.
|
|
5
5
|
* Its close reasons are the keyboard's and the blur's, which the core names
|
|
6
6
|
* itself, and the row's session takes only the first.
|
|
@@ -4,26 +4,26 @@ import { useRef } from "react";
|
|
|
4
4
|
import { acceptFieldCommit } from "viewkitjs/fields";
|
|
5
5
|
import { ConversionLine } from "../../display/converted.js";
|
|
6
6
|
import { EditorPanel } from "../../editors/EditorPanel.js";
|
|
7
|
-
import {
|
|
7
|
+
import { NumberEditorHost } from "../../editors/NumberEditor.js";
|
|
8
8
|
import { numberBounds } from "../../editors/number-body.js";
|
|
9
9
|
import { durationUnitOf, numberEditCode, numberEditDecimals, numberEditInitial } from "../../fields/number-edit.js";
|
|
10
10
|
import { useViews } from "../../provider/context.js";
|
|
11
11
|
import { ROW_BOX_FRAME } from "./row-frame.js";
|
|
12
12
|
import { RowRefusal, useRowEditSession } from "./row-session.js";
|
|
13
13
|
export function RowNumberEditor({ binding, row, field, initial, conversion, onAttempt, onClose, }) {
|
|
14
|
-
const { conventions
|
|
14
|
+
const { conventions } = useViews();
|
|
15
15
|
const editorRef = useRef(null);
|
|
16
16
|
const anchorRef = useRef(null);
|
|
17
17
|
const { session, close } = useRowEditSession({ editorRef, inPlace: true, onAttempt, onClose });
|
|
18
18
|
const decimals = numberEditDecimals(field);
|
|
19
19
|
const durationUnit = durationUnitOf(field);
|
|
20
|
-
const body =
|
|
20
|
+
const body = !durationUnit;
|
|
21
21
|
const unitOptions = binding.unit ? [...binding.unit.options] : undefined;
|
|
22
22
|
const check = (value, unit) => {
|
|
23
23
|
const read = acceptFieldCommit(field, { value, ...(unit === undefined ? {} : { unit }) }, { conventions, unitOptions });
|
|
24
24
|
return read.ok ? null : read.reason;
|
|
25
25
|
};
|
|
26
|
-
return (_jsxs(EditorPanel, { session: session, title: field.label, anchor: anchorRef, inPlace: true, children: [_jsx(
|
|
26
|
+
return (_jsxs(EditorPanel, { session: session, title: field.label, anchor: anchorRef, inPlace: true, children: [_jsx(NumberEditorHost, { ref: editorRef, boxClassName: ROW_BOX_FRAME, initial: numberEditInitial(initial), unit: binding.unit?.read(row), unitOptions: unitOptions, code: binding.unit ? undefined : numberEditCode(field), decimals: decimals, durationUnit: durationUnit, allowEmpty: !!field.nullable, align: "start", conventions: conventions, ...numberBounds(field), ...(body
|
|
27
27
|
? {
|
|
28
28
|
type: field.type,
|
|
29
29
|
label: field.label,
|
|
@@ -5,16 +5,16 @@ import { EditorPanel } from "../../editors/EditorPanel.js";
|
|
|
5
5
|
import { LocationEditor } from "../../editors/LocationEditor.js";
|
|
6
6
|
import { useViews } from "../../provider/context.js";
|
|
7
7
|
import { useRowEditSession } from "./row-session.js";
|
|
8
|
-
import {
|
|
8
|
+
import { bodyPanel } from "../../editors/body-panel.js";
|
|
9
9
|
export function RowPlaceEditor({ field, initial, anchor, onAttempt, onClose, }) {
|
|
10
|
-
const panel =
|
|
10
|
+
const panel = bodyPanel("parts", "z-90 max-w-[calc(100vw-2rem)]");
|
|
11
11
|
const { conventions } = useViews();
|
|
12
12
|
const editorRef = useRef(null);
|
|
13
13
|
const anchorRef = useRef(null);
|
|
14
14
|
const { session, close } = useRowEditSession({ editorRef, onAttempt, onClose });
|
|
15
15
|
const place = initial && typeof initial === "object" && !Array.isArray(initial) ? initial : null;
|
|
16
16
|
return (_jsxs(_Fragment, { children: [_jsx("span", { ref: anchorRef, className: "block min-w-0", children: anchor }), _jsx(EditorPanel, { panelData: panel.data, session: session, title: field.label, anchor: anchorRef, align: "start", sideOffset: 4, initialFocus: false, chrome: "menu", className: panel.className, children: (surface) => {
|
|
17
|
-
const editor = (_jsx(LocationEditor, { ref: editorRef, field: field, initial: place, allowEmpty: true,
|
|
17
|
+
const editor = (_jsx(LocationEditor, { ref: editorRef, field: field, initial: place, allowEmpty: true, conventions: conventions, label: field.label, onRequestClose: close }));
|
|
18
18
|
return surface === "sheet" ? _jsx("div", { className: "px-4 pb-4", children: editor }) : editor;
|
|
19
19
|
} })] }));
|
|
20
20
|
}
|
|
@@ -1,7 +1,4 @@
|
|
|
1
1
|
import type { RowHostProps } from "./host.js";
|
|
2
|
-
/** The FIELD ROW's host around the shared `RangeEditor
|
|
3
|
-
*
|
|
4
|
-
* With an app's parts body it opens anchored instead, as the place host does:
|
|
5
|
-
* a popover under the value on a desktop, the sheet on a phone, the value on
|
|
6
|
-
* screen, the refusal drawn by the panel. */
|
|
2
|
+
/** The FIELD ROW's host around the shared `RangeEditor`: the app's parts body opens anchored, as the place host does:
|
|
3
|
+
* a popover under the value on a desktop, the sheet on a phone, the value on screen, the refusal drawn by the panel. */
|
|
7
4
|
export declare function RowRangeEditor<Row>({ field, initial, anchor, onAttempt, onClose, }: RowHostProps<Row, "range">): import("react/jsx-runtime").JSX.Element;
|
|
@@ -5,21 +5,14 @@ import { isRangeValue, rangeDecimals } from "viewkitjs/fields";
|
|
|
5
5
|
import { EditorPanel } from "../../editors/EditorPanel.js";
|
|
6
6
|
import { RangeEditor } from "../../editors/RangeEditor.js";
|
|
7
7
|
import { useViews } from "../../provider/context.js";
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import { useBodyPanel } from "../../editors/body-panel.js";
|
|
11
|
-
import { numberBounds } from "../../editors/number-body.js";
|
|
8
|
+
import { useRowEditSession } from "./row-session.js";
|
|
9
|
+
import { bodyPanel } from "../../editors/body-panel.js";
|
|
12
10
|
export function RowRangeEditor({ field, initial, anchor, onAttempt, onClose, }) {
|
|
13
|
-
const panel =
|
|
14
|
-
const { conventions
|
|
15
|
-
const inPlace = !components.PartsBody;
|
|
11
|
+
const panel = bodyPanel("parts", "z-90 max-w-[calc(100vw-2rem)]");
|
|
12
|
+
const { conventions } = useViews();
|
|
16
13
|
const editorRef = useRef(null);
|
|
17
14
|
const anchorRef = useRef(null);
|
|
18
|
-
const { session, close } = useRowEditSession({ editorRef,
|
|
19
|
-
const
|
|
20
|
-
|
|
21
|
-
if (!inPlace) {
|
|
22
|
-
return (_jsxs(_Fragment, { children: [_jsx("span", { ref: anchorRef, className: "block min-w-0", children: anchor }), _jsx(EditorPanel, { panelData: panel.data, session: session, title: field.label, anchor: anchorRef, align: "start", sideOffset: 4, initialFocus: false, chrome: "menu", className: panel.className, children: (surface) => (surface === "sheet" ? _jsx("div", { className: "px-4 pb-4", children: editor }) : editor) })] }));
|
|
23
|
-
}
|
|
24
|
-
return (_jsxs(EditorPanel, { session: session, title: field.label, anchor: anchorRef, inPlace: true, children: [editor, !banded && _jsx(RowRefusal, { text: session.refusal })] }));
|
|
15
|
+
const { session, close } = useRowEditSession({ editorRef, onAttempt, onClose });
|
|
16
|
+
const editor = (_jsx(RangeEditor, { ref: editorRef, initial: isRangeValue(initial) ? initial : null, decimals: rangeDecimals(field), allowEmpty: !!field.nullable, suffix: field.of === "percent" ? "%" : field.of === "currency" ? field.code?.fixed : undefined, bands: field.presets, conventions: conventions, label: field.label, onRequestClose: close }));
|
|
17
|
+
return (_jsxs(_Fragment, { children: [_jsx("span", { ref: anchorRef, className: "block min-w-0", children: anchor }), _jsx(EditorPanel, { panelData: panel.data, session: session, title: field.label, anchor: anchorRef, align: "start", sideOffset: 4, initialFocus: false, chrome: "menu", className: panel.className, children: (surface) => (surface === "sheet" ? _jsx("div", { className: "px-4 pb-4", children: editor }) : editor) })] }));
|
|
25
18
|
}
|
|
@@ -8,7 +8,7 @@ import { useKnownKinds } from "../../editors/relation-kinds.js";
|
|
|
8
8
|
import { useViews } from "../../provider/context.js";
|
|
9
9
|
import { OPTION_ROW_INSET } from "./host.js";
|
|
10
10
|
import { useRowEditSession } from "./row-session.js";
|
|
11
|
-
import {
|
|
11
|
+
import { bodyPanel, useSetBody } from "../../editors/body-panel.js";
|
|
12
12
|
export function RowRelationEditor(props) {
|
|
13
13
|
const { field } = props;
|
|
14
14
|
if (field.type === "relation" && field.cardinality === "many")
|
|
@@ -22,7 +22,7 @@ function useKindGlyph(field, kindIcon) {
|
|
|
22
22
|
return named ? (_jsx(components.AppIcon, { name: named, className: "h-3.5 w-3.5" })) : (_jsx(TypeGlyph, { className: "h-3.5 w-3.5" }));
|
|
23
23
|
}
|
|
24
24
|
function RowRelationOneEditor({ binding, field, initial, anchor, onAttempt, onClose, message, kindIcon, }) {
|
|
25
|
-
const panel =
|
|
25
|
+
const panel = bodyPanel("picker", "z-90");
|
|
26
26
|
const editorRef = useRef(null);
|
|
27
27
|
const anchorRef = useRef(null);
|
|
28
28
|
const kindGlyph = useKindGlyph(field, kindIcon);
|
|
@@ -43,7 +43,7 @@ function RowRelationOneEditor({ binding, field, initial, anchor, onAttempt, onCl
|
|
|
43
43
|
return (_jsxs(_Fragment, { children: [_jsx("span", { ref: anchorRef, className: "block min-w-0", children: anchor }), _jsx(EditorPanel, { panelData: panel.data, session: session, title: field.label, anchor: anchorRef, align: "start", alignOffset: -OPTION_ROW_INSET, sideOffset: 4, initialFocus: false, chrome: "menu", className: panel.className, savesOnPick: true, children: _jsx(RelationEditor, { ref: editorRef, candidates: candidates, initial: relationIdOf(initial), clearable: !!field.nullable, kindGlyph: kindGlyph, focusSearch: !sheet, onRequestClose: close, message: message, label: field.label }) })] }));
|
|
44
44
|
}
|
|
45
45
|
function RowRelationSetEditor({ binding, field, initial, shown, anchor, onAttempt, onClose, message, kindIcon, }) {
|
|
46
|
-
const panel =
|
|
46
|
+
const panel = bodyPanel(useSetBody(field.links), "z-90");
|
|
47
47
|
const editorRef = useRef(null);
|
|
48
48
|
const anchorRef = useRef(null);
|
|
49
49
|
const kindGlyph = useKindGlyph(field, kindIcon);
|
|
@@ -8,9 +8,9 @@ import { useOpenValues } from "../../editors/open-values.js";
|
|
|
8
8
|
import { SelectEditor, pickerOptionsFromField, } from "../../editors/SelectEditor.js";
|
|
9
9
|
import { OPTION_ROW_INSET } from "./host.js";
|
|
10
10
|
import { useRowEditSession } from "./row-session.js";
|
|
11
|
-
import {
|
|
11
|
+
import { bodyPanel } from "../../editors/body-panel.js";
|
|
12
12
|
export function RowSelectEditor({ binding, field, initial, anchor, onAttempt, onClose, message, openedByKey = false, }) {
|
|
13
|
-
const panel =
|
|
13
|
+
const panel = bodyPanel("picker", "z-90");
|
|
14
14
|
const editorRef = useRef(null);
|
|
15
15
|
const anchorRef = useRef(null);
|
|
16
16
|
const known = useOpenValues(field);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { RowHostProps } from "./host.js";
|
|
2
2
|
/**
|
|
3
|
-
* The FIELD ROW's host around the `
|
|
3
|
+
* The FIELD ROW's host around the `TextEditorHost`, the one editor for a
|
|
4
4
|
* `text`, a `url`, a `domain`, an `email`, a `phone` and a `rich_text` (typed as
|
|
5
5
|
* its markdown). In place: the box replaces the value where it sits, on
|
|
6
6
|
* every width; a record's row never opens a sheet for typing.
|
|
@@ -3,8 +3,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
3
3
|
import { useRef } from "react";
|
|
4
4
|
import { acceptFieldCommit, phoneText } from "viewkitjs/fields";
|
|
5
5
|
import { EditorPanel } from "../../editors/EditorPanel.js";
|
|
6
|
-
import {
|
|
7
|
-
import { cx } from "../../internal/cx.js";
|
|
6
|
+
import { TextEditorHost } from "../../editors/TextEditor.js";
|
|
8
7
|
import { useViews } from "../../provider/context.js";
|
|
9
8
|
import { RowRefusal, useRowEditSession } from "./row-session.js";
|
|
10
9
|
export function RowTextEditor({ field, binding, row, initial, onAttempt, onClose, }) {
|
|
@@ -13,7 +12,7 @@ export function RowTextEditor({ field, binding, row, initial, onAttempt, onClose
|
|
|
13
12
|
const baseline = field.type === "phone" ? phoneText(initial, null) : typeof initial === "string" ? initial : "";
|
|
14
13
|
const long = (field.type === "text" && !!field.format?.long) || field.type === "rich_text";
|
|
15
14
|
const { session, close } = useRowEditSession({ editorRef, inPlace: true, onAttempt, onClose });
|
|
16
|
-
const {
|
|
15
|
+
const { conventions } = useViews();
|
|
17
16
|
const region = binding.region?.(row) ?? undefined;
|
|
18
17
|
const check = (text) => {
|
|
19
18
|
if (text.trim() === "" || text === baseline)
|
|
@@ -21,5 +20,5 @@ export function RowTextEditor({ field, binding, row, initial, onAttempt, onClose
|
|
|
21
20
|
const read = acceptFieldCommit(field, text, { conventions, region, stored: initial });
|
|
22
21
|
return read.ok ? null : read.reason;
|
|
23
22
|
};
|
|
24
|
-
return (_jsxs(EditorPanel, { session: session, title: field.label, anchor: anchorRef, inPlace: true, children: [_jsx(
|
|
23
|
+
return (_jsxs(EditorPanel, { session: session, title: field.label, anchor: anchorRef, inPlace: true, children: [_jsx(TextEditorHost, { ref: editorRef, type: field.type, multiline: long, initial: baseline, label: field.label, onRequestClose: close, check: check, region: region, escapeKeeps: session.keeps ?? false, place: "row" }), _jsx(RowRefusal, { text: session.refusal })] }));
|
|
25
24
|
}
|
|
@@ -9,9 +9,9 @@ import { listOfOne, oneOfList } from "../../editors/values-body.js";
|
|
|
9
9
|
import { useViews } from "../../provider/context.js";
|
|
10
10
|
import { RowTextEditor } from "./RowTextEditor.js";
|
|
11
11
|
import { useRowEditSession } from "./row-session.js";
|
|
12
|
-
import {
|
|
12
|
+
import { bodyPanel } from "../../editors/body-panel.js";
|
|
13
13
|
function RowValueListEditor({ field, binding, row, initial, anchor, onAttempt, onClose, holds = "several", }) {
|
|
14
|
-
const panel =
|
|
14
|
+
const panel = bodyPanel("values", "z-90 max-w-[calc(100vw-2rem)]");
|
|
15
15
|
const listRef = useRef(null);
|
|
16
16
|
const one = holds === "one";
|
|
17
17
|
const oneRef = useRef({ resolveClose: (reason) => oneOfList(listRef.current.resolveClose(reason)) });
|
|
@@ -19,10 +19,10 @@ function RowValueListEditor({ field, binding, row, initial, anchor, onAttempt, o
|
|
|
19
19
|
const anchorRef = useRef(null);
|
|
20
20
|
const { session, close } = useRowEditSession({ editorRef, onAttempt, onClose });
|
|
21
21
|
return (_jsxs(_Fragment, { children: [_jsx("span", { ref: anchorRef, className: "block min-w-0", children: anchor }), _jsx(EditorPanel, { panelData: panel.data, session: session, title: field.label, anchor: anchorRef, align: "start", sideOffset: 4, initialFocus: false, chrome: "menu", className: panel.className, children: (surface) => {
|
|
22
|
-
const editor = (_jsx(ValueListEditor, { ref: listRef, field: field, label: field.label, initial: one ? listOfOne(initial) : initial, labels: binding.labels !== false && !one, holds: holds, allowEmpty: true, region: binding.region?.(row),
|
|
23
|
-
if (surface !== "sheet"
|
|
22
|
+
const editor = (_jsx(ValueListEditor, { ref: listRef, field: field, label: field.label, initial: one ? listOfOne(initial) : initial, labels: binding.labels !== false && !one, holds: holds, allowEmpty: true, region: binding.region?.(row), escapeKeeps: session.keeps ?? false, onRequestClose: close }));
|
|
23
|
+
if (surface !== "sheet")
|
|
24
24
|
return editor;
|
|
25
|
-
return _jsx("div", { className:
|
|
25
|
+
return _jsx("div", { className: "px-4 pb-4", children: editor });
|
|
26
26
|
} })] }));
|
|
27
27
|
}
|
|
28
28
|
export function RowListOrText(props) {
|
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
import type { MouseEvent as ReactMouseEvent, ReactElement, ReactNode, Ref } from "react";
|
|
2
2
|
import type { ViewsContextValue } from "../provider/context.js";
|
|
3
|
-
/** What a field row's button reads from the provider: the app's `Button
|
|
4
|
-
export type FieldRowButtonViews = Pick<ViewsContextValue, "components"
|
|
3
|
+
/** What a field row's button reads from the provider: the app's `Button`. */
|
|
4
|
+
export type FieldRowButtonViews = Pick<ViewsContextValue, "components">;
|
|
5
5
|
/** One button a field row draws itself, as each of its places describes it. */
|
|
6
6
|
export type FieldRowButtonDraw = {
|
|
7
|
-
/** Today's classes, without `ELEMENT_RESET`: drawn on ViewKit's own `<button>`. */
|
|
8
|
-
own: string;
|
|
9
7
|
/** The box ViewKit keeps on the app's `Button`: its size and its place. The look is the app's. */
|
|
10
8
|
frame: string;
|
|
11
9
|
variant: "ghost";
|
|
@@ -15,8 +13,7 @@ export type FieldRowButtonDraw = {
|
|
|
15
13
|
"aria-disabled"?: boolean;
|
|
16
14
|
"aria-label"?: string;
|
|
17
15
|
"data-slot"?: string;
|
|
18
|
-
/** Marks the press as the host's own: `data-no-nav` on
|
|
19
|
-
* app's. */
|
|
16
|
+
/** Marks the press as the host's own: `data-no-nav` on a `display: contents` span around the app's button. */
|
|
20
17
|
noNav?: boolean;
|
|
21
18
|
onClick?: (event: ReactMouseEvent<HTMLButtonElement>) => void;
|
|
22
19
|
children?: ReactNode;
|
|
@@ -34,7 +31,7 @@ export declare function FieldRowButton({ views, ...draw }: FieldRowButtonDraw &
|
|
|
34
31
|
views: FieldRowButtonViews;
|
|
35
32
|
}): ReactElement;
|
|
36
33
|
/**
|
|
37
|
-
* Draws a button a field row draws itself:
|
|
38
|
-
*
|
|
34
|
+
* Draws a button a field row draws itself: the app's `Button`, handed the row's box in its class. A plain function,
|
|
35
|
+
* never a hook.
|
|
39
36
|
*/
|
|
40
|
-
export declare function drawFieldRowButton(views: FieldRowButtonViews, {
|
|
37
|
+
export declare function drawFieldRowButton(views: FieldRowButtonViews, { frame, variant, size, noNav, children, ...props }: FieldRowButtonDraw): ReactElement;
|
|
@@ -1,17 +1,12 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
-
import { cx } from "../internal/cx.js";
|
|
4
|
-
import { ELEMENT_RESET } from "../internal/reset.js";
|
|
5
3
|
export const FIELD_ROW_FRAME = "-mx-2 -my-1 flex h-auto min-h-7 w-[calc(100%+1rem)] min-w-0 items-center justify-start whitespace-normal px-2 py-1 text-left [font:inherit]";
|
|
6
4
|
export const FIELD_ROW_FRAME_BESIDE = "-ml-2 -my-1 flex h-auto min-h-7 min-w-0 flex-1 items-center justify-start whitespace-normal px-2 py-1 text-left [font:inherit]";
|
|
7
5
|
export const FIELD_ROW_FRAME_UNDER = "absolute -inset-x-2 -inset-y-1 h-auto w-auto p-0";
|
|
8
6
|
export function FieldRowButton({ views, ...draw }) {
|
|
9
7
|
return drawFieldRowButton(views, draw);
|
|
10
8
|
}
|
|
11
|
-
export function drawFieldRowButton(views, {
|
|
12
|
-
if (views.fieldRowButtons !== "button") {
|
|
13
|
-
return (_jsx("button", { type: "button", ...props, "data-no-nav": noNav || undefined, className: cx(ELEMENT_RESET, own), children: children }));
|
|
14
|
-
}
|
|
9
|
+
export function drawFieldRowButton(views, { frame, variant, size, noNav, children, ...props }) {
|
|
15
10
|
const { Button } = views.components;
|
|
16
11
|
const button = (_jsx(Button, { type: "button", variant: variant, size: size, className: frame, ...props, children: children }));
|
|
17
12
|
return noNav ? (_jsx("span", { className: "contents", "data-no-nav": true, children: button })) : (button);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { ReactElement } from "react";
|
|
2
2
|
import type { ViewsCheckboxProps } from "../provider/components.js";
|
|
3
3
|
/**
|
|
4
|
-
* A field row's yes/no as the app's `Checkbox
|
|
4
|
+
* A field row's yes/no as the app's `Checkbox`. The display core
|
|
5
5
|
* hands its box `tabIndex` -1, right in a grid cell, whose own key flips it; a field row has no such key, so its box
|
|
6
6
|
* stays a Tab stop, as the row's own switch is. One component at module level, so a redrawn row keeps the same
|
|
7
7
|
* element type and the box stays mounted.
|
|
@@ -11,10 +11,3 @@
|
|
|
11
11
|
* row's hover came up visibly short of its neighbours'.
|
|
12
12
|
*/
|
|
13
13
|
export declare const FIELD_ROW_TARGET = "-mx-2 -my-1 flex min-h-7 w-[calc(100%+1rem)] min-w-0 items-center rounded-md px-2 py-1 text-left transition-colors hover:bg-(color:--vk-hovered)";
|
|
14
|
-
/** The same target sharing its line with a control beside it (a link's open action): it pulls back on its left
|
|
15
|
-
* only and takes the room the control leaves. */
|
|
16
|
-
export declare const FIELD_ROW_TARGET_BESIDE = "-ml-2 -my-1 flex min-h-7 min-w-0 flex-1 items-center rounded-md px-2 py-1 text-left transition-colors hover:bg-(color:--vk-hovered)";
|
|
17
|
-
/** The target laid UNDER a value whose own links and buttons must stay outside it (a rich text): an empty button
|
|
18
|
-
* filling the value's footprint, padded out by the same amount as the target. The value's layer above it lets a
|
|
19
|
-
* press on its text through, and its own links and buttons take theirs. */
|
|
20
|
-
export declare const FIELD_ROW_TARGET_UNDER = "absolute -inset-x-2 -inset-y-1 rounded-md transition-colors hover:bg-(color:--vk-hovered)";
|
|
@@ -1,3 +1 @@
|
|
|
1
1
|
export const FIELD_ROW_TARGET = "-mx-2 -my-1 flex min-h-7 w-[calc(100%+1rem)] min-w-0 items-center rounded-md px-2 py-1 text-left transition-colors hover:bg-(color:--vk-hovered)";
|
|
2
|
-
export const FIELD_ROW_TARGET_BESIDE = "-ml-2 -my-1 flex min-h-7 min-w-0 flex-1 items-center rounded-md px-2 py-1 text-left transition-colors hover:bg-(color:--vk-hovered)";
|
|
3
|
-
export const FIELD_ROW_TARGET_UNDER = "absolute -inset-x-2 -inset-y-1 rounded-md transition-colors hover:bg-(color:--vk-hovered)";
|
|
@@ -10,7 +10,8 @@ export declare function gridAddColumnNode(render: RenderAddColumn, columns: List
|
|
|
10
10
|
/**
|
|
11
11
|
* "+ ADD COLUMN" ON EVERY GRID: the header row's last cell, for anyone who reads the list. It lists the columns
|
|
12
12
|
* this view hides and can show, and shows the one picked: a choice about the reader's own view, never a change
|
|
13
|
-
* to a field, so it needs no admin and no server.
|
|
13
|
+
* to a field, so it needs no admin and no server. It opens the app's `Menu`, on a desktop and a phone alike, handed
|
|
14
|
+
* the hidden columns as data (`gridAddColumnItems`). Where a host mounts its own field editor, the header draws
|
|
14
15
|
* the host's instead (a relation's ›, Create new field), in the same look. Hiding is a column's own menu, the
|
|
15
16
|
* order is dragging the header, and the whole list is the host's column list.
|
|
16
17
|
*/
|