@govbr-ds/webcomponents 2.2.0 → 2.4.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 (658) hide show
  1. package/README.md +75 -24
  2. package/cem/custom-elements.json +1858 -1712
  3. package/cem/webcomponents.html-custom-data.json +73 -67
  4. package/dist/cjs/br-avatar.cjs.entry.js +2 -2
  5. package/dist/cjs/br-breadcrumb-item.cjs.entry.js +1 -1
  6. package/dist/cjs/br-breadcrumb.cjs.entry.js +2 -2
  7. package/dist/cjs/br-button_2.cjs.entry.js +10 -5
  8. package/dist/cjs/br-card.cjs.entry.js +2 -2
  9. package/dist/cjs/br-carousel-page.cjs.entry.js +2 -2
  10. package/dist/cjs/br-carousel.cjs.entry.js +2 -2
  11. package/dist/cjs/br-checkbox-group.cjs.entry.js +2 -2
  12. package/dist/cjs/br-checkbox.cjs.entry.js +3 -3
  13. package/dist/cjs/br-checkgroup.cjs.entry.js +1 -1
  14. package/dist/cjs/br-collapse_2.cjs.entry.js +11 -7
  15. package/dist/cjs/br-cookiebar-cookie.cjs.entry.js +2 -2
  16. package/dist/cjs/br-cookiebar-group.cjs.entry.js +2 -2
  17. package/dist/cjs/br-cookiebar-header.cjs.entry.js +2 -2
  18. package/dist/cjs/br-cookiebar-link.cjs.entry.js +2 -2
  19. package/dist/cjs/br-cookiebar-note-group.cjs.entry.js +2 -2
  20. package/dist/cjs/br-cookiebar-note.cjs.entry.js +2 -2
  21. package/dist/cjs/br-cookiebar.cjs.entry.js +2 -2
  22. package/dist/cjs/br-crumb.cjs.entry.js +1 -1
  23. package/dist/cjs/br-date-picker_3.cjs.entry.js +869 -517
  24. package/dist/cjs/br-datetime-picker.cjs.entry.js +1347 -311
  25. package/dist/cjs/br-divider.cjs.entry.js +2 -2
  26. package/dist/cjs/br-dropdown_2.cjs.entry.js +282 -165
  27. package/dist/cjs/br-footer-category.cjs.entry.js +2 -2
  28. package/dist/cjs/br-footer-item.cjs.entry.js +2 -2
  29. package/dist/cjs/br-footer-legal.cjs.entry.js +2 -2
  30. package/dist/cjs/br-footer-logo.cjs.entry.js +2 -2
  31. package/dist/cjs/br-footer-social.cjs.entry.js +2 -2
  32. package/dist/cjs/br-footer.cjs.entry.js +2 -2
  33. package/dist/cjs/br-header-function.cjs.entry.js +2 -2
  34. package/dist/cjs/br-header-link.cjs.entry.js +2 -2
  35. package/dist/cjs/br-header-list.cjs.entry.js +2 -2
  36. package/dist/cjs/br-header-logo.cjs.entry.js +2 -2
  37. package/dist/cjs/br-header.cjs.entry.js +27 -23
  38. package/dist/cjs/br-icon.cjs.entry.js +4 -33
  39. package/dist/cjs/br-input.cjs.entry.js +31 -6
  40. package/dist/cjs/br-item.cjs.entry.js +5 -4
  41. package/dist/cjs/br-link.cjs.entry.js +2 -2
  42. package/dist/cjs/br-loading.cjs.entry.js +2 -2
  43. package/dist/cjs/br-magic-button.cjs.entry.js +21 -8
  44. package/dist/cjs/br-menu-group.cjs.entry.js +2 -2
  45. package/dist/cjs/br-menu-header.cjs.entry.js +2 -2
  46. package/dist/cjs/br-menu-info.cjs.entry.js +2 -2
  47. package/dist/cjs/br-menu-item.cjs.entry.js +2 -2
  48. package/dist/cjs/br-menu-link.cjs.entry.js +2 -2
  49. package/dist/cjs/br-menu-list.cjs.entry.js +2 -2
  50. package/dist/cjs/br-menu-logo.cjs.entry.js +2 -2
  51. package/dist/cjs/br-menu-social.cjs.entry.js +2 -2
  52. package/dist/cjs/br-menu.cjs.entry.js +2 -2
  53. package/dist/cjs/br-modal.cjs.entry.js +20 -4
  54. package/dist/cjs/br-notification-body.cjs.entry.js +2 -2
  55. package/dist/cjs/br-notification-header.cjs.entry.js +2 -2
  56. package/dist/cjs/br-notification-item.cjs.entry.js +2 -2
  57. package/dist/cjs/br-notification.cjs.entry.js +2 -2
  58. package/dist/cjs/br-pagination.cjs.entry.js +4 -4
  59. package/dist/cjs/br-radio-group.cjs.entry.js +3 -3
  60. package/dist/cjs/br-radio.cjs.entry.js +3 -3
  61. package/dist/cjs/br-scrim.cjs.entry.js +2 -2
  62. package/dist/cjs/br-select-input_3.cjs.entry.js +286 -100
  63. package/dist/cjs/br-sign-in.cjs.entry.js +8 -4
  64. package/dist/cjs/br-skip-link-item.cjs.entry.js +1 -1
  65. package/dist/cjs/br-skip-link.cjs.entry.js +2 -2
  66. package/dist/cjs/br-skiplink-item.cjs.entry.js +2 -2
  67. package/dist/cjs/br-slider.cjs.entry.js +3 -3
  68. package/dist/cjs/br-step_2.cjs.entry.js +3 -3
  69. package/dist/cjs/br-switch.cjs.entry.js +3 -3
  70. package/dist/cjs/br-tab-item.cjs.entry.js +3 -3
  71. package/dist/cjs/br-tab.cjs.entry.js +38 -13
  72. package/dist/cjs/br-table-body.cjs.entry.js +2 -2
  73. package/dist/cjs/br-table-cell.cjs.entry.js +2 -2
  74. package/dist/cjs/br-table-header-cell.cjs.entry.js +2 -2
  75. package/dist/cjs/br-table-header.cjs.entry.js +2 -2
  76. package/dist/cjs/br-table-row.cjs.entry.js +2 -2
  77. package/dist/cjs/br-table.cjs.entry.js +2 -2
  78. package/dist/cjs/br-tag.cjs.entry.js +3 -3
  79. package/dist/cjs/br-textarea.cjs.entry.js +3 -3
  80. package/dist/cjs/br-tooltip.cjs.entry.js +2 -2
  81. package/dist/cjs/br-upload.cjs.entry.js +7 -23
  82. package/dist/cjs/br-wizard-panel.cjs.entry.js +2 -2
  83. package/dist/cjs/br-wizard.cjs.entry.js +2 -2
  84. package/dist/cjs/{datetime-picker-constants-B5pWeOn1.js → datetime-picker-constants-CCeI5iW7.js} +20 -5
  85. package/dist/cjs/format-bytes-Cs8SH2w0.js +24 -0
  86. package/dist/cjs/icon.utils-DF6kMskA.js +46 -0
  87. package/dist/cjs/{index-CGgZBuyy.js → index-Bc30P_6z.js} +33 -27
  88. package/dist/cjs/{index-C92n55ch.js → index-C-IpVFDH.js} +13 -13
  89. package/dist/cjs/index.cjs.js +2 -2
  90. package/dist/cjs/{datetime-picker-props-validation-DmNKSXsy.js → isValid-CduHZTFc.js} +1 -483
  91. package/dist/cjs/loader.cjs.js +2 -2
  92. package/dist/cjs/select.utils-C38f5Kea.js +62 -0
  93. package/dist/cjs/{validator-CTCajtT9.js → validator-GkkueMOx.js} +18 -0
  94. package/dist/cjs/webcomponents.cjs.js +3 -3
  95. package/dist/collection/collection-manifest.json +1 -1
  96. package/dist/collection/components/avatar/avatar.css +1 -1
  97. package/dist/collection/components/breadcrumb/breadcrumb.css +1 -1
  98. package/dist/collection/components/button/button.css +1 -1
  99. package/dist/collection/components/button/button.js +8 -3
  100. package/dist/collection/components/card/card.css +1 -1
  101. package/dist/collection/components/carousel/carousel-page/carousel-page.css +1 -1
  102. package/dist/collection/components/carousel/carousel.css +1 -1
  103. package/dist/collection/components/checkbox/checkbox.css +1 -1
  104. package/dist/collection/components/checkbox-group/checkbox-group.css +1 -1
  105. package/dist/collection/components/collapse/collapse.css +1 -1
  106. package/dist/collection/components/collapse/collapse.js +12 -6
  107. package/dist/collection/components/cookiebar/cookiebar-cookie/cookiebar-cookie.css +1 -1
  108. package/dist/collection/components/cookiebar/cookiebar-group/cookiebar-group.css +1 -1
  109. package/dist/collection/components/cookiebar/cookiebar-header/cookiebar-header.css +1 -1
  110. package/dist/collection/components/cookiebar/cookiebar-link/cookiebar-link.css +1 -1
  111. package/dist/collection/components/cookiebar/cookiebar-note/cookiebar-note.css +1 -1
  112. package/dist/collection/components/cookiebar/cookiebar-note-group/cookiebar-note-group.css +1 -1
  113. package/dist/collection/components/cookiebar/cookiebar.css +1 -1
  114. package/dist/collection/components/datetime-picker/date-picker/date-picker-locale.js +12 -12
  115. package/dist/collection/components/datetime-picker/date-picker/date-picker-props-validation.js +14 -13
  116. package/dist/collection/components/datetime-picker/date-picker/date-picker.css +1 -1
  117. package/dist/collection/components/datetime-picker/date-picker/date-picker.js +384 -280
  118. package/dist/collection/components/datetime-picker/datetime-input/datetime-input-constants.js +59 -0
  119. package/dist/collection/components/datetime-picker/datetime-input/datetime-input-props-validation.js +19 -15
  120. package/dist/collection/components/datetime-picker/datetime-input/datetime-input.css +1 -1
  121. package/dist/collection/components/datetime-picker/datetime-input/datetime-input.js +373 -211
  122. package/dist/collection/components/datetime-picker/datetime-input/datetime-input.types.js +1 -0
  123. package/dist/collection/components/datetime-picker/datetime-picker-constants.js +19 -5
  124. package/dist/collection/components/datetime-picker/datetime-picker-form-associated.js +92 -11
  125. package/dist/collection/components/datetime-picker/datetime-picker-props-validation.js +52 -33
  126. package/dist/collection/components/datetime-picker/datetime-picker.css +1 -1
  127. package/dist/collection/components/datetime-picker/datetime-picker.js +915 -362
  128. package/dist/collection/components/datetime-picker/datetime-picker.utils.js +62 -49
  129. package/dist/collection/components/datetime-picker/time-picker/time-picker-constants.js +3 -2
  130. package/dist/collection/components/datetime-picker/time-picker/time-picker.css +1 -1
  131. package/dist/collection/components/datetime-picker/time-picker/time-picker.js +148 -85
  132. package/dist/collection/components/divider/divider.css +1 -1
  133. package/dist/collection/components/dropdown/dropdown.css +1 -1
  134. package/dist/collection/components/dropdown/dropdown.js +32 -36
  135. package/dist/collection/components/footer/footer-category/footer-category.css +1 -1
  136. package/dist/collection/components/footer/footer-item/footer-item.css +1 -1
  137. package/dist/collection/components/footer/footer-legal/footer-legal.css +1 -1
  138. package/dist/collection/components/footer/footer-logo/footer-logo.css +1 -1
  139. package/dist/collection/components/footer/footer-social/footer-social.css +1 -1
  140. package/dist/collection/components/footer/footer.css +1 -1
  141. package/dist/collection/components/header/header-function/header-function.css +1 -1
  142. package/dist/collection/components/header/header-link/header-link.css +1 -1
  143. package/dist/collection/components/header/header-list/header-list.css +1 -1
  144. package/dist/collection/components/header/header-logo/header-logo.css +1 -1
  145. package/dist/collection/components/header/header.css +1 -1
  146. package/dist/collection/components/header/header.js +25 -21
  147. package/dist/collection/components/icon/icon.css +1 -1
  148. package/dist/collection/components/icon/icon.utils.js +8 -0
  149. package/dist/collection/components/input/input.css +1 -1
  150. package/dist/collection/components/input/input.js +50 -4
  151. package/dist/collection/components/item/item.css +1 -1
  152. package/dist/collection/components/item/item.js +4 -3
  153. package/dist/collection/components/link/link.css +1 -1
  154. package/dist/collection/components/list/list.css +1 -1
  155. package/dist/collection/components/loading/loading.css +1 -1
  156. package/dist/collection/components/magic-button/magic-button.css +1 -1
  157. package/dist/collection/components/magic-button/magic-button.js +20 -6
  158. package/dist/collection/components/menu/menu-group/menu-group.css +1 -1
  159. package/dist/collection/components/menu/menu-header/menu-header.css +1 -1
  160. package/dist/collection/components/menu/menu-info/menu-info.css +1 -1
  161. package/dist/collection/components/menu/menu-item/menu-item.css +1 -1
  162. package/dist/collection/components/menu/menu-link/menu-link.css +1 -1
  163. package/dist/collection/components/menu/menu-list/menu-list.css +1 -1
  164. package/dist/collection/components/menu/menu-logo/menu-logo.css +1 -1
  165. package/dist/collection/components/menu/menu-social/menu-social.css +1 -1
  166. package/dist/collection/components/menu/menu.css +1 -1
  167. package/dist/collection/components/message/message.css +1 -1
  168. package/dist/collection/components/modal/modal.css +1 -1
  169. package/dist/collection/components/modal/modal.js +19 -3
  170. package/dist/collection/components/notification/notification-body/notification-body.css +1 -1
  171. package/dist/collection/components/notification/notification-header/notification-header.css +1 -1
  172. package/dist/collection/components/notification/notification-item/notification-item.css +1 -1
  173. package/dist/collection/components/notification/notification.css +1 -1
  174. package/dist/collection/components/pagination/pagination.css +1 -1
  175. package/dist/collection/components/pagination/pagination.js +4 -2
  176. package/dist/collection/components/radio/radio.css +1 -1
  177. package/dist/collection/components/radio-group/radio-group.css +1 -1
  178. package/dist/collection/components/scrim/scrim.css +1 -1
  179. package/dist/collection/components/select/select-input/select-input.css +1 -1
  180. package/dist/collection/components/select/select-input/select-input.js +126 -18
  181. package/dist/collection/components/select/select-list/select-list.css +1 -1
  182. package/dist/collection/components/select/select-list/select-list.js +218 -66
  183. package/dist/collection/components/select/select-option/select-option.css +1 -1
  184. package/dist/collection/components/select/select-option/select-option.js +14 -5
  185. package/dist/collection/components/select/select.css +1 -1
  186. package/dist/collection/components/select/select.js +303 -94
  187. package/dist/collection/components/select/select.utils.js +29 -8
  188. package/dist/collection/components/sign-in/sign-in.css +1 -1
  189. package/dist/collection/components/sign-in/sign-in.js +8 -4
  190. package/dist/collection/components/skip-link/skip-link-item/skip-link-item.css +1 -1
  191. package/dist/collection/components/skip-link/skip-link.css +1 -1
  192. package/dist/collection/components/slider/slider.css +1 -1
  193. package/dist/collection/components/step/step-item/step-item.css +1 -1
  194. package/dist/collection/components/step/step.css +1 -1
  195. package/dist/collection/components/switch/switch.css +1 -1
  196. package/dist/collection/components/tab/tab-item/tab-item.css +1 -1
  197. package/dist/collection/components/tab/tab-item/tab-item.js +2 -2
  198. package/dist/collection/components/tab/tab.css +1 -1
  199. package/dist/collection/components/tab/tab.js +37 -10
  200. package/dist/collection/components/table/table-body/table-body.css +1 -1
  201. package/dist/collection/components/table/table-cell/table-cell.css +1 -1
  202. package/dist/collection/components/table/table-header/table-header.css +1 -1
  203. package/dist/collection/components/table/table-header-cell/table-header-cell.css +1 -1
  204. package/dist/collection/components/table/table-row/table-row.css +1 -1
  205. package/dist/collection/components/table/table.css +1 -1
  206. package/dist/collection/components/tag/tag.css +1 -1
  207. package/dist/collection/components/textarea/textarea.css +1 -1
  208. package/dist/collection/components/tooltip/tooltip.css +1 -1
  209. package/dist/collection/components/upload/upload.css +1 -1
  210. package/dist/collection/components/wizard/wizard-panel/wizard-panel.css +1 -1
  211. package/dist/collection/components/wizard/wizard.css +1 -1
  212. package/dist/collection/pages/components/select/remote.js +33 -0
  213. package/dist/collection/pages/components/select/virtualized.js +13 -0
  214. package/dist/collection/pages/components/upload/handler.js +25 -0
  215. package/dist/collection/pages/scripts/component-controls.js +15 -16
  216. package/dist/collection/pages/scripts/menu.js +0 -1
  217. package/dist/collection/pages/scripts/pageLoader.js +168 -91
  218. package/dist/collection/pages/scripts/pageloader-preview.js +37 -28
  219. package/dist/collection/shared/utils/form.js +17 -0
  220. package/dist/components/br-avatar.js +1 -1
  221. package/dist/components/br-breadcrumb-item.js +1 -1
  222. package/dist/components/br-breadcrumb.js +1 -1
  223. package/dist/components/br-button.js +1 -1
  224. package/dist/components/br-card.js +1 -1
  225. package/dist/components/br-carousel-page.js +1 -1
  226. package/dist/components/br-carousel.js +1 -1
  227. package/dist/components/br-checkbox-group.js +1 -1
  228. package/dist/components/br-checkbox.js +1 -1
  229. package/dist/components/br-checkgroup.js +1 -1
  230. package/dist/components/br-collapse.js +1 -1
  231. package/dist/components/br-cookiebar-cookie.js +1 -1
  232. package/dist/components/br-cookiebar-group.js +1 -1
  233. package/dist/components/br-cookiebar-header.js +1 -1
  234. package/dist/components/br-cookiebar-link.js +1 -1
  235. package/dist/components/br-cookiebar-note-group.js +1 -1
  236. package/dist/components/br-cookiebar-note.js +1 -1
  237. package/dist/components/br-cookiebar.js +1 -1
  238. package/dist/components/br-crumb.js +1 -1
  239. package/dist/components/br-date-picker.js +1 -1
  240. package/dist/components/br-datetime-input.js +1 -1
  241. package/dist/components/br-datetime-picker.js +1 -1
  242. package/dist/components/br-divider.js +1 -1
  243. package/dist/components/br-dropdown.js +1 -1
  244. package/dist/components/br-footer-category.js +1 -1
  245. package/dist/components/br-footer-item.js +1 -1
  246. package/dist/components/br-footer-legal.js +1 -1
  247. package/dist/components/br-footer-logo.js +1 -1
  248. package/dist/components/br-footer-social.js +1 -1
  249. package/dist/components/br-footer.js +1 -1
  250. package/dist/components/br-header-function.js +1 -1
  251. package/dist/components/br-header-link.js +1 -1
  252. package/dist/components/br-header-list.js +1 -1
  253. package/dist/components/br-header-logo.js +1 -1
  254. package/dist/components/br-header.js +1 -1
  255. package/dist/components/br-icon.js +1 -1
  256. package/dist/components/br-input.js +1 -1
  257. package/dist/components/br-item.js +1 -1
  258. package/dist/components/br-link.js +1 -1
  259. package/dist/components/br-list.js +1 -1
  260. package/dist/components/br-loading.js +1 -1
  261. package/dist/components/br-magic-button.js +1 -1
  262. package/dist/components/br-menu-group.js +1 -1
  263. package/dist/components/br-menu-header.js +1 -1
  264. package/dist/components/br-menu-info.js +1 -1
  265. package/dist/components/br-menu-item.js +1 -1
  266. package/dist/components/br-menu-link.js +1 -1
  267. package/dist/components/br-menu-list.js +1 -1
  268. package/dist/components/br-menu-logo.js +1 -1
  269. package/dist/components/br-menu-social.js +1 -1
  270. package/dist/components/br-menu.js +1 -1
  271. package/dist/components/br-message.js +1 -1
  272. package/dist/components/br-modal.js +1 -1
  273. package/dist/components/br-notification-body.js +1 -1
  274. package/dist/components/br-notification-header.js +1 -1
  275. package/dist/components/br-notification-item.js +1 -1
  276. package/dist/components/br-notification.js +1 -1
  277. package/dist/components/br-pagination.js +1 -1
  278. package/dist/components/br-radio-group.js +1 -1
  279. package/dist/components/br-radio.js +1 -1
  280. package/dist/components/br-scrim.js +1 -1
  281. package/dist/components/br-select-input.js +1 -1
  282. package/dist/components/br-select-list.js +1 -1
  283. package/dist/components/br-select-option.js +1 -1
  284. package/dist/components/br-select.js +1 -1
  285. package/dist/components/br-sign-in.js +1 -1
  286. package/dist/components/br-skip-link-item.js +1 -1
  287. package/dist/components/br-skip-link.js +1 -1
  288. package/dist/components/br-skiplink-item.js +1 -1
  289. package/dist/components/br-slider.js +1 -1
  290. package/dist/components/br-step-item.js +1 -1
  291. package/dist/components/br-step.js +1 -1
  292. package/dist/components/br-switch.js +1 -1
  293. package/dist/components/br-tab-item.js +1 -1
  294. package/dist/components/br-tab.js +1 -1
  295. package/dist/components/br-table-body.js +1 -1
  296. package/dist/components/br-table-cell.js +1 -1
  297. package/dist/components/br-table-header-cell.js +1 -1
  298. package/dist/components/br-table-header.js +1 -1
  299. package/dist/components/br-table-row.js +1 -1
  300. package/dist/components/br-table.js +1 -1
  301. package/dist/components/br-tag.js +1 -1
  302. package/dist/components/br-textarea.js +1 -1
  303. package/dist/components/br-time-picker.js +1 -1
  304. package/dist/components/br-tooltip.js +1 -1
  305. package/dist/components/br-upload.js +1 -1
  306. package/dist/components/br-wizard-panel.js +1 -1
  307. package/dist/components/br-wizard.js +1 -1
  308. package/dist/components/index.js +1 -1
  309. package/dist/components/p-5h-W9_JR.js +5 -0
  310. package/dist/components/p-848QkYoM.js +5 -0
  311. package/dist/components/p-B7bNfmgh.js +5 -0
  312. package/dist/components/p-BFHvuEnN.js +5 -0
  313. package/dist/components/p-BH6QYnAr.js +5 -0
  314. package/dist/{webcomponents/p-6c2fe5e4.entry.js → components/p-BcW8O6h2.js} +1 -1
  315. package/dist/components/p-BicHMcSS.js +5 -0
  316. package/dist/components/p-Bs7iRQTG.js +5 -0
  317. package/dist/components/{p-DSHbttu9.js → p-Bvrw9yWR.js} +1 -1
  318. package/dist/components/p-BzQFMh9j.js +5 -0
  319. package/dist/components/p-CBHd0-fF.js +5 -0
  320. package/dist/components/p-CCPHCJjw.js +5 -0
  321. package/dist/components/p-CDTENPaP.js +5 -0
  322. package/dist/components/{p-BcqVlof7.js → p-CbgKdASU.js} +1 -1
  323. package/dist/components/p-CeNELttN.js +5 -0
  324. package/dist/components/p-CjtmJTLO.js +5 -0
  325. package/dist/components/{p-DTGNra9m.js → p-D-3G3Ioq.js} +1 -1
  326. package/dist/components/p-DDu3JV_r.js +5 -0
  327. package/dist/components/p-DFWqyfUe.js +5 -0
  328. package/dist/components/p-DL6xuxGG.js +5 -0
  329. package/dist/components/p-DOX9Uwk1.js +5 -0
  330. package/dist/components/p-DUq7uT2-.js +5 -0
  331. package/dist/components/p-Devw08cc.js +5 -0
  332. package/dist/components/p-Di96UxvH.js +5 -0
  333. package/dist/components/p-Dp3MsSXu.js +5 -0
  334. package/dist/components/p-DsO4F0Cz.js +5 -0
  335. package/dist/components/p-DuLHFTpa.js +5 -0
  336. package/dist/components/p-DusornQ0.js +5 -0
  337. package/dist/components/{p-Dma14GVa.js → p-Jk_KQE5V.js} +1 -1
  338. package/dist/components/p-OQpiDEK9.js +5 -0
  339. package/dist/components/p-PV731d8s.js +5 -0
  340. package/dist/components/p-XW6Hp_Jk.js +5 -0
  341. package/dist/components/p-jOb1hCPi.js +5 -0
  342. package/dist/components/p-rMnkh3Cy.js +5 -0
  343. package/dist/components/p-ta-24T1Z.js +5 -0
  344. package/dist/esm/br-avatar.entry.js +2 -2
  345. package/dist/esm/br-breadcrumb-item.entry.js +1 -1
  346. package/dist/esm/br-breadcrumb.entry.js +2 -2
  347. package/dist/esm/br-button_2.entry.js +10 -5
  348. package/dist/esm/br-card.entry.js +2 -2
  349. package/dist/esm/br-carousel-page.entry.js +2 -2
  350. package/dist/esm/br-carousel.entry.js +3 -3
  351. package/dist/esm/br-checkbox-group.entry.js +2 -2
  352. package/dist/esm/br-checkbox.entry.js +4 -4
  353. package/dist/esm/br-checkgroup.entry.js +1 -1
  354. package/dist/esm/br-collapse_2.entry.js +12 -8
  355. package/dist/esm/br-cookiebar-cookie.entry.js +2 -2
  356. package/dist/esm/br-cookiebar-group.entry.js +2 -2
  357. package/dist/esm/br-cookiebar-header.entry.js +2 -2
  358. package/dist/esm/br-cookiebar-link.entry.js +2 -2
  359. package/dist/esm/br-cookiebar-note-group.entry.js +2 -2
  360. package/dist/esm/br-cookiebar-note.entry.js +2 -2
  361. package/dist/esm/br-cookiebar.entry.js +3 -3
  362. package/dist/esm/br-crumb.entry.js +1 -1
  363. package/dist/esm/br-date-picker_3.entry.js +844 -492
  364. package/dist/esm/br-datetime-picker.entry.js +1316 -280
  365. package/dist/esm/br-divider.entry.js +2 -2
  366. package/dist/esm/br-dropdown_2.entry.js +281 -164
  367. package/dist/esm/br-footer-category.entry.js +2 -2
  368. package/dist/esm/br-footer-item.entry.js +2 -2
  369. package/dist/esm/br-footer-legal.entry.js +2 -2
  370. package/dist/esm/br-footer-logo.entry.js +2 -2
  371. package/dist/esm/br-footer-social.entry.js +2 -2
  372. package/dist/esm/br-footer.entry.js +2 -2
  373. package/dist/esm/br-header-function.entry.js +2 -2
  374. package/dist/esm/br-header-link.entry.js +2 -2
  375. package/dist/esm/br-header-list.entry.js +3 -3
  376. package/dist/esm/br-header-logo.entry.js +2 -2
  377. package/dist/esm/br-header.entry.js +27 -23
  378. package/dist/esm/br-icon.entry.js +3 -32
  379. package/dist/esm/br-input.entry.js +32 -7
  380. package/dist/esm/br-item.entry.js +5 -4
  381. package/dist/esm/br-link.entry.js +2 -2
  382. package/dist/esm/br-loading.entry.js +2 -2
  383. package/dist/esm/br-magic-button.entry.js +21 -8
  384. package/dist/esm/br-menu-group.entry.js +2 -2
  385. package/dist/esm/br-menu-header.entry.js +2 -2
  386. package/dist/esm/br-menu-info.entry.js +2 -2
  387. package/dist/esm/br-menu-item.entry.js +2 -2
  388. package/dist/esm/br-menu-link.entry.js +2 -2
  389. package/dist/esm/br-menu-list.entry.js +2 -2
  390. package/dist/esm/br-menu-logo.entry.js +2 -2
  391. package/dist/esm/br-menu-social.entry.js +2 -2
  392. package/dist/esm/br-menu.entry.js +3 -3
  393. package/dist/esm/br-modal.entry.js +21 -5
  394. package/dist/esm/br-notification-body.entry.js +2 -2
  395. package/dist/esm/br-notification-header.entry.js +2 -2
  396. package/dist/esm/br-notification-item.entry.js +2 -2
  397. package/dist/esm/br-notification.entry.js +3 -3
  398. package/dist/esm/br-pagination.entry.js +4 -4
  399. package/dist/esm/br-radio-group.entry.js +4 -4
  400. package/dist/esm/br-radio.entry.js +4 -4
  401. package/dist/esm/br-scrim.entry.js +2 -2
  402. package/dist/esm/br-select-input_3.entry.js +286 -100
  403. package/dist/esm/br-sign-in.entry.js +8 -4
  404. package/dist/esm/br-skip-link-item.entry.js +1 -1
  405. package/dist/esm/br-skip-link.entry.js +2 -2
  406. package/dist/esm/br-skiplink-item.entry.js +2 -2
  407. package/dist/esm/br-slider.entry.js +4 -4
  408. package/dist/esm/br-step_2.entry.js +3 -3
  409. package/dist/esm/br-switch.entry.js +4 -4
  410. package/dist/esm/br-tab-item.entry.js +3 -3
  411. package/dist/esm/br-tab.entry.js +38 -13
  412. package/dist/esm/br-table-body.entry.js +2 -2
  413. package/dist/esm/br-table-cell.entry.js +2 -2
  414. package/dist/esm/br-table-header-cell.entry.js +2 -2
  415. package/dist/esm/br-table-header.entry.js +2 -2
  416. package/dist/esm/br-table-row.entry.js +2 -2
  417. package/dist/esm/br-table.entry.js +2 -2
  418. package/dist/esm/br-tag.entry.js +4 -4
  419. package/dist/esm/br-textarea.entry.js +4 -4
  420. package/dist/esm/br-tooltip.entry.js +3 -3
  421. package/dist/esm/br-upload.entry.js +5 -21
  422. package/dist/esm/br-wizard-panel.entry.js +2 -2
  423. package/dist/esm/br-wizard.entry.js +2 -2
  424. package/dist/esm/{datetime-picker-constants-BtRPYRvA.js → datetime-picker-constants-DDc4sADe.js} +20 -6
  425. package/dist/esm/{event-CfuJQ1DY.js → event-6Da1SZ3J.js} +1 -1
  426. package/dist/esm/format-bytes-B7bNfmgh.js +22 -0
  427. package/dist/esm/icon.utils-zlORkiHQ.js +43 -0
  428. package/dist/esm/{index-Dcn7tRST.js → index-ConyRdJe.js} +33 -27
  429. package/dist/esm/{index-BQPOWxe5.js → index-CytVKoHT.js} +13 -13
  430. package/dist/esm/index.js +2 -2
  431. package/dist/esm/{datetime-picker-props-validation-BeTcUTnE.js → isValid-Bee0Uvqc.js} +2 -477
  432. package/dist/esm/loader.js +3 -3
  433. package/dist/esm/select.utils-BYsh2ZdE.js +57 -0
  434. package/dist/esm/{validator-D3tVP32U.js → validator-BkWWrDEr.js} +18 -1
  435. package/dist/esm/webcomponents.js +4 -4
  436. package/dist/hydrate/index.js +3314 -1806
  437. package/dist/hydrate/index.mjs +3314 -1806
  438. package/dist/types/components/button/button.d.ts +2 -1
  439. package/dist/types/components/collapse/collapse.d.ts +6 -2
  440. package/dist/types/components/datetime-picker/date-picker/date-picker-locale.d.ts +9 -9
  441. package/dist/types/components/datetime-picker/date-picker/date-picker-props-validation.d.ts +14 -13
  442. package/dist/types/components/datetime-picker/date-picker/date-picker.d.ts +264 -161
  443. package/dist/types/components/datetime-picker/datetime-input/datetime-input-constants.d.ts +14 -0
  444. package/dist/types/components/datetime-picker/datetime-input/datetime-input-props-validation.d.ts +19 -15
  445. package/dist/types/components/datetime-picker/datetime-input/datetime-input.d.ts +229 -98
  446. package/dist/types/components/datetime-picker/datetime-input/datetime-input.types.d.ts +36 -0
  447. package/dist/types/components/datetime-picker/datetime-picker-constants.d.ts +19 -5
  448. package/dist/types/components/datetime-picker/datetime-picker-form-associated.d.ts +32 -5
  449. package/dist/types/components/datetime-picker/datetime-picker-props-validation.d.ts +22 -24
  450. package/dist/types/components/datetime-picker/datetime-picker.d.ts +508 -235
  451. package/dist/types/components/datetime-picker/datetime-picker.types.d.ts +75 -21
  452. package/dist/types/components/datetime-picker/datetime-picker.utils.d.ts +53 -47
  453. package/dist/types/components/datetime-picker/time-picker/time-picker-constants.d.ts +3 -2
  454. package/dist/types/components/datetime-picker/time-picker/time-picker.d.ts +126 -55
  455. package/dist/types/components/dropdown/dropdown.d.ts +12 -4
  456. package/dist/types/components/header/header.d.ts +2 -0
  457. package/dist/types/components/icon/icon.utils.d.ts +6 -0
  458. package/dist/types/components/input/input.d.ts +18 -1
  459. package/dist/types/components/input/input.types.d.ts +4 -0
  460. package/dist/types/components/item/item.d.ts +6 -1
  461. package/dist/types/components/magic-button/magic-button.d.ts +7 -3
  462. package/dist/types/components/modal/modal.d.ts +6 -0
  463. package/dist/types/components/pagination/pagination.d.ts +2 -0
  464. package/dist/types/components/select/select-input/select-input.d.ts +9 -2
  465. package/dist/types/components/select/select-list/select-list.d.ts +14 -2
  466. package/dist/types/components/select/select-option/select-option.d.ts +1 -0
  467. package/dist/types/components/select/select.d.ts +47 -7
  468. package/dist/types/components/select/select.types.d.ts +12 -0
  469. package/dist/types/components/select/select.utils.d.ts +3 -0
  470. package/dist/types/components/sign-in/sign-in.d.ts +3 -2
  471. package/dist/types/components/tab/tab-item/tab-item.d.ts +6 -2
  472. package/dist/types/components/tab/tab.d.ts +7 -0
  473. package/dist/types/components.d.ts +405 -318
  474. package/dist/types/shared/utils/form.d.ts +8 -0
  475. package/dist/types/stencil-public-runtime.d.ts +61 -55
  476. package/dist/webcomponents/index.esm.js +1 -1
  477. package/dist/webcomponents/p-01801ac1.entry.js +5 -0
  478. package/dist/webcomponents/p-05b459f2.entry.js +5 -0
  479. package/dist/webcomponents/p-08ac6f09.entry.js +5 -0
  480. package/dist/webcomponents/{p-cff24492.entry.js → p-09817344.entry.js} +1 -1
  481. package/dist/webcomponents/p-09c79c1d.entry.js +5 -0
  482. package/dist/webcomponents/p-0fc112fc.entry.js +5 -0
  483. package/dist/webcomponents/p-13babfc4.entry.js +5 -0
  484. package/dist/webcomponents/p-15022ab7.entry.js +5 -0
  485. package/dist/webcomponents/p-172d42c2.entry.js +5 -0
  486. package/dist/webcomponents/p-18cf093a.entry.js +5 -0
  487. package/dist/webcomponents/p-198aa844.entry.js +5 -0
  488. package/dist/webcomponents/p-1ba60d13.entry.js +5 -0
  489. package/dist/webcomponents/p-1bb96641.entry.js +5 -0
  490. package/dist/webcomponents/{p-7acf20d3.entry.js → p-20477061.entry.js} +1 -1
  491. package/dist/webcomponents/p-21feda62.entry.js +5 -0
  492. package/dist/webcomponents/p-23a5cfd7.entry.js +5 -0
  493. package/dist/webcomponents/{p-030c02f8.entry.js → p-2c8595d3.entry.js} +1 -1
  494. package/dist/webcomponents/{p-09770c98.entry.js → p-31a4694a.entry.js} +1 -1
  495. package/dist/webcomponents/p-32ea6342.entry.js +5 -0
  496. package/dist/webcomponents/p-3658adcf.entry.js +5 -0
  497. package/dist/webcomponents/p-37914e63.entry.js +5 -0
  498. package/dist/webcomponents/p-3b0dd0ff.entry.js +5 -0
  499. package/dist/webcomponents/p-42b60169.entry.js +5 -0
  500. package/dist/webcomponents/p-42c9c6c5.entry.js +5 -0
  501. package/dist/{components/p-SvVnvJdC.js → webcomponents/p-473561f2.entry.js} +1 -1
  502. package/dist/webcomponents/p-47c490ef.entry.js +5 -0
  503. package/dist/webcomponents/p-4b01c60f.entry.js +5 -0
  504. package/dist/webcomponents/p-5a5ed7d8.entry.js +5 -0
  505. package/dist/webcomponents/{p-c8b7bbab.entry.js → p-5a7c2031.entry.js} +1 -1
  506. package/dist/webcomponents/p-609cf652.entry.js +5 -0
  507. package/dist/webcomponents/p-614683d9.entry.js +5 -0
  508. package/dist/webcomponents/p-67605757.entry.js +5 -0
  509. package/dist/{components/p-CppRJiyC.js → webcomponents/p-67774920.entry.js} +1 -1
  510. package/dist/webcomponents/p-67d62559.entry.js +5 -0
  511. package/dist/webcomponents/p-695dbeb0.entry.js +5 -0
  512. package/dist/webcomponents/{p-CfuJQ1DY.js → p-6Da1SZ3J.js} +1 -1
  513. package/dist/webcomponents/p-6a293be8.entry.js +5 -0
  514. package/dist/webcomponents/{p-03359c92.entry.js → p-6f1a4fbe.entry.js} +1 -1
  515. package/dist/webcomponents/p-7352d459.entry.js +5 -0
  516. package/dist/webcomponents/p-745213f7.entry.js +5 -0
  517. package/dist/webcomponents/p-794b701b.entry.js +5 -0
  518. package/dist/webcomponents/{p-d826c052.entry.js → p-7ee564a1.entry.js} +1 -1
  519. package/dist/webcomponents/{p-e20188c0.entry.js → p-7fda8b89.entry.js} +1 -1
  520. package/dist/webcomponents/p-8116ee93.entry.js +5 -0
  521. package/dist/webcomponents/p-821341dc.entry.js +5 -0
  522. package/dist/webcomponents/p-8aa6f07c.entry.js +5 -0
  523. package/dist/webcomponents/p-8ddf3ce3.entry.js +5 -0
  524. package/dist/webcomponents/p-95f3c44a.entry.js +5 -0
  525. package/dist/webcomponents/p-96dbb585.entry.js +5 -0
  526. package/dist/webcomponents/p-9815ab95.entry.js +5 -0
  527. package/dist/webcomponents/{p-327f034f.entry.js → p-9e0324a7.entry.js} +1 -1
  528. package/dist/webcomponents/p-B7bNfmgh.js +5 -0
  529. package/dist/webcomponents/p-BYsh2ZdE.js +5 -0
  530. package/dist/webcomponents/p-BkWWrDEr.js +5 -0
  531. package/dist/webcomponents/p-CJipT0in.js +5 -0
  532. package/dist/webcomponents/{p-Dcn7tRST.js → p-ConyRdJe.js} +1 -1
  533. package/dist/webcomponents/{p-BtRPYRvA.js → p-DDc4sADe.js} +1 -1
  534. package/dist/webcomponents/p-a038be16.entry.js +5 -0
  535. package/dist/webcomponents/p-a32d17cb.entry.js +5 -0
  536. package/dist/webcomponents/p-a46f068e.entry.js +5 -0
  537. package/dist/webcomponents/p-a89b684d.entry.js +5 -0
  538. package/dist/webcomponents/{p-abaf2365.entry.js → p-ac68355e.entry.js} +1 -1
  539. package/dist/webcomponents/{p-ed5af0e4.entry.js → p-af888d13.entry.js} +1 -1
  540. package/dist/webcomponents/p-b0124459.entry.js +5 -0
  541. package/dist/webcomponents/p-b063c12f.entry.js +5 -0
  542. package/dist/webcomponents/p-b07bfdc5.entry.js +5 -0
  543. package/dist/webcomponents/{p-f558d7b9.entry.js → p-b55425b7.entry.js} +1 -1
  544. package/dist/webcomponents/{p-a0931550.entry.js → p-b5d25332.entry.js} +1 -1
  545. package/dist/webcomponents/p-b609b464.entry.js +5 -0
  546. package/dist/webcomponents/p-b66ab52d.entry.js +5 -0
  547. package/dist/webcomponents/p-b8d4ace3.entry.js +5 -0
  548. package/dist/webcomponents/p-c717c745.entry.js +5 -0
  549. package/dist/webcomponents/p-ce3d689c.entry.js +5 -0
  550. package/dist/webcomponents/p-d08b6266.entry.js +5 -0
  551. package/dist/webcomponents/p-d6165aa0.entry.js +5 -0
  552. package/dist/webcomponents/{p-01fb0754.entry.js → p-dacb7e2c.entry.js} +1 -1
  553. package/dist/webcomponents/p-db309a11.entry.js +5 -0
  554. package/dist/webcomponents/{p-edc6da0e.entry.js → p-dc23cb2e.entry.js} +1 -1
  555. package/dist/webcomponents/p-e241caf3.entry.js +5 -0
  556. package/dist/webcomponents/p-e661c024.entry.js +5 -0
  557. package/dist/webcomponents/p-e7107869.entry.js +5 -0
  558. package/dist/webcomponents/p-eb94199d.entry.js +5 -0
  559. package/dist/webcomponents/p-f8993ae4.entry.js +5 -0
  560. package/dist/webcomponents/{p-670e8fec.entry.js → p-f99d8c9c.entry.js} +1 -1
  561. package/dist/webcomponents/{p-DV-iW9Aj.js → p-fOJu6uZR.js} +1 -1
  562. package/dist/webcomponents/{p-a212fd85.entry.js → p-fb76b1e0.entry.js} +1 -1
  563. package/dist/webcomponents/p-fdcb54a3.entry.js +5 -0
  564. package/dist/webcomponents/{p-e3de5bb3.entry.js → p-fed02286.entry.js} +1 -1
  565. package/dist/webcomponents/p-zlORkiHQ.js +5 -0
  566. package/dist/webcomponents/webcomponents.esm.js +1 -1
  567. package/package.json +2 -2
  568. package/dist/components/p-B0o70fWP.js +0 -5
  569. package/dist/components/p-B96LROz9.js +0 -5
  570. package/dist/components/p-BDqef5-y.js +0 -5
  571. package/dist/components/p-BP5zMCxG.js +0 -5
  572. package/dist/components/p-BRaphxoP.js +0 -5
  573. package/dist/components/p-BUzBa9L1.js +0 -5
  574. package/dist/components/p-BblZlUp2.js +0 -5
  575. package/dist/components/p-Bc4nAk5i.js +0 -5
  576. package/dist/components/p-Bezou5CQ.js +0 -5
  577. package/dist/components/p-BrNh9KdF.js +0 -5
  578. package/dist/components/p-C5th2dxu.js +0 -5
  579. package/dist/components/p-CEdUp183.js +0 -5
  580. package/dist/components/p-CF7t0uxQ.js +0 -5
  581. package/dist/components/p-CFzHx6zV.js +0 -5
  582. package/dist/components/p-CG4em0S6.js +0 -5
  583. package/dist/components/p-CI4D3-pf.js +0 -5
  584. package/dist/components/p-CIrVPkVg.js +0 -5
  585. package/dist/components/p-CdDwqbBv.js +0 -5
  586. package/dist/components/p-Cvk1Ggs5.js +0 -5
  587. package/dist/components/p-D12US39c.js +0 -5
  588. package/dist/components/p-DGPJkJsj.js +0 -5
  589. package/dist/components/p-DX1wAFn4.js +0 -5
  590. package/dist/components/p-DpRZ4B0d.js +0 -5
  591. package/dist/components/p-G35qEQZd.js +0 -5
  592. package/dist/components/p-Ho_IybzR.js +0 -5
  593. package/dist/components/p-emAWunES.js +0 -5
  594. package/dist/components/p-fB79wKCm.js +0 -5
  595. package/dist/components/p-k7p4QJ8a.js +0 -5
  596. package/dist/webcomponents/p-01baafce.entry.js +0 -5
  597. package/dist/webcomponents/p-0b9714f1.entry.js +0 -5
  598. package/dist/webcomponents/p-12aa36a8.entry.js +0 -5
  599. package/dist/webcomponents/p-130b6e06.entry.js +0 -5
  600. package/dist/webcomponents/p-144f8c8d.entry.js +0 -5
  601. package/dist/webcomponents/p-14fe22e2.entry.js +0 -5
  602. package/dist/webcomponents/p-1ff9210a.entry.js +0 -5
  603. package/dist/webcomponents/p-2605cdc3.entry.js +0 -5
  604. package/dist/webcomponents/p-27afaec9.entry.js +0 -5
  605. package/dist/webcomponents/p-2a50e42d.entry.js +0 -5
  606. package/dist/webcomponents/p-342650b8.entry.js +0 -5
  607. package/dist/webcomponents/p-38f6a78b.entry.js +0 -5
  608. package/dist/webcomponents/p-3920fe3a.entry.js +0 -5
  609. package/dist/webcomponents/p-3ae97345.entry.js +0 -5
  610. package/dist/webcomponents/p-3cce767c.entry.js +0 -5
  611. package/dist/webcomponents/p-3df6c5d2.entry.js +0 -5
  612. package/dist/webcomponents/p-3e287899.entry.js +0 -5
  613. package/dist/webcomponents/p-3e5580ba.entry.js +0 -5
  614. package/dist/webcomponents/p-403637dd.entry.js +0 -5
  615. package/dist/webcomponents/p-435c8ef2.entry.js +0 -5
  616. package/dist/webcomponents/p-59da5b55.entry.js +0 -5
  617. package/dist/webcomponents/p-5dd4314c.entry.js +0 -5
  618. package/dist/webcomponents/p-646af6a5.entry.js +0 -5
  619. package/dist/webcomponents/p-68046544.entry.js +0 -5
  620. package/dist/webcomponents/p-68ec76b8.entry.js +0 -5
  621. package/dist/webcomponents/p-6c0ea20c.entry.js +0 -5
  622. package/dist/webcomponents/p-707df9b9.entry.js +0 -5
  623. package/dist/webcomponents/p-72b839fe.entry.js +0 -5
  624. package/dist/webcomponents/p-73dcc05b.entry.js +0 -5
  625. package/dist/webcomponents/p-7b01bddb.entry.js +0 -5
  626. package/dist/webcomponents/p-7cd38850.entry.js +0 -5
  627. package/dist/webcomponents/p-82454383.entry.js +0 -5
  628. package/dist/webcomponents/p-91e959a8.entry.js +0 -5
  629. package/dist/webcomponents/p-964c01e6.entry.js +0 -5
  630. package/dist/webcomponents/p-9858e42a.entry.js +0 -5
  631. package/dist/webcomponents/p-9c4200b0.entry.js +0 -5
  632. package/dist/webcomponents/p-9d9c87b1.entry.js +0 -5
  633. package/dist/webcomponents/p-B0PbhaxL.js +0 -5
  634. package/dist/webcomponents/p-D3tVP32U.js +0 -5
  635. package/dist/webcomponents/p-a2e75143.entry.js +0 -5
  636. package/dist/webcomponents/p-a3bb98c9.entry.js +0 -5
  637. package/dist/webcomponents/p-a8b5dba0.entry.js +0 -5
  638. package/dist/webcomponents/p-aa909443.entry.js +0 -5
  639. package/dist/webcomponents/p-aeb16645.entry.js +0 -5
  640. package/dist/webcomponents/p-b287c384.entry.js +0 -5
  641. package/dist/webcomponents/p-b506b0a1.entry.js +0 -5
  642. package/dist/webcomponents/p-b520c08c.entry.js +0 -5
  643. package/dist/webcomponents/p-b94c3f84.entry.js +0 -5
  644. package/dist/webcomponents/p-bda62f90.entry.js +0 -5
  645. package/dist/webcomponents/p-c201ae16.entry.js +0 -5
  646. package/dist/webcomponents/p-c7e899a1.entry.js +0 -5
  647. package/dist/webcomponents/p-cbf3e251.entry.js +0 -5
  648. package/dist/webcomponents/p-d35cf5b4.entry.js +0 -5
  649. package/dist/webcomponents/p-d45ffe9c.entry.js +0 -5
  650. package/dist/webcomponents/p-d719a4af.entry.js +0 -5
  651. package/dist/webcomponents/p-da21a60d.entry.js +0 -5
  652. package/dist/webcomponents/p-de0c7f26.entry.js +0 -5
  653. package/dist/webcomponents/p-e27882e1.entry.js +0 -5
  654. package/dist/webcomponents/p-e624ff04.entry.js +0 -5
  655. package/dist/webcomponents/p-f24fcf3d.entry.js +0 -5
  656. package/dist/webcomponents/p-f52ef0dc.entry.js +0 -5
  657. package/dist/webcomponents/p-fcab1428.entry.js +0 -5
  658. package/dist/webcomponents/p-fe1729a7.entry.js +0 -5
