@1771technologies/lytenyte-pro 1.0.20 → 2.0.0-dev.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/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/dist/__play__/alpha.play.d.ts +3 -0
- package/dist/__play__/alpha.play.js +56 -0
- package/dist/__play__/basic-server-data/data.d.ts +10 -0
- package/dist/__play__/basic-server-data/data.js +17746 -0
- package/dist/__play__/basic-server-data/server.d.ts +36 -0
- package/dist/__play__/basic-server-data/server.js +105 -0
- package/dist/__play__/buttons.play.d.ts +4 -0
- package/dist/__play__/buttons.play.js +7 -0
- package/dist/__play__/inputs.play.d.ts +3 -0
- package/dist/__play__/inputs.play.js +13 -0
- package/dist/__play__/server.play.d.ts +3 -0
- package/dist/__play__/server.play.js +66 -0
- package/dist/__play__/tree.play.d.ts +3 -0
- package/dist/__play__/tree.play.js +47 -0
- package/dist/cell-selection/adjust-rect-for-row-and-cell-span.d.ts +2 -2
- package/dist/cell-selection/adjust-rect-for-row-and-cell-span.js +5 -5
- package/dist/cell-selection/are-rects-equal.d.ts +1 -1
- package/dist/cell-selection/bound-selection-rect.d.ts +3 -2
- package/dist/cell-selection/bound-selection-rect.js +2 -3
- package/dist/cell-selection/cell-selection-containers.js +32 -37
- package/dist/cell-selection/cell-selection-driver/cell-selection-driver.js +279 -0
- package/dist/cell-selection/cell-selection-driver/use-cell-focus-change.d.ts +6 -0
- package/dist/cell-selection/cell-selection-driver/use-cell-focus-change.js +34 -0
- package/dist/cell-selection/cell-style-row.d.ts +1 -1
- package/dist/cell-selection/cell-style-row.js +27 -32
- package/dist/cell-selection/data-rect-from-cell-position.d.ts +3 -0
- package/dist/cell-selection/data-rect-from-cell-position.js +17 -0
- package/dist/cell-selection/deselect-rect-range.d.ts +1 -1
- package/dist/cell-selection/expand-selection-down.d.ts +3 -0
- package/dist/cell-selection/expand-selection-down.js +78 -0
- package/dist/cell-selection/expand-selection-end.d.ts +3 -0
- package/dist/cell-selection/expand-selection-end.js +76 -0
- package/dist/cell-selection/expand-selection-start.d.ts +3 -0
- package/dist/cell-selection/expand-selection-start.js +73 -0
- package/dist/cell-selection/expand-selection-up.d.ts +3 -0
- package/dist/cell-selection/expand-selection-up.js +74 -0
- package/dist/cell-selection/full-width-start-end-index.d.ts +2 -2
- package/dist/cell-selection/full-width-start-end-index.js +2 -3
- package/dist/cell-selection/get-root-cell.d.ts +3 -2
- package/dist/cell-selection/get-root-cell.js +2 -2
- package/dist/cell-selection/index.d.ts +0 -5
- package/dist/cell-selection/index.js +0 -5
- package/dist/cell-selection/is-bottom-rect.d.ts +2 -2
- package/dist/cell-selection/is-bottom-rect.js +1 -4
- package/dist/cell-selection/is-center-col-rect.d.ts +2 -2
- package/dist/cell-selection/is-center-col-rect.js +2 -4
- package/dist/cell-selection/is-center-rect.d.ts +2 -2
- package/dist/cell-selection/is-center-rect.js +3 -4
- package/dist/cell-selection/is-end-rect.d.ts +2 -2
- package/dist/cell-selection/is-end-rect.js +2 -3
- package/dist/cell-selection/is-fully-within-rect.d.ts +2 -0
- package/dist/cell-selection/is-fully-within-rect.js +6 -0
- package/dist/cell-selection/is-overlapping-rect.d.ts +2 -2
- package/dist/cell-selection/is-overlapping-rect.js +4 -5
- package/dist/cell-selection/is-start-rect.d.ts +2 -2
- package/dist/cell-selection/is-start-rect.js +2 -3
- package/dist/cell-selection/is-top-rect.d.ts +2 -2
- package/dist/cell-selection/is-top-rect.js +1 -2
- package/dist/cell-selection/is-within-selection-rect.d.ts +1 -1
- package/dist/cell-selection/split-cell-selection-rect.d.ts +2 -1
- package/dist/cell-selection/split-on-pivot.d.ts +1 -1
- package/dist/cell-selection/update-additive-cell-selection.d.ts +4 -5
- package/dist/cell-selection/update-additive-cell-selection.js +9 -11
- package/dist/cell-selection/use-edge-scroll.d.ts +2 -6
- package/dist/cell-selection/use-edge-scroll.js +21 -16
- package/dist/components/checkbox/checkbox.d.ts +15 -0
- package/dist/components/checkbox/checkbox.js +42 -0
- package/dist/components/checkbox/checkbox.play.d.ts +2 -0
- package/dist/components/checkbox/checkbox.play.js +6 -0
- package/dist/components/column-manager/column-manager.d.ts +13 -0
- package/dist/components/column-manager/column-manager.js +47 -0
- package/dist/components/external/clsx.d.ts +2 -0
- package/dist/components/external/clsx.js +44 -0
- package/dist/components/external/floating-ui.d.ts +268 -0
- package/dist/components/external/floating-ui.js +1802 -0
- package/dist/components/headless/dialog/arrow.d.ts +6 -0
- package/dist/components/headless/dialog/arrow.js +16 -0
- package/dist/components/headless/dialog/close.d.ts +10 -0
- package/dist/components/headless/dialog/close.js +22 -0
- package/dist/components/headless/dialog/container.d.ts +5 -0
- package/dist/components/headless/dialog/container.js +221 -0
- package/dist/components/headless/dialog/context.d.ts +32 -0
- package/dist/components/headless/dialog/context.js +3 -0
- package/dist/components/headless/dialog/description.d.ts +9 -0
- package/dist/components/headless/dialog/description.js +20 -0
- package/dist/components/headless/dialog/index.parts.d.ts +30 -0
- package/dist/components/headless/dialog/index.parts.js +17 -0
- package/dist/components/headless/dialog/root.d.ts +32 -0
- package/dist/components/headless/dialog/root.js +75 -0
- package/dist/components/headless/dialog/title.d.ts +9 -0
- package/dist/components/headless/dialog/title.js +20 -0
- package/dist/components/headless/dialog/transform-origin.d.ts +5 -0
- package/dist/components/headless/dialog/transform-origin.js +38 -0
- package/dist/components/headless/dialog/trigger.d.ts +10 -0
- package/dist/components/headless/dialog/trigger.js +24 -0
- package/dist/components/headless/dialog/use-dialog.d.ts +4 -0
- package/dist/components/headless/dialog/use-dialog.js +12 -0
- package/dist/components/headless/menu/checkbox-item.d.ts +11 -0
- package/dist/components/headless/menu/checkbox-item.js +42 -0
- package/dist/components/headless/menu/combo/combo-checkbox.d.ts +11 -0
- package/dist/components/headless/menu/combo/combo-checkbox.js +38 -0
- package/dist/components/headless/menu/combo/combo-context.d.ts +9 -0
- package/dist/components/headless/menu/combo/combo-context.js +3 -0
- package/dist/components/headless/menu/combo/combo-input.d.ts +7 -0
- package/dist/components/headless/menu/combo/combo-input.js +58 -0
- package/dist/components/headless/menu/combo/combo-menu.d.ts +5 -0
- package/dist/components/headless/menu/combo/combo-menu.js +24 -0
- package/dist/components/headless/menu/combo/combo-option.d.ts +9 -0
- package/dist/components/headless/menu/combo/combo-option.js +37 -0
- package/dist/components/headless/menu/container.d.ts +5 -0
- package/dist/components/headless/menu/container.js +19 -0
- package/dist/components/headless/menu/dom.d.ts +4 -0
- package/dist/components/headless/menu/dom.js +20 -0
- package/dist/components/headless/menu/index.d.ts +54 -0
- package/dist/components/headless/menu/index.js +39 -0
- package/dist/components/headless/menu/item/handle-vertical-navigation.d.ts +2 -0
- package/dist/components/headless/menu/item/handle-vertical-navigation.js +28 -0
- package/dist/components/headless/menu/item/item.d.ts +9 -0
- package/dist/components/headless/menu/item/item.js +45 -0
- package/dist/components/headless/menu/item/use-menu-item-events.d.ts +1 -0
- package/dist/components/headless/menu/item/use-menu-item-events.js +25 -0
- package/dist/components/headless/menu/menu-divider.d.ts +5 -0
- package/dist/components/headless/menu/menu-divider.js +6 -0
- package/dist/components/headless/menu/menu-group.d.ts +5 -0
- package/dist/components/headless/menu/menu-group.js +6 -0
- package/dist/components/headless/menu/menu-header.d.ts +5 -0
- package/dist/components/headless/menu/menu-header.js +6 -0
- package/dist/components/headless/menu/popover.d.ts +5 -0
- package/dist/components/headless/menu/popover.js +7 -0
- package/dist/components/headless/menu/radio-group/context.d.ts +11 -0
- package/dist/components/headless/menu/radio-group/context.js +7 -0
- package/dist/components/headless/menu/radio-group/radio-item.d.ts +10 -0
- package/dist/components/headless/menu/radio-group/radio-item.js +44 -0
- package/dist/components/headless/menu/submenu/submenu-context.d.ts +9 -0
- package/dist/components/headless/menu/submenu/submenu-context.js +3 -0
- package/dist/components/headless/menu/submenu/submenu-trigger.d.ts +7 -0
- package/dist/components/headless/menu/submenu/submenu-trigger.js +70 -0
- package/dist/components/headless/menu/submenu/submenu.d.ts +21 -0
- package/dist/components/headless/menu/submenu/submenu.js +55 -0
- package/dist/components/headless/menu/submenu/use-submenu-position.d.ts +5 -0
- package/dist/components/headless/menu/submenu/use-submenu-position.js +31 -0
- package/dist/components/headless/menu/use-menu.d.ts +1 -0
- package/dist/components/headless/menu/use-menu.js +52 -0
- package/dist/components/headless/popover/container.d.ts +5 -0
- package/dist/components/headless/popover/container.js +7 -0
- package/dist/components/headless/popover/context.d.ts +6 -0
- package/dist/components/headless/popover/context.js +3 -0
- package/dist/components/headless/popover/index.d.ts +30 -0
- package/dist/components/headless/popover/index.js +17 -0
- package/dist/components/headless/popover/root.d.ts +6 -0
- package/dist/components/headless/popover/root.js +8 -0
- package/dist/components/headless/popover/trigger.d.ts +7 -0
- package/dist/components/headless/popover/trigger.js +11 -0
- package/dist/components/pill-manager/container.d.ts +5 -0
- package/dist/components/pill-manager/container.js +127 -0
- package/dist/components/pill-manager/expander.d.ts +9 -0
- package/dist/components/pill-manager/expander.js +21 -0
- package/dist/components/pill-manager/icons.d.ts +12 -0
- package/dist/components/pill-manager/icons.js +35 -0
- package/dist/components/pill-manager/index.d.ts +33 -0
- package/dist/components/pill-manager/index.js +13 -0
- package/dist/components/pill-manager/item.d.ts +10 -0
- package/dist/components/pill-manager/item.js +178 -0
- package/dist/components/pill-manager/label.d.ts +10 -0
- package/dist/components/pill-manager/label.js +31 -0
- package/dist/components/pill-manager/pill-manager.play.d.ts +3 -0
- package/dist/components/pill-manager/pill-manager.play.js +73 -0
- package/dist/components/pill-manager/pill-row.context.d.ts +8 -0
- package/dist/components/pill-manager/pill-row.context.js +4 -0
- package/dist/components/pill-manager/pill-row.d.ts +12 -0
- package/dist/components/pill-manager/pill-row.js +22 -0
- package/dist/components/pill-manager/root.context.d.ts +40 -0
- package/dist/components/pill-manager/root.context.js +4 -0
- package/dist/components/pill-manager/root.d.ts +25 -0
- package/dist/components/pill-manager/root.js +33 -0
- package/dist/components/pill-manager/row-default.d.ts +3 -0
- package/dist/components/pill-manager/row-default.js +14 -0
- package/dist/components/pill-manager/types.d.ts +21 -0
- package/dist/components/row-group-cell.d.ts +13 -0
- package/dist/components/row-group-cell.js +40 -0
- package/dist/components/select-all.d.ts +12 -0
- package/dist/components/select-all.js +34 -0
- package/dist/components/smart-select/chip-context.d.ts +8 -0
- package/dist/components/smart-select/chip-context.js +4 -0
- package/dist/components/smart-select/chip-remove.d.ts +1 -0
- package/dist/components/smart-select/chip-remove.js +13 -0
- package/dist/components/smart-select/chip.d.ts +13 -0
- package/dist/components/smart-select/chip.js +79 -0
- package/dist/components/smart-select/container.d.ts +1 -0
- package/dist/components/smart-select/container.js +13 -0
- package/dist/components/smart-select/context.d.ts +31 -0
- package/dist/components/smart-select/context.js +4 -0
- package/dist/components/smart-select/index.d.ts +30 -0
- package/dist/components/smart-select/index.js +19 -0
- package/dist/components/smart-select/option.d.ts +8 -0
- package/dist/components/smart-select/option.js +36 -0
- package/dist/components/smart-select/root.d.ts +17 -0
- package/dist/components/smart-select/root.js +165 -0
- package/dist/components/smart-select/smart-select.play.d.ts +2 -0
- package/dist/components/smart-select/smart-select.play.js +36 -0
- package/dist/components/smart-select/triggers/basic-trigger.d.ts +1 -0
- package/dist/components/smart-select/triggers/basic-trigger.js +18 -0
- package/dist/components/smart-select/triggers/combo-trigger.d.ts +1 -0
- package/dist/components/smart-select/triggers/combo-trigger.js +17 -0
- package/dist/components/smart-select/triggers/is-selectable-option.d.ts +1 -0
- package/dist/components/smart-select/triggers/is-selectable-option.js +3 -0
- package/dist/components/smart-select/triggers/multi-combo-trigger.d.ts +11 -0
- package/dist/components/smart-select/triggers/multi-combo-trigger.js +38 -0
- package/dist/components/smart-select/triggers/multi-trigger.d.ts +6 -0
- package/dist/components/smart-select/triggers/multi-trigger.js +8 -0
- package/dist/components/smart-select/triggers/use-combo-controls.d.ts +9 -0
- package/dist/components/smart-select/triggers/use-combo-controls.js +145 -0
- package/dist/components/smart-select/triggers/use-trigger-controls.d.ts +5 -0
- package/dist/components/smart-select/triggers/use-trigger-controls.js +126 -0
- package/dist/components/smart-select/type.d.ts +44 -0
- package/dist/components/smart-select/use-async-options.d.ts +8 -0
- package/dist/components/smart-select/use-async-options.js +42 -0
- package/dist/components/tree-view/index.d.ts +4 -0
- package/dist/components/tree-view/index.js +2 -0
- package/dist/components/tree-view/root.d.ts +37 -0
- package/dist/components/tree-view/root.js +139 -0
- package/dist/components/tree-view/select-all.d.ts +7 -0
- package/dist/components/tree-view/select-all.js +22 -0
- package/dist/components/tree-view/tree-children.d.ts +2 -0
- package/dist/components/tree-view/tree-children.js +15 -0
- package/dist/components/tree-view/types.d.ts +31 -0
- package/dist/components/types.d.ts +4 -0
- package/dist/components/virtual-from-coordinates.d.ts +2 -0
- package/dist/components/virtual-from-coordinates.js +15 -0
- package/dist/components.d.ts +16 -0
- package/dist/components.js +11 -0
- package/dist/data-source-client/hooks/get-valid-leafs.d.ts +3 -0
- package/dist/data-source-client/hooks/get-valid-leafs.js +11 -0
- package/dist/data-source-client/hooks/use-controlled-ds-state.d.ts +13 -0
- package/dist/data-source-client/hooks/use-controlled-ds-state.js +39 -0
- package/dist/data-source-client/hooks/use-flattened-data.d.ts +18 -0
- package/dist/data-source-client/hooks/use-flattened-data.js +40 -0
- package/dist/data-source-client/hooks/use-flattened-groups.d.ts +5 -0
- package/dist/data-source-client/hooks/use-flattened-groups.js +63 -0
- package/dist/data-source-client/hooks/use-flattened-piece.d.ts +14 -0
- package/dist/data-source-client/hooks/use-flattened-piece.js +55 -0
- package/dist/data-source-client/hooks/use-group-tree/collapse-child.d.ts +2 -0
- package/dist/data-source-client/hooks/use-group-tree/collapse-child.js +11 -0
- package/dist/data-source-client/hooks/use-group-tree/collapse-last.d.ts +2 -0
- package/dist/data-source-client/hooks/use-group-tree/collapse-last.js +14 -0
- package/dist/data-source-client/hooks/use-group-tree/collapse.d.ts +2 -0
- package/dist/data-source-client/hooks/use-group-tree/collapse.js +17 -0
- package/dist/data-source-client/hooks/use-group-tree/use-group-tree.d.ts +31 -0
- package/dist/data-source-client/hooks/use-group-tree/use-group-tree.js +152 -0
- package/dist/data-source-client/hooks/use-pivot/auxiliary-functions/apply-reference-column.d.ts +2 -0
- package/dist/data-source-client/hooks/use-pivot/auxiliary-functions/apply-reference-column.js +22 -0
- package/dist/data-source-client/hooks/use-pivot/auxiliary-functions/evaluate-label-filter.d.ts +2 -0
- package/dist/data-source-client/hooks/use-pivot/auxiliary-functions/evaluate-label-filter.js +9 -0
- package/dist/data-source-client/hooks/use-pivot/auxiliary-functions/pivot-paths-with-totals.d.ts +18 -0
- package/dist/data-source-client/hooks/use-pivot/auxiliary-functions/pivot-paths-with-totals.js +140 -0
- package/dist/data-source-client/hooks/use-pivot/auxiliary-functions/pivot-paths.d.ts +4 -0
- package/dist/data-source-client/hooks/use-pivot/auxiliary-functions/pivot-paths.js +31 -0
- package/dist/data-source-client/hooks/use-pivot/use-agg-model.d.ts +4 -0
- package/dist/data-source-client/hooks/use-pivot/use-agg-model.js +45 -0
- package/dist/data-source-client/hooks/use-pivot/use-filtered-data.d.ts +2 -0
- package/dist/data-source-client/hooks/use-pivot/use-filtered-data.js +18 -0
- package/dist/data-source-client/hooks/use-pivot/use-pivot-columns.d.ts +14 -0
- package/dist/data-source-client/hooks/use-pivot/use-pivot-columns.js +151 -0
- package/dist/data-source-client/hooks/use-pivot/use-pivot-data.d.ts +32 -0
- package/dist/data-source-client/hooks/use-pivot/use-pivot-data.js +83 -0
- package/dist/data-source-client/hooks/use-pivot/use-pivot-group-fn.d.ts +4 -0
- package/dist/data-source-client/hooks/use-pivot/use-pivot-group-fn.js +23 -0
- package/dist/data-source-client/hooks/use-pivot/use-pivot-state.d.ts +16 -0
- package/dist/data-source-client/hooks/use-pivot/use-pivot-state.js +40 -0
- package/dist/data-source-client/use-client-data-source.d.ts +91 -0
- package/dist/data-source-client/use-client-data-source.js +169 -0
- package/dist/data-source-server/async-tree/apply-delete-action-to-tree.d.ts +2 -0
- package/dist/data-source-server/async-tree/apply-set-action-to-tree.d.ts +2 -0
- package/dist/data-source-server/async-tree/apply-set-action-to-tree.js +26 -0
- package/dist/data-source-server/async-tree/data-integrity-checks/check-set-action-item-keys-are-unique.d.ts +2 -0
- package/dist/data-source-server/async-tree/data-integrity-checks/check-set-action-item-keys-are-unique.js +20 -0
- package/dist/data-source-server/async-tree/data-integrity-checks/check-set-action-item-keys-are-valid.d.ts +2 -0
- package/dist/data-source-server/async-tree/data-integrity-checks/check-set-action-item-keys-are-valid.js +12 -0
- package/dist/data-source-server/async-tree/data-integrity-checks/check-set-action-item-keys-fit.d.ts +2 -0
- package/dist/data-source-server/async-tree/data-integrity-checks/check-set-action-item-kinds.d.ts +2 -0
- package/dist/data-source-server/async-tree/data-integrity-checks/check-set-action-item-kinds.js +12 -0
- package/dist/data-source-server/async-tree/data-integrity-checks/check-set-action.d.ts +2 -0
- package/dist/data-source-server/async-tree/data-integrity-checks/check-set-action.js +24 -0
- package/dist/data-source-server/async-tree/get-parent-node-by-path.d.ts +2 -0
- package/dist/data-source-server/async-tree/is-set-action-a-no-op-on-node.d.ts +2 -0
- package/dist/data-source-server/async-tree/make-async-tree.d.ts +2 -0
- package/dist/data-source-server/async-tree/make-async-tree.js +64 -0
- package/dist/data-source-server/async-tree/maybe-apply-parent-remove-self.d.ts +2 -0
- package/dist/data-source-server/async-tree/maybe-apply-resize.d.ts +2 -0
- package/dist/data-source-server/async-tree/maybe-apply-set-action-items.d.ts +2 -0
- package/dist/data-source-server/async-tree/maybe-apply-set-action-items.js +54 -0
- package/dist/data-source-server/async-tree/types.d.ts +70 -0
- package/dist/data-source-server/range-tree/range-tree.d.ts +66 -0
- package/dist/data-source-server/server-data.d.ts +73 -0
- package/dist/data-source-server/server-data.js +553 -0
- package/dist/data-source-server/source/use-on-rows-updated.d.ts +4 -0
- package/dist/data-source-server/source/use-on-rows-updated.js +29 -0
- package/dist/data-source-server/source/use-on-view-change.d.ts +3 -0
- package/dist/data-source-server/source/use-on-view-change.js +13 -0
- package/dist/data-source-server/source/use-row-add.d.ts +3 -0
- package/dist/data-source-server/source/use-row-add.js +36 -0
- package/dist/data-source-server/source/use-row-by-id.d.ts +2 -0
- package/dist/data-source-server/source/use-row-by-id.js +8 -0
- package/dist/data-source-server/source/use-row-by-index.d.ts +9 -0
- package/dist/data-source-server/source/use-row-by-index.js +89 -0
- package/dist/data-source-server/source/use-row-children.d.ts +2 -0
- package/dist/data-source-server/source/use-row-children.js +16 -0
- package/dist/data-source-server/source/use-row-delete.d.ts +3 -0
- package/dist/data-source-server/source/use-row-delete.js +39 -0
- package/dist/data-source-server/source/use-row-id-to-row-index.d.ts +2 -0
- package/dist/data-source-server/source/use-row-id-to-row-index.js +7 -0
- package/dist/data-source-server/source/use-row-index-to-row-id.d.ts +2 -0
- package/dist/data-source-server/source/use-row-index-to-row-id.js +7 -0
- package/dist/data-source-server/source/use-row-leafs.d.ts +2 -0
- package/dist/data-source-server/source/use-row-leafs.js +20 -0
- package/dist/data-source-server/source/use-row-parents.d.ts +2 -0
- package/dist/data-source-server/source/use-row-parents.js +16 -0
- package/dist/data-source-server/source/use-row-siblings.d.ts +2 -0
- package/dist/data-source-server/source/use-row-siblings.js +15 -0
- package/dist/data-source-server/source/use-rows-between.d.ts +2 -0
- package/dist/data-source-server/source/use-rows-between.js +20 -0
- package/dist/data-source-server/source/use-source-state.d.ts +28 -0
- package/dist/data-source-server/source/use-source-state.js +47 -0
- package/dist/data-source-server/source/use-source.d.ts +5 -0
- package/dist/data-source-server/source/use-source.js +66 -0
- package/dist/data-source-server/types.d.ts +42 -0
- package/dist/data-source-server/use-server-data-source.d.ts +51 -0
- package/dist/data-source-server/use-server-data-source.js +192 -0
- package/dist/data-source-server/utils/get-node-depth.d.ts +2 -0
- package/dist/data-source-server/utils/get-node-path.d.ts +2 -0
- package/dist/data-source-tree/source/use-controlled-state.d.ts +8 -0
- package/dist/data-source-tree/source/use-controlled-state.js +21 -0
- package/dist/data-source-tree/source/use-flattened.d.ts +17 -0
- package/dist/data-source-tree/source/use-flattened.js +65 -0
- package/dist/data-source-tree/source/use-on-rows-updated.d.ts +3 -0
- package/dist/data-source-tree/source/use-on-rows-updated.js +49 -0
- package/dist/data-source-tree/source/use-row-by-id.d.ts +2 -0
- package/dist/data-source-tree/source/use-row-by-id.js +7 -0
- package/dist/data-source-tree/source/use-row-children.d.ts +2 -0
- package/dist/data-source-tree/source/use-row-children.js +11 -0
- package/dist/data-source-tree/source/use-row-leafs.d.ts +2 -0
- package/dist/data-source-tree/source/use-row-leafs.js +20 -0
- package/dist/data-source-tree/source/use-row-parents.d.ts +2 -0
- package/dist/data-source-tree/source/use-row-parents.js +16 -0
- package/dist/data-source-tree/source/use-row-siblings.d.ts +2 -0
- package/dist/data-source-tree/source/use-row-siblings.js +12 -0
- package/dist/data-source-tree/source/use-tree.d.ts +3 -0
- package/dist/data-source-tree/source/use-tree.js +59 -0
- package/dist/data-source-tree/types.d.ts +16 -0
- package/dist/data-source-tree/use-tree-data-source.d.ts +41 -0
- package/dist/data-source-tree/use-tree-data-source.js +101 -0
- package/dist/data-source-tree/utils/is-object.d.ts +1 -0
- package/dist/data-source-tree/utils/is-object.js +3 -0
- package/dist/hooks/use-slot/get-element-ref.d.ts +2 -0
- package/dist/hooks/use-slot/get-element-ref.js +20 -0
- package/dist/hooks/use-slot/index.d.ts +3 -0
- package/dist/hooks/use-slot/index.js +1 -0
- package/dist/hooks/use-slot/merge-props.d.ts +4 -0
- package/dist/hooks/use-slot/merge-props.js +27 -0
- package/dist/hooks/use-slot/react-version.d.ts +3 -0
- package/dist/hooks/use-slot/react-version.js +5 -0
- package/dist/hooks/use-slot/types.d.ts +4 -0
- package/dist/hooks/use-slot/use-slot.d.ts +12 -0
- package/dist/hooks/use-slot/use-slot.js +28 -0
- package/dist/hooks/use-transitioned-open.d.ts +2 -0
- package/dist/hooks/use-transitioned-open.js +50 -0
- package/dist/index.d.ts +120 -13
- package/dist/index.js +22 -13
- package/dist/license/md5-hash.d.ts +1 -1
- package/dist/license/md5-hash.js +1 -1
- package/dist/root/context.d.ts +16 -0
- package/dist/root/context.js +4 -0
- package/dist/root/hooks/use-pro-api.d.ts +2 -0
- package/dist/root/hooks/use-pro-api.js +8 -0
- package/dist/root/root.d.ts +15 -0
- package/dist/root/root.js +112 -0
- package/dist/types/api.d.ts +100 -0
- package/dist/types/api.js +1 -0
- package/dist/types/column.d.ts +73 -0
- package/dist/types/column.js +1 -0
- package/dist/types/events.d.ts +56 -0
- package/dist/types/events.js +1 -0
- package/dist/types/grid.d.ts +47 -0
- package/dist/types/grid.js +1 -0
- package/dist/types/index.d.ts +7 -0
- package/dist/types/index.js +1 -0
- package/dist/types/props.d.ts +187 -0
- package/dist/types/props.js +1 -0
- package/package.json +29 -16
- package/dist/+types.d.ts +0 -6177
- 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/cell-selection-driver.js +0 -289
- 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/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/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/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/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/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/+types.async-tree.d.ts +0 -59
- 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-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-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/is-set-action-a-no-op-on-node.d.ts +0 -2
- 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-resize.d.ts +0 -2
- 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/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-path.d.ts +0 -2
- package/dist/sort-manager/+types.d.ts +0 -13
- 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/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/main.css +0 -465
- /package/dist/cell-selection/{cell-selection-driver.d.ts → cell-selection-driver/cell-selection-driver.d.ts} +0 -0
- /package/dist/{types → components/pill-manager}/types.js +0 -0
- /package/dist/{+types.js → components/smart-select/type.js} +0 -0
- /package/dist/{grid-box/+types.js → components/tree-view/types.js} +0 -0
- /package/dist/{row-data-source-client/+types.js → components/types.js} +0 -0
- /package/dist/{row-data-source-server → data-source-server}/async-tree/+constants.async-tree.d.ts +0 -0
- /package/dist/{row-data-source-server → data-source-server}/async-tree/+constants.async-tree.js +0 -0
- /package/dist/{row-data-source-server → data-source-server}/async-tree/apply-delete-action-to-tree.js +0 -0
- /package/dist/{row-data-source-server/async-tree → data-source-server/async-tree/data-integrity-checks}/check-set-action-item-keys-fit.js +0 -0
- /package/dist/{row-data-source-server → data-source-server}/async-tree/get-parent-node-by-path.js +0 -0
- /package/dist/{row-data-source-server → data-source-server}/async-tree/is-set-action-a-no-op-on-node.js +0 -0
- /package/dist/{row-data-source-server → data-source-server}/async-tree/maybe-apply-parent-remove-self.js +0 -0
- /package/dist/{row-data-source-server → data-source-server}/async-tree/maybe-apply-resize.js +0 -0
- /package/dist/{row-data-source-client/filter/+types.js → data-source-server/async-tree/types.js} +0 -0
- /package/dist/{row-data-source-server → data-source-server}/range-tree/range-tree.js +0 -0
- /package/dist/{row-data-source-server/async-tree/+types.async-tree.js → data-source-server/types.js} +0 -0
- /package/dist/{row-data-source-server → data-source-server}/utils/get-node-depth.js +0 -0
- /package/dist/{row-data-source-server → data-source-server}/utils/get-node-path.js +0 -0
- /package/dist/{row-data-source-server → data-source-server}/utils/get-request-id.d.ts +0 -0
- /package/dist/{row-data-source-server → data-source-server}/utils/get-request-id.js +0 -0
- /package/dist/{sort-manager/+types.js → data-source-tree/types.js} +0 -0
- /package/dist/{state/+types.js → hooks/use-slot/types.js} +0 -0
|
@@ -0,0 +1,553 @@
|
|
|
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
|
+
#top = { asOf: 0, rows: [] };
|
|
10
|
+
#bottom = { asOf: 0, rows: [] };
|
|
11
|
+
#blocksize;
|
|
12
|
+
tree;
|
|
13
|
+
flat;
|
|
14
|
+
#dataFetcher = noopFetcher;
|
|
15
|
+
#expansions;
|
|
16
|
+
#onResetLoadBegin;
|
|
17
|
+
#onResetLoadError;
|
|
18
|
+
#onResetLoadEnd;
|
|
19
|
+
#onFlatten;
|
|
20
|
+
#onInvalidate;
|
|
21
|
+
#rowViewBounds = [0, 0];
|
|
22
|
+
#seenRequests = new Set();
|
|
23
|
+
#loadingRows = new Set();
|
|
24
|
+
#loadingGroup = new Set();
|
|
25
|
+
#rowsWithError = new Map();
|
|
26
|
+
#rowsWithGroupError = new Map();
|
|
27
|
+
#controllers = new Set();
|
|
28
|
+
#defaultExpansion;
|
|
29
|
+
constructor({ blocksize, expansions, onResetLoadBegin, onResetLoadEnd, onResetLoadError, onFlatten, onInvalidate, defaultExpansion, }) {
|
|
30
|
+
this.tree = makeAsyncTree();
|
|
31
|
+
this.#blocksize = blocksize;
|
|
32
|
+
this.#expansions = expansions;
|
|
33
|
+
this.#defaultExpansion = defaultExpansion;
|
|
34
|
+
this.#onResetLoadBegin = onResetLoadBegin;
|
|
35
|
+
this.#onResetLoadEnd = onResetLoadEnd;
|
|
36
|
+
this.#onResetLoadError = onResetLoadError;
|
|
37
|
+
this.#onFlatten = onFlatten;
|
|
38
|
+
this.#onInvalidate = onInvalidate;
|
|
39
|
+
}
|
|
40
|
+
// Properties
|
|
41
|
+
set dataFetcher(d) {
|
|
42
|
+
if (this.#dataFetcher === d)
|
|
43
|
+
return;
|
|
44
|
+
this.#dataFetcher = d;
|
|
45
|
+
this.reset();
|
|
46
|
+
}
|
|
47
|
+
set expansions(d) {
|
|
48
|
+
this.#expansions = d;
|
|
49
|
+
this.#flatten();
|
|
50
|
+
}
|
|
51
|
+
set defaultExpansion(d) {
|
|
52
|
+
this.#defaultExpansion = d;
|
|
53
|
+
}
|
|
54
|
+
set rowViewBounds(viewBounds) {
|
|
55
|
+
if (equal(viewBounds, this.#rowViewBounds))
|
|
56
|
+
return;
|
|
57
|
+
this.#rowViewBounds = viewBounds;
|
|
58
|
+
this.handleViewBoundsChange();
|
|
59
|
+
}
|
|
60
|
+
// Methods
|
|
61
|
+
reset = async () => {
|
|
62
|
+
// Abort all the existing requests in flight.
|
|
63
|
+
this.#controllers.forEach((c) => c.abort());
|
|
64
|
+
this.tree = makeAsyncTree();
|
|
65
|
+
this.#flatten();
|
|
66
|
+
this.#rowsWithError.clear();
|
|
67
|
+
this.#rowsWithGroupError.clear();
|
|
68
|
+
this.#loadingRows.clear();
|
|
69
|
+
this.#loadingGroup.clear();
|
|
70
|
+
try {
|
|
71
|
+
this.#onResetLoadBegin();
|
|
72
|
+
this.#seenRequests.clear();
|
|
73
|
+
const req = {
|
|
74
|
+
rowStartIndex: 0,
|
|
75
|
+
rowEndIndex: this.#blocksize,
|
|
76
|
+
id: getRequestId([], 0, this.#blocksize),
|
|
77
|
+
path: [],
|
|
78
|
+
start: 0,
|
|
79
|
+
end: this.#blocksize,
|
|
80
|
+
};
|
|
81
|
+
this.#seenRequests.add(req.id);
|
|
82
|
+
const res = await this.#dataFetcher([req], this.#expansions);
|
|
83
|
+
this.handleResponses(res);
|
|
84
|
+
}
|
|
85
|
+
catch (e) {
|
|
86
|
+
this.#onResetLoadError(e);
|
|
87
|
+
}
|
|
88
|
+
finally {
|
|
89
|
+
this.#onResetLoadEnd();
|
|
90
|
+
}
|
|
91
|
+
};
|
|
92
|
+
requestForGroup(i) {
|
|
93
|
+
const ranges = this.flat.rangeTree.findRangesForRowIndex(i);
|
|
94
|
+
const path = ranges.slice(1).map((c) => (c.parent.kind === "parent" ? c.parent.path : null));
|
|
95
|
+
const row = this.flat.rowIndexToRow.get(i);
|
|
96
|
+
if (row?.kind !== "branch")
|
|
97
|
+
return null;
|
|
98
|
+
path.push(row.key);
|
|
99
|
+
const r = (ranges.at(-1)?.parent).byPath.get(row.key);
|
|
100
|
+
const blocksize = this.#blocksize;
|
|
101
|
+
const start = 0;
|
|
102
|
+
const end = Math.min(start + blocksize, r.size);
|
|
103
|
+
const reqSize = end - start;
|
|
104
|
+
const req = {
|
|
105
|
+
path,
|
|
106
|
+
start: start,
|
|
107
|
+
end: end,
|
|
108
|
+
id: getRequestId(path, 0, blocksize),
|
|
109
|
+
rowStartIndex: i + 1,
|
|
110
|
+
rowEndIndex: i + 1 + reqSize,
|
|
111
|
+
};
|
|
112
|
+
return req;
|
|
113
|
+
}
|
|
114
|
+
handleRequests = async (requests, opts = {}) => {
|
|
115
|
+
const controller = new AbortController();
|
|
116
|
+
this.#controllers.add(controller);
|
|
117
|
+
const skip = opts.skipState ?? false;
|
|
118
|
+
// We need to request our new data now. There are a few scenarios to be aware. Once we are requesting rows,
|
|
119
|
+
// we should mark the rows loading. This means we mark the row indices as loading (maybe by range)?
|
|
120
|
+
// The load may fail, in which case we should mark the request as an error.
|
|
121
|
+
try {
|
|
122
|
+
// Mark these rows as loading
|
|
123
|
+
requests.forEach((req) => {
|
|
124
|
+
if (!skip)
|
|
125
|
+
for (let i = req.rowStartIndex; i < req.rowEndIndex; i++)
|
|
126
|
+
this.#loadingRows.add(i);
|
|
127
|
+
});
|
|
128
|
+
const responses = await this.#dataFetcher(requests, this.#expansions);
|
|
129
|
+
// The request was aborted, so we can ignore it from this point
|
|
130
|
+
if (controller.signal.aborted)
|
|
131
|
+
return;
|
|
132
|
+
this.handleResponses(responses, () => {
|
|
133
|
+
if (!skip)
|
|
134
|
+
requests.forEach((req) => {
|
|
135
|
+
for (let i = req.rowStartIndex; i < req.rowEndIndex; i++)
|
|
136
|
+
this.#rowsWithError.delete(i);
|
|
137
|
+
for (let i = req.rowStartIndex; i < req.rowEndIndex; i++)
|
|
138
|
+
this.#loadingRows.delete(i);
|
|
139
|
+
});
|
|
140
|
+
});
|
|
141
|
+
opts?.onSuccess?.();
|
|
142
|
+
}
|
|
143
|
+
catch (e) {
|
|
144
|
+
if (controller.signal.aborted)
|
|
145
|
+
return;
|
|
146
|
+
opts?.onError?.(e);
|
|
147
|
+
this.#onInvalidate();
|
|
148
|
+
if (!skip)
|
|
149
|
+
requests.forEach((req) => {
|
|
150
|
+
for (let i = req.rowStartIndex; i < req.rowEndIndex; i++)
|
|
151
|
+
this.#rowsWithError.set(i, { error: e, request: req });
|
|
152
|
+
for (let i = req.rowStartIndex; i < req.rowEndIndex; i++)
|
|
153
|
+
this.#loadingRows.delete(i);
|
|
154
|
+
});
|
|
155
|
+
}
|
|
156
|
+
finally {
|
|
157
|
+
this.#controllers.delete(controller);
|
|
158
|
+
}
|
|
159
|
+
};
|
|
160
|
+
handleResponses = (data, beforeOnFlat) => {
|
|
161
|
+
const pinned = data.filter((c) => c.kind === "top" || c.kind === "bottom");
|
|
162
|
+
const center = data.filter((c) => c.kind !== "top" && c.kind !== "bottom");
|
|
163
|
+
// handle pinned
|
|
164
|
+
for (let i = 0; i < pinned.length; i++) {
|
|
165
|
+
const r = pinned[i];
|
|
166
|
+
if (r.kind === "top" && r.asOfTime > this.#top.asOf) {
|
|
167
|
+
this.#top = {
|
|
168
|
+
asOf: r.asOfTime,
|
|
169
|
+
rows: r.data.map((c) => ({ id: c.id, data: c.data, kind: "leaf", depth: 0 })),
|
|
170
|
+
};
|
|
171
|
+
}
|
|
172
|
+
else if (r.kind === "bottom" && r.asOfTime > this.#bottom.asOf) {
|
|
173
|
+
this.#bottom = {
|
|
174
|
+
asOf: r.asOfTime,
|
|
175
|
+
rows: r.data.map((c) => ({ id: c.id, data: c.data, kind: "leaf", depth: 0 })),
|
|
176
|
+
};
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
center.sort((l, r) => l.path.length - r.path.length);
|
|
180
|
+
for (let i = 0; i < center.length; i++) {
|
|
181
|
+
const r = center[i];
|
|
182
|
+
this.tree.set({
|
|
183
|
+
path: r.path,
|
|
184
|
+
items: r.data.map((c, i) => {
|
|
185
|
+
const parentNode = this.tree.get({ path: r.path });
|
|
186
|
+
const parentId = parentNode?.kind === "parent" ? parentNode.row.id : null;
|
|
187
|
+
if (c.kind === "leaf") {
|
|
188
|
+
return {
|
|
189
|
+
kind: "leaf",
|
|
190
|
+
row: {
|
|
191
|
+
kind: "leaf",
|
|
192
|
+
data: c.data,
|
|
193
|
+
id: c.id,
|
|
194
|
+
depth: r.path.length,
|
|
195
|
+
parentId,
|
|
196
|
+
},
|
|
197
|
+
relIndex: r.start + i,
|
|
198
|
+
};
|
|
199
|
+
}
|
|
200
|
+
else {
|
|
201
|
+
return {
|
|
202
|
+
kind: "parent",
|
|
203
|
+
row: {
|
|
204
|
+
kind: "branch",
|
|
205
|
+
data: c.data,
|
|
206
|
+
depth: r.path.length,
|
|
207
|
+
id: c.id,
|
|
208
|
+
key: c.key,
|
|
209
|
+
expandable: true, // Group nodes are always expandable for the server data source3
|
|
210
|
+
expanded: false,
|
|
211
|
+
last: false,
|
|
212
|
+
parentId,
|
|
213
|
+
__path: r.path,
|
|
214
|
+
},
|
|
215
|
+
path: c.key,
|
|
216
|
+
relIndex: r.start + i,
|
|
217
|
+
size: c.childCount,
|
|
218
|
+
};
|
|
219
|
+
}
|
|
220
|
+
}),
|
|
221
|
+
size: r.size,
|
|
222
|
+
asOf: r.asOfTime,
|
|
223
|
+
});
|
|
224
|
+
}
|
|
225
|
+
// Re-flatten our tree once everything has been re-updated.
|
|
226
|
+
this.#flatten(beforeOnFlat);
|
|
227
|
+
};
|
|
228
|
+
requestForNextSlice(req) {
|
|
229
|
+
let current = this.tree;
|
|
230
|
+
for (const c of req.path) {
|
|
231
|
+
if (current.kind === "leaf")
|
|
232
|
+
return null;
|
|
233
|
+
const next = current.byPath.get(c);
|
|
234
|
+
if (!next)
|
|
235
|
+
return null;
|
|
236
|
+
current = next;
|
|
237
|
+
}
|
|
238
|
+
if (current.kind === "leaf")
|
|
239
|
+
return null;
|
|
240
|
+
const maxSize = current.size;
|
|
241
|
+
if (req.end >= maxSize)
|
|
242
|
+
return null;
|
|
243
|
+
const prevSize = req.end - req.start;
|
|
244
|
+
const start = req.end;
|
|
245
|
+
const end = Math.min(req.end + this.#blocksize, maxSize);
|
|
246
|
+
const size = end - start;
|
|
247
|
+
return {
|
|
248
|
+
id: getRequestId(req.path, start, start + this.#blocksize),
|
|
249
|
+
path: req.path,
|
|
250
|
+
start,
|
|
251
|
+
end,
|
|
252
|
+
rowStartIndex: req.rowStartIndex + prevSize,
|
|
253
|
+
rowEndIndex: req.rowStartIndex + prevSize + size,
|
|
254
|
+
};
|
|
255
|
+
}
|
|
256
|
+
requestsForView(start, end) {
|
|
257
|
+
const bounds = this.#rowViewBounds;
|
|
258
|
+
start = start ?? bounds[0];
|
|
259
|
+
end = end ?? bounds[1];
|
|
260
|
+
const seen = new Set();
|
|
261
|
+
const requests = [];
|
|
262
|
+
for (let i = start; i < end; i++) {
|
|
263
|
+
const ranges = this.flat.rangeTree.findRangesForRowIndex(i);
|
|
264
|
+
ranges.forEach((c) => {
|
|
265
|
+
if (c.parent.kind === "root") {
|
|
266
|
+
const blockIndex = Math.floor(i / this.#blocksize);
|
|
267
|
+
const start = blockIndex * this.#blocksize;
|
|
268
|
+
const end = Math.min(start + this.#blocksize, c.parent.size);
|
|
269
|
+
const path = [];
|
|
270
|
+
const reqId = getRequestId(path, start, start + this.#blocksize);
|
|
271
|
+
if (seen.has(reqId))
|
|
272
|
+
return;
|
|
273
|
+
seen.add(reqId);
|
|
274
|
+
const size = start + this.#blocksize > c.parent.size ? c.parent.size - start : this.#blocksize;
|
|
275
|
+
requests.push({ id: reqId, path, start, end, rowStartIndex: i, rowEndIndex: i + size });
|
|
276
|
+
}
|
|
277
|
+
else {
|
|
278
|
+
const blockIndex = Math.floor((i - c.rowStart) / this.#blocksize);
|
|
279
|
+
const start = blockIndex * this.#blocksize;
|
|
280
|
+
const end = Math.min(start + this.#blocksize, c.parent.size);
|
|
281
|
+
const path = getNodePath(c.parent);
|
|
282
|
+
const reqId = getRequestId(path, start, start + this.#blocksize);
|
|
283
|
+
if (seen.has(reqId))
|
|
284
|
+
return;
|
|
285
|
+
seen.add(reqId);
|
|
286
|
+
const size = start + this.#blocksize > c.parent.size ? c.parent.size - start : this.#blocksize;
|
|
287
|
+
requests.push({ id: reqId, path, start, end, rowStartIndex: i, rowEndIndex: i + size });
|
|
288
|
+
}
|
|
289
|
+
});
|
|
290
|
+
}
|
|
291
|
+
return requests;
|
|
292
|
+
}
|
|
293
|
+
async handleViewBoundsChange() {
|
|
294
|
+
const requests = this.requestsForView();
|
|
295
|
+
const newRequests = requests.filter((c) => !this.#seenRequests.has(c.id));
|
|
296
|
+
// We don't have any new requests to make in our view, so we can return
|
|
297
|
+
if (!newRequests.length)
|
|
298
|
+
return;
|
|
299
|
+
for (const n of newRequests)
|
|
300
|
+
this.#seenRequests.add(n.id);
|
|
301
|
+
await this.handleRequests(newRequests);
|
|
302
|
+
}
|
|
303
|
+
retry() {
|
|
304
|
+
const inViewSet = new Set(this.requestsForView().map((c) => c.id));
|
|
305
|
+
const erroredRequests = [...this.#rowsWithError.values()]
|
|
306
|
+
.map((c) => c.request)
|
|
307
|
+
.filter(Boolean);
|
|
308
|
+
const erroredGroups = [...this.#rowsWithGroupError.entries()];
|
|
309
|
+
const errors = erroredRequests.filter((x) => inViewSet.has(x.id));
|
|
310
|
+
const [start, end] = this.#rowViewBounds;
|
|
311
|
+
const groupErrors = erroredGroups
|
|
312
|
+
.filter(([index]) => {
|
|
313
|
+
return index >= start && index < end;
|
|
314
|
+
})
|
|
315
|
+
.map(([index, c]) => [index, c.request]);
|
|
316
|
+
const seenRequests = this.#seenRequests;
|
|
317
|
+
erroredRequests.map((x) => seenRequests.delete(x.id));
|
|
318
|
+
erroredGroups.map((x) => seenRequests.delete(x[1].request.id));
|
|
319
|
+
this.#rowsWithError.clear();
|
|
320
|
+
this.#rowsWithGroupError.clear();
|
|
321
|
+
const requests = [];
|
|
322
|
+
const seen = new Set();
|
|
323
|
+
groupErrors.forEach((x) => {
|
|
324
|
+
if (seen.has(x[1].id))
|
|
325
|
+
return;
|
|
326
|
+
requests.push(x[1]);
|
|
327
|
+
seen.add(x[1].id);
|
|
328
|
+
});
|
|
329
|
+
errors.forEach((x) => {
|
|
330
|
+
if (seen.has(x.id))
|
|
331
|
+
return;
|
|
332
|
+
seen.add(x.id);
|
|
333
|
+
requests.push(x);
|
|
334
|
+
});
|
|
335
|
+
for (const x of groupErrors) {
|
|
336
|
+
this.#loadingGroup.add(x[0]);
|
|
337
|
+
}
|
|
338
|
+
requests.forEach((x) => seenRequests.add(x.id));
|
|
339
|
+
const invalidate = this.#onInvalidate;
|
|
340
|
+
const withGroupError = this.#rowsWithGroupError;
|
|
341
|
+
const loadingGroup = this.#loadingGroup;
|
|
342
|
+
this.handleRequests(requests, {
|
|
343
|
+
onError: (e) => {
|
|
344
|
+
invalidate();
|
|
345
|
+
groupErrors.forEach((c) => {
|
|
346
|
+
withGroupError.set(c[0], { error: e, request: c[1] });
|
|
347
|
+
loadingGroup.delete(c[0]);
|
|
348
|
+
});
|
|
349
|
+
},
|
|
350
|
+
onSuccess: () => {
|
|
351
|
+
groupErrors.forEach((c) => {
|
|
352
|
+
loadingGroup.delete(c[0]);
|
|
353
|
+
});
|
|
354
|
+
},
|
|
355
|
+
});
|
|
356
|
+
}
|
|
357
|
+
addBefore(leafs) {
|
|
358
|
+
this.tree.addBefore(leafs);
|
|
359
|
+
}
|
|
360
|
+
addAfter(leafs) {
|
|
361
|
+
this.tree.addAfter(leafs);
|
|
362
|
+
}
|
|
363
|
+
deleteBefore(leafs) {
|
|
364
|
+
this.tree.deleteBefore(leafs);
|
|
365
|
+
}
|
|
366
|
+
deleteAfter(leafs) {
|
|
367
|
+
this.tree.deleteAfter(leafs);
|
|
368
|
+
}
|
|
369
|
+
updateRow(id, data, asOf) {
|
|
370
|
+
const centerRow = this.tree.rowIdToNode.get(id);
|
|
371
|
+
if (centerRow) {
|
|
372
|
+
if (asOf && centerRow.asOf > asOf)
|
|
373
|
+
return;
|
|
374
|
+
centerRow.row = { ...centerRow.row, data };
|
|
375
|
+
return;
|
|
376
|
+
}
|
|
377
|
+
// Maybe its a pinned row?
|
|
378
|
+
const topIndex = this.#top.rows.findIndex((c) => c.id === id);
|
|
379
|
+
if (topIndex != -1) {
|
|
380
|
+
if (asOf && this.#top.asOf > asOf)
|
|
381
|
+
return;
|
|
382
|
+
this.#top.rows[topIndex] = { ...this.#top.rows[topIndex], data };
|
|
383
|
+
}
|
|
384
|
+
const botIndex = this.#bottom.rows.findIndex((c) => c.id === id);
|
|
385
|
+
if (botIndex != -1) {
|
|
386
|
+
if (asOf && this.#bottom.asOf > asOf)
|
|
387
|
+
return;
|
|
388
|
+
this.#top.rows[botIndex] = { ...this.#top.rows[botIndex], data };
|
|
389
|
+
}
|
|
390
|
+
}
|
|
391
|
+
flatten = () => {
|
|
392
|
+
this.#flatten();
|
|
393
|
+
};
|
|
394
|
+
#flatten = (beforeOnFlat) => {
|
|
395
|
+
// The mode we are in determines the expansions we will use for the server data.
|
|
396
|
+
const expansions = this.#expansions;
|
|
397
|
+
const t = this.tree;
|
|
398
|
+
// We use these maps to keep track of the current view. These are helpful for
|
|
399
|
+
// quick lookup. They are also used to implement many of the data source APIs.
|
|
400
|
+
const rowIdToRow = new Map();
|
|
401
|
+
const rowIndexToRow = new Map();
|
|
402
|
+
const rowIdToRowIndex = new Map();
|
|
403
|
+
const rowIdToTreeNode = new Map();
|
|
404
|
+
// When flattening the tree we need to keep track of the ranges. The tree itself
|
|
405
|
+
// will only have some rows loaded, but the ranges will be fully defined.
|
|
406
|
+
const ranges = [];
|
|
407
|
+
const blocksize = this.#blocksize;
|
|
408
|
+
const seen = this.#seenRequests;
|
|
409
|
+
// Tracks the error and loading state of the rows.
|
|
410
|
+
const withGroupError = this.#rowsWithGroupError;
|
|
411
|
+
const withLoadingGroup = this.#loadingGroup;
|
|
412
|
+
const handleRequests = this.handleRequests;
|
|
413
|
+
const defaultExpansion = this.#defaultExpansion;
|
|
414
|
+
const postFlatRequests = [];
|
|
415
|
+
let hasGroups = false;
|
|
416
|
+
function processParent(node, start) {
|
|
417
|
+
const rows = [...node.byIndex.values()].sort((l, r) => l.relIndex - r.relIndex);
|
|
418
|
+
let offset = 0;
|
|
419
|
+
let deleted = 0;
|
|
420
|
+
if (node.kind === "root") {
|
|
421
|
+
if (node.before.length) {
|
|
422
|
+
for (const n of node.before) {
|
|
423
|
+
const rowIndex = offset;
|
|
424
|
+
offset++;
|
|
425
|
+
rowIndexToRow.set(rowIndex, n.row);
|
|
426
|
+
rowIdToRowIndex.set(n.row.id, rowIndex);
|
|
427
|
+
rowIdToRow.set(n.row.id, n.row);
|
|
428
|
+
rowIdToTreeNode.set(n.row.id, n);
|
|
429
|
+
}
|
|
430
|
+
}
|
|
431
|
+
}
|
|
432
|
+
for (let i = 0; i < rows.length; i++) {
|
|
433
|
+
const node = rows[i];
|
|
434
|
+
if (node.deleted) {
|
|
435
|
+
deleted++;
|
|
436
|
+
continue;
|
|
437
|
+
}
|
|
438
|
+
const rowIndex = node.relIndex + start + offset - deleted;
|
|
439
|
+
rowIndexToRow.set(rowIndex, node.row);
|
|
440
|
+
rowIdToRowIndex.set(node.row.id, rowIndex);
|
|
441
|
+
rowIdToRow.set(node.row.id, node.row);
|
|
442
|
+
rowIdToTreeNode.set(node.row.id, node);
|
|
443
|
+
// If this rows is a parent row, we need to check if it is expanded. There are a couple of
|
|
444
|
+
// situations this to consider.
|
|
445
|
+
// - the row is not expanded, in which case we only add the row itself to the flat view
|
|
446
|
+
// - the row is expanded but it has no data loaded. We should then request data, but not add the rows
|
|
447
|
+
// - the row is expanded and there is add. This is the easy case, we simply add the child rows as we flatten
|
|
448
|
+
if (node.kind === "parent") {
|
|
449
|
+
hasGroups = true;
|
|
450
|
+
const expanded = expansions[node.row.id] ??
|
|
451
|
+
(typeof defaultExpansion === "number"
|
|
452
|
+
? getNodeDepth(node) <= defaultExpansion
|
|
453
|
+
: defaultExpansion);
|
|
454
|
+
if (expanded) {
|
|
455
|
+
node.row.expanded = true;
|
|
456
|
+
}
|
|
457
|
+
else {
|
|
458
|
+
node.row.expanded = false;
|
|
459
|
+
}
|
|
460
|
+
// Expanded but no data. Fetch the child data.
|
|
461
|
+
if (expanded && !node.byIndex.size) {
|
|
462
|
+
const path = getNodePath(node);
|
|
463
|
+
const start = 0;
|
|
464
|
+
const end = Math.min(start + blocksize, node.size);
|
|
465
|
+
const reqSize = end - start;
|
|
466
|
+
const req = {
|
|
467
|
+
path,
|
|
468
|
+
start: start,
|
|
469
|
+
end: end,
|
|
470
|
+
id: getRequestId(path, 0, blocksize),
|
|
471
|
+
rowStartIndex: rowIndex + 1,
|
|
472
|
+
rowEndIndex: rowIndex + 1 + reqSize,
|
|
473
|
+
};
|
|
474
|
+
// If we haven't already requested the children data for this node, let's request it.
|
|
475
|
+
if (!seen.has(req.id)) {
|
|
476
|
+
postFlatRequests.push([rowIndex, req]);
|
|
477
|
+
}
|
|
478
|
+
}
|
|
479
|
+
else if (expanded) {
|
|
480
|
+
offset += processParent(node, rowIndex + 1);
|
|
481
|
+
}
|
|
482
|
+
}
|
|
483
|
+
}
|
|
484
|
+
ranges.push({
|
|
485
|
+
rowStart: start,
|
|
486
|
+
rowEnd: offset + node.size + start - deleted,
|
|
487
|
+
parent: node,
|
|
488
|
+
});
|
|
489
|
+
return offset + node.size - deleted;
|
|
490
|
+
}
|
|
491
|
+
const topCount = this.#top.rows.length;
|
|
492
|
+
const bottomCount = this.#bottom.rows.length;
|
|
493
|
+
for (let i = 0; i < topCount; i++) {
|
|
494
|
+
const row = this.#top.rows[i];
|
|
495
|
+
rowIndexToRow.set(i, row);
|
|
496
|
+
rowIdToRow.set(row.id, row);
|
|
497
|
+
rowIdToRowIndex.set(row.id, i);
|
|
498
|
+
}
|
|
499
|
+
const size = processParent(t, topCount);
|
|
500
|
+
for (let i = 0; i < bottomCount; i++) {
|
|
501
|
+
const row = this.#bottom.rows[i];
|
|
502
|
+
const rowIndex = i + size;
|
|
503
|
+
rowIndexToRow.set(rowIndex, row);
|
|
504
|
+
rowIdToRow.set(row.id, row);
|
|
505
|
+
rowIdToRowIndex.set(row.id, rowIndex);
|
|
506
|
+
}
|
|
507
|
+
const rangeTree = new RangeTree(ranges);
|
|
508
|
+
if (postFlatRequests.length > 0) {
|
|
509
|
+
postFlatRequests.forEach((c) => {
|
|
510
|
+
withLoadingGroup.add(c[0]);
|
|
511
|
+
seen.add(c[1].id);
|
|
512
|
+
});
|
|
513
|
+
const invalidate = this.#onInvalidate;
|
|
514
|
+
const reqs = postFlatRequests.map((c) => c[1]);
|
|
515
|
+
handleRequests(reqs, {
|
|
516
|
+
skipState: true,
|
|
517
|
+
onError: (e) => {
|
|
518
|
+
invalidate();
|
|
519
|
+
postFlatRequests.forEach((c) => {
|
|
520
|
+
const rowIndex = c[0];
|
|
521
|
+
const req = c[1];
|
|
522
|
+
withLoadingGroup.delete(rowIndex);
|
|
523
|
+
withGroupError.set(rowIndex, { error: e, request: req });
|
|
524
|
+
});
|
|
525
|
+
},
|
|
526
|
+
onSuccess: () => {
|
|
527
|
+
postFlatRequests.forEach((c) => {
|
|
528
|
+
withLoadingGroup.delete(c[0]);
|
|
529
|
+
});
|
|
530
|
+
},
|
|
531
|
+
});
|
|
532
|
+
}
|
|
533
|
+
this.flat = {
|
|
534
|
+
tree: t,
|
|
535
|
+
top: topCount,
|
|
536
|
+
center: size - topCount,
|
|
537
|
+
bottom: bottomCount,
|
|
538
|
+
rangeTree,
|
|
539
|
+
rowIndexToRow,
|
|
540
|
+
rowIdToRow,
|
|
541
|
+
rowIdToRowIndex,
|
|
542
|
+
rowIdToTreeNode,
|
|
543
|
+
errored: this.#rowsWithError,
|
|
544
|
+
erroredGroup: this.#rowsWithGroupError,
|
|
545
|
+
loading: this.#loadingRows,
|
|
546
|
+
loadingGroup: this.#loadingGroup,
|
|
547
|
+
maxDepth: hasGroups ? 1 : 0,
|
|
548
|
+
seenRequests: seen,
|
|
549
|
+
};
|
|
550
|
+
beforeOnFlat?.();
|
|
551
|
+
this.#onFlatten(this.flat);
|
|
552
|
+
};
|
|
553
|
+
}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { type Signal } from "@1771technologies/lytenyte-core/internal";
|
|
2
|
+
import type { ServerData } from "../server-data";
|
|
3
|
+
import { type UseServerDataSourceParams } from "../use-server-data-source.js";
|
|
4
|
+
export declare function useOnRowsUpdated<T>(source: ServerData, onRowDataChange: UseServerDataSourceParams<any, unknown[]>["onRowDataChange"], optimistic: UseServerDataSourceParams<any, unknown[]>["rowUpdateOptimistically"], globalSignal: Signal<number>): (rows: Map<import("@1771technologies/lytenyte-shared").RowNode<T>, T>) => void;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { useEvent } from "@1771technologies/lytenyte-core/internal";
|
|
2
|
+
import {} from "../use-server-data-source.js";
|
|
3
|
+
export function useOnRowsUpdated(source, onRowDataChange, optimistic, globalSignal) {
|
|
4
|
+
const onRowsUpdated = useEvent((updates) => {
|
|
5
|
+
if (!onRowDataChange)
|
|
6
|
+
return;
|
|
7
|
+
if (!optimistic) {
|
|
8
|
+
onRowDataChange?.({ rows: updates });
|
|
9
|
+
return;
|
|
10
|
+
}
|
|
11
|
+
const rollbackMap = new Map();
|
|
12
|
+
updates.forEach((d, row) => {
|
|
13
|
+
const node = source.tree.rowIdToNode.get(row.id);
|
|
14
|
+
if (node) {
|
|
15
|
+
rollbackMap.set(row.id, { data: node.row.data, asOf: node.asOf });
|
|
16
|
+
}
|
|
17
|
+
source.updateRow(row.id, d);
|
|
18
|
+
});
|
|
19
|
+
source.flatten();
|
|
20
|
+
onRowDataChange({ rows: updates }).catch(() => {
|
|
21
|
+
rollbackMap.forEach((d, id) => {
|
|
22
|
+
source.updateRow(id, d.data, d.asOf);
|
|
23
|
+
});
|
|
24
|
+
source.flatten();
|
|
25
|
+
});
|
|
26
|
+
globalSignal(Date.now());
|
|
27
|
+
});
|
|
28
|
+
return onRowsUpdated;
|
|
29
|
+
}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import type { ServerData } from "../server-data";
|
|
2
|
+
import type { DataRequest } from "../types";
|
|
3
|
+
export declare function useOnViewChange<T>(source: ServerData, requestsForView: DataRequest[], setRequestsForView: (v: DataRequest[]) => void): (view: import("@1771technologies/lytenyte-shared").SpanLayout) => void;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { useEvent } from "@1771technologies/lytenyte-core/internal";
|
|
2
|
+
import { equal } from "@1771technologies/lytenyte-shared";
|
|
3
|
+
export function useOnViewChange(source, requestsForView, setRequestsForView) {
|
|
4
|
+
const onViewChange = useEvent((bounds) => {
|
|
5
|
+
// This will result in the server sending the requests for the current view.
|
|
6
|
+
source.rowViewBounds = [bounds.rowCenterStart, bounds.rowCenterEnd];
|
|
7
|
+
const requests = source.requestsForView();
|
|
8
|
+
if (equal(requests, requestsForView))
|
|
9
|
+
return;
|
|
10
|
+
setRequestsForView(requests);
|
|
11
|
+
});
|
|
12
|
+
return onViewChange;
|
|
13
|
+
}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import type { ServerData } from "../server-data";
|
|
2
|
+
import type { UseServerDataSourceParams } from "../use-server-data-source";
|
|
3
|
+
export declare function useRowAdd<T>(source: ServerData, onRowAdd: UseServerDataSourceParams<any, unknown[]>["onRowsAdded"], optimistic?: boolean): (rows: import("@1771technologies/lytenyte-shared").RowLeaf<T>[], placement?: "start" | "end") => void;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { useEvent } from "@1771technologies/lytenyte-core/internal";
|
|
2
|
+
import { ROOT_LEAF_PREFIX } from "../async-tree/+constants.async-tree.js";
|
|
3
|
+
export function useRowAdd(source, onRowAdd, optimistic = false) {
|
|
4
|
+
const rowAdd = useEvent((rows, placement = "start") => {
|
|
5
|
+
if (!onRowAdd || !rows.length)
|
|
6
|
+
return;
|
|
7
|
+
if (!optimistic) {
|
|
8
|
+
onRowAdd({ rows, placement });
|
|
9
|
+
return;
|
|
10
|
+
}
|
|
11
|
+
const toNodes = rows.map((x) => {
|
|
12
|
+
return {
|
|
13
|
+
asOf: Date.now(),
|
|
14
|
+
kind: "leaf",
|
|
15
|
+
parent: source.tree,
|
|
16
|
+
path: ROOT_LEAF_PREFIX,
|
|
17
|
+
relIndex: -1,
|
|
18
|
+
row: x,
|
|
19
|
+
optimistic: placement,
|
|
20
|
+
};
|
|
21
|
+
});
|
|
22
|
+
if (placement === "start")
|
|
23
|
+
source.addBefore(toNodes);
|
|
24
|
+
else
|
|
25
|
+
source.addAfter(toNodes);
|
|
26
|
+
source.flatten();
|
|
27
|
+
onRowAdd({ rows, placement }).catch(() => {
|
|
28
|
+
if (placement === "start")
|
|
29
|
+
source.deleteBefore(toNodes.map((x) => x.row.id));
|
|
30
|
+
else
|
|
31
|
+
source.deleteAfter(toNodes.map((x) => x.row.id));
|
|
32
|
+
source.flatten();
|
|
33
|
+
});
|
|
34
|
+
});
|
|
35
|
+
return rowAdd;
|
|
36
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { RowAtom, RowNode, RowSelectionStateWithParent } from "@1771technologies/lytenyte-shared";
|
|
2
|
+
import type { ServerData } from "../server-data.js";
|
|
3
|
+
import { type Signal } from "@1771technologies/lytenyte-core/internal";
|
|
4
|
+
export declare function useRowByIndex<T>(source: ServerData, state: {
|
|
5
|
+
rowSelections: RowSelectionStateWithParent;
|
|
6
|
+
}, globalSignal: Signal<number>, getParents: (id: string) => string[]): {
|
|
7
|
+
rowInvalidate: (row?: number) => void;
|
|
8
|
+
rowByIndex: (row: number) => RowAtom<RowNode<T> | null>;
|
|
9
|
+
};
|