@1771technologies/lytenyte-pro 1.0.12-dev.1 → 1.0.12-dev.2
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/dist/+types.d.ts +5836 -0
- package/dist/+types.js +1 -0
- package/dist/cell-selection/adjust-rect-for-row-and-cell-span.d.ts +2 -0
- package/dist/cell-selection/adjust-rect-for-row-and-cell-span.js +43 -0
- package/dist/cell-selection/are-rects-equal.d.ts +2 -0
- package/dist/cell-selection/are-rects-equal.js +6 -0
- package/dist/cell-selection/bound-selection-rect.d.ts +2 -0
- package/dist/cell-selection/bound-selection-rect.js +17 -0
- package/dist/cell-selection/cell-selection-containers.d.ts +3 -0
- package/dist/cell-selection/cell-selection-containers.js +91 -0
- package/dist/cell-selection/cell-selection-driver.d.ts +1 -0
- package/dist/cell-selection/cell-selection-driver.js +285 -0
- package/dist/cell-selection/cell-style-row.d.ts +8 -0
- package/dist/cell-selection/cell-style-row.js +84 -0
- package/dist/cell-selection/deselect-rect-range.d.ts +2 -0
- package/dist/cell-selection/deselect-rect-range.js +43 -0
- package/dist/cell-selection/expand-cell-selection-down.d.ts +5 -0
- package/dist/cell-selection/expand-cell-selection-down.js +39 -0
- package/dist/cell-selection/expand-cell-selection-end.d.ts +5 -0
- package/dist/cell-selection/expand-cell-selection-end.js +40 -0
- package/dist/cell-selection/expand-cell-selection-start.d.ts +5 -0
- package/dist/cell-selection/expand-cell-selection-start.js +39 -0
- package/dist/cell-selection/expand-cell-selection-up.d.ts +5 -0
- package/dist/cell-selection/expand-cell-selection-up.js +39 -0
- package/dist/cell-selection/full-width-start-end-index.d.ts +2 -0
- package/dist/cell-selection/full-width-start-end-index.js +5 -0
- package/dist/cell-selection/get-root-cell.d.ts +2 -0
- package/dist/cell-selection/get-root-cell.js +6 -0
- package/dist/cell-selection/index.d.ts +18 -0
- package/dist/cell-selection/index.js +18 -0
- package/dist/cell-selection/is-bottom-rect.d.ts +2 -0
- package/dist/cell-selection/is-bottom-rect.js +7 -0
- package/dist/cell-selection/is-center-col-rect.d.ts +5 -0
- package/dist/cell-selection/is-center-col-rect.js +5 -0
- package/dist/cell-selection/is-center-rect.d.ts +2 -0
- package/dist/cell-selection/is-center-rect.js +5 -0
- package/dist/cell-selection/is-end-rect.d.ts +5 -0
- package/dist/cell-selection/is-end-rect.js +4 -0
- package/dist/cell-selection/is-overlapping-rect.d.ts +2 -0
- package/dist/cell-selection/is-overlapping-rect.js +6 -0
- package/dist/cell-selection/is-start-rect.d.ts +5 -0
- package/dist/cell-selection/is-start-rect.js +4 -0
- package/dist/cell-selection/is-top-rect.d.ts +2 -0
- package/dist/cell-selection/is-top-rect.js +4 -0
- package/dist/cell-selection/is-within-selection-rect.d.ts +2 -0
- package/dist/cell-selection/is-within-selection-rect.js +3 -0
- package/dist/cell-selection/split-cell-selection-rect.d.ts +46 -0
- package/dist/cell-selection/split-cell-selection-rect.js +88 -0
- package/dist/cell-selection/split-on-pivot.d.ts +3 -0
- package/dist/cell-selection/split-on-pivot.js +50 -0
- package/dist/cell-selection/update-additive-cell-selection.d.ts +5 -0
- package/dist/cell-selection/update-additive-cell-selection.js +23 -0
- package/dist/cell-selection/use-edge-scroll.d.ts +10 -0
- package/dist/cell-selection/use-edge-scroll.js +66 -0
- package/dist/cells/+types.cell.d.ts +13 -0
- package/dist/cells/+types.cell.js +1 -0
- package/dist/cells/cell-default.d.ts +2 -0
- package/dist/cells/cell-default.js +8 -0
- package/dist/cells/cell-editor.d.ts +6 -0
- package/dist/cells/cell-editor.js +103 -0
- package/dist/cells/cell-spacer.d.ts +9 -0
- package/dist/cells/cell-spacer.js +34 -0
- package/dist/cells/cell.d.ts +5 -0
- package/dist/cells/cell.js +43 -0
- package/dist/cells/use-cell-style.d.ts +3 -0
- package/dist/cells/use-cell-style.js +51 -0
- package/dist/column-manager/branch-lookup-context.d.ts +4 -0
- package/dist/column-manager/branch-lookup-context.js +3 -0
- package/dist/column-manager/branch.d.ts +15 -0
- package/dist/column-manager/branch.js +54 -0
- package/dist/column-manager/column-manager.d.ts +13 -0
- package/dist/column-manager/column-manager.js +18 -0
- package/dist/column-manager/context.d.ts +7 -0
- package/dist/column-manager/context.js +3 -0
- package/dist/column-manager/label.d.ts +5 -0
- package/dist/column-manager/label.js +18 -0
- package/dist/column-manager/leaf.d.ts +6 -0
- package/dist/column-manager/leaf.js +58 -0
- package/dist/column-manager/move-handle.d.ts +5 -0
- package/dist/column-manager/move-handle.js +73 -0
- package/dist/column-manager/panel.d.ts +1 -0
- package/dist/column-manager/panel.js +2 -0
- package/dist/column-manager/root.d.ts +8 -0
- package/dist/column-manager/root.js +7 -0
- package/dist/column-manager/use-column-manager.d.ts +10 -0
- package/dist/column-manager/use-column-manager.js +24 -0
- package/dist/column-manager/use-columns-from-context.d.ts +3 -0
- package/dist/column-manager/use-columns-from-context.js +23 -0
- package/dist/column-manager/visibility-checkbox.d.ts +9 -0
- package/dist/column-manager/visibility-checkbox.js +30 -0
- package/dist/context.d.ts +10 -0
- package/dist/context.js +4 -0
- package/dist/filter-tree/branch.d.ts +13 -0
- package/dist/filter-tree/branch.js +21 -0
- package/dist/filter-tree/context.d.ts +27 -0
- package/dist/filter-tree/context.js +5 -0
- package/dist/filter-tree/filter-tree.d.ts +14 -0
- package/dist/filter-tree/filter-tree.js +18 -0
- package/dist/filter-tree/hooks/use-filter-tree.d.ts +38 -0
- package/dist/filter-tree/hooks/use-filter-tree.js +101 -0
- package/dist/filter-tree/hooks/use-tree-item.d.ts +8 -0
- package/dist/filter-tree/hooks/use-tree-item.js +116 -0
- package/dist/filter-tree/inclusion-checkbox.d.ts +9 -0
- package/dist/filter-tree/inclusion-checkbox.js +14 -0
- package/dist/filter-tree/label.d.ts +5 -0
- package/dist/filter-tree/label.js +18 -0
- package/dist/filter-tree/leaf.d.ts +6 -0
- package/dist/filter-tree/leaf.js +14 -0
- package/dist/filter-tree/root.d.ts +13 -0
- package/dist/filter-tree/root.js +30 -0
- package/dist/grid-box/+types.d.ts +15 -0
- package/dist/grid-box/+types.js +1 -0
- package/dist/grid-box/context.d.ts +9 -0
- package/dist/grid-box/context.js +3 -0
- package/dist/grid-box/grid-box.d.ts +12 -0
- package/dist/grid-box/grid-box.js +14 -0
- package/dist/grid-box/item.d.ts +10 -0
- package/dist/grid-box/item.js +63 -0
- package/dist/grid-box/panel.d.ts +1 -0
- package/dist/grid-box/panel.js +9 -0
- package/dist/grid-box/root.d.ts +9 -0
- package/dist/grid-box/root.js +8 -0
- package/dist/grid-box/use-aggregation-box-items.d.ts +18 -0
- package/dist/grid-box/use-aggregation-box-items.js +61 -0
- package/dist/grid-box/use-column-box-items.d.ts +34 -0
- package/dist/grid-box/use-column-box-items.js +78 -0
- package/dist/grid-box/use-row-group-box-items.d.ts +18 -0
- package/dist/grid-box/use-row-group-box-items.js +169 -0
- package/dist/grid-provider/context.d.ts +5 -0
- package/dist/grid-provider/context.js +2 -0
- package/dist/grid-provider/provider.d.ts +3 -0
- package/dist/grid-provider/provider.js +2 -0
- package/dist/grid-provider/use-grid.d.ts +3 -0
- package/dist/grid-provider/use-grid.js +3 -0
- package/dist/grid.d.ts +18 -0
- package/dist/grid.js +28 -0
- package/dist/header/header-cell.d.ts +10 -0
- package/dist/header/header-cell.js +22 -0
- package/dist/header/header-group-cell.d.ts +5 -0
- package/dist/header/header-group-cell.js +16 -0
- package/dist/header/header-row.d.ts +4 -0
- package/dist/header/header-row.js +10 -0
- package/dist/header/header.d.ts +1 -0
- package/dist/header/header.js +12 -0
- package/dist/header/resize-handler.d.ts +12 -0
- package/dist/header/resize-handler.js +136 -0
- package/dist/header/use-drag-move.d.ts +14 -0
- package/dist/header/use-drag-move.js +97 -0
- package/dist/header/use-header-cell-renderer.d.ts +4 -0
- package/dist/header/use-header-cell-renderer.js +36 -0
- package/dist/icons/index.d.ts +1 -0
- package/dist/icons/index.js +3 -0
- package/dist/index.d.ts +13 -0
- package/dist/index.js +13 -0
- package/dist/license.d.ts +3 -0
- package/dist/license.js +214 -0
- package/dist/listbox/context.d.ts +6 -0
- package/dist/listbox/context.js +3 -0
- package/dist/listbox/item.d.ts +1 -0
- package/dist/listbox/item.js +25 -0
- package/dist/listbox/panel.d.ts +1 -0
- package/dist/listbox/panel.js +50 -0
- package/dist/listbox/root.d.ts +6 -0
- package/dist/listbox/root.js +12 -0
- package/dist/root/dialog-driver.d.ts +1 -0
- package/dist/root/dialog-driver.js +21 -0
- package/dist/root/popover-driver.d.ts +1 -0
- package/dist/root/popover-driver.js +21 -0
- package/dist/root/root.d.ts +8 -0
- package/dist/root/root.js +125 -0
- package/dist/row-data-source-client/+constants.d.ts +2 -0
- package/dist/row-data-source-client/+constants.js +2 -0
- package/dist/row-data-source-client/+types.d.ts +27 -0
- package/dist/row-data-source-client/+types.js +1 -0
- package/dist/row-data-source-client/built-ins/avg.d.ts +10 -0
- package/dist/row-data-source-client/built-ins/avg.js +16 -0
- package/dist/row-data-source-client/built-ins/built-ins.d.ts +44 -0
- package/dist/row-data-source-client/built-ins/built-ins.js +44 -0
- package/dist/row-data-source-client/built-ins/count.d.ts +10 -0
- package/dist/row-data-source-client/built-ins/count.js +16 -0
- package/dist/row-data-source-client/built-ins/first.d.ts +10 -0
- package/dist/row-data-source-client/built-ins/first.js +12 -0
- package/dist/row-data-source-client/built-ins/group.d.ts +1 -0
- package/dist/row-data-source-client/built-ins/group.js +3 -0
- package/dist/row-data-source-client/built-ins/last.d.ts +10 -0
- package/dist/row-data-source-client/built-ins/last.js +12 -0
- package/dist/row-data-source-client/built-ins/max.d.ts +11 -0
- package/dist/row-data-source-client/built-ins/max.js +25 -0
- package/dist/row-data-source-client/built-ins/min.d.ts +11 -0
- package/dist/row-data-source-client/built-ins/min.js +25 -0
- package/dist/row-data-source-client/built-ins/sum.d.ts +10 -0
- package/dist/row-data-source-client/built-ins/sum.js +21 -0
- package/dist/row-data-source-client/filter/+types.d.ts +23 -0
- package/dist/row-data-source-client/filter/+types.js +1 -0
- package/dist/row-data-source-client/filter/compute-filtered-rows.d.ts +2 -0
- package/dist/row-data-source-client/filter/compute-filtered-rows.js +109 -0
- package/dist/row-data-source-client/pivots/create-agg-model.d.ts +6 -0
- package/dist/row-data-source-client/pivots/create-agg-model.js +13 -0
- package/dist/row-data-source-client/pivots/create-pivot-columns-from-paths.d.ts +2 -0
- package/dist/row-data-source-client/pivots/create-pivot-columns-from-paths.js +50 -0
- package/dist/row-data-source-client/pivots/create-pivot-columns.d.ts +2 -0
- package/dist/row-data-source-client/pivots/create-pivot-columns.js +22 -0
- package/dist/row-data-source-client/pivots/create-pivot-tree.d.ts +2 -0
- package/dist/row-data-source-client/pivots/create-pivot-tree.js +23 -0
- package/dist/row-data-source-client/tree/client-tree.d.ts +18 -0
- package/dist/row-data-source-client/tree/client-tree.js +76 -0
- package/dist/row-data-source-client/tree/evaluator-aggregation.d.ts +2 -0
- package/dist/row-data-source-client/tree/evaluator-aggregation.js +8 -0
- package/dist/row-data-source-client/tree/evaluator-group.d.ts +2 -0
- package/dist/row-data-source-client/tree/evaluator-group.js +9 -0
- package/dist/row-data-source-client/tree/traverse.d.ts +2 -0
- package/dist/row-data-source-client/tree/traverse.js +22 -0
- package/dist/row-data-source-client/use-client-data-source-paginated.d.ts +10 -0
- package/dist/row-data-source-client/use-client-data-source-paginated.js +572 -0
- package/dist/row-data-source-client/use-client-data-source.d.ts +10 -0
- package/dist/row-data-source-client/use-client-data-source.js +666 -0
- package/dist/row-data-source-client/use-client-tree-data-source.d.ts +9 -0
- package/dist/row-data-source-client/use-client-tree-data-source.js +511 -0
- package/dist/row-data-source-server/async-tree/+constants.async-tree.d.ts +1 -0
- package/dist/row-data-source-server/async-tree/+constants.async-tree.js +1 -0
- package/dist/row-data-source-server/async-tree/+types.async-tree.d.ts +59 -0
- package/dist/row-data-source-server/async-tree/+types.async-tree.js +1 -0
- package/dist/row-data-source-server/async-tree/apply-delete-action-to-tree.d.ts +2 -0
- package/dist/row-data-source-server/async-tree/apply-delete-action-to-tree.js +27 -0
- package/dist/row-data-source-server/async-tree/apply-set-action-to-tree.d.ts +2 -0
- package/dist/row-data-source-server/async-tree/apply-set-action-to-tree.js +36 -0
- package/dist/row-data-source-server/async-tree/check-set-action-item-keys-are-unique.d.ts +2 -0
- package/dist/row-data-source-server/async-tree/check-set-action-item-keys-are-unique.js +24 -0
- package/dist/row-data-source-server/async-tree/check-set-action-item-keys-are-valid.d.ts +2 -0
- package/dist/row-data-source-server/async-tree/check-set-action-item-keys-are-valid.js +14 -0
- package/dist/row-data-source-server/async-tree/check-set-action-item-keys-fit.d.ts +2 -0
- package/dist/row-data-source-server/async-tree/check-set-action-item-keys-fit.js +18 -0
- package/dist/row-data-source-server/async-tree/check-set-action-item-kinds.d.ts +2 -0
- package/dist/row-data-source-server/async-tree/check-set-action-item-kinds.js +14 -0
- package/dist/row-data-source-server/async-tree/get-parent-node-by-path.d.ts +2 -0
- package/dist/row-data-source-server/async-tree/get-parent-node-by-path.js +18 -0
- package/dist/row-data-source-server/async-tree/is-set-action-a-no-op-on-node.d.ts +2 -0
- package/dist/row-data-source-server/async-tree/is-set-action-a-no-op-on-node.js +3 -0
- package/dist/row-data-source-server/async-tree/make-async-tree.d.ts +2 -0
- package/dist/row-data-source-server/async-tree/make-async-tree.js +19 -0
- package/dist/row-data-source-server/async-tree/maybe-apply-parent-remove-self.d.ts +2 -0
- package/dist/row-data-source-server/async-tree/maybe-apply-parent-remove-self.js +8 -0
- package/dist/row-data-source-server/async-tree/maybe-apply-resize.d.ts +2 -0
- package/dist/row-data-source-server/async-tree/maybe-apply-resize.js +17 -0
- package/dist/row-data-source-server/async-tree/maybe-apply-set-action-items.d.ts +2 -0
- package/dist/row-data-source-server/async-tree/maybe-apply-set-action-items.js +52 -0
- package/dist/row-data-source-server/range-tree/range-tree.d.ts +66 -0
- package/dist/row-data-source-server/range-tree/range-tree.js +102 -0
- package/dist/row-data-source-server/server-data.d.ts +48 -0
- package/dist/row-data-source-server/server-data.js +378 -0
- package/dist/row-data-source-server/use-server-data-source.d.ts +3 -0
- package/dist/row-data-source-server/use-server-data-source.js +344 -0
- package/dist/row-data-source-server/utils/get-node-depth.d.ts +2 -0
- package/dist/row-data-source-server/utils/get-node-depth.js +9 -0
- package/dist/row-data-source-server/utils/get-node-path.d.ts +2 -0
- package/dist/row-data-source-server/utils/get-node-path.js +9 -0
- package/dist/row-data-source-server/utils/get-request-id.d.ts +1 -0
- package/dist/row-data-source-server/utils/get-request-id.js +6 -0
- package/dist/rows/row/context.d.ts +14 -0
- package/dist/rows/row/context.js +13 -0
- package/dist/rows/row/row.d.ts +7 -0
- package/dist/rows/row/row.js +25 -0
- package/dist/rows/row/use-row-context-value.d.ts +6 -0
- package/dist/rows/row/use-row-context-value.js +44 -0
- package/dist/rows/row-detail-row.d.ts +4 -0
- package/dist/rows/row-detail-row.js +130 -0
- package/dist/rows/row-full-width.d.ts +8 -0
- package/dist/rows/row-full-width.js +19 -0
- package/dist/rows/rows-container.d.ts +1 -0
- package/dist/rows/rows-container.js +9 -0
- package/dist/rows/rows-sections.d.ts +3 -0
- package/dist/rows/rows-sections.js +27 -0
- package/dist/rows/scrollers/native-scroller.d.ts +2 -0
- package/dist/rows/scrollers/native-scroller.js +4 -0
- package/dist/sort-manager/+types.d.ts +13 -0
- package/dist/sort-manager/+types.js +1 -0
- package/dist/sort-manager/context.d.ts +14 -0
- package/dist/sort-manager/context.js +5 -0
- package/dist/sort-manager/hooks/use-sort-manager.d.ts +15 -0
- package/dist/sort-manager/hooks/use-sort-manager.js +56 -0
- package/dist/sort-manager/hooks/use-sort-row-item.d.ts +51 -0
- package/dist/sort-manager/hooks/use-sort-row-item.js +145 -0
- package/dist/sort-manager/hooks/use-sortable-column-items.d.ts +5 -0
- package/dist/sort-manager/hooks/use-sortable-column-items.js +13 -0
- package/dist/sort-manager/root.d.ts +3 -0
- package/dist/sort-manager/root.js +14 -0
- package/dist/sort-manager/sort-add.d.ts +8 -0
- package/dist/sort-manager/sort-add.js +14 -0
- package/dist/sort-manager/sort-apply.d.ts +7 -0
- package/dist/sort-manager/sort-apply.js +24 -0
- package/dist/sort-manager/sort-cancel.d.ts +7 -0
- package/dist/sort-manager/sort-cancel.js +27 -0
- package/dist/sort-manager/sort-clear.d.ts +7 -0
- package/dist/sort-manager/sort-clear.js +22 -0
- package/dist/sort-manager/sort-column-select.d.ts +10 -0
- package/dist/sort-manager/sort-column-select.js +20 -0
- package/dist/sort-manager/sort-direction-select.d.ts +10 -0
- package/dist/sort-manager/sort-direction-select.js +24 -0
- package/dist/sort-manager/sort-manager.d.ts +16 -0
- package/dist/sort-manager/sort-manager.js +26 -0
- package/dist/sort-manager/sort-remove.d.ts +7 -0
- package/dist/sort-manager/sort-remove.js +14 -0
- package/dist/sort-manager/sort-row.d.ts +5 -0
- package/dist/sort-manager/sort-row.js +7 -0
- package/dist/sort-manager/sort-rows.d.ts +1 -0
- package/dist/sort-manager/sort-rows.js +6 -0
- package/dist/sort-manager/sort-value-select.d.ts +11 -0
- package/dist/sort-manager/sort-value-select.js +25 -0
- package/dist/sort-manager/utils/sort-item-to-sort-model.d.ts +3 -0
- package/dist/sort-manager/utils/sort-item-to-sort-model.js +62 -0
- package/dist/sort-manager/utils/sort-model-to-sort-items.d.ts +3 -0
- package/dist/sort-manager/utils/sort-model-to-sort-items.js +50 -0
- package/dist/state/+types.d.ts +35 -0
- package/dist/state/+types.js +1 -0
- package/dist/state/api/cell-root.d.ts +5 -0
- package/dist/state/api/cell-root.js +64 -0
- package/dist/state/api/column-autosize.d.ts +5 -0
- package/dist/state/api/column-autosize.js +72 -0
- package/dist/state/api/column-by-id.d.ts +2 -0
- package/dist/state/api/column-by-id.js +6 -0
- package/dist/state/api/column-field.d.ts +2 -0
- package/dist/state/api/column-field.js +23 -0
- package/dist/state/api/column-from-index.d.ts +2 -0
- package/dist/state/api/column-from-index.js +6 -0
- package/dist/state/api/column-group-toggle.d.ts +2 -0
- package/dist/state/api/column-group-toggle.js +10 -0
- package/dist/state/api/column-index.d.ts +2 -0
- package/dist/state/api/column-index.js +7 -0
- package/dist/state/api/column-move.d.ts +2 -0
- package/dist/state/api/column-move.js +49 -0
- package/dist/state/api/column-resize.d.ts +2 -0
- package/dist/state/api/column-resize.js +9 -0
- package/dist/state/api/column-update.d.ts +5 -0
- package/dist/state/api/column-update.js +26 -0
- package/dist/state/api/dialog-frame.d.ts +8 -0
- package/dist/state/api/dialog-frame.js +16 -0
- package/dist/state/api/edit-begin.d.ts +5 -0
- package/dist/state/api/edit-begin.js +87 -0
- package/dist/state/api/edit-end.d.ts +5 -0
- package/dist/state/api/edit-end.js +43 -0
- package/dist/state/api/edit-is-cell-active.d.ts +5 -0
- package/dist/state/api/edit-is-cell-active.js +22 -0
- package/dist/state/api/edit-update.d.ts +5 -0
- package/dist/state/api/edit-update.js +88 -0
- package/dist/state/api/event-listeners.d.ts +5 -0
- package/dist/state/api/event-listeners.js +19 -0
- package/dist/state/api/export-csv.d.ts +3 -0
- package/dist/state/api/export-csv.js +40 -0
- package/dist/state/api/export-data-rect.d.ts +2 -0
- package/dist/state/api/export-data-rect.js +24 -0
- package/dist/state/api/focus-cell.d.ts +5 -0
- package/dist/state/api/focus-cell.js +117 -0
- package/dist/state/api/popover-frame.d.ts +8 -0
- package/dist/state/api/popover-frame.js +16 -0
- package/dist/state/api/position-from-element.d.ts +2 -0
- package/dist/state/api/position-from-element.js +9 -0
- package/dist/state/api/row-by-id.d.ts +2 -0
- package/dist/state/api/row-by-id.js +5 -0
- package/dist/state/api/row-by-index.d.ts +2 -0
- package/dist/state/api/row-by-index.js +9 -0
- package/dist/state/api/row-detail-is-expanded.d.ts +2 -0
- package/dist/state/api/row-detail-is-expanded.js +6 -0
- package/dist/state/api/row-detail-rendered-height.d.ts +5 -0
- package/dist/state/api/row-detail-rendered-height.js +14 -0
- package/dist/state/api/row-detail-toggle.d.ts +2 -0
- package/dist/state/api/row-detail-toggle.js +32 -0
- package/dist/state/api/row-group-apply-expansions.d.ts +2 -0
- package/dist/state/api/row-group-apply-expansions.js +20 -0
- package/dist/state/api/row-group-column-index.d.ts +2 -0
- package/dist/state/api/row-group-column-index.js +14 -0
- package/dist/state/api/row-group-is-expanded.d.ts +2 -0
- package/dist/state/api/row-group-is-expanded.js +15 -0
- package/dist/state/api/row-group-toggle.d.ts +2 -0
- package/dist/state/api/row-group-toggle.js +7 -0
- package/dist/state/api/row-handle-select.d.ts +5 -0
- package/dist/state/api/row-handle-select.js +43 -0
- package/dist/state/api/row-select-all.d.ts +2 -0
- package/dist/state/api/row-select-all.js +17 -0
- package/dist/state/api/row-select.d.ts +5 -0
- package/dist/state/api/row-select.js +35 -0
- package/dist/state/api/row-selected.d.ts +2 -0
- package/dist/state/api/row-selected.js +13 -0
- package/dist/state/api/scroll-into-view.d.ts +5 -0
- package/dist/state/api/scroll-into-view.js +50 -0
- package/dist/state/api/sort-for-column.d.ts +2 -0
- package/dist/state/api/sort-for-column.js +9 -0
- package/dist/state/api/use-row-drag.d.ts +2 -0
- package/dist/state/api/use-row-drag.js +27 -0
- package/dist/state/helpers/cell-row-group.d.ts +2 -0
- package/dist/state/helpers/cell-row-group.js +19 -0
- package/dist/state/helpers/column-add-row-group.d.ts +10 -0
- package/dist/state/helpers/column-add-row-group.js +74 -0
- package/dist/state/helpers/column-layout.d.ts +3 -0
- package/dist/state/helpers/column-layout.js +59 -0
- package/dist/state/helpers/column-marker.d.ts +8 -0
- package/dist/state/helpers/column-marker.js +43 -0
- package/dist/state/helpers/column-view.d.ts +21 -0
- package/dist/state/helpers/column-view.js +33 -0
- package/dist/state/helpers/edit-on-change.d.ts +15 -0
- package/dist/state/helpers/edit-on-change.js +27 -0
- package/dist/state/helpers/empty-row-data-source.d.ts +2 -0
- package/dist/state/helpers/empty-row-data-source.js +18 -0
- package/dist/state/helpers/get-data-rect.d.ts +13 -0
- package/dist/state/helpers/get-data-rect.js +65 -0
- package/dist/state/helpers/get-full-width-callback.d.ts +2 -0
- package/dist/state/helpers/get-full-width-callback.js +10 -0
- package/dist/state/helpers/get-span-callback.d.ts +2 -0
- package/dist/state/helpers/get-span-callback.js +22 -0
- package/dist/state/helpers/resolve-column.d.ts +4 -0
- package/dist/state/helpers/resolve-column.js +29 -0
- package/dist/state/helpers/row-layout/get-focus-criteria.d.ts +17 -0
- package/dist/state/helpers/row-layout/get-focus-criteria.js +62 -0
- package/dist/state/helpers/row-layout/row-layout.d.ts +19 -0
- package/dist/state/helpers/row-layout/row-layout.js +181 -0
- package/dist/state/use-lytenyte.d.ts +3 -0
- package/dist/state/use-lytenyte.js +671 -0
- package/dist/tree-view/branch/branch.d.ts +14 -0
- package/dist/tree-view/branch/branch.js +63 -0
- package/dist/tree-view/branch/use-branch-keys.d.ts +2 -0
- package/dist/tree-view/branch/use-branch-keys.js +87 -0
- package/dist/tree-view/context.d.ts +22 -0
- package/dist/tree-view/context.js +3 -0
- package/dist/tree-view/depth-provider.d.ts +2 -0
- package/dist/tree-view/depth-provider.js +3 -0
- package/dist/tree-view/hooks/use-tree-view-paths.d.ts +2 -0
- package/dist/tree-view/hooks/use-tree-view-paths.js +9 -0
- package/dist/tree-view/index.d.ts +16 -0
- package/dist/tree-view/index.js +16 -0
- package/dist/tree-view/leaf.d.ts +4 -0
- package/dist/tree-view/leaf.js +28 -0
- package/dist/tree-view/navigation/get-all-ids.d.ts +1 -0
- package/dist/tree-view/navigation/get-all-ids.js +7 -0
- package/dist/tree-view/navigation/get-first-node.d.ts +1 -0
- package/dist/tree-view/navigation/get-first-node.js +7 -0
- package/dist/tree-view/navigation/get-last-node.d.ts +1 -0
- package/dist/tree-view/navigation/get-last-node.js +7 -0
- package/dist/tree-view/navigation/get-next-node.d.ts +1 -0
- package/dist/tree-view/navigation/get-next-node.js +13 -0
- package/dist/tree-view/navigation/get-prev-node.d.ts +1 -0
- package/dist/tree-view/navigation/get-prev-node.js +13 -0
- package/dist/tree-view/panel/make-handle-navigation.d.ts +2 -0
- package/dist/tree-view/panel/make-handle-navigation.js +39 -0
- package/dist/tree-view/panel/make-handle-selection.d.ts +2 -0
- package/dist/tree-view/panel/make-handle-selection.js +92 -0
- package/dist/tree-view/panel/make-handle-typeahead.d.ts +1 -0
- package/dist/tree-view/panel/make-handle-typeahead.js +45 -0
- package/dist/tree-view/panel/panel.d.ts +1 -0
- package/dist/tree-view/panel/panel.js +30 -0
- package/dist/tree-view/panel/use-tree-navigation.d.ts +1 -0
- package/dist/tree-view/panel/use-tree-navigation.js +63 -0
- package/dist/tree-view/root.d.ts +17 -0
- package/dist/tree-view/root.js +63 -0
- package/dist/tree-view/utils/get-focusable-nodes.d.ts +1 -0
- package/dist/tree-view/utils/get-focusable-nodes.js +5 -0
- package/dist/tree-view/utils/get-focused-node.d.ts +1 -0
- package/dist/tree-view/utils/get-focused-node.js +14 -0
- package/dist/tree-view/utils/get-ids-between-nodes.d.ts +1 -0
- package/dist/tree-view/utils/get-ids-between-nodes.js +15 -0
- package/dist/tree-view/utils/get-panel.d.ts +1 -0
- package/dist/tree-view/utils/get-panel.js +7 -0
- package/dist/tree-view/utils/get-parent-node.d.ts +1 -0
- package/dist/tree-view/utils/get-parent-node.js +10 -0
- package/dist/tree-view/utils/get-sibling-branches.d.ts +1 -0
- package/dist/tree-view/utils/get-sibling-branches.js +14 -0
- package/dist/tree-view/utils/get-tree-node-id.d.ts +1 -0
- package/dist/tree-view/utils/get-tree-node-id.js +3 -0
- package/dist/tree-view/utils/is-branch-node.d.ts +1 -0
- package/dist/tree-view/utils/is-branch-node.js +3 -0
- package/dist/tree-view/utils/is-leaf-node.d.ts +1 -0
- package/dist/tree-view/utils/is-leaf-node.js +3 -0
- package/dist/tree-view/utils/is-tree-node-disabled.d.ts +1 -0
- package/dist/tree-view/utils/is-tree-node-disabled.js +3 -0
- package/dist/tree-view/utils/select-node.d.ts +2 -0
- package/dist/tree-view/utils/select-node.js +15 -0
- package/dist/tree-view/utils/toggle-all-selections.d.ts +2 -0
- package/dist/tree-view/utils/toggle-all-selections.js +9 -0
- package/dist/tree-view/utils/toggle-selection.d.ts +2 -0
- package/dist/tree-view/utils/toggle-selection.js +21 -0
- package/dist/tree-view/virtualized/force-sync-scrolling.d.ts +2 -0
- package/dist/tree-view/virtualized/force-sync-scrolling.js +23 -0
- package/dist/tree-view/virtualized/get-virtual-tree-paths.d.ts +2 -0
- package/dist/tree-view/virtualized/get-virtual-tree-paths.js +14 -0
- package/dist/tree-view/virtualized/make-virtual-tree.d.ts +31 -0
- package/dist/tree-view/virtualized/make-virtual-tree.js +90 -0
- package/dist/tree-view/virtualized/use-flattened-tree.d.ts +9 -0
- package/dist/tree-view/virtualized/use-flattened-tree.js +36 -0
- package/dist/tree-view/virtualized/use-row-start-and-end.d.ts +2 -0
- package/dist/tree-view/virtualized/use-row-start-and-end.js +27 -0
- package/dist/tree-view/virtualized/use-virtualized-tree.d.ts +22 -0
- package/dist/tree-view/virtualized/use-virtualized-tree.js +100 -0
- package/dist/types/types.d.ts +8 -0
- package/dist/types/types.js +1 -0
- package/dist/utils/cycle-sorts.d.ts +2 -0
- package/dist/utils/cycle-sorts.js +16 -0
- package/dist/viewport/begin-editing.d.ts +5 -0
- package/dist/viewport/begin-editing.js +15 -0
- package/dist/viewport/viewport.d.ts +1 -0
- package/dist/viewport/viewport.js +78 -0
- package/package.json +7 -7
|
@@ -0,0 +1,378 @@
|
|
|
1
|
+
import { equal } from "@1771technologies/lytenyte-js-utils";
|
|
2
|
+
import { makeAsyncTree } from "./async-tree/make-async-tree.js";
|
|
3
|
+
import { RangeTree } from "./range-tree/range-tree.js";
|
|
4
|
+
import { getRequestId } from "./utils/get-request-id.js";
|
|
5
|
+
import { getNodePath } from "./utils/get-node-path.js";
|
|
6
|
+
import { getNodeDepth } from "./utils/get-node-depth.js";
|
|
7
|
+
const noopFetcher = async () => [];
|
|
8
|
+
export class ServerData {
|
|
9
|
+
#tree;
|
|
10
|
+
#top = { asOf: 0, rows: [] };
|
|
11
|
+
#bottom = { asOf: 0, rows: [] };
|
|
12
|
+
#blocksize;
|
|
13
|
+
#flat;
|
|
14
|
+
#dataFetcher = noopFetcher;
|
|
15
|
+
#pivotMode;
|
|
16
|
+
#expansions;
|
|
17
|
+
#pivotExpansions;
|
|
18
|
+
#onResetLoadBegin;
|
|
19
|
+
#onResetLoadError;
|
|
20
|
+
#onResetLoadEnd;
|
|
21
|
+
#onFlatten;
|
|
22
|
+
#rowViewBounds = [0, 0];
|
|
23
|
+
#prevRequests = [];
|
|
24
|
+
#loadingRows = new Set();
|
|
25
|
+
#rowsWithError = new Map();
|
|
26
|
+
#controllers = new Set();
|
|
27
|
+
#defaultExpansion;
|
|
28
|
+
constructor({ blocksize, pivotMode, pivotExpansions, expansions, onResetLoadBegin, onResetLoadEnd, onResetLoadError, onFlatten, defaultExpansion, }) {
|
|
29
|
+
this.#tree = makeAsyncTree();
|
|
30
|
+
this.#blocksize = blocksize;
|
|
31
|
+
this.#pivotMode = pivotMode;
|
|
32
|
+
this.#expansions = expansions;
|
|
33
|
+
this.#pivotExpansions = pivotExpansions;
|
|
34
|
+
this.#defaultExpansion = defaultExpansion;
|
|
35
|
+
this.#onResetLoadBegin = onResetLoadBegin;
|
|
36
|
+
this.#onResetLoadEnd = onResetLoadEnd;
|
|
37
|
+
this.#onResetLoadError = onResetLoadError;
|
|
38
|
+
this.#onFlatten = onFlatten;
|
|
39
|
+
}
|
|
40
|
+
// Properties
|
|
41
|
+
set dataFetcher(d) {
|
|
42
|
+
if (this.#dataFetcher === d)
|
|
43
|
+
return;
|
|
44
|
+
this.#dataFetcher = d;
|
|
45
|
+
this.reset();
|
|
46
|
+
}
|
|
47
|
+
set pivotMode(b) {
|
|
48
|
+
if (b === this.#pivotMode)
|
|
49
|
+
return;
|
|
50
|
+
this.#pivotMode = b;
|
|
51
|
+
this.reset();
|
|
52
|
+
}
|
|
53
|
+
set expansions(d) {
|
|
54
|
+
this.#expansions = d;
|
|
55
|
+
if (this.#pivotMode)
|
|
56
|
+
return;
|
|
57
|
+
this.#flatten();
|
|
58
|
+
}
|
|
59
|
+
set pivotExpansions(d) {
|
|
60
|
+
this.#pivotExpansions = d;
|
|
61
|
+
if (!this.#pivotMode)
|
|
62
|
+
return;
|
|
63
|
+
this.#flatten();
|
|
64
|
+
}
|
|
65
|
+
set defaultExpansion(d) {
|
|
66
|
+
this.#defaultExpansion = d;
|
|
67
|
+
}
|
|
68
|
+
set rowViewBounds(viewBounds) {
|
|
69
|
+
if (equal(viewBounds, this.#rowViewBounds))
|
|
70
|
+
return;
|
|
71
|
+
this.#rowViewBounds = viewBounds;
|
|
72
|
+
this.handleViewBoundsChange();
|
|
73
|
+
}
|
|
74
|
+
// Methods
|
|
75
|
+
reset = async () => {
|
|
76
|
+
// Abort all the existing requests in flight.
|
|
77
|
+
this.#controllers.forEach((c) => c.abort());
|
|
78
|
+
this.#tree = makeAsyncTree();
|
|
79
|
+
this.#flatten();
|
|
80
|
+
try {
|
|
81
|
+
this.#onResetLoadBegin();
|
|
82
|
+
this.#prevRequests = [
|
|
83
|
+
{
|
|
84
|
+
rowStartIndex: 0,
|
|
85
|
+
rowEndIndex: this.#blocksize,
|
|
86
|
+
id: getRequestId([], 0, this.#blocksize),
|
|
87
|
+
path: [],
|
|
88
|
+
start: 0,
|
|
89
|
+
end: this.#blocksize,
|
|
90
|
+
},
|
|
91
|
+
];
|
|
92
|
+
const res = await this.#dataFetcher(this.#prevRequests, this.#expansions, this.#pivotExpansions);
|
|
93
|
+
this.handleResponses(res);
|
|
94
|
+
}
|
|
95
|
+
catch (e) {
|
|
96
|
+
console.log(e);
|
|
97
|
+
this.#onResetLoadError(e);
|
|
98
|
+
}
|
|
99
|
+
finally {
|
|
100
|
+
this.#onResetLoadEnd();
|
|
101
|
+
}
|
|
102
|
+
};
|
|
103
|
+
handleRequests = async (requests, opts = {}) => {
|
|
104
|
+
const controller = new AbortController();
|
|
105
|
+
this.#controllers.add(controller);
|
|
106
|
+
const skip = opts.skipState ?? false;
|
|
107
|
+
// We need to request our new data now. There are a few scenarios to be aware. Once we are requesting rows,
|
|
108
|
+
// we should mark the rows loading. This means we mark the row indices as loading (maybe by range)?
|
|
109
|
+
// The load may fail, in which case we should mark the request as an error.
|
|
110
|
+
try {
|
|
111
|
+
// Mark these rows as loading
|
|
112
|
+
requests.forEach((req) => {
|
|
113
|
+
if (!skip)
|
|
114
|
+
for (let i = req.rowStartIndex; i < req.rowEndIndex; i++)
|
|
115
|
+
this.#loadingRows.add(i);
|
|
116
|
+
});
|
|
117
|
+
const responses = await this.#dataFetcher(requests, this.#expansions, this.#pivotExpansions);
|
|
118
|
+
// The request was aborted, so we can ignore it from this point
|
|
119
|
+
if (controller.signal.aborted)
|
|
120
|
+
return;
|
|
121
|
+
this.handleResponses(responses, () => {
|
|
122
|
+
if (!skip)
|
|
123
|
+
requests.forEach((req) => {
|
|
124
|
+
for (let i = req.rowStartIndex; i < req.rowEndIndex; i++)
|
|
125
|
+
this.#rowsWithError.delete(i);
|
|
126
|
+
for (let i = req.rowStartIndex; i < req.rowEndIndex; i++)
|
|
127
|
+
this.#loadingRows.delete(i);
|
|
128
|
+
});
|
|
129
|
+
});
|
|
130
|
+
opts?.onSuccess?.();
|
|
131
|
+
}
|
|
132
|
+
catch (e) {
|
|
133
|
+
if (controller.signal.aborted)
|
|
134
|
+
return;
|
|
135
|
+
opts?.onError?.(e);
|
|
136
|
+
if (!skip)
|
|
137
|
+
requests.forEach((req) => {
|
|
138
|
+
for (let i = req.rowStartIndex; i < req.rowEndIndex; i++)
|
|
139
|
+
this.#rowsWithError.set(i, e);
|
|
140
|
+
for (let i = req.rowStartIndex; i < req.rowEndIndex; i++)
|
|
141
|
+
this.#loadingRows.delete(i);
|
|
142
|
+
});
|
|
143
|
+
}
|
|
144
|
+
finally {
|
|
145
|
+
this.#controllers.delete(controller);
|
|
146
|
+
}
|
|
147
|
+
};
|
|
148
|
+
handleResponses = (data, beforeOnFlat) => {
|
|
149
|
+
const pinned = data.filter((c) => c.kind === "top" || c.kind === "bottom");
|
|
150
|
+
const center = data.filter((c) => c.kind !== "top" && c.kind !== "bottom");
|
|
151
|
+
// handle pinned
|
|
152
|
+
for (let i = 0; i < pinned.length; i++) {
|
|
153
|
+
const r = pinned[i];
|
|
154
|
+
if (r.kind === "top" && r.asOfTime > this.#top.asOf) {
|
|
155
|
+
this.#top = {
|
|
156
|
+
asOf: r.asOfTime,
|
|
157
|
+
rows: r.data.map((c) => ({ id: c.id, data: c.data, kind: "leaf" })),
|
|
158
|
+
};
|
|
159
|
+
}
|
|
160
|
+
else if (r.kind === "bottom" && r.asOfTime > this.#bottom.asOf) {
|
|
161
|
+
this.#bottom = {
|
|
162
|
+
asOf: r.asOfTime,
|
|
163
|
+
rows: r.data.map((c) => ({ id: c.id, data: c.data, kind: "leaf" })),
|
|
164
|
+
};
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
center.sort((l, r) => l.path.length - r.path.length);
|
|
168
|
+
for (let i = 0; i < center.length; i++) {
|
|
169
|
+
const r = center[i];
|
|
170
|
+
this.#tree.set({
|
|
171
|
+
path: r.path,
|
|
172
|
+
items: r.data.map((c, i) => {
|
|
173
|
+
if (c.kind === "leaf") {
|
|
174
|
+
return {
|
|
175
|
+
kind: "leaf",
|
|
176
|
+
data: {
|
|
177
|
+
kind: "leaf",
|
|
178
|
+
data: c.data,
|
|
179
|
+
id: c.id,
|
|
180
|
+
},
|
|
181
|
+
relIndex: r.start + i,
|
|
182
|
+
};
|
|
183
|
+
}
|
|
184
|
+
else {
|
|
185
|
+
return {
|
|
186
|
+
kind: "parent",
|
|
187
|
+
data: {
|
|
188
|
+
kind: "branch",
|
|
189
|
+
data: c.data,
|
|
190
|
+
depth: r.path.length,
|
|
191
|
+
id: c.id,
|
|
192
|
+
key: c.key,
|
|
193
|
+
},
|
|
194
|
+
path: c.key,
|
|
195
|
+
relIndex: r.start + i,
|
|
196
|
+
size: c.childCount,
|
|
197
|
+
};
|
|
198
|
+
}
|
|
199
|
+
}),
|
|
200
|
+
size: r.size,
|
|
201
|
+
asOf: r.asOfTime,
|
|
202
|
+
});
|
|
203
|
+
}
|
|
204
|
+
// Re-flatten our tree once everything has been re-updated.
|
|
205
|
+
this.#flatten(beforeOnFlat);
|
|
206
|
+
};
|
|
207
|
+
async handleViewBoundsChange() {
|
|
208
|
+
const [start, end] = this.#rowViewBounds;
|
|
209
|
+
const seen = new Set();
|
|
210
|
+
const requests = [];
|
|
211
|
+
for (let i = start; i < end; i++) {
|
|
212
|
+
const ranges = this.#flat.rangeTree.findRangesForRowIndex(i);
|
|
213
|
+
ranges.forEach((c) => {
|
|
214
|
+
if (c.parent.kind === "root") {
|
|
215
|
+
const blockIndex = Math.floor(i / this.#blocksize);
|
|
216
|
+
const start = blockIndex * this.#blocksize;
|
|
217
|
+
const end = Math.min(start + this.#blocksize, c.parent.size);
|
|
218
|
+
const path = [];
|
|
219
|
+
const reqId = getRequestId(path, start, start + this.#blocksize);
|
|
220
|
+
if (seen.has(reqId))
|
|
221
|
+
return;
|
|
222
|
+
seen.add(reqId);
|
|
223
|
+
const size = start + this.#blocksize > c.parent.size ? c.parent.size - start : this.#blocksize;
|
|
224
|
+
requests.push({ id: reqId, path, start, end, rowStartIndex: i, rowEndIndex: i + size });
|
|
225
|
+
}
|
|
226
|
+
else {
|
|
227
|
+
const blockIndex = Math.floor((i - c.rowStart) / this.#blocksize);
|
|
228
|
+
const start = blockIndex * this.#blocksize;
|
|
229
|
+
const end = Math.min(start + this.#blocksize, c.parent.size);
|
|
230
|
+
const path = getNodePath(c.parent);
|
|
231
|
+
const reqId = getRequestId(path, start, start + this.#blocksize);
|
|
232
|
+
if (seen.has(reqId))
|
|
233
|
+
return;
|
|
234
|
+
seen.add(reqId);
|
|
235
|
+
const size = start + this.#blocksize > c.parent.size ? c.parent.size - start : this.#blocksize;
|
|
236
|
+
requests.push({ id: reqId, path, start, end, rowStartIndex: i, rowEndIndex: i + size });
|
|
237
|
+
}
|
|
238
|
+
});
|
|
239
|
+
}
|
|
240
|
+
const newRequests = requests.filter((c) => !this.#prevRequests.find((prev) => prev.id === c.id));
|
|
241
|
+
// We don't have any new requests to make in our view, so we can return
|
|
242
|
+
if (!newRequests.length)
|
|
243
|
+
return;
|
|
244
|
+
this.#prevRequests = requests;
|
|
245
|
+
await this.handleRequests(newRequests);
|
|
246
|
+
}
|
|
247
|
+
updateRow(id, data) {
|
|
248
|
+
const centerRow = this.#flat.rowIdToTreeNode.get(id);
|
|
249
|
+
if (centerRow) {
|
|
250
|
+
centerRow.data = { ...centerRow.data, data };
|
|
251
|
+
return;
|
|
252
|
+
}
|
|
253
|
+
// Maybe its a pinned row?
|
|
254
|
+
const topIndex = this.#top.rows.findIndex((c) => c.id === id);
|
|
255
|
+
if (topIndex != -1) {
|
|
256
|
+
this.#top.rows[topIndex] = { ...this.#top.rows[topIndex], data };
|
|
257
|
+
}
|
|
258
|
+
const botIndex = this.#bottom.rows.findIndex((c) => c.id === id);
|
|
259
|
+
if (botIndex != -1) {
|
|
260
|
+
this.#top.rows[botIndex] = { ...this.#top.rows[botIndex], data };
|
|
261
|
+
}
|
|
262
|
+
}
|
|
263
|
+
#flatten = (beforeOnFlat) => {
|
|
264
|
+
const mode = this.#pivotMode;
|
|
265
|
+
const expansions = mode ? this.#pivotExpansions : this.#expansions;
|
|
266
|
+
const t = this.#tree;
|
|
267
|
+
const rowIdToRow = new Map();
|
|
268
|
+
const rowIndexToRow = new Map();
|
|
269
|
+
const rowIdToRowIndex = new Map();
|
|
270
|
+
const rowIdToTreeNode = new Map();
|
|
271
|
+
const ranges = [];
|
|
272
|
+
const blocksize = this.#blocksize;
|
|
273
|
+
const previousRequests = this.#prevRequests;
|
|
274
|
+
const withError = this.#rowsWithError;
|
|
275
|
+
const withLoading = this.#loadingRows;
|
|
276
|
+
const handleRequests = this.handleRequests;
|
|
277
|
+
const defaultExpansion = this.#defaultExpansion;
|
|
278
|
+
const postFlatRequests = [];
|
|
279
|
+
function processParent(node, start) {
|
|
280
|
+
const rows = [...node.byIndex.values()].sort((l, r) => l.relIndex - r.relIndex);
|
|
281
|
+
let offset = 0;
|
|
282
|
+
for (let i = 0; i < rows.length; i++) {
|
|
283
|
+
const row = rows[i];
|
|
284
|
+
const rowIndex = row.relIndex + start + offset;
|
|
285
|
+
rowIndexToRow.set(rowIndex, row.data);
|
|
286
|
+
rowIdToRowIndex.set(row.data.id, rowIndex);
|
|
287
|
+
rowIdToRow.set(row.data.id, row.data);
|
|
288
|
+
rowIdToTreeNode.set(row.data.id, row);
|
|
289
|
+
if (row.kind === "parent") {
|
|
290
|
+
const expanded = expansions[row.data.id] ??
|
|
291
|
+
(typeof defaultExpansion === "number"
|
|
292
|
+
? getNodeDepth(row) <= defaultExpansion
|
|
293
|
+
: defaultExpansion);
|
|
294
|
+
if (expanded && !row.byIndex.size) {
|
|
295
|
+
const path = getNodePath(row);
|
|
296
|
+
const start = 0;
|
|
297
|
+
const end = Math.min(start + blocksize, row.size);
|
|
298
|
+
const reqSize = end - start;
|
|
299
|
+
const req = {
|
|
300
|
+
path,
|
|
301
|
+
start: start,
|
|
302
|
+
end: end,
|
|
303
|
+
id: getRequestId(path, 0, blocksize),
|
|
304
|
+
rowStartIndex: rowIndex + 1,
|
|
305
|
+
rowEndIndex: rowIndex + 1 + reqSize,
|
|
306
|
+
};
|
|
307
|
+
// If we haven't already requested this node
|
|
308
|
+
if (!previousRequests.find((c) => c.id === req.id)) {
|
|
309
|
+
postFlatRequests.push([rowIndex, req]);
|
|
310
|
+
}
|
|
311
|
+
}
|
|
312
|
+
else if (expanded) {
|
|
313
|
+
offset += processParent(row, rowIndex + 1);
|
|
314
|
+
}
|
|
315
|
+
}
|
|
316
|
+
}
|
|
317
|
+
ranges.push({
|
|
318
|
+
rowStart: start,
|
|
319
|
+
rowEnd: offset + node.size + start,
|
|
320
|
+
parent: node,
|
|
321
|
+
});
|
|
322
|
+
return offset + node.size;
|
|
323
|
+
}
|
|
324
|
+
const topCount = this.#top.rows.length;
|
|
325
|
+
const bottomCount = this.#bottom.rows.length;
|
|
326
|
+
for (let i = 0; i < topCount; i++) {
|
|
327
|
+
const row = this.#top.rows[i];
|
|
328
|
+
rowIndexToRow.set(i, row);
|
|
329
|
+
rowIdToRow.set(row.id, row);
|
|
330
|
+
rowIdToRowIndex.set(row.id, i);
|
|
331
|
+
}
|
|
332
|
+
const size = processParent(t, topCount);
|
|
333
|
+
for (let i = 0; i < bottomCount; i++) {
|
|
334
|
+
const row = this.#bottom.rows[i];
|
|
335
|
+
const rowIndex = i + size;
|
|
336
|
+
rowIndexToRow.set(rowIndex, row);
|
|
337
|
+
rowIdToRow.set(row.id, row);
|
|
338
|
+
rowIdToRowIndex.set(row.id, rowIndex);
|
|
339
|
+
}
|
|
340
|
+
const rangeTree = new RangeTree(ranges);
|
|
341
|
+
if (postFlatRequests.length > 0) {
|
|
342
|
+
postFlatRequests.forEach((c) => {
|
|
343
|
+
withLoading.add(c[0]);
|
|
344
|
+
previousRequests.push(c[1]);
|
|
345
|
+
});
|
|
346
|
+
const reqs = postFlatRequests.map((c) => c[1]);
|
|
347
|
+
handleRequests(reqs, {
|
|
348
|
+
skipState: true,
|
|
349
|
+
onError: (e) => {
|
|
350
|
+
postFlatRequests.forEach((c) => {
|
|
351
|
+
withLoading.delete(c[0]);
|
|
352
|
+
withError.set(c[0], e);
|
|
353
|
+
});
|
|
354
|
+
},
|
|
355
|
+
onSuccess: () => {
|
|
356
|
+
postFlatRequests.forEach((c) => {
|
|
357
|
+
withLoading.delete(c[0]);
|
|
358
|
+
});
|
|
359
|
+
},
|
|
360
|
+
});
|
|
361
|
+
}
|
|
362
|
+
this.#flat = {
|
|
363
|
+
tree: t,
|
|
364
|
+
top: topCount,
|
|
365
|
+
center: size - topCount,
|
|
366
|
+
bottom: bottomCount,
|
|
367
|
+
rangeTree,
|
|
368
|
+
rowIndexToRow,
|
|
369
|
+
rowIdToRow,
|
|
370
|
+
rowIdToRowIndex,
|
|
371
|
+
rowIdToTreeNode,
|
|
372
|
+
errored: this.#rowsWithError,
|
|
373
|
+
loading: this.#loadingRows,
|
|
374
|
+
};
|
|
375
|
+
beforeOnFlat?.();
|
|
376
|
+
this.#onFlatten(this.#flat);
|
|
377
|
+
};
|
|
378
|
+
}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import type { RowDataSourceServer, RowDataSourceServerParams } from "../+types.js";
|
|
2
|
+
export declare function makeServerDataSource<T>({ dataFetcher, dataInFilterItemFetcher, dataColumnPivotFetcher, cellUpdateHandler, cellUpdateOptimistically, blockSize, }: RowDataSourceServerParams<T>): RowDataSourceServer<T>;
|
|
3
|
+
export declare function useServerDataSource<T>(p: RowDataSourceServerParams<T>): RowDataSourceServer<T>;
|