@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,219 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import { computed, nextTick, onMounted, ref, watch } from "vue";
|
|
3
|
+
import { useNuGridCellEditor } from "../../composables";
|
|
4
|
+
defineOptions({ inheritAttrs: false });
|
|
5
|
+
const props = defineProps({
|
|
6
|
+
modelValue: { type: null, required: true },
|
|
7
|
+
cell: { type: null, required: true },
|
|
8
|
+
row: { type: Object, required: true },
|
|
9
|
+
isNavigating: { type: Boolean, required: true },
|
|
10
|
+
shouldFocus: { type: Boolean, required: true },
|
|
11
|
+
validationError: { type: [String, null], required: false },
|
|
12
|
+
showValidationErrors: { type: String, required: false },
|
|
13
|
+
interactionRouter: { type: Object, required: false }
|
|
14
|
+
});
|
|
15
|
+
const emit = defineEmits(["update:modelValue", "stop-editing", "cancel-editing", "update:isNavigating"]);
|
|
16
|
+
const containerRef = ref(null);
|
|
17
|
+
const clearButtonRef = ref(null);
|
|
18
|
+
const hoveredStar = ref(null);
|
|
19
|
+
const selectedStar = ref(null);
|
|
20
|
+
const focusedIndex = ref(null);
|
|
21
|
+
const dummyRef = ref(null);
|
|
22
|
+
const {
|
|
23
|
+
handleKeydown: baseHandleKeydown,
|
|
24
|
+
handleBlur: baseHandleBlur,
|
|
25
|
+
scheduleNavigation
|
|
26
|
+
} = useNuGridCellEditor(props, emit, dummyRef);
|
|
27
|
+
const rating = computed({
|
|
28
|
+
get: () => props.modelValue ?? null,
|
|
29
|
+
set: (value) => emit("update:modelValue", value)
|
|
30
|
+
});
|
|
31
|
+
watch(
|
|
32
|
+
() => props.modelValue,
|
|
33
|
+
(value) => {
|
|
34
|
+
selectedStar.value = value ?? null;
|
|
35
|
+
if (focusedIndex.value === null) {
|
|
36
|
+
focusedIndex.value = value ?? 0;
|
|
37
|
+
}
|
|
38
|
+
},
|
|
39
|
+
{ immediate: true }
|
|
40
|
+
);
|
|
41
|
+
watch(
|
|
42
|
+
() => props.shouldFocus,
|
|
43
|
+
(shouldFocus) => {
|
|
44
|
+
if (shouldFocus && containerRef.value) {
|
|
45
|
+
nextTick(() => {
|
|
46
|
+
containerRef.value?.focus({ preventScroll: true });
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
},
|
|
50
|
+
{ immediate: true }
|
|
51
|
+
);
|
|
52
|
+
onMounted(() => {
|
|
53
|
+
if (props.shouldFocus && containerRef.value) {
|
|
54
|
+
nextTick(() => {
|
|
55
|
+
containerRef.value?.focus({ preventScroll: true });
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
});
|
|
59
|
+
function handleContainerBlur(event) {
|
|
60
|
+
const nextTarget = event.relatedTarget;
|
|
61
|
+
if (nextTarget && containerRef.value?.contains(nextTarget)) return;
|
|
62
|
+
baseHandleBlur();
|
|
63
|
+
}
|
|
64
|
+
function setRating(value, closeEditor = false) {
|
|
65
|
+
const selection = window.getSelection?.();
|
|
66
|
+
if (selection && selection.type !== "None") {
|
|
67
|
+
selection.removeAllRanges();
|
|
68
|
+
}
|
|
69
|
+
rating.value = value;
|
|
70
|
+
selectedStar.value = value;
|
|
71
|
+
focusedIndex.value = value ?? 0;
|
|
72
|
+
if (closeEditor) {
|
|
73
|
+
emit("stop-editing");
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
function handleKeydown(e) {
|
|
77
|
+
e.stopPropagation();
|
|
78
|
+
if (e.key === "ArrowLeft") {
|
|
79
|
+
e.preventDefault();
|
|
80
|
+
if (focusedIndex.value === null || focusedIndex.value === 0) {
|
|
81
|
+
focusedIndex.value = 5;
|
|
82
|
+
selectedStar.value = 5;
|
|
83
|
+
rating.value = 5;
|
|
84
|
+
} else if (focusedIndex.value === 1) {
|
|
85
|
+
focusedIndex.value = 0;
|
|
86
|
+
selectedStar.value = null;
|
|
87
|
+
rating.value = null;
|
|
88
|
+
} else {
|
|
89
|
+
focusedIndex.value = focusedIndex.value - 1;
|
|
90
|
+
selectedStar.value = focusedIndex.value;
|
|
91
|
+
rating.value = focusedIndex.value;
|
|
92
|
+
}
|
|
93
|
+
return;
|
|
94
|
+
}
|
|
95
|
+
if (e.key === "ArrowRight") {
|
|
96
|
+
e.preventDefault();
|
|
97
|
+
if (focusedIndex.value === null || focusedIndex.value === 0) {
|
|
98
|
+
focusedIndex.value = 1;
|
|
99
|
+
selectedStar.value = 1;
|
|
100
|
+
rating.value = 1;
|
|
101
|
+
} else if (focusedIndex.value >= 5) {
|
|
102
|
+
focusedIndex.value = 0;
|
|
103
|
+
selectedStar.value = null;
|
|
104
|
+
rating.value = null;
|
|
105
|
+
} else {
|
|
106
|
+
focusedIndex.value = focusedIndex.value + 1;
|
|
107
|
+
selectedStar.value = focusedIndex.value;
|
|
108
|
+
rating.value = focusedIndex.value;
|
|
109
|
+
}
|
|
110
|
+
return;
|
|
111
|
+
}
|
|
112
|
+
if (e.key === "0") {
|
|
113
|
+
e.preventDefault();
|
|
114
|
+
setRating(null, true);
|
|
115
|
+
return;
|
|
116
|
+
}
|
|
117
|
+
if (e.key >= "1" && e.key <= "5") {
|
|
118
|
+
e.preventDefault();
|
|
119
|
+
const value = Number.parseInt(e.key, 10);
|
|
120
|
+
setRating(value, true);
|
|
121
|
+
return;
|
|
122
|
+
}
|
|
123
|
+
if (e.key === "Enter") {
|
|
124
|
+
e.preventDefault();
|
|
125
|
+
if (focusedIndex.value === 0) {
|
|
126
|
+
setRating(null, true);
|
|
127
|
+
} else {
|
|
128
|
+
emit("stop-editing");
|
|
129
|
+
}
|
|
130
|
+
return;
|
|
131
|
+
}
|
|
132
|
+
if (e.key === " ") {
|
|
133
|
+
e.preventDefault();
|
|
134
|
+
if (focusedIndex.value === 0) {
|
|
135
|
+
setRating(null, false);
|
|
136
|
+
} else if (focusedIndex.value !== null && focusedIndex.value >= 1 && focusedIndex.value <= 5) {
|
|
137
|
+
setRating(focusedIndex.value, false);
|
|
138
|
+
}
|
|
139
|
+
return;
|
|
140
|
+
}
|
|
141
|
+
if (e.key === "Tab") {
|
|
142
|
+
e.preventDefault();
|
|
143
|
+
scheduleNavigation(e.shiftKey ? "previous" : "next");
|
|
144
|
+
return;
|
|
145
|
+
}
|
|
146
|
+
if (e.key === "Escape") {
|
|
147
|
+
e.preventDefault();
|
|
148
|
+
emit("cancel-editing");
|
|
149
|
+
return;
|
|
150
|
+
}
|
|
151
|
+
if (e.key === "ArrowUp" || e.key === "ArrowDown") {
|
|
152
|
+
e.preventDefault();
|
|
153
|
+
scheduleNavigation(e.key === "ArrowUp" ? "up" : "down");
|
|
154
|
+
return;
|
|
155
|
+
}
|
|
156
|
+
baseHandleKeydown(e);
|
|
157
|
+
}
|
|
158
|
+
</script>
|
|
159
|
+
|
|
160
|
+
<template>
|
|
161
|
+
<div
|
|
162
|
+
ref="containerRef"
|
|
163
|
+
class="flex items-center gap-1 rounded border-2 border-transparent p-1 outline-none select-none
|
|
164
|
+
focus-visible:border-primary-500"
|
|
165
|
+
tabindex="0"
|
|
166
|
+
@keydown="handleKeydown"
|
|
167
|
+
@blur="handleContainerBlur"
|
|
168
|
+
@mouseleave="hoveredStar = null"
|
|
169
|
+
@focus="
|
|
170
|
+
() => {
|
|
171
|
+
if (focusedIndex === null) focusedIndex = selectedStar ?? 0;
|
|
172
|
+
}
|
|
173
|
+
"
|
|
174
|
+
@mousedown.prevent.stop
|
|
175
|
+
@pointerdown.prevent.stop
|
|
176
|
+
@selectstart.prevent
|
|
177
|
+
>
|
|
178
|
+
<button
|
|
179
|
+
v-for="star in 5"
|
|
180
|
+
:key="star"
|
|
181
|
+
type="button"
|
|
182
|
+
class="rounded transition-all hover:scale-110 focus:outline-none"
|
|
183
|
+
:class="[
|
|
184
|
+
star <= (hoveredStar ?? selectedStar ?? rating ?? 0) ? 'text-yellow-400' : 'text-gray-300',
|
|
185
|
+
focusedIndex === star ? 'ring-2 ring-primary-500 ring-offset-0' : ''
|
|
186
|
+
]"
|
|
187
|
+
tabindex="0"
|
|
188
|
+
@mousedown.prevent
|
|
189
|
+
@click="setRating(star, true)"
|
|
190
|
+
@mouseenter="hoveredStar = star"
|
|
191
|
+
@mouseleave="hoveredStar = null"
|
|
192
|
+
@focus="focusedIndex = star"
|
|
193
|
+
>
|
|
194
|
+
<svg
|
|
195
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
196
|
+
viewBox="0 0 24 24"
|
|
197
|
+
fill="currentColor"
|
|
198
|
+
class="h-5 w-5"
|
|
199
|
+
>
|
|
200
|
+
<path
|
|
201
|
+
d="M12 2l3.09 6.26L22 9.27l-5 4.87 1.18 6.88L12 17.77l-6.18 3.25L7 14.14 2 9.27l6.91-1.01L12 2z"
|
|
202
|
+
/>
|
|
203
|
+
</svg>
|
|
204
|
+
</button>
|
|
205
|
+
<UButton
|
|
206
|
+
ref="clearButtonRef"
|
|
207
|
+
icon="i-heroicons-x-mark"
|
|
208
|
+
size="xs"
|
|
209
|
+
color="neutral"
|
|
210
|
+
variant="ghost"
|
|
211
|
+
class="ml-2"
|
|
212
|
+
tabindex="0"
|
|
213
|
+
:class="focusedIndex === 0 ? 'ring-2 ring-primary-500 ring-offset-0' : ''"
|
|
214
|
+
@mousedown.prevent
|
|
215
|
+
@click="setRating(null, true)"
|
|
216
|
+
@focus="focusedIndex = 0"
|
|
217
|
+
/>
|
|
218
|
+
</div>
|
|
219
|
+
</template>
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { NuGridCellEditorProps } from '../../types/index.js';
|
|
2
|
+
type __VLS_Props = NuGridCellEditorProps;
|
|
3
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
|
|
4
|
+
"update:modelValue": (value: any) => any;
|
|
5
|
+
"update:isNavigating": (value: boolean) => any;
|
|
6
|
+
"stop-editing": (moveDirection?: "up" | "down" | "next" | "previous" | undefined) => any;
|
|
7
|
+
"cancel-editing": () => any;
|
|
8
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
9
|
+
"onUpdate:modelValue"?: ((value: any) => any) | undefined;
|
|
10
|
+
"onUpdate:isNavigating"?: ((value: boolean) => any) | undefined;
|
|
11
|
+
"onStop-editing"?: ((moveDirection?: "up" | "down" | "next" | "previous" | undefined) => any) | undefined;
|
|
12
|
+
"onCancel-editing"?: (() => any) | undefined;
|
|
13
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
14
|
+
declare const _default: typeof __VLS_export;
|
|
15
|
+
export default _default;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { NuGridFilterContext } from '../../types/cells.js';
|
|
2
|
+
interface Props {
|
|
3
|
+
context: NuGridFilterContext;
|
|
4
|
+
}
|
|
5
|
+
declare const __VLS_export: import("vue").DefineComponent<Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
6
|
+
declare const _default: typeof __VLS_export;
|
|
7
|
+
export default _default;
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import { computed, ref } from "vue";
|
|
3
|
+
const props = defineProps({
|
|
4
|
+
context: { type: Object, required: true }
|
|
5
|
+
});
|
|
6
|
+
const filterValue = computed({
|
|
7
|
+
get: () => props.context.filterValue.value,
|
|
8
|
+
set: (value) => props.context.setFilterValue(value)
|
|
9
|
+
});
|
|
10
|
+
const operator = ref("gte");
|
|
11
|
+
const operators = [
|
|
12
|
+
{ value: "equals", label: "Equals" },
|
|
13
|
+
{ value: "gte", label: "At least" },
|
|
14
|
+
{ value: "lte", label: "At most" },
|
|
15
|
+
{ value: "between", label: "Between" }
|
|
16
|
+
];
|
|
17
|
+
const filterValue2 = ref(null);
|
|
18
|
+
function clearFilter() {
|
|
19
|
+
filterValue.value = null;
|
|
20
|
+
filterValue2.value = null;
|
|
21
|
+
props.context.clearFilter();
|
|
22
|
+
}
|
|
23
|
+
</script>
|
|
24
|
+
|
|
25
|
+
<template>
|
|
26
|
+
<div class="min-w-[200px] space-y-2 p-2">
|
|
27
|
+
<div class="flex items-center gap-2">
|
|
28
|
+
<USelect
|
|
29
|
+
v-model="operator"
|
|
30
|
+
:options="operators"
|
|
31
|
+
option-attribute="label"
|
|
32
|
+
value-attribute="value"
|
|
33
|
+
class="flex-1"
|
|
34
|
+
/>
|
|
35
|
+
<UButton
|
|
36
|
+
v-if="context.isFiltered"
|
|
37
|
+
icon="i-heroicons-x-mark"
|
|
38
|
+
size="xs"
|
|
39
|
+
color="neutral"
|
|
40
|
+
variant="ghost"
|
|
41
|
+
@click="clearFilter"
|
|
42
|
+
/>
|
|
43
|
+
</div>
|
|
44
|
+
<div class="flex items-center gap-2">
|
|
45
|
+
<USelect
|
|
46
|
+
v-model="filterValue"
|
|
47
|
+
:options="[1, 2, 3, 4, 5].map((n) => ({ value: n, label: `${n} \u2B50` }))"
|
|
48
|
+
option-attribute="label"
|
|
49
|
+
value-attribute="value"
|
|
50
|
+
placeholder="Rating..."
|
|
51
|
+
autofocus
|
|
52
|
+
class="flex-1"
|
|
53
|
+
@update:model-value="context.setFilterValue($event)"
|
|
54
|
+
/>
|
|
55
|
+
</div>
|
|
56
|
+
<div v-if="operator === 'between'" class="flex items-center gap-2">
|
|
57
|
+
<span class="text-sm text-muted">and</span>
|
|
58
|
+
<USelect
|
|
59
|
+
v-model="filterValue2"
|
|
60
|
+
:options="[1, 2, 3, 4, 5].map((n) => ({ value: n, label: `${n} \u2B50` }))"
|
|
61
|
+
option-attribute="label"
|
|
62
|
+
value-attribute="value"
|
|
63
|
+
placeholder="To..."
|
|
64
|
+
class="flex-1"
|
|
65
|
+
@update:model-value="
|
|
66
|
+
context.setFilterValue({
|
|
67
|
+
from: filterValue,
|
|
68
|
+
to: filterValue2 ? Number(filterValue2) : null
|
|
69
|
+
})
|
|
70
|
+
"
|
|
71
|
+
/>
|
|
72
|
+
</div>
|
|
73
|
+
</div>
|
|
74
|
+
</template>
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { NuGridFilterContext } from '../../types/cells.js';
|
|
2
|
+
interface Props {
|
|
3
|
+
context: NuGridFilterContext;
|
|
4
|
+
}
|
|
5
|
+
declare const __VLS_export: import("vue").DefineComponent<Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
6
|
+
declare const _default: typeof __VLS_export;
|
|
7
|
+
export default _default;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
interface Props {
|
|
2
|
+
value: any;
|
|
3
|
+
row: any;
|
|
4
|
+
cell: any;
|
|
5
|
+
editable: boolean;
|
|
6
|
+
onUpdateValue?: (value: any) => void;
|
|
7
|
+
}
|
|
8
|
+
declare const __VLS_export: import("vue").DefineComponent<Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
9
|
+
declare const _default: typeof __VLS_export;
|
|
10
|
+
export default _default;
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import { computed, ref } from "vue";
|
|
3
|
+
defineOptions({ inheritAttrs: false });
|
|
4
|
+
const props = defineProps({
|
|
5
|
+
value: { type: null, required: true },
|
|
6
|
+
row: { type: null, required: true },
|
|
7
|
+
cell: { type: null, required: true },
|
|
8
|
+
editable: { type: Boolean, required: true },
|
|
9
|
+
onUpdateValue: { type: Function, required: false }
|
|
10
|
+
});
|
|
11
|
+
const hoveredStar = ref(null);
|
|
12
|
+
const rating = computed(() => {
|
|
13
|
+
const value = props.value;
|
|
14
|
+
if (value === null || value === void 0 || value === "") return null;
|
|
15
|
+
const numValue = Number(value);
|
|
16
|
+
if (Number.isNaN(numValue)) return null;
|
|
17
|
+
return Math.max(1, Math.min(5, Math.round(numValue)));
|
|
18
|
+
});
|
|
19
|
+
const displayValue = computed(() => hoveredStar.value ?? rating.value);
|
|
20
|
+
const isInteractive = computed(() => props.editable && typeof props.onUpdateValue === "function");
|
|
21
|
+
function handleSet(value) {
|
|
22
|
+
if (!isInteractive.value) return;
|
|
23
|
+
props.onUpdateValue?.(value);
|
|
24
|
+
}
|
|
25
|
+
function starClass(star) {
|
|
26
|
+
return star <= (displayValue.value ?? 0) ? "text-yellow-400" : "text-gray-300";
|
|
27
|
+
}
|
|
28
|
+
</script>
|
|
29
|
+
|
|
30
|
+
<template>
|
|
31
|
+
<div class="flex items-center gap-1" :class="isInteractive ? 'cursor-pointer' : 'opacity-70'">
|
|
32
|
+
<button
|
|
33
|
+
v-for="star in 5"
|
|
34
|
+
:key="star"
|
|
35
|
+
type="button"
|
|
36
|
+
class="rounded transition-all hover:scale-105 focus-visible:ring-2
|
|
37
|
+
focus-visible:ring-primary-500 focus-visible:outline-none"
|
|
38
|
+
:class="starClass(star)"
|
|
39
|
+
:disabled="!isInteractive"
|
|
40
|
+
:tabindex="isInteractive ? 0 : -1"
|
|
41
|
+
:aria-label="`Set rating to ${star}`"
|
|
42
|
+
@mouseenter="isInteractive && (hoveredStar = star)"
|
|
43
|
+
@mouseleave="isInteractive && (hoveredStar = null)"
|
|
44
|
+
@focus="isInteractive && (hoveredStar = star)"
|
|
45
|
+
@blur="isInteractive && (hoveredStar = null)"
|
|
46
|
+
@click.stop="handleSet(star)"
|
|
47
|
+
>
|
|
48
|
+
<svg
|
|
49
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
50
|
+
viewBox="0 0 24 24"
|
|
51
|
+
fill="currentColor"
|
|
52
|
+
class="h-5 w-5"
|
|
53
|
+
>
|
|
54
|
+
<path
|
|
55
|
+
d="M12 2l3.09 6.26L22 9.27l-5 4.87 1.18 6.88L12 17.77l-6.18 3.25L7 14.14 2 9.27l6.91-1.01L12 2z"
|
|
56
|
+
/>
|
|
57
|
+
</svg>
|
|
58
|
+
</button>
|
|
59
|
+
<UButton
|
|
60
|
+
icon="i-heroicons-x-mark"
|
|
61
|
+
size="xs"
|
|
62
|
+
color="neutral"
|
|
63
|
+
variant="ghost"
|
|
64
|
+
class="ml-1"
|
|
65
|
+
:disabled="!isInteractive"
|
|
66
|
+
:tabindex="isInteractive ? 0 : -1"
|
|
67
|
+
aria-label="Clear rating"
|
|
68
|
+
@click.stop="handleSet(null)"
|
|
69
|
+
/>
|
|
70
|
+
<span v-if="displayValue !== null" class="ml-1 text-sm text-gray-500"
|
|
71
|
+
>{{ displayValue }}/5</span
|
|
72
|
+
>
|
|
73
|
+
<span v-else class="ml-1 text-sm text-gray-400">—</span>
|
|
74
|
+
</div>
|
|
75
|
+
</template>
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
interface Props {
|
|
2
|
+
value: any;
|
|
3
|
+
row: any;
|
|
4
|
+
cell: any;
|
|
5
|
+
editable: boolean;
|
|
6
|
+
onUpdateValue?: (value: any) => void;
|
|
7
|
+
}
|
|
8
|
+
declare const __VLS_export: import("vue").DefineComponent<Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
9
|
+
declare const _default: typeof __VLS_export;
|
|
10
|
+
export default _default;
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import RatingEditor from "./RatingEditor.vue";
|
|
2
|
+
import RatingFilter from "./RatingFilter.vue";
|
|
3
|
+
import RatingRenderer from "./RatingRenderer.vue";
|
|
4
|
+
export const ratingCellType = {
|
|
5
|
+
name: "rating",
|
|
6
|
+
displayName: "Rating",
|
|
7
|
+
description: "1-5 star rating column with visual stars",
|
|
8
|
+
editor: RatingEditor,
|
|
9
|
+
renderer: RatingRenderer,
|
|
10
|
+
filter: {
|
|
11
|
+
component: RatingFilter,
|
|
12
|
+
defaultOperator: "gte"
|
|
13
|
+
},
|
|
14
|
+
enableFiltering: true,
|
|
15
|
+
validation: (value) => {
|
|
16
|
+
if (value === null || value === void 0) {
|
|
17
|
+
return { valid: true };
|
|
18
|
+
}
|
|
19
|
+
const numValue = Number(value);
|
|
20
|
+
if (Number.isNaN(numValue) || numValue < 0 || numValue > 5) {
|
|
21
|
+
return {
|
|
22
|
+
valid: false,
|
|
23
|
+
message: "Rating must be between 0 and 5"
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
return { valid: true };
|
|
27
|
+
},
|
|
28
|
+
formatter: (value) => {
|
|
29
|
+
if (value === null || value === void 0) return "";
|
|
30
|
+
const numValue = Number(value);
|
|
31
|
+
if (Number.isNaN(numValue)) return String(value);
|
|
32
|
+
return `${numValue} \u2B50`;
|
|
33
|
+
},
|
|
34
|
+
keyboardHandler: (event, context) => {
|
|
35
|
+
const { isFocused, canEdit, getValue, row, columnDef, data, tableApi, emitChange } = context;
|
|
36
|
+
if (isFocused && canEdit) {
|
|
37
|
+
if (event.key === "0") {
|
|
38
|
+
const oldValue = getValue();
|
|
39
|
+
const rowIndex = data.findIndex((r, index) => {
|
|
40
|
+
return tableApi.options.getRowId?.(r, index) === row.id || r === row.original;
|
|
41
|
+
});
|
|
42
|
+
if (rowIndex !== -1 && columnDef.accessorKey) {
|
|
43
|
+
const key = columnDef.accessorKey;
|
|
44
|
+
data[rowIndex][key] = null;
|
|
45
|
+
emitChange(oldValue, null);
|
|
46
|
+
}
|
|
47
|
+
return { handled: true, preventDefault: true, stopPropagation: true };
|
|
48
|
+
} else if (event.key >= "1" && event.key <= "5") {
|
|
49
|
+
const newValue = Number.parseInt(event.key);
|
|
50
|
+
const oldValue = getValue();
|
|
51
|
+
const rowIndex = data.findIndex((r, index) => {
|
|
52
|
+
return tableApi.options.getRowId?.(r, index) === row.id || r === row.original;
|
|
53
|
+
});
|
|
54
|
+
if (rowIndex !== -1 && columnDef.accessorKey) {
|
|
55
|
+
const key = columnDef.accessorKey;
|
|
56
|
+
data[rowIndex][key] = newValue;
|
|
57
|
+
emitChange(oldValue, newValue);
|
|
58
|
+
}
|
|
59
|
+
return { handled: true, preventDefault: true, stopPropagation: true };
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
return { handled: false };
|
|
63
|
+
},
|
|
64
|
+
defaultColumnDef: {
|
|
65
|
+
size: 120
|
|
66
|
+
}
|
|
67
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { NuGridCellEditorProps } from '../../types/index.js';
|
|
2
|
+
type __VLS_Props = NuGridCellEditorProps;
|
|
3
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
|
|
4
|
+
"update:modelValue": (value: any) => any;
|
|
5
|
+
"update:isNavigating": (value: boolean) => any;
|
|
6
|
+
"stop-editing": (moveDirection?: "up" | "down" | "next" | "previous" | undefined) => any;
|
|
7
|
+
"cancel-editing": () => any;
|
|
8
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
9
|
+
"onUpdate:modelValue"?: ((value: any) => any) | undefined;
|
|
10
|
+
"onUpdate:isNavigating"?: ((value: boolean) => any) | undefined;
|
|
11
|
+
"onStop-editing"?: ((moveDirection?: "up" | "down" | "next" | "previous" | undefined) => any) | undefined;
|
|
12
|
+
"onCancel-editing"?: (() => any) | undefined;
|
|
13
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
14
|
+
declare const _default: typeof __VLS_export;
|
|
15
|
+
export default _default;
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import { ref } from "vue";
|
|
3
|
+
import NuGridCellCheckbox from "../../components/NuGridCellCheckbox.vue";
|
|
4
|
+
import { useNuGridCellEditor } from "../../composables/useNuGridCellEditor";
|
|
5
|
+
defineOptions({ inheritAttrs: false });
|
|
6
|
+
const props = defineProps({
|
|
7
|
+
modelValue: { type: null, required: true },
|
|
8
|
+
cell: { type: null, required: true },
|
|
9
|
+
row: { type: Object, required: true },
|
|
10
|
+
isNavigating: { type: Boolean, required: true },
|
|
11
|
+
shouldFocus: { type: Boolean, required: true },
|
|
12
|
+
validationError: { type: [String, null], required: false },
|
|
13
|
+
showValidationErrors: { type: String, required: false },
|
|
14
|
+
interactionRouter: { type: Object, required: false }
|
|
15
|
+
});
|
|
16
|
+
const emit = defineEmits(["update:modelValue", "stop-editing", "cancel-editing", "update:isNavigating"]);
|
|
17
|
+
const checkboxRef = ref(null);
|
|
18
|
+
const isSelected = computed(() => props.row.getIsSelected());
|
|
19
|
+
const canRowBeSelected = computed(() => props.row.getCanSelect());
|
|
20
|
+
const { handleKeydown, handleBlur } = useNuGridCellEditor(props, emit, checkboxRef, () => {
|
|
21
|
+
checkboxRef.value?.focus({ preventScroll: true });
|
|
22
|
+
});
|
|
23
|
+
const handleToggle = (value) => {
|
|
24
|
+
if (!canRowBeSelected.value) {
|
|
25
|
+
return;
|
|
26
|
+
}
|
|
27
|
+
props.row.toggleSelected(!!value);
|
|
28
|
+
emit("update:modelValue", value);
|
|
29
|
+
};
|
|
30
|
+
</script>
|
|
31
|
+
|
|
32
|
+
<template>
|
|
33
|
+
<NuGridCellCheckbox
|
|
34
|
+
ref="checkboxRef"
|
|
35
|
+
:model-value="isSelected"
|
|
36
|
+
:interactive="canRowBeSelected"
|
|
37
|
+
:disabled="!canRowBeSelected"
|
|
38
|
+
@update:model-value="handleToggle"
|
|
39
|
+
@keydown="handleKeydown"
|
|
40
|
+
@blur="handleBlur"
|
|
41
|
+
/>
|
|
42
|
+
</template>
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { NuGridCellEditorProps } from '../../types/index.js';
|
|
2
|
+
type __VLS_Props = NuGridCellEditorProps;
|
|
3
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
|
|
4
|
+
"update:modelValue": (value: any) => any;
|
|
5
|
+
"update:isNavigating": (value: boolean) => any;
|
|
6
|
+
"stop-editing": (moveDirection?: "up" | "down" | "next" | "previous" | undefined) => any;
|
|
7
|
+
"cancel-editing": () => any;
|
|
8
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
9
|
+
"onUpdate:modelValue"?: ((value: any) => any) | undefined;
|
|
10
|
+
"onUpdate:isNavigating"?: ((value: boolean) => any) | undefined;
|
|
11
|
+
"onStop-editing"?: ((moveDirection?: "up" | "down" | "next" | "previous" | undefined) => any) | undefined;
|
|
12
|
+
"onCancel-editing"?: (() => any) | undefined;
|
|
13
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
14
|
+
declare const _default: typeof __VLS_export;
|
|
15
|
+
export default _default;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { Row } from '@tanstack/vue-table';
|
|
2
|
+
interface Props {
|
|
3
|
+
row: Row<any>;
|
|
4
|
+
editable?: boolean;
|
|
5
|
+
}
|
|
6
|
+
declare const __VLS_export: import("vue").DefineComponent<Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
7
|
+
"update:value": (value: boolean | "indeterminate") => any;
|
|
8
|
+
}, string, import("vue").PublicProps, Readonly<Props> & Readonly<{
|
|
9
|
+
"onUpdate:value"?: ((value: boolean | "indeterminate") => any) | undefined;
|
|
10
|
+
}>, {
|
|
11
|
+
editable: boolean;
|
|
12
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
13
|
+
declare const _default: typeof __VLS_export;
|
|
14
|
+
export default _default;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import NuGridCellCheckbox from "../../components/NuGridCellCheckbox.vue";
|
|
3
|
+
defineOptions({ inheritAttrs: false });
|
|
4
|
+
const props = defineProps({
|
|
5
|
+
row: { type: Object, required: true },
|
|
6
|
+
editable: { type: Boolean, required: false, default: false }
|
|
7
|
+
});
|
|
8
|
+
const emit = defineEmits(["update:value"]);
|
|
9
|
+
const isSelected = computed(() => props.row.getIsSelected());
|
|
10
|
+
const canRowBeSelected = computed(() => props.row.getCanSelect());
|
|
11
|
+
const handleUpdate = (newValue) => {
|
|
12
|
+
if (!canRowBeSelected.value) return;
|
|
13
|
+
props.row.toggleSelected(!!newValue);
|
|
14
|
+
emit("update:value", newValue);
|
|
15
|
+
};
|
|
16
|
+
</script>
|
|
17
|
+
|
|
18
|
+
<template>
|
|
19
|
+
<NuGridCellCheckbox
|
|
20
|
+
:model-value="isSelected"
|
|
21
|
+
:disabled="!canRowBeSelected"
|
|
22
|
+
:interactive="canRowBeSelected"
|
|
23
|
+
@update:model-value="handleUpdate"
|
|
24
|
+
/>
|
|
25
|
+
</template>
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { Row } from '@tanstack/vue-table';
|
|
2
|
+
interface Props {
|
|
3
|
+
row: Row<any>;
|
|
4
|
+
editable?: boolean;
|
|
5
|
+
}
|
|
6
|
+
declare const __VLS_export: import("vue").DefineComponent<Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
7
|
+
"update:value": (value: boolean | "indeterminate") => any;
|
|
8
|
+
}, string, import("vue").PublicProps, Readonly<Props> & Readonly<{
|
|
9
|
+
"onUpdate:value"?: ((value: boolean | "indeterminate") => any) | undefined;
|
|
10
|
+
}>, {
|
|
11
|
+
editable: boolean;
|
|
12
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
13
|
+
declare const _default: typeof __VLS_export;
|
|
14
|
+
export default _default;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { NuGridCellType } from '../../types/cells.js';
|
|
2
|
+
/**
|
|
3
|
+
* Selection cell type
|
|
4
|
+
* Selection checkbox with special keyboard handling:
|
|
5
|
+
* - Space: Toggle the selection state directly without entering edit mode
|
|
6
|
+
* - Enter: Prevent entering edit mode (do nothing)
|
|
7
|
+
*/
|
|
8
|
+
export declare const selectionCellType: NuGridCellType;
|