@@ -9,48 +9,52 @@ import { set } from "date-fns/set";
9
9
  import { toDate } from "date-fns/toDate";
10
10
  import { dispatchNativeFormEvent } from "../../shared/utils/event";
11
11
  import { getFormValidationState, isFormControlDisabled, setFormValidity, } from "../../shared/utils/form";
12
- import { generateUniqueId } from "../../shared/utils/id";
13
- import { reportInvalidPropValue } from "../../shared/utils/prop-warning";
12
+ import Helpers from "../../shared/utils/helpers";
14
13
  import { hasAssignedSlotContent } from "../../shared/utils/slot";
15
14
  import { resolveSsrLocalDate } from "../../shared/utils/ssr-date";
16
15
  import { resolveFormValidator, runFormValidator } from "../../shared/utils/validator";
17
- import { DATETIME_PICKER_LOCALE, DATETIME_PICKER_MODE } from "./datetime-picker-constants";
16
+ import { DATETIME_PICKER_LOCALE, DATETIME_PICKER_MODE, DATETIME_RANGE_ORDER_MESSAGE, } from "./datetime-picker-constants";
18
17
  import { hasDatetimePickerMissingValue, parseDatetimePickerSerializedRange, parseDatetimePickerSerializedValue, serializeDatetimePickerFormValue, } from "./datetime-picker-form-associated";
