@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,243 @@
|
|
|
1
|
+
import { useCookie } from "#imports";
|
|
2
|
+
import { StorageSerializers, useStorage } from "@vueuse/core";
|
|
3
|
+
import { nextTick, onMounted, watch } from "vue";
|
|
4
|
+
export function useNuGridStatePersistence(states, enabled, storageId, onStateChanged, eventEmitter) {
|
|
5
|
+
const emitStateChanged = (state) => {
|
|
6
|
+
if (eventEmitter?.stateChanged) {
|
|
7
|
+
eventEmitter.stateChanged(state);
|
|
8
|
+
}
|
|
9
|
+
onStateChanged?.(state);
|
|
10
|
+
};
|
|
11
|
+
if (!enabled || !storageId) {
|
|
12
|
+
return {
|
|
13
|
+
getState: () => ({}),
|
|
14
|
+
setState: (_snapshot) => {
|
|
15
|
+
}
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
const storageKey = enabled && storageId ? `nugrid-state-${storageId}` : null;
|
|
19
|
+
const cookieStateRef = storageKey ? useCookie(storageKey, {
|
|
20
|
+
default: () => null,
|
|
21
|
+
sameSite: "lax",
|
|
22
|
+
path: "/"
|
|
23
|
+
}) : null;
|
|
24
|
+
const initialPersistedState = cookieStateRef?.value ?? null;
|
|
25
|
+
let storedState = null;
|
|
26
|
+
if (import.meta.client && storageKey) {
|
|
27
|
+
storedState = useStorage(storageKey, null, localStorage, {
|
|
28
|
+
serializer: StorageSerializers.object
|
|
29
|
+
});
|
|
30
|
+
if (storedState && initialPersistedState && storedState.value === null) {
|
|
31
|
+
storedState.value = initialPersistedState;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
let isRestoring = false;
|
|
35
|
+
let watchersActive = false;
|
|
36
|
+
let initialActivationComplete = false;
|
|
37
|
+
if (initialPersistedState) {
|
|
38
|
+
applyStateSnapshot(initialPersistedState);
|
|
39
|
+
emitStateChanged(initialPersistedState);
|
|
40
|
+
}
|
|
41
|
+
if (import.meta.client && storedState) {
|
|
42
|
+
onMounted(() => {
|
|
43
|
+
const hasCookie = cookieStateRef?.value && Object.keys(cookieStateRef.value).length > 0;
|
|
44
|
+
const hasStored = storedState?.value && Object.keys(storedState.value ?? {}).length > 0;
|
|
45
|
+
if (!hasCookie && hasStored) {
|
|
46
|
+
const snapshot = storedState.value;
|
|
47
|
+
isRestoring = true;
|
|
48
|
+
applyStateSnapshot(snapshot);
|
|
49
|
+
if (cookieStateRef) {
|
|
50
|
+
cookieStateRef.value = snapshot;
|
|
51
|
+
}
|
|
52
|
+
emitStateChanged(getState());
|
|
53
|
+
nextTick(() => {
|
|
54
|
+
isRestoring = false;
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
function getState() {
|
|
60
|
+
const snapshot = {};
|
|
61
|
+
if (states.globalFilterState.value) {
|
|
62
|
+
snapshot.globalFilter = states.globalFilterState.value;
|
|
63
|
+
}
|
|
64
|
+
if (hasArray(states.columnFiltersState.value)) {
|
|
65
|
+
snapshot.columnFilters = states.columnFiltersState.value;
|
|
66
|
+
}
|
|
67
|
+
if (hasArray(states.columnOrderState.value)) {
|
|
68
|
+
snapshot.columnOrder = states.columnOrderState.value;
|
|
69
|
+
}
|
|
70
|
+
if (hasKeys(states.columnVisibilityState.value)) {
|
|
71
|
+
snapshot.columnVisibility = states.columnVisibilityState.value;
|
|
72
|
+
}
|
|
73
|
+
if (hasKeys(states.columnPinningState.value)) {
|
|
74
|
+
snapshot.columnPinning = states.columnPinningState.value;
|
|
75
|
+
}
|
|
76
|
+
if (hasKeys(states.columnSizingState.value)) {
|
|
77
|
+
snapshot.columnSizing = states.columnSizingState.value;
|
|
78
|
+
}
|
|
79
|
+
if (hasKeys(states.columnSizingInfoState.value)) {
|
|
80
|
+
snapshot.columnSizingInfo = states.columnSizingInfoState.value;
|
|
81
|
+
}
|
|
82
|
+
if (hasKeys(states.rowSelectionState.value)) {
|
|
83
|
+
snapshot.rowSelection = states.rowSelectionState.value;
|
|
84
|
+
}
|
|
85
|
+
if (hasRowPinning(states.rowPinningState.value)) {
|
|
86
|
+
snapshot.rowPinning = states.rowPinningState.value;
|
|
87
|
+
}
|
|
88
|
+
if (hasArray(states.sortingState.value)) {
|
|
89
|
+
snapshot.sorting = states.sortingState.value;
|
|
90
|
+
}
|
|
91
|
+
if (hasArray(states.groupingState.value)) {
|
|
92
|
+
snapshot.grouping = states.groupingState.value;
|
|
93
|
+
}
|
|
94
|
+
if (hasExpanded(states.expandedState.value)) {
|
|
95
|
+
snapshot.expanded = states.expandedState.value;
|
|
96
|
+
}
|
|
97
|
+
if (hasKeys(states.paginationState.value)) {
|
|
98
|
+
snapshot.pagination = states.paginationState.value;
|
|
99
|
+
}
|
|
100
|
+
return snapshot;
|
|
101
|
+
}
|
|
102
|
+
function hasArray(value) {
|
|
103
|
+
return Array.isArray(value) && value.length > 0;
|
|
104
|
+
}
|
|
105
|
+
function hasKeys(value) {
|
|
106
|
+
return !!value && Object.keys(value).length > 0;
|
|
107
|
+
}
|
|
108
|
+
function hasRowPinning(value) {
|
|
109
|
+
return !!value && ((value.top?.length ?? 0) > 0 || (value.bottom?.length ?? 0) > 0);
|
|
110
|
+
}
|
|
111
|
+
function hasExpanded(value) {
|
|
112
|
+
if (value === void 0 || value === null) return false;
|
|
113
|
+
if (value === true) return true;
|
|
114
|
+
return Object.keys(value).length > 0;
|
|
115
|
+
}
|
|
116
|
+
function applyStateSnapshot(snapshot) {
|
|
117
|
+
if (snapshot.globalFilter !== void 0) {
|
|
118
|
+
states.globalFilterState.value = snapshot.globalFilter;
|
|
119
|
+
}
|
|
120
|
+
if (snapshot.columnFilters !== void 0) {
|
|
121
|
+
states.columnFiltersState.value = snapshot.columnFilters;
|
|
122
|
+
}
|
|
123
|
+
if (snapshot.columnOrder !== void 0) {
|
|
124
|
+
states.columnOrderState.value = snapshot.columnOrder;
|
|
125
|
+
}
|
|
126
|
+
if (snapshot.columnVisibility !== void 0) {
|
|
127
|
+
states.columnVisibilityState.value = snapshot.columnVisibility;
|
|
128
|
+
}
|
|
129
|
+
if (snapshot.columnPinning !== void 0) {
|
|
130
|
+
states.columnPinningState.value = snapshot.columnPinning;
|
|
131
|
+
}
|
|
132
|
+
if (snapshot.columnSizing !== void 0) {
|
|
133
|
+
states.columnSizingState.value = snapshot.columnSizing;
|
|
134
|
+
}
|
|
135
|
+
if (snapshot.columnSizingInfo !== void 0) {
|
|
136
|
+
states.columnSizingInfoState.value = snapshot.columnSizingInfo;
|
|
137
|
+
}
|
|
138
|
+
if (snapshot.rowSelection !== void 0) {
|
|
139
|
+
states.rowSelectionState.value = snapshot.rowSelection;
|
|
140
|
+
}
|
|
141
|
+
if (snapshot.rowPinning !== void 0) {
|
|
142
|
+
states.rowPinningState.value = snapshot.rowPinning;
|
|
143
|
+
}
|
|
144
|
+
if (snapshot.sorting !== void 0) {
|
|
145
|
+
states.sortingState.value = snapshot.sorting;
|
|
146
|
+
}
|
|
147
|
+
if (snapshot.grouping !== void 0) {
|
|
148
|
+
states.groupingState.value = snapshot.grouping;
|
|
149
|
+
}
|
|
150
|
+
if (snapshot.expanded !== void 0) {
|
|
151
|
+
states.expandedState.value = snapshot.expanded;
|
|
152
|
+
}
|
|
153
|
+
if (snapshot.pagination !== void 0) {
|
|
154
|
+
states.paginationState.value = snapshot.pagination;
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
function setState(snapshot) {
|
|
158
|
+
try {
|
|
159
|
+
isRestoring = true;
|
|
160
|
+
applyStateSnapshot(snapshot);
|
|
161
|
+
emitStateChanged(getState());
|
|
162
|
+
nextTick(() => {
|
|
163
|
+
isRestoring = false;
|
|
164
|
+
});
|
|
165
|
+
} catch (error) {
|
|
166
|
+
console.warn("[NuGrid State] Failed to set state:", error);
|
|
167
|
+
isRestoring = false;
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
function saveState() {
|
|
171
|
+
if (isRestoring) {
|
|
172
|
+
return;
|
|
173
|
+
}
|
|
174
|
+
if (!watchersActive) {
|
|
175
|
+
return;
|
|
176
|
+
}
|
|
177
|
+
if (!storedState) {
|
|
178
|
+
return;
|
|
179
|
+
}
|
|
180
|
+
if (!initialActivationComplete) {
|
|
181
|
+
return;
|
|
182
|
+
}
|
|
183
|
+
try {
|
|
184
|
+
const snapshot = getState();
|
|
185
|
+
const hasState = Object.keys(snapshot).length > 0;
|
|
186
|
+
if (hasState) {
|
|
187
|
+
storedState.value = snapshot;
|
|
188
|
+
if (cookieStateRef) {
|
|
189
|
+
cookieStateRef.value = snapshot;
|
|
190
|
+
}
|
|
191
|
+
} else {
|
|
192
|
+
storedState.value = null;
|
|
193
|
+
if (cookieStateRef) {
|
|
194
|
+
cookieStateRef.value = null;
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
emitStateChanged(snapshot);
|
|
198
|
+
} catch (error) {
|
|
199
|
+
console.warn("[NuGrid State] Failed to save state:", error);
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
if (import.meta.client) {
|
|
203
|
+
const watchedRefs = [
|
|
204
|
+
states.globalFilterState,
|
|
205
|
+
states.columnFiltersState,
|
|
206
|
+
states.columnOrderState,
|
|
207
|
+
states.columnVisibilityState,
|
|
208
|
+
states.columnPinningState,
|
|
209
|
+
states.columnSizingState,
|
|
210
|
+
states.columnSizingInfoState,
|
|
211
|
+
states.rowSelectionState,
|
|
212
|
+
states.rowPinningState,
|
|
213
|
+
states.sortingState,
|
|
214
|
+
states.groupingState,
|
|
215
|
+
states.expandedState,
|
|
216
|
+
states.paginationState
|
|
217
|
+
];
|
|
218
|
+
for (const ref of watchedRefs) {
|
|
219
|
+
watch(
|
|
220
|
+
() => ref.value,
|
|
221
|
+
() => saveState(),
|
|
222
|
+
{ deep: true }
|
|
223
|
+
);
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
if (storageKey && storedState) {
|
|
227
|
+
if (import.meta.client) {
|
|
228
|
+
nextTick(() => {
|
|
229
|
+
watchersActive = true;
|
|
230
|
+
setTimeout(() => {
|
|
231
|
+
initialActivationComplete = true;
|
|
232
|
+
}, 100);
|
|
233
|
+
});
|
|
234
|
+
}
|
|
235
|
+
} else if (import.meta.client) {
|
|
236
|
+
watchersActive = true;
|
|
237
|
+
initialActivationComplete = true;
|
|
238
|
+
}
|
|
239
|
+
return {
|
|
240
|
+
getState,
|
|
241
|
+
setState
|
|
242
|
+
};
|
|
243
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import type { TableData } from '@nuxt/ui';
|
|
2
|
+
import type { Table } from '@tanstack/vue-table';
|
|
3
|
+
import type { ComputedRef, Ref } from 'vue';
|
|
4
|
+
import type { NuGridProps } from '../../types/index.js';
|
|
5
|
+
import type { NuGridHoverHandler, NuGridPointerHandler } from '../../types/_internal/index.js';
|
|
6
|
+
import type { NuGridColumn } from '../../types/column.js';
|
|
7
|
+
interface TooltipRouterInterface {
|
|
8
|
+
registerHoverHandler: (handler: NuGridHoverHandler) => () => void;
|
|
9
|
+
registerGlobalPointerHandler: (handler: NuGridPointerHandler) => () => void;
|
|
10
|
+
}
|
|
11
|
+
export interface TooltipState {
|
|
12
|
+
text: string;
|
|
13
|
+
x: number;
|
|
14
|
+
y: number;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Lightweight shared tooltip for NuGrid
|
|
18
|
+
* Uses the interaction router for all mouse events
|
|
19
|
+
* Works for cells, headers, and any element with truncated text
|
|
20
|
+
*/
|
|
21
|
+
export declare function useNuGridTooltip(): {
|
|
22
|
+
tooltipState: Ref<{
|
|
23
|
+
text: string;
|
|
24
|
+
x: number;
|
|
25
|
+
y: number;
|
|
26
|
+
} | null, TooltipState | {
|
|
27
|
+
text: string;
|
|
28
|
+
x: number;
|
|
29
|
+
y: number;
|
|
30
|
+
} | null>;
|
|
31
|
+
};
|
|
32
|
+
interface TooltipHandlerOptions<T extends TableData = TableData> {
|
|
33
|
+
tableApi?: Ref<Table<T> | undefined>;
|
|
34
|
+
columns?: ComputedRef<NuGridColumn<T>[] | undefined>;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Register tooltip hover handling with the interaction router
|
|
38
|
+
* Call this once from NuGrid.vue
|
|
39
|
+
*/
|
|
40
|
+
export declare function useNuGridTooltipHandler<T extends TableData = TableData>(props: NuGridProps<T>, interactionRouter: TooltipRouterInterface, handlerOptions?: TooltipHandlerOptions<T>): void;
|
|
41
|
+
export {};
|
|
@@ -0,0 +1,304 @@
|
|
|
1
|
+
import { onUnmounted, ref } from "vue";
|
|
2
|
+
import { usePropWithDefault } from "../../config/_internal/index.js";
|
|
3
|
+
const tooltipState = ref(null);
|
|
4
|
+
let showTimeout = null;
|
|
5
|
+
let hideTimeout = null;
|
|
6
|
+
let currentHoveredCell = null;
|
|
7
|
+
let lastMouseX = 0;
|
|
8
|
+
let lastMouseY = 0;
|
|
9
|
+
export function useNuGridTooltip() {
|
|
10
|
+
return {
|
|
11
|
+
tooltipState
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
export function useNuGridTooltipHandler(props, interactionRouter, handlerOptions) {
|
|
15
|
+
const truncatedOnly = usePropWithDefault(props, "tooltip", "truncatedOnly");
|
|
16
|
+
const showDelay = usePropWithDefault(props, "tooltip", "showDelay");
|
|
17
|
+
const hideDelay = usePropWithDefault(props, "tooltip", "hideDelay");
|
|
18
|
+
const mouseFollow = usePropWithDefault(props, "tooltip", "mouseFollow");
|
|
19
|
+
const getOptions = () => {
|
|
20
|
+
if (props.tooltip === false) return null;
|
|
21
|
+
return {
|
|
22
|
+
truncatedOnly: truncatedOnly.value,
|
|
23
|
+
showDelay: showDelay.value,
|
|
24
|
+
hideDelay: hideDelay.value,
|
|
25
|
+
mouseFollow: mouseFollow.value
|
|
26
|
+
};
|
|
27
|
+
};
|
|
28
|
+
const getColumnDef = (columnId) => {
|
|
29
|
+
const cols = handlerOptions?.columns?.value;
|
|
30
|
+
if (!cols) return void 0;
|
|
31
|
+
return cols.find((col) => {
|
|
32
|
+
const colId = col.accessorKey || col.id;
|
|
33
|
+
return colId === columnId;
|
|
34
|
+
});
|
|
35
|
+
};
|
|
36
|
+
const getRowData = (rowId) => {
|
|
37
|
+
const tableApi = handlerOptions?.tableApi?.value;
|
|
38
|
+
if (!tableApi) return void 0;
|
|
39
|
+
const rows = tableApi.getRowModel().rows;
|
|
40
|
+
const row = rows.find((r) => r.id === rowId);
|
|
41
|
+
return row?.original;
|
|
42
|
+
};
|
|
43
|
+
function scheduleShowTooltip(text) {
|
|
44
|
+
const opts = getOptions();
|
|
45
|
+
if (!opts) return;
|
|
46
|
+
if (hideTimeout) {
|
|
47
|
+
clearTimeout(hideTimeout);
|
|
48
|
+
hideTimeout = null;
|
|
49
|
+
}
|
|
50
|
+
if (showTimeout) {
|
|
51
|
+
clearTimeout(showTimeout);
|
|
52
|
+
showTimeout = null;
|
|
53
|
+
}
|
|
54
|
+
if (tooltipState.value) {
|
|
55
|
+
tooltipState.value = {
|
|
56
|
+
text,
|
|
57
|
+
x: lastMouseX,
|
|
58
|
+
y: lastMouseY
|
|
59
|
+
};
|
|
60
|
+
return;
|
|
61
|
+
}
|
|
62
|
+
showTimeout = setTimeout(() => {
|
|
63
|
+
tooltipState.value = {
|
|
64
|
+
text,
|
|
65
|
+
x: lastMouseX,
|
|
66
|
+
y: lastMouseY
|
|
67
|
+
};
|
|
68
|
+
showTimeout = null;
|
|
69
|
+
}, opts.showDelay);
|
|
70
|
+
}
|
|
71
|
+
function hideTooltip() {
|
|
72
|
+
const opts = getOptions();
|
|
73
|
+
if (!opts) {
|
|
74
|
+
hideTooltipImmediate();
|
|
75
|
+
return;
|
|
76
|
+
}
|
|
77
|
+
if (showTimeout) {
|
|
78
|
+
clearTimeout(showTimeout);
|
|
79
|
+
showTimeout = null;
|
|
80
|
+
}
|
|
81
|
+
currentHoveredCell = null;
|
|
82
|
+
hideTimeout = setTimeout(() => {
|
|
83
|
+
tooltipState.value = null;
|
|
84
|
+
}, opts.hideDelay);
|
|
85
|
+
}
|
|
86
|
+
function hideTooltipImmediate() {
|
|
87
|
+
if (showTimeout) {
|
|
88
|
+
clearTimeout(showTimeout);
|
|
89
|
+
showTimeout = null;
|
|
90
|
+
}
|
|
91
|
+
if (hideTimeout) {
|
|
92
|
+
clearTimeout(hideTimeout);
|
|
93
|
+
hideTimeout = null;
|
|
94
|
+
}
|
|
95
|
+
tooltipState.value = null;
|
|
96
|
+
currentHoveredCell = null;
|
|
97
|
+
}
|
|
98
|
+
function findCellElement(target) {
|
|
99
|
+
let el = target;
|
|
100
|
+
while (el) {
|
|
101
|
+
if (el.hasAttribute("data-editing")) {
|
|
102
|
+
return null;
|
|
103
|
+
}
|
|
104
|
+
if (el.hasAttribute("data-column-id") && el.hasAttribute("data-cell-index")) {
|
|
105
|
+
return el;
|
|
106
|
+
}
|
|
107
|
+
if (el.hasAttribute("data-nugrid") || el.tagName === "BODY") {
|
|
108
|
+
break;
|
|
109
|
+
}
|
|
110
|
+
el = el.parentElement;
|
|
111
|
+
}
|
|
112
|
+
return null;
|
|
113
|
+
}
|
|
114
|
+
function findHeaderElement(target) {
|
|
115
|
+
let el = target;
|
|
116
|
+
while (el) {
|
|
117
|
+
if (el.hasAttribute("data-column-id") && !el.hasAttribute("data-cell-index")) {
|
|
118
|
+
if (!el.closest("[data-row-id]")) {
|
|
119
|
+
return el;
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
if (el.hasAttribute("data-nugrid") || el.tagName === "BODY") {
|
|
123
|
+
break;
|
|
124
|
+
}
|
|
125
|
+
el = el.parentElement;
|
|
126
|
+
}
|
|
127
|
+
return null;
|
|
128
|
+
}
|
|
129
|
+
function findTruncatableContent(cell) {
|
|
130
|
+
return cell.querySelector(".truncate");
|
|
131
|
+
}
|
|
132
|
+
function isTruncated(element) {
|
|
133
|
+
return element.scrollWidth > element.clientWidth;
|
|
134
|
+
}
|
|
135
|
+
function getTooltipText(element) {
|
|
136
|
+
const text = element.textContent?.trim();
|
|
137
|
+
return text || null;
|
|
138
|
+
}
|
|
139
|
+
function getCellTooltipText(cell) {
|
|
140
|
+
const columnId = cell.getAttribute("data-column-id");
|
|
141
|
+
if (!columnId) return { text: null, forceShow: false };
|
|
142
|
+
const columnDef = getColumnDef(columnId);
|
|
143
|
+
if (columnDef?.tooltipValue) {
|
|
144
|
+
const rowElement = cell.closest("[data-row-id]");
|
|
145
|
+
const rowId = rowElement?.getAttribute("data-row-id");
|
|
146
|
+
if (rowId) {
|
|
147
|
+
const rowData = getRowData(rowId);
|
|
148
|
+
if (rowData) {
|
|
149
|
+
try {
|
|
150
|
+
const text = columnDef.tooltipValue(rowData);
|
|
151
|
+
if (text) {
|
|
152
|
+
return { text, forceShow: true };
|
|
153
|
+
}
|
|
154
|
+
} catch {
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
if (columnDef?.tooltipField) {
|
|
160
|
+
const rowElement = cell.closest("[data-row-id]");
|
|
161
|
+
const rowId = rowElement?.getAttribute("data-row-id");
|
|
162
|
+
if (rowId) {
|
|
163
|
+
const rowData = getRowData(rowId);
|
|
164
|
+
if (rowData) {
|
|
165
|
+
const fieldValue = rowData[columnDef.tooltipField];
|
|
166
|
+
if (fieldValue != null) {
|
|
167
|
+
return { text: String(fieldValue), forceShow: true };
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
const truncatableContent = findTruncatableContent(cell);
|
|
173
|
+
if (truncatableContent) {
|
|
174
|
+
return { text: getTooltipText(truncatableContent), forceShow: false };
|
|
175
|
+
}
|
|
176
|
+
return { text: null, forceShow: false };
|
|
177
|
+
}
|
|
178
|
+
function getHeaderTooltipText(header) {
|
|
179
|
+
const columnId = header.getAttribute("data-column-id");
|
|
180
|
+
if (!columnId) return { text: null, forceShow: false };
|
|
181
|
+
const columnDef = getColumnDef(columnId);
|
|
182
|
+
if (columnDef?.tooltipHeaderValue) {
|
|
183
|
+
try {
|
|
184
|
+
const text = columnDef.tooltipHeaderValue();
|
|
185
|
+
if (text) {
|
|
186
|
+
return { text, forceShow: true };
|
|
187
|
+
}
|
|
188
|
+
} catch {
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
if (columnDef?.tooltipHeader) {
|
|
192
|
+
const truncatableContent2 = findTruncatableContent(header);
|
|
193
|
+
if (truncatableContent2) {
|
|
194
|
+
const text2 = getTooltipText(truncatableContent2);
|
|
195
|
+
if (text2) {
|
|
196
|
+
return { text: text2, forceShow: false };
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
const text = header.textContent?.trim();
|
|
200
|
+
if (text) {
|
|
201
|
+
return { text, forceShow: false };
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
const truncatableContent = findTruncatableContent(header);
|
|
205
|
+
if (truncatableContent) {
|
|
206
|
+
return { text: getTooltipText(truncatableContent), forceShow: false };
|
|
207
|
+
}
|
|
208
|
+
return { text: null, forceShow: false };
|
|
209
|
+
}
|
|
210
|
+
function handleHover(context) {
|
|
211
|
+
const opts = getOptions();
|
|
212
|
+
if (!opts) return;
|
|
213
|
+
const { target, type, event } = context;
|
|
214
|
+
lastMouseX = event.clientX;
|
|
215
|
+
lastMouseY = event.clientY;
|
|
216
|
+
if (type === "move") {
|
|
217
|
+
if (opts.mouseFollow && tooltipState.value) {
|
|
218
|
+
tooltipState.value = {
|
|
219
|
+
...tooltipState.value,
|
|
220
|
+
x: lastMouseX,
|
|
221
|
+
y: lastMouseY
|
|
222
|
+
};
|
|
223
|
+
}
|
|
224
|
+
return;
|
|
225
|
+
}
|
|
226
|
+
if (type === "leave") {
|
|
227
|
+
const relatedTarget = event.relatedTarget;
|
|
228
|
+
if (!relatedTarget) {
|
|
229
|
+
hideTooltip();
|
|
230
|
+
return;
|
|
231
|
+
}
|
|
232
|
+
const newCell = findCellElement(relatedTarget);
|
|
233
|
+
const newHeader = findHeaderElement(relatedTarget);
|
|
234
|
+
if (!newCell && !newHeader) {
|
|
235
|
+
hideTooltip();
|
|
236
|
+
} else if (newCell && newCell !== currentHoveredCell) {
|
|
237
|
+
hideTooltip();
|
|
238
|
+
} else if (newHeader && newHeader !== currentHoveredCell) {
|
|
239
|
+
hideTooltip();
|
|
240
|
+
}
|
|
241
|
+
return;
|
|
242
|
+
}
|
|
243
|
+
const header = findHeaderElement(target);
|
|
244
|
+
if (header && header !== currentHoveredCell) {
|
|
245
|
+
currentHoveredCell = header;
|
|
246
|
+
const { text, forceShow } = getHeaderTooltipText(header);
|
|
247
|
+
if (text) {
|
|
248
|
+
const truncatableContent = findTruncatableContent(header);
|
|
249
|
+
const shouldShow = forceShow || truncatableContent && (!opts.truncatedOnly || isTruncated(truncatableContent));
|
|
250
|
+
if (shouldShow) {
|
|
251
|
+
scheduleShowTooltip(text);
|
|
252
|
+
} else if (tooltipState.value) {
|
|
253
|
+
hideTooltip();
|
|
254
|
+
}
|
|
255
|
+
} else if (tooltipState.value) {
|
|
256
|
+
hideTooltip();
|
|
257
|
+
}
|
|
258
|
+
return;
|
|
259
|
+
}
|
|
260
|
+
const cell = findCellElement(target);
|
|
261
|
+
if (cell && cell !== currentHoveredCell) {
|
|
262
|
+
currentHoveredCell = cell;
|
|
263
|
+
const { text, forceShow } = getCellTooltipText(cell);
|
|
264
|
+
if (text) {
|
|
265
|
+
const truncatableContent = findTruncatableContent(cell);
|
|
266
|
+
const shouldShow = forceShow || truncatableContent && (!opts.truncatedOnly || isTruncated(truncatableContent));
|
|
267
|
+
if (shouldShow) {
|
|
268
|
+
scheduleShowTooltip(text);
|
|
269
|
+
} else if (tooltipState.value) {
|
|
270
|
+
hideTooltip();
|
|
271
|
+
}
|
|
272
|
+
} else if (tooltipState.value) {
|
|
273
|
+
hideTooltip();
|
|
274
|
+
}
|
|
275
|
+
} else if (!cell && !header && currentHoveredCell) {
|
|
276
|
+
hideTooltip();
|
|
277
|
+
}
|
|
278
|
+
}
|
|
279
|
+
const unregisterHover = interactionRouter.registerHoverHandler({
|
|
280
|
+
id: "nugrid-tooltip",
|
|
281
|
+
priority: 100,
|
|
282
|
+
// Low priority - run after other handlers
|
|
283
|
+
handle: handleHover
|
|
284
|
+
});
|
|
285
|
+
const unregisterPointer = interactionRouter.registerGlobalPointerHandler({
|
|
286
|
+
id: "nugrid-tooltip-pointer",
|
|
287
|
+
priority: 100,
|
|
288
|
+
handle: () => {
|
|
289
|
+
hideTooltipImmediate();
|
|
290
|
+
}
|
|
291
|
+
});
|
|
292
|
+
onUnmounted(() => {
|
|
293
|
+
unregisterHover();
|
|
294
|
+
unregisterPointer();
|
|
295
|
+
if (showTimeout) {
|
|
296
|
+
clearTimeout(showTimeout);
|
|
297
|
+
}
|
|
298
|
+
if (hideTimeout) {
|
|
299
|
+
clearTimeout(hideTimeout);
|
|
300
|
+
}
|
|
301
|
+
tooltipState.value = null;
|
|
302
|
+
currentHoveredCell = null;
|
|
303
|
+
});
|
|
304
|
+
}
|