@baloise/ds-core 19.8.4 → 19.9.0-nightly.20260305

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 (281) hide show
  1. package/components/all.d.ts +2 -0
  2. package/components/all.js +3 -0
  3. package/components/animation.decorator.js +1 -1
  4. package/components/bal-accordion.js +1 -1
  5. package/components/bal-app.js +1 -102
  6. package/components/bal-app2.js +104 -0
  7. package/components/bal-button2.js +1 -1
  8. package/components/bal-carousel-item.js +1 -1
  9. package/components/bal-checkbox-group.js +1 -1
  10. package/components/bal-date-calendar2.js +1 -1
  11. package/components/bal-date.js +1 -1
  12. package/components/bal-doc-app.d.ts +11 -0
  13. package/components/bal-doc-app.js +264 -0
  14. package/components/bal-dropdown.js +1 -1
  15. package/components/bal-field.js +1 -1
  16. package/components/bal-footer.js +1 -1
  17. package/components/bal-form.js +1 -1
  18. package/components/bal-input-stepper.js +1 -1
  19. package/components/bal-list-item-accordion-body2.js +1 -1
  20. package/components/bal-list-item2.js +1 -1
  21. package/components/bal-logo.animation.js +77 -940
  22. package/components/bal-logo2.js +35 -20
  23. package/components/bal-modal.js +1 -1
  24. package/components/bal-nav.js +1 -1
  25. package/components/bal-navbar-brand.js +1 -1
  26. package/components/bal-option-list2.js +1 -1
  27. package/components/bal-popup2.js +1 -1
  28. package/components/bal-radio-group.js +1 -1
  29. package/components/bal-segment-item.js +1 -1
  30. package/components/bal-select2.js +1 -1
  31. package/components/bal-spinner2.js +1 -1
  32. package/components/bal-stage-image.js +1 -1
  33. package/components/bal-tabs2.js +1 -1
  34. package/components/breakpoints.subject.js +1 -1
  35. package/components/config.default.js +1 -0
  36. package/components/element-states.decorator.js +1 -1
  37. package/components/floating-ui.js +1 -1
  38. package/components/focus.decorator.js +1 -1
  39. package/components/form-input.js +1 -1
  40. package/components/helpers.js +1 -1
  41. package/components/index.js +5 -440
  42. package/components/initialize.js +450 -0
  43. package/components/mutation.decorator.js +1 -1
  44. package/components/overlays.js +1 -1
  45. package/components/resize.decorator.js +1 -1
  46. package/components/swipe.subject.js +1 -1
  47. package/components/swiper.util.js +1 -1
  48. package/components/tokens.esm.js +1 -1
  49. package/components/visibility.decorator.js +1 -1
  50. package/dist/baloise-design-system/baloise-design-system.esm.js +1 -1
  51. package/dist/baloise-design-system/baloise-design-system.js +1 -1
  52. package/dist/baloise-design-system/index.esm.js +1 -1
  53. package/dist/baloise-design-system/{p-a53c24274c.entry.js → p-0077e5a12f.entry.js} +1 -1
  54. package/dist/baloise-design-system/p-01a0ac82ed.entry.js +1 -0
  55. package/dist/baloise-design-system/{p-0db571d8f2.system.entry.js → p-03ca192ad3.system.entry.js} +1 -1
  56. package/dist/baloise-design-system/{p-cb3abec4bd.system.entry.js → p-20d311432c.system.entry.js} +1 -1
  57. package/dist/baloise-design-system/p-21ea7b32f1.system.entry.js +1 -0
  58. package/dist/baloise-design-system/{p-b01f9c5651.entry.js → p-2333a469fa.entry.js} +1 -1
  59. package/dist/baloise-design-system/{p-e2e7e3c5c4.entry.js → p-2f4b1993cc.entry.js} +1 -1
  60. package/dist/baloise-design-system/p-3VlTyI5Z.system.js +1 -0
  61. package/dist/baloise-design-system/{p-41dcd76f1f.system.entry.js → p-40a2f8778f.system.entry.js} +1 -1
  62. package/dist/baloise-design-system/{p-a32d50871a.system.entry.js → p-40f2569a17.system.entry.js} +1 -1
  63. package/dist/baloise-design-system/{p-70bdd60500.system.entry.js → p-41c63c9a82.system.entry.js} +1 -1
  64. package/dist/baloise-design-system/{p-f55a98dc20.entry.js → p-4b11899c5c.entry.js} +1 -1
  65. package/dist/baloise-design-system/{p-1df2fb625c.entry.js → p-4b2eeb8c37.entry.js} +1 -1
  66. package/dist/baloise-design-system/{p-8cf1d029e7.entry.js → p-4be902176f.entry.js} +1 -1
  67. package/dist/baloise-design-system/{p-31abb1f859.entry.js → p-54f5a92feb.entry.js} +1 -1
  68. package/dist/baloise-design-system/{p-f91be8b19a.entry.js → p-561277b588.entry.js} +1 -1
  69. package/dist/baloise-design-system/{p-6670584628.entry.js → p-5d1e1b4fa5.entry.js} +1 -1
  70. package/dist/baloise-design-system/{p-c29bcf4e69.entry.js → p-5ecc0f5e73.entry.js} +1 -1
  71. package/dist/baloise-design-system/{p-9da9d45bda.system.entry.js → p-6191805e40.system.entry.js} +1 -1
  72. package/dist/baloise-design-system/{p-1074fb7fbc.entry.js → p-65b8790526.entry.js} +1 -1
  73. package/dist/baloise-design-system/{p-cd6d0bfa91.system.entry.js → p-69234b4abe.system.entry.js} +1 -1
  74. package/dist/baloise-design-system/p-72a362d237.system.entry.js +1 -0
  75. package/dist/baloise-design-system/{p-93dc4e9ec8.entry.js → p-733dd88fe5.entry.js} +1 -1
  76. package/dist/baloise-design-system/{p-b38b2e9484.system.entry.js → p-772db94619.system.entry.js} +1 -1
  77. package/dist/baloise-design-system/{p-f6238b798a.system.entry.js → p-79006350e3.system.entry.js} +1 -1
  78. package/dist/baloise-design-system/{p-26764b092e.entry.js → p-7b52e9987d.entry.js} +1 -1
  79. package/dist/baloise-design-system/{p-d94f439c3b.system.entry.js → p-9191e04f14.system.entry.js} +1 -1
  80. package/dist/baloise-design-system/{p-5a66d8f568.entry.js → p-919d365894.entry.js} +1 -1
  81. package/dist/baloise-design-system/{p-f8b560b22f.system.entry.js → p-9334235334.system.entry.js} +1 -1
  82. package/dist/baloise-design-system/{p-d4252ea848.system.entry.js → p-9417cf5581.system.entry.js} +1 -1
  83. package/dist/baloise-design-system/{p-ac1cd5a1e1.system.entry.js → p-979dfed703.system.entry.js} +1 -1
  84. package/dist/baloise-design-system/{p-878f4e40a8.entry.js → p-9a934ccae7.entry.js} +1 -1
  85. package/dist/baloise-design-system/p-9ca0a9bf5c.entry.js +1 -0
  86. package/dist/baloise-design-system/p-BFRjY4w3.js +1 -0
  87. package/dist/baloise-design-system/p-BRAmUyPx.system.js +1 -0
  88. package/dist/baloise-design-system/{p-BVitEMYC.system.js → p-BSDw9H4A.system.js} +1 -1
  89. package/dist/baloise-design-system/{p-COIM5Kkz.js → p-BS_noTB2.js} +1 -1
  90. package/dist/baloise-design-system/{p-B3ZVog4n.system.js → p-Bj94DsFM.system.js} +1 -1
  91. package/dist/baloise-design-system/p-BvSkuJ_n.js +1 -0
  92. package/dist/baloise-design-system/p-BzIZLOtt.system.js +1 -0
  93. package/dist/baloise-design-system/p-CBkFUwrD.js +1 -0
  94. package/dist/baloise-design-system/p-CM3hCeNH.js +1 -0
  95. package/dist/baloise-design-system/p-C_qvcMEM.system.js +1 -0
  96. package/dist/baloise-design-system/p-CuyVPNj2.system.js +1 -0
  97. package/dist/baloise-design-system/p-DRGlmaYw.system.js +1 -0
  98. package/dist/baloise-design-system/{p-CgBveYeB.js → p-Dpr8A2IY.js} +1 -1
  99. package/dist/baloise-design-system/p-Ectc3YAG.js +1 -0
  100. package/dist/baloise-design-system/{p-ReLIdwsB.js → p-KYT2bmpn.js} +1 -1
  101. package/dist/baloise-design-system/p-Yg1qLcvR.js +1 -0
  102. package/dist/baloise-design-system/{p-3f596ba050.entry.js → p-a10bc9e5d8.entry.js} +1 -1
  103. package/dist/baloise-design-system/{p-4256f1331b.entry.js → p-a3c4c9d422.entry.js} +1 -1
  104. package/dist/baloise-design-system/{p-a2a1ed74fe.system.entry.js → p-ad0384474e.system.entry.js} +1 -1
  105. package/dist/baloise-design-system/{p-93311a064b.system.entry.js → p-aec5e73a82.system.entry.js} +1 -1
  106. package/dist/baloise-design-system/{p-0b05d342f5.entry.js → p-b13d48cf28.entry.js} +1 -1
  107. package/dist/baloise-design-system/{p-b4ff1b324f.system.entry.js → p-b27bea7701.system.entry.js} +1 -1
  108. package/dist/baloise-design-system/{p-dcebb4b8a2.system.entry.js → p-b43e8e98b9.system.entry.js} +1 -1
  109. package/dist/baloise-design-system/{p-26085b7dcc.system.entry.js → p-ba9bb78608.system.entry.js} +1 -1
  110. package/dist/baloise-design-system/{p-f682c289a1.system.entry.js → p-c8491fda99.system.entry.js} +1 -1
  111. package/dist/baloise-design-system/{p-c291d986ba.entry.js → p-ce2de36f43.entry.js} +1 -1
  112. package/dist/baloise-design-system/{p-4aeaa1a916.system.entry.js → p-d20d698c0b.system.entry.js} +1 -1
  113. package/dist/baloise-design-system/{p-81a7d8f03d.entry.js → p-daceb2fb50.entry.js} +1 -1
  114. package/dist/baloise-design-system/{p-38fa211868.entry.js → p-e7aa8239c9.entry.js} +1 -1
  115. package/dist/baloise-design-system/{p-133b5a4986.entry.js → p-ea9aa92049.entry.js} +1 -1
  116. package/dist/baloise-design-system/{p-e1b3b1f609.system.entry.js → p-ec911df779.system.entry.js} +1 -1
  117. package/dist/baloise-design-system/{p-f6cb5253aa.system.entry.js → p-eda2b48e62.system.entry.js} +1 -1
  118. package/dist/baloise-design-system/{p-255e5491e6.system.entry.js → p-eeeb52f266.system.entry.js} +1 -1
  119. package/dist/baloise-design-system/{p-06ae31c81e.entry.js → p-efd2551aca.entry.js} +1 -1
  120. package/dist/baloise-design-system/{p-99a9cc7202.entry.js → p-fbe515646a.entry.js} +1 -1
  121. package/dist/baloise-design-system/{p-042570e1b4.system.entry.js → p-ff84d8a24a.system.entry.js} +1 -1
  122. package/dist/baloise-design-system/p-giOY60zQ.system.js +1 -0
  123. package/dist/baloise-design-system/p-ncoiCFQ1.system.js +1 -0
  124. package/dist/baloise-design-system/{p-DAsF8QfB.system.js → p-wppmhJ05.system.js} +1 -1
  125. package/dist/cjs/app-globals-DcKvQZAC.js +7 -0
  126. package/dist/cjs/bal-accordion_4.cjs.entry.js +1 -1
  127. package/dist/cjs/bal-carousel_2.cjs.entry.js +4 -4
  128. package/dist/cjs/bal-close.cjs.entry.js +1 -1
  129. package/dist/cjs/bal-date-calendar_2.cjs.entry.js +1 -1
  130. package/dist/cjs/bal-date.cjs.entry.js +1 -1
  131. package/dist/cjs/bal-doc-app.cjs.entry.js +231 -0
  132. package/dist/cjs/bal-dropdown_3.cjs.entry.js +1 -1
  133. package/dist/cjs/bal-field_5.cjs.entry.js +3 -3
  134. package/dist/cjs/bal-footer.cjs.entry.js +1 -1
  135. package/dist/cjs/bal-hint_5.cjs.entry.js +3 -3
  136. package/dist/cjs/bal-icon.cjs.entry.js +1 -1
  137. package/dist/cjs/bal-input-stepper.cjs.entry.js +2 -2
  138. package/dist/cjs/bal-label.cjs.entry.js +1 -1
  139. package/dist/cjs/bal-list_8.cjs.entry.js +4 -4
  140. package/dist/cjs/{bal-logo.animation-q2TTdoP3.js → bal-logo.animation-B4LvXc5Q.js} +77 -940
  141. package/dist/cjs/bal-logo.cjs.entry.js +35 -22
  142. package/dist/cjs/bal-nav_8.cjs.entry.js +4 -4
  143. package/dist/cjs/bal-navbar_5.cjs.entry.js +4 -4
  144. package/dist/cjs/bal-number-input.cjs.entry.js +2 -2
  145. package/dist/cjs/bal-pagination.cjs.entry.js +4 -4
  146. package/dist/cjs/bal-progress-bar.cjs.entry.js +4 -4
  147. package/dist/cjs/bal-segment_2.cjs.entry.js +4 -4
  148. package/dist/cjs/bal-shape.cjs.entry.js +1 -1
  149. package/dist/cjs/bal-spinner.cjs.entry.js +1 -1
  150. package/dist/cjs/bal-steps.cjs.entry.js +3 -3
  151. package/dist/cjs/bal-tab-item_2.cjs.entry.js +4 -4
  152. package/dist/cjs/bal-time-input.cjs.entry.js +1 -1
  153. package/dist/cjs/baloise-design-system.cjs.js +5 -4
  154. package/dist/cjs/{breakpoints.decorator-byAdfhn7.js → breakpoints.decorator-D6Zo_NKF.js} +1 -1
  155. package/dist/cjs/{breakpoints.subject-CarqIcOv.js → breakpoints.subject-zt9eoqxv.js} +1 -1
  156. package/dist/cjs/{config.default-Bkso4_bY.js → config.default-Cko-wpRU.js} +1 -0
  157. package/dist/cjs/global-BOGOCc0T.js +9 -0
  158. package/dist/cjs/index.cjs.js +4 -4
  159. package/dist/cjs/{initialize-CWGvp-PN.js → initialize-BzrcZo6Y.js} +11 -2
  160. package/dist/cjs/loader.cjs.js +5 -4
  161. package/dist/cjs/{number-COdZG-wK.js → number-Zs70JOU-.js} +1 -1
  162. package/dist/cjs/{tokens.esm-wN1fum6F.js → tokens.esm-cWyf2huK.js} +1 -1
  163. package/dist/cjs/{window-resize.decorator-DMReD0Er.js → window-resize.decorator-C581Ozga.js} +1 -1
  164. package/dist/collection/collection-manifest.json +2 -1
  165. package/dist/collection/components/bal-logo/bal-logo.css +1 -1
  166. package/dist/collection/components/bal-logo/bal-logo.data.js +77 -940
  167. package/dist/collection/components/bal-logo/bal-logo.js +57 -17
  168. package/dist/collection/components/docs/bal-doc-app/bal-doc-app.css +1 -0
  169. package/dist/collection/components/docs/bal-doc-app/bal-doc-app.js +248 -0
  170. package/dist/collection/utils/config/config.default.js +1 -0
  171. package/dist/collection/utils/config/config.js +9 -0
  172. package/dist/collection/utils/constants/version.constant.js +1 -1
  173. package/dist/esm/app-globals-CIj5uAPM.js +5 -0
  174. package/dist/esm/bal-accordion_4.entry.js +1 -1
  175. package/dist/esm/bal-carousel_2.entry.js +4 -4
  176. package/dist/esm/bal-close.entry.js +1 -1
  177. package/dist/esm/bal-date-calendar_2.entry.js +1 -1
  178. package/dist/esm/bal-date.entry.js +1 -1
  179. package/dist/esm/bal-doc-app.entry.js +229 -0
  180. package/dist/esm/bal-dropdown_3.entry.js +1 -1
  181. package/dist/esm/bal-field_5.entry.js +3 -3
  182. package/dist/esm/bal-footer.entry.js +1 -1
  183. package/dist/esm/bal-hint_5.entry.js +3 -3
  184. package/dist/esm/bal-icon.entry.js +1 -1
  185. package/dist/esm/bal-input-stepper.entry.js +2 -2
  186. package/dist/esm/bal-label.entry.js +1 -1
  187. package/dist/esm/bal-list_8.entry.js +4 -4
  188. package/dist/esm/{bal-logo.animation-Bm-_mal3.js → bal-logo.animation-DQd9HTdg.js} +77 -940
  189. package/dist/esm/bal-logo.entry.js +35 -22
  190. package/dist/esm/bal-nav_8.entry.js +4 -4
  191. package/dist/esm/bal-navbar_5.entry.js +4 -4
  192. package/dist/esm/bal-number-input.entry.js +2 -2
  193. package/dist/esm/bal-pagination.entry.js +4 -4
  194. package/dist/esm/bal-progress-bar.entry.js +4 -4
  195. package/dist/esm/bal-segment_2.entry.js +4 -4
  196. package/dist/esm/bal-shape.entry.js +1 -1
  197. package/dist/esm/bal-spinner.entry.js +1 -1
  198. package/dist/esm/bal-steps.entry.js +3 -3
  199. package/dist/esm/bal-tab-item_2.entry.js +4 -4
  200. package/dist/esm/bal-time-input.entry.js +1 -1
  201. package/dist/esm/baloise-design-system.js +5 -4
  202. package/dist/esm/{breakpoints.decorator-t_yXJIZL.js → breakpoints.decorator-Byw3OjIy.js} +1 -1
  203. package/dist/esm/{breakpoints.subject-BnQp404Z.js → breakpoints.subject-BY7lMX-X.js} +1 -1
  204. package/dist/esm/{config.default-I6QXKbhg.js → config.default-RE8-gLMQ.js} +1 -0
  205. package/dist/esm/global-Llrc69_N.js +7 -0
  206. package/dist/esm/index.js +5 -5
  207. package/dist/esm/{initialize-pdWsVO-c.js → initialize-W3od-FM9.js} +11 -2
  208. package/dist/esm/loader.js +5 -4
  209. package/dist/esm/{number-Bwx2aNR0.js → number-DfnRcL0e.js} +1 -1
  210. package/dist/esm/{tokens.esm-Cf90NR4z.js → tokens.esm-WBqHcvAW.js} +1 -1
  211. package/dist/esm/{window-resize.decorator-DBJlK-45.js → window-resize.decorator-CMpnD2hf.js} +1 -1
  212. package/dist/esm-es5/app-globals-CIj5uAPM.js +1 -0
  213. package/dist/esm-es5/bal-accordion_4.entry.js +1 -1
  214. package/dist/esm-es5/bal-carousel_2.entry.js +1 -1
  215. package/dist/esm-es5/bal-close.entry.js +1 -1
  216. package/dist/esm-es5/bal-date-calendar_2.entry.js +1 -1
  217. package/dist/esm-es5/bal-date.entry.js +1 -1
  218. package/dist/esm-es5/bal-doc-app.entry.js +1 -0
  219. package/dist/esm-es5/bal-dropdown_3.entry.js +1 -1
  220. package/dist/esm-es5/bal-field_5.entry.js +1 -1
  221. package/dist/esm-es5/bal-footer.entry.js +1 -1
  222. package/dist/esm-es5/bal-hint_5.entry.js +1 -1
  223. package/dist/esm-es5/bal-icon.entry.js +1 -1
  224. package/dist/esm-es5/bal-input-stepper.entry.js +1 -1
  225. package/dist/esm-es5/bal-label.entry.js +1 -1
  226. package/dist/esm-es5/bal-list_8.entry.js +1 -1
  227. package/dist/esm-es5/bal-logo.animation-DQd9HTdg.js +1 -0
  228. package/dist/esm-es5/bal-logo.entry.js +1 -1
  229. package/dist/esm-es5/bal-nav_8.entry.js +1 -1
  230. package/dist/esm-es5/bal-navbar_5.entry.js +1 -1
  231. package/dist/esm-es5/bal-number-input.entry.js +1 -1
  232. package/dist/esm-es5/bal-pagination.entry.js +1 -1
  233. package/dist/esm-es5/bal-progress-bar.entry.js +1 -1
  234. package/dist/esm-es5/bal-segment_2.entry.js +1 -1
  235. package/dist/esm-es5/bal-shape.entry.js +1 -1
  236. package/dist/esm-es5/bal-spinner.entry.js +1 -1
  237. package/dist/esm-es5/bal-steps.entry.js +1 -1
  238. package/dist/esm-es5/bal-tab-item_2.entry.js +1 -1
  239. package/dist/esm-es5/bal-time-input.entry.js +1 -1
  240. package/dist/esm-es5/baloise-design-system.js +1 -1
  241. package/dist/esm-es5/{breakpoints.decorator-t_yXJIZL.js → breakpoints.decorator-Byw3OjIy.js} +1 -1
  242. package/dist/esm-es5/{breakpoints.subject-BnQp404Z.js → breakpoints.subject-BY7lMX-X.js} +1 -1
  243. package/dist/esm-es5/{config.default-I6QXKbhg.js → config.default-RE8-gLMQ.js} +1 -1
  244. package/dist/esm-es5/global-Llrc69_N.js +1 -0
  245. package/dist/esm-es5/index.js +1 -1
  246. package/dist/esm-es5/initialize-W3od-FM9.js +1 -0
  247. package/dist/esm-es5/loader.js +1 -1
  248. package/dist/esm-es5/{number-Bwx2aNR0.js → number-DfnRcL0e.js} +1 -1
  249. package/dist/esm-es5/{window-resize.decorator-DBJlK-45.js → window-resize.decorator-CMpnD2hf.js} +1 -1
  250. package/dist/html.html-data.json +12 -0
  251. package/dist/types/components/bal-logo/bal-logo.d.ts +6 -0
  252. package/dist/types/components/bal-logo/bal-logo.data.d.ts +81 -187
  253. package/dist/types/components/bal-logo/bal-logo.interfaces.d.ts +1 -1
  254. package/dist/types/components/docs/bal-doc-app/bal-doc-app.d.ts +21 -0
  255. package/dist/types/components.d.ts +85 -0
  256. package/dist/types/home/runner/work/design-system/design-system/packages/core/.stencil/packages/icons/src/index.d.ts +82 -0
  257. package/dist/types/utils/config/config.d.ts +3 -1
  258. package/dist/types/utils/config/config.types.d.ts +3 -0
  259. package/package.json +6 -6
  260. package/dist/baloise-design-system/p-74047cc11f.entry.js +0 -1
  261. package/dist/baloise-design-system/p-B1a79Kak.system.js +0 -1
  262. package/dist/baloise-design-system/p-BC9JH89x.js +0 -1
  263. package/dist/baloise-design-system/p-BRJ7ljGZ.system.js +0 -1
  264. package/dist/baloise-design-system/p-BblIE2Vz.system.js +0 -1
  265. package/dist/baloise-design-system/p-BtgFoKGn.js +0 -1
  266. package/dist/baloise-design-system/p-CBUCh83e.js +0 -1
  267. package/dist/baloise-design-system/p-C_0MGoKB.js +0 -1
  268. package/dist/baloise-design-system/p-CwWHLbPB.system.js +0 -1
  269. package/dist/baloise-design-system/p-DNy7adIE.system.js +0 -1
  270. package/dist/baloise-design-system/p-Dhp6-MTS.system.js +0 -1
  271. package/dist/baloise-design-system/p-DsxGYykr.js +0 -1
  272. package/dist/baloise-design-system/p-db2823d02b.system.entry.js +0 -1
  273. package/dist/baloise-design-system/p-wAfnccKA.system.js +0 -1
  274. package/dist/cjs/app-globals-C_KNnTwa.js +0 -11
  275. package/dist/esm/app-globals-BRqdW0lU.js +0 -9
  276. package/dist/esm-es5/app-globals-BRqdW0lU.js +0 -1
  277. package/dist/esm-es5/bal-logo.animation-Bm-_mal3.js +0 -1
  278. package/dist/esm-es5/initialize-pdWsVO-c.js +0 -1
  279. /package/dist/baloise-design-system/{p-LFV9NiI-.system.js → p-DKS7hs2P.system.js} +0 -0
  280. /package/dist/baloise-design-system/{p-Cf90NR4z.js → p-WBqHcvAW.js} +0 -0
  281. /package/dist/esm-es5/{tokens.esm-Cf90NR4z.js → tokens.esm-WBqHcvAW.js} +0 -0
