@viewkitjs/views 0.0.0-stage → 0.2.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 +615 -0
- package/LICENSE.md +7 -0
- package/README.md +99 -2
- package/dist/atoms/CommandMenu.d.ts +2 -0
- package/dist/atoms/CommandMenu.js +20 -0
- package/dist/atoms/List.d.ts +2 -0
- package/dist/atoms/List.js +6 -0
- package/dist/atoms/LoadMore.d.ts +2 -0
- package/dist/atoms/LoadMore.js +25 -0
- package/dist/atoms/Loading.d.ts +2 -0
- package/dist/atoms/Loading.js +7 -0
- package/dist/atoms/PlatformMark.d.ts +2 -0
- package/dist/atoms/PlatformMark.js +4 -0
- package/dist/atoms/RelationLink.d.ts +2 -0
- package/dist/atoms/RelationLink.js +6 -0
- package/dist/atoms/Row.d.ts +3 -0
- package/dist/atoms/Row.js +30 -0
- package/dist/atoms/RowMenu.d.ts +2 -0
- package/dist/atoms/RowMenu.js +112 -0
- package/dist/atoms/StatusBadge.d.ts +2 -0
- package/dist/atoms/StatusBadge.js +7 -0
- package/dist/atoms/StatusMarker.d.ts +2 -0
- package/dist/atoms/StatusMarker.js +19 -0
- package/dist/atoms/Tag.d.ts +2 -0
- package/dist/atoms/Tag.js +13 -0
- package/dist/atoms/TickBox.d.ts +2 -0
- package/dist/atoms/TickBox.js +8 -0
- package/dist/atoms/defaults.d.ts +2 -0
- package/dist/atoms/defaults.js +27 -0
- package/dist/atoms/tones.d.ts +5 -0
- package/dist/atoms/tones.js +28 -0
- package/dist/atoms/types.d.ts +178 -0
- package/dist/atoms/types.js +3 -0
- package/dist/cells/cell-format.d.ts +138 -0
- package/dist/cells/cell-format.js +16 -0
- package/dist/cells/cell-title.d.ts +17 -0
- package/dist/cells/cell-title.js +8 -0
- package/dist/cells/cell-values.d.ts +28 -0
- package/dist/cells/cell-values.js +87 -0
- package/dist/cells/index.d.ts +4 -0
- package/dist/cells/index.js +4 -0
- package/dist/cells/legacy-field.d.ts +52 -0
- package/dist/cells/legacy-field.js +164 -0
- package/dist/cells/relation-wrap.d.ts +3 -0
- package/dist/cells/relation-wrap.js +24 -0
- package/dist/cells/use-cell-format.d.ts +5 -0
- package/dist/cells/use-cell-format.js +10 -0
- package/dist/contract.d.ts +461 -0
- package/dist/contract.js +682 -0
- package/dist/display/actor.d.ts +4 -0
- package/dist/display/actor.js +26 -0
- package/dist/display/boolean.d.ts +18 -0
- package/dist/display/boolean.js +43 -0
- package/dist/display/breakdown.d.ts +15 -0
- package/dist/display/breakdown.js +32 -0
- package/dist/display/currency.d.ts +9 -0
- package/dist/display/currency.js +29 -0
- package/dist/display/date.d.ts +12 -0
- package/dist/display/date.js +26 -0
- package/dist/display/display-cores.d.ts +31 -0
- package/dist/display/display-cores.js +57 -0
- package/dist/display/entity-chip.d.ts +26 -0
- package/dist/display/entity-chip.js +9 -0
- package/dist/display/format.d.ts +66 -0
- package/dist/display/format.js +190 -0
- package/dist/display/index.d.ts +8 -0
- package/dist/display/index.js +7 -0
- package/dist/display/link.d.ts +29 -0
- package/dist/display/link.js +50 -0
- package/dist/display/location.d.ts +8 -0
- package/dist/display/location.js +22 -0
- package/dist/display/multi-value.d.ts +18 -0
- package/dist/display/multi-value.js +28 -0
- package/dist/display/name.d.ts +6 -0
- package/dist/display/name.js +14 -0
- package/dist/display/number.d.ts +11 -0
- package/dist/display/number.js +27 -0
- package/dist/display/options.d.ts +153 -0
- package/dist/display/options.js +1 -0
- package/dist/display/percent.d.ts +4 -0
- package/dist/display/percent.js +40 -0
- package/dist/display/phone.d.ts +11 -0
- package/dist/display/phone.js +45 -0
- package/dist/display/range.d.ts +6 -0
- package/dist/display/range.js +29 -0
- package/dist/display/relation.d.ts +4 -0
- package/dist/display/relation.js +29 -0
- package/dist/display/rich-text.d.ts +10 -0
- package/dist/display/rich-text.js +34 -0
- package/dist/display/select.d.ts +6 -0
- package/dist/display/select.js +38 -0
- package/dist/display/text-class.d.ts +23 -0
- package/dist/display/text-class.js +5 -0
- package/dist/display/text.d.ts +19 -0
- package/dist/display/text.js +8 -0
- package/dist/display/use-display-options.d.ts +2 -0
- package/dist/display/use-display-options.js +14 -0
- package/dist/display/user.d.ts +11 -0
- package/dist/display/user.js +10 -0
- package/dist/display/value-list.d.ts +10 -0
- package/dist/display/value-list.js +12 -0
- package/dist/display/viewer.d.ts +4 -0
- package/dist/display/viewer.js +11 -0
- package/dist/display/web-href.d.ts +8 -0
- package/dist/display/web-href.js +12 -0
- package/dist/editors/ChipsEditor.d.ts +59 -0
- package/dist/editors/ChipsEditor.js +73 -0
- package/dist/editors/DateEditor.d.ts +25 -0
- package/dist/editors/DateEditor.js +122 -0
- package/dist/editors/LocationEditor.d.ts +22 -0
- package/dist/editors/LocationEditor.js +228 -0
- package/dist/editors/NameEditor.d.ts +22 -0
- package/dist/editors/NameEditor.js +92 -0
- package/dist/editors/NumberEditor.d.ts +67 -0
- package/dist/editors/NumberEditor.js +86 -0
- package/dist/editors/RangeEditor.d.ts +22 -0
- package/dist/editors/RangeEditor.js +70 -0
- package/dist/editors/RelationEditor.d.ts +65 -0
- package/dist/editors/RelationEditor.js +64 -0
- package/dist/editors/SelectEditor.d.ts +72 -0
- package/dist/editors/SelectEditor.js +59 -0
- package/dist/editors/ValueListEditor.d.ts +38 -0
- package/dist/editors/ValueListEditor.js +217 -0
- package/dist/editors/edit-cores.d.ts +83 -0
- package/dist/editors/edit-cores.js +38 -0
- package/dist/editors/edit-session.d.ts +74 -0
- package/dist/editors/edit-session.js +35 -0
- package/dist/editors/open-values.d.ts +28 -0
- package/dist/editors/open-values.js +26 -0
- package/dist/editors/relation-source.d.ts +66 -0
- package/dist/editors/relation-source.js +102 -0
- package/dist/fields/binding.d.ts +87 -0
- package/dist/fields/binding.js +117 -0
- package/dist/fields/currency.d.ts +82 -0
- package/dist/fields/currency.js +41 -0
- package/dist/fields/denomination.d.ts +42 -0
- package/dist/fields/denomination.js +11 -0
- package/dist/fields/edit-core-types.d.ts +40 -0
- package/dist/fields/edit-core-types.js +29 -0
- package/dist/fields/format-knobs.d.ts +34 -0
- package/dist/fields/format-knobs.js +36 -0
- package/dist/fields/menus.d.ts +28 -0
- package/dist/fields/menus.js +1 -0
- package/dist/fields/money.d.ts +60 -0
- package/dist/fields/money.js +78 -0
- package/dist/fields/number-edit.d.ts +11 -0
- package/dist/fields/number-edit.js +17 -0
- package/dist/fields/prepare-write.d.ts +55 -0
- package/dist/fields/prepare-write.js +67 -0
- package/dist/fields/relation-source-types.d.ts +54 -0
- package/dist/fields/relation-source-types.js +1 -0
- package/dist/figures.d.ts +52 -0
- package/dist/figures.js +63 -0
- package/dist/filters/date-filter.d.ts +2 -0
- package/dist/filters/date-filter.js +1 -0
- package/dist/filters/filter-model.d.ts +176 -0
- package/dist/filters/filter-model.js +41 -0
- package/dist/filters/number-filter.d.ts +2 -0
- package/dist/filters/number-filter.js +1 -0
- package/dist/filters/range-filter.d.ts +2 -0
- package/dist/filters/range-filter.js +1 -0
- package/dist/filters/registry.d.ts +103 -0
- package/dist/filters/registry.js +8 -0
- package/dist/filters/relation-filter.d.ts +16 -0
- package/dist/filters/relation-filter.js +53 -0
- package/dist/filters/text-filter.d.ts +2 -0
- package/dist/filters/text-filter.js +1 -0
- package/dist/grid/chrome/GridAddColumn.d.ts +11 -0
- package/dist/grid/chrome/GridAddColumn.js +29 -0
- package/dist/grid/chrome/GridAggregateMenu.d.ts +31 -0
- package/dist/grid/chrome/GridAggregateMenu.js +27 -0
- package/dist/grid/chrome/GridCellEditors.d.ts +64 -0
- package/dist/grid/chrome/GridCellEditors.js +55 -0
- package/dist/grid/chrome/GridCellOutline.d.ts +70 -0
- package/dist/grid/chrome/GridCellOutline.js +21 -0
- package/dist/grid/chrome/GridChipsEditor.d.ts +28 -0
- package/dist/grid/chrome/GridChipsEditor.js +40 -0
- package/dist/grid/chrome/GridColumnColorSection.d.ts +11 -0
- package/dist/grid/chrome/GridColumnColorSection.js +40 -0
- package/dist/grid/chrome/GridColumnDateSection.d.ts +23 -0
- package/dist/grid/chrome/GridColumnDateSection.js +23 -0
- package/dist/grid/chrome/GridColumnDurationSection.d.ts +19 -0
- package/dist/grid/chrome/GridColumnDurationSection.js +24 -0
- package/dist/grid/chrome/GridColumnMenu.d.ts +101 -0
- package/dist/grid/chrome/GridColumnMenu.js +99 -0
- package/dist/grid/chrome/GridColumnNumberSection.d.ts +25 -0
- package/dist/grid/chrome/GridColumnNumberSection.js +27 -0
- package/dist/grid/chrome/GridColumnPercentSection.d.ts +15 -0
- package/dist/grid/chrome/GridColumnPercentSection.js +16 -0
- package/dist/grid/chrome/GridColumnSortSection.d.ts +18 -0
- package/dist/grid/chrome/GridColumnSortSection.js +16 -0
- package/dist/grid/chrome/GridDateEditor.d.ts +22 -0
- package/dist/grid/chrome/GridDateEditor.js +31 -0
- package/dist/grid/chrome/GridFlyout.d.ts +44 -0
- package/dist/grid/chrome/GridFlyout.js +80 -0
- package/dist/grid/chrome/GridFooter.d.ts +23 -0
- package/dist/grid/chrome/GridFooter.js +81 -0
- package/dist/grid/chrome/GridGroupMenu.d.ts +37 -0
- package/dist/grid/chrome/GridGroupMenu.js +57 -0
- package/dist/grid/chrome/GridHeader.d.ts +61 -0
- package/dist/grid/chrome/GridHeader.js +37 -0
- package/dist/grid/chrome/GridLongTextEditor.d.ts +36 -0
- package/dist/grid/chrome/GridLongTextEditor.js +127 -0
- package/dist/grid/chrome/GridMenuRow.d.ts +15 -0
- package/dist/grid/chrome/GridMenuRow.js +15 -0
- package/dist/grid/chrome/GridNameEditor.d.ts +19 -0
- package/dist/grid/chrome/GridNameEditor.js +36 -0
- package/dist/grid/chrome/GridNumberEditor.d.ts +35 -0
- package/dist/grid/chrome/GridNumberEditor.js +25 -0
- package/dist/grid/chrome/GridRangeEditor.d.ts +20 -0
- package/dist/grid/chrome/GridRangeEditor.js +25 -0
- package/dist/grid/chrome/GridRelationEditor.d.ts +21 -0
- package/dist/grid/chrome/GridRelationEditor.js +30 -0
- package/dist/grid/chrome/GridResizeHandle.d.ts +19 -0
- package/dist/grid/chrome/GridResizeHandle.js +19 -0
- package/dist/grid/chrome/GridRow.d.ts +25 -0
- package/dist/grid/chrome/GridRow.js +136 -0
- package/dist/grid/chrome/GridRowActions.d.ts +32 -0
- package/dist/grid/chrome/GridRowActions.js +25 -0
- package/dist/grid/chrome/GridRowCells.d.ts +4 -0
- package/dist/grid/chrome/GridRowCells.js +133 -0
- package/dist/grid/chrome/GridRowGlyph.d.ts +12 -0
- package/dist/grid/chrome/GridRowGlyph.js +13 -0
- package/dist/grid/chrome/GridSelectEditor.d.ts +18 -0
- package/dist/grid/chrome/GridSelectEditor.js +49 -0
- package/dist/grid/chrome/GridStructure.d.ts +48 -0
- package/dist/grid/chrome/GridStructure.js +45 -0
- package/dist/grid/chrome/GridTable.d.ts +4 -0
- package/dist/grid/chrome/GridTable.js +125 -0
- package/dist/grid/chrome/GridTableSurface.d.ts +15 -0
- package/dist/grid/chrome/GridTableSurface.js +6 -0
- package/dist/grid/chrome/GridTextEditor.d.ts +11 -0
- package/dist/grid/chrome/GridTextEditor.js +40 -0
- package/dist/grid/chrome/GridValueListEditor.d.ts +18 -0
- package/dist/grid/chrome/GridValueListEditor.js +36 -0
- package/dist/grid/chrome/StuckMarker.d.ts +16 -0
- package/dist/grid/chrome/StuckMarker.js +34 -0
- package/dist/grid/chrome/cell-clipboard.d.ts +9 -0
- package/dist/grid/chrome/cell-clipboard.js +28 -0
- package/dist/grid/chrome/cells.d.ts +21 -0
- package/dist/grid/chrome/cells.js +20 -0
- package/dist/grid/chrome/checks.d.ts +35 -0
- package/dist/grid/chrome/checks.js +22 -0
- package/dist/grid/chrome/column-glyph.d.ts +14 -0
- package/dist/grid/chrome/column-glyph.js +44 -0
- package/dist/grid/chrome/editors.d.ts +9 -0
- package/dist/grid/chrome/editors.js +10 -0
- package/dist/grid/chrome/grid-cell-classes.d.ts +59 -0
- package/dist/grid/chrome/grid-cell-classes.js +30 -0
- package/dist/grid/chrome/grid-menu-search.d.ts +7 -0
- package/dist/grid/chrome/grid-menu-search.js +7 -0
- package/dist/grid/chrome/grid-row-props.d.ts +131 -0
- package/dist/grid/chrome/grid-row-props.js +1 -0
- package/dist/grid/chrome/grid-styles.d.ts +37 -0
- package/dist/grid/chrome/grid-styles.js +8 -0
- package/dist/grid/chrome/grid-table-props.d.ts +173 -0
- package/dist/grid/chrome/grid-table-props.js +1 -0
- package/dist/grid/chrome/useGridBatchApi.d.ts +34 -0
- package/dist/grid/chrome/useGridBatchApi.js +35 -0
- package/dist/grid/chrome/useGridColumnLayout.d.ts +30 -0
- package/dist/grid/chrome/useGridColumnLayout.js +206 -0
- package/dist/grid/chrome/useGridHeaderDrag.d.ts +20 -0
- package/dist/grid/chrome/useGridHeaderDrag.js +37 -0
- package/dist/grid/chrome/useGridKeyboard.d.ts +47 -0
- package/dist/grid/chrome/useGridKeyboard.js +274 -0
- package/dist/grid/chrome/useGridPendingReconciliation.d.ts +12 -0
- package/dist/grid/chrome/useGridPendingReconciliation.js +32 -0
- package/dist/grid/chrome/useGridRailReveal.d.ts +57 -0
- package/dist/grid/chrome/useGridRailReveal.js +67 -0
- package/dist/grid/chrome/useGridRangeActions.d.ts +49 -0
- package/dist/grid/chrome/useGridRangeActions.js +188 -0
- package/dist/grid/chrome/useGridRangeGestures.d.ts +32 -0
- package/dist/grid/chrome/useGridRangeGestures.js +190 -0
- package/dist/grid/chrome/useGridRowContextMenu.d.ts +35 -0
- package/dist/grid/chrome/useGridRowContextMenu.js +127 -0
- package/dist/grid/chrome/useGridScaleStyles.d.ts +1 -0
- package/dist/grid/chrome/useGridScaleStyles.js +29 -0
- package/dist/grid/chrome/useGridScrollSync.d.ts +38 -0
- package/dist/grid/chrome/useGridScrollSync.js +176 -0
- package/dist/grid/chrome/useGridTableInteractionModel.d.ts +55 -0
- package/dist/grid/chrome/useGridTableInteractionModel.js +197 -0
- package/dist/grid/chrome/useGridTableSelection.d.ts +29 -0
- package/dist/grid/chrome/useGridTableSelection.js +55 -0
- package/dist/grid/chrome/useHeaderDragReorder.d.ts +21 -0
- package/dist/grid/chrome/useHeaderDragReorder.js +216 -0
- package/dist/grid/core/clipboard-model.d.ts +81 -0
- package/dist/grid/core/clipboard-model.js +291 -0
- package/dist/grid/core/column-values.d.ts +27 -0
- package/dist/grid/core/column-values.js +76 -0
- package/dist/grid/core/commit-model.d.ts +34 -0
- package/dist/grid/core/commit-model.js +3 -0
- package/dist/grid/core/coordinates.d.ts +48 -0
- package/dist/grid/core/coordinates.js +27 -0
- package/dist/grid/core/edit-values.d.ts +9 -0
- package/dist/grid/core/edit-values.js +1 -0
- package/dist/grid/core/editing-controller.d.ts +59 -0
- package/dist/grid/core/editing-controller.js +240 -0
- package/dist/grid/core/editing-model.d.ts +78 -0
- package/dist/grid/core/editing-model.js +136 -0
- package/dist/grid/core/grid-scale.d.ts +14 -0
- package/dist/grid/core/grid-scale.js +8 -0
- package/dist/grid/core/nav.d.ts +94 -0
- package/dist/grid/core/nav.js +92 -0
- package/dist/grid/core/pending-reconciliation.d.ts +50 -0
- package/dist/grid/core/pending-reconciliation.js +49 -0
- package/dist/grid/core/range-model.d.ts +25 -0
- package/dist/grid/core/range-model.js +59 -0
- package/dist/grid/core/spreadsheet-operations.d.ts +85 -0
- package/dist/grid/core/spreadsheet-operations.js +253 -0
- package/dist/grid/core/useGridEditing.d.ts +43 -0
- package/dist/grid/core/useGridEditing.js +90 -0
- package/dist/grid/core/useGridRange.d.ts +20 -0
- package/dist/grid/core/useGridRange.js +24 -0
- package/dist/grid/core/value-equality.d.ts +32 -0
- package/dist/grid/core/value-equality.js +34 -0
- package/dist/grid/index.d.ts +18 -0
- package/dist/grid/index.js +5 -0
- package/dist/grid/useGridTablePrefs.d.ts +50 -0
- package/dist/grid/useGridTablePrefs.js +101 -0
- package/dist/grouping/sort-groups.d.ts +18 -0
- package/dist/grouping/sort-groups.js +33 -0
- package/dist/grouping/types.d.ts +10 -0
- package/dist/grouping/types.js +1 -0
- package/dist/index.d.ts +28 -0
- package/dist/index.js +28 -0
- package/dist/internal/chip.d.ts +4 -0
- package/dist/internal/chip.js +3 -0
- package/dist/internal/cx.d.ts +3 -0
- package/dist/internal/cx.js +3 -0
- package/dist/internal/viewport.d.ts +5 -0
- package/dist/internal/viewport.js +29 -0
- package/dist/model/aggregates.d.ts +59 -0
- package/dist/model/aggregates.js +186 -0
- package/dist/model/card-density.d.ts +8 -0
- package/dist/model/card-density.js +10 -0
- package/dist/model/card-layout.d.ts +85 -0
- package/dist/model/card-layout.js +90 -0
- package/dist/model/column-capabilities.d.ts +162 -0
- package/dist/model/column-capabilities.js +233 -0
- package/dist/model/column-filters.d.ts +106 -0
- package/dist/model/column-filters.js +321 -0
- package/dist/model/column-format.d.ts +103 -0
- package/dist/model/column-format.js +1 -0
- package/dist/model/column-from.d.ts +28 -0
- package/dist/model/column-from.js +160 -0
- package/dist/model/column-inspect.d.ts +18 -0
- package/dist/model/column-inspect.js +6 -0
- package/dist/model/column-knobs.d.ts +20 -0
- package/dist/model/column-knobs.js +16 -0
- package/dist/model/column-money.d.ts +13 -0
- package/dist/model/column-money.js +27 -0
- package/dist/model/column-order.d.ts +36 -0
- package/dist/model/column-order.js +68 -0
- package/dist/model/column-schema.d.ts +335 -0
- package/dist/model/column-schema.js +1 -0
- package/dist/model/column-sort.d.ts +17 -0
- package/dist/model/column-sort.js +11 -0
- package/dist/model/column-state.d.ts +77 -0
- package/dist/model/column-state.js +95 -0
- package/dist/model/column-types.d.ts +109 -0
- package/dist/model/column-types.js +50 -0
- package/dist/model/column-warnings.d.ts +44 -0
- package/dist/model/column-warnings.js +24 -0
- package/dist/model/density.d.ts +3 -0
- package/dist/model/density.js +13 -0
- package/dist/model/field-type-of.d.ts +21 -0
- package/dist/model/field-type-of.js +11 -0
- package/dist/model/filter-capabilities.d.ts +1 -0
- package/dist/model/filter-capabilities.js +1 -0
- package/dist/model/index.d.ts +38 -0
- package/dist/model/index.js +20 -0
- package/dist/model/part-rows.d.ts +28 -0
- package/dist/model/part-rows.js +40 -0
- package/dist/model/preferences.d.ts +155 -0
- package/dist/model/preferences.js +84 -0
- package/dist/model/prefs-buckets.d.ts +173 -0
- package/dist/model/prefs-buckets.js +71 -0
- package/dist/model/relation-filters.d.ts +45 -0
- package/dist/model/relation-filters.js +78 -0
- package/dist/model/render-count.d.ts +2 -0
- package/dist/model/render-count.js +24 -0
- package/dist/model/row-icon.d.ts +23 -0
- package/dist/model/row-icon.js +5 -0
- package/dist/model/view-rules.d.ts +73 -0
- package/dist/model/view-rules.js +216 -0
- package/dist/provider/ViewsProvider.d.ts +26 -0
- package/dist/provider/ViewsProvider.js +16 -0
- package/dist/provider/components.d.ts +230 -0
- package/dist/provider/components.js +3 -0
- package/dist/provider/context.d.ts +20 -0
- package/dist/provider/context.js +10 -0
- package/dist/provider/icons.d.ts +6 -0
- package/dist/provider/icons.js +1 -0
- package/dist/provider/menu-groups.d.ts +8 -0
- package/dist/provider/menu-groups.js +38 -0
- package/dist/provider/ports.d.ts +57 -0
- package/dist/provider/ports.js +9 -0
- package/dist/react.d.ts +9 -0
- package/dist/react.js +4 -0
- package/dist/selection/SelectCheckbox.d.ts +17 -0
- package/dist/selection/SelectCheckbox.js +11 -0
- package/dist/selection/index.d.ts +7 -0
- package/dist/selection/index.js +6 -0
- package/dist/selection/model.d.ts +55 -0
- package/dist/selection/model.js +86 -0
- package/dist/selection/row-click.d.ts +35 -0
- package/dist/selection/row-click.js +20 -0
- package/dist/selection/types.d.ts +17 -0
- package/dist/selection/types.js +1 -0
- package/dist/selection/useCheckDragSelect.d.ts +61 -0
- package/dist/selection/useCheckDragSelect.js +165 -0
- package/dist/selection/useListSelection.d.ts +39 -0
- package/dist/selection/useListSelection.js +48 -0
- package/dist/selection/useListSelectionShortcuts.d.ts +6 -0
- package/dist/selection/useListSelectionShortcuts.js +14 -0
- package/dist/selection/useRestIntent.d.ts +18 -0
- package/dist/selection/useRestIntent.js +35 -0
- package/docs/contract.md +525 -0
- package/docs/getting-started.md +250 -0
- package/docs/guides/atoms.md +245 -0
- package/docs/guides/cells.md +302 -0
- package/docs/guides/columns.md +412 -0
- package/docs/guides/display.md +203 -0
- package/docs/guides/editors.md +404 -0
- package/docs/guides/ports.md +246 -0
- package/docs/guides/selection.md +270 -0
- package/docs/guides/the-grid.md +677 -0
- package/docs/guides/the-provider.md +446 -0
- package/docs/index.md +50 -0
- package/docs/install.md +67 -0
- package/docs/reference/cells.md +28 -0
- package/docs/reference/display.md +42 -0
- package/docs/reference/editors-chips.md +6 -0
- package/docs/reference/editors-date.md +6 -0
- package/docs/reference/editors-location.md +10 -0
- package/docs/reference/editors-name.md +6 -0
- package/docs/reference/editors-number.md +11 -0
- package/docs/reference/editors-open-values.md +9 -0
- package/docs/reference/editors-range.md +6 -0
- package/docs/reference/editors-relation.md +9 -0
- package/docs/reference/editors-select.md +8 -0
- package/docs/reference/editors-session.md +9 -0
- package/docs/reference/editors-value-list.md +6 -0
- package/docs/reference/editors.md +5 -0
- package/docs/reference/grid.md +39 -0
- package/docs/reference/react.md +86 -0
- package/docs/reference/selection.md +33 -0
- package/docs/reference/views.md +601 -0
- package/docs/reshaping.md +19 -0
- package/package.json +118 -3
- package/skills/views/SKILL.md +102 -0
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import { useEffect, useRef } from "react";
|
|
4
|
+
export function StuckMarker() {
|
|
5
|
+
const ref = useRef(null);
|
|
6
|
+
useEffect(() => {
|
|
7
|
+
const marker = ref.current;
|
|
8
|
+
const header = marker?.nextElementSibling;
|
|
9
|
+
if (!marker || !header)
|
|
10
|
+
return;
|
|
11
|
+
let raf = 0;
|
|
12
|
+
const apply = () => {
|
|
13
|
+
raf = 0;
|
|
14
|
+
const stuck = header.getBoundingClientRect().top - marker.getBoundingClientRect().top > 0.5;
|
|
15
|
+
if ((header.dataset.stuck === "true") !== stuck)
|
|
16
|
+
header.dataset.stuck = String(stuck);
|
|
17
|
+
};
|
|
18
|
+
const schedule = () => {
|
|
19
|
+
if (!raf)
|
|
20
|
+
raf = requestAnimationFrame(apply);
|
|
21
|
+
};
|
|
22
|
+
apply();
|
|
23
|
+
window.addEventListener("scroll", schedule, true);
|
|
24
|
+
window.addEventListener("resize", schedule);
|
|
25
|
+
return () => {
|
|
26
|
+
window.removeEventListener("scroll", schedule, true);
|
|
27
|
+
window.removeEventListener("resize", schedule);
|
|
28
|
+
if (raf)
|
|
29
|
+
cancelAnimationFrame(raf);
|
|
30
|
+
delete header.dataset.stuck;
|
|
31
|
+
};
|
|
32
|
+
}, []);
|
|
33
|
+
return _jsx("div", { ref: ref, "aria-hidden": true, className: "h-0" });
|
|
34
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { ViewsClipboardPort } from "../../provider/ports.js";
|
|
2
|
+
import { type GridCellClipboard, type GridClipboardCell } from "../core/clipboard-model.js";
|
|
3
|
+
import type { ListColumn } from "../../model/column-schema.js";
|
|
4
|
+
export { cellClearPrev, cellEditBaseline, cellPrevPayload, rowHoldsCurrency, coercePaste, parseTsvText, type GridPasteSource, } from "../core/clipboard-model.js";
|
|
5
|
+
export declare function getGridClipboard(): GridCellClipboard | null;
|
|
6
|
+
/** Puts one cell's text on the system clipboard through the app's port, and keeps the typed entry
|
|
7
|
+
* the grid pastes from — which survives a refused system write. */
|
|
8
|
+
export declare function copyCell<Row>(write: ViewsClipboardPort["writeText"], col: ListColumn<Row>, baseline: unknown, unit?: string): Promise<string>;
|
|
9
|
+
export declare function copyCells(write: ViewsClipboardPort["writeText"], matrix: GridClipboardCell[][]): Promise<string>;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { cellCopyText, serializeClipboardMatrix, } from "../core/clipboard-model.js";
|
|
2
|
+
export { cellClearPrev, cellEditBaseline, cellPrevPayload, rowHoldsCurrency, coercePaste, parseTsvText, } from "../core/clipboard-model.js";
|
|
3
|
+
let clipboard = null;
|
|
4
|
+
export function getGridClipboard() {
|
|
5
|
+
return clipboard;
|
|
6
|
+
}
|
|
7
|
+
export async function copyCell(write, col, baseline, unit) {
|
|
8
|
+
const text = cellCopyText(col, baseline);
|
|
9
|
+
clipboard = { text, value: baseline, type: col.type, unit };
|
|
10
|
+
try {
|
|
11
|
+
await write(text);
|
|
12
|
+
}
|
|
13
|
+
catch {
|
|
14
|
+
}
|
|
15
|
+
return text;
|
|
16
|
+
}
|
|
17
|
+
export async function copyCells(write, matrix) {
|
|
18
|
+
if (matrix.length === 0 || matrix[0].length === 0)
|
|
19
|
+
return "";
|
|
20
|
+
const text = serializeClipboardMatrix(matrix);
|
|
21
|
+
clipboard = { ...matrix[0][0], text, matrix };
|
|
22
|
+
try {
|
|
23
|
+
await write(text);
|
|
24
|
+
}
|
|
25
|
+
catch {
|
|
26
|
+
}
|
|
27
|
+
return text;
|
|
28
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { ReactNode } from "react";
|
|
2
|
+
import type { GridCellOptions } from "../../cells/cell-format.js";
|
|
3
|
+
import type { ListColumn } from "../../model/column-schema.js";
|
|
4
|
+
export { formatDate, formatNumber } from "../../cells/cell-format.js";
|
|
5
|
+
/**
|
|
6
|
+
* Renders a typed cell, then appends the column's `indicator` if it has one.
|
|
7
|
+
*
|
|
8
|
+
* `indicator` is declared on EVERY column in the schema but used to be read only
|
|
9
|
+
* inside the `title` branch — so it looked generic and was honoured by exactly
|
|
10
|
+
* one type. That gap is why a column needing a per-row adornment (Subscriptions'
|
|
11
|
+
* next-charge urgency) reached for a full custom `render` instead, throwing away
|
|
12
|
+
* the typed renderer's date formatting and hover tooltip to get it.
|
|
13
|
+
*
|
|
14
|
+
* `title` still places its own indicator: its cell has layout rules about where
|
|
15
|
+
* the click target ends, and the adornment has to sit inside them.
|
|
16
|
+
*/
|
|
17
|
+
export declare function renderTypedCell<Row>(col: ListColumn<Row>, row: Row, opts?: GridCellOptions): ReactNode;
|
|
18
|
+
/** Renders an `action` column's cell — a centered row of icon buttons. Real
|
|
19
|
+
* `<button>`s so GridRow's click contract treats them as interactive (the row
|
|
20
|
+
* does not open / select on an action click). */
|
|
21
|
+
export declare function renderActionCell<Row>(col: ListColumn<Row>, row: Row): ReactNode;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { cx } from "../../internal/cx.js";
|
|
4
|
+
import { GridActionButton } from "./GridRowActions.js";
|
|
5
|
+
import { renderTypedCellValue } from "../../cells/cell-values.js";
|
|
6
|
+
export { formatDate, formatNumber } from "../../cells/cell-format.js";
|
|
7
|
+
export function renderTypedCell(col, row, opts) {
|
|
8
|
+
const cell = renderTypedCellValue(col, row, opts);
|
|
9
|
+
if (col.type === "title")
|
|
10
|
+
return cell;
|
|
11
|
+
const indicator = col.indicator?.(row);
|
|
12
|
+
if (!indicator)
|
|
13
|
+
return cell;
|
|
14
|
+
return (_jsxs("span", { className: cx("flex min-w-0 flex-1 flex-wrap content-start items-center gap-x-1.5 overflow-hidden", !opts?.wrap && "h-(--vk-line-h) leading-(--vk-line-h)"), children: [_jsx("span", { className: cx("max-w-full", opts?.wrap ? "min-w-0" : "flex-none truncate"), children: cell }), indicator] }));
|
|
15
|
+
}
|
|
16
|
+
export function renderActionCell(col, row) {
|
|
17
|
+
if (!col.actions?.length)
|
|
18
|
+
return null;
|
|
19
|
+
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))) }));
|
|
20
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/** Empty rail segment — keeps the opaque lane continuous across the header and
|
|
2
|
+
* footer rows, which have no checkbox of their own. `bordered` follows whether
|
|
3
|
+
* that surface's own cells draw a bottom rule: the header's do, the footer's
|
|
4
|
+
* don't. */
|
|
5
|
+
export declare function GridRailSpacer({ selecting, bordered, }: {
|
|
6
|
+
selecting: boolean;
|
|
7
|
+
bordered?: boolean;
|
|
8
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
/** Row checkbox — reveals while the row (`group/gridrow`) is hovered. */
|
|
10
|
+
export declare function GridRowCheck({ selecting, checked, revealed, onChange, "aria-label": ariaLabel, }: {
|
|
11
|
+
selecting: boolean;
|
|
12
|
+
checked: boolean;
|
|
13
|
+
revealed: boolean;
|
|
14
|
+
onChange: (next: boolean, shift: boolean) => void;
|
|
15
|
+
"aria-label"?: string;
|
|
16
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
17
|
+
/**
|
|
18
|
+
* Select-all / group checkbox — the SAME rail slot the rows use, mounted as the
|
|
19
|
+
* header's leading track rather than as an overlay beside it.
|
|
20
|
+
*
|
|
21
|
+
* It used to be a page-anchored overlay, on the reasoning that the header strip
|
|
22
|
+
* sits outside the scrollers and its cells were slid by JS, so a checkbox in the
|
|
23
|
+
* flow would have had to be counter-translated. Both halves of that stopped
|
|
24
|
+
* being true: the strip is a real scroll container now, and the rail travels
|
|
25
|
+
* with its row instead of standing still. An overlay would be the one piece of
|
|
26
|
+
* leading chrome that didn't move — parked at a fixed x while every row's
|
|
27
|
+
* checkbox slid away from it and stopped somewhere else.
|
|
28
|
+
*/
|
|
29
|
+
export declare function GridHeadCheck({ selecting, allSelected, someSelected, onToggle, "aria-label": ariaLabel, }: {
|
|
30
|
+
selecting: boolean;
|
|
31
|
+
allSelected: boolean;
|
|
32
|
+
someSelected: boolean;
|
|
33
|
+
onToggle: (next: boolean) => void;
|
|
34
|
+
"aria-label"?: string;
|
|
35
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { useViews } from "../../provider/context.js";
|
|
4
|
+
import { cx } from "../../internal/cx.js";
|
|
5
|
+
import { gridFrozenBg } from "./GridCellOutline.js";
|
|
6
|
+
import { GRID_GROUND } from "./grid-styles.js";
|
|
7
|
+
import { SelectCheckbox } from "../../selection/SelectCheckbox.js";
|
|
8
|
+
function RailSlot({ selecting, selected = false, bordered = false, children, }) {
|
|
9
|
+
return (_jsx("div", { "data-slot": "vk-grid-rail", className: "sticky left-(--vk-rail-w) z-10 h-full", "data-action-menu": true, onClick: (e) => e.stopPropagation(), children: _jsxs("div", { "data-row-check": selecting ? "" : undefined, className: cx("relative flex h-full w-[calc(var(--vk-gutter,0px)+var(--vk-indent,0px))] -translate-x-full items-start justify-end", "pr-[calc(var(--vk-rail-gap)+((var(--vk-rail-w)-16px)/2-var(--vk-rail-gap))*var(--vk-parked,0)*(1-var(--vk-frozen-on,0)))]", "transition-[padding-right] duration-150"), children: [_jsx("span", { "aria-hidden": true, className: cx("absolute inset-0", gridFrozenBg(selected), "opacity-(--vk-frozen-on,0) transition-opacity duration-150", "group-data-[rail=on]/gridtable:opacity-100") }), bordered && (_jsx("span", { "aria-hidden": true, className: cx("pointer-events-none absolute inset-x-0 bottom-0 h-px bg-(color:--vk-border-subtle) transition-opacity duration-150", "opacity-[calc(var(--vk-parked,0)*var(--vk-frozen-on,0))]", "group-data-[rail=on]/gridtable:opacity-(--vk-parked,0)") })), children ? (_jsx("span", { "data-row-check": true, className: "relative flex h-(--vk-chrome-h,100%) items-center", children: children })) : null] }) }));
|
|
10
|
+
}
|
|
11
|
+
export function GridRailSpacer({ selecting, bordered = false, }) {
|
|
12
|
+
return _jsx(RailSlot, { selecting: selecting, bordered: bordered });
|
|
13
|
+
}
|
|
14
|
+
export function GridRowCheck({ selecting, checked, revealed, onChange, "aria-label": ariaLabel, }) {
|
|
15
|
+
return (_jsx(RailSlot, { selecting: selecting, selected: checked, bordered: true, children: _jsx(SelectCheckbox, { checked: checked, revealed: revealed, onChange: onChange, "aria-label": ariaLabel, className: cx(GRID_GROUND, "transition-opacity duration-150 group-hover/gridrow:opacity-100 group-data-[rail=on]/gridtable:opacity-100") }) }));
|
|
16
|
+
}
|
|
17
|
+
export function GridHeadCheck({ selecting, allSelected, someSelected, onToggle, "aria-label": ariaLabel, }) {
|
|
18
|
+
const { Checkbox } = useViews().components;
|
|
19
|
+
return (_jsx(RailSlot, { selecting: selecting, bordered: true, children: _jsx(Checkbox, { checked: allSelected, indeterminate: !allSelected && someSelected, onCheckedChange: (next) => onToggle(next), "aria-label": ariaLabel, partialTone: "brand", className: cx(cx(GRID_GROUND, "transition-opacity duration-150"), selecting || allSelected || someSelected
|
|
20
|
+
? "opacity-100"
|
|
21
|
+
: "opacity-0 group-hover/gridhead:opacity-100 group-data-[rail=on]/gridtable:opacity-100") }) }));
|
|
22
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { ComponentType, ReactNode } from "react";
|
|
2
|
+
import type { ListColumn } from "../../model/column-schema.js";
|
|
3
|
+
import type { ViewsIcons } from "../../provider/icons.js";
|
|
4
|
+
type GridGlyphs = {
|
|
5
|
+
icons: ViewsIcons;
|
|
6
|
+
AppIcon: ComponentType<{
|
|
7
|
+
name: string;
|
|
8
|
+
className?: string;
|
|
9
|
+
}>;
|
|
10
|
+
};
|
|
11
|
+
/** The column's glyph: its explicit `icon` → its binding's glyph → its field's type → a computed
|
|
12
|
+
* column's mark → its list type's → nothing. */
|
|
13
|
+
export declare function gridColumnGlyph<Row>({ icons, AppIcon }: GridGlyphs, col: ListColumn<Row>, className?: string): ReactNode;
|
|
14
|
+
export {};
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
const LIST_TYPE_GLYPHS = {
|
|
4
|
+
title: "text",
|
|
5
|
+
status: "status",
|
|
6
|
+
text: "text",
|
|
7
|
+
number: "number",
|
|
8
|
+
percent: "percent",
|
|
9
|
+
currency: "currency",
|
|
10
|
+
date: "date",
|
|
11
|
+
datetime: "datetime",
|
|
12
|
+
select: "select",
|
|
13
|
+
multiselect: "multiselect",
|
|
14
|
+
boolean: "boolean",
|
|
15
|
+
relation: "relation",
|
|
16
|
+
user: "user",
|
|
17
|
+
url: "url",
|
|
18
|
+
domain: "domain",
|
|
19
|
+
email: "email",
|
|
20
|
+
phone: "phone",
|
|
21
|
+
location: "location",
|
|
22
|
+
name: "name",
|
|
23
|
+
actor: "actor",
|
|
24
|
+
rich_text: "rich_text",
|
|
25
|
+
range: "range",
|
|
26
|
+
};
|
|
27
|
+
export function gridColumnGlyph({ icons, AppIcon }, col, className = "h-3.5 w-3.5 shrink-0 opacity-70") {
|
|
28
|
+
if (col.icon)
|
|
29
|
+
return col.icon;
|
|
30
|
+
if (col.binding?.icon)
|
|
31
|
+
return _jsx(AppIcon, { name: col.binding.icon, className: className });
|
|
32
|
+
if (col.field) {
|
|
33
|
+
const Glyph = icons[col.field.type];
|
|
34
|
+
return _jsx(Glyph, { className: className });
|
|
35
|
+
}
|
|
36
|
+
if (col.custom) {
|
|
37
|
+
const Glyph = icons.computed;
|
|
38
|
+
return _jsx(Glyph, { className: className });
|
|
39
|
+
}
|
|
40
|
+
if (!col.type)
|
|
41
|
+
return null;
|
|
42
|
+
const Glyph = icons[LIST_TYPE_GLYPHS[col.type]];
|
|
43
|
+
return _jsx(Glyph, { className: className });
|
|
44
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export { gridColumnHasEditor, gridEditorKind } from "../../model/column-capabilities.js";
|
|
2
|
+
export { GridTextEditor } from "./GridTextEditor.js";
|
|
3
|
+
export { GridLongTextEditor } from "./GridLongTextEditor.js";
|
|
4
|
+
export { GridSelectEditor } from "./GridSelectEditor.js";
|
|
5
|
+
export { GridChipsEditor } from "./GridChipsEditor.js";
|
|
6
|
+
export { GridNumberEditor } from "./GridNumberEditor.js";
|
|
7
|
+
export { GridRangeEditor } from "./GridRangeEditor.js";
|
|
8
|
+
export { GridDateEditor } from "./GridDateEditor.js";
|
|
9
|
+
export { GridRelationEditor } from "./GridRelationEditor.js";
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
export { gridColumnHasEditor, gridEditorKind } from "../../model/column-capabilities.js";
|
|
3
|
+
export { GridTextEditor } from "./GridTextEditor.js";
|
|
4
|
+
export { GridLongTextEditor } from "./GridLongTextEditor.js";
|
|
5
|
+
export { GridSelectEditor } from "./GridSelectEditor.js";
|
|
6
|
+
export { GridChipsEditor } from "./GridChipsEditor.js";
|
|
7
|
+
export { GridNumberEditor } from "./GridNumberEditor.js";
|
|
8
|
+
export { GridRangeEditor } from "./GridRangeEditor.js";
|
|
9
|
+
export { GridDateEditor } from "./GridDateEditor.js";
|
|
10
|
+
export { GridRelationEditor } from "./GridRelationEditor.js";
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import type { FieldSettlement } from "@viewkitjs/fields";
|
|
2
|
+
/**
|
|
3
|
+
* One body cell's class string.
|
|
4
|
+
*
|
|
5
|
+
* Extracted from `GridRowCells` because that file is held under the line ceiling
|
|
6
|
+
* and the policy there is split, not raise — and because this is the one part
|
|
7
|
+
* of the cell that is pure: a dozen booleans in, a string out. That makes the
|
|
8
|
+
* geometry testable without rendering a grid, which matters most for the wrap
|
|
9
|
+
* mode, whose whole contract is "the unwrapped string is unchanged".
|
|
10
|
+
*/
|
|
11
|
+
export type GridCellClassState = {
|
|
12
|
+
align?: "left" | "center" | "right";
|
|
13
|
+
/** The title column: an ordinary cell that holds the row-open hotspot (its
|
|
14
|
+
* rendered text), which the cell dresses as a link. */
|
|
15
|
+
isTitle: boolean;
|
|
16
|
+
/** Pinned to the left edge (inside the frozen block). */
|
|
17
|
+
frozen: boolean;
|
|
18
|
+
focused: boolean;
|
|
19
|
+
editing: boolean;
|
|
20
|
+
/** Inside the active multi-cell range. */
|
|
21
|
+
inRange: boolean;
|
|
22
|
+
/** The row is selected (frozen cells repaint the selection tint). */
|
|
23
|
+
selected: boolean;
|
|
24
|
+
/** Last visible column — its right border is always transparent. */
|
|
25
|
+
lastColumn: boolean;
|
|
26
|
+
verticalBorders: boolean;
|
|
27
|
+
/** Wrap mode: the cell grows with its content instead of clipping to one
|
|
28
|
+
* line, and its text top-aligns so line one still reads across the row. */
|
|
29
|
+
wrap: boolean;
|
|
30
|
+
/** The value is saved here but its provider has not accepted it yet (spec
|
|
31
|
+
* §11.2) — the one pending state the grid draws, beside `data-settlement`. */
|
|
32
|
+
settlement?: Extract<FieldSettlement, "requested">;
|
|
33
|
+
};
|
|
34
|
+
/** The row-open hotspot inside a title cell, dressed as a link on its own hover. */
|
|
35
|
+
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";
|
|
36
|
+
/** A ranged cell's tint: it covers the cell and reaches 1px past its trailing edges, bridging the
|
|
37
|
+
* hairlines between cells into one surface. `-z-1` lays it under the cell's value and over the
|
|
38
|
+
* cell's own ground, inside the stacking context every ranged cell is (its z, or sticky). */
|
|
39
|
+
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)";
|
|
40
|
+
export declare function gridCellClassName(state: GridCellClassState): string;
|
|
41
|
+
/** The row's own classes. A SELECTED row hovers brand, not neutral: hover and selected both write
|
|
42
|
+
* background-image, so the neutral tint would replace the selection, and the row would grey out
|
|
43
|
+
* under the pointer exactly where it should feel most active. A doubled brand mix keeps the hover
|
|
44
|
+
* a clear step up in the same colour. The host's class is the row's last word, as it was under the
|
|
45
|
+
* merge: where it paints the row's own ground (Domains' unregistered rows), the selected tint
|
|
46
|
+
* stands aside for it — only that one property conflicts; the hover is an image.
|
|
47
|
+
*
|
|
48
|
+
* The row owns the page gutter (px) — the checkbox reveals inside it at left-0 — so the table's
|
|
49
|
+
* left edge stays aligned with the page content; pl includes --vk-indent (grouped tables shift
|
|
50
|
+
* right as one unit). The hover tint is FLAT and full-bleed, a one-stop background-IMAGE rather
|
|
51
|
+
* than a colour so it layers OVER the selected ground; the same string as GRID_FROZEN_HOVER, so
|
|
52
|
+
* pinned and scrolling cells tint the same. In wrap mode `--vk-chrome-h` becomes the first-line
|
|
53
|
+
* strip, so the checkbox lane and the title's hover actions sit beside line one. */
|
|
54
|
+
export declare function gridRowClassName(state: {
|
|
55
|
+
selected: boolean;
|
|
56
|
+
selectable: boolean;
|
|
57
|
+
wrapCells: boolean;
|
|
58
|
+
hostClass?: string;
|
|
59
|
+
}): string;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { ROW_NO_TEXT_SELECT } from "../../selection/row-click.js";
|
|
2
|
+
import { cx } from "../../internal/cx.js";
|
|
3
|
+
import { GRID_CELL_HOVER_SHADOW, gridFrozenBg } from "./GridCellOutline.js";
|
|
4
|
+
import { GRID_GROUND } from "./grid-styles.js";
|
|
5
|
+
const GRID_CELL_REQUESTED = "italic opacity-80";
|
|
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_RANGE_TINT_CLASS = "pointer-events-none absolute left-0 top-0 -bottom-px -right-px -z-1 bg-(color:--vk-brand-subtlest)";
|
|
8
|
+
export function gridCellClassName(state) {
|
|
9
|
+
const { focused, editing, inRange, frozen, selected, wrap } = state;
|
|
10
|
+
return cx(state.settlement === "requested" && GRID_CELL_REQUESTED, "group/gridcell", "flex min-w-0 border-b border-r border-(color:--vk-border-subtle) px-(--vk-px) text-(length:--vk-text)", wrap
|
|
11
|
+
? "min-h-(--vk-row-h) items-start py-(--vk-cell-py) leading-(--vk-line-h) [&>*:not(.absolute)]:min-h-(--vk-line-h)"
|
|
12
|
+
: "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 ? "sticky" : "relative", focused || editing || inRange ? "overflow-visible" : "overflow-hidden", frozen
|
|
13
|
+
? focused || editing
|
|
14
|
+
? "z-9"
|
|
15
|
+
: inRange
|
|
16
|
+
? "z-[calc(8*var(--vk-scrolled,0))]"
|
|
17
|
+
: "z-[calc(7*var(--vk-scrolled,0))]"
|
|
18
|
+
: focused || editing
|
|
19
|
+
? "z-5"
|
|
20
|
+
: inRange
|
|
21
|
+
? "z-4"
|
|
22
|
+
: undefined, frozen && gridFrozenBg(selected), editing && GRID_GROUND, !focused && !editing && !inRange && !state.isTitle && GRID_CELL_HOVER_SHADOW, state.isTitle && GRID_TITLE_LINK_CLASS);
|
|
23
|
+
}
|
|
24
|
+
export function gridRowClassName(state) {
|
|
25
|
+
const { selected, selectable, wrapCells, hostClass } = state;
|
|
26
|
+
const hostPaintsGround = hostClass != null && /(?:^|\s)bg-/.test(hostClass);
|
|
27
|
+
return cx("group/gridrow relative grid cursor-pointer pl-[calc(var(--vk-gutter,0px)+var(--vk-indent,0px))] pr-(--vk-gutter,0px)", selectable && ROW_NO_TEXT_SELECT, wrapCells && "[--vk-chrome-h:var(--vk-row-h)]", selected
|
|
28
|
+
? "hover:bg-[linear-gradient(color-mix(in_oklab,_var(--vk-brand)_10%,_transparent),color-mix(in_oklab,_var(--vk-brand)_10%,_transparent))]"
|
|
29
|
+
: "hover:bg-[linear-gradient(var(--vk-hovered),var(--vk-hovered))]", selected && !hostPaintsGround && "bg-(color:--vk-brand-subtlest)", hostClass);
|
|
30
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/** How many options a grid menu lists before it offers a search: a group band's Sort rows. */
|
|
2
|
+
export declare const GRID_MENU_SEARCH_AFTER = 8;
|
|
3
|
+
/** The options a grid menu lists for a search: every one while the search is empty, else those whose label
|
|
4
|
+
* holds it. */
|
|
5
|
+
export declare function matchMenuOptions<O extends {
|
|
6
|
+
label: string;
|
|
7
|
+
}>(options: readonly O[], query: string): O[];
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
import type { ReactNode } from "react";
|
|
2
|
+
import type { ViewsRowMenuItem } from "../../atoms/types.js";
|
|
3
|
+
import type { FieldMenus } from "../../fields/menus.js";
|
|
4
|
+
import type { ListSettingsConfig } from "../../model/column-capabilities.js";
|
|
5
|
+
import type { ListCellAction, ListColumn, ListOptionColorOverrides, ListRelationValue } from "../../model/column-schema.js";
|
|
6
|
+
import type { ListDateStyleOverrides, ListDurationStyleOverrides, ListNumberFormatOverrides, ListPercentDisplayOverrides, ListShowTimeOverrides } from "../../model/column-format.js";
|
|
7
|
+
import type { ListRowIconAccessor } from "../../model/row-icon.js";
|
|
8
|
+
import type { GridRowRangeSpan } from "../core/useGridRange.js";
|
|
9
|
+
export type GridRowProps<Row> = {
|
|
10
|
+
row: Row;
|
|
11
|
+
/** The DATA id — what a write, the optimistic overlay and selection address.
|
|
12
|
+
* Shared by every copy of a row that is drawn more than once. */
|
|
13
|
+
id: string;
|
|
14
|
+
/** This RENDERED row's identity, unique even when the same record is drawn
|
|
15
|
+
* under several groups. Focus, the editor, arrows and ranges are in terms of
|
|
16
|
+
* it; see `GridCellPos`. */
|
|
17
|
+
rowKey: string;
|
|
18
|
+
gridTemplate: string;
|
|
19
|
+
columns: ListColumn<Row>[];
|
|
20
|
+
selectable: boolean;
|
|
21
|
+
selected: boolean;
|
|
22
|
+
/** The row directly above in the SAME rendered list is selected. Every
|
|
23
|
+
* selected row draws its own BOTTOM rule; the top one is drawn only to CAP a
|
|
24
|
+
* run, which is what leaves exactly one line at each boundary — with both
|
|
25
|
+
* ends unconditional, two adjacent rows would land a rule each on
|
|
26
|
+
* neighbouring pixels and read as a 2px line. Plain boolean on purpose: this
|
|
27
|
+
* row is `memo()`d with no comparator. */
|
|
28
|
+
selectedAbove: boolean;
|
|
29
|
+
selecting: boolean;
|
|
30
|
+
toggle: (id: string, next?: boolean) => void;
|
|
31
|
+
toggleRange: (id: string) => void;
|
|
32
|
+
contextMenu?: (row: Row) => ViewsRowMenuItem[];
|
|
33
|
+
rowClassName?: (row: Row) => string | undefined;
|
|
34
|
+
rowHref?: (row: Row) => string | undefined;
|
|
35
|
+
onOpenRow: (row: Row) => void;
|
|
36
|
+
onPrefetchRow?: (row: Row) => void;
|
|
37
|
+
onRowDelete?: (id: string) => Promise<void>;
|
|
38
|
+
deleteLabel?: string;
|
|
39
|
+
/** Per-row actions in the title cell's hover lane, before the built-in Edit. */
|
|
40
|
+
rowActions?: ListCellAction<Row>[];
|
|
41
|
+
/** Leading ICON at the START of the title cell — a bare glyph, never an
|
|
42
|
+
* avatar component (see GridTableProps.rowIcon). Undefined = the user
|
|
43
|
+
* turned the "Row icon" toggle off, or the list has no icon to draw. */
|
|
44
|
+
rowIcon?: ListRowIconAccessor<Row>;
|
|
45
|
+
verticalBorders?: boolean;
|
|
46
|
+
/** Cells wrap to at most 3 lines and the row grows to its tallest cell. */
|
|
47
|
+
wrapCells?: boolean;
|
|
48
|
+
optionColors?: ListOptionColorOverrides;
|
|
49
|
+
dateStyles?: ListDateStyleOverrides;
|
|
50
|
+
/** Per-field duration rendering (override → `format.durationStyle` → adaptive). */
|
|
51
|
+
durationStyles?: ListDurationStyleOverrides;
|
|
52
|
+
/** Per-field decimals / display-currency (host-owned, from the header menu). */
|
|
53
|
+
numberFormats?: ListNumberFormatOverrides;
|
|
54
|
+
/** Per-field show-time overrides for date columns. */
|
|
55
|
+
showTimeOverrides?: ListShowTimeOverrides;
|
|
56
|
+
/** Per-field percent drawing (text, bar, ring). */
|
|
57
|
+
percentDisplays?: ListPercentDisplayOverrides;
|
|
58
|
+
/** The grid has a commit handler — cells with editors may enter edit mode. */
|
|
59
|
+
editingEnabled: boolean;
|
|
60
|
+
/** Focused/editing column id — null unless it's THIS row's cell. */
|
|
61
|
+
focusedColId: string | null;
|
|
62
|
+
editingColId: string | null;
|
|
63
|
+
/** columnId → optimistic pending value (undefined when this row has none). */
|
|
64
|
+
pendingByCol?: Record<string, unknown>;
|
|
65
|
+
/** columnId → `requested` for a pending value saved here but not yet accepted
|
|
66
|
+
* by the provider that owns it (spec §11.2) — drawn as the cell's pending state. */
|
|
67
|
+
settlementByCol?: Record<string, "requested">;
|
|
68
|
+
/** columnId → option values for status/select editors (declared + discovered).
|
|
69
|
+
* One memo-stable object shared by every row. */
|
|
70
|
+
selectValues?: Record<string, string[]>;
|
|
71
|
+
/** THIS row's slices of the 2D range selection (visible-column indices),
|
|
72
|
+
* memo-stable (GridTable caches identity per row). Undefined when no
|
|
73
|
+
* multi-cell range touches the row — the common case renders as before. */
|
|
74
|
+
rowRange?: GridRowRangeSpan[];
|
|
75
|
+
/** How many LEADING columns are pinned to the left edge. A plain number, so a
|
|
76
|
+
* memoized row doesn't re-render on every scroll; the row computes its own
|
|
77
|
+
* sticky offsets from it. 0 = nothing frozen. */
|
|
78
|
+
frozenCount?: number;
|
|
79
|
+
/** Sticky `left` for the frozen column at visible index i — a calc() over the
|
|
80
|
+
* width vars, so live resize re-lays the frozen stack without React. */
|
|
81
|
+
frozenLeft?: (i: number) => string;
|
|
82
|
+
/** Workspace-settings capability locks (table read-only / per-column) — subtracts from
|
|
83
|
+
* what the columns declare. Memo-stable: threaded straight from the host. */
|
|
84
|
+
listConfig?: ListSettingsConfig;
|
|
85
|
+
onFocusCell: (rowId: string, columnId: string) => void;
|
|
86
|
+
onStartEdit: (rowId: string, columnId: string) => void;
|
|
87
|
+
/** A second click or a double-click on a cell that opens nothing: the grid
|
|
88
|
+
* says why it can't be edited (or nothing, when it can be written). */
|
|
89
|
+
onRefuseEdit?: (columnId: string) => void;
|
|
90
|
+
/** Tab out of an editor → next/prev cell in reading order (grid-owned so it
|
|
91
|
+
* matches Tab-while-focused; wraps rows). */
|
|
92
|
+
onEditorTab: (rowId: string, columnId: string, backwards: boolean) => void;
|
|
93
|
+
/** Enter out of an editor → advance one row down. */
|
|
94
|
+
onEditorEnter: (rowId: string, columnId: string) => void;
|
|
95
|
+
/** Type-to-replace seed: the character that opened THIS row's editor, or null.
|
|
96
|
+
* Used as the editor's initial value in place of the cell's own. */
|
|
97
|
+
editSeed?: string | null;
|
|
98
|
+
/** Shift-click: extend the active range to this cell (anchor stays). */
|
|
99
|
+
onExtendCell: (rowId: string, columnId: string) => void;
|
|
100
|
+
/** ⌘-click: add this cell as its own range. */
|
|
101
|
+
onAddCell: (rowId: string, columnId: string) => void;
|
|
102
|
+
onCommitCell: (row: Row, rowId: string, columnId: string, prev: unknown, next: unknown, opts?: {
|
|
103
|
+
overlay?: boolean;
|
|
104
|
+
}) => void;
|
|
105
|
+
/** Cell-scoped args make late (animation-deferred) cancels safe. */
|
|
106
|
+
onCancelEdit: (rowId?: string, columnId?: string) => void;
|
|
107
|
+
/** Open the entity a `relation` cell POINTS AT — a different entity from the
|
|
108
|
+
* one `onOpenRow` opens, which is why it can't reuse that handler. Omitted
|
|
109
|
+
* by a host with nowhere to send the click; the chip then renders inert
|
|
110
|
+
* rather than advertising a navigation it can't perform. */
|
|
111
|
+
onOpenRelation?: (value: ListRelationValue, columnId: string, row: Row) => void;
|
|
112
|
+
/** This app's glyph for an entity kind — see `GridCellOptions.entityIcon`. */
|
|
113
|
+
entityIcon?: (kind: string | undefined) => ReactNode;
|
|
114
|
+
/** The verbs a `command` column's cell opens, by field key — the host's, the
|
|
115
|
+
* same map the drawer's `FieldPanel` takes. Memo-stable: threaded straight
|
|
116
|
+
* from the host. See `GridCellOptions.commandItems`. */
|
|
117
|
+
commands?: FieldMenus<Row>;
|
|
118
|
+
/** Whether a cell sits inside the active MULTI-cell range — the context
|
|
119
|
+
* menu's verbs then act on the whole range instead of the one cell. */
|
|
120
|
+
inActiveRange: (rowId: string, columnId: string) => boolean;
|
|
121
|
+
/** Whether the active range holds any clearable column (greys Cut/Clear —
|
|
122
|
+
* required fields can't be emptied). */
|
|
123
|
+
rangeCanClear: () => boolean;
|
|
124
|
+
onRangeCopy: () => void;
|
|
125
|
+
onRangeCut: () => void;
|
|
126
|
+
onRangePaste: () => void;
|
|
127
|
+
onRangeClear: () => void;
|
|
128
|
+
/** Paste the clipboard MATRIX anchored at this cell (single-cell menu path
|
|
129
|
+
* when the clipboard holds a range copy). */
|
|
130
|
+
onPasteAtCell: (rowId: string, columnId: string) => void;
|
|
131
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
export declare const GRID_BLEED = "-mx-(--vk-gutter,0px)";
|
|
2
|
+
export declare const GRID_ROW_PAD = "px-(--vk-gutter,0px)";
|
|
3
|
+
export declare const GRID_CONTENT_PAD = "pl-[calc(var(--vk-gutter,0px)+var(--vk-indent,0px))] pr-(--vk-gutter,0px)";
|
|
4
|
+
/** A part that paints the ground it sits on — the editing cell, a frozen footer cell, the rail's
|
|
5
|
+
* checkboxes, an outlined row action, the header's drag ghost. The page's ground, without
|
|
6
|
+
* re-declaring its states: every host the grid mounts in carries the page's own. */
|
|
7
|
+
export declare const GRID_GROUND = "bg-(color:--vk-ground)";
|
|
8
|
+
/** THE endFill-tail ⋯ button look: each row's menu button. Its hover is the caller's: neutral, or
|
|
9
|
+
* brand on a selected row. */
|
|
10
|
+
export declare const GRID_TAIL_BUTTON_BASE = "inline-flex h-8 w-9 items-center justify-center rounded-sm text-(color:--vk-fg-subtle) hover:text-(color:--vk-fg)";
|
|
11
|
+
export declare const GRID_HEADER_BG = "bg-[linear-gradient(to_bottom,var(--vk-ground)_calc(100%-2px),transparent_calc(100%-2px))]";
|
|
12
|
+
/**
|
|
13
|
+
* A FROZEN header cell's OWN paint — the same band, alpha-gated on
|
|
14
|
+
* `--vk-scrolled` (0/1, from the scroll sync), like the frozen z-tier and the
|
|
15
|
+
* head fade. It needs to be opaque only while cells pass underneath it; at rest
|
|
16
|
+
* the strip's own GRID_HEADER_BG already covers the band.
|
|
17
|
+
*
|
|
18
|
+
* Load-bearing, not tidiness: painting it unconditionally fills GRID_HEADER_BG's
|
|
19
|
+
* deliberate 2px transparent sliver — the ONLY place the FIRST row's selection
|
|
20
|
+
* ring can draw its top edge (no row above it, and the band outranks every
|
|
21
|
+
* cell). Symptom: pin the identity columns, edit the first row's title, and the
|
|
22
|
+
* ring's top edge is missing.
|
|
23
|
+
*/
|
|
24
|
+
export declare const GRID_HEADER_BG_FROZEN = "bg-[linear-gradient(to_bottom,color-mix(in_oklab,_var(--vk-ground)_calc(var(--vk-scrolled,0)*100%),_transparent)_calc(100%-2px),transparent_calc(100%-2px))]";
|
|
25
|
+
/**
|
|
26
|
+
* The frozen cell's hover tint. GRID_HEADER_BG is a background-IMAGE and images
|
|
27
|
+
* paint over the background-COLOR — so the plain `hover:bg-(color:--vk-hovered)` the other
|
|
28
|
+
* header cells use is completely hidden underneath it, except in the 2px
|
|
29
|
+
* transparent sliver.
|
|
30
|
+
*
|
|
31
|
+
* So the hover tint has to be an image too, stacked ABOVE the same base — first
|
|
32
|
+
* layer wins in a background-image list. Non-frozen cells keep the simple
|
|
33
|
+
* colour version; only frozen cells need this. The base layer carries the same
|
|
34
|
+
* `--vk-scrolled` gate as GRID_HEADER_BG_FROZEN, so hovering a header at rest
|
|
35
|
+
* can't reintroduce the opacity the sliver depends on.
|
|
36
|
+
*/
|
|
37
|
+
export declare const GRID_HEADER_BG_FROZEN_HOVER = "hover:bg-[linear-gradient(var(--vk-hovered),var(--vk-hovered)),linear-gradient(to_bottom,color-mix(in_oklab,_var(--vk-ground)_calc(var(--vk-scrolled,0)*100%),_transparent)_calc(100%-2px),transparent_calc(100%-2px))]";
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export const GRID_BLEED = "-mx-(--vk-gutter,0px)";
|
|
2
|
+
export const GRID_ROW_PAD = "px-(--vk-gutter,0px)";
|
|
3
|
+
export const GRID_CONTENT_PAD = "pl-[calc(var(--vk-gutter,0px)+var(--vk-indent,0px))] pr-(--vk-gutter,0px)";
|
|
4
|
+
export const GRID_GROUND = "bg-(color:--vk-ground)";
|
|
5
|
+
export const GRID_TAIL_BUTTON_BASE = "inline-flex h-8 w-9 items-center justify-center rounded-sm text-(color:--vk-fg-subtle) hover:text-(color:--vk-fg)";
|
|
6
|
+
export const GRID_HEADER_BG = "bg-[linear-gradient(to_bottom,var(--vk-ground)_calc(100%-2px),transparent_calc(100%-2px))]";
|
|
7
|
+
export const GRID_HEADER_BG_FROZEN = "bg-[linear-gradient(to_bottom,color-mix(in_oklab,_var(--vk-ground)_calc(var(--vk-scrolled,0)*100%),_transparent)_calc(100%-2px),transparent_calc(100%-2px))]";
|
|
8
|
+
export const GRID_HEADER_BG_FROZEN_HOVER = "hover:bg-[linear-gradient(var(--vk-hovered),var(--vk-hovered)),linear-gradient(to_bottom,color-mix(in_oklab,_var(--vk-ground)_calc(var(--vk-scrolled,0)*100%),_transparent)_calc(100%-2px),transparent_calc(100%-2px))]";
|