@nova-design-system/nova-webcomponents 3.0.0 → 3.2.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 (532) 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 → index-108ddff0.js} +22 -6
  4. package/dist/cjs/index-108ddff0.js.map +1 -0
  5. package/dist/cjs/index.cjs.js +5 -471
  6. package/dist/cjs/index.cjs.js.map +1 -1
  7. package/dist/cjs/loader.cjs.js +2 -2
  8. package/dist/cjs/native.cjs.js +2 -2
  9. package/dist/cjs/nv-alert.cjs.entry.js +6 -6
  10. package/dist/cjs/nv-alert.cjs.entry.js.map +1 -1
  11. package/dist/cjs/nv-avatar.cjs.entry.js +2 -2
  12. package/dist/cjs/nv-badge_2.cjs.entry.js +18 -9
  13. package/dist/cjs/nv-badge_2.cjs.entry.js.map +1 -1
  14. package/dist/cjs/nv-breadcrumb.cjs.entry.js +1 -1
  15. package/dist/cjs/nv-breadcrumbs.cjs.entry.js +1 -1
  16. package/dist/cjs/nv-button.cjs.entry.js +2 -2
  17. package/dist/cjs/nv-calendar.cjs.entry.js +821 -843
  18. package/dist/cjs/nv-calendar.cjs.entry.js.map +1 -1
  19. package/dist/cjs/nv-col.cjs.entry.js +1 -1
  20. package/dist/cjs/nv-datagrid.cjs.entry.js +423 -94
  21. package/dist/cjs/nv-datagrid.cjs.entry.js.map +1 -1
  22. package/dist/cjs/nv-datagridcolumn.cjs.entry.js +2 -2
  23. package/dist/cjs/nv-datagridcolumn.cjs.entry.js.map +1 -1
  24. package/dist/cjs/nv-dialog.cjs.entry.js +19 -13
  25. package/dist/cjs/nv-dialog.cjs.entry.js.map +1 -1
  26. package/dist/cjs/nv-dialogfooter_2.cjs.entry.js +2 -2
  27. package/dist/cjs/nv-fieldcheckbox.cjs.entry.js +1 -1
  28. package/dist/cjs/nv-fielddate.cjs.entry.js +9 -18
  29. package/dist/cjs/nv-fielddate.cjs.entry.js.map +1 -1
  30. package/dist/cjs/nv-fielddaterange.cjs.entry.js +85 -32
  31. package/dist/cjs/nv-fielddaterange.cjs.entry.js.map +1 -1
  32. package/dist/cjs/nv-fielddropdown.cjs.entry.js +88 -57
  33. package/dist/cjs/nv-fielddropdown.cjs.entry.js.map +1 -1
  34. package/dist/cjs/nv-fielddropdownitem.cjs.entry.js +2 -2
  35. package/dist/cjs/nv-fieldmultiselect.cjs.entry.js +122 -104
  36. package/dist/cjs/nv-fieldmultiselect.cjs.entry.js.map +1 -1
  37. package/dist/cjs/nv-fieldnumber.cjs.entry.js +9 -5
  38. package/dist/cjs/nv-fieldnumber.cjs.entry.js.map +1 -1
  39. package/dist/cjs/nv-fieldpassword.cjs.entry.js +9 -5
  40. package/dist/cjs/nv-fieldpassword.cjs.entry.js.map +1 -1
  41. package/dist/cjs/nv-fieldradio.cjs.entry.js +4 -4
  42. package/dist/cjs/nv-fieldselect.cjs.entry.js +11 -7
  43. package/dist/cjs/nv-fieldselect.cjs.entry.js.map +1 -1
  44. package/dist/cjs/nv-fieldslider.cjs.entry.js +663 -0
  45. package/dist/cjs/nv-fieldslider.cjs.entry.js.map +1 -0
  46. package/dist/cjs/nv-fieldtext.cjs.entry.js +9 -5
  47. package/dist/cjs/nv-fieldtext.cjs.entry.js.map +1 -1
  48. package/dist/cjs/nv-fieldtextarea.cjs.entry.js +9 -5
  49. package/dist/cjs/nv-fieldtextarea.cjs.entry.js.map +1 -1
  50. package/dist/cjs/nv-fieldtime.cjs.entry.js +16 -13
  51. package/dist/cjs/nv-fieldtime.cjs.entry.js.map +1 -1
  52. package/dist/cjs/nv-icon.cjs.entry.js +4 -4
  53. package/dist/cjs/nv-icon.cjs.entry.js.map +1 -1
  54. package/dist/cjs/nv-iconbutton_2.cjs.entry.js +3 -3
  55. package/dist/cjs/nv-menu.cjs.entry.js +4 -2
  56. package/dist/cjs/nv-menu.cjs.entry.js.map +1 -1
  57. package/dist/cjs/nv-menuitem.cjs.entry.js +2 -2
  58. package/dist/cjs/nv-popover.cjs.entry.js +2 -2
  59. package/dist/cjs/nv-row.cjs.entry.js +2 -2
  60. package/dist/cjs/nv-stack.cjs.entry.js +2 -2
  61. package/dist/cjs/nv-table.cjs.entry.js +3 -3
  62. package/dist/cjs/nv-table.cjs.entry.js.map +1 -1
  63. package/dist/cjs/nv-tablecolumn.cjs.entry.js +1 -1
  64. package/dist/cjs/nv-toggle.cjs.entry.js +3 -3
  65. package/dist/cjs/nv-tooltip.cjs.entry.js +3 -3
  66. package/dist/cjs/nv-tooltip.cjs.entry.js.map +1 -1
  67. package/dist/collection/collection-manifest.json +1 -0
  68. package/dist/collection/components/nv-alert/nv-alert.css +3 -0
  69. package/dist/collection/components/nv-alert/nv-alert.js +6 -11
  70. package/dist/collection/components/nv-alert/nv-alert.js.map +1 -1
  71. package/dist/collection/components/nv-badge/nv-badge.css +181 -1
  72. package/dist/collection/components/nv-badge/nv-badge.docs.js +20 -1
  73. package/dist/collection/components/nv-badge/nv-badge.docs.js.map +1 -1
  74. package/dist/collection/components/nv-badge/nv-badge.js +39 -15
  75. package/dist/collection/components/nv-badge/nv-badge.js.map +1 -1
  76. package/dist/collection/components/nv-breadcrumbs/nv-breadcrumbs.docs.js +0 -1
  77. package/dist/collection/components/nv-breadcrumbs/nv-breadcrumbs.docs.js.map +1 -1
  78. package/dist/collection/components/nv-calendar/nv-calendar.css +25 -2
  79. package/dist/collection/components/nv-calendar/nv-calendar.docs.js +33 -38
  80. package/dist/collection/components/nv-calendar/nv-calendar.docs.js.map +1 -1
  81. package/dist/collection/components/nv-calendar/nv-calendar.js +659 -897
  82. package/dist/collection/components/nv-calendar/nv-calendar.js.map +1 -1
  83. package/dist/collection/components/nv-calendar/nv-calendar.utils.js +202 -0
  84. package/dist/collection/components/nv-calendar/nv-calendar.utils.js.map +1 -0
  85. package/dist/collection/components/nv-calendar/test/nv-calendar.utils.test.js +667 -0
  86. package/dist/collection/components/nv-calendar/test/nv-calendar.utils.test.js.map +1 -0
  87. package/dist/collection/components/nv-datagrid/nv-datagrid.css +98 -0
  88. package/dist/collection/components/nv-datagrid/nv-datagrid.docs.js +232 -51
  89. package/dist/collection/components/nv-datagrid/nv-datagrid.docs.js.map +1 -1
  90. package/dist/collection/components/nv-datagrid/nv-datagrid.js +437 -160
  91. package/dist/collection/components/nv-datagrid/nv-datagrid.js.map +1 -1
  92. package/dist/collection/components/nv-datagridcolumn/nv-datagridcolumn.js +20 -1
  93. package/dist/collection/components/nv-datagridcolumn/nv-datagridcolumn.js.map +1 -1
  94. package/dist/collection/components/nv-dialog/nv-dialog.css +29 -5
  95. package/dist/collection/components/nv-dialog/nv-dialog.docs.js +0 -1
  96. package/dist/collection/components/nv-dialog/nv-dialog.docs.js.map +1 -1
  97. package/dist/collection/components/nv-dialog/nv-dialog.js +16 -10
  98. package/dist/collection/components/nv-dialog/nv-dialog.js.map +1 -1
  99. package/dist/collection/components/nv-fielddate/nv-fielddate.docs.js +16 -8
  100. package/dist/collection/components/nv-fielddate/nv-fielddate.docs.js.map +1 -1
  101. package/dist/collection/components/nv-fielddate/nv-fielddate.js +48 -39
  102. package/dist/collection/components/nv-fielddate/nv-fielddate.js.map +1 -1
  103. package/dist/collection/components/nv-fielddate/styles/nv-fielddate.css +14 -1
  104. package/dist/collection/components/nv-fielddaterange/nv-fielddaterange.docs.js +12 -15
  105. package/dist/collection/components/nv-fielddaterange/nv-fielddaterange.docs.js.map +1 -1
  106. package/dist/collection/components/nv-fielddaterange/nv-fielddaterange.js +147 -68
  107. package/dist/collection/components/nv-fielddaterange/nv-fielddaterange.js.map +1 -1
  108. package/dist/collection/components/nv-fielddaterange/styles/nv-fielddaterange.css +20 -12
  109. package/dist/collection/components/nv-fielddropdown/nv-fielddropdown.docs.js +16 -0
  110. package/dist/collection/components/nv-fielddropdown/nv-fielddropdown.docs.js.map +1 -1
  111. package/dist/collection/components/nv-fielddropdown/nv-fielddropdown.js +197 -103
  112. package/dist/collection/components/nv-fielddropdown/nv-fielddropdown.js.map +1 -1
  113. package/dist/collection/components/nv-fielddropdown/styles/nv-fielddropdown.css +36 -1
  114. package/dist/collection/components/nv-fielddropdownitem/nv-fielddropdownitem.js +1 -1
  115. package/dist/collection/components/nv-fielddropdownitemcheck/nv-fielddropdownitemcheck.js +1 -1
  116. package/dist/collection/components/nv-fieldmultiselect/nv-fieldmultiselect.docs.js +8 -1
  117. package/dist/collection/components/nv-fieldmultiselect/nv-fieldmultiselect.docs.js.map +1 -1
  118. package/dist/collection/components/nv-fieldmultiselect/nv-fieldmultiselect.js +228 -190
  119. package/dist/collection/components/nv-fieldmultiselect/nv-fieldmultiselect.js.map +1 -1
  120. package/dist/collection/components/nv-fieldmultiselect/{nv-fieldmultiselect.css → styles/nv-fieldmultiselect.css} +36 -1
  121. package/dist/collection/components/nv-fieldnumber/nv-fieldnumber.css +12 -1
  122. package/dist/collection/components/nv-fieldnumber/nv-fieldnumber.docs.js +8 -0
  123. package/dist/collection/components/nv-fieldnumber/nv-fieldnumber.docs.js.map +1 -1
  124. package/dist/collection/components/nv-fieldnumber/nv-fieldnumber.js +27 -3
  125. package/dist/collection/components/nv-fieldnumber/nv-fieldnumber.js.map +1 -1
  126. package/dist/collection/components/nv-fieldpassword/nv-fieldpassword.css +12 -1
  127. package/dist/collection/components/nv-fieldpassword/nv-fieldpassword.docs.js +8 -0
  128. package/dist/collection/components/nv-fieldpassword/nv-fieldpassword.docs.js.map +1 -1
  129. package/dist/collection/components/nv-fieldpassword/nv-fieldpassword.js +27 -3
  130. package/dist/collection/components/nv-fieldpassword/nv-fieldpassword.js.map +1 -1
  131. package/dist/collection/components/nv-fieldradio/nv-fieldradio.js +3 -3
  132. package/dist/collection/components/nv-fieldselect/nv-fieldselect.css +12 -1
  133. package/dist/collection/components/nv-fieldselect/nv-fieldselect.docs.js +8 -0
  134. package/dist/collection/components/nv-fieldselect/nv-fieldselect.docs.js.map +1 -1
  135. package/dist/collection/components/nv-fieldselect/nv-fieldselect.js +29 -5
  136. package/dist/collection/components/nv-fieldselect/nv-fieldselect.js.map +1 -1
  137. package/dist/collection/components/nv-fieldslider/nv-fieldslider.docs.js +264 -0
  138. package/dist/collection/components/nv-fieldslider/nv-fieldslider.docs.js.map +1 -0
  139. package/dist/collection/components/nv-fieldslider/nv-fieldslider.js +1035 -0
  140. package/dist/collection/components/nv-fieldslider/nv-fieldslider.js.map +1 -0
  141. package/dist/collection/components/nv-fieldslider/nv-fieldslider.utils.js +77 -0
  142. package/dist/collection/components/nv-fieldslider/nv-fieldslider.utils.js.map +1 -0
  143. package/dist/collection/components/nv-fieldslider/partials/field-input.js +33 -0
  144. package/dist/collection/components/nv-fieldslider/partials/field-input.js.map +1 -0
  145. package/dist/collection/components/nv-fieldslider/partials/range-thumb.js +34 -0
  146. package/dist/collection/components/nv-fieldslider/partials/range-thumb.js.map +1 -0
  147. package/dist/collection/components/nv-fieldslider/partials/single-thumb.js +18 -0
  148. package/dist/collection/components/nv-fieldslider/partials/single-thumb.js.map +1 -0
  149. package/dist/collection/components/nv-fieldslider/partials/tick-marks.js +18 -0
  150. package/dist/collection/components/nv-fieldslider/partials/tick-marks.js.map +1 -0
  151. package/dist/collection/components/nv-fieldslider/styles/nv-fieldslider.css +267 -0
  152. package/dist/collection/components/nv-fieldslider/test/nv-fieldslider.utils.test.js +159 -0
  153. package/dist/collection/components/nv-fieldslider/test/nv-fieldslider.utils.test.js.map +1 -0
  154. package/dist/collection/components/nv-fieldtext/nv-fieldtext.css +20 -1
  155. package/dist/collection/components/nv-fieldtext/nv-fieldtext.docs.js +17 -1
  156. package/dist/collection/components/nv-fieldtext/nv-fieldtext.docs.js.map +1 -1
  157. package/dist/collection/components/nv-fieldtext/nv-fieldtext.js +28 -3
  158. package/dist/collection/components/nv-fieldtext/nv-fieldtext.js.map +1 -1
  159. package/dist/collection/components/nv-fieldtextarea/nv-fieldtextarea.css +30 -1
  160. package/dist/collection/components/nv-fieldtextarea/nv-fieldtextarea.docs.js +8 -0
  161. package/dist/collection/components/nv-fieldtextarea/nv-fieldtextarea.docs.js.map +1 -1
  162. package/dist/collection/components/nv-fieldtextarea/nv-fieldtextarea.js +27 -3
  163. package/dist/collection/components/nv-fieldtextarea/nv-fieldtextarea.js.map +1 -1
  164. package/dist/collection/components/nv-fieldtime/nv-fieldtime.js +13 -10
  165. package/dist/collection/components/nv-fieldtime/nv-fieldtime.js.map +1 -1
  166. package/dist/collection/components/nv-fieldtime/styles/nv-fieldtime.css +26 -3
  167. package/dist/collection/components/nv-icon/nv-icon.js +1 -1
  168. package/dist/collection/components/nv-icon/nv-icons.js +4 -470
  169. package/dist/collection/components/nv-icon/nv-icons.js.map +1 -1
  170. package/dist/collection/components/nv-iconbutton/nv-iconbutton.js +1 -1
  171. package/dist/collection/components/nv-loader/nv-loader.js +1 -1
  172. package/dist/collection/components/nv-menu/nv-menu.js +3 -1
  173. package/dist/collection/components/nv-menu/nv-menu.js.map +1 -1
  174. package/dist/collection/components/nv-menuitem/nv-menuitem.js +2 -2
  175. package/dist/collection/components/nv-popover/nv-popover.js +1 -1
  176. package/dist/collection/components/nv-row/nv-row.js +1 -1
  177. package/dist/collection/components/nv-stack/nv-stack.js +1 -1
  178. package/dist/collection/components/nv-table/nv-table.js +8 -11
  179. package/dist/collection/components/nv-table/nv-table.js.map +1 -1
  180. package/dist/collection/components/nv-toggle/nv-toggle.js +2 -2
  181. package/dist/collection/components/nv-tooltip/nv-tooltip.css +1 -0
  182. package/dist/collection/components/nv-tooltip/nv-tooltip.js +1 -1
  183. package/dist/collection/index.js.map +1 -1
  184. package/dist/collection/interfaces/Column.js.map +1 -1
  185. package/dist/collection/templates/navigation.docs.js +0 -1
  186. package/dist/collection/templates/navigation.docs.js.map +1 -1
  187. package/dist/collection/utils/constants.js +11 -0
  188. package/dist/collection/utils/constants.js.map +1 -1
  189. package/dist/components/index.js +6 -472
  190. package/dist/components/index.js.map +1 -1
  191. package/dist/components/nv-alert.js +7 -7
  192. package/dist/components/nv-alert.js.map +1 -1
  193. package/dist/components/nv-avatar.js +3 -3
  194. package/dist/components/nv-badge.js +1 -1
  195. package/dist/components/nv-breadcrumb.js +3 -3
  196. package/dist/components/nv-breadcrumbs.js +1 -1
  197. package/dist/components/nv-button.js +1 -1
  198. package/dist/components/nv-calendar.js +1 -1
  199. package/dist/components/nv-col.js +1 -1
  200. package/dist/components/nv-datagrid.js +447 -102
  201. package/dist/components/nv-datagrid.js.map +1 -1
  202. package/dist/components/nv-datagridcolumn.js +4 -3
  203. package/dist/components/nv-datagridcolumn.js.map +1 -1
  204. package/dist/components/nv-dialog.js +24 -18
  205. package/dist/components/nv-dialog.js.map +1 -1
  206. package/dist/components/nv-dialogfooter.js +1 -1
  207. package/dist/components/nv-dialogheader.js +1 -1
  208. package/dist/components/nv-fieldcheckbox.js +1 -1
  209. package/dist/components/nv-fielddate.js +19 -27
  210. package/dist/components/nv-fielddate.js.map +1 -1
  211. package/dist/components/nv-fielddaterange.js +99 -44
  212. package/dist/components/nv-fielddaterange.js.map +1 -1
  213. package/dist/components/nv-fielddropdown.js +103 -69
  214. package/dist/components/nv-fielddropdown.js.map +1 -1
  215. package/dist/components/nv-fielddropdownitem.js +1 -1
  216. package/dist/components/nv-fielddropdownitemcheck.js +1 -1
  217. package/dist/components/nv-fieldmultiselect.js +139 -120
  218. package/dist/components/nv-fieldmultiselect.js.map +1 -1
  219. package/dist/components/nv-fieldnumber.js +14 -9
  220. package/dist/components/nv-fieldnumber.js.map +1 -1
  221. package/dist/components/nv-fieldpassword.js +13 -8
  222. package/dist/components/nv-fieldpassword.js.map +1 -1
  223. package/dist/components/nv-fieldradio.js +4 -4
  224. package/dist/components/nv-fieldselect.js +15 -10
  225. package/dist/components/nv-fieldselect.js.map +1 -1
  226. package/dist/components/nv-fieldslider.d.ts +11 -0
  227. package/dist/components/nv-fieldslider.js +726 -0
  228. package/dist/components/nv-fieldslider.js.map +1 -0
  229. package/dist/components/nv-fieldtext.js +1 -158
  230. package/dist/components/nv-fieldtext.js.map +1 -1
  231. package/dist/components/nv-fieldtextarea.js +11 -6
  232. package/dist/components/nv-fieldtextarea.js.map +1 -1
  233. package/dist/components/nv-fieldtime.js +20 -17
  234. package/dist/components/nv-fieldtime.js.map +1 -1
  235. package/dist/components/nv-icon.js +1 -1
  236. package/dist/components/nv-iconbutton.js +1 -1
  237. package/dist/components/nv-loader.js +1 -1
  238. package/dist/components/nv-menu.js +7 -5
  239. package/dist/components/nv-menu.js.map +1 -1
  240. package/dist/components/nv-menuitem.js +1 -1
  241. package/dist/components/nv-popover.js +1 -1
  242. package/dist/components/nv-row.js +2 -2
  243. package/dist/components/nv-stack.js +2 -2
  244. package/dist/components/nv-table.js +3 -3
  245. package/dist/components/nv-table.js.map +1 -1
  246. package/dist/components/nv-tablecolumn.js +1 -1
  247. package/dist/components/nv-toggle.js +3 -3
  248. package/dist/components/nv-tooltip.js +1 -1
  249. package/dist/components/{p-dc3faba3.js → p-04cb3a6f.js} +5 -5
  250. package/dist/components/{p-dc3faba3.js.map → p-04cb3a6f.js.map} +1 -1
  251. package/dist/components/p-07a89754.js +187 -0
  252. package/dist/components/p-07a89754.js.map +1 -0
  253. package/dist/components/{p-b7b78e64.js → p-0ab80d95.js} +3 -3
  254. package/dist/components/{p-b7b78e64.js.map → p-0ab80d95.js.map} +1 -1
  255. package/dist/components/{p-8348db09.js → p-1f505531.js} +15 -2
  256. package/dist/components/p-1f505531.js.map +1 -0
  257. package/dist/components/{p-02752770.js → p-33e231f4.js} +2 -2
  258. package/dist/components/{p-02752770.js.map → p-33e231f4.js.map} +1 -1
  259. package/dist/components/p-4656efae.js +1111 -0
  260. package/dist/components/p-4656efae.js.map +1 -0
  261. package/dist/components/{p-2012b8ba.js → p-581e67cc.js} +4 -4
  262. package/dist/components/{p-2012b8ba.js.map → p-581e67cc.js.map} +1 -1
  263. package/dist/components/{p-1c45c0f2.js → p-679e0fa9.js} +16 -4
  264. package/dist/components/p-679e0fa9.js.map +1 -0
  265. package/dist/components/p-76a30bf1.js +88 -0
  266. package/dist/components/p-76a30bf1.js.map +1 -0
  267. package/dist/components/{p-150daf68.js → p-83c8873a.js} +3 -3
  268. package/dist/components/{p-150daf68.js.map → p-83c8873a.js.map} +1 -1
  269. package/dist/components/{p-c14f6b8e.js → p-c0a91091.js} +5 -5
  270. package/dist/components/p-c0a91091.js.map +1 -0
  271. package/dist/components/{p-6c364a23.js → p-cbdc2c8b.js} +6 -6
  272. package/dist/components/{p-6c364a23.js.map → p-cbdc2c8b.js.map} +1 -1
  273. package/dist/components/{p-2d9ba7d3.js → p-cbe9521f.js} +4 -4
  274. package/dist/components/{p-2d9ba7d3.js.map → p-cbe9521f.js.map} +1 -1
  275. package/dist/components/{p-a30b55fc.js → p-d19b41d2.js} +2 -2
  276. package/dist/components/{p-a30b55fc.js.map → p-d19b41d2.js.map} +1 -1
  277. package/dist/components/{p-4d3ec142.js → p-d63f1cbe.js} +4 -4
  278. package/dist/components/{p-4d3ec142.js.map → p-d63f1cbe.js.map} +1 -1
  279. package/dist/components/{p-e00cbb8a.js → p-dd2273a3.js} +2 -2
  280. package/dist/components/{p-e00cbb8a.js.map → p-dd2273a3.js.map} +1 -1
  281. package/dist/components/p-f0a5e7e4.js +167 -0
  282. package/dist/components/p-f0a5e7e4.js.map +1 -0
  283. package/dist/components/{p-f4d86795.js → p-f1859ddc.js} +4 -4
  284. package/dist/components/{p-f4d86795.js.map → p-f1859ddc.js.map} +1 -1
  285. package/dist/esm/{constants-98e2dcc2.js → constants-b97e736d.js} +15 -2
  286. package/dist/esm/constants-b97e736d.js.map +1 -0
  287. package/dist/esm/{index-1fb7a9a6.js → index-8f0e5f19.js} +22 -6
  288. package/dist/esm/index-8f0e5f19.js.map +1 -0
  289. package/dist/esm/index.js +5 -471
  290. package/dist/esm/index.js.map +1 -1
  291. package/dist/esm/loader.js +3 -3
  292. package/dist/esm/native.js +3 -3
  293. package/dist/esm/nv-alert.entry.js +6 -6
  294. package/dist/esm/nv-alert.entry.js.map +1 -1
  295. package/dist/esm/nv-avatar.entry.js +2 -2
  296. package/dist/esm/nv-badge_2.entry.js +18 -9
  297. package/dist/esm/nv-badge_2.entry.js.map +1 -1
  298. package/dist/esm/nv-breadcrumb.entry.js +1 -1
  299. package/dist/esm/nv-breadcrumbs.entry.js +1 -1
  300. package/dist/esm/nv-button.entry.js +2 -2
  301. package/dist/esm/nv-calendar.entry.js +821 -843
  302. package/dist/esm/nv-calendar.entry.js.map +1 -1
  303. package/dist/esm/nv-col.entry.js +1 -1
  304. package/dist/esm/nv-datagrid.entry.js +423 -94
  305. package/dist/esm/nv-datagrid.entry.js.map +1 -1
  306. package/dist/esm/nv-datagridcolumn.entry.js +2 -2
  307. package/dist/esm/nv-datagridcolumn.entry.js.map +1 -1
  308. package/dist/esm/nv-dialog.entry.js +19 -13
  309. package/dist/esm/nv-dialog.entry.js.map +1 -1
  310. package/dist/esm/nv-dialogfooter_2.entry.js +2 -2
  311. package/dist/esm/nv-fieldcheckbox.entry.js +1 -1
  312. package/dist/esm/nv-fielddate.entry.js +9 -18
  313. package/dist/esm/nv-fielddate.entry.js.map +1 -1
  314. package/dist/esm/nv-fielddaterange.entry.js +85 -32
  315. package/dist/esm/nv-fielddaterange.entry.js.map +1 -1
  316. package/dist/esm/nv-fielddropdown.entry.js +88 -57
  317. package/dist/esm/nv-fielddropdown.entry.js.map +1 -1
  318. package/dist/esm/nv-fielddropdownitem.entry.js +2 -2
  319. package/dist/esm/nv-fieldmultiselect.entry.js +122 -104
  320. package/dist/esm/nv-fieldmultiselect.entry.js.map +1 -1
  321. package/dist/esm/nv-fieldnumber.entry.js +9 -5
  322. package/dist/esm/nv-fieldnumber.entry.js.map +1 -1
  323. package/dist/esm/nv-fieldpassword.entry.js +9 -5
  324. package/dist/esm/nv-fieldpassword.entry.js.map +1 -1
  325. package/dist/esm/nv-fieldradio.entry.js +4 -4
  326. package/dist/esm/nv-fieldselect.entry.js +11 -7
  327. package/dist/esm/nv-fieldselect.entry.js.map +1 -1
  328. package/dist/esm/nv-fieldslider.entry.js +659 -0
  329. package/dist/esm/nv-fieldslider.entry.js.map +1 -0
  330. package/dist/esm/nv-fieldtext.entry.js +9 -5
  331. package/dist/esm/nv-fieldtext.entry.js.map +1 -1
  332. package/dist/esm/nv-fieldtextarea.entry.js +9 -5
  333. package/dist/esm/nv-fieldtextarea.entry.js.map +1 -1
  334. package/dist/esm/nv-fieldtime.entry.js +16 -13
  335. package/dist/esm/nv-fieldtime.entry.js.map +1 -1
  336. package/dist/esm/nv-icon.entry.js +4 -4
  337. package/dist/esm/nv-icon.entry.js.map +1 -1
  338. package/dist/esm/nv-iconbutton_2.entry.js +3 -3
  339. package/dist/esm/nv-menu.entry.js +4 -2
  340. package/dist/esm/nv-menu.entry.js.map +1 -1
  341. package/dist/esm/nv-menuitem.entry.js +2 -2
  342. package/dist/esm/nv-popover.entry.js +2 -2
  343. package/dist/esm/nv-row.entry.js +2 -2
  344. package/dist/esm/nv-stack.entry.js +2 -2
  345. package/dist/esm/nv-table.entry.js +3 -3
  346. package/dist/esm/nv-table.entry.js.map +1 -1
  347. package/dist/esm/nv-tablecolumn.entry.js +1 -1
  348. package/dist/esm/nv-toggle.entry.js +3 -3
  349. package/dist/esm/nv-tooltip.entry.js +3 -3
  350. package/dist/esm/nv-tooltip.entry.js.map +1 -1
  351. package/dist/native/index.esm.js +1 -1
  352. package/dist/native/index.esm.js.map +1 -1
  353. package/dist/native/native.css +1 -1
  354. package/dist/native/native.esm.js +1 -1
  355. package/dist/native/native.esm.js.map +1 -1
  356. package/dist/native/{p-6b348684.entry.js → p-0323daf6.entry.js} +2 -2
  357. package/dist/native/{p-d5cbf5c8.entry.js → p-05d95d4d.entry.js} +2 -2
  358. package/dist/native/{p-fb5bddba.entry.js → p-0ec1e2e3.entry.js} +2 -2
  359. package/dist/native/{p-c7b201cd.entry.js → p-16a4cdf3.entry.js} +2 -2
  360. package/dist/native/p-19fb0fd0.entry.js +2 -0
  361. package/dist/native/p-19fb0fd0.entry.js.map +1 -0
  362. package/dist/native/p-1e3d3374.entry.js +2 -0
  363. package/dist/native/{p-9135fdf5.entry.js.map → p-1e3d3374.entry.js.map} +1 -1
  364. package/dist/native/p-21e7132f.entry.js +2 -0
  365. package/dist/native/p-21e7132f.entry.js.map +1 -0
  366. package/dist/native/p-221b8f72.entry.js +2 -0
  367. package/dist/native/p-221b8f72.entry.js.map +1 -0
  368. package/dist/native/p-2805f9f2.entry.js +2 -0
  369. package/dist/native/p-2805f9f2.entry.js.map +1 -0
  370. package/dist/native/p-3f2b6a22.entry.js +2 -0
  371. package/dist/native/p-3f2b6a22.entry.js.map +1 -0
  372. package/dist/native/{p-0245863d.entry.js → p-407fc32d.entry.js} +2 -2
  373. package/dist/native/{p-63e6aed3.entry.js → p-4c0d81b0.entry.js} +2 -2
  374. package/dist/native/p-4c0d81b0.entry.js.map +1 -0
  375. package/dist/native/{p-39bb95ff.entry.js → p-519b4819.entry.js} +2 -2
  376. package/dist/native/{p-fa77a591.entry.js → p-5382eab2.entry.js} +2 -2
  377. package/dist/native/p-5ba3fc3c.entry.js +2 -0
  378. package/dist/native/p-5ba3fc3c.entry.js.map +1 -0
  379. package/dist/native/{p-bad11367.entry.js → p-60b204ac.entry.js} +2 -2
  380. package/dist/native/p-60b204ac.entry.js.map +1 -0
  381. package/dist/native/p-7092a675.entry.js +2 -0
  382. package/dist/native/p-711a7778.js +3 -0
  383. package/dist/native/p-711a7778.js.map +1 -0
  384. package/dist/native/p-759c9ce4.entry.js +2 -0
  385. package/dist/native/p-759c9ce4.entry.js.map +1 -0
  386. package/dist/native/{p-d7a76400.entry.js → p-7c676f2c.entry.js} +2 -2
  387. package/dist/native/p-7c6edd1c.entry.js +2 -0
  388. package/dist/native/p-7c6edd1c.entry.js.map +1 -0
  389. package/dist/native/p-987c79d8.entry.js +2 -0
  390. package/dist/native/p-987c79d8.entry.js.map +1 -0
  391. package/dist/native/{p-f85aca27.entry.js → p-9fba8663.entry.js} +2 -2
  392. package/dist/native/{p-b094296d.entry.js → p-a2c0f1a7.entry.js} +2 -2
  393. package/dist/native/p-aa86af25.entry.js +2 -0
  394. package/dist/native/p-aa86af25.entry.js.map +1 -0
  395. package/dist/native/p-adc96c3a.entry.js +2 -0
  396. package/dist/native/p-adc96c3a.entry.js.map +1 -0
  397. package/dist/native/p-b0fc08e7.entry.js +2 -0
  398. package/dist/native/p-b0fc08e7.entry.js.map +1 -0
  399. package/dist/native/{p-6ff228da.entry.js → p-c930adb7.entry.js} +2 -2
  400. package/dist/native/{p-701b5557.entry.js → p-cfe0a6c6.entry.js} +2 -2
  401. package/dist/native/p-d07ab618.entry.js +2 -0
  402. package/dist/native/p-dac0089b.entry.js +2 -0
  403. package/dist/native/p-dac0089b.entry.js.map +1 -0
  404. package/dist/native/p-de2c07a6.entry.js +13 -0
  405. package/dist/native/p-de2c07a6.entry.js.map +1 -0
  406. package/dist/native/p-ed488498.entry.js +7 -0
  407. package/dist/native/p-ed488498.entry.js.map +1 -0
  408. package/dist/native/p-ef76178b.entry.js +2 -0
  409. package/dist/native/p-ef76178b.entry.js.map +1 -0
  410. package/dist/native/{p-e5de64d5.entry.js → p-f0ddf60b.entry.js} +2 -2
  411. package/dist/native/p-f39803d9.entry.js +2 -0
  412. package/dist/native/p-f39803d9.entry.js.map +1 -0
  413. package/dist/native/{p-59768ee5.js → p-f85c08f1.js} +2 -2
  414. package/dist/native/p-f85c08f1.js.map +1 -0
  415. package/dist/native/p-fb897f7d.entry.js +2 -0
  416. package/dist/native/p-fb897f7d.entry.js.map +1 -0
  417. package/dist/native/{p-244f56ac.entry.js → p-fc3bea07.entry.js} +2 -2
  418. package/dist/types/components/nv-alert/nv-alert.d.ts +1 -1
  419. package/dist/types/components/nv-badge/nv-badge.d.ts +11 -3
  420. package/dist/types/components/nv-calendar/nv-calendar.d.ts +70 -112
  421. package/dist/types/components/nv-calendar/nv-calendar.utils.d.ts +60 -0
  422. package/dist/types/components/nv-calendar/test/nv-calendar.utils.test.d.ts +1 -0
  423. package/dist/types/components/nv-datagrid/nv-datagrid.d.ts +47 -26
  424. package/dist/types/components/nv-datagridcolumn/nv-datagridcolumn.d.ts +4 -0
  425. package/dist/types/components/nv-dialog/nv-dialog.d.ts +4 -0
  426. package/dist/types/components/nv-fielddate/nv-fielddate.d.ts +6 -7
  427. package/dist/types/components/nv-fielddaterange/nv-fielddaterange.d.ts +23 -12
  428. package/dist/types/components/nv-fielddropdown/nv-fielddropdown.d.ts +51 -26
  429. package/dist/types/components/nv-fieldmultiselect/nv-fieldmultiselect.d.ts +65 -55
  430. package/dist/types/components/nv-fieldnumber/nv-fieldnumber.d.ts +4 -0
  431. package/dist/types/components/nv-fieldpassword/nv-fieldpassword.d.ts +4 -0
  432. package/dist/types/components/nv-fieldselect/nv-fieldselect.d.ts +4 -0
  433. package/dist/types/components/nv-fieldslider/nv-fieldslider.d.ts +230 -0
  434. package/dist/types/components/nv-fieldslider/nv-fieldslider.docs.d.ts +4 -0
  435. package/dist/types/components/nv-fieldslider/nv-fieldslider.utils.d.ts +46 -0
  436. package/dist/types/components/nv-fieldslider/partials/field-input.d.ts +45 -0
  437. package/dist/types/components/nv-fieldslider/partials/range-thumb.d.ts +37 -0
  438. package/dist/types/components/nv-fieldslider/partials/single-thumb.d.ts +35 -0
  439. package/dist/types/components/nv-fieldslider/partials/tick-marks.d.ts +28 -0
  440. package/dist/types/components/nv-fieldslider/test/nv-fieldslider.utils.test.d.ts +1 -0
  441. package/dist/types/components/nv-fieldtext/nv-fieldtext.d.ts +5 -0
  442. package/dist/types/components/nv-fieldtextarea/nv-fieldtextarea.d.ts +4 -0
  443. package/dist/types/components/nv-icon/nv-icons.d.ts +1 -1
  444. package/dist/types/components/nv-table/nv-table.d.ts +13 -2
  445. package/dist/types/components.d.ts +656 -154
  446. package/dist/types/index.d.ts +0 -2
  447. package/dist/types/interfaces/Column.d.ts +5 -1
  448. package/dist/types/utils/constants.d.ts +9 -0
  449. package/dist/vscode-data.json +292 -1546
  450. package/hydrate/index.js +2715 -1533
  451. package/hydrate/index.mjs +2715 -1533
  452. package/package.json +6 -2
  453. package/dist/cjs/constants-bcd6b2e2.js.map +0 -1
  454. package/dist/cjs/index-9bda5507.js.map +0 -1
  455. package/dist/collection/interfaces/actionEvent.js +0 -2
  456. package/dist/collection/interfaces/actionEvent.js.map +0 -1
  457. package/dist/collection/interfaces/calendarShortcut.js +0 -2
  458. package/dist/collection/interfaces/calendarShortcut.js.map +0 -1
  459. package/dist/collection/interfaces/dateRange.js +0 -2
  460. package/dist/collection/interfaces/dateRange.js.map +0 -1
  461. package/dist/components/p-1c45c0f2.js.map +0 -1
  462. package/dist/components/p-373926aa.js +0 -177
  463. package/dist/components/p-373926aa.js.map +0 -1
  464. package/dist/components/p-591730e7.js +0 -88
  465. package/dist/components/p-591730e7.js.map +0 -1
  466. package/dist/components/p-8348db09.js.map +0 -1
  467. package/dist/components/p-c14f6b8e.js.map +0 -1
  468. package/dist/components/p-f331117c.js +0 -1133
  469. package/dist/components/p-f331117c.js.map +0 -1
  470. package/dist/esm/constants-98e2dcc2.js.map +0 -1
  471. package/dist/esm/index-1fb7a9a6.js.map +0 -1
  472. package/dist/native/p-0ee428d5.entry.js +0 -2
  473. package/dist/native/p-0ee428d5.entry.js.map +0 -1
  474. package/dist/native/p-2691e02d.entry.js +0 -2
  475. package/dist/native/p-37f0210e.entry.js +0 -2
  476. package/dist/native/p-37f0210e.entry.js.map +0 -1
  477. package/dist/native/p-4a440970.entry.js +0 -2
  478. package/dist/native/p-4a440970.entry.js.map +0 -1
  479. package/dist/native/p-4ae26462.entry.js +0 -7
  480. package/dist/native/p-4ae26462.entry.js.map +0 -1
  481. package/dist/native/p-4d9c4618.entry.js +0 -2
  482. package/dist/native/p-4d9c4618.entry.js.map +0 -1
  483. package/dist/native/p-4dc1d036.entry.js +0 -2
  484. package/dist/native/p-59768ee5.js.map +0 -1
  485. package/dist/native/p-59e0bd2b.entry.js +0 -2
  486. package/dist/native/p-59e0bd2b.entry.js.map +0 -1
  487. package/dist/native/p-5c00f092.entry.js +0 -2
  488. package/dist/native/p-5c00f092.entry.js.map +0 -1
  489. package/dist/native/p-63e6aed3.entry.js.map +0 -1
  490. package/dist/native/p-7f5eb2ac.entry.js +0 -2
  491. package/dist/native/p-7f5eb2ac.entry.js.map +0 -1
  492. package/dist/native/p-84a73e2a.entry.js +0 -2
  493. package/dist/native/p-84a73e2a.entry.js.map +0 -1
  494. package/dist/native/p-9135fdf5.entry.js +0 -2
  495. package/dist/native/p-93dc2f47.entry.js +0 -2
  496. package/dist/native/p-93dc2f47.entry.js.map +0 -1
  497. package/dist/native/p-9a267f16.entry.js +0 -13
  498. package/dist/native/p-9a267f16.entry.js.map +0 -1
  499. package/dist/native/p-9d6431c7.entry.js +0 -2
  500. package/dist/native/p-9d6431c7.entry.js.map +0 -1
  501. package/dist/native/p-ab002252.js +0 -3
  502. package/dist/native/p-ab002252.js.map +0 -1
  503. package/dist/native/p-b2ce83ad.entry.js +0 -2
  504. package/dist/native/p-b2ce83ad.entry.js.map +0 -1
  505. package/dist/native/p-bad11367.entry.js.map +0 -1
  506. package/dist/native/p-e1a4f776.entry.js +0 -2
  507. package/dist/native/p-e1a4f776.entry.js.map +0 -1
  508. package/dist/native/p-e49bbd02.entry.js +0 -2
  509. package/dist/native/p-e49bbd02.entry.js.map +0 -1
  510. package/dist/native/p-eee01062.entry.js +0 -2
  511. package/dist/native/p-eee01062.entry.js.map +0 -1
  512. package/dist/native/p-f6bdc270.entry.js +0 -2
  513. package/dist/native/p-f6bdc270.entry.js.map +0 -1
  514. package/dist/types/interfaces/actionEvent.d.ts +0 -13
  515. package/dist/types/interfaces/calendarShortcut.d.ts +0 -17
  516. package/dist/types/interfaces/dateRange.d.ts +0 -13
  517. /package/dist/native/{p-6b348684.entry.js.map → p-0323daf6.entry.js.map} +0 -0
  518. /package/dist/native/{p-d5cbf5c8.entry.js.map → p-05d95d4d.entry.js.map} +0 -0
  519. /package/dist/native/{p-fb5bddba.entry.js.map → p-0ec1e2e3.entry.js.map} +0 -0
  520. /package/dist/native/{p-c7b201cd.entry.js.map → p-16a4cdf3.entry.js.map} +0 -0
  521. /package/dist/native/{p-0245863d.entry.js.map → p-407fc32d.entry.js.map} +0 -0
  522. /package/dist/native/{p-39bb95ff.entry.js.map → p-519b4819.entry.js.map} +0 -0
  523. /package/dist/native/{p-fa77a591.entry.js.map → p-5382eab2.entry.js.map} +0 -0
  524. /package/dist/native/{p-2691e02d.entry.js.map → p-7092a675.entry.js.map} +0 -0
  525. /package/dist/native/{p-d7a76400.entry.js.map → p-7c676f2c.entry.js.map} +0 -0
  526. /package/dist/native/{p-f85aca27.entry.js.map → p-9fba8663.entry.js.map} +0 -0
  527. /package/dist/native/{p-b094296d.entry.js.map → p-a2c0f1a7.entry.js.map} +0 -0
  528. /package/dist/native/{p-6ff228da.entry.js.map → p-c930adb7.entry.js.map} +0 -0
  529. /package/dist/native/{p-701b5557.entry.js.map → p-cfe0a6c6.entry.js.map} +0 -0
  530. /package/dist/native/{p-4dc1d036.entry.js.map → p-d07ab618.entry.js.map} +0 -0
  531. /package/dist/native/{p-e5de64d5.entry.js.map → p-f0ddf60b.entry.js.map} +0 -0
  532. /package/dist/native/{p-244f56ac.entry.js.map → p-fc3bea07.entry.js.map} +0 -0
