@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,463 @@
|
|
|
1
|
+
import { useElementSize } from "@vueuse/core";
|
|
2
|
+
import { computed, ref, watch } from "vue";
|
|
3
|
+
export class NuGridScrollManager {
|
|
4
|
+
pendingScrollFrame = null;
|
|
5
|
+
pendingResolve = null;
|
|
6
|
+
isProcessing = false;
|
|
7
|
+
tableApi;
|
|
8
|
+
pinnedLeftWidth;
|
|
9
|
+
pinnedRightWidth;
|
|
10
|
+
visibleColumns;
|
|
11
|
+
cumulativeWidthsFromRight;
|
|
12
|
+
// Cache for sticky header detection to avoid expensive DOM queries
|
|
13
|
+
cachedTableElement = null;
|
|
14
|
+
cachedHeaderElement = null;
|
|
15
|
+
isHeaderSticky = false;
|
|
16
|
+
// Dimension cache - reuse container/header measurements during rapid scrolling
|
|
17
|
+
dimensionCache = {
|
|
18
|
+
containerRect: null,
|
|
19
|
+
stickyHeaderHeight: 0,
|
|
20
|
+
visibleTop: 0,
|
|
21
|
+
visibleBottom: 0,
|
|
22
|
+
visibleLeft: 0,
|
|
23
|
+
visibleRight: 0,
|
|
24
|
+
timestamp: 0
|
|
25
|
+
};
|
|
26
|
+
constructor(tableApi, pinnedLeftWidth, pinnedRightWidth, visibleColumns, cumulativeWidthsFromRight) {
|
|
27
|
+
this.tableApi = tableApi;
|
|
28
|
+
this.pinnedLeftWidth = pinnedLeftWidth;
|
|
29
|
+
this.pinnedRightWidth = pinnedRightWidth;
|
|
30
|
+
this.visibleColumns = visibleColumns;
|
|
31
|
+
this.cumulativeWidthsFromRight = cumulativeWidthsFromRight;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Cancel any pending scroll operation
|
|
35
|
+
*/
|
|
36
|
+
cancelPending(clearProcessing = true) {
|
|
37
|
+
if (this.pendingScrollFrame !== null) {
|
|
38
|
+
cancelAnimationFrame(this.pendingScrollFrame);
|
|
39
|
+
this.pendingScrollFrame = null;
|
|
40
|
+
}
|
|
41
|
+
if (this.pendingResolve) {
|
|
42
|
+
this.pendingResolve();
|
|
43
|
+
this.pendingResolve = null;
|
|
44
|
+
}
|
|
45
|
+
if (clearProcessing) {
|
|
46
|
+
this.isProcessing = false;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Check if a scroll operation is currently being processed
|
|
51
|
+
*/
|
|
52
|
+
get isProcessingScroll() {
|
|
53
|
+
return this.isProcessing;
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* Set the processing state
|
|
57
|
+
*/
|
|
58
|
+
setProcessing(value) {
|
|
59
|
+
this.isProcessing = value;
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* Invalidate the sticky header cache
|
|
63
|
+
* Call this if the table structure changes (e.g., headers added/removed)
|
|
64
|
+
*/
|
|
65
|
+
invalidateHeaderCache() {
|
|
66
|
+
this.cachedTableElement = null;
|
|
67
|
+
this.cachedHeaderElement = null;
|
|
68
|
+
this.isHeaderSticky = false;
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* Invalidate dimension cache
|
|
72
|
+
* Call this when container size might have changed
|
|
73
|
+
*/
|
|
74
|
+
invalidateDimensionCache() {
|
|
75
|
+
this.dimensionCache.timestamp = 0;
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* Get or compute container dimensions with caching
|
|
79
|
+
* Cache is valid for 30000ms (30 seconds) - invalidated manually on keyup
|
|
80
|
+
*/
|
|
81
|
+
getCachedDimensions(scrollContainer, tableElement, virtualizedStickyHeight) {
|
|
82
|
+
const now = Date.now();
|
|
83
|
+
const cacheAge = now - this.dimensionCache.timestamp;
|
|
84
|
+
if (cacheAge < 3e4 && this.dimensionCache.containerRect) {
|
|
85
|
+
return {
|
|
86
|
+
containerRect: this.dimensionCache.containerRect,
|
|
87
|
+
stickyHeaderHeight: this.dimensionCache.stickyHeaderHeight,
|
|
88
|
+
visibleTop: this.dimensionCache.visibleTop,
|
|
89
|
+
visibleBottom: this.dimensionCache.visibleBottom,
|
|
90
|
+
visibleLeft: this.dimensionCache.visibleLeft,
|
|
91
|
+
visibleRight: this.dimensionCache.visibleRight
|
|
92
|
+
};
|
|
93
|
+
}
|
|
94
|
+
const containerRect = scrollContainer.getBoundingClientRect();
|
|
95
|
+
let stickyHeaderHeight = 0;
|
|
96
|
+
const multiRowHeaders = tableElement?.querySelector(
|
|
97
|
+
'[data-multi-row-headers="true"][data-sticky-header]'
|
|
98
|
+
);
|
|
99
|
+
if (multiRowHeaders) {
|
|
100
|
+
stickyHeaderHeight = multiRowHeaders.offsetHeight;
|
|
101
|
+
} else {
|
|
102
|
+
stickyHeaderHeight = this.getStickyHeaderHeight(tableElement, virtualizedStickyHeight);
|
|
103
|
+
}
|
|
104
|
+
const visibleTop = containerRect.top + stickyHeaderHeight;
|
|
105
|
+
const hasSticky = stickyHeaderHeight > 0;
|
|
106
|
+
const visibleBottom = hasSticky ? containerRect.top + scrollContainer.clientHeight : containerRect.bottom;
|
|
107
|
+
const leftPinnedWidth = this.pinnedLeftWidth.value;
|
|
108
|
+
const rightPinnedWidth = this.pinnedRightWidth.value;
|
|
109
|
+
const visibleLeft = containerRect.left + leftPinnedWidth;
|
|
110
|
+
const visibleRight = containerRect.right - rightPinnedWidth;
|
|
111
|
+
this.dimensionCache = {
|
|
112
|
+
containerRect,
|
|
113
|
+
stickyHeaderHeight,
|
|
114
|
+
visibleTop,
|
|
115
|
+
visibleBottom,
|
|
116
|
+
visibleLeft,
|
|
117
|
+
visibleRight,
|
|
118
|
+
timestamp: now
|
|
119
|
+
};
|
|
120
|
+
return {
|
|
121
|
+
containerRect,
|
|
122
|
+
stickyHeaderHeight,
|
|
123
|
+
visibleTop,
|
|
124
|
+
visibleBottom,
|
|
125
|
+
visibleLeft,
|
|
126
|
+
visibleRight
|
|
127
|
+
};
|
|
128
|
+
}
|
|
129
|
+
/**
|
|
130
|
+
* Update cached sticky header information if table element changed
|
|
131
|
+
* This avoids expensive querySelector and getComputedStyle calls on every scroll
|
|
132
|
+
*/
|
|
133
|
+
updateStickyHeaderCache(tableElement) {
|
|
134
|
+
if (tableElement !== this.cachedTableElement) {
|
|
135
|
+
this.cachedTableElement = tableElement;
|
|
136
|
+
this.cachedHeaderElement = tableElement?.querySelector("[data-sticky-header]") || null;
|
|
137
|
+
}
|
|
138
|
+
this.isHeaderSticky = this.cachedHeaderElement ? window.getComputedStyle(this.cachedHeaderElement).position === "sticky" : false;
|
|
139
|
+
}
|
|
140
|
+
/**
|
|
141
|
+
* Return the sticky header height, reusing cached lookups when possible
|
|
142
|
+
*/
|
|
143
|
+
getStickyHeaderHeight(tableElement, virtualizedStickyHeight) {
|
|
144
|
+
if (typeof virtualizedStickyHeight === "number") {
|
|
145
|
+
return virtualizedStickyHeight;
|
|
146
|
+
}
|
|
147
|
+
this.updateStickyHeaderCache(tableElement);
|
|
148
|
+
if (this.isHeaderSticky) {
|
|
149
|
+
return this.cachedHeaderElement?.offsetHeight || 0;
|
|
150
|
+
}
|
|
151
|
+
return 0;
|
|
152
|
+
}
|
|
153
|
+
/**
|
|
154
|
+
* Scroll horizontally to the start/end of the scroll container
|
|
155
|
+
*/
|
|
156
|
+
scrollToHorizontalEdge(scrollContainer, direction, behavior = "instant") {
|
|
157
|
+
this.cancelPending();
|
|
158
|
+
return new Promise((resolve) => {
|
|
159
|
+
this.pendingResolve = resolve;
|
|
160
|
+
this.pendingScrollFrame = requestAnimationFrame(() => {
|
|
161
|
+
this.pendingScrollFrame = null;
|
|
162
|
+
this.pendingResolve = null;
|
|
163
|
+
const maxScrollLeft = Math.max(0, scrollContainer.scrollWidth - scrollContainer.clientWidth);
|
|
164
|
+
let targetLeft = direction === "start" ? 0 : maxScrollLeft;
|
|
165
|
+
if (direction === "end") {
|
|
166
|
+
const rightPinnedWidth = this.pinnedRightWidth.value;
|
|
167
|
+
if (rightPinnedWidth > 0) {
|
|
168
|
+
targetLeft = Math.min(maxScrollLeft, targetLeft + rightPinnedWidth);
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
scrollContainer.scrollTo({ left: targetLeft, behavior });
|
|
172
|
+
resolve();
|
|
173
|
+
});
|
|
174
|
+
});
|
|
175
|
+
}
|
|
176
|
+
/**
|
|
177
|
+
* Scroll vertically to the top/bottom of the scroll container
|
|
178
|
+
*/
|
|
179
|
+
scrollToVerticalEdge(scrollContainer, direction, behavior = "instant") {
|
|
180
|
+
this.cancelPending();
|
|
181
|
+
return new Promise((resolve) => {
|
|
182
|
+
this.pendingResolve = resolve;
|
|
183
|
+
this.pendingScrollFrame = requestAnimationFrame(() => {
|
|
184
|
+
this.pendingScrollFrame = null;
|
|
185
|
+
this.pendingResolve = null;
|
|
186
|
+
const maxScrollTop = Math.max(
|
|
187
|
+
0,
|
|
188
|
+
scrollContainer.scrollHeight - scrollContainer.clientHeight
|
|
189
|
+
);
|
|
190
|
+
const targetTop = direction === "start" ? 0 : maxScrollTop;
|
|
191
|
+
scrollContainer.scrollTo({ top: targetTop, behavior });
|
|
192
|
+
resolve();
|
|
193
|
+
});
|
|
194
|
+
});
|
|
195
|
+
}
|
|
196
|
+
/**
|
|
197
|
+
* Scroll to make a cell visible with performance optimizations
|
|
198
|
+
* Returns a promise that resolves when scrolling is complete
|
|
199
|
+
*/
|
|
200
|
+
scrollToCell(options) {
|
|
201
|
+
const {
|
|
202
|
+
cellElement,
|
|
203
|
+
scrollContainer,
|
|
204
|
+
horizontalScrollContainer,
|
|
205
|
+
tableElement,
|
|
206
|
+
rowIndex,
|
|
207
|
+
columnIndex,
|
|
208
|
+
virtualizedStickyHeight,
|
|
209
|
+
behavior = "instant",
|
|
210
|
+
verticalPadding = 15,
|
|
211
|
+
includeHeadersAbove = false,
|
|
212
|
+
skipHorizontalScroll = false,
|
|
213
|
+
verticalOnly = false
|
|
214
|
+
} = options;
|
|
215
|
+
const hScrollContainer = horizontalScrollContainer ?? scrollContainer;
|
|
216
|
+
this.cancelPending(false);
|
|
217
|
+
return new Promise((resolve) => {
|
|
218
|
+
this.pendingResolve = resolve;
|
|
219
|
+
this.pendingScrollFrame = requestAnimationFrame(() => {
|
|
220
|
+
this.pendingScrollFrame = null;
|
|
221
|
+
this.pendingResolve = null;
|
|
222
|
+
const cellRect = cellElement.getBoundingClientRect();
|
|
223
|
+
let cellTop;
|
|
224
|
+
let cellBottom;
|
|
225
|
+
let cellLeft;
|
|
226
|
+
let cellRight;
|
|
227
|
+
let cellWidth;
|
|
228
|
+
let cellHeight;
|
|
229
|
+
if (verticalOnly) {
|
|
230
|
+
cellTop = cellRect.top;
|
|
231
|
+
cellBottom = cellRect.bottom;
|
|
232
|
+
cellHeight = cellRect.height;
|
|
233
|
+
cellLeft = 0;
|
|
234
|
+
cellRight = 0;
|
|
235
|
+
cellWidth = 0;
|
|
236
|
+
} else {
|
|
237
|
+
;
|
|
238
|
+
({
|
|
239
|
+
top: cellTop,
|
|
240
|
+
bottom: cellBottom,
|
|
241
|
+
left: cellLeft,
|
|
242
|
+
right: cellRight,
|
|
243
|
+
width: cellWidth,
|
|
244
|
+
height: cellHeight
|
|
245
|
+
} = cellRect);
|
|
246
|
+
}
|
|
247
|
+
const cachedDims = this.getCachedDimensions(
|
|
248
|
+
scrollContainer,
|
|
249
|
+
tableElement,
|
|
250
|
+
virtualizedStickyHeight
|
|
251
|
+
);
|
|
252
|
+
const { stickyHeaderHeight, visibleTop, visibleBottom, visibleLeft, visibleRight } = cachedDims;
|
|
253
|
+
const visibleHeight = visibleBottom - visibleTop;
|
|
254
|
+
let effectiveTop = cellTop;
|
|
255
|
+
let effectiveBottom = cellBottom;
|
|
256
|
+
let effectiveCellHeight = cellHeight;
|
|
257
|
+
if (!verticalOnly) {
|
|
258
|
+
const multiRowContainer = cellElement.closest('[data-multi-row="true"]') || cellElement.closest(".nugrid-multi-row-container");
|
|
259
|
+
if (multiRowContainer) {
|
|
260
|
+
const multiRowRect = multiRowContainer.getBoundingClientRect();
|
|
261
|
+
effectiveTop = multiRowRect.top;
|
|
262
|
+
effectiveBottom = multiRowRect.bottom;
|
|
263
|
+
effectiveCellHeight = multiRowRect.height;
|
|
264
|
+
}
|
|
265
|
+
}
|
|
266
|
+
let verticalScrollAdjustment = 0;
|
|
267
|
+
const effectiveVerticalPadding = stickyHeaderHeight > 0 ? 0 : verticalPadding;
|
|
268
|
+
if (rowIndex === 0 && scrollContainer.scrollTop > 0) {
|
|
269
|
+
verticalScrollAdjustment = -scrollContainer.scrollTop;
|
|
270
|
+
}
|
|
271
|
+
if (verticalScrollAdjustment === 0 && effectiveCellHeight <= visibleHeight) {
|
|
272
|
+
const scrollMargin = 2;
|
|
273
|
+
const isCutOffTop = effectiveTop < visibleTop - scrollMargin;
|
|
274
|
+
const isCutOffBottom = effectiveBottom > visibleBottom + scrollMargin;
|
|
275
|
+
if (isCutOffTop) {
|
|
276
|
+
let targetTop = effectiveTop - effectiveVerticalPadding;
|
|
277
|
+
if (includeHeadersAbove && !virtualizedStickyHeight) {
|
|
278
|
+
const rowElement = cellElement.closest("[data-row-id]");
|
|
279
|
+
if (rowElement) {
|
|
280
|
+
let sibling = rowElement.previousElementSibling;
|
|
281
|
+
const headersToReveal = [];
|
|
282
|
+
while (sibling) {
|
|
283
|
+
const isColumnHeader = sibling.hasAttribute("data-sticky-header") || sibling.querySelector("[data-sticky-header]");
|
|
284
|
+
const isGroupHeader = sibling.hasAttribute("data-group-header");
|
|
285
|
+
if (isColumnHeader || isGroupHeader) {
|
|
286
|
+
headersToReveal.unshift(sibling);
|
|
287
|
+
sibling = sibling.previousElementSibling;
|
|
288
|
+
} else if (sibling.hasAttribute("data-row-id")) {
|
|
289
|
+
break;
|
|
290
|
+
} else {
|
|
291
|
+
sibling = sibling.previousElementSibling;
|
|
292
|
+
}
|
|
293
|
+
}
|
|
294
|
+
if (headersToReveal.length > 0) {
|
|
295
|
+
const topHeaderRect = headersToReveal[0].getBoundingClientRect();
|
|
296
|
+
targetTop = Math.min(targetTop, topHeaderRect.top - 10);
|
|
297
|
+
}
|
|
298
|
+
}
|
|
299
|
+
}
|
|
300
|
+
verticalScrollAdjustment = targetTop - visibleTop;
|
|
301
|
+
if (includeHeadersAbove) {
|
|
302
|
+
const maxScrollPerAction = 150;
|
|
303
|
+
if (verticalScrollAdjustment < -maxScrollPerAction) {
|
|
304
|
+
verticalScrollAdjustment = -maxScrollPerAction;
|
|
305
|
+
}
|
|
306
|
+
}
|
|
307
|
+
} else if (isCutOffBottom) {
|
|
308
|
+
verticalScrollAdjustment = effectiveBottom - visibleBottom + effectiveVerticalPadding;
|
|
309
|
+
const maxScroll = scrollContainer.scrollHeight - scrollContainer.clientHeight;
|
|
310
|
+
const currentScroll = scrollContainer.scrollTop;
|
|
311
|
+
const newScroll = currentScroll + verticalScrollAdjustment;
|
|
312
|
+
if (newScroll > maxScroll) {
|
|
313
|
+
verticalScrollAdjustment = maxScroll - currentScroll;
|
|
314
|
+
}
|
|
315
|
+
}
|
|
316
|
+
} else if (effectiveCellHeight > visibleHeight) {
|
|
317
|
+
if (effectiveTop < visibleTop) {
|
|
318
|
+
verticalScrollAdjustment = effectiveTop - visibleTop - effectiveVerticalPadding;
|
|
319
|
+
}
|
|
320
|
+
}
|
|
321
|
+
let horizontalScrollAdjustment = 0;
|
|
322
|
+
if (!skipHorizontalScroll && !verticalOnly) {
|
|
323
|
+
const isPinnedLeft = cellElement.getAttribute("data-pinned") === "left";
|
|
324
|
+
const isPinnedRight = cellElement.getAttribute("data-pinned") === "right";
|
|
325
|
+
const isPinned = isPinnedLeft || isPinnedRight;
|
|
326
|
+
if (!isPinned) {
|
|
327
|
+
const paddedVisibleLeft = visibleLeft + 10;
|
|
328
|
+
const paddedVisibleRight = visibleRight - 10;
|
|
329
|
+
const visibleWidth = paddedVisibleRight - paddedVisibleLeft;
|
|
330
|
+
if (cellWidth <= visibleWidth) {
|
|
331
|
+
if (cellLeft < paddedVisibleLeft) {
|
|
332
|
+
horizontalScrollAdjustment = cellLeft - paddedVisibleLeft - 4;
|
|
333
|
+
} else if (cellRight > paddedVisibleRight) {
|
|
334
|
+
const totalWidthToRight = this.cumulativeWidthsFromRight.value[columnIndex] || 0;
|
|
335
|
+
const rightPinnedWidth = this.pinnedRightWidth.value;
|
|
336
|
+
if (totalWidthToRight <= visibleWidth + rightPinnedWidth) {
|
|
337
|
+
horizontalScrollAdjustment = cellRight - paddedVisibleRight + 40;
|
|
338
|
+
} else {
|
|
339
|
+
horizontalScrollAdjustment = cellRight - paddedVisibleRight + 8;
|
|
340
|
+
}
|
|
341
|
+
}
|
|
342
|
+
} else {
|
|
343
|
+
if (cellLeft < paddedVisibleLeft) {
|
|
344
|
+
horizontalScrollAdjustment = cellLeft - paddedVisibleLeft - 4;
|
|
345
|
+
}
|
|
346
|
+
}
|
|
347
|
+
}
|
|
348
|
+
}
|
|
349
|
+
if (verticalScrollAdjustment !== 0) {
|
|
350
|
+
scrollContainer.scrollBy({
|
|
351
|
+
top: verticalScrollAdjustment,
|
|
352
|
+
behavior
|
|
353
|
+
});
|
|
354
|
+
}
|
|
355
|
+
if (horizontalScrollAdjustment !== 0) {
|
|
356
|
+
hScrollContainer.scrollBy({
|
|
357
|
+
left: horizontalScrollAdjustment,
|
|
358
|
+
behavior
|
|
359
|
+
});
|
|
360
|
+
}
|
|
361
|
+
resolve();
|
|
362
|
+
});
|
|
363
|
+
});
|
|
364
|
+
}
|
|
365
|
+
}
|
|
366
|
+
function findScrollContainer(element, axis) {
|
|
367
|
+
if (!element) return null;
|
|
368
|
+
const style = window.getComputedStyle(element);
|
|
369
|
+
if (axis === "vertical") {
|
|
370
|
+
const overflowY = style.overflowY;
|
|
371
|
+
const hasOverflow = overflowY === "auto" || overflowY === "scroll";
|
|
372
|
+
const hasScrollableContent = element.scrollHeight > element.clientHeight;
|
|
373
|
+
if (hasOverflow && hasScrollableContent) {
|
|
374
|
+
return element;
|
|
375
|
+
}
|
|
376
|
+
} else {
|
|
377
|
+
const overflowX = style.overflowX;
|
|
378
|
+
const hasOverflow = overflowX === "auto" || overflowX === "scroll";
|
|
379
|
+
const hasScrollableContent = element.scrollWidth > element.clientWidth;
|
|
380
|
+
if (hasOverflow && hasScrollableContent) {
|
|
381
|
+
return element;
|
|
382
|
+
}
|
|
383
|
+
}
|
|
384
|
+
return element;
|
|
385
|
+
}
|
|
386
|
+
export function useNuGridScroll(tableApi, rootRef) {
|
|
387
|
+
const pinnedLeftWidth = computed(() => {
|
|
388
|
+
return tableApi.getLeftLeafColumns().filter((col) => col.getIsPinned() === "left").reduce((sum, col) => sum + col.getSize(), 0);
|
|
389
|
+
});
|
|
390
|
+
const pinnedRightWidth = computed(() => {
|
|
391
|
+
return tableApi.getRightLeafColumns().filter((col) => col.getIsPinned() === "right").reduce((sum, col) => sum + col.getSize(), 0);
|
|
392
|
+
});
|
|
393
|
+
const visibleColumns = computed(() => {
|
|
394
|
+
return tableApi.getAllLeafColumns().filter((col) => col.getIsVisible());
|
|
395
|
+
});
|
|
396
|
+
const cumulativeWidthsFromRight = computed(() => {
|
|
397
|
+
const cols = visibleColumns.value;
|
|
398
|
+
const widths = Array.from({ length: cols.length });
|
|
399
|
+
let cumulative = 0;
|
|
400
|
+
for (let i = cols.length - 1; i >= 0; i--) {
|
|
401
|
+
const col = cols[i];
|
|
402
|
+
if (col) {
|
|
403
|
+
cumulative += col.getSize();
|
|
404
|
+
}
|
|
405
|
+
widths[i] = cumulative;
|
|
406
|
+
}
|
|
407
|
+
return widths;
|
|
408
|
+
});
|
|
409
|
+
const scrollManager = new NuGridScrollManager(
|
|
410
|
+
tableApi,
|
|
411
|
+
pinnedLeftWidth,
|
|
412
|
+
pinnedRightWidth,
|
|
413
|
+
visibleColumns,
|
|
414
|
+
cumulativeWidthsFromRight
|
|
415
|
+
);
|
|
416
|
+
const rootElement = computed(() => {
|
|
417
|
+
if (!rootRef?.value) {
|
|
418
|
+
return null;
|
|
419
|
+
}
|
|
420
|
+
return rootRef.value.$el ?? null;
|
|
421
|
+
});
|
|
422
|
+
const scrollContainerCache = ref({
|
|
423
|
+
vertical: null,
|
|
424
|
+
horizontal: null,
|
|
425
|
+
rootElement: null
|
|
426
|
+
});
|
|
427
|
+
function updateScrollContainerCache() {
|
|
428
|
+
const root = rootElement.value;
|
|
429
|
+
scrollContainerCache.value = {
|
|
430
|
+
vertical: findScrollContainer(root, "vertical"),
|
|
431
|
+
horizontal: findScrollContainer(root, "horizontal"),
|
|
432
|
+
rootElement: root
|
|
433
|
+
};
|
|
434
|
+
}
|
|
435
|
+
const verticalScrollContainer = computed(() => {
|
|
436
|
+
const root = rootElement.value;
|
|
437
|
+
if (scrollContainerCache.value.rootElement !== root) {
|
|
438
|
+
updateScrollContainerCache();
|
|
439
|
+
}
|
|
440
|
+
return scrollContainerCache.value.vertical;
|
|
441
|
+
});
|
|
442
|
+
const horizontalScrollContainer = computed(() => {
|
|
443
|
+
const root = rootElement.value;
|
|
444
|
+
if (scrollContainerCache.value.rootElement !== root) {
|
|
445
|
+
updateScrollContainerCache();
|
|
446
|
+
}
|
|
447
|
+
return scrollContainerCache.value.horizontal;
|
|
448
|
+
});
|
|
449
|
+
const { height: observedHeight } = useElementSize(rootElement, void 0, { box: "border-box" });
|
|
450
|
+
watch(observedHeight, () => {
|
|
451
|
+
updateScrollContainerCache();
|
|
452
|
+
});
|
|
453
|
+
return {
|
|
454
|
+
scrollManager,
|
|
455
|
+
pinnedLeftWidth,
|
|
456
|
+
pinnedRightWidth,
|
|
457
|
+
visibleColumns,
|
|
458
|
+
// Scroll containers
|
|
459
|
+
verticalScrollContainer,
|
|
460
|
+
horizontalScrollContainer,
|
|
461
|
+
updateScrollContainerCache
|
|
462
|
+
};
|
|
463
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import type { Ref } from 'vue';
|
|
2
|
+
export interface UseNuGridScrollStateOptions {
|
|
3
|
+
/** Reference to the scrollable container element */
|
|
4
|
+
containerRef: Ref<HTMLElement | null>;
|
|
5
|
+
/** Delay in ms after scrolling stops before considering scroll "settled" (default: 150) */
|
|
6
|
+
settleDelay?: number;
|
|
7
|
+
}
|
|
8
|
+
export interface UseNuGridScrollStateReturn {
|
|
9
|
+
/** Whether the user is currently scrolling */
|
|
10
|
+
isScrolling: Ref<boolean>;
|
|
11
|
+
/** Whether scrolling has settled (stopped for settleDelay ms) */
|
|
12
|
+
isSettled: Ref<boolean>;
|
|
13
|
+
/** Current scroll position */
|
|
14
|
+
scrollTop: Ref<number>;
|
|
15
|
+
/** Current scroll left position */
|
|
16
|
+
scrollLeft: Ref<number>;
|
|
17
|
+
/** Viewport height of the container */
|
|
18
|
+
viewportHeight: Ref<number>;
|
|
19
|
+
/** Total scrollable height */
|
|
20
|
+
scrollHeight: Ref<number>;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Composable for tracking NuGrid scroll state
|
|
24
|
+
*
|
|
25
|
+
* Provides reactive scroll state including:
|
|
26
|
+
* - Whether user is actively scrolling
|
|
27
|
+
* - Whether scrolling has "settled" (stopped for a configurable delay)
|
|
28
|
+
* - Current scroll positions and viewport dimensions
|
|
29
|
+
*
|
|
30
|
+
* Used by LazyCell to defer rendering expensive content during scroll
|
|
31
|
+
*/
|
|
32
|
+
export declare function useNuGridScrollState(options: UseNuGridScrollStateOptions): UseNuGridScrollStateReturn;
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { computed, onUnmounted, ref, watch } from "vue";
|
|
2
|
+
export function useNuGridScrollState(options) {
|
|
3
|
+
const { containerRef, settleDelay = 150 } = options;
|
|
4
|
+
const isScrolling = ref(false);
|
|
5
|
+
const isSettled = ref(true);
|
|
6
|
+
const scrollTop = ref(0);
|
|
7
|
+
const scrollLeft = ref(0);
|
|
8
|
+
const viewportHeight = ref(0);
|
|
9
|
+
const scrollHeight = ref(0);
|
|
10
|
+
let scrollTimeout = null;
|
|
11
|
+
const onScroll = () => {
|
|
12
|
+
const container = containerRef.value;
|
|
13
|
+
if (!container) return;
|
|
14
|
+
scrollTop.value = container.scrollTop;
|
|
15
|
+
scrollLeft.value = container.scrollLeft;
|
|
16
|
+
viewportHeight.value = container.clientHeight;
|
|
17
|
+
scrollHeight.value = container.scrollHeight;
|
|
18
|
+
isScrolling.value = true;
|
|
19
|
+
isSettled.value = false;
|
|
20
|
+
if (scrollTimeout) {
|
|
21
|
+
clearTimeout(scrollTimeout);
|
|
22
|
+
}
|
|
23
|
+
scrollTimeout = setTimeout(() => {
|
|
24
|
+
isScrolling.value = false;
|
|
25
|
+
isSettled.value = true;
|
|
26
|
+
}, settleDelay);
|
|
27
|
+
};
|
|
28
|
+
watch(
|
|
29
|
+
containerRef,
|
|
30
|
+
(container, oldContainer) => {
|
|
31
|
+
if (oldContainer && oldContainer !== container) {
|
|
32
|
+
oldContainer.removeEventListener("scroll", onScroll);
|
|
33
|
+
}
|
|
34
|
+
if (container) {
|
|
35
|
+
container.addEventListener("scroll", onScroll, { passive: true });
|
|
36
|
+
scrollTop.value = container.scrollTop;
|
|
37
|
+
scrollLeft.value = container.scrollLeft;
|
|
38
|
+
viewportHeight.value = container.clientHeight;
|
|
39
|
+
scrollHeight.value = container.scrollHeight;
|
|
40
|
+
}
|
|
41
|
+
},
|
|
42
|
+
{ immediate: true }
|
|
43
|
+
);
|
|
44
|
+
onUnmounted(() => {
|
|
45
|
+
if (scrollTimeout) {
|
|
46
|
+
clearTimeout(scrollTimeout);
|
|
47
|
+
}
|
|
48
|
+
if (containerRef.value) {
|
|
49
|
+
containerRef.value.removeEventListener("scroll", onScroll);
|
|
50
|
+
}
|
|
51
|
+
});
|
|
52
|
+
return {
|
|
53
|
+
isScrolling,
|
|
54
|
+
isSettled,
|
|
55
|
+
scrollTop,
|
|
56
|
+
scrollLeft,
|
|
57
|
+
viewportHeight: computed(() => viewportHeight.value),
|
|
58
|
+
scrollHeight: computed(() => scrollHeight.value)
|
|
59
|
+
};
|
|
60
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { ClassValue } from 'tailwind-variants';
|
|
2
|
+
import type { Ref } from 'vue';
|
|
3
|
+
import type { NuGridScrollbars } from '../../types/index.js';
|
|
4
|
+
export interface UseNuGridScrollbarsOptions {
|
|
5
|
+
/** NuGrid props object */
|
|
6
|
+
props: Record<string, any>;
|
|
7
|
+
containerRef: Ref<HTMLElement | null>;
|
|
8
|
+
/** Theme scrollbar class from ui slot */
|
|
9
|
+
themeClass?: Ref<ClassValue | undefined>;
|
|
10
|
+
}
|
|
11
|
+
export interface UseNuGridScrollbarsReturn {
|
|
12
|
+
scrollbarClass: ComputedRef<string>;
|
|
13
|
+
scrollbarThemeClass: ComputedRef<string>;
|
|
14
|
+
scrollbarAttr: ComputedRef<NuGridScrollbars>;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Composable for handling NuGrid scrollbar styling modes
|
|
18
|
+
*
|
|
19
|
+
* Supports three modes:
|
|
20
|
+
* - 'native': Browser default scrollbar behavior
|
|
21
|
+
* - 'hover': Show styled scrollbar on hover
|
|
22
|
+
* - 'scroll': Show styled scrollbar when scrolling (macOS-like)
|
|
23
|
+
*/
|
|
24
|
+
export declare function useNuGridScrollbars(options: UseNuGridScrollbarsOptions): UseNuGridScrollbarsReturn;
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { computed, onUnmounted, ref, watch } from "vue";
|
|
2
|
+
import { usePropWithDefault } from "../../config/_internal/index.js";
|
|
3
|
+
export function useNuGridScrollbars(options) {
|
|
4
|
+
const { props, containerRef } = options;
|
|
5
|
+
const resolvedMode = usePropWithDefault(props, "layout", "scrollbars");
|
|
6
|
+
const isScrolling = ref(false);
|
|
7
|
+
let scrollTimeout = null;
|
|
8
|
+
const HIDE_DELAY = 700;
|
|
9
|
+
const onScroll = () => {
|
|
10
|
+
if (resolvedMode.value !== "scroll") return;
|
|
11
|
+
isScrolling.value = true;
|
|
12
|
+
if (scrollTimeout) {
|
|
13
|
+
clearTimeout(scrollTimeout);
|
|
14
|
+
}
|
|
15
|
+
scrollTimeout = setTimeout(() => {
|
|
16
|
+
isScrolling.value = false;
|
|
17
|
+
}, HIDE_DELAY);
|
|
18
|
+
};
|
|
19
|
+
watch(
|
|
20
|
+
[containerRef, resolvedMode],
|
|
21
|
+
([container, currentMode], [oldContainer]) => {
|
|
22
|
+
if (oldContainer && oldContainer !== container) {
|
|
23
|
+
oldContainer.removeEventListener("scroll", onScroll);
|
|
24
|
+
}
|
|
25
|
+
if (container && currentMode === "scroll") {
|
|
26
|
+
container.addEventListener("scroll", onScroll, { passive: true });
|
|
27
|
+
}
|
|
28
|
+
},
|
|
29
|
+
{ immediate: true }
|
|
30
|
+
);
|
|
31
|
+
onUnmounted(() => {
|
|
32
|
+
if (scrollTimeout) {
|
|
33
|
+
clearTimeout(scrollTimeout);
|
|
34
|
+
}
|
|
35
|
+
if (containerRef.value) {
|
|
36
|
+
containerRef.value.removeEventListener("scroll", onScroll);
|
|
37
|
+
}
|
|
38
|
+
});
|
|
39
|
+
const scrollbarClass = computed(() => {
|
|
40
|
+
if (resolvedMode.value === "scroll" && isScrolling.value) {
|
|
41
|
+
return "is-scrolling";
|
|
42
|
+
}
|
|
43
|
+
return "";
|
|
44
|
+
});
|
|
45
|
+
const scrollbarAttr = computed(() => resolvedMode.value);
|
|
46
|
+
const scrollbarThemeClass = computed(() => {
|
|
47
|
+
const currentMode = resolvedMode.value;
|
|
48
|
+
if (currentMode === "hover") {
|
|
49
|
+
const themeValue = options.themeClass?.value;
|
|
50
|
+
if (!themeValue) return "";
|
|
51
|
+
if (typeof themeValue === "string") return themeValue;
|
|
52
|
+
if (Array.isArray(themeValue)) return themeValue.filter(Boolean).join(" ");
|
|
53
|
+
return "";
|
|
54
|
+
}
|
|
55
|
+
if (currentMode === "scroll") {
|
|
56
|
+
const base = "scrollbar-thin scrollbar-track-transparent scrollbar-thumb-rounded";
|
|
57
|
+
if (isScrolling.value) {
|
|
58
|
+
return `${base} scrollbar-thumb-gray-400/50 dark:scrollbar-thumb-gray-500/50`;
|
|
59
|
+
}
|
|
60
|
+
return `${base} scrollbar-thumb-transparent`;
|
|
61
|
+
}
|
|
62
|
+
return "";
|
|
63
|
+
});
|
|
64
|
+
return {
|
|
65
|
+
scrollbarClass,
|
|
66
|
+
scrollbarThemeClass,
|
|
67
|
+
scrollbarAttr
|
|
68
|
+
};
|
|
69
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { TableData } from '@nuxt/ui';
|
|
2
|
+
import type { ColumnFiltersState, ColumnOrderState, ColumnPinningState, ColumnSizingInfoState, ColumnSizingState, ExpandedState, GroupingState, PaginationState, RowPinningState, RowSelectionState, SortingState, VisibilityState } from '@tanstack/vue-table';
|
|
3
|
+
import type { NuGridEventEmitter } from '../../types/index.js';
|
|
4
|
+
import type { NuGridStates } from '../../types/_internal/index.js';
|
|
5
|
+
export interface NuGridStateSnapshot {
|
|
6
|
+
globalFilter?: string;
|
|
7
|
+
columnFilters?: ColumnFiltersState;
|
|
8
|
+
columnOrder?: ColumnOrderState;
|
|
9
|
+
columnVisibility?: VisibilityState;
|
|
10
|
+
columnPinning?: ColumnPinningState;
|
|
11
|
+
columnSizing?: ColumnSizingState;
|
|
12
|
+
columnSizingInfo?: ColumnSizingInfoState;
|
|
13
|
+
rowSelection?: RowSelectionState;
|
|
14
|
+
rowPinning?: RowPinningState;
|
|
15
|
+
sorting?: SortingState;
|
|
16
|
+
grouping?: GroupingState;
|
|
17
|
+
expanded?: ExpandedState;
|
|
18
|
+
pagination?: PaginationState;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Composable for persisting and restoring NuGrid state to/from localStorage and cookies
|
|
22
|
+
* Handles all state initialization, restoration, and persistence logic
|
|
23
|
+
*/
|
|
24
|
+
export declare function useNuGridStatePersistence<T extends TableData = TableData>(states: NuGridStates, enabled: boolean, storageId: string | undefined, onStateChanged?: (state: NuGridStateSnapshot) => void, eventEmitter?: NuGridEventEmitter<T>): {
|
|
25
|
+
getState: () => {};
|
|
26
|
+
setState: (_snapshot: NuGridStateSnapshot) => void;
|
|
27
|
+
};
|