@1771technologies/lytenyte-pro 1.0.0-beta.1 → 1.0.0-beta.10
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 +4135 -3940
- package/dist/cell-selection/adjust-rect-for-row-and-cell-span.d.ts +1 -1
- package/dist/cell-selection/adjust-rect-for-row-and-cell-span.js +39 -39
- package/dist/cell-selection/are-rects-equal.d.ts +1 -1
- package/dist/cell-selection/are-rects-equal.js +6 -4
- package/dist/cell-selection/bound-selection-rect.d.ts +1 -1
- 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 -254
- 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.d.ts +1 -1
- package/dist/cell-selection/deselect-rect-range.js +42 -41
- package/dist/cell-selection/expand-cell-selection-down.d.ts +7 -4
- package/dist/cell-selection/expand-cell-selection-down.js +30 -34
- package/dist/cell-selection/expand-cell-selection-end.d.ts +7 -4
- package/dist/cell-selection/expand-cell-selection-end.js +31 -35
- package/dist/cell-selection/expand-cell-selection-start.d.ts +7 -4
- package/dist/cell-selection/expand-cell-selection-start.js +30 -34
- package/dist/cell-selection/expand-cell-selection-up.d.ts +7 -4
- package/dist/cell-selection/expand-cell-selection-up.js +30 -34
- package/dist/cell-selection/full-width-start-end-index.d.ts +1 -1
- package/dist/cell-selection/full-width-start-end-index.js +3 -3
- package/dist/cell-selection/get-root-cell.d.ts +6 -2
- package/dist/cell-selection/get-root-cell.js +79 -81
- package/dist/cell-selection/is-bottom-rect.d.ts +1 -1
- package/dist/cell-selection/is-bottom-rect.js +5 -5
- package/dist/cell-selection/is-center-col-rect.d.ts +6 -3
- package/dist/cell-selection/is-center-col-rect.js +5 -3
- package/dist/cell-selection/is-center-rect.d.ts +1 -1
- package/dist/cell-selection/is-center-rect.js +3 -3
- package/dist/cell-selection/is-end-rect.d.ts +6 -3
- package/dist/cell-selection/is-end-rect.js +2 -2
- package/dist/cell-selection/is-overlapping-rect.d.ts +1 -1
- package/dist/cell-selection/is-overlapping-rect.js +6 -4
- package/dist/cell-selection/is-start-rect.d.ts +6 -3
- package/dist/cell-selection/is-start-rect.js +2 -2
- package/dist/cell-selection/is-top-rect.d.ts +1 -1
- package/dist/cell-selection/is-top-rect.js +2 -2
- package/dist/cell-selection/is-within-selection-rect.d.ts +1 -1
- package/dist/cell-selection/is-within-selection-rect.js +1 -1
- package/dist/cell-selection/split-cell-selection-rect.d.ts +13 -7
- package/dist/cell-selection/split-cell-selection-rect.js +53 -47
- package/dist/cell-selection/update-additive-cell-selection.d.ts +7 -4
- package/dist/cell-selection/update-additive-cell-selection.js +22 -23
- package/dist/cell-selection/use-edge-scroll.d.ts +10 -8
- 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 +55 -26
- 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 +14 -14
- package/dist/column-manager/use-column-manager.js +21 -21
- package/dist/column-manager/use-columns-from-context.d.ts +2 -2
- package/dist/column-manager/use-columns-from-context.js +19 -19
- 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 +53 -12
- package/dist/filter-tree/filter-tree.js +16 -16
- 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 +6 -6
- package/dist/filter-tree/hooks/use-tree-item.js +101 -108
- 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 +10 -10
- package/dist/grid-box/context.d.ts +4 -4
- 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 +18 -15
- package/dist/grid-box/use-aggregation-box-items.js +54 -55
- package/dist/grid-box/use-column-box-items.d.ts +33 -23
- package/dist/grid-box/use-column-box-items.js +90 -78
- package/dist/grid-box/use-row-group-box-items.d.ts +19 -14
- package/dist/grid-box/use-row-group-box-items.js +116 -124
- package/dist/grid-provider/context.d.ts +6 -4
- package/dist/grid-provider/provider.d.ts +5 -3
- package/dist/grid-provider/provider.js +1 -1
- package/dist/grid-provider/use-grid.d.ts +2 -2
- package/dist/grid-provider/use-grid.js +1 -1
- package/dist/grid.d.ts +150 -25
- package/dist/grid.js +39 -25
- 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 -117
- package/dist/header/use-drag-move.d.ts +23 -12
- 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 -0
- package/dist/icons/index.js +92 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- 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 +17 -17
- package/dist/row-data-source-client/built-ins/built-ins.js +17 -17
- 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 +18 -19
- 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 +5 -2
- package/dist/row-data-source-client/tree/evaluator-aggregation.js +6 -6
- package/dist/row-data-source-client/tree/evaluator-group.d.ts +5 -2
- package/dist/row-data-source-client/tree/evaluator-group.js +6 -7
- package/dist/row-data-source-client/tree/traverse.d.ts +6 -2
- package/dist/row-data-source-client/tree/traverse.js +16 -19
- package/dist/row-data-source-client/use-client-data-source-paginated.d.ts +11 -7
- package/dist/row-data-source-client/use-client-data-source-paginated.js +528 -512
- package/dist/row-data-source-client/use-client-data-source.d.ts +11 -7
- package/dist/row-data-source-client/use-client-data-source.js +673 -639
- package/dist/row-data-source-client/use-client-tree-data-source.d.ts +10 -6
- package/dist/row-data-source-client/use-client-tree-data-source.js +499 -489
- 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 +19 -23
- 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 +17 -17
- 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 +12 -3
- package/dist/row-data-source-server/use-server-data-source.js +667 -654
- 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 +7 -7
- package/dist/sort-manager/hooks/use-sort-manager.d.ts +10 -10
- package/dist/sort-manager/hooks/use-sort-manager.js +47 -51
- package/dist/sort-manager/hooks/use-sort-row-item.d.ts +58 -47
- package/dist/sort-manager/hooks/use-sort-row-item.js +127 -132
- 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 +5 -2
- 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 +5 -2
- 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 +5 -3
- package/dist/state/api/column-autosize.js +63 -64
- 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 +49 -47
- 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 +9 -5
- package/dist/state/api/dialog-frame.js +11 -12
- package/dist/state/api/edit-begin.d.ts +5 -3
- package/dist/state/api/edit-begin.js +72 -85
- package/dist/state/api/edit-end.d.ts +5 -3
- package/dist/state/api/edit-end.js +38 -41
- package/dist/state/api/edit-is-cell-active.d.ts +5 -3
- package/dist/state/api/edit-is-cell-active.js +17 -24
- package/dist/state/api/edit-update.d.ts +5 -3
- package/dist/state/api/edit-update.js +75 -86
- 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 +34 -36
- package/dist/state/api/export-data-rect.js +22 -22
- package/dist/state/api/focus-cell.d.ts +5 -3
- package/dist/state/api/focus-cell.js +110 -109
- package/dist/state/api/popover-frame.d.ts +10 -6
- 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 +6 -4
- 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 +15 -15
- 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 +15 -9
|
@@ -4,27 +4,40 @@ import { useColumnItemContext } from "./context";
|
|
|
4
4
|
import { forwardRef, useCallback, useMemo } from "react";
|
|
5
5
|
import { useGrid } from "../grid-provider/use-grid";
|
|
6
6
|
import { useColumnsFromContext } from "./use-columns-from-context";
|
|
7
|
-
export const VisibilityCheckbox = forwardRef(function VisibilityCheckbox(
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
const
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
7
|
+
export const VisibilityCheckbox = forwardRef(function VisibilityCheckbox(
|
|
8
|
+
{ slot, ...props },
|
|
9
|
+
forwarded,
|
|
10
|
+
) {
|
|
11
|
+
const { item } = useColumnItemContext();
|
|
12
|
+
const grid = useGrid();
|
|
13
|
+
const base = grid.state.columnBase.useValue();
|
|
14
|
+
const columns = useColumnsFromContext(item);
|
|
15
|
+
const [isVisible, isIndeterminate] = useMemo(() => {
|
|
16
|
+
const allVisible = columns.every((c) => !(c.hide ?? base.hide));
|
|
17
|
+
const someVisible = columns.some((c) => !(c.hide ?? base.hide));
|
|
18
|
+
return [allVisible, !allVisible && someVisible];
|
|
19
|
+
}, [base.hide, columns]);
|
|
20
|
+
const toggle = useCallback(
|
|
21
|
+
(s) => {
|
|
22
|
+
const next = s ?? isVisible;
|
|
23
|
+
grid.api.columnUpdate(Object.fromEntries(columns.map((c) => [c.id, { hide: next }])));
|
|
24
|
+
},
|
|
25
|
+
[columns, grid.api, isVisible],
|
|
26
|
+
);
|
|
27
|
+
const rendered = useSlot({
|
|
28
|
+
props: [props],
|
|
29
|
+
ref: forwarded,
|
|
30
|
+
slot:
|
|
31
|
+
slot ??
|
|
32
|
+
_jsx("input", {
|
|
33
|
+
type: "checkbox",
|
|
34
|
+
checked: isVisible,
|
|
35
|
+
"aria-label": "visibility toggle",
|
|
36
|
+
onChange: () => {
|
|
37
|
+
toggle();
|
|
38
|
+
},
|
|
39
|
+
}),
|
|
40
|
+
state: { visible: isVisible, indeterminate: isIndeterminate, toggle },
|
|
41
|
+
});
|
|
42
|
+
return rendered;
|
|
30
43
|
});
|
package/dist/context.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import type { Grid } from "./+types";
|
|
2
2
|
import type { InternalAtoms } from "./state/+types";
|
|
3
3
|
export interface GridRootContext {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
4
|
+
readonly ref: (el: HTMLElement | SVGElement | null) => void;
|
|
5
|
+
readonly grid: Grid<any> & {
|
|
6
|
+
internal: InternalAtoms;
|
|
7
|
+
};
|
|
8
8
|
}
|
|
9
9
|
export declare const RootProvider: import("react").Provider<GridRootContext>;
|
|
10
10
|
export declare const useGridRoot: () => GridRootContext;
|
|
@@ -2,9 +2,17 @@ import type { TreeVirtualBranch } from "../tree-view/virtualized/make-virtual-tr
|
|
|
2
2
|
import type { FilterInFilterItem } from "../+types";
|
|
3
3
|
import { type SlotComponent } from "@1771technologies/lytenyte-react-hooks";
|
|
4
4
|
export interface FilterTreeBranch {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
5
|
+
readonly item: TreeVirtualBranch<FilterInFilterItem>;
|
|
6
|
+
readonly label: SlotComponent;
|
|
7
|
+
readonly labelWrap?: SlotComponent;
|
|
8
|
+
readonly expander?: SlotComponent;
|
|
9
9
|
}
|
|
10
|
-
export declare const Branch: import("react").ForwardRefExoticComponent<
|
|
10
|
+
export declare const Branch: import("react").ForwardRefExoticComponent<
|
|
11
|
+
Omit<
|
|
12
|
+
FilterTreeBranch &
|
|
13
|
+
import("react").ClassAttributes<HTMLLIElement> &
|
|
14
|
+
import("react").LiHTMLAttributes<HTMLLIElement>,
|
|
15
|
+
"ref"
|
|
16
|
+
> &
|
|
17
|
+
import("react").RefAttributes<HTMLLIElement>
|
|
18
|
+
>;
|
|
@@ -5,17 +5,27 @@ import { useSlot } from "@1771technologies/lytenyte-react-hooks";
|
|
|
5
5
|
import { FilterTreeItemContext } from "./context";
|
|
6
6
|
import { useTreeItem } from "./hooks/use-tree-item";
|
|
7
7
|
export const Branch = forwardRef(function Branch({ item, labelWrap, label, ...props }, forwarded) {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
8
|
+
const value = useTreeItem(item);
|
|
9
|
+
const labelSlot = useSlot({
|
|
10
|
+
slot: labelWrap ?? _jsx("div", {}),
|
|
11
|
+
props: [
|
|
12
|
+
{
|
|
13
|
+
onClick: () => value.onCheckChange(),
|
|
14
|
+
},
|
|
15
|
+
],
|
|
16
|
+
});
|
|
17
|
+
return _jsx(FilterTreeItemContext.Provider, {
|
|
18
|
+
value: value,
|
|
19
|
+
children: _jsx(TreeBranch, {
|
|
20
|
+
...props,
|
|
21
|
+
itemId: item.branch.data.idOccurrence,
|
|
22
|
+
ref: forwarded,
|
|
23
|
+
...item.attrs,
|
|
24
|
+
onKeyDown: (ev) => {
|
|
25
|
+
if (ev.key === " ") value.onCheckChange();
|
|
26
|
+
},
|
|
27
|
+
label: label,
|
|
28
|
+
labelWrap: labelSlot,
|
|
29
|
+
}),
|
|
30
|
+
});
|
|
21
31
|
});
|
|
@@ -2,26 +2,26 @@ import { type Dispatch, type SetStateAction } from "react";
|
|
|
2
2
|
import type { TreeVirtualItem } from "../tree-view/virtualized/make-virtual-tree";
|
|
3
3
|
import type { FilterIn, FilterInFilterItem } from "../+types";
|
|
4
4
|
export interface TreeItemContextValue {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
5
|
+
readonly item: TreeVirtualItem<FilterInFilterItem>;
|
|
6
|
+
readonly onCheckChange: (b?: boolean) => void;
|
|
7
|
+
readonly isChecked: boolean;
|
|
8
|
+
readonly isIndeterminate: boolean;
|
|
9
9
|
}
|
|
10
10
|
export declare const FilterTreeContext: import("react").Context<{
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
11
|
+
items: FilterInFilterItem[];
|
|
12
|
+
pivotMode: boolean;
|
|
13
|
+
columnId: string;
|
|
14
|
+
filter: FilterIn;
|
|
15
|
+
filterChange: Dispatch<SetStateAction<FilterIn>>;
|
|
16
|
+
applyChangesImmediately: boolean;
|
|
17
17
|
}>;
|
|
18
18
|
export declare const useTreeContext: () => {
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
19
|
+
items: FilterInFilterItem[];
|
|
20
|
+
pivotMode: boolean;
|
|
21
|
+
columnId: string;
|
|
22
|
+
filter: FilterIn;
|
|
23
|
+
filterChange: Dispatch<SetStateAction<FilterIn>>;
|
|
24
|
+
applyChangesImmediately: boolean;
|
|
25
25
|
};
|
|
26
26
|
export declare const FilterTreeItemContext: import("react").Context<TreeItemContextValue>;
|
|
27
27
|
export declare const useTreeItemContext: () => TreeItemContextValue;
|
|
@@ -1,14 +1,55 @@
|
|
|
1
|
-
import { ForceSyncScrolling } from "../tree-view/virtualized/force-sync-scrolling";
|
|
2
|
-
import { InclusionCheckbox } from "./inclusion-checkbox";
|
|
3
|
-
import { Root } from "./root";
|
|
4
|
-
import { useFilterTree } from "./hooks/use-filter-tree";
|
|
1
|
+
import { ForceSyncScrolling } from "../tree-view/virtualized/force-sync-scrolling.js";
|
|
2
|
+
import { InclusionCheckbox } from "./inclusion-checkbox.js";
|
|
3
|
+
import { Root } from "./root.js";
|
|
4
|
+
import { useFilterTree } from "./hooks/use-filter-tree.js";
|
|
5
5
|
export declare const FilterTree: {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
6
|
+
Root: typeof Root;
|
|
7
|
+
Panel: import("react").ForwardRefExoticComponent<
|
|
8
|
+
Omit<
|
|
9
|
+
import("react").DetailedHTMLProps<
|
|
10
|
+
import("react").HTMLAttributes<HTMLUListElement>,
|
|
11
|
+
HTMLUListElement
|
|
12
|
+
>,
|
|
13
|
+
"ref"
|
|
14
|
+
> &
|
|
15
|
+
import("react").RefAttributes<HTMLUListElement>
|
|
16
|
+
>;
|
|
17
|
+
PassiveScroll: typeof ForceSyncScrolling;
|
|
18
|
+
Leaf: import("react").ForwardRefExoticComponent<
|
|
19
|
+
Omit<
|
|
20
|
+
import("./leaf.js").FilterTreeLeafProps &
|
|
21
|
+
import("react").ClassAttributes<HTMLLIElement> &
|
|
22
|
+
import("react").LiHTMLAttributes<HTMLLIElement>,
|
|
23
|
+
"ref"
|
|
24
|
+
> &
|
|
25
|
+
import("react").RefAttributes<HTMLLIElement>
|
|
26
|
+
>;
|
|
27
|
+
Branch: import("react").ForwardRefExoticComponent<
|
|
28
|
+
Omit<
|
|
29
|
+
import("./branch.js").FilterTreeBranch &
|
|
30
|
+
import("react").ClassAttributes<HTMLLIElement> &
|
|
31
|
+
import("react").LiHTMLAttributes<HTMLLIElement>,
|
|
32
|
+
"ref"
|
|
33
|
+
> &
|
|
34
|
+
import("react").RefAttributes<HTMLLIElement>
|
|
35
|
+
>;
|
|
36
|
+
Label: import("react").ForwardRefExoticComponent<
|
|
37
|
+
Omit<
|
|
38
|
+
import("react").ClassAttributes<HTMLDivElement> &
|
|
39
|
+
import("react").HTMLAttributes<HTMLDivElement> &
|
|
40
|
+
import("./label.js").LabelProps,
|
|
41
|
+
"ref"
|
|
42
|
+
> &
|
|
43
|
+
import("react").RefAttributes<HTMLDivElement>
|
|
44
|
+
>;
|
|
45
|
+
Checkbox: import("react").ForwardRefExoticComponent<
|
|
46
|
+
Omit<
|
|
47
|
+
import("react").ClassAttributes<HTMLDivElement> &
|
|
48
|
+
import("react").HTMLAttributes<HTMLDivElement> &
|
|
49
|
+
InclusionCheckbox,
|
|
50
|
+
"ref"
|
|
51
|
+
> &
|
|
52
|
+
import("react").RefAttributes<HTMLDivElement>
|
|
53
|
+
>;
|
|
54
|
+
useFilterTree: typeof useFilterTree;
|
|
14
55
|
};
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import { TreePanel } from "../tree-view/panel/panel";
|
|
2
|
-
import { ForceSyncScrolling } from "../tree-view/virtualized/force-sync-scrolling";
|
|
3
|
-
import { Branch } from "./branch";
|
|
4
|
-
import { InclusionCheckbox } from "./inclusion-checkbox";
|
|
5
|
-
import { Label } from "./label";
|
|
6
|
-
import { Leaf } from "./leaf";
|
|
7
|
-
import { Root } from "./root";
|
|
8
|
-
import { useFilterTree } from "./hooks/use-filter-tree";
|
|
1
|
+
import { TreePanel } from "../tree-view/panel/panel.js";
|
|
2
|
+
import { ForceSyncScrolling } from "../tree-view/virtualized/force-sync-scrolling.js";
|
|
3
|
+
import { Branch } from "./branch.js";
|
|
4
|
+
import { InclusionCheckbox } from "./inclusion-checkbox.js";
|
|
5
|
+
import { Label } from "./label.js";
|
|
6
|
+
import { Leaf } from "./leaf.js";
|
|
7
|
+
import { Root } from "./root.js";
|
|
8
|
+
import { useFilterTree } from "./hooks/use-filter-tree.js";
|
|
9
9
|
export const FilterTree = {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
10
|
+
Root,
|
|
11
|
+
Panel: TreePanel,
|
|
12
|
+
PassiveScroll: ForceSyncScrolling,
|
|
13
|
+
Leaf: Leaf,
|
|
14
|
+
Branch: Branch,
|
|
15
|
+
Label: Label,
|
|
16
|
+
Checkbox: InclusionCheckbox,
|
|
17
|
+
useFilterTree,
|
|
18
18
|
};
|
|
@@ -3,35 +3,41 @@ import type { Column, FilterIn, FilterInFilterItem, Grid } from "../../+types";
|
|
|
3
3
|
import type { PathRoot } from "@1771technologies/lytenyte-shared";
|
|
4
4
|
import type { TreeVirtualItem } from "../../tree-view/virtualized/make-virtual-tree";
|
|
5
5
|
export interface UseTreeFilterReturn<T> {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
6
|
+
readonly rootProps: {
|
|
7
|
+
readonly fetchItems: () => void;
|
|
8
|
+
readonly loading: boolean;
|
|
9
|
+
readonly error: any;
|
|
10
|
+
readonly pivotMode: boolean;
|
|
11
|
+
readonly grid: Grid<T>;
|
|
12
|
+
readonly expansions: Record<string, boolean>;
|
|
13
|
+
readonly onExpansionChange: Dispatch<SetStateAction<Record<string, boolean>>>;
|
|
14
|
+
readonly treeRef: (el: HTMLElement | null) => void;
|
|
15
|
+
readonly getAllIds: () => Set<string>;
|
|
16
|
+
readonly getIdsBetweenNodes: (left: HTMLElement, right: HTMLElement) => string[];
|
|
17
|
+
readonly onFocusChange: (el: HTMLElement | null) => void;
|
|
18
|
+
readonly root: PathRoot<FilterInFilterItem>;
|
|
19
|
+
readonly columnId: string;
|
|
20
|
+
readonly items: FilterInFilterItem[];
|
|
21
|
+
readonly applyChangesImmediately: boolean;
|
|
22
|
+
readonly filterIn: FilterIn;
|
|
23
|
+
readonly filterInChange: Dispatch<SetStateAction<FilterIn>>;
|
|
24
|
+
};
|
|
25
|
+
readonly tree: TreeVirtualItem<FilterInFilterItem>[];
|
|
26
|
+
readonly spacer: JSX.Element;
|
|
27
|
+
readonly apply: () => void;
|
|
28
|
+
readonly reset: () => void;
|
|
29
29
|
}
|
|
30
30
|
export interface UseFilterTreeArgs<T> {
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
31
|
+
grid: Grid<T>;
|
|
32
|
+
column: Column<T>;
|
|
33
|
+
treeItemHeight?: number;
|
|
34
|
+
pivotMode?: boolean;
|
|
35
|
+
applyChangesImmediately?: boolean;
|
|
36
36
|
}
|
|
37
|
-
export declare function useFilterTree<T>({
|
|
37
|
+
export declare function useFilterTree<T>({
|
|
38
|
+
grid,
|
|
39
|
+
column,
|
|
40
|
+
treeItemHeight,
|
|
41
|
+
pivotMode,
|
|
42
|
+
applyChangesImmediately,
|
|
43
|
+
}: UseFilterTreeArgs<T>): UseTreeFilterReturn<T>;
|
|
@@ -1,96 +1,98 @@
|
|
|
1
1
|
import { useEffect, useMemo, useState } from "react";
|
|
2
2
|
import { useVirtualizedTree } from "../../tree-view/virtualized/use-virtualized-tree";
|
|
3
3
|
import { useEvent } from "@1771technologies/lytenyte-react-hooks";
|
|
4
|
-
export function useFilterTree({
|
|
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
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
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
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
4
|
+
export function useFilterTree({
|
|
5
|
+
grid,
|
|
6
|
+
column,
|
|
7
|
+
treeItemHeight = 24,
|
|
8
|
+
pivotMode,
|
|
9
|
+
applyChangesImmediately = false,
|
|
10
|
+
}) {
|
|
11
|
+
const [items, setItems] = useState([]);
|
|
12
|
+
const [expansions, onExpansionChange] = useState({});
|
|
13
|
+
const [loading, setLoading] = useState(false);
|
|
14
|
+
const [error, setError] = useState();
|
|
15
|
+
const rds = grid.state.rowDataSource.useValue();
|
|
16
|
+
const filterModel = grid.state.filterInModel.useValue();
|
|
17
|
+
const pivotModel = grid.state.columnPivotModel.useValue().filtersIn;
|
|
18
|
+
const currentPivotMode = grid.state.columnPivotMode.useValue();
|
|
19
|
+
const model = (pivotMode ?? currentPivotMode) ? pivotModel : filterModel;
|
|
20
|
+
const existingFilter = useMemo(() => {
|
|
21
|
+
const filter = model[column.id];
|
|
22
|
+
return filter ?? { kind: "in", operator: "not_in", value: new Set() };
|
|
23
|
+
}, [column.id, model]);
|
|
24
|
+
const [changes, setChanges] = useState(() => existingFilter);
|
|
25
|
+
// Keep in sync with any external changes.
|
|
26
|
+
useEffect(() => {
|
|
27
|
+
setChanges(existingFilter);
|
|
28
|
+
}, [existingFilter]);
|
|
29
|
+
const fetchItems = useEvent(() => {
|
|
30
|
+
const items = rds.inFilterItems(column);
|
|
31
|
+
if ("then" in items) {
|
|
32
|
+
setLoading(true);
|
|
33
|
+
items
|
|
34
|
+
.then((res) => {
|
|
35
|
+
setItems(res);
|
|
36
|
+
setError(null);
|
|
37
|
+
})
|
|
38
|
+
.catch((error) => setError(error))
|
|
39
|
+
.finally(() => setLoading(false));
|
|
40
|
+
} else {
|
|
41
|
+
setItems(items);
|
|
42
|
+
setError(null);
|
|
43
|
+
setLoading(false);
|
|
44
|
+
}
|
|
45
|
+
});
|
|
46
|
+
useEffect(() => {
|
|
47
|
+
fetchItems();
|
|
48
|
+
}, [column, fetchItems, rds]);
|
|
49
|
+
const itemsWithSelectAll = useMemo(() => {
|
|
50
|
+
return [{ id: "__LNG__SELECT_ALL", label: "(Select All)", value: "" }, ...items];
|
|
51
|
+
}, [items]);
|
|
52
|
+
const virt = useVirtualizedTree({
|
|
53
|
+
itemHeight: treeItemHeight,
|
|
54
|
+
paths: itemsWithSelectAll,
|
|
55
|
+
expansions,
|
|
56
|
+
expansionDefault: true,
|
|
57
|
+
nonAdjacentPathTrees: false,
|
|
58
|
+
});
|
|
59
|
+
const apply = useEvent(() => {
|
|
60
|
+
if (applyChangesImmediately) return;
|
|
61
|
+
if (pivotMode) {
|
|
62
|
+
grid.state.columnPivotModel.set((prev) => {
|
|
63
|
+
return {
|
|
64
|
+
...prev,
|
|
65
|
+
filtersIn: { ...prev.filtersIn, [column.id]: changes },
|
|
66
|
+
};
|
|
67
|
+
});
|
|
68
|
+
} else {
|
|
69
|
+
grid.state.filterInModel.set((prev) => ({ ...prev, [column.id]: changes }));
|
|
70
|
+
}
|
|
71
|
+
});
|
|
72
|
+
const reset = useEvent(() => {
|
|
73
|
+
if (applyChangesImmediately) return;
|
|
74
|
+
setChanges(existingFilter);
|
|
75
|
+
});
|
|
76
|
+
return {
|
|
77
|
+
rootProps: {
|
|
78
|
+
fetchItems,
|
|
79
|
+
items,
|
|
80
|
+
grid,
|
|
81
|
+
columnId: column.id,
|
|
82
|
+
expansions,
|
|
83
|
+
pivotMode: pivotMode ?? currentPivotMode,
|
|
84
|
+
onExpansionChange,
|
|
85
|
+
treeRef: virt.ref,
|
|
86
|
+
loading,
|
|
87
|
+
error,
|
|
88
|
+
filterIn: changes,
|
|
89
|
+
filterInChange: setChanges,
|
|
90
|
+
applyChangesImmediately,
|
|
91
|
+
...virt.rootProps,
|
|
92
|
+
},
|
|
93
|
+
spacer: virt.spacer,
|
|
94
|
+
tree: virt.virtualTree,
|
|
95
|
+
apply,
|
|
96
|
+
reset,
|
|
97
|
+
};
|
|
96
98
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import type { FilterInFilterItem } from "../../+types";
|
|
2
|
-
import type { TreeVirtualItem } from "../../tree-view/virtualized/make-virtual-tree";
|
|
1
|
+
import type { FilterInFilterItem } from "../../+types.js";
|
|
2
|
+
import type { TreeVirtualItem } from "../../tree-view/virtualized/make-virtual-tree.js";
|
|
3
3
|
export declare function useTreeItem(item: TreeVirtualItem<FilterInFilterItem>): {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
4
|
+
onCheckChange: (b?: boolean) => void;
|
|
5
|
+
isChecked: boolean;
|
|
6
|
+
isIndeterminate: boolean;
|
|
7
|
+
item: TreeVirtualItem<FilterInFilterItem>;
|
|
8
8
|
};
|