@1771technologies/lytenyte-pro 1.0.11 → 1.0.12-dev.1
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/package.json +7 -7
- package/dist/+types.d.ts +0 -5836
- package/dist/+types.js +0 -1
- package/dist/cell-selection/adjust-rect-for-row-and-cell-span.d.ts +0 -2
- package/dist/cell-selection/adjust-rect-for-row-and-cell-span.js +0 -43
- package/dist/cell-selection/are-rects-equal.d.ts +0 -2
- package/dist/cell-selection/are-rects-equal.js +0 -6
- package/dist/cell-selection/bound-selection-rect.d.ts +0 -2
- package/dist/cell-selection/bound-selection-rect.js +0 -17
- package/dist/cell-selection/cell-selection-containers.d.ts +0 -3
- package/dist/cell-selection/cell-selection-containers.js +0 -91
- package/dist/cell-selection/cell-selection-driver.d.ts +0 -1
- package/dist/cell-selection/cell-selection-driver.js +0 -281
- package/dist/cell-selection/cell-style-row.d.ts +0 -8
- package/dist/cell-selection/cell-style-row.js +0 -84
- package/dist/cell-selection/deselect-rect-range.d.ts +0 -2
- package/dist/cell-selection/deselect-rect-range.js +0 -43
- package/dist/cell-selection/expand-cell-selection-down.d.ts +0 -5
- package/dist/cell-selection/expand-cell-selection-down.js +0 -39
- package/dist/cell-selection/expand-cell-selection-end.d.ts +0 -5
- package/dist/cell-selection/expand-cell-selection-end.js +0 -40
- package/dist/cell-selection/expand-cell-selection-start.d.ts +0 -5
- package/dist/cell-selection/expand-cell-selection-start.js +0 -39
- package/dist/cell-selection/expand-cell-selection-up.d.ts +0 -5
- package/dist/cell-selection/expand-cell-selection-up.js +0 -39
- package/dist/cell-selection/full-width-start-end-index.d.ts +0 -2
- package/dist/cell-selection/full-width-start-end-index.js +0 -5
- package/dist/cell-selection/get-root-cell.d.ts +0 -2
- package/dist/cell-selection/get-root-cell.js +0 -6
- package/dist/cell-selection/index.d.ts +0 -18
- package/dist/cell-selection/index.js +0 -18
- package/dist/cell-selection/is-bottom-rect.d.ts +0 -2
- package/dist/cell-selection/is-bottom-rect.js +0 -7
- package/dist/cell-selection/is-center-col-rect.d.ts +0 -5
- package/dist/cell-selection/is-center-col-rect.js +0 -5
- package/dist/cell-selection/is-center-rect.d.ts +0 -2
- package/dist/cell-selection/is-center-rect.js +0 -5
- package/dist/cell-selection/is-end-rect.d.ts +0 -5
- package/dist/cell-selection/is-end-rect.js +0 -4
- package/dist/cell-selection/is-overlapping-rect.d.ts +0 -2
- package/dist/cell-selection/is-overlapping-rect.js +0 -6
- package/dist/cell-selection/is-start-rect.d.ts +0 -5
- package/dist/cell-selection/is-start-rect.js +0 -4
- package/dist/cell-selection/is-top-rect.d.ts +0 -2
- package/dist/cell-selection/is-top-rect.js +0 -4
- package/dist/cell-selection/is-within-selection-rect.d.ts +0 -2
- package/dist/cell-selection/is-within-selection-rect.js +0 -3
- package/dist/cell-selection/split-cell-selection-rect.d.ts +0 -46
- package/dist/cell-selection/split-cell-selection-rect.js +0 -88
- package/dist/cell-selection/split-on-pivot.d.ts +0 -3
- package/dist/cell-selection/split-on-pivot.js +0 -50
- package/dist/cell-selection/update-additive-cell-selection.d.ts +0 -5
- package/dist/cell-selection/update-additive-cell-selection.js +0 -23
- package/dist/cell-selection/use-edge-scroll.d.ts +0 -10
- package/dist/cell-selection/use-edge-scroll.js +0 -66
- package/dist/cells/+types.cell.d.ts +0 -13
- package/dist/cells/+types.cell.js +0 -1
- package/dist/cells/cell-default.d.ts +0 -2
- package/dist/cells/cell-default.js +0 -8
- package/dist/cells/cell-editor.d.ts +0 -6
- package/dist/cells/cell-editor.js +0 -103
- package/dist/cells/cell-spacer.d.ts +0 -9
- package/dist/cells/cell-spacer.js +0 -34
- package/dist/cells/cell.d.ts +0 -5
- package/dist/cells/cell.js +0 -43
- package/dist/cells/use-cell-style.d.ts +0 -3
- package/dist/cells/use-cell-style.js +0 -51
- package/dist/column-manager/branch-lookup-context.d.ts +0 -4
- package/dist/column-manager/branch-lookup-context.js +0 -3
- package/dist/column-manager/branch.d.ts +0 -15
- package/dist/column-manager/branch.js +0 -54
- package/dist/column-manager/column-manager.d.ts +0 -13
- package/dist/column-manager/column-manager.js +0 -18
- package/dist/column-manager/context.d.ts +0 -7
- package/dist/column-manager/context.js +0 -3
- package/dist/column-manager/label.d.ts +0 -5
- package/dist/column-manager/label.js +0 -18
- package/dist/column-manager/leaf.d.ts +0 -6
- package/dist/column-manager/leaf.js +0 -58
- package/dist/column-manager/move-handle.d.ts +0 -5
- package/dist/column-manager/move-handle.js +0 -73
- package/dist/column-manager/panel.d.ts +0 -1
- package/dist/column-manager/panel.js +0 -2
- package/dist/column-manager/root.d.ts +0 -8
- package/dist/column-manager/root.js +0 -7
- package/dist/column-manager/use-column-manager.d.ts +0 -10
- package/dist/column-manager/use-column-manager.js +0 -24
- package/dist/column-manager/use-columns-from-context.d.ts +0 -3
- package/dist/column-manager/use-columns-from-context.js +0 -23
- package/dist/column-manager/visibility-checkbox.d.ts +0 -9
- package/dist/column-manager/visibility-checkbox.js +0 -30
- package/dist/context.d.ts +0 -10
- package/dist/context.js +0 -4
- package/dist/filter-tree/branch.d.ts +0 -13
- package/dist/filter-tree/branch.js +0 -21
- package/dist/filter-tree/context.d.ts +0 -27
- package/dist/filter-tree/context.js +0 -5
- package/dist/filter-tree/filter-tree.d.ts +0 -14
- package/dist/filter-tree/filter-tree.js +0 -18
- package/dist/filter-tree/hooks/use-filter-tree.d.ts +0 -38
- package/dist/filter-tree/hooks/use-filter-tree.js +0 -101
- package/dist/filter-tree/hooks/use-tree-item.d.ts +0 -8
- package/dist/filter-tree/hooks/use-tree-item.js +0 -116
- package/dist/filter-tree/inclusion-checkbox.d.ts +0 -9
- package/dist/filter-tree/inclusion-checkbox.js +0 -14
- package/dist/filter-tree/label.d.ts +0 -5
- package/dist/filter-tree/label.js +0 -18
- package/dist/filter-tree/leaf.d.ts +0 -6
- package/dist/filter-tree/leaf.js +0 -14
- package/dist/filter-tree/root.d.ts +0 -13
- package/dist/filter-tree/root.js +0 -30
- package/dist/grid-box/+types.d.ts +0 -15
- package/dist/grid-box/+types.js +0 -1
- package/dist/grid-box/context.d.ts +0 -9
- package/dist/grid-box/context.js +0 -3
- package/dist/grid-box/grid-box.d.ts +0 -12
- package/dist/grid-box/grid-box.js +0 -14
- package/dist/grid-box/item.d.ts +0 -10
- package/dist/grid-box/item.js +0 -63
- package/dist/grid-box/panel.d.ts +0 -1
- package/dist/grid-box/panel.js +0 -9
- package/dist/grid-box/root.d.ts +0 -9
- package/dist/grid-box/root.js +0 -8
- package/dist/grid-box/use-aggregation-box-items.d.ts +0 -18
- package/dist/grid-box/use-aggregation-box-items.js +0 -61
- package/dist/grid-box/use-column-box-items.d.ts +0 -34
- package/dist/grid-box/use-column-box-items.js +0 -78
- package/dist/grid-box/use-row-group-box-items.d.ts +0 -18
- package/dist/grid-box/use-row-group-box-items.js +0 -169
- package/dist/grid-provider/context.d.ts +0 -5
- package/dist/grid-provider/context.js +0 -2
- package/dist/grid-provider/provider.d.ts +0 -3
- package/dist/grid-provider/provider.js +0 -2
- package/dist/grid-provider/use-grid.d.ts +0 -3
- package/dist/grid-provider/use-grid.js +0 -3
- package/dist/grid.d.ts +0 -18
- package/dist/grid.js +0 -28
- package/dist/header/header-cell.d.ts +0 -10
- package/dist/header/header-cell.js +0 -24
- package/dist/header/header-group-cell.d.ts +0 -5
- package/dist/header/header-group-cell.js +0 -16
- package/dist/header/header-row.d.ts +0 -4
- package/dist/header/header-row.js +0 -10
- package/dist/header/header.d.ts +0 -1
- package/dist/header/header.js +0 -10
- package/dist/header/resize-handler.d.ts +0 -12
- package/dist/header/resize-handler.js +0 -139
- package/dist/header/use-drag-move.d.ts +0 -14
- package/dist/header/use-drag-move.js +0 -97
- package/dist/header/use-header-cell-renderer.d.ts +0 -4
- package/dist/header/use-header-cell-renderer.js +0 -36
- package/dist/icons/index.d.ts +0 -1
- package/dist/icons/index.js +0 -3
- package/dist/index.d.ts +0 -13
- package/dist/index.js +0 -13
- package/dist/license.d.ts +0 -3
- package/dist/license.js +0 -214
- package/dist/listbox/context.d.ts +0 -6
- package/dist/listbox/context.js +0 -3
- package/dist/listbox/item.d.ts +0 -1
- package/dist/listbox/item.js +0 -25
- package/dist/listbox/panel.d.ts +0 -1
- package/dist/listbox/panel.js +0 -50
- package/dist/listbox/root.d.ts +0 -6
- package/dist/listbox/root.js +0 -12
- package/dist/root/dialog-driver.d.ts +0 -1
- package/dist/root/dialog-driver.js +0 -21
- package/dist/root/popover-driver.d.ts +0 -1
- package/dist/root/popover-driver.js +0 -21
- package/dist/root/root.d.ts +0 -8
- package/dist/root/root.js +0 -125
- package/dist/row-data-source-client/+constants.d.ts +0 -2
- package/dist/row-data-source-client/+constants.js +0 -2
- package/dist/row-data-source-client/+types.d.ts +0 -27
- package/dist/row-data-source-client/+types.js +0 -1
- package/dist/row-data-source-client/built-ins/avg.d.ts +0 -10
- package/dist/row-data-source-client/built-ins/avg.js +0 -16
- package/dist/row-data-source-client/built-ins/built-ins.d.ts +0 -44
- package/dist/row-data-source-client/built-ins/built-ins.js +0 -44
- package/dist/row-data-source-client/built-ins/count.d.ts +0 -10
- package/dist/row-data-source-client/built-ins/count.js +0 -16
- package/dist/row-data-source-client/built-ins/first.d.ts +0 -10
- package/dist/row-data-source-client/built-ins/first.js +0 -12
- package/dist/row-data-source-client/built-ins/group.d.ts +0 -1
- package/dist/row-data-source-client/built-ins/group.js +0 -3
- package/dist/row-data-source-client/built-ins/last.d.ts +0 -10
- package/dist/row-data-source-client/built-ins/last.js +0 -12
- package/dist/row-data-source-client/built-ins/max.d.ts +0 -11
- package/dist/row-data-source-client/built-ins/max.js +0 -25
- package/dist/row-data-source-client/built-ins/min.d.ts +0 -11
- package/dist/row-data-source-client/built-ins/min.js +0 -25
- package/dist/row-data-source-client/built-ins/sum.d.ts +0 -10
- package/dist/row-data-source-client/built-ins/sum.js +0 -21
- package/dist/row-data-source-client/filter/+types.d.ts +0 -23
- package/dist/row-data-source-client/filter/+types.js +0 -1
- package/dist/row-data-source-client/filter/compute-filtered-rows.d.ts +0 -2
- package/dist/row-data-source-client/filter/compute-filtered-rows.js +0 -109
- package/dist/row-data-source-client/pivots/create-agg-model.d.ts +0 -6
- package/dist/row-data-source-client/pivots/create-agg-model.js +0 -13
- package/dist/row-data-source-client/pivots/create-pivot-columns-from-paths.d.ts +0 -2
- package/dist/row-data-source-client/pivots/create-pivot-columns-from-paths.js +0 -50
- package/dist/row-data-source-client/pivots/create-pivot-columns.d.ts +0 -2
- package/dist/row-data-source-client/pivots/create-pivot-columns.js +0 -22
- package/dist/row-data-source-client/pivots/create-pivot-tree.d.ts +0 -2
- package/dist/row-data-source-client/pivots/create-pivot-tree.js +0 -23
- package/dist/row-data-source-client/tree/client-tree.d.ts +0 -18
- package/dist/row-data-source-client/tree/client-tree.js +0 -76
- package/dist/row-data-source-client/tree/evaluator-aggregation.d.ts +0 -2
- package/dist/row-data-source-client/tree/evaluator-aggregation.js +0 -8
- package/dist/row-data-source-client/tree/evaluator-group.d.ts +0 -2
- package/dist/row-data-source-client/tree/evaluator-group.js +0 -9
- package/dist/row-data-source-client/tree/traverse.d.ts +0 -2
- package/dist/row-data-source-client/tree/traverse.js +0 -22
- package/dist/row-data-source-client/use-client-data-source-paginated.d.ts +0 -10
- package/dist/row-data-source-client/use-client-data-source-paginated.js +0 -572
- package/dist/row-data-source-client/use-client-data-source.d.ts +0 -10
- package/dist/row-data-source-client/use-client-data-source.js +0 -666
- package/dist/row-data-source-client/use-client-tree-data-source.d.ts +0 -9
- package/dist/row-data-source-client/use-client-tree-data-source.js +0 -511
- package/dist/row-data-source-server/async-tree/+constants.async-tree.d.ts +0 -1
- package/dist/row-data-source-server/async-tree/+constants.async-tree.js +0 -1
- package/dist/row-data-source-server/async-tree/+types.async-tree.d.ts +0 -59
- package/dist/row-data-source-server/async-tree/+types.async-tree.js +0 -1
- package/dist/row-data-source-server/async-tree/apply-delete-action-to-tree.d.ts +0 -2
- package/dist/row-data-source-server/async-tree/apply-delete-action-to-tree.js +0 -27
- package/dist/row-data-source-server/async-tree/apply-set-action-to-tree.d.ts +0 -2
- package/dist/row-data-source-server/async-tree/apply-set-action-to-tree.js +0 -36
- package/dist/row-data-source-server/async-tree/check-set-action-item-keys-are-unique.d.ts +0 -2
- package/dist/row-data-source-server/async-tree/check-set-action-item-keys-are-unique.js +0 -24
- package/dist/row-data-source-server/async-tree/check-set-action-item-keys-are-valid.d.ts +0 -2
- package/dist/row-data-source-server/async-tree/check-set-action-item-keys-are-valid.js +0 -14
- package/dist/row-data-source-server/async-tree/check-set-action-item-keys-fit.d.ts +0 -2
- package/dist/row-data-source-server/async-tree/check-set-action-item-keys-fit.js +0 -18
- package/dist/row-data-source-server/async-tree/check-set-action-item-kinds.d.ts +0 -2
- package/dist/row-data-source-server/async-tree/check-set-action-item-kinds.js +0 -14
- package/dist/row-data-source-server/async-tree/get-parent-node-by-path.d.ts +0 -2
- package/dist/row-data-source-server/async-tree/get-parent-node-by-path.js +0 -18
- package/dist/row-data-source-server/async-tree/is-set-action-a-no-op-on-node.d.ts +0 -2
- package/dist/row-data-source-server/async-tree/is-set-action-a-no-op-on-node.js +0 -3
- package/dist/row-data-source-server/async-tree/make-async-tree.d.ts +0 -2
- package/dist/row-data-source-server/async-tree/make-async-tree.js +0 -19
- package/dist/row-data-source-server/async-tree/maybe-apply-parent-remove-self.d.ts +0 -2
- package/dist/row-data-source-server/async-tree/maybe-apply-parent-remove-self.js +0 -8
- package/dist/row-data-source-server/async-tree/maybe-apply-resize.d.ts +0 -2
- package/dist/row-data-source-server/async-tree/maybe-apply-resize.js +0 -17
- package/dist/row-data-source-server/async-tree/maybe-apply-set-action-items.d.ts +0 -2
- package/dist/row-data-source-server/async-tree/maybe-apply-set-action-items.js +0 -52
- package/dist/row-data-source-server/range-tree/range-tree.d.ts +0 -66
- package/dist/row-data-source-server/range-tree/range-tree.js +0 -102
- package/dist/row-data-source-server/server-data.d.ts +0 -48
- package/dist/row-data-source-server/server-data.js +0 -378
- package/dist/row-data-source-server/use-server-data-source.d.ts +0 -3
- package/dist/row-data-source-server/use-server-data-source.js +0 -344
- package/dist/row-data-source-server/utils/get-node-depth.d.ts +0 -2
- package/dist/row-data-source-server/utils/get-node-depth.js +0 -9
- package/dist/row-data-source-server/utils/get-node-path.d.ts +0 -2
- package/dist/row-data-source-server/utils/get-node-path.js +0 -9
- package/dist/row-data-source-server/utils/get-request-id.d.ts +0 -1
- package/dist/row-data-source-server/utils/get-request-id.js +0 -6
- package/dist/rows/row/context.d.ts +0 -14
- package/dist/rows/row/context.js +0 -13
- package/dist/rows/row/row.d.ts +0 -7
- package/dist/rows/row/row.js +0 -25
- package/dist/rows/row/use-row-context-value.d.ts +0 -6
- package/dist/rows/row/use-row-context-value.js +0 -44
- package/dist/rows/row-detail-row.d.ts +0 -4
- package/dist/rows/row-detail-row.js +0 -130
- package/dist/rows/row-full-width.d.ts +0 -8
- package/dist/rows/row-full-width.js +0 -19
- package/dist/rows/rows-container.d.ts +0 -1
- package/dist/rows/rows-container.js +0 -9
- package/dist/rows/rows-sections.d.ts +0 -3
- package/dist/rows/rows-sections.js +0 -27
- package/dist/rows/scrollers/native-scroller.d.ts +0 -2
- package/dist/rows/scrollers/native-scroller.js +0 -4
- package/dist/sort-manager/+types.d.ts +0 -13
- package/dist/sort-manager/+types.js +0 -1
- package/dist/sort-manager/context.d.ts +0 -14
- package/dist/sort-manager/context.js +0 -5
- package/dist/sort-manager/hooks/use-sort-manager.d.ts +0 -15
- package/dist/sort-manager/hooks/use-sort-manager.js +0 -56
- package/dist/sort-manager/hooks/use-sort-row-item.d.ts +0 -51
- package/dist/sort-manager/hooks/use-sort-row-item.js +0 -145
- package/dist/sort-manager/hooks/use-sortable-column-items.d.ts +0 -5
- package/dist/sort-manager/hooks/use-sortable-column-items.js +0 -13
- package/dist/sort-manager/root.d.ts +0 -3
- package/dist/sort-manager/root.js +0 -14
- package/dist/sort-manager/sort-add.d.ts +0 -8
- package/dist/sort-manager/sort-add.js +0 -14
- package/dist/sort-manager/sort-apply.d.ts +0 -7
- package/dist/sort-manager/sort-apply.js +0 -24
- package/dist/sort-manager/sort-cancel.d.ts +0 -7
- package/dist/sort-manager/sort-cancel.js +0 -27
- package/dist/sort-manager/sort-clear.d.ts +0 -7
- package/dist/sort-manager/sort-clear.js +0 -22
- package/dist/sort-manager/sort-column-select.d.ts +0 -10
- package/dist/sort-manager/sort-column-select.js +0 -20
- package/dist/sort-manager/sort-direction-select.d.ts +0 -10
- package/dist/sort-manager/sort-direction-select.js +0 -24
- package/dist/sort-manager/sort-manager.d.ts +0 -16
- package/dist/sort-manager/sort-manager.js +0 -26
- package/dist/sort-manager/sort-remove.d.ts +0 -7
- package/dist/sort-manager/sort-remove.js +0 -14
- package/dist/sort-manager/sort-row.d.ts +0 -5
- package/dist/sort-manager/sort-row.js +0 -7
- package/dist/sort-manager/sort-rows.d.ts +0 -1
- package/dist/sort-manager/sort-rows.js +0 -6
- package/dist/sort-manager/sort-value-select.d.ts +0 -11
- package/dist/sort-manager/sort-value-select.js +0 -25
- package/dist/sort-manager/utils/sort-item-to-sort-model.d.ts +0 -3
- package/dist/sort-manager/utils/sort-item-to-sort-model.js +0 -62
- package/dist/sort-manager/utils/sort-model-to-sort-items.d.ts +0 -3
- package/dist/sort-manager/utils/sort-model-to-sort-items.js +0 -50
- package/dist/state/+types.d.ts +0 -35
- package/dist/state/+types.js +0 -1
- package/dist/state/api/cell-root.d.ts +0 -5
- package/dist/state/api/cell-root.js +0 -64
- package/dist/state/api/column-autosize.d.ts +0 -5
- package/dist/state/api/column-autosize.js +0 -72
- package/dist/state/api/column-by-id.d.ts +0 -2
- package/dist/state/api/column-by-id.js +0 -6
- package/dist/state/api/column-field.d.ts +0 -2
- package/dist/state/api/column-field.js +0 -23
- package/dist/state/api/column-from-index.d.ts +0 -2
- package/dist/state/api/column-from-index.js +0 -6
- package/dist/state/api/column-group-toggle.d.ts +0 -2
- package/dist/state/api/column-group-toggle.js +0 -10
- package/dist/state/api/column-index.d.ts +0 -2
- package/dist/state/api/column-index.js +0 -7
- package/dist/state/api/column-move.d.ts +0 -2
- package/dist/state/api/column-move.js +0 -49
- package/dist/state/api/column-resize.d.ts +0 -2
- package/dist/state/api/column-resize.js +0 -9
- package/dist/state/api/column-update.d.ts +0 -5
- package/dist/state/api/column-update.js +0 -26
- package/dist/state/api/dialog-frame.d.ts +0 -8
- package/dist/state/api/dialog-frame.js +0 -16
- package/dist/state/api/edit-begin.d.ts +0 -5
- package/dist/state/api/edit-begin.js +0 -87
- package/dist/state/api/edit-end.d.ts +0 -5
- package/dist/state/api/edit-end.js +0 -43
- package/dist/state/api/edit-is-cell-active.d.ts +0 -5
- package/dist/state/api/edit-is-cell-active.js +0 -22
- package/dist/state/api/edit-update.d.ts +0 -5
- package/dist/state/api/edit-update.js +0 -88
- package/dist/state/api/event-listeners.d.ts +0 -5
- package/dist/state/api/event-listeners.js +0 -19
- package/dist/state/api/export-csv.d.ts +0 -3
- package/dist/state/api/export-csv.js +0 -40
- package/dist/state/api/export-data-rect.d.ts +0 -2
- package/dist/state/api/export-data-rect.js +0 -24
- package/dist/state/api/focus-cell.d.ts +0 -5
- package/dist/state/api/focus-cell.js +0 -117
- package/dist/state/api/popover-frame.d.ts +0 -8
- package/dist/state/api/popover-frame.js +0 -16
- package/dist/state/api/position-from-element.d.ts +0 -2
- package/dist/state/api/position-from-element.js +0 -9
- package/dist/state/api/row-by-id.d.ts +0 -2
- package/dist/state/api/row-by-id.js +0 -5
- package/dist/state/api/row-by-index.d.ts +0 -2
- package/dist/state/api/row-by-index.js +0 -9
- package/dist/state/api/row-detail-is-expanded.d.ts +0 -2
- package/dist/state/api/row-detail-is-expanded.js +0 -6
- package/dist/state/api/row-detail-rendered-height.d.ts +0 -5
- package/dist/state/api/row-detail-rendered-height.js +0 -14
- package/dist/state/api/row-detail-toggle.d.ts +0 -2
- package/dist/state/api/row-detail-toggle.js +0 -32
- package/dist/state/api/row-group-apply-expansions.d.ts +0 -2
- package/dist/state/api/row-group-apply-expansions.js +0 -20
- package/dist/state/api/row-group-column-index.d.ts +0 -2
- package/dist/state/api/row-group-column-index.js +0 -14
- package/dist/state/api/row-group-is-expanded.d.ts +0 -2
- package/dist/state/api/row-group-is-expanded.js +0 -15
- package/dist/state/api/row-group-toggle.d.ts +0 -2
- package/dist/state/api/row-group-toggle.js +0 -7
- package/dist/state/api/row-handle-select.d.ts +0 -5
- package/dist/state/api/row-handle-select.js +0 -43
- package/dist/state/api/row-select-all.d.ts +0 -2
- package/dist/state/api/row-select-all.js +0 -17
- package/dist/state/api/row-select.d.ts +0 -5
- package/dist/state/api/row-select.js +0 -35
- package/dist/state/api/row-selected.d.ts +0 -2
- package/dist/state/api/row-selected.js +0 -13
- package/dist/state/api/scroll-into-view.d.ts +0 -5
- package/dist/state/api/scroll-into-view.js +0 -50
- package/dist/state/api/sort-for-column.d.ts +0 -2
- package/dist/state/api/sort-for-column.js +0 -9
- package/dist/state/api/use-row-drag.d.ts +0 -2
- package/dist/state/api/use-row-drag.js +0 -27
- package/dist/state/helpers/cell-row-group.d.ts +0 -2
- package/dist/state/helpers/cell-row-group.js +0 -19
- package/dist/state/helpers/column-add-row-group.d.ts +0 -10
- package/dist/state/helpers/column-add-row-group.js +0 -74
- package/dist/state/helpers/column-layout.d.ts +0 -3
- package/dist/state/helpers/column-layout.js +0 -59
- package/dist/state/helpers/column-marker.d.ts +0 -8
- package/dist/state/helpers/column-marker.js +0 -43
- package/dist/state/helpers/column-view.d.ts +0 -21
- package/dist/state/helpers/column-view.js +0 -33
- package/dist/state/helpers/edit-on-change.d.ts +0 -15
- package/dist/state/helpers/edit-on-change.js +0 -27
- package/dist/state/helpers/empty-row-data-source.d.ts +0 -2
- package/dist/state/helpers/empty-row-data-source.js +0 -18
- package/dist/state/helpers/get-data-rect.d.ts +0 -13
- package/dist/state/helpers/get-data-rect.js +0 -65
- package/dist/state/helpers/get-full-width-callback.d.ts +0 -2
- package/dist/state/helpers/get-full-width-callback.js +0 -10
- package/dist/state/helpers/get-span-callback.d.ts +0 -2
- package/dist/state/helpers/get-span-callback.js +0 -22
- package/dist/state/helpers/resolve-column.d.ts +0 -4
- package/dist/state/helpers/resolve-column.js +0 -29
- package/dist/state/helpers/row-layout/get-focus-criteria.d.ts +0 -17
- package/dist/state/helpers/row-layout/get-focus-criteria.js +0 -62
- package/dist/state/helpers/row-layout/row-layout.d.ts +0 -19
- package/dist/state/helpers/row-layout/row-layout.js +0 -181
- package/dist/state/use-lytenyte.d.ts +0 -3
- package/dist/state/use-lytenyte.js +0 -673
- package/dist/tree-view/branch/branch.d.ts +0 -14
- package/dist/tree-view/branch/branch.js +0 -63
- package/dist/tree-view/branch/use-branch-keys.d.ts +0 -2
- package/dist/tree-view/branch/use-branch-keys.js +0 -87
- package/dist/tree-view/context.d.ts +0 -22
- package/dist/tree-view/context.js +0 -3
- package/dist/tree-view/depth-provider.d.ts +0 -2
- package/dist/tree-view/depth-provider.js +0 -3
- package/dist/tree-view/hooks/use-tree-view-paths.d.ts +0 -2
- package/dist/tree-view/hooks/use-tree-view-paths.js +0 -9
- package/dist/tree-view/index.d.ts +0 -16
- package/dist/tree-view/index.js +0 -16
- package/dist/tree-view/leaf.d.ts +0 -4
- package/dist/tree-view/leaf.js +0 -28
- package/dist/tree-view/navigation/get-all-ids.d.ts +0 -1
- package/dist/tree-view/navigation/get-all-ids.js +0 -7
- package/dist/tree-view/navigation/get-first-node.d.ts +0 -1
- package/dist/tree-view/navigation/get-first-node.js +0 -7
- package/dist/tree-view/navigation/get-last-node.d.ts +0 -1
- package/dist/tree-view/navigation/get-last-node.js +0 -7
- package/dist/tree-view/navigation/get-next-node.d.ts +0 -1
- package/dist/tree-view/navigation/get-next-node.js +0 -13
- package/dist/tree-view/navigation/get-prev-node.d.ts +0 -1
- package/dist/tree-view/navigation/get-prev-node.js +0 -13
- package/dist/tree-view/panel/make-handle-navigation.d.ts +0 -2
- package/dist/tree-view/panel/make-handle-navigation.js +0 -39
- package/dist/tree-view/panel/make-handle-selection.d.ts +0 -2
- package/dist/tree-view/panel/make-handle-selection.js +0 -92
- package/dist/tree-view/panel/make-handle-typeahead.d.ts +0 -1
- package/dist/tree-view/panel/make-handle-typeahead.js +0 -45
- package/dist/tree-view/panel/panel.d.ts +0 -1
- package/dist/tree-view/panel/panel.js +0 -30
- package/dist/tree-view/panel/use-tree-navigation.d.ts +0 -1
- package/dist/tree-view/panel/use-tree-navigation.js +0 -63
- package/dist/tree-view/root.d.ts +0 -17
- package/dist/tree-view/root.js +0 -63
- package/dist/tree-view/utils/get-focusable-nodes.d.ts +0 -1
- package/dist/tree-view/utils/get-focusable-nodes.js +0 -5
- package/dist/tree-view/utils/get-focused-node.d.ts +0 -1
- package/dist/tree-view/utils/get-focused-node.js +0 -14
- package/dist/tree-view/utils/get-ids-between-nodes.d.ts +0 -1
- package/dist/tree-view/utils/get-ids-between-nodes.js +0 -15
- package/dist/tree-view/utils/get-panel.d.ts +0 -1
- package/dist/tree-view/utils/get-panel.js +0 -7
- package/dist/tree-view/utils/get-parent-node.d.ts +0 -1
- package/dist/tree-view/utils/get-parent-node.js +0 -10
- package/dist/tree-view/utils/get-sibling-branches.d.ts +0 -1
- package/dist/tree-view/utils/get-sibling-branches.js +0 -14
- package/dist/tree-view/utils/get-tree-node-id.d.ts +0 -1
- package/dist/tree-view/utils/get-tree-node-id.js +0 -3
- package/dist/tree-view/utils/is-branch-node.d.ts +0 -1
- package/dist/tree-view/utils/is-branch-node.js +0 -3
- package/dist/tree-view/utils/is-leaf-node.d.ts +0 -1
- package/dist/tree-view/utils/is-leaf-node.js +0 -3
- package/dist/tree-view/utils/is-tree-node-disabled.d.ts +0 -1
- package/dist/tree-view/utils/is-tree-node-disabled.js +0 -3
- package/dist/tree-view/utils/select-node.d.ts +0 -2
- package/dist/tree-view/utils/select-node.js +0 -15
- package/dist/tree-view/utils/toggle-all-selections.d.ts +0 -2
- package/dist/tree-view/utils/toggle-all-selections.js +0 -9
- package/dist/tree-view/utils/toggle-selection.d.ts +0 -2
- package/dist/tree-view/utils/toggle-selection.js +0 -21
- package/dist/tree-view/virtualized/force-sync-scrolling.d.ts +0 -2
- package/dist/tree-view/virtualized/force-sync-scrolling.js +0 -23
- package/dist/tree-view/virtualized/get-virtual-tree-paths.d.ts +0 -2
- package/dist/tree-view/virtualized/get-virtual-tree-paths.js +0 -14
- package/dist/tree-view/virtualized/make-virtual-tree.d.ts +0 -31
- package/dist/tree-view/virtualized/make-virtual-tree.js +0 -90
- package/dist/tree-view/virtualized/use-flattened-tree.d.ts +0 -9
- package/dist/tree-view/virtualized/use-flattened-tree.js +0 -36
- package/dist/tree-view/virtualized/use-row-start-and-end.d.ts +0 -2
- package/dist/tree-view/virtualized/use-row-start-and-end.js +0 -27
- package/dist/tree-view/virtualized/use-virtualized-tree.d.ts +0 -22
- package/dist/tree-view/virtualized/use-virtualized-tree.js +0 -100
- package/dist/types/types.d.ts +0 -8
- package/dist/types/types.js +0 -1
- package/dist/utils/cycle-sorts.d.ts +0 -2
- package/dist/utils/cycle-sorts.js +0 -16
- package/dist/viewport/begin-editing.d.ts +0 -5
- package/dist/viewport/begin-editing.js +0 -15
- package/dist/viewport/viewport.d.ts +0 -1
- package/dist/viewport/viewport.js +0 -78
|
@@ -1,511 +0,0 @@
|
|
|
1
|
-
import {} from "../+types.js";
|
|
2
|
-
import { useRef } from "react";
|
|
3
|
-
import { traverse } from "./tree/traverse.js";
|
|
4
|
-
import { computed, dateComparator, effect, makeAtom, numberComparator, peek, signal, stringComparator, } from "@1771technologies/lytenyte-shared";
|
|
5
|
-
import { equal } from "@1771technologies/lytenyte-js-utils";
|
|
6
|
-
import { makeClientTree } from "./tree/client-tree.js";
|
|
7
|
-
import { computeFilteredRows } from "./filter/compute-filtered-rows.js";
|
|
8
|
-
import { builtIns } from "./built-ins/built-ins.js";
|
|
9
|
-
export function makeClientTreeDataSource(p) {
|
|
10
|
-
const data = signal(p.data);
|
|
11
|
-
const topData = signal(p.topData ?? []);
|
|
12
|
-
const bottomData = signal(p.bottomData ?? []);
|
|
13
|
-
const dataToSrc$ = computed(() => {
|
|
14
|
-
return new Map(data().map((c, i) => [c, i]));
|
|
15
|
-
});
|
|
16
|
-
const cache = new Map();
|
|
17
|
-
const centerNodes = computed(() => {
|
|
18
|
-
const nodes = [];
|
|
19
|
-
const d = data();
|
|
20
|
-
for (let i = 0; i < d.length; i++) {
|
|
21
|
-
if (!cache.has(i)) {
|
|
22
|
-
cache.set(i, {
|
|
23
|
-
id: "",
|
|
24
|
-
kind: "leaf",
|
|
25
|
-
data: d[i],
|
|
26
|
-
});
|
|
27
|
-
}
|
|
28
|
-
const node = cache.get(i);
|
|
29
|
-
node.data = d[i];
|
|
30
|
-
nodes.push(node);
|
|
31
|
-
}
|
|
32
|
-
return nodes;
|
|
33
|
-
});
|
|
34
|
-
const topNodes = computed(() => {
|
|
35
|
-
return topData().map((c, i) => ({ data: c, id: `top-${i}`, kind: "leaf" }));
|
|
36
|
-
});
|
|
37
|
-
const botNodes = computed(() => {
|
|
38
|
-
return bottomData().map((c, i) => ({ data: c, id: `bottom-${i}`, kind: "leaf" }));
|
|
39
|
-
});
|
|
40
|
-
const pinnedIdMap = computed(() => {
|
|
41
|
-
const combined = new Map([...topNodes(), ...botNodes()].map((c) => [c.id, c]));
|
|
42
|
-
return combined;
|
|
43
|
-
});
|
|
44
|
-
const models = signal({
|
|
45
|
-
sort: [],
|
|
46
|
-
filter: {},
|
|
47
|
-
filterIn: {},
|
|
48
|
-
quickSearch: null,
|
|
49
|
-
agg: {},
|
|
50
|
-
groupExpansions: {},
|
|
51
|
-
});
|
|
52
|
-
const sortModel = computed(() => models().sort);
|
|
53
|
-
const filterModel = computed(() => models().filter);
|
|
54
|
-
const filterInModel = computed(() => models().filterIn);
|
|
55
|
-
const groupExpansions = computed(() => models().groupExpansions);
|
|
56
|
-
const aggModel = computed(() => models().agg);
|
|
57
|
-
const quickSearch = computed(() => models().quickSearch);
|
|
58
|
-
const grid$ = signal(null);
|
|
59
|
-
const snapshot = signal(0);
|
|
60
|
-
const tree = computed(() => {
|
|
61
|
-
snapshot();
|
|
62
|
-
const grid = grid$();
|
|
63
|
-
const rows = centerNodes();
|
|
64
|
-
const filtered = computeFilteredRows(rows, grid, filterModel(), filterInModel(), quickSearch(), grid?.state.quickSearchSensitivity.get() ?? "case-sensitive", false);
|
|
65
|
-
const rowAggModel = Object.entries(aggModel()).map(([name, agg]) => {
|
|
66
|
-
if (typeof agg.fn === "function") {
|
|
67
|
-
const fn = agg.fn;
|
|
68
|
-
return {
|
|
69
|
-
name,
|
|
70
|
-
fn: (rows) => fn(rows.map((c) => c.data), grid),
|
|
71
|
-
};
|
|
72
|
-
}
|
|
73
|
-
const key = agg.fn;
|
|
74
|
-
const fn = (data) => {
|
|
75
|
-
const fieldData = data.map((r) => grid?.api.columnField(name, { kind: "leaf", data: r.data }));
|
|
76
|
-
return builtIns[key](fieldData);
|
|
77
|
-
};
|
|
78
|
-
return { name, fn };
|
|
79
|
-
});
|
|
80
|
-
return makeClientTree({
|
|
81
|
-
rowData: filtered,
|
|
82
|
-
rowAggModel: grid ? rowAggModel : [],
|
|
83
|
-
rowBranchModel: p.getPathFromData,
|
|
84
|
-
rowIdGroup: p.rowIdBranch,
|
|
85
|
-
rowIdLeaf: p.rowIdLeaf,
|
|
86
|
-
});
|
|
87
|
-
});
|
|
88
|
-
const sortComparator = computed(() => {
|
|
89
|
-
const model = sortModel();
|
|
90
|
-
const grid = grid$();
|
|
91
|
-
if (!model.length || !grid)
|
|
92
|
-
return { fn: () => 0 };
|
|
93
|
-
const comparator = (l, r) => {
|
|
94
|
-
let res = 0;
|
|
95
|
-
for (const sortSpec of model) {
|
|
96
|
-
const sort = sortSpec.sort;
|
|
97
|
-
const columnId = sortSpec.columnId;
|
|
98
|
-
const ld = l.kind === 2
|
|
99
|
-
? { kind: "branch", data: l.data, key: l.key }
|
|
100
|
-
: { kind: "leaf", data: l.data.data };
|
|
101
|
-
const rd = r.kind === 2
|
|
102
|
-
? { kind: "branch", data: r.data, key: r.key }
|
|
103
|
-
: { kind: "leaf", data: r.data.data };
|
|
104
|
-
if (sort.kind === "custom") {
|
|
105
|
-
res = sort.comparator(ld, rd, sort.options ?? {});
|
|
106
|
-
}
|
|
107
|
-
else if (sort.kind === "number") {
|
|
108
|
-
const left = grid.api.columnField(columnId, ld);
|
|
109
|
-
const right = grid.api.columnField(columnId, rd);
|
|
110
|
-
res = numberComparator(left, right, sort.options ?? {});
|
|
111
|
-
}
|
|
112
|
-
else if (sort.kind === "date") {
|
|
113
|
-
const left = grid.api.columnField(columnId, ld);
|
|
114
|
-
const right = grid.api.columnField(columnId, rd);
|
|
115
|
-
res = dateComparator(left, right, sort.options ?? {});
|
|
116
|
-
}
|
|
117
|
-
else if (sort.kind === "string") {
|
|
118
|
-
const left = grid.api.columnField(columnId, ld);
|
|
119
|
-
const right = grid.api.columnField(columnId, rd);
|
|
120
|
-
res = stringComparator(left, right, sort.options ?? {});
|
|
121
|
-
}
|
|
122
|
-
else {
|
|
123
|
-
res = 0;
|
|
124
|
-
}
|
|
125
|
-
res = sortSpec.isDescending ? -res : res;
|
|
126
|
-
if (res !== 0)
|
|
127
|
-
break;
|
|
128
|
-
}
|
|
129
|
-
return res;
|
|
130
|
-
};
|
|
131
|
-
return { fn: comparator };
|
|
132
|
-
});
|
|
133
|
-
const idToNode = computed(() => {
|
|
134
|
-
const map = new Map();
|
|
135
|
-
traverse(tree().root, (node) => {
|
|
136
|
-
map.set(node.id, node);
|
|
137
|
-
});
|
|
138
|
-
return map;
|
|
139
|
-
});
|
|
140
|
-
const initialized = signal(false);
|
|
141
|
-
const flat = computed(() => {
|
|
142
|
-
if (!initialized())
|
|
143
|
-
return { flat: [], idMap: new Map(), idToIndexMap: new Map() };
|
|
144
|
-
const idMap = new Map();
|
|
145
|
-
const idToIndexMap = new Map();
|
|
146
|
-
const flattened = [];
|
|
147
|
-
const comparator = sortComparator();
|
|
148
|
-
const expansions = groupExpansions();
|
|
149
|
-
const defaultExpansion = grid$()?.state.rowGroupDefaultExpansion.get() ?? false;
|
|
150
|
-
let index = topNodes().length;
|
|
151
|
-
traverse(tree().root, (node) => {
|
|
152
|
-
if (node.kind === 1) {
|
|
153
|
-
node.data.id = node.id;
|
|
154
|
-
flattened.push(node.data);
|
|
155
|
-
}
|
|
156
|
-
else {
|
|
157
|
-
flattened.push({
|
|
158
|
-
kind: "branch",
|
|
159
|
-
data: node.data,
|
|
160
|
-
id: node.id,
|
|
161
|
-
key: node.key,
|
|
162
|
-
depth: node.depth,
|
|
163
|
-
});
|
|
164
|
-
}
|
|
165
|
-
idMap.set(node.id, flattened.at(-1));
|
|
166
|
-
idToIndexMap.set(node.id, index);
|
|
167
|
-
index++;
|
|
168
|
-
if (node.kind === 2) {
|
|
169
|
-
const expanded = expansions[node.id] ??
|
|
170
|
-
(typeof defaultExpansion === "number"
|
|
171
|
-
? node.depth <= defaultExpansion
|
|
172
|
-
: defaultExpansion);
|
|
173
|
-
return expanded;
|
|
174
|
-
}
|
|
175
|
-
}, comparator.fn);
|
|
176
|
-
return { flat: flattened, idMap, idToIndexMap };
|
|
177
|
-
});
|
|
178
|
-
const flatLength = computed(() => flat().flat.length);
|
|
179
|
-
const cleanup = [];
|
|
180
|
-
const init = (grid) => {
|
|
181
|
-
while (cleanup.length)
|
|
182
|
-
cleanup.pop()?.();
|
|
183
|
-
grid$.set(grid);
|
|
184
|
-
const store = grid.state.rowDataStore;
|
|
185
|
-
// Monitor row count changes
|
|
186
|
-
const centerCount = flatLength();
|
|
187
|
-
const top = topData().length;
|
|
188
|
-
const bottom = bottomData().length;
|
|
189
|
-
store.rowCenterCount.set(centerCount);
|
|
190
|
-
store.rowTopCount.set(top);
|
|
191
|
-
store.rowBottomCount.set(bottom);
|
|
192
|
-
cleanup.push(effect(() => {
|
|
193
|
-
store.rowCenterCount.set(flatLength());
|
|
194
|
-
store.rowTopCount.set(topData().length);
|
|
195
|
-
store.rowBottomCount.set(bottomData().length);
|
|
196
|
-
grid.state.rowDataStore.rowClearCache();
|
|
197
|
-
}));
|
|
198
|
-
const sort = grid.state.sortModel.get();
|
|
199
|
-
const filter = grid.state.filterModel.get();
|
|
200
|
-
const filterIn = grid.state.filterInModel.get();
|
|
201
|
-
const agg = grid.state.aggModel.get();
|
|
202
|
-
const quickSearch = grid.state.quickSearch.get();
|
|
203
|
-
const groupExpansions = grid.state.rowGroupExpansions.get();
|
|
204
|
-
models.set({
|
|
205
|
-
agg,
|
|
206
|
-
filter,
|
|
207
|
-
filterIn,
|
|
208
|
-
groupExpansions,
|
|
209
|
-
quickSearch,
|
|
210
|
-
sort,
|
|
211
|
-
});
|
|
212
|
-
initialized.set(true);
|
|
213
|
-
cleanup.push(effect(() => {
|
|
214
|
-
models.set({
|
|
215
|
-
// @ts-expect-error The $ is defined, but only internally
|
|
216
|
-
sort: grid.state.sortModel.$(),
|
|
217
|
-
// @ts-expect-error The $ is defined, but only internally
|
|
218
|
-
agg: grid.state.aggModel.$(),
|
|
219
|
-
// @ts-expect-error The $ is defined, but only internally
|
|
220
|
-
filter: grid.state.filterModel.$(),
|
|
221
|
-
// @ts-expect-error The $ is defined, but only internally
|
|
222
|
-
group: grid.state.rowGroupModel.$(),
|
|
223
|
-
// @ts-expect-error The $ is defined, but only internally
|
|
224
|
-
groupExpansions: grid.state.rowGroupExpansions.$(),
|
|
225
|
-
// @ts-expect-error The $ is defined, but only internally
|
|
226
|
-
columnPivotGroupExpansions: grid.state.columnPivotColumnGroupExpansions.$(),
|
|
227
|
-
// @ts-expect-error The $ is defined, but only internally
|
|
228
|
-
filterIn: grid.state.filterInModel.$(),
|
|
229
|
-
// @ts-expect-error The $ is defined, but only internally
|
|
230
|
-
quickSearch: grid.state.quickSearch.$(),
|
|
231
|
-
});
|
|
232
|
-
grid.state.rowDataStore.rowClearCache();
|
|
233
|
-
}));
|
|
234
|
-
};
|
|
235
|
-
const rowById = (id) => {
|
|
236
|
-
const pinned = peek(pinnedIdMap);
|
|
237
|
-
if (pinned.has(id))
|
|
238
|
-
return pinned.get(id);
|
|
239
|
-
const t = peek(flat);
|
|
240
|
-
return t.idMap.get(id) ?? null;
|
|
241
|
-
};
|
|
242
|
-
const rowByIndex = (index) => {
|
|
243
|
-
const top = peek(topNodes);
|
|
244
|
-
const bot = peek(botNodes);
|
|
245
|
-
const center = peek(flat).flat;
|
|
246
|
-
const topOffset = top.length;
|
|
247
|
-
const centerOffset = topOffset + center.length;
|
|
248
|
-
const botOffset = centerOffset + bot.length;
|
|
249
|
-
if (index < topOffset)
|
|
250
|
-
return top[index];
|
|
251
|
-
if (index < centerOffset)
|
|
252
|
-
return center[index - topOffset];
|
|
253
|
-
if (index < botOffset)
|
|
254
|
-
return bot[index - centerOffset];
|
|
255
|
-
return null;
|
|
256
|
-
};
|
|
257
|
-
const rowUpdate = (updates) => {
|
|
258
|
-
const grid = peek(grid$);
|
|
259
|
-
const d = peek(data);
|
|
260
|
-
const idMap = peek(idToNode);
|
|
261
|
-
const dataToSrc = peek(dataToSrc$);
|
|
262
|
-
for (const [key, next] of updates.entries()) {
|
|
263
|
-
const row = typeof key === "string" ? rowById(key) : rowByIndex(key);
|
|
264
|
-
const treeNode = typeof key === "string" ? idMap.get(key) : null;
|
|
265
|
-
if ((!row && !treeNode) || !grid) {
|
|
266
|
-
console.error(`Failed to find the row with identifier ${key} which is being updated.`);
|
|
267
|
-
continue;
|
|
268
|
-
}
|
|
269
|
-
if (row?.kind === "branch") {
|
|
270
|
-
row.data = next;
|
|
271
|
-
}
|
|
272
|
-
else {
|
|
273
|
-
const data = row?.kind === "leaf" ? row.data : treeNode?.data.data;
|
|
274
|
-
const source = dataToSrc.get(data);
|
|
275
|
-
if (source == null) {
|
|
276
|
-
console.error(`Failed to find the row with identifier ${key} which is being updated.`);
|
|
277
|
-
continue;
|
|
278
|
-
}
|
|
279
|
-
d[source] = next;
|
|
280
|
-
cache.delete(source);
|
|
281
|
-
}
|
|
282
|
-
}
|
|
283
|
-
data.set([...d]);
|
|
284
|
-
snapshot.set((prev) => prev + 1);
|
|
285
|
-
grid.state.rowDataStore.rowClearCache();
|
|
286
|
-
};
|
|
287
|
-
const rowToIndex = (rowId) => {
|
|
288
|
-
const f = peek(flat);
|
|
289
|
-
const top = peek(topNodes);
|
|
290
|
-
const bot = peek(botNodes);
|
|
291
|
-
const topCount = top.length;
|
|
292
|
-
const center = f.flat.length;
|
|
293
|
-
const rowIndex = f.idToIndexMap.get(rowId);
|
|
294
|
-
if (rowIndex != null)
|
|
295
|
-
return rowIndex;
|
|
296
|
-
if (rowIndex == null) {
|
|
297
|
-
const foundTop = top.findIndex((row) => row.id === rowId);
|
|
298
|
-
if (foundTop !== -1)
|
|
299
|
-
return foundTop;
|
|
300
|
-
const foundBot = bot.findIndex((row) => row.id === rowId);
|
|
301
|
-
if (foundBot !== -1)
|
|
302
|
-
return foundBot + topCount + center;
|
|
303
|
-
}
|
|
304
|
-
return null;
|
|
305
|
-
};
|
|
306
|
-
const rowAllChildIds = (rowId) => {
|
|
307
|
-
const t = peek(tree);
|
|
308
|
-
const ids = [];
|
|
309
|
-
const node = t.idToNode.get(rowId);
|
|
310
|
-
if (node?.kind === 2) {
|
|
311
|
-
traverse(node, (n) => {
|
|
312
|
-
ids.push(n.id);
|
|
313
|
-
});
|
|
314
|
-
}
|
|
315
|
-
return ids;
|
|
316
|
-
};
|
|
317
|
-
return [
|
|
318
|
-
{
|
|
319
|
-
init,
|
|
320
|
-
rowById,
|
|
321
|
-
rowByIndex,
|
|
322
|
-
rowAllChildIds,
|
|
323
|
-
rowUpdate,
|
|
324
|
-
inFilterItems: (c) => {
|
|
325
|
-
const grid = peek(grid$);
|
|
326
|
-
if (!grid)
|
|
327
|
-
return [];
|
|
328
|
-
const data = peek(centerNodes);
|
|
329
|
-
const values = new Set(data.map((row) => {
|
|
330
|
-
const field = grid.api.columnField(c, row);
|
|
331
|
-
return field;
|
|
332
|
-
}));
|
|
333
|
-
if (p.transformInFilterItem) {
|
|
334
|
-
return p.transformInFilterItem({ column: c, values: [...values] });
|
|
335
|
-
}
|
|
336
|
-
return [...values].map((x) => ({ id: `${x}`, label: `${x}`, value: x }));
|
|
337
|
-
},
|
|
338
|
-
rowAdd: (newRows, place = "end") => {
|
|
339
|
-
data.set((prev) => {
|
|
340
|
-
if (!newRows.length)
|
|
341
|
-
return prev;
|
|
342
|
-
let next;
|
|
343
|
-
if (place === "beginning")
|
|
344
|
-
next = [...newRows, ...prev];
|
|
345
|
-
else if (place === "end")
|
|
346
|
-
next = [...prev, ...newRows];
|
|
347
|
-
else {
|
|
348
|
-
next = [...prev];
|
|
349
|
-
next.splice(place, 0, ...newRows);
|
|
350
|
-
}
|
|
351
|
-
return next;
|
|
352
|
-
});
|
|
353
|
-
const grid = peek(grid$);
|
|
354
|
-
grid?.state.rowDataStore.rowClearCache();
|
|
355
|
-
},
|
|
356
|
-
rowDelete: (rows) => {
|
|
357
|
-
const rowData = new Set(rows
|
|
358
|
-
.map((c) => {
|
|
359
|
-
if (typeof c === "number")
|
|
360
|
-
return rowByIndex(c)?.data;
|
|
361
|
-
else
|
|
362
|
-
return rowById(c)?.data;
|
|
363
|
-
})
|
|
364
|
-
.filter((c) => !!c));
|
|
365
|
-
data.set((prev) => {
|
|
366
|
-
if (!rowData.size)
|
|
367
|
-
return prev;
|
|
368
|
-
return prev.filter((d) => !rowData.has(d));
|
|
369
|
-
});
|
|
370
|
-
const grid = peek(grid$);
|
|
371
|
-
grid?.state.rowDataStore.rowClearCache();
|
|
372
|
-
},
|
|
373
|
-
rowSetBotData: (data) => {
|
|
374
|
-
bottomData.set(data);
|
|
375
|
-
const grid = peek(grid$);
|
|
376
|
-
grid?.state.rowDataStore.rowClearCache();
|
|
377
|
-
},
|
|
378
|
-
rowSetTopData: (data) => {
|
|
379
|
-
topData.set(data);
|
|
380
|
-
const grid = peek(grid$);
|
|
381
|
-
grid?.state.rowDataStore.rowClearCache();
|
|
382
|
-
},
|
|
383
|
-
rowSetCenterData: (d) => {
|
|
384
|
-
data.set(d);
|
|
385
|
-
const grid = peek(grid$);
|
|
386
|
-
grid?.state.rowDataStore.rowClearCache();
|
|
387
|
-
cache.clear();
|
|
388
|
-
},
|
|
389
|
-
rowExpand: (expansions) => {
|
|
390
|
-
const grid = peek(grid$);
|
|
391
|
-
if (!grid)
|
|
392
|
-
return;
|
|
393
|
-
grid.state.rowGroupExpansions.set((prev) => ({ ...prev, ...expansions }));
|
|
394
|
-
},
|
|
395
|
-
rowToIndex,
|
|
396
|
-
rowSelect: (params) => {
|
|
397
|
-
const grid = peek(grid$);
|
|
398
|
-
if (!grid)
|
|
399
|
-
return;
|
|
400
|
-
if (params.mode === "none")
|
|
401
|
-
return;
|
|
402
|
-
if (params.mode === "single") {
|
|
403
|
-
if (params.deselect) {
|
|
404
|
-
grid.state.rowSelectedIds.set(new Set());
|
|
405
|
-
}
|
|
406
|
-
else {
|
|
407
|
-
grid.state.rowSelectedIds.set(new Set([params.startId]));
|
|
408
|
-
}
|
|
409
|
-
return;
|
|
410
|
-
}
|
|
411
|
-
const ids = new Set();
|
|
412
|
-
if (params.startId === params.endId) {
|
|
413
|
-
ids.add(params.startId);
|
|
414
|
-
if (params.selectChildren) {
|
|
415
|
-
rowAllChildIds(params.startId).forEach((c) => ids.add(c));
|
|
416
|
-
}
|
|
417
|
-
}
|
|
418
|
-
else {
|
|
419
|
-
const first = rowToIndex(params.startId);
|
|
420
|
-
const last = rowToIndex(params.endId);
|
|
421
|
-
if (first == null || last == null)
|
|
422
|
-
return;
|
|
423
|
-
const start = Math.min(first, last);
|
|
424
|
-
const end = Math.max(first, last);
|
|
425
|
-
for (let i = start; i <= end; i++) {
|
|
426
|
-
const row = rowByIndex(i);
|
|
427
|
-
if (!row)
|
|
428
|
-
continue;
|
|
429
|
-
if (params.selectChildren) {
|
|
430
|
-
rowAllChildIds(row.id).forEach((c) => ids.add(c));
|
|
431
|
-
}
|
|
432
|
-
if (row?.id)
|
|
433
|
-
ids.add(row.id);
|
|
434
|
-
}
|
|
435
|
-
}
|
|
436
|
-
if (params.deselect) {
|
|
437
|
-
const current = grid.state.rowSelectedIds.get();
|
|
438
|
-
const next = current.difference(ids);
|
|
439
|
-
grid.state.rowSelectedIds.set(next);
|
|
440
|
-
}
|
|
441
|
-
else {
|
|
442
|
-
const current = grid.state.rowSelectedIds.get();
|
|
443
|
-
const next = current.union(ids);
|
|
444
|
-
grid.state.rowSelectedIds.set(next);
|
|
445
|
-
}
|
|
446
|
-
},
|
|
447
|
-
rowSelectAll: (params) => {
|
|
448
|
-
const grid = peek(grid$);
|
|
449
|
-
if (!grid)
|
|
450
|
-
return;
|
|
451
|
-
if (params.deselect) {
|
|
452
|
-
grid.state.rowSelectedIds.set(new Set());
|
|
453
|
-
return;
|
|
454
|
-
}
|
|
455
|
-
const t = peek(tree);
|
|
456
|
-
grid.state.rowSelectedIds.set(new Set(t.idsAll));
|
|
457
|
-
},
|
|
458
|
-
rowData: (section) => {
|
|
459
|
-
const d = [];
|
|
460
|
-
if (section === "top" || section === "flat") {
|
|
461
|
-
d.push(...peek(topData));
|
|
462
|
-
}
|
|
463
|
-
if (section === "center" || section === "flat") {
|
|
464
|
-
d.push(...peek(data));
|
|
465
|
-
}
|
|
466
|
-
if (section === "bottom" || section === "flat") {
|
|
467
|
-
d.push(...peek(bottomData));
|
|
468
|
-
}
|
|
469
|
-
return d;
|
|
470
|
-
},
|
|
471
|
-
rowAreAllSelected: (rowId) => {
|
|
472
|
-
const g = grid$();
|
|
473
|
-
if (!g)
|
|
474
|
-
return false;
|
|
475
|
-
const selected = g.state.rowSelectedIds.get();
|
|
476
|
-
if (rowId) {
|
|
477
|
-
const row = rowById(rowId);
|
|
478
|
-
if (!row)
|
|
479
|
-
return false;
|
|
480
|
-
const childIds = new Set(rowAllChildIds(rowId));
|
|
481
|
-
return childIds.isSubsetOf(selected);
|
|
482
|
-
}
|
|
483
|
-
const f = tree();
|
|
484
|
-
return f.idsAll.isSubsetOf(selected);
|
|
485
|
-
},
|
|
486
|
-
},
|
|
487
|
-
{
|
|
488
|
-
top: makeAtom(topData),
|
|
489
|
-
center: makeAtom(data),
|
|
490
|
-
bottom: makeAtom(bottomData),
|
|
491
|
-
},
|
|
492
|
-
];
|
|
493
|
-
}
|
|
494
|
-
export function useClientTreeDataSource(p) {
|
|
495
|
-
const ds = useRef(null);
|
|
496
|
-
const dataAtomRef = useRef(null);
|
|
497
|
-
if (!ds.current)
|
|
498
|
-
[ds.current, dataAtomRef.current] = makeClientTreeDataSource(p);
|
|
499
|
-
const da = dataAtomRef.current;
|
|
500
|
-
if (p.reflectData) {
|
|
501
|
-
// Need to queue the microtask since it we cannot update state during render.
|
|
502
|
-
if (p.data !== da.center.get())
|
|
503
|
-
queueMicrotask(() => ds.current.rowSetCenterData(p.data));
|
|
504
|
-
if (!equal(p.topData ?? [], da.top.get())) {
|
|
505
|
-
queueMicrotask(() => ds.current.rowSetTopData(p.topData ?? []));
|
|
506
|
-
}
|
|
507
|
-
if (!equal(p.bottomData ?? [], da.bottom.get()))
|
|
508
|
-
queueMicrotask(() => ds.current.rowSetBotData(p.bottomData ?? []));
|
|
509
|
-
}
|
|
510
|
-
return ds.current;
|
|
511
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const ROOT_LEAF_PREFIX = "__|#-Root-#|__";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export const ROOT_LEAF_PREFIX = "__|#-Root-#|__";
|
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* The root of the async tree. This is the entry point of the tree.
|
|
3
|
-
*/
|
|
4
|
-
export type TreeRoot<K, D> = {
|
|
5
|
-
readonly kind: "root";
|
|
6
|
-
readonly byPath: Map<string | null, LeafOrParent<K, D>>;
|
|
7
|
-
readonly byIndex: Map<number, LeafOrParent<K, D>>;
|
|
8
|
-
readonly size: number;
|
|
9
|
-
readonly asOf: number;
|
|
10
|
-
};
|
|
11
|
-
export type TreeParent<K, D> = {
|
|
12
|
-
readonly kind: "parent";
|
|
13
|
-
readonly relIndex: number;
|
|
14
|
-
readonly data: K;
|
|
15
|
-
readonly asOf: number;
|
|
16
|
-
readonly byPath: Map<string | null, LeafOrParent<K, D>>;
|
|
17
|
-
readonly byIndex: Map<number, LeafOrParent<K, D>>;
|
|
18
|
-
readonly size: number;
|
|
19
|
-
readonly path: string | null;
|
|
20
|
-
readonly parent: TreeParent<K, D> | TreeRoot<K, D>;
|
|
21
|
-
};
|
|
22
|
-
export type TreeLeaf<K, D> = {
|
|
23
|
-
readonly kind: "leaf";
|
|
24
|
-
readonly relIndex: number;
|
|
25
|
-
readonly data: D;
|
|
26
|
-
readonly asOf: number;
|
|
27
|
-
readonly parent: TreeParent<K, D> | TreeRoot<K, D>;
|
|
28
|
-
readonly path: string;
|
|
29
|
-
};
|
|
30
|
-
export type LeafOrParent<K, D> = TreeLeaf<K, D> | TreeParent<K, D>;
|
|
31
|
-
export type TreeRootAndApi<K, D> = TreeRoot<K, D> & {
|
|
32
|
-
readonly set: (payload: SetDataAction<K, D>) => void;
|
|
33
|
-
readonly delete: (path: DeleteDataAction) => void;
|
|
34
|
-
readonly get: (payload: GetDataAction) => TreeRoot<K, D> | TreeParent<K, D> | null;
|
|
35
|
-
};
|
|
36
|
-
export interface SetDataAction<K = any, D = any> {
|
|
37
|
-
readonly path: (string | null)[];
|
|
38
|
-
readonly asOf?: number;
|
|
39
|
-
readonly size?: number;
|
|
40
|
-
readonly items?: ({
|
|
41
|
-
kind: "parent";
|
|
42
|
-
path: string | null;
|
|
43
|
-
data: K;
|
|
44
|
-
relIndex: number;
|
|
45
|
-
size: number;
|
|
46
|
-
} | {
|
|
47
|
-
kind: "leaf";
|
|
48
|
-
data: D;
|
|
49
|
-
relIndex: number;
|
|
50
|
-
})[];
|
|
51
|
-
}
|
|
52
|
-
export interface DeleteDataAction {
|
|
53
|
-
readonly path: (string | null)[];
|
|
54
|
-
readonly paths?: string[];
|
|
55
|
-
readonly relIndices?: number[];
|
|
56
|
-
}
|
|
57
|
-
export interface GetDataAction {
|
|
58
|
-
readonly path: (string | null)[];
|
|
59
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import { getParentNodeByPath } from "./get-parent-node-by-path.js";
|
|
2
|
-
export function applyDeleteActionToTree(p, tree) {
|
|
3
|
-
// No op. We aren't deleting keys or indices
|
|
4
|
-
if (!p.relIndices?.length && !p.paths?.length)
|
|
5
|
-
return;
|
|
6
|
-
const parentNode = getParentNodeByPath(tree, p.path);
|
|
7
|
-
if (!parentNode)
|
|
8
|
-
return;
|
|
9
|
-
if (p.relIndices) {
|
|
10
|
-
for (const rel of p.relIndices) {
|
|
11
|
-
const node = parentNode.byIndex.get(rel);
|
|
12
|
-
if (!node)
|
|
13
|
-
continue;
|
|
14
|
-
parentNode.byPath.delete(node.path);
|
|
15
|
-
parentNode.byIndex.delete(rel);
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
if (p.paths) {
|
|
19
|
-
for (const path of p.paths) {
|
|
20
|
-
const node = parentNode.byPath.get(path);
|
|
21
|
-
if (!node)
|
|
22
|
-
continue;
|
|
23
|
-
parentNode.byPath.delete(node.path);
|
|
24
|
-
parentNode.byIndex.delete(node.relIndex);
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
}
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import { maybeApplyParentRemoveSelf } from "./maybe-apply-parent-remove-self.js";
|
|
2
|
-
import { checkSetActionItemKeysAreUnique } from "./check-set-action-item-keys-are-unique.js";
|
|
3
|
-
import { checkSetActionItemKeysAreValid } from "./check-set-action-item-keys-are-valid.js";
|
|
4
|
-
import { checkSetActionItemKeysFit } from "./check-set-action-item-keys-fit.js";
|
|
5
|
-
import { checkSetActionItemKinds } from "./check-set-action-item-kinds.js";
|
|
6
|
-
import { getParentNodeByPath } from "./get-parent-node-by-path.js";
|
|
7
|
-
import { isSetActionANoOpOnNode } from "./is-set-action-a-no-op-on-node.js";
|
|
8
|
-
import { maybeApplyResize } from "./maybe-apply-resize.js";
|
|
9
|
-
import { maybeApplySetActionItems } from "./maybe-apply-set-action-items.js";
|
|
10
|
-
export function applySetActionToTree(p, root) {
|
|
11
|
-
// If we are not adding items and we are not resizing a node, then we just
|
|
12
|
-
// return our previous data and skip the update. This is effectively a no-op.
|
|
13
|
-
if (!p.items?.length && p.size == null)
|
|
14
|
-
return false;
|
|
15
|
-
// We need to find the parent that we are adding data to. Its possible the path is invalid.
|
|
16
|
-
// If we encounter an invalid path we return early without change. An invalid path is a
|
|
17
|
-
// path that does not exist or where there is a leaf node at some point in the path.
|
|
18
|
-
const pathNode = getParentNodeByPath(root, p.path);
|
|
19
|
-
if (!pathNode)
|
|
20
|
-
return false;
|
|
21
|
-
if (!checkSetActionItemKeysFit(p, pathNode))
|
|
22
|
-
return false;
|
|
23
|
-
if (!checkSetActionItemKinds(p))
|
|
24
|
-
return false;
|
|
25
|
-
if (!checkSetActionItemKeysAreValid(p))
|
|
26
|
-
return false;
|
|
27
|
-
if (!checkSetActionItemKeysAreUnique(p))
|
|
28
|
-
return false;
|
|
29
|
-
if (isSetActionANoOpOnNode(p, pathNode))
|
|
30
|
-
return false;
|
|
31
|
-
maybeApplyResize(pathNode, p.size, p.asOf ?? Date.now());
|
|
32
|
-
if (maybeApplyParentRemoveSelf(pathNode))
|
|
33
|
-
return true;
|
|
34
|
-
maybeApplySetActionItems(p, pathNode);
|
|
35
|
-
return true;
|
|
36
|
-
}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { ROOT_LEAF_PREFIX } from "./+constants.async-tree.js";
|
|
2
|
-
const invalidItemKeyDupes = "Invalid set action items, the same 'key' appears more than once";
|
|
3
|
-
const invalidItemPathsDupes = "Invalid set action items, the same 'path' appears more than once";
|
|
4
|
-
export function checkSetActionItemKeysAreUnique(p) {
|
|
5
|
-
const seenKeys = new Set();
|
|
6
|
-
const seenPaths = new Set();
|
|
7
|
-
if (!p.items?.length)
|
|
8
|
-
return true;
|
|
9
|
-
for (let i = p.items.length - 1; i >= 0; i--) {
|
|
10
|
-
const item = p.items[i];
|
|
11
|
-
if (seenKeys.has(item.relIndex)) {
|
|
12
|
-
console.error(invalidItemKeyDupes, p);
|
|
13
|
-
return false;
|
|
14
|
-
}
|
|
15
|
-
const pathId = item.kind === "leaf" ? `${p.path.at(-1) ?? ROOT_LEAF_PREFIX}#${item.relIndex}` : item.path;
|
|
16
|
-
if (seenPaths.has(pathId)) {
|
|
17
|
-
console.error(invalidItemPathsDupes, p);
|
|
18
|
-
return false;
|
|
19
|
-
}
|
|
20
|
-
seenPaths.add(pathId);
|
|
21
|
-
seenKeys.add(item.relIndex);
|
|
22
|
-
}
|
|
23
|
-
return true;
|
|
24
|
-
}
|