@@ -1 +1 @@
1
- import{__awaiter,__extends,__generator,__spreadArray}from"tslib";import{h,r as registerInstance,c as createEvent,H as Host,g as getElement}from"./index-BdVwMG9u.js";import{_ as __decorate,a as __metadata}from"./tslib.es6-dfXERft2.js";import{B as BEM}from"./bem-ByiN-QjD.js";import{a as waitAfterFramePaint,q as hasParent}from"./helpers-BNj87EbG.js";import{L as Logger}from"./log-CwssmmaV.js";import{p as padStart}from"./index-BU7FUSdu.js";import{i as isNil}from"./index-zWZxKBfo.js";import{B as BalDate,i as i18nBalDate,d as dateSeparator}from"./date-W0XtD641.js";import{d as defaultConfig}from"./config.default-I6QXKbhg.js";import{L as ListenToConfig}from"./config.decorator-3bfyZ-0Y.js";import{L as ListenToSwipe}from"./swipe.decorator-B_Ghrp1o.js";import{a as ariaBooleanToString}from"./aria-DBsOHTWj.js";import{i as inheritAttributes}from"./attributes-C4sZQbkT.js";import{d as defaultBalAriaForm}from"./form-FCLKfv6B.js";import{l as hasValueChanged,c as inputSetFocus,d as inputSetBlur}from"./form-input-DYvzaBlM.js";import{N as NUMBER_KEYS}from"./keys.constant-xVPGsAdF.js";import{I as INVALID_VALUE}from"./mask-util-DuObDTix.js";import"./browser-B1u-Mq75.js";import"./config.utils-B7jugjyM.js";import"./_commonjsHelpers-BFTU3MAI.js";import"./swipe.subject-T0VStuOK.js";import"./device-TtMibDFL.js";import"./listener-CClDIhvK.js";function getDaysInMonth(t,e){if(e<1||t<0){return undefined}return new Date(t,e,0).getDate()}function isoDateOfDay(t,e,a){return"".concat(a,"-").concat(padStart("".concat(e),2,"0"),"-").concat(padStart("".concat(t),2,"0"))}function isoDateOfToday(){var t=new Date;return"".concat(t.getFullYear(),"-").concat(padStart("".concat(t.getMonth()+1),2,"0"),"-").concat(padStart("".concat(t.getDate()),2,"0"))}function generateCalendarGrid(t,e,a,n,i){var r=[];var o=getDaysInMonth(t,e);var l=getFirstDayOfMonth(t,e);if(o!==undefined&&l){var s=isoDateOfToday();var d=BalDate.fromISO(a);var u=BalDate.fromISO(n);var c=function(t){if(isNil(i)){return false}return!i(t)};for(var h=1;h<=o;h++){var f=isoDateOfDay(h,e,t);r.push({day:h,month:e,year:t,isoDate:f,fullDate:BalDate.fromISO(f).toFormat(),today:s===f,disabled:d.isAfter(f)||u.isBefore(f)||c(f)})}}return r}function getFirstWeekdayOfMonth(t,e){if(e<1||t<0){return 1}var a=new Date(t,e-1,1);var n=a.getDay();return n===0?7:n}function validateLanguage(t){if(["en","de","fr","it","nl","es","pl","pt","sv","fi"].includes(t)){return t}return"de"}function generateYears(t,e,a){var n=[];var i=new Date;var r=i.getFullYear();for(var o=e;o<=a;o++){n.push({value:o,label:"".concat(o),disabled:false,today:r===o,selected:t===o})}return n}function generateMonths(t,e,a,n,i){var r=validateLanguage(t);var o=BalDate.infoMonths({format:"long",locale:r});var l=BalDate.fromISO(a);var s=new Date;var d=s.getFullYear();var u=s.getMonth()+1;var c=0;if(n&&e!==undefined){var h=BalDate.fromISO(n);if(h.isValid){if(e>h.year){c=0}else{c=h.month||c}}}var f=12;if(i&&e!==undefined){var b=BalDate.fromISO(i);if(b.isValid){if(e<b.year){f=12}else{f=b.month||f}}}return o.map((function(t,a){var n=a+1;return{label:t,value:n,today:n===u&&e===d,selected:n===l.month&&e===l.year,disabled:n<c||n>f}}))}function generateWeekDays(t){var e=validateLanguage(t);var a=BalDate.infoWeekdays({format:"short",locale:e});var n=BalDate.infoWeekdays({format:"long",locale:e});return a.map((function(t,e){return{ariaLabel:n[e],textContent:t}}))}function getFirstDayOfMonth(t,e){if(e<1||e>12||t<0){return undefined}return new Date(t,e-1,1)}var CalendarGrid=function(t){var e=t.isVisible,a=t.ref,n=t.grid,i=t.weekdays,r=t.selectedDate,o=t.firstDayOfWeek,l=t.onSelectDay;var s=BEM.block("date-calendar");var d=s.element("body");var u=d.element("grid");return h("div",{role:"grid",class:Object.assign(Object.assign({},u.class()),u.modifier("visible").class(e)),"aria-hidden":e?"false":"true",ref:function(t){return a(t)}},h("div",{role:"row",class:Object.assign({},u.element("head").class())},i.map((function(t){return h("span",{key:t.textContent,role:"columnheader","aria-label":t.ariaLabel,title:t.ariaLabel},t.textContent)}))),h("div",{role:"row",class:Object.assign({},u.element("body").class()),style:{"--bal-date-first-week-day":"".concat(o)}},n.map((function(t){return h("bal-date-calendar-cell",Object.assign({key:t.isoDate},t,{selected:t.isoDate===r,onBalSelectDay:function(t){var e=t.detail;return l(e)}}))}))))};var CalendarList=function(t){var e=t.name,a=t.isVisible,n=t.girdHeight,i=t.list,r=t.onSelect,o=t.ref;var l=BEM.block("date-calendar");var s=l.element("body");var d=s.element("list");return h("ul",{class:Object.assign(Object.assign(Object.assign({},d.class()),d.modifier(e).class()),d.modifier("visible").class(a)),"aria-hidden":a?"false":"true",style:{height:"".concat(n-2-8-8,"px")},ref:function(t){return o?o(t):undefined}},i.map((function(t){return h("li",{key:t.value,id:"".concat(e,"-").concat(t.value)},h("button",{class:Object.assign(Object.assign(Object.assign(Object.assign({},d.element("item").class()),d.element("item").modifier("today").class(t.today)),d.element("item").modifier("selected").class(t.selected)),d.element("item").modifier("disabled").class(t.disabled)),disabled:t.disabled,tabIndex:-1,onClick:function(){if(!t.disabled){r(t)}}},t.label))})))};var CalendarNav=function(t){var e=t.language,a=t.onClickSelectMonthAndYear,n=t.monthFullNames,i=t.month,r=t.year,o=t.isCalendarVisible,l=t.isListVisible,s=t.onClickPreviousMonth,d=t.onClickNextMonth;var u=BEM.block("date-calendar");var c=u.element("nav");var f=i18nBalDate[e].nextMonth;var b=i18nBalDate[e].previousMonth;var v=i18nBalDate[e].selectMonth;return h("div",{class:Object.assign({},c.class())},h("div",{class:Object.assign({},c.modifier("start").class())},h("button",{title:v,"aria-label":v,tabIndex:-1,"data-testid":"change-year-month",onClick:a},h("span",null,n[i-1]," ",r),h("bal-icon",{name:"caret-up",color:"primary",size:"small",turn:o}))),h("div",{class:Object.assign({},c.modifier("end").class()),style:{display:l?"none":"flex"}},h("button",{title:b,"aria-label":b,onClick:s,tabIndex:-1,"data-testid":"previous-month"},h("bal-icon",{name:"caret-left",color:"primary",size:"small"})),h("button",{title:f,"aria-label":f,onClick:d,tabIndex:-1,"data-testid":"next-month"},h("bal-icon",{name:"caret-right",color:"primary",size:"small"}))))};var balDateCalendarCss=':host{--bal-date-first-week-day:0;--bal-date-calendar-button-background:transparent;--bal-date-calendar-button-background-hover:var(--bal-color-light-blue-1);--bal-date-calendar-button-background-active:var(--bal-color-light-blue-2);--bal-date-calendar-button-color:var(--bal-color-text-primary);--bal-date-calendar-button-today-color:var(--bal-color-light-blue-3);--bal-date-calendar-button-today-color-hover:var(--bal-color-text-primary);--bal-date-calendar-button-today-color-active:var(--bal-color-text-primary);--bal-date-calendar-button-selected-background:var(--bal-color-primary);--bal-date-calendar-button-selected-color:var(--bal-color-text-white)}:host{-webkit-touch-callout:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;display:inline-block;background:var(--bal-color-white);border-radius:var(--bal-radius-normal)}.bal-date-calendar__nav{display:-ms-flexbox;display:flex;width:calc(100% - 1rem);-ms-flex-pack:justify;justify-content:space-between;-ms-flex-align:center;align-items:center;padding:.5rem;gap:.5rem}.bal-date-calendar__nav--start>button{display:-ms-flexbox;display:flex;gap:.5rem}.bal-date-calendar__nav--end{display:-ms-flexbox;display:flex;gap:.5rem}.bal-date-calendar__nav button{display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;-ms-flex-align:center;align-items:center;cursor:pointer;border-radius:var(--bal-radius-normal);font-family:var(--bal-font-family-text);font-weight:var(--bal-font-weight-regular);color:var(--bal-date-calendar-button-color);border:none;background:var(--bal-date-calendar-button-background);text-align:center;font-size:var(--bal-text-size-normal);line-height:var(--bal-line-height-normal);-webkit-hyphens:auto;-ms-hyphens:auto;hyphens:auto;outline:none;min-height:2rem;min-width:2rem;padding:.25rem;border-radius:var(--bal-button-radius);font-family:var(--bal-font-family-title);font-weight:var(--bal-font-weight-bold)}@media (hover: hover)and (pointer: fine){.bal-date-calendar__nav button:not(.bal-date-calendar__nav button--selected):not(.bal-date-calendar__nav button--disabled):hover{background:var(--bal-date-calendar-button-background-hover)}}.bal-date-calendar__nav button:not(.bal-date-calendar__nav button--selected):not(.bal-date-calendar__nav button--disabled):active{background:var(--bal-date-calendar-button-background-active)}.bal-date-calendar__nav button--today:not(.bal-date-calendar__nav button--selected):not(.bal-date-calendar__nav button--disabled){color:var(--bal-date-calendar-button-today-color);font-weight:var(--bal-font-weight-bold)}@media (hover: hover)and (pointer: fine){.bal-date-calendar__nav button--today:not(.bal-date-calendar__nav button--selected):not(.bal-date-calendar__nav button--disabled):hover{color:var(--bal-date-calendar-button-today-color-hover)}}.bal-date-calendar__nav button--today:not(.bal-date-calendar__nav button--selected):not(.bal-date-calendar__nav button--disabled):active{color:var(--bal-date-calendar-button-today-color-active)}.bal-date-calendar__nav button--selected{background:var(--bal-date-calendar-button-selected-background);color:var(--bal-date-calendar-button-selected-color);font-weight:var(--bal-font-weight-bold)}.bal-date-calendar__nav button--disabled{cursor:default;background:rgba(0,0,0,0);color:var(--bal-color-text-grey-light)}.bal-date-calendar__body{display:block}.bal-date-calendar__body__grid{width:-webkit-fit-content;width:-moz-fit-content;width:fit-content;padding:.5rem;height:0;padding-top:0;padding-bottom:0;visibility:hidden}.bal-date-calendar__body__grid--visible{height:auto;padding-top:.5rem;padding-bottom:.5rem;visibility:visible}.bal-date-calendar__body__grid__head{position:relative;display:grid;grid-template-columns:repeat(7, 1fr);-webkit-column-gap:.5rem;-moz-column-gap:.5rem;column-gap:.5rem;row-gap:.5rem;width:-webkit-fit-content;width:-moz-fit-content;width:fit-content}.bal-date-calendar__body__grid__head::after{position:absolute;content:"";height:2px;width:calc(100% + 1rem);bottom:0;left:-0.5rem;right:-0.5rem;background:var(--bal-color-border)}.bal-date-calendar__body__grid__head span{display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;-ms-flex-align:center;align-items:center;height:2rem;width:2rem;font-family:var(--bal-font-family-title);font-weight:var(--bal-font-weight-bold);font-size:var(--bal-text-size-normal);line-height:var(--bal-line-height-normal);-webkit-hyphens:auto;-ms-hyphens:auto;hyphens:auto;text-wrap:nowrap}.bal-date-calendar__body__grid__body{display:grid;grid-template-columns:repeat(7, 1fr);-webkit-column-gap:.5rem;-moz-column-gap:.5rem;column-gap:.5rem;row-gap:.5rem;width:-webkit-fit-content;width:-moz-fit-content;width:fit-content;padding-top:.5rem}.bal-date-calendar__body__grid__body>.bal-date-calendar-cell{width:2rem;height:2rem;text-align:center;font-size:var(--bal-text-size-normal);line-height:var(--bal-line-height-normal);-webkit-hyphens:auto;-ms-hyphens:auto;hyphens:auto}.bal-date-calendar__body__grid__body>.bal-date-calendar-cell:first-child{grid-column:var(--bal-date-first-week-day)}.bal-date-calendar__body__list{display:none;list-style:none;margin:0;padding:0;-webkit-column-gap:.5rem;-moz-column-gap:.5rem;column-gap:.5rem;row-gap:.5rem;width:calc(100% - 1rem);overflow-y:auto;max-height:18rem;position:relative;padding:.5rem;border-top:2px solid var(--bal-color-border)}.bal-date-calendar__body__list .bal-date-calendar__body__list__item{display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;-ms-flex-align:center;align-items:center;cursor:pointer;border-radius:var(--bal-radius-normal);font-family:var(--bal-font-family-text);font-weight:var(--bal-font-weight-regular);color:var(--bal-date-calendar-button-color);border:none;background:var(--bal-date-calendar-button-background);text-align:center;font-size:var(--bal-text-size-normal);line-height:var(--bal-line-height-normal);-webkit-hyphens:auto;-ms-hyphens:auto;hyphens:auto;outline:none;width:100%}@media (hover: hover)and (pointer: fine){.bal-date-calendar__body__list .bal-date-calendar__body__list__item:not(.bal-date-calendar__body__list .bal-date-calendar__body__list__item--selected):not(.bal-date-calendar__body__list .bal-date-calendar__body__list__item--disabled):hover{background:var(--bal-date-calendar-button-background-hover)}}.bal-date-calendar__body__list .bal-date-calendar__body__list__item:not(.bal-date-calendar__body__list .bal-date-calendar__body__list__item--selected):not(.bal-date-calendar__body__list .bal-date-calendar__body__list__item--disabled):active{background:var(--bal-date-calendar-button-background-active)}.bal-date-calendar__body__list .bal-date-calendar__body__list__item--today:not(.bal-date-calendar__body__list .bal-date-calendar__body__list__item--selected):not(.bal-date-calendar__body__list .bal-date-calendar__body__list__item--disabled){color:var(--bal-date-calendar-button-today-color);font-weight:var(--bal-font-weight-bold)}@media (hover: hover)and (pointer: fine){.bal-date-calendar__body__list .bal-date-calendar__body__list__item--today:not(.bal-date-calendar__body__list .bal-date-calendar__body__list__item--selected):not(.bal-date-calendar__body__list .bal-date-calendar__body__list__item--disabled):hover{color:var(--bal-date-calendar-button-today-color-hover)}}.bal-date-calendar__body__list .bal-date-calendar__body__list__item--today:not(.bal-date-calendar__body__list .bal-date-calendar__body__list__item--selected):not(.bal-date-calendar__body__list .bal-date-calendar__body__list__item--disabled):active{color:var(--bal-date-calendar-button-today-color-active)}.bal-date-calendar__body__list .bal-date-calendar__body__list__item--selected{background:var(--bal-date-calendar-button-selected-background);color:var(--bal-date-calendar-button-selected-color);font-weight:var(--bal-font-weight-bold)}.bal-date-calendar__body__list .bal-date-calendar__body__list__item--disabled{cursor:default;background:rgba(0,0,0,0);color:var(--bal-color-text-grey-light)}.bal-date-calendar__body__list--visible{display:grid}.bal-date-calendar__body__list--year{grid-template-columns:repeat(4, 1fr)}.bal-date-calendar__body__list--month{grid-template-columns:repeat(2, 1fr)}.bal-date-calendar-cell{display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;-ms-flex-align:center;align-items:center;cursor:pointer;border-radius:var(--bal-radius-normal);font-family:var(--bal-font-family-text);font-weight:var(--bal-font-weight-regular);color:var(--bal-date-calendar-button-color);border:none;background:var(--bal-date-calendar-button-background);text-align:center;font-size:var(--bal-text-size-normal);line-height:var(--bal-line-height-normal);-webkit-hyphens:auto;-ms-hyphens:auto;hyphens:auto;outline:none;width:2rem;height:2rem}@media (hover: hover)and (pointer: fine){.bal-date-calendar-cell:not(.bal-date-calendar-cell--selected):not(.bal-date-calendar-cell--disabled):hover{background:var(--bal-date-calendar-button-background-hover)}}.bal-date-calendar-cell:not(.bal-date-calendar-cell--selected):not(.bal-date-calendar-cell--disabled):active{background:var(--bal-date-calendar-button-background-active)}.bal-date-calendar-cell--today:not(.bal-date-calendar-cell--selected):not(.bal-date-calendar-cell--disabled){color:var(--bal-date-calendar-button-today-color);font-weight:var(--bal-font-weight-bold)}@media (hover: hover)and (pointer: fine){.bal-date-calendar-cell--today:not(.bal-date-calendar-cell--selected):not(.bal-date-calendar-cell--disabled):hover{color:var(--bal-date-calendar-button-today-color-hover)}}.bal-date-calendar-cell--today:not(.bal-date-calendar-cell--selected):not(.bal-date-calendar-cell--disabled):active{color:var(--bal-date-calendar-button-today-color-active)}.bal-date-calendar-cell--selected{background:var(--bal-date-calendar-button-selected-background);color:var(--bal-date-calendar-button-selected-color);font-weight:var(--bal-font-weight-bold)}.bal-date-calendar-cell--disabled{cursor:default;background:rgba(0,0,0,0);color:var(--bal-color-text-grey-light)}';var DateCalendar=function(){function t(t){var e=this;registerInstance(this,t);this.balChange=createEvent(this,"balChange");this.oldMin="";this.oldMax="";this.selectedDate="";this.monthFullNames=[];this.weekdays=[];this.months=[];this.years=[];this.calendarGrid=[];this.firstDayOfWeek=0;this.month=0;this.year=0;this.language=defaultConfig.language;this.isCalendarVisible=true;this.isYearListVisible=false;this.isMonthListVisible=false;this.allowedDates=undefined;this.onSelectDay=function(t){e.valueChanged(t,e.selectedDate);e.balChange.emit(e.selectedDate)};this.onClickNextMonth=function(){var t=e.year;var a=e.month+1;if(a>12){a=1;t=t+1}e.generateGridByMonthAndYear(a,t)};this.onClickPreviousMonth=function(){var t=e.year;var a=e.month-1;if(a<1){a=12;t=t-1}e.generateGridByMonthAndYear(a,t)};this.onClickSelectMonthAndYear=function(){return __awaiter(e,void 0,void 0,(function(){var t,e;return __generator(this,(function(a){switch(a.label){case 0:this.updateSelections();if(!(this.isCalendarVisible===true))return[3,2];this.isCalendarVisible=false;this.isYearListVisible=true;this.isMonthListVisible=false;return[4,waitAfterFramePaint()];case 1:a.sent();if(this.yearListEl){t=this.yearListEl.querySelector("#year-".concat(this.year));if(t){e=26+8+4;this.yearListEl.scrollTop=t.offsetTop-e*2}else{this.yearListEl.scrollTop=0}}return[3,3];case 2:this.isCalendarVisible=true;this.isYearListVisible=false;this.isMonthListVisible=false;a.label=3;case 3:return[2]}}))}))};this.onClickYear=function(t){e.isYearListVisible=false;e.isMonthListVisible=true;e.generateGridByMonthAndYear(e.month,t);e.months=generateMonths(e.language,t,e.selectedDate,e.min,e.max)};this.onClickMonth=function(t){e.isYearListVisible=false;e.isMonthListVisible=false;e.isCalendarVisible=true;e.generateGridByMonthAndYear(t,e.year)}}t.prototype.createLogger=function(t){this.log=t};t.prototype.valueChanged=function(t,e){if(t!==e){var a=BalDate.fromISO(t);if(!a.isValid){this.generateGridByDefaultDate();this.selectedDate=""}else{this.generateGridByDate(a);this.selectedDate=a.toISODate()}this.updateSelections()}};t.prototype.rangePropChanged=function(){this.updateSelections();this.generateGrid()};t.prototype.yearRangePropChanged=function(){this.updateSelections()};t.prototype.connectedCallback=function(){this.generateGridByDefaultDate();this.valueChanged(this.value,undefined)};t.prototype.configChanged=function(t){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){this.language=t.language;this.monthFullNames=BalDate.infoMonths({format:"long",locale:this.language});this.weekdays=generateWeekDays(this.language);this.updateSelections();return[2]}))}))};t.prototype.swipeListener=function(t){var e=t.left,a=t.right;if(e){this.onClickNextMonth()}else if(a){this.onClickPreviousMonth()}};Object.defineProperty(t.prototype,"minYear",{get:function(){if(this.minYearProp===undefined){var t=new Date;var e=t.getFullYear();var a=e-100;if(this.min){var n=BalDate.fromISO(this.min);return n.year||a}else{return a}}return this.minYearProp},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"maxYear",{get:function(){if(this.maxYearProp===undefined){var t=new Date;var e=t.getFullYear();var a=e+50;if(this.max){var n=BalDate.fromISO(this.max);return n.year||a}else{return a}}return this.maxYearProp},enumerable:false,configurable:true});t.prototype.updateSelections=function(){this.years=generateYears(this.year,this.minYear,this.maxYear);this.months=generateMonths(this.language,this.year,this.selectedDate,this.min,this.max)};t.prototype.generateGrid=function(){var t=BalDate.fromISO(this.value);if(t.isValid){this.generateGridByDate(t)}else{this.generateGridByDefaultDate()}};t.prototype.generateGridByDate=function(t){if(t.year!==undefined&&t.month!==undefined){this.generateGridByMonthAndYear(t.month,t.year)}};t.prototype.generateGridByDefaultDate=function(){var t=BalDate.fromISO(this.defaultDate);if(t.isValid){this.generateGridByDate(t)}else{var e=new Date;this.month=e.getMonth()+1;this.year=e.getFullYear();this.calendarGrid=generateCalendarGrid(this.year,this.month,this.min,this.max,this.allowedDates);this.firstDayOfWeek=getFirstWeekdayOfMonth(this.year,this.month)}};t.prototype.generateGridByMonthAndYear=function(t,e){if(this.month!==t||this.year!==e||this.oldMin!==this.min||this.oldMax!==this.max){this.calendarGrid=generateCalendarGrid(e,t,this.min,this.max,this.allowedDates);this.firstDayOfWeek=getFirstWeekdayOfMonth(e,t)}this.month=t;this.year=e;this.oldMin=this.min;this.oldMax=this.max};t.prototype.render=function(){var t=this;var e;var a=((e=this.gridEl)===null||e===void 0?void 0:e.clientHeight)||0;var n=BEM.block("date-calendar");var i=n.element("body");var r=n.element("foot");return h(Host,{key:"34efddf3c88e5470dcefd22c5cab262873d07de8",class:Object.assign({},n.class())},h(CalendarNav,{key:"9c8942a95ff9f1c8fdc8b1e153a29632145d1c2b",language:this.language,monthFullNames:this.monthFullNames,month:this.month,year:this.year,isCalendarVisible:this.isCalendarVisible,isListVisible:this.isMonthListVisible||this.isYearListVisible,onClickSelectMonthAndYear:this.onClickSelectMonthAndYear,onClickPreviousMonth:this.onClickPreviousMonth,onClickNextMonth:this.onClickNextMonth}),h("div",{key:"6a2cb7bba9c0568c1dc31d8b1c811b90c5845dce",class:Object.assign({},i.class())},h(CalendarGrid,{key:"a687e1e1f80bc8ea21bdc7ad4709537829005843",isVisible:this.isCalendarVisible,grid:this.calendarGrid,weekdays:this.weekdays,firstDayOfWeek:this.firstDayOfWeek,selectedDate:this.selectedDate,ref:function(e){return t.gridEl=e},onSelectDay:function(e){return t.onSelectDay(e)}}),h(CalendarList,{key:"cba1e282fb92f5edfa04e97eefcf9b38b57b8428",name:"year",isVisible:this.isYearListVisible,girdHeight:a,list:this.years,ref:function(e){return t.yearListEl=e},onSelect:function(e){return t.onClickYear(e.value)}}),h(CalendarList,{key:"ae7cb47aaffec3d3a91d1aab96f1fbdde34b7e6f",name:"month",isVisible:this.isMonthListVisible,girdHeight:a,list:this.months,onSelect:function(e){return t.onClickMonth(e.value)}})),h("div",{key:"6e455964845a4e57abc793cb78916ed51fa0bdb3",class:Object.assign({},r.class())},h("slot",{key:"277a09ef4cb10f6f051c84b1ba9f9ae79f0d3479"})))};Object.defineProperty(t.prototype,"el",{get:function(){return getElement(this)},enumerable:false,configurable:true});Object.defineProperty(t,"watchers",{get:function(){return{value:["valueChanged"],min:["rangePropChanged"],max:["rangePropChanged"],minYearProp:["yearRangePropChanged"],maxYearProp:["yearRangePropChanged"]}},enumerable:false,configurable:true});return t}();__decorate([Logger("bal-date-calendar"),__metadata("design:type",Function),__metadata("design:paramtypes",[Function]),__metadata("design:returntype",void 0)],DateCalendar.prototype,"createLogger",null);__decorate([ListenToConfig(),__metadata("design:type",Function),__metadata("design:paramtypes",[Object]),__metadata("design:returntype",Promise)],DateCalendar.prototype,"configChanged",null);__decorate([ListenToSwipe({mobileOnly:true}),__metadata("design:type",Function),__metadata("design:paramtypes",[Object]),__metadata("design:returntype",void 0)],DateCalendar.prototype,"swipeListener",null);DateCalendar.style=balDateCalendarCss;var MaskPosition=function(){function t(t){this._options=t;this._position=0;this._positionEnd=0;this._isRangeSelection=false;if(t.component&&t.component.nativeInput){this._position=t.component.nativeInput.selectionStart||0;this._positionEnd=t.component.nativeInput.selectionEnd||0;this._isRangeSelection=this._position!==this._positionEnd}}Object.defineProperty(t.prototype,"isRangeSelection",{get:function(){return this._isRangeSelection},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"value",{get:function(){if(this._options.isBackspace&&this._position>0){return this._position-1}return this._position},set:function(t){var e=t<0?0:t>this._options.mask.maxLength?this._options.mask.maxLength:t;this._position=e},enumerable:false,configurable:true});t.prototype.toStart=function(){this.value=0};t.prototype.toEnd=function(){var t=this.getTarget();if(t){this.value=t.value.length}};t.prototype.next=function(t){if(t===void 0){t=1}var e=this._position+t;if(e<=this._options.mask.maxLength){this._position=e}return this._position};t.prototype.previous=function(t){if(t===void 0){t=1}var e=this._position-t;if(e>=0){this._position=e}else{this._position=0}return this._position};t.prototype.submit=function(){var t=this.getTarget();if(t&&t.selectionStart!==this._position&&t.selectionEnd!==this._position){t.selectionStart=this._position;t.selectionEnd=this._position}};t.prototype.getTarget=function(){if(this._options.component&&this._options.component.nativeInput){return this._options.component.nativeInput}return undefined};return t}();var MaskContext=function(){function t(t){this._options=t;this._value="";if(this._options.component&&this._options.component.nativeInput){this._value=this._options.component.nativeInput.value}this.position=new MaskPosition(this._options);this.component=this._options.component}Object.defineProperty(t.prototype,"target",{get:function(){if(this._options.component&&this._options.component.nativeInput){return this._options.component.nativeInput}return undefined},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"value",{get:function(){return this._value},set:function(t){this._value=t},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"focused",{get:function(){return this._options.component.focused},enumerable:false,configurable:true});t.prototype.isValueEmpty=function(){return this.value===""||this.value===undefined||this.value===null};t.prototype.preventDefault=function(){if(this._options.event.preventDefault){this._options.event.preventDefault()}};t.prototype.stopPropagation=function(){this.preventDefault();if(this._options.event.stopPropagation){this._options.event.stopPropagation()}};t.prototype.submit=function(){return __awaiter(this,arguments,void 0,(function(t,e){if(t===void 0){t="input"}return __generator(this,(function(a){if(this.target){this.target.value=this.value;if(t!=="blur"&&t!=="tab"){this.position.submit()}if(this._options.component){if(t==="input"||t==="tab"){this._options.component.balInput.emit(this.value)}if((t==="change"||t==="blur")&&e!==undefined){if(hasValueChanged(this._options.component.value,e)){this._options.component.value=e;this._options.component.balChange.emit(e)}}}}return[2]}))}))};return t}();var MaskClipboardContext=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}Object.defineProperty(e.prototype,"clipboardData",{get:function(){var t;return(t=this._options.event.clipboardData)===null||t===void 0?void 0:t.getData("text")},enumerable:false,configurable:true});return e}(MaskContext);var MaskFocusContext=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e}(MaskContext);var MaskKeyboardContext=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}Object.defineProperty(e.prototype,"key",{get:function(){return this._options.event.key},enumerable:false,configurable:true});Object.defineProperty(e.prototype,"isCtrlOrCommandKey",{get:function(){return this._options.event.metaKey||this._options.event.ctrlKey},enumerable:false,configurable:true});Object.defineProperty(e.prototype,"isBackspaceKey",{get:function(){return this._options.event.key==="Backspace"},enumerable:false,configurable:true});Object.defineProperty(e.prototype,"isTabKey",{get:function(){return this._options.event.key==="Tab"},enumerable:false,configurable:true});Object.defineProperty(e.prototype,"isWhiteSpaceKey",{get:function(){return this._options.event.key===" "},enumerable:false,configurable:true});Object.defineProperty(e.prototype,"isDeleteKey",{get:function(){return this._options.event.key==="Delete"||this._options.event.key==="Del"},enumerable:false,configurable:true});Object.defineProperty(e.prototype,"isNumberKey",{get:function(){return e.NUMBER_KEYS.includes(this._options.event.key)},enumerable:false,configurable:true});Object.defineProperty(e.prototype,"isNavigationKey",{get:function(){return e.NAVIGATION_KEYS.includes(this._options.event.key)},enumerable:false,configurable:true});Object.defineProperty(e.prototype,"isSelectAllCommand",{get:function(){return(this._options.event.ctrlKey||this._options.event.metaKey)&&this.key==="a"},enumerable:false,configurable:true});Object.defineProperty(e.prototype,"isCopyCommand",{get:function(){return(this._options.event.ctrlKey||this._options.event.metaKey)&&this.key==="c"},enumerable:false,configurable:true});Object.defineProperty(e.prototype,"isPasteCommand",{get:function(){return(this._options.event.ctrlKey||this._options.event.metaKey)&&this.key==="v"},enumerable:false,configurable:true});e.prototype.getCharAt=function(t){if(t===void 0){t=this.position.value}return this.value.charAt(t)};e.prototype.getCharAtBackspacePosition=function(){return this.getCharAt(this.position.value-1)};e.prototype.setChar=function(t,e){if(t===void 0){t=this._options.event.key}if(e===void 0){e=this.position.value}this.value=this.value.substring(0,e)+t+this.value.substring(e+1)};return e}(MaskContext);MaskKeyboardContext.NUMBER_KEYS=["0","1","2","3","4","5","6","7","8","9"];MaskKeyboardContext.NAVIGATION_KEYS=["Home","End","ArrowLeft","Left","ArrowRight","Right","Tab","Enter","Esc","Escape"];var MaskLocaleContext=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}Object.defineProperty(e.prototype,"locale",{get:function(){return this._options.event.locale},enumerable:false,configurable:true});return e}(MaskContext);var MaskMouseContext=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e}(MaskContext);var MaskValueChangedContext=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}Object.defineProperty(e.prototype,"newValue",{get:function(){return this._options.event.newValue},enumerable:false,configurable:true});Object.defineProperty(e.prototype,"oldValue",{get:function(){return this._options.event.oldValue},enumerable:false,configurable:true});Object.defineProperty(e.prototype,"didValueChange",{get:function(){return this.newValue!==this.oldValue},enumerable:false,configurable:true});return e}(MaskContext);var MaskBlock=function(){function t(t){this._isSeparator=false;this._allowedKeys=[];this._locale="de-CH";this._from=t.from||0;this._to=t.to||0;this._isSeparator=t.isSeparator===undefined?false:t.isSeparator;this._mask=t.mask||"_";this._allowedKeys=t.allowedKeys?t.allowedKeys:this.allowedKeys;this._format=t.format}t.prototype.format=function(t){if(this._format){return this._format(t.replace(this.mask,""),this._locale,this.mask)}return t};Object.defineProperty(t.prototype,"isSeparator",{get:function(){return this._isSeparator},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"to",{get:function(){return this._to},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"from",{get:function(){return this._from},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"mask",{get:function(){if(typeof this._mask==="function"){return this._mask(this._locale)}return this._mask},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"allowedKeys",{get:function(){return this._allowedKeys},enumerable:false,configurable:true});t.prototype.onI18nChange=function(t){this._locale=t};t.prototype.getValueOfTheBlock=function(t){return t.slice(this._from,this._to)};t.prototype.isTouched=function(t){var e=this;var a=this.getValueOfTheBlock(t);return!a.split("").every((function(t){return t===e.mask}))};t.prototype.verifyAllowedKeyHits=function(t){if(this.isSeparator&&t===this.mask){return true}else if(this.allowedKeys.indexOf(t)>=0){return true}else{return false}};return t}();var MaskBlockList=function(){function t(t){if(t===void 0){t=[]}this._list=t}Object.defineProperty(t.prototype,"lastPosition",{get:function(){return this._list[this._list.length-1].to},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"list",{get:function(){return this._list},set:function(t){this._list=t},enumerable:false,configurable:true});t.prototype.clone=function(){return new t(__spreadArray([],this._list,true))};t.prototype.findByIndex=function(t,e){if(e===void 0){e=this.list}return e.find((function(e){return e.from<=t&&t<e.to}))};t.prototype.getPlaceholderMask=function(){var t=[];this.list.forEach((function(e){var a=e.to-e.from;for(var n=0;n<a;n++){t.push(e.mask)}}));return t.join("")};t.prototype.getRawValueWithoutMaskByContext=function(t){return this.getRawValueWithoutMask(t.value)};t.prototype.getRawValueWithoutMask=function(t){if(t){var e=[];var a=t.split("");for(var n=0;n<a.length;n++){var i=a[n];var r=this.findByIndex(n);if(r&&!r.isSeparator){e.push(i.replace(r.mask,""))}else{e.push(i)}}e=e.filter((function(t){return t}));var o=this.list.filter((function(t){return t.isSeparator})).length;if(o===e.length){return""}return e.join("")}return""};t.prototype.formatBlocks=function(t,e){var a="".concat(t);for(var n=0;n<this.list.length;n++){var i=this.list[n];if(e!==n&&!i.isSeparator&&i.isTouched(a)){var r=i.getValueOfTheBlock(a);var o=i.format(r);a=a.substring(0,i.from)+o+a.substring(i.to)}}return a};t.prototype.getBlockIndexFromPosition=function(t){var e=this.list.reduce((function(t,e){return t+e.to-e.from}),0);if(t===e){return this.list.length-1}var a=this.list.findIndex((function(e){return e.from<=t&&t<e.to}));return a<0?undefined:Math.min(e,a)};t.prototype.verifyCallOfNextSeparator=function(t,e){if(this.list.length-1>e){var a=this.list[e+1];if(a.isSeparator&&a.mask===t){return true}}return false};return t}();var AbstractMask=function(){function t(t){if(t===void 0){t=[]}this.inputMode="text";this.locale="de-CH";this.blocks=new MaskBlockList(t)}t.prototype.onLocaleChange=function(t,e,a){if(t.target){var n=t.value;var i=n.split("");for(var r=0;r<i.length;r++){var o=i[r];var l=this.blocks.findByIndex(r);var s=a.findByIndex(r);if(l&&s){if(l.isSeparator){i[r]=l.mask}else if(o===s.mask){i[r]=l.mask}}}t.value=i.join("")}};t.prototype.onFocus=function(t){};t.prototype.onBlur=function(t){};t.prototype.onChange=function(t){t.submit("change",this.onParseValue(t.value))};t.prototype.onNavigationDown=function(t,e,a){};t.prototype.onSelectAll=function(t,e,a){};t.prototype.onPaste=function(t,e,a){var n=t.clipboardData||"";t.value=n;t.position.toEnd()};t.prototype.onBlockChange=function(t,e,a){t.setChar();t.position.next();var n=this.blocks.list[a+1];if(t.position.value===e.to&&n&&n.isSeparator){t.position.next()}};t.prototype.onBackspaceDown=function(t,e,a){t.position.previous();if(!e.isSeparator){t.setChar(e.mask);var n=this.blocks.list[a-1];if(t.position.value===e.from&&n&&n.isSeparator){t.position.previous()}}};t.prototype.onDeleteDown=function(t,e,a){t.setChar(e.mask);t.position.next();var n=this.blocks.list[a+1];if(t.position.value===e.to&&n&&n.isSeparator){t.position.next()}};t.prototype.onValueChanged=function(t){var e=this.onFormatValue(t.newValue);var a=t.focused&&e===""?this.blocks.getPlaceholderMask():e;t.value=a;t.position.toEnd()};t.prototype.onParseValue=function(t,e){if(e===void 0){e={allowInvalidValue:false}}if(t){return t.trim()}return t||""};t.prototype.onFormatValue=function(t){if(t){return t.trim()}return t||""};t.prototype.toParsedValue=function(t){return this.onParseValue(t)};t.prototype.toFormattedValue=function(t){return this.onFormatValue(t)};t.prototype.fireI18nChange=function(t){var e=this.blocks.clone();var a="".concat(t.locale);this.locale=t.locale;this.blocks.list.forEach((function(e){return e.onI18nChange(t.locale)}));this.onLocaleChange(t,a,e)};t.prototype.fireValueChanged=function(t){if(t.didValueChange){this.onValueChanged(t)}};t.prototype.firePaste=function(t){var e=this.blocks.getBlockIndexFromPosition(t.position.value);if(e!==undefined){var a=this.blocks.list[e];this.onPaste(t,a,e);this.onChange(t)}};t.prototype.fireClick=function(t){var e=this.blocks.getPlaceholderMask();if(e===t.value){t.position.toStart()}};t.prototype.fireFocus=function(t){if(t.target&&t.isValueEmpty()){this.resetInputValueWithMask(t)}this.onFocus(t)};t.prototype.fireBlur=function(t){if(t.target){if(this.isValueEmptyMask(t)){this.emptyInputValue(t)}else{this.onBlur(t);t.submit("blur",this.onParseValue(t.value,{allowInvalidValue:t.component.allowInvalidValue}))}}};t.prototype.fireKeyDown=function(t){var e=t.isBackspaceKey?Math.max(0,t.position.value-1):t.position.value;var a=this.blocks.getBlockIndexFromPosition(e);if(e>=this.blocks.lastPosition&&!t.isNavigationKey&&!t.isSelectAllCommand){t.preventDefault();t.stopPropagation();return}if(a!==undefined&&!t.position.isRangeSelection){var n=this.blocks.list[a];if(t.isNavigationKey){this.onNavigationDown(t,n,a)}else if(t.isSelectAllCommand){this.onSelectAll(t,n,a)}else if(t.isCopyCommand);else if(t.isPasteCommand);else if(t.isBackspaceKey){t.preventDefault();this.onBackspaceDown(t,n,a)}else if(t.isDeleteKey){t.preventDefault();this.onDeleteDown(t,n,a)}else if(t.isWhiteSpaceKey){t.preventDefault();var i=t.value[t.position.value];if(i==="."){t.stopPropagation();var r=t.value;t.value=r.substring(0,t.position.value)+"_"+r.substring(t.position.value+1)}}else if(n.verifyAllowedKeyHits(t.key)){t.preventDefault();this.onBlockChange(t,n,a)}else if(this.blocks.verifyCallOfNextSeparator(t.key,a)){t.preventDefault();var o=this.blocks.list[a];if(t.position.value>o.from){var l=this.blocks.list[a+1];var r=t.value;var s=n.getValueOfTheBlock(r);var d=n.format(s);t.value=r.substring(0,n.from)+d+r.substring(n.to);t.position.value=l.to}}var u=this.blocks.getBlockIndexFromPosition(t.position.value);if(u&&!t.isBackspaceKey){var c=this.blocks.formatBlocks(t.value,u);var h=t.position.value;t.value=c;t.position.value=h}}else{if(!t.isTabKey){t.preventDefault()}if(t.isBackspaceKey||t.isDeleteKey){this.resetInputValueWithMask(t)}else if(this.blocks.list[0].verifyAllowedKeyHits(t.key)){this.onBlockChange(t,this.blocks.list[0],0)}}};t.prototype.resetInputValueWithMask=function(t){t.value=this.blocks.getPlaceholderMask();t.position.toStart()};t.prototype.isValueEmptyMask=function(t){var e=this.blocks.getPlaceholderMask();return e===t.value};t.prototype.emptyInputValue=function(t){t.value="";t.submit("blur",t.value)};return t}();var DateMask=function(t){__extends(e,t);function e(){var e=t.call(this,[new MaskBlock({from:0,to:2,allowedKeys:__spreadArray([],NUMBER_KEYS,true),format:function(t,e,a){if(Number.isNaN(parseInt(t,10))){return"".concat(a).concat(a)}return t.padStart(2,"0")},mask:function(t){return e.dayMask[t.split("-")[0]]||e.dayMask["de"]}}),new MaskBlock({from:2,to:3,mask:function(t){return dateSeparator(t)},isSeparator:true}),new MaskBlock({from:3,to:5,allowedKeys:__spreadArray([],NUMBER_KEYS,true),format:function(t,e,a){if(Number.isNaN(parseInt(t,10))){return"".concat(a).concat(a)}return t.padStart(2,"0")},mask:function(t){return e.monthMask[t.split("-")[0]]||e.monthMask["de"]}}),new MaskBlock({from:5,to:6,mask:function(t){return dateSeparator(t)},isSeparator:true}),new MaskBlock({from:6,to:10,allowedKeys:__spreadArray([],NUMBER_KEYS,true),mask:function(t){return e.yearMask[t.split("-")[0]]||e.yearMask["de"]}})])||this;e.maxLength=10;e.minLength=10;e.inputMode="decimal";e.dayMask={de:"T",en:"D",fr:"J",it:"G",nl:"D",es:"D",pl:"D",pt:"D",sv:"D",fi:"M"};e.monthMask={de:"M",en:"M",fr:"M",it:"M",nl:"M",es:"M",pl:"M",pt:"M",sv:"M",fi:"K"};e.yearMask={de:"J",en:"Y",fr:"A",it:"A",nl:"J",es:"A",pl:"R",pt:"A",sv:"Å",fi:"V"};return e}e.prototype.onParseValue=function(t,e){if(e===void 0){e={allowInvalidValue:false}}if(t){var a=BalDate.fromAnyFormat(this.blocks.getRawValueWithoutMask(t));if(a.isValid){return a.toISODate()}else if(e&&e.allowInvalidValue){return INVALID_VALUE}}return""};e.prototype.onFormatValue=function(t){if(t){var e=BalDate.fromISO(t);if(e.isValid){return e.toFormat()}}return""};e.prototype.onPaste=function(t,e,a){var n=t.clipboardData||"";var i=BalDate.fromAnyFormat(n);if(i.isValid){t.value=i.toFormat();t.position.toEnd()}};e.prototype.onBlur=function(t){var e=this.blocks.getRawValueWithoutMaskByContext(t);var a=BalDate.fromAnyFormat(e);if(a.isValid){var n=a.toFormat();if(n!==t.value){t.value=n}}else if(t.component.allowInvalidValue){if(e!==t.value){t.value=e}}};return e}(AbstractMask);var MaskComponentAdapter=function(){function t(t){this.mask=t}Object.defineProperty(t.prototype,"attributes",{get:function(){return{inputMode:this.mask.inputMode,maxLength:this.mask.maxLength,minLength:this.mask.minLength,type:"text",autoCapitalize:"off",autoCorrect:"off",spellcheck:false}},enumerable:false,configurable:true});t.prototype.bindComponent=function(t){this.component=t};t.prototype.bindComponentDidLoad=function(){if(this.component&&this.component.nativeInput){this.component.nativeInput.value=this.component.value||""}this.bindValueChanged(this.component.value,undefined)};t.prototype.bindConfigChanged=function(t){var e=this,a=e.component,n=e.mask;var i=new MaskLocaleContext({component:a,mask:n,event:{locale:"".concat(t.language,"-").concat(t.region)}});this.mask.fireI18nChange(i);i.submit()};t.prototype.bindValueChanged=function(t,e){var a=this,n=a.component,i=a.mask;var r=new MaskValueChangedContext({component:n,mask:i,event:{newValue:t,oldValue:e}});this.mask.fireValueChanged(r);r.submit("blur")};t.prototype.bindKeyDown=function(t){if(this.isComponentAccessible){var e=this,a=e.component,n=e.mask;var i=new MaskKeyboardContext({event:t,component:a,mask:n});this.mask.fireKeyDown(i);var r=t.key==="Tab";i.submit(r?"tab":"input");a.balKeyPress.emit(t)}};t.prototype.bindFocus=function(t){if(this.isComponentAccessible){var e=this,a=e.component,n=e.mask;a.focused=true;var i=new MaskFocusContext({event:t,component:a,mask:n});this.mask.fireFocus(i);i.submit();a.balFocus.emit(t)}};t.prototype.bindBlur=function(t){if(this.isComponentAccessible){var e=this,a=e.component,n=e.mask;a.focused=false;var i=new MaskFocusContext({event:t,component:a,mask:n});this.mask.fireBlur(i);i.submit("blur");a.balBlur.emit(t)}};t.prototype.bindPaste=function(t){if(this.isComponentAccessible){var e=this,a=e.component,n=e.mask;var i=new MaskClipboardContext({event:t,component:a,mask:n});this.mask.firePaste(i);i.submit()}};t.prototype.bindFormReset=function(t){var e=this;var a=t.target;if(a&&(a===this.component.el||a.contains(this.component.el))){this.component.value=this.component.initialValue;this.component.inputValue=this.component.initialValue;clearTimeout(this.resetHandlerTimer);this.resetHandlerTimer=setTimeout((function(){if(e.component.nativeInput){e.component.nativeInput.value=e.mask.toFormattedValue(e.component.value||"")}}))}};t.prototype.bindClick=function(t){if(this.isComponentAccessible){var e=this,a=e.component,n=e.mask;var i=new MaskMouseContext({event:t,component:a,mask:n});this.mask.fireClick(i);i.submit()}};t.prototype.bindHostClick=function(t){if(!this.isComponentAccessible){t.preventDefault();t.stopPropagation()}};t.prototype.bindGlobalClick=function(t){if(!this.isComponentAccessible){if(t.target&&t.target===this.component.el){t.preventDefault();t.stopPropagation()}}};Object.defineProperty(t.prototype,"isComponentAccessible",{get:function(){return!this.component.disabled&&!this.component.readonly},enumerable:false,configurable:true});return t}();var balInputDateCss=".bal-input-date{display:block;width:100%;-ms-flex:1;flex:1}.bal-input-date input:not(:-moz-placeholder-shown){letter-spacing:.4px}.bal-input-date input:not(:-ms-input-placeholder){letter-spacing:.4px}.bal-input-date input:not(:placeholder-shown){letter-spacing:.4px}.bal-input-date__native{position:absolute !important;left:0;top:0;margin:0;padding:0;opacity:0;outline:0;border:none;width:1px;height:1px;clip:rect(1px, 1px, 1px, 1px);overflow:hidden}";var InputDate=function(){function t(t){registerInstance(this,t);this.balKeyPress=createEvent(this,"balKeyPress");this.balChange=createEvent(this,"balChange");this.balInput=createEvent(this,"balInput");this.balBlur=createEvent(this,"balBlur");this.balFocus=createEvent(this,"balFocus");this.inputId="bal-i-date-".concat(inputDateIds++);this.inheritedAttributes={};this.maskAdapter=new MaskComponentAdapter(new DateMask);this.focused=false;this.isGrouped=false;this.ariaForm=defaultBalAriaForm;this.name=this.inputId;this.invalid=false;this.required=false;this.disabled=false;this.readonly=false;this.clickable=false;this.autocomplete="off";this.hasIconRight=false;this.value=undefined;this.inputValue=this.value;this.initialValue=this.value||"";this.autoInvalidOff=false;this.allowInvalidValue=false}t.prototype.createLogger=function(t){this.log=t};t.prototype.valueChanged=function(t,e){this.maskAdapter.bindValueChanged(t,e)};t.prototype.connectedCallback=function(){this.maskAdapter.bindComponent(this);this.isGrouped=hasParent("bal-input-group",this.el)};t.prototype.componentDidLoad=function(){this.maskAdapter.bindComponentDidLoad()};t.prototype.componentWillRender=function(){this.inheritedAttributes=inheritAttributes(this.el,["aria-label","tabindex","title","data-hj-allow"])};t.prototype.configChanged=function(t){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){this.maskAdapter.bindConfigChanged(t);return[2]}))}))};t.prototype.resetHandler=function(t){this.maskAdapter.bindFormReset(t)};t.prototype.listenOnClick=function(t){this.maskAdapter.bindGlobalClick(t)};t.prototype.setFocus=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){inputSetFocus(this);return[2]}))}))};t.prototype.setBlur=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){inputSetBlur(this);return[2]}))}))};t.prototype.getInputElement=function(){return Promise.resolve(this.nativeInput)};t.prototype.setAriaForm=function(t){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){this.ariaForm=Object.assign({},t);return[2]}))}))};t.prototype.render=function(){var t=this;var e=BEM.block("input-date");var a=e.element("native");return h(Host,{key:"3c71adc69c5270029c588885037338aee6dfc85f",onClick:function(e){return t.maskAdapter.bindHostClick(e)},class:Object.assign({},e.class())},h("input",Object.assign({key:"56c3f39f98b9dadb6b18f8bfea4c172e7bc0e607",class:{input:true,"is-disabled":this.disabled||this.readonly,"is-danger":this.invalid,"is-clickable":this.clickable&&!(this.disabled||this.readonly),"bal-focusable":!this.disabled,"has-icon-right":this.hasIconRight},"data-testid":"bal-date-input",ref:function(e){return t.nativeInput=e},id:this.ariaForm.controlId||this.inputId,"aria-labelledby":this.ariaForm.labelId,"aria-describedby":this.ariaForm.messageId,"aria-invalid":this.invalid===true?"true":"false","aria-disabled":ariaBooleanToString(this.disabled),required:this.required,disabled:this.disabled,readonly:this.readonly,autoComplete:this.autocomplete},this.maskAdapter.attributes,this.inheritedAttributes,{placeholder:this.placeholder,value:this.inputValue,onKeyDown:function(e){return t.maskAdapter.bindKeyDown(e)},onClick:function(e){return t.maskAdapter.bindClick(e)},onFocus:function(e){return t.maskAdapter.bindFocus(e)},onBlur:function(e){return t.maskAdapter.bindBlur(e)},onPaste:function(e){return t.maskAdapter.bindPaste(e)}})),h("input",{key:"dae67450389be6169c8257a0b1eaf877fb81e66b",type:"date",class:Object.assign({},a.class()),name:this.name,min:this.min,max:this.max,value:this.value,tabindex:-1,"aria-hidden":"true"}))};Object.defineProperty(t.prototype,"el",{get:function(){return getElement(this)},enumerable:false,configurable:true});Object.defineProperty(t,"watchers",{get:function(){return{value:["valueChanged"]}},enumerable:false,configurable:true});return t}();__decorate([Logger("bal-input-date"),__metadata("design:type",Function),__metadata("design:paramtypes",[Function]),__metadata("design:returntype",void 0)],InputDate.prototype,"createLogger",null);__decorate([ListenToConfig(),__metadata("design:type",Function),__metadata("design:paramtypes",[Object]),__metadata("design:returntype",Promise)],InputDate.prototype,"configChanged",null);var inputDateIds=0;InputDate.style=balInputDateCss;export{DateCalendar as bal_date_calendar,InputDate as bal_input_date};
1
+ import{__awaiter,__extends,__generator,__spreadArray}from"tslib";import{h,r as registerInstance,c as createEvent,H as Host,g as getElement}from"./index-BdVwMG9u.js";import{_ as __decorate,a as __metadata}from"./tslib.es6-dfXERft2.js";import{B as BEM}from"./bem-ByiN-QjD.js";import{a as waitAfterFramePaint,q as hasParent}from"./helpers-BNj87EbG.js";import{L as Logger}from"./log-CwssmmaV.js";import{p as padStart}from"./index-BU7FUSdu.js";import{i as isNil}from"./index-zWZxKBfo.js";import{B as BalDate,i as i18nBalDate,d as dateSeparator}from"./date-W0XtD641.js";import{d as defaultConfig}from"./config.default-RE8-gLMQ.js";import{L as ListenToConfig}from"./config.decorator-3bfyZ-0Y.js";import{L as ListenToSwipe}from"./swipe.decorator-B_Ghrp1o.js";import{a as ariaBooleanToString}from"./aria-DBsOHTWj.js";import{i as inheritAttributes}from"./attributes-C4sZQbkT.js";import{d as defaultBalAriaForm}from"./form-FCLKfv6B.js";import{l as hasValueChanged,c as inputSetFocus,d as inputSetBlur}from"./form-input-DYvzaBlM.js";import{N as NUMBER_KEYS}from"./keys.constant-xVPGsAdF.js";import{I as INVALID_VALUE}from"./mask-util-DuObDTix.js";import"./browser-B1u-Mq75.js";import"./config.utils-B7jugjyM.js";import"./_commonjsHelpers-BFTU3MAI.js";import"./swipe.subject-T0VStuOK.js";import"./device-TtMibDFL.js";import"./listener-CClDIhvK.js";function getDaysInMonth(t,e){if(e<1||t<0){return undefined}return new Date(t,e,0).getDate()}function isoDateOfDay(t,e,a){return"".concat(a,"-").concat(padStart("".concat(e),2,"0"),"-").concat(padStart("".concat(t),2,"0"))}function isoDateOfToday(){var t=new Date;return"".concat(t.getFullYear(),"-").concat(padStart("".concat(t.getMonth()+1),2,"0"),"-").concat(padStart("".concat(t.getDate()),2,"0"))}function generateCalendarGrid(t,e,a,n,i){var r=[];var o=getDaysInMonth(t,e);var l=getFirstDayOfMonth(t,e);if(o!==undefined&&l){var s=isoDateOfToday();var d=BalDate.fromISO(a);var u=BalDate.fromISO(n);var c=function(t){if(isNil(i)){return false}return!i(t)};for(var h=1;h<=o;h++){var f=isoDateOfDay(h,e,t);r.push({day:h,month:e,year:t,isoDate:f,fullDate:BalDate.fromISO(f).toFormat(),today:s===f,disabled:d.isAfter(f)||u.isBefore(f)||c(f)})}}return r}function getFirstWeekdayOfMonth(t,e){if(e<1||t<0){return 1}var a=new Date(t,e-1,1);var n=a.getDay();return n===0?7:n}function validateLanguage(t){if(["en","de","fr","it","nl","es","pl","pt","sv","fi"].includes(t)){return t}return"de"}function generateYears(t,e,a){var n=[];var i=new Date;var r=i.getFullYear();for(var o=e;o<=a;o++){n.push({value:o,label:"".concat(o),disabled:false,today:r===o,selected:t===o})}return n}function generateMonths(t,e,a,n,i){var r=validateLanguage(t);var o=BalDate.infoMonths({format:"long",locale:r});var l=BalDate.fromISO(a);var s=new Date;var d=s.getFullYear();var u=s.getMonth()+1;var c=0;if(n&&e!==undefined){var h=BalDate.fromISO(n);if(h.isValid){if(e>h.year){c=0}else{c=h.month||c}}}var f=12;if(i&&e!==undefined){var b=BalDate.fromISO(i);if(b.isValid){if(e<b.year){f=12}else{f=b.month||f}}}return o.map((function(t,a){var n=a+1;return{label:t,value:n,today:n===u&&e===d,selected:n===l.month&&e===l.year,disabled:n<c||n>f}}))}function generateWeekDays(t){var e=validateLanguage(t);var a=BalDate.infoWeekdays({format:"short",locale:e});var n=BalDate.infoWeekdays({format:"long",locale:e});return a.map((function(t,e){return{ariaLabel:n[e],textContent:t}}))}function getFirstDayOfMonth(t,e){if(e<1||e>12||t<0){return undefined}return new Date(t,e-1,1)}var CalendarGrid=function(t){var e=t.isVisible,a=t.ref,n=t.grid,i=t.weekdays,r=t.selectedDate,o=t.firstDayOfWeek,l=t.onSelectDay;var s=BEM.block("date-calendar");var d=s.element("body");var u=d.element("grid");return h("div",{role:"grid",class:Object.assign(Object.assign({},u.class()),u.modifier("visible").class(e)),"aria-hidden":e?"false":"true",ref:function(t){return a(t)}},h("div",{role:"row",class:Object.assign({},u.element("head").class())},i.map((function(t){return h("span",{key:t.textContent,role:"columnheader","aria-label":t.ariaLabel,title:t.ariaLabel},t.textContent)}))),h("div",{role:"row",class:Object.assign({},u.element("body").class()),style:{"--bal-date-first-week-day":"".concat(o)}},n.map((function(t){return h("bal-date-calendar-cell",Object.assign({key:t.isoDate},t,{selected:t.isoDate===r,onBalSelectDay:function(t){var e=t.detail;return l(e)}}))}))))};var CalendarList=function(t){var e=t.name,a=t.isVisible,n=t.girdHeight,i=t.list,r=t.onSelect,o=t.ref;var l=BEM.block("date-calendar");var s=l.element("body");var d=s.element("list");return h("ul",{class:Object.assign(Object.assign(Object.assign({},d.class()),d.modifier(e).class()),d.modifier("visible").class(a)),"aria-hidden":a?"false":"true",style:{height:"".concat(n-2-8-8,"px")},ref:function(t){return o?o(t):undefined}},i.map((function(t){return h("li",{key:t.value,id:"".concat(e,"-").concat(t.value)},h("button",{class:Object.assign(Object.assign(Object.assign(Object.assign({},d.element("item").class()),d.element("item").modifier("today").class(t.today)),d.element("item").modifier("selected").class(t.selected)),d.element("item").modifier("disabled").class(t.disabled)),disabled:t.disabled,tabIndex:-1,onClick:function(){if(!t.disabled){r(t)}}},t.label))})))};var CalendarNav=function(t){var e=t.language,a=t.onClickSelectMonthAndYear,n=t.monthFullNames,i=t.month,r=t.year,o=t.isCalendarVisible,l=t.isListVisible,s=t.onClickPreviousMonth,d=t.onClickNextMonth;var u=BEM.block("date-calendar");var c=u.element("nav");var f=i18nBalDate[e].nextMonth;var b=i18nBalDate[e].previousMonth;var v=i18nBalDate[e].selectMonth;return h("div",{class:Object.assign({},c.class())},h("div",{class:Object.assign({},c.modifier("start").class())},h("button",{title:v,"aria-label":v,tabIndex:-1,"data-testid":"change-year-month",onClick:a},h("span",null,n[i-1]," ",r),h("bal-icon",{name:"caret-up",color:"primary",size:"small",turn:o}))),h("div",{class:Object.assign({},c.modifier("end").class()),style:{display:l?"none":"flex"}},h("button",{title:b,"aria-label":b,onClick:s,tabIndex:-1,"data-testid":"previous-month"},h("bal-icon",{name:"caret-left",color:"primary",size:"small"})),h("button",{title:f,"aria-label":f,onClick:d,tabIndex:-1,"data-testid":"next-month"},h("bal-icon",{name:"caret-right",color:"primary",size:"small"}))))};var balDateCalendarCss=':host{--bal-date-first-week-day:0;--bal-date-calendar-button-background:transparent;--bal-date-calendar-button-background-hover:var(--bal-color-light-blue-1);--bal-date-calendar-button-background-active:var(--bal-color-light-blue-2);--bal-date-calendar-button-color:var(--bal-color-text-primary);--bal-date-calendar-button-today-color:var(--bal-color-light-blue-3);--bal-date-calendar-button-today-color-hover:var(--bal-color-text-primary);--bal-date-calendar-button-today-color-active:var(--bal-color-text-primary);--bal-date-calendar-button-selected-background:var(--bal-color-primary);--bal-date-calendar-button-selected-color:var(--bal-color-text-white)}:host{-webkit-touch-callout:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;display:inline-block;background:var(--bal-color-white);border-radius:var(--bal-radius-normal)}.bal-date-calendar__nav{display:-ms-flexbox;display:flex;width:calc(100% - 1rem);-ms-flex-pack:justify;justify-content:space-between;-ms-flex-align:center;align-items:center;padding:.5rem;gap:.5rem}.bal-date-calendar__nav--start>button{display:-ms-flexbox;display:flex;gap:.5rem}.bal-date-calendar__nav--end{display:-ms-flexbox;display:flex;gap:.5rem}.bal-date-calendar__nav button{display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;-ms-flex-align:center;align-items:center;cursor:pointer;border-radius:var(--bal-radius-normal);font-family:var(--bal-font-family-text);font-weight:var(--bal-font-weight-regular);color:var(--bal-date-calendar-button-color);border:none;background:var(--bal-date-calendar-button-background);text-align:center;font-size:var(--bal-text-size-normal);line-height:var(--bal-line-height-normal);-webkit-hyphens:auto;-ms-hyphens:auto;hyphens:auto;outline:none;min-height:2rem;min-width:2rem;padding:.25rem;border-radius:var(--bal-button-radius);font-family:var(--bal-font-family-title);font-weight:var(--bal-font-weight-bold)}@media (hover: hover)and (pointer: fine){.bal-date-calendar__nav button:not(.bal-date-calendar__nav button--selected):not(.bal-date-calendar__nav button--disabled):hover{background:var(--bal-date-calendar-button-background-hover)}}.bal-date-calendar__nav button:not(.bal-date-calendar__nav button--selected):not(.bal-date-calendar__nav button--disabled):active{background:var(--bal-date-calendar-button-background-active)}.bal-date-calendar__nav button--today:not(.bal-date-calendar__nav button--selected):not(.bal-date-calendar__nav button--disabled){color:var(--bal-date-calendar-button-today-color);font-weight:var(--bal-font-weight-bold)}@media (hover: hover)and (pointer: fine){.bal-date-calendar__nav button--today:not(.bal-date-calendar__nav button--selected):not(.bal-date-calendar__nav button--disabled):hover{color:var(--bal-date-calendar-button-today-color-hover)}}.bal-date-calendar__nav button--today:not(.bal-date-calendar__nav button--selected):not(.bal-date-calendar__nav button--disabled):active{color:var(--bal-date-calendar-button-today-color-active)}.bal-date-calendar__nav button--selected{background:var(--bal-date-calendar-button-selected-background);color:var(--bal-date-calendar-button-selected-color);font-weight:var(--bal-font-weight-bold)}.bal-date-calendar__nav button--disabled{cursor:default;background:rgba(0,0,0,0);color:var(--bal-color-text-grey-light)}.bal-date-calendar__body{display:block}.bal-date-calendar__body__grid{width:-webkit-fit-content;width:-moz-fit-content;width:fit-content;padding:.5rem;height:0;padding-top:0;padding-bottom:0;visibility:hidden}.bal-date-calendar__body__grid--visible{height:auto;padding-top:.5rem;padding-bottom:.5rem;visibility:visible}.bal-date-calendar__body__grid__head{position:relative;display:grid;grid-template-columns:repeat(7, 1fr);-webkit-column-gap:.5rem;-moz-column-gap:.5rem;column-gap:.5rem;row-gap:.5rem;width:-webkit-fit-content;width:-moz-fit-content;width:fit-content}.bal-date-calendar__body__grid__head::after{position:absolute;content:"";height:2px;width:calc(100% + 1rem);bottom:0;left:-0.5rem;right:-0.5rem;background:var(--bal-color-border)}.bal-date-calendar__body__grid__head span{display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;-ms-flex-align:center;align-items:center;height:2rem;width:2rem;font-family:var(--bal-font-family-title);font-weight:var(--bal-font-weight-bold);font-size:var(--bal-text-size-normal);line-height:var(--bal-line-height-normal);-webkit-hyphens:auto;-ms-hyphens:auto;hyphens:auto;text-wrap:nowrap}.bal-date-calendar__body__grid__body{display:grid;grid-template-columns:repeat(7, 1fr);-webkit-column-gap:.5rem;-moz-column-gap:.5rem;column-gap:.5rem;row-gap:.5rem;width:-webkit-fit-content;width:-moz-fit-content;width:fit-content;padding-top:.5rem}.bal-date-calendar__body__grid__body>.bal-date-calendar-cell{width:2rem;height:2rem;text-align:center;font-size:var(--bal-text-size-normal);line-height:var(--bal-line-height-normal);-webkit-hyphens:auto;-ms-hyphens:auto;hyphens:auto}.bal-date-calendar__body__grid__body>.bal-date-calendar-cell:first-child{grid-column:var(--bal-date-first-week-day)}.bal-date-calendar__body__list{display:none;list-style:none;margin:0;padding:0;-webkit-column-gap:.5rem;-moz-column-gap:.5rem;column-gap:.5rem;row-gap:.5rem;width:calc(100% - 1rem);overflow-y:auto;max-height:18rem;position:relative;padding:.5rem;border-top:2px solid var(--bal-color-border)}.bal-date-calendar__body__list .bal-date-calendar__body__list__item{display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;-ms-flex-align:center;align-items:center;cursor:pointer;border-radius:var(--bal-radius-normal);font-family:var(--bal-font-family-text);font-weight:var(--bal-font-weight-regular);color:var(--bal-date-calendar-button-color);border:none;background:var(--bal-date-calendar-button-background);text-align:center;font-size:var(--bal-text-size-normal);line-height:var(--bal-line-height-normal);-webkit-hyphens:auto;-ms-hyphens:auto;hyphens:auto;outline:none;width:100%}@media (hover: hover)and (pointer: fine){.bal-date-calendar__body__list .bal-date-calendar__body__list__item:not(.bal-date-calendar__body__list .bal-date-calendar__body__list__item--selected):not(.bal-date-calendar__body__list .bal-date-calendar__body__list__item--disabled):hover{background:var(--bal-date-calendar-button-background-hover)}}.bal-date-calendar__body__list .bal-date-calendar__body__list__item:not(.bal-date-calendar__body__list .bal-date-calendar__body__list__item--selected):not(.bal-date-calendar__body__list .bal-date-calendar__body__list__item--disabled):active{background:var(--bal-date-calendar-button-background-active)}.bal-date-calendar__body__list .bal-date-calendar__body__list__item--today:not(.bal-date-calendar__body__list .bal-date-calendar__body__list__item--selected):not(.bal-date-calendar__body__list .bal-date-calendar__body__list__item--disabled){color:var(--bal-date-calendar-button-today-color);font-weight:var(--bal-font-weight-bold)}@media (hover: hover)and (pointer: fine){.bal-date-calendar__body__list .bal-date-calendar__body__list__item--today:not(.bal-date-calendar__body__list .bal-date-calendar__body__list__item--selected):not(.bal-date-calendar__body__list .bal-date-calendar__body__list__item--disabled):hover{color:var(--bal-date-calendar-button-today-color-hover)}}.bal-date-calendar__body__list .bal-date-calendar__body__list__item--today:not(.bal-date-calendar__body__list .bal-date-calendar__body__list__item--selected):not(.bal-date-calendar__body__list .bal-date-calendar__body__list__item--disabled):active{color:var(--bal-date-calendar-button-today-color-active)}.bal-date-calendar__body__list .bal-date-calendar__body__list__item--selected{background:var(--bal-date-calendar-button-selected-background);color:var(--bal-date-calendar-button-selected-color);font-weight:var(--bal-font-weight-bold)}.bal-date-calendar__body__list .bal-date-calendar__body__list__item--disabled{cursor:default;background:rgba(0,0,0,0);color:var(--bal-color-text-grey-light)}.bal-date-calendar__body__list--visible{display:grid}.bal-date-calendar__body__list--year{grid-template-columns:repeat(4, 1fr)}.bal-date-calendar__body__list--month{grid-template-columns:repeat(2, 1fr)}.bal-date-calendar-cell{display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;-ms-flex-align:center;align-items:center;cursor:pointer;border-radius:var(--bal-radius-normal);font-family:var(--bal-font-family-text);font-weight:var(--bal-font-weight-regular);color:var(--bal-date-calendar-button-color);border:none;background:var(--bal-date-calendar-button-background);text-align:center;font-size:var(--bal-text-size-normal);line-height:var(--bal-line-height-normal);-webkit-hyphens:auto;-ms-hyphens:auto;hyphens:auto;outline:none;width:2rem;height:2rem}@media (hover: hover)and (pointer: fine){.bal-date-calendar-cell:not(.bal-date-calendar-cell--selected):not(.bal-date-calendar-cell--disabled):hover{background:var(--bal-date-calendar-button-background-hover)}}.bal-date-calendar-cell:not(.bal-date-calendar-cell--selected):not(.bal-date-calendar-cell--disabled):active{background:var(--bal-date-calendar-button-background-active)}.bal-date-calendar-cell--today:not(.bal-date-calendar-cell--selected):not(.bal-date-calendar-cell--disabled){color:var(--bal-date-calendar-button-today-color);font-weight:var(--bal-font-weight-bold)}@media (hover: hover)and (pointer: fine){.bal-date-calendar-cell--today:not(.bal-date-calendar-cell--selected):not(.bal-date-calendar-cell--disabled):hover{color:var(--bal-date-calendar-button-today-color-hover)}}.bal-date-calendar-cell--today:not(.bal-date-calendar-cell--selected):not(.bal-date-calendar-cell--disabled):active{color:var(--bal-date-calendar-button-today-color-active)}.bal-date-calendar-cell--selected{background:var(--bal-date-calendar-button-selected-background);color:var(--bal-date-calendar-button-selected-color);font-weight:var(--bal-font-weight-bold)}.bal-date-calendar-cell--disabled{cursor:default;background:rgba(0,0,0,0);color:var(--bal-color-text-grey-light)}';var DateCalendar=function(){function t(t){var e=this;registerInstance(this,t);this.balChange=createEvent(this,"balChange");this.oldMin="";this.oldMax="";this.selectedDate="";this.monthFullNames=[];this.weekdays=[];this.months=[];this.years=[];this.calendarGrid=[];this.firstDayOfWeek=0;this.month=0;this.year=0;this.language=defaultConfig.language;this.isCalendarVisible=true;this.isYearListVisible=false;this.isMonthListVisible=false;this.allowedDates=undefined;this.onSelectDay=function(t){e.valueChanged(t,e.selectedDate);e.balChange.emit(e.selectedDate)};this.onClickNextMonth=function(){var t=e.year;var a=e.month+1;if(a>12){a=1;t=t+1}e.generateGridByMonthAndYear(a,t)};this.onClickPreviousMonth=function(){var t=e.year;var a=e.month-1;if(a<1){a=12;t=t-1}e.generateGridByMonthAndYear(a,t)};this.onClickSelectMonthAndYear=function(){return __awaiter(e,void 0,void 0,(function(){var t,e;return __generator(this,(function(a){switch(a.label){case 0:this.updateSelections();if(!(this.isCalendarVisible===true))return[3,2];this.isCalendarVisible=false;this.isYearListVisible=true;this.isMonthListVisible=false;return[4,waitAfterFramePaint()];case 1:a.sent();if(this.yearListEl){t=this.yearListEl.querySelector("#year-".concat(this.year));if(t){e=26+8+4;this.yearListEl.scrollTop=t.offsetTop-e*2}else{this.yearListEl.scrollTop=0}}return[3,3];case 2:this.isCalendarVisible=true;this.isYearListVisible=false;this.isMonthListVisible=false;a.label=3;case 3:return[2]}}))}))};this.onClickYear=function(t){e.isYearListVisible=false;e.isMonthListVisible=true;e.generateGridByMonthAndYear(e.month,t);e.months=generateMonths(e.language,t,e.selectedDate,e.min,e.max)};this.onClickMonth=function(t){e.isYearListVisible=false;e.isMonthListVisible=false;e.isCalendarVisible=true;e.generateGridByMonthAndYear(t,e.year)}}t.prototype.createLogger=function(t){this.log=t};t.prototype.valueChanged=function(t,e){if(t!==e){var a=BalDate.fromISO(t);if(!a.isValid){this.generateGridByDefaultDate();this.selectedDate=""}else{this.generateGridByDate(a);this.selectedDate=a.toISODate()}this.updateSelections()}};t.prototype.rangePropChanged=function(){this.updateSelections();this.generateGrid()};t.prototype.yearRangePropChanged=function(){this.updateSelections()};t.prototype.connectedCallback=function(){this.generateGridByDefaultDate();this.valueChanged(this.value,undefined)};t.prototype.configChanged=function(t){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){this.language=t.language;this.monthFullNames=BalDate.infoMonths({format:"long",locale:this.language});this.weekdays=generateWeekDays(this.language);this.updateSelections();return[2]}))}))};t.prototype.swipeListener=function(t){var e=t.left,a=t.right;if(e){this.onClickNextMonth()}else if(a){this.onClickPreviousMonth()}};Object.defineProperty(t.prototype,"minYear",{get:function(){if(this.minYearProp===undefined){var t=new Date;var e=t.getFullYear();var a=e-100;if(this.min){var n=BalDate.fromISO(this.min);return n.year||a}else{return a}}return this.minYearProp},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"maxYear",{get:function(){if(this.maxYearProp===undefined){var t=new Date;var e=t.getFullYear();var a=e+50;if(this.max){var n=BalDate.fromISO(this.max);return n.year||a}else{return a}}return this.maxYearProp},enumerable:false,configurable:true});t.prototype.updateSelections=function(){this.years=generateYears(this.year,this.minYear,this.maxYear);this.months=generateMonths(this.language,this.year,this.selectedDate,this.min,this.max)};t.prototype.generateGrid=function(){var t=BalDate.fromISO(this.value);if(t.isValid){this.generateGridByDate(t)}else{this.generateGridByDefaultDate()}};t.prototype.generateGridByDate=function(t){if(t.year!==undefined&&t.month!==undefined){this.generateGridByMonthAndYear(t.month,t.year)}};t.prototype.generateGridByDefaultDate=function(){var t=BalDate.fromISO(this.defaultDate);if(t.isValid){this.generateGridByDate(t)}else{var e=new Date;this.month=e.getMonth()+1;this.year=e.getFullYear();this.calendarGrid=generateCalendarGrid(this.year,this.month,this.min,this.max,this.allowedDates);this.firstDayOfWeek=getFirstWeekdayOfMonth(this.year,this.month)}};t.prototype.generateGridByMonthAndYear=function(t,e){if(this.month!==t||this.year!==e||this.oldMin!==this.min||this.oldMax!==this.max){this.calendarGrid=generateCalendarGrid(e,t,this.min,this.max,this.allowedDates);this.firstDayOfWeek=getFirstWeekdayOfMonth(e,t)}this.month=t;this.year=e;this.oldMin=this.min;this.oldMax=this.max};t.prototype.render=function(){var t=this;var e;var a=((e=this.gridEl)===null||e===void 0?void 0:e.clientHeight)||0;var n=BEM.block("date-calendar");var i=n.element("body");var r=n.element("foot");return h(Host,{key:"34efddf3c88e5470dcefd22c5cab262873d07de8",class:Object.assign({},n.class())},h(CalendarNav,{key:"9c8942a95ff9f1c8fdc8b1e153a29632145d1c2b",language:this.language,monthFullNames:this.monthFullNames,month:this.month,year:this.year,isCalendarVisible:this.isCalendarVisible,isListVisible:this.isMonthListVisible||this.isYearListVisible,onClickSelectMonthAndYear:this.onClickSelectMonthAndYear,onClickPreviousMonth:this.onClickPreviousMonth,onClickNextMonth:this.onClickNextMonth}),h("div",{key:"6a2cb7bba9c0568c1dc31d8b1c811b90c5845dce",class:Object.assign({},i.class())},h(CalendarGrid,{key:"a687e1e1f80bc8ea21bdc7ad4709537829005843",isVisible:this.isCalendarVisible,grid:this.calendarGrid,weekdays:this.weekdays,firstDayOfWeek:this.firstDayOfWeek,selectedDate:this.selectedDate,ref:function(e){return t.gridEl=e},onSelectDay:function(e){return t.onSelectDay(e)}}),h(CalendarList,{key:"cba1e282fb92f5edfa04e97eefcf9b38b57b8428",name:"year",isVisible:this.isYearListVisible,girdHeight:a,list:this.years,ref:function(e){return t.yearListEl=e},onSelect:function(e){return t.onClickYear(e.value)}}),h(CalendarList,{key:"ae7cb47aaffec3d3a91d1aab96f1fbdde34b7e6f",name:"month",isVisible:this.isMonthListVisible,girdHeight:a,list:this.months,onSelect:function(e){return t.onClickMonth(e.value)}})),h("div",{key:"6e455964845a4e57abc793cb78916ed51fa0bdb3",class:Object.assign({},r.class())},h("slot",{key:"277a09ef4cb10f6f051c84b1ba9f9ae79f0d3479"})))};Object.defineProperty(t.prototype,"el",{get:function(){return getElement(this)},enumerable:false,configurable:true});Object.defineProperty(t,"watchers",{get:function(){return{value:["valueChanged"],min:["rangePropChanged"],max:["rangePropChanged"],minYearProp:["yearRangePropChanged"],maxYearProp:["yearRangePropChanged"]}},enumerable:false,configurable:true});return t}();__decorate([Logger("bal-date-calendar"),__metadata("design:type",Function),__metadata("design:paramtypes",[Function]),__metadata("design:returntype",void 0)],DateCalendar.prototype,"createLogger",null);__decorate([ListenToConfig(),__metadata("design:type",Function),__metadata("design:paramtypes",[Object]),__metadata("design:returntype",Promise)],DateCalendar.prototype,"configChanged",null);__decorate([ListenToSwipe({mobileOnly:true}),__metadata("design:type",Function),__metadata("design:paramtypes",[Object]),__metadata("design:returntype",void 0)],DateCalendar.prototype,"swipeListener",null);DateCalendar.style=balDateCalendarCss;var MaskPosition=function(){function t(t){this._options=t;this._position=0;this._positionEnd=0;this._isRangeSelection=false;if(t.component&&t.component.nativeInput){this._position=t.component.nativeInput.selectionStart||0;this._positionEnd=t.component.nativeInput.selectionEnd||0;this._isRangeSelection=this._position!==this._positionEnd}}Object.defineProperty(t.prototype,"isRangeSelection",{get:function(){return this._isRangeSelection},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"value",{get:function(){if(this._options.isBackspace&&this._position>0){return this._position-1}return this._position},set:function(t){var e=t<0?0:t>this._options.mask.maxLength?this._options.mask.maxLength:t;this._position=e},enumerable:false,configurable:true});t.prototype.toStart=function(){this.value=0};t.prototype.toEnd=function(){var t=this.getTarget();if(t){this.value=t.value.length}};t.prototype.next=function(t){if(t===void 0){t=1}var e=this._position+t;if(e<=this._options.mask.maxLength){this._position=e}return this._position};t.prototype.previous=function(t){if(t===void 0){t=1}var e=this._position-t;if(e>=0){this._position=e}else{this._position=0}return this._position};t.prototype.submit=function(){var t=this.getTarget();if(t&&t.selectionStart!==this._position&&t.selectionEnd!==this._position){t.selectionStart=this._position;t.selectionEnd=this._position}};t.prototype.getTarget=function(){if(this._options.component&&this._options.component.nativeInput){return this._options.component.nativeInput}return undefined};return t}();var MaskContext=function(){function t(t){this._options=t;this._value="";if(this._options.component&&this._options.component.nativeInput){this._value=this._options.component.nativeInput.value}this.position=new MaskPosition(this._options);this.component=this._options.component}Object.defineProperty(t.prototype,"target",{get:function(){if(this._options.component&&this._options.component.nativeInput){return this._options.component.nativeInput}return undefined},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"value",{get:function(){return this._value},set:function(t){this._value=t},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"focused",{get:function(){return this._options.component.focused},enumerable:false,configurable:true});t.prototype.isValueEmpty=function(){return this.value===""||this.value===undefined||this.value===null};t.prototype.preventDefault=function(){if(this._options.event.preventDefault){this._options.event.preventDefault()}};t.prototype.stopPropagation=function(){this.preventDefault();if(this._options.event.stopPropagation){this._options.event.stopPropagation()}};t.prototype.submit=function(){return __awaiter(this,arguments,void 0,(function(t,e){if(t===void 0){t="input"}return __generator(this,(function(a){if(this.target){this.target.value=this.value;if(t!=="blur"&&t!=="tab"){this.position.submit()}if(this._options.component){if(t==="input"||t==="tab"){this._options.component.balInput.emit(this.value)}if((t==="change"||t==="blur")&&e!==undefined){if(hasValueChanged(this._options.component.value,e)){this._options.component.value=e;this._options.component.balChange.emit(e)}}}}return[2]}))}))};return t}();var MaskClipboardContext=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}Object.defineProperty(e.prototype,"clipboardData",{get:function(){var t;return(t=this._options.event.clipboardData)===null||t===void 0?void 0:t.getData("text")},enumerable:false,configurable:true});return e}(MaskContext);var MaskFocusContext=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e}(MaskContext);var MaskKeyboardContext=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}Object.defineProperty(e.prototype,"key",{get:function(){return this._options.event.key},enumerable:false,configurable:true});Object.defineProperty(e.prototype,"isCtrlOrCommandKey",{get:function(){return this._options.event.metaKey||this._options.event.ctrlKey},enumerable:false,configurable:true});Object.defineProperty(e.prototype,"isBackspaceKey",{get:function(){return this._options.event.key==="Backspace"},enumerable:false,configurable:true});Object.defineProperty(e.prototype,"isTabKey",{get:function(){return this._options.event.key==="Tab"},enumerable:false,configurable:true});Object.defineProperty(e.prototype,"isWhiteSpaceKey",{get:function(){return this._options.event.key===" "},enumerable:false,configurable:true});Object.defineProperty(e.prototype,"isDeleteKey",{get:function(){return this._options.event.key==="Delete"||this._options.event.key==="Del"},enumerable:false,configurable:true});Object.defineProperty(e.prototype,"isNumberKey",{get:function(){return e.NUMBER_KEYS.includes(this._options.event.key)},enumerable:false,configurable:true});Object.defineProperty(e.prototype,"isNavigationKey",{get:function(){return e.NAVIGATION_KEYS.includes(this._options.event.key)},enumerable:false,configurable:true});Object.defineProperty(e.prototype,"isSelectAllCommand",{get:function(){return(this._options.event.ctrlKey||this._options.event.metaKey)&&this.key==="a"},enumerable:false,configurable:true});Object.defineProperty(e.prototype,"isCopyCommand",{get:function(){return(this._options.event.ctrlKey||this._options.event.metaKey)&&this.key==="c"},enumerable:false,configurable:true});Object.defineProperty(e.prototype,"isPasteCommand",{get:function(){return(this._options.event.ctrlKey||this._options.event.metaKey)&&this.key==="v"},enumerable:false,configurable:true});e.prototype.getCharAt=function(t){if(t===void 0){t=this.position.value}return this.value.charAt(t)};e.prototype.getCharAtBackspacePosition=function(){return this.getCharAt(this.position.value-1)};e.prototype.setChar=function(t,e){if(t===void 0){t=this._options.event.key}if(e===void 0){e=this.position.value}this.value=this.value.substring(0,e)+t+this.value.substring(e+1)};return e}(MaskContext);MaskKeyboardContext.NUMBER_KEYS=["0","1","2","3","4","5","6","7","8","9"];MaskKeyboardContext.NAVIGATION_KEYS=["Home","End","ArrowLeft","Left","ArrowRight","Right","Tab","Enter","Esc","Escape"];var MaskLocaleContext=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}Object.defineProperty(e.prototype,"locale",{get:function(){return this._options.event.locale},enumerable:false,configurable:true});return e}(MaskContext);var MaskMouseContext=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e}(MaskContext);var MaskValueChangedContext=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}Object.defineProperty(e.prototype,"newValue",{get:function(){return this._options.event.newValue},enumerable:false,configurable:true});Object.defineProperty(e.prototype,"oldValue",{get:function(){return this._options.event.oldValue},enumerable:false,configurable:true});Object.defineProperty(e.prototype,"didValueChange",{get:function(){return this.newValue!==this.oldValue},enumerable:false,configurable:true});return e}(MaskContext);var MaskBlock=function(){function t(t){this._isSeparator=false;this._allowedKeys=[];this._locale="de-CH";this._from=t.from||0;this._to=t.to||0;this._isSeparator=t.isSeparator===undefined?false:t.isSeparator;this._mask=t.mask||"_";this._allowedKeys=t.allowedKeys?t.allowedKeys:this.allowedKeys;this._format=t.format}t.prototype.format=function(t){if(this._format){return this._format(t.replace(this.mask,""),this._locale,this.mask)}return t};Object.defineProperty(t.prototype,"isSeparator",{get:function(){return this._isSeparator},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"to",{get:function(){return this._to},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"from",{get:function(){return this._from},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"mask",{get:function(){if(typeof this._mask==="function"){return this._mask(this._locale)}return this._mask},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"allowedKeys",{get:function(){return this._allowedKeys},enumerable:false,configurable:true});t.prototype.onI18nChange=function(t){this._locale=t};t.prototype.getValueOfTheBlock=function(t){return t.slice(this._from,this._to)};t.prototype.isTouched=function(t){var e=this;var a=this.getValueOfTheBlock(t);return!a.split("").every((function(t){return t===e.mask}))};t.prototype.verifyAllowedKeyHits=function(t){if(this.isSeparator&&t===this.mask){return true}else if(this.allowedKeys.indexOf(t)>=0){return true}else{return false}};return t}();var MaskBlockList=function(){function t(t){if(t===void 0){t=[]}this._list=t}Object.defineProperty(t.prototype,"lastPosition",{get:function(){return this._list[this._list.length-1].to},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"list",{get:function(){return this._list},set:function(t){this._list=t},enumerable:false,configurable:true});t.prototype.clone=function(){return new t(__spreadArray([],this._list,true))};t.prototype.findByIndex=function(t,e){if(e===void 0){e=this.list}return e.find((function(e){return e.from<=t&&t<e.to}))};t.prototype.getPlaceholderMask=function(){var t=[];this.list.forEach((function(e){var a=e.to-e.from;for(var n=0;n<a;n++){t.push(e.mask)}}));return t.join("")};t.prototype.getRawValueWithoutMaskByContext=function(t){return this.getRawValueWithoutMask(t.value)};t.prototype.getRawValueWithoutMask=function(t){if(t){var e=[];var a=t.split("");for(var n=0;n<a.length;n++){var i=a[n];var r=this.findByIndex(n);if(r&&!r.isSeparator){e.push(i.replace(r.mask,""))}else{e.push(i)}}e=e.filter((function(t){return t}));var o=this.list.filter((function(t){return t.isSeparator})).length;if(o===e.length){return""}return e.join("")}return""};t.prototype.formatBlocks=function(t,e){var a="".concat(t);for(var n=0;n<this.list.length;n++){var i=this.list[n];if(e!==n&&!i.isSeparator&&i.isTouched(a)){var r=i.getValueOfTheBlock(a);var o=i.format(r);a=a.substring(0,i.from)+o+a.substring(i.to)}}return a};t.prototype.getBlockIndexFromPosition=function(t){var e=this.list.reduce((function(t,e){return t+e.to-e.from}),0);if(t===e){return this.list.length-1}var a=this.list.findIndex((function(e){return e.from<=t&&t<e.to}));return a<0?undefined:Math.min(e,a)};t.prototype.verifyCallOfNextSeparator=function(t,e){if(this.list.length-1>e){var a=this.list[e+1];if(a.isSeparator&&a.mask===t){return true}}return false};return t}();var AbstractMask=function(){function t(t){if(t===void 0){t=[]}this.inputMode="text";this.locale="de-CH";this.blocks=new MaskBlockList(t)}t.prototype.onLocaleChange=function(t,e,a){if(t.target){var n=t.value;var i=n.split("");for(var r=0;r<i.length;r++){var o=i[r];var l=this.blocks.findByIndex(r);var s=a.findByIndex(r);if(l&&s){if(l.isSeparator){i[r]=l.mask}else if(o===s.mask){i[r]=l.mask}}}t.value=i.join("")}};t.prototype.onFocus=function(t){};t.prototype.onBlur=function(t){};t.prototype.onChange=function(t){t.submit("change",this.onParseValue(t.value))};t.prototype.onNavigationDown=function(t,e,a){};t.prototype.onSelectAll=function(t,e,a){};t.prototype.onPaste=function(t,e,a){var n=t.clipboardData||"";t.value=n;t.position.toEnd()};t.prototype.onBlockChange=function(t,e,a){t.setChar();t.position.next();var n=this.blocks.list[a+1];if(t.position.value===e.to&&n&&n.isSeparator){t.position.next()}};t.prototype.onBackspaceDown=function(t,e,a){t.position.previous();if(!e.isSeparator){t.setChar(e.mask);var n=this.blocks.list[a-1];if(t.position.value===e.from&&n&&n.isSeparator){t.position.previous()}}};t.prototype.onDeleteDown=function(t,e,a){t.setChar(e.mask);t.position.next();var n=this.blocks.list[a+1];if(t.position.value===e.to&&n&&n.isSeparator){t.position.next()}};t.prototype.onValueChanged=function(t){var e=this.onFormatValue(t.newValue);var a=t.focused&&e===""?this.blocks.getPlaceholderMask():e;t.value=a;t.position.toEnd()};t.prototype.onParseValue=function(t,e){if(e===void 0){e={allowInvalidValue:false}}if(t){return t.trim()}return t||""};t.prototype.onFormatValue=function(t){if(t){return t.trim()}return t||""};t.prototype.toParsedValue=function(t){return this.onParseValue(t)};t.prototype.toFormattedValue=function(t){return this.onFormatValue(t)};t.prototype.fireI18nChange=function(t){var e=this.blocks.clone();var a="".concat(t.locale);this.locale=t.locale;this.blocks.list.forEach((function(e){return e.onI18nChange(t.locale)}));this.onLocaleChange(t,a,e)};t.prototype.fireValueChanged=function(t){if(t.didValueChange){this.onValueChanged(t)}};t.prototype.firePaste=function(t){var e=this.blocks.getBlockIndexFromPosition(t.position.value);if(e!==undefined){var a=this.blocks.list[e];this.onPaste(t,a,e);this.onChange(t)}};t.prototype.fireClick=function(t){var e=this.blocks.getPlaceholderMask();if(e===t.value){t.position.toStart()}};t.prototype.fireFocus=function(t){if(t.target&&t.isValueEmpty()){this.resetInputValueWithMask(t)}this.onFocus(t)};t.prototype.fireBlur=function(t){if(t.target){if(this.isValueEmptyMask(t)){this.emptyInputValue(t)}else{this.onBlur(t);t.submit("blur",this.onParseValue(t.value,{allowInvalidValue:t.component.allowInvalidValue}))}}};t.prototype.fireKeyDown=function(t){var e=t.isBackspaceKey?Math.max(0,t.position.value-1):t.position.value;var a=this.blocks.getBlockIndexFromPosition(e);if(e>=this.blocks.lastPosition&&!t.isNavigationKey&&!t.isSelectAllCommand){t.preventDefault();t.stopPropagation();return}if(a!==undefined&&!t.position.isRangeSelection){var n=this.blocks.list[a];if(t.isNavigationKey){this.onNavigationDown(t,n,a)}else if(t.isSelectAllCommand){this.onSelectAll(t,n,a)}else if(t.isCopyCommand);else if(t.isPasteCommand);else if(t.isBackspaceKey){t.preventDefault();this.onBackspaceDown(t,n,a)}else if(t.isDeleteKey){t.preventDefault();this.onDeleteDown(t,n,a)}else if(t.isWhiteSpaceKey){t.preventDefault();var i=t.value[t.position.value];if(i==="."){t.stopPropagation();var r=t.value;t.value=r.substring(0,t.position.value)+"_"+r.substring(t.position.value+1)}}else if(n.verifyAllowedKeyHits(t.key)){t.preventDefault();this.onBlockChange(t,n,a)}else if(this.blocks.verifyCallOfNextSeparator(t.key,a)){t.preventDefault();var o=this.blocks.list[a];if(t.position.value>o.from){var l=this.blocks.list[a+1];var r=t.value;var s=n.getValueOfTheBlock(r);var d=n.format(s);t.value=r.substring(0,n.from)+d+r.substring(n.to);t.position.value=l.to}}var u=this.blocks.getBlockIndexFromPosition(t.position.value);if(u&&!t.isBackspaceKey){var c=this.blocks.formatBlocks(t.value,u);var h=t.position.value;t.value=c;t.position.value=h}}else{if(!t.isTabKey){t.preventDefault()}if(t.isBackspaceKey||t.isDeleteKey){this.resetInputValueWithMask(t)}else if(this.blocks.list[0].verifyAllowedKeyHits(t.key)){this.onBlockChange(t,this.blocks.list[0],0)}}};t.prototype.resetInputValueWithMask=function(t){t.value=this.blocks.getPlaceholderMask();t.position.toStart()};t.prototype.isValueEmptyMask=function(t){var e=this.blocks.getPlaceholderMask();return e===t.value};t.prototype.emptyInputValue=function(t){t.value="";t.submit("blur",t.value)};return t}();var DateMask=function(t){__extends(e,t);function e(){var e=t.call(this,[new MaskBlock({from:0,to:2,allowedKeys:__spreadArray([],NUMBER_KEYS,true),format:function(t,e,a){if(Number.isNaN(parseInt(t,10))){return"".concat(a).concat(a)}return t.padStart(2,"0")},mask:function(t){return e.dayMask[t.split("-")[0]]||e.dayMask["de"]}}),new MaskBlock({from:2,to:3,mask:function(t){return dateSeparator(t)},isSeparator:true}),new MaskBlock({from:3,to:5,allowedKeys:__spreadArray([],NUMBER_KEYS,true),format:function(t,e,a){if(Number.isNaN(parseInt(t,10))){return"".concat(a).concat(a)}return t.padStart(2,"0")},mask:function(t){return e.monthMask[t.split("-")[0]]||e.monthMask["de"]}}),new MaskBlock({from:5,to:6,mask:function(t){return dateSeparator(t)},isSeparator:true}),new MaskBlock({from:6,to:10,allowedKeys:__spreadArray([],NUMBER_KEYS,true),mask:function(t){return e.yearMask[t.split("-")[0]]||e.yearMask["de"]}})])||this;e.maxLength=10;e.minLength=10;e.inputMode="decimal";e.dayMask={de:"T",en:"D",fr:"J",it:"G",nl:"D",es:"D",pl:"D",pt:"D",sv:"D",fi:"M"};e.monthMask={de:"M",en:"M",fr:"M",it:"M",nl:"M",es:"M",pl:"M",pt:"M",sv:"M",fi:"K"};e.yearMask={de:"J",en:"Y",fr:"A",it:"A",nl:"J",es:"A",pl:"R",pt:"A",sv:"Å",fi:"V"};return e}e.prototype.onParseValue=function(t,e){if(e===void 0){e={allowInvalidValue:false}}if(t){var a=BalDate.fromAnyFormat(this.blocks.getRawValueWithoutMask(t));if(a.isValid){return a.toISODate()}else if(e&&e.allowInvalidValue){return INVALID_VALUE}}return""};e.prototype.onFormatValue=function(t){if(t){var e=BalDate.fromISO(t);if(e.isValid){return e.toFormat()}}return""};e.prototype.onPaste=function(t,e,a){var n=t.clipboardData||"";var i=BalDate.fromAnyFormat(n);if(i.isValid){t.value=i.toFormat();t.position.toEnd()}};e.prototype.onBlur=function(t){var e=this.blocks.getRawValueWithoutMaskByContext(t);var a=BalDate.fromAnyFormat(e);if(a.isValid){var n=a.toFormat();if(n!==t.value){t.value=n}}else if(t.component.allowInvalidValue){if(e!==t.value){t.value=e}}};return e}(AbstractMask);var MaskComponentAdapter=function(){function t(t){this.mask=t}Object.defineProperty(t.prototype,"attributes",{get:function(){return{inputMode:this.mask.inputMode,maxLength:this.mask.maxLength,minLength:this.mask.minLength,type:"text",autoCapitalize:"off",autoCorrect:"off",spellcheck:false}},enumerable:false,configurable:true});t.prototype.bindComponent=function(t){this.component=t};t.prototype.bindComponentDidLoad=function(){if(this.component&&this.component.nativeInput){this.component.nativeInput.value=this.component.value||""}this.bindValueChanged(this.component.value,undefined)};t.prototype.bindConfigChanged=function(t){var e=this,a=e.component,n=e.mask;var i=new MaskLocaleContext({component:a,mask:n,event:{locale:"".concat(t.language,"-").concat(t.region)}});this.mask.fireI18nChange(i);i.submit()};t.prototype.bindValueChanged=function(t,e){var a=this,n=a.component,i=a.mask;var r=new MaskValueChangedContext({component:n,mask:i,event:{newValue:t,oldValue:e}});this.mask.fireValueChanged(r);r.submit("blur")};t.prototype.bindKeyDown=function(t){if(this.isComponentAccessible){var e=this,a=e.component,n=e.mask;var i=new MaskKeyboardContext({event:t,component:a,mask:n});this.mask.fireKeyDown(i);var r=t.key==="Tab";i.submit(r?"tab":"input");a.balKeyPress.emit(t)}};t.prototype.bindFocus=function(t){if(this.isComponentAccessible){var e=this,a=e.component,n=e.mask;a.focused=true;var i=new MaskFocusContext({event:t,component:a,mask:n});this.mask.fireFocus(i);i.submit();a.balFocus.emit(t)}};t.prototype.bindBlur=function(t){if(this.isComponentAccessible){var e=this,a=e.component,n=e.mask;a.focused=false;var i=new MaskFocusContext({event:t,component:a,mask:n});this.mask.fireBlur(i);i.submit("blur");a.balBlur.emit(t)}};t.prototype.bindPaste=function(t){if(this.isComponentAccessible){var e=this,a=e.component,n=e.mask;var i=new MaskClipboardContext({event:t,component:a,mask:n});this.mask.firePaste(i);i.submit()}};t.prototype.bindFormReset=function(t){var e=this;var a=t.target;if(a&&(a===this.component.el||a.contains(this.component.el))){this.component.value=this.component.initialValue;this.component.inputValue=this.component.initialValue;clearTimeout(this.resetHandlerTimer);this.resetHandlerTimer=setTimeout((function(){if(e.component.nativeInput){e.component.nativeInput.value=e.mask.toFormattedValue(e.component.value||"")}}))}};t.prototype.bindClick=function(t){if(this.isComponentAccessible){var e=this,a=e.component,n=e.mask;var i=new MaskMouseContext({event:t,component:a,mask:n});this.mask.fireClick(i);i.submit()}};t.prototype.bindHostClick=function(t){if(!this.isComponentAccessible){t.preventDefault();t.stopPropagation()}};t.prototype.bindGlobalClick=function(t){if(!this.isComponentAccessible){if(t.target&&t.target===this.component.el){t.preventDefault();t.stopPropagation()}}};Object.defineProperty(t.prototype,"isComponentAccessible",{get:function(){return!this.component.disabled&&!this.component.readonly},enumerable:false,configurable:true});return t}();var balInputDateCss=".bal-input-date{display:block;width:100%;-ms-flex:1;flex:1}.bal-input-date input:not(:-moz-placeholder-shown){letter-spacing:.4px}.bal-input-date input:not(:-ms-input-placeholder){letter-spacing:.4px}.bal-input-date input:not(:placeholder-shown){letter-spacing:.4px}.bal-input-date__native{position:absolute !important;left:0;top:0;margin:0;padding:0;opacity:0;outline:0;border:none;width:1px;height:1px;clip:rect(1px, 1px, 1px, 1px);overflow:hidden}";var InputDate=function(){function t(t){registerInstance(this,t);this.balKeyPress=createEvent(this,"balKeyPress");this.balChange=createEvent(this,"balChange");this.balInput=createEvent(this,"balInput");this.balBlur=createEvent(this,"balBlur");this.balFocus=createEvent(this,"balFocus");this.inputId="bal-i-date-".concat(inputDateIds++);this.inheritedAttributes={};this.maskAdapter=new MaskComponentAdapter(new DateMask);this.focused=false;this.isGrouped=false;this.ariaForm=defaultBalAriaForm;this.name=this.inputId;this.invalid=false;this.required=false;this.disabled=false;this.readonly=false;this.clickable=false;this.autocomplete="off";this.hasIconRight=false;this.value=undefined;this.inputValue=this.value;this.initialValue=this.value||"";this.autoInvalidOff=false;this.allowInvalidValue=false}t.prototype.createLogger=function(t){this.log=t};t.prototype.valueChanged=function(t,e){this.maskAdapter.bindValueChanged(t,e)};t.prototype.connectedCallback=function(){this.maskAdapter.bindComponent(this);this.isGrouped=hasParent("bal-input-group",this.el)};t.prototype.componentDidLoad=function(){this.maskAdapter.bindComponentDidLoad()};t.prototype.componentWillRender=function(){this.inheritedAttributes=inheritAttributes(this.el,["aria-label","tabindex","title","data-hj-allow"])};t.prototype.configChanged=function(t){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){this.maskAdapter.bindConfigChanged(t);return[2]}))}))};t.prototype.resetHandler=function(t){this.maskAdapter.bindFormReset(t)};t.prototype.listenOnClick=function(t){this.maskAdapter.bindGlobalClick(t)};t.prototype.setFocus=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){inputSetFocus(this);return[2]}))}))};t.prototype.setBlur=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){inputSetBlur(this);return[2]}))}))};t.prototype.getInputElement=function(){return Promise.resolve(this.nativeInput)};t.prototype.setAriaForm=function(t){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){this.ariaForm=Object.assign({},t);return[2]}))}))};t.prototype.render=function(){var t=this;var e=BEM.block("input-date");var a=e.element("native");return h(Host,{key:"3c71adc69c5270029c588885037338aee6dfc85f",onClick:function(e){return t.maskAdapter.bindHostClick(e)},class:Object.assign({},e.class())},h("input",Object.assign({key:"56c3f39f98b9dadb6b18f8bfea4c172e7bc0e607",class:{input:true,"is-disabled":this.disabled||this.readonly,"is-danger":this.invalid,"is-clickable":this.clickable&&!(this.disabled||this.readonly),"bal-focusable":!this.disabled,"has-icon-right":this.hasIconRight},"data-testid":"bal-date-input",ref:function(e){return t.nativeInput=e},id:this.ariaForm.controlId||this.inputId,"aria-labelledby":this.ariaForm.labelId,"aria-describedby":this.ariaForm.messageId,"aria-invalid":this.invalid===true?"true":"false","aria-disabled":ariaBooleanToString(this.disabled),required:this.required,disabled:this.disabled,readonly:this.readonly,autoComplete:this.autocomplete},this.maskAdapter.attributes,this.inheritedAttributes,{placeholder:this.placeholder,value:this.inputValue,onKeyDown:function(e){return t.maskAdapter.bindKeyDown(e)},onClick:function(e){return t.maskAdapter.bindClick(e)},onFocus:function(e){return t.maskAdapter.bindFocus(e)},onBlur:function(e){return t.maskAdapter.bindBlur(e)},onPaste:function(e){return t.maskAdapter.bindPaste(e)}})),h("input",{key:"dae67450389be6169c8257a0b1eaf877fb81e66b",type:"date",class:Object.assign({},a.class()),name:this.name,min:this.min,max:this.max,value:this.value,tabindex:-1,"aria-hidden":"true"}))};Object.defineProperty(t.prototype,"el",{get:function(){return getElement(this)},enumerable:false,configurable:true});Object.defineProperty(t,"watchers",{get:function(){return{value:["valueChanged"]}},enumerable:false,configurable:true});return t}();__decorate([Logger("bal-input-date"),__metadata("design:type",Function),__metadata("design:paramtypes",[Function]),__metadata("design:returntype",void 0)],InputDate.prototype,"createLogger",null);__decorate([ListenToConfig(),__metadata("design:type",Function),__metadata("design:paramtypes",[Object]),__metadata("design:returntype",Promise)],InputDate.prototype,"configChanged",null);var inputDateIds=0;InputDate.style=balInputDateCss;export{DateCalendar as bal_date_calendar,InputDate as bal_input_date};
@@ -1 +1 @@
1
- import{__awaiter,__generator}from"tslib";import{r as registerInstance,c as createEvent,h,H as Host,g as getElement}from"./index-BdVwMG9u.js";import{_ as __decorate,a as __metadata}from"./tslib.es6-dfXERft2.js";import{b as isEscapeKey}from"./index.esm-Btc0yydR.js";import{a as ariaBooleanToString}from"./aria-DBsOHTWj.js";import{i as inheritAttributes}from"./attributes-C4sZQbkT.js";import{B as BEM}from"./bem-ByiN-QjD.js";import{b as balBrowser}from"./browser-B1u-Mq75.js";import{b as balFloatingUi}from"./floating-ui-Bx04QSXP.js";import{F as FOCUS_KEYS}from"./focus-visible-DqCbGYzv.js";import{d as defaultBalAriaForm}from"./form-FCLKfv6B.js";import{s as stopEventBubbling}from"./form-input-DYvzaBlM.js";import{r as rIC,n as debounceEvent,o as addEventListener,p as removeEventListener,b as waitAfterIdleCallback}from"./helpers-BNj87EbG.js";import{L as Logger}from"./log-CwssmmaV.js";import{B as BalDate,i as i18nBalDate}from"./date-W0XtD641.js";import{d as defaultConfig}from"./config.default-I6QXKbhg.js";import{i as isSpaceKey}from"./keyboard.helpers-BERg8BNc.js";import{L as ListenToConfig}from"./config.decorator-3bfyZ-0Y.js";import"./index-zWZxKBfo.js";import"./_commonjsHelpers-BFTU3MAI.js";import"./index-B4k_dH6V.js";import"./index-BU7FUSdu.js";import"./index-D6JOtC1P.js";import"./config.utils-B7jugjyM.js";var balDateCss=":root{--bal-date-popup-z-index:var(--bal-z-index-tooltip);--bal-date-popup-shadow:var(--bal-shadow-normal);--bal-date-popup-radius:var(--bal-radius-normal)}:root{--bal-z-index-tooltip:1300}.bal-date{display:block;font-family:var(--bal-font-family-text);width:100%}.bal-date__icon--clickable{cursor:pointer}.bal-date__popup{display:none;width:-webkit-max-content;width:-moz-max-content;width:max-content;position:absolute;top:0;left:0;z-index:var(--bal-date-popup-z-index);-webkit-box-shadow:var(--bal-date-popup-shadow);box-shadow:var(--bal-date-popup-shadow);border-radius:var(--bal-date-popup-radius)}.bal-date__popup--visible{display:block}";var Date=function(){function t(t){var e=this;registerInstance(this,t);this.balInput=createEvent(this,"balInput");this.balChange=createEvent(this,"balChange");this.balWillAnimate=createEvent(this,"balWillAnimate");this.balDidAnimate=createEvent(this,"balDidAnimate");this.balBlur=createEvent(this,"balBlur");this.balFocus=createEvent(this,"balFocus");this.balInputClick=createEvent(this,"balInputClick");this.balIconClick=createEvent(this,"balIconClick");this.inputId="bal-da-".concat(dateIds++);this.inheritedAttributes={};this.isKeyboardMode=false;this.hasFocus=false;this.isExpanded=false;this.language=defaultConfig.language;this.ariaForm=defaultBalAriaForm;this.name=this.inputId;this.invalid=false;this.required=false;this.disabled=false;this.readonly=false;this.freeSolo=false;this.triggerIcon=false;this.closeOnSelect=true;this.autocomplete="off";this.value=undefined;this.allowedDates=undefined;this.allowInvalidValue=false;this.debounce=0;this.autoInvalidOff=false;this.hasConnected=false;this.handleKeydown=function(t){e.isKeyboardMode=FOCUS_KEYS.includes(t.key)};this.handlePointerDown=function(){e.isKeyboardMode=false};this.handleOutsideClick=function(t){if(e.isExpanded){if(!e.el.contains(t.target)){e.isExpanded=false;e.hasFocus=false;rIC((function(){return e.balBlur.emit(t)}))}}};this.handleFocus=function(t){stopEventBubbling(t);e.hasFocus=true;e.balFocus.emit(t.detail)};this.handleBlur=function(t){stopEventBubbling(t);if(!e.isExpanded){e.hasFocus=false;rIC((function(){return e.balBlur.emit(t.detail)}))}};this.onIconClick=function(t){return __awaiter(e,void 0,void 0,(function(){return __generator(this,(function(t){switch(t.label){case 0:if(!this.triggerIcon)return[3,2];return[4,this.toggle()];case 1:t.sent();return[3,4];case 2:return[4,this.open()];case 3:t.sent();t.label=4;case 4:return[2]}}))}))};this.onInputClick=function(t){return __awaiter(e,void 0,void 0,(function(){return __generator(this,(function(t){switch(t.label){case 0:if(!!this.triggerIcon)return[3,2];return[4,this.open()];case 1:t.sent();t.label=2;case 2:return[2]}}))}))};this.onCalendarChange=function(t){stopEventBubbling(t);e.value=t.detail;e.balChange.emit(e.value);if(e.closeOnSelect){e.close();e.hasFocus=false;rIC((function(){return e.balBlur.emit()}))}};this.onInputInput=function(t){stopEventBubbling(t);e.balInput.emit(t.detail);if(t.detail){var i=BalDate.fromAnyFormat(t.detail);if(i.isValid){e.calendarValue=i.toISODate()}}};this.onInputChange=function(t){stopEventBubbling(t);e.value=t.detail;e.balChange.emit(e.value)};this.onKeyPress=function(t){return __awaiter(e,[t],void 0,(function(t){var e=t.detail;return __generator(this,(function(t){switch(t.label){case 0:if(!(e&&e.key))return[3,5];if(!this.isExpanded)return[3,3];if(!(e.key==="Tab"||isEscapeKey(e)||isSpaceKey(e)))return[3,2];return[4,this.close()];case 1:t.sent();t.label=2;case 2:return[3,5];case 3:if(!isSpaceKey(e))return[3,5];return[4,this.open()];case 4:t.sent();t.label=5;case 5:return[2]}}))}))}}t.prototype.createLogger=function(t){this.log=t};t.prototype.valueChanged=function(){this.calendarValue=this.value};t.prototype.debounceChanged=function(){this.balChange=debounceEvent(this.balChange,this.debounce)};t.prototype.connectedCallback=function(){if(balBrowser.hasDocument){addEventListener(document,"keydown",this.handleKeydown);addEventListener(document,"touchstart",this.handlePointerDown);addEventListener(document,"mousedown",this.handlePointerDown);addEventListener(document,"click",this.handleOutsideClick)}this.hasConnected=true;this.valueChanged()};t.prototype.disconnectedCallback=function(){if(balBrowser.hasDocument){removeEventListener(document,"keydown",this.handleKeydown);removeEventListener(document,"touchstart",this.handlePointerDown);removeEventListener(document,"mousedown",this.handlePointerDown);removeEventListener(document,"click",this.handleOutsideClick)}};t.prototype.componentWillLoad=function(){this.inheritedAttributes=inheritAttributes(this.el,["aria-label","tabindex","title","data-hj-allow"])};t.prototype.configChanged=function(t){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){this.language=t.language;return[2]}))}))};t.prototype.open=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){return[2,this.expand()]}))}))};t.prototype.close=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){return[2,this.collapse()]}))}))};t.prototype.toggle=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){if(this.isExpanded){return[2,this.collapse()]}else{return[2,this.expand()]}return[2]}))}))};t.prototype.select=function(t){return __awaiter(this,void 0,void 0,(function(){var e;return __generator(this,(function(i){e=BalDate.fromISO(t);if(e.isValid){this.value=e.toISODate();this.calendarValue=this.value}return[2]}))}))};t.prototype.setFocus=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){switch(t.label){case 0:if(!(this.inputEl&&!this.disabled&&!this.readonly))return[3,2];return[4,waitAfterIdleCallback()];case 1:t.sent();this.inputEl.focus();t.label=2;case 2:return[2]}}))}))};t.prototype.setBlur=function(){return __awaiter(this,void 0,void 0,(function(){var t;return __generator(this,(function(e){switch(e.label){case 0:if(!(this.inputEl&&!this.disabled&&!this.readonly))return[3,2];return[4,waitAfterIdleCallback()];case 1:e.sent();(t=this.inputEl)===null||t===void 0?void 0:t.setBlur();e.label=2;case 2:return[2]}}))}))};t.prototype.getInputElement=function(){return __awaiter(this,void 0,void 0,(function(){var t;return __generator(this,(function(e){return[2,(t=this.inputEl)===null||t===void 0?void 0:t.getInputElement()]}))}))};t.prototype.setAriaForm=function(t){return __awaiter(this,void 0,void 0,(function(){var e;return __generator(this,(function(i){this.ariaForm=Object.assign({},t);(e=this.inputEl)===null||e===void 0?void 0:e.setAriaForm(t);return[2]}))}))};t.prototype.expand=function(){return __awaiter(this,void 0,void 0,(function(){var t;var e=this;return __generator(this,(function(i){switch(i.label){case 0:if(!(this.referenceEl&&this.floatingEl))return[3,2];return[4,balFloatingUi.load()];case 1:t=i.sent();this.balWillAnimate.emit();this.isExpanded=true;this.popupCleanup=t.autoUpdate(this.referenceEl,this.floatingEl,(function(){e.updatePosition(e.referenceEl,e.floatingEl)}));i.label=2;case 2:return[2,this.isExpanded]}}))}))};t.prototype.collapse=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){if(this.floatingEl){this.balWillAnimate.emit();this.isExpanded=false;if(this.popupCleanup){this.popupCleanup()}this.balDidAnimate.emit()}return[2,this.isExpanded]}))}))};t.prototype.updatePosition=function(t,e){return __awaiter(this,void 0,void 0,(function(){var i;var n=this;return __generator(this,(function(a){switch(a.label){case 0:return[4,balFloatingUi.load()];case 1:i=a.sent();i.computePosition(t,e,{placement:"bottom-start",middleware:[i.offset(4),i.flip({crossAxis:false})]}).then((function(t){var i=t.x,a=t.y;Object.assign(e.style,{left:"".concat(i,"px"),top:"".concat(a,"px")});n.balDidAnimate.emit()}));return[2]}}))}))};t.prototype.render=function(){var t=this;var e=BEM.block("date");var i=e.element("icon");var n=e.element("popup");return h(Host,{key:"66accfbf681e12eefdc6e61912fe5736f75c4501",id:this.inputId,class:Object.assign({},e.class())},h("bal-input-group",{key:"4e816b701215387a395c6a73da929609302d0c8f",invalid:this.invalid,readonly:this.readonly,disabled:this.disabled,ref:function(e){return t.referenceEl=e}},h("bal-input-date",Object.assign({key:"188d50af76d1625bafb08b2d8ad4d13756bc4468",name:this.name,required:this.required,placeholder:this.placeholder,value:this.value,min:this.min,max:this.max,invalid:this.invalid,readonly:this.readonly,disabled:this.disabled,allowInvalidValue:this.allowInvalidValue,autocomplete:this.autocomplete,onClick:this.onInputClick,onBalInput:this.onInputInput,onBalChange:this.onInputChange,onBalFocus:function(e){return t.handleFocus(e)},onBalBlur:function(e){return t.handleBlur(e)},onBalKeyPress:this.onKeyPress,ref:function(e){return t.inputEl=e}},this.inheritedAttributes)),!this.freeSolo?h("bal-icon",{name:"date",role:"button",tabindex:-1,class:Object.assign(Object.assign({},i.class()),i.modifier("clickable").class(!this.disabled&&!this.readonly)),"is-right":true,color:this.disabled||this.readonly?"grey":this.invalid?"danger":"primary",onClick:this.onIconClick,"aria-label":i18nBalDate[this.language].toggleDatepicker,"aria-haspopup":"true","aria-expanded":ariaBooleanToString(this.isExpanded)}):""),h("div",{key:"8eaee6ea09c2099057a2ad0165d63f70154d4095",role:"dialog",class:Object.assign(Object.assign({},n.class()),n.modifier("visible").class(this.isExpanded)),ref:function(e){return t.floatingEl=e},"aria-hidden":"".concat(this.isExpanded!==true),"aria-presented":"".concat(this.isExpanded===true)},h("bal-date-calendar",{key:"16f6680967612f55e9f8259b780a02e61c830090",value:this.calendarValue,min:this.min,max:this.max,minYearProp:this.minYearProp,maxYearProp:this.maxYearProp,defaultDate:this.defaultDate,allowedDates:this.allowedDates,onBalChange:this.onCalendarChange})))};Object.defineProperty(t.prototype,"el",{get:function(){return getElement(this)},enumerable:false,configurable:true});Object.defineProperty(t,"watchers",{get:function(){return{value:["valueChanged"],debounce:["debounceChanged"]}},enumerable:false,configurable:true});return t}();__decorate([Logger("bal-date"),__metadata("design:type",Function),__metadata("design:paramtypes",[Function]),__metadata("design:returntype",void 0)],Date.prototype,"createLogger",null);__decorate([ListenToConfig(),__metadata("design:type",Function),__metadata("design:paramtypes",[Object]),__metadata("design:returntype",Promise)],Date.prototype,"configChanged",null);var dateIds=0;Date.style=balDateCss;export{Date as bal_date};
1
+ import{__awaiter,__generator}from"tslib";import{r as registerInstance,c as createEvent,h,H as Host,g as getElement}from"./index-BdVwMG9u.js";import{_ as __decorate,a as __metadata}from"./tslib.es6-dfXERft2.js";import{b as isEscapeKey}from"./index.esm-Btc0yydR.js";import{a as ariaBooleanToString}from"./aria-DBsOHTWj.js";import{i as inheritAttributes}from"./attributes-C4sZQbkT.js";import{B as BEM}from"./bem-ByiN-QjD.js";import{b as balBrowser}from"./browser-B1u-Mq75.js";import{b as balFloatingUi}from"./floating-ui-Bx04QSXP.js";import{F as FOCUS_KEYS}from"./focus-visible-DqCbGYzv.js";import{d as defaultBalAriaForm}from"./form-FCLKfv6B.js";import{s as stopEventBubbling}from"./form-input-DYvzaBlM.js";import{r as rIC,n as debounceEvent,o as addEventListener,p as removeEventListener,b as waitAfterIdleCallback}from"./helpers-BNj87EbG.js";import{L as Logger}from"./log-CwssmmaV.js";import{B as BalDate,i as i18nBalDate}from"./date-W0XtD641.js";import{d as defaultConfig}from"./config.default-RE8-gLMQ.js";import{i as isSpaceKey}from"./keyboard.helpers-BERg8BNc.js";import{L as ListenToConfig}from"./config.decorator-3bfyZ-0Y.js";import"./index-zWZxKBfo.js";import"./_commonjsHelpers-BFTU3MAI.js";import"./index-B4k_dH6V.js";import"./index-BU7FUSdu.js";import"./index-D6JOtC1P.js";import"./config.utils-B7jugjyM.js";var balDateCss=":root{--bal-date-popup-z-index:var(--bal-z-index-tooltip);--bal-date-popup-shadow:var(--bal-shadow-normal);--bal-date-popup-radius:var(--bal-radius-normal)}:root{--bal-z-index-tooltip:1300}.bal-date{display:block;font-family:var(--bal-font-family-text);width:100%}.bal-date__icon--clickable{cursor:pointer}.bal-date__popup{display:none;width:-webkit-max-content;width:-moz-max-content;width:max-content;position:absolute;top:0;left:0;z-index:var(--bal-date-popup-z-index);-webkit-box-shadow:var(--bal-date-popup-shadow);box-shadow:var(--bal-date-popup-shadow);border-radius:var(--bal-date-popup-radius)}.bal-date__popup--visible{display:block}";var Date=function(){function t(t){var e=this;registerInstance(this,t);this.balInput=createEvent(this,"balInput");this.balChange=createEvent(this,"balChange");this.balWillAnimate=createEvent(this,"balWillAnimate");this.balDidAnimate=createEvent(this,"balDidAnimate");this.balBlur=createEvent(this,"balBlur");this.balFocus=createEvent(this,"balFocus");this.balInputClick=createEvent(this,"balInputClick");this.balIconClick=createEvent(this,"balIconClick");this.inputId="bal-da-".concat(dateIds++);this.inheritedAttributes={};this.isKeyboardMode=false;this.hasFocus=false;this.isExpanded=false;this.language=defaultConfig.language;this.ariaForm=defaultBalAriaForm;this.name=this.inputId;this.invalid=false;this.required=false;this.disabled=false;this.readonly=false;this.freeSolo=false;this.triggerIcon=false;this.closeOnSelect=true;this.autocomplete="off";this.value=undefined;this.allowedDates=undefined;this.allowInvalidValue=false;this.debounce=0;this.autoInvalidOff=false;this.hasConnected=false;this.handleKeydown=function(t){e.isKeyboardMode=FOCUS_KEYS.includes(t.key)};this.handlePointerDown=function(){e.isKeyboardMode=false};this.handleOutsideClick=function(t){if(e.isExpanded){if(!e.el.contains(t.target)){e.isExpanded=false;e.hasFocus=false;rIC((function(){return e.balBlur.emit(t)}))}}};this.handleFocus=function(t){stopEventBubbling(t);e.hasFocus=true;e.balFocus.emit(t.detail)};this.handleBlur=function(t){stopEventBubbling(t);if(!e.isExpanded){e.hasFocus=false;rIC((function(){return e.balBlur.emit(t.detail)}))}};this.onIconClick=function(t){return __awaiter(e,void 0,void 0,(function(){return __generator(this,(function(t){switch(t.label){case 0:if(!this.triggerIcon)return[3,2];return[4,this.toggle()];case 1:t.sent();return[3,4];case 2:return[4,this.open()];case 3:t.sent();t.label=4;case 4:return[2]}}))}))};this.onInputClick=function(t){return __awaiter(e,void 0,void 0,(function(){return __generator(this,(function(t){switch(t.label){case 0:if(!!this.triggerIcon)return[3,2];return[4,this.open()];case 1:t.sent();t.label=2;case 2:return[2]}}))}))};this.onCalendarChange=function(t){stopEventBubbling(t);e.value=t.detail;e.balChange.emit(e.value);if(e.closeOnSelect){e.close();e.hasFocus=false;rIC((function(){return e.balBlur.emit()}))}};this.onInputInput=function(t){stopEventBubbling(t);e.balInput.emit(t.detail);if(t.detail){var i=BalDate.fromAnyFormat(t.detail);if(i.isValid){e.calendarValue=i.toISODate()}}};this.onInputChange=function(t){stopEventBubbling(t);e.value=t.detail;e.balChange.emit(e.value)};this.onKeyPress=function(t){return __awaiter(e,[t],void 0,(function(t){var e=t.detail;return __generator(this,(function(t){switch(t.label){case 0:if(!(e&&e.key))return[3,5];if(!this.isExpanded)return[3,3];if(!(e.key==="Tab"||isEscapeKey(e)||isSpaceKey(e)))return[3,2];return[4,this.close()];case 1:t.sent();t.label=2;case 2:return[3,5];case 3:if(!isSpaceKey(e))return[3,5];return[4,this.open()];case 4:t.sent();t.label=5;case 5:return[2]}}))}))}}t.prototype.createLogger=function(t){this.log=t};t.prototype.valueChanged=function(){this.calendarValue=this.value};t.prototype.debounceChanged=function(){this.balChange=debounceEvent(this.balChange,this.debounce)};t.prototype.connectedCallback=function(){if(balBrowser.hasDocument){addEventListener(document,"keydown",this.handleKeydown);addEventListener(document,"touchstart",this.handlePointerDown);addEventListener(document,"mousedown",this.handlePointerDown);addEventListener(document,"click",this.handleOutsideClick)}this.hasConnected=true;this.valueChanged()};t.prototype.disconnectedCallback=function(){if(balBrowser.hasDocument){removeEventListener(document,"keydown",this.handleKeydown);removeEventListener(document,"touchstart",this.handlePointerDown);removeEventListener(document,"mousedown",this.handlePointerDown);removeEventListener(document,"click",this.handleOutsideClick)}};t.prototype.componentWillLoad=function(){this.inheritedAttributes=inheritAttributes(this.el,["aria-label","tabindex","title","data-hj-allow"])};t.prototype.configChanged=function(t){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){this.language=t.language;return[2]}))}))};t.prototype.open=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){return[2,this.expand()]}))}))};t.prototype.close=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){return[2,this.collapse()]}))}))};t.prototype.toggle=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){if(this.isExpanded){return[2,this.collapse()]}else{return[2,this.expand()]}return[2]}))}))};t.prototype.select=function(t){return __awaiter(this,void 0,void 0,(function(){var e;return __generator(this,(function(i){e=BalDate.fromISO(t);if(e.isValid){this.value=e.toISODate();this.calendarValue=this.value}return[2]}))}))};t.prototype.setFocus=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){switch(t.label){case 0:if(!(this.inputEl&&!this.disabled&&!this.readonly))return[3,2];return[4,waitAfterIdleCallback()];case 1:t.sent();this.inputEl.focus();t.label=2;case 2:return[2]}}))}))};t.prototype.setBlur=function(){return __awaiter(this,void 0,void 0,(function(){var t;return __generator(this,(function(e){switch(e.label){case 0:if(!(this.inputEl&&!this.disabled&&!this.readonly))return[3,2];return[4,waitAfterIdleCallback()];case 1:e.sent();(t=this.inputEl)===null||t===void 0?void 0:t.setBlur();e.label=2;case 2:return[2]}}))}))};t.prototype.getInputElement=function(){return __awaiter(this,void 0,void 0,(function(){var t;return __generator(this,(function(e){return[2,(t=this.inputEl)===null||t===void 0?void 0:t.getInputElement()]}))}))};t.prototype.setAriaForm=function(t){return __awaiter(this,void 0,void 0,(function(){var e;return __generator(this,(function(i){this.ariaForm=Object.assign({},t);(e=this.inputEl)===null||e===void 0?void 0:e.setAriaForm(t);return[2]}))}))};t.prototype.expand=function(){return __awaiter(this,void 0,void 0,(function(){var t;var e=this;return __generator(this,(function(i){switch(i.label){case 0:if(!(this.referenceEl&&this.floatingEl))return[3,2];return[4,balFloatingUi.load()];case 1:t=i.sent();this.balWillAnimate.emit();this.isExpanded=true;this.popupCleanup=t.autoUpdate(this.referenceEl,this.floatingEl,(function(){e.updatePosition(e.referenceEl,e.floatingEl)}));i.label=2;case 2:return[2,this.isExpanded]}}))}))};t.prototype.collapse=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){if(this.floatingEl){this.balWillAnimate.emit();this.isExpanded=false;if(this.popupCleanup){this.popupCleanup()}this.balDidAnimate.emit()}return[2,this.isExpanded]}))}))};t.prototype.updatePosition=function(t,e){return __awaiter(this,void 0,void 0,(function(){var i;var n=this;return __generator(this,(function(a){switch(a.label){case 0:return[4,balFloatingUi.load()];case 1:i=a.sent();i.computePosition(t,e,{placement:"bottom-start",middleware:[i.offset(4),i.flip({crossAxis:false})]}).then((function(t){var i=t.x,a=t.y;Object.assign(e.style,{left:"".concat(i,"px"),top:"".concat(a,"px")});n.balDidAnimate.emit()}));return[2]}}))}))};t.prototype.render=function(){var t=this;var e=BEM.block("date");var i=e.element("icon");var n=e.element("popup");return h(Host,{key:"66accfbf681e12eefdc6e61912fe5736f75c4501",id:this.inputId,class:Object.assign({},e.class())},h("bal-input-group",{key:"4e816b701215387a395c6a73da929609302d0c8f",invalid:this.invalid,readonly:this.readonly,disabled:this.disabled,ref:function(e){return t.referenceEl=e}},h("bal-input-date",Object.assign({key:"188d50af76d1625bafb08b2d8ad4d13756bc4468",name:this.name,required:this.required,placeholder:this.placeholder,value:this.value,min:this.min,max:this.max,invalid:this.invalid,readonly:this.readonly,disabled:this.disabled,allowInvalidValue:this.allowInvalidValue,autocomplete:this.autocomplete,onClick:this.onInputClick,onBalInput:this.onInputInput,onBalChange:this.onInputChange,onBalFocus:function(e){return t.handleFocus(e)},onBalBlur:function(e){return t.handleBlur(e)},onBalKeyPress:this.onKeyPress,ref:function(e){return t.inputEl=e}},this.inheritedAttributes)),!this.freeSolo?h("bal-icon",{name:"date",role:"button",tabindex:-1,class:Object.assign(Object.assign({},i.class()),i.modifier("clickable").class(!this.disabled&&!this.readonly)),"is-right":true,color:this.disabled||this.readonly?"grey":this.invalid?"danger":"primary",onClick:this.onIconClick,"aria-label":i18nBalDate[this.language].toggleDatepicker,"aria-haspopup":"true","aria-expanded":ariaBooleanToString(this.isExpanded)}):""),h("div",{key:"8eaee6ea09c2099057a2ad0165d63f70154d4095",role:"dialog",class:Object.assign(Object.assign({},n.class()),n.modifier("visible").class(this.isExpanded)),ref:function(e){return t.floatingEl=e},"aria-hidden":"".concat(this.isExpanded!==true),"aria-presented":"".concat(this.isExpanded===true)},h("bal-date-calendar",{key:"16f6680967612f55e9f8259b780a02e61c830090",value:this.calendarValue,min:this.min,max:this.max,minYearProp:this.minYearProp,maxYearProp:this.maxYearProp,defaultDate:this.defaultDate,allowedDates:this.allowedDates,onBalChange:this.onCalendarChange})))};Object.defineProperty(t.prototype,"el",{get:function(){return getElement(this)},enumerable:false,configurable:true});Object.defineProperty(t,"watchers",{get:function(){return{value:["valueChanged"],debounce:["debounceChanged"]}},enumerable:false,configurable:true});return t}();__decorate([Logger("bal-date"),__metadata("design:type",Function),__metadata("design:paramtypes",[Function]),__metadata("design:returntype",void 0)],Date.prototype,"createLogger",null);__decorate([ListenToConfig(),__metadata("design:type",Function),__metadata("design:paramtypes",[Object]),__metadata("design:returntype",Promise)],Date.prototype,"configChanged",null);var dateIds=0;Date.style=balDateCss;export{Date as bal_date};