@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
package/LICENSE.md
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
# MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2024 NuGrid Contributors
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,261 @@
|
|
|
1
|
+
<p align="center">
|
|
2
|
+
<img src="nu-grid-logo.svg" alt="NuGrid Logo" width="400" />
|
|
3
|
+
</p>
|
|
4
|
+
|
|
5
|
+
<h1 align="center">NuGrid</h1>
|
|
6
|
+
|
|
7
|
+
<p align="center">
|
|
8
|
+
<a href="https://npmjs.com/package/@nu-grid/nuxt"><img src="https://img.shields.io/npm/v/@nu-grid/nuxt/latest.svg?style=flat&colorA=020420&colorB=00DC82" alt="npm version"></a>
|
|
9
|
+
<a href="https://npm.chart.dev/@nu-grid/nuxt"><img src="https://img.shields.io/npm/dm/@nu-grid/nuxt.svg?style=flat&colorA=020420&colorB=00DC82" alt="npm downloads"></a>
|
|
10
|
+
<a href="https://npmjs.com/package/@nu-grid/nuxt"><img src="https://img.shields.io/npm/l/@nu-grid/nuxt.svg?style=flat&colorA=020420&colorB=00DC82" alt="License"></a>
|
|
11
|
+
<a href="https://nuxt.com"><img src="https://img.shields.io/badge/Nuxt-020420?logo=nuxt.js" alt="Nuxt"></a>
|
|
12
|
+
</p>
|
|
13
|
+
|
|
14
|
+
A powerful, feature-rich data grid component for Nuxt applications with virtualization, inline editing, and TanStack Table integration.
|
|
15
|
+
|
|
16
|
+
- [Release Notes](/CHANGELOG.md)
|
|
17
|
+
- [Demos](https://www.nug-rid.dev/demos)
|
|
18
|
+
- [Documentation](https://www.nu-grid.dev)
|
|
19
|
+
|
|
20
|
+
## Features
|
|
21
|
+
|
|
22
|
+
- **High Performance** - Virtualized rendering handles thousands of rows smoothly
|
|
23
|
+
- **Inline Editing** - Edit cells directly with built-in validation support
|
|
24
|
+
- **Row Grouping** - Group data by columns with expandable/collapsible groups
|
|
25
|
+
- **Keyboard Navigation** - Excel-like navigation and editing experience
|
|
26
|
+
- **Theming** - Full customization with Nuxt UI design system integration
|
|
27
|
+
- **TanStack Table** - Built on TanStack Table for sorting, filtering, and pagination
|
|
28
|
+
|
|
29
|
+
### Built-in Cell Types
|
|
30
|
+
|
|
31
|
+
- Text & Textarea
|
|
32
|
+
- Number & Currency
|
|
33
|
+
- Date (with date picker)
|
|
34
|
+
- Boolean (checkbox)
|
|
35
|
+
- Selection (dropdown)
|
|
36
|
+
- Rating (star rating)
|
|
37
|
+
- Lookup (autocomplete/search)
|
|
38
|
+
- Action Menu
|
|
39
|
+
|
|
40
|
+
### Additional Capabilities
|
|
41
|
+
|
|
42
|
+
- Column resizing, pinning, and reordering
|
|
43
|
+
- Row selection (single and multi-select)
|
|
44
|
+
- Excel export
|
|
45
|
+
- State persistence (save/restore column widths, sorting, filters)
|
|
46
|
+
- Custom cell type support
|
|
47
|
+
- Comprehensive event system
|
|
48
|
+
|
|
49
|
+
## Installation
|
|
50
|
+
|
|
51
|
+
```bash
|
|
52
|
+
# Using pnpm
|
|
53
|
+
pnpm add @nu-grid/nuxt @nuxt/ui @vueuse/nuxt
|
|
54
|
+
|
|
55
|
+
# Using npm
|
|
56
|
+
npm install @nu-grid/nuxt @nuxt/ui @vueuse/nuxt
|
|
57
|
+
|
|
58
|
+
# Using yarn
|
|
59
|
+
yarn add @nu-grid/nuxt @nuxt/ui @vueuse/nuxt
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
Add `@nu-grid/nuxt` to your `nuxt.config.ts`:
|
|
63
|
+
|
|
64
|
+
```ts
|
|
65
|
+
export default defineNuxtConfig({
|
|
66
|
+
modules: ['@nuxt/ui', '@nu-grid/nuxt'],
|
|
67
|
+
})
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
### CSS Setup
|
|
71
|
+
|
|
72
|
+
NuGrid requires its CSS to be imported in your application's main stylesheet. This ensures Tailwind scans the component classes for proper theming and focus styling.
|
|
73
|
+
|
|
74
|
+
Add the following to your `main.css` (or equivalent):
|
|
75
|
+
|
|
76
|
+
```css
|
|
77
|
+
@import "tailwindcss";
|
|
78
|
+
@import "@nuxt/ui";
|
|
79
|
+
@import "@nu-grid/nuxt/css";
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
## Quick Start
|
|
83
|
+
|
|
84
|
+
```vue
|
|
85
|
+
<script setup lang="ts">
|
|
86
|
+
import type { NuGridColumn } from '@nu-grid/nuxt/types'
|
|
87
|
+
|
|
88
|
+
interface Person {
|
|
89
|
+
id: number
|
|
90
|
+
name: string
|
|
91
|
+
email: string
|
|
92
|
+
age: number
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
const columns: NuGridColumn<Person>[] = [
|
|
96
|
+
{ accessorKey: 'name', header: 'Name' },
|
|
97
|
+
{ accessorKey: 'email', header: 'Email' },
|
|
98
|
+
{ accessorKey: 'age', header: 'Age', cellType: 'number' }
|
|
99
|
+
]
|
|
100
|
+
|
|
101
|
+
const data = ref<Person[]>([
|
|
102
|
+
{ id: 1, name: 'John Doe', email: 'john@example.com', age: 32 },
|
|
103
|
+
{ id: 2, name: 'Jane Smith', email: 'jane@example.com', age: 28 },
|
|
104
|
+
{ id: 3, name: 'Bob Wilson', email: 'bob@example.com', age: 45 }
|
|
105
|
+
])
|
|
106
|
+
</script>
|
|
107
|
+
|
|
108
|
+
<template>
|
|
109
|
+
<NuGrid :columns="columns" :data="data" />
|
|
110
|
+
</template>
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
### Enabling Editing
|
|
114
|
+
|
|
115
|
+
```vue
|
|
116
|
+
<script setup lang="ts">
|
|
117
|
+
const columns: NuGridColumn<Person>[] = [
|
|
118
|
+
{ accessorKey: 'name', header: 'Name', editable: true },
|
|
119
|
+
{ accessorKey: 'email', header: 'Email', editable: true },
|
|
120
|
+
{
|
|
121
|
+
accessorKey: 'age',
|
|
122
|
+
header: 'Age',
|
|
123
|
+
cellType: 'number',
|
|
124
|
+
editable: true
|
|
125
|
+
}
|
|
126
|
+
]
|
|
127
|
+
</script>
|
|
128
|
+
|
|
129
|
+
<template>
|
|
130
|
+
<NuGrid
|
|
131
|
+
:columns="columns"
|
|
132
|
+
:data="data"
|
|
133
|
+
editable
|
|
134
|
+
@cell-value-changed="handleChange"
|
|
135
|
+
/>
|
|
136
|
+
</template>
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
### With Virtualization
|
|
140
|
+
|
|
141
|
+
For large datasets, enable virtualization for optimal performance:
|
|
142
|
+
|
|
143
|
+
```vue
|
|
144
|
+
<template>
|
|
145
|
+
<NuGrid
|
|
146
|
+
:columns="columns"
|
|
147
|
+
:data="largeDataset"
|
|
148
|
+
virtualized
|
|
149
|
+
:row-height="40"
|
|
150
|
+
style="height: 600px"
|
|
151
|
+
/>
|
|
152
|
+
</template>
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+
### Row Grouping
|
|
156
|
+
|
|
157
|
+
```vue
|
|
158
|
+
<template>
|
|
159
|
+
<NuGridGroup
|
|
160
|
+
:columns="columns"
|
|
161
|
+
:data="data"
|
|
162
|
+
:group-by="['department', 'status']"
|
|
163
|
+
/>
|
|
164
|
+
</template>
|
|
165
|
+
```
|
|
166
|
+
|
|
167
|
+
## Props
|
|
168
|
+
|
|
169
|
+
| Prop | Type | Default | Description |
|
|
170
|
+
| -------------- | ----------------------------------- | ------------- | -------------------------- |
|
|
171
|
+
| `columns` | `NuGridColumn<T>[]` | required | Column definitions |
|
|
172
|
+
| `data` | `T[]` | required | Row data array |
|
|
173
|
+
| `editable` | `boolean` | `false` | Enable inline editing |
|
|
174
|
+
| `virtualized` | `boolean` | `false` | Enable virtualization |
|
|
175
|
+
| `rowHeight` | `number` | `40` | Row height in pixels |
|
|
176
|
+
| `rowSelection` | `boolean \| 'single' \| 'multiple'` | `false` | Enable row selection |
|
|
177
|
+
| `theme` | `NuGridTheme` | default theme | Custom theme configuration |
|
|
178
|
+
|
|
179
|
+
## Events
|
|
180
|
+
|
|
181
|
+
| Event | Payload | Description |
|
|
182
|
+
| ----------------------- | ------------------------------------- | ----------------------- |
|
|
183
|
+
| `cell-click` | `{ row, column, value }` | Cell was clicked |
|
|
184
|
+
| `cell-double-click` | `{ row, column, value }` | Cell was double-clicked |
|
|
185
|
+
| `cell-value-changed` | `{ row, column, oldValue, newValue }` | Cell value was edited |
|
|
186
|
+
| `row-selection-changed` | `{ selectedRows }` | Row selection changed |
|
|
187
|
+
| `validation-error` | `{ row, column, error }` | Validation failed |
|
|
188
|
+
|
|
189
|
+
See [EVENTS.md](/EVENTS.md) for a complete event reference.
|
|
190
|
+
|
|
191
|
+
## Development
|
|
192
|
+
|
|
193
|
+
```bash
|
|
194
|
+
# Install dependencies
|
|
195
|
+
pnpm install
|
|
196
|
+
|
|
197
|
+
# Generate type stubs and prepare
|
|
198
|
+
pnpm run dev:prepare
|
|
199
|
+
|
|
200
|
+
# Start development server with playground
|
|
201
|
+
pnpm run dev
|
|
202
|
+
|
|
203
|
+
# Start documentation site
|
|
204
|
+
pnpm run docs
|
|
205
|
+
|
|
206
|
+
# Run tests
|
|
207
|
+
pnpm run test
|
|
208
|
+
|
|
209
|
+
# Run tests in watch mode
|
|
210
|
+
pnpm run test:watch
|
|
211
|
+
|
|
212
|
+
# Run E2E tests
|
|
213
|
+
pnpm run test:e2e
|
|
214
|
+
|
|
215
|
+
# Type check
|
|
216
|
+
pnpm run test:types
|
|
217
|
+
|
|
218
|
+
# Lint
|
|
219
|
+
pnpm run lint
|
|
220
|
+
|
|
221
|
+
# Format
|
|
222
|
+
pnpm run format
|
|
223
|
+
|
|
224
|
+
# Build for production
|
|
225
|
+
pnpm run prepack
|
|
226
|
+
|
|
227
|
+
# Release
|
|
228
|
+
pnpm run release
|
|
229
|
+
```
|
|
230
|
+
|
|
231
|
+
## Project Structure
|
|
232
|
+
|
|
233
|
+
```
|
|
234
|
+
src/
|
|
235
|
+
├── module.ts # Nuxt module entry
|
|
236
|
+
└── runtime/
|
|
237
|
+
├── components/ # Vue components
|
|
238
|
+
├── composables/ # Vue composables
|
|
239
|
+
├── cell-types/ # Built-in cell types
|
|
240
|
+
├── types/ # TypeScript definitions
|
|
241
|
+
└── themes/ # Theme configurations
|
|
242
|
+
|
|
243
|
+
docs/ # Documentation site
|
|
244
|
+
playgrounds/nuxt/ # Development playground
|
|
245
|
+
test/ # Unit tests
|
|
246
|
+
e2e/ # End-to-end tests
|
|
247
|
+
```
|
|
248
|
+
|
|
249
|
+
## Contributing
|
|
250
|
+
|
|
251
|
+
Contributions are welcome! Please read our contributing guidelines before submitting a pull request.
|
|
252
|
+
|
|
253
|
+
1. Fork the repository
|
|
254
|
+
2. Create your feature branch (`git checkout -b feature/amazing-feature`)
|
|
255
|
+
3. Commit your changes (`git commit -m 'Add amazing feature'`)
|
|
256
|
+
4. Push to the branch (`git push origin feature/amazing-feature`)
|
|
257
|
+
5. Open a Pull Request
|
|
258
|
+
|
|
259
|
+
## License
|
|
260
|
+
|
|
261
|
+
[MIT](./LICENSE.md)
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import * as _nuxt_schema from '@nuxt/schema';
|
|
2
|
+
|
|
3
|
+
interface ModuleOptions {
|
|
4
|
+
/**
|
|
5
|
+
* Prefix for NuGrid components
|
|
6
|
+
* @default 'NuGrid'
|
|
7
|
+
*/
|
|
8
|
+
prefix?: string;
|
|
9
|
+
}
|
|
10
|
+
declare const _default: _nuxt_schema.NuxtModule<ModuleOptions, ModuleOptions, false>;
|
|
11
|
+
|
|
12
|
+
export { _default as default };
|
|
13
|
+
export type { ModuleOptions };
|
package/dist/module.json
ADDED
package/dist/module.mjs
ADDED
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { defineNuxtModule, createResolver, addPlugin, addImports, addComponentsDir } from '@nuxt/kit';
|
|
2
|
+
|
|
3
|
+
const module$1 = defineNuxtModule({
|
|
4
|
+
meta: {
|
|
5
|
+
name: "@nu-grid/nuxt",
|
|
6
|
+
configKey: "nuGrid"
|
|
7
|
+
},
|
|
8
|
+
// Default configuration options of the Nuxt module
|
|
9
|
+
defaults: {
|
|
10
|
+
prefix: "NuGrid"
|
|
11
|
+
},
|
|
12
|
+
setup(options, nuxt) {
|
|
13
|
+
const resolver = createResolver(import.meta.url);
|
|
14
|
+
const runtimeDir = resolver.resolve("./runtime");
|
|
15
|
+
nuxt.options.alias["#nu-grid"] = runtimeDir;
|
|
16
|
+
nuxt.options.alias["#nu-grid/types"] = resolver.resolve("./runtime/types");
|
|
17
|
+
nuxt.options.alias["#nu-grid/types/*"] = resolver.resolve("./runtime/types/*");
|
|
18
|
+
nuxt.options.alias["#nu-grid/composables"] = resolver.resolve("./runtime/composables");
|
|
19
|
+
nuxt.options.alias["#nu-grid/composables/*"] = resolver.resolve("./runtime/composables/*");
|
|
20
|
+
nuxt.options.alias["#nu-grid/cell-types"] = resolver.resolve("./runtime/cell-types");
|
|
21
|
+
nuxt.options.alias["#nu-grid/cell-types/*"] = resolver.resolve("./runtime/cell-types/*");
|
|
22
|
+
nuxt.options.alias["#nu-grid/config"] = resolver.resolve("./runtime/config");
|
|
23
|
+
nuxt.options.alias["#nu-grid/config/*"] = resolver.resolve("./runtime/config/*");
|
|
24
|
+
nuxt.options.alias["#nu-grid/cells"] = resolver.resolve("./runtime/types/cells");
|
|
25
|
+
addPlugin(resolver.resolve("./runtime/plugin"));
|
|
26
|
+
addImports([
|
|
27
|
+
{
|
|
28
|
+
name: "useNuGridCellEditor",
|
|
29
|
+
from: resolver.resolve("runtime/composables/useNuGridCellEditor")
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
name: "useNuGridCellTypeRegistry",
|
|
33
|
+
from: resolver.resolve("runtime/composables/useNuGridCellTypeRegistry")
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
name: "nuGridCellTypeRegistry",
|
|
37
|
+
from: resolver.resolve("runtime/composables/useNuGridCellTypeRegistry")
|
|
38
|
+
}
|
|
39
|
+
]);
|
|
40
|
+
addComponentsDir({
|
|
41
|
+
path: resolver.resolve("runtime/components"),
|
|
42
|
+
prefix: options.prefix
|
|
43
|
+
});
|
|
44
|
+
addComponentsDir({
|
|
45
|
+
path: resolver.resolve("runtime/cell-types"),
|
|
46
|
+
prefix: options.prefix,
|
|
47
|
+
pathPrefix: false
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
});
|
|
51
|
+
|
|
52
|
+
export { module$1 as default };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { Cell, Row } from '@tanstack/vue-table';
|
|
2
|
+
interface Props {
|
|
3
|
+
row: Row<any>;
|
|
4
|
+
cell?: Cell<any, unknown>;
|
|
5
|
+
}
|
|
6
|
+
declare const __VLS_export: import("vue").DefineComponent<Props, {
|
|
7
|
+
openMenu: () => void;
|
|
8
|
+
closeMenu: () => void;
|
|
9
|
+
isOpen: any;
|
|
10
|
+
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
11
|
+
declare const _default: typeof __VLS_export;
|
|
12
|
+
export default _default;
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
defineOptions({ inheritAttrs: false });
|
|
3
|
+
const props = defineProps({
|
|
4
|
+
row: { type: Object, required: true },
|
|
5
|
+
cell: { type: Object, required: false }
|
|
6
|
+
});
|
|
7
|
+
const meta = computed(
|
|
8
|
+
() => props.cell?.column.columnDef.meta
|
|
9
|
+
);
|
|
10
|
+
const isActionsEnabled = computed(() => {
|
|
11
|
+
if (!meta.value) return false;
|
|
12
|
+
if (meta.value.enabledRef?.value === false) return false;
|
|
13
|
+
if (meta.value.isRowEnabledFn) {
|
|
14
|
+
return meta.value.isRowEnabledFn(props.row);
|
|
15
|
+
}
|
|
16
|
+
return meta.value.actionMenuEnabled ?? true;
|
|
17
|
+
});
|
|
18
|
+
const menuItems = computed(() => {
|
|
19
|
+
if (!meta.value?.getActions || !isActionsEnabled.value) return [];
|
|
20
|
+
return meta.value.getActions(props.row);
|
|
21
|
+
});
|
|
22
|
+
const buttonConfig = computed(() => ({
|
|
23
|
+
icon: meta.value?.button?.icon ?? "i-lucide-ellipsis-vertical",
|
|
24
|
+
color: meta.value?.button?.color ?? "neutral",
|
|
25
|
+
variant: meta.value?.button?.variant ?? "ghost",
|
|
26
|
+
class: meta.value?.button?.class ?? "ml-auto"
|
|
27
|
+
}));
|
|
28
|
+
const buttonProps = computed(() => ({
|
|
29
|
+
"icon": buttonConfig.value.icon,
|
|
30
|
+
"color": buttonConfig.value.color,
|
|
31
|
+
"variant": buttonConfig.value.variant,
|
|
32
|
+
"class": buttonConfig.value.class,
|
|
33
|
+
"disabled": !isActionsEnabled.value,
|
|
34
|
+
"tabindex": -1,
|
|
35
|
+
"aria-label": "Actions"
|
|
36
|
+
}));
|
|
37
|
+
const containerRef = ref(null);
|
|
38
|
+
function getOrCreateMenuOpenRef(rowId) {
|
|
39
|
+
const states = meta.value?.menuOpenStates;
|
|
40
|
+
if (!states) return null;
|
|
41
|
+
if (!states.has(rowId)) {
|
|
42
|
+
states.set(rowId, ref(false));
|
|
43
|
+
}
|
|
44
|
+
return states.get(rowId);
|
|
45
|
+
}
|
|
46
|
+
const menuOpen = computed({
|
|
47
|
+
get: () => {
|
|
48
|
+
const rowId = String(props.row.id);
|
|
49
|
+
const menuRef = getOrCreateMenuOpenRef(rowId);
|
|
50
|
+
return menuRef?.value ?? false;
|
|
51
|
+
},
|
|
52
|
+
set: (value) => {
|
|
53
|
+
const rowId = String(props.row.id);
|
|
54
|
+
const menuRef = getOrCreateMenuOpenRef(rowId);
|
|
55
|
+
if (menuRef) {
|
|
56
|
+
menuRef.value = value;
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
});
|
|
60
|
+
watch(
|
|
61
|
+
() => menuOpen.value,
|
|
62
|
+
(isOpen, wasOpen) => {
|
|
63
|
+
if (wasOpen && !isOpen) {
|
|
64
|
+
nextTick(() => {
|
|
65
|
+
const cell = containerRef.value?.closest("[data-cell-index]");
|
|
66
|
+
if (cell) {
|
|
67
|
+
cell.focus({ preventScroll: true });
|
|
68
|
+
}
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
);
|
|
73
|
+
function handleKeyDown(event) {
|
|
74
|
+
if (!menuOpen.value && (event.key === "ArrowDown" || event.key === "ArrowUp")) {
|
|
75
|
+
event.stopPropagation();
|
|
76
|
+
event.preventDefault();
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
function openMenuOnClick() {
|
|
80
|
+
if (isActionsEnabled.value) {
|
|
81
|
+
menuOpen.value = true;
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
function openMenuOnKeydown(event) {
|
|
85
|
+
if (event.key === "Enter" || event.key === " ") {
|
|
86
|
+
event.preventDefault();
|
|
87
|
+
if (isActionsEnabled.value) {
|
|
88
|
+
menuOpen.value = true;
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
defineExpose({
|
|
93
|
+
openMenu: () => {
|
|
94
|
+
if (isActionsEnabled.value) menuOpen.value = true;
|
|
95
|
+
},
|
|
96
|
+
closeMenu: () => {
|
|
97
|
+
menuOpen.value = false;
|
|
98
|
+
},
|
|
99
|
+
isOpen: menuOpen
|
|
100
|
+
});
|
|
101
|
+
</script>
|
|
102
|
+
|
|
103
|
+
<template>
|
|
104
|
+
<div
|
|
105
|
+
ref="containerRef"
|
|
106
|
+
class="flex items-center justify-end"
|
|
107
|
+
data-action-menu-cell
|
|
108
|
+
@keydown.capture="handleKeyDown"
|
|
109
|
+
>
|
|
110
|
+
<!-- Performance optimization: Only render UDropdownMenu when menu is open -->
|
|
111
|
+
<!-- When closed, render a simple button that's much lighter weight -->
|
|
112
|
+
<UDropdownMenu
|
|
113
|
+
v-if="menuOpen"
|
|
114
|
+
v-model:open="menuOpen"
|
|
115
|
+
:content="{ align: 'end' }"
|
|
116
|
+
:items="menuItems"
|
|
117
|
+
>
|
|
118
|
+
<UButton v-bind="buttonProps" />
|
|
119
|
+
</UDropdownMenu>
|
|
120
|
+
<!-- Lightweight button when menu is closed - no UDropdownMenu overhead -->
|
|
121
|
+
<UButton v-else v-bind="buttonProps" @click="openMenuOnClick" @keydown="openMenuOnKeydown" />
|
|
122
|
+
</div>
|
|
123
|
+
</template>
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { Cell, Row } from '@tanstack/vue-table';
|
|
2
|
+
interface Props {
|
|
3
|
+
row: Row<any>;
|
|
4
|
+
cell?: Cell<any, unknown>;
|
|
5
|
+
}
|
|
6
|
+
declare const __VLS_export: import("vue").DefineComponent<Props, {
|
|
7
|
+
openMenu: () => void;
|
|
8
|
+
closeMenu: () => void;
|
|
9
|
+
isOpen: any;
|
|
10
|
+
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
11
|
+
declare const _default: typeof __VLS_export;
|
|
12
|
+
export default _default;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { NuGridCellType } from '../../types/cells.js';
|
|
2
|
+
/**
|
|
3
|
+
* Action menu cell type
|
|
4
|
+
* Action menu with special keyboard handling:
|
|
5
|
+
* - Space or Enter: Open the action menu (only opens, doesn't toggle - closing is done via Escape or clicking outside)
|
|
6
|
+
* - Escape: Close the action menu (handled by UDropdownMenu component)
|
|
7
|
+
*/
|
|
8
|
+
export declare const actionMenuCellType: NuGridCellType;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { ref } from "vue";
|
|
2
|
+
import ActionMenuRenderer from "./ActionMenuRenderer.vue";
|
|
3
|
+
export const actionMenuCellType = {
|
|
4
|
+
name: "action-menu",
|
|
5
|
+
displayName: "Action Menu",
|
|
6
|
+
description: "Action menu column with row-specific actions",
|
|
7
|
+
// No editor for action menu - it's not tied to data
|
|
8
|
+
renderer: ActionMenuRenderer,
|
|
9
|
+
keyboardHandler: (event, context) => {
|
|
10
|
+
const { isFocused, row, cell } = context;
|
|
11
|
+
if (isFocused && (event.key === " " || event.key === "Enter")) {
|
|
12
|
+
const meta = cell.column.columnDef.meta;
|
|
13
|
+
const menuOpenStates = meta?.menuOpenStates;
|
|
14
|
+
if (menuOpenStates) {
|
|
15
|
+
const rowId = String(row.id);
|
|
16
|
+
if (!menuOpenStates.has(rowId)) {
|
|
17
|
+
menuOpenStates.set(rowId, ref(false));
|
|
18
|
+
}
|
|
19
|
+
const menuOpenRef = menuOpenStates.get(rowId);
|
|
20
|
+
if (!menuOpenRef.value) {
|
|
21
|
+
menuOpenRef.value = true;
|
|
22
|
+
}
|
|
23
|
+
return { handled: true, preventDefault: true, stopPropagation: true };
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
return { handled: false };
|
|
27
|
+
}
|
|
28
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { NuGridCellEditorProps } from '../../types/index.js';
|
|
2
|
+
type __VLS_Props = NuGridCellEditorProps;
|
|
3
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
|
|
4
|
+
"update:modelValue": (value: any) => any;
|
|
5
|
+
"update:isNavigating": (value: boolean) => any;
|
|
6
|
+
"stop-editing": (moveDirection?: "up" | "down" | "next" | "previous" | undefined) => any;
|
|
7
|
+
"cancel-editing": () => any;
|
|
8
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
9
|
+
"onUpdate:modelValue"?: ((value: any) => any) | undefined;
|
|
10
|
+
"onUpdate:isNavigating"?: ((value: boolean) => any) | undefined;
|
|
11
|
+
"onStop-editing"?: ((moveDirection?: "up" | "down" | "next" | "previous" | undefined) => any) | undefined;
|
|
12
|
+
"onCancel-editing"?: (() => any) | undefined;
|
|
13
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
14
|
+
declare const _default: typeof __VLS_export;
|
|
15
|
+
export default _default;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import { ref } from "vue";
|
|
3
|
+
import NuGridCellCheckbox from "../../components/NuGridCellCheckbox.vue";
|
|
4
|
+
import { useNuGridCellEditor } from "../../composables/useNuGridCellEditor";
|
|
5
|
+
defineOptions({ inheritAttrs: false });
|
|
6
|
+
const props = defineProps({
|
|
7
|
+
modelValue: { type: null, required: true },
|
|
8
|
+
cell: { type: null, required: true },
|
|
9
|
+
row: { type: Object, required: true },
|
|
10
|
+
isNavigating: { type: Boolean, required: true },
|
|
11
|
+
shouldFocus: { type: Boolean, required: true },
|
|
12
|
+
validationError: { type: [String, null], required: false },
|
|
13
|
+
showValidationErrors: { type: String, required: false },
|
|
14
|
+
interactionRouter: { type: Object, required: false }
|
|
15
|
+
});
|
|
16
|
+
const emit = defineEmits(["update:modelValue", "stop-editing", "cancel-editing", "update:isNavigating"]);
|
|
17
|
+
const checkboxRef = ref(null);
|
|
18
|
+
const { handleKeydown, handleBlur } = useNuGridCellEditor(props, emit, checkboxRef, () => {
|
|
19
|
+
checkboxRef.value?.focus({ preventScroll: true });
|
|
20
|
+
});
|
|
21
|
+
</script>
|
|
22
|
+
|
|
23
|
+
<template>
|
|
24
|
+
<NuGridCellCheckbox
|
|
25
|
+
ref="checkboxRef"
|
|
26
|
+
:model-value="modelValue"
|
|
27
|
+
:interactive="true"
|
|
28
|
+
@update:model-value="emit('update:modelValue', $event)"
|
|
29
|
+
@keydown="handleKeydown"
|
|
30
|
+
@blur="handleBlur"
|
|
31
|
+
/>
|
|
32
|
+
</template>
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { NuGridCellEditorProps } from '../../types/index.js';
|
|
2
|
+
type __VLS_Props = NuGridCellEditorProps;
|
|
3
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
|
|
4
|
+
"update:modelValue": (value: any) => any;
|
|
5
|
+
"update:isNavigating": (value: boolean) => any;
|
|
6
|
+
"stop-editing": (moveDirection?: "up" | "down" | "next" | "previous" | undefined) => any;
|
|
7
|
+
"cancel-editing": () => any;
|
|
8
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
9
|
+
"onUpdate:modelValue"?: ((value: any) => any) | undefined;
|
|
10
|
+
"onUpdate:isNavigating"?: ((value: boolean) => any) | undefined;
|
|
11
|
+
"onStop-editing"?: ((moveDirection?: "up" | "down" | "next" | "previous" | undefined) => any) | undefined;
|
|
12
|
+
"onCancel-editing"?: (() => any) | undefined;
|
|
13
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
14
|
+
declare const _default: typeof __VLS_export;
|
|
15
|
+
export default _default;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { NuGridFilterContext } from '../../types/cells.js';
|
|
2
|
+
interface Props {
|
|
3
|
+
context: NuGridFilterContext;
|
|
4
|
+
}
|
|
5
|
+
declare const __VLS_export: import("vue").DefineComponent<Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
6
|
+
declare const _default: typeof __VLS_export;
|
|
7
|
+
export default _default;
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import { computed } from "vue";
|
|
3
|
+
const props = defineProps({
|
|
4
|
+
context: { type: Object, required: true }
|
|
5
|
+
});
|
|
6
|
+
const filterValue = computed({
|
|
7
|
+
get: () => props.context.filterValue.value,
|
|
8
|
+
set: (value) => props.context.setFilterValue(value)
|
|
9
|
+
});
|
|
10
|
+
const options = [
|
|
11
|
+
{ value: true, label: "True" },
|
|
12
|
+
{ value: false, label: "False" },
|
|
13
|
+
{ value: null, label: "All" }
|
|
14
|
+
];
|
|
15
|
+
function clearFilter() {
|
|
16
|
+
filterValue.value = null;
|
|
17
|
+
props.context.clearFilter();
|
|
18
|
+
}
|
|
19
|
+
</script>
|
|
20
|
+
|
|
21
|
+
<template>
|
|
22
|
+
<div class="min-w-[200px] space-y-2 p-2">
|
|
23
|
+
<div class="flex items-center gap-2">
|
|
24
|
+
<USelect
|
|
25
|
+
v-model="filterValue"
|
|
26
|
+
:options="options"
|
|
27
|
+
option-attribute="label"
|
|
28
|
+
value-attribute="value"
|
|
29
|
+
class="flex-1"
|
|
30
|
+
autofocus
|
|
31
|
+
/>
|
|
32
|
+
<UButton
|
|
33
|
+
v-if="context.isFiltered"
|
|
34
|
+
icon="i-heroicons-x-mark"
|
|
35
|
+
size="xs"
|
|
36
|
+
color="neutral"
|
|
37
|
+
variant="ghost"
|
|
38
|
+
@click="clearFilter"
|
|
39
|
+
/>
|
|
40
|
+
</div>
|
|
41
|
+
</div>
|
|
42
|
+
</template>
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { NuGridFilterContext } from '../../types/cells.js';
|
|
2
|
+
interface Props {
|
|
3
|
+
context: NuGridFilterContext;
|
|
4
|
+
}
|
|
5
|
+
declare const __VLS_export: import("vue").DefineComponent<Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
6
|
+
declare const _default: typeof __VLS_export;
|
|
7
|
+
export default _default;
|