@nova-design-system/nova-webcomponents 3.2.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 (386) hide show
  1. package/dist/cjs/{index-108ddff0.js → index-c56424e5.js} +16 -184
  2. package/dist/cjs/index-c56424e5.js.map +1 -0
  3. package/dist/cjs/loader.cjs.js +2 -2
  4. package/dist/cjs/native.cjs.js +2 -23
  5. package/dist/cjs/native.cjs.js.map +1 -1
  6. package/dist/cjs/nv-alert.cjs.entry.js +1 -1
  7. package/dist/cjs/nv-avatar.cjs.entry.js +1 -1
  8. package/dist/cjs/nv-badge_2.cjs.entry.js +1 -1
  9. package/dist/cjs/nv-breadcrumb.cjs.entry.js +1 -1
  10. package/dist/cjs/nv-breadcrumbs.cjs.entry.js +1 -1
  11. package/dist/cjs/nv-button.cjs.entry.js +1 -1
  12. package/dist/cjs/nv-calendar.cjs.entry.js +371 -138
  13. package/dist/cjs/nv-calendar.cjs.entry.js.map +1 -1
  14. package/dist/cjs/nv-col.cjs.entry.js +1 -1
  15. package/dist/cjs/nv-datagrid.cjs.entry.js +1 -1
  16. package/dist/cjs/nv-datagridcolumn.cjs.entry.js +1 -1
  17. package/dist/cjs/nv-dialog.cjs.entry.js +1 -1
  18. package/dist/cjs/nv-dialogfooter_2.cjs.entry.js +1 -1
  19. package/dist/cjs/nv-fieldcheckbox.cjs.entry.js +1 -1
  20. package/dist/cjs/nv-fielddate.cjs.entry.js +45 -11
  21. package/dist/cjs/nv-fielddate.cjs.entry.js.map +1 -1
  22. package/dist/cjs/nv-fielddaterange.cjs.entry.js +75 -44
  23. package/dist/cjs/nv-fielddaterange.cjs.entry.js.map +1 -1
  24. package/dist/cjs/nv-fielddropdown.cjs.entry.js +2 -2
  25. package/dist/cjs/nv-fielddropdown.cjs.entry.js.map +1 -1
  26. package/dist/cjs/nv-fielddropdownitem.cjs.entry.js +1 -1
  27. package/dist/cjs/nv-fieldmultiselect.cjs.entry.js +2 -2
  28. package/dist/cjs/nv-fieldmultiselect.cjs.entry.js.map +1 -1
  29. package/dist/cjs/nv-fieldnumber.cjs.entry.js +2 -2
  30. package/dist/cjs/nv-fieldnumber.cjs.entry.js.map +1 -1
  31. package/dist/cjs/nv-fieldpassword.cjs.entry.js +2 -2
  32. package/dist/cjs/nv-fieldpassword.cjs.entry.js.map +1 -1
  33. package/dist/cjs/nv-fieldradio.cjs.entry.js +1 -1
  34. package/dist/cjs/nv-fieldselect.cjs.entry.js +2 -2
  35. package/dist/cjs/nv-fieldselect.cjs.entry.js.map +1 -1
  36. package/dist/cjs/nv-fieldslider.cjs.entry.js +25 -20
  37. package/dist/cjs/nv-fieldslider.cjs.entry.js.map +1 -1
  38. package/dist/cjs/nv-fieldtext.cjs.entry.js +2 -2
  39. package/dist/cjs/nv-fieldtext.cjs.entry.js.map +1 -1
  40. package/dist/cjs/nv-fieldtextarea.cjs.entry.js +2 -2
  41. package/dist/cjs/nv-fieldtextarea.cjs.entry.js.map +1 -1
  42. package/dist/cjs/nv-fieldtime.cjs.entry.js +2 -2
  43. package/dist/cjs/nv-fieldtime.cjs.entry.js.map +1 -1
  44. package/dist/cjs/nv-icon.cjs.entry.js +1 -1
  45. package/dist/cjs/nv-iconbutton_2.cjs.entry.js +1 -1
  46. package/dist/cjs/nv-menu.cjs.entry.js +1 -1
  47. package/dist/cjs/nv-menuitem.cjs.entry.js +1 -1
  48. package/dist/cjs/nv-popover.cjs.entry.js +1 -1
  49. package/dist/cjs/nv-row.cjs.entry.js +1 -1
  50. package/dist/cjs/nv-stack.cjs.entry.js +1 -1
  51. package/dist/cjs/nv-table.cjs.entry.js +1 -1
  52. package/dist/cjs/nv-tablecolumn.cjs.entry.js +1 -1
  53. package/dist/cjs/nv-toggle.cjs.entry.js +1 -1
  54. package/dist/cjs/nv-tooltip.cjs.entry.js +1 -1
  55. package/dist/collection/components/nv-calendar/nv-calendar.js +235 -136
  56. package/dist/collection/components/nv-calendar/nv-calendar.js.map +1 -1
  57. package/dist/collection/components/nv-calendar/nv-calendar.utils.js +12 -3
  58. package/dist/collection/components/nv-calendar/nv-calendar.utils.js.map +1 -1
  59. package/dist/collection/components/nv-calendar/partials/calendar-actions.js +11 -0
  60. package/dist/collection/components/nv-calendar/partials/calendar-actions.js.map +1 -0
  61. package/dist/collection/components/nv-calendar/partials/calendar-grid.js +24 -0
  62. package/dist/collection/components/nv-calendar/partials/calendar-grid.js.map +1 -0
  63. package/dist/collection/components/nv-calendar/partials/calendar-header.js +38 -0
  64. package/dist/collection/components/nv-calendar/partials/calendar-header.js.map +1 -0
  65. package/dist/collection/components/nv-calendar/partials/calendar-shortcuts.js +22 -0
  66. package/dist/collection/components/nv-calendar/partials/calendar-shortcuts.js.map +1 -0
  67. package/dist/collection/components/nv-calendar/partials/day-cell.js +31 -0
  68. package/dist/collection/components/nv-calendar/partials/day-cell.js.map +1 -0
  69. package/dist/collection/components/nv-calendar/partials/index.js +7 -0
  70. package/dist/collection/components/nv-calendar/partials/index.js.map +1 -0
  71. package/dist/collection/components/nv-calendar/partials/week-numbers.js +36 -0
  72. package/dist/collection/components/nv-calendar/partials/week-numbers.js.map +1 -0
  73. package/dist/collection/components/nv-calendar/test/nv-calendar.utils.test.js +692 -651
  74. package/dist/collection/components/nv-calendar/test/nv-calendar.utils.test.js.map +1 -1
  75. package/dist/collection/components/nv-calendar/test/partials/calendar-actions.logic.test.js +169 -0
  76. package/dist/collection/components/nv-calendar/test/partials/calendar-actions.logic.test.js.map +1 -0
  77. package/dist/collection/components/nv-calendar/test/partials/calendar-grid.logic.test.js +262 -0
  78. package/dist/collection/components/nv-calendar/test/partials/calendar-grid.logic.test.js.map +1 -0
  79. package/dist/collection/components/nv-calendar/test/partials/calendar-header.logic.test.js +208 -0
  80. package/dist/collection/components/nv-calendar/test/partials/calendar-header.logic.test.js.map +1 -0
  81. package/dist/collection/components/nv-calendar/test/partials/calendar-shortcuts.logic.test.js +355 -0
  82. package/dist/collection/components/nv-calendar/test/partials/calendar-shortcuts.logic.test.js.map +1 -0
  83. package/dist/collection/components/nv-calendar/test/partials/day-cell.logic.test.js +250 -0
  84. package/dist/collection/components/nv-calendar/test/partials/day-cell.logic.test.js.map +1 -0
  85. package/dist/collection/components/nv-calendar/test/partials/week-numbers.logic.test.js +217 -0
  86. package/dist/collection/components/nv-calendar/test/partials/week-numbers.logic.test.js.map +1 -0
  87. package/dist/collection/components/nv-fielddate/nv-fielddate.js +56 -16
  88. package/dist/collection/components/nv-fielddate/nv-fielddate.js.map +1 -1
  89. package/dist/collection/components/nv-fielddate/styles/nv-fielddate.css +44 -0
  90. package/dist/collection/components/nv-fielddate/test/nv-fielddate.logic.test.js +196 -0
  91. package/dist/collection/components/nv-fielddate/test/nv-fielddate.logic.test.js.map +1 -0
  92. package/dist/collection/components/nv-fielddaterange/nv-fielddaterange.js +99 -43
  93. package/dist/collection/components/nv-fielddaterange/nv-fielddaterange.js.map +1 -1
  94. package/dist/collection/components/nv-fielddaterange/styles/nv-fielddaterange.css +44 -0
  95. package/dist/collection/components/nv-fielddaterange/test/nv-fielddaterange.logic.test.js +137 -0
  96. package/dist/collection/components/nv-fielddaterange/test/nv-fielddaterange.logic.test.js.map +1 -0
  97. package/dist/collection/components/nv-fielddropdown/styles/nv-fielddropdown.css +46 -0
  98. package/dist/collection/components/nv-fieldmultiselect/styles/nv-fieldmultiselect.css +46 -0
  99. package/dist/collection/components/nv-fieldnumber/nv-fieldnumber.css +44 -0
  100. package/dist/collection/components/nv-fieldpassword/nv-fieldpassword.css +44 -0
  101. package/dist/collection/components/nv-fieldselect/nv-fieldselect.css +44 -0
  102. package/dist/collection/components/nv-fieldslider/nv-fieldslider.docs.js +22 -22
  103. package/dist/collection/components/nv-fieldslider/nv-fieldslider.docs.js.map +1 -1
  104. package/dist/collection/components/nv-fieldslider/nv-fieldslider.js +30 -29
  105. package/dist/collection/components/nv-fieldslider/nv-fieldslider.js.map +1 -1
  106. package/dist/collection/components/nv-fieldslider/styles/nv-fieldslider.css +91 -20
  107. package/dist/collection/components/nv-fieldtext/nv-fieldtext.css +44 -0
  108. package/dist/collection/components/nv-fieldtextarea/nv-fieldtextarea.css +38 -0
  109. package/dist/collection/components/nv-fieldtime/styles/nv-fieldtime.css +44 -0
  110. package/dist/components/index.js +1 -1
  111. package/dist/components/nv-alert.js +2 -2
  112. package/dist/components/nv-avatar.js +2 -2
  113. package/dist/components/nv-badge.js +1 -1
  114. package/dist/components/nv-breadcrumb.js +3 -3
  115. package/dist/components/nv-breadcrumbs.js +1 -1
  116. package/dist/components/nv-button.js +1 -1
  117. package/dist/components/nv-calendar.js +1 -1
  118. package/dist/components/nv-col.js +1 -1
  119. package/dist/components/nv-datagrid.js +3 -3
  120. package/dist/components/nv-datagridcolumn.js +1 -1
  121. package/dist/components/nv-dialog.js +6 -6
  122. package/dist/components/nv-dialogfooter.js +1 -1
  123. package/dist/components/nv-dialogheader.js +1 -1
  124. package/dist/components/nv-fieldcheckbox.js +1 -1
  125. package/dist/components/nv-fielddate.js +53 -25
  126. package/dist/components/nv-fielddate.js.map +1 -1
  127. package/dist/components/nv-fielddaterange.js +85 -61
  128. package/dist/components/nv-fielddaterange.js.map +1 -1
  129. package/dist/components/nv-fielddropdown.js +7 -7
  130. package/dist/components/nv-fielddropdown.js.map +1 -1
  131. package/dist/components/nv-fielddropdownitem.js +1 -1
  132. package/dist/components/nv-fielddropdownitemcheck.js +1 -1
  133. package/dist/components/nv-fieldmultiselect.js +9 -9
  134. package/dist/components/nv-fieldmultiselect.js.map +1 -1
  135. package/dist/components/nv-fieldnumber.js +5 -5
  136. package/dist/components/nv-fieldnumber.js.map +1 -1
  137. package/dist/components/nv-fieldpassword.js +5 -5
  138. package/dist/components/nv-fieldpassword.js.map +1 -1
  139. package/dist/components/nv-fieldradio.js +1 -1
  140. package/dist/components/nv-fieldselect.js +5 -5
  141. package/dist/components/nv-fieldselect.js.map +1 -1
  142. package/dist/components/nv-fieldslider.js +27 -22
  143. package/dist/components/nv-fieldslider.js.map +1 -1
  144. package/dist/components/nv-fieldtext.js +1 -1
  145. package/dist/components/nv-fieldtextarea.js +2 -2
  146. package/dist/components/nv-fieldtextarea.js.map +1 -1
  147. package/dist/components/nv-fieldtime.js +6 -6
  148. package/dist/components/nv-fieldtime.js.map +1 -1
  149. package/dist/components/nv-icon.js +1 -1
  150. package/dist/components/nv-iconbutton.js +1 -1
  151. package/dist/components/nv-loader.js +1 -1
  152. package/dist/components/nv-menu.js +4 -4
  153. package/dist/components/nv-menuitem.js +1 -1
  154. package/dist/components/nv-popover.js +1 -1
  155. package/dist/components/nv-row.js +1 -1
  156. package/dist/components/nv-stack.js +1 -1
  157. package/dist/components/nv-table.js +1 -1
  158. package/dist/components/nv-tablecolumn.js +1 -1
  159. package/dist/components/nv-toggle.js +1 -1
  160. package/dist/components/nv-tooltip.js +1 -1
  161. package/dist/components/{p-d63f1cbe.js → p-2ae214d2.js} +3 -3
  162. package/dist/components/{p-d63f1cbe.js.map → p-2ae214d2.js.map} +1 -1
  163. package/dist/components/{p-c0a91091.js → p-3e32b5a1.js} +3 -3
  164. package/dist/components/{p-c0a91091.js.map → p-3e32b5a1.js.map} +1 -1
  165. package/dist/components/{p-4656efae.js → p-5e90b9b8.js} +376 -165
  166. package/dist/components/p-5e90b9b8.js.map +1 -0
  167. package/dist/components/{p-cbe9521f.js → p-5ee4015d.js} +3 -3
  168. package/dist/components/{p-cbe9521f.js.map → p-5ee4015d.js.map} +1 -1
  169. package/dist/components/{p-33e231f4.js → p-6277f746.js} +2 -2
  170. package/dist/components/{p-33e231f4.js.map → p-6277f746.js.map} +1 -1
  171. package/dist/components/{p-f0a5e7e4.js → p-7935c1cb.js} +4 -4
  172. package/dist/components/{p-f0a5e7e4.js.map → p-7935c1cb.js.map} +1 -1
  173. package/dist/components/{p-f1859ddc.js → p-8d92f0e1.js} +3 -3
  174. package/dist/components/{p-f1859ddc.js.map → p-8d92f0e1.js.map} +1 -1
  175. package/dist/components/{p-cbdc2c8b.js → p-95a7581c.js} +5 -5
  176. package/dist/components/{p-cbdc2c8b.js.map → p-95a7581c.js.map} +1 -1
  177. package/dist/components/{p-dd2273a3.js → p-9e6e26cb.js} +2 -2
  178. package/dist/components/{p-dd2273a3.js.map → p-9e6e26cb.js.map} +1 -1
  179. package/dist/components/{p-76a30bf1.js → p-9fa0de38.js} +2 -2
  180. package/dist/components/{p-76a30bf1.js.map → p-9fa0de38.js.map} +1 -1
  181. package/dist/components/{p-679e0fa9.js → p-aff3ed68.js} +10 -175
  182. package/dist/components/p-aff3ed68.js.map +1 -0
  183. package/dist/components/{p-d19b41d2.js → p-b6d858b2.js} +2 -2
  184. package/dist/components/{p-d19b41d2.js.map → p-b6d858b2.js.map} +1 -1
  185. package/dist/components/{p-83c8873a.js → p-bb6d1e4e.js} +2 -2
  186. package/dist/components/{p-83c8873a.js.map → p-bb6d1e4e.js.map} +1 -1
  187. package/dist/components/{p-581e67cc.js → p-c07c32d2.js} +3 -3
  188. package/dist/components/{p-581e67cc.js.map → p-c07c32d2.js.map} +1 -1
  189. package/dist/components/{p-04cb3a6f.js → p-c9006520.js} +4 -4
  190. package/dist/components/{p-04cb3a6f.js.map → p-c9006520.js.map} +1 -1
  191. package/dist/components/{p-07a89754.js → p-e28c4707.js} +3 -3
  192. package/dist/components/{p-07a89754.js.map → p-e28c4707.js.map} +1 -1
  193. package/dist/components/{p-0ab80d95.js → p-eabbc885.js} +2 -2
  194. package/dist/components/{p-0ab80d95.js.map → p-eabbc885.js.map} +1 -1
  195. package/dist/esm/{constants-b97e736d.js → constants-4faa1fae.js} +2 -2
  196. package/dist/esm/{constants-b97e736d.js.map → constants-4faa1fae.js.map} +1 -1
  197. package/dist/esm/{index-8f0e5f19.js → index-a1936cd0.js} +17 -184
  198. package/dist/esm/index-a1936cd0.js.map +1 -0
  199. package/dist/esm/index.js +1 -1
  200. package/dist/esm/loader.js +3 -3
  201. package/dist/esm/native.js +3 -24
  202. package/dist/esm/native.js.map +1 -1
  203. package/dist/esm/nv-alert.entry.js +2 -2
  204. package/dist/esm/nv-avatar.entry.js +2 -2
  205. package/dist/esm/nv-badge_2.entry.js +1 -1
  206. package/dist/esm/nv-breadcrumb.entry.js +1 -1
  207. package/dist/esm/nv-breadcrumbs.entry.js +1 -1
  208. package/dist/esm/nv-button.entry.js +2 -2
  209. package/dist/esm/nv-calendar.entry.js +372 -139
  210. package/dist/esm/nv-calendar.entry.js.map +1 -1
  211. package/dist/esm/nv-col.entry.js +1 -1
  212. package/dist/esm/nv-datagrid.entry.js +2 -2
  213. package/dist/esm/nv-datagridcolumn.entry.js +1 -1
  214. package/dist/esm/nv-dialog.entry.js +2 -2
  215. package/dist/esm/nv-dialogfooter_2.entry.js +2 -2
  216. package/dist/esm/nv-fieldcheckbox.entry.js +1 -1
  217. package/dist/esm/nv-fielddate.entry.js +45 -11
  218. package/dist/esm/nv-fielddate.entry.js.map +1 -1
  219. package/dist/esm/nv-fielddaterange.entry.js +75 -44
  220. package/dist/esm/nv-fielddaterange.entry.js.map +1 -1
  221. package/dist/esm/nv-fielddropdown.entry.js +2 -2
  222. package/dist/esm/nv-fielddropdown.entry.js.map +1 -1
  223. package/dist/esm/nv-fielddropdownitem.entry.js +1 -1
  224. package/dist/esm/nv-fieldmultiselect.entry.js +2 -2
  225. package/dist/esm/nv-fieldmultiselect.entry.js.map +1 -1
  226. package/dist/esm/nv-fieldnumber.entry.js +2 -2
  227. package/dist/esm/nv-fieldnumber.entry.js.map +1 -1
  228. package/dist/esm/nv-fieldpassword.entry.js +2 -2
  229. package/dist/esm/nv-fieldpassword.entry.js.map +1 -1
  230. package/dist/esm/nv-fieldradio.entry.js +1 -1
  231. package/dist/esm/nv-fieldselect.entry.js +2 -2
  232. package/dist/esm/nv-fieldselect.entry.js.map +1 -1
  233. package/dist/esm/nv-fieldslider.entry.js +25 -20
  234. package/dist/esm/nv-fieldslider.entry.js.map +1 -1
  235. package/dist/esm/nv-fieldtext.entry.js +2 -2
  236. package/dist/esm/nv-fieldtext.entry.js.map +1 -1
  237. package/dist/esm/nv-fieldtextarea.entry.js +2 -2
  238. package/dist/esm/nv-fieldtextarea.entry.js.map +1 -1
  239. package/dist/esm/nv-fieldtime.entry.js +3 -3
  240. package/dist/esm/nv-fieldtime.entry.js.map +1 -1
  241. package/dist/esm/nv-icon.entry.js +2 -2
  242. package/dist/esm/nv-iconbutton_2.entry.js +1 -1
  243. package/dist/esm/nv-menu.entry.js +1 -1
  244. package/dist/esm/nv-menuitem.entry.js +1 -1
  245. package/dist/esm/nv-popover.entry.js +1 -1
  246. package/dist/esm/nv-row.entry.js +1 -1
  247. package/dist/esm/nv-stack.entry.js +1 -1
  248. package/dist/esm/nv-table.entry.js +1 -1
  249. package/dist/esm/nv-tablecolumn.entry.js +1 -1
  250. package/dist/esm/nv-toggle.entry.js +1 -1
  251. package/dist/esm/nv-tooltip.entry.js +1 -1
  252. package/dist/native/index.esm.js +1 -1
  253. package/dist/native/native.css +1 -1
  254. package/dist/native/native.esm.js +1 -1
  255. package/dist/native/native.esm.js.map +1 -1
  256. package/dist/native/p-050d6c6c.entry.js +2 -0
  257. package/dist/native/{p-adc96c3a.entry.js.map → p-050d6c6c.entry.js.map} +1 -1
  258. package/dist/native/{p-519b4819.entry.js → p-08ca678c.entry.js} +2 -2
  259. package/dist/native/p-1a5d3b87.entry.js +2 -0
  260. package/dist/native/{p-7c676f2c.entry.js.map → p-1a5d3b87.entry.js.map} +1 -1
  261. package/dist/native/{p-0323daf6.entry.js → p-1c1ecd38.entry.js} +2 -2
  262. package/dist/native/{p-16a4cdf3.entry.js → p-1d98477d.entry.js} +2 -2
  263. package/dist/native/{p-19fb0fd0.entry.js → p-2006f5d4.entry.js} +2 -2
  264. package/dist/native/p-26cf4938.entry.js +2 -0
  265. package/dist/native/p-26cf4938.entry.js.map +1 -0
  266. package/dist/native/p-3817efb2.entry.js +2 -0
  267. package/dist/native/{p-fb897f7d.entry.js.map → p-3817efb2.entry.js.map} +1 -1
  268. package/dist/native/p-45459dbb.entry.js +2 -0
  269. package/dist/native/{p-5382eab2.entry.js.map → p-45459dbb.entry.js.map} +1 -1
  270. package/dist/native/p-45cbe6e4.entry.js +2 -0
  271. package/dist/native/p-46428304.entry.js +2 -0
  272. package/dist/native/p-46428304.entry.js.map +1 -0
  273. package/dist/native/{p-7092a675.entry.js → p-4f9cdf0b.entry.js} +2 -2
  274. package/dist/native/{p-cfe0a6c6.entry.js → p-58bb90ad.entry.js} +2 -2
  275. package/dist/native/p-59b07b36.entry.js +2 -0
  276. package/dist/native/{p-987c79d8.entry.js.map → p-59b07b36.entry.js.map} +1 -1
  277. package/dist/native/{p-4c0d81b0.entry.js → p-5b6c59e0.entry.js} +2 -2
  278. package/dist/native/p-6029e51b.entry.js +2 -0
  279. package/dist/native/{p-fc3bea07.entry.js.map → p-6029e51b.entry.js.map} +1 -1
  280. package/dist/native/{p-a2c0f1a7.entry.js → p-60c64f2b.entry.js} +2 -2
  281. package/dist/native/{p-3f2b6a22.entry.js → p-64a76565.entry.js} +2 -2
  282. package/dist/native/{p-c930adb7.entry.js → p-83288db0.entry.js} +2 -2
  283. package/dist/native/p-838f7842.entry.js +2 -0
  284. package/dist/native/{p-b0fc08e7.entry.js.map → p-838f7842.entry.js.map} +1 -1
  285. package/dist/native/{p-407fc32d.entry.js → p-86ab23ea.entry.js} +2 -2
  286. package/dist/native/p-87784622.entry.js +2 -0
  287. package/dist/native/p-8fb4e5c0.entry.js +2 -0
  288. package/dist/native/{p-5ba3fc3c.entry.js.map → p-8fb4e5c0.entry.js.map} +1 -1
  289. package/dist/native/{p-05d95d4d.entry.js → p-914da1e1.entry.js} +2 -2
  290. package/dist/native/p-abbe5d69.entry.js +2 -0
  291. package/dist/native/{p-7c6edd1c.entry.js.map → p-abbe5d69.entry.js.map} +1 -1
  292. package/dist/native/p-abc251aa.entry.js +2 -0
  293. package/dist/native/p-abc251aa.entry.js.map +1 -0
  294. package/dist/native/{p-221b8f72.entry.js → p-ad128108.entry.js} +2 -2
  295. package/dist/native/{p-f0ddf60b.entry.js → p-b5b9190a.entry.js} +2 -2
  296. package/dist/native/{p-de2c07a6.entry.js → p-b8f2c1e7.entry.js} +2 -2
  297. package/dist/native/{p-9fba8663.entry.js → p-d040bd61.entry.js} +2 -2
  298. package/dist/native/p-d0a33e64.js +3 -0
  299. package/dist/native/p-d0a33e64.js.map +1 -0
  300. package/dist/native/{p-ed488498.entry.js → p-d21b2da2.entry.js} +3 -3
  301. package/dist/native/{p-0ec1e2e3.entry.js → p-d53e8795.entry.js} +2 -2
  302. package/dist/native/p-dc7dd7f3.entry.js +2 -0
  303. package/dist/native/{p-21e7132f.entry.js.map → p-dc7dd7f3.entry.js.map} +1 -1
  304. package/dist/native/p-e2c1992e.entry.js +2 -0
  305. package/dist/native/{p-60b204ac.entry.js.map → p-e2c1992e.entry.js.map} +1 -1
  306. package/dist/native/{p-f85c08f1.js → p-e2d0a77d.js} +2 -2
  307. package/dist/native/p-ed6019fe.entry.js +2 -0
  308. package/dist/native/p-ed6019fe.entry.js.map +1 -0
  309. package/dist/native/p-f94d7054.entry.js +2 -0
  310. package/dist/native/{p-aa86af25.entry.js.map → p-f94d7054.entry.js.map} +1 -1
  311. package/dist/native/p-fdea17ce.entry.js +2 -0
  312. package/dist/native/{p-ef76178b.entry.js.map → p-fdea17ce.entry.js.map} +1 -1
  313. package/dist/types/components/nv-calendar/nv-calendar.d.ts +25 -45
  314. package/dist/types/components/nv-calendar/partials/calendar-actions.d.ts +19 -0
  315. package/dist/types/components/nv-calendar/partials/calendar-grid.d.ts +46 -0
  316. package/dist/types/components/nv-calendar/partials/calendar-header.d.ts +38 -0
  317. package/dist/types/components/nv-calendar/partials/calendar-shortcuts.d.ts +35 -0
  318. package/dist/types/components/nv-calendar/partials/day-cell.d.ts +35 -0
  319. package/dist/types/components/nv-calendar/partials/index.d.ts +6 -0
  320. package/dist/types/components/nv-calendar/partials/week-numbers.d.ts +30 -0
  321. package/dist/types/components/nv-calendar/test/partials/calendar-actions.logic.test.d.ts +1 -0
  322. package/dist/types/components/nv-calendar/test/partials/calendar-grid.logic.test.d.ts +1 -0
  323. package/dist/types/components/nv-calendar/test/partials/calendar-header.logic.test.d.ts +1 -0
  324. package/dist/types/components/nv-calendar/test/partials/calendar-shortcuts.logic.test.d.ts +1 -0
  325. package/dist/types/components/nv-calendar/test/partials/day-cell.logic.test.d.ts +1 -0
  326. package/dist/types/components/nv-calendar/test/partials/week-numbers.logic.test.d.ts +1 -0
  327. package/dist/types/components/nv-fielddate/nv-fielddate.d.ts +21 -9
  328. package/dist/types/components/nv-fielddate/test/nv-fielddate.logic.test.d.ts +1 -0
  329. package/dist/types/components/nv-fielddaterange/nv-fielddaterange.d.ts +17 -6
  330. package/dist/types/components/nv-fielddaterange/test/nv-fielddaterange.logic.test.d.ts +1 -0
  331. package/dist/types/components/nv-fieldslider/nv-fieldslider.d.ts +5 -6
  332. package/dist/types/components.d.ts +37 -38
  333. package/dist/vscode-data.json +4 -4
  334. package/hydrate/index.js +530 -229
  335. package/hydrate/index.mjs +530 -229
  336. package/package.json +1 -1
  337. package/dist/cjs/index-108ddff0.js.map +0 -1
  338. package/dist/components/p-4656efae.js.map +0 -1
  339. package/dist/components/p-679e0fa9.js.map +0 -1
  340. package/dist/esm/index-8f0e5f19.js.map +0 -1
  341. package/dist/native/p-1e3d3374.entry.js +0 -2
  342. package/dist/native/p-21e7132f.entry.js +0 -2
  343. package/dist/native/p-2805f9f2.entry.js +0 -2
  344. package/dist/native/p-2805f9f2.entry.js.map +0 -1
  345. package/dist/native/p-5382eab2.entry.js +0 -2
  346. package/dist/native/p-5ba3fc3c.entry.js +0 -2
  347. package/dist/native/p-60b204ac.entry.js +0 -2
  348. package/dist/native/p-711a7778.js +0 -3
  349. package/dist/native/p-711a7778.js.map +0 -1
  350. package/dist/native/p-759c9ce4.entry.js +0 -2
  351. package/dist/native/p-759c9ce4.entry.js.map +0 -1
  352. package/dist/native/p-7c676f2c.entry.js +0 -2
  353. package/dist/native/p-7c6edd1c.entry.js +0 -2
  354. package/dist/native/p-987c79d8.entry.js +0 -2
  355. package/dist/native/p-aa86af25.entry.js +0 -2
  356. package/dist/native/p-adc96c3a.entry.js +0 -2
  357. package/dist/native/p-b0fc08e7.entry.js +0 -2
  358. package/dist/native/p-d07ab618.entry.js +0 -2
  359. package/dist/native/p-dac0089b.entry.js +0 -2
  360. package/dist/native/p-dac0089b.entry.js.map +0 -1
  361. package/dist/native/p-ef76178b.entry.js +0 -2
  362. package/dist/native/p-f39803d9.entry.js +0 -2
  363. package/dist/native/p-f39803d9.entry.js.map +0 -1
  364. package/dist/native/p-fb897f7d.entry.js +0 -2
  365. package/dist/native/p-fc3bea07.entry.js +0 -2
  366. /package/dist/native/{p-519b4819.entry.js.map → p-08ca678c.entry.js.map} +0 -0
  367. /package/dist/native/{p-0323daf6.entry.js.map → p-1c1ecd38.entry.js.map} +0 -0
  368. /package/dist/native/{p-16a4cdf3.entry.js.map → p-1d98477d.entry.js.map} +0 -0
  369. /package/dist/native/{p-19fb0fd0.entry.js.map → p-2006f5d4.entry.js.map} +0 -0
  370. /package/dist/native/{p-1e3d3374.entry.js.map → p-45cbe6e4.entry.js.map} +0 -0
  371. /package/dist/native/{p-7092a675.entry.js.map → p-4f9cdf0b.entry.js.map} +0 -0
  372. /package/dist/native/{p-cfe0a6c6.entry.js.map → p-58bb90ad.entry.js.map} +0 -0
  373. /package/dist/native/{p-4c0d81b0.entry.js.map → p-5b6c59e0.entry.js.map} +0 -0
  374. /package/dist/native/{p-a2c0f1a7.entry.js.map → p-60c64f2b.entry.js.map} +0 -0
  375. /package/dist/native/{p-3f2b6a22.entry.js.map → p-64a76565.entry.js.map} +0 -0
  376. /package/dist/native/{p-c930adb7.entry.js.map → p-83288db0.entry.js.map} +0 -0
  377. /package/dist/native/{p-407fc32d.entry.js.map → p-86ab23ea.entry.js.map} +0 -0
  378. /package/dist/native/{p-d07ab618.entry.js.map → p-87784622.entry.js.map} +0 -0
  379. /package/dist/native/{p-05d95d4d.entry.js.map → p-914da1e1.entry.js.map} +0 -0
  380. /package/dist/native/{p-221b8f72.entry.js.map → p-ad128108.entry.js.map} +0 -0
  381. /package/dist/native/{p-f0ddf60b.entry.js.map → p-b5b9190a.entry.js.map} +0 -0
  382. /package/dist/native/{p-de2c07a6.entry.js.map → p-b8f2c1e7.entry.js.map} +0 -0
  383. /package/dist/native/{p-9fba8663.entry.js.map → p-d040bd61.entry.js.map} +0 -0
  384. /package/dist/native/{p-ed488498.entry.js.map → p-d21b2da2.entry.js.map} +0 -0
  385. /package/dist/native/{p-0ec1e2e3.entry.js.map → p-d53e8795.entry.js.map} +0 -0
  386. /package/dist/native/{p-f85c08f1.js.map → p-e2d0a77d.js.map} +0 -0
