@swisspost/design-system-components 10.0.0-next.68 → 10.0.0-next.69

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 (462) hide show
  1. package/dist/.config/rollup-plugin.air-datepicker-locale.js +30 -0
  2. package/dist/cjs/_air-datepicker-locale_ar-CWOSiErt.js +5 -0
  3. package/dist/cjs/_air-datepicker-locale_bg-JFWSZzWm.js +5 -0
  4. package/dist/cjs/_air-datepicker-locale_ca-D4TAa7rI.js +5 -0
  5. package/dist/cjs/_air-datepicker-locale_cs-DosuWhKM.js +5 -0
  6. package/dist/cjs/_air-datepicker-locale_da-B5NHFJuC.js +5 -0
  7. package/dist/cjs/_air-datepicker-locale_de-pCyAfzJ2.js +5 -0
  8. package/dist/cjs/_air-datepicker-locale_el-Cpwc-DA1.js +5 -0
  9. package/dist/cjs/_air-datepicker-locale_en-Be7ImjN_.js +5 -0
  10. package/dist/cjs/_air-datepicker-locale_es-Cv0KAzTX.js +5 -0
  11. package/dist/cjs/_air-datepicker-locale_eu-DIWyMMth.js +5 -0
  12. package/dist/cjs/_air-datepicker-locale_fi-D0NlYCfL.js +5 -0
  13. package/dist/cjs/_air-datepicker-locale_fr-SkEOXj1I.js +5 -0
  14. package/dist/cjs/_air-datepicker-locale_hr-BrTsx2iQ.js +5 -0
  15. package/dist/cjs/_air-datepicker-locale_hu-a5Toa3rt.js +5 -0
  16. package/dist/cjs/_air-datepicker-locale_id-h0ieLcJv.js +5 -0
  17. package/dist/cjs/_air-datepicker-locale_it-DQeeF5n7.js +5 -0
  18. package/dist/cjs/_air-datepicker-locale_ja-C78DHDAv.js +5 -0
  19. package/dist/cjs/_air-datepicker-locale_ko-BGSYNW_t.js +5 -0
  20. package/dist/cjs/_air-datepicker-locale_nb-BQkZ_Pvp.js +5 -0
  21. package/dist/cjs/_air-datepicker-locale_nl-DG6dvxj-.js +5 -0
  22. package/dist/cjs/_air-datepicker-locale_pl-mZxBq8TF.js +5 -0
  23. package/dist/cjs/_air-datepicker-locale_pt-sCO-c8dQ.js +5 -0
  24. package/dist/cjs/_air-datepicker-locale_ro-Cf2HyYTE.js +5 -0
  25. package/dist/cjs/_air-datepicker-locale_ru-BS-yHOKw.js +5 -0
  26. package/dist/cjs/_air-datepicker-locale_si-C-vceOjt.js +5 -0
  27. package/dist/cjs/_air-datepicker-locale_sk-D6Sexd7V.js +5 -0
  28. package/dist/cjs/_air-datepicker-locale_sl-C769P2Cr.js +5 -0
  29. package/dist/cjs/_air-datepicker-locale_sv-DV21M0v9.js +5 -0
  30. package/dist/cjs/_air-datepicker-locale_th-HFoj3y5r.js +5 -0
  31. package/dist/cjs/_air-datepicker-locale_tr-C4soRqRo.js +5 -0
  32. package/dist/cjs/_air-datepicker-locale_uk-BM5nVNZS.js +5 -0
  33. package/dist/cjs/_air-datepicker-locale_zh-B4bR_9wv.js +5 -0
  34. package/dist/cjs/{index-Du1lKw8D.js → index-DPdHkdGf.js} +353 -1933
  35. package/dist/cjs/index-YBj3gUJp.js +114540 -0
  36. package/dist/cjs/{index.browser-Doj636JV.js → index.browser-BVb9l9T_.js} +1 -1
  37. package/dist/cjs/loader.cjs.js +2 -2
  38. package/dist/{esm/long-press-event-C_2k3G1c.js → cjs/long-press-event-Dx21Ojod.js} +13 -1
  39. package/dist/cjs/{package-DB6yM9Rp.js → package-CzSn3NmD.js} +1 -1
  40. package/dist/cjs/post-accordion_2.cjs.entry.js +4 -4
  41. package/dist/cjs/post-autocomplete.cjs.entry.js +36 -10
  42. package/dist/cjs/post-avatar.cjs.entry.js +4 -4
  43. package/dist/cjs/post-back-to-top.cjs.entry.js +4 -4
  44. package/dist/cjs/post-banner.cjs.entry.js +4 -4
  45. package/dist/cjs/post-breadcrumb-item.cjs.entry.js +4 -4
  46. package/dist/cjs/post-breadcrumbs.cjs.entry.js +5 -5
  47. package/dist/cjs/post-closebutton_14.cjs.entry.js +59 -57
  48. package/dist/cjs/post-collapsible_2.cjs.entry.js +5 -5
  49. package/dist/cjs/post-components.cjs.js +3 -3
  50. package/dist/cjs/post-date-picker.cjs.entry.js +368 -268
  51. package/dist/cjs/post-footer.cjs.entry.js +5 -5
  52. package/dist/cjs/post-linkarea.cjs.entry.js +3 -3
  53. package/dist/cjs/post-listbox-option.cjs.entry.js +4 -4
  54. package/dist/cjs/post-listbox.cjs.entry.js +4 -4
  55. package/dist/cjs/post-login-widget.cjs.entry.js +3 -3
  56. package/dist/cjs/post-number-input.cjs.entry.js +7 -7
  57. package/dist/cjs/post-pagination.cjs.entry.js +5 -5
  58. package/dist/cjs/post-popover-trigger.cjs.entry.js +4 -4
  59. package/dist/cjs/post-popover.cjs.entry.js +4 -4
  60. package/dist/cjs/post-rating.cjs.entry.js +4 -4
  61. package/dist/cjs/post-stepper-item.cjs.entry.js +3 -3
  62. package/dist/cjs/post-stepper.cjs.entry.js +6 -6
  63. package/dist/cjs/post-tab-item.cjs.entry.js +5 -5
  64. package/dist/cjs/post-tab-panel.cjs.entry.js +5 -5
  65. package/dist/cjs/post-tabs.cjs.entry.js +5 -5
  66. package/dist/cjs/post-tooltip-trigger.cjs.entry.js +5 -5
  67. package/dist/cjs/post-tooltip.cjs.entry.js +5 -5
  68. package/dist/collection/collection-manifest.json +2 -1
  69. package/dist/collection/components/post-autocomplete/post-autocomplete.css +1 -1
  70. package/dist/collection/components/post-autocomplete/post-autocomplete.js +52 -7
  71. package/dist/collection/components/post-avatar/post-avatar.js +1 -1
  72. package/dist/collection/components/post-back-to-top/post-back-to-top.js +1 -1
  73. package/dist/collection/components/post-banner/post-banner.js +1 -1
  74. package/dist/collection/components/post-breadcrumb-item/post-breadcrumb-item.js +1 -1
  75. package/dist/collection/components/post-breadcrumbs/post-breadcrumbs.js +2 -2
  76. package/dist/collection/components/post-closebutton/post-closebutton.css +1 -1
  77. package/dist/collection/components/post-closebutton/post-closebutton.js +1 -1
  78. package/dist/collection/components/post-collapsible/post-collapsible.js +1 -1
  79. package/dist/collection/components/post-collapsible-trigger/post-collapsible-trigger.js +1 -1
  80. package/dist/collection/components/post-date-picker/air-locales.js +34 -0
  81. package/dist/collection/components/post-date-picker/constants.js +42 -0
  82. package/dist/collection/components/post-date-picker/post-date-picker.css +6 -2
  83. package/dist/collection/components/post-date-picker/post-date-picker.js +295 -135
  84. package/dist/collection/components/post-footer/post-footer.js +1 -1
  85. package/dist/collection/components/post-header/post-header.css +1 -1
  86. package/dist/collection/components/post-header/post-header.js +5 -5
  87. package/dist/collection/components/post-icon/post-icon.js +1 -1
  88. package/dist/collection/components/post-language-menu/post-language-menu.css +1 -1
  89. package/dist/collection/components/post-language-menu/post-language-menu.js +11 -1
  90. package/dist/collection/components/post-linkarea/post-linkarea.js +1 -1
  91. package/dist/collection/components/post-listbox/post-listbox.js +1 -1
  92. package/dist/collection/components/post-listbox-option/post-listbox-option.js +2 -2
  93. package/dist/collection/components/post-login-widget/post-login-widget.js +1 -1
  94. package/dist/collection/components/post-logo/post-logo.js +1 -1
  95. package/dist/collection/components/post-mainnavigation/post-mainnavigation.js +1 -1
  96. package/dist/collection/components/post-megadropdown/post-megadropdown.css +1 -1
  97. package/dist/collection/components/post-megadropdown/post-megadropdown.js +1 -1
  98. package/dist/collection/components/post-megadropdown-trigger/post-megadropdown-trigger.css +1 -1
  99. package/dist/collection/components/post-megadropdown-trigger/post-megadropdown-trigger.js +1 -1
  100. package/dist/collection/components/post-menu/post-menu.js +3 -2
  101. package/dist/collection/components/post-menu-trigger/post-menu-trigger.js +1 -1
  102. package/dist/collection/components/post-number-input/post-number-input.css +1 -1
  103. package/dist/collection/components/post-number-input/post-number-input.js +2 -2
  104. package/dist/collection/components/post-pagination/post-pagination.css +1 -1
  105. package/dist/collection/components/post-popover/post-popover.js +2 -2
  106. package/dist/collection/components/post-popover-trigger/post-popover-trigger.js +1 -1
  107. package/dist/collection/components/post-popovercontainer/post-popovercontainer.css +1 -1
  108. package/dist/collection/components/post-popovercontainer/post-popovercontainer.js +4 -11
  109. package/dist/collection/components/post-rating/post-rating.js +1 -1
  110. package/dist/collection/components/post-stepper/post-stepper.js +4 -4
  111. package/dist/collection/components/post-stepper-item/post-stepper-item.js +1 -1
  112. package/dist/collection/components/post-tab-item/post-tab-item.js +1 -1
  113. package/dist/collection/components/post-tab-panel/post-tab-panel.js +1 -1
  114. package/dist/collection/components/post-tabs/post-tabs.js +2 -2
  115. package/dist/collection/components/post-togglebutton/post-togglebutton.js +1 -1
  116. package/dist/collection/components/post-tooltip/post-tooltip.css +1 -1
  117. package/dist/collection/components/post-tooltip/post-tooltip.js +2 -2
  118. package/dist/collection/components/post-tooltip-trigger/post-tooltip-trigger.js +1 -1
  119. package/dist/collection/utils/index.js +1 -0
  120. package/dist/collection/utils/is-iso-date.js +7 -6
  121. package/dist/collection/utils/locales.js +17 -0
  122. package/dist/components/_air-datepicker-locale_ar.js +1 -0
  123. package/dist/components/_air-datepicker-locale_bg.js +1 -0
  124. package/dist/components/_air-datepicker-locale_ca.js +1 -0
  125. package/dist/components/_air-datepicker-locale_cs.js +1 -0
  126. package/dist/components/_air-datepicker-locale_da.js +1 -0
  127. package/dist/components/_air-datepicker-locale_de.js +1 -0
  128. package/dist/components/_air-datepicker-locale_el.js +1 -0
  129. package/dist/components/_air-datepicker-locale_en.js +1 -0
  130. package/dist/components/_air-datepicker-locale_es.js +1 -0
  131. package/dist/components/_air-datepicker-locale_eu.js +1 -0
  132. package/dist/components/_air-datepicker-locale_fi.js +1 -0
  133. package/dist/components/_air-datepicker-locale_fr.js +1 -0
  134. package/dist/components/_air-datepicker-locale_hr.js +1 -0
  135. package/dist/components/_air-datepicker-locale_hu.js +1 -0
  136. package/dist/components/_air-datepicker-locale_id.js +1 -0
  137. package/dist/components/_air-datepicker-locale_it.js +1 -0
  138. package/dist/components/_air-datepicker-locale_ja.js +1 -0
  139. package/dist/components/_air-datepicker-locale_ko.js +1 -0
  140. package/dist/components/_air-datepicker-locale_nb.js +1 -0
  141. package/dist/components/_air-datepicker-locale_nl.js +1 -0
  142. package/dist/components/_air-datepicker-locale_pl.js +1 -0
  143. package/dist/components/_air-datepicker-locale_pt.js +1 -0
  144. package/dist/components/_air-datepicker-locale_ro.js +1 -0
  145. package/dist/components/_air-datepicker-locale_ru.js +1 -0
  146. package/dist/components/_air-datepicker-locale_si.js +1 -0
  147. package/dist/components/_air-datepicker-locale_sk.js +1 -0
  148. package/dist/components/_air-datepicker-locale_sl.js +1 -0
  149. package/dist/components/_air-datepicker-locale_sv.js +1 -0
  150. package/dist/components/_air-datepicker-locale_th.js +1 -0
  151. package/dist/components/_air-datepicker-locale_tr.js +1 -0
  152. package/dist/components/_air-datepicker-locale_uk.js +1 -0
  153. package/dist/components/_air-datepicker-locale_zh.js +1 -0
  154. package/dist/components/index3.js +6 -0
  155. package/dist/components/long-press-event.js +1 -1
  156. package/dist/components/package.js +1 -1
  157. package/dist/components/post-accordion-item2.js +1 -1
  158. package/dist/components/post-accordion2.js +1 -1
  159. package/dist/components/post-autocomplete.js +1 -1
  160. package/dist/components/post-avatar.js +1 -1
  161. package/dist/components/post-back-to-top.js +1 -1
  162. package/dist/components/post-banner.js +1 -1
  163. package/dist/components/post-breadcrumb-item2.js +1 -1
  164. package/dist/components/post-breadcrumbs.js +1 -1
  165. package/dist/components/post-closebutton2.js +1 -1
  166. package/dist/components/post-collapsible-trigger2.js +1 -1
  167. package/dist/components/post-collapsible2.js +1 -1
  168. package/dist/components/post-date-picker.js +1 -1
  169. package/dist/components/post-footer.js +1 -1
  170. package/dist/components/post-header.js +1 -1
  171. package/dist/components/post-icon2.js +1 -1
  172. package/dist/components/post-language-menu-item.js +1 -1
  173. package/dist/components/post-language-menu.js +1 -1
  174. package/dist/components/post-linkarea.js +1 -1
  175. package/dist/components/post-listbox-option.js +1 -1
  176. package/dist/components/post-listbox.js +1 -1
  177. package/dist/components/post-login-widget.js +1 -1
  178. package/dist/components/post-logo.js +1 -1
  179. package/dist/components/post-mainnavigation.js +1 -1
  180. package/dist/components/post-megadropdown-trigger.js +1 -1
  181. package/dist/components/post-megadropdown.js +1 -1
  182. package/dist/components/post-menu-trigger2.js +1 -1
  183. package/dist/components/post-menu2.js +1 -1
  184. package/dist/components/post-number-input.js +1 -1
  185. package/dist/components/post-pagination.js +1 -1
  186. package/dist/components/post-popover-trigger.js +1 -1
  187. package/dist/components/post-popover.js +1 -1
  188. package/dist/components/post-popovercontainer2.js +1 -1
  189. package/dist/components/post-rating.js +1 -1
  190. package/dist/components/post-stepper-item.js +1 -1
  191. package/dist/components/post-stepper.js +1 -1
  192. package/dist/components/post-tab-item.js +1 -1
  193. package/dist/components/post-tab-panel.js +1 -1
  194. package/dist/components/post-tabs.js +1 -1
  195. package/dist/components/post-togglebutton2.js +1 -1
  196. package/dist/components/post-tooltip-trigger.js +1 -1
  197. package/dist/components/post-tooltip.js +1 -1
  198. package/dist/components/react/index.js +1 -1
  199. package/dist/components/react/p-B0UL6WWC.js +1 -0
  200. package/dist/components/react/p-B4l5EAoq.js +1 -0
  201. package/dist/components/react/{p-CmkOK7QT.js → p-B4tq6hiA.js} +1 -1
  202. package/dist/components/react/p-B5zHEJHg.js +1 -0
  203. package/dist/components/react/p-BI8IDv3x.js +1 -0
  204. package/dist/components/react/p-BL8Kkhue.js +1 -0
  205. package/dist/components/react/{p-C_2k3G1c.js → p-BNgqqRsB.js} +1 -1
  206. package/dist/components/react/{p-DSw_A3Mh.js → p-BYfHrHCb.js} +1 -1
  207. package/dist/components/react/p-B_mxRlWV.js +1 -0
  208. package/dist/components/react/p-BaE0RQYu.js +1 -0
  209. package/dist/components/react/p-BbOp03Tv.js +1 -0
  210. package/dist/components/react/p-BfPjPzPS.js +1 -0
  211. package/dist/components/react/p-BhrWATcv.js +1 -0
  212. package/dist/components/react/{p-CuiEdxy9.js → p-Bj33xnuq.js} +1 -1
  213. package/dist/components/react/p-Blr-q_ib.js +1 -0
  214. package/dist/components/react/p-ByHlofKQ.js +1 -0
  215. package/dist/components/react/p-BzFuQlXL.js +1 -0
  216. package/dist/components/react/p-C820VY6h.js +1 -0
  217. package/dist/components/react/p-CHD6fZJe.js +1 -0
  218. package/dist/components/react/p-CJcRbvrI.js +6 -0
  219. package/dist/components/react/p-CKeMJgsB.js +1 -0
  220. package/dist/components/react/p-CKmlbvS5.js +1 -0
  221. package/dist/components/react/p-CLO4Gc79.js +1 -0
  222. package/dist/components/react/p-COcQTTvB.js +1 -0
  223. package/dist/components/react/p-CY0xDY7T.js +1 -0
  224. package/dist/components/react/p-CaXZrKGy.js +1 -0
  225. package/dist/components/react/{p-BOqFllSV.js → p-CfQqdIV2.js} +1 -1
  226. package/dist/components/react/p-Cp9RABzO.js +1 -0
  227. package/dist/components/react/{p-wHDwT4JH.js → p-D1KBbwmi.js} +1 -1
  228. package/dist/components/react/p-D74-8pcb.js +1 -0
  229. package/dist/components/react/p-D7MKQ7S-.js +1 -0
  230. package/dist/components/react/p-DAIxJysJ.js +1 -0
  231. package/dist/components/react/p-DLWEDodU.js +1 -0
  232. package/dist/components/react/p-DQq5Bnk2.js +1 -0
  233. package/dist/components/react/{p-DPFq3I2q.js → p-DRtzK3cr.js} +1 -1
  234. package/dist/components/react/p-DYpJ3j2A.js +1 -0
  235. package/dist/components/react/{p-aFH1oGSZ.js → p-De_QjSNJ.js} +1 -1
  236. package/dist/components/react/p-DiNZLG90.js +1 -0
  237. package/dist/components/react/p-Dp41Pg4o.js +1 -0
  238. package/dist/components/react/{p-BFAXoyMM.js → p-DwJ5SwpN.js} +1 -1
  239. package/dist/components/react/{p-rEK_D60T.js → p-HNUXY1z7.js} +1 -1
  240. package/dist/components/react/p-TmutBiUy.js +1 -0
  241. package/dist/components/react/{p-ByN3t9FX.js → p-UY924tHr.js} +1 -1
  242. package/dist/components/react/p-bl3gSRgH.js +1 -0
  243. package/dist/components/react/p-jZZU8-Dx.js +1 -0
  244. package/dist/components/react/p-r5tpdxcW.js +1 -0
  245. package/dist/components/react/p-tHlklq2F.js +1 -0
  246. package/dist/components/react/post-accordion-item.js +1 -1
  247. package/dist/components/react/post-accordion.js +1 -1
  248. package/dist/components/react/post-autocomplete.js +1 -1
  249. package/dist/components/react/post-avatar.js +1 -1
  250. package/dist/components/react/post-back-to-top.js +1 -1
  251. package/dist/components/react/post-banner.js +1 -1
  252. package/dist/components/react/post-breadcrumb-item.js +1 -1
  253. package/dist/components/react/post-breadcrumbs.js +1 -1
  254. package/dist/components/react/post-closebutton.js +1 -1
  255. package/dist/components/react/post-collapsible-trigger.js +1 -1
  256. package/dist/components/react/post-collapsible.js +1 -1
  257. package/dist/components/react/post-date-picker.js +1 -1
  258. package/dist/components/react/post-footer.js +1 -1
  259. package/dist/components/react/post-header.js +1 -1
  260. package/dist/components/react/post-icon.js +1 -1
  261. package/dist/components/react/post-language-menu-item.js +1 -1
  262. package/dist/components/react/post-language-menu.js +1 -1
  263. package/dist/components/react/post-linkarea.js +1 -1
  264. package/dist/components/react/post-listbox-option.js +1 -1
  265. package/dist/components/react/post-listbox.js +1 -1
  266. package/dist/components/react/post-login-widget.js +1 -1
  267. package/dist/components/react/post-logo.js +1 -1
  268. package/dist/components/react/post-mainnavigation.js +1 -1
  269. package/dist/components/react/post-megadropdown-trigger.js +1 -1
  270. package/dist/components/react/post-megadropdown.js +1 -1
  271. package/dist/components/react/post-menu-item.js +1 -1
  272. package/dist/components/react/post-menu-trigger.js +1 -1
  273. package/dist/components/react/post-menu.js +1 -1
  274. package/dist/components/react/post-number-input.js +1 -1
  275. package/dist/components/react/post-pagination.js +1 -1
  276. package/dist/components/react/post-popover-trigger.js +1 -1
  277. package/dist/components/react/post-popover.js +1 -1
  278. package/dist/components/react/post-popovercontainer.js +1 -1
  279. package/dist/components/react/post-rating.js +1 -1
  280. package/dist/components/react/post-stepper-item.js +1 -1
  281. package/dist/components/react/post-stepper.js +1 -1
  282. package/dist/components/react/post-tab-item.js +1 -1
  283. package/dist/components/react/post-tab-panel.js +1 -1
  284. package/dist/components/react/post-tabs.js +1 -1
  285. package/dist/components/react/post-togglebutton.js +1 -1
  286. package/dist/components/react/post-tooltip-trigger.js +1 -1
  287. package/dist/components/react/post-tooltip.js +1 -1
  288. package/dist/docs.d.ts +26 -0
  289. package/dist/docs.json +113 -9
  290. package/dist/esm/_air-datepicker-locale_ar-DQq5Bnk2.js +3 -0
  291. package/dist/esm/_air-datepicker-locale_bg-bl3gSRgH.js +3 -0
  292. package/dist/esm/_air-datepicker-locale_ca-BI8IDv3x.js +3 -0
  293. package/dist/esm/_air-datepicker-locale_cs-COcQTTvB.js +3 -0
  294. package/dist/esm/_air-datepicker-locale_da-jZZU8-Dx.js +3 -0
  295. package/dist/esm/_air-datepicker-locale_de-DiNZLG90.js +3 -0
  296. package/dist/esm/_air-datepicker-locale_el-CY0xDY7T.js +3 -0
  297. package/dist/esm/_air-datepicker-locale_en-D74-8pcb.js +3 -0
  298. package/dist/esm/_air-datepicker-locale_es-TmutBiUy.js +3 -0
  299. package/dist/esm/_air-datepicker-locale_eu-Blr-q_ib.js +3 -0
  300. package/dist/esm/_air-datepicker-locale_fi-B5zHEJHg.js +3 -0
  301. package/dist/esm/_air-datepicker-locale_fr-CLO4Gc79.js +3 -0
  302. package/dist/esm/_air-datepicker-locale_hr-CKeMJgsB.js +3 -0
  303. package/dist/esm/_air-datepicker-locale_hu-B_mxRlWV.js +3 -0
  304. package/dist/esm/_air-datepicker-locale_id-BhrWATcv.js +3 -0
  305. package/dist/esm/_air-datepicker-locale_it-B0UL6WWC.js +3 -0
  306. package/dist/esm/_air-datepicker-locale_ja-DLWEDodU.js +3 -0
  307. package/dist/esm/_air-datepicker-locale_ko-BL8Kkhue.js +3 -0
  308. package/dist/esm/_air-datepicker-locale_nb-BzFuQlXL.js +3 -0
  309. package/dist/esm/_air-datepicker-locale_nl-ByHlofKQ.js +3 -0
  310. package/dist/esm/_air-datepicker-locale_pl-CaXZrKGy.js +3 -0
  311. package/dist/esm/_air-datepicker-locale_pt-CKmlbvS5.js +3 -0
  312. package/dist/esm/_air-datepicker-locale_ro-r5tpdxcW.js +3 -0
  313. package/dist/esm/_air-datepicker-locale_ru-BfPjPzPS.js +3 -0
  314. package/dist/esm/_air-datepicker-locale_si-Dp41Pg4o.js +3 -0
  315. package/dist/esm/_air-datepicker-locale_sk-BaE0RQYu.js +3 -0
  316. package/dist/esm/_air-datepicker-locale_sl-tHlklq2F.js +3 -0
  317. package/dist/esm/_air-datepicker-locale_sv-DYpJ3j2A.js +3 -0
  318. package/dist/esm/_air-datepicker-locale_th-D7MKQ7S-.js +3 -0
  319. package/dist/esm/_air-datepicker-locale_tr-CHD6fZJe.js +3 -0
  320. package/dist/esm/_air-datepicker-locale_uk-Cp9RABzO.js +3 -0
  321. package/dist/esm/_air-datepicker-locale_zh-C820VY6h.js +3 -0
  322. package/dist/esm/index-CJcRbvrI.js +114535 -0
  323. package/dist/esm/{index-Ci4L1rzN.js → index-DmAi35UF.js} +353 -1933
  324. package/dist/esm/{index.browser-BLchVpF6.js → index.browser-nA1BKco0.js} +1 -1
  325. package/dist/esm/loader.js +3 -3
  326. package/dist/{cjs/long-press-event-Q8jMUNXD.js → esm/long-press-event-BNgqqRsB.js} +11 -3
  327. package/dist/esm/package-B4l5EAoq.js +3 -0
  328. package/dist/esm/post-accordion_2.entry.js +4 -4
  329. package/dist/esm/post-autocomplete.entry.js +36 -10
  330. package/dist/esm/post-avatar.entry.js +4 -4
  331. package/dist/esm/post-back-to-top.entry.js +4 -4
  332. package/dist/esm/post-banner.entry.js +4 -4
  333. package/dist/esm/post-breadcrumb-item.entry.js +4 -4
  334. package/dist/esm/post-breadcrumbs.entry.js +5 -5
  335. package/dist/esm/post-closebutton_14.entry.js +56 -54
  336. package/dist/esm/post-collapsible_2.entry.js +5 -5
  337. package/dist/esm/post-components.js +4 -4
  338. package/dist/esm/post-date-picker.entry.js +352 -252
  339. package/dist/esm/post-footer.entry.js +4 -4
  340. package/dist/esm/post-linkarea.entry.js +3 -3
  341. package/dist/esm/post-listbox-option.entry.js +4 -4
  342. package/dist/esm/post-listbox.entry.js +4 -4
  343. package/dist/esm/post-login-widget.entry.js +3 -3
  344. package/dist/esm/post-number-input.entry.js +6 -6
  345. package/dist/esm/post-pagination.entry.js +5 -5
  346. package/dist/esm/post-popover-trigger.entry.js +4 -4
  347. package/dist/esm/post-popover.entry.js +4 -4
  348. package/dist/esm/post-rating.entry.js +4 -4
  349. package/dist/esm/post-stepper-item.entry.js +3 -3
  350. package/dist/esm/post-stepper.entry.js +6 -6
  351. package/dist/esm/post-tab-item.entry.js +5 -5
  352. package/dist/esm/post-tab-panel.entry.js +5 -5
  353. package/dist/esm/post-tabs.entry.js +5 -5
  354. package/dist/esm/post-tooltip-trigger.entry.js +5 -5
  355. package/dist/esm/post-tooltip.entry.js +5 -5
  356. package/dist/post-components/{p-4ad6993e.entry.js → p-0992cba9.entry.js} +1 -1
  357. package/dist/post-components/{p-9bdb92c0.entry.js → p-0c249c71.entry.js} +1 -1
  358. package/dist/post-components/{p-4c021d5f.entry.js → p-1e28d279.entry.js} +1 -1
  359. package/dist/post-components/{p-5f86479f.entry.js → p-220d0eab.entry.js} +1 -1
  360. package/dist/post-components/{p-38880c61.entry.js → p-272de102.entry.js} +1 -1
  361. package/dist/post-components/{p-5c66d070.entry.js → p-30e5bc99.entry.js} +1 -1
  362. package/dist/post-components/p-500a3fc7.entry.js +1 -0
  363. package/dist/post-components/{p-eb89eecb.entry.js → p-52f85cba.entry.js} +1 -1
  364. package/dist/post-components/{p-602960ff.entry.js → p-5664d5b5.entry.js} +1 -1
  365. package/dist/post-components/p-5ade4255.entry.js +1 -0
  366. package/dist/post-components/p-6644e626.entry.js +1 -0
  367. package/dist/post-components/p-694e76be.entry.js +1 -0
  368. package/dist/post-components/p-8b68164f.entry.js +1 -0
  369. package/dist/post-components/{p-cdc11592.entry.js → p-906b669b.entry.js} +1 -1
  370. package/dist/post-components/p-92e4a7f7.entry.js +1 -0
  371. package/dist/post-components/{p-df54677a.entry.js → p-95df4d4e.entry.js} +1 -1
  372. package/dist/post-components/{p-7ad4e293.entry.js → p-9fab1847.entry.js} +1 -1
  373. package/dist/post-components/p-B0UL6WWC.js +1 -0
  374. package/dist/post-components/p-B4l5EAoq.js +1 -0
  375. package/dist/post-components/p-B5zHEJHg.js +1 -0
  376. package/dist/post-components/p-BI8IDv3x.js +1 -0
  377. package/dist/post-components/p-BL8Kkhue.js +1 -0
  378. package/dist/post-components/{p-C_2k3G1c.js → p-BNgqqRsB.js} +1 -1
  379. package/dist/post-components/p-B_mxRlWV.js +1 -0
  380. package/dist/post-components/p-BaE0RQYu.js +1 -0
  381. package/dist/post-components/p-BfPjPzPS.js +1 -0
  382. package/dist/post-components/p-BhrWATcv.js +1 -0
  383. package/dist/post-components/p-Blr-q_ib.js +1 -0
  384. package/dist/post-components/p-ByHlofKQ.js +1 -0
  385. package/dist/post-components/p-BzFuQlXL.js +1 -0
  386. package/dist/post-components/p-C820VY6h.js +1 -0
  387. package/dist/post-components/p-CHD6fZJe.js +1 -0
  388. package/dist/post-components/p-CJcRbvrI.js +6 -0
  389. package/dist/post-components/p-CKeMJgsB.js +1 -0
  390. package/dist/post-components/p-CKmlbvS5.js +1 -0
  391. package/dist/post-components/p-CLO4Gc79.js +1 -0
  392. package/dist/post-components/p-COcQTTvB.js +1 -0
  393. package/dist/post-components/p-CY0xDY7T.js +1 -0
  394. package/dist/post-components/p-CaXZrKGy.js +1 -0
  395. package/dist/post-components/p-Cp9RABzO.js +1 -0
  396. package/dist/post-components/p-D74-8pcb.js +1 -0
  397. package/dist/post-components/p-D7MKQ7S-.js +1 -0
  398. package/dist/post-components/p-DLWEDodU.js +1 -0
  399. package/dist/post-components/p-DQq5Bnk2.js +1 -0
  400. package/dist/post-components/p-DYpJ3j2A.js +1 -0
  401. package/dist/post-components/p-DiNZLG90.js +1 -0
  402. package/dist/post-components/p-DmAi35UF.js +2 -0
  403. package/dist/post-components/p-Dp41Pg4o.js +1 -0
  404. package/dist/post-components/p-TmutBiUy.js +1 -0
  405. package/dist/post-components/p-bl3gSRgH.js +1 -0
  406. package/dist/post-components/p-c70cad6e.entry.js +1 -0
  407. package/dist/post-components/{p-319959ee.entry.js → p-c95fcb40.entry.js} +1 -1
  408. package/dist/post-components/{p-39b2b086.entry.js → p-cca0cf23.entry.js} +1 -1
  409. package/dist/post-components/{p-fd10d5b9.entry.js → p-cd6684e1.entry.js} +1 -1
  410. package/dist/post-components/p-d57462a3.entry.js +1 -0
  411. package/dist/post-components/{p-f64c6491.entry.js → p-d99bdef2.entry.js} +1 -1
  412. package/dist/post-components/{p-e331093d.entry.js → p-dfe811cc.entry.js} +1 -1
  413. package/dist/post-components/p-f14ca918.entry.js +1 -0
  414. package/dist/post-components/{p-e01ce660.entry.js → p-f88a161a.entry.js} +1 -1
  415. package/dist/post-components/p-fc2882a8.entry.js +1 -0
  416. package/dist/post-components/p-jZZU8-Dx.js +1 -0
  417. package/dist/post-components/p-r5tpdxcW.js +1 -0
  418. package/dist/post-components/p-tHlklq2F.js +1 -0
  419. package/dist/post-components/post-components.css +1 -1
  420. package/dist/post-components/post-components.esm.js +1 -1
  421. package/dist/prebuild.js +4 -1
  422. package/dist/types/components/post-autocomplete/post-autocomplete.d.ts +10 -0
  423. package/dist/types/components/post-date-picker/air-locales.d.ts +5 -0
  424. package/dist/types/components/post-date-picker/constants.d.ts +37 -0
  425. package/dist/types/components/post-date-picker/post-date-picker.d.ts +74 -18
  426. package/dist/types/components/post-language-menu/post-language-menu.d.ts +2 -0
  427. package/dist/types/components/post-stepper/post-stepper.d.ts +2 -2
  428. package/dist/types/components.d.ts +286 -80
  429. package/dist/types/home/runner/work/design-system/design-system/packages/components/.stencil/.config/rollup-plugin.air-datepicker-locale.d.ts +12 -0
  430. package/dist/types/home/runner/work/design-system/design-system/packages/components/.stencil/types/language-tags.d.ts +1 -0
  431. package/dist/types/language-tags.js +0 -0
  432. package/dist/types/stencil-public-runtime.d.ts +23 -2
  433. package/dist/types/utils/index.d.ts +1 -0
  434. package/dist/types/utils/locales.d.ts +11 -0
  435. package/hydrate/index.js +120010 -4831
  436. package/hydrate/index.mjs +120010 -4831
  437. package/package.json +14 -13
  438. package/dist/cjs/breakpoints-B0Olgvgc.js +0 -206
  439. package/dist/collection/components/post-date-picker/locales.js +0 -10
  440. package/dist/components/breakpoints.js +0 -1
  441. package/dist/components/react/p-BADyL6qQ.js +0 -1
  442. package/dist/components/react/p-BQ3HlJPr.js +0 -1
  443. package/dist/components/react/p-NDMNbu5d.js +0 -1
  444. package/dist/components/react/p-_AAbD0Gm.js +0 -1
  445. package/dist/esm/breakpoints-BQ3HlJPr.js +0 -202
  446. package/dist/esm/package-NDMNbu5d.js +0 -3
  447. package/dist/post-components/p-1edd4d7c.entry.js +0 -1
  448. package/dist/post-components/p-3364b421.entry.js +0 -1
  449. package/dist/post-components/p-631f4bdd.entry.js +0 -1
  450. package/dist/post-components/p-6336ea0b.entry.js +0 -1
  451. package/dist/post-components/p-82871134.entry.js +0 -1
  452. package/dist/post-components/p-8c91a9d8.entry.js +0 -1
  453. package/dist/post-components/p-BQ3HlJPr.js +0 -1
  454. package/dist/post-components/p-Ci4L1rzN.js +0 -2
  455. package/dist/post-components/p-NDMNbu5d.js +0 -1
  456. package/dist/post-components/p-e4fd234d.entry.js +0 -1
  457. package/dist/post-components/p-ee03eed0.entry.js +0 -1
  458. package/dist/post-components/p-f1813327.entry.js +0 -1
  459. package/dist/post-components/p-f1bff988.entry.js +0 -1
  460. package/dist/types/components/post-date-picker/locales.d.ts +0 -6
  461. /package/dist/components/react/{p-BLchVpF6.js → p-nA1BKco0.js} +0 -0
  462. /package/dist/post-components/{p-BLchVpF6.js → p-nA1BKco0.js} +0 -0
