@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,20 @@
|
|
|
1
|
+
import type { TableData, TableSlots } from '@nuxt/ui';
|
|
2
|
+
import type { NuGridProps } from '../../types/index.js';
|
|
3
|
+
declare const __VLS_export: <T extends TableData>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_exposed?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
|
|
4
|
+
props: import("vue").PublicProps & __VLS_PrettifyLocal<NuGridProps<T>> & (typeof globalThis extends {
|
|
5
|
+
__VLS_PROPS_FALLBACK: infer P;
|
|
6
|
+
} ? P : {});
|
|
7
|
+
expose: (exposed: {}) => void;
|
|
8
|
+
attrs: any;
|
|
9
|
+
slots: TableSlots<T>;
|
|
10
|
+
emit: {};
|
|
11
|
+
}>) => import("vue").VNode & {
|
|
12
|
+
__ctx?: Awaited<typeof __VLS_setup>;
|
|
13
|
+
};
|
|
14
|
+
declare const _default: typeof __VLS_export;
|
|
15
|
+
export default _default;
|
|
16
|
+
type __VLS_PrettifyLocal<T> = (T extends any ? {
|
|
17
|
+
[K in keyof T]: T[K];
|
|
18
|
+
} : {
|
|
19
|
+
[K in keyof T as K]: T[K];
|
|
20
|
+
}) & {};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
declare const __VLS_export: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
2
|
+
declare const _default: typeof __VLS_export;
|
|
3
|
+
export default _default;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import theme from "#build/ui/tooltip";
|
|
3
|
+
import { tv } from "@nuxt/ui/utils/tv";
|
|
4
|
+
import { Presence } from "reka-ui";
|
|
5
|
+
import { computed } from "vue";
|
|
6
|
+
import { useNuGridTooltip } from "../../composables/_internal/useNuGridTooltip";
|
|
7
|
+
const { tooltipState } = useNuGridTooltip();
|
|
8
|
+
const appConfig = useAppConfig();
|
|
9
|
+
const ui = computed(
|
|
10
|
+
() => tv({ extend: tv(theme), ...appConfig.ui?.tooltip || {} })({
|
|
11
|
+
side: "top"
|
|
12
|
+
})
|
|
13
|
+
);
|
|
14
|
+
const isOpen = computed(() => !!tooltipState.value);
|
|
15
|
+
</script>
|
|
16
|
+
|
|
17
|
+
<template>
|
|
18
|
+
<Teleport to="body">
|
|
19
|
+
<Presence :present="isOpen">
|
|
20
|
+
<div
|
|
21
|
+
v-if="tooltipState"
|
|
22
|
+
:data-state="isOpen ? 'delayed-open' : 'closed'"
|
|
23
|
+
data-slot="content"
|
|
24
|
+
class="pointer-events-none fixed z-50 -translate-x-1/2 -translate-y-full"
|
|
25
|
+
:class="ui.content()"
|
|
26
|
+
:style="{
|
|
27
|
+
'left': `${tooltipState.x}px`,
|
|
28
|
+
'top': `${tooltipState.y - 8}px`,
|
|
29
|
+
'--reka-tooltip-content-transform-origin': 'bottom center'
|
|
30
|
+
}"
|
|
31
|
+
>
|
|
32
|
+
<span data-slot="text" class="truncate" :class="ui.text()">{{ tooltipState.text }}</span>
|
|
33
|
+
</div>
|
|
34
|
+
</Presence>
|
|
35
|
+
</Teleport>
|
|
36
|
+
</template>
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
declare const __VLS_export: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
2
|
+
declare const _default: typeof __VLS_export;
|
|
3
|
+
export default _default;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @internal
|
|
3
|
+
*/
|
|
4
|
+
export * from './keyboard-handlers/index.js';
|
|
5
|
+
export * from './useNuGridActionMenu.js';
|
|
6
|
+
export * from './useNuGridAddRow.js';
|
|
7
|
+
export * from './useNuGridAnimation.js';
|
|
8
|
+
export * from './useNuGridAutosize.js';
|
|
9
|
+
export * from './useNuGridCellEditing.js';
|
|
10
|
+
export * from './useNuGridColumnDragDrop.js';
|
|
11
|
+
export * from './useNuGridColumnPinning.js';
|
|
12
|
+
export * from './useNuGridColumnResize.js';
|
|
13
|
+
export * from './useNuGridCore.js';
|
|
14
|
+
export * from './useNuGridExcel.js';
|
|
15
|
+
export * from './useNuGridFocus.js';
|
|
16
|
+
export * from './useNuGridGrouping.js';
|
|
17
|
+
export * from './useNuGridGroupSelection.js';
|
|
18
|
+
export * from './useNuGridInteractionRouter.js';
|
|
19
|
+
export * from './useNuGridInteractions.js';
|
|
20
|
+
export * from './useNuGridKeyboardNavigation.js';
|
|
21
|
+
export * from './useNuGridPaging.js';
|
|
22
|
+
export * from './useNuGridRowDragDrop.js';
|
|
23
|
+
export * from './useNuGridRowSelection.js';
|
|
24
|
+
export * from './useNuGridScroll.js';
|
|
25
|
+
export * from './useNuGridScrollbars.js';
|
|
26
|
+
export * from './useNuGridScrollState.js';
|
|
27
|
+
export * from './useNuGridStatePersistence.js';
|
|
28
|
+
export * from './useNuGridTooltip.js';
|
|
29
|
+
export * from './useNuGridUI.js';
|
|
30
|
+
export * from './useNuGridVirtualization.js';
|
|
31
|
+
export * from './useNuGridWheelSmoothing.js';
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
export * from "./keyboard-handlers/index.js";
|
|
2
|
+
export * from "./useNuGridActionMenu.js";
|
|
3
|
+
export * from "./useNuGridAddRow.js";
|
|
4
|
+
export * from "./useNuGridAnimation.js";
|
|
5
|
+
export * from "./useNuGridAutosize.js";
|
|
6
|
+
export * from "./useNuGridCellEditing.js";
|
|
7
|
+
export * from "./useNuGridColumnDragDrop.js";
|
|
8
|
+
export * from "./useNuGridColumnPinning.js";
|
|
9
|
+
export * from "./useNuGridColumnResize.js";
|
|
10
|
+
export * from "./useNuGridCore.js";
|
|
11
|
+
export * from "./useNuGridExcel.js";
|
|
12
|
+
export * from "./useNuGridFocus.js";
|
|
13
|
+
export * from "./useNuGridGrouping.js";
|
|
14
|
+
export * from "./useNuGridGroupSelection.js";
|
|
15
|
+
export * from "./useNuGridInteractionRouter.js";
|
|
16
|
+
export * from "./useNuGridInteractions.js";
|
|
17
|
+
export * from "./useNuGridKeyboardNavigation.js";
|
|
18
|
+
export * from "./useNuGridPaging.js";
|
|
19
|
+
export * from "./useNuGridRowDragDrop.js";
|
|
20
|
+
export * from "./useNuGridRowSelection.js";
|
|
21
|
+
export * from "./useNuGridScroll.js";
|
|
22
|
+
export * from "./useNuGridScrollbars.js";
|
|
23
|
+
export * from "./useNuGridScrollState.js";
|
|
24
|
+
export * from "./useNuGridStatePersistence.js";
|
|
25
|
+
export * from "./useNuGridTooltip.js";
|
|
26
|
+
export * from "./useNuGridUI.js";
|
|
27
|
+
export * from "./useNuGridVirtualization.js";
|
|
28
|
+
export * from "./useNuGridWheelSmoothing.js";
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export { type CellTypeDispatchOptions, createCellTypeDispatchHandler, } from './useKeyboardCellTypeDispatch.js';
|
|
2
|
+
export { createEditingTriggersHandler, type EditingTriggersOptions, type StartKeyOption, type StartKeysConfig, } from './useKeyboardEditingTriggers.js';
|
|
3
|
+
export { createNavigationHandler } from './useKeyboardNavigation.js';
|
|
4
|
+
export { type KeyboardSetupOptions, useKeyboardSetup } from './useKeyboardSetup.js';
|
|
5
|
+
export { createPagingKeyboardHandler } from './usePagingKeyboard.js';
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export {
|
|
2
|
+
createCellTypeDispatchHandler
|
|
3
|
+
} from "./useKeyboardCellTypeDispatch.js";
|
|
4
|
+
export {
|
|
5
|
+
createEditingTriggersHandler
|
|
6
|
+
} from "./useKeyboardEditingTriggers.js";
|
|
7
|
+
export { createNavigationHandler } from "./useKeyboardNavigation.js";
|
|
8
|
+
export { useKeyboardSetup } from "./useKeyboardSetup.js";
|
|
9
|
+
export { createPagingKeyboardHandler } from "./usePagingKeyboard.js";
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { TableData } from '@nuxt/ui';
|
|
2
|
+
import type { Ref } from 'vue';
|
|
3
|
+
import type { NuGridKeyboardHandler } from '../../../types/_internal/index.js';
|
|
4
|
+
export interface CellTypeDispatchOptions<T extends TableData> {
|
|
5
|
+
cellTypes?: Ref<any[] | undefined>;
|
|
6
|
+
data: Ref<T[]>;
|
|
7
|
+
emit: (payload: {
|
|
8
|
+
row: any;
|
|
9
|
+
column: any;
|
|
10
|
+
oldValue: any;
|
|
11
|
+
newValue: any;
|
|
12
|
+
}) => void;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Creates a keyboard handler that dispatches to cell type keyboard handlers
|
|
16
|
+
* Priority 15 - runs before editing triggers
|
|
17
|
+
*/
|
|
18
|
+
export declare function createCellTypeDispatchHandler<T extends TableData>(options: CellTypeDispatchOptions<T>): NuGridKeyboardHandler<T>;
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { ROUTER_PRIORITIES } from "../../../types/_internal/index.js";
|
|
2
|
+
import { useNuGridCellTypeRegistry } from "../../useNuGridCellTypeRegistry.js";
|
|
3
|
+
export function createCellTypeDispatchHandler(options) {
|
|
4
|
+
const typeRegistry = useNuGridCellTypeRegistry(options.cellTypes);
|
|
5
|
+
return {
|
|
6
|
+
id: "keyboard-cell-type-dispatch",
|
|
7
|
+
priority: ROUTER_PRIORITIES.KEYBOARD_CELL_TYPE,
|
|
8
|
+
when: (ctx) => {
|
|
9
|
+
return !ctx.isEditing && ctx.cell !== null && ctx.focusedCell !== null;
|
|
10
|
+
},
|
|
11
|
+
handle: (ctx) => {
|
|
12
|
+
const { cell, focusedRow: row, event, cellEditingFns, tableApi, focusFns, cellIndex } = ctx;
|
|
13
|
+
if (!cell || !row) return { handled: false };
|
|
14
|
+
const columnDef = cell.column.columnDef;
|
|
15
|
+
const cellDataType = columnDef.cellDataType || "text";
|
|
16
|
+
const keyboardHandler = typeRegistry.getKeyboardHandler(cellDataType);
|
|
17
|
+
if (!keyboardHandler) {
|
|
18
|
+
return { handled: false };
|
|
19
|
+
}
|
|
20
|
+
const isFocused = focusFns.shouldCellHandleKeydown(row, cellIndex);
|
|
21
|
+
const canEdit = cellEditingFns.isCellEditable(row, cell);
|
|
22
|
+
const pluginContext = {
|
|
23
|
+
cell,
|
|
24
|
+
row,
|
|
25
|
+
columnDef,
|
|
26
|
+
column: cell.column,
|
|
27
|
+
getValue: () => cell.getValue(),
|
|
28
|
+
isFocused,
|
|
29
|
+
canEdit,
|
|
30
|
+
data: options.data.value,
|
|
31
|
+
tableApi,
|
|
32
|
+
startEditing: (initialValue) => cellEditingFns.startEditing(row, cell, initialValue),
|
|
33
|
+
stopEditing: (newValue, moveDirection) => {
|
|
34
|
+
cellEditingFns.stopEditing(row, cell, newValue, moveDirection);
|
|
35
|
+
},
|
|
36
|
+
emitChange: (oldValue, newValue) => {
|
|
37
|
+
options.emit({
|
|
38
|
+
row,
|
|
39
|
+
column: cell.column,
|
|
40
|
+
oldValue,
|
|
41
|
+
newValue
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
};
|
|
45
|
+
const result = keyboardHandler(event, pluginContext);
|
|
46
|
+
return {
|
|
47
|
+
handled: result.handled,
|
|
48
|
+
preventDefault: result.preventDefault,
|
|
49
|
+
stopPropagation: result.stopPropagation
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
};
|
|
53
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { TableData } from '@nuxt/ui';
|
|
2
|
+
import type { NuGridKeyboardHandler } from '../../../types/_internal/index.js';
|
|
3
|
+
export type StartKeyOption = 'enter' | 'f2' | 'bs' | 'alpha' | 'numeric';
|
|
4
|
+
export type StartKeysConfig = 'all' | 'minimal' | 'none' | StartKeyOption[];
|
|
5
|
+
export interface EditingTriggersOptions {
|
|
6
|
+
getStartKeys: () => StartKeysConfig;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* Creates a keyboard handler for editing triggers (F2, Enter, Backspace, alphanumeric)
|
|
10
|
+
* Priority 20 - runs after cell type handlers
|
|
11
|
+
*/
|
|
12
|
+
export declare function createEditingTriggersHandler<T extends TableData>(options: EditingTriggersOptions): NuGridKeyboardHandler<T>;
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { ROUTER_PRIORITIES } from "../../../types/_internal/index.js";
|
|
2
|
+
function parseStartKeys(config) {
|
|
3
|
+
if (config === "all") {
|
|
4
|
+
return ["enter", "f2", "bs", "alpha", "numeric"];
|
|
5
|
+
}
|
|
6
|
+
if (config === "minimal") {
|
|
7
|
+
return ["enter", "f2"];
|
|
8
|
+
}
|
|
9
|
+
if (config === "none") {
|
|
10
|
+
return [];
|
|
11
|
+
}
|
|
12
|
+
return config;
|
|
13
|
+
}
|
|
14
|
+
export function createEditingTriggersHandler(options) {
|
|
15
|
+
return {
|
|
16
|
+
id: "keyboard-editing-triggers",
|
|
17
|
+
priority: ROUTER_PRIORITIES.KEYBOARD_EDITING_TRIGGERS,
|
|
18
|
+
when: (ctx) => {
|
|
19
|
+
if (ctx.isEditing || !ctx.editingEnabled) return false;
|
|
20
|
+
if (!ctx.cell || !ctx.focusedRow) return false;
|
|
21
|
+
return ctx.cellEditingFns.isCellEditable(ctx.focusedRow, ctx.cell);
|
|
22
|
+
},
|
|
23
|
+
handle: (ctx) => {
|
|
24
|
+
const { event, cell, focusedRow: row, cellEditingFns } = ctx;
|
|
25
|
+
if (!cell || !row) return { handled: false };
|
|
26
|
+
const enabledKeys = parseStartKeys(options.getStartKeys());
|
|
27
|
+
if (enabledKeys.length === 0) {
|
|
28
|
+
return { handled: false };
|
|
29
|
+
}
|
|
30
|
+
if (event.key === "F2" && enabledKeys.includes("f2")) {
|
|
31
|
+
cellEditingFns.startEditing(row, cell);
|
|
32
|
+
return { handled: true, preventDefault: true, stopPropagation: true };
|
|
33
|
+
}
|
|
34
|
+
if ((event.key === "Backspace" || event.key === "Delete") && enabledKeys.includes("bs")) {
|
|
35
|
+
cellEditingFns.startEditing(row, cell, "");
|
|
36
|
+
return { handled: true, preventDefault: true, stopPropagation: true };
|
|
37
|
+
}
|
|
38
|
+
if (event.key === "Enter" && enabledKeys.includes("enter")) {
|
|
39
|
+
cellEditingFns.startEditing(row, cell);
|
|
40
|
+
return { handled: true, preventDefault: true, stopPropagation: true };
|
|
41
|
+
}
|
|
42
|
+
if (event.key.length === 1 && !event.ctrlKey && !event.metaKey && !event.altKey && event.key !== " ") {
|
|
43
|
+
const isAlpha = /[a-z]/i.test(event.key);
|
|
44
|
+
const isNumeric = /\d/.test(event.key);
|
|
45
|
+
if (isAlpha && enabledKeys.includes("alpha") || isNumeric && enabledKeys.includes("numeric")) {
|
|
46
|
+
cellEditingFns.startEditing(row, cell, event.key);
|
|
47
|
+
return { handled: true, preventDefault: true, stopPropagation: true };
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
return { handled: false };
|
|
51
|
+
}
|
|
52
|
+
};
|
|
53
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { TableData } from '@nuxt/ui';
|
|
2
|
+
import type { NuGridKeyboardHandler } from '../../../types/_internal/index.js';
|
|
3
|
+
/**
|
|
4
|
+
* Creates a keyboard handler for navigation keys
|
|
5
|
+
* Priority 30 - runs after cell type and editing handlers
|
|
6
|
+
*
|
|
7
|
+
* Delegates to the focus system's onCellKeyDown for actual navigation logic
|
|
8
|
+
*/
|
|
9
|
+
export declare function createNavigationHandler<T extends TableData>(): NuGridKeyboardHandler<T>;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { ROUTER_PRIORITIES } from "../../../types/_internal/index.js";
|
|
2
|
+
const NAVIGATION_KEYS = [
|
|
3
|
+
"ArrowUp",
|
|
4
|
+
"ArrowDown",
|
|
5
|
+
"ArrowLeft",
|
|
6
|
+
"ArrowRight",
|
|
7
|
+
"Home",
|
|
8
|
+
"End",
|
|
9
|
+
"PageUp",
|
|
10
|
+
"PageDown",
|
|
11
|
+
"Tab",
|
|
12
|
+
" "
|
|
13
|
+
// Space key for row selection toggle
|
|
14
|
+
];
|
|
15
|
+
export function createNavigationHandler() {
|
|
16
|
+
return {
|
|
17
|
+
id: "keyboard-navigation",
|
|
18
|
+
priority: ROUTER_PRIORITIES.KEYBOARD_NAVIGATION,
|
|
19
|
+
when: (ctx) => {
|
|
20
|
+
return !ctx.isEditing && ctx.focusedCell !== null;
|
|
21
|
+
},
|
|
22
|
+
handle: (ctx) => {
|
|
23
|
+
const { event, focusFns } = ctx;
|
|
24
|
+
if (!NAVIGATION_KEYS.includes(event.key)) {
|
|
25
|
+
return { handled: false };
|
|
26
|
+
}
|
|
27
|
+
focusFns.onCellKeyDown(event);
|
|
28
|
+
return {
|
|
29
|
+
handled: event.defaultPrevented || event.cancelBubble,
|
|
30
|
+
preventDefault: event.defaultPrevented,
|
|
31
|
+
stopPropagation: event.cancelBubble
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
};
|
|
35
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import type { TableData } from '@nuxt/ui';
|
|
2
|
+
import type { Row, Table } from '@tanstack/vue-table';
|
|
3
|
+
import type { ComputedRef, Ref } from 'vue';
|
|
4
|
+
import type { NuGridCellEditing, NuGridFocus, NuGridInteractionRouter } from '../../../types/_internal/index.js';
|
|
5
|
+
export interface KeyboardSetupOptions<T extends TableData> {
|
|
6
|
+
interactionRouter: NuGridInteractionRouter<T>;
|
|
7
|
+
focusFns: NuGridFocus<T>;
|
|
8
|
+
cellEditingFns: NuGridCellEditing<T>;
|
|
9
|
+
tableApi: Table<T>;
|
|
10
|
+
resolvedRows: ComputedRef<Row<T>[]>;
|
|
11
|
+
rootRef: Ref<{
|
|
12
|
+
$el: HTMLElement | undefined;
|
|
13
|
+
} | undefined>;
|
|
14
|
+
focusModeRef: ComputedRef<'none' | 'cell' | 'row'>;
|
|
15
|
+
retainFocusRef: ComputedRef<boolean>;
|
|
16
|
+
editingEnabledRef: ComputedRef<boolean>;
|
|
17
|
+
startKeysRef: ComputedRef<any>;
|
|
18
|
+
cellTypes?: ComputedRef<any[] | undefined>;
|
|
19
|
+
data: Ref<T[]>;
|
|
20
|
+
emitCellValueChanged: (payload: {
|
|
21
|
+
row: any;
|
|
22
|
+
column: any;
|
|
23
|
+
oldValue: any;
|
|
24
|
+
newValue: any;
|
|
25
|
+
}) => void;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Sets up keyboard handling for NuGrid
|
|
29
|
+
* - Configures the interaction router with keyboard context builder
|
|
30
|
+
* - Registers built-in keyboard handlers
|
|
31
|
+
* - Manages lifecycle cleanup
|
|
32
|
+
*/
|
|
33
|
+
export declare function useKeyboardSetup<T extends TableData>(options: KeyboardSetupOptions<T>): void;
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
import { onMounted, onUnmounted, watch } from "vue";
|
|
2
|
+
import {
|
|
3
|
+
createCellTypeDispatchHandler,
|
|
4
|
+
createEditingTriggersHandler,
|
|
5
|
+
createNavigationHandler
|
|
6
|
+
} from "./index.js";
|
|
7
|
+
const INTERACTIVE_SELECTORS = ["input", "textarea", "select", '[contenteditable="true"]', "button"];
|
|
8
|
+
const NAVIGATION_KEYS = /* @__PURE__ */ new Set([
|
|
9
|
+
"ArrowUp",
|
|
10
|
+
"ArrowDown",
|
|
11
|
+
"ArrowLeft",
|
|
12
|
+
"ArrowRight",
|
|
13
|
+
"Home",
|
|
14
|
+
"End",
|
|
15
|
+
"PageUp",
|
|
16
|
+
"PageDown",
|
|
17
|
+
"Tab",
|
|
18
|
+
" "
|
|
19
|
+
// Space key for row selection toggle
|
|
20
|
+
]);
|
|
21
|
+
export function useKeyboardSetup(options) {
|
|
22
|
+
const {
|
|
23
|
+
interactionRouter,
|
|
24
|
+
focusFns,
|
|
25
|
+
cellEditingFns,
|
|
26
|
+
tableApi,
|
|
27
|
+
resolvedRows,
|
|
28
|
+
rootRef,
|
|
29
|
+
focusModeRef,
|
|
30
|
+
retainFocusRef,
|
|
31
|
+
editingEnabledRef,
|
|
32
|
+
startKeysRef,
|
|
33
|
+
cellTypes,
|
|
34
|
+
data,
|
|
35
|
+
emitCellValueChanged
|
|
36
|
+
} = options;
|
|
37
|
+
function isInteractiveElement(target) {
|
|
38
|
+
if (!target || !(target instanceof HTMLElement)) return false;
|
|
39
|
+
return INTERACTIVE_SELECTORS.some((s) => target.matches(s) || target.closest(s));
|
|
40
|
+
}
|
|
41
|
+
function isEventTargetInGrid(target) {
|
|
42
|
+
if (!target || !(target instanceof HTMLElement)) return false;
|
|
43
|
+
const rootEl = rootRef.value?.$el;
|
|
44
|
+
return rootEl?.contains(target) ?? false;
|
|
45
|
+
}
|
|
46
|
+
function buildKeyboardContext(event) {
|
|
47
|
+
if (focusModeRef.value === "none") return null;
|
|
48
|
+
const isEditing = !!cellEditingFns.editingCell.value;
|
|
49
|
+
const focusedCell = focusFns.focusedCell.value;
|
|
50
|
+
if (!isEditing && !focusedCell) return null;
|
|
51
|
+
if (!isEditing) {
|
|
52
|
+
const isInteractive = isInteractiveElement(event.target);
|
|
53
|
+
const isNavigationKey = NAVIGATION_KEYS.has(event.key);
|
|
54
|
+
if (retainFocusRef.value && !isEventTargetInGrid(event.target)) {
|
|
55
|
+
const target = event.target;
|
|
56
|
+
const isTextInput = target && (target.tagName === "INPUT" || target.tagName === "TEXTAREA" || target.isContentEditable);
|
|
57
|
+
if (isTextInput && isNavigationKey) return null;
|
|
58
|
+
if (isInteractive && !isNavigationKey) return null;
|
|
59
|
+
} else if (isInteractive && !isNavigationKey) {
|
|
60
|
+
return null;
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
const rowsList = resolvedRows.value;
|
|
64
|
+
const focusedRow = focusedCell ? rowsList[focusedCell.rowIndex] ?? null : null;
|
|
65
|
+
const cellIndex = focusedCell?.columnIndex ?? 0;
|
|
66
|
+
const cell = focusedRow?.getVisibleCells()[cellIndex] ?? null;
|
|
67
|
+
return {
|
|
68
|
+
event,
|
|
69
|
+
focusedCell,
|
|
70
|
+
focusedRow,
|
|
71
|
+
cell,
|
|
72
|
+
cellIndex,
|
|
73
|
+
isEditing,
|
|
74
|
+
focusMode: focusModeRef.value,
|
|
75
|
+
editingEnabled: editingEnabledRef.value,
|
|
76
|
+
tableApi,
|
|
77
|
+
focusFns,
|
|
78
|
+
cellEditingFns
|
|
79
|
+
};
|
|
80
|
+
}
|
|
81
|
+
interactionRouter.setKeyboardConfig({
|
|
82
|
+
retainFocus: retainFocusRef.value,
|
|
83
|
+
buildContext: buildKeyboardContext
|
|
84
|
+
});
|
|
85
|
+
watch(retainFocusRef, (newRetainFocus) => {
|
|
86
|
+
interactionRouter.setKeyboardConfig({
|
|
87
|
+
retainFocus: newRetainFocus,
|
|
88
|
+
buildContext: buildKeyboardContext
|
|
89
|
+
});
|
|
90
|
+
});
|
|
91
|
+
const keyboardUnregisterFns = [];
|
|
92
|
+
onMounted(() => {
|
|
93
|
+
const cellTypeHandler = createCellTypeDispatchHandler({
|
|
94
|
+
cellTypes,
|
|
95
|
+
data,
|
|
96
|
+
emit: emitCellValueChanged
|
|
97
|
+
});
|
|
98
|
+
keyboardUnregisterFns.push(interactionRouter.registerKeyboardHandler(cellTypeHandler));
|
|
99
|
+
const editingHandler = createEditingTriggersHandler({
|
|
100
|
+
getStartKeys: () => startKeysRef.value
|
|
101
|
+
});
|
|
102
|
+
keyboardUnregisterFns.push(interactionRouter.registerKeyboardHandler(editingHandler));
|
|
103
|
+
const navHandler = createNavigationHandler();
|
|
104
|
+
keyboardUnregisterFns.push(interactionRouter.registerKeyboardHandler(navHandler));
|
|
105
|
+
});
|
|
106
|
+
onUnmounted(() => {
|
|
107
|
+
keyboardUnregisterFns.forEach((unregister) => unregister());
|
|
108
|
+
keyboardUnregisterFns.length = 0;
|
|
109
|
+
interactionRouter.setKeyboardConfig(null);
|
|
110
|
+
});
|
|
111
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { TableData } from '@nuxt/ui';
|
|
2
|
+
import type { NuGridKeyboardHandler, NuGridPagingContext } from '../../../types/_internal/index.js';
|
|
3
|
+
/**
|
|
4
|
+
* Creates a keyboard handler for paging navigation
|
|
5
|
+
* Priority 25 - runs before regular navigation handler
|
|
6
|
+
*
|
|
7
|
+
* When paging is enabled:
|
|
8
|
+
* - PageUp/PageDown: Navigate to previous/next page
|
|
9
|
+
* - Cmd/Ctrl + Up/Down: Navigate to previous/next page
|
|
10
|
+
*/
|
|
11
|
+
export declare function createPagingKeyboardHandler<T extends TableData>(pagingContext: NuGridPagingContext): NuGridKeyboardHandler<T>;
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { nextTick } from "vue";
|
|
2
|
+
import { ROUTER_PRIORITIES } from "../../../types/_internal/index.js";
|
|
3
|
+
export function createPagingKeyboardHandler(pagingContext) {
|
|
4
|
+
return {
|
|
5
|
+
id: "keyboard-paging",
|
|
6
|
+
priority: ROUTER_PRIORITIES.KEYBOARD_PAGING,
|
|
7
|
+
when: (ctx) => {
|
|
8
|
+
if (!pagingContext.enabled.value) return false;
|
|
9
|
+
if (ctx.isEditing) return false;
|
|
10
|
+
const { event } = ctx;
|
|
11
|
+
const key = event.key;
|
|
12
|
+
if (key === "PageUp" || key === "PageDown") {
|
|
13
|
+
return true;
|
|
14
|
+
}
|
|
15
|
+
if ((event.metaKey || event.ctrlKey) && (key === "ArrowUp" || key === "ArrowDown")) {
|
|
16
|
+
return true;
|
|
17
|
+
}
|
|
18
|
+
return false;
|
|
19
|
+
},
|
|
20
|
+
handle: (ctx) => {
|
|
21
|
+
const { event, focusFns, focusedCell } = ctx;
|
|
22
|
+
const key = event.key;
|
|
23
|
+
let direction = null;
|
|
24
|
+
if (key === "PageUp" || (event.metaKey || event.ctrlKey) && key === "ArrowUp") {
|
|
25
|
+
direction = "prev";
|
|
26
|
+
} else if (key === "PageDown" || (event.metaKey || event.ctrlKey) && key === "ArrowDown") {
|
|
27
|
+
direction = "next";
|
|
28
|
+
}
|
|
29
|
+
if (!direction) {
|
|
30
|
+
return { handled: false };
|
|
31
|
+
}
|
|
32
|
+
const currentPage = pagingContext.pageIndex.value;
|
|
33
|
+
const totalPages = pagingContext.totalPages.value;
|
|
34
|
+
const currentRowIndex = focusedCell?.rowIndex ?? 0;
|
|
35
|
+
const currentColumnIndex = focusedCell?.columnIndex ?? 0;
|
|
36
|
+
const restoreFocus = () => {
|
|
37
|
+
nextTick(() => {
|
|
38
|
+
focusFns.focusedCell.value = {
|
|
39
|
+
rowIndex: currentRowIndex,
|
|
40
|
+
columnIndex: currentColumnIndex
|
|
41
|
+
};
|
|
42
|
+
nextTick(() => {
|
|
43
|
+
const rows = ctx.tableApi.getRowModel().rows;
|
|
44
|
+
const targetRow = rows[currentRowIndex];
|
|
45
|
+
if (targetRow) {
|
|
46
|
+
const cellElement = focusFns.getCellElement(targetRow.id, currentColumnIndex);
|
|
47
|
+
if (cellElement) {
|
|
48
|
+
cellElement.focus();
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
});
|
|
52
|
+
});
|
|
53
|
+
};
|
|
54
|
+
if (direction === "prev" && currentPage > 0) {
|
|
55
|
+
pagingContext.setPageIndex(currentPage - 1);
|
|
56
|
+
restoreFocus();
|
|
57
|
+
return { handled: true, preventDefault: true, stopPropagation: true };
|
|
58
|
+
}
|
|
59
|
+
if (direction === "next" && currentPage < totalPages - 1) {
|
|
60
|
+
pagingContext.setPageIndex(currentPage + 1);
|
|
61
|
+
restoreFocus();
|
|
62
|
+
return { handled: true, preventDefault: true, stopPropagation: true };
|
|
63
|
+
}
|
|
64
|
+
return { handled: true, preventDefault: true };
|
|
65
|
+
}
|
|
66
|
+
};
|
|
67
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { TableData } from '@nuxt/ui';
|
|
2
|
+
import type { VisibilityState } from '@tanstack/vue-table';
|
|
3
|
+
import type { Ref } from 'vue';
|
|
4
|
+
import type { NuGridActionMenuOptions } from '../../types/index.js';
|
|
5
|
+
import type { UseNuGridActionMenuReturn } from '../../types/_internal/index.js';
|
|
6
|
+
/**
|
|
7
|
+
* Composable for managing action menu column in NuGrid.
|
|
8
|
+
* Handles creating the action menu column for row actions.
|
|
9
|
+
*
|
|
10
|
+
* IMPORTANT: The action menu column is created at instantiation and cannot be added later.
|
|
11
|
+
* If actionMenu is initially false/undefined and later changed to enabled,
|
|
12
|
+
* an error will be thrown. To start with a hidden action menu column, use:
|
|
13
|
+
* { getActions: fn, hidden: true }
|
|
14
|
+
*/
|
|
15
|
+
export declare function useNuGridActionMenu<T extends TableData>(actionMenuOptions: Ref<NuGridActionMenuOptions<T> | undefined | false>, columnVisibilityState?: Ref<VisibilityState>): UseNuGridActionMenuReturn<T>;
|