@@ -1,3 +1,41 @@
1
+ /* TODO: integrate this logic in the proper structure */
2
+ nv-fieldslider .slider-container .track-container:has(.thumb:hover) .track-range {
3
+ background: var(--components-slider-track-filled-hover);
4
+ }
5
+ nv-fieldslider .slider-container .track-container:has(.thumb:hover) .thumb {
6
+ border-color: var(--components-slider-track-filled-hover);
7
+ }
8
+ nv-fieldslider .slider-container .track-container:has(.thumb:focus) .track-range {
9
+ background: var(--components-slider-track-filled-focus);
10
+ }
11
+ nv-fieldslider .slider-container .track-container:has(.thumb:focus) .thumb {
12
+ border-color: var(--components-slider-track-filled-focus);
13
+ }
14
+ nv-fieldslider[error] .slider-container .track-container .track .track-range {
15
+ background: var(--components-slider-track-filled-error);
16
+ }
17
+ nv-fieldslider[error] .slider-container .track-container .track .thumb {
18
+ border-color: var(--components-slider-track-filled-error);
19
+ }
20
+ nv-fieldslider[error] .slider-container .track-container .track .thumb:hover {
21
+ border-color: var(--components-slider-track-filled-error);
22
+ outline: calc(var(--focus-outline-stroke) * 1) solid var(--components-slider-track-filled-error);
23
+ outline-offset: calc(var(--focus-outline-offset) * 1);
24
+ background-color: var(--components-slider-handler-background-error);
25
+ }
26
+ nv-fieldslider[error] .slider-container .track-container .track .thumb:focus {
27
+ border-color: var(--components-slider-track-filled-error);
28
+ outline: calc(var(--focus-outline-stroke) * 1) solid var(--components-slider-track-filled-error);
29
+ outline-offset: calc(var(--focus-outline-offset) * 1);
30
+ background-color: var(--components-slider-track-filled-error);
31
+ }
32
+ nv-fieldslider[error] .slider-container .track-container:has(.thumb:hover) .track-range {
33
+ background: var(--components-slider-track-filled-error);
34
+ }
35
+ nv-fieldslider[error] .slider-container .track-container:has(.thumb:hover) .thumb {
36
+ border-color: var(--components-slider-track-filled-error);
37
+ }
38
+
1
39
  nv-fielddate {
2
40
  --nv-field-border-default: var(--components-form-field-border-default);
3
41
  --nv-field-border-hover: var(--components-form-field-border-hover);
@@ -128,6 +166,7 @@ nv-fielddate .input-wrapper .input-container input {
128
166
  font-weight: 500;
129
167
  line-height: var(--form-field-line-height);
130
168
  width: 100%;
169
+ /* Hide Edge built-in password reveal and clear icons */
131
170
  }
132
171
  nv-fielddate .input-wrapper .input-container input:focus {
133
172
  outline: none;
@@ -142,6 +181,11 @@ nv-fielddate .input-wrapper .input-container input::placeholder {
142
181
  font-weight: 400;
143
182
  line-height: var(--form-field-line-height);
144
183
  }
184
+ nv-fielddate .input-wrapper .input-container input[type=password]::-ms-clear, nv-fielddate .input-wrapper .input-container input[type=password]::-ms-reveal {
185
+ display: none;
186
+ width: 0;
187
+ height: 0;
188
+ }
145
189
  nv-fielddate .input-wrapper .input-container > nv-iconbutton {
146
190
  border: 0px;
147
191
  border-radius: 0px;
@@ -0,0 +1,196 @@
1
+ /* eslint-disable jsdoc/require-jsdoc */
2
+ import { describe, it, expect } from "vitest";
3
+ /**
4
+ * Logic tests for nv-fielddate basic functionality
5
+ *
6
+ * These tests validate basic utility functions and logic
7
+ * without testing the full component implementation.
8
+ */
9
+ /**
10
+ * Utility function to convert date format to inputmask format
11
+ * @param {string} format - The date format
12
+ * @returns {string} Format adapted for Inputmask
13
+ */
14
+ function convertToInputmaskFormat(format) {
15
+ switch (format) {
16
+ case 'DD/MM/YYYY':
17
+ return 'dd/mm/yyyy';
18
+ case 'MM/DD/YYYY':
19
+ return 'mm/dd/yyyy';
20
+ case 'YYYY-MM-DD':
21
+ return 'yyyy-mm-dd';
22
+ case 'DD.MM.YYYY':
23
+ return 'dd.mm.yyyy';
24
+ case 'YYYYMMDD':
25
+ return 'yyyymmdd';
26
+ default:
27
+ return format;
28
+ }
29
+ }
30
+ /**
31
+ * Utility function to validate date format
32
+ * @param {string} dateString - Date string to validate
33
+ * @param {string} format - Expected format
34
+ * @returns {boolean} Whether the date matches the format
35
+ */
36
+ function isValidDateFormat(dateString, format) {
37
+ if (!dateString || !format)
38
+ return false;
39
+ const formatMap = {
40
+ 'DD/MM/YYYY': /^\d{2}\/\d{2}\/\d{4}$/,
41
+ 'MM/DD/YYYY': /^\d{2}\/\d{2}\/\d{4}$/,
42
+ 'YYYY-MM-DD': /^\d{4}-\d{2}-\d{2}$/,
43
+ 'DD.MM.YYYY': /^\d{2}\.\d{2}\.\d{4}$/,
44
+ 'YYYYMMDD': /^\d{8}$/,
45
+ };
46
+ const regex = formatMap[format];
47
+ return regex ? regex.test(dateString) : false;
48
+ }
49
+ /**
50
+ * Utility function to check if a value has changed
51
+ * @param {string} oldValue - Previous value
52
+ * @param {string} newValue - New value
53
+ * @returns {boolean} Whether the value has changed
54
+ */
55
+ function hasValueChanged(oldValue, newValue) {
56
+ return oldValue !== newValue;
57
+ }
58
+ /**
59
+ * Utility function to normalize empty values
60
+ * @param {string | null | undefined} value - Value to normalize
61
+ * @returns {string} Normalized value
62
+ */
63
+ function normalizeValue(value) {
64
+ return value || '';
65
+ }
66
+ /**
67
+ * Utility function to determine selection range based on date format
68
+ * @param {string} format - Date format
69
+ * @returns {object} Selection range with start and end
70
+ */
71
+ function getSelectionRange(format) {
72
+ if (format.startsWith('DD') || format.startsWith('MM')) {
73
+ return { start: 0, end: 2 };
74
+ }
75
+ else if (format.startsWith('YYYY')) {
76
+ return { start: 0, end: 4 };
77
+ }
78
+ return { start: 0, end: 0 };
79
+ }
80
+ describe('nv-fielddate - Logic Tests', () => {
81
+ describe('Input Mask Format Conversion', () => {
82
+ it('should convert DD/MM/YYYY format correctly', () => {
83
+ expect(convertToInputmaskFormat('DD/MM/YYYY')).toBe('dd/mm/yyyy');
84
+ });
85
+ it('should convert MM/DD/YYYY format correctly', () => {
86
+ expect(convertToInputmaskFormat('MM/DD/YYYY')).toBe('mm/dd/yyyy');
87
+ });
88
+ it('should convert YYYY-MM-DD format correctly', () => {
89
+ expect(convertToInputmaskFormat('YYYY-MM-DD')).toBe('yyyy-mm-dd');
90
+ });
91
+ it('should convert DD.MM.YYYY format correctly', () => {
92
+ expect(convertToInputmaskFormat('DD.MM.YYYY')).toBe('dd.mm.yyyy');
93
+ });
94
+ it('should convert YYYYMMDD format correctly', () => {
95
+ expect(convertToInputmaskFormat('YYYYMMDD')).toBe('yyyymmdd');
96
+ });
97
+ it('should return original format for unknown formats', () => {
98
+ const unknownFormat = 'CUSTOM-FORMAT';
99
+ expect(convertToInputmaskFormat(unknownFormat)).toBe(unknownFormat);
100
+ });
101
+ it('should handle empty string', () => {
102
+ expect(convertToInputmaskFormat('')).toBe('');
103
+ });
104
+ });
105
+ describe('Date Format Validation', () => {
106
+ it('should validate DD/MM/YYYY format correctly', () => {
107
+ expect(isValidDateFormat('15/03/2024', 'DD/MM/YYYY')).toBe(true);
108
+ expect(isValidDateFormat('1/3/2024', 'DD/MM/YYYY')).toBe(false);
109
+ expect(isValidDateFormat('15-03-2024', 'DD/MM/YYYY')).toBe(false);
110
+ expect(isValidDateFormat('', 'DD/MM/YYYY')).toBe(false);
111
+ });
112
+ it('should validate MM/DD/YYYY format correctly', () => {
113
+ expect(isValidDateFormat('03/15/2024', 'MM/DD/YYYY')).toBe(true);
114
+ expect(isValidDateFormat('3/15/2024', 'MM/DD/YYYY')).toBe(false);
115
+ expect(isValidDateFormat('03-15-2024', 'MM/DD/YYYY')).toBe(false);
116
+ });
117
+ it('should validate YYYY-MM-DD format correctly', () => {
118
+ expect(isValidDateFormat('2024-03-15', 'YYYY-MM-DD')).toBe(true);
119
+ expect(isValidDateFormat('24-3-15', 'YYYY-MM-DD')).toBe(false);
120
+ expect(isValidDateFormat('2024/03/15', 'YYYY-MM-DD')).toBe(false);
121
+ });
122
+ it('should validate DD.MM.YYYY format correctly', () => {
123
+ expect(isValidDateFormat('15.03.2024', 'DD.MM.YYYY')).toBe(true);
124
+ expect(isValidDateFormat('15/03/2024', 'DD.MM.YYYY')).toBe(false);
125
+ });
126
+ it('should validate YYYYMMDD format correctly', () => {
127
+ expect(isValidDateFormat('20240315', 'YYYYMMDD')).toBe(true);
128
+ expect(isValidDateFormat('2024-03-15', 'YYYYMMDD')).toBe(false);
129
+ });
130
+ it('should handle invalid inputs gracefully', () => {
131
+ expect(isValidDateFormat('invalid', 'DD/MM/YYYY')).toBe(false);
132
+ expect(isValidDateFormat('15/03/2024', 'UNKNOWN_FORMAT')).toBe(false);
133
+ expect(isValidDateFormat('', '')).toBe(false);
134
+ });
135
+ });
136
+ describe('Value Change Detection', () => {
137
+ it('should detect when value changes', () => {
138
+ expect(hasValueChanged('', '2024-03-15')).toBe(true);
139
+ expect(hasValueChanged('2024-03-15', '2024-03-16')).toBe(true);
140
+ expect(hasValueChanged('2024-03-15', '2024-03-15')).toBe(false);
141
+ });
142
+ it('should handle empty values correctly', () => {
143
+ expect(hasValueChanged('', '')).toBe(false);
144
+ expect(hasValueChanged('value', '')).toBe(true);
145
+ expect(hasValueChanged('', 'value')).toBe(true);
146
+ });
147
+ });
148
+ describe('Value Normalization', () => {
149
+ it('should normalize empty values correctly', () => {
150
+ expect(normalizeValue('')).toBe('');
151
+ expect(normalizeValue('2024-03-15')).toBe('2024-03-15');
152
+ expect(normalizeValue(null)).toBe('');
153
+ expect(normalizeValue(undefined)).toBe('');
154
+ });
155
+ it('should preserve valid values', () => {
156
+ const validValue = '15/03/2024';
157
+ expect(normalizeValue(validValue)).toBe(validValue);
158
+ });
159
+ });
160
+ describe('Selection Range Logic', () => {
161
+ it('should return correct range for DD format', () => {
162
+ expect(getSelectionRange('DD/MM/YYYY')).toEqual({ start: 0, end: 2 });
163
+ expect(getSelectionRange('DD.MM.YYYY')).toEqual({ start: 0, end: 2 });
164
+ });
165
+ it('should return correct range for MM format', () => {
166
+ expect(getSelectionRange('MM/DD/YYYY')).toEqual({ start: 0, end: 2 });
167
+ });
168
+ it('should return correct range for YYYY format', () => {
169
+ expect(getSelectionRange('YYYY-MM-DD')).toEqual({ start: 0, end: 4 });
170
+ expect(getSelectionRange('YYYYMMDD')).toEqual({ start: 0, end: 4 });
171
+ });
172
+ it('should handle unknown formats', () => {
173
+ expect(getSelectionRange('UNKNOWN')).toEqual({ start: 0, end: 0 });
174
+ expect(getSelectionRange('')).toEqual({ start: 0, end: 0 });
175
+ });
176
+ });
177
+ describe('Edge Cases', () => {
178
+ it('should handle leap year dates in validation', () => {
179
+ expect(isValidDateFormat('29/02/2024', 'DD/MM/YYYY')).toBe(true);
180
+ expect(isValidDateFormat('2024-02-29', 'YYYY-MM-DD')).toBe(true);
181
+ });
182
+ it('should handle year boundaries', () => {
183
+ expect(isValidDateFormat('31/12/2024', 'DD/MM/YYYY')).toBe(true);
184
+ expect(isValidDateFormat('01/01/2025', 'DD/MM/YYYY')).toBe(true);
185
+ });
186
+ it('should handle format conversion edge cases', () => {
187
+ expect(convertToInputmaskFormat(null)).toBe(null);
188
+ expect(convertToInputmaskFormat(undefined)).toBe(undefined);
189
+ });
190
+ it('should handle value change detection with special characters', () => {
191
+ expect(hasValueChanged('15/03/2024', '15/03/2024')).toBe(false);
192
+ expect(hasValueChanged('15/03/2024', '15-03-2024')).toBe(true);
193
+ });
194
+ });
195
+ });
196
+ //# sourceMappingURL=nv-fielddate.logic.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"nv-fielddate.logic.test.js","sourceRoot":"","sources":["../../../../src/components/nv-fielddate/test/nv-fielddate.logic.test.ts"],"names":[],"mappings":"AAAA,wCAAwC;AACxC,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,EAAE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C,eAAe,CAAC,YAAY,EAAE,YAAY,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACjE,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["/* eslint-disable jsdoc/require-jsdoc */\nimport { describe, it, expect } from 'vitest';\n\n/**\n * Logic tests for nv-fielddate basic functionality\n *\n * These tests validate basic utility functions and logic\n * without testing the full component implementation.\n */\n\n/**\n * Utility function to convert date format to inputmask format\n * @param {string} format - The date format\n * @returns {string} Format adapted for Inputmask\n */\nfunction convertToInputmaskFormat(format: string): string {\n switch (format) {\n case 'DD/MM/YYYY':\n return 'dd/mm/yyyy';\n case 'MM/DD/YYYY':\n return 'mm/dd/yyyy';\n case 'YYYY-MM-DD':\n return 'yyyy-mm-dd';\n case 'DD.MM.YYYY':\n return 'dd.mm.yyyy';\n case 'YYYYMMDD':\n return 'yyyymmdd';\n default:\n return format;\n }\n}\n\n/**\n * Utility function to validate date format\n * @param {string} dateString - Date string to validate\n * @param {string} format - Expected format\n * @returns {boolean} Whether the date matches the format\n */\nfunction isValidDateFormat(dateString: string, format: string): boolean {\n if (!dateString || !format) return false;\n\n const formatMap = {\n 'DD/MM/YYYY': /^\\d{2}\\/\\d{2}\\/\\d{4}$/,\n 'MM/DD/YYYY': /^\\d{2}\\/\\d{2}\\/\\d{4}$/,\n 'YYYY-MM-DD': /^\\d{4}-\\d{2}-\\d{2}$/,\n 'DD.MM.YYYY': /^\\d{2}\\.\\d{2}\\.\\d{4}$/,\n 'YYYYMMDD': /^\\d{8}$/,\n };\n\n const regex = formatMap[format as keyof typeof formatMap];\n return regex ? regex.test(dateString) : false;\n}\n\n/**\n * Utility function to check if a value has changed\n * @param {string} oldValue - Previous value\n * @param {string} newValue - New value\n * @returns {boolean} Whether the value has changed\n */\nfunction hasValueChanged(oldValue: string, newValue: string): boolean {\n return oldValue !== newValue;\n}\n\n/**\n * Utility function to normalize empty values\n * @param {string | null | undefined} value - Value to normalize\n * @returns {string} Normalized value\n */\nfunction normalizeValue(value: string | null | undefined): string {\n return value || '';\n}\n\n/**\n * Utility function to determine selection range based on date format\n * @param {string} format - Date format\n * @returns {object} Selection range with start and end\n */\nfunction getSelectionRange(format: string): { start: number; end: number } {\n if (format.startsWith('DD') || format.startsWith('MM')) {\n return { start: 0, end: 2 };\n } else if (format.startsWith('YYYY')) {\n return { start: 0, end: 4 };\n }\n return { start: 0, end: 0 };\n}\n\ndescribe('nv-fielddate - Logic Tests', () => {\n describe('Input Mask Format Conversion', () => {\n it('should convert DD/MM/YYYY format correctly', () => {\n expect(convertToInputmaskFormat('DD/MM/YYYY')).toBe('dd/mm/yyyy');\n });\n\n it('should convert MM/DD/YYYY format correctly', () => {\n expect(convertToInputmaskFormat('MM/DD/YYYY')).toBe('mm/dd/yyyy');\n });\n\n it('should convert YYYY-MM-DD format correctly', () => {\n expect(convertToInputmaskFormat('YYYY-MM-DD')).toBe('yyyy-mm-dd');\n });\n\n it('should convert DD.MM.YYYY format correctly', () => {\n expect(convertToInputmaskFormat('DD.MM.YYYY')).toBe('dd.mm.yyyy');\n });\n\n it('should convert YYYYMMDD format correctly', () => {\n expect(convertToInputmaskFormat('YYYYMMDD')).toBe('yyyymmdd');\n });\n\n it('should return original format for unknown formats', () => {\n const unknownFormat = 'CUSTOM-FORMAT';\n expect(convertToInputmaskFormat(unknownFormat)).toBe(unknownFormat);\n });\n\n it('should handle empty string', () => {\n expect(convertToInputmaskFormat('')).toBe('');\n });\n });\n\n describe('Date Format Validation', () => {\n it('should validate DD/MM/YYYY format correctly', () => {\n expect(isValidDateFormat('15/03/2024', 'DD/MM/YYYY')).toBe(true);\n expect(isValidDateFormat('1/3/2024', 'DD/MM/YYYY')).toBe(false);\n expect(isValidDateFormat('15-03-2024', 'DD/MM/YYYY')).toBe(false);\n expect(isValidDateFormat('', 'DD/MM/YYYY')).toBe(false);\n });\n\n it('should validate MM/DD/YYYY format correctly', () => {\n expect(isValidDateFormat('03/15/2024', 'MM/DD/YYYY')).toBe(true);\n expect(isValidDateFormat('3/15/2024', 'MM/DD/YYYY')).toBe(false);\n expect(isValidDateFormat('03-15-2024', 'MM/DD/YYYY')).toBe(false);\n });\n\n it('should validate YYYY-MM-DD format correctly', () => {\n expect(isValidDateFormat('2024-03-15', 'YYYY-MM-DD')).toBe(true);\n expect(isValidDateFormat('24-3-15', 'YYYY-MM-DD')).toBe(false);\n expect(isValidDateFormat('2024/03/15', 'YYYY-MM-DD')).toBe(false);\n });\n\n it('should validate DD.MM.YYYY format correctly', () => {\n expect(isValidDateFormat('15.03.2024', 'DD.MM.YYYY')).toBe(true);\n expect(isValidDateFormat('15/03/2024', 'DD.MM.YYYY')).toBe(false);\n });\n\n it('should validate YYYYMMDD format correctly', () => {\n expect(isValidDateFormat('20240315', 'YYYYMMDD')).toBe(true);\n expect(isValidDateFormat('2024-03-15', 'YYYYMMDD')).toBe(false);\n });\n\n it('should handle invalid inputs gracefully', () => {\n expect(isValidDateFormat('invalid', 'DD/MM/YYYY')).toBe(false);\n expect(isValidDateFormat('15/03/2024', 'UNKNOWN_FORMAT')).toBe(false);\n expect(isValidDateFormat('', '')).toBe(false);\n });\n });\n\n describe('Value Change Detection', () => {\n it('should detect when value changes', () => {\n expect(hasValueChanged('', '2024-03-15')).toBe(true);\n expect(hasValueChanged('2024-03-15', '2024-03-16')).toBe(true);\n expect(hasValueChanged('2024-03-15', '2024-03-15')).toBe(false);\n });\n\n it('should handle empty values correctly', () => {\n expect(hasValueChanged('', '')).toBe(false);\n expect(hasValueChanged('value', '')).toBe(true);\n expect(hasValueChanged('', 'value')).toBe(true);\n });\n });\n\n describe('Value Normalization', () => {\n it('should normalize empty values correctly', () => {\n expect(normalizeValue('')).toBe('');\n expect(normalizeValue('2024-03-15')).toBe('2024-03-15');\n expect(normalizeValue(null)).toBe('');\n expect(normalizeValue(undefined)).toBe('');\n });\n\n it('should preserve valid values', () => {\n const validValue = '15/03/2024';\n expect(normalizeValue(validValue)).toBe(validValue);\n });\n });\n\n describe('Selection Range Logic', () => {\n it('should return correct range for DD format', () => {\n expect(getSelectionRange('DD/MM/YYYY')).toEqual({ start: 0, end: 2 });\n expect(getSelectionRange('DD.MM.YYYY')).toEqual({ start: 0, end: 2 });\n });\n\n it('should return correct range for MM format', () => {\n expect(getSelectionRange('MM/DD/YYYY')).toEqual({ start: 0, end: 2 });\n });\n\n it('should return correct range for YYYY format', () => {\n expect(getSelectionRange('YYYY-MM-DD')).toEqual({ start: 0, end: 4 });\n expect(getSelectionRange('YYYYMMDD')).toEqual({ start: 0, end: 4 });\n });\n\n it('should handle unknown formats', () => {\n expect(getSelectionRange('UNKNOWN')).toEqual({ start: 0, end: 0 });\n expect(getSelectionRange('')).toEqual({ start: 0, end: 0 });\n });\n });\n\n describe('Edge Cases', () => {\n it('should handle leap year dates in validation', () => {\n expect(isValidDateFormat('29/02/2024', 'DD/MM/YYYY')).toBe(true);\n expect(isValidDateFormat('2024-02-29', 'YYYY-MM-DD')).toBe(true);\n });\n\n it('should handle year boundaries', () => {\n expect(isValidDateFormat('31/12/2024', 'DD/MM/YYYY')).toBe(true);\n expect(isValidDateFormat('01/01/2025', 'DD/MM/YYYY')).toBe(true);\n });\n\n it('should handle format conversion edge cases', () => {\n expect(convertToInputmaskFormat(null as unknown as string)).toBe(null);\n expect(convertToInputmaskFormat(undefined as unknown as string)).toBe(\n undefined,\n );\n });\n\n it('should handle value change detection with special characters', () => {\n expect(hasValueChanged('15/03/2024', '15/03/2024')).toBe(false);\n expect(hasValueChanged('15/03/2024', '15-03-2024')).toBe(true);\n });\n });\n});\n"]}
@@ -52,6 +52,7 @@ export class NvFielddaterange {
52
52
  /**
53
53
  * The initial value of the date range (in string format).
54
54
  */
55
+ // eslint-disable-next-line @stencil-community/strict-mutable
55
56
  this.value = '';
56
57
  /**
57
58
  * The current value of the start date in string format.
@@ -65,10 +66,6 @@ export class NvFielddaterange {
65
66
  * Controls the opening of the popover.
66
67
  */
67
68
  this.open = false;
68
- /**
69
- * Current calendar state to prevent unwanted navigation
70
- */
71
- this.calendarState = null;
72
69
  /**
73
70
  * First day of the week 0 = Sunday, 1 = Monday, etc.
74
71
  * @default 1
@@ -109,6 +106,35 @@ export class NvFielddaterange {
109
106
  * Allows the field to stretch and fill the entire width of its container.
110
107
  */
111
108
  this.fluid = false;
109
+ //#endregion PROPERTIES
110
+ /****************************************************************************/
111
+ //#region METHODS
112
+ /**
113
+ * Parses the unified value prop and synchronizes with internal state
114
+ * @param {string} value - Value to parse
115
+ */
116
+ this.parseUnifiedValue = (value) => {
117
+ if (!value) {
118
+ // Reset all selections
119
+ this.startValue = '';
120
+ this.endValue = '';
121
+ return;
122
+ }
123
+ const values = value
124
+ .split(',')
125
+ .map(v => v.trim())
126
+ .filter(Boolean);
127
+ if (values.length >= 2) {
128
+ this.startValue = values[0];
129
+ this.endValue = values[1];
130
+ }
131
+ else {
132
+ // Handle malformed value gracefully
133
+ console.warn(`Invalid date range format: ${value}`);
134
+ this.startValue = '';
135
+ this.endValue = '';
136
+ }
137
+ };
112
138
  /**
113
139
  * Closes the popover when a click is detected outside the component.
114
140
  * @param {MouseEvent} event - The mouse event
@@ -129,6 +155,10 @@ export class NvFielddaterange {
129
155
  }
130
156
  const input = event.target;
131
157
  this.startValue = input.value;
158
+ // Update unified value prop
159
+ this.value = `${input.value},${this.endValue}`;
160
+ this.valueChanged.emit(this.value);
161
+ // Legacy support (deprecated)
132
162
  this.dateRangeChange.emit({ start: input.value, end: this.endValue });
133
163
  // Temporarily enable navigation for keyboard input
134
164
  if (this.calendarElement) {
@@ -153,6 +183,10 @@ export class NvFielddaterange {
153
183
  }
154
184
  const input = event.target;
155
185
  this.endValue = input.value;
186
+ // Update unified value prop
187
+ this.value = `${this.startValue},${input.value}`;
188
+ this.valueChanged.emit(this.value);
189
+ // Legacy support (deprecated)
156
190
  this.dateRangeChange.emit({ start: this.startValue, end: input.value });
157
191
  // Temporarily enable navigation for keyboard input
158
192
  if (this.calendarElement) {
@@ -198,9 +232,6 @@ export class NvFielddaterange {
198
232
  this.open = !this.open;
199
233
  };
200
234
  }
201
- //#endregion PROPERTIES
202
- /****************************************************************************/
203
- //#region METHODS
204
235
  /**
205
236
  * Converts the nv-calendar date format to the format expected by Inputmask.
206
237
  * @param {string} format - The date format to convert
@@ -226,10 +257,6 @@ export class NvFielddaterange {
226
257
  updateCalendarValue() {
227
258
  if (this.calendarElement && this.startValue && this.endValue) {
228
259
  // Store the current calendar state
229
- this.calendarState = {
230
- start: this.startValue,
231
- end: this.endValue,
232
- };
233
260
  }
234
261
  }
235
262
  //#endregion METHODS
@@ -240,21 +267,8 @@ export class NvFielddaterange {
240
267
  }
241
268
  componentWillLoad() {
242
269
  if (this.value) {
243
- try {
244
- const range = JSON.parse(this.value);
245
- this.startValue = range.start || '';
246
- this.endValue = range.end || '';
247
- if (range.start && range.end) {
248
- this.calendarState = {
249
- start: range.start,
250
- end: range.end,
251
- };
252
- }
253
- }
254
- catch (error) {
255
- console.error('Invalid JSON for value:');
256
- console.error(error);
257
- }
270
+ // Use the unified parsing method
271
+ this.parseUnifiedValue(this.value);
258
272
  }
259
273
  }
260
274
  componentDidLoad() {
@@ -324,7 +338,10 @@ export class NvFielddaterange {
324
338
  if (start && end) {
325
339
  this.startValue = start;
326
340
  this.endValue = end;
327
- this.calendarState = { start, end };
341
+ // Update unified value prop (like nv-calendar)
342
+ this.value = `${start},${end}`;
343
+ this.valueChanged.emit(this.value);
344
+ // Legacy support (deprecated)
328
345
  this.dateRangeChange.emit({
329
346
  start: this.startValue,
330
347
  end: this.endValue,
@@ -334,6 +351,24 @@ export class NvFielddaterange {
334
351
  }
335
352
  }
336
353
  }
354
+ /**
355
+ * Handles the unified value change event from nv-calendar
356
+ * @param {CustomEvent<string>} event - The custom event
357
+ */
358
+ handleCalendarValueChanged(event) {
359
+ const newValue = event.detail || '';
360
+ if (newValue !== this.value) {
361
+ this.value = newValue;
362
+ this.valueChanged.emit(newValue);
363
+ // Parse and update internal state
364
+ this.parseUnifiedValue(newValue);
365
+ // Legacy support - emit dateRangeChange
366
+ this.dateRangeChange.emit({
367
+ start: this.startValue,
368
+ end: this.endValue,
369
+ });
370
+ }
371
+ }
337
372
  handleClosePopover() {
338
373
  this.open = false;
339
374
  }
@@ -353,10 +388,14 @@ export class NvFielddaterange {
353
388
  if (isResetSingle || isResetRange) {
354
389
  this.startValue = '';
355
390
  this.endValue = '';
391
+ // Update unified value prop
392
+ this.value = '';
393
+ this.valueChanged.emit('');
356
394
  const inputs = this.el.querySelectorAll('.input-wrapper input');
357
395
  inputs.forEach((input) => {
358
396
  input.value = '';
359
397
  });
398
+ // Legacy support (deprecated)
360
399
  this.dateRangeChange.emit({ start: '', end: '' });
361
400
  }
362
401
  }
@@ -379,23 +418,17 @@ export class NvFielddaterange {
379
418
  }
380
419
  }
381
420
  handleValueChange(newValue) {
382
- try {
383
- const range = JSON.parse(newValue);
384
- this.startValue = range.start || '';
385
- this.endValue = range.end || '';
386
- }
387
- catch (error) {
388
- console.error('Invalid JSON for value:', error);
389
- }
421
+ // Use the unified parsing method instead of JSON.parse
422
+ this.parseUnifiedValue(newValue);
390
423
  }
391
424
  //#endregion EVENTS
392
425
  /****************************************************************************/
393
426
  //#region RENDER
394
427
  render() {
395
- return (h(Host, { key: '152a588b815a0f3846c5b0c8b9da8d3dbc8f4768' }, ((this.label && this.label.length > 0) ||
396
- this.el.querySelector('[slot="label"]')) && (h("label", { key: '786269a2bd4a50559cfad72c61f80797e4afc902', htmlFor: this.startInputId }, h("slot", { key: 'e1c6ed7d288d21889e1ebdfdf0595d4f43e551f7', name: "label" }, this.label))), h("nv-popover", { key: '228966569f5670f1b283c2e45f1c1057811e699d', ref: el => (this.popoverElement = el), id: this.popoverId, triggerMode: "controlled", placement: "bottom-start", open: this.open }, h("div", { key: 'ee39e8da7367bceb1fdcaf7f008d780652471e8e', slot: "trigger", class: "input-wrapper" }, h("slot", { key: '0555695d16ae919327771c586a291dc1767ed98f', name: "before-input" }), h("div", { key: '106aec6a9be06a03497f66407ea8038d5e4be899', class: "input-container" }, h("slot", { key: 'e448f8bacd3b383944f862b9dc1b7ea64feb565e', name: "leading-input" }), h("div", { key: '52ef48b4d76f063c65daa43865da607273ba6410', class: "range-inputs" }, h("input", { key: '899e309f7e100b7b6d12603b229aa4c429ddc1d2', id: this.startInputId, type: "text", placeholder: this.startPlaceholder, name: this.startName, disabled: this.disabled, readOnly: this.readonly, required: this.required, autofocus: this.autofocus, value: this.startValue, onInput: this.handleStartInput, onFocus: this.handleFocus, "data-scope": "date-range" }), h("svg", { key: '083bef93159b08aaf5c9f7637fbe459c2017e82f', xmlns: "http://www.w3.org/2000/svg", width: "24", height: "24", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", "stroke-width": "2", "stroke-linecap": "round", "stroke-linejoin": "round", class: "icon icon-tabler icons-tabler-outline icon-tabler-arrows-move-horizontal" }, h("path", { key: '2946dbfae81e0b3cdd62f77bb928617d182ae5c1', stroke: "none", d: "M0 0h24v24H0z", fill: "none" }), h("path", { key: 'afcf53514d22c9f8bb5d7d09294808f3ca053cc9', d: "M18 9l3 3l-3 3" }), h("path", { key: '53fe61cf1c1a5206f22d4c065292680f28fa3c59', d: "M15 12h6" }), h("path", { key: '1e138be2146498fa127922dcba9646e2e960a7e3', d: "M6 9l-3 3l3 3" }), h("path", { key: '3e324bf333bd69374fccac278386f6cc966fc3bd', d: "M3 12h6" })), h("input", { key: 'b7eeab7a9e0071c862528e8fa47c543d0295d331', id: this.endInputId, type: "text", placeholder: this.endPlaceholder, name: this.endName, disabled: this.disabled, readOnly: this.readonly, required: this.required, value: this.endValue, onInput: this.handleEndInput, onFocus: this.handleFocus, "data-scope": "date-range" })), this.error && (h("nv-icon", { key: 'f2ab540736820a8fcf7f4dbb973bc3a16b14fa8d', name: "alert-circle", class: "validation", size: "md" })), this.success && (h("nv-icon", { key: '91e75c515c4a44a3e499240e4d3c45b7a736429a', name: "circle-check", class: "validation", size: "md" })), h("nv-iconbutton", { key: 'a471cb1db59673f07ce493bae59e54ee8ecd8968', class: "toggle-calendar-icon", name: "calendar", size: "md", emphasis: "lower", "aria-label": this.open ? 'Hide calendar' : 'Show calendar', "aria-pressed": this.open.toString(), onClick: this.toggleCalendar, tabIndex: this.disabled ? -1 : 0 })), h("slot", { key: '375a0c1848445652c2ef5f20ded877223774f792', name: "after-input" })), h("div", { key: '7427c51a78cf38a979b9f7eb4e9a7f49a36279d5', slot: "content" }, h("nv-calendar", { key: '1f9ad9bed53d9496f17544c6381824490431c342', ref: el => (this.calendarElement = el), dateFormat: this.dateFormat, rangeValue: this.calendarState, firstDayOfWeek: this.firstDayOfWeek, numberOfCalendars: this.numberOfCalendars, min: this.min, max: this.max, locale: this.locale, shortcutsPlacement: this.shortcutsPlacement, showActions: this.showActions, shortcuts: this.shortcuts, showWeekNumbers: this.showWeekNumbers, disabledDates: this.disabledDates, selectionType: "range", "data-prevent-navigation": "true" }))), ((this.description && this.description.length > 0) ||
397
- this.el.querySelector('[slot="description"]')) && (h("div", { key: 'c964928de34f26fc82619601d0964079b061048f', class: "description" }, h("slot", { key: 'f409a5286e1c0ba16f36f062df3df5531dad6296', name: "description" }, this.description))), (this.errorDescription ||
398
- this.el.querySelector('[slot="error-description"]')) && (h("div", { key: '5e8a1b48da516f801372a59e379c5ade77f9761a', hidden: !this.error, class: "error-description" }, this.el.querySelector('[slot="error-description"]') ? (h("slot", { name: "error-description" })) : (this.errorDescription))), h("slot", { key: '68f37bddcd3208217a26eb230d1f8afdd3552eff' })));
428
+ return (h(Host, { key: 'a451ea256b0149d8c49676f764832a2fb0f751e1' }, ((this.label && this.label.length > 0) ||
429
+ this.el.querySelector('[slot="label"]')) && (h("label", { key: '8b5dfcffa03da62b728b121705213a5dbc61dc6c', htmlFor: this.startInputId }, h("slot", { key: 'f55bf5e98ac77ab4781956ed98f2e327f0806df6', name: "label" }, this.label))), h("nv-popover", { key: 'c818788df088dd87bce8e0f3f7dfadf282675981', ref: el => (this.popoverElement = el), id: this.popoverId, triggerMode: "controlled", placement: "bottom-start", open: this.open }, h("div", { key: '2208b4f6033232fde9c149bd7ec7096a7b5bf36c', slot: "trigger", class: "input-wrapper" }, h("slot", { key: 'c32096e78b3b1846e8aac664770310f3e2a658c7', name: "before-input" }), h("div", { key: '478355cdb09432c84c44811f048ff832a58b7c21', class: "input-container" }, h("slot", { key: '4703b43ce78daec5c249cb64e2d5c6ea239e9682', name: "leading-input" }), h("div", { key: '02e39ceb5d680fe73b4e701162b12fdf6d351128', class: "range-inputs" }, h("input", { key: '54548154537b4f9661b2bc07cfa1e8fbdc587788', id: this.startInputId, type: "text", placeholder: this.startPlaceholder, name: this.startName, disabled: this.disabled, readOnly: this.readonly, required: this.required, autofocus: this.autofocus, value: this.startValue, onInput: this.handleStartInput, onFocus: this.handleFocus, "data-scope": "date-range" }), h("svg", { key: 'b32d842470237bdb1d846b61ed165d2d1587a491', xmlns: "http://www.w3.org/2000/svg", width: "24", height: "24", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", "stroke-width": "2", "stroke-linecap": "round", "stroke-linejoin": "round", class: "icon icon-tabler icons-tabler-outline icon-tabler-arrows-move-horizontal" }, h("path", { key: '7281b2de95391d3dc04ffdbfbc5da81a4b3f2fc3', stroke: "none", d: "M0 0h24v24H0z", fill: "none" }), h("path", { key: '13f2cfe57b9eaadc9317bd489f6abfc472addd0e', d: "M18 9l3 3l-3 3" }), h("path", { key: '646dbf9fe81981c93a4ad70a7cf75d485b573e42', d: "M15 12h6" }), h("path", { key: '753699e6aa5325cd91b27af5ede8d316adaa7727', d: "M6 9l-3 3l3 3" }), h("path", { key: 'aab52481a7846a400bd0274f197b5c29c71fa15c', d: "M3 12h6" })), h("input", { key: '9c441f448382dd4f5c73c94d7ebaff80c6bcec2a', id: this.endInputId, type: "text", placeholder: this.endPlaceholder, name: this.endName, disabled: this.disabled, readOnly: this.readonly, required: this.required, value: this.endValue, onInput: this.handleEndInput, onFocus: this.handleFocus, "data-scope": "date-range" })), this.error && (h("nv-icon", { key: 'f16264bdc82de90a1c8e7b5acf25687ed31a0a49', name: "alert-circle", class: "validation", size: "md" })), this.success && (h("nv-icon", { key: '9b1a0f81dc60bbcf68e53bc1c6ff33be515d3689', name: "circle-check", class: "validation", size: "md" })), h("nv-iconbutton", { key: '5e898f106896aa5496b9f243c8e4896d007dea65', class: "toggle-calendar-icon", name: "calendar", size: "md", emphasis: "lower", "aria-label": this.open ? 'Hide calendar' : 'Show calendar', "aria-pressed": this.open.toString(), onClick: this.toggleCalendar, tabIndex: this.disabled ? -1 : 0 })), h("slot", { key: 'f1ab4a033654907143750a47ab44acf0b5293def', name: "after-input" })), h("div", { key: '55d69c575b8630b08a90334c7b65190d398ebec8', slot: "content" }, h("nv-calendar", { key: 'a3f9d43a961d7a8c38ffc7d7bd8fcbe7e0b544f8', ref: el => (this.calendarElement = el), dateFormat: this.dateFormat, value: this.value, firstDayOfWeek: this.firstDayOfWeek, numberOfCalendars: this.numberOfCalendars, min: this.min, max: this.max, locale: this.locale, shortcutsPlacement: this.shortcutsPlacement, showActions: this.showActions, shortcuts: this.shortcuts, showWeekNumbers: this.showWeekNumbers, disabledDates: this.disabledDates, selectionType: "range", "data-prevent-navigation": "true" }))), ((this.description && this.description.length > 0) ||
430
+ this.el.querySelector('[slot="description"]')) && (h("div", { key: 'b58241fe9c321b2c55aab00235e07627d4aae5a8', class: "description" }, h("slot", { key: '4450872685fbb82838f5bc920fd0fd1b867347c5', name: "description" }, this.description))), (this.errorDescription ||
431
+ this.el.querySelector('[slot="error-description"]')) && (h("div", { key: '947701fd9a14ef6e564460cd73bafb510883692a', hidden: !this.error, class: "error-description" }, this.el.querySelector('[slot="error-description"]') ? (h("slot", { name: "error-description" })) : (this.errorDescription))), h("slot", { key: '95dc7827c626e92a74067ffb7759dcca63cc4102' })));
399
432
  }
400
433
  static get is() { return "nv-fielddaterange"; }
401
434
  static get originalStyleUrls() {
@@ -705,7 +738,7 @@ export class NvFielddaterange {
705
738
  },
706
739
  "value": {
707
740
  "type": "string",
708
- "mutable": false,
741
+ "mutable": true,
709
742
  "complexType": {
710
743
  "original": "string",
711
744
  "resolved": "string",
@@ -990,8 +1023,7 @@ export class NvFielddaterange {
990
1023
  return {
991
1024
  "startValue": {},
992
1025
  "endValue": {},
993
- "open": {},
994
- "calendarState": {}
1026
+ "open": {}
995
1027
  };
996
1028
  }
997
1029
  static get events() {
@@ -1003,7 +1035,7 @@ export class NvFielddaterange {
1003
1035
  "composed": true,
1004
1036
  "docs": {
1005
1037
  "tags": [],
1006
- "text": "Emits an event when the date range changes."
1038
+ "text": "Emitted when the date range changes."
1007
1039
  },
1008
1040
  "complexType": {
1009
1041
  "original": "HTMLNvCalendarElementEventMap['rangeDateChange']",
@@ -1015,6 +1047,24 @@ export class NvFielddaterange {
1015
1047
  }
1016
1048
  }
1017
1049
  }
1050
+ }, {
1051
+ "method": "valueChanged",
1052
+ "name": "valueChanged",
1053
+ "bubbles": true,
1054
+ "cancelable": true,
1055
+ "composed": true,
1056
+ "docs": {
1057
+ "tags": [{
1058
+ "name": "bind",
1059
+ "text": "value"
1060
+ }],
1061
+ "text": "Emitted when the unified value changes"
1062
+ },
1063
+ "complexType": {
1064
+ "original": "string",
1065
+ "resolved": "string",
1066
+ "references": {}
1067
+ }
1018
1068
  }];
1019
1069
  }
1020
1070
  static get elementRef() { return "el"; }
@@ -1031,6 +1081,12 @@ export class NvFielddaterange {
1031
1081
  "target": undefined,
1032
1082
  "capture": false,
1033
1083
  "passive": false
1084
+ }, {
1085
+ "name": "valueChanged",
1086
+ "method": "handleCalendarValueChanged",
1087
+ "target": undefined,
1088
+ "capture": false,
1089
+ "passive": false
1034
1090
  }, {
1035
1091
  "name": "closePopover",
1036
1092
  "method": "handleClosePopover",