@nova-design-system/nova-webcomponents 3.1.0 → 3.3.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 (474) hide show
  1. package/dist/cjs/{index-9bda5507.js → index-c56424e5.js} +34 -186
  2. package/dist/cjs/index-c56424e5.js.map +1 -0
  3. package/dist/cjs/index.cjs.js +1 -0
  4. package/dist/cjs/index.cjs.js.map +1 -1
  5. package/dist/cjs/loader.cjs.js +2 -2
  6. package/dist/cjs/native.cjs.js +2 -23
  7. package/dist/cjs/native.cjs.js.map +1 -1
  8. package/dist/cjs/nv-alert.cjs.entry.js +1 -1
  9. package/dist/cjs/nv-avatar.cjs.entry.js +1 -1
  10. package/dist/cjs/nv-badge_2.cjs.entry.js +1 -1
  11. package/dist/cjs/nv-breadcrumb.cjs.entry.js +1 -1
  12. package/dist/cjs/nv-breadcrumbs.cjs.entry.js +1 -1
  13. package/dist/cjs/nv-button.cjs.entry.js +1 -1
  14. package/dist/cjs/nv-calendar.cjs.entry.js +384 -172
  15. package/dist/cjs/nv-calendar.cjs.entry.js.map +1 -1
  16. package/dist/cjs/nv-col.cjs.entry.js +1 -1
  17. package/dist/cjs/nv-datagrid.cjs.entry.js +95 -103
  18. package/dist/cjs/nv-datagrid.cjs.entry.js.map +1 -1
  19. package/dist/cjs/nv-datagridcolumn.cjs.entry.js +2 -2
  20. package/dist/cjs/nv-datagridcolumn.cjs.entry.js.map +1 -1
  21. package/dist/cjs/nv-dialog.cjs.entry.js +1 -1
  22. package/dist/cjs/nv-dialogfooter_2.cjs.entry.js +1 -1
  23. package/dist/cjs/nv-fieldcheckbox.cjs.entry.js +1 -1
  24. package/dist/cjs/nv-fielddate.cjs.entry.js +45 -11
  25. package/dist/cjs/nv-fielddate.cjs.entry.js.map +1 -1
  26. package/dist/cjs/nv-fielddaterange.cjs.entry.js +128 -42
  27. package/dist/cjs/nv-fielddaterange.cjs.entry.js.map +1 -1
  28. package/dist/cjs/nv-fielddropdown.cjs.entry.js +84 -60
  29. package/dist/cjs/nv-fielddropdown.cjs.entry.js.map +1 -1
  30. package/dist/cjs/nv-fielddropdownitem.cjs.entry.js +1 -1
  31. package/dist/cjs/nv-fieldmultiselect.cjs.entry.js +116 -104
  32. package/dist/cjs/nv-fieldmultiselect.cjs.entry.js.map +1 -1
  33. package/dist/cjs/nv-fieldnumber.cjs.entry.js +2 -2
  34. package/dist/cjs/nv-fieldnumber.cjs.entry.js.map +1 -1
  35. package/dist/cjs/nv-fieldpassword.cjs.entry.js +2 -2
  36. package/dist/cjs/nv-fieldpassword.cjs.entry.js.map +1 -1
  37. package/dist/cjs/nv-fieldradio.cjs.entry.js +1 -1
  38. package/dist/cjs/nv-fieldselect.cjs.entry.js +2 -2
  39. package/dist/cjs/nv-fieldselect.cjs.entry.js.map +1 -1
  40. package/dist/cjs/nv-fieldslider.cjs.entry.js +668 -0
  41. package/dist/cjs/nv-fieldslider.cjs.entry.js.map +1 -0
  42. package/dist/cjs/nv-fieldtext.cjs.entry.js +5 -5
  43. package/dist/cjs/nv-fieldtext.cjs.entry.js.map +1 -1
  44. package/dist/cjs/nv-fieldtextarea.cjs.entry.js +5 -5
  45. package/dist/cjs/nv-fieldtextarea.cjs.entry.js.map +1 -1
  46. package/dist/cjs/nv-fieldtime.cjs.entry.js +11 -11
  47. package/dist/cjs/nv-fieldtime.cjs.entry.js.map +1 -1
  48. package/dist/cjs/nv-icon.cjs.entry.js +3 -3
  49. package/dist/cjs/nv-icon.cjs.entry.js.map +1 -1
  50. package/dist/cjs/nv-iconbutton_2.cjs.entry.js +3 -3
  51. package/dist/cjs/nv-menu.cjs.entry.js +2 -2
  52. package/dist/cjs/nv-menuitem.cjs.entry.js +2 -2
  53. package/dist/cjs/nv-popover.cjs.entry.js +2 -2
  54. package/dist/cjs/nv-row.cjs.entry.js +2 -2
  55. package/dist/cjs/nv-stack.cjs.entry.js +2 -2
  56. package/dist/cjs/nv-table.cjs.entry.js +3 -3
  57. package/dist/cjs/nv-tablecolumn.cjs.entry.js +1 -1
  58. package/dist/cjs/nv-toggle.cjs.entry.js +3 -3
  59. package/dist/cjs/nv-tooltip.cjs.entry.js +3 -3
  60. package/dist/cjs/nv-tooltip.cjs.entry.js.map +1 -1
  61. package/dist/collection/collection-manifest.json +1 -0
  62. package/dist/collection/components/nv-calendar/nv-calendar.css +6 -2
  63. package/dist/collection/components/nv-calendar/nv-calendar.js +247 -169
  64. package/dist/collection/components/nv-calendar/nv-calendar.js.map +1 -1
  65. package/dist/collection/components/nv-calendar/nv-calendar.utils.js +12 -3
  66. package/dist/collection/components/nv-calendar/nv-calendar.utils.js.map +1 -1
  67. package/dist/collection/components/nv-calendar/partials/calendar-actions.js +11 -0
  68. package/dist/collection/components/nv-calendar/partials/calendar-actions.js.map +1 -0
  69. package/dist/collection/components/nv-calendar/partials/calendar-grid.js +24 -0
  70. package/dist/collection/components/nv-calendar/partials/calendar-grid.js.map +1 -0
  71. package/dist/collection/components/nv-calendar/partials/calendar-header.js +38 -0
  72. package/dist/collection/components/nv-calendar/partials/calendar-header.js.map +1 -0
  73. package/dist/collection/components/nv-calendar/partials/calendar-shortcuts.js +22 -0
  74. package/dist/collection/components/nv-calendar/partials/calendar-shortcuts.js.map +1 -0
  75. package/dist/collection/components/nv-calendar/partials/day-cell.js +31 -0
  76. package/dist/collection/components/nv-calendar/partials/day-cell.js.map +1 -0
  77. package/dist/collection/components/nv-calendar/partials/index.js +7 -0
  78. package/dist/collection/components/nv-calendar/partials/index.js.map +1 -0
  79. package/dist/collection/components/nv-calendar/partials/week-numbers.js +36 -0
  80. package/dist/collection/components/nv-calendar/partials/week-numbers.js.map +1 -0
  81. package/dist/collection/components/nv-calendar/test/nv-calendar.utils.test.js +692 -651
  82. package/dist/collection/components/nv-calendar/test/nv-calendar.utils.test.js.map +1 -1
  83. package/dist/collection/components/nv-calendar/test/partials/calendar-actions.logic.test.js +169 -0
  84. package/dist/collection/components/nv-calendar/test/partials/calendar-actions.logic.test.js.map +1 -0
  85. package/dist/collection/components/nv-calendar/test/partials/calendar-grid.logic.test.js +262 -0
  86. package/dist/collection/components/nv-calendar/test/partials/calendar-grid.logic.test.js.map +1 -0
  87. package/dist/collection/components/nv-calendar/test/partials/calendar-header.logic.test.js +208 -0
  88. package/dist/collection/components/nv-calendar/test/partials/calendar-header.logic.test.js.map +1 -0
  89. package/dist/collection/components/nv-calendar/test/partials/calendar-shortcuts.logic.test.js +355 -0
  90. package/dist/collection/components/nv-calendar/test/partials/calendar-shortcuts.logic.test.js.map +1 -0
  91. package/dist/collection/components/nv-calendar/test/partials/day-cell.logic.test.js +250 -0
  92. package/dist/collection/components/nv-calendar/test/partials/day-cell.logic.test.js.map +1 -0
  93. package/dist/collection/components/nv-calendar/test/partials/week-numbers.logic.test.js +217 -0
  94. package/dist/collection/components/nv-calendar/test/partials/week-numbers.logic.test.js.map +1 -0
  95. package/dist/collection/components/nv-datagrid/nv-datagrid.docs.js +131 -48
  96. package/dist/collection/components/nv-datagrid/nv-datagrid.docs.js.map +1 -1
  97. package/dist/collection/components/nv-datagrid/nv-datagrid.js +94 -152
  98. package/dist/collection/components/nv-datagrid/nv-datagrid.js.map +1 -1
  99. package/dist/collection/components/nv-datagridcolumn/nv-datagridcolumn.js +20 -1
  100. package/dist/collection/components/nv-datagridcolumn/nv-datagridcolumn.js.map +1 -1
  101. package/dist/collection/components/nv-fielddate/nv-fielddate.js +56 -16
  102. package/dist/collection/components/nv-fielddate/nv-fielddate.js.map +1 -1
  103. package/dist/collection/components/nv-fielddate/styles/nv-fielddate.css +51 -1
  104. package/dist/collection/components/nv-fielddate/test/nv-fielddate.logic.test.js +196 -0
  105. package/dist/collection/components/nv-fielddate/test/nv-fielddate.logic.test.js.map +1 -0
  106. package/dist/collection/components/nv-fielddaterange/nv-fielddaterange.js +165 -41
  107. package/dist/collection/components/nv-fielddaterange/nv-fielddaterange.js.map +1 -1
  108. package/dist/collection/components/nv-fielddaterange/styles/nv-fielddaterange.css +51 -1
  109. package/dist/collection/components/nv-fielddaterange/test/nv-fielddaterange.logic.test.js +137 -0
  110. package/dist/collection/components/nv-fielddaterange/test/nv-fielddaterange.logic.test.js.map +1 -0
  111. package/dist/collection/components/nv-fielddropdown/nv-fielddropdown.docs.js +8 -0
  112. package/dist/collection/components/nv-fielddropdown/nv-fielddropdown.docs.js.map +1 -1
  113. package/dist/collection/components/nv-fielddropdown/nv-fielddropdown.js +173 -106
  114. package/dist/collection/components/nv-fielddropdown/nv-fielddropdown.js.map +1 -1
  115. package/dist/collection/components/nv-fielddropdown/styles/nv-fielddropdown.css +77 -1
  116. package/dist/collection/components/nv-fieldmultiselect/nv-fieldmultiselect.js +202 -190
  117. package/dist/collection/components/nv-fieldmultiselect/nv-fieldmultiselect.js.map +1 -1
  118. package/dist/collection/components/nv-fieldmultiselect/{nv-fieldmultiselect.css → styles/nv-fieldmultiselect.css} +61 -4
  119. package/dist/collection/components/nv-fieldnumber/nv-fieldnumber.css +51 -1
  120. package/dist/collection/components/nv-fieldpassword/nv-fieldpassword.css +51 -1
  121. package/dist/collection/components/nv-fieldselect/nv-fieldselect.css +51 -1
  122. package/dist/collection/components/nv-fieldslider/nv-fieldslider.docs.js +264 -0
  123. package/dist/collection/components/nv-fieldslider/nv-fieldslider.docs.js.map +1 -0
  124. package/dist/collection/components/nv-fieldslider/nv-fieldslider.js +1036 -0
  125. package/dist/collection/components/nv-fieldslider/nv-fieldslider.js.map +1 -0
  126. package/dist/collection/components/nv-fieldslider/nv-fieldslider.utils.js +77 -0
  127. package/dist/collection/components/nv-fieldslider/nv-fieldslider.utils.js.map +1 -0
  128. package/dist/collection/components/nv-fieldslider/partials/field-input.js +33 -0
  129. package/dist/collection/components/nv-fieldslider/partials/field-input.js.map +1 -0
  130. package/dist/collection/components/nv-fieldslider/partials/range-thumb.js +34 -0
  131. package/dist/collection/components/nv-fieldslider/partials/range-thumb.js.map +1 -0
  132. package/dist/collection/components/nv-fieldslider/partials/single-thumb.js +18 -0
  133. package/dist/collection/components/nv-fieldslider/partials/single-thumb.js.map +1 -0
  134. package/dist/collection/components/nv-fieldslider/partials/tick-marks.js +18 -0
  135. package/dist/collection/components/nv-fieldslider/partials/tick-marks.js.map +1 -0
  136. package/dist/collection/components/nv-fieldslider/styles/nv-fieldslider.css +338 -0
  137. package/dist/collection/components/nv-fieldslider/test/nv-fieldslider.utils.test.js +159 -0
  138. package/dist/collection/components/nv-fieldslider/test/nv-fieldslider.utils.test.js.map +1 -0
  139. package/dist/collection/components/nv-fieldtext/nv-fieldtext.css +59 -1
  140. package/dist/collection/components/nv-fieldtext/nv-fieldtext.docs.js +9 -1
  141. package/dist/collection/components/nv-fieldtext/nv-fieldtext.docs.js.map +1 -1
  142. package/dist/collection/components/nv-fieldtext/nv-fieldtext.js +4 -3
  143. package/dist/collection/components/nv-fieldtext/nv-fieldtext.js.map +1 -1
  144. package/dist/collection/components/nv-fieldtextarea/nv-fieldtextarea.css +45 -1
  145. package/dist/collection/components/nv-fieldtextarea/nv-fieldtextarea.js +3 -3
  146. package/dist/collection/components/nv-fieldtime/nv-fieldtime.js +9 -9
  147. package/dist/collection/components/nv-fieldtime/styles/nv-fieldtime.css +51 -1
  148. package/dist/collection/components/nv-icon/nv-icon.js +1 -1
  149. package/dist/collection/components/nv-icon/nv-icons.js +1 -0
  150. package/dist/collection/components/nv-icon/nv-icons.js.map +1 -1
  151. package/dist/collection/components/nv-iconbutton/nv-iconbutton.js +1 -1
  152. package/dist/collection/components/nv-loader/nv-loader.js +1 -1
  153. package/dist/collection/components/nv-menu/nv-menu.js +1 -1
  154. package/dist/collection/components/nv-menuitem/nv-menuitem.js +2 -2
  155. package/dist/collection/components/nv-popover/nv-popover.js +1 -1
  156. package/dist/collection/components/nv-row/nv-row.js +1 -1
  157. package/dist/collection/components/nv-stack/nv-stack.js +1 -1
  158. package/dist/collection/components/nv-table/nv-table.js +2 -2
  159. package/dist/collection/components/nv-toggle/nv-toggle.js +2 -2
  160. package/dist/collection/components/nv-tooltip/nv-tooltip.css +1 -0
  161. package/dist/collection/components/nv-tooltip/nv-tooltip.js +1 -1
  162. package/dist/collection/interfaces/Column.js.map +1 -1
  163. package/dist/components/index.js +2 -1
  164. package/dist/components/index.js.map +1 -1
  165. package/dist/components/nv-alert.js +2 -2
  166. package/dist/components/nv-avatar.js +2 -2
  167. package/dist/components/nv-badge.js +1 -1
  168. package/dist/components/nv-breadcrumb.js +3 -3
  169. package/dist/components/nv-breadcrumbs.js +1 -1
  170. package/dist/components/nv-button.js +1 -1
  171. package/dist/components/nv-calendar.js +1 -1
  172. package/dist/components/nv-col.js +1 -1
  173. package/dist/components/nv-datagrid.js +97 -109
  174. package/dist/components/nv-datagrid.js.map +1 -1
  175. package/dist/components/nv-datagridcolumn.js +4 -3
  176. package/dist/components/nv-datagridcolumn.js.map +1 -1
  177. package/dist/components/nv-dialog.js +6 -6
  178. package/dist/components/nv-dialogfooter.js +1 -1
  179. package/dist/components/nv-dialogheader.js +1 -1
  180. package/dist/components/nv-fieldcheckbox.js +1 -1
  181. package/dist/components/nv-fielddate.js +53 -25
  182. package/dist/components/nv-fielddate.js.map +1 -1
  183. package/dist/components/nv-fielddaterange.js +137 -57
  184. package/dist/components/nv-fielddaterange.js.map +1 -1
  185. package/dist/components/nv-fielddropdown.js +98 -72
  186. package/dist/components/nv-fielddropdown.js.map +1 -1
  187. package/dist/components/nv-fielddropdownitem.js +1 -1
  188. package/dist/components/nv-fielddropdownitemcheck.js +1 -1
  189. package/dist/components/nv-fieldmultiselect.js +132 -120
  190. package/dist/components/nv-fieldmultiselect.js.map +1 -1
  191. package/dist/components/nv-fieldnumber.js +5 -5
  192. package/dist/components/nv-fieldnumber.js.map +1 -1
  193. package/dist/components/nv-fieldpassword.js +5 -5
  194. package/dist/components/nv-fieldpassword.js.map +1 -1
  195. package/dist/components/nv-fieldradio.js +1 -1
  196. package/dist/components/nv-fieldselect.js +5 -5
  197. package/dist/components/nv-fieldselect.js.map +1 -1
  198. package/dist/components/nv-fieldslider.d.ts +11 -0
  199. package/dist/components/nv-fieldslider.js +731 -0
  200. package/dist/components/nv-fieldslider.js.map +1 -0
  201. package/dist/components/nv-fieldtext.js +1 -1
  202. package/dist/components/nv-fieldtextarea.js +5 -5
  203. package/dist/components/nv-fieldtextarea.js.map +1 -1
  204. package/dist/components/nv-fieldtime.js +15 -15
  205. package/dist/components/nv-fieldtime.js.map +1 -1
  206. package/dist/components/nv-icon.js +1 -1
  207. package/dist/components/nv-iconbutton.js +1 -1
  208. package/dist/components/nv-loader.js +1 -1
  209. package/dist/components/nv-menu.js +5 -5
  210. package/dist/components/nv-menuitem.js +1 -1
  211. package/dist/components/nv-popover.js +1 -1
  212. package/dist/components/nv-row.js +2 -2
  213. package/dist/components/nv-stack.js +2 -2
  214. package/dist/components/nv-table.js +3 -3
  215. package/dist/components/nv-tablecolumn.js +1 -1
  216. package/dist/components/nv-toggle.js +3 -3
  217. package/dist/components/nv-tooltip.js +1 -1
  218. package/dist/components/{p-eb632278.js → p-2ae214d2.js} +3 -3
  219. package/dist/components/{p-eb632278.js.map → p-2ae214d2.js.map} +1 -1
  220. package/dist/components/{p-f76bb0c3.js → p-3e32b5a1.js} +5 -5
  221. package/dist/components/p-3e32b5a1.js.map +1 -0
  222. package/dist/components/{p-854c32dc.js → p-5e90b9b8.js} +389 -199
  223. package/dist/components/p-5e90b9b8.js.map +1 -0
  224. package/dist/components/{p-a2527411.js → p-5ee4015d.js} +3 -3
  225. package/dist/components/{p-a2527411.js.map → p-5ee4015d.js.map} +1 -1
  226. package/dist/components/{p-02752770.js → p-6277f746.js} +2 -2
  227. package/dist/components/{p-02752770.js.map → p-6277f746.js.map} +1 -1
  228. package/dist/components/p-7935c1cb.js +167 -0
  229. package/dist/components/p-7935c1cb.js.map +1 -0
  230. package/dist/components/{p-b48d5a94.js → p-8d92f0e1.js} +4 -4
  231. package/dist/components/{p-b48d5a94.js.map → p-8d92f0e1.js.map} +1 -1
  232. package/dist/components/{p-41c56ddc.js → p-95a7581c.js} +5 -5
  233. package/dist/components/{p-41c56ddc.js.map → p-95a7581c.js.map} +1 -1
  234. package/dist/components/{p-e00cbb8a.js → p-9e6e26cb.js} +2 -2
  235. package/dist/components/{p-e00cbb8a.js.map → p-9e6e26cb.js.map} +1 -1
  236. package/dist/components/p-9fa0de38.js +88 -0
  237. package/dist/components/p-9fa0de38.js.map +1 -0
  238. package/dist/components/{p-1c45c0f2.js → p-aff3ed68.js} +24 -177
  239. package/dist/components/p-aff3ed68.js.map +1 -0
  240. package/dist/components/{p-608eb9da.js → p-b6d858b2.js} +2 -2
  241. package/dist/components/{p-608eb9da.js.map → p-b6d858b2.js.map} +1 -1
  242. package/dist/components/{p-f5cb0a63.js → p-bb6d1e4e.js} +3 -3
  243. package/dist/components/{p-f5cb0a63.js.map → p-bb6d1e4e.js.map} +1 -1
  244. package/dist/components/{p-35a70c5e.js → p-c07c32d2.js} +3 -3
  245. package/dist/components/{p-35a70c5e.js.map → p-c07c32d2.js.map} +1 -1
  246. package/dist/components/{p-10faa938.js → p-c9006520.js} +5 -5
  247. package/dist/components/{p-10faa938.js.map → p-c9006520.js.map} +1 -1
  248. package/dist/components/{p-0a0f6daf.js → p-e28c4707.js} +3 -3
  249. package/dist/components/{p-0a0f6daf.js.map → p-e28c4707.js.map} +1 -1
  250. package/dist/components/{p-10b37876.js → p-eabbc885.js} +3 -3
  251. package/dist/components/{p-10b37876.js.map → p-eabbc885.js.map} +1 -1
  252. package/dist/esm/{constants-b97e736d.js → constants-4faa1fae.js} +2 -2
  253. package/dist/esm/{constants-b97e736d.js.map → constants-4faa1fae.js.map} +1 -1
  254. package/dist/esm/{index-1fb7a9a6.js → index-a1936cd0.js} +35 -186
  255. package/dist/esm/index-a1936cd0.js.map +1 -0
  256. package/dist/esm/index.js +2 -1
  257. package/dist/esm/index.js.map +1 -1
  258. package/dist/esm/loader.js +3 -3
  259. package/dist/esm/native.js +3 -24
  260. package/dist/esm/native.js.map +1 -1
  261. package/dist/esm/nv-alert.entry.js +2 -2
  262. package/dist/esm/nv-avatar.entry.js +2 -2
  263. package/dist/esm/nv-badge_2.entry.js +1 -1
  264. package/dist/esm/nv-breadcrumb.entry.js +1 -1
  265. package/dist/esm/nv-breadcrumbs.entry.js +1 -1
  266. package/dist/esm/nv-button.entry.js +2 -2
  267. package/dist/esm/nv-calendar.entry.js +385 -173
  268. package/dist/esm/nv-calendar.entry.js.map +1 -1
  269. package/dist/esm/nv-col.entry.js +1 -1
  270. package/dist/esm/nv-datagrid.entry.js +96 -104
  271. package/dist/esm/nv-datagrid.entry.js.map +1 -1
  272. package/dist/esm/nv-datagridcolumn.entry.js +2 -2
  273. package/dist/esm/nv-datagridcolumn.entry.js.map +1 -1
  274. package/dist/esm/nv-dialog.entry.js +2 -2
  275. package/dist/esm/nv-dialogfooter_2.entry.js +2 -2
  276. package/dist/esm/nv-fieldcheckbox.entry.js +1 -1
  277. package/dist/esm/nv-fielddate.entry.js +45 -11
  278. package/dist/esm/nv-fielddate.entry.js.map +1 -1
  279. package/dist/esm/nv-fielddaterange.entry.js +128 -42
  280. package/dist/esm/nv-fielddaterange.entry.js.map +1 -1
  281. package/dist/esm/nv-fielddropdown.entry.js +84 -60
  282. package/dist/esm/nv-fielddropdown.entry.js.map +1 -1
  283. package/dist/esm/nv-fielddropdownitem.entry.js +1 -1
  284. package/dist/esm/nv-fieldmultiselect.entry.js +116 -104
  285. package/dist/esm/nv-fieldmultiselect.entry.js.map +1 -1
  286. package/dist/esm/nv-fieldnumber.entry.js +2 -2
  287. package/dist/esm/nv-fieldnumber.entry.js.map +1 -1
  288. package/dist/esm/nv-fieldpassword.entry.js +2 -2
  289. package/dist/esm/nv-fieldpassword.entry.js.map +1 -1
  290. package/dist/esm/nv-fieldradio.entry.js +1 -1
  291. package/dist/esm/nv-fieldselect.entry.js +2 -2
  292. package/dist/esm/nv-fieldselect.entry.js.map +1 -1
  293. package/dist/esm/nv-fieldslider.entry.js +664 -0
  294. package/dist/esm/nv-fieldslider.entry.js.map +1 -0
  295. package/dist/esm/nv-fieldtext.entry.js +5 -5
  296. package/dist/esm/nv-fieldtext.entry.js.map +1 -1
  297. package/dist/esm/nv-fieldtextarea.entry.js +5 -5
  298. package/dist/esm/nv-fieldtextarea.entry.js.map +1 -1
  299. package/dist/esm/nv-fieldtime.entry.js +12 -12
  300. package/dist/esm/nv-fieldtime.entry.js.map +1 -1
  301. package/dist/esm/nv-icon.entry.js +4 -4
  302. package/dist/esm/nv-icon.entry.js.map +1 -1
  303. package/dist/esm/nv-iconbutton_2.entry.js +3 -3
  304. package/dist/esm/nv-menu.entry.js +2 -2
  305. package/dist/esm/nv-menuitem.entry.js +2 -2
  306. package/dist/esm/nv-popover.entry.js +2 -2
  307. package/dist/esm/nv-row.entry.js +2 -2
  308. package/dist/esm/nv-stack.entry.js +2 -2
  309. package/dist/esm/nv-table.entry.js +3 -3
  310. package/dist/esm/nv-tablecolumn.entry.js +1 -1
  311. package/dist/esm/nv-toggle.entry.js +3 -3
  312. package/dist/esm/nv-tooltip.entry.js +3 -3
  313. package/dist/esm/nv-tooltip.entry.js.map +1 -1
  314. package/dist/native/index.esm.js +1 -1
  315. package/dist/native/index.esm.js.map +1 -1
  316. package/dist/native/native.css +1 -1
  317. package/dist/native/native.esm.js +1 -1
  318. package/dist/native/native.esm.js.map +1 -1
  319. package/dist/native/p-050d6c6c.entry.js +2 -0
  320. package/dist/native/{p-4d164ed6.entry.js.map → p-050d6c6c.entry.js.map} +1 -1
  321. package/dist/native/{p-615947e7.entry.js → p-08ca678c.entry.js} +2 -2
  322. package/dist/native/p-1a5d3b87.entry.js +2 -0
  323. package/dist/native/{p-efe6a46c.entry.js.map → p-1a5d3b87.entry.js.map} +1 -1
  324. package/dist/native/{p-7fd4d13d.entry.js → p-1c1ecd38.entry.js} +2 -2
  325. package/dist/native/{p-c7b201cd.entry.js → p-1d98477d.entry.js} +2 -2
  326. package/dist/native/{p-1da72182.entry.js → p-2006f5d4.entry.js} +2 -2
  327. package/dist/native/p-26cf4938.entry.js +2 -0
  328. package/dist/native/p-26cf4938.entry.js.map +1 -0
  329. package/dist/native/p-3817efb2.entry.js +2 -0
  330. package/dist/native/{p-fc97f071.entry.js.map → p-3817efb2.entry.js.map} +1 -1
  331. package/dist/native/p-45459dbb.entry.js +2 -0
  332. package/dist/native/{p-7042ba8a.entry.js.map → p-45459dbb.entry.js.map} +1 -1
  333. package/dist/native/p-45cbe6e4.entry.js +2 -0
  334. package/dist/native/{p-9135fdf5.entry.js.map → p-45cbe6e4.entry.js.map} +1 -1
  335. package/dist/native/p-46428304.entry.js +2 -0
  336. package/dist/native/p-46428304.entry.js.map +1 -0
  337. package/dist/native/p-4f9cdf0b.entry.js +2 -0
  338. package/dist/native/{p-3b7ef609.entry.js → p-58bb90ad.entry.js} +2 -2
  339. package/dist/native/p-59b07b36.entry.js +2 -0
  340. package/dist/native/p-59b07b36.entry.js.map +1 -0
  341. package/dist/native/{p-3cd77d82.entry.js → p-5b6c59e0.entry.js} +2 -2
  342. package/dist/native/p-6029e51b.entry.js +2 -0
  343. package/dist/native/{p-244f56ac.entry.js.map → p-6029e51b.entry.js.map} +1 -1
  344. package/dist/native/{p-08a75cfa.entry.js → p-60c64f2b.entry.js} +2 -2
  345. package/dist/native/p-64a76565.entry.js +2 -0
  346. package/dist/native/p-64a76565.entry.js.map +1 -0
  347. package/dist/native/{p-c67186f8.entry.js → p-83288db0.entry.js} +2 -2
  348. package/dist/native/p-838f7842.entry.js +2 -0
  349. package/dist/native/p-838f7842.entry.js.map +1 -0
  350. package/dist/native/{p-0245863d.entry.js → p-86ab23ea.entry.js} +2 -2
  351. package/dist/native/p-87784622.entry.js +2 -0
  352. package/dist/native/p-8fb4e5c0.entry.js +2 -0
  353. package/dist/native/{p-b94d9f0b.entry.js.map → p-8fb4e5c0.entry.js.map} +1 -1
  354. package/dist/native/{p-14c07207.entry.js → p-914da1e1.entry.js} +2 -2
  355. package/dist/native/p-abbe5d69.entry.js +2 -0
  356. package/dist/native/p-abbe5d69.entry.js.map +1 -0
  357. package/dist/native/p-abc251aa.entry.js +2 -0
  358. package/dist/native/p-abc251aa.entry.js.map +1 -0
  359. package/dist/native/{p-c0f79bac.entry.js → p-ad128108.entry.js} +2 -2
  360. package/dist/native/{p-e5de64d5.entry.js → p-b5b9190a.entry.js} +2 -2
  361. package/dist/native/{p-470588c2.entry.js → p-b8f2c1e7.entry.js} +3 -3
  362. package/dist/native/p-b8f2c1e7.entry.js.map +1 -0
  363. package/dist/native/{p-b8b6875d.entry.js → p-d040bd61.entry.js} +2 -2
  364. package/dist/native/p-d0a33e64.js +3 -0
  365. package/dist/native/p-d0a33e64.js.map +1 -0
  366. package/dist/native/{p-3953464e.entry.js → p-d21b2da2.entry.js} +3 -3
  367. package/dist/native/{p-90e6d9dd.entry.js → p-d53e8795.entry.js} +2 -2
  368. package/dist/native/p-dc7dd7f3.entry.js +2 -0
  369. package/dist/native/{p-ae7ab110.entry.js.map → p-dc7dd7f3.entry.js.map} +1 -1
  370. package/dist/native/p-e2c1992e.entry.js +2 -0
  371. package/dist/native/{p-656c56f0.entry.js.map → p-e2c1992e.entry.js.map} +1 -1
  372. package/dist/native/{p-f85c08f1.js → p-e2d0a77d.js} +2 -2
  373. package/dist/native/p-ed6019fe.entry.js +2 -0
  374. package/dist/native/p-ed6019fe.entry.js.map +1 -0
  375. package/dist/native/p-f94d7054.entry.js +2 -0
  376. package/dist/native/{p-49cac014.entry.js.map → p-f94d7054.entry.js.map} +1 -1
  377. package/dist/native/p-fdea17ce.entry.js +2 -0
  378. package/dist/native/p-fdea17ce.entry.js.map +1 -0
  379. package/dist/types/components/nv-calendar/nv-calendar.d.ts +26 -50
  380. package/dist/types/components/nv-calendar/partials/calendar-actions.d.ts +19 -0
  381. package/dist/types/components/nv-calendar/partials/calendar-grid.d.ts +46 -0
  382. package/dist/types/components/nv-calendar/partials/calendar-header.d.ts +38 -0
  383. package/dist/types/components/nv-calendar/partials/calendar-shortcuts.d.ts +35 -0
  384. package/dist/types/components/nv-calendar/partials/day-cell.d.ts +35 -0
  385. package/dist/types/components/nv-calendar/partials/index.d.ts +6 -0
  386. package/dist/types/components/nv-calendar/partials/week-numbers.d.ts +30 -0
  387. package/dist/types/components/nv-calendar/test/partials/calendar-actions.logic.test.d.ts +1 -0
  388. package/dist/types/components/nv-calendar/test/partials/calendar-grid.logic.test.d.ts +1 -0
  389. package/dist/types/components/nv-calendar/test/partials/calendar-header.logic.test.d.ts +1 -0
  390. package/dist/types/components/nv-calendar/test/partials/calendar-shortcuts.logic.test.d.ts +1 -0
  391. package/dist/types/components/nv-calendar/test/partials/day-cell.logic.test.d.ts +1 -0
  392. package/dist/types/components/nv-calendar/test/partials/week-numbers.logic.test.d.ts +1 -0
  393. package/dist/types/components/nv-datagrid/nv-datagrid.d.ts +0 -16
  394. package/dist/types/components/nv-datagridcolumn/nv-datagridcolumn.d.ts +4 -0
  395. package/dist/types/components/nv-fielddate/nv-fielddate.d.ts +21 -9
  396. package/dist/types/components/nv-fielddate/test/nv-fielddate.logic.test.d.ts +1 -0
  397. package/dist/types/components/nv-fielddaterange/nv-fielddaterange.d.ts +24 -3
  398. package/dist/types/components/nv-fielddaterange/test/nv-fielddaterange.logic.test.d.ts +1 -0
  399. package/dist/types/components/nv-fielddropdown/nv-fielddropdown.d.ts +47 -26
  400. package/dist/types/components/nv-fieldmultiselect/nv-fieldmultiselect.d.ts +61 -55
  401. package/dist/types/components/nv-fieldslider/nv-fieldslider.d.ts +229 -0
  402. package/dist/types/components/nv-fieldslider/nv-fieldslider.docs.d.ts +4 -0
  403. package/dist/types/components/nv-fieldslider/nv-fieldslider.utils.d.ts +46 -0
  404. package/dist/types/components/nv-fieldslider/partials/field-input.d.ts +45 -0
  405. package/dist/types/components/nv-fieldslider/partials/range-thumb.d.ts +37 -0
  406. package/dist/types/components/nv-fieldslider/partials/single-thumb.d.ts +35 -0
  407. package/dist/types/components/nv-fieldslider/partials/tick-marks.d.ts +28 -0
  408. package/dist/types/components/nv-fieldslider/test/nv-fieldslider.utils.test.d.ts +1 -0
  409. package/dist/types/components/nv-fieldtext/nv-fieldtext.d.ts +1 -0
  410. package/dist/types/components/nv-icon/nv-icons.d.ts +1 -1
  411. package/dist/types/components.d.ts +402 -54
  412. package/dist/types/interfaces/Column.d.ts +5 -1
  413. package/dist/vscode-data.json +121 -9
  414. package/hydrate/index.js +1664 -584
  415. package/hydrate/index.mjs +1664 -584
  416. package/package.json +6 -2
  417. package/dist/cjs/index-9bda5507.js.map +0 -1
  418. package/dist/components/p-1c45c0f2.js.map +0 -1
  419. package/dist/components/p-76646ce9.js +0 -88
  420. package/dist/components/p-76646ce9.js.map +0 -1
  421. package/dist/components/p-854c32dc.js.map +0 -1
  422. package/dist/components/p-9decffb6.js +0 -167
  423. package/dist/components/p-9decffb6.js.map +0 -1
  424. package/dist/components/p-f76bb0c3.js.map +0 -1
  425. package/dist/esm/index-1fb7a9a6.js.map +0 -1
  426. package/dist/native/p-244f56ac.entry.js +0 -2
  427. package/dist/native/p-2523eead.entry.js +0 -2
  428. package/dist/native/p-2523eead.entry.js.map +0 -1
  429. package/dist/native/p-470588c2.entry.js.map +0 -1
  430. package/dist/native/p-49cac014.entry.js +0 -2
  431. package/dist/native/p-4d164ed6.entry.js +0 -2
  432. package/dist/native/p-4dc1d036.entry.js +0 -2
  433. package/dist/native/p-4e635fa7.entry.js +0 -2
  434. package/dist/native/p-4e635fa7.entry.js.map +0 -1
  435. package/dist/native/p-5d21532a.entry.js +0 -2
  436. package/dist/native/p-5d21532a.entry.js.map +0 -1
  437. package/dist/native/p-656c56f0.entry.js +0 -2
  438. package/dist/native/p-7042ba8a.entry.js +0 -2
  439. package/dist/native/p-7e154bfd.entry.js +0 -2
  440. package/dist/native/p-7e154bfd.entry.js.map +0 -1
  441. package/dist/native/p-7eba904e.entry.js +0 -2
  442. package/dist/native/p-7eba904e.entry.js.map +0 -1
  443. package/dist/native/p-9135fdf5.entry.js +0 -2
  444. package/dist/native/p-ab002252.js +0 -3
  445. package/dist/native/p-ab002252.js.map +0 -1
  446. package/dist/native/p-ae7ab110.entry.js +0 -2
  447. package/dist/native/p-b94d9f0b.entry.js +0 -2
  448. package/dist/native/p-c71c6f23.entry.js +0 -2
  449. package/dist/native/p-c71c6f23.entry.js.map +0 -1
  450. package/dist/native/p-d9a52884.entry.js +0 -2
  451. package/dist/native/p-d9a52884.entry.js.map +0 -1
  452. package/dist/native/p-efe6a46c.entry.js +0 -2
  453. package/dist/native/p-f2ef6771.entry.js +0 -2
  454. package/dist/native/p-f5f68992.entry.js +0 -2
  455. package/dist/native/p-f5f68992.entry.js.map +0 -1
  456. package/dist/native/p-fc97f071.entry.js +0 -2
  457. /package/dist/native/{p-615947e7.entry.js.map → p-08ca678c.entry.js.map} +0 -0
  458. /package/dist/native/{p-7fd4d13d.entry.js.map → p-1c1ecd38.entry.js.map} +0 -0
  459. /package/dist/native/{p-c7b201cd.entry.js.map → p-1d98477d.entry.js.map} +0 -0
  460. /package/dist/native/{p-1da72182.entry.js.map → p-2006f5d4.entry.js.map} +0 -0
  461. /package/dist/native/{p-f2ef6771.entry.js.map → p-4f9cdf0b.entry.js.map} +0 -0
  462. /package/dist/native/{p-3b7ef609.entry.js.map → p-58bb90ad.entry.js.map} +0 -0
  463. /package/dist/native/{p-3cd77d82.entry.js.map → p-5b6c59e0.entry.js.map} +0 -0
  464. /package/dist/native/{p-08a75cfa.entry.js.map → p-60c64f2b.entry.js.map} +0 -0
  465. /package/dist/native/{p-c67186f8.entry.js.map → p-83288db0.entry.js.map} +0 -0
  466. /package/dist/native/{p-0245863d.entry.js.map → p-86ab23ea.entry.js.map} +0 -0
  467. /package/dist/native/{p-4dc1d036.entry.js.map → p-87784622.entry.js.map} +0 -0
  468. /package/dist/native/{p-14c07207.entry.js.map → p-914da1e1.entry.js.map} +0 -0
  469. /package/dist/native/{p-c0f79bac.entry.js.map → p-ad128108.entry.js.map} +0 -0
  470. /package/dist/native/{p-e5de64d5.entry.js.map → p-b5b9190a.entry.js.map} +0 -0
  471. /package/dist/native/{p-b8b6875d.entry.js.map → p-d040bd61.entry.js.map} +0 -0
  472. /package/dist/native/{p-3953464e.entry.js.map → p-d21b2da2.entry.js.map} +0 -0
  473. /package/dist/native/{p-90e6d9dd.entry.js.map → p-d53e8795.entry.js.map} +0 -0
  474. /package/dist/native/{p-f85c08f1.js.map → p-e2d0a77d.js.map} +0 -0
