@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,651 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import { computed, nextTick, onMounted, provide, ref, shallowRef, watch } from "vue";
|
|
3
|
+
import {
|
|
4
|
+
useNuGridAddRow,
|
|
5
|
+
useNuGridAnimation,
|
|
6
|
+
useNuGridApi,
|
|
7
|
+
useNuGridAutosize,
|
|
8
|
+
useNuGridCellEditing,
|
|
9
|
+
useNuGridColumnDragDrop,
|
|
10
|
+
useNuGridColumnResize,
|
|
11
|
+
useNuGridColumns,
|
|
12
|
+
useNuGridDataWatch,
|
|
13
|
+
useNuGridFocus,
|
|
14
|
+
useNuGridFocusInit,
|
|
15
|
+
useNuGridFooter,
|
|
16
|
+
useNuGridGrouping,
|
|
17
|
+
useNuGridInteractionRouter,
|
|
18
|
+
useNuGridPaging,
|
|
19
|
+
useNuGridRowDragDrop,
|
|
20
|
+
useNuGridRowInteractions,
|
|
21
|
+
useNuGridScrollbars,
|
|
22
|
+
useNuGridScrollState,
|
|
23
|
+
useNuGridStatePersistence,
|
|
24
|
+
useNuGridTooltipHandler,
|
|
25
|
+
useNuGridUI,
|
|
26
|
+
useNuGridVirtualization,
|
|
27
|
+
useNuGridWheelSmoothing
|
|
28
|
+
} from "../composables/_internal";
|
|
29
|
+
import {
|
|
30
|
+
createPagingKeyboardHandler,
|
|
31
|
+
useKeyboardSetup
|
|
32
|
+
} from "../composables/_internal/keyboard-handlers";
|
|
33
|
+
import { resolvePagingOptions } from "../composables/_internal/useNuGridPaging";
|
|
34
|
+
import { nuGridDefaults, usePropWithDefault } from "../config/_internal";
|
|
35
|
+
import { NUGRID_EVENTS_KEY } from "../types/events";
|
|
36
|
+
import NuGridBase from "./_internal/NuGridBase.vue";
|
|
37
|
+
import NuGridGroup from "./_internal/NuGridGroup.vue";
|
|
38
|
+
import NuGridPaging from "./_internal/NuGridPaging.vue";
|
|
39
|
+
import NuGridSplitGroup from "./_internal/NuGridSplitGroup.vue";
|
|
40
|
+
import NuGridTooltip from "./_internal/NuGridTooltip.vue";
|
|
41
|
+
defineOptions({ inheritAttrs: false });
|
|
42
|
+
const props = defineProps({
|
|
43
|
+
ui: { type: null, required: false },
|
|
44
|
+
preset: { type: String, required: false },
|
|
45
|
+
focus: { type: Object, required: false },
|
|
46
|
+
editing: { type: Object, required: false },
|
|
47
|
+
validation: { type: [Boolean, Object], required: false },
|
|
48
|
+
selection: { type: [Boolean, String, Object], required: false },
|
|
49
|
+
actions: { type: [Boolean, Object], required: false },
|
|
50
|
+
columnDefaults: { type: Object, required: false },
|
|
51
|
+
layout: { type: Object, required: false },
|
|
52
|
+
tooltip: { type: [Boolean, Object], required: false },
|
|
53
|
+
multiRow: { type: [Boolean, Object], required: false },
|
|
54
|
+
animation: { type: [Boolean, Object], required: false },
|
|
55
|
+
paging: { type: [Boolean, Object], required: false },
|
|
56
|
+
state: { type: [Boolean, Object], required: false },
|
|
57
|
+
theme: { type: [String, Object], required: false },
|
|
58
|
+
virtualization: { type: [Boolean, Object], required: false },
|
|
59
|
+
cellTypes: { type: Array, required: false },
|
|
60
|
+
skipAutoSizeColumns: { type: Array, required: false },
|
|
61
|
+
rowDragOptions: { type: Object, required: false },
|
|
62
|
+
rowId: { type: [String, Function], required: false },
|
|
63
|
+
addNewRow: { type: [Boolean, Object], required: false },
|
|
64
|
+
as: { type: null, required: false },
|
|
65
|
+
data: { type: Array, required: false },
|
|
66
|
+
columns: { type: Array, required: false },
|
|
67
|
+
caption: { type: String, required: false },
|
|
68
|
+
meta: { type: Object, required: false },
|
|
69
|
+
empty: { type: String, required: false },
|
|
70
|
+
sticky: { type: [Boolean, String], required: false },
|
|
71
|
+
loading: { type: Boolean, required: false },
|
|
72
|
+
loadingColor: { type: null, required: false },
|
|
73
|
+
loadingAnimation: { type: null, required: false },
|
|
74
|
+
watchOptions: { type: Object, required: false, default: () => ({
|
|
75
|
+
deep: true
|
|
76
|
+
}) },
|
|
77
|
+
globalFilterOptions: { type: Object, required: false },
|
|
78
|
+
columnFiltersOptions: { type: Object, required: false },
|
|
79
|
+
columnPinningOptions: { type: Object, required: false },
|
|
80
|
+
columnSizingOptions: { type: Object, required: false },
|
|
81
|
+
visibilityOptions: { type: Object, required: false },
|
|
82
|
+
sortingOptions: { type: Object, required: false },
|
|
83
|
+
groupingOptions: { type: Object, required: false },
|
|
84
|
+
expandedOptions: { type: Object, required: false },
|
|
85
|
+
rowSelectionOptions: { type: Object, required: false },
|
|
86
|
+
rowPinningOptions: { type: Object, required: false },
|
|
87
|
+
paginationOptions: { type: Object, required: false },
|
|
88
|
+
facetedOptions: { type: Object, required: false },
|
|
89
|
+
onSelect: { type: Function, required: false },
|
|
90
|
+
onHover: { type: Function, required: false },
|
|
91
|
+
onContextmenu: { type: [Function, Array], required: false },
|
|
92
|
+
class: { type: null, required: false },
|
|
93
|
+
onStateChange: { type: Function, required: false },
|
|
94
|
+
renderFallbackValue: { type: null, required: false },
|
|
95
|
+
_features: { type: Array, required: false },
|
|
96
|
+
autoResetAll: { type: Boolean, required: false },
|
|
97
|
+
debugAll: { type: Boolean, required: false },
|
|
98
|
+
debugCells: { type: Boolean, required: false },
|
|
99
|
+
debugColumns: { type: Boolean, required: false },
|
|
100
|
+
debugHeaders: { type: Boolean, required: false },
|
|
101
|
+
debugRows: { type: Boolean, required: false },
|
|
102
|
+
debugTable: { type: Boolean, required: false },
|
|
103
|
+
defaultColumn: { type: Object, required: false },
|
|
104
|
+
getRowId: { type: Function, required: false },
|
|
105
|
+
getSubRows: { type: Function, required: false },
|
|
106
|
+
initialState: { type: Object, required: false },
|
|
107
|
+
mergeOptions: { type: Function, required: false }
|
|
108
|
+
});
|
|
109
|
+
const emit = defineEmits(["rowDragged", "cellValueChanged", "rowSelectionChanged", "stateChanged", "ready", "rowAddRequested", "addRowStateChanged", "cellClicked", "cellDoubleClicked", "rowClicked", "rowDoubleClicked", "focusedCellChanged", "focusedRowChanged", "cellEditingStarted", "cellEditingCancelled", "sortChanged", "filterChanged"]);
|
|
110
|
+
const slots = defineSlots();
|
|
111
|
+
const eventEmitter = {
|
|
112
|
+
// Click events
|
|
113
|
+
cellClicked: (e) => emit("cellClicked", e),
|
|
114
|
+
cellDoubleClicked: (e) => emit("cellDoubleClicked", e),
|
|
115
|
+
rowClicked: (e) => emit("rowClicked", e),
|
|
116
|
+
rowDoubleClicked: (e) => emit("rowDoubleClicked", e),
|
|
117
|
+
// Focus events
|
|
118
|
+
focusedCellChanged: (e) => emit("focusedCellChanged", e),
|
|
119
|
+
focusedRowChanged: (e) => emit("focusedRowChanged", e),
|
|
120
|
+
// Editing lifecycle events
|
|
121
|
+
cellEditingStarted: (e) => emit("cellEditingStarted", e),
|
|
122
|
+
cellEditingCancelled: (e) => emit("cellEditingCancelled", e),
|
|
123
|
+
cellValueChanged: (e) => emit("cellValueChanged", e),
|
|
124
|
+
// State change events
|
|
125
|
+
sortChanged: (e) => emit("sortChanged", e),
|
|
126
|
+
filterChanged: (e) => emit("filterChanged", e),
|
|
127
|
+
// Migrated existing events
|
|
128
|
+
rowDragged: (e) => emit("rowDragged", e),
|
|
129
|
+
stateChanged: (e) => emit("stateChanged", e)
|
|
130
|
+
};
|
|
131
|
+
const hasRowSlot = computed(() => !!slots.row);
|
|
132
|
+
const data = ref(props.data ?? []);
|
|
133
|
+
const propsColumns = computed(() => props.columns);
|
|
134
|
+
useNuGridDataWatch(props, data);
|
|
135
|
+
const rootRef = ref();
|
|
136
|
+
const tableRef = ref(null);
|
|
137
|
+
const globalFilterState = defineModel("globalFilter", { type: String, ...{ default: void 0 } });
|
|
138
|
+
const columnFiltersState = defineModel("columnFilters", { type: Array, ...{ default: [] } });
|
|
139
|
+
const columnOrderState = defineModel("columnOrder", { type: Array, ...{ default: [] } });
|
|
140
|
+
const columnVisibilityState = defineModel("columnVisibility", { type: Object, ...{ default: {} } });
|
|
141
|
+
const columnPinningState = defineModel("columnPinning", { type: Object, ...{ default: {} } });
|
|
142
|
+
const columnSizingState = defineModel("columnSizing", { type: Object, ...{ default: {} } });
|
|
143
|
+
const columnSizingInfoState = defineModel("columnSizingInfo", { type: Object, ...{
|
|
144
|
+
default: {}
|
|
145
|
+
} });
|
|
146
|
+
const rowSelectionState = defineModel("rowSelection", { type: Object, ...{ default: {} } });
|
|
147
|
+
const rowPinningState = defineModel("rowPinning", { type: Object, ...{ default: {} } });
|
|
148
|
+
const sortingState = defineModel("sorting", { type: Array, ...{ default: [] } });
|
|
149
|
+
const groupingState = defineModel("grouping", { type: Array, ...{ default: [] } });
|
|
150
|
+
const expandedState = defineModel("expanded", { type: [Boolean, Object], ...{ default: {} } });
|
|
151
|
+
const paginationState = defineModel("pagination", { type: Object, ...{ default: {} } });
|
|
152
|
+
const focusedRowIdState = defineModel("focusedRowId", { type: [String, null], ...{ default: null } });
|
|
153
|
+
const initPaginationState = () => {
|
|
154
|
+
const pagingOptions = resolvePagingOptions(props.paging);
|
|
155
|
+
if (pagingOptions.enabled && (!paginationState.value.pageSize || paginationState.value.pageSize === 0)) {
|
|
156
|
+
paginationState.value = {
|
|
157
|
+
pageIndex: paginationState.value.pageIndex ?? 0,
|
|
158
|
+
pageSize: pagingOptions.pageSize ?? nuGridDefaults.paging.pageSize
|
|
159
|
+
};
|
|
160
|
+
}
|
|
161
|
+
};
|
|
162
|
+
initPaginationState();
|
|
163
|
+
const rowSelectionModeRef = computed(() => hasRowSlot.value ? false : props.selection ?? false);
|
|
164
|
+
const actionMenuRef = computed(() => props.actions ?? false);
|
|
165
|
+
const { columns } = useNuGridColumns(
|
|
166
|
+
propsColumns,
|
|
167
|
+
data,
|
|
168
|
+
rowSelectionModeRef,
|
|
169
|
+
actionMenuRef,
|
|
170
|
+
columnVisibilityState
|
|
171
|
+
);
|
|
172
|
+
const { ui, checkboxTheme } = useNuGridUI(props);
|
|
173
|
+
const { hasFooter } = useNuGridFooter(columns);
|
|
174
|
+
watch(
|
|
175
|
+
rowSelectionState,
|
|
176
|
+
(val) => {
|
|
177
|
+
emit("rowSelectionChanged", val);
|
|
178
|
+
},
|
|
179
|
+
{ deep: true }
|
|
180
|
+
);
|
|
181
|
+
const states = {
|
|
182
|
+
globalFilterState,
|
|
183
|
+
columnFiltersState,
|
|
184
|
+
columnOrderState,
|
|
185
|
+
columnVisibilityState,
|
|
186
|
+
columnPinningState,
|
|
187
|
+
columnSizingState,
|
|
188
|
+
columnSizingInfoState,
|
|
189
|
+
rowSelectionState,
|
|
190
|
+
rowPinningState,
|
|
191
|
+
sortingState,
|
|
192
|
+
groupingState,
|
|
193
|
+
expandedState,
|
|
194
|
+
paginationState
|
|
195
|
+
};
|
|
196
|
+
const editingCellRef = ref(null);
|
|
197
|
+
const focusFnsRef = shallowRef(null);
|
|
198
|
+
const groupingFnsRef = shallowRef(null);
|
|
199
|
+
const interactionRouter = useNuGridInteractionRouter({ eventEmitter });
|
|
200
|
+
let groupingFns = null;
|
|
201
|
+
const statePersistence = useNuGridStatePersistence(
|
|
202
|
+
states,
|
|
203
|
+
!!(typeof props.state === "object" && props.state),
|
|
204
|
+
typeof props.state === "object" && props.state ? props.state.key : void 0,
|
|
205
|
+
(state) => emit("stateChanged", state),
|
|
206
|
+
eventEmitter
|
|
207
|
+
);
|
|
208
|
+
const tableApi = useNuGridApi(props, data, columns, states, rowSelectionModeRef, eventEmitter);
|
|
209
|
+
const tableRows = computed(() => tableApi.getRowModel().rows);
|
|
210
|
+
const rowInteractions = useNuGridRowInteractions(props);
|
|
211
|
+
const cellEditingFnsRef = shallowRef(null);
|
|
212
|
+
const {
|
|
213
|
+
showAddNewRow,
|
|
214
|
+
addRowPosition,
|
|
215
|
+
addNewText,
|
|
216
|
+
refreshAddRows,
|
|
217
|
+
isAddRowRow,
|
|
218
|
+
orderedRows,
|
|
219
|
+
getGroupAddRow,
|
|
220
|
+
finalizeAddRow,
|
|
221
|
+
resetAddRow,
|
|
222
|
+
addRowState,
|
|
223
|
+
isFinalizing: addRowIsFinalizing,
|
|
224
|
+
finalizingRowId: addRowFinalizingRowId
|
|
225
|
+
} = useNuGridAddRow({
|
|
226
|
+
props,
|
|
227
|
+
data,
|
|
228
|
+
table: tableApi,
|
|
229
|
+
rows: tableRows,
|
|
230
|
+
columns,
|
|
231
|
+
groupingState,
|
|
232
|
+
editingCell: editingCellRef,
|
|
233
|
+
focusFns: focusFnsRef,
|
|
234
|
+
cellEditingFns: cellEditingFnsRef,
|
|
235
|
+
groupingFns: groupingFnsRef,
|
|
236
|
+
interactionRouter,
|
|
237
|
+
onAddRowStateChange: (state) => emit("addRowStateChanged", state),
|
|
238
|
+
onAddRowRequested: (row) => {
|
|
239
|
+
const nextRow = { ...row };
|
|
240
|
+
emit("rowAddRequested", nextRow);
|
|
241
|
+
return { success: true, row: nextRow };
|
|
242
|
+
}
|
|
243
|
+
});
|
|
244
|
+
watch(
|
|
245
|
+
[() => props.addNewRow, groupingState, () => props.data],
|
|
246
|
+
() => {
|
|
247
|
+
refreshAddRows();
|
|
248
|
+
},
|
|
249
|
+
{ deep: true, immediate: true }
|
|
250
|
+
);
|
|
251
|
+
const rows = orderedRows;
|
|
252
|
+
const stickyEnabled = computed(() => props.layout?.stickyHeaders ?? false);
|
|
253
|
+
const {
|
|
254
|
+
virtualizer,
|
|
255
|
+
virtualizationEnabled,
|
|
256
|
+
virtualRowItems,
|
|
257
|
+
activeStickyHeight: baseStickyHeight,
|
|
258
|
+
measuredVirtualSizes,
|
|
259
|
+
getVirtualItemHeight,
|
|
260
|
+
stickyOffsets
|
|
261
|
+
} = useNuGridVirtualization({
|
|
262
|
+
props: () => props,
|
|
263
|
+
rows,
|
|
264
|
+
tableApi,
|
|
265
|
+
rootRef,
|
|
266
|
+
stickyEnabled,
|
|
267
|
+
hasFooter
|
|
268
|
+
});
|
|
269
|
+
const { handleResizeStart, handleGroupResizeStart, resizingGroupId, resizingColumnId } = useNuGridColumnResize(props, tableApi);
|
|
270
|
+
const dragFns = useNuGridColumnDragDrop(tableApi, states.columnOrderState, tableRef);
|
|
271
|
+
const rowDragOptions = computed(() => props.rowDragOptions || { enabled: false });
|
|
272
|
+
const rowDragFns = useNuGridRowDragDrop(
|
|
273
|
+
tableApi,
|
|
274
|
+
data,
|
|
275
|
+
rowDragOptions,
|
|
276
|
+
tableRef,
|
|
277
|
+
(event, payload) => {
|
|
278
|
+
if (event === "rowDragged") {
|
|
279
|
+
emit("rowDragged", payload);
|
|
280
|
+
}
|
|
281
|
+
},
|
|
282
|
+
eventEmitter
|
|
283
|
+
);
|
|
284
|
+
const gridMode = props.layout?.mode ?? "div";
|
|
285
|
+
groupingFns = gridMode === "group" || gridMode === "splitgroup" ? useNuGridGrouping(props, tableApi, rootRef, stickyEnabled, gridMode, {
|
|
286
|
+
addRowPosition,
|
|
287
|
+
isAddRowRow,
|
|
288
|
+
getAddRowForGroup: getGroupAddRow
|
|
289
|
+
}) : null;
|
|
290
|
+
groupingFnsRef.value = groupingFns;
|
|
291
|
+
const focusFns = useNuGridFocus(
|
|
292
|
+
props,
|
|
293
|
+
tableApi,
|
|
294
|
+
rows,
|
|
295
|
+
groupingFns?.navigableRows,
|
|
296
|
+
tableRef,
|
|
297
|
+
rootRef,
|
|
298
|
+
groupingFns?.activeStickyHeight ?? baseStickyHeight,
|
|
299
|
+
groupingFns?.virtualizer ?? virtualizer ?? false,
|
|
300
|
+
editingCellRef,
|
|
301
|
+
interactionRouter,
|
|
302
|
+
eventEmitter,
|
|
303
|
+
focusedRowIdState
|
|
304
|
+
);
|
|
305
|
+
focusFnsRef.value = focusFns;
|
|
306
|
+
const cellEditingFns = useNuGridCellEditing(
|
|
307
|
+
props,
|
|
308
|
+
tableApi,
|
|
309
|
+
data,
|
|
310
|
+
rows,
|
|
311
|
+
tableRef,
|
|
312
|
+
rootRef,
|
|
313
|
+
focusFns,
|
|
314
|
+
interactionRouter,
|
|
315
|
+
(payload) => emit("cellValueChanged", payload),
|
|
316
|
+
groupingFns?.navigableRows,
|
|
317
|
+
editingCellRef,
|
|
318
|
+
{
|
|
319
|
+
showAddNewRow,
|
|
320
|
+
addRowPosition,
|
|
321
|
+
addRowState,
|
|
322
|
+
addNewText,
|
|
323
|
+
isAddRowRow,
|
|
324
|
+
finalizeAddRow,
|
|
325
|
+
resetAddRow
|
|
326
|
+
}
|
|
327
|
+
);
|
|
328
|
+
cellEditingFnsRef.value = cellEditingFns;
|
|
329
|
+
const effectiveFocusMode = computed(() => {
|
|
330
|
+
const mode = usePropWithDefault(props, "focus", "mode").value;
|
|
331
|
+
if (hasRowSlot.value && mode === "cell") return "row";
|
|
332
|
+
return mode;
|
|
333
|
+
});
|
|
334
|
+
const effectiveEditingEnabled = computed(() => {
|
|
335
|
+
if (hasRowSlot.value) return false;
|
|
336
|
+
return usePropWithDefault(props, "editing", "enabled").value;
|
|
337
|
+
});
|
|
338
|
+
useKeyboardSetup({
|
|
339
|
+
interactionRouter,
|
|
340
|
+
focusFns,
|
|
341
|
+
cellEditingFns,
|
|
342
|
+
tableApi,
|
|
343
|
+
resolvedRows: computed(() => groupingFns?.navigableRows?.value ?? rows.value),
|
|
344
|
+
rootRef,
|
|
345
|
+
focusModeRef: effectiveFocusMode,
|
|
346
|
+
retainFocusRef: usePropWithDefault(props, "focus", "retain"),
|
|
347
|
+
editingEnabledRef: effectiveEditingEnabled,
|
|
348
|
+
startKeysRef: usePropWithDefault(props, "editing", "startKeys"),
|
|
349
|
+
cellTypes: props.cellTypes ? computed(() => props.cellTypes) : void 0,
|
|
350
|
+
data,
|
|
351
|
+
emitCellValueChanged: (payload) => emit("cellValueChanged", payload)
|
|
352
|
+
});
|
|
353
|
+
const autosizeFns = useNuGridAutosize(props, tableApi, tableRef);
|
|
354
|
+
const headerGroups = computed(() => tableApi.getHeaderGroups());
|
|
355
|
+
const headerGroupsLength = computed(() => headerGroups.value.length);
|
|
356
|
+
const footerGroups = computed(() => tableApi.getFooterGroups());
|
|
357
|
+
const allLeafColumns = computed(() => tableApi.getAllLeafColumns());
|
|
358
|
+
const visibleCellsCache = computed(() => {
|
|
359
|
+
const cache = /* @__PURE__ */ new Map();
|
|
360
|
+
rows.value.forEach((row) => {
|
|
361
|
+
cache.set(row.id, row.getVisibleCells());
|
|
362
|
+
});
|
|
363
|
+
return cache;
|
|
364
|
+
});
|
|
365
|
+
function getVisibleCells(row) {
|
|
366
|
+
return visibleCellsCache.value.get(row.id) ?? row.getVisibleCells();
|
|
367
|
+
}
|
|
368
|
+
function shouldHaveBorder(row, cellIndex, side) {
|
|
369
|
+
const cells = getVisibleCells(row);
|
|
370
|
+
const cell = cells[cellIndex];
|
|
371
|
+
const pinPosition = side;
|
|
372
|
+
const isFirst = side === "left";
|
|
373
|
+
if (cell?.column.getIsPinned() === pinPosition) {
|
|
374
|
+
if (isFirst) {
|
|
375
|
+
return cells.findIndex((c) => c.column.getIsPinned() === pinPosition) === cellIndex;
|
|
376
|
+
} else {
|
|
377
|
+
for (let i = cells.length - 1; i >= 0; i--) {
|
|
378
|
+
if (cells[i]?.column.getIsPinned() === pinPosition) {
|
|
379
|
+
return i === cellIndex;
|
|
380
|
+
}
|
|
381
|
+
}
|
|
382
|
+
}
|
|
383
|
+
}
|
|
384
|
+
const hasPinned = cells.some((c) => c.column.getIsPinned() === pinPosition);
|
|
385
|
+
return !hasPinned && (isFirst ? cellIndex === 0 : cellIndex === cells.length - 1);
|
|
386
|
+
}
|
|
387
|
+
const rootElement = computed(() => rootRef.value?.$el);
|
|
388
|
+
const scrollbarTheme = computed(() => props.ui?.scrollbar ?? ui.value.scrollbar?.());
|
|
389
|
+
const { scrollbarClass, scrollbarThemeClass, scrollbarAttr } = useNuGridScrollbars({
|
|
390
|
+
props,
|
|
391
|
+
containerRef: rootElement,
|
|
392
|
+
themeClass: scrollbarTheme
|
|
393
|
+
});
|
|
394
|
+
const scrollState = useNuGridScrollState({
|
|
395
|
+
containerRef: rootElement,
|
|
396
|
+
settleDelay: 150
|
|
397
|
+
});
|
|
398
|
+
useNuGridWheelSmoothing(rootElement, {
|
|
399
|
+
threshold: 2,
|
|
400
|
+
maxVelocityPxPerSec: 6e3,
|
|
401
|
+
// Mouse wheel cap
|
|
402
|
+
maxVelocityPxPerSecTouchpad: 9e3,
|
|
403
|
+
// Touchpad cap (higher for smoother feel)
|
|
404
|
+
touchpadDeltaThreshold: 20,
|
|
405
|
+
// Deltas < 20px = touchpad, >= 20px = mouse wheel
|
|
406
|
+
smoothingFactor: 0.35
|
|
407
|
+
});
|
|
408
|
+
watch(
|
|
409
|
+
rootElement,
|
|
410
|
+
(el) => {
|
|
411
|
+
interactionRouter.setGridRoot(el);
|
|
412
|
+
},
|
|
413
|
+
{ immediate: true }
|
|
414
|
+
);
|
|
415
|
+
useNuGridTooltipHandler(props, interactionRouter, {
|
|
416
|
+
tableApi: computed(() => tableApi),
|
|
417
|
+
columns: propsColumns
|
|
418
|
+
});
|
|
419
|
+
provide("nugrid-core", {
|
|
420
|
+
tableRef,
|
|
421
|
+
rootRef,
|
|
422
|
+
tableApi,
|
|
423
|
+
ui,
|
|
424
|
+
propsUi: computed(() => props.ui),
|
|
425
|
+
hasFooter,
|
|
426
|
+
rows,
|
|
427
|
+
rowSlot: slots.row
|
|
428
|
+
});
|
|
429
|
+
provide("nugrid-drag", {
|
|
430
|
+
dragFns,
|
|
431
|
+
rowDragFns,
|
|
432
|
+
rowDragOptions
|
|
433
|
+
});
|
|
434
|
+
provide("nugrid-focus", {
|
|
435
|
+
focusFns,
|
|
436
|
+
cellEditingFns
|
|
437
|
+
});
|
|
438
|
+
provide("nugrid-resize", {
|
|
439
|
+
handleResizeStart,
|
|
440
|
+
handleGroupResizeStart,
|
|
441
|
+
resizingGroupId,
|
|
442
|
+
resizingColumnId
|
|
443
|
+
});
|
|
444
|
+
provide("nugrid-virtualization", {
|
|
445
|
+
virtualizer,
|
|
446
|
+
virtualizationEnabled,
|
|
447
|
+
virtualRowItems,
|
|
448
|
+
measuredVirtualSizes,
|
|
449
|
+
getVirtualItemHeight,
|
|
450
|
+
stickyOffsets,
|
|
451
|
+
stickyEnabled
|
|
452
|
+
});
|
|
453
|
+
provide("nugrid-grouping", {
|
|
454
|
+
groupingFns
|
|
455
|
+
});
|
|
456
|
+
provide("nugrid-performance", {
|
|
457
|
+
headerGroups,
|
|
458
|
+
headerGroupsLength,
|
|
459
|
+
footerGroups,
|
|
460
|
+
allLeafColumns,
|
|
461
|
+
getVisibleCells,
|
|
462
|
+
shouldHaveBorder
|
|
463
|
+
});
|
|
464
|
+
provide("nugrid-ui-config", {
|
|
465
|
+
sortIcons: computed(() => props.columnDefaults?.sortIcons),
|
|
466
|
+
scrollbarClass,
|
|
467
|
+
scrollbarThemeClass,
|
|
468
|
+
scrollbarAttr,
|
|
469
|
+
getColumnMenuItems: computed(() => props.columnDefaults?.menu?.items),
|
|
470
|
+
showColumnVisibility: computed(() => props.columnDefaults?.menu?.visibilityToggle ?? true),
|
|
471
|
+
columnMenuButton: computed(() => props.columnDefaults?.menu?.button),
|
|
472
|
+
wrapText: computed(() => props.columnDefaults?.wrapText ?? false),
|
|
473
|
+
checkboxTheme
|
|
474
|
+
});
|
|
475
|
+
provide("nugrid-validation", {
|
|
476
|
+
// Expose validation error display settings so editors can inject without prop wiring
|
|
477
|
+
showErrors: computed(() => cellEditingFns.showValidationErrors.value),
|
|
478
|
+
icon: computed(() => cellEditingFns.validationIcon.value)
|
|
479
|
+
});
|
|
480
|
+
provide("nugrid-row-interactions", {
|
|
481
|
+
rowInteractions,
|
|
482
|
+
rowSelectionMode: rowSelectionModeRef
|
|
483
|
+
});
|
|
484
|
+
provide("nugrid-interaction-router", {
|
|
485
|
+
interactionRouter
|
|
486
|
+
});
|
|
487
|
+
provide(NUGRID_EVENTS_KEY, eventEmitter);
|
|
488
|
+
provide("nugrid-multi-row", {
|
|
489
|
+
enabled: computed(() => {
|
|
490
|
+
if (props.multiRow === false) return false;
|
|
491
|
+
return props.multiRow?.enabled ?? false;
|
|
492
|
+
}),
|
|
493
|
+
rowCount: computed(() => {
|
|
494
|
+
if (props.multiRow === false) return 1;
|
|
495
|
+
return props.multiRow?.rowCount ?? 1;
|
|
496
|
+
}),
|
|
497
|
+
alignColumns: computed(() => {
|
|
498
|
+
if (props.multiRow === false) return false;
|
|
499
|
+
return props.multiRow?.alignColumns ?? false;
|
|
500
|
+
}),
|
|
501
|
+
row0Columns: computed(() => {
|
|
502
|
+
const allColumns = tableApi.getAllLeafColumns().filter((col) => col.getIsVisible());
|
|
503
|
+
return allColumns.filter((col) => (col.columnDef.row ?? 0) === 0).map((col) => ({
|
|
504
|
+
id: col.id,
|
|
505
|
+
width: col.getSize(),
|
|
506
|
+
minWidth: col.columnDef.minSize ?? 50,
|
|
507
|
+
pinned: col.getIsPinned() || false,
|
|
508
|
+
column: col
|
|
509
|
+
}));
|
|
510
|
+
})
|
|
511
|
+
});
|
|
512
|
+
const addRowContext = {
|
|
513
|
+
showAddNewRow,
|
|
514
|
+
addRowPosition,
|
|
515
|
+
addRowState,
|
|
516
|
+
addNewText,
|
|
517
|
+
indicatorSlot: slots["add-row-indicator"],
|
|
518
|
+
isAddRowRow,
|
|
519
|
+
finalizeAddRow,
|
|
520
|
+
resetAddRow,
|
|
521
|
+
isFinalizing: addRowIsFinalizing,
|
|
522
|
+
finalizingRowId: addRowFinalizingRowId
|
|
523
|
+
};
|
|
524
|
+
provide("nugrid-add-row", addRowContext);
|
|
525
|
+
const animationContext = useNuGridAnimation(props, {
|
|
526
|
+
rootRef: rootElement,
|
|
527
|
+
rows,
|
|
528
|
+
animationClass: computed(() => ui.value.rowAnimation())
|
|
529
|
+
});
|
|
530
|
+
provide("nugrid-animation", animationContext);
|
|
531
|
+
const pagingContext = useNuGridPaging({
|
|
532
|
+
props,
|
|
533
|
+
tableApi,
|
|
534
|
+
rootRef: rootElement
|
|
535
|
+
});
|
|
536
|
+
provide("nugrid-paging", pagingContext);
|
|
537
|
+
const pagingKeyboardHandler = createPagingKeyboardHandler(pagingContext);
|
|
538
|
+
interactionRouter.registerKeyboardHandler(pagingKeyboardHandler);
|
|
539
|
+
provide("nugrid-scroll-state", {
|
|
540
|
+
...scrollState,
|
|
541
|
+
containerRef: rootElement
|
|
542
|
+
});
|
|
543
|
+
useNuGridFocusInit(props, focusFns, groupingFns?.navigableRows ?? rows);
|
|
544
|
+
onMounted(() => {
|
|
545
|
+
nextTick(() => {
|
|
546
|
+
emit("ready");
|
|
547
|
+
});
|
|
548
|
+
});
|
|
549
|
+
const excelExport = async (filenameOrOptions, sheetName) => {
|
|
550
|
+
const options = typeof filenameOrOptions === "string" ? { filename: filenameOrOptions, ...sheetName ? { sheetName } : {} } : filenameOrOptions ?? {};
|
|
551
|
+
const isGrouped = tableApi.getState().grouping?.length > 0;
|
|
552
|
+
const columnsToExport = props.columns ?? [];
|
|
553
|
+
const { exportGroupedToExcel, exportToExcel } = await import("../utils/excelExport");
|
|
554
|
+
if (isGrouped) {
|
|
555
|
+
await exportGroupedToExcel(tableApi, columnsToExport, options);
|
|
556
|
+
} else {
|
|
557
|
+
await exportToExcel(tableApi, columnsToExport, options);
|
|
558
|
+
}
|
|
559
|
+
};
|
|
560
|
+
function getSelectedRows() {
|
|
561
|
+
if (!tableApi) return [];
|
|
562
|
+
return tableApi.getSelectedRowModel().rows.map((row) => row.original);
|
|
563
|
+
}
|
|
564
|
+
const pinColumn = (columnId, side) => {
|
|
565
|
+
const currentPinning = tableApi.getState().columnPinning;
|
|
566
|
+
const newPinning = { ...currentPinning };
|
|
567
|
+
const oppositeSide = side === "left" ? "right" : "left";
|
|
568
|
+
if (newPinning[oppositeSide]) {
|
|
569
|
+
newPinning[oppositeSide] = newPinning[oppositeSide].filter((id) => id !== columnId);
|
|
570
|
+
}
|
|
571
|
+
if (!newPinning[side]) {
|
|
572
|
+
newPinning[side] = [];
|
|
573
|
+
}
|
|
574
|
+
if (!newPinning[side].includes(columnId)) {
|
|
575
|
+
newPinning[side] = [...newPinning[side], columnId];
|
|
576
|
+
}
|
|
577
|
+
tableApi.setColumnPinning(newPinning);
|
|
578
|
+
};
|
|
579
|
+
const unpinColumn = (columnId) => {
|
|
580
|
+
const currentPinning = tableApi.getState().columnPinning;
|
|
581
|
+
const newPinning = {
|
|
582
|
+
left: currentPinning.left?.filter((id) => id !== columnId) || [],
|
|
583
|
+
right: currentPinning.right?.filter((id) => id !== columnId) || []
|
|
584
|
+
};
|
|
585
|
+
tableApi.setColumnPinning(newPinning);
|
|
586
|
+
};
|
|
587
|
+
const isPinned = (columnId) => {
|
|
588
|
+
const pinning = tableApi.getState().columnPinning;
|
|
589
|
+
if (pinning.left?.includes(columnId)) return "left";
|
|
590
|
+
if (pinning.right?.includes(columnId)) return "right";
|
|
591
|
+
return false;
|
|
592
|
+
};
|
|
593
|
+
const getPinnedColumns = () => {
|
|
594
|
+
const pinning = tableApi.getState().columnPinning;
|
|
595
|
+
return {
|
|
596
|
+
left: pinning.left || [],
|
|
597
|
+
right: pinning.right || []
|
|
598
|
+
};
|
|
599
|
+
};
|
|
600
|
+
defineExpose({
|
|
601
|
+
get $el() {
|
|
602
|
+
return rootRef.value?.$el;
|
|
603
|
+
},
|
|
604
|
+
tableRef,
|
|
605
|
+
tableApi,
|
|
606
|
+
autoSizeColumns: autosizeFns.autoSizeColumns,
|
|
607
|
+
autoSizeColumn: autosizeFns.autoSizeColumn,
|
|
608
|
+
getState: statePersistence.getState,
|
|
609
|
+
setState: statePersistence.setState,
|
|
610
|
+
addRowState,
|
|
611
|
+
excelExport,
|
|
612
|
+
getSelectedRows,
|
|
613
|
+
// Paging methods
|
|
614
|
+
pagingGoToPage: (page) => pagingContext.setPageIndex(page),
|
|
615
|
+
pagingGetCurrentPage: () => pagingContext.pageIndex.value,
|
|
616
|
+
pagingGetPageSize: () => pagingContext.pageSize.value,
|
|
617
|
+
pagingGetTotalPages: () => pagingContext.totalPages.value,
|
|
618
|
+
// Column pinning methods
|
|
619
|
+
pinColumn,
|
|
620
|
+
unpinColumn,
|
|
621
|
+
isPinned,
|
|
622
|
+
getPinnedColumns,
|
|
623
|
+
// Focus methods
|
|
624
|
+
focusRowById: focusFns.focusRowById
|
|
625
|
+
});
|
|
626
|
+
const childGrid = computed(() => {
|
|
627
|
+
if (gridMode === "splitgroup") return NuGridSplitGroup;
|
|
628
|
+
if (gridMode === "group") return NuGridGroup;
|
|
629
|
+
return NuGridBase;
|
|
630
|
+
});
|
|
631
|
+
</script>
|
|
632
|
+
|
|
633
|
+
<template>
|
|
634
|
+
<div class="nugrid-wrapper flex flex-col h-full w-full">
|
|
635
|
+
<div class="nugrid-grid-container grow shrink min-h-0">
|
|
636
|
+
<component :is="childGrid">
|
|
637
|
+
<template v-for="(_, name) in $slots" #[name]="slotProps" :key="name">
|
|
638
|
+
<slot :name="name" v-bind="slotProps" />
|
|
639
|
+
</template>
|
|
640
|
+
</component>
|
|
641
|
+
</div>
|
|
642
|
+
<!-- Paging panel (outside scrolling area) -->
|
|
643
|
+
<NuGridPaging v-if="pagingContext.showPanel.value" class="shrink-0" />
|
|
644
|
+
</div>
|
|
645
|
+
<!-- Single shared tooltip instance for all cells -->
|
|
646
|
+
<NuGridTooltip />
|
|
647
|
+
</template>
|
|
648
|
+
|
|
649
|
+
<style>
|
|
650
|
+
body.is-resizing-column,body.is-resizing-column *{cursor:col-resize!important;-webkit-user-select:none!important;-moz-user-select:none!important;user-select:none!important}body.is-resizing-column{cursor:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24'%3E%3Cpath d='M11 2v20h2V2zM9 6H5v12h4zm10 0h-4v12h4z'/%3E%3C/svg%3E") 12 12,col-resize!important}@media (prefers-color-scheme:dark){body.is-resizing-column{cursor:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24'%3E%3Cpath fill='%23fff' d='M11 2v20h2V2zM9 6H5v12h4zm10 0h-4v12h4z'/%3E%3C/svg%3E") 12 12,col-resize!important}}body.is-dragging-column{cursor:move!important}body.is-dragging-column,body.is-dragging-column-outside,body.is-dragging-row-outside{-webkit-user-select:none!important;-moz-user-select:none!important;user-select:none!important}body.is-dragging-column-outside,body.is-dragging-row-outside{cursor:no-drop!important}body.is-dragging-row{cursor:grabbing!important;-webkit-user-select:none!important;-moz-user-select:none!important;user-select:none!important}body.is-dragging-column-outside div[data-dragging=true],body.is-dragging-row-outside [data-tbody]>div[data-dragging=true]{background-color:rgba(239,68,68,.2);cursor:no-drop!important;opacity:.3;outline:2px dashed rgba(239,68,68,.6);outline-offset:-2px}
|
|
651
|
+
</style>
|