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,34 @@
|
|
|
1
|
+
import { GridApi, IRowNode, RowDragEndEvent, RowDragMoveEvent } from 'ag-grid-community';
|
|
2
|
+
import { AgGridReactProps } from 'ag-grid-react';
|
|
3
|
+
import { ListDropPosition, isListDropAllowed } from './list-row-move';
|
|
4
|
+
import { AgGridVisualVariant, AgGridWrapperProps } from './ag-grid.types';
|
|
5
|
+
/** Card-row skin on `DataTableContent` / `AgGridWrapper`. */
|
|
6
|
+
export declare function isAgGridListVariant(variant: AgGridVisualVariant | undefined): boolean;
|
|
7
|
+
/**
|
|
8
|
+
* Row drag on the list skin: `variant="list"` plus `onRowReorder` plus `getRowId`.
|
|
9
|
+
* Handles are not shown without a callback — the host must own `rowData`.
|
|
10
|
+
*/
|
|
11
|
+
export declare function isAgGridListDragEnabled(options: {
|
|
12
|
+
variant: AgGridVisualVariant | undefined;
|
|
13
|
+
onRowReorder?: unknown;
|
|
14
|
+
getRowId?: unknown;
|
|
15
|
+
}): boolean;
|
|
16
|
+
export declare function readDragRowId<TData>(node: IRowNode<TData> | undefined): string | undefined;
|
|
17
|
+
/** Resolve the row under the drag handle / `.ag-row`, then fall back to the focused cell. */
|
|
18
|
+
export declare function readListKeyboardRow<TData>(options: {
|
|
19
|
+
api: GridApi<TData> | undefined;
|
|
20
|
+
target: EventTarget | null;
|
|
21
|
+
}): IRowNode<TData> | undefined;
|
|
22
|
+
export declare function formatListReorderLiveMessage(position: number, template: string): string;
|
|
23
|
+
export declare function dropPositionFromEvent<TData>(event: RowDragMoveEvent<TData> | RowDragEndEvent<TData>): ListDropPosition;
|
|
24
|
+
/** Same-list line only while the pointer is over this grid. Cross-list drop paints the other grid. */
|
|
25
|
+
export declare function isListDragPointerOverHost(event: {
|
|
26
|
+
event?: {
|
|
27
|
+
clientX?: number;
|
|
28
|
+
clientY?: number;
|
|
29
|
+
} | null;
|
|
30
|
+
}, host: HTMLElement | null | undefined): boolean;
|
|
31
|
+
export declare function itemIdFromGetRowId<TData>(getRowId: AgGridReactProps<TData>['getRowId'], data: TData): string | undefined;
|
|
32
|
+
export declare function createDefaultRowDragText<TData>(columnDefs: AgGridReactProps<TData>['columnDefs']): NonNullable<AgGridReactProps<TData>['rowDragText']>;
|
|
33
|
+
export declare function createListRowStyle<TData>(listRowGradient: AgGridWrapperProps<TData>['listRowGradient'], userGetRowStyle: AgGridReactProps<TData>['getRowStyle']): AgGridReactProps<TData>['getRowStyle'];
|
|
34
|
+
export { isListDropAllowed };
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
function s(t) {
|
|
2
|
+
return t === "list";
|
|
3
|
+
}
|
|
4
|
+
function a(t) {
|
|
5
|
+
return t.variant === "list" && t.onRowReorder != null && t.getRowId != null;
|
|
6
|
+
}
|
|
7
|
+
function g(t) {
|
|
8
|
+
if (!(t?.id == null || t.id === ""))
|
|
9
|
+
return String(t.id);
|
|
10
|
+
}
|
|
11
|
+
function w(t) {
|
|
12
|
+
const { api: n, target: r } = t;
|
|
13
|
+
if (n && r instanceof Element) {
|
|
14
|
+
const i = r.closest(".ag-row");
|
|
15
|
+
if (i) {
|
|
16
|
+
const e = i.getAttribute("row-id");
|
|
17
|
+
if (e) {
|
|
18
|
+
const d = n.getRowNode(e);
|
|
19
|
+
if (d) return d;
|
|
20
|
+
}
|
|
21
|
+
const l = i.getAttribute("row-index");
|
|
22
|
+
if (l) {
|
|
23
|
+
const d = Number(l);
|
|
24
|
+
if (!Number.isNaN(d)) {
|
|
25
|
+
const f = n.getDisplayedRowAtIndex(d);
|
|
26
|
+
if (f) return f;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
const o = n?.getFocusedCell();
|
|
32
|
+
if (!(!o || o.rowIndex == null))
|
|
33
|
+
return n?.getDisplayedRowAtIndex(o.rowIndex) ?? void 0;
|
|
34
|
+
}
|
|
35
|
+
function b(t, n) {
|
|
36
|
+
return n.replace(/\{\{position\}\}/g, String(t));
|
|
37
|
+
}
|
|
38
|
+
function p(t) {
|
|
39
|
+
return t.rowsDrop?.position === "above" ? "above" : "below";
|
|
40
|
+
}
|
|
41
|
+
function I(t, n) {
|
|
42
|
+
if (!n) return !0;
|
|
43
|
+
const r = t.event;
|
|
44
|
+
if (r == null || typeof r.clientX != "number" || typeof r.clientY != "number")
|
|
45
|
+
return !0;
|
|
46
|
+
const o = n.getBoundingClientRect();
|
|
47
|
+
return o.width <= 0 || o.height <= 0 ? !0 : r.clientX >= o.left && r.clientX <= o.right && r.clientY >= o.top && r.clientY <= o.bottom;
|
|
48
|
+
}
|
|
49
|
+
function m(t, n) {
|
|
50
|
+
if (t)
|
|
51
|
+
return String(
|
|
52
|
+
t({ data: n, level: 0 })
|
|
53
|
+
);
|
|
54
|
+
}
|
|
55
|
+
function x(t) {
|
|
56
|
+
const n = u(t), r = [], o = (i) => {
|
|
57
|
+
for (const e of i) {
|
|
58
|
+
if (r.length >= 2) return;
|
|
59
|
+
"children" in e && e.children ? o(e.children) : "field" in e && typeof e.field == "string" && r.push(e.field);
|
|
60
|
+
}
|
|
61
|
+
};
|
|
62
|
+
return t && o(t), (i) => {
|
|
63
|
+
const e = i.rowNode?.data ?? {};
|
|
64
|
+
if (n) {
|
|
65
|
+
const l = e[n];
|
|
66
|
+
if (l != null && l !== "") return String(l);
|
|
67
|
+
}
|
|
68
|
+
return r.map((l) => e[l]).filter((l) => l != null && l !== "").join(" · ");
|
|
69
|
+
};
|
|
70
|
+
}
|
|
71
|
+
function c(t, n) {
|
|
72
|
+
return /rank/i.test(t) || n != null && /rank/i.test(n);
|
|
73
|
+
}
|
|
74
|
+
function u(t) {
|
|
75
|
+
const n = [], r = (i) => {
|
|
76
|
+
for (const e of i)
|
|
77
|
+
"children" in e && e.children ? r(e.children) : "field" in e && typeof e.field == "string" && e.colId !== "__drag-handle" && n.push({
|
|
78
|
+
field: e.field,
|
|
79
|
+
colId: typeof e.colId == "string" ? e.colId : void 0,
|
|
80
|
+
context: e.context
|
|
81
|
+
});
|
|
82
|
+
};
|
|
83
|
+
t && r(t);
|
|
84
|
+
for (const i of n)
|
|
85
|
+
if (/label|name|title$/i.test(i.field)) return i.field;
|
|
86
|
+
for (const i of n) {
|
|
87
|
+
const e = i.context;
|
|
88
|
+
if (e != null && typeof e == "object" && "findable" in e && e.findable === !0 && !c(i.field, i.colId))
|
|
89
|
+
return i.field;
|
|
90
|
+
}
|
|
91
|
+
return n.filter((i) => !c(i.field, i.colId))[0]?.field ?? n[0]?.field;
|
|
92
|
+
}
|
|
93
|
+
function y(t, n) {
|
|
94
|
+
return t == null ? n : (r) => {
|
|
95
|
+
const o = typeof t == "function" ? t({ data: r.data, rowIndex: r.node.rowIndex }) : t, i = n?.(r);
|
|
96
|
+
return o ? { ...i, "--in-ag-list-row-gradient": o } : i;
|
|
97
|
+
};
|
|
98
|
+
}
|
|
99
|
+
export {
|
|
100
|
+
x as createDefaultRowDragText,
|
|
101
|
+
y as createListRowStyle,
|
|
102
|
+
p as dropPositionFromEvent,
|
|
103
|
+
b as formatListReorderLiveMessage,
|
|
104
|
+
a as isAgGridListDragEnabled,
|
|
105
|
+
s as isAgGridListVariant,
|
|
106
|
+
I as isListDragPointerOverHost,
|
|
107
|
+
m as itemIdFromGetRowId,
|
|
108
|
+
g as readDragRowId,
|
|
109
|
+
w as readListKeyboardRow
|
|
110
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { jsx as t } from "react/jsx-runtime";
|
|
2
|
+
function r(e) {
|
|
3
|
+
return /* @__PURE__ */ t(
|
|
4
|
+
"span",
|
|
5
|
+
{
|
|
6
|
+
"data-component": "ag-grid-drag-preview-label",
|
|
7
|
+
className: "block min-w-0 truncate text-sm leading-5 text-content",
|
|
8
|
+
children: e.label
|
|
9
|
+
}
|
|
10
|
+
);
|
|
11
|
+
}
|
|
12
|
+
export {
|
|
13
|
+
r as ListDragPreviewCard
|
|
14
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export type ListDragRowFrame = {
|
|
2
|
+
left: number;
|
|
3
|
+
top: number;
|
|
4
|
+
width: number;
|
|
5
|
+
height: number;
|
|
6
|
+
cardHeight: number;
|
|
7
|
+
rowGradient: string;
|
|
8
|
+
listBorderRadius: string;
|
|
9
|
+
};
|
|
10
|
+
export declare function readListDragRowFrame(container: HTMLElement | null): ListDragRowFrame | null;
|
|
11
|
+
/** List row cells without the drag handle — same content as the visible row card. */
|
|
12
|
+
export declare function readListDragPreviewMarkup(container: HTMLElement | null): string;
|
|
13
|
+
export declare function readListDragPreviewPosition(options: {
|
|
14
|
+
pointerX: number;
|
|
15
|
+
pointerY: number;
|
|
16
|
+
frame: ListDragRowFrame | null;
|
|
17
|
+
}): {
|
|
18
|
+
left: number;
|
|
19
|
+
top: number;
|
|
20
|
+
};
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
function o(t) {
|
|
2
|
+
const e = t?.closest('[data-component="ag-grid-react"][data-variant="list"]');
|
|
3
|
+
if (!(e instanceof HTMLElement)) return "";
|
|
4
|
+
const r = getComputedStyle(e).getPropertyValue("--in-ag-list-radius").trim();
|
|
5
|
+
return r && !r.startsWith("var(") ? r : getComputedStyle(e).getPropertyValue("--radius").trim();
|
|
6
|
+
}
|
|
7
|
+
function c(t) {
|
|
8
|
+
const e = t.querySelector(".ag-center-cols-container") ?? t.querySelector(".ag-grid-scrolling-cells");
|
|
9
|
+
return e instanceof HTMLElement ? e : t;
|
|
10
|
+
}
|
|
11
|
+
function l(t) {
|
|
12
|
+
const e = t?.querySelector(".ag-row.ag-row-dragging");
|
|
13
|
+
if (!(e instanceof HTMLElement)) return null;
|
|
14
|
+
const r = e.getBoundingClientRect(), n = c(e).getBoundingClientRect(), a = e.style.getPropertyValue("--in-ag-list-row-gradient").trim();
|
|
15
|
+
return {
|
|
16
|
+
left: n.left,
|
|
17
|
+
top: r.top,
|
|
18
|
+
width: n.width / 2,
|
|
19
|
+
height: r.height,
|
|
20
|
+
cardHeight: Math.max(r.height - 12, 0),
|
|
21
|
+
rowGradient: a,
|
|
22
|
+
listBorderRadius: o(t)
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
function s(t) {
|
|
26
|
+
const e = t?.querySelector(".ag-row.ag-row-dragging");
|
|
27
|
+
if (!(e instanceof HTMLElement)) return "";
|
|
28
|
+
const r = e.querySelectorAll('.ag-cell:not([col-id="__drag-handle"])');
|
|
29
|
+
return r.length === 0 ? "" : `<div class="in-ag-list-drag-preview-row">${Array.from(r).map((n) => `<div class="in-ag-list-drag-preview-cell">${n.innerHTML}</div>`).join("")}</div>`;
|
|
30
|
+
}
|
|
31
|
+
function g(t) {
|
|
32
|
+
const r = t.frame?.cardHeight ?? 40;
|
|
33
|
+
return {
|
|
34
|
+
left: t.pointerX + 16,
|
|
35
|
+
top: t.pointerY - r / 2
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
export {
|
|
39
|
+
s as readListDragPreviewMarkup,
|
|
40
|
+
g as readListDragPreviewPosition,
|
|
41
|
+
l as readListDragRowFrame
|
|
42
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { jsx as e } from "react/jsx-runtime";
|
|
2
|
+
function t(i) {
|
|
3
|
+
return /* @__PURE__ */ e("div", { className: i.active ? "bg-canvas-sunken" : void 0, "data-find-current": i.active ? "true" : "false", children: i.children });
|
|
4
|
+
}
|
|
5
|
+
export {
|
|
6
|
+
t as ListFindHighlight
|
|
7
|
+
};
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
export type ListDropPosition = 'above' | 'below';
|
|
2
|
+
/** Same-list drop or Alt+Arrow. Set state from `rows` — do not rebuild order from the indexes. */
|
|
3
|
+
export interface ListRowReorderMeta<TItem> {
|
|
4
|
+
rowId: string;
|
|
5
|
+
fromIndex: number;
|
|
6
|
+
toIndex: number;
|
|
7
|
+
rows: TItem[];
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Cross-list drop from `useListRowDropZones`. Remove `row` from the source list
|
|
11
|
+
* and insert it at `toIndex` on the destination list.
|
|
12
|
+
*/
|
|
13
|
+
export interface ListRowTransferMeta<TItem> {
|
|
14
|
+
rowId: string;
|
|
15
|
+
row: TItem;
|
|
16
|
+
fromListId: string;
|
|
17
|
+
toListId: string;
|
|
18
|
+
toIndex: number;
|
|
19
|
+
}
|
|
20
|
+
export interface ListRowDropCheck<TItem> {
|
|
21
|
+
row: TItem;
|
|
22
|
+
fromListId?: string;
|
|
23
|
+
toListId?: string;
|
|
24
|
+
toIndex: number;
|
|
25
|
+
}
|
|
26
|
+
/** Same-list move. `toIndex` is the destination in the array after the item is removed, then inserted. */
|
|
27
|
+
export declare function moveListRow<TItem>(items: TItem[], fromIndex: number, toIndex: number): TItem[];
|
|
28
|
+
/**
|
|
29
|
+
* Maps a hover target to the `toIndex` for `moveListRow`.
|
|
30
|
+
* `below` inserts after the hovered row; `above` inserts before it.
|
|
31
|
+
*/
|
|
32
|
+
export declare function resolveDropToIndex(options: {
|
|
33
|
+
fromIndex: number;
|
|
34
|
+
overIndex: number;
|
|
35
|
+
position: ListDropPosition;
|
|
36
|
+
}): number;
|
|
37
|
+
export declare function applyUnmanagedRowDrag<TItem>(options: {
|
|
38
|
+
items: TItem[];
|
|
39
|
+
getItemId: (item: TItem) => string;
|
|
40
|
+
draggedId: string;
|
|
41
|
+
overId: string | undefined;
|
|
42
|
+
position: ListDropPosition;
|
|
43
|
+
}): ListRowReorderMeta<TItem> | null;
|
|
44
|
+
export declare function transferListRow<TItem>(options: {
|
|
45
|
+
fromItems: TItem[];
|
|
46
|
+
toItems: TItem[];
|
|
47
|
+
itemId: string;
|
|
48
|
+
getItemId: (item: TItem) => string;
|
|
49
|
+
toIndex: number;
|
|
50
|
+
}): {
|
|
51
|
+
fromItems: TItem[];
|
|
52
|
+
toItems: TItem[];
|
|
53
|
+
};
|
|
54
|
+
export type ListKeyboardDirection = 'up' | 'down';
|
|
55
|
+
/** Alt+Arrow reorder using displayed row order (respects quick filter) against full `items`. */
|
|
56
|
+
export declare function applyKeyboardListRowReorder<TItem>(options: {
|
|
57
|
+
items: TItem[];
|
|
58
|
+
displayedRowIds: string[];
|
|
59
|
+
draggedId: string;
|
|
60
|
+
direction: ListKeyboardDirection;
|
|
61
|
+
getItemId: (item: TItem) => string;
|
|
62
|
+
isRowDragDisabled?: (row: TItem | undefined) => boolean;
|
|
63
|
+
canDropRow?: (params: ListRowDropCheck<TItem>) => boolean;
|
|
64
|
+
}): ListRowReorderMeta<TItem> | null;
|
|
65
|
+
export declare function listRowTransferDropIndex(options: {
|
|
66
|
+
overIndex: number;
|
|
67
|
+
overNode: unknown;
|
|
68
|
+
targetDisplayedCount: number;
|
|
69
|
+
position: ListDropPosition;
|
|
70
|
+
}): number;
|
|
71
|
+
export declare function buildListRowTransferMeta<TItem>(options: {
|
|
72
|
+
row: TItem | undefined;
|
|
73
|
+
rowId: string | undefined;
|
|
74
|
+
fromListId: string;
|
|
75
|
+
toListId: string;
|
|
76
|
+
overIndex: number;
|
|
77
|
+
overNode: unknown;
|
|
78
|
+
targetDisplayedCount: number;
|
|
79
|
+
position: ListDropPosition;
|
|
80
|
+
canDropRow?: (params: ListRowDropCheck<TItem>) => boolean;
|
|
81
|
+
}): ListRowTransferMeta<TItem> | null;
|
|
82
|
+
export declare function isListDropAllowed<TItem>(canDropRow: ((params: ListRowDropCheck<TItem>) => boolean) | undefined, check: ListRowDropCheck<TItem>): boolean;
|
|
83
|
+
/** Keep known ids in place, drop missing ones, append newly arrived ids. */
|
|
84
|
+
export declare function reconcileListOrder<TItem>(orderIds: string[], items: TItem[], getItemId: (item: TItem) => string): string[];
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
function a(e, r, d) {
|
|
2
|
+
if (r === d || r < 0 || d < 0 || r >= e.length || d >= e.length)
|
|
3
|
+
return e;
|
|
4
|
+
const n = e.slice(), [t] = n.splice(r, 1);
|
|
5
|
+
return t === void 0 ? e : (n.splice(d, 0, t), n);
|
|
6
|
+
}
|
|
7
|
+
function f(e) {
|
|
8
|
+
let r = e.position === "below" ? e.overIndex + 1 : e.overIndex;
|
|
9
|
+
return e.fromIndex < r && (r -= 1), r;
|
|
10
|
+
}
|
|
11
|
+
function i(e) {
|
|
12
|
+
const r = e.items.findIndex((I) => e.getItemId(I) === e.draggedId);
|
|
13
|
+
if (r < 0) return null;
|
|
14
|
+
const d = e.overId ? e.items.findIndex((I) => e.getItemId(I) === e.overId) : e.items.length - 1;
|
|
15
|
+
if (d < 0) return null;
|
|
16
|
+
const n = f({
|
|
17
|
+
fromIndex: r,
|
|
18
|
+
overIndex: d,
|
|
19
|
+
position: e.overId ? e.position : "below"
|
|
20
|
+
}), t = a(e.items, r, n);
|
|
21
|
+
return t === e.items ? null : { rowId: e.draggedId, fromIndex: r, toIndex: n, rows: t };
|
|
22
|
+
}
|
|
23
|
+
function c(e) {
|
|
24
|
+
const r = e.items.find((u) => e.getItemId(u) === e.draggedId);
|
|
25
|
+
if (!r || e.isRowDragDisabled?.(r)) return null;
|
|
26
|
+
const d = e.displayedRowIds.indexOf(e.draggedId);
|
|
27
|
+
if (d < 0) return null;
|
|
28
|
+
const n = d + (e.direction === "down" ? 1 : -1);
|
|
29
|
+
if (n < 0 || n >= e.displayedRowIds.length) return null;
|
|
30
|
+
const t = e.displayedRowIds[n], I = e.direction === "down" ? "below" : "above", l = i({
|
|
31
|
+
items: e.items,
|
|
32
|
+
getItemId: e.getItemId,
|
|
33
|
+
draggedId: e.draggedId,
|
|
34
|
+
overId: t,
|
|
35
|
+
position: I
|
|
36
|
+
});
|
|
37
|
+
return !l || e.canDropRow && !e.canDropRow({ row: r, toIndex: l.toIndex }) ? null : l;
|
|
38
|
+
}
|
|
39
|
+
function w(e) {
|
|
40
|
+
return e.overIndex < 0 || !e.overNode ? e.targetDisplayedCount : e.position === "below" ? e.overIndex + 1 : e.overIndex;
|
|
41
|
+
}
|
|
42
|
+
function v(e) {
|
|
43
|
+
if (!e.row || !e.rowId) return null;
|
|
44
|
+
const r = w({
|
|
45
|
+
overIndex: e.overIndex,
|
|
46
|
+
overNode: e.overNode,
|
|
47
|
+
targetDisplayedCount: e.targetDisplayedCount,
|
|
48
|
+
position: e.position
|
|
49
|
+
});
|
|
50
|
+
return g(e.canDropRow, {
|
|
51
|
+
row: e.row,
|
|
52
|
+
toIndex: r,
|
|
53
|
+
fromListId: e.fromListId,
|
|
54
|
+
toListId: e.toListId
|
|
55
|
+
}) ? {
|
|
56
|
+
rowId: e.rowId,
|
|
57
|
+
row: e.row,
|
|
58
|
+
fromListId: e.fromListId,
|
|
59
|
+
toListId: e.toListId,
|
|
60
|
+
toIndex: r
|
|
61
|
+
} : null;
|
|
62
|
+
}
|
|
63
|
+
function g(e, r) {
|
|
64
|
+
return e ? e(r) : !0;
|
|
65
|
+
}
|
|
66
|
+
export {
|
|
67
|
+
c as applyKeyboardListRowReorder,
|
|
68
|
+
i as applyUnmanagedRowDrag,
|
|
69
|
+
v as buildListRowTransferMeta,
|
|
70
|
+
g as isListDropAllowed,
|
|
71
|
+
w as listRowTransferDropIndex,
|
|
72
|
+
a as moveListRow,
|
|
73
|
+
f as resolveDropToIndex
|
|
74
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ColDef, ColGroupDef } from 'ag-grid-community';
|
|
2
|
+
/** Default matches ItemSmart / legacy tables: numeric headers right-aligned with cells. */
|
|
3
|
+
export type NumericColumnHeaderAlignment = 'left' | 'right';
|
|
4
|
+
export declare function columnDefUsesNumericType(type: ColDef['type'] | undefined): boolean;
|
|
5
|
+
export declare function columnDefPresentsNumericData(columnDef: ColDef): boolean;
|
|
6
|
+
export declare function stripNumericHeaderRightAlignmentClass(headerClass: ColDef['headerClass']): ColDef['headerClass'];
|
|
7
|
+
export declare function applyNumericColumnPresentationClasses(columnDef: ColDef, numericColumnHeaderAlignment?: NumericColumnHeaderAlignment): ColDef;
|
|
8
|
+
export declare function normalizeColumnDefsNumericHeaderAlignment<TData>(columnDefs: (ColDef<TData> | ColGroupDef<TData>)[] | undefined, numericColumnHeaderAlignment: NumericColumnHeaderAlignment): (ColDef<TData> | ColGroupDef<TData>)[] | undefined;
|
|
9
|
+
export declare function readNumericColumnTypeConfig(numericColumnHeaderAlignment: NumericColumnHeaderAlignment): Pick<ColDef, 'cellClass' | 'headerClass' | 'filter'>;
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
const a = /* @__PURE__ */ new Set(["number", "numericColumn", "currency", "percentage"]), n = "ag-right-aligned-header", i = "ag-right-aligned-cell";
|
|
2
|
+
function c(r) {
|
|
3
|
+
return r == null ? !1 : Array.isArray(r) ? r.some((e) => a.has(String(e))) : a.has(String(r));
|
|
4
|
+
}
|
|
5
|
+
function h(r) {
|
|
6
|
+
return c(r.type) || r.cellDataType === "number";
|
|
7
|
+
}
|
|
8
|
+
function s(r) {
|
|
9
|
+
if (r == null)
|
|
10
|
+
return r;
|
|
11
|
+
if (typeof r == "string") {
|
|
12
|
+
const e = r.split(/\s+/).filter((t) => t.length > 0 && t !== n).join(" ");
|
|
13
|
+
return e.length > 0 ? e : void 0;
|
|
14
|
+
}
|
|
15
|
+
if (Array.isArray(r)) {
|
|
16
|
+
const e = r.filter((t) => t !== n);
|
|
17
|
+
return e.length > 0 ? e : void 0;
|
|
18
|
+
}
|
|
19
|
+
return r;
|
|
20
|
+
}
|
|
21
|
+
function g(r) {
|
|
22
|
+
return typeof r == "string" && r.length > 0 ? r.includes(i) ? r : `${r} ${i}` : i;
|
|
23
|
+
}
|
|
24
|
+
function o(r) {
|
|
25
|
+
return typeof r == "string" && r.length > 0 ? r.includes(n) ? r : `${r} ${n}` : n;
|
|
26
|
+
}
|
|
27
|
+
function f(r, e = "right") {
|
|
28
|
+
if (!h(r))
|
|
29
|
+
return r;
|
|
30
|
+
const t = {
|
|
31
|
+
...r,
|
|
32
|
+
cellClass: g(r.cellClass)
|
|
33
|
+
};
|
|
34
|
+
return e === "right" ? t.headerClass = o(r.headerClass) : t.headerClass = s(r.headerClass), t;
|
|
35
|
+
}
|
|
36
|
+
function C(r, e) {
|
|
37
|
+
return !r || r.length === 0 || e === "right" ? r : r.map((t) => {
|
|
38
|
+
if ("children" in t && Array.isArray(t.children))
|
|
39
|
+
return {
|
|
40
|
+
...t,
|
|
41
|
+
children: C(
|
|
42
|
+
t.children,
|
|
43
|
+
e
|
|
44
|
+
)
|
|
45
|
+
};
|
|
46
|
+
const l = t, u = {
|
|
47
|
+
...l,
|
|
48
|
+
headerClass: s(l.headerClass)
|
|
49
|
+
};
|
|
50
|
+
return f(u, e);
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
function d(r) {
|
|
54
|
+
const e = {
|
|
55
|
+
cellClass: i,
|
|
56
|
+
filter: "agNumberColumnFilter"
|
|
57
|
+
};
|
|
58
|
+
return r === "right" ? { ...e, headerClass: n } : e;
|
|
59
|
+
}
|
|
60
|
+
export {
|
|
61
|
+
f as applyNumericColumnPresentationClasses,
|
|
62
|
+
h as columnDefPresentsNumericData,
|
|
63
|
+
c as columnDefUsesNumericType,
|
|
64
|
+
C as normalizeColumnDefsNumericHeaderAlignment,
|
|
65
|
+
d as readNumericColumnTypeConfig,
|
|
66
|
+
s as stripNumericHeaderRightAlignmentClass
|
|
67
|
+
};
|
|
@@ -1,4 +1,8 @@
|
|
|
1
1
|
import { ColDef, ColGroupDef, CellStyle, CellClassParams } from 'ag-grid-community';
|
|
2
|
+
import { NumericColumnHeaderAlignment } from './numeric-column-header-alignment';
|
|
3
|
+
export type ProcessBackendColumnDefsOptions = {
|
|
4
|
+
numericColumnHeaderAlignment?: NumericColumnHeaderAlignment;
|
|
5
|
+
};
|
|
2
6
|
/**
|
|
3
7
|
* Color rule from backend
|
|
4
8
|
*/
|
|
@@ -16,15 +20,19 @@ export interface BackendColDef extends Omit<ColDef, 'cellStyle'> {
|
|
|
16
20
|
colorRules?: ColorRule[];
|
|
17
21
|
cellStyle?: CellStyle | ((params: CellClassParams) => CellStyle | undefined);
|
|
18
22
|
children?: BackendColDef[];
|
|
23
|
+
decimals?: number;
|
|
24
|
+
divideBy?: number;
|
|
25
|
+
symbol?: string;
|
|
26
|
+
currency?: string;
|
|
19
27
|
}
|
|
20
28
|
/**
|
|
21
29
|
* Processes a single column definition to handle colorRules, valueFormatters, and alignment.
|
|
22
30
|
*
|
|
23
31
|
* This is exported so it can be used for individual column processing or in other components.
|
|
24
32
|
*/
|
|
25
|
-
export declare const processColDef: (colDef: BackendColDef) => ColDef | ColGroupDef;
|
|
33
|
+
export declare const processColDef: (colDef: BackendColDef, options?: ProcessBackendColumnDefsOptions) => ColDef | ColGroupDef;
|
|
26
34
|
/**
|
|
27
35
|
* Processes a list of column definitions.
|
|
28
36
|
* Filters out invalid columns and applies transformation to each.
|
|
29
37
|
*/
|
|
30
|
-
export declare const processBackendColumnDefs: (columnDefs?: (BackendColDef | ColDef | ColGroupDef)[]) => (ColDef | ColGroupDef)[] | undefined;
|
|
38
|
+
export declare const processBackendColumnDefs: (columnDefs?: (BackendColDef | ColDef | ColGroupDef)[], options?: ProcessBackendColumnDefsOptions) => (ColDef | ColGroupDef)[] | undefined;
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import { AG_GRID_VALUE_FORMATTERS as l } from "./value-formatters.js";
|
|
2
|
+
import { isBackendValueFormatterObject as d } from "./value-formatter.types.js";
|
|
3
|
+
import { applyNumericColumnPresentationClasses as b } from "./numeric-column-header-alignment.js";
|
|
4
|
+
const v = ["percentage", "currency", "currencySymbol", "number"], g = {
|
|
5
|
+
percentage: 2,
|
|
6
|
+
currencySymbol: 2,
|
|
7
|
+
currency: 2,
|
|
8
|
+
number: 0
|
|
9
|
+
}, p = (r, i, n) => {
|
|
10
|
+
if (r == null) return !1;
|
|
11
|
+
switch (i) {
|
|
12
|
+
case ">":
|
|
13
|
+
return Number(r) > Number(n);
|
|
14
|
+
case "<":
|
|
15
|
+
return Number(r) < Number(n);
|
|
16
|
+
case ">=":
|
|
17
|
+
return Number(r) >= Number(n);
|
|
18
|
+
case "<=":
|
|
19
|
+
return Number(r) <= Number(n);
|
|
20
|
+
case "==":
|
|
21
|
+
return r == n;
|
|
22
|
+
case "!=":
|
|
23
|
+
return r != n;
|
|
24
|
+
case "contains":
|
|
25
|
+
return String(r).includes(String(n));
|
|
26
|
+
case "startsWith":
|
|
27
|
+
return String(r).startsWith(String(n));
|
|
28
|
+
case "endsWith":
|
|
29
|
+
return String(r).endsWith(String(n));
|
|
30
|
+
default:
|
|
31
|
+
return !1;
|
|
32
|
+
}
|
|
33
|
+
}, C = (r) => (i) => {
|
|
34
|
+
const n = i.value;
|
|
35
|
+
for (const e of r)
|
|
36
|
+
if (p(n, e.condition, e.value)) {
|
|
37
|
+
const c = {
|
|
38
|
+
color: e.color
|
|
39
|
+
};
|
|
40
|
+
return e.fontWeight && (c.fontWeight = e.fontWeight), e.backgroundColor && (c.backgroundColor = e.backgroundColor), c;
|
|
41
|
+
}
|
|
42
|
+
}, f = (r, i = {}) => {
|
|
43
|
+
const n = i.numericColumnHeaderAlignment ?? "right";
|
|
44
|
+
if ("children" in r && r.children)
|
|
45
|
+
return {
|
|
46
|
+
...r,
|
|
47
|
+
children: r.children.map((t) => f(t, i))
|
|
48
|
+
};
|
|
49
|
+
const e = { ...r };
|
|
50
|
+
if (d(e.valueFormatter)) {
|
|
51
|
+
const t = e.valueFormatter, o = l[t.type];
|
|
52
|
+
o ? (t.decimals !== void 0 && (e.decimals = t.decimals), t.divideBy !== void 0 && (e.divideBy = t.divideBy), t.symbol !== void 0 && (e.symbol = t.symbol), t.currency !== void 0 && (e.currency = t.currency), e.valueFormatter = o) : console.warn(`[processColDef] Unknown valueFormatter type: "${t.type}"`);
|
|
53
|
+
}
|
|
54
|
+
if (r.colorRules && r.colorRules.length > 0) {
|
|
55
|
+
const t = C(r.colorRules), o = e.cellStyle;
|
|
56
|
+
typeof o == "function" ? e.cellStyle = (s) => {
|
|
57
|
+
const u = o(s), a = t(s);
|
|
58
|
+
if (!(!u && !a))
|
|
59
|
+
return { ...u, ...a };
|
|
60
|
+
} : o ? e.cellStyle = (s) => ({
|
|
61
|
+
...o,
|
|
62
|
+
...t(s) || {}
|
|
63
|
+
}) : e.cellStyle = t, delete e.colorRules;
|
|
64
|
+
}
|
|
65
|
+
if (d(r.valueFormatter)) {
|
|
66
|
+
const { type: t, decimals: o } = r.valueFormatter;
|
|
67
|
+
if (t && v.includes(t) && !e.filterValueGetter) {
|
|
68
|
+
const s = o ?? g[t] ?? 0, u = Math.pow(10, s), a = r.field;
|
|
69
|
+
e.filterValueGetter = (y) => {
|
|
70
|
+
const m = y.data?.[a];
|
|
71
|
+
return m == null || isNaN(Number(m)) ? m : Math.round(Number(m) * u) / u;
|
|
72
|
+
};
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
const c = b(
|
|
76
|
+
e,
|
|
77
|
+
n
|
|
78
|
+
);
|
|
79
|
+
return Object.assign(e, c), !e.valueFormatter && (e.type === "numericColumn" || e.type === "number") && (e.valueFormatter = l.number), e;
|
|
80
|
+
}, N = (r, i = {}) => !r || r.length === 0 ? r : r.filter((n) => n != null).map((n) => f(n, i));
|
|
81
|
+
export {
|
|
82
|
+
N as processBackendColumnDefs,
|
|
83
|
+
f as processColDef
|
|
84
|
+
};
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { RefObject } from 'react';
|
|
2
|
+
import { ColDef, ColGroupDef, GridApi, RowDragCancelEvent, RowDragEndEvent, RowDragLeaveEvent, RowDragMoveEvent } from 'ag-grid-community';
|
|
3
|
+
import { AgGridReactProps } from 'ag-grid-react';
|
|
4
|
+
import { ListRowDropCheck, ListRowReorderMeta } from './list-row-move';
|
|
5
|
+
import { AgGridListHeaderMode, AgGridVisualVariant, AgGridWrapperProps } from './ag-grid.types';
|
|
6
|
+
export declare function useAgGridDragList<TData>(options: {
|
|
7
|
+
variant: AgGridVisualVariant;
|
|
8
|
+
listHeader: AgGridListHeaderMode;
|
|
9
|
+
columnDefs: AgGridReactProps<TData>['columnDefs'];
|
|
10
|
+
mergedColumnDefs: Array<ColDef<TData> | ColGroupDef<TData>> | null | undefined;
|
|
11
|
+
listRowGradient: AgGridWrapperProps<TData>['listRowGradient'];
|
|
12
|
+
listDragPreview?: AgGridWrapperProps<TData>['listDragPreview'];
|
|
13
|
+
isRowDragDisabled?: AgGridWrapperProps<TData>['isRowDragDisabled'];
|
|
14
|
+
getRowDragHandleLabel?: AgGridWrapperProps<TData>['getRowDragHandleLabel'];
|
|
15
|
+
canDropRow?: (params: ListRowDropCheck<TData>) => boolean;
|
|
16
|
+
onRowReorder?: (meta: ListRowReorderMeta<TData>) => void;
|
|
17
|
+
onRowMoveBeyondEdge?: (meta: {
|
|
18
|
+
rowId: string;
|
|
19
|
+
direction: 'up' | 'down';
|
|
20
|
+
row: TData;
|
|
21
|
+
}) => void;
|
|
22
|
+
getRowStyle?: AgGridReactProps<TData>['getRowStyle'];
|
|
23
|
+
getRowId?: AgGridReactProps<TData>['getRowId'];
|
|
24
|
+
rowData?: TData[] | null;
|
|
25
|
+
rowDragManaged?: boolean;
|
|
26
|
+
rowDragText?: AgGridReactProps<TData>['rowDragText'];
|
|
27
|
+
onRowDragEnter?: AgGridReactProps<TData>['onRowDragEnter'];
|
|
28
|
+
onRowDragMove?: AgGridReactProps<TData>['onRowDragMove'];
|
|
29
|
+
onRowDragLeave?: AgGridReactProps<TData>['onRowDragLeave'];
|
|
30
|
+
onRowDragCancel?: AgGridReactProps<TData>['onRowDragCancel'];
|
|
31
|
+
onRowDragEnd?: AgGridReactProps<TData>['onRowDragEnd'];
|
|
32
|
+
gridContainerRef: RefObject<HTMLDivElement | null>;
|
|
33
|
+
gridApiRef: RefObject<GridApi<TData> | null>;
|
|
34
|
+
}): {
|
|
35
|
+
isDragList: boolean;
|
|
36
|
+
isListVariant: boolean;
|
|
37
|
+
hideColumnHeader: boolean;
|
|
38
|
+
dragListColumnDefs: (ColDef<TData, any> | ColGroupDef<TData>)[] | null | undefined;
|
|
39
|
+
dragListGridProps: {
|
|
40
|
+
rowDragManaged: boolean;
|
|
41
|
+
rowDragText: import('ag-grid-community').RowDragTextFunc;
|
|
42
|
+
suppressMoveWhenRowDragging: boolean;
|
|
43
|
+
animateRows: boolean;
|
|
44
|
+
getRowStyle: import('ag-grid-community').GetRowStyle<TData, any> | undefined;
|
|
45
|
+
onRowDragEnter: (event: import('ag-grid-community').RowDragEnterEvent<TData, any>) => void;
|
|
46
|
+
onRowDragMove: (event: RowDragMoveEvent<TData>) => void;
|
|
47
|
+
onRowDragLeave: (event: RowDragLeaveEvent<TData>) => void;
|
|
48
|
+
onRowDragCancel: (event: RowDragCancelEvent<TData>) => void;
|
|
49
|
+
onRowDragEnd: (event: RowDragEndEvent<TData>) => void;
|
|
50
|
+
} | {
|
|
51
|
+
getRowStyle: import('ag-grid-community').GetRowStyle<TData, any> | undefined;
|
|
52
|
+
rowDragManaged?: undefined;
|
|
53
|
+
rowDragText?: undefined;
|
|
54
|
+
suppressMoveWhenRowDragging?: undefined;
|
|
55
|
+
animateRows?: undefined;
|
|
56
|
+
onRowDragEnter?: undefined;
|
|
57
|
+
onRowDragMove?: undefined;
|
|
58
|
+
onRowDragLeave?: undefined;
|
|
59
|
+
onRowDragCancel?: undefined;
|
|
60
|
+
onRowDragEnd?: undefined;
|
|
61
|
+
} | null;
|
|
62
|
+
listHeaderGridProps: {
|
|
63
|
+
headerHeight: number;
|
|
64
|
+
} | null;
|
|
65
|
+
dragPreviewPortal: import('react').ReactPortal | null;
|
|
66
|
+
liveRegion: import("react/jsx-runtime").JSX.Element | null;
|
|
67
|
+
};
|