@nova-design-system/nova-webcomponents 3.0.0-beta.46 → 3.0.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 (322) hide show
  1. package/dist/cjs/index-9bda5507.js +0 -4
  2. package/dist/cjs/loader.cjs.js +1 -1
  3. package/dist/cjs/native.cjs.js +1 -1
  4. package/dist/cjs/nv-badge_2.cjs.entry.js +1 -1
  5. package/dist/cjs/nv-breadcrumb.cjs.entry.js +1 -1
  6. package/dist/cjs/nv-breadcrumbs.cjs.entry.js +1 -1
  7. package/dist/cjs/nv-button.cjs.entry.js +1 -1
  8. package/dist/cjs/nv-calendar.cjs.entry.js +48 -19
  9. package/dist/cjs/nv-calendar.cjs.entry.js.map +1 -1
  10. package/dist/cjs/nv-col.cjs.entry.js +1 -1
  11. package/dist/cjs/nv-datagrid.cjs.entry.js +351 -91
  12. package/dist/cjs/nv-datagrid.cjs.entry.js.map +1 -1
  13. package/dist/cjs/nv-datagridcolumn.cjs.entry.js +1 -1
  14. package/dist/cjs/nv-dialog.cjs.entry.js +1 -1
  15. package/dist/cjs/nv-dialogfooter_2.cjs.entry.js +2 -2
  16. package/dist/cjs/nv-fieldcheckbox.cjs.entry.js +4 -4
  17. package/dist/cjs/nv-fielddate.cjs.entry.js +5 -5
  18. package/dist/cjs/nv-fielddaterange.cjs.entry.js +4 -4
  19. package/dist/cjs/nv-fielddropdown.cjs.entry.js +15 -29
  20. package/dist/cjs/nv-fielddropdown.cjs.entry.js.map +1 -1
  21. package/dist/cjs/nv-fielddropdownitem.cjs.entry.js +1 -1
  22. package/dist/cjs/nv-fieldmultiselect.cjs.entry.js +28 -71
  23. package/dist/cjs/nv-fieldmultiselect.cjs.entry.js.map +1 -1
  24. package/dist/cjs/nv-fieldnumber.cjs.entry.js +3 -3
  25. package/dist/cjs/nv-fieldnumber.cjs.entry.js.map +1 -1
  26. package/dist/cjs/nv-fieldpassword.cjs.entry.js +3 -3
  27. package/dist/cjs/nv-fieldradio.cjs.entry.js +3 -3
  28. package/dist/cjs/nv-fieldselect.cjs.entry.js +5 -5
  29. package/dist/cjs/nv-fieldtext.cjs.entry.js +3 -3
  30. package/dist/cjs/nv-fieldtextarea.cjs.entry.js +3 -3
  31. package/dist/cjs/nv-fieldtime.cjs.entry.js +9 -9
  32. package/dist/cjs/nv-icon.cjs.entry.js +1 -1
  33. package/dist/cjs/nv-iconbutton_2.cjs.entry.js +2 -2
  34. package/dist/cjs/nv-menu.cjs.entry.js +16 -42
  35. package/dist/cjs/nv-menu.cjs.entry.js.map +1 -1
  36. package/dist/cjs/nv-menuitem.cjs.entry.js +1 -1
  37. package/dist/cjs/nv-popover.cjs.entry.js +1 -1
  38. package/dist/cjs/nv-row.cjs.entry.js +1 -1
  39. package/dist/cjs/nv-stack.cjs.entry.js +1 -1
  40. package/dist/cjs/nv-stack.cjs.entry.js.map +1 -1
  41. package/dist/cjs/nv-table.cjs.entry.js +2 -2
  42. package/dist/cjs/nv-toggle.cjs.entry.js +2 -2
  43. package/dist/cjs/nv-tooltip.cjs.entry.js +1 -1
  44. package/dist/collection/collection-manifest.json +0 -1
  45. package/dist/collection/components/nv-breadcrumb/nv-breadcrumb.js +1 -1
  46. package/dist/collection/components/nv-breadcrumbs/nv-breadcrumbs.js +1 -1
  47. package/dist/collection/components/nv-button/nv-button.js +1 -1
  48. package/dist/collection/components/nv-calendar/nv-calendar.docs.js +0 -9
  49. package/dist/collection/components/nv-calendar/nv-calendar.docs.js.map +1 -1
  50. package/dist/collection/components/nv-calendar/nv-calendar.js +48 -19
  51. package/dist/collection/components/nv-calendar/nv-calendar.js.map +1 -1
  52. package/dist/collection/components/nv-col/nv-col.js +1 -1
  53. package/dist/collection/components/nv-datagrid/nv-datagrid.docs.js +542 -75
  54. package/dist/collection/components/nv-datagrid/nv-datagrid.docs.js.map +1 -1
  55. package/dist/collection/components/nv-datagrid/nv-datagrid.js +366 -95
  56. package/dist/collection/components/nv-datagrid/nv-datagrid.js.map +1 -1
  57. package/dist/collection/components/nv-datagridcolumn/nv-datagridcolumn.js +1 -1
  58. package/dist/collection/components/nv-dialog/nv-dialog.js +1 -1
  59. package/dist/collection/components/nv-dialogfooter/nv-dialogfooter.js +1 -1
  60. package/dist/collection/components/nv-dialogheader/nv-dialogheader.js +1 -1
  61. package/dist/collection/components/nv-fieldcheckbox/nv-fieldcheckbox.js +4 -4
  62. package/dist/collection/components/nv-fielddate/nv-fielddate.js +5 -5
  63. package/dist/collection/components/nv-fielddaterange/nv-fielddaterange.js +4 -4
  64. package/dist/collection/components/nv-fielddropdown/nv-fielddropdown.docs.js +8 -8
  65. package/dist/collection/components/nv-fielddropdown/nv-fielddropdown.docs.js.map +1 -1
  66. package/dist/collection/components/nv-fielddropdown/nv-fielddropdown.js +22 -39
  67. package/dist/collection/components/nv-fielddropdown/nv-fielddropdown.js.map +1 -1
  68. package/dist/collection/components/nv-fielddropdownitem/nv-fielddropdownitem.js +1 -1
  69. package/dist/collection/components/nv-fielddropdownitemcheck/nv-fielddropdownitemcheck.js +1 -1
  70. package/dist/collection/components/nv-fieldmultiselect/nv-fieldmultiselect.docs.js +6 -6
  71. package/dist/collection/components/nv-fieldmultiselect/nv-fieldmultiselect.docs.js.map +1 -1
  72. package/dist/collection/components/nv-fieldmultiselect/nv-fieldmultiselect.js +35 -85
  73. package/dist/collection/components/nv-fieldmultiselect/nv-fieldmultiselect.js.map +1 -1
  74. package/dist/collection/components/nv-fieldnumber/nv-fieldnumber.js +3 -3
  75. package/dist/collection/components/nv-fieldnumber/nv-fieldnumber.js.map +1 -1
  76. package/dist/collection/components/nv-fieldpassword/nv-fieldpassword.js +3 -3
  77. package/dist/collection/components/nv-fieldradio/nv-fieldradio.js +3 -3
  78. package/dist/collection/components/nv-fieldselect/nv-fieldselect.js +5 -5
  79. package/dist/collection/components/nv-fieldtext/nv-fieldtext.js +3 -3
  80. package/dist/collection/components/nv-fieldtextarea/nv-fieldtextarea.js +3 -3
  81. package/dist/collection/components/nv-fieldtime/nv-fieldtime.js +9 -9
  82. package/dist/collection/components/nv-icon/nv-icon.js +1 -1
  83. package/dist/collection/components/nv-iconbutton/nv-iconbutton.js +1 -1
  84. package/dist/collection/components/nv-loader/nv-loader.js +1 -1
  85. package/dist/collection/components/nv-menu/nv-menu.docs.js +3 -3
  86. package/dist/collection/components/nv-menu/nv-menu.docs.js.map +1 -1
  87. package/dist/collection/components/nv-menu/nv-menu.js +31 -59
  88. package/dist/collection/components/nv-menu/nv-menu.js.map +1 -1
  89. package/dist/collection/components/nv-menuitem/nv-menuitem.js +1 -1
  90. package/dist/collection/components/nv-popover/nv-popover.js +1 -1
  91. package/dist/collection/components/nv-row/nv-row.js +1 -1
  92. package/dist/collection/components/nv-stack/nv-stack.docs.js +7 -6
  93. package/dist/collection/components/nv-stack/nv-stack.docs.js.map +1 -1
  94. package/dist/collection/components/nv-stack/nv-stack.js +1 -1
  95. package/dist/collection/components/nv-stack/nv-stack.js.map +1 -1
  96. package/dist/collection/components/nv-table/nv-table.js +2 -2
  97. package/dist/collection/components/nv-toggle/nv-toggle.js +2 -2
  98. package/dist/collection/components/nv-tooltip/nv-tooltip.js +1 -1
  99. package/dist/components/nv-alert.js +1 -1
  100. package/dist/components/nv-avatar.js +1 -1
  101. package/dist/components/nv-badge.js +1 -1
  102. package/dist/components/nv-breadcrumb.js +3 -3
  103. package/dist/components/nv-breadcrumbs.js +1 -1
  104. package/dist/components/nv-button.js +1 -1
  105. package/dist/components/nv-calendar.js +1 -1
  106. package/dist/components/nv-col.js +1 -1
  107. package/dist/components/nv-datagrid.js +359 -94
  108. package/dist/components/nv-datagrid.js.map +1 -1
  109. package/dist/components/nv-datagridcolumn.js +1 -1
  110. package/dist/components/nv-dialog.js +6 -6
  111. package/dist/components/nv-dialogfooter.js +1 -1
  112. package/dist/components/nv-dialogheader.js +1 -1
  113. package/dist/components/nv-fieldcheckbox.js +1 -1
  114. package/dist/components/nv-fielddate.js +12 -12
  115. package/dist/components/nv-fielddaterange.js +11 -11
  116. package/dist/components/nv-fielddropdown.js +21 -36
  117. package/dist/components/nv-fielddropdown.js.map +1 -1
  118. package/dist/components/nv-fielddropdownitem.js +1 -1
  119. package/dist/components/nv-fielddropdownitemcheck.js +1 -1
  120. package/dist/components/nv-fieldmultiselect.js +36 -81
  121. package/dist/components/nv-fieldmultiselect.js.map +1 -1
  122. package/dist/components/nv-fieldnumber.js +6 -6
  123. package/dist/components/nv-fieldnumber.js.map +1 -1
  124. package/dist/components/nv-fieldpassword.js +6 -6
  125. package/dist/components/nv-fieldradio.js +3 -3
  126. package/dist/components/nv-fieldselect.js +8 -8
  127. package/dist/components/nv-fieldtext.js +4 -4
  128. package/dist/components/nv-fieldtextarea.js +3 -3
  129. package/dist/components/nv-fieldtime.js +13 -13
  130. package/dist/components/nv-icon.js +1 -1
  131. package/dist/components/nv-iconbutton.js +1 -1
  132. package/dist/components/nv-loader.js +1 -1
  133. package/dist/components/nv-menu.js +21 -50
  134. package/dist/components/nv-menu.js.map +1 -1
  135. package/dist/components/nv-menuitem.js +1 -1
  136. package/dist/components/nv-popover.js +1 -1
  137. package/dist/components/nv-row.js +1 -1
  138. package/dist/components/nv-stack.js +1 -1
  139. package/dist/components/nv-stack.js.map +1 -1
  140. package/dist/components/nv-table.js +2 -2
  141. package/dist/components/nv-toggle.js +2 -2
  142. package/dist/components/nv-tooltip.js +1 -1
  143. package/dist/components/{p-d88ced51.js → p-02752770.js} +2 -2
  144. package/dist/components/{p-d88ced51.js.map → p-02752770.js.map} +1 -1
  145. package/dist/components/{p-7b89fb48.js → p-150daf68.js} +2 -2
  146. package/dist/components/{p-7b89fb48.js.map → p-150daf68.js.map} +1 -1
  147. package/dist/components/{p-56ef8131.js → p-2012b8ba.js} +3 -3
  148. package/dist/components/{p-56ef8131.js.map → p-2012b8ba.js.map} +1 -1
  149. package/dist/components/{p-8674c7af.js → p-2d9ba7d3.js} +3 -3
  150. package/dist/components/{p-8674c7af.js.map → p-2d9ba7d3.js.map} +1 -1
  151. package/dist/components/{p-5a5f11c2.js → p-373926aa.js} +2 -2
  152. package/dist/components/{p-5a5f11c2.js.map → p-373926aa.js.map} +1 -1
  153. package/dist/components/{p-dcabc6fa.js → p-4d3ec142.js} +3 -3
  154. package/dist/components/{p-dcabc6fa.js.map → p-4d3ec142.js.map} +1 -1
  155. package/dist/components/{p-91b58443.js → p-591730e7.js} +2 -2
  156. package/dist/components/{p-91b58443.js.map → p-591730e7.js.map} +1 -1
  157. package/dist/components/{p-b4768da6.js → p-6c364a23.js} +5 -5
  158. package/dist/components/{p-b4768da6.js.map → p-6c364a23.js.map} +1 -1
  159. package/dist/components/{p-f469df15.js → p-a30b55fc.js} +2 -2
  160. package/dist/components/{p-f469df15.js.map → p-a30b55fc.js.map} +1 -1
  161. package/dist/components/{p-664c5a14.js → p-b7b78e64.js} +2 -2
  162. package/dist/components/{p-664c5a14.js.map → p-b7b78e64.js.map} +1 -1
  163. package/dist/components/{p-8c5a861b.js → p-c14f6b8e.js} +3 -3
  164. package/dist/components/{p-8c5a861b.js.map → p-c14f6b8e.js.map} +1 -1
  165. package/dist/components/{p-a9e1bf70.js → p-dc3faba3.js} +4 -4
  166. package/dist/components/{p-a9e1bf70.js.map → p-dc3faba3.js.map} +1 -1
  167. package/dist/components/{p-9d6aaf76.js → p-e00cbb8a.js} +5 -5
  168. package/dist/components/{p-9d6aaf76.js.map → p-e00cbb8a.js.map} +1 -1
  169. package/dist/components/{p-a9f162a8.js → p-f331117c.js} +53 -24
  170. package/dist/components/p-f331117c.js.map +1 -0
  171. package/dist/components/{p-18bc0291.js → p-f4d86795.js} +3 -3
  172. package/dist/components/{p-18bc0291.js.map → p-f4d86795.js.map} +1 -1
  173. package/dist/esm/index-1fb7a9a6.js +0 -4
  174. package/dist/esm/loader.js +1 -1
  175. package/dist/esm/native.js +1 -1
  176. package/dist/esm/nv-badge_2.entry.js +1 -1
  177. package/dist/esm/nv-breadcrumb.entry.js +1 -1
  178. package/dist/esm/nv-breadcrumbs.entry.js +1 -1
  179. package/dist/esm/nv-button.entry.js +1 -1
  180. package/dist/esm/nv-calendar.entry.js +48 -19
  181. package/dist/esm/nv-calendar.entry.js.map +1 -1
  182. package/dist/esm/nv-col.entry.js +1 -1
  183. package/dist/esm/nv-datagrid.entry.js +351 -91
  184. package/dist/esm/nv-datagrid.entry.js.map +1 -1
  185. package/dist/esm/nv-datagridcolumn.entry.js +1 -1
  186. package/dist/esm/nv-dialog.entry.js +1 -1
  187. package/dist/esm/nv-dialogfooter_2.entry.js +2 -2
  188. package/dist/esm/nv-fieldcheckbox.entry.js +4 -4
  189. package/dist/esm/nv-fielddate.entry.js +5 -5
  190. package/dist/esm/nv-fielddaterange.entry.js +4 -4
  191. package/dist/esm/nv-fielddropdown.entry.js +15 -29
  192. package/dist/esm/nv-fielddropdown.entry.js.map +1 -1
  193. package/dist/esm/nv-fielddropdownitem.entry.js +1 -1
  194. package/dist/esm/nv-fieldmultiselect.entry.js +28 -71
  195. package/dist/esm/nv-fieldmultiselect.entry.js.map +1 -1
  196. package/dist/esm/nv-fieldnumber.entry.js +3 -3
  197. package/dist/esm/nv-fieldnumber.entry.js.map +1 -1
  198. package/dist/esm/nv-fieldpassword.entry.js +3 -3
  199. package/dist/esm/nv-fieldradio.entry.js +3 -3
  200. package/dist/esm/nv-fieldselect.entry.js +5 -5
  201. package/dist/esm/nv-fieldtext.entry.js +3 -3
  202. package/dist/esm/nv-fieldtextarea.entry.js +3 -3
  203. package/dist/esm/nv-fieldtime.entry.js +9 -9
  204. package/dist/esm/nv-icon.entry.js +1 -1
  205. package/dist/esm/nv-iconbutton_2.entry.js +2 -2
  206. package/dist/esm/nv-menu.entry.js +16 -42
  207. package/dist/esm/nv-menu.entry.js.map +1 -1
  208. package/dist/esm/nv-menuitem.entry.js +1 -1
  209. package/dist/esm/nv-popover.entry.js +1 -1
  210. package/dist/esm/nv-row.entry.js +1 -1
  211. package/dist/esm/nv-stack.entry.js +1 -1
  212. package/dist/esm/nv-stack.entry.js.map +1 -1
  213. package/dist/esm/nv-table.entry.js +2 -2
  214. package/dist/esm/nv-toggle.entry.js +2 -2
  215. package/dist/esm/nv-tooltip.entry.js +1 -1
  216. package/dist/native/native.esm.js +1 -1
  217. package/dist/native/native.esm.js.map +1 -1
  218. package/dist/native/p-0245863d.entry.js +2 -0
  219. package/dist/native/{p-8946883b.entry.js → p-0ee428d5.entry.js} +2 -2
  220. package/dist/native/{p-8f7c1bb8.entry.js → p-244f56ac.entry.js} +2 -2
  221. package/dist/native/p-2691e02d.entry.js +2 -0
  222. package/dist/native/{p-aeac63ea.entry.js → p-37f0210e.entry.js} +2 -2
  223. package/dist/native/{p-000ef9c9.entry.js → p-39bb95ff.entry.js} +2 -2
  224. package/dist/native/{p-76cd466a.entry.js → p-4ae26462.entry.js} +2 -2
  225. package/dist/native/{p-75f4bfe8.entry.js → p-4d9c4618.entry.js} +2 -2
  226. package/dist/native/p-4d9c4618.entry.js.map +1 -0
  227. package/dist/native/{p-d4e48d08.entry.js → p-59e0bd2b.entry.js} +2 -2
  228. package/dist/native/{p-d4e48d08.entry.js.map → p-59e0bd2b.entry.js.map} +1 -1
  229. package/dist/native/{p-626a1372.entry.js → p-5c00f092.entry.js} +2 -2
  230. package/dist/native/p-63e6aed3.entry.js +2 -0
  231. package/dist/native/p-63e6aed3.entry.js.map +1 -0
  232. package/dist/native/{p-4fe5ebe9.entry.js → p-6b348684.entry.js} +2 -2
  233. package/dist/native/{p-aa957898.entry.js → p-6ff228da.entry.js} +2 -2
  234. package/dist/native/{p-aa957898.entry.js.map → p-6ff228da.entry.js.map} +1 -1
  235. package/dist/native/{p-74f7f404.entry.js → p-701b5557.entry.js} +2 -2
  236. package/dist/native/{p-002e7bf1.entry.js → p-7f5eb2ac.entry.js} +2 -2
  237. package/dist/native/{p-e4f84faa.entry.js → p-84a73e2a.entry.js} +2 -2
  238. package/dist/native/p-9135fdf5.entry.js +2 -0
  239. package/dist/native/p-93dc2f47.entry.js +2 -0
  240. package/dist/native/{p-7e1fa44c.entry.js.map → p-93dc2f47.entry.js.map} +1 -1
  241. package/dist/native/{p-be5f62e5.entry.js → p-9a267f16.entry.js} +2 -2
  242. package/dist/native/p-9a267f16.entry.js.map +1 -0
  243. package/dist/native/{p-60d6ffa3.entry.js → p-9d6431c7.entry.js} +2 -2
  244. package/dist/native/{p-b11fdaed.entry.js → p-b094296d.entry.js} +2 -2
  245. package/dist/native/{p-43cc98dc.entry.js → p-b2ce83ad.entry.js} +2 -2
  246. package/dist/native/{p-115ad66c.entry.js → p-bad11367.entry.js} +2 -2
  247. package/dist/native/{p-6603d939.entry.js → p-c7b201cd.entry.js} +2 -2
  248. package/dist/native/{p-4c859a14.entry.js → p-d7a76400.entry.js} +2 -2
  249. package/dist/native/p-e1a4f776.entry.js +2 -0
  250. package/dist/native/p-e1a4f776.entry.js.map +1 -0
  251. package/dist/native/p-e49bbd02.entry.js +2 -0
  252. package/dist/native/p-e49bbd02.entry.js.map +1 -0
  253. package/dist/native/{p-98030346.entry.js → p-e5de64d5.entry.js} +2 -2
  254. package/dist/native/p-eee01062.entry.js +2 -0
  255. package/dist/native/{p-3df6febe.entry.js.map → p-eee01062.entry.js.map} +1 -1
  256. package/dist/native/{p-b6164ebc.entry.js → p-f6bdc270.entry.js} +2 -2
  257. package/dist/native/{p-50dcce07.entry.js → p-f85aca27.entry.js} +2 -2
  258. package/dist/native/{p-1e5453be.entry.js → p-fa77a591.entry.js} +2 -2
  259. package/dist/native/{p-d5158e27.entry.js → p-fb5bddba.entry.js} +2 -2
  260. package/dist/types/components/nv-calendar/nv-calendar.d.ts +10 -7
  261. package/dist/types/components/nv-datagrid/nv-datagrid.d.ts +37 -2
  262. package/dist/types/components/nv-fielddropdown/nv-fielddropdown.d.ts +16 -20
  263. package/dist/types/components/nv-fieldmultiselect/nv-fieldmultiselect.d.ts +16 -34
  264. package/dist/types/components/nv-menu/nv-menu.d.ts +46 -12
  265. package/dist/types/components.d.ts +174 -43
  266. package/dist/vscode-data.json +8 -20
  267. package/hydrate/index.js +535 -407
  268. package/hydrate/index.mjs +535 -407
  269. package/package.json +3 -2
  270. package/dist/cjs/nv-base.cjs.entry.js +0 -74
  271. package/dist/cjs/nv-base.cjs.entry.js.map +0 -1
  272. package/dist/collection/components/nv-base/nv-base.docs.js +0 -5
  273. package/dist/collection/components/nv-base/nv-base.docs.js.map +0 -1
  274. package/dist/collection/components/nv-base/nv-base.js +0 -68
  275. package/dist/collection/components/nv-base/nv-base.js.map +0 -1
  276. package/dist/components/nv-base.d.ts +0 -11
  277. package/dist/components/nv-base.js +0 -88
  278. package/dist/components/nv-base.js.map +0 -1
  279. package/dist/components/p-a9f162a8.js.map +0 -1
  280. package/dist/esm/nv-base.entry.js +0 -70
  281. package/dist/esm/nv-base.entry.js.map +0 -1
  282. package/dist/native/p-2ed9934a.entry.js +0 -2
  283. package/dist/native/p-2ed9934a.entry.js.map +0 -1
  284. package/dist/native/p-3df6febe.entry.js +0 -2
  285. package/dist/native/p-4977fcd0.entry.js +0 -2
  286. package/dist/native/p-75f4bfe8.entry.js.map +0 -1
  287. package/dist/native/p-7e1fa44c.entry.js +0 -2
  288. package/dist/native/p-b8b58064.entry.js +0 -2
  289. package/dist/native/p-be5f62e5.entry.js.map +0 -1
  290. package/dist/native/p-c6fe73a9.entry.js +0 -2
  291. package/dist/native/p-c6fe73a9.entry.js.map +0 -1
  292. package/dist/native/p-ce64d562.entry.js +0 -2
  293. package/dist/native/p-d352a8b3.entry.js +0 -2
  294. package/dist/native/p-d352a8b3.entry.js.map +0 -1
  295. package/dist/native/p-e200185a.entry.js +0 -2
  296. package/dist/native/p-e200185a.entry.js.map +0 -1
  297. package/dist/types/components/nv-base/nv-base.d.ts +0 -17
  298. package/dist/types/components/nv-base/nv-base.docs.d.ts +0 -5
  299. /package/dist/native/{p-ce64d562.entry.js.map → p-0245863d.entry.js.map} +0 -0
  300. /package/dist/native/{p-8946883b.entry.js.map → p-0ee428d5.entry.js.map} +0 -0
  301. /package/dist/native/{p-8f7c1bb8.entry.js.map → p-244f56ac.entry.js.map} +0 -0
  302. /package/dist/native/{p-4977fcd0.entry.js.map → p-2691e02d.entry.js.map} +0 -0
  303. /package/dist/native/{p-aeac63ea.entry.js.map → p-37f0210e.entry.js.map} +0 -0
  304. /package/dist/native/{p-000ef9c9.entry.js.map → p-39bb95ff.entry.js.map} +0 -0
  305. /package/dist/native/{p-76cd466a.entry.js.map → p-4ae26462.entry.js.map} +0 -0
  306. /package/dist/native/{p-626a1372.entry.js.map → p-5c00f092.entry.js.map} +0 -0
  307. /package/dist/native/{p-4fe5ebe9.entry.js.map → p-6b348684.entry.js.map} +0 -0
  308. /package/dist/native/{p-74f7f404.entry.js.map → p-701b5557.entry.js.map} +0 -0
  309. /package/dist/native/{p-002e7bf1.entry.js.map → p-7f5eb2ac.entry.js.map} +0 -0
  310. /package/dist/native/{p-e4f84faa.entry.js.map → p-84a73e2a.entry.js.map} +0 -0
  311. /package/dist/native/{p-b8b58064.entry.js.map → p-9135fdf5.entry.js.map} +0 -0
  312. /package/dist/native/{p-60d6ffa3.entry.js.map → p-9d6431c7.entry.js.map} +0 -0
  313. /package/dist/native/{p-b11fdaed.entry.js.map → p-b094296d.entry.js.map} +0 -0
  314. /package/dist/native/{p-43cc98dc.entry.js.map → p-b2ce83ad.entry.js.map} +0 -0
  315. /package/dist/native/{p-115ad66c.entry.js.map → p-bad11367.entry.js.map} +0 -0
  316. /package/dist/native/{p-6603d939.entry.js.map → p-c7b201cd.entry.js.map} +0 -0
  317. /package/dist/native/{p-4c859a14.entry.js.map → p-d7a76400.entry.js.map} +0 -0
  318. /package/dist/native/{p-98030346.entry.js.map → p-e5de64d5.entry.js.map} +0 -0
  319. /package/dist/native/{p-b6164ebc.entry.js.map → p-f6bdc270.entry.js.map} +0 -0
  320. /package/dist/native/{p-50dcce07.entry.js.map → p-f85aca27.entry.js.map} +0 -0
  321. /package/dist/native/{p-1e5453be.entry.js.map → p-fa77a591.entry.js.map} +0 -0
  322. /package/dist/native/{p-d5158e27.entry.js.map → p-fb5bddba.entry.js.map} +0 -0
