@nova-design-system/nova-webcomponents 3.0.0 → 3.1.0

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 (436) hide show
  1. package/dist/cjs/{constants-bcd6b2e2.js → constants-8fb8ccc0.js} +14 -1
  2. package/dist/cjs/constants-8fb8ccc0.js.map +1 -0
  3. package/dist/cjs/index-9bda5507.js +4 -4
  4. package/dist/cjs/index.cjs.js +4 -471
  5. package/dist/cjs/index.cjs.js.map +1 -1
  6. package/dist/cjs/loader.cjs.js +1 -1
  7. package/dist/cjs/native.cjs.js +1 -1
  8. package/dist/cjs/nv-alert.cjs.entry.js +5 -5
  9. package/dist/cjs/nv-alert.cjs.entry.js.map +1 -1
  10. package/dist/cjs/nv-avatar.cjs.entry.js +1 -1
  11. package/dist/cjs/nv-badge_2.cjs.entry.js +17 -8
  12. package/dist/cjs/nv-badge_2.cjs.entry.js.map +1 -1
  13. package/dist/cjs/nv-button.cjs.entry.js +1 -1
  14. package/dist/cjs/nv-calendar.cjs.entry.js +841 -842
  15. package/dist/cjs/nv-calendar.cjs.entry.js.map +1 -1
  16. package/dist/cjs/nv-datagrid.cjs.entry.js +376 -39
  17. package/dist/cjs/nv-datagrid.cjs.entry.js.map +1 -1
  18. package/dist/cjs/nv-dialog.cjs.entry.js +18 -12
  19. package/dist/cjs/nv-dialog.cjs.entry.js.map +1 -1
  20. package/dist/cjs/nv-dialogfooter_2.cjs.entry.js +1 -1
  21. package/dist/cjs/nv-fielddate.cjs.entry.js +8 -17
  22. package/dist/cjs/nv-fielddate.cjs.entry.js.map +1 -1
  23. package/dist/cjs/nv-fielddaterange.cjs.entry.js +26 -28
  24. package/dist/cjs/nv-fielddaterange.cjs.entry.js.map +1 -1
  25. package/dist/cjs/nv-fielddropdown.cjs.entry.js +12 -5
  26. package/dist/cjs/nv-fielddropdown.cjs.entry.js.map +1 -1
  27. package/dist/cjs/nv-fielddropdownitem.cjs.entry.js +1 -1
  28. package/dist/cjs/nv-fieldmultiselect.cjs.entry.js +10 -4
  29. package/dist/cjs/nv-fieldmultiselect.cjs.entry.js.map +1 -1
  30. package/dist/cjs/nv-fieldnumber.cjs.entry.js +8 -4
  31. package/dist/cjs/nv-fieldnumber.cjs.entry.js.map +1 -1
  32. package/dist/cjs/nv-fieldpassword.cjs.entry.js +8 -4
  33. package/dist/cjs/nv-fieldpassword.cjs.entry.js.map +1 -1
  34. package/dist/cjs/nv-fieldradio.cjs.entry.js +3 -3
  35. package/dist/cjs/nv-fieldselect.cjs.entry.js +10 -6
  36. package/dist/cjs/nv-fieldselect.cjs.entry.js.map +1 -1
  37. package/dist/cjs/nv-fieldtext.cjs.entry.js +8 -4
  38. package/dist/cjs/nv-fieldtext.cjs.entry.js.map +1 -1
  39. package/dist/cjs/nv-fieldtextarea.cjs.entry.js +8 -4
  40. package/dist/cjs/nv-fieldtextarea.cjs.entry.js.map +1 -1
  41. package/dist/cjs/nv-fieldtime.cjs.entry.js +15 -12
  42. package/dist/cjs/nv-fieldtime.cjs.entry.js.map +1 -1
  43. package/dist/cjs/nv-icon.cjs.entry.js +3 -3
  44. package/dist/cjs/nv-icon.cjs.entry.js.map +1 -1
  45. package/dist/cjs/nv-iconbutton_2.cjs.entry.js +2 -2
  46. package/dist/cjs/nv-menu.cjs.entry.js +3 -1
  47. package/dist/cjs/nv-menu.cjs.entry.js.map +1 -1
  48. package/dist/cjs/nv-menuitem.cjs.entry.js +1 -1
  49. package/dist/cjs/nv-popover.cjs.entry.js +1 -1
  50. package/dist/cjs/nv-row.cjs.entry.js +1 -1
  51. package/dist/cjs/nv-stack.cjs.entry.js +1 -1
  52. package/dist/cjs/nv-table.cjs.entry.js +2 -2
  53. package/dist/cjs/nv-table.cjs.entry.js.map +1 -1
  54. package/dist/cjs/nv-toggle.cjs.entry.js +2 -2
  55. package/dist/cjs/nv-tooltip.cjs.entry.js +1 -1
  56. package/dist/collection/components/nv-alert/nv-alert.css +3 -0
  57. package/dist/collection/components/nv-alert/nv-alert.js +6 -11
  58. package/dist/collection/components/nv-alert/nv-alert.js.map +1 -1
  59. package/dist/collection/components/nv-badge/nv-badge.css +181 -1
  60. package/dist/collection/components/nv-badge/nv-badge.docs.js +20 -1
  61. package/dist/collection/components/nv-badge/nv-badge.docs.js.map +1 -1
  62. package/dist/collection/components/nv-badge/nv-badge.js +39 -15
  63. package/dist/collection/components/nv-badge/nv-badge.js.map +1 -1
  64. package/dist/collection/components/nv-breadcrumbs/nv-breadcrumbs.docs.js +0 -1
  65. package/dist/collection/components/nv-breadcrumbs/nv-breadcrumbs.docs.js.map +1 -1
  66. package/dist/collection/components/nv-calendar/nv-calendar.css +19 -0
  67. package/dist/collection/components/nv-calendar/nv-calendar.docs.js +33 -38
  68. package/dist/collection/components/nv-calendar/nv-calendar.docs.js.map +1 -1
  69. package/dist/collection/components/nv-calendar/nv-calendar.js +680 -897
  70. package/dist/collection/components/nv-calendar/nv-calendar.js.map +1 -1
  71. package/dist/collection/components/nv-calendar/nv-calendar.utils.js +202 -0
  72. package/dist/collection/components/nv-calendar/nv-calendar.utils.js.map +1 -0
  73. package/dist/collection/components/nv-calendar/test/nv-calendar.utils.test.js +667 -0
  74. package/dist/collection/components/nv-calendar/test/nv-calendar.utils.test.js.map +1 -0
  75. package/dist/collection/components/nv-datagrid/nv-datagrid.css +98 -0
  76. package/dist/collection/components/nv-datagrid/nv-datagrid.docs.js +103 -5
  77. package/dist/collection/components/nv-datagrid/nv-datagrid.docs.js.map +1 -1
  78. package/dist/collection/components/nv-datagrid/nv-datagrid.js +391 -56
  79. package/dist/collection/components/nv-datagrid/nv-datagrid.js.map +1 -1
  80. package/dist/collection/components/nv-dialog/nv-dialog.css +29 -5
  81. package/dist/collection/components/nv-dialog/nv-dialog.docs.js +0 -1
  82. package/dist/collection/components/nv-dialog/nv-dialog.docs.js.map +1 -1
  83. package/dist/collection/components/nv-dialog/nv-dialog.js +16 -10
  84. package/dist/collection/components/nv-dialog/nv-dialog.js.map +1 -1
  85. package/dist/collection/components/nv-fielddate/nv-fielddate.docs.js +16 -8
  86. package/dist/collection/components/nv-fielddate/nv-fielddate.docs.js.map +1 -1
  87. package/dist/collection/components/nv-fielddate/nv-fielddate.js +48 -39
  88. package/dist/collection/components/nv-fielddate/nv-fielddate.js.map +1 -1
  89. package/dist/collection/components/nv-fielddate/styles/nv-fielddate.css +7 -0
  90. package/dist/collection/components/nv-fielddaterange/nv-fielddaterange.docs.js +12 -15
  91. package/dist/collection/components/nv-fielddaterange/nv-fielddaterange.docs.js.map +1 -1
  92. package/dist/collection/components/nv-fielddaterange/nv-fielddaterange.js +75 -64
  93. package/dist/collection/components/nv-fielddaterange/nv-fielddaterange.js.map +1 -1
  94. package/dist/collection/components/nv-fielddaterange/styles/nv-fielddaterange.css +13 -11
  95. package/dist/collection/components/nv-fielddropdown/nv-fielddropdown.docs.js +8 -0
  96. package/dist/collection/components/nv-fielddropdown/nv-fielddropdown.docs.js.map +1 -1
  97. package/dist/collection/components/nv-fielddropdown/nv-fielddropdown.js +31 -4
  98. package/dist/collection/components/nv-fielddropdown/nv-fielddropdown.js.map +1 -1
  99. package/dist/collection/components/nv-fielddropdown/styles/nv-fielddropdown.css +5 -0
  100. package/dist/collection/components/nv-fielddropdownitem/nv-fielddropdownitem.js +1 -1
  101. package/dist/collection/components/nv-fielddropdownitemcheck/nv-fielddropdownitemcheck.js +1 -1
  102. package/dist/collection/components/nv-fieldmultiselect/nv-fieldmultiselect.css +24 -0
  103. package/dist/collection/components/nv-fieldmultiselect/nv-fieldmultiselect.docs.js +8 -1
  104. package/dist/collection/components/nv-fieldmultiselect/nv-fieldmultiselect.docs.js.map +1 -1
  105. package/dist/collection/components/nv-fieldmultiselect/nv-fieldmultiselect.js +29 -3
  106. package/dist/collection/components/nv-fieldmultiselect/nv-fieldmultiselect.js.map +1 -1
  107. package/dist/collection/components/nv-fieldnumber/nv-fieldnumber.css +5 -0
  108. package/dist/collection/components/nv-fieldnumber/nv-fieldnumber.docs.js +8 -0
  109. package/dist/collection/components/nv-fieldnumber/nv-fieldnumber.docs.js.map +1 -1
  110. package/dist/collection/components/nv-fieldnumber/nv-fieldnumber.js +27 -3
  111. package/dist/collection/components/nv-fieldnumber/nv-fieldnumber.js.map +1 -1
  112. package/dist/collection/components/nv-fieldpassword/nv-fieldpassword.css +5 -0
  113. package/dist/collection/components/nv-fieldpassword/nv-fieldpassword.docs.js +8 -0
  114. package/dist/collection/components/nv-fieldpassword/nv-fieldpassword.docs.js.map +1 -1
  115. package/dist/collection/components/nv-fieldpassword/nv-fieldpassword.js +27 -3
  116. package/dist/collection/components/nv-fieldpassword/nv-fieldpassword.js.map +1 -1
  117. package/dist/collection/components/nv-fieldradio/nv-fieldradio.js +3 -3
  118. package/dist/collection/components/nv-fieldselect/nv-fieldselect.css +5 -0
  119. package/dist/collection/components/nv-fieldselect/nv-fieldselect.docs.js +8 -0
  120. package/dist/collection/components/nv-fieldselect/nv-fieldselect.docs.js.map +1 -1
  121. package/dist/collection/components/nv-fieldselect/nv-fieldselect.js +29 -5
  122. package/dist/collection/components/nv-fieldselect/nv-fieldselect.js.map +1 -1
  123. package/dist/collection/components/nv-fieldtext/nv-fieldtext.css +5 -0
  124. package/dist/collection/components/nv-fieldtext/nv-fieldtext.docs.js +8 -0
  125. package/dist/collection/components/nv-fieldtext/nv-fieldtext.docs.js.map +1 -1
  126. package/dist/collection/components/nv-fieldtext/nv-fieldtext.js +27 -3
  127. package/dist/collection/components/nv-fieldtext/nv-fieldtext.js.map +1 -1
  128. package/dist/collection/components/nv-fieldtextarea/nv-fieldtextarea.css +23 -0
  129. package/dist/collection/components/nv-fieldtextarea/nv-fieldtextarea.docs.js +8 -0
  130. package/dist/collection/components/nv-fieldtextarea/nv-fieldtextarea.docs.js.map +1 -1
  131. package/dist/collection/components/nv-fieldtextarea/nv-fieldtextarea.js +27 -3
  132. package/dist/collection/components/nv-fieldtextarea/nv-fieldtextarea.js.map +1 -1
  133. package/dist/collection/components/nv-fieldtime/nv-fieldtime.js +13 -10
  134. package/dist/collection/components/nv-fieldtime/nv-fieldtime.js.map +1 -1
  135. package/dist/collection/components/nv-fieldtime/styles/nv-fieldtime.css +19 -2
  136. package/dist/collection/components/nv-icon/nv-icon.js +1 -1
  137. package/dist/collection/components/nv-icon/nv-icons.js +3 -470
  138. package/dist/collection/components/nv-icon/nv-icons.js.map +1 -1
  139. package/dist/collection/components/nv-iconbutton/nv-iconbutton.js +1 -1
  140. package/dist/collection/components/nv-loader/nv-loader.js +1 -1
  141. package/dist/collection/components/nv-menu/nv-menu.js +3 -1
  142. package/dist/collection/components/nv-menu/nv-menu.js.map +1 -1
  143. package/dist/collection/components/nv-menuitem/nv-menuitem.js +2 -2
  144. package/dist/collection/components/nv-popover/nv-popover.js +1 -1
  145. package/dist/collection/components/nv-row/nv-row.js +1 -1
  146. package/dist/collection/components/nv-stack/nv-stack.js +1 -1
  147. package/dist/collection/components/nv-table/nv-table.js +8 -11
  148. package/dist/collection/components/nv-table/nv-table.js.map +1 -1
  149. package/dist/collection/components/nv-toggle/nv-toggle.js +2 -2
  150. package/dist/collection/components/nv-tooltip/nv-tooltip.js +1 -1
  151. package/dist/collection/index.js.map +1 -1
  152. package/dist/collection/templates/navigation.docs.js +0 -1
  153. package/dist/collection/templates/navigation.docs.js.map +1 -1
  154. package/dist/collection/utils/constants.js +11 -0
  155. package/dist/collection/utils/constants.js.map +1 -1
  156. package/dist/components/index.js +4 -471
  157. package/dist/components/index.js.map +1 -1
  158. package/dist/components/nv-alert.js +6 -6
  159. package/dist/components/nv-alert.js.map +1 -1
  160. package/dist/components/nv-avatar.js +2 -2
  161. package/dist/components/nv-badge.js +1 -1
  162. package/dist/components/nv-breadcrumb.js +2 -2
  163. package/dist/components/nv-button.js +1 -1
  164. package/dist/components/nv-calendar.js +1 -1
  165. package/dist/components/nv-datagrid.js +400 -43
  166. package/dist/components/nv-datagrid.js.map +1 -1
  167. package/dist/components/nv-dialog.js +22 -16
  168. package/dist/components/nv-dialog.js.map +1 -1
  169. package/dist/components/nv-dialogfooter.js +1 -1
  170. package/dist/components/nv-fielddate.js +18 -26
  171. package/dist/components/nv-fielddate.js.map +1 -1
  172. package/dist/components/nv-fielddaterange.js +37 -38
  173. package/dist/components/nv-fielddaterange.js.map +1 -1
  174. package/dist/components/nv-fielddropdown.js +18 -10
  175. package/dist/components/nv-fielddropdown.js.map +1 -1
  176. package/dist/components/nv-fielddropdownitem.js +1 -1
  177. package/dist/components/nv-fielddropdownitemcheck.js +1 -1
  178. package/dist/components/nv-fieldmultiselect.js +17 -10
  179. package/dist/components/nv-fieldmultiselect.js.map +1 -1
  180. package/dist/components/nv-fieldnumber.js +13 -8
  181. package/dist/components/nv-fieldnumber.js.map +1 -1
  182. package/dist/components/nv-fieldpassword.js +12 -7
  183. package/dist/components/nv-fieldpassword.js.map +1 -1
  184. package/dist/components/nv-fieldradio.js +3 -3
  185. package/dist/components/nv-fieldselect.js +14 -9
  186. package/dist/components/nv-fieldselect.js.map +1 -1
  187. package/dist/components/nv-fieldtext.js +1 -158
  188. package/dist/components/nv-fieldtext.js.map +1 -1
  189. package/dist/components/nv-fieldtextarea.js +10 -5
  190. package/dist/components/nv-fieldtextarea.js.map +1 -1
  191. package/dist/components/nv-fieldtime.js +19 -16
  192. package/dist/components/nv-fieldtime.js.map +1 -1
  193. package/dist/components/nv-icon.js +1 -1
  194. package/dist/components/nv-iconbutton.js +1 -1
  195. package/dist/components/nv-loader.js +1 -1
  196. package/dist/components/nv-menu.js +6 -4
  197. package/dist/components/nv-menu.js.map +1 -1
  198. package/dist/components/nv-menuitem.js +1 -1
  199. package/dist/components/nv-popover.js +1 -1
  200. package/dist/components/nv-row.js +1 -1
  201. package/dist/components/nv-stack.js +1 -1
  202. package/dist/components/nv-table.js +2 -2
  203. package/dist/components/nv-table.js.map +1 -1
  204. package/dist/components/nv-toggle.js +2 -2
  205. package/dist/components/nv-tooltip.js +1 -1
  206. package/dist/components/p-0a0f6daf.js +187 -0
  207. package/dist/components/p-0a0f6daf.js.map +1 -0
  208. package/dist/components/{p-b7b78e64.js → p-10b37876.js} +2 -2
  209. package/dist/components/{p-b7b78e64.js.map → p-10b37876.js.map} +1 -1
  210. package/dist/components/{p-dc3faba3.js → p-10faa938.js} +4 -4
  211. package/dist/components/{p-dc3faba3.js.map → p-10faa938.js.map} +1 -1
  212. package/dist/{esm/constants-98e2dcc2.js → components/p-1f505531.js} +15 -2
  213. package/dist/components/p-1f505531.js.map +1 -0
  214. package/dist/components/{p-2012b8ba.js → p-35a70c5e.js} +2 -2
  215. package/dist/components/{p-2012b8ba.js.map → p-35a70c5e.js.map} +1 -1
  216. package/dist/components/{p-6c364a23.js → p-41c56ddc.js} +5 -5
  217. package/dist/components/{p-6c364a23.js.map → p-41c56ddc.js.map} +1 -1
  218. package/dist/components/{p-a30b55fc.js → p-608eb9da.js} +2 -2
  219. package/dist/components/{p-a30b55fc.js.map → p-608eb9da.js.map} +1 -1
  220. package/dist/components/p-76646ce9.js +88 -0
  221. package/dist/components/p-76646ce9.js.map +1 -0
  222. package/dist/components/p-854c32dc.js +1132 -0
  223. package/dist/components/p-854c32dc.js.map +1 -0
  224. package/dist/components/p-9decffb6.js +167 -0
  225. package/dist/components/p-9decffb6.js.map +1 -0
  226. package/dist/components/{p-2d9ba7d3.js → p-a2527411.js} +3 -3
  227. package/dist/components/{p-2d9ba7d3.js.map → p-a2527411.js.map} +1 -1
  228. package/dist/components/{p-f4d86795.js → p-b48d5a94.js} +3 -3
  229. package/dist/components/{p-f4d86795.js.map → p-b48d5a94.js.map} +1 -1
  230. package/dist/components/{p-4d3ec142.js → p-eb632278.js} +3 -3
  231. package/dist/components/{p-4d3ec142.js.map → p-eb632278.js.map} +1 -1
  232. package/dist/components/{p-150daf68.js → p-f5cb0a63.js} +2 -2
  233. package/dist/components/{p-150daf68.js.map → p-f5cb0a63.js.map} +1 -1
  234. package/dist/components/{p-c14f6b8e.js → p-f76bb0c3.js} +3 -3
  235. package/dist/components/{p-c14f6b8e.js.map → p-f76bb0c3.js.map} +1 -1
  236. package/dist/{components/p-8348db09.js → esm/constants-b97e736d.js} +15 -2
  237. package/dist/esm/constants-b97e736d.js.map +1 -0
  238. package/dist/esm/index-1fb7a9a6.js +4 -4
  239. package/dist/esm/index.js +4 -471
  240. package/dist/esm/index.js.map +1 -1
  241. package/dist/esm/loader.js +1 -1
  242. package/dist/esm/native.js +1 -1
  243. package/dist/esm/nv-alert.entry.js +5 -5
  244. package/dist/esm/nv-alert.entry.js.map +1 -1
  245. package/dist/esm/nv-avatar.entry.js +1 -1
  246. package/dist/esm/nv-badge_2.entry.js +17 -8
  247. package/dist/esm/nv-badge_2.entry.js.map +1 -1
  248. package/dist/esm/nv-button.entry.js +1 -1
  249. package/dist/esm/nv-calendar.entry.js +841 -842
  250. package/dist/esm/nv-calendar.entry.js.map +1 -1
  251. package/dist/esm/nv-datagrid.entry.js +376 -39
  252. package/dist/esm/nv-datagrid.entry.js.map +1 -1
  253. package/dist/esm/nv-dialog.entry.js +18 -12
  254. package/dist/esm/nv-dialog.entry.js.map +1 -1
  255. package/dist/esm/nv-dialogfooter_2.entry.js +1 -1
  256. package/dist/esm/nv-fielddate.entry.js +8 -17
  257. package/dist/esm/nv-fielddate.entry.js.map +1 -1
  258. package/dist/esm/nv-fielddaterange.entry.js +26 -28
  259. package/dist/esm/nv-fielddaterange.entry.js.map +1 -1
  260. package/dist/esm/nv-fielddropdown.entry.js +12 -5
  261. package/dist/esm/nv-fielddropdown.entry.js.map +1 -1
  262. package/dist/esm/nv-fielddropdownitem.entry.js +1 -1
  263. package/dist/esm/nv-fieldmultiselect.entry.js +10 -4
  264. package/dist/esm/nv-fieldmultiselect.entry.js.map +1 -1
  265. package/dist/esm/nv-fieldnumber.entry.js +8 -4
  266. package/dist/esm/nv-fieldnumber.entry.js.map +1 -1
  267. package/dist/esm/nv-fieldpassword.entry.js +8 -4
  268. package/dist/esm/nv-fieldpassword.entry.js.map +1 -1
  269. package/dist/esm/nv-fieldradio.entry.js +3 -3
  270. package/dist/esm/nv-fieldselect.entry.js +10 -6
  271. package/dist/esm/nv-fieldselect.entry.js.map +1 -1
  272. package/dist/esm/nv-fieldtext.entry.js +8 -4
  273. package/dist/esm/nv-fieldtext.entry.js.map +1 -1
  274. package/dist/esm/nv-fieldtextarea.entry.js +8 -4
  275. package/dist/esm/nv-fieldtextarea.entry.js.map +1 -1
  276. package/dist/esm/nv-fieldtime.entry.js +15 -12
  277. package/dist/esm/nv-fieldtime.entry.js.map +1 -1
  278. package/dist/esm/nv-icon.entry.js +3 -3
  279. package/dist/esm/nv-icon.entry.js.map +1 -1
  280. package/dist/esm/nv-iconbutton_2.entry.js +2 -2
  281. package/dist/esm/nv-menu.entry.js +3 -1
  282. package/dist/esm/nv-menu.entry.js.map +1 -1
  283. package/dist/esm/nv-menuitem.entry.js +1 -1
  284. package/dist/esm/nv-popover.entry.js +1 -1
  285. package/dist/esm/nv-row.entry.js +1 -1
  286. package/dist/esm/nv-stack.entry.js +1 -1
  287. package/dist/esm/nv-table.entry.js +2 -2
  288. package/dist/esm/nv-table.entry.js.map +1 -1
  289. package/dist/esm/nv-toggle.entry.js +2 -2
  290. package/dist/esm/nv-tooltip.entry.js +1 -1
  291. package/dist/native/index.esm.js +1 -1
  292. package/dist/native/index.esm.js.map +1 -1
  293. package/dist/native/native.css +1 -1
  294. package/dist/native/native.esm.js +1 -1
  295. package/dist/native/native.esm.js.map +1 -1
  296. package/dist/native/{p-b094296d.entry.js → p-08a75cfa.entry.js} +2 -2
  297. package/dist/native/{p-d5cbf5c8.entry.js → p-14c07207.entry.js} +2 -2
  298. package/dist/native/p-1da72182.entry.js +2 -0
  299. package/dist/native/p-1da72182.entry.js.map +1 -0
  300. package/dist/native/p-2523eead.entry.js +2 -0
  301. package/dist/native/p-2523eead.entry.js.map +1 -0
  302. package/dist/native/p-3953464e.entry.js +7 -0
  303. package/dist/native/p-3953464e.entry.js.map +1 -0
  304. package/dist/native/{p-701b5557.entry.js → p-3b7ef609.entry.js} +2 -2
  305. package/dist/native/{p-63e6aed3.entry.js → p-3cd77d82.entry.js} +2 -2
  306. package/dist/native/p-3cd77d82.entry.js.map +1 -0
  307. package/dist/native/p-470588c2.entry.js +13 -0
  308. package/dist/native/p-470588c2.entry.js.map +1 -0
  309. package/dist/native/p-49cac014.entry.js +2 -0
  310. package/dist/native/p-49cac014.entry.js.map +1 -0
  311. package/dist/native/p-4d164ed6.entry.js +2 -0
  312. package/dist/native/p-4d164ed6.entry.js.map +1 -0
  313. package/dist/native/p-4e635fa7.entry.js +2 -0
  314. package/dist/native/p-4e635fa7.entry.js.map +1 -0
  315. package/dist/native/p-5d21532a.entry.js +2 -0
  316. package/dist/native/p-5d21532a.entry.js.map +1 -0
  317. package/dist/native/{p-39bb95ff.entry.js → p-615947e7.entry.js} +2 -2
  318. package/dist/native/{p-bad11367.entry.js → p-656c56f0.entry.js} +2 -2
  319. package/dist/native/p-656c56f0.entry.js.map +1 -0
  320. package/dist/native/{p-fa77a591.entry.js → p-7042ba8a.entry.js} +2 -2
  321. package/dist/native/p-7e154bfd.entry.js +2 -0
  322. package/dist/native/p-7e154bfd.entry.js.map +1 -0
  323. package/dist/native/p-7eba904e.entry.js +2 -0
  324. package/dist/native/p-7eba904e.entry.js.map +1 -0
  325. package/dist/native/{p-6b348684.entry.js → p-7fd4d13d.entry.js} +2 -2
  326. package/dist/native/{p-fb5bddba.entry.js → p-90e6d9dd.entry.js} +2 -2
  327. package/dist/native/p-ae7ab110.entry.js +2 -0
  328. package/dist/native/p-ae7ab110.entry.js.map +1 -0
  329. package/dist/native/{p-f85aca27.entry.js → p-b8b6875d.entry.js} +2 -2
  330. package/dist/native/p-b94d9f0b.entry.js +2 -0
  331. package/dist/native/p-b94d9f0b.entry.js.map +1 -0
  332. package/dist/native/p-c0f79bac.entry.js +2 -0
  333. package/dist/native/p-c0f79bac.entry.js.map +1 -0
  334. package/dist/native/{p-6ff228da.entry.js → p-c67186f8.entry.js} +2 -2
  335. package/dist/native/{p-eee01062.entry.js → p-c71c6f23.entry.js} +2 -2
  336. package/dist/native/p-d9a52884.entry.js +2 -0
  337. package/dist/native/p-d9a52884.entry.js.map +1 -0
  338. package/dist/native/{p-d7a76400.entry.js → p-efe6a46c.entry.js} +2 -2
  339. package/dist/native/p-f2ef6771.entry.js +2 -0
  340. package/dist/native/p-f5f68992.entry.js +2 -0
  341. package/dist/native/p-f5f68992.entry.js.map +1 -0
  342. package/dist/native/{p-59768ee5.js → p-f85c08f1.js} +2 -2
  343. package/dist/native/p-f85c08f1.js.map +1 -0
  344. package/dist/native/p-fc97f071.entry.js +2 -0
  345. package/dist/native/p-fc97f071.entry.js.map +1 -0
  346. package/dist/types/components/nv-alert/nv-alert.d.ts +1 -1
  347. package/dist/types/components/nv-badge/nv-badge.d.ts +11 -3
  348. package/dist/types/components/nv-calendar/nv-calendar.d.ts +69 -107
  349. package/dist/types/components/nv-calendar/nv-calendar.utils.d.ts +60 -0
  350. package/dist/types/components/nv-calendar/test/nv-calendar.utils.test.d.ts +1 -0
  351. package/dist/types/components/nv-datagrid/nv-datagrid.d.ts +47 -10
  352. package/dist/types/components/nv-dialog/nv-dialog.d.ts +4 -0
  353. package/dist/types/components/nv-fielddate/nv-fielddate.d.ts +6 -7
  354. package/dist/types/components/nv-fielddaterange/nv-fielddaterange.d.ts +13 -12
  355. package/dist/types/components/nv-fielddropdown/nv-fielddropdown.d.ts +4 -0
  356. package/dist/types/components/nv-fieldmultiselect/nv-fieldmultiselect.d.ts +4 -0
  357. package/dist/types/components/nv-fieldnumber/nv-fieldnumber.d.ts +4 -0
  358. package/dist/types/components/nv-fieldpassword/nv-fieldpassword.d.ts +4 -0
  359. package/dist/types/components/nv-fieldselect/nv-fieldselect.d.ts +4 -0
  360. package/dist/types/components/nv-fieldtext/nv-fieldtext.d.ts +4 -0
  361. package/dist/types/components/nv-fieldtextarea/nv-fieldtextarea.d.ts +4 -0
  362. package/dist/types/components/nv-icon/nv-icons.d.ts +1 -1
  363. package/dist/types/components/nv-table/nv-table.d.ts +13 -2
  364. package/dist/types/components.d.ts +269 -116
  365. package/dist/types/index.d.ts +0 -2
  366. package/dist/types/utils/constants.d.ts +9 -0
  367. package/dist/vscode-data.json +221 -1587
  368. package/hydrate/index.js +1466 -1063
  369. package/hydrate/index.mjs +1466 -1063
  370. package/package.json +1 -1
  371. package/dist/cjs/constants-bcd6b2e2.js.map +0 -1
  372. package/dist/collection/interfaces/actionEvent.js +0 -2
  373. package/dist/collection/interfaces/actionEvent.js.map +0 -1
  374. package/dist/collection/interfaces/calendarShortcut.js +0 -2
  375. package/dist/collection/interfaces/calendarShortcut.js.map +0 -1
  376. package/dist/collection/interfaces/dateRange.js +0 -2
  377. package/dist/collection/interfaces/dateRange.js.map +0 -1
  378. package/dist/components/p-373926aa.js +0 -177
  379. package/dist/components/p-373926aa.js.map +0 -1
  380. package/dist/components/p-591730e7.js +0 -88
  381. package/dist/components/p-591730e7.js.map +0 -1
  382. package/dist/components/p-8348db09.js.map +0 -1
  383. package/dist/components/p-f331117c.js +0 -1133
  384. package/dist/components/p-f331117c.js.map +0 -1
  385. package/dist/esm/constants-98e2dcc2.js.map +0 -1
  386. package/dist/native/p-0ee428d5.entry.js +0 -2
  387. package/dist/native/p-0ee428d5.entry.js.map +0 -1
  388. package/dist/native/p-2691e02d.entry.js +0 -2
  389. package/dist/native/p-37f0210e.entry.js +0 -2
  390. package/dist/native/p-37f0210e.entry.js.map +0 -1
  391. package/dist/native/p-4a440970.entry.js +0 -2
  392. package/dist/native/p-4a440970.entry.js.map +0 -1
  393. package/dist/native/p-4ae26462.entry.js +0 -7
  394. package/dist/native/p-4ae26462.entry.js.map +0 -1
  395. package/dist/native/p-4d9c4618.entry.js +0 -2
  396. package/dist/native/p-4d9c4618.entry.js.map +0 -1
  397. package/dist/native/p-59768ee5.js.map +0 -1
  398. package/dist/native/p-59e0bd2b.entry.js +0 -2
  399. package/dist/native/p-59e0bd2b.entry.js.map +0 -1
  400. package/dist/native/p-5c00f092.entry.js +0 -2
  401. package/dist/native/p-5c00f092.entry.js.map +0 -1
  402. package/dist/native/p-63e6aed3.entry.js.map +0 -1
  403. package/dist/native/p-7f5eb2ac.entry.js +0 -2
  404. package/dist/native/p-7f5eb2ac.entry.js.map +0 -1
  405. package/dist/native/p-84a73e2a.entry.js +0 -2
  406. package/dist/native/p-84a73e2a.entry.js.map +0 -1
  407. package/dist/native/p-93dc2f47.entry.js +0 -2
  408. package/dist/native/p-93dc2f47.entry.js.map +0 -1
  409. package/dist/native/p-9a267f16.entry.js +0 -13
  410. package/dist/native/p-9a267f16.entry.js.map +0 -1
  411. package/dist/native/p-9d6431c7.entry.js +0 -2
  412. package/dist/native/p-9d6431c7.entry.js.map +0 -1
  413. package/dist/native/p-b2ce83ad.entry.js +0 -2
  414. package/dist/native/p-b2ce83ad.entry.js.map +0 -1
  415. package/dist/native/p-bad11367.entry.js.map +0 -1
  416. package/dist/native/p-e1a4f776.entry.js +0 -2
  417. package/dist/native/p-e1a4f776.entry.js.map +0 -1
  418. package/dist/native/p-e49bbd02.entry.js +0 -2
  419. package/dist/native/p-e49bbd02.entry.js.map +0 -1
  420. package/dist/native/p-f6bdc270.entry.js +0 -2
  421. package/dist/native/p-f6bdc270.entry.js.map +0 -1
  422. package/dist/types/interfaces/actionEvent.d.ts +0 -13
  423. package/dist/types/interfaces/calendarShortcut.d.ts +0 -17
  424. package/dist/types/interfaces/dateRange.d.ts +0 -13
  425. /package/dist/native/{p-b094296d.entry.js.map → p-08a75cfa.entry.js.map} +0 -0
  426. /package/dist/native/{p-d5cbf5c8.entry.js.map → p-14c07207.entry.js.map} +0 -0
  427. /package/dist/native/{p-701b5557.entry.js.map → p-3b7ef609.entry.js.map} +0 -0
  428. /package/dist/native/{p-39bb95ff.entry.js.map → p-615947e7.entry.js.map} +0 -0
  429. /package/dist/native/{p-fa77a591.entry.js.map → p-7042ba8a.entry.js.map} +0 -0
  430. /package/dist/native/{p-6b348684.entry.js.map → p-7fd4d13d.entry.js.map} +0 -0
  431. /package/dist/native/{p-fb5bddba.entry.js.map → p-90e6d9dd.entry.js.map} +0 -0
  432. /package/dist/native/{p-f85aca27.entry.js.map → p-b8b6875d.entry.js.map} +0 -0
  433. /package/dist/native/{p-6ff228da.entry.js.map → p-c67186f8.entry.js.map} +0 -0
  434. /package/dist/native/{p-eee01062.entry.js.map → p-c71c6f23.entry.js.map} +0 -0
  435. /package/dist/native/{p-d7a76400.entry.js.map → p-efe6a46c.entry.js.map} +0 -0
  436. /package/dist/native/{p-2691e02d.entry.js.map → p-f2ef6771.entry.js.map} +0 -0
