@affino/datagrid-vue 0.3.2 → 0.3.3
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 +170 -195
- package/dist/advanced/clipboard.d.ts +5 -0
- package/dist/advanced/clipboard.d.ts.map +1 -0
- package/dist/advanced/clipboard.js +4 -0
- package/dist/advanced/editing.d.ts +22 -0
- package/dist/advanced/editing.d.ts.map +1 -0
- package/dist/advanced/editing.js +20 -0
- package/dist/advanced/filtering.d.ts +16 -0
- package/dist/advanced/filtering.d.ts.map +1 -0
- package/dist/advanced/filtering.js +15 -0
- package/dist/advanced/history.d.ts +3 -0
- package/dist/advanced/history.d.ts.map +1 -0
- package/dist/advanced/history.js +2 -0
- package/dist/advanced/index.d.ts +8 -0
- package/dist/advanced/index.d.ts.map +1 -0
- package/dist/advanced/index.js +7 -0
- package/dist/advanced/layout.d.ts +16 -0
- package/dist/advanced/layout.d.ts.map +1 -0
- package/dist/advanced/layout.js +14 -0
- package/dist/advanced/pointer.d.ts +12 -0
- package/dist/advanced/pointer.d.ts.map +1 -0
- package/dist/advanced/pointer.js +11 -0
- package/dist/advanced/selection.d.ts +13 -0
- package/dist/advanced/selection.d.ts.map +1 -0
- package/dist/advanced/selection.js +12 -0
- package/dist/advanced.d.ts +2 -136
- package/dist/advanced.d.ts.map +1 -1
- package/dist/advanced.js +2 -206
- package/dist/app/advancedFilterPanel.types.d.ts +18 -0
- package/dist/app/advancedFilterPanel.types.d.ts.map +1 -0
- package/dist/app/columnLayoutPanel.types.d.ts +18 -0
- package/dist/app/columnLayoutPanel.types.d.ts.map +1 -0
- package/dist/app/dataGridRowHeightMetrics.d.ts +19 -0
- package/dist/app/dataGridRowHeightMetrics.d.ts.map +1 -0
- package/dist/app/dataGridRowHeightMetrics.js +119 -0
- package/dist/app/index.d.ts +25 -0
- package/dist/app/index.d.ts.map +1 -0
- package/dist/app/index.js +22 -0
- package/dist/app/useDataGridAppActiveCellViewport.d.ts +19 -0
- package/dist/app/useDataGridAppActiveCellViewport.d.ts.map +1 -0
- package/dist/app/useDataGridAppActiveCellViewport.js +139 -0
- package/dist/app/useDataGridAppAdvancedFilterBuilder.d.ts +24 -0
- package/dist/app/useDataGridAppAdvancedFilterBuilder.d.ts.map +1 -0
- package/dist/app/useDataGridAppAdvancedFilterBuilder.js +139 -0
- package/dist/app/useDataGridAppCellSelection.d.ts +40 -0
- package/dist/app/useDataGridAppCellSelection.d.ts.map +1 -0
- package/dist/app/useDataGridAppCellSelection.js +290 -0
- package/dist/app/useDataGridAppClipboard.d.ts +49 -0
- package/dist/app/useDataGridAppClipboard.d.ts.map +1 -0
- package/dist/app/useDataGridAppClipboard.js +258 -0
- package/dist/app/useDataGridAppColumnLayoutPanel.d.ts +19 -0
- package/dist/app/useDataGridAppColumnLayoutPanel.d.ts.map +1 -0
- package/dist/app/useDataGridAppColumnLayoutPanel.js +75 -0
- package/dist/app/useDataGridAppControls.d.ts +88 -0
- package/dist/app/useDataGridAppControls.d.ts.map +1 -0
- package/dist/app/useDataGridAppControls.js +396 -0
- package/dist/app/useDataGridAppDiagnosticsPanel.d.ts +14 -0
- package/dist/app/useDataGridAppDiagnosticsPanel.d.ts.map +1 -0
- package/dist/app/useDataGridAppDiagnosticsPanel.js +23 -0
- package/dist/app/useDataGridAppFill.d.ts +33 -0
- package/dist/app/useDataGridAppFill.d.ts.map +1 -0
- package/dist/app/useDataGridAppFill.js +97 -0
- package/dist/app/useDataGridAppHeaderResize.d.ts +29 -0
- package/dist/app/useDataGridAppHeaderResize.d.ts.map +1 -0
- package/dist/app/useDataGridAppHeaderResize.js +57 -0
- package/dist/app/useDataGridAppInlineEditing.d.ts +47 -0
- package/dist/app/useDataGridAppInlineEditing.d.ts.map +1 -0
- package/dist/app/useDataGridAppInlineEditing.js +301 -0
- package/dist/app/useDataGridAppIntentHistory.d.ts +23 -0
- package/dist/app/useDataGridAppIntentHistory.d.ts.map +1 -0
- package/dist/app/useDataGridAppIntentHistory.js +37 -0
- package/dist/app/useDataGridAppInteractionController.d.ts +96 -0
- package/dist/app/useDataGridAppInteractionController.d.ts.map +1 -0
- package/dist/app/useDataGridAppInteractionController.js +1448 -0
- package/dist/app/useDataGridAppModeMeta.d.ts +11 -0
- package/dist/app/useDataGridAppModeMeta.d.ts.map +1 -0
- package/dist/app/useDataGridAppModeMeta.js +31 -0
- package/dist/app/useDataGridAppRowPresentation.d.ts +19 -0
- package/dist/app/useDataGridAppRowPresentation.d.ts.map +1 -0
- package/dist/app/useDataGridAppRowPresentation.js +106 -0
- package/dist/app/useDataGridAppRowSelection.d.ts +17 -0
- package/dist/app/useDataGridAppRowSelection.d.ts.map +1 -0
- package/dist/app/useDataGridAppRowSelection.js +85 -0
- package/dist/app/useDataGridAppRowSizing.d.ts +24 -0
- package/dist/app/useDataGridAppRowSizing.d.ts.map +1 -0
- package/dist/app/useDataGridAppRowSizing.js +215 -0
- package/dist/app/useDataGridAppRuntime.d.ts +32 -0
- package/dist/app/useDataGridAppRuntime.d.ts.map +1 -0
- package/dist/app/useDataGridAppRuntime.js +137 -0
- package/dist/app/useDataGridAppRuntimeSync.d.ts +21 -0
- package/dist/app/useDataGridAppRuntimeSync.d.ts.map +1 -0
- package/dist/app/useDataGridAppRuntimeSync.js +30 -0
- package/dist/app/useDataGridAppSelection.d.ts +24 -0
- package/dist/app/useDataGridAppSelection.d.ts.map +1 -0
- package/dist/app/useDataGridAppSelection.js +191 -0
- package/dist/app/useDataGridAppViewport.d.ts +57 -0
- package/dist/app/useDataGridAppViewport.d.ts.map +1 -0
- package/dist/app/useDataGridAppViewport.js +387 -0
- package/dist/app/useDataGridAppViewportLifecycle.d.ts +12 -0
- package/dist/app/useDataGridAppViewportLifecycle.d.ts.map +1 -0
- package/dist/app/useDataGridAppViewportLifecycle.js +33 -0
- package/dist/composables/dataGridFillBehavior.d.ts +2 -0
- package/dist/composables/dataGridFillBehavior.d.ts.map +1 -0
- package/dist/composables/dataGridFillBehavior.js +1 -0
- package/dist/composables/useAffinoGrid.d.ts +20 -0
- package/dist/composables/useAffinoGrid.d.ts.map +1 -0
- package/dist/composables/useAffinoGrid.js +17 -0
- package/dist/composables/useDataGridContext.d.ts +9 -0
- package/dist/composables/useDataGridContext.d.ts.map +1 -0
- package/dist/composables/useDataGridContext.js +12 -0
- package/dist/composables/useDataGridEngine.d.ts +18 -0
- package/dist/composables/useDataGridEngine.d.ts.map +1 -0
- package/dist/composables/useDataGridEngine.js +12 -0
- package/dist/composables/useDataGridEngineContext.d.ts +8 -0
- package/dist/composables/useDataGridEngineContext.d.ts.map +1 -0
- package/dist/composables/useDataGridEngineContext.js +15 -0
- package/dist/composables/useDataGridEventBridge.d.ts +27 -0
- package/dist/composables/useDataGridEventBridge.d.ts.map +1 -0
- package/dist/composables/useDataGridEventBridge.js +24 -0
- package/dist/composables/useDataGridManagedWheelScroll.d.ts +1 -1
- package/dist/composables/useDataGridManagedWheelScroll.d.ts.map +1 -1
- package/dist/composables/useDataGridManagedWheelScroll.js +1 -1
- package/dist/composables/useDataGridOverlayScrollState.d.ts +2 -2
- package/dist/composables/useDataGridRuntime.d.ts +74 -3
- package/dist/composables/useDataGridRuntime.d.ts.map +1 -1
- package/dist/composables/useDataGridRuntime.js +337 -21
- package/dist/composables/useDataGridTheme.d.ts +7 -0
- package/dist/composables/useDataGridTheme.d.ts.map +1 -0
- package/dist/composables/useDataGridTheme.js +10 -0
- package/dist/composables/useDataGridViewContext.d.ts +11 -0
- package/dist/composables/useDataGridViewContext.d.ts.map +1 -0
- package/dist/composables/useDataGridViewContext.js +12 -0
- package/dist/composables/useDataGridViewModel.d.ts +48 -0
- package/dist/composables/useDataGridViewModel.d.ts.map +1 -0
- package/dist/composables/useDataGridViewModel.js +40 -0
- package/dist/grid/createGrid.d.ts +3 -0
- package/dist/grid/createGrid.d.ts.map +1 -0
- package/dist/grid/createGrid.js +92 -0
- package/dist/grid/eventBus.d.ts +9 -0
- package/dist/grid/eventBus.d.ts.map +1 -0
- package/dist/grid/eventBus.js +39 -0
- package/dist/grid/types.d.ts +45 -0
- package/dist/grid/types.d.ts.map +1 -0
- package/dist/public.d.ts +14 -7
- package/dist/public.d.ts.map +1 -1
- package/dist/public.js +10 -5
- package/dist/worker.d.ts +3 -0
- package/dist/worker.d.ts.map +1 -0
- package/dist/worker.js +1 -0
- package/package.json +46 -15
- package/dist/adapters/adapterLifecycle.d.ts +0 -12
- package/dist/adapters/adapterLifecycle.d.ts.map +0 -1
- package/dist/adapters/clipboardAdapter.d.ts +0 -3
- package/dist/adapters/clipboardAdapter.d.ts.map +0 -1
- package/dist/adapters/clipboardAdapter.js +0 -38
- package/dist/adapters/columnPinNormalization.d.ts +0 -14
- package/dist/adapters/columnPinNormalization.d.ts.map +0 -1
- package/dist/adapters/columnPinNormalization.js +0 -55
- package/dist/adapters/hoverEnvironment.d.ts +0 -3
- package/dist/adapters/hoverEnvironment.d.ts.map +0 -1
- package/dist/adapters/hoverEnvironment.js +0 -24
- package/dist/adapters/selectionControllerAdapter.d.ts +0 -30
- package/dist/adapters/selectionControllerAdapter.d.ts.map +0 -1
- package/dist/adapters/selectionControllerAdapter.js +0 -77
- package/dist/adapters/selectionEnvironment.d.ts +0 -41
- package/dist/adapters/selectionEnvironment.d.ts.map +0 -1
- package/dist/adapters/selectionEnvironment.js +0 -188
- package/dist/adapters/selectionHeadlessAdapter.d.ts +0 -48
- package/dist/adapters/selectionHeadlessAdapter.d.ts.map +0 -1
- package/dist/adapters/selectionHeadlessAdapter.js +0 -160
- package/dist/adapters/sharedState.d.ts +0 -4
- package/dist/adapters/sharedState.d.ts.map +0 -1
- package/dist/adapters/sharedState.js +0 -27
- package/dist/adapters/viewportHostEnvironment.d.ts +0 -3
- package/dist/adapters/viewportHostEnvironment.d.ts.map +0 -1
- package/dist/adapters/viewportHostEnvironment.js +0 -46
- package/dist/cells/cellUtils.d.ts +0 -95
- package/dist/cells/cellUtils.d.ts.map +0 -1
- package/dist/cells/cellUtils.js +0 -20
- package/dist/cells/index.d.ts +0 -5
- package/dist/cells/index.d.ts.map +0 -1
- package/dist/cells/index.js +0 -4
- package/dist/cells/useCellEditing.d.ts +0 -42
- package/dist/cells/useCellEditing.d.ts.map +0 -1
- package/dist/cells/useCellEditing.js +0 -194
- package/dist/cells/useCellSelection.d.ts +0 -7
- package/dist/cells/useCellSelection.d.ts.map +0 -1
- package/dist/cells/useCellSelection.js +0 -48
- package/dist/cells/useCellStyle.d.ts +0 -22
- package/dist/cells/useCellStyle.d.ts.map +0 -1
- package/dist/cells/useCellStyle.js +0 -128
- package/dist/components/AffinoDataGridSimple.d.ts +0 -107
- package/dist/components/AffinoDataGridSimple.d.ts.map +0 -1
- package/dist/components/AffinoDataGridSimple.js +0 -349
- package/dist/components/DataGrid.d.ts +0 -57
- package/dist/components/DataGrid.d.ts.map +0 -1
- package/dist/components/DataGrid.js +0 -68
- package/dist/components/index.d.ts +0 -3
- package/dist/components/index.d.ts.map +0 -1
- package/dist/components/index.js +0 -2
- package/dist/components/overlayRenderer.d.ts +0 -36
- package/dist/components/overlayRenderer.d.ts.map +0 -1
- package/dist/components/overlayRenderer.js +0 -169
- package/dist/components/ui/VirtualList.types.d.ts +0 -5
- package/dist/components/ui/VirtualList.types.d.ts.map +0 -1
- package/dist/composables/internal/useAffinoDataGrid/index.d.ts +0 -16
- package/dist/composables/internal/useAffinoDataGrid/index.d.ts.map +0 -1
- package/dist/composables/internal/useAffinoDataGrid/index.js +0 -15
- package/dist/composables/internal/useAffinoDataGrid/useAffinoDataGridActionRunner.d.ts +0 -34
- package/dist/composables/internal/useAffinoDataGrid/useAffinoDataGridActionRunner.d.ts.map +0 -1
- package/dist/composables/internal/useAffinoDataGrid/useAffinoDataGridActionRunner.js +0 -181
- package/dist/composables/internal/useAffinoDataGrid/useAffinoDataGridBaseBindings.d.ts +0 -99
- package/dist/composables/internal/useAffinoDataGrid/useAffinoDataGridBaseBindings.d.ts.map +0 -1
- package/dist/composables/internal/useAffinoDataGrid/useAffinoDataGridBaseBindings.js +0 -316
- package/dist/composables/internal/useAffinoDataGrid/useAffinoDataGridBindingSuite.d.ts +0 -40
- package/dist/composables/internal/useAffinoDataGrid/useAffinoDataGridBindingSuite.d.ts.map +0 -1
- package/dist/composables/internal/useAffinoDataGrid/useAffinoDataGridBindingSuite.js +0 -68
- package/dist/composables/internal/useAffinoDataGrid/useAffinoDataGridClipboardFeature.d.ts +0 -37
- package/dist/composables/internal/useAffinoDataGrid/useAffinoDataGridClipboardFeature.d.ts.map +0 -1
- package/dist/composables/internal/useAffinoDataGrid/useAffinoDataGridClipboardFeature.js +0 -148
- package/dist/composables/internal/useAffinoDataGrid/useAffinoDataGridContextMenuFeature.d.ts +0 -92
- package/dist/composables/internal/useAffinoDataGrid/useAffinoDataGridContextMenuFeature.d.ts.map +0 -1
- package/dist/composables/internal/useAffinoDataGrid/useAffinoDataGridContextMenuFeature.js +0 -91
- package/dist/composables/internal/useAffinoDataGrid/useAffinoDataGridEditingFeature.d.ts +0 -81
- package/dist/composables/internal/useAffinoDataGrid/useAffinoDataGridEditingFeature.d.ts.map +0 -1
- package/dist/composables/internal/useAffinoDataGrid/useAffinoDataGridEditingFeature.js +0 -144
- package/dist/composables/internal/useAffinoDataGrid/useAffinoDataGridEventHub.d.ts +0 -16
- package/dist/composables/internal/useAffinoDataGrid/useAffinoDataGridEventHub.d.ts.map +0 -1
- package/dist/composables/internal/useAffinoDataGrid/useAffinoDataGridEventHub.js +0 -105
- package/dist/composables/internal/useAffinoDataGrid/useAffinoDataGridFeatureNormalization.d.ts +0 -74
- package/dist/composables/internal/useAffinoDataGrid/useAffinoDataGridFeatureNormalization.d.ts.map +0 -1
- package/dist/composables/internal/useAffinoDataGrid/useAffinoDataGridFeatureNormalization.js +0 -123
- package/dist/composables/internal/useAffinoDataGrid/useAffinoDataGridFeatureSuite.d.ts +0 -32
- package/dist/composables/internal/useAffinoDataGrid/useAffinoDataGridFeatureSuite.d.ts.map +0 -1
- package/dist/composables/internal/useAffinoDataGrid/useAffinoDataGridFeatureSuite.js +0 -196
- package/dist/composables/internal/useAffinoDataGrid/useAffinoDataGridFilteringFeature.d.ts +0 -25
- package/dist/composables/internal/useAffinoDataGrid/useAffinoDataGridFilteringFeature.d.ts.map +0 -1
- package/dist/composables/internal/useAffinoDataGrid/useAffinoDataGridFilteringFeature.js +0 -51
- package/dist/composables/internal/useAffinoDataGrid/useAffinoDataGridHeaderFilters.d.ts +0 -65
- package/dist/composables/internal/useAffinoDataGrid/useAffinoDataGridHeaderFilters.d.ts.map +0 -1
- package/dist/composables/internal/useAffinoDataGrid/useAffinoDataGridHeaderFilters.js +0 -251
- package/dist/composables/internal/useAffinoDataGrid/useAffinoDataGridIdentity.d.ts +0 -5
- package/dist/composables/internal/useAffinoDataGrid/useAffinoDataGridIdentity.d.ts.map +0 -1
- package/dist/composables/internal/useAffinoDataGrid/useAffinoDataGridIdentity.js +0 -30
- package/dist/composables/internal/useAffinoDataGrid/useAffinoDataGridKeyboardDispatcher.d.ts +0 -22
- package/dist/composables/internal/useAffinoDataGrid/useAffinoDataGridKeyboardDispatcher.d.ts.map +0 -1
- package/dist/composables/internal/useAffinoDataGrid/useAffinoDataGridKeyboardDispatcher.js +0 -74
- package/dist/composables/internal/useAffinoDataGrid/useAffinoDataGridLayoutProfiles.d.ts +0 -31
- package/dist/composables/internal/useAffinoDataGrid/useAffinoDataGridLayoutProfiles.d.ts.map +0 -1
- package/dist/composables/internal/useAffinoDataGrid/useAffinoDataGridLayoutProfiles.js +0 -64
- package/dist/composables/internal/useAffinoDataGrid/useAffinoDataGridPointerLifecycle.d.ts +0 -9
- package/dist/composables/internal/useAffinoDataGrid/useAffinoDataGridPointerLifecycle.d.ts.map +0 -1
- package/dist/composables/internal/useAffinoDataGrid/useAffinoDataGridPointerLifecycle.js +0 -15
- package/dist/composables/internal/useAffinoDataGrid/useAffinoDataGridRangeClipboard.d.ts +0 -61
- package/dist/composables/internal/useAffinoDataGrid/useAffinoDataGridRangeClipboard.d.ts.map +0 -1
- package/dist/composables/internal/useAffinoDataGrid/useAffinoDataGridRangeClipboard.js +0 -470
- package/dist/composables/internal/useAffinoDataGrid/useAffinoDataGridResultAssembly.d.ts +0 -23
- package/dist/composables/internal/useAffinoDataGrid/useAffinoDataGridResultAssembly.d.ts.map +0 -1
- package/dist/composables/internal/useAffinoDataGrid/useAffinoDataGridResultAssembly.js +0 -131
- package/dist/composables/internal/useAffinoDataGrid/useAffinoDataGridRowHeightFeature.d.ts +0 -30
- package/dist/composables/internal/useAffinoDataGrid/useAffinoDataGridRowHeightFeature.d.ts.map +0 -1
- package/dist/composables/internal/useAffinoDataGrid/useAffinoDataGridRowHeightFeature.js +0 -82
- package/dist/composables/internal/useAffinoDataGrid/useAffinoDataGridRuntimeBootstrap.d.ts +0 -20
- package/dist/composables/internal/useAffinoDataGrid/useAffinoDataGridRuntimeBootstrap.d.ts.map +0 -1
- package/dist/composables/internal/useAffinoDataGrid/useAffinoDataGridRuntimeBootstrap.js +0 -66
- package/dist/composables/internal/useAffinoDataGrid/useAffinoDataGridSelectionEngine.d.ts +0 -56
- package/dist/composables/internal/useAffinoDataGrid/useAffinoDataGridSelectionEngine.d.ts.map +0 -1
- package/dist/composables/internal/useAffinoDataGrid/useAffinoDataGridSelectionEngine.js +0 -365
- package/dist/composables/internal/useAffinoDataGrid/useAffinoDataGridSelectionFeature.d.ts +0 -38
- package/dist/composables/internal/useAffinoDataGrid/useAffinoDataGridSelectionFeature.d.ts.map +0 -1
- package/dist/composables/internal/useAffinoDataGrid/useAffinoDataGridSelectionFeature.js +0 -170
- package/dist/composables/internal/useAffinoDataGrid/useAffinoDataGridSortActionSuite.d.ts +0 -30
- package/dist/composables/internal/useAffinoDataGrid/useAffinoDataGridSortActionSuite.d.ts.map +0 -1
- package/dist/composables/internal/useAffinoDataGrid/useAffinoDataGridSortActionSuite.js +0 -36
- package/dist/composables/internal/useAffinoDataGrid/useAffinoDataGridSortingFeature.d.ts +0 -15
- package/dist/composables/internal/useAffinoDataGrid/useAffinoDataGridSortingFeature.d.ts.map +0 -1
- package/dist/composables/internal/useAffinoDataGrid/useAffinoDataGridSortingFeature.js +0 -42
- package/dist/composables/internal/useAffinoDataGrid/useAffinoDataGridStatusBar.d.ts +0 -32
- package/dist/composables/internal/useAffinoDataGrid/useAffinoDataGridStatusBar.d.ts.map +0 -1
- package/dist/composables/internal/useAffinoDataGrid/useAffinoDataGridStatusBar.js +0 -73
- package/dist/composables/internal/useAffinoDataGrid/useAffinoDataGridSummaryFeature.d.ts +0 -27
- package/dist/composables/internal/useAffinoDataGrid/useAffinoDataGridSummaryFeature.d.ts.map +0 -1
- package/dist/composables/internal/useAffinoDataGrid/useAffinoDataGridSummaryFeature.js +0 -39
- package/dist/composables/internal/useAffinoDataGrid/useAffinoDataGridTreeFeature.d.ts +0 -35
- package/dist/composables/internal/useAffinoDataGrid/useAffinoDataGridTreeFeature.d.ts.map +0 -1
- package/dist/composables/internal/useAffinoDataGrid/useAffinoDataGridTreeFeature.js +0 -220
- package/dist/composables/internal/useAffinoDataGrid/useAffinoDataGridVisibilityFeature.d.ts +0 -28
- package/dist/composables/internal/useAffinoDataGrid/useAffinoDataGridVisibilityFeature.d.ts.map +0 -1
- package/dist/composables/internal/useAffinoDataGrid/useAffinoDataGridVisibilityFeature.js +0 -59
- package/dist/composables/selection/selectionControllerStateScheduler.d.ts +0 -13
- package/dist/composables/selection/selectionControllerStateScheduler.d.ts.map +0 -1
- package/dist/composables/selection/selectionControllerStateScheduler.js +0 -48
- package/dist/composables/selection/selectionGeometry.d.ts +0 -47
- package/dist/composables/selection/selectionGeometry.d.ts.map +0 -1
- package/dist/composables/selection/selectionGeometry.js +0 -84
- package/dist/composables/selection/selectionInput.d.ts +0 -6
- package/dist/composables/selection/selectionInput.d.ts.map +0 -1
- package/dist/composables/selection/selectionInput.js +0 -6
- package/dist/composables/selection/selectionOverlayUpdateScheduler.d.ts +0 -21
- package/dist/composables/selection/selectionOverlayUpdateScheduler.d.ts.map +0 -1
- package/dist/composables/selection/selectionOverlayUpdateScheduler.js +0 -65
- package/dist/composables/selection/selectionStateSync.d.ts +0 -55
- package/dist/composables/selection/selectionStateSync.d.ts.map +0 -1
- package/dist/composables/selection/selectionStateSync.js +0 -30
- package/dist/composables/useAffinoDataGrid.d.ts +0 -4
- package/dist/composables/useAffinoDataGrid.d.ts.map +0 -1
- package/dist/composables/useAffinoDataGrid.js +0 -1556
- package/dist/composables/useAffinoDataGrid.types.d.ts +0 -706
- package/dist/composables/useAffinoDataGrid.types.d.ts.map +0 -1
- package/dist/composables/useAffinoDataGridClipboardFeature.d.ts +0 -37
- package/dist/composables/useAffinoDataGridClipboardFeature.d.ts.map +0 -1
- package/dist/composables/useAffinoDataGridClipboardFeature.js +0 -135
- package/dist/composables/useAffinoDataGridEditingFeature.d.ts +0 -50
- package/dist/composables/useAffinoDataGridEditingFeature.d.ts.map +0 -1
- package/dist/composables/useAffinoDataGridEditingFeature.js +0 -94
- package/dist/composables/useAffinoDataGridFilteringFeature.d.ts +0 -25
- package/dist/composables/useAffinoDataGridFilteringFeature.d.ts.map +0 -1
- package/dist/composables/useAffinoDataGridFilteringFeature.js +0 -51
- package/dist/composables/useAffinoDataGridMinimal.d.ts +0 -3
- package/dist/composables/useAffinoDataGridMinimal.d.ts.map +0 -1
- package/dist/composables/useAffinoDataGridMinimal.js +0 -6
- package/dist/composables/useAffinoDataGridSelectionFeature.d.ts +0 -38
- package/dist/composables/useAffinoDataGridSelectionFeature.d.ts.map +0 -1
- package/dist/composables/useAffinoDataGridSelectionFeature.js +0 -160
- package/dist/composables/useAffinoDataGridSummaryFeature.d.ts +0 -27
- package/dist/composables/useAffinoDataGridSummaryFeature.d.ts.map +0 -1
- package/dist/composables/useAffinoDataGridSummaryFeature.js +0 -39
- package/dist/composables/useAffinoDataGridTreeFeature.d.ts +0 -31
- package/dist/composables/useAffinoDataGridTreeFeature.d.ts.map +0 -1
- package/dist/composables/useAffinoDataGridTreeFeature.js +0 -183
- package/dist/composables/useAffinoDataGridUi.d.ts +0 -36
- package/dist/composables/useAffinoDataGridUi.d.ts.map +0 -1
- package/dist/composables/useAffinoDataGridUi.js +0 -81
- package/dist/composables/useAffinoDataGridVisibilityFeature.d.ts +0 -28
- package/dist/composables/useAffinoDataGridVisibilityFeature.d.ts.map +0 -1
- package/dist/composables/useAffinoDataGridVisibilityFeature.js +0 -59
- package/dist/composables/useAutoResizeColumn.d.ts +0 -14
- package/dist/composables/useAutoResizeColumn.d.ts.map +0 -1
- package/dist/composables/useAutoResizeColumn.js +0 -64
- package/dist/composables/useAxisVirtualizer.d.ts +0 -25
- package/dist/composables/useAxisVirtualizer.d.ts.map +0 -1
- package/dist/composables/useAxisVirtualizer.js +0 -41
- package/dist/composables/useColumnGroups.d.ts +0 -15
- package/dist/composables/useColumnGroups.d.ts.map +0 -1
- package/dist/composables/useColumnGroups.js +0 -35
- package/dist/composables/useColumnHeaderInteractions.d.ts +0 -38
- package/dist/composables/useColumnHeaderInteractions.d.ts.map +0 -1
- package/dist/composables/useColumnHeaderInteractions.js +0 -471
- package/dist/composables/useColumnVisibility.d.ts +0 -31
- package/dist/composables/useColumnVisibility.d.ts.map +0 -1
- package/dist/composables/useColumnVisibility.js +0 -124
- package/dist/composables/useDomSampling.d.ts +0 -17
- package/dist/composables/useDomSampling.d.ts.map +0 -1
- package/dist/composables/useDomSampling.js +0 -66
- package/dist/composables/useHorizontalViewport.d.ts +0 -35
- package/dist/composables/useHorizontalViewport.d.ts.map +0 -1
- package/dist/composables/useHorizontalViewport.js +0 -167
- package/dist/composables/useSelectableRows.d.ts +0 -24
- package/dist/composables/useSelectableRows.d.ts.map +0 -1
- package/dist/composables/useSelectableRows.js +0 -108
- package/dist/composables/useSelectionOverlayAdapter.d.ts +0 -34
- package/dist/composables/useSelectionOverlayAdapter.d.ts.map +0 -1
- package/dist/composables/useSelectionOverlayAdapter.js +0 -159
- package/dist/composables/useServerRowModel.d.ts +0 -30
- package/dist/composables/useServerRowModel.d.ts.map +0 -1
- package/dist/composables/useServerRowModel.js +0 -44
- package/dist/composables/useTableAdvancedFilterModal.d.ts +0 -30
- package/dist/composables/useTableAdvancedFilterModal.d.ts.map +0 -1
- package/dist/composables/useTableAdvancedFilterModal.js +0 -78
- package/dist/composables/useTableAutoColumnScheduler.d.ts +0 -26
- package/dist/composables/useTableAutoColumnScheduler.d.ts.map +0 -1
- package/dist/composables/useTableAutoColumnScheduler.js +0 -59
- package/dist/composables/useTableAutoScroll.d.ts +0 -18
- package/dist/composables/useTableAutoScroll.d.ts.map +0 -1
- package/dist/composables/useTableAutoScroll.js +0 -167
- package/dist/composables/useTableClipboardBridge.d.ts +0 -45
- package/dist/composables/useTableClipboardBridge.d.ts.map +0 -1
- package/dist/composables/useTableClipboardBridge.js +0 -185
- package/dist/composables/useTableColumnBindings.d.ts +0 -25
- package/dist/composables/useTableColumnBindings.d.ts.map +0 -1
- package/dist/composables/useTableColumnBindings.js +0 -72
- package/dist/composables/useTableColumnPinning.d.ts +0 -17
- package/dist/composables/useTableColumnPinning.d.ts.map +0 -1
- package/dist/composables/useTableColumnPinning.js +0 -49
- package/dist/composables/useTableDataModel.d.ts +0 -46
- package/dist/composables/useTableDataModel.d.ts.map +0 -1
- package/dist/composables/useTableDataModel.js +0 -411
- package/dist/composables/useTableEditing.d.ts +0 -67
- package/dist/composables/useTableEditing.d.ts.map +0 -1
- package/dist/composables/useTableEditing.js +0 -321
- package/dist/composables/useTableFilters.d.ts +0 -55
- package/dist/composables/useTableFilters.d.ts.map +0 -1
- package/dist/composables/useTableFilters.js +0 -723
- package/dist/composables/useTableFindReplaceBridge.d.ts +0 -27
- package/dist/composables/useTableFindReplaceBridge.d.ts.map +0 -1
- package/dist/composables/useTableFindReplaceBridge.js +0 -84
- package/dist/composables/useTableFocusManagement.d.ts +0 -35
- package/dist/composables/useTableFocusManagement.d.ts.map +0 -1
- package/dist/composables/useTableFocusManagement.js +0 -106
- package/dist/composables/useTableGridLayout.d.ts +0 -17
- package/dist/composables/useTableGridLayout.d.ts.map +0 -1
- package/dist/composables/useTableGridLayout.js +0 -47
- package/dist/composables/useTableGrouping.d.ts +0 -54
- package/dist/composables/useTableGrouping.d.ts.map +0 -1
- package/dist/composables/useTableGrouping.js +0 -255
- package/dist/composables/useTableHeaderLayout.d.ts +0 -33
- package/dist/composables/useTableHeaderLayout.d.ts.map +0 -1
- package/dist/composables/useTableHeaderLayout.js +0 -84
- package/dist/composables/useTableHistory.d.ts +0 -16
- package/dist/composables/useTableHistory.d.ts.map +0 -1
- package/dist/composables/useTableHistory.js +0 -37
- package/dist/composables/useTableHoverOverlay.d.ts +0 -36
- package/dist/composables/useTableHoverOverlay.d.ts.map +0 -1
- package/dist/composables/useTableHoverOverlay.js +0 -323
- package/dist/composables/useTableImperativeRendering.d.ts +0 -44
- package/dist/composables/useTableImperativeRendering.d.ts.map +0 -1
- package/dist/composables/useTableImperativeRendering.js +0 -82
- package/dist/composables/useTableLocalColumns.d.ts +0 -23
- package/dist/composables/useTableLocalColumns.d.ts.map +0 -1
- package/dist/composables/useTableLocalColumns.js +0 -40
- package/dist/composables/useTableOverlayController.d.ts +0 -14
- package/dist/composables/useTableOverlayController.d.ts.map +0 -1
- package/dist/composables/useTableOverlayController.js +0 -97
- package/dist/composables/useTableOverlayScrollState.d.ts +0 -17
- package/dist/composables/useTableOverlayScrollState.d.ts.map +0 -1
- package/dist/composables/useTableOverlayScrollState.js +0 -26
- package/dist/composables/useTablePanels.d.ts +0 -17
- package/dist/composables/useTablePanels.d.ts.map +0 -1
- package/dist/composables/useTablePanels.js +0 -60
- package/dist/composables/useTableRecalcWatcher.d.ts +0 -24
- package/dist/composables/useTableRecalcWatcher.d.ts.map +0 -1
- package/dist/composables/useTableRecalcWatcher.js +0 -30
- package/dist/composables/useTableRuntime.d.ts +0 -18
- package/dist/composables/useTableRuntime.d.ts.map +0 -1
- package/dist/composables/useTableRuntime.js +0 -43
- package/dist/composables/useTableSearchHighlights.d.ts +0 -18
- package/dist/composables/useTableSearchHighlights.d.ts.map +0 -1
- package/dist/composables/useTableSearchHighlights.js +0 -45
- package/dist/composables/useTableSelection.d.ts +0 -204
- package/dist/composables/useTableSelection.d.ts.map +0 -1
- package/dist/composables/useTableSelection.js +0 -3080
- package/dist/composables/useTableServerSync.d.ts +0 -35
- package/dist/composables/useTableServerSync.d.ts.map +0 -1
- package/dist/composables/useTableServerSync.js +0 -130
- package/dist/composables/useTableSorting.d.ts +0 -29
- package/dist/composables/useTableSorting.d.ts.map +0 -1
- package/dist/composables/useTableSorting.js +0 -84
- package/dist/composables/useTableStatusMetrics.d.ts +0 -22
- package/dist/composables/useTableStatusMetrics.d.ts.map +0 -1
- package/dist/composables/useTableStatusMetrics.js +0 -25
- package/dist/composables/useTableStickyColumns.d.ts +0 -39
- package/dist/composables/useTableStickyColumns.d.ts.map +0 -1
- package/dist/composables/useTableStickyColumns.js +0 -244
- package/dist/composables/useTableTheme.d.ts +0 -30
- package/dist/composables/useTableTheme.d.ts.map +0 -1
- package/dist/composables/useTableTheme.js +0 -207
- package/dist/composables/useTableViewport.d.ts +0 -103
- package/dist/composables/useTableViewport.d.ts.map +0 -1
- package/dist/composables/useTableViewport.js +0 -298
- package/dist/composables/useTableViewportMetrics.d.ts +0 -12
- package/dist/composables/useTableViewportMetrics.d.ts.map +0 -1
- package/dist/composables/useTableViewportMetrics.js +0 -179
- package/dist/composables/useTableZoom.d.ts +0 -16
- package/dist/composables/useTableZoom.d.ts.map +0 -1
- package/dist/composables/useTableZoom.js +0 -68
- package/dist/composables/useVerticalViewport.d.ts +0 -34
- package/dist/composables/useVerticalViewport.d.ts.map +0 -1
- package/dist/composables/useVerticalViewport.js +0 -210
- package/dist/composables/useVirtualDebug.d.ts +0 -169
- package/dist/composables/useVirtualDebug.d.ts.map +0 -1
- package/dist/composables/useVirtualDebug.js +0 -206
- package/dist/composables/useVirtualList.d.ts +0 -25
- package/dist/composables/useVirtualList.d.ts.map +0 -1
- package/dist/composables/useVirtualList.js +0 -54
- package/dist/context.d.ts +0 -463
- package/dist/context.d.ts.map +0 -1
- package/dist/context.js +0 -5
- package/dist/core/api/useUiTableApi.d.ts +0 -51
- package/dist/core/api/useUiTableApi.d.ts.map +0 -1
- package/dist/core/api/useUiTableApi.js +0 -103
- package/dist/core/columns/columnGroup.d.ts +0 -2
- package/dist/core/columns/columnGroup.d.ts.map +0 -1
- package/dist/core/columns/columnGroup.js +0 -1
- package/dist/core/columns/measurement.d.ts +0 -3
- package/dist/core/columns/measurement.d.ts.map +0 -1
- package/dist/core/columns/measurement.js +0 -132
- package/dist/core/virtualization/types.d.ts +0 -8
- package/dist/core/virtualization/types.d.ts.map +0 -1
- package/dist/core/virtualization/types.js +0 -4
- package/dist/core/virtualization/viewportConfig.d.ts +0 -6
- package/dist/core/virtualization/viewportConfig.d.ts.map +0 -1
- package/dist/core/virtualization/viewportConfig.js +0 -20
- package/dist/imperative/createDomControllerSuite.d.ts +0 -3
- package/dist/imperative/createDomControllerSuite.d.ts.map +0 -1
- package/dist/imperative/createDomControllerSuite.js +0 -24
- package/dist/imperative/selectionDomAdapter.d.ts +0 -54
- package/dist/imperative/selectionDomAdapter.d.ts.map +0 -1
- package/dist/imperative/selectionDomAdapter.js +0 -466
- package/dist/imperative/useImperativeTableAdapter.d.ts +0 -12
- package/dist/imperative/useImperativeTableAdapter.d.ts.map +0 -1
- package/dist/imperative/useImperativeTableAdapter.js +0 -80
- package/dist/piniaTableSettingsAdapter.d.ts +0 -5
- package/dist/piniaTableSettingsAdapter.d.ts.map +0 -1
- package/dist/piniaTableSettingsAdapter.js +0 -45
- package/dist/src/index.d.ts +0 -2
- package/dist/src/index.d.ts.map +0 -1
- package/dist/src/index.js +0 -1
- package/dist/src/piniaTableSettingsAdapter.d.ts +0 -4
- package/dist/src/piniaTableSettingsAdapter.d.ts.map +0 -1
- package/dist/src/piniaTableSettingsAdapter.js +0 -37
- package/dist/src/public.d.ts +0 -7
- package/dist/src/public.d.ts.map +0 -1
- package/dist/src/public.js +0 -6
- package/dist/src/tableSettingsStore.d.ts +0 -13
- package/dist/src/tableSettingsStore.d.ts.map +0 -1
- package/dist/src/tableSettingsStore.js +0 -134
- package/dist/stores/useFindReplaceStore.d.ts +0 -52
- package/dist/stores/useFindReplaceStore.d.ts.map +0 -1
- package/dist/stores/useFindReplaceStore.js +0 -237
- package/dist/tableSettingsStore.d.ts +0 -27
- package/dist/tableSettingsStore.d.ts.map +0 -1
- package/dist/tableSettingsStore.js +0 -154
- package/dist/tsconfig.public.tsbuildinfo +0 -1
- package/dist/types/overlay.d.ts +0 -26
- package/dist/types/overlay.d.ts.map +0 -1
- package/dist/types/overlay.js +0 -1
- package/dist/types/piniaPersist.d.ts +0 -11
- package/dist/types/piniaPersist.d.ts.map +0 -1
- package/dist/types/piniaPersist.js +0 -2
- package/dist/utils/columnStorage.d.ts +0 -9
- package/dist/utils/columnStorage.d.ts.map +0 -1
- package/dist/utils/columnStorage.js +0 -136
- package/dist/utils/createWheelAccumulator.d.ts +0 -22
- package/dist/utils/createWheelAccumulator.d.ts.map +0 -1
- package/dist/utils/createWheelAccumulator.js +0 -70
- package/dist/utils/sortStateAdapter.d.ts +0 -5
- package/dist/utils/sortStateAdapter.d.ts.map +0 -1
- package/dist/utils/sortStateAdapter.js +0 -24
- /package/dist/{adapters/adapterLifecycle.js → app/advancedFilterPanel.types.js} +0 -0
- /package/dist/{components/ui/VirtualList.types.js → app/columnLayoutPanel.types.js} +0 -0
- /package/dist/{composables/useAffinoDataGrid.types.js → grid/types.js} +0 -0
|
@@ -1,1556 +0,0 @@
|
|
|
1
|
-
import { computed, onBeforeUnmount, ref, watch } from "vue";
|
|
2
|
-
import { DataGrid } from "../components/DataGrid";
|
|
3
|
-
import { assembleAffinoDataGridResult, fallbackResolveRowKey, normalizeAffinoDataGridFeatures, useAffinoDataGridBindingSuite, useAffinoDataGridEventHub, useAffinoDataGridFeatureSuite, useAffinoDataGridHeaderFilters, useAffinoDataGridLayoutProfiles, useAffinoDataGridKeyboardDispatcher, useAffinoDataGridRangeClipboard, useAffinoDataGridSelectionEngine, useAffinoDataGridRuntimeBootstrap, useAffinoDataGridSortActionSuite, useAffinoDataGridStatusBar, useAffinoDataGridPointerLifecycle, } from "./internal/useAffinoDataGrid";
|
|
4
|
-
function clonePaginationSnapshot(snapshot) {
|
|
5
|
-
return { ...snapshot };
|
|
6
|
-
}
|
|
7
|
-
function cloneColumnModelSnapshot(snapshot) {
|
|
8
|
-
const columns = snapshot.columns.map(column => ({
|
|
9
|
-
...column,
|
|
10
|
-
column: { ...column.column },
|
|
11
|
-
}));
|
|
12
|
-
const visibleColumnKeys = new Set(snapshot.visibleColumns.map(column => column.key));
|
|
13
|
-
return {
|
|
14
|
-
columns,
|
|
15
|
-
order: [...snapshot.order],
|
|
16
|
-
visibleColumns: columns.filter(column => visibleColumnKeys.has(column.key)),
|
|
17
|
-
};
|
|
18
|
-
}
|
|
19
|
-
function cloneTransactionSnapshot(snapshot) {
|
|
20
|
-
if (!snapshot) {
|
|
21
|
-
return null;
|
|
22
|
-
}
|
|
23
|
-
return {
|
|
24
|
-
revision: snapshot.revision,
|
|
25
|
-
pendingBatch: snapshot.pendingBatch
|
|
26
|
-
? {
|
|
27
|
-
id: snapshot.pendingBatch.id,
|
|
28
|
-
label: snapshot.pendingBatch.label,
|
|
29
|
-
size: snapshot.pendingBatch.size,
|
|
30
|
-
}
|
|
31
|
-
: null,
|
|
32
|
-
undoDepth: snapshot.undoDepth,
|
|
33
|
-
redoDepth: snapshot.redoDepth,
|
|
34
|
-
lastCommittedId: snapshot.lastCommittedId,
|
|
35
|
-
};
|
|
36
|
-
}
|
|
37
|
-
function isFilteringModelActive(snapshot) {
|
|
38
|
-
if (!snapshot || typeof snapshot !== "object") {
|
|
39
|
-
return false;
|
|
40
|
-
}
|
|
41
|
-
const filterSnapshot = snapshot;
|
|
42
|
-
const columnFilters = filterSnapshot.columnFilters ?? {};
|
|
43
|
-
for (const entry of Object.values(columnFilters)) {
|
|
44
|
-
if (Array.isArray(entry) && entry.length > 0) {
|
|
45
|
-
return true;
|
|
46
|
-
}
|
|
47
|
-
if (!entry || typeof entry !== "object") {
|
|
48
|
-
continue;
|
|
49
|
-
}
|
|
50
|
-
const valueSetEntry = entry;
|
|
51
|
-
if (valueSetEntry.kind === "valueSet" && Array.isArray(valueSetEntry.tokens) && valueSetEntry.tokens.length > 0) {
|
|
52
|
-
return true;
|
|
53
|
-
}
|
|
54
|
-
if (valueSetEntry.kind === "predicate") {
|
|
55
|
-
return true;
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
const advancedFilters = filterSnapshot.advancedFilters ?? {};
|
|
59
|
-
if (Object.keys(advancedFilters).length > 0) {
|
|
60
|
-
return true;
|
|
61
|
-
}
|
|
62
|
-
return filterSnapshot.advancedExpression != null;
|
|
63
|
-
}
|
|
64
|
-
function reorderArrayByIndex(source, fromIndexRaw, toIndexRaw, countRaw = 1) {
|
|
65
|
-
const length = source.length;
|
|
66
|
-
if (length <= 1) {
|
|
67
|
-
return null;
|
|
68
|
-
}
|
|
69
|
-
if (!Number.isFinite(fromIndexRaw) || !Number.isFinite(toIndexRaw) || !Number.isFinite(countRaw)) {
|
|
70
|
-
return null;
|
|
71
|
-
}
|
|
72
|
-
const fromIndex = Math.max(0, Math.min(length - 1, Math.trunc(fromIndexRaw)));
|
|
73
|
-
const count = Math.max(1, Math.trunc(countRaw));
|
|
74
|
-
const normalizedCount = Math.max(1, Math.min(count, length - fromIndex));
|
|
75
|
-
const toIndex = Math.max(0, Math.min(length, Math.trunc(toIndexRaw)));
|
|
76
|
-
const nextRows = source.slice();
|
|
77
|
-
const moved = nextRows.splice(fromIndex, normalizedCount);
|
|
78
|
-
if (moved.length === 0) {
|
|
79
|
-
return null;
|
|
80
|
-
}
|
|
81
|
-
const adjustedTarget = toIndex > fromIndex ? Math.max(0, toIndex - moved.length) : toIndex;
|
|
82
|
-
nextRows.splice(adjustedTarget, 0, ...moved);
|
|
83
|
-
return nextRows;
|
|
84
|
-
}
|
|
85
|
-
function normalizeFilterColumnKey(value) {
|
|
86
|
-
return typeof value === "string" ? value.trim() : "";
|
|
87
|
-
}
|
|
88
|
-
function normalizeFilterChildren(children) {
|
|
89
|
-
return children.filter((entry) => Boolean(entry));
|
|
90
|
-
}
|
|
91
|
-
function createAdvancedCondition(condition) {
|
|
92
|
-
const key = normalizeFilterColumnKey(condition.key);
|
|
93
|
-
return {
|
|
94
|
-
...condition,
|
|
95
|
-
key,
|
|
96
|
-
kind: "condition",
|
|
97
|
-
};
|
|
98
|
-
}
|
|
99
|
-
function createAdvancedGroup(operator, children) {
|
|
100
|
-
const normalizedChildren = normalizeFilterChildren(children);
|
|
101
|
-
if (normalizedChildren.length === 0) {
|
|
102
|
-
return null;
|
|
103
|
-
}
|
|
104
|
-
if (normalizedChildren.length === 1) {
|
|
105
|
-
return normalizedChildren[0] ?? null;
|
|
106
|
-
}
|
|
107
|
-
return {
|
|
108
|
-
kind: "group",
|
|
109
|
-
operator,
|
|
110
|
-
children: normalizedChildren,
|
|
111
|
-
};
|
|
112
|
-
}
|
|
113
|
-
function createAdvancedNot(child) {
|
|
114
|
-
if (!child) {
|
|
115
|
-
return null;
|
|
116
|
-
}
|
|
117
|
-
return {
|
|
118
|
-
kind: "not",
|
|
119
|
-
child,
|
|
120
|
-
};
|
|
121
|
-
}
|
|
122
|
-
function mergeAdvancedExpression(current, next, mergeMode) {
|
|
123
|
-
if (mergeMode === "replace") {
|
|
124
|
-
return next ?? null;
|
|
125
|
-
}
|
|
126
|
-
if (!next) {
|
|
127
|
-
return current ?? null;
|
|
128
|
-
}
|
|
129
|
-
if (!current) {
|
|
130
|
-
return next;
|
|
131
|
-
}
|
|
132
|
-
const operator = mergeMode === "merge-or" ? "or" : "and";
|
|
133
|
-
return createAdvancedGroup(operator, [current, next]);
|
|
134
|
-
}
|
|
135
|
-
function removeAdvancedConditionByKey(expression, columnKeyRaw) {
|
|
136
|
-
if (!expression) {
|
|
137
|
-
return null;
|
|
138
|
-
}
|
|
139
|
-
const columnKey = normalizeFilterColumnKey(columnKeyRaw);
|
|
140
|
-
if (!columnKey) {
|
|
141
|
-
return expression;
|
|
142
|
-
}
|
|
143
|
-
const visit = (node) => {
|
|
144
|
-
if (node.kind === "condition") {
|
|
145
|
-
return normalizeFilterColumnKey(node.key) === columnKey ? null : node;
|
|
146
|
-
}
|
|
147
|
-
if (node.kind === "not") {
|
|
148
|
-
const nextChild = visit(node.child);
|
|
149
|
-
if (!nextChild) {
|
|
150
|
-
return null;
|
|
151
|
-
}
|
|
152
|
-
return { ...node, child: nextChild };
|
|
153
|
-
}
|
|
154
|
-
const nextChildren = node.children
|
|
155
|
-
.map(child => visit(child))
|
|
156
|
-
.filter((child) => Boolean(child));
|
|
157
|
-
if (nextChildren.length === 0) {
|
|
158
|
-
return null;
|
|
159
|
-
}
|
|
160
|
-
if (nextChildren.length === 1) {
|
|
161
|
-
return nextChildren[0] ?? null;
|
|
162
|
-
}
|
|
163
|
-
return { ...node, children: nextChildren };
|
|
164
|
-
};
|
|
165
|
-
return visit(expression);
|
|
166
|
-
}
|
|
167
|
-
function findSetConditionValuesByKey(expression, columnKeyRaw) {
|
|
168
|
-
if (!expression) {
|
|
169
|
-
return [];
|
|
170
|
-
}
|
|
171
|
-
const columnKey = normalizeFilterColumnKey(columnKeyRaw);
|
|
172
|
-
if (!columnKey) {
|
|
173
|
-
return [];
|
|
174
|
-
}
|
|
175
|
-
const visit = (node) => {
|
|
176
|
-
if (node.kind === "condition") {
|
|
177
|
-
if (normalizeFilterColumnKey(node.key) !== columnKey) {
|
|
178
|
-
return null;
|
|
179
|
-
}
|
|
180
|
-
if (node.type !== "set") {
|
|
181
|
-
return null;
|
|
182
|
-
}
|
|
183
|
-
if (!Array.isArray(node.value)) {
|
|
184
|
-
return [];
|
|
185
|
-
}
|
|
186
|
-
return node.value;
|
|
187
|
-
}
|
|
188
|
-
if (node.kind === "not") {
|
|
189
|
-
return visit(node.child);
|
|
190
|
-
}
|
|
191
|
-
for (const child of node.children) {
|
|
192
|
-
const found = visit(child);
|
|
193
|
-
if (found) {
|
|
194
|
-
return found;
|
|
195
|
-
}
|
|
196
|
-
}
|
|
197
|
-
return null;
|
|
198
|
-
};
|
|
199
|
-
return visit(expression) ?? [];
|
|
200
|
-
}
|
|
201
|
-
function nextSetFilterValues(current, incoming, mode) {
|
|
202
|
-
const stableKey = (value) => {
|
|
203
|
-
if (typeof value === "string") {
|
|
204
|
-
return value;
|
|
205
|
-
}
|
|
206
|
-
const serialized = JSON.stringify(value);
|
|
207
|
-
return typeof serialized === "string" ? serialized : String(value);
|
|
208
|
-
};
|
|
209
|
-
const incomingMap = new Map();
|
|
210
|
-
for (const value of incoming) {
|
|
211
|
-
incomingMap.set(stableKey(value), value);
|
|
212
|
-
}
|
|
213
|
-
if (mode === "replace") {
|
|
214
|
-
return Array.from(incomingMap.values());
|
|
215
|
-
}
|
|
216
|
-
const currentMap = new Map();
|
|
217
|
-
for (const value of current) {
|
|
218
|
-
currentMap.set(stableKey(value), value);
|
|
219
|
-
}
|
|
220
|
-
if (mode === "append") {
|
|
221
|
-
for (const [key, value] of incomingMap) {
|
|
222
|
-
currentMap.set(key, value);
|
|
223
|
-
}
|
|
224
|
-
return Array.from(currentMap.values());
|
|
225
|
-
}
|
|
226
|
-
for (const key of incomingMap.keys()) {
|
|
227
|
-
currentMap.delete(key);
|
|
228
|
-
}
|
|
229
|
-
return Array.from(currentMap.values());
|
|
230
|
-
}
|
|
231
|
-
function stableSerialize(value) {
|
|
232
|
-
if (typeof value === "string") {
|
|
233
|
-
return value;
|
|
234
|
-
}
|
|
235
|
-
try {
|
|
236
|
-
return JSON.stringify(value) ?? String(value);
|
|
237
|
-
}
|
|
238
|
-
catch {
|
|
239
|
-
return String(value);
|
|
240
|
-
}
|
|
241
|
-
}
|
|
242
|
-
function stableClone(value) {
|
|
243
|
-
try {
|
|
244
|
-
if (typeof structuredClone === "function") {
|
|
245
|
-
return structuredClone(value);
|
|
246
|
-
}
|
|
247
|
-
}
|
|
248
|
-
catch {
|
|
249
|
-
// Fallback below.
|
|
250
|
-
}
|
|
251
|
-
try {
|
|
252
|
-
const serialized = JSON.stringify(value);
|
|
253
|
-
if (typeof serialized !== "string") {
|
|
254
|
-
return value;
|
|
255
|
-
}
|
|
256
|
-
return JSON.parse(serialized);
|
|
257
|
-
}
|
|
258
|
-
catch {
|
|
259
|
-
return value;
|
|
260
|
-
}
|
|
261
|
-
}
|
|
262
|
-
export function useAffinoDataGrid(options) {
|
|
263
|
-
const runtimeBootstrap = useAffinoDataGridRuntimeBootstrap({
|
|
264
|
-
rows: options.rows,
|
|
265
|
-
columns: options.columns,
|
|
266
|
-
rowModel: options.rowModel,
|
|
267
|
-
services: options.services,
|
|
268
|
-
startupOrder: options.startupOrder,
|
|
269
|
-
autoStart: options.autoStart,
|
|
270
|
-
});
|
|
271
|
-
const { rows, columns, runtime, internalSelectionSnapshot } = runtimeBootstrap;
|
|
272
|
-
const normalizedFeatures = normalizeAffinoDataGridFeatures(options.features);
|
|
273
|
-
const featureSuite = useAffinoDataGridFeatureSuite({
|
|
274
|
-
rows,
|
|
275
|
-
columns,
|
|
276
|
-
runtime,
|
|
277
|
-
normalizedFeatures,
|
|
278
|
-
fallbackResolveRowKey,
|
|
279
|
-
internalSelectionSnapshot,
|
|
280
|
-
});
|
|
281
|
-
const { selectedRowKeySet, selectedRowKeys, resolveRowKey, isSelectedByKey, toggleSelectedByKey, clearSelection, selectOnlyRow, selectAllRows, resolveSelectedRows, filteringEnabled, clipboardEnabled, copySelectedRows, clearSelectedRows, cutSelectedRows, pasteRowsAppend, editingEnabled, editingEnum, enumEditorEnabled, enumEditorPrimitive, resolveEnumEditorOptions, activeSession, beginEdit, updateDraft, cancelEdit, commitEdit, isCellEditing, resolveCellDraft, } = featureSuite;
|
|
282
|
-
let runCopyAction = () => copySelectedRows();
|
|
283
|
-
let runCutAction = () => cutSelectedRows();
|
|
284
|
-
let runPasteAction = () => pasteRowsAppend();
|
|
285
|
-
let runClearAction = () => clearSelectedRows();
|
|
286
|
-
const eventHub = useAffinoDataGridEventHub({
|
|
287
|
-
maxEvents: normalizedFeatures.feedback.maxEvents * 4,
|
|
288
|
-
});
|
|
289
|
-
const eventHubEnabled = computed(() => eventHub.enabled.value ?? true);
|
|
290
|
-
const eventHubLast = computed(() => eventHub.last.value ?? null);
|
|
291
|
-
const eventHubLog = computed(() => eventHub.log.value ?? []);
|
|
292
|
-
const emitGridEvent = (input) => eventHub.emit(input);
|
|
293
|
-
const feedbackEnabled = ref(normalizedFeatures.feedback.enabled);
|
|
294
|
-
const feedbackLastAction = ref("Ready");
|
|
295
|
-
const feedbackEvents = ref([]);
|
|
296
|
-
let nextFeedbackEventId = 1;
|
|
297
|
-
const pushFeedback = (event) => {
|
|
298
|
-
if (!feedbackEnabled.value) {
|
|
299
|
-
return;
|
|
300
|
-
}
|
|
301
|
-
const nextEvent = {
|
|
302
|
-
...event,
|
|
303
|
-
id: nextFeedbackEventId++,
|
|
304
|
-
timestamp: Date.now(),
|
|
305
|
-
};
|
|
306
|
-
feedbackLastAction.value = nextEvent.message;
|
|
307
|
-
const nextEvents = [...feedbackEvents.value, nextEvent];
|
|
308
|
-
const limit = normalizedFeatures.feedback.maxEvents;
|
|
309
|
-
feedbackEvents.value = nextEvents.length > limit
|
|
310
|
-
? nextEvents.slice(nextEvents.length - limit)
|
|
311
|
-
: nextEvents;
|
|
312
|
-
emitGridEvent({
|
|
313
|
-
tier: "internal",
|
|
314
|
-
name: "sugar:feedback",
|
|
315
|
-
args: [nextEvent],
|
|
316
|
-
source: "system",
|
|
317
|
-
phase: "change",
|
|
318
|
-
});
|
|
319
|
-
};
|
|
320
|
-
const { sortState, setSortState, toggleColumnSort, clearSort, resolveColumnSortDirection, runAction, } = useAffinoDataGridSortActionSuite({
|
|
321
|
-
initialSortState: options.initialSortState,
|
|
322
|
-
onSortModelChange(nextSortState) {
|
|
323
|
-
runtime.api.setSortModel(nextSortState);
|
|
324
|
-
},
|
|
325
|
-
selectedRowKeySet,
|
|
326
|
-
clearSelection,
|
|
327
|
-
selectAllRows,
|
|
328
|
-
resolveSelectedRows,
|
|
329
|
-
resolveRows: () => rows.value,
|
|
330
|
-
resolveColumns: () => columns.value,
|
|
331
|
-
setColumnWidth: (columnKey, width) => {
|
|
332
|
-
runtime.api.setColumnWidth(columnKey, width);
|
|
333
|
-
},
|
|
334
|
-
isFilteringEnabled: () => filteringEnabled.value,
|
|
335
|
-
copySelectedRows: () => runCopyAction(),
|
|
336
|
-
cutSelectedRows: () => runCutAction(),
|
|
337
|
-
pasteRowsAppend: () => runPasteAction(),
|
|
338
|
-
clearSelectedRows: () => runClearAction(),
|
|
339
|
-
});
|
|
340
|
-
const runActionWithFeedback = async (actionId, actionOptions) => {
|
|
341
|
-
emitGridEvent({
|
|
342
|
-
tier: "advanced",
|
|
343
|
-
name: "sugar:action",
|
|
344
|
-
args: [{ actionId, options: actionOptions ?? null }],
|
|
345
|
-
source: "api",
|
|
346
|
-
phase: "start",
|
|
347
|
-
});
|
|
348
|
-
const result = await runAction(actionId, actionOptions);
|
|
349
|
-
pushFeedback({
|
|
350
|
-
source: "action",
|
|
351
|
-
action: actionId,
|
|
352
|
-
message: result.message,
|
|
353
|
-
affected: result.affected,
|
|
354
|
-
ok: result.ok,
|
|
355
|
-
meta: actionOptions ? { columnKey: actionOptions.columnKey ?? null } : undefined,
|
|
356
|
-
});
|
|
357
|
-
emitGridEvent({
|
|
358
|
-
tier: "advanced",
|
|
359
|
-
name: "sugar:action",
|
|
360
|
-
args: [{ actionId, result }],
|
|
361
|
-
source: "api",
|
|
362
|
-
phase: "end",
|
|
363
|
-
});
|
|
364
|
-
return result;
|
|
365
|
-
};
|
|
366
|
-
watch(sortState, nextSortState => {
|
|
367
|
-
emitGridEvent({
|
|
368
|
-
tier: "stable",
|
|
369
|
-
name: "sortChange",
|
|
370
|
-
args: [nextSortState[0] ?? null, nextSortState],
|
|
371
|
-
source: "ui",
|
|
372
|
-
phase: "change",
|
|
373
|
-
});
|
|
374
|
-
}, { immediate: true, flush: "sync" });
|
|
375
|
-
watch(() => featureSuite.filterModel.value, nextFilterModel => {
|
|
376
|
-
const nextColumnFilters = nextFilterModel?.columnFilters ?? {};
|
|
377
|
-
const hasColumnFilters = Object.values(nextColumnFilters).some(entry => {
|
|
378
|
-
if (Array.isArray(entry)) {
|
|
379
|
-
return entry.length > 0;
|
|
380
|
-
}
|
|
381
|
-
if (!entry || typeof entry !== "object") {
|
|
382
|
-
return false;
|
|
383
|
-
}
|
|
384
|
-
const valueSetEntry = entry;
|
|
385
|
-
if (valueSetEntry.kind === "valueSet") {
|
|
386
|
-
return Array.isArray(valueSetEntry.tokens) && valueSetEntry.tokens.length > 0;
|
|
387
|
-
}
|
|
388
|
-
return valueSetEntry.kind === "predicate";
|
|
389
|
-
});
|
|
390
|
-
const hasAdvancedFilters = Boolean(nextFilterModel?.advancedExpression)
|
|
391
|
-
|| Boolean(nextFilterModel?.advancedFilters && Object.keys(nextFilterModel.advancedFilters).length > 0);
|
|
392
|
-
if (!hasColumnFilters && !hasAdvancedFilters) {
|
|
393
|
-
emitGridEvent({
|
|
394
|
-
tier: "stable",
|
|
395
|
-
name: "filtersReset",
|
|
396
|
-
args: [],
|
|
397
|
-
source: "ui",
|
|
398
|
-
phase: "change",
|
|
399
|
-
});
|
|
400
|
-
return;
|
|
401
|
-
}
|
|
402
|
-
emitGridEvent({
|
|
403
|
-
tier: "stable",
|
|
404
|
-
name: "filterChange",
|
|
405
|
-
args: [nextColumnFilters, nextFilterModel],
|
|
406
|
-
source: "ui",
|
|
407
|
-
phase: "change",
|
|
408
|
-
});
|
|
409
|
-
}, { immediate: true, flush: "sync" });
|
|
410
|
-
watch(() => featureSuite.groupBy.value, nextGroupBy => {
|
|
411
|
-
emitGridEvent({
|
|
412
|
-
tier: "stable",
|
|
413
|
-
name: "groupByChange",
|
|
414
|
-
args: [nextGroupBy, featureSuite.groupExpansion.value],
|
|
415
|
-
source: "ui",
|
|
416
|
-
phase: "change",
|
|
417
|
-
});
|
|
418
|
-
}, { immediate: true, flush: "sync" });
|
|
419
|
-
watch(() => featureSuite.groupExpansion.value, nextGroupExpansion => {
|
|
420
|
-
emitGridEvent({
|
|
421
|
-
tier: "stable",
|
|
422
|
-
name: "groupExpansionChange",
|
|
423
|
-
args: [nextGroupExpansion, featureSuite.groupBy.value],
|
|
424
|
-
source: "ui",
|
|
425
|
-
phase: "change",
|
|
426
|
-
});
|
|
427
|
-
}, { immediate: true, flush: "sync" });
|
|
428
|
-
watch(selectedRowKeys, nextSelectedRowKeys => {
|
|
429
|
-
emitGridEvent({
|
|
430
|
-
tier: "advanced",
|
|
431
|
-
name: "sugar:selection",
|
|
432
|
-
args: [{ selectedRowKeys: nextSelectedRowKeys, selectedCount: nextSelectedRowKeys.length }],
|
|
433
|
-
source: "ui",
|
|
434
|
-
phase: "change",
|
|
435
|
-
});
|
|
436
|
-
}, { flush: "sync" });
|
|
437
|
-
const componentProps = computed(() => ({
|
|
438
|
-
rows: rows.value,
|
|
439
|
-
columns: columns.value,
|
|
440
|
-
services: options.services,
|
|
441
|
-
startupOrder: options.startupOrder,
|
|
442
|
-
autoStart: options.autoStart ?? true,
|
|
443
|
-
}));
|
|
444
|
-
const rowReorderSupported = computed(() => runtime.rowModel.kind === "client");
|
|
445
|
-
const rowReorderReason = computed(() => {
|
|
446
|
-
if (!rowReorderSupported.value) {
|
|
447
|
-
return "Row reorder is available only for client row model.";
|
|
448
|
-
}
|
|
449
|
-
if (featureSuite.treeEnabled.value && featureSuite.groupBy.value) {
|
|
450
|
-
return "Disable group-by before row reorder.";
|
|
451
|
-
}
|
|
452
|
-
if (featureSuite.filteringEnabled.value && isFilteringModelActive(featureSuite.filterModel.value)) {
|
|
453
|
-
return "Clear active filters before row reorder.";
|
|
454
|
-
}
|
|
455
|
-
return null;
|
|
456
|
-
});
|
|
457
|
-
const canReorderRows = computed(() => rowReorderReason.value == null);
|
|
458
|
-
const moveRowsByIndex = async (fromIndex, toIndex, count = 1) => {
|
|
459
|
-
if (!canReorderRows.value) {
|
|
460
|
-
return false;
|
|
461
|
-
}
|
|
462
|
-
const nextRows = reorderArrayByIndex(rows.value, fromIndex, toIndex, count);
|
|
463
|
-
if (!nextRows || nextRows === rows.value) {
|
|
464
|
-
return false;
|
|
465
|
-
}
|
|
466
|
-
const normalizedFromIndex = Math.max(0, Math.min(rows.value.length - 1, Math.trunc(fromIndex)));
|
|
467
|
-
const normalizedToIndex = Math.max(0, Math.min(rows.value.length, Math.trunc(toIndex)));
|
|
468
|
-
const columnCount = Math.max(1, columns.value.length);
|
|
469
|
-
return featureSuite.replaceRows(nextRows, {
|
|
470
|
-
intent: "rows-reorder",
|
|
471
|
-
label: "Reorder rows",
|
|
472
|
-
clearSelection: false,
|
|
473
|
-
affectedRange: {
|
|
474
|
-
startRow: Math.min(normalizedFromIndex, normalizedToIndex),
|
|
475
|
-
endRow: Math.max(normalizedFromIndex, normalizedToIndex),
|
|
476
|
-
startColumn: 0,
|
|
477
|
-
endColumn: columnCount - 1,
|
|
478
|
-
},
|
|
479
|
-
});
|
|
480
|
-
};
|
|
481
|
-
const moveRowsByKey = async (sourceRowKey, targetRowKey, position = "before") => {
|
|
482
|
-
if (!canReorderRows.value) {
|
|
483
|
-
return false;
|
|
484
|
-
}
|
|
485
|
-
const order = rows.value.map((row, index) => resolveRowKey(row, index));
|
|
486
|
-
const sourceIndex = order.indexOf(sourceRowKey);
|
|
487
|
-
const targetIndex = order.indexOf(targetRowKey);
|
|
488
|
-
if (sourceIndex < 0 || targetIndex < 0 || sourceIndex === targetIndex) {
|
|
489
|
-
return false;
|
|
490
|
-
}
|
|
491
|
-
const insertionIndex = position === "after" ? targetIndex + 1 : targetIndex;
|
|
492
|
-
return moveRowsByIndex(sourceIndex, insertionIndex, 1);
|
|
493
|
-
};
|
|
494
|
-
const selectionEngine = useAffinoDataGridSelectionEngine({
|
|
495
|
-
runtime,
|
|
496
|
-
rows,
|
|
497
|
-
resolveRowKey,
|
|
498
|
-
groupSelectsChildren: featureSuite.groupSelectsChildren,
|
|
499
|
-
internalSelectionSnapshot,
|
|
500
|
-
selectionSnapshot: featureSuite.selectionSnapshot,
|
|
501
|
-
emitSelectionChange: snapshot => {
|
|
502
|
-
emitGridEvent({
|
|
503
|
-
tier: "stable",
|
|
504
|
-
name: "selectionChange",
|
|
505
|
-
args: [snapshot],
|
|
506
|
-
source: "ui",
|
|
507
|
-
phase: "change",
|
|
508
|
-
});
|
|
509
|
-
},
|
|
510
|
-
emitRangeChange: range => {
|
|
511
|
-
emitGridEvent({
|
|
512
|
-
tier: "advanced",
|
|
513
|
-
name: "sugar:cell-selection",
|
|
514
|
-
args: [range],
|
|
515
|
-
source: "ui",
|
|
516
|
-
phase: "change",
|
|
517
|
-
});
|
|
518
|
-
},
|
|
519
|
-
resolveStepRows: () => 20,
|
|
520
|
-
});
|
|
521
|
-
const { activeCellSelection, anchorCellSelection, focusCellSelection, cellSelectionRange, cellSelectionRanges, isPointerSelectingCells, isCellSelected, setCellSelection, setCellByKey, clearCellSelection, stopPointerCellSelection, resolveVisibleColumnIndex, resolveCellCoordByIndex, resolveCellCoordByKey, cellNavigation, applySelectionFromRange, } = selectionEngine;
|
|
522
|
-
let dispatchCellKeyboardCommands = (_event) => false;
|
|
523
|
-
const createCellSelectionBindings = (params) => {
|
|
524
|
-
const rowKey = resolveRowKey(params.row, params.rowIndex);
|
|
525
|
-
const resolveBoundCoord = () => (resolveCellCoordByKey(rowKey, params.columnKey)
|
|
526
|
-
?? resolveCellCoordByIndex(params.rowIndex, resolveVisibleColumnIndex(params.columnKey)));
|
|
527
|
-
const ensureCurrentCoord = () => {
|
|
528
|
-
const coord = resolveBoundCoord();
|
|
529
|
-
if (!coord) {
|
|
530
|
-
return null;
|
|
531
|
-
}
|
|
532
|
-
if (!activeCellSelection.value) {
|
|
533
|
-
setCellSelection(coord, false);
|
|
534
|
-
}
|
|
535
|
-
return coord;
|
|
536
|
-
};
|
|
537
|
-
return {
|
|
538
|
-
"data-row-key": rowKey,
|
|
539
|
-
"data-column-key": params.columnKey,
|
|
540
|
-
onMousedown: (event) => {
|
|
541
|
-
if (event.button !== 0) {
|
|
542
|
-
return;
|
|
543
|
-
}
|
|
544
|
-
const coord = resolveBoundCoord();
|
|
545
|
-
if (!coord) {
|
|
546
|
-
return;
|
|
547
|
-
}
|
|
548
|
-
event.preventDefault();
|
|
549
|
-
const currentTarget = event.currentTarget;
|
|
550
|
-
if (currentTarget instanceof HTMLElement) {
|
|
551
|
-
currentTarget.focus({ preventScroll: true });
|
|
552
|
-
}
|
|
553
|
-
setCellSelection(coord, event.shiftKey);
|
|
554
|
-
isPointerSelectingCells.value = true;
|
|
555
|
-
},
|
|
556
|
-
onMouseenter: (_event) => {
|
|
557
|
-
if (!isPointerSelectingCells.value) {
|
|
558
|
-
return;
|
|
559
|
-
}
|
|
560
|
-
const coord = resolveBoundCoord();
|
|
561
|
-
if (!coord) {
|
|
562
|
-
return;
|
|
563
|
-
}
|
|
564
|
-
setCellSelection(coord, true);
|
|
565
|
-
},
|
|
566
|
-
onMouseup: (_event) => {
|
|
567
|
-
stopPointerCellSelection();
|
|
568
|
-
},
|
|
569
|
-
onKeydown: (event) => {
|
|
570
|
-
ensureCurrentCoord();
|
|
571
|
-
if (dispatchCellKeyboardCommands(event)) {
|
|
572
|
-
return;
|
|
573
|
-
}
|
|
574
|
-
if (cellNavigation.dispatchNavigation(event)) {
|
|
575
|
-
return;
|
|
576
|
-
}
|
|
577
|
-
if (event.key === " " || event.key === "Spacebar") {
|
|
578
|
-
const coord = resolveBoundCoord();
|
|
579
|
-
if (!coord) {
|
|
580
|
-
return;
|
|
581
|
-
}
|
|
582
|
-
event.preventDefault();
|
|
583
|
-
setCellSelection(coord, event.shiftKey);
|
|
584
|
-
}
|
|
585
|
-
},
|
|
586
|
-
};
|
|
587
|
-
};
|
|
588
|
-
const createRangeHandleBindings = (params) => ({
|
|
589
|
-
"data-row-index": params.rowIndex,
|
|
590
|
-
"data-column-key": params.columnKey,
|
|
591
|
-
"data-range-mode": (params.mode ?? "fill"),
|
|
592
|
-
onMousedown: (event) => {
|
|
593
|
-
event.preventDefault();
|
|
594
|
-
event.stopPropagation();
|
|
595
|
-
rangeClipboard.startRangePointerInteraction(params.mode ?? "fill", {
|
|
596
|
-
rowIndex: params.rowIndex,
|
|
597
|
-
columnKey: params.columnKey,
|
|
598
|
-
});
|
|
599
|
-
},
|
|
600
|
-
});
|
|
601
|
-
const createRangeSurfaceBindings = (params) => ({
|
|
602
|
-
"data-row-index": params.rowIndex,
|
|
603
|
-
"data-column-key": params.columnKey,
|
|
604
|
-
onMouseenter: (_event) => {
|
|
605
|
-
rangeClipboard.updateRangePointerPreview(params.rowIndex, params.columnKey);
|
|
606
|
-
},
|
|
607
|
-
onMouseup: (_event) => {
|
|
608
|
-
rangeClipboard.stopRangePointerInteraction(true);
|
|
609
|
-
},
|
|
610
|
-
});
|
|
611
|
-
const commitEditWithEvents = async () => {
|
|
612
|
-
const session = activeSession.value;
|
|
613
|
-
if (!session) {
|
|
614
|
-
return false;
|
|
615
|
-
}
|
|
616
|
-
emitGridEvent({
|
|
617
|
-
tier: "advanced",
|
|
618
|
-
name: "sugar:edit",
|
|
619
|
-
args: [{ session }],
|
|
620
|
-
source: "ui",
|
|
621
|
-
phase: "start",
|
|
622
|
-
});
|
|
623
|
-
const ok = await commitEdit();
|
|
624
|
-
emitGridEvent({
|
|
625
|
-
tier: ok ? "stable" : "advanced",
|
|
626
|
-
name: ok ? "cellEdit" : "sugar:edit",
|
|
627
|
-
args: ok
|
|
628
|
-
? [{ rowKey: session.rowKey, columnKey: session.columnKey, draft: session.draft, mode: session.mode }]
|
|
629
|
-
: [{ session }],
|
|
630
|
-
source: "ui",
|
|
631
|
-
phase: ok ? "commit" : "cancel",
|
|
632
|
-
});
|
|
633
|
-
return ok;
|
|
634
|
-
};
|
|
635
|
-
const bindingSuite = useAffinoDataGridBindingSuite({
|
|
636
|
-
columns,
|
|
637
|
-
resolveColumnOrder: () => runtime.api.getColumnModelSnapshot().order,
|
|
638
|
-
setColumnOrder: keys => {
|
|
639
|
-
runtime.api.setColumnOrder(keys);
|
|
640
|
-
},
|
|
641
|
-
resolveRowOrder: () => rows.value.map((row, index) => resolveRowKey(row, index)),
|
|
642
|
-
moveRowByKey: moveRowsByKey,
|
|
643
|
-
canReorderRows: () => canReorderRows.value,
|
|
644
|
-
resolveRowKey,
|
|
645
|
-
resolveColumnSortDirection,
|
|
646
|
-
toggleColumnSort,
|
|
647
|
-
isSelectedByKey,
|
|
648
|
-
toggleSelectedByKey,
|
|
649
|
-
selectOnlyRow,
|
|
650
|
-
editingEnabled,
|
|
651
|
-
beginEdit,
|
|
652
|
-
resolveCellDraft,
|
|
653
|
-
isCellEditing,
|
|
654
|
-
activeSession,
|
|
655
|
-
updateDraft,
|
|
656
|
-
cancelEdit,
|
|
657
|
-
commitEdit: commitEditWithEvents,
|
|
658
|
-
runAction,
|
|
659
|
-
});
|
|
660
|
-
const resolveCellRefreshValue = (batch, rowKey, columnKey) => {
|
|
661
|
-
const targetKey = String(rowKey);
|
|
662
|
-
const directHit = batch.cells.find(cell => String(cell.rowKey) === targetKey && cell.columnKey === columnKey);
|
|
663
|
-
if (!directHit) {
|
|
664
|
-
return null;
|
|
665
|
-
}
|
|
666
|
-
const directNode = runtime.api.getRow(directHit.rowIndex);
|
|
667
|
-
let resolvedRow = directNode?.row;
|
|
668
|
-
if (!resolvedRow || String(directNode?.rowId ?? "") !== targetKey) {
|
|
669
|
-
const viewportRange = runtime.api.getRowModelSnapshot().viewportRange;
|
|
670
|
-
const visibleRows = runtime.api.getRowsInRange(viewportRange);
|
|
671
|
-
resolvedRow = visibleRows.find(node => String(node.rowId) === targetKey)?.row;
|
|
672
|
-
}
|
|
673
|
-
if (!resolvedRow || typeof resolvedRow !== "object") {
|
|
674
|
-
return null;
|
|
675
|
-
}
|
|
676
|
-
const value = resolvedRow[columnKey];
|
|
677
|
-
if (value == null) {
|
|
678
|
-
return "";
|
|
679
|
-
}
|
|
680
|
-
return String(value);
|
|
681
|
-
};
|
|
682
|
-
const unsubscribeCellRefresh = runtime.api.onCellsRefresh(batch => {
|
|
683
|
-
for (const cell of batch.cells) {
|
|
684
|
-
const cellElement = bindingSuite.findCellElement(String(cell.rowKey), cell.columnKey);
|
|
685
|
-
if (!cellElement) {
|
|
686
|
-
continue;
|
|
687
|
-
}
|
|
688
|
-
cellElement.setAttribute("data-affino-cell-refresh-ts", String(batch.timestamp));
|
|
689
|
-
const nextValue = resolveCellRefreshValue(batch, cell.rowKey, cell.columnKey);
|
|
690
|
-
if (nextValue != null && cellElement.childElementCount === 0) {
|
|
691
|
-
cellElement.textContent = nextValue;
|
|
692
|
-
}
|
|
693
|
-
if (typeof CustomEvent === "function") {
|
|
694
|
-
cellElement.dispatchEvent(new CustomEvent("affino-datagrid:cell-refresh", {
|
|
695
|
-
detail: {
|
|
696
|
-
...cell,
|
|
697
|
-
timestamp: batch.timestamp,
|
|
698
|
-
reason: batch.reason,
|
|
699
|
-
},
|
|
700
|
-
}));
|
|
701
|
-
}
|
|
702
|
-
}
|
|
703
|
-
});
|
|
704
|
-
const applyAdvancedExpression = (expression, options = {}) => {
|
|
705
|
-
const mergeMode = options.mergeMode ?? "replace";
|
|
706
|
-
const currentExpression = featureSuite.filterModel.value?.advancedExpression ?? null;
|
|
707
|
-
const nextExpression = mergeAdvancedExpression(currentExpression, expression, mergeMode);
|
|
708
|
-
featureSuite.setAdvancedFilterExpression(nextExpression);
|
|
709
|
-
return nextExpression;
|
|
710
|
-
};
|
|
711
|
-
const clearAdvancedExpressionByKey = (columnKey) => {
|
|
712
|
-
const currentExpression = featureSuite.filterModel.value?.advancedExpression ?? null;
|
|
713
|
-
const nextExpression = removeAdvancedConditionByKey(currentExpression, columnKey);
|
|
714
|
-
featureSuite.setAdvancedFilterExpression(nextExpression);
|
|
715
|
-
return nextExpression;
|
|
716
|
-
};
|
|
717
|
-
const setTypedAdvancedCondition = (condition, options = {}) => {
|
|
718
|
-
const key = normalizeFilterColumnKey(condition.key);
|
|
719
|
-
if (!key) {
|
|
720
|
-
return featureSuite.filterModel.value?.advancedExpression ?? null;
|
|
721
|
-
}
|
|
722
|
-
const currentExpression = featureSuite.filterModel.value?.advancedExpression ?? null;
|
|
723
|
-
const withoutKey = removeAdvancedConditionByKey(currentExpression, key);
|
|
724
|
-
const nextCondition = createAdvancedCondition({ ...condition, key });
|
|
725
|
-
const mergeMode = options.mergeMode ?? "merge-and";
|
|
726
|
-
const nextExpression = mergeAdvancedExpression(withoutKey, nextCondition, mergeMode);
|
|
727
|
-
featureSuite.setAdvancedFilterExpression(nextExpression);
|
|
728
|
-
return nextExpression;
|
|
729
|
-
};
|
|
730
|
-
const filteringHelpers = {
|
|
731
|
-
condition: createAdvancedCondition,
|
|
732
|
-
and: (...children) => createAdvancedGroup("and", children),
|
|
733
|
-
or: (...children) => createAdvancedGroup("or", children),
|
|
734
|
-
not: child => createAdvancedNot(child),
|
|
735
|
-
apply: applyAdvancedExpression,
|
|
736
|
-
clearByKey: clearAdvancedExpressionByKey,
|
|
737
|
-
setText: (columnKey, options) => setTypedAdvancedCondition({
|
|
738
|
-
key: columnKey,
|
|
739
|
-
type: "text",
|
|
740
|
-
operator: options.operator ?? "contains",
|
|
741
|
-
value: options.value ?? "",
|
|
742
|
-
}, { mergeMode: options.mergeMode }),
|
|
743
|
-
setNumber: (columnKey, options) => setTypedAdvancedCondition({
|
|
744
|
-
key: columnKey,
|
|
745
|
-
type: "number",
|
|
746
|
-
operator: options.operator ?? "equals",
|
|
747
|
-
value: options.value,
|
|
748
|
-
value2: options.value2,
|
|
749
|
-
}, { mergeMode: options.mergeMode }),
|
|
750
|
-
setDate: (columnKey, options) => setTypedAdvancedCondition({
|
|
751
|
-
key: columnKey,
|
|
752
|
-
type: "date",
|
|
753
|
-
operator: options.operator ?? "equals",
|
|
754
|
-
value: options.value,
|
|
755
|
-
value2: options.value2,
|
|
756
|
-
}, { mergeMode: options.mergeMode }),
|
|
757
|
-
setSet: (columnKey, values, options = {}) => {
|
|
758
|
-
const key = normalizeFilterColumnKey(columnKey);
|
|
759
|
-
if (!key) {
|
|
760
|
-
return featureSuite.filterModel.value?.advancedExpression ?? null;
|
|
761
|
-
}
|
|
762
|
-
const currentExpression = featureSuite.filterModel.value?.advancedExpression ?? null;
|
|
763
|
-
const existingValues = findSetConditionValuesByKey(currentExpression, key);
|
|
764
|
-
const valueMode = options.valueMode ?? "replace";
|
|
765
|
-
const nextValues = nextSetFilterValues(existingValues, values, valueMode);
|
|
766
|
-
const withoutKey = removeAdvancedConditionByKey(currentExpression, key);
|
|
767
|
-
if (nextValues.length === 0) {
|
|
768
|
-
featureSuite.setAdvancedFilterExpression(withoutKey);
|
|
769
|
-
return withoutKey;
|
|
770
|
-
}
|
|
771
|
-
const nextCondition = createAdvancedCondition({
|
|
772
|
-
key,
|
|
773
|
-
type: "set",
|
|
774
|
-
operator: options.operator ?? "in",
|
|
775
|
-
value: nextValues,
|
|
776
|
-
});
|
|
777
|
-
const mergeMode = options.mergeMode ?? "merge-and";
|
|
778
|
-
const nextExpression = mergeAdvancedExpression(withoutKey, nextCondition, mergeMode);
|
|
779
|
-
featureSuite.setAdvancedFilterExpression(nextExpression);
|
|
780
|
-
return nextExpression;
|
|
781
|
-
},
|
|
782
|
-
};
|
|
783
|
-
const rangeClipboard = useAffinoDataGridRangeClipboard({
|
|
784
|
-
rows,
|
|
785
|
-
runtime,
|
|
786
|
-
featureSuite,
|
|
787
|
-
resolveRowKey,
|
|
788
|
-
resolveVisibleColumnIndex,
|
|
789
|
-
resolveCellCoordByIndex,
|
|
790
|
-
cellSelectionRange,
|
|
791
|
-
activeCellSelection,
|
|
792
|
-
clearCellSelection,
|
|
793
|
-
applySelectionFromRange,
|
|
794
|
-
closeContextMenu: () => {
|
|
795
|
-
bindingSuite.closeContextMenu();
|
|
796
|
-
},
|
|
797
|
-
interactions: {
|
|
798
|
-
enabled: normalizedFeatures.interactions.enabled,
|
|
799
|
-
rangeEnabled: normalizedFeatures.interactions.range.enabled,
|
|
800
|
-
fillEnabled: normalizedFeatures.interactions.range.fill,
|
|
801
|
-
moveEnabled: normalizedFeatures.interactions.range.move,
|
|
802
|
-
},
|
|
803
|
-
pushFeedback,
|
|
804
|
-
});
|
|
805
|
-
const stopAllPointerInteractions = (applyRange = true) => {
|
|
806
|
-
stopPointerCellSelection();
|
|
807
|
-
rangeClipboard.stopRangePointerInteraction(applyRange);
|
|
808
|
-
};
|
|
809
|
-
const handleGlobalPointerUp = () => {
|
|
810
|
-
stopAllPointerInteractions(true);
|
|
811
|
-
};
|
|
812
|
-
const handleGlobalPointerCancel = () => {
|
|
813
|
-
stopAllPointerInteractions(false);
|
|
814
|
-
};
|
|
815
|
-
const pointerLifecycle = useAffinoDataGridPointerLifecycle({
|
|
816
|
-
onPointerUp: handleGlobalPointerUp,
|
|
817
|
-
onPointerCancel: handleGlobalPointerCancel,
|
|
818
|
-
});
|
|
819
|
-
const copyCellRangeSelection = (trigger = "context-menu") => (rangeClipboard.copySelection(trigger));
|
|
820
|
-
const pasteCellRangeSelection = (trigger = "context-menu") => (rangeClipboard.pasteSelection(trigger));
|
|
821
|
-
const cutCellRangeSelection = (trigger = "context-menu") => (rangeClipboard.cutSelection(trigger));
|
|
822
|
-
const clearCellRangeSelection = (trigger = "context-menu") => (rangeClipboard.clearSelection(trigger));
|
|
823
|
-
const hasCellRangeContext = () => rangeClipboard.hasCellRangeContext();
|
|
824
|
-
runCopyAction = () => (hasCellRangeContext() ? copyCellRangeSelection("context-menu") : copySelectedRows());
|
|
825
|
-
runCutAction = async () => {
|
|
826
|
-
if (!hasCellRangeContext()) {
|
|
827
|
-
return cutSelectedRows();
|
|
828
|
-
}
|
|
829
|
-
const ok = await cutCellRangeSelection("context-menu");
|
|
830
|
-
return ok ? Math.max(1, rangeClipboard.resolveActiveRangeCellCount()) : 0;
|
|
831
|
-
};
|
|
832
|
-
runPasteAction = async () => {
|
|
833
|
-
if (!hasCellRangeContext()) {
|
|
834
|
-
return pasteRowsAppend();
|
|
835
|
-
}
|
|
836
|
-
const ok = await pasteCellRangeSelection("context-menu");
|
|
837
|
-
return ok ? Math.max(1, rangeClipboard.resolveActiveRangeCellCount()) : 0;
|
|
838
|
-
};
|
|
839
|
-
runClearAction = async () => {
|
|
840
|
-
if (!hasCellRangeContext()) {
|
|
841
|
-
return clearSelectedRows();
|
|
842
|
-
}
|
|
843
|
-
const ok = await clearCellRangeSelection("context-menu");
|
|
844
|
-
return ok ? Math.max(1, rangeClipboard.resolveActiveRangeCellCount()) : 0;
|
|
845
|
-
};
|
|
846
|
-
let refreshHistorySnapshotBridge = () => null;
|
|
847
|
-
const keyboardDispatcher = useAffinoDataGridKeyboardDispatcher({
|
|
848
|
-
enabled: ref(normalizedFeatures.keyboardNavigation.enabled),
|
|
849
|
-
runtime,
|
|
850
|
-
onHistoryRefresh: () => {
|
|
851
|
-
refreshHistorySnapshotBridge();
|
|
852
|
-
},
|
|
853
|
-
pushFeedback,
|
|
854
|
-
copySelection: () => copyCellRangeSelection("keyboard"),
|
|
855
|
-
pasteSelection: () => pasteCellRangeSelection("keyboard"),
|
|
856
|
-
cutSelection: () => cutCellRangeSelection("keyboard"),
|
|
857
|
-
clearSelection: () => clearCellRangeSelection("keyboard"),
|
|
858
|
-
});
|
|
859
|
-
dispatchCellKeyboardCommands = keyboardDispatcher.dispatch;
|
|
860
|
-
const paginationSnapshot = ref(clonePaginationSnapshot(runtime.api.getPaginationSnapshot()));
|
|
861
|
-
const columnStateSnapshot = ref(cloneColumnModelSnapshot(runtime.api.getColumnModelSnapshot()));
|
|
862
|
-
const historySupported = ref(runtime.api.hasTransactionSupport());
|
|
863
|
-
const historySnapshot = ref(cloneTransactionSnapshot(runtime.api.getTransactionSnapshot()));
|
|
864
|
-
const refreshPaginationSnapshot = () => {
|
|
865
|
-
const nextSnapshot = clonePaginationSnapshot(runtime.api.getPaginationSnapshot());
|
|
866
|
-
paginationSnapshot.value = nextSnapshot;
|
|
867
|
-
return nextSnapshot;
|
|
868
|
-
};
|
|
869
|
-
const refreshColumnStateSnapshot = () => {
|
|
870
|
-
const nextSnapshot = cloneColumnModelSnapshot(runtime.api.getColumnModelSnapshot());
|
|
871
|
-
columnStateSnapshot.value = nextSnapshot;
|
|
872
|
-
return nextSnapshot;
|
|
873
|
-
};
|
|
874
|
-
const refreshHistorySnapshot = () => {
|
|
875
|
-
historySupported.value = runtime.api.hasTransactionSupport();
|
|
876
|
-
if (!historySupported.value) {
|
|
877
|
-
historySnapshot.value = null;
|
|
878
|
-
return null;
|
|
879
|
-
}
|
|
880
|
-
const nextSnapshot = cloneTransactionSnapshot(runtime.api.getTransactionSnapshot());
|
|
881
|
-
historySnapshot.value = nextSnapshot;
|
|
882
|
-
return nextSnapshot;
|
|
883
|
-
};
|
|
884
|
-
refreshHistorySnapshotBridge = refreshHistorySnapshot;
|
|
885
|
-
const statusBar = useAffinoDataGridStatusBar({
|
|
886
|
-
enabled: normalizedFeatures.statusBar.enabled,
|
|
887
|
-
rows,
|
|
888
|
-
runtime,
|
|
889
|
-
featureSuite,
|
|
890
|
-
cellSelectionRange,
|
|
891
|
-
activeCellSelection,
|
|
892
|
-
anchorCellSelection,
|
|
893
|
-
resolveRowKey,
|
|
894
|
-
});
|
|
895
|
-
const headerFilters = useAffinoDataGridHeaderFilters({
|
|
896
|
-
enabled: normalizedFeatures.headerFilters.enabled,
|
|
897
|
-
maxUniqueValues: normalizedFeatures.headerFilters.maxUniqueValues,
|
|
898
|
-
rows,
|
|
899
|
-
columns,
|
|
900
|
-
featureSuite,
|
|
901
|
-
filteringHelpers,
|
|
902
|
-
stableSerialize,
|
|
903
|
-
findSetConditionValuesByKey,
|
|
904
|
-
pushFeedback,
|
|
905
|
-
});
|
|
906
|
-
const unsubscribeRowModel = runtime.rowModel.subscribe(nextSnapshot => {
|
|
907
|
-
paginationSnapshot.value = clonePaginationSnapshot(nextSnapshot.pagination);
|
|
908
|
-
statusBar.refresh();
|
|
909
|
-
if (historySupported.value) {
|
|
910
|
-
refreshHistorySnapshot();
|
|
911
|
-
}
|
|
912
|
-
});
|
|
913
|
-
const unsubscribeColumnModel = runtime.columnModel.subscribe(nextSnapshot => {
|
|
914
|
-
columnStateSnapshot.value = cloneColumnModelSnapshot(nextSnapshot);
|
|
915
|
-
statusBar.refresh();
|
|
916
|
-
if (historySupported.value) {
|
|
917
|
-
refreshHistorySnapshot();
|
|
918
|
-
}
|
|
919
|
-
});
|
|
920
|
-
onBeforeUnmount(() => {
|
|
921
|
-
if (typeof window !== "undefined") {
|
|
922
|
-
window.removeEventListener("mousemove", onColumnResizeMove);
|
|
923
|
-
window.removeEventListener("mouseup", onColumnResizeEnd);
|
|
924
|
-
window.removeEventListener("mousemove", onRowResizeMove);
|
|
925
|
-
window.removeEventListener("mouseup", onRowResizeEnd);
|
|
926
|
-
}
|
|
927
|
-
pointerLifecycle.dispose();
|
|
928
|
-
rangeClipboard.dispose();
|
|
929
|
-
stopAllPointerInteractions(false);
|
|
930
|
-
stopColumnResize();
|
|
931
|
-
stopRowResize();
|
|
932
|
-
unsubscribeRowModel();
|
|
933
|
-
unsubscribeColumnModel();
|
|
934
|
-
unsubscribeCellRefresh();
|
|
935
|
-
});
|
|
936
|
-
const baseResult = assembleAffinoDataGridResult({
|
|
937
|
-
runtime,
|
|
938
|
-
rows,
|
|
939
|
-
columns,
|
|
940
|
-
componentProps,
|
|
941
|
-
sort: {
|
|
942
|
-
sortState,
|
|
943
|
-
setSortState,
|
|
944
|
-
toggleColumnSort,
|
|
945
|
-
clearSort,
|
|
946
|
-
},
|
|
947
|
-
runAction: runActionWithFeedback,
|
|
948
|
-
filteringHelpers,
|
|
949
|
-
featureSuite,
|
|
950
|
-
bindingSuite,
|
|
951
|
-
});
|
|
952
|
-
const openContextMenuForActiveCell = (options = {}) => {
|
|
953
|
-
const active = activeCellSelection.value;
|
|
954
|
-
if (!active) {
|
|
955
|
-
return false;
|
|
956
|
-
}
|
|
957
|
-
const zone = options.zone ?? "cell";
|
|
958
|
-
const cell = bindingSuite.findCellElement(active.rowKey, active.columnKey);
|
|
959
|
-
const rect = cell?.getBoundingClientRect();
|
|
960
|
-
const x = options.clientX ?? (rect ? rect.left + rect.width / 2 : 0);
|
|
961
|
-
const y = options.clientY ?? (rect ? rect.top + rect.height / 2 : 0);
|
|
962
|
-
baseResult.contextMenu.open(x, y, {
|
|
963
|
-
zone,
|
|
964
|
-
columnKey: active.columnKey,
|
|
965
|
-
rowId: active.rowKey,
|
|
966
|
-
});
|
|
967
|
-
return true;
|
|
968
|
-
};
|
|
969
|
-
const openContextMenuForHeader = (columnKey, options = {}) => {
|
|
970
|
-
const header = bindingSuite.findHeaderElement(columnKey);
|
|
971
|
-
const rect = header?.getBoundingClientRect();
|
|
972
|
-
const x = options.clientX ?? (rect ? rect.left + rect.width / 2 : 0);
|
|
973
|
-
const y = options.clientY ?? (rect ? rect.top + rect.height / 2 : 0);
|
|
974
|
-
baseResult.contextMenu.open(x, y, {
|
|
975
|
-
zone: "header",
|
|
976
|
-
columnKey,
|
|
977
|
-
rowId: null,
|
|
978
|
-
});
|
|
979
|
-
return true;
|
|
980
|
-
};
|
|
981
|
-
const resolveContextMenuActionDisabledReason = (actionId) => {
|
|
982
|
-
const state = baseResult.contextMenu.state.value;
|
|
983
|
-
if ((actionId === "copy" || actionId === "cut" || actionId === "clear") && !hasCellRangeContext()) {
|
|
984
|
-
return "No active cell range";
|
|
985
|
-
}
|
|
986
|
-
if (actionId === "paste" && !clipboardEnabled.value) {
|
|
987
|
-
return "Clipboard feature disabled";
|
|
988
|
-
}
|
|
989
|
-
if ((actionId === "sort-asc" || actionId === "sort-desc" || actionId === "sort-clear" || actionId === "auto-size") && !state.columnKey) {
|
|
990
|
-
return "No target column";
|
|
991
|
-
}
|
|
992
|
-
if (actionId === "filter" && !filteringEnabled.value) {
|
|
993
|
-
return "Filtering feature disabled";
|
|
994
|
-
}
|
|
995
|
-
return null;
|
|
996
|
-
};
|
|
997
|
-
const isContextMenuActionDisabled = (actionId) => (resolveContextMenuActionDisabledReason(actionId) != null);
|
|
998
|
-
const groupedContextMenuActions = computed(() => {
|
|
999
|
-
const actionsById = new Map(baseResult.contextMenu.actions.value.map(action => [action.id, action]));
|
|
1000
|
-
const groups = [
|
|
1001
|
-
{
|
|
1002
|
-
id: "clipboard",
|
|
1003
|
-
label: "Clipboard",
|
|
1004
|
-
actions: ["copy", "cut", "paste", "clear"]
|
|
1005
|
-
.map(id => actionsById.get(id))
|
|
1006
|
-
.filter((entry) => Boolean(entry)),
|
|
1007
|
-
},
|
|
1008
|
-
{
|
|
1009
|
-
id: "sorting",
|
|
1010
|
-
label: "Sorting",
|
|
1011
|
-
actions: ["sort-asc", "sort-desc", "sort-clear"]
|
|
1012
|
-
.map(id => actionsById.get(id))
|
|
1013
|
-
.filter((entry) => Boolean(entry)),
|
|
1014
|
-
},
|
|
1015
|
-
{
|
|
1016
|
-
id: "filters",
|
|
1017
|
-
label: "Filters",
|
|
1018
|
-
actions: ["filter"]
|
|
1019
|
-
.map(id => actionsById.get(id))
|
|
1020
|
-
.filter((entry) => Boolean(entry)),
|
|
1021
|
-
},
|
|
1022
|
-
{
|
|
1023
|
-
id: "column",
|
|
1024
|
-
label: "Column",
|
|
1025
|
-
actions: ["auto-size"]
|
|
1026
|
-
.map(id => actionsById.get(id))
|
|
1027
|
-
.filter((entry) => Boolean(entry)),
|
|
1028
|
-
},
|
|
1029
|
-
];
|
|
1030
|
-
return groups.filter(group => group.actions.length > 0);
|
|
1031
|
-
});
|
|
1032
|
-
const runContextMenuActionWithParity = async (actionId) => {
|
|
1033
|
-
emitGridEvent({
|
|
1034
|
-
tier: "advanced",
|
|
1035
|
-
name: "sugar:context-menu-action",
|
|
1036
|
-
args: [{ actionId }],
|
|
1037
|
-
source: "context-menu",
|
|
1038
|
-
phase: "start",
|
|
1039
|
-
});
|
|
1040
|
-
const disabledReason = resolveContextMenuActionDisabledReason(actionId);
|
|
1041
|
-
if (disabledReason) {
|
|
1042
|
-
const result = {
|
|
1043
|
-
ok: false,
|
|
1044
|
-
affected: 0,
|
|
1045
|
-
message: disabledReason,
|
|
1046
|
-
};
|
|
1047
|
-
pushFeedback({
|
|
1048
|
-
source: "context-menu",
|
|
1049
|
-
action: actionId,
|
|
1050
|
-
message: disabledReason,
|
|
1051
|
-
ok: false,
|
|
1052
|
-
});
|
|
1053
|
-
emitGridEvent({
|
|
1054
|
-
tier: "advanced",
|
|
1055
|
-
name: "sugar:context-menu-action",
|
|
1056
|
-
args: [{ actionId, result }],
|
|
1057
|
-
source: "context-menu",
|
|
1058
|
-
phase: "cancel",
|
|
1059
|
-
});
|
|
1060
|
-
return result;
|
|
1061
|
-
}
|
|
1062
|
-
const result = await baseResult.contextMenu.runAction(actionId);
|
|
1063
|
-
pushFeedback({
|
|
1064
|
-
source: "context-menu",
|
|
1065
|
-
action: actionId,
|
|
1066
|
-
message: result.message,
|
|
1067
|
-
affected: result.affected,
|
|
1068
|
-
ok: result.ok,
|
|
1069
|
-
});
|
|
1070
|
-
emitGridEvent({
|
|
1071
|
-
tier: "advanced",
|
|
1072
|
-
name: "sugar:context-menu-action",
|
|
1073
|
-
args: [{ actionId, result }],
|
|
1074
|
-
source: "context-menu",
|
|
1075
|
-
phase: "end",
|
|
1076
|
-
});
|
|
1077
|
-
return result;
|
|
1078
|
-
};
|
|
1079
|
-
const setPagination = (pagination) => {
|
|
1080
|
-
runtime.api.setPagination(pagination);
|
|
1081
|
-
refreshPaginationSnapshot();
|
|
1082
|
-
emitGridEvent({
|
|
1083
|
-
tier: "advanced",
|
|
1084
|
-
name: "sugar:pagination",
|
|
1085
|
-
args: [paginationSnapshot.value ?? runtime.api.getPaginationSnapshot()],
|
|
1086
|
-
source: "api",
|
|
1087
|
-
phase: "change",
|
|
1088
|
-
});
|
|
1089
|
-
};
|
|
1090
|
-
const setPageSize = (pageSize) => {
|
|
1091
|
-
runtime.api.setPageSize(pageSize);
|
|
1092
|
-
refreshPaginationSnapshot();
|
|
1093
|
-
emitGridEvent({
|
|
1094
|
-
tier: "advanced",
|
|
1095
|
-
name: "sugar:pagination",
|
|
1096
|
-
args: [paginationSnapshot.value ?? runtime.api.getPaginationSnapshot()],
|
|
1097
|
-
source: "api",
|
|
1098
|
-
phase: "change",
|
|
1099
|
-
});
|
|
1100
|
-
};
|
|
1101
|
-
const setCurrentPage = (page) => {
|
|
1102
|
-
runtime.api.setCurrentPage(page);
|
|
1103
|
-
const snapshot = refreshPaginationSnapshot();
|
|
1104
|
-
emitGridEvent({
|
|
1105
|
-
tier: "advanced",
|
|
1106
|
-
name: "sugar:pagination",
|
|
1107
|
-
args: [snapshot],
|
|
1108
|
-
source: "api",
|
|
1109
|
-
phase: "change",
|
|
1110
|
-
});
|
|
1111
|
-
};
|
|
1112
|
-
const goToNextPage = () => {
|
|
1113
|
-
const snapshot = paginationSnapshot.value;
|
|
1114
|
-
if (!snapshot.enabled) {
|
|
1115
|
-
return;
|
|
1116
|
-
}
|
|
1117
|
-
setCurrentPage(snapshot.currentPage + 1);
|
|
1118
|
-
};
|
|
1119
|
-
const goToPreviousPage = () => {
|
|
1120
|
-
const snapshot = paginationSnapshot.value;
|
|
1121
|
-
if (!snapshot.enabled) {
|
|
1122
|
-
return;
|
|
1123
|
-
}
|
|
1124
|
-
setCurrentPage(Math.max(0, snapshot.currentPage - 1));
|
|
1125
|
-
};
|
|
1126
|
-
const goToFirstPage = () => {
|
|
1127
|
-
setCurrentPage(0);
|
|
1128
|
-
};
|
|
1129
|
-
const goToLastPage = () => {
|
|
1130
|
-
const snapshot = paginationSnapshot.value;
|
|
1131
|
-
setCurrentPage(Math.max(0, snapshot.pageCount - 1));
|
|
1132
|
-
};
|
|
1133
|
-
const setColumnOrder = (keys) => {
|
|
1134
|
-
runtime.api.setColumnOrder(keys);
|
|
1135
|
-
refreshColumnStateSnapshot();
|
|
1136
|
-
};
|
|
1137
|
-
const setColumnVisibility = (columnKey, visible) => {
|
|
1138
|
-
runtime.api.setColumnVisibility(columnKey, visible);
|
|
1139
|
-
refreshColumnStateSnapshot();
|
|
1140
|
-
};
|
|
1141
|
-
const setColumnWidth = (columnKey, width) => {
|
|
1142
|
-
runtime.api.setColumnWidth(columnKey, width);
|
|
1143
|
-
refreshColumnStateSnapshot();
|
|
1144
|
-
};
|
|
1145
|
-
const setColumnPin = (columnKey, pin) => {
|
|
1146
|
-
runtime.api.setColumnPin(columnKey, pin);
|
|
1147
|
-
refreshColumnStateSnapshot();
|
|
1148
|
-
};
|
|
1149
|
-
const columnResizeState = ref(null);
|
|
1150
|
-
const stopColumnResize = () => {
|
|
1151
|
-
columnResizeState.value = null;
|
|
1152
|
-
if (typeof window !== "undefined") {
|
|
1153
|
-
window.removeEventListener("mousemove", onColumnResizeMove);
|
|
1154
|
-
window.removeEventListener("mouseup", onColumnResizeEnd);
|
|
1155
|
-
}
|
|
1156
|
-
refreshColumnStateSnapshot();
|
|
1157
|
-
};
|
|
1158
|
-
const onColumnResizeMove = (event) => {
|
|
1159
|
-
const state = columnResizeState.value;
|
|
1160
|
-
if (!state) {
|
|
1161
|
-
return;
|
|
1162
|
-
}
|
|
1163
|
-
const delta = event.clientX - state.startX;
|
|
1164
|
-
const nextWidth = Math.max(56, Math.round(state.startWidth + delta));
|
|
1165
|
-
runtime.api.setColumnWidth(state.columnKey, nextWidth);
|
|
1166
|
-
};
|
|
1167
|
-
const onColumnResizeEnd = () => {
|
|
1168
|
-
const state = columnResizeState.value;
|
|
1169
|
-
if (!state) {
|
|
1170
|
-
return;
|
|
1171
|
-
}
|
|
1172
|
-
const column = runtime.api.getColumn(state.columnKey);
|
|
1173
|
-
emitGridEvent({
|
|
1174
|
-
tier: "stable",
|
|
1175
|
-
name: "columnResize",
|
|
1176
|
-
args: [{
|
|
1177
|
-
key: state.columnKey,
|
|
1178
|
-
width: Number(column?.width ?? column?.column.width ?? state.startWidth),
|
|
1179
|
-
}],
|
|
1180
|
-
source: "pointer",
|
|
1181
|
-
phase: "end",
|
|
1182
|
-
});
|
|
1183
|
-
stopColumnResize();
|
|
1184
|
-
};
|
|
1185
|
-
const startColumnResize = (columnKey, event) => {
|
|
1186
|
-
event.preventDefault();
|
|
1187
|
-
const column = runtime.api.getColumn(columnKey);
|
|
1188
|
-
if (!column) {
|
|
1189
|
-
return;
|
|
1190
|
-
}
|
|
1191
|
-
const startWidth = Number.isFinite(column.width)
|
|
1192
|
-
? Number(column.width)
|
|
1193
|
-
: Number(column.column.width ?? 160);
|
|
1194
|
-
columnResizeState.value = {
|
|
1195
|
-
columnKey,
|
|
1196
|
-
startX: event.clientX,
|
|
1197
|
-
startWidth: Math.max(56, startWidth || 160),
|
|
1198
|
-
};
|
|
1199
|
-
if (typeof window !== "undefined") {
|
|
1200
|
-
window.addEventListener("mousemove", onColumnResizeMove);
|
|
1201
|
-
window.addEventListener("mouseup", onColumnResizeEnd);
|
|
1202
|
-
}
|
|
1203
|
-
};
|
|
1204
|
-
const autosizeColumn = async (columnKey) => {
|
|
1205
|
-
await runActionWithFeedback("auto-size", { columnKey });
|
|
1206
|
-
refreshColumnStateSnapshot();
|
|
1207
|
-
};
|
|
1208
|
-
const createColumnResizeHandleBindings = (columnKey) => ({
|
|
1209
|
-
role: "separator",
|
|
1210
|
-
tabindex: 0,
|
|
1211
|
-
"aria-orientation": "vertical",
|
|
1212
|
-
"data-column-key": columnKey,
|
|
1213
|
-
onMousedown: (event) => {
|
|
1214
|
-
startColumnResize(columnKey, event);
|
|
1215
|
-
},
|
|
1216
|
-
onDblclick: (_event) => {
|
|
1217
|
-
void autosizeColumn(columnKey);
|
|
1218
|
-
},
|
|
1219
|
-
onKeydown: (event) => {
|
|
1220
|
-
if (event.key === "Enter" || event.key === " ") {
|
|
1221
|
-
event.preventDefault();
|
|
1222
|
-
void autosizeColumn(columnKey);
|
|
1223
|
-
return;
|
|
1224
|
-
}
|
|
1225
|
-
if (event.key === "ArrowLeft" || event.key === "ArrowRight") {
|
|
1226
|
-
event.preventDefault();
|
|
1227
|
-
const direction = event.key === "ArrowRight" ? 1 : -1;
|
|
1228
|
-
const current = runtime.api.getColumn(columnKey);
|
|
1229
|
-
const currentWidth = Number(current?.width ?? current?.column.width ?? 160);
|
|
1230
|
-
runtime.api.setColumnWidth(columnKey, Math.max(56, currentWidth + direction * 12));
|
|
1231
|
-
}
|
|
1232
|
-
},
|
|
1233
|
-
});
|
|
1234
|
-
const rowResizeState = ref(null);
|
|
1235
|
-
const stopRowResize = () => {
|
|
1236
|
-
rowResizeState.value = null;
|
|
1237
|
-
if (typeof window !== "undefined") {
|
|
1238
|
-
window.removeEventListener("mousemove", onRowResizeMove);
|
|
1239
|
-
window.removeEventListener("mouseup", onRowResizeEnd);
|
|
1240
|
-
}
|
|
1241
|
-
};
|
|
1242
|
-
const onRowResizeMove = (event) => {
|
|
1243
|
-
const state = rowResizeState.value;
|
|
1244
|
-
if (!state || !featureSuite.rowHeightEnabled.value) {
|
|
1245
|
-
return;
|
|
1246
|
-
}
|
|
1247
|
-
featureSuite.setRowHeightMode("fixed");
|
|
1248
|
-
const delta = event.clientY - state.startY;
|
|
1249
|
-
featureSuite.setBaseRowHeight(Math.max(22, Math.round(state.startBase + delta)));
|
|
1250
|
-
};
|
|
1251
|
-
const onRowResizeEnd = () => {
|
|
1252
|
-
if (!rowResizeState.value) {
|
|
1253
|
-
return;
|
|
1254
|
-
}
|
|
1255
|
-
stopRowResize();
|
|
1256
|
-
};
|
|
1257
|
-
const startRowResize = (rowKey, event) => {
|
|
1258
|
-
if (!featureSuite.rowHeightEnabled.value) {
|
|
1259
|
-
return;
|
|
1260
|
-
}
|
|
1261
|
-
event.preventDefault();
|
|
1262
|
-
rowResizeState.value = {
|
|
1263
|
-
rowKey,
|
|
1264
|
-
startY: event.clientY,
|
|
1265
|
-
startBase: featureSuite.baseRowHeight.value,
|
|
1266
|
-
};
|
|
1267
|
-
featureSuite.setRowHeightMode("fixed");
|
|
1268
|
-
if (typeof window !== "undefined") {
|
|
1269
|
-
window.addEventListener("mousemove", onRowResizeMove);
|
|
1270
|
-
window.addEventListener("mouseup", onRowResizeEnd);
|
|
1271
|
-
}
|
|
1272
|
-
};
|
|
1273
|
-
const autosizeRows = () => {
|
|
1274
|
-
if (!featureSuite.rowHeightEnabled.value || !featureSuite.rowHeightSupported.value) {
|
|
1275
|
-
return;
|
|
1276
|
-
}
|
|
1277
|
-
featureSuite.setRowHeightMode("auto");
|
|
1278
|
-
featureSuite.measureVisibleRowHeights();
|
|
1279
|
-
featureSuite.applyRowHeightSettings();
|
|
1280
|
-
pushFeedback({
|
|
1281
|
-
source: "action",
|
|
1282
|
-
action: "autosize-rows",
|
|
1283
|
-
message: "Auto-sized visible rows",
|
|
1284
|
-
ok: true,
|
|
1285
|
-
});
|
|
1286
|
-
};
|
|
1287
|
-
const createRowResizeHandleBindings = (rowKey) => ({
|
|
1288
|
-
role: "separator",
|
|
1289
|
-
tabindex: 0,
|
|
1290
|
-
"aria-orientation": "horizontal",
|
|
1291
|
-
"data-row-key": rowKey,
|
|
1292
|
-
onMousedown: (event) => {
|
|
1293
|
-
startRowResize(rowKey, event);
|
|
1294
|
-
},
|
|
1295
|
-
onDblclick: (_event) => {
|
|
1296
|
-
autosizeRows();
|
|
1297
|
-
},
|
|
1298
|
-
onKeydown: (event) => {
|
|
1299
|
-
if (!featureSuite.rowHeightEnabled.value) {
|
|
1300
|
-
return;
|
|
1301
|
-
}
|
|
1302
|
-
if (event.key === "Enter" || event.key === " ") {
|
|
1303
|
-
event.preventDefault();
|
|
1304
|
-
autosizeRows();
|
|
1305
|
-
return;
|
|
1306
|
-
}
|
|
1307
|
-
if (event.key === "ArrowUp" || event.key === "ArrowDown") {
|
|
1308
|
-
event.preventDefault();
|
|
1309
|
-
featureSuite.setRowHeightMode("fixed");
|
|
1310
|
-
const delta = event.key === "ArrowDown" ? 2 : -2;
|
|
1311
|
-
featureSuite.setBaseRowHeight(Math.max(22, featureSuite.baseRowHeight.value + delta));
|
|
1312
|
-
}
|
|
1313
|
-
},
|
|
1314
|
-
});
|
|
1315
|
-
const applyColumnStateSnapshot = (snapshot) => {
|
|
1316
|
-
runtime.api.setColumnOrder(snapshot.order);
|
|
1317
|
-
for (const column of snapshot.columns) {
|
|
1318
|
-
runtime.api.setColumnVisibility(column.key, column.visible);
|
|
1319
|
-
runtime.api.setColumnWidth(column.key, column.width);
|
|
1320
|
-
runtime.api.setColumnPin(column.key, column.pin);
|
|
1321
|
-
}
|
|
1322
|
-
refreshColumnStateSnapshot();
|
|
1323
|
-
};
|
|
1324
|
-
const layoutProfiles = useAffinoDataGridLayoutProfiles({
|
|
1325
|
-
runtime,
|
|
1326
|
-
sortState,
|
|
1327
|
-
setSortState,
|
|
1328
|
-
featureSuite,
|
|
1329
|
-
applyColumnStateSnapshot,
|
|
1330
|
-
cloneColumnModelSnapshot,
|
|
1331
|
-
stableClone,
|
|
1332
|
-
pushFeedback,
|
|
1333
|
-
});
|
|
1334
|
-
const canUndo = computed(() => (historySupported.value ? runtime.api.canUndoTransaction() : false));
|
|
1335
|
-
const canRedo = computed(() => (historySupported.value ? runtime.api.canRedoTransaction() : false));
|
|
1336
|
-
const undo = async () => {
|
|
1337
|
-
if (!historySupported.value || !runtime.api.canUndoTransaction()) {
|
|
1338
|
-
return null;
|
|
1339
|
-
}
|
|
1340
|
-
emitGridEvent({
|
|
1341
|
-
tier: "advanced",
|
|
1342
|
-
name: "sugar:history",
|
|
1343
|
-
args: [{ direction: "undo" }],
|
|
1344
|
-
source: "keyboard",
|
|
1345
|
-
phase: "start",
|
|
1346
|
-
});
|
|
1347
|
-
const committedId = await runtime.api.undoTransaction();
|
|
1348
|
-
refreshHistorySnapshot();
|
|
1349
|
-
pushFeedback({
|
|
1350
|
-
source: "history",
|
|
1351
|
-
action: "undo",
|
|
1352
|
-
message: "Undo",
|
|
1353
|
-
ok: true,
|
|
1354
|
-
});
|
|
1355
|
-
emitGridEvent({
|
|
1356
|
-
tier: "advanced",
|
|
1357
|
-
name: "sugar:history",
|
|
1358
|
-
args: [{ direction: "undo", committedId }],
|
|
1359
|
-
source: "keyboard",
|
|
1360
|
-
phase: "end",
|
|
1361
|
-
});
|
|
1362
|
-
return committedId;
|
|
1363
|
-
};
|
|
1364
|
-
const redo = async () => {
|
|
1365
|
-
if (!historySupported.value || !runtime.api.canRedoTransaction()) {
|
|
1366
|
-
return null;
|
|
1367
|
-
}
|
|
1368
|
-
emitGridEvent({
|
|
1369
|
-
tier: "advanced",
|
|
1370
|
-
name: "sugar:history",
|
|
1371
|
-
args: [{ direction: "redo" }],
|
|
1372
|
-
source: "keyboard",
|
|
1373
|
-
phase: "start",
|
|
1374
|
-
});
|
|
1375
|
-
const committedId = await runtime.api.redoTransaction();
|
|
1376
|
-
refreshHistorySnapshot();
|
|
1377
|
-
pushFeedback({
|
|
1378
|
-
source: "history",
|
|
1379
|
-
action: "redo",
|
|
1380
|
-
message: "Redo",
|
|
1381
|
-
ok: true,
|
|
1382
|
-
});
|
|
1383
|
-
emitGridEvent({
|
|
1384
|
-
tier: "advanced",
|
|
1385
|
-
name: "sugar:history",
|
|
1386
|
-
args: [{ direction: "redo", committedId }],
|
|
1387
|
-
source: "keyboard",
|
|
1388
|
-
phase: "end",
|
|
1389
|
-
});
|
|
1390
|
-
return committedId;
|
|
1391
|
-
};
|
|
1392
|
-
return {
|
|
1393
|
-
...baseResult,
|
|
1394
|
-
DataGrid,
|
|
1395
|
-
actions: {
|
|
1396
|
-
...baseResult.actions,
|
|
1397
|
-
runAction: runActionWithFeedback,
|
|
1398
|
-
},
|
|
1399
|
-
feedback: {
|
|
1400
|
-
enabled: feedbackEnabled,
|
|
1401
|
-
lastAction: feedbackLastAction,
|
|
1402
|
-
events: feedbackEvents,
|
|
1403
|
-
clear: () => {
|
|
1404
|
-
feedbackEvents.value = [];
|
|
1405
|
-
},
|
|
1406
|
-
},
|
|
1407
|
-
layoutProfiles: {
|
|
1408
|
-
profiles: layoutProfiles.profiles,
|
|
1409
|
-
capture: layoutProfiles.capture,
|
|
1410
|
-
apply: layoutProfiles.apply,
|
|
1411
|
-
remove: layoutProfiles.remove,
|
|
1412
|
-
clear: layoutProfiles.clear,
|
|
1413
|
-
},
|
|
1414
|
-
statusBar: {
|
|
1415
|
-
enabled: statusBar.enabled,
|
|
1416
|
-
metrics: statusBar.metrics,
|
|
1417
|
-
refresh: statusBar.refresh,
|
|
1418
|
-
},
|
|
1419
|
-
contextMenu: {
|
|
1420
|
-
...baseResult.contextMenu,
|
|
1421
|
-
groupedActions: groupedContextMenuActions,
|
|
1422
|
-
openForActiveCell: openContextMenuForActiveCell,
|
|
1423
|
-
openForHeader: openContextMenuForHeader,
|
|
1424
|
-
isActionDisabled: isContextMenuActionDisabled,
|
|
1425
|
-
getActionDisabledReason: resolveContextMenuActionDisabledReason,
|
|
1426
|
-
runAction: runContextMenuActionWithParity,
|
|
1427
|
-
},
|
|
1428
|
-
events: {
|
|
1429
|
-
enabled: eventHubEnabled,
|
|
1430
|
-
last: eventHubLast,
|
|
1431
|
-
log: eventHubLog,
|
|
1432
|
-
on: eventHub.on,
|
|
1433
|
-
off: eventHub.off,
|
|
1434
|
-
emit: eventHub.emit,
|
|
1435
|
-
clear: eventHub.clear,
|
|
1436
|
-
},
|
|
1437
|
-
cellSelection: {
|
|
1438
|
-
activeCell: activeCellSelection,
|
|
1439
|
-
anchorCell: anchorCellSelection,
|
|
1440
|
-
focusCell: focusCellSelection,
|
|
1441
|
-
range: cellSelectionRange,
|
|
1442
|
-
ranges: cellSelectionRanges,
|
|
1443
|
-
isCellSelected,
|
|
1444
|
-
setCellByKey,
|
|
1445
|
-
clear: clearCellSelection,
|
|
1446
|
-
},
|
|
1447
|
-
cellRange: {
|
|
1448
|
-
copiedRange: rangeClipboard.copiedRange,
|
|
1449
|
-
fillPreviewRange: rangeClipboard.fillPreviewRange,
|
|
1450
|
-
rangeMovePreviewRange: rangeClipboard.rangeMovePreviewRange,
|
|
1451
|
-
lastAction: rangeClipboard.lastAction,
|
|
1452
|
-
copy: copyCellRangeSelection,
|
|
1453
|
-
paste: pasteCellRangeSelection,
|
|
1454
|
-
cut: cutCellRangeSelection,
|
|
1455
|
-
clear: clearCellRangeSelection,
|
|
1456
|
-
setFillPreviewRange: rangeClipboard.setFillPreviewRange,
|
|
1457
|
-
setRangeMovePreviewRange: rangeClipboard.setRangeMovePreviewRange,
|
|
1458
|
-
applyFillPreview: rangeClipboard.applyFillPreview,
|
|
1459
|
-
applyRangeMove: rangeClipboard.applyRangeMove,
|
|
1460
|
-
},
|
|
1461
|
-
features: {
|
|
1462
|
-
...baseResult.features,
|
|
1463
|
-
editing: {
|
|
1464
|
-
...baseResult.features.editing,
|
|
1465
|
-
enumEditor: {
|
|
1466
|
-
enabled: enumEditorEnabled,
|
|
1467
|
-
primitive: enumEditorPrimitive,
|
|
1468
|
-
resolveOptions: resolveEnumEditorOptions,
|
|
1469
|
-
},
|
|
1470
|
-
},
|
|
1471
|
-
interactions: {
|
|
1472
|
-
enabled: rangeClipboard.interactionsEnabled,
|
|
1473
|
-
range: {
|
|
1474
|
-
enabled: rangeClipboard.rangeInteractionsEnabled,
|
|
1475
|
-
fillEnabled: rangeClipboard.rangeFillEnabled,
|
|
1476
|
-
moveEnabled: rangeClipboard.rangeMoveEnabled,
|
|
1477
|
-
pointerMode: rangeClipboard.rangePointerMode,
|
|
1478
|
-
stop: () => {
|
|
1479
|
-
rangeClipboard.stopRangePointerInteraction(false);
|
|
1480
|
-
},
|
|
1481
|
-
},
|
|
1482
|
-
},
|
|
1483
|
-
headerFilters: {
|
|
1484
|
-
enabled: headerFilters.enabled,
|
|
1485
|
-
state: headerFilters.state,
|
|
1486
|
-
open: headerFilters.open,
|
|
1487
|
-
close: headerFilters.close,
|
|
1488
|
-
toggle: headerFilters.toggle,
|
|
1489
|
-
setQuery: headerFilters.setQuery,
|
|
1490
|
-
setOperator: headerFilters.setOperator,
|
|
1491
|
-
getOperators: headerFilters.getOperators,
|
|
1492
|
-
getUniqueValues: headerFilters.getUniqueValues,
|
|
1493
|
-
setValueSelected: headerFilters.setValueSelected,
|
|
1494
|
-
selectOnlyValue: headerFilters.selectOnlyValue,
|
|
1495
|
-
selectAllValues: headerFilters.selectAllValues,
|
|
1496
|
-
clearValues: headerFilters.clearValues,
|
|
1497
|
-
applyText: headerFilters.applyText,
|
|
1498
|
-
applyNumber: headerFilters.applyNumber,
|
|
1499
|
-
applyDate: headerFilters.applyDate,
|
|
1500
|
-
clear: headerFilters.clear,
|
|
1501
|
-
},
|
|
1502
|
-
},
|
|
1503
|
-
bindings: {
|
|
1504
|
-
...baseResult.bindings,
|
|
1505
|
-
cellSelection: createCellSelectionBindings,
|
|
1506
|
-
rangeHandle: createRangeHandleBindings,
|
|
1507
|
-
rangeSurface: createRangeSurfaceBindings,
|
|
1508
|
-
columnResizeHandle: createColumnResizeHandleBindings,
|
|
1509
|
-
rowResizeHandle: createRowResizeHandleBindings,
|
|
1510
|
-
contextMenuAction: (actionId, options = {}) => ({
|
|
1511
|
-
onClick: () => {
|
|
1512
|
-
void runContextMenuActionWithParity(actionId).then(result => {
|
|
1513
|
-
options.onResult?.(result);
|
|
1514
|
-
});
|
|
1515
|
-
},
|
|
1516
|
-
}),
|
|
1517
|
-
},
|
|
1518
|
-
pagination: {
|
|
1519
|
-
snapshot: paginationSnapshot,
|
|
1520
|
-
set: setPagination,
|
|
1521
|
-
setPageSize,
|
|
1522
|
-
setCurrentPage,
|
|
1523
|
-
goToNextPage,
|
|
1524
|
-
goToPreviousPage,
|
|
1525
|
-
goToFirstPage,
|
|
1526
|
-
goToLastPage,
|
|
1527
|
-
refresh: refreshPaginationSnapshot,
|
|
1528
|
-
},
|
|
1529
|
-
columnState: {
|
|
1530
|
-
snapshot: columnStateSnapshot,
|
|
1531
|
-
setOrder: setColumnOrder,
|
|
1532
|
-
setVisibility: setColumnVisibility,
|
|
1533
|
-
setWidth: setColumnWidth,
|
|
1534
|
-
setPin: setColumnPin,
|
|
1535
|
-
capture: refreshColumnStateSnapshot,
|
|
1536
|
-
apply: applyColumnStateSnapshot,
|
|
1537
|
-
refresh: refreshColumnStateSnapshot,
|
|
1538
|
-
},
|
|
1539
|
-
history: {
|
|
1540
|
-
supported: historySupported,
|
|
1541
|
-
snapshot: historySnapshot,
|
|
1542
|
-
canUndo,
|
|
1543
|
-
canRedo,
|
|
1544
|
-
refresh: refreshHistorySnapshot,
|
|
1545
|
-
undo,
|
|
1546
|
-
redo,
|
|
1547
|
-
},
|
|
1548
|
-
rowReorder: {
|
|
1549
|
-
supported: rowReorderSupported,
|
|
1550
|
-
canReorder: canReorderRows,
|
|
1551
|
-
reason: rowReorderReason,
|
|
1552
|
-
moveByIndex: moveRowsByIndex,
|
|
1553
|
-
moveByKey: moveRowsByKey,
|
|
1554
|
-
},
|
|
1555
|
-
};
|
|
1556
|
-
}
|