@@ -1,6 +1,6 @@
1
1
  /* eslint-disable @typescript-eslint/no-explicit-any */
2
2
  import { h, Host, } from "@stencil/core";
3
- import { createTable, getCoreRowModel, createColumnHelper, getFilteredRowModel, } from "@tanstack/table-core";
3
+ import { createTable, getCoreRowModel, createColumnHelper, getFilteredRowModel, getPaginationRowModel, } from "@tanstack/table-core";
4
4
  import { deepCopyElement, excludedProps } from "../../utils/dom.utils";
5
5
  import { debounce } from "../../utils/input.utils";
6
6
  /**
@@ -16,13 +16,15 @@ export class NvDatagrid {
16
16
  constructor() {
17
17
  this.templateCache = new Map();
18
18
  this.headerTemplateCache = new Map();
19
+ this.minPageIndex = 1;
19
20
  /****************************************************************************/
20
21
  //#region STATES
21
22
  this.table = null;
22
23
  this.parsedColumns = []; // Parsed array
23
24
  this.parsedData = []; // Parsed array
24
- this.globalFilter = '';
25
+ this.globalFilterSearchTerm = '';
25
26
  this.columnData = [];
27
+ this.paginationState = null;
26
28
  //#endregion STATES
27
29
  /****************************************************************************/
