@1771technologies/lytenyte-pro 1.0.0-beta.11 → 1.0.0-beta.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/+types.d.ts +4155 -3957
- package/dist/cell-selection/adjust-rect-for-row-and-cell-span.js +38 -38
- package/dist/cell-selection/are-rects-equal.js +6 -4
- package/dist/cell-selection/bound-selection-rect.js +14 -14
- package/dist/cell-selection/cell-selection-containers.js +108 -78
- package/dist/cell-selection/cell-selection-driver.js +250 -262
- package/dist/cell-selection/cell-style-row.d.ts +12 -6
- package/dist/cell-selection/cell-style-row.js +82 -79
- package/dist/cell-selection/deselect-rect-range.js +41 -40
- package/dist/cell-selection/expand-cell-selection-down.d.ts +5 -2
- package/dist/cell-selection/expand-cell-selection-down.js +29 -33
- package/dist/cell-selection/expand-cell-selection-end.d.ts +5 -2
- package/dist/cell-selection/expand-cell-selection-end.js +30 -34
- package/dist/cell-selection/expand-cell-selection-start.d.ts +5 -2
- package/dist/cell-selection/expand-cell-selection-start.js +29 -33
- package/dist/cell-selection/expand-cell-selection-up.d.ts +5 -2
- package/dist/cell-selection/expand-cell-selection-up.js +29 -33
- package/dist/cell-selection/full-width-start-end-index.js +3 -3
- package/dist/cell-selection/get-root-cell.d.ts +5 -1
- package/dist/cell-selection/get-root-cell.js +77 -79
- package/dist/cell-selection/is-bottom-rect.js +5 -5
- package/dist/cell-selection/is-center-col-rect.d.ts +5 -2
- package/dist/cell-selection/is-center-col-rect.js +5 -3
- package/dist/cell-selection/is-center-rect.js +3 -3
- package/dist/cell-selection/is-end-rect.d.ts +5 -2
- package/dist/cell-selection/is-end-rect.js +2 -2
- package/dist/cell-selection/is-overlapping-rect.js +6 -4
- package/dist/cell-selection/is-start-rect.d.ts +5 -2
- package/dist/cell-selection/is-start-rect.js +2 -2
- package/dist/cell-selection/is-top-rect.js +2 -2
- package/dist/cell-selection/is-within-selection-rect.js +1 -1
- package/dist/cell-selection/split-cell-selection-rect.d.ts +12 -6
- package/dist/cell-selection/split-cell-selection-rect.js +53 -47
- package/dist/cell-selection/update-additive-cell-selection.d.ts +5 -2
- package/dist/cell-selection/update-additive-cell-selection.js +18 -19
- package/dist/cell-selection/use-edge-scroll.d.ts +8 -6
- package/dist/cell-selection/use-edge-scroll.js +65 -63
- package/dist/cells/cell-default.d.ts +5 -1
- package/dist/cells/cell-default.js +5 -5
- package/dist/cells/cell-editor.d.ts +4 -2
- package/dist/cells/cell-editor.js +121 -86
- package/dist/cells/cell.d.ts +16 -3
- package/dist/cells/cell.js +56 -27
- package/dist/column-manager/branch-lookup-context.d.ts +3 -1
- package/dist/column-manager/branch.d.ts +12 -4
- package/dist/column-manager/branch.js +39 -29
- package/dist/column-manager/column-manager.d.ts +58 -9
- package/dist/column-manager/column-manager.js +9 -9
- package/dist/column-manager/context.d.ts +1 -1
- package/dist/column-manager/label.d.ts +10 -2
- package/dist/column-manager/label.js +11 -12
- package/dist/column-manager/leaf.d.ts +10 -2
- package/dist/column-manager/leaf.js +42 -32
- package/dist/column-manager/move-handle.d.ts +14 -6
- package/dist/column-manager/move-handle.js +54 -50
- package/dist/column-manager/root.d.ts +9 -3
- package/dist/column-manager/root.js +26 -13
- package/dist/column-manager/use-column-manager.d.ts +12 -12
- package/dist/column-manager/use-column-manager.js +20 -20
- package/dist/column-manager/use-columns-from-context.js +18 -18
- package/dist/column-manager/visibility-checkbox.d.ts +14 -6
- package/dist/column-manager/visibility-checkbox.js +36 -23
- package/dist/context.d.ts +4 -4
- package/dist/filter-tree/branch.d.ts +13 -5
- package/dist/filter-tree/branch.js +23 -13
- package/dist/filter-tree/context.d.ts +16 -16
- package/dist/filter-tree/filter-tree.d.ts +49 -8
- package/dist/filter-tree/filter-tree.js +8 -8
- package/dist/filter-tree/hooks/use-filter-tree.d.ts +35 -29
- package/dist/filter-tree/hooks/use-filter-tree.js +94 -92
- package/dist/filter-tree/hooks/use-tree-item.d.ts +4 -4
- package/dist/filter-tree/hooks/use-tree-item.js +99 -106
- package/dist/filter-tree/inclusion-checkbox.d.ts +14 -6
- package/dist/filter-tree/inclusion-checkbox.js +19 -9
- package/dist/filter-tree/label.d.ts +10 -2
- package/dist/filter-tree/label.js +11 -12
- package/dist/filter-tree/leaf.d.ts +10 -2
- package/dist/filter-tree/leaf.js +15 -5
- package/dist/filter-tree/root.d.ts +23 -7
- package/dist/filter-tree/root.js +51 -23
- package/dist/grid-box/+types.d.ts +9 -9
- package/dist/grid-box/context.d.ts +3 -3
- package/dist/grid-box/grid-box.d.ts +26 -6
- package/dist/grid-box/grid-box.js +6 -6
- package/dist/grid-box/item.d.ts +11 -3
- package/dist/grid-box/item.js +29 -26
- package/dist/grid-box/panel.d.ts +13 -1
- package/dist/grid-box/panel.js +9 -2
- package/dist/grid-box/root.d.ts +11 -5
- package/dist/grid-box/root.js +11 -2
- package/dist/grid-box/use-aggregation-box-items.d.ts +16 -13
- package/dist/grid-box/use-aggregation-box-items.js +54 -55
- package/dist/grid-box/use-column-box-items.d.ts +31 -21
- package/dist/grid-box/use-column-box-items.js +90 -78
- package/dist/grid-box/use-row-group-box-items.d.ts +17 -12
- package/dist/grid-box/use-row-group-box-items.js +116 -124
- package/dist/grid-provider/context.d.ts +4 -2
- package/dist/grid-provider/provider.d.ts +4 -2
- package/dist/grid-provider/use-grid.d.ts +1 -1
- package/dist/grid.d.ts +150 -26
- package/dist/grid.js +38 -26
- package/dist/header/header-cell.d.ts +13 -5
- package/dist/header/header-cell.js +41 -15
- package/dist/header/header-group-cell.d.ts +10 -2
- package/dist/header/header-group-cell.js +21 -6
- package/dist/header/header-row.d.ts +10 -2
- package/dist/header/header-row.js +2 -2
- package/dist/header/header.d.ts +10 -1
- package/dist/header/header.js +11 -2
- package/dist/header/resize-handler.d.ts +15 -6
- package/dist/header/resize-handler.js +128 -118
- package/dist/header/use-drag-move.d.ts +22 -11
- package/dist/header/use-drag-move.js +83 -87
- package/dist/header/use-header-cell-renderer.d.ts +9 -2
- package/dist/header/use-header-cell-renderer.js +24 -29
- package/dist/icons/index.d.ts +92 -1
- package/dist/icons/index.js +92 -1
- package/dist/license.js +174 -174
- package/dist/listbox/context.d.ts +2 -2
- package/dist/listbox/item.d.ts +10 -1
- package/dist/listbox/item.js +23 -19
- package/dist/listbox/panel.d.ts +10 -1
- package/dist/listbox/panel.js +69 -43
- package/dist/listbox/root.d.ts +5 -3
- package/dist/listbox/root.js +7 -7
- package/dist/root/dialog-driver.js +22 -16
- package/dist/root/popover-driver.js +27 -16
- package/dist/root/root.d.ts +7 -3
- package/dist/root/root.js +111 -107
- package/dist/row-data-source-client/+types.d.ts +17 -17
- package/dist/row-data-source-client/built-ins/avg.js +3 -4
- package/dist/row-data-source-client/built-ins/built-ins.d.ts +16 -16
- package/dist/row-data-source-client/built-ins/built-ins.js +16 -16
- package/dist/row-data-source-client/built-ins/count.js +3 -5
- package/dist/row-data-source-client/built-ins/first.js +1 -1
- package/dist/row-data-source-client/built-ins/group.js +1 -1
- package/dist/row-data-source-client/built-ins/last.js +1 -1
- package/dist/row-data-source-client/built-ins/max.js +9 -13
- package/dist/row-data-source-client/built-ins/min.js +9 -13
- package/dist/row-data-source-client/built-ins/sum.js +8 -10
- package/dist/row-data-source-client/filter/+types.d.ts +35 -13
- package/dist/row-data-source-client/filter/compute-filtered-rows.d.ts +16 -2
- package/dist/row-data-source-client/filter/compute-filtered-rows.js +102 -102
- package/dist/row-data-source-client/pivots/create-agg-model.d.ts +8 -4
- package/dist/row-data-source-client/pivots/create-agg-model.js +8 -9
- package/dist/row-data-source-client/pivots/create-pivot-columns-from-paths.d.ts +6 -1
- package/dist/row-data-source-client/pivots/create-pivot-columns-from-paths.js +42 -46
- package/dist/row-data-source-client/pivots/create-pivot-columns.d.ts +6 -1
- package/dist/row-data-source-client/pivots/create-pivot-columns.js +16 -17
- package/dist/row-data-source-client/pivots/create-pivot-tree.d.ts +7 -1
- package/dist/row-data-source-client/pivots/create-pivot-tree.js +19 -19
- package/dist/row-data-source-client/tree/client-tree.d.ts +19 -13
- package/dist/row-data-source-client/tree/client-tree.js +64 -67
- package/dist/row-data-source-client/tree/evaluator-aggregation.d.ts +4 -1
- package/dist/row-data-source-client/tree/evaluator-aggregation.js +6 -6
- package/dist/row-data-source-client/tree/evaluator-group.d.ts +4 -1
- package/dist/row-data-source-client/tree/evaluator-group.js +6 -7
- package/dist/row-data-source-client/tree/traverse.d.ts +5 -1
- package/dist/row-data-source-client/tree/traverse.js +15 -18
- package/dist/row-data-source-client/use-client-data-source-paginated.d.ts +9 -5
- package/dist/row-data-source-client/use-client-data-source-paginated.js +539 -522
- package/dist/row-data-source-client/use-client-data-source.d.ts +9 -5
- package/dist/row-data-source-client/use-client-data-source.js +682 -647
- package/dist/row-data-source-client/use-client-tree-data-source.d.ts +9 -5
- package/dist/row-data-source-client/use-client-tree-data-source.js +510 -499
- package/dist/row-data-source-server/async-tree/+types.async-tree.d.ts +36 -33
- package/dist/row-data-source-server/async-tree/apply-delete-action-to-tree.d.ts +4 -1
- package/dist/row-data-source-server/async-tree/apply-delete-action-to-tree.js +18 -22
- package/dist/row-data-source-server/async-tree/apply-set-action-to-tree.d.ts +4 -1
- package/dist/row-data-source-server/async-tree/apply-set-action-to-tree.js +17 -25
- package/dist/row-data-source-server/async-tree/check-set-action-item-keys-are-unique.js +18 -18
- package/dist/row-data-source-server/async-tree/check-set-action-item-keys-are-valid.js +9 -10
- package/dist/row-data-source-server/async-tree/check-set-action-item-keys-fit.d.ts +4 -1
- package/dist/row-data-source-server/async-tree/check-set-action-item-keys-fit.js +13 -14
- package/dist/row-data-source-server/async-tree/check-set-action-item-kinds.js +9 -10
- package/dist/row-data-source-server/async-tree/get-parent-node-by-path.d.ts +4 -1
- package/dist/row-data-source-server/async-tree/get-parent-node-by-path.js +13 -13
- package/dist/row-data-source-server/async-tree/is-set-action-a-no-op-on-node.d.ts +4 -1
- package/dist/row-data-source-server/async-tree/is-set-action-a-no-op-on-node.js +1 -1
- package/dist/row-data-source-server/async-tree/make-async-tree.js +14 -14
- package/dist/row-data-source-server/async-tree/maybe-apply-parent-remove-self.d.ts +3 -1
- package/dist/row-data-source-server/async-tree/maybe-apply-parent-remove-self.js +6 -6
- package/dist/row-data-source-server/async-tree/maybe-apply-resize.d.ts +5 -1
- package/dist/row-data-source-server/async-tree/maybe-apply-resize.js +11 -14
- package/dist/row-data-source-server/async-tree/maybe-apply-set-action-items.d.ts +4 -1
- package/dist/row-data-source-server/async-tree/maybe-apply-set-action-items.js +42 -46
- package/dist/row-data-source-server/range-tree/range-tree.d.ts +28 -28
- package/dist/row-data-source-server/range-tree/range-tree.js +49 -48
- package/dist/row-data-source-server/use-server-data-source.d.ts +11 -2
- package/dist/row-data-source-server/use-server-data-source.js +665 -652
- package/dist/row-data-source-server/utils/get-node-depth.js +7 -7
- package/dist/row-data-source-server/utils/get-node-path.js +7 -7
- package/dist/row-data-source-server/utils/get-request-id.js +3 -4
- package/dist/rows/row/context.d.ts +2 -2
- package/dist/rows/row/row.d.ts +16 -3
- package/dist/rows/row/row.js +19 -4
- package/dist/rows/row/use-row-context-value.d.ts +5 -2
- package/dist/rows/row/use-row-context-value.js +23 -26
- package/dist/rows/row-detail-row.d.ts +4 -2
- package/dist/rows/row-detail-row.js +147 -124
- package/dist/rows/row-full-width.d.ts +12 -4
- package/dist/rows/row-full-width.js +35 -7
- package/dist/rows/rows-container.d.ts +10 -1
- package/dist/rows/rows-container.js +12 -3
- package/dist/rows/rows-sections.d.ts +30 -3
- package/dist/rows/rows-sections.js +42 -10
- package/dist/rows/scrollers/native-scroller.d.ts +3 -1
- package/dist/rows/scrollers/native-scroller.js +17 -13
- package/dist/sort-manager/+types.d.ts +14 -7
- package/dist/sort-manager/context.d.ts +4 -4
- package/dist/sort-manager/hooks/use-sort-manager.d.ts +9 -9
- package/dist/sort-manager/hooks/use-sort-manager.js +45 -49
- package/dist/sort-manager/hooks/use-sort-row-item.d.ts +57 -46
- package/dist/sort-manager/hooks/use-sort-row-item.js +126 -131
- package/dist/sort-manager/hooks/use-sortable-column-items.d.ts +6 -3
- package/dist/sort-manager/hooks/use-sortable-column-items.js +10 -10
- package/dist/sort-manager/root.d.ts +7 -1
- package/dist/sort-manager/root.js +10 -10
- package/dist/sort-manager/sort-add.d.ts +13 -5
- package/dist/sort-manager/sort-add.js +8 -8
- package/dist/sort-manager/sort-apply.d.ts +12 -4
- package/dist/sort-manager/sort-apply.js +16 -16
- package/dist/sort-manager/sort-cancel.d.ts +12 -4
- package/dist/sort-manager/sort-cancel.js +19 -19
- package/dist/sort-manager/sort-clear.d.ts +12 -4
- package/dist/sort-manager/sort-clear.js +15 -16
- package/dist/sort-manager/sort-column-select.d.ts +14 -6
- package/dist/sort-manager/sort-column-select.js +26 -15
- package/dist/sort-manager/sort-direction-select.d.ts +14 -6
- package/dist/sort-manager/sort-direction-select.js +27 -19
- package/dist/sort-manager/sort-manager.d.ts +93 -12
- package/dist/sort-manager/sort-manager.js +12 -12
- package/dist/sort-manager/sort-remove.d.ts +12 -4
- package/dist/sort-manager/sort-remove.js +8 -8
- package/dist/sort-manager/sort-row.d.ts +10 -2
- package/dist/sort-manager/sort-row.js +4 -1
- package/dist/sort-manager/sort-rows.d.ts +10 -1
- package/dist/sort-manager/sort-rows.js +1 -1
- package/dist/sort-manager/sort-value-select.d.ts +15 -7
- package/dist/sort-manager/sort-value-select.js +28 -19
- package/dist/sort-manager/utils/sort-item-to-sort-model.d.ts +4 -1
- package/dist/sort-manager/utils/sort-item-to-sort-model.js +46 -49
- package/dist/sort-manager/utils/sort-model-to-sort-items.d.ts +4 -1
- package/dist/sort-manager/utils/sort-model-to-sort-items.js +36 -44
- package/dist/state/+types.d.ts +41 -28
- package/dist/state/api/column-autosize.d.ts +4 -2
- package/dist/state/api/column-autosize.js +62 -63
- package/dist/state/api/column-by-id.js +4 -4
- package/dist/state/api/column-field.js +17 -20
- package/dist/state/api/column-from-index.js +4 -4
- package/dist/state/api/column-group-toggle.js +8 -8
- package/dist/state/api/column-index.js +5 -5
- package/dist/state/api/column-move.js +48 -46
- package/dist/state/api/column-resize.js +9 -7
- package/dist/state/api/column-update.js +11 -11
- package/dist/state/api/dialog-frame.d.ts +8 -4
- package/dist/state/api/dialog-frame.js +11 -12
- package/dist/state/api/edit-begin.d.ts +4 -2
- package/dist/state/api/edit-begin.js +71 -84
- package/dist/state/api/edit-end.d.ts +4 -2
- package/dist/state/api/edit-end.js +38 -41
- package/dist/state/api/edit-is-cell-active.d.ts +4 -2
- package/dist/state/api/edit-is-cell-active.js +17 -24
- package/dist/state/api/edit-update.d.ts +4 -2
- package/dist/state/api/edit-update.js +74 -85
- package/dist/state/api/event-listeners.d.ts +12 -3
- package/dist/state/api/event-listeners.js +16 -17
- package/dist/state/api/export-csv.js +33 -35
- package/dist/state/api/export-data-rect.js +21 -21
- package/dist/state/api/focus-cell.d.ts +4 -2
- package/dist/state/api/focus-cell.js +110 -109
- package/dist/state/api/popover-frame.d.ts +8 -4
- package/dist/state/api/popover-frame.js +11 -12
- package/dist/state/api/position-from-element.js +5 -6
- package/dist/state/api/row-by-id.js +3 -3
- package/dist/state/api/row-by-index.js +11 -6
- package/dist/state/api/row-detail-is-expanded.d.ts +3 -1
- package/dist/state/api/row-detail-is-expanded.js +4 -4
- package/dist/state/api/row-detail-rendered-height.d.ts +4 -2
- package/dist/state/api/row-detail-rendered-height.js +10 -12
- package/dist/state/api/row-detail-toggle.js +26 -30
- package/dist/state/api/row-group-apply-expansions.d.ts +3 -1
- package/dist/state/api/row-group-apply-expansions.js +15 -17
- package/dist/state/api/row-group-column-index.d.ts +3 -1
- package/dist/state/api/row-group-column-index.js +14 -12
- package/dist/state/api/row-group-is-expanded.d.ts +3 -1
- package/dist/state/api/row-group-is-expanded.js +11 -13
- package/dist/state/api/row-group-toggle.js +5 -5
- package/dist/state/api/row-handle-select.d.ts +4 -2
- package/dist/state/api/row-handle-select.js +36 -40
- package/dist/state/api/row-select-all.js +14 -15
- package/dist/state/api/row-select.d.ts +4 -2
- package/dist/state/api/row-select.js +30 -33
- package/dist/state/api/row-selected.js +10 -11
- package/dist/state/api/scroll-into-view.d.ts +4 -2
- package/dist/state/api/scroll-into-view.js +47 -47
- package/dist/state/api/sort-for-column.js +6 -7
- package/dist/state/api/use-row-drag.js +22 -24
- package/dist/state/helpers/cell-row-group.d.ts +5 -1
- package/dist/state/helpers/cell-row-group.js +18 -16
- package/dist/state/helpers/column-add-row-group.d.ts +16 -6
- package/dist/state/helpers/column-add-row-group.js +63 -58
- package/dist/state/helpers/column-layout.d.ts +7 -1
- package/dist/state/helpers/column-layout.js +60 -60
- package/dist/state/helpers/column-marker.d.ts +8 -4
- package/dist/state/helpers/column-marker.js +38 -34
- package/dist/state/helpers/column-view.d.ts +21 -15
- package/dist/state/helpers/column-view.js +56 -32
- package/dist/state/helpers/edit-on-change.d.ts +18 -10
- package/dist/state/helpers/edit-on-change.js +24 -24
- package/dist/state/helpers/empty-row-data-source.js +16 -16
- package/dist/state/helpers/get-data-rect.d.ts +20 -10
- package/dist/state/helpers/get-data-rect.js +67 -62
- package/dist/state/helpers/get-full-width-callback.d.ts +5 -1
- package/dist/state/helpers/get-full-width-callback.js +5 -6
- package/dist/state/helpers/get-span-callback.d.ts +6 -1
- package/dist/state/helpers/get-span-callback.js +15 -18
- package/dist/state/helpers/resolve-column.d.ts +6 -2
- package/dist/state/helpers/resolve-column.js +18 -18
- package/dist/state/helpers/row-layout/get-focus-criteria.d.ts +15 -12
- package/dist/state/helpers/row-layout/get-focus-criteria.js +57 -56
- package/dist/state/helpers/row-layout/row-layout.d.ts +15 -9
- package/dist/state/helpers/row-layout/row-layout.js +387 -401
- package/dist/state/use-lytenyte.js +556 -516
- package/dist/tree-view/branch/branch.d.ts +16 -8
- package/dist/tree-view/branch/branch.js +104 -52
- package/dist/tree-view/branch/use-branch-keys.d.ts +5 -1
- package/dist/tree-view/branch/use-branch-keys.js +71 -74
- package/dist/tree-view/context.d.ts +21 -17
- package/dist/tree-view/hooks/use-tree-view-paths.d.ts +6 -1
- package/dist/tree-view/hooks/use-tree-view-paths.js +5 -5
- package/dist/tree-view/index.d.ts +35 -7
- package/dist/tree-view/index.js +7 -7
- package/dist/tree-view/leaf.d.ts +10 -2
- package/dist/tree-view/leaf.js +29 -20
- package/dist/tree-view/navigation/get-all-ids.js +3 -3
- package/dist/tree-view/navigation/get-first-node.js +3 -3
- package/dist/tree-view/navigation/get-last-node.js +3 -3
- package/dist/tree-view/navigation/get-next-node.js +6 -8
- package/dist/tree-view/navigation/get-prev-node.js +6 -8
- package/dist/tree-view/panel/make-handle-navigation.js +23 -31
- package/dist/tree-view/panel/make-handle-selection.js +68 -77
- package/dist/tree-view/panel/make-handle-typeahead.js +34 -40
- package/dist/tree-view/panel/panel.d.ts +10 -1
- package/dist/tree-view/panel/panel.js +40 -20
- package/dist/tree-view/panel/use-tree-navigation.js +64 -52
- package/dist/tree-view/root.d.ts +20 -14
- package/dist/tree-view/root.js +53 -55
- package/dist/tree-view/utils/get-focusable-nodes.js +4 -2
- package/dist/tree-view/utils/get-focused-node.js +11 -11
- package/dist/tree-view/utils/get-ids-between-nodes.d.ts +5 -1
- package/dist/tree-view/utils/get-ids-between-nodes.js +10 -11
- package/dist/tree-view/utils/get-panel.js +5 -5
- package/dist/tree-view/utils/get-parent-node.js +6 -7
- package/dist/tree-view/utils/get-sibling-branches.js +8 -10
- package/dist/tree-view/utils/get-tree-node-id.js +1 -1
- package/dist/tree-view/utils/is-branch-node.js +1 -1
- package/dist/tree-view/utils/is-leaf-node.js +1 -1
- package/dist/tree-view/utils/is-tree-node-disabled.js +1 -1
- package/dist/tree-view/utils/select-node.d.ts +5 -1
- package/dist/tree-view/utils/select-node.js +8 -11
- package/dist/tree-view/utils/toggle-all-selections.js +4 -6
- package/dist/tree-view/utils/toggle-selection.js +15 -18
- package/dist/tree-view/virtualized/force-sync-scrolling.d.ts +3 -1
- package/dist/tree-view/virtualized/force-sync-scrolling.js +24 -18
- package/dist/tree-view/virtualized/get-virtual-tree-paths.d.ts +3 -1
- package/dist/tree-view/virtualized/get-virtual-tree-paths.js +11 -12
- package/dist/tree-view/virtualized/make-virtual-tree.d.ts +26 -21
- package/dist/tree-view/virtualized/make-virtual-tree.js +79 -85
- package/dist/tree-view/virtualized/use-flattened-tree.d.ts +17 -8
- package/dist/tree-view/virtualized/use-flattened-tree.js +30 -31
- package/dist/tree-view/virtualized/use-row-start-and-end.d.ts +6 -1
- package/dist/tree-view/virtualized/use-row-start-and-end.js +21 -23
- package/dist/tree-view/virtualized/use-virtualized-tree.d.ts +21 -15
- package/dist/tree-view/virtualized/use-virtualized-tree.js +103 -90
- package/dist/utils/cycle-sorts.js +12 -14
- package/dist/viewport/begin-editing.d.ts +6 -2
- package/dist/viewport/begin-editing.js +9 -13
- package/dist/viewport/viewport.d.ts +10 -1
- package/dist/viewport/viewport.js +93 -70
- package/package.json +7 -7
|
@@ -1,90 +1,84 @@
|
|
|
1
1
|
export function makeVirtualTree(paths, nodeToIndex, itemHeight, nonAdjacentPathTrees) {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
}
|
|
45
|
-
else {
|
|
46
|
-
root.push(branchNode); // fallback
|
|
47
|
-
}
|
|
48
|
-
}
|
|
2
|
+
const root = [];
|
|
3
|
+
const lookup = new Map();
|
|
4
|
+
for (const [rawPath, node] of paths) {
|
|
5
|
+
const path = typeof rawPath === "string" ? [] : rawPath;
|
|
6
|
+
if (nonAdjacentPathTrees) path.pop();
|
|
7
|
+
const joinPath = path.join("#");
|
|
8
|
+
if (node.kind === "branch") {
|
|
9
|
+
const rowIndex = nodeToIndex.get(node);
|
|
10
|
+
const parentIndex = node.parent.kind === "root" ? 0 : nodeToIndex.get(node.parent);
|
|
11
|
+
const posinset = rowIndex - parentIndex + 1;
|
|
12
|
+
const setSize = node.parent.children.size;
|
|
13
|
+
const branchNode = {
|
|
14
|
+
kind: "branch",
|
|
15
|
+
path: joinPath,
|
|
16
|
+
branch: node,
|
|
17
|
+
children: [],
|
|
18
|
+
rowIndex,
|
|
19
|
+
attrs: {
|
|
20
|
+
style: {
|
|
21
|
+
position: "absolute",
|
|
22
|
+
height: itemHeight,
|
|
23
|
+
width: "100%",
|
|
24
|
+
boxSizing: "border-box",
|
|
25
|
+
top: 0,
|
|
26
|
+
left: 0,
|
|
27
|
+
transform: `translate3d(0px, ${(posinset - 1) * itemHeight}px, 0px)`,
|
|
28
|
+
},
|
|
29
|
+
"data-ln-row-index": rowIndex,
|
|
30
|
+
"aria-posinset": posinset,
|
|
31
|
+
"aria-setsize": setSize,
|
|
32
|
+
},
|
|
33
|
+
};
|
|
34
|
+
lookup.set(joinPath, branchNode);
|
|
35
|
+
if (path.length === 0) {
|
|
36
|
+
root.push(branchNode);
|
|
37
|
+
} else {
|
|
38
|
+
const parentPath = path.slice(0, -1).join("#");
|
|
39
|
+
const parent = lookup.get(parentPath);
|
|
40
|
+
if (parent) {
|
|
41
|
+
parent.children.push(branchNode);
|
|
42
|
+
} else {
|
|
43
|
+
root.push(branchNode); // fallback
|
|
49
44
|
}
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
root.push(leafNode); // fallback
|
|
85
|
-
}
|
|
86
|
-
}
|
|
45
|
+
}
|
|
46
|
+
} else {
|
|
47
|
+
const rowIndex = nodeToIndex.get(node);
|
|
48
|
+
const parentIndex = node.parent.kind === "root" ? 0 : nodeToIndex.get(node.parent);
|
|
49
|
+
const posinset = rowIndex - parentIndex + 1;
|
|
50
|
+
const setSize = node.parent.children.size;
|
|
51
|
+
const leafNode = {
|
|
52
|
+
kind: "leaf",
|
|
53
|
+
leaf: node,
|
|
54
|
+
rowIndex,
|
|
55
|
+
attrs: {
|
|
56
|
+
style: {
|
|
57
|
+
position: "absolute",
|
|
58
|
+
height: itemHeight,
|
|
59
|
+
boxSizing: "border-box",
|
|
60
|
+
width: "100%",
|
|
61
|
+
top: 0,
|
|
62
|
+
left: 0,
|
|
63
|
+
transform: `translate3d(0px, ${(posinset - 1) * itemHeight}px, 0px)`,
|
|
64
|
+
},
|
|
65
|
+
"data-ln-row-index": rowIndex,
|
|
66
|
+
"aria-posinset": posinset,
|
|
67
|
+
"aria-setsize": setSize,
|
|
68
|
+
},
|
|
69
|
+
};
|
|
70
|
+
if (path.length === 0) {
|
|
71
|
+
root.push(leafNode); // top-level leaf
|
|
72
|
+
} else {
|
|
73
|
+
const parentPath = path.join("#");
|
|
74
|
+
const parent = lookup.get(parentPath);
|
|
75
|
+
if (parent) {
|
|
76
|
+
parent.children.push(leafNode);
|
|
77
|
+
} else {
|
|
78
|
+
root.push(leafNode); // fallback
|
|
87
79
|
}
|
|
80
|
+
}
|
|
88
81
|
}
|
|
89
|
-
|
|
82
|
+
}
|
|
83
|
+
return root;
|
|
90
84
|
}
|
|
@@ -1,9 +1,18 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
1
|
+
import {
|
|
2
|
+
type PathBranch,
|
|
3
|
+
type PathLeaf,
|
|
4
|
+
type PathProvidedItem,
|
|
5
|
+
} from "@1771technologies/lytenyte-shared";
|
|
6
|
+
export declare function useFlattenedTree<T extends PathProvidedItem>(
|
|
7
|
+
paths: T[],
|
|
8
|
+
expansions: Record<string, boolean>,
|
|
9
|
+
expansionDefault: boolean,
|
|
10
|
+
nonAdjacentPathTrees?: boolean,
|
|
11
|
+
): {
|
|
12
|
+
flat: (PathBranch<T> | PathLeaf<T>)[];
|
|
13
|
+
nodeToIndex: Map<PathBranch<T> | PathLeaf<T>, number>;
|
|
14
|
+
indexToId: Map<number, string>;
|
|
15
|
+
allIds: Set<string>;
|
|
16
|
+
idToNode: Map<string, PathBranch<T> | PathLeaf<T>>;
|
|
17
|
+
root: import("@1771technologies/lytenyte-shared").PathRoot<T>;
|
|
9
18
|
};
|
|
@@ -1,36 +1,35 @@
|
|
|
1
|
-
import { computePathTree
|
|
1
|
+
import { computePathTree } from "@1771technologies/lytenyte-shared";
|
|
2
2
|
import { useMemo } from "react";
|
|
3
3
|
export function useFlattenedTree(paths, expansions, expansionDefault, nonAdjacentPathTrees) {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
stack.unshift(...children);
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
const id = item.kind === "branch" ? item.data.idOccurrence : item.data.id;
|
|
27
|
-
allIds.add(id);
|
|
28
|
-
indexToId.set(index, id);
|
|
29
|
-
nodeToIndex.set(item, index);
|
|
30
|
-
idToNode.set(id, item);
|
|
31
|
-
index++;
|
|
4
|
+
const { flat, nodeToIndex, indexToId, allIds, idToNode, root } = useMemo(() => {
|
|
5
|
+
const root = computePathTree(paths, undefined, nonAdjacentPathTrees);
|
|
6
|
+
const flat = [];
|
|
7
|
+
const nodeToIndex = new Map();
|
|
8
|
+
const stack = [...root.children.values()];
|
|
9
|
+
const allIds = new Set();
|
|
10
|
+
const indexToId = new Map();
|
|
11
|
+
const idToNode = new Map();
|
|
12
|
+
let index = 0;
|
|
13
|
+
while (stack.length) {
|
|
14
|
+
const item = stack.shift();
|
|
15
|
+
if (item.kind === "leaf") {
|
|
16
|
+
flat.push(item);
|
|
17
|
+
} else {
|
|
18
|
+
flat.push(item);
|
|
19
|
+
const isExpanded = expansions[item.id] ?? expansionDefault;
|
|
20
|
+
if (isExpanded) {
|
|
21
|
+
const children = [...item.children.values()];
|
|
22
|
+
stack.unshift(...children);
|
|
32
23
|
}
|
|
33
|
-
|
|
34
|
-
|
|
24
|
+
}
|
|
25
|
+
const id = item.kind === "branch" ? item.data.idOccurrence : item.data.id;
|
|
26
|
+
allIds.add(id);
|
|
27
|
+
indexToId.set(index, id);
|
|
28
|
+
nodeToIndex.set(item, index);
|
|
29
|
+
idToNode.set(id, item);
|
|
30
|
+
index++;
|
|
31
|
+
}
|
|
35
32
|
return { flat, nodeToIndex, indexToId, allIds, idToNode, root };
|
|
33
|
+
}, [expansionDefault, expansions, nonAdjacentPathTrees, paths]);
|
|
34
|
+
return { flat, nodeToIndex, indexToId, allIds, idToNode, root };
|
|
36
35
|
}
|
|
@@ -1,2 +1,7 @@
|
|
|
1
1
|
import type { RectReadOnly } from "@1771technologies/lytenyte-react-hooks";
|
|
2
|
-
export declare function useRowStartAndEnd(
|
|
2
|
+
export declare function useRowStartAndEnd(
|
|
3
|
+
panel: HTMLElement | null | undefined,
|
|
4
|
+
itemHeight: number,
|
|
5
|
+
bounds: RectReadOnly,
|
|
6
|
+
size: number,
|
|
7
|
+
): number[];
|
|
@@ -1,27 +1,25 @@
|
|
|
1
1
|
import { clamp } from "@1771technologies/lytenyte-js-utils";
|
|
2
2
|
import { useEffect, useMemo, useState } from "react";
|
|
3
3
|
export function useRowStartAndEnd(panel, itemHeight, bounds, size) {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
}, [itemHeight, panel]);
|
|
26
|
-
return [rowStart, rowEnd];
|
|
4
|
+
const [startOffset, setStartOffset] = useState(0);
|
|
5
|
+
const [rowStart, rowEnd] = useMemo(() => {
|
|
6
|
+
if (!panel) return [0, 0];
|
|
7
|
+
const start = startOffset;
|
|
8
|
+
const end = start + Math.ceil(bounds.height / itemHeight) + 1;
|
|
9
|
+
return [clamp(0, start - 3, size), clamp(0, end + 3, size)];
|
|
10
|
+
}, [bounds.height, itemHeight, panel, size, startOffset]);
|
|
11
|
+
useEffect(() => {
|
|
12
|
+
if (!panel) return;
|
|
13
|
+
const handleViewChange = () => {
|
|
14
|
+
const scrollTop = panel.scrollTop;
|
|
15
|
+
const start = Math.floor(scrollTop / itemHeight);
|
|
16
|
+
setStartOffset(start);
|
|
17
|
+
};
|
|
18
|
+
handleViewChange();
|
|
19
|
+
panel.addEventListener("scroll", handleViewChange);
|
|
20
|
+
return () => {
|
|
21
|
+
panel.removeEventListener("scroll", handleViewChange);
|
|
22
|
+
};
|
|
23
|
+
}, [itemHeight, panel]);
|
|
24
|
+
return [rowStart, rowEnd];
|
|
27
25
|
}
|
|
@@ -2,21 +2,27 @@ import { type PathProvidedItem, type PathRoot } from "@1771technologies/lytenyte
|
|
|
2
2
|
import { type JSX } from "react";
|
|
3
3
|
import { type TreeVirtualItem } from "./make-virtual-tree.js";
|
|
4
4
|
export interface VirtualizedTreeViewPathsArgs<T extends PathProvidedItem> {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
5
|
+
readonly itemHeight: number;
|
|
6
|
+
readonly expansions: Record<string, boolean>;
|
|
7
|
+
readonly expansionDefault?: boolean;
|
|
8
|
+
readonly paths: T[];
|
|
9
|
+
readonly nonAdjacentPathTrees?: boolean;
|
|
10
10
|
}
|
|
11
11
|
export interface TreeReturn<T extends PathProvidedItem> {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
12
|
+
readonly ref: (h: HTMLElement | null) => void;
|
|
13
|
+
readonly virtualTree: TreeVirtualItem<T>[];
|
|
14
|
+
readonly spacer: JSX.Element;
|
|
15
|
+
readonly rootProps: {
|
|
16
|
+
readonly getAllIds: () => Set<string>;
|
|
17
|
+
readonly getIdsBetweenNodes: (h: HTMLElement, r: HTMLElement) => string[];
|
|
18
|
+
readonly onFocusChange: (h: HTMLElement | null) => void;
|
|
19
|
+
readonly root: PathRoot<T>;
|
|
20
|
+
};
|
|
21
21
|
}
|
|
22
|
-
export declare function useVirtualizedTree<T extends PathProvidedItem>({
|
|
22
|
+
export declare function useVirtualizedTree<T extends PathProvidedItem>({
|
|
23
|
+
itemHeight,
|
|
24
|
+
expansions,
|
|
25
|
+
expansionDefault,
|
|
26
|
+
nonAdjacentPathTrees,
|
|
27
|
+
paths,
|
|
28
|
+
}: VirtualizedTreeViewPathsArgs<T>): TreeReturn<T>;
|
|
@@ -7,94 +7,107 @@ import { makeVirtualTree } from "./make-virtual-tree.js";
|
|
|
7
7
|
import { useFlattenedTree } from "./use-flattened-tree.js";
|
|
8
8
|
import { useRowStartAndEnd } from "./use-row-start-and-end.js";
|
|
9
9
|
import { getTreeNodeId } from "../utils/get-tree-node-id.js";
|
|
10
|
-
export function useVirtualizedTree({
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
const
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
}
|
|
10
|
+
export function useVirtualizedTree({
|
|
11
|
+
itemHeight,
|
|
12
|
+
expansions,
|
|
13
|
+
expansionDefault = false,
|
|
14
|
+
nonAdjacentPathTrees,
|
|
15
|
+
paths,
|
|
16
|
+
}) {
|
|
17
|
+
const [ref, bounds, _, panel] = useMeasure({ scroll: true });
|
|
18
|
+
const { flat, nodeToIndex, indexToId, allIds, idToNode, root } = useFlattenedTree(
|
|
19
|
+
paths,
|
|
20
|
+
expansions,
|
|
21
|
+
expansionDefault,
|
|
22
|
+
nonAdjacentPathTrees,
|
|
23
|
+
);
|
|
24
|
+
const size = useMemo(() => flat.length, [flat.length]);
|
|
25
|
+
const [rowStart, rowEnd] = useRowStartAndEnd(panel, itemHeight, bounds, size);
|
|
26
|
+
const [focused, setFocused] = useState(null);
|
|
27
|
+
const virtualTree = useMemo(() => {
|
|
28
|
+
const items = flat.slice(rowStart, rowEnd);
|
|
29
|
+
if (!items.length) return [];
|
|
30
|
+
// Ensure that the parent nodes of the current tree in view are added as well. This ensure that
|
|
31
|
+
// the nodes are always visible.
|
|
32
|
+
while (items[0].parent.kind !== "root") {
|
|
33
|
+
items.unshift(items[0].parent);
|
|
34
|
+
}
|
|
35
|
+
// Ensure that the first node is always in the list of tree nodes so the home key works fine.
|
|
36
|
+
if (rowStart !== 0 && items[0] !== flat[0]) items.unshift(flat[0]);
|
|
37
|
+
// Ensure the last node is always in the list of nodes present.
|
|
38
|
+
if (rowEnd !== flat.length) {
|
|
39
|
+
const endItems = [flat.at(-1)];
|
|
40
|
+
while (endItems[0].parent.kind !== "root" && endItems[0].parent !== items.at(-1)) {
|
|
41
|
+
endItems.unshift(endItems[0].parent);
|
|
42
|
+
}
|
|
43
|
+
items.push(...endItems);
|
|
44
|
+
}
|
|
45
|
+
// Finally we need to ensure the focused node is present. We add the node before and after
|
|
46
|
+
// the current node - so that the next and previous node are selectable.
|
|
47
|
+
if (focused && idToNode.has(focused)) {
|
|
48
|
+
const node = idToNode.get(focused);
|
|
49
|
+
const index = nodeToIndex.get(node);
|
|
50
|
+
const nextId = indexToId.get(index + 1);
|
|
51
|
+
const prevId = indexToId.get(index - 1);
|
|
52
|
+
const next = idToNode.get(nextId);
|
|
53
|
+
const prev = idToNode.get(prevId);
|
|
54
|
+
if (!items.includes(node)) {
|
|
55
|
+
const firstIndexGreater = items.findIndex((c) => nodeToIndex.get(c) > index);
|
|
56
|
+
items.splice(firstIndexGreater, 0, node);
|
|
57
|
+
}
|
|
58
|
+
if (next && !items.includes(next)) {
|
|
59
|
+
const firstIndexGreater = items.findIndex((c) => nodeToIndex.get(c) > index + 1);
|
|
60
|
+
items.splice(firstIndexGreater, 0, next);
|
|
61
|
+
}
|
|
62
|
+
if (prev && !items.includes(prev)) {
|
|
63
|
+
const firstIndexGreater = items.findIndex((c) => nodeToIndex.get(c) > index - 1);
|
|
64
|
+
items.splice(firstIndexGreater, 0, prev);
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
const subtreePaths = buildVirtualTreePartial(items);
|
|
68
|
+
const subtree = makeVirtualTree(
|
|
69
|
+
subtreePaths,
|
|
70
|
+
nodeToIndex,
|
|
71
|
+
itemHeight,
|
|
72
|
+
nonAdjacentPathTrees ?? false,
|
|
73
|
+
);
|
|
74
|
+
return subtree;
|
|
75
|
+
}, [
|
|
76
|
+
flat,
|
|
77
|
+
focused,
|
|
78
|
+
idToNode,
|
|
79
|
+
indexToId,
|
|
80
|
+
itemHeight,
|
|
81
|
+
nodeToIndex,
|
|
82
|
+
nonAdjacentPathTrees,
|
|
83
|
+
rowEnd,
|
|
84
|
+
rowStart,
|
|
85
|
+
]);
|
|
86
|
+
const spacer = _jsx("div", { style: { height: size * itemHeight, width: 0 } });
|
|
87
|
+
const onFocusChange = useEvent((el) => {
|
|
88
|
+
setFocused(el ? getTreeNodeId(el) : null);
|
|
89
|
+
});
|
|
90
|
+
const getAllIds = useEvent(() => allIds);
|
|
91
|
+
const getIdsBetweenNodes = useEvent((left, right) => {
|
|
92
|
+
const leftIndex = Number.parseInt(left.getAttribute("data-ln-row-index"));
|
|
93
|
+
const rightIndex = Number.parseInt(right.getAttribute("data-ln-row-index"));
|
|
94
|
+
const [start, end] = leftIndex < rightIndex ? [leftIndex, rightIndex] : [rightIndex, leftIndex];
|
|
95
|
+
if (start === end) return [indexToId.get(start)];
|
|
96
|
+
const ids = [];
|
|
97
|
+
for (let i = start; i <= end; i++) {
|
|
98
|
+
ids.push(indexToId.get(i));
|
|
99
|
+
}
|
|
100
|
+
return ids;
|
|
101
|
+
});
|
|
102
|
+
return {
|
|
103
|
+
ref,
|
|
104
|
+
virtualTree,
|
|
105
|
+
spacer,
|
|
106
|
+
rootProps: {
|
|
107
|
+
getAllIds,
|
|
108
|
+
getIdsBetweenNodes,
|
|
109
|
+
onFocusChange,
|
|
110
|
+
root,
|
|
111
|
+
},
|
|
112
|
+
};
|
|
100
113
|
}
|
|
@@ -1,16 +1,14 @@
|
|
|
1
1
|
export function cycleSorts(grid, column) {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
]);
|
|
15
|
-
}
|
|
2
|
+
const current = grid.api.sortForColumn(column.id);
|
|
3
|
+
if (current) {
|
|
4
|
+
if (current.sort.isDescending) grid.state.sortModel.set([]);
|
|
5
|
+
else
|
|
6
|
+
grid.state.sortModel.set([
|
|
7
|
+
{ columnId: column.id, sort: { kind: "string" }, isDescending: true },
|
|
8
|
+
]);
|
|
9
|
+
} else {
|
|
10
|
+
grid.state.sortModel.set([
|
|
11
|
+
{ columnId: column.id, sort: { kind: "string" }, isDescending: false },
|
|
12
|
+
]);
|
|
13
|
+
}
|
|
16
14
|
}
|
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
import type { Grid } from "../+types";
|
|
2
2
|
import type { InternalAtoms } from "../state/+types";
|
|
3
|
-
export declare function beginEditing<T>(
|
|
3
|
+
export declare function beginEditing<T>(
|
|
4
|
+
grid: Grid<T> & {
|
|
4
5
|
internal: InternalAtoms;
|
|
5
|
-
},
|
|
6
|
+
},
|
|
7
|
+
activator?: "single" | "double-click",
|
|
8
|
+
init?: any,
|
|
9
|
+
): void;
|