@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,62 @@
|
|
|
1
|
+
import type { TableData, TableProps, TableRow } from '@nuxt/ui';
|
|
2
|
+
import type { Updater, VisibilityState } from '@tanstack/vue-table';
|
|
3
|
+
import type { ComponentPublicInstance, Ref } from 'vue';
|
|
4
|
+
import type { NuGridActionMenuOptions, NuGridColumn, NuGridEventEmitter, NuGridProps } from '../../types/index.js';
|
|
5
|
+
import type { NuGridRowSelectionMode, NuGridStates, PinnableHeader, UseNuGridColumnsReturn } from '../../types/_internal/index.js';
|
|
6
|
+
/**
|
|
7
|
+
* Shared logic for processing columns with default cell renderers
|
|
8
|
+
*/
|
|
9
|
+
export declare function useNuGridColumns<T extends TableData>(propsColumns: Ref<NuGridColumn<T>[] | undefined>, data: Ref<T[]>, rowSelectionMode?: Ref<NuGridRowSelectionMode<T>>, actionMenuOptions?: Ref<NuGridActionMenuOptions<T> | undefined | false>, columnVisibilityState?: Ref<VisibilityState>): UseNuGridColumnsReturn<T>;
|
|
10
|
+
/**
|
|
11
|
+
* Helper function to update state values
|
|
12
|
+
*/
|
|
13
|
+
export declare function valueUpdater<T extends Updater<any>>(updaterOrValue: T, ref: Ref): void;
|
|
14
|
+
/**
|
|
15
|
+
* Resolve value or function
|
|
16
|
+
*/
|
|
17
|
+
export declare function resolveValue<T, A = undefined>(prop: T | ((arg: A) => T), arg?: A): T | undefined;
|
|
18
|
+
/**
|
|
19
|
+
* Resolve style object from string or function
|
|
20
|
+
*/
|
|
21
|
+
export declare function resolveStyleObject<T>(prop: string | Record<string, string> | ((arg: T) => string | Record<string, string>) | undefined, arg?: T): Record<string, string>;
|
|
22
|
+
/**
|
|
23
|
+
* Determine the effective pinning state for a header.
|
|
24
|
+
* For regular columns (colSpan <= 1), returns the column's pinning state.
|
|
25
|
+
* For column groups (colSpan > 1), returns the pinning state only if ALL leaf columns
|
|
26
|
+
* share the same pinning state. Returns false for mixed pinning.
|
|
27
|
+
*
|
|
28
|
+
* This should be used for BOTH the CSS class and the inline style to ensure consistency.
|
|
29
|
+
*/
|
|
30
|
+
export declare function getHeaderEffectivePinning(header: PinnableHeader): false | 'left' | 'right';
|
|
31
|
+
/**
|
|
32
|
+
* Calculate pinning style for a header cell.
|
|
33
|
+
* Handles both regular columns (colSpan === 1) and column group headers (colSpan > 1).
|
|
34
|
+
*
|
|
35
|
+
* For column groups, the position is calculated based on the leaf headers:
|
|
36
|
+
* - Left-pinned groups: use the first leaf header's left position
|
|
37
|
+
* - Right-pinned groups: use the last leaf header's right position
|
|
38
|
+
*/
|
|
39
|
+
export declare function getHeaderPinningStyle(header: PinnableHeader, options?: {
|
|
40
|
+
zIndex?: number;
|
|
41
|
+
includeZIndex?: boolean;
|
|
42
|
+
}): Record<string, string | number>;
|
|
43
|
+
export declare function createRowReusableTemplate<T>(): import("@vueuse/core").ReusableTemplatePair<{
|
|
44
|
+
row: TableRow<T>;
|
|
45
|
+
style?: Record<string, string>;
|
|
46
|
+
dataIndex?: number;
|
|
47
|
+
measureRef?: (el: Element | ComponentPublicInstance | null) => void;
|
|
48
|
+
}, Record<"default", undefined>>;
|
|
49
|
+
/**
|
|
50
|
+
* Create table API instance with all features configured
|
|
51
|
+
*/
|
|
52
|
+
export declare function useNuGridApi<T extends TableData>(props: NuGridProps<T> | TableProps<T>, data: Ref<T[]>, columns: Ref<NuGridColumn<T>[]>, states: NuGridStates, rowSelectionMode?: Ref<NuGridRowSelectionMode<T>>, eventEmitter?: NuGridEventEmitter<T>): import("@tanstack/table-core").Table<T>;
|
|
53
|
+
/**
|
|
54
|
+
* Check if table has footer columns
|
|
55
|
+
*/
|
|
56
|
+
export declare function useNuGridFooter<T extends TableData>(columns: Ref<NuGridColumn<T>[]>): {
|
|
57
|
+
hasFooter: import("vue").ComputedRef<boolean>;
|
|
58
|
+
};
|
|
59
|
+
/**
|
|
60
|
+
* Watch for data changes
|
|
61
|
+
*/
|
|
62
|
+
export declare function useNuGridDataWatch<T extends TableData>(props: NuGridProps<T>, data: Ref<T[]>): void;
|
|
@@ -0,0 +1,359 @@
|
|
|
1
|
+
import {
|
|
2
|
+
getCoreRowModel,
|
|
3
|
+
getExpandedRowModel,
|
|
4
|
+
getFilteredRowModel,
|
|
5
|
+
getGroupedRowModel,
|
|
6
|
+
getPaginationRowModel,
|
|
7
|
+
getSortedRowModel,
|
|
8
|
+
useVueTable
|
|
9
|
+
} from "@tanstack/vue-table";
|
|
10
|
+
import { createReusableTemplate, reactiveOmit } from "@vueuse/core";
|
|
11
|
+
import { upperFirst } from "scule";
|
|
12
|
+
import { computed, watch } from "vue";
|
|
13
|
+
import { nuGridDefaults } from "../../config/_internal/index.js";
|
|
14
|
+
import { nuGridCellTypeRegistry } from "../useNuGridCellTypeRegistry.js";
|
|
15
|
+
import { useNuGridActionMenu } from "./useNuGridActionMenu.js";
|
|
16
|
+
import { useNuGridRowSelection } from "./useNuGridRowSelection.js";
|
|
17
|
+
export function useNuGridColumns(propsColumns, data, rowSelectionMode, actionMenuOptions, columnVisibilityState) {
|
|
18
|
+
const rowSelection = rowSelectionMode ? useNuGridRowSelection(rowSelectionMode, columnVisibilityState) : null;
|
|
19
|
+
const actionMenu = actionMenuOptions ? useNuGridActionMenu(actionMenuOptions, columnVisibilityState) : null;
|
|
20
|
+
const columns = computed(() => {
|
|
21
|
+
const cols = propsColumns.value ?? Object.keys(data.value[0] ?? {}).map((accessorKey) => ({
|
|
22
|
+
accessorKey,
|
|
23
|
+
header: upperFirst(accessorKey)
|
|
24
|
+
}));
|
|
25
|
+
let processedCols = processColumns(cols);
|
|
26
|
+
if (rowSelection) {
|
|
27
|
+
processedCols = rowSelection.prependSelectionColumn(processedCols);
|
|
28
|
+
}
|
|
29
|
+
if (actionMenu) {
|
|
30
|
+
processedCols = actionMenu.appendActionMenuColumn(processedCols);
|
|
31
|
+
}
|
|
32
|
+
return processedCols;
|
|
33
|
+
});
|
|
34
|
+
const pluginCache = /* @__PURE__ */ new Map();
|
|
35
|
+
function processColumns(columns2) {
|
|
36
|
+
return columns2.map((column) => {
|
|
37
|
+
const col = { ...column };
|
|
38
|
+
if ("columns" in col && col.columns) {
|
|
39
|
+
col.columns = processColumns(col.columns);
|
|
40
|
+
}
|
|
41
|
+
const cellDataType = col.cellDataType;
|
|
42
|
+
if (cellDataType) {
|
|
43
|
+
let plugin = pluginCache.get(cellDataType);
|
|
44
|
+
if (plugin === void 0) {
|
|
45
|
+
plugin = nuGridCellTypeRegistry.get(cellDataType);
|
|
46
|
+
pluginCache.set(cellDataType, plugin);
|
|
47
|
+
}
|
|
48
|
+
if (plugin?.defaultColumnDef) {
|
|
49
|
+
Object.assign(col, plugin.defaultColumnDef, col);
|
|
50
|
+
}
|
|
51
|
+
if (!col.cell && plugin?.defaultCellRenderer) {
|
|
52
|
+
col.cell = ({ getValue, row, column: colColumn, table }) => {
|
|
53
|
+
const context = {
|
|
54
|
+
cell: { getValue, column: colColumn },
|
|
55
|
+
row,
|
|
56
|
+
getValue,
|
|
57
|
+
column: colColumn,
|
|
58
|
+
table
|
|
59
|
+
};
|
|
60
|
+
return plugin.defaultCellRenderer(context);
|
|
61
|
+
};
|
|
62
|
+
}
|
|
63
|
+
if (!col.cell && plugin?.formatter) {
|
|
64
|
+
col.cell = ({ getValue, row, column: colColumn, table }) => {
|
|
65
|
+
const rawValue = getValue();
|
|
66
|
+
const pluginContext = {
|
|
67
|
+
cell: { getValue: () => rawValue, column: colColumn },
|
|
68
|
+
row,
|
|
69
|
+
columnDef: colColumn.columnDef,
|
|
70
|
+
column: colColumn,
|
|
71
|
+
getValue: () => rawValue,
|
|
72
|
+
isFocused: false,
|
|
73
|
+
canEdit: true,
|
|
74
|
+
data: data.value,
|
|
75
|
+
tableApi: table,
|
|
76
|
+
startEditing: () => {
|
|
77
|
+
},
|
|
78
|
+
stopEditing: () => {
|
|
79
|
+
},
|
|
80
|
+
emitChange: () => {
|
|
81
|
+
}
|
|
82
|
+
};
|
|
83
|
+
const formattedValue = plugin.formatter(rawValue, pluginContext);
|
|
84
|
+
if (formattedValue === "" || formattedValue === null || formattedValue === void 0) {
|
|
85
|
+
return "\xA0";
|
|
86
|
+
}
|
|
87
|
+
return formattedValue;
|
|
88
|
+
};
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
if (!col.cell) {
|
|
92
|
+
col.cell = ({ getValue }) => {
|
|
93
|
+
const value = getValue();
|
|
94
|
+
if (value === "" || value === null || value === void 0) {
|
|
95
|
+
return "\xA0";
|
|
96
|
+
}
|
|
97
|
+
return String(value);
|
|
98
|
+
};
|
|
99
|
+
}
|
|
100
|
+
return col;
|
|
101
|
+
});
|
|
102
|
+
}
|
|
103
|
+
return { columns, rowSelection, actionMenu };
|
|
104
|
+
}
|
|
105
|
+
export function valueUpdater(updaterOrValue, ref) {
|
|
106
|
+
ref.value = typeof updaterOrValue === "function" ? updaterOrValue(ref.value) : updaterOrValue;
|
|
107
|
+
}
|
|
108
|
+
export function resolveValue(prop, arg) {
|
|
109
|
+
if (typeof prop === "function") {
|
|
110
|
+
return prop(arg);
|
|
111
|
+
}
|
|
112
|
+
return prop;
|
|
113
|
+
}
|
|
114
|
+
export function resolveStyleObject(prop, arg) {
|
|
115
|
+
const resolved = resolveValue(prop, arg);
|
|
116
|
+
if (!resolved) return {};
|
|
117
|
+
if (typeof resolved === "string") return {};
|
|
118
|
+
return resolved;
|
|
119
|
+
}
|
|
120
|
+
export function getHeaderEffectivePinning(header) {
|
|
121
|
+
const pinned = header.column.getIsPinned();
|
|
122
|
+
if (!pinned) {
|
|
123
|
+
return false;
|
|
124
|
+
}
|
|
125
|
+
if (header.colSpan <= 1) {
|
|
126
|
+
return pinned;
|
|
127
|
+
}
|
|
128
|
+
const leafHeaders = header.getLeafHeaders();
|
|
129
|
+
if (leafHeaders.length === 0) {
|
|
130
|
+
return false;
|
|
131
|
+
}
|
|
132
|
+
const allSamePinning = leafHeaders.every((leaf) => leaf.column.getIsPinned() === pinned);
|
|
133
|
+
if (!allSamePinning) {
|
|
134
|
+
return false;
|
|
135
|
+
}
|
|
136
|
+
return pinned;
|
|
137
|
+
}
|
|
138
|
+
export function getHeaderPinningStyle(header, options = {}) {
|
|
139
|
+
const { zIndex = 20, includeZIndex = true } = options;
|
|
140
|
+
const effectivePinned = getHeaderEffectivePinning(header);
|
|
141
|
+
if (!effectivePinned) {
|
|
142
|
+
return {};
|
|
143
|
+
}
|
|
144
|
+
const buildResult = (positionStyle) => {
|
|
145
|
+
if (includeZIndex && zIndex !== void 0) {
|
|
146
|
+
return { ...positionStyle, zIndex };
|
|
147
|
+
}
|
|
148
|
+
return positionStyle;
|
|
149
|
+
};
|
|
150
|
+
if (header.colSpan <= 1) {
|
|
151
|
+
if (effectivePinned === "left") {
|
|
152
|
+
return buildResult({ left: `${header.column.getStart("left")}px` });
|
|
153
|
+
}
|
|
154
|
+
if (effectivePinned === "right") {
|
|
155
|
+
return buildResult({ right: `${header.column.getAfter("right")}px` });
|
|
156
|
+
}
|
|
157
|
+
return {};
|
|
158
|
+
}
|
|
159
|
+
const leafHeaders = header.getLeafHeaders();
|
|
160
|
+
if (leafHeaders.length === 0) {
|
|
161
|
+
return {};
|
|
162
|
+
}
|
|
163
|
+
if (effectivePinned === "left") {
|
|
164
|
+
const firstLeaf = leafHeaders[0];
|
|
165
|
+
if (!firstLeaf) return {};
|
|
166
|
+
return buildResult({ left: `${firstLeaf.column.getStart("left")}px` });
|
|
167
|
+
}
|
|
168
|
+
if (effectivePinned === "right") {
|
|
169
|
+
const lastLeaf = leafHeaders[leafHeaders.length - 1];
|
|
170
|
+
if (!lastLeaf) return {};
|
|
171
|
+
return buildResult({ right: `${lastLeaf.column.getAfter("right")}px` });
|
|
172
|
+
}
|
|
173
|
+
return {};
|
|
174
|
+
}
|
|
175
|
+
export function createRowReusableTemplate() {
|
|
176
|
+
return createReusableTemplate({
|
|
177
|
+
inheritAttrs: false,
|
|
178
|
+
props: {
|
|
179
|
+
row: {
|
|
180
|
+
type: Object,
|
|
181
|
+
required: true
|
|
182
|
+
},
|
|
183
|
+
style: {
|
|
184
|
+
type: Object,
|
|
185
|
+
required: false
|
|
186
|
+
},
|
|
187
|
+
dataIndex: {
|
|
188
|
+
type: Number,
|
|
189
|
+
required: false
|
|
190
|
+
},
|
|
191
|
+
measureRef: {
|
|
192
|
+
type: Function,
|
|
193
|
+
required: false
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
});
|
|
197
|
+
}
|
|
198
|
+
export function useNuGridApi(props, data, columns, states, rowSelectionMode, eventEmitter) {
|
|
199
|
+
const meta = computed(() => props.meta ?? {});
|
|
200
|
+
const rowSelection = rowSelectionMode ? useNuGridRowSelection(rowSelectionMode) : null;
|
|
201
|
+
const filteredProps = reactiveOmit(
|
|
202
|
+
props,
|
|
203
|
+
"as",
|
|
204
|
+
"data",
|
|
205
|
+
"columns",
|
|
206
|
+
"virtualization",
|
|
207
|
+
"caption",
|
|
208
|
+
"sticky",
|
|
209
|
+
"loading",
|
|
210
|
+
"loadingColor",
|
|
211
|
+
"loadingAnimation",
|
|
212
|
+
"class",
|
|
213
|
+
"ui"
|
|
214
|
+
);
|
|
215
|
+
const tableApi = useVueTable({
|
|
216
|
+
...filteredProps,
|
|
217
|
+
data,
|
|
218
|
+
columns: columns.value,
|
|
219
|
+
meta: meta.value,
|
|
220
|
+
// Use rowId prop for stable row identity (required for animations)
|
|
221
|
+
// Falls back to index if the specified field is not present
|
|
222
|
+
getRowId: (originalRow, index) => {
|
|
223
|
+
const rowIdProp = props.rowId ?? nuGridDefaults.rowId;
|
|
224
|
+
if (typeof rowIdProp === "function") {
|
|
225
|
+
return rowIdProp(originalRow);
|
|
226
|
+
}
|
|
227
|
+
const id = originalRow[rowIdProp];
|
|
228
|
+
return id !== void 0 ? String(id) : String(index);
|
|
229
|
+
},
|
|
230
|
+
getCoreRowModel: getCoreRowModel(),
|
|
231
|
+
...props.globalFilterOptions || {},
|
|
232
|
+
onGlobalFilterChange: (updaterOrValue) => valueUpdater(updaterOrValue, states.globalFilterState),
|
|
233
|
+
...props.columnFiltersOptions || {},
|
|
234
|
+
getFilteredRowModel: getFilteredRowModel(),
|
|
235
|
+
onColumnFiltersChange: (updaterOrValue) => {
|
|
236
|
+
valueUpdater(updaterOrValue, states.columnFiltersState);
|
|
237
|
+
if (eventEmitter?.filterChanged) {
|
|
238
|
+
eventEmitter.filterChanged({ columnFilters: states.columnFiltersState.value });
|
|
239
|
+
}
|
|
240
|
+
},
|
|
241
|
+
onColumnOrderChange: (updaterOrValue) => valueUpdater(updaterOrValue, states.columnOrderState),
|
|
242
|
+
...props.visibilityOptions || {},
|
|
243
|
+
onColumnVisibilityChange: (updaterOrValue) => valueUpdater(updaterOrValue, states.columnVisibilityState),
|
|
244
|
+
...props.columnPinningOptions || {},
|
|
245
|
+
onColumnPinningChange: (updaterOrValue) => valueUpdater(updaterOrValue, states.columnPinningState),
|
|
246
|
+
...props.columnSizingOptions || {},
|
|
247
|
+
onColumnSizingChange: (updaterOrValue) => valueUpdater(updaterOrValue, states.columnSizingState),
|
|
248
|
+
onColumnSizingInfoChange: (updaterOrValue) => valueUpdater(updaterOrValue, states.columnSizingInfoState),
|
|
249
|
+
columnResizeMode: props.columnSizingOptions?.columnResizeMode ?? "onChange",
|
|
250
|
+
...props.rowSelectionOptions || {},
|
|
251
|
+
get enableMultiRowSelection() {
|
|
252
|
+
return rowSelection?.enableMultiRowSelection.value ?? true;
|
|
253
|
+
},
|
|
254
|
+
get enableRowSelection() {
|
|
255
|
+
return rowSelection?.enableRowSelection.value ?? true;
|
|
256
|
+
},
|
|
257
|
+
onRowSelectionChange: (updaterOrValue) => valueUpdater(updaterOrValue, states.rowSelectionState),
|
|
258
|
+
...props.rowPinningOptions || {},
|
|
259
|
+
onRowPinningChange: (updaterOrValue) => valueUpdater(updaterOrValue, states.rowPinningState),
|
|
260
|
+
...props.sortingOptions || {},
|
|
261
|
+
getSortedRowModel: getSortedRowModel(),
|
|
262
|
+
onSortingChange: (updaterOrValue) => {
|
|
263
|
+
valueUpdater(updaterOrValue, states.sortingState);
|
|
264
|
+
if (eventEmitter?.sortChanged) {
|
|
265
|
+
eventEmitter.sortChanged({ sorting: states.sortingState.value });
|
|
266
|
+
}
|
|
267
|
+
},
|
|
268
|
+
// Use Tanstack's default grouping utility, can be overridden by user's groupingOptions
|
|
269
|
+
getGroupedRowModel: getGroupedRowModel(),
|
|
270
|
+
...props.groupingOptions || {},
|
|
271
|
+
onGroupingChange: (updaterOrValue) => valueUpdater(updaterOrValue, states.groupingState),
|
|
272
|
+
...props.expandedOptions || {},
|
|
273
|
+
getExpandedRowModel: getExpandedRowModel(),
|
|
274
|
+
onExpandedChange: (updaterOrValue) => valueUpdater(updaterOrValue, states.expandedState),
|
|
275
|
+
...props.paginationOptions || {},
|
|
276
|
+
// Conditionally include pagination row model when paging is enabled
|
|
277
|
+
...(() => {
|
|
278
|
+
const pagingProp = props.paging;
|
|
279
|
+
const isPaginationEnabled = pagingProp === true || typeof pagingProp === "object" && pagingProp?.enabled !== false;
|
|
280
|
+
return isPaginationEnabled ? { getPaginationRowModel: getPaginationRowModel() } : {};
|
|
281
|
+
})(),
|
|
282
|
+
onPaginationChange: (updaterOrValue) => valueUpdater(updaterOrValue, states.paginationState),
|
|
283
|
+
...props.facetedOptions || {},
|
|
284
|
+
state: {
|
|
285
|
+
get globalFilter() {
|
|
286
|
+
return states.globalFilterState.value;
|
|
287
|
+
},
|
|
288
|
+
get columnFilters() {
|
|
289
|
+
return states.columnFiltersState.value;
|
|
290
|
+
},
|
|
291
|
+
get columnOrder() {
|
|
292
|
+
return states.columnOrderState.value;
|
|
293
|
+
},
|
|
294
|
+
get columnVisibility() {
|
|
295
|
+
return states.columnVisibilityState.value;
|
|
296
|
+
},
|
|
297
|
+
get columnPinning() {
|
|
298
|
+
return states.columnPinningState.value;
|
|
299
|
+
},
|
|
300
|
+
get expanded() {
|
|
301
|
+
return states.expandedState.value;
|
|
302
|
+
},
|
|
303
|
+
get rowSelection() {
|
|
304
|
+
return states.rowSelectionState.value;
|
|
305
|
+
},
|
|
306
|
+
get sorting() {
|
|
307
|
+
return states.sortingState.value;
|
|
308
|
+
},
|
|
309
|
+
get grouping() {
|
|
310
|
+
return states.groupingState.value;
|
|
311
|
+
},
|
|
312
|
+
get rowPinning() {
|
|
313
|
+
return states.rowPinningState.value;
|
|
314
|
+
},
|
|
315
|
+
get columnSizing() {
|
|
316
|
+
return states.columnSizingState.value;
|
|
317
|
+
},
|
|
318
|
+
get columnSizingInfo() {
|
|
319
|
+
return states.columnSizingInfoState.value;
|
|
320
|
+
},
|
|
321
|
+
get pagination() {
|
|
322
|
+
return states.paginationState.value;
|
|
323
|
+
}
|
|
324
|
+
}
|
|
325
|
+
});
|
|
326
|
+
watch(columns, (newColumns) => {
|
|
327
|
+
tableApi.setOptions((prev) => ({
|
|
328
|
+
...prev,
|
|
329
|
+
columns: newColumns
|
|
330
|
+
}));
|
|
331
|
+
});
|
|
332
|
+
return tableApi;
|
|
333
|
+
}
|
|
334
|
+
export function useNuGridFooter(columns) {
|
|
335
|
+
const hasFooter = computed(() => {
|
|
336
|
+
function hasFooterRecursive(columns2) {
|
|
337
|
+
for (const column of columns2) {
|
|
338
|
+
if ("footer" in column && column.footer != null) {
|
|
339
|
+
return true;
|
|
340
|
+
}
|
|
341
|
+
if ("columns" in column && hasFooterRecursive(column.columns)) {
|
|
342
|
+
return true;
|
|
343
|
+
}
|
|
344
|
+
}
|
|
345
|
+
return false;
|
|
346
|
+
}
|
|
347
|
+
return hasFooterRecursive(columns.value);
|
|
348
|
+
});
|
|
349
|
+
return { hasFooter };
|
|
350
|
+
}
|
|
351
|
+
export function useNuGridDataWatch(props, data) {
|
|
352
|
+
watch(
|
|
353
|
+
() => props.data,
|
|
354
|
+
() => {
|
|
355
|
+
data.value = props.data ? [...props.data] : [];
|
|
356
|
+
},
|
|
357
|
+
props.watchOptions
|
|
358
|
+
);
|
|
359
|
+
}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import type { TableData } from '@nuxt/ui';
|
|
2
|
+
import type { Table } from '@tanstack/vue-table';
|
|
3
|
+
import type { ComputedRef, MaybeRef, ShallowRef } from 'vue';
|
|
4
|
+
import type { NuGridColumn } from '../../types/index.js';
|
|
5
|
+
import type { ExcelExportOptions, GroupedExcelExportOptions } from '../../utils/excelExport.js';
|
|
6
|
+
export interface UseNuGridExcelOptions<T = any> {
|
|
7
|
+
/**
|
|
8
|
+
* Reference to the NuGrid component
|
|
9
|
+
*/
|
|
10
|
+
tableRef: ShallowRef<{
|
|
11
|
+
tableApi: Table<T>;
|
|
12
|
+
} | null | undefined>;
|
|
13
|
+
/**
|
|
14
|
+
* Column definitions for the grid
|
|
15
|
+
*/
|
|
16
|
+
columns: MaybeRef<NuGridColumn<any>[]>;
|
|
17
|
+
/**
|
|
18
|
+
* Default export options
|
|
19
|
+
*/
|
|
20
|
+
defaultOptions?: ExcelExportOptions;
|
|
21
|
+
}
|
|
22
|
+
export interface UseNuGridExcelReturn {
|
|
23
|
+
/**
|
|
24
|
+
* Export the grid data to an Excel file
|
|
25
|
+
*/
|
|
26
|
+
exportExcel: (options?: ExcelExportOptions) => Promise<void>;
|
|
27
|
+
/**
|
|
28
|
+
* Export grouped grid data to an Excel file with group headers
|
|
29
|
+
*/
|
|
30
|
+
exportGroupedExcel: (options?: GroupedExcelExportOptions) => Promise<void>;
|
|
31
|
+
/**
|
|
32
|
+
* Whether export is available (table API exists)
|
|
33
|
+
*/
|
|
34
|
+
canExport: ComputedRef<boolean>;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Composable for exporting NuGrid data to Excel
|
|
38
|
+
*
|
|
39
|
+
* @example
|
|
40
|
+
* ```vue
|
|
41
|
+
* <script setup>
|
|
42
|
+
* const table = useTemplateRef('table')
|
|
43
|
+
* const columns = ref([...])
|
|
44
|
+
*
|
|
45
|
+
* const { exportExcel, canExport } = useNuGridExcel({
|
|
46
|
+
* tableRef: table,
|
|
47
|
+
* columns,
|
|
48
|
+
* defaultOptions: { filename: 'my-export' }
|
|
49
|
+
* })
|
|
50
|
+
* </script>
|
|
51
|
+
*
|
|
52
|
+
* <template>
|
|
53
|
+
* <UButton @click="exportExcel()" :disabled="!canExport">
|
|
54
|
+
* Export to Excel
|
|
55
|
+
* </UButton>
|
|
56
|
+
* <NuGrid ref="table" :columns="columns" :data="data" />
|
|
57
|
+
* </template>
|
|
58
|
+
* ```
|
|
59
|
+
*/
|
|
60
|
+
export declare function useNuGridExcel<T extends TableData>(options: UseNuGridExcelOptions<T>): UseNuGridExcelReturn;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { defu } from "defu";
|
|
2
|
+
const getExcelExport = () => import("../../utils/excelExport.js");
|
|
3
|
+
export function useNuGridExcel(options) {
|
|
4
|
+
const { tableRef, columns, defaultOptions = {} } = options;
|
|
5
|
+
const canExport = computed(() => {
|
|
6
|
+
return !!tableRef.value?.tableApi;
|
|
7
|
+
});
|
|
8
|
+
const exportExcel = async (exportOptions = {}) => {
|
|
9
|
+
const tableApi = tableRef.value?.tableApi;
|
|
10
|
+
if (!tableApi) {
|
|
11
|
+
console.warn("Cannot export: table API not available");
|
|
12
|
+
return;
|
|
13
|
+
}
|
|
14
|
+
const resolvedColumns = unref(columns);
|
|
15
|
+
const mergedOptions = defu(exportOptions, defaultOptions);
|
|
16
|
+
const { exportToExcel } = await getExcelExport();
|
|
17
|
+
await exportToExcel(tableApi, resolvedColumns, mergedOptions);
|
|
18
|
+
};
|
|
19
|
+
const exportGroupedExcel = async (exportOptions = {}) => {
|
|
20
|
+
const tableApi = tableRef.value?.tableApi;
|
|
21
|
+
if (!tableApi) {
|
|
22
|
+
console.warn("Cannot export: table API not available");
|
|
23
|
+
return;
|
|
24
|
+
}
|
|
25
|
+
const resolvedColumns = unref(columns);
|
|
26
|
+
const mergedOptions = defu(exportOptions, defaultOptions);
|
|
27
|
+
const { exportGroupedToExcel } = await getExcelExport();
|
|
28
|
+
await exportGroupedToExcel(tableApi, resolvedColumns, mergedOptions);
|
|
29
|
+
};
|
|
30
|
+
return {
|
|
31
|
+
exportExcel,
|
|
32
|
+
exportGroupedExcel,
|
|
33
|
+
canExport
|
|
34
|
+
};
|
|
35
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { TableData } from '@nuxt/ui';
|
|
2
|
+
import type { Row, Table } from '@tanstack/vue-table';
|
|
3
|
+
import type { Primitive } from 'reka-ui';
|
|
4
|
+
import type { Ref } from 'vue';
|
|
5
|
+
import type { NuGridEventEmitter, NuGridProps } from '../../types/index.js';
|
|
6
|
+
import type { NuGridEditingCell, NuGridFocus, NuGridInteractionRouter, NuGridVirtualizer } from '../../types/_internal/index.js';
|
|
7
|
+
/**
|
|
8
|
+
* Cell and row focus management with keyboard navigation
|
|
9
|
+
*/
|
|
10
|
+
export declare function useNuGridFocus<T extends TableData>(props: NuGridProps<T>, tableApi: Table<T>, rows: Ref<Row<T>[]>, navigableRows: Ref<Row<T>[]> | null | undefined, tableRef: Ref<HTMLDivElement | null>, rootRef: Ref<InstanceType<typeof Primitive> | null | undefined> | null, virtualizedStickyHeight?: Ref<number>, virtualizer?: Ref<NuGridVirtualizer> | false, editingCell?: Ref<NuGridEditingCell | null>, interactionRouter?: NuGridInteractionRouter<T>, eventEmitter?: NuGridEventEmitter<T>, focusedRowIdModel?: Ref<string | null>): NuGridFocus<T>;
|
|
11
|
+
/**
|
|
12
|
+
* Initialize focus on first cell when data loads (for keyboard navigation)
|
|
13
|
+
* Should be called after creating the focus composable
|
|
14
|
+
*/
|
|
15
|
+
export declare function useNuGridFocusInit<T extends TableData>(props: NuGridProps<T>, focusFns: NuGridFocus<T>, rows: Ref<Row<T>[]>): void;
|