19
- import { isValidDatetimePickerDateRange, normalizeDatetimePickerDisabledDates, normalizeDatetimePickerInitialMoment, normalizeDatetimePickerMode, normalizeDatetimePickerSelectionMode, normalizeDatetimePickerWeekStartsOn, } from "./datetime-picker-props-validation";
18
+ import { normalizeDatetimePickerDisabledDates, normalizeDatetimePickerInitialMoment, normalizeDatetimePickerMode, normalizeDatetimePickerSelectionMode, normalizeDatetimePickerWeekStartsOn, } from "./datetime-picker-props-validation";
20
19
  /**
21
- * O componente `br-datetime-picker` é o orquestrador completo do GovBR-DS para seleção e digitação de datas, horários ou intervalos combinados. Ele integra-se nativamente a formulários HTML via `formAssociated` e oferece suporte WAI-ARIA para diálogos e calendários.
20
+ * O `br-datetime-picker` é o controle completo do GovBR-DS para digitação e seleção visual de datas e horários. Orquestra o campo textual e os seletores internos, consolidando valor, validação e integração com formulários HTML.
22
21
  *
23
22
  * ### Para que serve
24
23
  *
25
- * - **Seleção completa de data e horário:** Reúne em um único controle o campo de entrada com máscara formatada (`br-datetime-input`), o calendário de seleção de datas (`br-date-picker`) e o seletor de horários (`br-time-picker`).
26
- * - **Múltiplos modos operacionais:** Suporta data simples, intervalo de datas (`range`), apenas hora (`time`), data e hora combinadas (`datetime`) e datas múltiplas.
27
- * - **Validação e formulários nativos:** Valida datas mínimas (`min`), máximas (`max`), formatos permitidos e comunica valores estruturados diretamente ao formulário pai.
24
+ * - Oferece os modos `date`, `time` e `datetime`, com seleção única (`single`) ou de intervalo (`range`).
25
+ * - Combina edição textual com máscara, calendário e ajuste de horas e minutos conforme o modo escolhido.
26
+ * - Centraliza restrições de seleção, validação e submissão do valor por meio de `formAssociated`.
28
27
  *
29
28
  * ### Quando utilizar
30
29
  *
31
- * - **Utilize quando:**
32
- * - O formulário exigir preenchimento de datas ou horários onde tanto a digitação manual rápida quanto a exploração visual no calendário agreguem valor à experiência.
33
- * - For necessário selecionar um período com data de início e fim.
34
- * - **Evite e prefira outro componente quando:**
35
- * - A data for estritamente de nascimento ou emissão de documento onde a pessoa usuária sabe os dígitos de cor e prefere digitar apenas números (prefira `br-input` com máscara numérica).
30
+ * - Utilize quando o formulário precisar de um controle completo de data ou horário com digitação e seleção visual.
31
+ * - Utilize para períodos com início e fim, inclusive com horários nos modos `time` e `datetime`.
32
+ * - Evite quando precisar apenas apresentar uma data: prefira texto formatado.
33
+ * - Para um calendário permanentemente visível sem o campo textual, considere `br-date-picker`; a aplicação assume a integração com o restante do formulário.
34
+ * - A seleção não oferece uma coleção de datas independentes: use `single` para um valor ou `range` para um intervalo.
36
35
  *
37
36
  * ### Composição e Subcomponentes
38
37
  *
39
- * | Subcomponente | Papel | Regra de uso |
38
+ * | Componente | Papel | Regra de uso |
40
39
  * | --- | --- | --- |
41
- * | `br-datetime-picker` | **Orquestrador principal.** Gerencia valor consolidado, validação, abertura do popup e sincronização entre input e calendário. | Deve ser o único controle declarado no template da aplicação na quase totalidade dos casos. |
42
- * | `br-datetime-input` | **Campo com máscara.** Exibe o valor formatado e permite digitação manual. | Coordenado automaticamente pelo pai; use avulso apenas em composições customizadas. |
43
- * | `br-date-picker` | **Calendário de datas.** Painel visual com grade de dias, meses e anos. | Coordenado pelo pai; use avulso se precisar de calendário estático embutido. |
44
- * | `br-time-picker` | **Seletor de horário.** Controle de escolha de horas e minutos. | Coordenado pelo pai; use avulso se precisar apenas de seletor de hora sem data. |
40
+ * | `br-datetime-picker` | Orquestrador do valor consolidado, validação, formulário e abertura do painel. | Declare este controle no template para obter a composição completa. |
41
+ * | `br-datetime-input` | Campo textual com máscara, interpretação da entrada e ação de abertura do painel. | Instanciado internamente pelo pai; não deve ser fornecido em slot. |
42
+ * | `br-date-picker` | Calendário para navegação e seleção de data única ou intervalo. | Criado pelo pai nos modos `date` e `datetime`; pode ser usado isoladamente como calendário embutido. |
43
+ * | `br-time-picker` | Controles de hora e minuto. | Criado pelo pai nos modos `time` e `datetime`, com uma instância por limite quando a seleção é `range`. |
44
+ *
45
+ * O slot `feedback` recebe conteúdo declarativo de validação, normalmente um `br-message`; não substitui os seletores internos.
45
46
  *
46
47
  * ### Como os subcomponentes se relacionam
47
48
  *
48
- * O `br-datetime-picker` funciona como o modelo pronto: ele instancia e sincroniza internamente o campo textual (`br-datetime-input`) e os seletores visuais suspensos (`br-date-picker` e/ou `br-time-picker`). A aplicação consome os eventos unificados emitidos diretamente pelo orquestrador pai (`change`, `input`).
49
+ * O pai fornece valores e configurações aos filhos por propriedades e consolida suas alterações por eventos DOM. O campo textual solicita a abertura do painel; o calendário e os controles de horário atualizam a seleção compartilhada, sem coordenar diretamente uns aos outros.
50
+ *
51
+ * `referenceDate` representa a referência de navegação visual, distinta da seleção efetiva. O orquestrador mantém o campo textual, os seletores e o valor de formulário sincronizados. A aplicação consome o valor e os eventos do pai, incluindo `brDatetimePickerChange` para a seleção completa e tipada.
49
52
  *
50
- * Para a documentação completa de design, incluindo diretrizes de acessibilidade e especificações visuais, consulte o [Design System do GovBR](https://www.gov.br/ds/components/datetime-picker?tab=designer).
53
+ * O uso isolado dos filhos exige que a aplicação assuma a coordenação de estado, validação e formulário; eles não herdam a associação nativa ao formulário do `br-datetime-picker`.
51
54
  *
52
-
53
- * @category Formulários, Seleção
55
+ * Para a documentação completa de design, incluindo diretrizes de uso, acessibilidade e exemplos visuais, consulte o [Design System do GovBR](https://www.gov.br/ds/components/datetimepicker?tab=designer).
56
+ *
57
+ * @category Formulários
54
58
  * @status stable
55
59
  * @slot feedback - Mensagem de validação, normalmente um `br-message`.
56
60
  * @part container - Parte para o container base do seletor.
@@ -63,188 +67,334 @@ import { isValidDatetimePickerDateRange, normalizeDatetimePickerDisabledDates, n
63
67
  export class DatetimePicker {
64
68
  constructor() {
65
69
  /**
66
- * Controla se o conteúdo do picker está visível.
67
- */
68
- this.isPickerOpen = false;
69
- this.formDisabled = false;
70
- this.hasFeedbackSlot = false;
71
- this.customValidationMessage = '';
72
- this.validatorMessage = null;
73
- this.isValidating = false;
74
- this.feedbackId = generateUniqueId('br-datetime-picker-feedback');
75
- /** Lista normalizada de datas indisponíveis para seleção. */
76
- this.normalizedDisabledDates = [];
77
- /** Data final selecionada no modo de intervalo. */
78
- this.rangeEnd = null;
79
- /** Data inicial selecionada no modo de intervalo. */
80
- this.rangeStart = null;
81
- /**
82
- * Mantém a data de referência que orienta a navegação visual do calendário.
83
- */
84
- this.referenceDate = new Date();
85
- /**
86
- * Define o modo de seleção exibido pelo componente: data, horário ou ambos.
70
+ * Modo exibido pelo componente.
87
71
  *
88
- * Valores aceitos: `date`, `time` ou `datetime`.
89
- * Valores inválidos são corrigidos automaticamente para o valor padrão,
90
- * mantendo o atributo refletido sempre consistente com o modo exibido.
72
+ * Valores: `date` | `time` | `datetime`.
73
+ * Valores inválidos são normalizados para o padrão.
91
74
  *
92
75
  * @default 'datetime'
93
76
  */
94
77
  this.mode = DATETIME_PICKER_MODE.DEFAULT;
95
78
  /**
96
- * Define o locale usado pelos subcomponentes para formatar datas e rótulos.
79
+ * Locale usado para formatação e rótulos.
97
80
  *
98
81
  * @default 'pt-BR'
99
82
  */
100
83
  this.locale = DATETIME_PICKER_LOCALE.DEFAULT;
101
84
  /**
102
- * Define o placeholder exibido no campo de entrada do datetime picker.
85
+ * Texto placeholder exibido no input.
103
86
  *
104
87
  * @default ''
105
88
  */
106
89
  this.placeholder = '';
107
- /** Nome do campo para submissão em formulários nativos. */
90
+ /**
91
+ * Nome do campo para submissão em formulários nativos.
92
+ *
93
+ * @default ''
94
+ */
108
95
  this.name = '';
109
- /** Indica se o campo deve ter valor antes do envio do formulário. */
96
+ /**
97
+ * Indica se o campo é requerido para submissão do formulário.
98
+ *
99
+ * @default false
100
+ */
110
101
  this.required = false;
111
102
  /**
112
- * Menor data/horário aceito, interpretado conforme `mode`. Valores inválidos são ignorados.
113
- * Aceita texto no atributo HTML ou uma instância de `Date` por property binding.
103
+ * Menor data/hora aceito (Date | string | null).
114
104
  *
115
- * @example
116
- * ```html
117
- * <br-datetime-picker mode="date" min="2026-01-01"></br-datetime-picker>
118
- * ```
105
+ * @default null
119
106
  */
120
107
  this.min = null;
121
108
  /**
122
- * Maior data/horário aceito, interpretado conforme `mode`. Valores inválidos são ignorados.
123
- * Aceita texto no atributo HTML ou uma instância de `Date` por property binding.
109
+ * Maior data/hora aceito (Date | string | null).
124
110
  *
125
- * @example
126
- * ```html
127
- * <br-datetime-picker mode="date" max="2026-12-31"></br-datetime-picker>
128
- * ```
111
+ * @default null
129
112
  */
130
113
  this.max = null;
131
114
  /**
132
- * Define o tipo de seleção de datas para o calendário: única ou intervalo.
115
+ * Tipo de seleção: `single` ou `range`.
133
116
  *
134
- * `range` só funciona em conjunto com `mode="date"`.
135
- * Se `selectionMode="range"` for informado, o componente ajusta automaticamente
136
- * `mode` para `date`. Se `mode` mudar para `time` ou `datetime`, o componente
137
- * normaliza `selectionMode` para `single` quando necessário.
138
- * Valores inválidos usam `single`.
117
+ * @default 'single'
139
118
  */