28
30
  //#region PROPERTIES
@@ -72,8 +74,24 @@ export class NvDatagrid {
72
74
  * @default false
73
75
  */
74
76
  this.autoGenerateColumns = false;
77
+ /**
78
+ * Whether to enable pagination for the data grid.
79
+ * @default false
80
+ */
81
+ this.enablePagination = false;
82
+ /**
83
+ * The number of rows to display per page.
84
+ * @default 10
85
+ */
86
+ this.pageSize = 10;
87
+ /**
88
+ * The array of page sizes to display in the pagination dropdown.
89
+ * @default [10, 20, 30, 40, 50]
90
+ */
91
+ this.pageSizes = [10, 20, 30, 40, 50];
75
92
  this.debouncedFilter = debounce((value) => {
76
- this.globalFilter = value;
93
+ var _a;
94
+ (_a = this.table) === null || _a === void 0 ? void 0 : _a.setGlobalFilter(value);
77
95
  }, 300);
78
96
  /**
79
97
  * Handles global filtering on input event for the search input.
@@ -89,6 +107,23 @@ export class NvDatagrid {
89
107
  this.debouncedFilter(value);
90
108
  }
91
109
  };
110
+ this.flexRender = (comp, props) => {
111
+ if (typeof comp === 'function') {
112
+ return comp(props);
113
+ }
114
+ return comp;
115
+ };
116
+ this.handlePageIndexChange = (event) => {
117
+ const target = event.target;
118
+ const page = target.value ? Number(target.value) - 1 : 0;
119
+ // Simply use `setPageIndex` to update the page index directly
120
+ this.paginationState = Object.assign(Object.assign({}, this.paginationState), { pageIndex: page }); // This triggers the paginationState watcher
121
+ };
122
+ this.handlePageSizeChange = (event) => {
123
+ const target = event.target;
124
+ // 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
126
+ };
92
127
  }
93
128
  //#endregion PROPERTIES
94
129
  /****************************************************************************/
@@ -190,6 +225,7 @@ export class NvDatagrid {
190
225
  this.parsedColumns = safeNewValue;
191
226
  }
192
227
  initializeTable() {
228
+ var _a, _b, _c, _d;
193
229
  // Clear the previous table instance (if any)
194
230
  this.table = null;
195
231
  // Set default options for the table
@@ -223,26 +259,9 @@ export class NvDatagrid {
223
259
  }, // Default: no column sizing info
224
260
  },
225
261
  };