@@ -2,8 +2,9 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- const index = require('./index-9bda5507.js');
5
+ const index = require('./index-108ddff0.js');
6
6
  const dom_utils = require('./dom.utils-4d43f69a.js');
7
+ const constants = require('./constants-8fb8ccc0.js');
7
8
 
8
9
  /**
9
10
  * table-core
@@ -3203,6 +3204,92 @@ function getPaginationRowModel(opts) {
3203
3204
  }, getMemoOptions(table.options, 'debugTable'));
3204
3205
  }
3205
3206
 
3207
+ function getSortedRowModel() {
3208
+ return table => memo(() => [table.getState().sorting, table.getPreSortedRowModel()], (sorting, rowModel) => {
3209
+ if (!rowModel.rows.length || !(sorting != null && sorting.length)) {
3210
+ return rowModel;
3211
+ }
3212
+ const sortingState = table.getState().sorting;
3213
+ const sortedFlatRows = [];
3214
+
3215
+ // Filter out sortings that correspond to non existing columns
3216
+ const availableSorting = sortingState.filter(sort => {
3217
+ var _table$getColumn;
3218
+ return (_table$getColumn = table.getColumn(sort.id)) == null ? void 0 : _table$getColumn.getCanSort();
3219
+ });
3220
+ const columnInfoById = {};
3221
+ availableSorting.forEach(sortEntry => {
3222
+ const column = table.getColumn(sortEntry.id);
3223
+ if (!column) return;
3224
+ columnInfoById[sortEntry.id] = {
3225
+ sortUndefined: column.columnDef.sortUndefined,
3226
+ invertSorting: column.columnDef.invertSorting,
3227
+ sortingFn: column.getSortingFn()
3228
+ };
3229
+ });
3230
+ const sortData = rows => {
3231
+ // This will also perform a stable sorting using the row index
3232
+ // if needed.
3233
+ const sortedData = rows.map(row => ({
3234
+ ...row
3235
+ }));
3236
+ sortedData.sort((rowA, rowB) => {
3237
+ for (let i = 0; i < availableSorting.length; i += 1) {
3238
+ var _sortEntry$desc;
3239
+ const sortEntry = availableSorting[i];
3240
+ const columnInfo = columnInfoById[sortEntry.id];
3241
+ const sortUndefined = columnInfo.sortUndefined;
3242
+ const isDesc = (_sortEntry$desc = sortEntry == null ? void 0 : sortEntry.desc) != null ? _sortEntry$desc : false;
3243
+ let sortInt = 0;
3244
+
3245
+ // All sorting ints should always return in ascending order
3246
+ if (sortUndefined) {
3247
+ const aValue = rowA.getValue(sortEntry.id);
3248
+ const bValue = rowB.getValue(sortEntry.id);
3249
+ const aUndefined = aValue === undefined;
3250
+ const bUndefined = bValue === undefined;
3251
+ if (aUndefined || bUndefined) {
3252
+ if (sortUndefined === 'first') return aUndefined ? -1 : 1;
3253
+ if (sortUndefined === 'last') return aUndefined ? 1 : -1;
3254
+ sortInt = aUndefined && bUndefined ? 0 : aUndefined ? sortUndefined : -sortUndefined;
3255
+ }
3256
+ }
3257
+ if (sortInt === 0) {
3258
+ sortInt = columnInfo.sortingFn(rowA, rowB, sortEntry.id);
3259
+ }
3260
+
3261
+ // If sorting is non-zero, take care of desc and inversion
3262
+ if (sortInt !== 0) {
3263
+ if (isDesc) {
3264
+ sortInt *= -1;
3265
+ }
3266
+ if (columnInfo.invertSorting) {
3267
+ sortInt *= -1;
3268
+ }
3269
+ return sortInt;
3270
+ }
3271
+ }
3272
+ return rowA.index - rowB.index;
3273
+ });
3274
+
3275
+ // If there are sub-rows, sort them
3276
+ sortedData.forEach(row => {
3277
+ var _row$subRows;
3278
+ sortedFlatRows.push(row);
3279
+ if ((_row$subRows = row.subRows) != null && _row$subRows.length) {
3280
+ row.subRows = sortData(row.subRows);
3281
+ }
3282
+ });
3283
+ return sortedData;
3284
+ };
3285
+ return {
3286
+ rows: sortData(rowModel.rows),
3287
+ flatRows: sortedFlatRows,
3288
+ rowsById: rowModel.rowsById
3289
+ };
3290
+ }, getMemoOptions(table.options, 'debugTable', 'getSortedRowModel', () => table._autoResetPageIndex()));
3291
+ }
3292
+
3206
3293
  /* eslint-disable @typescript-eslint/no-explicit-any */
