@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
package/dist/pill-BHBLeJ6k.js
DELETED
|
@@ -1,1012 +0,0 @@
|
|
|
1
|
-
import * as React from "react";
|
|
2
|
-
import { useRef, useState, useEffect, useCallback, useMemo, forwardRef } from "react";
|
|
3
|
-
import { u as useDragStore, b as useStore } from "./drag-store-BMsDBUy_.js";
|
|
4
|
-
import { arrayOverlap, clsx } from "@1771technologies/js-utils";
|
|
5
|
-
import { m as mergeProps, E as contains, P as PropTypes } from "./proptypes-BjYr2nFr.js";
|
|
6
|
-
import { u as useButton } from "./useButton-DWXzFgcr.js";
|
|
7
|
-
import { u as useForkRef, a as useComponentRenderer, c as pressableTriggerOpenStateMapping } from "./InternalBackdrop-C4RACVzs.js";
|
|
8
|
-
import { o as ownerDocument, c as useGrid } from "./useScrollLock-D4UY33Sb.js";
|
|
9
|
-
import { g as getPseudoElementBounds } from "./getPseudoElementBounds-BSHt6WYm.js";
|
|
10
|
-
import { u as useMenuRootContext } from "./column-menu-driver-cG-EZgLa.js";
|
|
11
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
12
|
-
import { a as Menu } from "./menu-lIx6h6Vn.js";
|
|
13
|
-
const toJSON = () => "";
|
|
14
|
-
function getVisibleBoundingBox(element) {
|
|
15
|
-
if (!element) return null;
|
|
16
|
-
let visibleBox = element.getBoundingClientRect();
|
|
17
|
-
let current = element.parentElement;
|
|
18
|
-
while (current && current !== document.body && current !== document.documentElement) {
|
|
19
|
-
const style = getComputedStyle(current);
|
|
20
|
-
const isClipping = style.overflow !== "visible";
|
|
21
|
-
if (isClipping) {
|
|
22
|
-
const parentRect = current.getBoundingClientRect();
|
|
23
|
-
visibleBox = {
|
|
24
|
-
top: Math.max(visibleBox.top, parentRect.top),
|
|
25
|
-
y: Math.max(visibleBox.top, parentRect.top),
|
|
26
|
-
right: Math.min(visibleBox.right, parentRect.right),
|
|
27
|
-
bottom: Math.min(visibleBox.bottom, parentRect.bottom),
|
|
28
|
-
left: Math.max(visibleBox.left, parentRect.left),
|
|
29
|
-
x: Math.max(visibleBox.left, parentRect.left),
|
|
30
|
-
width: 0,
|
|
31
|
-
// Initialized to 0 for now (calculated below)
|
|
32
|
-
height: 0,
|
|
33
|
-
// Initialized to 0 for now (calculated below)
|
|
34
|
-
toJSON
|
|
35
|
-
};
|
|
36
|
-
visibleBox.width = Math.max(0, visibleBox.right - visibleBox.left);
|
|
37
|
-
visibleBox.height = Math.max(0, visibleBox.bottom - visibleBox.top);
|
|
38
|
-
if (visibleBox.width === 0 || visibleBox.height === 0) {
|
|
39
|
-
return null;
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
current = current.parentElement;
|
|
43
|
-
}
|
|
44
|
-
return visibleBox;
|
|
45
|
-
}
|
|
46
|
-
function computeActiveDrag(mounted, tags, data, id, x, y) {
|
|
47
|
-
const targets = getDropTargets(mounted, x, y, tags);
|
|
48
|
-
const sortedRects = targets.sort((left, right) => {
|
|
49
|
-
const distanceToRootA = nodesToRoot(left.target);
|
|
50
|
-
const distanceToRootB = nodesToRoot(right.target);
|
|
51
|
-
return distanceToRootA - distanceToRootB;
|
|
52
|
-
});
|
|
53
|
-
return {
|
|
54
|
-
data,
|
|
55
|
-
id,
|
|
56
|
-
tags,
|
|
57
|
-
over: sortedRects,
|
|
58
|
-
x,
|
|
59
|
-
y
|
|
60
|
-
};
|
|
61
|
-
}
|
|
62
|
-
function getDropTargets(mounted, x, y, tags) {
|
|
63
|
-
const overlapping = mounted.reduce((acc, c) => {
|
|
64
|
-
const bb = c.target.getBoundingClientRect();
|
|
65
|
-
const overlaps = x >= bb.x && x <= bb.x + bb.width && y >= bb.y && y < bb.y + bb.height;
|
|
66
|
-
if (!overlaps) return acc;
|
|
67
|
-
const v = getVisibleBoundingBox(c.target);
|
|
68
|
-
const visiblyOverlaps = v && x >= v.x && x < v.x + v.width && y >= v.y && y <= v.y + v.height;
|
|
69
|
-
if (!visiblyOverlaps) return acc;
|
|
70
|
-
acc.push({
|
|
71
|
-
id: c.id,
|
|
72
|
-
accepted: c.accepted,
|
|
73
|
-
target: c.target,
|
|
74
|
-
box: bb,
|
|
75
|
-
canDrop: c.accepted.some((c2) => tags.includes(c2)),
|
|
76
|
-
xHalf: x <= bb.x + bb.width / 2 ? "left" : "right",
|
|
77
|
-
yHalf: y <= bb.y + bb.height / 2 ? "top" : "bottom",
|
|
78
|
-
data: c.data
|
|
79
|
-
});
|
|
80
|
-
return acc;
|
|
81
|
-
}, []);
|
|
82
|
-
return overlapping;
|
|
83
|
-
}
|
|
84
|
-
function nodesToRoot(c) {
|
|
85
|
-
let current = 0;
|
|
86
|
-
while (c) {
|
|
87
|
-
current++;
|
|
88
|
-
c = c.parentElement;
|
|
89
|
-
}
|
|
90
|
-
return current;
|
|
91
|
-
}
|
|
92
|
-
function useDraggable({
|
|
93
|
-
id,
|
|
94
|
-
getTags,
|
|
95
|
-
getData,
|
|
96
|
-
onDragStart,
|
|
97
|
-
onDragMove,
|
|
98
|
-
onDragEnd,
|
|
99
|
-
onDragCancel
|
|
100
|
-
}) {
|
|
101
|
-
const hasDragStartedRef = useRef(false);
|
|
102
|
-
const [isActive, setIsActive] = useState(false);
|
|
103
|
-
const store = useDragStore();
|
|
104
|
-
const [drag, setDrag] = useState(null);
|
|
105
|
-
useEffect(() => {
|
|
106
|
-
if (!drag) return;
|
|
107
|
-
const c = new AbortController();
|
|
108
|
-
drag.addEventListener(
|
|
109
|
-
"touchstart",
|
|
110
|
-
(ev) => {
|
|
111
|
-
ev.preventDefault();
|
|
112
|
-
},
|
|
113
|
-
{ passive: false, signal: c.signal }
|
|
114
|
-
);
|
|
115
|
-
drag.addEventListener(
|
|
116
|
-
"pointerdown",
|
|
117
|
-
(ev) => {
|
|
118
|
-
const startX = ev.clientX;
|
|
119
|
-
const startY = ev.clientY;
|
|
120
|
-
if (ev.pointerType === "touch") {
|
|
121
|
-
hasDragStartedRef.current = true;
|
|
122
|
-
const data = getData();
|
|
123
|
-
const tags = getTags();
|
|
124
|
-
const s = store.getState();
|
|
125
|
-
const next = computeActiveDrag(s.mounted, tags, data, id, startX, startY);
|
|
126
|
-
store.setState({ active: next });
|
|
127
|
-
onDragStart?.(next);
|
|
128
|
-
setIsActive(true);
|
|
129
|
-
ev.stopPropagation();
|
|
130
|
-
ev.preventDefault();
|
|
131
|
-
}
|
|
132
|
-
if (ev.pointerType === "mouse" && ev.button !== 0) return;
|
|
133
|
-
const c2 = new AbortController();
|
|
134
|
-
let anim = null;
|
|
135
|
-
const clickFix = (ev2) => {
|
|
136
|
-
ev2.preventDefault();
|
|
137
|
-
ev2.stopPropagation();
|
|
138
|
-
ev2.stopImmediatePropagation();
|
|
139
|
-
globalThis.removeEventListener("click", clickFix, { capture: true });
|
|
140
|
-
};
|
|
141
|
-
globalThis.addEventListener("click", clickFix, { capture: true });
|
|
142
|
-
document.addEventListener(
|
|
143
|
-
"pointermove",
|
|
144
|
-
(ev2) => {
|
|
145
|
-
if (!hasDragStartedRef.current && !shouldDragStart(ev2, startX, startY)) return;
|
|
146
|
-
const x = ev2.clientX;
|
|
147
|
-
const y = ev2.clientY;
|
|
148
|
-
if (!hasDragStartedRef.current) {
|
|
149
|
-
hasDragStartedRef.current = true;
|
|
150
|
-
const data = getData();
|
|
151
|
-
const tags = getTags();
|
|
152
|
-
const s = store.getState();
|
|
153
|
-
const next = computeActiveDrag(s.mounted, tags, data, id, x, y);
|
|
154
|
-
store.setState({ active: next });
|
|
155
|
-
onDragStart?.(next);
|
|
156
|
-
setIsActive(true);
|
|
157
|
-
}
|
|
158
|
-
if (anim) return;
|
|
159
|
-
anim = requestAnimationFrame(() => {
|
|
160
|
-
const s = store.getState();
|
|
161
|
-
const data = s.active.data;
|
|
162
|
-
const tags = s.active.tags;
|
|
163
|
-
const next = computeActiveDrag(s.mounted, tags, data, id, x, y);
|
|
164
|
-
store.setState({ active: next });
|
|
165
|
-
onDragMove?.(next);
|
|
166
|
-
anim = null;
|
|
167
|
-
});
|
|
168
|
-
},
|
|
169
|
-
{ signal: c2.signal }
|
|
170
|
-
);
|
|
171
|
-
document.addEventListener(
|
|
172
|
-
"pointerup",
|
|
173
|
-
(ev2) => {
|
|
174
|
-
c2.abort();
|
|
175
|
-
setTimeout(() => globalThis.removeEventListener("click", clickFix, { capture: true }));
|
|
176
|
-
if (!hasDragStartedRef.current) return;
|
|
177
|
-
endDrag(ev2.clientX, ev2.clientY);
|
|
178
|
-
},
|
|
179
|
-
{ signal: c2.signal, capture: true }
|
|
180
|
-
);
|
|
181
|
-
document.addEventListener(
|
|
182
|
-
"pointercancel",
|
|
183
|
-
(ev2) => {
|
|
184
|
-
c2.abort();
|
|
185
|
-
setTimeout(() => globalThis.removeEventListener("click", clickFix, { capture: true }));
|
|
186
|
-
if (!hasDragStartedRef.current) return;
|
|
187
|
-
endDrag(ev2.clientX, ev2.clientY, true);
|
|
188
|
-
},
|
|
189
|
-
{ signal: c2.signal }
|
|
190
|
-
);
|
|
191
|
-
document.addEventListener(
|
|
192
|
-
"keydown",
|
|
193
|
-
(ev2) => {
|
|
194
|
-
c2.abort();
|
|
195
|
-
setTimeout(() => globalThis.removeEventListener("click", clickFix, { capture: true }));
|
|
196
|
-
if (!hasDragStartedRef.current) return;
|
|
197
|
-
if (ev2.key === "Escape") {
|
|
198
|
-
ev2.preventDefault();
|
|
199
|
-
ev2.stopPropagation();
|
|
200
|
-
const s = store.getState().active;
|
|
201
|
-
endDrag(s.x, s.y, true);
|
|
202
|
-
}
|
|
203
|
-
},
|
|
204
|
-
{ signal: c2.signal, capture: true }
|
|
205
|
-
);
|
|
206
|
-
function endDrag(x, y, isCancel = false) {
|
|
207
|
-
const s = store.getState();
|
|
208
|
-
setIsActive(false);
|
|
209
|
-
const next = computeActiveDrag(
|
|
210
|
-
s.mounted,
|
|
211
|
-
s.active.tags,
|
|
212
|
-
s.active.data,
|
|
213
|
-
s.active.id,
|
|
214
|
-
x,
|
|
215
|
-
y
|
|
216
|
-
);
|
|
217
|
-
if (isCancel) {
|
|
218
|
-
onDragCancel?.(next);
|
|
219
|
-
} else {
|
|
220
|
-
onDragEnd?.(next);
|
|
221
|
-
}
|
|
222
|
-
hasDragStartedRef.current = false;
|
|
223
|
-
store.setState({ active: null });
|
|
224
|
-
}
|
|
225
|
-
},
|
|
226
|
-
{ passive: false, signal: c.signal }
|
|
227
|
-
);
|
|
228
|
-
return () => c.abort();
|
|
229
|
-
}, [drag, getData, getTags, id, onDragCancel, onDragEnd, onDragMove, onDragStart, store]);
|
|
230
|
-
return { setDrag, isActive };
|
|
231
|
-
}
|
|
232
|
-
function shouldDragStart(ev, startX, startY) {
|
|
233
|
-
const deltaY = Math.abs(ev.clientY - startY);
|
|
234
|
-
const deltaX = Math.abs(ev.clientX - startX);
|
|
235
|
-
return deltaX > 10 || deltaY > 10;
|
|
236
|
-
}
|
|
237
|
-
function useDroppable({ id, accepted, data, active = true }) {
|
|
238
|
-
const [target, ref] = useState(null);
|
|
239
|
-
const store = useDragStore();
|
|
240
|
-
const over = useStore(store, (s) => s.active?.over.find((c) => c.id === id));
|
|
241
|
-
const isNearestOver = useStore(store, (s) => s.active?.over.at(-1) === over);
|
|
242
|
-
const canDrop = !!over?.canDrop;
|
|
243
|
-
const isOver = !!over;
|
|
244
|
-
const isTarget = useStore(store, (s) => arrayOverlap(s.active?.tags ?? [], accepted));
|
|
245
|
-
useEffect(() => {
|
|
246
|
-
if (!target || !active) return;
|
|
247
|
-
store.setState((prev) => {
|
|
248
|
-
if (prev.mounted.find((c) => c.id === id)) return prev;
|
|
249
|
-
return {
|
|
250
|
-
mounted: [...prev.mounted, { accepted, id, target, data }]
|
|
251
|
-
};
|
|
252
|
-
});
|
|
253
|
-
return () => store.setState((prev) => {
|
|
254
|
-
return { mounted: prev.mounted.filter((c) => c.id !== id) };
|
|
255
|
-
});
|
|
256
|
-
}, [accepted, active, data, id, store, target]);
|
|
257
|
-
return { ref, isOver, isTarget, canDrop, yHalf: over?.yHalf, xHalf: over?.xHalf, isNearestOver };
|
|
258
|
-
}
|
|
259
|
-
const useEdgeScroll = ({
|
|
260
|
-
isActive,
|
|
261
|
-
threshold = 50,
|
|
262
|
-
direction = "both",
|
|
263
|
-
maxSpeed = 20,
|
|
264
|
-
acceleration = 0.5
|
|
265
|
-
}) => {
|
|
266
|
-
const [container, ref] = useState(null);
|
|
267
|
-
const scrollIntervalX = useRef(null);
|
|
268
|
-
const scrollIntervalY = useRef(null);
|
|
269
|
-
const speedX = useRef(0);
|
|
270
|
-
const speedY = useRef(0);
|
|
271
|
-
const stopScrollX = useCallback(() => {
|
|
272
|
-
if (scrollIntervalX.current) {
|
|
273
|
-
clearInterval(scrollIntervalX.current);
|
|
274
|
-
scrollIntervalX.current = null;
|
|
275
|
-
speedX.current = 0;
|
|
276
|
-
}
|
|
277
|
-
}, []);
|
|
278
|
-
const stopScrollY = useCallback(() => {
|
|
279
|
-
if (scrollIntervalY.current) {
|
|
280
|
-
clearInterval(scrollIntervalY.current);
|
|
281
|
-
scrollIntervalY.current = null;
|
|
282
|
-
speedY.current = 0;
|
|
283
|
-
}
|
|
284
|
-
}, []);
|
|
285
|
-
const stopScrolling = useCallback(() => {
|
|
286
|
-
stopScrollX();
|
|
287
|
-
stopScrollY();
|
|
288
|
-
}, [stopScrollX, stopScrollY]);
|
|
289
|
-
const startScrollingXLeft = useCallback(() => {
|
|
290
|
-
if (!scrollIntervalX.current) {
|
|
291
|
-
scrollIntervalX.current = setInterval(() => {
|
|
292
|
-
speedX.current = Math.min(speedX.current + acceleration, maxSpeed);
|
|
293
|
-
container?.scrollBy({ left: speedX.current * -1 });
|
|
294
|
-
}, 16);
|
|
295
|
-
}
|
|
296
|
-
}, [acceleration, container, maxSpeed]);
|
|
297
|
-
const startScrollingXRight = useCallback(() => {
|
|
298
|
-
if (!scrollIntervalX.current) {
|
|
299
|
-
scrollIntervalX.current = setInterval(() => {
|
|
300
|
-
speedX.current = Math.min(speedX.current + acceleration, maxSpeed);
|
|
301
|
-
container?.scrollBy({ left: speedX.current });
|
|
302
|
-
}, 16);
|
|
303
|
-
}
|
|
304
|
-
}, [acceleration, container, maxSpeed]);
|
|
305
|
-
const startScrollTop = useCallback(() => {
|
|
306
|
-
if (!scrollIntervalY.current) {
|
|
307
|
-
scrollIntervalY.current = setInterval(() => {
|
|
308
|
-
speedY.current = Math.min(speedY.current + acceleration, maxSpeed);
|
|
309
|
-
container?.scrollBy({ top: speedY.current * -1 });
|
|
310
|
-
}, 16);
|
|
311
|
-
}
|
|
312
|
-
}, [acceleration, container, maxSpeed]);
|
|
313
|
-
const startScrollBottom = useCallback(() => {
|
|
314
|
-
if (!scrollIntervalY.current) {
|
|
315
|
-
scrollIntervalY.current = setInterval(() => {
|
|
316
|
-
speedY.current = Math.min(speedY.current + acceleration, maxSpeed);
|
|
317
|
-
container?.scrollBy({ top: speedY.current });
|
|
318
|
-
}, 16);
|
|
319
|
-
}
|
|
320
|
-
}, [acceleration, container, maxSpeed]);
|
|
321
|
-
const controllerRef = useRef(null);
|
|
322
|
-
useEffect(() => {
|
|
323
|
-
if (!isActive) {
|
|
324
|
-
controllerRef.current?.abort();
|
|
325
|
-
controllerRef.current = null;
|
|
326
|
-
stopScrolling();
|
|
327
|
-
return;
|
|
328
|
-
}
|
|
329
|
-
if (!container) return;
|
|
330
|
-
const handleMouseMove = (event) => {
|
|
331
|
-
const containerRect = container.getBoundingClientRect();
|
|
332
|
-
const distanceToTop = Math.abs(event.clientY - containerRect.top);
|
|
333
|
-
const distanceToBottom = Math.abs(event.clientY - containerRect.bottom);
|
|
334
|
-
const distanceToLeft = Math.abs(event.clientX - containerRect.left);
|
|
335
|
-
const distanceToRight = Math.abs(event.clientX - containerRect.right);
|
|
336
|
-
if (direction === "both" || direction === "horizontal") {
|
|
337
|
-
if (distanceToLeft < threshold) {
|
|
338
|
-
startScrollingXLeft();
|
|
339
|
-
} else if (distanceToRight < threshold) {
|
|
340
|
-
startScrollingXRight();
|
|
341
|
-
} else {
|
|
342
|
-
stopScrollX();
|
|
343
|
-
}
|
|
344
|
-
}
|
|
345
|
-
if (direction === "both" || direction === "vertical") {
|
|
346
|
-
if (distanceToTop < threshold) {
|
|
347
|
-
startScrollTop();
|
|
348
|
-
} else if (distanceToBottom < threshold) {
|
|
349
|
-
startScrollBottom();
|
|
350
|
-
} else {
|
|
351
|
-
stopScrollY();
|
|
352
|
-
}
|
|
353
|
-
}
|
|
354
|
-
};
|
|
355
|
-
const controller = new AbortController();
|
|
356
|
-
controllerRef.current = controller;
|
|
357
|
-
container.addEventListener("pointermove", handleMouseMove, {
|
|
358
|
-
passive: false,
|
|
359
|
-
capture: true,
|
|
360
|
-
signal: controller.signal
|
|
361
|
-
});
|
|
362
|
-
container.addEventListener("pointerleave", stopScrolling);
|
|
363
|
-
return () => {
|
|
364
|
-
controller.abort();
|
|
365
|
-
stopScrolling();
|
|
366
|
-
};
|
|
367
|
-
}, [
|
|
368
|
-
isActive,
|
|
369
|
-
threshold,
|
|
370
|
-
direction,
|
|
371
|
-
maxSpeed,
|
|
372
|
-
acceleration,
|
|
373
|
-
container,
|
|
374
|
-
stopScrolling,
|
|
375
|
-
startScrollingXLeft,
|
|
376
|
-
startScrollingXRight,
|
|
377
|
-
stopScrollX,
|
|
378
|
-
startScrollTop,
|
|
379
|
-
startScrollBottom,
|
|
380
|
-
stopScrollY
|
|
381
|
-
]);
|
|
382
|
-
return ref;
|
|
383
|
-
};
|
|
384
|
-
function useMenuTrigger(parameters) {
|
|
385
|
-
const BOUNDARY_OFFSET = 2;
|
|
386
|
-
const {
|
|
387
|
-
disabled = false,
|
|
388
|
-
rootRef: externalRef,
|
|
389
|
-
open,
|
|
390
|
-
setOpen,
|
|
391
|
-
setTriggerElement,
|
|
392
|
-
positionerRef,
|
|
393
|
-
allowMouseUpTriggerRef
|
|
394
|
-
} = parameters;
|
|
395
|
-
const triggerRef = React.useRef(null);
|
|
396
|
-
const mergedRef = useForkRef(externalRef, triggerRef);
|
|
397
|
-
const allowMouseUpTriggerTimeoutRef = React.useRef(-1);
|
|
398
|
-
const {
|
|
399
|
-
getButtonProps,
|
|
400
|
-
buttonRef
|
|
401
|
-
} = useButton({
|
|
402
|
-
disabled,
|
|
403
|
-
buttonRef: mergedRef
|
|
404
|
-
});
|
|
405
|
-
const handleRef = useForkRef(buttonRef, setTriggerElement);
|
|
406
|
-
React.useEffect(() => {
|
|
407
|
-
if (!open) {
|
|
408
|
-
allowMouseUpTriggerRef.current = false;
|
|
409
|
-
}
|
|
410
|
-
}, [allowMouseUpTriggerRef, open]);
|
|
411
|
-
const getTriggerProps = React.useCallback((externalProps) => {
|
|
412
|
-
return mergeProps({
|
|
413
|
-
"aria-haspopup": "menu",
|
|
414
|
-
tabIndex: 0,
|
|
415
|
-
// this is needed to make the button focused after click in Safari
|
|
416
|
-
ref: handleRef,
|
|
417
|
-
onMouseDown: (event) => {
|
|
418
|
-
if (open) {
|
|
419
|
-
return;
|
|
420
|
-
}
|
|
421
|
-
allowMouseUpTriggerTimeoutRef.current = window.setTimeout(() => {
|
|
422
|
-
allowMouseUpTriggerRef.current = true;
|
|
423
|
-
}, 200);
|
|
424
|
-
const doc = ownerDocument(event.currentTarget);
|
|
425
|
-
function handleMouseUp(mouseEvent) {
|
|
426
|
-
if (!triggerRef.current) {
|
|
427
|
-
return;
|
|
428
|
-
}
|
|
429
|
-
if (allowMouseUpTriggerTimeoutRef.current !== -1) {
|
|
430
|
-
clearTimeout(allowMouseUpTriggerTimeoutRef.current);
|
|
431
|
-
allowMouseUpTriggerTimeoutRef.current = -1;
|
|
432
|
-
}
|
|
433
|
-
allowMouseUpTriggerRef.current = false;
|
|
434
|
-
const mouseUpTarget = mouseEvent.target;
|
|
435
|
-
if (contains(triggerRef.current, mouseUpTarget) || contains(positionerRef.current, mouseUpTarget) || mouseUpTarget === triggerRef.current) {
|
|
436
|
-
return;
|
|
437
|
-
}
|
|
438
|
-
const bounds = getPseudoElementBounds(triggerRef.current);
|
|
439
|
-
if (mouseEvent.clientX >= bounds.left - BOUNDARY_OFFSET && mouseEvent.clientX <= bounds.right + BOUNDARY_OFFSET && mouseEvent.clientY >= bounds.top - BOUNDARY_OFFSET && mouseEvent.clientY <= bounds.bottom + BOUNDARY_OFFSET) {
|
|
440
|
-
return;
|
|
441
|
-
}
|
|
442
|
-
setOpen(false, mouseEvent);
|
|
443
|
-
}
|
|
444
|
-
doc.addEventListener("mouseup", handleMouseUp, {
|
|
445
|
-
once: true
|
|
446
|
-
});
|
|
447
|
-
}
|
|
448
|
-
}, externalProps, getButtonProps);
|
|
449
|
-
}, [getButtonProps, handleRef, open, setOpen, positionerRef, allowMouseUpTriggerRef]);
|
|
450
|
-
return React.useMemo(() => ({
|
|
451
|
-
getTriggerProps,
|
|
452
|
-
triggerRef: handleRef
|
|
453
|
-
}), [getTriggerProps, handleRef]);
|
|
454
|
-
}
|
|
455
|
-
const MenuTrigger = /* @__PURE__ */ React.forwardRef(function MenuTrigger2(props, forwardedRef) {
|
|
456
|
-
const {
|
|
457
|
-
render,
|
|
458
|
-
className,
|
|
459
|
-
disabled = false,
|
|
460
|
-
...other
|
|
461
|
-
} = props;
|
|
462
|
-
const {
|
|
463
|
-
triggerProps: rootTriggerProps,
|
|
464
|
-
disabled: menuDisabled,
|
|
465
|
-
setTriggerElement,
|
|
466
|
-
open,
|
|
467
|
-
mounted,
|
|
468
|
-
setOpen,
|
|
469
|
-
allowMouseUpTriggerRef,
|
|
470
|
-
positionerRef
|
|
471
|
-
} = useMenuRootContext();
|
|
472
|
-
const {
|
|
473
|
-
getTriggerProps
|
|
474
|
-
} = useMenuTrigger({
|
|
475
|
-
disabled: disabled || menuDisabled,
|
|
476
|
-
rootRef: forwardedRef,
|
|
477
|
-
setTriggerElement,
|
|
478
|
-
open,
|
|
479
|
-
setOpen,
|
|
480
|
-
allowMouseUpTriggerRef,
|
|
481
|
-
positionerRef
|
|
482
|
-
});
|
|
483
|
-
const state = React.useMemo(() => ({
|
|
484
|
-
disabled,
|
|
485
|
-
open: mounted
|
|
486
|
-
}), [disabled, mounted]);
|
|
487
|
-
const propGetter = React.useCallback((externalProps) => mergeProps(rootTriggerProps, externalProps, getTriggerProps), [getTriggerProps, rootTriggerProps]);
|
|
488
|
-
const {
|
|
489
|
-
renderElement
|
|
490
|
-
} = useComponentRenderer({
|
|
491
|
-
render: render || "button",
|
|
492
|
-
className,
|
|
493
|
-
state,
|
|
494
|
-
propGetter,
|
|
495
|
-
customStyleHookMapping: pressableTriggerOpenStateMapping,
|
|
496
|
-
extraProps: other
|
|
497
|
-
});
|
|
498
|
-
return renderElement();
|
|
499
|
-
});
|
|
500
|
-
process.env.NODE_ENV !== "production" ? MenuTrigger.propTypes = {
|
|
501
|
-
// ┌────────────────────────────── Warning ──────────────────────────────┐
|
|
502
|
-
// │ These PropTypes are generated from the TypeScript type definitions. │
|
|
503
|
-
// │ To update them, edit the TypeScript types and run `pnpm proptypes`. │
|
|
504
|
-
// └─────────────────────────────────────────────────────────────────────┘
|
|
505
|
-
/**
|
|
506
|
-
* @ignore
|
|
507
|
-
*/
|
|
508
|
-
children: PropTypes.node,
|
|
509
|
-
/**
|
|
510
|
-
* CSS class applied to the element, or a function that
|
|
511
|
-
* returns a class based on the component’s state.
|
|
512
|
-
*/
|
|
513
|
-
className: PropTypes.oneOfType([PropTypes.func, PropTypes.string]),
|
|
514
|
-
/**
|
|
515
|
-
* Whether the component should ignore user interaction.
|
|
516
|
-
* @default false
|
|
517
|
-
*/
|
|
518
|
-
disabled: PropTypes.bool,
|
|
519
|
-
/**
|
|
520
|
-
* Allows you to replace the component’s HTML element
|
|
521
|
-
* with a different tag, or compose it with another component.
|
|
522
|
-
*
|
|
523
|
-
* Accepts a `ReactElement` or a function that returns the element to render.
|
|
524
|
-
*/
|
|
525
|
-
render: PropTypes.oneOfType([PropTypes.element, PropTypes.func])
|
|
526
|
-
} : void 0;
|
|
527
|
-
const canAgg = (c, base) => {
|
|
528
|
-
return Boolean(c.aggFnDefault ?? c.aggFnsAllowed?.length ?? base.aggFnsAllowed?.length);
|
|
529
|
-
};
|
|
530
|
-
const canMeasure = (c, base) => {
|
|
531
|
-
return Boolean(
|
|
532
|
-
c.measureFnDefault ?? c.measureFnsAllowed?.length ?? base.measureFnsAllowed?.length
|
|
533
|
-
);
|
|
534
|
-
};
|
|
535
|
-
function useAggregationSource(source) {
|
|
536
|
-
const { api, state: sx } = useGrid();
|
|
537
|
-
const columns = sx.columns.use();
|
|
538
|
-
const aggModel = sx.aggModel.use();
|
|
539
|
-
return useMemo(() => {
|
|
540
|
-
if (source !== "aggregations") return [];
|
|
541
|
-
const entries = Object.entries(aggModel);
|
|
542
|
-
const active = [];
|
|
543
|
-
for (const [key, m] of entries) {
|
|
544
|
-
let column = api.columnById(key) ?? null;
|
|
545
|
-
if (column && (api.columnIsPivot(column) || api.columnIsGridGenerated(column))) column = null;
|
|
546
|
-
const secondaryLabel = typeof m.fn === "string" ? `(${m.fn})` : "Fn(x)";
|
|
547
|
-
const onToggle = () => sx.aggModel.set((prev) => {
|
|
548
|
-
const next = { ...prev };
|
|
549
|
-
delete next[key];
|
|
550
|
-
return next;
|
|
551
|
-
});
|
|
552
|
-
if (column) {
|
|
553
|
-
active.push({
|
|
554
|
-
kind: "column",
|
|
555
|
-
active: true,
|
|
556
|
-
label: column.headerName ?? column.id,
|
|
557
|
-
secondaryLabel,
|
|
558
|
-
onClick: onToggle,
|
|
559
|
-
draggable: false,
|
|
560
|
-
dragTags: [],
|
|
561
|
-
dropId: `agg-${column.id}`,
|
|
562
|
-
column,
|
|
563
|
-
isAggregation: true,
|
|
564
|
-
dropTags: [],
|
|
565
|
-
dropData: {}
|
|
566
|
-
});
|
|
567
|
-
} else {
|
|
568
|
-
active.push({
|
|
569
|
-
kind: "column",
|
|
570
|
-
active: true,
|
|
571
|
-
label: key,
|
|
572
|
-
secondaryLabel,
|
|
573
|
-
onClick: onToggle,
|
|
574
|
-
draggable: false,
|
|
575
|
-
dragTags: [],
|
|
576
|
-
dropId: `agg-${key}`,
|
|
577
|
-
dropTags: [],
|
|
578
|
-
dropData: {}
|
|
579
|
-
});
|
|
580
|
-
}
|
|
581
|
-
}
|
|
582
|
-
const base = sx.columnBase.peek();
|
|
583
|
-
const inactive = columns.filter((c) => {
|
|
584
|
-
const agg = c.aggFnDefault ?? c.aggFnsAllowed?.length ?? base.aggFnsAllowed?.length;
|
|
585
|
-
const isAgged = !!aggModel[c.id];
|
|
586
|
-
return !!agg && !isAgged;
|
|
587
|
-
}).map((c) => {
|
|
588
|
-
const aggFn = c.aggFnDefault ?? c.aggFnsAllowed?.[0] ?? base.aggFnsAllowed?.at(0);
|
|
589
|
-
const onToggle = () => sx.aggModel.set((prev) => aggFn ? { ...prev, [c.id]: { fn: aggFn } } : prev);
|
|
590
|
-
const aggName = typeof aggFn === "string" ? `(${aggFn})` : "Fn(x)";
|
|
591
|
-
return {
|
|
592
|
-
kind: "column",
|
|
593
|
-
label: c.headerName ?? c.id,
|
|
594
|
-
active: false,
|
|
595
|
-
secondaryLabel: aggName,
|
|
596
|
-
onClick: onToggle,
|
|
597
|
-
draggable: false,
|
|
598
|
-
dropId: `agg-${c.id}`,
|
|
599
|
-
dropTags: [],
|
|
600
|
-
dragTags: [],
|
|
601
|
-
dropData: {}
|
|
602
|
-
};
|
|
603
|
-
});
|
|
604
|
-
return [...active, ...inactive];
|
|
605
|
-
}, [aggModel, api, columns, source, sx.aggModel, sx.columnBase]);
|
|
606
|
-
}
|
|
607
|
-
function useMeasuresSource(source) {
|
|
608
|
-
const { api, state: sx } = useGrid();
|
|
609
|
-
const columns = sx.columns.use();
|
|
610
|
-
const measureModel = sx.measureModel.use();
|
|
611
|
-
return useMemo(() => {
|
|
612
|
-
if (source !== "measures") return [];
|
|
613
|
-
const entries = Object.entries(measureModel);
|
|
614
|
-
const active = [];
|
|
615
|
-
for (const [key, m] of entries) {
|
|
616
|
-
let column = api.columnById(key) ?? null;
|
|
617
|
-
if (column && (api.columnIsPivot(column) || api.columnIsGridGenerated(column))) column = null;
|
|
618
|
-
const secondaryLabel = typeof m.fn === "string" ? `(${m.fn})` : "Fn(x)";
|
|
619
|
-
const onToggle = () => sx.measureModel.set((prev) => {
|
|
620
|
-
const next = { ...prev };
|
|
621
|
-
delete next[key];
|
|
622
|
-
return next;
|
|
623
|
-
});
|
|
624
|
-
if (column) {
|
|
625
|
-
active.push({
|
|
626
|
-
kind: "column",
|
|
627
|
-
active: true,
|
|
628
|
-
label: column.headerName ?? column.id,
|
|
629
|
-
secondaryLabel,
|
|
630
|
-
onClick: onToggle,
|
|
631
|
-
draggable: false,
|
|
632
|
-
dragTags: [],
|
|
633
|
-
dropTags: [],
|
|
634
|
-
dropData: {},
|
|
635
|
-
column,
|
|
636
|
-
isMeasure: true,
|
|
637
|
-
dropId: `measure-${key}`
|
|
638
|
-
});
|
|
639
|
-
} else {
|
|
640
|
-
active.push({
|
|
641
|
-
kind: "column",
|
|
642
|
-
active: true,
|
|
643
|
-
label: key,
|
|
644
|
-
secondaryLabel,
|
|
645
|
-
onClick: onToggle,
|
|
646
|
-
draggable: false,
|
|
647
|
-
dragTags: [],
|
|
648
|
-
dropTags: [],
|
|
649
|
-
dropData: {},
|
|
650
|
-
dropId: `measure-${key}`
|
|
651
|
-
});
|
|
652
|
-
}
|
|
653
|
-
}
|
|
654
|
-
const base = sx.columnBase.peek();
|
|
655
|
-
const inactive = columns.filter((c) => {
|
|
656
|
-
const measure = c.measureFnDefault ?? c.measureFnsAllowed?.length ?? base.measureFnsAllowed?.length;
|
|
657
|
-
const isMeasured = !!measureModel[c.id];
|
|
658
|
-
return !!measure && !isMeasured;
|
|
659
|
-
}).map((c) => {
|
|
660
|
-
const measureFn = c.measureFnDefault ?? c.measureFnsAllowed?.[0] ?? base.measureFnsAllowed?.at(0);
|
|
661
|
-
const measureName = typeof measureFn === "string" ? `(${measureFn})` : "Fn(x)";
|
|
662
|
-
const onToggle = () => sx.measureModel.set(
|
|
663
|
-
(prev) => measureFn ? { ...prev, [c.id]: { fn: measureFn } } : prev
|
|
664
|
-
);
|
|
665
|
-
return {
|
|
666
|
-
kind: "column",
|
|
667
|
-
label: c.headerName ?? c.id,
|
|
668
|
-
active: false,
|
|
669
|
-
secondaryLabel: measureName,
|
|
670
|
-
onClick: onToggle,
|
|
671
|
-
draggable: false,
|
|
672
|
-
dragTags: [],
|
|
673
|
-
dropTags: [],
|
|
674
|
-
dropData: {},
|
|
675
|
-
dropId: `measure-${c.id}`
|
|
676
|
-
};
|
|
677
|
-
});
|
|
678
|
-
return [...active, ...inactive];
|
|
679
|
-
}, [api, columns, measureModel, source, sx.columnBase, sx.measureModel]);
|
|
680
|
-
}
|
|
681
|
-
function useRowGroupsSource(source, dir = "horizontal") {
|
|
682
|
-
const { api, state: sx } = useGrid();
|
|
683
|
-
const rowModel = sx.rowGroupModel.use();
|
|
684
|
-
const columns = sx.columns.use();
|
|
685
|
-
const aggModel = sx.aggModel.use();
|
|
686
|
-
const measureModel = sx.measureModel.use();
|
|
687
|
-
const base = sx.columnBase.use();
|
|
688
|
-
return useMemo(() => {
|
|
689
|
-
if (source !== "row-groups") return [];
|
|
690
|
-
const activeItems = rowModel.map((c) => api.columnById(c)).map((c) => {
|
|
691
|
-
const onToggle = () => sx.rowGroupModel.set((prev) => prev.filter((x) => x !== c.id));
|
|
692
|
-
const dragTags = ["row-group"];
|
|
693
|
-
if (!api.columnIsVisible(c, true)) dragTags.push("columns");
|
|
694
|
-
if (api.columnIsPivotable(c)) dragTags.push("column-pivot");
|
|
695
|
-
if (!aggModel[c.id] && canAgg(c, base)) dragTags.push("aggregations");
|
|
696
|
-
if (!measureModel[c.id] && canMeasure(c, base)) dragTags.push("measures");
|
|
697
|
-
const dragEnd = (d) => {
|
|
698
|
-
const over = d.over.at(-1);
|
|
699
|
-
if (!over || !over.canDrop) return;
|
|
700
|
-
const isBefore = dir === "horizontal" ? (sx.rtl.peek() ? "right" : "left") === over.xHalf : over.yHalf === "top";
|
|
701
|
-
if (over.data.target === "row-group") {
|
|
702
|
-
const id = over.data.id;
|
|
703
|
-
if (id === c.id) return;
|
|
704
|
-
const myIndex = rowModel.indexOf(c.id);
|
|
705
|
-
const next = [...rowModel];
|
|
706
|
-
next.splice(myIndex, 1);
|
|
707
|
-
const targetIndex = next.indexOf(id);
|
|
708
|
-
next.splice(targetIndex + (isBefore ? 0 : 1), 0, c.id);
|
|
709
|
-
sx.rowGroupModel.set(next);
|
|
710
|
-
return;
|
|
711
|
-
}
|
|
712
|
-
if (over.id === "columns-pills") {
|
|
713
|
-
api.columnUpdate(c, { hide: false });
|
|
714
|
-
api.columnMoveToVisibleIndex([c.id], 0);
|
|
715
|
-
sx.rowGroupModel.set((prev) => prev.filter((x) => x !== c.id));
|
|
716
|
-
return;
|
|
717
|
-
}
|
|
718
|
-
if (over.data.target === "columns") {
|
|
719
|
-
const id = over.data.id;
|
|
720
|
-
if (id === c.id) return;
|
|
721
|
-
api.columnUpdate(c, { hide: false });
|
|
722
|
-
if (isBefore) api.columnMoveBefore([c.id], id);
|
|
723
|
-
else api.columnMoveAfter([c.id], id);
|
|
724
|
-
sx.rowGroupModel.set((prev) => prev.filter((x) => x !== c.id));
|
|
725
|
-
return;
|
|
726
|
-
}
|
|
727
|
-
if (over.id === "column-pivots-pills") {
|
|
728
|
-
sx.rowGroupModel.set((prev) => prev.filter((x) => x !== c.id));
|
|
729
|
-
sx.columnPivotModel.set((prev) => [...prev, c.id]);
|
|
730
|
-
return;
|
|
731
|
-
}
|
|
732
|
-
if (over.data.target === "column-pivot") {
|
|
733
|
-
const id = over.data.id;
|
|
734
|
-
if (id === c.id) return;
|
|
735
|
-
sx.rowGroupModel.set((prev) => prev.filter((x) => x !== c.id));
|
|
736
|
-
sx.columnPivotModel.set((prev) => {
|
|
737
|
-
const next = [...prev];
|
|
738
|
-
const index = next.indexOf(id) + (isBefore ? 0 : 1);
|
|
739
|
-
next.splice(index, 0, c.id);
|
|
740
|
-
return next;
|
|
741
|
-
});
|
|
742
|
-
}
|
|
743
|
-
if (over.id === "aggregations-pills") {
|
|
744
|
-
const aggFn = c.aggFnDefault ?? c.aggFnsAllowed?.at(0) ?? base.aggFnsAllowed?.at(0);
|
|
745
|
-
if (!aggFn) return;
|
|
746
|
-
sx.aggModel.set((prev) => ({ ...prev, [c.id]: { fn: aggFn } }));
|
|
747
|
-
sx.rowGroupModel.set((prev) => prev.filter((x) => x !== c.id));
|
|
748
|
-
}
|
|
749
|
-
if (over.id === "measures-pills") {
|
|
750
|
-
const measureFn = c.measureFnDefault ?? c.measureFnsAllowed?.at(0) ?? base.measureFnsAllowed?.at(0);
|
|
751
|
-
if (!measureFn) return;
|
|
752
|
-
sx.measureModel.set((prev) => ({ ...prev, [c.id]: { fn: measureFn } }));
|
|
753
|
-
sx.rowGroupModel.set((prev) => prev.filter((x) => x !== c.id));
|
|
754
|
-
}
|
|
755
|
-
};
|
|
756
|
-
return {
|
|
757
|
-
kind: "row-group",
|
|
758
|
-
label: c.headerName ?? c.id,
|
|
759
|
-
active: true,
|
|
760
|
-
onClick: onToggle,
|
|
761
|
-
draggable: true,
|
|
762
|
-
isRowGroup: true,
|
|
763
|
-
dragEnd,
|
|
764
|
-
dragTags,
|
|
765
|
-
dropTags: ["row-group"],
|
|
766
|
-
dropData: { target: "row-group", id: c.id },
|
|
767
|
-
dropId: `row-group-${c.id}`
|
|
768
|
-
};
|
|
769
|
-
});
|
|
770
|
-
const inactiveItems = columns.filter((c) => api.columnIsRowGroupable(c) && !rowModel.includes(c.id)).map((c) => {
|
|
771
|
-
const onToggle = () => sx.rowGroupModel.set((prev) => [...prev, c.id]);
|
|
772
|
-
return {
|
|
773
|
-
kind: "row-group",
|
|
774
|
-
label: c.headerName ?? c.id,
|
|
775
|
-
active: false,
|
|
776
|
-
onClick: onToggle,
|
|
777
|
-
draggable: false,
|
|
778
|
-
dragTags: [],
|
|
779
|
-
dropTags: [],
|
|
780
|
-
dropData: {},
|
|
781
|
-
dropId: `row-group-${c.id}`
|
|
782
|
-
};
|
|
783
|
-
});
|
|
784
|
-
return [...activeItems, ...inactiveItems];
|
|
785
|
-
}, [
|
|
786
|
-
aggModel,
|
|
787
|
-
api,
|
|
788
|
-
base,
|
|
789
|
-
columns,
|
|
790
|
-
dir,
|
|
791
|
-
measureModel,
|
|
792
|
-
rowModel,
|
|
793
|
-
source,
|
|
794
|
-
sx.aggModel,
|
|
795
|
-
sx.columnPivotModel,
|
|
796
|
-
sx.measureModel,
|
|
797
|
-
sx.rowGroupModel,
|
|
798
|
-
sx.rtl
|
|
799
|
-
]);
|
|
800
|
-
}
|
|
801
|
-
function useColumnPivotSource(source, dir = "horizontal") {
|
|
802
|
-
const { api, state: sx } = useGrid();
|
|
803
|
-
const columns = sx.columns.use();
|
|
804
|
-
const pivotModel = sx.columnPivotModel.use();
|
|
805
|
-
const aggModel = sx.aggModel.use();
|
|
806
|
-
const measureModel = sx.measureModel.use();
|
|
807
|
-
const base = sx.columnBase.use();
|
|
808
|
-
return useMemo(() => {
|
|
809
|
-
if (source !== "column-pivots") return [];
|
|
810
|
-
const appliedPivots = new Set(pivotModel);
|
|
811
|
-
const canBePivoted = columns.filter(
|
|
812
|
-
(c) => !appliedPivots.has(c.id) && api.columnIsPivotable(c)
|
|
813
|
-
);
|
|
814
|
-
const pivotedColumns = pivotModel.map((c) => api.columnById(c));
|
|
815
|
-
const activeItems = pivotedColumns.map((c) => {
|
|
816
|
-
const onToggle = () => sx.columnPivotModel.set((prev) => prev.filter((x) => x !== c.id));
|
|
817
|
-
const dragTags = ["column-pivot"];
|
|
818
|
-
if (api.columnIsRowGroupable(c)) dragTags.push("row-group");
|
|
819
|
-
if (!api.columnIsVisible(c, true)) dragTags.push("columns");
|
|
820
|
-
if (!aggModel[c.id] && canAgg(c, base)) dragTags.push("aggregations");
|
|
821
|
-
if (!measureModel[c.id] && canMeasure(c, base)) dragTags.push("measures");
|
|
822
|
-
const dragEnd = (d) => {
|
|
823
|
-
const over = d.over.at(-1);
|
|
824
|
-
if (!over || !over.canDrop) return;
|
|
825
|
-
const isBefore = dir === "horizontal" ? (sx.rtl.peek() ? "right" : "left") === over.xHalf : over.yHalf === "top";
|
|
826
|
-
if (over.data.target === "column-pivot") {
|
|
827
|
-
const id = over.data.id;
|
|
828
|
-
if (id === c.id) return;
|
|
829
|
-
const myIndex = pivotModel.indexOf(c.id);
|
|
830
|
-
const next = [...pivotModel];
|
|
831
|
-
next.splice(myIndex, 1);
|
|
832
|
-
const targetIndex = next.indexOf(id);
|
|
833
|
-
next.splice(targetIndex + (isBefore ? 0 : 1), 0, c.id);
|
|
834
|
-
sx.columnPivotModel.set(next);
|
|
835
|
-
return;
|
|
836
|
-
}
|
|
837
|
-
if (over.id === "columns-pills") {
|
|
838
|
-
api.columnUpdate(c, { hide: false });
|
|
839
|
-
api.columnMoveToVisibleIndex([c.id], 0);
|
|
840
|
-
sx.columnPivotModel.set((prev) => prev.filter((x) => x !== c.id));
|
|
841
|
-
return;
|
|
842
|
-
}
|
|
843
|
-
if (over.data.target === "columns") {
|
|
844
|
-
const id = over.data.id;
|
|
845
|
-
if (id === c.id) return;
|
|
846
|
-
api.columnUpdate(c, { hide: false });
|
|
847
|
-
if (isBefore) api.columnMoveBefore([c.id], id);
|
|
848
|
-
else api.columnMoveAfter([c.id], id);
|
|
849
|
-
sx.columnPivotModel.set((prev) => prev.filter((x) => x !== c.id));
|
|
850
|
-
return;
|
|
851
|
-
}
|
|
852
|
-
if (over.id === "row-groups-pills") {
|
|
853
|
-
sx.columnPivotModel.set((prev) => prev.filter((x) => x !== c.id));
|
|
854
|
-
sx.rowGroupModel.set((prev) => [...prev, c.id]);
|
|
855
|
-
return;
|
|
856
|
-
}
|
|
857
|
-
if (over.data.target === "row-group") {
|
|
858
|
-
const id = over.data.id;
|
|
859
|
-
if (id === c.id) return;
|
|
860
|
-
sx.columnPivotModel.set((prev) => prev.filter((x) => x !== c.id));
|
|
861
|
-
sx.rowGroupModel.set((prev) => {
|
|
862
|
-
const next = [...prev];
|
|
863
|
-
const index = next.indexOf(id) + (isBefore ? 0 : 1);
|
|
864
|
-
next.splice(index, 0, c.id);
|
|
865
|
-
return next;
|
|
866
|
-
});
|
|
867
|
-
}
|
|
868
|
-
if (over.id === "aggregations-pills") {
|
|
869
|
-
const aggFn = c.aggFnDefault ?? c.aggFnsAllowed?.at(0) ?? base.aggFnsAllowed?.at(0);
|
|
870
|
-
if (!aggFn) return;
|
|
871
|
-
sx.aggModel.set((prev) => ({ ...prev, [c.id]: { fn: aggFn } }));
|
|
872
|
-
sx.columnPivotModel.set((prev) => prev.filter((x) => x !== c.id));
|
|
873
|
-
}
|
|
874
|
-
if (over.id === "measures-pills") {
|
|
875
|
-
const measureFn = c.measureFnDefault ?? c.measureFnsAllowed?.at(0) ?? base.measureFnsAllowed?.at(0);
|
|
876
|
-
if (!measureFn) return;
|
|
877
|
-
sx.measureModel.set((prev) => ({ ...prev, [c.id]: { fn: measureFn } }));
|
|
878
|
-
sx.columnPivotModel.set((prev) => prev.filter((x) => x !== c.id));
|
|
879
|
-
}
|
|
880
|
-
};
|
|
881
|
-
return {
|
|
882
|
-
kind: "column-pivot",
|
|
883
|
-
label: c.headerName ?? c.id,
|
|
884
|
-
active: true,
|
|
885
|
-
onClick: onToggle,
|
|
886
|
-
dragEnd,
|
|
887
|
-
dropId: `pivot-${c.id}`,
|
|
888
|
-
draggable: true,
|
|
889
|
-
isColumnPivot: true,
|
|
890
|
-
dragTags,
|
|
891
|
-
dropTags: ["column-pivot"],
|
|
892
|
-
dropData: { target: "column-pivot", id: c.id }
|
|
893
|
-
};
|
|
894
|
-
});
|
|
895
|
-
const inactiveItems = canBePivoted.map((c) => {
|
|
896
|
-
const onToggle = () => sx.columnPivotModel.set((prev) => [...prev, c.id]);
|
|
897
|
-
return {
|
|
898
|
-
kind: "column-pivot",
|
|
899
|
-
label: c.headerName ?? c.id,
|
|
900
|
-
active: false,
|
|
901
|
-
onClick: onToggle,
|
|
902
|
-
draggable: false,
|
|
903
|
-
dropId: `pivot-${c.id}`,
|
|
904
|
-
dragTags: [],
|
|
905
|
-
dropTags: [],
|
|
906
|
-
dropData: {}
|
|
907
|
-
};
|
|
908
|
-
});
|
|
909
|
-
return [...activeItems, ...inactiveItems];
|
|
910
|
-
}, [
|
|
911
|
-
aggModel,
|
|
912
|
-
api,
|
|
913
|
-
base,
|
|
914
|
-
columns,
|
|
915
|
-
dir,
|
|
916
|
-
measureModel,
|
|
917
|
-
pivotModel,
|
|
918
|
-
source,
|
|
919
|
-
sx.aggModel,
|
|
920
|
-
sx.columnPivotModel,
|
|
921
|
-
sx.measureModel,
|
|
922
|
-
sx.rowGroupModel,
|
|
923
|
-
sx.rtl
|
|
924
|
-
]);
|
|
925
|
-
}
|
|
926
|
-
function PillManagerAggMenu({ column, grid }) {
|
|
927
|
-
const base = grid.state.columnBase.use();
|
|
928
|
-
const aggModel = grid.state.aggModel.use();
|
|
929
|
-
const agg = aggModel[column.id]?.fn;
|
|
930
|
-
let allowed = column.aggFnsAllowed ?? base.aggFnsAllowed ?? [];
|
|
931
|
-
if (typeof agg === "function") allowed = ["Fn(x)", ...allowed];
|
|
932
|
-
else if (typeof agg === "string" && !allowed.includes(agg)) allowed = [agg, ...allowed];
|
|
933
|
-
return /* @__PURE__ */ jsx(Menu.Container, { children: /* @__PURE__ */ jsx(
|
|
934
|
-
Menu.RadioGroup,
|
|
935
|
-
{
|
|
936
|
-
value: typeof agg === "function" ? "Fn(x)" : agg ?? "",
|
|
937
|
-
onValueChange: (v) => {
|
|
938
|
-
if (v === "Fn(x)") return;
|
|
939
|
-
const next = { ...aggModel };
|
|
940
|
-
next[column.id] = {
|
|
941
|
-
...next[column.id],
|
|
942
|
-
fn: v
|
|
943
|
-
};
|
|
944
|
-
grid.state.aggModel.set(next);
|
|
945
|
-
},
|
|
946
|
-
children: allowed.map((c) => {
|
|
947
|
-
return /* @__PURE__ */ jsxs(Menu.Radio, { value: c, closeOnClick: true, children: [
|
|
948
|
-
c,
|
|
949
|
-
/* @__PURE__ */ jsx(Menu.RadioIndicator, {})
|
|
950
|
-
] }, c);
|
|
951
|
-
})
|
|
952
|
-
}
|
|
953
|
-
) });
|
|
954
|
-
}
|
|
955
|
-
function PillManagerMeasureMenu({ column, grid }) {
|
|
956
|
-
const base = grid.state.columnBase.use();
|
|
957
|
-
const measureModel = grid.state.measureModel.use();
|
|
958
|
-
const agg = measureModel[column.id].fn;
|
|
959
|
-
let allowed = column.measureFnsAllowed ?? base.measureFnsAllowed ?? [];
|
|
960
|
-
if (typeof agg === "function") allowed = ["Fn(x)", ...allowed];
|
|
961
|
-
else if (typeof agg === "string" && !allowed.includes(agg)) allowed = [agg, ...allowed];
|
|
962
|
-
return /* @__PURE__ */ jsx(Menu.Container, { children: /* @__PURE__ */ jsx(
|
|
963
|
-
Menu.RadioGroup,
|
|
964
|
-
{
|
|
965
|
-
value: typeof agg === "function" ? "Fn(x)" : agg ?? "",
|
|
966
|
-
onValueChange: (v) => {
|
|
967
|
-
if (v === "Fn(x)") return;
|
|
968
|
-
const next = { ...measureModel };
|
|
969
|
-
next[column.id] = {
|
|
970
|
-
...next[column.id],
|
|
971
|
-
fn: v
|
|
972
|
-
};
|
|
973
|
-
grid.state.measureModel.set(next);
|
|
974
|
-
},
|
|
975
|
-
children: allowed.map((c) => {
|
|
976
|
-
return /* @__PURE__ */ jsxs(Menu.Radio, { value: c, closeOnClick: true, children: [
|
|
977
|
-
c,
|
|
978
|
-
/* @__PURE__ */ jsx(Menu.RadioIndicator, {})
|
|
979
|
-
] }, c);
|
|
980
|
-
})
|
|
981
|
-
}
|
|
982
|
-
) });
|
|
983
|
-
}
|
|
984
|
-
const Pill = forwardRef(
|
|
985
|
-
function Pill2({ className, interactive, kind = "plain", ...props }, ref) {
|
|
986
|
-
return /* @__PURE__ */ jsx(
|
|
987
|
-
"div",
|
|
988
|
-
{
|
|
989
|
-
...props,
|
|
990
|
-
className: clsx("lng1771-pill", className),
|
|
991
|
-
ref,
|
|
992
|
-
"data-pill-interactive": interactive,
|
|
993
|
-
"data-pill-kind": kind
|
|
994
|
-
}
|
|
995
|
-
);
|
|
996
|
-
}
|
|
997
|
-
);
|
|
998
|
-
export {
|
|
999
|
-
MenuTrigger as M,
|
|
1000
|
-
Pill as P,
|
|
1001
|
-
canMeasure as a,
|
|
1002
|
-
useMeasuresSource as b,
|
|
1003
|
-
canAgg as c,
|
|
1004
|
-
useRowGroupsSource as d,
|
|
1005
|
-
useColumnPivotSource as e,
|
|
1006
|
-
useDroppable as f,
|
|
1007
|
-
useEdgeScroll as g,
|
|
1008
|
-
useDraggable as h,
|
|
1009
|
-
PillManagerAggMenu as i,
|
|
1010
|
-
PillManagerMeasureMenu as j,
|
|
1011
|
-
useAggregationSource as u
|
|
1012
|
-
};
|