@1771technologies/lytenyte-pro 0.9.4 → 1.0.0-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -2
- package/dist/+types.d.ts +5299 -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.js +272 -0
- package/dist/{types/cell-selection → cell-selection}/cell-style-row.d.ts +2 -2
- 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 +86 -0
- package/dist/cell-selection/index.d.ts +19 -0
- package/dist/cell-selection/index.js +19 -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 +39 -0
- package/dist/cell-selection/split-cell-selection-rect.js +79 -0
- package/dist/cell-selection/update-additive-cell-selection.d.ts +5 -0
- package/dist/cell-selection/update-additive-cell-selection.js +25 -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/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 +96 -0
- package/dist/cells/cell.d.ts +7 -0
- package/dist/cells/cell.js +37 -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 +9 -0
- package/dist/column-manager/branch.js +38 -0
- package/dist/column-manager/column-manager.d.ts +15 -0
- package/dist/column-manager/column-manager.js +20 -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 +40 -0
- package/dist/column-manager/move-handle.d.ts +12 -0
- package/dist/column-manager/move-handle.js +58 -0
- package/dist/column-manager/passive-scroll.d.ts +2 -0
- package/dist/column-manager/passive-scroll.js +2 -0
- package/dist/column-manager/root.d.ts +9 -0
- package/dist/column-manager/root.js +20 -0
- package/dist/column-manager/use-column-manager.d.ts +19 -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 +10 -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 +37 -0
- package/dist/filter-tree/hooks/use-filter-tree.js +96 -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 +12 -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 +13 -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 +7 -0
- package/dist/grid-box/item.js +33 -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 +60 -0
- package/dist/grid-box/use-column-box-items.d.ts +31 -0
- package/dist/grid-box/use-column-box-items.js +81 -0
- package/dist/grid-box/use-row-group-box-items.d.ts +18 -0
- package/dist/grid-box/use-row-group-box-items.js +134 -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 +29 -0
- package/dist/grid.js +38 -0
- package/dist/header/header-cell.d.ts +10 -0
- package/dist/header/header-cell.js +24 -0
- package/dist/header/header-group-cell.d.ts +5 -0
- package/dist/header/header-group-cell.js +14 -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 +10 -0
- package/dist/header/resize-handler.d.ts +12 -0
- package/dist/header/resize-handler.js +128 -0
- package/dist/header/use-drag-move.d.ts +14 -0
- package/dist/header/use-drag-move.js +90 -0
- package/dist/header/use-header-cell-renderer.d.ts +4 -0
- package/dist/header/use-header-cell-renderer.js +36 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.js +6 -3860
- package/dist/license.d.ts +2 -0
- package/dist/license.js +217 -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.js +21 -0
- package/dist/root/popover-driver.js +21 -0
- package/dist/root/root.d.ts +8 -0
- package/dist/root/root.js +120 -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 +538 -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 +667 -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 +513 -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 +51 -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/use-server-data-source.d.ts +3 -0
- package/dist/row-data-source-server/use-server-data-source.js +679 -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 +6 -0
- package/dist/rows/row/context.js +3 -0
- package/dist/rows/row/row.d.ts +7 -0
- package/dist/rows/row/row.js +16 -0
- package/dist/rows/row/use-row-context-value.d.ts +6 -0
- package/dist/rows/row/use-row-context-value.js +29 -0
- package/dist/rows/row-detail-row.d.ts +4 -0
- package/dist/rows/row-detail-row.js +131 -0
- package/dist/rows/row-full-width.d.ts +8 -0
- package/dist/rows/row-full-width.js +17 -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 +18 -0
- package/dist/{types/sort-manager/use-sort-state.d.ts → sort-manager/+types.d.ts} +5 -2
- 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/{types/sort-manager/sort-manager-container.d.ts → sort-manager/hooks/use-sort-row-item.d.ts} +5 -7
- 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 +57 -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 +49 -0
- package/dist/state/+types.d.ts +34 -0
- package/dist/state/+types.js +1 -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 +2 -0
- package/dist/state/api/column-update.js +13 -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 +91 -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 +27 -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 +9 -0
- package/dist/state/helpers/column-add-row-group.js +66 -0
- package/dist/state/helpers/column-layout.d.ts +3 -0
- package/dist/state/helpers/column-layout.js +65 -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 +26 -0
- package/dist/state/helpers/empty-row-data-source.d.ts +2 -0
- package/dist/state/helpers/empty-row-data-source.js +17 -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 +8 -0
- package/dist/state/helpers/get-span-callback.d.ts +2 -0
- package/dist/state/helpers/get-span-callback.js +20 -0
- package/dist/state/helpers/resolve-column.d.ts +4 -0
- package/dist/state/helpers/resolve-column.js +22 -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 +18 -0
- package/dist/state/helpers/row-layout/row-layout.js +414 -0
- package/dist/state/use-lytenyte.d.ts +3 -0
- package/dist/state/use-lytenyte.js +579 -0
- package/dist/tree-view/branch/branch.d.ts +11 -0
- package/dist/tree-view/branch/branch.js +61 -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 +27 -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 -13
- 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 +77 -0
- package/main.css +315 -0
- package/package.json +29 -77
- package/dist/CompositeList-CGRaS6LQ.js +0 -149
- package/dist/DialogPortalContext-C2WZTqJ3.js +0 -47
- package/dist/DirectionContext-DIPP5cAe.js +0 -15
- package/dist/InternalBackdrop-C4RACVzs.js +0 -324
- package/dist/PopoverPortalContext-BdsDjihw.js +0 -26
- package/dist/anchor-context-Cqr_oiJt.js +0 -11
- package/dist/arrow-down-icon-B-3ldODD.js +0 -27
- package/dist/column-manager.js +0 -1228
- package/dist/column-menu-driver-cG-EZgLa.js +0 -491
- package/dist/cross-icon-CEMLAlFX.js +0 -20
- package/dist/dialog.js +0 -506
- package/dist/drag-store-BMsDBUy_.js +0 -1039
- package/dist/filter-manager.js +0 -1057
- package/dist/getPseudoElementBounds-BSHt6WYm.js +0 -26
- package/dist/grid-container.js +0 -18
- package/dist/icons.js +0 -516
- package/dist/lytenyte-pro.css +0 -2167
- package/dist/manage-columns-icon-D4CElo5H.js +0 -146
- package/dist/menu-lIx6h6Vn.js +0 -1885
- package/dist/menu.js +0 -4
- package/dist/more-dots-icon-CzAH3xHG.js +0 -26
- package/dist/pill-BHBLeJ6k.js +0 -1012
- package/dist/pill-manager.js +0 -737
- package/dist/plus-icon-ToqW5CC-.js +0 -15
- package/dist/popover.js +0 -795
- package/dist/proptypes-BjYr2nFr.js +0 -6472
- package/dist/row-group-icon-DFUMye0v.js +0 -186
- package/dist/search-icon-CcG1lqsn.js +0 -86
- package/dist/select-Db5ksjoS.js +0 -2256
- package/dist/separator-BnPPeAk8.js +0 -21
- package/dist/sort-descending-BMtfaa2L.js +0 -34
- package/dist/sort-manager.js +0 -308
- package/dist/tickmark-icon-CoogRMoO.js +0 -51
- package/dist/types/anchor-context/anchor-context.d.ts +0 -6
- package/dist/types/cell-selection/cell-selection-containers.d.ts +0 -3
- package/dist/types/column-manager/column-manager-context.d.ts +0 -12
- package/dist/types/column-manager/column-manager-drag-box-controls.d.ts +0 -1
- package/dist/types/column-manager/column-manager-drag-box-expander.d.ts +0 -1
- package/dist/types/column-manager/column-manager-drag-box-label.d.ts +0 -5
- package/dist/types/column-manager/column-manager-drag-box.d.ts +0 -13
- package/dist/types/column-manager/column-manager-drag-placeholder.d.ts +0 -5
- package/dist/types/column-manager/column-manager-drop-zone.d.ts +0 -10
- package/dist/types/column-manager/column-manager-impl.d.ts +0 -36
- package/dist/types/column-manager/column-manager-pill.d.ts +0 -4
- package/dist/types/column-manager/column-manager-pivot-mode-toggle.d.ts +0 -1
- package/dist/types/column-manager/column-manager-search.d.ts +0 -1
- package/dist/types/column-manager/column-manager-state.d.ts +0 -8
- package/dist/types/column-manager/column-manager-tree-item.d.ts +0 -6
- package/dist/types/column-manager/column-manager-tree.d.ts +0 -11
- package/dist/types/column-manager/column-manager-types.d.ts +0 -1
- package/dist/types/column-manager/column-manager.d.ts +0 -1
- package/dist/types/column-manager/utils/all-leafs.d.ts +0 -3
- package/dist/types/column-manager/utils/can-hide-item.d.ts +0 -3
- package/dist/types/column-manager/utils/handle-item-hide.d.ts +0 -3
- package/dist/types/components-internal/button/button.d.ts +0 -9
- package/dist/types/components-internal/grid-frame/grid-frame.d.ts +0 -11
- package/dist/types/components-internal/radio/radio.d.ts +0 -5
- package/dist/types/components-internal/separator/separator.d.ts +0 -8
- package/dist/types/components-internal/toggle/toggle.d.ts +0 -7
- package/dist/types/dialog/dialog-impl.d.ts +0 -6
- package/dist/types/dialog/dialog.d.ts +0 -8
- package/dist/types/dialog/use-dialog-class.d.ts +0 -1
- package/dist/types/external.d.ts +0 -2
- package/dist/types/filter-manager/combined-to-flat.d.ts +0 -3
- package/dist/types/filter-manager/components/apply-filter-button.d.ts +0 -1
- package/dist/types/filter-manager/components/clear-filter-button.d.ts +0 -1
- package/dist/types/filter-manager/components/flatten-tree-items.d.ts +0 -4
- package/dist/types/filter-manager/components/get-child-values.d.ts +0 -2
- package/dist/types/filter-manager/components/in-filter-container.d.ts +0 -1
- package/dist/types/filter-manager/components/in-filter-error.d.ts +0 -5
- package/dist/types/filter-manager/components/in-filter-loading.d.ts +0 -1
- package/dist/types/filter-manager/components/in-filter-root.d.ts +0 -11
- package/dist/types/filter-manager/components/in-filter-tree.d.ts +0 -15
- package/dist/types/filter-manager/components/simple-filter-additional-switch.d.ts +0 -1
- package/dist/types/filter-manager/components/simple-filter-operator/date-operator.d.ts +0 -1
- package/dist/types/filter-manager/components/simple-filter-operator/number-operator.d.ts +0 -1
- package/dist/types/filter-manager/components/simple-filter-operator/simple-filter-operator.d.ts +0 -1
- package/dist/types/filter-manager/components/simple-filter-operator/text-operator.d.ts +0 -1
- package/dist/types/filter-manager/components/simple-filter-root.d.ts +0 -9
- package/dist/types/filter-manager/components/simple-filter-value/date-value.d.ts +0 -1
- package/dist/types/filter-manager/components/simple-filter-value/number-value.d.ts +0 -1
- package/dist/types/filter-manager/components/simple-filter-value/simple-filter-value.d.ts +0 -1
- package/dist/types/filter-manager/components/simple-filter-value/text-value.d.ts +0 -1
- package/dist/types/filter-manager/components/use-date-filter-callbacks.d.ts +0 -9
- package/dist/types/filter-manager/components/use-in-filter-item-loader.d.ts +0 -7
- package/dist/types/filter-manager/components/use-number-filter-callbacks.d.ts +0 -8
- package/dist/types/filter-manager/components/use-text-filter-callbacks.d.ts +0 -8
- package/dist/types/filter-manager/filter-manager-impl.d.ts +0 -27
- package/dist/types/filter-manager/filter-manager.d.ts +0 -1
- package/dist/types/filter-manager/filter-state-context.d.ts +0 -16
- package/dist/types/filter-manager/flat-to-combined.d.ts +0 -3
- package/dist/types/filter-manager/flatten-combined-filter.d.ts +0 -3
- package/dist/types/filter-manager/is-filter-complete.d.ts +0 -2
- package/dist/types/filter-manager/types.d.ts +0 -15
- package/dist/types/filter-manager/use-in-filter.d.ts +0 -5
- package/dist/types/filter-manager/use-simple-filters.d.ts +0 -8
- package/dist/types/grid-container/grid-container-impl.d.ts +0 -6
- package/dist/types/grid-container/grid-container.d.ts +0 -2
- package/dist/types/header-cell/header-cell-default.d.ts +0 -2
- package/dist/types/icons.d.ts +0 -1
- package/dist/types/index.d.ts +0 -8
- package/dist/types/license.d.ts +0 -12
- package/dist/types/list-view/list-view-context.d.ts +0 -21
- package/dist/types/list-view/list-view.d.ts +0 -26
- package/dist/types/lytenyte-pro.d.ts +0 -7
- package/dist/types/menu/arrow-svg.d.ts +0 -1
- package/dist/types/menu/column-menu/column-menu-driver.d.ts +0 -4
- package/dist/types/menu/context-menu/context-menu-driver.d.ts +0 -1
- package/dist/types/menu/context-menu/use-context-menu-listener.d.ts +0 -6
- package/dist/types/menu/menu-impl.d.ts +0 -18
- package/dist/types/menu/menu.d.ts +0 -19
- package/dist/types/menu/use-menu-class-name.d.ts +0 -1
- package/dist/types/menu-frame/menu-frame-driver.d.ts +0 -1
- package/dist/types/overlay/load-error-overlay.d.ts +0 -1
- package/dist/types/overlay/loading-overlay.d.ts +0 -1
- package/dist/types/overlay/no-data-overlay.d.ts +0 -1
- package/dist/types/overlay/overlay-driver.d.ts +0 -1
- package/dist/types/pill/pill.d.ts +0 -5
- package/dist/types/pill-manager/pill-manager-agg-menu.d.ts +0 -7
- package/dist/types/pill-manager/pill-manager-controls.d.ts +0 -9
- package/dist/types/pill-manager/pill-manager-drag-placeholder.d.ts +0 -5
- package/dist/types/pill-manager/pill-manager-expander.d.ts +0 -1
- package/dist/types/pill-manager/pill-manager-impl.d.ts +0 -50
- package/dist/types/pill-manager/pill-manager-pill.d.ts +0 -5
- package/dist/types/pill-manager/pill-manager-pills/pill-manager-pills.d.ts +0 -2
- package/dist/types/pill-manager/pill-manager-pills/use-aggregation-source.d.ts +0 -2
- package/dist/types/pill-manager/pill-manager-pills/use-column-pivot-source.d.ts +0 -2
- package/dist/types/pill-manager/pill-manager-pills/use-column-source.d.ts +0 -2
- package/dist/types/pill-manager/pill-manager-pills/use-measures-source.d.ts +0 -2
- package/dist/types/pill-manager/pill-manager-pills/use-row-groups-source.d.ts +0 -2
- package/dist/types/pill-manager/pill-manager-pills/utils.d.ts +0 -3
- package/dist/types/pill-manager/pill-manager-row-label.d.ts +0 -22
- package/dist/types/pill-manager/pill-manager-row.d.ts +0 -12
- package/dist/types/pill-manager/pill-manager-rows.d.ts +0 -1
- package/dist/types/pill-manager/pill-manager-separator.d.ts +0 -1
- package/dist/types/pill-manager/pill-manager-types.d.ts +0 -36
- package/dist/types/pill-manager/pill-manager.d.ts +0 -1
- package/dist/types/popover/popover-impl.d.ts +0 -8
- package/dist/types/popover/popover.d.ts +0 -10
- package/dist/types/popover/use-popover-class.d.ts +0 -1
- package/dist/types/select/select.d.ts +0 -26
- package/dist/types/sort-manager/sort-adder.d.ts +0 -4
- package/dist/types/sort-manager/sort-apply.d.ts +0 -1
- package/dist/types/sort-manager/sort-cancel.d.ts +0 -1
- package/dist/types/sort-manager/sort-clear.d.ts +0 -1
- package/dist/types/sort-manager/sort-column-select.d.ts +0 -6
- package/dist/types/sort-manager/sort-direction-select.d.ts +0 -6
- package/dist/types/sort-manager/sort-items-to-sort-model.d.ts +0 -3
- package/dist/types/sort-manager/sort-manager-context.d.ts +0 -4
- package/dist/types/sort-manager/sort-manager-impl.d.ts +0 -32
- package/dist/types/sort-manager/sort-manager.d.ts +0 -1
- package/dist/types/sort-manager/sort-model-to-sort-items.d.ts +0 -4
- package/dist/types/sort-manager/sort-remove.d.ts +0 -4
- package/dist/types/sort-manager/sort-sort-select.d.ts +0 -6
- package/dist/types/sort-manager/use-sortable-column-items.d.ts +0 -9
- package/dist/types/use-client-data-source.d.ts +0 -6
- package/dist/types/use-edge-scroll.d.ts +0 -7
- package/dist/types/use-grid.d.ts +0 -6
- package/dist/types/use-lytenyte.d.ts +0 -11
- package/dist/types/use-server-data-source.d.ts +0 -3
- package/dist/types/use-tree-data-source.d.ts +0 -3
- package/dist/types/watermark.d.ts +0 -3
- package/dist/types.js +0 -1
- package/dist/useAnchorPositioning-52zK7jlD.js +0 -241
- package/dist/useButton-DWXzFgcr.js +0 -184
- package/dist/useScrollLock-D4UY33Sb.js +0 -425
- /package/dist/{types/cell-selection → cell-selection}/cell-selection-driver.d.ts +0 -0
- /package/dist/{types/dialog → root}/dialog-driver.d.ts +0 -0
- /package/dist/{types/popover → root}/popover-driver.d.ts +0 -0
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useCallback, useEffect, useState } from "react";
|
|
3
|
+
import { getTabbables } from "@1771technologies/lytenyte-dom-utils";
|
|
4
|
+
import { useGridRoot } from "../context";
|
|
5
|
+
import { editOnChange } from "../state/helpers/edit-on-change";
|
|
6
|
+
import { handleNavigationKeys } from "@1771technologies/lytenyte-shared";
|
|
7
|
+
export function CellEditor({ cell }) {
|
|
8
|
+
const [el, setEl] = useState(null);
|
|
9
|
+
const grid = useGridRoot().grid;
|
|
10
|
+
useEffect(() => {
|
|
11
|
+
if (!el)
|
|
12
|
+
return;
|
|
13
|
+
const focusFirst = () => {
|
|
14
|
+
const tabbables = getTabbables(el);
|
|
15
|
+
if (!el.contains(document.activeElement))
|
|
16
|
+
tabbables.at(0)?.focus();
|
|
17
|
+
};
|
|
18
|
+
const controller = new AbortController();
|
|
19
|
+
if (el.parentElement) {
|
|
20
|
+
el.parentElement.addEventListener("focus", () => {
|
|
21
|
+
focusFirst();
|
|
22
|
+
}, { signal: controller.signal });
|
|
23
|
+
}
|
|
24
|
+
focusFirst();
|
|
25
|
+
return () => controller.abort();
|
|
26
|
+
}, [el]);
|
|
27
|
+
return (_jsx("div", { ref: setEl, style: { width: "100%", height: "100%" }, onKeyDown: (e) => {
|
|
28
|
+
if (e.key === "Escape") {
|
|
29
|
+
const parent = el?.parentElement;
|
|
30
|
+
grid.api.editEnd(true);
|
|
31
|
+
setTimeout(() => {
|
|
32
|
+
parent?.focus();
|
|
33
|
+
}, 4);
|
|
34
|
+
}
|
|
35
|
+
if (e.key === "Enter") {
|
|
36
|
+
const ds = grid.state.rowDataStore;
|
|
37
|
+
handleNavigationKeys({
|
|
38
|
+
ctrlKey: false,
|
|
39
|
+
metaKey: false,
|
|
40
|
+
key: "ArrowDown",
|
|
41
|
+
preventDefault: () => { },
|
|
42
|
+
stopPropagation: () => { },
|
|
43
|
+
}, {
|
|
44
|
+
vp: grid.state.viewport.get(),
|
|
45
|
+
rowCount: ds.rowCount.get(),
|
|
46
|
+
topCount: ds.rowTopCount.get(),
|
|
47
|
+
centerCount: ds.rowCenterCount.get(),
|
|
48
|
+
columnCount: grid.state.columnMeta.get().columnsVisible.length,
|
|
49
|
+
focusActive: grid.internal.focusActive,
|
|
50
|
+
id: grid.state.gridId.get(),
|
|
51
|
+
layout: grid.internal.layout.get(),
|
|
52
|
+
rtl: grid.state.rtl.get(),
|
|
53
|
+
scrollIntoView: grid.api.scrollIntoView,
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
e.stopPropagation();
|
|
57
|
+
}, children: _jsx(EditRenderer, { cell: cell }) }));
|
|
58
|
+
}
|
|
59
|
+
function EditRenderer({ cell }) {
|
|
60
|
+
const column = cell.column;
|
|
61
|
+
const ctx = useGridRoot();
|
|
62
|
+
const base = ctx.grid.state.columnBase.useValue();
|
|
63
|
+
const editFuncs = ctx.grid.state.editRenderers.useValue();
|
|
64
|
+
const editRenderer = column.editRenderer ?? base.editRenderer;
|
|
65
|
+
const activeData = ctx.grid.internal.editData.useValue();
|
|
66
|
+
const row = cell.row.get();
|
|
67
|
+
const value = ctx.grid.api.columnField(column, row.kind === "branch"
|
|
68
|
+
? { kind: "branch", data: activeData, key: row.key }
|
|
69
|
+
: { kind: "leaf", data: activeData });
|
|
70
|
+
const onChange = useCallback((c) => {
|
|
71
|
+
editOnChange({
|
|
72
|
+
value: c,
|
|
73
|
+
activeData,
|
|
74
|
+
base,
|
|
75
|
+
column,
|
|
76
|
+
grid: ctx.grid,
|
|
77
|
+
row,
|
|
78
|
+
rowIndex: cell.rowIndex,
|
|
79
|
+
});
|
|
80
|
+
}, [activeData, base, cell.rowIndex, column, ctx.grid, row]);
|
|
81
|
+
if (!editRenderer) {
|
|
82
|
+
const type = column.type;
|
|
83
|
+
if (type === "number")
|
|
84
|
+
return (_jsx("input", { type: "number", value: value, onChange: (e) => onChange(Number.parseFloat(e.target.value)) }));
|
|
85
|
+
if (type === "date")
|
|
86
|
+
return _jsx("input", { type: "date", value: value, onChange: (e) => onChange(e.target.value) });
|
|
87
|
+
if (type === "datetime")
|
|
88
|
+
return (_jsx("input", { type: "datetime-local", value: value, onChange: (e) => onChange(e.target.value) }));
|
|
89
|
+
return _jsx("input", { value: value, onChange: (e) => onChange(e.target.value) });
|
|
90
|
+
}
|
|
91
|
+
const Renderer = typeof editRenderer === "string" ? editFuncs[editRenderer] : editRenderer;
|
|
92
|
+
const validation = ctx.grid.internal.editValidation.useValue();
|
|
93
|
+
if (!Renderer)
|
|
94
|
+
return null;
|
|
95
|
+
return (_jsx(Renderer, { column: column, grid: ctx.grid, onChange: onChange, row: cell.row.get(), rowIndex: cell.rowIndex, value: value, rowValidationState: validation }));
|
|
96
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { type ReactNode } from "react";
|
|
2
|
+
import type { CellRendererFn, RowCellLayout } from "../+types";
|
|
3
|
+
export interface CellProps {
|
|
4
|
+
readonly cell: RowCellLayout<any>;
|
|
5
|
+
readonly children?: ReactNode | CellRendererFn<any>;
|
|
6
|
+
}
|
|
7
|
+
export declare const Cell: import("react").ForwardRefExoticComponent<Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "children"> & CellProps, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef, useEffect, useState } from "react";
|
|
3
|
+
import { fastDeepMemo } from "@1771technologies/lytenyte-react-hooks";
|
|
4
|
+
import { useGridRoot } from "../context";
|
|
5
|
+
import { CellReact } from "@1771technologies/lytenyte-shared";
|
|
6
|
+
import { CellDefault } from "./cell-default";
|
|
7
|
+
import { CellEditor } from "./cell-editor";
|
|
8
|
+
import { useRowMeta } from "../rows/row/context";
|
|
9
|
+
const CellImpl = forwardRef(function Cell({ cell, children, ...props }, forwarded) {
|
|
10
|
+
const grid = useGridRoot().grid;
|
|
11
|
+
const cx = grid.state;
|
|
12
|
+
grid.internal.refreshKey.useValue();
|
|
13
|
+
const row = cell.row.useValue();
|
|
14
|
+
const renderers = cx.cellRenderers.useValue();
|
|
15
|
+
const providedRenderer = children ?? cell.column.cellRenderer;
|
|
16
|
+
const Renderer = providedRenderer
|
|
17
|
+
? typeof providedRenderer === "string"
|
|
18
|
+
? (renderers[providedRenderer] ?? CellDefault)
|
|
19
|
+
: providedRenderer
|
|
20
|
+
: CellDefault;
|
|
21
|
+
const [isEditing, setIsEditing] = useState(false);
|
|
22
|
+
useEffect(() => {
|
|
23
|
+
return grid.internal.editActivePos.watch(() => {
|
|
24
|
+
const pos = grid.internal.editActivePos.get();
|
|
25
|
+
if (!pos)
|
|
26
|
+
return setIsEditing(false);
|
|
27
|
+
setIsEditing(pos.column === cell.column &&
|
|
28
|
+
pos.rowIndex >= cell.rowIndex &&
|
|
29
|
+
pos.rowIndex < cell.rowIndex + cell.rowSpan);
|
|
30
|
+
});
|
|
31
|
+
}, [cell.column, cell.rowIndex, cell.rowSpan, grid.internal.editActivePos]);
|
|
32
|
+
const rowMeta = useRowMeta();
|
|
33
|
+
if (!row)
|
|
34
|
+
return null;
|
|
35
|
+
return (_jsxs(CellReact, { ...props, ref: forwarded, cell: cell, isEditing: isEditing, viewportWidth: cx.viewportWidthInner.useValue(), detailHeight: grid.api.rowDetailRenderedHeight(row ?? ""), rtl: cx.rtl.useValue(), xPosition: cx.xPositions.useValue(), yPosition: cx.yPositions.useValue(), children: [isEditing && _jsx(CellEditor, { cell: cell }), !isEditing && (_jsx(_Fragment, { children: typeof Renderer === "function" ? (_jsx(Renderer, { column: cell.column, rowSelected: rowMeta.selected, rowIndeterminate: rowMeta.indeterminate, row: row, grid: grid, rowIndex: cell.rowIndex, colIndex: cell.colIndex })) : (Renderer) }))] }));
|
|
36
|
+
});
|
|
37
|
+
export const Cell = fastDeepMemo(CellImpl);
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { Column } from "../+types";
|
|
2
|
+
import type { PathBranch } from "@1771technologies/lytenyte-shared";
|
|
3
|
+
export declare const branchLookupContext: import("react").Context<Record<string, PathBranch<Column<any>>>>;
|
|
4
|
+
export declare const useBranchLookup: () => Record<string, PathBranch<Column<any>>>;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { TreeVirtualBranch } from "../tree-view/virtualized/make-virtual-tree";
|
|
2
|
+
import type { Column } from "../+types";
|
|
3
|
+
import type { SlotComponent } from "@1771technologies/lytenyte-react-hooks";
|
|
4
|
+
export interface ColumnManagerBranchProps {
|
|
5
|
+
readonly item: TreeVirtualBranch<Column<any>>;
|
|
6
|
+
readonly label: SlotComponent;
|
|
7
|
+
readonly expander?: SlotComponent;
|
|
8
|
+
}
|
|
9
|
+
export declare const Branch: import("react").ForwardRefExoticComponent<Omit<ColumnManagerBranchProps & import("react").ClassAttributes<HTMLLIElement> & import("react").LiHTMLAttributes<HTMLLIElement>, "ref"> & import("react").RefAttributes<HTMLLIElement>>;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef, useMemo } from "react";
|
|
3
|
+
import { TreeBranch } from "../tree-view/branch/branch";
|
|
4
|
+
import { ColumnItemContext } from "./context";
|
|
5
|
+
import { dragState, DropWrap } from "@1771technologies/lytenyte-dragon";
|
|
6
|
+
import { useGrid } from "../grid-provider/use-grid";
|
|
7
|
+
import { useColumnsFromContext } from "./use-columns-from-context";
|
|
8
|
+
export const Branch = forwardRef(function Branch({ item, label, ...props }, forwarded) {
|
|
9
|
+
const grid = useGrid();
|
|
10
|
+
const id = grid.state.gridId.useValue();
|
|
11
|
+
const accepted = `${id}/columns`;
|
|
12
|
+
const columns = useColumnsFromContext(item);
|
|
13
|
+
return (_jsx(ColumnItemContext, { value: useMemo(() => ({ item }), [item]), children: _jsx(TreeBranch, { ...props, itemId: item.branch.data.idOccurrence, ref: forwarded, ...item.attrs, labelWrap: _jsx(DropWrap, { "data-ln-column-manager-branch": true, "data-ln-column-id": item.branch.data.idOccurrence, accepted: [accepted], onEnter: (el) => {
|
|
14
|
+
const data = dragState.data
|
|
15
|
+
.get()
|
|
16
|
+
?.siteLocalData?.[accepted]?.at(-1);
|
|
17
|
+
if (!data)
|
|
18
|
+
return;
|
|
19
|
+
const move = data.id;
|
|
20
|
+
if (columns.some((c) => c.id === move))
|
|
21
|
+
return;
|
|
22
|
+
const allColumns = grid.state.columns.get();
|
|
23
|
+
const moveIndex = allColumns.findIndex((c) => c.id === move);
|
|
24
|
+
if (moveIndex === -1)
|
|
25
|
+
return;
|
|
26
|
+
const thisIndex = allColumns.findIndex((c) => c.id === columns[0].id);
|
|
27
|
+
const isBefore = thisIndex > moveIndex;
|
|
28
|
+
if (isBefore) {
|
|
29
|
+
el.setAttribute("data-ln-is-before", "true");
|
|
30
|
+
}
|
|
31
|
+
else {
|
|
32
|
+
el.setAttribute("data-ln-is-after", "true");
|
|
33
|
+
}
|
|
34
|
+
}, onLeave: (el) => {
|
|
35
|
+
el.removeAttribute("data-ln-is-before");
|
|
36
|
+
el.removeAttribute("data-ln-is-after");
|
|
37
|
+
} }), label: label }) }));
|
|
38
|
+
});
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { ForceSyncScrolling } from "../tree-view/virtualized/force-sync-scrolling";
|
|
2
|
+
import { Root } from "./root";
|
|
3
|
+
import { useColumnManager } from "./use-column-manager";
|
|
4
|
+
import { VisibilityCheckbox } from "./visibility-checkbox";
|
|
5
|
+
export declare const ColumnManager: {
|
|
6
|
+
Root: typeof Root;
|
|
7
|
+
Panel: import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLUListElement>, HTMLUListElement>, "ref"> & import("react").RefAttributes<HTMLUListElement>>;
|
|
8
|
+
PassiveScroll: typeof ForceSyncScrolling;
|
|
9
|
+
Leaf: import("react").ForwardRefExoticComponent<Omit<import("./leaf").ColumnManagerLeafProps & import("react").ClassAttributes<HTMLLIElement> & import("react").LiHTMLAttributes<HTMLLIElement>, "ref"> & import("react").RefAttributes<HTMLLIElement>>;
|
|
10
|
+
Branch: import("react").ForwardRefExoticComponent<Omit<import("./branch").ColumnManagerBranchProps & import("react").ClassAttributes<HTMLLIElement> & import("react").LiHTMLAttributes<HTMLLIElement>, "ref"> & import("react").RefAttributes<HTMLLIElement>>;
|
|
11
|
+
Label: import("react").ForwardRefExoticComponent<Omit<import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & import("./label").LabelProps, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
12
|
+
VisibilityCheckbox: import("react").ForwardRefExoticComponent<Omit<import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & VisibilityCheckbox, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
13
|
+
MoveHandle: import("react").ForwardRefExoticComponent<Omit<import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & import("./move-handle").MoveHandleProps, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
14
|
+
useColumnManager: typeof useColumnManager;
|
|
15
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
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 { Label } from "./label";
|
|
5
|
+
import { Leaf } from "./leaf";
|
|
6
|
+
import { MoveHandle } from "./move-handle";
|
|
7
|
+
import { Root } from "./root";
|
|
8
|
+
import { useColumnManager } from "./use-column-manager";
|
|
9
|
+
import { VisibilityCheckbox } from "./visibility-checkbox";
|
|
10
|
+
export const ColumnManager = {
|
|
11
|
+
Root: Root,
|
|
12
|
+
Panel: TreePanel,
|
|
13
|
+
PassiveScroll: ForceSyncScrolling,
|
|
14
|
+
Leaf,
|
|
15
|
+
Branch,
|
|
16
|
+
Label,
|
|
17
|
+
VisibilityCheckbox,
|
|
18
|
+
MoveHandle,
|
|
19
|
+
useColumnManager,
|
|
20
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { TreeVirtualItem } from "../tree-view/virtualized/make-virtual-tree";
|
|
2
|
+
import type { Column } from "../+types";
|
|
3
|
+
export interface TreeItemContextValue {
|
|
4
|
+
readonly item: TreeVirtualItem<Column<any>>;
|
|
5
|
+
}
|
|
6
|
+
export declare const ColumnItemContext: import("react").Context<TreeItemContextValue>;
|
|
7
|
+
export declare const useColumnItemContext: () => TreeItemContextValue;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { type SlotComponent } from "@1771technologies/lytenyte-react-hooks";
|
|
2
|
+
export interface LabelProps {
|
|
3
|
+
readonly slot?: SlotComponent;
|
|
4
|
+
}
|
|
5
|
+
export declare const Label: import("react").ForwardRefExoticComponent<Omit<import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & LabelProps, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useSlot } from "@1771technologies/lytenyte-react-hooks";
|
|
3
|
+
import { useColumnItemContext } from "./context";
|
|
4
|
+
import { forwardRef, useMemo } from "react";
|
|
5
|
+
export const Label = forwardRef(function Label({ slot, ...props }, forwarded) {
|
|
6
|
+
const { item } = useColumnItemContext();
|
|
7
|
+
const label = useMemo(() => {
|
|
8
|
+
if (item.kind == "branch")
|
|
9
|
+
return item.branch.id.split("#").at(-2);
|
|
10
|
+
return item.leaf.data.name ?? item.leaf.data.id;
|
|
11
|
+
}, [item]);
|
|
12
|
+
const rendered = useSlot({
|
|
13
|
+
props: [{ children: label }, props],
|
|
14
|
+
ref: forwarded,
|
|
15
|
+
slot: slot ?? _jsx("div", {}),
|
|
16
|
+
});
|
|
17
|
+
return rendered;
|
|
18
|
+
});
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { TreeVirtualLeaf } from "../tree-view/virtualized/make-virtual-tree";
|
|
2
|
+
import type { Column } from "../+types";
|
|
3
|
+
export interface ColumnManagerLeafProps {
|
|
4
|
+
readonly item: TreeVirtualLeaf<Column<any>>;
|
|
5
|
+
}
|
|
6
|
+
export declare const Leaf: import("react").ForwardRefExoticComponent<Omit<ColumnManagerLeafProps & import("react").ClassAttributes<HTMLLIElement> & import("react").LiHTMLAttributes<HTMLLIElement>, "ref"> & import("react").RefAttributes<HTMLLIElement>>;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef, useMemo } from "react";
|
|
3
|
+
import { ColumnItemContext } from "./context";
|
|
4
|
+
import { TreeLeaf } from "../tree-view/leaf";
|
|
5
|
+
import { dragState, DropWrap } from "@1771technologies/lytenyte-dragon";
|
|
6
|
+
import { useGrid } from "../grid-provider/use-grid";
|
|
7
|
+
export const Leaf = forwardRef(function ColumnManagerLeaf({ item, ...props }, forwarded) {
|
|
8
|
+
const context = useMemo(() => {
|
|
9
|
+
return { item: item };
|
|
10
|
+
}, [item]);
|
|
11
|
+
const grid = useGrid();
|
|
12
|
+
const id = grid.state.gridId.useValue();
|
|
13
|
+
const accepted = `${id}/columns`;
|
|
14
|
+
return (_jsx(ColumnItemContext.Provider, { value: context, children: _jsx(DropWrap, { accepted: [accepted], onEnter: (el) => {
|
|
15
|
+
const data = dragState.data
|
|
16
|
+
.get()
|
|
17
|
+
?.siteLocalData?.[accepted]?.at(-1);
|
|
18
|
+
if (!data)
|
|
19
|
+
return;
|
|
20
|
+
const columns = [item.leaf.data];
|
|
21
|
+
const move = data.id;
|
|
22
|
+
if (columns.some((c) => c.id === move))
|
|
23
|
+
return;
|
|
24
|
+
const allColumns = grid.state.columns.get();
|
|
25
|
+
const moveIndex = allColumns.findIndex((c) => c.id === move);
|
|
26
|
+
if (moveIndex === -1)
|
|
27
|
+
return;
|
|
28
|
+
const thisIndex = allColumns.findIndex((c) => c.id === columns[0].id);
|
|
29
|
+
const isBefore = thisIndex > moveIndex;
|
|
30
|
+
if (isBefore) {
|
|
31
|
+
el.setAttribute("data-ln-is-before", "true");
|
|
32
|
+
}
|
|
33
|
+
else {
|
|
34
|
+
el.setAttribute("data-ln-is-after", "true");
|
|
35
|
+
}
|
|
36
|
+
}, onLeave: (el) => {
|
|
37
|
+
el.removeAttribute("data-ln-is-before");
|
|
38
|
+
el.removeAttribute("data-ln-is-after");
|
|
39
|
+
}, as: _jsx(TreeLeaf, { ...props, itemId: item.leaf.data.id, ref: forwarded, ...item.attrs, style: { ...props.style, ...item.attrs.style }, "data-ln-column-manager-leaf": true, "data-ln-column-id": item.leaf.data.id }) }) }));
|
|
40
|
+
});
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { type SlotComponent } from "@1771technologies/lytenyte-react-hooks";
|
|
2
|
+
import { type ReactNode } from "react";
|
|
3
|
+
import type { Column } from "../+types";
|
|
4
|
+
import type { TreeVirtualItem } from "../tree-view/virtualized/make-virtual-tree";
|
|
5
|
+
export interface MoveHandleProps {
|
|
6
|
+
readonly slot?: SlotComponent;
|
|
7
|
+
readonly placeholder?: (p: {
|
|
8
|
+
columns: Column<any>[];
|
|
9
|
+
item: TreeVirtualItem<Column<any>>;
|
|
10
|
+
}) => ReactNode;
|
|
11
|
+
}
|
|
12
|
+
export declare const MoveHandle: import("react").ForwardRefExoticComponent<Omit<import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & MoveHandleProps, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useDraggable } from "@1771technologies/lytenyte-dragon";
|
|
3
|
+
import { useCombinedRefs, useSlot, } from "@1771technologies/lytenyte-react-hooks";
|
|
4
|
+
import { forwardRef, useMemo } from "react";
|
|
5
|
+
import { useColumnItemContext } from "./context";
|
|
6
|
+
import { useColumnsFromContext } from "./use-columns-from-context";
|
|
7
|
+
import { useGrid } from "../grid-provider/use-grid";
|
|
8
|
+
export const MoveHandle = forwardRef(function MoveHandle({ slot, placeholder: Placeholder, ...props }, forwarded) {
|
|
9
|
+
const item = useColumnItemContext().item;
|
|
10
|
+
const grid = useGrid();
|
|
11
|
+
const columns = useColumnsFromContext(item);
|
|
12
|
+
const base = grid.state.columnBase.useValue();
|
|
13
|
+
const isMovable = useMemo(() => {
|
|
14
|
+
return columns.every((c) => c.uiHints?.movable ?? base.uiHints?.movable);
|
|
15
|
+
}, [base.uiHints?.movable, columns]);
|
|
16
|
+
const { dragProps: { ref, ...otherProps }, } = useDraggable({
|
|
17
|
+
getItems: () => {
|
|
18
|
+
return {
|
|
19
|
+
siteLocalData: {
|
|
20
|
+
[`${grid.state.gridId.get()}/columns`]: columns,
|
|
21
|
+
},
|
|
22
|
+
};
|
|
23
|
+
},
|
|
24
|
+
onDrop: (p) => {
|
|
25
|
+
const move = p.dropElement.getAttribute("data-ln-column-id");
|
|
26
|
+
if (!move)
|
|
27
|
+
return null;
|
|
28
|
+
if (columns.some((c) => c.id === move))
|
|
29
|
+
return;
|
|
30
|
+
const allColumns = grid.state.columns.get();
|
|
31
|
+
const moveIndex = allColumns.findIndex((c) => c.id === move);
|
|
32
|
+
if (moveIndex === -1)
|
|
33
|
+
return;
|
|
34
|
+
const thisIndex = allColumns.findIndex((c) => c.id === columns[0].id);
|
|
35
|
+
const isBefore = thisIndex > moveIndex;
|
|
36
|
+
grid.api.columnMove({
|
|
37
|
+
moveColumns: columns,
|
|
38
|
+
moveTarget: move,
|
|
39
|
+
before: isBefore,
|
|
40
|
+
});
|
|
41
|
+
},
|
|
42
|
+
placeholder: () => {
|
|
43
|
+
if (Placeholder)
|
|
44
|
+
return _jsx(Placeholder, { columns: columns, item: item });
|
|
45
|
+
return (_jsx("div", { children: item.kind === "branch"
|
|
46
|
+
? item.branch.data.joinPath.at(-1)
|
|
47
|
+
: (item.leaf.data.name ?? item.leaf.data.id) }));
|
|
48
|
+
},
|
|
49
|
+
});
|
|
50
|
+
const combined = useCombinedRefs(ref, forwarded);
|
|
51
|
+
const additionalProps = isMovable ? otherProps : {};
|
|
52
|
+
const renderer = useSlot({
|
|
53
|
+
props: [{ "aria-label": "Drag to move column" }, additionalProps, props],
|
|
54
|
+
ref: isMovable ? combined : forwarded,
|
|
55
|
+
slot: slot ?? _jsx("div", {}),
|
|
56
|
+
});
|
|
57
|
+
return renderer;
|
|
58
|
+
});
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { type PropsWithChildren } from "react";
|
|
2
|
+
import type { Column, Grid } from "../+types";
|
|
3
|
+
import type { UseColumnManagerReturn } from "./use-column-manager";
|
|
4
|
+
import type { PathRoot } from "@1771technologies/lytenyte-shared";
|
|
5
|
+
export type ColumnManagerRootProps<T> = UseColumnManagerReturn<T>["rootProps"] & {
|
|
6
|
+
readonly grid: Grid<T>;
|
|
7
|
+
readonly root: PathRoot<Column<any>>;
|
|
8
|
+
};
|
|
9
|
+
export declare function Root<T>({ grid, children, treeRef, root, ...rootProps }: PropsWithChildren<ColumnManagerRootProps<T>>): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useMemo } from "react";
|
|
3
|
+
import { GridProvider } from "../grid-provider/provider";
|
|
4
|
+
import { TreeRoot } from "../tree-view/root";
|
|
5
|
+
import { branchLookupContext } from "./branch-lookup-context";
|
|
6
|
+
export function Root({ grid, children, treeRef, root, ...rootProps }) {
|
|
7
|
+
const branchLookup = useMemo(() => {
|
|
8
|
+
const stack = [...root.children.values()];
|
|
9
|
+
const lookup = {};
|
|
10
|
+
while (stack.length) {
|
|
11
|
+
const item = stack.pop();
|
|
12
|
+
if (item.kind === "leaf")
|
|
13
|
+
continue;
|
|
14
|
+
lookup[item.data.idOccurrence] = item;
|
|
15
|
+
stack.push(...item.children.values());
|
|
16
|
+
}
|
|
17
|
+
return lookup;
|
|
18
|
+
}, [root.children]);
|
|
19
|
+
return (_jsx(branchLookupContext.Provider, { value: branchLookup, children: _jsx(GridProvider, { value: grid, children: _jsx(TreeRoot, { selectMode: "multiple", transitionEnter: 200, transitionExit: 200, expansionDefault: true, ref: treeRef, ...rootProps, children: children }) }) }));
|
|
20
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { type Dispatch, type JSX, type SetStateAction } from "react";
|
|
2
|
+
import type { Column, Grid } from "../+types";
|
|
3
|
+
import type { TreeVirtualItem } from "../tree-view/virtualized/make-virtual-tree";
|
|
4
|
+
import type { PathRoot } from "@1771technologies/lytenyte-shared";
|
|
5
|
+
export interface UseColumnManagerReturn<T> {
|
|
6
|
+
readonly rootProps: {
|
|
7
|
+
readonly grid: Grid<T>;
|
|
8
|
+
readonly expansions: Record<string, boolean>;
|
|
9
|
+
readonly onExpansionChange: Dispatch<SetStateAction<Record<string, boolean>>>;
|
|
10
|
+
readonly treeRef: (el: HTMLElement | null) => void;
|
|
11
|
+
readonly getAllIds: () => Set<string>;
|
|
12
|
+
readonly getIdsBetweenNodes: (left: HTMLElement, right: HTMLElement) => string[];
|
|
13
|
+
readonly onFocusChange: (el: HTMLElement | null) => void;
|
|
14
|
+
readonly root: PathRoot<Column<T>>;
|
|
15
|
+
};
|
|
16
|
+
readonly tree: TreeVirtualItem<Column<T>>[];
|
|
17
|
+
readonly spacer: JSX.Element;
|
|
18
|
+
}
|
|
19
|
+
export declare function useColumnManager<T>(grid: Grid<T>): UseColumnManagerReturn<T>;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { useState } from "react";
|
|
2
|
+
import { useVirtualizedTree } from "../tree-view/virtualized/use-virtualized-tree";
|
|
3
|
+
export function useColumnManager(grid) {
|
|
4
|
+
const [expansions, onExpansionChange] = useState({});
|
|
5
|
+
const columns = grid.state.columns.useValue();
|
|
6
|
+
const virt = useVirtualizedTree({
|
|
7
|
+
paths: columns,
|
|
8
|
+
expansions,
|
|
9
|
+
itemHeight: 24,
|
|
10
|
+
expansionDefault: true,
|
|
11
|
+
nonAdjacentPathTrees: true,
|
|
12
|
+
});
|
|
13
|
+
return {
|
|
14
|
+
rootProps: {
|
|
15
|
+
grid,
|
|
16
|
+
expansions,
|
|
17
|
+
onExpansionChange,
|
|
18
|
+
treeRef: virt.ref,
|
|
19
|
+
...virt.rootProps,
|
|
20
|
+
},
|
|
21
|
+
spacer: virt.spacer,
|
|
22
|
+
tree: virt.virtualTree,
|
|
23
|
+
};
|
|
24
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { useMemo } from "react";
|
|
2
|
+
import { useBranchLookup } from "./branch-lookup-context";
|
|
3
|
+
export function useColumnsFromContext(item) {
|
|
4
|
+
const lookup = useBranchLookup();
|
|
5
|
+
const columns = useMemo(() => {
|
|
6
|
+
if (item.kind === "branch") {
|
|
7
|
+
const allChildren = [];
|
|
8
|
+
const branch = lookup[item.branch.data.idOccurrence];
|
|
9
|
+
const stack = [...branch.children.values()];
|
|
10
|
+
while (stack.length) {
|
|
11
|
+
const p = stack.pop();
|
|
12
|
+
if (p.kind === "branch") {
|
|
13
|
+
stack.push(...p.children.values());
|
|
14
|
+
continue;
|
|
15
|
+
}
|
|
16
|
+
allChildren.push(p.data);
|
|
17
|
+
}
|
|
18
|
+
return allChildren;
|
|
19
|
+
}
|
|
20
|
+
return [item.leaf.data];
|
|
21
|
+
}, [item, lookup]);
|
|
22
|
+
return columns;
|
|
23
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { type SlotComponent } from "@1771technologies/lytenyte-react-hooks";
|
|
2
|
+
export interface VisibilityCheckbox {
|
|
3
|
+
readonly slot?: SlotComponent<{
|
|
4
|
+
visible: boolean;
|
|
5
|
+
indeterminate: boolean;
|
|
6
|
+
toggle: (s?: boolean) => void;
|
|
7
|
+
}>;
|
|
8
|
+
}
|
|
9
|
+
export declare const VisibilityCheckbox: import("react").ForwardRefExoticComponent<Omit<import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & VisibilityCheckbox, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useSlot } from "@1771technologies/lytenyte-react-hooks";
|
|
3
|
+
import { useColumnItemContext } from "./context";
|
|
4
|
+
import { forwardRef, useCallback, useMemo } from "react";
|
|
5
|
+
import { useGrid } from "../grid-provider/use-grid";
|
|
6
|
+
import { useColumnsFromContext } from "./use-columns-from-context";
|
|
7
|
+
export const VisibilityCheckbox = forwardRef(function VisibilityCheckbox({ slot, ...props }, forwarded) {
|
|
8
|
+
const { item } = useColumnItemContext();
|
|
9
|
+
const grid = useGrid();
|
|
10
|
+
const base = grid.state.columnBase.useValue();
|
|
11
|
+
const columns = useColumnsFromContext(item);
|
|
12
|
+
const [isVisible, isIndeterminate] = useMemo(() => {
|
|
13
|
+
const allVisible = columns.every((c) => !(c.hide ?? base.hide));
|
|
14
|
+
const someVisible = columns.some((c) => !(c.hide ?? base.hide));
|
|
15
|
+
return [allVisible, !allVisible && someVisible];
|
|
16
|
+
}, [base.hide, columns]);
|
|
17
|
+
const toggle = useCallback((s) => {
|
|
18
|
+
const next = s ?? isVisible;
|
|
19
|
+
grid.api.columnUpdate(Object.fromEntries(columns.map((c) => [c.id, { hide: next }])));
|
|
20
|
+
}, [columns, grid.api, isVisible]);
|
|
21
|
+
const rendered = useSlot({
|
|
22
|
+
props: [props],
|
|
23
|
+
ref: forwarded,
|
|
24
|
+
slot: slot ?? (_jsx("input", { type: "checkbox", checked: isVisible, "aria-label": "visibility toggle", onChange: () => {
|
|
25
|
+
toggle();
|
|
26
|
+
} })),
|
|
27
|
+
state: { visible: isVisible, indeterminate: isIndeterminate, toggle },
|
|
28
|
+
});
|
|
29
|
+
return rendered;
|
|
30
|
+
});
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { Grid } from "./+types";
|
|
2
|
+
import type { InternalAtoms } from "./state/+types";
|
|
3
|
+
export interface GridRootContext {
|
|
4
|
+
readonly ref: (el: HTMLElement | SVGElement | null) => void;
|
|
5
|
+
readonly grid: Grid<any> & {
|
|
6
|
+
internal: InternalAtoms;
|
|
7
|
+
};
|
|
8
|
+
}
|
|
9
|
+
export declare const RootProvider: import("react").Provider<GridRootContext>;
|
|
10
|
+
export declare const useGridRoot: () => GridRootContext;
|
package/dist/context.js
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { TreeVirtualBranch } from "../tree-view/virtualized/make-virtual-tree";
|
|
2
|
+
import type { FilterInFilterItem } from "../+types";
|
|
3
|
+
import { type SlotComponent } from "@1771technologies/lytenyte-react-hooks";
|
|
4
|
+
export interface FilterTreeBranch {
|
|
5
|
+
readonly item: TreeVirtualBranch<FilterInFilterItem>;
|
|
6
|
+
readonly label: SlotComponent;
|
|
7
|
+
readonly labelWrap?: SlotComponent;
|
|
8
|
+
readonly expander?: SlotComponent;
|
|
9
|
+
}
|
|
10
|
+
export declare const Branch: import("react").ForwardRefExoticComponent<Omit<FilterTreeBranch & import("react").ClassAttributes<HTMLLIElement> & import("react").LiHTMLAttributes<HTMLLIElement>, "ref"> & import("react").RefAttributes<HTMLLIElement>>;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef } from "react";
|
|
3
|
+
import { TreeBranch } from "../tree-view/branch/branch";
|
|
4
|
+
import { useSlot } from "@1771technologies/lytenyte-react-hooks";
|
|
5
|
+
import { FilterTreeItemContext } from "./context";
|
|
6
|
+
import { useTreeItem } from "./hooks/use-tree-item";
|
|
7
|
+
export const Branch = forwardRef(function Branch({ item, labelWrap, label, ...props }, forwarded) {
|
|
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, { value: value, children: _jsx(TreeBranch, { ...props, itemId: item.branch.data.idOccurrence, ref: forwarded, ...item.attrs, onKeyDown: (ev) => {
|
|
18
|
+
if (ev.key === " ")
|
|
19
|
+
value.onCheckChange();
|
|
20
|
+
}, label: label, labelWrap: labelSlot }) }));
|
|
21
|
+
});
|