@nu-grid/nuxt 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE.md +21 -0
- package/README.md +261 -0
- package/dist/module.d.mts +13 -0
- package/dist/module.json +9 -0
- package/dist/module.mjs +52 -0
- package/dist/runtime/cell-types/action-menu/ActionMenuRenderer.d.vue.ts +12 -0
- package/dist/runtime/cell-types/action-menu/ActionMenuRenderer.vue +123 -0
- package/dist/runtime/cell-types/action-menu/ActionMenuRenderer.vue.d.ts +12 -0
- package/dist/runtime/cell-types/action-menu/index.d.ts +8 -0
- package/dist/runtime/cell-types/action-menu/index.js +28 -0
- package/dist/runtime/cell-types/boolean/BooleanEditor.d.vue.ts +15 -0
- package/dist/runtime/cell-types/boolean/BooleanEditor.vue +32 -0
- package/dist/runtime/cell-types/boolean/BooleanEditor.vue.d.ts +15 -0
- package/dist/runtime/cell-types/boolean/BooleanFilter.d.vue.ts +7 -0
- package/dist/runtime/cell-types/boolean/BooleanFilter.vue +42 -0
- package/dist/runtime/cell-types/boolean/BooleanFilter.vue.d.ts +7 -0
- package/dist/runtime/cell-types/boolean/BooleanRenderer.d.vue.ts +13 -0
- package/dist/runtime/cell-types/boolean/BooleanRenderer.vue +23 -0
- package/dist/runtime/cell-types/boolean/BooleanRenderer.vue.d.ts +13 -0
- package/dist/runtime/cell-types/boolean/index.d.ts +8 -0
- package/dist/runtime/cell-types/boolean/index.js +31 -0
- package/dist/runtime/cell-types/currency/CurrencyEditor.d.vue.ts +15 -0
- package/dist/runtime/cell-types/currency/CurrencyEditor.vue +40 -0
- package/dist/runtime/cell-types/currency/CurrencyEditor.vue.d.ts +15 -0
- package/dist/runtime/cell-types/currency/CurrencyFilter.d.vue.ts +7 -0
- package/dist/runtime/cell-types/currency/CurrencyFilter.vue +76 -0
- package/dist/runtime/cell-types/currency/CurrencyFilter.vue.d.ts +7 -0
- package/dist/runtime/cell-types/currency/index.d.ts +6 -0
- package/dist/runtime/cell-types/currency/index.js +42 -0
- package/dist/runtime/cell-types/date/DateEditor.d.vue.ts +15 -0
- package/dist/runtime/cell-types/date/DateEditor.vue +42 -0
- package/dist/runtime/cell-types/date/DateEditor.vue.d.ts +15 -0
- package/dist/runtime/cell-types/date/DateFilter.d.vue.ts +7 -0
- package/dist/runtime/cell-types/date/DateFilter.vue +58 -0
- package/dist/runtime/cell-types/date/DateFilter.vue.d.ts +7 -0
- package/dist/runtime/cell-types/date/index.d.ts +6 -0
- package/dist/runtime/cell-types/date/index.js +13 -0
- package/dist/runtime/cell-types/index.d.ts +17 -0
- package/dist/runtime/cell-types/index.js +34 -0
- package/dist/runtime/cell-types/lookup/LookupEditor.d.vue.ts +15 -0
- package/dist/runtime/cell-types/lookup/LookupEditor.vue +291 -0
- package/dist/runtime/cell-types/lookup/LookupEditor.vue.d.ts +15 -0
- package/dist/runtime/cell-types/lookup/LookupRenderer.d.vue.ts +8 -0
- package/dist/runtime/cell-types/lookup/LookupRenderer.vue +43 -0
- package/dist/runtime/cell-types/lookup/LookupRenderer.vue.d.ts +8 -0
- package/dist/runtime/cell-types/lookup/index.d.ts +36 -0
- package/dist/runtime/cell-types/lookup/index.js +50 -0
- package/dist/runtime/cell-types/number/NumberEditor.d.vue.ts +15 -0
- package/dist/runtime/cell-types/number/NumberEditor.vue +34 -0
- package/dist/runtime/cell-types/number/NumberEditor.vue.d.ts +15 -0
- package/dist/runtime/cell-types/number/NumberFilter.d.vue.ts +7 -0
- package/dist/runtime/cell-types/number/NumberFilter.vue +66 -0
- package/dist/runtime/cell-types/number/NumberFilter.vue.d.ts +7 -0
- package/dist/runtime/cell-types/number/index.d.ts +6 -0
- package/dist/runtime/cell-types/number/index.js +13 -0
- package/dist/runtime/cell-types/rating/RatingEditor.d.vue.ts +15 -0
- package/dist/runtime/cell-types/rating/RatingEditor.vue +219 -0
- package/dist/runtime/cell-types/rating/RatingEditor.vue.d.ts +15 -0
- package/dist/runtime/cell-types/rating/RatingFilter.d.vue.ts +7 -0
- package/dist/runtime/cell-types/rating/RatingFilter.vue +74 -0
- package/dist/runtime/cell-types/rating/RatingFilter.vue.d.ts +7 -0
- package/dist/runtime/cell-types/rating/RatingRenderer.d.vue.ts +10 -0
- package/dist/runtime/cell-types/rating/RatingRenderer.vue +75 -0
- package/dist/runtime/cell-types/rating/RatingRenderer.vue.d.ts +10 -0
- package/dist/runtime/cell-types/rating/index.d.ts +6 -0
- package/dist/runtime/cell-types/rating/index.js +67 -0
- package/dist/runtime/cell-types/selection/SelectionEditor.d.vue.ts +15 -0
- package/dist/runtime/cell-types/selection/SelectionEditor.vue +42 -0
- package/dist/runtime/cell-types/selection/SelectionEditor.vue.d.ts +15 -0
- package/dist/runtime/cell-types/selection/SelectionRenderer.d.vue.ts +14 -0
- package/dist/runtime/cell-types/selection/SelectionRenderer.vue +25 -0
- package/dist/runtime/cell-types/selection/SelectionRenderer.vue.d.ts +14 -0
- package/dist/runtime/cell-types/selection/index.d.ts +8 -0
- package/dist/runtime/cell-types/selection/index.js +36 -0
- package/dist/runtime/cell-types/text/TextEditor.d.vue.ts +15 -0
- package/dist/runtime/cell-types/text/TextEditor.vue +70 -0
- package/dist/runtime/cell-types/text/TextEditor.vue.d.ts +15 -0
- package/dist/runtime/cell-types/text/TextFilter.d.vue.ts +7 -0
- package/dist/runtime/cell-types/text/TextFilter.vue +50 -0
- package/dist/runtime/cell-types/text/TextFilter.vue.d.ts +7 -0
- package/dist/runtime/cell-types/text/TextareaEditor.d.vue.ts +15 -0
- package/dist/runtime/cell-types/text/TextareaEditor.vue +100 -0
- package/dist/runtime/cell-types/text/TextareaEditor.vue.d.ts +15 -0
- package/dist/runtime/cell-types/text/index.d.ts +10 -0
- package/dist/runtime/cell-types/text/index.js +16 -0
- package/dist/runtime/cell-types/text/textarea.d.ts +13 -0
- package/dist/runtime/cell-types/text/textarea.js +13 -0
- package/dist/runtime/components/NuGrid.d.vue.ts +96 -0
- package/dist/runtime/components/NuGrid.vue +651 -0
- package/dist/runtime/components/NuGrid.vue.d.ts +96 -0
- package/dist/runtime/components/NuGridCellCheckbox.d.vue.ts +24 -0
- package/dist/runtime/components/NuGridCellCheckbox.vue +105 -0
- package/dist/runtime/components/NuGridCellCheckbox.vue.d.ts +24 -0
- package/dist/runtime/components/NuGridGroup.d.vue.ts +20 -0
- package/dist/runtime/components/NuGridGroup.vue +650 -0
- package/dist/runtime/components/NuGridGroup.vue.d.ts +20 -0
- package/dist/runtime/components/NuGridLazyCell.d.vue.ts +62 -0
- package/dist/runtime/components/NuGridLazyCell.vue +133 -0
- package/dist/runtime/components/NuGridLazyCell.vue.d.ts +62 -0
- package/dist/runtime/components/_internal/NuGridAddRow.d.vue.ts +36 -0
- package/dist/runtime/components/_internal/NuGridAddRow.vue +144 -0
- package/dist/runtime/components/_internal/NuGridAddRow.vue.d.ts +36 -0
- package/dist/runtime/components/_internal/NuGridBase.d.vue.ts +20 -0
- package/dist/runtime/components/_internal/NuGridBase.vue +1172 -0
- package/dist/runtime/components/_internal/NuGridBase.vue.d.ts +20 -0
- package/dist/runtime/components/_internal/NuGridCellContent.d.vue.ts +9 -0
- package/dist/runtime/components/_internal/NuGridCellContent.vue +202 -0
- package/dist/runtime/components/_internal/NuGridCellContent.vue.d.ts +9 -0
- package/dist/runtime/components/_internal/NuGridColumnMenu.d.vue.ts +25 -0
- package/dist/runtime/components/_internal/NuGridColumnMenu.vue +391 -0
- package/dist/runtime/components/_internal/NuGridColumnMenu.vue.d.ts +25 -0
- package/dist/runtime/components/_internal/NuGridGroup.d.vue.ts +20 -0
- package/dist/runtime/components/_internal/NuGridGroup.vue +650 -0
- package/dist/runtime/components/_internal/NuGridGroup.vue.d.ts +20 -0
- package/dist/runtime/components/_internal/NuGridGroupCheckbox.d.vue.ts +22 -0
- package/dist/runtime/components/_internal/NuGridGroupCheckbox.vue +132 -0
- package/dist/runtime/components/_internal/NuGridGroupCheckbox.vue.d.ts +22 -0
- package/dist/runtime/components/_internal/NuGridHeaderSortButton.d.vue.ts +31 -0
- package/dist/runtime/components/_internal/NuGridHeaderSortButton.vue +61 -0
- package/dist/runtime/components/_internal/NuGridHeaderSortButton.vue.d.ts +31 -0
- package/dist/runtime/components/_internal/NuGridPaging.d.vue.ts +3 -0
- package/dist/runtime/components/_internal/NuGridPaging.vue +65 -0
- package/dist/runtime/components/_internal/NuGridPaging.vue.d.ts +3 -0
- package/dist/runtime/components/_internal/NuGridRow.d.vue.ts +40 -0
- package/dist/runtime/components/_internal/NuGridRow.vue +645 -0
- package/dist/runtime/components/_internal/NuGridRow.vue.d.ts +40 -0
- package/dist/runtime/components/_internal/NuGridSplitGroup.d.vue.ts +20 -0
- package/dist/runtime/components/_internal/NuGridSplitGroup.vue +735 -0
- package/dist/runtime/components/_internal/NuGridSplitGroup.vue.d.ts +20 -0
- package/dist/runtime/components/_internal/NuGridTooltip.d.vue.ts +3 -0
- package/dist/runtime/components/_internal/NuGridTooltip.vue +36 -0
- package/dist/runtime/components/_internal/NuGridTooltip.vue.d.ts +3 -0
- package/dist/runtime/composables/_internal/index.d.ts +31 -0
- package/dist/runtime/composables/_internal/index.js +28 -0
- package/dist/runtime/composables/_internal/keyboard-handlers/index.d.ts +5 -0
- package/dist/runtime/composables/_internal/keyboard-handlers/index.js +9 -0
- package/dist/runtime/composables/_internal/keyboard-handlers/useKeyboardCellTypeDispatch.d.ts +18 -0
- package/dist/runtime/composables/_internal/keyboard-handlers/useKeyboardCellTypeDispatch.js +53 -0
- package/dist/runtime/composables/_internal/keyboard-handlers/useKeyboardEditingTriggers.d.ts +12 -0
- package/dist/runtime/composables/_internal/keyboard-handlers/useKeyboardEditingTriggers.js +53 -0
- package/dist/runtime/composables/_internal/keyboard-handlers/useKeyboardNavigation.d.ts +9 -0
- package/dist/runtime/composables/_internal/keyboard-handlers/useKeyboardNavigation.js +35 -0
- package/dist/runtime/composables/_internal/keyboard-handlers/useKeyboardSetup.d.ts +33 -0
- package/dist/runtime/composables/_internal/keyboard-handlers/useKeyboardSetup.js +111 -0
- package/dist/runtime/composables/_internal/keyboard-handlers/usePagingKeyboard.d.ts +11 -0
- package/dist/runtime/composables/_internal/keyboard-handlers/usePagingKeyboard.js +67 -0
- package/dist/runtime/composables/_internal/useNuGridActionMenu.d.ts +15 -0
- package/dist/runtime/composables/_internal/useNuGridActionMenu.js +137 -0
- package/dist/runtime/composables/_internal/useNuGridAddRow.d.ts +39 -0
- package/dist/runtime/composables/_internal/useNuGridAddRow.js +735 -0
- package/dist/runtime/composables/_internal/useNuGridAnimation.d.ts +33 -0
- package/dist/runtime/composables/_internal/useNuGridAnimation.js +178 -0
- package/dist/runtime/composables/_internal/useNuGridAutosize.d.ts +14 -0
- package/dist/runtime/composables/_internal/useNuGridAutosize.js +161 -0
- package/dist/runtime/composables/_internal/useNuGridCellEditing.d.ts +15 -0
- package/dist/runtime/composables/_internal/useNuGridCellEditing.js +1243 -0
- package/dist/runtime/composables/_internal/useNuGridColumnDragDrop.d.ts +8 -0
- package/dist/runtime/composables/_internal/useNuGridColumnDragDrop.js +148 -0
- package/dist/runtime/composables/_internal/useNuGridColumnPinning.d.ts +15 -0
- package/dist/runtime/composables/_internal/useNuGridColumnPinning.js +44 -0
- package/dist/runtime/composables/_internal/useNuGridColumnResize.d.ts +22 -0
- package/dist/runtime/composables/_internal/useNuGridColumnResize.js +427 -0
- package/dist/runtime/composables/_internal/useNuGridCore.d.ts +62 -0
- package/dist/runtime/composables/_internal/useNuGridCore.js +359 -0
- package/dist/runtime/composables/_internal/useNuGridExcel.d.ts +60 -0
- package/dist/runtime/composables/_internal/useNuGridExcel.js +35 -0
- package/dist/runtime/composables/_internal/useNuGridFocus.d.ts +15 -0
- package/dist/runtime/composables/_internal/useNuGridFocus.js +1378 -0
- package/dist/runtime/composables/_internal/useNuGridGroupSelection.d.ts +13 -0
- package/dist/runtime/composables/_internal/useNuGridGroupSelection.js +38 -0
- package/dist/runtime/composables/_internal/useNuGridGrouping.d.ts +28 -0
- package/dist/runtime/composables/_internal/useNuGridGrouping.js +211 -0
- package/dist/runtime/composables/_internal/useNuGridInteractionRouter.d.ts +9 -0
- package/dist/runtime/composables/_internal/useNuGridInteractionRouter.js +441 -0
- package/dist/runtime/composables/_internal/useNuGridInteractions.d.ts +10 -0
- package/dist/runtime/composables/_internal/useNuGridInteractions.js +36 -0
- package/dist/runtime/composables/_internal/useNuGridKeyboardNavigation.d.ts +54 -0
- package/dist/runtime/composables/_internal/useNuGridKeyboardNavigation.js +407 -0
- package/dist/runtime/composables/_internal/useNuGridPaging.d.ts +76 -0
- package/dist/runtime/composables/_internal/useNuGridPaging.js +147 -0
- package/dist/runtime/composables/_internal/useNuGridRowDragDrop.d.ts +68 -0
- package/dist/runtime/composables/_internal/useNuGridRowDragDrop.js +295 -0
- package/dist/runtime/composables/_internal/useNuGridRowSelection.d.ts +14 -0
- package/dist/runtime/composables/_internal/useNuGridRowSelection.js +214 -0
- package/dist/runtime/composables/_internal/useNuGridScroll.d.ts +110 -0
- package/dist/runtime/composables/_internal/useNuGridScroll.js +463 -0
- package/dist/runtime/composables/_internal/useNuGridScrollState.d.ts +32 -0
- package/dist/runtime/composables/_internal/useNuGridScrollState.js +60 -0
- package/dist/runtime/composables/_internal/useNuGridScrollbars.d.ts +24 -0
- package/dist/runtime/composables/_internal/useNuGridScrollbars.js +69 -0
- package/dist/runtime/composables/_internal/useNuGridStatePersistence.d.ts +27 -0
- package/dist/runtime/composables/_internal/useNuGridStatePersistence.js +243 -0
- package/dist/runtime/composables/_internal/useNuGridTooltip.d.ts +41 -0
- package/dist/runtime/composables/_internal/useNuGridTooltip.js +304 -0
- package/dist/runtime/composables/_internal/useNuGridUI.d.ts +3283 -0
- package/dist/runtime/composables/_internal/useNuGridUI.js +58 -0
- package/dist/runtime/composables/_internal/useNuGridVirtualization.d.ts +75 -0
- package/dist/runtime/composables/_internal/useNuGridVirtualization.js +534 -0
- package/dist/runtime/composables/_internal/useNuGridWheelSmoothing.d.ts +25 -0
- package/dist/runtime/composables/_internal/useNuGridWheelSmoothing.js +157 -0
- package/dist/runtime/composables/index.d.ts +3 -0
- package/dist/runtime/composables/index.js +2 -0
- package/dist/runtime/composables/useNuGridCellEditor.d.ts +91 -0
- package/dist/runtime/composables/useNuGridCellEditor.js +82 -0
- package/dist/runtime/composables/useNuGridCellTypeRegistry.d.ts +85 -0
- package/dist/runtime/composables/useNuGridCellTypeRegistry.js +202 -0
- package/dist/runtime/config/_internal/index.d.ts +5 -0
- package/dist/runtime/config/_internal/index.js +2 -0
- package/dist/runtime/config/_internal/options-defaults.d.ts +121 -0
- package/dist/runtime/config/_internal/options-defaults.js +121 -0
- package/dist/runtime/config/_internal/prop-utils.d.ts +54 -0
- package/dist/runtime/config/_internal/prop-utils.js +21 -0
- package/dist/runtime/config/config.d.ts +44 -0
- package/dist/runtime/config/config.js +18 -0
- package/dist/runtime/config/index.d.ts +2 -0
- package/dist/runtime/config/index.js +2 -0
- package/dist/runtime/config/presets.d.ts +15 -0
- package/dist/runtime/config/presets.js +58 -0
- package/dist/runtime/index.css +1 -0
- package/dist/runtime/index.d.ts +1 -0
- package/dist/runtime/index.js +1 -0
- package/dist/runtime/plugin.d.ts +5 -0
- package/dist/runtime/plugin.js +10 -0
- package/dist/runtime/themes/index.d.ts +56 -0
- package/dist/runtime/themes/index.js +68 -0
- package/dist/runtime/themes/nuGridTheme.d.ts +329 -0
- package/dist/runtime/themes/nuGridTheme.js +236 -0
- package/dist/runtime/themes/nuGridThemeCompact.d.ts +331 -0
- package/dist/runtime/themes/nuGridThemeCompact.js +236 -0
- package/dist/runtime/types/_internal/action-menu.d.ts +55 -0
- package/dist/runtime/types/_internal/action-menu.js +0 -0
- package/dist/runtime/types/_internal/cell-editing.d.ts +75 -0
- package/dist/runtime/types/_internal/cell-editing.js +0 -0
- package/dist/runtime/types/_internal/composable-returns.d.ts +52 -0
- package/dist/runtime/types/_internal/composable-returns.js +0 -0
- package/dist/runtime/types/_internal/config.d.ts +16 -0
- package/dist/runtime/types/_internal/config.js +0 -0
- package/dist/runtime/types/_internal/contexts/add-row.d.ts +25 -0
- package/dist/runtime/types/_internal/contexts/add-row.js +0 -0
- package/dist/runtime/types/_internal/contexts/animation.d.ts +24 -0
- package/dist/runtime/types/_internal/contexts/animation.js +0 -0
- package/dist/runtime/types/_internal/contexts/core.d.ts +24 -0
- package/dist/runtime/types/_internal/contexts/core.js +0 -0
- package/dist/runtime/types/_internal/contexts/drag.d.ts +13 -0
- package/dist/runtime/types/_internal/contexts/drag.js +0 -0
- package/dist/runtime/types/_internal/contexts/focus.d.ts +11 -0
- package/dist/runtime/types/_internal/contexts/focus.js +0 -0
- package/dist/runtime/types/_internal/contexts/grouping.d.ts +9 -0
- package/dist/runtime/types/_internal/contexts/grouping.js +0 -0
- package/dist/runtime/types/_internal/contexts/index.d.ts +15 -0
- package/dist/runtime/types/_internal/contexts/index.js +0 -0
- package/dist/runtime/types/_internal/contexts/interaction-router.d.ts +5 -0
- package/dist/runtime/types/_internal/contexts/interaction-router.js +0 -0
- package/dist/runtime/types/_internal/contexts/multi-row.d.ts +40 -0
- package/dist/runtime/types/_internal/contexts/multi-row.js +0 -0
- package/dist/runtime/types/_internal/contexts/paging.d.ts +39 -0
- package/dist/runtime/types/_internal/contexts/paging.js +0 -0
- package/dist/runtime/types/_internal/contexts/performance.d.ts +15 -0
- package/dist/runtime/types/_internal/contexts/performance.js +0 -0
- package/dist/runtime/types/_internal/contexts/resize.d.ts +12 -0
- package/dist/runtime/types/_internal/contexts/resize.js +0 -0
- package/dist/runtime/types/_internal/contexts/row-interactions.d.ts +12 -0
- package/dist/runtime/types/_internal/contexts/row-interactions.js +0 -0
- package/dist/runtime/types/_internal/contexts/scroll-state.d.ts +21 -0
- package/dist/runtime/types/_internal/contexts/scroll-state.js +0 -0
- package/dist/runtime/types/_internal/contexts/ui-config.d.ts +21 -0
- package/dist/runtime/types/_internal/contexts/ui-config.js +0 -0
- package/dist/runtime/types/_internal/contexts/virtualization.d.ts +16 -0
- package/dist/runtime/types/_internal/contexts/virtualization.js +0 -0
- package/dist/runtime/types/_internal/drag-drop.d.ts +48 -0
- package/dist/runtime/types/_internal/drag-drop.js +0 -0
- package/dist/runtime/types/_internal/focus.d.ts +68 -0
- package/dist/runtime/types/_internal/focus.js +0 -0
- package/dist/runtime/types/_internal/grouping.d.ts +48 -0
- package/dist/runtime/types/_internal/grouping.js +0 -0
- package/dist/runtime/types/_internal/index.d.ts +37 -0
- package/dist/runtime/types/_internal/index.js +2 -0
- package/dist/runtime/types/_internal/interaction-router.d.ts +176 -0
- package/dist/runtime/types/_internal/interaction-router.js +39 -0
- package/dist/runtime/types/_internal/props.d.ts +28 -0
- package/dist/runtime/types/_internal/props.js +0 -0
- package/dist/runtime/types/_internal/resize.d.ts +37 -0
- package/dist/runtime/types/_internal/resize.js +0 -0
- package/dist/runtime/types/_internal/row-interactions.d.ts +15 -0
- package/dist/runtime/types/_internal/row-interactions.js +0 -0
- package/dist/runtime/types/_internal/row-selection.d.ts +27 -0
- package/dist/runtime/types/_internal/row-selection.js +0 -0
- package/dist/runtime/types/_internal/states.d.ts +24 -0
- package/dist/runtime/types/_internal/states.js +0 -0
- package/dist/runtime/types/_internal/sticky-headers.d.ts +10 -0
- package/dist/runtime/types/_internal/sticky-headers.js +0 -0
- package/dist/runtime/types/_internal/validation.d.ts +54 -0
- package/dist/runtime/types/_internal/validation.js +0 -0
- package/dist/runtime/types/_internal/virtualization.d.ts +114 -0
- package/dist/runtime/types/_internal/virtualization.js +0 -0
- package/dist/runtime/types/action-menu.d.ts +62 -0
- package/dist/runtime/types/action-menu.js +0 -0
- package/dist/runtime/types/autosize.d.ts +8 -0
- package/dist/runtime/types/autosize.js +0 -0
- package/dist/runtime/types/cells.d.ts +292 -0
- package/dist/runtime/types/cells.js +5 -0
- package/dist/runtime/types/column.d.ts +248 -0
- package/dist/runtime/types/column.js +0 -0
- package/dist/runtime/types/config.d.ts +35 -0
- package/dist/runtime/types/config.js +0 -0
- package/dist/runtime/types/drag-drop.d.ts +92 -0
- package/dist/runtime/types/drag-drop.js +0 -0
- package/dist/runtime/types/events.d.ts +164 -0
- package/dist/runtime/types/events.js +1 -0
- package/dist/runtime/types/focus.d.ts +50 -0
- package/dist/runtime/types/focus.js +0 -0
- package/dist/runtime/types/grouping.d.ts +7 -0
- package/dist/runtime/types/grouping.js +0 -0
- package/dist/runtime/types/index.d.ts +15 -0
- package/dist/runtime/types/index.js +0 -0
- package/dist/runtime/types/option-groups.d.ts +624 -0
- package/dist/runtime/types/option-groups.js +0 -0
- package/dist/runtime/types/props.d.ts +418 -0
- package/dist/runtime/types/props.js +0 -0
- package/dist/runtime/types/resize.d.ts +14 -0
- package/dist/runtime/types/resize.js +0 -0
- package/dist/runtime/types/row-interactions.d.ts +11 -0
- package/dist/runtime/types/row-interactions.js +0 -0
- package/dist/runtime/types/row-selection.d.ts +48 -0
- package/dist/runtime/types/row-selection.js +0 -0
- package/dist/runtime/types/row.d.ts +7 -0
- package/dist/runtime/types/row.js +0 -0
- package/dist/runtime/types/sort-icon.d.ts +35 -0
- package/dist/runtime/types/sort-icon.js +0 -0
- package/dist/runtime/types/states.d.ts +17 -0
- package/dist/runtime/types/states.js +0 -0
- package/dist/runtime/types/sticky-headers.d.ts +6 -0
- package/dist/runtime/types/sticky-headers.js +0 -0
- package/dist/runtime/types/tanstack-table.d.ts +126 -0
- package/dist/runtime/types/theme.d.ts +22 -0
- package/dist/runtime/types/theme.js +0 -0
- package/dist/runtime/types/validation.d.ts +94 -0
- package/dist/runtime/types/validation.js +0 -0
- package/dist/runtime/utils/columnHelper.d.ts +208 -0
- package/dist/runtime/utils/columnHelper.js +23 -0
- package/dist/runtime/utils/excelExport.d.ts +63 -0
- package/dist/runtime/utils/excelExport.js +297 -0
- package/dist/runtime/utils/index.d.ts +2 -0
- package/dist/runtime/utils/index.js +2 -0
- package/dist/runtime/utils/standardSchema.d.ts +77 -0
- package/dist/runtime/utils/standardSchema.js +141 -0
- package/dist/types.d.mts +3 -0
- package/package.json +117 -0
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import baseCheckboxTheme from "#build/ui/checkbox";
|
|
2
|
+
import { useAppConfig } from "#imports";
|
|
3
|
+
import { tv } from "@nuxt/ui/runtime/utils/tv.js";
|
|
4
|
+
import { twMerge } from "tailwind-merge";
|
|
5
|
+
import { computed } from "vue";
|
|
6
|
+
import { getTheme } from "../../themes/index.js";
|
|
7
|
+
export function useNuGridUI(props) {
|
|
8
|
+
const appConfig = useAppConfig();
|
|
9
|
+
const ui = computed(() => {
|
|
10
|
+
const themeName = props.theme || "default";
|
|
11
|
+
const themeDefinition = getTheme(themeName);
|
|
12
|
+
if (!themeDefinition) {
|
|
13
|
+
if (import.meta.dev) {
|
|
14
|
+
console.warn(`[NuGrid] Theme "${themeName}" not found. Using "default" theme.`);
|
|
15
|
+
}
|
|
16
|
+
const defaultThemeDef = getTheme("default");
|
|
17
|
+
const virtualization2 = props.virtualization;
|
|
18
|
+
return tv({ extend: tv(defaultThemeDef.theme), ...appConfig.ui?.table || {} })({
|
|
19
|
+
sticky: virtualization2 ? false : props.sticky,
|
|
20
|
+
loading: props.loading,
|
|
21
|
+
loadingColor: props.loadingColor,
|
|
22
|
+
loadingAnimation: props.loadingAnimation,
|
|
23
|
+
virtualize: !!virtualization2
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
const selectedTheme = themeDefinition.theme;
|
|
27
|
+
const virtualization = props.virtualization;
|
|
28
|
+
return tv({ extend: tv(selectedTheme), ...appConfig.ui?.table || {} })({
|
|
29
|
+
sticky: virtualization ? false : props.sticky,
|
|
30
|
+
loading: props.loading,
|
|
31
|
+
loadingColor: props.loadingColor,
|
|
32
|
+
loadingAnimation: props.loadingAnimation,
|
|
33
|
+
virtualize: !!virtualization
|
|
34
|
+
});
|
|
35
|
+
});
|
|
36
|
+
const checkboxTheme = computed(() => {
|
|
37
|
+
const themeName = props.theme || "default";
|
|
38
|
+
const themeDefinition = getTheme(themeName) || getTheme("default");
|
|
39
|
+
const selectedTheme = themeDefinition.theme;
|
|
40
|
+
return {
|
|
41
|
+
...baseCheckboxTheme,
|
|
42
|
+
slots: {
|
|
43
|
+
...baseCheckboxTheme.slots,
|
|
44
|
+
base: twMerge(baseCheckboxTheme.slots.base, selectedTheme.slots.checkboxBase),
|
|
45
|
+
indicator: twMerge(
|
|
46
|
+
baseCheckboxTheme.slots.indicator,
|
|
47
|
+
selectedTheme.slots.checkboxIndicator
|
|
48
|
+
),
|
|
49
|
+
container: twMerge(
|
|
50
|
+
baseCheckboxTheme.slots.container,
|
|
51
|
+
selectedTheme.slots.checkboxContainer
|
|
52
|
+
),
|
|
53
|
+
icon: twMerge(baseCheckboxTheme.slots.icon, selectedTheme.slots.checkboxIcon)
|
|
54
|
+
}
|
|
55
|
+
};
|
|
56
|
+
});
|
|
57
|
+
return { ui, checkboxTheme };
|
|
58
|
+
}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import type { TableData } from '@nuxt/ui';
|
|
2
|
+
import type { Row, Table } from '@tanstack/vue-table';
|
|
3
|
+
import type { Primitive } from 'reka-ui';
|
|
4
|
+
import type { ComputedRef, MaybeRefOrGetter, Ref } from 'vue';
|
|
5
|
+
import type { NuGridProps } from '../../types/index.js';
|
|
6
|
+
import type { GroupingVirtualRowHeights, GroupVirtualRowItem, GroupVirtualRowType, NuGridVirtualizer, NuGridVirtualizerOptions, ResolvedNuGridVirtualizeOptions } from '../../types/_internal/index.js';
|
|
7
|
+
export type { GroupVirtualRowItem, GroupVirtualRowType };
|
|
8
|
+
/**
|
|
9
|
+
* Resolve virtualization options using centralized defaults.
|
|
10
|
+
* Handles boolean toggles, explicit enable/disable, breakpoint-aware overscan, and dynamic row height heuristics.
|
|
11
|
+
*/
|
|
12
|
+
export declare function resolveVirtualizationOptions(virtualization: boolean | NuGridVirtualizerOptions | undefined, defaultEstimateSize?: number, currentBreakpoint?: string): ResolvedNuGridVirtualizeOptions;
|
|
13
|
+
interface SharedVirtualizerResult<T extends TableData = TableData> {
|
|
14
|
+
virtualizer: Ref<NuGridVirtualizer> | null;
|
|
15
|
+
virtualizationEnabled: ComputedRef<boolean>;
|
|
16
|
+
activeStickyIndexes: Ref<number[]>;
|
|
17
|
+
activeStickyHeight: ComputedRef<number>;
|
|
18
|
+
virtualRowItems: ComputedRef<GroupVirtualRowItem<T>[]>;
|
|
19
|
+
measuredVirtualSizes: ComputedRef<Map<number, number> | null>;
|
|
20
|
+
getVirtualItemHeight: (index: number) => number;
|
|
21
|
+
stickyOffsets: ComputedRef<Map<number, number>>;
|
|
22
|
+
}
|
|
23
|
+
export interface UseNuGridGroupVirtualizationOptions<T extends TableData> {
|
|
24
|
+
props: MaybeRefOrGetter<NuGridProps<T>>;
|
|
25
|
+
tableApi: Table<T>;
|
|
26
|
+
rootRef: Ref<InstanceType<typeof Primitive> | null | undefined>;
|
|
27
|
+
stickyEnabled?: Ref<boolean>;
|
|
28
|
+
groupRows: ComputedRef<Row<T>[]>;
|
|
29
|
+
groupedRows: ComputedRef<Record<string, Row<T>[]>>;
|
|
30
|
+
isGroupExpanded: (groupId: string) => boolean;
|
|
31
|
+
topLevelRows: ComputedRef<Row<T>[]>;
|
|
32
|
+
addRowOptions?: {
|
|
33
|
+
addRowPosition: Ref<'top' | 'bottom' | 'none'>;
|
|
34
|
+
getAddRowForGroup?: (groupId: string) => Row<T> | null;
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
export declare function useNuGridGroupVirtualization<T extends TableData>(options: UseNuGridGroupVirtualizationOptions<T>): {
|
|
38
|
+
groupingRowHeights: ComputedRef<Required<GroupingVirtualRowHeights>>;
|
|
39
|
+
headerGroupCount: ComputedRef<number>;
|
|
40
|
+
virtualRowItems: ComputedRef<GroupVirtualRowItem<T>[]>;
|
|
41
|
+
virtualizer: Ref<NuGridVirtualizer<Element, Element>, NuGridVirtualizer<Element, Element>> | null;
|
|
42
|
+
virtualizationEnabled: ComputedRef<boolean>;
|
|
43
|
+
activeStickyIndexes: Ref<number[], number[]>;
|
|
44
|
+
activeStickyHeight: ComputedRef<number>;
|
|
45
|
+
measuredVirtualSizes: ComputedRef<Map<number, number> | null>;
|
|
46
|
+
getVirtualItemHeight: (index: number) => number;
|
|
47
|
+
stickyOffsets: ComputedRef<Map<number, number>>;
|
|
48
|
+
};
|
|
49
|
+
/**
|
|
50
|
+
* Virtualization for large datasets (non-grouped grids)
|
|
51
|
+
*/
|
|
52
|
+
export interface UseNuGridVirtualizationOptions<T extends TableData> {
|
|
53
|
+
props: MaybeRefOrGetter<NuGridProps<T>>;
|
|
54
|
+
rows: ComputedRef<Row<T>[]>;
|
|
55
|
+
tableApi: Table<T>;
|
|
56
|
+
rootRef: Ref<InstanceType<typeof Primitive> | null | undefined>;
|
|
57
|
+
stickyEnabled?: Ref<boolean>;
|
|
58
|
+
hasFooter?: MaybeRefOrGetter<boolean>;
|
|
59
|
+
}
|
|
60
|
+
export declare function useNuGridVirtualization<T extends TableData>(options: UseNuGridVirtualizationOptions<T>): SharedVirtualizerResult<T>;
|
|
61
|
+
/**
|
|
62
|
+
* Virtualization for standard group mode (column headers once at top, group subheaders between rows)
|
|
63
|
+
*/
|
|
64
|
+
export declare function useNuGridStandardGroupVirtualization<T extends TableData>(options: UseNuGridGroupVirtualizationOptions<T>): {
|
|
65
|
+
groupingRowHeights: ComputedRef<Required<GroupingVirtualRowHeights>>;
|
|
66
|
+
headerGroupCount: ComputedRef<number>;
|
|
67
|
+
virtualRowItems: ComputedRef<GroupVirtualRowItem<T>[]>;
|
|
68
|
+
virtualizer: Ref<NuGridVirtualizer<Element, Element>, NuGridVirtualizer<Element, Element>> | null;
|
|
69
|
+
virtualizationEnabled: ComputedRef<boolean>;
|
|
70
|
+
activeStickyIndexes: Ref<number[], number[]>;
|
|
71
|
+
activeStickyHeight: ComputedRef<number>;
|
|
72
|
+
measuredVirtualSizes: ComputedRef<Map<number, number> | null>;
|
|
73
|
+
getVirtualItemHeight: (index: number) => number;
|
|
74
|
+
stickyOffsets: ComputedRef<Map<number, number>>;
|
|
75
|
+
};
|
|
@@ -0,0 +1,534 @@
|
|
|
1
|
+
import { defaultRangeExtractor, useVirtualizer } from "@tanstack/vue-virtual";
|
|
2
|
+
import { breakpointsTailwind, useBreakpoints } from "@vueuse/core";
|
|
3
|
+
import { computed, ref, toValue, watch } from "vue";
|
|
4
|
+
import { nuGridDefaults } from "../../config/_internal/index.js";
|
|
5
|
+
function resolveOverscanForBreakpoint(overscan, currentBreakpoint, fallback) {
|
|
6
|
+
if (overscan === void 0) {
|
|
7
|
+
return fallback;
|
|
8
|
+
}
|
|
9
|
+
if (typeof overscan === "number") {
|
|
10
|
+
return overscan;
|
|
11
|
+
}
|
|
12
|
+
if (currentBreakpoint && overscan[currentBreakpoint] !== void 0) {
|
|
13
|
+
return overscan[currentBreakpoint];
|
|
14
|
+
}
|
|
15
|
+
if (overscan.default !== void 0) {
|
|
16
|
+
return overscan.default;
|
|
17
|
+
}
|
|
18
|
+
const firstValue = Object.values(overscan).find((value) => typeof value === "number");
|
|
19
|
+
return typeof firstValue === "number" ? firstValue : fallback;
|
|
20
|
+
}
|
|
21
|
+
function useNuGridBreakpointKey() {
|
|
22
|
+
const breakpoints = useBreakpoints(breakpointsTailwind);
|
|
23
|
+
const current = breakpoints.current();
|
|
24
|
+
return computed(() => {
|
|
25
|
+
const value = current.value;
|
|
26
|
+
if (Array.isArray(value)) {
|
|
27
|
+
return value[0];
|
|
28
|
+
}
|
|
29
|
+
return value ?? void 0;
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
export function resolveVirtualizationOptions(virtualization, defaultEstimateSize = nuGridDefaults.virtualization.estimateSize, currentBreakpoint) {
|
|
33
|
+
const defaults = nuGridDefaults.virtualization;
|
|
34
|
+
const options = typeof virtualization === "object" && virtualization !== null ? virtualization : void 0;
|
|
35
|
+
const enabled = virtualization === true || (typeof virtualization === "object" && virtualization !== null ? options?.enabled !== false : false);
|
|
36
|
+
const rowHeights = resolveRowHeights(
|
|
37
|
+
options?.rowHeights,
|
|
38
|
+
defaults.rowHeights ?? {}
|
|
39
|
+
);
|
|
40
|
+
const estimateSize = options?.estimateSize ?? defaultEstimateSize ?? defaults.estimateSize;
|
|
41
|
+
const overscanSetting = options?.overscanByBreakpoint ?? options?.overscan ?? defaults.overscanByBreakpoint ?? defaults.overscan;
|
|
42
|
+
const overscan = resolveOverscanForBreakpoint(
|
|
43
|
+
overscanSetting,
|
|
44
|
+
currentBreakpoint,
|
|
45
|
+
defaults.overscan ?? defaultEstimateSize ?? 12
|
|
46
|
+
);
|
|
47
|
+
const overscanByBreakpoint = options?.overscanByBreakpoint ?? (typeof options?.overscan === "object" && options.overscan !== null ? options.overscan : defaults.overscanByBreakpoint);
|
|
48
|
+
const dynamicRowHeights = typeof options?.dynamicRowHeights === "boolean" ? options.dynamicRowHeights : options?.rowHeights ? false : defaults.dynamicRowHeights;
|
|
49
|
+
return {
|
|
50
|
+
...options,
|
|
51
|
+
enabled,
|
|
52
|
+
estimateSize,
|
|
53
|
+
overscan,
|
|
54
|
+
overscanByBreakpoint,
|
|
55
|
+
dynamicRowHeights,
|
|
56
|
+
rowHeights
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
function resolveRowHeights(rowHeights, defaults) {
|
|
60
|
+
return {
|
|
61
|
+
groupHeader: rowHeights?.groupHeader ?? defaults.groupHeader,
|
|
62
|
+
columnHeader: rowHeights?.columnHeader ?? defaults.columnHeader,
|
|
63
|
+
dataRow: rowHeights?.dataRow ?? defaults.dataRow,
|
|
64
|
+
footer: rowHeights?.footer ?? defaults.footer
|
|
65
|
+
};
|
|
66
|
+
}
|
|
67
|
+
export function useNuGridGroupVirtualization(options) {
|
|
68
|
+
const props = computed(() => toValue(options.props));
|
|
69
|
+
const currentBreakpoint = useNuGridBreakpointKey();
|
|
70
|
+
const virtualization = computed(
|
|
71
|
+
() => resolveVirtualizationOptions(props.value.virtualization, 80, currentBreakpoint.value)
|
|
72
|
+
);
|
|
73
|
+
const groupingRowHeights = computed(() => virtualization.value.rowHeights);
|
|
74
|
+
const headerGroupCount = computed(() => options.tableApi.getHeaderGroups().length);
|
|
75
|
+
const getColumnHeadersHeight = (expanded) => {
|
|
76
|
+
const columnHeaderHeight = groupingRowHeights.value.columnHeader;
|
|
77
|
+
if (!expanded) {
|
|
78
|
+
return columnHeaderHeight;
|
|
79
|
+
}
|
|
80
|
+
return headerGroupCount.value * columnHeaderHeight;
|
|
81
|
+
};
|
|
82
|
+
function processGroupRecursively(groupRow, items, indexRef, heights, parentExpanded = true, depth = 0) {
|
|
83
|
+
const groupId = groupRow.id;
|
|
84
|
+
const expanded = options.isGroupExpanded(groupId);
|
|
85
|
+
if (!parentExpanded) {
|
|
86
|
+
return;
|
|
87
|
+
}
|
|
88
|
+
items.push({
|
|
89
|
+
type: "group-header",
|
|
90
|
+
height: heights.groupHeader,
|
|
91
|
+
groupId,
|
|
92
|
+
groupRow,
|
|
93
|
+
index: indexRef.value++,
|
|
94
|
+
depth
|
|
95
|
+
});
|
|
96
|
+
if (!expanded) {
|
|
97
|
+
items.push({
|
|
98
|
+
type: "column-headers",
|
|
99
|
+
height: getColumnHeadersHeight(false),
|
|
100
|
+
groupId,
|
|
101
|
+
index: indexRef.value++
|
|
102
|
+
});
|
|
103
|
+
items.push({
|
|
104
|
+
type: "footer",
|
|
105
|
+
height: heights.footer,
|
|
106
|
+
groupId,
|
|
107
|
+
index: indexRef.value++
|
|
108
|
+
});
|
|
109
|
+
} else {
|
|
110
|
+
items.push({
|
|
111
|
+
type: "column-headers",
|
|
112
|
+
height: getColumnHeadersHeight(true),
|
|
113
|
+
groupId,
|
|
114
|
+
index: indexRef.value++
|
|
115
|
+
});
|
|
116
|
+
const addRowPosition = options.addRowOptions?.addRowPosition.value ?? "none";
|
|
117
|
+
const addRowRow = options.addRowOptions?.getAddRowForGroup?.(groupId) || null;
|
|
118
|
+
if (addRowRow && addRowPosition === "top") {
|
|
119
|
+
items.push({
|
|
120
|
+
type: "data",
|
|
121
|
+
height: heights.dataRow,
|
|
122
|
+
groupId,
|
|
123
|
+
dataRow: addRowRow,
|
|
124
|
+
index: indexRef.value++,
|
|
125
|
+
depth
|
|
126
|
+
});
|
|
127
|
+
}
|
|
128
|
+
if (groupRow.subRows && groupRow.subRows.length > 0) {
|
|
129
|
+
groupRow.subRows.forEach((subRow) => {
|
|
130
|
+
if (subRow.getIsGrouped()) {
|
|
131
|
+
processGroupRecursively(subRow, items, indexRef, heights, expanded, depth + 1);
|
|
132
|
+
} else {
|
|
133
|
+
items.push({
|
|
134
|
+
type: "data",
|
|
135
|
+
height: heights.dataRow,
|
|
136
|
+
groupId,
|
|
137
|
+
dataRow: subRow,
|
|
138
|
+
index: indexRef.value++,
|
|
139
|
+
depth
|
|
140
|
+
});
|
|
141
|
+
}
|
|
142
|
+
});
|
|
143
|
+
}
|
|
144
|
+
if (addRowRow && addRowPosition === "bottom") {
|
|
145
|
+
items.push({
|
|
146
|
+
type: "data",
|
|
147
|
+
height: heights.dataRow,
|
|
148
|
+
groupId,
|
|
149
|
+
dataRow: addRowRow,
|
|
150
|
+
index: indexRef.value++,
|
|
151
|
+
depth
|
|
152
|
+
});
|
|
153
|
+
}
|
|
154
|
+
items.push({
|
|
155
|
+
type: "footer",
|
|
156
|
+
height: heights.footer,
|
|
157
|
+
groupId,
|
|
158
|
+
index: indexRef.value++
|
|
159
|
+
});
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
const virtualRowItems = computed(() => {
|
|
163
|
+
const items = [];
|
|
164
|
+
const index = 0;
|
|
165
|
+
const heights = groupingRowHeights.value;
|
|
166
|
+
const indexRef = { value: index };
|
|
167
|
+
options.topLevelRows.value.forEach((row) => {
|
|
168
|
+
if (row.getIsGrouped()) {
|
|
169
|
+
processGroupRecursively(row, items, indexRef, heights, true, 0);
|
|
170
|
+
}
|
|
171
|
+
});
|
|
172
|
+
return items;
|
|
173
|
+
});
|
|
174
|
+
const {
|
|
175
|
+
virtualizer,
|
|
176
|
+
virtualizationEnabled,
|
|
177
|
+
activeStickyIndexes,
|
|
178
|
+
activeStickyHeight,
|
|
179
|
+
measuredVirtualSizes,
|
|
180
|
+
getVirtualItemHeight,
|
|
181
|
+
stickyOffsets
|
|
182
|
+
} = useSharedVirtualizer({
|
|
183
|
+
virtualization,
|
|
184
|
+
rootRef: options.rootRef,
|
|
185
|
+
stickyEnabled: options.stickyEnabled,
|
|
186
|
+
virtualRowItems,
|
|
187
|
+
resolveStickyIndexes: ({ range, items }) => resolveGroupStickyIndexes(range, items)
|
|
188
|
+
});
|
|
189
|
+
return {
|
|
190
|
+
groupingRowHeights,
|
|
191
|
+
headerGroupCount,
|
|
192
|
+
virtualRowItems,
|
|
193
|
+
virtualizer,
|
|
194
|
+
virtualizationEnabled,
|
|
195
|
+
activeStickyIndexes,
|
|
196
|
+
activeStickyHeight,
|
|
197
|
+
measuredVirtualSizes,
|
|
198
|
+
getVirtualItemHeight,
|
|
199
|
+
stickyOffsets
|
|
200
|
+
};
|
|
201
|
+
}
|
|
202
|
+
export function useNuGridVirtualization(options) {
|
|
203
|
+
const props = computed(() => toValue(options.props));
|
|
204
|
+
const rows = computed(() => options.rows.value);
|
|
205
|
+
const headerGroupCount = computed(() => options.tableApi.getHeaderGroups().length);
|
|
206
|
+
const hasFooter = computed(() => toValue(options.hasFooter ?? false));
|
|
207
|
+
const currentBreakpoint = useNuGridBreakpointKey();
|
|
208
|
+
const virtualization = computed(
|
|
209
|
+
() => resolveVirtualizationOptions(props.value.virtualization, 65, currentBreakpoint.value)
|
|
210
|
+
);
|
|
211
|
+
const rowHeights = computed(() => virtualization.value.rowHeights);
|
|
212
|
+
const virtualRowItems = computed(() => {
|
|
213
|
+
const items = [];
|
|
214
|
+
let index = 0;
|
|
215
|
+
items.push({
|
|
216
|
+
type: "column-headers",
|
|
217
|
+
height: rowHeights.value.columnHeader * Math.max(headerGroupCount.value, 1),
|
|
218
|
+
index: index++
|
|
219
|
+
});
|
|
220
|
+
rows.value.forEach((row) => {
|
|
221
|
+
items.push({
|
|
222
|
+
type: "data",
|
|
223
|
+
height: rowHeights.value.dataRow,
|
|
224
|
+
dataRow: row,
|
|
225
|
+
index: index++
|
|
226
|
+
});
|
|
227
|
+
});
|
|
228
|
+
if (hasFooter.value) {
|
|
229
|
+
items.push({
|
|
230
|
+
type: "footer",
|
|
231
|
+
height: rowHeights.value.footer,
|
|
232
|
+
index: index++
|
|
233
|
+
});
|
|
234
|
+
}
|
|
235
|
+
return items;
|
|
236
|
+
});
|
|
237
|
+
const shared = useSharedVirtualizer({
|
|
238
|
+
virtualization,
|
|
239
|
+
rootRef: options.rootRef,
|
|
240
|
+
stickyEnabled: options.stickyEnabled,
|
|
241
|
+
virtualRowItems,
|
|
242
|
+
resolveStickyIndexes: () => {
|
|
243
|
+
if (!options.stickyEnabled?.value) {
|
|
244
|
+
return [];
|
|
245
|
+
}
|
|
246
|
+
return [0];
|
|
247
|
+
}
|
|
248
|
+
});
|
|
249
|
+
return shared;
|
|
250
|
+
}
|
|
251
|
+
function useSharedVirtualizer(options) {
|
|
252
|
+
const virtualizerProps = computed(() => {
|
|
253
|
+
const {
|
|
254
|
+
enabled: _enabled,
|
|
255
|
+
rowHeights: _rowHeights,
|
|
256
|
+
dynamicRowHeights: _dyn,
|
|
257
|
+
overscanByBreakpoint: _overscanMap,
|
|
258
|
+
...rest
|
|
259
|
+
} = options.virtualization.value;
|
|
260
|
+
return rest;
|
|
261
|
+
});
|
|
262
|
+
const virtualizationEnabled = computed(() => options.virtualization.value.enabled);
|
|
263
|
+
const activeStickyIndexes = ref([]);
|
|
264
|
+
if (!virtualizationEnabled.value) {
|
|
265
|
+
const measuredVirtualSizes2 = computed(() => null);
|
|
266
|
+
const getVirtualItemHeight2 = (index) => options.virtualRowItems.value[index]?.height ?? 0;
|
|
267
|
+
const stickyOffsets2 = computed(() => /* @__PURE__ */ new Map());
|
|
268
|
+
const activeStickyHeight2 = computed(() => {
|
|
269
|
+
let total = 0;
|
|
270
|
+
for (const index of activeStickyIndexes.value) {
|
|
271
|
+
total += getVirtualItemHeight2(index);
|
|
272
|
+
}
|
|
273
|
+
return total;
|
|
274
|
+
});
|
|
275
|
+
return {
|
|
276
|
+
virtualizer: null,
|
|
277
|
+
virtualizationEnabled,
|
|
278
|
+
activeStickyIndexes,
|
|
279
|
+
activeStickyHeight: activeStickyHeight2,
|
|
280
|
+
virtualRowItems: options.virtualRowItems,
|
|
281
|
+
measuredVirtualSizes: measuredVirtualSizes2,
|
|
282
|
+
getVirtualItemHeight: getVirtualItemHeight2,
|
|
283
|
+
stickyOffsets: stickyOffsets2
|
|
284
|
+
};
|
|
285
|
+
}
|
|
286
|
+
const baseVirtualizer = useVirtualizer({
|
|
287
|
+
...virtualizerProps.value,
|
|
288
|
+
get count() {
|
|
289
|
+
return options.virtualRowItems.value.length;
|
|
290
|
+
},
|
|
291
|
+
getScrollElement: () => options.rootRef.value?.$el,
|
|
292
|
+
estimateSize: (index) => {
|
|
293
|
+
const item = options.virtualRowItems.value[index];
|
|
294
|
+
return item?.height ?? virtualizerProps.value.estimateSize;
|
|
295
|
+
},
|
|
296
|
+
rangeExtractor: (range) => {
|
|
297
|
+
if (!options.stickyEnabled?.value || !options.resolveStickyIndexes) {
|
|
298
|
+
activeStickyIndexes.value = [];
|
|
299
|
+
return defaultRangeExtractor(range);
|
|
300
|
+
}
|
|
301
|
+
const sticky = options.resolveStickyIndexes({ range, items: options.virtualRowItems.value });
|
|
302
|
+
activeStickyIndexes.value = sticky;
|
|
303
|
+
if (!sticky.length) {
|
|
304
|
+
return defaultRangeExtractor(range);
|
|
305
|
+
}
|
|
306
|
+
const merged = /* @__PURE__ */ new Set([...sticky, ...defaultRangeExtractor(range)]);
|
|
307
|
+
return [...merged];
|
|
308
|
+
}
|
|
309
|
+
});
|
|
310
|
+
const virtualizer = baseVirtualizer;
|
|
311
|
+
const dynamicRowHeightsEnabled = computed(() => options.virtualization.value.dynamicRowHeights);
|
|
312
|
+
virtualizer.value.props = options.virtualization;
|
|
313
|
+
virtualizer.value.dynamicRowHeightsEnabled = dynamicRowHeightsEnabled;
|
|
314
|
+
if (options.stickyEnabled) {
|
|
315
|
+
watch(options.stickyEnabled, () => {
|
|
316
|
+
virtualizer.value?.measure();
|
|
317
|
+
});
|
|
318
|
+
}
|
|
319
|
+
const measuredVirtualSizes = computed(() => {
|
|
320
|
+
if (!dynamicRowHeightsEnabled.value) {
|
|
321
|
+
return null;
|
|
322
|
+
}
|
|
323
|
+
const map = /* @__PURE__ */ new Map();
|
|
324
|
+
virtualizer.value.getVirtualItems().forEach((virtualItem) => {
|
|
325
|
+
map.set(virtualItem.index, virtualItem.size);
|
|
326
|
+
});
|
|
327
|
+
return map;
|
|
328
|
+
});
|
|
329
|
+
const getVirtualItemHeight = (index) => {
|
|
330
|
+
const fallbackHeight = options.virtualRowItems.value[index]?.height ?? 0;
|
|
331
|
+
if (!dynamicRowHeightsEnabled.value) {
|
|
332
|
+
return fallbackHeight;
|
|
333
|
+
}
|
|
334
|
+
return measuredVirtualSizes.value?.get(index) ?? fallbackHeight;
|
|
335
|
+
};
|
|
336
|
+
const stickyOffsets = computed(() => {
|
|
337
|
+
if (!options.stickyEnabled?.value || !activeStickyIndexes.value.length) {
|
|
338
|
+
return /* @__PURE__ */ new Map();
|
|
339
|
+
}
|
|
340
|
+
const offsets = /* @__PURE__ */ new Map();
|
|
341
|
+
let topOffset = 0;
|
|
342
|
+
activeStickyIndexes.value.forEach((stickyIndex) => {
|
|
343
|
+
offsets.set(stickyIndex, topOffset);
|
|
344
|
+
topOffset += getVirtualItemHeight(stickyIndex);
|
|
345
|
+
});
|
|
346
|
+
return offsets;
|
|
347
|
+
});
|
|
348
|
+
const activeStickyHeight = computed(() => {
|
|
349
|
+
let total = 0;
|
|
350
|
+
for (const index of activeStickyIndexes.value) {
|
|
351
|
+
total += getVirtualItemHeight(index);
|
|
352
|
+
}
|
|
353
|
+
return total;
|
|
354
|
+
});
|
|
355
|
+
return {
|
|
356
|
+
virtualizer,
|
|
357
|
+
virtualizationEnabled,
|
|
358
|
+
activeStickyIndexes,
|
|
359
|
+
activeStickyHeight,
|
|
360
|
+
virtualRowItems: options.virtualRowItems,
|
|
361
|
+
measuredVirtualSizes,
|
|
362
|
+
getVirtualItemHeight,
|
|
363
|
+
stickyOffsets
|
|
364
|
+
};
|
|
365
|
+
}
|
|
366
|
+
function resolveGroupStickyIndexes(range, items) {
|
|
367
|
+
const activeStickySet = /* @__PURE__ */ new Set();
|
|
368
|
+
const groupHeaderIndexes = items.map((item, index) => item.type === "group-header" ? index : -1).filter((index) => index !== -1);
|
|
369
|
+
let activeGroupHeaderIndex;
|
|
370
|
+
for (let i = groupHeaderIndexes.length - 1; i >= 0; i--) {
|
|
371
|
+
const headerIndex = groupHeaderIndexes[i];
|
|
372
|
+
if (headerIndex !== void 0 && headerIndex <= range.startIndex) {
|
|
373
|
+
activeGroupHeaderIndex = headerIndex;
|
|
374
|
+
break;
|
|
375
|
+
}
|
|
376
|
+
}
|
|
377
|
+
if (activeGroupHeaderIndex === void 0 && groupHeaderIndexes.length > 0) {
|
|
378
|
+
activeGroupHeaderIndex = groupHeaderIndexes[0];
|
|
379
|
+
}
|
|
380
|
+
if (activeGroupHeaderIndex !== void 0) {
|
|
381
|
+
activeStickySet.add(activeGroupHeaderIndex);
|
|
382
|
+
let nextIndex = activeGroupHeaderIndex + 1;
|
|
383
|
+
while (nextIndex < items.length) {
|
|
384
|
+
const item = items[nextIndex];
|
|
385
|
+
if (item?.type === "column-headers") {
|
|
386
|
+
activeStickySet.add(nextIndex);
|
|
387
|
+
break;
|
|
388
|
+
} else if (item?.type === "group-header") {
|
|
389
|
+
break;
|
|
390
|
+
}
|
|
391
|
+
nextIndex++;
|
|
392
|
+
}
|
|
393
|
+
}
|
|
394
|
+
return Array.from(activeStickySet);
|
|
395
|
+
}
|
|
396
|
+
export function useNuGridStandardGroupVirtualization(options) {
|
|
397
|
+
const props = computed(() => toValue(options.props));
|
|
398
|
+
const currentBreakpoint = useNuGridBreakpointKey();
|
|
399
|
+
const virtualization = computed(
|
|
400
|
+
() => resolveVirtualizationOptions(props.value.virtualization, 80, currentBreakpoint.value)
|
|
401
|
+
);
|
|
402
|
+
const groupingRowHeights = computed(() => virtualization.value.rowHeights);
|
|
403
|
+
const headerGroupCount = computed(() => options.tableApi.getHeaderGroups().length);
|
|
404
|
+
const getColumnHeadersHeight = () => {
|
|
405
|
+
const columnHeaderHeight = groupingRowHeights.value.columnHeader;
|
|
406
|
+
return headerGroupCount.value * columnHeaderHeight;
|
|
407
|
+
};
|
|
408
|
+
function processGroupRecursively(groupRow, items, indexRef, heights, parentExpanded = true, depth = 0) {
|
|
409
|
+
const groupId = groupRow.id;
|
|
410
|
+
const expanded = options.isGroupExpanded(groupId);
|
|
411
|
+
if (!parentExpanded) {
|
|
412
|
+
return;
|
|
413
|
+
}
|
|
414
|
+
items.push({
|
|
415
|
+
type: "group-header",
|
|
416
|
+
height: heights.groupHeader,
|
|
417
|
+
groupId,
|
|
418
|
+
groupRow,
|
|
419
|
+
index: indexRef.value++,
|
|
420
|
+
depth
|
|
421
|
+
});
|
|
422
|
+
if (expanded) {
|
|
423
|
+
const addRowPosition = options.addRowOptions?.addRowPosition.value ?? "none";
|
|
424
|
+
const addRowRow = options.addRowOptions?.getAddRowForGroup?.(groupId) || null;
|
|
425
|
+
if (addRowRow && addRowPosition === "top") {
|
|
426
|
+
items.push({
|
|
427
|
+
type: "data",
|
|
428
|
+
height: heights.dataRow,
|
|
429
|
+
groupId,
|
|
430
|
+
dataRow: addRowRow,
|
|
431
|
+
index: indexRef.value++,
|
|
432
|
+
depth
|
|
433
|
+
});
|
|
434
|
+
}
|
|
435
|
+
if (groupRow.subRows && groupRow.subRows.length > 0) {
|
|
436
|
+
groupRow.subRows.forEach((subRow) => {
|
|
437
|
+
if (subRow.getIsGrouped()) {
|
|
438
|
+
processGroupRecursively(subRow, items, indexRef, heights, expanded, depth + 1);
|
|
439
|
+
} else {
|
|
440
|
+
items.push({
|
|
441
|
+
type: "data",
|
|
442
|
+
height: heights.dataRow,
|
|
443
|
+
groupId,
|
|
444
|
+
dataRow: subRow,
|
|
445
|
+
index: indexRef.value++,
|
|
446
|
+
depth
|
|
447
|
+
});
|
|
448
|
+
}
|
|
449
|
+
});
|
|
450
|
+
}
|
|
451
|
+
if (addRowRow && addRowPosition === "bottom") {
|
|
452
|
+
items.push({
|
|
453
|
+
type: "data",
|
|
454
|
+
height: heights.dataRow,
|
|
455
|
+
groupId,
|
|
456
|
+
dataRow: addRowRow,
|
|
457
|
+
index: indexRef.value++,
|
|
458
|
+
depth
|
|
459
|
+
});
|
|
460
|
+
}
|
|
461
|
+
}
|
|
462
|
+
}
|
|
463
|
+
const virtualRowItems = computed(() => {
|
|
464
|
+
const items = [];
|
|
465
|
+
const index = 0;
|
|
466
|
+
const heights = groupingRowHeights.value;
|
|
467
|
+
const indexRef = { value: index };
|
|
468
|
+
items.push({
|
|
469
|
+
type: "column-headers",
|
|
470
|
+
height: getColumnHeadersHeight(),
|
|
471
|
+
index: indexRef.value++
|
|
472
|
+
});
|
|
473
|
+
options.topLevelRows.value.forEach((row) => {
|
|
474
|
+
if (row.getIsGrouped()) {
|
|
475
|
+
processGroupRecursively(row, items, indexRef, heights, true, 0);
|
|
476
|
+
}
|
|
477
|
+
});
|
|
478
|
+
items.push({
|
|
479
|
+
type: "footer",
|
|
480
|
+
height: heights.footer,
|
|
481
|
+
index: indexRef.value++
|
|
482
|
+
});
|
|
483
|
+
return items;
|
|
484
|
+
});
|
|
485
|
+
const {
|
|
486
|
+
virtualizer,
|
|
487
|
+
virtualizationEnabled,
|
|
488
|
+
activeStickyIndexes,
|
|
489
|
+
activeStickyHeight,
|
|
490
|
+
measuredVirtualSizes,
|
|
491
|
+
getVirtualItemHeight,
|
|
492
|
+
stickyOffsets
|
|
493
|
+
} = useSharedVirtualizer({
|
|
494
|
+
virtualization,
|
|
495
|
+
rootRef: options.rootRef,
|
|
496
|
+
stickyEnabled: options.stickyEnabled,
|
|
497
|
+
virtualRowItems,
|
|
498
|
+
resolveStickyIndexes: ({ range, items }) => resolveStandardGroupStickyIndexes(range, items)
|
|
499
|
+
});
|
|
500
|
+
return {
|
|
501
|
+
groupingRowHeights,
|
|
502
|
+
headerGroupCount,
|
|
503
|
+
virtualRowItems,
|
|
504
|
+
virtualizer,
|
|
505
|
+
virtualizationEnabled,
|
|
506
|
+
activeStickyIndexes,
|
|
507
|
+
activeStickyHeight,
|
|
508
|
+
measuredVirtualSizes,
|
|
509
|
+
getVirtualItemHeight,
|
|
510
|
+
stickyOffsets
|
|
511
|
+
};
|
|
512
|
+
}
|
|
513
|
+
function resolveStandardGroupStickyIndexes(range, items) {
|
|
514
|
+
const activeStickySet = /* @__PURE__ */ new Set();
|
|
515
|
+
if (items[0]?.type === "column-headers") {
|
|
516
|
+
activeStickySet.add(0);
|
|
517
|
+
}
|
|
518
|
+
const groupHeaderIndexes = items.map((item, index) => item.type === "group-header" ? index : -1).filter((index) => index !== -1);
|
|
519
|
+
let activeGroupHeaderIndex;
|
|
520
|
+
for (let i = groupHeaderIndexes.length - 1; i >= 0; i--) {
|
|
521
|
+
const headerIndex = groupHeaderIndexes[i];
|
|
522
|
+
if (headerIndex !== void 0 && headerIndex <= range.startIndex) {
|
|
523
|
+
activeGroupHeaderIndex = headerIndex;
|
|
524
|
+
break;
|
|
525
|
+
}
|
|
526
|
+
}
|
|
527
|
+
if (activeGroupHeaderIndex === void 0 && groupHeaderIndexes.length > 0) {
|
|
528
|
+
activeGroupHeaderIndex = groupHeaderIndexes[0];
|
|
529
|
+
}
|
|
530
|
+
if (activeGroupHeaderIndex !== void 0) {
|
|
531
|
+
activeStickySet.add(activeGroupHeaderIndex);
|
|
532
|
+
}
|
|
533
|
+
return Array.from(activeStickySet).sort((a, b) => a - b);
|
|
534
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
export interface UseNuGridWheelSmoothingOptions {
|
|
2
|
+
threshold?: number;
|
|
3
|
+
/** Maximum scroll speed in px/sec for intercepted wheel input */
|
|
4
|
+
maxVelocityPxPerSec?: number;
|
|
5
|
+
/** Maximum scroll speed in px/sec for touchpad input (small deltas) */
|
|
6
|
+
maxVelocityPxPerSecTouchpad?: number;
|
|
7
|
+
/** Delta threshold to distinguish touchpad (below) from mouse wheel (above) */
|
|
8
|
+
touchpadDeltaThreshold?: number;
|
|
9
|
+
/** How long (ms) after the last wheel event before we cancel any remaining momentum */
|
|
10
|
+
stopOnInactivityMs?: number;
|
|
11
|
+
/** Fraction of pending delta applied each frame (lower = smoother) */
|
|
12
|
+
smoothingFactor?: number;
|
|
13
|
+
/** Minimum px to apply per frame when pending exists (avoids stutter) */
|
|
14
|
+
minStepPx?: number;
|
|
15
|
+
/** Enable adaptive smoothing based on recent velocity */
|
|
16
|
+
adaptive?: boolean;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Smooths bursty mouse-wheel events by batching them into rAF-driven scrolls and
|
|
20
|
+
* optionally caps their speed so mouse wheels cannot spike scroll velocity.
|
|
21
|
+
* Only intercepts large pixel-mode deltas to avoid affecting trackpads.
|
|
22
|
+
*/
|
|
23
|
+
export declare function useNuGridWheelSmoothing(containerRef: {
|
|
24
|
+
value: HTMLElement | null;
|
|
25
|
+
}, options?: UseNuGridWheelSmoothingOptions): void;
|