226
- if (this.enableGlobalFilter) {
227
- tableOptions.getFilteredRowModel = getFilteredRowModel();
228
- // Set the initial global filter value
229
- tableOptions.state.globalFilter = this.globalFilter;
230
- // Define the callback for global filter changes
231
- tableOptions.onGlobalFilterChange = value => {
232
- this.globalFilter = value;
233
- };
234
- tableOptions.globalFilterFn = (row, columnId, filterValue) => {
235
- const response = row
236
- .getValue(columnId)
237
- .toString()
238
- .toLowerCase()
239
- .includes(filterValue.toLowerCase());
240
- return response;
241
- };
242
- }
243
262
  if (this.parsedColumns.length > 0) {
244
263
  // Validate and generate column definitions
245
- const validColumns = this.parsedColumns.filter(column => (column === null || column === void 0 ? void 0 : column.accessor) && (column === null || column === void 0 ? void 0 : column.header));
264
+ const validColumns = this.parsedColumns.filter(column => column === null || column === void 0 ? void 0 : column.accessor);
246
265
  // Update tableOptions based on parsed data and columns
247
266
  const hasColumns = validColumns && Array.isArray(validColumns) && validColumns.length > 0;
248
267
  const hasData = this.parsedData &&
@@ -252,22 +271,22 @@ export class NvDatagrid {
252
271
  // No columns and no data
253
272
  }
254
273
  else if (hasColumns && !hasData) {
274
+ // Has columns but no data
255
275
  tableOptions.columns = this.generateColumns(validColumns, tableOptions);
256
276
  }
257
277
  else {
258
278
  // Both columns and data are available
259
- // No columns and data is available
260
279
  tableOptions.data = this.getTableData();
261
280
  tableOptions.columns = this.generateColumns(validColumns, tableOptions);
262
281
  }
263
282
  }