140
119
  this.selectionMode = 'single';
141
120
  /**
142
- * Define o dia inicial da semana exibida no calendário.
143
- *
144
- * Valores suportados: 0 (domingo) a 6 (sábado).
121
+ * Dia inicial da semana exibido no calendário (0 = Dom, 6 = Sáb).
145
122
  *
146
123
  * @default 0
147
124
  */
148
125
  this.weekStartsOn = 0;
149
126
  /**
150
- * Define a seleção inicial do componente.
151
- *
152
- * Aceita:
153
- * - `'now'`: seleciona o momento atual.
154
- * - `Date` ou `string`: seleciona uma data arbitrária.
155
- * - `null`: inicia sem seleção.
156
- *
157
- * Reativo em runtime: mudanças na prop atualizam estado e subcomponentes.
127
+ * Valor inicial da seleção: `'now' | Date | string | null`.
158
128
  *
159
129
  * @default null
160
- * @example
161
- * ```html
162
- * <br-datetime-picker initial-moment="now"></br-datetime-picker>
163
- * ```
164
130
  */
165
131
  this.initialMoment = null;
166
132
  /**
167
- * Instância de `Date` selecionada pelo usuário no modo simples.
168
- * Pode ser controlada por property binding e é atualizada pelo evento `valueChange`.
169
- * Para formulários e atributos textuais, use `serializedValue`.
133
+ * Valor selecionado pelo usuário (Date | null).
170
134
  *
171
- * @example
172
- * ```js
173
- * const picker = document.querySelector('br-datetime-picker');
174
- * picker.value = new Date(2026, 8, 7, 14, 30);
175
- * ```
135
+ * Pode ser controlado externamente e é refletido internamente.
136
+ *
137
+ * @default null
176
138
  */
177
139
  this.value = null;
178
140
  /**
179
141
  * Desabilita toda a interação do componente.
180
142
  *
181
- * Quando `true`, impede abrir o picker, alterar valores e navegar entre datas/horários.
182
- *
183
143
  * @default false
184
144
  */
185
145
  this.disabled = false;
186
146
  /**
187
- * Define um conjunto de datas indisponíveis para seleção.
147
+ * Datas indisponíveis para seleção. Aceita `Date[]`, `string` ou `null`.
188
148
  *
189
- * Aceita uma lista de `Date` e/ou strings analisáveis, ou uma string com datas
190
- * separadas por espaço em branco. Datas inválidas são ignoradas com warning.
191
- * A comparação considera apenas o dia (ano/mês/dia), ignorando hora.
149
+ * Datas inválidas são ignoradas. A comparação considera apenas o dia.
192
150
  *
193
151
  * @default null
194
- * @example
195
- * ```html
196
- * <br-datetime-picker mode="date" disabled-dates="2026-09-07 2026-09-08"></br-datetime-picker>
197
- * ```
198
- * @example
199
- * ```js
200
- * const picker = document.querySelector('br-datetime-picker');
201
- * picker.disabledDates = [new Date(2026, 8, 7), '2026-09-08'];
202
- * ```
203
152
  */
204
153
  this.disabledDates = null;
205
154
  /**
206
- * Define se o calendário deve manter um número fixo de linhas (6 semanas = 42 dias)
207
- * ou variar conforme o mês.
208
- *
209
- * Quando `true`, o calendário sempre exibe 6 semanas completas.
210
- * Quando `false`, o calendário adapta-se ao mês, exibindo apenas as semanas necessárias.
155
+ * Mantém número fixo de linhas no calendário (6 semanas) quando `true`.
211
156
  *
212
157
  * @default false
213
158
  */
214
159
  this.fixedRowCount = false;
215
- /** Snapshot da seleção inicial usada para restaurar em reset de formulário. */
160
+ /**
161
+ * Controla se o conteúdo do picker está visível.
162
+ *
163
+ * @internal Estado reativo interno; não usar externamente.
164
+ */
165
+ this.isPickerOpen = false;
166
+ /**
167
+ * Indica se o formulário associado desabilitou o componente.
168
+ *
169
+ * @internal Estado reativo interno.
170
+ */
171
+ this.formDisabled = false;
172
+ /**
173
+ * Indica se existe slot `feedback` presente no host.
174
+ *
175
+ * @internal Estado reativo interno.
176
+ */
177
+ this.hasFeedbackSlot = false;
178
+ /**
179
+ * Mensagem de validação customizada definida por `setCustomValidity`.
180
+ *
181
+ * @internal Estado reativo interno.
182
+ */
183
+ this.customValidationMessage = '';
184
+ /**
185
+ * Mensagem retornada pelo validator customizado, se houver.
186
+ *
187
+ * @internal Estado reativo interno.
188
+ */
189
+ this.validatorMessage = null;
190
+ /**
191
+ * Mensagem textual de validação proveniente do input interno.
192
+ *
193
+ * @internal Estado reativo interno.
194
+ */
195
+ this.inputValidationMessage = '';
196
+ /**
197
+ * Indica que o usuário está editando o texto do input e que a validação
198
+ * textual está pendente (mensagem escondida até commit/blur).
199
+ *
200
+ * @internal
201
+ */
202
+ this.inputValidationPending = false;
203
+ /**
204
+ * Indicador de execução do validator assíncrono.
205
+ *
206
+ * @internal Estado reativo interno.
207
+ */
208
+ this.isValidating = false;
209
+ /**
210
+ * Lista normalizada de datas indisponíveis para seleção.
211
+ *
212
+ * @internal Mantida em formato `Date[]` para uso interno pelo calendário.
213
+ */
214
+ this.normalizedDisabledDates = [];
215
+ /**
216
+ * Data final selecionada no modo de intervalo.
217
+ *
218
+ * @internal Estado reativo interno.
219
+ */
220
+ this.rangeEnd = null;
221
+ /**
222
+ * Data inicial selecionada no modo de intervalo.
223
+ *
224
+ * @internal Estado reativo interno.
225
+ */
226
+ this.rangeStart = null;
227
+ /**
228
+ * Data de referência usada para navegação visual (mês/semana exibidos).
229
+ *
230
+ * @internal Controle de navegação do calendário.
231
+ */
232
+ this.referenceDate = new Date();
233
+ /**
234
+ * ID único do contêiner de feedback interno.
235
+ * Gerado por `Helpers.generateUniqueId` no momento da criação da instância
236
+ * e usado para associar mensagens de validação ao input interno.
237
+ *
238
+ * @internal
239
+ */
240
+ this.feedbackId = Helpers.generateUniqueId('br-datetime-picker-feedback');
241
+ /**
242
+ * Snapshot da seleção inicial usada para restaurar em reset de formulário.
243
+ * Mantém uma cópia imutável do valor original para `formResetCallback`.
244
+ *
245
+ * @internal
246
+ */
216
247
  this.initialFormValue = null;
248
+ /**
249
+ * Contador monótono usado para invalidar execuções assíncronas de validação.
250
+ * Incrementado antes de cada execução; resultados com `runId` diferente são ignorados.
251
+ *
252
+ * @internal
253
+ */
217
254
  this.validationRunId = 0;
255
+ /**
256
+ * Indica se o componente já completou o ciclo `componentDidLoad`.
257
+ * Evita executar lógica de inicialização mais de uma vez.
258
+ *
259
+ * @internal
260
+ */
218
261
  this.isInitialized = false;
262
+ /**
263
+ * Flag para evitar loops de sincronização entre `value`, `valueAsDate` e `serializedValue`.
264
+ * Setada temporariamente durante operações programáticas de sincronização.
265
+ *
266
+ * @internal
267
+ */
219
268
  this.syncingCanonicalValues = false;
220
- /** Mapeia cada modo para a função responsável por renderizar seu conteúdo. */
269
+ /**
270
+ * Flag que sinaliza atualizações internas em `rangeValue`.
271
+ * Usada para distinguir atribuições programáticas de alterações externas.
272
+ *
273
+ * @internal
274
+ */
275
+ this.syncingRangeValueInternally = false;
276
+ /**
277
+ * Mapeia cada modo para a função responsável por renderizar seu conteúdo.
278
+ * Facilita seleção de renderer sem condicionais espalhadas pelo código.
279
+ *
280
+ * @internal
281
+ */
221
282
  this.modeRendererMap = {
222
283
  [DATETIME_PICKER_MODE.DATE]: () => this.renderDatePicker(),
223
- [DATETIME_PICKER_MODE.TIME]: () => this.renderTimePicker(),
284
+ [DATETIME_PICKER_MODE.TIME]: () => this.selectionMode === 'range' ? this.renderRangeTimePickers() : this.renderTimePicker(),
224
285
  [DATETIME_PICKER_MODE.DATETIME]: () => this.renderDateTimePicker(),
225
286
  };
226
287
  /**
227
- * Sincroniza o estado local com a emissão dos subcomponentes de data e horário.
288
+ * Indica se o listener global de clique fora do componente está anexado.
289
+ * Evita anexações/remoções redundantes do mesmo handler.
290
+ *
291
+ * @internal
292
+ */
293
+ this.outsideClickListenerAttached = false;
294
+ /**
295
+ * Handler disparado por `br-datetime-input` para propagar mensagens de
296
+ * validação do input interno para o estado do componente.
297
+ *
298
+ * @param event CustomEvent<{ valid: boolean; message: string }> — detalhe com `valid` e `message`.
299
+ * @returns void
300
+ */
301
+ this.handleInputValidationChange = (event) => {
302
+ event.stopPropagation();
303
+ const valid = event.detail.valid;
304
+ if (valid === null) {
305
+ // usuário está editando: escondemos a mensagem visual, mas mantemos
306
+ // o estado de validade indefinido até commit/blur/enter
307
+ this.inputValidationMessage = '';
308
+ this.inputValidationPending = true;
309
+ }
310
+ else {
311
+ this.inputValidationMessage = valid ? '' : event.detail.message;
312
+ this.inputValidationPending = false;
313
+ }
314
+ this.syncFormValidity();
315
+ };
316
+ /**
317
+ * Handler principal que consolida eventos de `br-date-picker` / `br-time-picker`.
318
+ * Contém lógica de proteção contra valores desabilitados, navegação e emissão
319
+ * de eventos públicos apropriados.
228
320
  *
229
- * @param event - Evento com a data de referência e o valor selecionado.
321
+ * @param event CustomEvent<DatetimePickerDateState> — detalhe com `referenceDate`, `value` e `range`.
230
322
  */
231
323
  this.handleDateStateChange = (event) => {
232
- // Evita que o evento interno dos subcomponentes vaze para fora do host.
233
324
  event.stopPropagation();
234
325
  if (this.isDisabled()) {
235
326
  return;
236
327
  }
328
+ const origin = event.detail.origin;
329
+ if (origin !== 'BR-DATETIME-INPUT') {
330
+ this.inputValidationMessage = '';
331
+ }
237
332
  const { referenceDate, value, range } = event.detail;
333
+ if (this.isRangeNavigationState(value, range)) {
334
+ this.referenceDate = toDate(referenceDate);
335
+ this.updateFormInternals();
336
+ return;
337
+ }
238
338
  const selectedDate = this.resolveSelectedDateFromEvent(range, value);
239
339
  if (selectedDate !== null && this.isDateDisabled(selectedDate)) {
240
340
  return;
241
341
  }
242
342
  this.referenceDate = toDate(referenceDate);
243
343
  const shouldEmitPublicEvent = this.resolvePublicEventEmissionForRange(range);
244
- this.setComponentValue(value === null ? null : toDate(value), shouldEmitPublicEvent && this.isInitialized);
344
+ const nextValue = value === null ? null : toDate(value);
345
+ if (this.sameDate(this.value, nextValue)) {
346
+ this.handleUnchangedDateState(range, shouldEmitPublicEvent);
347
+ return;
348
+ }
349
+ this.setComponentValue(nextValue, shouldEmitPublicEvent && this.isInitialized);
350
+ this.emitPendingRangeChange(range, shouldEmitPublicEvent);
245
351
  };
352
+ /**
353
+ * Atualiza somente o horário de um dos limites do intervalo.
354
+ *
355
+ * @param boundary 'start' | 'end' — qual limite será atualizado.
356
+ * @param event CustomEvent<DatetimePickerDateState> — detalhe com novo `value`.
357
+ */
358
+ this.handleRangeTimeStateChange = (boundary, event) => {
359
+ event.stopPropagation();
360
+ if (this.isDisabled() || event.detail.value === null)
361
+ return;
362
+ const displayedStart = this.cloneDate(this.rangeStart ?? this.referenceDate);
363
+ const displayedEnd = this.cloneDate(this.rangeEnd ?? this.referenceDate);
364
+ if (this.rangeStart === null)
365
+ this.rangeStart = displayedStart;
366
+ if (this.rangeEnd === null)
367
+ this.rangeEnd = displayedEnd;
368
+ const selected = toDate(event.detail.value);
369
+ const current = boundary === 'start' ? this.rangeStart : this.rangeEnd;
370
+ const base = current ?? this.referenceDate;
371
+ const next = set(base, {
372
+ hours: selected.getHours(),
373
+ minutes: selected.getMinutes(),
374
+ seconds: 0,
375
+ milliseconds: 0,
376
+ });
377
+ if (boundary === 'start')
378
+ this.rangeStart = next;
379
+ else
380
+ this.rangeEnd = next;
381
+ const nextComponentValue = this.rangeEnd ?? this.rangeStart;
382
+ if (!this.sameDate(this.value, nextComponentValue)) {
383
+ this.value = this.cloneDate(nextComponentValue);
384
+ }
385
+ this.syncCanonicalValues();
386
+ if (this.isInitialized) {
387
+ this.emitDateStateChange();
388
+ void this.validate();
389
+ }
390
+ this.updateFormInternals();
391
+ };
392
+ this.handleRangeStartTimeStateChange = (event) => this.handleRangeTimeStateChange('start', event);
393
+ this.handleRangeEndTimeStateChange = (event) => this.handleRangeTimeStateChange('end', event);
246
394
  /**
247
395
  * Alterna visibilidade do picker quando o input solicita.
396
+ *
397
+ * @param event Event — evento de toggle vindo do input.
248
398
  */