3207
3294
  /**
3208
3295
  * Debounce function to prevent multiple calls in a short
@@ -3223,13 +3310,14 @@ function debounce(func, wait) {
3223
3310
  };
3224
3311
  }
3225
3312
 
3226
- const nvDatagridCss = "nv-datagrid{display:block}nv-datagrid .hidden{display:none}nv-datagrid table{border-collapse:collapse;border-color:inherit;text-indent:0;width:100%}nv-datagrid th{text-align:left;border-bottom:1px solid var(--components-datagrid-header-border);height:var(--spacing-12);padding:var(--spacing-3) var(--spacing-4);font-size:var(--font-size-md);font-weight:700;color:var(--components-datagrid-header-text)}nv-datagrid td{border-bottom:1px solid var(--components-datagrid-body-border);height:var(--spacing-12);max-height:var(--spacing-14);padding:var(--spacing-2) var(--spacing-4);font-size:var(--font-size-md);font-weight:400;color:var(--components-datagrid-body-text);white-space:nowrap;text-overflow:ellipsis}nv-datagrid tbody>tr:hover{background:var(--color-interaction-container-neutral-background-hover)}";
3313
+ const nvDatagridCss = "nv-datagrid{--nv-datagrid-border-default:var(\n --components-form-field-border-default\n );--nv-datagrid-border-hover:var(--components-form-field-border-hover);--nv-datagrid-border-focus:var(--components-form-field-border-default);--nv-datagrid-background-default:var(\n --components-form-field-background-default\n );--nv-datagrid-background-checked:var(\n --components-form-field-background-checked\n );--nv-datagrid-background-disabled:var(\n --components-form-field-background-disabled\n );--nv-datagrid-color-checked:var(\n --components-form-shape-foreground-default\n );--nv-datagrid-color-disabled:var(\n --components-form-shape-foreground-disabled\n );--nv-datagrid-outline-color:var(--color-focus-brand);display:block}nv-datagrid .hidden{display:none}nv-datagrid table{border-collapse:collapse;border-color:inherit;text-indent:0;width:100%}nv-datagrid th{text-align:left;border-bottom:1px solid var(--components-datagrid-header-border);height:var(--spacing-12);padding:var(--spacing-3) var(--spacing-4);font-size:var(--font-size-md);font-weight:700;color:var(--components-datagrid-header-text)}nv-datagrid td{border-bottom:1px solid var(--components-datagrid-body-border);height:var(--spacing-12);max-height:var(--spacing-14);padding:var(--spacing-2) var(--spacing-4);font-size:var(--font-size-md);font-weight:400;color:var(--components-datagrid-body-text);white-space:nowrap;text-overflow:ellipsis}nv-datagrid tbody>tr:hover{background:var(--color-interaction-container-neutral-background-hover)}nv-datagrid .cursor-pointer{cursor:pointer}nv-datagrid .select-none{-webkit-user-select:none;user-select:none}nv-datagrid .search-container{display:flex}nv-datagrid .checkbox-container{position:relative;color:var(--nv-datagrid-color-checked)}nv-datagrid .checkbox-container input[type=checkbox][readonly]{opacity:0.5}nv-datagrid .checkbox-container:has(input[type=checkbox]:disabled:not([readonly])){color:var(--nv-datagrid-color-disabled)}nv-datagrid .checkbox-container input[type=checkbox]{appearance:none;position:relative;display:flex;width:var(--form-checkbox-size);height:var(--form-checkbox-size);flex-direction:column;align-items:flex-start;border-radius:var(--form-checkbox-radius);border-width:var(--form-checkbox-border-width);border-style:solid;border-color:var(--nv-datagrid-border-default);background:var(--nv-datagrid-background-default)}nv-datagrid .checkbox-container input[type=checkbox]:hover{border-color:var(--nv-datagrid-border-hover)}nv-datagrid .checkbox-container input[type=checkbox]:focus{border-color:var(--nv-datagrid-border-focus)}nv-datagrid .checkbox-container input[type=checkbox]:focus,nv-datagrid .checkbox-container input[type=checkbox]:focus-within{outline:none}nv-datagrid .checkbox-container input[type=checkbox]:focus-visible,nv-datagrid .checkbox-container input[type=checkbox]:has(:focus-visible){outline:calc(var(--focus-outline-stroke) * 1) solid var(--nv-datagrid-outline-color);outline-offset:calc(var(--focus-outline-offset) * 1)}nv-datagrid .checkbox-container input[type=checkbox]:checked,nv-datagrid .checkbox-container input[type=checkbox]:indeterminate{background:var(--nv-datagrid-background-checked);border-color:var(--nv-datagrid-background-checked)}nv-datagrid .checkbox-container input[type=checkbox]:disabled:not([readonly]){background:var(--nv-datagrid-background-disabled);border-color:var(--nv-datagrid-border-default)}nv-datagrid .checkbox-container input[type=checkbox][readonly]{opacity:0.5}nv-datagrid .checkbox-container .icon{pointer-events:none;position:absolute;top:0;left:0;width:100%;height:100%;display:flex;justify-content:center;align-items:center}nv-datagrid .checkbox-container .icon svg{width:var(--form-checkbox-icon-size);height:var(--form-checkbox-icon-size);fill:none;stroke:currentcolor;stroke-width:var(--form-checkbox-icon-stroke);flex-shrink:0}";
3227
3314
  const NvDatagridStyle0 = nvDatagridCss;
3228
3315
 
3229
3316
  const NvDatagrid = class {
3230
3317
  constructor(hostRef) {
3231
3318
  index.registerInstance(this, hostRef);
3232
3319
  this.action = index.createEvent(this, "action", 7);
3320
+ this.selectedRows = index.createEvent(this, "selectedRows", 7);
3233
3321
  this.templateCache = new Map();
3234
3322
  this.headerTemplateCache = new Map();
3235
3323
  this.minPageIndex = 1;
@@ -3241,6 +3329,8 @@ const NvDatagrid = class {
3241
3329
  this.globalFilterSearchTerm = '';
3242
3330
  this.columnData = [];
3243
3331
  this.paginationState = null;
3332
+ this.sorting = [];
3333
+ this.rowSelectionState = {};
3244
3334
  //#endregion STATES
3245
3335
  /****************************************************************************/
