@1771technologies/lytenyte-pro 1.0.12-dev.1 → 1.0.12-dev.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/+types.d.ts +5836 -0
- package/dist/+types.js +1 -0
- package/dist/cell-selection/adjust-rect-for-row-and-cell-span.d.ts +2 -0
- package/dist/cell-selection/adjust-rect-for-row-and-cell-span.js +43 -0
- package/dist/cell-selection/are-rects-equal.d.ts +2 -0
- package/dist/cell-selection/are-rects-equal.js +6 -0
- package/dist/cell-selection/bound-selection-rect.d.ts +2 -0
- package/dist/cell-selection/bound-selection-rect.js +17 -0
- package/dist/cell-selection/cell-selection-containers.d.ts +3 -0
- package/dist/cell-selection/cell-selection-containers.js +91 -0
- package/dist/cell-selection/cell-selection-driver.d.ts +1 -0
- package/dist/cell-selection/cell-selection-driver.js +285 -0
- package/dist/cell-selection/cell-style-row.d.ts +8 -0
- package/dist/cell-selection/cell-style-row.js +84 -0
- package/dist/cell-selection/deselect-rect-range.d.ts +2 -0
- package/dist/cell-selection/deselect-rect-range.js +43 -0
- package/dist/cell-selection/expand-cell-selection-down.d.ts +5 -0
- package/dist/cell-selection/expand-cell-selection-down.js +39 -0
- package/dist/cell-selection/expand-cell-selection-end.d.ts +5 -0
- package/dist/cell-selection/expand-cell-selection-end.js +40 -0
- package/dist/cell-selection/expand-cell-selection-start.d.ts +5 -0
- package/dist/cell-selection/expand-cell-selection-start.js +39 -0
- package/dist/cell-selection/expand-cell-selection-up.d.ts +5 -0
- package/dist/cell-selection/expand-cell-selection-up.js +39 -0
- package/dist/cell-selection/full-width-start-end-index.d.ts +2 -0
- package/dist/cell-selection/full-width-start-end-index.js +5 -0
- package/dist/cell-selection/get-root-cell.d.ts +2 -0
- package/dist/cell-selection/get-root-cell.js +6 -0
- package/dist/cell-selection/index.d.ts +18 -0
- package/dist/cell-selection/index.js +18 -0
- package/dist/cell-selection/is-bottom-rect.d.ts +2 -0
- package/dist/cell-selection/is-bottom-rect.js +7 -0
- package/dist/cell-selection/is-center-col-rect.d.ts +5 -0
- package/dist/cell-selection/is-center-col-rect.js +5 -0
- package/dist/cell-selection/is-center-rect.d.ts +2 -0
- package/dist/cell-selection/is-center-rect.js +5 -0
- package/dist/cell-selection/is-end-rect.d.ts +5 -0
- package/dist/cell-selection/is-end-rect.js +4 -0
- package/dist/cell-selection/is-overlapping-rect.d.ts +2 -0
- package/dist/cell-selection/is-overlapping-rect.js +6 -0
- package/dist/cell-selection/is-start-rect.d.ts +5 -0
- package/dist/cell-selection/is-start-rect.js +4 -0
- package/dist/cell-selection/is-top-rect.d.ts +2 -0
- package/dist/cell-selection/is-top-rect.js +4 -0
- package/dist/cell-selection/is-within-selection-rect.d.ts +2 -0
- package/dist/cell-selection/is-within-selection-rect.js +3 -0
- package/dist/cell-selection/split-cell-selection-rect.d.ts +46 -0
- package/dist/cell-selection/split-cell-selection-rect.js +88 -0
- package/dist/cell-selection/split-on-pivot.d.ts +3 -0
- package/dist/cell-selection/split-on-pivot.js +50 -0
- package/dist/cell-selection/update-additive-cell-selection.d.ts +5 -0
- package/dist/cell-selection/update-additive-cell-selection.js +23 -0
- package/dist/cell-selection/use-edge-scroll.d.ts +10 -0
- package/dist/cell-selection/use-edge-scroll.js +66 -0
- package/dist/cells/+types.cell.d.ts +13 -0
- package/dist/cells/+types.cell.js +1 -0
- package/dist/cells/cell-default.d.ts +2 -0
- package/dist/cells/cell-default.js +8 -0
- package/dist/cells/cell-editor.d.ts +6 -0
- package/dist/cells/cell-editor.js +103 -0
- package/dist/cells/cell-spacer.d.ts +9 -0
- package/dist/cells/cell-spacer.js +34 -0
- package/dist/cells/cell.d.ts +5 -0
- package/dist/cells/cell.js +43 -0
- package/dist/cells/use-cell-style.d.ts +3 -0
- package/dist/cells/use-cell-style.js +51 -0
- package/dist/column-manager/branch-lookup-context.d.ts +4 -0
- package/dist/column-manager/branch-lookup-context.js +3 -0
- package/dist/column-manager/branch.d.ts +15 -0
- package/dist/column-manager/branch.js +54 -0
- package/dist/column-manager/column-manager.d.ts +13 -0
- package/dist/column-manager/column-manager.js +18 -0
- package/dist/column-manager/context.d.ts +7 -0
- package/dist/column-manager/context.js +3 -0
- package/dist/column-manager/label.d.ts +5 -0
- package/dist/column-manager/label.js +18 -0
- package/dist/column-manager/leaf.d.ts +6 -0
- package/dist/column-manager/leaf.js +58 -0
- package/dist/column-manager/move-handle.d.ts +5 -0
- package/dist/column-manager/move-handle.js +73 -0
- package/dist/column-manager/panel.d.ts +1 -0
- package/dist/column-manager/panel.js +2 -0
- package/dist/column-manager/root.d.ts +8 -0
- package/dist/column-manager/root.js +7 -0
- package/dist/column-manager/use-column-manager.d.ts +10 -0
- package/dist/column-manager/use-column-manager.js +24 -0
- package/dist/column-manager/use-columns-from-context.d.ts +3 -0
- package/dist/column-manager/use-columns-from-context.js +23 -0
- package/dist/column-manager/visibility-checkbox.d.ts +9 -0
- package/dist/column-manager/visibility-checkbox.js +30 -0
- package/dist/context.d.ts +10 -0
- package/dist/context.js +4 -0
- package/dist/filter-tree/branch.d.ts +13 -0
- package/dist/filter-tree/branch.js +21 -0
- package/dist/filter-tree/context.d.ts +27 -0
- package/dist/filter-tree/context.js +5 -0
- package/dist/filter-tree/filter-tree.d.ts +14 -0
- package/dist/filter-tree/filter-tree.js +18 -0
- package/dist/filter-tree/hooks/use-filter-tree.d.ts +38 -0
- package/dist/filter-tree/hooks/use-filter-tree.js +101 -0
- package/dist/filter-tree/hooks/use-tree-item.d.ts +8 -0
- package/dist/filter-tree/hooks/use-tree-item.js +116 -0
- package/dist/filter-tree/inclusion-checkbox.d.ts +9 -0
- package/dist/filter-tree/inclusion-checkbox.js +14 -0
- package/dist/filter-tree/label.d.ts +5 -0
- package/dist/filter-tree/label.js +18 -0
- package/dist/filter-tree/leaf.d.ts +6 -0
- package/dist/filter-tree/leaf.js +14 -0
- package/dist/filter-tree/root.d.ts +13 -0
- package/dist/filter-tree/root.js +30 -0
- package/dist/grid-box/+types.d.ts +15 -0
- package/dist/grid-box/+types.js +1 -0
- package/dist/grid-box/context.d.ts +9 -0
- package/dist/grid-box/context.js +3 -0
- package/dist/grid-box/grid-box.d.ts +12 -0
- package/dist/grid-box/grid-box.js +14 -0
- package/dist/grid-box/item.d.ts +10 -0
- package/dist/grid-box/item.js +63 -0
- package/dist/grid-box/panel.d.ts +1 -0
- package/dist/grid-box/panel.js +9 -0
- package/dist/grid-box/root.d.ts +9 -0
- package/dist/grid-box/root.js +8 -0
- package/dist/grid-box/use-aggregation-box-items.d.ts +18 -0
- package/dist/grid-box/use-aggregation-box-items.js +61 -0
- package/dist/grid-box/use-column-box-items.d.ts +34 -0
- package/dist/grid-box/use-column-box-items.js +78 -0
- package/dist/grid-box/use-row-group-box-items.d.ts +18 -0
- package/dist/grid-box/use-row-group-box-items.js +169 -0
- package/dist/grid-provider/context.d.ts +5 -0
- package/dist/grid-provider/context.js +2 -0
- package/dist/grid-provider/provider.d.ts +3 -0
- package/dist/grid-provider/provider.js +2 -0
- package/dist/grid-provider/use-grid.d.ts +3 -0
- package/dist/grid-provider/use-grid.js +3 -0
- package/dist/grid.d.ts +18 -0
- package/dist/grid.js +28 -0
- package/dist/header/header-cell.d.ts +10 -0
- package/dist/header/header-cell.js +22 -0
- package/dist/header/header-group-cell.d.ts +5 -0
- package/dist/header/header-group-cell.js +16 -0
- package/dist/header/header-row.d.ts +4 -0
- package/dist/header/header-row.js +10 -0
- package/dist/header/header.d.ts +1 -0
- package/dist/header/header.js +12 -0
- package/dist/header/resize-handler.d.ts +12 -0
- package/dist/header/resize-handler.js +136 -0
- package/dist/header/use-drag-move.d.ts +14 -0
- package/dist/header/use-drag-move.js +97 -0
- package/dist/header/use-header-cell-renderer.d.ts +4 -0
- package/dist/header/use-header-cell-renderer.js +36 -0
- package/dist/icons/index.d.ts +1 -0
- package/dist/icons/index.js +3 -0
- package/dist/index.d.ts +13 -0
- package/dist/index.js +13 -0
- package/dist/license.d.ts +3 -0
- package/dist/license.js +214 -0
- package/dist/listbox/context.d.ts +6 -0
- package/dist/listbox/context.js +3 -0
- package/dist/listbox/item.d.ts +1 -0
- package/dist/listbox/item.js +25 -0
- package/dist/listbox/panel.d.ts +1 -0
- package/dist/listbox/panel.js +50 -0
- package/dist/listbox/root.d.ts +6 -0
- package/dist/listbox/root.js +12 -0
- package/dist/root/dialog-driver.d.ts +1 -0
- package/dist/root/dialog-driver.js +21 -0
- package/dist/root/popover-driver.d.ts +1 -0
- package/dist/root/popover-driver.js +21 -0
- package/dist/root/root.d.ts +8 -0
- package/dist/root/root.js +125 -0
- package/dist/row-data-source-client/+constants.d.ts +2 -0
- package/dist/row-data-source-client/+constants.js +2 -0
- package/dist/row-data-source-client/+types.d.ts +27 -0
- package/dist/row-data-source-client/+types.js +1 -0
- package/dist/row-data-source-client/built-ins/avg.d.ts +10 -0
- package/dist/row-data-source-client/built-ins/avg.js +16 -0
- package/dist/row-data-source-client/built-ins/built-ins.d.ts +44 -0
- package/dist/row-data-source-client/built-ins/built-ins.js +44 -0
- package/dist/row-data-source-client/built-ins/count.d.ts +10 -0
- package/dist/row-data-source-client/built-ins/count.js +16 -0
- package/dist/row-data-source-client/built-ins/first.d.ts +10 -0
- package/dist/row-data-source-client/built-ins/first.js +12 -0
- package/dist/row-data-source-client/built-ins/group.d.ts +1 -0
- package/dist/row-data-source-client/built-ins/group.js +3 -0
- package/dist/row-data-source-client/built-ins/last.d.ts +10 -0
- package/dist/row-data-source-client/built-ins/last.js +12 -0
- package/dist/row-data-source-client/built-ins/max.d.ts +11 -0
- package/dist/row-data-source-client/built-ins/max.js +25 -0
- package/dist/row-data-source-client/built-ins/min.d.ts +11 -0
- package/dist/row-data-source-client/built-ins/min.js +25 -0
- package/dist/row-data-source-client/built-ins/sum.d.ts +10 -0
- package/dist/row-data-source-client/built-ins/sum.js +21 -0
- package/dist/row-data-source-client/filter/+types.d.ts +23 -0
- package/dist/row-data-source-client/filter/+types.js +1 -0
- package/dist/row-data-source-client/filter/compute-filtered-rows.d.ts +2 -0
- package/dist/row-data-source-client/filter/compute-filtered-rows.js +109 -0
- package/dist/row-data-source-client/pivots/create-agg-model.d.ts +6 -0
- package/dist/row-data-source-client/pivots/create-agg-model.js +13 -0
- package/dist/row-data-source-client/pivots/create-pivot-columns-from-paths.d.ts +2 -0
- package/dist/row-data-source-client/pivots/create-pivot-columns-from-paths.js +50 -0
- package/dist/row-data-source-client/pivots/create-pivot-columns.d.ts +2 -0
- package/dist/row-data-source-client/pivots/create-pivot-columns.js +22 -0
- package/dist/row-data-source-client/pivots/create-pivot-tree.d.ts +2 -0
- package/dist/row-data-source-client/pivots/create-pivot-tree.js +23 -0
- package/dist/row-data-source-client/tree/client-tree.d.ts +18 -0
- package/dist/row-data-source-client/tree/client-tree.js +76 -0
- package/dist/row-data-source-client/tree/evaluator-aggregation.d.ts +2 -0
- package/dist/row-data-source-client/tree/evaluator-aggregation.js +8 -0
- package/dist/row-data-source-client/tree/evaluator-group.d.ts +2 -0
- package/dist/row-data-source-client/tree/evaluator-group.js +9 -0
- package/dist/row-data-source-client/tree/traverse.d.ts +2 -0
- package/dist/row-data-source-client/tree/traverse.js +22 -0
- package/dist/row-data-source-client/use-client-data-source-paginated.d.ts +10 -0
- package/dist/row-data-source-client/use-client-data-source-paginated.js +572 -0
- package/dist/row-data-source-client/use-client-data-source.d.ts +10 -0
- package/dist/row-data-source-client/use-client-data-source.js +666 -0
- package/dist/row-data-source-client/use-client-tree-data-source.d.ts +9 -0
- package/dist/row-data-source-client/use-client-tree-data-source.js +511 -0
- package/dist/row-data-source-server/async-tree/+constants.async-tree.d.ts +1 -0
- package/dist/row-data-source-server/async-tree/+constants.async-tree.js +1 -0
- package/dist/row-data-source-server/async-tree/+types.async-tree.d.ts +59 -0
- package/dist/row-data-source-server/async-tree/+types.async-tree.js +1 -0
- package/dist/row-data-source-server/async-tree/apply-delete-action-to-tree.d.ts +2 -0
- package/dist/row-data-source-server/async-tree/apply-delete-action-to-tree.js +27 -0
- package/dist/row-data-source-server/async-tree/apply-set-action-to-tree.d.ts +2 -0
- package/dist/row-data-source-server/async-tree/apply-set-action-to-tree.js +36 -0
- package/dist/row-data-source-server/async-tree/check-set-action-item-keys-are-unique.d.ts +2 -0
- package/dist/row-data-source-server/async-tree/check-set-action-item-keys-are-unique.js +24 -0
- package/dist/row-data-source-server/async-tree/check-set-action-item-keys-are-valid.d.ts +2 -0
- package/dist/row-data-source-server/async-tree/check-set-action-item-keys-are-valid.js +14 -0
- package/dist/row-data-source-server/async-tree/check-set-action-item-keys-fit.d.ts +2 -0
- package/dist/row-data-source-server/async-tree/check-set-action-item-keys-fit.js +18 -0
- package/dist/row-data-source-server/async-tree/check-set-action-item-kinds.d.ts +2 -0
- package/dist/row-data-source-server/async-tree/check-set-action-item-kinds.js +14 -0
- package/dist/row-data-source-server/async-tree/get-parent-node-by-path.d.ts +2 -0
- package/dist/row-data-source-server/async-tree/get-parent-node-by-path.js +18 -0
- package/dist/row-data-source-server/async-tree/is-set-action-a-no-op-on-node.d.ts +2 -0
- package/dist/row-data-source-server/async-tree/is-set-action-a-no-op-on-node.js +3 -0
- package/dist/row-data-source-server/async-tree/make-async-tree.d.ts +2 -0
- package/dist/row-data-source-server/async-tree/make-async-tree.js +19 -0
- package/dist/row-data-source-server/async-tree/maybe-apply-parent-remove-self.d.ts +2 -0
- package/dist/row-data-source-server/async-tree/maybe-apply-parent-remove-self.js +8 -0
- package/dist/row-data-source-server/async-tree/maybe-apply-resize.d.ts +2 -0
- package/dist/row-data-source-server/async-tree/maybe-apply-resize.js +17 -0
- package/dist/row-data-source-server/async-tree/maybe-apply-set-action-items.d.ts +2 -0
- package/dist/row-data-source-server/async-tree/maybe-apply-set-action-items.js +52 -0
- package/dist/row-data-source-server/range-tree/range-tree.d.ts +66 -0
- package/dist/row-data-source-server/range-tree/range-tree.js +102 -0
- package/dist/row-data-source-server/server-data.d.ts +48 -0
- package/dist/row-data-source-server/server-data.js +378 -0
- package/dist/row-data-source-server/use-server-data-source.d.ts +3 -0
- package/dist/row-data-source-server/use-server-data-source.js +344 -0
- package/dist/row-data-source-server/utils/get-node-depth.d.ts +2 -0
- package/dist/row-data-source-server/utils/get-node-depth.js +9 -0
- package/dist/row-data-source-server/utils/get-node-path.d.ts +2 -0
- package/dist/row-data-source-server/utils/get-node-path.js +9 -0
- package/dist/row-data-source-server/utils/get-request-id.d.ts +1 -0
- package/dist/row-data-source-server/utils/get-request-id.js +6 -0
- package/dist/rows/row/context.d.ts +14 -0
- package/dist/rows/row/context.js +13 -0
- package/dist/rows/row/row.d.ts +7 -0
- package/dist/rows/row/row.js +25 -0
- package/dist/rows/row/use-row-context-value.d.ts +6 -0
- package/dist/rows/row/use-row-context-value.js +44 -0
- package/dist/rows/row-detail-row.d.ts +4 -0
- package/dist/rows/row-detail-row.js +130 -0
- package/dist/rows/row-full-width.d.ts +8 -0
- package/dist/rows/row-full-width.js +19 -0
- package/dist/rows/rows-container.d.ts +1 -0
- package/dist/rows/rows-container.js +9 -0
- package/dist/rows/rows-sections.d.ts +3 -0
- package/dist/rows/rows-sections.js +27 -0
- package/dist/rows/scrollers/native-scroller.d.ts +2 -0
- package/dist/rows/scrollers/native-scroller.js +4 -0
- package/dist/sort-manager/+types.d.ts +13 -0
- package/dist/sort-manager/+types.js +1 -0
- package/dist/sort-manager/context.d.ts +14 -0
- package/dist/sort-manager/context.js +5 -0
- package/dist/sort-manager/hooks/use-sort-manager.d.ts +15 -0
- package/dist/sort-manager/hooks/use-sort-manager.js +56 -0
- package/dist/sort-manager/hooks/use-sort-row-item.d.ts +51 -0
- package/dist/sort-manager/hooks/use-sort-row-item.js +145 -0
- package/dist/sort-manager/hooks/use-sortable-column-items.d.ts +5 -0
- package/dist/sort-manager/hooks/use-sortable-column-items.js +13 -0
- package/dist/sort-manager/root.d.ts +3 -0
- package/dist/sort-manager/root.js +14 -0
- package/dist/sort-manager/sort-add.d.ts +8 -0
- package/dist/sort-manager/sort-add.js +14 -0
- package/dist/sort-manager/sort-apply.d.ts +7 -0
- package/dist/sort-manager/sort-apply.js +24 -0
- package/dist/sort-manager/sort-cancel.d.ts +7 -0
- package/dist/sort-manager/sort-cancel.js +27 -0
- package/dist/sort-manager/sort-clear.d.ts +7 -0
- package/dist/sort-manager/sort-clear.js +22 -0
- package/dist/sort-manager/sort-column-select.d.ts +10 -0
- package/dist/sort-manager/sort-column-select.js +20 -0
- package/dist/sort-manager/sort-direction-select.d.ts +10 -0
- package/dist/sort-manager/sort-direction-select.js +24 -0
- package/dist/sort-manager/sort-manager.d.ts +16 -0
- package/dist/sort-manager/sort-manager.js +26 -0
- package/dist/sort-manager/sort-remove.d.ts +7 -0
- package/dist/sort-manager/sort-remove.js +14 -0
- package/dist/sort-manager/sort-row.d.ts +5 -0
- package/dist/sort-manager/sort-row.js +7 -0
- package/dist/sort-manager/sort-rows.d.ts +1 -0
- package/dist/sort-manager/sort-rows.js +6 -0
- package/dist/sort-manager/sort-value-select.d.ts +11 -0
- package/dist/sort-manager/sort-value-select.js +25 -0
- package/dist/sort-manager/utils/sort-item-to-sort-model.d.ts +3 -0
- package/dist/sort-manager/utils/sort-item-to-sort-model.js +62 -0
- package/dist/sort-manager/utils/sort-model-to-sort-items.d.ts +3 -0
- package/dist/sort-manager/utils/sort-model-to-sort-items.js +50 -0
- package/dist/state/+types.d.ts +35 -0
- package/dist/state/+types.js +1 -0
- package/dist/state/api/cell-root.d.ts +5 -0
- package/dist/state/api/cell-root.js +64 -0
- package/dist/state/api/column-autosize.d.ts +5 -0
- package/dist/state/api/column-autosize.js +72 -0
- package/dist/state/api/column-by-id.d.ts +2 -0
- package/dist/state/api/column-by-id.js +6 -0
- package/dist/state/api/column-field.d.ts +2 -0
- package/dist/state/api/column-field.js +23 -0
- package/dist/state/api/column-from-index.d.ts +2 -0
- package/dist/state/api/column-from-index.js +6 -0
- package/dist/state/api/column-group-toggle.d.ts +2 -0
- package/dist/state/api/column-group-toggle.js +10 -0
- package/dist/state/api/column-index.d.ts +2 -0
- package/dist/state/api/column-index.js +7 -0
- package/dist/state/api/column-move.d.ts +2 -0
- package/dist/state/api/column-move.js +49 -0
- package/dist/state/api/column-resize.d.ts +2 -0
- package/dist/state/api/column-resize.js +9 -0
- package/dist/state/api/column-update.d.ts +5 -0
- package/dist/state/api/column-update.js +26 -0
- package/dist/state/api/dialog-frame.d.ts +8 -0
- package/dist/state/api/dialog-frame.js +16 -0
- package/dist/state/api/edit-begin.d.ts +5 -0
- package/dist/state/api/edit-begin.js +87 -0
- package/dist/state/api/edit-end.d.ts +5 -0
- package/dist/state/api/edit-end.js +43 -0
- package/dist/state/api/edit-is-cell-active.d.ts +5 -0
- package/dist/state/api/edit-is-cell-active.js +22 -0
- package/dist/state/api/edit-update.d.ts +5 -0
- package/dist/state/api/edit-update.js +88 -0
- package/dist/state/api/event-listeners.d.ts +5 -0
- package/dist/state/api/event-listeners.js +19 -0
- package/dist/state/api/export-csv.d.ts +3 -0
- package/dist/state/api/export-csv.js +40 -0
- package/dist/state/api/export-data-rect.d.ts +2 -0
- package/dist/state/api/export-data-rect.js +24 -0
- package/dist/state/api/focus-cell.d.ts +5 -0
- package/dist/state/api/focus-cell.js +117 -0
- package/dist/state/api/popover-frame.d.ts +8 -0
- package/dist/state/api/popover-frame.js +16 -0
- package/dist/state/api/position-from-element.d.ts +2 -0
- package/dist/state/api/position-from-element.js +9 -0
- package/dist/state/api/row-by-id.d.ts +2 -0
- package/dist/state/api/row-by-id.js +5 -0
- package/dist/state/api/row-by-index.d.ts +2 -0
- package/dist/state/api/row-by-index.js +9 -0
- package/dist/state/api/row-detail-is-expanded.d.ts +2 -0
- package/dist/state/api/row-detail-is-expanded.js +6 -0
- package/dist/state/api/row-detail-rendered-height.d.ts +5 -0
- package/dist/state/api/row-detail-rendered-height.js +14 -0
- package/dist/state/api/row-detail-toggle.d.ts +2 -0
- package/dist/state/api/row-detail-toggle.js +32 -0
- package/dist/state/api/row-group-apply-expansions.d.ts +2 -0
- package/dist/state/api/row-group-apply-expansions.js +20 -0
- package/dist/state/api/row-group-column-index.d.ts +2 -0
- package/dist/state/api/row-group-column-index.js +14 -0
- package/dist/state/api/row-group-is-expanded.d.ts +2 -0
- package/dist/state/api/row-group-is-expanded.js +15 -0
- package/dist/state/api/row-group-toggle.d.ts +2 -0
- package/dist/state/api/row-group-toggle.js +7 -0
- package/dist/state/api/row-handle-select.d.ts +5 -0
- package/dist/state/api/row-handle-select.js +43 -0
- package/dist/state/api/row-select-all.d.ts +2 -0
- package/dist/state/api/row-select-all.js +17 -0
- package/dist/state/api/row-select.d.ts +5 -0
- package/dist/state/api/row-select.js +35 -0
- package/dist/state/api/row-selected.d.ts +2 -0
- package/dist/state/api/row-selected.js +13 -0
- package/dist/state/api/scroll-into-view.d.ts +5 -0
- package/dist/state/api/scroll-into-view.js +50 -0
- package/dist/state/api/sort-for-column.d.ts +2 -0
- package/dist/state/api/sort-for-column.js +9 -0
- package/dist/state/api/use-row-drag.d.ts +2 -0
- package/dist/state/api/use-row-drag.js +27 -0
- package/dist/state/helpers/cell-row-group.d.ts +2 -0
- package/dist/state/helpers/cell-row-group.js +19 -0
- package/dist/state/helpers/column-add-row-group.d.ts +10 -0
- package/dist/state/helpers/column-add-row-group.js +74 -0
- package/dist/state/helpers/column-layout.d.ts +3 -0
- package/dist/state/helpers/column-layout.js +59 -0
- package/dist/state/helpers/column-marker.d.ts +8 -0
- package/dist/state/helpers/column-marker.js +43 -0
- package/dist/state/helpers/column-view.d.ts +21 -0
- package/dist/state/helpers/column-view.js +33 -0
- package/dist/state/helpers/edit-on-change.d.ts +15 -0
- package/dist/state/helpers/edit-on-change.js +27 -0
- package/dist/state/helpers/empty-row-data-source.d.ts +2 -0
- package/dist/state/helpers/empty-row-data-source.js +18 -0
- package/dist/state/helpers/get-data-rect.d.ts +13 -0
- package/dist/state/helpers/get-data-rect.js +65 -0
- package/dist/state/helpers/get-full-width-callback.d.ts +2 -0
- package/dist/state/helpers/get-full-width-callback.js +10 -0
- package/dist/state/helpers/get-span-callback.d.ts +2 -0
- package/dist/state/helpers/get-span-callback.js +22 -0
- package/dist/state/helpers/resolve-column.d.ts +4 -0
- package/dist/state/helpers/resolve-column.js +29 -0
- package/dist/state/helpers/row-layout/get-focus-criteria.d.ts +17 -0
- package/dist/state/helpers/row-layout/get-focus-criteria.js +62 -0
- package/dist/state/helpers/row-layout/row-layout.d.ts +19 -0
- package/dist/state/helpers/row-layout/row-layout.js +181 -0
- package/dist/state/use-lytenyte.d.ts +3 -0
- package/dist/state/use-lytenyte.js +671 -0
- package/dist/tree-view/branch/branch.d.ts +14 -0
- package/dist/tree-view/branch/branch.js +63 -0
- package/dist/tree-view/branch/use-branch-keys.d.ts +2 -0
- package/dist/tree-view/branch/use-branch-keys.js +87 -0
- package/dist/tree-view/context.d.ts +22 -0
- package/dist/tree-view/context.js +3 -0
- package/dist/tree-view/depth-provider.d.ts +2 -0
- package/dist/tree-view/depth-provider.js +3 -0
- package/dist/tree-view/hooks/use-tree-view-paths.d.ts +2 -0
- package/dist/tree-view/hooks/use-tree-view-paths.js +9 -0
- package/dist/tree-view/index.d.ts +16 -0
- package/dist/tree-view/index.js +16 -0
- package/dist/tree-view/leaf.d.ts +4 -0
- package/dist/tree-view/leaf.js +28 -0
- package/dist/tree-view/navigation/get-all-ids.d.ts +1 -0
- package/dist/tree-view/navigation/get-all-ids.js +7 -0
- package/dist/tree-view/navigation/get-first-node.d.ts +1 -0
- package/dist/tree-view/navigation/get-first-node.js +7 -0
- package/dist/tree-view/navigation/get-last-node.d.ts +1 -0
- package/dist/tree-view/navigation/get-last-node.js +7 -0
- package/dist/tree-view/navigation/get-next-node.d.ts +1 -0
- package/dist/tree-view/navigation/get-next-node.js +13 -0
- package/dist/tree-view/navigation/get-prev-node.d.ts +1 -0
- package/dist/tree-view/navigation/get-prev-node.js +13 -0
- package/dist/tree-view/panel/make-handle-navigation.d.ts +2 -0
- package/dist/tree-view/panel/make-handle-navigation.js +39 -0
- package/dist/tree-view/panel/make-handle-selection.d.ts +2 -0
- package/dist/tree-view/panel/make-handle-selection.js +92 -0
- package/dist/tree-view/panel/make-handle-typeahead.d.ts +1 -0
- package/dist/tree-view/panel/make-handle-typeahead.js +45 -0
- package/dist/tree-view/panel/panel.d.ts +1 -0
- package/dist/tree-view/panel/panel.js +30 -0
- package/dist/tree-view/panel/use-tree-navigation.d.ts +1 -0
- package/dist/tree-view/panel/use-tree-navigation.js +63 -0
- package/dist/tree-view/root.d.ts +17 -0
- package/dist/tree-view/root.js +63 -0
- package/dist/tree-view/utils/get-focusable-nodes.d.ts +1 -0
- package/dist/tree-view/utils/get-focusable-nodes.js +5 -0
- package/dist/tree-view/utils/get-focused-node.d.ts +1 -0
- package/dist/tree-view/utils/get-focused-node.js +14 -0
- package/dist/tree-view/utils/get-ids-between-nodes.d.ts +1 -0
- package/dist/tree-view/utils/get-ids-between-nodes.js +15 -0
- package/dist/tree-view/utils/get-panel.d.ts +1 -0
- package/dist/tree-view/utils/get-panel.js +7 -0
- package/dist/tree-view/utils/get-parent-node.d.ts +1 -0
- package/dist/tree-view/utils/get-parent-node.js +10 -0
- package/dist/tree-view/utils/get-sibling-branches.d.ts +1 -0
- package/dist/tree-view/utils/get-sibling-branches.js +14 -0
- package/dist/tree-view/utils/get-tree-node-id.d.ts +1 -0
- package/dist/tree-view/utils/get-tree-node-id.js +3 -0
- package/dist/tree-view/utils/is-branch-node.d.ts +1 -0
- package/dist/tree-view/utils/is-branch-node.js +3 -0
- package/dist/tree-view/utils/is-leaf-node.d.ts +1 -0
- package/dist/tree-view/utils/is-leaf-node.js +3 -0
- package/dist/tree-view/utils/is-tree-node-disabled.d.ts +1 -0
- package/dist/tree-view/utils/is-tree-node-disabled.js +3 -0
- package/dist/tree-view/utils/select-node.d.ts +2 -0
- package/dist/tree-view/utils/select-node.js +15 -0
- package/dist/tree-view/utils/toggle-all-selections.d.ts +2 -0
- package/dist/tree-view/utils/toggle-all-selections.js +9 -0
- package/dist/tree-view/utils/toggle-selection.d.ts +2 -0
- package/dist/tree-view/utils/toggle-selection.js +21 -0
- package/dist/tree-view/virtualized/force-sync-scrolling.d.ts +2 -0
- package/dist/tree-view/virtualized/force-sync-scrolling.js +23 -0
- package/dist/tree-view/virtualized/get-virtual-tree-paths.d.ts +2 -0
- package/dist/tree-view/virtualized/get-virtual-tree-paths.js +14 -0
- package/dist/tree-view/virtualized/make-virtual-tree.d.ts +31 -0
- package/dist/tree-view/virtualized/make-virtual-tree.js +90 -0
- package/dist/tree-view/virtualized/use-flattened-tree.d.ts +9 -0
- package/dist/tree-view/virtualized/use-flattened-tree.js +36 -0
- package/dist/tree-view/virtualized/use-row-start-and-end.d.ts +2 -0
- package/dist/tree-view/virtualized/use-row-start-and-end.js +27 -0
- package/dist/tree-view/virtualized/use-virtualized-tree.d.ts +22 -0
- package/dist/tree-view/virtualized/use-virtualized-tree.js +100 -0
- package/dist/types/types.d.ts +8 -0
- package/dist/types/types.js +1 -0
- package/dist/utils/cycle-sorts.d.ts +2 -0
- package/dist/utils/cycle-sorts.js +16 -0
- package/dist/viewport/begin-editing.d.ts +5 -0
- package/dist/viewport/begin-editing.js +15 -0
- package/dist/viewport/viewport.d.ts +1 -0
- package/dist/viewport/viewport.js +78 -0
- package/package.json +7 -7
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef, useEffect } from "react";
|
|
3
|
+
import { depthContext, useDepth } from "../depth-provider.js";
|
|
4
|
+
import { useEvent, useSlot, useTransitionedOpen, } from "@1771technologies/lytenyte-react-hooks";
|
|
5
|
+
import { useTreeRoot } from "../context.js";
|
|
6
|
+
import { useBranchKeys } from "./use-branch-keys.js";
|
|
7
|
+
export const TreeBranch = forwardRef(function TreeBranch({ itemId, label, expander, transitionEnterMs, transitionExitMs, gridWrapped, labelWrap, ...props }, forwarded) {
|
|
8
|
+
const depth = useDepth();
|
|
9
|
+
const root = useTreeRoot();
|
|
10
|
+
// Manage the open and close state of the branch
|
|
11
|
+
const expanded = root.expansions[itemId] ?? root.expansionDefault ?? false;
|
|
12
|
+
const { open, shouldMount, state, toggle } = useTransitionedOpen({
|
|
13
|
+
initial: expanded,
|
|
14
|
+
timeEnter: transitionEnterMs ?? root.transitionEnterMs,
|
|
15
|
+
timeExit: transitionExitMs ?? root.transitionExitMs,
|
|
16
|
+
});
|
|
17
|
+
const onExpansionChange = useEvent((b) => {
|
|
18
|
+
root.onExpansionChange({
|
|
19
|
+
...root.expansions,
|
|
20
|
+
[itemId]: b,
|
|
21
|
+
});
|
|
22
|
+
});
|
|
23
|
+
useEffect(() => {
|
|
24
|
+
if (expanded === open)
|
|
25
|
+
return;
|
|
26
|
+
toggle(expanded);
|
|
27
|
+
}, [expanded, open, toggle]);
|
|
28
|
+
// Component part rendering
|
|
29
|
+
const labelRendered = useSlot({
|
|
30
|
+
props: [],
|
|
31
|
+
slot: label ?? _jsx("div", {}),
|
|
32
|
+
});
|
|
33
|
+
const expandedProps = {
|
|
34
|
+
onClick: (e) => {
|
|
35
|
+
e.stopPropagation();
|
|
36
|
+
onExpansionChange(!expanded);
|
|
37
|
+
},
|
|
38
|
+
};
|
|
39
|
+
const expanderRendered = useSlot({
|
|
40
|
+
props: [expandedProps],
|
|
41
|
+
slot: expander ?? _jsx("button", { children: ">" }),
|
|
42
|
+
state: { toggle, expanded },
|
|
43
|
+
});
|
|
44
|
+
const wrapped = gridWrapped ?? root.gridWrappedBranches;
|
|
45
|
+
const labelWrapSlot = useSlot({
|
|
46
|
+
props: [
|
|
47
|
+
{
|
|
48
|
+
"data-tree-branch-label": true,
|
|
49
|
+
children: (_jsxs(_Fragment, { children: [expanderRendered, labelRendered] })),
|
|
50
|
+
},
|
|
51
|
+
],
|
|
52
|
+
slot: labelWrap ?? _jsx("div", {}),
|
|
53
|
+
});
|
|
54
|
+
return (_jsx(depthContext.Provider, { value: depth + 1, children: _jsxs("li", { ...props, onKeyDown: useBranchKeys(itemId, root.expansionDefault ?? false, props.onKeyDown), tabIndex: -1, ref: forwarded, role: "treeitem", "aria-expanded": open, "aria-selected": root.selection.has(itemId), "aria-level": depth + 1, "data-ln-selected": root.selection.has(itemId), "data-ln-tree-node": true, "data-ln-tree-branch": true, "data-ln-tree-id": itemId, style: {
|
|
55
|
+
...props.style,
|
|
56
|
+
"--ln-tree-depth": depth,
|
|
57
|
+
}, children: [labelWrapSlot, _jsx("div", { children: _jsx(Wrapped, { wrapped: wrapped, expanded: open, children: shouldMount && (_jsx("ul", { "data-tree-branch-children": true, "data-expanded": open, "data-open-state": state, role: "group", children: props.children })) }) })] }) }));
|
|
58
|
+
});
|
|
59
|
+
function Wrapped(props) {
|
|
60
|
+
if (!props.wrapped)
|
|
61
|
+
return _jsx(_Fragment, { children: props.children });
|
|
62
|
+
return (_jsx("div", { "data-tree-branch-grid-wrapped": true, "data-expanded": props.expanded, children: _jsx("div", { "data-tree-branch-grid-wrapped-content": true, children: props.children }) }));
|
|
63
|
+
}
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import { useEvent } from "@1771technologies/lytenyte-react-hooks";
|
|
2
|
+
import { useTreeRoot } from "../context.js";
|
|
3
|
+
import { getFocusableNodes } from "../utils/get-focusable-nodes.js";
|
|
4
|
+
import { getFocusedNode } from "../utils/get-focused-node.js";
|
|
5
|
+
import { isBranchNode } from "../utils/is-branch-node.js";
|
|
6
|
+
import { getTreeNodeId } from "../utils/get-tree-node-id.js";
|
|
7
|
+
import { getParentNode } from "../utils/get-parent-node.js";
|
|
8
|
+
import { getSiblingBranches } from "../utils/get-sibling-branches.js";
|
|
9
|
+
import { getFocusables } from "@1771technologies/lytenyte-dom-utils";
|
|
10
|
+
const accepted = ["ArrowRight", "ArrowLeft", "Enter", "*"];
|
|
11
|
+
export function useBranchKeys(id, defaultExpansion, current) {
|
|
12
|
+
const ctx = useTreeRoot();
|
|
13
|
+
const onKeyDown = useEvent((ev) => {
|
|
14
|
+
current?.(ev);
|
|
15
|
+
if (!accepted.includes(ev.key))
|
|
16
|
+
return;
|
|
17
|
+
const isExpanded = ctx.expansions[id] ?? defaultExpansion;
|
|
18
|
+
if (ev.key === "*") {
|
|
19
|
+
const node = getFocusedNode();
|
|
20
|
+
const siblings = getSiblingBranches(node);
|
|
21
|
+
const next = { ...ctx.expansions };
|
|
22
|
+
siblings?.forEach((c) => {
|
|
23
|
+
next[getTreeNodeId(c)] = true;
|
|
24
|
+
});
|
|
25
|
+
ctx.onExpansionChange(next);
|
|
26
|
+
ev.stopPropagation();
|
|
27
|
+
return;
|
|
28
|
+
}
|
|
29
|
+
if (ev.key === "Enter") {
|
|
30
|
+
if (ev.currentTarget !== ev.target)
|
|
31
|
+
return;
|
|
32
|
+
const next = { ...ctx.expansions };
|
|
33
|
+
next[id] = !isExpanded;
|
|
34
|
+
ctx.onExpansionChange(next);
|
|
35
|
+
return;
|
|
36
|
+
}
|
|
37
|
+
if (ev.key === "ArrowRight") {
|
|
38
|
+
const branch = getFocusedNode();
|
|
39
|
+
if (ev.currentTarget !== branch)
|
|
40
|
+
return;
|
|
41
|
+
if (!isExpanded) {
|
|
42
|
+
const next = { ...ctx.expansions };
|
|
43
|
+
next[id] = !(next[id] ?? defaultExpansion);
|
|
44
|
+
ctx.onExpansionChange(next);
|
|
45
|
+
return;
|
|
46
|
+
}
|
|
47
|
+
const childNodes = getFocusables(branch.firstElementChild);
|
|
48
|
+
if (childNodes.length > 1 && childNodes.at(-1) !== document.activeElement) {
|
|
49
|
+
const current = childNodes.indexOf(document.activeElement);
|
|
50
|
+
const index = current === -1 || current === 0 ? 1 : current + 1;
|
|
51
|
+
childNodes[index]?.focus();
|
|
52
|
+
return;
|
|
53
|
+
}
|
|
54
|
+
// Get the first focusable node.
|
|
55
|
+
const nodes = getFocusableNodes(branch);
|
|
56
|
+
nodes.at(0)?.focus();
|
|
57
|
+
}
|
|
58
|
+
if (ev.key === "ArrowLeft") {
|
|
59
|
+
const node = getFocusedNode();
|
|
60
|
+
// We need to collapse this node
|
|
61
|
+
if (isBranchNode(node) && isExpanded) {
|
|
62
|
+
// Ensure we don't collapse the node when the event bubbles and the left arrow
|
|
63
|
+
// was pressed on a child element. Pressing left arrow on the child will focus the
|
|
64
|
+
// parent, and then run the parent's on keydown handler.
|
|
65
|
+
if (ev.target !== ev.currentTarget &&
|
|
66
|
+
!ev.currentTarget.firstElementChild?.contains(document.activeElement))
|
|
67
|
+
return;
|
|
68
|
+
const next = { ...ctx.expansions };
|
|
69
|
+
const id = getTreeNodeId(node);
|
|
70
|
+
next[id] = false;
|
|
71
|
+
ctx.onExpansionChange(next);
|
|
72
|
+
return;
|
|
73
|
+
}
|
|
74
|
+
else {
|
|
75
|
+
const parent = getParentNode(node);
|
|
76
|
+
if (!parent) {
|
|
77
|
+
const focusNodes = getFocusableNodes(ctx.panel);
|
|
78
|
+
focusNodes.at(0)?.focus();
|
|
79
|
+
}
|
|
80
|
+
else {
|
|
81
|
+
parent.focus();
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
});
|
|
86
|
+
return onKeyDown;
|
|
87
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { type Dispatch, type SetStateAction } from "react";
|
|
2
|
+
export interface TreeViewRootContext {
|
|
3
|
+
readonly panel: HTMLUListElement | null;
|
|
4
|
+
readonly panelRef: Dispatch<SetStateAction<HTMLUListElement | null>>;
|
|
5
|
+
readonly expansions: Record<string, boolean>;
|
|
6
|
+
readonly onExpansionChange: (n: Record<string, boolean>) => void;
|
|
7
|
+
readonly expansionDefault: boolean;
|
|
8
|
+
readonly selectionMode: "single" | "multiple" | "none";
|
|
9
|
+
readonly selection: Set<string>;
|
|
10
|
+
readonly onSelectionChange: (c: Set<string>) => void;
|
|
11
|
+
readonly selectionPivotRef: {
|
|
12
|
+
current: string | null;
|
|
13
|
+
};
|
|
14
|
+
readonly transitionEnterMs: number;
|
|
15
|
+
readonly transitionExitMs: number;
|
|
16
|
+
readonly gridWrappedBranches: boolean;
|
|
17
|
+
readonly onFocusChange: (el: HTMLElement | null) => void;
|
|
18
|
+
readonly getAllIds: (panel: HTMLElement) => Set<string>;
|
|
19
|
+
readonly getIdsBetweenNodes: (start: HTMLElement, end: HTMLElement, panel: HTMLElement) => string[];
|
|
20
|
+
}
|
|
21
|
+
export declare const context: import("react").Context<TreeViewRootContext>;
|
|
22
|
+
export declare const useTreeRoot: () => TreeViewRootContext;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { type PathProvidedItem } from "@1771technologies/lytenyte-shared";
|
|
2
|
+
export declare function useTreeViewPaths<T extends PathProvidedItem>(paths: T[], nonAdjacentAreDistinct?: boolean): (import("@1771technologies/lytenyte-shared").PathBranch<T> | import("@1771technologies/lytenyte-shared").PathLeaf<T>)[];
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { computePathTree } from "@1771technologies/lytenyte-shared";
|
|
2
|
+
import { useMemo } from "react";
|
|
3
|
+
export function useTreeViewPaths(paths, nonAdjacentAreDistinct) {
|
|
4
|
+
const tree = useMemo(() => {
|
|
5
|
+
const result = computePathTree(paths, {}, nonAdjacentAreDistinct);
|
|
6
|
+
return [...result.children.values()];
|
|
7
|
+
}, [nonAdjacentAreDistinct, paths]);
|
|
8
|
+
return tree;
|
|
9
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { useTreeViewPaths } from "./hooks/use-tree-view-paths.js";
|
|
2
|
+
import { ForceSyncScrolling } from "./virtualized/force-sync-scrolling.js";
|
|
3
|
+
import { useVirtualizedTree } from "./virtualized/use-virtualized-tree.js";
|
|
4
|
+
export declare const Tree: {
|
|
5
|
+
Leaf: import("react").ForwardRefExoticComponent<Omit<import("react").ClassAttributes<HTMLLIElement> & import("react").LiHTMLAttributes<HTMLLIElement> & import("./leaf.js").TreeLeafProps, "ref"> & import("react").RefAttributes<HTMLLIElement>>;
|
|
6
|
+
Branch: import("react").ForwardRefExoticComponent<Omit<import("react").ClassAttributes<HTMLLIElement> & import("react").LiHTMLAttributes<HTMLLIElement> & import("./index.js").TreeBranchProps, "ref"> & import("react").RefAttributes<HTMLLIElement>>;
|
|
7
|
+
Root: import("react").ForwardRefExoticComponent<Omit<import("react").PropsWithChildren<import("./root.js").TreeRootProps>, "ref"> & import("react").RefAttributes<HTMLElement>>;
|
|
8
|
+
Panel: import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLUListElement>, HTMLUListElement>, "ref"> & import("react").RefAttributes<HTMLUListElement>>;
|
|
9
|
+
usePaths: typeof useTreeViewPaths;
|
|
10
|
+
useVirtualTree: typeof useVirtualizedTree;
|
|
11
|
+
ForceSyncScrolling: typeof ForceSyncScrolling;
|
|
12
|
+
};
|
|
13
|
+
export type { TreeRootProps } from "./root.js";
|
|
14
|
+
export type { TreeBranchProps } from "./branch/branch.js";
|
|
15
|
+
export type { TreeLeafProps } from "./leaf.js";
|
|
16
|
+
export type { VirtualizedTreeViewPathsArgs } from "./virtualized/use-virtualized-tree.js";
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { TreeBranch } from "./branch/branch.js";
|
|
2
|
+
import { useTreeViewPaths } from "./hooks/use-tree-view-paths.js";
|
|
3
|
+
import { TreeLeaf } from "./leaf.js";
|
|
4
|
+
import { TreePanel } from "./panel/panel.js";
|
|
5
|
+
import { TreeRoot } from "./root.js";
|
|
6
|
+
import { ForceSyncScrolling } from "./virtualized/force-sync-scrolling.js";
|
|
7
|
+
import { useVirtualizedTree } from "./virtualized/use-virtualized-tree.js";
|
|
8
|
+
export const Tree = {
|
|
9
|
+
Leaf: TreeLeaf,
|
|
10
|
+
Branch: TreeBranch,
|
|
11
|
+
Root: TreeRoot,
|
|
12
|
+
Panel: TreePanel,
|
|
13
|
+
usePaths: useTreeViewPaths,
|
|
14
|
+
useVirtualTree: useVirtualizedTree,
|
|
15
|
+
ForceSyncScrolling,
|
|
16
|
+
};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export interface TreeLeafProps {
|
|
2
|
+
readonly itemId: string;
|
|
3
|
+
}
|
|
4
|
+
export declare const TreeLeaf: import("react").ForwardRefExoticComponent<Omit<import("react").ClassAttributes<HTMLLIElement> & import("react").LiHTMLAttributes<HTMLLIElement> & TreeLeafProps, "ref"> & import("react").RefAttributes<HTMLLIElement>>;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef } from "react";
|
|
3
|
+
import { useDepth } from "./depth-provider.js";
|
|
4
|
+
import { useTreeRoot } from "./context.js";
|
|
5
|
+
import { getFocusables } from "@1771technologies/lytenyte-dom-utils";
|
|
6
|
+
export const TreeLeaf = forwardRef(function TreeLeaf({ itemId, ...props }, forwarded) {
|
|
7
|
+
const depth = useDepth();
|
|
8
|
+
const root = useTreeRoot();
|
|
9
|
+
return (_jsx("li", { ...props, tabIndex: -1, "data-ln-tree-node": true, "data-ln-tree-leaf": true, "data-ln-selected": root.selection.has(itemId), "data-ln-tree-id": itemId, onKeyDown: (e) => {
|
|
10
|
+
props.onKeyDown?.(e);
|
|
11
|
+
if ((e.key !== "ArrowLeft" && e.key !== "ArrowRight") ||
|
|
12
|
+
e.metaKey ||
|
|
13
|
+
e.ctrlKey ||
|
|
14
|
+
e.shiftKey)
|
|
15
|
+
return;
|
|
16
|
+
e.preventDefault();
|
|
17
|
+
const nodes = getFocusables(e.currentTarget);
|
|
18
|
+
const index = nodes.indexOf(document.activeElement);
|
|
19
|
+
if (index === -1) {
|
|
20
|
+
nodes.at(0)?.focus();
|
|
21
|
+
return;
|
|
22
|
+
}
|
|
23
|
+
if (e.key === "ArrowLeft")
|
|
24
|
+
nodes[index === 0 ? nodes.length - 1 : index - 1].focus();
|
|
25
|
+
else
|
|
26
|
+
nodes[index === nodes.length - 1 ? 0 : index + 1].focus();
|
|
27
|
+
}, ref: forwarded, role: "treeitem", "aria-level": depth + 1, "aria-selected": root.selection.has(itemId), style: { ...props.style, "--tree-depth": depth }, children: props.children }));
|
|
28
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function getAllIds(panel: HTMLElement): Set<string>;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { getFocusableNodes } from "../utils/get-focusable-nodes.js";
|
|
2
|
+
import { getTreeNodeId } from "../utils/get-tree-node-id.js";
|
|
3
|
+
export function getAllIds(panel) {
|
|
4
|
+
const focusables = getFocusableNodes(panel);
|
|
5
|
+
const allIds = new Set(focusables.map((c) => getTreeNodeId(c)));
|
|
6
|
+
return allIds;
|
|
7
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function getFirstNode(panel: HTMLElement): HTMLElement | undefined;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { getFocusableNodes } from "../utils/get-focusable-nodes.js";
|
|
2
|
+
import { isTreeNodeDisabled } from "../utils/is-tree-node-disabled.js";
|
|
3
|
+
export function getFirstNode(panel) {
|
|
4
|
+
const focusables = getFocusableNodes(panel);
|
|
5
|
+
const first = focusables.find((c) => !isTreeNodeDisabled(c));
|
|
6
|
+
return first;
|
|
7
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function getLastNode(panel: HTMLElement): HTMLElement | undefined;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { getFocusableNodes } from "../utils/get-focusable-nodes.js";
|
|
2
|
+
import { isTreeNodeDisabled } from "../utils/is-tree-node-disabled.js";
|
|
3
|
+
export function getLastNode(panel) {
|
|
4
|
+
const focusables = getFocusableNodes(panel);
|
|
5
|
+
const first = focusables.findLast((c) => !isTreeNodeDisabled(c));
|
|
6
|
+
return first;
|
|
7
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function getNextNode(el: HTMLElement): HTMLElement | undefined;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { getFocusableNodes } from "../utils/get-focusable-nodes.js";
|
|
2
|
+
import { getPanel } from "../utils/get-panel.js";
|
|
3
|
+
// Assumes that el is a branch or leaf node
|
|
4
|
+
export function getNextNode(el) {
|
|
5
|
+
const panel = getPanel(el);
|
|
6
|
+
if (!panel)
|
|
7
|
+
return;
|
|
8
|
+
const focusables = getFocusableNodes(panel);
|
|
9
|
+
const index = focusables.indexOf(el);
|
|
10
|
+
if (index === -1)
|
|
11
|
+
return;
|
|
12
|
+
return focusables.at(index + 1);
|
|
13
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function getPrevNode(el: HTMLElement): HTMLElement | undefined;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { getFocusableNodes } from "../utils/get-focusable-nodes.js";
|
|
2
|
+
import { getPanel } from "../utils/get-panel.js";
|
|
3
|
+
// Assumes that el is a branch or leaf node
|
|
4
|
+
export function getPrevNode(el) {
|
|
5
|
+
const panel = getPanel(el);
|
|
6
|
+
if (!panel)
|
|
7
|
+
return;
|
|
8
|
+
const focusables = getFocusableNodes(panel);
|
|
9
|
+
const index = focusables.indexOf(el);
|
|
10
|
+
if (index === -1)
|
|
11
|
+
return;
|
|
12
|
+
return focusables[index - 1];
|
|
13
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { isInView } from "@1771technologies/lytenyte-dom-utils";
|
|
2
|
+
import { getFirstNode } from "../navigation/get-first-node.js";
|
|
3
|
+
import { getLastNode } from "../navigation/get-last-node.js";
|
|
4
|
+
import { getNextNode } from "../navigation/get-next-node.js";
|
|
5
|
+
import { getPrevNode } from "../navigation/get-prev-node.js";
|
|
6
|
+
import { getFocusedNode } from "../utils/get-focused-node.js";
|
|
7
|
+
export function makeHandleNavigation(ctx) {
|
|
8
|
+
const acceptedKeys = ["ArrowUp", "ArrowDown", "Home", "End"];
|
|
9
|
+
return (ev) => {
|
|
10
|
+
if (!acceptedKeys.includes(ev.key) || ev.shiftKey || ev.ctrlKey || ev.metaKey)
|
|
11
|
+
return;
|
|
12
|
+
const current = getFocusedNode();
|
|
13
|
+
if (!current)
|
|
14
|
+
return;
|
|
15
|
+
if (ev.key === "ArrowUp") {
|
|
16
|
+
const prev = getPrevNode(current);
|
|
17
|
+
if (!prev)
|
|
18
|
+
return;
|
|
19
|
+
const inView = isInView(prev, ctx.panel);
|
|
20
|
+
if (!inView)
|
|
21
|
+
prev?.scrollIntoView({ behavior: "instant", block: "start" });
|
|
22
|
+
prev?.focus();
|
|
23
|
+
}
|
|
24
|
+
if (ev.key === "ArrowDown") {
|
|
25
|
+
const node = getNextNode(current);
|
|
26
|
+
if (!node)
|
|
27
|
+
return;
|
|
28
|
+
const inView = isInView(node, ctx.panel);
|
|
29
|
+
if (!inView)
|
|
30
|
+
node?.scrollIntoView({ behavior: "instant", block: "end" });
|
|
31
|
+
node?.focus();
|
|
32
|
+
}
|
|
33
|
+
if (ev.key === "Home")
|
|
34
|
+
getFirstNode(ctx.panel)?.focus();
|
|
35
|
+
if (ev.key === "End")
|
|
36
|
+
getLastNode(ctx.panel)?.focus();
|
|
37
|
+
ev.preventDefault();
|
|
38
|
+
};
|
|
39
|
+
}
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import { isInView } from "@1771technologies/lytenyte-dom-utils";
|
|
2
|
+
import { getFirstNode } from "../navigation/get-first-node.js";
|
|
3
|
+
import { getLastNode } from "../navigation/get-last-node.js";
|
|
4
|
+
import { getNextNode } from "../navigation/get-next-node.js";
|
|
5
|
+
import { getPrevNode } from "../navigation/get-prev-node.js";
|
|
6
|
+
import { getFocusableNodes } from "../utils/get-focusable-nodes.js";
|
|
7
|
+
import { getFocusedNode } from "../utils/get-focused-node.js";
|
|
8
|
+
import { getIdsBetweenNodes } from "../utils/get-ids-between-nodes.js";
|
|
9
|
+
import { getTreeNodeId } from "../utils/get-tree-node-id.js";
|
|
10
|
+
import { selectNode } from "../utils/select-node.js";
|
|
11
|
+
import { toggleAllSelections } from "../utils/toggle-all-selections.js";
|
|
12
|
+
import { toggleSelection } from "../utils/toggle-selection.js";
|
|
13
|
+
export function makeHandleSelection(ctx) {
|
|
14
|
+
const acceptedKeys = ["Enter", "Home", "End", "ArrowDown", "ArrowUp", "Space", " ", "a"];
|
|
15
|
+
const make = (ev) => {
|
|
16
|
+
if (ctx.selectionMode === "none")
|
|
17
|
+
return;
|
|
18
|
+
if (!acceptedKeys.includes(ev.key))
|
|
19
|
+
return;
|
|
20
|
+
ev.preventDefault();
|
|
21
|
+
const pivot = ctx.selectionPivotRef.current;
|
|
22
|
+
if (ev.key === " " && (ctx.selectionMode === "single" || !ev.shiftKey || !pivot)) {
|
|
23
|
+
const node = getFocusedNode();
|
|
24
|
+
toggleSelection(node, ctx);
|
|
25
|
+
return;
|
|
26
|
+
}
|
|
27
|
+
if (ctx.selectionMode !== "multiple")
|
|
28
|
+
return;
|
|
29
|
+
const focusables = getFocusableNodes(ctx.panel);
|
|
30
|
+
const focused = getFocusedNode();
|
|
31
|
+
const focusedIndex = focusables.indexOf(focused);
|
|
32
|
+
if (focusedIndex === -1)
|
|
33
|
+
return;
|
|
34
|
+
if (ev.ctrlKey || ev.metaKey) {
|
|
35
|
+
if (ev.key === "a") {
|
|
36
|
+
ev.preventDefault();
|
|
37
|
+
toggleAllSelections(ctx);
|
|
38
|
+
return;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
if (!ev.shiftKey)
|
|
42
|
+
return;
|
|
43
|
+
if (ev.key === "ArrowUp" && focusedIndex !== 0) {
|
|
44
|
+
const node = getPrevNode(focused);
|
|
45
|
+
if (!isInView(node, ctx.panel))
|
|
46
|
+
node?.scrollIntoView({ behavior: "instant", block: "start" });
|
|
47
|
+
selectNode(node, ctx, true);
|
|
48
|
+
return;
|
|
49
|
+
}
|
|
50
|
+
if (ev.key === "ArrowDown" && focusedIndex !== focusables.length) {
|
|
51
|
+
const node = getNextNode(focused);
|
|
52
|
+
if (!isInView(node, ctx.panel))
|
|
53
|
+
node?.scrollIntoView({ behavior: "instant", block: "end" });
|
|
54
|
+
selectNode(node, ctx, true);
|
|
55
|
+
return;
|
|
56
|
+
}
|
|
57
|
+
if (ev.key === " ") {
|
|
58
|
+
const pivotNode = focusables.find((c) => getTreeNodeId(c) === pivot);
|
|
59
|
+
if (!pivotNode)
|
|
60
|
+
return;
|
|
61
|
+
const ids = ctx.getIdsBetweenNodes(pivotNode, focused, ctx.panel);
|
|
62
|
+
const next = new Set(ctx.selection);
|
|
63
|
+
ids.forEach((c) => next.add(c));
|
|
64
|
+
ctx.onSelectionChange(next);
|
|
65
|
+
ctx.selectionPivotRef.current = getTreeNodeId(focused);
|
|
66
|
+
return;
|
|
67
|
+
}
|
|
68
|
+
if (!ev.ctrlKey && !ev.metaKey)
|
|
69
|
+
return;
|
|
70
|
+
if (ev.key === "Home") {
|
|
71
|
+
const firstNode = getFirstNode(ctx.panel);
|
|
72
|
+
const ids = getIdsBetweenNodes(firstNode, focused, ctx.panel);
|
|
73
|
+
const next = new Set(ctx.selection);
|
|
74
|
+
ids.forEach((c) => next.add(c));
|
|
75
|
+
ctx.onSelectionChange(next);
|
|
76
|
+
firstNode?.focus();
|
|
77
|
+
ctx.selectionPivotRef.current = getTreeNodeId(firstNode);
|
|
78
|
+
return;
|
|
79
|
+
}
|
|
80
|
+
if (ev.key === "End") {
|
|
81
|
+
const lastNode = getLastNode(ctx.panel);
|
|
82
|
+
const ids = ctx.getIdsBetweenNodes(focused, lastNode, ctx.panel);
|
|
83
|
+
const next = new Set(ctx.selection);
|
|
84
|
+
ids.forEach((c) => next.add(c));
|
|
85
|
+
ctx.onSelectionChange(next);
|
|
86
|
+
lastNode?.focus();
|
|
87
|
+
ctx.selectionPivotRef.current = getTreeNodeId(lastNode);
|
|
88
|
+
return;
|
|
89
|
+
}
|
|
90
|
+
};
|
|
91
|
+
return make;
|
|
92
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function makeHandleTypeahead(): (panel: HTMLElement, ev: KeyboardEvent) => void;
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { getFocusableNodes } from "../utils/get-focusable-nodes.js";
|
|
2
|
+
import { getFocusedNode } from "../utils/get-focused-node.js";
|
|
3
|
+
import { isBranchNode } from "../utils/is-branch-node.js";
|
|
4
|
+
export function makeHandleTypeahead() {
|
|
5
|
+
let typeaheadCapture = [];
|
|
6
|
+
let typeaheadTimeout = null;
|
|
7
|
+
const handleTypeahead = (panel, ev) => {
|
|
8
|
+
if (ev.ctrlKey || ev.shiftKey || ev.metaKey)
|
|
9
|
+
return;
|
|
10
|
+
if (ev.key.length === 1 && ev.key.match(/[\S\s]/) && ev.key != " ") {
|
|
11
|
+
// Begin the typeahead.
|
|
12
|
+
typeaheadCapture.push(ev.key);
|
|
13
|
+
if (typeaheadTimeout)
|
|
14
|
+
clearTimeout(typeaheadTimeout);
|
|
15
|
+
typeaheadTimeout = setTimeout(() => {
|
|
16
|
+
const text = typeaheadCapture.join("");
|
|
17
|
+
const nodes = getFocusableNodes(panel);
|
|
18
|
+
const focused = getFocusedNode();
|
|
19
|
+
if (!focused)
|
|
20
|
+
return;
|
|
21
|
+
const index = nodes.indexOf(focused);
|
|
22
|
+
if (index === -1)
|
|
23
|
+
return;
|
|
24
|
+
const nodesAfterCurrent = nodes.slice(index);
|
|
25
|
+
const nodeToFocus = nodesAfterCurrent.find((c) => {
|
|
26
|
+
let textContent = "";
|
|
27
|
+
if (isBranchNode(c)) {
|
|
28
|
+
// On a branch node the text content of the expanded should not be included. We should simply
|
|
29
|
+
// look at the text content of the node.
|
|
30
|
+
textContent = c.firstElementChild?.lastElementChild?.textContent ?? "";
|
|
31
|
+
}
|
|
32
|
+
else {
|
|
33
|
+
textContent = c.textContent ?? "";
|
|
34
|
+
}
|
|
35
|
+
return textContent?.toLowerCase()?.startsWith(text);
|
|
36
|
+
});
|
|
37
|
+
if (nodeToFocus)
|
|
38
|
+
nodeToFocus.focus();
|
|
39
|
+
typeaheadCapture = [];
|
|
40
|
+
typeaheadTimeout = null;
|
|
41
|
+
}, 300);
|
|
42
|
+
}
|
|
43
|
+
};
|
|
44
|
+
return handleTypeahead;
|
|
45
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const TreePanel: import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLUListElement>, HTMLUListElement>, "ref"> & import("react").RefAttributes<HTMLUListElement>>;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef, useRef } from "react";
|
|
3
|
+
import { depthContext } from "../depth-provider.js";
|
|
4
|
+
import { useTreeRoot } from "../context.js";
|
|
5
|
+
import { useForkRef } from "@1771technologies/lytenyte-react-hooks";
|
|
6
|
+
import { useTreeNavigation } from "./use-tree-navigation.js";
|
|
7
|
+
import { getFocusedNode } from "../utils/get-focused-node.js";
|
|
8
|
+
import { getFirstNode } from "../navigation/get-first-node.js";
|
|
9
|
+
export const TreePanel = forwardRef(function TreePanel(props, forwarded) {
|
|
10
|
+
const ctx = useTreeRoot();
|
|
11
|
+
const ref = useForkRef(ctx.panelRef, forwarded);
|
|
12
|
+
const focused = useTreeNavigation();
|
|
13
|
+
const focusTime = useRef(null);
|
|
14
|
+
return (_jsxs(depthContext.Provider, { value: 0, children: [_jsx("ul", { ...props, role: "tree", ref: ref, tabIndex: focused ? -1 : 0, "aria-multiselectable": ctx.selectionMode === "multiple", "aria-orientation": "vertical", "data-ln-tree-panel": true, onFocus: () => {
|
|
15
|
+
if (focusTime.current) {
|
|
16
|
+
clearTimeout(focusTime.current);
|
|
17
|
+
focusTime.current = null;
|
|
18
|
+
}
|
|
19
|
+
ctx.onFocusChange(getFocusedNode());
|
|
20
|
+
}, onBlur: () => {
|
|
21
|
+
if (focusTime.current)
|
|
22
|
+
return;
|
|
23
|
+
focusTime.current = setTimeout(() => {
|
|
24
|
+
ctx.onFocusChange(null);
|
|
25
|
+
focusTime.current = null;
|
|
26
|
+
}, 20);
|
|
27
|
+
}, children: props.children }), _jsx("div", { role: "presentation", tabIndex: focused ? -1 : 0, onFocus: () => {
|
|
28
|
+
getFirstNode(ctx.panel)?.focus();
|
|
29
|
+
} })] }));
|
|
30
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function useTreeNavigation(): boolean;
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { useEffect, useState } from "react";
|
|
2
|
+
import { useTreeRoot } from "../context.js";
|
|
3
|
+
import { getFocusableNodes } from "../utils/get-focusable-nodes.js";
|
|
4
|
+
import { makeHandleTypeahead } from "./make-handle-typeahead.js";
|
|
5
|
+
import { makeHandleNavigation } from "./make-handle-navigation.js";
|
|
6
|
+
import { makeHandleSelection } from "./make-handle-selection.js";
|
|
7
|
+
import { getTreeNodeId } from "../utils/get-tree-node-id.js";
|
|
8
|
+
import { getTabbables } from "@1771technologies/lytenyte-dom-utils";
|
|
9
|
+
export function useTreeNavigation() {
|
|
10
|
+
const ctx = useTreeRoot();
|
|
11
|
+
const [focused, setFocused] = useState(false);
|
|
12
|
+
const panel = ctx.panel;
|
|
13
|
+
useEffect(() => {
|
|
14
|
+
if (!panel)
|
|
15
|
+
return;
|
|
16
|
+
const controller = new AbortController();
|
|
17
|
+
panel.addEventListener("focus", () => {
|
|
18
|
+
const focusNodes = getFocusableNodes(panel);
|
|
19
|
+
if (ctx.selectionMode !== "none" && ctx.selection.size > 0) {
|
|
20
|
+
const node = focusNodes.find((c) => ctx.selection.has(getTreeNodeId(c)));
|
|
21
|
+
if (node) {
|
|
22
|
+
node.focus();
|
|
23
|
+
return;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
focusNodes.at(0)?.focus();
|
|
27
|
+
}, { signal: controller.signal });
|
|
28
|
+
panel.addEventListener("focusin", () => {
|
|
29
|
+
setFocused(true);
|
|
30
|
+
}, { signal: controller.signal });
|
|
31
|
+
panel.addEventListener("focusout", () => {
|
|
32
|
+
setFocused(false);
|
|
33
|
+
}, { signal: controller.signal });
|
|
34
|
+
const handleTypeahead = makeHandleTypeahead();
|
|
35
|
+
const handleNavigation = makeHandleNavigation(ctx);
|
|
36
|
+
const handleSelection = makeHandleSelection(ctx);
|
|
37
|
+
panel.addEventListener("keydown", (ev) => {
|
|
38
|
+
handleTypeahead(panel, ev);
|
|
39
|
+
handleNavigation(ev);
|
|
40
|
+
handleSelection(ev);
|
|
41
|
+
if (ev.key === "Tab") {
|
|
42
|
+
const els = getTabbables(panel);
|
|
43
|
+
if (!els.length)
|
|
44
|
+
return;
|
|
45
|
+
const original = els.map((el) => {
|
|
46
|
+
const o = el.getAttribute("tabindex");
|
|
47
|
+
el.tabIndex = -1;
|
|
48
|
+
return o;
|
|
49
|
+
});
|
|
50
|
+
requestAnimationFrame(() => {
|
|
51
|
+
els.forEach((el, i) => {
|
|
52
|
+
if (original[i] == null)
|
|
53
|
+
el.removeAttribute("tabindex");
|
|
54
|
+
else
|
|
55
|
+
el.setAttribute("tabindex", original[i]);
|
|
56
|
+
});
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
}, { signal: controller.signal });
|
|
60
|
+
return () => controller.abort();
|
|
61
|
+
}, [ctx, focused, panel]);
|
|
62
|
+
return focused;
|
|
63
|
+
}
|