@nova-design-system/nova-webcomponents 3.20.0 → 3.21.1-beta.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 (549) hide show
  1. package/dist/cjs/{grow.animation-f1cef0ad.js → grow.animation-69832995.js} +29 -1
  2. package/dist/cjs/grow.animation-69832995.js.map +1 -0
  3. package/dist/cjs/index-93d3b2f8.js +44 -0
  4. package/dist/cjs/index.cjs.js +3 -5
  5. package/dist/cjs/index.cjs.js.map +1 -1
  6. package/dist/cjs/loader.cjs.js +1 -1
  7. package/dist/cjs/native.cjs.js +1 -1
  8. package/dist/cjs/nv-badge_2.cjs.entry.js +1 -1
  9. package/dist/cjs/nv-button.cjs.entry.js +7 -2
  10. package/dist/cjs/nv-button.cjs.entry.js.map +1 -1
  11. package/dist/cjs/nv-datagrid.cjs.entry.js +2 -2
  12. package/dist/cjs/nv-datagrid.cjs.entry.js.map +1 -1
  13. package/dist/cjs/nv-dialog.cjs.entry.js +53 -19
  14. package/dist/cjs/nv-dialog.cjs.entry.js.map +1 -1
  15. package/dist/cjs/nv-dialogfooter_2.cjs.entry.js +2 -2
  16. package/dist/cjs/nv-fieldcheckbox.cjs.entry.js +4 -4
  17. package/dist/cjs/nv-fielddate.cjs.entry.js +14 -17
  18. package/dist/cjs/nv-fielddate.cjs.entry.js.map +1 -1
  19. package/dist/cjs/nv-fielddaterange.cjs.entry.js +7 -9
  20. package/dist/cjs/nv-fielddaterange.cjs.entry.js.map +1 -1
  21. package/dist/cjs/nv-fielddropdown.cjs.entry.js +14 -5
  22. package/dist/cjs/nv-fielddropdown.cjs.entry.js.map +1 -1
  23. package/dist/cjs/nv-fielddropdownitem.cjs.entry.js +2 -2
  24. package/dist/cjs/nv-fielddropdownitem.cjs.entry.js.map +1 -1
  25. package/dist/cjs/nv-fieldmultiselect.cjs.entry.js +1 -1
  26. package/dist/cjs/nv-fieldmultiselect.cjs.entry.js.map +1 -1
  27. package/dist/cjs/nv-fieldnumber.cjs.entry.js +3 -3
  28. package/dist/cjs/nv-fieldpassword.cjs.entry.js +3 -3
  29. package/dist/cjs/nv-fieldradio.cjs.entry.js +3 -3
  30. package/dist/cjs/nv-fieldselect.cjs.entry.js +5 -5
  31. package/dist/cjs/nv-fieldslider.cjs.entry.js +3 -3
  32. package/dist/cjs/nv-fieldtext.cjs.entry.js +3 -3
  33. package/dist/cjs/nv-fieldtextarea.cjs.entry.js +3 -3
  34. package/dist/cjs/nv-fieldtime.cjs.entry.js +3 -3
  35. package/dist/cjs/nv-icon.cjs.entry.js +2 -2
  36. package/dist/cjs/nv-icon.cjs.entry.js.map +1 -1
  37. package/dist/cjs/nv-iconbutton_2.cjs.entry.js +7 -2
  38. package/dist/cjs/nv-iconbutton_2.cjs.entry.js.map +1 -1
  39. package/dist/cjs/nv-menu.cjs.entry.js +1 -1
  40. package/dist/cjs/nv-menuitem.cjs.entry.js +1 -1
  41. package/dist/cjs/nv-notification-bullet.cjs.entry.js +79 -0
  42. package/dist/cjs/nv-notification-bullet.cjs.entry.js.map +1 -0
  43. package/dist/cjs/nv-notification.cjs.entry.js +1 -1
  44. package/dist/cjs/nv-notificationcontainer.cjs.entry.js +1 -1
  45. package/dist/cjs/nv-popover.cjs.entry.js +10 -11
  46. package/dist/cjs/nv-popover.cjs.entry.js.map +1 -1
  47. package/dist/cjs/nv-row.cjs.entry.js +1 -1
  48. package/dist/cjs/nv-sidebar.cjs.entry.js +179 -0
  49. package/dist/cjs/nv-sidebar.cjs.entry.js.map +1 -0
  50. package/dist/cjs/nv-sidebarcontent.cjs.entry.js +24 -0
  51. package/dist/cjs/nv-sidebarcontent.cjs.entry.js.map +1 -0
  52. package/dist/cjs/nv-sidebardivider.cjs.entry.js +24 -0
  53. package/dist/cjs/nv-sidebardivider.cjs.entry.js.map +1 -0
  54. package/dist/cjs/nv-sidebarfooter.cjs.entry.js +24 -0
  55. package/dist/cjs/nv-sidebarfooter.cjs.entry.js.map +1 -0
  56. package/dist/cjs/nv-sidebargroup.cjs.entry.js +25 -0
  57. package/dist/cjs/nv-sidebargroup.cjs.entry.js.map +1 -0
  58. package/dist/cjs/nv-sidebarheader.cjs.entry.js +24 -0
  59. package/dist/cjs/nv-sidebarheader.cjs.entry.js.map +1 -0
  60. package/dist/cjs/nv-sidebarlogo.cjs.entry.js +34 -0
  61. package/dist/cjs/nv-sidebarlogo.cjs.entry.js.map +1 -0
  62. package/dist/cjs/nv-sidebarnavitem.cjs.entry.js +299 -0
  63. package/dist/cjs/nv-sidebarnavitem.cjs.entry.js.map +1 -0
  64. package/dist/cjs/nv-sidebarnavsubitem.cjs.entry.js +37 -0
  65. package/dist/cjs/nv-sidebarnavsubitem.cjs.entry.js.map +1 -0
  66. package/dist/cjs/nv-split.cjs.entry.js +1 -1
  67. package/dist/cjs/nv-stack.cjs.entry.js +1 -1
  68. package/dist/cjs/nv-table.cjs.entry.js +1 -1
  69. package/dist/cjs/nv-tableheader.cjs.entry.js +77 -0
  70. package/dist/cjs/nv-tableheader.cjs.entry.js.map +1 -0
  71. package/dist/cjs/nv-toggle.cjs.entry.js +2 -2
  72. package/dist/cjs/nv-togglebutton.cjs.entry.js +2 -2
  73. package/dist/cjs/nv-togglebutton.cjs.entry.js.map +1 -1
  74. package/dist/cjs/nv-togglebuttongroup.cjs.entry.js +1 -1
  75. package/dist/cjs/nv-tooltip.cjs.entry.js +1 -1
  76. package/dist/collection/collection-manifest.json +11 -0
  77. package/dist/collection/components/nv-button/nv-button.js +26 -1
  78. package/dist/collection/components/nv-button/nv-button.js.map +1 -1
  79. package/dist/collection/components/nv-button/styles/nv-button.css +4 -0
  80. package/dist/collection/components/nv-datagrid/nv-datagrid.docs.js +1 -1
  81. package/dist/collection/components/nv-datagrid/nv-datagrid.docs.js.map +1 -1
  82. package/dist/collection/components/nv-datagrid/nv-datagrid.js +4 -2
  83. package/dist/collection/components/nv-datagrid/nv-datagrid.js.map +1 -1
  84. package/dist/collection/components/nv-dialog/nv-dialog.css +30 -22
  85. package/dist/collection/components/nv-dialog/nv-dialog.docs.js +14 -1
  86. package/dist/collection/components/nv-dialog/nv-dialog.docs.js.map +1 -1
  87. package/dist/collection/components/nv-dialog/nv-dialog.js +47 -21
  88. package/dist/collection/components/nv-dialog/nv-dialog.js.map +1 -1
  89. package/dist/collection/components/nv-dialogfooter/nv-dialogfooter.js +1 -1
  90. package/dist/collection/components/nv-dialogheader/nv-dialogheader.js +1 -1
  91. package/dist/collection/components/nv-fieldcheckbox/nv-fieldcheckbox.js +4 -4
  92. package/dist/collection/components/nv-fielddate/nv-fielddate.js +20 -17
  93. package/dist/collection/components/nv-fielddate/nv-fielddate.js.map +1 -1
  94. package/dist/collection/components/nv-fielddaterange/nv-fielddaterange.js +7 -9
  95. package/dist/collection/components/nv-fielddaterange/nv-fielddaterange.js.map +1 -1
  96. package/dist/collection/components/nv-fielddropdown/nv-fielddropdown.js +13 -4
  97. package/dist/collection/components/nv-fielddropdown/nv-fielddropdown.js.map +1 -1
  98. package/dist/collection/components/nv-fielddropdown/styles/nv-fielddropdown.css +24 -18
  99. package/dist/collection/components/nv-fielddropdownitem/nv-fielddropdownitem.js +1 -1
  100. package/dist/collection/components/nv-fielddropdownitem/styles/nv-fielddropdownitem.css +5 -3
  101. package/dist/collection/components/nv-fielddropdownitemcheck/nv-fielddropdownitemcheck.js +1 -1
  102. package/dist/collection/components/nv-fieldmultiselect/styles/nv-fieldmultiselect.css +3 -1
  103. package/dist/collection/components/nv-fieldnumber/nv-fieldnumber.js +3 -3
  104. package/dist/collection/components/nv-fieldpassword/nv-fieldpassword.js +3 -3
  105. package/dist/collection/components/nv-fieldradio/nv-fieldradio.js +3 -3
  106. package/dist/collection/components/nv-fieldselect/nv-fieldselect.js +5 -5
  107. package/dist/collection/components/nv-fieldslider/nv-fieldslider.js +3 -3
  108. package/dist/collection/components/nv-fieldtext/nv-fieldtext.js +3 -3
  109. package/dist/collection/components/nv-fieldtextarea/nv-fieldtextarea.js +3 -3
  110. package/dist/collection/components/nv-fieldtime/nv-fieldtime.js +3 -3
  111. package/dist/collection/components/nv-icon/nv-icon.js +1 -1
  112. package/dist/collection/components/nv-icon/nv-icons.js +1 -2
  113. package/dist/collection/components/nv-icon/nv-icons.js.map +1 -1
  114. package/dist/collection/components/nv-iconbutton/nv-iconbutton.js +26 -1
  115. package/dist/collection/components/nv-iconbutton/nv-iconbutton.js.map +1 -1
  116. package/dist/collection/components/nv-loader/nv-loader.js +1 -1
  117. package/dist/collection/components/nv-menu/nv-menu.js +1 -1
  118. package/dist/collection/components/nv-menuitem/nv-menuitem.js +2 -2
  119. package/dist/collection/components/nv-notification/nv-notification.js +1 -1
  120. package/dist/collection/components/nv-notification-bullet/nv-notification-bullet.docs.js +68 -0
  121. package/dist/collection/components/nv-notification-bullet/nv-notification-bullet.docs.js.map +1 -0
  122. package/dist/collection/components/nv-notification-bullet/nv-notification-bullet.js +189 -0
  123. package/dist/collection/components/nv-notification-bullet/nv-notification-bullet.js.map +1 -0
  124. package/dist/collection/components/nv-notification-bullet/styles/nv-notification-bullet.css +80 -0
  125. package/dist/collection/components/nv-notificationcontainer/nv-notificationcontainer.js +1 -1
  126. package/dist/collection/components/nv-popover/nv-popover.js +1 -1
  127. package/dist/collection/components/nv-row/nv-row.js +1 -1
  128. package/dist/collection/components/nv-sidebar/nv-sidebar.docs.js +37 -0
  129. package/dist/collection/components/nv-sidebar/nv-sidebar.docs.js.map +1 -0
  130. package/dist/collection/components/nv-sidebar/nv-sidebar.js +309 -0
  131. package/dist/collection/components/nv-sidebar/nv-sidebar.js.map +1 -0
  132. package/dist/collection/components/nv-sidebar/styles/nv-sidebar.css +73 -0
  133. package/dist/collection/components/nv-sidebarcontent/nv-sidebarcontent.css +7 -0
  134. package/dist/collection/components/nv-sidebarcontent/nv-sidebarcontent.docs.js +6 -0
  135. package/dist/collection/components/nv-sidebarcontent/nv-sidebarcontent.docs.js.map +1 -0
  136. package/dist/collection/components/nv-sidebarcontent/nv-sidebarcontent.js +24 -0
  137. package/dist/collection/components/nv-sidebarcontent/nv-sidebarcontent.js.map +1 -0
  138. package/dist/collection/components/nv-sidebardivider/nv-sidebardivider.css +6 -0
  139. package/dist/collection/components/nv-sidebardivider/nv-sidebardivider.docs.js +6 -0
  140. package/dist/collection/components/nv-sidebardivider/nv-sidebardivider.docs.js.map +1 -0
  141. package/dist/collection/components/nv-sidebardivider/nv-sidebardivider.js +23 -0
  142. package/dist/collection/components/nv-sidebardivider/nv-sidebardivider.js.map +1 -0
  143. package/dist/collection/components/nv-sidebarfooter/nv-sidebarfooter.css +4 -0
  144. package/dist/collection/components/nv-sidebarfooter/nv-sidebarfooter.docs.js +6 -0
  145. package/dist/collection/components/nv-sidebarfooter/nv-sidebarfooter.docs.js.map +1 -0
  146. package/dist/collection/components/nv-sidebarfooter/nv-sidebarfooter.js +25 -0
  147. package/dist/collection/components/nv-sidebarfooter/nv-sidebarfooter.js.map +1 -0
  148. package/dist/collection/components/nv-sidebargroup/nv-sidebargroup.css +17 -0
  149. package/dist/collection/components/nv-sidebargroup/nv-sidebargroup.docs.js +6 -0
  150. package/dist/collection/components/nv-sidebargroup/nv-sidebargroup.docs.js.map +1 -0
  151. package/dist/collection/components/nv-sidebargroup/nv-sidebargroup.js +48 -0
  152. package/dist/collection/components/nv-sidebargroup/nv-sidebargroup.js.map +1 -0
  153. package/dist/collection/components/nv-sidebarheader/nv-sidebarheader.css +3 -0
  154. package/dist/collection/components/nv-sidebarheader/nv-sidebarheader.docs.js +6 -0
  155. package/dist/collection/components/nv-sidebarheader/nv-sidebarheader.docs.js.map +1 -0
  156. package/dist/collection/components/nv-sidebarheader/nv-sidebarheader.js +25 -0
  157. package/dist/collection/components/nv-sidebarheader/nv-sidebarheader.js.map +1 -0
  158. package/dist/collection/components/nv-sidebarlogo/nv-sidebarlogo.docs.js +6 -0
  159. package/dist/collection/components/nv-sidebarlogo/nv-sidebarlogo.docs.js.map +1 -0
  160. package/dist/collection/components/nv-sidebarlogo/nv-sidebarlogo.js +97 -0
  161. package/dist/collection/components/nv-sidebarlogo/nv-sidebarlogo.js.map +1 -0
  162. package/dist/collection/components/nv-sidebarlogo/styles/nv-sidebarlogo.css +47 -0
  163. package/dist/collection/components/nv-sidebarnavitem/nv-sidebarnavitem.docs.js +6 -0
  164. package/dist/collection/components/nv-sidebarnavitem/nv-sidebarnavitem.docs.js.map +1 -0
  165. package/dist/collection/components/nv-sidebarnavitem/nv-sidebarnavitem.js +422 -0
  166. package/dist/collection/components/nv-sidebarnavitem/nv-sidebarnavitem.js.map +1 -0
  167. package/dist/collection/components/nv-sidebarnavitem/styles/nv-sidebarnavitem.css +114 -0
  168. package/dist/collection/components/nv-sidebarnavsubitem/nv-sidebarnavsubitem.docs.js +6 -0
  169. package/dist/collection/components/nv-sidebarnavsubitem/nv-sidebarnavsubitem.docs.js.map +1 -0
  170. package/dist/collection/components/nv-sidebarnavsubitem/nv-sidebarnavsubitem.js +64 -0
  171. package/dist/collection/components/nv-sidebarnavsubitem/nv-sidebarnavsubitem.js.map +1 -0
  172. package/dist/collection/components/nv-sidebarnavsubitem/styles/nv-sidebarnavsubitem.css +73 -0
  173. package/dist/collection/components/nv-split/nv-split.js +1 -1
  174. package/dist/collection/components/nv-stack/nv-stack.js +1 -1
  175. package/dist/collection/components/nv-table/nv-table.docs.js +7 -0
  176. package/dist/collection/components/nv-table/nv-table.docs.js.map +1 -1
  177. package/dist/collection/components/nv-table/nv-table.js +1 -1
  178. package/dist/collection/components/nv-tableheader/nv-tableheader.css +28 -0
  179. package/dist/collection/components/nv-tableheader/nv-tableheader.docs.js +13 -0
  180. package/dist/collection/components/nv-tableheader/nv-tableheader.docs.js.map +1 -0
  181. package/dist/collection/components/nv-tableheader/nv-tableheader.js +139 -0
  182. package/dist/collection/components/nv-tableheader/nv-tableheader.js.map +1 -0
  183. package/dist/collection/components/nv-toggle/nv-toggle.js +2 -2
  184. package/dist/collection/components/nv-togglebutton/nv-togglebutton.js +1 -1
  185. package/dist/collection/components/nv-togglebutton/styles/nv-togglebutton.css +4 -0
  186. package/dist/collection/components/nv-togglebuttongroup/nv-togglebuttongroup.js +1 -1
  187. package/dist/collection/components/nv-tooltip/nv-tooltip.js +1 -1
  188. package/dist/components/index.js +3 -4
  189. package/dist/components/index.js.map +1 -1
  190. package/dist/components/nv-accordion-item.js +1 -1
  191. package/dist/components/nv-accordion.js +4 -4
  192. package/dist/components/nv-alert.js +1 -1
  193. package/dist/components/nv-avatar.js +1 -1
  194. package/dist/components/nv-badge.js +1 -1
  195. package/dist/components/nv-breadcrumb.js +2 -2
  196. package/dist/components/nv-button.js +1 -1
  197. package/dist/components/nv-datagrid.js +4 -4
  198. package/dist/components/nv-datagrid.js.map +1 -1
  199. package/dist/components/nv-dialog.js +57 -23
  200. package/dist/components/nv-dialog.js.map +1 -1
  201. package/dist/components/nv-dialogfooter.js +1 -1
  202. package/dist/components/nv-dialogheader.js +1 -1
  203. package/dist/components/nv-fieldcheckbox.js +1 -1
  204. package/dist/components/nv-fielddate.js +19 -22
  205. package/dist/components/nv-fielddate.js.map +1 -1
  206. package/dist/components/nv-fielddaterange.js +11 -13
  207. package/dist/components/nv-fielddaterange.js.map +1 -1
  208. package/dist/components/nv-fielddropdown.js +19 -10
  209. package/dist/components/nv-fielddropdown.js.map +1 -1
  210. package/dist/components/nv-fielddropdownitem.js +1 -1
  211. package/dist/components/nv-fielddropdownitemcheck.js +1 -1
  212. package/dist/components/nv-fieldmultiselect.js +8 -8
  213. package/dist/components/nv-fieldmultiselect.js.map +1 -1
  214. package/dist/components/nv-fieldnumber.js +1 -1
  215. package/dist/components/nv-fieldpassword.js +6 -6
  216. package/dist/components/nv-fieldradio.js +3 -3
  217. package/dist/components/nv-fieldselect.js +8 -8
  218. package/dist/components/nv-fieldslider.js +7 -7
  219. package/dist/components/nv-fieldtext.js +1 -1
  220. package/dist/components/nv-fieldtextarea.js +3 -3
  221. package/dist/components/nv-fieldtime.js +7 -7
  222. package/dist/components/nv-icon.js +1 -1
  223. package/dist/components/nv-iconbutton.js +1 -1
  224. package/dist/components/nv-loader.js +1 -1
  225. package/dist/components/nv-menu.js +4 -4
  226. package/dist/components/nv-menuitem.js +1 -1
  227. package/dist/components/nv-notification-bullet.d.ts +11 -0
  228. package/dist/components/nv-notification-bullet.js +8 -0
  229. package/dist/components/nv-notification-bullet.js.map +1 -0
  230. package/dist/components/nv-notification.js +2 -2
  231. package/dist/components/nv-notificationcontainer.js +1 -1
  232. package/dist/components/nv-popover.js +1 -1
  233. package/dist/components/nv-row.js +1 -1
  234. package/dist/components/nv-sidebar.d.ts +11 -0
  235. package/dist/components/nv-sidebar.js +208 -0
  236. package/dist/components/nv-sidebar.js.map +1 -0
  237. package/dist/components/nv-sidebarcontent.d.ts +11 -0
  238. package/dist/components/nv-sidebarcontent.js +38 -0
  239. package/dist/components/nv-sidebarcontent.js.map +1 -0
  240. package/dist/components/nv-sidebardivider.d.ts +11 -0
  241. package/dist/components/nv-sidebardivider.js +38 -0
  242. package/dist/components/nv-sidebardivider.js.map +1 -0
  243. package/dist/components/nv-sidebarfooter.d.ts +11 -0
  244. package/dist/components/nv-sidebarfooter.js +38 -0
  245. package/dist/components/nv-sidebarfooter.js.map +1 -0
  246. package/dist/components/nv-sidebargroup.d.ts +11 -0
  247. package/dist/components/nv-sidebargroup.js +41 -0
  248. package/dist/components/nv-sidebargroup.js.map +1 -0
  249. package/dist/components/nv-sidebarheader.d.ts +11 -0
  250. package/dist/components/nv-sidebarheader.js +38 -0
  251. package/dist/components/nv-sidebarheader.js.map +1 -0
  252. package/dist/components/nv-sidebarlogo.d.ts +11 -0
  253. package/dist/components/nv-sidebarlogo.js +52 -0
  254. package/dist/components/nv-sidebarlogo.js.map +1 -0
  255. package/dist/components/nv-sidebarnavitem.d.ts +11 -0
  256. package/dist/components/nv-sidebarnavitem.js +335 -0
  257. package/dist/components/nv-sidebarnavitem.js.map +1 -0
  258. package/dist/components/nv-sidebarnavsubitem.d.ts +11 -0
  259. package/dist/components/nv-sidebarnavsubitem.js +53 -0
  260. package/dist/components/nv-sidebarnavsubitem.js.map +1 -0
  261. package/dist/components/nv-split.js +1 -1
  262. package/dist/components/nv-stack.js +1 -1
  263. package/dist/components/nv-table.js +1 -1
  264. package/dist/components/nv-tableheader.d.ts +11 -0
  265. package/dist/components/nv-tableheader.js +112 -0
  266. package/dist/components/nv-tableheader.js.map +1 -0
  267. package/dist/components/nv-toggle.js +2 -2
  268. package/dist/components/nv-togglebutton.js +2 -2
  269. package/dist/components/nv-togglebutton.js.map +1 -1
  270. package/dist/components/nv-togglebuttongroup.js +1 -1
  271. package/dist/components/nv-tooltip.js +1 -1
  272. package/dist/components/{p-18f50d91.js → p-20a1c769.js} +2 -2
  273. package/dist/components/{p-18f50d91.js.map → p-20a1c769.js.map} +1 -1
  274. package/dist/components/{p-a6c29711.js → p-2d7d3aa2.js} +3 -3
  275. package/dist/components/{p-a6c29711.js.map → p-2d7d3aa2.js.map} +1 -1
  276. package/dist/components/{p-81d915ef.js → p-439c38c3.js} +3 -3
  277. package/dist/components/{p-81d915ef.js.map → p-439c38c3.js.map} +1 -1
  278. package/dist/components/{p-429e01f3.js → p-583b3d89.js} +2 -2
  279. package/dist/components/{p-429e01f3.js.map → p-583b3d89.js.map} +1 -1
  280. package/dist/components/{p-2ac6f42d.js → p-5f78a78f.js} +3 -3
  281. package/dist/components/{p-2ac6f42d.js.map → p-5f78a78f.js.map} +1 -1
  282. package/dist/components/{p-4799b6c3.js → p-62f91b46.js} +3 -4
  283. package/dist/components/p-62f91b46.js.map +1 -0
  284. package/dist/components/{p-5a5db065.js → p-7214f13f.js} +11 -5
  285. package/dist/components/p-7214f13f.js.map +1 -0
  286. package/dist/components/p-743b3452.js +88 -0
  287. package/dist/components/p-743b3452.js.map +1 -0
  288. package/dist/components/p-82c9b7cc.js +96 -0
  289. package/dist/components/p-82c9b7cc.js.map +1 -0
  290. package/dist/components/{p-60083982.js → p-94ad267c.js} +5 -5
  291. package/dist/components/{p-60083982.js.map → p-94ad267c.js.map} +1 -1
  292. package/dist/components/{p-222136c2.js → p-996438a2.js} +2 -2
  293. package/dist/components/{p-222136c2.js.map → p-996438a2.js.map} +1 -1
  294. package/dist/components/{p-4697bd56.js → p-996ed843.js} +27 -2
  295. package/dist/components/p-996ed843.js.map +1 -0
  296. package/dist/components/p-af663ff5.js +191 -0
  297. package/dist/components/p-af663ff5.js.map +1 -0
  298. package/dist/components/{p-49205084.js → p-bcf9d309.js} +5 -5
  299. package/dist/components/{p-49205084.js.map → p-bcf9d309.js.map} +1 -1
  300. package/dist/components/{p-b67f31af.js → p-cc77f8fe.js} +7 -7
  301. package/dist/components/{p-b67f31af.js.map → p-cc77f8fe.js.map} +1 -1
  302. package/dist/components/{p-45a3cf85.js → p-d9c1cd97.js} +4 -4
  303. package/dist/components/{p-45a3cf85.js.map → p-d9c1cd97.js.map} +1 -1
  304. package/dist/components/{p-0d5ed1d7.js → p-e1f82896.js} +5 -5
  305. package/dist/components/{p-0d5ed1d7.js.map → p-e1f82896.js.map} +1 -1
  306. package/dist/components/{p-334e19d3.js → p-f6ffffd9.js} +4 -4
  307. package/dist/components/{p-334e19d3.js.map → p-f6ffffd9.js.map} +1 -1
  308. package/dist/esm/{grow.animation-03fa5c19.js → grow.animation-24ad5cf8.js} +27 -2
  309. package/dist/esm/grow.animation-24ad5cf8.js.map +1 -0
  310. package/dist/esm/index-dc2723f3.js +44 -0
  311. package/dist/esm/index.js +3 -4
  312. package/dist/esm/index.js.map +1 -1
  313. package/dist/esm/loader.js +1 -1
  314. package/dist/esm/native.js +1 -1
  315. package/dist/esm/nv-badge_2.entry.js +1 -1
  316. package/dist/esm/nv-button.entry.js +7 -2
  317. package/dist/esm/nv-button.entry.js.map +1 -1
  318. package/dist/esm/nv-datagrid.entry.js +2 -2
  319. package/dist/esm/nv-datagrid.entry.js.map +1 -1
  320. package/dist/esm/nv-dialog.entry.js +51 -17
  321. package/dist/esm/nv-dialog.entry.js.map +1 -1
  322. package/dist/esm/nv-dialogfooter_2.entry.js +2 -2
  323. package/dist/esm/nv-fieldcheckbox.entry.js +4 -4
  324. package/dist/esm/nv-fielddate.entry.js +14 -17
  325. package/dist/esm/nv-fielddate.entry.js.map +1 -1
  326. package/dist/esm/nv-fielddaterange.entry.js +7 -9
  327. package/dist/esm/nv-fielddaterange.entry.js.map +1 -1
  328. package/dist/esm/nv-fielddropdown.entry.js +14 -5
  329. package/dist/esm/nv-fielddropdown.entry.js.map +1 -1
  330. package/dist/esm/nv-fielddropdownitem.entry.js +2 -2
  331. package/dist/esm/nv-fielddropdownitem.entry.js.map +1 -1
  332. package/dist/esm/nv-fieldmultiselect.entry.js +1 -1
  333. package/dist/esm/nv-fieldmultiselect.entry.js.map +1 -1
  334. package/dist/esm/nv-fieldnumber.entry.js +3 -3
  335. package/dist/esm/nv-fieldpassword.entry.js +3 -3
  336. package/dist/esm/nv-fieldradio.entry.js +3 -3
  337. package/dist/esm/nv-fieldselect.entry.js +5 -5
  338. package/dist/esm/nv-fieldslider.entry.js +3 -3
  339. package/dist/esm/nv-fieldtext.entry.js +3 -3
  340. package/dist/esm/nv-fieldtextarea.entry.js +3 -3
  341. package/dist/esm/nv-fieldtime.entry.js +3 -3
  342. package/dist/esm/nv-icon.entry.js +2 -2
  343. package/dist/esm/nv-icon.entry.js.map +1 -1
  344. package/dist/esm/nv-iconbutton_2.entry.js +7 -2
  345. package/dist/esm/nv-iconbutton_2.entry.js.map +1 -1
  346. package/dist/esm/nv-menu.entry.js +1 -1
  347. package/dist/esm/nv-menuitem.entry.js +1 -1
  348. package/dist/esm/nv-notification-bullet.entry.js +75 -0
  349. package/dist/esm/nv-notification-bullet.entry.js.map +1 -0
  350. package/dist/esm/nv-notification.entry.js +1 -1
  351. package/dist/esm/nv-notificationcontainer.entry.js +1 -1
  352. package/dist/esm/nv-popover.entry.js +2 -3
  353. package/dist/esm/nv-popover.entry.js.map +1 -1
  354. package/dist/esm/nv-row.entry.js +1 -1
  355. package/dist/esm/nv-sidebar.entry.js +175 -0
  356. package/dist/esm/nv-sidebar.entry.js.map +1 -0
  357. package/dist/esm/nv-sidebarcontent.entry.js +20 -0
  358. package/dist/esm/nv-sidebarcontent.entry.js.map +1 -0
  359. package/dist/esm/nv-sidebardivider.entry.js +20 -0
  360. package/dist/esm/nv-sidebardivider.entry.js.map +1 -0
  361. package/dist/esm/nv-sidebarfooter.entry.js +20 -0
  362. package/dist/esm/nv-sidebarfooter.entry.js.map +1 -0
  363. package/dist/esm/nv-sidebargroup.entry.js +21 -0
  364. package/dist/esm/nv-sidebargroup.entry.js.map +1 -0
  365. package/dist/esm/nv-sidebarheader.entry.js +20 -0
  366. package/dist/esm/nv-sidebarheader.entry.js.map +1 -0
  367. package/dist/esm/nv-sidebarlogo.entry.js +30 -0
  368. package/dist/esm/nv-sidebarlogo.entry.js.map +1 -0
  369. package/dist/esm/nv-sidebarnavitem.entry.js +295 -0
  370. package/dist/esm/nv-sidebarnavitem.entry.js.map +1 -0
  371. package/dist/esm/nv-sidebarnavsubitem.entry.js +33 -0
  372. package/dist/esm/nv-sidebarnavsubitem.entry.js.map +1 -0
  373. package/dist/esm/nv-split.entry.js +1 -1
  374. package/dist/esm/nv-stack.entry.js +1 -1
  375. package/dist/esm/nv-table.entry.js +1 -1
  376. package/dist/esm/nv-tableheader.entry.js +73 -0
  377. package/dist/esm/nv-tableheader.entry.js.map +1 -0
  378. package/dist/esm/nv-toggle.entry.js +2 -2
  379. package/dist/esm/nv-togglebutton.entry.js +2 -2
  380. package/dist/esm/nv-togglebutton.entry.js.map +1 -1
  381. package/dist/esm/nv-togglebuttongroup.entry.js +1 -1
  382. package/dist/esm/nv-tooltip.entry.js +1 -1
  383. package/dist/native/index.esm.js +1 -1
  384. package/dist/native/index.esm.js.map +1 -1
  385. package/dist/native/native.css +1 -1
  386. package/dist/native/native.esm.js +1 -1
  387. package/dist/native/native.esm.js.map +1 -1
  388. package/dist/native/p-02debfd0.entry.js +2 -0
  389. package/dist/native/p-02debfd0.entry.js.map +1 -0
  390. package/dist/native/{p-859bf9ad.entry.js → p-1ee225be.entry.js} +2 -2
  391. package/dist/native/p-1ee225be.entry.js.map +1 -0
  392. package/dist/native/p-21dde805.entry.js +2 -0
  393. package/dist/native/p-242cdeac.entry.js +2 -0
  394. package/dist/native/p-242cdeac.entry.js.map +1 -0
  395. package/dist/native/p-2ba7b6f2.entry.js +2 -0
  396. package/dist/native/p-2ba7b6f2.entry.js.map +1 -0
  397. package/dist/native/{p-b4382c94.entry.js → p-2d363bd9.entry.js} +2 -2
  398. package/dist/native/{p-b02c896a.entry.js → p-31a61359.entry.js} +2 -2
  399. package/dist/native/p-32c16132.entry.js +2 -0
  400. package/dist/native/p-32c16132.entry.js.map +1 -0
  401. package/dist/native/p-35263b61.entry.js +2 -0
  402. package/dist/native/p-35263b61.entry.js.map +1 -0
  403. package/dist/native/{p-9950e075.entry.js → p-3df31ed5.entry.js} +2 -2
  404. package/dist/native/{p-c901693d.entry.js → p-4bf63654.entry.js} +2 -2
  405. package/dist/native/p-6005ff69.entry.js +2 -0
  406. package/dist/native/p-6005ff69.entry.js.map +1 -0
  407. package/dist/native/p-63348887.entry.js +2 -0
  408. package/dist/native/p-63348887.entry.js.map +1 -0
  409. package/dist/native/{p-587d94f3.entry.js → p-6fb6b9e4.entry.js} +2 -2
  410. package/dist/native/{p-a2f58133.entry.js → p-7a2f37e2.entry.js} +2 -2
  411. package/dist/native/p-7b7bbac7.entry.js +2 -0
  412. package/dist/native/p-7b7bbac7.entry.js.map +1 -0
  413. package/dist/native/{p-075d231e.entry.js → p-87deff5a.entry.js} +2 -2
  414. package/dist/native/p-8bee34e6.entry.js +2 -0
  415. package/dist/native/p-8bee34e6.entry.js.map +1 -0
  416. package/dist/native/{p-6a418ec4.entry.js → p-93d80b03.entry.js} +2 -2
  417. package/dist/native/p-98cab7d2.entry.js +2 -0
  418. package/dist/native/p-98cab7d2.entry.js.map +1 -0
  419. package/dist/native/p-996ed843.js +2 -0
  420. package/dist/native/p-996ed843.js.map +1 -0
  421. package/dist/native/{p-fa3e588e.entry.js → p-9e36eebc.entry.js} +2 -2
  422. package/dist/native/{p-2a7f80f4.entry.js → p-a4a0021c.entry.js} +2 -2
  423. package/dist/native/{p-17666092.entry.js → p-a6d8d9a1.entry.js} +2 -2
  424. package/dist/native/{p-eb74feb7.entry.js → p-a9a7f1b8.entry.js} +2 -2
  425. package/dist/native/p-ad5e12d2.entry.js +2 -0
  426. package/dist/native/{p-e6f24210.entry.js.map → p-ad5e12d2.entry.js.map} +1 -1
  427. package/dist/native/{p-fffbd3c1.entry.js → p-aefd32f0.entry.js} +2 -2
  428. package/dist/native/p-b369a073.entry.js +2 -0
  429. package/dist/native/{p-dfb6b65e.entry.js.map → p-b369a073.entry.js.map} +1 -1
  430. package/dist/native/p-b3d6e9f4.entry.js +2 -0
  431. package/dist/native/{p-c9fea0df.entry.js.map → p-b3d6e9f4.entry.js.map} +1 -1
  432. package/dist/native/{p-445221dc.entry.js → p-b4128eb5.entry.js} +2 -2
  433. package/dist/native/p-b43d6629.entry.js +2 -0
  434. package/dist/native/p-b43d6629.entry.js.map +1 -0
  435. package/dist/native/p-b5e752f5.entry.js +2 -0
  436. package/dist/native/p-b5e752f5.entry.js.map +1 -0
  437. package/dist/native/p-b860d0d3.entry.js +7 -0
  438. package/dist/native/p-b860d0d3.entry.js.map +1 -0
  439. package/dist/native/{p-9c432751.entry.js → p-b97f392a.entry.js} +2 -2
  440. package/dist/native/{p-d63689da.entry.js → p-bd91e0bb.entry.js} +2 -2
  441. package/dist/native/p-bd91e0bb.entry.js.map +1 -0
  442. package/dist/native/{p-122c78c3.entry.js → p-be49d837.entry.js} +2 -2
  443. package/dist/native/{p-122c78c3.entry.js.map → p-be49d837.entry.js.map} +1 -1
  444. package/dist/native/{p-a026654f.entry.js → p-c37ab530.entry.js} +2 -2
  445. package/dist/native/{p-44a78545.entry.js → p-c4cd2860.entry.js} +2 -2
  446. package/dist/native/{p-bd9bf6a1.entry.js → p-d22a503b.entry.js} +2 -2
  447. package/dist/native/{p-f3c73492.entry.js → p-da76357c.entry.js} +2 -2
  448. package/dist/native/{p-d0db5e72.entry.js → p-dac1537a.entry.js} +2 -2
  449. package/dist/native/p-e688c905.entry.js +2 -0
  450. package/dist/native/{p-218135b1.entry.js.map → p-e688c905.entry.js.map} +1 -1
  451. package/dist/native/p-e7fdcb83.entry.js +2 -0
  452. package/dist/native/p-e7fdcb83.entry.js.map +1 -0
  453. package/dist/native/{p-0177409b.entry.js → p-e887bbf5.entry.js} +2 -2
  454. package/dist/native/p-f22ac722.entry.js +2 -0
  455. package/dist/native/p-f22ac722.entry.js.map +1 -0
  456. package/dist/native/p-f8a099a5.entry.js +2 -0
  457. package/dist/native/p-f8a099a5.entry.js.map +1 -0
  458. package/dist/types/components/nv-button/nv-button.d.ts +5 -0
  459. package/dist/types/components/nv-datagrid/nv-datagrid.d.ts +2 -0
  460. package/dist/types/components/nv-dialog/nv-dialog.d.ts +4 -2
  461. package/dist/types/components/nv-fielddate/nv-fielddate.d.ts +1 -1
  462. package/dist/types/components/nv-fielddropdown/nv-fielddropdown.d.ts +1 -0
  463. package/dist/types/components/nv-icon/nv-icons.d.ts +1 -1
  464. package/dist/types/components/nv-iconbutton/nv-iconbutton.d.ts +5 -0
  465. package/dist/types/components/nv-notification-bullet/nv-notification-bullet.d.ts +44 -0
  466. package/dist/types/components/nv-notification-bullet/nv-notification-bullet.docs.d.ts +4 -0
  467. package/dist/types/components/nv-sidebar/nv-sidebar.d.ts +64 -0
  468. package/dist/types/components/nv-sidebar/nv-sidebar.docs.d.ts +4 -0
  469. package/dist/types/components/nv-sidebarcontent/nv-sidebarcontent.d.ts +8 -0
  470. package/dist/types/components/nv-sidebarcontent/nv-sidebarcontent.docs.d.ts +4 -0
  471. package/dist/types/components/nv-sidebardivider/nv-sidebardivider.d.ts +7 -0
  472. package/dist/types/components/nv-sidebardivider/nv-sidebardivider.docs.d.ts +4 -0
  473. package/dist/types/components/nv-sidebarfooter/nv-sidebarfooter.d.ts +9 -0
  474. package/dist/types/components/nv-sidebarfooter/nv-sidebarfooter.docs.d.ts +4 -0
  475. package/dist/types/components/nv-sidebargroup/nv-sidebargroup.d.ts +13 -0
  476. package/dist/types/components/nv-sidebargroup/nv-sidebargroup.docs.d.ts +4 -0
  477. package/dist/types/components/nv-sidebarheader/nv-sidebarheader.d.ts +9 -0
  478. package/dist/types/components/nv-sidebarheader/nv-sidebarheader.docs.d.ts +4 -0
  479. package/dist/types/components/nv-sidebarlogo/nv-sidebarlogo.d.ts +26 -0
  480. package/dist/types/components/nv-sidebarlogo/nv-sidebarlogo.docs.d.ts +4 -0
  481. package/dist/types/components/nv-sidebarnavitem/nv-sidebarnavitem.d.ts +62 -0
  482. package/dist/types/components/nv-sidebarnavitem/nv-sidebarnavitem.docs.d.ts +4 -0
  483. package/dist/types/components/nv-sidebarnavsubitem/nv-sidebarnavsubitem.d.ts +15 -0
  484. package/dist/types/components/nv-sidebarnavsubitem/nv-sidebarnavsubitem.docs.d.ts +4 -0
  485. package/dist/types/components/nv-tableheader/nv-tableheader.d.ts +32 -0
  486. package/dist/types/components/nv-tableheader/nv-tableheader.docs.d.ts +4 -0
  487. package/dist/types/components.d.ts +594 -0
  488. package/dist/vscode-data.json +1823 -32
  489. package/hydrate/index.js +1066 -112
  490. package/hydrate/index.mjs +1066 -112
  491. package/package.json +45 -5
  492. package/dist/cjs/events.utils-52846a7d.js +0 -32
  493. package/dist/cjs/events.utils-52846a7d.js.map +0 -1
  494. package/dist/cjs/grow.animation-f1cef0ad.js.map +0 -1
  495. package/dist/components/p-4697bd56.js.map +0 -1
  496. package/dist/components/p-4799b6c3.js.map +0 -1
  497. package/dist/components/p-5a5db065.js.map +0 -1
  498. package/dist/components/p-946a047c.js +0 -88
  499. package/dist/components/p-946a047c.js.map +0 -1
  500. package/dist/components/p-d429a343.js +0 -28
  501. package/dist/components/p-d429a343.js.map +0 -1
  502. package/dist/components/p-e1b2eba2.js +0 -185
  503. package/dist/components/p-e1b2eba2.js.map +0 -1
  504. package/dist/esm/events.utils-fe1d907f.js +0 -28
  505. package/dist/esm/events.utils-fe1d907f.js.map +0 -1
  506. package/dist/esm/grow.animation-03fa5c19.js.map +0 -1
  507. package/dist/native/p-144d0f8a.entry.js +0 -2
  508. package/dist/native/p-144d0f8a.entry.js.map +0 -1
  509. package/dist/native/p-218135b1.entry.js +0 -2
  510. package/dist/native/p-4697bd56.js +0 -2
  511. package/dist/native/p-4697bd56.js.map +0 -1
  512. package/dist/native/p-57420a2f.entry.js +0 -2
  513. package/dist/native/p-859bf9ad.entry.js.map +0 -1
  514. package/dist/native/p-8e423742.entry.js +0 -7
  515. package/dist/native/p-8e423742.entry.js.map +0 -1
  516. package/dist/native/p-a6fc987a.entry.js +0 -2
  517. package/dist/native/p-a6fc987a.entry.js.map +0 -1
  518. package/dist/native/p-c9fea0df.entry.js +0 -2
  519. package/dist/native/p-d429a343.js +0 -2
  520. package/dist/native/p-d429a343.js.map +0 -1
  521. package/dist/native/p-d62869ff.entry.js +0 -2
  522. package/dist/native/p-d62869ff.entry.js.map +0 -1
  523. package/dist/native/p-d63689da.entry.js.map +0 -1
  524. package/dist/native/p-d8f3cf92.entry.js +0 -2
  525. package/dist/native/p-d8f3cf92.entry.js.map +0 -1
  526. package/dist/native/p-dfb6b65e.entry.js +0 -2
  527. package/dist/native/p-e6f24210.entry.js +0 -2
  528. /package/dist/native/{p-57420a2f.entry.js.map → p-21dde805.entry.js.map} +0 -0
  529. /package/dist/native/{p-b4382c94.entry.js.map → p-2d363bd9.entry.js.map} +0 -0
  530. /package/dist/native/{p-b02c896a.entry.js.map → p-31a61359.entry.js.map} +0 -0
  531. /package/dist/native/{p-9950e075.entry.js.map → p-3df31ed5.entry.js.map} +0 -0
  532. /package/dist/native/{p-c901693d.entry.js.map → p-4bf63654.entry.js.map} +0 -0
  533. /package/dist/native/{p-587d94f3.entry.js.map → p-6fb6b9e4.entry.js.map} +0 -0
  534. /package/dist/native/{p-a2f58133.entry.js.map → p-7a2f37e2.entry.js.map} +0 -0
  535. /package/dist/native/{p-075d231e.entry.js.map → p-87deff5a.entry.js.map} +0 -0
  536. /package/dist/native/{p-6a418ec4.entry.js.map → p-93d80b03.entry.js.map} +0 -0
  537. /package/dist/native/{p-fa3e588e.entry.js.map → p-9e36eebc.entry.js.map} +0 -0
  538. /package/dist/native/{p-2a7f80f4.entry.js.map → p-a4a0021c.entry.js.map} +0 -0
  539. /package/dist/native/{p-17666092.entry.js.map → p-a6d8d9a1.entry.js.map} +0 -0
  540. /package/dist/native/{p-eb74feb7.entry.js.map → p-a9a7f1b8.entry.js.map} +0 -0
  541. /package/dist/native/{p-fffbd3c1.entry.js.map → p-aefd32f0.entry.js.map} +0 -0
  542. /package/dist/native/{p-445221dc.entry.js.map → p-b4128eb5.entry.js.map} +0 -0
  543. /package/dist/native/{p-9c432751.entry.js.map → p-b97f392a.entry.js.map} +0 -0
  544. /package/dist/native/{p-a026654f.entry.js.map → p-c37ab530.entry.js.map} +0 -0
  545. /package/dist/native/{p-44a78545.entry.js.map → p-c4cd2860.entry.js.map} +0 -0
  546. /package/dist/native/{p-bd9bf6a1.entry.js.map → p-d22a503b.entry.js.map} +0 -0
  547. /package/dist/native/{p-f3c73492.entry.js.map → p-da76357c.entry.js.map} +0 -0
  548. /package/dist/native/{p-d0db5e72.entry.js.map → p-dac1537a.entry.js.map} +0 -0
  549. /package/dist/native/{p-0177409b.entry.js.map → p-e887bbf5.entry.js.map} +0 -0