249
399
  this.handleTogglePicker = (event) => {
250
400
  if (this.isDisabled()) {
@@ -254,11 +404,14 @@ export class DatetimePicker {
254
404
  const willOpen = !this.isPickerOpen;
255
405
  if (willOpen) {
256
406
  this.referenceDate = this.value === null ? toDate(new Date()) : toDate(this.value);
407
+ this.initializeTimeRangeBoundaries();
257
408
  }
258
409
  this.isPickerOpen = willOpen;
259
410
  };
260
411
  /**
261
412
  * Fecha o picker quando o clique acontece fora do host.
413
+ *
414
+ * @param event MouseEvent — clique ocorrido no documento.
262
415
  */
263
416
  this.handleOutsideClick = (event) => {
264
417
  const eventPath = event.composedPath();
@@ -267,7 +420,6 @@ export class DatetimePicker {
267
420
  }
268
421
  this.isPickerOpen = false;
269
422
  };
270
- this.outsideClickListenerAttached = false;
271
423
  /**
272
424
  * Fecha o picker ao pressionar Escape, devolvendo o foco ao input interno.
273
425
  *
@@ -278,42 +430,17 @@ export class DatetimePicker {
278
430
  return;
279
431
  event.stopPropagation();
280
432
  this.isPickerOpen = false;
281
- void this.focusInput();
433
+ this.getNativeInputElement()?.focus();
282
434
  };
283
435
  }
284
- formDisabledCallback(disabled) {
285
- this.formDisabled = disabled;
286
- }
287
- /** API nativa de reset de form-associated custom elements. */
288
- formResetCallback() {
289
- this.customValidationMessage = '';
290
- this.validatorMessage = null;
291
- this.validationRunId++;
292
- this.restoreSelection(this.initialFormValue);
293
- }
294
- /** API nativa de restauração de estado (histórico/autofill) do formulário. */
295
- formStateRestoreCallback(state) {
296
- if (typeof state !== 'string') {
297
- this.restoreSelection(null);
298
- return;
299
- }
300
- if (this.isRangeRestoreMode()) {
301
- this.restoreRangeStateFromSerialized(state);
302
- return;
303
- }
304
- this.restoreSingleStateFromSerialized(state);
305
- }
306
436
  /**
307
437
  * Revalida o modo sempre que a prop mudar.
308
438
  *
309
- * @param newValue - Valor recebido via atributo/prop.
439
+ * @param {string} newValue - Valor recebido via atributo/prop.
310
440
  */
311
441
  handleModeChange(newValue) {
312
442
  this.ensureValidMode(newValue);
313
- if (this.selectionMode === 'range' && this.mode !== DATETIME_PICKER_MODE.DATE) {
314
- this.selectionMode = 'single';
315
- return;
316
- }
443
+ this.initializeTimeRangeBoundaries();
317
444
  this.updateFormInternals();
318
445
  }
319
446
  /** Revalida o estado do formulário quando required mudar. */
@@ -330,14 +457,11 @@ export class DatetimePicker {
330
457
  /** Reage a mudanças no modo de seleção e limpa intervalo quando necessário. */
331
458
  handleSelectionModeChange(newValue) {
332
459
  this.ensureValidSelectionMode(newValue);
333
- if (this.selectionMode === 'range' && this.mode !== DATETIME_PICKER_MODE.DATE) {
334
- this.mode = DATETIME_PICKER_MODE.DATE;
335
- return;
336
- }
337
460
  if (this.selectionMode === 'single') {
338
461
  this.clearRangeState();
339
462
  return;
340
463
  }
464
+ this.initializeTimeRangeBoundaries();
341
465
  this.updateFormInternals();
342
466
  }
343
467
  /** Revalida o dia inicial da semana sempre que a prop mudar. */
@@ -347,13 +471,16 @@ export class DatetimePicker {
347
471
  /**
348
472
  * Aplica ou limpa a seleção da data atual conforme o novo valor da prop.
349
473
  *
350
- * @param newValue - Novo estado da prop.
474
+ * @param {DatetimePickerInitialMoment} newValue - Novo estado da prop.
351
475
  */
352
476
  handleInitialMomentChange(newValue) {
353
477
  this.applyInitialMoment(newValue, this.isInitialized);
354
478
  this.initialFormValue = this.cloneDate(this.value);
355
479
  }
356
480
  /** Sincroniza alterações externas do valor com o estado visual e o formulário nativo. */
481
+ /**
482
+ * @param {Date | null} newValue - Novo valor recebido via prop.
483
+ */
357
484
  handleValueChange(newValue) {
358
485
  const normalizedValue = newValue instanceof Date && !Number.isNaN(newValue.getTime()) ? toDate(newValue) : null;
359
486
  if (newValue !== null && normalizedValue === null) {
@@ -398,45 +525,33 @@ export class DatetimePicker {
398
525
  this.syncDisabledDates(newValue);
399
526
  }
400
527
  handleRangeValueChange(newValue) {
401
- if (!newValue || this.selectionMode !== 'range')
528
+ if (this.syncingRangeValueInternally || !newValue || this.selectionMode !== 'range')
402
529
  return;
403
- if (!isValidDatetimePickerDateRange(newValue)) {
404
- reportInvalidPropValue(this.el, 'rangeValue', newValue, 'Informe um objeto com `start` e `end` como Date válido ou null.', 'Mantendo o último intervalo efetivo.');
405
- return;
406
- }
407
530
  this.rangeStart = this.cloneDate(newValue.start);
408
531
  this.rangeEnd = this.cloneDate(newValue.end);
409
- const nextValue = newValue.end ?? newValue.start;
410
- this.referenceDate = nextValue ? toDate(nextValue) : this.referenceDate;
411
- this.setComponentValue(nextValue);
532
+ const nextValue = this.rangeEnd ?? this.rangeStart;
533
+ this.setComponentValue(nextValue, false);
412
534
  }
413
- /** Registra o listener global somente enquanto o picker está aberto. */
414
535
  connectedCallback() {
415
536
  if (this.isPickerOpen)
416
537
  this.attachOutsideClickListener();
417
538
  }
418
- /** Remove o listener global para evitar vazamento de eventos ao desmontar. */
419
- disconnectedCallback() {
420
- this.detachOutsideClickListener();
421
- }
422
- /**
423
- * Normaliza o modo antes da primeira renderização e aplica a data atual quando solicitado.
424
- */
425
539
  componentWillLoad() {
426
- // A inicialização dos defaults sincroniza os espelhos; preserve as entradas do consumidor.
427
- const { serializedValue, valueAsDate } = this;
540
+ const initialSerializedValue = this.serializedValue;
541
+ const initialValueAsDate = this.valueAsDate;
428
542
  this.referenceDate = resolveSsrLocalDate(this.el, this.referenceDate);
429
543
  this.initializeMode();
430
544
  this.initializeSelectionMode();
431
545
  this.initializeWeekStartsOn();
432
546
  this.initializeDisabledDates();
433
547
  this.initializeDefaultValue();
434
- if (serializedValue !== undefined) {
435
- this.restoreSerializedValue(serializedValue);
548
+ if (initialSerializedValue !== undefined) {
549
+ this.restoreSerializedValue(initialSerializedValue);
436
550
  }
437
- else if (valueAsDate !== undefined) {
438
- this.handleValueAsDateChange(valueAsDate);
551
+ else if (initialValueAsDate !== undefined) {
552
+ this.handleValueAsDateChange(initialValueAsDate);
439
553
  }
554
+ this.initializeTimeRangeBoundaries(true);
440
555
  this.initialFormValue = this.cloneDate(this.value);
441
556
  this.syncCanonicalValues();
442
557
  this.updateFormInternals();
@@ -445,18 +560,58 @@ export class DatetimePicker {
445
560
  this.isInitialized = true;
446
561
  this.hasFeedbackSlot = this.el.querySelector('[slot="feedback"]') !== null;
447
562
  }
563
+ disconnectedCallback() {
564
+ this.detachOutsideClickListener();
565
+ }
566
+ formDisabledCallback(disabled) {
567
+ this.formDisabled = disabled;
568
+ }
569
+ /** Restaura o estado do componente quando o formulário é restaurado. */
570
+ formResetCallback() {
571
+ this.customValidationMessage = '';
572
+ this.validatorMessage = null;
573
+ this.inputValidationMessage = '';
574
+ this.validationRunId++;
575
+ this.restoreSelection(this.initialFormValue);
576
+ }
577
+ /**
578
+ * Restaura o estado do formulário (autofill / histórico).
579
+ *
580
+ * @param {string | File | FormData | null} state Estado serializado fornecido pelo navegador.
581
+ */
582
+ formStateRestoreCallback(state) {
583
+ if (typeof state !== 'string') {
584
+ this.restoreSelection(null);
585
+ return;
586
+ }
587
+ if (this.isRangeRestoreMode()) {
588
+ this.restoreRangeStateFromSerialized(state);
589
+ return;
590
+ }
591
+ this.restoreSingleStateFromSerialized(state);
592
+ }
448
593
  /**
449
- * Define programaticamente as datas desabilitadas por meio de array.
594
+ * Define programaticamente as datas desabilitadas.
450
595
  *
451
- * Útil quando o componente é usado via HTML e o consumidor precisa enviar
452
- * uma lista tipada em runtime.
596
+ * Use quando scripts externos precisam fornecer uma lista tipada de
597
+ * datas a bloquear no calendário. Substitui a prop `disabledDates` para
598
+ * atualizações imperativas.
453
599
  *
454
- * @param dates - Lista de datas (Date|string) a bloquear.
600
+ * @param dates Lista de datas (`Date` | `string`) a bloquear, ou `null` para limpar.
601
+ * @returns Promise<void> — resolve quando a atualização interna for aplicada.
455
602
  */
456
603
  async setDisabledDates(dates) {
457
604
  this.syncDisabledDates(dates);
458
605
  }
459
- /** Define o valor atual de forma imperativa aceitando Date, string serializada ou null. */
606
+ /**
607
+ * Define o valor do componente de forma imperativa.
608
+ *
609
+ * Aceita `Date`, string compatível com o `mode`, ou `null` para limpar a seleção.
610
+ * Validação de datas desabilitadas é aplicada antes da atribuição.
611
+ *
612
+ * @param value Date | string | null — valor a aplicar; `null` limpa a seleção.
613
+ * @returns Promise<void> — resolve quando o componente aplicar e sincronizar o valor.
614
+ */
460
615
  async setValue(value) {
461
616
  if (this.isDisabled()) {
462
617
  return;
@@ -473,18 +628,32 @@ export class DatetimePicker {
473
628
  this.referenceDate = nextValue === null ? toDate(new Date()) : toDate(nextValue);
474
629
  this.setComponentValue(nextValue);
475
630
  }
476
- /** Retorna uma cópia do valor selecionado atualmente. */
631
+ /**
632
+ * Retorna uma cópia do valor selecionado atualmente.
633
+ *
634
+ * @returns Promise<Date | null> — cópia imutável do `value` atual, ou `null`.
635
+ */
477
636
  async getValue() {
478
637
  return this.cloneDate(this.value);
479
638
  }
480
- /** Limpa valor e intervalo selecionados. */
639
+ /**
640
+ * Limpa valor e intervalo selecionados.
641
+ *
642
+ * Remove seleção atual e restaura a referência de navegação para a data atual.
643
+ *
644
+ * @returns Promise<void> — resolve após a limpeza e sincronização internas.
645
+ */
481
646
  async clear() {
482
647
  this.rangeStart = null;
483
648
  this.rangeEnd = null;
484
649
  this.referenceDate = toDate(new Date());
485
650
  this.setComponentValue(null);
486
651
  }
487
- /** Abre o picker quando o componente estiver habilitado. */
652
+ /**
653
+ * Abre o picker quando o componente estiver habilitado.
654
+ *
655
+ * @returns Promise<void> — resolve quando o estado visual for atualizado.
656
+ */
488
657
  async open() {
489
658
  if (this.isDisabled()) {
490
659
  return;
@@ -492,11 +661,19 @@ export class DatetimePicker {
492
661
  this.referenceDate = this.value === null ? toDate(new Date()) : toDate(this.value);
493
662
  this.isPickerOpen = true;
494
663
  }
495
- /** Fecha o picker. */
664
+ /**
665
+ * Fecha o picker.
666
+ *
667
+ * @returns Promise<void> — resolve após atualização do estado de visibilidade.
668
+ */
496
669
  async close() {
497
670
  this.isPickerOpen = false;
498
671
  }
499
- /** Alterna o estado de abertura do picker. */
672
+ /**
673
+ * Alterna o estado de abertura do picker.
674
+ *
675
+ * @returns Promise<void> — resolve quando a transição de estado terminar.
676
+ */
500
677
  async toggle() {
501
678
  if (this.isPickerOpen) {
502
679
  await this.close();
@@ -504,20 +681,32 @@ export class DatetimePicker {
504
681
  }
505
682
  await this.open();
506
683
  }
507
- /** Move o foco para o input nativo interno. */
684
+ /**
685
+ * Move o foco para o input nativo interno.
686
+ *
687
+ * @returns Promise<void> — resolve imediatamente após tentar focar o elemento.
688
+ */
508
689
  async focusInput() {
509
- const input = this.datetimeInputElement ?? this.el.shadowRoot?.querySelector('br-datetime-input');
510
- await input?.focusInput?.();
690
+ this.getNativeInputElement()?.focus();
511
691
  }
512
- /** Define intervalo de datas de forma imperativa, forçando modo date e selectionMode range. */
692
+ /**
693
+ * Define um intervalo no modo atual e ativa `selectionMode="range"`.
694
+ *
695
+ * Valida datas contra bloqueios e sincroniza estado visual e de formulário.
696
+ * Em `datetime`, mantém os limites informados e sinaliza intervalo inválido
697
+ * quando o término precede o início, sem ajustar datas automaticamente.
698
+ *
699
+ * @param start Date | string | null — data inicial do intervalo.
700
+ * @param end Date | string | null — data final do intervalo.
701
+ * @returns Promise<void> — resolve quando o intervalo for aplicado e sincronizado.
702
+ */
513
703
  async setRange(start, end) {
514
704
  if (this.isDisabled()) {
515
705
  return;
516
706
  }
517
707
  this.selectionMode = 'range';
518
- this.mode = DATETIME_PICKER_MODE.DATE;
519
- const normalizedStart = this.parseMethodValue(start, DATETIME_PICKER_MODE.DATE);
520
- const normalizedEnd = this.parseMethodValue(end, DATETIME_PICKER_MODE.DATE);
708
+ const normalizedStart = this.parseMethodValue(start, this.mode);
709
+ const normalizedEnd = this.parseMethodValue(end, this.mode);
521
710
  if ((normalizedStart !== null && this.isDateDisabled(normalizedStart)) ||
522
711
  (normalizedEnd !== null && this.isDateDisabled(normalizedEnd))) {
523
712
  this.clearRangeState();
@@ -525,17 +714,18 @@ export class DatetimePicker {
525
714
  }
526
715
  this.rangeStart = this.cloneDate(normalizedStart);
527
716
  this.rangeEnd = this.cloneDate(normalizedEnd);
528
- const nextValue = normalizedEnd ?? normalizedStart;
717
+ const nextValue = this.rangeEnd ?? this.rangeStart;
529
718
  this.referenceDate = nextValue === null ? toDate(new Date()) : toDate(nextValue);
530
719
  this.setComponentValue(nextValue);
531
720
  }
532
721
  /**
533
722
  * Retorna o intervalo de datas selecionado quando em modo `selectionMode="range"`.
534
723
  *
535
- * @returns Objeto com datas `start` e `end`, ou `null` se não estiver em modo range.
724
+ * @returns Promise<{ start: Date | null; end: Date | null } | null> — objeto com `start`/`end` ou `null` quando
725
+ * não estiver em modo `range`.
536
726
  */
537
727
  async getRange() {
538
- if (this.selectionMode !== 'range' || this.mode !== DATETIME_PICKER_MODE.DATE) {
728
+ if (this.selectionMode !== 'range') {
539
729
  return null;
540
730
  }
541
731
  return {
@@ -546,29 +736,52 @@ export class DatetimePicker {
546
736
  /**
547
737
  * Consulta se o picker está atualmente aberto.
548
738
  *
549
- * @returns `true` se o picker está visível, `false` caso contrário.
739
+ * @returns Promise<boolean> — `true` se o picker está visível, `false` caso contrário.
550
740
  */
551
741
  async isOpen() {
552
742
  return this.isPickerOpen;
553
743
  }
554
- /** Restaura o estado inicial atualmente registrado para reset. */
744
+ /**
745
+ * Restaura o estado inicial atualmente registrado para reset.
746
+ *
747
+ * @returns Promise<void> — resolve quando a seleção inicial for restaurada.
748
+ */
555
749
  async resetToInitial() {
556
750
  this.restoreSelection(this.initialFormValue);
557
751
  }
558
- /** Permite que consumidores acionem validação nativa do formulário via host. */
752
+ /**
753
+ * Permite que consumidores acionem validação nativa do formulário via host.
754
+ *
755
+ * @returns Promise<boolean> — resultado da Constraint Validation API para o host.
756
+ */
559
757
  async checkValidity() {
560
758
  return this.elementInternals.checkValidity();
561
759
  }
562
- /** Permite exibir mensagens nativas de validação no host. */
760
+ /**
761
+ * Permite exibir mensagens nativas de validação no host.
762
+ *
763
+ * @returns Promise<boolean> — `true` se a mensagem foi exibida e o formulário é válido.
764
+ */
563
765
  async reportValidity() {
564
766
  return this.elementInternals.reportValidity();
565
767
  }
566
- /** Define ou limpa uma mensagem de validade customizada. */
768
+ /**
769
+ * Define ou limpa uma mensagem de validade customizada.
770
+ *
771
+ * @param message string — mensagem de validação; string vazia remove a mensagem.
772
+ * @returns Promise<void> — resolve após sincronizar a validade no host.
773
+ */
567
774
  async setCustomValidity(message) {
568
775
  this.customValidationMessage = message;
569
776
  this.syncFormValidity();
570
777
  }
571
- /** Executa o validator do picker e retorna se a seleção atual é válida. */
778
+ /**
779
+ * Executa o validator customizado (se houver) e valida o controle.
780
+ *
781
+ * Emite eventos de início/conclusão da validação e atualiza mensagens internas.
782
+ *
783
+ * @returns Promise<boolean> — `true` se a seleção for considerada válida.
784
+ */
572
785
  async validate() {
573
786
  const validator = resolveFormValidator(this.validator);
574
787
  if (!validator || this.isDisabled())
@@ -577,9 +790,16 @@ export class DatetimePicker {
577
790
  this.isValidating = true;
578
791
  this.validatorMessage = null;
579
792
  this.syncFormValidity();
580
- this.brDatetimePickerValidationChange.emit({ validating: true, valid: null, message: null });
793
+ this.brDatetimePickerValidationChange.emit({
794
+ validating: true,
795
+ valid: null,
796
+ message: null,
797
+ });
581
798
  const value = this.selectionMode === 'range'
582
- ? { start: this.cloneDate(this.rangeStart), end: this.cloneDate(this.rangeEnd) }
799
+ ? {
800
+ start: this.cloneDate(this.rangeStart),
801
+ end: this.cloneDate(this.rangeEnd),
802
+ }
583
803
  : this.cloneDate(this.value);
584
804
  const message = await runFormValidator(validator, value);
585
805
  if (runId !== this.validationRunId)
@@ -588,10 +808,19 @@ export class DatetimePicker {
588
808
  this.isValidating = false;
589
809
  this.syncFormValidity();
590
810
  const valid = message === null && (await this.checkValidity());
591
- this.brDatetimePickerValidationChange.emit({ validating: false, valid, message });
811
+ this.brDatetimePickerValidationChange.emit({
812
+ validating: false,
813
+ valid,
814
+ message,
815
+ });
592
816
  return valid;
593
817
  }
594
- /** Retorna um snapshot serializável da Constraint Validation API. */
818
+ /**
819
+ * Retorna um snapshot serializável da Constraint Validation API.
820
+ *
821
+ * @returns Promise<FormValidationState> — estado atual de validação do host,
822
+ * pronto para conversão e restauração via `formStateRestoreCallback`.
823
+ */
595
824
  async getValidationState() {
596
825
  return getFormValidationState(this.elementInternals);
597
826
  }
@@ -603,36 +832,52 @@ export class DatetimePicker {
603
832
  ensureValidSelectionMode(value) {
604
833
  this.selectionMode = normalizeDatetimePickerSelectionMode(value);
605
834
  }
606
- /**
607
- * Normaliza o modo de seleção logo na inicialização.
608
- */
609
835
  initializeSelectionMode() {
610
836
  this.handleSelectionModeChange(this.selectionMode);
611
837
  }
612
- /** Normaliza o dia inicial da semana logo na inicialização. */
613
838
  initializeWeekStartsOn() {
614
839
  this.handleWeekStartsOnChange(this.weekStartsOn);
615
840
  }
616
- /** Valida o dia inicial da semana e corrige para padrão quando necessário. */
841
+ /**
842
+ * Valida o dia inicial da semana e corrige para padrão quando necessário.
843
+ *
844
+ * @param value unknown — valor recebido via prop/atributo a ser normalizado.
845
+ */
617
846
  ensureValidWeekStartsOn(value) {
618
847
  this.weekStartsOn = normalizeDatetimePickerWeekStartsOn(value);
619
848
  }
620
- /**
621
- * Limpa o estado do intervalo de datas ao mudar para modo single.
622
- */
623
849
  clearRangeState() {
624
850
  this.rangeStart = null;
625
851
  this.rangeEnd = null;
626
852
  this.updateFormInternals();
627
853
  }
628
- /** Indica quando o componente está operando em seleção de intervalo por data. */
854
+ /**
855
+ * Materializa os horários exibidos pelos dois timers como limites reais.
856
+ * Assim o range de horário já nasce completo, o input pode representá-lo na
857
+ * primeira renderização e nenhum timer depende da referência do outro.
858
+ */
859
+ initializeTimeRangeBoundaries(duringInitialization = false) {
860
+ if ((!this.isInitialized && !duringInitialization) ||
861
+ this.selectionMode !== 'range' ||
862
+ this.mode !== DATETIME_PICKER_MODE.TIME) {
863
+ return;
864
+ }
865
+ const fallback = this.cloneDate(this.value ?? this.referenceDate);
866
+ if (this.rangeStart === null)
867
+ this.rangeStart = this.cloneDate(fallback);
868
+ if (this.rangeEnd === null)
869
+ this.rangeEnd = this.cloneDate(fallback);
870
+ this.value = this.cloneDate(this.rangeEnd);
871
+ }
629
872
  isRangeDateSelectionMode() {
630
- return this.selectionMode === 'range' && this.mode === DATETIME_PICKER_MODE.DATE;
873
+ return this.selectionMode === 'range';
631
874
  }
632
875
  /**
633
- * Resolve se o evento público deve ser emitido após um update vindo dos subcomponentes.
876
+ * Decide se um evento público deve ser emitido após atualização vinda de
877
+ * subcomponentes (calendário/relógio).
634
878
  *
635
- * No modo range, o evento externo só é emitido no clique final (quando `end` é definido).
879
+ * @param range DatetimePickerDateRange | undefined — estado parcial do range vindo do subcomponente.
880
+ * @returns boolean — `true` quando o evento deve ser emitido externamente.
636
881
  */
637
882
  resolvePublicEventEmissionForRange(range) {
638
883
  if (!this.isRangeDateSelectionMode()) {
@@ -645,13 +890,63 @@ export class DatetimePicker {
645
890
  this.setRangeState(range);
646
891
  return isFinalRangeClick;
647
892
  }
648
- /** Resolve a data efetivamente selecionada no evento para validar bloqueio em single/range. */
893
+ /**
894
+ * Resolve a data efetivamente selecionada no evento para validações e bloqueios.
895
+ *
896
+ * @param range DatetimePickerDateRange | undefined — intervalo parcial (quando aplicável).
897
+ * @param value Date | null — valor principal vindo do subcomponente.
898
+ * @returns Date | null — data final a ser considerada para validação.
899
+ */
649
900
  resolveSelectedDateFromEvent(range, value) {
650
901
  if (!this.isRangeDateSelectionMode() || range === undefined) {
651
902
  return value;
652
903
  }
653
904
  return range.end ?? range.start ?? value;
654
905
  }
906
+ /**
907
+ * Identifica navegação visual que preserva integralmente o range selecionado.
908
+ *
909
+ * @param value Date | null — valor principal do evento.
910
+ * @param range DatetimePickerDateRange | undefined — range parcial do evento.
911
+ * @returns boolean — `true` quando a navegação não altera a seleção atual.
912
+ */
913
+ isRangeNavigationState(value, range) {
914
+ return (range !== undefined &&
915
+ this.sameDate(range.start, this.rangeStart) &&
916
+ this.sameDate(range.end, this.rangeEnd) &&
917
+ this.sameDate(value, this.value));
918
+ }
919
+ /**
920
+ * Consolida um evento cujo valor principal permaneceu inalterado.
921
+ *
922
+ * @param range DatetimePickerDateRange | undefined — estado parcial do range.
923
+ * @param shouldEmitPublicEvent boolean — indica se o evento público deve ser emitido.
924
+ */
925
+ handleUnchangedDateState(range, shouldEmitPublicEvent) {
926
+ this.syncCanonicalValues();
927
+ const shouldNotifyRange = this.isInitialized && this.isRangeDateSelectionMode() && range !== undefined;
928
+ if (shouldNotifyRange && shouldEmitPublicEvent) {
929
+ this.emitDateStateChange();
930
+ void this.validate();
931
+ }
932
+ else if (shouldNotifyRange) {
933
+ this.emitCanonicalChange(range);
934
+ }
935
+ this.updateFormInternals();
936
+ }
937
+ /**
938
+ * Emite a seleção parcial de range quando os eventos públicos foram adiados
939
+ * para evitar duplicidade com listeners legados.
940
+ *
941
+ * @param range DatetimePickerDateRange | undefined — snapshot parcial do range.
942
+ * @param shouldEmitPublicEvent boolean — se deve ser emitido publicamente.
943
+ */
944
+ emitPendingRangeChange(range, shouldEmitPublicEvent) {
945
+ if (shouldEmitPublicEvent || !this.isInitialized || !this.isRangeDateSelectionMode() || range === undefined) {
946
+ return;
947
+ }
948
+ this.emitCanonicalChange(range);
949
+ }
655
950
  attachOutsideClickListener() {
656
951
  if (this.outsideClickListenerAttached)
657
952
  return;
@@ -664,15 +959,9 @@ export class DatetimePicker {
664
959
  document.removeEventListener('click', this.handleOutsideClick);
665
960
  this.outsideClickListenerAttached = false;
666
961
  }
667
- /**
668
- * Garante que o componente inicie com um modo suportado.
669
- */
670
962
  initializeMode() {
671
963
  this.ensureValidMode(this.mode);
672
964
  }
673
- /**
674
- * Normaliza a coleção de datas desabilitadas na inicialização.
675
- */
676
965
  initializeDisabledDates() {
677
966
  this.syncDisabledDates(this.disabledDates);
678
967
  }
@@ -693,9 +982,6 @@ export class DatetimePicker {
693
982
  this.setComponentValue(null);
694
983
  }
695
984
  }
696
- /**
697
- * Aplica a seleção inicial configurada na prop.
698
- */
699
985
  initializeDefaultValue() {
700
986
  if (this.value instanceof Date && !Number.isNaN(this.value.getTime())) {
701
987
  this.referenceDate = toDate(this.value);
@@ -736,13 +1022,16 @@ export class DatetimePicker {
736
1022
  this.rangeEnd = null;
737
1023
  this.setComponentValue(selectedDate, shouldEmitEvents);
738
1024
  }
739
- /** Indica se o estado serializado deve ser interpretado como intervalo. */
740
1025
  isRangeRestoreMode() {
741
- return this.selectionMode === 'range' && this.mode === DATETIME_PICKER_MODE.DATE;
1026
+ return this.selectionMode === 'range';
742
1027
  }
743
- /** Restaura estado de intervalo a partir do valor serializado do formulário. */
1028
+ /**
1029
+ * Restaura estado de intervalo a partir do valor serializado do formulário.
1030
+ *
1031
+ * @param serializedState string — valor serializado vindo do formulário.
1032
+ */
744
1033
  restoreRangeStateFromSerialized(serializedState) {
745
- const restoredRange = parseDatetimePickerSerializedRange(serializedState);
1034
+ const restoredRange = parseDatetimePickerSerializedRange(serializedState, this.mode, this.referenceDate);
746
1035
  if (restoredRange === null) {
747
1036
  this.restoreSelection(null);
748
1037
  return;
@@ -752,7 +1041,11 @@ export class DatetimePicker {
752
1041
  this.rangeEnd = end;
753
1042
  this.restoreSelection(end);
754
1043
  }
755
- /** Restaura estado de seleção única a partir do valor serializado do formulário. */
1044
+ /**
1045
+ * Restaura estado de seleção única a partir do valor serializado do formulário.
1046
+ *
1047
+ * @param serializedState string — valor serializado vindo do formulário.
1048
+ */
756
1049
  restoreSingleStateFromSerialized(serializedState) {
757
1050
  const restoredValue = parseDatetimePickerSerializedValue(serializedState, this.mode, this.referenceDate);
758
1051
  if (restoredValue !== null && this.isDateDisabled(restoredValue)) {
@@ -761,7 +1054,13 @@ export class DatetimePicker {
761
1054
  }
762
1055
  this.restoreSelection(restoredValue);
763
1056
  }
764
- /** Resolve Date|null a partir de valores aceitos pelos métodos públicos. */
1057
+ /**
1058
+ * Converte entradas aceitas por métodos públicos em `Date | null`.
1059
+ *
1060
+ * @param value Date | string | null — valor bruto recebido pelo método público.
1061
+ * @param mode DatetimePickerMode — modo atual para parsing de strings.
1062
+ * @returns Date | null — representação normalizada ou `null` se inválida.
1063
+ */
765
1064
  parseMethodValue(value, mode) {
766
1065
  if (value === null) {
767
1066
  return null;
@@ -771,7 +1070,11 @@ export class DatetimePicker {
771
1070
  }
772
1071
  return parseDatetimePickerSerializedValue(value, mode, this.referenceDate);
773
1072
  }
774
- /** Aplica a ponte serializada usando os mesmos parsers já usados por restore de formulário. */
1073
+ /**
1074
+ * Aplica a ponte serializada usando os mesmos parsers já usados por restore de formulário.
1075
+ *
1076
+ * @param serializedValue string — valor serializado a ser restaurado.
1077
+ */
775
1078
  restoreSerializedValue(serializedValue) {
776
1079
  if (this.isRangeRestoreMode()) {
777
1080
  this.restoreRangeStateFromSerialized(serializedValue);
@@ -790,7 +1093,11 @@ export class DatetimePicker {
790
1093
  this.valueAsDate = nextValueAsDate;
791
1094
  this.syncingCanonicalValues = false;
792
1095
  }
793
- /** Retorna o mesmo valor que será submetido pelo ElementInternals. */
1096
+ /**
1097
+ * Retorna o mesmo valor que será submetido pelo ElementInternals.
1098
+ *
1099
+ * @returns string — valor serializado pronto para `setFormValue`.
1100
+ */
794
1101
  getSerializedValue() {
795
1102
  const zero = (date) => (date === null ? null : set(date, { seconds: 0, milliseconds: 0 }));
796
1103
  return (serializeDatetimePickerFormValue(this.value === null ? null : zero(this.value), {
@@ -804,11 +1111,24 @@ export class DatetimePicker {
804
1111
  sameDate(left, right) {
805
1112
  return left === right || (left !== null && right !== null && left.getTime() === right.getTime());
806
1113
  }
807
- /** Retorna a âncora de validação, ou undefined antes do primeiro render. */
1114
+ /**
1115
+ * Busca o input nativo interno para ações imperativas de foco.
1116
+ *
1117
+ * @returns HTMLElement | undefined — elemento `input` nativo interno, quando disponível.
1118
+ */
808
1119
  getNativeInputElement() {
809
- return (this.datetimeInputElement ?? this.el.shadowRoot?.querySelector('br-datetime-input') ?? undefined);
1120
+ return this.el.shadowRoot
1121
+ ?.querySelector('br-datetime-input')
1122
+ ?.shadowRoot?.querySelector('br-input')
1123
+ ?.shadowRoot?.querySelector('input');
810
1124
  }
811
- /** Atualiza estado interno, FormData e validação com uma única chamada. */
1125
+ /**
1126
+ * Atualiza estado interno, FormData e validação com uma única chamada.
1127
+ *
1128
+ * @param nextValue Date | null — próximo valor a ser aplicado no componente.
1129
+ * @param shouldEmitPublicEvent boolean — controla emissão de eventos públicos.
1130
+ * @returns void
1131
+ */
812
1132
  setComponentValue(nextValue, shouldEmitPublicEvent = true) {
813
1133
  this.value = this.cloneDate(nextValue);
814
1134
  this.syncCanonicalValues();
@@ -820,13 +1140,13 @@ export class DatetimePicker {
820
1140
  }
821
1141
  /** Propaga o estado atual consolidado para consumidores externos do componente raiz. */
822
1142
  emitDateStateChange() {
823
- const range = this.selectionMode === 'range' && this.mode === DATETIME_PICKER_MODE.DATE
1143
+ const range = this.selectionMode === 'range'
824
1144
  ? {
825
1145
  start: this.cloneDate(this.rangeStart),
826
1146
  end: this.cloneDate(this.rangeEnd),
827
1147
  }
828
1148
  : undefined;
829
- const rangeDates = range !== undefined && range.start !== null && range.end !== null
1149
+ const rangeDates = this.mode === DATETIME_PICKER_MODE.DATE && range !== undefined && range.start !== null && range.end !== null
830
1150
  ? this.buildRangeDatesState(range.start, range.end)
831
1151
  : undefined;
832
1152
  this.dateStateChange.emit({
@@ -835,13 +1155,118 @@ export class DatetimePicker {
835
1155
  range,
836
1156
  rangeDates,
837
1157
  });
838
- if (range)
839
- this.rangeValue = range;
1158
+ this.emitCanonicalChange(range);
840
1159
  this.valueChange.emit(this.cloneDate(this.value));
841
1160
  dispatchNativeFormEvent(this.el, 'input');
842
1161
  dispatchNativeFormEvent(this.el, 'change');
843
1162
  }
844
- /** Expande o intervalo completo e marca quais dias estão desabilitados. */
1163
+ /** Emite o contrato público sem expor detalhes incidentais do estado interno. */
1164
+ emitCanonicalChange(rangeSnapshot) {
1165
+ const serializedValue = this.getSerializedValue();
1166
+ if (this.selectionMode === 'range') {
1167
+ const range = rangeSnapshot ?? {
1168
+ start: this.rangeStart,
1169
+ end: this.rangeEnd,
1170
+ };
1171
+ const rangeValue = {
1172
+ start: this.cloneDate(range.start),
1173
+ end: this.cloneDate(range.end),
1174
+ };
1175
+ this.syncingRangeValueInternally = true;
1176
+ this.rangeValue = rangeValue;
1177
+ this.syncingRangeValueInternally = false;
1178
+ const value = {
1179
+ start: this.serializeRangeBoundary(rangeValue.start),
1180
+ end: this.serializeRangeBoundary(rangeValue.end),
1181
+ };
1182
+ const detail = {
1183
+ selectionMode: 'range',
1184
+ value,
1185
+ serializedValue,
1186
+ complete: value.start !== null && value.end !== null,
1187
+ };
1188
+ if (this.mode === DATETIME_PICKER_MODE.DATE) {
1189
+ this.brDatetimePickerChange.emit({ mode: 'date', ...detail });
1190
+ }
1191
+ else if (this.mode === DATETIME_PICKER_MODE.TIME) {
1192
+ this.brDatetimePickerChange.emit({ mode: 'time', ...detail });
1193
+ }
1194
+ else {
1195
+ this.brDatetimePickerChange.emit({ mode: 'datetime', ...detail });
1196
+ }
1197
+ return;
1198
+ }
1199
+ if (this.mode === DATETIME_PICKER_MODE.TIME) {
1200
+ this.brDatetimePickerChange.emit({
1201
+ mode: 'time',
1202
+ selectionMode: 'single',
1203
+ value: this.value === null
1204
+ ? null
1205
+ : {
1206
+ hours: this.value.getHours(),
1207
+ minutes: this.value.getMinutes(),
1208
+ },
1209
+ serializedValue,
1210
+ });
1211
+ return;
1212
+ }
1213
+ if (this.mode === DATETIME_PICKER_MODE.DATE) {
1214
+ this.brDatetimePickerChange.emit({
1215
+ mode: 'date',
1216
+ selectionMode: 'single',
1217
+ value: this.cloneDate(this.value),
1218
+ serializedValue,
1219
+ });
1220
+ return;
1221
+ }
1222
+ this.brDatetimePickerChange.emit({
1223
+ mode: 'datetime',
1224
+ selectionMode: 'single',
1225
+ value: this.cloneDate(this.value),
1226
+ serializedValue,
1227
+ });
1228
+ }
1229
+ /**
1230
+ * Serializa uma data civil sem conversão para UTC ou mudança de dia.
1231
+ *
1232
+ * @param value Date — data a serializar (somente componente civil).
1233
+ * @returns string — formato `YYYY-MM-DD`.
1234
+ */
1235
+ serializeDateOnly(value) {
1236
+ const year = String(value.getFullYear()).padStart(4, '0');
1237
+ const month = String(value.getMonth() + 1).padStart(2, '0');
1238
+ const day = String(value.getDate()).padStart(2, '0');
1239
+ return `${year}-${month}-${day}`;
1240
+ }
1241
+ /**
1242
+ * Serializa um limite do intervalo conforme o modo sem expor objetos Date no payload.
1243
+ *
1244
+ * @param value Date | null — limite a serializar.
1245
+ * @returns string | null — representação serializada do limite ou `null`.
1246
+ */
1247
+ serializeRangeBoundary(value) {
1248
+ if (value === null)
1249
+ return null;
1250
+ if (this.mode === DATETIME_PICKER_MODE.DATE)
1251
+ return this.serializeDateOnly(value);
1252
+ if (this.mode === DATETIME_PICKER_MODE.TIME) {
1253
+ return `${String(value.getHours()).padStart(2, '0')}:${String(value.getMinutes()).padStart(2, '0')}`;
1254
+ }
1255
+ return serializeDatetimePickerFormValue(value, {
1256
+ mode: DATETIME_PICKER_MODE.DATETIME,
1257
+ selectionMode: 'single',
1258
+ rangeStart: null,
1259
+ rangeEnd: null,
1260
+ referenceDate: value,
1261
+ });
1262
+ }
1263
+ /**
1264
+ * Expande o intervalo completo e marca quais dias estão desabilitados.
1265
+ *
1266
+ * @param start Date — início do intervalo.
1267
+ * @param end Date — fim do intervalo.
1268
+ * @returns Array<{date: Date, disabled: boolean}> — lista diária com flags.
1269
+ */
845
1270
  buildRangeDatesState(start, end) {
846
1271
  const intervalStart = start.getTime() <= end.getTime() ? start : end;
847
1272
  const intervalEnd = start.getTime() <= end.getTime() ? end : start;
@@ -853,8 +1278,13 @@ export class DatetimePicker {
853
1278
  disabled: this.isDateDisabled(date),
854
1279
  }));
855
1280
  }
856
- /** Restaura seleção e data de referência a partir de uma data já validada. */
1281
+ /**
1282
+ * Restaura seleção e data de referência a partir de uma data já validada.
1283
+ *
1284
+ * @param nextValue Date | null — valor validado a ser restaurado como seleção.
1285
+ */
857
1286
  restoreSelection(nextValue) {
1287
+ this.inputValidationMessage = '';
858
1288
  this.value = this.cloneDate(nextValue);
859
1289
  if (this.selectionMode === 'single') {
860
1290
  this.rangeStart = null;
@@ -864,12 +1294,15 @@ export class DatetimePicker {
864
1294
  this.syncCanonicalValues();
865
1295
  this.updateFormInternals();
866
1296
  }
867
- /** Atualiza o estado local de intervalo a partir do evento do calendário. */
1297
+ /**
1298
+ * Atualiza o estado local de intervalo a partir do evento do calendário.
1299
+ *
1300
+ * @param nextRange DatetimePickerDateRange | undefined — novo snapshot do intervalo.
1301
+ */
868
1302
  setRangeState(nextRange) {
869
1303
  this.rangeStart = this.cloneDate(nextRange?.start ?? null);
870
1304
  this.rangeEnd = this.cloneDate(nextRange?.end ?? null);
871
1305
  }
872
- /** Mantém ElementInternals sincronizado com estado e regras do componente. */
873
1306
  updateFormInternals() {
874
1307
  this.syncFormValue();
875
1308
  this.syncFormValidity();
@@ -889,9 +1322,20 @@ export class DatetimePicker {
889
1322
  });
890
1323
  this.elementInternals.setFormValue(nextValue);
891
1324
  }
892
- catch {
893
- // Ambientes de teste podem esconder attachInternals parcialmente.
894
- }
1325
+ catch { }
1326
+ }
1327
+ /** Deriva o erro de ordenação sem modificar os limites escolhidos. */
1328
+ getRangeOrderValidationMessage() {
1329
+ const invalidRange = this.selectionMode === 'range' &&
1330
+ this.mode !== DATETIME_PICKER_MODE.TIME &&
1331
+ this.rangeStart !== null &&
1332
+ this.rangeEnd !== null &&
1333
+ this.rangeStart.getTime() > this.rangeEnd.getTime();
1334
+ if (!invalidRange)
1335
+ return '';
1336
+ return this.mode === DATETIME_PICKER_MODE.DATETIME
1337
+ ? DATETIME_RANGE_ORDER_MESSAGE
1338
+ : 'A data inicial deve anteceder a data final.';
895
1339
  }
896
1340
  /** Espelha a regra de required no mecanismo nativo de validade. */
897
1341
  // biome-ignore lint/complexity/noExcessiveCognitiveComplexity: consolida flags nativos relacionados sem esconder a precedência das mensagens.
@@ -907,50 +1351,40 @@ export class DatetimePicker {
907
1351
  rangeEnd: this.rangeEnd,
908
1352
  referenceDate: this.referenceDate,
909
1353
  });
910
- const min = this.parseConstraintValue(this.min, 'min');
911
- const max = this.parseConstraintValue(this.max, 'max');
1354
+ const min = this.parseConstraintValue(this.min);
1355
+ const max = this.parseConstraintValue(this.max);
912
1356
  const values = this.selectionMode === 'range' ? [this.rangeStart, this.rangeEnd] : [this.value];
913
1357
  const rangeUnderflow = min !== null && values.some((value) => value !== null && value.getTime() < min.getTime());
914
1358
  const rangeOverflow = max !== null && values.some((value) => value !== null && value.getTime() > max.getTime());
915
- const invalidRange = this.selectionMode === 'range' &&
916
- this.rangeStart !== null &&
917
- this.rangeEnd !== null &&
918
- this.rangeStart.getTime() > this.rangeEnd.getTime();
1359
+ const rangeOrderMessage = this.getRangeOrderValidationMessage();
919
1360
  const flags = {
920
- customError: this.customValidationMessage !== '' || Boolean(this.validatorMessage) || invalidRange,
1361
+ customError: this.customValidationMessage !== '' ||
1362
+ this.inputValidationMessage !== '' ||
1363
+ Boolean(this.validatorMessage) ||
1364
+ rangeOrderMessage !== '' ||
1365
+ this.inputValidationPending,
921
1366
  rangeOverflow,
922
1367
  rangeUnderflow,
923
1368
  valueMissing: missing,
924
1369
  };
925
1370
  const message = this.customValidationMessage ||
1371
+ this.inputValidationMessage ||
926
1372
  this.validatorMessage ||
927
1373
  (missing
928
1374
  ? 'Preencha este campo.'
929
- : invalidRange
930
- ? 'A data inicial deve anteceder a data final.'
1375
+ : rangeOrderMessage
1376
+ ? rangeOrderMessage
931
1377
  : rangeUnderflow
932
1378
  ? 'Selecione uma data igual ou posterior ao mínimo.'
933
1379
  : rangeOverflow
934
1380
  ? 'Selecione uma data igual ou anterior ao máximo.'
935
1381
  : '');
936
- setFormValidity(this.elementInternals, flags, message, this.getNativeInputElement());
937
- }
938
- catch {
939
- // Ambientes sem ElementInternals completo não devem falhar.
1382
+ setFormValidity(this.elementInternals, flags, message, this.getNativeInputElement() ?? undefined);
940
1383
  }
1384
+ catch { }
941
1385
  }
942
- parseConstraintValue(value, propertyName) {
943
- if (value === null)
944
- return null;
945
- if (!(value instanceof Date) && typeof value !== 'string') {
946
- reportInvalidPropValue(this.el, propertyName, value, 'Informe uma data válida como Date ou string compatível com o modo atual.', 'Aplicando fallback null (sem limite).');
947
- return null;
948
- }
949
- const parsedValue = this.parseMethodValue(value, this.mode);
950
- if (parsedValue !== null)
951
- return parsedValue;
952
- reportInvalidPropValue(this.el, propertyName, value, 'Informe uma data válida como Date ou string compatível com o modo atual.', 'Aplicando fallback null (sem limite).');
953
- return null;
1386
+ parseConstraintValue(value) {
1387
+ return value === null ? null : this.parseMethodValue(value, this.mode);
954
1388
  }
955
1389
  isDisabled() {
956
1390
  return isFormControlDisabled(this.disabled, this.formDisabled);
@@ -1008,24 +1442,35 @@ export class DatetimePicker {
1008
1442
  }
1009
1443
  /** Renderiza o campo de entrada responsável por abrir e sincronizar o picker. */
1010
1444
  renderInputField() {
1011
- return (h("br-datetime-input", { ref: (element) => {
1012
- this.datetimeInputElement = element;
1013
- }, referenceDate: this.referenceDate, value: this.value, selectionMode: this.selectionMode, rangeStart: this.rangeStart, rangeEnd: this.rangeEnd, placeholder: this.placeholder, mode: this.mode, disabled: this.isDisabled(), onDateStateChange: this.handleDateStateChange, onTogglePicker: this.handleTogglePicker, exportparts: "container: input-container, input: input-field, icon: input-icon" }));
1445
+ return (h("br-datetime-input", { referenceDate: this.referenceDate, value: this.value, selectionMode: this.selectionMode, rangeStart: this.rangeStart, rangeEnd: this.rangeEnd, placeholder: this.placeholder, mode: this.mode, disabled: this.isDisabled(), onDateStateChange: this.handleDateStateChange, onInputValidationChange: this.handleInputValidationChange, onTogglePicker: this.handleTogglePicker, exportparts: "container: input-container, input: input-field, icon: input-icon" }));
1014
1446
  }
1015
1447
  /** Renderiza apenas o seletor de data. */
1016
1448
  renderDatePicker() {
1017
- const effectiveSelectionMode = this.mode === DATETIME_PICKER_MODE.DATE ? this.selectionMode : 'single';
1449
+ const effectiveSelectionMode = this.selectionMode;
1018
1450
  return (h("br-date-picker", { ...this.getSharedDateStateBindings(), selectionMode: effectiveSelectionMode, weekStartsOn: this.weekStartsOn, locale: this.locale, disabled: this.isDisabled(), disabledDates: this.normalizedDisabledDates, fixedRowCount: this.fixedRowCount }));
1019
1451
  }
1020
- /** Renderiza apenas o seletor de hora. */
1021
- renderTimePicker() {
1022
- return h("br-time-picker", { ...this.getSharedDateStateBindings(), disabled: this.isDisabled() });
1452
+ /** Renderiza um seletor de hora simples ou um limite do intervalo. */
1453
+ renderTimePicker(boundary) {
1454
+ const rangeValue = boundary === 'start' ? this.rangeStart : this.rangeEnd;
1455
+ const referenceDate = this.cloneDate(rangeValue ?? this.referenceDate);
1456
+ const selectedValue = this.cloneDate(rangeValue);
1457
+ const timerKey = boundary === undefined ? 'single' : `${boundary}-${rangeValue?.getTime() ?? `empty-${referenceDate.getTime()}`}`;
1458
+ const handler = boundary === 'start'
1459
+ ? this.handleRangeStartTimeStateChange
1460
+ : boundary === 'end'
1461
+ ? this.handleRangeEndTimeStateChange
1462
+ : this.handleDateStateChange;
1463
+ return (h("br-time-picker", { key: timerKey, referenceDate: referenceDate, value: boundary === undefined ? this.cloneDate(this.value) : selectedValue, onDateStateChange: handler, disabled: this.isDisabled() }));
1464
+ }
1465
+ /** Renderiza os horários inicial e final lado a lado no modo range. */
1466
+ renderRangeTimePickers() {
1467
+ return (h("div", { class: "range-time-pickers", role: "group", "aria-label": "Intervalo de hor\u00E1rios" }, h("div", { class: "range-time-picker" }, h("span", { class: "range-time-label" }, "In\u00EDcio"), this.renderTimePicker('start')), h("span", { class: "range-time-separator", "aria-hidden": "true" }, "-"), h("div", { class: "range-time-picker" }, h("span", { class: "range-time-label" }, "Fim"), this.renderTimePicker('end'))));
1023
1468
  }
1024
1469
  /**
1025
1470
  * Renderiza a combinação de data e horário no modo `datetime`.
1026
1471
  */
1027
1472
  renderDateTimePicker() {
1028
- return (h(Fragment, null, this.renderDatePicker(), this.renderDivider(), this.renderTimePicker()));
1473
+ return (h(Fragment, null, this.renderDatePicker(), this.renderDivider(), this.selectionMode === 'range' ? this.renderRangeTimePickers() : this.renderTimePicker()));
1029
1474
  }
1030
1475
  /** Renderiza o separador visual entre data e hora no modo combinado. */
1031
1476
  renderDivider() {
@@ -1045,7 +1490,11 @@ export class DatetimePicker {
1045
1490
  * Renderização principal do componente.
1046
1491
  */
1047
1492
  render() {
1048
- return (h(Host, { key: 'b964215e48b1871bf6ab1b045612f3d166543177', onKeyDown: this.handlePickerKeydown, "aria-busy": this.isValidating ? 'true' : null, "aria-describedby": this.hasFeedbackSlot || this.customValidationMessage || this.validatorMessage ? this.feedbackId : null, "aria-errormessage": this.customValidationMessage || this.validatorMessage || this.hasFeedbackSlot ? this.feedbackId : null }, h("div", { key: '50ba10963ba4e8bdf7c70f0d4513eea657692df8', class: this.getCssClassMap(), part: "container" }, this.renderInputField(), this.renderPickerContent()), h("div", { key: 'b220e70a85d8ba941dabed18a5a0dcdc9a99124f', id: this.feedbackId, part: "feedback", hidden: !this.hasFeedbackSlot && !this.customValidationMessage && !this.validatorMessage }, h("slot", { key: 'cdcc69b126491b2cea3b634066f1e4071c1c3b61', name: "feedback", onSlotchange: (event) => (this.hasFeedbackSlot = hasAssignedSlotContent(event.currentTarget)) }), !this.hasFeedbackSlot && (this.customValidationMessage || this.validatorMessage) ? (h("br-message", { state: "danger", message: this.customValidationMessage || this.validatorMessage })) : null)));
1493
+ const validationMessage = this.customValidationMessage ||
1494
+ this.inputValidationMessage ||
1495
+ this.validatorMessage ||
1496
+ (this.inputValidationPending ? '' : this.getRangeOrderValidationMessage());
1497
+ return (h(Host, { key: '0640504e844713daaf31d7c8a34b96fb48bcf499', onKeyDown: this.handlePickerKeydown, "aria-busy": this.isValidating ? 'true' : null, "aria-describedby": this.hasFeedbackSlot || validationMessage ? this.feedbackId : null, "aria-errormessage": validationMessage || this.hasFeedbackSlot ? this.feedbackId : null }, h("div", { key: '7512ed8a4437a99d6d0702351af659bfa1d270b0', class: this.getCssClassMap(), part: "container" }, this.renderInputField(), this.renderPickerContent()), h("div", { key: '80a8d3a717ceacc4dfb6bd0ac4850b61e3b2d311', id: this.feedbackId, part: "feedback", hidden: !this.hasFeedbackSlot && !validationMessage }, h("slot", { key: '41a8e4fad5edaa3729d63b7ee469f248a53129a1', name: "feedback", onSlotchange: (event) => (this.hasFeedbackSlot = hasAssignedSlotContent(event.currentTarget)) }), !this.hasFeedbackSlot && validationMessage ? (h("br-message", { state: "danger", "attr:message": validationMessage, feedback: true })) : null)));
1049
1498
  }
1050
1499
  static get is() { return "br-datetime-picker"; }
1051
1500
  static get encapsulation() { return "shadow"; }
@@ -1084,7 +1533,7 @@ export class DatetimePicker {
1084
1533
  "name": "default",
1085
1534
  "text": "'datetime'"
1086
1535
  }],
1087
- "text": "Define o modo de sele\u00E7\u00E3o exibido pelo componente: data, hor\u00E1rio ou ambos.\n\nValores aceitos: `date`, `time` ou `datetime`.\nValores inv\u00E1lidos s\u00E3o corrigidos automaticamente para o valor padr\u00E3o,\nmantendo o atributo refletido sempre consistente com o modo exibido."
1536
+ "text": "Modo exibido pelo componente.\n\nValores: `date` | `time` | `datetime`.\nValores inv\u00E1lidos s\u00E3o normalizados para o padr\u00E3o."
1088
1537
  },
1089
1538
  "getter": false,
1090
1539
  "setter": false,
@@ -1114,7 +1563,7 @@ export class DatetimePicker {
1114
1563
  "name": "default",
1115
1564
  "text": "'pt-BR'"
1116
1565
  }],
1117
- "text": "Define o locale usado pelos subcomponentes para formatar datas e r\u00F3tulos."
1566
+ "text": "Locale usado para formata\u00E7\u00E3o e r\u00F3tulos."
1118
1567
  },
1119
1568
  "getter": false,
1120
1569
  "setter": false,
@@ -1137,7 +1586,7 @@ export class DatetimePicker {
1137
1586
  "name": "default",
1138
1587
  "text": "''"
1139
1588
  }],
1140
- "text": "Define o placeholder exibido no campo de entrada do datetime picker."
1589
+ "text": "Texto placeholder exibido no input."
1141
1590
  },
1142
1591
  "getter": false,
1143
1592
  "setter": false,
@@ -1156,7 +1605,10 @@ export class DatetimePicker {
1156
1605
  "required": false,
1157
1606
  "optional": false,
1158
1607
  "docs": {
1159
- "tags": [],
1608
+ "tags": [{
1609
+ "name": "default",
1610
+ "text": "''"
1611
+ }],
1160
1612
  "text": "Nome do campo para submiss\u00E3o em formul\u00E1rios nativos."
1161
1613
  },
1162
1614
  "getter": false,
@@ -1176,8 +1628,11 @@ export class DatetimePicker {
1176
1628
  "required": false,
1177
1629
  "optional": false,
1178
1630
  "docs": {
1179
- "tags": [],
1180
- "text": "Indica se o campo deve ter valor antes do envio do formul\u00E1rio."
1631
+ "tags": [{
1632
+ "name": "default",
1633
+ "text": "false"
1634
+ }],
1635
+ "text": "Indica se o campo \u00E9 requerido para submiss\u00E3o do formul\u00E1rio."
1181
1636
  },
1182
1637
  "getter": false,
1183
1638
  "setter": false,
@@ -1202,10 +1657,10 @@ export class DatetimePicker {
1202
1657
  "optional": false,
1203
1658
  "docs": {
1204
1659
  "tags": [{
1205
- "name": "example",
1206
- "text": "```html\n<br-datetime-picker mode=\"date\" min=\"2026-01-01\"></br-datetime-picker>\n```"
1660
+ "name": "default",
1661
+ "text": "null"
1207
1662
  }],
1208
- "text": "Menor data/hor\u00E1rio aceito, interpretado conforme `mode`. Valores inv\u00E1lidos s\u00E3o ignorados.\nAceita texto no atributo HTML ou uma inst\u00E2ncia de `Date` por property binding."
1663
+ "text": "Menor data/hora aceito (Date | string | null)."
1209
1664
  },
1210
1665
  "getter": false,
1211
1666
  "setter": false,
@@ -1230,10 +1685,10 @@ export class DatetimePicker {
1230
1685
  "optional": false,
1231
1686
  "docs": {
1232
1687
  "tags": [{
1233
- "name": "example",
1234
- "text": "```html\n<br-datetime-picker mode=\"date\" max=\"2026-12-31\"></br-datetime-picker>\n```"
1688
+ "name": "default",
1689
+ "text": "null"
1235
1690
  }],
1236
- "text": "Maior data/hor\u00E1rio aceito, interpretado conforme `mode`. Valores inv\u00E1lidos s\u00E3o ignorados.\nAceita texto no atributo HTML ou uma inst\u00E2ncia de `Date` por property binding."
1691
+ "text": "Maior data/hora aceito (Date | string | null)."
1237
1692
  },
1238
1693
  "getter": false,
1239
1694
  "setter": false,
@@ -1260,10 +1715,10 @@ export class DatetimePicker {
1260
1715
  "optional": true,
1261
1716
  "docs": {
1262
1717
  "tags": [{
1263
- "name": "example",
1264
- "text": "```js\nconst picker = document.querySelector('br-datetime-picker');\npicker.validator = (value) => value === null ? 'Escolha uma data' : null;\n```"
1718
+ "name": "default",
1719
+ "text": "undefined"
1265
1720
  }],
1266
- "text": "Regra s\u00EDncrona ou ass\u00EDncrona aplicada \u00E0 data ou intervalo selecionado.\nRetorne uma mensagem para invalidar ou `null` para aceitar o valor."
1721
+ "text": "Validador customizado (s\u00EDncrono ou ass\u00EDncrono) para a sele\u00E7\u00E3o.\n\nRecebe `Date | DatetimePickerDateRange | null` como valor."
1267
1722
  },
1268
1723
  "getter": false,
1269
1724
  "setter": false
@@ -1286,8 +1741,11 @@ export class DatetimePicker {
1286
1741
  "required": false,
1287
1742
  "optional": false,
1288
1743
  "docs": {
1289
- "tags": [],
1290
- "text": "Define o tipo de sele\u00E7\u00E3o de datas para o calend\u00E1rio: \u00FAnica ou intervalo.\n\n`range` s\u00F3 funciona em conjunto com `mode=\"date\"`.\nSe `selectionMode=\"range\"` for informado, o componente ajusta automaticamente\n`mode` para `date`. Se `mode` mudar para `time` ou `datetime`, o componente\nnormaliza `selectionMode` para `single` quando necess\u00E1rio.\nValores inv\u00E1lidos usam `single`."
1744
+ "tags": [{
1745
+ "name": "default",
1746
+ "text": "'single'"
1747
+ }],
1748
+ "text": "Tipo de sele\u00E7\u00E3o: `single` ou `range`."
1291
1749
  },
1292
1750
  "getter": false,
1293
1751
  "setter": false,
@@ -1317,7 +1775,7 @@ export class DatetimePicker {
1317
1775
  "name": "default",
1318
1776
  "text": "0"
1319
1777
  }],
1320
- "text": "Define o dia inicial da semana exibida no calend\u00E1rio.\n\nValores suportados: 0 (domingo) a 6 (s\u00E1bado)."
1778
+ "text": "Dia inicial da semana exibido no calend\u00E1rio (0 = Dom, 6 = S\u00E1b)."
1321
1779
  },
1322
1780
  "getter": false,
1323
1781
  "setter": false,
@@ -1346,11 +1804,8 @@ export class DatetimePicker {
1346
1804
  "tags": [{
1347
1805
  "name": "default",
1348
1806
  "text": "null"
1349
- }, {
1350
- "name": "example",
1351
- "text": "```html\n<br-datetime-picker initial-moment=\"now\"></br-datetime-picker>\n```"
1352
1807
  }],
1353
- "text": "Define a sele\u00E7\u00E3o inicial do componente.\n\nAceita:\n- `'now'`: seleciona o momento atual.\n- `Date` ou `string`: seleciona uma data arbitr\u00E1ria.\n- `null`: inicia sem sele\u00E7\u00E3o.\n\nReativo em runtime: mudan\u00E7as na prop atualizam estado e subcomponentes."
1808
+ "text": "Valor inicial da sele\u00E7\u00E3o: `'now' | Date | string | null`."
1354
1809
  },
1355
1810
  "getter": false,
1356
1811
  "setter": false,
@@ -1375,10 +1830,10 @@ export class DatetimePicker {
1375
1830
  "optional": false,
1376
1831
  "docs": {
1377
1832
  "tags": [{
1378
- "name": "example",
1379
- "text": "```js\nconst picker = document.querySelector('br-datetime-picker');\npicker.value = new Date(2026, 8, 7, 14, 30);\n```"
1833
+ "name": "default",
1834
+ "text": "null"
1380
1835
  }],
1381
- "text": "Inst\u00E2ncia de `Date` selecionada pelo usu\u00E1rio no modo simples.\nPode ser controlada por property binding e \u00E9 atualizada pelo evento `valueChange`.\nPara formul\u00E1rios e atributos textuais, use `serializedValue`."
1836
+ "text": "Valor selecionado pelo usu\u00E1rio (Date | null).\n\nPode ser controlado externamente e \u00E9 refletido internamente."
1382
1837
  },
1383
1838
  "getter": false,
1384
1839
  "setter": false,
@@ -1396,10 +1851,10 @@ export class DatetimePicker {
1396
1851
  "optional": true,
1397
1852
  "docs": {
1398
1853
  "tags": [{
1399
- "name": "example",
1400
- "text": "```html\n<br-datetime-picker mode=\"datetime\" serialized-value=\"2026-09-07T14:30\"></br-datetime-picker>\n```"
1854
+ "name": "default",
1855
+ "text": "undefined"
1401
1856
  }],
1402
- "text": "Representa\u00E7\u00E3o serializada compat\u00EDvel com os formatos de controles HTML (`YYYY-MM-DD`, `HH:mm`\nou ISO local, conforme `mode`). Em intervalos, usa `in\u00EDcio/fim`.\n\nNa inicializa\u00E7\u00E3o, tem preced\u00EAncia sobre `valueAsDate`, `value` e `initialMoment`.\nUma string vazia inicia sem sele\u00E7\u00E3o, mesmo quando outra prop fornece uma data."
1857
+ "text": "Representa\u00E7\u00E3o serializada compat\u00EDvel com controles HTML.\n\nFormatos variam conforme `mode`. Em intervalos, usa `in\u00EDcio/fim`."
1403
1858
  },
1404
1859
  "getter": false,
1405
1860
  "setter": false,
@@ -1423,10 +1878,13 @@ export class DatetimePicker {
1423
1878
  "optional": true,
1424
1879
  "docs": {
1425
1880
  "tags": [{
1426
- "name": "example",
1427
- "text": "```js\nconst picker = document.querySelector('br-datetime-picker');\npicker.valueAsDate = new Date(2026, 8, 7);\n```"
1881
+ "name": "internal",
1882
+ "text": "Mant\u00E9m compatibilidade com APIs legadas."
1883
+ }, {
1884
+ "name": "default",
1885
+ "text": "undefined"
1428
1886
  }],
1429
- "text": "Espelho tipado da sele\u00E7\u00E3o atual, equivalente ao padr\u00E3o `valueAsDate` dos controles HTML.\nDiferentemente de `serializedValue`, recebe e retorna uma inst\u00E2ncia de `Date`.\nNa inicializa\u00E7\u00E3o, tem preced\u00EAncia sobre `value` e `initialMoment` quando `serializedValue`\nn\u00E3o \u00E9 informado. `null` inicia sem sele\u00E7\u00E3o; `undefined` permite usar as outras props."
1887
+ "text": "Espelho tipado da sele\u00E7\u00E3o atual (`valueAsDate`)."
1430
1888
  },
1431
1889
  "getter": false,
1432
1890
  "setter": false
@@ -1450,10 +1908,10 @@ export class DatetimePicker {
1450
1908
  "optional": true,
1451
1909
  "docs": {
1452
1910
  "tags": [{
1453
- "name": "example",
1454
- "text": "```js\nconst picker = document.querySelector('br-datetime-picker');\npicker.selectionMode = 'range';\npicker.rangeValue = {\n start: new Date(2026, 8, 7),\n end: new Date(2026, 8, 12),\n};\n```"
1911
+ "name": "default",
1912
+ "text": "undefined"
1455
1913
  }],
1456
- "text": "Intervalo controlado quando `selectionMode=\"range\"`.\nDeve conter datas v\u00E1lidas ou `null` em `start` e `end`; valores inv\u00E1lidos mant\u00EAm o \u00FAltimo intervalo efetivo.\nPasse o objeto por property binding; atributos HTML n\u00E3o representam objetos com `Date`."
1914
+ "text": "Intervalo controlado quando `selectionMode=\"range\"`.\n\nEm `datetime`, preserva as datas e hor\u00E1rios informados; t\u00E9rmino anterior ao\nin\u00EDcio torna o controle inv\u00E1lido, sem reordenar ou avan\u00E7ar datas."
1457
1915
  },
1458
1916
  "getter": false,
1459
1917
  "setter": false
@@ -1473,7 +1931,7 @@ export class DatetimePicker {
1473
1931
  "name": "default",
1474
1932
  "text": "false"
1475
1933
  }],
1476
- "text": "Desabilita toda a intera\u00E7\u00E3o do componente.\n\nQuando `true`, impede abrir o picker, alterar valores e navegar entre datas/hor\u00E1rios."
1934
+ "text": "Desabilita toda a intera\u00E7\u00E3o do componente."
1477
1935
  },
1478
1936
  "getter": false,
1479
1937
  "setter": false,
@@ -1502,14 +1960,8 @@ export class DatetimePicker {
1502
1960
  "tags": [{
1503
1961
  "name": "default",
1504
1962
  "text": "null"
1505
- }, {
1506
- "name": "example",
1507
- "text": "```html\n<br-datetime-picker mode=\"date\" disabled-dates=\"2026-09-07 2026-09-08\"></br-datetime-picker>\n```"
1508
- }, {
1509
- "name": "example",
1510
- "text": "```js\nconst picker = document.querySelector('br-datetime-picker');\npicker.disabledDates = [new Date(2026, 8, 7), '2026-09-08'];\n```"
1511
1963
  }],
1512
- "text": "Define um conjunto de datas indispon\u00EDveis para sele\u00E7\u00E3o.\n\nAceita uma lista de `Date` e/ou strings analis\u00E1veis, ou uma string com datas\nseparadas por espa\u00E7o em branco. Datas inv\u00E1lidas s\u00E3o ignoradas com warning.\nA compara\u00E7\u00E3o considera apenas o dia (ano/m\u00EAs/dia), ignorando hora."
1964
+ "text": "Datas indispon\u00EDveis para sele\u00E7\u00E3o. Aceita `Date[]`, `string` ou `null`.\n\nDatas inv\u00E1lidas s\u00E3o ignoradas. A compara\u00E7\u00E3o considera apenas o dia."
1513
1965
  },
1514
1966
  "getter": false,
1515
1967
  "setter": false,
@@ -1532,7 +1984,7 @@ export class DatetimePicker {
1532
1984
  "name": "default",
1533
1985
  "text": "false"
1534
1986
  }],
1535
- "text": "Define se o calend\u00E1rio deve manter um n\u00FAmero fixo de linhas (6 semanas = 42 dias)\nou variar conforme o m\u00EAs.\n\nQuando `true`, o calend\u00E1rio sempre exibe 6 semanas completas.\nQuando `false`, o calend\u00E1rio adapta-se ao m\u00EAs, exibindo apenas as semanas necess\u00E1rias."
1987
+ "text": "Mant\u00E9m n\u00FAmero fixo de linhas no calend\u00E1rio (6 semanas) quando `true`."
1536
1988
  },
1537
1989
  "getter": false,
1538
1990
  "setter": false,
@@ -1549,6 +2001,8 @@ export class DatetimePicker {
1549
2001
  "hasFeedbackSlot": {},
1550
2002
  "customValidationMessage": {},
1551
2003
  "validatorMessage": {},
2004
+ "inputValidationMessage": {},
2005
+ "inputValidationPending": {},
1552
2006
  "isValidating": {},
1553
2007
  "normalizedDisabledDates": {},
1554
2008
  "rangeEnd": {},
@@ -1564,12 +2018,18 @@ export class DatetimePicker {
1564
2018
  "cancelable": true,
1565
2019
  "composed": true,
1566
2020
  "docs": {
1567
- "tags": [],
1568
- "text": "Evento p\u00FAblico emitido quando a data de refer\u00EAncia ou a sele\u00E7\u00E3o mudam."
2021
+ "tags": [{
2022
+ "name": "event",
2023
+ "text": "dateStateChange"
2024
+ }, {
2025
+ "name": "type",
2026
+ "text": "{CustomEvent<DatetimePickerDateState>}"
2027
+ }],
2028
+ "text": "Evento p\u00FAblico emitido quando a data de refer\u00EAncia ou a sele\u00E7\u00E3o mudam.\n\nPayload (`DatetimePickerDateState`):\n- `referenceDate`: Date \u2014 data usada para navega\u00E7\u00E3o visual (m\u00EAs/semana exibidos).\n- `value`: Date | null \u2014 valor selecionado atualmente."
1569
2029
  },
1570
2030
  "complexType": {
1571
2031
  "original": "DatetimePickerDateState",
1572
- "resolved": "{ referenceDate: Date; value: Date; range?: DatetimePickerDateRange; rangeDates?: DatetimePickerRangeDateState[]; }",
2032
+ "resolved": "{ referenceDate: Date; value: Date; range?: DatetimePickerDateRange; rangeDates?: DatetimePickerRangeDateState[]; origin?: string; }",
1573
2033
  "references": {
1574
2034
  "DatetimePickerDateState": {
1575
2035
  "location": "import",
@@ -1579,6 +2039,34 @@ export class DatetimePicker {
1579
2039
  }
1580
2040
  }
1581
2041
  }
2042
+ }, {
2043
+ "method": "brDatetimePickerChange",
2044
+ "name": "brDatetimePickerChange",
2045
+ "bubbles": true,
2046
+ "cancelable": true,
2047
+ "composed": true,
2048
+ "docs": {
2049
+ "tags": [{
2050
+ "name": "event",
2051
+ "text": "brDatetimePickerChange"
2052
+ }, {
2053
+ "name": "type",
2054
+ "text": "{CustomEvent<DatetimePickerChangeDetail>}"
2055
+ }],
2056
+ "text": "Evento p\u00FAblico can\u00F4nico emitido quando a sele\u00E7\u00E3o muda.\n\nPayload (`DatetimePickerChangeDetail`):\n- `mode`: DatetimePickerMode \u2014 modo atual do componente (`date` | `time` | `datetime`).\n- `selectionMode`: DatetimePickerSelectionMode \u2014 `single` ou `range`.\n- `value`: Date | null | DatetimePickerDateRange \u2014 sele\u00E7\u00E3o atual (tipo depende de `selectionMode`).\n- `serializedValue`: string | undefined \u2014 representa\u00E7\u00E3o serializada para integra\u00E7\u00E3o com formul\u00E1rios."
2057
+ },
2058
+ "complexType": {
2059
+ "original": "DatetimePickerChangeDetail",
2060
+ "resolved": "{ mode: \"date\"; selectionMode: \"range\"; value: { start: string; end: string; }; serializedValue: string; complete: boolean; } | { mode: \"date\"; selectionMode: \"single\"; value: Date; serializedValue: string; } | { mode: \"datetime\"; selectionMode: \"range\"; value: { start: string; end: string; }; serializedValue: string; complete: boolean; } | { mode: \"datetime\"; selectionMode: \"single\"; value: Date; serializedValue: string; } | { mode: \"time\"; selectionMode: \"range\"; value: { start: string; end: string; }; serializedValue: string; complete: boolean; } | { mode: \"time\"; selectionMode: \"single\"; value: { hours: number; minutes: number; }; serializedValue: string; }",
2061
+ "references": {
2062
+ "DatetimePickerChangeDetail": {
2063
+ "location": "import",
2064
+ "path": "./datetime-picker.types",
2065
+ "id": "src/components/datetime-picker/datetime-picker.types.ts::DatetimePickerChangeDetail",
2066
+ "referenceLocation": "DatetimePickerChangeDetail"
2067
+ }
2068
+ }
2069
+ }
1582
2070
  }, {
1583
2071
  "method": "valueChange",
1584
2072
  "name": "valueChange",
@@ -1588,7 +2076,13 @@ export class DatetimePicker {
1588
2076
  "docs": {
1589
2077
  "tags": [{
1590
2078
  "name": "deprecated",
1591
- "text": "Use `input`/`change` e leia `event.target.value`."
2079
+ "text": "Use `brDatetimePickerChange` para receber a sele\u00E7\u00E3o completa e tipada.\n\nPayload (legacy): `Date | null` \u2014 valor selecionado."
2080
+ }, {
2081
+ "name": "event",
2082
+ "text": "valueChange"
2083
+ }, {
2084
+ "name": "type",
2085
+ "text": "{CustomEvent<Date | null>}"
1592
2086
  }],
1593
2087
  "text": "Evento emitido quando o valor selecionado muda."
1594
2088
  },
@@ -1609,8 +2103,14 @@ export class DatetimePicker {
1609
2103
  "cancelable": true,
1610
2104
  "composed": true,
1611
2105
  "docs": {
1612
- "tags": [],
1613
- "text": "Emitido ao iniciar e concluir a valida\u00E7\u00E3o customizada."
2106
+ "tags": [{
2107
+ "name": "event",
2108
+ "text": "brDatetimePickerValidationChange"
2109
+ }, {
2110
+ "name": "type",
2111
+ "text": "{CustomEvent<FormValidationChangeDetail>}"
2112
+ }],
2113
+ "text": "Emitido ao iniciar e concluir a valida\u00E7\u00E3o customizada.\n\nPayload (`FormValidationChangeDetail`):\n- `validating`: boolean \u2014 indica se a valida\u00E7\u00E3o est\u00E1 em execu\u00E7\u00E3o.\n- `valid`: boolean | null \u2014 resultado da valida\u00E7\u00E3o (`null` enquanto valida).\n- `message`: string | null \u2014 mensagem de valida\u00E7\u00E3o associada."
1614
2114
  },
1615
2115
  "complexType": {
1616
2116
  "original": "FormValidationChangeDetail",
@@ -1634,7 +2134,7 @@ export class DatetimePicker {
1634
2134
  "parameters": [{
1635
2135
  "name": "dates",
1636
2136
  "type": "DatetimePickerDisabledDate[]",
1637
- "docs": "- Lista de datas (Date|string) a bloquear."
2137
+ "docs": "Lista de datas (`Date` | `string`) a bloquear, ou `null` para limpar."
1638
2138
  }],
1639
2139
  "references": {
1640
2140
  "Promise": {
@@ -1651,10 +2151,13 @@ export class DatetimePicker {
1651
2151
  "return": "Promise<void>"
1652
2152
  },
1653
2153
  "docs": {
1654
- "text": "Define programaticamente as datas desabilitadas por meio de array.\n\n\u00DAtil quando o componente \u00E9 usado via HTML e o consumidor precisa enviar\numa lista tipada em runtime.",
2154
+ "text": "Define programaticamente as datas desabilitadas.\n\nUse quando scripts externos precisam fornecer uma lista tipada de\ndatas a bloquear no calend\u00E1rio. Substitui a prop `disabledDates` para\natualiza\u00E7\u00F5es imperativas.",
1655
2155
  "tags": [{
1656
2156
  "name": "param",
1657
- "text": "dates - Lista de datas (Date|string) a bloquear."
2157
+ "text": "dates Lista de datas (`Date` | `string`) a bloquear, ou `null` para limpar."
2158
+ }, {
2159
+ "name": "returns",
2160
+ "text": "Promise<void> \u2014 resolve quando a atualiza\u00E7\u00E3o interna for aplicada."
1658
2161
  }]
1659
2162
  }
1660
2163
  },
@@ -1664,7 +2167,7 @@ export class DatetimePicker {
1664
2167
  "parameters": [{
1665
2168
  "name": "value",
1666
2169
  "type": "string | Date",
1667
- "docs": ""
2170
+ "docs": "Date | string | null \u2014 valor a aplicar; `null` limpa a sele\u00E7\u00E3o."
1668
2171
  }],
1669
2172
  "references": {
1670
2173
  "Promise": {
@@ -1679,8 +2182,14 @@ export class DatetimePicker {
1679
2182
  "return": "Promise<void>"
1680
2183
  },
1681
2184
  "docs": {
1682
- "text": "Define o valor atual de forma imperativa aceitando Date, string serializada ou null.",
1683
- "tags": []
2185
+ "text": "Define o valor do componente de forma imperativa.\n\nAceita `Date`, string compat\u00EDvel com o `mode`, ou `null` para limpar a sele\u00E7\u00E3o.\nValida\u00E7\u00E3o de datas desabilitadas \u00E9 aplicada antes da atribui\u00E7\u00E3o.",
2186
+ "tags": [{
2187
+ "name": "param",
2188
+ "text": "value Date | string | null \u2014 valor a aplicar; `null` limpa a sele\u00E7\u00E3o."
2189
+ }, {
2190
+ "name": "returns",
2191
+ "text": "Promise<void> \u2014 resolve quando o componente aplicar e sincronizar o valor."
2192
+ }]
1684
2193
  }
1685
2194
  },
1686
2195
  "getValue": {
@@ -1701,7 +2210,10 @@ export class DatetimePicker {
1701
2210
  },
1702
2211
  "docs": {
1703
2212
  "text": "Retorna uma c\u00F3pia do valor selecionado atualmente.",
1704
- "tags": []
2213
+ "tags": [{
2214
+ "name": "returns",
2215
+ "text": "Promise<Date | null> \u2014 c\u00F3pia imut\u00E1vel do `value` atual, ou `null`."
2216
+ }]
1705
2217
  }
1706
2218
  },
1707
2219
  "clear": {
@@ -1717,8 +2229,11 @@ export class DatetimePicker {
1717
2229
  "return": "Promise<void>"
1718
2230
  },
1719
2231
  "docs": {
1720
- "text": "Limpa valor e intervalo selecionados.",
1721
- "tags": []
2232
+ "text": "Limpa valor e intervalo selecionados.\n\nRemove sele\u00E7\u00E3o atual e restaura a refer\u00EAncia de navega\u00E7\u00E3o para a data atual.",
2233
+ "tags": [{
2234
+ "name": "returns",
2235
+ "text": "Promise<void> \u2014 resolve ap\u00F3s a limpeza e sincroniza\u00E7\u00E3o internas."
2236
+ }]
1722
2237
  }
1723
2238
  },
1724
2239
  "open": {
@@ -1735,7 +2250,10 @@ export class DatetimePicker {
1735
2250
  },
1736
2251
  "docs": {
1737
2252
  "text": "Abre o picker quando o componente estiver habilitado.",
1738
- "tags": []
2253
+ "tags": [{
2254
+ "name": "returns",
2255
+ "text": "Promise<void> \u2014 resolve quando o estado visual for atualizado."
2256
+ }]
1739
2257
  }
1740
2258
  },
1741
2259
  "close": {
@@ -1752,7 +2270,10 @@ export class DatetimePicker {
1752
2270
  },
1753
2271
  "docs": {
1754
2272
  "text": "Fecha o picker.",
1755
- "tags": []
2273
+ "tags": [{
2274
+ "name": "returns",
2275
+ "text": "Promise<void> \u2014 resolve ap\u00F3s atualiza\u00E7\u00E3o do estado de visibilidade."
2276
+ }]
1756
2277
  }
1757
2278
  },
1758
2279
  "toggle": {
@@ -1769,7 +2290,10 @@ export class DatetimePicker {
1769
2290
  },
1770
2291
  "docs": {
1771
2292
  "text": "Alterna o estado de abertura do picker.",
1772
- "tags": []
2293
+ "tags": [{
2294
+ "name": "returns",
2295
+ "text": "Promise<void> \u2014 resolve quando a transi\u00E7\u00E3o de estado terminar."
2296
+ }]
1773
2297
  }
1774
2298
  },
1775
2299
  "focusInput": {
@@ -1780,17 +2304,16 @@ export class DatetimePicker {
1780
2304
  "Promise": {
1781
2305
  "location": "global",
1782
2306
  "id": "global::Promise"
1783
- },
1784
- "HTMLBrDatetimeInputElement": {
1785
- "location": "global",
1786
- "id": "global::HTMLBrDatetimeInputElement"
1787
2307
  }
1788
2308
  },
1789
2309
  "return": "Promise<void>"
1790
2310
  },
1791
2311
  "docs": {
1792
2312
  "text": "Move o foco para o input nativo interno.",
1793
- "tags": []
2313
+ "tags": [{
2314
+ "name": "returns",
2315
+ "text": "Promise<void> \u2014 resolve imediatamente ap\u00F3s tentar focar o elemento."
2316
+ }]
1794
2317
  }
1795
2318
  },
1796
2319
  "setRange": {
@@ -1799,11 +2322,11 @@ export class DatetimePicker {
1799
2322
  "parameters": [{
1800
2323
  "name": "start",
1801
2324
  "type": "string | Date",
1802
- "docs": ""
2325
+ "docs": "Date | string | null \u2014 data inicial do intervalo."
1803
2326
  }, {
1804
2327
  "name": "end",
1805
2328
  "type": "string | Date",
1806
- "docs": ""
2329
+ "docs": "Date | string | null \u2014 data final do intervalo."
1807
2330
  }],
1808
2331
  "references": {
1809
2332
  "Promise": {
@@ -1818,8 +2341,17 @@ export class DatetimePicker {
1818
2341
  "return": "Promise<void>"
1819
2342
  },
1820
2343
  "docs": {
1821
- "text": "Define intervalo de datas de forma imperativa, for\u00E7ando modo date e selectionMode range.",
1822
- "tags": []
2344
+ "text": "Define um intervalo no modo atual e ativa `selectionMode=\"range\"`.\n\nValida datas contra bloqueios e sincroniza estado visual e de formul\u00E1rio.\nEm `datetime`, mant\u00E9m os limites informados e sinaliza intervalo inv\u00E1lido\nquando o t\u00E9rmino precede o in\u00EDcio, sem ajustar datas automaticamente.",
2345
+ "tags": [{
2346
+ "name": "param",
2347
+ "text": "start Date | string | null \u2014 data inicial do intervalo."
2348
+ }, {
2349
+ "name": "param",
2350
+ "text": "end Date | string | null \u2014 data final do intervalo."
2351
+ }, {
2352
+ "name": "returns",
2353
+ "text": "Promise<void> \u2014 resolve quando o intervalo for aplicado e sincronizado."
2354
+ }]
1823
2355
  }
1824
2356
  },
1825
2357
  "getRange": {
@@ -1842,7 +2374,7 @@ export class DatetimePicker {
1842
2374
  "text": "Retorna o intervalo de datas selecionado quando em modo `selectionMode=\"range\"`.",
1843
2375
  "tags": [{
1844
2376
  "name": "returns",
1845
- "text": "Objeto com datas `start` e `end`, ou `null` se n\u00E3o estiver em modo range."
2377
+ "text": "Promise<{ start: Date | null; end: Date | null } | null> \u2014 objeto com `start`/`end` ou `null` quando\nn\u00E3o estiver em modo `range`."
1846
2378
  }]
1847
2379
  }
1848
2380
  },
@@ -1862,7 +2394,7 @@ export class DatetimePicker {
1862
2394
  "text": "Consulta se o picker est\u00E1 atualmente aberto.",
1863
2395
  "tags": [{
1864
2396
  "name": "returns",
1865
- "text": "`true` se o picker est\u00E1 vis\u00EDvel, `false` caso contr\u00E1rio."
2397
+ "text": "Promise<boolean> \u2014 `true` se o picker est\u00E1 vis\u00EDvel, `false` caso contr\u00E1rio."
1866
2398
  }]
1867
2399
  }
1868
2400
  },
@@ -1880,7 +2412,10 @@ export class DatetimePicker {
1880
2412
  },
1881
2413
  "docs": {
1882
2414
  "text": "Restaura o estado inicial atualmente registrado para reset.",
1883
- "tags": []
2415
+ "tags": [{
2416
+ "name": "returns",
2417
+ "text": "Promise<void> \u2014 resolve quando a sele\u00E7\u00E3o inicial for restaurada."
2418
+ }]
1884
2419
  }
1885
2420
  },
1886
2421
  "checkValidity": {
@@ -1897,7 +2432,10 @@ export class DatetimePicker {
1897
2432
  },
1898
2433
  "docs": {
1899
2434
  "text": "Permite que consumidores acionem valida\u00E7\u00E3o nativa do formul\u00E1rio via host.",
1900
- "tags": []
2435
+ "tags": [{
2436
+ "name": "returns",
2437
+ "text": "Promise<boolean> \u2014 resultado da Constraint Validation API para o host."
2438
+ }]
1901
2439
  }
1902
2440
  },
1903
2441
  "reportValidity": {
@@ -1914,7 +2452,10 @@ export class DatetimePicker {
1914
2452
  },
1915
2453
  "docs": {
1916
2454
  "text": "Permite exibir mensagens nativas de valida\u00E7\u00E3o no host.",
1917
- "tags": []
2455
+ "tags": [{
2456
+ "name": "returns",
2457
+ "text": "Promise<boolean> \u2014 `true` se a mensagem foi exibida e o formul\u00E1rio \u00E9 v\u00E1lido."
2458
+ }]
1918
2459
  }
1919
2460
  },
1920
2461
  "setCustomValidity": {
@@ -1923,7 +2464,7 @@ export class DatetimePicker {
1923
2464
  "parameters": [{
1924
2465
  "name": "message",
1925
2466
  "type": "string",
1926
- "docs": ""
2467
+ "docs": "string \u2014 mensagem de valida\u00E7\u00E3o; string vazia remove a mensagem."
1927
2468
  }],
1928
2469
  "references": {
1929
2470
  "Promise": {
@@ -1935,7 +2476,13 @@ export class DatetimePicker {
1935
2476
  },
1936
2477
  "docs": {
1937
2478
  "text": "Define ou limpa uma mensagem de validade customizada.",
1938
- "tags": []
2479
+ "tags": [{
2480
+ "name": "param",
2481
+ "text": "message string \u2014 mensagem de valida\u00E7\u00E3o; string vazia remove a mensagem."
2482
+ }, {
2483
+ "name": "returns",
2484
+ "text": "Promise<void> \u2014 resolve ap\u00F3s sincronizar a validade no host."
2485
+ }]
1939
2486
  }
1940
2487
  },
1941
2488
  "validate": {
@@ -1961,8 +2508,11 @@ export class DatetimePicker {
1961
2508
  "return": "Promise<boolean>"
1962
2509
  },
1963
2510
  "docs": {
1964
- "text": "Executa o validator do picker e retorna se a sele\u00E7\u00E3o atual \u00E9 v\u00E1lida.",
1965
- "tags": []
2511
+ "text": "Executa o validator customizado (se houver) e valida o controle.\n\nEmite eventos de in\u00EDcio/conclus\u00E3o da valida\u00E7\u00E3o e atualiza mensagens internas.",
2512
+ "tags": [{
2513
+ "name": "returns",
2514
+ "text": "Promise<boolean> \u2014 `true` se a sele\u00E7\u00E3o for considerada v\u00E1lida."
2515
+ }]
1966
2516
  }
1967
2517
  },
1968
2518
  "getValidationState": {
@@ -1985,7 +2535,10 @@ export class DatetimePicker {
1985
2535
  },
1986
2536
  "docs": {
1987
2537
  "text": "Retorna um snapshot serializ\u00E1vel da Constraint Validation API.",
1988
- "tags": []
2538
+ "tags": [{
2539
+ "name": "returns",
2540
+ "text": "Promise<FormValidationState> \u2014 estado atual de valida\u00E7\u00E3o do host,\npronto para convers\u00E3o e restaura\u00E7\u00E3o via `formStateRestoreCallback`."
2541
+ }]
1989
2542
  }
1990
2543
  }
1991
2544
  };