@1771technologies/lytenyte-pro 1.0.19 → 2.0.0-dev.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/css/all-colors.css +8 -0
- package/css/components/button.css +176 -0
- package/css/components/checkbox.css +54 -0
- package/css/components/input.css +64 -0
- package/css/components/tree-view.css +108 -0
- package/css/components.css +300 -0
- package/css/cotton-candy.css +1 -0
- package/css/dark.css +1 -0
- package/css/design.css +1 -0
- package/css/fonts.css +1 -0
- package/css/grid-full.css +3 -0
- package/css/grid.css +81 -0
- package/css/light-dark.css +3 -0
- package/css/light.css +1 -0
- package/css/pill-manager.css +184 -0
- package/css/shadcn-vars.css +1 -0
- package/css/shadcn.css +1 -0
- package/css/teal.css +1 -0
- package/css/term.css +1 -0
- package/css/tw.css +1 -0
- package/package.json +29 -16
- package/dist/+types.d.ts +0 -6177
- package/dist/+types.js +0 -1
- package/dist/__play__/cell-selections/cell-selection.play.d.ts +0 -5
- package/dist/__play__/cell-selections/cell-selection.play.js +0 -80
- package/dist/__play__/filter-select/filter-select.play.d.ts +0 -4
- package/dist/__play__/filter-select/filter-select.play.js +0 -76
- package/dist/__play__/test-utils/bank-data-smaller.d.ts +0 -19
- package/dist/__play__/test-utils/bank-data-smaller.js +0 -252
- package/dist/__play__/test-utils/row-handler.d.ts +0 -6
- package/dist/__play__/test-utils/row-handler.js +0 -32
- 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 -289
- 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/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 -72
- 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 -11
- package/dist/context.js +0 -5
- package/dist/filter-selects/apply.d.ts +0 -7
- package/dist/filter-selects/apply.js +0 -22
- package/dist/filter-selects/clear.d.ts +0 -7
- package/dist/filter-selects/clear.js +0 -22
- package/dist/filter-selects/context.d.ts +0 -13
- package/dist/filter-selects/context.js +0 -3
- package/dist/filter-selects/filter-combinator.d.ts +0 -10
- package/dist/filter-selects/filter-combinator.js +0 -19
- package/dist/filter-selects/filter-row-context.d.ts +0 -30
- package/dist/filter-selects/filter-row-context.js +0 -3
- package/dist/filter-selects/filter-row.d.ts +0 -13
- package/dist/filter-selects/filter-row.js +0 -118
- package/dist/filter-selects/index.d.ts +0 -22
- package/dist/filter-selects/index.js +0 -20
- package/dist/filter-selects/is-complete-filter.d.ts +0 -2
- package/dist/filter-selects/is-complete-filter.js +0 -5
- package/dist/filter-selects/operator-select.d.ts +0 -14
- package/dist/filter-selects/operator-select.js +0 -25
- package/dist/filter-selects/options.d.ts +0 -9
- package/dist/filter-selects/options.js +0 -100
- package/dist/filter-selects/reset.d.ts +0 -7
- package/dist/filter-selects/reset.js +0 -22
- package/dist/filter-selects/root.d.ts +0 -14
- package/dist/filter-selects/root.js +0 -5
- package/dist/filter-selects/to-filter-item.d.ts +0 -3
- package/dist/filter-selects/to-filter-item.js +0 -7
- package/dist/filter-selects/use-filter-select.d.ts +0 -38
- package/dist/filter-selects/use-filter-select.js +0 -167
- package/dist/filter-selects/value-input.d.ts +0 -12
- package/dist/filter-selects/value-input.js +0 -27
- 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/cell.d.ts +0 -6
- package/dist/grid/cell.js +0 -3
- package/dist/grid/dialog-driver.d.ts +0 -1
- package/dist/grid/dialog-driver.js +0 -21
- package/dist/grid/header-cell.d.ts +0 -10
- package/dist/grid/header-cell.js +0 -3
- package/dist/grid/header-group-cell.d.ts +0 -6
- package/dist/grid/header-group-cell.js +0 -3
- package/dist/grid/header-row.d.ts +0 -5
- package/dist/grid/header-row.js +0 -2
- package/dist/grid/header.d.ts +0 -1
- package/dist/grid/header.js +0 -2
- package/dist/grid/popover-driver.d.ts +0 -1
- package/dist/grid/popover-driver.js +0 -21
- package/dist/grid/root.d.ts +0 -8
- package/dist/grid/root.js +0 -37
- package/dist/grid/row-full-width.d.ts +0 -9
- package/dist/grid/row-full-width.js +0 -3
- package/dist/grid/row.d.ts +0 -8
- package/dist/grid/row.js +0 -3
- package/dist/grid/rows-container.d.ts +0 -1
- package/dist/grid/rows-container.js +0 -2
- package/dist/grid/rows-sections.d.ts +0 -3
- package/dist/grid/rows-sections.js +0 -13
- package/dist/grid/viewport.d.ts +0 -1
- package/dist/grid/viewport.js +0 -9
- 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 -62
- 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/icons/index.d.ts +0 -1
- package/dist/icons/index.js +0 -1
- package/dist/index.d.ts +0 -14
- package/dist/index.js +0 -14
- package/dist/license/index.d.ts +0 -1
- package/dist/license/index.js +0 -1
- package/dist/license/license.d.ts +0 -3
- package/dist/license/license.js +0 -215
- package/dist/license/md5-hash.d.ts +0 -9
- package/dist/license/md5-hash.js +0 -167
- 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/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 -573
- 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 -667
- 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 -512
- 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 -70
- package/dist/row-data-source-server/server-data.js +0 -519
- 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 -413
- 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/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 -36
- 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 -65
- 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/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 -5
- 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 -20
- 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 -45
- 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 -162
- package/dist/state/use-lytenyte.d.ts +0 -3
- package/dist/state/use-lytenyte.js +0 -686
- 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/main.css +0 -453
|
@@ -1,519 +0,0 @@
|
|
|
1
|
-
import { equal } from "@1771technologies/lytenyte-shared";
|
|
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
|
-
#onInvalidate;
|
|
23
|
-
#rowViewBounds = [0, 0];
|
|
24
|
-
#seenRequests = new Set();
|
|
25
|
-
#loadingRows = new Set();
|
|
26
|
-
#loadingGroup = new Set();
|
|
27
|
-
#rowsWithError = new Map();
|
|
28
|
-
#rowsWithGroupError = new Map();
|
|
29
|
-
#controllers = new Set();
|
|
30
|
-
#defaultExpansion;
|
|
31
|
-
constructor({ blocksize, pivotMode, pivotExpansions, expansions, onResetLoadBegin, onResetLoadEnd, onResetLoadError, onFlatten, onInvalidate, defaultExpansion, }) {
|
|
32
|
-
this.#tree = makeAsyncTree();
|
|
33
|
-
this.#blocksize = blocksize;
|
|
34
|
-
this.#pivotMode = pivotMode;
|
|
35
|
-
this.#expansions = expansions;
|
|
36
|
-
this.#pivotExpansions = pivotExpansions;
|
|
37
|
-
this.#defaultExpansion = defaultExpansion;
|
|
38
|
-
this.#onResetLoadBegin = onResetLoadBegin;
|
|
39
|
-
this.#onResetLoadEnd = onResetLoadEnd;
|
|
40
|
-
this.#onResetLoadError = onResetLoadError;
|
|
41
|
-
this.#onFlatten = onFlatten;
|
|
42
|
-
this.#onInvalidate = onInvalidate;
|
|
43
|
-
}
|
|
44
|
-
// Properties
|
|
45
|
-
set dataFetcher(d) {
|
|
46
|
-
if (this.#dataFetcher === d)
|
|
47
|
-
return;
|
|
48
|
-
this.#dataFetcher = d;
|
|
49
|
-
this.reset();
|
|
50
|
-
}
|
|
51
|
-
set pivotMode(b) {
|
|
52
|
-
if (b === this.#pivotMode)
|
|
53
|
-
return;
|
|
54
|
-
this.#pivotMode = b;
|
|
55
|
-
this.reset();
|
|
56
|
-
}
|
|
57
|
-
set expansions(d) {
|
|
58
|
-
this.#expansions = d;
|
|
59
|
-
if (this.#pivotMode)
|
|
60
|
-
return;
|
|
61
|
-
this.#flatten();
|
|
62
|
-
}
|
|
63
|
-
set pivotExpansions(d) {
|
|
64
|
-
this.#pivotExpansions = d;
|
|
65
|
-
if (!this.#pivotMode)
|
|
66
|
-
return;
|
|
67
|
-
this.#flatten();
|
|
68
|
-
}
|
|
69
|
-
set defaultExpansion(d) {
|
|
70
|
-
this.#defaultExpansion = d;
|
|
71
|
-
}
|
|
72
|
-
set rowViewBounds(viewBounds) {
|
|
73
|
-
if (equal(viewBounds, this.#rowViewBounds))
|
|
74
|
-
return;
|
|
75
|
-
this.#rowViewBounds = viewBounds;
|
|
76
|
-
this.handleViewBoundsChange();
|
|
77
|
-
}
|
|
78
|
-
// Methods
|
|
79
|
-
reset = async () => {
|
|
80
|
-
// Abort all the existing requests in flight.
|
|
81
|
-
this.#controllers.forEach((c) => c.abort());
|
|
82
|
-
this.#tree = makeAsyncTree();
|
|
83
|
-
this.#flatten();
|
|
84
|
-
this.#rowsWithError.clear();
|
|
85
|
-
this.#rowsWithGroupError.clear();
|
|
86
|
-
this.#loadingRows.clear();
|
|
87
|
-
this.#loadingGroup.clear();
|
|
88
|
-
try {
|
|
89
|
-
this.#onResetLoadBegin();
|
|
90
|
-
this.#seenRequests.clear();
|
|
91
|
-
const req = {
|
|
92
|
-
rowStartIndex: 0,
|
|
93
|
-
rowEndIndex: this.#blocksize,
|
|
94
|
-
id: getRequestId([], 0, this.#blocksize),
|
|
95
|
-
path: [],
|
|
96
|
-
start: 0,
|
|
97
|
-
end: this.#blocksize,
|
|
98
|
-
};
|
|
99
|
-
this.#seenRequests.add(req.id);
|
|
100
|
-
const res = await this.#dataFetcher([req], this.#expansions, this.#pivotExpansions);
|
|
101
|
-
this.handleResponses(res);
|
|
102
|
-
}
|
|
103
|
-
catch (e) {
|
|
104
|
-
this.#onResetLoadError(e);
|
|
105
|
-
}
|
|
106
|
-
finally {
|
|
107
|
-
this.#onResetLoadEnd();
|
|
108
|
-
}
|
|
109
|
-
};
|
|
110
|
-
requestForGroup(i) {
|
|
111
|
-
const ranges = this.#flat.rangeTree.findRangesForRowIndex(i);
|
|
112
|
-
const path = ranges.slice(1).map((c) => (c.parent.kind === "parent" ? c.parent.path : null));
|
|
113
|
-
const row = this.#flat.rowIndexToRow.get(i);
|
|
114
|
-
if (row?.kind !== "branch")
|
|
115
|
-
return null;
|
|
116
|
-
path.push(row.key);
|
|
117
|
-
const r = (ranges.at(-1)?.parent).byPath.get(row.key);
|
|
118
|
-
const blocksize = this.#blocksize;
|
|
119
|
-
const start = 0;
|
|
120
|
-
const end = Math.min(start + blocksize, r.size);
|
|
121
|
-
const reqSize = end - start;
|
|
122
|
-
const req = {
|
|
123
|
-
path,
|
|
124
|
-
start: start,
|
|
125
|
-
end: end,
|
|
126
|
-
id: getRequestId(path, 0, blocksize),
|
|
127
|
-
rowStartIndex: i + 1,
|
|
128
|
-
rowEndIndex: i + 1 + reqSize,
|
|
129
|
-
};
|
|
130
|
-
return req;
|
|
131
|
-
}
|
|
132
|
-
handleRequests = async (requests, opts = {}) => {
|
|
133
|
-
const controller = new AbortController();
|
|
134
|
-
this.#controllers.add(controller);
|
|
135
|
-
const skip = opts.skipState ?? false;
|
|
136
|
-
// We need to request our new data now. There are a few scenarios to be aware. Once we are requesting rows,
|
|
137
|
-
// we should mark the rows loading. This means we mark the row indices as loading (maybe by range)?
|
|
138
|
-
// The load may fail, in which case we should mark the request as an error.
|
|
139
|
-
try {
|
|
140
|
-
// Mark these rows as loading
|
|
141
|
-
requests.forEach((req) => {
|
|
142
|
-
if (!skip)
|
|
143
|
-
for (let i = req.rowStartIndex; i < req.rowEndIndex; i++)
|
|
144
|
-
this.#loadingRows.add(i);
|
|
145
|
-
});
|
|
146
|
-
const responses = await this.#dataFetcher(requests, this.#expansions, this.#pivotExpansions);
|
|
147
|
-
// The request was aborted, so we can ignore it from this point
|
|
148
|
-
if (controller.signal.aborted)
|
|
149
|
-
return;
|
|
150
|
-
this.handleResponses(responses, () => {
|
|
151
|
-
if (!skip)
|
|
152
|
-
requests.forEach((req) => {
|
|
153
|
-
for (let i = req.rowStartIndex; i < req.rowEndIndex; i++)
|
|
154
|
-
this.#rowsWithError.delete(i);
|
|
155
|
-
for (let i = req.rowStartIndex; i < req.rowEndIndex; i++)
|
|
156
|
-
this.#loadingRows.delete(i);
|
|
157
|
-
});
|
|
158
|
-
});
|
|
159
|
-
opts?.onSuccess?.();
|
|
160
|
-
}
|
|
161
|
-
catch (e) {
|
|
162
|
-
if (controller.signal.aborted)
|
|
163
|
-
return;
|
|
164
|
-
opts?.onError?.(e);
|
|
165
|
-
this.#onInvalidate();
|
|
166
|
-
if (!skip)
|
|
167
|
-
requests.forEach((req) => {
|
|
168
|
-
for (let i = req.rowStartIndex; i < req.rowEndIndex; i++)
|
|
169
|
-
this.#rowsWithError.set(i, { error: e, request: req });
|
|
170
|
-
for (let i = req.rowStartIndex; i < req.rowEndIndex; i++)
|
|
171
|
-
this.#loadingRows.delete(i);
|
|
172
|
-
});
|
|
173
|
-
}
|
|
174
|
-
finally {
|
|
175
|
-
this.#controllers.delete(controller);
|
|
176
|
-
}
|
|
177
|
-
};
|
|
178
|
-
handleResponses = (data, beforeOnFlat) => {
|
|
179
|
-
const pinned = data.filter((c) => c.kind === "top" || c.kind === "bottom");
|
|
180
|
-
const center = data.filter((c) => c.kind !== "top" && c.kind !== "bottom");
|
|
181
|
-
// handle pinned
|
|
182
|
-
for (let i = 0; i < pinned.length; i++) {
|
|
183
|
-
const r = pinned[i];
|
|
184
|
-
if (r.kind === "top" && r.asOfTime > this.#top.asOf) {
|
|
185
|
-
this.#top = {
|
|
186
|
-
asOf: r.asOfTime,
|
|
187
|
-
rows: r.data.map((c) => ({ id: c.id, data: c.data, kind: "leaf" })),
|
|
188
|
-
};
|
|
189
|
-
}
|
|
190
|
-
else if (r.kind === "bottom" && r.asOfTime > this.#bottom.asOf) {
|
|
191
|
-
this.#bottom = {
|
|
192
|
-
asOf: r.asOfTime,
|
|
193
|
-
rows: r.data.map((c) => ({ id: c.id, data: c.data, kind: "leaf" })),
|
|
194
|
-
};
|
|
195
|
-
}
|
|
196
|
-
}
|
|
197
|
-
center.sort((l, r) => l.path.length - r.path.length);
|
|
198
|
-
for (let i = 0; i < center.length; i++) {
|
|
199
|
-
const r = center[i];
|
|
200
|
-
this.#tree.set({
|
|
201
|
-
path: r.path,
|
|
202
|
-
items: r.data.map((c, i) => {
|
|
203
|
-
if (c.kind === "leaf") {
|
|
204
|
-
return {
|
|
205
|
-
kind: "leaf",
|
|
206
|
-
data: {
|
|
207
|
-
kind: "leaf",
|
|
208
|
-
data: c.data,
|
|
209
|
-
id: c.id,
|
|
210
|
-
},
|
|
211
|
-
relIndex: r.start + i,
|
|
212
|
-
};
|
|
213
|
-
}
|
|
214
|
-
else {
|
|
215
|
-
return {
|
|
216
|
-
kind: "parent",
|
|
217
|
-
data: {
|
|
218
|
-
kind: "branch",
|
|
219
|
-
data: c.data,
|
|
220
|
-
depth: r.path.length,
|
|
221
|
-
id: c.id,
|
|
222
|
-
key: c.key,
|
|
223
|
-
},
|
|
224
|
-
path: c.key,
|
|
225
|
-
relIndex: r.start + i,
|
|
226
|
-
size: c.childCount,
|
|
227
|
-
};
|
|
228
|
-
}
|
|
229
|
-
}),
|
|
230
|
-
size: r.size,
|
|
231
|
-
asOf: r.asOfTime,
|
|
232
|
-
});
|
|
233
|
-
}
|
|
234
|
-
// Re-flatten our tree once everything has been re-updated.
|
|
235
|
-
this.#flatten(beforeOnFlat);
|
|
236
|
-
};
|
|
237
|
-
requestForNextSlice(req) {
|
|
238
|
-
let current = this.#tree;
|
|
239
|
-
for (const c of req.path) {
|
|
240
|
-
if (current.kind === "leaf")
|
|
241
|
-
return null;
|
|
242
|
-
const next = current.byPath.get(c);
|
|
243
|
-
if (!next)
|
|
244
|
-
return null;
|
|
245
|
-
current = next;
|
|
246
|
-
}
|
|
247
|
-
if (current.kind === "leaf")
|
|
248
|
-
return null;
|
|
249
|
-
const maxSize = current.size;
|
|
250
|
-
if (req.end >= maxSize)
|
|
251
|
-
return null;
|
|
252
|
-
const prevSize = req.end - req.start;
|
|
253
|
-
const start = req.end;
|
|
254
|
-
const end = Math.min(req.end + this.#blocksize, maxSize);
|
|
255
|
-
const size = end - start;
|
|
256
|
-
return {
|
|
257
|
-
id: getRequestId(req.path, start, start + this.#blocksize),
|
|
258
|
-
path: req.path,
|
|
259
|
-
start,
|
|
260
|
-
end,
|
|
261
|
-
rowStartIndex: req.rowStartIndex + prevSize,
|
|
262
|
-
rowEndIndex: req.rowStartIndex + prevSize + size,
|
|
263
|
-
};
|
|
264
|
-
}
|
|
265
|
-
requestsForView(start, end) {
|
|
266
|
-
const bounds = this.#rowViewBounds;
|
|
267
|
-
start = start ?? bounds[0];
|
|
268
|
-
end = end ?? bounds[1];
|
|
269
|
-
const seen = new Set();
|
|
270
|
-
const requests = [];
|
|
271
|
-
for (let i = start; i < end; i++) {
|
|
272
|
-
const ranges = this.#flat.rangeTree.findRangesForRowIndex(i);
|
|
273
|
-
ranges.forEach((c) => {
|
|
274
|
-
if (c.parent.kind === "root") {
|
|
275
|
-
const blockIndex = Math.floor(i / this.#blocksize);
|
|
276
|
-
const start = blockIndex * this.#blocksize;
|
|
277
|
-
const end = Math.min(start + this.#blocksize, c.parent.size);
|
|
278
|
-
const path = [];
|
|
279
|
-
const reqId = getRequestId(path, start, start + this.#blocksize);
|
|
280
|
-
if (seen.has(reqId))
|
|
281
|
-
return;
|
|
282
|
-
seen.add(reqId);
|
|
283
|
-
const size = start + this.#blocksize > c.parent.size ? c.parent.size - start : this.#blocksize;
|
|
284
|
-
requests.push({ id: reqId, path, start, end, rowStartIndex: i, rowEndIndex: i + size });
|
|
285
|
-
}
|
|
286
|
-
else {
|
|
287
|
-
const blockIndex = Math.floor((i - c.rowStart) / this.#blocksize);
|
|
288
|
-
const start = blockIndex * this.#blocksize;
|
|
289
|
-
const end = Math.min(start + this.#blocksize, c.parent.size);
|
|
290
|
-
const path = getNodePath(c.parent);
|
|
291
|
-
const reqId = getRequestId(path, start, start + this.#blocksize);
|
|
292
|
-
if (seen.has(reqId))
|
|
293
|
-
return;
|
|
294
|
-
seen.add(reqId);
|
|
295
|
-
const size = start + this.#blocksize > c.parent.size ? c.parent.size - start : this.#blocksize;
|
|
296
|
-
requests.push({ id: reqId, path, start, end, rowStartIndex: i, rowEndIndex: i + size });
|
|
297
|
-
}
|
|
298
|
-
});
|
|
299
|
-
}
|
|
300
|
-
return requests;
|
|
301
|
-
}
|
|
302
|
-
async handleViewBoundsChange() {
|
|
303
|
-
const requests = this.requestsForView();
|
|
304
|
-
const newRequests = requests.filter((c) => !this.#seenRequests.has(c.id));
|
|
305
|
-
// We don't have any new requests to make in our view, so we can return
|
|
306
|
-
if (!newRequests.length)
|
|
307
|
-
return;
|
|
308
|
-
for (const n of newRequests)
|
|
309
|
-
this.#seenRequests.add(n.id);
|
|
310
|
-
await this.handleRequests(newRequests);
|
|
311
|
-
}
|
|
312
|
-
retry() {
|
|
313
|
-
const inViewSet = new Set(this.requestsForView().map((c) => c.id));
|
|
314
|
-
const erroredRequests = [...this.#rowsWithError.values()]
|
|
315
|
-
.map((c) => c.request)
|
|
316
|
-
.filter(Boolean);
|
|
317
|
-
const erroredGroups = [...this.#rowsWithGroupError.entries()];
|
|
318
|
-
const errors = erroredRequests.filter((x) => inViewSet.has(x.id));
|
|
319
|
-
const [start, end] = this.#rowViewBounds;
|
|
320
|
-
const groupErrors = erroredGroups
|
|
321
|
-
.filter(([index]) => {
|
|
322
|
-
return index >= start && index < end;
|
|
323
|
-
})
|
|
324
|
-
.map(([index, c]) => [index, c.request]);
|
|
325
|
-
const seenRequests = this.#seenRequests;
|
|
326
|
-
erroredRequests.map((x) => seenRequests.delete(x.id));
|
|
327
|
-
erroredGroups.map((x) => seenRequests.delete(x[1].request.id));
|
|
328
|
-
this.#rowsWithError.clear();
|
|
329
|
-
this.#rowsWithGroupError.clear();
|
|
330
|
-
const requests = [];
|
|
331
|
-
const seen = new Set();
|
|
332
|
-
groupErrors.forEach((x) => {
|
|
333
|
-
if (seen.has(x[1].id))
|
|
334
|
-
return;
|
|
335
|
-
requests.push(x[1]);
|
|
336
|
-
seen.add(x[1].id);
|
|
337
|
-
});
|
|
338
|
-
errors.forEach((x) => {
|
|
339
|
-
if (seen.has(x.id))
|
|
340
|
-
return;
|
|
341
|
-
seen.add(x.id);
|
|
342
|
-
requests.push(x);
|
|
343
|
-
});
|
|
344
|
-
for (const x of groupErrors) {
|
|
345
|
-
this.#loadingGroup.add(x[0]);
|
|
346
|
-
}
|
|
347
|
-
requests.forEach((x) => seenRequests.add(x.id));
|
|
348
|
-
const invalidate = this.#onInvalidate;
|
|
349
|
-
const withGroupError = this.#rowsWithGroupError;
|
|
350
|
-
const loadingGroup = this.#loadingGroup;
|
|
351
|
-
this.handleRequests(requests, {
|
|
352
|
-
onError: (e) => {
|
|
353
|
-
invalidate();
|
|
354
|
-
groupErrors.forEach((c) => {
|
|
355
|
-
withGroupError.set(c[0], { error: e, request: c[1] });
|
|
356
|
-
loadingGroup.delete(c[0]);
|
|
357
|
-
});
|
|
358
|
-
},
|
|
359
|
-
onSuccess: () => {
|
|
360
|
-
groupErrors.forEach((c) => {
|
|
361
|
-
loadingGroup.delete(c[0]);
|
|
362
|
-
});
|
|
363
|
-
},
|
|
364
|
-
});
|
|
365
|
-
}
|
|
366
|
-
updateRow(id, data) {
|
|
367
|
-
const centerRow = this.#flat.rowIdToTreeNode.get(id);
|
|
368
|
-
if (centerRow) {
|
|
369
|
-
centerRow.data = { ...centerRow.data, data };
|
|
370
|
-
return;
|
|
371
|
-
}
|
|
372
|
-
// Maybe its a pinned row?
|
|
373
|
-
const topIndex = this.#top.rows.findIndex((c) => c.id === id);
|
|
374
|
-
if (topIndex != -1) {
|
|
375
|
-
this.#top.rows[topIndex] = { ...this.#top.rows[topIndex], data };
|
|
376
|
-
}
|
|
377
|
-
const botIndex = this.#bottom.rows.findIndex((c) => c.id === id);
|
|
378
|
-
if (botIndex != -1) {
|
|
379
|
-
this.#top.rows[botIndex] = { ...this.#top.rows[botIndex], data };
|
|
380
|
-
}
|
|
381
|
-
}
|
|
382
|
-
flatten = () => {
|
|
383
|
-
this.#flatten();
|
|
384
|
-
};
|
|
385
|
-
#flatten = (beforeOnFlat) => {
|
|
386
|
-
// The mode we are in determines the expansions we will use for the server data.
|
|
387
|
-
const mode = this.#pivotMode;
|
|
388
|
-
const expansions = mode ? this.#pivotExpansions : this.#expansions;
|
|
389
|
-
const t = this.#tree;
|
|
390
|
-
// We use these maps to keep track of the current view. These are helpful for
|
|
391
|
-
// quick lookup. They are also used to implement many of the data source APIs.
|
|
392
|
-
const rowIdToRow = new Map();
|
|
393
|
-
const rowIndexToRow = new Map();
|
|
394
|
-
const rowIdToRowIndex = new Map();
|
|
395
|
-
const rowIdToTreeNode = new Map();
|
|
396
|
-
// When flattening the tree we need to keep track of the ranges. The tree itself
|
|
397
|
-
// will only have some rows loaded, but the ranges will be fully defined.
|
|
398
|
-
const ranges = [];
|
|
399
|
-
const blocksize = this.#blocksize;
|
|
400
|
-
const seen = this.#seenRequests;
|
|
401
|
-
// Tracks the error and loading state of the rows.
|
|
402
|
-
const withGroupError = this.#rowsWithGroupError;
|
|
403
|
-
const withLoadingGroup = this.#loadingGroup;
|
|
404
|
-
const handleRequests = this.handleRequests;
|
|
405
|
-
const defaultExpansion = this.#defaultExpansion;
|
|
406
|
-
const postFlatRequests = [];
|
|
407
|
-
function processParent(node, start) {
|
|
408
|
-
const rows = [...node.byIndex.values()].sort((l, r) => l.relIndex - r.relIndex);
|
|
409
|
-
let offset = 0;
|
|
410
|
-
for (let i = 0; i < rows.length; i++) {
|
|
411
|
-
const row = rows[i];
|
|
412
|
-
const rowIndex = row.relIndex + start + offset;
|
|
413
|
-
rowIndexToRow.set(rowIndex, row.data);
|
|
414
|
-
rowIdToRowIndex.set(row.data.id, rowIndex);
|
|
415
|
-
rowIdToRow.set(row.data.id, row.data);
|
|
416
|
-
rowIdToTreeNode.set(row.data.id, row);
|
|
417
|
-
// If this rows is a parent row, we need to check if it is expanded. There are a couple of
|
|
418
|
-
// situations this to consider.
|
|
419
|
-
// - the row is not expanded, in which case we only add the row itself to the flat view
|
|
420
|
-
// - the row is expanded but it has no data loaded. We should then request data, but not add the rows
|
|
421
|
-
// - the row is expanded and there is add. This is the easy case, we simply add the child rows as we flatten
|
|
422
|
-
if (row.kind === "parent") {
|
|
423
|
-
const expanded = expansions[row.data.id] ??
|
|
424
|
-
(typeof defaultExpansion === "number"
|
|
425
|
-
? getNodeDepth(row) <= defaultExpansion
|
|
426
|
-
: defaultExpansion);
|
|
427
|
-
// Expanded but no data. Fetch the child data.
|
|
428
|
-
if (expanded && !row.byIndex.size) {
|
|
429
|
-
const path = getNodePath(row);
|
|
430
|
-
const start = 0;
|
|
431
|
-
const end = Math.min(start + blocksize, row.size);
|
|
432
|
-
const reqSize = end - start;
|
|
433
|
-
const req = {
|
|
434
|
-
path,
|
|
435
|
-
start: start,
|
|
436
|
-
end: end,
|
|
437
|
-
id: getRequestId(path, 0, blocksize),
|
|
438
|
-
rowStartIndex: rowIndex + 1,
|
|
439
|
-
rowEndIndex: rowIndex + 1 + reqSize,
|
|
440
|
-
};
|
|
441
|
-
// If we haven't already requested the children data for this node, let's request it.
|
|
442
|
-
if (!seen.has(req.id)) {
|
|
443
|
-
postFlatRequests.push([rowIndex, req]);
|
|
444
|
-
}
|
|
445
|
-
}
|
|
446
|
-
else if (expanded) {
|
|
447
|
-
offset += processParent(row, rowIndex + 1);
|
|
448
|
-
}
|
|
449
|
-
}
|
|
450
|
-
}
|
|
451
|
-
ranges.push({
|
|
452
|
-
rowStart: start,
|
|
453
|
-
rowEnd: offset + node.size + start,
|
|
454
|
-
parent: node,
|
|
455
|
-
});
|
|
456
|
-
return offset + node.size;
|
|
457
|
-
}
|
|
458
|
-
const topCount = this.#top.rows.length;
|
|
459
|
-
const bottomCount = this.#bottom.rows.length;
|
|
460
|
-
for (let i = 0; i < topCount; i++) {
|
|
461
|
-
const row = this.#top.rows[i];
|
|
462
|
-
rowIndexToRow.set(i, row);
|
|
463
|
-
rowIdToRow.set(row.id, row);
|
|
464
|
-
rowIdToRowIndex.set(row.id, i);
|
|
465
|
-
}
|
|
466
|
-
const size = processParent(t, topCount);
|
|
467
|
-
for (let i = 0; i < bottomCount; i++) {
|
|
468
|
-
const row = this.#bottom.rows[i];
|
|
469
|
-
const rowIndex = i + size;
|
|
470
|
-
rowIndexToRow.set(rowIndex, row);
|
|
471
|
-
rowIdToRow.set(row.id, row);
|
|
472
|
-
rowIdToRowIndex.set(row.id, rowIndex);
|
|
473
|
-
}
|
|
474
|
-
const rangeTree = new RangeTree(ranges);
|
|
475
|
-
if (postFlatRequests.length > 0) {
|
|
476
|
-
postFlatRequests.forEach((c) => {
|
|
477
|
-
withLoadingGroup.add(c[0]);
|
|
478
|
-
seen.add(c[1].id);
|
|
479
|
-
});
|
|
480
|
-
const invalidate = this.#onInvalidate;
|
|
481
|
-
const reqs = postFlatRequests.map((c) => c[1]);
|
|
482
|
-
handleRequests(reqs, {
|
|
483
|
-
skipState: true,
|
|
484
|
-
onError: (e) => {
|
|
485
|
-
invalidate();
|
|
486
|
-
postFlatRequests.forEach((c) => {
|
|
487
|
-
const rowIndex = c[0];
|
|
488
|
-
const req = c[1];
|
|
489
|
-
withLoadingGroup.delete(rowIndex);
|
|
490
|
-
withGroupError.set(rowIndex, { error: e, request: req });
|
|
491
|
-
});
|
|
492
|
-
},
|
|
493
|
-
onSuccess: () => {
|
|
494
|
-
postFlatRequests.forEach((c) => {
|
|
495
|
-
withLoadingGroup.delete(c[0]);
|
|
496
|
-
});
|
|
497
|
-
},
|
|
498
|
-
});
|
|
499
|
-
}
|
|
500
|
-
this.#flat = {
|
|
501
|
-
tree: t,
|
|
502
|
-
top: topCount,
|
|
503
|
-
center: size - topCount,
|
|
504
|
-
bottom: bottomCount,
|
|
505
|
-
rangeTree,
|
|
506
|
-
rowIndexToRow,
|
|
507
|
-
rowIdToRow,
|
|
508
|
-
rowIdToRowIndex,
|
|
509
|
-
rowIdToTreeNode,
|
|
510
|
-
errored: this.#rowsWithError,
|
|
511
|
-
erroredGroup: this.#rowsWithGroupError,
|
|
512
|
-
loading: this.#loadingRows,
|
|
513
|
-
loadingGroup: this.#loadingGroup,
|
|
514
|
-
seenRequests: seen,
|
|
515
|
-
};
|
|
516
|
-
beforeOnFlat?.();
|
|
517
|
-
this.#onFlatten(this.#flat);
|
|
518
|
-
};
|
|
519
|
-
}
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import type { RowDataSourceServer, RowDataSourceServerParams } from "../+types.js";
|
|
2
|
-
export declare function makeServerDataSource<T>({ dataFetcher, dataInFilterItemFetcher, dataColumnPivotFetcher, cellUpdateHandler, cellUpdateOptimistically, blockSize, }: Omit<RowDataSourceServerParams<T>, "dataFetchExternals">): RowDataSourceServer<T>;
|
|
3
|
-
export declare function useServerDataSource<T>(p: RowDataSourceServerParams<T>): RowDataSourceServer<T>;
|