@@ -0,0 +1,668 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ const index = require('./index-c56424e5.js');
6
+ const v4 = require('./v4-7014b8b0.js');
7
+
8
+ /**
9
+ * Utility functions for nv-fieldslider.
10
+ */
11
+ /**
12
+ * Clamp a value between min and max.
13
+ * @param {number} value - The value to clamp
14
+ * @param {number} min - The minimum boundary
15
+ * @param {number} max - The maximum boundary
16
+ * @returns {number} The clamped value
17
+ */
18
+ function clamp(value, min, max) {
19
+ return Math.max(min, Math.min(max, value));
20
+ }
21
+ /**
22
+ * Calculate the percentage position of a value within a range.
23
+ * @param {number} value - The value to convert to percentage
24
+ * @param {number} min - The minimum value of the range
25
+ * @param {number} max - The maximum value of the range
26
+ * @returns {number} The percentage (0-100)
27
+ */
28
+ function valueToPercent(value, min, max) {
29
+ if (max === min)
30
+ return 0;
31
+ return ((value - min) / (max - min)) * 100;
32
+ }
33
+ /**
34
+ * Snap a value to the nearest step.
35
+ * @param {number} value - The value to snap
36
+ * @param {number} min - The minimum boundary
37
+ * @param {number} max - The maximum boundary
38
+ * @param {number} step - The step size
39
+ * @returns {number} The snapped value
40
+ */
41
+ function snapToStep(value, min, max, step) {
42
+ const clamped = clamp(value, min, max);
43
+ const snapped = Math.round((clamped - min) / step) * step + min;
44
+ return clamp(snapped, min, max);
45
+ }
46
+ /**
47
+ * Generate tick values for the slider.
48
+ * @param {number} min - The minimum value
49
+ * @param {number} max - The maximum value
50
+ * @param {number} step - The step size
51
+ * @returns {number[]} Array of tick values
52
+ */
53
+ function generateTicks(min, max, step) {
54
+ const ticks = [];
55
+ for (let v = min; v <= max; v += step) {
56
+ ticks.push(Number(v.toFixed(10))); // avoid floating point issues
57
+ }
58
+ if (ticks[ticks.length - 1] !== max) {
59
+ ticks.push(max);
60
+ }
61
+ return ticks;
62
+ }
63
+ /**
64
+ * Snap a value to the nearest tick mark.
65
+ * @param {number} value - The value to snap
66
+ * @param {object[]} ticks - Array of tick objects
67
+ * @returns {number} The value of the closest tick
68
+ */
69
+ function snapToTicks(value, ticks) {
70
+ if (!ticks || ticks.length === 0)
71
+ return value;
72
+ // Find the closest tick
73
+ let closestTick = ticks[0].value;
74
+ let minDistance = Math.abs(value - closestTick);
75
+ for (const tick of ticks) {
76
+ const distance = Math.abs(value - tick.value);
77
+ if (distance < minDistance) {
78
+ minDistance = distance;
79
+ closestTick = tick.value;
80
+ }
81
+ }
82
+ return closestTick;
83
+ }
84
+
85
+ /**
86
+ * Renders single thumb in standard mode.
87
+ * @param {SingleThumbProps} props - Component properties
88
+ * @returns {JSX.Element} JSX element representing the thumb
89
+ */
90
+ const SingleThumb = props => {
91
+ const { value, min, max, rawPosition, isDragging, snap, disabled, readonly, onKeyDown, labelBeforeValue, labelAfterValue, } = props;
92
+ // Use raw position for visual display during dragging, but the snapped value otherwise
93
+ let displayPosition = value;
94
+ if (isDragging && !snap) {
95
+ displayPosition = clamp(rawPosition, min, max);
96
+ }
97
+ const percent = valueToPercent(displayPosition, min, max);
98
+ return (index.h("div", { class: "thumb", style: { left: `${percent}%` }, role: "slider", "aria-valuemin": min, "aria-valuemax": max, "aria-valuenow": value, "aria-disabled": disabled ? 'true' : undefined, "aria-readonly": readonly ? 'true' : undefined, tabindex: disabled ? -1 : 0, onKeyDown: onKeyDown },
99
+ index.h("div", { class: "thumb-tooltip" },
100
+ labelBeforeValue && (index.h("span", { class: "label-before" }, labelBeforeValue)),
101
+ String(value),
102
+ labelAfterValue && index.h("span", { class: "label-after" }, labelAfterValue))));
103
+ };
104
+
105
+ /**
106
+ * Renders dual thumbs in range mode.
107
+ * @param {RangeThumbProps} props - Component properties
108
+ * @returns {JSX.Element[]} Array of JSX elements representing the range slider thumbs
109
+ */
110
+ const RangeThumb = props => {
111
+ const { rangeValue, rawRangePosition, activeDragThumb, isDragging, snap, min, max, disabled, readonly, onKeyDown, labelBeforeValue, labelAfterValue, } = props;
112
+ const [leftValue, rightValue] = rangeValue;
113
+ // Use raw positions for visual display during dragging, but the snapped values otherwise
114
+ let displayLeftPosition = leftValue;
115
+ let displayRightPosition = rightValue;
116
+ if (isDragging && !snap) {
117
+ const [rawLeft, rawRight] = rawRangePosition;
118
+ if (activeDragThumb === 'left') {
119
+ displayLeftPosition = clamp(rawLeft, min, Math.min(rightValue, max));
120
+ }
121
+ else if (activeDragThumb === 'right') {
122
+ displayRightPosition = clamp(rawRight, Math.max(leftValue, min), max);
123
+ }
124
+ }
125
+ const leftPercent = valueToPercent(displayLeftPosition, min, max);
126
+ const rightPercent = valueToPercent(displayRightPosition, min, max);
127
+ return [
128
+ index.h("div", { class: "track-range", style: {
129
+ left: `${leftPercent}%`,
130
+ width: `${rightPercent - leftPercent}%`,
131
+ } }),
132
+ index.h("div", { class: "thumb thumb-left", style: { left: `${leftPercent}%` }, role: "slider", "aria-valuemin": min, "aria-valuemax": max, "aria-valuenow": leftValue, "aria-disabled": disabled ? 'true' : undefined, "aria-readonly": readonly ? 'true' : undefined, "data-thumb": "left", tabindex: disabled ? -1 : 0, onKeyDown: onKeyDown },
133
+ index.h("div", { class: "thumb-tooltip" },
134
+ labelBeforeValue && (index.h("span", { class: "label-before" }, labelBeforeValue)),
135
+ String(leftValue),
136
+ labelAfterValue && index.h("span", { class: "label-after" }, labelAfterValue))),
137
+ index.h("div", { class: "thumb thumb-right", style: { left: `${rightPercent}%` }, role: "slider", "aria-valuemin": min, "aria-valuemax": max, "aria-valuenow": rightValue, "aria-disabled": disabled ? 'true' : undefined, "aria-readonly": readonly ? 'true' : undefined, "data-thumb": "right", tabindex: disabled ? -1 : 0, onKeyDown: onKeyDown },
138
+ index.h("div", { class: "thumb-tooltip" },
139
+ labelBeforeValue && (index.h("span", { class: "label-before" }, labelBeforeValue)),
140
+ String(rightValue),
141
+ labelAfterValue && index.h("span", { class: "label-after" }, labelAfterValue))),
142
+ ];
143
+ };
144
+
145
+ /**
146
+ * Renders tick marks along the slider track.
147
+ * @param {TickMarksProps} props - Component properties
148
+ * @returns {JSX.Element | null} JSX element representing the tick marks or null if no ticks
149
+ */
150
+ const TickMarks = props => {
151
+ const { ticks, min, max } = props;
152
+ if (ticks.length === 0) {
153
+ return null;
154
+ }
155
+ return (index.h("div", { class: "track-ticks" }, ticks.map(tick => {
156
+ const percent = valueToPercent(tick.value, min, max);
157
+ return (index.h("div", { class: "track-tick", style: { left: `${percent}%` } }, tick.label && index.h("div", { class: "tick-label" }, tick.label)));
158
+ })));
159
+ };
160
+
161
+ /**
162
+ * Renders field input for direct value entry
163
+ * @param {FieldInputProps} props - Component properties
164
+ * @returns {JSX.Element} JSX element representing the field input
165
+ */
166
+ const FieldInput = props => {
167
+ const { range, hasField, value, rangeValue, index: index$1, inputId, min, max, step, disabled, readonly, onInput, labelBeforeValue, labelAfterValue, name, endName, } = props;
168
+ // Determine the appropriate value based on mode and index
169
+ const fieldValue = range ? rangeValue[index$1] : value;
170
+ // In range mode, we need data-index for event handling
171
+ const dataAttrs = range ? { 'data-index': index$1.toString() } : {};
172
+ // Determine the appropriate name based on mode and index
173
+ let inputName;
174
+ if (range) {
175
+ if (index$1 === 0) {
176
+ inputName = name || '';
177
+ }
178
+ else {
179
+ // Use endName if provided, otherwise append "-end" to the name
180
+ inputName = endName || (name ? `${name}-end` : '');
181
+ }
182
+ }
183
+ else {
184
+ inputName = name || '';
185
+ }
186
+ // If hasField is false, only the containers are visible, not the input fields
187
+ const containerClass = hasField
188
+ ? 'input-container'
189
+ : 'input-container hidden-input';
190
+ return hasField ? (index.h("div", { class: containerClass },
191
+ labelBeforeValue && index.h("span", { class: "label-before" }, labelBeforeValue),
192
+ index.h("input", Object.assign({ id: inputId, type: "number", value: fieldValue, min: min, max: max, step: step, disabled: disabled, readonly: readonly, name: inputName }, dataAttrs, { onInput: onInput })),
193
+ labelAfterValue && index.h("span", { class: "label-after" }, labelAfterValue))) : (index.h("input", { id: inputId, type: "hidden", value: fieldValue, disabled: disabled, readonly: readonly, name: inputName }));
194
+ };
195
+
196
+ const nvFieldsliderCss = "nv-fieldslider .slider-container .track-container:has(.thumb:hover) .track-range{background:var(--components-slider-track-filled-hover)}nv-fieldslider .slider-container .track-container:has(.thumb:hover) .thumb{border-color:var(--components-slider-track-filled-hover)}nv-fieldslider .slider-container .track-container:has(.thumb:focus) .track-range{background:var(--components-slider-track-filled-focus)}nv-fieldslider .slider-container .track-container:has(.thumb:focus) .thumb{border-color:var(--components-slider-track-filled-focus)}nv-fieldslider[error] .slider-container .track-container .track .track-range{background:var(--components-slider-track-filled-error)}nv-fieldslider[error] .slider-container .track-container .track .thumb{border-color:var(--components-slider-track-filled-error)}nv-fieldslider[error] .slider-container .track-container .track .thumb:hover{border-color:var(--components-slider-track-filled-error);outline:calc(var(--focus-outline-stroke) * 1) solid var(--components-slider-track-filled-error);outline-offset:calc(var(--focus-outline-offset) * 1);background-color:var(--components-slider-handler-background-error)}nv-fieldslider[error] .slider-container .track-container .track .thumb:focus{border-color:var(--components-slider-track-filled-error);outline:calc(var(--focus-outline-stroke) * 1) solid var(--components-slider-track-filled-error);outline-offset:calc(var(--focus-outline-offset) * 1);background-color:var(--components-slider-track-filled-error)}nv-fieldslider[error] .slider-container .track-container:has(.thumb:hover) .track-range{background:var(--components-slider-track-filled-error)}nv-fieldslider[error] .slider-container .track-container:has(.thumb:hover) .thumb{border-color:var(--components-slider-track-filled-error)}nv-fieldslider{--nv-field-border-default:var(--components-form-field-border-default);--nv-field-border-hover:var(--components-form-field-border-hover);--nv-field-border-focus:var(--components-form-field-border-focus);--nv-field-border-disabled:var(--components-form-field-border-default);--nv-field-border-readonly:var(--components-form-field-border-default);--nv-field-focus-box-shadow:var(--color-focus-brand);--nv-field-background:var(--components-form-field-background-default);display:flex;flex-direction:column;align-items:flex-start;gap:var(--form-gap-y);box-sizing:border-box;max-width:480px}nv-fieldslider .slider-container{width:100%;display:flex;flex-direction:row;align-items:center;gap:var(--form-gap-x)}nv-fieldslider .slider-container .track-container{position:relative;flex:1;height:calc(var(--slider-handler-size-min) + 0.25rem);padding:calc(var(--slider-handler-size-min) / 2) 0}nv-fieldslider .slider-container .track-container .track{position:relative;height:var(--slider-track-height);background:var(--components-slider-track-background);border-radius:var(--slider-track-radius);cursor:pointer}nv-fieldslider .slider-container .track-container .track .track-range{position:absolute;top:0;height:var(--slider-track-height);background:var(--components-slider-track-filled-default);border-radius:var(--slider-track-radius);pointer-events:none}nv-fieldslider .slider-container .track-container .track .thumb{position:absolute;top:50%;width:var(--slider-handler-size-min);height:var(--slider-handler-size-min);background:#ffffff;border:var(--slider-handler-stroke) solid var(--components-slider-track-filled-default);border-radius:50%;transform:translate(-50%, -50%);z-index:1;cursor:grab;transition:width 0.2s, height 0.2s, box-shadow 0.2s, background-color 0.2s}nv-fieldslider .slider-container .track-container .track .thumb:hover{width:var(--slider-handler-size-max);height:var(--slider-handler-size-max);border-color:var(--components-slider-track-filled-hover)}nv-fieldslider .slider-container .track-container .track .thumb:focus{width:var(--slider-handler-size-min);height:var(--slider-handler-size-min);border-color:var(--components-slider-track-filled-focus);outline:calc(var(--focus-outline-stroke) * 1) solid var(--color-focus-brand);outline-offset:calc(var(--focus-outline-offset) * 1);transition:outline;background:var(--components-slider-handler-background-focus)}nv-fieldslider .slider-container .track-container .track .thumb:active{cursor:grabbing;background:var(--components-slider-handler-background-hover)}nv-fieldslider .slider-container .track-container .track .thumb .thumb-tooltip{position:absolute;top:25px;left:50%;background-color:var(--components-tooltip-background);color:var(--components-tooltip-text);padding:5px;border-radius:var(--tooltip-radius);font-size:var(--tooltip-font-size);z-index:10;pointer-events:none;user-select:none;opacity:0;transition:opacity 0.3s ease-in-out;transform:translateX(-50%)}nv-fieldslider .slider-container .track-container .track .thumb .thumb-tooltip:after{content:\"\";background:var(--components-tooltip-background);box-shadow:none;border:none;position:absolute;border-bottom-color:transparent;border-right-color:transparent;width:6px;height:6px;transform:rotate(45deg);border-radius:1px;top:-3px;left:50%;margin-left:-3px}nv-fieldslider .slider-container .track-container .track .thumb:hover .thumb-tooltip,nv-fieldslider .slider-container .track-container .track .thumb:active .thumb-tooltip,nv-fieldslider .slider-container .track-container .track .thumb:focus .thumb-tooltip{opacity:1}nv-fieldslider .slider-container .track-container .track-ticks{position:relative;height:1rem;margin-top:0.25rem}nv-fieldslider .slider-container .track-container .track-ticks .track-tick{position:absolute;top:0;width:var(--slider-tick-height);height:var(--slider-tick-height);background:var(--components-form-field-border-default);border-radius:50%;transform:translate(-50%, 0);pointer-events:none}nv-fieldslider .slider-container .track-container .track-ticks .track-tick:first-of-type{transform:translate(0, 0)}nv-fieldslider .slider-container .track-container .track-ticks .track-tick:last-of-type{transform:translate(-100%, 0)}nv-fieldslider .slider-container .track-container .track-ticks .track-tick .tick-label{position:absolute;top:calc(var(--slider-tick-height) + 0.25rem);left:50%;color:var(--components-form-field-border-default);transform:translateX(-50%);white-space:nowrap}.track-tick-first nv-fieldslider .slider-container .track-container .track-ticks .track-tick .tick-label{left:0;transform:translateX(0)}.track-tick-last nv-fieldslider .slider-container .track-container .track-ticks .track-tick .tick-label{left:100%;transform:translateX(-100%)}nv-fieldslider .slider-container .input-container{display:flex;flex-grow:1;justify-content:center;align-items:center;align-self:stretch;border-radius:var(--form-field-radius);border-width:1px;border-style:solid;border-color:var(--nv-field-border-default);opacity:var(--components-form-opacity-default, 1);background:var(--nv-field-background);transition:all 150ms ease-out;width:70px;flex-grow:unset}nv-fieldslider .slider-container .input-container:hover{border-color:var(--nv-field-border-hover)}nv-fieldslider .slider-container .input-container:focus-within,nv-fieldslider .slider-container .input-container:focus-within:hover,nv-fieldslider .slider-container .input-container:focus,nv-fieldslider .slider-container .input-container:focus:hover{border-color:var(--nv-field-border-focus);box-shadow:0px 0px 0px var(--focus-field-stroke) var(--nv-field-focus-box-shadow)}nv-fieldslider .slider-container .input-container:has(input:read-only){opacity:0.5;background-color:var(--components-form-field-background-readonly);border-color:var(--nv-field-border-readonly)}nv-fieldslider .slider-container .input-container:has(input:disabled){opacity:0.5;background-color:var(--components-form-field-background-disabled);border-color:var(--nv-field-border-disabled)}nv-fieldslider .slider-container .input-container input{display:flex;align-items:center;flex:1 0 0;overflow:hidden;background-color:transparent;color:var(--components-form-field-content-text);padding:var(--form-field-padding-y) var(--form-field-padding-x);font-size:var(--form-field-font-size);font-style:normal;font-weight:500;line-height:var(--form-field-line-height);width:100%;}nv-fieldslider .slider-container .input-container input:focus{outline:none}nv-fieldslider .slider-container .input-container input::placeholder{overflow:hidden;color:var(--components-form-field-content-placeholder);text-overflow:ellipsis;font-family:\"TT Norms Pro\", sans-serif;font-size:var(--form-field-font-size);font-style:normal;font-weight:400;line-height:var(--form-field-line-height)}nv-fieldslider .slider-container .input-container input[type=password]::-ms-clear,nv-fieldslider .slider-container .input-container input[type=password]::-ms-reveal{display:none;width:0;height:0}nv-fieldslider[fluid]:not([fluid=false]){max-width:unset}nv-fieldslider[error]:not([error=false]){--nv-field-border-default:var(--components-form-field-border-error);--nv-field-border-hover:var(--nv-field-border-default);--nv-field-border-focus:var(--nv-field-border-default);--nv-field-border-disabled:var(--nv-field-border-default);--nv-field-border-readonly:var(--nv-field-border-default);--nv-field-focus-box-shadow:var(--color-focus-destructive-in-field)}nv-fieldslider[success]:not([success=false]){--nv-field-border-default:var(--components-form-field-border-success);--nv-field-border-hover:var(--nv-field-border-default);--nv-field-border-focus:var(--nv-field-border-default);--nv-field-border-disabled:var(--nv-field-border-default);--nv-field-border-readonly:var(--nv-field-border-default);--nv-field-focus-box-shadow:var(--color-focus-success)}nv-fieldslider[readonly]:not([readonly=false]){--nv-field-border-default:var(--components-form-field-border-readonly);--nv-field-border-hover:var(--nv-field-border-default);--nv-field-border-focus:var(--components-form-field-border-focus);--nv-field-border-disabled:var(--nv-field-border-default);--nv-field-border-readonly:var(--nv-field-border-default);--nv-field-background:var(--components-form-field-background-readonly)}nv-fieldslider[readonly]:not([readonly=false]) .track,nv-fieldslider[readonly]:not([readonly=false]) .thumb{cursor:default}nv-fieldslider label{display:flex;align-items:center;gap:var(--form-label-gap);align-self:stretch;color:var(--components-form-text-label-default);font-family:\"TT Norms Pro\", sans-serif;font-size:var(--form-label-font-size);font-style:normal;font-weight:500;line-height:var(--form-label-line-height)}nv-fieldslider nv-icon.validation{color:var(--nv-field-border-default)}nv-fieldslider[hide-label]:not([hide-label=false]) label{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0, 0, 0, 0);white-space:nowrap;border-width:0}nv-fieldslider[has-field]:not([has-field=false]) .thumb-tooltip{display:none}nv-fieldslider>.description{display:flex;align-items:center;align-self:stretch;gap:var(--spacing-1);color:var(--components-form-text-description-default);font-family:\"TT Norms Pro\", sans-serif;font-size:var(--form-description-font-size);font-style:normal;line-height:var(--form-description-line-height)}nv-fieldslider>.error-description{display:flex;align-items:center;align-self:stretch;gap:var(--spacing-1);color:var(--components-form-text-description-default);font-family:\"TT Norms Pro\", sans-serif;font-size:var(--form-description-font-size);font-style:normal;line-height:var(--form-description-line-height);color:var(--components-form-text-description-error)}nv-fieldslider>.error-description[hidden]{display:none}";
197
+ const NvFieldsliderStyle0 = nvFieldsliderCss;
198
+
199
+ const NvFieldslider = class {
200
+ constructor(hostRef) {
201
+ index.registerInstance(this, hostRef);
202
+ this.valueChanged = index.createEvent(this, "valueChanged", 7);
203
+ /****************************************************************************/
204
+ //#region PROPERTIES
205
+ /**
206
+ * Sets the ID for the start input element and the for attribute of the associated
207
+ * label. If no ID is provided, a random one will be automatically generated.
208
+ */
209
+ this.startInputId = v4.v4();
210
+ /**
211
+ * Sets the ID for the end input element and the for attribute of the associated
212
+ * label. If no ID is provided, a random one will be automatically generated.
213
+ */
214
+ this.endInputId = v4.v4();
215
+ /**
216
+ * Keeps the interface clean by removing visible labels, but still announces
217
+ * the label to screen readers so users relying on assistive tech aren't left
218
+ * guessing.
219
+ */
220
+ this.hideLabel = false;
221
+ /**
222
+ * Enables an optional numeric input field alongside the slider, allowing
223
+ * users to type a value directly instead of—or in addition to—using the
224
+ * slider handle.
225
+ */
226
+ this.hasField = false;
227
+ /**
228
+ * Allows the slider to display two thumbs, enabling users to select a
229
+ * continuous range between a minimum and maximum value. Ideal for use cases
230
+ * like filtering by price or time.
231
+ */
232
+ this.range = false;
233
+ /**
234
+ * Disables user interaction with the slider and its associated input fields.
235
+ */
236
+ this.disabled = false;
237
+ /**
238
+ * Makes the slider and input non-editable while keeping them focusable and
239
+ * included in form submissions.
240
+ */
241
+ this.readonly = false;
242
+ /**
243
+ * Alters the slider's appearance to indicate an error, helping users
244
+ * identify fields that need correction.
245
+ * @validator error
246
+ */
247
+ this.error = false;
248
+ /**
249
+ * Changes the slider's appearance to indicate successful input or validation.
250
+ */
251
+ this.success = false;
252
+ /**
253
+ * Numeric value of the slider as an array of numbers. When in single mode,
254
+ * the value should be a an array of one number. When in range mode, the value
255
+ * should be an array of two numbers.
256
+ */
257
+ this.value = [0, 0];
258
+ /**
259
+ * Defines the interval between selectable values on the slider. Controls how
260
+ * much the value increases or decreases with each keyboard interaction, drag
261
+ * movement, or direct input.
262
+ */
263
+ this.step = 1;
264
+ /**
265
+ * Controls whether the slider handle should visually snap to step values
266
+ * during dragging. When false, the handle can be positioned at any point
267
+ * along the track while dragging, but the actual value will still snap to the
268
+ * nearest step value. When true, the handle will visually snap to the nearest
269
+ * step value during dragging.
270
+ */
271
+ this.snap = false;
272
+ /**
273
+ * When true and custom ticks are provided, the slider will snap to the nearest
274
+ * tick value during dragging, instead of using the step value. This is useful
275
+ * when you have custom ticks at specific values that don't align with regular step intervals.
276
+ */
277
+ this.snapTicks = false;
278
+ /**
279
+ * Defines the minimum allowed value for the slider. The thumb cannot move
280
+ * below this value, and manual input is also constrained accordingly.
281
+ */
282
+ this.min = 0;
283
+ /**
284
+ * Defines the maximum allowed value for the slider. The thumb cannot move
285
+ * above this value, and manual input is also constrained accordingly.
286
+ */
287
+ this.max = 100;
288
+ /**
289
+ * Controls the visibility of tick marks on the slider. When enabled, all
290
+ * visual ticks that indicate step points along the track are shown. If custom
291
+ * ticks are provided, they are always shown regardless of this setting.
292
+ */
293
+ this.showTicks = false;
294
+ /**
295
+ * Allows the field to stretch and fill the entire width of its container.
296
+ */
297
+ this.fluid = false;
298
+ //#endregion PROPERTIES
299
+ /****************************************************************************/
300
+ //#region STATE
301
+ this.isDragging = false;
302
+ this.activeDragThumb = 'single';
303
+ this.internalTicks = [];
304
+ // These track the raw slider positions for visual display
305
+ this.rawPosition = 0;
306
+ this.rawRangePosition = [0, 0];
307
+ this.valueInternal = 0;
308
+ this.rangeValueInternal = [0, 0];
309
+ /**
310
+ * Parses the value string into a number or array of numbers for internal use.
311
+ */
312
+ this.parseValue = () => {
313
+ if (typeof this.value === 'string') {
314
+ console.error('Sliders require a number or array of numbers to be passed in the value prop.');
315
+ return;
316
+ }
317
+ if (this.range && this.value.length !== 2) {
318
+ console.error('Range sliders require an array of two values to be passed in the value prop.');
319
+ return;
320
+ }
321
+ if (!this.range && this.value.length !== 1) {
322
+ console.error('Single sliders require a single value as an array to be passed in the value prop.');
323
+ return;
324
+ }
325
+ this.valueInternal = this.value[0];
326
+ this.rangeValueInternal = [this.value[0], this.value[1]];
327
+ };
328
+ /**
329
+ * Handles pointer events on the track.
330
+ * @param {PointerEvent} event - The pointer event
331
+ */
332
+ this.onTrackInteraction = (event) => {
333
+ if (this.disabled || this.readonly) {
334
+ return;
335
+ }
336
+ const trackRect = event.currentTarget.getBoundingClientRect();
337
+ const percentage = clamp(((event.clientX - trackRect.left) / trackRect.width) * 100, 0, 100);
338
+ const newValue = this.min + (percentage / 100) * (this.max - this.min);
339
+ // Store raw position for visual display
340
+ this.rawPosition = newValue;
341
+ if (this.range) {
342
+ // In range mode, determine which thumb to move based on proximity
343
+ const leftPct = valueToPercent(this.rangeValueInternal[0], this.min, this.max);
344
+ const rightPct = valueToPercent(this.rangeValueInternal[1], this.min, this.max);
345
+ const distanceToLeft = Math.abs(percentage - leftPct);
346
+ const distanceToRight = Math.abs(percentage - rightPct);
347
+ if (distanceToLeft <= distanceToRight) {
348
+ this.activeDragThumb = 'left';
349
+ this.rawRangePosition = [newValue, this.rawRangePosition[1]];
350
+ this.handleValueChange([newValue, this.rangeValueInternal[1]]);
351
+ }
352
+ else {
353
+ this.activeDragThumb = 'right';
354
+ this.rawRangePosition = [this.rawRangePosition[0], newValue];
355
+ this.handleValueChange([this.rangeValueInternal[0], newValue]);
356
+ }
357
+ }
358
+ else {
359
+ this.activeDragThumb = 'single';
360
+ this.rawPosition = newValue;
361
+ this.handleValueChange(newValue);
362
+ }
363
+ this.isDragging = true;
364
+ this.registerGlobalEvents();
365
+ };
366
+ /**
367
+ * Handles pointer move events during drag.
368
+ * @param {PointerEvent} event - The pointer event
369
+ */
370
+ this.onPointerMove = (event) => {
371
+ if (!this.isDragging || this.disabled || this.readonly) {
372
+ return;
373
+ }
374
+ const trackElement = this.el.querySelector('.track');
375
+ if (!trackElement)
376
+ return;
377
+ const trackRect = trackElement.getBoundingClientRect();
378
+ const percentage = clamp(((event.clientX - trackRect.left) / trackRect.width) * 100, 0, 100);
379
+ const newValue = this.min + (percentage / 100) * (this.max - this.min);
380
+ // Update visual position
381
+ if (this.range) {
382
+ if (this.activeDragThumb === 'left') {
383
+ this.rawRangePosition = [newValue, this.rawRangePosition[1]];
384
+ this.handleValueChange([newValue, this.rangeValueInternal[1]]);
385
+ }
386
+ else {
387
+ this.rawRangePosition = [this.rawRangePosition[0], newValue];
388
+ this.handleValueChange([this.rangeValueInternal[0], newValue]);
389
+ }
390
+ }
391
+ else {
392
+ this.rawPosition = newValue;
393
+ this.handleValueChange(newValue);
394
+ }
395
+ };
396
+ /**
397
+ * Handles the end of a drag operation.
398
+ */
399
+ this.onPointerUp = () => {
400
+ this.isDragging = false;
401
+ this.removeGlobalEvents();
402
+ };
403
+ /**
404
+ * Handles keydown events for keyboard accessibility.
405
+ * @param {KeyboardEvent} event - The keyboard event
406
+ */
407
+ this.onKeyDown = (event) => {
408
+ if (this.disabled || this.readonly) {
409
+ return;
410
+ }
411
+ let newValue;
412
+ const stepMultiplier = event.shiftKey ? 10 : 1;
413
+ const singleStep = this.step * stepMultiplier;
414
+ if (this.range) {
415
+ const focusedThumb = event.target.getAttribute('data-thumb');
416
+ const idx = focusedThumb === 'left' ? 0 : 1;
417
+ const currentValue = [...this.rangeValueInternal];
418
+ switch (event.key) {
419
+ case 'ArrowRight':
420
+ case 'ArrowUp':
421
+ currentValue[idx] += singleStep;
422
+ break;
423
+ case 'ArrowLeft':
424
+ case 'ArrowDown':
425
+ currentValue[idx] -= singleStep;
426
+ break;
427
+ case 'Home':
428
+ currentValue[idx] = this.min;
429
+ break;
430
+ case 'End':
431
+ currentValue[idx] = this.max;
432
+ break;
433
+ case 'PageUp':
434
+ currentValue[idx] += singleStep * 10;
435
+ break;
436
+ case 'PageDown':
437
+ currentValue[idx] -= singleStep * 10;
438
+ break;
439
+ default:
440
+ return;
441
+ }
442
+ newValue = currentValue;
443
+ }
444
+ else {
445
+ switch (event.key) {
446
+ case 'ArrowRight':
447
+ case 'ArrowUp':
448
+ newValue = this.valueInternal + singleStep;
449
+ break;
450
+ case 'ArrowLeft':
451
+ case 'ArrowDown':
452
+ newValue = this.valueInternal - singleStep;
453
+ break;
454
+ case 'Home':
455
+ newValue = this.min;
456
+ break;
457
+ case 'End':
458
+ newValue = this.max;
459
+ break;
460
+ case 'PageUp':
461
+ newValue = this.valueInternal + singleStep * 10;
462
+ break;
463
+ case 'PageDown':
464
+ newValue = this.valueInternal - singleStep * 10;
465
+ break;
466
+ default:
467
+ return;
468
+ }
469
+ }
470
+ event.preventDefault();
471
+ this.handleValueChange(newValue);
472
+ };
473
+ /**
474
+ * Handles field input value changes.
475
+ * @param {Event} event - The input event
476
+ */
477
+ this.handleFieldChange = (event) => {
478
+ const input = event.target;
479
+ const newValue = parseFloat(input.value);
480
+ if (isNaN(newValue)) {
481
+ return;
482
+ }
483
+ if (this.range) {
484
+ const fieldIndex = input.getAttribute('data-index') === '0' ? 0 : 1;
485
+ const updatedRange = [...this.rangeValueInternal];
486
+ updatedRange[fieldIndex] = newValue;
487
+ this.handleValueChange(updatedRange);
488
+ }
489
+ else {
490
+ this.handleValueChange(newValue);
491
+ }
492
+ };
493
+ }
494
+ //#endregion STATE
495
+ /****************************************************************************/
496
+ //#region METHODS
497
+ /**
498
+ * Ensures value is valid and within bounds.
499
+ * @param {number} val - The value to validate
500
+ * @returns {number} The validated and snapped value
501
+ */
502
+ validateValue(val) {
503
+ // First ensure the value is within bounds
504
+ const clampedValue = clamp(val, this.min, this.max);
505
+ // If snapTicks is true and we have custom ticks, snap to the nearest tick
506
+ if (this.snapTicks && this.internalTicks && this.internalTicks.length > 0) {
507
+ return snapToTicks(clampedValue, this.internalTicks);
508
+ }
509
+ // Otherwise snap to step values
510
+ return snapToStep(clampedValue, this.min, this.max, this.step);
511
+ }
512
+ /**
513
+ * Handles value changes from slider interaction.
514
+ * @param {number | number[]} newValue - The new value or range values
515
+ */
516
+ handleValueChange(newValue) {
517
+ if (this.disabled || this.readonly) {
518
+ return;
519
+ }
520
+ if (this.range) {
521
+ // Handle range values
522
+ if (Array.isArray(newValue) && newValue.length === 2) {
523
+ // Ensure values are in order (left ≤ right)
524
+ const orderedValues = [
525
+ Math.min(newValue[0], newValue[1]),
526
+ Math.max(newValue[0], newValue[1]),
527
+ ];
528
+ // Snap to steps and clamp
529
+ const validatedValues = [
530
+ this.validateValue(orderedValues[0]),
531
+ this.validateValue(orderedValues[1]),
532
+ ];
533
+ if (validatedValues[0] !== this.rangeValueInternal[0] ||
534
+ validatedValues[1] !== this.rangeValueInternal[1]) {
535
+ this.rangeValueInternal = validatedValues;
536
+ this.value = this.rangeValueInternal;
537
+ this.valueChanged.emit(this.rangeValueInternal);
538
+ }
539
+ }
540
+ }
541
+ else {
542
+ // Handle single value
543
+ if (typeof newValue === 'number') {
544
+ const validatedValue = this.validateValue(newValue);
545
+ if (validatedValue !== this.valueInternal) {
546
+ this.valueInternal = validatedValue;
547
+ this.value = [this.valueInternal];
548
+ this.valueChanged.emit([this.valueInternal]);
549
+ }
550
+ }
551
+ }
552
+ }
553
+ /**
554
+ * Generates the ticks to display based on props and state.
555
+ */
556
+ generateDisplayTicks() {
557
+ // If custom ticks are provided, always use them regardless of showTicks setting
558
+ if (this.ticks && this.ticks.length > 0) {
559
+ this.internalTicks = [...this.ticks].sort((a, b) => a.value - b.value);
560
+ return;
561
+ }
562
+ // If showTicks is false and there are no custom ticks, hide all ticks
563
+ if (!this.showTicks) {
564
+ this.internalTicks = [];
565
+ return;
566
+ }
567
+ // Generate all ticks at each step point
568
+ const autoTicks = generateTicks(this.min, this.max, this.step);
569
+ this.internalTicks = autoTicks.map(value => ({ value }));
570
+ }
571
+ /**
572
+ * Registers global events for tracking pointer movement.
573
+ */
574
+ registerGlobalEvents() {
575
+ document.addEventListener('pointermove', this.onPointerMove);
576
+ document.addEventListener('pointerup', this.onPointerUp);
577
+ document.addEventListener('pointercancel', this.onPointerUp);
578
+ }
579
+ /**
580
+ * Removes global events when tracking ends.
581
+ */
582
+ removeGlobalEvents() {
583
+ document.removeEventListener('pointermove', this.onPointerMove);
584
+ document.removeEventListener('pointerup', this.onPointerUp);
585
+ document.removeEventListener('pointercancel', this.onPointerUp);
586
+ }
587
+ //#endregion METHODS
588
+ /****************************************************************************/
589
+ //#region WATCHERS
590
+ onValueChange() {
591
+ this.parseValue();
592
+ }
593
+ onConfigChange() {
594
+ this.generateDisplayTicks();
595
+ if (this.range) {
596
+ this.handleValueChange(this.rangeValueInternal);
597
+ }
598
+ else {
599
+ this.handleValueChange(this.valueInternal);
600
+ }
601
+ }
602
+ onRangeChange(newValue) {
603
+ if (newValue) {
604
+ // Switching to range mode
605
+ this.rangeValueInternal = [this.min, this.valueInternal];
606
+ }
607
+ else {
608
+ // Switching to single mode, take the higher value
609
+ this.valueInternal = this.rangeValueInternal[1];
610
+ }
611
+ }
612
+ //#endregion WATCHERS
613
+ /****************************************************************************/
614
+ //#region LIFECYCLE
615
+ connectedCallback() {
616
+ this.parseValue();
617
+ this.generateDisplayTicks();
618
+ // Initialize values and make sure they're valid
619
+ if (this.range) {
620
+ if (!Array.isArray(this.rangeValueInternal) ||
621
+ this.rangeValueInternal.length !== 2) {
622
+ this.rangeValueInternal = [this.min, this.max];
623
+ }
624
+ this.handleValueChange(this.rangeValueInternal);
625
+ // Initialize raw range position to match actual values
626
+ this.rawRangePosition = [
627
+ this.rangeValueInternal[0],
628
+ this.rangeValueInternal[1],
629
+ ];
630
+ }
631
+ else {
632
+ this.handleValueChange(this.valueInternal);
633
+ // Initialize raw position to match actual value
634
+ this.rawPosition = this.valueInternal;
635
+ }
636
+ }
637
+ disconnectedCallback() {
638
+ this.removeGlobalEvents();
639
+ }
640
+ //#endregion EVENTS
641
+ /****************************************************************************/
642
+ //#region RENDER
643
+ render() {
644
+ return (index.h(index.Host, { key: '5625de672648fc737a3c463241621c96e3f5678c' }, (this.label || this.el.querySelector('[slot="label"]')) && (index.h("label", { key: 'c9bb829857daf1f38a07ba8d851a126b8e1014d0', htmlFor: this.startInputId }, index.h("slot", { key: '86daceb63a9467395bd576ee8e2a1fd335dab8a9', name: "label" }, this.label))), index.h("div", { key: 'a2f9fcfd6f201926d59b1542cfb6aecb9995bfe6', class: "slider-container" }, this.range ? (index.h(FieldInput, { range: this.range, hasField: this.hasField, value: this.valueInternal, rangeValue: this.rangeValueInternal, index: 0, inputId: this.startInputId, min: this.min, max: this.max, step: this.step, disabled: this.disabled, readonly: this.readonly, onInput: this.handleFieldChange, labelBeforeValue: this.labelBeforeValue, labelAfterValue: this.labelAfterValue, name: this.name, endName: this.endName })) : null, index.h("div", { key: 'c217e21c05160391608196c689a506332cdd2c6a', class: "track-container" }, index.h("div", { key: 'eff5a66ed65ca210e66138dfcf345843e4947fe9', class: "track", onPointerDown: this.onTrackInteraction }, this.range ? (index.h(RangeThumb, { rangeValue: this.rangeValueInternal, rawRangePosition: this.rawRangePosition, activeDragThumb: this.activeDragThumb, isDragging: this.isDragging, snap: this.snap, min: this.min, max: this.max, disabled: this.disabled, readonly: this.readonly, onKeyDown: this.onKeyDown, labelBeforeValue: this.labelBeforeValue, labelAfterValue: this.labelAfterValue })) : (index.h(SingleThumb, { value: this.valueInternal, min: this.min, max: this.max, rawPosition: this.rawPosition, isDragging: this.isDragging, snap: this.snap, disabled: this.disabled, readonly: this.readonly, onKeyDown: this.onKeyDown, labelBeforeValue: this.labelBeforeValue, labelAfterValue: this.labelAfterValue }))), index.h(TickMarks, { key: 'a1168d80e444702014631c51770f81bc66c42c7e', ticks: this.internalTicks, min: this.min, max: this.max })), this.range ? (index.h(FieldInput, { range: this.range, hasField: this.hasField, value: this.valueInternal, rangeValue: this.rangeValueInternal, index: 1, inputId: this.endInputId, min: this.min, max: this.max, step: this.step, disabled: this.disabled, readonly: this.readonly, onInput: this.handleFieldChange, labelBeforeValue: this.labelBeforeValue, labelAfterValue: this.labelAfterValue, name: this.name, endName: this.endName })) : (index.h(FieldInput, { range: this.range, hasField: this.hasField, value: this.valueInternal, rangeValue: this.rangeValueInternal, inputId: this.startInputId, min: this.min, max: this.max, step: this.step, disabled: this.disabled, readonly: this.readonly, onInput: this.handleFieldChange, labelBeforeValue: this.labelBeforeValue, labelAfterValue: this.labelAfterValue, name: this.name }))), (this.success ||
645
+ this.description ||
646
+ this.el.querySelector('[slot="description"]')) && (index.h("div", { key: 'f92bc3bba0d12897563532d18873ed00cd01107c', class: "description" }, this.success && (index.h("nv-icon", { key: 'bbe9253cf1a560d1e5e398cece3bdc1dc65c5edc', name: "circle-check", class: "validation", size: "md" })), index.h("slot", { key: '52396d459eca326fd6e0e1587e79c5b1ab0f8e74', name: "description" }, this.description))), (this.error ||
647
+ this.errorDescription ||
648
+ this.el.querySelector('[slot="error-description"]')) && (index.h("div", { key: '2da1fec9cf6c1c5a2f5c0aa16c18d4b45f0758d9', class: "error-description", hidden: !this.error }, this.error && (index.h("nv-icon", { key: '9b97a3cc6d56971b6dda8263316f83ea4e35d257', name: "alert-circle", class: "validation", size: "md" })), index.h("slot", { key: 'f2a96d286c53529ebee99606bee0c43f9ff21b74', name: "error-description" }, this.errorDescription)))));
649
+ }
650
+ static get formAssociated() { return true; }
651
+ get el() { return index.getElement(this); }
652
+ static get watchers() { return {
653
+ "value": ["onValueChange"],
654
+ "min": ["onConfigChange"],
655
+ "max": ["onConfigChange"],
656
+ "step": ["onConfigChange"],
657
+ "ticks": ["onConfigChange"],
658
+ "showTicks": ["onConfigChange"],
659
+ "snap": ["onConfigChange"],
660
+ "snapTicks": ["onConfigChange"],
661
+ "range": ["onRangeChange"]
662
+ }; }
663
+ };
664
+ NvFieldslider.style = NvFieldsliderStyle0;
665
+
666
+ exports.nv_fieldslider = NvFieldslider;
667
+
668
+ //# sourceMappingURL=nv-fieldslider.cjs.entry.js.map