@@ -1 +1 @@
1
- {"version":3,"file":"nv-dialog.docs.js","sourceRoot":"","sources":["../../../src/components/nv-dialog/nv-dialog.docs.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,eAAe,CAAC;AAGlC,OAAO,EAAE,MAAM,EAAE,MAAM,yBAAyB,CAAC;AAEjD,MAAM,YAAY,GAAkC;IAClD,SAAS,EAAE,WAAW;IACtB,aAAa,EAAE,CAAC,iBAAiB,EAAE,iBAAiB,EAAE,WAAW,EAAE,SAAS,CAAC;IAC7E,kBAAk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gBACjD,6BAAoB;gBACpB,uBAAiB,IAAI,EAAC,QAAQ,EAAC,MAAM,SAAmB,CAC9C,CACb;SACF;QACD,cAAc;QACd;YACE,IAAI,EAAE,MAAM,CAA4B,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,WAAW,CAAC;YAC3D,iBAAiB,EAAE,iBAAiB;YACpC,QAAQ,EAAE,CACR;gBACE,iBAAW,IAAI,EAAC,SAAS,kBAAwB;gBACjD,6BAAoB;gBACpB,uBACE,IAAI,EAAC,QAAQ,kBACA,WAAW,GACP,CACT,CACb;SACF;QACD,eAAe;QACf;YACE,IAAI,EAAE,MAAM,CAA4B,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,YAAY,CAAC;YAC5D,iBAAiB,EAAE,iBAAiB;YACpC,QAAQ,EAAE,CACR;gBACE,iBAAW,IAAI,EAAC,SAAS,kBAAwB;gBACjD,6BAAoB;gBACpB,uBACE,IAAI,EAAC,QAAQ,kBACA,aAAa,GACT,CACT,CACb;SACF;QACD,OAAO;QACP;YACE,IAAI,EAAE,MAAM,CAA4B,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC;YACpD,iBAAiB,EAAE,iBAAiB;YACpC,QAAQ,EAAE,CACR;gBACE,iBAAW,IAAI,EAAC,SAAS,kBAAwB;gBACjD,YAAM,EAAE,EAAC,WAAW,GAAQ;gBAC5B,uBAAiB,IAAI,EAAC,QAAQ,EAAC,IAAI,EAAC,WAAW,GAAmB,CACxD,CACb;SACF;KACF;CACF,CAAC;AAEF,eAAe,YAAY,CAAC","sourcesContent":["import { h } from '@stencil/core';\nimport type { NovaDocs } from '../../nova-docs';\nimport { Components } from '../../components';\nimport { nameof } from '../../utils/class.utils';\n\nconst NvDialogDocs: NovaDocs<Components.NvDialog> = {\n component: 'nv-dialog',\n subcomponents: ['nv-dialogheader', 'nv-dialogfooter', 'nv-button', 'nv-icon'],\n composedComponents: ['nv-dialogheader', 'nv-dialogfooter'],\n\n stories: [\n // Default\n {\n name: 'Default',\n template: (\n <nv-dialog data-storybook-args>\n <nv-button slot=\"trigger\">Open Dialog</nv-button>\n <p>Child Content</p>\n </nv-dialog>\n ),\n },\n // Open\n {\n name: nameof<Components.NvDialog>(x => x.open),\n args: {\n open: false,\n },\n template: (\n <nv-dialog data-storybook-args>\n <nv-button slot=\"trigger\">Open Dialog</nv-button>\n <p>Child Content</p>\n </nv-dialog>\n ),\n },\n // Undismissable\n {\n name: nameof<Components.NvDialog>(x => x.undismissable),\n args: {\n undismissable: true,\n },\n template: (\n <nv-dialog data-storybook-args>\n <nv-button slot=\"trigger\">Open Dialog</nv-button>\n <p>Child Content</p>\n </nv-dialog>\n ),\n },\n // ClickOutside\n {\n name: nameof<Components.NvDialog>(x => x.clickOutside),\n args: {\n clickOutside: true,\n },\n template: (\n <nv-dialog data-storybook-args>\n <nv-button slot=\"trigger\">Open Dialog</nv-button>\n <p>Child Content</p>\n </nv-dialog>\n ),\n },\n // Full\n {\n name: nameof<Components.NvDialog>(x => x.full),\n args: {\n full: true,\n },\n template: (\n <nv-dialog data-storybook-args>\n <nv-button slot=\"trigger\">Open Dialog</nv-button>\n <p>\n The dialog will take the full width of the screen regardless of the\n content.\n </p>\n </nv-dialog>\n ),\n },\n // Heading\n {\n name: nameof<Components.NvDialogheader>(x => x.heading),\n descriptionSource: 'nv-dialogheader',\n template: (\n <nv-dialog data-storybook-args>\n <nv-button slot=\"trigger\">Open Dialog</nv-button>\n <nv-dialogheader\n slot=\"header\"\n heading=\"Dialog Heading\"\n ></nv-dialogheader>\n <p>Child Content</p>\n </nv-dialog>\n ),\n },\n // Subheading\n {\n name: nameof<Components.NvDialogheader>(x => x.subheading),\n descriptionSource: 'nv-dialogheader',\n template: (\n <nv-dialog data-storybook-args>\n <nv-button slot=\"trigger\">Open Dialog</nv-button>\n <nv-dialogheader\n slot=\"header\"\n heading=\"Dialog Heading\"\n subheading=\"Dialog Subheading\"\n ></nv-dialogheader>\n <p>Child Content</p>\n </nv-dialog>\n ),\n },\n // LeadingIcon\n {\n name: nameof<Components.NvDialogfooter>(x => x.leadingIcon),\n descriptionSource: 'nv-dialogfooter',\n template: (\n <nv-dialog data-storybook-args>\n <nv-button slot=\"trigger\">Open Dialog</nv-button>\n <p>Child Content</p>\n <nv-dialogfooter slot=\"footer\" leading-icon=\"user\"></nv-dialogfooter>\n </nv-dialog>\n ),\n },\n // TrailingIcon\n {\n name: nameof<Components.NvDialogfooter>(x => x.trailingIcon),\n descriptionSource: 'nv-dialogfooter',\n template: (\n <nv-dialog data-storybook-args>\n <nv-button slot=\"trigger\">Open Dialog</nv-button>\n <p>Child Content</p>\n <nv-dialogfooter slot=\"footer\" trailing-icon=\"user\"></nv-dialogfooter>\n </nv-dialog>\n ),\n },\n // Danger\n {\n name: nameof<Components.NvDialogfooter>(x => x.danger),\n descriptionSource: 'nv-dialogfooter',\n template: (\n <nv-dialog data-storybook-args>\n <nv-button slot=\"trigger\">Open Dialog</nv-button>\n <p>Child Content</p>\n <nv-dialogfooter slot=\"footer\" danger></nv-dialogfooter>\n </nv-dialog>\n ),\n },\n // CancelLabel\n {\n name: nameof<Components.NvDialogfooter>(x => x.cancelLabel),\n descriptionSource: 'nv-dialogfooter',\n template: (\n <nv-dialog data-storybook-args>\n <nv-button slot=\"trigger\">Open Dialog</nv-button>\n <p>Child Content</p>\n <nv-dialogfooter\n slot=\"footer\"\n cancel-label=\"Abbrechen\"\n ></nv-dialogfooter>\n </nv-dialog>\n ),\n },\n // PrimaryLabel\n {\n name: nameof<Components.NvDialogfooter>(x => x.primaryLabel),\n descriptionSource: 'nv-dialogfooter',\n template: (\n <nv-dialog data-storybook-args>\n <nv-button slot=\"trigger\">Open Dialog</nv-button>\n <p>Child Content</p>\n <nv-dialogfooter\n slot=\"footer\"\n submit-label=\"Akzeptieren\"\n ></nv-dialogfooter>\n </nv-dialog>\n ),\n },\n // Form\n {\n name: nameof<Components.NvDialogfooter>(x => x.form),\n descriptionSource: 'nv-dialogfooter',\n template: (\n <nv-dialog data-storybook-args>\n <nv-button slot=\"trigger\">Open Dialog</nv-button>\n <form id=\"test-form\"></form>\n <nv-dialogfooter slot=\"footer\" form=\"test-form\"></nv-dialogfooter>\n </nv-dialog>\n ),\n },\n ],\n};\n\nexport default NvDialogDocs;\n"]}
1
+ {"version":3,"file":"nv-dialog.docs.js","sourceRoot":"","sources":["../../../src/components/nv-dialog/nv-dialog.docs.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,eAAe,CAAC;AAGlC,OAAO,EAAE,MAAM,EAAE,MAAM,yBAAyB,CAAC;AAEjD,MAAM,YAAY,GAAkC;IAClD,SAAS,EAAE,WAAW;IACtB,aAAa,EAAE;QACb,iBAAiB;QACjB,iBAAiB;QACjB,WAAW;QACX,SAAS;QACT,cAAc;QACd,mBAAmB;KACpB;IACD,kBAAkB,EAAE,CAAC,iBAAiB,EAAE,iBAAiB,CAAC;IAE1D,OAAO,EAAE;QACP,UAAU;QACV;YACE,IAAI,EAAE,SAAS;YACf,QAAQ,EAAE,CACR;gBACE,iBAAW,IAAI,EAAC,SAAS,kBAAwB;gBACjD,6BAAoB,CACV,CACb;SACF;QACD,OAAO;QACP;YACE,IAAI,EAAE,MAAM,CAAsB,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC;YAC9C,IAAI,EAAE;gBACJ,IAAI,EAAE,KAAK;aACZ;YACD,QAAQ,EAAE,CACR;gBACE,iBAAW,IAAI,EAAC,SAAS,kBAAwB;gBACjD,6BAAoB,CACV,CACb;SACF;QACD,gBAAgB;QAChB;YACE,IAAI,EAAE,MAAM,CAAsB,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,aAAa,CAAC;YACvD,IAAI,EAAE;gBACJ,aAAa,EAAE,IAAI;aACpB;YACD,QAAQ,EAAE,CACR;gBACE,iBAAW,IAAI,EAAC,SAAS,kBAAwB;gBACjD,6BAAoB,CACV,CACb;SACF;QACD,eAAe;QACf;YACE,IAAI,EAAE,M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AAI,CAAC;YACpD,iBAAiB,EAAE,iBAAiB;YACpC,QAAQ,EAAE,CACR;gBACE,iBAAW,IAAI,EAAC,SAAS,kBAAwB;gBACjD,YAAM,EAAE,EAAC,WAAW,GAAQ;gBAC5B,uBAAiB,IAAI,EAAC,QAAQ,EAAC,IAAI,EAAC,WAAW,GAAmB,CACxD,CACb;SACF;QACD,wBAAwB;QACxB;YACE,IAAI,EAAE,qBAAqB;YAC3B,WAAW,EAAE,2DAA2D;YACxE,QAAQ,EAAE,CACR;gBACE,iBAAW,IAAI,EAAC,SAAS,kBAAwB;gBACjD,6BAAoB;gBACpB,WAAK,KAAK,EAAC,qBAAqB;oBAC9B,uBAA6B;oBAC7B,4BAAuC,CACnC,CACI,CACb;SACF;KACF;CACF,CAAC;AAEF,eAAe,YAAY,CAAC","sourcesContent":["import { h } from '@stencil/core';\nimport type { NovaDocs } from '../../nova-docs';\nimport { Components } from '../../components';\nimport { nameof } from '../../utils/class.utils';\n\nconst NvDialogDocs: NovaDocs<Components.NvDialog> = {\n component: 'nv-dialog',\n subcomponents: [\n 'nv-dialogheader',\n 'nv-dialogfooter',\n 'nv-button',\n 'nv-icon',\n 'nv-fielddate',\n 'nv-fielddaterange',\n ],\n composedComponents: ['nv-dialogheader', 'nv-dialogfooter'],\n\n stories: [\n // Default\n {\n name: 'Default',\n template: (\n <nv-dialog data-storybook-args>\n <nv-button slot=\"trigger\">Open Dialog</nv-button>\n <p>Child Content</p>\n </nv-dialog>\n ),\n },\n // Open\n {\n name: nameof<Components.NvDialog>(x => x.open),\n args: {\n open: false,\n },\n template: (\n <nv-dialog data-storybook-args>\n <nv-button slot=\"trigger\">Open Dialog</nv-button>\n <p>Child Content</p>\n </nv-dialog>\n ),\n },\n // Undismissable\n {\n name: nameof<Components.NvDialog>(x => x.undismissable),\n args: {\n undismissable: true,\n },\n template: (\n <nv-dialog data-storybook-args>\n <nv-button slot=\"trigger\">Open Dialog</nv-button>\n <p>Child Content</p>\n </nv-dialog>\n ),\n },\n // ClickOutside\n {\n name: nameof<Components.NvDialog>(x => x.clickOutside),\n args: {\n clickOutside: true,\n },\n template: (\n <nv-dialog data-storybook-args>\n <nv-button slot=\"trigger\">Open Dialog</nv-button>\n <p>Child Content</p>\n </nv-dialog>\n ),\n },\n // Full\n {\n name: nameof<Components.NvDialog>(x => x.full),\n args: {\n full: true,\n },\n template: (\n <nv-dialog data-storybook-args>\n <nv-button slot=\"trigger\">Open Dialog</nv-button>\n <p>\n The dialog will take the full width of the screen regardless of the\n content.\n </p>\n </nv-dialog>\n ),\n },\n // Heading\n {\n name: nameof<Components.NvDialogheader>(x => x.heading),\n descriptionSource: 'nv-dialogheader',\n template: (\n <nv-dialog data-storybook-args>\n <nv-button slot=\"trigger\">Open Dialog</nv-button>\n <nv-dialogheader\n slot=\"header\"\n heading=\"Dialog Heading\"\n ></nv-dialogheader>\n <p>Child Content</p>\n </nv-dialog>\n ),\n },\n // Subheading\n {\n name: nameof<Components.NvDialogheader>(x => x.subheading),\n descriptionSource: 'nv-dialogheader',\n template: (\n <nv-dialog data-storybook-args>\n <nv-button slot=\"trigger\">Open Dialog</nv-button>\n <nv-dialogheader\n slot=\"header\"\n heading=\"Dialog Heading\"\n subheading=\"Dialog Subheading\"\n ></nv-dialogheader>\n <p>Child Content</p>\n </nv-dialog>\n ),\n },\n // LeadingIcon\n {\n name: nameof<Components.NvDialogfooter>(x => x.leadingIcon),\n descriptionSource: 'nv-dialogfooter',\n template: (\n <nv-dialog data-storybook-args>\n <nv-button slot=\"trigger\">Open Dialog</nv-button>\n <p>Child Content</p>\n <nv-dialogfooter slot=\"footer\" leading-icon=\"user\"></nv-dialogfooter>\n </nv-dialog>\n ),\n },\n // TrailingIcon\n {\n name: nameof<Components.NvDialogfooter>(x => x.trailingIcon),\n descriptionSource: 'nv-dialogfooter',\n template: (\n <nv-dialog data-storybook-args>\n <nv-button slot=\"trigger\">Open Dialog</nv-button>\n <p>Child Content</p>\n <nv-dialogfooter slot=\"footer\" trailing-icon=\"user\"></nv-dialogfooter>\n </nv-dialog>\n ),\n },\n // Danger\n {\n name: nameof<Components.NvDialogfooter>(x => x.danger),\n descriptionSource: 'nv-dialogfooter',\n template: (\n <nv-dialog data-storybook-args>\n <nv-button slot=\"trigger\">Open Dialog</nv-button>\n <p>Child Content</p>\n <nv-dialogfooter slot=\"footer\" danger></nv-dialogfooter>\n </nv-dialog>\n ),\n },\n // CancelLabel\n {\n name: nameof<Components.NvDialogfooter>(x => x.cancelLabel),\n descriptionSource: 'nv-dialogfooter',\n template: (\n <nv-dialog data-storybook-args>\n <nv-button slot=\"trigger\">Open Dialog</nv-button>\n <p>Child Content</p>\n <nv-dialogfooter\n slot=\"footer\"\n cancel-label=\"Abbrechen\"\n ></nv-dialogfooter>\n </nv-dialog>\n ),\n },\n // PrimaryLabel\n {\n name: nameof<Components.NvDialogfooter>(x => x.primaryLabel),\n descriptionSource: 'nv-dialogfooter',\n template: (\n <nv-dialog data-storybook-args>\n <nv-button slot=\"trigger\">Open Dialog</nv-button>\n <p>Child Content</p>\n <nv-dialogfooter\n slot=\"footer\"\n submit-label=\"Akzeptieren\"\n ></nv-dialogfooter>\n </nv-dialog>\n ),\n },\n // Form\n {\n name: nameof<Components.NvDialogfooter>(x => x.form),\n descriptionSource: 'nv-dialogfooter',\n template: (\n <nv-dialog data-storybook-args>\n <nv-button slot=\"trigger\">Open Dialog</nv-button>\n <form id=\"test-form\"></form>\n <nv-dialogfooter slot=\"footer\" form=\"test-form\"></nv-dialogfooter>\n </nv-dialog>\n ),\n },\n // With popover elements\n {\n name: 'WithPopoverElements',\n description: 'The dialog can contain other form elements with popovers.',\n template: (\n <nv-dialog data-storybook-args>\n <nv-button slot=\"trigger\">Open Dialog</nv-button>\n <p>Child Content</p>\n <div class=\"flex flex-col gap-4\">\n <nv-fielddate></nv-fielddate>\n <nv-fielddaterange></nv-fielddaterange>\n </div>\n </nv-dialog>\n ),\n },\n ],\n};\n\nexport default NvDialogDocs;\n"]}
@@ -1,6 +1,7 @@
1
1
  import { Host, h, } from "@stencil/core";
2
2
  import { tabbable } from "tabbable";
3
3
  import { addEventListeners, removeEventListeners, } from "../../utils/events.utils";
4
+ import { useGrow, useFade, parallel } from "../../animations";
4
5
  import clsx from "clsx";
5
6
  import { ButtonType } from "../../utils/constants";
6
7
  import { v4 as uuidv4 } from "uuid";
@@ -72,13 +73,30 @@ export class NvDialog {
72
73
  this.close();
73
74
  }
74
75
  };
75
- this.handleClickOutside = (event) => {
76
- if (event.target === this.dialogElement) {
76
+ /**
77
+ * Handles the click event to close the dialog when clickOutside is true.
78
+ * @param {MouseEvent} event - The click event.
79
+ */
80
+ this.handleDialogClick = (event) => {
81
+ if (!this.clickOutside || this.undismissable)
82
+ return;
83
+ if (this.checkForOpenPopovers())
84
+ return;
85
+ if (event.target === this.backdropElement) {
77
86
  this.close();
78
87
  event.preventDefault();
79
88
  event.stopPropagation();
80
89
  }
81
90
  };
91
+ this.checkForOpenPopovers = () => {
92
+ let hasOpenPopover = false;
93
+ this.el.querySelectorAll('nv-popover').forEach(popover => {
94
+ if (popover.hasAttribute('open')) {
95
+ hasOpenPopover = true;
96
+ }
97
+ });
98
+ return hasOpenPopover;
99
+ };
82
100
  }
83
101
  //#endregion PROPERTIES
84
102
  /****************************************************************************/
@@ -92,7 +110,18 @@ export class NvDialog {
92
110
  /** It is recommended to use the .show() or .showModal() method to render
93
111
  * dialogs, rather than the open attribute. If a <dialog> is opened using
94
112
  * the open attribute, it is non-modal. */
113
+ const { setFadeOut } = useFade(this.dialogElement);
114
+ setFadeOut();
95
115
  this.dialogElement.showModal();
116
+ const { setGrowIn, growIn } = useGrow(this.contentElement, {
117
+ duration: 100,
118
+ amount: 0.9,
119
+ });
120
+ const { fadeIn } = useFade(this.dialogElement, {
121
+ duration: 100,
122
+ });
123
+ setGrowIn();
124
+ await parallel(fadeIn, growIn).start();
96
125
  }
97
126
  /**
98
127
  * Call this method to hide the dialog, making it disappear from view.
@@ -100,6 +129,14 @@ export class NvDialog {
100
129
  async close() {
101
130
  this.open = false;
102
131
  this.allowScroll();
132
+ const { growOut } = useGrow(this.contentElement, {
133
+ duration: 150,
134
+ amount: 0.85,
135
+ });
136
+ const { fadeOut } = useFade(this.dialogElement, {
137
+ duration: 150,
138
+ });
139
+ await parallel(growOut, fadeOut).start();
103
140
  this.dialogElement.close();
104
141
  }
105
142
  /**
@@ -182,23 +219,17 @@ export class NvDialog {
182
219
  handleKeyDown(event) {
183
220
  if (event.key !== 'Escape')
184
221
  return;
185
- if (this.undismissable) {
222
+ if (!this.open)
223
+ return;
224
+ event.preventDefault();
225
+ event.stopPropagation();
226
+ const hasOpenPopover = this.checkForOpenPopovers();
227
+ if (!this.undismissable && !hasOpenPopover) {
186
228
  event.preventDefault();
187
229
  event.stopPropagation();
188
- }
189
- else {
190
230
  this.close();
191
231
  }
192
232
  }
193
- /**
194
- * Handles the click event to close the dialog when clickOutside is true.
195
- * @param {MouseEvent} event - The click event.
196
- */
197
- handleDocumentClick(event) {
198
- if (!this.clickOutside || this.undismissable)
199
- return;
200
- this.handleClickOutside(event);
201
- }
202
233
  //#endregion LISTENERS
203
234
  /****************************************************************************/
204
235
  //#region LIFECYCLE
@@ -236,6 +267,7 @@ export class NvDialog {
236
267
  this.attachEventListeners();
237
268
  // Additional form check in case form was added after initial load
238
269
  this.checkForForm();
270
+ // this.setupContentBodyListeners();
239
271
  }
240
272
  disconnectedCallback() {
241
273
  if (this.triggerElement && !this.eventsAttached && !this.controlled) {
@@ -249,7 +281,7 @@ export class NvDialog {
249
281
  //#region RENDER
250
282
  render() {
251
283
  const hasForm = this.form || this.el.querySelector('form');
252
- return (h(Host, { key: 'b32680019247cf7e39b5861a77dce61e08eadd7b' }, h("slot", { key: '104978b5cccd97997955a6c0db21f9549643f40a', name: "trigger" }), h("dialog", { key: '951a58755ac49f6c2b2f427599d5bc2540c65e2e', ref: el => (this.dialogElement = el), onClose: this.handleDialogClose, role: "dialog", "aria-modal": "true", "aria-labelledby": "dialog-header", "aria-describedby": "dialog-content", class: clsx({ full: this.full }) }, h("div", { key: '96b727e70efe35991086ead905f925af28808cb8', class: "content" }, !this.undismissable && (h("nv-button", { key: '36f2214d2ed81d7b85c3c523f490e75ca2bffc68', class: "close-button", emphasis: "lower", size: "sm", onClick: this.handleDialogClose, "aria-label": "Close dialog" }, h("nv-icon", { key: '7a50fc4e330e7ab67bba0fa429c5cd92630014bc', name: "x", size: "sm" }))), this.headerElement ? (h("slot", { name: "header" })) : (h("nv-dialogheader", { id: "dialog-header" })), h("div", { key: 'cf4269a73467794d0158a4e56f34e2a81edd6643', class: "content-body", id: "dialog-content" }, h("slot", { key: 'f91e72aafdd2f5de65ae78262f274b83bd37560d' })), this.footerElement ? (h("slot", { name: "footer" })) : (h("nv-dialogfooter", { form: this.form, primaryButtonType: hasForm ? ButtonType.Submit : ButtonType.Button, onDialogCanceled: this.handleDialogClose, undismissable: this.undismissable }))))));
284
+ return (h(Host, { key: '91b36e5daac0251997c7a6794166794f1e89087f' }, h("slot", { key: 'abeef317af74093c9b09fa6f2d300c23bbde54a6', name: "trigger" }), h("dialog", { key: '1eb417dc921bca7837aa05aad9c252fba7d9d920', ref: el => (this.dialogElement = el), onClose: this.handleDialogClose, onClick: this.handleDialogClick, role: "dialog", "aria-modal": "true", "aria-labelledby": "dialog-header", "aria-describedby": "dialog-content", class: clsx({ full: this.full }) }, h("div", { key: '8ec55c461a747ebb4556fbf791ee1d66d3bcc51a', class: "backdrop", ref: el => (this.backdropElement = el) }, h("div", { key: '373beedad09464f3473935e0464b3f51133e0372', class: "content", ref: el => (this.contentElement = el) }, !this.undismissable && (h("nv-button", { key: '5e94d056687837b017991f54df6cf350159addcc', class: "close-button", emphasis: "lower", size: "sm", onClick: this.handleDialogClose, "aria-label": "Close dialog" }, h("nv-icon", { key: '98db7848b9796589b9e7670c62a26417228a15d6', name: "x", size: "sm" }))), this.headerElement ? (h("slot", { name: "header" })) : (h("nv-dialogheader", { id: "dialog-header" })), h("div", { key: '611eb7914b65d5a27513f91eb458a578dbc63734', class: "content-body", id: "dialog-content" }, h("slot", { key: 'caf21876e6a33e997eccdc577fb43d6e63fcfc90' })), this.footerElement ? (h("slot", { name: "footer" })) : (h("nv-dialogfooter", { form: this.form, primaryButtonType: hasForm ? ButtonType.Submit : ButtonType.Button, onDialogCanceled: this.handleDialogClose, undismissable: this.undismissable })))))));
253
285
  }
254
286
  static get is() { return "nv-dialog"; }
255
287
  static get originalStyleUrls() {
@@ -537,12 +569,6 @@ export class NvDialog {
537
569
  "target": "document",
538
570
  "capture": false,
539
571
  "passive": false
540
- }, {
541
- "name": "click",
542
- "method": "handleDocumentClick",
543
- "target": "document",
544
- "capture": false,
545
- "passive": false
546
572
  }];
547
573
  }
548
574
  }
@@ -1 +1 @@
1
- {"version":3,"file":"nv-dialog.js","sourceRoot":"","sources":["../../../src/components/nv-dialog/nv-dialog.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,EACT,IAAI,EACJ,IAAI,EACJ,CAAC,EACD,OAAO,EACP,MAAM,EACN,KAAK,EAEL,KAAK,EACL,MAAM,GACP,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AACpC,OAAO,EACL,iBAAiB,EACjB,oBAAoB,GAErB,MAAM,0BAA0B,CAAC;AAClC,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AACnD,OAAO,EAAE,EAAE,IAAI,MAAM,EAAE,MAAM,MAAM,CAAC;AAEpC;;;;;GAKG;AAMH,MAAM,OAAO,QAAQ;IALrB;QAQU,mBAAc,GAAG,KAAK,CAAC;QAGvB,uBAAkB,GAAuB;YAC/C,CAAC,OAAO,EAAE,IAAI,CAAC,IAAI,CAAC;YACpB;gBACE,SAAS;gBACT,CAAC,CAAgB,EAAE,EAAE;oBACnB,IAAI,CAAC,CAAC,GAAG,KAAK,OAAO,IAAI,CAAC,CAAC,GAAG,KAAK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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAGF","sourcesContent":["import {\n Component,\n Host,\n Prop,\n h,\n Element,\n Method,\n Event,\n EventEmitter,\n Watch,\n Listen,\n} from '@stencil/core';\nimport { tabbable } from 'tabbable';\nimport {\n addEventListeners,\n removeEventListeners,\n type EventsAndListeners,\n} from '../../utils/events.utils';\nimport clsx from 'clsx';\nimport { ButtonType } from '../../utils/constants';\nimport { v4 as uuidv4 } from 'uuid';\n\n/**\n * @slot default - Body of the dialog.\n * @slot trigger - Content to be placed as the trigger, will override the trigger prop.\n * @slot header - Content to be placed as the header, will override the header prop.\n * @slot footer - Content to be placed as the footer, will override the footer prop.\n */\n@Component({\n tag: 'nv-dialog',\n styleUrl: 'nv-dialog.scss',\n shadow: false,\n})\nexport class NvDialog {\n @Element() el: HTMLNvDialogElement;\n private dialogElement!: HTMLDialogElement;\n private eventsAttached = false;\n private form: string;\n\n private triggerClickEvents: EventsAndListeners = [\n ['click', this.show],\n [\n 'keydown',\n (e: KeyboardEvent) => {\n if (e.key === 'Enter' || e.key === ' ') {\n e.preventDefault();\n this.show();\n }\n },\n ],\n ];\n\n /****************************************************************************/\n //#region PROPERTIES\n\n /**\n * @internal\n * Accepts a reference to the DOM element acting as the popover trigger. This\n * should be used when the slot for the trigger is not defined.\n */\n @Prop({ reflect: false, mutable: true })\n triggerElement: Element;\n\n /**\n * @internal\n * Accepts a reference to the DOM element acting as the header. This should\n * be used when the slot for the header is not defined.\n */\n @Prop({ reflect: false, mutable: true })\n headerElement: Element;\n\n /**\n * @internal\n * Accepts a reference to the DOM element acting as the footer. This should\n * be used when the slot for the footer is not defined.\n */\n @Prop({ reflect: false, mutable: true })\n footerElement: Element;\n\n /**\n * Use this prop to toggle the visibility of the dialog. Set to true to show\n * the dialog and false to hide it.\n */\n @Prop({ reflect: true, mutable: true })\n open: boolean = false;\n\n /**\n * If true, the dialog cannot be closed by the user.\n */\n @Prop({ reflect: true })\n readonly undismissable: boolean = false;\n\n /**\n * If true, the dialog will be closed when the backdrop is clicked.\n */\n @Prop({ reflect: true })\n readonly clickOutside: boolean = false;\n\n /**\n * If true, the dialog visibility is managed manually through methods or the\n * open prop.\n */\n @Prop({ reflect: true })\n readonly controlled: boolean = false;\n\n /**\n * If true, the dialog takes full width styling.\n */\n @Prop({ reflect: true })\n readonly full: boolean = false;\n\n /**\n * Controls whether the dialog should automatically focus the first focusable\n * element when opened. When disabled, prevents unwanted tooltip triggers on\n * dialog open.\n */\n @Prop({ reflect: true })\n // eslint-disable-next-line @stencil-community/reserved-member-names\n readonly autofocus: boolean = false;\n\n //#endregion PROPERTIES\n /****************************************************************************/\n //#region METHODS\n\n /**\n * Call this method to show the dialog, making it visible on the screen.\n */\n @Method()\n public async show() {\n this.open = true;\n this.preventScroll();\n /** It is recommended to use the .show() or .showModal() method to render\n * dialogs, rather than the open attribute. If a <dialog> is opened using\n * the open attribute, it is non-modal. */\n this.dialogElement.showModal();\n }\n\n /**\n * Call this method to hide the dialog, making it disappear from view.\n */\n @Method()\n public async close() {\n this.open = false;\n this.allowScroll();\n this.dialogElement.close();\n }\n\n /**\n * Sets the autofocus on the first focusable element in the dialog.\n */\n private setAutofocus() {\n const focusableElements = tabbable(this.dialogElement, {\n displayCheck: 'none',\n });\n\n if (focusableElements.length > 0) {\n // Convert to array and find element with smallest top and left position\n let topLeftElement = focusableElements[0];\n let topLeftRect = topLeftElement.getBoundingClientRect();\n\n focusableElements.forEach(element => {\n const rect = element.getBoundingClientRect();\n if (rect.top < topLeftRect.top || rect.left < topLeftRect.left) {\n topLeftElement = element;\n topLeftRect = rect;\n }\n });\n\n // Set autofocus attribute on the found element\n topLeftElement.setAttribute('autofocus', 'true');\n }\n }\n\n /**\n * Attaches event listeners to the dialog.\n */\n private attachEventListeners() {\n if (this.triggerElement && !this.eventsAttached && !this.controlled) {\n addEventListeners(this.triggerClickEvents, this.triggerElement, this);\n this.eventsAttached = true;\n }\n }\n\n /**\n * Prevents the body from scrolling when the dialog is open.\n * Compensates for scrollbar width to prevent layout shift.\n */\n private preventScroll() {\n // Calculate scrollbar width\n const scrollBarWidth =\n window.innerWidth - document.documentElement.clientWidth;\n\n // Apply overflow hidden and padding compensation\n document.documentElement.style.overflow = 'hidden';\n document.documentElement.style.paddingRight = `${scrollBarWidth}px`;\n }\n\n /**\n * Allows the body to scroll when the dialog is closed.\n * Removes the applied overflow and padding styles.\n */\n private allowScroll() {\n // Remove the applied styles\n document.documentElement.style.removeProperty('overflow');\n document.documentElement.style.removeProperty('padding-right');\n }\n\n private ensureFormId(formElement: HTMLFormElement): string {\n if (!formElement.id) {\n formElement.id = `dialog-form-${uuidv4()}`;\n }\n return formElement.id;\n }\n\n /**\n * Checks for and sets up form ID if a form is present\n */\n private checkForForm = () => {\n if (!this.form) {\n const formElement = this.el.querySelector('form') as HTMLFormElement;\n if (formElement) {\n this.form = this.ensureFormId(formElement);\n }\n }\n };\n\n /**\n * Handles the native dialog close event.\n */\n private handleDialogClose = () => {\n if (this.open) {\n this.close();\n }\n };\n\n private handleClickOutside = (event: MouseEvent) => {\n if (event.target === this.dialogElement) {\n this.close();\n event.preventDefault();\n event.stopPropagation();\n }\n };\n\n //#endregion METHODS\n /****************************************************************************/\n //#region EVENTS\n\n /**\n * Emitted when the dialog is closing in order to allow for cleanup, data-capture, etc.\n * @bind open\n */\n @Event()\n openChanged: EventEmitter<boolean>;\n\n //#endregion EVENTS\n /****************************************************************************/\n //#region WATCHERS\n\n @Watch('open')\n async handleDialogOpenChange(isOpen: boolean) {\n if (isOpen) {\n this.show();\n this.openChanged.emit(isOpen);\n } else {\n this.close();\n this.openChanged.emit(isOpen);\n }\n }\n\n //#endregion WATCHERS\n /****************************************************************************/\n //#region LISTENERS\n\n /**\n * Handles the keydown event to optionally prevent the native dialog from closing when the escape key is pressed.\n * @param {KeyboardEvent} event - The keydown event.\n */\n @Listen('keydown', { target: 'document' })\n handleKeyDown(event: KeyboardEvent) {\n if (event.key !== 'Escape') return;\n\n if (this.undismissable) {\n event.preventDefault();\n event.stopPropagation();\n } else {\n this.close();\n }\n }\n\n /**\n * Handles the click event to close the dialog when clickOutside is true.\n * @param {MouseEvent} event - The click event.\n */\n @Listen('click', { target: 'document' })\n handleDocumentClick(event: MouseEvent) {\n if (!this.clickOutside || this.undismissable) return;\n this.handleClickOutside(event);\n }\n\n //#endregion LISTENERS\n /****************************************************************************/\n //#region LIFECYCLE\n\n /**\n * Lifecycle method that runs before the component loads.\n * Initializes the trigger, header, and footer elements by finding them in the component's children.\n * Elements are found either by their slot attribute or by their tag name (for dialog header/footer)\n */\n componentWillLoad() {\n this.triggerElement = Array.from(this.el.children).find(child => {\n return child.getAttribute('slot') === 'trigger';\n }) as HTMLElement;\n\n this.headerElement = Array.from(this.el.children).find(child => {\n return (\n child.getAttribute('slot') === 'header' ||\n child.tagName.toLowerCase() === 'nv-dialogheader'\n );\n }) as HTMLElement;\n\n this.footerElement = Array.from(this.el.children).find(child => {\n return (\n child.getAttribute('slot') === 'footer' ||\n child.tagName.toLowerCase() === 'nv-dialogfooter'\n );\n }) as HTMLElement;\n\n // Initial form check\n this.checkForForm();\n }\n\n componentWillUpdate() {\n this.attachEventListeners();\n }\n\n componentDidLoad() {\n if (this.open) {\n this.show();\n }\n // Only set autofocus if the prop is true and no element already has autofocus\n if (this.autofocus && !this.dialogElement.querySelector('[autofocus]')) {\n this.setAutofocus();\n }\n this.attachEventListeners();\n\n // Additional form check in case form was added after initial load\n this.checkForForm();\n }\n\n disconnectedCallback() {\n if (this.triggerElement && !this.eventsAttached && !this.controlled) {\n removeEventListeners(this.triggerClickEvents, this.triggerElement, this);\n this.eventsAttached = false;\n }\n this.allowScroll();\n }\n\n //#endregion LIFECYCLE\n /****************************************************************************/\n //#region RENDER\n\n render() {\n const hasForm = this.form || this.el.querySelector('form');\n\n return (\n <Host>\n <slot name=\"trigger\"></slot>\n\n <dialog\n ref={el => (this.dialogElement = el)}\n onClose={this.handleDialogClose}\n role=\"dialog\"\n aria-modal=\"true\"\n aria-labelledby=\"dialog-header\"\n aria-describedby=\"dialog-content\"\n class={clsx({ full: this.full })}\n >\n <div class=\"content\">\n {!this.undismissable && (\n <nv-button\n class=\"close-button\"\n emphasis=\"lower\"\n size=\"sm\"\n onClick={this.handleDialogClose}\n aria-label=\"Close dialog\"\n >\n <nv-icon name=\"x\" size=\"sm\" />\n </nv-button>\n )}\n\n {this.headerElement ? (\n <slot name=\"header\"></slot>\n ) : (\n <nv-dialogheader id=\"dialog-header\"></nv-dialogheader>\n )}\n\n <div class=\"content-body\" id=\"dialog-content\">\n <slot></slot>\n </div>\n\n {this.footerElement ? (\n <slot name=\"footer\"></slot>\n ) : (\n <nv-dialogfooter\n form={this.form}\n primaryButtonType={\n hasForm ? ButtonType.Submit : ButtonType.Button\n }\n onDialogCanceled={this.handleDialogClose}\n undismissable={this.undismissable}\n ></nv-dialogfooter>\n )}\n </div>\n </dialog>\n </Host>\n );\n }\n\n //#endregion RENDER\n}\n"]}
1
+ {"version":3,"file":"nv-dialog.js","sourceRoot":"","sources":["../../../src/components/nv-dialog/nv-dialog.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,EACT,IAAI,EACJ,IAAI,EACJ,CAAC,EACD,OAAO,EACP,MAAM,EACN,KAAK,EAEL,KAAK,EACL,MAAM,GACP,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AACpC,OAAO,EACL,iBAAiB,EACjB,oBAAoB,GAErB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC9D,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AACnD,OAAO,EAAE,EAAE,IAAI,MAAM,EAAE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DAAa,CACT;wBAEL,IAAI,CAAC,aAAa,CAAC,CAAC,CAAC,CACpB,YAAM,IAAI,EAAC,QAAQ,GAAQ,CAC5B,CAAC,CAAC,CAAC,CACF,uBACE,IAAI,EAAE,IAAI,CAAC,IAAI,EACf,iBAAiB,EACf,OAAO,CAAC,CAAC,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC,CAAC,UAAU,CAAC,MAAM,EAEjD,gBAAgB,EAAE,IAAI,CAAC,iBAAiB,EACxC,aAAa,EAAE,IAAI,CAAC,aAAa,GAChB,CACpB,CACG,CACF,CACC,CACJ,CACR,CAAC;IACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAGF","sourcesContent":["import {\n Component,\n Host,\n Prop,\n h,\n Element,\n Method,\n Event,\n EventEmitter,\n Watch,\n Listen,\n} from '@stencil/core';\nimport { tabbable } from 'tabbable';\nimport {\n addEventListeners,\n removeEventListeners,\n type EventsAndListeners,\n} from '../../utils/events.utils';\nimport { useGrow, useFade, parallel } from '../../animations';\nimport clsx from 'clsx';\nimport { ButtonType } from '../../utils/constants';\nimport { v4 as uuidv4 } from 'uuid';\n\n/**\n * @slot default - Body of the dialog.\n * @slot trigger - Content to be placed as the trigger, will override the trigger prop.\n * @slot header - Content to be placed as the header, will override the header prop.\n * @slot footer - Content to be placed as the footer, will override the footer prop.\n */\n@Component({\n tag: 'nv-dialog',\n styleUrl: 'nv-dialog.scss',\n shadow: false,\n})\nexport class NvDialog {\n @Element() el: HTMLNvDialogElement;\n private dialogElement!: HTMLDialogElement;\n private backdropElement!: HTMLDivElement;\n private contentElement!: HTMLDivElement;\n private eventsAttached = false;\n private form: string;\n\n private triggerClickEvents: EventsAndListeners = [\n ['click', this.show],\n [\n 'keydown',\n (e: KeyboardEvent) => {\n if (e.key === 'Enter' || e.key === ' ') {\n e.preventDefault();\n this.show();\n }\n },\n ],\n ];\n\n /****************************************************************************/\n //#region PROPERTIES\n\n /**\n * @internal\n * Accepts a reference to the DOM element acting as the popover trigger. This\n * should be used when the slot for the trigger is not defined.\n */\n @Prop({ reflect: false, mutable: true })\n triggerElement: Element;\n\n /**\n * @internal\n * Accepts a reference to the DOM element acting as the header. This should\n * be used when the slot for the header is not defined.\n */\n @Prop({ reflect: false, mutable: true })\n headerElement: Element;\n\n /**\n * @internal\n * Accepts a reference to the DOM element acting as the footer. This should\n * be used when the slot for the footer is not defined.\n */\n @Prop({ reflect: false, mutable: true })\n footerElement: Element;\n\n /**\n * Use this prop to toggle the visibility of the dialog. Set to true to show\n * the dialog and false to hide it.\n */\n @Prop({ reflect: true, mutable: true })\n open: boolean = false;\n\n /**\n * If true, the dialog cannot be closed by the user.\n */\n @Prop({ reflect: true })\n readonly undismissable: boolean = false;\n\n /**\n * If true, the dialog will be closed when the backdrop is clicked.\n */\n @Prop({ reflect: true })\n readonly clickOutside: boolean = false;\n\n /**\n * If true, the dialog visibility is managed manually through methods or the\n * open prop.\n */\n @Prop({ reflect: true })\n readonly controlled: boolean = false;\n\n /**\n * If true, the dialog takes full width styling.\n */\n @Prop({ reflect: true })\n readonly full: boolean = false;\n\n /**\n * Controls whether the dialog should automatically focus the first focusable\n * element when opened. When disabled, prevents unwanted tooltip triggers on\n * dialog open.\n */\n @Prop({ reflect: true })\n // eslint-disable-next-line @stencil-community/reserved-member-names\n readonly autofocus: boolean = false;\n\n //#endregion PROPERTIES\n /****************************************************************************/\n //#region METHODS\n\n /**\n * Call this method to show the dialog, making it visible on the screen.\n */\n @Method()\n public async show() {\n this.open = true;\n this.preventScroll();\n /** It is recommended to use the .show() or .showModal() method to render\n * dialogs, rather than the open attribute. If a <dialog> is opened using\n * the open attribute, it is non-modal. */\n const { setFadeOut } = useFade(this.dialogElement);\n setFadeOut();\n this.dialogElement.showModal();\n\n const { setGrowIn, growIn } = useGrow(this.contentElement, {\n duration: 100,\n amount: 0.9,\n });\n const { fadeIn } = useFade(this.dialogElement, {\n duration: 100,\n });\n\n setGrowIn();\n await parallel(fadeIn, growIn).start();\n }\n\n /**\n * Call this method to hide the dialog, making it disappear from view.\n */\n @Method()\n public async close() {\n this.open = false;\n this.allowScroll();\n const { growOut } = useGrow(this.contentElement, {\n duration: 150,\n amount: 0.85,\n });\n const { fadeOut } = useFade(this.dialogElement, {\n duration: 150,\n });\n await parallel(growOut, fadeOut).start();\n this.dialogElement.close();\n }\n\n /**\n * Sets the autofocus on the first focusable element in the dialog.\n */\n private setAutofocus() {\n const focusableElements = tabbable(this.dialogElement, {\n displayCheck: 'none',\n });\n\n if (focusableElements.length > 0) {\n // Convert to array and find element with smallest top and left position\n let topLeftElement = focusableElements[0];\n let topLeftRect = topLeftElement.getBoundingClientRect();\n\n focusableElements.forEach(element => {\n const rect = element.getBoundingClientRect();\n if (rect.top < topLeftRect.top || rect.left < topLeftRect.left) {\n topLeftElement = element;\n topLeftRect = rect;\n }\n });\n\n // Set autofocus attribute on the found element\n topLeftElement.setAttribute('autofocus', 'true');\n }\n }\n\n /**\n * Attaches event listeners to the dialog.\n */\n private attachEventListeners() {\n if (this.triggerElement && !this.eventsAttached && !this.controlled) {\n addEventListeners(this.triggerClickEvents, this.triggerElement, this);\n this.eventsAttached = true;\n }\n }\n\n /**\n * Prevents the body from scrolling when the dialog is open.\n * Compensates for scrollbar width to prevent layout shift.\n */\n private preventScroll() {\n // Calculate scrollbar width\n const scrollBarWidth =\n window.innerWidth - document.documentElement.clientWidth;\n\n // Apply overflow hidden and padding compensation\n document.documentElement.style.overflow = 'hidden';\n document.documentElement.style.paddingRight = `${scrollBarWidth}px`;\n }\n\n /**\n * Allows the body to scroll when the dialog is closed.\n * Removes the applied overflow and padding styles.\n */\n private allowScroll() {\n // Remove the applied styles\n document.documentElement.style.removeProperty('overflow');\n document.documentElement.style.removeProperty('padding-right');\n }\n\n private ensureFormId(formElement: HTMLFormElement): string {\n if (!formElement.id) {\n formElement.id = `dialog-form-${uuidv4()}`;\n }\n return formElement.id;\n }\n\n /**\n * Checks for and sets up form ID if a form is present\n */\n private checkForForm = () => {\n if (!this.form) {\n const formElement = this.el.querySelector('form') as HTMLFormElement;\n if (formElement) {\n this.form = this.ensureFormId(formElement);\n }\n }\n };\n\n /**\n * Handles the native dialog close event.\n */\n private handleDialogClose = () => {\n if (this.open) {\n this.close();\n }\n };\n\n //#endregion METHODS\n /****************************************************************************/\n //#region EVENTS\n\n /**\n * Emitted when the dialog is closing in order to allow for cleanup, data-capture, etc.\n * @bind open\n */\n @Event()\n openChanged: EventEmitter<boolean>;\n\n //#endregion EVENTS\n /****************************************************************************/\n //#region WATCHERS\n\n @Watch('open')\n async handleDialogOpenChange(isOpen: boolean) {\n if (isOpen) {\n this.show();\n this.openChanged.emit(isOpen);\n } else {\n this.close();\n this.openChanged.emit(isOpen);\n }\n }\n\n //#endregion WATCHERS\n /****************************************************************************/\n //#region LISTENERS\n\n /**\n * Handles the keydown event to optionally prevent the native dialog from closing when the escape key is pressed.\n * @param {KeyboardEvent} event - The keydown event.\n */\n @Listen('keydown', { target: 'document' })\n handleKeyDown(event: KeyboardEvent) {\n if (event.key !== 'Escape') return;\n if (!this.open) return;\n\n event.preventDefault();\n event.stopPropagation();\n const hasOpenPopover = this.checkForOpenPopovers();\n\n if (!this.undismissable && !hasOpenPopover) {\n event.preventDefault();\n event.stopPropagation();\n this.close();\n }\n }\n\n /**\n * Handles the click event to close the dialog when clickOutside is true.\n * @param {MouseEvent} event - The click event.\n */\n private handleDialogClick = (event: MouseEvent) => {\n if (!this.clickOutside || this.undismissable) return;\n if (this.checkForOpenPopovers()) return;\n\n if (event.target === this.backdropElement) {\n this.close();\n event.preventDefault();\n event.stopPropagation();\n }\n };\n\n private checkForOpenPopovers = (): boolean => {\n let hasOpenPopover = false;\n\n this.el.querySelectorAll('nv-popover').forEach(popover => {\n if (popover.hasAttribute('open')) {\n hasOpenPopover = true;\n }\n });\n\n return hasOpenPopover;\n };\n\n //#endregion LISTENERS\n /****************************************************************************/\n //#region LIFECYCLE\n\n /**\n * Lifecycle method that runs before the component loads.\n * Initializes the trigger, header, and footer elements by finding them in the component's children.\n * Elements are found either by their slot attribute or by their tag name (for dialog header/footer)\n */\n componentWillLoad() {\n this.triggerElement = Array.from(this.el.children).find(child => {\n return child.getAttribute('slot') === 'trigger';\n }) as HTMLElement;\n\n this.headerElement = Array.from(this.el.children).find(child => {\n return (\n child.getAttribute('slot') === 'header' ||\n child.tagName.toLowerCase() === 'nv-dialogheader'\n );\n }) as HTMLElement;\n\n this.footerElement = Array.from(this.el.children).find(child => {\n return (\n child.getAttribute('slot') === 'footer' ||\n child.tagName.toLowerCase() === 'nv-dialogfooter'\n );\n }) as HTMLElement;\n\n // Initial form check\n this.checkForForm();\n }\n\n componentWillUpdate() {\n this.attachEventListeners();\n }\n\n componentDidLoad() {\n if (this.open) {\n this.show();\n }\n // Only set autofocus if the prop is true and no element already has autofocus\n if (this.autofocus && !this.dialogElement.querySelector('[autofocus]')) {\n this.setAutofocus();\n }\n this.attachEventListeners();\n\n // Additional form check in case form was added after initial load\n this.checkForForm();\n\n // this.setupContentBodyListeners();\n }\n\n disconnectedCallback() {\n if (this.triggerElement && !this.eventsAttached && !this.controlled) {\n removeEventListeners(this.triggerClickEvents, this.triggerElement, this);\n this.eventsAttached = false;\n }\n this.allowScroll();\n }\n\n //#endregion LIFECYCLE\n /****************************************************************************/\n //#region RENDER\n\n render() {\n const hasForm = this.form || this.el.querySelector('form');\n\n return (\n <Host>\n <slot name=\"trigger\"></slot>\n\n <dialog\n ref={el => (this.dialogElement = el)}\n onClose={this.handleDialogClose}\n onClick={this.handleDialogClick}\n role=\"dialog\"\n aria-modal=\"true\"\n aria-labelledby=\"dialog-header\"\n aria-describedby=\"dialog-content\"\n class={clsx({ full: this.full })}\n >\n <div class=\"backdrop\" ref={el => (this.backdropElement = el)}>\n <div class=\"content\" ref={el => (this.contentElement = el)}>\n {!this.undismissable && (\n <nv-button\n class=\"close-button\"\n emphasis=\"lower\"\n size=\"sm\"\n onClick={this.handleDialogClose}\n aria-label=\"Close dialog\"\n >\n <nv-icon name=\"x\" size=\"sm\" />\n </nv-button>\n )}\n\n {this.headerElement ? (\n <slot name=\"header\"></slot>\n ) : (\n <nv-dialogheader id=\"dialog-header\"></nv-dialogheader>\n )}\n\n <div class=\"content-body\" id=\"dialog-content\">\n <slot></slot>\n </div>\n\n {this.footerElement ? (\n <slot name=\"footer\"></slot>\n ) : (\n <nv-dialogfooter\n form={this.form}\n primaryButtonType={\n hasForm ? ButtonType.Submit : ButtonType.Button\n }\n onDialogCanceled={this.handleDialogClose}\n undismissable={this.undismissable}\n ></nv-dialogfooter>\n )}\n </div>\n </div>\n </dialog>\n </Host>\n );\n }\n\n //#endregion RENDER\n}\n"]}
@@ -78,7 +78,7 @@ export class NvDialogfooter {
78
78
  /****************************************************************************/
79
79
  //#region RENDER
80
80
  render() {
81
- return (h(Host, { key: '0868c3af73f89219eee7c006b4ddca47c6da29b0' }, !this.hasSlot ? (h(Fragment, null, !this.undismissable && (h("nv-button", { onClick: this.handleCancel, emphasis: "low", size: "sm" }, this.cancelLabel)), h("nv-button", { onClick: this.handlePrimary, disabled: this.disabled, danger: this.danger, size: "sm", emphasis: "high", form: this.form, type: this.primaryButtonType }, this.leadingIcon && (h("nv-icon", { slot: "leading-icon", name: this.leadingIcon, size: "sm" })), this.primaryLabel, this.trailingIcon && (h("nv-icon", { slot: "trailing-icon", name: this.trailingIcon, size: "sm" }))))) : (h("slot", null))));
81
+ return (h(Host, { key: '908abbe8e2e9aa215641dd056c70dc16f36c3ac3' }, !this.hasSlot ? (h(Fragment, null, !this.undismissable && (h("nv-button", { onClick: this.handleCancel, emphasis: "low", size: "sm" }, this.cancelLabel)), h("nv-button", { onClick: this.handlePrimary, disabled: this.disabled, danger: this.danger, size: "sm", emphasis: "high", form: this.form, type: this.primaryButtonType }, this.leadingIcon && (h("nv-icon", { slot: "leading-icon", name: this.leadingIcon, size: "sm" })), this.primaryLabel, this.trailingIcon && (h("nv-icon", { slot: "trailing-icon", name: this.trailingIcon, size: "sm" }))))) : (h("slot", null))));
82
82
  }
83
83
  static get is() { return "nv-dialogfooter"; }
84
84
  static get formAssociated() { return true; }
@@ -26,7 +26,7 @@ export class NvDialogheader {
26
26
  /****************************************************************************/
27
27
  //#region RENDER
28
28
  render() {
29
- return (h(Host, { key: 'f91a9aea8aa7116266f52bb356ef2ec493df6354' }, !this.hasSlot ? (h(Fragment, null, h("div", { class: "heading" }, this.heading), h("div", { class: "subheading" }, this.subheading))) : (h("slot", null))));
29
+ return (h(Host, { key: 'e3390a18cd40f00dd70f71b436d3603fdcb2b337' }, !this.hasSlot ? (h(Fragment, null, h("div", { class: "heading" }, this.heading), h("div", { class: "subheading" }, this.subheading))) : (h("slot", null))));
30
30
  }
31
31
  static get is() { return "nv-dialogheader"; }
32
32
  static get originalStyleUrls() {
@@ -118,13 +118,13 @@ export class NvFieldcheckbox {
118
118
  /****************************************************************************/
119
119
  //#region RENDER
120
120
  render() {
121
- return (h(Host, { key: '62195333f84808381f19ca4017916380d20d493f', class: clsx(this.labelPlacement === 'before' && 'label-placement-before', this.error && 'error') }, h("div", { key: '65f02aee06eacecf83c5297d87130bbe9f85b19c', class: "input-container" }, h("input", { key: 'c3e8fcb41c835f0eba254f9e77de749b7dc6349e', type: "checkbox", id: this.inputId, name: this.name, autofocus: this.autofocus, autocomplete: "off", value: this.value, checked: Boolean(this.checked), disabled: this.disabled || this.readonly, readonly: this.readonly && !this.required, required: this.required, indeterminate: this.indeterminate, ref: el => {
121
+ return (h(Host, { key: '4db161f34d188b5370f28a39ec9637d269719b04', class: clsx(this.labelPlacement === 'before' && 'label-placement-before', this.error && 'error') }, h("div", { key: '7608f50840faf35c4da8dbfcc8240becece6f609', class: "input-container" }, h("input", { key: '733ad01f2cadd1e17d6bfc40022ef9ab1db93f0a', type: "checkbox", id: this.inputId, name: this.name, autofocus: this.autofocus, autocomplete: "off", value: this.value, checked: Boolean(this.checked), disabled: this.disabled || this.readonly, readonly: this.readonly && !this.required, required: this.required, indeterminate: this.indeterminate, ref: el => {
122
122
  if (el) {
123
123
  el.indeterminate = this.indeterminate;
124
124
  }
125
- } }), h("span", { key: '439a8c467373d734293012514cdb22c419b534ae', class: "icon" }, this.checked && !this.indeterminate && (h("slot", { key: '335a92ed1431fe96af3c7c6fac2f4245c0d4caaa', name: "checked-icon" }, h("svg", { key: '67d97efca27a97c7db77d9f8c182a21fbd21d13c', xmlns: "http://www.w3.org/2000/svg", width: "14", height: "14", viewBox: "0 0 14 14", fill: "none" }, h("path", { key: '9cb6730b00813e8d4fe6fa14549de6f2a41ea068', d: "M11.6667 3.5L5.25004 9.91667L2.33337 7", "stroke-linecap": "round", "stroke-linejoin": "round" })))), this.indeterminate && (h("slot", { key: 'e47b17269156f72ddaf7af1ecc818ae5b6b8c0d3', name: "indeterminate-icon" }, h("svg", { key: '4748acc27a70e74f9228cdb6e41eae4b1ae82559', class: "indeterminate-svg", xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 14 14", fill: "none" }, h("path", { key: '40748b36b277c1ed6ea8fc8f82f4cd687b2f6e3a', d: "M2.9165 7H11.0832", "stroke-linecap": "round", "stroke-linejoin": "round" })))))), h("slot", { key: '0fa9e559cefb8169c20b171fcbb6c1786fd6b3ae' }), h("div", { key: '44eef633025d1a7606979d4d8374c2a04081f45c', class: "text-container" }, h("slot", { key: 'b43251a02b15431f5399c3bced485b89741e069e', name: "main" }, (this.label || this.el.querySelector('[slot="label"]')) && (h("label", { key: '7781451a357961ce1606b18c590baa344df4ff95', htmlFor: this.inputId, class: clsx(this.hideLabel && 'visually-hidden') }, h("slot", { key: 'b420ad1dbdc05a5c57d0b45e62176866ec0527ca', name: "label" }, this.label))), (this.description ||
126
- this.el.querySelector('[slot="description"]')) && (h("div", { key: '67715bef879e0778b58648b83135edefdbdba53d', class: "description" }, h("slot", { key: 'b1d4d21e83130e19e94efa915abd6661c027bbce', name: "description" }, this.description)))), (this.errorDescription ||
127
- this.el.querySelector('[slot="error-description"]')) && (h("div", { key: '157df3faf2cadb4014ba8475c99cf68d86da9f63', hidden: !this.error, class: "error-description" }, h("slot", { key: '42aa95b2332618120d846fa481a1b30b7edeccca', name: "error-description" }, this.errorDescription))))));
125
+ } }), h("span", { key: '81da5960abee0aa2c74f10612d05388e427b3a1a', class: "icon" }, this.checked && !this.indeterminate && (h("slot", { key: 'e257ebad9a1c23bc77961645dabe6e0fc8c51440', name: "checked-icon" }, h("svg", { key: 'd4005dfd634169aa14140c7eba1e0ac63e28342d', xmlns: "http://www.w3.org/2000/svg", width: "14", height: "14", viewBox: "0 0 14 14", fill: "none" }, h("path", { key: '1817c25edf09f09d4317d9e41b52484883c7a943', d: "M11.6667 3.5L5.25004 9.91667L2.33337 7", "stroke-linecap": "round", "stroke-linejoin": "round" })))), this.indeterminate && (h("slot", { key: '043148db3518e99f2850ffa4b3622f7ae3c654a7', name: "indeterminate-icon" }, h("svg", { key: 'b8a67cfa8d0f880657b62b89ddae7a238b22bc26', class: "indeterminate-svg", xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 14 14", fill: "none" }, h("path", { key: 'd63f610ff5cca552d295de18dffeda84cbd370ac', d: "M2.9165 7H11.0832", "stroke-linecap": "round", "stroke-linejoin": "round" })))))), h("slot", { key: 'e4befe30753cd2f76da4af10e648704068f7ce55' }), h("div", { key: '281b4046dbeb8b8dcb05fc154b65ed822fa45960', class: "text-container" }, h("slot", { key: '8e40b1e52c55fa45b38bec26e6b20da90c8553ed', name: "main" }, (this.label || this.el.querySelector('[slot="label"]')) && (h("label", { key: 'ad2e4a47d1d5a218835b410579e7e93febd08d15', htmlFor: this.inputId, class: clsx(this.hideLabel && 'visually-hidden') }, h("slot", { key: '815d03f2c69465e430178c29a885ad770e2c561f', name: "label" }, this.label))), (this.description ||
126
+ this.el.querySelector('[slot="description"]')) && (h("div", { key: '22159e2cb8c4897507da91ebee09502922093ead', class: "description" }, h("slot", { key: '61b277015ecb4e0e3b813e45dbb6cd7ebe89506b', name: "description" }, this.description)))), (this.errorDescription ||
127
+ this.el.querySelector('[slot="error-description"]')) && (h("div", { key: '924d333e443c943b5fe37f31e3191d231b9d87e1', hidden: !this.error, class: "error-description" }, h("slot", { key: '2469d3f6cf2121b489b637138642417d27556740', name: "error-description" }, this.errorDescription))))));
128
128
  }
129
129
  static get is() { return "nv-fieldcheckbox"; }
130
130
  static get formAssociated() { return true; }
@@ -106,17 +106,17 @@ export class NvFielddate {
106
106
  * @param {MouseEvent} event - The click event.
107
107
  */
108
108
  this.handleClickOutside = (event) => {
109
- if (this.open && this.el && !this.el.contains(event.target)) {
109
+ var _a;
110
+ if (!(event.target instanceof Node))
111
+ return;
112
+ if (!((_a = this.el) === null || _a === void 0 ? void 0 : _a.contains(event.target)))
110
113
  this.open = false;
111
- }
112
114
  };
113
115
  /**
114
116
  * Focuses the input when the input container is clicked.
115
117
  * @param {MouseEvent} event - The click event.
116
118
  */
117
119
  this.handleInputContainerClick = (event) => {
118
- // Stop propagation to prevent closing parent dialogs
119
- event.stopPropagation();
120
120
  if (this.readonly || this.disabled) {
121
121
  event.preventDefault();
122
122
  return;
@@ -179,12 +179,10 @@ export class NvFielddate {
179
179
  * Toggles the opening/closing of the popover.
180
180
  * @param {MouseEvent} event - The click event.
181
181
  */
182
- this.toggleCalendar = (event) => {
182
+ this.toggleCalendar = () => {
183
183
  if (this.readonly || this.disabled) {
184
184
  return;
185
185
  }
186
- // Stop propagation to prevent closing parent dialogs
187
- event.stopPropagation();
188
186
  this.open = !this.open;
189
187
  };
190
188
  }
@@ -261,9 +259,6 @@ export class NvFielddate {
261
259
  //#endregion METHODS
262
260
  /****************************************************************************/
263
261
  //#region LIFECYCLE
264
- connectedCallback() {
265
- document.addEventListener('click', this.handleClickOutside);
266
- }
267
262
  componentWillLoad() {
268
263
  if (this.value) {
269
264
  this.singleValue = this.value;
@@ -290,7 +285,6 @@ export class NvFielddate {
290
285
  }
291
286
  }
292
287
  disconnectedCallback() {
293
- document.removeEventListener('click', this.handleClickOutside);
294
288
  if (this.inputElement &&
295
289
  this.inputElement.inputmask) {
296
290
  this.inputElement.inputmask.remove();
@@ -345,6 +339,9 @@ export class NvFielddate {
345
339
  handleClosePopover() {
346
340
  this.open = false;
347
341
  }
342
+ handleDocumentClick(event) {
343
+ this.handleClickOutside(event);
344
+ }
348
345
  handleKeyDown(event) {
349
346
  if (event.key === 'Escape') {
350
347
  this.open = false;
@@ -368,13 +365,13 @@ export class NvFielddate {
368
365
  /****************************************************************************/
369
366
  //#region RENDER
370
367
  render() {
371
- return (h(Host, { key: '0ec615c05a7f830586f21a6e26a62cbbec4902b0' }, ((this.label && this.label.length > 0) ||
372
- this.el.querySelector('[slot="label"]')) && (h("label", { key: '1b1814a4ab2ccef80d2ee641d2624397f6b953d1', htmlFor: this.inputId }, h("slot", { key: '853d2f3ef6561dd05ccd438c717a866a62f4791a', name: "label" }, this.label))), h("nv-popover", { key: '3259f86dbb8051a9ca10fe3a63b5716dc24b356e', ref: this.setPopoverRef, id: this.popoverId, triggerMode: "controlled", placement: "bottom-start", strategy: "fixed", open: this.open }, h("div", { key: 'd6f40610224724396ce6a1b5857f6baa6b308172', slot: "trigger", class: "input-wrapper" }, h("slot", { key: '9736e07f75aff0c74d23198648f6266854c4f523', name: "before-input" }), h("div", { key: 'c7019e5f0c7a88458f3dc1759b4d7d1d5f098dc9', class: "input-container", onClick: this.handleInputContainerClick }, h("slot", { key: '1c8fcc1f3cb6dfe5016f09780b5c4085eb53bf9b', name: "leading-input" }), h("input", { key: 'b1482ebabf4753dacb434774df3247c0ea9b885b', id: this.inputId, ref: this.setInputRef, placeholder: this.placeholder ||
373
- this.convertToInputmaskFormat(this.dateFormat), name: this.name, disabled: this.disabled, readOnly: this.readonly, required: this.required, autofocus: this.autofocus, onInput: this.handleInput, onFocus: this.handleFocus, "data-scope": "date" }), this.error && (h("nv-icon", { key: '7a9448bd1aef0dcf95183651b07621cebdeec467', name: "alert-circle", class: "validation", size: "md" })), this.success && (h("nv-icon", { key: 'c7329b1feaca5f1bcdaae5e8398a6357bb228333', name: "circle-check", class: "validation", size: "md" })), h("nv-iconbutton", { key: 'd26593800bc0f65438906c576adbefabc841081a', class: "toggle-calendar-icon", name: "calendar" //{this.open ? 'chevron-top' : 'chevron-down'}
368
+ return (h(Host, { key: 'c8b62c90ddfde96e12cb63aafba29d5b507286c6' }, ((this.label && this.label.length > 0) ||
369
+ this.el.querySelector('[slot="label"]')) && (h("label", { key: '761e06fd5d55b23946a87b86403105be049bbb4b', htmlFor: this.inputId }, h("slot", { key: '73676bbc15ddc90172e0d1a6da0c84bb21e433a1', name: "label" }, this.label))), h("nv-popover", { key: 'dddd5f5619c6696b1a7b9991c94fba01e3710199', ref: this.setPopoverRef, id: this.popoverId, triggerMode: "controlled", placement: "bottom-start", open: this.open }, h("div", { key: '28bcfe3c9a50b81b1c2565b1dbab0479cf0927c0', slot: "trigger", class: "input-wrapper" }, h("slot", { key: '9ff4bfecd08b05c3425baa16f56da95584a33977', name: "before-input" }), h("div", { key: '8cfb31352d12b45d4450fabeb84328bfb9644ee4', class: "input-container", onClick: this.handleInputContainerClick }, h("slot", { key: 'ac99e0f250644eef55a24979f92890b04c03179e', name: "leading-input" }), h("input", { key: 'dd490963055df6295d6a04eda58d44857d827255', id: this.inputId, ref: this.setInputRef, placeholder: this.placeholder ||
370
+ this.convertToInputmaskFormat(this.dateFormat), name: this.name, disabled: this.disabled, readOnly: this.readonly, required: this.required, autofocus: this.autofocus, onInput: this.handleInput, onFocus: this.handleFocus, "data-scope": "date" }), this.error && (h("nv-icon", { key: '16b6825561152e5157aca753082c7229d15e2c46', name: "alert-circle", class: "validation", size: "md" })), this.success && (h("nv-icon", { key: '4780677cf8da9866d2fa4d40557b564b8920b065', name: "circle-check", class: "validation", size: "md" })), h("nv-iconbutton", { key: 'c6bd82b770b28f35b6716abc8cba5a28aa13dd56', class: "toggle-calendar-icon", name: "calendar" //{this.open ? 'chevron-top' : 'chevron-down'}
374
371
  ,
375
- size: "md", emphasis: "lower", "aria-label": this.open ? 'Hide calendar' : 'Show calendar', onClick: this.toggleCalendar, tabIndex: this.disabled ? -1 : 0 })), h("slot", { key: '7308a0126263ca8f0182bfbbc5305d0392fe6187', name: "after-input" })), h("div", { key: '25f181caaa5fa66d0245de5d050f41f603bae804', slot: "content" }, h("nv-calendar", { key: '0ade256f483d9c7d3c7a3af47790646510a59c2e', dateFormat: this.dateFormat, singleValue: this.singleValue, 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, onValueChanged: this.handleCalendarValueChanged }))), ((this.description && this.description.length > 0) ||
376
- this.el.querySelector('[slot="description"]')) && (h("div", { key: 'a6b011fb140ed508a9681e9dd0635261db705c7c', class: "description" }, h("slot", { key: 'dfffc39d6fd525a359ff72f1ccf263f1f2a57274', name: "description" }, this.description))), (this.errorDescription ||
377
- this.el.querySelector('[slot="error-description"]')) && (h("div", { key: 'd421e5bf8f9839ce636007864fddfb24bac43631', hidden: !this.error, class: "error-description" }, this.el.querySelector('[slot="error-description"]') ? (h("slot", { name: "error-description" })) : (this.errorDescription))), h("slot", { key: 'b8e8b003f1fca9a499ab276bf8717f018d33fbb5' })));
372
+ size: "md", emphasis: "lower", "aria-label": this.open ? 'Hide calendar' : 'Show calendar', onClick: this.toggleCalendar, tabIndex: this.disabled ? -1 : 0 })), h("slot", { key: '85ed704fa118dc5087af5ce8e791e91a3c210093', name: "after-input" })), h("div", { key: 'ad9eaa9cedb72c56d8d5b201904259798a790aa4', slot: "content" }, h("nv-calendar", { key: '79abc83113d0a14bdfcb19e693b6f5d94adaa071', dateFormat: this.dateFormat, singleValue: this.singleValue, 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, onValueChanged: this.handleCalendarValueChanged }))), ((this.description && this.description.length > 0) ||
373
+ this.el.querySelector('[slot="description"]')) && (h("div", { key: '8d3620b3ddb001c5ed1ba0557310a7bf4af4c5e0', class: "description" }, h("slot", { key: 'b80b706332d733476feec054737f35a4f008a078', name: "description" }, this.description))), (this.errorDescription ||
374
+ this.el.querySelector('[slot="error-description"]')) && (h("div", { key: '976a1e236e6391ef7e8aeac0b56c1fd815bb9640', hidden: !this.error, class: "error-description" }, this.el.querySelector('[slot="error-description"]') ? (h("slot", { name: "error-description" })) : (this.errorDescription))), h("slot", { key: 'eb645c44cde2c175892ed31326d71897e3a5062c' })));
378
375
  }
379
376
  static get is() { return "nv-fielddate"; }
380
377
  static get originalStyleUrls() {
@@ -994,6 +991,12 @@ export class NvFielddate {
994
991
  "target": undefined,
995
992
  "capture": false,
996
993
  "passive": false
994
+ }, {
995
+ "name": "click",
996
+ "method": "handleDocumentClick",
997
+ "target": "document",
998
+ "capture": false,
999
+ "passive": false
997
1000
  }, {
998
1001
  "name": "keydown",
999
1002
  "method": "handleKeyDown",
@@ -1 +1 @@
1
- {"version":3,"file":"nv-fielddate.js","sourceRoot":"","sources":["../../../src/components/nv-fielddate/nv-fielddate.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,EACT,CAAC,EACD,IAAI,EACJ,KAAK,EACL,OAAO,EACP,KAAK,EAEL,MAAM,EACN,IAAI,EACJ,KAAK,EACL,MAAM,GACP,MAAM,eAAe,CAAC;AACvB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AE,CAAC,aAAa,CAAC,4BAA4B,CAAC,CAAC,CAAC,CAAC,CACrD,YAAM,IAAI,EAAC,mBAAmB,GAAQ,CACvC,CAAC,CAAC,CAAC,CACF,IAAI,CAAC,gBAAgB,CACtB,CACG,CACP;YAED,8DAAa,CACR,CACR,CAAC;IACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAGF","sourcesContent":["import {\n Component,\n h,\n Prop,\n State,\n Element,\n Event,\n EventEmitter,\n Listen,\n Host,\n Watch,\n Method,\n} from '@stencil/core';\nimport Inputmask from 'inputmask';\nimport { v4 as uuidv4 } from 'uuid';\n\n/**\n * Extends HTMLInputElement to include the inputmask property.\n */\ninterface HTMLInputElementWithInputmask extends HTMLInputElement {\n /**\n * The inputmask instance that provides masking functionality.\n */\n inputmask?: {\n /**\n * Removes the inputmask instance.\n */\n remove?: () => void;\n };\n}\n\n/**\n * A field date component that combines an input with a calendar popover.\n *\n * @slot default - Child content of the component.\n * @slot leading-input - Content to be placed before the input text, within the input container.\n * @slot before-input - Content to be placed before the input text, outside the input container.\n * @slot after-input - Content to be placed after the input text, outside the input container.\n * @slot label - Content to be placed as the label, will override the label prop.\n * @slot description - Content to be placed as the description, will override the description prop.\n * @slot error-description - Content to be placed as the error description, will override the errorDescription prop.\n */\n@Component({\n tag: 'nv-fielddate',\n styleUrl: 'styles/nv-fielddate.scss',\n shadow: false,\n})\nexport class NvFielddate {\n @Element() el: HTMLNvFielddateElement;\n private inputElement!: HTMLInputElement;\n\n private popoverElement!: HTMLNvPopoverElement;\n private popoverId: string = uuidv4();\n\n /****************************************************************************/\n //#region PROPERTIES\n\n /**\n * Sets the ID for the input element and the for attribute of the associated\n * label. If no ID is provided, a random one will be automatically generated.\n */\n @Prop({ reflect: true })\n readonly inputId: string = uuidv4();\n\n /**\n * Text displayed as label. A slot label can override this prop.\n */\n @Prop({ reflect: true })\n readonly label: string;\n\n /**\n * Description displayed below the input. A slot description can override this prop.\n */\n @Prop({ reflect: true })\n readonly description: string;\n\n /**\n * Placeholder for the input field.\n */\n @Prop({ reflect: true })\n readonly placeholder: string;\n\n /**\n * Name attribute for the input.\n */\n @Prop({ reflect: true })\n readonly name: string;\n\n /**\n * Disables the input field.\n */\n @Prop({ reflect: true })\n readonly disabled: boolean = false;\n\n /**\n * Sets the input field as read-only.\n */\n @Prop({ reflect: true })\n readonly readonly: boolean = false;\n\n /**\n * Marks the input field as required.\n */\n @Prop({ reflect: true })\n readonly required: boolean = false;\n\n /**\n * Indicates an error state.\n */\n @Prop({ reflect: true })\n readonly error: boolean = false;\n\n /**\n * Error description. A slot error-description can override this prop.\n */\n @Prop({ reflect: true })\n readonly errorDescription?: string;\n\n /**\n * Indicates a success state.\n */\n @Prop({ reflect: true })\n readonly success: boolean = false;\n\n /**\n * Autofocus the input when the component is mounted.\n */\n @Prop({ reflect: true })\n // eslint-disable-next-line @stencil-community/reserved-member-names\n readonly autofocus: boolean = false;\n\n /**\n * The initial value of the input (date in string format).\n * @bind value\n */\n @Prop({ reflect: true, mutable: true })\n value: string = '';\n\n /**\n * The current value of the input date in string format.\n */\n @State()\n singleValue: string = '';\n\n /**\n * Controls the opening of the popover.\n */\n @State()\n open: boolean = false;\n\n /**\n * First day of the week 0 = Sunday, 1 = Monday, etc.\n * @default 1\n */\n @Prop({ reflect: true })\n readonly firstDayOfWeek: number = 1;\n\n /**\n * Number of calendars to display\n * @default 1\n */\n @Prop({ reflect: true })\n readonly numberOfCalendars: number = 1;\n\n /**\n * Minimum date for selection ISO string format, ex: 2025-01-01\n */\n @Prop({ reflect: true })\n readonly min?: string = '';\n\n /**\n * Maximum date for selection ISO string format, ex: 2025-12-31\n */\n @Prop({ reflect: true })\n readonly max?: string = '';\n\n /** Locale for date formatting\n * @default 'en-BE'\n */\n @Prop({ reflect: true })\n readonly locale: string = 'en-BE';\n\n /** Date format ex: YYYY-MM-DD, DD-MM-YYYY, etc.\n * @default 'YYYY-MM-DD'\n * @note If the date format is in UTC mode, the date will be displayed in UTC time.\n * @note If the date format is not in UTC mode, the date will be displayed in the local time.\n */\n @Prop({ reflect: true })\n readonly dateFormat: string = 'YYYY-MM-DD';\n\n /**\n * Footer placement\n * @default 'bottom'\n */\n @Prop({ reflect: true })\n readonly shortcutsPlacement: 'bottom' | 'left' | 'right' = 'bottom';\n\n /**\n * Show action buttons\n * @default false\n */\n @Prop({ reflect: true })\n readonly showActions: boolean = false;\n\n /**\n * Custom actions to display in the footer\n */\n @Prop({ reflect: true })\n readonly shortcuts: HTMLNvCalendarElement['shortcuts'];\n\n /**\n * Show week numbers\n * @default true\n */\n @Prop({ reflect: true })\n readonly showWeekNumbers: boolean;\n\n /**\n * Disabled dates ISO string array\n */\n @Prop({ reflect: true })\n readonly disabledDates: Array<string>;\n\n /**\n * Allows the field to stretch and fill the entire width of its container.\n */\n @Prop({ reflect: true })\n readonly fluid: boolean = false;\n\n //#endregion PROPERTIES\n /****************************************************************************/\n //#region METHODS\n\n /**\n * Converts the nv-calendar date format to the format expected by Inputmask.\n * @param {string} format - The date format.\n * @returns {string} Format adapted for Inputmask.\n */\n private convertToInputmaskFormat(format: string): string {\n // If the format is not specified, use the default format\n if (!format) {\n return 'dd/mm/yyyy';\n }\n\n const formatMap = {\n 'DD/MM/YYYY': 'dd/mm/yyyy',\n 'MM/DD/YYYY': 'mm/dd/yyyy',\n 'YYYY-MM-DD': 'yyyy-mm-dd',\n 'DD.MM.YYYY': 'dd.mm.yyyy',\n 'YYYYMMDD': 'yyyymmdd',\n };\n\n return formatMap[format] || 'dd/mm/yyyy';\n }\n\n /**\n * Closes the popover when a click is detected outside the component.\n * @param {MouseEvent} event - The click event.\n */\n private handleClickOutside = (event: MouseEvent) => {\n if (this.open && this.el && !this.el.contains(event.target as Node)) {\n this.open = false;\n }\n };\n\n /**\n * Focuses the input when the input container is clicked.\n * @param {MouseEvent} event - The click event.\n */\n private handleInputContainerClick = (event: MouseEvent) => {\n // Stop propagation to prevent closing parent dialogs\n event.stopPropagation();\n\n if (this.readonly || this.disabled) {\n event.preventDefault();\n return;\n }\n this.inputElement.focus();\n };\n\n /**\n * Handles the input event on the input element.\n * Updates internal state to keep UI in sync - events are only emitted on completion or clear.\n * @param {Event} event - The input event.\n */\n private handleInput = (event: Event) => {\n if (this.readonly || this.disabled) {\n event.preventDefault();\n return;\n }\n const input = event.target as HTMLInputElement;\n\n // Always update singleValue to keep state in sync\n this.singleValue = input.value;\n\n // Only emit event when input is cleared\n if (input.value === '') {\n this.value = '';\n this.valueChanged.emit('');\n }\n };\n\n /**\n * Handles focus events on the input element.\n * @param {FocusEvent} event - The focus event.\n */\n private handleFocus = (event: FocusEvent) => {\n if (this.readonly || this.disabled) {\n event.preventDefault();\n (event.target as HTMLElement).blur();\n return;\n }\n\n this.open = true;\n };\n\n /**\n * Prevents the valueChanged event from the calendar from propagating up.\n * @param {CustomEvent} event - The valueChanged event from nv-calendar.\n */\n private handleCalendarValueChanged = (event: CustomEvent) => {\n event.stopPropagation();\n };\n\n /**\n * Sets the reference to the popover element.\n * @param {HTMLNvPopoverElement} el - The popover element.\n */\n private setPopoverRef = (el: HTMLNvPopoverElement) => {\n this.popoverElement = el;\n };\n\n /**\n * Sets the reference to the input element.\n * @param {HTMLInputElement} el - The input element.\n */\n private setInputRef = (el: HTMLInputElement) => {\n this.inputElement = el;\n };\n\n /**\n * Toggles the opening/closing of the popover.\n * @param {MouseEvent} event - The click event.\n */\n private toggleCalendar = (event: MouseEvent) => {\n if (this.readonly || this.disabled) {\n return;\n }\n // Stop propagation to prevent closing parent dialogs\n event.stopPropagation();\n this.open = !this.open;\n };\n\n /**\n * Clears the current selection and resets the field to its initial state.\n * This method can be called programmatically to reset the field.\n */\n @Method()\n async clear(): Promise<void> {\n // Reset internal state\n this.singleValue = '';\n this.value = '';\n\n // Reset the input element value\n if (this.inputElement) {\n this.inputElement.value = '';\n // Remove the input mask and reinitialize if needed\n if ((this.inputElement as HTMLInputElementWithInputmask).inputmask) {\n (this.inputElement as HTMLInputElementWithInputmask).inputmask.remove();\n }\n }\n\n // Emit events to notify about the change\n this.valueChanged.emit('');\n\n // Close the popover if open\n this.open = false;\n }\n\n private updateMask() {\n if (!this.inputElement) return;\n (this.inputElement as HTMLInputElementWithInputmask).inputmask?.remove?.();\n\n const inputMask = new Inputmask({\n alias: 'datetime',\n inputFormat: this.convertToInputmaskFormat(this.dateFormat),\n placeholder: this.convertToInputmaskFormat(this.dateFormat),\n clearIncomplete: false,\n showMaskOnHover: false,\n showMaskOnFocus: true,\n clearMaskOnLostFocus: !this.open,\n postValidation: true,\n oncomplete: (e: CustomEvent) => {\n const newValue = (e.target as HTMLInputElement)?.value;\n // Only emit if the value actually changed\n if (this.value !== newValue) {\n this.singleValue = newValue;\n this.value = newValue;\n this.valueChanged.emit(newValue);\n }\n },\n });\n inputMask.mask(this.inputElement);\n }\n\n //#endregion METHODS\n /****************************************************************************/\n //#region LIFECYCLE\n\n connectedCallback() {\n document.addEventListener('click', this.handleClickOutside);\n }\n\n componentWillLoad() {\n if (this.value) {\n this.singleValue = this.value;\n }\n }\n\n componentDidLoad() {\n this.updateMask();\n\n // Set the initial value after applying the mask\n if (this.inputElement.name === this.name && this.singleValue) {\n requestAnimationFrame(() => {\n this.inputElement.value = this.singleValue;\n const event = new CustomEvent('input', { bubbles: true });\n this.inputElement.dispatchEvent(event);\n });\n }\n }\n\n componentDidRender() {\n // Only set value on initial render when there's no existing value in the input\n if (this.singleValue && this.inputElement && !this.inputElement.value) {\n requestAnimationFrame(() => {\n this.inputElement.value = this.singleValue;\n this.inputElement.setAttribute('value', this.singleValue);\n });\n }\n }\n\n disconnectedCallback() {\n document.removeEventListener('click', this.handleClickOutside);\n if (\n this.inputElement &&\n (this.inputElement as HTMLInputElementWithInputmask).inputmask\n ) {\n (this.inputElement as HTMLInputElementWithInputmask).inputmask.remove();\n }\n }\n\n //#endregion LIFECYCLE\n /****************************************************************************/\n //#region EVENTS\n\n /**\n * Emitted when the value changes (unified value binding).\n * @bind value\n */\n @Event()\n valueChanged: EventEmitter<string>;\n\n //#endregion EVENTS\n /****************************************************************************/\n //#region WATCHERS\n\n @Watch('value')\n handleValueChange(newValue: string) {\n this.singleValue = newValue;\n // Only set input value if it's different from current input value\n // This prevents interfering with user typing\n if (this.inputElement && this.inputElement.value !== newValue) {\n this.inputElement.value = newValue;\n }\n }\n\n @Watch('open')\n handleOpenChange(newOpen: boolean) {\n this.updateMask();\n\n // Additional side effect for external control, e.g., focus calendar if opened externally\n if (newOpen && this.popoverElement) {\n // Focus first selectable date\n const firstDate = this.popoverElement.querySelector(\n 'nv-calendar [data-date]',\n );\n if (firstDate) (firstDate as HTMLElement).focus();\n }\n }\n\n //#endregion WATCHERS\n /****************************************************************************/\n //#region LISTENERS\n\n /**\n * Handles the single date selection event from nv-calendar.\n * Updates the input value and closes the popover.\n * @param {CustomEvent} event - The event from nv-calendar.\n */\n @Listen('singleDateChange')\n handleSingleDateChange(event: CustomEvent) {\n const value: string = event.detail;\n const previousValue = this.value;\n this.singleValue = value;\n this.value = value;\n\n // Set the input value directly when calendar is used\n if (this.inputElement) {\n this.inputElement.value = value;\n }\n\n // Only emit valueChanged if the value actually changed\n if (previousValue !== value) {\n this.valueChanged.emit(value);\n }\n if (!this.showActions) {\n this.open = false;\n }\n }\n\n @Listen('closePopover')\n handleClosePopover() {\n this.open = false;\n }\n\n @Listen('keydown', { passive: false })\n handleKeyDown(event: KeyboardEvent) {\n if (event.key === 'Escape') {\n this.open = false;\n return;\n }\n\n if (!this.open) {\n if (event.key === 'ArrowDown') {\n this.open = true;\n\n event.preventDefault();\n return;\n }\n return;\n }\n\n // Verify if the popover element is defined\n if (!this.popoverElement) {\n console.warn('nv-fielddate -> Popover element is not defined');\n return;\n }\n }\n\n //#endregion LISTENERS\n /****************************************************************************/\n //#region RENDER\n\n render() {\n return (\n <Host>\n {((this.label && this.label.length > 0) ||\n this.el.querySelector('[slot=\"label\"]')) && (\n <label htmlFor={this.inputId}>\n <slot name=\"label\">{this.label}</slot>\n </label>\n )}\n\n <nv-popover\n ref={this.setPopoverRef}\n id={this.popoverId}\n triggerMode=\"controlled\"\n placement=\"bottom-start\"\n strategy=\"fixed\"\n open={this.open}\n >\n <div slot=\"trigger\" class=\"input-wrapper\">\n <slot name=\"before-input\"></slot>\n\n <div\n class=\"input-container\"\n onClick={this.handleInputContainerClick}\n >\n <slot name=\"leading-input\"></slot>\n\n <input\n id={this.inputId}\n ref={this.setInputRef}\n placeholder={\n this.placeholder ||\n this.convertToInputmaskFormat(this.dateFormat)\n }\n name={this.name}\n disabled={this.disabled}\n readOnly={this.readonly}\n required={this.required}\n autofocus={this.autofocus}\n onInput={this.handleInput}\n onFocus={this.handleFocus}\n data-scope=\"date\"\n />\n\n {this.error && (\n <nv-icon name=\"alert-circle\" class=\"validation\" size=\"md\" />\n )}\n {this.success && (\n <nv-icon name=\"circle-check\" class=\"validation\" size=\"md\" />\n )}\n\n <nv-iconbutton\n class=\"toggle-calendar-icon\"\n name=\"calendar\" //{this.open ? 'chevron-top' : 'chevron-down'}\n size=\"md\"\n emphasis=\"lower\"\n aria-label={this.open ? 'Hide calendar' : 'Show calendar'}\n onClick={this.toggleCalendar}\n tabIndex={this.disabled ? -1 : 0}\n />\n </div>\n\n <slot name=\"after-input\"></slot>\n </div>\n\n <div slot=\"content\">\n <nv-calendar\n dateFormat={this.dateFormat}\n singleValue={this.singleValue}\n firstDayOfWeek={this.firstDayOfWeek}\n numberOfCalendars={this.numberOfCalendars}\n min={this.min}\n max={this.max}\n locale={this.locale}\n shortcutsPlacement={this.shortcutsPlacement}\n showActions={this.showActions}\n shortcuts={this.shortcuts}\n showWeekNumbers={this.showWeekNumbers}\n disabledDates={this.disabledDates}\n onValueChanged={this.handleCalendarValueChanged}\n ></nv-calendar>\n </div>\n </nv-popover>\n\n {((this.description && this.description.length > 0) ||\n this.el.querySelector('[slot=\"description\"]')) && (\n <div class=\"description\">\n <slot name=\"description\">{this.description}</slot>\n </div>\n )}\n\n {(this.errorDescription ||\n this.el.querySelector('[slot=\"error-description\"]')) && (\n <div hidden={!this.error} class=\"error-description\">\n {this.el.querySelector('[slot=\"error-description\"]') ? (\n <slot name=\"error-description\"></slot>\n ) : (\n this.errorDescription\n )}\n </div>\n )}\n\n <slot></slot>\n </Host>\n );\n }\n\n //#endregion RENDER\n}\n"]}
1
+ {"version":3,"file":"nv-fielddate.js","sourceRoot":"","sources":["../../../src/components/nv-fielddate/nv-fielddate.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,EACT,CAAC,EACD,IAAI,EACJ,KAAK,EACL,OAAO,EACP,KAAK,EAEL,MAAM,EACN,IAAI,EACJ,KAAK,EACL,MAAM,GACP,MAAM,eAAe,CAAC;AACvB,OAAO,SAAS,MAAM,WAAW,CAAC;AAClC,OAAO,EAAE,EAAE,IAAI,MAAM,EAAE,MAAM,MAAM,CAAC;AAiBpC;;;;;;;;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAGF","sourcesContent":["import {\n Component,\n h,\n Prop,\n State,\n Element,\n Event,\n EventEmitter,\n Listen,\n Host,\n Watch,\n Method,\n} from '@stencil/core';\nimport Inputmask from 'inputmask';\nimport { v4 as uuidv4 } from 'uuid';\n\n/**\n * Extends HTMLInputElement to include the inputmask property.\n */\ninterface HTMLInputElementWithInputmask extends HTMLInputElement {\n /**\n * The inputmask instance that provides masking functionality.\n */\n inputmask?: {\n /**\n * Removes the inputmask instance.\n */\n remove?: () => void;\n };\n}\n\n/**\n * A field date component that combines an input with a calendar popover.\n *\n * @slot default - Child content of the component.\n * @slot leading-input - Content to be placed before the input text, within the input container.\n * @slot before-input - Content to be placed before the input text, outside the input container.\n * @slot after-input - Content to be placed after the input text, outside the input container.\n * @slot label - Content to be placed as the label, will override the label prop.\n * @slot description - Content to be placed as the description, will override the description prop.\n * @slot error-description - Content to be placed as the error description, will override the errorDescription prop.\n */\n@Component({\n tag: 'nv-fielddate',\n styleUrl: 'styles/nv-fielddate.scss',\n shadow: false,\n})\nexport class NvFielddate {\n @Element() el: HTMLNvFielddateElement;\n private inputElement!: HTMLInputElement;\n\n private popoverElement!: HTMLNvPopoverElement;\n private popoverId: string = uuidv4();\n\n /****************************************************************************/\n //#region PROPERTIES\n\n /**\n * Sets the ID for the input element and the for attribute of the associated\n * label. If no ID is provided, a random one will be automatically generated.\n */\n @Prop({ reflect: true })\n readonly inputId: string = uuidv4();\n\n /**\n * Text displayed as label. A slot label can override this prop.\n */\n @Prop({ reflect: true })\n readonly label: string;\n\n /**\n * Description displayed below the input. A slot description can override this prop.\n */\n @Prop({ reflect: true })\n readonly description: string;\n\n /**\n * Placeholder for the input field.\n */\n @Prop({ reflect: true })\n readonly placeholder: string;\n\n /**\n * Name attribute for the input.\n */\n @Prop({ reflect: true })\n readonly name: string;\n\n /**\n * Disables the input field.\n */\n @Prop({ reflect: true })\n readonly disabled: boolean = false;\n\n /**\n * Sets the input field as read-only.\n */\n @Prop({ reflect: true })\n readonly readonly: boolean = false;\n\n /**\n * Marks the input field as required.\n */\n @Prop({ reflect: true })\n readonly required: boolean = false;\n\n /**\n * Indicates an error state.\n */\n @Prop({ reflect: true })\n readonly error: boolean = false;\n\n /**\n * Error description. A slot error-description can override this prop.\n */\n @Prop({ reflect: true })\n readonly errorDescription?: string;\n\n /**\n * Indicates a success state.\n */\n @Prop({ reflect: true })\n readonly success: boolean = false;\n\n /**\n * Autofocus the input when the component is mounted.\n */\n @Prop({ reflect: true })\n // eslint-disable-next-line @stencil-community/reserved-member-names\n readonly autofocus: boolean = false;\n\n /**\n * The initial value of the input (date in string format).\n * @bind value\n */\n @Prop({ reflect: true, mutable: true })\n value: string = '';\n\n /**\n * The current value of the input date in string format.\n */\n @State()\n singleValue: string = '';\n\n /**\n * Controls the opening of the popover.\n */\n @State()\n open: boolean = false;\n\n /**\n * First day of the week 0 = Sunday, 1 = Monday, etc.\n * @default 1\n */\n @Prop({ reflect: true })\n readonly firstDayOfWeek: number = 1;\n\n /**\n * Number of calendars to display\n * @default 1\n */\n @Prop({ reflect: true })\n readonly numberOfCalendars: number = 1;\n\n /**\n * Minimum date for selection ISO string format, ex: 2025-01-01\n */\n @Prop({ reflect: true })\n readonly min?: string = '';\n\n /**\n * Maximum date for selection ISO string format, ex: 2025-12-31\n */\n @Prop({ reflect: true })\n readonly max?: string = '';\n\n /** Locale for date formatting\n * @default 'en-BE'\n */\n @Prop({ reflect: true })\n readonly locale: string = 'en-BE';\n\n /** Date format ex: YYYY-MM-DD, DD-MM-YYYY, etc.\n * @default 'YYYY-MM-DD'\n * @note If the date format is in UTC mode, the date will be displayed in UTC time.\n * @note If the date format is not in UTC mode, the date will be displayed in the local time.\n */\n @Prop({ reflect: true })\n readonly dateFormat: string = 'YYYY-MM-DD';\n\n /**\n * Footer placement\n * @default 'bottom'\n */\n @Prop({ reflect: true })\n readonly shortcutsPlacement: 'bottom' | 'left' | 'right' = 'bottom';\n\n /**\n * Show action buttons\n * @default false\n */\n @Prop({ reflect: true })\n readonly showActions: boolean = false;\n\n /**\n * Custom actions to display in the footer\n */\n @Prop({ reflect: true })\n readonly shortcuts: HTMLNvCalendarElement['shortcuts'];\n\n /**\n * Show week numbers\n * @default true\n */\n @Prop({ reflect: true })\n readonly showWeekNumbers: boolean;\n\n /**\n * Disabled dates ISO string array\n */\n @Prop({ reflect: true })\n readonly disabledDates: Array<string>;\n\n /**\n * Allows the field to stretch and fill the entire width of its container.\n */\n @Prop({ reflect: true })\n readonly fluid: boolean = false;\n\n //#endregion PROPERTIES\n /****************************************************************************/\n //#region METHODS\n\n /**\n * Converts the nv-calendar date format to the format expected by Inputmask.\n * @param {string} format - The date format.\n * @returns {string} Format adapted for Inputmask.\n */\n private convertToInputmaskFormat(format: string): string {\n // If the format is not specified, use the default format\n if (!format) {\n return 'dd/mm/yyyy';\n }\n\n const formatMap = {\n 'DD/MM/YYYY': 'dd/mm/yyyy',\n 'MM/DD/YYYY': 'mm/dd/yyyy',\n 'YYYY-MM-DD': 'yyyy-mm-dd',\n 'DD.MM.YYYY': 'dd.mm.yyyy',\n 'YYYYMMDD': 'yyyymmdd',\n };\n\n return formatMap[format] || 'dd/mm/yyyy';\n }\n\n /**\n * Closes the popover when a click is detected outside the component.\n * @param {MouseEvent} event - The click event.\n */\n private handleClickOutside = (event: MouseEvent) => {\n if (!(event.target instanceof Node)) return;\n if (!this.el?.contains(event.target)) this.open = false;\n };\n\n /**\n * Focuses the input when the input container is clicked.\n * @param {MouseEvent} event - The click event.\n */\n private handleInputContainerClick = (event: MouseEvent) => {\n if (this.readonly || this.disabled) {\n event.preventDefault();\n return;\n }\n this.inputElement.focus();\n };\n\n /**\n * Handles the input event on the input element.\n * Updates internal state to keep UI in sync - events are only emitted on completion or clear.\n * @param {Event} event - The input event.\n */\n private handleInput = (event: Event) => {\n if (this.readonly || this.disabled) {\n event.preventDefault();\n return;\n }\n const input = event.target as HTMLInputElement;\n\n // Always update singleValue to keep state in sync\n this.singleValue = input.value;\n\n // Only emit event when input is cleared\n if (input.value === '') {\n this.value = '';\n this.valueChanged.emit('');\n }\n };\n\n /**\n * Handles focus events on the input element.\n * @param {FocusEvent} event - The focus event.\n */\n private handleFocus = (event: FocusEvent) => {\n if (this.readonly || this.disabled) {\n event.preventDefault();\n (event.target as HTMLElement).blur();\n return;\n }\n\n this.open = true;\n };\n\n /**\n * Prevents the valueChanged event from the calendar from propagating up.\n * @param {CustomEvent} event - The valueChanged event from nv-calendar.\n */\n private handleCalendarValueChanged = (event: CustomEvent) => {\n event.stopPropagation();\n };\n\n /**\n * Sets the reference to the popover element.\n * @param {HTMLNvPopoverElement} el - The popover element.\n */\n private setPopoverRef = (el: HTMLNvPopoverElement) => {\n this.popoverElement = el;\n };\n\n /**\n * Sets the reference to the input element.\n * @param {HTMLInputElement} el - The input element.\n */\n private setInputRef = (el: HTMLInputElement) => {\n this.inputElement = el;\n };\n\n /**\n * Toggles the opening/closing of the popover.\n * @param {MouseEvent} event - The click event.\n */\n private toggleCalendar = () => {\n if (this.readonly || this.disabled) {\n return;\n }\n this.open = !this.open;\n };\n\n /**\n * Clears the current selection and resets the field to its initial state.\n * This method can be called programmatically to reset the field.\n */\n @Method()\n async clear(): Promise<void> {\n // Reset internal state\n this.singleValue = '';\n this.value = '';\n\n // Reset the input element value\n if (this.inputElement) {\n this.inputElement.value = '';\n // Remove the input mask and reinitialize if needed\n if ((this.inputElement as HTMLInputElementWithInputmask).inputmask) {\n (this.inputElement as HTMLInputElementWithInputmask).inputmask.remove();\n }\n }\n\n // Emit events to notify about the change\n this.valueChanged.emit('');\n\n // Close the popover if open\n this.open = false;\n }\n\n private updateMask() {\n if (!this.inputElement) return;\n (this.inputElement as HTMLInputElementWithInputmask).inputmask?.remove?.();\n\n const inputMask = new Inputmask({\n alias: 'datetime',\n inputFormat: this.convertToInputmaskFormat(this.dateFormat),\n placeholder: this.convertToInputmaskFormat(this.dateFormat),\n clearIncomplete: false,\n showMaskOnHover: false,\n showMaskOnFocus: true,\n clearMaskOnLostFocus: !this.open,\n postValidation: true,\n oncomplete: (e: CustomEvent) => {\n const newValue = (e.target as HTMLInputElement)?.value;\n // Only emit if the value actually changed\n if (this.value !== newValue) {\n this.singleValue = newValue;\n this.value = newValue;\n this.valueChanged.emit(newValue);\n }\n },\n });\n inputMask.mask(this.inputElement);\n }\n\n //#endregion METHODS\n /****************************************************************************/\n //#region LIFECYCLE\n\n componentWillLoad() {\n if (this.value) {\n this.singleValue = this.value;\n }\n }\n\n componentDidLoad() {\n this.updateMask();\n\n // Set the initial value after applying the mask\n if (this.inputElement.name === this.name && this.singleValue) {\n requestAnimationFrame(() => {\n this.inputElement.value = this.singleValue;\n const event = new CustomEvent('input', { bubbles: true });\n this.inputElement.dispatchEvent(event);\n });\n }\n }\n\n componentDidRender() {\n // Only set value on initial render when there's no existing value in the input\n if (this.singleValue && this.inputElement && !this.inputElement.value) {\n requestAnimationFrame(() => {\n this.inputElement.value = this.singleValue;\n this.inputElement.setAttribute('value', this.singleValue);\n });\n }\n }\n\n disconnectedCallback() {\n if (\n this.inputElement &&\n (this.inputElement as HTMLInputElementWithInputmask).inputmask\n ) {\n (this.inputElement as HTMLInputElementWithInputmask).inputmask.remove();\n }\n }\n\n //#endregion LIFECYCLE\n /****************************************************************************/\n //#region EVENTS\n\n /**\n * Emitted when the value changes (unified value binding).\n * @bind value\n */\n @Event()\n valueChanged: EventEmitter<string>;\n\n //#endregion EVENTS\n /****************************************************************************/\n //#region WATCHERS\n\n @Watch('value')\n handleValueChange(newValue: string) {\n this.singleValue = newValue;\n // Only set input value if it's different from current input value\n // This prevents interfering with user typing\n if (this.inputElement && this.inputElement.value !== newValue) {\n this.inputElement.value = newValue;\n }\n }\n\n @Watch('open')\n handleOpenChange(newOpen: boolean) {\n this.updateMask();\n\n // Additional side effect for external control, e.g., focus calendar if opened externally\n if (newOpen && this.popoverElement) {\n // Focus first selectable date\n const firstDate = this.popoverElement.querySelector(\n 'nv-calendar [data-date]',\n );\n if (firstDate) (firstDate as HTMLElement).focus();\n }\n }\n\n //#endregion WATCHERS\n /****************************************************************************/\n //#region LISTENERS\n\n /**\n * Handles the single date selection event from nv-calendar.\n * Updates the input value and closes the popover.\n * @param {CustomEvent} event - The event from nv-calendar.\n */\n @Listen('singleDateChange')\n handleSingleDateChange(event: CustomEvent) {\n const value: string = event.detail;\n const previousValue = this.value;\n this.singleValue = value;\n this.value = value;\n\n // Set the input value directly when calendar is used\n if (this.inputElement) {\n this.inputElement.value = value;\n }\n\n // Only emit valueChanged if the value actually changed\n if (previousValue !== value) {\n this.valueChanged.emit(value);\n }\n if (!this.showActions) {\n this.open = false;\n }\n }\n\n @Listen('closePopover')\n handleClosePopover() {\n this.open = false;\n }\n\n @Listen('click', { target: 'document' })\n handleDocumentClick(event: MouseEvent) {\n this.handleClickOutside(event);\n }\n\n @Listen('keydown', { passive: false })\n handleKeyDown(event: KeyboardEvent) {\n if (event.key === 'Escape') {\n this.open = false;\n return;\n }\n\n if (!this.open) {\n if (event.key === 'ArrowDown') {\n this.open = true;\n\n event.preventDefault();\n return;\n }\n return;\n }\n\n // Verify if the popover element is defined\n if (!this.popoverElement) {\n console.warn('nv-fielddate -> Popover element is not defined');\n return;\n }\n }\n\n //#endregion LISTENERS\n /****************************************************************************/\n //#region RENDER\n\n render() {\n return (\n <Host>\n {((this.label && this.label.length > 0) ||\n this.el.querySelector('[slot=\"label\"]')) && (\n <label htmlFor={this.inputId}>\n <slot name=\"label\">{this.label}</slot>\n </label>\n )}\n\n <nv-popover\n ref={this.setPopoverRef}\n id={this.popoverId}\n triggerMode=\"controlled\"\n placement=\"bottom-start\"\n open={this.open}\n >\n <div slot=\"trigger\" class=\"input-wrapper\">\n <slot name=\"before-input\"></slot>\n\n <div\n class=\"input-container\"\n onClick={this.handleInputContainerClick}\n >\n <slot name=\"leading-input\"></slot>\n\n <input\n id={this.inputId}\n ref={this.setInputRef}\n placeholder={\n this.placeholder ||\n this.convertToInputmaskFormat(this.dateFormat)\n }\n name={this.name}\n disabled={this.disabled}\n readOnly={this.readonly}\n required={this.required}\n autofocus={this.autofocus}\n onInput={this.handleInput}\n onFocus={this.handleFocus}\n data-scope=\"date\"\n />\n\n {this.error && (\n <nv-icon name=\"alert-circle\" class=\"validation\" size=\"md\" />\n )}\n {this.success && (\n <nv-icon name=\"circle-check\" class=\"validation\" size=\"md\" />\n )}\n\n <nv-iconbutton\n class=\"toggle-calendar-icon\"\n name=\"calendar\" //{this.open ? 'chevron-top' : 'chevron-down'}\n size=\"md\"\n emphasis=\"lower\"\n aria-label={this.open ? 'Hide calendar' : 'Show calendar'}\n onClick={this.toggleCalendar}\n tabIndex={this.disabled ? -1 : 0}\n />\n </div>\n\n <slot name=\"after-input\"></slot>\n </div>\n\n <div slot=\"content\">\n <nv-calendar\n dateFormat={this.dateFormat}\n singleValue={this.singleValue}\n firstDayOfWeek={this.firstDayOfWeek}\n numberOfCalendars={this.numberOfCalendars}\n min={this.min}\n max={this.max}\n locale={this.locale}\n shortcutsPlacement={this.shortcutsPlacement}\n showActions={this.showActions}\n shortcuts={this.shortcuts}\n showWeekNumbers={this.showWeekNumbers}\n disabledDates={this.disabledDates}\n onValueChanged={this.handleCalendarValueChanged}\n ></nv-calendar>\n </div>\n </nv-popover>\n\n {((this.description && this.description.length > 0) ||\n this.el.querySelector('[slot=\"description\"]')) && (\n <div class=\"description\">\n <slot name=\"description\">{this.description}</slot>\n </div>\n )}\n\n {(this.errorDescription ||\n this.el.querySelector('[slot=\"error-description\"]')) && (\n <div hidden={!this.error} class=\"error-description\">\n {this.el.querySelector('[slot=\"error-description\"]') ? (\n <slot name=\"error-description\"></slot>\n ) : (\n this.errorDescription\n )}\n </div>\n )}\n\n <slot></slot>\n </Host>\n );\n }\n\n //#endregion RENDER\n}\n"]}