@1771technologies/lytenyte-pro 2.0.0-dev.0 → 2.0.0-dev.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/__play__/alpha.play.d.ts +3 -0
- package/dist/__play__/alpha.play.js +56 -0
- package/dist/__play__/basic-server-data/data.d.ts +10 -0
- package/dist/__play__/basic-server-data/data.js +17746 -0
- package/dist/__play__/basic-server-data/server.d.ts +36 -0
- package/dist/__play__/basic-server-data/server.js +105 -0
- package/dist/__play__/buttons.play.d.ts +4 -0
- package/dist/__play__/buttons.play.js +7 -0
- package/dist/__play__/inputs.play.d.ts +3 -0
- package/dist/__play__/inputs.play.js +13 -0
- package/dist/__play__/server.play.d.ts +3 -0
- package/dist/__play__/server.play.js +66 -0
- package/dist/__play__/tree.play.d.ts +3 -0
- package/dist/__play__/tree.play.js +47 -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 +3 -0
- package/dist/cell-selection/bound-selection-rect.js +16 -0
- package/dist/cell-selection/cell-selection-containers.d.ts +3 -0
- package/dist/cell-selection/cell-selection-containers.js +86 -0
- package/dist/cell-selection/cell-selection-driver/cell-selection-driver.d.ts +1 -0
- package/dist/cell-selection/cell-selection-driver/cell-selection-driver.js +279 -0
- package/dist/cell-selection/cell-selection-driver/use-cell-focus-change.d.ts +6 -0
- package/dist/cell-selection/cell-selection-driver/use-cell-focus-change.js +34 -0
- package/dist/cell-selection/cell-style-row.d.ts +8 -0
- package/dist/cell-selection/cell-style-row.js +79 -0
- package/dist/cell-selection/data-rect-from-cell-position.d.ts +3 -0
- package/dist/cell-selection/data-rect-from-cell-position.js +17 -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-selection-down.d.ts +3 -0
- package/dist/cell-selection/expand-selection-down.js +78 -0
- package/dist/cell-selection/expand-selection-end.d.ts +3 -0
- package/dist/cell-selection/expand-selection-end.js +76 -0
- package/dist/cell-selection/expand-selection-start.d.ts +3 -0
- package/dist/cell-selection/expand-selection-start.js +73 -0
- package/dist/cell-selection/expand-selection-up.d.ts +3 -0
- package/dist/cell-selection/expand-selection-up.js +74 -0
- package/dist/cell-selection/full-width-start-end-index.d.ts +2 -0
- package/dist/cell-selection/full-width-start-end-index.js +4 -0
- package/dist/cell-selection/get-root-cell.d.ts +3 -0
- package/dist/cell-selection/get-root-cell.js +6 -0
- package/dist/cell-selection/index.d.ts +13 -0
- package/dist/cell-selection/index.js +13 -0
- package/dist/cell-selection/is-bottom-rect.d.ts +2 -0
- package/dist/cell-selection/is-bottom-rect.js +4 -0
- package/dist/cell-selection/is-center-col-rect.d.ts +5 -0
- package/dist/cell-selection/is-center-col-rect.js +3 -0
- package/dist/cell-selection/is-center-rect.d.ts +2 -0
- package/dist/cell-selection/is-center-rect.js +4 -0
- package/dist/cell-selection/is-end-rect.d.ts +5 -0
- package/dist/cell-selection/is-end-rect.js +3 -0
- package/dist/cell-selection/is-fully-within-rect.d.ts +2 -0
- package/dist/cell-selection/is-fully-within-rect.js +6 -0
- package/dist/cell-selection/is-overlapping-rect.d.ts +2 -0
- package/dist/cell-selection/is-overlapping-rect.js +5 -0
- package/dist/cell-selection/is-start-rect.d.ts +5 -0
- package/dist/cell-selection/is-start-rect.js +3 -0
- package/dist/cell-selection/is-top-rect.d.ts +2 -0
- package/dist/cell-selection/is-top-rect.js +3 -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 +47 -0
- package/dist/cell-selection/split-cell-selection-rect.js +88 -0
- package/dist/cell-selection/split-on-pivot.d.ts +3 -0
- package/dist/cell-selection/split-on-pivot.js +50 -0
- package/dist/cell-selection/update-additive-cell-selection.d.ts +4 -0
- package/dist/cell-selection/update-additive-cell-selection.js +21 -0
- package/dist/cell-selection/use-edge-scroll.d.ts +6 -0
- package/dist/cell-selection/use-edge-scroll.js +71 -0
- package/dist/components/checkbox/checkbox.d.ts +15 -0
- package/dist/components/checkbox/checkbox.js +42 -0
- package/dist/components/checkbox/checkbox.play.d.ts +2 -0
- package/dist/components/checkbox/checkbox.play.js +6 -0
- package/dist/components/column-manager/column-manager.d.ts +13 -0
- package/dist/components/column-manager/column-manager.js +47 -0
- package/dist/components/external/clsx.d.ts +2 -0
- package/dist/components/external/clsx.js +44 -0
- package/dist/components/external/floating-ui.d.ts +268 -0
- package/dist/components/external/floating-ui.js +1802 -0
- package/dist/components/headless/dialog/arrow.d.ts +6 -0
- package/dist/components/headless/dialog/arrow.js +16 -0
- package/dist/components/headless/dialog/close.d.ts +10 -0
- package/dist/components/headless/dialog/close.js +22 -0
- package/dist/components/headless/dialog/container.d.ts +5 -0
- package/dist/components/headless/dialog/container.js +221 -0
- package/dist/components/headless/dialog/context.d.ts +32 -0
- package/dist/components/headless/dialog/context.js +3 -0
- package/dist/components/headless/dialog/description.d.ts +9 -0
- package/dist/components/headless/dialog/description.js +20 -0
- package/dist/components/headless/dialog/index.parts.d.ts +30 -0
- package/dist/components/headless/dialog/index.parts.js +17 -0
- package/dist/components/headless/dialog/root.d.ts +32 -0
- package/dist/components/headless/dialog/root.js +75 -0
- package/dist/components/headless/dialog/title.d.ts +9 -0
- package/dist/components/headless/dialog/title.js +20 -0
- package/dist/components/headless/dialog/transform-origin.d.ts +5 -0
- package/dist/components/headless/dialog/transform-origin.js +38 -0
- package/dist/components/headless/dialog/trigger.d.ts +10 -0
- package/dist/components/headless/dialog/trigger.js +24 -0
- package/dist/components/headless/dialog/use-dialog.d.ts +4 -0
- package/dist/components/headless/dialog/use-dialog.js +12 -0
- package/dist/components/headless/menu/checkbox-item.d.ts +11 -0
- package/dist/components/headless/menu/checkbox-item.js +42 -0
- package/dist/components/headless/menu/combo/combo-checkbox.d.ts +11 -0
- package/dist/components/headless/menu/combo/combo-checkbox.js +38 -0
- package/dist/components/headless/menu/combo/combo-context.d.ts +9 -0
- package/dist/components/headless/menu/combo/combo-context.js +3 -0
- package/dist/components/headless/menu/combo/combo-input.d.ts +7 -0
- package/dist/components/headless/menu/combo/combo-input.js +58 -0
- package/dist/components/headless/menu/combo/combo-menu.d.ts +5 -0
- package/dist/components/headless/menu/combo/combo-menu.js +24 -0
- package/dist/components/headless/menu/combo/combo-option.d.ts +9 -0
- package/dist/components/headless/menu/combo/combo-option.js +37 -0
- package/dist/components/headless/menu/container.d.ts +5 -0
- package/dist/components/headless/menu/container.js +19 -0
- package/dist/components/headless/menu/dom.d.ts +4 -0
- package/dist/components/headless/menu/dom.js +20 -0
- package/dist/components/headless/menu/index.d.ts +54 -0
- package/dist/components/headless/menu/index.js +39 -0
- package/dist/components/headless/menu/item/handle-vertical-navigation.d.ts +2 -0
- package/dist/components/headless/menu/item/handle-vertical-navigation.js +28 -0
- package/dist/components/headless/menu/item/item.d.ts +9 -0
- package/dist/components/headless/menu/item/item.js +45 -0
- package/dist/components/headless/menu/item/use-menu-item-events.d.ts +1 -0
- package/dist/components/headless/menu/item/use-menu-item-events.js +25 -0
- package/dist/components/headless/menu/menu-divider.d.ts +5 -0
- package/dist/components/headless/menu/menu-divider.js +6 -0
- package/dist/components/headless/menu/menu-group.d.ts +5 -0
- package/dist/components/headless/menu/menu-group.js +6 -0
- package/dist/components/headless/menu/menu-header.d.ts +5 -0
- package/dist/components/headless/menu/menu-header.js +6 -0
- package/dist/components/headless/menu/popover.d.ts +5 -0
- package/dist/components/headless/menu/popover.js +7 -0
- package/dist/components/headless/menu/radio-group/context.d.ts +11 -0
- package/dist/components/headless/menu/radio-group/context.js +7 -0
- package/dist/components/headless/menu/radio-group/radio-item.d.ts +10 -0
- package/dist/components/headless/menu/radio-group/radio-item.js +44 -0
- package/dist/components/headless/menu/submenu/submenu-context.d.ts +9 -0
- package/dist/components/headless/menu/submenu/submenu-context.js +3 -0
- package/dist/components/headless/menu/submenu/submenu-trigger.d.ts +7 -0
- package/dist/components/headless/menu/submenu/submenu-trigger.js +70 -0
- package/dist/components/headless/menu/submenu/submenu.d.ts +21 -0
- package/dist/components/headless/menu/submenu/submenu.js +55 -0
- package/dist/components/headless/menu/submenu/use-submenu-position.d.ts +5 -0
- package/dist/components/headless/menu/submenu/use-submenu-position.js +31 -0
- package/dist/components/headless/menu/use-menu.d.ts +1 -0
- package/dist/components/headless/menu/use-menu.js +52 -0
- package/dist/components/headless/popover/container.d.ts +5 -0
- package/dist/components/headless/popover/container.js +7 -0
- package/dist/components/headless/popover/context.d.ts +6 -0
- package/dist/components/headless/popover/context.js +3 -0
- package/dist/components/headless/popover/index.d.ts +30 -0
- package/dist/components/headless/popover/index.js +17 -0
- package/dist/components/headless/popover/root.d.ts +6 -0
- package/dist/components/headless/popover/root.js +8 -0
- package/dist/components/headless/popover/trigger.d.ts +7 -0
- package/dist/components/headless/popover/trigger.js +11 -0
- package/dist/components/pill-manager/container.d.ts +5 -0
- package/dist/components/pill-manager/container.js +127 -0
- package/dist/components/pill-manager/expander.d.ts +9 -0
- package/dist/components/pill-manager/expander.js +21 -0
- package/dist/components/pill-manager/icons.d.ts +12 -0
- package/dist/components/pill-manager/icons.js +35 -0
- package/dist/components/pill-manager/index.d.ts +33 -0
- package/dist/components/pill-manager/index.js +13 -0
- package/dist/components/pill-manager/item.d.ts +10 -0
- package/dist/components/pill-manager/item.js +178 -0
- package/dist/components/pill-manager/label.d.ts +10 -0
- package/dist/components/pill-manager/label.js +31 -0
- package/dist/components/pill-manager/pill-manager.play.d.ts +3 -0
- package/dist/components/pill-manager/pill-manager.play.js +73 -0
- package/dist/components/pill-manager/pill-row.context.d.ts +8 -0
- package/dist/components/pill-manager/pill-row.context.js +4 -0
- package/dist/components/pill-manager/pill-row.d.ts +12 -0
- package/dist/components/pill-manager/pill-row.js +22 -0
- package/dist/components/pill-manager/root.context.d.ts +40 -0
- package/dist/components/pill-manager/root.context.js +4 -0
- package/dist/components/pill-manager/root.d.ts +25 -0
- package/dist/components/pill-manager/root.js +33 -0
- package/dist/components/pill-manager/row-default.d.ts +3 -0
- package/dist/components/pill-manager/row-default.js +14 -0
- package/dist/components/pill-manager/types.d.ts +21 -0
- package/dist/components/pill-manager/types.js +1 -0
- package/dist/components/row-group-cell.d.ts +13 -0
- package/dist/components/row-group-cell.js +40 -0
- package/dist/components/select-all.d.ts +12 -0
- package/dist/components/select-all.js +34 -0
- package/dist/components/smart-select/chip-context.d.ts +8 -0
- package/dist/components/smart-select/chip-context.js +4 -0
- package/dist/components/smart-select/chip-remove.d.ts +1 -0
- package/dist/components/smart-select/chip-remove.js +13 -0
- package/dist/components/smart-select/chip.d.ts +13 -0
- package/dist/components/smart-select/chip.js +79 -0
- package/dist/components/smart-select/container.d.ts +1 -0
- package/dist/components/smart-select/container.js +13 -0
- package/dist/components/smart-select/context.d.ts +31 -0
- package/dist/components/smart-select/context.js +4 -0
- package/dist/components/smart-select/index.d.ts +30 -0
- package/dist/components/smart-select/index.js +19 -0
- package/dist/components/smart-select/option.d.ts +8 -0
- package/dist/components/smart-select/option.js +36 -0
- package/dist/components/smart-select/root.d.ts +17 -0
- package/dist/components/smart-select/root.js +165 -0
- package/dist/components/smart-select/smart-select.play.d.ts +2 -0
- package/dist/components/smart-select/smart-select.play.js +36 -0
- package/dist/components/smart-select/triggers/basic-trigger.d.ts +1 -0
- package/dist/components/smart-select/triggers/basic-trigger.js +18 -0
- package/dist/components/smart-select/triggers/combo-trigger.d.ts +1 -0
- package/dist/components/smart-select/triggers/combo-trigger.js +17 -0
- package/dist/components/smart-select/triggers/is-selectable-option.d.ts +1 -0
- package/dist/components/smart-select/triggers/is-selectable-option.js +3 -0
- package/dist/components/smart-select/triggers/multi-combo-trigger.d.ts +11 -0
- package/dist/components/smart-select/triggers/multi-combo-trigger.js +38 -0
- package/dist/components/smart-select/triggers/multi-trigger.d.ts +6 -0
- package/dist/components/smart-select/triggers/multi-trigger.js +8 -0
- package/dist/components/smart-select/triggers/use-combo-controls.d.ts +9 -0
- package/dist/components/smart-select/triggers/use-combo-controls.js +145 -0
- package/dist/components/smart-select/triggers/use-trigger-controls.d.ts +5 -0
- package/dist/components/smart-select/triggers/use-trigger-controls.js +126 -0
- package/dist/components/smart-select/type.d.ts +44 -0
- package/dist/components/smart-select/type.js +1 -0
- package/dist/components/smart-select/use-async-options.d.ts +8 -0
- package/dist/components/smart-select/use-async-options.js +42 -0
- package/dist/components/tree-view/index.d.ts +4 -0
- package/dist/components/tree-view/index.js +2 -0
- package/dist/components/tree-view/root.d.ts +37 -0
- package/dist/components/tree-view/root.js +139 -0
- package/dist/components/tree-view/select-all.d.ts +7 -0
- package/dist/components/tree-view/select-all.js +22 -0
- package/dist/components/tree-view/tree-children.d.ts +2 -0
- package/dist/components/tree-view/tree-children.js +15 -0
- package/dist/components/tree-view/types.d.ts +31 -0
- package/dist/components/tree-view/types.js +1 -0
- package/dist/components/types.d.ts +4 -0
- package/dist/components/types.js +1 -0
- package/dist/components/virtual-from-coordinates.d.ts +2 -0
- package/dist/components/virtual-from-coordinates.js +15 -0
- package/dist/components.d.ts +16 -0
- package/dist/components.js +11 -0
- package/dist/data-source-client/hooks/get-valid-leafs.d.ts +3 -0
- package/dist/data-source-client/hooks/get-valid-leafs.js +11 -0
- package/dist/data-source-client/hooks/use-controlled-ds-state.d.ts +13 -0
- package/dist/data-source-client/hooks/use-controlled-ds-state.js +39 -0
- package/dist/data-source-client/hooks/use-flattened-data.d.ts +18 -0
- package/dist/data-source-client/hooks/use-flattened-data.js +40 -0
- package/dist/data-source-client/hooks/use-flattened-groups.d.ts +5 -0
- package/dist/data-source-client/hooks/use-flattened-groups.js +63 -0
- package/dist/data-source-client/hooks/use-flattened-piece.d.ts +14 -0
- package/dist/data-source-client/hooks/use-flattened-piece.js +55 -0
- package/dist/data-source-client/hooks/use-group-tree/collapse-child.d.ts +2 -0
- package/dist/data-source-client/hooks/use-group-tree/collapse-child.js +11 -0
- package/dist/data-source-client/hooks/use-group-tree/collapse-last.d.ts +2 -0
- package/dist/data-source-client/hooks/use-group-tree/collapse-last.js +14 -0
- package/dist/data-source-client/hooks/use-group-tree/collapse.d.ts +2 -0
- package/dist/data-source-client/hooks/use-group-tree/collapse.js +17 -0
- package/dist/data-source-client/hooks/use-group-tree/use-group-tree.d.ts +31 -0
- package/dist/data-source-client/hooks/use-group-tree/use-group-tree.js +152 -0
- package/dist/data-source-client/hooks/use-pivot/auxiliary-functions/apply-reference-column.d.ts +2 -0
- package/dist/data-source-client/hooks/use-pivot/auxiliary-functions/apply-reference-column.js +22 -0
- package/dist/data-source-client/hooks/use-pivot/auxiliary-functions/evaluate-label-filter.d.ts +2 -0
- package/dist/data-source-client/hooks/use-pivot/auxiliary-functions/evaluate-label-filter.js +9 -0
- package/dist/data-source-client/hooks/use-pivot/auxiliary-functions/pivot-paths-with-totals.d.ts +18 -0
- package/dist/data-source-client/hooks/use-pivot/auxiliary-functions/pivot-paths-with-totals.js +140 -0
- package/dist/data-source-client/hooks/use-pivot/auxiliary-functions/pivot-paths.d.ts +4 -0
- package/dist/data-source-client/hooks/use-pivot/auxiliary-functions/pivot-paths.js +31 -0
- package/dist/data-source-client/hooks/use-pivot/use-agg-model.d.ts +4 -0
- package/dist/data-source-client/hooks/use-pivot/use-agg-model.js +45 -0
- package/dist/data-source-client/hooks/use-pivot/use-filtered-data.d.ts +2 -0
- package/dist/data-source-client/hooks/use-pivot/use-filtered-data.js +18 -0
- package/dist/data-source-client/hooks/use-pivot/use-pivot-columns.d.ts +14 -0
- package/dist/data-source-client/hooks/use-pivot/use-pivot-columns.js +151 -0
- package/dist/data-source-client/hooks/use-pivot/use-pivot-data.d.ts +32 -0
- package/dist/data-source-client/hooks/use-pivot/use-pivot-data.js +83 -0
- package/dist/data-source-client/hooks/use-pivot/use-pivot-group-fn.d.ts +4 -0
- package/dist/data-source-client/hooks/use-pivot/use-pivot-group-fn.js +23 -0
- package/dist/data-source-client/hooks/use-pivot/use-pivot-state.d.ts +16 -0
- package/dist/data-source-client/hooks/use-pivot/use-pivot-state.js +40 -0
- package/dist/data-source-client/use-client-data-source.d.ts +91 -0
- package/dist/data-source-client/use-client-data-source.js +169 -0
- package/dist/data-source-server/async-tree/+constants.async-tree.d.ts +1 -0
- package/dist/data-source-server/async-tree/+constants.async-tree.js +1 -0
- package/dist/data-source-server/async-tree/apply-delete-action-to-tree.d.ts +2 -0
- package/dist/data-source-server/async-tree/apply-delete-action-to-tree.js +27 -0
- package/dist/data-source-server/async-tree/apply-set-action-to-tree.d.ts +2 -0
- package/dist/data-source-server/async-tree/apply-set-action-to-tree.js +26 -0
- package/dist/data-source-server/async-tree/data-integrity-checks/check-set-action-item-keys-are-unique.d.ts +2 -0
- package/dist/data-source-server/async-tree/data-integrity-checks/check-set-action-item-keys-are-unique.js +20 -0
- package/dist/data-source-server/async-tree/data-integrity-checks/check-set-action-item-keys-are-valid.d.ts +2 -0
- package/dist/data-source-server/async-tree/data-integrity-checks/check-set-action-item-keys-are-valid.js +12 -0
- package/dist/data-source-server/async-tree/data-integrity-checks/check-set-action-item-keys-fit.d.ts +2 -0
- package/dist/data-source-server/async-tree/data-integrity-checks/check-set-action-item-keys-fit.js +18 -0
- package/dist/data-source-server/async-tree/data-integrity-checks/check-set-action-item-kinds.d.ts +2 -0
- package/dist/data-source-server/async-tree/data-integrity-checks/check-set-action-item-kinds.js +12 -0
- package/dist/data-source-server/async-tree/data-integrity-checks/check-set-action.d.ts +2 -0
- package/dist/data-source-server/async-tree/data-integrity-checks/check-set-action.js +24 -0
- package/dist/data-source-server/async-tree/get-parent-node-by-path.d.ts +2 -0
- package/dist/data-source-server/async-tree/get-parent-node-by-path.js +18 -0
- package/dist/data-source-server/async-tree/is-set-action-a-no-op-on-node.d.ts +2 -0
- package/dist/data-source-server/async-tree/is-set-action-a-no-op-on-node.js +3 -0
- package/dist/data-source-server/async-tree/make-async-tree.d.ts +2 -0
- package/dist/data-source-server/async-tree/make-async-tree.js +64 -0
- package/dist/data-source-server/async-tree/maybe-apply-parent-remove-self.d.ts +2 -0
- package/dist/data-source-server/async-tree/maybe-apply-parent-remove-self.js +8 -0
- package/dist/data-source-server/async-tree/maybe-apply-resize.d.ts +2 -0
- package/dist/data-source-server/async-tree/maybe-apply-resize.js +17 -0
- package/dist/data-source-server/async-tree/maybe-apply-set-action-items.d.ts +2 -0
- package/dist/data-source-server/async-tree/maybe-apply-set-action-items.js +54 -0
- package/dist/data-source-server/async-tree/types.d.ts +70 -0
- package/dist/data-source-server/async-tree/types.js +1 -0
- package/dist/data-source-server/range-tree/range-tree.d.ts +66 -0
- package/dist/data-source-server/range-tree/range-tree.js +102 -0
- package/dist/data-source-server/server-data.d.ts +73 -0
- package/dist/data-source-server/server-data.js +553 -0
- package/dist/data-source-server/source/use-on-rows-updated.d.ts +4 -0
- package/dist/data-source-server/source/use-on-rows-updated.js +29 -0
- package/dist/data-source-server/source/use-on-view-change.d.ts +3 -0
- package/dist/data-source-server/source/use-on-view-change.js +13 -0
- package/dist/data-source-server/source/use-row-add.d.ts +3 -0
- package/dist/data-source-server/source/use-row-add.js +36 -0
- package/dist/data-source-server/source/use-row-by-id.d.ts +2 -0
- package/dist/data-source-server/source/use-row-by-id.js +8 -0
- package/dist/data-source-server/source/use-row-by-index.d.ts +9 -0
- package/dist/data-source-server/source/use-row-by-index.js +89 -0
- package/dist/data-source-server/source/use-row-children.d.ts +2 -0
- package/dist/data-source-server/source/use-row-children.js +16 -0
- package/dist/data-source-server/source/use-row-delete.d.ts +3 -0
- package/dist/data-source-server/source/use-row-delete.js +39 -0
- package/dist/data-source-server/source/use-row-id-to-row-index.d.ts +2 -0
- package/dist/data-source-server/source/use-row-id-to-row-index.js +7 -0
- package/dist/data-source-server/source/use-row-index-to-row-id.d.ts +2 -0
- package/dist/data-source-server/source/use-row-index-to-row-id.js +7 -0
- package/dist/data-source-server/source/use-row-leafs.d.ts +2 -0
- package/dist/data-source-server/source/use-row-leafs.js +20 -0
- package/dist/data-source-server/source/use-row-parents.d.ts +2 -0
- package/dist/data-source-server/source/use-row-parents.js +16 -0
- package/dist/data-source-server/source/use-row-siblings.d.ts +2 -0
- package/dist/data-source-server/source/use-row-siblings.js +15 -0
- package/dist/data-source-server/source/use-rows-between.d.ts +2 -0
- package/dist/data-source-server/source/use-rows-between.js +20 -0
- package/dist/data-source-server/source/use-source-state.d.ts +28 -0
- package/dist/data-source-server/source/use-source-state.js +47 -0
- package/dist/data-source-server/source/use-source.d.ts +5 -0
- package/dist/data-source-server/source/use-source.js +66 -0
- package/dist/data-source-server/types.d.ts +42 -0
- package/dist/data-source-server/types.js +1 -0
- package/dist/data-source-server/use-server-data-source.d.ts +51 -0
- package/dist/data-source-server/use-server-data-source.js +192 -0
- package/dist/data-source-server/utils/get-node-depth.d.ts +2 -0
- package/dist/data-source-server/utils/get-node-depth.js +9 -0
- package/dist/data-source-server/utils/get-node-path.d.ts +2 -0
- package/dist/data-source-server/utils/get-node-path.js +9 -0
- package/dist/data-source-server/utils/get-request-id.d.ts +1 -0
- package/dist/data-source-server/utils/get-request-id.js +6 -0
- package/dist/data-source-tree/source/use-controlled-state.d.ts +8 -0
- package/dist/data-source-tree/source/use-controlled-state.js +21 -0
- package/dist/data-source-tree/source/use-flattened.d.ts +17 -0
- package/dist/data-source-tree/source/use-flattened.js +65 -0
- package/dist/data-source-tree/source/use-on-rows-updated.d.ts +3 -0
- package/dist/data-source-tree/source/use-on-rows-updated.js +49 -0
- package/dist/data-source-tree/source/use-row-by-id.d.ts +2 -0
- package/dist/data-source-tree/source/use-row-by-id.js +7 -0
- package/dist/data-source-tree/source/use-row-children.d.ts +2 -0
- package/dist/data-source-tree/source/use-row-children.js +11 -0
- package/dist/data-source-tree/source/use-row-leafs.d.ts +2 -0
- package/dist/data-source-tree/source/use-row-leafs.js +20 -0
- package/dist/data-source-tree/source/use-row-parents.d.ts +2 -0
- package/dist/data-source-tree/source/use-row-parents.js +16 -0
- package/dist/data-source-tree/source/use-row-siblings.d.ts +2 -0
- package/dist/data-source-tree/source/use-row-siblings.js +12 -0
- package/dist/data-source-tree/source/use-tree.d.ts +3 -0
- package/dist/data-source-tree/source/use-tree.js +59 -0
- package/dist/data-source-tree/types.d.ts +16 -0
- package/dist/data-source-tree/types.js +1 -0
- package/dist/data-source-tree/use-tree-data-source.d.ts +41 -0
- package/dist/data-source-tree/use-tree-data-source.js +101 -0
- package/dist/data-source-tree/utils/is-object.d.ts +1 -0
- package/dist/data-source-tree/utils/is-object.js +3 -0
- package/dist/hooks/use-slot/get-element-ref.d.ts +2 -0
- package/dist/hooks/use-slot/get-element-ref.js +20 -0
- package/dist/hooks/use-slot/index.d.ts +3 -0
- package/dist/hooks/use-slot/index.js +1 -0
- package/dist/hooks/use-slot/merge-props.d.ts +4 -0
- package/dist/hooks/use-slot/merge-props.js +27 -0
- package/dist/hooks/use-slot/react-version.d.ts +3 -0
- package/dist/hooks/use-slot/react-version.js +5 -0
- package/dist/hooks/use-slot/types.d.ts +4 -0
- package/dist/hooks/use-slot/types.js +1 -0
- package/dist/hooks/use-slot/use-slot.d.ts +12 -0
- package/dist/hooks/use-slot/use-slot.js +28 -0
- package/dist/hooks/use-transitioned-open.d.ts +2 -0
- package/dist/hooks/use-transitioned-open.js +50 -0
- package/dist/index.d.ts +121 -0
- package/dist/index.js +23 -0
- package/dist/license/index.d.ts +1 -0
- package/dist/license/index.js +1 -0
- package/dist/license/license.d.ts +3 -0
- package/dist/license/license.js +215 -0
- package/dist/license/md5-hash.d.ts +9 -0
- package/dist/license/md5-hash.js +167 -0
- package/dist/license.d.ts +3 -0
- package/dist/license.js +214 -0
- package/dist/root/context.d.ts +16 -0
- package/dist/root/context.js +4 -0
- package/dist/root/hooks/use-pro-api.d.ts +2 -0
- package/dist/root/hooks/use-pro-api.js +8 -0
- package/dist/root/root.d.ts +15 -0
- package/dist/root/root.js +112 -0
- package/dist/types/api.d.ts +100 -0
- package/dist/types/api.js +1 -0
- package/dist/types/column.d.ts +73 -0
- package/dist/types/column.js +1 -0
- package/dist/types/events.d.ts +56 -0
- package/dist/types/events.js +1 -0
- package/dist/types/grid.d.ts +47 -0
- package/dist/types/grid.js +1 -0
- package/dist/types/index.d.ts +7 -0
- package/dist/types/index.js +1 -0
- package/dist/types/props.d.ts +187 -0
- package/dist/types/props.js +1 -0
- package/package.json +5 -5
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
export function Icon(props) {
|
|
3
|
+
return (_jsx("div", { ...props, style: {
|
|
4
|
+
height: 20,
|
|
5
|
+
width: 20,
|
|
6
|
+
display: "flex",
|
|
7
|
+
alignItems: "center",
|
|
8
|
+
justifyContent: "center",
|
|
9
|
+
...props.style,
|
|
10
|
+
} }));
|
|
11
|
+
}
|
|
12
|
+
export const DragDots = (props) => {
|
|
13
|
+
return (_jsxs("svg", { width: "16", height: "16", viewBox: "0 0 20 20", fill: "currentcolor", xmlns: "http://www.w3.org/2000/svg", ...props, children: [_jsx("circle", { cx: "7.75", cy: "5.5", r: "1.25" }), _jsx("circle", { cx: "7.75", cy: "10", r: "1.25" }), _jsx("circle", { cx: "7.75", cy: "14.5", r: "1.25" }), _jsx("circle", { cx: "12.25", cy: "5.5", r: "1.25" }), _jsx("circle", { cx: "12.25", cy: "10", r: "1.25" }), _jsx("circle", { cx: "12.25", cy: "14.5", r: "1.25" })] }));
|
|
14
|
+
};
|
|
15
|
+
export const Measure = (props) => {
|
|
16
|
+
return (_jsx("svg", { width: "20", height: "20", viewBox: "0 0 20 20", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...props, children: _jsx("path", { d: "M15 6.25V4H5L10.7143 10L5 16H15V13.75", stroke: "currentcolor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }) }));
|
|
17
|
+
};
|
|
18
|
+
export const RowGroups = (props) => {
|
|
19
|
+
return (_jsxs("svg", { width: "16", height: "16", viewBox: "0 0 20 20", stroke: "currentcolor", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...props, children: [_jsx("path", { d: "M12 9.8252L14.8284 9.8252L14.8284 6.99677", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }), _jsx("path", { d: "M14.8286 12.6543L14.8286 9.82587L17.657 9.82587", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }), _jsx("rect", { x: "2", y: "2", width: "8", height: "16", rx: "2", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }), _jsx("path", { d: "M2 6H10", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }), _jsx("path", { d: "M2 10H10", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }), _jsx("path", { d: "M2 14H10", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" })] }));
|
|
20
|
+
};
|
|
21
|
+
export const Columns = (props) => {
|
|
22
|
+
return (_jsxs("svg", { width: "16", height: "16", viewBox: "0 0 20 20", stroke: "currentcolor", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...props, children: [_jsx("rect", { x: "2.5", y: "2.5", width: "15", height: "15", rx: "3", strokeWidth: "1.5", strokeLinecap: "round" }), _jsx("path", { d: "M7 2.5V17.5", strokeWidth: "1.5", strokeLinecap: "round" }), _jsx("path", { d: "M2.5 7L17.5 7", strokeWidth: "1.5", strokeLinecap: "round" })] }));
|
|
23
|
+
};
|
|
24
|
+
export const RowPivots = (props) => {
|
|
25
|
+
return (_jsxs("svg", { width: "16", height: "16", stroke: "currentcolor", viewBox: "0 0 20 20", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...props, children: [_jsx("path", { d: "M2.5 3.75H17.203", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }), _jsx("path", { d: "M2.5 9.56055H9.07178", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }), _jsx("path", { d: "M2.5 15.4688H9", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }), _jsx("path", { d: "M12 12.8281L14.8284 12.8281L14.8284 9.9997", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }), _jsx("path", { d: "M14.8286 15.6572L14.8286 12.8288L17.657 12.8288", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" })] }));
|
|
26
|
+
};
|
|
27
|
+
export const ColumnPivots = (props) => {
|
|
28
|
+
return (_jsxs("svg", { width: "16", height: "16", viewBox: "0 0 20 20", stroke: "currentcolor", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...props, children: [_jsx("path", { d: "M4.125 17.2822L4.125 2.57926", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }), _jsx("path", { d: "M9.93604 17.2822L9.93603 10.7104", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }), _jsx("path", { d: "M15.8438 17.2822L15.8437 10.7822", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }), _jsx("path", { d: "M13.2036 7.78223L13.2036 4.9538L10.3752 4.9538", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }), _jsx("path", { d: "M16.0317 4.95312L13.2033 4.95313L13.2033 2.1247", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" })] }));
|
|
29
|
+
};
|
|
30
|
+
export const ExpandIcon = (props) => {
|
|
31
|
+
return (_jsxs("svg", { width: "16", height: "16", viewBox: "0 0 20 20", stroke: "currentcolor", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...props, children: [_jsx("path", { d: "M6.84325 17.0415L2.9488 17.038L2.94531 13.1436", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }), _jsx("path", { d: "M8.02344 11.9639L2.94924 17.0381", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }), _jsx("path", { d: "M13.1577 2.93409L17.0522 2.93758L17.0557 6.83203", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }), _jsx("path", { d: "M17.0518 2.93555L11.9776 8.00974", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" })] }));
|
|
32
|
+
};
|
|
33
|
+
export const CollapseIcon = (props) => {
|
|
34
|
+
return (_jsxs("svg", { width: "16", height: "16", viewBox: "0 0 20 20", stroke: "currentcolor", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...props, children: [_jsx("path", { d: "M15.8198 8.07763L11.9254 8.07414L11.9219 4.17969", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }), _jsx("path", { d: "M17 3L11.9258 8.0742", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }), _jsx("path", { d: "M4.51124 11.5786L8.40569 11.5821L8.40918 15.4766", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }), _jsx("path", { d: "M8.40527 11.5801L3.33107 16.6543", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" })] }));
|
|
35
|
+
};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import type { PillContainer } from "./container.js";
|
|
2
|
+
import type { PillRowExpander } from "./expander.js";
|
|
3
|
+
import type { PillItem } from "./item.js";
|
|
4
|
+
import type { PillLabel } from "./label.js";
|
|
5
|
+
import type { PillRow } from "./pill-row.js";
|
|
6
|
+
import { PillManager as Root } from "./root.js";
|
|
7
|
+
import type { PillItemSpec, PillRowSpec } from "./types.js";
|
|
8
|
+
export declare const PillManager: {
|
|
9
|
+
(props: Root.Props): import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
Container: import("react").NamedExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
11
|
+
Expander: import("react").NamedExoticComponent<Omit<PillRowExpander.Props, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
12
|
+
Pill: import("react").NamedExoticComponent<Omit<PillItem.Props, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
13
|
+
Label: import("react").NamedExoticComponent<Omit<PillLabel.Props, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
14
|
+
Row: import("react").ForwardRefExoticComponent<{
|
|
15
|
+
readonly row: PillRowSpec;
|
|
16
|
+
} & Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
|
|
17
|
+
children?: import("react").ReactNode | undefined;
|
|
18
|
+
} & import("react").RefAttributes<HTMLDivElement>>;
|
|
19
|
+
};
|
|
20
|
+
export declare namespace PillManager {
|
|
21
|
+
type Props = Root.Props;
|
|
22
|
+
namespace Component {
|
|
23
|
+
type Container = PillContainer.Props;
|
|
24
|
+
type Expanded = PillRowExpander.Props;
|
|
25
|
+
type Pill = PillItem.Props;
|
|
26
|
+
type Label = PillLabel.Props;
|
|
27
|
+
type Row = PillRow.Props;
|
|
28
|
+
}
|
|
29
|
+
namespace T {
|
|
30
|
+
type PillItem = PillItemSpec;
|
|
31
|
+
type PillRow = PillRowSpec;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { PillContainer as Container } from "./container.js";
|
|
3
|
+
import { PillRowExpander as Expander } from "./expander.js";
|
|
4
|
+
import { PillItem as Pill } from "./item.js";
|
|
5
|
+
import { PillLabel as Label } from "./label.js";
|
|
6
|
+
import { PillRow as Row } from "./pill-row.js";
|
|
7
|
+
import { PillManager as Root } from "./root.js";
|
|
8
|
+
export const PillManager = (props) => _jsx(Root, { ...props });
|
|
9
|
+
PillManager.Container = Container;
|
|
10
|
+
PillManager.Expander = Expander;
|
|
11
|
+
PillManager.Pill = Pill;
|
|
12
|
+
PillManager.Label = Label;
|
|
13
|
+
PillManager.Row = Row;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { type JSX, type ReactNode } from "react";
|
|
2
|
+
import type { PillItemSpec } from "./types.js";
|
|
3
|
+
export declare const PillItem: import("react").NamedExoticComponent<Omit<PillItem.Props, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
4
|
+
export declare namespace PillItem {
|
|
5
|
+
type Props = JSX.IntrinsicElements["div"] & {
|
|
6
|
+
item: PillItemSpec;
|
|
7
|
+
} & {
|
|
8
|
+
elementEnd?: ReactNode;
|
|
9
|
+
};
|
|
10
|
+
}
|
|
@@ -0,0 +1,178 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef, memo, useRef, useState } from "react";
|
|
3
|
+
import { useSlot } from "../../hooks/use-slot/index.js";
|
|
4
|
+
import { usePillRow } from "./pill-row.context.js";
|
|
5
|
+
import { getDragData, getDragDirection, useDraggable, useEvent, } from "@1771technologies/lytenyte-core/internal";
|
|
6
|
+
import { DragDots } from "./icons.js";
|
|
7
|
+
import { usePillRoot } from "./root.context.js";
|
|
8
|
+
import { equal, moveRelative } from "@1771technologies/lytenyte-shared";
|
|
9
|
+
function PillItemBase({ item, elementEnd, ...props }, ref) {
|
|
10
|
+
const { expandToggle, expanded, row } = usePillRow();
|
|
11
|
+
const { prevRowId, prevSwapId, movedRef, setDragState, setCloned, cloned, rows, orientation, onPillItemThrown, onPillItemActiveChange, onPillRowChange, } = usePillRoot();
|
|
12
|
+
const clonedRef = useRef(cloned);
|
|
13
|
+
clonedRef.current = cloned;
|
|
14
|
+
const { isDragActive, placeholder, props: dragProps, } = useDraggable({
|
|
15
|
+
data: { pill: { data: { item, id: row.id }, kind: "site" } },
|
|
16
|
+
onUnhandledDrop: () => {
|
|
17
|
+
onPillItemThrown?.({
|
|
18
|
+
index: rows.findIndex((x) => x.id === row.id),
|
|
19
|
+
item,
|
|
20
|
+
row: rows.find((x) => x.id === row.id),
|
|
21
|
+
});
|
|
22
|
+
},
|
|
23
|
+
onDragStart: () => {
|
|
24
|
+
setDragState({ activeId: item.id, activeRow: row.id, activeType: row.type ?? "" });
|
|
25
|
+
setCloned(structuredClone(rows));
|
|
26
|
+
},
|
|
27
|
+
onDragEnd: () => {
|
|
28
|
+
prevRowId.current = null;
|
|
29
|
+
prevSwapId.current = null;
|
|
30
|
+
const full = clonedRef.current;
|
|
31
|
+
if (movedRef.current) {
|
|
32
|
+
const move = movedRef.current;
|
|
33
|
+
const movedPill = full
|
|
34
|
+
.find((x) => x.id === move.id)
|
|
35
|
+
?.pills.find((x) => x.id === move.pillId);
|
|
36
|
+
if (movedPill)
|
|
37
|
+
movedPill.active = false;
|
|
38
|
+
}
|
|
39
|
+
const changed = clonedRef.current.filter((x, i) => {
|
|
40
|
+
return !equal(x, rows[i]);
|
|
41
|
+
});
|
|
42
|
+
if (changed.length) {
|
|
43
|
+
onPillRowChange({ changed, full: clonedRef.current });
|
|
44
|
+
}
|
|
45
|
+
setDragState(null);
|
|
46
|
+
setCloned(null);
|
|
47
|
+
},
|
|
48
|
+
});
|
|
49
|
+
const [_, force] = useState({});
|
|
50
|
+
const handleDragEnter = useEvent((ev) => {
|
|
51
|
+
ev.preventDefault();
|
|
52
|
+
ev.stopPropagation();
|
|
53
|
+
const ds = getDragData();
|
|
54
|
+
if (!ds?.pill?.data)
|
|
55
|
+
return;
|
|
56
|
+
const { item: dragged, id: dragRowId } = ds.pill.data;
|
|
57
|
+
const accepts = new Set([...(row.accepts ?? []), row.id]);
|
|
58
|
+
if (!accepts.has(dragRowId) && !item.tags?.some((x) => accepts.has(x)))
|
|
59
|
+
return;
|
|
60
|
+
const hasPill = row.pills.find((x) => x.id === dragged.id);
|
|
61
|
+
if (dragged.id === item.id) {
|
|
62
|
+
if (dragRowId !== row.id)
|
|
63
|
+
hasPill.active = dragged.active;
|
|
64
|
+
force({});
|
|
65
|
+
return;
|
|
66
|
+
}
|
|
67
|
+
if (hasPill) {
|
|
68
|
+
const draggedIndex = row.pills.findIndex((x) => x.id === dragged.id);
|
|
69
|
+
const overIndex = row.pills.findIndex((x) => x.id === item.id);
|
|
70
|
+
const newPills = moveRelative(row.pills, draggedIndex, overIndex);
|
|
71
|
+
if (dragRowId !== row.id)
|
|
72
|
+
hasPill.active = dragged.active;
|
|
73
|
+
const [horizontal, vertical] = getDragDirection();
|
|
74
|
+
const currentSwapId = row.pills[overIndex].id;
|
|
75
|
+
const currentRowId = row.id;
|
|
76
|
+
if (orientation === "horizontal") {
|
|
77
|
+
if (currentSwapId === prevSwapId.current && currentRowId === prevRowId.current) {
|
|
78
|
+
if (horizontal === "end" && draggedIndex >= overIndex)
|
|
79
|
+
return;
|
|
80
|
+
if (horizontal === "start" && draggedIndex <= overIndex)
|
|
81
|
+
return;
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
else {
|
|
85
|
+
if (currentSwapId === prevSwapId.current && currentRowId === prevRowId.current) {
|
|
86
|
+
if (vertical === "bottom" && draggedIndex >= overIndex)
|
|
87
|
+
return;
|
|
88
|
+
if (vertical === "top" && draggedIndex <= overIndex)
|
|
89
|
+
return;
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
// We are gonna swap these two
|
|
93
|
+
prevSwapId.current = currentSwapId;
|
|
94
|
+
prevRowId.current = currentRowId;
|
|
95
|
+
setCloned((prev) => {
|
|
96
|
+
if (!prev)
|
|
97
|
+
throw new Error("Can't call drag function without cloning nodes.");
|
|
98
|
+
const thisRow = prev.findIndex((x) => x.id === row.id);
|
|
99
|
+
const newPill = { ...prev[thisRow] };
|
|
100
|
+
newPill.pills = newPills;
|
|
101
|
+
const newDef = [...prev];
|
|
102
|
+
newDef[thisRow] = newPill;
|
|
103
|
+
return newDef;
|
|
104
|
+
});
|
|
105
|
+
return;
|
|
106
|
+
}
|
|
107
|
+
// If here we need to check if this row accepts items the dragged.
|
|
108
|
+
if (!row.accepts || !dragged.tags || dragged.tags.every((x) => !row.accepts?.includes(x)))
|
|
109
|
+
return null;
|
|
110
|
+
const thisRow = rows.findIndex((x) => x.id === row.id);
|
|
111
|
+
const originalRow = rows[thisRow];
|
|
112
|
+
// The original row has this id so we can't dragged a new item to it.
|
|
113
|
+
if (originalRow.pills.find((x) => x.id === dragged.id))
|
|
114
|
+
return;
|
|
115
|
+
const overIndex = row.pills.findIndex((x) => x.id === item.id);
|
|
116
|
+
const draggedIndex = row.pills.findIndex((x) => x.id === dragged.id);
|
|
117
|
+
let newPills;
|
|
118
|
+
if (draggedIndex !== -1) {
|
|
119
|
+
const [horizontal] = getDragDirection();
|
|
120
|
+
if (horizontal === "end" && draggedIndex >= overIndex)
|
|
121
|
+
return;
|
|
122
|
+
if (horizontal === "start" && draggedIndex <= overIndex)
|
|
123
|
+
return;
|
|
124
|
+
newPills = moveRelative(row.pills, draggedIndex, overIndex);
|
|
125
|
+
}
|
|
126
|
+
else {
|
|
127
|
+
newPills = [...originalRow.pills];
|
|
128
|
+
newPills.splice(overIndex, 0, dragged);
|
|
129
|
+
}
|
|
130
|
+
setCloned((prev) => {
|
|
131
|
+
if (!prev)
|
|
132
|
+
throw new Error("Can't call drag function without cloning nodes.");
|
|
133
|
+
const newPill = { ...prev[thisRow] };
|
|
134
|
+
newPill.pills = newPills;
|
|
135
|
+
const newDef = [...prev];
|
|
136
|
+
newDef[thisRow] = newPill;
|
|
137
|
+
return newDef;
|
|
138
|
+
});
|
|
139
|
+
});
|
|
140
|
+
const onItemClick = () => {
|
|
141
|
+
const next = !item.active;
|
|
142
|
+
const nextPill = { ...item, active: next };
|
|
143
|
+
const nextPills = [...row.pills];
|
|
144
|
+
nextPills.splice(nextPills.indexOf(item), 1, nextPill);
|
|
145
|
+
const nextRow = { ...row, pills: nextPills };
|
|
146
|
+
const index = rows.indexOf(row);
|
|
147
|
+
onPillItemActiveChange({ index, item: nextPill, row: nextRow });
|
|
148
|
+
};
|
|
149
|
+
const s = (_jsxs("div", { tabIndex: -1, onClick: onItemClick, onKeyDown: (ev) => {
|
|
150
|
+
if (ev.key === " " && document.activeElement === ev.currentTarget) {
|
|
151
|
+
onItemClick?.();
|
|
152
|
+
ev.preventDefault();
|
|
153
|
+
}
|
|
154
|
+
}, children: [item.movable && (_jsx("div", { style: {
|
|
155
|
+
width: 20,
|
|
156
|
+
height: 20,
|
|
157
|
+
display: "flex",
|
|
158
|
+
alignItems: "center",
|
|
159
|
+
justifyContent: "center",
|
|
160
|
+
cursor: "grab",
|
|
161
|
+
}, children: _jsx(DragDots, {}) })), _jsx("div", { children: item.name ?? item.id }), elementEnd] }));
|
|
162
|
+
const slot = useSlot({
|
|
163
|
+
props: [item.movable ? dragProps : {}, props, { "data-ln-pill-item": true }],
|
|
164
|
+
ref,
|
|
165
|
+
slot: s,
|
|
166
|
+
state: {
|
|
167
|
+
item,
|
|
168
|
+
expanded,
|
|
169
|
+
expandToggle,
|
|
170
|
+
row,
|
|
171
|
+
},
|
|
172
|
+
});
|
|
173
|
+
return (_jsxs("div", { "data-ln-pill-type": row.type, "data-ln-pill-item-container": true, "data-ln-pill-active": item.active, "data-ln-draggable": item.movable, "data-ln-drag-active": isDragActive, onDragLeave: (e) => {
|
|
174
|
+
e.stopPropagation();
|
|
175
|
+
e.preventDefault();
|
|
176
|
+
}, onDragEnter: handleDragEnter, children: [slot, placeholder] }));
|
|
177
|
+
}
|
|
178
|
+
export const PillItem = memo(forwardRef(PillItemBase));
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { type JSX } from "react";
|
|
2
|
+
import { type SlotComponent } from "../../hooks/use-slot/index.js";
|
|
3
|
+
import type { PillRowSpec, PillState } from "./types.js";
|
|
4
|
+
export declare const PillLabel: import("react").NamedExoticComponent<Omit<PillLabel.Props, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
5
|
+
export declare namespace PillLabel {
|
|
6
|
+
type Props = Omit<JSX.IntrinsicElements["div"], "children"> & {
|
|
7
|
+
row: PillRowSpec;
|
|
8
|
+
render?: SlotComponent<PillState>;
|
|
9
|
+
};
|
|
10
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef, memo } from "react";
|
|
3
|
+
import { useSlot } from "../../hooks/use-slot/index.js";
|
|
4
|
+
import { usePillRow } from "./pill-row.context.js";
|
|
5
|
+
import { ColumnPivots, Columns, Icon, Measure, RowGroups, RowPivots } from "./icons.js";
|
|
6
|
+
const typeToIcon = {
|
|
7
|
+
columns: Columns,
|
|
8
|
+
"row-groups": RowGroups,
|
|
9
|
+
"row-pivots": RowPivots,
|
|
10
|
+
"column-pivots": ColumnPivots,
|
|
11
|
+
measures: Measure,
|
|
12
|
+
};
|
|
13
|
+
function PillBase({ render, ...props }, forwarded) {
|
|
14
|
+
const { expandToggle, expanded, row } = usePillRow();
|
|
15
|
+
const I = row.type ? typeToIcon[row.type] : null;
|
|
16
|
+
const s = render ?? (_jsxs("div", { "data-ln-pill-label": true, children: [I && (_jsx(Icon, { children: _jsx(I, {}) })), _jsx("div", { "data-ln-pill-label-text": true, children: row.label })] }));
|
|
17
|
+
const slot = useSlot({
|
|
18
|
+
props: [props],
|
|
19
|
+
ref: forwarded,
|
|
20
|
+
slot: s,
|
|
21
|
+
state: {
|
|
22
|
+
expanded,
|
|
23
|
+
expandToggle,
|
|
24
|
+
row,
|
|
25
|
+
},
|
|
26
|
+
});
|
|
27
|
+
if (row.label == null)
|
|
28
|
+
return null;
|
|
29
|
+
return slot;
|
|
30
|
+
}
|
|
31
|
+
export const PillLabel = memo(forwardRef(PillBase));
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import "@1771technologies/lytenyte-design/light-dark.css";
|
|
3
|
+
import "../../../css/pill-manager.css";
|
|
4
|
+
import { PillManager } from "./root.js";
|
|
5
|
+
import { useState } from "react";
|
|
6
|
+
const columns = [
|
|
7
|
+
{ id: "age", name: "bob", groupPath: ["Alpha", "Beta"], type: "number" },
|
|
8
|
+
{ id: "marital", groupPath: ["Alpha"] },
|
|
9
|
+
{ id: "default", groupPath: ["Top Dog"] },
|
|
10
|
+
{ id: "housing" },
|
|
11
|
+
{ id: "loan" },
|
|
12
|
+
{ id: "contact", groupPath: ["Alpha", "Beta", "Carlson"], grouped: true },
|
|
13
|
+
{ id: "day", groupPath: ["Alpha", "Beta"] },
|
|
14
|
+
{ id: "month", groupPath: ["Alpha"], grouped: true },
|
|
15
|
+
{ id: "duration", grouped: true },
|
|
16
|
+
{ id: "campaign", grouped: true },
|
|
17
|
+
{ id: "pdays", groupPath: ["Carlson"] },
|
|
18
|
+
{ id: "previous", groupPath: ["Carlson", "Delta"] },
|
|
19
|
+
{ id: "poutcome" },
|
|
20
|
+
{ id: "y" },
|
|
21
|
+
];
|
|
22
|
+
export default function Demo() {
|
|
23
|
+
const [state, setState] = useState([
|
|
24
|
+
{
|
|
25
|
+
id: "columns",
|
|
26
|
+
type: "columns",
|
|
27
|
+
label: "Columns",
|
|
28
|
+
pills: columns.map((x) => ({ ...x, active: !x.hide, movable: true, tags: ["groupable"] })),
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
id: "group",
|
|
32
|
+
type: "row-pivots",
|
|
33
|
+
label: "Row Groups",
|
|
34
|
+
accepts: ["groupable"],
|
|
35
|
+
pills: columns.filter((x) => x.grouped).map((x) => ({ ...x, active: true, movable: true })),
|
|
36
|
+
},
|
|
37
|
+
]);
|
|
38
|
+
return (_jsxs("div", { style: { display: "flex", gap: 8, flexDirection: "column" }, children: [_jsx("div", { style: { height: "200px" }, children: _jsx(PillManager, { rows: state, onPillRowChange: (p) => {
|
|
39
|
+
setState(p.full);
|
|
40
|
+
}, onPillItemThrown: (x) => {
|
|
41
|
+
setState((prev) => {
|
|
42
|
+
const next = [...prev];
|
|
43
|
+
next[x.index] = {
|
|
44
|
+
...next[x.index],
|
|
45
|
+
pills: next[x.index].pills.filter((item) => item.id !== x.item.id),
|
|
46
|
+
};
|
|
47
|
+
return next;
|
|
48
|
+
});
|
|
49
|
+
}, onPillItemActiveChange: (p) => {
|
|
50
|
+
setState((prev) => {
|
|
51
|
+
const next = [...prev];
|
|
52
|
+
next.splice(p.index, 1, p.row);
|
|
53
|
+
return next;
|
|
54
|
+
});
|
|
55
|
+
} }) }), _jsx("div", { style: { height: "200px", display: "flex", flexDirection: "column", alignItems: "center" }, children: _jsx("div", { style: { width: 400 }, children: _jsx(PillManager, { orientation: "vertical", rows: state, onPillRowChange: (p) => {
|
|
56
|
+
setState(p.full);
|
|
57
|
+
}, onPillItemThrown: (x) => {
|
|
58
|
+
setState((prev) => {
|
|
59
|
+
const next = [...prev];
|
|
60
|
+
next[x.index] = {
|
|
61
|
+
...next[x.index],
|
|
62
|
+
pills: next[x.index].pills.filter((item) => item.id !== x.item.id),
|
|
63
|
+
};
|
|
64
|
+
return next;
|
|
65
|
+
});
|
|
66
|
+
}, onPillItemActiveChange: (p) => {
|
|
67
|
+
setState((prev) => {
|
|
68
|
+
const next = [...prev];
|
|
69
|
+
next.splice(p.index, 1, p.row);
|
|
70
|
+
return next;
|
|
71
|
+
});
|
|
72
|
+
} }) }) })] }));
|
|
73
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { PillRowSpec } from "./types";
|
|
2
|
+
export interface PillRowContext {
|
|
3
|
+
readonly expanded: boolean;
|
|
4
|
+
readonly expandToggle: (s?: boolean) => void;
|
|
5
|
+
readonly row: PillRowSpec;
|
|
6
|
+
}
|
|
7
|
+
export declare const PillRowProvider: import("react").Provider<PillRowContext>;
|
|
8
|
+
export declare const usePillRow: () => PillRowContext;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { type JSX } from "react";
|
|
2
|
+
import type { PillRowSpec } from "./types.js";
|
|
3
|
+
export declare const PillRow: import("react").ForwardRefExoticComponent<{
|
|
4
|
+
readonly row: PillRowSpec;
|
|
5
|
+
} & Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
|
|
6
|
+
children?: import("react").ReactNode | undefined;
|
|
7
|
+
} & import("react").RefAttributes<HTMLDivElement>>;
|
|
8
|
+
export declare namespace PillRow {
|
|
9
|
+
type Props = {
|
|
10
|
+
readonly row: PillRowSpec;
|
|
11
|
+
} & Omit<JSX.IntrinsicElements["div"], "ref">;
|
|
12
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef, useMemo, useState } from "react";
|
|
3
|
+
import { PillRowProvider } from "./pill-row.context.js";
|
|
4
|
+
import { usePillRoot } from "./root.context.js";
|
|
5
|
+
function PillRowBase({ row, children, ...props }, forwarded) {
|
|
6
|
+
const [expanded, setExpanded] = useState(false);
|
|
7
|
+
const { orientation } = usePillRoot();
|
|
8
|
+
const value = useMemo(() => {
|
|
9
|
+
return {
|
|
10
|
+
expanded,
|
|
11
|
+
expandToggle: (s) => {
|
|
12
|
+
if (s != null)
|
|
13
|
+
setExpanded(s);
|
|
14
|
+
else
|
|
15
|
+
setExpanded((prev) => !prev);
|
|
16
|
+
},
|
|
17
|
+
row,
|
|
18
|
+
};
|
|
19
|
+
}, [expanded, row]);
|
|
20
|
+
return (_jsx(PillRowProvider, { value: value, children: _jsx("div", { ...props, ref: forwarded, "data-ln-pill-row": true, "data-ln-expanded": expanded, "data-ln-orientation": orientation, children: children }) }));
|
|
21
|
+
}
|
|
22
|
+
export const PillRow = forwardRef(PillRowBase);
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { type Dispatch, type RefObject, type SetStateAction } from "react";
|
|
2
|
+
import type { PillItemSpec, PillRowSpec } from "./types";
|
|
3
|
+
export type PillRootContext = {
|
|
4
|
+
readonly rows: PillRowSpec[];
|
|
5
|
+
readonly orientation: "horizontal" | "vertical";
|
|
6
|
+
readonly onPillRowChange: (params: {
|
|
7
|
+
readonly changed: PillRowSpec[];
|
|
8
|
+
readonly full: PillRowSpec[];
|
|
9
|
+
}) => void;
|
|
10
|
+
readonly onPillItemActiveChange: (params: {
|
|
11
|
+
readonly index: number;
|
|
12
|
+
readonly item: PillItemSpec;
|
|
13
|
+
readonly row: PillRowSpec;
|
|
14
|
+
}) => void;
|
|
15
|
+
readonly onPillItemThrown?: (params: {
|
|
16
|
+
readonly index: number;
|
|
17
|
+
readonly item: PillItemSpec;
|
|
18
|
+
readonly row: PillRowSpec;
|
|
19
|
+
}) => void;
|
|
20
|
+
readonly cloned: null | PillRowSpec[];
|
|
21
|
+
readonly setCloned: Dispatch<SetStateAction<null | PillRowSpec[]>>;
|
|
22
|
+
readonly setDragState: Dispatch<SetStateAction<{
|
|
23
|
+
readonly activeId: string;
|
|
24
|
+
readonly activeRow: string;
|
|
25
|
+
readonly activeType: string;
|
|
26
|
+
} | null>>;
|
|
27
|
+
readonly dragState: null | {
|
|
28
|
+
readonly activeId: string;
|
|
29
|
+
readonly activeRow: string;
|
|
30
|
+
readonly activeType: string;
|
|
31
|
+
};
|
|
32
|
+
movedRef: RefObject<{
|
|
33
|
+
pillId: string;
|
|
34
|
+
id: string;
|
|
35
|
+
} | null>;
|
|
36
|
+
prevSwapId: RefObject<string | null>;
|
|
37
|
+
prevRowId: RefObject<string | null>;
|
|
38
|
+
};
|
|
39
|
+
export declare const PillRootProvider: import("react").Provider<PillRootContext>;
|
|
40
|
+
export declare const usePillRoot: () => PillRootContext;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { type JSX, type ReactNode } from "react";
|
|
2
|
+
import { type PillRootContext } from "./root.context.js";
|
|
3
|
+
import type { PillItemSpec, PillRowSpec } from "./types.js";
|
|
4
|
+
export declare const PillManager: import("react").NamedExoticComponent<Omit<PillManager.Props, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
5
|
+
export declare namespace PillManager {
|
|
6
|
+
type Props = Omit<JSX.IntrinsicElements["div"], "children"> & {
|
|
7
|
+
readonly rows: PillRowSpec[];
|
|
8
|
+
readonly orientation?: "horizontal" | "vertical";
|
|
9
|
+
readonly children?: (row: PillRowSpec, ctx: PillRootContext) => ReactNode;
|
|
10
|
+
readonly onPillRowChange?: (params: {
|
|
11
|
+
readonly changed: PillRowSpec[];
|
|
12
|
+
readonly full: PillRowSpec[];
|
|
13
|
+
}) => void;
|
|
14
|
+
readonly onPillItemActiveChange?: (params: {
|
|
15
|
+
readonly index: number;
|
|
16
|
+
readonly item: PillItemSpec;
|
|
17
|
+
readonly row: PillRowSpec;
|
|
18
|
+
}) => void;
|
|
19
|
+
readonly onPillItemThrown?: (params: {
|
|
20
|
+
readonly index: number;
|
|
21
|
+
readonly item: PillItemSpec;
|
|
22
|
+
readonly row: PillRowSpec;
|
|
23
|
+
}) => void;
|
|
24
|
+
};
|
|
25
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef, Fragment, memo, useMemo, useRef, useState } from "react";
|
|
3
|
+
import { PillRootProvider } from "./root.context.js";
|
|
4
|
+
import { PillRowDefault } from "./row-default.js";
|
|
5
|
+
function PillRootImpl({ children = PillRowDefault, rows, orientation, onPillRowChange, onPillItemActiveChange, onPillItemThrown, ...p }, ref) {
|
|
6
|
+
const [cloned, setCloned] = useState(null);
|
|
7
|
+
const [dragState, setDragState] = useState(null);
|
|
8
|
+
const prevSwapId = useRef(null);
|
|
9
|
+
const prevRowId = useRef(null);
|
|
10
|
+
const movedRef = useRef(null);
|
|
11
|
+
const value = useMemo(() => {
|
|
12
|
+
return {
|
|
13
|
+
orientation: orientation ?? "horizontal",
|
|
14
|
+
cloned,
|
|
15
|
+
setCloned,
|
|
16
|
+
rows: rows,
|
|
17
|
+
dragState,
|
|
18
|
+
setDragState,
|
|
19
|
+
movedRef,
|
|
20
|
+
prevSwapId,
|
|
21
|
+
prevRowId,
|
|
22
|
+
onPillItemActiveChange: onPillItemActiveChange ?? (() => { }),
|
|
23
|
+
onPillRowChange: onPillRowChange ?? (() => { }),
|
|
24
|
+
onPillItemThrown: onPillItemThrown ?? (() => { }),
|
|
25
|
+
};
|
|
26
|
+
}, [cloned, dragState, onPillItemActiveChange, onPillItemThrown, onPillRowChange, orientation, rows]);
|
|
27
|
+
const rendered = useMemo(() => {
|
|
28
|
+
const r = cloned ?? rows;
|
|
29
|
+
return r.map((x, i) => _jsx(Fragment, { children: children(x, value) }, i));
|
|
30
|
+
}, [children, cloned, rows, value]);
|
|
31
|
+
return (_jsx(PillRootProvider, { value: value, children: _jsx("div", { ...p, ref: ref, "data-ln-pill-root": true, "data-ln-orientation": orientation ?? "horizontal", children: rendered }) }));
|
|
32
|
+
}
|
|
33
|
+
export const PillManager = memo(forwardRef(PillRootImpl));
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { PillContainer } from "./container.js";
|
|
3
|
+
import { PillRowExpander } from "./expander.js";
|
|
4
|
+
import { PillItem } from "./item.js";
|
|
5
|
+
import { PillLabel } from "./label.js";
|
|
6
|
+
import { PillRow } from "./pill-row.js";
|
|
7
|
+
export function PillRowDefault(row, ctx) {
|
|
8
|
+
const orientation = ctx.orientation;
|
|
9
|
+
return (
|
|
10
|
+
// Label
|
|
11
|
+
_jsxs(PillRow, { row: row, children: [_jsx(PillLabel, { row: row }), _jsx(PillContainer, { children: row.pills.map((x) => {
|
|
12
|
+
return _jsx(PillItem, { item: x }, x.id);
|
|
13
|
+
}) }), orientation === "horizontal" && _jsx(PillRowExpander, {})] }));
|
|
14
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export interface PillItemSpec {
|
|
2
|
+
readonly id: string;
|
|
3
|
+
readonly active: boolean;
|
|
4
|
+
readonly name?: string;
|
|
5
|
+
readonly movable?: boolean;
|
|
6
|
+
readonly tags?: string[];
|
|
7
|
+
readonly data?: unknown;
|
|
8
|
+
readonly removable?: boolean;
|
|
9
|
+
}
|
|
10
|
+
export interface PillState {
|
|
11
|
+
readonly expanded: boolean;
|
|
12
|
+
readonly expandToggle: (s?: boolean) => void;
|
|
13
|
+
readonly row: PillRowSpec;
|
|
14
|
+
}
|
|
15
|
+
export interface PillRowSpec {
|
|
16
|
+
readonly id: string;
|
|
17
|
+
readonly pills: PillItemSpec[];
|
|
18
|
+
readonly accepts?: string[];
|
|
19
|
+
readonly label?: string;
|
|
20
|
+
readonly type?: "columns" | "row-groups" | "row-pivots" | "column-pivots" | "measures" | ({} & string);
|
|
21
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { RowAggregated, RowGroup, RowLeaf } from "@1771technologies/lytenyte-shared";
|
|
2
|
+
import type { API, CellParamsWithIndex, GridSpec } from "../types";
|
|
3
|
+
import type { ReactNode } from "react";
|
|
4
|
+
import { type SlotComponent } from "../hooks/use-slot/index.js";
|
|
5
|
+
export declare const RowGroupCell: <Spec extends GridSpec = GridSpec>({ api, row, leafLabel, groupLabel, aggLabel, expansionSlot, }: CellParamsWithIndex<Spec> & {
|
|
6
|
+
leafLabel?: (row: RowLeaf<Spec["data"]>, api: API<Spec>) => ReactNode;
|
|
7
|
+
groupLabel?: (row: RowGroup, api: API<Spec>) => ReactNode;
|
|
8
|
+
aggLabel?: (row: RowAggregated, api: API<Spec>) => ReactNode;
|
|
9
|
+
expansionSlot?: SlotComponent<{
|
|
10
|
+
readonly row: RowGroup;
|
|
11
|
+
readonly api: API<Spec>;
|
|
12
|
+
}>;
|
|
13
|
+
}) => import("react/jsx-runtime").JSX.Element;
|