@ionic/core 8.7.19-nightly.20260304 → 8.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (587) hide show
  1. package/components/index.d.ts +2 -0
  2. package/components/index.js +1 -114
  3. package/components/ion-accordion-group.js +1 -268
  4. package/components/ion-accordion.js +1 -456
  5. package/components/ion-action-sheet.js +1 -6
  6. package/components/ion-alert.js +1 -6
  7. package/components/ion-app.js +1 -132
  8. package/components/ion-avatar.js +1 -41
  9. package/components/ion-back-button.js +1 -130
  10. package/components/ion-backdrop.js +1 -6
  11. package/components/ion-badge.js +1 -47
  12. package/components/ion-breadcrumb.js +1 -137
  13. package/components/ion-breadcrumbs.js +1 -164
  14. package/components/ion-button.js +1 -6
  15. package/components/ion-buttons.js +1 -6
  16. package/components/ion-card-content.js +1 -45
  17. package/components/ion-card-header.js +1 -56
  18. package/components/ion-card-subtitle.js +1 -48
  19. package/components/ion-card-title.js +1 -48
  20. package/components/ion-card.js +1 -107
  21. package/components/ion-checkbox.js +1 -6
  22. package/components/ion-chip.js +1 -66
  23. package/components/ion-col.js +1 -163
  24. package/components/ion-content.js +1 -6
  25. package/components/ion-datetime-button.js +1 -383
  26. package/components/ion-datetime.js +1 -2047
  27. package/components/ion-fab-button.js +1 -151
  28. package/components/ion-fab-list.js +1 -73
  29. package/components/ion-fab.js +1 -101
  30. package/components/ion-footer.js +1 -179
  31. package/components/ion-grid.js +1 -46
  32. package/components/ion-header.js +1 -6
  33. package/components/ion-icon.js +1 -6
  34. package/components/ion-img.js +1 -133
  35. package/components/ion-infinite-scroll-content.js +1 -69
  36. package/components/ion-infinite-scroll.js +1 -236
  37. package/components/ion-input-otp.js +1 -682
  38. package/components/ion-input-password-toggle.js +1 -128
  39. package/components/ion-input.js +1 -646
  40. package/components/ion-item-divider.js +1 -59
  41. package/components/ion-item-group.js +1 -46
  42. package/components/ion-item-option.js +1 -91
  43. package/components/ion-item-options.js +1 -73
  44. package/components/ion-item-sliding.js +1 -457
  45. package/components/ion-item.js +1 -6
  46. package/components/ion-label.js +1 -6
  47. package/components/ion-list-header.js +1 -6
  48. package/components/ion-list.js +1 -6
  49. package/components/ion-loading.js +1 -343
  50. package/components/ion-menu-button.js +1 -109
  51. package/components/ion-menu-toggle.js +1 -64
  52. package/components/ion-menu.js +1 -741
  53. package/components/ion-modal.js +1 -6
  54. package/components/ion-nav-link.js +1 -64
  55. package/components/ion-nav.js +1 -951
  56. package/components/ion-note.js +1 -47
  57. package/components/ion-picker-column-option.js +1 -6
  58. package/components/ion-picker-column.js +1 -6
  59. package/components/ion-picker-legacy-column.js +1 -6
  60. package/components/ion-picker-legacy.js +1 -342
  61. package/components/ion-picker.js +1 -6
  62. package/components/ion-popover.js +1 -6
  63. package/components/ion-progress-bar.js +1 -100
  64. package/components/ion-radio-group.js +1 -6
  65. package/components/ion-radio.js +1 -6
  66. package/components/ion-range.js +1 -844
  67. package/components/ion-refresher-content.js +1 -88
  68. package/components/ion-refresher.js +1 -750
  69. package/components/ion-reorder-group.js +1 -322
  70. package/components/ion-reorder.js +1 -60
  71. package/components/ion-ripple-effect.js +1 -6
  72. package/components/ion-route-redirect.js +1 -45
  73. package/components/ion-route.js +1 -74
  74. package/components/ion-router-link.js +1 -61
  75. package/components/ion-router-outlet.js +1 -226
  76. package/components/ion-router.js +1 -840
  77. package/components/ion-row.js +1 -36
  78. package/components/ion-searchbar.js +1 -540
  79. package/components/ion-segment-button.js +1 -173
  80. package/components/ion-segment-content.js +1 -35
  81. package/components/ion-segment-view.js +1 -142
  82. package/components/ion-segment.js +1 -602
  83. package/components/ion-select-modal.js +1 -6
  84. package/components/ion-select-option.js +1 -46
  85. package/components/ion-select-popover.js +1 -6
  86. package/components/ion-select.js +1 -1035
  87. package/components/ion-skeleton-text.js +1 -64
  88. package/components/ion-spinner.js +1 -6
  89. package/components/ion-split-pane.js +1 -190
  90. package/components/ion-tab-bar.js +1 -135
  91. package/components/ion-tab-button.js +1 -127
  92. package/components/ion-tab.js +1 -82
  93. package/components/ion-tabs.js +1 -204
  94. package/components/ion-text.js +1 -42
  95. package/components/ion-textarea.js +1 -554
  96. package/components/ion-thumbnail.js +1 -36
  97. package/components/ion-title.js +1 -6
  98. package/components/ion-toast.js +1 -938
  99. package/components/ion-toggle.js +1 -360
  100. package/components/ion-toolbar.js +1 -6
  101. package/components/p-1KVKSLu5.js +4 -0
  102. package/{dist/ionic/p-DUt5fQmA.js → components/p-9VcRUwdB.js} +1 -1
  103. package/components/p-ApmKVjaE.js +4 -0
  104. package/components/p-B-hirT0v.js +1 -35
  105. package/components/p-B6FQ0cKR.js +4 -0
  106. package/components/p-B6HaBl3o.js +4 -0
  107. package/components/p-B8b1Ukl9.js +4 -0
  108. package/components/p-BFxT89Wl.js +4 -0
  109. package/components/p-BJoMtgfR.js +4 -0
  110. package/components/p-BNAG-aVv.js +4 -0
  111. package/{dist/ionic/p-D-eFFUkA.js → components/p-BR3tZJmu.js} +1 -1
  112. package/{dist/ionic/p-D0dMcSkw.js → components/p-BS1TtEiJ.js} +1 -1
  113. package/components/p-BSB38Tek.js +4 -0
  114. package/components/p-BTEOs1at.js +1 -192
  115. package/components/p-BTeL5HCK.js +4 -0
  116. package/{dist/ionic/p-DbQ5QkTP.js → components/p-BUbsoBOV.js} +1 -1
  117. package/components/p-BVnB3eEn.js +4 -0
  118. package/components/p-BYDc3hSE.js +4 -0
  119. package/components/p-BagjAGC0.js +4 -0
  120. package/components/p-BegtE7nr.js +4 -0
  121. package/components/p-BgwEQWW6.js +4 -0
  122. package/components/p-Bk2zuNWT.js +4 -0
  123. package/components/p-BmVRXR1y.js +1 -72
  124. package/components/p-Bum_LjMh.js +4 -0
  125. package/components/p-BxwWvu-b.js +4 -0
  126. package/components/p-C4jPsTQa.js +4 -0
  127. package/components/p-C53feagD.js +1 -15
  128. package/{dist/ionic/p-CwgG81ZD.js → components/p-C59ryAuS.js} +1 -1
  129. package/components/p-C7AoMl7c.js +4 -0
  130. package/components/p-CBzELu-H.js +4 -0
  131. package/components/p-CDfQnFrd.js +4 -0
  132. package/components/p-CH0NYjKq.js +4 -0
  133. package/components/p-CIGNaXM1.js +1 -10
  134. package/components/p-CO7fmmxt.js +1 -29
  135. package/components/p-CU1SSH8_.js +4 -0
  136. package/components/p-CVF7ukTk.js +4 -0
  137. package/components/p-CgfaEEem.js +4 -0
  138. package/components/p-CgqKJg96.js +4 -0
  139. package/components/p-Cl0B-RWe.js +1 -452
  140. package/components/p-CneGxKsZ.js +4 -0
  141. package/components/p-CoA-aqGF.js +4 -0
  142. package/{dist/ionic/p-DdR6rpbR.js → components/p-Cq8cQ0NL.js} +1 -1
  143. package/components/p-Csw8xuz4.js +4 -0
  144. package/components/p-CtWGkNnJ.js +1 -162
  145. package/components/p-Cwv-vmkN.js +4 -0
  146. package/{dist/ionic/p-BYEqWnSg.js → components/p-Cy5XSfIk.js} +1 -1
  147. package/components/p-Cyxa_4PV.js +4 -0
  148. package/components/p-Cz5nLPGT.js +4 -0
  149. package/components/p-D13Eaw-8.js +1 -76
  150. package/components/p-D6NJwNJN.js +4 -0
  151. package/components/p-D6Ynv7Xh.js +1 -141
  152. package/components/p-DHsZWn1l.js +4 -0
  153. package/components/p-DJMZehmW.js +4 -0
  154. package/components/p-DJztqcrH.js +1 -14
  155. package/components/p-DYdpXONG.js +4 -0
  156. package/components/p-DgbT0exM.js +4 -0
  157. package/components/p-DiVJyqlX.js +1 -40
  158. package/components/p-Dtdm8lKC.js +1 -44
  159. package/components/p-YLXPWgVj.js +4 -0
  160. package/components/p-ZjP4CjeZ.js +1 -4
  161. package/{dist/ionic/p-DCv9sLH2.js → components/p-ak_d-z48.js} +1 -1
  162. package/components/p-cyNmxje6.js +1 -155
  163. package/components/p-fpbh6w3f.js +4 -0
  164. package/components/p-hHmYLOfE.js +1 -87
  165. package/components/p-kvaDs24J.js +4 -0
  166. package/components/p-vEbVo2hO.js +4 -0
  167. package/dist/cjs/{animation-Bt3H9L1C.js → animation-Dg4yiuR2.js} +1 -1
  168. package/dist/cjs/app-globals-CLI8xCmk.js +11 -0
  169. package/dist/cjs/{button-active-CMc8cD90.js → button-active-FscMI17-.js} +1 -1
  170. package/dist/cjs/{config-C5fsO43a.js → config-BukYi_pW.js} +1 -1
  171. package/dist/cjs/{data-JwZKaIQB.js → data-BYlBjkMU.js} +1 -1
  172. package/dist/cjs/{framework-delegate-DMJRBuDi.js → framework-delegate-CRgp8o_p.js} +1 -1
  173. package/dist/cjs/{hardware-back-button-VCK4V3mG.js → hardware-back-button-C4rMJ5uI.js} +1 -1
  174. package/dist/cjs/{helpers-DrTqNghc.js → helpers-CxTYJdbT.js} +1 -1
  175. package/dist/cjs/{index-094mMFB-.js → index-C845Ti6K.js} +4 -4
  176. package/dist/cjs/{index-DrMUZJj6.js → index-CFUwM5x_.js} +5 -5
  177. package/dist/cjs/{index-D6Wc6v08.js → index-CqT-2gKy.js} +503 -382
  178. package/dist/cjs/{index-CO6eryBo.js → index-MbaBbWXk.js} +2 -2
  179. package/dist/cjs/{index-C534ULug.js → index-YcSftOMz.js} +2 -2
  180. package/dist/cjs/index.cjs.js +12 -12
  181. package/dist/cjs/{input-shims-CuMghsQ-.js → input-shims-Dl5cnc_e.js} +3 -3
  182. package/dist/cjs/{input.utils-B_QROI2g.js → input.utils-DmeJ8dmo.js} +2 -2
  183. package/dist/cjs/ion-accordion_2.cjs.entry.js +23 -15
  184. package/dist/cjs/ion-action-sheet.cjs.entry.js +21 -15
  185. package/dist/cjs/ion-alert.cjs.entry.js +25 -17
  186. package/dist/cjs/ion-app_8.cjs.entry.js +48 -43
  187. package/dist/cjs/ion-avatar_3.cjs.entry.js +12 -12
  188. package/dist/cjs/ion-back-button.cjs.entry.js +7 -7
  189. package/dist/cjs/ion-backdrop.cjs.entry.js +6 -6
  190. package/dist/cjs/ion-breadcrumb_2.cjs.entry.js +20 -14
  191. package/dist/cjs/ion-button_2.cjs.entry.js +36 -18
  192. package/dist/cjs/ion-card_5.cjs.entry.js +23 -23
  193. package/dist/cjs/ion-checkbox.cjs.entry.js +7 -7
  194. package/dist/cjs/ion-chip.cjs.entry.js +6 -6
  195. package/dist/cjs/ion-col_3.cjs.entry.js +8 -8
  196. package/dist/cjs/ion-datetime-button.cjs.entry.js +8 -8
  197. package/dist/cjs/ion-datetime_3.cjs.entry.js +75 -46
  198. package/dist/cjs/ion-fab_3.cjs.entry.js +17 -13
  199. package/dist/cjs/ion-img.cjs.entry.js +8 -6
  200. package/dist/cjs/ion-infinite-scroll_2.cjs.entry.js +17 -13
  201. package/dist/cjs/ion-input-otp.cjs.entry.js +16 -10
  202. package/dist/cjs/ion-input-password-toggle.cjs.entry.js +9 -7
  203. package/dist/cjs/ion-input.cjs.entry.js +21 -13
  204. package/dist/cjs/ion-item-option_3.cjs.entry.js +19 -17
  205. package/dist/cjs/ion-item_8.cjs.entry.js +48 -42
  206. package/dist/cjs/ion-loading.cjs.entry.js +18 -14
  207. package/dist/cjs/ion-menu_3.cjs.entry.js +30 -22
  208. package/dist/cjs/ion-modal.cjs.entry.js +237 -59
  209. package/dist/cjs/ion-nav_2.cjs.entry.js +14 -10
  210. package/dist/cjs/ion-picker-column-option.cjs.entry.js +10 -8
  211. package/dist/cjs/ion-picker-column.cjs.entry.js +11 -7
  212. package/dist/cjs/ion-picker.cjs.entry.js +6 -6
  213. package/dist/cjs/ion-popover.cjs.entry.js +21 -15
  214. package/dist/cjs/ion-progress-bar.cjs.entry.js +7 -7
  215. package/dist/cjs/ion-radio_2.cjs.entry.js +17 -13
  216. package/dist/cjs/ion-range.cjs.entry.js +205 -57
  217. package/dist/cjs/ion-refresher_2.cjs.entry.js +45 -14
  218. package/dist/cjs/ion-reorder_2.cjs.entry.js +13 -11
  219. package/dist/cjs/ion-ripple-effect.cjs.entry.js +4 -4
  220. package/dist/cjs/ion-route_4.cjs.entry.js +20 -10
  221. package/dist/cjs/ion-searchbar.cjs.entry.js +22 -12
  222. package/dist/cjs/ion-segment-content.cjs.entry.js +3 -3
  223. package/dist/cjs/ion-segment-view.cjs.entry.js +13 -8
  224. package/dist/cjs/ion-segment_2.cjs.entry.js +26 -16
  225. package/dist/cjs/ion-select-modal.cjs.entry.js +17 -13
  226. package/dist/cjs/ion-select_3.cjs.entry.js +33 -24
  227. package/dist/cjs/ion-spinner.cjs.entry.js +4 -4
  228. package/dist/cjs/ion-split-pane.cjs.entry.js +15 -9
  229. package/dist/cjs/ion-tab-bar_2.cjs.entry.js +14 -12
  230. package/dist/cjs/ion-tab_2.cjs.entry.js +10 -8
  231. package/dist/cjs/ion-text.cjs.entry.js +4 -4
  232. package/dist/cjs/ion-textarea.cjs.entry.js +20 -14
  233. package/dist/cjs/ion-toast.cjs.entry.js +21 -15
  234. package/dist/cjs/ion-toggle.cjs.entry.js +10 -8
  235. package/dist/cjs/{ionic-global-HMVqOFGO.js → ionic-global-Bc3kJi1Z.js} +1 -1
  236. package/dist/cjs/ionic.cjs.js +5 -5
  237. package/dist/cjs/{ios.transition-BOt_uW73.js → ios.transition-trBiC95R.js} +4 -4
  238. package/dist/cjs/loader.cjs.js +4 -4
  239. package/dist/cjs/{md.transition-Dt968VXB.js → md.transition-CUQECuvD.js} +4 -4
  240. package/dist/cjs/{notch-controller-Bzqhjm4f.js → notch-controller-sD-lTpdc.js} +1 -1
  241. package/dist/cjs/{overlays-B2b-TTbl.js → overlays-C2jiBSNQ.js} +5 -5
  242. package/dist/cjs/{status-tap-g0sWWkXk.js → status-tap-CCJk5VgT.js} +3 -3
  243. package/dist/cjs/{swipe-back-BIayeNOD.js → swipe-back-BGhTQ1CU.js} +2 -2
  244. package/dist/collection/collection-manifest.json +2 -2
  245. package/dist/collection/components/accordion-group/accordion-group.js +4 -2
  246. package/dist/collection/components/action-sheet/action-sheet.js +20 -10
  247. package/dist/collection/components/alert/alert.js +24 -12
  248. package/dist/collection/components/back-button/back-button.js +4 -2
  249. package/dist/collection/components/badge/badge.js +2 -1
  250. package/dist/collection/components/breadcrumb/breadcrumb.js +8 -4
  251. package/dist/collection/components/breadcrumbs/breadcrumbs.js +4 -2
  252. package/dist/collection/components/button/button.js +6 -3
  253. package/dist/collection/components/card/card.js +6 -3
  254. package/dist/collection/components/card-header/card-header.js +2 -1
  255. package/dist/collection/components/card-subtitle/card-subtitle.js +2 -1
  256. package/dist/collection/components/card-title/card-title.js +2 -1
  257. package/dist/collection/components/checkbox/checkbox.js +4 -2
  258. package/dist/collection/components/chip/chip.js +2 -1
  259. package/dist/collection/components/content/content.js +12 -7
  260. package/dist/collection/components/datetime/datetime.js +43 -22
  261. package/dist/collection/components/datetime-button/datetime-button.js +2 -1
  262. package/dist/collection/components/fab-button/fab-button.js +6 -3
  263. package/dist/collection/components/infinite-scroll-content/infinite-scroll-content.js +4 -2
  264. package/dist/collection/components/input/input.js +11 -6
  265. package/dist/collection/components/input-otp/input-otp.js +8 -4
  266. package/dist/collection/components/input-password-toggle/input-password-toggle.js +4 -2
  267. package/dist/collection/components/item/item.js +10 -5
  268. package/dist/collection/components/item-divider/item-divider.js +7 -3
  269. package/dist/collection/components/item-option/item-option.js +6 -3
  270. package/dist/collection/components/item-options/item-options.js +2 -1
  271. package/dist/collection/components/item-sliding/item-sliding.js +2 -1
  272. package/dist/collection/components/label/label.js +6 -3
  273. package/dist/collection/components/list-header/list-header.js +6 -3
  274. package/dist/collection/components/loading/loading.js +22 -11
  275. package/dist/collection/components/menu/menu.js +10 -5
  276. package/dist/collection/components/menu-button/menu-button.js +2 -1
  277. package/dist/collection/components/modal/gestures/sheet.js +120 -12
  278. package/dist/collection/components/modal/gestures/swipe-to-close.js +54 -1
  279. package/dist/collection/components/modal/modal.js +127 -45
  280. package/dist/collection/components/nav/nav.js +89 -45
  281. package/dist/collection/components/nav-link/nav-link.js +9 -5
  282. package/dist/collection/components/note/note.js +2 -1
  283. package/dist/collection/components/picker/picker.js +2 -1
  284. package/dist/collection/components/picker-column/picker-column.js +6 -3
  285. package/dist/collection/components/picker-column-option/picker-column-option.js +2 -1
  286. package/dist/collection/components/picker-legacy/picker.js +24 -12
  287. package/dist/collection/components/picker-legacy-column/picker-column.js +4 -2
  288. package/dist/collection/components/popover/popover.js +33 -17
  289. package/dist/collection/components/progress-bar/progress-bar.js +2 -1
  290. package/dist/collection/components/radio/radio.js +2 -1
  291. package/dist/collection/components/radio-group/radio-group.js +6 -3
  292. package/dist/collection/components/range/range.js +214 -53
  293. package/dist/collection/components/refresher/refresher.js +73 -5
  294. package/dist/collection/components/refresher-content/refresher-content.js +8 -4
  295. package/dist/collection/components/reorder-group/reorder-group.js +6 -3
  296. package/dist/collection/components/route/route.js +4 -2
  297. package/dist/collection/components/router/router.js +10 -5
  298. package/dist/collection/components/router-link/router-link.js +6 -3
  299. package/dist/collection/components/router-outlet/router-outlet.js +18 -9
  300. package/dist/collection/components/searchbar/searchbar.js +11 -6
  301. package/dist/collection/components/segment/segment.js +10 -5
  302. package/dist/collection/components/segment-button/segment-button.js +4 -2
  303. package/dist/collection/components/segment-view/segment-view.ios.css +2 -1
  304. package/dist/collection/components/segment-view/segment-view.js +30 -4
  305. package/dist/collection/components/segment-view/segment-view.md.css +2 -1
  306. package/dist/collection/components/select/select.js +17 -8
  307. package/dist/collection/components/select-modal/select-modal.js +27 -2
  308. package/dist/collection/components/select-popover/select-popover.js +2 -1
  309. package/dist/collection/components/skeleton-text/skeleton-text.js +2 -1
  310. package/dist/collection/components/spinner/spinner.js +4 -2
  311. package/dist/collection/components/tab/tab.js +4 -2
  312. package/dist/collection/components/tab-bar/tab-bar.js +4 -2
  313. package/dist/collection/components/tab-button/tab-button.js +4 -2
  314. package/dist/collection/components/tabs/tabs.js +4 -2
  315. package/dist/collection/components/text/text.js +2 -1
  316. package/dist/collection/components/textarea/textarea.js +10 -7
  317. package/dist/collection/components/title/title.js +4 -2
  318. package/dist/collection/components/toast/toast.js +34 -17
  319. package/dist/collection/components/toggle/toggle.js +4 -2
  320. package/dist/collection/components/toolbar/toolbar.js +2 -1
  321. package/dist/docs.d.ts +37 -0
  322. package/dist/docs.json +1186 -389
  323. package/dist/esm/{animation-Dt8bGnA-.js → animation-CnGMT4ji.js} +1 -1
  324. package/dist/esm/app-globals-DhZjtldk.js +9 -0
  325. package/dist/esm/{button-active-L570Swow.js → button-active-BBx21brx.js} +1 -1
  326. package/dist/esm/{config-mCdtaoPe.js → config-TO1rZH52.js} +1 -1
  327. package/dist/esm/{data-DCORV9FH.js → data-B9iGR5YO.js} +1 -1
  328. package/dist/esm/{framework-delegate-BYawdMXj.js → framework-delegate-CyxE1S_P.js} +1 -1
  329. package/dist/esm/{hardware-back-button-CPLxO-Ev.js → hardware-back-button-CTe4XmL7.js} +1 -1
  330. package/dist/esm/{helpers-DEn3pfjm.js → helpers-Tl8jw6S2.js} +1 -1
  331. package/dist/esm/{index-r2D9DEro.js → index-B-hkiOUh.js} +4 -4
  332. package/dist/esm/{index-CvDIirVx.js → index-B2KwgBLx.js} +5 -5
  333. package/dist/esm/{index-ceb5RaMT.js → index-BtUdxPjv.js} +2 -2
  334. package/dist/esm/{index-C8IsBmNU.js → index-IGIE5vDm.js} +503 -382
  335. package/dist/esm/{index-Bs3kT4bc.js → index-hW6eNZ3o.js} +2 -2
  336. package/dist/esm/index.js +12 -12
  337. package/dist/esm/{input-shims-D6H3ZaWt.js → input-shims-AaDhOpKN.js} +3 -3
  338. package/dist/esm/{input.utils-DrvTa8gz.js → input.utils-Bxa_DQ7-.js} +2 -2
  339. package/dist/esm/ion-accordion_2.entry.js +23 -15
  340. package/dist/esm/ion-action-sheet.entry.js +21 -15
  341. package/dist/esm/ion-alert.entry.js +25 -17
  342. package/dist/esm/ion-app_8.entry.js +48 -43
  343. package/dist/esm/ion-avatar_3.entry.js +12 -12
  344. package/dist/esm/ion-back-button.entry.js +7 -7
  345. package/dist/esm/ion-backdrop.entry.js +6 -6
  346. package/dist/esm/ion-breadcrumb_2.entry.js +20 -14
  347. package/dist/esm/ion-button_2.entry.js +36 -18
  348. package/dist/esm/ion-card_5.entry.js +23 -23
  349. package/dist/esm/ion-checkbox.entry.js +7 -7
  350. package/dist/esm/ion-chip.entry.js +6 -6
  351. package/dist/esm/ion-col_3.entry.js +8 -8
  352. package/dist/esm/ion-datetime-button.entry.js +8 -8
  353. package/dist/esm/ion-datetime_3.entry.js +75 -46
  354. package/dist/esm/ion-fab_3.entry.js +17 -13
  355. package/dist/esm/ion-img.entry.js +8 -6
  356. package/dist/esm/ion-infinite-scroll_2.entry.js +17 -13
  357. package/dist/esm/ion-input-otp.entry.js +16 -10
  358. package/dist/esm/ion-input-password-toggle.entry.js +9 -7
  359. package/dist/esm/ion-input.entry.js +21 -13
  360. package/dist/esm/ion-item-option_3.entry.js +19 -17
  361. package/dist/esm/ion-item_8.entry.js +48 -42
  362. package/dist/esm/ion-loading.entry.js +18 -14
  363. package/dist/esm/ion-menu_3.entry.js +30 -22
  364. package/dist/esm/ion-modal.entry.js +237 -59
  365. package/dist/esm/ion-nav_2.entry.js +14 -10
  366. package/dist/esm/ion-picker-column-option.entry.js +10 -8
  367. package/dist/esm/ion-picker-column.entry.js +11 -7
  368. package/dist/esm/ion-picker.entry.js +6 -6
  369. package/dist/esm/ion-popover.entry.js +21 -15
  370. package/dist/esm/ion-progress-bar.entry.js +7 -7
  371. package/dist/esm/ion-radio_2.entry.js +17 -13
  372. package/dist/esm/ion-range.entry.js +205 -57
  373. package/dist/esm/ion-refresher_2.entry.js +45 -14
  374. package/dist/esm/ion-reorder_2.entry.js +13 -11
  375. package/dist/esm/ion-ripple-effect.entry.js +4 -4
  376. package/dist/esm/ion-route_4.entry.js +20 -10
  377. package/dist/esm/ion-searchbar.entry.js +22 -12
  378. package/dist/esm/ion-segment-content.entry.js +3 -3
  379. package/dist/esm/ion-segment-view.entry.js +13 -8
  380. package/dist/esm/ion-segment_2.entry.js +26 -16
  381. package/dist/esm/ion-select-modal.entry.js +17 -13
  382. package/dist/esm/ion-select_3.entry.js +33 -24
  383. package/dist/esm/ion-spinner.entry.js +4 -4
  384. package/dist/esm/ion-split-pane.entry.js +15 -9
  385. package/dist/esm/ion-tab-bar_2.entry.js +14 -12
  386. package/dist/esm/ion-tab_2.entry.js +10 -8
  387. package/dist/esm/ion-text.entry.js +4 -4
  388. package/dist/esm/ion-textarea.entry.js +20 -14
  389. package/dist/esm/ion-toast.entry.js +21 -15
  390. package/dist/esm/ion-toggle.entry.js +10 -8
  391. package/dist/esm/{ionic-global-CDrldh-5.js → ionic-global-DfbeLwcV.js} +1 -1
  392. package/dist/esm/ionic.js +6 -6
  393. package/dist/esm/{ios.transition-BDzw0_Hm.js → ios.transition--aMF-pDH.js} +4 -4
  394. package/dist/esm/loader.js +5 -5
  395. package/dist/esm/{md.transition-BzDYi3qq.js → md.transition-BEVbfm8j.js} +4 -4
  396. package/dist/esm/{notch-controller-BwelN_JM.js → notch-controller-DAcvKU57.js} +1 -1
  397. package/dist/esm/{overlays-D5YkFThA.js → overlays-F8GHPo-e.js} +5 -5
  398. package/dist/esm/{status-tap-5DQ7Fc4V.js → status-tap-BfJqFSLF.js} +3 -3
  399. package/dist/esm/{swipe-back-BKw2CAHc.js → swipe-back-BZBFwTQV.js} +2 -2
  400. package/dist/html.html-data.json +117 -109
  401. package/dist/ionic/index.esm.js +1 -1
  402. package/dist/ionic/ionic.esm.js +1 -1
  403. package/dist/ionic/p-031b76f7.entry.js +4 -0
  404. package/dist/ionic/p-045a6a42.entry.js +4 -0
  405. package/dist/ionic/p-07506134.entry.js +4 -0
  406. package/dist/ionic/p-084c25b2.entry.js +4 -0
  407. package/dist/ionic/p-0d8b5c38.entry.js +4 -0
  408. package/dist/ionic/p-16813ce7.entry.js +4 -0
  409. package/dist/ionic/p-16b65553.entry.js +4 -0
  410. package/dist/ionic/p-1b02923f.entry.js +4 -0
  411. package/dist/ionic/{p-5c8f7253.entry.js → p-1b169fb6.entry.js} +1 -1
  412. package/dist/ionic/{p-915b3e3d.entry.js → p-23fac490.entry.js} +1 -1
  413. package/dist/ionic/{p-b8551510.entry.js → p-294f4bb5.entry.js} +1 -1
  414. package/dist/ionic/p-2a68388b.entry.js +4 -0
  415. package/dist/ionic/p-2f5a8140.entry.js +4 -0
  416. package/dist/ionic/{p-49d06882.entry.js → p-301c43f8.entry.js} +1 -1
  417. package/dist/ionic/{p-79bd78f9.entry.js → p-370a60ee.entry.js} +1 -1
  418. package/dist/ionic/p-3e143d1d.entry.js +4 -0
  419. package/dist/ionic/p-4819b469.entry.js +4 -0
  420. package/dist/ionic/p-4dd5e8e0.entry.js +4 -0
  421. package/dist/ionic/p-51c11c47.entry.js +4 -0
  422. package/dist/ionic/p-53f750a5.entry.js +4 -0
  423. package/dist/ionic/{p-7cad388a.entry.js → p-6af16209.entry.js} +1 -1
  424. package/dist/ionic/{p-7f98e710.entry.js → p-6b701daa.entry.js} +1 -1
  425. package/dist/ionic/p-6b97f2a3.entry.js +4 -0
  426. package/dist/ionic/p-71e322f7.entry.js +4 -0
  427. package/dist/ionic/p-7620be24.entry.js +4 -0
  428. package/dist/ionic/p-771b27a5.entry.js +4 -0
  429. package/dist/ionic/{p-906bb44d.entry.js → p-7ca71c83.entry.js} +1 -1
  430. package/dist/ionic/{p-11aa58d6.entry.js → p-80cac7a2.entry.js} +1 -1
  431. package/dist/ionic/p-96a2e768.entry.js +4 -0
  432. package/dist/ionic/{p-582824c5.entry.js → p-9833cf63.entry.js} +1 -1
  433. package/dist/ionic/p-9cbc6f1f.entry.js +4 -0
  434. package/dist/ionic/p-9cdbabbb.entry.js +4 -0
  435. package/dist/ionic/p-9eac4eb1.entry.js +4 -0
  436. package/dist/ionic/{p-675b1a31.entry.js → p-9fae83d8.entry.js} +1 -1
  437. package/dist/ionic/p-B8xlpH8p.js +4 -0
  438. package/dist/ionic/{p-C7hRNDhM.js → p-BAt5H1ac.js} +1 -1
  439. package/dist/ionic/p-BW_TRJm8.js +4 -0
  440. package/dist/ionic/{p-DDb5r57F.js → p-Bum7H1fw.js} +1 -1
  441. package/dist/ionic/p-BvFYtOdE.js +4 -0
  442. package/dist/ionic/{p-Dc45iWE4.js → p-BxIcPWoV.js} +1 -1
  443. package/dist/ionic/p-C0JvVFMv.js +4 -0
  444. package/dist/ionic/{p-CTfR9YZG.js → p-CGmVTdWh.js} +1 -1
  445. package/dist/ionic/{p-BOVrCkpJ.js → p-CYbRmDdy.js} +1 -1
  446. package/dist/ionic/{p-MUoJJJwd.js → p-CYvM5g3q.js} +1 -1
  447. package/dist/ionic/p-CmFz1Mjc.js +4 -0
  448. package/dist/ionic/p-CtA-yJYy.js +4 -0
  449. package/dist/ionic/p-D8HJQ1qq.js +4 -0
  450. package/dist/ionic/{p-B0q1YL7N.js → p-DB_iPQC-.js} +1 -1
  451. package/dist/ionic/{p-DNcfiJwE.js → p-DLbbmF9h.js} +1 -1
  452. package/dist/ionic/p-DTPR1Wpn.js +4 -0
  453. package/dist/ionic/p-DjriolRs.js +4 -0
  454. package/dist/ionic/p-DtVZDHlS.js +4 -0
  455. package/dist/ionic/p-IGIE5vDm.js +5 -0
  456. package/dist/ionic/{p-BFvmZNyx.js → p-NFFyoJ4Q.js} +1 -1
  457. package/dist/ionic/p-a805674e.entry.js +4 -0
  458. package/dist/ionic/{p-da7d04cc.entry.js → p-a84f2d21.entry.js} +1 -1
  459. package/dist/ionic/p-aa47f46e.entry.js +4 -0
  460. package/dist/ionic/{p-2668188b.entry.js → p-b325a113.entry.js} +1 -1
  461. package/dist/ionic/{p-d1f54e28.entry.js → p-b440381f.entry.js} +1 -1
  462. package/dist/ionic/p-b6e0ff03.entry.js +4 -0
  463. package/dist/ionic/{p-6f37536a.entry.js → p-bcaa827e.entry.js} +1 -1
  464. package/dist/ionic/{p-fb0271ae.entry.js → p-c3cce9d8.entry.js} +1 -1
  465. package/dist/ionic/{p-b0a7585c.entry.js → p-ca31010f.entry.js} +1 -1
  466. package/dist/ionic/p-d4e8b473.entry.js +4 -0
  467. package/dist/ionic/{p-9575b654.entry.js → p-e663bc5a.entry.js} +1 -1
  468. package/dist/ionic/p-e6c5f060.entry.js +4 -0
  469. package/dist/ionic/{p-652318c3.entry.js → p-e6cedcd7.entry.js} +1 -1
  470. package/dist/ionic/{p-fbb00634.entry.js → p-e863ffe8.entry.js} +1 -1
  471. package/dist/ionic/{p-0ca0fe9c.entry.js → p-f2deaceb.entry.js} +1 -1
  472. package/dist/ionic/{p-ac4eb91d.entry.js → p-f5dfb9a3.entry.js} +1 -1
  473. package/dist/ionic/{p-bce86e56.entry.js → p-f8186550.entry.js} +1 -1
  474. package/dist/ionic/p-fdbc90d4.entry.js +4 -0
  475. package/dist/ionic/p-gbVXD275.js +4 -0
  476. package/dist/ionic/p-hNN3VvaC.js +4 -0
  477. package/dist/types/components/datetime/datetime.d.ts +10 -0
  478. package/dist/types/components/header/header.utils.d.ts +2 -1
  479. package/dist/types/components/item/item.d.ts +2 -0
  480. package/dist/types/components/item-divider/item-divider.d.ts +3 -0
  481. package/dist/types/components/item-option/item-option.d.ts +2 -0
  482. package/dist/types/components/list-header/list-header.d.ts +2 -0
  483. package/dist/types/components/modal/gestures/sheet.d.ts +2 -2
  484. package/dist/types/components/modal/gestures/swipe-to-close.d.ts +2 -2
  485. package/dist/types/components/modal/modal-interface.d.ts +25 -0
  486. package/dist/types/components/modal/modal.d.ts +22 -1
  487. package/dist/types/components/range/range-interface.d.ts +1 -0
  488. package/dist/types/components/range/range.d.ts +44 -4
  489. package/dist/types/components/refresher/refresher-interface.d.ts +7 -0
  490. package/dist/types/components/refresher/refresher.d.ts +16 -3
  491. package/dist/types/components/segment-view/segment-view.d.ts +4 -0
  492. package/dist/types/components/select/select.d.ts +3 -0
  493. package/dist/types/components/select-modal/select-modal.d.ts +4 -0
  494. package/dist/types/components.d.ts +964 -191
  495. package/dist/types/interface.d.ts +2 -2
  496. package/dist/types/stencil-public-runtime.d.ts +126 -14
  497. package/dist/types/utils/gesture/listener.d.ts +2 -1
  498. package/hydrate/index.d.ts +12 -0
  499. package/hydrate/index.js +5632 -1421
  500. package/hydrate/index.mjs +5631 -1422
  501. package/package.json +2 -2
  502. package/components/p-B25GjpND.js +0 -71
  503. package/components/p-BANeLH_G.js +0 -290
  504. package/components/p-BBFQmhcD.js +0 -59
  505. package/components/p-BC-awmYt.js +0 -306
  506. package/components/p-BHbOsu99.js +0 -501
  507. package/components/p-BTlwXR9e.js +0 -73
  508. package/components/p-BcazQttQ.js +0 -612
  509. package/components/p-BdGshsIJ.js +0 -226
  510. package/components/p-BfS7vSpC.js +0 -147
  511. package/components/p-BhRFCLuX.js +0 -675
  512. package/components/p-Bhnhnzjz.js +0 -75
  513. package/components/p-BmcqD0EN.js +0 -153
  514. package/components/p-Boi6hecl.js +0 -115
  515. package/components/p-Bt_moUyl.js +0 -232
  516. package/components/p-Bxl5etF4.js +0 -146
  517. package/components/p-ByjmWt3s.js +0 -139
  518. package/components/p-C04oPyjT.js +0 -54
  519. package/components/p-C6dkQWq2.js +0 -1626
  520. package/components/p-CFZWrvIQ.js +0 -194
  521. package/components/p-CIJwkzL6.js +0 -195
  522. package/components/p-CL12ApCQ.js +0 -820
  523. package/components/p-CXJR56Oq.js +0 -564
  524. package/components/p-Cdm3dKWf.js +0 -108
  525. package/components/p-CslsoGzv.js +0 -192
  526. package/components/p-Cyd00tgZ.js +0 -167
  527. package/components/p-CzAJ3ArC.js +0 -380
  528. package/components/p-CzW34QBh.js +0 -12
  529. package/components/p-D0zXRwcr.js +0 -196
  530. package/components/p-D5hF6rwn.js +0 -339
  531. package/components/p-D8eD2iBA.js +0 -67
  532. package/components/p-DGOrLIyS.js +0 -481
  533. package/components/p-DK2Bn1Mc.js +0 -305
  534. package/components/p-DKRQWlK2.js +0 -598
  535. package/components/p-DNDUsygf.js +0 -128
  536. package/components/p-DTWZF6wg.js +0 -418
  537. package/components/p-DWoUQeZ3.js +0 -3012
  538. package/components/p-DX0w75a9.js +0 -420
  539. package/components/p-Dt8zaCLQ.js +0 -92
  540. package/components/p-DyFBFrV7.js +0 -264
  541. package/components/p-DyHPCMyn.js +0 -39
  542. package/components/p-LgLeKTkH.js +0 -112
  543. package/components/p-NhiRFRn9.js +0 -50
  544. package/components/p-OuiHmXO5.js +0 -646
  545. package/components/p-Wro9IPHE.js +0 -459
  546. package/components/p-aIWC4ZEV.js +0 -305
  547. package/components/p-c-XJ9XhZ.js +0 -915
  548. package/components/p-fVuFT3Wd.js +0 -78
  549. package/components/p-iyo0Toaz.js +0 -2822
  550. package/components/p-l_lso3Zl.js +0 -140
  551. package/components/p-mQp4lwQD.js +0 -1638
  552. package/dist/cjs/app-globals-Ciccnk9_.js +0 -10
  553. package/dist/esm/app-globals-BDSf8fOA.js +0 -8
  554. package/dist/ionic/p-11518b31.entry.js +0 -4
  555. package/dist/ionic/p-221a3d8c.entry.js +0 -4
  556. package/dist/ionic/p-2ac254dc.entry.js +0 -4
  557. package/dist/ionic/p-2bd1ea35.entry.js +0 -4
  558. package/dist/ionic/p-30333874.entry.js +0 -4
  559. package/dist/ionic/p-31db96da.entry.js +0 -4
  560. package/dist/ionic/p-34642fa1.entry.js +0 -4
  561. package/dist/ionic/p-35696017.entry.js +0 -4
  562. package/dist/ionic/p-363d1209.entry.js +0 -4
  563. package/dist/ionic/p-46a38cfd.entry.js +0 -4
  564. package/dist/ionic/p-4eec1a5e.entry.js +0 -4
  565. package/dist/ionic/p-530fcd71.entry.js +0 -4
  566. package/dist/ionic/p-5d6fb6e3.entry.js +0 -4
  567. package/dist/ionic/p-66fbe052.entry.js +0 -4
  568. package/dist/ionic/p-7babec72.entry.js +0 -4
  569. package/dist/ionic/p-82d5bb3d.entry.js +0 -4
  570. package/dist/ionic/p-97eb0812.entry.js +0 -4
  571. package/dist/ionic/p-9b6d46f2.entry.js +0 -4
  572. package/dist/ionic/p-BKc55Xev.js +0 -4
  573. package/dist/ionic/p-Bmgaetn_.js +0 -4
  574. package/dist/ionic/p-C8IsBmNU.js +0 -5
  575. package/dist/ionic/p-CJxh_yLS.js +0 -4
  576. package/dist/ionic/p-DZRJwG4S.js +0 -4
  577. package/dist/ionic/p-a4a9f5ae.entry.js +0 -4
  578. package/dist/ionic/p-b0ebf9f8.entry.js +0 -4
  579. package/dist/ionic/p-be263062.entry.js +0 -4
  580. package/dist/ionic/p-c175d792.entry.js +0 -4
  581. package/dist/ionic/p-cc2a9936.entry.js +0 -4
  582. package/dist/ionic/p-cc45bcbc.entry.js +0 -4
  583. package/dist/ionic/p-d0a2a1ab.entry.js +0 -4
  584. package/dist/ionic/p-e4c57008.entry.js +0 -4
  585. package/dist/ionic/p-e5d6d0f0.entry.js +0 -4
  586. package/dist/ionic/p-f1dfee25.entry.js +0 -4
  587. package/dist/ionic/p-f9f7b9db.entry.js +0 -4
