@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.
Files changed (348) hide show
  1. package/LICENSE.md +21 -0
  2. package/README.md +261 -0
  3. package/dist/module.d.mts +13 -0
  4. package/dist/module.json +9 -0
  5. package/dist/module.mjs +52 -0
  6. package/dist/runtime/cell-types/action-menu/ActionMenuRenderer.d.vue.ts +12 -0
  7. package/dist/runtime/cell-types/action-menu/ActionMenuRenderer.vue +123 -0
  8. package/dist/runtime/cell-types/action-menu/ActionMenuRenderer.vue.d.ts +12 -0
  9. package/dist/runtime/cell-types/action-menu/index.d.ts +8 -0
  10. package/dist/runtime/cell-types/action-menu/index.js +28 -0
  11. package/dist/runtime/cell-types/boolean/BooleanEditor.d.vue.ts +15 -0
  12. package/dist/runtime/cell-types/boolean/BooleanEditor.vue +32 -0
  13. package/dist/runtime/cell-types/boolean/BooleanEditor.vue.d.ts +15 -0
  14. package/dist/runtime/cell-types/boolean/BooleanFilter.d.vue.ts +7 -0
  15. package/dist/runtime/cell-types/boolean/BooleanFilter.vue +42 -0
  16. package/dist/runtime/cell-types/boolean/BooleanFilter.vue.d.ts +7 -0
  17. package/dist/runtime/cell-types/boolean/BooleanRenderer.d.vue.ts +13 -0
  18. package/dist/runtime/cell-types/boolean/BooleanRenderer.vue +23 -0
  19. package/dist/runtime/cell-types/boolean/BooleanRenderer.vue.d.ts +13 -0
  20. package/dist/runtime/cell-types/boolean/index.d.ts +8 -0
  21. package/dist/runtime/cell-types/boolean/index.js +31 -0
  22. package/dist/runtime/cell-types/currency/CurrencyEditor.d.vue.ts +15 -0
  23. package/dist/runtime/cell-types/currency/CurrencyEditor.vue +40 -0
  24. package/dist/runtime/cell-types/currency/CurrencyEditor.vue.d.ts +15 -0
  25. package/dist/runtime/cell-types/currency/CurrencyFilter.d.vue.ts +7 -0
  26. package/dist/runtime/cell-types/currency/CurrencyFilter.vue +76 -0
  27. package/dist/runtime/cell-types/currency/CurrencyFilter.vue.d.ts +7 -0
  28. package/dist/runtime/cell-types/currency/index.d.ts +6 -0
  29. package/dist/runtime/cell-types/currency/index.js +42 -0
  30. package/dist/runtime/cell-types/date/DateEditor.d.vue.ts +15 -0
  31. package/dist/runtime/cell-types/date/DateEditor.vue +42 -0
  32. package/dist/runtime/cell-types/date/DateEditor.vue.d.ts +15 -0
  33. package/dist/runtime/cell-types/date/DateFilter.d.vue.ts +7 -0
  34. package/dist/runtime/cell-types/date/DateFilter.vue +58 -0
  35. package/dist/runtime/cell-types/date/DateFilter.vue.d.ts +7 -0
  36. package/dist/runtime/cell-types/date/index.d.ts +6 -0
  37. package/dist/runtime/cell-types/date/index.js +13 -0
  38. package/dist/runtime/cell-types/index.d.ts +17 -0
  39. package/dist/runtime/cell-types/index.js +34 -0
  40. package/dist/runtime/cell-types/lookup/LookupEditor.d.vue.ts +15 -0
  41. package/dist/runtime/cell-types/lookup/LookupEditor.vue +291 -0
  42. package/dist/runtime/cell-types/lookup/LookupEditor.vue.d.ts +15 -0
  43. package/dist/runtime/cell-types/lookup/LookupRenderer.d.vue.ts +8 -0
  44. package/dist/runtime/cell-types/lookup/LookupRenderer.vue +43 -0
  45. package/dist/runtime/cell-types/lookup/LookupRenderer.vue.d.ts +8 -0
  46. package/dist/runtime/cell-types/lookup/index.d.ts +36 -0
  47. package/dist/runtime/cell-types/lookup/index.js +50 -0
  48. package/dist/runtime/cell-types/number/NumberEditor.d.vue.ts +15 -0
  49. package/dist/runtime/cell-types/number/NumberEditor.vue +34 -0
  50. package/dist/runtime/cell-types/number/NumberEditor.vue.d.ts +15 -0
  51. package/dist/runtime/cell-types/number/NumberFilter.d.vue.ts +7 -0
  52. package/dist/runtime/cell-types/number/NumberFilter.vue +66 -0
  53. package/dist/runtime/cell-types/number/NumberFilter.vue.d.ts +7 -0
  54. package/dist/runtime/cell-types/number/index.d.ts +6 -0
  55. package/dist/runtime/cell-types/number/index.js +13 -0
  56. package/dist/runtime/cell-types/rating/RatingEditor.d.vue.ts +15 -0
  57. package/dist/runtime/cell-types/rating/RatingEditor.vue +219 -0
  58. package/dist/runtime/cell-types/rating/RatingEditor.vue.d.ts +15 -0
  59. package/dist/runtime/cell-types/rating/RatingFilter.d.vue.ts +7 -0
  60. package/dist/runtime/cell-types/rating/RatingFilter.vue +74 -0
  61. package/dist/runtime/cell-types/rating/RatingFilter.vue.d.ts +7 -0
  62. package/dist/runtime/cell-types/rating/RatingRenderer.d.vue.ts +10 -0
  63. package/dist/runtime/cell-types/rating/RatingRenderer.vue +75 -0
  64. package/dist/runtime/cell-types/rating/RatingRenderer.vue.d.ts +10 -0
  65. package/dist/runtime/cell-types/rating/index.d.ts +6 -0
  66. package/dist/runtime/cell-types/rating/index.js +67 -0
  67. package/dist/runtime/cell-types/selection/SelectionEditor.d.vue.ts +15 -0
  68. package/dist/runtime/cell-types/selection/SelectionEditor.vue +42 -0
  69. package/dist/runtime/cell-types/selection/SelectionEditor.vue.d.ts +15 -0
  70. package/dist/runtime/cell-types/selection/SelectionRenderer.d.vue.ts +14 -0
  71. package/dist/runtime/cell-types/selection/SelectionRenderer.vue +25 -0
  72. package/dist/runtime/cell-types/selection/SelectionRenderer.vue.d.ts +14 -0
  73. package/dist/runtime/cell-types/selection/index.d.ts +8 -0
  74. package/dist/runtime/cell-types/selection/index.js +36 -0
  75. package/dist/runtime/cell-types/text/TextEditor.d.vue.ts +15 -0
  76. package/dist/runtime/cell-types/text/TextEditor.vue +70 -0
  77. package/dist/runtime/cell-types/text/TextEditor.vue.d.ts +15 -0
  78. package/dist/runtime/cell-types/text/TextFilter.d.vue.ts +7 -0
  79. package/dist/runtime/cell-types/text/TextFilter.vue +50 -0
  80. package/dist/runtime/cell-types/text/TextFilter.vue.d.ts +7 -0
  81. package/dist/runtime/cell-types/text/TextareaEditor.d.vue.ts +15 -0
  82. package/dist/runtime/cell-types/text/TextareaEditor.vue +100 -0
  83. package/dist/runtime/cell-types/text/TextareaEditor.vue.d.ts +15 -0
  84. package/dist/runtime/cell-types/text/index.d.ts +10 -0
  85. package/dist/runtime/cell-types/text/index.js +16 -0
  86. package/dist/runtime/cell-types/text/textarea.d.ts +13 -0
  87. package/dist/runtime/cell-types/text/textarea.js +13 -0
  88. package/dist/runtime/components/NuGrid.d.vue.ts +96 -0
  89. package/dist/runtime/components/NuGrid.vue +651 -0
  90. package/dist/runtime/components/NuGrid.vue.d.ts +96 -0
  91. package/dist/runtime/components/NuGridCellCheckbox.d.vue.ts +24 -0
  92. package/dist/runtime/components/NuGridCellCheckbox.vue +105 -0
  93. package/dist/runtime/components/NuGridCellCheckbox.vue.d.ts +24 -0
  94. package/dist/runtime/components/NuGridGroup.d.vue.ts +20 -0
  95. package/dist/runtime/components/NuGridGroup.vue +650 -0
  96. package/dist/runtime/components/NuGridGroup.vue.d.ts +20 -0
  97. package/dist/runtime/components/NuGridLazyCell.d.vue.ts +62 -0
  98. package/dist/runtime/components/NuGridLazyCell.vue +133 -0
  99. package/dist/runtime/components/NuGridLazyCell.vue.d.ts +62 -0
  100. package/dist/runtime/components/_internal/NuGridAddRow.d.vue.ts +36 -0
  101. package/dist/runtime/components/_internal/NuGridAddRow.vue +144 -0
  102. package/dist/runtime/components/_internal/NuGridAddRow.vue.d.ts +36 -0
  103. package/dist/runtime/components/_internal/NuGridBase.d.vue.ts +20 -0
  104. package/dist/runtime/components/_internal/NuGridBase.vue +1172 -0
  105. package/dist/runtime/components/_internal/NuGridBase.vue.d.ts +20 -0
  106. package/dist/runtime/components/_internal/NuGridCellContent.d.vue.ts +9 -0
  107. package/dist/runtime/components/_internal/NuGridCellContent.vue +202 -0
  108. package/dist/runtime/components/_internal/NuGridCellContent.vue.d.ts +9 -0
  109. package/dist/runtime/components/_internal/NuGridColumnMenu.d.vue.ts +25 -0
  110. package/dist/runtime/components/_internal/NuGridColumnMenu.vue +391 -0
  111. package/dist/runtime/components/_internal/NuGridColumnMenu.vue.d.ts +25 -0
  112. package/dist/runtime/components/_internal/NuGridGroup.d.vue.ts +20 -0
  113. package/dist/runtime/components/_internal/NuGridGroup.vue +650 -0
  114. package/dist/runtime/components/_internal/NuGridGroup.vue.d.ts +20 -0
  115. package/dist/runtime/components/_internal/NuGridGroupCheckbox.d.vue.ts +22 -0
  116. package/dist/runtime/components/_internal/NuGridGroupCheckbox.vue +132 -0
  117. package/dist/runtime/components/_internal/NuGridGroupCheckbox.vue.d.ts +22 -0
  118. package/dist/runtime/components/_internal/NuGridHeaderSortButton.d.vue.ts +31 -0
  119. package/dist/runtime/components/_internal/NuGridHeaderSortButton.vue +61 -0
  120. package/dist/runtime/components/_internal/NuGridHeaderSortButton.vue.d.ts +31 -0
  121. package/dist/runtime/components/_internal/NuGridPaging.d.vue.ts +3 -0
  122. package/dist/runtime/components/_internal/NuGridPaging.vue +65 -0
  123. package/dist/runtime/components/_internal/NuGridPaging.vue.d.ts +3 -0
  124. package/dist/runtime/components/_internal/NuGridRow.d.vue.ts +40 -0
  125. package/dist/runtime/components/_internal/NuGridRow.vue +645 -0
  126. package/dist/runtime/components/_internal/NuGridRow.vue.d.ts +40 -0
  127. package/dist/runtime/components/_internal/NuGridSplitGroup.d.vue.ts +20 -0
  128. package/dist/runtime/components/_internal/NuGridSplitGroup.vue +735 -0
  129. package/dist/runtime/components/_internal/NuGridSplitGroup.vue.d.ts +20 -0
  130. package/dist/runtime/components/_internal/NuGridTooltip.d.vue.ts +3 -0
  131. package/dist/runtime/components/_internal/NuGridTooltip.vue +36 -0
  132. package/dist/runtime/components/_internal/NuGridTooltip.vue.d.ts +3 -0
  133. package/dist/runtime/composables/_internal/index.d.ts +31 -0
  134. package/dist/runtime/composables/_internal/index.js +28 -0
  135. package/dist/runtime/composables/_internal/keyboard-handlers/index.d.ts +5 -0
  136. package/dist/runtime/composables/_internal/keyboard-handlers/index.js +9 -0
  137. package/dist/runtime/composables/_internal/keyboard-handlers/useKeyboardCellTypeDispatch.d.ts +18 -0
  138. package/dist/runtime/composables/_internal/keyboard-handlers/useKeyboardCellTypeDispatch.js +53 -0
  139. package/dist/runtime/composables/_internal/keyboard-handlers/useKeyboardEditingTriggers.d.ts +12 -0
  140. package/dist/runtime/composables/_internal/keyboard-handlers/useKeyboardEditingTriggers.js +53 -0
  141. package/dist/runtime/composables/_internal/keyboard-handlers/useKeyboardNavigation.d.ts +9 -0
  142. package/dist/runtime/composables/_internal/keyboard-handlers/useKeyboardNavigation.js +35 -0
  143. package/dist/runtime/composables/_internal/keyboard-handlers/useKeyboardSetup.d.ts +33 -0
  144. package/dist/runtime/composables/_internal/keyboard-handlers/useKeyboardSetup.js +111 -0
  145. package/dist/runtime/composables/_internal/keyboard-handlers/usePagingKeyboard.d.ts +11 -0
  146. package/dist/runtime/composables/_internal/keyboard-handlers/usePagingKeyboard.js +67 -0
  147. package/dist/runtime/composables/_internal/useNuGridActionMenu.d.ts +15 -0
  148. package/dist/runtime/composables/_internal/useNuGridActionMenu.js +137 -0
  149. package/dist/runtime/composables/_internal/useNuGridAddRow.d.ts +39 -0
  150. package/dist/runtime/composables/_internal/useNuGridAddRow.js +735 -0
  151. package/dist/runtime/composables/_internal/useNuGridAnimation.d.ts +33 -0
  152. package/dist/runtime/composables/_internal/useNuGridAnimation.js +178 -0
  153. package/dist/runtime/composables/_internal/useNuGridAutosize.d.ts +14 -0
  154. package/dist/runtime/composables/_internal/useNuGridAutosize.js +161 -0
  155. package/dist/runtime/composables/_internal/useNuGridCellEditing.d.ts +15 -0
  156. package/dist/runtime/composables/_internal/useNuGridCellEditing.js +1243 -0
  157. package/dist/runtime/composables/_internal/useNuGridColumnDragDrop.d.ts +8 -0
  158. package/dist/runtime/composables/_internal/useNuGridColumnDragDrop.js +148 -0
  159. package/dist/runtime/composables/_internal/useNuGridColumnPinning.d.ts +15 -0
  160. package/dist/runtime/composables/_internal/useNuGridColumnPinning.js +44 -0
  161. package/dist/runtime/composables/_internal/useNuGridColumnResize.d.ts +22 -0
  162. package/dist/runtime/composables/_internal/useNuGridColumnResize.js +427 -0
  163. package/dist/runtime/composables/_internal/useNuGridCore.d.ts +62 -0
  164. package/dist/runtime/composables/_internal/useNuGridCore.js +359 -0
  165. package/dist/runtime/composables/_internal/useNuGridExcel.d.ts +60 -0
  166. package/dist/runtime/composables/_internal/useNuGridExcel.js +35 -0
  167. package/dist/runtime/composables/_internal/useNuGridFocus.d.ts +15 -0
  168. package/dist/runtime/composables/_internal/useNuGridFocus.js +1378 -0
  169. package/dist/runtime/composables/_internal/useNuGridGroupSelection.d.ts +13 -0
  170. package/dist/runtime/composables/_internal/useNuGridGroupSelection.js +38 -0
  171. package/dist/runtime/composables/_internal/useNuGridGrouping.d.ts +28 -0
  172. package/dist/runtime/composables/_internal/useNuGridGrouping.js +211 -0
  173. package/dist/runtime/composables/_internal/useNuGridInteractionRouter.d.ts +9 -0
  174. package/dist/runtime/composables/_internal/useNuGridInteractionRouter.js +441 -0
  175. package/dist/runtime/composables/_internal/useNuGridInteractions.d.ts +10 -0
  176. package/dist/runtime/composables/_internal/useNuGridInteractions.js +36 -0
  177. package/dist/runtime/composables/_internal/useNuGridKeyboardNavigation.d.ts +54 -0
  178. package/dist/runtime/composables/_internal/useNuGridKeyboardNavigation.js +407 -0
  179. package/dist/runtime/composables/_internal/useNuGridPaging.d.ts +76 -0
  180. package/dist/runtime/composables/_internal/useNuGridPaging.js +147 -0
  181. package/dist/runtime/composables/_internal/useNuGridRowDragDrop.d.ts +68 -0
  182. package/dist/runtime/composables/_internal/useNuGridRowDragDrop.js +295 -0
  183. package/dist/runtime/composables/_internal/useNuGridRowSelection.d.ts +14 -0
  184. package/dist/runtime/composables/_internal/useNuGridRowSelection.js +214 -0
  185. package/dist/runtime/composables/_internal/useNuGridScroll.d.ts +110 -0
  186. package/dist/runtime/composables/_internal/useNuGridScroll.js +463 -0
  187. package/dist/runtime/composables/_internal/useNuGridScrollState.d.ts +32 -0
  188. package/dist/runtime/composables/_internal/useNuGridScrollState.js +60 -0
  189. package/dist/runtime/composables/_internal/useNuGridScrollbars.d.ts +24 -0
  190. package/dist/runtime/composables/_internal/useNuGridScrollbars.js +69 -0
  191. package/dist/runtime/composables/_internal/useNuGridStatePersistence.d.ts +27 -0
  192. package/dist/runtime/composables/_internal/useNuGridStatePersistence.js +243 -0
  193. package/dist/runtime/composables/_internal/useNuGridTooltip.d.ts +41 -0
  194. package/dist/runtime/composables/_internal/useNuGridTooltip.js +304 -0
  195. package/dist/runtime/composables/_internal/useNuGridUI.d.ts +3283 -0
  196. package/dist/runtime/composables/_internal/useNuGridUI.js +58 -0
  197. package/dist/runtime/composables/_internal/useNuGridVirtualization.d.ts +75 -0
  198. package/dist/runtime/composables/_internal/useNuGridVirtualization.js +534 -0
  199. package/dist/runtime/composables/_internal/useNuGridWheelSmoothing.d.ts +25 -0
  200. package/dist/runtime/composables/_internal/useNuGridWheelSmoothing.js +157 -0
  201. package/dist/runtime/composables/index.d.ts +3 -0
  202. package/dist/runtime/composables/index.js +2 -0
  203. package/dist/runtime/composables/useNuGridCellEditor.d.ts +91 -0
  204. package/dist/runtime/composables/useNuGridCellEditor.js +82 -0
  205. package/dist/runtime/composables/useNuGridCellTypeRegistry.d.ts +85 -0
  206. package/dist/runtime/composables/useNuGridCellTypeRegistry.js +202 -0
  207. package/dist/runtime/config/_internal/index.d.ts +5 -0
  208. package/dist/runtime/config/_internal/index.js +2 -0
  209. package/dist/runtime/config/_internal/options-defaults.d.ts +121 -0
  210. package/dist/runtime/config/_internal/options-defaults.js +121 -0
  211. package/dist/runtime/config/_internal/prop-utils.d.ts +54 -0
  212. package/dist/runtime/config/_internal/prop-utils.js +21 -0
  213. package/dist/runtime/config/config.d.ts +44 -0
  214. package/dist/runtime/config/config.js +18 -0
  215. package/dist/runtime/config/index.d.ts +2 -0
  216. package/dist/runtime/config/index.js +2 -0
  217. package/dist/runtime/config/presets.d.ts +15 -0
  218. package/dist/runtime/config/presets.js +58 -0
  219. package/dist/runtime/index.css +1 -0
  220. package/dist/runtime/index.d.ts +1 -0
  221. package/dist/runtime/index.js +1 -0
  222. package/dist/runtime/plugin.d.ts +5 -0
  223. package/dist/runtime/plugin.js +10 -0
  224. package/dist/runtime/themes/index.d.ts +56 -0
  225. package/dist/runtime/themes/index.js +68 -0
  226. package/dist/runtime/themes/nuGridTheme.d.ts +329 -0
  227. package/dist/runtime/themes/nuGridTheme.js +236 -0
  228. package/dist/runtime/themes/nuGridThemeCompact.d.ts +331 -0
  229. package/dist/runtime/themes/nuGridThemeCompact.js +236 -0
  230. package/dist/runtime/types/_internal/action-menu.d.ts +55 -0
  231. package/dist/runtime/types/_internal/action-menu.js +0 -0
  232. package/dist/runtime/types/_internal/cell-editing.d.ts +75 -0
  233. package/dist/runtime/types/_internal/cell-editing.js +0 -0
  234. package/dist/runtime/types/_internal/composable-returns.d.ts +52 -0
  235. package/dist/runtime/types/_internal/composable-returns.js +0 -0
  236. package/dist/runtime/types/_internal/config.d.ts +16 -0
  237. package/dist/runtime/types/_internal/config.js +0 -0
  238. package/dist/runtime/types/_internal/contexts/add-row.d.ts +25 -0
  239. package/dist/runtime/types/_internal/contexts/add-row.js +0 -0
  240. package/dist/runtime/types/_internal/contexts/animation.d.ts +24 -0
  241. package/dist/runtime/types/_internal/contexts/animation.js +0 -0
  242. package/dist/runtime/types/_internal/contexts/core.d.ts +24 -0
  243. package/dist/runtime/types/_internal/contexts/core.js +0 -0
  244. package/dist/runtime/types/_internal/contexts/drag.d.ts +13 -0
  245. package/dist/runtime/types/_internal/contexts/drag.js +0 -0
  246. package/dist/runtime/types/_internal/contexts/focus.d.ts +11 -0
  247. package/dist/runtime/types/_internal/contexts/focus.js +0 -0
  248. package/dist/runtime/types/_internal/contexts/grouping.d.ts +9 -0
  249. package/dist/runtime/types/_internal/contexts/grouping.js +0 -0
  250. package/dist/runtime/types/_internal/contexts/index.d.ts +15 -0
  251. package/dist/runtime/types/_internal/contexts/index.js +0 -0
  252. package/dist/runtime/types/_internal/contexts/interaction-router.d.ts +5 -0
  253. package/dist/runtime/types/_internal/contexts/interaction-router.js +0 -0
  254. package/dist/runtime/types/_internal/contexts/multi-row.d.ts +40 -0
  255. package/dist/runtime/types/_internal/contexts/multi-row.js +0 -0
  256. package/dist/runtime/types/_internal/contexts/paging.d.ts +39 -0
  257. package/dist/runtime/types/_internal/contexts/paging.js +0 -0
  258. package/dist/runtime/types/_internal/contexts/performance.d.ts +15 -0
  259. package/dist/runtime/types/_internal/contexts/performance.js +0 -0
  260. package/dist/runtime/types/_internal/contexts/resize.d.ts +12 -0
  261. package/dist/runtime/types/_internal/contexts/resize.js +0 -0
  262. package/dist/runtime/types/_internal/contexts/row-interactions.d.ts +12 -0
  263. package/dist/runtime/types/_internal/contexts/row-interactions.js +0 -0
  264. package/dist/runtime/types/_internal/contexts/scroll-state.d.ts +21 -0
  265. package/dist/runtime/types/_internal/contexts/scroll-state.js +0 -0
  266. package/dist/runtime/types/_internal/contexts/ui-config.d.ts +21 -0
  267. package/dist/runtime/types/_internal/contexts/ui-config.js +0 -0
  268. package/dist/runtime/types/_internal/contexts/virtualization.d.ts +16 -0
  269. package/dist/runtime/types/_internal/contexts/virtualization.js +0 -0
  270. package/dist/runtime/types/_internal/drag-drop.d.ts +48 -0
  271. package/dist/runtime/types/_internal/drag-drop.js +0 -0
  272. package/dist/runtime/types/_internal/focus.d.ts +68 -0
  273. package/dist/runtime/types/_internal/focus.js +0 -0
  274. package/dist/runtime/types/_internal/grouping.d.ts +48 -0
  275. package/dist/runtime/types/_internal/grouping.js +0 -0
  276. package/dist/runtime/types/_internal/index.d.ts +37 -0
  277. package/dist/runtime/types/_internal/index.js +2 -0
  278. package/dist/runtime/types/_internal/interaction-router.d.ts +176 -0
  279. package/dist/runtime/types/_internal/interaction-router.js +39 -0
  280. package/dist/runtime/types/_internal/props.d.ts +28 -0
  281. package/dist/runtime/types/_internal/props.js +0 -0
  282. package/dist/runtime/types/_internal/resize.d.ts +37 -0
  283. package/dist/runtime/types/_internal/resize.js +0 -0
  284. package/dist/runtime/types/_internal/row-interactions.d.ts +15 -0
  285. package/dist/runtime/types/_internal/row-interactions.js +0 -0
  286. package/dist/runtime/types/_internal/row-selection.d.ts +27 -0
  287. package/dist/runtime/types/_internal/row-selection.js +0 -0
  288. package/dist/runtime/types/_internal/states.d.ts +24 -0
  289. package/dist/runtime/types/_internal/states.js +0 -0
  290. package/dist/runtime/types/_internal/sticky-headers.d.ts +10 -0
  291. package/dist/runtime/types/_internal/sticky-headers.js +0 -0
  292. package/dist/runtime/types/_internal/validation.d.ts +54 -0
  293. package/dist/runtime/types/_internal/validation.js +0 -0
  294. package/dist/runtime/types/_internal/virtualization.d.ts +114 -0
  295. package/dist/runtime/types/_internal/virtualization.js +0 -0
  296. package/dist/runtime/types/action-menu.d.ts +62 -0
  297. package/dist/runtime/types/action-menu.js +0 -0
  298. package/dist/runtime/types/autosize.d.ts +8 -0
  299. package/dist/runtime/types/autosize.js +0 -0
  300. package/dist/runtime/types/cells.d.ts +292 -0
  301. package/dist/runtime/types/cells.js +5 -0
  302. package/dist/runtime/types/column.d.ts +248 -0
  303. package/dist/runtime/types/column.js +0 -0
  304. package/dist/runtime/types/config.d.ts +35 -0
  305. package/dist/runtime/types/config.js +0 -0
  306. package/dist/runtime/types/drag-drop.d.ts +92 -0
  307. package/dist/runtime/types/drag-drop.js +0 -0
  308. package/dist/runtime/types/events.d.ts +164 -0
  309. package/dist/runtime/types/events.js +1 -0
  310. package/dist/runtime/types/focus.d.ts +50 -0
  311. package/dist/runtime/types/focus.js +0 -0
  312. package/dist/runtime/types/grouping.d.ts +7 -0
  313. package/dist/runtime/types/grouping.js +0 -0
  314. package/dist/runtime/types/index.d.ts +15 -0
  315. package/dist/runtime/types/index.js +0 -0
  316. package/dist/runtime/types/option-groups.d.ts +624 -0
  317. package/dist/runtime/types/option-groups.js +0 -0
  318. package/dist/runtime/types/props.d.ts +418 -0
  319. package/dist/runtime/types/props.js +0 -0
  320. package/dist/runtime/types/resize.d.ts +14 -0
  321. package/dist/runtime/types/resize.js +0 -0
  322. package/dist/runtime/types/row-interactions.d.ts +11 -0
  323. package/dist/runtime/types/row-interactions.js +0 -0
  324. package/dist/runtime/types/row-selection.d.ts +48 -0
  325. package/dist/runtime/types/row-selection.js +0 -0
  326. package/dist/runtime/types/row.d.ts +7 -0
  327. package/dist/runtime/types/row.js +0 -0
  328. package/dist/runtime/types/sort-icon.d.ts +35 -0
  329. package/dist/runtime/types/sort-icon.js +0 -0
  330. package/dist/runtime/types/states.d.ts +17 -0
  331. package/dist/runtime/types/states.js +0 -0
  332. package/dist/runtime/types/sticky-headers.d.ts +6 -0
  333. package/dist/runtime/types/sticky-headers.js +0 -0
  334. package/dist/runtime/types/tanstack-table.d.ts +126 -0
  335. package/dist/runtime/types/theme.d.ts +22 -0
  336. package/dist/runtime/types/theme.js +0 -0
  337. package/dist/runtime/types/validation.d.ts +94 -0
  338. package/dist/runtime/types/validation.js +0 -0
  339. package/dist/runtime/utils/columnHelper.d.ts +208 -0
  340. package/dist/runtime/utils/columnHelper.js +23 -0
  341. package/dist/runtime/utils/excelExport.d.ts +63 -0
  342. package/dist/runtime/utils/excelExport.js +297 -0
  343. package/dist/runtime/utils/index.d.ts +2 -0
  344. package/dist/runtime/utils/index.js +2 -0
  345. package/dist/runtime/utils/standardSchema.d.ts +77 -0
  346. package/dist/runtime/utils/standardSchema.js +141 -0
  347. package/dist/types.d.mts +3 -0
  348. package/package.json +117 -0
