impact-nova 3.0.0-alpha.2 → 3.0.0-alpha.20
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 +1 -1
- package/dist/_virtual/index.js +4 -4
- package/dist/_virtual/index2.js +4 -4
- package/dist/components/data/ag-grid-react/ag-grid-list.d.ts +3 -1
- package/dist/components/data/ag-grid-react/ag-grid-list.demo-board.d.ts +46 -0
- package/dist/components/data/ag-grid-react/ag-grid-list.js +9 -8
- package/dist/components/data/ag-grid-react/ag-grid-list.key-attributes.d.ts +1 -0
- package/dist/components/data/ag-grid-react/ag-grid.types.d.ts +65 -3
- package/dist/components/data/ag-grid-react/build-list-drag-column-defs.d.ts +8 -0
- package/dist/components/data/ag-grid-react/build-list-drag-column-defs.js +28 -0
- package/dist/components/data/ag-grid-react/cell-renderers/badge-cell-renderer.d.ts +2 -0
- package/dist/components/data/ag-grid-react/cell-renderers/badge-cell-renderer.js +15 -14
- package/dist/components/data/ag-grid-react/cell-renderers/badge-icon-registry.d.ts +10 -0
- package/dist/components/data/ag-grid-react/cell-renderers/badge-icon-registry.js +17 -0
- package/dist/components/data/ag-grid-react/cell-renderers/drag-handle-cell-renderer.d.ts +18 -0
- package/dist/components/data/ag-grid-react/cell-renderers/drag-handle-cell-renderer.js +32 -0
- package/dist/components/data/ag-grid-react/cell-renderers/editors/list-select-cell-editor.js +71 -46
- package/dist/components/data/ag-grid-react/cell-renderers/editors/select-cell-editor.js +48 -45
- package/dist/components/data/ag-grid-react/cell-renderers/index.d.ts +45 -7
- package/dist/components/data/ag-grid-react/cell-renderers/index.js +70 -58
- package/dist/components/data/ag-grid-react/cell-renderers/link-with-batch-cell-renderer.js +88 -76
- package/dist/components/data/ag-grid-react/cell-renderers/list-select-display-renderer.js +31 -33
- package/dist/components/data/ag-grid-react/cell-renderers/select-display-renderer.js +18 -17
- package/dist/components/data/ag-grid-react/cell-renderers/style-description-display-renderer.d.ts +5 -11
- package/dist/components/data/ag-grid-react/cell-renderers/style-description-display-renderer.js +127 -51
- package/dist/components/data/ag-grid-react/editable-utils.d.ts +9 -1
- package/dist/components/data/ag-grid-react/editable-utils.js +46 -41
- package/dist/components/data/ag-grid-react/headers/custom-header.js +110 -108
- package/dist/components/data/ag-grid-react/headers/header-search-input.js +203 -199
- package/dist/components/data/ag-grid-react/index.d.ts +6 -1
- package/dist/components/data/ag-grid-react/index.js +316 -248
- package/dist/components/data/ag-grid-react/list-drag-grid-options.d.ts +34 -0
- package/dist/components/data/ag-grid-react/list-drag-grid-options.js +110 -0
- package/dist/components/data/ag-grid-react/list-drag-preview-card.d.ts +4 -0
- package/dist/components/data/ag-grid-react/list-drag-preview-card.js +14 -0
- package/dist/components/data/ag-grid-react/list-drag-preview-snapshot.d.ts +20 -0
- package/dist/components/data/ag-grid-react/list-drag-preview-snapshot.js +42 -0
- package/dist/components/data/ag-grid-react/list-find-highlight.d.ts +6 -0
- package/dist/components/data/ag-grid-react/list-find-highlight.js +7 -0
- package/dist/components/data/ag-grid-react/list-row-move.d.ts +84 -0
- package/dist/components/data/ag-grid-react/list-row-move.js +74 -0
- package/dist/components/data/ag-grid-react/numeric-column-header-alignment.d.ts +9 -0
- package/dist/components/data/ag-grid-react/numeric-column-header-alignment.js +67 -0
- package/dist/components/data/ag-grid-react/process-backend-columndefs.d.ts +10 -2
- package/dist/components/data/ag-grid-react/process-backend-columndefs.js +84 -0
- package/dist/components/data/ag-grid-react/use-ag-grid-list-drag.d.ts +67 -0
- package/dist/components/data/ag-grid-react/use-ag-grid-list-drag.js +162 -0
- package/dist/components/data/ag-grid-react/use-list-drag-preview.d.ts +20 -0
- package/dist/components/data/ag-grid-react/use-list-drag-preview.js +148 -0
- package/dist/components/data/ag-grid-react/use-list-find.d.ts +36 -0
- package/dist/components/data/ag-grid-react/use-list-row-drop-zones.d.ts +46 -0
- package/dist/components/data/ag-grid-react/use-list-row-drop-zones.js +92 -0
- package/dist/components/data/data-table/build-column-tree-from-grid.js +15 -15
- package/dist/components/data/data-table/column-picker-authority.js +9 -9
- package/dist/components/data/data-table/data-table-column-apply.js +30 -29
- package/dist/components/data/data-table/data-table-column-tree-cache.js +62 -60
- package/dist/components/data/data-table/data-table-list-header.d.ts +7 -0
- package/dist/components/data/data-table/data-table-list-header.js +31 -0
- package/dist/components/data/data-table/data-table-overlay.d.ts +6 -0
- package/dist/components/data/data-table/data-table-overlay.js +18 -0
- package/dist/components/data/data-table/data-table-picker-column-eligibility.d.ts +3 -0
- package/dist/components/data/data-table/data-table-picker-column-eligibility.js +24 -4
- package/dist/components/data/data-table/data-table.js +35 -34
- package/dist/components/data/data-table/data-table.types.d.ts +13 -2
- package/dist/components/data/data-table/index.d.ts +10 -0
- package/dist/components/data/data-table/index.js +64 -52
- package/dist/components/data/data-table/use-data-table-viewport.d.ts +10 -0
- package/dist/components/data/data-table/use-data-table-viewport.js +31 -0
- package/dist/components/data/expandable-list-item/expandable-list-item-attributes.js +3 -2
- package/dist/components/data/expandable-list-item/expandable-list-item-metrics.js +3 -2
- package/dist/components/data/expandable-list-item/index.d.ts +2 -0
- package/dist/components/data/expandable-list-item/index.js +20 -16
- package/dist/components/data/expandable-list-item/product-card-hero.d.ts +15 -0
- package/dist/components/data/expandable-list-item/product-card-iris-insight-trigger.d.ts +8 -0
- package/dist/components/data/expandable-list-item/product-card-iris-insight-trigger.js +41 -0
- package/dist/components/data/expandable-list-item/product-card-metrics-toggle.d.ts +13 -0
- package/dist/components/data/expandable-list-item/product-card-metrics-toggle.js +27 -0
- package/dist/components/data/expandable-list-item/sku-picker-chrome.d.ts +40 -0
- package/dist/components/data/expandable-list-item/sku-picker-chrome.js +150 -0
- package/dist/components/data/expandable-list-item/useServerSkuInfinitePages.d.ts +2 -1
- package/dist/components/data/expandable-list-item/virtualized-responsive-grid.catalog.d.ts +5 -4
- package/dist/components/data/expandable-list-item/virtualized-responsive-grid.sku-picker.d.ts +3 -2
- package/dist/components/data/scenario-comparison/flatten-scenario-comparison-rows.d.ts +2 -0
- package/dist/components/data/scenario-comparison/flatten-scenario-comparison-rows.js +16 -0
- package/dist/components/data/scenario-comparison/index.d.ts +3 -0
- package/dist/components/data/scenario-comparison/index.js +6 -0
- package/dist/components/data/scenario-comparison/scenario-comparison-column.d.ts +12 -0
- package/dist/components/data/scenario-comparison/scenario-comparison-column.js +172 -0
- package/dist/components/data/scenario-comparison/scenario-comparison-label.d.ts +6 -0
- package/dist/components/data/scenario-comparison/scenario-comparison-label.js +64 -0
- package/dist/components/data/scenario-comparison/scenario-comparison.d.ts +5 -0
- package/dist/components/data/scenario-comparison/scenario-comparison.js +127 -0
- package/dist/components/data/scenario-comparison/scenario-comparison.types.d.ts +56 -0
- package/dist/components/data/scenario-comparison/scenario-comparison.variants.d.ts +7 -0
- package/dist/components/data/scenario-comparison/scenario-comparison.variants.js +29 -0
- package/dist/components/data-display/badge/index.d.ts +2 -0
- package/dist/components/data-display/badge/index.js +4 -2
- package/dist/components/data-display/badge/trophy-icon.d.ts +6 -0
- package/dist/components/data-display/badge/trophy-icon.js +28 -0
- package/dist/components/data-display/chart/chart-scatter3d.d.ts +39 -0
- package/dist/components/data-display/chart/chart-scatter3d.js +180 -0
- package/dist/components/data-display/chart/chart.js +125 -112
- package/dist/components/data-display/chart/chart.utils.js +122 -92
- package/dist/components/data-display/stereo-scatter/index.d.ts +2 -0
- package/dist/components/data-display/stereo-scatter/index.js +10 -0
- package/dist/components/data-display/stereo-scatter/internals/stereo-engine-frame.d.ts +41 -0
- package/dist/components/data-display/stereo-scatter/internals/stereo-engine-frame.js +178 -0
- package/dist/components/data-display/stereo-scatter/internals/stereo-engine-theme.d.ts +14 -0
- package/dist/components/data-display/stereo-scatter/internals/stereo-engine-theme.js +29 -0
- package/dist/components/data-display/stereo-scatter/internals/stereo-engine-wedges.d.ts +23 -0
- package/dist/components/data-display/stereo-scatter/internals/stereo-engine-wedges.js +80 -0
- package/dist/components/data-display/stereo-scatter/internals/stereo-engine.d.ts +120 -0
- package/dist/components/data-display/stereo-scatter/internals/stereo-engine.js +519 -0
- package/dist/components/data-display/stereo-scatter/internals/stereo-math.d.ts +64 -0
- package/dist/components/data-display/stereo-scatter/internals/stereo-math.js +129 -0
- package/dist/components/data-display/stereo-scatter/internals/stereo-model.d.ts +37 -0
- package/dist/components/data-display/stereo-scatter/internals/stereo-model.js +71 -0
- package/dist/components/data-display/stereo-scatter/internals/stereo-scatter-context.d.ts +33 -0
- package/dist/components/data-display/stereo-scatter/internals/stereo-scatter-context.js +19 -0
- package/dist/components/data-display/stereo-scatter/internals/stereo-scatter-key.d.ts +4 -0
- package/dist/components/data-display/stereo-scatter/internals/stereo-scatter-key.js +19 -0
- package/dist/components/data-display/stereo-scatter/internals/stereo-scatter-legend.d.ts +2 -0
- package/dist/components/data-display/stereo-scatter/internals/stereo-scatter-legend.js +75 -0
- package/dist/components/data-display/stereo-scatter/internals/stereo-scatter-scene.d.ts +2 -0
- package/dist/components/data-display/stereo-scatter/internals/stereo-scatter-scene.js +149 -0
- package/dist/components/data-display/stereo-scatter/internals/stereo-scatter-toolbar.d.ts +13 -0
- package/dist/components/data-display/stereo-scatter/internals/stereo-scatter-toolbar.js +93 -0
- package/dist/components/data-display/stereo-scatter/internals/stereo-scatter-tooltip.d.ts +2 -0
- package/dist/components/data-display/stereo-scatter/internals/stereo-scatter-tooltip.js +62 -0
- package/dist/components/data-display/stereo-scatter/internals/stereo-scatter-viewport.d.ts +3 -0
- package/dist/components/data-display/stereo-scatter/internals/stereo-scatter-viewport.js +41 -0
- package/dist/components/data-display/stereo-scatter/stereo-scatter.d.ts +12 -0
- package/dist/components/data-display/stereo-scatter/stereo-scatter.js +107 -0
- package/dist/components/data-display/stereo-scatter/stereo-scatter.stories-data.d.ts +11 -0
- package/dist/components/data-display/stereo-scatter/stereo-scatter.types.d.ts +69 -0
- package/dist/components/data-display/stereo-scatter/stereo-scatter.variants.d.ts +13 -0
- package/dist/components/data-display/stereo-scatter/stereo-scatter.variants.js +42 -0
- package/dist/components/feedback/find-bar/collect-find-matches.d.ts +35 -0
- package/dist/components/feedback/find-bar/collect-find-matches.js +68 -0
- package/dist/components/feedback/find-bar/find-bar-shortcuts.d.ts +5 -0
- package/dist/components/feedback/find-bar/find-bar-shortcuts.js +27 -0
- package/dist/components/feedback/find-bar/find-bar.d.ts +7 -0
- package/dist/components/feedback/find-bar/find-bar.js +266 -0
- package/dist/components/feedback/find-bar/find-bar.types.d.ts +32 -0
- package/dist/components/feedback/find-bar/index.d.ts +4 -0
- package/dist/components/feedback/find-bar/index.js +11 -0
- package/dist/components/feedback/tooltip/button-icon-tooltip.d.ts +6 -1
- package/dist/components/feedback/tooltip/button-icon-tooltip.js +22 -17
- package/dist/components/feedback/tooltip/tab-tooltip-render.js +3 -2
- package/dist/components/feedback/tooltip/use-overflow-tooltip.js +44 -36
- package/dist/components/flows/command-palette/shortcut-settings.js +10 -10
- package/dist/components/flows/filter-panel/filter-panel.js +4 -4
- package/dist/components/flows/iris-chat/IrisChatComposerVoiceCapture.d.ts +5 -0
- package/dist/components/flows/iris-chat/IrisChatComposerVoiceCapture.js +73 -0
- package/dist/components/flows/iris-chat/IrisChatHeaderWindowSizeButton.d.ts +5 -0
- package/dist/components/flows/iris-chat/IrisChatHeaderWindowSizeButton.js +49 -0
- package/dist/components/flows/iris-chat/IrisChatSnapTile.d.ts +8 -0
- package/dist/components/flows/iris-chat/IrisChatSnapTile.js +30 -0
- package/dist/components/flows/iris-chat/IrisChatVoiceWaveform.d.ts +3 -0
- package/dist/components/flows/iris-chat/IrisChatVoiceWaveform.js +25 -0
- package/dist/components/flows/iris-chat/IrisChatWindowSnapMenu.d.ts +4 -0
- package/dist/components/flows/iris-chat/IrisChatWindowSnapMenu.js +113 -0
- package/dist/components/flows/iris-chat/index.d.ts +3 -1
- package/dist/components/flows/iris-chat/index.js +58 -53
- package/dist/components/flows/iris-chat/iris-chat-artifact.js +46 -36
- package/dist/components/flows/iris-chat/iris-chat-chrome.d.ts +39 -0
- package/dist/components/flows/iris-chat/iris-chat-chrome.js +311 -0
- package/dist/components/flows/iris-chat/iris-chat-close-animation.d.ts +12 -0
- package/dist/components/flows/iris-chat/iris-chat-close-animation.js +21 -0
- package/dist/components/flows/iris-chat/iris-chat-composer.js +291 -234
- package/dist/components/flows/iris-chat/iris-chat-context.d.ts +16 -0
- package/dist/components/flows/iris-chat/iris-chat-context.js +14 -10
- package/dist/components/flows/iris-chat/iris-chat-copy-feedback.d.ts +4 -0
- package/dist/components/flows/iris-chat/iris-chat-copy-feedback.js +16 -0
- package/dist/components/flows/iris-chat/iris-chat-frame.d.ts +32 -0
- package/dist/components/flows/iris-chat/iris-chat-frame.js +88 -0
- package/dist/components/flows/iris-chat/iris-chat-icons.d.ts +2 -0
- package/dist/components/flows/iris-chat/iris-chat-icons.js +46 -20
- package/dist/components/flows/iris-chat/iris-chat-launch-animation.d.ts +11 -0
- package/dist/components/flows/iris-chat/iris-chat-launch-animation.js +35 -0
- package/dist/components/flows/iris-chat/iris-chat-markdown.js +82 -42
- package/dist/components/flows/iris-chat/iris-chat-menu.js +149 -117
- package/dist/components/flows/iris-chat/iris-chat-snap-presets.d.ts +7 -0
- package/dist/components/flows/iris-chat/iris-chat-snap-presets.js +83 -0
- package/dist/components/flows/iris-chat/iris-chat-speech.d.ts +52 -0
- package/dist/components/flows/iris-chat/iris-chat-speech.js +121 -0
- package/dist/components/flows/iris-chat/iris-chat-thread.d.ts +4 -0
- package/dist/components/flows/iris-chat/iris-chat-thread.js +277 -220
- package/dist/components/flows/iris-chat/iris-chat-window-chrome.d.ts +33 -0
- package/dist/components/flows/iris-chat/iris-chat-window-chrome.js +37 -0
- package/dist/components/flows/iris-chat/iris-chat-window-geometry-context.d.ts +14 -0
- package/dist/components/flows/iris-chat/iris-chat-window-geometry-context.js +15 -0
- package/dist/components/flows/iris-chat/iris-chat-window-geometry.d.ts +12 -0
- package/dist/components/flows/iris-chat/iris-chat-window-geometry.js +113 -0
- package/dist/components/flows/iris-chat/iris-chat-window-handles.d.ts +6 -0
- package/dist/components/flows/iris-chat/iris-chat-window-handles.js +50 -0
- package/dist/components/flows/iris-chat/iris-chat-window-shell.d.ts +8 -0
- package/dist/components/flows/iris-chat/iris-chat-window-shell.js +37 -0
- package/dist/components/flows/iris-chat/iris-chat.d.ts +3 -39
- package/dist/components/flows/iris-chat/iris-chat.js +22 -330
- package/dist/components/flows/iris-chat/iris-chat.types.d.ts +20 -0
- package/dist/components/flows/iris-chat/iris-chat.variants.d.ts +4 -3
- package/dist/components/flows/iris-chat/iris-chat.variants.js +45 -22
- package/dist/components/flows/iris-chat/sync-iris-chat-composer-textarea.d.ts +6 -0
- package/dist/components/flows/iris-chat/sync-iris-chat-composer-textarea.js +23 -0
- package/dist/components/flows/iris-chat/use-iris-chat-root.d.ts +29 -0
- package/dist/components/flows/iris-chat/use-iris-chat-root.js +162 -0
- package/dist/components/forms/choice-card/choice-card-compare-scroll.d.ts +4 -0
- package/dist/components/forms/choice-card/choice-card-compare-scroll.js +6 -0
- package/dist/components/forms/choice-card/choice-card-percent.js +82 -51
- package/dist/components/forms/choice-card/choice-card.d.ts +14 -2
- package/dist/components/forms/choice-card/choice-card.js +470 -381
- package/dist/components/forms/choice-card/choice-card.types.d.ts +9 -2
- package/dist/components/forms/choice-card/choice-card.variants.js +24 -3
- package/dist/components/forms/input/input.js +5 -5
- package/dist/components/forms/select/components/SelectMenuPanel.js +15 -15
- package/dist/components/forms/select/components/SelectTriggerValue.js +3 -2
- package/dist/components/forms/select/components/Submenu.js +3 -2
- package/dist/components/layout/header/header.js +1 -0
- package/dist/components/layout/horizontal-scroller/horizontal-scroller-mask.d.ts +3 -0
- package/dist/components/layout/horizontal-scroller/horizontal-scroller-mask.js +12 -0
- package/dist/components/layout/horizontal-scroller/horizontal-scroller.js +181 -125
- package/dist/components/layout/horizontal-scroller/horizontal-scroller.types.d.ts +2 -0
- package/dist/components/layout/horizontal-scroller/scroll-overflow-affordance.d.ts +3 -1
- package/dist/components/layout/horizontal-scroller/scroll-overflow-affordance.js +77 -67
- package/dist/components/primitives/button/button.variants.js +1 -1
- package/dist/components/primitives/iris/iris-insight-truncated-text.d.ts +3 -0
- package/dist/components/primitives/iris/iris-insight-truncated-text.js +33 -0
- package/dist/components/primitives/iris/iris.d.ts +3 -1
- package/dist/components/primitives/iris/iris.js +85 -91
- package/dist/components/primitives/iris/iris.types.d.ts +9 -0
- package/dist/components/primitives/stepper/internals/step-model.d.ts +1 -1
- package/dist/components/primitives/stepper/internals/step-model.js +5 -5
- package/dist/components/primitives/stepper/internals/stepper-compact.js +13 -13
- package/dist/components/primitives/stepper/internals/stepper-pipeline.js +6 -6
- package/dist/components/primitives/stepper/internals/stepper-rail.js +15 -15
- package/dist/components/primitives/stepper/internals/stepper-summary.js +7 -7
- package/dist/components/primitives/stepper/internals/stepper-track.js +2 -2
- package/dist/components/primitives/stepper/stepper.js +99 -97
- package/dist/components/primitives/stepper/stepper.types.d.ts +4 -0
- package/dist/components/primitives/tabs/folder-tab-path.d.ts +6 -0
- package/dist/components/primitives/tabs/folder-tab-path.js +16 -0
- package/dist/components/primitives/tabs/tabs.js +178 -112
- package/dist/components/primitives/tabs/tabs.types.d.ts +1 -1
- package/dist/form-react/Fields/SelectField.js +66 -57
- package/dist/form-react/Fields/VirtualizedListField.d.ts +3 -0
- package/dist/form-react/Fields/VirtualizedListField.js +223 -0
- package/dist/form-react/fields.d.ts +1 -0
- package/dist/form-react/fields.js +28 -26
- package/dist/form-react/index.d.ts +1 -1
- package/dist/form-react/registry/defaultFieldRegistrations.d.ts +1 -1
- package/dist/form-react/registry/defaultFieldRegistrations.js +13 -12
- package/dist/form-react/types/fields.types.d.ts +48 -1
- package/dist/form-react/types/fieldsOutput.types.d.ts +4 -1
- package/dist/form-react/types/reactHookForm.types.d.ts +18 -1
- package/dist/form-react/utils/fieldDefaults.utils.js +1 -1
- package/dist/i18n/defaultMessages.d.ts +69 -0
- package/dist/i18n/defaultMessages.js +107 -42
- package/dist/i18n/impact-nova-i18n-defaults.d.ts +5 -0
- package/dist/i18n/impact-nova-i18n-defaults.js +4 -9
- package/dist/i18n/index.d.ts +1 -1
- package/dist/i18n/locales/de.js +66 -1
- package/dist/i18n/locales/es.js +66 -1
- package/dist/i18n/locales/hi.js +66 -1
- package/dist/i18n/locales/kn.js +66 -1
- package/dist/impact-nova-components.css +372 -14
- package/dist/impact-nova-tokens.scss +4 -0
- package/dist/impact-nova.css +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.js +627 -601
- package/dist/lib/alphabetical-sort.d.ts +3 -0
- package/dist/lib/alphabetical-sort.js +13 -0
- package/dist/lib/guidance/engine/guidance-engine.js +26 -27
- package/dist/lib/guidance/engine/step-navigation.d.ts +1 -0
- package/dist/lib/guidance/engine/step-navigation.js +16 -9
- package/dist/lib/guidance/types/guidance.types.d.ts +9 -1
- package/dist/lib/virtualized/index.d.ts +2 -0
- package/dist/lib/virtualized/index.js +35 -31
- package/dist/lib/virtualized/list-index.d.ts +5 -0
- package/dist/lib/virtualized/list-index.js +13 -0
- package/dist/lib/virtualized/read-infinite-query-list.d.ts +14 -0
- package/dist/lib/virtualized/read-infinite-query-list.js +12 -0
- package/dist/lib/virtualized/types.d.ts +4 -2
- package/dist/lib/virtualized/useRowState.js +60 -56
- package/dist/lib/virtualized/useVirtualizedList.d.ts +5 -0
- package/dist/llms/rules/ag-grid.js +1 -1
- package/dist/llms/rules/installation.js +1 -1
- package/dist/llms/rules/real-world-patterns.js +1 -1
- package/dist/llms/rules/requirements.js +1 -1
- package/dist/node_modules/hast-util-to-jsx-runtime/lib/index.js +1 -1
- package/dist/node_modules/unified/lib/index.js +1 -1
- package/dist/tailwind.config.js +3 -0
- package/dist/theme/tailwind-colors.js +3 -0
- package/package.json +23 -4
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
import { jsx as so } from "react/jsx-runtime";
|
|
2
|
+
import { useState as lo, useMemo as A, useCallback as p, useEffect as wo } from "react";
|
|
3
|
+
import { useImpactNovaI18n as go } from "../../../i18n/use-impact-nova-i18n.js";
|
|
4
|
+
import { isListDropAllowed as B, applyUnmanagedRowDrag as co, applyKeyboardListRowReorder as Do } from "./list-row-move.js";
|
|
5
|
+
import { buildDragListColumnDefs as Ro } from "./build-list-drag-column-defs.js";
|
|
6
|
+
import { createDefaultRowDragText as uo, createListRowStyle as po, formatListReorderLiveMessage as fo, isListDragPointerOverHost as mo, dropPositionFromEvent as W, readDragRowId as h, isAgGridListDragEnabled as Io, isAgGridListVariant as Lo, itemIdFromGetRowId as q, readListKeyboardRow as yo } from "./list-drag-grid-options.js";
|
|
7
|
+
import { useListDragPreview as ho } from "./use-list-drag-preview.js";
|
|
8
|
+
function z(x) {
|
|
9
|
+
const w = [];
|
|
10
|
+
return x.forEachNodeAfterFilterAndSort((P) => {
|
|
11
|
+
const g = h(P);
|
|
12
|
+
g && w.push(g);
|
|
13
|
+
}), w;
|
|
14
|
+
}
|
|
15
|
+
function Go(x) {
|
|
16
|
+
const {
|
|
17
|
+
variant: w,
|
|
18
|
+
listHeader: P,
|
|
19
|
+
columnDefs: g,
|
|
20
|
+
mergedColumnDefs: E,
|
|
21
|
+
listRowGradient: f,
|
|
22
|
+
listDragPreview: J,
|
|
23
|
+
isRowDragDisabled: m,
|
|
24
|
+
getRowDragHandleLabel: C,
|
|
25
|
+
canDropRow: d,
|
|
26
|
+
onRowReorder: M,
|
|
27
|
+
onRowMoveBeyondEdge: v,
|
|
28
|
+
getRowStyle: b,
|
|
29
|
+
getRowId: n,
|
|
30
|
+
rowData: l,
|
|
31
|
+
rowDragManaged: Q,
|
|
32
|
+
rowDragText: G,
|
|
33
|
+
onRowDragEnter: X,
|
|
34
|
+
onRowDragMove: T,
|
|
35
|
+
onRowDragLeave: S,
|
|
36
|
+
onRowDragCancel: Y,
|
|
37
|
+
onRowDragEnd: k,
|
|
38
|
+
gridContainerRef: c,
|
|
39
|
+
gridApiRef: H
|
|
40
|
+
} = x, D = Lo(w), t = Io({ variant: w, onRowReorder: M, getRowId: n }), N = D && P === "none", e = Q === !0, { t: K } = go(), [Z, _] = lo(""), $ = A(() => t ? Ro({
|
|
41
|
+
columnDefs: E,
|
|
42
|
+
isRowDragDisabled: m,
|
|
43
|
+
getRowDragHandleLabel: C
|
|
44
|
+
}) : E, [C, t, m, E]), F = A(
|
|
45
|
+
() => uo(g),
|
|
46
|
+
[g]
|
|
47
|
+
), O = A(
|
|
48
|
+
() => D ? po(f, b) : b,
|
|
49
|
+
[b, D, f]
|
|
50
|
+
), I = p(
|
|
51
|
+
(o) => {
|
|
52
|
+
M?.(o), _(
|
|
53
|
+
fo(o.toIndex + 1, K("dataTable.listMovedToPosition"))
|
|
54
|
+
);
|
|
55
|
+
},
|
|
56
|
+
[M, K]
|
|
57
|
+
), a = ho({
|
|
58
|
+
enabled: t,
|
|
59
|
+
gridContainerRef: c,
|
|
60
|
+
listDragPreview: J,
|
|
61
|
+
rowDragText: G ?? F,
|
|
62
|
+
onRowDragEnter: X,
|
|
63
|
+
onRowDragCancel: Y
|
|
64
|
+
}), oo = p(
|
|
65
|
+
(o) => {
|
|
66
|
+
if (a.handleRowDragMove(o), !e) {
|
|
67
|
+
const i = Math.max(o.overIndex, 0), r = o.node.data && B(d, { row: o.node.data, toIndex: i }), R = mo(
|
|
68
|
+
o,
|
|
69
|
+
c.current
|
|
70
|
+
);
|
|
71
|
+
o.api.setRowDropPositionIndicator(
|
|
72
|
+
R && r && o.overNode ? { row: o.overNode, dropIndicatorPosition: W(o) } : null
|
|
73
|
+
);
|
|
74
|
+
}
|
|
75
|
+
T?.(o);
|
|
76
|
+
},
|
|
77
|
+
[d, c, e, T, a]
|
|
78
|
+
), ro = p(
|
|
79
|
+
(o) => {
|
|
80
|
+
e || o.api.setRowDropPositionIndicator(null), S?.(o);
|
|
81
|
+
},
|
|
82
|
+
[e, S]
|
|
83
|
+
), eo = p(
|
|
84
|
+
(o) => {
|
|
85
|
+
e || o.api.setRowDropPositionIndicator(null), a.handleRowDragCancel(o);
|
|
86
|
+
},
|
|
87
|
+
[e, a]
|
|
88
|
+
), to = p(
|
|
89
|
+
(o) => {
|
|
90
|
+
if (a.clearPreview(), o.api.setRowDropPositionIndicator(null), !e && l && o.node.data && n) {
|
|
91
|
+
const i = h(o.node), r = Math.max(o.overIndex, 0);
|
|
92
|
+
if (o.node.data && B(d, { row: o.node.data, toIndex: r }) && i) {
|
|
93
|
+
const s = co({
|
|
94
|
+
items: l,
|
|
95
|
+
getItemId: (u) => q(n, u) ?? "",
|
|
96
|
+
draggedId: i,
|
|
97
|
+
overId: h(o.overNode),
|
|
98
|
+
position: W(o)
|
|
99
|
+
});
|
|
100
|
+
s && I(s);
|
|
101
|
+
}
|
|
102
|
+
} else typeof f == "function" && o.api.redrawRows();
|
|
103
|
+
k?.(o);
|
|
104
|
+
},
|
|
105
|
+
[d, I, n, f, e, k, a, l]
|
|
106
|
+
);
|
|
107
|
+
wo(() => {
|
|
108
|
+
const o = c.current;
|
|
109
|
+
if (!t || !o || !n) return;
|
|
110
|
+
const i = (r) => {
|
|
111
|
+
if (!r.altKey || r.key !== "ArrowUp" && r.key !== "ArrowDown") return;
|
|
112
|
+
const R = r.target;
|
|
113
|
+
if (R?.closest('input, textarea, [contenteditable="true"]')) return;
|
|
114
|
+
const s = H.current, u = yo({ api: s ?? void 0, target: R });
|
|
115
|
+
if (!u?.data || !l || !s) return;
|
|
116
|
+
const L = h(u);
|
|
117
|
+
if (!L) return;
|
|
118
|
+
r.preventDefault();
|
|
119
|
+
const y = r.key === "ArrowUp" ? "up" : "down", U = Do({
|
|
120
|
+
items: l,
|
|
121
|
+
displayedRowIds: z(s),
|
|
122
|
+
draggedId: L,
|
|
123
|
+
direction: y,
|
|
124
|
+
getItemId: (io) => q(n, io) ?? "",
|
|
125
|
+
isRowDragDisabled: m,
|
|
126
|
+
canDropRow: d
|
|
127
|
+
});
|
|
128
|
+
if (U) {
|
|
129
|
+
I(U);
|
|
130
|
+
return;
|
|
131
|
+
}
|
|
132
|
+
const V = z(s), j = V.indexOf(L);
|
|
133
|
+
(y === "up" && j === 0 || y === "down" && j === V.length - 1) && v && v({ rowId: L, direction: y, row: u.data });
|
|
134
|
+
};
|
|
135
|
+
return o.addEventListener("keydown", i), () => o.removeEventListener("keydown", i);
|
|
136
|
+
}, [d, I, n, H, c, t, m, v, l]);
|
|
137
|
+
const ao = t ? /* @__PURE__ */ so("div", { className: "sr-only", "aria-live": "polite", children: Z }) : null, no = t ? {
|
|
138
|
+
rowDragManaged: e,
|
|
139
|
+
rowDragText: G ?? F,
|
|
140
|
+
suppressMoveWhenRowDragging: !0,
|
|
141
|
+
animateRows: !0,
|
|
142
|
+
getRowStyle: O,
|
|
143
|
+
onRowDragEnter: a.handleRowDragEnter,
|
|
144
|
+
onRowDragMove: oo,
|
|
145
|
+
onRowDragLeave: ro,
|
|
146
|
+
onRowDragCancel: eo,
|
|
147
|
+
onRowDragEnd: to
|
|
148
|
+
} : D ? { getRowStyle: O } : null;
|
|
149
|
+
return {
|
|
150
|
+
isDragList: t,
|
|
151
|
+
isListVariant: D,
|
|
152
|
+
hideColumnHeader: N,
|
|
153
|
+
dragListColumnDefs: $,
|
|
154
|
+
dragListGridProps: no,
|
|
155
|
+
listHeaderGridProps: N ? { headerHeight: 0 } : null,
|
|
156
|
+
dragPreviewPortal: a.dragPreviewPortal,
|
|
157
|
+
liveRegion: ao
|
|
158
|
+
};
|
|
159
|
+
}
|
|
160
|
+
export {
|
|
161
|
+
Go as useAgGridDragList
|
|
162
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { ReactNode, RefObject } from 'react';
|
|
2
|
+
import { RowDragCancelEvent, RowDragEnterEvent, RowDragMoveEvent } from 'ag-grid-community';
|
|
3
|
+
import { AgGridReactProps } from 'ag-grid-react';
|
|
4
|
+
export declare function useListDragPreview<TData>(options: {
|
|
5
|
+
enabled: boolean;
|
|
6
|
+
gridContainerRef: RefObject<HTMLElement | null>;
|
|
7
|
+
listDragPreview?: (params: {
|
|
8
|
+
data: TData;
|
|
9
|
+
}) => ReactNode;
|
|
10
|
+
rowDragText?: AgGridReactProps<TData>['rowDragText'];
|
|
11
|
+
onRowDragEnter?: (event: RowDragEnterEvent<TData>) => void;
|
|
12
|
+
onRowDragMove?: (event: RowDragMoveEvent<TData>) => void;
|
|
13
|
+
onRowDragCancel?: (event: RowDragCancelEvent<TData>) => void;
|
|
14
|
+
}): {
|
|
15
|
+
handleRowDragEnter: (event: RowDragEnterEvent<TData>) => void;
|
|
16
|
+
handleRowDragMove: (event: RowDragMoveEvent<TData>) => void;
|
|
17
|
+
handleRowDragCancel: (event: RowDragCancelEvent<TData>) => void;
|
|
18
|
+
clearPreview: () => void;
|
|
19
|
+
dragPreviewPortal: import('react').ReactPortal | null;
|
|
20
|
+
};
|
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
import { jsx as b } from "react/jsx-runtime";
|
|
2
|
+
import { useState as E, useRef as T, useCallback as u, useEffect as A } from "react";
|
|
3
|
+
import { createPortal as F } from "react-dom";
|
|
4
|
+
import { ListDragPreviewCard as H } from "./list-drag-preview-card.js";
|
|
5
|
+
import { readListDragPreviewPosition as N, readListDragPreviewMarkup as q, readListDragRowFrame as B } from "./list-drag-preview-snapshot.js";
|
|
6
|
+
function k(r) {
|
|
7
|
+
return r ? { x: r.clientX, y: r.clientY } : { x: 0, y: 0 };
|
|
8
|
+
}
|
|
9
|
+
function G(r, a) {
|
|
10
|
+
return r ? r({ rowNode: a, defaultTextValue: a.id ?? "" }, 1) : "";
|
|
11
|
+
}
|
|
12
|
+
function I(r) {
|
|
13
|
+
return {
|
|
14
|
+
frame: B(r),
|
|
15
|
+
markup: q(r)
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
function x(r, a, s) {
|
|
19
|
+
return { ...r, pointerX: a, pointerY: s };
|
|
20
|
+
}
|
|
21
|
+
function C(r) {
|
|
22
|
+
return r.pointerType === "mouse" || r.pointerType === "pen" ? r.buttons === 1 : r.buttons !== 0;
|
|
23
|
+
}
|
|
24
|
+
function K(r) {
|
|
25
|
+
const {
|
|
26
|
+
enabled: a,
|
|
27
|
+
gridContainerRef: s,
|
|
28
|
+
listDragPreview: f,
|
|
29
|
+
rowDragText: P,
|
|
30
|
+
onRowDragEnter: g,
|
|
31
|
+
onRowDragMove: y,
|
|
32
|
+
onRowDragCancel: L
|
|
33
|
+
} = r, [n, l] = E(null), [p, D] = E(!1), c = T(!1), i = u(() => {
|
|
34
|
+
c.current = !1, l(null), D(!1);
|
|
35
|
+
}, []), h = u(
|
|
36
|
+
(e) => {
|
|
37
|
+
D(!0), l({
|
|
38
|
+
body: e.body,
|
|
39
|
+
label: e.label,
|
|
40
|
+
pointerX: e.pointerX,
|
|
41
|
+
pointerY: e.pointerY,
|
|
42
|
+
frame: e.frame,
|
|
43
|
+
markup: e.markup
|
|
44
|
+
});
|
|
45
|
+
},
|
|
46
|
+
[]
|
|
47
|
+
), R = u(
|
|
48
|
+
(e, t, o, d) => {
|
|
49
|
+
const m = s.current;
|
|
50
|
+
if (!m?.querySelector(".ag-row.ag-row-dragging")) return !1;
|
|
51
|
+
const v = I(m);
|
|
52
|
+
return v.frame ? (c.current = !0, h({
|
|
53
|
+
pointerX: e,
|
|
54
|
+
pointerY: t,
|
|
55
|
+
label: o,
|
|
56
|
+
body: d,
|
|
57
|
+
frame: v.frame,
|
|
58
|
+
markup: v.markup
|
|
59
|
+
}), !0) : !1;
|
|
60
|
+
},
|
|
61
|
+
[h, s]
|
|
62
|
+
), S = u(
|
|
63
|
+
(e) => {
|
|
64
|
+
if (c.current) {
|
|
65
|
+
g?.(e);
|
|
66
|
+
return;
|
|
67
|
+
}
|
|
68
|
+
const t = k(e.event), o = e.node.data, d = G(P, e.node), m = f && o ? f({ data: o }) : null;
|
|
69
|
+
requestAnimationFrame(() => {
|
|
70
|
+
c.current || R(t.x, t.y, d, m);
|
|
71
|
+
}), g?.(e);
|
|
72
|
+
},
|
|
73
|
+
[R, f, g, P]
|
|
74
|
+
), X = u(
|
|
75
|
+
(e) => {
|
|
76
|
+
if (!C(e.event ?? {})) {
|
|
77
|
+
i();
|
|
78
|
+
return;
|
|
79
|
+
}
|
|
80
|
+
const t = k(e.event);
|
|
81
|
+
l((o) => o && x(o, t.x, t.y)), y?.(e);
|
|
82
|
+
},
|
|
83
|
+
[i, y]
|
|
84
|
+
), Y = u(
|
|
85
|
+
(e) => {
|
|
86
|
+
i(), L?.(e);
|
|
87
|
+
},
|
|
88
|
+
[i, L]
|
|
89
|
+
);
|
|
90
|
+
A(() => {
|
|
91
|
+
if (!a || !p) return;
|
|
92
|
+
document.body.setAttribute("data-in-list-drag", "true");
|
|
93
|
+
const e = (o) => {
|
|
94
|
+
if (!C(o)) {
|
|
95
|
+
i();
|
|
96
|
+
return;
|
|
97
|
+
}
|
|
98
|
+
l(
|
|
99
|
+
(d) => d && x(d, o.clientX, o.clientY)
|
|
100
|
+
);
|
|
101
|
+
}, t = () => {
|
|
102
|
+
i();
|
|
103
|
+
};
|
|
104
|
+
return document.addEventListener("pointermove", e), document.addEventListener("pointerup", t), document.addEventListener("pointercancel", t), window.addEventListener("blur", t), () => {
|
|
105
|
+
document.body.removeAttribute("data-in-list-drag"), document.removeEventListener("pointermove", e), document.removeEventListener("pointerup", t), document.removeEventListener("pointercancel", t), window.removeEventListener("blur", t);
|
|
106
|
+
};
|
|
107
|
+
}, [i, a, p]);
|
|
108
|
+
const w = n == null ? null : N({
|
|
109
|
+
pointerX: n.pointerX,
|
|
110
|
+
pointerY: n.pointerY,
|
|
111
|
+
frame: n.frame
|
|
112
|
+
}), M = a && p && n && w && typeof document < "u" ? F(
|
|
113
|
+
/* @__PURE__ */ b(
|
|
114
|
+
"div",
|
|
115
|
+
{
|
|
116
|
+
"data-component": "ag-grid-drag-preview",
|
|
117
|
+
"aria-hidden": "true",
|
|
118
|
+
className: "pointer-events-none fixed z-[9999] box-border overflow-hidden",
|
|
119
|
+
style: {
|
|
120
|
+
left: w.left,
|
|
121
|
+
top: w.top,
|
|
122
|
+
width: n.frame?.width,
|
|
123
|
+
height: n.frame?.cardHeight,
|
|
124
|
+
borderRadius: n.frame?.listBorderRadius || void 0,
|
|
125
|
+
"--in-ag-list-row-gradient": n.frame?.rowGradient || void 0
|
|
126
|
+
},
|
|
127
|
+
children: n.body ?? (n.markup ? /* @__PURE__ */ b(
|
|
128
|
+
"div",
|
|
129
|
+
{
|
|
130
|
+
className: "in-ag-list-drag-preview-content",
|
|
131
|
+
dangerouslySetInnerHTML: { __html: n.markup }
|
|
132
|
+
}
|
|
133
|
+
) : /* @__PURE__ */ b(H, { label: n.label }))
|
|
134
|
+
}
|
|
135
|
+
),
|
|
136
|
+
document.body
|
|
137
|
+
) : null;
|
|
138
|
+
return {
|
|
139
|
+
handleRowDragEnter: S,
|
|
140
|
+
handleRowDragMove: X,
|
|
141
|
+
handleRowDragCancel: Y,
|
|
142
|
+
clearPreview: i,
|
|
143
|
+
dragPreviewPortal: M
|
|
144
|
+
};
|
|
145
|
+
}
|
|
146
|
+
export {
|
|
147
|
+
K as useListDragPreview
|
|
148
|
+
};
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { GridApi } from 'ag-grid-community';
|
|
2
|
+
import { KeyAttributeRow } from './ag-grid-list.demo-board';
|
|
3
|
+
interface UseKeyAttributesFindOptions {
|
|
4
|
+
topRows: KeyAttributeRow[];
|
|
5
|
+
benchRows: KeyAttributeRow[];
|
|
6
|
+
showBench: boolean;
|
|
7
|
+
topApi: GridApi<KeyAttributeRow> | null;
|
|
8
|
+
benchApi: GridApi<KeyAttributeRow> | null;
|
|
9
|
+
}
|
|
10
|
+
/** Refresh name cells on the rows that changed. Omit `rowIds` to refresh the whole name column. */
|
|
11
|
+
export declare function refreshFindHighlightGrids(options: {
|
|
12
|
+
topApi: GridApi<KeyAttributeRow> | null;
|
|
13
|
+
benchApi: GridApi<KeyAttributeRow> | null;
|
|
14
|
+
rowIds?: string[];
|
|
15
|
+
}): void;
|
|
16
|
+
export interface KeyAttributesFindGridContext {
|
|
17
|
+
findQuery: string;
|
|
18
|
+
currentMatchRowId?: string;
|
|
19
|
+
/** Active substring within the row name (0-based among matches in that cell). */
|
|
20
|
+
currentOccurrenceIndexInRow?: number;
|
|
21
|
+
}
|
|
22
|
+
export declare const KEY_ATTRIBUTES_FIND_CONTEXT_KEY = "keyAttributesFind";
|
|
23
|
+
export declare function readKeyAttributesFindFromGridContext(context: unknown): KeyAttributesFindGridContext;
|
|
24
|
+
/** Key Attributes demo hook — not part of the public `impact-nova/data-table` API. */
|
|
25
|
+
export declare function useListFind(options: UseKeyAttributesFindOptions): {
|
|
26
|
+
open: boolean;
|
|
27
|
+
query: string;
|
|
28
|
+
activeIndex: number;
|
|
29
|
+
matchCount: number;
|
|
30
|
+
openFind: () => void;
|
|
31
|
+
closeFind: () => void;
|
|
32
|
+
setQuery: (nextQuery: string) => void;
|
|
33
|
+
goPrevious: () => void;
|
|
34
|
+
goNext: () => void;
|
|
35
|
+
};
|
|
36
|
+
export {};
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { GridApi, RowDragEndEvent, RowDragMoveEvent } from 'ag-grid-community';
|
|
2
|
+
import { ListRowDropCheck, ListRowTransferMeta } from './list-row-move';
|
|
3
|
+
/** Stable key for drop-zone pairing — ignores a new `lists` object with the same APIs. */
|
|
4
|
+
export declare function readListDropZoneIdentity(lists: Record<string, object | null | undefined>): string;
|
|
5
|
+
export interface UseListRowDropZonesOptions<TData> {
|
|
6
|
+
/** Grid APIs from each list's `onGridReady`. A `null` api is skipped (hidden list). */
|
|
7
|
+
lists: Record<string, GridApi<TData> | null>;
|
|
8
|
+
/**
|
|
9
|
+
* Host owns both `rowData` arrays. Remove `meta.row` from `meta.fromListId`
|
|
10
|
+
* and insert it at `meta.toIndex` on `meta.toListId`.
|
|
11
|
+
*/
|
|
12
|
+
onRowTransfer: (meta: ListRowTransferMeta<TData>) => void;
|
|
13
|
+
canDropRow?: (params: ListRowDropCheck<TData>) => boolean;
|
|
14
|
+
}
|
|
15
|
+
export declare function displayedRowCount<TData>(api: GridApi<TData>): number;
|
|
16
|
+
export declare function previewListTransferAllowed<TData>(event: RowDragMoveEvent<TData>, options: {
|
|
17
|
+
fromListId: string;
|
|
18
|
+
toListId: string;
|
|
19
|
+
target: GridApi<TData>;
|
|
20
|
+
canDropRow?: (params: ListRowDropCheck<TData>) => boolean;
|
|
21
|
+
}): boolean;
|
|
22
|
+
export declare function tryListRowTransfer<TData>(event: RowDragEndEvent<TData>, options: {
|
|
23
|
+
fromListId: string;
|
|
24
|
+
toListId: string;
|
|
25
|
+
target: GridApi<TData>;
|
|
26
|
+
canDropRow?: (params: ListRowDropCheck<TData>) => boolean;
|
|
27
|
+
}): ListRowTransferMeta<TData> | null;
|
|
28
|
+
/**
|
|
29
|
+
* Cross-list drag on `variant="list"` + `onRowReorder`. Pass each list's `GridApi`
|
|
30
|
+
* from `onGridReady`. Same-list drops still go through that list's `onRowReorder`.
|
|
31
|
+
*
|
|
32
|
+
* @example
|
|
33
|
+
* useListRowDropZones({
|
|
34
|
+
* lists: { inPlan: inPlanApi, bench: benchApi },
|
|
35
|
+
* onRowTransfer: ({ row, rowId, toListId, toIndex }) => {
|
|
36
|
+
* const place = (rows: Item[], isDestination: boolean) => {
|
|
37
|
+
* const without = rows.filter((item) => item.id !== rowId);
|
|
38
|
+
* if (!isDestination) return without;
|
|
39
|
+
* return [...without.slice(0, toIndex), row, ...without.slice(toIndex)];
|
|
40
|
+
* };
|
|
41
|
+
* setInPlan((rows) => place(rows, toListId === 'inPlan'));
|
|
42
|
+
* setBench((rows) => place(rows, toListId === 'bench'));
|
|
43
|
+
* },
|
|
44
|
+
* });
|
|
45
|
+
*/
|
|
46
|
+
export declare function useListRowDropZones<TData>(options: UseListRowDropZonesOptions<TData>): void;
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import { useRef as y, useEffect as w } from "react";
|
|
2
|
+
import { buildListRowTransferMeta as A, listRowTransferDropIndex as P, isListDropAllowed as Z } from "./list-row-move.js";
|
|
3
|
+
import { readDragRowId as v, dropPositionFromEvent as m } from "./list-drag-grid-options.js";
|
|
4
|
+
const D = /* @__PURE__ */ new WeakMap();
|
|
5
|
+
let R = 1;
|
|
6
|
+
function N(t) {
|
|
7
|
+
const o = D.get(t);
|
|
8
|
+
if (o) return o;
|
|
9
|
+
const r = R;
|
|
10
|
+
return R += 1, D.set(t, r), r;
|
|
11
|
+
}
|
|
12
|
+
function T(t) {
|
|
13
|
+
return Object.keys(t).sort().map((o) => {
|
|
14
|
+
const r = t[o];
|
|
15
|
+
return `${o}:${r == null ? "0" : String(N(r))}`;
|
|
16
|
+
}).join("|");
|
|
17
|
+
}
|
|
18
|
+
function L(t) {
|
|
19
|
+
let o = 0;
|
|
20
|
+
return t.forEachNodeAfterFilterAndSort(() => {
|
|
21
|
+
o += 1;
|
|
22
|
+
}), o;
|
|
23
|
+
}
|
|
24
|
+
function C(t, o) {
|
|
25
|
+
const r = t.node.data;
|
|
26
|
+
if (!r) return !1;
|
|
27
|
+
const n = P({
|
|
28
|
+
overIndex: t.overIndex,
|
|
29
|
+
overNode: t.overNode,
|
|
30
|
+
targetDisplayedCount: L(o.target),
|
|
31
|
+
position: m(t)
|
|
32
|
+
});
|
|
33
|
+
return Z(o.canDropRow, {
|
|
34
|
+
row: r,
|
|
35
|
+
toIndex: n,
|
|
36
|
+
fromListId: o.fromListId,
|
|
37
|
+
toListId: o.toListId
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
function b(t, o) {
|
|
41
|
+
const r = t.node.data, n = v(t.node);
|
|
42
|
+
return A({
|
|
43
|
+
row: r,
|
|
44
|
+
rowId: n,
|
|
45
|
+
fromListId: o.fromListId,
|
|
46
|
+
toListId: o.toListId,
|
|
47
|
+
overIndex: t.overIndex,
|
|
48
|
+
overNode: t.overNode,
|
|
49
|
+
targetDisplayedCount: L(o.target),
|
|
50
|
+
position: m(t),
|
|
51
|
+
canDropRow: o.canDropRow
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
function S(t) {
|
|
55
|
+
const { lists: o, onRowTransfer: r, canDropRow: n } = t, c = y(o), g = T(o);
|
|
56
|
+
w(() => {
|
|
57
|
+
c.current = o;
|
|
58
|
+
}), w(() => {
|
|
59
|
+
const x = c.current, f = Object.entries(x).filter(
|
|
60
|
+
(e) => e[1] != null
|
|
61
|
+
), u = [];
|
|
62
|
+
for (const [e, s] of f)
|
|
63
|
+
for (const [p, i] of f) {
|
|
64
|
+
if (e === p) continue;
|
|
65
|
+
const l = { fromListId: e, toListId: p, target: i, canDropRow: n }, d = i.getRowDropZoneParams({
|
|
66
|
+
onDragging: (a) => {
|
|
67
|
+
s.setRowDropPositionIndicator(null), C(a, l) || i.setRowDropPositionIndicator(null);
|
|
68
|
+
},
|
|
69
|
+
onDragStop: (a) => {
|
|
70
|
+
i.setRowDropPositionIndicator(null);
|
|
71
|
+
const I = b(a, l);
|
|
72
|
+
I && r(I);
|
|
73
|
+
},
|
|
74
|
+
onDragLeave: () => {
|
|
75
|
+
s.setRowDropPositionIndicator(null), i.setRowDropPositionIndicator(null);
|
|
76
|
+
}
|
|
77
|
+
});
|
|
78
|
+
d && (s.addRowDropZone(d), u.push({ source: s, params: d }));
|
|
79
|
+
}
|
|
80
|
+
return () => {
|
|
81
|
+
for (const { source: e, params: s } of u)
|
|
82
|
+
e.removeRowDropZone(s);
|
|
83
|
+
};
|
|
84
|
+
}, [n, g, r]);
|
|
85
|
+
}
|
|
86
|
+
export {
|
|
87
|
+
L as displayedRowCount,
|
|
88
|
+
C as previewListTransferAllowed,
|
|
89
|
+
T as readListDropZoneIdentity,
|
|
90
|
+
b as tryListRowTransfer,
|
|
91
|
+
S as useListRowDropZones
|
|
92
|
+
};
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import { resolveColumnPinnedFromGridState as E } from "./data-table-column-apply.js";
|
|
2
|
-
import {
|
|
2
|
+
import { isPickerEligibleGridColumn as H } from "./data-table-picker-column-eligibility.js";
|
|
3
3
|
import { resolveColumnSavability as q } from "./column-savability.js";
|
|
4
4
|
function K(l) {
|
|
5
|
-
const
|
|
5
|
+
const d = [];
|
|
6
6
|
let c = l.getOriginalParent();
|
|
7
7
|
for (; c; ) {
|
|
8
8
|
const u = c.getColGroupDef();
|
|
9
|
-
u?.headerName && u?.children &&
|
|
9
|
+
u?.headerName && u?.children && d.push(c), c = c.getOriginalParent();
|
|
10
10
|
}
|
|
11
|
-
return
|
|
11
|
+
return d.reverse(), d;
|
|
12
12
|
}
|
|
13
|
-
function
|
|
13
|
+
function J(l, d) {
|
|
14
14
|
const c = l.getColumnState(), u = l.getGridOption("context"), _ = typeof u?.activeSearchColumnId == "string" ? u.activeSearchColumnId : null, F = l.getAllGridColumns?.() ?? l.getColumns() ?? [], M = new Map(
|
|
15
15
|
F.map((o) => [o.getColId(), o])
|
|
16
16
|
), f = [], h = [], v = /* @__PURE__ */ new Map(), S = /* @__PURE__ */ new Map(), m = /* @__PURE__ */ new Map();
|
|
@@ -25,27 +25,27 @@ function A(l, a) {
|
|
|
25
25
|
return n.node;
|
|
26
26
|
const s = S.get(r) || 0;
|
|
27
27
|
S.set(r, s + 1);
|
|
28
|
-
const k = o.getColGroupDef(),
|
|
28
|
+
const k = o.getColGroupDef(), a = {
|
|
29
29
|
id: s === 0 ? `${t}__${i}` : `${t}__${i}__${s}`,
|
|
30
30
|
label: k?.headerName || t,
|
|
31
31
|
checked: !0,
|
|
32
32
|
children: [],
|
|
33
33
|
category: "group"
|
|
34
34
|
};
|
|
35
|
-
return e.push(
|
|
35
|
+
return e.push(a), v.set(r, { list: e, node: a }), a;
|
|
36
36
|
};
|
|
37
37
|
let g = 0, y = 0, I = 0, N = 0;
|
|
38
38
|
c.forEach((o) => {
|
|
39
39
|
const e = M.get(o.colId) ?? l.getColumn(o.colId);
|
|
40
40
|
if (!e) return;
|
|
41
41
|
const t = e.getColDef(), i = t.headerName;
|
|
42
|
-
if (i != null && i.trim() === "" || !H(
|
|
42
|
+
if (i != null && i.trim() === "" || !H(e, l))
|
|
43
43
|
return;
|
|
44
44
|
const r = t.headerName;
|
|
45
45
|
let n = typeof r == "string" && r.trim() !== "" ? r : l.getDisplayNameForColumn(e, "header");
|
|
46
46
|
if ((!n || n.trim() === "") && (n = t.field ?? o.colId), !n || n.trim() === "")
|
|
47
47
|
return;
|
|
48
|
-
const s = !o.hide, k = !!o.sort, $ = e.isFilterActive() || _ === o.colId,
|
|
48
|
+
const s = !o.hide, k = !!o.sort, $ = e.isFilterActive() || _ === o.colId, a = E(o, e), w = !q(e), p = {
|
|
49
49
|
id: o.colId,
|
|
50
50
|
label: n,
|
|
51
51
|
checked: s,
|
|
@@ -53,11 +53,11 @@ function A(l, a) {
|
|
|
53
53
|
hasSortApplied: k,
|
|
54
54
|
hasFilterApplied: $,
|
|
55
55
|
isNonSavable: w,
|
|
56
|
-
pinned:
|
|
56
|
+
pinned: a
|
|
57
57
|
}
|
|
58
58
|
};
|
|
59
|
-
|
|
60
|
-
const z =
|
|
59
|
+
a ? (g++, s && y++) : (I++, s && N++);
|
|
60
|
+
const z = a ? f : h, G = K(e), T = G.map((C) => C.getGroupId());
|
|
61
61
|
if (G.length > 0) {
|
|
62
62
|
p.data = {
|
|
63
63
|
...p.data,
|
|
@@ -79,7 +79,7 @@ function A(l, a) {
|
|
|
79
79
|
return b(f), b(h), [
|
|
80
80
|
{
|
|
81
81
|
id: "root-frozen",
|
|
82
|
-
label:
|
|
82
|
+
label: d.frozenColumns,
|
|
83
83
|
checked: g > 0 && y === g,
|
|
84
84
|
children: f,
|
|
85
85
|
category: "structure",
|
|
@@ -87,7 +87,7 @@ function A(l, a) {
|
|
|
87
87
|
},
|
|
88
88
|
{
|
|
89
89
|
id: "root-scrollable",
|
|
90
|
-
label:
|
|
90
|
+
label: d.scrollableColumns,
|
|
91
91
|
checked: I > 0 && N === I,
|
|
92
92
|
children: h,
|
|
93
93
|
category: "structure",
|
|
@@ -96,5 +96,5 @@ function A(l, a) {
|
|
|
96
96
|
];
|
|
97
97
|
}
|
|
98
98
|
export {
|
|
99
|
-
|
|
99
|
+
J as buildColumnTreeFromGrid
|
|
100
100
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { resolveColumnPinnedFromGridState as P } from "./data-table-column-apply.js";
|
|
2
|
-
import {
|
|
2
|
+
import { isPickerEligibleGridColumn as F } from "./data-table-picker-column-eligibility.js";
|
|
3
3
|
import { buildColumnIndicatorMapsFromGrid as S } from "./patch-column-tree-indicators-from-grid.js";
|
|
4
4
|
import { resolveColumnSavability as V } from "./column-savability.js";
|
|
5
5
|
import { Fnv1a128Hasher as N } from "../../../lib/hash/fnv1a128.js";
|
|
@@ -12,7 +12,7 @@ function E(n) {
|
|
|
12
12
|
const r = e.get(t.colId) ?? n.getColumn(t.colId);
|
|
13
13
|
if (!r) continue;
|
|
14
14
|
const a = r.getColDef(), p = a.headerName;
|
|
15
|
-
if (p != null && p.trim() === "" || !F(
|
|
15
|
+
if (p != null && p.trim() === "" || !F(r, n))
|
|
16
16
|
continue;
|
|
17
17
|
const C = a.headerName;
|
|
18
18
|
let s = typeof C == "string" && C.trim() !== "" ? C : n.getDisplayNameForColumn(r, "header");
|
|
@@ -23,22 +23,22 @@ function E(n) {
|
|
|
23
23
|
const h = [];
|
|
24
24
|
let u = r.getOriginalParent();
|
|
25
25
|
for (; u; ) {
|
|
26
|
-
const
|
|
27
|
-
if (
|
|
26
|
+
const f = u.getColGroupDef();
|
|
27
|
+
if (f?.headerName && f?.children) {
|
|
28
28
|
const m = u.getGroupId();
|
|
29
29
|
if (h.unshift(m), !c.has(m)) {
|
|
30
|
-
const
|
|
30
|
+
const I = u.getOriginalParent();
|
|
31
31
|
let M = null;
|
|
32
|
-
for (;
|
|
33
|
-
const G =
|
|
32
|
+
for (; I; ) {
|
|
33
|
+
const G = I.getColGroupDef();
|
|
34
34
|
if (G?.headerName && G?.children) {
|
|
35
|
-
M =
|
|
35
|
+
M = I.getGroupId();
|
|
36
36
|
break;
|
|
37
37
|
}
|
|
38
38
|
}
|
|
39
39
|
c.set(m, {
|
|
40
40
|
groupId: m,
|
|
41
|
-
label:
|
|
41
|
+
label: f.headerName,
|
|
42
42
|
parentGroupId: M
|
|
43
43
|
});
|
|
44
44
|
}
|