@@ -1,2050 +1,4 @@
1
1
  /*!
2
2
  * (C) Ionic http://ionicframework.com - MIT License
3
3
  */
4
- import { j as printIonError, f as printIonWarning, p as proxyCustomElement, H, e as createEvent, w as writeTask, h, d as Host } from './p-DWoUQeZ3.js';
5
- import { startFocusVisible } from './p-BmVRXR1y.js';
6
- import { r as raf, g as getElementRoot, e as renderHiddenInput } from './p-D5hF6rwn.js';
7
- import { F as FOCUS_TRAP_DISABLE_CLASS } from './p-c-XJ9XhZ.js';
8
- import { i as isRTL } from './p-C53feagD.js';
9
- import { c as createColorClasses } from './p-DiVJyqlX.js';
10
- import { c as chevronDown, f as caretUpSharp, g as chevronForward, h as caretDownSharp, a as chevronBack } from './p-CO7fmmxt.js';
11
- import { b as getIonMode } from './p-Bxl5etF4.js';
12
- import { i as isBefore, a as isAfter, g as getPreviousMonth, b as getNextMonth, c as isSameDay, d as getDay, e as generateDayAriaLabel, v as validateParts, f as getPartsFromCalendarDay, h as getNextYear, j as getPreviousYear, k as getEndOfWeek, l as getStartOfWeek, m as getPreviousDay, n as getNextDay, o as getPreviousWeek, p as getNextWeek, q as parseMinParts, r as parseMaxParts, s as parseDate, w as warnIfValueOutOfBounds, t as parseAmPm, u as clampDate, x as convertToArrayOfNumbers, y as convertDataToISO, z as getToday, A as getClosestValidDate, B as generateMonths, C as getNumDaysInMonth, D as getCombinedDateColumnData, E as getMonthColumnData, F as getDayColumnData, G as getYearColumnData, H as isMonthFirstLocale, I as getTimeColumnsData, J as isLocaleDayPeriodRTL, K as getDaysOfWeek, L as getMonthAndYear, M as getDaysOfMonth, N as getHourCycle, O as getLocalizedTime, P as getLocalizedDateTime, Q as formatValue, R as calculateHourFromAMPM } from './p-mQp4lwQD.js';
13
- import { d as defineCustomElement$a } from './p-Bhnhnzjz.js';
14
- import { d as defineCustomElement$9 } from './p-DK2Bn1Mc.js';
15
- import { d as defineCustomElement$8 } from './p-BBFQmhcD.js';
16
- import { d as defineCustomElement$7 } from './p-Wro9IPHE.js';
17
- import { d as defineCustomElement$6 } from './p-BHbOsu99.js';
18
- import { d as defineCustomElement$5 } from './p-DKRQWlK2.js';
19
- import { d as defineCustomElement$4 } from './p-ByjmWt3s.js';
20
- import { d as defineCustomElement$3 } from './p-C6dkQWq2.js';
21
- import { d as defineCustomElement$2 } from './p-LgLeKTkH.js';
22
-
23
- const isYearDisabled = (refYear, minParts, maxParts) => {
24
- if (minParts && minParts.year > refYear) {
25
- return true;
26
- }
27
- if (maxParts && maxParts.year < refYear) {
28
- return true;
29
- }
30
- return false;
31
- };
32
- /**
33
- * Returns true if a given day should
34
- * not be interactive according to its value,
35
- * or the max/min dates.
36
- */
37
- const isDayDisabled = (refParts, minParts, maxParts, dayValues) => {
38
- /**
39
- * If this is a filler date (i.e. padding)
40
- * then the date is disabled.
41
- */
42
- if (refParts.day === null) {
43
- return true;
44
- }
45
- /**
46
- * If user passed in a list of acceptable day values
47
- * check to make sure that the date we are looking
48
- * at is in this array.
49
- */
50
- if (dayValues !== undefined && !dayValues.includes(refParts.day)) {
51
- return true;
52
- }
53
- /**
54
- * Given a min date, perform the following
55
- * checks. If any of them are true, then the
56
- * day should be disabled:
57
- * 1. Is the current year < the min allowed year?
58
- * 2. Is the current year === min allowed year,
59
- * but the current month < the min allowed month?
60
- * 3. Is the current year === min allowed year, the
61
- * current month === min allow month, but the current
62
- * day < the min allowed day?
63
- */
64
- if (minParts && isBefore(refParts, minParts)) {
65
- return true;
66
- }
67
- /**
68
- * Given a max date, perform the following
69
- * checks. If any of them are true, then the
70
- * day should be disabled:
71
- * 1. Is the current year > the max allowed year?
72
- * 2. Is the current year === max allowed year,
73
- * but the current month > the max allowed month?
74
- * 3. Is the current year === max allowed year, the
75
- * current month === max allow month, but the current
76
- * day > the max allowed day?
77
- */
78
- if (maxParts && isAfter(refParts, maxParts)) {
79
- return true;
80
- }
81
- /**
82
- * If none of these checks
83
- * passed then the date should
84
- * be interactive.
85
- */
86
- return false;
87
- };
88
- /**
89
- * Given a locale, a date, the selected date(s), and today's date,
90
- * generate the state for a given calendar day button.
91
- */
92
- const getCalendarDayState = (locale, refParts, activeParts, todayParts, minParts, maxParts, dayValues) => {
93
- /**
94
- * activeParts signals what day(s) are currently selected in the datetime.
95
- * If multiple="true", this will be an array, but the logic in this util
96
- * is the same whether we have one selected day or many because we're only
97
- * calculating the state for one button. So, we treat a single activeParts value
98
- * the same as an array of length one.
99
- */
100
- const activePartsArray = Array.isArray(activeParts) ? activeParts : [activeParts];
101
- /**
102
- * The day button is active if it is selected, or in other words, if refParts
103
- * matches at least one selected date.
104
- */
105
- const isActive = activePartsArray.find((parts) => isSameDay(refParts, parts)) !== undefined;
106
- const isToday = isSameDay(refParts, todayParts);
107
- const disabled = isDayDisabled(refParts, minParts, maxParts, dayValues);
108
- /**
109
- * Note that we always return one object regardless of whether activeParts
110
- * was an array, since we pare down to one value for isActive.
111
- */
112
- return {
113
- disabled,
114
- isActive,
115
- isToday,
116
- ariaSelected: isActive ? 'true' : null,
117
- ariaLabel: generateDayAriaLabel(locale, isToday, refParts),
118
- text: refParts.day != null ? getDay(locale, refParts) : null,
119
- };
120
- };
121
- /**
122
- * Returns `true` if the month is disabled given the
123
- * current date value and min/max date constraints.
124
- */
125
- const isMonthDisabled = (refParts, { minParts, maxParts, }) => {
126
- // If the year is disabled then the month is disabled.
127
- if (isYearDisabled(refParts.year, minParts, maxParts)) {
128
- return true;
129
- }
130
- // If the date value is before the min date, then the month is disabled.
131
- // If the date value is after the max date, then the month is disabled.
132
- if ((minParts && isBefore(refParts, minParts)) || (maxParts && isAfter(refParts, maxParts))) {
133
- return true;
134
- }
135
- return false;
136
- };
137
- /**
138
- * Given a working date, an optional minimum date range,
139
- * and an optional maximum date range; determine if the
140
- * previous navigation button is disabled.
141
- */
142
- const isPrevMonthDisabled = (refParts, minParts, maxParts) => {
143
- const prevMonth = Object.assign(Object.assign({}, getPreviousMonth(refParts)), { day: null });
144
- return isMonthDisabled(prevMonth, {
145
- minParts,
146
- maxParts,
147
- });
148
- };
149
- /**
150
- * Given a working date and a maximum date range,
151
- * determine if the next navigation button is disabled.
152
- */
153
- const isNextMonthDisabled = (refParts, maxParts) => {
154
- const nextMonth = Object.assign(Object.assign({}, getNextMonth(refParts)), { day: null });
155
- return isMonthDisabled(nextMonth, {
156
- maxParts,
157
- });
158
- };
159
- /**
160
- * Given the value of the highlightedDates property
161
- * and an ISO string, return the styles to use for
162
- * that date, or undefined if none are found.
163
- */
164
- const getHighlightStyles = (highlightedDates, dateIsoString, el) => {
165
- if (Array.isArray(highlightedDates)) {
166
- const dateStringWithoutTime = dateIsoString.split('T')[0];
167
- const matchingHighlight = highlightedDates.find((hd) => hd.date === dateStringWithoutTime);
168
- if (matchingHighlight) {
169
- return {
170
- textColor: matchingHighlight.textColor,
171
- backgroundColor: matchingHighlight.backgroundColor,
172
- border: matchingHighlight.border,
173
- };
174
- }
175
- }
176
- else {
177
- /**
178
- * Wrap in a try-catch to prevent exceptions in the user's function
179
- * from interrupting the calendar's rendering.
180
- */
181
- try {
182
- return highlightedDates(dateIsoString);
183
- }
184
- catch (e) {
185
- printIonError('[ion-datetime] - Exception thrown from provided `highlightedDates` callback. Please check your function and try again.', el, e);
186
- }
187
- }
188
- return undefined;
189
- };
190
-
191
- /**
192
- * If a time zone is provided in the format options, the rendered text could
193
- * differ from what was selected in the Datetime, which could cause
194
- * confusion.
195
- */
196
- const warnIfTimeZoneProvided = (el, formatOptions) => {
197
- var _a, _b, _c, _d;
198
- if (((_a = formatOptions === null || formatOptions === void 0 ? void 0 : formatOptions.date) === null || _a === void 0 ? void 0 : _a.timeZone) ||
199
- ((_b = formatOptions === null || formatOptions === void 0 ? void 0 : formatOptions.date) === null || _b === void 0 ? void 0 : _b.timeZoneName) ||
200
- ((_c = formatOptions === null || formatOptions === void 0 ? void 0 : formatOptions.time) === null || _c === void 0 ? void 0 : _c.timeZone) ||
201
- ((_d = formatOptions === null || formatOptions === void 0 ? void 0 : formatOptions.time) === null || _d === void 0 ? void 0 : _d.timeZoneName)) {
202
- printIonWarning('[ion-datetime] - "timeZone" and "timeZoneName" are not supported in "formatOptions".', el);
203
- }
204
- };
205
- const checkForPresentationFormatMismatch = (el, presentation, formatOptions) => {
206
- // formatOptions is not required
207
- if (!formatOptions)
208
- return;
209
- // If formatOptions is provided, the date and/or time objects are required, depending on the presentation
210
- switch (presentation) {
211
- case 'date':
212
- case 'month-year':
213
- case 'month':
214
- case 'year':
215
- if (formatOptions.date === undefined) {
216
- printIonWarning(`[ion-datetime] - The '${presentation}' presentation requires a date object in formatOptions.`, el);
217
- }
218
- break;
219
- case 'time':
220
- if (formatOptions.time === undefined) {
221
- printIonWarning(`[ion-datetime] - The 'time' presentation requires a time object in formatOptions.`, el);
222
- }
223
- break;
224
- case 'date-time':
225
- case 'time-date':
226
- if (formatOptions.date === undefined && formatOptions.time === undefined) {
227
- printIonWarning(`[ion-datetime] - The '${presentation}' presentation requires either a date or time object (or both) in formatOptions.`, el);
228
- }
229
- break;
230
- }
231
- };
232
-
233
- const datetimeIosCss = ":host{display:-ms-flexbox;display:flex;-ms-flex-flow:column;flex-flow:column;background:var(--background);overflow:hidden}:host(.datetime-size-fixed){width:auto;height:auto}:host(.datetime-size-fixed:not(.datetime-prefer-wheel)){max-width:350px}:host(.datetime-size-fixed.datetime-prefer-wheel){min-width:350px;max-width:-webkit-max-content;max-width:-moz-max-content;max-width:max-content}:host(.datetime-size-cover){width:100%}:host .calendar-body,:host .datetime-year{opacity:0}:host(:not(.datetime-ready)) .datetime-year{position:absolute;pointer-events:none}:host(.datetime-ready) .calendar-body{opacity:1}:host(.datetime-ready) .datetime-year{display:none;opacity:1}:host .wheel-order-year-first .day-column{-ms-flex-order:3;order:3;text-align:end}:host .wheel-order-year-first .month-column{-ms-flex-order:2;order:2;text-align:end}:host .wheel-order-year-first .year-column{-ms-flex-order:1;order:1;text-align:start}:host .datetime-calendar,:host .datetime-year{display:-ms-flexbox;display:flex;-ms-flex:1 1 auto;flex:1 1 auto;-ms-flex-flow:column;flex-flow:column}:host(.show-month-and-year) .datetime-year{display:-ms-flexbox;display:flex}:host(.show-month-and-year) .calendar-next-prev,:host(.show-month-and-year) .calendar-days-of-week,:host(.show-month-and-year) .calendar-body,:host(.show-month-and-year) .datetime-time{display:none}:host(.month-year-picker-open) .datetime-footer{display:none}:host(.datetime-disabled){pointer-events:none}:host(.datetime-disabled) .calendar-days-of-week,:host(.datetime-disabled) .datetime-time{opacity:0.4}:host(.datetime-readonly){pointer-events:none;}:host(.datetime-readonly) .calendar-action-buttons,:host(.datetime-readonly) .calendar-body,:host(.datetime-readonly) .datetime-year{pointer-events:initial}:host(.datetime-readonly) .calendar-day[disabled]:not(.calendar-day-constrained),:host(.datetime-readonly) .datetime-action-buttons ion-button[disabled]{opacity:1}:host .datetime-header .datetime-title{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}:host .datetime-action-buttons.has-clear-button{width:100%}:host .datetime-action-buttons ion-buttons{display:-ms-flexbox;display:flex;-ms-flex-pack:justify;justify-content:space-between}.datetime-action-buttons .datetime-action-buttons-container{display:-ms-flexbox;display:flex}:host .calendar-action-buttons{display:-ms-flexbox;display:flex;-ms-flex-pack:justify;justify-content:space-between}:host .calendar-action-buttons ion-button{--background:transparent}:host .calendar-days-of-week{display:grid;grid-template-columns:repeat(7, 1fr);text-align:center}.calendar-days-of-week .day-of-week{-webkit-margin-start:auto;margin-inline-start:auto;-webkit-margin-end:auto;margin-inline-end:auto;margin-top:0;margin-bottom:0}:host .calendar-body{display:-ms-flexbox;display:flex;-ms-flex-positive:1;flex-grow:1;-webkit-scroll-snap-type:x mandatory;-ms-scroll-snap-type:x mandatory;scroll-snap-type:x mandatory;overflow-x:scroll;overflow-y:hidden;scrollbar-width:none;outline:none}:host .calendar-body .calendar-month{display:-ms-flexbox;display:flex;-ms-flex-flow:column;flex-flow:column;scroll-snap-align:start;scroll-snap-stop:always;-ms-flex-negative:0;flex-shrink:0;width:100%}:host .calendar-body .calendar-month-disabled{scroll-snap-align:none}:host .calendar-body::-webkit-scrollbar{display:none}:host .calendar-body .calendar-month-grid{display:grid;grid-template-columns:repeat(7, 1fr)}:host .calendar-day-wrapper{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;min-width:0;min-height:0;overflow:visible}.calendar-day{border-radius:50%;-webkit-padding-start:0px;padding-inline-start:0px;-webkit-padding-end:0px;padding-inline-end:0px;padding-top:0px;padding-bottom:0px;-webkit-margin-start:0px;margin-inline-start:0px;-webkit-margin-end:0px;margin-inline-end:0px;margin-top:0px;margin-bottom:0px;display:-ms-flexbox;display:flex;position:relative;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;border:none;outline:none;background:none;color:currentColor;font-family:var(--ion-font-family, inherit);cursor:pointer;-webkit-appearance:none;-moz-appearance:none;appearance:none;z-index:0}:host .calendar-day[disabled]{pointer-events:none;opacity:0.4}.calendar-day:not(.calendar-day-adjacent-day):focus{background:rgba(var(--ion-color-base-rgb), 0.2);-webkit-box-shadow:0px 0px 0px 4px rgba(var(--ion-color-base-rgb), 0.2);box-shadow:0px 0px 0px 4px rgba(var(--ion-color-base-rgb), 0.2)}:host .datetime-time{display:-ms-flexbox;display:flex;-ms-flex-pack:justify;justify-content:space-between}:host(.datetime-presentation-time) .datetime-time{padding-left:0;padding-right:0;padding-top:0;padding-bottom:0}:host ion-popover{--height:200px}:host .time-header{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center}:host .time-body{border-radius:8px;-webkit-padding-start:12px;padding-inline-start:12px;-webkit-padding-end:12px;padding-inline-end:12px;padding-top:6px;padding-bottom:6px;display:-ms-flexbox;display:flex;border:none;background:var(--ion-color-step-300, var(--ion-background-color-step-300, #edeef0));color:var(--ion-text-color, #000);font-family:inherit;font-size:inherit;cursor:pointer;-webkit-appearance:none;-moz-appearance:none;appearance:none}:host .time-body-active{color:var(--ion-color-base)}:host(.in-item){position:static}:host(.show-month-and-year) .calendar-action-buttons .calendar-month-year-toggle{color:var(--ion-color-base)}.calendar-month-year{min-width:0}.calendar-month-year-toggle{font-family:inherit;font-size:inherit;font-style:inherit;font-weight:inherit;letter-spacing:inherit;text-decoration:inherit;text-indent:inherit;text-overflow:inherit;text-transform:inherit;text-align:inherit;white-space:inherit;color:inherit;position:relative;border:0;outline:none;background:transparent;cursor:pointer;z-index:1}.calendar-month-year-toggle::after{left:0;right:0;top:0;bottom:0;position:absolute;content:\"\";opacity:0;-webkit-transition:opacity 15ms linear, background-color 15ms linear;transition:opacity 15ms linear, background-color 15ms linear;z-index:-1}.calendar-month-year-toggle.ion-focused::after{background:currentColor}.calendar-month-year-toggle:disabled{opacity:0.3;pointer-events:none}.calendar-month-year-toggle ion-icon{-webkit-padding-start:4px;padding-inline-start:4px;-webkit-padding-end:0;padding-inline-end:0;padding-top:0;padding-bottom:0;-ms-flex-negative:0;flex-shrink:0}.calendar-month-year-toggle #toggle-wrapper{display:-ms-inline-flexbox;display:inline-flex;-ms-flex-align:center;align-items:center}ion-picker{--highlight-background:var(--wheel-highlight-background);--highlight-border-radius:var(--wheel-highlight-border-radius);--fade-background-rgb:var(--wheel-fade-background-rgb)}:host{--background:var(--ion-color-light, #f4f5f8);--background-rgb:var(--ion-color-light-rgb, 244, 245, 248);--title-color:var(--ion-color-step-600, var(--ion-text-color-step-400, #666666))}:host(.datetime-presentation-date-time:not(.datetime-prefer-wheel)),:host(.datetime-presentation-time-date:not(.datetime-prefer-wheel)),:host(.datetime-presentation-date:not(.datetime-prefer-wheel)){min-height:350px}:host .datetime-header{-webkit-padding-start:16px;padding-inline-start:16px;-webkit-padding-end:16px;padding-inline-end:16px;padding-top:16px;padding-bottom:16px;border-bottom:0.55px solid var(--ion-color-step-200, var(--ion-background-color-step-200, #cccccc));font-size:min(0.875rem, 22.4px)}:host .datetime-header .datetime-title{color:var(--title-color)}:host .datetime-header .datetime-selected-date{margin-top:10px}.calendar-month-year-toggle{-webkit-padding-start:16px;padding-inline-start:16px;-webkit-padding-end:16px;padding-inline-end:16px;padding-top:0px;padding-bottom:0px;min-height:44px;font-size:min(1rem, 25.6px);font-weight:600}.calendar-month-year-toggle.ion-focused::after{opacity:0.15}.calendar-month-year-toggle #toggle-wrapper{-webkit-margin-start:0;margin-inline-start:0;-webkit-margin-end:8px;margin-inline-end:8px;margin-top:10px;margin-bottom:10px}:host .calendar-action-buttons .calendar-month-year-toggle ion-icon,:host .calendar-action-buttons ion-buttons ion-button{color:var(--ion-color-base)}:host .calendar-action-buttons ion-buttons{-ms-flex-align:stretch;align-items:stretch;height:100%}:host .calendar-action-buttons ion-buttons ion-button{margin-left:0;margin-right:0;margin-top:0;margin-bottom:0}:host .calendar-days-of-week{-webkit-padding-start:8px;padding-inline-start:8px;-webkit-padding-end:8px;padding-inline-end:8px;padding-top:0;padding-bottom:0;color:var(--ion-color-step-300, var(--ion-text-color-step-700, #b3b3b3));font-size:min(0.75rem, 19.2px);font-weight:600;line-height:24px;text-transform:uppercase}@supports (border-radius: mod(1px, 1px)){.calendar-days-of-week .day-of-week{width:clamp(20px, calc(mod(min(1rem, 24px), 24px) * 10), 100%);height:24px;overflow:hidden}.calendar-day{border-radius:max(8px, mod(min(1rem, 24px), 24px) * 10)}}@supports ((border-radius: mod(1px, 1px)) and (background: -webkit-named-image(apple-pay-logo-black)) and (not (contain-intrinsic-size: none))) or (not (border-radius: mod(1px, 1px))){.calendar-days-of-week .day-of-week{width:auto;height:auto;overflow:initial}.calendar-day{border-radius:32px}}:host .calendar-body .calendar-month .calendar-month-grid{-webkit-padding-start:8px;padding-inline-start:8px;-webkit-padding-end:8px;padding-inline-end:8px;padding-top:8px;padding-bottom:8px;-ms-flex-align:center;align-items:center;height:calc(100% - 16px)}:host .calendar-day-wrapper{-webkit-padding-start:4px;padding-inline-start:4px;-webkit-padding-end:4px;padding-inline-end:4px;padding-top:4px;padding-bottom:4px;height:0;min-height:1rem}:host .calendar-day{width:40px;min-width:40px;height:40px;font-size:min(1.25rem, 32px)}.calendar-day.calendar-day-active{background:rgba(var(--ion-color-base-rgb), 0.2);font-size:min(1.375rem, 35.2px)}:host .calendar-day.calendar-day-today{color:var(--ion-color-base)}:host .calendar-day.calendar-day-active,:host .calendar-day.calendar-day-adjacent-day.calendar-day-active{color:var(--ion-color-base);font-weight:600}:host .calendar-day.calendar-day-today.calendar-day-active{background:var(--ion-color-base);color:var(--ion-color-contrast)}:host .calendar-day.calendar-day-adjacent-day{color:var(--ion-color-step-300, var(--ion-text-color-step-700, #b3b3b3))}:host .datetime-time{-webkit-padding-start:16px;padding-inline-start:16px;-webkit-padding-end:16px;padding-inline-end:16px;padding-top:8px;padding-bottom:16px;font-size:min(1rem, 25.6px)}:host .datetime-time .time-header{font-weight:600}:host .datetime-buttons{-webkit-padding-start:8px;padding-inline-start:8px;-webkit-padding-end:8px;padding-inline-end:8px;padding-top:8px;padding-bottom:8px;border-top:0.55px solid var(--ion-color-step-200, var(--ion-background-color-step-200, #cccccc))}:host .datetime-buttons ::slotted(ion-buttons),:host .datetime-buttons ion-buttons{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:justify;justify-content:space-between}:host .datetime-action-buttons{width:100%}";
234
-
235
- const datetimeMdCss = ":host{display:-ms-flexbox;display:flex;-ms-flex-flow:column;flex-flow:column;background:var(--background);overflow:hidden}:host(.datetime-size-fixed){width:auto;height:auto}:host(.datetime-size-fixed:not(.datetime-prefer-wheel)){max-width:350px}:host(.datetime-size-fixed.datetime-prefer-wheel){min-width:350px;max-width:-webkit-max-content;max-width:-moz-max-content;max-width:max-content}:host(.datetime-size-cover){width:100%}:host .calendar-body,:host .datetime-year{opacity:0}:host(:not(.datetime-ready)) .datetime-year{position:absolute;pointer-events:none}:host(.datetime-ready) .calendar-body{opacity:1}:host(.datetime-ready) .datetime-year{display:none;opacity:1}:host .wheel-order-year-first .day-column{-ms-flex-order:3;order:3;text-align:end}:host .wheel-order-year-first .month-column{-ms-flex-order:2;order:2;text-align:end}:host .wheel-order-year-first .year-column{-ms-flex-order:1;order:1;text-align:start}:host .datetime-calendar,:host .datetime-year{display:-ms-flexbox;display:flex;-ms-flex:1 1 auto;flex:1 1 auto;-ms-flex-flow:column;flex-flow:column}:host(.show-month-and-year) .datetime-year{display:-ms-flexbox;display:flex}:host(.show-month-and-year) .calendar-next-prev,:host(.show-month-and-year) .calendar-days-of-week,:host(.show-month-and-year) .calendar-body,:host(.show-month-and-year) .datetime-time{display:none}:host(.month-year-picker-open) .datetime-footer{display:none}:host(.datetime-disabled){pointer-events:none}:host(.datetime-disabled) .calendar-days-of-week,:host(.datetime-disabled) .datetime-time{opacity:0.4}:host(.datetime-readonly){pointer-events:none;}:host(.datetime-readonly) .calendar-action-buttons,:host(.datetime-readonly) .calendar-body,:host(.datetime-readonly) .datetime-year{pointer-events:initial}:host(.datetime-readonly) .calendar-day[disabled]:not(.calendar-day-constrained),:host(.datetime-readonly) .datetime-action-buttons ion-button[disabled]{opacity:1}:host .datetime-header .datetime-title{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}:host .datetime-action-buttons.has-clear-button{width:100%}:host .datetime-action-buttons ion-buttons{display:-ms-flexbox;display:flex;-ms-flex-pack:justify;justify-content:space-between}.datetime-action-buttons .datetime-action-buttons-container{display:-ms-flexbox;display:flex}:host .calendar-action-buttons{display:-ms-flexbox;display:flex;-ms-flex-pack:justify;justify-content:space-between}:host .calendar-action-buttons ion-button{--background:transparent}:host .calendar-days-of-week{display:grid;grid-template-columns:repeat(7, 1fr);text-align:center}.calendar-days-of-week .day-of-week{-webkit-margin-start:auto;margin-inline-start:auto;-webkit-margin-end:auto;margin-inline-end:auto;margin-top:0;margin-bottom:0}:host .calendar-body{display:-ms-flexbox;display:flex;-ms-flex-positive:1;flex-grow:1;-webkit-scroll-snap-type:x mandatory;-ms-scroll-snap-type:x mandatory;scroll-snap-type:x mandatory;overflow-x:scroll;overflow-y:hidden;scrollbar-width:none;outline:none}:host .calendar-body .calendar-month{display:-ms-flexbox;display:flex;-ms-flex-flow:column;flex-flow:column;scroll-snap-align:start;scroll-snap-stop:always;-ms-flex-negative:0;flex-shrink:0;width:100%}:host .calendar-body .calendar-month-disabled{scroll-snap-align:none}:host .calendar-body::-webkit-scrollbar{display:none}:host .calendar-body .calendar-month-grid{display:grid;grid-template-columns:repeat(7, 1fr)}:host .calendar-day-wrapper{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;min-width:0;min-height:0;overflow:visible}.calendar-day{border-radius:50%;-webkit-padding-start:0px;padding-inline-start:0px;-webkit-padding-end:0px;padding-inline-end:0px;padding-top:0px;padding-bottom:0px;-webkit-margin-start:0px;margin-inline-start:0px;-webkit-margin-end:0px;margin-inline-end:0px;margin-top:0px;margin-bottom:0px;display:-ms-flexbox;display:flex;position:relative;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;border:none;outline:none;background:none;color:currentColor;font-family:var(--ion-font-family, inherit);cursor:pointer;-webkit-appearance:none;-moz-appearance:none;appearance:none;z-index:0}:host .calendar-day[disabled]{pointer-events:none;opacity:0.4}.calendar-day:not(.calendar-day-adjacent-day):focus{background:rgba(var(--ion-color-base-rgb), 0.2);-webkit-box-shadow:0px 0px 0px 4px rgba(var(--ion-color-base-rgb), 0.2);box-shadow:0px 0px 0px 4px rgba(var(--ion-color-base-rgb), 0.2)}:host .datetime-time{display:-ms-flexbox;display:flex;-ms-flex-pack:justify;justify-content:space-between}:host(.datetime-presentation-time) .datetime-time{padding-left:0;padding-right:0;padding-top:0;padding-bottom:0}:host ion-popover{--height:200px}:host .time-header{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center}:host .time-body{border-radius:8px;-webkit-padding-start:12px;padding-inline-start:12px;-webkit-padding-end:12px;padding-inline-end:12px;padding-top:6px;padding-bottom:6px;display:-ms-flexbox;display:flex;border:none;background:var(--ion-color-step-300, var(--ion-background-color-step-300, #edeef0));color:var(--ion-text-color, #000);font-family:inherit;font-size:inherit;cursor:pointer;-webkit-appearance:none;-moz-appearance:none;appearance:none}:host .time-body-active{color:var(--ion-color-base)}:host(.in-item){position:static}:host(.show-month-and-year) .calendar-action-buttons .calendar-month-year-toggle{color:var(--ion-color-base)}.calendar-month-year{min-width:0}.calendar-month-year-toggle{font-family:inherit;font-size:inherit;font-style:inherit;font-weight:inherit;letter-spacing:inherit;text-decoration:inherit;text-indent:inherit;text-overflow:inherit;text-transform:inherit;text-align:inherit;white-space:inherit;color:inherit;position:relative;border:0;outline:none;background:transparent;cursor:pointer;z-index:1}.calendar-month-year-toggle::after{left:0;right:0;top:0;bottom:0;position:absolute;content:\"\";opacity:0;-webkit-transition:opacity 15ms linear, background-color 15ms linear;transition:opacity 15ms linear, background-color 15ms linear;z-index:-1}.calendar-month-year-toggle.ion-focused::after{background:currentColor}.calendar-month-year-toggle:disabled{opacity:0.3;pointer-events:none}.calendar-month-year-toggle ion-icon{-webkit-padding-start:4px;padding-inline-start:4px;-webkit-padding-end:0;padding-inline-end:0;padding-top:0;padding-bottom:0;-ms-flex-negative:0;flex-shrink:0}.calendar-month-year-toggle #toggle-wrapper{display:-ms-inline-flexbox;display:inline-flex;-ms-flex-align:center;align-items:center}ion-picker{--highlight-background:var(--wheel-highlight-background);--highlight-border-radius:var(--wheel-highlight-border-radius);--fade-background-rgb:var(--wheel-fade-background-rgb)}:host{--background:var(--ion-color-step-100, var(--ion-background-color-step-100, #ffffff));--title-color:var(--ion-color-contrast)}:host .datetime-header{-webkit-padding-start:20px;padding-inline-start:20px;-webkit-padding-end:20px;padding-inline-end:20px;padding-top:20px;padding-bottom:20px;background:var(--ion-color-base);color:var(--title-color)}:host .datetime-header .datetime-title{font-size:0.75rem;text-transform:uppercase}:host .datetime-header .datetime-selected-date{margin-top:30px;font-size:2.125rem}:host .calendar-action-buttons ion-button{--color:var(--ion-color-step-650, var(--ion-text-color-step-350, #595959))}.calendar-month-year-toggle{-webkit-padding-start:20px;padding-inline-start:20px;-webkit-padding-end:16px;padding-inline-end:16px;padding-top:12px;padding-bottom:12px;min-height:48px;background:transparent;color:var(--ion-color-step-650, var(--ion-text-color-step-350, #595959));z-index:1}.calendar-month-year-toggle.ion-focused::after{opacity:0.04}.calendar-month-year-toggle ion-ripple-effect{color:currentColor}@media (any-hover: hover){.calendar-month-year-toggle.ion-activatable:not(.ion-focused):hover::after{background:currentColor;opacity:0.04}}:host .calendar-days-of-week{-webkit-padding-start:10px;padding-inline-start:10px;-webkit-padding-end:10px;padding-inline-end:10px;padding-top:0px;padding-bottom:0px;color:var(--ion-color-step-500, var(--ion-text-color-step-500, gray));font-size:0.875rem;line-height:36px}:host .calendar-body .calendar-month .calendar-month-grid{-webkit-padding-start:10px;padding-inline-start:10px;-webkit-padding-end:10px;padding-inline-end:10px;padding-top:4px;padding-bottom:4px;grid-template-rows:repeat(6, 1fr)}:host .calendar-day{width:42px;min-width:42px;height:42px;font-size:0.875rem}:host .calendar-day.calendar-day-today{border:1px solid var(--ion-color-base);color:var(--ion-color-base)}:host .calendar-day.calendar-day-active,:host .calendar-day.calendar-day-adjacent-day.calendar-day-active{color:var(--ion-color-contrast)}.calendar-day.calendar-day-active,.calendar-day.calendar-day-active:focus{border:1px solid var(--ion-color-base);background:var(--ion-color-base)}:host .calendar-day.calendar-day-adjacent-day{color:var(--ion-color-step-500, var(--ion-text-color-step-500, gray))}:host .datetime-time{-webkit-padding-start:16px;padding-inline-start:16px;-webkit-padding-end:16px;padding-inline-end:16px;padding-top:8px;padding-bottom:8px}:host .time-header{color:var(--ion-color-step-650, var(--ion-text-color-step-350, #595959))}:host(.datetime-presentation-month) .datetime-year,:host(.datetime-presentation-year) .datetime-year,:host(.datetime-presentation-month-year) .datetime-year{margin-top:20px;margin-bottom:20px}:host .datetime-buttons{-webkit-padding-start:10px;padding-inline-start:10px;-webkit-padding-end:10px;padding-inline-end:10px;padding-top:10px;padding-bottom:10px;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:end;justify-content:flex-end}";
236
-
237
- const Datetime = /*@__PURE__*/ proxyCustomElement(class Datetime extends H {
238
- constructor(registerHost) {
239
- super();
240
- if (registerHost !== false) {
241
- this.__registerHost();
242
- }
243
- this.__attachShadow();
244
- this.ionCancel = createEvent(this, "ionCancel", 7);
245
- this.ionChange = createEvent(this, "ionChange", 7);
246
- this.ionValueChange = createEvent(this, "ionValueChange", 7);
247
- this.ionFocus = createEvent(this, "ionFocus", 7);
248
- this.ionBlur = createEvent(this, "ionBlur", 7);
249
- this.ionStyle = createEvent(this, "ionStyle", 7);
250
- this.ionRender = createEvent(this, "ionRender", 7);
251
- this.inputId = `ion-dt-${datetimeIds++}`;
252
- this.prevPresentation = null;
253
- this.showMonthAndYear = false;
254
- this.activeParts = [];
255
- this.workingParts = {
256
- month: 5,
257
- day: 28,
258
- year: 2021,
259
- hour: 13,
260
- minute: 52,
261
- ampm: 'pm',
262
- isAdjacentDay: false,
263
- };
264
- this.isTimePopoverOpen = false;
265
- /**
266
- * The color to use from your application's color palette.
267
- * Default options are: `"primary"`, `"secondary"`, `"tertiary"`, `"success"`, `"warning"`, `"danger"`, `"light"`, `"medium"`, and `"dark"`.
268
- * For more information on colors, see [theming](/docs/theming/basics).
269
- */
270
- this.color = 'primary';
271
- /**
272
- * The name of the control, which is submitted with the form data.
273
- */
274
- this.name = this.inputId;
275
- /**
276
- * If `true`, the user cannot interact with the datetime.
277
- */
278
- this.disabled = false;
279
- /**
280
- * If `true`, the datetime appears normal but the selected date cannot be changed.
281
- */
282
- this.readonly = false;
283
- /**
284
- * If `true`, the datetime calendar displays a six-week (42-day) layout,
285
- * including days from the previous and next months to fill the grid.
286
- * These adjacent days are selectable unless disabled.
287
- */
288
- this.showAdjacentDays = false;
289
- /**
290
- * Which values you want to select. `"date"` will show
291
- * a calendar picker to select the month, day, and year. `"time"`
292
- * will show a time picker to select the hour, minute, and (optionally)
293
- * AM/PM. `"date-time"` will show the date picker first and time picker second.
294
- * `"time-date"` will show the time picker first and date picker second.
295
- */
296
- this.presentation = 'date-time';
297
- /**
298
- * The text to display on the picker's cancel button.
299
- */
300
- this.cancelText = 'Cancel';
301
- /**
302
- * The text to display on the picker's "Done" button.
303
- */
304
- this.doneText = 'Done';
305
- /**
306
- * The text to display on the picker's "Clear" button.
307
- */
308
- this.clearText = 'Clear';
309
- /**
310
- * The locale to use for `ion-datetime`. This
311
- * impacts month and day name formatting.
312
- * The `"default"` value refers to the default
313
- * locale set by your device.
314
- */
315
- this.locale = 'default';
316
- /**
317
- * The first day of the week to use for `ion-datetime`. The
318
- * default value is `0` and represents Sunday.
319
- */
320
- this.firstDayOfWeek = 0;
321
- /**
322
- * If `true`, multiple dates can be selected at once. Only
323
- * applies to `presentation="date"` and `preferWheel="false"`.
324
- */
325
- this.multiple = false;
326
- /**
327
- * If `true`, a header will be shown above the calendar
328
- * picker. This will include both the slotted title, and
329
- * the selected date.
330
- */
331
- this.showDefaultTitle = false;
332
- /**
333
- * If `true`, the default "Cancel" and "OK" buttons
334
- * will be rendered at the bottom of the `ion-datetime`
335
- * component. Developers can also use the `button` slot
336
- * if they want to customize these buttons. If custom
337
- * buttons are set in the `button` slot then the
338
- * default buttons will not be rendered.
339
- */
340
- this.showDefaultButtons = false;
341
- /**
342
- * If `true`, a "Clear" button will be rendered alongside
343
- * the default "Cancel" and "OK" buttons at the bottom of the `ion-datetime`
344
- * component. Developers can also use the `button` slot
345
- * if they want to customize these buttons. If custom
346
- * buttons are set in the `button` slot then the
347
- * default buttons will not be rendered.
348
- */
349
- this.showClearButton = false;
350
- /**
351
- * If `true`, the default "Time" label will be rendered
352
- * for the time selector of the `ion-datetime` component.
353
- * Developers can also use the `time-label` slot
354
- * if they want to customize this label. If a custom
355
- * label is set in the `time-label` slot then the
356
- * default label will not be rendered.
357
- */
358
- this.showDefaultTimeLabel = true;
359
- /**
360
- * If `cover`, the `ion-datetime` will expand to cover the full width of its container.
361
- * If `fixed`, the `ion-datetime` will have a fixed width.
362
- */
363
- this.size = 'fixed';
364
- /**
365
- * If `true`, a wheel picker will be rendered instead of a calendar grid
366
- * where possible. If `false`, a calendar grid will be rendered instead of
367
- * a wheel picker where possible.
368
- *
369
- * A wheel picker can be rendered instead of a grid when `presentation` is
370
- * one of the following values: `"date"`, `"date-time"`, or `"time-date"`.
371
- *
372
- * A wheel picker will always be rendered regardless of
373
- * the `preferWheel` value when `presentation` is one of the following values:
374
- * `"time"`, `"month"`, `"month-year"`, or `"year"`.
375
- */
376
- this.preferWheel = false;
377
- this.warnIfIncorrectValueUsage = () => {
378
- const { multiple, value } = this;
379
- if (!multiple && Array.isArray(value)) {
380
- /**
381
- * We do some processing on the `value` array so
382
- * that it looks more like an array when logged to
383
- * the console.
384
- * Example given ['a', 'b']
385
- * Default toString() behavior: a,b
386
- * Custom behavior: ['a', 'b']
387
- */
388
- printIonWarning(`[ion-datetime] - An array of values was passed, but multiple is "false". This is incorrect usage and may result in unexpected behaviors. To dismiss this warning, pass a string to the "value" property when multiple="false".
389
-
390
- Value Passed: [${value.map((v) => `'${v}'`).join(', ')}]
391
- `, this.el);
392
- }
393
- };
394
- this.setValue = (value) => {
395
- this.value = value;
396
- this.ionChange.emit({ value });
397
- };
398
- /**
399
- * Returns the DatetimePart interface
400
- * to use when rendering an initial set of
401
- * data. This should be used when rendering an
402
- * interface in an environment where the `value`
403
- * may not be set. This function works
404
- * by returning the first selected date and then
405
- * falling back to defaultParts if no active date
406
- * is selected.
407
- */
408
- this.getActivePartsWithFallback = () => {
409
- var _a;
410
- const { defaultParts } = this;
411
- return (_a = this.getActivePart()) !== null && _a !== void 0 ? _a : defaultParts;
412
- };
413
- this.getActivePart = () => {
414
- const { activeParts } = this;
415
- return Array.isArray(activeParts) ? activeParts[0] : activeParts;
416
- };
417
- this.closeParentOverlay = (role) => {
418
- const popoverOrModal = this.el.closest('ion-modal, ion-popover');
419
- if (popoverOrModal) {
420
- popoverOrModal.dismiss(undefined, role);
421
- }
422
- };
423
- this.setWorkingParts = (parts) => {
424
- this.workingParts = Object.assign({}, parts);
425
- };
426
- this.setActiveParts = (parts, removeDate = false) => {
427
- /** if the datetime component is in readonly mode,
428
- * allow browsing of the calendar without changing
429
- * the set value
430
- */
431
- if (this.readonly) {
432
- return;
433
- }
434
- const { multiple, minParts, maxParts, activeParts } = this;
435
- /**
436
- * When setting the active parts, it is possible
437
- * to set invalid data. For example,
438
- * when updating January 31 to February,
439
- * February 31 does not exist. As a result
440
- * we need to validate the active parts and
441
- * ensure that we are only setting valid dates.
442
- * Additionally, we need to update the working parts
443
- * too in the event that the validated parts are different.
444
- */
445
- const validatedParts = validateParts(parts, minParts, maxParts);
446
- this.setWorkingParts(validatedParts);
447
- if (multiple) {
448
- const activePartsArray = Array.isArray(activeParts) ? activeParts : [activeParts];
449
- if (removeDate) {
450
- this.activeParts = activePartsArray.filter((p) => !isSameDay(p, validatedParts));
451
- }
452
- else {
453
- this.activeParts = [...activePartsArray, validatedParts];
454
- }
455
- }
456
- else {
457
- this.activeParts = Object.assign({}, validatedParts);
458
- }
459
- const hasSlottedButtons = this.el.querySelector('[slot="buttons"]') !== null;
460
- if (hasSlottedButtons || this.showDefaultButtons) {
461
- return;
462
- }
463
- this.confirm();
464
- };
465
- this.initializeKeyboardListeners = () => {
466
- const calendarBodyRef = this.calendarBodyRef;
467
- if (!calendarBodyRef) {
468
- return;
469
- }
470
- const root = this.el.shadowRoot;
471
- /**
472
- * Get a reference to the month
473
- * element we are currently viewing.
474
- */
475
- const currentMonth = calendarBodyRef.querySelector('.calendar-month:nth-of-type(2)');
476
- /**
477
- * When focusing the calendar body, we want to pass focus
478
- * to the working day, but other days should
479
- * only be accessible using the arrow keys. Pressing
480
- * Tab should jump between bodies of selectable content.
481
- */
482
- const checkCalendarBodyFocus = (ev) => {
483
- var _a;
484
- const record = ev[0];
485
- /**
486
- * If calendar body was already focused
487
- * when this fired or if the calendar body
488
- * if not currently focused, we should not re-focus
489
- * the inner day.
490
- */
491
- if (((_a = record.oldValue) === null || _a === void 0 ? void 0 : _a.includes('ion-focused')) || !calendarBodyRef.classList.contains('ion-focused')) {
492
- return;
493
- }
494
- this.focusWorkingDay(currentMonth);
495
- };
496
- const mo = new MutationObserver(checkCalendarBodyFocus);
497
- mo.observe(calendarBodyRef, { attributeFilter: ['class'], attributeOldValue: true });
498
- this.destroyKeyboardMO = () => {
499
- mo === null || mo === void 0 ? void 0 : mo.disconnect();
500
- };
501
- /**
502
- * We must use keydown not keyup as we want
503
- * to prevent scrolling when using the arrow keys.
504
- */
505
- calendarBodyRef.addEventListener('keydown', (ev) => {
506
- const activeElement = root.activeElement;
507
- if (!activeElement || !activeElement.classList.contains('calendar-day')) {
508
- return;
509
- }
510
- const parts = getPartsFromCalendarDay(activeElement);
511
- let partsToFocus;
512
- switch (ev.key) {
513
- case 'ArrowDown':
514
- ev.preventDefault();
515
- partsToFocus = getNextWeek(parts);
516
- break;
517
- case 'ArrowUp':
518
- ev.preventDefault();
519
- partsToFocus = getPreviousWeek(parts);
520
- break;
521
- case 'ArrowRight':
522
- ev.preventDefault();
523
- partsToFocus = getNextDay(parts);
524
- break;
525
- case 'ArrowLeft':
526
- ev.preventDefault();
527
- partsToFocus = getPreviousDay(parts);
528
- break;
529
- case 'Home':
530
- ev.preventDefault();
531
- partsToFocus = getStartOfWeek(parts);
532
- break;
533
- case 'End':
534
- ev.preventDefault();
535
- partsToFocus = getEndOfWeek(parts);
536
- break;
537
- case 'PageUp':
538
- ev.preventDefault();
539
- partsToFocus = ev.shiftKey ? getPreviousYear(parts) : getPreviousMonth(parts);
540
- break;
541
- case 'PageDown':
542
- ev.preventDefault();
543
- partsToFocus = ev.shiftKey ? getNextYear(parts) : getNextMonth(parts);
544
- break;
545
- /**
546
- * Do not preventDefault here
547
- * as we do not want to override other
548
- * browser defaults such as pressing Enter/Space
549
- * to select a day.
550
- */
551
- default:
552
- return;
553
- }
554
- /**
555
- * If the day we want to move focus to is
556
- * disabled, do not do anything.
557
- */
558
- if (isDayDisabled(partsToFocus, this.minParts, this.maxParts)) {
559
- return;
560
- }
561
- this.setWorkingParts(Object.assign(Object.assign({}, this.workingParts), partsToFocus));
562
- /**
563
- * Give view a chance to re-render
564
- * then move focus to the new working day
565
- */
566
- requestAnimationFrame(() => this.focusWorkingDay(currentMonth));
567
- });
568
- };
569
- this.focusWorkingDay = (currentMonth) => {
570
- /**
571
- * Get the number of offset days so
572
- * we know how much to offset our next selector by
573
- * to grab the correct calendar-day element.
574
- */
575
- const { day, month, year } = this.workingParts;
576
- const firstOfMonth = new Date(`${month}/1/${year}`).getDay();
577
- const offset = firstOfMonth >= this.firstDayOfWeek
578
- ? firstOfMonth - this.firstDayOfWeek
579
- : 7 - (this.firstDayOfWeek - firstOfMonth);
580
- if (day === null) {
581
- return;
582
- }
583
- /**
584
- * Get the calendar day element
585
- * and focus it.
586
- */
587
- const dayEl = currentMonth.querySelector(`.calendar-day-wrapper:nth-of-type(${offset + day}) .calendar-day`);
588
- if (dayEl) {
589
- dayEl.focus();
590
- }
591
- };
592
- this.processMinParts = () => {
593
- const { min, defaultParts } = this;
594
- if (min === undefined) {
595
- this.minParts = undefined;
596
- return;
597
- }
598
- this.minParts = parseMinParts(min, defaultParts);
599
- };
600
- this.processMaxParts = () => {
601
- const { max, defaultParts } = this;
602
- if (max === undefined) {
603
- this.maxParts = undefined;
604
- return;
605
- }
606
- this.maxParts = parseMaxParts(max, defaultParts);
607
- };
608
- this.initializeCalendarListener = () => {
609
- const calendarBodyRef = this.calendarBodyRef;
610
- if (!calendarBodyRef) {
611
- return;
612
- }
613
- /**
614
- * For performance reasons, we only render 3
615
- * months at a time: The current month, the previous
616
- * month, and the next month. We have a scroll listener
617
- * on the calendar body to append/prepend new months.
618
- *
619
- * We can do this because Stencil is smart enough to not
620
- * re-create the .calendar-month containers, but rather
621
- * update the content within those containers.
622
- *
623
- * As an added bonus, WebKit has some troubles with
624
- * scroll-snap-stop: always, so not rendering all of
625
- * the months in a row allows us to mostly sidestep
626
- * that issue.
627
- */
628
- const months = calendarBodyRef.querySelectorAll('.calendar-month');
629
- const startMonth = months[0];
630
- const workingMonth = months[1];
631
- const endMonth = months[2];
632
- const mode = getIonMode(this);
633
- const needsiOSRubberBandFix = mode === 'ios' && typeof navigator !== 'undefined' && navigator.maxTouchPoints > 1;
634
- /**
635
- * Before setting up the scroll listener,
636
- * scroll the middle month into view.
637
- * scrollIntoView() will scroll entire page
638
- * if element is not in viewport. Use scrollLeft instead.
639
- */
640
- writeTask(() => {
641
- calendarBodyRef.scrollLeft = startMonth.clientWidth * (isRTL(this.el) ? -1 : 1);
642
- const getChangedMonth = (parts) => {
643
- const box = calendarBodyRef.getBoundingClientRect();
644
- /**
645
- * If the current scroll position is all the way to the left
646
- * then we have scrolled to the previous month.
647
- * Otherwise, assume that we have scrolled to the next
648
- * month. We have a tolerance of 2px to account for
649
- * sub pixel rendering.
650
- *
651
- * Check below the next line ensures that we did not
652
- * swipe and abort (i.e. we swiped but we are still on the current month).
653
- */
654
- const condition = isRTL(this.el) ? calendarBodyRef.scrollLeft >= -2 : calendarBodyRef.scrollLeft <= 2;
655
- const month = condition ? startMonth : endMonth;
656
- /**
657
- * The edge of the month must be lined up with
658
- * the edge of the calendar body in order for
659
- * the component to update. Otherwise, it
660
- * may be the case that the user has paused their
661
- * swipe or the browser has not finished snapping yet.
662
- * Rather than check if the x values are equal,
663
- * we give it a tolerance of 2px to account for
664
- * sub pixel rendering.
665
- */
666
- const monthBox = month.getBoundingClientRect();
667
- if (Math.abs(monthBox.x - box.x) > 2)
668
- return;
669
- /**
670
- * If we're force-rendering a month, assume we've
671
- * scrolled to that and return it.
672
- *
673
- * If forceRenderDate is ever used in a context where the
674
- * forced month is not immediately auto-scrolled to, this
675
- * should be updated to also check whether `month` has the
676
- * same month and year as the forced date.
677
- */
678
- const { forceRenderDate } = this;
679
- if (forceRenderDate !== undefined) {
680
- return { month: forceRenderDate.month, year: forceRenderDate.year, day: forceRenderDate.day };
681
- }
682
- /**
683
- * From here, we can determine if the start
684
- * month or the end month was scrolled into view.
685
- * If no month was changed, then we can return from
686
- * the scroll callback early.
687
- */
688
- if (month === startMonth) {
689
- return getPreviousMonth(parts);
690
- }
691
- else if (month === endMonth) {
692
- return getNextMonth(parts);
693
- }
694
- else {
695
- return;
696
- }
697
- };
698
- const updateActiveMonth = () => {
699
- if (needsiOSRubberBandFix) {
700
- calendarBodyRef.style.removeProperty('pointer-events');
701
- appliediOSRubberBandFix = false;
702
- }
703
- /**
704
- * If the month did not change
705
- * then we can return early.
706
- */
707
- const newDate = getChangedMonth(this.workingParts);
708
- if (!newDate)
709
- return;
710
- const { month, day, year } = newDate;
711
- if (isMonthDisabled({ month, year, day: null }, {
712
- minParts: Object.assign(Object.assign({}, this.minParts), { day: null }),
713
- maxParts: Object.assign(Object.assign({}, this.maxParts), { day: null }),
714
- })) {
715
- return;
716
- }
717
- /**
718
- * Prevent scrolling for other browsers
719
- * to give the DOM time to update and the container
720
- * time to properly snap.
721
- */
722
- calendarBodyRef.style.setProperty('overflow', 'hidden');
723
- /**
724
- * Use a writeTask here to ensure
725
- * that the state is updated and the
726
- * correct month is scrolled into view
727
- * in the same frame. This is not
728
- * typically a problem on newer devices
729
- * but older/slower device may have a flicker
730
- * if we did not do this.
731
- */
732
- writeTask(() => {
733
- this.setWorkingParts(Object.assign(Object.assign({}, this.workingParts), { month, day: day, year }));
734
- calendarBodyRef.scrollLeft = workingMonth.clientWidth * (isRTL(this.el) ? -1 : 1);
735
- calendarBodyRef.style.removeProperty('overflow');
736
- if (this.resolveForceDateScrolling) {
737
- this.resolveForceDateScrolling();
738
- }
739
- });
740
- };
741
- /**
742
- * When the container finishes scrolling we
743
- * need to update the DOM with the selected month.
744
- */
745
- let scrollTimeout;
746
- /**
747
- * We do not want to attempt to set pointer-events
748
- * multiple times within a single swipe gesture as
749
- * that adds unnecessary work to the main thread.
750
- */
751
- let appliediOSRubberBandFix = false;
752
- const scrollCallback = () => {
753
- if (scrollTimeout) {
754
- clearTimeout(scrollTimeout);
755
- }
756
- /**
757
- * On iOS it is possible to quickly rubber band
758
- * the scroll area before the scroll timeout has fired.
759
- * This results in users reaching the end of the scrollable
760
- * container before the DOM has updated.
761
- * By setting `pointer-events: none` we can ensure that
762
- * subsequent swipes do not happen while the container
763
- * is snapping.
764
- */
765
- if (!appliediOSRubberBandFix && needsiOSRubberBandFix) {
766
- calendarBodyRef.style.setProperty('pointer-events', 'none');
767
- appliediOSRubberBandFix = true;
768
- }
769
- // Wait ~3 frames
770
- scrollTimeout = setTimeout(updateActiveMonth, 50);
771
- };
772
- calendarBodyRef.addEventListener('scroll', scrollCallback);
773
- this.destroyCalendarListener = () => {
774
- calendarBodyRef.removeEventListener('scroll', scrollCallback);
775
- };
776
- });
777
- };
778
- /**
779
- * Clean up all listeners except for the overlay
780
- * listener. This is so that we can re-create the listeners
781
- * if the datetime has been hidden/presented by a modal or popover.
782
- */
783
- this.destroyInteractionListeners = () => {
784
- const { destroyCalendarListener, destroyKeyboardMO } = this;
785
- if (destroyCalendarListener !== undefined) {
786
- destroyCalendarListener();
787
- }
788
- if (destroyKeyboardMO !== undefined) {
789
- destroyKeyboardMO();
790
- }
791
- };
792
- /**
793
- * TODO(FW-6931): Remove this fallback upon solving the root cause
794
- * Fallback to ensure the datetime becomes ready even if
795
- * IntersectionObserver never reports it as intersecting.
796
- *
797
- * This is primarily used in environments where the observer
798
- * might not fire as expected, such as when running under
799
- * synthetic tests that stub IntersectionObserver.
800
- */
801
- this.ensureReadyIfVisible = () => {
802
- if (this.el.classList.contains('datetime-ready')) {
803
- return;
804
- }
805
- const rect = this.el.getBoundingClientRect();
806
- if (rect.width === 0 || rect.height === 0) {
807
- return;
808
- }
809
- this.initializeListeners();
810
- writeTask(() => {
811
- this.el.classList.add('datetime-ready');
812
- });
813
- };
814
- this.processValue = (value) => {
815
- const hasValue = value !== null && value !== undefined && value !== '' && (!Array.isArray(value) || value.length > 0);
816
- const valueToProcess = hasValue ? parseDate(value) : this.defaultParts;
817
- const { minParts, maxParts, workingParts, el } = this;
818
- this.warnIfIncorrectValueUsage();
819
- /**
820
- * Return early if the value wasn't parsed correctly, such as
821
- * if an improperly formatted date string was provided.
822
- */
823
- if (!valueToProcess) {
824
- return;
825
- }
826
- /**
827
- * Datetime should only warn of out of bounds values
828
- * if set by the user. If the `value` is undefined,
829
- * we will default to today's date which may be out
830
- * of bounds. In this case, the warning makes it look
831
- * like the developer did something wrong which is
832
- * not true.
833
- */
834
- if (hasValue) {
835
- warnIfValueOutOfBounds(valueToProcess, minParts, maxParts);
836
- }
837
- /**
838
- * If there are multiple values, clamp to the last one.
839
- * This is because the last value is the one that the user
840
- * has most recently interacted with.
841
- */
842
- const singleValue = Array.isArray(valueToProcess) ? valueToProcess[valueToProcess.length - 1] : valueToProcess;
843
- const targetValue = clampDate(singleValue, minParts, maxParts);
844
- const { month, day, year, hour, minute } = targetValue;
845
- const ampm = parseAmPm(hour);
846
- /**
847
- * Since `activeParts` indicates a value that been explicitly selected
848
- * either by the user or the app, only update `activeParts` if the
849
- * `value` property is set.
850
- */
851
- if (hasValue) {
852
- if (Array.isArray(valueToProcess)) {
853
- this.activeParts = [...valueToProcess];
854
- }
855
- else {
856
- this.activeParts = {
857
- month,
858
- day,
859
- year,
860
- hour,
861
- minute,
862
- ampm,
863
- };
864
- }
865
- }
866
- else {
867
- /**
868
- * Reset the active parts if the value is not set.
869
- * This will clear the selected calendar day when
870
- * performing a clear action or using the reset() method.
871
- */
872
- this.activeParts = [];
873
- }
874
- const didChangeMonth = (month !== undefined && month !== workingParts.month) || (year !== undefined && year !== workingParts.year);
875
- const bodyIsVisible = el.classList.contains('datetime-ready');
876
- const { isGridStyle, showMonthAndYear } = this;
877
- if (isGridStyle && didChangeMonth && bodyIsVisible && !showMonthAndYear) {
878
- /**
879
- * Only animate if:
880
- * 1. We're using grid style (wheel style pickers should just jump to new value)
881
- * 2. The month and/or year actually changed, and both are defined (otherwise there's nothing to animate to)
882
- * 3. The calendar body is visible (prevents animation when in collapsed datetime-button, for example)
883
- * 4. The month/year picker is not open (since you wouldn't see the animation anyway)
884
- */
885
- this.animateToDate(targetValue);
886
- }
887
- else {
888
- this.setWorkingParts({
889
- month,
890
- day,
891
- year,
892
- hour,
893
- minute,
894
- ampm,
895
- });
896
- }
897
- };
898
- this.animateToDate = async (targetValue) => {
899
- const { workingParts } = this;
900
- /**
901
- * Tell other render functions that we need to force the
902
- * target month to appear in place of the actual next/prev month.
903
- * Because this is a State variable, a rerender will be triggered
904
- * automatically, updating the rendered months.
905
- */
906
- this.forceRenderDate = targetValue;
907
- /**
908
- * Flag that we've started scrolling to the forced date.
909
- * The resolve function will be called by the datetime's
910
- * scroll listener when it's done updating everything.
911
- * This is a replacement for making prev/nextMonth async,
912
- * since the logic we're waiting on is in a listener.
913
- */
914
- const forceDateScrollingPromise = new Promise((resolve) => {
915
- this.resolveForceDateScrolling = resolve;
916
- });
917
- /**
918
- * Animate smoothly to the forced month. This will also update
919
- * workingParts and correct the surrounding months for us.
920
- */
921
- const targetMonthIsBefore = isBefore(targetValue, workingParts);
922
- targetMonthIsBefore ? this.prevMonth() : this.nextMonth();
923
- await forceDateScrollingPromise;
924
- this.resolveForceDateScrolling = undefined;
925
- this.forceRenderDate = undefined;
926
- };
927
- this.onFocus = () => {
928
- this.ionFocus.emit();
929
- };
930
- this.onBlur = () => {
931
- this.ionBlur.emit();
932
- };
933
- this.hasValue = () => {
934
- return this.value != null;
935
- };
936
- this.nextMonth = () => {
937
- const calendarBodyRef = this.calendarBodyRef;
938
- if (!calendarBodyRef) {
939
- return;
940
- }
941
- const nextMonth = calendarBodyRef.querySelector('.calendar-month:last-of-type');
942
- if (!nextMonth) {
943
- return;
944
- }
945
- const left = nextMonth.offsetWidth * 2;
946
- calendarBodyRef.scrollTo({
947
- top: 0,
948
- left: left * (isRTL(this.el) ? -1 : 1),
949
- behavior: 'smooth',
950
- });
951
- };
952
- this.prevMonth = () => {
953
- const calendarBodyRef = this.calendarBodyRef;
954
- if (!calendarBodyRef) {
955
- return;
956
- }
957
- const prevMonth = calendarBodyRef.querySelector('.calendar-month:first-of-type');
958
- if (!prevMonth) {
959
- return;
960
- }
961
- calendarBodyRef.scrollTo({
962
- top: 0,
963
- left: 0,
964
- behavior: 'smooth',
965
- });
966
- };
967
- this.toggleMonthAndYearView = () => {
968
- this.showMonthAndYear = !this.showMonthAndYear;
969
- };
970
- }
971
- formatOptionsChanged() {
972
- const { el, formatOptions, presentation } = this;
973
- checkForPresentationFormatMismatch(el, presentation, formatOptions);
974
- warnIfTimeZoneProvided(el, formatOptions);
975
- }
976
- disabledChanged() {
977
- this.emitStyle();
978
- }
979
- minChanged() {
980
- this.processMinParts();
981
- }
982
- maxChanged() {
983
- this.processMaxParts();
984
- }
985
- presentationChanged() {
986
- const { el, formatOptions, presentation } = this;
987
- checkForPresentationFormatMismatch(el, presentation, formatOptions);
988
- }
989
- get isGridStyle() {
990
- const { presentation, preferWheel } = this;
991
- const hasDatePresentation = presentation === 'date' || presentation === 'date-time' || presentation === 'time-date';
992
- return hasDatePresentation && !preferWheel;
993
- }
994
- yearValuesChanged() {
995
- this.parsedYearValues = convertToArrayOfNumbers(this.yearValues);
996
- }
997
- monthValuesChanged() {
998
- this.parsedMonthValues = convertToArrayOfNumbers(this.monthValues);
999
- }
1000
- dayValuesChanged() {
1001
- this.parsedDayValues = convertToArrayOfNumbers(this.dayValues);
1002
- }
1003
- hourValuesChanged() {
1004
- this.parsedHourValues = convertToArrayOfNumbers(this.hourValues);
1005
- }
1006
- minuteValuesChanged() {
1007
- this.parsedMinuteValues = convertToArrayOfNumbers(this.minuteValues);
1008
- }
1009
- /**
1010
- * Update the datetime value when the value changes
1011
- */
1012
- async valueChanged() {
1013
- const { value } = this;
1014
- if (this.hasValue()) {
1015
- this.processValue(value);
1016
- }
1017
- this.emitStyle();
1018
- this.ionValueChange.emit({ value });
1019
- }
1020
- /**
1021
- * Confirms the selected datetime value, updates the
1022
- * `value` property, and optionally closes the popover
1023
- * or modal that the datetime was presented in.
1024
- *
1025
- * @param closeOverlay If `true`, closes the parent overlay. Defaults to `false`.
1026
- */
1027
- async confirm(closeOverlay = false) {
1028
- const { isCalendarPicker, activeParts, preferWheel, workingParts } = this;
1029
- /**
1030
- * We only update the value if the presentation is not a calendar picker.
1031
- */
1032
- if (activeParts !== undefined || !isCalendarPicker) {
1033
- const activePartsIsArray = Array.isArray(activeParts);
1034
- if (activePartsIsArray && activeParts.length === 0) {
1035
- if (preferWheel) {
1036
- /**
1037
- * If the datetime is using a wheel picker, but the
1038
- * active parts are empty, then the user has confirmed the
1039
- * initial value (working parts) presented to them.
1040
- */
1041
- this.setValue(convertDataToISO(workingParts));
1042
- }
1043
- else {
1044
- this.setValue(undefined);
1045
- }
1046
- }
1047
- else {
1048
- this.setValue(convertDataToISO(activeParts));
1049
- }
1050
- }
1051
- if (closeOverlay) {
1052
- this.closeParentOverlay(CONFIRM_ROLE);
1053
- }
1054
- }
1055
- /**
1056
- * Resets the internal state of the datetime but does not update the value.
1057
- * Passing a valid ISO-8601 string will reset the state of the component to the provided date.
1058
- * If no value is provided, the internal state will be reset to the clamped value of the min, max and today.
1059
- *
1060
- * @param startDate A valid [ISO-8601 string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date#date_time_string_format) to reset the datetime state to.
1061
- */
1062
- async reset(startDate) {
1063
- this.processValue(startDate);
1064
- }
1065
- /**
1066
- * Emits the ionCancel event and
1067
- * optionally closes the popover
1068
- * or modal that the datetime was
1069
- * presented in.
1070
- *
1071
- * @param closeOverlay If `true`, closes the parent overlay. Defaults to `false`.
1072
- */
1073
- async cancel(closeOverlay = false) {
1074
- this.ionCancel.emit();
1075
- if (closeOverlay) {
1076
- this.closeParentOverlay(CANCEL_ROLE);
1077
- }
1078
- }
1079
- get isCalendarPicker() {
1080
- const { presentation } = this;
1081
- return presentation === 'date' || presentation === 'date-time' || presentation === 'time-date';
1082
- }
1083
- connectedCallback() {
1084
- this.clearFocusVisible = startFocusVisible(this.el).destroy;
1085
- }
1086
- disconnectedCallback() {
1087
- if (this.clearFocusVisible) {
1088
- this.clearFocusVisible();
1089
- this.clearFocusVisible = undefined;
1090
- }
1091
- if (this.loadTimeout) {
1092
- clearTimeout(this.loadTimeout);
1093
- }
1094
- }
1095
- initializeListeners() {
1096
- this.initializeCalendarListener();
1097
- this.initializeKeyboardListeners();
1098
- }
1099
- componentDidLoad() {
1100
- const { el, intersectionTrackerRef } = this;
1101
- /**
1102
- * If a scrollable element is hidden using `display: none`,
1103
- * it will not have a scroll height meaning we cannot scroll elements
1104
- * into view. As a result, we will need to wait for the datetime to become
1105
- * visible if used inside of a modal or a popover otherwise the scrollable
1106
- * areas will not have the correct values snapped into place.
1107
- */
1108
- const visibleCallback = (entries) => {
1109
- const ev = entries[0];
1110
- if (!ev.isIntersecting) {
1111
- return;
1112
- }
1113
- this.initializeListeners();
1114
- /**
1115
- * TODO FW-2793: Datetime needs a frame to ensure that it
1116
- * can properly scroll contents into view. As a result
1117
- * we hide the scrollable content until after that frame
1118
- * so users do not see the content quickly shifting. The downside
1119
- * is that the content will pop into view a frame after. Maybe there
1120
- * is a better way to handle this?
1121
- */
1122
- writeTask(() => {
1123
- this.el.classList.add('datetime-ready');
1124
- });
1125
- };
1126
- const visibleIO = new IntersectionObserver(visibleCallback, { threshold: 0.01, root: el });
1127
- /**
1128
- * Use raf to avoid a race condition between the component loading and
1129
- * its display animation starting (such as when shown in a modal). This
1130
- * could cause the datetime to start at a visibility of 0, erroneously
1131
- * triggering the `hiddenIO` observer below.
1132
- */
1133
- raf(() => visibleIO === null || visibleIO === void 0 ? void 0 : visibleIO.observe(intersectionTrackerRef));
1134
- /**
1135
- * TODO(FW-6931): Remove this fallback upon solving the root cause
1136
- * Fallback: If IntersectionObserver never reports that the
1137
- * datetime is visible but the host clearly has layout, ensure
1138
- * we still initialize listeners and mark the component as ready.
1139
- *
1140
- * We schedule this after everything has had a chance to run.
1141
- */
1142
- this.loadTimeout = setTimeout(() => {
1143
- this.ensureReadyIfVisible();
1144
- }, 100);
1145
- /**
1146
- * We need to clean up listeners when the datetime is hidden
1147
- * in a popover/modal so that we can properly scroll containers
1148
- * back into view if they are re-presented. When the datetime is hidden
1149
- * the scroll areas have scroll widths/heights of 0px, so any snapping
1150
- * we did originally has been lost.
1151
- */
1152
- const hiddenCallback = (entries) => {
1153
- const ev = entries[0];
1154
- if (ev.isIntersecting) {
1155
- return;
1156
- }
1157
- this.destroyInteractionListeners();
1158
- /**
1159
- * When datetime is hidden, we need to make sure that
1160
- * the month/year picker is closed. Otherwise,
1161
- * it will be open when the datetime re-appears
1162
- * and the scroll area of the calendar grid will be 0.
1163
- * As a result, the wrong month will be shown.
1164
- */
1165
- this.showMonthAndYear = false;
1166
- writeTask(() => {
1167
- this.el.classList.remove('datetime-ready');
1168
- });
1169
- };
1170
- const hiddenIO = new IntersectionObserver(hiddenCallback, { threshold: 0, root: el });
1171
- raf(() => hiddenIO === null || hiddenIO === void 0 ? void 0 : hiddenIO.observe(intersectionTrackerRef));
1172
- /**
1173
- * Datetime uses Ionic components that emit
1174
- * ionFocus and ionBlur. These events are
1175
- * composed meaning they will cross
1176
- * the shadow dom boundary. We need to
1177
- * stop propagation on these events otherwise
1178
- * developers will see 2 ionFocus or 2 ionBlur
1179
- * events at a time.
1180
- */
1181
- const root = getElementRoot(this.el);
1182
- root.addEventListener('ionFocus', (ev) => ev.stopPropagation());
1183
- root.addEventListener('ionBlur', (ev) => ev.stopPropagation());
1184
- }
1185
- /**
1186
- * When the presentation is changed, all calendar content is recreated,
1187
- * so we need to re-init behavior with the new elements.
1188
- */
1189
- componentDidRender() {
1190
- const { presentation, prevPresentation, calendarBodyRef, minParts, preferWheel, forceRenderDate } = this;
1191
- /**
1192
- * TODO(FW-2165)
1193
- * Remove this when https://bugs.webkit.org/show_bug.cgi?id=235960 is fixed.
1194
- * When using `min`, we add `scroll-snap-align: none`
1195
- * to the disabled month so that users cannot scroll to it.
1196
- * This triggers a bug in WebKit where the scroll position is reset.
1197
- * Since the month change logic is handled by a scroll listener,
1198
- * this causes the month to change leading to `scroll-snap-align`
1199
- * changing again, thus changing the scroll position again and causing
1200
- * an infinite loop.
1201
- * This issue only applies to the calendar grid, so we can disable
1202
- * it if the calendar grid is not being used.
1203
- */
1204
- const hasCalendarGrid = !preferWheel && ['date-time', 'time-date', 'date'].includes(presentation);
1205
- if (minParts !== undefined && hasCalendarGrid && calendarBodyRef) {
1206
- const workingMonth = calendarBodyRef.querySelector('.calendar-month:nth-of-type(1)');
1207
- /**
1208
- * We need to make sure the datetime is not in the process
1209
- * of scrolling to a new datetime value if the value
1210
- * is updated programmatically.
1211
- * Otherwise, the datetime will appear to not scroll at all because
1212
- * we are resetting the scroll position to the center of the view.
1213
- * Prior to the datetime's value being updated programmatically,
1214
- * the calendarBodyRef is scrolled such that the middle month is centered
1215
- * in the view. The below code updates the scroll position so the middle
1216
- * month is also centered in the view. Since the scroll position did not change,
1217
- * the scroll callback in this file does not fire,
1218
- * and the resolveForceDateScrolling promise never resolves.
1219
- */
1220
- if (workingMonth && forceRenderDate === undefined) {
1221
- calendarBodyRef.scrollLeft = workingMonth.clientWidth * (isRTL(this.el) ? -1 : 1);
1222
- }
1223
- }
1224
- if (prevPresentation === null) {
1225
- this.prevPresentation = presentation;
1226
- return;
1227
- }
1228
- if (presentation === prevPresentation) {
1229
- return;
1230
- }
1231
- this.prevPresentation = presentation;
1232
- this.destroyInteractionListeners();
1233
- this.initializeListeners();
1234
- /**
1235
- * The month/year picker from the date interface
1236
- * should be closed as it is not available in non-date
1237
- * interfaces.
1238
- */
1239
- this.showMonthAndYear = false;
1240
- raf(() => {
1241
- this.ionRender.emit();
1242
- });
1243
- }
1244
- componentWillLoad() {
1245
- const { el, formatOptions, highlightedDates, multiple, presentation, preferWheel } = this;
1246
- if (multiple) {
1247
- if (presentation !== 'date') {
1248
- printIonWarning('[ion-datetime] - Multiple date selection is only supported for presentation="date".', el);
1249
- }
1250
- if (preferWheel) {
1251
- printIonWarning('[ion-datetime] - Multiple date selection is not supported with preferWheel="true".', el);
1252
- }
1253
- }
1254
- if (highlightedDates !== undefined) {
1255
- if (presentation !== 'date' && presentation !== 'date-time' && presentation !== 'time-date') {
1256
- printIonWarning('[ion-datetime] - The highlightedDates property is only supported with the date, date-time, and time-date presentations.', el);
1257
- }
1258
- if (preferWheel) {
1259
- printIonWarning('[ion-datetime] - The highlightedDates property is not supported with preferWheel="true".', el);
1260
- }
1261
- }
1262
- if (formatOptions) {
1263
- checkForPresentationFormatMismatch(el, presentation, formatOptions);
1264
- warnIfTimeZoneProvided(el, formatOptions);
1265
- }
1266
- const hourValues = (this.parsedHourValues = convertToArrayOfNumbers(this.hourValues));
1267
- const minuteValues = (this.parsedMinuteValues = convertToArrayOfNumbers(this.minuteValues));
1268
- const monthValues = (this.parsedMonthValues = convertToArrayOfNumbers(this.monthValues));
1269
- const yearValues = (this.parsedYearValues = convertToArrayOfNumbers(this.yearValues));
1270
- const dayValues = (this.parsedDayValues = convertToArrayOfNumbers(this.dayValues));
1271
- const todayParts = (this.todayParts = parseDate(getToday()));
1272
- this.processMinParts();
1273
- this.processMaxParts();
1274
- this.defaultParts = getClosestValidDate({
1275
- refParts: todayParts,
1276
- monthValues,
1277
- dayValues,
1278
- yearValues,
1279
- hourValues,
1280
- minuteValues,
1281
- minParts: this.minParts,
1282
- maxParts: this.maxParts,
1283
- });
1284
- this.processValue(this.value);
1285
- this.emitStyle();
1286
- }
1287
- emitStyle() {
1288
- this.ionStyle.emit({
1289
- interactive: true,
1290
- datetime: true,
1291
- 'interactive-disabled': this.disabled,
1292
- });
1293
- }
1294
- /**
1295
- * Universal render methods
1296
- * These are pieces of datetime that
1297
- * are rendered independently of presentation.
1298
- */
1299
- renderFooter() {
1300
- const { disabled, readonly, showDefaultButtons, showClearButton } = this;
1301
- /**
1302
- * The cancel, clear, and confirm buttons
1303
- * should not be interactive if the datetime
1304
- * is disabled or readonly.
1305
- */
1306
- const isButtonDisabled = disabled || readonly;
1307
- const hasSlottedButtons = this.el.querySelector('[slot="buttons"]') !== null;
1308
- if (!hasSlottedButtons && !showDefaultButtons && !showClearButton) {
1309
- return;
1310
- }
1311
- const clearButtonClick = () => {
1312
- this.reset();
1313
- this.setValue(undefined);
1314
- };
1315
- /**
1316
- * By default we render two buttons:
1317
- * Cancel - Dismisses the datetime and
1318
- * does not update the `value` prop.
1319
- * OK - Dismisses the datetime and
1320
- * updates the `value` prop.
1321
- */
1322
- return (h("div", { class: "datetime-footer" }, h("div", { class: "datetime-buttons" }, h("div", { class: {
1323
- ['datetime-action-buttons']: true,
1324
- ['has-clear-button']: this.showClearButton,
1325
- } }, h("slot", { name: "buttons" }, h("ion-buttons", null, showDefaultButtons && (h("ion-button", { id: "cancel-button", color: this.color, onClick: () => this.cancel(true), disabled: isButtonDisabled }, this.cancelText)), h("div", { class: "datetime-action-buttons-container" }, showClearButton && (h("ion-button", { id: "clear-button", color: this.color, onClick: () => clearButtonClick(), disabled: isButtonDisabled }, this.clearText)), showDefaultButtons && (h("ion-button", { id: "confirm-button", color: this.color, onClick: () => this.confirm(true), disabled: isButtonDisabled }, this.doneText)))))))));
1326
- }
1327
- /**
1328
- * Wheel picker render methods
1329
- */
1330
- renderWheelPicker(forcePresentation = this.presentation) {
1331
- /**
1332
- * If presentation="time-date" we switch the
1333
- * order of the render array here instead of
1334
- * manually reordering each date/time picker
1335
- * column with CSS. This allows for additional
1336
- * flexibility if we need to render subsets
1337
- * of the date/time data or do additional ordering
1338
- * within the child render functions.
1339
- */
1340
- const renderArray = forcePresentation === 'time-date'
1341
- ? [this.renderTimePickerColumns(forcePresentation), this.renderDatePickerColumns(forcePresentation)]
1342
- : [this.renderDatePickerColumns(forcePresentation), this.renderTimePickerColumns(forcePresentation)];
1343
- return h("ion-picker", { class: FOCUS_TRAP_DISABLE_CLASS }, renderArray);
1344
- }
1345
- renderDatePickerColumns(forcePresentation) {
1346
- return forcePresentation === 'date-time' || forcePresentation === 'time-date'
1347
- ? this.renderCombinedDatePickerColumn()
1348
- : this.renderIndividualDatePickerColumns(forcePresentation);
1349
- }
1350
- renderCombinedDatePickerColumn() {
1351
- const { defaultParts, disabled, workingParts, locale, minParts, maxParts, todayParts, isDateEnabled } = this;
1352
- const activePart = this.getActivePartsWithFallback();
1353
- /**
1354
- * By default, generate a range of 3 months:
1355
- * Previous month, current month, and next month
1356
- */
1357
- const monthsToRender = generateMonths(workingParts);
1358
- const lastMonth = monthsToRender[monthsToRender.length - 1];
1359
- /**
1360
- * Ensure that users can select the entire window of dates.
1361
- */
1362
- monthsToRender[0].day = 1;
1363
- lastMonth.day = getNumDaysInMonth(lastMonth.month, lastMonth.year);
1364
- /**
1365
- * Narrow the dates rendered based on min/max dates (if any).
1366
- * The `min` date is used if the min is after the generated min month.
1367
- * The `max` date is used if the max is before the generated max month.
1368
- * This ensures that the sliding window always stays at 3 months
1369
- * but still allows future dates to be lazily rendered based on any min/max
1370
- * constraints.
1371
- */
1372
- const min = minParts !== undefined && isAfter(minParts, monthsToRender[0]) ? minParts : monthsToRender[0];
1373
- const max = maxParts !== undefined && isBefore(maxParts, lastMonth) ? maxParts : lastMonth;
1374
- const result = getCombinedDateColumnData(locale, todayParts, min, max, this.parsedDayValues, this.parsedMonthValues);
1375
- let items = result.items;
1376
- const parts = result.parts;
1377
- if (isDateEnabled) {
1378
- items = items.map((itemObject, index) => {
1379
- const referenceParts = parts[index];
1380
- let disabled;
1381
- try {
1382
- /**
1383
- * The `isDateEnabled` implementation is try-catch wrapped
1384
- * to prevent exceptions in the user's function from
1385
- * interrupting the calendar rendering.
1386
- */
1387
- disabled = !isDateEnabled(convertDataToISO(referenceParts));
1388
- }
1389
- catch (e) {
1390
- printIonError('[ion-datetime] - Exception thrown from provided `isDateEnabled` function. Please check your function and try again.', e);
1391
- }
1392
- return Object.assign(Object.assign({}, itemObject), { disabled });
1393
- });
1394
- }
1395
- /**
1396
- * If we have selected a day already, then default the column
1397
- * to that value. Otherwise, set it to the default date.
1398
- */
1399
- const todayString = workingParts.day !== null
1400
- ? `${workingParts.year}-${workingParts.month}-${workingParts.day}`
1401
- : `${defaultParts.year}-${defaultParts.month}-${defaultParts.day}`;
1402
- return (h("ion-picker-column", { "aria-label": "Select a date", class: "date-column", color: this.color, disabled: disabled, value: todayString, onIonChange: (ev) => {
1403
- const { value } = ev.detail;
1404
- const findPart = parts.find(({ month, day, year }) => value === `${year}-${month}-${day}`);
1405
- this.setWorkingParts(Object.assign(Object.assign({}, workingParts), findPart));
1406
- this.setActiveParts(Object.assign(Object.assign({}, activePart), findPart));
1407
- ev.stopPropagation();
1408
- } }, items.map((item) => (h("ion-picker-column-option", { part: item.value === todayString ? `${WHEEL_ITEM_PART} ${WHEEL_ITEM_ACTIVE_PART}` : WHEEL_ITEM_PART, key: item.value, disabled: item.disabled, value: item.value }, item.text)))));
1409
- }
1410
- renderIndividualDatePickerColumns(forcePresentation) {
1411
- const { workingParts, isDateEnabled } = this;
1412
- const shouldRenderMonths = forcePresentation !== 'year' && forcePresentation !== 'time';
1413
- const months = shouldRenderMonths
1414
- ? getMonthColumnData(this.locale, workingParts, this.minParts, this.maxParts, this.parsedMonthValues)
1415
- : [];
1416
- const shouldRenderDays = forcePresentation === 'date';
1417
- let days = shouldRenderDays
1418
- ? getDayColumnData(this.locale, workingParts, this.minParts, this.maxParts, this.parsedDayValues)
1419
- : [];
1420
- if (isDateEnabled) {
1421
- days = days.map((dayObject) => {
1422
- const { value } = dayObject;
1423
- const valueNum = typeof value === 'string' ? parseInt(value) : value;
1424
- const referenceParts = {
1425
- month: workingParts.month,
1426
- day: valueNum,
1427
- year: workingParts.year,
1428
- };
1429
- let disabled;
1430
- try {
1431
- /**
1432
- * The `isDateEnabled` implementation is try-catch wrapped
1433
- * to prevent exceptions in the user's function from
1434
- * interrupting the calendar rendering.
1435
- */
1436
- disabled = !isDateEnabled(convertDataToISO(referenceParts));
1437
- }
1438
- catch (e) {
1439
- printIonError('[ion-datetime] - Exception thrown from provided `isDateEnabled` function. Please check your function and try again.', e);
1440
- }
1441
- return Object.assign(Object.assign({}, dayObject), { disabled });
1442
- });
1443
- }
1444
- const shouldRenderYears = forcePresentation !== 'month' && forcePresentation !== 'time';
1445
- const years = shouldRenderYears
1446
- ? getYearColumnData(this.locale, this.defaultParts, this.minParts, this.maxParts, this.parsedYearValues)
1447
- : [];
1448
- /**
1449
- * Certain locales show the day before the month.
1450
- */
1451
- const showMonthFirst = isMonthFirstLocale(this.locale, { month: 'numeric', day: 'numeric' });
1452
- let renderArray = [];
1453
- if (showMonthFirst) {
1454
- renderArray = [
1455
- this.renderMonthPickerColumn(months),
1456
- this.renderDayPickerColumn(days),
1457
- this.renderYearPickerColumn(years),
1458
- ];
1459
- }
1460
- else {
1461
- renderArray = [
1462
- this.renderDayPickerColumn(days),
1463
- this.renderMonthPickerColumn(months),
1464
- this.renderYearPickerColumn(years),
1465
- ];
1466
- }
1467
- return renderArray;
1468
- }
1469
- renderDayPickerColumn(days) {
1470
- var _a;
1471
- if (days.length === 0) {
1472
- return [];
1473
- }
1474
- const { disabled, workingParts } = this;
1475
- const activePart = this.getActivePartsWithFallback();
1476
- const pickerColumnValue = (_a = (workingParts.day !== null ? workingParts.day : this.defaultParts.day)) !== null && _a !== void 0 ? _a : undefined;
1477
- return (h("ion-picker-column", { "aria-label": "Select a day", class: "day-column", color: this.color, disabled: disabled, value: pickerColumnValue, onIonChange: (ev) => {
1478
- this.setWorkingParts(Object.assign(Object.assign({}, workingParts), { day: ev.detail.value }));
1479
- this.setActiveParts(Object.assign(Object.assign({}, activePart), { day: ev.detail.value }));
1480
- ev.stopPropagation();
1481
- } }, days.map((day) => (h("ion-picker-column-option", { part: day.value === pickerColumnValue ? `${WHEEL_ITEM_PART} ${WHEEL_ITEM_ACTIVE_PART}` : WHEEL_ITEM_PART, key: day.value, disabled: day.disabled, value: day.value }, day.text)))));
1482
- }
1483
- renderMonthPickerColumn(months) {
1484
- if (months.length === 0) {
1485
- return [];
1486
- }
1487
- const { disabled, workingParts } = this;
1488
- const activePart = this.getActivePartsWithFallback();
1489
- return (h("ion-picker-column", { "aria-label": "Select a month", class: "month-column", color: this.color, disabled: disabled, value: workingParts.month, onIonChange: (ev) => {
1490
- this.setWorkingParts(Object.assign(Object.assign({}, workingParts), { month: ev.detail.value }));
1491
- this.setActiveParts(Object.assign(Object.assign({}, activePart), { month: ev.detail.value }));
1492
- ev.stopPropagation();
1493
- } }, months.map((month) => (h("ion-picker-column-option", { part: month.value === workingParts.month ? `${WHEEL_ITEM_PART} ${WHEEL_ITEM_ACTIVE_PART}` : WHEEL_ITEM_PART, key: month.value, disabled: month.disabled, value: month.value }, month.text)))));
1494
- }
1495
- renderYearPickerColumn(years) {
1496
- if (years.length === 0) {
1497
- return [];
1498
- }
1499
- const { disabled, workingParts } = this;
1500
- const activePart = this.getActivePartsWithFallback();
1501
- return (h("ion-picker-column", { "aria-label": "Select a year", class: "year-column", color: this.color, disabled: disabled, value: workingParts.year, onIonChange: (ev) => {
1502
- this.setWorkingParts(Object.assign(Object.assign({}, workingParts), { year: ev.detail.value }));
1503
- this.setActiveParts(Object.assign(Object.assign({}, activePart), { year: ev.detail.value }));
1504
- ev.stopPropagation();
1505
- } }, years.map((year) => (h("ion-picker-column-option", { part: year.value === workingParts.year ? `${WHEEL_ITEM_PART} ${WHEEL_ITEM_ACTIVE_PART}` : WHEEL_ITEM_PART, key: year.value, disabled: year.disabled, value: year.value }, year.text)))));
1506
- }
1507
- renderTimePickerColumns(forcePresentation) {
1508
- if (['date', 'month', 'month-year', 'year'].includes(forcePresentation)) {
1509
- return [];
1510
- }
1511
- /**
1512
- * If a user has not selected a date,
1513
- * then we should show all times. If the
1514
- * user has selected a date (even if it has
1515
- * not been confirmed yet), we should apply
1516
- * the max and min restrictions so that the
1517
- * time picker shows values that are
1518
- * appropriate for the selected date.
1519
- */
1520
- const activePart = this.getActivePart();
1521
- const userHasSelectedDate = activePart !== undefined;
1522
- const { hoursData, minutesData, dayPeriodData } = getTimeColumnsData(this.locale, this.workingParts, this.hourCycle, userHasSelectedDate ? this.minParts : undefined, userHasSelectedDate ? this.maxParts : undefined, this.parsedHourValues, this.parsedMinuteValues);
1523
- return [
1524
- this.renderHourPickerColumn(hoursData),
1525
- this.renderMinutePickerColumn(minutesData),
1526
- this.renderDayPeriodPickerColumn(dayPeriodData),
1527
- ];
1528
- }
1529
- renderHourPickerColumn(hoursData) {
1530
- const { disabled, workingParts } = this;
1531
- if (hoursData.length === 0)
1532
- return [];
1533
- const activePart = this.getActivePartsWithFallback();
1534
- return (h("ion-picker-column", { "aria-label": "Select an hour", color: this.color, disabled: disabled, value: activePart.hour, numericInput: true, onIonChange: (ev) => {
1535
- this.setWorkingParts(Object.assign(Object.assign({}, workingParts), { hour: ev.detail.value }));
1536
- this.setActiveParts(Object.assign(Object.assign({}, this.getActivePartsWithFallback()), { hour: ev.detail.value }));
1537
- ev.stopPropagation();
1538
- } }, hoursData.map((hour) => (h("ion-picker-column-option", { part: hour.value === activePart.hour ? `${WHEEL_ITEM_PART} ${WHEEL_ITEM_ACTIVE_PART}` : WHEEL_ITEM_PART, key: hour.value, disabled: hour.disabled, value: hour.value }, hour.text)))));
1539
- }
1540
- renderMinutePickerColumn(minutesData) {
1541
- const { disabled, workingParts } = this;
1542
- if (minutesData.length === 0)
1543
- return [];
1544
- const activePart = this.getActivePartsWithFallback();
1545
- return (h("ion-picker-column", { "aria-label": "Select a minute", color: this.color, disabled: disabled, value: activePart.minute, numericInput: true, onIonChange: (ev) => {
1546
- this.setWorkingParts(Object.assign(Object.assign({}, workingParts), { minute: ev.detail.value }));
1547
- this.setActiveParts(Object.assign(Object.assign({}, this.getActivePartsWithFallback()), { minute: ev.detail.value }));
1548
- ev.stopPropagation();
1549
- } }, minutesData.map((minute) => (h("ion-picker-column-option", { part: minute.value === activePart.minute ? `${WHEEL_ITEM_PART} ${WHEEL_ITEM_ACTIVE_PART}` : WHEEL_ITEM_PART, key: minute.value, disabled: minute.disabled, value: minute.value }, minute.text)))));
1550
- }
1551
- renderDayPeriodPickerColumn(dayPeriodData) {
1552
- const { disabled, workingParts } = this;
1553
- if (dayPeriodData.length === 0) {
1554
- return [];
1555
- }
1556
- const activePart = this.getActivePartsWithFallback();
1557
- const isDayPeriodRTL = isLocaleDayPeriodRTL(this.locale);
1558
- return (h("ion-picker-column", { "aria-label": "Select a day period", style: isDayPeriodRTL ? { order: '-1' } : {}, color: this.color, disabled: disabled, value: activePart.ampm, onIonChange: (ev) => {
1559
- const hour = calculateHourFromAMPM(workingParts, ev.detail.value);
1560
- this.setWorkingParts(Object.assign(Object.assign({}, workingParts), { ampm: ev.detail.value, hour }));
1561
- this.setActiveParts(Object.assign(Object.assign({}, this.getActivePartsWithFallback()), { ampm: ev.detail.value, hour }));
1562
- ev.stopPropagation();
1563
- } }, dayPeriodData.map((dayPeriod) => (h("ion-picker-column-option", { part: dayPeriod.value === activePart.ampm ? `${WHEEL_ITEM_PART} ${WHEEL_ITEM_ACTIVE_PART}` : WHEEL_ITEM_PART, key: dayPeriod.value, disabled: dayPeriod.disabled, value: dayPeriod.value }, dayPeriod.text)))));
1564
- }
1565
- renderWheelView(forcePresentation) {
1566
- const { locale } = this;
1567
- const showMonthFirst = isMonthFirstLocale(locale);
1568
- const columnOrder = showMonthFirst ? 'month-first' : 'year-first';
1569
- return (h("div", { class: {
1570
- [`wheel-order-${columnOrder}`]: true,
1571
- } }, this.renderWheelPicker(forcePresentation)));
1572
- }
1573
- /**
1574
- * Grid Render Methods
1575
- */
1576
- renderCalendarHeader(mode) {
1577
- const { disabled } = this;
1578
- const expandedIcon = mode === 'ios' ? chevronDown : caretUpSharp;
1579
- const collapsedIcon = mode === 'ios' ? chevronForward : caretDownSharp;
1580
- const prevMonthDisabled = disabled || isPrevMonthDisabled(this.workingParts, this.minParts, this.maxParts);
1581
- const nextMonthDisabled = disabled || isNextMonthDisabled(this.workingParts, this.maxParts);
1582
- // don't use the inheritAttributes util because it removes dir from the host, and we still need that
1583
- const hostDir = this.el.getAttribute('dir') || undefined;
1584
- return (h("div", { class: "calendar-header" }, h("div", { class: "calendar-action-buttons" }, h("div", { class: "calendar-month-year" }, h("button", { class: {
1585
- 'calendar-month-year-toggle': true,
1586
- 'ion-activatable': true,
1587
- 'ion-focusable': true,
1588
- }, part: "month-year-button", disabled: disabled, "aria-label": this.showMonthAndYear ? 'Hide year picker' : 'Show year picker', onClick: () => this.toggleMonthAndYearView() }, h("span", { id: "toggle-wrapper" }, getMonthAndYear(this.locale, this.workingParts), h("ion-icon", { "aria-hidden": "true", icon: this.showMonthAndYear ? expandedIcon : collapsedIcon, lazy: false, flipRtl: true })), mode === 'md' && h("ion-ripple-effect", null))), h("div", { class: "calendar-next-prev" }, h("ion-buttons", null, h("ion-button", { "aria-label": "Previous month", disabled: prevMonthDisabled, onClick: () => this.prevMonth() }, h("ion-icon", { dir: hostDir, "aria-hidden": "true", slot: "icon-only", icon: chevronBack, lazy: false, flipRtl: true })), h("ion-button", { "aria-label": "Next month", disabled: nextMonthDisabled, onClick: () => this.nextMonth() }, h("ion-icon", { dir: hostDir, "aria-hidden": "true", slot: "icon-only", icon: chevronForward, lazy: false, flipRtl: true }))))), h("div", { class: "calendar-days-of-week", "aria-hidden": "true" }, getDaysOfWeek(this.locale, mode, this.firstDayOfWeek % 7).map((d) => {
1589
- return h("div", { class: "day-of-week" }, d);
1590
- }))));
1591
- }
1592
- renderMonth(month, year) {
1593
- const { disabled, readonly } = this;
1594
- const yearAllowed = this.parsedYearValues === undefined || this.parsedYearValues.includes(year);
1595
- const monthAllowed = this.parsedMonthValues === undefined || this.parsedMonthValues.includes(month);
1596
- const isCalMonthDisabled = !yearAllowed || !monthAllowed;
1597
- const isDatetimeDisabled = disabled || readonly;
1598
- const swipeDisabled = disabled ||
1599
- isMonthDisabled({
1600
- month,
1601
- year,
1602
- day: null,
1603
- }, {
1604
- // The day is not used when checking if a month is disabled.
1605
- // Users should be able to access the min or max month, even if the
1606
- // min/max date is out of bounds (e.g. min is set to Feb 15, Feb should not be disabled).
1607
- minParts: Object.assign(Object.assign({}, this.minParts), { day: null }),
1608
- maxParts: Object.assign(Object.assign({}, this.maxParts), { day: null }),
1609
- });
1610
- // The working month should never have swipe disabled.
1611
- // Otherwise the CSS scroll snap will not work and the user
1612
- // can free-scroll the calendar.
1613
- const isWorkingMonth = this.workingParts.month === month && this.workingParts.year === year;
1614
- const activePart = this.getActivePartsWithFallback();
1615
- return (h("div", { "aria-hidden": !isWorkingMonth ? 'true' : null, class: {
1616
- 'calendar-month': true,
1617
- // Prevents scroll snap swipe gestures for months outside of the min/max bounds
1618
- 'calendar-month-disabled': !isWorkingMonth && swipeDisabled,
1619
- } }, h("div", { class: "calendar-month-grid" }, getDaysOfMonth(month, year, this.firstDayOfWeek % 7, this.showAdjacentDays).map((dateObject, index) => {
1620
- const { day, dayOfWeek, isAdjacentDay } = dateObject;
1621
- const { el, highlightedDates, isDateEnabled, multiple, showAdjacentDays } = this;
1622
- let _month = month;
1623
- let _year = year;
1624
- if (showAdjacentDays && isAdjacentDay && day !== null) {
1625
- if (day > 20) {
1626
- // Leading with the adjacent day from the previous month
1627
- // if its a adjacent day and is higher than '20' (last week even in feb)
1628
- if (month === 1) {
1629
- _year = year - 1;
1630
- _month = 12;
1631
- }
1632
- else {
1633
- _month = month - 1;
1634
- }
1635
- }
1636
- else if (day < 15) {
1637
- // Leading with the adjacent day from the next month
1638
- // if its a adjacent day and is lower than '15' (first two weeks)
1639
- if (month === 12) {
1640
- _year = year + 1;
1641
- _month = 1;
1642
- }
1643
- else {
1644
- _month = month + 1;
1645
- }
1646
- }
1647
- }
1648
- const referenceParts = { month: _month, day, year: _year, isAdjacentDay };
1649
- const isCalendarPadding = day === null;
1650
- const { isActive, isToday, ariaLabel, ariaSelected, disabled: isDayDisabled, text, } = getCalendarDayState(this.locale, referenceParts, this.activeParts, this.todayParts, this.minParts, this.maxParts, this.parsedDayValues);
1651
- const dateIsoString = convertDataToISO(referenceParts);
1652
- let isCalDayDisabled = isCalMonthDisabled || isDayDisabled;
1653
- if (!isCalDayDisabled && isDateEnabled !== undefined) {
1654
- try {
1655
- /**
1656
- * The `isDateEnabled` implementation is try-catch wrapped
1657
- * to prevent exceptions in the user's function from
1658
- * interrupting the calendar rendering.
1659
- */
1660
- isCalDayDisabled = !isDateEnabled(dateIsoString);
1661
- }
1662
- catch (e) {
1663
- printIonError('[ion-datetime] - Exception thrown from provided `isDateEnabled` function. Please check your function and try again.', el, e);
1664
- }
1665
- }
1666
- /**
1667
- * Some days are constrained through max & min or allowed dates
1668
- * and also disabled because the component is readonly or disabled.
1669
- * These need to be displayed differently.
1670
- */
1671
- const isCalDayConstrained = isCalDayDisabled && isDatetimeDisabled;
1672
- const isButtonDisabled = isCalDayDisabled || isDatetimeDisabled;
1673
- let dateStyle = undefined;
1674
- /**
1675
- * Custom highlight styles should not override the style for selected dates,
1676
- * nor apply to "filler days" at the start of the grid.
1677
- */
1678
- if (highlightedDates !== undefined && !isActive && day !== null && !isAdjacentDay) {
1679
- dateStyle = getHighlightStyles(highlightedDates, dateIsoString, el);
1680
- }
1681
- let dateParts = undefined;
1682
- // "Filler days" at the beginning of the grid should not get the calendar day
1683
- // CSS parts added to them
1684
- if (!isCalendarPadding && !isAdjacentDay) {
1685
- dateParts = `calendar-day${isActive ? ' active' : ''}${isToday ? ' today' : ''}${isCalDayDisabled ? ' disabled' : ''}`;
1686
- }
1687
- else if (isAdjacentDay) {
1688
- dateParts = `calendar-day${isCalDayDisabled ? ' disabled' : ''}`;
1689
- }
1690
- return (h("div", { class: "calendar-day-wrapper" }, h("button", {
1691
- // We need to use !important for the inline styles here because
1692
- // otherwise the CSS shadow parts will override these styles.
1693
- // See https://github.com/WICG/webcomponents/issues/847
1694
- // Both the CSS shadow parts and highlightedDates styles are
1695
- // provided by the developer, but highlightedDates styles should
1696
- // always take priority.
1697
- ref: (el) => {
1698
- if (el) {
1699
- el.style.setProperty('color', `${dateStyle ? dateStyle.textColor : ''}`, 'important');
1700
- el.style.setProperty('background-color', `${dateStyle ? dateStyle.backgroundColor : ''}`, 'important');
1701
- el.style.setProperty('border', `${dateStyle ? dateStyle.border : ''}`, 'important');
1702
- }
1703
- }, tabindex: "-1", "data-day": day, "data-month": _month, "data-year": _year, "data-index": index, "data-day-of-week": dayOfWeek, disabled: isButtonDisabled, class: {
1704
- 'calendar-day-padding': isCalendarPadding,
1705
- 'calendar-day': true,
1706
- 'calendar-day-active': isActive,
1707
- 'calendar-day-constrained': isCalDayConstrained,
1708
- 'calendar-day-today': isToday,
1709
- 'calendar-day-adjacent-day': isAdjacentDay,
1710
- }, part: dateParts, "aria-hidden": isCalendarPadding ? 'true' : null, "aria-selected": ariaSelected, "aria-label": ariaLabel, onClick: () => {
1711
- if (isCalendarPadding) {
1712
- return;
1713
- }
1714
- if (isAdjacentDay) {
1715
- // The user selected a day outside the current month. Ignore this button, as the month will be re-rendered.
1716
- this.el.blur();
1717
- this.activeParts = Object.assign(Object.assign({}, activePart), referenceParts);
1718
- this.animateToDate(referenceParts);
1719
- this.confirm();
1720
- }
1721
- else {
1722
- this.setWorkingParts(Object.assign(Object.assign({}, this.workingParts), referenceParts));
1723
- // Multiple only needs date info so we can wipe out other fields like time.
1724
- if (multiple) {
1725
- this.setActiveParts(referenceParts, isActive);
1726
- }
1727
- else {
1728
- this.setActiveParts(Object.assign(Object.assign({}, activePart), referenceParts));
1729
- }
1730
- }
1731
- }
1732
- }, text)));
1733
- }))));
1734
- }
1735
- renderCalendarBody() {
1736
- return (h("div", { class: "calendar-body ion-focusable", ref: (el) => (this.calendarBodyRef = el), tabindex: "0" }, generateMonths(this.workingParts, this.forceRenderDate).map(({ month, year }) => {
1737
- return this.renderMonth(month, year);
1738
- })));
1739
- }
1740
- renderCalendar(mode) {
1741
- return (h("div", { class: "datetime-calendar", key: "datetime-calendar" }, this.renderCalendarHeader(mode), this.renderCalendarBody()));
1742
- }
1743
- renderTimeLabel() {
1744
- const hasSlottedTimeLabel = this.el.querySelector('[slot="time-label"]') !== null;
1745
- if (!hasSlottedTimeLabel && !this.showDefaultTimeLabel) {
1746
- return;
1747
- }
1748
- return h("slot", { name: "time-label" }, "Time");
1749
- }
1750
- renderTimeOverlay() {
1751
- const { disabled, hourCycle, isTimePopoverOpen, locale, formatOptions } = this;
1752
- const computedHourCycle = getHourCycle(locale, hourCycle);
1753
- const activePart = this.getActivePartsWithFallback();
1754
- return [
1755
- h("div", { class: "time-header" }, this.renderTimeLabel()),
1756
- h("button", { class: {
1757
- 'time-body': true,
1758
- 'time-body-active': isTimePopoverOpen,
1759
- }, part: `time-button${isTimePopoverOpen ? ' active' : ''}`, "aria-expanded": "false", "aria-haspopup": "true", disabled: disabled, onClick: async (ev) => {
1760
- const { popoverRef } = this;
1761
- if (popoverRef) {
1762
- this.isTimePopoverOpen = true;
1763
- popoverRef.present(new CustomEvent('ionShadowTarget', {
1764
- detail: {
1765
- ionShadowTarget: ev.target,
1766
- },
1767
- }));
1768
- await popoverRef.onWillDismiss();
1769
- this.isTimePopoverOpen = false;
1770
- }
1771
- } }, getLocalizedTime(locale, activePart, computedHourCycle, formatOptions === null || formatOptions === void 0 ? void 0 : formatOptions.time)),
1772
- h("ion-popover", { alignment: "center", translucent: true, overlayIndex: 1, arrow: false, onWillPresent: (ev) => {
1773
- /**
1774
- * Intersection Observers do not consistently fire between Blink and Webkit
1775
- * when toggling the visibility of the popover and trying to scroll the picker
1776
- * column to the correct time value.
1777
- *
1778
- * This will correctly scroll the element position to the correct time value,
1779
- * before the popover is fully presented.
1780
- */
1781
- const cols = ev.target.querySelectorAll('ion-picker-column');
1782
- // TODO (FW-615): Potentially remove this when intersection observers are fixed in picker column
1783
- cols.forEach((col) => col.scrollActiveItemIntoView());
1784
- }, style: {
1785
- '--offset-y': '-10px',
1786
- '--min-width': 'fit-content',
1787
- },
1788
- // Allow native browser keyboard events to support up/down/home/end key
1789
- // navigation within the time picker.
1790
- keyboardEvents: true, ref: (el) => (this.popoverRef = el) }, this.renderWheelPicker('time')),
1791
- ];
1792
- }
1793
- getHeaderSelectedDateText() {
1794
- var _a;
1795
- const { activeParts, formatOptions, multiple, titleSelectedDatesFormatter } = this;
1796
- const isArray = Array.isArray(activeParts);
1797
- let headerText;
1798
- if (multiple && isArray && activeParts.length !== 1) {
1799
- headerText = `${activeParts.length} days`; // default/fallback for multiple selection
1800
- if (titleSelectedDatesFormatter !== undefined) {
1801
- try {
1802
- headerText = titleSelectedDatesFormatter(convertDataToISO(activeParts));
1803
- }
1804
- catch (e) {
1805
- printIonError('[ion-datetime] - Exception in provided `titleSelectedDatesFormatter`:', e);
1806
- }
1807
- }
1808
- }
1809
- else {
1810
- // for exactly 1 day selected (multiple set or not), show a formatted version of that
1811
- headerText = getLocalizedDateTime(this.locale, this.getActivePartsWithFallback(), (_a = formatOptions === null || formatOptions === void 0 ? void 0 : formatOptions.date) !== null && _a !== void 0 ? _a : { weekday: 'short', month: 'short', day: 'numeric' });
1812
- }
1813
- return headerText;
1814
- }
1815
- renderHeader(showExpandedHeader = true) {
1816
- const hasSlottedTitle = this.el.querySelector('[slot="title"]') !== null;
1817
- if (!hasSlottedTitle && !this.showDefaultTitle) {
1818
- return;
1819
- }
1820
- return (h("div", { class: "datetime-header" }, h("div", { class: "datetime-title" }, h("slot", { name: "title" }, "Select Date")), showExpandedHeader && h("div", { class: "datetime-selected-date" }, this.getHeaderSelectedDateText())));
1821
- }
1822
- /**
1823
- * Render time picker inside of datetime.
1824
- * Do not pass color prop to segment on
1825
- * iOS mode. MD segment has been customized and
1826
- * should take on the color prop, but iOS
1827
- * should just be the default segment.
1828
- */
1829
- renderTime() {
1830
- const { presentation } = this;
1831
- const timeOnlyPresentation = presentation === 'time';
1832
- return (h("div", { class: "datetime-time" }, timeOnlyPresentation ? this.renderWheelPicker() : this.renderTimeOverlay()));
1833
- }
1834
- /**
1835
- * Renders the month/year picker that is
1836
- * displayed on the calendar grid.
1837
- * The .datetime-year class has additional
1838
- * styles that let us show/hide the
1839
- * picker when the user clicks on the
1840
- * toggle in the calendar header.
1841
- */
1842
- renderCalendarViewMonthYearPicker() {
1843
- return h("div", { class: "datetime-year" }, this.renderWheelView('month-year'));
1844
- }
1845
- /**
1846
- * Render entry point
1847
- * All presentation types are rendered from here.
1848
- */
1849
- renderDatetime(mode) {
1850
- const { presentation, preferWheel } = this;
1851
- /**
1852
- * Certain presentation types have separate grid and wheel displays.
1853
- * If preferWheel is true then we should show a wheel picker instead.
1854
- */
1855
- const hasWheelVariant = presentation === 'date' || presentation === 'date-time' || presentation === 'time-date';
1856
- if (preferWheel && hasWheelVariant) {
1857
- return [this.renderHeader(false), this.renderWheelView(), this.renderFooter()];
1858
- }
1859
- switch (presentation) {
1860
- case 'date-time':
1861
- return [
1862
- this.renderHeader(),
1863
- this.renderCalendar(mode),
1864
- this.renderCalendarViewMonthYearPicker(),
1865
- this.renderTime(),
1866
- this.renderFooter(),
1867
- ];
1868
- case 'time-date':
1869
- return [
1870
- this.renderHeader(),
1871
- this.renderTime(),
1872
- this.renderCalendar(mode),
1873
- this.renderCalendarViewMonthYearPicker(),
1874
- this.renderFooter(),
1875
- ];
1876
- case 'time':
1877
- return [this.renderHeader(false), this.renderTime(), this.renderFooter()];
1878
- case 'month':
1879
- case 'month-year':
1880
- case 'year':
1881
- return [this.renderHeader(false), this.renderWheelView(), this.renderFooter()];
1882
- default:
1883
- return [
1884
- this.renderHeader(),
1885
- this.renderCalendar(mode),
1886
- this.renderCalendarViewMonthYearPicker(),
1887
- this.renderFooter(),
1888
- ];
1889
- }
1890
- }
1891
- render() {
1892
- const { name, value, disabled, el, color, readonly, showMonthAndYear, preferWheel, presentation, size, isGridStyle, } = this;
1893
- const mode = getIonMode(this);
1894
- const isMonthAndYearPresentation = presentation === 'year' || presentation === 'month' || presentation === 'month-year';
1895
- const shouldShowMonthAndYear = showMonthAndYear || isMonthAndYearPresentation;
1896
- const monthYearPickerOpen = showMonthAndYear && !isMonthAndYearPresentation;
1897
- const hasDatePresentation = presentation === 'date' || presentation === 'date-time' || presentation === 'time-date';
1898
- const hasWheelVariant = hasDatePresentation && preferWheel;
1899
- renderHiddenInput(true, el, name, formatValue(value), disabled);
1900
- return (h(Host, { key: 'b81c3531f4654be3f6948df5f790c0f6ab488000', "aria-disabled": disabled ? 'true' : null, onFocus: this.onFocus, onBlur: this.onBlur, class: Object.assign({}, createColorClasses(color, {
1901
- [mode]: true,
1902
- ['datetime-readonly']: readonly,
1903
- ['datetime-disabled']: disabled,
1904
- 'show-month-and-year': shouldShowMonthAndYear,
1905
- 'month-year-picker-open': monthYearPickerOpen,
1906
- [`datetime-presentation-${presentation}`]: true,
1907
- [`datetime-size-${size}`]: true,
1908
- [`datetime-prefer-wheel`]: hasWheelVariant,
1909
- [`datetime-grid`]: isGridStyle,
1910
- })) }, h("div", { key: 'f7f39f8e56146186210d0ab70ae95e829573e549', class: "intersection-tracker", ref: (el) => (this.intersectionTrackerRef = el) }), this.renderDatetime(mode)));
1911
- }
1912
- get el() { return this; }
1913
- static get watchers() { return {
1914
- "formatOptions": ["formatOptionsChanged"],
1915
- "disabled": ["disabledChanged"],
1916
- "min": ["minChanged"],
1917
- "max": ["maxChanged"],
1918
- "presentation": ["presentationChanged"],
1919
- "yearValues": ["yearValuesChanged"],
1920
- "monthValues": ["monthValuesChanged"],
1921
- "dayValues": ["dayValuesChanged"],
1922
- "hourValues": ["hourValuesChanged"],
1923
- "minuteValues": ["minuteValuesChanged"],
1924
- "value": ["valueChanged"]
1925
- }; }
1926
- static get style() { return {
1927
- ios: datetimeIosCss,
1928
- md: datetimeMdCss
1929
- }; }
1930
- }, [289, "ion-datetime", {
1931
- "color": [1],
1932
- "name": [1],
1933
- "disabled": [4],
1934
- "formatOptions": [16],
1935
- "readonly": [4],
1936
- "isDateEnabled": [16],
1937
- "showAdjacentDays": [4, "show-adjacent-days"],
1938
- "min": [1025],
1939
- "max": [1025],
1940
- "presentation": [1],
1941
- "cancelText": [1, "cancel-text"],
1942
- "doneText": [1, "done-text"],
1943
- "clearText": [1, "clear-text"],
1944
- "yearValues": [8, "year-values"],
1945
- "monthValues": [8, "month-values"],
1946
- "dayValues": [8, "day-values"],
1947
- "hourValues": [8, "hour-values"],
1948
- "minuteValues": [8, "minute-values"],
1949
- "locale": [1],
1950
- "firstDayOfWeek": [2, "first-day-of-week"],
1951
- "titleSelectedDatesFormatter": [16],
1952
- "multiple": [4],
1953
- "highlightedDates": [16],
1954
- "value": [1025],
1955
- "showDefaultTitle": [4, "show-default-title"],
1956
- "showDefaultButtons": [4, "show-default-buttons"],
1957
- "showClearButton": [4, "show-clear-button"],
1958
- "showDefaultTimeLabel": [4, "show-default-time-label"],
1959
- "hourCycle": [1, "hour-cycle"],
1960
- "size": [1],
1961
- "preferWheel": [4, "prefer-wheel"],
1962
- "showMonthAndYear": [32],
1963
- "activeParts": [32],
1964
- "workingParts": [32],
1965
- "isTimePopoverOpen": [32],
1966
- "forceRenderDate": [32],
1967
- "confirm": [64],
1968
- "reset": [64],
1969
- "cancel": [64]
1970
- }, undefined, {
1971
- "formatOptions": ["formatOptionsChanged"],
1972
- "disabled": ["disabledChanged"],
1973
- "min": ["minChanged"],
1974
- "max": ["maxChanged"],
1975
- "presentation": ["presentationChanged"],
1976
- "yearValues": ["yearValuesChanged"],
1977
- "monthValues": ["monthValuesChanged"],
1978
- "dayValues": ["dayValuesChanged"],
1979
- "hourValues": ["hourValuesChanged"],
1980
- "minuteValues": ["minuteValuesChanged"],
1981
- "value": ["valueChanged"]
1982
- }]);
1983
- let datetimeIds = 0;
1984
- const CANCEL_ROLE = 'datetime-cancel';
1985
- const CONFIRM_ROLE = 'datetime-confirm';
1986
- const WHEEL_ITEM_PART = 'wheel-item';
1987
- const WHEEL_ITEM_ACTIVE_PART = `active`;
1988
- function defineCustomElement$1() {
1989
- if (typeof customElements === "undefined") {
1990
- return;
1991
- }
1992
- const components = ["ion-datetime", "ion-backdrop", "ion-button", "ion-buttons", "ion-icon", "ion-picker", "ion-picker-column", "ion-picker-column-option", "ion-popover", "ion-ripple-effect"];
1993
- components.forEach(tagName => { switch (tagName) {
1994
- case "ion-datetime":
1995
- if (!customElements.get(tagName)) {
1996
- customElements.define(tagName, Datetime);
1997
- }
1998
- break;
1999
- case "ion-backdrop":
2000
- if (!customElements.get(tagName)) {
2001
- defineCustomElement$a();
2002
- }
2003
- break;
2004
- case "ion-button":
2005
- if (!customElements.get(tagName)) {
2006
- defineCustomElement$9();
2007
- }
2008
- break;
2009
- case "ion-buttons":
2010
- if (!customElements.get(tagName)) {
2011
- defineCustomElement$8();
2012
- }
2013
- break;
2014
- case "ion-icon":
2015
- if (!customElements.get(tagName)) {
2016
- defineCustomElement$7();
2017
- }
2018
- break;
2019
- case "ion-picker":
2020
- if (!customElements.get(tagName)) {
2021
- defineCustomElement$6();
2022
- }
2023
- break;
2024
- case "ion-picker-column":
2025
- if (!customElements.get(tagName)) {
2026
- defineCustomElement$5();
2027
- }
2028
- break;
2029
- case "ion-picker-column-option":
2030
- if (!customElements.get(tagName)) {
2031
- defineCustomElement$4();
2032
- }
2033
- break;
2034
- case "ion-popover":
2035
- if (!customElements.get(tagName)) {
2036
- defineCustomElement$3();
2037
- }
2038
- break;
2039
- case "ion-ripple-effect":
2040
- if (!customElements.get(tagName)) {
2041
- defineCustomElement$2();
2042
- }
2043
- break;
2044
- } });
2045
- }
2046
-
2047
- const IonDatetime = Datetime;
2048
- const defineCustomElement = defineCustomElement$1;
2049
-
2050
- export { IonDatetime, defineCustomElement };
4
+ import{j as e,f as t,p as a,H as i,e as n,w as o,h as r,d as s,t as d}from"./p-BJoMtgfR.js";import{startFocusVisible as l}from"./p-BmVRXR1y.js";import{r as h,g as c,e as p}from"./p-DgbT0exM.js";import{F as m}from"./p-Cq8cQ0NL.js";import{i as u}from"./p-C53feagD.js";import{c as b}from"./p-DiVJyqlX.js";import{c as y,f as g,g as f,h as x,a as v}from"./p-CO7fmmxt.js";import{b as w}from"./p-CDfQnFrd.js";import{i as k,a as j,g as C,b as O,c as P,d as D,e as z,v as V,f as T,h as $,j as A,k as E,l as S,m as B,n as W,o as M,p as R,q as I,r as F,s as L,w as H,t as q,u as Y,x as G,y as J,z as N,A as K,B as Q,C as U,D as X,E as Z,F as _,G as ee,H as te,I as ae,J as ie,K as ne,L as oe,M as re,N as se,O as de,P as le,Q as he,R as ce}from"./p-BS1TtEiJ.js";import{d as pe}from"./p-CoA-aqGF.js";import{d as me}from"./p-BTeL5HCK.js";import{d as ue}from"./p-B8b1Ukl9.js";import{d as be}from"./p-YLXPWgVj.js";import{d as ye}from"./p-B6HaBl3o.js";import{d as ge}from"./p-C7AoMl7c.js";import{d as fe}from"./p-BxwWvu-b.js";import{d as xe}from"./p-DHsZWn1l.js";import{d as ve}from"./p-fpbh6w3f.js";const we=(e,t,a,i)=>null===e.day||void 0!==i&&!i.includes(e.day)||!(!t||!k(e,t))||!(!a||!j(e,a)),ke=(e,t,a,i,n,o,r)=>{const s=void 0!==(Array.isArray(a)?a:[a]).find((e=>P(t,e))),d=P(t,i);return{disabled:we(t,n,o,r),isActive:s,isToday:d,ariaSelected:s?"true":null,ariaLabel:z(e,d,t),text:null!=t.day?D(e,t):null}},je=(e,{minParts:t,maxParts:a})=>!!((e,t,a)=>!!(t&&t.year>e)||!!(a&&a.year<e))(e.year,t,a)||!!(t&&k(e,t)||a&&j(e,a)),Ce=(e,a)=>{var i,n,o,r;((null===(i=null==a?void 0:a.date)||void 0===i?void 0:i.timeZone)||(null===(n=null==a?void 0:a.date)||void 0===n?void 0:n.timeZoneName)||(null===(o=null==a?void 0:a.time)||void 0===o?void 0:o.timeZone)||(null===(r=null==a?void 0:a.time)||void 0===r?void 0:r.timeZoneName))&&t('[ion-datetime] - "timeZone" and "timeZoneName" are not supported in "formatOptions".',e)},Oe=(e,a,i)=>{if(i)switch(a){case"date":case"month-year":case"month":case"year":void 0===i.date&&t(`[ion-datetime] - The '${a}' presentation requires a date object in formatOptions.`,e);break;case"time":void 0===i.time&&t("[ion-datetime] - The 'time' presentation requires a time object in formatOptions.",e);break;case"date-time":case"time-date":void 0===i.date&&void 0===i.time&&t(`[ion-datetime] - The '${a}' presentation requires either a date or time object (or both) in formatOptions.`,e)}},Pe=a(class extends i{constructor(e){super(),!1!==e&&this.__registerHost(),this.__attachShadow(),this.ionCancel=n(this,"ionCancel",7),this.ionChange=n(this,"ionChange",7),this.ionValueChange=n(this,"ionValueChange",7),this.ionFocus=n(this,"ionFocus",7),this.ionBlur=n(this,"ionBlur",7),this.ionStyle=n(this,"ionStyle",7),this.ionRender=n(this,"ionRender",7),this.inputId="ion-dt-"+De++,this.prevPresentation=null,this.showMonthAndYear=!1,this.activeParts=[],this.workingParts={month:5,day:28,year:2021,hour:13,minute:52,ampm:"pm",isAdjacentDay:!1},this.isTimePopoverOpen=!1,this.color="primary",this.name=this.inputId,this.disabled=!1,this.readonly=!1,this.showAdjacentDays=!1,this.presentation="date-time",this.cancelText="Cancel",this.doneText="Done",this.clearText="Clear",this.locale="default",this.firstDayOfWeek=0,this.multiple=!1,this.showDefaultTitle=!1,this.showDefaultButtons=!1,this.showClearButton=!1,this.showDefaultTimeLabel=!0,this.size="fixed",this.preferWheel=!1,this.warnIfIncorrectValueUsage=()=>{const{multiple:e,value:a}=this;!e&&Array.isArray(a)&&t(`[ion-datetime] - An array of values was passed, but multiple is "false". This is incorrect usage and may result in unexpected behaviors. To dismiss this warning, pass a string to the "value" property when multiple="false".\n\n Value Passed: [${a.map((e=>`'${e}'`)).join(", ")}]\n`,this.el)},this.setValue=e=>{this.value=e,this.ionChange.emit({value:e})},this.getActivePartsWithFallback=()=>{var e;const{defaultParts:t}=this;return null!==(e=this.getActivePart())&&void 0!==e?e:t},this.getActivePart=()=>{const{activeParts:e}=this;return Array.isArray(e)?e[0]:e},this.closeParentOverlay=e=>{const t=this.el.closest("ion-modal, ion-popover");t&&t.dismiss(void 0,e)},this.setWorkingParts=e=>{this.workingParts=Object.assign({},e)},this.setActiveParts=(e,t=!1)=>{if(this.readonly)return;const{multiple:a,minParts:i,maxParts:n,activeParts:o}=this,r=V(e,i,n);if(this.setWorkingParts(r),a){const e=Array.isArray(o)?o:[o];this.activeParts=t?e.filter((e=>!P(e,r))):[...e,r]}else this.activeParts=Object.assign({},r);null!==this.el.querySelector('[slot="buttons"]')||this.showDefaultButtons||this.confirm()},this.initializeKeyboardListeners=()=>{const e=this.calendarBodyRef;if(!e)return;const t=this.el.shadowRoot,a=e.querySelector(".calendar-month:nth-of-type(2)"),i=new MutationObserver((t=>{var i;!(null===(i=t[0].oldValue)||void 0===i?void 0:i.includes("ion-focused"))&&e.classList.contains("ion-focused")&&this.focusWorkingDay(a)}));i.observe(e,{attributeFilter:["class"],attributeOldValue:!0}),this.destroyKeyboardMO=()=>{null==i||i.disconnect()},e.addEventListener("keydown",(e=>{const i=t.activeElement;if(!i||!i.classList.contains("calendar-day"))return;const n=T(i);let o;switch(e.key){case"ArrowDown":e.preventDefault(),o=R(n);break;case"ArrowUp":e.preventDefault(),o=M(n);break;case"ArrowRight":e.preventDefault(),o=W(n);break;case"ArrowLeft":e.preventDefault(),o=B(n);break;case"Home":e.preventDefault(),o=S(n);break;case"End":e.preventDefault(),o=E(n);break;case"PageUp":e.preventDefault(),o=e.shiftKey?A(n):C(n);break;case"PageDown":e.preventDefault(),o=e.shiftKey?$(n):O(n);break;default:return}we(o,this.minParts,this.maxParts)||(this.setWorkingParts(Object.assign(Object.assign({},this.workingParts),o)),requestAnimationFrame((()=>this.focusWorkingDay(a))))}))},this.focusWorkingDay=e=>{const{day:t,month:a,year:i}=this.workingParts,n=new Date(`${a}/1/${i}`).getDay();if(null===t)return;const o=e.querySelector(`.calendar-day-wrapper:nth-of-type(${(n>=this.firstDayOfWeek?n-this.firstDayOfWeek:7-(this.firstDayOfWeek-n))+t}) .calendar-day`);o&&o.focus()},this.processMinParts=()=>{const{min:e,defaultParts:t}=this;this.minParts=void 0!==e?I(e,t):void 0},this.processMaxParts=()=>{const{max:e,defaultParts:t}=this;this.maxParts=void 0!==e?F(e,t):void 0},this.initializeCalendarListener=()=>{const e=this.calendarBodyRef;if(!e)return;const t=e.querySelectorAll(".calendar-month"),a=t[0],i=t[1],n=t[2],r="ios"===w(this)&&"undefined"!=typeof navigator&&navigator.maxTouchPoints>1;o((()=>{e.scrollLeft=a.clientWidth*(u(this.el)?-1:1);const t=t=>{const i=e.getBoundingClientRect(),o=(u(this.el)?e.scrollLeft>=-2:e.scrollLeft<=2)?a:n,r=o.getBoundingClientRect();if(Math.abs(r.x-i.x)>2)return;const{forceRenderDate:s}=this;return void 0!==s?{month:s.month,year:s.year,day:s.day}:o===a?C(t):o===n?O(t):void 0},s=()=>{r&&(e.style.removeProperty("pointer-events"),l=!1);const a=t(this.workingParts);if(!a)return;const{month:n,day:s,year:d}=a;je({month:n,year:d,day:null},{minParts:Object.assign(Object.assign({},this.minParts),{day:null}),maxParts:Object.assign(Object.assign({},this.maxParts),{day:null})})||(e.style.setProperty("overflow","hidden"),o((()=>{this.setWorkingParts(Object.assign(Object.assign({},this.workingParts),{month:n,day:s,year:d})),e.scrollLeft=i.clientWidth*(u(this.el)?-1:1),e.style.removeProperty("overflow"),this.resolveForceDateScrolling&&this.resolveForceDateScrolling()})))};let d,l=!1;const h=()=>{d&&clearTimeout(d),!l&&r&&(e.style.setProperty("pointer-events","none"),l=!0),d=setTimeout(s,50)};e.addEventListener("scroll",h),this.destroyCalendarListener=()=>{e.removeEventListener("scroll",h)}}))},this.destroyInteractionListeners=()=>{const{destroyCalendarListener:e,destroyKeyboardMO:t}=this;void 0!==e&&e(),void 0!==t&&t()},this.ensureReadyIfVisible=()=>{if(this.el.classList.contains("datetime-ready"))return;const e=this.el.getBoundingClientRect();0!==e.width&&0!==e.height&&(this.initializeListeners(),o((()=>{this.el.classList.add("datetime-ready")})))},this.processValue=e=>{const t=null!=e&&""!==e&&(!Array.isArray(e)||e.length>0),a=t?L(e):this.defaultParts,{minParts:i,maxParts:n,workingParts:o,el:r}=this;if(this.warnIfIncorrectValueUsage(),!a)return;t&&H(a,i,n);const s=Y(Array.isArray(a)?a[a.length-1]:a,i,n),{month:d,day:l,year:h,hour:c,minute:p}=s,m=q(c);this.activeParts=t?Array.isArray(a)?[...a]:{month:d,day:l,year:h,hour:c,minute:p,ampm:m}:[];const u=void 0!==d&&d!==o.month||void 0!==h&&h!==o.year,b=r.classList.contains("datetime-ready"),{isGridStyle:y,showMonthAndYear:g}=this;y&&u&&b&&!g?this.animateToDate(s):this.setWorkingParts({month:d,day:l,year:h,hour:c,minute:p,ampm:m})},this.animateToDate=async e=>{const{workingParts:t}=this;this.forceRenderDate=e;const a=new Promise((e=>{this.resolveForceDateScrolling=e}));k(e,t)?this.prevMonth():this.nextMonth(),await a,this.resolveForceDateScrolling=void 0,this.forceRenderDate=void 0},this.onFocus=()=>{this.ionFocus.emit()},this.onBlur=()=>{this.ionBlur.emit()},this.hasValue=()=>null!=this.value,this.nextMonth=()=>{const e=this.calendarBodyRef;if(!e)return;const t=e.querySelector(".calendar-month:last-of-type");t&&e.scrollTo({top:0,left:2*t.offsetWidth*(u(this.el)?-1:1),behavior:"smooth"})},this.prevMonth=()=>{const e=this.calendarBodyRef;e&&e.querySelector(".calendar-month:first-of-type")&&e.scrollTo({top:0,left:0,behavior:"smooth"})},this.toggleMonthAndYearView=()=>{this.showMonthAndYear=!this.showMonthAndYear}}formatOptionsChanged(){const{el:e,formatOptions:t,presentation:a}=this;Oe(e,a,t),Ce(e,t)}disabledChanged(){this.emitStyle()}minChanged(){this.processMinParts()}maxChanged(){this.processMaxParts()}presentationChanged(){const{el:e,formatOptions:t,presentation:a}=this;Oe(e,a,t)}get isGridStyle(){const{presentation:e,preferWheel:t}=this;return("date"===e||"date-time"===e||"time-date"===e)&&!t}yearValuesChanged(){this.parsedYearValues=G(this.yearValues)}monthValuesChanged(){this.parsedMonthValues=G(this.monthValues)}dayValuesChanged(){this.parsedDayValues=G(this.dayValues)}hourValuesChanged(){this.parsedHourValues=G(this.hourValues)}minuteValuesChanged(){this.parsedMinuteValues=G(this.minuteValues)}async valueChanged(){const{value:e}=this;this.hasValue()&&this.processValue(e),this.emitStyle(),this.ionValueChange.emit({value:e})}async confirm(e=!1){const{isCalendarPicker:t,activeParts:a,preferWheel:i,workingParts:n}=this;void 0===a&&t||this.setValue(Array.isArray(a)&&0===a.length?i?J(n):void 0:J(a)),e&&this.closeParentOverlay(Ve)}async reset(e){this.processValue(e)}async cancel(e=!1){this.ionCancel.emit(),e&&this.closeParentOverlay(ze)}get isCalendarPicker(){const{presentation:e}=this;return"date"===e||"date-time"===e||"time-date"===e}connectedCallback(){this.clearFocusVisible=l(this.el).destroy}disconnectedCallback(){this.clearFocusVisible&&(this.clearFocusVisible(),this.clearFocusVisible=void 0),this.loadTimeout&&clearTimeout(this.loadTimeout)}initializeListeners(){this.initializeCalendarListener(),this.initializeKeyboardListeners()}componentDidLoad(){const{el:e,intersectionTrackerRef:t}=this,a=new IntersectionObserver((e=>{e[0].isIntersecting&&(this.initializeListeners(),o((()=>{this.el.classList.add("datetime-ready")})))}),{threshold:.01,root:e});h((()=>null==a?void 0:a.observe(t))),this.loadTimeout=setTimeout((()=>{this.ensureReadyIfVisible()}),100);const i=new IntersectionObserver((e=>{e[0].isIntersecting||(this.destroyInteractionListeners(),this.showMonthAndYear=!1,o((()=>{this.el.classList.remove("datetime-ready")})))}),{threshold:0,root:e});h((()=>null==i?void 0:i.observe(t)));const n=c(this.el);n.addEventListener("ionFocus",(e=>e.stopPropagation())),n.addEventListener("ionBlur",(e=>e.stopPropagation()))}componentDidRender(){const{presentation:e,prevPresentation:t,calendarBodyRef:a,minParts:i,preferWheel:n,forceRenderDate:o}=this;if(void 0!==i&&!n&&["date-time","time-date","date"].includes(e)&&a){const e=a.querySelector(".calendar-month:nth-of-type(1)");e&&void 0===o&&(a.scrollLeft=e.clientWidth*(u(this.el)?-1:1))}null!==t?e!==t&&(this.prevPresentation=e,this.destroyInteractionListeners(),this.initializeListeners(),this.showMonthAndYear=!1,h((()=>{this.ionRender.emit()}))):this.prevPresentation=e}componentWillLoad(){const{el:e,formatOptions:a,highlightedDates:i,multiple:n,presentation:o,preferWheel:r}=this;n&&("date"!==o&&t('[ion-datetime] - Multiple date selection is only supported for presentation="date".',e),r&&t('[ion-datetime] - Multiple date selection is not supported with preferWheel="true".',e)),void 0!==i&&("date"!==o&&"date-time"!==o&&"time-date"!==o&&t("[ion-datetime] - The highlightedDates property is only supported with the date, date-time, and time-date presentations.",e),r&&t('[ion-datetime] - The highlightedDates property is not supported with preferWheel="true".',e)),a&&(Oe(e,o,a),Ce(e,a));const s=this.parsedHourValues=G(this.hourValues),d=this.parsedMinuteValues=G(this.minuteValues),l=this.parsedMonthValues=G(this.monthValues),h=this.parsedYearValues=G(this.yearValues),c=this.parsedDayValues=G(this.dayValues),p=this.todayParts=L(N());this.processMinParts(),this.processMaxParts(),this.defaultParts=K({refParts:p,monthValues:l,dayValues:c,yearValues:h,hourValues:s,minuteValues:d,minParts:this.minParts,maxParts:this.maxParts}),this.processValue(this.value),this.emitStyle()}emitStyle(){this.ionStyle.emit({interactive:!0,datetime:!0,"interactive-disabled":this.disabled})}renderFooter(){const{disabled:e,readonly:t,showDefaultButtons:a,showClearButton:i}=this,n=e||t;if(null===this.el.querySelector('[slot="buttons"]')&&!a&&!i)return;const o=()=>{this.reset(),this.setValue(void 0)};return r("div",{class:"datetime-footer"},r("div",{class:"datetime-buttons"},r("div",{class:{"datetime-action-buttons":!0,"has-clear-button":this.showClearButton}},r("slot",{name:"buttons"},r("ion-buttons",null,a&&r("ion-button",{id:"cancel-button",color:this.color,onClick:()=>this.cancel(!0),disabled:n},this.cancelText),r("div",{class:"datetime-action-buttons-container"},i&&r("ion-button",{id:"clear-button",color:this.color,onClick:()=>o(),disabled:n},this.clearText),a&&r("ion-button",{id:"confirm-button",color:this.color,onClick:()=>this.confirm(!0),disabled:n},this.doneText)))))))}renderWheelPicker(e=this.presentation){const t="time-date"===e?[this.renderTimePickerColumns(e),this.renderDatePickerColumns(e)]:[this.renderDatePickerColumns(e),this.renderTimePickerColumns(e)];return r("ion-picker",{class:m},t)}renderDatePickerColumns(e){return"date-time"===e||"time-date"===e?this.renderCombinedDatePickerColumn():this.renderIndividualDatePickerColumns(e)}renderCombinedDatePickerColumn(){const{defaultParts:t,disabled:a,workingParts:i,locale:n,minParts:o,maxParts:s,todayParts:d,isDateEnabled:l}=this,h=this.getActivePartsWithFallback(),c=Q(i),p=c[c.length-1];c[0].day=1,p.day=U(p.month,p.year);const m=void 0!==o&&j(o,c[0])?o:c[0],u=void 0!==s&&k(s,p)?s:p,b=X(n,d,m,u,this.parsedDayValues,this.parsedMonthValues);let y=b.items;const g=b.parts;l&&(y=y.map(((t,a)=>{const i=g[a];let n;try{n=!l(J(i))}catch(t){e("[ion-datetime] - Exception thrown from provided `isDateEnabled` function. Please check your function and try again.",t)}return Object.assign(Object.assign({},t),{disabled:n})})));const f=null!==i.day?`${i.year}-${i.month}-${i.day}`:`${t.year}-${t.month}-${t.day}`;return r("ion-picker-column",{part:Te,"aria-label":"Select a date",class:"date-column",color:this.color,disabled:a,value:f,onIonChange:e=>{const{value:t}=e.detail,a=g.find((({month:e,day:a,year:i})=>t===`${i}-${e}-${a}`));this.setWorkingParts(Object.assign(Object.assign({},i),a)),this.setActiveParts(Object.assign(Object.assign({},h),a)),e.stopPropagation()}},y.map((e=>r("ion-picker-column-option",{part:e.value===f?`${$e} ${Ae}`:$e,key:e.value,disabled:e.disabled,value:e.value},e.text))))}renderIndividualDatePickerColumns(t){const{workingParts:a,isDateEnabled:i}=this,n="year"!==t&&"time"!==t?Z(this.locale,a,this.minParts,this.maxParts,this.parsedMonthValues):[];let o="date"===t?_(this.locale,a,this.minParts,this.maxParts,this.parsedDayValues):[];i&&(o=o.map((t=>{const{value:n}=t,o={month:a.month,day:"string"==typeof n?parseInt(n):n,year:a.year};let r;try{r=!i(J(o))}catch(t){e("[ion-datetime] - Exception thrown from provided `isDateEnabled` function. Please check your function and try again.",t)}return Object.assign(Object.assign({},t),{disabled:r})})));const r="month"!==t&&"time"!==t?ee(this.locale,this.defaultParts,this.minParts,this.maxParts,this.parsedYearValues):[];let s=[];return s=te(this.locale,{month:"numeric",day:"numeric"})?[this.renderMonthPickerColumn(n),this.renderDayPickerColumn(o),this.renderYearPickerColumn(r)]:[this.renderDayPickerColumn(o),this.renderMonthPickerColumn(n),this.renderYearPickerColumn(r)],s}renderDayPickerColumn(e){var t;if(0===e.length)return[];const{disabled:a,workingParts:i}=this,n=this.getActivePartsWithFallback(),o=null!==(t=null!==i.day?i.day:this.defaultParts.day)&&void 0!==t?t:void 0;return r("ion-picker-column",{part:Te,"aria-label":"Select a day",class:"day-column",color:this.color,disabled:a,value:o,onIonChange:e=>{this.setWorkingParts(Object.assign(Object.assign({},i),{day:e.detail.value})),this.setActiveParts(Object.assign(Object.assign({},n),{day:e.detail.value})),e.stopPropagation()}},e.map((e=>r("ion-picker-column-option",{part:e.value===o?`${$e} ${Ae}`:$e,key:e.value,disabled:e.disabled,value:e.value},e.text))))}renderMonthPickerColumn(e){if(0===e.length)return[];const{disabled:t,workingParts:a}=this,i=this.getActivePartsWithFallback();return r("ion-picker-column",{part:Te,"aria-label":"Select a month",class:"month-column",color:this.color,disabled:t,value:a.month,onIonChange:e=>{this.setWorkingParts(Object.assign(Object.assign({},a),{month:e.detail.value})),this.setActiveParts(Object.assign(Object.assign({},i),{month:e.detail.value})),e.stopPropagation()}},e.map((e=>r("ion-picker-column-option",{part:e.value===a.month?`${$e} ${Ae}`:$e,key:e.value,disabled:e.disabled,value:e.value},e.text))))}renderYearPickerColumn(e){if(0===e.length)return[];const{disabled:t,workingParts:a}=this,i=this.getActivePartsWithFallback();return r("ion-picker-column",{part:Te,"aria-label":"Select a year",class:"year-column",color:this.color,disabled:t,value:a.year,onIonChange:e=>{this.setWorkingParts(Object.assign(Object.assign({},a),{year:e.detail.value})),this.setActiveParts(Object.assign(Object.assign({},i),{year:e.detail.value})),e.stopPropagation()}},e.map((e=>r("ion-picker-column-option",{part:e.value===a.year?`${$e} ${Ae}`:$e,key:e.value,disabled:e.disabled,value:e.value},e.text))))}renderTimePickerColumns(e){if(["date","month","month-year","year"].includes(e))return[];const t=void 0!==this.getActivePart(),{hoursData:a,minutesData:i,dayPeriodData:n}=ae(this.locale,this.workingParts,this.hourCycle,t?this.minParts:void 0,t?this.maxParts:void 0,this.parsedHourValues,this.parsedMinuteValues);return[this.renderHourPickerColumn(a),this.renderMinutePickerColumn(i),this.renderDayPeriodPickerColumn(n)]}renderHourPickerColumn(e){const{disabled:t,workingParts:a}=this;if(0===e.length)return[];const i=this.getActivePartsWithFallback();return r("ion-picker-column",{part:Te,"aria-label":"Select an hour",color:this.color,disabled:t,value:i.hour,numericInput:!0,onIonChange:e=>{this.setWorkingParts(Object.assign(Object.assign({},a),{hour:e.detail.value})),this.setActiveParts(Object.assign(Object.assign({},this.getActivePartsWithFallback()),{hour:e.detail.value})),e.stopPropagation()}},e.map((e=>r("ion-picker-column-option",{part:e.value===i.hour?`${$e} ${Ae}`:$e,key:e.value,disabled:e.disabled,value:e.value},e.text))))}renderMinutePickerColumn(e){const{disabled:t,workingParts:a}=this;if(0===e.length)return[];const i=this.getActivePartsWithFallback();return r("ion-picker-column",{part:Te,"aria-label":"Select a minute",color:this.color,disabled:t,value:i.minute,numericInput:!0,onIonChange:e=>{this.setWorkingParts(Object.assign(Object.assign({},a),{minute:e.detail.value})),this.setActiveParts(Object.assign(Object.assign({},this.getActivePartsWithFallback()),{minute:e.detail.value})),e.stopPropagation()}},e.map((e=>r("ion-picker-column-option",{part:e.value===i.minute?`${$e} ${Ae}`:$e,key:e.value,disabled:e.disabled,value:e.value},e.text))))}renderDayPeriodPickerColumn(e){const{disabled:t,workingParts:a}=this;if(0===e.length)return[];const i=this.getActivePartsWithFallback(),n=ie(this.locale);return r("ion-picker-column",{part:Te,"aria-label":"Select a day period",style:n?{order:"-1"}:{},color:this.color,disabled:t,value:i.ampm,onIonChange:e=>{const t=ce(a,e.detail.value);this.setWorkingParts(Object.assign(Object.assign({},a),{ampm:e.detail.value,hour:t})),this.setActiveParts(Object.assign(Object.assign({},this.getActivePartsWithFallback()),{ampm:e.detail.value,hour:t})),e.stopPropagation()}},e.map((e=>r("ion-picker-column-option",{part:e.value===i.ampm?`${$e} ${Ae}`:$e,key:e.value,disabled:e.disabled,value:e.value},e.text))))}renderWheelView(e){const{locale:t}=this,a=te(t)?"month-first":"year-first";return r("div",{class:{["wheel-order-"+a]:!0}},this.renderWheelPicker(e))}renderCalendarHeader(e){const{disabled:t}=this,a="ios"===e?y:g,i="ios"===e?f:x,n=t||((e,t,a)=>{const i=Object.assign(Object.assign({},C(this.workingParts)),{day:null});return je(i,{minParts:t,maxParts:a})})(0,this.minParts,this.maxParts),o=t||((e,t)=>{const a=Object.assign(Object.assign({},O(this.workingParts)),{day:null});return je(a,{maxParts:t})})(0,this.maxParts),s=this.el.getAttribute("dir")||void 0;return r("div",{class:"calendar-header",part:"calendar-header"},r("div",{class:"calendar-action-buttons"},r("div",{class:"calendar-month-year"},r("button",{class:{"calendar-month-year-toggle":!0,"ion-activatable":!0,"ion-focusable":!0},part:"month-year-button",disabled:t,"aria-label":this.showMonthAndYear?"Hide year picker":"Show year picker",onClick:()=>this.toggleMonthAndYearView()},r("span",{id:"toggle-wrapper"},oe(this.locale,this.workingParts),r("ion-icon",{"aria-hidden":"true",icon:this.showMonthAndYear?a:i,lazy:!1,flipRtl:!0})),"md"===e&&r("ion-ripple-effect",null))),r("div",{class:"calendar-next-prev"},r("ion-buttons",null,r("ion-button",{"aria-label":"Previous month",disabled:n,onClick:()=>this.prevMonth(),part:"navigation-button previous-button"},r("ion-icon",{dir:s,"aria-hidden":"true",slot:"icon-only",icon:v,lazy:!1,flipRtl:!0})),r("ion-button",{"aria-label":"Next month",disabled:o,onClick:()=>this.nextMonth(),part:"navigation-button next-button"},r("ion-icon",{dir:s,"aria-hidden":"true",slot:"icon-only",icon:f,lazy:!1,flipRtl:!0}))))),r("div",{class:"calendar-days-of-week","aria-hidden":"true",part:"calendar-days-of-week"},ne(this.locale,e,this.firstDayOfWeek%7).map((e=>r("div",{class:"day-of-week"},e)))))}renderMonth(t,a){const{disabled:i,readonly:n}=this,o=void 0===this.parsedYearValues||this.parsedYearValues.includes(a),s=void 0===this.parsedMonthValues||this.parsedMonthValues.includes(t),d=!o||!s,l=i||n,h=i||je({month:t,year:a,day:null},{minParts:Object.assign(Object.assign({},this.minParts),{day:null}),maxParts:Object.assign(Object.assign({},this.maxParts),{day:null})}),c=this.workingParts.month===t&&this.workingParts.year===a,p=this.getActivePartsWithFallback();return r("div",{"aria-hidden":c?null:"true",class:{"calendar-month":!0,"calendar-month-disabled":!c&&h}},r("div",{class:"calendar-month-grid"},re(t,a,this.firstDayOfWeek%7,this.showAdjacentDays).map(((i,n)=>{const{day:o,dayOfWeek:s,isAdjacentDay:h}=i,{el:c,highlightedDates:m,isDateEnabled:u,multiple:b,showAdjacentDays:y}=this;let g=t,f=a;y&&h&&null!==o&&(o>20?1===t?(f=a-1,g=12):g=t-1:o<15&&(12===t?(f=a+1,g=1):g=t+1));const x={month:g,day:o,year:f,isAdjacentDay:h},v=null===o,{isActive:w,isToday:k,ariaLabel:j,ariaSelected:C,disabled:O,text:P}=ke(this.locale,x,this.activeParts,this.todayParts,this.minParts,this.maxParts,this.parsedDayValues),D=J(x);let z=d||O;if(!z&&void 0!==u)try{z=!u(D)}catch(t){e("[ion-datetime] - Exception thrown from provided `isDateEnabled` function. Please check your function and try again.",c,t)}const V=z&&l,T=z||l;let $,A;return void 0===m||w||null===o||h||($=((t,a,i)=>{if(Array.isArray(t)){const e=a.split("T")[0],i=t.find((t=>t.date===e));if(i)return{textColor:i.textColor,backgroundColor:i.backgroundColor,border:i.border}}else try{return t(a)}catch(t){e("[ion-datetime] - Exception thrown from provided `highlightedDates` callback. Please check your function and try again.",i,t)}})(m,D,c)),v||h?h&&(A="calendar-day"+(z?" disabled":"")):A=`calendar-day${w?" active":""}${k?" today":""}${z?" disabled":""}`,r("div",{class:"calendar-day-wrapper"},r("button",{ref:e=>{e&&(e.style.setProperty("color",""+($?$.textColor:""),"important"),e.style.setProperty("background-color",""+($?$.backgroundColor:""),"important"),e.style.setProperty("border",""+($?$.border:""),"important"))},tabindex:"-1","data-day":o,"data-month":g,"data-year":f,"data-index":n,"data-day-of-week":s,disabled:T,class:{"calendar-day-padding":v,"calendar-day":!0,"calendar-day-active":w,"calendar-day-constrained":V,"calendar-day-today":k,"calendar-day-adjacent-day":h},part:A,"aria-hidden":v?"true":null,"aria-selected":C,"aria-label":j,onClick:()=>{v||(h?(this.el.blur(),this.activeParts=Object.assign(Object.assign({},p),x),this.animateToDate(x),this.confirm()):(this.setWorkingParts(Object.assign(Object.assign({},this.workingParts),x)),b?this.setActiveParts(x,w):this.setActiveParts(Object.assign(Object.assign({},p),x))))}},P))}))))}renderCalendarBody(){return r("div",{class:"calendar-body ion-focusable",ref:e=>this.calendarBodyRef=e,tabindex:"0"},Q(this.workingParts,this.forceRenderDate).map((({month:e,year:t})=>this.renderMonth(e,t))))}renderCalendar(e){return r("div",{class:"datetime-calendar",key:"datetime-calendar"},this.renderCalendarHeader(e),this.renderCalendarBody())}renderTimeLabel(){if(null!==this.el.querySelector('[slot="time-label"]')||this.showDefaultTimeLabel)return r("slot",{name:"time-label"},"Time")}renderTimeOverlay(){const{disabled:e,hourCycle:t,isTimePopoverOpen:a,locale:i,formatOptions:n}=this,o=se(i,t),s=this.getActivePartsWithFallback();return[r("div",{class:"time-header"},this.renderTimeLabel()),r("button",{class:{"time-body":!0,"time-body-active":a},part:"time-button"+(a?" active":""),"aria-expanded":"false","aria-haspopup":"true",disabled:e,onClick:async e=>{const{popoverRef:t}=this;t&&(this.isTimePopoverOpen=!0,t.present(new CustomEvent("ionShadowTarget",{detail:{ionShadowTarget:e.target}})),await t.onWillDismiss(),this.isTimePopoverOpen=!1)}},de(i,s,o,null==n?void 0:n.time)),r("ion-popover",{alignment:"center",translucent:!0,overlayIndex:1,arrow:!1,onWillPresent:e=>{e.target.querySelectorAll("ion-picker-column").forEach((e=>e.scrollActiveItemIntoView()))},style:{"--offset-y":"-10px","--min-width":"fit-content"},keyboardEvents:!0,ref:e=>this.popoverRef=e},this.renderWheelPicker("time"))]}getHeaderSelectedDateText(){var t;const{activeParts:a,formatOptions:i,multiple:n,titleSelectedDatesFormatter:o}=this;let r;if(n&&Array.isArray(a)&&1!==a.length){if(r=a.length+" days",void 0!==o)try{r=o(J(a))}catch(t){e("[ion-datetime] - Exception in provided `titleSelectedDatesFormatter`:",t)}}else r=le(this.locale,this.getActivePartsWithFallback(),null!==(t=null==i?void 0:i.date)&&void 0!==t?t:{weekday:"short",month:"short",day:"numeric"});return r}renderHeader(e=!0){if(null!==this.el.querySelector('[slot="title"]')||this.showDefaultTitle)return r("div",{class:"datetime-header",part:"datetime-header"},r("div",{class:"datetime-title",part:"datetime-title"},r("slot",{name:"title"},"Select Date")),e&&r("div",{class:"datetime-selected-date",part:"datetime-selected-date"},this.getHeaderSelectedDateText()))}renderTime(){const{presentation:e}=this;return r("div",{class:"datetime-time"},"time"===e?this.renderWheelPicker():this.renderTimeOverlay())}renderCalendarViewMonthYearPicker(){return r("div",{class:"datetime-year"},this.renderWheelView("month-year"))}renderDatetime(e){const{presentation:t,preferWheel:a}=this;if(a&&("date"===t||"date-time"===t||"time-date"===t))return[this.renderHeader(!1),this.renderWheelView(),this.renderFooter()];switch(t){case"date-time":return[this.renderHeader(),this.renderCalendar(e),this.renderCalendarViewMonthYearPicker(),this.renderTime(),this.renderFooter()];case"time-date":return[this.renderHeader(),this.renderTime(),this.renderCalendar(e),this.renderCalendarViewMonthYearPicker(),this.renderFooter()];case"time":return[this.renderHeader(!1),this.renderTime(),this.renderFooter()];case"month":case"month-year":case"year":return[this.renderHeader(!1),this.renderWheelView(),this.renderFooter()];default:return[this.renderHeader(),this.renderCalendar(e),this.renderCalendarViewMonthYearPicker(),this.renderFooter()]}}render(){const{name:e,value:t,disabled:a,el:i,color:n,readonly:o,showMonthAndYear:d,preferWheel:l,presentation:h,size:c,isGridStyle:m}=this,u=w(this),y="year"===h||"month"===h||"month-year"===h,g=d||y,f=d&&!y,x=("date"===h||"date-time"===h||"time-date"===h)&&l;return p(!0,i,e,he(t),a),r(s,{key:"0039549c1a4098672eb827c3d6b2c8fcf8f41c53","aria-disabled":a?"true":null,onFocus:this.onFocus,onBlur:this.onBlur,class:Object.assign({},b(n,{[u]:!0,"datetime-readonly":o,"datetime-disabled":a,"show-month-and-year":g,"month-year-picker-open":f,["datetime-presentation-"+h]:!0,["datetime-size-"+c]:!0,"datetime-prefer-wheel":x,"datetime-grid":m}))},r("div",{key:"72f0860a8c46aa493af28819d2e49689358b8357",class:"intersection-tracker",ref:e=>this.intersectionTrackerRef=e}),this.renderDatetime(u))}get el(){return this}static get watchers(){return{formatOptions:[{formatOptionsChanged:0}],disabled:[{disabledChanged:0}],min:[{minChanged:0}],max:[{maxChanged:0}],presentation:[{presentationChanged:0}],yearValues:[{yearValuesChanged:0}],monthValues:[{monthValuesChanged:0}],dayValues:[{dayValuesChanged:0}],hourValues:[{hourValuesChanged:0}],minuteValues:[{minuteValuesChanged:0}],value:[{valueChanged:0}]}}static get style(){return{ios:':host{display:-ms-flexbox;display:flex;-ms-flex-flow:column;flex-flow:column;background:var(--background);overflow:hidden}:host(.datetime-size-fixed){width:auto;height:auto}:host(.datetime-size-fixed:not(.datetime-prefer-wheel)){max-width:350px}:host(.datetime-size-fixed.datetime-prefer-wheel){min-width:350px;max-width:-webkit-max-content;max-width:-moz-max-content;max-width:max-content}:host(.datetime-size-cover){width:100%}:host .calendar-body,:host .datetime-year{opacity:0}:host(:not(.datetime-ready)) .datetime-year{position:absolute;pointer-events:none}:host(.datetime-ready) .calendar-body{opacity:1}:host(.datetime-ready) .datetime-year{display:none;opacity:1}:host .wheel-order-year-first .day-column{-ms-flex-order:3;order:3;text-align:end}:host .wheel-order-year-first .month-column{-ms-flex-order:2;order:2;text-align:end}:host .wheel-order-year-first .year-column{-ms-flex-order:1;order:1;text-align:start}:host .datetime-calendar,:host .datetime-year{display:-ms-flexbox;display:flex;-ms-flex:1 1 auto;flex:1 1 auto;-ms-flex-flow:column;flex-flow:column}:host(.show-month-and-year) .datetime-year{display:-ms-flexbox;display:flex}:host(.show-month-and-year) .calendar-next-prev,:host(.show-month-and-year) .calendar-days-of-week,:host(.show-month-and-year) .calendar-body,:host(.show-month-and-year) .datetime-time{display:none}:host(.month-year-picker-open) .datetime-footer{display:none}:host(.datetime-disabled){pointer-events:none}:host(.datetime-disabled) .calendar-days-of-week,:host(.datetime-disabled) .datetime-time{opacity:0.4}:host(.datetime-readonly){pointer-events:none;}:host(.datetime-readonly) .calendar-action-buttons,:host(.datetime-readonly) .calendar-body,:host(.datetime-readonly) .datetime-year{pointer-events:initial}:host(.datetime-readonly) .calendar-day[disabled]:not(.calendar-day-constrained),:host(.datetime-readonly) .datetime-action-buttons ion-button[disabled]{opacity:1}:host .datetime-header .datetime-title{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}:host .datetime-action-buttons.has-clear-button{width:100%}:host .datetime-action-buttons ion-buttons{display:-ms-flexbox;display:flex;-ms-flex-pack:justify;justify-content:space-between}.datetime-action-buttons .datetime-action-buttons-container{display:-ms-flexbox;display:flex}:host .calendar-action-buttons{display:-ms-flexbox;display:flex;-ms-flex-pack:justify;justify-content:space-between}:host .calendar-action-buttons ion-button{--background:transparent}:host .calendar-days-of-week{display:grid;grid-template-columns:repeat(7, 1fr);text-align:center}.calendar-days-of-week .day-of-week{-webkit-margin-start:auto;margin-inline-start:auto;-webkit-margin-end:auto;margin-inline-end:auto;margin-top:0;margin-bottom:0}:host .calendar-body{display:-ms-flexbox;display:flex;-ms-flex-positive:1;flex-grow:1;-webkit-scroll-snap-type:x mandatory;-ms-scroll-snap-type:x mandatory;scroll-snap-type:x mandatory;overflow-x:scroll;overflow-y:hidden;scrollbar-width:none;outline:none}:host .calendar-body .calendar-month{display:-ms-flexbox;display:flex;-ms-flex-flow:column;flex-flow:column;scroll-snap-align:start;scroll-snap-stop:always;-ms-flex-negative:0;flex-shrink:0;width:100%}:host .calendar-body .calendar-month-disabled{scroll-snap-align:none}:host .calendar-body::-webkit-scrollbar{display:none}:host .calendar-body .calendar-month-grid{display:grid;grid-template-columns:repeat(7, 1fr)}:host .calendar-day-wrapper{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;min-width:0;min-height:0;overflow:visible}.calendar-day{border-radius:50%;-webkit-padding-start:0px;padding-inline-start:0px;-webkit-padding-end:0px;padding-inline-end:0px;padding-top:0px;padding-bottom:0px;-webkit-margin-start:0px;margin-inline-start:0px;-webkit-margin-end:0px;margin-inline-end:0px;margin-top:0px;margin-bottom:0px;display:-ms-flexbox;display:flex;position:relative;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;border:none;outline:none;background:none;color:currentColor;font-family:var(--ion-font-family, inherit);cursor:pointer;-webkit-appearance:none;-moz-appearance:none;appearance:none;z-index:0}:host .calendar-day[disabled]{pointer-events:none;opacity:0.4}.calendar-day:not(.calendar-day-adjacent-day):focus{background:rgba(var(--ion-color-base-rgb), 0.2);-webkit-box-shadow:0px 0px 0px 4px rgba(var(--ion-color-base-rgb), 0.2);box-shadow:0px 0px 0px 4px rgba(var(--ion-color-base-rgb), 0.2)}:host .datetime-time{display:-ms-flexbox;display:flex;-ms-flex-pack:justify;justify-content:space-between}:host(.datetime-presentation-time) .datetime-time{padding-left:0;padding-right:0;padding-top:0;padding-bottom:0}:host ion-popover{--height:200px}:host .time-header{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center}:host .time-body{border-radius:8px;-webkit-padding-start:12px;padding-inline-start:12px;-webkit-padding-end:12px;padding-inline-end:12px;padding-top:6px;padding-bottom:6px;display:-ms-flexbox;display:flex;border:none;background:var(--ion-color-step-300, var(--ion-background-color-step-300, #edeef0));color:var(--ion-text-color, #000);font-family:inherit;font-size:inherit;cursor:pointer;-webkit-appearance:none;-moz-appearance:none;appearance:none}:host .time-body-active{color:var(--ion-color-base)}:host(.in-item){position:static}:host(.show-month-and-year) .calendar-action-buttons .calendar-month-year-toggle{color:var(--ion-color-base)}.calendar-month-year{min-width:0}.calendar-month-year-toggle{font-family:inherit;font-size:inherit;font-style:inherit;font-weight:inherit;letter-spacing:inherit;text-decoration:inherit;text-indent:inherit;text-overflow:inherit;text-transform:inherit;text-align:inherit;white-space:inherit;color:inherit;position:relative;border:0;outline:none;background:transparent;cursor:pointer;z-index:1}.calendar-month-year-toggle::after{left:0;right:0;top:0;bottom:0;position:absolute;content:"";opacity:0;-webkit-transition:opacity 15ms linear, background-color 15ms linear;transition:opacity 15ms linear, background-color 15ms linear;z-index:-1}.calendar-month-year-toggle.ion-focused::after{background:currentColor}.calendar-month-year-toggle:disabled{opacity:0.3;pointer-events:none}.calendar-month-year-toggle ion-icon{-webkit-padding-start:4px;padding-inline-start:4px;-webkit-padding-end:0;padding-inline-end:0;padding-top:0;padding-bottom:0;-ms-flex-negative:0;flex-shrink:0}.calendar-month-year-toggle #toggle-wrapper{display:-ms-inline-flexbox;display:inline-flex;-ms-flex-align:center;align-items:center}ion-picker{--highlight-background:var(--wheel-highlight-background);--highlight-border-radius:var(--wheel-highlight-border-radius);--fade-background-rgb:var(--wheel-fade-background-rgb)}:host{--background:var(--ion-color-light, #f4f5f8);--background-rgb:var(--ion-color-light-rgb, 244, 245, 248);--title-color:var(--ion-color-step-600, var(--ion-text-color-step-400, #666666))}:host(.datetime-presentation-date-time:not(.datetime-prefer-wheel)),:host(.datetime-presentation-time-date:not(.datetime-prefer-wheel)),:host(.datetime-presentation-date:not(.datetime-prefer-wheel)){min-height:350px}:host .datetime-header{-webkit-padding-start:16px;padding-inline-start:16px;-webkit-padding-end:16px;padding-inline-end:16px;padding-top:16px;padding-bottom:16px;border-bottom:0.55px solid var(--ion-color-step-200, var(--ion-background-color-step-200, #cccccc));font-size:min(0.875rem, 22.4px)}:host .datetime-header .datetime-title{color:var(--title-color)}:host .datetime-header .datetime-selected-date{margin-top:10px}.calendar-month-year-toggle{-webkit-padding-start:16px;padding-inline-start:16px;-webkit-padding-end:16px;padding-inline-end:16px;padding-top:0px;padding-bottom:0px;min-height:44px;font-size:min(1rem, 25.6px);font-weight:600}.calendar-month-year-toggle.ion-focused::after{opacity:0.15}.calendar-month-year-toggle #toggle-wrapper{-webkit-margin-start:0;margin-inline-start:0;-webkit-margin-end:8px;margin-inline-end:8px;margin-top:10px;margin-bottom:10px}:host .calendar-action-buttons .calendar-month-year-toggle ion-icon,:host .calendar-action-buttons ion-buttons ion-button{color:var(--ion-color-base)}:host .calendar-action-buttons ion-buttons{-ms-flex-align:stretch;align-items:stretch;height:100%}:host .calendar-action-buttons ion-buttons ion-button{margin-left:0;margin-right:0;margin-top:0;margin-bottom:0}:host .calendar-days-of-week{-webkit-padding-start:8px;padding-inline-start:8px;-webkit-padding-end:8px;padding-inline-end:8px;padding-top:0;padding-bottom:0;color:var(--ion-color-step-300, var(--ion-text-color-step-700, #b3b3b3));font-size:min(0.75rem, 19.2px);font-weight:600;line-height:24px;text-transform:uppercase}@supports (border-radius: mod(1px, 1px)){.calendar-days-of-week .day-of-week{width:clamp(20px, calc(mod(min(1rem, 24px), 24px) * 10), 100%);height:24px;overflow:hidden}.calendar-day{border-radius:max(8px, mod(min(1rem, 24px), 24px) * 10)}}@supports ((border-radius: mod(1px, 1px)) and (background: -webkit-named-image(apple-pay-logo-black)) and (not (contain-intrinsic-size: none))) or (not (border-radius: mod(1px, 1px))){.calendar-days-of-week .day-of-week{width:auto;height:auto;overflow:initial}.calendar-day{border-radius:32px}}:host .calendar-body .calendar-month .calendar-month-grid{-webkit-padding-start:8px;padding-inline-start:8px;-webkit-padding-end:8px;padding-inline-end:8px;padding-top:8px;padding-bottom:8px;-ms-flex-align:center;align-items:center;height:calc(100% - 16px)}:host .calendar-day-wrapper{-webkit-padding-start:4px;padding-inline-start:4px;-webkit-padding-end:4px;padding-inline-end:4px;padding-top:4px;padding-bottom:4px;height:0;min-height:1rem}:host .calendar-day{width:40px;min-width:40px;height:40px;font-size:min(1.25rem, 32px)}.calendar-day.calendar-day-active{background:rgba(var(--ion-color-base-rgb), 0.2);font-size:min(1.375rem, 35.2px)}:host .calendar-day.calendar-day-today{color:var(--ion-color-base)}:host .calendar-day.calendar-day-active,:host .calendar-day.calendar-day-adjacent-day.calendar-day-active{color:var(--ion-color-base);font-weight:600}:host .calendar-day.calendar-day-today.calendar-day-active{background:var(--ion-color-base);color:var(--ion-color-contrast)}:host .calendar-day.calendar-day-adjacent-day{color:var(--ion-color-step-300, var(--ion-text-color-step-700, #b3b3b3))}:host .datetime-time{-webkit-padding-start:16px;padding-inline-start:16px;-webkit-padding-end:16px;padding-inline-end:16px;padding-top:8px;padding-bottom:16px;font-size:min(1rem, 25.6px)}:host .datetime-time .time-header{font-weight:600}:host .datetime-buttons{-webkit-padding-start:8px;padding-inline-start:8px;-webkit-padding-end:8px;padding-inline-end:8px;padding-top:8px;padding-bottom:8px;border-top:0.55px solid var(--ion-color-step-200, var(--ion-background-color-step-200, #cccccc))}:host .datetime-buttons ::slotted(ion-buttons),:host .datetime-buttons ion-buttons{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:justify;justify-content:space-between}:host .datetime-action-buttons{width:100%}',md:':host{display:-ms-flexbox;display:flex;-ms-flex-flow:column;flex-flow:column;background:var(--background);overflow:hidden}:host(.datetime-size-fixed){width:auto;height:auto}:host(.datetime-size-fixed:not(.datetime-prefer-wheel)){max-width:350px}:host(.datetime-size-fixed.datetime-prefer-wheel){min-width:350px;max-width:-webkit-max-content;max-width:-moz-max-content;max-width:max-content}:host(.datetime-size-cover){width:100%}:host .calendar-body,:host .datetime-year{opacity:0}:host(:not(.datetime-ready)) .datetime-year{position:absolute;pointer-events:none}:host(.datetime-ready) .calendar-body{opacity:1}:host(.datetime-ready) .datetime-year{display:none;opacity:1}:host .wheel-order-year-first .day-column{-ms-flex-order:3;order:3;text-align:end}:host .wheel-order-year-first .month-column{-ms-flex-order:2;order:2;text-align:end}:host .wheel-order-year-first .year-column{-ms-flex-order:1;order:1;text-align:start}:host .datetime-calendar,:host .datetime-year{display:-ms-flexbox;display:flex;-ms-flex:1 1 auto;flex:1 1 auto;-ms-flex-flow:column;flex-flow:column}:host(.show-month-and-year) .datetime-year{display:-ms-flexbox;display:flex}:host(.show-month-and-year) .calendar-next-prev,:host(.show-month-and-year) .calendar-days-of-week,:host(.show-month-and-year) .calendar-body,:host(.show-month-and-year) .datetime-time{display:none}:host(.month-year-picker-open) .datetime-footer{display:none}:host(.datetime-disabled){pointer-events:none}:host(.datetime-disabled) .calendar-days-of-week,:host(.datetime-disabled) .datetime-time{opacity:0.4}:host(.datetime-readonly){pointer-events:none;}:host(.datetime-readonly) .calendar-action-buttons,:host(.datetime-readonly) .calendar-body,:host(.datetime-readonly) .datetime-year{pointer-events:initial}:host(.datetime-readonly) .calendar-day[disabled]:not(.calendar-day-constrained),:host(.datetime-readonly) .datetime-action-buttons ion-button[disabled]{opacity:1}:host .datetime-header .datetime-title{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}:host .datetime-action-buttons.has-clear-button{width:100%}:host .datetime-action-buttons ion-buttons{display:-ms-flexbox;display:flex;-ms-flex-pack:justify;justify-content:space-between}.datetime-action-buttons .datetime-action-buttons-container{display:-ms-flexbox;display:flex}:host .calendar-action-buttons{display:-ms-flexbox;display:flex;-ms-flex-pack:justify;justify-content:space-between}:host .calendar-action-buttons ion-button{--background:transparent}:host .calendar-days-of-week{display:grid;grid-template-columns:repeat(7, 1fr);text-align:center}.calendar-days-of-week .day-of-week{-webkit-margin-start:auto;margin-inline-start:auto;-webkit-margin-end:auto;margin-inline-end:auto;margin-top:0;margin-bottom:0}:host .calendar-body{display:-ms-flexbox;display:flex;-ms-flex-positive:1;flex-grow:1;-webkit-scroll-snap-type:x mandatory;-ms-scroll-snap-type:x mandatory;scroll-snap-type:x mandatory;overflow-x:scroll;overflow-y:hidden;scrollbar-width:none;outline:none}:host .calendar-body .calendar-month{display:-ms-flexbox;display:flex;-ms-flex-flow:column;flex-flow:column;scroll-snap-align:start;scroll-snap-stop:always;-ms-flex-negative:0;flex-shrink:0;width:100%}:host .calendar-body .calendar-month-disabled{scroll-snap-align:none}:host .calendar-body::-webkit-scrollbar{display:none}:host .calendar-body .calendar-month-grid{display:grid;grid-template-columns:repeat(7, 1fr)}:host .calendar-day-wrapper{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;min-width:0;min-height:0;overflow:visible}.calendar-day{border-radius:50%;-webkit-padding-start:0px;padding-inline-start:0px;-webkit-padding-end:0px;padding-inline-end:0px;padding-top:0px;padding-bottom:0px;-webkit-margin-start:0px;margin-inline-start:0px;-webkit-margin-end:0px;margin-inline-end:0px;margin-top:0px;margin-bottom:0px;display:-ms-flexbox;display:flex;position:relative;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;border:none;outline:none;background:none;color:currentColor;font-family:var(--ion-font-family, inherit);cursor:pointer;-webkit-appearance:none;-moz-appearance:none;appearance:none;z-index:0}:host .calendar-day[disabled]{pointer-events:none;opacity:0.4}.calendar-day:not(.calendar-day-adjacent-day):focus{background:rgba(var(--ion-color-base-rgb), 0.2);-webkit-box-shadow:0px 0px 0px 4px rgba(var(--ion-color-base-rgb), 0.2);box-shadow:0px 0px 0px 4px rgba(var(--ion-color-base-rgb), 0.2)}:host .datetime-time{display:-ms-flexbox;display:flex;-ms-flex-pack:justify;justify-content:space-between}:host(.datetime-presentation-time) .datetime-time{padding-left:0;padding-right:0;padding-top:0;padding-bottom:0}:host ion-popover{--height:200px}:host .time-header{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center}:host .time-body{border-radius:8px;-webkit-padding-start:12px;padding-inline-start:12px;-webkit-padding-end:12px;padding-inline-end:12px;padding-top:6px;padding-bottom:6px;display:-ms-flexbox;display:flex;border:none;background:var(--ion-color-step-300, var(--ion-background-color-step-300, #edeef0));color:var(--ion-text-color, #000);font-family:inherit;font-size:inherit;cursor:pointer;-webkit-appearance:none;-moz-appearance:none;appearance:none}:host .time-body-active{color:var(--ion-color-base)}:host(.in-item){position:static}:host(.show-month-and-year) .calendar-action-buttons .calendar-month-year-toggle{color:var(--ion-color-base)}.calendar-month-year{min-width:0}.calendar-month-year-toggle{font-family:inherit;font-size:inherit;font-style:inherit;font-weight:inherit;letter-spacing:inherit;text-decoration:inherit;text-indent:inherit;text-overflow:inherit;text-transform:inherit;text-align:inherit;white-space:inherit;color:inherit;position:relative;border:0;outline:none;background:transparent;cursor:pointer;z-index:1}.calendar-month-year-toggle::after{left:0;right:0;top:0;bottom:0;position:absolute;content:"";opacity:0;-webkit-transition:opacity 15ms linear, background-color 15ms linear;transition:opacity 15ms linear, background-color 15ms linear;z-index:-1}.calendar-month-year-toggle.ion-focused::after{background:currentColor}.calendar-month-year-toggle:disabled{opacity:0.3;pointer-events:none}.calendar-month-year-toggle ion-icon{-webkit-padding-start:4px;padding-inline-start:4px;-webkit-padding-end:0;padding-inline-end:0;padding-top:0;padding-bottom:0;-ms-flex-negative:0;flex-shrink:0}.calendar-month-year-toggle #toggle-wrapper{display:-ms-inline-flexbox;display:inline-flex;-ms-flex-align:center;align-items:center}ion-picker{--highlight-background:var(--wheel-highlight-background);--highlight-border-radius:var(--wheel-highlight-border-radius);--fade-background-rgb:var(--wheel-fade-background-rgb)}:host{--background:var(--ion-color-step-100, var(--ion-background-color-step-100, #ffffff));--title-color:var(--ion-color-contrast)}:host .datetime-header{-webkit-padding-start:20px;padding-inline-start:20px;-webkit-padding-end:20px;padding-inline-end:20px;padding-top:20px;padding-bottom:20px;background:var(--ion-color-base);color:var(--title-color)}:host .datetime-header .datetime-title{font-size:0.75rem;text-transform:uppercase}:host .datetime-header .datetime-selected-date{margin-top:30px;font-size:2.125rem}:host .calendar-action-buttons ion-button{--color:var(--ion-color-step-650, var(--ion-text-color-step-350, #595959))}.calendar-month-year-toggle{-webkit-padding-start:20px;padding-inline-start:20px;-webkit-padding-end:16px;padding-inline-end:16px;padding-top:12px;padding-bottom:12px;min-height:48px;background:transparent;color:var(--ion-color-step-650, var(--ion-text-color-step-350, #595959));z-index:1}.calendar-month-year-toggle.ion-focused::after{opacity:0.04}.calendar-month-year-toggle ion-ripple-effect{color:currentColor}@media (any-hover: hover){.calendar-month-year-toggle.ion-activatable:not(.ion-focused):hover::after{background:currentColor;opacity:0.04}}:host .calendar-days-of-week{-webkit-padding-start:10px;padding-inline-start:10px;-webkit-padding-end:10px;padding-inline-end:10px;padding-top:0px;padding-bottom:0px;color:var(--ion-color-step-500, var(--ion-text-color-step-500, gray));font-size:0.875rem;line-height:36px}:host .calendar-body .calendar-month .calendar-month-grid{-webkit-padding-start:10px;padding-inline-start:10px;-webkit-padding-end:10px;padding-inline-end:10px;padding-top:4px;padding-bottom:4px;grid-template-rows:repeat(6, 1fr)}:host .calendar-day{width:42px;min-width:42px;height:42px;font-size:0.875rem}:host .calendar-day.calendar-day-today{border:1px solid var(--ion-color-base);color:var(--ion-color-base)}:host .calendar-day.calendar-day-active,:host .calendar-day.calendar-day-adjacent-day.calendar-day-active{color:var(--ion-color-contrast)}.calendar-day.calendar-day-active,.calendar-day.calendar-day-active:focus{border:1px solid var(--ion-color-base);background:var(--ion-color-base)}:host .calendar-day.calendar-day-adjacent-day{color:var(--ion-color-step-500, var(--ion-text-color-step-500, gray))}:host .datetime-time{-webkit-padding-start:16px;padding-inline-start:16px;-webkit-padding-end:16px;padding-inline-end:16px;padding-top:8px;padding-bottom:8px}:host .time-header{color:var(--ion-color-step-650, var(--ion-text-color-step-350, #595959))}:host(.datetime-presentation-month) .datetime-year,:host(.datetime-presentation-year) .datetime-year,:host(.datetime-presentation-month-year) .datetime-year{margin-top:20px;margin-bottom:20px}:host .datetime-buttons{-webkit-padding-start:10px;padding-inline-start:10px;-webkit-padding-end:10px;padding-inline-end:10px;padding-top:10px;padding-bottom:10px;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:end;justify-content:flex-end}'}}},[289,"ion-datetime",{color:[1],name:[1],disabled:[4],formatOptions:[16],readonly:[4],isDateEnabled:[16],showAdjacentDays:[4,"show-adjacent-days"],min:[1025],max:[1025],presentation:[1],cancelText:[1,"cancel-text"],doneText:[1,"done-text"],clearText:[1,"clear-text"],yearValues:[8,"year-values"],monthValues:[8,"month-values"],dayValues:[8,"day-values"],hourValues:[8,"hour-values"],minuteValues:[8,"minute-values"],locale:[1],firstDayOfWeek:[2,"first-day-of-week"],titleSelectedDatesFormatter:[16],multiple:[4],highlightedDates:[16],value:[1025],showDefaultTitle:[4,"show-default-title"],showDefaultButtons:[4,"show-default-buttons"],showClearButton:[4,"show-clear-button"],showDefaultTimeLabel:[4,"show-default-time-label"],hourCycle:[1,"hour-cycle"],size:[1],preferWheel:[4,"prefer-wheel"],showMonthAndYear:[32],activeParts:[32],workingParts:[32],isTimePopoverOpen:[32],forceRenderDate:[32],confirm:[64],reset:[64],cancel:[64]},void 0,{formatOptions:[{formatOptionsChanged:0}],disabled:[{disabledChanged:0}],min:[{minChanged:0}],max:[{maxChanged:0}],presentation:[{presentationChanged:0}],yearValues:[{yearValuesChanged:0}],monthValues:[{monthValuesChanged:0}],dayValues:[{dayValuesChanged:0}],hourValues:[{hourValuesChanged:0}],minuteValues:[{minuteValuesChanged:0}],value:[{valueChanged:0}]}]);let De=0;const ze="datetime-cancel",Ve="datetime-confirm",Te="wheel",$e="wheel-item",Ae="active",Ee=Pe,Se=function(){"undefined"!=typeof customElements&&["ion-datetime","ion-backdrop","ion-button","ion-buttons","ion-icon","ion-picker","ion-picker-column","ion-picker-column-option","ion-popover","ion-ripple-effect"].forEach((e=>{switch(e){case"ion-datetime":customElements.get(d(e))||customElements.define(d(e),Pe);break;case"ion-backdrop":customElements.get(d(e))||pe();break;case"ion-button":customElements.get(d(e))||me();break;case"ion-buttons":customElements.get(d(e))||ue();break;case"ion-icon":customElements.get(d(e))||be();break;case"ion-picker":customElements.get(d(e))||ye();break;case"ion-picker-column":customElements.get(d(e))||ge();break;case"ion-picker-column-option":customElements.get(d(e))||fe();break;case"ion-popover":customElements.get(d(e))||xe();break;case"ion-ripple-effect":customElements.get(d(e))||ve()}}))};export{Ee as IonDatetime,Se as defineCustomElement}