@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,645 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import { inject } from "vue";
|
|
3
|
+
import { resolveStyleObject, resolveValue } from "../../composables/_internal";
|
|
4
|
+
import NuGridCellContent from "./NuGridCellContent.vue";
|
|
5
|
+
const props = defineProps({
|
|
6
|
+
row: { type: Object, required: true },
|
|
7
|
+
style: { type: Object, required: false },
|
|
8
|
+
minHeight: { type: Number, required: false },
|
|
9
|
+
dataIndex: { type: Number, required: false },
|
|
10
|
+
measureRef: { type: Function, required: false }
|
|
11
|
+
});
|
|
12
|
+
const slots = defineSlots();
|
|
13
|
+
const coreContext = inject("nugrid-core");
|
|
14
|
+
const dragContext = inject("nugrid-drag");
|
|
15
|
+
const focusContext = inject("nugrid-focus");
|
|
16
|
+
const performanceContext = inject("nugrid-performance");
|
|
17
|
+
const rowInteractionsContext = inject("nugrid-row-interactions");
|
|
18
|
+
const interactionRouterContext = inject(
|
|
19
|
+
"nugrid-interaction-router"
|
|
20
|
+
);
|
|
21
|
+
const multiRowContext = inject("nugrid-multi-row");
|
|
22
|
+
if (!coreContext || !dragContext || !focusContext || !performanceContext || !rowInteractionsContext || !interactionRouterContext) {
|
|
23
|
+
throw new Error("NuGridRow must be used within a NuGrid component.");
|
|
24
|
+
}
|
|
25
|
+
const { tableApi, ui, propsUi, rowSlot } = coreContext;
|
|
26
|
+
const { rowDragFns, rowDragOptions } = dragContext;
|
|
27
|
+
const { focusFns, cellEditingFns } = focusContext;
|
|
28
|
+
const { getVisibleCells, shouldHaveBorder } = performanceContext;
|
|
29
|
+
const { rowInteractions } = rowInteractionsContext;
|
|
30
|
+
const { interactionRouter } = interactionRouterContext;
|
|
31
|
+
const { onRowSelect, onRowHover, onRowContextmenu } = rowInteractions;
|
|
32
|
+
const tdClassCache = /* @__PURE__ */ new Map();
|
|
33
|
+
function getTdCacheKey(variants) {
|
|
34
|
+
return `${variants.pinned ? 1 : 0}|${variants.hasLeftBorder ? 1 : 0}|${variants.hasRightBorder ? 1 : 0}|${variants.focusCell ? 1 : 0}|${variants.focusRow ? 1 : 0}|${variants.activeRow ? 1 : 0}|${variants.gridFocused ? 1 : 0}|${variants.rowInvalid ? 1 : 0}|${variants.customClass || ""}`;
|
|
35
|
+
}
|
|
36
|
+
function getMemoizedTdClass(customClass, pinned, hasLeftBorder, hasRightBorder, focusCell, focusRow, activeRow, gridFocused, rowInvalid) {
|
|
37
|
+
const cacheKey = getTdCacheKey({
|
|
38
|
+
pinned,
|
|
39
|
+
hasLeftBorder,
|
|
40
|
+
hasRightBorder,
|
|
41
|
+
focusCell,
|
|
42
|
+
focusRow,
|
|
43
|
+
activeRow,
|
|
44
|
+
gridFocused,
|
|
45
|
+
rowInvalid,
|
|
46
|
+
customClass: String(customClass || "")
|
|
47
|
+
});
|
|
48
|
+
let cached = tdClassCache.get(cacheKey);
|
|
49
|
+
if (!cached) {
|
|
50
|
+
cached = ui.value.td({
|
|
51
|
+
class: [propsUi?.value?.td, customClass],
|
|
52
|
+
pinned,
|
|
53
|
+
hasLeftBorder,
|
|
54
|
+
hasRightBorder,
|
|
55
|
+
focusCell,
|
|
56
|
+
focusRow,
|
|
57
|
+
activeRow,
|
|
58
|
+
gridFocused,
|
|
59
|
+
rowInvalid
|
|
60
|
+
});
|
|
61
|
+
if (tdClassCache.size > 500) {
|
|
62
|
+
const firstKey = tdClassCache.keys().next().value;
|
|
63
|
+
if (firstKey) tdClassCache.delete(firstKey);
|
|
64
|
+
}
|
|
65
|
+
tdClassCache.set(cacheKey, cached);
|
|
66
|
+
}
|
|
67
|
+
return cached;
|
|
68
|
+
}
|
|
69
|
+
const rowTrClass = computed(
|
|
70
|
+
() => ui.value.tr({
|
|
71
|
+
class: [propsUi?.value?.tr, resolveValue(tableApi.options.meta?.class?.tr, props.row)],
|
|
72
|
+
focusRow: !!focusFns.isFocusedRow(props.row),
|
|
73
|
+
gridFocused: focusFns.gridHasFocus.value
|
|
74
|
+
})
|
|
75
|
+
);
|
|
76
|
+
const rowMultiRowContainerClass = computed(
|
|
77
|
+
() => ui.value.multiRowContainer({
|
|
78
|
+
class: [propsUi?.value?.multiRowContainer],
|
|
79
|
+
focusMultiRow: focusFns.isFocusedRow(props.row) && focusFns.gridHasFocus.value
|
|
80
|
+
})
|
|
81
|
+
);
|
|
82
|
+
const isRowFocused = computed(() => !!focusFns.isFocusedRow(props.row));
|
|
83
|
+
const isRowActive = computed(
|
|
84
|
+
() => focusFns.isActiveRow(props.row) && !focusFns.isFocusedRow(props.row)
|
|
85
|
+
);
|
|
86
|
+
const rowHasValidationError = computed(() => cellEditingFns.hasRowValidationError(props.row.id));
|
|
87
|
+
const gridIsFocused = computed(() => focusFns.gridHasFocus.value);
|
|
88
|
+
function onRowClick(e) {
|
|
89
|
+
onRowSelect(e, props.row);
|
|
90
|
+
if (rowSlot) {
|
|
91
|
+
focusFns.onCellClick(e, props.row, 0);
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
const multiRowEnabled = computed(() => multiRowContext?.enabled.value ?? false);
|
|
95
|
+
const multiRowCount = computed(() => multiRowContext?.rowCount.value ?? 1);
|
|
96
|
+
const alignColumns = computed(() => multiRowContext?.alignColumns.value ?? false);
|
|
97
|
+
const row0Columns = computed(() => multiRowContext?.row0Columns.value ?? []);
|
|
98
|
+
const cellsByVisualRow = computed(() => {
|
|
99
|
+
const cells = getVisibleCells(props.row);
|
|
100
|
+
if (!multiRowEnabled.value || multiRowCount.value <= 1) {
|
|
101
|
+
return [cells.map((cell, idx) => ({ cell, cellIndex: idx }))];
|
|
102
|
+
}
|
|
103
|
+
const grouped = Array.from({ length: multiRowCount.value }, () => []);
|
|
104
|
+
cells.forEach((cell, cellIndex) => {
|
|
105
|
+
const rowNum = cell.column.columnDef.row ?? 0;
|
|
106
|
+
const clampedRow = Math.max(0, Math.min(rowNum, multiRowCount.value - 1));
|
|
107
|
+
grouped[clampedRow].push({ cell, cellIndex });
|
|
108
|
+
});
|
|
109
|
+
return grouped;
|
|
110
|
+
});
|
|
111
|
+
const row0Layout = computed(() => {
|
|
112
|
+
if (!alignColumns.value || !multiRowEnabled.value) return null;
|
|
113
|
+
const row0Cols = row0Columns.value;
|
|
114
|
+
if (row0Cols.length === 0) return null;
|
|
115
|
+
const grouped = cellsByVisualRow.value;
|
|
116
|
+
const row0 = grouped[0] ?? [];
|
|
117
|
+
let leftPinnedEnd = 0;
|
|
118
|
+
while (leftPinnedEnd < row0Cols.length && row0Cols[leftPinnedEnd].pinned === "left") {
|
|
119
|
+
leftPinnedEnd++;
|
|
120
|
+
}
|
|
121
|
+
const firstRightPinnedIdx = row0Cols.findIndex(
|
|
122
|
+
(col, idx) => idx >= leftPinnedEnd && col.pinned === "right"
|
|
123
|
+
);
|
|
124
|
+
const unpinnedEndIdx = firstRightPinnedIdx === -1 ? row0Cols.length : firstRightPinnedIdx;
|
|
125
|
+
const widthPrefix = [0];
|
|
126
|
+
const minWidthPrefix = [0];
|
|
127
|
+
for (let i = 0; i < row0Cols.length; i++) {
|
|
128
|
+
widthPrefix.push(widthPrefix[i] + row0Cols[i].width);
|
|
129
|
+
minWidthPrefix.push(minWidthPrefix[i] + row0Cols[i].minWidth);
|
|
130
|
+
}
|
|
131
|
+
const sumRange = (prefix, start, end) => prefix[end] - prefix[start];
|
|
132
|
+
const row0NonPinned = row0.filter(({ cell }) => !cell.column.getIsPinned());
|
|
133
|
+
const leftPinnedCells = row0.filter(({ cell }) => cell.column.getIsPinned() === "left");
|
|
134
|
+
const rightPinnedCells = row0.filter(({ cell }) => cell.column.getIsPinned() === "right");
|
|
135
|
+
return {
|
|
136
|
+
row0Cols,
|
|
137
|
+
row0NonPinned,
|
|
138
|
+
leftPinnedCells,
|
|
139
|
+
rightPinnedCells,
|
|
140
|
+
leftPinnedEnd,
|
|
141
|
+
unpinnedEndIdx,
|
|
142
|
+
widthPrefix,
|
|
143
|
+
minWidthPrefix,
|
|
144
|
+
sumRange
|
|
145
|
+
};
|
|
146
|
+
});
|
|
147
|
+
const alignedCellsByVisualRow = computed(() => {
|
|
148
|
+
if (!alignColumns.value || !multiRowEnabled.value) {
|
|
149
|
+
return null;
|
|
150
|
+
}
|
|
151
|
+
const layout = row0Layout.value;
|
|
152
|
+
if (!layout) return null;
|
|
153
|
+
const {
|
|
154
|
+
row0Cols,
|
|
155
|
+
row0NonPinned,
|
|
156
|
+
leftPinnedEnd,
|
|
157
|
+
unpinnedEndIdx,
|
|
158
|
+
widthPrefix,
|
|
159
|
+
minWidthPrefix,
|
|
160
|
+
sumRange
|
|
161
|
+
} = layout;
|
|
162
|
+
const grouped = cellsByVisualRow.value;
|
|
163
|
+
const result = [];
|
|
164
|
+
result[0] = row0NonPinned.map(({ cell, cellIndex }) => ({
|
|
165
|
+
type: "cell",
|
|
166
|
+
cell,
|
|
167
|
+
cellIndex,
|
|
168
|
+
width: cell.column.getSize(),
|
|
169
|
+
minWidth: cell.column.columnDef.minSize ?? 50,
|
|
170
|
+
pinned: false,
|
|
171
|
+
flexGrow: 1,
|
|
172
|
+
flexBasis: cell.column.getSize()
|
|
173
|
+
}));
|
|
174
|
+
for (let rowIdx = 1; rowIdx < multiRowCount.value; rowIdx++) {
|
|
175
|
+
const rowCells = grouped[rowIdx] ?? [];
|
|
176
|
+
const alignedItems = [];
|
|
177
|
+
let cellIdx = 0;
|
|
178
|
+
let currentSlotIdx = leftPinnedEnd;
|
|
179
|
+
while (cellIdx < rowCells.length && currentSlotIdx < unpinnedEndIdx) {
|
|
180
|
+
const { cell, cellIndex } = rowCells[cellIdx];
|
|
181
|
+
const span = cell.column.columnDef.span;
|
|
182
|
+
let cellFlexBasis = 0;
|
|
183
|
+
let cellMinWidth = 0;
|
|
184
|
+
let slotsToSpan = 1;
|
|
185
|
+
if (span === "*") {
|
|
186
|
+
slotsToSpan = unpinnedEndIdx - currentSlotIdx;
|
|
187
|
+
cellFlexBasis = sumRange(widthPrefix, currentSlotIdx, unpinnedEndIdx);
|
|
188
|
+
cellMinWidth = sumRange(minWidthPrefix, currentSlotIdx, unpinnedEndIdx);
|
|
189
|
+
} else if (typeof span === "number" && span > 1) {
|
|
190
|
+
slotsToSpan = Math.min(span, unpinnedEndIdx - currentSlotIdx);
|
|
191
|
+
cellFlexBasis = sumRange(widthPrefix, currentSlotIdx, currentSlotIdx + slotsToSpan);
|
|
192
|
+
cellMinWidth = sumRange(minWidthPrefix, currentSlotIdx, currentSlotIdx + slotsToSpan);
|
|
193
|
+
} else {
|
|
194
|
+
cellFlexBasis = row0Cols[currentSlotIdx].width;
|
|
195
|
+
cellMinWidth = row0Cols[currentSlotIdx].minWidth;
|
|
196
|
+
}
|
|
197
|
+
alignedItems.push({
|
|
198
|
+
type: "cell",
|
|
199
|
+
cell,
|
|
200
|
+
cellIndex,
|
|
201
|
+
minWidth: cellMinWidth,
|
|
202
|
+
pinned: false,
|
|
203
|
+
flexGrow: slotsToSpan,
|
|
204
|
+
flexBasis: cellFlexBasis
|
|
205
|
+
});
|
|
206
|
+
currentSlotIdx += slotsToSpan;
|
|
207
|
+
cellIdx++;
|
|
208
|
+
}
|
|
209
|
+
if (currentSlotIdx < unpinnedEndIdx && alignedItems.length > 0) {
|
|
210
|
+
const lastItem = alignedItems[alignedItems.length - 1];
|
|
211
|
+
const remainingSlots = unpinnedEndIdx - currentSlotIdx;
|
|
212
|
+
lastItem.flexBasis = (lastItem.flexBasis ?? 0) + sumRange(widthPrefix, currentSlotIdx, unpinnedEndIdx);
|
|
213
|
+
lastItem.flexGrow = (lastItem.flexGrow ?? 1) + remainingSlots;
|
|
214
|
+
lastItem.minWidth = (lastItem.minWidth ?? 50) + sumRange(minWidthPrefix, currentSlotIdx, unpinnedEndIdx);
|
|
215
|
+
} else if (currentSlotIdx < unpinnedEndIdx) {
|
|
216
|
+
alignedItems.push({
|
|
217
|
+
type: "filler",
|
|
218
|
+
minWidth: 50,
|
|
219
|
+
pinned: false,
|
|
220
|
+
flexGrow: unpinnedEndIdx - currentSlotIdx,
|
|
221
|
+
flexBasis: sumRange(widthPrefix, currentSlotIdx, unpinnedEndIdx)
|
|
222
|
+
});
|
|
223
|
+
}
|
|
224
|
+
result[rowIdx] = alignedItems;
|
|
225
|
+
}
|
|
226
|
+
return result;
|
|
227
|
+
});
|
|
228
|
+
const alignedLeftPinnedCells = computed(() => {
|
|
229
|
+
return row0Layout.value?.leftPinnedCells ?? [];
|
|
230
|
+
});
|
|
231
|
+
const alignedRightPinnedCells = computed(() => {
|
|
232
|
+
return row0Layout.value?.rightPinnedCells ?? [];
|
|
233
|
+
});
|
|
234
|
+
function getMultiRowPinningStyle(cell, _visualRowCells) {
|
|
235
|
+
const pinned = cell.column.getIsPinned();
|
|
236
|
+
if (!pinned) return {};
|
|
237
|
+
if (pinned === "left") {
|
|
238
|
+
return {
|
|
239
|
+
position: "sticky",
|
|
240
|
+
left: `${cell.column.getStart("left")}px`,
|
|
241
|
+
zIndex: 10
|
|
242
|
+
};
|
|
243
|
+
}
|
|
244
|
+
if (pinned === "right") {
|
|
245
|
+
return {
|
|
246
|
+
position: "sticky",
|
|
247
|
+
right: `${cell.column.getAfter("right")}px`,
|
|
248
|
+
zIndex: 10
|
|
249
|
+
};
|
|
250
|
+
}
|
|
251
|
+
return {};
|
|
252
|
+
}
|
|
253
|
+
</script>
|
|
254
|
+
|
|
255
|
+
<template>
|
|
256
|
+
<!-- Multi-row mode: wrap all visual rows in a container -->
|
|
257
|
+
<div
|
|
258
|
+
v-if="multiRowEnabled && multiRowCount > 1"
|
|
259
|
+
:ref="measureRef"
|
|
260
|
+
:data-index="dataIndex"
|
|
261
|
+
v-bind="rowDragFns.rowDragProps(row)"
|
|
262
|
+
:data-row-id="row.id"
|
|
263
|
+
:data-multi-row="true"
|
|
264
|
+
:data-selected="row.getIsSelected()"
|
|
265
|
+
:data-selectable="!!onRowSelect || !!onRowHover || !!onRowContextmenu"
|
|
266
|
+
:data-expanded="row.getIsExpanded()"
|
|
267
|
+
:data-active-row="focusFns.isActiveRow(row)"
|
|
268
|
+
:data-focused-row="focusFns.isFocusedRow(row)"
|
|
269
|
+
:tabindex="focusFns.getRowTabIndex(row)"
|
|
270
|
+
:class="rowMultiRowContainerClass"
|
|
271
|
+
:style="[
|
|
272
|
+
resolveValue(tableApi.options.meta?.style?.tr, row),
|
|
273
|
+
style,
|
|
274
|
+
minHeight ? { minHeight: `${minHeight}px` } : {}
|
|
275
|
+
]"
|
|
276
|
+
@click="onRowSelect($event, row)"
|
|
277
|
+
@pointerenter="onRowHover($event, row)"
|
|
278
|
+
@pointerleave="onRowHover($event, null)"
|
|
279
|
+
@contextmenu="onRowContextmenu($event, row)"
|
|
280
|
+
>
|
|
281
|
+
<!-- Drag handle (only shown once for the entire multi-row item) -->
|
|
282
|
+
<div
|
|
283
|
+
v-if="rowDragOptions.enabled"
|
|
284
|
+
v-bind="rowDragFns.rowDragHandleProps(row)"
|
|
285
|
+
:class="[
|
|
286
|
+
ui.rowDragHandle({ class: [propsUi?.rowDragHandle] }),
|
|
287
|
+
ui.multiRowDragHandle({ class: [propsUi?.multiRowDragHandle] })
|
|
288
|
+
]"
|
|
289
|
+
>
|
|
290
|
+
<UIcon
|
|
291
|
+
name="i-lucide-grip-vertical"
|
|
292
|
+
:class="[
|
|
293
|
+
'h-4 w-4',
|
|
294
|
+
rowDragFns.isRowDraggable(row) ? 'text-muted hover:text-default' : 'text-muted/30'
|
|
295
|
+
]"
|
|
296
|
+
/>
|
|
297
|
+
</div>
|
|
298
|
+
|
|
299
|
+
<!-- Visual rows container (non-aligned mode) -->
|
|
300
|
+
<div
|
|
301
|
+
v-if="!alignedCellsByVisualRow"
|
|
302
|
+
:class="ui.multiRowContent({ class: [propsUi?.multiRowContent] })"
|
|
303
|
+
>
|
|
304
|
+
<div
|
|
305
|
+
v-for="(visualRowCells, visualRowIndex) in cellsByVisualRow"
|
|
306
|
+
:key="visualRowIndex"
|
|
307
|
+
:data-visual-row="visualRowIndex"
|
|
308
|
+
:class="ui.visualRow({ class: [propsUi?.visualRow] })"
|
|
309
|
+
>
|
|
310
|
+
<div
|
|
311
|
+
v-for="{ cell, cellIndex } in visualRowCells"
|
|
312
|
+
:key="cell.id"
|
|
313
|
+
:data-cell-index="cellIndex"
|
|
314
|
+
:data-column-id="cell.column.id"
|
|
315
|
+
:data-pinned="cell.column.getIsPinned()"
|
|
316
|
+
:data-focused="focusFns.isFocusedCell(row, cellIndex)"
|
|
317
|
+
:data-row-invalid="cellEditingFns.hasRowValidationError(row.id)"
|
|
318
|
+
:data-cell-invalid="cellEditingFns.hasCellValidationError(row.id, cell.column.id)"
|
|
319
|
+
:tabindex="focusFns.getCellTabIndex(row, cellIndex)"
|
|
320
|
+
:class="
|
|
321
|
+
getMemoizedTdClass(
|
|
322
|
+
resolveValue(cell.column.columnDef.meta?.class?.td, cell),
|
|
323
|
+
!!cell.column.getIsPinned(),
|
|
324
|
+
shouldHaveBorder(row, cellIndex, 'left'),
|
|
325
|
+
shouldHaveBorder(row, cellIndex, 'right'),
|
|
326
|
+
!!focusFns.isFocusedCell(row, cellIndex) && !cellEditingFns.isEditingCell(row, cell.column.id),
|
|
327
|
+
false,
|
|
328
|
+
isRowActive,
|
|
329
|
+
gridIsFocused,
|
|
330
|
+
rowHasValidationError
|
|
331
|
+
)
|
|
332
|
+
"
|
|
333
|
+
:style="{
|
|
334
|
+
...resolveStyleObject(cell.column.columnDef.meta?.style?.td, cell),
|
|
335
|
+
// Pinned columns use fixed width, non-pinned use flex-grow
|
|
336
|
+
...cell.column.getIsPinned() ? {
|
|
337
|
+
width: `${cell.column.getSize()}px`,
|
|
338
|
+
minWidth: `${cell.column.getSize()}px`,
|
|
339
|
+
maxWidth: `${cell.column.getSize()}px`,
|
|
340
|
+
flexShrink: 0
|
|
341
|
+
} : {
|
|
342
|
+
flexGrow: 1,
|
|
343
|
+
flexBasis: `${cell.column.getSize()}px`,
|
|
344
|
+
minWidth: `${cell.column.columnDef.minSize ?? 50}px`
|
|
345
|
+
},
|
|
346
|
+
...getMultiRowPinningStyle(cell, visualRowCells)
|
|
347
|
+
}"
|
|
348
|
+
@click="
|
|
349
|
+
(e) => interactionRouter.routeCellClick({
|
|
350
|
+
event: e,
|
|
351
|
+
row,
|
|
352
|
+
cell,
|
|
353
|
+
cellIndex
|
|
354
|
+
})
|
|
355
|
+
"
|
|
356
|
+
@dblclick="cellEditingFns.onCellDoubleClick($event, row, cell)"
|
|
357
|
+
>
|
|
358
|
+
<slot :cell="cell" :row="row" :cell-index="cellIndex">
|
|
359
|
+
<NuGridCellContent :cell="cell" :row="row" :cell-editing-fns="cellEditingFns" />
|
|
360
|
+
</slot>
|
|
361
|
+
</div>
|
|
362
|
+
</div>
|
|
363
|
+
</div>
|
|
364
|
+
|
|
365
|
+
<!-- Aligned mode: pinned columns span all rows, content in the middle -->
|
|
366
|
+
<div v-else :class="ui.alignedLayout({ class: [propsUi?.alignedLayout] })">
|
|
367
|
+
<!-- Left-pinned cells spanning all visual rows -->
|
|
368
|
+
<div
|
|
369
|
+
v-if="alignedLeftPinnedCells.length > 0"
|
|
370
|
+
:class="ui.alignedPinnedLeft({ class: [propsUi?.alignedPinnedLeft] })"
|
|
371
|
+
>
|
|
372
|
+
<div
|
|
373
|
+
v-for="{ cell, cellIndex } in alignedLeftPinnedCells"
|
|
374
|
+
:key="cell.id"
|
|
375
|
+
:data-cell-index="cellIndex"
|
|
376
|
+
:data-column-id="cell.column.id"
|
|
377
|
+
data-pinned="left"
|
|
378
|
+
:data-focused="focusFns.isFocusedCell(row, cellIndex)"
|
|
379
|
+
:data-row-invalid="cellEditingFns.hasRowValidationError(row.id)"
|
|
380
|
+
:data-cell-invalid="cellEditingFns.hasCellValidationError(row.id, cell.column.id)"
|
|
381
|
+
:tabindex="focusFns.getCellTabIndex(row, cellIndex)"
|
|
382
|
+
:class="
|
|
383
|
+
getMemoizedTdClass(
|
|
384
|
+
resolveValue(cell.column.columnDef.meta?.class?.td, cell),
|
|
385
|
+
true,
|
|
386
|
+
shouldHaveBorder(row, cellIndex, 'left'),
|
|
387
|
+
shouldHaveBorder(row, cellIndex, 'right'),
|
|
388
|
+
!!focusFns.isFocusedCell(row, cellIndex) && !cellEditingFns.isEditingCell(row, cell.column.id),
|
|
389
|
+
false,
|
|
390
|
+
isRowActive,
|
|
391
|
+
gridIsFocused,
|
|
392
|
+
rowHasValidationError
|
|
393
|
+
)
|
|
394
|
+
"
|
|
395
|
+
:style="{
|
|
396
|
+
...resolveStyleObject(cell.column.columnDef.meta?.style?.td, cell),
|
|
397
|
+
width: `${cell.column.getSize()}px`,
|
|
398
|
+
minWidth: `${cell.column.getSize()}px`,
|
|
399
|
+
maxWidth: `${cell.column.getSize()}px`
|
|
400
|
+
}"
|
|
401
|
+
@click="
|
|
402
|
+
(e) => interactionRouter.routeCellClick({
|
|
403
|
+
event: e,
|
|
404
|
+
row,
|
|
405
|
+
cell,
|
|
406
|
+
cellIndex
|
|
407
|
+
})
|
|
408
|
+
"
|
|
409
|
+
@dblclick="cellEditingFns.onCellDoubleClick($event, row, cell)"
|
|
410
|
+
>
|
|
411
|
+
<slot :cell="cell" :row="row" :cell-index="cellIndex">
|
|
412
|
+
<NuGridCellContent :cell="cell" :row="row" :cell-editing-fns="cellEditingFns" />
|
|
413
|
+
</slot>
|
|
414
|
+
</div>
|
|
415
|
+
</div>
|
|
416
|
+
|
|
417
|
+
<!-- Non-pinned content area with visual rows -->
|
|
418
|
+
<div :class="ui.alignedContent({ class: [propsUi?.alignedContent] })">
|
|
419
|
+
<div
|
|
420
|
+
v-for="(alignedItems, visualRowIndex) in alignedCellsByVisualRow"
|
|
421
|
+
:key="visualRowIndex"
|
|
422
|
+
:data-visual-row="visualRowIndex"
|
|
423
|
+
:class="ui.visualRow({ class: [propsUi?.visualRow] })"
|
|
424
|
+
>
|
|
425
|
+
<template v-for="(item, itemIndex) in alignedItems" :key="itemIndex">
|
|
426
|
+
<!-- Cell item -->
|
|
427
|
+
<div
|
|
428
|
+
v-if="item.type === 'cell' && item.cell"
|
|
429
|
+
:data-cell-index="item.cellIndex"
|
|
430
|
+
:data-column-id="item.cell.column.id"
|
|
431
|
+
:data-focused="focusFns.isFocusedCell(row, item.cellIndex)"
|
|
432
|
+
:data-row-invalid="cellEditingFns.hasRowValidationError(row.id)"
|
|
433
|
+
:data-cell-invalid="
|
|
434
|
+
cellEditingFns.hasCellValidationError(row.id, item.cell.column.id)
|
|
435
|
+
"
|
|
436
|
+
:tabindex="focusFns.getCellTabIndex(row, item.cellIndex)"
|
|
437
|
+
:class="
|
|
438
|
+
getMemoizedTdClass(
|
|
439
|
+
resolveValue(item.cell.column.columnDef.meta?.class?.td, item.cell),
|
|
440
|
+
false,
|
|
441
|
+
shouldHaveBorder(row, item.cellIndex, 'left'),
|
|
442
|
+
shouldHaveBorder(row, item.cellIndex, 'right'),
|
|
443
|
+
!!focusFns.isFocusedCell(row, item.cellIndex) && !cellEditingFns.isEditingCell(row, item.cell.column.id),
|
|
444
|
+
false,
|
|
445
|
+
isRowActive,
|
|
446
|
+
gridIsFocused,
|
|
447
|
+
rowHasValidationError
|
|
448
|
+
)
|
|
449
|
+
"
|
|
450
|
+
:style="{
|
|
451
|
+
...resolveStyleObject(item.cell.column.columnDef.meta?.style?.td, item.cell),
|
|
452
|
+
flexGrow: item.flexGrow ?? 1,
|
|
453
|
+
flexBasis: `${item.flexBasis ?? item.width}px`,
|
|
454
|
+
minWidth: `${item.minWidth}px`
|
|
455
|
+
}"
|
|
456
|
+
@click="
|
|
457
|
+
(e) => interactionRouter.routeCellClick({
|
|
458
|
+
event: e,
|
|
459
|
+
row,
|
|
460
|
+
cell: item.cell,
|
|
461
|
+
cellIndex: item.cellIndex
|
|
462
|
+
})
|
|
463
|
+
"
|
|
464
|
+
@dblclick="cellEditingFns.onCellDoubleClick($event, row, item.cell)"
|
|
465
|
+
>
|
|
466
|
+
<slot :cell="item.cell" :row="row" :cell-index="item.cellIndex">
|
|
467
|
+
<NuGridCellContent
|
|
468
|
+
:cell="item.cell"
|
|
469
|
+
:row="row"
|
|
470
|
+
:cell-editing-fns="cellEditingFns"
|
|
471
|
+
/>
|
|
472
|
+
</slot>
|
|
473
|
+
</div>
|
|
474
|
+
|
|
475
|
+
<!-- Filler item (empty space for remaining columns) -->
|
|
476
|
+
<div
|
|
477
|
+
v-else-if="item.type === 'filler'"
|
|
478
|
+
:class="ui.alignedFiller({ class: [propsUi?.alignedFiller] })"
|
|
479
|
+
:style="{
|
|
480
|
+
flexGrow: item.flexGrow ?? 1,
|
|
481
|
+
flexBasis: `${item.flexBasis ?? item.width ?? 0}px`,
|
|
482
|
+
minWidth: `${item.minWidth}px`
|
|
483
|
+
}"
|
|
484
|
+
/>
|
|
485
|
+
</template>
|
|
486
|
+
</div>
|
|
487
|
+
</div>
|
|
488
|
+
|
|
489
|
+
<!-- Right-pinned cells spanning all visual rows -->
|
|
490
|
+
<div
|
|
491
|
+
v-if="alignedRightPinnedCells.length > 0"
|
|
492
|
+
:class="ui.alignedPinnedRight({ class: [propsUi?.alignedPinnedRight] })"
|
|
493
|
+
>
|
|
494
|
+
<div
|
|
495
|
+
v-for="{ cell, cellIndex } in alignedRightPinnedCells"
|
|
496
|
+
:key="cell.id"
|
|
497
|
+
:data-cell-index="cellIndex"
|
|
498
|
+
:data-column-id="cell.column.id"
|
|
499
|
+
data-pinned="right"
|
|
500
|
+
:data-focused="focusFns.isFocusedCell(row, cellIndex)"
|
|
501
|
+
:data-row-invalid="cellEditingFns.hasRowValidationError(row.id)"
|
|
502
|
+
:data-cell-invalid="cellEditingFns.hasCellValidationError(row.id, cell.column.id)"
|
|
503
|
+
:tabindex="focusFns.getCellTabIndex(row, cellIndex)"
|
|
504
|
+
:class="
|
|
505
|
+
getMemoizedTdClass(
|
|
506
|
+
resolveValue(cell.column.columnDef.meta?.class?.td, cell),
|
|
507
|
+
true,
|
|
508
|
+
shouldHaveBorder(row, cellIndex, 'left'),
|
|
509
|
+
shouldHaveBorder(row, cellIndex, 'right'),
|
|
510
|
+
!!focusFns.isFocusedCell(row, cellIndex) && !cellEditingFns.isEditingCell(row, cell.column.id),
|
|
511
|
+
false,
|
|
512
|
+
isRowActive,
|
|
513
|
+
gridIsFocused,
|
|
514
|
+
rowHasValidationError
|
|
515
|
+
)
|
|
516
|
+
"
|
|
517
|
+
:style="{
|
|
518
|
+
...resolveStyleObject(cell.column.columnDef.meta?.style?.td, cell),
|
|
519
|
+
width: `${cell.column.getSize()}px`,
|
|
520
|
+
minWidth: `${cell.column.getSize()}px`,
|
|
521
|
+
maxWidth: `${cell.column.getSize()}px`
|
|
522
|
+
}"
|
|
523
|
+
@click="
|
|
524
|
+
(e) => interactionRouter.routeCellClick({
|
|
525
|
+
event: e,
|
|
526
|
+
row,
|
|
527
|
+
cell,
|
|
528
|
+
cellIndex
|
|
529
|
+
})
|
|
530
|
+
"
|
|
531
|
+
@dblclick="cellEditingFns.onCellDoubleClick($event, row, cell)"
|
|
532
|
+
>
|
|
533
|
+
<slot :cell="cell" :row="row" :cell-index="cellIndex">
|
|
534
|
+
<NuGridCellContent :cell="cell" :row="row" :cell-editing-fns="cellEditingFns" />
|
|
535
|
+
</slot>
|
|
536
|
+
</div>
|
|
537
|
+
</div>
|
|
538
|
+
</div>
|
|
539
|
+
|
|
540
|
+
<!-- Expanded content for multi-row mode -->
|
|
541
|
+
<div
|
|
542
|
+
v-if="row.getIsExpanded() && !!slots.expanded"
|
|
543
|
+
:class="ui.visualRow({ class: [propsUi?.visualRow] })"
|
|
544
|
+
>
|
|
545
|
+
<div :class="ui.td({ class: [propsUi?.td] })">
|
|
546
|
+
<slot name="expanded" :row="row" />
|
|
547
|
+
</div>
|
|
548
|
+
</div>
|
|
549
|
+
</div>
|
|
550
|
+
|
|
551
|
+
<!-- Single-row mode - row element is direct child for TransitionGroup FLIP -->
|
|
552
|
+
<div
|
|
553
|
+
v-else
|
|
554
|
+
:ref="measureRef"
|
|
555
|
+
:data-index="dataIndex"
|
|
556
|
+
v-bind="rowDragFns.rowDragProps(row)"
|
|
557
|
+
:data-row-id="row.id"
|
|
558
|
+
:data-selected="row.getIsSelected()"
|
|
559
|
+
:data-selectable="!!onRowSelect || !!onRowHover || !!onRowContextmenu"
|
|
560
|
+
:data-expanded="row.getIsExpanded()"
|
|
561
|
+
:data-active-row="focusFns.isActiveRow(row)"
|
|
562
|
+
:data-focused-row="focusFns.isFocusedRow(row)"
|
|
563
|
+
:tabindex="focusFns.getRowTabIndex(row)"
|
|
564
|
+
:class="rowTrClass"
|
|
565
|
+
:style="[
|
|
566
|
+
resolveValue(tableApi.options.meta?.style?.tr, row),
|
|
567
|
+
style,
|
|
568
|
+
minHeight ? { minHeight: `${minHeight}px` } : {}
|
|
569
|
+
]"
|
|
570
|
+
@click="onRowClick"
|
|
571
|
+
@pointerenter="onRowHover($event, row)"
|
|
572
|
+
@pointerleave="onRowHover($event, null)"
|
|
573
|
+
@contextmenu="onRowContextmenu($event, row)"
|
|
574
|
+
>
|
|
575
|
+
<div
|
|
576
|
+
v-if="rowDragOptions.enabled"
|
|
577
|
+
v-bind="rowDragFns.rowDragHandleProps(row)"
|
|
578
|
+
:class="[
|
|
579
|
+
ui.rowDragHandle({ class: [propsUi?.rowDragHandle] }),
|
|
580
|
+
ui.td({ class: [propsUi?.td] })
|
|
581
|
+
]"
|
|
582
|
+
>
|
|
583
|
+
<UIcon
|
|
584
|
+
name="i-lucide-grip-vertical"
|
|
585
|
+
:class="[
|
|
586
|
+
'h-4 w-4',
|
|
587
|
+
rowDragFns.isRowDraggable(row) ? 'text-muted hover:text-default' : 'text-muted/30'
|
|
588
|
+
]"
|
|
589
|
+
/>
|
|
590
|
+
</div>
|
|
591
|
+
|
|
592
|
+
<!-- Row slot: allows user to replace entire row content -->
|
|
593
|
+
<component :is="rowSlot" v-if="rowSlot" :row="row" :cells="getVisibleCells(row)" />
|
|
594
|
+
|
|
595
|
+
<!-- Default cell rendering -->
|
|
596
|
+
<template v-else>
|
|
597
|
+
<div
|
|
598
|
+
v-for="(cell, cellIndex) in getVisibleCells(row)"
|
|
599
|
+
:key="cell.id"
|
|
600
|
+
:data-cell-index="cellIndex"
|
|
601
|
+
:data-column-id="cell.column.id"
|
|
602
|
+
:data-pinned="cell.column.getIsPinned()"
|
|
603
|
+
:data-focused="focusFns.isFocusedCell(row, cellIndex)"
|
|
604
|
+
:data-row-invalid="cellEditingFns.hasRowValidationError(row.id)"
|
|
605
|
+
:data-cell-invalid="cellEditingFns.hasCellValidationError(row.id, cell.column.id)"
|
|
606
|
+
:tabindex="focusFns.getCellTabIndex(row, cellIndex)"
|
|
607
|
+
:class="
|
|
608
|
+
getMemoizedTdClass(
|
|
609
|
+
resolveValue(cell.column.columnDef.meta?.class?.td, cell),
|
|
610
|
+
!!cell.column.getIsPinned(),
|
|
611
|
+
shouldHaveBorder(row, cellIndex, 'left'),
|
|
612
|
+
shouldHaveBorder(row, cellIndex, 'right'),
|
|
613
|
+
!!focusFns.isFocusedCell(row, cellIndex) && !cellEditingFns.isEditingCell(row, cell.column.id),
|
|
614
|
+
isRowFocused,
|
|
615
|
+
isRowActive,
|
|
616
|
+
gridIsFocused,
|
|
617
|
+
rowHasValidationError
|
|
618
|
+
)
|
|
619
|
+
"
|
|
620
|
+
:style="{
|
|
621
|
+
...resolveStyleObject(cell.column.columnDef.meta?.style?.td, cell),
|
|
622
|
+
width: `${cell.column.getSize()}px`,
|
|
623
|
+
minWidth: `${cell.column.getSize()}px`,
|
|
624
|
+
maxWidth: `${cell.column.getSize()}px`,
|
|
625
|
+
...cell.column.getIsPinned() === 'left' ? { left: `${cell.column.getStart('left')}px` } : {},
|
|
626
|
+
...cell.column.getIsPinned() === 'right' ? { right: `${cell.column.getAfter('right')}px` } : {},
|
|
627
|
+
...resolveValue(cell.column.columnDef.meta?.colspan?.td, cell) ? { flexGrow: resolveValue(cell.column.columnDef.meta?.colspan?.td, cell) } : {}
|
|
628
|
+
}"
|
|
629
|
+
@click="
|
|
630
|
+
(e) => interactionRouter.routeCellClick({
|
|
631
|
+
event: e,
|
|
632
|
+
row,
|
|
633
|
+
cell,
|
|
634
|
+
cellIndex
|
|
635
|
+
})
|
|
636
|
+
"
|
|
637
|
+
@dblclick="cellEditingFns.onCellDoubleClick($event, row, cell)"
|
|
638
|
+
>
|
|
639
|
+
<slot :cell="cell" :row="row" :cell-index="cellIndex">
|
|
640
|
+
<NuGridCellContent :cell="cell" :row="row" :cell-editing-fns="cellEditingFns" />
|
|
641
|
+
</slot>
|
|
642
|
+
</div>
|
|
643
|
+
</template>
|
|
644
|
+
</div>
|
|
645
|
+
</template>
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import type { TableData } from '@nuxt/ui';
|
|
2
|
+
import type { Cell, Row } from '@tanstack/vue-table';
|
|
3
|
+
import type { ComponentPublicInstance } from 'vue';
|
|
4
|
+
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<{
|
|
5
|
+
props: import("vue").PublicProps & __VLS_PrettifyLocal<{
|
|
6
|
+
row: Row<T>;
|
|
7
|
+
style?: Record<string, any>;
|
|
8
|
+
minHeight?: number;
|
|
9
|
+
dataIndex?: number;
|
|
10
|
+
measureRef?: (el: Element | ComponentPublicInstance | null) => void;
|
|
11
|
+
}> & (typeof globalThis extends {
|
|
12
|
+
__VLS_PROPS_FALLBACK: infer P;
|
|
13
|
+
} ? P : {});
|
|
14
|
+
expose: (exposed: {}) => void;
|
|
15
|
+
attrs: any;
|
|
16
|
+
slots: {
|
|
17
|
+
default?: (props: {
|
|
18
|
+
cell: any;
|
|
19
|
+
row: Row<T>;
|
|
20
|
+
cellIndex: number;
|
|
21
|
+
}) => any;
|
|
22
|
+
expanded?: (props: {
|
|
23
|
+
row: Row<T>;
|
|
24
|
+
}) => any;
|
|
25
|
+
row?: (props: {
|
|
26
|
+
row: Row<T>;
|
|
27
|
+
cells: Cell<T, unknown>[];
|
|
28
|
+
}) => any;
|
|
29
|
+
};
|
|
30
|
+
emit: {};
|
|
31
|
+
}>) => import("vue").VNode & {
|
|
32
|
+
__ctx?: Awaited<typeof __VLS_setup>;
|
|
33
|
+
};
|
|
34
|
+
declare const _default: typeof __VLS_export;
|
|
35
|
+
export default _default;
|
|
36
|
+
type __VLS_PrettifyLocal<T> = (T extends any ? {
|
|
37
|
+
[K in keyof T]: T[K];
|
|
38
|
+
} : {
|
|
39
|
+
[K in keyof T as K]: T[K];
|
|
40
|
+
}) & {};
|