@@ -1,16 +1,14 @@
1
1
  /* eslint-disable @typescript-eslint/no-explicit-any */
2
2
  import { h, Host, } from "@stencil/core";
3
- import { createTable, getCoreRowModel, createColumnHelper, getFilteredRowModel, getPaginationRowModel, } from "@tanstack/table-core";
3
+ import { createTable, getCoreRowModel, createColumnHelper, getFilteredRowModel, getPaginationRowModel, getSortedRowModel, } from "@tanstack/table-core";
4
4
  import { deepCopyElement, excludedProps } from "../../utils/dom.utils";
5
5
  import { debounce } from "../../utils/input.utils";
6
+ import { SortingPossibility, } from "../../utils/constants";
6
7
  /**
7
8
  * A flexible data grid component powered by `@tanstack/table-core`.
8
9
  * @slot default - Use this slot to insert HTML into the data grid content.
9
10
  * @slot before - Use this slot to insert HTML before the data grid.
10
11
  * @slot after - Use this slot to insert HTML after the data grid.
11
- *
12
- * @deprecated [EXPERIMENTAL]
13
- * @experimental - This component is still under development and is not ready for use.
14
12
  */
15
13
  export class NvDatagrid {
16
14
  constructor() {
@@ -25,6 +23,8 @@ export class NvDatagrid {
25
23
  this.globalFilterSearchTerm = '';
26
24
  this.columnData = [];
27
25
  this.paginationState = null;
26
+ this.sorting = [];
27
+ this.rowSelectionState = {};
28
28
  //#endregion STATES
29
29
  /****************************************************************************/
30
30
  //#region PROPERTIES
@@ -60,6 +60,12 @@ export class NvDatagrid {
60
60
  * @default 'No data or columns available to display.'
61
61
  */
62
62
  this.noColumnsNoDataMessage = 'No data or columns available to display.';
63
+ /**
64
+ * Whether to automatically generate columns if none are provided.
65
+ * If columns are explicitly set, this property is ignored.
66
+ * @default false
67
+ */
68
+ this.autoGenerateColumns = false;
63
69
  /**
64
70
  * Whether to enable global filtering for the data grid.
65
71
  * This allows users to search across all columns for a specific value.
@@ -69,11 +75,9 @@ export class NvDatagrid {
69
75
  */
70
76
  this.enableGlobalFilter = false;
71
77
  /**
72
- * Whether to automatically generate columns if none are provided.
73
- * If columns are explicitly set, this property is ignored.
74
- * @default false
78
+ * Position the global filter input field
75
79
  */
76
- this.autoGenerateColumns = false;
80
+ this.globalFilterPosition = 'end';
77
81
  /**
78
82
  * Whether to enable pagination for the data grid.
79
83
  * @default false
@@ -81,6 +85,7 @@ export class NvDatagrid {
81
85
  this.enablePagination = false;
82
86
  /**
83
87
  * The number of rows to display per page.
88
+ * If the number is not present in the property pageSizes it takes the first of the list.
84
89
  * @default 10
85
90
  */
86
91
  this.pageSize = 10;
@@ -89,6 +94,15 @@ export class NvDatagrid {
89
94
  * @default [10, 20, 30, 40, 50]
90
95
  */
91
96
  this.pageSizes = [10, 20, 30, 40, 50];
97
+ /**
98
+ * Whether to enable sorting for the data grid.
99
+ * @default false
100
+ */
101
+ this.enableSorting = false;
102
+ /**
103
+ * Whether to enable row selection for the data grid.
104
+ */
105
+ this.enableRowSelection = false;
92
106
  this.debouncedFilter = debounce((value) => {
93
107
  var _a;
94
108
  (_a = this.table) === null || _a === void 0 ? void 0 : _a.setGlobalFilter(value);
@@ -121,8 +135,32 @@ export class NvDatagrid {
121
135
  };
122
136
  this.handlePageSizeChange = (event) => {
123
137
  const target = event.target;
138
+ let effectivePageSize = Number(target.value);
139
+ if (!this.pageSizes.includes(effectivePageSize) && this.pageSizes) {
140
+ effectivePageSize = this.pageSizes[0];
141
+ }
124
142
  // Simply use `setPageSize` to update the page size directly
125
- this.paginationState = Object.assign(Object.assign({}, this.paginationState), { pageSize: Number(target.value) }); // This triggers the paginationState watcher
143
+ this.paginationState = Object.assign(Object.assign({}, this.paginationState), { pageSize: effectivePageSize }); // This triggers the paginationState watcher
144
+ };
145
+ this.handleSortingClick = (event, header) => {
146
+ var _a;
147
+ if (!header.column.getCanSort()) {
148
+ return;
149
+ }
150
+ (_a = header.column.getToggleSortingHandler()) === null || _a === void 0 ? void 0 : _a(event);
151
+ };
152
+ this.getSortTitle = (header) => {
153
+ if (!header.column.getCanSort())
154
+ return;
155
+ const nextOrder = header.column.getNextSortingOrder();
156
+ switch (nextOrder) {
157
+ case SortingPossibility.Asc:
158
+ return 'Sort ascending';
159
+ case SortingPossibility.Desc:
160
+ return 'Sort descending';
161
+ default:
162
+ return 'Clear sort';
163
+ }
126
164
  };
127
165
  }
128
166
  //#endregion PROPERTIES
@@ -315,9 +353,14 @@ export class NvDatagrid {
315
353
  }
316
354
  if (this.enablePagination) {
317
355
  tableOptions.getPaginationRowModel = getPaginationRowModel();
356
+ const pageIndex = (_b = (_a = this.paginationState) === null || _a === void 0 ? void 0 : _a.pageIndex) !== null && _b !== void 0 ? _b : 0;
357
+ let effectivePageSize = (_d = (_c = this.paginationState) === null || _c === void 0 ? void 0 : _c.pageSize) !== null && _d !== void 0 ? _d : 10;
358
+ if (!this.pageSizes.includes(effectivePageSize) && this.pageSizes) {
359
+ effectivePageSize = this.pageSizes[0];
360
+ }
318
361
  const pagination = {
319
- pageIndex: (_b = (_a = this.paginationState) === null || _a === void 0 ? void 0 : _a.pageIndex) !== null && _b !== void 0 ? _b : 0,
320
- pageSize: (_d = (_c = this.paginationState) === null || _c === void 0 ? void 0 : _c.pageSize) !== null && _d !== void 0 ? _d : 10,
362
+ pageIndex: pageIndex,
363
+ pageSize: effectivePageSize,
321
364
  };
322
365
  // Set the initial pagination value with safeguards
323
366
  tableOptions.state.pagination = pagination;
@@ -328,6 +371,33 @@ export class NvDatagrid {
328
371
  this.paginationState = newPagination;
329
372
  };
330
373
  }
374
+ if (this.enableSorting) {
375
+ tableOptions.getSortedRowModel = getSortedRowModel();
376
+ tableOptions.enableSorting = this.enableSorting;
377
+ tableOptions.state.sorting = this.sorting;
378
+ tableOptions.onSortingChange = updater => {
379
+ const newSorting = typeof updater === 'function' ? updater(this.sorting) : updater;
380
+ this.sorting = newSorting; // Will automatically trigger the searchTerm watcher and update the table
381
+ };
382
+ }
383
+ if (this.enableRowSelection) {
384
+ tableOptions.state.rowSelection = this.rowSelectionState;
385
+ tableOptions.onRowSelectionChange = updater => {
386
+ const newRowSelectionState = typeof updater === 'function'
387
+ ? updater(this.rowSelectionState)
388
+ : updater;
389
+ this.rowSelectionState = newRowSelectionState;
390
+ // Emit the original rows instead of IDs
391
+ const selectedRows = Object.keys(newRowSelectionState)
392
+ .filter(rowId => newRowSelectionState[rowId])
393
+ .map(rowId => {
394
+ // Assuming rowId corresponds to the index in parsedData
395
+ const index = parseInt(rowId, 10); // Convert rowId to an integer index
396
+ return this.parsedData[index]; // Get the original row data
397
+ });
398
+ this.selectedRows.emit(selectedRows); // Emit the original rows
399
+ };
400
+ }
331
401
  // Initialize the table
332
402
  this.table = createTable(tableOptions);
333
403
  }
@@ -362,14 +432,67 @@ export class NvDatagrid {
362
432
  };
363
433
  return checkValue(row.original);
364
434
  }
435
+ createIconSpan(checked, indeterminate) {
436
+ const span = document.createElement('span');
437
+ span.className = 'icon';
438
+ if (checked && !indeterminate) {
439
+ const svg = document.createElementNS('http://www.w3.org/2000/svg', 'svg');
440
+ svg.setAttribute('xmlns', 'http://www.w3.org/2000/svg');
441
+ svg.setAttribute('width', '14');
442
+ svg.setAttribute('height', '14');
443
+ svg.setAttribute('viewBox', '0 0 14 14');
444
+ svg.setAttribute('fill', 'none');
445
+ const path = document.createElementNS('http://www.w3.org/2000/svg', 'path');
446
+ path.setAttribute('d', 'M11.6667 3.5L5.25004 9.91667L2.33337 7');
447
+ path.setAttribute('stroke-linecap', 'round');
448
+ path.setAttribute('stroke-linejoin', 'round');
449
+ svg.appendChild(path);
450
+ span.appendChild(svg);
451
+ }
452
+ if (indeterminate) {
453
+ const svg = document.createElementNS('http://www.w3.org/2000/svg', 'svg');
454
+ svg.classList.add('indeterminate-svg');
455
+ svg.setAttribute('xmlns', 'http://www.w3.org/2000/svg');
456
+ svg.setAttribute('viewBox', '0 0 14 14');
457
+ svg.setAttribute('fill', 'none');
458
+ const path = document.createElementNS('http://www.w3.org/2000/svg', 'path');
459
+ path.setAttribute('d', 'M2.9165 7H11.0832');
460
+ path.setAttribute('stroke-linecap', 'round');
461
+ path.setAttribute('stroke-linejoin', 'round');
462
+ svg.appendChild(path);
463
+ span.appendChild(svg);
464
+ }
465
+ return span;
466
+ }
467
+ createIndeterminateCheckbox(options = {}) {
468
+ const { indeterminate, checked = false, disabled = false, className = '', onChange, } = options;
469
+ const input = document.createElement('input');
470
+ input.type = 'checkbox';
471
+ input.checked = checked;
472
+ input.disabled = disabled;
473
+ input.className = `${className} cursor-pointer`.trim();
474
+ if (typeof indeterminate === 'boolean') {
475
+ input.indeterminate = !checked && indeterminate;
476
+ }
477
+ if (onChange) {
478
+ input.addEventListener('change', onChange);
479
+ }
480
+ const iconSpan = this.createIconSpan(checked, indeterminate);
481
+ const container = document.createElement('div');
482
+ container.className = 'checkbox-container';
483
+ container.appendChild(input);
484
+ container.appendChild(iconSpan);
485
+ return container;
486
+ }
365
487
  // Helper function to generate column definitions
366
488
  generateColumns(validColumns, tableOptions) {
489
+ let generatedColumns = [];
367
490
  const columnHelper = createColumnHelper();
368
491
  if (validColumns.length > 0) {
369
492
  // Use defined columns
370
- return validColumns.map(column => {
493
+ generatedColumns = validColumns.map(column => {
371
494
  var _a, _b;
372
- return columnHelper.accessor(column.accessor, {
495
+ const identifiedColumnDef = {
373
496
  header: (_b = (this.renderTemplate(this.headerTemplateCache.get(column.accessor), (_a = column.header) !== null && _a !== void 0 ? _a : column.accessor, null) ||
374
497
  column.header)) !== null && _b !== void 0 ? _b : column.accessor,
375
498
  cell: (info) => {
@@ -387,35 +510,83 @@ export class NvDatagrid {
387
510
  value)) !== null && _b !== void 0 ? _b : value) !== null && _c !== void 0 ? _c : this.fallbackValue;
388
511
  },
389
512
  enableGlobalFilter: this.enableGlobalFilter,
390
- });
513
+ enableSorting: this.enableSorting,
514
+ };
515
+ if (this.enableSorting) {
516
+ identifiedColumnDef.sortUndefined = 'last'; // Force undefined values to the end
517
+ identifiedColumnDef.sortDescFirst = false; // First sort order will be ascending (nullable values can mess up auto detection of sort order)
518
+ }
519
+ return columnHelper.accessor(column.accessor, identifiedColumnDef);
391
520
  });
392
521
  }
393
522
  else if (tableOptions.data && tableOptions.data.length > 0) {
394
523
  // Generate columns from data keys
395
524
  const sampleRow = tableOptions.data[0];
396
- return Object.keys(sampleRow).map(key => columnHelper.accessor(key, {
397
- header: this.renderTemplate(this.headerTemplateCache.get(key), key.charAt(0).toUpperCase() + key.slice(1), null) || key.charAt(0).toUpperCase() + key.slice(1), // Capitalize key for header
398
- cell: (info) => {
399
- var _a, _b, _c;
400
- const value = info.getValue();
401
- const cellAccessors = key;
402
- const row = info.row;
403
- return ((_a = this.columnData.find(x => x.accessor === cellAccessors)) === null || _a === void 0 ? void 0 : _a.repeatTemplate) && Array.isArray(value)
404
- ? value.map((item) => {
405
- var _a, _b;
406
- return (_b = (_a = (this.renderTemplate(this.templateCache.get(cellAccessors), item, row) ||
407
- item)) !== null && _a !== void 0 ? _a : value) !== null && _b !== void 0 ? _b : this.fallbackValue;
408
- })
409
- : (_c = (_b = (this.renderTemplate(this.templateCache.get(cellAccessors), value, row) ||
410
- value)) !== null && _b !== void 0 ? _b : value) !== null && _c !== void 0 ? _c : this.fallbackValue;
411
- },
412
- enableGlobalFilter: this.enableGlobalFilter,
413
- }));
525
+ generatedColumns = Object.keys(sampleRow).map(key => {
526
+ const identifiedColumnDef = {
527
+ header: this.renderTemplate(this.headerTemplateCache.get(key), key.charAt(0).toUpperCase() + key.slice(1), null) || key.charAt(0).toUpperCase() + key.slice(1), // Capitalize key for header
528
+ cell: (info) => {
529
+ var _a, _b, _c;
530
+ const value = info.getValue();
531
+ const cellAccessors = key;
532
+ const row = info.row;
533
+ return ((_a = this.columnData.find(x => x.accessor === cellAccessors)) === null || _a === void 0 ? void 0 : _a.repeatTemplate) && Array.isArray(value)
534
+ ? value.map((item) => {
535
+ var _a, _b;
536
+ return (_b = (_a = (this.renderTemplate(this.templateCache.get(cellAccessors), item, row) ||
537
+ item)) !== null && _a !== void 0 ? _a : value) !== null && _b !== void 0 ? _b : this.fallbackValue;
538
+ })
539
+ : (_c = (_b = (this.renderTemplate(this.templateCache.get(cellAccessors), value, row) ||
540
+ value)) !== null && _b !== void 0 ? _b : value) !== null && _c !== void 0 ? _c : this.fallbackValue;
541
+ },
542
+ enableGlobalFilter: this.enableGlobalFilter,
543
+ enableSorting: this.enableSorting,
544
+ };
545
+ if (this.enableSorting) {
546
+ identifiedColumnDef.sortUndefined = 'last'; // Force undefined values to the end
547
+ identifiedColumnDef.sortDescFirst = false; // First sort order will be ascending (nullable values can mess up auto detection of sort order)
548
+ }
549
+ return columnHelper.accessor(key, identifiedColumnDef);
550
+ });
414
551
  }
415
552
  else {
416
553
  // No columns and no data
417
- return [];
418
554
  }
555
+ if (this.enableRowSelection) {
556
+ const rowSelection = columnHelper.accessor('select', {
557
+ header: ({ table }) => {
558
+ return (h("div", { class: "flex px-1", ref: el => {
559
+ const checkbox = this.createIndeterminateCheckbox({
560
+ checked: table === null || table === void 0 ? void 0 : table.getIsAllRowsSelected(),
561
+ indeterminate: table === null || table === void 0 ? void 0 : table.getIsSomeRowsSelected(),
562
+ onChange: table === null || table === void 0 ? void 0 : table.getToggleAllRowsSelectedHandler(),
563
+ });
564
+ if (el) {
565
+ el.innerHTML = ''; // Remove existing content
566
+ el.appendChild(checkbox); // Append new checkbox
567
+ }
568
+ } }));
569
+ },
570
+ cell: ({ row }) => {
571
+ return (h("div", { class: "flex px-1", ref: el => {
572
+ const checkbox = this.createIndeterminateCheckbox({
573
+ checked: row === null || row === void 0 ? void 0 : row.getIsSelected(),
574
+ disabled: !(row === null || row === void 0 ? void 0 : row.getCanSelect()),
575
+ indeterminate: row === null || row === void 0 ? void 0 : row.getIsSomeSelected(),
576
+ onChange: row === null || row === void 0 ? void 0 : row.getToggleSelectedHandler(),
577
+ });
578
+ if (el) {
579
+ el.innerHTML = ''; // Remove existing content
580
+ el.appendChild(checkbox); // Append new checkbox
581
+ }
582
+ } }));
583
+ },
584
+ enableGlobalFilter: false,
585
+ enableSorting: false,
586
+ });
587
+ generatedColumns = [rowSelection, ...generatedColumns];
588
+ }
589
+ return generatedColumns;
419
590
  }
420
591
  getTableData() {
421
592
  if (this.parsedData &&
@@ -663,6 +834,46 @@ export class NvDatagrid {
663
834
  });
664
835
  }
665
836
  }
837
+ getArrowSorting(header) {
838
+ if (!header.column.getCanSort())
839
+ return null;
840
+ const sortState = header.column.getIsSorted();
841
+ if (sortState === SortingPossibility.Asc) {
842
+ return (h("div", { class: "inline-flex align-middle" }, h("nv-icon", { name: "arrow-up" })));
843
+ }
844
+ if (sortState === SortingPossibility.Desc) {
845
+ return (h("div", { class: "inline-flex align-middle" }, h("nv-icon", { name: "arrow-down" })));
846
+ }
847
+ return null;
848
+ }
849
+ getHeaderCell(header) {
850
+ const isSortable = header.column.getCanSort();
851
+ const sortTitle = this.getSortTitle(header);
852
+ const content = header.isPlaceholder
853
+ ? null
854
+ : header.column.columnDef.header
855
+ ? this.flexRender(header.column.columnDef.header, header.getContext())
856
+ : null; // Ensure content is not null
857
+ const sortIcon = this.getArrowSorting(header);
858
+ const handleClick = this.createSortingClickHandler(header);
859
+ if (this.enableRowSelection) {
860
+ return (h("th", { key: header.id }, content, " "));
861
+ }
862
+ const returnHtml = (h("th", { key: header.id }, h("button", { type: "button", class: isSortable
863
+ ? 'w-full text-left cursor-pointer select-none bg-transparent border-none p-0 m-0 focus:outline-none'
864
+ : 'w-full text-left bg-transparent border-none p-0 m-0 cursor-default', onClick: handleClick, title: sortTitle }, h("span", { class: "inline-flex items-center gap-1" }, content, sortIcon))));
865
+ return returnHtml;
866
+ }
867
+ // 👇 Helper method to avoid arrow function in JSX
868
+ createSortingClickHandler(header) {
869
+ return (e) => {
870
+ this.handleSortingClick(e, header);
871
+ };
872
+ }
873
+ getPagination() {
874
+ var _a;
875
+ return (this.enablePagination && (h("div", { class: "flex items-center gap-2" }, h("button", { class: "border rounded p-1", disabled: !this.table.getCanPreviousPage(), onClick: this.table.firstPage }, "<<"), h("button", { class: "border rounded p-1", disabled: !this.table.getCanPreviousPage(), onClick: this.table.previousPage }, "<"), h("button", { class: "border rounded p-1", disabled: !this.table.getCanNextPage(), onClick: this.table.nextPage }, ">"), h("button", { class: "border rounded p-1", disabled: !this.table.getCanNextPage(), onClick: this.table.lastPage }, ">>"), h("span", { class: "flex items-center gap-1" }, h("div", null, "Page"), h("strong", null, this.table.getState().pagination.pageIndex + 1, " of", ' ', this.table.getPageCount().toLocaleString())), h("span", { class: "flex items-center gap-1" }, "| Go to page:", ' ', h("input", { type: "number", min: this.minPageIndex, max: this.table.getPageCount(), value: this.table.getState().pagination.pageIndex + 1, class: "border p-1 rounded w-16", "aria-label": "Go to page", onInput: this.handlePageIndexChange })), ((_a = this.pageSizes) === null || _a === void 0 ? void 0 : _a.length) > 0 && (h("select", { "aria-label": "Rows per page", onChange: this.handlePageSizeChange }, this.pageSizes.map(pageSize => (h("option", { value: String(pageSize), selected: this.table.getState().pagination.pageSize === pageSize }, "Show ", pageSize))))))));
876
+ }
666
877
  //#endregion METHODS
667
878
  /****************************************************************************/
668
879
  //#region WATCHERS
@@ -720,6 +931,39 @@ export class NvDatagrid {
720
931
  this.table.options.state.pagination = newValue;
721
932
  }
722
933
  }
934
+ handleSorting(newValue) {
935
+ if (!this.table) {
936
+ console.warn('Table is not initialized yet.');
937
+ return;
938
+ }
939
+ // Not working
940
+ /*// Set the sorting for the table
941
+ this.table.setSorting(newValue);*/
942
+ // Manually update the sorting state
943
+ this.table.options.state.sorting = newValue;
944
+ }
945
+ handlePageSize(newValue) {
946
+ let effectivePageSize = newValue;
947
+ if (!this.pageSizes.includes(effectivePageSize) && this.pageSizes) {
948
+ effectivePageSize = this.pageSizes[0];
949
+ }
950
+ // Simply use `setPageSize` to update the page size directly
951
+ this.paginationState = Object.assign(Object.assign({}, this.paginationState), { pageSize: effectivePageSize }); // This triggers the paginationState watcher
952
+ }
953
+ handleRowSelectionState(newValue, oldValue) {
954
+ if (!this.table) {
955
+ console.warn('Table is not initialized yet.');
956
+ return;
957
+ }
958
+ // Only update if there is a meaningful change
959
+ if (JSON.stringify(newValue) !== JSON.stringify(oldValue)) {
960
+ // Not working
961
+ /*// Set the rowSelection for the table
962
+ this.table.setRowSelection(newValue);*/
963
+ // Manually update the row selection state
964
+ this.table.options.state.rowSelection = newValue;
965
+ }
966
+ }
723
967
  //#endregion WATCHERS
724
968
  /****************************************************************************/
725
969
  //#region LIFECYCLE
@@ -729,7 +973,10 @@ export class NvDatagrid {
729
973
  this.initializeTable();
730
974
  if (this.enablePagination) {
731
975
  // Ensure a valid page size
732
- const effectivePageSize = this.pageSize > 0 ? this.pageSize : 10;
976
+ let effectivePageSize = this.pageSize > 0 ? this.pageSize : 10;
977
+ if (!this.pageSizes.includes(effectivePageSize) && this.pageSizes) {
978
+ effectivePageSize = this.pageSizes[0];
979
+ }
733
980
  this.paginationState = {
734
981
  pageIndex: Math.max(0, this.minPageIndex - 1),
735
982
  pageSize: effectivePageSize,
@@ -747,11 +994,9 @@ export class NvDatagrid {
747
994
  const rows = !this.table || this.table === undefined || this.parsedData.length === 0
748
995
  ? []
749
996
  : (_c = (_b = this.table) === null || _b === void 0 ? void 0 : _b.getRowModel()) === null || _c === void 0 ? void 0 : _c.rows;
750
- return (h(Host, { key: 'b3886397a5e6694611636d4da7d61ae5ccbe1903' }, h("div", { key: '8fa71d83f4cfa79cf7fb334bcf6115e4cf253c5d', class: "hidden" }, h("slot", { key: '9aad5956b5973cafc486f3a854a66ae86038ef4a' })), h("slot", { key: '7a1ca93223567faffabb3473df2176cd02654247', name: "before" }), this.enableGlobalFilter && this.table && (h("div", { key: '0020880c229d8ed9070c15182191e86b8b3fed1d', class: "search-container" }, h("input", { key: 'cefc47330a7d770c3668d1406930b9ac50992a10', type: "text", value: (_d = this.globalFilterSearchTerm) !== null && _d !== void 0 ? _d : '', onInput: this.handleGlobalFilteringOnInput, placeholder: "Search all columns...", class: "search-input", "aria-label": "Search all columns" }))), this.parsedColumns.length === 0 && this.parsedData.length === 0 ? (h("div", { class: "no-data" }, this.noColumnsNoDataMessage)) : (h("div", null, h("table", null, this.parsedColumns.length > 0 && headerGroups.length > 0 && (h("thead", null, this.parsedColumns.length > 0 && headerGroups
997
+ return (h(Host, { key: '7ed48645de6272bb3fed7897406e2a798021bba2' }, h("div", { key: '4ae6135c7ca302e06c3d26509dbf813128631a2e', class: "hidden" }, h("slot", { key: '3f8078b877a4e2ebe46842fc3a52d7059cb3cc68' })), h("slot", { key: 'c97cb30a0ce80dc8c25c2b855eb6086937dbe76b', name: "before" }), this.enableGlobalFilter && this.table && (h("div", { key: '68cd75ed6ecad3de049797ebfe7787f5a0b357fa', class: `search-container justify-${this.globalFilterPosition}` }, h("nv-fieldtext", { key: '80b4f8b50c3dda39555597a44707f3a296fbb8e6', value: this.globalFilterSearchTerm, onInput: this.handleGlobalFilteringOnInput, placeholder: "Search all columns..." }))), this.parsedColumns.length === 0 && this.parsedData.length === 0 ? (h("div", { class: "no-data" }, this.noColumnsNoDataMessage)) : (h("div", null, h("table", null, this.parsedColumns.length > 0 && headerGroups.length > 0 && (h("thead", null, this.parsedColumns.length > 0 && headerGroups
751
998
  ? headerGroups === null || headerGroups === void 0 ? void 0 : headerGroups.map(headerGroup => (h("tr", { key: headerGroup.id }, headerGroup.headers.map(header => {
752
- return (h("th", { key: header.id }, header.isPlaceholder
753
- ? null
754
- : this.flexRender(header.column.columnDef.header, header.getContext())));
999
+ return this.getHeaderCell(header);
755
1000
  }))))
756
1001
  : null)), h("tbody", null, !rows || rows.length === 0 || this.parsedData.length === 0 ? (h("tr", null, h("td", { colSpan: this.parsedColumns.length || 12, class: "no-data" }, this.noDataMessage))) : (rows.map(row => {
757
1002
  const rowId = row.id;
@@ -759,7 +1004,8 @@ export class NvDatagrid {
759
1004
  return (h("tr", { key: rowId }, visibleCells.map(cell => {
760
1005
  return (h("td", { key: cell.id, "data-row-id": rowId }, this.flexRender(cell.column.columnDef.cell, cell.getContext())));
761
1006
  })));
762
- })))), this.enablePagination && (h("div", { class: "flex items-center gap-2" }, h("button", { class: "border rounded p-1", disabled: !this.table.getCanPreviousPage(), onClick: this.table.firstPage }, "<<"), h("button", { class: "border rounded p-1", disabled: !this.table.getCanPreviousPage(), onClick: this.table.previousPage }, "<"), h("button", { class: "border rounded p-1", disabled: !this.table.getCanNextPage(), onClick: this.table.nextPage }, ">"), h("button", { class: "border rounded p-1", disabled: !this.table.getCanNextPage(), onClick: this.table.lastPage }, ">>"), h("span", { class: "flex items-center gap-1" }, h("div", null, "Page"), h("strong", null, this.table.getState().pagination.pageIndex + 1, " of", ' ', this.table.getPageCount().toLocaleString())), h("span", { class: "flex items-center gap-1" }, "| Go to page:", ' ', h("input", { type: "number", min: this.minPageIndex, max: this.table.getPageCount(), value: this.table.getState().pagination.pageIndex + 1, class: "border p-1 rounded w-16", "aria-label": "Go to page", onInput: this.handlePageIndexChange })), (_e = this.pageSizes) !== null && _e !== void 0 ? _e : (h("select", { "aria-label": "Rows per page", onChange: this.handlePageSizeChange }, this.pageSizes.map(pageSize => (h("option", { value: String(pageSize), selected: this.table.getState().pagination.pageSize === pageSize }, "Show ", pageSize))))))))), h("slot", { key: '2030fdc2b38a293e749f2ffd4645987e834fee76', name: "after" })));
1007
+ }))), this.table && this.enableRowSelection ? (h("tfoot", null, h("tr", null, h("td", { colSpan: 20 }, this.enableRowSelection && this.table ? (h("div", null, this.rowSelectionState &&
1008
+ Object.keys(this.rowSelectionState).length > 0 ? (h("span", null, Object.keys(this.rowSelectionState).length, " of", ' ', ((_e = (_d = this.table.getPreFilteredRowModel()) === null || _d === void 0 ? void 0 : _d.rows) === null || _e === void 0 ? void 0 : _e.length) || 0, ' ', "Total Rows Selected")) : (h("span", null, "No rows selected")))) : null)))) : null), this.getPagination())), h("slot", { key: 'f7209e67ff423310bb4b59b866f486ade897781a', name: "after" })));
763
1009
  }
764
1010
  static get is() { return "nv-datagrid"; }
765
1011
  static get originalStyleUrls() {
@@ -941,7 +1187,7 @@ export class NvDatagrid {
941
1187
  "reflect": true,
942
1188
  "defaultValue": "'No data or columns available to display.'"
943
1189
  },
944
- "enableGlobalFilter": {
1190
+ "autoGenerateColumns": {
945
1191
  "type": "boolean",
946
1192
  "mutable": false,
947
1193
  "complexType": {
@@ -956,15 +1202,15 @@ export class NvDatagrid {
956
1202
  "name": "default",
957
1203
  "text": "false"
958
1204
  }],
959
- "text": "Whether to enable global filtering for the data grid.\nThis allows users to search across all columns for a specific value.\nThe search is case-insensitive and supports partial matches.\nIt use string.includes() to match the search term."
1205
+ "text": "Whether to automatically generate columns if none are provided.\nIf columns are explicitly set, this property is ignored."
960
1206
  },
961
1207
  "getter": false,
962
1208
  "setter": false,
963
- "attribute": "enable-global-filter",
1209
+ "attribute": "auto-generate-columns",
964
1210
  "reflect": true,
965
1211
  "defaultValue": "false"
966
1212
  },
967
- "autoGenerateColumns": {
1213
+ "enableGlobalFilter": {
968
1214
  "type": "boolean",
969
1215
  "mutable": false,
970
1216
  "complexType": {
@@ -979,14 +1225,40 @@ export class NvDatagrid {
979
1225
  "name": "default",
980
1226
  "text": "false"
981
1227
  }],
982
- "text": "Whether to automatically generate columns if none are provided.\nIf columns are explicitly set, this property is ignored."
1228
+ "text": "Whether to enable global filtering for the data grid.\nThis allows users to search across all columns for a specific value.\nThe search is case-insensitive and supports partial matches.\nIt use string.includes() to match the search term."
983
1229
  },
984
1230
  "getter": false,
985
1231
  "setter": false,
986
- "attribute": "auto-generate-columns",
1232
+ "attribute": "enable-global-filter",
987
1233
  "reflect": true,
988
1234
  "defaultValue": "false"
989
1235
  },
1236
+ "globalFilterPosition": {
1237
+ "type": "string",
1238
+ "mutable": false,
1239
+ "complexType": {
1240
+ "original": "`${GlobalFilterPosition}`",
1241
+ "resolved": "\"center\" | \"end\" | \"start\"",
1242
+ "references": {
1243
+ "GlobalFilterPosition": {
1244
+ "location": "import",
1245
+ "path": "../../utils/constants",
1246
+ "id": "src/utils/constants.ts::GlobalFilterPosition"
1247
+ }
1248
+ }
1249
+ },
1250
+ "required": false,
1251
+ "optional": false,
1252
+ "docs": {
1253
+ "tags": [],
1254
+ "text": "Position the global filter input field"
1255
+ },
1256
+ "getter": false,
1257
+ "setter": false,
1258
+ "attribute": "global-filter-position",
1259
+ "reflect": true,
1260
+ "defaultValue": "'end'"
1261
+ },
990
1262
  "enablePagination": {
991
1263
  "type": "boolean",
992
1264
  "mutable": false,
@@ -1025,7 +1297,7 @@ export class NvDatagrid {
1025
1297
  "name": "default",
1026
1298
  "text": "10"
1027
1299
  }],
1028
- "text": "The number of rows to display per page."
1300
+ "text": "The number of rows to display per page.\nIf the number is not present in the property pageSizes it takes the first of the list."
1029
1301
  },
1030
1302
  "getter": false,
1031
1303
  "setter": false,
@@ -1053,6 +1325,49 @@ export class NvDatagrid {
1053
1325
  "getter": false,
1054
1326
  "setter": false,
1055
1327
  "defaultValue": "[10, 20, 30, 40, 50]"
1328
+ },
1329
+ "enableSorting": {
1330
+ "type": "boolean",
1331
+ "mutable": false,
1332
+ "complexType": {
1333
+ "original": "boolean",
1334
+ "resolved": "boolean",
1335
+ "references": {}
1336
+ },
1337
+ "required": false,
1338
+ "optional": false,
1339
+ "docs": {
1340
+ "tags": [{
1341
+ "name": "default",
1342
+ "text": "false"
1343
+ }],
1344
+ "text": "Whether to enable sorting for the data grid."
1345
+ },
1346
+ "getter": false,
1347
+ "setter": false,
1348
+ "attribute": "enable-sorting",
1349
+ "reflect": true,
1350
+ "defaultValue": "false"
1351
+ },
1352
+ "enableRowSelection": {
1353
+ "type": "boolean",
1354
+ "mutable": false,
1355
+ "complexType": {
1356
+ "original": "boolean",
1357
+ "resolved": "boolean",
1358
+ "references": {}
1359
+ },
1360
+ "required": false,
1361
+ "optional": false,
1362
+ "docs": {
1363
+ "tags": [],
1364
+ "text": "Whether to enable row selection for the data grid."
1365
+ },
1366
+ "getter": false,
1367
+ "setter": false,
1368
+ "attribute": "enable-row-selection",
1369
+ "reflect": true,
1370
+ "defaultValue": "false"
1056
1371
  }
1057
1372
  };
1058
1373
  }
@@ -1063,7 +1378,9 @@ export class NvDatagrid {
1063
1378
  "parsedData": {},
1064
1379
  "globalFilterSearchTerm": {},
1065
1380
  "columnData": {},
1066
- "paginationState": {}
1381
+ "paginationState": {},
1382
+ "sorting": {},
1383
+ "rowSelectionState": {}
1067
1384
  };
1068
1385
  }
1069
1386
  static get events() {
@@ -1078,15 +1395,24 @@ export class NvDatagrid {
1078
1395
  "text": "Emitted when an action is triggered on a cell."
1079
1396
  },
1080
1397
  "complexType": {
1081
- "original": "ActionEvent",
1082
- "resolved": "ActionEvent",
1083
- "references": {
1084
- "ActionEvent": {
1085
- "location": "import",
1086
- "path": "../../interfaces/actionEvent",
1087
- "id": "src/interfaces/actionEvent.tsx::ActionEvent"
1088
- }
1089
- }
1398
+ "original": "{\n /**\n * Key action to be performed\n */\n keyAction: string;\n\n /**\n * Details of the action to be performed\n */\n details: any;\n }",
1399
+ "resolved": "{ keyAction: string; details: any; }",
1400
+ "references": {}
1401
+ }
1402
+ }, {
1403
+ "method": "selectedRows",
1404
+ "name": "selectedRows",
1405
+ "bubbles": true,
1406
+ "cancelable": true,
1407
+ "composed": true,
1408
+ "docs": {
1409
+ "tags": [],
1410
+ "text": "Emitted when the selection of the rows are changed."
1411
+ },
1412
+ "complexType": {
1413
+ "original": "any[]",
1414
+ "resolved": "any[]",
1415
+ "references": {}
1090
1416
  }
1091
1417
  }];
1092
1418
  }
@@ -1116,6 +1442,15 @@ export class NvDatagrid {
1116
1442
  }, {
1117
1443
  "propName": "paginationState",
1118
1444
  "methodName": "handlePaginationState"
1445
+ }, {
1446
+ "propName": "sorting",
1447
+ "methodName": "handleSorting"
1448
+ }, {
1449
+ "propName": "pageSize",
1450
+ "methodName": "handlePageSize"
1451
+ }, {
1452
+ "propName": "rowSelectionState",
1453
+ "methodName": "handleRowSelectionState"
1119
1454
  }];
1120
1455
  }
1121
1456
  }