@@ -1,12 +1,17 @@
1
- import { h, Host, Build, } from "@stencil/core";
1
+ import { Build, h, Host, } from "@stencil/core";
2
+ import { version } from "../../../../package";
2
3
  import AirDatepicker from "air-datepicker";
4
+ import { airDatepickerLocales } from "./air-locales";
3
5
  import IMask from "imask";
4
- import { localesMap } from "./locales";
5
- import { checkEmptyOrDate, checkRequiredAndType, checkIsoDate, isIsoDate } from "../../utils/index";
6
+ import { checkEmptyOrDate, checkRequiredAndType, checkIsoDate, getLocaleTextDirection, isValidLocale, BUDDHIST_CALENDAR_YEAR_OFFSET, BUDDHIST_CALENDAR_LOCALES, UNICODE_BIDI, FALLBACK_LANGUAGE_CODE, } from "../../utils/index";
7
+ import { TEXT_DIRECTION_MARKERS_REGEX, DATE_FORMAT_RANGE_SEPARATOR, DATE_FORMAT_MAP, DATE_FORMAT_KEYS, DATE_FORMAT_KEYS_REGEX, DATE_FORMAT_SEPARATOR_REGEX, DATE_FORMAT_STRING_OPTIONS, } from "./constants";
6
8
  export class PostDatePicker {
7
9
  constructor() {
8
- this.today = new Date();
9
- this.inputDisabled = false;
10
+ /**
11
+ * The date pickers locale (e.g. "it", "it-CH", etc.), which specifies the date format and language.
12
+ * <post-banner type="info" data-size="sm"><span>If not set, it defaults to either the closest ancestor with a `lang` attribute (e.g. \<html lang="de"\>), or falls back to English.</span></post-banner>
13
+ */
14
+ this.locale = this.systemLocale;
10
15
  /**
11
16
  * Whether the date picker expects a range selection or a single date selection.
12
17
  *
@@ -16,17 +21,17 @@ export class PostDatePicker {
16
21
  * Whether the calendar is inline in the page (not showing in a popover when input clicked).
17
22
  */
18
23
  this.inline = false;
24
+ this.inputDisabled = false;
25
+ this.today = new Date();
19
26
  this.startDate = new Date();
20
- this.locale = Build.isBrowser ? document.documentElement.lang : 'en';
21
27
  this.currentViewType = 'days';
22
- this.euFormat = true;
23
28
  this.skipOnSelectCount = 0;
24
29
  this.skipFocusOnNextRender = false;
25
30
  this.handleInputBlur = () => {
26
31
  if (this.range) {
27
- const dates = this.splitRangeDates(this.inputMask.value);
28
- const start = this.dateStrToDate(dates[0]);
29
- const end = this.dateStrToDate(dates[1]);
32
+ const dates = this.inputMask.value.split(this.dateFormatRangeSeparator);
33
+ const start = this.stringToDate(dates[0]);
34
+ const end = this.stringToDate(dates[1]);
30
35
  const startValid = this.isValidDate(start);
31
36
  const endValid = this.isValidDate(end);
32
37
  if (startValid && endValid) {
@@ -35,6 +40,7 @@ export class PostDatePicker {
35
40
  this.skipOnSelectCount = reversed ? 0 : 2; // don't skip if reversed
36
41
  this.dpInstance.selectDate([start, end]);
37
42
  this.dpInstance.setViewDate(start);
43
+ this.postUpdateDates.emit([this.dateToIso(start), this.dateToIso(end)]);
38
44
  }
39
45
  else if (startValid && !endValid) {
40
46
  this.dpInstance.clear();
@@ -46,11 +52,12 @@ export class PostDatePicker {
46
52
  }
47
53
  }
48
54
  else {
49
- const date = this.dateStrToDate(this.inputMask.value);
55
+ const date = this.stringToDate(this.inputMask.value);
50
56
  if (this.isValidDate(date)) {
51
57
  this.skipOnSelectCount = 1;
52
58
  this.dpInstance.selectDate(date);
53
59
  this.dpInstance.setViewDate(date);
60
+ this.postUpdateDates.emit(this.dateToIso(date));
54
61
  }
55
62
  else {
56
63
  this.resetSelection();
@@ -178,6 +185,25 @@ export class PostDatePicker {
178
185
  }
179
186
  };
180
187
  }
188
+ validateLocale() {
189
+ if (!isValidLocale(this.locale)) {
190
+ console.error('The prop `locale` of the `post-date-picker` component must be a valid localeCode (e.g. `en`, `en-GB`, etc.), based on <a href="https://www.rfc-editor.org/info/bcp47">BCP 47 (RFC 5646)</a> standard.');
191
+ }
192
+ }
193
+ async updateLocale() {
194
+ const locale = await this.airLocale();
195
+ this.dpInstance?.update({
196
+ locale: locale,
197
+ dateFormat: locale.dateFormat,
198
+ firstDay: locale.firstDay,
199
+ });
200
+ this.updateMask();
201
+ }
202
+ updateRange() {
203
+ this.dpInstance?.update({ range: this.range });
204
+ this.handleSelectedDates();
205
+ this.updateMask();
206
+ }
181
207
  validateSelectedStartDate() {
182
208
  checkEmptyOrDate(this, 'selectedStartDate');
183
209
  checkIsoDate(this, 'selectedStartDate');
@@ -250,6 +276,142 @@ export class PostDatePicker {
250
276
  console.error('hide: popoverRef is null or undefined');
251
277
  }
252
278
  }
279
+ /**
280
+ * Get the system locale (e.g.`en`, etc.) from the closest parent with a `lang` attribute,
281
+ * or fallback to a default language code if not found or in server environment.
282
+ */
283
+ get systemLocale() {
284
+ if (Build.isServer)
285
+ return FALLBACK_LANGUAGE_CODE;
286
+ return this.host.closest('[lang]')?.getAttribute('lang') ?? FALLBACK_LANGUAGE_CODE;
287
+ }
288
+ /**
289
+ * Get the locale code to use for the date picker, ensuring it is valid and applying fallback if necessary.
290
+ * @info Use `this.localeCode` or `this.languageCode`, instead of `this.locale` when you need to get the
291
+ * locale for the date picker, to ensure you get a valid locale code with fallback applied.
292
+ * `this.locale` can still be used when you want to get the exact value of the `locale` prop without fallback or validation.
293
+ */
294
+ get localeCode() {
295
+ const locale = this.locale ?? FALLBACK_LANGUAGE_CODE;
296
+ return isValidLocale(locale) ? locale : FALLBACK_LANGUAGE_CODE;
297
+ }
298
+ get languageCode() {
299
+ return this.localeCode.split('-')[0];
300
+ }
301
+ /**
302
+ * Get the date format string for the current locale, by formatting a sample date and replacing the date parts
303
+ * with format keys (y, m, d). For example, it will return "dd.mm.yyyy" for "de-CH" locale and "mm/dd/yyyy" for "en-US" locale.
304
+ */
305
+ get dateFormat() {
306
+ const date = new Date(Object.values(DATE_FORMAT_MAP).join('-'));
307
+ // get the locale date format e.g. `22.11.3333` for `de-CH` or `11/22/3333` for `en-US`
308
+ let localeDateString = date.toLocaleDateString(this.localeCode, DATE_FORMAT_STRING_OPTIONS);
309
+ // replace the date parts (3333, 11, 22) with the corresponding format keys (y, m, d)
310
+ for (const [key, value] of Object.entries(DATE_FORMAT_MAP)) {
311
+ // for Thai locale, the year is in Buddhist calendar which is 543 years ahead of Gregorian calendar, so we need to adjust the year value accordingly
312
+ localeDateString = localeDateString.replace(this.isBuddhistCalendar && value.length === 4
313
+ ? (Number(value) + BUDDHIST_CALENDAR_YEAR_OFFSET).toString()
314
+ : value, key);
315
+ }
316
+ return localeDateString;
317
+ }
318
+ /**
319
+ * Determine the text direction (ltr or rtl) based on the language code, to apply the correct styles and layout to the date picker.
320
+ * Use `new Locale(this.localeCode).getTextInfo().direction` as soon as it becomes baseline:
321
+ * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Locale/getTextInfo
322
+ */
323
+ get textDirection() {
324
+ return getLocaleTextDirection(this.localeCode);
325
+ }
326
+ get dateFormatRangeSeparator() {
327
+ return this.textDirection === 'rtl'
328
+ ? `${UNICODE_BIDI.rtl}${DATE_FORMAT_RANGE_SEPARATOR}${UNICODE_BIDI.pop}`
329
+ : DATE_FORMAT_RANGE_SEPARATOR;
330
+ }
331
+ get isBuddhistCalendar() {
332
+ return BUDDHIST_CALENDAR_LOCALES.includes(this.localeCode);
333
+ }
334
+ /**
335
+ * Dynamically load the appropriate locale module for the date picker.
336
+ * @returns The locale module for the Air date picker.
337
+ */
338
+ async airLocale() {
339
+ let localeName = FALLBACK_LANGUAGE_CODE;
340
+ if (airDatepickerLocales[this.languageCode]) {
341
+ localeName = this.languageCode;
342
+ }
343
+ else {
344
+ console.warn(`Post Date Picker: Locale module "${this.localeCode}" not found! Falling back to "${FALLBACK_LANGUAGE_CODE}".`);
345
+ }
346
+ const module = await airDatepickerLocales[localeName]?.();
347
+ return module.default;
348
+ }
349
+ /**
350
+ * Convert a date object to a localized date string and vice versa.
351
+ * @param date A localtime date object.
352
+ * @returns A localized date string, depending on the given `localeCode` and the given `options`.
353
+ */
354
+ dateToString(date) {
355
+ const dateString = date.toLocaleDateString(this.localeCode, DATE_FORMAT_STRING_OPTIONS);
356
+ const yearString = date.getFullYear().toString();
357
+ if (yearString.length < 4) {
358
+ return dateString.replace(yearString, yearString.padStart(4, '0'));
359
+ }
360
+ return dateString;
361
+ }
362
+ /**
363
+ * Convert a localized date string to a date object.
364
+ * The date string should be in the same format as the date picker's `dateFormat`, which depends on the given `localeCode`.
365
+ * @param localeDateString A localized date string.
366
+ * @returns A localtime date object.
367
+ */
368
+ stringToDate(localeDateString) {
369
+ // Match the separator chars in the date format (e.g. "." for "dd.mm.yyyy", etc.).
370
+ const dateSeparator = this.dateFormat.match(DATE_FORMAT_SEPARATOR_REGEX)[0];
371
+ // Remove the text direction markers, split the date string into its parts (e.g. ["31", "01", "2026"], etc.)
372
+ // and make sure its values only contains digits (e.g. for "bg-BG", etc.).
373
+ const dateParts = localeDateString
374
+ .replace(TEXT_DIRECTION_MARKERS_REGEX, '')
375
+ .split(dateSeparator)
376
+ .map(p => p.replaceAll(/[^\d]/g, ''));
377
+ // Split the dateFormat into its parts to get the year, month, day order (e.g. ["d", "m", "y"], etc.).
378
+ // Removing everything else but the DATE_FORMAT_KEYS is necessary to support date formats with additional chars (e.g. "d.m.y г.", etc.).
379
+ const formatParts = this.dateFormat.replace(DATE_FORMAT_KEYS_REGEX, '').split('');
380
+ // Map the datePart values to their corresponding keys (e.g. y, m, d),
381
+ // to construct an ISO date string (e.g. "2026-01-31") that can be parsed by the Date constructor.
382
+ // This is necessary because different locale date formats may have different orders (e.g. "ymd", "dmy", "mdy", etc.).
383
+ const { y, m, d } = DATE_FORMAT_KEYS.reduce((parts, key) => ({
384
+ ...parts,
385
+ [key]: dateParts[formatParts.indexOf(key)],
386
+ }), {});
387
+ // Adjust for Thai Buddhist calendar
388
+ const year = this.isBuddhistCalendar
389
+ ? (Number(y) - BUDDHIST_CALENDAR_YEAR_OFFSET).toString()
390
+ : y;
391
+ return this.isoToDate([year, m, d].join('-'));
392
+ }
393
+ /**
394
+ * Convert a date object to an ISO 8601 formatted date string (YYYY-MM-DD) and vice versa.
395
+ * @param date A localtime date object.
396
+ * @returns An iso formatted, localtime date string.
397
+ */
398
+ dateToIso(date) {
399
+ // The swedish locale (`sv`) happens to format the date in the exact ISO format (YYYY-MM-DD),
400
+ // so we can use it as a shortcut instead of manually constructing the string from the date parts.
401
+ return date.toLocaleDateString('sv', DATE_FORMAT_STRING_OPTIONS);
402
+ }
403
+ /**
404
+ * Convert an ISO 8601 formatted date string (YYYY-MM-DD) to a localtime date object.
405
+ * @param isoDateString An iso formatted, localtime date string.
406
+ * @returns A localtime date object.
407
+ */
408
+ isoToDate(isoDateString) {
409
+ return new Date(`${this.padIsoDate(isoDateString)}T00:00`);
410
+ }
411
+ padIsoDate(isoDateString) {
412
+ const valueParts = isoDateString.split('-');
413
+ return `${valueParts[0].padStart(4, '0')}-${valueParts[1]}-${valueParts[2]}`;
414
+ }
253
415
  setupInputObserver() {
254
416
  if (typeof MutationObserver === 'undefined')
255
417
  return;
@@ -388,78 +550,80 @@ export class PostDatePicker {
388
550
  });
389
551
  body.removeEventListener('keydown', this.handleGridKeydown);
390
552
  body.addEventListener('keydown', this.handleGridKeydown);
391
- this.setActiveCell(this.isoToDate(this.selectedStartDate) || this.today, focusOnDate);
553
+ this.setActiveCell((this.selectedStartDate && this.isoToDate(this.selectedStartDate)) || this.today, focusOnDate);
392
554
  }
393
555
  /**
394
556
  * Set up the masks on the inputs to reflect the date pickers
395
557
  */
396
558
  setUpMask() {
397
- const usBlockOpts = {
398
- pattern: 'm{/}`d{/}`Y',
399
- format: (date) => {
400
- if (!date)
401
- return '';
402
- const day = String(date.getDate()).padStart(2, '0');
403
- const month = String(date.getMonth() + 1).padStart(2, '0');
404
- const year = date.getFullYear();
405
- return [month, day, year].join('/');
406
- },
407
- parse: (str) => {
408
- const [month, day, year] = str.split('/').map(Number);
409
- return new Date(year, month - 1, day);
559
+ // WARNING: using the DATE_FORMAT_SEPARATOR_REGEX is mandatory here,
560
+ // because `this.dateFormat` can possibly contain unicode bidi characters!
561
+ const maskPattern = this.dateFormat; //.replace(DATE_FORMAT_SEPARATOR_REGEX, m => `${m}\``);
562
+ const baseMaskOptions = {
563
+ mask: Date,
564
+ pattern: maskPattern,
565
+ format: this.dateToString.bind(this),
566
+ parse: this.stringToDate.bind(this),
567
+ blocks: {
568
+ y: {
569
+ mask: IMask.MaskedRange,
570
+ from: 101, // dates from 0100-01-31 and earlier are causing issues in air-datepicker
571
+ to: 9999,
572
+ maxLength: 4,
573
+ placeholderChar: Object.keys(DATE_FORMAT_MAP)[0],
574
+ },
575
+ m: {
576
+ mask: IMask.MaskedRange,
577
+ from: 1,
578
+ to: 12,
579
+ placeholderChar: Object.keys(DATE_FORMAT_MAP)[1],
580
+ },
581
+ d: {
582
+ mask: IMask.MaskedRange,
583
+ from: 1,
584
+ to: 31,
585
+ placeholderChar: Object.keys(DATE_FORMAT_MAP)[2],
586
+ },
410
587
  },
588
+ min: this.min ? new Date(`${this.padIsoDate(this.min)}T00:00`) : null,
589
+ max: this.max ? new Date(`${this.padIsoDate(this.max)}T00:00`) : null,
411
590
  };
412
- const baseDateOpts = {
413
- mask: Date,
414
- min: this.min ? new Date(this.min) : null,
415
- max: this.max ? new Date(this.max) : null,
591
+ const singleMaskOptions = {
592
+ ...baseMaskOptions,
593
+ lazy: false,
594
+ overwrite: true,
416
595
  };
417
- if (this.range) {
418
- const baseRangeOpts = {
419
- mask: 'from - to',
420
- lazy: false,
421
- overwrite: true,
422
- };
423
- if (this.euFormat) {
424
- const options = {
425
- ...baseRangeOpts,
426
- blocks: { from: baseDateOpts, to: baseDateOpts },
427
- };
428
- this.inputMask = IMask(this.dpInput, options);
429
- }
430
- else {
431
- const options = {
432
- ...baseRangeOpts,
433
- blocks: {
434
- from: { ...baseDateOpts, ...usBlockOpts },
435
- to: { ...baseDateOpts, ...usBlockOpts },
436
- },
437
- };
438
- this.inputMask = IMask(this.dpInput, options);
439
- }
440
- }
441
- else {
442
- const baseSingleOpts = {
443
- ...baseDateOpts,
444
- lazy: false,
445
- overwrite: true,
446
- };
447
- if (this.euFormat) {
448
- const options = baseSingleOpts;
449
- this.inputMask = IMask(this.dpInput, options);
450
- }
451
- else {
452
- const options = { ...baseSingleOpts, ...usBlockOpts };
453
- this.inputMask = IMask(this.dpInput, options);
596
+ const rangeMaskOptions = {
597
+ mask: `from${this.dateFormatRangeSeparator}to`,
598
+ blocks: {
599
+ from: { ...baseMaskOptions },
600
+ to: { ...baseMaskOptions },
601
+ },
602
+ lazy: false,
603
+ overwrite: true,
604
+ };
605
+ this.inputMask = IMask(this.dpInput, this.range ? rangeMaskOptions : singleMaskOptions);
606
+ }
607
+ updateMask() {
608
+ if (!this.inline) {
609
+ this.inputMask.destroy();
610
+ this.setUpMask();
611
+ if (this.dpInstance.selectedDates.length > 0) {
612
+ if (this.range) {
613
+ this.inputMask.value = this.dpInstance.selectedDates
614
+ .map(d => this.dateToString(d))
615
+ .join(this.dateFormatRangeSeparator);
616
+ }
617
+ else {
618
+ this.inputMask.value = this.dateToString(this.dpInstance.selectedDates[0]);
619
+ }
454
620
  }
455
621
  }
456
622
  }
457
- configDatePicker() {
458
- const slot = this.host.shadowRoot.querySelector('slot');
459
- const assignedNodes = slot && slot.assignedElements();
460
- const locale = localesMap[this.locale] || localesMap.en;
623
+ async configDatePicker() {
624
+ const locale = await this.airLocale();
461
625
  if (!this.inline) {
462
- this.dpInput = assignedNodes?.find(el => el.tagName === 'INPUT');
626
+ this.dpInput = this.host.querySelector('input');
463
627
  this.setUpMask();
464
628
  }
465
629
  this.dpContainer = this.host.shadowRoot.querySelector('.datepicker-container');
@@ -478,12 +642,12 @@ export class PostDatePicker {
478
642
  selectOtherYears: true,
479
643
  showOtherMonths: false,
480
644
  moveToOtherMonthsOnSelect: true,
481
- firstDay: 1,
482
645
  startDate: this.startDate,
483
646
  minDate: this.min,
484
647
  maxDate: this.max,
485
648
  locale: locale,
486
- dateFormat: (localesMap[this.locale] || localesMap.en).dateFormat,
649
+ dateFormat: locale.dateFormat,
650
+ firstDay: locale.firstDay,
487
651
  view: 'days',
488
652
  onChangeView: view => {
489
653
  this.currentViewType = view;
@@ -520,13 +684,14 @@ export class PostDatePicker {
520
684
  // Assign value to the input, close the popover and focus on the input
521
685
  if (this.dpInput) {
522
686
  if (Array.isArray(date)) {
523
- const dates = date.map(d => this.dateToDateStr(d));
524
- this.inputMask.value = dates.join(' - ');
687
+ this.inputMask.value = date
688
+ .map(d => this.dateToString(d))
689
+ .join(this.dateFormatRangeSeparator);
525
690
  this.updateInputValue();
526
691
  }
527
692
  else if (date) {
528
693
  // If there is a date, set it to the input. No date = same date as before
529
- this.inputMask.value = this.dateToDateStr(date);
694
+ this.inputMask.value = this.dateToString(date);
530
695
  this.updateInputValue();
531
696
  }
532
697
  // If range & only one date has been selected, user should stay in the DP
@@ -534,7 +699,7 @@ export class PostDatePicker {
534
699
  return;
535
700
  }
536
701
  this.popoverRef?.hide();
537
- requestAnimationFrame(() => this.dpInput.focus());
702
+ requestAnimationFrame(() => this.dpTrigger.focus());
538
703
  }
539
704
  },
540
705
  onShow: () => {
@@ -587,48 +752,15 @@ export class PostDatePicker {
587
752
  this.titleBtn.addEventListener('click', this.forceTitleClickToYear, { capture: true });
588
753
  });
589
754
  }
590
- splitRangeDates(rangeStr) {
591
- return rangeStr.split(' - ');
592
- }
593
- isoToDate(iso) {
594
- if (!isIsoDate(iso))
595
- return null;
596
- const [y, m, d] = iso.split('-').map(Number);
597
- return new Date(y, m - 1, d);
598
- }
599
- dateToIso(date) {
600
- return `${date.getFullYear()}-${String(date.getMonth() + 1).padStart(2, '0')}-${String(date.getDate()).padStart(2, '0')}`;
601
- }
602
- dateStrToDate(dateStr) {
603
- return this.euFormat ? this.euDateStrToDate(dateStr) : this.usDateStrToDate(dateStr);
604
- }
605
- euDateStrToDate(dateStr) {
606
- const [d, m, y] = dateStr.split('.');
607
- return new Date(+y, +m - 1, +d);
608
- }
609
- usDateStrToDate(dateStr) {
610
- const [m, d, y] = dateStr.split('/');
611
- return new Date(+y, +m - 1, +d);
612
- }
613
- dateToDateStr(date) {
614
- return this.euFormat ? this.dateToEuDateStr(date) : this.dateToUSDateStr(date);
615
- }
616
- dateToEuDateStr(date) {
617
- return `${String(date.getDate()).padStart(2, '0')}.${String(date.getMonth() + 1).padStart(2, '0')}.${date.getFullYear()}`;
618
- }
619
- dateToUSDateStr(date) {
620
- return `${String(date.getMonth() + 1).padStart(2, '0')}/${String(date.getDate()).padStart(2, '0')}/${date.getFullYear()}`;
621
- }
622
755
  /**
623
756
  * Add role and aria-label to each grid cell
624
757
  */
625
758
  internalOnRenderCell({ date, cellType }) {
626
- const safeLocale = this.locale || 'en';
627
759
  if (cellType === 'day') {
628
760
  return {
629
761
  attrs: {
630
762
  'role': 'gridcell',
631
- 'aria-label': date.toLocaleDateString(safeLocale, {
763
+ 'aria-label': date.toLocaleDateString(this.localeCode, {
632
764
  weekday: 'long',
633
765
  year: 'numeric',
634
766
  month: 'long',
@@ -641,7 +773,7 @@ export class PostDatePicker {
641
773
  return {
642
774
  attrs: {
643
775
  'role': 'gridcell',
644
- 'aria-label': date.toLocaleDateString(safeLocale, {
776
+ 'aria-label': date.toLocaleDateString(this.localeCode, {
645
777
  year: 'numeric',
646
778
  month: 'long',
647
779
  }),
@@ -652,7 +784,7 @@ export class PostDatePicker {
652
784
  return {
653
785
  attrs: {
654
786
  'role': 'gridcell',
655
- 'aria-label': date.toLocaleDateString(safeLocale, {
787
+ 'aria-label': date.toLocaleDateString(this.localeCode, {
656
788
  year: 'numeric',
657
789
  }),
658
790
  },
@@ -742,11 +874,11 @@ export class PostDatePicker {
742
874
  this.inputDisabled = this.dpInput.disabled;
743
875
  }
744
876
  async componentDidLoad() {
745
- this.euFormat = document.documentElement.lang !== 'en-US';
746
- this.configDatePicker();
877
+ await this.configDatePicker();
747
878
  this.setupGridObserver();
748
879
  this.setupNavObserver();
749
880
  this.setupInputObserver();
881
+ this.validateLocale();
750
882
  this.validateSelectedStartDate();
751
883
  this.validateSelectedEndDate();
752
884
  this.validateMin();
@@ -787,11 +919,11 @@ export class PostDatePicker {
787
919
  }
788
920
  }
789
921
  render() {
790
- return (h(Host, { key: 'b721b731d9ad4ff3c6d80c995a3c471786b6425a' }, this.inline && h("div", { key: '9dc37bf0ab23a5ce611139d0efd7f3fca4f6e6e2', class: "datepicker-container" }), !this.inline && (h("div", { key: 'f2e0376510e5e26a98e29703fbf11c0be90266bb' }, h("div", { key: '52e05c2f28a725c5336fca16842e97ce21a36b42', class: {
922
+ return (h(Host, { key: 'c1203edb0b72d93a5e936c595a891dd8e46b671f', "data-version": version }, this.inline && h("div", { key: 'f327dd6dff018d8ce332c519bcd94f2a5a1e91d4', class: "datepicker-container" }), !this.inline && (h("div", { key: '1156f8c3f539d99ed273e1ccfdb2c63660d9a11b', dir: this.textDirection }, h("div", { key: 'bd0a9fc399f9fdb943887ab5881ad363e3de7b5f', class: {
791
923
  'calendar-input': !this.range,
792
924
  'calendar-input-range': this.range,
793
925
  'disabled': this.inputDisabled,
794
- } }, h("slot", { key: '11147329e23c51b3bf7c5fa2925cbf97d26c9da2' }), h("button", { key: 'c57f2450bd8ce1976876a8bc11f7d238300ca687', onClick: () => this.show(), "aria-haspopup": "true", "aria-label": this.textToggleCalendar, disabled: this.inputDisabled }, h("post-icon", { key: 'd6a37bfc1471a8eabbf3e0450c3010da8e7ef28e', name: "calendar" }))), h("post-popovercontainer", { key: 'fd4259c066d92c5bbf1066940da72f74a58bdfe8', placement: "bottom-end", offset: PostDatePicker.FLYOUT_OFFSET, ref: e => (this.popoverRef = e) }, h("div", { key: '0ba6ef3f33a003317ab70728e1c67fc8c1d726a9', class: "datepicker-container" }))))));
926
+ } }, h("slot", { key: '5e13d9746d5e95cfa0cbcffffecad62eb8e666af' }), h("button", { key: '5b0133694198472b31f666c69b56ffd90d8fcc84', onClick: () => this.show(), "aria-haspopup": "true", "aria-label": this.textToggleCalendar, disabled: this.inputDisabled, ref: e => (this.dpTrigger = e) }, h("post-icon", { key: '2b68084d2b9bdff3c9ffe5de9fb4eee8e8d5f6b5', name: "calendar" }))), h("post-popovercontainer", { key: '6f71be7bba17e6fdaca9ae5238291faaea7fa1ad', placement: "bottom-end", offset: PostDatePicker.FLYOUT_OFFSET, ref: e => (this.popoverRef = e) }, h("div", { key: '5497f1f9128f15f4f229f99d0b445abfabc8a2ae', class: "datepicker-container" }))))));
795
927
  }
796
928
  static get is() { return "post-date-picker"; }
797
929
  static get encapsulation() { return "shadow"; }
@@ -807,9 +939,9 @@ export class PostDatePicker {
807
939
  }
808
940
  static get properties() {
809
941
  return {
810
- "selectedStartDate": {
942
+ "locale": {
811
943
  "type": "string",
812
- "mutable": true,
944
+ "mutable": false,
813
945
  "complexType": {
814
946
  "original": "string",
815
947
  "resolved": "string",
@@ -819,14 +951,35 @@ export class PostDatePicker {
819
951
  "optional": true,
820
952
  "docs": {
821
953
  "tags": [],
822
- "text": "The date picker's selected date. If in range mode, the selected start date.\nMust be a valid date in ISO 8601 format (YYYY-MM-DD)."
954
+ "text": "The date pickers locale (e.g. \"it\", \"it-CH\", etc.), which specifies the date format and language.\n<post-banner type=\"info\" data-size=\"sm\"><span>If not set, it defaults to either the closest ancestor with a `lang` attribute (e.g. \\<html lang=\"de\"\\>), or falls back to English.</span></post-banner>"
823
955
  },
824
956
  "getter": false,
825
957
  "setter": false,
826
958
  "reflect": false,
827
- "attribute": "selected-start-date"
959
+ "attribute": "locale",
960
+ "defaultValue": "this.systemLocale"
828
961
  },
829
- "selectedEndDate": {
962
+ "range": {
963
+ "type": "boolean",
964
+ "mutable": false,
965
+ "complexType": {
966
+ "original": "boolean",
967
+ "resolved": "boolean",
968
+ "references": {}
969
+ },
970
+ "required": false,
971
+ "optional": true,
972
+ "docs": {
973
+ "tags": [],
974
+ "text": "Whether the date picker expects a range selection or a single date selection."
975
+ },
976
+ "getter": false,
977
+ "setter": false,
978
+ "reflect": false,
979
+ "attribute": "range",
980
+ "defaultValue": "false"
981
+ },
982
+ "selectedStartDate": {
830
983
  "type": "string",
831
984
  "mutable": true,
832
985
  "complexType": {
@@ -838,32 +991,31 @@ export class PostDatePicker {
838
991
  "optional": true,
839
992
  "docs": {
840
993
  "tags": [],
841
- "text": "The date picker's selected end date (for range date picker only).\nMust be a valid date in ISO 8601 format (YYYY-MM-DD)."
994
+ "text": "The date picker's selected date. If in range mode, the selected start date.\nMust be a valid date in ISO 8601 format (YYYY-MM-DD)."
842
995
  },
843
996
  "getter": false,
844
997
  "setter": false,
845
998
  "reflect": false,
846
- "attribute": "selected-end-date"
999
+ "attribute": "selected-start-date"
847
1000
  },
848
- "range": {
849
- "type": "boolean",
850
- "mutable": false,
1001
+ "selectedEndDate": {
1002
+ "type": "string",
1003
+ "mutable": true,
851
1004
  "complexType": {
852
- "original": "boolean",
853
- "resolved": "boolean",
1005
+ "original": "string",
1006
+ "resolved": "string",
854
1007
  "references": {}
855
1008
  },
856
1009
  "required": false,
857
1010
  "optional": true,
858
1011
  "docs": {
859
1012
  "tags": [],
860
- "text": "Whether the date picker expects a range selection or a single date selection."
1013
+ "text": "The date picker's selected end date (for range date picker only).\nMust be a valid date in ISO 8601 format (YYYY-MM-DD)."
861
1014
  },
862
1015
  "getter": false,
863
1016
  "setter": false,
864
1017
  "reflect": false,
865
- "attribute": "range",
866
- "defaultValue": "false"
1018
+ "attribute": "selected-end-date"
867
1019
  },
868
1020
  "min": {
869
1021
  "type": "string",
@@ -1102,10 +1254,9 @@ export class PostDatePicker {
1102
1254
  }
1103
1255
  static get states() {
1104
1256
  return {
1105
- "today": {},
1106
1257
  "inputDisabled": {},
1107
- "startDate": {},
1108
- "locale": {}
1258
+ "today": {},
1259
+ "startDate": {}
1109
1260
  };
1110
1261
  }
1111
1262
  static get events() {
@@ -1167,6 +1318,15 @@ export class PostDatePicker {
1167
1318
  static get elementRef() { return "host"; }
1168
1319
  static get watchers() {
1169
1320
  return [{
1321
+ "propName": "locale",
1322
+ "methodName": "validateLocale"
1323
+ }, {
1324
+ "propName": "locale",
1325
+ "methodName": "updateLocale"
1326
+ }, {
1327
+ "propName": "range",
1328
+ "methodName": "updateRange"
1329
+ }, {
1170
1330
  "propName": "selectedStartDate",
1171
1331
  "methodName": "validateSelectedStartDate"
1172
1332
  }, {
@@ -56,7 +56,7 @@ export class PostFooter {
56
56
  return GRID_SLOTS.map(slotName => (h("div", { class: { 'd-none': !this.gridSlotDisplayed[slotName] } }, h("h3", null, h("slot", { name: slotName + '-title' })), h("slot", { onSlotchange: this.handleGridSlotChange('tablet', 'desktop'), name: slotName }))));
57
57
  }
58
58
  render() {
59
- return (h(Host, { key: 'b144591b02f0e8010d9e4bbba34841151ba6b3b9', "data-version": version, "data-color-scheme": "light" }, h("footer", { key: '1f83f8ecf0e07ebd05f4ed9c45f6d2f6fe141422' }, h("h2", { key: 'fdfc10c2be686d97c2a994fd069109ec46444626', class: "visually-hidden" }, this.textFooter), h("div", { key: 'a89e56546788b71790747c8ee57b4d2fe5d8ae1f', class: "footer-container" }, h("div", { key: '407518b583499c90002de8baa1cd955e8e123daa', class: "footer-grid" }, this.device === 'mobile' ? this.renderAccordion() : this.renderColumns()), h("div", { key: '9c46b21064994229a1132b77432d9193a58e1dd4', class: "footer-column" }, h("div", { key: 'f2686c80b116869255a2ae5087d5c0a72f5b57f3', class: "footer-socialmedia" }, h("slot", { key: 'a3120b829237f2e82a7fb6ed897bc4ad8fc0ab44', name: "socialmedia" })), h("div", { key: '3f868a04bc8a9952ca13041e630433ba4c4012c4', class: "footer-app" }, h("slot", { key: '9325886b54b36bcc0dafa6b683fa9415b55590ce', name: "app" }))), h("div", { key: '9b1382957dbe4eb9e2fb7a717b528fc76f18c1f6', class: "footer-businesssectors" }, h("slot", { key: 'a38e36aeca86bd27c062624456bde8fa92349af9', name: "businesssectors" })), h("div", { key: '65f1e95887a715de194420ace838695cfafed7ac', class: "footer-meta" }, h("slot", { key: 'bbb052400f6f65853784c5e3f7ecfbaa9b87e8cb', name: "meta" })), h("div", { key: '98a70e130ac05af4d9d5d3aaefb8ac473056c339', class: "footer-copyright" }, h("slot", { key: 'ed7ac57a7862a32050d0481fa6d5cad45cd02677', name: "copyright" }))))));
59
+ return (h(Host, { key: '09861845febd1bff02333f80f0abf78e3254926c', "data-version": version, "data-color-scheme": "light" }, h("footer", { key: '356ced9b17a9e46db52a18834b41b3463bc1abac' }, h("h2", { key: 'da914976a9f50a06f8d79cb1c2c33251922e31ea', class: "visually-hidden" }, this.textFooter), h("div", { key: '4b9b6b45bf6784110603e632502c5470c93f3252', class: "footer-container" }, h("div", { key: 'bdac516b970b710128a25a9e42bc8ef19176c75c', class: "footer-grid" }, this.device === 'mobile' ? this.renderAccordion() : this.renderColumns()), h("div", { key: 'c1304673455570f5a19e05c141e12113dde30a36', class: "footer-column" }, h("div", { key: 'b1f8ac3ea1083713e4a380fe3f172ba078195e4f', class: "footer-socialmedia" }, h("slot", { key: '1efa03d1c601dedc974214628488009872829109', name: "socialmedia" })), h("div", { key: '90efd1be2cb94f96e5932cc8fa7faff279d83146', class: "footer-app" }, h("slot", { key: '89a3b05f64d766c5d519b8e2af6c7a18ed260eb4', name: "app" }))), h("div", { key: '48cf8edf63633769e2c41e9b606c0b398cea9fdc', class: "footer-businesssectors" }, h("slot", { key: '2bf2e29c9922b5e1a8343dd72e2ce905c813858f', name: "businesssectors" })), h("div", { key: '78d93e0c518811340660a5c5050dc075ff9933a9', class: "footer-meta" }, h("slot", { key: '1c42433f304a8443ad57484fbe06b6ac870dfcfa', name: "meta" })), h("div", { key: '0508d5d02307b317572038e3de0c6a21372dd072', class: "footer-copyright" }, h("slot", { key: 'ea38c93ef2f43d39a0669b764a89c9f78fc1d10a', name: "copyright" }))))));
60
60
  }
61
61
  static get is() { return "post-footer"; }
62
62
  static get encapsulation() { return "shadow"; }