@nu-grid/nuxt 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE.md +21 -0
- package/README.md +261 -0
- package/dist/module.d.mts +13 -0
- package/dist/module.json +9 -0
- package/dist/module.mjs +52 -0
- package/dist/runtime/cell-types/action-menu/ActionMenuRenderer.d.vue.ts +12 -0
- package/dist/runtime/cell-types/action-menu/ActionMenuRenderer.vue +123 -0
- package/dist/runtime/cell-types/action-menu/ActionMenuRenderer.vue.d.ts +12 -0
- package/dist/runtime/cell-types/action-menu/index.d.ts +8 -0
- package/dist/runtime/cell-types/action-menu/index.js +28 -0
- package/dist/runtime/cell-types/boolean/BooleanEditor.d.vue.ts +15 -0
- package/dist/runtime/cell-types/boolean/BooleanEditor.vue +32 -0
- package/dist/runtime/cell-types/boolean/BooleanEditor.vue.d.ts +15 -0
- package/dist/runtime/cell-types/boolean/BooleanFilter.d.vue.ts +7 -0
- package/dist/runtime/cell-types/boolean/BooleanFilter.vue +42 -0
- package/dist/runtime/cell-types/boolean/BooleanFilter.vue.d.ts +7 -0
- package/dist/runtime/cell-types/boolean/BooleanRenderer.d.vue.ts +13 -0
- package/dist/runtime/cell-types/boolean/BooleanRenderer.vue +23 -0
- package/dist/runtime/cell-types/boolean/BooleanRenderer.vue.d.ts +13 -0
- package/dist/runtime/cell-types/boolean/index.d.ts +8 -0
- package/dist/runtime/cell-types/boolean/index.js +31 -0
- package/dist/runtime/cell-types/currency/CurrencyEditor.d.vue.ts +15 -0
- package/dist/runtime/cell-types/currency/CurrencyEditor.vue +40 -0
- package/dist/runtime/cell-types/currency/CurrencyEditor.vue.d.ts +15 -0
- package/dist/runtime/cell-types/currency/CurrencyFilter.d.vue.ts +7 -0
- package/dist/runtime/cell-types/currency/CurrencyFilter.vue +76 -0
- package/dist/runtime/cell-types/currency/CurrencyFilter.vue.d.ts +7 -0
- package/dist/runtime/cell-types/currency/index.d.ts +6 -0
- package/dist/runtime/cell-types/currency/index.js +42 -0
- package/dist/runtime/cell-types/date/DateEditor.d.vue.ts +15 -0
- package/dist/runtime/cell-types/date/DateEditor.vue +42 -0
- package/dist/runtime/cell-types/date/DateEditor.vue.d.ts +15 -0
- package/dist/runtime/cell-types/date/DateFilter.d.vue.ts +7 -0
- package/dist/runtime/cell-types/date/DateFilter.vue +58 -0
- package/dist/runtime/cell-types/date/DateFilter.vue.d.ts +7 -0
- package/dist/runtime/cell-types/date/index.d.ts +6 -0
- package/dist/runtime/cell-types/date/index.js +13 -0
- package/dist/runtime/cell-types/index.d.ts +17 -0
- package/dist/runtime/cell-types/index.js +34 -0
- package/dist/runtime/cell-types/lookup/LookupEditor.d.vue.ts +15 -0
- package/dist/runtime/cell-types/lookup/LookupEditor.vue +291 -0
- package/dist/runtime/cell-types/lookup/LookupEditor.vue.d.ts +15 -0
- package/dist/runtime/cell-types/lookup/LookupRenderer.d.vue.ts +8 -0
- package/dist/runtime/cell-types/lookup/LookupRenderer.vue +43 -0
- package/dist/runtime/cell-types/lookup/LookupRenderer.vue.d.ts +8 -0
- package/dist/runtime/cell-types/lookup/index.d.ts +36 -0
- package/dist/runtime/cell-types/lookup/index.js +50 -0
- package/dist/runtime/cell-types/number/NumberEditor.d.vue.ts +15 -0
- package/dist/runtime/cell-types/number/NumberEditor.vue +34 -0
- package/dist/runtime/cell-types/number/NumberEditor.vue.d.ts +15 -0
- package/dist/runtime/cell-types/number/NumberFilter.d.vue.ts +7 -0
- package/dist/runtime/cell-types/number/NumberFilter.vue +66 -0
- package/dist/runtime/cell-types/number/NumberFilter.vue.d.ts +7 -0
- package/dist/runtime/cell-types/number/index.d.ts +6 -0
- package/dist/runtime/cell-types/number/index.js +13 -0
- package/dist/runtime/cell-types/rating/RatingEditor.d.vue.ts +15 -0
- package/dist/runtime/cell-types/rating/RatingEditor.vue +219 -0
- package/dist/runtime/cell-types/rating/RatingEditor.vue.d.ts +15 -0
- package/dist/runtime/cell-types/rating/RatingFilter.d.vue.ts +7 -0
- package/dist/runtime/cell-types/rating/RatingFilter.vue +74 -0
- package/dist/runtime/cell-types/rating/RatingFilter.vue.d.ts +7 -0
- package/dist/runtime/cell-types/rating/RatingRenderer.d.vue.ts +10 -0
- package/dist/runtime/cell-types/rating/RatingRenderer.vue +75 -0
- package/dist/runtime/cell-types/rating/RatingRenderer.vue.d.ts +10 -0
- package/dist/runtime/cell-types/rating/index.d.ts +6 -0
- package/dist/runtime/cell-types/rating/index.js +67 -0
- package/dist/runtime/cell-types/selection/SelectionEditor.d.vue.ts +15 -0
- package/dist/runtime/cell-types/selection/SelectionEditor.vue +42 -0
- package/dist/runtime/cell-types/selection/SelectionEditor.vue.d.ts +15 -0
- package/dist/runtime/cell-types/selection/SelectionRenderer.d.vue.ts +14 -0
- package/dist/runtime/cell-types/selection/SelectionRenderer.vue +25 -0
- package/dist/runtime/cell-types/selection/SelectionRenderer.vue.d.ts +14 -0
- package/dist/runtime/cell-types/selection/index.d.ts +8 -0
- package/dist/runtime/cell-types/selection/index.js +36 -0
- package/dist/runtime/cell-types/text/TextEditor.d.vue.ts +15 -0
- package/dist/runtime/cell-types/text/TextEditor.vue +70 -0
- package/dist/runtime/cell-types/text/TextEditor.vue.d.ts +15 -0
- package/dist/runtime/cell-types/text/TextFilter.d.vue.ts +7 -0
- package/dist/runtime/cell-types/text/TextFilter.vue +50 -0
- package/dist/runtime/cell-types/text/TextFilter.vue.d.ts +7 -0
- package/dist/runtime/cell-types/text/TextareaEditor.d.vue.ts +15 -0
- package/dist/runtime/cell-types/text/TextareaEditor.vue +100 -0
- package/dist/runtime/cell-types/text/TextareaEditor.vue.d.ts +15 -0
- package/dist/runtime/cell-types/text/index.d.ts +10 -0
- package/dist/runtime/cell-types/text/index.js +16 -0
- package/dist/runtime/cell-types/text/textarea.d.ts +13 -0
- package/dist/runtime/cell-types/text/textarea.js +13 -0
- package/dist/runtime/components/NuGrid.d.vue.ts +96 -0
- package/dist/runtime/components/NuGrid.vue +651 -0
- package/dist/runtime/components/NuGrid.vue.d.ts +96 -0
- package/dist/runtime/components/NuGridCellCheckbox.d.vue.ts +24 -0
- package/dist/runtime/components/NuGridCellCheckbox.vue +105 -0
- package/dist/runtime/components/NuGridCellCheckbox.vue.d.ts +24 -0
- package/dist/runtime/components/NuGridGroup.d.vue.ts +20 -0
- package/dist/runtime/components/NuGridGroup.vue +650 -0
- package/dist/runtime/components/NuGridGroup.vue.d.ts +20 -0
- package/dist/runtime/components/NuGridLazyCell.d.vue.ts +62 -0
- package/dist/runtime/components/NuGridLazyCell.vue +133 -0
- package/dist/runtime/components/NuGridLazyCell.vue.d.ts +62 -0
- package/dist/runtime/components/_internal/NuGridAddRow.d.vue.ts +36 -0
- package/dist/runtime/components/_internal/NuGridAddRow.vue +144 -0
- package/dist/runtime/components/_internal/NuGridAddRow.vue.d.ts +36 -0
- package/dist/runtime/components/_internal/NuGridBase.d.vue.ts +20 -0
- package/dist/runtime/components/_internal/NuGridBase.vue +1172 -0
- package/dist/runtime/components/_internal/NuGridBase.vue.d.ts +20 -0
- package/dist/runtime/components/_internal/NuGridCellContent.d.vue.ts +9 -0
- package/dist/runtime/components/_internal/NuGridCellContent.vue +202 -0
- package/dist/runtime/components/_internal/NuGridCellContent.vue.d.ts +9 -0
- package/dist/runtime/components/_internal/NuGridColumnMenu.d.vue.ts +25 -0
- package/dist/runtime/components/_internal/NuGridColumnMenu.vue +391 -0
- package/dist/runtime/components/_internal/NuGridColumnMenu.vue.d.ts +25 -0
- package/dist/runtime/components/_internal/NuGridGroup.d.vue.ts +20 -0
- package/dist/runtime/components/_internal/NuGridGroup.vue +650 -0
- package/dist/runtime/components/_internal/NuGridGroup.vue.d.ts +20 -0
- package/dist/runtime/components/_internal/NuGridGroupCheckbox.d.vue.ts +22 -0
- package/dist/runtime/components/_internal/NuGridGroupCheckbox.vue +132 -0
- package/dist/runtime/components/_internal/NuGridGroupCheckbox.vue.d.ts +22 -0
- package/dist/runtime/components/_internal/NuGridHeaderSortButton.d.vue.ts +31 -0
- package/dist/runtime/components/_internal/NuGridHeaderSortButton.vue +61 -0
- package/dist/runtime/components/_internal/NuGridHeaderSortButton.vue.d.ts +31 -0
- package/dist/runtime/components/_internal/NuGridPaging.d.vue.ts +3 -0
- package/dist/runtime/components/_internal/NuGridPaging.vue +65 -0
- package/dist/runtime/components/_internal/NuGridPaging.vue.d.ts +3 -0
- package/dist/runtime/components/_internal/NuGridRow.d.vue.ts +40 -0
- package/dist/runtime/components/_internal/NuGridRow.vue +645 -0
- package/dist/runtime/components/_internal/NuGridRow.vue.d.ts +40 -0
- package/dist/runtime/components/_internal/NuGridSplitGroup.d.vue.ts +20 -0
- package/dist/runtime/components/_internal/NuGridSplitGroup.vue +735 -0
- package/dist/runtime/components/_internal/NuGridSplitGroup.vue.d.ts +20 -0
- package/dist/runtime/components/_internal/NuGridTooltip.d.vue.ts +3 -0
- package/dist/runtime/components/_internal/NuGridTooltip.vue +36 -0
- package/dist/runtime/components/_internal/NuGridTooltip.vue.d.ts +3 -0
- package/dist/runtime/composables/_internal/index.d.ts +31 -0
- package/dist/runtime/composables/_internal/index.js +28 -0
- package/dist/runtime/composables/_internal/keyboard-handlers/index.d.ts +5 -0
- package/dist/runtime/composables/_internal/keyboard-handlers/index.js +9 -0
- package/dist/runtime/composables/_internal/keyboard-handlers/useKeyboardCellTypeDispatch.d.ts +18 -0
- package/dist/runtime/composables/_internal/keyboard-handlers/useKeyboardCellTypeDispatch.js +53 -0
- package/dist/runtime/composables/_internal/keyboard-handlers/useKeyboardEditingTriggers.d.ts +12 -0
- package/dist/runtime/composables/_internal/keyboard-handlers/useKeyboardEditingTriggers.js +53 -0
- package/dist/runtime/composables/_internal/keyboard-handlers/useKeyboardNavigation.d.ts +9 -0
- package/dist/runtime/composables/_internal/keyboard-handlers/useKeyboardNavigation.js +35 -0
- package/dist/runtime/composables/_internal/keyboard-handlers/useKeyboardSetup.d.ts +33 -0
- package/dist/runtime/composables/_internal/keyboard-handlers/useKeyboardSetup.js +111 -0
- package/dist/runtime/composables/_internal/keyboard-handlers/usePagingKeyboard.d.ts +11 -0
- package/dist/runtime/composables/_internal/keyboard-handlers/usePagingKeyboard.js +67 -0
- package/dist/runtime/composables/_internal/useNuGridActionMenu.d.ts +15 -0
- package/dist/runtime/composables/_internal/useNuGridActionMenu.js +137 -0
- package/dist/runtime/composables/_internal/useNuGridAddRow.d.ts +39 -0
- package/dist/runtime/composables/_internal/useNuGridAddRow.js +735 -0
- package/dist/runtime/composables/_internal/useNuGridAnimation.d.ts +33 -0
- package/dist/runtime/composables/_internal/useNuGridAnimation.js +178 -0
- package/dist/runtime/composables/_internal/useNuGridAutosize.d.ts +14 -0
- package/dist/runtime/composables/_internal/useNuGridAutosize.js +161 -0
- package/dist/runtime/composables/_internal/useNuGridCellEditing.d.ts +15 -0
- package/dist/runtime/composables/_internal/useNuGridCellEditing.js +1243 -0
- package/dist/runtime/composables/_internal/useNuGridColumnDragDrop.d.ts +8 -0
- package/dist/runtime/composables/_internal/useNuGridColumnDragDrop.js +148 -0
- package/dist/runtime/composables/_internal/useNuGridColumnPinning.d.ts +15 -0
- package/dist/runtime/composables/_internal/useNuGridColumnPinning.js +44 -0
- package/dist/runtime/composables/_internal/useNuGridColumnResize.d.ts +22 -0
- package/dist/runtime/composables/_internal/useNuGridColumnResize.js +427 -0
- package/dist/runtime/composables/_internal/useNuGridCore.d.ts +62 -0
- package/dist/runtime/composables/_internal/useNuGridCore.js +359 -0
- package/dist/runtime/composables/_internal/useNuGridExcel.d.ts +60 -0
- package/dist/runtime/composables/_internal/useNuGridExcel.js +35 -0
- package/dist/runtime/composables/_internal/useNuGridFocus.d.ts +15 -0
- package/dist/runtime/composables/_internal/useNuGridFocus.js +1378 -0
- package/dist/runtime/composables/_internal/useNuGridGroupSelection.d.ts +13 -0
- package/dist/runtime/composables/_internal/useNuGridGroupSelection.js +38 -0
- package/dist/runtime/composables/_internal/useNuGridGrouping.d.ts +28 -0
- package/dist/runtime/composables/_internal/useNuGridGrouping.js +211 -0
- package/dist/runtime/composables/_internal/useNuGridInteractionRouter.d.ts +9 -0
- package/dist/runtime/composables/_internal/useNuGridInteractionRouter.js +441 -0
- package/dist/runtime/composables/_internal/useNuGridInteractions.d.ts +10 -0
- package/dist/runtime/composables/_internal/useNuGridInteractions.js +36 -0
- package/dist/runtime/composables/_internal/useNuGridKeyboardNavigation.d.ts +54 -0
- package/dist/runtime/composables/_internal/useNuGridKeyboardNavigation.js +407 -0
- package/dist/runtime/composables/_internal/useNuGridPaging.d.ts +76 -0
- package/dist/runtime/composables/_internal/useNuGridPaging.js +147 -0
- package/dist/runtime/composables/_internal/useNuGridRowDragDrop.d.ts +68 -0
- package/dist/runtime/composables/_internal/useNuGridRowDragDrop.js +295 -0
- package/dist/runtime/composables/_internal/useNuGridRowSelection.d.ts +14 -0
- package/dist/runtime/composables/_internal/useNuGridRowSelection.js +214 -0
- package/dist/runtime/composables/_internal/useNuGridScroll.d.ts +110 -0
- package/dist/runtime/composables/_internal/useNuGridScroll.js +463 -0
- package/dist/runtime/composables/_internal/useNuGridScrollState.d.ts +32 -0
- package/dist/runtime/composables/_internal/useNuGridScrollState.js +60 -0
- package/dist/runtime/composables/_internal/useNuGridScrollbars.d.ts +24 -0
- package/dist/runtime/composables/_internal/useNuGridScrollbars.js +69 -0
- package/dist/runtime/composables/_internal/useNuGridStatePersistence.d.ts +27 -0
- package/dist/runtime/composables/_internal/useNuGridStatePersistence.js +243 -0
- package/dist/runtime/composables/_internal/useNuGridTooltip.d.ts +41 -0
- package/dist/runtime/composables/_internal/useNuGridTooltip.js +304 -0
- package/dist/runtime/composables/_internal/useNuGridUI.d.ts +3283 -0
- package/dist/runtime/composables/_internal/useNuGridUI.js +58 -0
- package/dist/runtime/composables/_internal/useNuGridVirtualization.d.ts +75 -0
- package/dist/runtime/composables/_internal/useNuGridVirtualization.js +534 -0
- package/dist/runtime/composables/_internal/useNuGridWheelSmoothing.d.ts +25 -0
- package/dist/runtime/composables/_internal/useNuGridWheelSmoothing.js +157 -0
- package/dist/runtime/composables/index.d.ts +3 -0
- package/dist/runtime/composables/index.js +2 -0
- package/dist/runtime/composables/useNuGridCellEditor.d.ts +91 -0
- package/dist/runtime/composables/useNuGridCellEditor.js +82 -0
- package/dist/runtime/composables/useNuGridCellTypeRegistry.d.ts +85 -0
- package/dist/runtime/composables/useNuGridCellTypeRegistry.js +202 -0
- package/dist/runtime/config/_internal/index.d.ts +5 -0
- package/dist/runtime/config/_internal/index.js +2 -0
- package/dist/runtime/config/_internal/options-defaults.d.ts +121 -0
- package/dist/runtime/config/_internal/options-defaults.js +121 -0
- package/dist/runtime/config/_internal/prop-utils.d.ts +54 -0
- package/dist/runtime/config/_internal/prop-utils.js +21 -0
- package/dist/runtime/config/config.d.ts +44 -0
- package/dist/runtime/config/config.js +18 -0
- package/dist/runtime/config/index.d.ts +2 -0
- package/dist/runtime/config/index.js +2 -0
- package/dist/runtime/config/presets.d.ts +15 -0
- package/dist/runtime/config/presets.js +58 -0
- package/dist/runtime/index.css +1 -0
- package/dist/runtime/index.d.ts +1 -0
- package/dist/runtime/index.js +1 -0
- package/dist/runtime/plugin.d.ts +5 -0
- package/dist/runtime/plugin.js +10 -0
- package/dist/runtime/themes/index.d.ts +56 -0
- package/dist/runtime/themes/index.js +68 -0
- package/dist/runtime/themes/nuGridTheme.d.ts +329 -0
- package/dist/runtime/themes/nuGridTheme.js +236 -0
- package/dist/runtime/themes/nuGridThemeCompact.d.ts +331 -0
- package/dist/runtime/themes/nuGridThemeCompact.js +236 -0
- package/dist/runtime/types/_internal/action-menu.d.ts +55 -0
- package/dist/runtime/types/_internal/action-menu.js +0 -0
- package/dist/runtime/types/_internal/cell-editing.d.ts +75 -0
- package/dist/runtime/types/_internal/cell-editing.js +0 -0
- package/dist/runtime/types/_internal/composable-returns.d.ts +52 -0
- package/dist/runtime/types/_internal/composable-returns.js +0 -0
- package/dist/runtime/types/_internal/config.d.ts +16 -0
- package/dist/runtime/types/_internal/config.js +0 -0
- package/dist/runtime/types/_internal/contexts/add-row.d.ts +25 -0
- package/dist/runtime/types/_internal/contexts/add-row.js +0 -0
- package/dist/runtime/types/_internal/contexts/animation.d.ts +24 -0
- package/dist/runtime/types/_internal/contexts/animation.js +0 -0
- package/dist/runtime/types/_internal/contexts/core.d.ts +24 -0
- package/dist/runtime/types/_internal/contexts/core.js +0 -0
- package/dist/runtime/types/_internal/contexts/drag.d.ts +13 -0
- package/dist/runtime/types/_internal/contexts/drag.js +0 -0
- package/dist/runtime/types/_internal/contexts/focus.d.ts +11 -0
- package/dist/runtime/types/_internal/contexts/focus.js +0 -0
- package/dist/runtime/types/_internal/contexts/grouping.d.ts +9 -0
- package/dist/runtime/types/_internal/contexts/grouping.js +0 -0
- package/dist/runtime/types/_internal/contexts/index.d.ts +15 -0
- package/dist/runtime/types/_internal/contexts/index.js +0 -0
- package/dist/runtime/types/_internal/contexts/interaction-router.d.ts +5 -0
- package/dist/runtime/types/_internal/contexts/interaction-router.js +0 -0
- package/dist/runtime/types/_internal/contexts/multi-row.d.ts +40 -0
- package/dist/runtime/types/_internal/contexts/multi-row.js +0 -0
- package/dist/runtime/types/_internal/contexts/paging.d.ts +39 -0
- package/dist/runtime/types/_internal/contexts/paging.js +0 -0
- package/dist/runtime/types/_internal/contexts/performance.d.ts +15 -0
- package/dist/runtime/types/_internal/contexts/performance.js +0 -0
- package/dist/runtime/types/_internal/contexts/resize.d.ts +12 -0
- package/dist/runtime/types/_internal/contexts/resize.js +0 -0
- package/dist/runtime/types/_internal/contexts/row-interactions.d.ts +12 -0
- package/dist/runtime/types/_internal/contexts/row-interactions.js +0 -0
- package/dist/runtime/types/_internal/contexts/scroll-state.d.ts +21 -0
- package/dist/runtime/types/_internal/contexts/scroll-state.js +0 -0
- package/dist/runtime/types/_internal/contexts/ui-config.d.ts +21 -0
- package/dist/runtime/types/_internal/contexts/ui-config.js +0 -0
- package/dist/runtime/types/_internal/contexts/virtualization.d.ts +16 -0
- package/dist/runtime/types/_internal/contexts/virtualization.js +0 -0
- package/dist/runtime/types/_internal/drag-drop.d.ts +48 -0
- package/dist/runtime/types/_internal/drag-drop.js +0 -0
- package/dist/runtime/types/_internal/focus.d.ts +68 -0
- package/dist/runtime/types/_internal/focus.js +0 -0
- package/dist/runtime/types/_internal/grouping.d.ts +48 -0
- package/dist/runtime/types/_internal/grouping.js +0 -0
- package/dist/runtime/types/_internal/index.d.ts +37 -0
- package/dist/runtime/types/_internal/index.js +2 -0
- package/dist/runtime/types/_internal/interaction-router.d.ts +176 -0
- package/dist/runtime/types/_internal/interaction-router.js +39 -0
- package/dist/runtime/types/_internal/props.d.ts +28 -0
- package/dist/runtime/types/_internal/props.js +0 -0
- package/dist/runtime/types/_internal/resize.d.ts +37 -0
- package/dist/runtime/types/_internal/resize.js +0 -0
- package/dist/runtime/types/_internal/row-interactions.d.ts +15 -0
- package/dist/runtime/types/_internal/row-interactions.js +0 -0
- package/dist/runtime/types/_internal/row-selection.d.ts +27 -0
- package/dist/runtime/types/_internal/row-selection.js +0 -0
- package/dist/runtime/types/_internal/states.d.ts +24 -0
- package/dist/runtime/types/_internal/states.js +0 -0
- package/dist/runtime/types/_internal/sticky-headers.d.ts +10 -0
- package/dist/runtime/types/_internal/sticky-headers.js +0 -0
- package/dist/runtime/types/_internal/validation.d.ts +54 -0
- package/dist/runtime/types/_internal/validation.js +0 -0
- package/dist/runtime/types/_internal/virtualization.d.ts +114 -0
- package/dist/runtime/types/_internal/virtualization.js +0 -0
- package/dist/runtime/types/action-menu.d.ts +62 -0
- package/dist/runtime/types/action-menu.js +0 -0
- package/dist/runtime/types/autosize.d.ts +8 -0
- package/dist/runtime/types/autosize.js +0 -0
- package/dist/runtime/types/cells.d.ts +292 -0
- package/dist/runtime/types/cells.js +5 -0
- package/dist/runtime/types/column.d.ts +248 -0
- package/dist/runtime/types/column.js +0 -0
- package/dist/runtime/types/config.d.ts +35 -0
- package/dist/runtime/types/config.js +0 -0
- package/dist/runtime/types/drag-drop.d.ts +92 -0
- package/dist/runtime/types/drag-drop.js +0 -0
- package/dist/runtime/types/events.d.ts +164 -0
- package/dist/runtime/types/events.js +1 -0
- package/dist/runtime/types/focus.d.ts +50 -0
- package/dist/runtime/types/focus.js +0 -0
- package/dist/runtime/types/grouping.d.ts +7 -0
- package/dist/runtime/types/grouping.js +0 -0
- package/dist/runtime/types/index.d.ts +15 -0
- package/dist/runtime/types/index.js +0 -0
- package/dist/runtime/types/option-groups.d.ts +624 -0
- package/dist/runtime/types/option-groups.js +0 -0
- package/dist/runtime/types/props.d.ts +418 -0
- package/dist/runtime/types/props.js +0 -0
- package/dist/runtime/types/resize.d.ts +14 -0
- package/dist/runtime/types/resize.js +0 -0
- package/dist/runtime/types/row-interactions.d.ts +11 -0
- package/dist/runtime/types/row-interactions.js +0 -0
- package/dist/runtime/types/row-selection.d.ts +48 -0
- package/dist/runtime/types/row-selection.js +0 -0
- package/dist/runtime/types/row.d.ts +7 -0
- package/dist/runtime/types/row.js +0 -0
- package/dist/runtime/types/sort-icon.d.ts +35 -0
- package/dist/runtime/types/sort-icon.js +0 -0
- package/dist/runtime/types/states.d.ts +17 -0
- package/dist/runtime/types/states.js +0 -0
- package/dist/runtime/types/sticky-headers.d.ts +6 -0
- package/dist/runtime/types/sticky-headers.js +0 -0
- package/dist/runtime/types/tanstack-table.d.ts +126 -0
- package/dist/runtime/types/theme.d.ts +22 -0
- package/dist/runtime/types/theme.js +0 -0
- package/dist/runtime/types/validation.d.ts +94 -0
- package/dist/runtime/types/validation.js +0 -0
- package/dist/runtime/utils/columnHelper.d.ts +208 -0
- package/dist/runtime/utils/columnHelper.js +23 -0
- package/dist/runtime/utils/excelExport.d.ts +63 -0
- package/dist/runtime/utils/excelExport.js +297 -0
- package/dist/runtime/utils/index.d.ts +2 -0
- package/dist/runtime/utils/index.js +2 -0
- package/dist/runtime/utils/standardSchema.d.ts +77 -0
- package/dist/runtime/utils/standardSchema.js +141 -0
- package/dist/types.d.mts +3 -0
- package/package.json +117 -0
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { TableData, TableSlots } from '@nuxt/ui';
|
|
2
|
+
import type { NuGridProps } from '../../types/index.js';
|
|
3
|
+
declare const __VLS_export: <T extends TableData>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_exposed?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
|
|
4
|
+
props: import("vue").PublicProps & __VLS_PrettifyLocal<NuGridProps<T>> & (typeof globalThis extends {
|
|
5
|
+
__VLS_PROPS_FALLBACK: infer P;
|
|
6
|
+
} ? P : {});
|
|
7
|
+
expose: (exposed: {}) => void;
|
|
8
|
+
attrs: any;
|
|
9
|
+
slots: TableSlots<T>;
|
|
10
|
+
emit: {};
|
|
11
|
+
}>) => import("vue").VNode & {
|
|
12
|
+
__ctx?: Awaited<typeof __VLS_setup>;
|
|
13
|
+
};
|
|
14
|
+
declare const _default: typeof __VLS_export;
|
|
15
|
+
export default _default;
|
|
16
|
+
type __VLS_PrettifyLocal<T> = (T extends any ? {
|
|
17
|
+
[K in keyof T]: T[K];
|
|
18
|
+
} : {
|
|
19
|
+
[K in keyof T as K]: T[K];
|
|
20
|
+
}) & {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { NuGridCellEditing } from '../../types/_internal/index.js';
|
|
2
|
+
interface Props {
|
|
3
|
+
cell: any;
|
|
4
|
+
row: any;
|
|
5
|
+
cellEditingFns: NuGridCellEditing<any>;
|
|
6
|
+
}
|
|
7
|
+
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>;
|
|
8
|
+
declare const _default: typeof __VLS_export;
|
|
9
|
+
export default _default;
|
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import { FlexRender } from "@tanstack/vue-table";
|
|
3
|
+
import { computed, inject, ref, resolveComponent, watch } from "vue";
|
|
4
|
+
import { nuGridCellTypeRegistry } from "../../composables/useNuGridCellTypeRegistry";
|
|
5
|
+
const props = defineProps({
|
|
6
|
+
cell: { type: null, required: true },
|
|
7
|
+
row: { type: null, required: true },
|
|
8
|
+
cellEditingFns: { type: Object, required: true }
|
|
9
|
+
});
|
|
10
|
+
const uiConfig = inject("nugrid-ui-config", null);
|
|
11
|
+
const wrapperRef = ref(null);
|
|
12
|
+
const capturedHeight = ref(null);
|
|
13
|
+
const addRowContext = inject("nugrid-add-row", null);
|
|
14
|
+
const isAddRow = computed(() => addRowContext?.isAddRowRow(props.row) ?? false);
|
|
15
|
+
const shouldHideContent = computed(() => {
|
|
16
|
+
if (!isAddRow.value) return false;
|
|
17
|
+
const columnDef = props.cell.column.columnDef;
|
|
18
|
+
return columnDef.showNew === false;
|
|
19
|
+
});
|
|
20
|
+
const isEditing = computed(
|
|
21
|
+
() => props.cellEditingFns.isEditingCell(props.row, props.cell.column.id)
|
|
22
|
+
);
|
|
23
|
+
watch(
|
|
24
|
+
isEditing,
|
|
25
|
+
(newValue, oldValue) => {
|
|
26
|
+
if (newValue && !oldValue && wrapperRef.value) {
|
|
27
|
+
capturedHeight.value = wrapperRef.value.offsetHeight;
|
|
28
|
+
} else if (!newValue && oldValue) {
|
|
29
|
+
capturedHeight.value = null;
|
|
30
|
+
}
|
|
31
|
+
},
|
|
32
|
+
{ flush: "sync" }
|
|
33
|
+
);
|
|
34
|
+
const hasOverrideCellRender = computed(
|
|
35
|
+
() => props.cell.column.columnDef.overrideCellRender === true
|
|
36
|
+
);
|
|
37
|
+
const cellDataType = computed(() => {
|
|
38
|
+
const columnDef = props.cell.column.columnDef;
|
|
39
|
+
const defined = columnDef.cellDataType;
|
|
40
|
+
if (defined && defined !== "text") return defined;
|
|
41
|
+
if (columnDef.wrapText === true) {
|
|
42
|
+
return "textarea";
|
|
43
|
+
}
|
|
44
|
+
const value = props.cell.getValue();
|
|
45
|
+
if (typeof value === "string" && value.includes("\n")) {
|
|
46
|
+
return "textarea";
|
|
47
|
+
}
|
|
48
|
+
return "text";
|
|
49
|
+
});
|
|
50
|
+
const pluginRenderer = computed(() => {
|
|
51
|
+
const type = cellDataType.value;
|
|
52
|
+
return nuGridCellTypeRegistry.getRenderer(type);
|
|
53
|
+
});
|
|
54
|
+
const shouldUsePluginRenderer = computed(() => {
|
|
55
|
+
if (isEditing.value || hasOverrideCellRender.value) return false;
|
|
56
|
+
const renderer = pluginRenderer.value;
|
|
57
|
+
return !!renderer && renderer !== void 0;
|
|
58
|
+
});
|
|
59
|
+
const resolvedComponentCache = /* @__PURE__ */ new Map();
|
|
60
|
+
const isRendererFunction = computed(() => {
|
|
61
|
+
const renderer = pluginRenderer.value;
|
|
62
|
+
if (!renderer) return false;
|
|
63
|
+
return typeof renderer === "function" && !("component" in renderer) && !("__name" in renderer);
|
|
64
|
+
});
|
|
65
|
+
const pluginRendererComponent = computed(() => {
|
|
66
|
+
if (!shouldUsePluginRenderer.value || !pluginRenderer.value || isRendererFunction.value)
|
|
67
|
+
return null;
|
|
68
|
+
const renderer = pluginRenderer.value;
|
|
69
|
+
if (typeof renderer === "string") {
|
|
70
|
+
if (!resolvedComponentCache.has(renderer)) {
|
|
71
|
+
const resolved = resolveComponent(renderer);
|
|
72
|
+
resolvedComponentCache.set(renderer, resolved);
|
|
73
|
+
return resolved;
|
|
74
|
+
}
|
|
75
|
+
return resolvedComponentCache.get(renderer);
|
|
76
|
+
} else if (typeof renderer === "object" && "component" in renderer) {
|
|
77
|
+
const component = renderer.component;
|
|
78
|
+
if (typeof component === "string") {
|
|
79
|
+
if (!resolvedComponentCache.has(component)) {
|
|
80
|
+
const resolved = resolveComponent(component);
|
|
81
|
+
resolvedComponentCache.set(component, resolved);
|
|
82
|
+
return resolved;
|
|
83
|
+
}
|
|
84
|
+
return resolvedComponentCache.get(component);
|
|
85
|
+
}
|
|
86
|
+
return component;
|
|
87
|
+
} else {
|
|
88
|
+
return renderer;
|
|
89
|
+
}
|
|
90
|
+
});
|
|
91
|
+
const pluginRendererProps = computed(() => {
|
|
92
|
+
if (!shouldUsePluginRenderer.value || !pluginRenderer.value || isRendererFunction.value) {
|
|
93
|
+
return {};
|
|
94
|
+
}
|
|
95
|
+
const renderer = pluginRenderer.value;
|
|
96
|
+
const baseProps = {
|
|
97
|
+
value: props.cell.getValue(),
|
|
98
|
+
row: props.row,
|
|
99
|
+
cell: props.cell,
|
|
100
|
+
editable: props.cellEditingFns.isCellEditable(props.row, props.cell),
|
|
101
|
+
onUpdateValue: (value) => {
|
|
102
|
+
props.cellEditingFns.stopEditing(props.row, props.cell, value);
|
|
103
|
+
}
|
|
104
|
+
};
|
|
105
|
+
if (typeof renderer === "object" && "component" in renderer && renderer.props) {
|
|
106
|
+
return { ...baseProps, ...renderer.props };
|
|
107
|
+
}
|
|
108
|
+
return baseProps;
|
|
109
|
+
});
|
|
110
|
+
const functionRendererResult = computed(() => {
|
|
111
|
+
if (!isRendererFunction.value || !pluginRenderer.value) return null;
|
|
112
|
+
const renderer = pluginRenderer.value;
|
|
113
|
+
return renderer({
|
|
114
|
+
cell: props.cell,
|
|
115
|
+
row: props.row,
|
|
116
|
+
getValue: () => props.cell.getValue(),
|
|
117
|
+
column: props.cell.column,
|
|
118
|
+
table: props.cell.table
|
|
119
|
+
});
|
|
120
|
+
});
|
|
121
|
+
const shouldWrapText = computed(() => {
|
|
122
|
+
const columnDef = props.cell.column.columnDef;
|
|
123
|
+
if (columnDef.wrapText !== void 0) {
|
|
124
|
+
return columnDef.wrapText;
|
|
125
|
+
}
|
|
126
|
+
return uiConfig?.wrapText.value ?? false;
|
|
127
|
+
});
|
|
128
|
+
const wrapperClass = computed(() => {
|
|
129
|
+
const baseClass = shouldWrapText.value ? "w-full whitespace-normal break-words" : "truncate w-full";
|
|
130
|
+
if (isEditing.value) {
|
|
131
|
+
return `${baseClass} relative`;
|
|
132
|
+
}
|
|
133
|
+
const preventSelect = props.cellEditingFns.startClicks.value === "double";
|
|
134
|
+
return preventSelect ? `${baseClass} select-none` : baseClass;
|
|
135
|
+
});
|
|
136
|
+
const wrapperStyle = computed(() => {
|
|
137
|
+
if (isEditing.value && capturedHeight.value !== null) {
|
|
138
|
+
return {
|
|
139
|
+
minHeight: `${capturedHeight.value}px`,
|
|
140
|
+
height: `${capturedHeight.value}px`,
|
|
141
|
+
display: "flex",
|
|
142
|
+
alignItems: "center"
|
|
143
|
+
};
|
|
144
|
+
}
|
|
145
|
+
return void 0;
|
|
146
|
+
});
|
|
147
|
+
const editorContent = computed(() => {
|
|
148
|
+
const _focus = props.cellEditingFns.shouldFocusEditor.value;
|
|
149
|
+
const _showErrors = props.cellEditingFns.showValidationErrors.value;
|
|
150
|
+
return props.cellEditingFns.renderCellContent(props.cell, props.row);
|
|
151
|
+
});
|
|
152
|
+
</script>
|
|
153
|
+
|
|
154
|
+
<template>
|
|
155
|
+
<div v-if="shouldHideContent" :class="wrapperClass">
|
|
156
|
+
<span class="invisible select-none" aria-hidden="true">Aa</span>
|
|
157
|
+
</div>
|
|
158
|
+
<!-- Editing mode: textarea needs overlay for popout, others render inline -->
|
|
159
|
+
<div
|
|
160
|
+
v-else-if="isEditing && cellDataType === 'textarea'"
|
|
161
|
+
ref="wrapperRef"
|
|
162
|
+
:class="wrapperClass"
|
|
163
|
+
:style="wrapperStyle"
|
|
164
|
+
data-editing
|
|
165
|
+
>
|
|
166
|
+
<!-- Original content stays visible to maintain exact height -->
|
|
167
|
+
<component :is="functionRendererResult" v-if="shouldUsePluginRenderer && isRendererFunction" />
|
|
168
|
+
<component
|
|
169
|
+
:is="pluginRendererComponent"
|
|
170
|
+
v-else-if="shouldUsePluginRenderer && pluginRendererComponent"
|
|
171
|
+
v-bind="pluginRendererProps"
|
|
172
|
+
/>
|
|
173
|
+
<FlexRender v-else :render="cell.column.columnDef.cell" :props="cell.getContext()" />
|
|
174
|
+
<!-- Textarea overlay expands beyond cell -->
|
|
175
|
+
<div class="absolute inset-0 -mx-2.5 -my-2">
|
|
176
|
+
<component :is="editorContent" />
|
|
177
|
+
</div>
|
|
178
|
+
</div>
|
|
179
|
+
<!-- Regular editors render inline without overlay, negative margin compensates for input border/padding -->
|
|
180
|
+
<div
|
|
181
|
+
v-else-if="isEditing"
|
|
182
|
+
ref="wrapperRef"
|
|
183
|
+
class="-ml-3 w-full"
|
|
184
|
+
:style="wrapperStyle"
|
|
185
|
+
data-editing
|
|
186
|
+
>
|
|
187
|
+
<component :is="editorContent" />
|
|
188
|
+
</div>
|
|
189
|
+
<!-- Display mode: tooltip handled by grid-level event delegation -->
|
|
190
|
+
<div v-else ref="wrapperRef" :class="wrapperClass" :style="wrapperStyle">
|
|
191
|
+
<!-- Function-based renderer -->
|
|
192
|
+
<component :is="functionRendererResult" v-if="shouldUsePluginRenderer && isRendererFunction" />
|
|
193
|
+
<!-- Component-based plugin renderer -->
|
|
194
|
+
<component
|
|
195
|
+
:is="pluginRendererComponent"
|
|
196
|
+
v-else-if="shouldUsePluginRenderer && pluginRendererComponent"
|
|
197
|
+
v-bind="pluginRendererProps"
|
|
198
|
+
/>
|
|
199
|
+
<!-- Display mode - render custom or default cell content -->
|
|
200
|
+
<FlexRender v-else :render="cell.column.columnDef.cell" :props="cell.getContext()" />
|
|
201
|
+
</div>
|
|
202
|
+
</template>
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { NuGridCellEditing } from '../../types/_internal/index.js';
|
|
2
|
+
interface Props {
|
|
3
|
+
cell: any;
|
|
4
|
+
row: any;
|
|
5
|
+
cellEditingFns: NuGridCellEditing<any>;
|
|
6
|
+
}
|
|
7
|
+
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>;
|
|
8
|
+
declare const _default: typeof __VLS_export;
|
|
9
|
+
export default _default;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { TableData } from '@nuxt/ui';
|
|
2
|
+
import type { Header } from '@tanstack/vue-table';
|
|
3
|
+
declare const __VLS_export: <T extends TableData>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_exposed?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
|
|
4
|
+
props: import("vue").PublicProps & __VLS_PrettifyLocal<{
|
|
5
|
+
/**
|
|
6
|
+
* The TanStack Table header object
|
|
7
|
+
*/
|
|
8
|
+
header: Header<any, unknown>;
|
|
9
|
+
}> & (typeof globalThis extends {
|
|
10
|
+
__VLS_PROPS_FALLBACK: infer P;
|
|
11
|
+
} ? P : {});
|
|
12
|
+
expose: (exposed: {}) => void;
|
|
13
|
+
attrs: any;
|
|
14
|
+
slots: {};
|
|
15
|
+
emit: {};
|
|
16
|
+
}>) => import("vue").VNode & {
|
|
17
|
+
__ctx?: Awaited<typeof __VLS_setup>;
|
|
18
|
+
};
|
|
19
|
+
declare const _default: typeof __VLS_export;
|
|
20
|
+
export default _default;
|
|
21
|
+
type __VLS_PrettifyLocal<T> = (T extends any ? {
|
|
22
|
+
[K in keyof T]: T[K];
|
|
23
|
+
} : {
|
|
24
|
+
[K in keyof T as K]: T[K];
|
|
25
|
+
}) & {};
|
|
@@ -0,0 +1,391 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import { computed, inject, ref, resolveComponent, watch } from "vue";
|
|
3
|
+
import { nuGridCellTypeRegistry } from "../../composables/useNuGridCellTypeRegistry";
|
|
4
|
+
import { nuGridDefaults } from "../../config/_internal";
|
|
5
|
+
defineOptions({ inheritAttrs: false });
|
|
6
|
+
const props = defineProps({
|
|
7
|
+
header: { type: Object, required: true }
|
|
8
|
+
});
|
|
9
|
+
const coreContext = inject("nugrid-core");
|
|
10
|
+
const performanceContext = inject("nugrid-performance");
|
|
11
|
+
const uiConfigContext = inject("nugrid-ui-config");
|
|
12
|
+
if (!coreContext || !performanceContext || !uiConfigContext) {
|
|
13
|
+
throw new Error("NuGridColumnMenu must be used within a NuGrid component.");
|
|
14
|
+
}
|
|
15
|
+
const { tableApi } = coreContext;
|
|
16
|
+
const { allLeafColumns } = performanceContext;
|
|
17
|
+
const { getColumnMenuItems, showColumnVisibility, columnMenuButton } = uiConfigContext;
|
|
18
|
+
const pinColumn = (columnId, side) => {
|
|
19
|
+
if (!tableApi) return;
|
|
20
|
+
const currentPinning = tableApi.getState().columnPinning;
|
|
21
|
+
const newPinning = { ...currentPinning };
|
|
22
|
+
const oppositeSide = side === "left" ? "right" : "left";
|
|
23
|
+
if (newPinning[oppositeSide]) {
|
|
24
|
+
newPinning[oppositeSide] = newPinning[oppositeSide].filter((id) => id !== columnId);
|
|
25
|
+
}
|
|
26
|
+
if (!newPinning[side]) {
|
|
27
|
+
newPinning[side] = [];
|
|
28
|
+
}
|
|
29
|
+
if (!newPinning[side].includes(columnId)) {
|
|
30
|
+
newPinning[side] = [...newPinning[side], columnId];
|
|
31
|
+
}
|
|
32
|
+
tableApi.setColumnPinning(newPinning);
|
|
33
|
+
};
|
|
34
|
+
const unpinColumn = (columnId) => {
|
|
35
|
+
if (!tableApi) return;
|
|
36
|
+
const currentPinning = tableApi.getState().columnPinning;
|
|
37
|
+
const newPinning = {
|
|
38
|
+
left: currentPinning.left?.filter((id) => id !== columnId) || [],
|
|
39
|
+
right: currentPinning.right?.filter((id) => id !== columnId) || []
|
|
40
|
+
};
|
|
41
|
+
tableApi.setColumnPinning(newPinning);
|
|
42
|
+
};
|
|
43
|
+
const getIsPinned = (columnId) => {
|
|
44
|
+
if (!tableApi) return false;
|
|
45
|
+
const pinning = tableApi.getState().columnPinning;
|
|
46
|
+
if (pinning.left?.includes(columnId)) return "left";
|
|
47
|
+
if (pinning.right?.includes(columnId)) return "right";
|
|
48
|
+
return false;
|
|
49
|
+
};
|
|
50
|
+
const menuOpen = ref(false);
|
|
51
|
+
const filterPopoverOpen = ref(false);
|
|
52
|
+
const column = computed(() => props.header.column);
|
|
53
|
+
const isColumnMenuEnabled = computed(() => {
|
|
54
|
+
const colDef = column.value.columnDef;
|
|
55
|
+
return colDef.enableColumnMenu !== false;
|
|
56
|
+
});
|
|
57
|
+
const isSpecialColumn = computed(() => {
|
|
58
|
+
const columnId = column.value.id;
|
|
59
|
+
return columnId === "__selection" || columnId === "__actions" || !isColumnMenuEnabled.value;
|
|
60
|
+
});
|
|
61
|
+
const sortState = computed(() => column.value.getIsSorted());
|
|
62
|
+
const canSort = computed(() => column.value.getCanSort());
|
|
63
|
+
const canFilter = computed(() => column.value.getCanFilter());
|
|
64
|
+
const isFiltered = computed(() => {
|
|
65
|
+
const filterValue = column.value.getFilterValue();
|
|
66
|
+
return filterValue !== void 0 && filterValue !== null && filterValue !== "";
|
|
67
|
+
});
|
|
68
|
+
const isPinned = computed(() => {
|
|
69
|
+
return getIsPinned(column.value.id);
|
|
70
|
+
});
|
|
71
|
+
const canResize = computed(() => column.value.getCanResize());
|
|
72
|
+
const hasCustomSize = computed(() => {
|
|
73
|
+
const currentSize = column.value.getSize();
|
|
74
|
+
const defaultSize = column.value.columnDef.size ?? 150;
|
|
75
|
+
return currentSize !== defaultSize;
|
|
76
|
+
});
|
|
77
|
+
const buttonConfig = computed(() => ({
|
|
78
|
+
icon: columnMenuButton.value?.icon ?? nuGridDefaults.columnDefaults.menu.button.icon,
|
|
79
|
+
color: columnMenuButton.value?.color ?? nuGridDefaults.columnDefaults.menu.button.color,
|
|
80
|
+
variant: columnMenuButton.value?.variant ?? nuGridDefaults.columnDefaults.menu.button.variant
|
|
81
|
+
}));
|
|
82
|
+
function buildDefaultMenuItems() {
|
|
83
|
+
const items = [];
|
|
84
|
+
let needsSeparator = false;
|
|
85
|
+
const addSeparatorIfNeeded = () => {
|
|
86
|
+
if (needsSeparator && items.length > 0) {
|
|
87
|
+
items.push({ type: "separator" });
|
|
88
|
+
needsSeparator = false;
|
|
89
|
+
}
|
|
90
|
+
};
|
|
91
|
+
if (canSort.value) {
|
|
92
|
+
addSeparatorIfNeeded();
|
|
93
|
+
if (sortState.value !== "asc") {
|
|
94
|
+
items.push({
|
|
95
|
+
label: "Sort Ascending",
|
|
96
|
+
icon: "i-lucide-arrow-up",
|
|
97
|
+
onSelect: (_event, _col) => {
|
|
98
|
+
column.value.toggleSorting(false, false);
|
|
99
|
+
}
|
|
100
|
+
});
|
|
101
|
+
}
|
|
102
|
+
if (sortState.value !== "desc") {
|
|
103
|
+
items.push({
|
|
104
|
+
label: "Sort Descending",
|
|
105
|
+
icon: "i-lucide-arrow-down",
|
|
106
|
+
onSelect: (_event, _col) => {
|
|
107
|
+
column.value.toggleSorting(true, false);
|
|
108
|
+
}
|
|
109
|
+
});
|
|
110
|
+
}
|
|
111
|
+
if (sortState.value) {
|
|
112
|
+
items.push({
|
|
113
|
+
label: "Clear Sort",
|
|
114
|
+
icon: "i-lucide-x",
|
|
115
|
+
onSelect: (_event, _col) => {
|
|
116
|
+
column.value.clearSorting();
|
|
117
|
+
}
|
|
118
|
+
});
|
|
119
|
+
}
|
|
120
|
+
needsSeparator = true;
|
|
121
|
+
}
|
|
122
|
+
if (canFilter.value) {
|
|
123
|
+
const colDef = column.value.columnDef;
|
|
124
|
+
const cellDataType = colDef.cellDataType || "text";
|
|
125
|
+
const plugin = nuGridCellTypeRegistry.get(cellDataType);
|
|
126
|
+
const isFilteringEnabled = plugin?.enableFiltering !== false && !!plugin?.filter;
|
|
127
|
+
if (isFilteringEnabled) {
|
|
128
|
+
addSeparatorIfNeeded();
|
|
129
|
+
items.push({
|
|
130
|
+
label: isFiltered.value ? "Filter Active" : "Filter",
|
|
131
|
+
icon: isFiltered.value ? "i-lucide-filter" : "i-lucide-filter",
|
|
132
|
+
onSelect: (_event, _col) => {
|
|
133
|
+
filterPopoverOpen.value = !filterPopoverOpen.value;
|
|
134
|
+
}
|
|
135
|
+
});
|
|
136
|
+
needsSeparator = true;
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
if (tableApi) {
|
|
140
|
+
const pinSide = isPinned.value;
|
|
141
|
+
let hasAddedPinningItem = false;
|
|
142
|
+
addSeparatorIfNeeded();
|
|
143
|
+
if (pinSide !== "left") {
|
|
144
|
+
items.push({
|
|
145
|
+
label: "Pin Left",
|
|
146
|
+
icon: "i-lucide-arrow-left-to-line",
|
|
147
|
+
onSelect: (_event, _col) => {
|
|
148
|
+
pinColumn(column.value.id, "left");
|
|
149
|
+
}
|
|
150
|
+
});
|
|
151
|
+
hasAddedPinningItem = true;
|
|
152
|
+
}
|
|
153
|
+
if (pinSide !== "right") {
|
|
154
|
+
items.push({
|
|
155
|
+
label: "Pin Right",
|
|
156
|
+
icon: "i-lucide-arrow-right-to-line",
|
|
157
|
+
onSelect: (_event, _col) => {
|
|
158
|
+
pinColumn(column.value.id, "right");
|
|
159
|
+
}
|
|
160
|
+
});
|
|
161
|
+
hasAddedPinningItem = true;
|
|
162
|
+
}
|
|
163
|
+
if (pinSide) {
|
|
164
|
+
items.push({
|
|
165
|
+
label: "Unpin",
|
|
166
|
+
icon: "i-lucide-pin-off",
|
|
167
|
+
onSelect: (_event, _col) => {
|
|
168
|
+
unpinColumn(column.value.id);
|
|
169
|
+
}
|
|
170
|
+
});
|
|
171
|
+
hasAddedPinningItem = true;
|
|
172
|
+
}
|
|
173
|
+
if (hasAddedPinningItem) {
|
|
174
|
+
needsSeparator = true;
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
if (canResize.value) {
|
|
178
|
+
addSeparatorIfNeeded();
|
|
179
|
+
items.push({
|
|
180
|
+
label: "Autosize Column",
|
|
181
|
+
icon: "i-lucide-maximize-2",
|
|
182
|
+
onSelect: (_event, _col) => {
|
|
183
|
+
const columnId = column.value.id;
|
|
184
|
+
if (tableApi) {
|
|
185
|
+
const headerGroups = tableApi.getHeaderGroups();
|
|
186
|
+
const header = headerGroups.flatMap((hg) => hg.headers).find((h) => h.column.id === columnId);
|
|
187
|
+
if (header) {
|
|
188
|
+
const headerText = typeof header.column.columnDef.header === "string" ? header.column.columnDef.header : columnId;
|
|
189
|
+
const measureDiv = document.createElement("div");
|
|
190
|
+
measureDiv.style.cssText = "position: absolute; visibility: hidden; height: auto; width: auto; white-space: nowrap; font-size: 14px; font-weight: 600;";
|
|
191
|
+
document.body.appendChild(measureDiv);
|
|
192
|
+
measureDiv.textContent = headerText;
|
|
193
|
+
const measuredWidth = Math.max(measureDiv.offsetWidth + 64, 100);
|
|
194
|
+
document.body.removeChild(measureDiv);
|
|
195
|
+
tableApi.setColumnSizing((old) => ({
|
|
196
|
+
...old,
|
|
197
|
+
[columnId]: measuredWidth
|
|
198
|
+
}));
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
});
|
|
203
|
+
needsSeparator = true;
|
|
204
|
+
}
|
|
205
|
+
if (canResize.value && hasCustomSize.value) {
|
|
206
|
+
addSeparatorIfNeeded();
|
|
207
|
+
items.push({
|
|
208
|
+
label: "Reset Column Size",
|
|
209
|
+
icon: "i-lucide-rotate-ccw",
|
|
210
|
+
onSelect: (_event, _col) => {
|
|
211
|
+
const columnId = column.value.id;
|
|
212
|
+
const defaultSize = column.value.columnDef.size ?? 150;
|
|
213
|
+
tableApi?.setColumnSizing((old) => ({
|
|
214
|
+
...old,
|
|
215
|
+
[columnId]: defaultSize
|
|
216
|
+
}));
|
|
217
|
+
}
|
|
218
|
+
});
|
|
219
|
+
needsSeparator = true;
|
|
220
|
+
}
|
|
221
|
+
return items;
|
|
222
|
+
}
|
|
223
|
+
function convertToDropdownMenuItem(item, col) {
|
|
224
|
+
if (item.type === "separator" || item.type === "label") {
|
|
225
|
+
return item;
|
|
226
|
+
}
|
|
227
|
+
const dropdownItem = { ...item };
|
|
228
|
+
if (item.children) {
|
|
229
|
+
dropdownItem.children = item.children.map((child) => convertToDropdownMenuItem(child, col));
|
|
230
|
+
}
|
|
231
|
+
if (item.onSelect) {
|
|
232
|
+
dropdownItem.onSelect = (event) => {
|
|
233
|
+
return item.onSelect(event, col);
|
|
234
|
+
};
|
|
235
|
+
}
|
|
236
|
+
return dropdownItem;
|
|
237
|
+
}
|
|
238
|
+
function processMenuItems(items, _col) {
|
|
239
|
+
return items;
|
|
240
|
+
}
|
|
241
|
+
const menuItems = computed(() => {
|
|
242
|
+
let defaultItems = buildDefaultMenuItems();
|
|
243
|
+
const colDef = column.value.columnDef;
|
|
244
|
+
const cellDataType = colDef.cellDataType || "text";
|
|
245
|
+
const plugin = nuGridCellTypeRegistry.get(cellDataType);
|
|
246
|
+
const pluginMenuItemsCallback = plugin?.columnMenuItems;
|
|
247
|
+
if (pluginMenuItemsCallback) {
|
|
248
|
+
const callback = pluginMenuItemsCallback;
|
|
249
|
+
defaultItems = callback(defaultItems, column.value);
|
|
250
|
+
}
|
|
251
|
+
let finalItems = defaultItems;
|
|
252
|
+
if (colDef.columnMenuItems) {
|
|
253
|
+
if (typeof colDef.columnMenuItems === "function") {
|
|
254
|
+
finalItems = colDef.columnMenuItems.length === 2 ? colDef.columnMenuItems(defaultItems, column.value) : colDef.columnMenuItems(defaultItems);
|
|
255
|
+
} else {
|
|
256
|
+
finalItems = colDef.columnMenuItems;
|
|
257
|
+
}
|
|
258
|
+
finalItems = processMenuItems(finalItems, column.value);
|
|
259
|
+
} else if (getColumnMenuItems?.value) {
|
|
260
|
+
finalItems = getColumnMenuItems.value(defaultItems, column.value);
|
|
261
|
+
finalItems = processMenuItems(finalItems, column.value);
|
|
262
|
+
}
|
|
263
|
+
const columnShowVisibility = colDef.showColumnVisibility ?? showColumnVisibility.value;
|
|
264
|
+
const chooserItems = [];
|
|
265
|
+
if (columnShowVisibility) {
|
|
266
|
+
const visibleColumns = allLeafColumns.value.filter((col) => col.getCanHide());
|
|
267
|
+
if (visibleColumns.length > 0) {
|
|
268
|
+
chooserItems.push({
|
|
269
|
+
label: "Column Visibility",
|
|
270
|
+
icon: "i-lucide-eye",
|
|
271
|
+
children: visibleColumns.map(
|
|
272
|
+
(col) => ({
|
|
273
|
+
label: typeof col.columnDef.header === "string" ? col.columnDef.header : col.id,
|
|
274
|
+
type: "checkbox",
|
|
275
|
+
checked: col.getIsVisible(),
|
|
276
|
+
onUpdateChecked: (checked) => {
|
|
277
|
+
col.toggleVisibility(!!checked);
|
|
278
|
+
},
|
|
279
|
+
onSelect: (_event, _column) => {
|
|
280
|
+
}
|
|
281
|
+
})
|
|
282
|
+
)
|
|
283
|
+
});
|
|
284
|
+
}
|
|
285
|
+
}
|
|
286
|
+
const convertedFinalItems = finalItems.map(
|
|
287
|
+
(item) => convertToDropdownMenuItem(item, column.value)
|
|
288
|
+
);
|
|
289
|
+
const convertedChooserItems = chooserItems.map(
|
|
290
|
+
(item) => convertToDropdownMenuItem(item, column.value)
|
|
291
|
+
);
|
|
292
|
+
const sections = [];
|
|
293
|
+
if (convertedFinalItems.length > 0) {
|
|
294
|
+
sections.push(convertedFinalItems);
|
|
295
|
+
}
|
|
296
|
+
if (convertedChooserItems.length > 0) {
|
|
297
|
+
sections.push(convertedChooserItems);
|
|
298
|
+
}
|
|
299
|
+
return sections.length > 0 ? sections : [];
|
|
300
|
+
});
|
|
301
|
+
const shouldShowMenu = computed(() => !isSpecialColumn.value && menuItems.value.length > 0);
|
|
302
|
+
const filterValueRef = ref(null);
|
|
303
|
+
const filterContext = computed(() => {
|
|
304
|
+
if (!canFilter.value) return null;
|
|
305
|
+
const colDef = column.value.columnDef;
|
|
306
|
+
const cellDataType = colDef.cellDataType || "text";
|
|
307
|
+
const plugin = nuGridCellTypeRegistry.get(cellDataType);
|
|
308
|
+
if (!plugin?.filter || plugin.enableFiltering === false) return null;
|
|
309
|
+
return {
|
|
310
|
+
column: column.value,
|
|
311
|
+
filterValue: filterValueRef,
|
|
312
|
+
setFilterValue: (value) => {
|
|
313
|
+
filterValueRef.value = value;
|
|
314
|
+
column.value.setFilterValue(value);
|
|
315
|
+
},
|
|
316
|
+
clearFilter: () => {
|
|
317
|
+
filterValueRef.value = null;
|
|
318
|
+
column.value.setFilterValue(void 0);
|
|
319
|
+
},
|
|
320
|
+
isFiltered: isFiltered.value,
|
|
321
|
+
table: tableApi
|
|
322
|
+
};
|
|
323
|
+
});
|
|
324
|
+
watch(
|
|
325
|
+
[filterContext, () => canFilter.value ? column.value.getFilterValue() : null],
|
|
326
|
+
([context, currentFilterValue]) => {
|
|
327
|
+
if (!context) return;
|
|
328
|
+
const colDef = column.value.columnDef;
|
|
329
|
+
const cellDataType = colDef.cellDataType || "text";
|
|
330
|
+
const plugin = nuGridCellTypeRegistry.get(cellDataType);
|
|
331
|
+
const defaultValue = plugin?.filter?.defaultValue ?? null;
|
|
332
|
+
const newValue = currentFilterValue ?? defaultValue;
|
|
333
|
+
if (filterValueRef.value !== newValue) {
|
|
334
|
+
filterValueRef.value = newValue;
|
|
335
|
+
}
|
|
336
|
+
},
|
|
337
|
+
{ immediate: true }
|
|
338
|
+
);
|
|
339
|
+
const filterComponent = computed(() => {
|
|
340
|
+
if (!filterContext.value) return null;
|
|
341
|
+
const colDef = column.value.columnDef;
|
|
342
|
+
const cellDataType = colDef.cellDataType || "text";
|
|
343
|
+
const plugin = nuGridCellTypeRegistry.get(cellDataType);
|
|
344
|
+
if (!plugin?.filter?.component) return null;
|
|
345
|
+
const component = plugin.filter.component;
|
|
346
|
+
if (typeof component === "string") {
|
|
347
|
+
return resolveComponent(component);
|
|
348
|
+
}
|
|
349
|
+
return component;
|
|
350
|
+
});
|
|
351
|
+
</script>
|
|
352
|
+
|
|
353
|
+
<template>
|
|
354
|
+
<div
|
|
355
|
+
v-if="shouldShowMenu"
|
|
356
|
+
:class="[
|
|
357
|
+
'relative z-0 flex shrink-0 items-center px-1 transition-opacity duration-200',
|
|
358
|
+
menuOpen ? 'opacity-100' : 'opacity-0 group-hover:opacity-100 focus-within:opacity-100'
|
|
359
|
+
]"
|
|
360
|
+
>
|
|
361
|
+
<UDropdownMenu
|
|
362
|
+
v-model:open="menuOpen"
|
|
363
|
+
:items="menuItems"
|
|
364
|
+
:content="{ align: 'end', collisionPadding: 8 }"
|
|
365
|
+
>
|
|
366
|
+
<UButton
|
|
367
|
+
:icon="buttonConfig.icon"
|
|
368
|
+
:color="buttonConfig.color"
|
|
369
|
+
:variant="buttonConfig.variant"
|
|
370
|
+
size="xs"
|
|
371
|
+
:square="true"
|
|
372
|
+
:class="[
|
|
373
|
+
'flex h-6 w-6 items-center justify-center p-0 text-gray-400/60 hover:text-primary-500',
|
|
374
|
+
menuOpen && 'text-primary-500'
|
|
375
|
+
]"
|
|
376
|
+
@click.stop
|
|
377
|
+
/>
|
|
378
|
+
</UDropdownMenu>
|
|
379
|
+
|
|
380
|
+
<!-- Filter popover - positioned relative to menu button -->
|
|
381
|
+
<UPopover
|
|
382
|
+
v-if="filterComponent && filterContext"
|
|
383
|
+
v-model:open="filterPopoverOpen"
|
|
384
|
+
:content="{ align: 'end' }"
|
|
385
|
+
>
|
|
386
|
+
<template #content>
|
|
387
|
+
<component :is="filterComponent" :context="filterContext" />
|
|
388
|
+
</template>
|
|
389
|
+
</UPopover>
|
|
390
|
+
</div>
|
|
391
|
+
</template>
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { TableData } from '@nuxt/ui';
|
|
2
|
+
import type { Header } from '@tanstack/vue-table';
|
|
3
|
+
declare const __VLS_export: <T extends TableData>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_exposed?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
|
|
4
|
+
props: import("vue").PublicProps & __VLS_PrettifyLocal<{
|
|
5
|
+
/**
|
|
6
|
+
* The TanStack Table header object
|
|
7
|
+
*/
|
|
8
|
+
header: Header<any, unknown>;
|
|
9
|
+
}> & (typeof globalThis extends {
|
|
10
|
+
__VLS_PROPS_FALLBACK: infer P;
|
|
11
|
+
} ? P : {});
|
|
12
|
+
expose: (exposed: {}) => void;
|
|
13
|
+
attrs: any;
|
|
14
|
+
slots: {};
|
|
15
|
+
emit: {};
|
|
16
|
+
}>) => import("vue").VNode & {
|
|
17
|
+
__ctx?: Awaited<typeof __VLS_setup>;
|
|
18
|
+
};
|
|
19
|
+
declare const _default: typeof __VLS_export;
|
|
20
|
+
export default _default;
|
|
21
|
+
type __VLS_PrettifyLocal<T> = (T extends any ? {
|
|
22
|
+
[K in keyof T]: T[K];
|
|
23
|
+
} : {
|
|
24
|
+
[K in keyof T as K]: T[K];
|
|
25
|
+
}) & {};
|