@@ -0,0 +1,291 @@
1
+ <script setup>
2
+ import { computed, isRef, nextTick, onMounted, onUnmounted, ref, watch } from "vue";
3
+ import { nuGridDefaults } from "../../config/_internal";
4
+ import { ROUTER_PRIORITIES } from "../../types/_internal";
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 containerRef = ref(null);
18
+ let unregisterKeyboardHandler = null;
19
+ const columnDef = computed(() => props.cell.column.columnDef);
20
+ const lookupConfig = computed(() => columnDef.value.lookup);
21
+ const isOpen = ref(false);
22
+ const resolvedItems = ref([]);
23
+ const isLoading = ref(false);
24
+ const loadError = ref(null);
25
+ watchEffect(async () => {
26
+ const config = lookupConfig.value;
27
+ if (!config?.items) {
28
+ resolvedItems.value = [];
29
+ return;
30
+ }
31
+ try {
32
+ loadError.value = null;
33
+ if (typeof config.items === "function") {
34
+ isLoading.value = true;
35
+ resolvedItems.value = await config.items();
36
+ } else if (isRef(config.items)) {
37
+ resolvedItems.value = config.items.value;
38
+ } else {
39
+ resolvedItems.value = config.items;
40
+ }
41
+ } catch (err) {
42
+ loadError.value = err instanceof Error ? err.message : "Failed to load items";
43
+ resolvedItems.value = [];
44
+ } finally {
45
+ isLoading.value = false;
46
+ }
47
+ });
48
+ const valueKey = computed(
49
+ () => lookupConfig.value?.valueKey ?? nuGridDefaults.columnDefaults.lookup.valueKey
50
+ );
51
+ const labelKey = computed(
52
+ () => lookupConfig.value?.labelKey ?? nuGridDefaults.columnDefaults.lookup.labelKey
53
+ );
54
+ const descriptionKey = computed(() => lookupConfig.value?.descriptionKey);
55
+ const searchable = computed(
56
+ () => lookupConfig.value?.searchable ?? nuGridDefaults.columnDefaults.lookup.searchable
57
+ );
58
+ const filterFields = computed(() => lookupConfig.value?.filterFields ?? [labelKey.value]);
59
+ const placeholder = computed(
60
+ () => lookupConfig.value?.placeholder ?? nuGridDefaults.columnDefaults.lookup.placeholder
61
+ );
62
+ const clearable = computed(
63
+ () => lookupConfig.value?.clearable ?? nuGridDefaults.columnDefaults.lookup.clearable
64
+ );
65
+ const autoOpen = computed(
66
+ () => lookupConfig.value?.autoOpen ?? nuGridDefaults.columnDefaults.lookup.autoOpen
67
+ );
68
+ const valueJustChanged = ref(false);
69
+ const navigatingViaTab = ref(false);
70
+ const escapingMenu = ref(false);
71
+ const lastKeyPressed = ref(null);
72
+ function handleValueChange(value) {
73
+ valueJustChanged.value = true;
74
+ emit("update:modelValue", value);
75
+ setTimeout(() => {
76
+ valueJustChanged.value = false;
77
+ }, 100);
78
+ }
79
+ function handleMenuClose(open) {
80
+ if (!open && lastKeyPressed.value === "Enter") {
81
+ lastKeyPressed.value = null;
82
+ setTimeout(() => {
83
+ emit("stop-editing");
84
+ }, 100);
85
+ return;
86
+ }
87
+ if (!open && !valueJustChanged.value && !navigatingViaTab.value && !escapingMenu.value) {
88
+ setTimeout(() => {
89
+ emit("stop-editing");
90
+ }, 100);
91
+ }
92
+ if (!open && escapingMenu.value) {
93
+ escapingMenu.value = false;
94
+ }
95
+ }
96
+ function handleKeydown(ctx) {
97
+ const e = ctx.event;
98
+ lastKeyPressed.value = e.key;
99
+ if (e.key === "Tab") {
100
+ if (isOpen.value) {
101
+ navigatingViaTab.value = true;
102
+ const direction = e.shiftKey ? "previous" : "next";
103
+ const enterEvent = new KeyboardEvent("keydown", {
104
+ key: "Enter",
105
+ code: "Enter",
106
+ keyCode: 13,
107
+ which: 13,
108
+ bubbles: true,
109
+ cancelable: true
110
+ });
111
+ const trigger = containerRef.value?.querySelector(
112
+ 'button[aria-haspopup="listbox"]'
113
+ );
114
+ if (trigger) {
115
+ const listboxId = trigger.getAttribute("aria-controls");
116
+ if (listboxId) {
117
+ const listbox = document.getElementById(listboxId);
118
+ if (listbox) {
119
+ listbox.dispatchEvent(enterEvent);
120
+ }
121
+ }
122
+ }
123
+ setTimeout(() => {
124
+ emit("update:isNavigating", true);
125
+ emit("stop-editing", direction);
126
+ }, 50);
127
+ } else {
128
+ emit("update:isNavigating", true);
129
+ emit("stop-editing", e.shiftKey ? "previous" : "next");
130
+ }
131
+ return { handled: true, preventDefault: true, stopPropagation: true };
132
+ }
133
+ if (e.key === "Escape") {
134
+ if (isOpen.value) {
135
+ escapingMenu.value = true;
136
+ isOpen.value = false;
137
+ return { handled: true, preventDefault: true, stopPropagation: true };
138
+ } else {
139
+ emit("cancel-editing");
140
+ return { handled: true, preventDefault: true, stopPropagation: true };
141
+ }
142
+ }
143
+ if (e.key === " ") {
144
+ if (!isOpen.value) {
145
+ const trigger = containerRef.value?.querySelector("button, [tabindex]");
146
+ if (trigger) {
147
+ trigger.click();
148
+ }
149
+ return { handled: true, preventDefault: true, stopPropagation: true };
150
+ } else {
151
+ valueJustChanged.value = true;
152
+ return { handled: false };
153
+ }
154
+ }
155
+ if (e.key === "PageUp" || e.key === "PageDown") {
156
+ return { handled: true, preventDefault: true, stopPropagation: true };
157
+ }
158
+ if (e.key === "ArrowDown" || e.key === "ArrowUp") {
159
+ if (e.metaKey || e.ctrlKey) {
160
+ return { handled: true, preventDefault: true, stopPropagation: true };
161
+ }
162
+ if (!isOpen.value) {
163
+ const trigger = containerRef.value?.querySelector("button, [tabindex]");
164
+ if (trigger) {
165
+ trigger.click();
166
+ }
167
+ return { handled: true, preventDefault: true, stopPropagation: true };
168
+ }
169
+ }
170
+ if (e.key === "Enter") {
171
+ if (isOpen.value) {
172
+ return { handled: false };
173
+ } else {
174
+ emit("stop-editing");
175
+ return { handled: true, preventDefault: true, stopPropagation: true };
176
+ }
177
+ }
178
+ return { handled: false };
179
+ }
180
+ function registerKeyboardHandler() {
181
+ if (!props.interactionRouter || unregisterKeyboardHandler) return;
182
+ const cellId = props.cell.id;
183
+ const rowId = props.row.id;
184
+ unregisterKeyboardHandler = props.interactionRouter.registerKeyboardHandler({
185
+ id: `lookup-editor-${rowId}-${cellId}`,
186
+ priority: ROUTER_PRIORITIES.GUARD_MIN,
187
+ // Highest priority - editors should handle keys first
188
+ documentLevel: true,
189
+ // Need document-level to capture events on teleported dropdown
190
+ // No 'when' needed - handler is only registered while this editor is mounted
191
+ handle: handleKeydown
192
+ });
193
+ }
194
+ function unregisterHandler() {
195
+ if (unregisterKeyboardHandler) {
196
+ unregisterKeyboardHandler();
197
+ unregisterKeyboardHandler = null;
198
+ }
199
+ }
200
+ onMounted(() => {
201
+ registerKeyboardHandler();
202
+ if (props.shouldFocus) {
203
+ nextTick(() => {
204
+ const trigger = containerRef.value?.querySelector("button, [tabindex]");
205
+ trigger?.focus({ preventScroll: true });
206
+ });
207
+ }
208
+ if (autoOpen.value) {
209
+ const config = lookupConfig.value;
210
+ const isAsync = typeof config?.items === "function";
211
+ if (isAsync) {
212
+ const unwatch = watch(isLoading, (loading) => {
213
+ if (!loading && resolvedItems.value.length > 0) {
214
+ nextTick(() => {
215
+ isOpen.value = true;
216
+ });
217
+ unwatch();
218
+ }
219
+ });
220
+ } else {
221
+ nextTick(() => {
222
+ isOpen.value = true;
223
+ });
224
+ }
225
+ }
226
+ });
227
+ onUnmounted(() => {
228
+ unregisterHandler();
229
+ });
230
+ watch(
231
+ () => props.shouldFocus,
232
+ (shouldFocus) => {
233
+ if (shouldFocus) {
234
+ nextTick(() => {
235
+ const trigger = containerRef.value?.querySelector("button, [tabindex]");
236
+ trigger?.focus({ preventScroll: true });
237
+ });
238
+ }
239
+ }
240
+ );
241
+ </script>
242
+
243
+ <template>
244
+ <div ref="containerRef" class="w-full">
245
+ <USelectMenu
246
+ :model-value="modelValue"
247
+ :open="isOpen"
248
+ :items="resolvedItems"
249
+ :value-key="valueKey"
250
+ :label-key="labelKey"
251
+ :description-key="descriptionKey"
252
+ :search-input="searchable"
253
+ :filter-fields="filterFields"
254
+ :placeholder="placeholder"
255
+ :loading="isLoading"
256
+ :disabled="isLoading"
257
+ :ui="{
258
+ base: 'ring-2 ring-offset-0 outline-none focus:ring-2 focus:ring-offset-0',
259
+ content: 'outline-none'
260
+ }"
261
+ highlight
262
+ class="w-full outline-none"
263
+ @update:model-value="handleValueChange"
264
+ @update:open="
265
+ (open) => {
266
+ isOpen = open;
267
+ handleMenuClose(open);
268
+ }
269
+ "
270
+ >
271
+ <template v-if="clearable && modelValue != null" #trailing>
272
+ <UButton
273
+ icon="i-lucide-x"
274
+ size="xs"
275
+ color="neutral"
276
+ variant="ghost"
277
+ class="size-4"
278
+ @click.stop="handleValueChange(null)"
279
+ />
280
+ </template>
281
+ </USelectMenu>
282
+
283
+ <div v-if="loadError" class="mt-1 text-xs text-red-500">
284
+ {{ loadError }}
285
+ </div>
286
+ </div>
287
+ </template>
288
+
289
+ <style scoped>
290
+ :deep([role=listbox]){outline:none!important}:deep([role=listbox]:focus){outline:none!important}
291
+ </style>
@@ -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,8 @@
1
+ interface Props {
2
+ value: any;
3
+ cell: any;
4
+ editable?: boolean;
5
+ }
6
+ 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>;
7
+ declare const _default: typeof __VLS_export;
8
+ export default _default;
@@ -0,0 +1,43 @@
1
+ <script setup>
2
+ import { isRef } from "vue";
3
+ import { nuGridDefaults } from "../../config/_internal";
4
+ defineOptions({ inheritAttrs: false });
5
+ const props = defineProps({
6
+ value: { type: null, required: true },
7
+ cell: { type: null, required: true },
8
+ editable: { type: Boolean, required: false }
9
+ });
10
+ const lookupConfig = computed(() => props.cell?.column?.columnDef?.lookup);
11
+ const resolvedItems = computed(() => {
12
+ const config = lookupConfig.value;
13
+ if (!config?.items) return [];
14
+ if (typeof config.items === "function") {
15
+ return [];
16
+ } else if (isRef(config.items)) {
17
+ return config.items.value;
18
+ } else {
19
+ return config.items;
20
+ }
21
+ });
22
+ const valueKey = computed(
23
+ () => lookupConfig.value?.valueKey ?? nuGridDefaults.columnDefaults.lookup.valueKey
24
+ );
25
+ const labelKey = computed(
26
+ () => lookupConfig.value?.labelKey ?? nuGridDefaults.columnDefaults.lookup.labelKey
27
+ );
28
+ const displayLabel = computed(() => {
29
+ if (props.value === null || props.value === void 0) {
30
+ return "";
31
+ }
32
+ const items = resolvedItems.value;
33
+ if (!items.length) {
34
+ return String(props.value);
35
+ }
36
+ const item = items.find((i) => i[valueKey.value] === props.value);
37
+ return item?.[labelKey.value] ?? String(props.value);
38
+ });
39
+ </script>
40
+
41
+ <template>
42
+ <span class="truncate">{{ displayLabel }}</span>
43
+ </template>
@@ -0,0 +1,8 @@
1
+ interface Props {
2
+ value: any;
3
+ cell: any;
4
+ editable?: boolean;
5
+ }
6
+ 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>;
7
+ declare const _default: typeof __VLS_export;
8
+ export default _default;
@@ -0,0 +1,36 @@
1
+ import type { NuGridCellType } from '../../types/cells.js';
2
+ /**
3
+ * Lookup cell type
4
+ * Provides dropdown selection using Nuxt UI's SelectMenu component
5
+ * Supports static, reactive, and async item sources
6
+ *
7
+ * Keyboard interactions in edit mode:
8
+ * - **Space**: Opens dropdown when closed; selects highlighted item when open (stays in edit mode)
9
+ * - **Enter**: Selects highlighted item and exits edit mode (closes dropdown if open, then stops editing)
10
+ * - **Escape**: Two-stage behavior - first press closes dropdown, second press cancels editing
11
+ * - **Tab/Shift+Tab**: Closes dropdown and navigates to next/previous cell
12
+ * - **Arrow Up/Down**: Opens dropdown with native item highlighting when closed; navigates items when open
13
+ * - **Arrow Left/Right**: Navigate items when open (USelectMenu native behavior)
14
+ *
15
+ * Keyboard interactions in view mode:
16
+ * - **Space**: Opens the dropdown editor (via keyboardHandler)
17
+ * - **Enter**: Opens the dropdown editor (default grid behavior)
18
+ *
19
+ * Usage:
20
+ * ```ts
21
+ * {
22
+ * accessorKey: 'status',
23
+ * cellDataType: 'lookup',
24
+ * lookup: {
25
+ * items: [
26
+ * { value: 'active', label: 'Active' },
27
+ * { value: 'inactive', label: 'Inactive' },
28
+ * ],
29
+ * valueKey: 'value',
30
+ * labelKey: 'label',
31
+ * searchable: true,
32
+ * }
33
+ * }
34
+ * ```
35
+ */
36
+ export declare const lookupCellType: NuGridCellType;
@@ -0,0 +1,50 @@
1
+ import { isRef } from "vue";
2
+ import { nuGridDefaults } from "../../config/_internal/index.js";
3
+ import LookupEditor from "./LookupEditor.vue";
4
+ import LookupRenderer from "./LookupRenderer.vue";
5
+ function resolveItemsSync(items) {
6
+ if (!items) return [];
7
+ if (typeof items === "function") return [];
8
+ if (isRef(items)) return items.value;
9
+ return items;
10
+ }
11
+ export const lookupCellType = {
12
+ name: "lookup",
13
+ displayName: "Lookup",
14
+ description: "Dropdown selection with search support",
15
+ editor: LookupEditor,
16
+ renderer: LookupRenderer,
17
+ /**
18
+ * Format value for display (used in clipboard, export, etc.)
19
+ * Looks up the label from items based on the stored value
20
+ */
21
+ formatter: (value, context) => {
22
+ if (value === null || value === void 0) return "";
23
+ const lookup = context.columnDef?.lookup;
24
+ if (!lookup) return String(value);
25
+ const items = resolveItemsSync(lookup.items);
26
+ if (!items.length) return String(value);
27
+ const valueKey = lookup.valueKey ?? nuGridDefaults.columnDefaults.lookup.valueKey;
28
+ const labelKey = lookup.labelKey ?? nuGridDefaults.columnDefaults.lookup.labelKey;
29
+ const item = items.find((i) => i[valueKey] === value);
30
+ return item?.[labelKey] ?? String(value);
31
+ },
32
+ /**
33
+ * Keyboard handler for lookup cells in view mode
34
+ * Space opens the dropdown editor (like native select behavior)
35
+ * Enter also opens the dropdown (default grid behavior)
36
+ */
37
+ keyboardHandler: (event, context) => {
38
+ const { isFocused, canEdit, startEditing } = context;
39
+ if (isFocused && canEdit && event.key === " ") {
40
+ event.preventDefault();
41
+ startEditing();
42
+ return { handled: true, preventDefault: true, stopPropagation: true };
43
+ }
44
+ return { handled: false };
45
+ },
46
+ // Default column settings
47
+ defaultColumnDef: {
48
+ size: 150
49
+ }
50
+ };
@@ -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,34 @@
1
+ <script setup>
2
+ import { ref } 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 inputRef = ref(null);
17
+ const { handleKeydown, handleBlur } = useNuGridCellEditor(props, emit, inputRef);
18
+ const handleInput = (value) => {
19
+ const numValue = value === "" ? null : Number(value);
20
+ emit("update:modelValue", numValue);
21
+ };
22
+ </script>
23
+
24
+ <template>
25
+ <UInput
26
+ ref="inputRef"
27
+ :model-value="modelValue"
28
+ type="number"
29
+ class="w-full pl-0.5!"
30
+ @update:model-value="handleInput"
31
+ @blur="handleBlur"
32
+ @keydown="handleKeydown"
33
+ />
34
+ </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,66 @@
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("equals");
11
+ const operators = [
12
+ { value: "equals", label: "Equals" },
13
+ { value: "greaterThan", label: "Greater than" },
14
+ { value: "lessThan", label: "Less than" },
15
+ { value: "greaterThanOrEqual", label: "Greater than or equal" },
16
+ { value: "lessThanOrEqual", label: "Less than or equal" },
17
+ { value: "between", label: "Between" }
18
+ ];
19
+ const filterValue2 = ref(null);
20
+ function clearFilter() {
21
+ filterValue.value = null;
22
+ filterValue2.value = null;
23
+ props.context.clearFilter();
24
+ }
25
+ </script>
26
+
27
+ <template>
28
+ <div class="min-w-[200px] space-y-2 p-2">
29
+ <div class="flex items-center gap-2">
30
+ <USelect
31
+ v-model="operator"
32
+ :options="operators"
33
+ option-attribute="label"
34
+ value-attribute="value"
35
+ class="flex-1"
36
+ />
37
+ <UButton
38
+ v-if="context.isFiltered"
39
+ icon="i-heroicons-x-mark"
40
+ size="xs"
41
+ color="neutral"
42
+ variant="ghost"
43
+ @click="clearFilter"
44
+ />
45
+ </div>
46
+ <UInput
47
+ v-model="filterValue"
48
+ type="number"
49
+ placeholder="Value..."
50
+ autofocus
51
+ @update:model-value="context.setFilterValue($event ? Number($event) : null)"
52
+ />
53
+ <UInput
54
+ v-if="operator === 'between'"
55
+ v-model="filterValue2"
56
+ type="number"
57
+ placeholder="To..."
58
+ @update:model-value="
59
+ context.setFilterValue({
60
+ from: filterValue,
61
+ to: filterValue2 ? Number(filterValue2) : null
62
+ })
63
+ "
64
+ />
65
+ </div>
66
+ </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,6 @@
1
+ import type { NuGridCellType } from '../../types/cells.js';
2
+ /**
3
+ * Number cell type
4
+ * Number input with step controls, no special keyboard handling
5
+ */
6
+ export declare const numberCellType: NuGridCellType;
@@ -0,0 +1,13 @@
1
+ import NumberEditor from "./NumberEditor.vue";
2
+ import NumberFilter from "./NumberFilter.vue";
3
+ export const numberCellType = {
4
+ name: "number",
5
+ displayName: "Number",
6
+ description: "Number input column",
7
+ editor: NumberEditor,
8
+ filter: {
9
+ component: NumberFilter,
10
+ defaultOperator: "equals"
11
+ },
12
+ enableFiltering: true
13
+ };
@@ -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;