@viewkitjs/views 0.4.0 → 0.6.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 +768 -0
- package/README.md +5 -3
- package/dist/atoms/Avatar.d.ts +2 -0
- package/dist/atoms/Avatar.js +13 -0
- package/dist/atoms/CellMore.d.ts +2 -0
- package/dist/atoms/CellMore.js +4 -0
- package/dist/atoms/DisabledReason.d.ts +11 -0
- package/dist/atoms/DisabledReason.js +10 -0
- package/dist/atoms/DrillRows.d.ts +3 -0
- package/dist/atoms/DrillRows.js +27 -0
- package/dist/atoms/Loading.d.ts +6 -0
- package/dist/atoms/Loading.js +4 -1
- package/dist/atoms/PanelRows.d.ts +5 -0
- package/dist/atoms/PanelRows.js +38 -0
- package/dist/atoms/PanelSearch.d.ts +2 -0
- package/dist/atoms/PanelSearch.js +21 -0
- package/dist/atoms/Pill.d.ts +2 -0
- package/dist/atoms/Pill.js +25 -0
- package/dist/atoms/RangeCalendar.d.ts +8 -0
- package/dist/atoms/RangeCalendar.js +30 -0
- package/dist/atoms/RelationRoles.js +2 -2
- package/dist/atoms/SelectionSheet.d.ts +3 -0
- package/dist/atoms/SelectionSheet.js +31 -0
- package/dist/atoms/ToolbarButton.d.ts +2 -0
- package/dist/atoms/ToolbarButton.js +18 -0
- package/dist/atoms/defaults.js +22 -0
- package/dist/atoms/types.d.ts +257 -1
- package/dist/cells/cell-format.d.ts +10 -1
- package/dist/cells/cell-title.d.ts +5 -1
- package/dist/cells/cell-title.js +2 -2
- package/dist/cells/cell-values.js +22 -7
- package/dist/cells/relation-wrap.js +1 -1
- package/dist/contract.d.ts +515 -18
- package/dist/contract.js +660 -5
- package/dist/display/actor.js +1 -1
- package/dist/display/boolean.js +5 -0
- package/dist/display/entity-chip.d.ts +12 -9
- package/dist/display/entity-chip.js +4 -5
- package/dist/display/fit-values.d.ts +34 -0
- package/dist/display/fit-values.js +45 -0
- package/dist/display/location.js +1 -1
- package/dist/display/multi-value.js +72 -8
- package/dist/display/options.d.ts +9 -1
- package/dist/display/relation.js +1 -1
- package/dist/display/rich-text.js +17 -6
- package/dist/display/select.js +6 -4
- package/dist/display/status-steps.d.ts +8 -0
- package/dist/display/status-steps.js +18 -0
- package/dist/display/viewer.js +1 -0
- package/dist/editors/BodyFrame.d.ts +29 -0
- package/dist/editors/BodyFrame.js +80 -0
- package/dist/editors/DateEditor.js +13 -17
- package/dist/editors/LocationEditor.d.ts +2 -0
- package/dist/editors/LocationEditor.js +29 -5
- package/dist/editors/NameEditor.d.ts +2 -0
- package/dist/editors/NameEditor.js +27 -7
- package/dist/editors/NumberEditor.d.ts +18 -0
- package/dist/editors/NumberEditor.js +29 -2
- package/dist/editors/RangeEditor.d.ts +2 -0
- package/dist/editors/RangeEditor.js +29 -4
- package/dist/editors/SelectEditor.d.ts +5 -0
- package/dist/editors/SelectEditor.js +3 -2
- package/dist/editors/TextEditor.d.ts +11 -1
- package/dist/editors/TextEditor.js +25 -8
- package/dist/editors/ValueListEditor.d.ts +7 -0
- package/dist/editors/ValueListEditor.js +60 -48
- package/dist/editors/body-panel.d.ts +7 -0
- package/dist/editors/body-panel.js +8 -0
- package/dist/editors/edit-session.d.ts +20 -3
- package/dist/editors/edit-session.js +43 -3
- package/dist/editors/leave-scope.d.ts +23 -0
- package/dist/editors/leave-scope.js +28 -0
- package/dist/editors/number-body.d.ts +29 -0
- package/dist/editors/number-body.js +37 -0
- package/dist/editors/parts-body.d.ts +66 -0
- package/dist/editors/parts-body.js +114 -0
- package/dist/editors/tab-ends.d.ts +5 -0
- package/dist/editors/tab-ends.js +7 -0
- package/dist/editors/text-body.d.ts +16 -0
- package/dist/editors/text-body.js +30 -0
- package/dist/editors/values-body.d.ts +47 -0
- package/dist/editors/values-body.js +140 -0
- package/dist/field-row/FieldRow.d.ts +7 -0
- package/dist/field-row/FieldRow.js +44 -24
- package/dist/field-row/FieldRowLane.js +12 -4
- package/dist/field-row/editors/RowChipsEditor.js +3 -1
- package/dist/field-row/editors/RowEditor.js +2 -1
- package/dist/field-row/editors/RowNameEditor.d.ts +5 -2
- package/dist/field-row/editors/RowNameEditor.js +12 -5
- package/dist/field-row/editors/RowNumberEditor.js +18 -2
- package/dist/field-row/editors/RowPlaceEditor.js +4 -2
- package/dist/field-row/editors/RowRangeEditor.d.ts +5 -2
- package/dist/field-row/editors/RowRangeEditor.js +13 -6
- package/dist/field-row/editors/RowRelationEditor.js +5 -2
- package/dist/field-row/editors/RowSelectEditor.js +4 -1
- package/dist/field-row/editors/RowTextEditor.d.ts +1 -1
- package/dist/field-row/editors/RowTextEditor.js +12 -3
- package/dist/field-row/editors/RowValueListEditor.d.ts +2 -1
- package/dist/field-row/editors/RowValueListEditor.js +17 -4
- package/dist/field-row/editors/host.d.ts +3 -0
- package/dist/field-row/editors/row-session.d.ts +12 -1
- package/dist/field-row/editors/row-session.js +52 -2
- package/dist/field-row/field-row-button.d.ts +40 -0
- package/dist/field-row/field-row-button.js +18 -0
- package/dist/field-row/field-row-checkbox.d.ts +9 -0
- package/dist/field-row/field-row-checkbox.js +7 -0
- package/dist/figures.d.ts +5 -48
- package/dist/figures.js +1 -63
- package/dist/filters/filter-model.d.ts +2 -0
- package/dist/grid/chrome/GridAddColumn.js +17 -3
- package/dist/grid/chrome/GridAggregateMenu.d.ts +2 -0
- package/dist/grid/chrome/GridAggregateMenu.js +2 -0
- package/dist/grid/chrome/GridCellEditors.js +16 -6
- package/dist/grid/chrome/GridCellOutline.d.ts +7 -4
- package/dist/grid/chrome/GridCellOutline.js +4 -2
- package/dist/grid/chrome/GridChipsEditor.js +3 -1
- package/dist/grid/chrome/GridColumnMenu.d.ts +7 -4
- package/dist/grid/chrome/GridColumnMenu.js +5 -3
- package/dist/grid/chrome/GridColumnSortSection.d.ts +23 -3
- package/dist/grid/chrome/GridColumnSortSection.js +18 -1
- package/dist/grid/chrome/GridFooter.d.ts +4 -1
- package/dist/grid/chrome/GridFooter.js +6 -4
- package/dist/grid/chrome/GridGroupMenu.d.ts +7 -3
- package/dist/grid/chrome/GridGroupMenu.js +30 -8
- package/dist/grid/chrome/GridHeader.d.ts +5 -1
- package/dist/grid/chrome/GridHeader.js +9 -5
- package/dist/grid/chrome/GridLongTextEditor.js +15 -11
- package/dist/grid/chrome/GridNameEditor.js +4 -2
- package/dist/grid/chrome/GridNumberEditor.d.ts +8 -1
- package/dist/grid/chrome/GridNumberEditor.js +15 -3
- package/dist/grid/chrome/GridPager.d.ts +7 -0
- package/dist/grid/chrome/GridPager.js +34 -0
- package/dist/grid/chrome/GridPlaceEditor.js +4 -2
- package/dist/grid/chrome/GridRangeEditor.js +12 -4
- package/dist/grid/chrome/GridRelationEditor.js +5 -2
- package/dist/grid/chrome/GridRow.js +18 -6
- package/dist/grid/chrome/GridRowActions.d.ts +8 -3
- package/dist/grid/chrome/GridRowActions.js +16 -6
- package/dist/grid/chrome/GridRowCells.js +23 -7
- package/dist/grid/chrome/GridRowGlyph.d.ts +3 -1
- package/dist/grid/chrome/GridRowGlyph.js +7 -2
- package/dist/grid/chrome/GridSelectEditor.js +6 -3
- package/dist/grid/chrome/GridStructure.d.ts +6 -1
- package/dist/grid/chrome/GridStructure.js +32 -8
- package/dist/grid/chrome/GridTable.js +36 -24
- package/dist/grid/chrome/GridTableSurface.d.ts +5 -1
- package/dist/grid/chrome/GridTableSurface.js +5 -2
- package/dist/grid/chrome/GridTextEditor.d.ts +5 -1
- package/dist/grid/chrome/GridTextEditor.js +13 -3
- package/dist/grid/chrome/GridValueListEditor.d.ts +12 -4
- package/dist/grid/chrome/GridValueListEditor.js +11 -3
- package/dist/grid/chrome/StuckMarker.d.ts +3 -1
- package/dist/grid/chrome/StuckMarker.js +6 -2
- package/dist/grid/chrome/cells.d.ts +4 -2
- package/dist/grid/chrome/cells.js +2 -2
- package/dist/grid/chrome/grid-add-column-items.d.ts +1 -1
- package/dist/grid/chrome/grid-add-column-items.js +8 -1
- package/dist/grid/chrome/grid-button.d.ts +32 -0
- package/dist/grid/chrome/grid-button.js +12 -0
- package/dist/grid/chrome/grid-cell-classes.d.ts +38 -0
- package/dist/grid/chrome/grid-cell-classes.js +30 -0
- package/dist/grid/chrome/grid-column-menu-items.d.ts +3 -0
- package/dist/grid/chrome/grid-column-menu-items.js +32 -3
- package/dist/grid/chrome/grid-columns-template.d.ts +27 -0
- package/dist/grid/chrome/grid-columns-template.js +13 -0
- package/dist/grid/chrome/grid-edit-session.d.ts +4 -1
- package/dist/grid/chrome/grid-edit-session.js +11 -1
- package/dist/grid/chrome/grid-group-menu-items.d.ts +8 -1
- package/dist/grid/chrome/grid-group-menu-items.js +17 -0
- package/dist/grid/chrome/grid-group-menu-parts.d.ts +10 -6
- package/dist/grid/chrome/grid-group-menu-parts.js +4 -2
- package/dist/grid/chrome/grid-hover.d.ts +4 -1
- package/dist/grid/chrome/grid-hover.js +16 -6
- package/dist/grid/chrome/grid-pages.d.ts +15 -0
- package/dist/grid/chrome/grid-pages.js +9 -0
- package/dist/grid/chrome/grid-row-menu-items.js +18 -10
- package/dist/grid/chrome/grid-row-props.d.ts +6 -2
- package/dist/grid/chrome/grid-row-window.d.ts +7 -0
- package/dist/grid/chrome/grid-row-window.js +35 -1
- package/dist/grid/chrome/grid-table-props.d.ts +38 -4
- package/dist/grid/chrome/useGridColumnLayout.d.ts +3 -1
- package/dist/grid/chrome/useGridColumnLayout.js +29 -9
- package/dist/grid/chrome/useGridPartColumns.js +1 -1
- package/dist/grid/chrome/useGridScrollArea.js +2 -0
- package/dist/grid/chrome/useGridTableInteractionModel.d.ts +1 -0
- package/dist/grid/chrome/useGridTableInteractionModel.js +5 -3
- package/dist/grid/chrome/useGridTableSelection.d.ts +3 -1
- package/dist/grid/chrome/useGridTableSelection.js +2 -2
- package/dist/grid/chrome/useHeaderDragReorder.js +2 -0
- package/dist/grid/core/editing-controller.d.ts +36 -11
- package/dist/grid/core/editing-controller.js +92 -25
- package/dist/grid/core/grid-aria.d.ts +4 -0
- package/dist/grid/core/grid-aria.js +6 -4
- package/dist/grid/core/grid-focus.d.ts +6 -0
- package/dist/grid/core/grid-focus.js +28 -5
- package/dist/grid/core/useGridEditing.d.ts +11 -2
- package/dist/grid/core/useGridEditing.js +9 -5
- package/dist/grid/core/write-states.d.ts +20 -0
- package/dist/grid/core/write-states.js +21 -0
- package/dist/grid/grid-format-props.d.ts +26 -0
- package/dist/grid/grid-format-props.js +65 -0
- package/dist/grid/index.d.ts +3 -1
- package/dist/grid/index.js +1 -0
- package/dist/grid/useGridTablePrefs.d.ts +20 -21
- package/dist/grid/useGridTablePrefs.js +6 -58
- package/dist/grid/useGridTableSettings.d.ts +60 -0
- package/dist/grid/useGridTableSettings.js +61 -0
- package/dist/grouping/sort-groups.d.ts +6 -7
- package/dist/internal/count.d.ts +3 -0
- package/dist/internal/count.js +3 -0
- package/dist/model/aggregates.d.ts +3 -3
- package/dist/model/aggregates.js +17 -71
- package/dist/model/body-frame.d.ts +16 -0
- package/dist/model/body-frame.js +5 -0
- package/dist/model/column-capabilities.d.ts +4 -1
- package/dist/model/column-capabilities.js +4 -1
- package/dist/model/column-filters.d.ts +7 -4
- package/dist/model/column-filters.js +26 -18
- package/dist/model/column-inspect.d.ts +3 -2
- package/dist/model/column-inspect.js +3 -1
- package/dist/model/column-order.d.ts +2 -2
- package/dist/model/column-schema.d.ts +6 -7
- package/dist/model/column-sort.d.ts +11 -0
- package/dist/model/column-sort.js +14 -0
- package/dist/model/column-state.d.ts +3 -20
- package/dist/model/column-state.js +1 -4
- package/dist/model/column-types.d.ts +1 -15
- package/dist/model/column-types.js +1 -1
- package/dist/model/one-value.d.ts +6 -0
- package/dist/model/one-value.js +5 -0
- package/dist/model/part-columns.d.ts +1 -6
- package/dist/model/part-columns.js +1 -1
- package/dist/model/part-rows.d.ts +2 -9
- package/dist/model/part-rows.js +1 -10
- package/dist/model/part-write.js +1 -1
- package/dist/model/place-parts.d.ts +6 -0
- package/dist/model/place-parts.js +14 -0
- package/dist/model/preferences.d.ts +3 -23
- package/dist/model/preferences.js +1 -17
- package/dist/model/prefs-buckets.d.ts +0 -27
- package/dist/model/prefs-buckets.js +1 -1
- package/dist/model/relation-filters.d.ts +13 -3
- package/dist/model/relation-filters.js +9 -4
- package/dist/model/row-icon.d.ts +17 -11
- package/dist/model/settings-columns.d.ts +34 -0
- package/dist/model/settings-columns.js +146 -0
- package/dist/model/settings-look.d.ts +17 -0
- package/dist/model/settings-look.js +23 -0
- package/dist/model/view-rules.d.ts +32 -6
- package/dist/model/view-rules.js +99 -23
- package/dist/panels/availability.d.ts +26 -0
- package/dist/panels/availability.js +28 -0
- package/dist/panels/filter/DateFilterBody.d.ts +42 -0
- package/dist/panels/filter/DateFilterBody.js +64 -0
- package/dist/panels/filter/DateFilterCalendar.d.ts +19 -0
- package/dist/panels/filter/DateFilterCalendar.js +37 -0
- package/dist/panels/filter/DateFilterInput.d.ts +16 -0
- package/dist/panels/filter/DateFilterInput.js +37 -0
- package/dist/panels/filter/FilterIcon.d.ts +7 -0
- package/dist/panels/filter/FilterIcon.js +15 -0
- package/dist/panels/filter/MenuSelect.d.ts +12 -0
- package/dist/panels/filter/MenuSelect.js +34 -0
- package/dist/panels/filter/NumberFilterBody.d.ts +21 -0
- package/dist/panels/filter/NumberFilterBody.js +76 -0
- package/dist/panels/filter/RangeFilterBody.d.ts +19 -0
- package/dist/panels/filter/RangeFilterBody.js +71 -0
- package/dist/panels/filter/RelationFilterBody.d.ts +17 -0
- package/dist/panels/filter/RelationFilterBody.js +20 -0
- package/dist/panels/filter/TextFilterBody.d.ts +31 -0
- package/dist/panels/filter/TextFilterBody.js +44 -0
- package/dist/panels/filter/TimeScopeDetail.d.ts +6 -0
- package/dist/panels/filter/TimeScopeDetail.js +47 -0
- package/dist/panels/filter/details.d.ts +17 -0
- package/dist/panels/filter/details.js +73 -0
- package/dist/panels/filter/filter-list.d.ts +23 -0
- package/dist/panels/filter/filter-list.js +38 -0
- package/dist/panels/group-sort.d.ts +24 -0
- package/dist/panels/group-sort.js +58 -0
- package/dist/panels/index.d.ts +24 -0
- package/dist/panels/index.js +17 -0
- package/dist/panels/labels.d.ts +37 -0
- package/dist/panels/labels.js +166 -0
- package/dist/panels/model.d.ts +343 -0
- package/dist/panels/model.js +77 -0
- package/dist/panels/react/GroupBucketsList.d.ts +16 -0
- package/dist/panels/react/GroupBucketsList.js +38 -0
- package/dist/panels/react/LayoutColumnsList.d.ts +24 -0
- package/dist/panels/react/LayoutColumnsList.js +71 -0
- package/dist/panels/react/PopoverColumnDetail.d.ts +11 -0
- package/dist/panels/react/PopoverColumnDetail.js +24 -0
- package/dist/panels/react/chrome.d.ts +17 -0
- package/dist/panels/react/chrome.js +8 -0
- package/dist/panels/react/column-refusals.d.ts +7 -0
- package/dist/panels/react/column-refusals.js +14 -0
- package/dist/panels/react/customize.d.ts +26 -0
- package/dist/panels/react/customize.js +98 -0
- package/dist/panels/react/drag.d.ts +2 -0
- package/dist/panels/react/drag.js +6 -0
- package/dist/panels/react/field-editor.d.ts +10 -0
- package/dist/panels/react/field-editor.js +1 -0
- package/dist/panels/react/filter-panel.d.ts +15 -0
- package/dist/panels/react/filter-panel.js +48 -0
- package/dist/panels/react/layout-detail.d.ts +4 -0
- package/dist/panels/react/layout-detail.js +21 -0
- package/dist/panels/react/order-details.d.ts +32 -0
- package/dist/panels/react/order-details.js +81 -0
- package/dist/panels/react/panel-header.d.ts +10 -0
- package/dist/panels/react/panel-header.js +12 -0
- package/dist/panels/react/panel-sheet.d.ts +19 -0
- package/dist/panels/react/panel-sheet.js +22 -0
- package/dist/panels/react/popover.d.ts +71 -0
- package/dist/panels/react/popover.js +47 -0
- package/dist/panels/react/root-list.d.ts +6 -0
- package/dist/panels/react/root-list.js +31 -0
- package/dist/panels/react/toolbar/ReadyToolbar.d.ts +42 -0
- package/dist/panels/react/toolbar/ReadyToolbar.js +92 -0
- package/dist/panels/react/toolbar/Toolbar.d.ts +16 -0
- package/dist/panels/react/toolbar/Toolbar.js +34 -0
- package/dist/panels/react/toolbar/ToolbarButton.d.ts +5 -0
- package/dist/panels/react/toolbar/ToolbarButton.js +9 -0
- package/dist/panels/react/toolbar/ToolbarFilter.d.ts +19 -0
- package/dist/panels/react/toolbar/ToolbarFilter.js +32 -0
- package/dist/panels/react/toolbar/ToolbarNew.d.ts +12 -0
- package/dist/panels/react/toolbar/ToolbarNew.js +21 -0
- package/dist/panels/react/toolbar/ToolbarOptions.d.ts +25 -0
- package/dist/panels/react/toolbar/ToolbarOptions.js +33 -0
- package/dist/panels/react/toolbar/ToolbarSearch.d.ts +9 -0
- package/dist/panels/react/toolbar/ToolbarSearch.js +41 -0
- package/dist/panels/react/toolbar/ToolbarSort.d.ts +12 -0
- package/dist/panels/react/toolbar/ToolbarSort.js +16 -0
- package/dist/panels/react/toolbar/ToolbarViews.d.ts +13 -0
- package/dist/panels/react/toolbar/ToolbarViews.js +24 -0
- package/dist/panels/react/toolbar/context.d.ts +29 -0
- package/dist/panels/react/toolbar/context.js +49 -0
- package/dist/panels/react/toolbar/panel-part.d.ts +37 -0
- package/dist/panels/react/toolbar/panel-part.js +37 -0
- package/dist/panels/react/toolbar/panel-state.d.ts +9 -0
- package/dist/panels/react/toolbar/panel-state.js +12 -0
- package/dist/panels/react/toolbar/use-box-narrow.d.ts +2 -0
- package/dist/panels/react/toolbar/use-box-narrow.js +18 -0
- package/dist/panels/react/toolbar/use-list-settings-state.d.ts +10 -0
- package/dist/panels/react/toolbar/use-list-settings-state.js +10 -0
- package/dist/panels/react/view-actions.d.ts +4 -0
- package/dist/panels/react/view-actions.js +37 -0
- package/dist/panels/react/view-footer.d.ts +16 -0
- package/dist/panels/react/view-footer.js +11 -0
- package/dist/panels/react/views-row/FoldingViewRow.d.ts +4 -0
- package/dist/panels/react/views-row/FoldingViewRow.js +105 -0
- package/dist/panels/react/views-row/HScrollRow.d.ts +7 -0
- package/dist/panels/react/views-row/HScrollRow.js +42 -0
- package/dist/panels/react/views-row/PillGroup.d.ts +30 -0
- package/dist/panels/react/views-row/PillGroup.js +86 -0
- package/dist/panels/react/views-row/ViewAxes.d.ts +6 -0
- package/dist/panels/react/views-row/ViewAxes.js +16 -0
- package/dist/panels/react/views-row/ViewCreatePill.d.ts +7 -0
- package/dist/panels/react/views-row/ViewCreatePill.js +11 -0
- package/dist/panels/react/views-row/ViewPicker.d.ts +5 -0
- package/dist/panels/react/views-row/ViewPicker.js +65 -0
- package/dist/panels/react/views-row/ViewPickerRow.d.ts +7 -0
- package/dist/panels/react/views-row/ViewPickerRow.js +18 -0
- package/dist/panels/react/views-row/ViewTabs.d.ts +31 -0
- package/dist/panels/react/views-row/ViewTabs.js +29 -0
- package/dist/panels/react/views-row/menu-classes.d.ts +6 -0
- package/dist/panels/react/views-row/menu-classes.js +3 -0
- package/dist/panels/react/views-row/use-anchored-toggle.d.ts +19 -0
- package/dist/panels/react/views-row/use-anchored-toggle.js +31 -0
- package/dist/panels/react.d.ts +51 -0
- package/dist/panels/react.js +43 -0
- package/dist/panels/settings/axes.d.ts +28 -0
- package/dist/panels/settings/axes.js +71 -0
- package/dist/panels/settings/filters.d.ts +5 -0
- package/dist/panels/settings/filters.js +62 -0
- package/dist/panels/settings/group-buckets.d.ts +23 -0
- package/dist/panels/settings/group-buckets.js +73 -0
- package/dist/panels/settings/input.d.ts +69 -0
- package/dist/panels/settings/input.js +1 -0
- package/dist/panels/settings/layout.d.ts +5 -0
- package/dist/panels/settings/layout.js +244 -0
- package/dist/panels/settings/order.d.ts +19 -0
- package/dist/panels/settings/order.js +271 -0
- package/dist/panels/settings/settings-panels.d.ts +17 -0
- package/dist/panels/settings/settings-panels.js +28 -0
- package/dist/panels/toolbar/clear.d.ts +9 -0
- package/dist/panels/toolbar/clear.js +26 -0
- package/dist/panels/toolbar/counts.d.ts +15 -0
- package/dist/panels/toolbar/counts.js +21 -0
- package/dist/panels/toolbar/edit-view.d.ts +5 -0
- package/dist/panels/toolbar/edit-view.js +18 -0
- package/dist/panels/toolbar/model.d.ts +34 -0
- package/dist/panels/toolbar/model.js +52 -0
- package/dist/panels/use-filter-opened.d.ts +8 -0
- package/dist/panels/use-filter-opened.js +11 -0
- package/dist/panels/view-state.d.ts +38 -0
- package/dist/panels/view-state.js +1 -0
- package/dist/panels/views-row/model.d.ts +131 -0
- package/dist/panels/views-row/model.js +14 -0
- package/dist/provider/ViewsProvider.d.ts +50 -6
- package/dist/provider/ViewsProvider.js +33 -2
- package/dist/provider/components.d.ts +274 -11
- package/dist/provider/context.d.ts +23 -2
- package/dist/provider/desktop.d.ts +3 -0
- package/dist/provider/desktop.js +7 -4
- package/dist/react.d.ts +5 -2
- package/dist/selection/SelectionBar.d.ts +18 -0
- package/dist/selection/SelectionBar.js +98 -0
- package/dist/selection/SelectionBarPhone.d.ts +3 -0
- package/dist/selection/SelectionBarPhone.js +14 -0
- package/dist/selection/bar-overflow.d.ts +12 -0
- package/dist/selection/bar-overflow.js +55 -0
- package/dist/selection/bar-parts.d.ts +17 -0
- package/dist/selection/bar-parts.js +19 -0
- package/dist/selection/index.d.ts +2 -0
- package/dist/selection/index.js +1 -0
- package/dist/selection/types.d.ts +3 -2
- package/dist/selection/useListSelectionShortcuts.d.ts +3 -2
- package/dist/selection/useListSelectionShortcuts.js +1 -1
- package/dist/selection/verbs.d.ts +41 -0
- package/dist/selection/verbs.js +1 -0
- package/docs/contract.md +355 -35
- package/docs/getting-started.md +1 -1
- package/docs/guides/atoms.md +39 -6
- package/docs/guides/columns.md +1 -1
- package/docs/guides/display.md +3 -2
- package/docs/guides/editors.md +4 -3
- package/docs/guides/selection.md +35 -21
- package/docs/guides/the-grid.md +24 -13
- package/docs/guides/the-provider.md +24 -6
- package/docs/index.md +2 -0
- package/docs/install.md +3 -1
- package/docs/reference/cells.md +1 -1
- package/docs/reference/display.md +5 -4
- package/docs/reference/editors-location.md +3 -1
- package/docs/reference/editors-name.md +3 -1
- package/docs/reference/editors-number.md +1 -0
- package/docs/reference/editors-range.md +3 -1
- package/docs/reference/editors-session.md +1 -0
- package/docs/reference/editors-text.md +2 -2
- package/docs/reference/editors-value-list.md +1 -1
- package/docs/reference/field-row.md +2 -2
- package/docs/reference/grid.md +10 -7
- package/docs/reference/panels-react.md +101 -0
- package/docs/reference/panels.md +123 -0
- package/docs/reference/react.md +45 -12
- package/docs/reference/selection.md +11 -3
- package/docs/reference/views.md +41 -38
- package/package.json +33 -4
- package/skills/views/SKILL.md +5 -4
|
@@ -19,6 +19,7 @@ import { useGridPartColumns } from "./useGridPartColumns.js";
|
|
|
19
19
|
import { GridFooter, gridFooterShown } from "./GridFooter.js";
|
|
20
20
|
import { useGridBandFigures } from "./useGridBandFigures.js";
|
|
21
21
|
import { groupMenuParts } from "./grid-group-menu-parts.js";
|
|
22
|
+
import { GRID_HEAD_KEY } from "../core/grid-focus.js";
|
|
22
23
|
import { gridAriaLayout } from "../core/grid-aria.js";
|
|
23
24
|
import { GridBody } from "./GridStructure.js";
|
|
24
25
|
import { useGridScaleStyles } from "./useGridScaleStyles.js";
|
|
@@ -32,6 +33,8 @@ import { GridRowWindowContext, useGridRowWindow } from "./grid-row-window.js";
|
|
|
32
33
|
import { useGridLab } from "./grid-lab.js";
|
|
33
34
|
import { useGridRecorder } from "./useGridRecorder.js";
|
|
34
35
|
import { GRID_ROW_PX } from "./useGridScaleStyles.js";
|
|
36
|
+
import { GridPager } from "./GridPager.js";
|
|
37
|
+
import { EditLeaveContext, useEditLeaveScope } from "../../editors/leave-scope.js";
|
|
35
38
|
export function GridTable(props) {
|
|
36
39
|
const { atoms, messages } = useViews();
|
|
37
40
|
const { Loading } = atoms;
|
|
@@ -42,7 +45,8 @@ export function GridTable(props) {
|
|
|
42
45
|
return _jsx(GridTableContent, { ...props });
|
|
43
46
|
}
|
|
44
47
|
function GridTableContent(props) {
|
|
45
|
-
const { groups, grouped, getRowId, columns, isCollapsed, onToggleGroup, renderGroupLabel, onHideGroup, renderAggregate, countOf, onOpenRow, onPrefetchRow, rowHref, rowClassName, onRowDelete, rowActions, rowIcon, showRowIcon = true, freezeIdentity = true, selection, loadMore, emptyState, sort, groupBy, sortOptions, groupSummary, aggregates, onAggregateChange, onGroupSummaryChange, groupFigures, countNoun, optionColors, onOptionColorChange, dateStyles, onDateStyleChange, durationStyles, onDurationStyleChange, numberFormats, onNumberFormatChange, showTimeOverrides, onShowTimeChange, percentDisplays, onPercentDisplayChange, columnState, onColumnStateChange, listConfig, } = props;
|
|
48
|
+
const { groups, grouped, getRowId, columns, isCollapsed, onToggleGroup, renderGroupLabel, onHideGroup, renderAggregate, countOf, onOpenRow, onPrefetchRow, rowHref, rowClassName, onRowDelete, rowActions, rowIcon, showRowIcon = true, freezeIdentity = true, selection, loadMore, pages, emptyState, sort, groupBy, sortOptions, groupSummary, aggregates, onAggregateChange, onGroupSummaryChange, groupFigures, countNoun, optionColors, onOptionColorChange, dateStyles, onDateStyleChange, durationStyles, onDurationStyleChange, numberFormats, onNumberFormatChange, showTimeOverrides, onShowTimeChange, percentDisplays, onPercentDisplayChange, columnState, onColumnStateChange, listConfig, } = props;
|
|
49
|
+
const leaveScope = useEditLeaveScope();
|
|
46
50
|
const { atoms, messages, desktopQuery } = useViews();
|
|
47
51
|
const { LoadMore } = atoms;
|
|
48
52
|
const verticalBorders = props.verticalBorders ?? true;
|
|
@@ -60,11 +64,13 @@ function GridTableContent(props) {
|
|
|
60
64
|
scale,
|
|
61
65
|
freezeIdentity,
|
|
62
66
|
viewBacked: props.viewBacked,
|
|
67
|
+
fillWidth: props.fillWidth,
|
|
63
68
|
});
|
|
64
69
|
const showAddColumn = !!columnManager &&
|
|
65
70
|
(!phone || !!props.addColumnOnPhone) &&
|
|
66
71
|
gridAddColumnDrawn(props.renderAddColumn, columnManager);
|
|
67
72
|
const scaleVarsStyle = useGridScaleStyles(scale, grouped, phone, showAddColumn);
|
|
73
|
+
const oneHead = grouped && !!props.oneHeader;
|
|
68
74
|
const flatRows = useMemo(() => groups.flatMap((g) => g.items), [groups]);
|
|
69
75
|
const shutKey = JSON.stringify(grouped ? groups.filter((g) => isCollapsed?.(g.key)).map((g) => g.key) : []);
|
|
70
76
|
const flat = useMemo(() => {
|
|
@@ -84,6 +90,7 @@ function GridTableContent(props) {
|
|
|
84
90
|
}, [flat, getRowId]);
|
|
85
91
|
const visibleRowKeys = flat.visible;
|
|
86
92
|
const total = useMemo(() => groups.reduce((n, g) => n + g.items.length, 0), [groups]);
|
|
93
|
+
const paged = !!pages && !grouped;
|
|
87
94
|
const lab = useGridLab();
|
|
88
95
|
const boxes = useGridBoxes();
|
|
89
96
|
const recorderRef = useGridRecorder({
|
|
@@ -100,6 +107,7 @@ function GridTableContent(props) {
|
|
|
100
107
|
isCollapsed,
|
|
101
108
|
getRowId,
|
|
102
109
|
selection,
|
|
110
|
+
pageKey: paged ? `${pages.page}:${pages.size}` : undefined,
|
|
103
111
|
});
|
|
104
112
|
const visibleColIds = useMemo(() => visibleColumns.map((c) => c.id), [visibleColumns]);
|
|
105
113
|
const sectionRowKeys = useMemo(() => flat.sections.map((s) => s.items.map((row) => gridRowKey(s.groupKey, getRowId(row)))), [flat, getRowId]);
|
|
@@ -125,6 +133,7 @@ function GridTableContent(props) {
|
|
|
125
133
|
figureCount: bandFigures.length,
|
|
126
134
|
canToggleFigures: !!onGroupSummaryChange,
|
|
127
135
|
canHide: !!onHideGroup,
|
|
136
|
+
canSelect: selectable,
|
|
128
137
|
}).open;
|
|
129
138
|
const footerKey = flat.sections.map((s) => (!s.collapsed && footerShown(s.groupKey) ? "1" : "0")).join("");
|
|
130
139
|
const focusShape = useMemo(() => ({
|
|
@@ -132,6 +141,7 @@ function GridTableContent(props) {
|
|
|
132
141
|
selectable,
|
|
133
142
|
columnIds: visibleColIds,
|
|
134
143
|
addColumn: showAddColumn,
|
|
144
|
+
oneHead,
|
|
135
145
|
sections: flat.sections.map((s, index) => ({
|
|
136
146
|
groupKey: s.groupKey,
|
|
137
147
|
collapsed: s.collapsed,
|
|
@@ -139,9 +149,9 @@ function GridTableContent(props) {
|
|
|
139
149
|
footer: footerKey[index] === "1",
|
|
140
150
|
menu: barMenu,
|
|
141
151
|
})),
|
|
142
|
-
}), [barMenu, flat, footerKey, grouped, sectionRowKeys, selectable, showAddColumn, visibleColIds]);
|
|
152
|
+
}), [barMenu, flat, footerKey, grouped, oneHead, sectionRowKeys, selectable, showAddColumn, visibleColIds]);
|
|
143
153
|
const groupOfRow = (rowKey) => flat.place.get(rowKey)?.groupKey;
|
|
144
|
-
const more = !!loadMore?.hasMore;
|
|
154
|
+
const more = !paged && !!loadMore?.hasMore;
|
|
145
155
|
const aria = useMemo(() => gridAriaLayout({
|
|
146
156
|
sections: flat.sections.map((s, index) => ({
|
|
147
157
|
groupKey: s.groupKey,
|
|
@@ -153,10 +163,11 @@ function GridTableContent(props) {
|
|
|
153
163
|
selectable,
|
|
154
164
|
columnIds: visibleColIds,
|
|
155
165
|
more,
|
|
156
|
-
|
|
166
|
+
oneHead,
|
|
167
|
+
}), [flat, footerKey, grouped, oneHead, selectable, visibleColIds, more]);
|
|
157
168
|
const ariaTailIndex = aria.colCount + 1;
|
|
158
169
|
const ariaColOffset = selectable ? 1 : 0;
|
|
159
|
-
const { rowSpansMap, selectValuesByColumn, onRangeCopy, onRangeCut, onRangeClear, onRangePaste, onPasteAtCell, inActiveRange, rangeCanClear, editingEnabled, focusedCell, editingCell, pendingByRow, settlementByRow, editSeed, editWhole, focusCellSync, startEditSync, cancelEdit, commitEdit, commitBatch, refuseEdit, onExtendCell, onAddCell, handleRootPointerDown, handleRootPointerDownCapture, handleRootClickCapture, onEditorTab, onEditorEnter, enterGrid, revealCell, focus, } = useGridTableInteractionModel({
|
|
170
|
+
const { rowSpansMap, selectValuesByColumn, onRangeCopy, onRangeCut, onRangeClear, onRangePaste, onPasteAtCell, inActiveRange, rangeCanClear, editingEnabled, focusedCell, editingCell, pendingByRow, settlementByRow, writeStateByRow, editSeed, editWhole, focusCellSync, startEditSync, cancelEdit, commitEdit, commitBatch, refuseEdit, onExtendCell, onAddCell, handleRootPointerDown, handleRootPointerDownCapture, handleRootClickCapture, onEditorTab, onEditorEnter, enterGrid, revealCell, focus, } = useGridTableInteractionModel({
|
|
160
171
|
rootRef,
|
|
161
172
|
props,
|
|
162
173
|
rows: flatRows,
|
|
@@ -256,6 +267,7 @@ function GridTableContent(props) {
|
|
|
256
267
|
onEditorEnter,
|
|
257
268
|
pendingByCol: pendingByRow.get(rowId),
|
|
258
269
|
settlementByCol: settlementByRow.get(rowId),
|
|
270
|
+
writeStateByCol: writeStateByRow.get(rowId),
|
|
259
271
|
selectValues: selectValuesByColumn,
|
|
260
272
|
rowRange: rowRangeFor(rowKey),
|
|
261
273
|
ariaRowIndex: aria.rowIndex(groupKey, index),
|
|
@@ -291,24 +303,24 @@ function GridTableContent(props) {
|
|
|
291
303
|
return place && section && row !== undefined ? rowProps(row, place.index, section.items, place.groupKey) : null;
|
|
292
304
|
};
|
|
293
305
|
const wrapRows = (rows) => (_jsx(GridRowsMenu, { rowPropsFor: rowPropsFor, selectable: selectable, children: rows }));
|
|
294
|
-
const header = (checkbox, groupKey) => (_jsx(GridHeader, { showAddColumn: showAddColumn, checkbox: checkbox, groupKey: groupKey, ariaRowIndex: empty ? 1 : groupKey != null ? aria.headIndex(groupKey) : undefined, ariaLevel: grouped ? 2 : undefined, ariaColOffset: ariaColOffset, ariaTailIndex: ariaTailIndex, columns: visibleColumns, columnManager: columnManager, minWidth: minWidth, sort: sort, selectValues: selectValuesByColumn, optionColors: optionColors, onOptionColorChange: onOptionColorChange, dateStyles: dateStyles, onDateStyleChange: onDateStyleChange, durationStyles: durationStyles, onDurationStyleChange: onDurationStyleChange, numberFormats: numberFormats, onNumberFormatChange: onNumberFormatChange, showTimeOverrides: showTimeOverrides, onShowTimeChange: onShowTimeChange, percentDisplays: percentDisplays, onPercentDisplayChange: onPercentDisplayChange, columnStateEnabled: !!onColumnStateChange, listConfig: listConfig, groupBy: groupBy, viewBacked: props.viewBacked, formatsWritable: props.formatsWritable, renderAddColumn: props.renderAddColumn, renderColumnMenuRows: props.renderColumnMenuRows, columnMenuItems: props.columnMenuItems, resizingId: resizingId, startResize: startResize, moveResize: moveResize, endResize: endResize, resetColumnWidth: resetColumnWidth, hideColumn: hideColumn, moveColumn: moveColumn, headerDrag: headerDrag, frozenCount: frozenCount, frozenLeft: frozenLeft }));
|
|
295
|
-
const footer = (group) => (_jsx(GridFooter, { group: group, ariaRowIndex: aria.footIndex(grouped ? group.key : (flat.sections[0]?.groupKey ?? group.key)), ariaLevel: grouped ? 2 : undefined, ariaColOffset: ariaColOffset, columns: visibleColumns, selecting: selecting, aggregates: aggregates, numberFormats: numberFormats, renderAggregate: renderAggregate, onAggregateChange: onAggregateChange, viewBacked: props.viewBacked, frozenCount: frozenCount, frozenLeft: frozenLeft, continuation: props.renderGroupFooter?.(group), defaultCurrency: props.defaultCurrency }));
|
|
306
|
+
const header = (checkbox, groupKey) => (_jsx(GridHeader, { showAddColumn: showAddColumn, checkbox: checkbox, groupKey: groupKey, ariaRowIndex: empty ? 1 : groupKey != null ? aria.headIndex(groupKey) : undefined, ariaLevel: grouped ? (oneHead && groupKey === GRID_HEAD_KEY ? 1 : 2) : undefined, ariaColOffset: ariaColOffset, ariaTailIndex: ariaTailIndex, columns: visibleColumns, columnManager: columnManager, minWidth: minWidth, sort: sort, selectValues: selectValuesByColumn, optionColors: optionColors, onOptionColorChange: onOptionColorChange, dateStyles: dateStyles, onDateStyleChange: onDateStyleChange, durationStyles: durationStyles, onDurationStyleChange: onDurationStyleChange, numberFormats: numberFormats, onNumberFormatChange: onNumberFormatChange, showTimeOverrides: showTimeOverrides, onShowTimeChange: onShowTimeChange, percentDisplays: percentDisplays, onPercentDisplayChange: onPercentDisplayChange, columnStateEnabled: !!onColumnStateChange, listConfig: listConfig, groupBy: groupBy, viewBacked: props.viewBacked, formatsWritable: props.formatsWritable, renderAddColumn: props.renderAddColumn, renderColumnMenuRows: props.renderColumnMenuRows, columnMenuItems: props.columnMenuItems, resizingId: resizingId, startResize: startResize, moveResize: moveResize, endResize: endResize, resetColumnWidth: resetColumnWidth, hideColumn: hideColumn, moveColumn: moveColumn, headerDrag: headerDrag, frozenCount: frozenCount, frozenLeft: frozenLeft, verticalBorders: verticalBorders, headerVerticalBorders: props.headerVerticalBorders }));
|
|
307
|
+
const footer = (group) => (_jsx(GridFooter, { group: group, ariaRowIndex: aria.footIndex(grouped ? group.key : (flat.sections[0]?.groupKey ?? group.key)), ariaLevel: grouped ? 2 : undefined, ariaColOffset: ariaColOffset, columns: visibleColumns, selecting: selecting, aggregates: aggregates, numberFormats: numberFormats, renderAggregate: renderAggregate, onAggregateChange: onAggregateChange, viewBacked: props.viewBacked, frozenCount: frozenCount, frozenLeft: frozenLeft, continuation: props.renderGroupFooter?.(group), defaultCurrency: props.defaultCurrency, pageOnly: paged }));
|
|
296
308
|
const groupCheckbox = (items) => (_jsx(GridHeadCheck, { selecting: selecting, ...groupSelection(items), "aria-label": messages({ key: "views.grid.select-group" }) }));
|
|
297
|
-
return (_jsx(GridHoverContext.Provider, { value: hoverStore, children: _jsx(GridRowWindowContext.Provider, { value: rowWindow.store, children: _jsx(GridTableSurface, { rootRef: rootRef, areaRef: areaRef, panRef: panRef, boxes: boxes, minWidth: minWidth, columnsTemplate: gridTemplate, gridAria: empty
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
309
|
+
return (_jsx(EditLeaveContext.Provider, { value: leaveScope, children: _jsx(GridHoverContext.Provider, { value: hoverStore, children: _jsx(GridRowWindowContext.Provider, { value: rowWindow.store, children: _jsx(GridTableSurface, { rootRef: rootRef, empty: empty, areaRef: areaRef, panRef: panRef, boxes: boxes, minWidth: minWidth, columnsTemplate: gridTemplate, gridAria: empty
|
|
310
|
+
? { role: "grid", rowCount: 2, colCount: ariaTailIndex }
|
|
311
|
+
: { role: aria.role, rowCount: aria.rowCount, colCount: ariaTailIndex }, style: { ...widthVarsStyle, ...scaleVarsStyle }, selecting: selecting, railRootProps: rail.rootProps, onPointerDown: (event) => {
|
|
312
|
+
if (checkDrag.tryArm(event))
|
|
313
|
+
return;
|
|
314
|
+
handleRootPointerDown(event);
|
|
315
|
+
}, onPointerDownCapture: handleRootPointerDownCapture, onClickCapture: (event) => {
|
|
316
|
+
if (checkDrag.consumeDrag()) {
|
|
317
|
+
event.preventDefault();
|
|
318
|
+
event.stopPropagation();
|
|
319
|
+
return;
|
|
320
|
+
}
|
|
321
|
+
handleRootClickCapture(event);
|
|
322
|
+
}, railProbe: _jsx(GridRailProbe, { probeRef: rail.probeRef }), onGuardFocus: (which, from) => {
|
|
323
|
+
if (!settlingFrom())
|
|
324
|
+
enterGrid(which, from);
|
|
325
|
+
}, body: _jsx(GridBody, { empty: empty, emptyState: emptyState, grouped: grouped, oneHead: oneHead, groups: groups, rows: flatRows, selectable: selectable, selecting: selecting, allSelected: sel.allSelected, someSelected: sel.someSelected, selectAll: sel.selectAll, clearSelection: sel.clear, isCollapsed: isCollapsed, countOf: countOf, sort: sort, sortOptions: sortOptions, groupSummary: groupSummary, onToggleGroup: onToggleGroup, onGroupSummaryChange: onGroupSummaryChange, renderGroupLabel: renderGroupLabel, onHideGroup: onHideGroup, groupMenu: props.groupMenu, figures: bandFigures, countNoun: countNoun, renderHeader: header, renderGroupCheckbox: groupCheckbox, selectGroup: groupSelection, renderRow: renderRow, wrapRows: wrapRows, renderFooter: footer, keptFor: keptFor, barIndexOf: aria.barIndex, ariaColCount: ariaTailIndex }), loadMore: !paged && loadMore?.hasMore ? _jsx(LoadMore, { onReveal: loadMore.onReveal, label: loadMore.label }) : undefined, pager: paged ? _jsx(GridPager, { pages: pages, rowsOnPage: total }) : undefined, selectionBar: selection?.renderBar?.(sel, batchApi) }) }) }) }));
|
|
314
326
|
}
|
|
@@ -29,7 +29,9 @@ import type { GridBoxes } from "./useGridBoxes.js";
|
|
|
29
29
|
* A frame with no height (an app that hasn't given one) grows to its rows: the page scrolls it, and
|
|
30
30
|
* its heads don't pin.
|
|
31
31
|
*/
|
|
32
|
-
export declare function GridTableSurface({ rootRef, areaRef, panRef, boxes, style, selecting, minWidth, columnsTemplate, railRootProps, onPointerDown, onPointerDownCapture, onClickCapture, railProbe, body, loadMore, selectionBar, onGuardFocus, gridAria, }: {
|
|
32
|
+
export declare function GridTableSurface({ rootRef, areaRef, panRef, boxes, style, selecting, minWidth, columnsTemplate, railRootProps, onPointerDown, onPointerDownCapture, onClickCapture, railProbe, body, loadMore, pager, selectionBar, onGuardFocus, gridAria, empty, }: {
|
|
33
|
+
/** The grid has no rows to draw (the contract's `data-empty` on the frame). */
|
|
34
|
+
empty?: boolean;
|
|
33
35
|
/** What a screen reader is told of the whole table: a grid (a tree grid when grouped), its rows (-1 while more
|
|
34
36
|
* remain to load) and its columns. */
|
|
35
37
|
gridAria?: {
|
|
@@ -61,5 +63,7 @@ export declare function GridTableSurface({ rootRef, areaRef, panRef, boxes, styl
|
|
|
61
63
|
railProbe: ReactNode;
|
|
62
64
|
body: ReactNode;
|
|
63
65
|
loadMore?: ReactNode;
|
|
66
|
+
/** The pager of a grid in pages, drawn under the grid's frame and outside it, so a Tab out of the grid reaches it. */
|
|
67
|
+
pager?: ReactNode;
|
|
64
68
|
selectionBar?: ReactNode;
|
|
65
69
|
}): import("react/jsx-runtime").JSX.Element;
|
|
@@ -2,12 +2,12 @@
|
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
3
|
import { cx } from "../../internal/cx.js";
|
|
4
4
|
import { GRID_BLEED } from "./grid-styles.js";
|
|
5
|
-
export function GridTableSurface({ rootRef, areaRef, panRef, boxes, style, selecting, minWidth, columnsTemplate, railRootProps, onPointerDown, onPointerDownCapture, onClickCapture, railProbe, body, loadMore, selectionBar, onGuardFocus, gridAria, }) {
|
|
5
|
+
export function GridTableSurface({ rootRef, areaRef, panRef, boxes, style, selecting, minWidth, columnsTemplate, railRootProps, onPointerDown, onPointerDownCapture, onClickCapture, railProbe, body, loadMore, pager, selectionBar, onGuardFocus, gridAria, empty, }) {
|
|
6
6
|
const content = (_jsxs("div", { className: "relative", role: gridAria?.role, "aria-rowcount": gridAria?.rowCount, "aria-colcount": gridAria?.colCount, "aria-multiselectable": gridAria ? true : undefined, style: {
|
|
7
7
|
minWidth,
|
|
8
8
|
paddingBottom: `calc(${selecting ? "3.5rem" : "0.5rem"} + var(--vk-scroll-inset-bottom,0px))`,
|
|
9
9
|
}, children: [body, loadMore ? (_jsx("div", { role: "row", children: _jsx("div", { role: "gridcell", "aria-colspan": gridAria?.colCount, children: loadMore }) })) : null] }));
|
|
10
|
-
|
|
10
|
+
const frame = (_jsxs("div", { ref: rootRef, style: style, tabIndex: -1, className: "group/gridtable relative isolate flex h-full min-h-0 flex-1 flex-col animate-fade-in outline-none", "data-slot": "vk-grid", "data-empty": empty ? "" : undefined, ...railRootProps, onPointerDown: onPointerDown, onPointerDownCapture: onPointerDownCapture, onClickCapture: onClickCapture, children: [_jsx("span", { "data-grid-guard": "start", tabIndex: 0, className: "absolute size-0 overflow-hidden outline-none", onFocus: (event) => onGuardFocus?.("start", event.relatedTarget) }), boxes === 2 ? (_jsx("div", { ref: panRef, "data-slot": "vk-grid-pan", className: cx("@container flex min-h-0 flex-1 flex-col", GRID_BLEED), style: { overflowX: "auto", overflowY: "hidden", overscrollBehaviorX: "contain" }, children: _jsx("div", { ref: areaRef, "data-slot": "vk-grid-scroll", className: "min-h-0 flex-1", style: {
|
|
11
11
|
overflowX: "hidden",
|
|
12
12
|
overflowY: "auto",
|
|
13
13
|
minWidth,
|
|
@@ -19,4 +19,7 @@ export function GridTableSurface({ rootRef, areaRef, panRef, boxes, style, selec
|
|
|
19
19
|
scrollPaddingBottom: "var(--vk-scroll-inset-bottom,0px)",
|
|
20
20
|
"--vk-cols": columnsTemplate,
|
|
21
21
|
}, children: content })), _jsx("span", { "data-grid-guard": "end", tabIndex: 0, className: "absolute size-0 overflow-hidden outline-none", onFocus: (event) => onGuardFocus?.("end", event.relatedTarget) }), selectionBar, railProbe] }));
|
|
22
|
+
if (!pager)
|
|
23
|
+
return frame;
|
|
24
|
+
return (_jsxs("div", { className: "flex h-full min-h-0 flex-1 flex-col", children: [frame, pager] }));
|
|
22
25
|
}
|
|
@@ -15,7 +15,7 @@ export declare function gridTextEditorType(colType: string | undefined): TextEdi
|
|
|
15
15
|
* ✕ and a swipe change nothing, ✓ saves and closes without moving the selection, and the write waits
|
|
16
16
|
* for the sheet to slide away.
|
|
17
17
|
*/
|
|
18
|
-
export declare function GridTextEditor({ initial, seed, type, title, strong, open, refuse, onCommit, onCancel, onTab, onEnter, }: {
|
|
18
|
+
export declare function GridTextEditor({ initial, seed, type, paragraph, region, title, strong, open, refuse, onCommit, onCancel, onTab, onEnter, }: {
|
|
19
19
|
/** The stored email, phone, link or domain the sheet's open action follows (mail, call or browse), drawn
|
|
20
20
|
* beside the box on a phone, where a tap on the cell edits it. Gone once the box is typed over: it opens
|
|
21
21
|
* what is stored, never a draft. */
|
|
@@ -29,6 +29,10 @@ export declare function GridTextEditor({ initial, seed, type, title, strong, ope
|
|
|
29
29
|
seed?: string;
|
|
30
30
|
/** The field's text type: the keyboard the box brings. Default `text`. */
|
|
31
31
|
type?: TextEditorType;
|
|
32
|
+
/** A paragraph (long text with an app's `TextBody` in the cell): handed to the editor as `multiline` when true. */
|
|
33
|
+
paragraph?: boolean;
|
|
34
|
+
/** A phone's country, where a number typed without its code is read: handed to an app's `TextBody`. */
|
|
35
|
+
region?: string;
|
|
32
36
|
/** The sheet's title on a phone: the column's header. */
|
|
33
37
|
title?: ReactNode;
|
|
34
38
|
/** Title columns render medium-weight — match it while editing. */
|
|
@@ -5,6 +5,7 @@ import { EditorPanel } from "../../editors/EditorPanel.js";
|
|
|
5
5
|
import { OpenValueAction } from "../../editors/open-value.js";
|
|
6
6
|
import { TextEditor, } from "../../editors/TextEditor.js";
|
|
7
7
|
import { cx } from "../../internal/cx.js";
|
|
8
|
+
import { useViews } from "../../provider/context.js";
|
|
8
9
|
import { GridRefusal, useGridEditSession } from "./grid-edit-session.js";
|
|
9
10
|
import { GridFittedBox } from "./grid-fitted-box.js";
|
|
10
11
|
const TEXT_TYPES = new Set([
|
|
@@ -18,9 +19,10 @@ const TEXT_TYPES = new Set([
|
|
|
18
19
|
export function gridTextEditorType(colType) {
|
|
19
20
|
return colType && TEXT_TYPES.has(colType) ? colType : "text";
|
|
20
21
|
}
|
|
21
|
-
export function GridTextEditor({ initial, seed, type = "text", title, strong = false, open, refuse, onCommit, onCancel, onTab, onEnter, }) {
|
|
22
|
+
export function GridTextEditor({ initial, seed, type = "text", paragraph = false, region, title, strong = false, open, refuse, onCommit, onCancel, onTab, onEnter, }) {
|
|
22
23
|
const editorRef = useRef(null);
|
|
23
24
|
const boxRef = useRef(null);
|
|
25
|
+
const { TextBody } = useViews().components;
|
|
24
26
|
const { session, close } = useGridEditSession({
|
|
25
27
|
editorRef,
|
|
26
28
|
inPlace: true,
|
|
@@ -32,9 +34,17 @@ export function GridTextEditor({ initial, seed, type = "text", title, strong = f
|
|
|
32
34
|
});
|
|
33
35
|
const [stored, setStored] = useState(seed === undefined);
|
|
34
36
|
return (_jsx(EditorPanel, { session: session, title: title ?? "", anchor: null, inPlace: true, sheetOnPhone: true, children: (surface) => {
|
|
35
|
-
const editor = (_jsx(TextEditor, { ref: editorRef, type: type, initial: initial, seed: seed, closeOnBlur: surface === "in-place", chrome: surface === "sheet" ? "field" : "bare",
|
|
37
|
+
const editor = (_jsx(TextEditor, { ref: editorRef, type: type, initial: initial, seed: seed, closeOnBlur: surface === "in-place", chrome: surface === "sheet" ? "field" : "bare", ...(paragraph ? { multiline: true } : {}), ...(TextBody
|
|
38
|
+
? {
|
|
39
|
+
label: typeof title === "string" ? title : undefined,
|
|
40
|
+
check: refuse,
|
|
41
|
+
region,
|
|
42
|
+
escapeKeeps: session.keeps ?? false,
|
|
43
|
+
form: surface === "sheet" ? "phone" : "computer",
|
|
44
|
+
}
|
|
45
|
+
: {}), boxData: { "data-slot": "vk-grid-editor", "data-grid-editor": "" }, onRequestClose: close, className: surface === "sheet"
|
|
36
46
|
? "w-full min-w-0 select-text"
|
|
37
47
|
: cx("h-full w-full min-w-0 select-text bg-transparent text-(length:--vk-text) text-(color:--vk-fg) outline-hidden placeholder:text-(color:--vk-fg-subtlest)", strong && "font-medium") }));
|
|
38
|
-
return surface === "sheet" ? (open ? (_jsxs("div", { className: "flex items-center gap-2 px-4 pb-4", onInput: (e) => setStored(e.target.value === initial), children: [_jsx("div", { className: "min-w-0 flex-1", children: editor }), stored && _jsx(OpenValueAction, { type: open.type, value: open.value, label: initial })] })) : (_jsx("div", { className: "px-4 pb-4", children: editor }))) : (_jsxs("span", { className: "relative flex h-full w-full min-w-0", children: [_jsx(GridFittedBox, { boxRef: boxRef, children: editor }), _jsx(GridRefusal, { reason: session.refusal })] }));
|
|
48
|
+
return surface === "sheet" ? (open ? (_jsxs("div", { className: "flex items-center gap-2 px-4 pb-4", onInput: (e) => setStored(e.target.value === initial), children: [_jsx("div", { className: "min-w-0 flex-1", children: editor }), stored && _jsx(OpenValueAction, { type: open.type, value: open.value, label: initial })] })) : (_jsx("div", { className: "px-4 pb-4", children: editor }))) : TextBody ? (_jsxs("span", { "data-grown": "", className: "relative flex h-full w-full min-w-0", children: [editor, _jsx(GridRefusal, { reason: session.refusal })] })) : (_jsxs("span", { className: "relative flex h-full w-full min-w-0", children: [_jsx(GridFittedBox, { boxRef: boxRef, children: editor }), _jsx(GridRefusal, { reason: session.refusal })] }));
|
|
39
49
|
} }));
|
|
40
50
|
}
|
|
@@ -7,9 +7,12 @@ import type { FieldDefOf, MultipleType, ValueItem } from "@viewkitjs/fields";
|
|
|
7
7
|
* one-answer guard and the exit gap; the editor panel opens the popover on a
|
|
8
8
|
* desktop and the sheet on a phone, titled with the column's header. No seed: a
|
|
9
9
|
* key typed on a list cell opens the list as it is (`useGridKeyboard`'s
|
|
10
|
-
* `seedable`).
|
|
10
|
+
* `seedable`). Holding one (`holds="one"`, a single email or domain the app opens as a list of one), it opens on the
|
|
11
|
+
* stored string, starts from a typed key as the text box does, and hands its write the string the text box writes.
|
|
11
12
|
*/
|
|
12
|
-
|
|
13
|
+
/** What the list writes: its items (null for none), or, holding one, the string the text box writes. */
|
|
14
|
+
type ValuesPayload = ValueItem<unknown>[] | null | string;
|
|
15
|
+
export declare function GridValueListEditor({ field, title, initial, labels, allowEmpty, region, refuse, onCommit, onCancel, onTab, onEnter, holds, seed, }: {
|
|
13
16
|
field: FieldDefOf<MultipleType>;
|
|
14
17
|
/** The field's name: the sheet's title on a phone. */
|
|
15
18
|
title: ReactNode;
|
|
@@ -21,10 +24,15 @@ export declare function GridValueListEditor({ field, title, initial, labels, all
|
|
|
21
24
|
region?: string | null;
|
|
22
25
|
/** The grid's judgement of the list it is about to write: its reason, or null. A refused list stays open
|
|
23
26
|
* with the reason under it. */
|
|
24
|
-
refuse?: (payload:
|
|
25
|
-
onCommit: (payload:
|
|
27
|
+
refuse?: (payload: ValuesPayload) => string | null;
|
|
28
|
+
onCommit: (payload: ValuesPayload) => void;
|
|
26
29
|
onCancel: () => void;
|
|
27
30
|
onTab?: (backwards: boolean) => void;
|
|
28
31
|
/** Commit happened via Enter — advance one row down. */
|
|
29
32
|
onEnter?: () => void;
|
|
33
|
+
/** `one`: a single value opened as a list of one; `initial`, `refuse` and `onCommit` take its string. */
|
|
34
|
+
holds?: "one" | "several";
|
|
35
|
+
/** What was typed on what opened it (a list of one only). */
|
|
36
|
+
seed?: string;
|
|
30
37
|
}): import("react/jsx-runtime").JSX.Element;
|
|
38
|
+
export {};
|
|
@@ -3,10 +3,18 @@ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-run
|
|
|
3
3
|
import { useRef } from "react";
|
|
4
4
|
import { EditorPanel } from "../../editors/EditorPanel.js";
|
|
5
5
|
import { ValueListEditor } from "../../editors/ValueListEditor.js";
|
|
6
|
+
import { listOfOne, oneOfList } from "../../editors/values-body.js";
|
|
6
7
|
import { useGridEditSession } from "./grid-edit-session.js";
|
|
7
|
-
|
|
8
|
+
import { useBodyPanel } from "../../editors/body-panel.js";
|
|
9
|
+
export function GridValueListEditor({ field, title, initial, labels, allowEmpty = false, region, refuse, onCommit, onCancel, onTab, onEnter, holds = "several", seed, }) {
|
|
10
|
+
const panel = useBodyPanel("values", "w-96 p-2", "z-90");
|
|
8
11
|
const anchorRef = useRef(null);
|
|
9
|
-
const
|
|
12
|
+
const listRef = useRef(null);
|
|
13
|
+
const one = holds === "one";
|
|
14
|
+
const oneRef = useRef({ resolveClose: (reason) => oneOfList(listRef.current.resolveClose(reason)) });
|
|
15
|
+
const editorRef = one
|
|
16
|
+
? oneRef
|
|
17
|
+
: listRef;
|
|
10
18
|
const { session, close } = useGridEditSession({
|
|
11
19
|
editorRef,
|
|
12
20
|
refuse: refuse ? (payload) => refuse(payload) : undefined,
|
|
@@ -15,5 +23,5 @@ export function GridValueListEditor({ field, title, initial, labels, allowEmpty
|
|
|
15
23
|
onTab,
|
|
16
24
|
onEnter,
|
|
17
25
|
});
|
|
18
|
-
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: 4, initialFocus: false, panelData: { "data-slot": "vk-grid-editor" }, onPanelClick: (e) => e.stopPropagation(), chrome: "menu", className:
|
|
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: 4, initialFocus: false, panelData: { "data-slot": "vk-grid-editor", ...panel.data }, onPanelClick: (e) => e.stopPropagation(), chrome: "menu", className: panel.className, children: (surface) => (_jsx(ValueListEditor, { ref: listRef, field: field, label: typeof title === "string" ? title : undefined, initial: one ? listOfOne(initial) : initial, labels: labels && !one, holds: holds, seed: one ? seed : undefined, allowEmpty: allowEmpty, region: region, openLinks: surface === "sheet", escapeKeeps: session.keeps ?? false, onRequestClose: close })) })] }));
|
|
19
27
|
}
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Says when the sticky header right after it is STUCK — `data-stuck="true"`
|
|
3
3
|
* on that header, while it stands below where it would rest (Mihai,
|
|
4
|
-
* 2026-10-05).
|
|
4
|
+
* 2026-10-05); at rest it carries none. A flag of the contract's States: present
|
|
5
|
+
* or absent, its value "true" so a skin written for 0.5.0's
|
|
6
|
+
* `[data-stuck="true"]` still matches.
|
|
5
7
|
*
|
|
6
8
|
* The header's ground leaves a 2px sliver at its foot see-through
|
|
7
9
|
* (GRID_HEADER_BG): at rest it is where the first row's selection ring draws
|
|
@@ -12,8 +12,12 @@ export function StuckMarker() {
|
|
|
12
12
|
const apply = () => {
|
|
13
13
|
raf = 0;
|
|
14
14
|
const stuck = header.getBoundingClientRect().top - marker.getBoundingClientRect().top > 0.5;
|
|
15
|
-
if (
|
|
16
|
-
|
|
15
|
+
if (header.hasAttribute("data-stuck") === stuck)
|
|
16
|
+
return;
|
|
17
|
+
if (stuck)
|
|
18
|
+
header.dataset.stuck = "true";
|
|
19
|
+
else
|
|
20
|
+
delete header.dataset.stuck;
|
|
17
21
|
};
|
|
18
22
|
const schedule = () => {
|
|
19
23
|
if (!raf)
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { ReactNode } from "react";
|
|
2
|
+
import type { GridButtonViews } from "./grid-button.js";
|
|
2
3
|
import type { GridCellOptions } from "../../cells/cell-format.js";
|
|
3
4
|
import type { ListColumn } from "../../model/column-schema.js";
|
|
4
5
|
export { formatDate, formatNumber } from "../../cells/cell-format.js";
|
|
@@ -17,5 +18,6 @@ export { formatDate, formatNumber } from "../../cells/cell-format.js";
|
|
|
17
18
|
export declare function renderTypedCell<Row>(col: ListColumn<Row>, row: Row, opts?: GridCellOptions): ReactNode;
|
|
18
19
|
/** Renders an `action` column's cell — a centered row of icon buttons. Real
|
|
19
20
|
* `<button>`s so GridRow's click contract treats them as interactive (the row
|
|
20
|
-
* does not open / select on an action click).
|
|
21
|
-
|
|
21
|
+
* does not open / select on an action click). `views` is the provider's Button and who draws, handed down by the
|
|
22
|
+
* row's cells. */
|
|
23
|
+
export declare function renderActionCell<Row>(col: ListColumn<Row>, row: Row, views: GridButtonViews): ReactNode;
|
|
@@ -12,8 +12,8 @@ export function renderTypedCell(col, row, opts) {
|
|
|
12
12
|
return cell;
|
|
13
13
|
return (_jsxs("span", { className: "flex h-(--vk-line-h) min-w-0 flex-1 flex-wrap content-start items-center gap-x-1.5 overflow-hidden leading-(--vk-line-h)", children: [_jsx("span", { className: "max-w-full flex-none truncate", children: cell }), indicator] }));
|
|
14
14
|
}
|
|
15
|
-
export function renderActionCell(col, row) {
|
|
15
|
+
export function renderActionCell(col, row, views) {
|
|
16
16
|
if (!col.actions?.length)
|
|
17
17
|
return null;
|
|
18
|
-
return (_jsx("span", { className: "flex items-center justify-center gap-1", children: col.actions.map((a) => (_jsx(GridActionButton, { variant: "bare", label: a.label?.(row), onClick: a.onClick ? () => a.onClick?.(row) : undefined, children: a.icon(row) }, a.id))) }));
|
|
18
|
+
return (_jsx("span", { className: "flex items-center justify-center gap-1", children: col.actions.map((a) => (_jsx(GridActionButton, { views: views, variant: "bare", label: a.label?.(row), onClick: a.onClick ? () => a.onClick?.(row) : undefined, children: a.icon(row) }, a.id))) }));
|
|
19
19
|
}
|
|
@@ -5,7 +5,7 @@ import type { ViewsMenuItem } from "../../provider/components.js";
|
|
|
5
5
|
* Each hidden column a row; each field with parts (`parts`) a group beside the menu, its count as `detail`, holding
|
|
6
6
|
* the field itself when hidden and then each hidden part by its word; a fixed column never. There is no search: a
|
|
7
7
|
* menu finds a row by its first letters, and a part by opening its field. With nothing to add, one disabled row says
|
|
8
|
-
* all columns are shown.
|
|
8
|
+
* all columns are shown, its reason that no hidden column is left to add.
|
|
9
9
|
*/
|
|
10
10
|
export declare function gridAddColumnItems(columns: ListColumnsConfig, deps: {
|
|
11
11
|
messages: ViewsMessageResolver;
|
|
@@ -36,5 +36,12 @@ export function gridAddColumnItems(columns, deps) {
|
|
|
36
36
|
});
|
|
37
37
|
if (rows.length > 0)
|
|
38
38
|
return rows;
|
|
39
|
-
return [
|
|
39
|
+
return [
|
|
40
|
+
{
|
|
41
|
+
key: "all-shown",
|
|
42
|
+
label: deps.messages({ key: "views.menus.add-column-all-shown" }),
|
|
43
|
+
disabled: true,
|
|
44
|
+
disabledReason: deps.messages({ key: "views.menus.add-column-all-shown-reason" }),
|
|
45
|
+
},
|
|
46
|
+
];
|
|
40
47
|
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import type { MouseEvent as ReactMouseEvent, ReactElement, ReactNode, Ref } from "react";
|
|
2
|
+
import type { ViewsContextValue } from "../../provider/context.js";
|
|
3
|
+
/** What a grid button reads from the provider: the app's `Button` and who draws. Handed down by a part that already
|
|
4
|
+
* reads the provider, so a button in a row reads no context of its own. */
|
|
5
|
+
export type GridButtonViews = Pick<ViewsContextValue, "components" | "gridButtons">;
|
|
6
|
+
/** One button the grid draws itself, as each of its places describes it. */
|
|
7
|
+
export type GridButtonDraw = {
|
|
8
|
+
/** Today's classes, without `ELEMENT_RESET`: drawn on ViewKit's own `<button>`. */
|
|
9
|
+
own: string;
|
|
10
|
+
/** The box ViewKit keeps on the app's `Button`: its size, its place, its reveal. The look is the app's. */
|
|
11
|
+
frame: string;
|
|
12
|
+
variant: "ghost" | "outline";
|
|
13
|
+
size: "icon" | "sm";
|
|
14
|
+
ref?: Ref<HTMLButtonElement>;
|
|
15
|
+
tabIndex?: number;
|
|
16
|
+
title?: string;
|
|
17
|
+
"aria-label"?: string;
|
|
18
|
+
"aria-haspopup"?: "menu" | "dialog";
|
|
19
|
+
"aria-expanded"?: boolean;
|
|
20
|
+
"data-slot"?: string;
|
|
21
|
+
"data-open"?: "";
|
|
22
|
+
/** A press noted before its click (a menu's toggle on the `menu` route). */
|
|
23
|
+
onPointerDownCapture?: () => void;
|
|
24
|
+
onClick?: (event: ReactMouseEvent<HTMLButtonElement>) => void;
|
|
25
|
+
children: ReactNode;
|
|
26
|
+
};
|
|
27
|
+
/**
|
|
28
|
+
* Draws a button the grid draws itself: ViewKit's own `<button>` by default (the provider's `gridButtons` is `own`),
|
|
29
|
+
* exactly as on 0.5.0, or the app's `Button` with `gridButtons: "button"`. A plain function, never a component and
|
|
30
|
+
* never a hook, so a row that draws one draws nothing more than its one element while the option is off.
|
|
31
|
+
*/
|
|
32
|
+
export declare function drawGridButton(views: GridButtonViews, { own, frame, variant, size, onPointerDownCapture, children, ...props }: GridButtonDraw): ReactElement;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use client";
|
|
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
|
+
export function drawGridButton(views, { own, frame, variant, size, onPointerDownCapture, children, ...props }) {
|
|
6
|
+
if (views.gridButtons !== "button") {
|
|
7
|
+
return (_jsx("button", { type: "button", ...props, onPointerDownCapture: onPointerDownCapture, className: cx(ELEMENT_RESET, own), children: children }));
|
|
8
|
+
}
|
|
9
|
+
const { Button } = views.components;
|
|
10
|
+
const button = (_jsx(Button, { type: "button", variant: variant, size: size, className: frame, ...props, children: children }));
|
|
11
|
+
return onPointerDownCapture ? (_jsx("span", { className: "contents", onPointerDownCapture: onPointerDownCapture, children: button })) : (button);
|
|
12
|
+
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { FieldSettlement } from "@viewkitjs/fields";
|
|
2
|
+
import type { GridWriteState } from "../core/write-states.js";
|
|
2
3
|
/**
|
|
3
4
|
* One body cell's class string.
|
|
4
5
|
*
|
|
@@ -31,10 +32,47 @@ export type GridCellClassState = {
|
|
|
31
32
|
};
|
|
32
33
|
/** The row-open hotspot inside a title cell, dressed as a link on its own hover. */
|
|
33
34
|
export declare const GRID_TITLE_LINK_CLASS = "**:data-cell-open:underline-offset-2 [&_[data-cell-open]:hover]:text-(color:--vk-fg-brand) [&_[data-cell-open]:hover]:underline";
|
|
35
|
+
/** The contract's part on that hotspot, `vk-grid-title`: the grid hands it to the title cell (`GridCellOptions.titleData`),
|
|
36
|
+
* so only a grid's name carries it, never a board's or a rows look's. Its look stays on `GRID_TITLE_LINK_CLASS`. */
|
|
37
|
+
export declare const GRID_TITLE_DATA: {
|
|
38
|
+
readonly "data-slot": "vk-grid-title";
|
|
39
|
+
};
|
|
40
|
+
/** A picked row's line along one edge, in `--vk-selection-edge` (undeclared, the brand). Each edge is a whole
|
|
41
|
+
* literal, so the class scanner sees both. */
|
|
42
|
+
export declare function gridSelectionEdgeClass(edge: "top" | "bottom"): string;
|
|
34
43
|
/** A ranged cell's tint: it covers the cell and reaches 1px past its trailing edges, bridging the
|
|
35
44
|
* hairlines between cells into one surface. `-z-1` lays it under the cell's value and over the
|
|
36
45
|
* cell's own ground, inside the stacking context every ranged cell is (its z, or sticky). */
|
|
37
46
|
export declare const GRID_RANGE_TINT_CLASS = "pointer-events-none absolute left-0 top-0 -bottom-px -right-px -z-1 bg-(color:--vk-brand-subtlest)";
|
|
47
|
+
/** The contract's states on a body cell (`GRID_STATES`): present ("" or the edges) when they hold, absent when not. */
|
|
48
|
+
export type GridCellStates = {
|
|
49
|
+
"data-focused"?: "";
|
|
50
|
+
"data-editing"?: "";
|
|
51
|
+
"data-in-range"?: "";
|
|
52
|
+
"data-range-edge"?: string;
|
|
53
|
+
"data-pending"?: "";
|
|
54
|
+
"data-invalid"?: "";
|
|
55
|
+
"data-empty"?: "";
|
|
56
|
+
"data-frozen"?: "";
|
|
57
|
+
};
|
|
58
|
+
/**
|
|
59
|
+
* A body cell's state attributes, for a skin to dress (`[data-focused]`). They only name the state: the cell's own
|
|
60
|
+
* look stays on `gridCellClassName`. Absent keys, never `undefined` values, so the object spreads clean.
|
|
61
|
+
*/
|
|
62
|
+
export declare function gridCellStates(state: {
|
|
63
|
+
focused: boolean;
|
|
64
|
+
editing: boolean;
|
|
65
|
+
/** Undefined outside a range; inside one, which of its outer edges this cell draws. */
|
|
66
|
+
range?: {
|
|
67
|
+
top: boolean;
|
|
68
|
+
right: boolean;
|
|
69
|
+
bottom: boolean;
|
|
70
|
+
left: boolean;
|
|
71
|
+
};
|
|
72
|
+
write?: GridWriteState;
|
|
73
|
+
empty: boolean;
|
|
74
|
+
frozen: boolean;
|
|
75
|
+
}): GridCellStates;
|
|
38
76
|
export declare function gridCellClassName(state: GridCellClassState): string;
|
|
39
77
|
/** The row's own classes. A SELECTED row hovers brand, not neutral: hover and selected both write
|
|
40
78
|
* background-image, so the neutral tint would replace the selection, and the row would grey out
|
|
@@ -4,7 +4,37 @@ import { GRID_CELL_HOVER_RING, GRID_CELL_HOVER_SHADOW, gridFrozenBg } from "./Gr
|
|
|
4
4
|
import { GRID_GROUND } from "./grid-styles.js";
|
|
5
5
|
const GRID_CELL_REQUESTED = "italic opacity-80";
|
|
6
6
|
export const GRID_TITLE_LINK_CLASS = "**:data-cell-open:underline-offset-2 [&_[data-cell-open]:hover]:text-(color:--vk-fg-brand) [&_[data-cell-open]:hover]:underline";
|
|
7
|
+
export const GRID_TITLE_DATA = { "data-slot": "vk-grid-title" };
|
|
8
|
+
export function gridSelectionEdgeClass(edge) {
|
|
9
|
+
return edge === "top"
|
|
10
|
+
? "pointer-events-none absolute inset-x-0 top-0 z-11 h-px bg-(color:--vk-selection-edge,var(--vk-brand))"
|
|
11
|
+
: "pointer-events-none absolute inset-x-0 bottom-0 z-11 h-px bg-(color:--vk-selection-edge,var(--vk-brand))";
|
|
12
|
+
}
|
|
7
13
|
export const GRID_RANGE_TINT_CLASS = "pointer-events-none absolute left-0 top-0 -bottom-px -right-px -z-1 bg-(color:--vk-brand-subtlest)";
|
|
14
|
+
const RANGE_EDGES = ["top", "right", "bottom", "left"];
|
|
15
|
+
export function gridCellStates(state) {
|
|
16
|
+
const states = {};
|
|
17
|
+
if (state.focused)
|
|
18
|
+
states["data-focused"] = "";
|
|
19
|
+
if (state.editing)
|
|
20
|
+
states["data-editing"] = "";
|
|
21
|
+
if (state.range) {
|
|
22
|
+
states["data-in-range"] = "";
|
|
23
|
+
const range = state.range;
|
|
24
|
+
const edges = RANGE_EDGES.filter((edge) => range[edge]);
|
|
25
|
+
if (edges.length > 0)
|
|
26
|
+
states["data-range-edge"] = edges.join(" ");
|
|
27
|
+
}
|
|
28
|
+
if (state.write?.pending)
|
|
29
|
+
states["data-pending"] = "";
|
|
30
|
+
if (state.write?.invalid)
|
|
31
|
+
states["data-invalid"] = "";
|
|
32
|
+
if (state.empty)
|
|
33
|
+
states["data-empty"] = "";
|
|
34
|
+
if (state.frozen)
|
|
35
|
+
states["data-frozen"] = "";
|
|
36
|
+
return states;
|
|
37
|
+
}
|
|
8
38
|
export function gridCellClassName(state) {
|
|
9
39
|
const { focused, editing, inRange, frozen, selected } = state;
|
|
10
40
|
return cx(state.settlement === "requested" && GRID_CELL_REQUESTED, "group/gridcell", "outline-none", "flex min-w-0 border-b border-r border-(color:--vk-border-subtle) px-(--vk-px) text-(length:--vk-text)", "h-(--vk-row-h) items-center whitespace-nowrap", "scroll-mt-(--vk-scroll-mt)", "scroll-ml-[calc(var(--vk-rail-w)+var(--vk-frozen-w,0px))]", (!state.verticalBorders || state.lastColumn) && "border-r-transparent", state.align === "right" && "justify-end text-right tabular-nums", state.align === "center" && "justify-center text-center", frozen
|
|
@@ -30,6 +30,9 @@ export type ColumnMenuGates = {
|
|
|
30
30
|
/** The field key every knob and colour writes under. */
|
|
31
31
|
key: string;
|
|
32
32
|
sortKey: string | undefined;
|
|
33
|
+
/** A place column's parts it sorts by (`columnSortParts`), each a sort of its own; empty for any other column. */
|
|
34
|
+
sortParts: readonly string[];
|
|
35
|
+
/** Sort is offered: by its key, or by its parts. */
|
|
33
36
|
sortable: boolean;
|
|
34
37
|
groupable: boolean;
|
|
35
38
|
grouped: boolean;
|