264
283
  else {
265
- // No columns and data is available
284
+ // No parsed columns and data is available
266
285
  const hasData = this.parsedData &&
267
286
  Array.isArray(this.parsedData) &&
268
287
  this.parsedData.length > 0;
269
288
  if (hasData) {
270
- // No columns and data is available
289
+ // No parsed columns and data is available
271
290
  const firstRow = this.parsedData[0];
272
291
  const arrayColumnsConfig = Object.keys(firstRow).map(key => ({
273
292
  accessor: key,
@@ -280,26 +299,116 @@ export class NvDatagrid {
280
299
  tableOptions.columns = this.generateColumns(arrayColumnsConfig, tableOptions);
281
300
  }
282
301
  }
302
+ if (this.enableGlobalFilter) {
303
+ tableOptions.getFilteredRowModel = getFilteredRowModel();
304
+ const globalFilter = this.globalFilterSearchTerm;
305
+ // Set the initial global filter value
306
+ tableOptions.state.globalFilter = globalFilter;
307
+ // Define the callback for global filter changes
308
+ tableOptions.onGlobalFilterChange = updater => {
309
+ const newFilter = typeof updater === 'function'
310
+ ? updater(this.globalFilterSearchTerm)
311
+ : updater;
312
+ this.globalFilterSearchTerm = newFilter; // Will automatically trigger the searchTerm watcher and update the table
313
+ };
314
+ tableOptions.globalFilterFn = this.globalFilterFn;
315
+ }
316
+ if (this.enablePagination) {
317
+ tableOptions.getPaginationRowModel = getPaginationRowModel();
318
+ 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,
321
+ };
322
+ // Set the initial pagination value with safeguards
323
+ tableOptions.state.pagination = pagination;
324
+ tableOptions.onPaginationChange = updater => {
325
+ const newPagination = typeof updater === 'function'
326
+ ? updater(this.paginationState)
327
+ : updater;
328
+ this.paginationState = newPagination;
329
+ };
330
+ }
283
331
  // Initialize the table
284
332
  this.table = createTable(tableOptions);
285
333
  }
334
+ /**
335
+ * Global filter function for the table.
336
+ * This function checks if the specified filter value is present in any of the row's original values,
337
+ * including nested objects and arrays. It is used to filter the rows based on the global filter value,
338
+ * allowing for case-insensitive matching.
339
+ *
340
+ * @param {Row<any>} row - The row object containing the data to be filtered.
341
+ * @param {string} _columnId - The ID of the column being filtered (not used in this function).
342
+ * @param {string} filterValue - The value to filter the rows by. This value is checked against the row's data.
343
+ * @returns {boolean} - Returns true if the row should be included in the filtered results, false otherwise.
344
+ * If the filter value is empty, all rows are included.
345
+ */
346
+ globalFilterFn(row, _columnId, filterValue) {
347
+ const safeFilterValue = String(filterValue).toLowerCase().trim();
348
+ // If no filter value, return true for all rows
349
+ if (!safeFilterValue)
350
+ return true;
351
+ // More robust filtering across all columns
352
+ const checkValue = (value) => {
353
+ if (typeof value === 'object' && value !== null) {
354
+ // If it's an array, check each item
355
+ if (Array.isArray(value)) {
356
+ return value.some(item => checkValue(item));
357
+ }
358
+ // If it's an object, check each property
359
+ return Object.values(value).some(val => checkValue(val));
360
+ }
361
+ return String(value).toLowerCase().includes(safeFilterValue);
362
+ };
363
+ return checkValue(row.original);
364
+ }
286
365
  // Helper function to generate column definitions
287
366
  generateColumns(validColumns, tableOptions) {
288
367
  const columnHelper = createColumnHelper();
289
368
  if (validColumns.length > 0) {
290
369
  // Use defined columns
291
- return validColumns.map(column => columnHelper.accessor(column.accessor, {
292
- header: column.header,
293
- cell: info => info.getValue(),
294
- enableGlobalFilter: this.enableGlobalFilter,
295
- }));
370
+ return validColumns.map(column => {
371
+ var _a, _b;
372
+ return columnHelper.accessor(column.accessor, {
373
+ header: (_b = (this.renderTemplate(this.headerTemplateCache.get(column.accessor), (_a = column.header) !== null && _a !== void 0 ? _a : column.accessor, null) ||
374
+ column.header)) !== null && _b !== void 0 ? _b : column.accessor,
375
+ cell: (info) => {
376
+ var _a, _b, _c;
377
+ const value = info.getValue();
378
+ const cellAccessors = column.accessor;
379
+ const row = info.row;
380
+ return ((_a = this.columnData.find(x => x.accessor === cellAccessors)) === null || _a === void 0 ? void 0 : _a.repeatTemplate) && Array.isArray(value)
381
+ ? value.map((item) => {
382
+ var _a, _b;
383
+ return (_b = (_a = (this.renderTemplate(this.templateCache.get(cellAccessors), item, row) ||
384
+ item)) !== null && _a !== void 0 ? _a : value) !== null && _b !== void 0 ? _b : this.fallbackValue;
385
+ })
386
+ : (_c = (_b = (this.renderTemplate(this.templateCache.get(cellAccessors), value, row) ||
387
+ value)) !== null && _b !== void 0 ? _b : value) !== null && _c !== void 0 ? _c : this.fallbackValue;
388
+ },
389
+ enableGlobalFilter: this.enableGlobalFilter,
390
+ });
391
+ });
296
392
  }
297
393
  else if (tableOptions.data && tableOptions.data.length > 0) {
298
394
  // Generate columns from data keys
299
395
  const sampleRow = tableOptions.data[0];
300
396
  return Object.keys(sampleRow).map(key => columnHelper.accessor(key, {
301
- header: key.charAt(0).toUpperCase() + key.slice(1), // Capitalize key for header
302
- cell: info => info.getValue(),
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
+ },
303
412
  enableGlobalFilter: this.enableGlobalFilter,
304
413
  }));
305
414
  }
@@ -328,11 +437,11 @@ export class NvDatagrid {
328
437
  // Replace placeholders in text content, attributes, and properties
329
438
  element.querySelectorAll('*').forEach(el => {
330
439
  // Replace placeholders in text content
331
- this.replacePlaceholdersTextContent(el, cellValue);
440
+ this.replacePlaceholdersTextContent(el, cellValue, row);
332
441
  // Replace placeholders in attributes
333
- this.replacePlaceholdersAttributes(el, cellValue);
442
+ this.replacePlaceholdersAttributes(el, cellValue, row);
334
443
  // Replace placeholders in properties
335
- this.replacePlaceholdersProperties(el, cellValue);
444
+ this.replacePlaceholdersProperties(el, cellValue, row);
336
445
  });
337
446
  // Handle `data-bind-event`
338
447
  element.querySelectorAll('[data-bind-event]').forEach(el => {
@@ -431,51 +540,128 @@ export class NvDatagrid {
431
540
  // If cellValue is a primitive (string, number, boolean, etc.), return it as a string
432
541
  return (_a = cellValue === null || cellValue === void 0 ? void 0 : cellValue.toString()) !== null && _a !== void 0 ? _a : this.fallbackValue;
433
542
  }
434
- replacePlaceholdersTextContent(element, cellValue) {
435
- // Replace placeholders in text content
436
- element.childNodes.forEach(node => {
437
- if (node.nodeType === Node.TEXT_NODE) {
438
- node.textContent = node.textContent.replace(/__([\w.]+)__/g, (_, key) => this.replaceKeyWithValue(key, cellValue));
439
- }
440
- });
543
+ replacePlaceholdersTextContent(element, cellValue, row) {
544
+ if (!cellValue) {
545
+ // Replace placeholders in text content with the row original value
546
+ // but first get the original value
547
+ const originalValue = row.original;
548
+ element.childNodes.forEach(node => {
549
+ if (node.nodeType === Node.TEXT_NODE) {
550
+ node.textContent = node.textContent.replace(/__([\w.]+)__/g, (_, key) => {
551
+ if (key in originalValue) {
552
+ return this.replaceKeyWithValue(key, originalValue[key]);
553
+ }
554
+ else {
555
+ console.warn(`Key ${key} not found in originalValue`);
556
+ return '';
557
+ }
558
+ });
559
+ }
560
+ });
561
+ }
562
+ else {
563
+ // ✅ Replace placeholders in text content
564
+ element.childNodes.forEach(node => {
565
+ if (node.nodeType === Node.TEXT_NODE) {
566
+ node.textContent = node.textContent.replace(/__([\w.]+)__/g, (_, key) => this.replaceKeyWithValue(key, cellValue));
567
+ }
568
+ });
569
+ }
441
570
  }
442
- replacePlaceholdersAttributes(element, cellValue) {
443
- // Replace placeholders in attributes
444
- Array.from(element.attributes).forEach(attr => {
445
- if (attr.value.includes('__')) {
446
- attr.value = attr.value.replace(/__([\w.]+)__/g, (_, key) => this.replaceKeyWithValue(key, cellValue));
447
- }
448
- });
571
+ replacePlaceholdersAttributes(element, cellValue, row) {
572
+ if (!cellValue) {
573
+ // ✅ Replace placeholders in attributes with the row original value
574
+ // but first get the original value
575
+ const originalValue = row.original;
576
+ Array.from(element.attributes).forEach(attr => {
577
+ if (attr.value.includes('__')) {
578
+ attr.value = attr.value.replace(/__([\w.]+)__/g, (_, key) => {
579
+ if (key in originalValue) {
580
+ return this.replaceKeyWithValue(key, originalValue[key]);
581
+ }
582
+ else {
583
+ console.warn(`Key ${key} not found in originalValue`);
584
+ return '';
585
+ }
586
+ });
587
+ }
588
+ });
589
+ }
590
+ else {
591
+ // ✅ Replace placeholders in attributes
592
+ Array.from(element.attributes).forEach(attr => {
593
+ if (attr.value.includes('__')) {
594
+ attr.value = attr.value.replace(/__([\w.]+)__/g, (_, key) => this.replaceKeyWithValue(key, cellValue));
595
+ }
596
+ });
597
+ }
449
598
  }
450
- replacePlaceholdersProperties(element, cellValue) {
451
- // Dynamically extract relevant properties
452
- const properties = new Set();
453
- // Collect only own enumerable properties
454
- Object.keys(element).forEach(key => properties.add(key));
455
- // Collect inherited properties from prototypes (HTMLElement -> Element -> Node)
456
- let proto = Object.getPrototypeOf(element);
457
- while (proto && proto !== HTMLElement.prototype) {
458
- Object.keys(proto).forEach(key => properties.add(key));
459
- proto = Object.getPrototypeOf(proto);
460
- }
461
- // Filter and copy only non-function properties and exclude irrelevant ones
462
- properties.forEach(prop => {
463
- if (typeof element[prop] !== 'function' && // Ignore methods
464
- !prop.startsWith('on') && // Ignore event listeners (onclick, oninput, etc.)
465
- !excludedProps.has(prop) // 🚨 Prevent text duplication and irrelevant props
466
- ) {
467
- try {
599
+ replacePlaceholdersProperties(element, cellValue, row) {
600
+ if (!cellValue) {
601
+ // ✅ Replace placeholders in properties with the row original value
602
+ // but first get the original value
603
+ const originalValue = row.original;
604
+ // Dynamically extract relevant properties
605
+ const properties = new Set();
606
+ // Collect only own enumerable properties
607
+ Object.keys(originalValue).forEach(key => properties.add(key));
608
+ // Collect inherited properties from prototypes (HTMLElement -> Element -> Node)
609
+ let proto = Object.getPrototypeOf(originalValue);
610
+ while (proto && proto !== HTMLElement.prototype) {
611
+ Object.keys(proto).forEach(key => properties.add(key));
612
+ proto = Object.getPrototypeOf(proto);
613
+ }
614
+ // Filter and copy only non-function properties and exclude irrelevant ones
615
+ properties.forEach(prop => {
616
+ if (typeof element[prop] !== 'function' && // Ignore methods
617
+ !prop.startsWith('on') && // Ignore event listeners (onclick, oninput, etc.)
618
+ !excludedProps.has(prop) // 🚨 Prevent text duplication and irrelevant props
619
+ ) {
468
620
  const propValue = element[prop];
469
- // ✅ Replace placeholders only if the value is a string
470
621
  if (typeof propValue === 'string' && propValue.includes('__')) {
471
- element[prop] = propValue.replace(/__([\w.]+)__/g, (_, key) => this.replaceKeyWithValue(key, cellValue)); // ✅ TypeScript safe
622
+ element[prop] = propValue.replace(/__([\w.]+)__/g, (_, key) => {
623
+ if (key in originalValue) {
624
+ return this.replaceKeyWithValue(key, originalValue[key]);
625
+ }
626
+ else {
627
+ console.warn(`Key ${key} not found in originalValue`);
628
+ return '';
629
+ }
630
+ });
472
631
  }
473
632
  }
474
- catch (error) {
475
- console.warn(`Could not assign property ${prop}:`, error.message);
476
- }
633
+ });
634
+ }
635
+ else {
636
+ // ✅ Dynamically extract relevant properties
637
+ const properties = new Set();
638
+ // Collect only own enumerable properties
639
+ Object.keys(element).forEach(key => properties.add(key));
640
+ // Collect inherited properties from prototypes (HTMLElement -> Element -> Node)
641
+ let proto = Object.getPrototypeOf(element);
642
+ while (proto && proto !== HTMLElement.prototype) {
643
+ Object.keys(proto).forEach(key => properties.add(key));
644
+ proto = Object.getPrototypeOf(proto);
477
645
  }
478
- });
646
+ // ✅ Filter and copy only non-function properties and exclude irrelevant ones
647
+ properties.forEach(prop => {
648
+ if (typeof element[prop] !== 'function' && // Ignore methods
649
+ !prop.startsWith('on') && // Ignore event listeners (onclick, oninput, etc.)
650
+ !excludedProps.has(prop) // 🚨 Prevent text duplication and irrelevant props
651
+ ) {
652
+ try {
653
+ const propValue = element[prop];
654
+ // ✅ Replace placeholders only if the value is a string
655
+ if (typeof propValue === 'string' && propValue.includes('__')) {
656
+ element[prop] = propValue.replace(/__([\w.]+)__/g, (_, key) => this.replaceKeyWithValue(key, cellValue)); // ✅ TypeScript safe
657
+ }
658
+ }
659
+ catch (error) {
660
+ console.warn(`Could not assign property ${prop}:`, error.message);
661
+ }
662
+ }
663
+ });
664
+ }
479
665
  }
480
666
  //#endregion METHODS
481
667
  /****************************************************************************/
@@ -509,14 +695,30 @@ export class NvDatagrid {
509
695
  handleParsedChange() {
510
696
  this.initializeTable();
511
697
  }
512
- handleGlobalFilter(newValue) {
698
+ handleGlobalFilterSearchTerm(newValue) {
513
699
  if (!this.table) {
514
700
  console.warn('Table is not initialized yet.');
515
701
  return;
516
702
  }
517
- // 🚨 Manually update state before calling filter
518
- this.table.options.state = Object.assign(Object.assign({}, this.table.options.state), { globalFilter: newValue });
519
- this.table.setGlobalFilter(newValue);
703
+ // Not working
704
+ /*// Set the global filter for the table
705
+ this.table.setGlobalFilter(newValue);*/
706
+ // Manually update the globalFilter state
707
+ this.table.options.state.globalFilter = newValue;
708
+ }
709
+ handlePaginationState(newValue, oldValue) {
710
+ if (!this.table) {
711
+ console.warn('Table is not initialized yet.');
712
+ return;
713
+ }
714
+ // Only update if there is a meaningful change
715
+ if (JSON.stringify(newValue) !== JSON.stringify(oldValue)) {
716
+ // Not working
717
+ /*// Set the pagination for the table
718
+ this.table.setPagination(newValue);*/
719
+ // Manually update the pagination state
720
+ this.table.options.state.pagination = newValue;
721
+ }
520
722
  }
521
723
  //#endregion WATCHERS
522
724
  /****************************************************************************/
@@ -525,41 +727,39 @@ export class NvDatagrid {
525
727
  this.cacheTemplates();
526
728
  this.parseDataAndColumns();
527
729
  this.initializeTable();
730
+ if (this.enablePagination) {
731
+ // Ensure a valid page size
732
+ const effectivePageSize = this.pageSize > 0 ? this.pageSize : 10;
733
+ this.paginationState = {
734
+ pageIndex: Math.max(0, this.minPageIndex - 1),
735
+ pageSize: effectivePageSize,
736
+ };
737
+ }
528
738
  }
529
739
  //#endregion EVENTS
530
740
  /****************************************************************************/
531
741
  //#region RENDER
532
742
  render() {
533
- var _a, _b, _c, _d;
743
+ var _a, _b, _c, _d, _e;
534
744
  const headerGroups = !this.table || this.table === undefined || this.parsedColumns.length === 0
535
745
  ? []
536
746
  : (_a = this.table) === null || _a === void 0 ? void 0 : _a.getHeaderGroups();
537
747
  const rows = !this.table || this.table === undefined || this.parsedData.length === 0
538
748
  ? []
539
749
  : (_c = (_b = this.table) === null || _b === void 0 ? void 0 : _b.getRowModel()) === null || _c === void 0 ? void 0 : _c.rows;
540
- return (h(Host, { key: '94163c2c73d03dca35795bfb536c5743cb3aa0dc' }, h("div", { key: '022776844872a4a6fcf9d7bdc71651e946e83724', class: "hidden" }, h("slot", { key: 'a479cfc2b5ee53aa83450ec784451625e1ae7667' })), h("slot", { key: '9beeb16975a685d8ce05981923c999ab2ffa004e', name: "before" }), this.enableGlobalFilter && this.table && (h("div", { key: '57efcd1ee55fae941a0071000dc665ee76615f32', class: "search-container" }, h("input", { key: 'd7352618ce123a7c14d8ebcc0b228136ae2df66a', type: "text", value: (_d = this.globalFilter) !== 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("table", null, this.parsedColumns.length > 0 && headerGroups.length > 0 && (h("thead", null, this.parsedColumns.length > 0 && headerGroups
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
541
751
  ? headerGroups === null || headerGroups === void 0 ? void 0 : headerGroups.map(headerGroup => (h("tr", { key: headerGroup.id }, headerGroup.headers.map(header => {
542
752
  return (h("th", { key: header.id }, header.isPlaceholder
543
753
  ? null
544
- : this.renderTemplate(this.headerTemplateCache.get(header.id), {}) || header.column.columnDef.header));
754
+ : this.flexRender(header.column.columnDef.header, header.getContext())));
545
755
  }))))
546
756
  : 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 => {
547
757
  const rowId = row.id;
548
758
  const visibleCells = row === null || row === void 0 ? void 0 : row.getVisibleCells();
549
759
  return (h("tr", { key: rowId }, visibleCells.map(cell => {
550
- var _a, _b;
551
- const cellAccessors = cell.column.id;
552
- const cellValue = cell.getValue();
553
- return (h("td", { key: cell.id, "data-row-id": rowId }, ((_a = this.columnData.find(x => x.accessor === cellAccessors)) === null || _a === void 0 ? void 0 : _a.repeatTemplate) && Array.isArray(cellValue)
554
- ? cellValue.map((item) => {
555
- var _a;
556
- return (_a = (this.renderTemplate(this.templateCache.get(cellAccessors), item, row) ||
557
- item)) !== null && _a !== void 0 ? _a : this.fallbackValue;
558
- })
559
- : (_b = (this.renderTemplate(this.templateCache.get(cellAccessors), cellValue, row) ||
560
- cellValue)) !== null && _b !== void 0 ? _b : this.fallbackValue));
760
+ return (h("td", { key: cell.id, "data-row-id": rowId }, this.flexRender(cell.column.columnDef.cell, cell.getContext())));
561
761
  })));
562
- }))))), h("slot", { key: '15815f259d3936559c89ff943dc349f99fda34fa', name: "after" })));
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" })));
563
763
  }
564
764
  static get is() { return "nv-datagrid"; }
565
765
  static get originalStyleUrls() {
@@ -786,6 +986,73 @@ export class NvDatagrid {
786
986
  "attribute": "auto-generate-columns",
787
987
  "reflect": true,
788
988
  "defaultValue": "false"
989
+ },
990
+ "enablePagination": {
991
+ "type": "boolean",
992
+ "mutable": false,
993
+ "complexType": {
994
+ "original": "boolean",
995
+ "resolved": "boolean",
996
+ "references": {}
997
+ },
998
+ "required": false,
999
+ "optional": false,
1000
+ "docs": {
1001
+ "tags": [{
1002
+ "name": "default",
1003
+ "text": "false"
1004
+ }],
1005
+ "text": "Whether to enable pagination for the data grid."
1006
+ },
1007
+ "getter": false,
1008
+ "setter": false,
1009
+ "attribute": "enable-pagination",
1010
+ "reflect": true,
1011
+ "defaultValue": "false"
1012
+ },
1013
+ "pageSize": {
1014
+ "type": "number",
1015
+ "mutable": false,
1016
+ "complexType": {
1017
+ "original": "number",
1018
+ "resolved": "number",
1019
+ "references": {}
1020
+ },
1021
+ "required": false,
1022
+ "optional": false,
1023
+ "docs": {
1024
+ "tags": [{
1025
+ "name": "default",
1026
+ "text": "10"
1027
+ }],
1028
+ "text": "The number of rows to display per page."
1029
+ },
1030
+ "getter": false,
1031
+ "setter": false,
1032
+ "attribute": "page-size",
1033
+ "reflect": true,
1034
+ "defaultValue": "10"
1035
+ },
1036
+ "pageSizes": {
1037
+ "type": "unknown",
1038
+ "mutable": false,
1039
+ "complexType": {
1040
+ "original": "number[]",
1041
+ "resolved": "number[]",
1042
+ "references": {}
1043
+ },
1044
+ "required": false,
1045
+ "optional": false,
1046
+ "docs": {
1047
+ "tags": [{
1048
+ "name": "default",
1049
+ "text": "[10, 20, 30, 40, 50]"
1050
+ }],
1051
+ "text": "The array of page sizes to display in the pagination dropdown."
1052
+ },
1053
+ "getter": false,
1054
+ "setter": false,
1055
+ "defaultValue": "[10, 20, 30, 40, 50]"
789
1056
  }
790
1057
  };
791
1058
  }
@@ -794,8 +1061,9 @@ export class NvDatagrid {
794
1061
  "table": {},
795
1062
  "parsedColumns": {},
796
1063
  "parsedData": {},
797
- "globalFilter": {},
798
- "columnData": {}
1064
+ "globalFilterSearchTerm": {},
1065
+ "columnData": {},
1066
+ "paginationState": {}
799
1067
  };
800
1068
  }
801
1069
  static get events() {
@@ -843,8 +1111,11 @@ export class NvDatagrid {
843
1111
  "propName": "parsedData",
844
1112
  "methodName": "handleParsedChange"
845
1113
  }, {
846
- "propName": "globalFilter",
847
- "methodName": "handleGlobalFilter"
1114
+ "propName": "globalFilterSearchTerm",
1115
+ "methodName": "handleGlobalFilterSearchTerm"
1116
+ }, {
1117
+ "propName": "paginationState",
1118
+ "methodName": "handlePaginationState"
848
1119
  }];
849
1120
  }
850
1121
  }