@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,292 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Cell Types System - Public API for custom cell types and editors
|
|
3
|
+
*
|
|
4
|
+
* This module exports types for creating custom cell types, editors,
|
|
5
|
+
* renderers, and filters for NuGrid columns.
|
|
6
|
+
*
|
|
7
|
+
* Import from '#nu-grid/cells' in your Nuxt application.
|
|
8
|
+
*/
|
|
9
|
+
import type { TableData } from '@nuxt/ui';
|
|
10
|
+
import type { Column, Row, Table } from '@tanstack/vue-table';
|
|
11
|
+
import type { Component, Ref } from 'vue';
|
|
12
|
+
import type { NuGridEditorConfig, NuGridInteractionRouter } from './_internal/index.js';
|
|
13
|
+
import type { NuGridColumn, NuGridColumnMenuItem } from './column.js';
|
|
14
|
+
import type { NuGridShowErrors } from './validation.js';
|
|
15
|
+
/**
|
|
16
|
+
* Props for custom cell editor components
|
|
17
|
+
*/
|
|
18
|
+
export interface NuGridCellEditorProps<T extends TableData = TableData> {
|
|
19
|
+
modelValue: any;
|
|
20
|
+
cell: any;
|
|
21
|
+
row: Row<any>;
|
|
22
|
+
isNavigating: boolean;
|
|
23
|
+
shouldFocus: boolean;
|
|
24
|
+
/**
|
|
25
|
+
* Validation error message from schema validation
|
|
26
|
+
* When set, the editor should display error styling and optionally show the message
|
|
27
|
+
*/
|
|
28
|
+
validationError?: string | null;
|
|
29
|
+
/**
|
|
30
|
+
* When to show error messages
|
|
31
|
+
* - 'always': show whenever invalid (default)
|
|
32
|
+
* - 'hover': show only while hovering
|
|
33
|
+
* - 'never': never show
|
|
34
|
+
* @defaultValue 'always'
|
|
35
|
+
*/
|
|
36
|
+
showValidationErrors?: NuGridShowErrors;
|
|
37
|
+
/**
|
|
38
|
+
* Interaction router for registering keyboard handlers
|
|
39
|
+
* Editors can use this to register keyboard handlers through the router system
|
|
40
|
+
* instead of managing their own document-level listeners
|
|
41
|
+
*/
|
|
42
|
+
interactionRouter?: NuGridInteractionRouter<T>;
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Emits for custom cell editor components
|
|
46
|
+
*/
|
|
47
|
+
export interface NuGridCellEditorEmits {
|
|
48
|
+
(e: 'update:modelValue', value: any): void;
|
|
49
|
+
(e: 'stop-editing', moveDirection?: 'up' | 'down' | 'next' | 'previous'): void;
|
|
50
|
+
(e: 'cancel-editing'): void;
|
|
51
|
+
(e: 'update:isNavigating', value: boolean): void;
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Renderer configuration type - supports multiple formats for flexibility
|
|
55
|
+
*/
|
|
56
|
+
export type NuGridRendererConfig = string | Component | {
|
|
57
|
+
component: string | Component;
|
|
58
|
+
props?: Record<string, any>;
|
|
59
|
+
} | ((context: NuGridCellRenderContext) => any);
|
|
60
|
+
/**
|
|
61
|
+
* Context provided when rendering a cell
|
|
62
|
+
*/
|
|
63
|
+
export interface NuGridCellRenderContext<T = any> {
|
|
64
|
+
cell: any;
|
|
65
|
+
row: Row<T>;
|
|
66
|
+
getValue: () => any;
|
|
67
|
+
column: Column<T, unknown>;
|
|
68
|
+
table: Table<T>;
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* Filter operator definition
|
|
72
|
+
*/
|
|
73
|
+
export interface NuGridFilterOperator {
|
|
74
|
+
/** Unique identifier for the operator */
|
|
75
|
+
value: string;
|
|
76
|
+
/** Human-readable label */
|
|
77
|
+
label: string;
|
|
78
|
+
/** Filter function that determines if a row matches */
|
|
79
|
+
filterFn: (row: Row<any>, columnId: string, filterValue: any, operatorValue: string) => boolean;
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* Filter configuration for a cell type
|
|
83
|
+
*/
|
|
84
|
+
export interface NuGridFilterConfig {
|
|
85
|
+
/** Filter control component (rendered in column menu or header) */
|
|
86
|
+
component?: Component | string;
|
|
87
|
+
/** Props to pass to filter component */
|
|
88
|
+
props?: Record<string, any>;
|
|
89
|
+
/** Default filter value */
|
|
90
|
+
defaultValue?: any;
|
|
91
|
+
/** Filter operator options (e.g., 'equals', 'contains', 'greaterThan', etc.) */
|
|
92
|
+
operators?: NuGridFilterOperator[];
|
|
93
|
+
/** Default operator to use */
|
|
94
|
+
defaultOperator?: string;
|
|
95
|
+
}
|
|
96
|
+
/**
|
|
97
|
+
* Context provided to filter components
|
|
98
|
+
*/
|
|
99
|
+
export interface NuGridFilterContext<T extends TableData = TableData> {
|
|
100
|
+
/** The column being filtered */
|
|
101
|
+
column: Column<T, unknown>;
|
|
102
|
+
/** Current filter value (reactive) */
|
|
103
|
+
filterValue: Ref<any>;
|
|
104
|
+
/** Set the filter value */
|
|
105
|
+
setFilterValue: (value: any) => void;
|
|
106
|
+
/** Clear the filter */
|
|
107
|
+
clearFilter: () => void;
|
|
108
|
+
/** Whether a filter is currently active */
|
|
109
|
+
isFiltered: boolean;
|
|
110
|
+
/** Table API instance */
|
|
111
|
+
table: Table<T>;
|
|
112
|
+
}
|
|
113
|
+
/**
|
|
114
|
+
* Context provided to cell types
|
|
115
|
+
* Provides access to cell, row, column, and utility functions
|
|
116
|
+
*/
|
|
117
|
+
export interface NuGridCellTypeContext<T extends TableData = TableData> {
|
|
118
|
+
/** The cell being operated on */
|
|
119
|
+
cell: any;
|
|
120
|
+
/** The row containing the cell */
|
|
121
|
+
row: Row<T>;
|
|
122
|
+
/** Column definition */
|
|
123
|
+
columnDef: any;
|
|
124
|
+
/** Column instance */
|
|
125
|
+
column: Column<T, unknown>;
|
|
126
|
+
/** Current cell value */
|
|
127
|
+
getValue: () => any;
|
|
128
|
+
/** Whether the cell is currently focused */
|
|
129
|
+
isFocused: boolean;
|
|
130
|
+
/** Whether editing is enabled for this cell */
|
|
131
|
+
canEdit: boolean;
|
|
132
|
+
/** Data array reference (for direct updates) */
|
|
133
|
+
data: T[];
|
|
134
|
+
/** TanStack table API */
|
|
135
|
+
tableApi: Table<T>;
|
|
136
|
+
/** Start editing the cell */
|
|
137
|
+
startEditing: (initialValue?: any) => void;
|
|
138
|
+
/** Stop editing and save value */
|
|
139
|
+
stopEditing: (newValue: any, moveDirection?: 'up' | 'down' | 'next' | 'previous') => void;
|
|
140
|
+
/** Emit cell value change event */
|
|
141
|
+
emitChange: (oldValue: any, newValue: any) => void;
|
|
142
|
+
}
|
|
143
|
+
/**
|
|
144
|
+
* Result from a cell type's keyboard handler
|
|
145
|
+
*/
|
|
146
|
+
export interface NuGridCellTypeKeyboardResult {
|
|
147
|
+
/** Whether the cell type handled this key event */
|
|
148
|
+
handled: boolean;
|
|
149
|
+
/** Whether to prevent default behavior */
|
|
150
|
+
preventDefault?: boolean;
|
|
151
|
+
/** Whether to stop event propagation */
|
|
152
|
+
stopPropagation?: boolean;
|
|
153
|
+
}
|
|
154
|
+
/**
|
|
155
|
+
* Result from validation function
|
|
156
|
+
*/
|
|
157
|
+
export interface NuGridValidationResult {
|
|
158
|
+
/** Whether the value is valid */
|
|
159
|
+
valid: boolean;
|
|
160
|
+
/** Error message if invalid */
|
|
161
|
+
message?: string;
|
|
162
|
+
/** Detailed validation issues (for schema validation) */
|
|
163
|
+
issues?: ReadonlyArray<{
|
|
164
|
+
message: string;
|
|
165
|
+
path?: ReadonlyArray<PropertyKey | {
|
|
166
|
+
key: PropertyKey;
|
|
167
|
+
}>;
|
|
168
|
+
}>;
|
|
169
|
+
}
|
|
170
|
+
/**
|
|
171
|
+
* Cell type interface
|
|
172
|
+
* Comprehensive interface for defining custom cell types with editors, renderers, filters, validation, and more
|
|
173
|
+
*
|
|
174
|
+
* @example
|
|
175
|
+
* // Custom rating cell type
|
|
176
|
+
* const ratingCellType: NuGridCellType = {
|
|
177
|
+
* name: 'rating',
|
|
178
|
+
* displayName: 'Rating',
|
|
179
|
+
* description: '1-5 star rating column',
|
|
180
|
+
* editor: RatingEditor,
|
|
181
|
+
* renderer: RatingRenderer,
|
|
182
|
+
* filter: {
|
|
183
|
+
* component: RatingFilter,
|
|
184
|
+
* operators: [
|
|
185
|
+
* { value: 'equals', label: 'Equals', filterFn: (row, colId, val) => row.getValue(colId) === val },
|
|
186
|
+
* { value: 'gte', label: 'At least', filterFn: (row, colId, val) => row.getValue(colId) >= val }
|
|
187
|
+
* ]
|
|
188
|
+
* },
|
|
189
|
+
* validation: (value) => ({
|
|
190
|
+
* valid: value >= 1 && value <= 5,
|
|
191
|
+
* message: value < 1 || value > 5 ? 'Rating must be between 1 and 5' : undefined
|
|
192
|
+
* }),
|
|
193
|
+
* formatter: (value) => `${value} ⭐`,
|
|
194
|
+
* keyboardHandler: (event, context) => {
|
|
195
|
+
* if (event.key >= '1' && event.key <= '5' && context.isFocused && context.canEdit) {
|
|
196
|
+
* const newValue = parseInt(event.key)
|
|
197
|
+
* const oldValue = context.getValue()
|
|
198
|
+
* context.emitChange(oldValue, newValue)
|
|
199
|
+
* return { handled: true, preventDefault: true }
|
|
200
|
+
* }
|
|
201
|
+
* return { handled: false }
|
|
202
|
+
* }
|
|
203
|
+
* }
|
|
204
|
+
*/
|
|
205
|
+
export interface NuGridCellType<T extends TableData = TableData> {
|
|
206
|
+
/**
|
|
207
|
+
* Unique name for this cell type
|
|
208
|
+
* Used to match against column's cellDataType property
|
|
209
|
+
*/
|
|
210
|
+
name: string;
|
|
211
|
+
/**
|
|
212
|
+
* Human-readable display name for this type
|
|
213
|
+
* Used in UI elements like filter dropdowns
|
|
214
|
+
*/
|
|
215
|
+
displayName?: string;
|
|
216
|
+
/**
|
|
217
|
+
* Description of what this cell type does
|
|
218
|
+
* Used for documentation and tooltips
|
|
219
|
+
*/
|
|
220
|
+
description?: string;
|
|
221
|
+
/**
|
|
222
|
+
* Editor component for edit mode
|
|
223
|
+
* Used when column doesn't specify a custom editor
|
|
224
|
+
*/
|
|
225
|
+
editor?: NuGridEditorConfig;
|
|
226
|
+
/**
|
|
227
|
+
* Renderer component for display mode
|
|
228
|
+
* Optional - falls back to default cell rendering if not provided
|
|
229
|
+
*/
|
|
230
|
+
renderer?: NuGridRendererConfig;
|
|
231
|
+
/**
|
|
232
|
+
* Custom keyboard handler for non-editing mode
|
|
233
|
+
* Called when a key is pressed on a focused cell that is not in edit mode
|
|
234
|
+
* Return { handled: true } to prevent default behavior
|
|
235
|
+
*/
|
|
236
|
+
keyboardHandler?: (event: KeyboardEvent, context: NuGridCellTypeContext<T>) => NuGridCellTypeKeyboardResult;
|
|
237
|
+
/**
|
|
238
|
+
* Validation function for cell values
|
|
239
|
+
* Called when editing stops to validate the new value
|
|
240
|
+
*/
|
|
241
|
+
validation?: (value: any, context: NuGridCellTypeContext<T>) => NuGridValidationResult;
|
|
242
|
+
/**
|
|
243
|
+
* Formatter function for display values
|
|
244
|
+
* Transforms the raw value for display purposes
|
|
245
|
+
*/
|
|
246
|
+
formatter?: (value: any, context: NuGridCellTypeContext<T>) => any;
|
|
247
|
+
/**
|
|
248
|
+
* Filter configuration
|
|
249
|
+
* Defines filter component and operators for this cell type
|
|
250
|
+
*/
|
|
251
|
+
filter?: NuGridFilterConfig;
|
|
252
|
+
/**
|
|
253
|
+
* Custom filter function
|
|
254
|
+
* Overrides default filtering logic for this cell type
|
|
255
|
+
* If not provided, uses TanStack Table's default filterFn or type's filter operators
|
|
256
|
+
*/
|
|
257
|
+
filterFn?: (row: Row<T>, columnId: string, filterValue: any) => boolean;
|
|
258
|
+
/**
|
|
259
|
+
* Whether filtering is enabled for this cell type
|
|
260
|
+
* @defaultValue true if filter is provided, false otherwise
|
|
261
|
+
*/
|
|
262
|
+
enableFiltering?: boolean;
|
|
263
|
+
/**
|
|
264
|
+
* Column menu customization
|
|
265
|
+
* Allows cell types to add or modify column menu items
|
|
266
|
+
*/
|
|
267
|
+
columnMenuItems?: (defaultItems: NuGridColumnMenuItem<T>[], column: Column<T, unknown>) => NuGridColumnMenuItem<T>[];
|
|
268
|
+
/**
|
|
269
|
+
* Default cell renderer function
|
|
270
|
+
* Used if renderer component is not provided
|
|
271
|
+
* Falls back to TanStack Table's default cell rendering
|
|
272
|
+
*/
|
|
273
|
+
defaultCellRenderer?: (context: NuGridCellRenderContext<T>) => any;
|
|
274
|
+
/**
|
|
275
|
+
* Lifecycle hook called when a cell is created
|
|
276
|
+
* Useful for initialization or setup
|
|
277
|
+
*/
|
|
278
|
+
onCellCreated?: (cell: any, context: NuGridCellTypeContext<T>) => void;
|
|
279
|
+
/**
|
|
280
|
+
* Lifecycle hook called when a cell value changes
|
|
281
|
+
* Useful for side effects or data synchronization
|
|
282
|
+
*/
|
|
283
|
+
onValueChanged?: (oldValue: any, newValue: any, context: NuGridCellTypeContext<T>) => void;
|
|
284
|
+
/**
|
|
285
|
+
* Default column definition properties
|
|
286
|
+
* Applied to columns using this cell type
|
|
287
|
+
* Can be overridden by explicit column definition
|
|
288
|
+
*/
|
|
289
|
+
defaultColumnDef?: Partial<NuGridColumn<T>>;
|
|
290
|
+
}
|
|
291
|
+
export { useNuGridCellEditor } from '../composables/useNuGridCellEditor.js';
|
|
292
|
+
export { nuGridCellTypeRegistry, useNuGridCellTypeRegistry, } from '../composables/useNuGridCellTypeRegistry.js';
|
|
@@ -0,0 +1,248 @@
|
|
|
1
|
+
import type { DropdownMenuItem, TableColumn, TableData } from '@nuxt/ui';
|
|
2
|
+
import type { Column, Row } from '@tanstack/vue-table';
|
|
3
|
+
import type { NuGridEditorConfig } from './_internal/index.js';
|
|
4
|
+
import type { NuGridValidationResult } from './cells.js';
|
|
5
|
+
import type { NuGridLookupOptions } from './option-groups.js';
|
|
6
|
+
import type { NuGridSortIcon } from './sort-icon.js';
|
|
7
|
+
/**
|
|
8
|
+
* Extended dropdown menu item for column menus
|
|
9
|
+
* Adds column parameter to onSelect callback
|
|
10
|
+
* Supports all DropdownMenuItem types (separator, label, etc.) but extends onSelect for regular items
|
|
11
|
+
*/
|
|
12
|
+
export type NuGridColumnMenuItem<T extends TableData = TableData> = (Omit<DropdownMenuItem, 'onSelect' | 'children'> & {
|
|
13
|
+
/**
|
|
14
|
+
* Callback function called when the menu item is selected
|
|
15
|
+
* @param event The click event (optional)
|
|
16
|
+
* @param column The column instance (automatically provided by NuGridColumnMenu)
|
|
17
|
+
*/
|
|
18
|
+
onSelect?: (event?: Event, column?: Column<T, unknown>) => void;
|
|
19
|
+
/**
|
|
20
|
+
* Nested menu items (children)
|
|
21
|
+
*/
|
|
22
|
+
children?: NuGridColumnMenuItem<T>[];
|
|
23
|
+
}) | Extract<DropdownMenuItem, {
|
|
24
|
+
type: 'separator' | 'label';
|
|
25
|
+
}>;
|
|
26
|
+
/**
|
|
27
|
+
* Function type for customizing column menu items
|
|
28
|
+
* Used by both column-level `columnMenuItems` callbacks and grid-level `getColumnMenuItems`
|
|
29
|
+
* @param defaultItems The default menu items for the column
|
|
30
|
+
* @param column The column instance
|
|
31
|
+
* @returns Custom menu items array
|
|
32
|
+
*/
|
|
33
|
+
export type NuGridColumnMenuItemsCallback<T extends TableData = TableData> = (defaultItems: NuGridColumnMenuItem<T>[], column: Column<T, unknown>) => NuGridColumnMenuItem<T>[];
|
|
34
|
+
/**
|
|
35
|
+
* Extended column type with editor support
|
|
36
|
+
*/
|
|
37
|
+
export type NuGridColumn<T extends TableData> = TableColumn<T> & {
|
|
38
|
+
/**
|
|
39
|
+
* Editor configuration for the column cell
|
|
40
|
+
* Can be specified as:
|
|
41
|
+
* - String: Component name (e.g., 'NuGridCellEditorRange')
|
|
42
|
+
* - Object: { component: 'ComponentName', props: { min: 0, max: 100 } }
|
|
43
|
+
* - Function: Custom render function for advanced cases
|
|
44
|
+
* @example
|
|
45
|
+
* // Simple component reference
|
|
46
|
+
* editor: 'NuGridCellEditorRange'
|
|
47
|
+
*
|
|
48
|
+
* // Component with props
|
|
49
|
+
* editor: { component: 'NuGridCellEditorRange', props: { min: 0, max: 100, step: 5 } }
|
|
50
|
+
*/
|
|
51
|
+
editor?: NuGridEditorConfig;
|
|
52
|
+
/**
|
|
53
|
+
* Controls whether this column is editable
|
|
54
|
+
* Can be a boolean or a function that receives the row and returns a boolean
|
|
55
|
+
* @defaultValue true
|
|
56
|
+
*/
|
|
57
|
+
enableEditing?: boolean | ((row: Row<T>) => boolean);
|
|
58
|
+
/**
|
|
59
|
+
* Controls whether this column can receive keyboard focus during navigation
|
|
60
|
+
* Can be a boolean or a function that receives the row and returns a boolean
|
|
61
|
+
* When false, the column will be skipped during keyboard navigation (arrows, tab, etc.)
|
|
62
|
+
* @defaultValue true
|
|
63
|
+
*/
|
|
64
|
+
enableFocusing?: boolean | ((row: Row<T>) => boolean);
|
|
65
|
+
/**
|
|
66
|
+
* Data type for the cell, determines which default editor to use
|
|
67
|
+
* Built-in types: 'text', 'number', 'date', 'boolean', 'selection', 'action-menu', 'lookup'
|
|
68
|
+
* Custom types can be registered via cellTypes prop
|
|
69
|
+
* @defaultValue 'text'
|
|
70
|
+
*/
|
|
71
|
+
cellDataType?: string;
|
|
72
|
+
/**
|
|
73
|
+
* Lookup/dropdown configuration for cells using cellDataType: 'lookup'
|
|
74
|
+
* Provides a dropdown selection interface using Nuxt UI's SelectMenu
|
|
75
|
+
* @example
|
|
76
|
+
* {
|
|
77
|
+
* items: [
|
|
78
|
+
* { value: 'active', label: 'Active' },
|
|
79
|
+
* { value: 'inactive', label: 'Inactive' }
|
|
80
|
+
* ],
|
|
81
|
+
* valueKey: 'value',
|
|
82
|
+
* labelKey: 'label',
|
|
83
|
+
* searchable: true
|
|
84
|
+
* }
|
|
85
|
+
*/
|
|
86
|
+
lookup?: NuGridLookupOptions;
|
|
87
|
+
/**
|
|
88
|
+
* Sort icon configuration for this column's header
|
|
89
|
+
* Overrides the grid-level sortIcons configuration
|
|
90
|
+
* @example
|
|
91
|
+
* // Use custom icons for this column
|
|
92
|
+
* sortIcons: {
|
|
93
|
+
* unsorted: 'i-lucide-chevrons-up-down',
|
|
94
|
+
* asc: 'i-lucide-chevron-up',
|
|
95
|
+
* desc: 'i-lucide-chevron-down',
|
|
96
|
+
* position: 'inline'
|
|
97
|
+
* }
|
|
98
|
+
*/
|
|
99
|
+
sortIcons?: NuGridSortIcon;
|
|
100
|
+
/**
|
|
101
|
+
* Override the default cell rendering behavior
|
|
102
|
+
* When true, indicates that the cell uses a custom renderer and should bypass default rendering logic
|
|
103
|
+
* @defaultValue false
|
|
104
|
+
*/
|
|
105
|
+
overrideCellRender?: boolean;
|
|
106
|
+
/**
|
|
107
|
+
* Controls whether the column menu is enabled for this column
|
|
108
|
+
* @defaultValue true
|
|
109
|
+
*/
|
|
110
|
+
enableColumnMenu?: boolean;
|
|
111
|
+
/**
|
|
112
|
+
* Controls whether this column can be reordered via drag and drop
|
|
113
|
+
* @defaultValue true
|
|
114
|
+
*/
|
|
115
|
+
enableReordering?: boolean;
|
|
116
|
+
/**
|
|
117
|
+
* Controls whether the column visibility chooser appears in the column menu
|
|
118
|
+
* Column-level setting takes precedence over grid-level `showColumnVisibility`
|
|
119
|
+
* @defaultValue true
|
|
120
|
+
*/
|
|
121
|
+
showColumnVisibility?: boolean;
|
|
122
|
+
/**
|
|
123
|
+
* Custom menu items for the column menu
|
|
124
|
+
* Can be either:
|
|
125
|
+
* - An array of menu items (replaces default items)
|
|
126
|
+
* - A callback function that receives default items and returns custom items
|
|
127
|
+
* If not provided, default menu items are used
|
|
128
|
+
* @example
|
|
129
|
+
* // Replace with custom items
|
|
130
|
+
* columnMenuItems: [
|
|
131
|
+
* { label: 'Custom Action', icon: 'i-lucide-star', onSelect: (event, column) => console.log(column?.id) }
|
|
132
|
+
* ]
|
|
133
|
+
* @example
|
|
134
|
+
* // Modify default items
|
|
135
|
+
* columnMenuItems: (defaultItems) => [
|
|
136
|
+
* ...defaultItems,
|
|
137
|
+
* { type: 'separator' },
|
|
138
|
+
* { label: 'Custom Action', icon: 'i-lucide-star', onSelect: (event, column) => console.log(column?.id) }
|
|
139
|
+
* ]
|
|
140
|
+
*/
|
|
141
|
+
columnMenuItems?: NuGridColumnMenuItem<T>[] | ((defaultItems: NuGridColumnMenuItem<T>[], column?: Column<T, unknown>) => NuGridColumnMenuItem<T>[]);
|
|
142
|
+
/**
|
|
143
|
+
* Controls whether this column's editor is shown when the user clicks "Add New"
|
|
144
|
+
* When false, the column will be hidden in the add new row form
|
|
145
|
+
* @defaultValue true
|
|
146
|
+
*/
|
|
147
|
+
showNew?: boolean;
|
|
148
|
+
/**
|
|
149
|
+
* Controls whether this column is required when adding a new row
|
|
150
|
+
* Can be a boolean or a function that returns a boolean
|
|
151
|
+
* @defaultValue false
|
|
152
|
+
* @example
|
|
153
|
+
* // Simple boolean
|
|
154
|
+
* requiredNew: true
|
|
155
|
+
*
|
|
156
|
+
* @example
|
|
157
|
+
* // Function for dynamic requirement
|
|
158
|
+
* requiredNew: () => someCondition
|
|
159
|
+
*/
|
|
160
|
+
requiredNew?: boolean | (() => boolean);
|
|
161
|
+
/**
|
|
162
|
+
* Validation function for the new row value
|
|
163
|
+
* Called when the user attempts to add a new row with a value for this column
|
|
164
|
+
* @param value The current value being attempted by the user
|
|
165
|
+
* @returns NuGridValidationResult, boolean, or string (error message)
|
|
166
|
+
* @example
|
|
167
|
+
* // Return NuGridValidationResult
|
|
168
|
+
* validateNew: (value) => ({
|
|
169
|
+
* valid: value.length > 0,
|
|
170
|
+
* message: 'Name is required'
|
|
171
|
+
* })
|
|
172
|
+
*
|
|
173
|
+
* @example
|
|
174
|
+
* // Return boolean
|
|
175
|
+
* validateNew: (value) => value > 0
|
|
176
|
+
*
|
|
177
|
+
* @example
|
|
178
|
+
* // Return string (error message) or undefined/null (valid)
|
|
179
|
+
* validateNew: (value) => value ? undefined : 'Value is required'
|
|
180
|
+
*/
|
|
181
|
+
validateNew?: (value: any) => NuGridValidationResult | boolean | string | undefined | null;
|
|
182
|
+
/**
|
|
183
|
+
* Controls whether text in this column should wrap instead of being truncated
|
|
184
|
+
* When true, cell content will wrap to multiple lines
|
|
185
|
+
* When false or undefined, text will be truncated with ellipsis
|
|
186
|
+
* @defaultValue false
|
|
187
|
+
*/
|
|
188
|
+
wrapText?: boolean;
|
|
189
|
+
/**
|
|
190
|
+
* Alternate field in the row data to use as the tooltip value
|
|
191
|
+
* When set, tooltip always shows (ignores truncatedOnly setting for this column)
|
|
192
|
+
* @example
|
|
193
|
+
* // Show 'fullDescription' field as tooltip for 'title' column
|
|
194
|
+
* { accessorKey: 'title', tooltipField: 'fullDescription' }
|
|
195
|
+
*/
|
|
196
|
+
tooltipField?: string;
|
|
197
|
+
/**
|
|
198
|
+
* Function to generate custom tooltip content for cells in this column
|
|
199
|
+
* Takes precedence over tooltipField
|
|
200
|
+
* When set, tooltip always shows (ignores truncatedOnly setting for this column)
|
|
201
|
+
* @param row The row data
|
|
202
|
+
* @returns The tooltip text to display
|
|
203
|
+
* @example
|
|
204
|
+
* // Generate tooltip from multiple fields
|
|
205
|
+
* tooltipValue: (row) => `${row.name} - ${row.department}`
|
|
206
|
+
*/
|
|
207
|
+
tooltipValue?: (row: T) => string;
|
|
208
|
+
/**
|
|
209
|
+
* Whether to show a tooltip on the column header
|
|
210
|
+
* Useful for showing full header text when header is truncated
|
|
211
|
+
* @defaultValue false
|
|
212
|
+
*/
|
|
213
|
+
tooltipHeader?: boolean;
|
|
214
|
+
/**
|
|
215
|
+
* Function to generate custom tooltip content for the column header
|
|
216
|
+
* When set, tooltipHeader is automatically enabled
|
|
217
|
+
* @returns The tooltip text for the header
|
|
218
|
+
* @example
|
|
219
|
+
* // Custom header tooltip
|
|
220
|
+
* tooltipHeaderValue: () => 'Full column description or help text'
|
|
221
|
+
*/
|
|
222
|
+
tooltipHeaderValue?: () => string;
|
|
223
|
+
/**
|
|
224
|
+
* The visual row index this column should appear on in multi-row mode
|
|
225
|
+
* Only used when `multiRow.enabled` is true on the grid
|
|
226
|
+
* Columns on the same row are rendered left-to-right in their defined order
|
|
227
|
+
* @defaultValue 0
|
|
228
|
+
* @example
|
|
229
|
+
* // Place this column on the second visual row
|
|
230
|
+
* row: 1
|
|
231
|
+
*/
|
|
232
|
+
row?: number;
|
|
233
|
+
/**
|
|
234
|
+
* Number of column slots to span in aligned multi-row mode
|
|
235
|
+
* Only used when `multiRow.alignColumns` is true
|
|
236
|
+
* - Number: Span that many columns from row 0
|
|
237
|
+
* - '*': Span all remaining columns (fills to the end)
|
|
238
|
+
* @defaultValue 1
|
|
239
|
+
* @example
|
|
240
|
+
* // Span 2 column slots
|
|
241
|
+
* span: 2
|
|
242
|
+
*
|
|
243
|
+
* @example
|
|
244
|
+
* // Span all remaining columns
|
|
245
|
+
* span: '*'
|
|
246
|
+
*/
|
|
247
|
+
span?: number | '*';
|
|
248
|
+
};
|
|
File without changes
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import type { ComponentConfig } from '@nuxt/ui';
|
|
2
|
+
import type { AppConfig } from 'nuxt/schema';
|
|
3
|
+
import type { nuGridTheme } from '../themes/index.js';
|
|
4
|
+
export type NuGridConfig = ComponentConfig<typeof nuGridTheme, AppConfig, 'table'>;
|
|
5
|
+
export type { NuGridUISlots } from '../composables/_internal/useNuGridUI.js';
|
|
6
|
+
/**
|
|
7
|
+
* Custom theme configuration for app.config.ts
|
|
8
|
+
*/
|
|
9
|
+
export interface NuGridThemeConfig {
|
|
10
|
+
/** Unique theme identifier */
|
|
11
|
+
name: string;
|
|
12
|
+
/** Human-readable display name */
|
|
13
|
+
displayName?: string;
|
|
14
|
+
/** Theme description */
|
|
15
|
+
description?: string;
|
|
16
|
+
/** Base theme to extend */
|
|
17
|
+
baseTheme?: string;
|
|
18
|
+
/** Custom slot classes */
|
|
19
|
+
slots?: Record<string, string>;
|
|
20
|
+
/** Custom variants */
|
|
21
|
+
variants?: Record<string, any>;
|
|
22
|
+
/** Custom compound variants */
|
|
23
|
+
compoundVariants?: any[];
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Augment AppConfig to include NuGrid theme configuration
|
|
27
|
+
*/
|
|
28
|
+
declare module 'nuxt/schema' {
|
|
29
|
+
interface AppConfig {
|
|
30
|
+
nuGrid?: {
|
|
31
|
+
/** Custom themes to register */
|
|
32
|
+
themes?: NuGridThemeConfig[];
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
}
|
|
File without changes
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import type { TableData } from '@nuxt/ui';
|
|
2
|
+
import type { Header, Row } from '@tanstack/vue-table';
|
|
3
|
+
import type { MaybeRef, Ref } from 'vue';
|
|
4
|
+
/**
|
|
5
|
+
* Event payload for row drag events
|
|
6
|
+
*/
|
|
7
|
+
export interface RowDragEvent<T extends TableData = TableData> {
|
|
8
|
+
/**
|
|
9
|
+
* The row data that was dragged
|
|
10
|
+
*/
|
|
11
|
+
row: T;
|
|
12
|
+
/**
|
|
13
|
+
* Original index in the data array before drag
|
|
14
|
+
*/
|
|
15
|
+
originalIndex: number;
|
|
16
|
+
/**
|
|
17
|
+
* New index in the data array after drop
|
|
18
|
+
*/
|
|
19
|
+
newIndex: number;
|
|
20
|
+
/**
|
|
21
|
+
* Grid ID where the drag originated (for cross-grid dragging)
|
|
22
|
+
*/
|
|
23
|
+
sourceGridId?: string;
|
|
24
|
+
/**
|
|
25
|
+
* Grid ID where the item was dropped (for cross-grid dragging)
|
|
26
|
+
*/
|
|
27
|
+
targetGridId?: string;
|
|
28
|
+
/**
|
|
29
|
+
* Group value where the drag originated (for grouped tables)
|
|
30
|
+
*/
|
|
31
|
+
sourceGroup?: string;
|
|
32
|
+
/**
|
|
33
|
+
* Group value where the item was dropped (for grouped tables)
|
|
34
|
+
*/
|
|
35
|
+
targetGroup?: string;
|
|
36
|
+
/**
|
|
37
|
+
* Position change: positive means moved down, negative means moved up
|
|
38
|
+
*/
|
|
39
|
+
positionChange: number;
|
|
40
|
+
/**
|
|
41
|
+
* Whether the row was moved to a different group
|
|
42
|
+
*/
|
|
43
|
+
groupChanged: boolean;
|
|
44
|
+
/**
|
|
45
|
+
* Whether the row was moved to a different grid
|
|
46
|
+
*/
|
|
47
|
+
gridChanged: boolean;
|
|
48
|
+
/**
|
|
49
|
+
* The drop position relative to target ('before' or 'after')
|
|
50
|
+
*/
|
|
51
|
+
dropPosition: 'before' | 'after';
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Type for nugrid-dragfns injection
|
|
55
|
+
* Provides column drag and drop functionality
|
|
56
|
+
*/
|
|
57
|
+
export interface NuGridColumnDragDrop<T extends TableData = TableData> {
|
|
58
|
+
draggedColumnId: MaybeRef<string | null>;
|
|
59
|
+
dropTargetColumnId: MaybeRef<string | null>;
|
|
60
|
+
dropPosition: MaybeRef<'left' | 'right'>;
|
|
61
|
+
isDraggingOutside: Ref<boolean>;
|
|
62
|
+
handleColumnDragStart: (e: DragEvent, columnId: string) => void;
|
|
63
|
+
handleColumnDragOver: (e: DragEvent, columnId: string) => void;
|
|
64
|
+
handleColumnDrop: (e: DragEvent, columnId: string) => void;
|
|
65
|
+
handleColumnDragEnd: () => void;
|
|
66
|
+
handleColumnDragLeave: (e: DragEvent) => void;
|
|
67
|
+
handleColumnDragEnter: () => void;
|
|
68
|
+
isHeaderDraggable: (header: Header<T, any>) => boolean;
|
|
69
|
+
headerDragHandleProps: (header: Header<T, any>) => Record<string, unknown>;
|
|
70
|
+
headerDragProps: (header: Header<T, any>) => Record<string, unknown>;
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* Type for nugrid-rowdragfns injection
|
|
74
|
+
* Provides row drag and drop functionality
|
|
75
|
+
*/
|
|
76
|
+
export interface NuGridRowDragDrop<T extends TableData = TableData> {
|
|
77
|
+
draggedRowId: Ref<string | null>;
|
|
78
|
+
draggedRowData: Ref<T | null>;
|
|
79
|
+
dropTargetRowId: Ref<string | null>;
|
|
80
|
+
dropPosition: Ref<'before' | 'after'>;
|
|
81
|
+
dragSourceGridId: Ref<string | null>;
|
|
82
|
+
isDraggingOutside: Ref<boolean>;
|
|
83
|
+
handleRowDragStart: (e: DragEvent, row: Row<T>) => void;
|
|
84
|
+
handleRowDragOver: (e: DragEvent, row: Row<T>) => void;
|
|
85
|
+
handleRowDrop: (e: DragEvent, row: Row<T>) => void;
|
|
86
|
+
handleRowDragEnd: () => void;
|
|
87
|
+
handleRowDragLeave: (e: DragEvent) => void;
|
|
88
|
+
handleRowDragEnter: () => void;
|
|
89
|
+
isRowDraggable: (row: Row<T>) => boolean;
|
|
90
|
+
rowDragHandleProps: (row: Row<T>) => Record<string, unknown>;
|
|
91
|
+
rowDragProps: (row: Row<T>) => Record<string, unknown>;
|
|
92
|
+
}
|
|
File without changes
|