3246
3336
  //#region PROPERTIES
@@ -3276,6 +3366,12 @@ const NvDatagrid = class {
3276
3366
  * @default 'No data or columns available to display.'
3277
3367
  */
3278
3368
  this.noColumnsNoDataMessage = 'No data or columns available to display.';
3369
+ /**
3370
+ * Whether to automatically generate columns if none are provided.
3371
+ * If columns are explicitly set, this property is ignored.
3372
+ * @default false
3373
+ */
3374
+ this.autoGenerateColumns = false;
3279
3375
  /**
3280
3376
  * Whether to enable global filtering for the data grid.
3281
3377
  * This allows users to search across all columns for a specific value.
@@ -3285,11 +3381,9 @@ const NvDatagrid = class {
3285
3381
  */
3286
3382
  this.enableGlobalFilter = false;
3287
3383
  /**
3288
- * Whether to automatically generate columns if none are provided.
3289
- * If columns are explicitly set, this property is ignored.
3290
- * @default false
3384
+ * Position the global filter input field
3291
3385
  */
3292
- this.autoGenerateColumns = false;
3386
+ this.globalFilterPosition = 'end';
3293
3387
  /**
3294
3388
  * Whether to enable pagination for the data grid.
3295
3389
  * @default false
@@ -3297,6 +3391,7 @@ const NvDatagrid = class {
3297
3391
  this.enablePagination = false;
3298
3392
  /**
3299
3393
  * The number of rows to display per page.
3394
+ * If the number is not present in the property pageSizes it takes the first of the list.
3300
3395
  * @default 10
3301
3396
  */
3302
3397
  this.pageSize = 10;
@@ -3305,6 +3400,15 @@ const NvDatagrid = class {
3305
3400
  * @default [10, 20, 30, 40, 50]
3306
3401
  */
3307
3402
  this.pageSizes = [10, 20, 30, 40, 50];
3403
+ /**
3404
+ * Whether to enable sorting for the data grid.
3405
+ * @default false
3406
+ */
3407
+ this.enableSorting = false;
3408
+ /**
3409
+ * Whether to enable row selection for the data grid.
3410
+ */
3411
+ this.enableRowSelection = false;
3308
3412
  this.debouncedFilter = debounce((value) => {
3309
3413
  var _a;
3310
3414
  (_a = this.table) === null || _a === void 0 ? void 0 : _a.setGlobalFilter(value);
@@ -3337,8 +3441,32 @@ const NvDatagrid = class {
3337
3441
  };
3338
3442
  this.handlePageSizeChange = (event) => {
3339
3443
  const target = event.target;
3444
+ let effectivePageSize = Number(target.value);
3445
+ if (!this.pageSizes.includes(effectivePageSize) && this.pageSizes) {
3446
+ effectivePageSize = this.pageSizes[0];
3447
+ }
3340
3448
  // Simply use `setPageSize` to update the page size directly
3341
- this.paginationState = Object.assign(Object.assign({}, this.paginationState), { pageSize: Number(target.value) }); // This triggers the paginationState watcher
3449
+ this.paginationState = Object.assign(Object.assign({}, this.paginationState), { pageSize: effectivePageSize }); // This triggers the paginationState watcher
3450
+ };
3451
+ this.handleSortingClick = (event, header) => {
3452
+ var _a;
3453
+ if (!header.column.getCanSort()) {
3454
+ return;
3455
+ }
3456
+ (_a = header.column.getToggleSortingHandler()) === null || _a === void 0 ? void 0 : _a(event);
3457
+ };
3458
+ this.getSortTitle = (header) => {
3459
+ if (!header.column.getCanSort())
3460
+ return;
3461
+ const nextOrder = header.column.getNextSortingOrder();
3462
+ switch (nextOrder) {
3463
+ case constants.SortingPossibility.Asc:
3464
+ return 'Sort ascending';
3465
+ case constants.SortingPossibility.Desc:
3466
+ return 'Sort descending';
3467
+ default:
3468
+ return 'Clear sort';
3469
+ }
3342
3470
  };
3343
3471
  }
3344
3472
  //#endregion PROPERTIES
@@ -3374,34 +3502,37 @@ const NvDatagrid = class {
3374
3502
  header: col.header,
3375
3503
  accessor: col.accessor,
3376
3504
  repeatTemplate: col.hasAttribute('repeat-template'),
3505
+ group: col.group,
3377
3506
  };
3378
3507
  this.columnData.push(colData);
3379
3508
  });
3509
+ console.info('cacheTemplates this.columnData:', this.columnData);
3380
3510
  }
