@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,407 @@
|
|
|
1
|
+
import { computed } from "vue";
|
|
2
|
+
export function useNuGridKeyboardNavigation(props, tableApi) {
|
|
3
|
+
const multiRowEnabled = computed(() => {
|
|
4
|
+
if (props.multiRow === false) return false;
|
|
5
|
+
return props.multiRow?.enabled ?? false;
|
|
6
|
+
});
|
|
7
|
+
const multiRowCount = computed(() => {
|
|
8
|
+
if (props.multiRow === false) return 1;
|
|
9
|
+
return props.multiRow?.rowCount ?? 1;
|
|
10
|
+
});
|
|
11
|
+
const alignColumns = computed(() => {
|
|
12
|
+
if (props.multiRow === false) return false;
|
|
13
|
+
return props.multiRow?.alignColumns ?? false;
|
|
14
|
+
});
|
|
15
|
+
const visibleColumns = computed(() => tableApi.getVisibleLeafColumns());
|
|
16
|
+
const columnToVisualRow = computed(() => {
|
|
17
|
+
if (!multiRowEnabled.value || multiRowCount.value <= 1) return [];
|
|
18
|
+
const cols = visibleColumns.value;
|
|
19
|
+
const mapping = [];
|
|
20
|
+
const maxRow = Math.max(1, multiRowCount.value) - 1;
|
|
21
|
+
for (let i = 0; i < cols.length; i++) {
|
|
22
|
+
const rowNum = cols[i].columnDef.row ?? 0;
|
|
23
|
+
mapping[i] = Math.max(0, Math.min(rowNum, maxRow));
|
|
24
|
+
}
|
|
25
|
+
return mapping;
|
|
26
|
+
});
|
|
27
|
+
const columnsByVisualRow = computed(() => {
|
|
28
|
+
if (!multiRowEnabled.value || multiRowCount.value <= 1) {
|
|
29
|
+
return [visibleColumns.value.map((_, idx) => idx)];
|
|
30
|
+
}
|
|
31
|
+
const rows = Array.from({ length: multiRowCount.value }, () => []);
|
|
32
|
+
columnToVisualRow.value.forEach((row, idx) => {
|
|
33
|
+
rows[row]?.push(idx);
|
|
34
|
+
});
|
|
35
|
+
return rows;
|
|
36
|
+
});
|
|
37
|
+
const nonPinnedColumnsByVisualRow = computed(() => {
|
|
38
|
+
if (!multiRowEnabled.value || multiRowCount.value <= 1) {
|
|
39
|
+
const all = visibleColumns.value.map((_, idx) => idx);
|
|
40
|
+
return [all];
|
|
41
|
+
}
|
|
42
|
+
const cols = visibleColumns.value;
|
|
43
|
+
return columnsByVisualRow.value.map(
|
|
44
|
+
(rowCols) => rowCols.filter((idx) => {
|
|
45
|
+
const pin = cols[idx]?.getIsPinned();
|
|
46
|
+
return !pin;
|
|
47
|
+
})
|
|
48
|
+
);
|
|
49
|
+
});
|
|
50
|
+
const pinnedColumnsByVisualRow = computed(() => {
|
|
51
|
+
if (!multiRowEnabled.value || multiRowCount.value <= 1) {
|
|
52
|
+
return [{ left: [], right: [] }];
|
|
53
|
+
}
|
|
54
|
+
const cols = visibleColumns.value;
|
|
55
|
+
return columnsByVisualRow.value.map((rowCols) => ({
|
|
56
|
+
left: rowCols.filter((idx) => cols[idx]?.getIsPinned() === "left"),
|
|
57
|
+
right: rowCols.filter((idx) => cols[idx]?.getIsPinned() === "right")
|
|
58
|
+
}));
|
|
59
|
+
});
|
|
60
|
+
function getVisualRowForColumn(columnIndex) {
|
|
61
|
+
if (!multiRowEnabled.value || multiRowCount.value <= 1) return 0;
|
|
62
|
+
return columnToVisualRow.value[columnIndex] ?? 0;
|
|
63
|
+
}
|
|
64
|
+
function getColumnsInVisualRow(visualRow) {
|
|
65
|
+
if (!multiRowEnabled.value || multiRowCount.value <= 1) {
|
|
66
|
+
return visibleColumns.value.map((_, idx) => idx);
|
|
67
|
+
}
|
|
68
|
+
return columnsByVisualRow.value[visualRow] ?? [];
|
|
69
|
+
}
|
|
70
|
+
function getNonPinnedColumnsInVisualRow(visualRow) {
|
|
71
|
+
if (!multiRowEnabled.value || multiRowCount.value <= 1) {
|
|
72
|
+
return visibleColumns.value.map((_, idx) => idx);
|
|
73
|
+
}
|
|
74
|
+
return nonPinnedColumnsByVisualRow.value[visualRow] ?? [];
|
|
75
|
+
}
|
|
76
|
+
function findColumnInVisualRow(currentColumnIndex, targetVisualRow, _row) {
|
|
77
|
+
const targetColumns = getColumnsInVisualRow(targetVisualRow);
|
|
78
|
+
if (targetColumns.length === 0) return currentColumnIndex;
|
|
79
|
+
const currentVisualRow = getVisualRowForColumn(currentColumnIndex);
|
|
80
|
+
const currentRowColumns = getColumnsInVisualRow(currentVisualRow);
|
|
81
|
+
if (alignColumns.value) {
|
|
82
|
+
const currentNonPinned = getNonPinnedColumnsInVisualRow(currentVisualRow);
|
|
83
|
+
const targetNonPinned = getNonPinnedColumnsInVisualRow(targetVisualRow);
|
|
84
|
+
const currentCol = visibleColumns.value[currentColumnIndex];
|
|
85
|
+
const isPinned = currentCol?.getIsPinned();
|
|
86
|
+
const currentPins = pinnedColumnsByVisualRow.value[currentVisualRow];
|
|
87
|
+
const targetPins = pinnedColumnsByVisualRow.value[targetVisualRow];
|
|
88
|
+
if (isPinned === "left") {
|
|
89
|
+
const leftPinnedInCurrent = currentPins?.left ?? [];
|
|
90
|
+
const leftPinnedInTarget = targetPins?.left ?? [];
|
|
91
|
+
const posInPinned = leftPinnedInCurrent.indexOf(currentColumnIndex);
|
|
92
|
+
if (posInPinned !== -1 && posInPinned < leftPinnedInTarget.length) {
|
|
93
|
+
return leftPinnedInTarget[posInPinned];
|
|
94
|
+
}
|
|
95
|
+
return targetNonPinned[0] ?? targetColumns[0] ?? currentColumnIndex;
|
|
96
|
+
}
|
|
97
|
+
if (isPinned === "right") {
|
|
98
|
+
const rightPinnedInCurrent = currentPins?.right ?? [];
|
|
99
|
+
const rightPinnedInTarget = targetPins?.right ?? [];
|
|
100
|
+
const posInPinned = rightPinnedInCurrent.indexOf(currentColumnIndex);
|
|
101
|
+
if (posInPinned !== -1 && posInPinned < rightPinnedInTarget.length) {
|
|
102
|
+
return rightPinnedInTarget[posInPinned];
|
|
103
|
+
}
|
|
104
|
+
return targetNonPinned[targetNonPinned.length - 1] ?? targetColumns[0] ?? currentColumnIndex;
|
|
105
|
+
}
|
|
106
|
+
const posInNonPinned = currentNonPinned.indexOf(currentColumnIndex);
|
|
107
|
+
if (posInNonPinned !== -1 && posInNonPinned < targetNonPinned.length) {
|
|
108
|
+
return targetNonPinned[posInNonPinned];
|
|
109
|
+
}
|
|
110
|
+
return targetNonPinned[targetNonPinned.length - 1] ?? targetColumns[0] ?? currentColumnIndex;
|
|
111
|
+
}
|
|
112
|
+
const currentPosInRow = currentRowColumns.indexOf(currentColumnIndex);
|
|
113
|
+
if (currentPosInRow !== -1 && currentPosInRow < targetColumns.length) {
|
|
114
|
+
return targetColumns[currentPosInRow];
|
|
115
|
+
}
|
|
116
|
+
return targetColumns[targetColumns.length - 1] ?? currentColumnIndex;
|
|
117
|
+
}
|
|
118
|
+
function findFirstInVisualRow(visualRow, row, isValidTarget) {
|
|
119
|
+
const columnsInRow = getColumnsInVisualRow(visualRow);
|
|
120
|
+
for (const colIdx of columnsInRow) {
|
|
121
|
+
if (!isValidTarget || isValidTarget(colIdx, row)) {
|
|
122
|
+
return colIdx;
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
return columnsInRow[0] ?? null;
|
|
126
|
+
}
|
|
127
|
+
function findLastInVisualRow(visualRow, row, isValidTarget) {
|
|
128
|
+
const columnsInRow = getColumnsInVisualRow(visualRow);
|
|
129
|
+
for (let i = columnsInRow.length - 1; i >= 0; i--) {
|
|
130
|
+
const colIdx = columnsInRow[i];
|
|
131
|
+
if (!isValidTarget || isValidTarget(colIdx, row)) {
|
|
132
|
+
return colIdx;
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
return columnsInRow[columnsInRow.length - 1] ?? null;
|
|
136
|
+
}
|
|
137
|
+
function findNextInVisualRow(startIndex, visualRow, row, isValidTarget) {
|
|
138
|
+
const columnsInRow = getColumnsInVisualRow(visualRow);
|
|
139
|
+
const currentPosInRow = columnsInRow.indexOf(startIndex);
|
|
140
|
+
if (currentPosInRow === -1) return null;
|
|
141
|
+
for (let i = currentPosInRow + 1; i < columnsInRow.length; i++) {
|
|
142
|
+
const colIdx = columnsInRow[i];
|
|
143
|
+
if (!isValidTarget || isValidTarget(colIdx, row)) {
|
|
144
|
+
return colIdx;
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
return null;
|
|
148
|
+
}
|
|
149
|
+
function findPreviousInVisualRow(startIndex, visualRow, row, isValidTarget) {
|
|
150
|
+
const columnsInRow = getColumnsInVisualRow(visualRow);
|
|
151
|
+
const currentPosInRow = columnsInRow.indexOf(startIndex);
|
|
152
|
+
if (currentPosInRow === -1) return null;
|
|
153
|
+
for (let i = currentPosInRow - 1; i >= 0; i--) {
|
|
154
|
+
const colIdx = columnsInRow[i];
|
|
155
|
+
if (!isValidTarget || isValidTarget(colIdx, row)) {
|
|
156
|
+
return colIdx;
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
return null;
|
|
160
|
+
}
|
|
161
|
+
function findFirstColumn(row, isValidTarget) {
|
|
162
|
+
const cols = visibleColumns.value;
|
|
163
|
+
for (let i = 0; i < cols.length; i++) {
|
|
164
|
+
if (!isValidTarget || isValidTarget(i, row)) {
|
|
165
|
+
return i;
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
return 0;
|
|
169
|
+
}
|
|
170
|
+
function findLastColumn(row, isValidTarget) {
|
|
171
|
+
const cols = visibleColumns.value;
|
|
172
|
+
for (let i = cols.length - 1; i >= 0; i--) {
|
|
173
|
+
if (!isValidTarget || isValidTarget(i, row)) {
|
|
174
|
+
return i;
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
return cols.length - 1;
|
|
178
|
+
}
|
|
179
|
+
function findNextColumn(currentIndex, row, isValidTarget) {
|
|
180
|
+
const cols = visibleColumns.value;
|
|
181
|
+
for (let i = currentIndex + 1; i < cols.length; i++) {
|
|
182
|
+
if (!isValidTarget || isValidTarget(i, row)) {
|
|
183
|
+
return i;
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
return currentIndex;
|
|
187
|
+
}
|
|
188
|
+
function findPreviousColumn(currentIndex, row, isValidTarget) {
|
|
189
|
+
for (let i = currentIndex - 1; i >= 0; i--) {
|
|
190
|
+
if (!isValidTarget || isValidTarget(i, row)) {
|
|
191
|
+
return i;
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
return currentIndex;
|
|
195
|
+
}
|
|
196
|
+
function navigateVertical(direction, currentRowIndex, currentColumnIndex, rows, isValidTarget) {
|
|
197
|
+
const currentRow = rows[currentRowIndex];
|
|
198
|
+
if (!currentRow) return null;
|
|
199
|
+
if (multiRowEnabled.value && multiRowCount.value > 1) {
|
|
200
|
+
const currentVisualRow = getVisualRowForColumn(currentColumnIndex);
|
|
201
|
+
const lastVisualRow = multiRowCount.value - 1;
|
|
202
|
+
if (direction === "up") {
|
|
203
|
+
if (currentVisualRow > 0) {
|
|
204
|
+
const targetColIdx = findColumnInVisualRow(
|
|
205
|
+
currentColumnIndex,
|
|
206
|
+
currentVisualRow - 1,
|
|
207
|
+
currentRow
|
|
208
|
+
);
|
|
209
|
+
if (!isValidTarget || isValidTarget(targetColIdx, currentRow)) {
|
|
210
|
+
return { rowIndex: currentRowIndex, columnIndex: targetColIdx };
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
if (currentRowIndex > 0) {
|
|
214
|
+
const targetRow = rows[currentRowIndex - 1];
|
|
215
|
+
if (targetRow) {
|
|
216
|
+
const targetColIdx = findColumnInVisualRow(currentColumnIndex, lastVisualRow, targetRow);
|
|
217
|
+
if (!isValidTarget || isValidTarget(targetColIdx, targetRow)) {
|
|
218
|
+
return { rowIndex: currentRowIndex - 1, columnIndex: targetColIdx };
|
|
219
|
+
}
|
|
220
|
+
const fallback = findLastInVisualRow(lastVisualRow, targetRow, isValidTarget);
|
|
221
|
+
if (fallback !== null) {
|
|
222
|
+
return { rowIndex: currentRowIndex - 1, columnIndex: fallback };
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
} else {
|
|
227
|
+
if (currentVisualRow < lastVisualRow) {
|
|
228
|
+
const targetColIdx = findColumnInVisualRow(
|
|
229
|
+
currentColumnIndex,
|
|
230
|
+
currentVisualRow + 1,
|
|
231
|
+
currentRow
|
|
232
|
+
);
|
|
233
|
+
if (!isValidTarget || isValidTarget(targetColIdx, currentRow)) {
|
|
234
|
+
return { rowIndex: currentRowIndex, columnIndex: targetColIdx };
|
|
235
|
+
}
|
|
236
|
+
}
|
|
237
|
+
if (currentRowIndex < rows.length - 1) {
|
|
238
|
+
const targetRow = rows[currentRowIndex + 1];
|
|
239
|
+
if (targetRow) {
|
|
240
|
+
const targetColIdx = findColumnInVisualRow(currentColumnIndex, 0, targetRow);
|
|
241
|
+
if (!isValidTarget || isValidTarget(targetColIdx, targetRow)) {
|
|
242
|
+
return { rowIndex: currentRowIndex + 1, columnIndex: targetColIdx };
|
|
243
|
+
}
|
|
244
|
+
const fallback = findFirstInVisualRow(0, targetRow, isValidTarget);
|
|
245
|
+
if (fallback !== null) {
|
|
246
|
+
return { rowIndex: currentRowIndex + 1, columnIndex: fallback };
|
|
247
|
+
}
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
}
|
|
251
|
+
} else {
|
|
252
|
+
const targetRowIndex = direction === "up" ? currentRowIndex - 1 : currentRowIndex + 1;
|
|
253
|
+
if (targetRowIndex >= 0 && targetRowIndex < rows.length) {
|
|
254
|
+
const targetRow = rows[targetRowIndex];
|
|
255
|
+
if (targetRow) {
|
|
256
|
+
if (!isValidTarget || isValidTarget(currentColumnIndex, targetRow)) {
|
|
257
|
+
return { rowIndex: targetRowIndex, columnIndex: currentColumnIndex };
|
|
258
|
+
}
|
|
259
|
+
const fallbackCol = direction === "up" ? findPreviousColumn(currentColumnIndex, targetRow, isValidTarget) : findNextColumn(currentColumnIndex, targetRow, isValidTarget);
|
|
260
|
+
if (fallbackCol !== currentColumnIndex || isValidTarget && isValidTarget(fallbackCol, targetRow)) {
|
|
261
|
+
return { rowIndex: targetRowIndex, columnIndex: fallbackCol };
|
|
262
|
+
}
|
|
263
|
+
}
|
|
264
|
+
}
|
|
265
|
+
}
|
|
266
|
+
return null;
|
|
267
|
+
}
|
|
268
|
+
function navigateHorizontal(direction, currentRowIndex, currentColumnIndex, rows, isValidTarget) {
|
|
269
|
+
const currentRow = rows[currentRowIndex];
|
|
270
|
+
if (!currentRow) return null;
|
|
271
|
+
if (multiRowEnabled.value && multiRowCount.value > 1) {
|
|
272
|
+
const currentVisualRow = getVisualRowForColumn(currentColumnIndex);
|
|
273
|
+
const lastVisualRow = multiRowCount.value - 1;
|
|
274
|
+
if (direction === "left") {
|
|
275
|
+
const prevCol = findPreviousInVisualRow(
|
|
276
|
+
currentColumnIndex,
|
|
277
|
+
currentVisualRow,
|
|
278
|
+
currentRow,
|
|
279
|
+
isValidTarget
|
|
280
|
+
);
|
|
281
|
+
if (prevCol !== null) {
|
|
282
|
+
return { rowIndex: currentRowIndex, columnIndex: prevCol };
|
|
283
|
+
}
|
|
284
|
+
if (currentVisualRow > 0) {
|
|
285
|
+
const lastInPrevRow = findLastInVisualRow(currentVisualRow - 1, currentRow, isValidTarget);
|
|
286
|
+
if (lastInPrevRow !== null) {
|
|
287
|
+
return { rowIndex: currentRowIndex, columnIndex: lastInPrevRow };
|
|
288
|
+
}
|
|
289
|
+
}
|
|
290
|
+
if (currentRowIndex > 0) {
|
|
291
|
+
const prevDataRow = rows[currentRowIndex - 1];
|
|
292
|
+
if (prevDataRow) {
|
|
293
|
+
const lastInLastRow = findLastInVisualRow(lastVisualRow, prevDataRow, isValidTarget);
|
|
294
|
+
if (lastInLastRow !== null) {
|
|
295
|
+
return { rowIndex: currentRowIndex - 1, columnIndex: lastInLastRow };
|
|
296
|
+
}
|
|
297
|
+
}
|
|
298
|
+
}
|
|
299
|
+
} else {
|
|
300
|
+
const nextCol = findNextInVisualRow(
|
|
301
|
+
currentColumnIndex,
|
|
302
|
+
currentVisualRow,
|
|
303
|
+
currentRow,
|
|
304
|
+
isValidTarget
|
|
305
|
+
);
|
|
306
|
+
if (nextCol !== null) {
|
|
307
|
+
return { rowIndex: currentRowIndex, columnIndex: nextCol };
|
|
308
|
+
}
|
|
309
|
+
if (currentVisualRow < lastVisualRow) {
|
|
310
|
+
const firstInNextRow = findFirstInVisualRow(
|
|
311
|
+
currentVisualRow + 1,
|
|
312
|
+
currentRow,
|
|
313
|
+
isValidTarget
|
|
314
|
+
);
|
|
315
|
+
if (firstInNextRow !== null) {
|
|
316
|
+
return { rowIndex: currentRowIndex, columnIndex: firstInNextRow };
|
|
317
|
+
}
|
|
318
|
+
}
|
|
319
|
+
if (currentRowIndex < rows.length - 1) {
|
|
320
|
+
const nextDataRow = rows[currentRowIndex + 1];
|
|
321
|
+
if (nextDataRow) {
|
|
322
|
+
const firstInFirstRow = findFirstInVisualRow(0, nextDataRow, isValidTarget);
|
|
323
|
+
if (firstInFirstRow !== null) {
|
|
324
|
+
return { rowIndex: currentRowIndex + 1, columnIndex: firstInFirstRow };
|
|
325
|
+
}
|
|
326
|
+
}
|
|
327
|
+
}
|
|
328
|
+
}
|
|
329
|
+
} else {
|
|
330
|
+
if (direction === "left") {
|
|
331
|
+
const prevCol = findPreviousColumn(currentColumnIndex, currentRow, isValidTarget);
|
|
332
|
+
if (prevCol !== currentColumnIndex) {
|
|
333
|
+
return { rowIndex: currentRowIndex, columnIndex: prevCol };
|
|
334
|
+
}
|
|
335
|
+
} else {
|
|
336
|
+
const nextCol = findNextColumn(currentColumnIndex, currentRow, isValidTarget);
|
|
337
|
+
if (nextCol !== currentColumnIndex) {
|
|
338
|
+
return { rowIndex: currentRowIndex, columnIndex: nextCol };
|
|
339
|
+
}
|
|
340
|
+
}
|
|
341
|
+
}
|
|
342
|
+
return null;
|
|
343
|
+
}
|
|
344
|
+
function navigateTab(direction, currentRowIndex, currentColumnIndex, rows, isValidTarget) {
|
|
345
|
+
const currentRow = rows[currentRowIndex];
|
|
346
|
+
if (!currentRow) return null;
|
|
347
|
+
if (direction === "next") {
|
|
348
|
+
const nextCol = findNextColumn(currentColumnIndex, currentRow, isValidTarget);
|
|
349
|
+
if (nextCol !== currentColumnIndex) {
|
|
350
|
+
return { rowIndex: currentRowIndex, columnIndex: nextCol };
|
|
351
|
+
}
|
|
352
|
+
if (currentRowIndex < rows.length - 1) {
|
|
353
|
+
const nextRow = rows[currentRowIndex + 1];
|
|
354
|
+
if (nextRow) {
|
|
355
|
+
const firstCol = findFirstColumn(nextRow, isValidTarget);
|
|
356
|
+
return { rowIndex: currentRowIndex + 1, columnIndex: firstCol };
|
|
357
|
+
}
|
|
358
|
+
}
|
|
359
|
+
} else {
|
|
360
|
+
const prevCol = findPreviousColumn(currentColumnIndex, currentRow, isValidTarget);
|
|
361
|
+
if (prevCol !== currentColumnIndex) {
|
|
362
|
+
return { rowIndex: currentRowIndex, columnIndex: prevCol };
|
|
363
|
+
}
|
|
364
|
+
if (currentRowIndex > 0) {
|
|
365
|
+
const prevRow = rows[currentRowIndex - 1];
|
|
366
|
+
if (prevRow) {
|
|
367
|
+
const lastCol = findLastColumn(prevRow, isValidTarget);
|
|
368
|
+
return { rowIndex: currentRowIndex - 1, columnIndex: lastCol };
|
|
369
|
+
}
|
|
370
|
+
}
|
|
371
|
+
}
|
|
372
|
+
return null;
|
|
373
|
+
}
|
|
374
|
+
function navigateToEdge(edge, currentRowIndex, rows, isValidTarget) {
|
|
375
|
+
const currentRow = rows[currentRowIndex];
|
|
376
|
+
if (!currentRow) return null;
|
|
377
|
+
const columnIndex = edge === "first" ? findFirstColumn(currentRow, isValidTarget) : findLastColumn(currentRow, isValidTarget);
|
|
378
|
+
return { rowIndex: currentRowIndex, columnIndex };
|
|
379
|
+
}
|
|
380
|
+
return {
|
|
381
|
+
// Configuration (reactive)
|
|
382
|
+
multiRowEnabled,
|
|
383
|
+
multiRowCount,
|
|
384
|
+
alignColumns,
|
|
385
|
+
visibleColumns,
|
|
386
|
+
// Core multi-row helpers
|
|
387
|
+
getVisualRowForColumn,
|
|
388
|
+
getColumnsInVisualRow,
|
|
389
|
+
getNonPinnedColumnsInVisualRow,
|
|
390
|
+
findColumnInVisualRow,
|
|
391
|
+
// Visual row finders
|
|
392
|
+
findFirstInVisualRow,
|
|
393
|
+
findLastInVisualRow,
|
|
394
|
+
findNextInVisualRow,
|
|
395
|
+
findPreviousInVisualRow,
|
|
396
|
+
// Column finders
|
|
397
|
+
findFirstColumn,
|
|
398
|
+
findLastColumn,
|
|
399
|
+
findNextColumn,
|
|
400
|
+
findPreviousColumn,
|
|
401
|
+
// High-level navigation
|
|
402
|
+
navigateVertical,
|
|
403
|
+
navigateHorizontal,
|
|
404
|
+
navigateTab,
|
|
405
|
+
navigateToEdge
|
|
406
|
+
};
|
|
407
|
+
}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import type { TableData } from '@nuxt/ui';
|
|
2
|
+
import type { Table } from '@tanstack/vue-table';
|
|
3
|
+
import type { ComputedRef, Ref } from 'vue';
|
|
4
|
+
import type { NuGridPagingOptions, NuGridProps } from '../../types/index.js';
|
|
5
|
+
/**
|
|
6
|
+
* Paging context provided to child components
|
|
7
|
+
*/
|
|
8
|
+
export interface NuGridPagingContext {
|
|
9
|
+
/** Whether paging is enabled */
|
|
10
|
+
enabled: ComputedRef<boolean>;
|
|
11
|
+
/** Current page size (rows per page) */
|
|
12
|
+
pageSize: ComputedRef<number>;
|
|
13
|
+
/** Current page index (0-based) */
|
|
14
|
+
pageIndex: ComputedRef<number>;
|
|
15
|
+
/** Total number of rows (after filtering) */
|
|
16
|
+
totalRows: ComputedRef<number>;
|
|
17
|
+
/** Total number of pages */
|
|
18
|
+
totalPages: ComputedRef<number>;
|
|
19
|
+
/** Page size selector options */
|
|
20
|
+
pageSizeOptions: ComputedRef<number[]>;
|
|
21
|
+
/** Whether to show the built-in paging panel */
|
|
22
|
+
showPanel: ComputedRef<boolean>;
|
|
23
|
+
/** Whether auto page size is enabled */
|
|
24
|
+
autoPageSize: ComputedRef<boolean>;
|
|
25
|
+
/** Navigate to a specific page (0-based index) */
|
|
26
|
+
setPageIndex: (index: number) => void;
|
|
27
|
+
/** Set the page size */
|
|
28
|
+
setPageSize: (size: number) => void;
|
|
29
|
+
/** Navigate to the first page */
|
|
30
|
+
firstPage: () => void;
|
|
31
|
+
/** Navigate to the last page */
|
|
32
|
+
lastPage: () => void;
|
|
33
|
+
/** Navigate to the next page */
|
|
34
|
+
nextPage: () => void;
|
|
35
|
+
/** Navigate to the previous page */
|
|
36
|
+
previousPage: () => void;
|
|
37
|
+
/** Check if can go to next page */
|
|
38
|
+
canNextPage: ComputedRef<boolean>;
|
|
39
|
+
/** Check if can go to previous page */
|
|
40
|
+
canPreviousPage: ComputedRef<boolean>;
|
|
41
|
+
}
|
|
42
|
+
interface UseNuGridPagingOptions<T extends TableData> {
|
|
43
|
+
/** NuGrid props */
|
|
44
|
+
props: NuGridProps<T>;
|
|
45
|
+
/** TanStack table instance */
|
|
46
|
+
tableApi: Table<T>;
|
|
47
|
+
/** Root container element for auto page size calculation */
|
|
48
|
+
rootRef: Ref<HTMLElement | null>;
|
|
49
|
+
/** Row height for auto page size calculation */
|
|
50
|
+
estimatedRowHeight?: number;
|
|
51
|
+
/** Header height for auto page size calculation */
|
|
52
|
+
headerHeight?: number;
|
|
53
|
+
/** Paging panel height for auto page size calculation */
|
|
54
|
+
pagingPanelHeight?: number;
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* Resolve paging options from props
|
|
58
|
+
* Handles boolean shorthand and merges with defaults
|
|
59
|
+
*/
|
|
60
|
+
export declare function resolvePagingOptions(prop: boolean | NuGridPagingOptions | undefined): NuGridPagingOptions;
|
|
61
|
+
/**
|
|
62
|
+
* Get the pagination row model for TanStack table
|
|
63
|
+
* Returns undefined if paging is not enabled
|
|
64
|
+
*/
|
|
65
|
+
export declare function getPagingRowModelIfEnabled(prop: boolean | NuGridPagingOptions | undefined): ((table: Table<unknown>) => () => import("@tanstack/table-core").RowModel<unknown>) | undefined;
|
|
66
|
+
/**
|
|
67
|
+
* Composable for NuGrid paging
|
|
68
|
+
*
|
|
69
|
+
* Provides:
|
|
70
|
+
* - Paging configuration from props
|
|
71
|
+
* - Auto page size calculation based on container height
|
|
72
|
+
* - Page navigation methods
|
|
73
|
+
* - Paging context for child components
|
|
74
|
+
*/
|
|
75
|
+
export declare function useNuGridPaging<T extends TableData = TableData>(options: UseNuGridPagingOptions<T>): NuGridPagingContext;
|
|
76
|
+
export {};
|
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
import { getPaginationRowModel } from "@tanstack/vue-table";
|
|
2
|
+
import { useResizeObserver } from "@vueuse/core";
|
|
3
|
+
import { computed, ref, watch } from "vue";
|
|
4
|
+
import { nuGridDefaults } from "../../config/_internal/index.js";
|
|
5
|
+
export function resolvePagingOptions(prop) {
|
|
6
|
+
const defaults = nuGridDefaults.paging;
|
|
7
|
+
if (prop === void 0 || prop === false) {
|
|
8
|
+
return { ...defaults, enabled: false };
|
|
9
|
+
}
|
|
10
|
+
if (prop === true) {
|
|
11
|
+
return { ...defaults, enabled: true };
|
|
12
|
+
}
|
|
13
|
+
return {
|
|
14
|
+
enabled: prop.enabled ?? defaults.enabled,
|
|
15
|
+
pageSize: prop.pageSize ?? defaults.pageSize,
|
|
16
|
+
pageSizeSelector: prop.pageSizeSelector ?? defaults.pageSizeSelector,
|
|
17
|
+
autoPageSize: prop.autoPageSize ?? defaults.autoPageSize,
|
|
18
|
+
autoPageSizeMinimum: prop.autoPageSizeMinimum ?? defaults.autoPageSizeMinimum,
|
|
19
|
+
suppressPanel: prop.suppressPanel ?? defaults.suppressPanel
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
export function getPagingRowModelIfEnabled(prop) {
|
|
23
|
+
const options = resolvePagingOptions(prop);
|
|
24
|
+
if (options.enabled) {
|
|
25
|
+
return getPaginationRowModel();
|
|
26
|
+
}
|
|
27
|
+
return void 0;
|
|
28
|
+
}
|
|
29
|
+
export function useNuGridPaging(options) {
|
|
30
|
+
const { props, tableApi, rootRef } = options;
|
|
31
|
+
const resolvedOptions = computed(() => resolvePagingOptions(props.paging));
|
|
32
|
+
const enabled = computed(() => resolvedOptions.value.enabled ?? false);
|
|
33
|
+
const autoPageSizeEnabled = computed(() => resolvedOptions.value.autoPageSize ?? false);
|
|
34
|
+
const suppressPanel = computed(() => resolvedOptions.value.suppressPanel ?? false);
|
|
35
|
+
const showPanel = computed(() => enabled.value && !suppressPanel.value);
|
|
36
|
+
const pageSizeOptions = computed(() => {
|
|
37
|
+
const selector = resolvedOptions.value.pageSizeSelector;
|
|
38
|
+
if (selector === false) {
|
|
39
|
+
return [];
|
|
40
|
+
}
|
|
41
|
+
if (Array.isArray(selector)) {
|
|
42
|
+
return selector;
|
|
43
|
+
}
|
|
44
|
+
return nuGridDefaults.paging.pageSizeSelector;
|
|
45
|
+
});
|
|
46
|
+
const calculatedAutoPageSize = ref(null);
|
|
47
|
+
const autoPageSizeMinimum = computed(
|
|
48
|
+
() => resolvedOptions.value.autoPageSizeMinimum ?? nuGridDefaults.paging.autoPageSizeMinimum
|
|
49
|
+
);
|
|
50
|
+
const calculateAutoPageSize = () => {
|
|
51
|
+
if (!autoPageSizeEnabled.value || !rootRef.value) {
|
|
52
|
+
calculatedAutoPageSize.value = null;
|
|
53
|
+
return;
|
|
54
|
+
}
|
|
55
|
+
const containerHeight = rootRef.value.clientHeight;
|
|
56
|
+
if (containerHeight <= 0) {
|
|
57
|
+
calculatedAutoPageSize.value = null;
|
|
58
|
+
return;
|
|
59
|
+
}
|
|
60
|
+
const headerHeight = options.headerHeight ?? 48;
|
|
61
|
+
const pagingHeight = options.pagingPanelHeight ?? 56;
|
|
62
|
+
const rowHeight = options.estimatedRowHeight ?? 48;
|
|
63
|
+
const availableHeight = containerHeight - headerHeight - pagingHeight;
|
|
64
|
+
const minimum = autoPageSizeMinimum.value;
|
|
65
|
+
const calculatedSize = Math.max(minimum, Math.floor(availableHeight / rowHeight));
|
|
66
|
+
calculatedAutoPageSize.value = calculatedSize;
|
|
67
|
+
if (autoPageSizeEnabled.value && tableApi) {
|
|
68
|
+
tableApi.setPageSize(calculatedSize);
|
|
69
|
+
}
|
|
70
|
+
};
|
|
71
|
+
useResizeObserver(rootRef, () => {
|
|
72
|
+
if (autoPageSizeEnabled.value) {
|
|
73
|
+
calculateAutoPageSize();
|
|
74
|
+
}
|
|
75
|
+
});
|
|
76
|
+
watch(
|
|
77
|
+
[enabled, () => resolvedOptions.value.pageSize, autoPageSizeEnabled],
|
|
78
|
+
([isEnabled, configuredPageSize]) => {
|
|
79
|
+
if (isEnabled && !autoPageSizeEnabled.value && tableApi) {
|
|
80
|
+
tableApi.setPageSize(configuredPageSize ?? nuGridDefaults.paging.pageSize);
|
|
81
|
+
}
|
|
82
|
+
},
|
|
83
|
+
{ immediate: true }
|
|
84
|
+
);
|
|
85
|
+
watch(autoPageSizeEnabled, (isAuto) => {
|
|
86
|
+
if (isAuto) {
|
|
87
|
+
calculateAutoPageSize();
|
|
88
|
+
}
|
|
89
|
+
});
|
|
90
|
+
const pageSize = computed(() => {
|
|
91
|
+
if (autoPageSizeEnabled.value && calculatedAutoPageSize.value !== null) {
|
|
92
|
+
return calculatedAutoPageSize.value;
|
|
93
|
+
}
|
|
94
|
+
return tableApi?.getState().pagination.pageSize ?? resolvedOptions.value.pageSize ?? 20;
|
|
95
|
+
});
|
|
96
|
+
const pageIndex = computed(() => {
|
|
97
|
+
return tableApi?.getState().pagination.pageIndex ?? 0;
|
|
98
|
+
});
|
|
99
|
+
const totalRows = computed(() => {
|
|
100
|
+
return tableApi?.getFilteredRowModel().rows.length ?? 0;
|
|
101
|
+
});
|
|
102
|
+
const totalPages = computed(() => {
|
|
103
|
+
return tableApi?.getPageCount() ?? 0;
|
|
104
|
+
});
|
|
105
|
+
const canNextPage = computed(() => {
|
|
106
|
+
return tableApi?.getCanNextPage() ?? false;
|
|
107
|
+
});
|
|
108
|
+
const canPreviousPage = computed(() => {
|
|
109
|
+
return tableApi?.getCanPreviousPage() ?? false;
|
|
110
|
+
});
|
|
111
|
+
const setPageIndex = (index) => {
|
|
112
|
+
tableApi?.setPageIndex(index);
|
|
113
|
+
};
|
|
114
|
+
const setPageSize = (size) => {
|
|
115
|
+
tableApi?.setPageSize(size);
|
|
116
|
+
};
|
|
117
|
+
const firstPage = () => {
|
|
118
|
+
tableApi?.firstPage();
|
|
119
|
+
};
|
|
120
|
+
const lastPage = () => {
|
|
121
|
+
tableApi?.lastPage();
|
|
122
|
+
};
|
|
123
|
+
const nextPage = () => {
|
|
124
|
+
tableApi?.nextPage();
|
|
125
|
+
};
|
|
126
|
+
const previousPage = () => {
|
|
127
|
+
tableApi?.previousPage();
|
|
128
|
+
};
|
|
129
|
+
return {
|
|
130
|
+
enabled,
|
|
131
|
+
pageSize,
|
|
132
|
+
pageIndex,
|
|
133
|
+
totalRows,
|
|
134
|
+
totalPages,
|
|
135
|
+
pageSizeOptions,
|
|
136
|
+
showPanel,
|
|
137
|
+
autoPageSize: autoPageSizeEnabled,
|
|
138
|
+
setPageIndex,
|
|
139
|
+
setPageSize,
|
|
140
|
+
firstPage,
|
|
141
|
+
lastPage,
|
|
142
|
+
nextPage,
|
|
143
|
+
previousPage,
|
|
144
|
+
canNextPage,
|
|
145
|
+
canPreviousPage
|
|
146
|
+
};
|
|
147
|
+
}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import type { TableData } from '@nuxt/ui';
|
|
2
|
+
import type { Row, Table } from '@tanstack/vue-table';
|
|
3
|
+
import type { Ref } from 'vue';
|
|
4
|
+
import type { NuGridEventEmitter } from '../../types/index.js';
|
|
5
|
+
export type { RowDragEvent } from '../../types/drag-drop.js';
|
|
6
|
+
export interface RowDragOptions {
|
|
7
|
+
/**
|
|
8
|
+
* Enable row dragging
|
|
9
|
+
* @defaultValue false
|
|
10
|
+
*/
|
|
11
|
+
enabled?: boolean;
|
|
12
|
+
/**
|
|
13
|
+
* Field name to update with new sort order after drag
|
|
14
|
+
* @defaultValue undefined
|
|
15
|
+
*/
|
|
16
|
+
sortOrderField?: string;
|
|
17
|
+
/**
|
|
18
|
+
* Allow dragging rows between groups
|
|
19
|
+
* @defaultValue false
|
|
20
|
+
*/
|
|
21
|
+
allowCrossGroup?: boolean;
|
|
22
|
+
/**
|
|
23
|
+
* Allow dragging rows between different grid instances
|
|
24
|
+
* @defaultValue false
|
|
25
|
+
*/
|
|
26
|
+
allowCrossGrid?: boolean;
|
|
27
|
+
/**
|
|
28
|
+
* Grid instance ID for cross-grid dragging
|
|
29
|
+
* @defaultValue undefined
|
|
30
|
+
*/
|
|
31
|
+
gridId?: string;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Row drag and drop functionality
|
|
35
|
+
*/
|
|
36
|
+
export declare function useNuGridRowDragDrop<T extends TableData>(tableApi: Table<T>, data: Ref<T[]>, options: Ref<RowDragOptions>, tableRef: Ref<HTMLDivElement | null>, emit?: (event: string, ...args: any[]) => void, eventEmitter?: NuGridEventEmitter<T>): Ref<{
|
|
37
|
+
draggedRowId: string | null;
|
|
38
|
+
draggedRowData: any;
|
|
39
|
+
dropTargetRowId: string | null;
|
|
40
|
+
dropPosition: "before" | "after";
|
|
41
|
+
dragSourceGridId: string | null;
|
|
42
|
+
isDraggingOutside: boolean;
|
|
43
|
+
handleRowDragStart: (e: DragEvent, row: Row<T>) => void;
|
|
44
|
+
handleRowDragOver: (e: DragEvent, row: Row<T>) => void;
|
|
45
|
+
handleRowDrop: (e: DragEvent, row: Row<T>) => void;
|
|
46
|
+
handleRowDragEnd: () => void;
|
|
47
|
+
handleRowDragLeave: (e: DragEvent) => void;
|
|
48
|
+
handleRowDragEnter: () => void;
|
|
49
|
+
isRowDraggable: (row: Row<T>) => boolean;
|
|
50
|
+
rowDragHandleProps: (row: Row<T>) => Record<string, unknown>;
|
|
51
|
+
rowDragProps: (row: Row<T>) => Record<string, unknown>;
|
|
52
|
+
}, {
|
|
53
|
+
draggedRowId: string | null;
|
|
54
|
+
draggedRowData: any;
|
|
55
|
+
dropTargetRowId: string | null;
|
|
56
|
+
dropPosition: "before" | "after";
|
|
57
|
+
dragSourceGridId: string | null;
|
|
58
|
+
isDraggingOutside: boolean;
|
|
59
|
+
handleRowDragStart: (e: DragEvent, row: Row<T>) => void;
|
|
60
|
+
handleRowDragOver: (e: DragEvent, row: Row<T>) => void;
|
|
61
|
+
handleRowDrop: (e: DragEvent, row: Row<T>) => void;
|
|
62
|
+
handleRowDragEnd: () => void;
|
|
63
|
+
handleRowDragLeave: (e: DragEvent) => void;
|
|
64
|
+
handleRowDragEnter: () => void;
|
|
65
|
+
isRowDraggable: (row: Row<T>) => boolean;
|
|
66
|
+
rowDragHandleProps: (row: Row<T>) => Record<string, unknown>;
|
|
67
|
+
rowDragProps: (row: Row<T>) => Record<string, unknown>;
|
|
68
|
+
}>;
|