@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,1172 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import { FlexRender } from "@tanstack/vue-table";
|
|
3
|
+
import { createReusableTemplate } from "@vueuse/core";
|
|
4
|
+
import { Primitive } from "reka-ui";
|
|
5
|
+
import { computed, inject } from "vue";
|
|
6
|
+
import {
|
|
7
|
+
getHeaderEffectivePinning,
|
|
8
|
+
getHeaderPinningStyle,
|
|
9
|
+
resolveStyleObject,
|
|
10
|
+
resolveValue
|
|
11
|
+
} from "../../composables/_internal";
|
|
12
|
+
import NuGridAddRow from "./NuGridAddRow.vue";
|
|
13
|
+
import NuGridColumnMenu from "./NuGridColumnMenu.vue";
|
|
14
|
+
import NuGridHeaderSortButton from "./NuGridHeaderSortButton.vue";
|
|
15
|
+
import NuGridRow from "./NuGridRow.vue";
|
|
16
|
+
defineOptions({ inheritAttrs: false });
|
|
17
|
+
const props = defineProps({
|
|
18
|
+
ui: { type: null, required: false },
|
|
19
|
+
preset: { type: String, required: false },
|
|
20
|
+
focus: { type: Object, required: false },
|
|
21
|
+
editing: { type: Object, required: false },
|
|
22
|
+
validation: { type: [Boolean, Object], required: false },
|
|
23
|
+
selection: { type: [Boolean, String, Object], required: false },
|
|
24
|
+
actions: { type: [Boolean, Object], required: false },
|
|
25
|
+
columnDefaults: { type: Object, required: false },
|
|
26
|
+
layout: { type: Object, required: false },
|
|
27
|
+
tooltip: { type: [Boolean, Object], required: false },
|
|
28
|
+
multiRow: { type: [Boolean, Object], required: false },
|
|
29
|
+
animation: { type: [Boolean, Object], required: false },
|
|
30
|
+
paging: { type: [Boolean, Object], required: false },
|
|
31
|
+
state: { type: [Boolean, Object], required: false },
|
|
32
|
+
theme: { type: [String, Object], required: false },
|
|
33
|
+
virtualization: { type: [Boolean, Object], required: false },
|
|
34
|
+
cellTypes: { type: Array, required: false },
|
|
35
|
+
skipAutoSizeColumns: { type: Array, required: false },
|
|
36
|
+
rowDragOptions: { type: Object, required: false },
|
|
37
|
+
rowId: { type: [String, Function], required: false },
|
|
38
|
+
addNewRow: { type: [Boolean, Object], required: false },
|
|
39
|
+
as: { type: null, required: false },
|
|
40
|
+
data: { type: Array, required: false },
|
|
41
|
+
columns: { type: Array, required: false },
|
|
42
|
+
caption: { type: String, required: false },
|
|
43
|
+
meta: { type: Object, required: false },
|
|
44
|
+
empty: { type: String, required: false },
|
|
45
|
+
sticky: { type: [Boolean, String], required: false },
|
|
46
|
+
loading: { type: Boolean, required: false },
|
|
47
|
+
loadingColor: { type: null, required: false },
|
|
48
|
+
loadingAnimation: { type: null, required: false },
|
|
49
|
+
watchOptions: { type: Object, required: false },
|
|
50
|
+
globalFilterOptions: { type: Object, required: false },
|
|
51
|
+
columnFiltersOptions: { type: Object, required: false },
|
|
52
|
+
columnPinningOptions: { type: Object, required: false },
|
|
53
|
+
columnSizingOptions: { type: Object, required: false },
|
|
54
|
+
visibilityOptions: { type: Object, required: false },
|
|
55
|
+
sortingOptions: { type: Object, required: false },
|
|
56
|
+
groupingOptions: { type: Object, required: false },
|
|
57
|
+
expandedOptions: { type: Object, required: false },
|
|
58
|
+
rowSelectionOptions: { type: Object, required: false },
|
|
59
|
+
rowPinningOptions: { type: Object, required: false },
|
|
60
|
+
paginationOptions: { type: Object, required: false },
|
|
61
|
+
facetedOptions: { type: Object, required: false },
|
|
62
|
+
onSelect: { type: Function, required: false },
|
|
63
|
+
onHover: { type: Function, required: false },
|
|
64
|
+
onContextmenu: { type: [Function, Array], required: false },
|
|
65
|
+
class: { type: null, required: false },
|
|
66
|
+
onStateChange: { type: Function, required: false },
|
|
67
|
+
renderFallbackValue: { type: null, required: false },
|
|
68
|
+
_features: { type: Array, required: false },
|
|
69
|
+
autoResetAll: { type: Boolean, required: false },
|
|
70
|
+
debugAll: { type: Boolean, required: false },
|
|
71
|
+
debugCells: { type: Boolean, required: false },
|
|
72
|
+
debugColumns: { type: Boolean, required: false },
|
|
73
|
+
debugHeaders: { type: Boolean, required: false },
|
|
74
|
+
debugRows: { type: Boolean, required: false },
|
|
75
|
+
debugTable: { type: Boolean, required: false },
|
|
76
|
+
defaultColumn: { type: Object, required: false },
|
|
77
|
+
getRowId: { type: Function, required: false },
|
|
78
|
+
getSubRows: { type: Function, required: false },
|
|
79
|
+
initialState: { type: Object, required: false },
|
|
80
|
+
mergeOptions: { type: Function, required: false }
|
|
81
|
+
});
|
|
82
|
+
const slots = defineSlots();
|
|
83
|
+
const coreContext = inject("nugrid-core");
|
|
84
|
+
const dragContext = inject("nugrid-drag");
|
|
85
|
+
const resizeContext = inject("nugrid-resize");
|
|
86
|
+
const virtualizationContext = inject("nugrid-virtualization");
|
|
87
|
+
const performanceContext = inject("nugrid-performance");
|
|
88
|
+
const uiConfigContext = inject("nugrid-ui-config");
|
|
89
|
+
const addRowContext = inject("nugrid-add-row");
|
|
90
|
+
const multiRowContext = inject("nugrid-multi-row");
|
|
91
|
+
const animationContext = inject("nugrid-animation");
|
|
92
|
+
if (!coreContext || !dragContext || !resizeContext || !virtualizationContext || !performanceContext || !uiConfigContext || !addRowContext || !animationContext) {
|
|
93
|
+
throw new Error("NuGridBase must be used within a NuGrid component.");
|
|
94
|
+
}
|
|
95
|
+
const animationEnabled = animationContext.enabled;
|
|
96
|
+
const { tableRef, rootRef, tableApi, ui, hasFooter, rows: contextRows, propsUi } = coreContext;
|
|
97
|
+
const rows = computed(() => {
|
|
98
|
+
const currentRows = contextRows.value ?? [];
|
|
99
|
+
return [...currentRows];
|
|
100
|
+
});
|
|
101
|
+
const { dragFns, rowDragOptions } = dragContext;
|
|
102
|
+
const { handleResizeStart, handleGroupResizeStart, resizingGroupId, resizingColumnId } = resizeContext;
|
|
103
|
+
const {
|
|
104
|
+
virtualizer,
|
|
105
|
+
virtualizationEnabled,
|
|
106
|
+
virtualRowItems,
|
|
107
|
+
getVirtualItemHeight,
|
|
108
|
+
stickyOffsets,
|
|
109
|
+
stickyEnabled
|
|
110
|
+
} = virtualizationContext;
|
|
111
|
+
const { headerGroups, headerGroupsLength, footerGroups } = performanceContext;
|
|
112
|
+
const {
|
|
113
|
+
sortIcons: gridSortIcons,
|
|
114
|
+
scrollbarClass,
|
|
115
|
+
scrollbarThemeClass,
|
|
116
|
+
scrollbarAttr
|
|
117
|
+
} = uiConfigContext;
|
|
118
|
+
const multiRowEnabled = computed(() => multiRowContext?.enabled.value ?? false);
|
|
119
|
+
const multiRowCount = computed(() => multiRowContext?.rowCount.value ?? 1);
|
|
120
|
+
const alignColumns = computed(() => multiRowContext?.alignColumns.value ?? false);
|
|
121
|
+
const row0Columns = computed(() => multiRowContext?.row0Columns.value ?? []);
|
|
122
|
+
const leftPinnedWidth = computed(() => {
|
|
123
|
+
if (!alignColumns.value) return 0;
|
|
124
|
+
return row0Columns.value.filter((col) => col.pinned === "left").reduce((sum, col) => sum + col.width, 0);
|
|
125
|
+
});
|
|
126
|
+
const rightPinnedWidth = computed(() => {
|
|
127
|
+
if (!alignColumns.value) return 0;
|
|
128
|
+
return row0Columns.value.filter((col) => col.pinned === "right").reduce((sum, col) => sum + col.width, 0);
|
|
129
|
+
});
|
|
130
|
+
const headersByVisualRow = computed(() => {
|
|
131
|
+
const groups = headerGroups.value;
|
|
132
|
+
if (!multiRowEnabled.value || multiRowCount.value <= 1 || groups.length === 0) {
|
|
133
|
+
return null;
|
|
134
|
+
}
|
|
135
|
+
const leafHeaderGroup = groups[groups.length - 1];
|
|
136
|
+
if (!leafHeaderGroup) return null;
|
|
137
|
+
const grouped = Array.from({ length: multiRowCount.value }, () => []);
|
|
138
|
+
leafHeaderGroup.headers.forEach((header) => {
|
|
139
|
+
const rowNum = header.column.columnDef.row ?? 0;
|
|
140
|
+
const clampedRow = Math.max(0, Math.min(rowNum, multiRowCount.value - 1));
|
|
141
|
+
if (alignColumns.value && clampedRow > 0 && header.column.getIsPinned()) {
|
|
142
|
+
return;
|
|
143
|
+
}
|
|
144
|
+
grouped[clampedRow].push(header);
|
|
145
|
+
});
|
|
146
|
+
return grouped;
|
|
147
|
+
});
|
|
148
|
+
function getMultiRowHeaderPinningStyle(header, visualRowHeaders) {
|
|
149
|
+
const pinned = header.column.getIsPinned();
|
|
150
|
+
if (!pinned) return {};
|
|
151
|
+
if (pinned === "left") {
|
|
152
|
+
let leftOffset = 0;
|
|
153
|
+
for (const h of visualRowHeaders) {
|
|
154
|
+
if (h.column.id === header.column.id) break;
|
|
155
|
+
if (h.column.getIsPinned() === "left") {
|
|
156
|
+
leftOffset += h.getSize();
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
return {
|
|
160
|
+
position: "sticky",
|
|
161
|
+
left: `${leftOffset}px`,
|
|
162
|
+
zIndex: 20
|
|
163
|
+
};
|
|
164
|
+
}
|
|
165
|
+
if (pinned === "right") {
|
|
166
|
+
let rightOffset = 0;
|
|
167
|
+
let foundSelf = false;
|
|
168
|
+
for (const h of visualRowHeaders) {
|
|
169
|
+
if (h.column.id === header.column.id) {
|
|
170
|
+
foundSelf = true;
|
|
171
|
+
continue;
|
|
172
|
+
}
|
|
173
|
+
if (foundSelf && h.column.getIsPinned() === "right") {
|
|
174
|
+
rightOffset += h.getSize();
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
return {
|
|
178
|
+
position: "sticky",
|
|
179
|
+
right: `${rightOffset}px`,
|
|
180
|
+
zIndex: 20
|
|
181
|
+
};
|
|
182
|
+
}
|
|
183
|
+
return {};
|
|
184
|
+
}
|
|
185
|
+
function getAlignedHeaderStyle(header, visualRowIndex, headerIndexInRow, totalHeadersInRow) {
|
|
186
|
+
const isPinned = header.column.getIsPinned();
|
|
187
|
+
if (isPinned) {
|
|
188
|
+
return {
|
|
189
|
+
width: `${header.getSize()}px`,
|
|
190
|
+
minWidth: `${header.getSize()}px`,
|
|
191
|
+
maxWidth: `${header.getSize()}px`,
|
|
192
|
+
flexShrink: 0
|
|
193
|
+
};
|
|
194
|
+
}
|
|
195
|
+
if (visualRowIndex === 0 || !alignColumns.value) {
|
|
196
|
+
return {
|
|
197
|
+
flexGrow: 1,
|
|
198
|
+
flexBasis: `${header.getSize()}px`,
|
|
199
|
+
minWidth: `${header.column.columnDef.minSize ?? 50}px`
|
|
200
|
+
};
|
|
201
|
+
}
|
|
202
|
+
const row0Cols = row0Columns.value;
|
|
203
|
+
let leftPinnedEnd = 0;
|
|
204
|
+
while (leftPinnedEnd < row0Cols.length && row0Cols[leftPinnedEnd]?.pinned === "left") {
|
|
205
|
+
leftPinnedEnd++;
|
|
206
|
+
}
|
|
207
|
+
const firstRightPinnedIdx = row0Cols.findIndex(
|
|
208
|
+
(col, idx) => idx >= leftPinnedEnd && col.pinned === "right"
|
|
209
|
+
);
|
|
210
|
+
const unpinnedEndIdx = firstRightPinnedIdx === -1 ? row0Cols.length : firstRightPinnedIdx;
|
|
211
|
+
const unpinnedSlots = unpinnedEndIdx - leftPinnedEnd;
|
|
212
|
+
const span = header.column.columnDef.span;
|
|
213
|
+
let slotsToSpan = 1;
|
|
214
|
+
let flexBasis = 0;
|
|
215
|
+
let minWidth = 0;
|
|
216
|
+
const isLastHeader = headerIndexInRow === totalHeadersInRow - 1;
|
|
217
|
+
if (span === "*" || isLastHeader) {
|
|
218
|
+
const remainingSlots = Math.max(1, unpinnedSlots - headerIndexInRow);
|
|
219
|
+
slotsToSpan = remainingSlots;
|
|
220
|
+
for (let i = 0; i < remainingSlots && leftPinnedEnd + headerIndexInRow + i < unpinnedEndIdx; i++) {
|
|
221
|
+
const slotIdx = leftPinnedEnd + headerIndexInRow + i;
|
|
222
|
+
if (slotIdx < row0Cols.length) {
|
|
223
|
+
flexBasis += row0Cols[slotIdx].width;
|
|
224
|
+
minWidth += row0Cols[slotIdx].minWidth;
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
} else if (typeof span === "number" && span > 1) {
|
|
228
|
+
slotsToSpan = Math.min(span, unpinnedSlots - headerIndexInRow);
|
|
229
|
+
for (let i = 0; i < slotsToSpan; i++) {
|
|
230
|
+
const slotIdx = leftPinnedEnd + headerIndexInRow + i;
|
|
231
|
+
if (slotIdx < row0Cols.length && slotIdx < unpinnedEndIdx) {
|
|
232
|
+
flexBasis += row0Cols[slotIdx].width;
|
|
233
|
+
minWidth += row0Cols[slotIdx].minWidth;
|
|
234
|
+
}
|
|
235
|
+
}
|
|
236
|
+
} else {
|
|
237
|
+
const slotIdx = leftPinnedEnd + headerIndexInRow;
|
|
238
|
+
if (slotIdx < row0Cols.length && slotIdx < unpinnedEndIdx) {
|
|
239
|
+
flexBasis = row0Cols[slotIdx].width;
|
|
240
|
+
minWidth = row0Cols[slotIdx].minWidth;
|
|
241
|
+
} else {
|
|
242
|
+
flexBasis = header.getSize();
|
|
243
|
+
minWidth = header.column.columnDef.minSize ?? 50;
|
|
244
|
+
}
|
|
245
|
+
}
|
|
246
|
+
return {
|
|
247
|
+
flexGrow: slotsToSpan,
|
|
248
|
+
flexBasis: `${flexBasis}px`,
|
|
249
|
+
minWidth: `${minWidth}px`
|
|
250
|
+
};
|
|
251
|
+
}
|
|
252
|
+
const [DefineTableTemplate, ReuseNuGridTemplate] = createReusableTemplate({ inheritAttrs: false });
|
|
253
|
+
function measureElementRef(el) {
|
|
254
|
+
if (el && virtualizer && virtualizer.value.dynamicRowHeightsEnabled.value) {
|
|
255
|
+
virtualizer.value.measureElement(el);
|
|
256
|
+
}
|
|
257
|
+
}
|
|
258
|
+
const totalTableWidth = computed(() => `${tableApi.getTotalSize()}px`);
|
|
259
|
+
function getVirtualItemStyle(type, virtualRow) {
|
|
260
|
+
if (!virtualizer) {
|
|
261
|
+
return {};
|
|
262
|
+
}
|
|
263
|
+
const useDynamicHeight = virtualizer.value.dynamicRowHeightsEnabled?.value ?? false;
|
|
264
|
+
const stickyTop = stickyOffsets.value.get(virtualRow.index);
|
|
265
|
+
const resolvedHeight = getVirtualItemHeight(virtualRow.index);
|
|
266
|
+
const width = totalTableWidth.value;
|
|
267
|
+
if (stickyEnabled.value && type === "column-headers") {
|
|
268
|
+
if (stickyTop !== void 0) {
|
|
269
|
+
return {
|
|
270
|
+
position: "sticky",
|
|
271
|
+
top: `${stickyTop}px`,
|
|
272
|
+
left: 0,
|
|
273
|
+
width,
|
|
274
|
+
zIndex: 30,
|
|
275
|
+
...useDynamicHeight ? {} : { height: `${resolvedHeight}px` },
|
|
276
|
+
backgroundColor: "var(--ui-bg)"
|
|
277
|
+
};
|
|
278
|
+
}
|
|
279
|
+
return {
|
|
280
|
+
position: "absolute",
|
|
281
|
+
top: 0,
|
|
282
|
+
width,
|
|
283
|
+
zIndex: 30,
|
|
284
|
+
...useDynamicHeight ? {} : { height: `${resolvedHeight}px` },
|
|
285
|
+
transform: `translateY(${virtualRow.start}px)`,
|
|
286
|
+
backgroundColor: "var(--ui-bg)"
|
|
287
|
+
};
|
|
288
|
+
}
|
|
289
|
+
return {
|
|
290
|
+
position: "absolute",
|
|
291
|
+
top: 0,
|
|
292
|
+
width,
|
|
293
|
+
...useDynamicHeight ? {} : { height: `${resolvedHeight}px` },
|
|
294
|
+
transform: `translateY(${virtualRow.start}px)`
|
|
295
|
+
};
|
|
296
|
+
}
|
|
297
|
+
</script>
|
|
298
|
+
|
|
299
|
+
<template>
|
|
300
|
+
<Primitive
|
|
301
|
+
ref="rootRef"
|
|
302
|
+
:as="as"
|
|
303
|
+
:class="[ui.root({ class: [propsUi?.root, props.class] }), scrollbarThemeClass, scrollbarClass]"
|
|
304
|
+
:style="{
|
|
305
|
+
'--nugrid-animation-duration': animationEnabled ? `${animationContext.duration.value}ms` : void 0,
|
|
306
|
+
'--nugrid-animation-easing': animationEnabled ? animationContext.easing.value : void 0
|
|
307
|
+
}"
|
|
308
|
+
:data-scrollbars="scrollbarAttr"
|
|
309
|
+
>
|
|
310
|
+
<DefineTableTemplate>
|
|
311
|
+
<div ref="tableRef" :class="ui.base({ class: [propsUi?.base] })">
|
|
312
|
+
<div v-if="caption || !!slots.caption" :class="ui.caption({ class: [propsUi?.caption] })">
|
|
313
|
+
<slot name="caption">
|
|
314
|
+
{{ caption }}
|
|
315
|
+
</slot>
|
|
316
|
+
</div>
|
|
317
|
+
|
|
318
|
+
<!-- Multi-row headers: render headers grouped by visual row -->
|
|
319
|
+
<div
|
|
320
|
+
v-if="!virtualizationEnabled && multiRowEnabled && headersByVisualRow"
|
|
321
|
+
:class="[
|
|
322
|
+
ui.thead({ class: [propsUi?.thead] }),
|
|
323
|
+
stickyEnabled ? ui.stickyColumnHeader({ class: [propsUi?.stickyColumnHeader] }) : {}
|
|
324
|
+
]"
|
|
325
|
+
:data-sticky-header="stickyEnabled ? 'true' : void 0"
|
|
326
|
+
data-multi-row-headers="true"
|
|
327
|
+
>
|
|
328
|
+
<div
|
|
329
|
+
v-for="(visualRowHeaders, visualRowIndex) in headersByVisualRow"
|
|
330
|
+
:key="`visual-row-${visualRowIndex}`"
|
|
331
|
+
:data-visual-row="visualRowIndex"
|
|
332
|
+
:class="ui.multiRowHeaderRow({ class: [propsUi?.multiRowHeaderRow] })"
|
|
333
|
+
>
|
|
334
|
+
<!-- Drag handle header placeholder (only on first visual row) -->
|
|
335
|
+
<div
|
|
336
|
+
v-if="rowDragOptions.enabled && visualRowIndex === 0"
|
|
337
|
+
:class="[
|
|
338
|
+
ui.th({ class: [propsUi?.th] }),
|
|
339
|
+
ui.rowDragHeaderHandle({ class: [propsUi?.rowDragHeaderHandle] })
|
|
340
|
+
]"
|
|
341
|
+
:style="{ gridRow: `span ${multiRowCount}` }"
|
|
342
|
+
/>
|
|
343
|
+
<!-- Left pinned spacer for visual rows 1+ (aligns with pinned columns from row 0) -->
|
|
344
|
+
<div
|
|
345
|
+
v-if="alignColumns && visualRowIndex > 0 && leftPinnedWidth > 0"
|
|
346
|
+
class="nugrid-header-pinned-spacer"
|
|
347
|
+
:style="{
|
|
348
|
+
width: `${leftPinnedWidth}px`,
|
|
349
|
+
minWidth: `${leftPinnedWidth}px`,
|
|
350
|
+
flexShrink: 0,
|
|
351
|
+
position: 'sticky',
|
|
352
|
+
left: 0,
|
|
353
|
+
zIndex: 20,
|
|
354
|
+
backgroundColor: 'var(--ui-bg-elevated)'
|
|
355
|
+
}"
|
|
356
|
+
/>
|
|
357
|
+
<div
|
|
358
|
+
v-for="(header, headerIndex) in visualRowHeaders"
|
|
359
|
+
:key="header.id"
|
|
360
|
+
:data-column-id="header.column.id"
|
|
361
|
+
:data-pinned="header.column.getIsPinned()"
|
|
362
|
+
:data-dragging="toValue(dragFns.draggedColumnId) === header.column.id"
|
|
363
|
+
:data-drop-target="toValue(dragFns.dropTargetColumnId) === header.column.id"
|
|
364
|
+
:data-drop-position="
|
|
365
|
+
toValue(dragFns.dropTargetColumnId) === header.column.id ? toValue(dragFns.dropPosition) : void 0
|
|
366
|
+
"
|
|
367
|
+
:class="[
|
|
368
|
+
ui.th({
|
|
369
|
+
class: [
|
|
370
|
+
propsUi?.th,
|
|
371
|
+
resolveValue(header.column.columnDef.meta?.class?.th, header)
|
|
372
|
+
],
|
|
373
|
+
pinned: !!getHeaderEffectivePinning(header),
|
|
374
|
+
colDragging: toValue(dragFns.draggedColumnId) === header.column.id,
|
|
375
|
+
colDropTarget: toValue(dragFns.dropTargetColumnId) === header.column.id
|
|
376
|
+
})
|
|
377
|
+
]"
|
|
378
|
+
:style="{
|
|
379
|
+
...resolveStyleObject(header.column.columnDef.meta?.style?.th, header),
|
|
380
|
+
...getAlignedHeaderStyle(
|
|
381
|
+
header,
|
|
382
|
+
visualRowIndex,
|
|
383
|
+
headerIndex,
|
|
384
|
+
visualRowHeaders.length
|
|
385
|
+
),
|
|
386
|
+
...getMultiRowHeaderPinningStyle(header, visualRowHeaders)
|
|
387
|
+
}"
|
|
388
|
+
@dragover="
|
|
389
|
+
(e) => dragFns.isHeaderDraggable(header) && dragFns.handleColumnDragOver(e, header.column.id)
|
|
390
|
+
"
|
|
391
|
+
@dragenter="dragFns.handleColumnDragEnter"
|
|
392
|
+
@drop="
|
|
393
|
+
(e) => dragFns.isHeaderDraggable(header) && dragFns.handleColumnDrop(e, header.column.id)
|
|
394
|
+
"
|
|
395
|
+
@dragend="dragFns.handleColumnDragEnd"
|
|
396
|
+
@dragleave="dragFns.handleColumnDragLeave"
|
|
397
|
+
>
|
|
398
|
+
<div :class="ui.headerContainer({ class: [propsUi?.headerContainer] })">
|
|
399
|
+
<div
|
|
400
|
+
:draggable="dragFns.isHeaderDraggable(header)"
|
|
401
|
+
:class="
|
|
402
|
+
ui.thInner({
|
|
403
|
+
class: [propsUi?.thInner],
|
|
404
|
+
colDraggable: dragFns.isHeaderDraggable(header)
|
|
405
|
+
})
|
|
406
|
+
"
|
|
407
|
+
@dragstart="
|
|
408
|
+
(e) => dragFns.isHeaderDraggable(header) && dragFns.handleColumnDragStart(e, header.column.id)
|
|
409
|
+
"
|
|
410
|
+
>
|
|
411
|
+
<slot :name="`${header.id}-header`" v-bind="header.getContext()">
|
|
412
|
+
<FlexRender
|
|
413
|
+
v-if="!header.isPlaceholder"
|
|
414
|
+
:render="header.column.columnDef.header"
|
|
415
|
+
:props="header.getContext()"
|
|
416
|
+
/>
|
|
417
|
+
</slot>
|
|
418
|
+
<NuGridHeaderSortButton
|
|
419
|
+
v-if="
|
|
420
|
+
(header.column.columnDef.sortIcons?.position ?? gridSortIcons?.position ?? 'edge') === 'inline'
|
|
421
|
+
"
|
|
422
|
+
:header="header"
|
|
423
|
+
:sort-icons="header.column.columnDef.sortIcons"
|
|
424
|
+
/>
|
|
425
|
+
</div>
|
|
426
|
+
<NuGridHeaderSortButton
|
|
427
|
+
v-if="
|
|
428
|
+
(header.column.columnDef.sortIcons?.position ?? gridSortIcons?.position ?? 'edge') === 'edge'
|
|
429
|
+
"
|
|
430
|
+
:header="header"
|
|
431
|
+
:sort-icons="header.column.columnDef.sortIcons"
|
|
432
|
+
/>
|
|
433
|
+
<NuGridColumnMenu :header="header" />
|
|
434
|
+
<div
|
|
435
|
+
v-if="header.column.getCanResize()"
|
|
436
|
+
:class="
|
|
437
|
+
ui.colResizeHandle({
|
|
438
|
+
class: [propsUi?.colResizeHandle],
|
|
439
|
+
colResizing: resizingColumnId === header.column.id || header.column.getIsResizing()
|
|
440
|
+
})
|
|
441
|
+
"
|
|
442
|
+
:data-col-resizing="
|
|
443
|
+
resizingColumnId === header.column.id || header.column.getIsResizing() ? 'true' : void 0
|
|
444
|
+
"
|
|
445
|
+
@mousedown="handleResizeStart($event, header)"
|
|
446
|
+
@touchstart.passive="handleResizeStart($event, header)"
|
|
447
|
+
>
|
|
448
|
+
<div
|
|
449
|
+
:class="
|
|
450
|
+
ui.colResizer({
|
|
451
|
+
class: [propsUi?.colResizer],
|
|
452
|
+
colResizing: resizingColumnId === header.column.id || header.column.getIsResizing()
|
|
453
|
+
})
|
|
454
|
+
"
|
|
455
|
+
:data-col-resizing="
|
|
456
|
+
resizingColumnId === header.column.id || header.column.getIsResizing() ? 'true' : void 0
|
|
457
|
+
"
|
|
458
|
+
/>
|
|
459
|
+
</div>
|
|
460
|
+
</div>
|
|
461
|
+
</div>
|
|
462
|
+
<!-- Right pinned spacer for visual rows 1+ (aligns with pinned columns from row 0) -->
|
|
463
|
+
<div
|
|
464
|
+
v-if="alignColumns && visualRowIndex > 0 && rightPinnedWidth > 0"
|
|
465
|
+
class="nugrid-header-pinned-spacer"
|
|
466
|
+
:style="{
|
|
467
|
+
width: `${rightPinnedWidth}px`,
|
|
468
|
+
minWidth: `${rightPinnedWidth}px`,
|
|
469
|
+
flexShrink: 0,
|
|
470
|
+
position: 'sticky',
|
|
471
|
+
right: 0,
|
|
472
|
+
zIndex: 20,
|
|
473
|
+
backgroundColor: 'var(--ui-bg-elevated)'
|
|
474
|
+
}"
|
|
475
|
+
/>
|
|
476
|
+
</div>
|
|
477
|
+
|
|
478
|
+
<div :class="ui.separator({ class: [propsUi?.separator] })" />
|
|
479
|
+
</div>
|
|
480
|
+
|
|
481
|
+
<!-- Standard headers: original single-row rendering -->
|
|
482
|
+
<div
|
|
483
|
+
v-else-if="!virtualizationEnabled"
|
|
484
|
+
:class="[
|
|
485
|
+
ui.thead({ class: [propsUi?.thead] }),
|
|
486
|
+
stickyEnabled ? ui.stickyColumnHeader({ class: [propsUi?.stickyColumnHeader] }) : {}
|
|
487
|
+
]"
|
|
488
|
+
:data-sticky-header="stickyEnabled ? 'true' : void 0"
|
|
489
|
+
>
|
|
490
|
+
<div
|
|
491
|
+
v-for="(headerGroup, rowIndex) in headerGroups"
|
|
492
|
+
:key="headerGroup.id"
|
|
493
|
+
:class="ui.tr({ class: propsUi?.tr })"
|
|
494
|
+
>
|
|
495
|
+
<!-- Drag handle header placeholder -->
|
|
496
|
+
<div
|
|
497
|
+
v-if="rowDragOptions.enabled"
|
|
498
|
+
:class="[
|
|
499
|
+
ui.th({ class: [propsUi?.th] }),
|
|
500
|
+
ui.rowDragHeaderHandle({ class: [propsUi?.rowDragHeaderHandle] })
|
|
501
|
+
]"
|
|
502
|
+
/>
|
|
503
|
+
<div
|
|
504
|
+
v-for="header in headerGroup.headers"
|
|
505
|
+
:key="header.id"
|
|
506
|
+
:data-column-id="header.column.id"
|
|
507
|
+
:data-pinned="header.column.getIsPinned()"
|
|
508
|
+
:data-column-group="header.colSpan > 1 ? 'true' : void 0"
|
|
509
|
+
:data-dragging="toValue(dragFns.draggedColumnId) === header.column.id"
|
|
510
|
+
:data-drop-target="toValue(dragFns.dropTargetColumnId) === header.column.id"
|
|
511
|
+
:data-drop-position="
|
|
512
|
+
toValue(dragFns.dropTargetColumnId) === header.column.id ? toValue(dragFns.dropPosition) : void 0
|
|
513
|
+
"
|
|
514
|
+
:class="[
|
|
515
|
+
header.colSpan > 1 || rowIndex < headerGroupsLength - 1 ? ui.thGroup({
|
|
516
|
+
class: [
|
|
517
|
+
propsUi?.thGroup,
|
|
518
|
+
rowIndex < headerGroupsLength - 1 ? 'rounded-b-none!' : '',
|
|
519
|
+
resolveValue(header.column.columnDef.meta?.class?.th, header)
|
|
520
|
+
],
|
|
521
|
+
pinned: !!getHeaderEffectivePinning(header)
|
|
522
|
+
}) : ui.th({
|
|
523
|
+
class: [
|
|
524
|
+
propsUi?.th,
|
|
525
|
+
rowIndex < headerGroupsLength - 1 ? 'rounded-b-none!' : '',
|
|
526
|
+
headerGroupsLength > 1 && rowIndex === headerGroupsLength - 1 ? 'rounded-t-none!' : '',
|
|
527
|
+
resolveValue(header.column.columnDef.meta?.class?.th, header)
|
|
528
|
+
],
|
|
529
|
+
pinned: !!getHeaderEffectivePinning(header),
|
|
530
|
+
colDragging: toValue(dragFns.draggedColumnId) === header.column.id,
|
|
531
|
+
colDropTarget: toValue(dragFns.dropTargetColumnId) === header.column.id
|
|
532
|
+
})
|
|
533
|
+
]"
|
|
534
|
+
:style="{
|
|
535
|
+
...resolveStyleObject(header.column.columnDef.meta?.style?.th, header),
|
|
536
|
+
width: `${header.getSize()}px`,
|
|
537
|
+
minWidth: `${header.getSize()}px`,
|
|
538
|
+
maxWidth: `${header.getSize()}px`,
|
|
539
|
+
...getHeaderPinningStyle(header),
|
|
540
|
+
...header.colSpan > 1 ? { flexGrow: header.colSpan } : {},
|
|
541
|
+
...header.rowSpan > 1 ? { alignSelf: 'stretch' } : {}
|
|
542
|
+
}"
|
|
543
|
+
@dragover="
|
|
544
|
+
(e) => dragFns.isHeaderDraggable(header) && dragFns.handleColumnDragOver(e, header.column.id)
|
|
545
|
+
"
|
|
546
|
+
@dragenter="dragFns.handleColumnDragEnter"
|
|
547
|
+
@drop="
|
|
548
|
+
(e) => dragFns.isHeaderDraggable(header) && dragFns.handleColumnDrop(e, header.column.id)
|
|
549
|
+
"
|
|
550
|
+
@dragend="dragFns.handleColumnDragEnd"
|
|
551
|
+
@dragleave="dragFns.handleColumnDragLeave"
|
|
552
|
+
>
|
|
553
|
+
<!-- Column Group Header (multi-column spanning or in group row) -->
|
|
554
|
+
<template v-if="header.colSpan > 1 || rowIndex < headerGroupsLength - 1">
|
|
555
|
+
<div :class="ui.headerContainer({ class: [propsUi?.headerContainer] })">
|
|
556
|
+
<div :class="ui.thGroupInner({ class: [propsUi?.thGroupInner] })">
|
|
557
|
+
<slot :name="`${header.id}-header`" v-bind="header.getContext()">
|
|
558
|
+
<FlexRender
|
|
559
|
+
v-if="!header.isPlaceholder"
|
|
560
|
+
:render="header.column.columnDef.header"
|
|
561
|
+
:props="header.getContext()"
|
|
562
|
+
/>
|
|
563
|
+
</slot>
|
|
564
|
+
</div>
|
|
565
|
+
<!-- Group resize handle -->
|
|
566
|
+
<div
|
|
567
|
+
v-if="header.colSpan > 1"
|
|
568
|
+
:class="
|
|
569
|
+
ui.colResizeHandle({
|
|
570
|
+
class: [propsUi?.colResizeHandle],
|
|
571
|
+
colResizing: resizingGroupId === header.id
|
|
572
|
+
})
|
|
573
|
+
"
|
|
574
|
+
:data-col-resizing="resizingGroupId === header.id ? 'true' : void 0"
|
|
575
|
+
@mousedown="handleGroupResizeStart($event, header)"
|
|
576
|
+
@touchstart.passive="handleGroupResizeStart($event, header)"
|
|
577
|
+
>
|
|
578
|
+
<div
|
|
579
|
+
:class="
|
|
580
|
+
ui.colResizer({
|
|
581
|
+
class: [propsUi?.colResizer],
|
|
582
|
+
colResizing: resizingGroupId === header.id
|
|
583
|
+
})
|
|
584
|
+
"
|
|
585
|
+
:data-col-resizing="resizingGroupId === header.id ? 'true' : void 0"
|
|
586
|
+
/>
|
|
587
|
+
</div>
|
|
588
|
+
</div>
|
|
589
|
+
</template>
|
|
590
|
+
<!-- Regular Column Header -->
|
|
591
|
+
<template v-else>
|
|
592
|
+
<div :class="ui.headerContainer({ class: [propsUi?.headerContainer] })">
|
|
593
|
+
<div
|
|
594
|
+
:draggable="dragFns.isHeaderDraggable(header)"
|
|
595
|
+
:class="
|
|
596
|
+
ui.thInner({
|
|
597
|
+
class: [propsUi?.thInner],
|
|
598
|
+
colDraggable: dragFns.isHeaderDraggable(header)
|
|
599
|
+
})
|
|
600
|
+
"
|
|
601
|
+
@dragstart="
|
|
602
|
+
(e) => dragFns.isHeaderDraggable(header) && dragFns.handleColumnDragStart(e, header.column.id)
|
|
603
|
+
"
|
|
604
|
+
>
|
|
605
|
+
<slot :name="`${header.id}-header`" v-bind="header.getContext()">
|
|
606
|
+
<FlexRender
|
|
607
|
+
v-if="!header.isPlaceholder"
|
|
608
|
+
:render="header.column.columnDef.header"
|
|
609
|
+
:props="header.getContext()"
|
|
610
|
+
/>
|
|
611
|
+
</slot>
|
|
612
|
+
<NuGridHeaderSortButton
|
|
613
|
+
v-if="
|
|
614
|
+
(header.column.columnDef.sortIcons?.position ?? gridSortIcons?.position ?? 'edge') === 'inline'
|
|
615
|
+
"
|
|
616
|
+
:header="header"
|
|
617
|
+
:sort-icons="header.column.columnDef.sortIcons"
|
|
618
|
+
/>
|
|
619
|
+
</div>
|
|
620
|
+
<NuGridHeaderSortButton
|
|
621
|
+
v-if="
|
|
622
|
+
(header.column.columnDef.sortIcons?.position ?? gridSortIcons?.position ?? 'edge') === 'edge'
|
|
623
|
+
"
|
|
624
|
+
:header="header"
|
|
625
|
+
:sort-icons="header.column.columnDef.sortIcons"
|
|
626
|
+
/>
|
|
627
|
+
<NuGridColumnMenu :header="header" />
|
|
628
|
+
<div
|
|
629
|
+
v-if="header.column.getCanResize()"
|
|
630
|
+
:class="
|
|
631
|
+
ui.colResizeHandle({
|
|
632
|
+
class: [propsUi?.colResizeHandle],
|
|
633
|
+
colResizing: resizingColumnId === header.column.id || header.column.getIsResizing()
|
|
634
|
+
})
|
|
635
|
+
"
|
|
636
|
+
:data-col-resizing="
|
|
637
|
+
resizingColumnId === header.column.id || header.column.getIsResizing() ? 'true' : void 0
|
|
638
|
+
"
|
|
639
|
+
@mousedown="handleResizeStart($event, header)"
|
|
640
|
+
@touchstart.passive="handleResizeStart($event, header)"
|
|
641
|
+
>
|
|
642
|
+
<div
|
|
643
|
+
:class="
|
|
644
|
+
ui.colResizer({
|
|
645
|
+
class: [propsUi?.colResizer],
|
|
646
|
+
colResizing: resizingColumnId === header.column.id || header.column.getIsResizing()
|
|
647
|
+
})
|
|
648
|
+
"
|
|
649
|
+
:data-col-resizing="
|
|
650
|
+
resizingColumnId === header.column.id || header.column.getIsResizing() ? 'true' : void 0
|
|
651
|
+
"
|
|
652
|
+
/>
|
|
653
|
+
</div>
|
|
654
|
+
</div>
|
|
655
|
+
</template>
|
|
656
|
+
</div>
|
|
657
|
+
</div>
|
|
658
|
+
|
|
659
|
+
<div :class="ui.separator({ class: [propsUi?.separator] })" />
|
|
660
|
+
</div>
|
|
661
|
+
|
|
662
|
+
<div
|
|
663
|
+
data-tbody
|
|
664
|
+
:class="ui.tbody({ class: [propsUi?.tbody] })"
|
|
665
|
+
:style="
|
|
666
|
+
virtualizer ? { position: 'relative', height: `${virtualizer.getTotalSize()}px` } : void 0
|
|
667
|
+
"
|
|
668
|
+
>
|
|
669
|
+
<slot name="body-top" />
|
|
670
|
+
|
|
671
|
+
<template v-if="rows.length">
|
|
672
|
+
<template v-if="virtualizer && virtualizationEnabled">
|
|
673
|
+
<template v-for="virtualRow in virtualizer.getVirtualItems()" :key="virtualRow.index">
|
|
674
|
+
<div
|
|
675
|
+
v-if="virtualRowItems[virtualRow.index]?.type === 'column-headers'"
|
|
676
|
+
:ref="
|
|
677
|
+
virtualizer && virtualizer.dynamicRowHeightsEnabled.value ? measureElementRef : void 0
|
|
678
|
+
"
|
|
679
|
+
:data-sticky-header="stickyEnabled ? 'true' : void 0"
|
|
680
|
+
:data-index="virtualRow.index"
|
|
681
|
+
:data-multi-row-headers="
|
|
682
|
+
multiRowEnabled && headersByVisualRow ? 'true' : void 0
|
|
683
|
+
"
|
|
684
|
+
:class="[
|
|
685
|
+
ui.thead({ class: [propsUi?.thead] }),
|
|
686
|
+
stickyEnabled ? ui.stickyColumnHeader({ class: [propsUi?.stickyColumnHeader] }) : {}
|
|
687
|
+
]"
|
|
688
|
+
:style="getVirtualItemStyle('column-headers', virtualRow)"
|
|
689
|
+
>
|
|
690
|
+
<!-- Multi-row virtualized headers -->
|
|
691
|
+
<template v-if="multiRowEnabled && headersByVisualRow">
|
|
692
|
+
<div
|
|
693
|
+
v-for="(visualRowHeaders, visualRowIndex) in headersByVisualRow"
|
|
694
|
+
:key="`virtual-visual-row-${visualRowIndex}-${virtualRow.index}`"
|
|
695
|
+
:data-visual-row="visualRowIndex"
|
|
696
|
+
:class="ui.multiRowHeaderRow({ class: [propsUi?.multiRowHeaderRow] })"
|
|
697
|
+
>
|
|
698
|
+
<!-- Drag handle header placeholder (only on first visual row) -->
|
|
699
|
+
<div
|
|
700
|
+
v-if="rowDragOptions.enabled && visualRowIndex === 0"
|
|
701
|
+
:class="[
|
|
702
|
+
ui.th({ class: [propsUi?.th] }),
|
|
703
|
+
ui.rowDragHeaderHandle({ class: [propsUi?.rowDragHeaderHandle] })
|
|
704
|
+
]"
|
|
705
|
+
:style="{ gridRow: `span ${multiRowCount}` }"
|
|
706
|
+
/>
|
|
707
|
+
<!-- Left pinned spacer for visual rows 1+ -->
|
|
708
|
+
<div
|
|
709
|
+
v-if="alignColumns && visualRowIndex > 0 && leftPinnedWidth > 0"
|
|
710
|
+
class="nugrid-header-pinned-spacer"
|
|
711
|
+
:style="{
|
|
712
|
+
width: `${leftPinnedWidth}px`,
|
|
713
|
+
minWidth: `${leftPinnedWidth}px`,
|
|
714
|
+
flexShrink: 0,
|
|
715
|
+
position: 'sticky',
|
|
716
|
+
left: 0,
|
|
717
|
+
zIndex: 20,
|
|
718
|
+
backgroundColor: 'var(--ui-bg-elevated)'
|
|
719
|
+
}"
|
|
720
|
+
/>
|
|
721
|
+
<div
|
|
722
|
+
v-for="(header, headerIndex) in visualRowHeaders"
|
|
723
|
+
:key="header.id"
|
|
724
|
+
:data-column-id="header.column.id"
|
|
725
|
+
:data-pinned="header.column.getIsPinned()"
|
|
726
|
+
:data-dragging="toValue(dragFns.draggedColumnId) === header.column.id"
|
|
727
|
+
:data-drop-target="toValue(dragFns.dropTargetColumnId) === header.column.id"
|
|
728
|
+
:data-drop-position="
|
|
729
|
+
toValue(dragFns.dropTargetColumnId) === header.column.id ? toValue(dragFns.dropPosition) : void 0
|
|
730
|
+
"
|
|
731
|
+
:class="[
|
|
732
|
+
ui.th({
|
|
733
|
+
class: [
|
|
734
|
+
propsUi?.th,
|
|
735
|
+
resolveValue(header.column.columnDef.meta?.class?.th, header)
|
|
736
|
+
],
|
|
737
|
+
pinned: !!getHeaderEffectivePinning(header),
|
|
738
|
+
colDragging: toValue(dragFns.draggedColumnId) === header.column.id,
|
|
739
|
+
colDropTarget: toValue(dragFns.dropTargetColumnId) === header.column.id
|
|
740
|
+
})
|
|
741
|
+
]"
|
|
742
|
+
:style="{
|
|
743
|
+
...resolveStyleObject(header.column.columnDef.meta?.style?.th, header),
|
|
744
|
+
...getAlignedHeaderStyle(
|
|
745
|
+
header,
|
|
746
|
+
visualRowIndex,
|
|
747
|
+
headerIndex,
|
|
748
|
+
visualRowHeaders.length
|
|
749
|
+
),
|
|
750
|
+
...getMultiRowHeaderPinningStyle(header, visualRowHeaders)
|
|
751
|
+
}"
|
|
752
|
+
@dragover="
|
|
753
|
+
(e) => dragFns.isHeaderDraggable(header) && dragFns.handleColumnDragOver(e, header.column.id)
|
|
754
|
+
"
|
|
755
|
+
@dragenter="dragFns.handleColumnDragEnter"
|
|
756
|
+
@drop="
|
|
757
|
+
(e) => dragFns.isHeaderDraggable(header) && dragFns.handleColumnDrop(e, header.column.id)
|
|
758
|
+
"
|
|
759
|
+
@dragend="dragFns.handleColumnDragEnd"
|
|
760
|
+
@dragleave="dragFns.handleColumnDragLeave"
|
|
761
|
+
>
|
|
762
|
+
<div :class="ui.headerContainer({ class: [propsUi?.headerContainer] })">
|
|
763
|
+
<div
|
|
764
|
+
:draggable="dragFns.isHeaderDraggable(header)"
|
|
765
|
+
:class="
|
|
766
|
+
ui.thInner({
|
|
767
|
+
class: [propsUi?.thInner],
|
|
768
|
+
colDraggable: dragFns.isHeaderDraggable(header)
|
|
769
|
+
})
|
|
770
|
+
"
|
|
771
|
+
@dragstart="
|
|
772
|
+
(e) => dragFns.isHeaderDraggable(header) && dragFns.handleColumnDragStart(e, header.column.id)
|
|
773
|
+
"
|
|
774
|
+
>
|
|
775
|
+
<slot :name="`${header.id}-header`" v-bind="header.getContext()">
|
|
776
|
+
<FlexRender
|
|
777
|
+
v-if="!header.isPlaceholder"
|
|
778
|
+
:render="header.column.columnDef.header"
|
|
779
|
+
:props="header.getContext()"
|
|
780
|
+
/>
|
|
781
|
+
</slot>
|
|
782
|
+
<NuGridHeaderSortButton
|
|
783
|
+
v-if="
|
|
784
|
+
(header.column.columnDef.sortIcons?.position ?? gridSortIcons?.position ?? 'edge') === 'inline'
|
|
785
|
+
"
|
|
786
|
+
:header="header"
|
|
787
|
+
:sort-icons="header.column.columnDef.sortIcons"
|
|
788
|
+
/>
|
|
789
|
+
</div>
|
|
790
|
+
<NuGridHeaderSortButton
|
|
791
|
+
v-if="
|
|
792
|
+
(header.column.columnDef.sortIcons?.position ?? gridSortIcons?.position ?? 'edge') === 'edge'
|
|
793
|
+
"
|
|
794
|
+
:header="header"
|
|
795
|
+
:sort-icons="header.column.columnDef.sortIcons"
|
|
796
|
+
/>
|
|
797
|
+
<NuGridColumnMenu :header="header" />
|
|
798
|
+
<div
|
|
799
|
+
v-if="header.column.getCanResize()"
|
|
800
|
+
:class="
|
|
801
|
+
ui.colResizeHandle({
|
|
802
|
+
class: [propsUi?.colResizeHandle],
|
|
803
|
+
colResizing: resizingColumnId === header.column.id || header.column.getIsResizing()
|
|
804
|
+
})
|
|
805
|
+
"
|
|
806
|
+
:data-col-resizing="
|
|
807
|
+
resizingColumnId === header.column.id || header.column.getIsResizing() ? 'true' : void 0
|
|
808
|
+
"
|
|
809
|
+
@mousedown="handleResizeStart($event, header)"
|
|
810
|
+
@touchstart.passive="handleResizeStart($event, header)"
|
|
811
|
+
>
|
|
812
|
+
<div
|
|
813
|
+
:class="
|
|
814
|
+
ui.colResizer({
|
|
815
|
+
class: [propsUi?.colResizer],
|
|
816
|
+
colResizing: resizingColumnId === header.column.id || header.column.getIsResizing()
|
|
817
|
+
})
|
|
818
|
+
"
|
|
819
|
+
:data-col-resizing="
|
|
820
|
+
resizingColumnId === header.column.id || header.column.getIsResizing() ? 'true' : void 0
|
|
821
|
+
"
|
|
822
|
+
/>
|
|
823
|
+
</div>
|
|
824
|
+
</div>
|
|
825
|
+
</div>
|
|
826
|
+
<!-- Right pinned spacer for visual rows 1+ -->
|
|
827
|
+
<div
|
|
828
|
+
v-if="alignColumns && visualRowIndex > 0 && rightPinnedWidth > 0"
|
|
829
|
+
class="nugrid-header-pinned-spacer"
|
|
830
|
+
:style="{
|
|
831
|
+
width: `${rightPinnedWidth}px`,
|
|
832
|
+
minWidth: `${rightPinnedWidth}px`,
|
|
833
|
+
flexShrink: 0,
|
|
834
|
+
position: 'sticky',
|
|
835
|
+
right: 0,
|
|
836
|
+
zIndex: 20,
|
|
837
|
+
backgroundColor: 'var(--ui-bg-elevated)'
|
|
838
|
+
}"
|
|
839
|
+
/>
|
|
840
|
+
</div>
|
|
841
|
+
</template>
|
|
842
|
+
|
|
843
|
+
<!-- Standard virtualized headers -->
|
|
844
|
+
<template v-else>
|
|
845
|
+
<div
|
|
846
|
+
v-for="(headerGroup, rowIndex) in headerGroups"
|
|
847
|
+
:key="`${headerGroup.id}-${virtualRow.index}`"
|
|
848
|
+
:class="ui.tr({ class: propsUi?.tr })"
|
|
849
|
+
>
|
|
850
|
+
<div
|
|
851
|
+
v-if="rowDragOptions.enabled"
|
|
852
|
+
:class="[
|
|
853
|
+
ui.th({ class: [propsUi?.th] }),
|
|
854
|
+
ui.rowDragHeaderHandle({ class: [propsUi?.rowDragHeaderHandle] })
|
|
855
|
+
]"
|
|
856
|
+
/>
|
|
857
|
+
<div
|
|
858
|
+
v-for="header in headerGroup.headers"
|
|
859
|
+
:key="header.id"
|
|
860
|
+
:data-column-id="header.column.id"
|
|
861
|
+
:data-pinned="header.column.getIsPinned()"
|
|
862
|
+
:data-column-group="header.colSpan > 1 ? 'true' : void 0"
|
|
863
|
+
:data-dragging="toValue(dragFns.draggedColumnId) === header.column.id"
|
|
864
|
+
:data-drop-target="toValue(dragFns.dropTargetColumnId) === header.column.id"
|
|
865
|
+
:data-drop-position="
|
|
866
|
+
toValue(dragFns.dropTargetColumnId) === header.column.id ? toValue(dragFns.dropPosition) : void 0
|
|
867
|
+
"
|
|
868
|
+
:class="[
|
|
869
|
+
header.colSpan > 1 || rowIndex < headerGroupsLength - 1 ? ui.thGroup({
|
|
870
|
+
class: [
|
|
871
|
+
propsUi?.thGroup,
|
|
872
|
+
rowIndex < headerGroupsLength - 1 ? 'rounded-b-none!' : '',
|
|
873
|
+
resolveValue(header.column.columnDef.meta?.class?.th, header)
|
|
874
|
+
],
|
|
875
|
+
pinned: !!getHeaderEffectivePinning(header)
|
|
876
|
+
}) : ui.th({
|
|
877
|
+
class: [
|
|
878
|
+
propsUi?.th,
|
|
879
|
+
rowIndex < headerGroupsLength - 1 ? 'rounded-b-none!' : '',
|
|
880
|
+
headerGroupsLength > 1 && rowIndex === headerGroupsLength - 1 ? 'rounded-t-none!' : '',
|
|
881
|
+
resolveValue(header.column.columnDef.meta?.class?.th, header)
|
|
882
|
+
],
|
|
883
|
+
pinned: !!getHeaderEffectivePinning(header),
|
|
884
|
+
colDragging: toValue(dragFns.draggedColumnId) === header.column.id,
|
|
885
|
+
colDropTarget: toValue(dragFns.dropTargetColumnId) === header.column.id
|
|
886
|
+
})
|
|
887
|
+
]"
|
|
888
|
+
:style="{
|
|
889
|
+
...resolveStyleObject(header.column.columnDef.meta?.style?.th, header),
|
|
890
|
+
width: `${header.getSize()}px`,
|
|
891
|
+
minWidth: `${header.getSize()}px`,
|
|
892
|
+
maxWidth: `${header.getSize()}px`,
|
|
893
|
+
...getHeaderPinningStyle(header),
|
|
894
|
+
...header.colSpan > 1 ? { flexGrow: header.colSpan } : {},
|
|
895
|
+
...header.rowSpan > 1 ? { alignSelf: 'stretch' } : {}
|
|
896
|
+
}"
|
|
897
|
+
@dragover="
|
|
898
|
+
(e) => dragFns.isHeaderDraggable(header) && dragFns.handleColumnDragOver(e, header.column.id)
|
|
899
|
+
"
|
|
900
|
+
@dragenter="dragFns.handleColumnDragEnter"
|
|
901
|
+
@drop="
|
|
902
|
+
(e) => dragFns.isHeaderDraggable(header) && dragFns.handleColumnDrop(e, header.column.id)
|
|
903
|
+
"
|
|
904
|
+
@dragend="dragFns.handleColumnDragEnd"
|
|
905
|
+
@dragleave="dragFns.handleColumnDragLeave"
|
|
906
|
+
>
|
|
907
|
+
<!-- Column Group Header (multi-column spanning or in group row) -->
|
|
908
|
+
<template v-if="header.colSpan > 1 || rowIndex < headerGroupsLength - 1">
|
|
909
|
+
<div :class="ui.headerContainer({ class: [propsUi?.headerContainer] })">
|
|
910
|
+
<div :class="ui.thGroupInner({ class: [propsUi?.thGroupInner] })">
|
|
911
|
+
<slot :name="`${header.id}-header`" v-bind="header.getContext()">
|
|
912
|
+
<FlexRender
|
|
913
|
+
v-if="!header.isPlaceholder"
|
|
914
|
+
:render="header.column.columnDef.header"
|
|
915
|
+
:props="header.getContext()"
|
|
916
|
+
/>
|
|
917
|
+
</slot>
|
|
918
|
+
</div>
|
|
919
|
+
<!-- Group resize handle -->
|
|
920
|
+
<div
|
|
921
|
+
v-if="header.colSpan > 1"
|
|
922
|
+
:class="
|
|
923
|
+
ui.colResizeHandle({
|
|
924
|
+
class: [propsUi?.colResizeHandle],
|
|
925
|
+
colResizing: resizingGroupId === header.id
|
|
926
|
+
})
|
|
927
|
+
"
|
|
928
|
+
@mousedown="handleGroupResizeStart($event, header)"
|
|
929
|
+
@touchstart.passive="handleGroupResizeStart($event, header)"
|
|
930
|
+
>
|
|
931
|
+
<div
|
|
932
|
+
:class="
|
|
933
|
+
ui.colResizer({
|
|
934
|
+
class: [propsUi?.colResizer],
|
|
935
|
+
colResizing: resizingGroupId === header.id
|
|
936
|
+
})
|
|
937
|
+
"
|
|
938
|
+
/>
|
|
939
|
+
</div>
|
|
940
|
+
</div>
|
|
941
|
+
</template>
|
|
942
|
+
<!-- Regular Column Header -->
|
|
943
|
+
<template v-else>
|
|
944
|
+
<div :class="ui.headerContainer({ class: [propsUi?.headerContainer] })">
|
|
945
|
+
<div
|
|
946
|
+
:draggable="dragFns.isHeaderDraggable(header)"
|
|
947
|
+
:class="
|
|
948
|
+
ui.thInner({
|
|
949
|
+
class: [propsUi?.thInner],
|
|
950
|
+
colDraggable: dragFns.isHeaderDraggable(header)
|
|
951
|
+
})
|
|
952
|
+
"
|
|
953
|
+
@dragstart="
|
|
954
|
+
(e) => dragFns.isHeaderDraggable(header) && dragFns.handleColumnDragStart(e, header.column.id)
|
|
955
|
+
"
|
|
956
|
+
>
|
|
957
|
+
<slot :name="`${header.id}-header`" v-bind="header.getContext()">
|
|
958
|
+
<FlexRender
|
|
959
|
+
v-if="!header.isPlaceholder"
|
|
960
|
+
:render="header.column.columnDef.header"
|
|
961
|
+
:props="header.getContext()"
|
|
962
|
+
/>
|
|
963
|
+
</slot>
|
|
964
|
+
<NuGridHeaderSortButton
|
|
965
|
+
v-if="
|
|
966
|
+
(header.column.columnDef.sortIcons?.position ?? gridSortIcons?.position ?? 'edge') === 'inline'
|
|
967
|
+
"
|
|
968
|
+
:header="header"
|
|
969
|
+
:sort-icons="header.column.columnDef.sortIcons"
|
|
970
|
+
/>
|
|
971
|
+
</div>
|
|
972
|
+
<NuGridHeaderSortButton
|
|
973
|
+
v-if="
|
|
974
|
+
(header.column.columnDef.sortIcons?.position ?? gridSortIcons?.position ?? 'edge') === 'edge'
|
|
975
|
+
"
|
|
976
|
+
:header="header"
|
|
977
|
+
:sort-icons="header.column.columnDef.sortIcons"
|
|
978
|
+
/>
|
|
979
|
+
<NuGridColumnMenu :header="header" />
|
|
980
|
+
<div
|
|
981
|
+
v-if="header.column.getCanResize()"
|
|
982
|
+
:class="
|
|
983
|
+
ui.colResizeHandle({
|
|
984
|
+
class: [propsUi?.colResizeHandle],
|
|
985
|
+
colResizing: resizingColumnId === header.column.id || header.column.getIsResizing()
|
|
986
|
+
})
|
|
987
|
+
"
|
|
988
|
+
:data-col-resizing="
|
|
989
|
+
resizingColumnId === header.column.id || header.column.getIsResizing() ? 'true' : void 0
|
|
990
|
+
"
|
|
991
|
+
@mousedown="handleResizeStart($event, header)"
|
|
992
|
+
@touchstart.passive="handleResizeStart($event, header)"
|
|
993
|
+
>
|
|
994
|
+
<div
|
|
995
|
+
:class="
|
|
996
|
+
ui.colResizer({
|
|
997
|
+
class: [propsUi?.colResizer],
|
|
998
|
+
colResizing: resizingColumnId === header.column.id || header.column.getIsResizing()
|
|
999
|
+
})
|
|
1000
|
+
"
|
|
1001
|
+
:data-col-resizing="
|
|
1002
|
+
resizingColumnId === header.column.id || header.column.getIsResizing() ? 'true' : void 0
|
|
1003
|
+
"
|
|
1004
|
+
/>
|
|
1005
|
+
</div>
|
|
1006
|
+
</div>
|
|
1007
|
+
</template>
|
|
1008
|
+
</div>
|
|
1009
|
+
</div>
|
|
1010
|
+
</template>
|
|
1011
|
+
|
|
1012
|
+
<div :class="ui.separator({ class: [propsUi?.separator] })" />
|
|
1013
|
+
</div>
|
|
1014
|
+
|
|
1015
|
+
<component
|
|
1016
|
+
:is="
|
|
1017
|
+
addRowContext.isAddRowRow(virtualRowItems[virtualRow.index]?.dataRow) ? NuGridAddRow : NuGridRow
|
|
1018
|
+
"
|
|
1019
|
+
v-else-if="virtualRowItems[virtualRow.index]?.type === 'data'"
|
|
1020
|
+
:key="virtualRowItems[virtualRow.index]?.dataRow?.id"
|
|
1021
|
+
:row="virtualRowItems[virtualRow.index]?.dataRow"
|
|
1022
|
+
:data-index="virtualRow.index"
|
|
1023
|
+
:data-row-id="virtualRowItems[virtualRow.index]?.dataRow?.id"
|
|
1024
|
+
:measure-ref="
|
|
1025
|
+
virtualizer && virtualizer.dynamicRowHeightsEnabled.value ? measureElementRef : void 0
|
|
1026
|
+
"
|
|
1027
|
+
:style="getVirtualItemStyle('data', virtualRow)"
|
|
1028
|
+
/>
|
|
1029
|
+
|
|
1030
|
+
<div
|
|
1031
|
+
v-else-if="virtualRowItems[virtualRow.index]?.type === 'footer'"
|
|
1032
|
+
:ref="
|
|
1033
|
+
virtualizer && virtualizer.dynamicRowHeightsEnabled.value ? measureElementRef : void 0
|
|
1034
|
+
"
|
|
1035
|
+
:data-index="virtualRow.index"
|
|
1036
|
+
:class="ui.tfoot({ class: [propsUi?.tfoot] })"
|
|
1037
|
+
:style="getVirtualItemStyle('footer', virtualRow)"
|
|
1038
|
+
>
|
|
1039
|
+
<div :class="ui.separator({ class: [propsUi?.separator] })" />
|
|
1040
|
+
|
|
1041
|
+
<div
|
|
1042
|
+
v-for="footerGroup in footerGroups"
|
|
1043
|
+
:key="`${footerGroup.id}-${virtualRow.index}`"
|
|
1044
|
+
:class="ui.tr({ class: [propsUi?.tr] })"
|
|
1045
|
+
>
|
|
1046
|
+
<div
|
|
1047
|
+
v-for="header in footerGroup.headers"
|
|
1048
|
+
:key="header.id"
|
|
1049
|
+
:data-pinned="header.column.getIsPinned()"
|
|
1050
|
+
:class="[
|
|
1051
|
+
ui.th({
|
|
1052
|
+
class: [
|
|
1053
|
+
propsUi?.th,
|
|
1054
|
+
resolveValue(header.column.columnDef.meta?.class?.th, header)
|
|
1055
|
+
],
|
|
1056
|
+
pinned: !!getHeaderEffectivePinning(header)
|
|
1057
|
+
})
|
|
1058
|
+
]"
|
|
1059
|
+
:style="{
|
|
1060
|
+
...resolveStyleObject(header.column.columnDef.meta?.style?.th, header),
|
|
1061
|
+
width: `${header.getSize()}px`,
|
|
1062
|
+
minWidth: `${header.getSize()}px`,
|
|
1063
|
+
maxWidth: `${header.getSize()}px`,
|
|
1064
|
+
...getHeaderPinningStyle(header),
|
|
1065
|
+
...header.colSpan > 1 ? { flexGrow: header.colSpan } : {},
|
|
1066
|
+
...header.rowSpan > 1 ? { alignSelf: 'stretch' } : {}
|
|
1067
|
+
}"
|
|
1068
|
+
>
|
|
1069
|
+
<div :class="ui.footerContent({ class: [propsUi?.footerContent] })">
|
|
1070
|
+
<slot :name="`${header.id}-footer`" v-bind="header.getContext()">
|
|
1071
|
+
<FlexRender
|
|
1072
|
+
v-if="!header.isPlaceholder"
|
|
1073
|
+
:render="header.column.columnDef.footer"
|
|
1074
|
+
:props="header.getContext()"
|
|
1075
|
+
/>
|
|
1076
|
+
</slot>
|
|
1077
|
+
</div>
|
|
1078
|
+
</div>
|
|
1079
|
+
</div>
|
|
1080
|
+
</div>
|
|
1081
|
+
</template>
|
|
1082
|
+
</template>
|
|
1083
|
+
|
|
1084
|
+
<!-- Non-virtualized rows (animation handled by useVirtualizedRowAnimation composable) -->
|
|
1085
|
+
<template v-else>
|
|
1086
|
+
<component
|
|
1087
|
+
:is="addRowContext.isAddRowRow(row) ? NuGridAddRow : NuGridRow"
|
|
1088
|
+
v-for="row in rows"
|
|
1089
|
+
:key="row.id"
|
|
1090
|
+
:row="row"
|
|
1091
|
+
:data-row-id="row.id"
|
|
1092
|
+
/>
|
|
1093
|
+
</template>
|
|
1094
|
+
</template>
|
|
1095
|
+
|
|
1096
|
+
<div v-else-if="loading && !!slots.loading" :class="ui.tr({ class: propsUi?.tr })">
|
|
1097
|
+
<div :class="ui.loading({ class: propsUi?.loading })">
|
|
1098
|
+
<slot name="loading" />
|
|
1099
|
+
</div>
|
|
1100
|
+
</div>
|
|
1101
|
+
|
|
1102
|
+
<div v-else :class="ui.tr({ class: propsUi?.tr })">
|
|
1103
|
+
<div :class="ui.empty({ class: propsUi?.empty })">
|
|
1104
|
+
<slot name="empty">
|
|
1105
|
+
{{ empty || "No data available." }}
|
|
1106
|
+
</slot>
|
|
1107
|
+
</div>
|
|
1108
|
+
</div>
|
|
1109
|
+
|
|
1110
|
+
<slot name="body-bottom" />
|
|
1111
|
+
</div>
|
|
1112
|
+
|
|
1113
|
+
<div
|
|
1114
|
+
v-if="hasFooter && !virtualizationEnabled"
|
|
1115
|
+
:class="ui.tfoot({ class: [propsUi?.tfoot] })"
|
|
1116
|
+
>
|
|
1117
|
+
<div :class="ui.separator({ class: [propsUi?.separator] })" />
|
|
1118
|
+
|
|
1119
|
+
<div
|
|
1120
|
+
v-for="footerGroup in footerGroups"
|
|
1121
|
+
:key="footerGroup.id"
|
|
1122
|
+
:class="ui.tr({ class: [propsUi?.tr] })"
|
|
1123
|
+
>
|
|
1124
|
+
<div
|
|
1125
|
+
v-for="header in footerGroup.headers"
|
|
1126
|
+
:key="header.id"
|
|
1127
|
+
:data-pinned="header.column.getIsPinned()"
|
|
1128
|
+
:class="[
|
|
1129
|
+
ui.th({
|
|
1130
|
+
class: [
|
|
1131
|
+
propsUi?.th,
|
|
1132
|
+
resolveValue(header.column.columnDef.meta?.class?.th, header)
|
|
1133
|
+
],
|
|
1134
|
+
pinned: !!getHeaderEffectivePinning(header)
|
|
1135
|
+
})
|
|
1136
|
+
]"
|
|
1137
|
+
:style="{
|
|
1138
|
+
...resolveStyleObject(header.column.columnDef.meta?.style?.th, header),
|
|
1139
|
+
width: `${header.getSize()}px`,
|
|
1140
|
+
minWidth: `${header.getSize()}px`,
|
|
1141
|
+
maxWidth: `${header.getSize()}px`,
|
|
1142
|
+
...getHeaderPinningStyle(header),
|
|
1143
|
+
...header.colSpan > 1 ? { flexGrow: header.colSpan } : {},
|
|
1144
|
+
...header.rowSpan > 1 ? { alignSelf: 'stretch' } : {}
|
|
1145
|
+
}"
|
|
1146
|
+
>
|
|
1147
|
+
<div :class="ui.footerContent({ class: [propsUi?.footerContent] })">
|
|
1148
|
+
<slot :name="`${header.id}-footer`" v-bind="header.getContext()">
|
|
1149
|
+
<FlexRender
|
|
1150
|
+
v-if="!header.isPlaceholder"
|
|
1151
|
+
:render="header.column.columnDef.footer"
|
|
1152
|
+
:props="header.getContext()"
|
|
1153
|
+
/>
|
|
1154
|
+
</slot>
|
|
1155
|
+
</div>
|
|
1156
|
+
</div>
|
|
1157
|
+
</div>
|
|
1158
|
+
</div>
|
|
1159
|
+
</div>
|
|
1160
|
+
</DefineTableTemplate>
|
|
1161
|
+
|
|
1162
|
+
<div
|
|
1163
|
+
v-if="virtualizer"
|
|
1164
|
+
:style="{
|
|
1165
|
+
height: `${virtualizer.getTotalSize()}px`
|
|
1166
|
+
}"
|
|
1167
|
+
>
|
|
1168
|
+
<ReuseNuGridTemplate />
|
|
1169
|
+
</div>
|
|
1170
|
+
<ReuseNuGridTemplate v-else />
|
|
1171
|
+
</Primitive>
|
|
1172
|
+
</template>
|