3381
3511
  parseDataAndColumns() {
3382
- if (this.dataJson) {
3383
- this.parseJsonData(this.dataJson);
3384
- }
3385
- else if (this.data && this.data.length > 0) {
3512
+ if (this.data && this.data.length > 0) {
3386
3513
  this.parseDataArray(this.data, this.parsedData);
3387
3514
  }
3388
- if (this.columnsJson) {
3389
- this.parseJsonColumns(this.columnsJson, this.parsedColumns);
3390
- }
3391
- else if (this.columns && this.columns.length > 0) {
3515
+ if (this.columns && this.columns.length > 0) {
3392
3516
  this.parseColumnsArray(this.columns, this.parsedColumns);
3393
3517
  }
3394
3518
  else if (this.headerTemplateCache.size > 0) {
3395
3519
  const headerKeys = Array.from(this.headerTemplateCache.keys());
3396
- const arrayColumnsConfig = headerKeys.map(key => (Object.assign({}, { accessor: key, header: key ? key.charAt(0).toUpperCase() + key.slice(1) : '' })));
3520
+ const arrayColumnsConfig = headerKeys.map(key => {
3521
+ var _a, _b;
3522
+ return (Object.assign({}, { accessor: key, header: key ? key.charAt(0).toUpperCase() + key.slice(1) : '', group: (_b = (_a = this.columnData.find(x => x.accessor === key)) === null || _a === void 0 ? void 0 : _a.group) !== null && _b !== void 0 ? _b : 'ungrouped' }));
3523
+ });
3397
3524
  this.parseColumnsArray(arrayColumnsConfig, this.parsedColumns);
3398
3525
  }
3399
3526
  else if (this.parsedData.length > 0) {
3400
3527
  const firstRow = this.parsedData[0];
3401
- const arrayColumnsConfig = Object.keys(firstRow).map(key => ({
3402
- accessor: key,
3403
- header: key.charAt(0).toUpperCase() + key.slice(1),
3404
- }));
3528
+ const arrayColumnsConfig = Object.keys(firstRow).map(key => {
3529
+ var _a, _b;
3530
+ return ({
3531
+ accessor: key,
3532
+ header: key.charAt(0).toUpperCase() + key.slice(1),
3533
+ group: (_b = (_a = this.columnData.find(x => x.accessor === key)) === null || _a === void 0 ? void 0 : _a.group) !== null && _b !== void 0 ? _b : 'ungrouped',
3534
+ });
3535
+ });
3405
3536
  if (this.autoGenerateColumns) {
3406
3537
  this.parseColumnsArray(arrayColumnsConfig, this.parsedColumns);
3407
3538
  }
@@ -3444,6 +3575,7 @@ const NvDatagrid = class {
3444
3575
  var _a, _b, _c, _d;
3445
3576
  // Clear the previous table instance (if any)
3446
3577
  this.table = null;
3578
+ console.info('initializeTable this.columnData:', this.columnData);
3447
3579
  // Set default options for the table
3448
3580
  const tableOptions = {
3449
3581
  columns: [],
@@ -3502,10 +3634,14 @@ const NvDatagrid = class {
3502
3634
  if (hasData) {
3503
3635
  // No parsed columns and data is available
3504
3636
  const firstRow = this.parsedData[0];
3505
- const arrayColumnsConfig = Object.keys(firstRow).map(key => ({
3506
- accessor: key,
3507
- header: key.charAt(0).toUpperCase() + key.slice(1),
3508
- }));
3637
+ const arrayColumnsConfig = Object.keys(firstRow).map(key => {
3638
+ var _a, _b;
3639
+ return ({
3640
+ accessor: key,
3641
+ header: key.charAt(0).toUpperCase() + key.slice(1),
3642
+ group: (_b = (_a = this.columnData.find(x => x.accessor === key)) === null || _a === void 0 ? void 0 : _a.group) !== null && _b !== void 0 ? _b : 'ungrouped',
3643
+ });
3644
+ });
3509
3645
  if (this.autoGenerateColumns) {
3510
3646
  this.parseColumnsArray(arrayColumnsConfig, this.parsedColumns);
3511
3647
  }
@@ -3529,9 +3665,14 @@ const NvDatagrid = class {
3529
3665
  }
3530
3666
  if (this.enablePagination) {
3531
3667
  tableOptions.getPaginationRowModel = getPaginationRowModel();
3668
+ const pageIndex = (_b = (_a = this.paginationState) === null || _a === void 0 ? void 0 : _a.pageIndex) !== null && _b !== void 0 ? _b : 0;
3669
+ let effectivePageSize = (_d = (_c = this.paginationState) === null || _c === void 0 ? void 0 : _c.pageSize) !== null && _d !== void 0 ? _d : 10;
3670
+ if (!this.pageSizes.includes(effectivePageSize) && this.pageSizes) {
3671
+ effectivePageSize = this.pageSizes[0];
3672
+ }
3532
3673
  const pagination = {
3533
- pageIndex: (_b = (_a = this.paginationState) === null || _a === void 0 ? void 0 : _a.pageIndex) !== null && _b !== void 0 ? _b : 0,
3534
- pageSize: (_d = (_c = this.paginationState) === null || _c === void 0 ? void 0 : _c.pageSize) !== null && _d !== void 0 ? _d : 10,
3674
+ pageIndex: pageIndex,
3675
+ pageSize: effectivePageSize,
3535
3676
  };
3536
3677
  // Set the initial pagination value with safeguards
3537
3678
  tableOptions.state.pagination = pagination;
@@ -3542,6 +3683,33 @@ const NvDatagrid = class {
3542
3683
  this.paginationState = newPagination;
3543
3684
  };
3544
3685
  }
3686
+ if (this.enableSorting) {
3687
+ tableOptions.getSortedRowModel = getSortedRowModel();
3688
+ tableOptions.enableSorting = this.enableSorting;
3689
+ tableOptions.state.sorting = this.sorting;
3690
+ tableOptions.onSortingChange = updater => {
3691
+ const newSorting = typeof updater === 'function' ? updater(this.sorting) : updater;
3692
+ this.sorting = newSorting; // Will automatically trigger the searchTerm watcher and update the table
3693
+ };
3694
+ }
3695
+ if (this.enableRowSelection) {
3696
+ tableOptions.state.rowSelection = this.rowSelectionState;
3697
+ tableOptions.onRowSelectionChange = updater => {
3698
+ const newRowSelectionState = typeof updater === 'function'
3699
+ ? updater(this.rowSelectionState)
3700
+ : updater;
3701
+ this.rowSelectionState = newRowSelectionState;
3702
+ // Emit the original rows instead of IDs
3703
+ const selectedRows = Object.keys(newRowSelectionState)
3704
+ .filter(rowId => newRowSelectionState[rowId])
3705
+ .map(rowId => {
3706
+ // Assuming rowId corresponds to the index in parsedData
3707
+ const index = parseInt(rowId, 10); // Convert rowId to an integer index
3708
+ return this.parsedData[index]; // Get the original row data
3709
+ });
3710
+ this.selectedRows.emit(selectedRows); // Emit the original rows
3711
+ };
3712
+ }
3545
3713
  // Initialize the table
3546
3714
  this.table = createTable(tableOptions);
3547
3715
  }
@@ -3576,60 +3744,165 @@ const NvDatagrid = class {
3576
3744
  };
3577
3745
  return checkValue(row.original);
3578
3746
  }
3747
+ createIconSpan(checked, indeterminate) {
3748
+ const span = document.createElement('span');
3749
+ span.className = 'icon';
3750
+ if (checked && !indeterminate) {
3751
+ const svg = document.createElementNS('http://www.w3.org/2000/svg', 'svg');
3752
+ svg.setAttribute('xmlns', 'http://www.w3.org/2000/svg');
3753
+ svg.setAttribute('width', '14');
3754
+ svg.setAttribute('height', '14');
3755
+ svg.setAttribute('viewBox', '0 0 14 14');
3756
+ svg.setAttribute('fill', 'none');
3757
+ const path = document.createElementNS('http://www.w3.org/2000/svg', 'path');
3758
+ path.setAttribute('d', 'M11.6667 3.5L5.25004 9.91667L2.33337 7');
3759
+ path.setAttribute('stroke-linecap', 'round');
3760
+ path.setAttribute('stroke-linejoin', 'round');
3761
+ svg.appendChild(path);
3762
+ span.appendChild(svg);
3763
+ }
3764
+ if (indeterminate) {
3765
+ const svg = document.createElementNS('http://www.w3.org/2000/svg', 'svg');
3766
+ svg.classList.add('indeterminate-svg');
3767
+ svg.setAttribute('xmlns', 'http://www.w3.org/2000/svg');
3768
+ svg.setAttribute('viewBox', '0 0 14 14');
3769
+ svg.setAttribute('fill', 'none');
3770
+ const path = document.createElementNS('http://www.w3.org/2000/svg', 'path');
3771
+ path.setAttribute('d', 'M2.9165 7H11.0832');
3772
+ path.setAttribute('stroke-linecap', 'round');
3773
+ path.setAttribute('stroke-linejoin', 'round');
3774
+ svg.appendChild(path);
3775
+ span.appendChild(svg);
3776
+ }
3777
+ return span;
3778
+ }
3779
+ createIndeterminateCheckbox(options = {}) {
3780
+ const { indeterminate, checked = false, disabled = false, className = '', onChange, } = options;
3781
+ const input = document.createElement('input');
3782
+ input.type = 'checkbox';
3783
+ input.checked = checked;
3784
+ input.disabled = disabled;
3785
+ input.className = `${className} cursor-pointer`.trim();
3786
+ if (typeof indeterminate === 'boolean') {
3787
+ input.indeterminate = !checked && indeterminate;
3788
+ }
3789
+ if (onChange) {
3790
+ input.addEventListener('change', onChange);
3791
+ }
3792
+ const iconSpan = this.createIconSpan(checked, indeterminate);
3793
+ const container = document.createElement('div');
3794
+ container.className = 'checkbox-container';
3795
+ container.appendChild(input);
3796
+ container.appendChild(iconSpan);
3797
+ return container;
3798
+ }
3579
3799
  // Helper function to generate column definitions
3580
3800
  generateColumns(validColumns, tableOptions) {
3801
+ console.info('generateColumns this.columnData:', this.columnData);
3802
+ console.info('generateColumns validColumns:', validColumns);
3803
+ let processedColumns = validColumns || [];
3581
3804
  const columnHelper = createColumnHelper();
3582
- if (validColumns.length > 0) {
3583
- // Use defined columns
3584
- return validColumns.map(column => {
3805
+ // If no columns provided or autoGenerateColumns is true, generate them from data
3806
+ if ((!validColumns && tableOptions.data && tableOptions.data.length > 0) ||
3807
+ (validColumns.length <= 0 &&
3808
+ tableOptions.data &&
3809
+ tableOptions.data.length > 0)) {
3810
+ const sampleRow = tableOptions.data[0];
3811
+ processedColumns = Object.keys(sampleRow).map(key => {
3585
3812
  var _a, _b;
3586
- return columnHelper.accessor(column.accessor, {
3587
- header: (_b = (this.renderTemplate(this.headerTemplateCache.get(column.accessor), (_a = column.header) !== null && _a !== void 0 ? _a : column.accessor, null) ||
3588
- column.header)) !== null && _b !== void 0 ? _b : column.accessor,
3589
- cell: (info) => {
3590
- var _a, _b, _c;
3591
- const value = info.getValue();
3592
- const cellAccessors = column.accessor;
3593
- const row = info.row;
3594
- return ((_a = this.columnData.find(x => x.accessor === cellAccessors)) === null || _a === void 0 ? void 0 : _a.repeatTemplate) && Array.isArray(value)
3595
- ? value.map((item) => {
3596
- var _a, _b;
3597
- return (_b = (_a = (this.renderTemplate(this.templateCache.get(cellAccessors), item, row) ||
3598
- item)) !== null && _a !== void 0 ? _a : value) !== null && _b !== void 0 ? _b : this.fallbackValue;
3599
- })
3600
- : (_c = (_b = (this.renderTemplate(this.templateCache.get(cellAccessors), value, row) ||
3601
- value)) !== null && _b !== void 0 ? _b : value) !== null && _c !== void 0 ? _c : this.fallbackValue;
3602
- },
3603
- enableGlobalFilter: this.enableGlobalFilter,
3813
+ return ({
3814
+ header: key.charAt(0).toUpperCase() + key.slice(1),
3815
+ accessor: key,
3816
+ group: (_b = (_a = this.columnData.find(x => x.accessor === key)) === null || _a === void 0 ? void 0 : _a.group) !== null && _b !== void 0 ? _b : 'ungrouped',
3817
+ headerSlot: null,
3818
+ cellSlot: null,
3604
3819
  });
3605
3820
  });
3606
3821
  }
3607
- else if (tableOptions.data && tableOptions.data.length > 0) {
3608
- // Generate columns from data keys
3609
- const sampleRow = tableOptions.data[0];
3610
- return Object.keys(sampleRow).map(key => columnHelper.accessor(key, {
3611
- 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
3822
+ // Group columns by their group property
3823
+ const groupedColumns = processedColumns.reduce((acc, column) => {
3824
+ let group = column.group || 'ungrouped';
3825
+ if (group == 'ungrouped') {
3826
+ group = group + processedColumns.findIndex(x => x == column);
3827
+ }
3828
+ if (!acc[group]) {
3829
+ acc[group] = [];
3830
+ }
3831
+ acc[group].push(column);
3832
+ return acc;
3833
+ }, {});
3834
+ // Transform each column into a ColumnDef
3835
+ const createColumnDef = (column) => {
3836
+ var _a, _b, _c;
3837
+ return columnHelper.accessor(column.accessor, {
3838
+ header: (_c = (_b = this.renderTemplate(this.headerTemplateCache.get(column.accessor), (_a = column.header) !== null && _a !== void 0 ? _a : column.accessor, null)) !== null && _b !== void 0 ? _b : column.header) !== null && _c !== void 0 ? _c : column.accessor,
3612
3839
  cell: (info) => {
3613
3840
  var _a, _b, _c;
3614
3841
  const value = info.getValue();
3615
- const cellAccessors = key;
3616
3842
  const row = info.row;
3617
- return ((_a = this.columnData.find(x => x.accessor === cellAccessors)) === null || _a === void 0 ? void 0 : _a.repeatTemplate) && Array.isArray(value)
3843
+ return ((_a = this.columnData.find(x => x.accessor === column.accessor)) === null || _a === void 0 ? void 0 : _a.repeatTemplate) && Array.isArray(value)
3618
3844
  ? value.map((item) => {
3619
- var _a, _b;
3620
- return (_b = (_a = (this.renderTemplate(this.templateCache.get(cellAccessors), item, row) ||
3621
- item)) !== null && _a !== void 0 ? _a : value) !== null && _b !== void 0 ? _b : this.fallbackValue;
3845
+ var _a, _b, _c;
3846
+ return (_c = (_b = (_a = this.renderTemplate(this.templateCache.get(column.accessor), item, row)) !== null && _a !== void 0 ? _a : item) !== null && _b !== void 0 ? _b : value) !== null && _c !== void 0 ? _c : this.fallbackValue;
3622
3847
  })
3623
- : (_c = (_b = (this.renderTemplate(this.templateCache.get(cellAccessors), value, row) ||
3624
- value)) !== null && _b !== void 0 ? _b : value) !== null && _c !== void 0 ? _c : this.fallbackValue;
3848
+ : (_c = (_b = this.renderTemplate(this.templateCache.get(column.accessor), value, row)) !== null && _b !== void 0 ? _b : value) !== null && _c !== void 0 ? _c : this.fallbackValue;
3625
3849
  },
3626
- enableGlobalFilter: this.enableGlobalFilter,
3627
- }));
3628
- }
3629
- else {
3630
- // No columns and no data
3631
- return [];
3850
+ sortUndefined: 'last',
3851
+ sortDescFirst: false,
3852
+ enableSorting: this.enableSorting, // Explicitly set enableSorting based on the sorting prop
3853
+ enableGlobalFilter: this.enableGlobalFilter, // Explicity set enableGlobalFilter based on the globalFiltering prop
3854
+ });
3855
+ };
3856
+ // Create the final column structure
3857
+ let generatedColumns = Object.entries(groupedColumns)
3858
+ .map(([groupName, groupColumns]) => {
3859
+ if (groupName.includes('ungrouped')) {
3860
+ return groupColumns.map(createColumnDef);
3861
+ }
3862
+ return {
3863
+ id: groupName,
3864
+ header: groupName,
3865
+ columns: groupColumns.map(createColumnDef),
3866
+ enableSorting: this.enableSorting, // Also apply to column groups
3867
+ enableGlobalFilter: this.enableGlobalFilter, // Also apply to column groups
3868
+ };
3869
+ })
3870
+ .flat();
3871
+ if (this.enableRowSelection) {
3872
+ const rowSelection = columnHelper.accessor('select', {
3873
+ header: ({ table }) => {
3874
+ return (index.h("div", { class: "flex px-1", ref: el => {
3875
+ const checkbox = this.createIndeterminateCheckbox({
3876
+ checked: table === null || table === void 0 ? void 0 : table.getIsAllRowsSelected(),
3877
+ indeterminate: table === null || table === void 0 ? void 0 : table.getIsSomeRowsSelected(),
3878
+ onChange: table === null || table === void 0 ? void 0 : table.getToggleAllRowsSelectedHandler(),
3879
+ });
3880
+ if (el) {
3881
+ el.innerHTML = ''; // Remove existing content
3882
+ el.appendChild(checkbox); // Append new checkbox
3883
+ }
3884
+ } }));
3885
+ },
3886
+ cell: ({ row }) => {
3887
+ return (index.h("div", { class: "flex px-1", ref: el => {
3888
+ const checkbox = this.createIndeterminateCheckbox({
3889
+ checked: row === null || row === void 0 ? void 0 : row.getIsSelected(),
3890
+ disabled: !(row === null || row === void 0 ? void 0 : row.getCanSelect()),
3891
+ indeterminate: row === null || row === void 0 ? void 0 : row.getIsSomeSelected(),
3892
+ onChange: row === null || row === void 0 ? void 0 : row.getToggleSelectedHandler(),
3893
+ });
3894
+ if (el) {
3895
+ el.innerHTML = ''; // Remove existing content
3896
+ el.appendChild(checkbox); // Append new checkbox
3897
+ }
3898
+ } }));
3899
+ },
3900
+ enableGlobalFilter: false,
3901
+ enableSorting: false,
3902
+ });
3903
+ generatedColumns = [rowSelection, ...generatedColumns];
3632
3904
  }
3905
+ return generatedColumns;
3633
3906
  }
3634
3907
  getTableData() {
3635
3908
  if (this.parsedData &&
@@ -3877,35 +4150,55 @@ const NvDatagrid = class {
3877
4150
  });
3878
4151
  }
3879
4152
  }
4153
+ getArrowSorting(header) {
4154
+ if (!header.column.getCanSort())
4155
+ return null;
4156
+ const sortState = header.column.getIsSorted();
4157
+ if (sortState === constants.SortingPossibility.Asc) {
4158
+ return (index.h("div", { class: "inline-flex align-middle" }, index.h("nv-icon", { name: "arrow-up" })));
4159
+ }
4160
+ if (sortState === constants.SortingPossibility.Desc) {
4161
+ return (index.h("div", { class: "inline-flex align-middle" }, index.h("nv-icon", { name: "arrow-down" })));
4162
+ }
4163
+ return null;
4164
+ }
4165
+ getHeaderCell(header) {
4166
+ const isSortable = header.column.getCanSort();
4167
+ const sortTitle = this.getSortTitle(header);
4168
+ const content = header.isPlaceholder
4169
+ ? null
4170
+ : header.column.columnDef.header
4171
+ ? this.flexRender(header.column.columnDef.header, header.getContext())
4172
+ : null; // Ensure content is not null
4173
+ const sortIcon = this.getArrowSorting(header);
4174
+ const handleClick = this.createSortingClickHandler(header);
4175
+ if (this.enableRowSelection) {
4176
+ return (index.h("th", { key: header.id, colSpan: header.colSpan }, content, " "));
4177
+ }
4178
+ const returnHtml = (index.h("th", { key: header.id, colSpan: header.colSpan }, index.h("button", { type: "button", class: isSortable
4179
+ ? 'w-full text-left cursor-pointer select-none bg-transparent border-none p-0 m-0 focus:outline-none'
4180
+ : 'w-full text-left bg-transparent border-none p-0 m-0 cursor-default', onClick: handleClick, title: sortTitle }, index.h("span", { class: "inline-flex items-center gap-1" }, content, sortIcon))));
4181
+ return returnHtml;
4182
+ }
4183
+ // 👇 Helper method to avoid arrow function in JSX
4184
+ createSortingClickHandler(header) {
4185
+ return (e) => {
4186
+ this.handleSortingClick(e, header);
4187
+ };
4188
+ }
4189
+ getPagination() {
4190
+ var _a;
4191
+ return (this.enablePagination && (index.h("div", { class: "flex items-center gap-2" }, index.h("button", { class: "border rounded p-1", disabled: !this.table.getCanPreviousPage(), onClick: this.table.firstPage }, "<<"), index.h("button", { class: "border rounded p-1", disabled: !this.table.getCanPreviousPage(), onClick: this.table.previousPage }, "<"), index.h("button", { class: "border rounded p-1", disabled: !this.table.getCanNextPage(), onClick: this.table.nextPage }, ">"), index.h("button", { class: "border rounded p-1", disabled: !this.table.getCanNextPage(), onClick: this.table.lastPage }, ">>"), index.h("span", { class: "flex items-center gap-1" }, index.h("div", null, "Page"), index.h("strong", null, this.table.getState().pagination.pageIndex + 1, " of", ' ', this.table.getPageCount().toLocaleString())), index.h("span", { class: "flex items-center gap-1" }, "| Go to page:", ' ', index.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 && (index.h("select", { "aria-label": "Rows per page", onChange: this.handlePageSizeChange }, this.pageSizes.map(pageSize => (index.h("option", { value: String(pageSize), selected: this.table.getState().pagination.pageSize === pageSize }, "Show ", pageSize))))))));
4192
+ }
3880
4193
  //#endregion METHODS
3881
4194
  /****************************************************************************/
3882
4195
  //#region WATCHERS
3883
4196
  parseColumns(newValue, oldValue = []) {
3884
4197
  this.parseColumnsArray(newValue, oldValue);
3885
4198
  }
3886
- parseJsonColumns(newValue, oldValue) {
3887
- try {
3888
- const newItems = newValue ? JSON.parse(newValue) : [];
3889
- this.parseColumnsArray(newItems, oldValue);
3890
- }
3891
- catch (e) {
3892
- console.error('Invalid JSON format for columnsJson:', e.message);
3893
- this.parsedColumns = [];
3894
- }
3895
- }
3896
4199
  parseData(newValue, oldValue = []) {
3897
4200
  this.parseDataArray(newValue, oldValue);
3898
4201
  }
3899
- parseJsonData(newValue) {
3900
- try {
3901
- const newItems = newValue ? JSON.parse(newValue) : [];
3902
- this.parseDataArray(newItems, this.parsedData);
3903
- }
3904
- catch (e) {
3905
- console.error('Invalid JSON format for dataJson:', e.message);
3906
- this.parsedData = [];
3907
- }
3908
- }
3909
4202
  handleParsedChange() {
3910
4203
  this.initializeTable();
3911
4204
  }
@@ -3934,6 +4227,39 @@ const NvDatagrid = class {
3934
4227
  this.table.options.state.pagination = newValue;
3935
4228
  }
3936
4229
  }
4230
+ handleSorting(newValue) {
4231
+ if (!this.table) {
4232
+ console.warn('Table is not initialized yet.');
4233
+ return;
4234
+ }
4235
+ // Not working
4236
+ /*// Set the sorting for the table
4237
+ this.table.setSorting(newValue);*/
4238
+ // Manually update the sorting state
4239
+ this.table.options.state.sorting = newValue;
4240
+ }
4241
+ handlePageSize(newValue) {
4242
+ let effectivePageSize = newValue;
4243
+ if (!this.pageSizes.includes(effectivePageSize) && this.pageSizes) {
4244
+ effectivePageSize = this.pageSizes[0];
4245
+ }
4246
+ // Simply use `setPageSize` to update the page size directly
4247
+ this.paginationState = Object.assign(Object.assign({}, this.paginationState), { pageSize: effectivePageSize }); // This triggers the paginationState watcher
4248
+ }
4249
+ handleRowSelectionState(newValue, oldValue) {
4250
+ if (!this.table) {
4251
+ console.warn('Table is not initialized yet.');
4252
+ return;
4253
+ }
4254
+ // Only update if there is a meaningful change
4255
+ if (JSON.stringify(newValue) !== JSON.stringify(oldValue)) {
4256
+ // Not working
4257
+ /*// Set the rowSelection for the table
4258
+ this.table.setRowSelection(newValue);*/
4259
+ // Manually update the row selection state
4260
+ this.table.options.state.rowSelection = newValue;
4261
+ }
4262
+ }
3937
4263
  //#endregion WATCHERS
3938
4264
  /****************************************************************************/
3939
4265
  //#region LIFECYCLE
@@ -3943,7 +4269,10 @@ const NvDatagrid = class {
3943
4269
  this.initializeTable();
3944
4270
  if (this.enablePagination) {
3945
4271
  // Ensure a valid page size
3946
- const effectivePageSize = this.pageSize > 0 ? this.pageSize : 10;
4272
+ let effectivePageSize = this.pageSize > 0 ? this.pageSize : 10;
4273
+ if (!this.pageSizes.includes(effectivePageSize) && this.pageSizes) {
4274
+ effectivePageSize = this.pageSizes[0];
4275
+ }
3947
4276
  this.paginationState = {
3948
4277
  pageIndex: Math.max(0, this.minPageIndex - 1),
3949
4278
  pageSize: effectivePageSize,
@@ -3961,11 +4290,9 @@ const NvDatagrid = class {
3961
4290
  const rows = !this.table || this.table === undefined || this.parsedData.length === 0
3962
4291
  ? []
3963
4292
  : (_c = (_b = this.table) === null || _b === void 0 ? void 0 : _b.getRowModel()) === null || _c === void 0 ? void 0 : _c.rows;
3964
- return (index.h(index.Host, { key: 'b3886397a5e6694611636d4da7d61ae5ccbe1903' }, index.h("div", { key: '8fa71d83f4cfa79cf7fb334bcf6115e4cf253c5d', class: "hidden" }, index.h("slot", { key: '9aad5956b5973cafc486f3a854a66ae86038ef4a' })), index.h("slot", { key: '7a1ca93223567faffabb3473df2176cd02654247', name: "before" }), this.enableGlobalFilter && this.table && (index.h("div", { key: '0020880c229d8ed9070c15182191e86b8b3fed1d', class: "search-container" }, index.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 ? (index.h("div", { class: "no-data" }, this.noColumnsNoDataMessage)) : (index.h("div", null, index.h("table", null, this.parsedColumns.length > 0 && headerGroups.length > 0 && (index.h("thead", null, this.parsedColumns.length > 0 && headerGroups
4293
+ return (index.h(index.Host, { key: '90be657fa9c7f8755391f8d91418399de742ae1f' }, index.h("div", { key: 'f28596438b7c9c22b34789236c5faa644938d1dc', class: "hidden" }, index.h("slot", { key: 'fdc1670cc6bafb5f1efa8c63d41acbfd15659de6' })), index.h("slot", { key: '65afa2282af4842bcb23f8baa592545fe3b74fa3', name: "before" }), this.enableGlobalFilter && this.table && (index.h("div", { key: '8628a23712471690b6a6239a289dd8263aed423c', class: `search-container justify-${this.globalFilterPosition}` }, index.h("nv-fieldtext", { key: '42c56dd6ba426e2045c02b3754fae3562632c49f', value: this.globalFilterSearchTerm, onInput: this.handleGlobalFilteringOnInput, placeholder: "Search all columns..." }))), this.parsedColumns.length === 0 && this.parsedData.length === 0 ? (index.h("div", { class: "no-data" }, this.noColumnsNoDataMessage)) : (index.h("div", null, index.h("table", null, this.parsedColumns.length > 0 && headerGroups.length > 0 && (index.h("thead", null, this.parsedColumns.length > 0 && headerGroups
3965
4294
  ? headerGroups === null || headerGroups === void 0 ? void 0 : headerGroups.map(headerGroup => (index.h("tr", { key: headerGroup.id }, headerGroup.headers.map(header => {
3966
- return (index.h("th", { key: header.id }, header.isPlaceholder
3967
- ? null
3968
- : this.flexRender(header.column.columnDef.header, header.getContext())));
4295
+ return this.getHeaderCell(header);
3969
4296
  }))))
3970
4297
  : null)), index.h("tbody", null, !rows || rows.length === 0 || this.parsedData.length === 0 ? (index.h("tr", null, index.h("td", { colSpan: this.parsedColumns.length || 12, class: "no-data" }, this.noDataMessage))) : (rows.map(row => {
3971
4298
  const rowId = row.id;
@@ -3973,18 +4300,20 @@ const NvDatagrid = class {
3973
4300
  return (index.h("tr", { key: rowId }, visibleCells.map(cell => {
3974
4301
  return (index.h("td", { key: cell.id, "data-row-id": rowId }, this.flexRender(cell.column.columnDef.cell, cell.getContext())));
3975
4302
  })));
3976
- })))), this.enablePagination && (index.h("div", { class: "flex items-center gap-2" }, index.h("button", { class: "border rounded p-1", disabled: !this.table.getCanPreviousPage(), onClick: this.table.firstPage }, "<<"), index.h("button", { class: "border rounded p-1", disabled: !this.table.getCanPreviousPage(), onClick: this.table.previousPage }, "<"), index.h("button", { class: "border rounded p-1", disabled: !this.table.getCanNextPage(), onClick: this.table.nextPage }, ">"), index.h("button", { class: "border rounded p-1", disabled: !this.table.getCanNextPage(), onClick: this.table.lastPage }, ">>"), index.h("span", { class: "flex items-center gap-1" }, index.h("div", null, "Page"), index.h("strong", null, this.table.getState().pagination.pageIndex + 1, " of", ' ', this.table.getPageCount().toLocaleString())), index.h("span", { class: "flex items-center gap-1" }, "| Go to page:", ' ', index.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 : (index.h("select", { "aria-label": "Rows per page", onChange: this.handlePageSizeChange }, this.pageSizes.map(pageSize => (index.h("option", { value: String(pageSize), selected: this.table.getState().pagination.pageSize === pageSize }, "Show ", pageSize))))))))), index.h("slot", { key: '2030fdc2b38a293e749f2ffd4645987e834fee76', name: "after" })));
4303
+ }))), this.table && this.enableRowSelection ? (index.h("tfoot", null, index.h("tr", null, index.h("td", { colSpan: 20 }, this.enableRowSelection && this.table ? (index.h("div", null, this.rowSelectionState &&
4304
+ Object.keys(this.rowSelectionState).length > 0 ? (index.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")) : (index.h("span", null, "No rows selected")))) : null)))) : null), this.getPagination())), index.h("slot", { key: 'e1641d8fd103b0802e1df4f0848f0de921260065', name: "after" })));
3977
4305
  }
3978
4306
  get el() { return index.getElement(this); }
3979
4307
  static get watchers() { return {
3980
4308
  "columns": ["parseColumns"],
3981
- "columnsJson": ["parseJsonColumns"],
3982
4309
  "data": ["parseData"],
3983
- "dataJson": ["parseJsonData"],
3984
4310
  "parsedColumns": ["handleParsedChange"],
3985
4311
  "parsedData": ["handleParsedChange"],
3986
4312
  "globalFilterSearchTerm": ["handleGlobalFilterSearchTerm"],
3987
- "paginationState": ["handlePaginationState"]
4313
+ "paginationState": ["handlePaginationState"],
4314
+ "sorting": ["handleSorting"],
4315
+ "pageSize": ["handlePageSize"],
4316
+ "rowSelectionState": ["handleRowSelectionState"]
3988
4317
  }; }
3989
4318
  };
3990
4319
  NvDatagrid.style = NvDatagridStyle0;