@ionic/core 8.8.19-dev.11786610762.137bbb21 → 8.8.19-dev.11786730389.1a1927bf

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 (1232) hide show
  1. package/components/index.js +1 -1
  2. package/components/ion-accordion-group.js +1 -1
  3. package/components/ion-accordion.js +1 -1
  4. package/components/ion-action-sheet.js +1 -1
  5. package/components/ion-alert.js +1 -1
  6. package/components/ion-app.js +1 -1
  7. package/components/ion-avatar.js +1 -1
  8. package/components/ion-back-button.js +1 -1
  9. package/components/ion-backdrop.js +1 -1
  10. package/components/ion-badge.js +1 -1
  11. package/components/ion-breadcrumb.js +1 -1
  12. package/components/ion-breadcrumbs.js +1 -1
  13. package/components/ion-button.js +1 -1
  14. package/components/ion-buttons.js +1 -1
  15. package/components/ion-card-content.js +1 -1
  16. package/components/ion-card-header.js +1 -1
  17. package/components/ion-card-subtitle.js +1 -1
  18. package/components/ion-card-title.js +1 -1
  19. package/components/ion-card.js +1 -1
  20. package/components/ion-checkbox.js +1 -1
  21. package/components/ion-chip.js +1 -1
  22. package/components/ion-col.js +1 -1
  23. package/components/ion-content.js +1 -1
  24. package/components/ion-datetime-button.js +1 -1
  25. package/components/ion-datetime.js +1 -1
  26. package/components/ion-fab-button.js +1 -1
  27. package/components/ion-fab-list.js +1 -1
  28. package/components/ion-fab.js +1 -1
  29. package/components/ion-footer.js +1 -1
  30. package/components/ion-grid.js +1 -1
  31. package/components/ion-header.js +1 -1
  32. package/components/ion-icon.js +1 -1
  33. package/components/ion-img.js +1 -1
  34. package/components/ion-infinite-scroll-content.js +1 -1
  35. package/components/ion-infinite-scroll.js +1 -1
  36. package/components/ion-input-otp.js +1 -1
  37. package/components/ion-input-password-toggle.js +1 -1
  38. package/components/ion-input.js +1 -1
  39. package/components/ion-item-divider.js +1 -1
  40. package/components/ion-item-group.js +1 -1
  41. package/components/ion-item-option.js +1 -1
  42. package/components/ion-item-options.js +1 -1
  43. package/components/ion-item-sliding.js +1 -1
  44. package/components/ion-item.js +1 -1
  45. package/components/ion-label.js +1 -1
  46. package/components/ion-list-header.js +1 -1
  47. package/components/ion-list.js +1 -1
  48. package/components/ion-loading.js +1 -1
  49. package/components/ion-menu-button.js +1 -1
  50. package/components/ion-menu-toggle.js +1 -1
  51. package/components/ion-menu.js +1 -1
  52. package/components/ion-modal.js +1 -1
  53. package/components/ion-nav-link.js +1 -1
  54. package/components/ion-nav.js +1 -1
  55. package/components/ion-note.js +1 -1
  56. package/components/ion-picker-column-option.js +1 -1
  57. package/components/ion-picker-column.js +1 -1
  58. package/components/ion-picker.js +1 -1
  59. package/components/ion-popover.js +1 -1
  60. package/components/ion-progress-bar.js +1 -1
  61. package/components/ion-radio-group.js +1 -1
  62. package/components/ion-radio.js +1 -1
  63. package/components/ion-range.js +1 -1
  64. package/components/ion-refresher-content.js +1 -1
  65. package/components/ion-refresher.js +1 -1
  66. package/components/ion-reorder-group.js +1 -1
  67. package/components/ion-reorder.js +1 -1
  68. package/components/ion-ripple-effect.js +1 -1
  69. package/components/ion-route-redirect.js +1 -1
  70. package/components/ion-route.js +1 -1
  71. package/components/ion-router-link.js +1 -1
  72. package/components/ion-router-outlet.js +1 -1
  73. package/components/ion-router.js +1 -1
  74. package/components/ion-row.js +1 -1
  75. package/components/ion-searchbar.js +1 -1
  76. package/components/ion-segment-button.js +1 -1
  77. package/components/ion-segment-content.js +1 -1
  78. package/components/ion-segment-view.js +1 -1
  79. package/components/ion-segment.js +1 -1
  80. package/components/ion-select-modal.js +1 -1
  81. package/components/ion-select-option.js +1 -1
  82. package/components/ion-select-popover.js +1 -1
  83. package/components/ion-select.js +1 -1
  84. package/components/ion-skeleton-text.js +1 -1
  85. package/components/ion-spinner.js +1 -1
  86. package/components/ion-split-pane.js +1 -1
  87. package/components/ion-tab-bar.js +1 -1
  88. package/components/ion-tab-button.js +1 -1
  89. package/components/ion-tab.js +1 -1
  90. package/components/ion-tabs.js +1 -1
  91. package/components/ion-text.js +1 -1
  92. package/components/ion-textarea.js +1 -1
  93. package/components/ion-thumbnail.js +1 -1
  94. package/components/ion-title.js +1 -1
  95. package/components/ion-toast.js +1 -1
  96. package/components/ion-toggle.js +1 -1
  97. package/components/ion-toolbar.js +1 -1
  98. package/components/p-0Pyit076.js +4 -0
  99. package/components/{p-CpHPq11n.js → p-30_sZS2V.js} +1 -1
  100. package/components/p-83oP9gzn.js +4 -0
  101. package/components/p-8FN7p701.js +4 -0
  102. package/components/p-B-FxiyeI.js +4 -0
  103. package/components/p-B6dUPQXq.js +4 -0
  104. package/components/p-BMPN55of.js +4 -0
  105. package/components/p-BMS4t-kJ.js +4 -0
  106. package/components/p-BO4sUqUv.js +4 -0
  107. package/components/p-BSQPZ79H.js +4 -0
  108. package/components/p-Bc4wROfM.js +4 -0
  109. package/components/p-BhamHSw3.js +4 -0
  110. package/components/p-BmVRXR1y.js +4 -0
  111. package/components/p-BpG8kBfD.js +4 -0
  112. package/components/p-BqPNzJf6.js +4 -0
  113. package/components/p-BsVxQGUT.js +4 -0
  114. package/components/p-BxUIQcD9.js +4 -0
  115. package/components/p-C1O9GEug.js +4 -0
  116. package/components/p-C5KYjZWD.js +4 -0
  117. package/components/p-C9BGR5fy.js +4 -0
  118. package/components/p-CD4fmpem.js +4 -0
  119. package/components/p-CEW4RXZO.js +4 -0
  120. package/components/p-CIGNaXM1.js +4 -0
  121. package/components/p-CKhiNOEg.js +4 -0
  122. package/components/p-CO2zzh3W.js +4 -0
  123. package/components/p-CVnwvOBD.js +4 -0
  124. package/components/p-CbhUdtjf.js +4 -0
  125. package/components/p-CejmQs3h.js +4 -0
  126. package/components/p-CfnGxjv-.js +4 -0
  127. package/components/p-ClFYbgND.js +4 -0
  128. package/components/p-CmKf4pgI.js +4 -0
  129. package/components/p-Cs5f-uOS.js +4 -0
  130. package/components/p-D7-vHX0A.js +4 -0
  131. package/components/{p-CA4M5WkT.js → p-DIgGHN7D.js} +1 -1
  132. package/components/p-DJztqcrH.js +4 -0
  133. package/components/p-DRfgH82D.js +4 -0
  134. package/components/p-DTY4otpr.js +4 -0
  135. package/components/p-DV85C0e0.js +4 -0
  136. package/components/p-DVKS-ovH.js +4 -0
  137. package/components/p-DWCzVL3Y.js +4 -0
  138. package/components/p-D_XD0pVT.js +4 -0
  139. package/components/p-Dd8ajo9a.js +4 -0
  140. package/components/p-DdnhY_oj.js +4 -0
  141. package/components/p-Dm7h4Nyv.js +4 -0
  142. package/components/{p-B2SvA6NE.js → p-DwpKZ6rl.js} +1 -1
  143. package/components/p-DyePCNGr.js +4 -0
  144. package/components/p-G0TxqHfe.js +4 -0
  145. package/components/{p-Ch8jco3x.js → p-J-p0EtHR.js} +1 -1
  146. package/components/p-LXu5-6Ti.js +4 -0
  147. package/components/p-LpMHEu3v.js +4 -0
  148. package/components/p-MCJ7HjWe.js +4 -0
  149. package/components/p-Obm7si-x.js +4 -0
  150. package/components/p-TXPDHL13.js +4 -0
  151. package/components/p-UuPYCOZE.js +4 -0
  152. package/components/p-WeeS7GvC.js +4 -0
  153. package/components/p-ZjP4CjeZ.js +4 -0
  154. package/components/{p-CzlL9T_X.js → p-_0JhwClE.js} +1 -1
  155. package/components/p-_IKFD3ID.js +4 -0
  156. package/components/p-byZM6qHV.js +4 -0
  157. package/components/p-hh7qIC-X.js +4 -0
  158. package/components/p-idq4JFo2.js +4 -0
  159. package/components/{p-BZwQa9ey.js → p-ryyf_ItD.js} +1 -1
  160. package/components/p-tYCT3JGl.js +4 -0
  161. package/components/p-wzAhIh03.js +4 -0
  162. package/components/p-xOjr4bwc.js +4 -0
  163. package/components/{p-Dovs7FIs.js → p-yuj4Nkm_.js} +1 -1
  164. package/css/core.css +1 -1
  165. package/css/core.css.map +1 -1
  166. package/css/display.css +1 -1
  167. package/css/display.css.map +1 -1
  168. package/css/flex-utils.css +1 -1
  169. package/css/flex-utils.css.map +1 -1
  170. package/css/float-elements.css.map +1 -1
  171. package/css/global.bundle.css.map +1 -1
  172. package/css/ionic-swiper.css +1 -1
  173. package/css/ionic-swiper.css.map +1 -1
  174. package/css/ionic.bundle.css +1 -1
  175. package/css/ionic.bundle.css.map +1 -1
  176. package/css/normalize.css.map +1 -1
  177. package/css/padding.css.map +1 -1
  178. package/css/palettes/dark.always.css.map +1 -1
  179. package/css/palettes/dark.class.css.map +1 -1
  180. package/css/palettes/dark.system.css.map +1 -1
  181. package/css/palettes/high-contrast-dark.always.css.map +1 -1
  182. package/css/palettes/high-contrast-dark.class.css.map +1 -1
  183. package/css/palettes/high-contrast-dark.system.css.map +1 -1
  184. package/css/palettes/high-contrast.always.css.map +1 -1
  185. package/css/palettes/high-contrast.class.css.map +1 -1
  186. package/css/palettes/high-contrast.system.css.map +1 -1
  187. package/css/structure.css.map +1 -1
  188. package/css/text-alignment.css.map +1 -1
  189. package/css/text-transformation.css.map +1 -1
  190. package/css/typography.css.map +1 -1
  191. package/css/utils.bundle.css +1 -1
  192. package/css/utils.bundle.css.map +1 -1
  193. package/dist/cjs/{animation-qlGmEn5Y.js → animation-C0mOHzej.js} +6 -6
  194. package/dist/cjs/{app-globals-CtK-3pCu.js → app-globals-BREG4twP.js} +1 -1
  195. package/dist/cjs/{button-active-CugpWmFI.js → button-active-BKj1rdFx.js} +3 -3
  196. package/dist/cjs/{capacitor-BixsAzyb.js → capacitor-DmA66EwP.js} +3 -3
  197. package/dist/cjs/{config-DWdFbSNK.js → config-CjUbvdPW.js} +5 -4
  198. package/dist/cjs/{dir-Cn0z1rJH.js → dir-Brx7VkvP.js} +1 -1
  199. package/dist/{esm/focus-visible-vXpMhGrs.js → cjs/focus-visible-CCvKiLh3.js} +3 -23
  200. package/dist/cjs/{format-COAsdjOc.js → format-pp0Du3K-.js} +40 -30
  201. package/dist/cjs/{framework-delegate-CJT_QJQI.js → framework-delegate-NTLQ5YzV.js} +6 -10
  202. package/dist/cjs/{gesture-controller-dtqlP_q4.js → gesture-controller-BDUH7687.js} +15 -8
  203. package/dist/cjs/{haptic-BFgF-QCg.js → haptic-Ch-X4gRx.js} +3 -4
  204. package/dist/cjs/hardware-back-button-fqpYh-kd.js +121 -0
  205. package/dist/cjs/{helpers-Fh1iXsX9.js → helpers-CaLhEmTE.js} +6 -73
  206. package/dist/cjs/{index-YYUVCfP-.js → index-B7zJsYWS.js} +3 -3
  207. package/dist/cjs/{index-CNicxECl.js → index-BlshL9ib.js} +8 -9
  208. package/dist/cjs/{index-D94mERjz.js → index-Ck9advCT.js} +5 -5
  209. package/dist/cjs/{index-CM8iGvyx.js → index-D2X6b92x.js} +15 -16
  210. package/dist/cjs/{index-DRFkZu3V.js → index-D48vawBq.js} +2 -2
  211. package/dist/cjs/index-DkNv4J_i.js +10 -0
  212. package/dist/cjs/{index-CAvQ7Tka.js → index-P1nQxrpZ.js} +10 -4
  213. package/dist/cjs/{index-C1knGA9x.js → index-uvry__L4.js} +33 -65
  214. package/dist/cjs/{index-CxDnX7hd.js → index-wOmugbdg.js} +0 -2
  215. package/dist/cjs/index.cjs.js +17 -17
  216. package/dist/cjs/{input-shims-C8NCYfWv.js → input-shims-DvHAFqiP.js} +19 -22
  217. package/dist/cjs/{input.utils-CYZZsbdf.js → input.utils-CP4fzrqk.js} +6 -7
  218. package/dist/cjs/ion-accordion_2.cjs.entry.js +378 -382
  219. package/dist/cjs/ion-action-sheet.cjs.entry.js +178 -86
  220. package/dist/cjs/ion-alert.cjs.entry.js +250 -125
  221. package/dist/cjs/ion-app_8.cjs.entry.js +461 -608
  222. package/dist/cjs/ion-avatar_3.cjs.entry.js +19 -125
  223. package/dist/cjs/ion-back-button.cjs.entry.js +64 -49
  224. package/dist/cjs/ion-backdrop.cjs.entry.js +23 -22
  225. package/dist/cjs/ion-breadcrumb_2.cjs.entry.js +211 -169
  226. package/dist/cjs/ion-button_2.cjs.entry.js +152 -117
  227. package/dist/cjs/ion-card_5.cjs.entry.js +109 -79
  228. package/dist/cjs/ion-checkbox.cjs.entry.js +163 -129
  229. package/dist/cjs/ion-chip.cjs.entry.js +21 -56
  230. package/dist/cjs/ion-col_3.cjs.entry.js +186 -61
  231. package/dist/cjs/ion-datetime-button.cjs.entry.js +255 -247
  232. package/dist/cjs/ion-datetime.cjs.entry.js +2770 -0
  233. package/dist/cjs/ion-fab_3.cjs.entry.js +154 -112
  234. package/dist/cjs/ion-img.cjs.entry.js +34 -16
  235. package/dist/cjs/ion-infinite-scroll_2.cjs.entry.js +108 -156
  236. package/dist/cjs/ion-input-otp.cjs.entry.js +435 -437
  237. package/dist/cjs/ion-input-password-toggle.cjs.entry.js +40 -64
  238. package/dist/cjs/ion-input.cjs.entry.js +330 -276
  239. package/dist/cjs/ion-item-option_3.cjs.entry.js +136 -511
  240. package/dist/cjs/ion-item_8.cjs.entry.js +217 -189
  241. package/dist/cjs/ion-loading.cjs.entry.js +151 -68
  242. package/dist/cjs/ion-menu_3.cjs.entry.js +181 -137
  243. package/dist/cjs/ion-modal.cjs.entry.js +570 -500
  244. package/dist/cjs/ion-nav_2.cjs.entry.js +103 -163
  245. package/dist/cjs/ion-picker-column-option.cjs.entry.js +39 -39
  246. package/dist/cjs/ion-picker-column.cjs.entry.js +421 -409
  247. package/dist/cjs/ion-picker.cjs.entry.js +405 -400
  248. package/dist/cjs/ion-popover.cjs.entry.js +323 -211
  249. package/dist/cjs/ion-progress-bar.cjs.entry.js +35 -47
  250. package/dist/cjs/ion-radio_2.cjs.entry.js +216 -161
  251. package/dist/cjs/ion-range.cjs.entry.js +307 -249
  252. package/dist/cjs/ion-refresher_2.cjs.entry.js +174 -121
  253. package/dist/cjs/ion-reorder_2.cjs.entry.js +59 -53
  254. package/dist/cjs/ion-ripple-effect.cjs.entry.js +18 -26
  255. package/dist/cjs/ion-route_4.cjs.entry.js +178 -75
  256. package/dist/cjs/ion-searchbar.cjs.entry.js +308 -331
  257. package/dist/cjs/ion-segment-content.cjs.entry.js +2 -2
  258. package/dist/cjs/ion-segment-view.cjs.entry.js +28 -27
  259. package/dist/cjs/ion-segment_2.cjs.entry.js +177 -141
  260. package/dist/cjs/ion-select-modal.cjs.entry.js +49 -69
  261. package/dist/cjs/ion-select_3.cjs.entry.js +481 -385
  262. package/dist/cjs/ion-spinner.cjs.entry.js +28 -36
  263. package/dist/cjs/ion-split-pane.cjs.entry.js +34 -25
  264. package/dist/cjs/ion-tab-bar_2.cjs.entry.js +116 -179
  265. package/dist/cjs/ion-tab_2.cjs.entry.js +54 -29
  266. package/dist/cjs/ion-text.cjs.entry.js +13 -7
  267. package/dist/cjs/ion-textarea.cjs.entry.js +274 -269
  268. package/dist/cjs/ion-toast.cjs.entry.js +264 -169
  269. package/dist/cjs/ion-toggle.cjs.entry.js +184 -187
  270. package/dist/cjs/ionic-global-k6hOWWpn.js +156 -0
  271. package/dist/cjs/ionic.cjs.js +4 -4
  272. package/dist/cjs/{ios.transition-BgDCUY4Y.js → ios.transition-KvuRAe2W.js} +14 -20
  273. package/dist/cjs/{item-multiple-inputs-DKn76MYO.js → item-multiple-inputs-BdYSbfKN.js} +1 -1
  274. package/dist/cjs/{keyboard-nne7rvBK.js → keyboard-Cix5TVkD.js} +4 -5
  275. package/dist/cjs/{keyboard-BbZXOwZg.js → keyboard-cHxZlTyz.js} +3 -3
  276. package/dist/cjs/keyboard-controller-PtZoN2GS.js +167 -0
  277. package/dist/cjs/loader.cjs.js +4 -4
  278. package/dist/cjs/{md.transition-Debf4tYr.js → md.transition-Bjl5Ozph.js} +8 -10
  279. package/dist/cjs/{notch-controller-CFlPw7ER.js → notch-controller-BEUpEgb5.js} +4 -4
  280. package/dist/cjs/{overlay-control-label-DnRLQR1t.js → overlay-control-label-D2sdL2O8.js} +11 -13
  281. package/dist/cjs/{overlays-DYBUkNQu.js → overlays-IlP4H2Gn.js} +60 -336
  282. package/dist/cjs/{select-option-render-BqJEK1N1.js → select-option-render-pULCGldr.js} +3 -4
  283. package/dist/cjs/{status-tap-hwqc0yb_.js → status-tap-BR_ujYHg.js} +3 -4
  284. package/dist/cjs/{swipe-back-DqQx5QCp.js → swipe-back-DzQKEl5g.js} +5 -6
  285. package/dist/cjs/{theme-IlOsGAz7.js → theme-Bw0rpaNN.js} +7 -26
  286. package/dist/cjs/validity-BpS37YFM.js +19 -0
  287. package/dist/collection/collection-manifest.json +1 -13
  288. package/dist/collection/components/accordion/accordion.ios.css +58 -73
  289. package/dist/collection/components/accordion/accordion.js +327 -338
  290. package/dist/collection/components/accordion/accordion.md.css +59 -67
  291. package/dist/collection/components/accordion-group/accordion-group.ios.css +4 -16
  292. package/dist/collection/components/accordion-group/accordion-group.js +56 -69
  293. package/dist/collection/components/accordion-group/accordion-group.md.css +4 -22
  294. package/dist/collection/components/action-sheet/action-sheet.ios.css +54 -184
  295. package/dist/collection/components/action-sheet/action-sheet.js +166 -76
  296. package/dist/collection/components/action-sheet/action-sheet.md.css +55 -179
  297. package/dist/collection/components/action-sheet/test/basic/fixture.js +3 -0
  298. package/dist/collection/components/alert/alert.ios.css +54 -247
  299. package/dist/collection/components/alert/alert.js +236 -113
  300. package/dist/collection/components/alert/alert.md.css +56 -243
  301. package/dist/collection/components/app/app.js +86 -15
  302. package/dist/collection/components/avatar/avatar.ios.css +33 -7
  303. package/dist/collection/components/avatar/avatar.js +4 -120
  304. package/dist/collection/components/avatar/avatar.md.css +0 -51
  305. package/dist/collection/components/back-button/back-button.ios.css +48 -60
  306. package/dist/collection/components/back-button/back-button.js +61 -46
  307. package/dist/collection/components/back-button/back-button.md.css +48 -60
  308. package/dist/collection/components/backdrop/backdrop.ios.css +19 -56
  309. package/dist/collection/components/backdrop/backdrop.js +22 -26
  310. package/dist/collection/components/backdrop/backdrop.md.css +19 -56
  311. package/dist/collection/components/badge/badge.ios.css +12 -137
  312. package/dist/collection/components/badge/badge.js +15 -145
  313. package/dist/collection/components/badge/badge.md.css +12 -122
  314. package/dist/collection/components/breadcrumb/breadcrumb.ios.css +8 -20
  315. package/dist/collection/components/breadcrumb/breadcrumb.js +101 -72
  316. package/dist/collection/components/breadcrumb/breadcrumb.md.css +8 -20
  317. package/dist/collection/components/breadcrumbs/breadcrumbs.ios.css +0 -6
  318. package/dist/collection/components/breadcrumbs/breadcrumbs.js +112 -99
  319. package/dist/collection/components/breadcrumbs/breadcrumbs.md.css +0 -6
  320. package/dist/collection/components/button/button.ios.css +46 -154
  321. package/dist/collection/components/button/button.js +157 -122
  322. package/dist/collection/components/button/button.md.css +50 -150
  323. package/dist/collection/components/buttons/buttons.ios.css +7 -59
  324. package/dist/collection/components/buttons/buttons.js +21 -29
  325. package/dist/collection/components/buttons/buttons.md.css +3 -55
  326. package/dist/collection/components/card/card.ios.css +14 -65
  327. package/dist/collection/components/card/card.js +63 -61
  328. package/dist/collection/components/card/card.md.css +14 -65
  329. package/dist/collection/components/card-content/card-content.ios.css +35 -20
  330. package/dist/collection/components/card-content/card-content.js +10 -12
  331. package/dist/collection/components/card-content/card-content.md.css +35 -20
  332. package/dist/collection/components/card-header/card-header.ios.css +15 -27
  333. package/dist/collection/components/card-header/card-header.js +21 -20
  334. package/dist/collection/components/card-header/card-header.md.css +15 -27
  335. package/dist/collection/components/card-subtitle/card-subtitle.ios.css +0 -12
  336. package/dist/collection/components/card-subtitle/card-subtitle.js +14 -11
  337. package/dist/collection/components/card-subtitle/card-subtitle.md.css +0 -12
  338. package/dist/collection/components/card-title/card-title.ios.css +0 -73
  339. package/dist/collection/components/card-title/card-title.js +14 -11
  340. package/dist/collection/components/card-title/card-title.md.css +0 -73
  341. package/dist/collection/components/checkbox/checkbox.ios.css +117 -242
  342. package/dist/collection/components/checkbox/checkbox.js +160 -165
  343. package/dist/collection/components/checkbox/checkbox.md.css +118 -243
  344. package/dist/collection/components/chip/chip.ios.css +14 -67
  345. package/dist/collection/components/chip/chip.js +20 -116
  346. package/dist/collection/components/chip/chip.md.css +14 -67
  347. package/dist/collection/components/col/col.css +4 -192
  348. package/dist/collection/components/col/col.js +186 -212
  349. package/dist/collection/components/content/content.css +2 -47
  350. package/dist/collection/components/content/content.js +102 -78
  351. package/dist/collection/components/datetime/datetime.ios.css +148 -304
  352. package/dist/collection/components/datetime/datetime.js +1068 -910
  353. package/dist/collection/components/datetime/datetime.md.css +138 -294
  354. package/dist/collection/components/datetime/utils/data.js +18 -19
  355. package/dist/collection/components/datetime/utils/format.js +21 -11
  356. package/dist/collection/components/datetime/utils/manipulation.js +8 -8
  357. package/dist/collection/components/datetime/utils/parse.js +10 -10
  358. package/dist/collection/components/datetime/utils/state.js +8 -2
  359. package/dist/collection/components/datetime/utils/validate.js +4 -5
  360. package/dist/collection/components/datetime-button/datetime-button.ios.css +5 -6
  361. package/dist/collection/components/datetime-button/datetime-button.js +253 -246
  362. package/dist/collection/components/datetime-button/datetime-button.md.css +5 -6
  363. package/dist/collection/components/fab/fab.css +1 -25
  364. package/dist/collection/components/fab/fab.js +25 -22
  365. package/dist/collection/components/fab-button/fab-button.ios.css +6 -18
  366. package/dist/collection/components/fab-button/fab-button.js +117 -83
  367. package/dist/collection/components/fab-button/fab-button.md.css +8 -20
  368. package/dist/collection/components/fab-list/fab-list.css +0 -12
  369. package/dist/collection/components/fab-list/fab-list.js +15 -20
  370. package/dist/collection/components/footer/footer.ios.css +6 -33
  371. package/dist/collection/components/footer/footer.js +65 -151
  372. package/dist/collection/components/footer/footer.md.css +0 -40
  373. package/dist/collection/components/grid/grid.css +0 -12
  374. package/dist/collection/components/grid/grid.js +9 -15
  375. package/dist/collection/components/header/header.ios.css +133 -178
  376. package/dist/collection/components/header/header.js +70 -202
  377. package/dist/collection/components/header/header.md.css +9 -199
  378. package/dist/collection/components/header/header.utils.js +13 -6
  379. package/dist/collection/components/img/img.js +34 -16
  380. package/dist/collection/components/infinite-scroll/infinite-scroll.js +76 -164
  381. package/dist/collection/components/infinite-scroll-content/infinite-scroll-content.ios.css +0 -12
  382. package/dist/collection/components/infinite-scroll-content/infinite-scroll-content.js +30 -19
  383. package/dist/collection/components/infinite-scroll-content/infinite-scroll-content.md.css +0 -12
  384. package/dist/collection/components/input/input.ios.css +135 -223
  385. package/dist/collection/components/input/input.js +339 -307
  386. package/dist/collection/components/input/input.md.css +207 -193
  387. package/dist/collection/components/input-otp/input-otp.ios.css +60 -105
  388. package/dist/collection/components/input-otp/input-otp.js +432 -437
  389. package/dist/collection/components/input-otp/input-otp.md.css +60 -105
  390. package/dist/collection/components/input-password-toggle/input-password-toggle.js +37 -60
  391. package/dist/collection/components/item/item.ios.css +80 -120
  392. package/dist/collection/components/item/item.js +113 -102
  393. package/dist/collection/components/item/item.md.css +79 -131
  394. package/dist/collection/components/item-divider/item-divider.ios.css +0 -18
  395. package/dist/collection/components/item-divider/item-divider.js +23 -21
  396. package/dist/collection/components/item-divider/item-divider.md.css +0 -18
  397. package/dist/collection/components/item-group/item-group.ios.css +0 -12
  398. package/dist/collection/components/item-group/item-group.js +7 -13
  399. package/dist/collection/components/item-group/item-group.md.css +0 -12
  400. package/dist/collection/components/item-option/item-option.ios.css +29 -136
  401. package/dist/collection/components/item-option/item-option.js +56 -92
  402. package/dist/collection/components/item-option/item-option.md.css +29 -136
  403. package/dist/collection/components/item-options/item-options.ios.css +34 -77
  404. package/dist/collection/components/item-options/item-options.js +17 -20
  405. package/dist/collection/components/item-options/item-options.md.css +34 -77
  406. package/dist/collection/components/item-sliding/{item-sliding.native.css → item-sliding.css} +9 -84
  407. package/dist/collection/components/item-sliding/item-sliding.js +61 -441
  408. package/dist/collection/components/item-sliding/test/test.utils.js +0 -13
  409. package/dist/collection/components/label/label.ios.css +0 -18
  410. package/dist/collection/components/label/label.js +32 -15
  411. package/dist/collection/components/label/label.md.css +0 -18
  412. package/dist/collection/components/list/list.ios.css +14 -54
  413. package/dist/collection/components/list/list.js +19 -55
  414. package/dist/collection/components/list/list.md.css +16 -56
  415. package/dist/collection/components/list-header/list-header.ios.css +38 -82
  416. package/dist/collection/components/list-header/list-header.js +18 -11
  417. package/dist/collection/components/list-header/list-header.md.css +38 -82
  418. package/dist/collection/components/loading/loading.ios.css +1 -13
  419. package/dist/collection/components/loading/loading.js +143 -62
  420. package/dist/collection/components/loading/loading.md.css +1 -13
  421. package/dist/collection/components/menu/menu.ios.css +3 -15
  422. package/dist/collection/components/menu/menu.js +108 -71
  423. package/dist/collection/components/menu/menu.md.css +3 -15
  424. package/dist/collection/components/menu-button/menu-button.ios.css +14 -48
  425. package/dist/collection/components/menu-button/menu-button.js +38 -45
  426. package/dist/collection/components/menu-button/menu-button.md.css +15 -49
  427. package/dist/collection/components/menu-toggle/menu-toggle.js +25 -21
  428. package/dist/collection/components/modal/animations/ios.enter.js +1 -1
  429. package/dist/collection/components/modal/animations/md.enter.js +1 -1
  430. package/dist/collection/components/modal/animations/sheet.js +2 -8
  431. package/dist/collection/components/modal/gestures/sheet.js +32 -86
  432. package/dist/collection/components/modal/gestures/swipe-to-close.js +15 -3
  433. package/dist/collection/components/modal/modal.ios.css +70 -178
  434. package/dist/collection/components/modal/modal.js +404 -272
  435. package/dist/collection/components/modal/modal.md.css +70 -178
  436. package/dist/collection/components/modal/safe-area-utils.js +6 -7
  437. package/dist/collection/components/modal/test/fixtures.js +3 -0
  438. package/dist/collection/components/nav/nav.css +1 -7
  439. package/dist/collection/components/nav/nav.js +72 -256
  440. package/dist/collection/components/nav/view-controller.js +7 -1
  441. package/dist/collection/components/nav-link/nav-link.js +21 -14
  442. package/dist/collection/components/note/note.ios.css +0 -12
  443. package/dist/collection/components/note/note.js +14 -11
  444. package/dist/collection/components/note/note.md.css +0 -12
  445. package/dist/collection/components/picker/picker.ios.css +3 -15
  446. package/dist/collection/components/picker/picker.js +403 -398
  447. package/dist/collection/components/picker/picker.md.css +3 -15
  448. package/dist/collection/components/picker-column/picker-column.css +5 -9
  449. package/dist/collection/components/picker-column/picker-column.js +418 -409
  450. package/dist/collection/components/picker-column-option/picker-column-option.ios.css +0 -6
  451. package/dist/collection/components/picker-column-option/picker-column-option.js +38 -42
  452. package/dist/collection/components/picker-column-option/picker-column-option.md.css +6 -7
  453. package/dist/collection/components/popover/animations/ios.enter.js +1 -2
  454. package/dist/collection/components/popover/animations/md.enter.js +1 -2
  455. package/dist/collection/components/popover/popover.ios.css +2 -15
  456. package/dist/collection/components/popover/popover.js +313 -199
  457. package/dist/collection/components/popover/popover.md.css +2 -15
  458. package/dist/collection/components/popover/test/fixture.js +1 -0
  459. package/dist/collection/components/popover/utils.js +4 -6
  460. package/dist/collection/components/progress-bar/progress-bar.ios.css +17 -48
  461. package/dist/collection/components/progress-bar/progress-bar.js +33 -65
  462. package/dist/collection/components/progress-bar/progress-bar.md.css +17 -48
  463. package/dist/collection/components/radio/radio.ios.css +102 -207
  464. package/dist/collection/components/radio/radio.js +108 -77
  465. package/dist/collection/components/radio/radio.md.css +102 -207
  466. package/dist/collection/components/radio-group/radio-group.ios.css +19 -43
  467. package/dist/collection/components/radio-group/radio-group.js +107 -113
  468. package/dist/collection/components/radio-group/radio-group.md.css +19 -43
  469. package/dist/collection/components/radio-group/test/fixtures.js +2 -0
  470. package/dist/collection/components/range/range.ios.css +85 -128
  471. package/dist/collection/components/range/range.js +303 -245
  472. package/dist/collection/components/range/range.md.css +85 -128
  473. package/dist/collection/components/refresher/refresher.ios.css +1 -14
  474. package/dist/collection/components/refresher/refresher.js +117 -88
  475. package/dist/collection/components/refresher/refresher.md.css +2 -15
  476. package/dist/collection/components/refresher-content/refresher-content.js +47 -31
  477. package/dist/collection/components/reorder/reorder.ios.css +0 -6
  478. package/dist/collection/components/reorder/reorder.js +7 -33
  479. package/dist/collection/components/reorder/reorder.md.css +0 -6
  480. package/dist/collection/components/reorder-group/reorder-group.css +0 -6
  481. package/dist/collection/components/reorder-group/reorder-group.js +47 -22
  482. package/dist/collection/components/ripple-effect/{ripple-effect.common.css → ripple-effect.css} +1 -7
  483. package/dist/collection/components/ripple-effect/ripple-effect.js +17 -26
  484. package/dist/collection/components/route/route.js +39 -14
  485. package/dist/collection/components/route-redirect/route-redirect.js +31 -0
  486. package/dist/collection/components/router/router.js +37 -37
  487. package/dist/collection/components/router/utils/dom.js +25 -7
  488. package/dist/collection/components/router/utils/matching.js +7 -9
  489. package/dist/collection/components/router/utils/parser.js +1 -1
  490. package/dist/collection/components/router/utils/path.js +0 -1
  491. package/dist/collection/components/router-link/router-link.css +2 -8
  492. package/dist/collection/components/router-link/router-link.js +40 -19
  493. package/dist/collection/components/router-outlet/router-outlet.css +1 -7
  494. package/dist/collection/components/router-outlet/router-outlet.js +83 -25
  495. package/dist/collection/components/row/row.css +0 -16
  496. package/dist/collection/components/row/row.js +2 -9
  497. package/dist/collection/components/searchbar/searchbar.ios.css +18 -56
  498. package/dist/collection/components/searchbar/searchbar.js +321 -380
  499. package/dist/collection/components/searchbar/searchbar.md.css +18 -56
  500. package/dist/collection/components/segment/segment.ios.css +2 -45
  501. package/dist/collection/components/segment/segment.js +126 -94
  502. package/dist/collection/components/segment/segment.md.css +2 -45
  503. package/dist/collection/components/segment-button/segment-button.ios.css +105 -146
  504. package/dist/collection/components/segment-button/segment-button.js +49 -46
  505. package/dist/collection/components/segment-button/segment-button.md.css +107 -148
  506. package/dist/collection/components/segment-content/segment-content.js +1 -1
  507. package/dist/collection/components/segment-view/segment-view.ios.css +0 -6
  508. package/dist/collection/components/segment-view/segment-view.js +28 -27
  509. package/dist/collection/components/segment-view/segment-view.md.css +0 -6
  510. package/dist/collection/components/select/select.ios.css +177 -316
  511. package/dist/collection/components/select/select.js +401 -399
  512. package/dist/collection/components/select/select.md.css +179 -332
  513. package/dist/collection/components/select-modal/select-modal.ios.css +45 -293
  514. package/dist/collection/components/select-modal/select-modal.js +37 -79
  515. package/dist/collection/components/select-modal/select-modal.md.css +43 -273
  516. package/dist/collection/components/select-modal/test/fixtures.js +8 -1
  517. package/dist/collection/components/select-option/select-option.js +48 -15
  518. package/dist/collection/components/select-popover/select-popover.ios.css +124 -188
  519. package/dist/collection/components/select-popover/select-popover.js +44 -37
  520. package/dist/collection/components/select-popover/select-popover.md.css +47 -228
  521. package/dist/collection/components/select-popover/test/fixtures.js +8 -1
  522. package/dist/collection/components/skeleton-text/skeleton-text.css +0 -6
  523. package/dist/collection/components/skeleton-text/skeleton-text.js +15 -15
  524. package/dist/collection/components/spinner/{spinner.ionic.css → spinner.css} +10 -78
  525. package/dist/collection/components/spinner/spinner.js +26 -55
  526. package/dist/collection/components/split-pane/split-pane.ios.css +2 -20
  527. package/dist/collection/components/split-pane/split-pane.js +33 -28
  528. package/dist/collection/components/split-pane/split-pane.md.css +2 -20
  529. package/dist/collection/components/tab/tab.js +17 -10
  530. package/dist/collection/components/tab-bar/tab-bar.ios.css +43 -86
  531. package/dist/collection/components/tab-bar/tab-bar.js +44 -190
  532. package/dist/collection/components/tab-bar/tab-bar.md.css +43 -86
  533. package/dist/collection/components/tab-button/tab-button.ios.css +95 -171
  534. package/dist/collection/components/tab-button/tab-button.js +68 -74
  535. package/dist/collection/components/tab-button/tab-button.md.css +93 -137
  536. package/dist/collection/components/tabs/tabs.css +1 -7
  537. package/dist/collection/components/tabs/tabs.js +33 -23
  538. package/dist/collection/components/text/text.css +0 -6
  539. package/dist/collection/components/text/text.js +12 -7
  540. package/dist/collection/components/textarea/textarea.ios.css +158 -298
  541. package/dist/collection/components/textarea/textarea.js +275 -295
  542. package/dist/collection/components/textarea/textarea.md.css +159 -312
  543. package/dist/collection/components/thumbnail/thumbnail.css +0 -6
  544. package/dist/collection/components/thumbnail/thumbnail.js +2 -9
  545. package/dist/collection/components/title/title.ios.css +4 -32
  546. package/dist/collection/components/title/title.js +23 -13
  547. package/dist/collection/components/title/title.md.css +4 -39
  548. package/dist/collection/components/toast/animations/utils.js +1 -1
  549. package/dist/collection/components/toast/toast.ios.css +45 -84
  550. package/dist/collection/components/toast/toast.js +232 -178
  551. package/dist/collection/components/toast/toast.md.css +45 -84
  552. package/dist/collection/components/toggle/toggle.ios.css +127 -247
  553. package/dist/collection/components/toggle/toggle.js +175 -177
  554. package/dist/collection/components/toggle/toggle.md.css +127 -245
  555. package/dist/collection/components/toolbar/toolbar.ios.css +47 -90
  556. package/dist/collection/components/toolbar/toolbar.js +25 -222
  557. package/dist/collection/components/toolbar/toolbar.md.css +47 -90
  558. package/dist/collection/global/config.js +4 -6
  559. package/dist/collection/global/ionic-global.js +20 -242
  560. package/dist/collection/index.js +1 -1
  561. package/dist/collection/utils/animation/animation.js +3 -3
  562. package/dist/collection/utils/config.js +5 -4
  563. package/dist/collection/utils/focus-controller/index.js +1 -1
  564. package/dist/collection/utils/focus-trap.js +5 -16
  565. package/dist/collection/utils/focus-visible.js +0 -22
  566. package/dist/collection/utils/forms/index.js +0 -1
  567. package/dist/collection/utils/forms/validity.js +0 -31
  568. package/dist/collection/utils/framework-delegate.js +5 -9
  569. package/dist/collection/utils/gesture/gesture-controller.js +15 -8
  570. package/dist/collection/utils/gesture/index.js +10 -2
  571. package/dist/collection/utils/gesture/listener.js +1 -1
  572. package/dist/collection/utils/hardware-back-button.js +3 -18
  573. package/dist/collection/utils/helpers.js +5 -72
  574. package/dist/collection/utils/input-shims/hacks/scroll-assist.js +4 -5
  575. package/dist/collection/utils/input-shims/hacks/scroll-data.js +1 -2
  576. package/dist/collection/utils/keyboard/keyboard-controller.js +6 -8
  577. package/dist/collection/utils/keyboard/keyboard.js +1 -1
  578. package/dist/collection/utils/logging/index.js +23 -4
  579. package/dist/collection/utils/media.js +0 -1
  580. package/dist/collection/utils/menu-controller/animations/overlay.js +3 -3
  581. package/dist/collection/utils/menu-controller/animations/push.js +1 -2
  582. package/dist/collection/utils/menu-controller/animations/reveal.js +1 -2
  583. package/dist/collection/utils/menu-controller/index.js +1 -2
  584. package/dist/collection/utils/native/haptic.js +2 -3
  585. package/dist/collection/utils/native/keyboard.js +2 -2
  586. package/dist/collection/utils/native/status-bar.js +1 -1
  587. package/dist/collection/utils/overlay-control-label.js +11 -13
  588. package/dist/collection/utils/overlays.js +45 -312
  589. package/dist/collection/utils/platform.js +4 -5
  590. package/dist/collection/utils/rtl/dir.js +1 -1
  591. package/dist/collection/utils/sanitization/index.js +2 -2
  592. package/dist/collection/utils/select-option-render.js +1 -2
  593. package/dist/collection/utils/slot-mutation-controller.js +1 -2
  594. package/dist/collection/utils/test/playwright/apply-keyboard-focus.js +1 -1
  595. package/dist/collection/utils/test/playwright/drag-element.js +11 -35
  596. package/dist/collection/utils/test/playwright/generator.js +25 -51
  597. package/dist/collection/utils/test/playwright/page/event-spy.js +11 -12
  598. package/dist/collection/utils/test/playwright/page/utils/goto.js +5 -15
  599. package/dist/collection/utils/test/playwright/page/utils/set-content.js +4 -27
  600. package/dist/collection/utils/test/playwright/page/utils/set-ion-viewport.js +2 -3
  601. package/dist/collection/utils/test/press-keys.js +10 -17
  602. package/dist/collection/utils/theme.js +7 -26
  603. package/dist/collection/utils/transition/ios.transition.js +9 -14
  604. package/dist/collection/utils/transition/md.transition.js +3 -4
  605. package/dist/docs.json +503 -10023
  606. package/dist/esm/{animation-ChfHU0RG.js → animation-CGFdmGk9.js} +5 -5
  607. package/dist/esm/{app-globals-D1OOQlqq.js → app-globals-CYmMeGdU.js} +1 -1
  608. package/dist/esm/{button-active-CPYK0dNo.js → button-active--80YqSHA.js} +3 -3
  609. package/dist/esm/{capacitor-DG_4yVXz.js → capacitor-CFERIeaU.js} +1 -1
  610. package/dist/esm/{config-BwKpO3Is.js → config-DWCzVL3Y.js} +5 -4
  611. package/dist/esm/{dir-C53feagD.js → dir-B-FxiyeI.js} +1 -1
  612. package/dist/{cjs/focus-visible-BIj-I3-C.js → esm/focus-visible-BmVRXR1y.js} +1 -27
  613. package/dist/esm/{format-2WlZcMvG.js → format-Dcwga61t.js} +41 -31
  614. package/dist/esm/{framework-delegate-DO2QXccA.js → framework-delegate--ajhSeKH.js} +6 -10
  615. package/dist/esm/{gesture-controller-BTEOs1at.js → gesture-controller-TXPDHL13.js} +15 -8
  616. package/dist/esm/{haptic-BWlRCqa-.js → haptic-Cq4UAeka.js} +3 -4
  617. package/dist/esm/hardware-back-button-gLJHMX_F.js +115 -0
  618. package/dist/esm/{helpers-DfF5_wJc.js → helpers-DexiPLIC.js} +7 -73
  619. package/dist/esm/{index-BSDDOljg.js → index-8s8kZKJ7.js} +5 -5
  620. package/dist/esm/{index-DNY2GOUg.js → index-BCgUwrV0.js} +3 -4
  621. package/dist/esm/{index-B4Kq2YNk.js → index-BvabGprD.js} +1 -2
  622. package/dist/esm/{index-Mq5pCWmZ.js → index-CKM1DdGm.js} +3 -3
  623. package/dist/esm/{index-C0EQceqV.js → index-ChhhtsGZ.js} +34 -66
  624. package/dist/esm/{index-7eS8XtuU.js → index-CumkqGQF.js} +12 -13
  625. package/dist/esm/{index-CfgBF1SE.js → index-DppOcPFQ.js} +10 -4
  626. package/dist/esm/index-ZjP4CjeZ.js +7 -0
  627. package/dist/esm/{index-taYRjZGp.js → index-_Za5VB9w.js} +2 -2
  628. package/dist/esm/index.js +17 -16
  629. package/dist/esm/{input-shims-tZfqB5a5.js → input-shims-BB0AKb_k.js} +11 -14
  630. package/dist/esm/{input.utils-fs4B7WL5.js → input.utils-J6HWocLA.js} +4 -5
  631. package/dist/esm/ion-accordion_2.entry.js +378 -382
  632. package/dist/esm/ion-action-sheet.entry.js +178 -86
  633. package/dist/esm/ion-alert.entry.js +250 -125
  634. package/dist/esm/ion-app_8.entry.js +460 -607
  635. package/dist/esm/ion-avatar_3.entry.js +19 -125
  636. package/dist/esm/ion-back-button.entry.js +64 -49
  637. package/dist/esm/ion-backdrop.entry.js +23 -22
  638. package/dist/esm/ion-breadcrumb_2.entry.js +211 -169
  639. package/dist/esm/ion-button_2.entry.js +152 -117
  640. package/dist/esm/ion-card_5.entry.js +109 -79
  641. package/dist/esm/ion-checkbox.entry.js +163 -129
  642. package/dist/esm/ion-chip.entry.js +21 -56
  643. package/dist/esm/ion-col_3.entry.js +186 -61
  644. package/dist/esm/ion-datetime-button.entry.js +255 -247
  645. package/dist/esm/ion-datetime.entry.js +2768 -0
  646. package/dist/esm/ion-fab_3.entry.js +154 -112
  647. package/dist/esm/ion-img.entry.js +34 -16
  648. package/dist/esm/ion-infinite-scroll_2.entry.js +108 -156
  649. package/dist/esm/ion-input-otp.entry.js +435 -437
  650. package/dist/esm/ion-input-password-toggle.entry.js +40 -64
  651. package/dist/esm/ion-input.entry.js +330 -276
  652. package/dist/esm/ion-item-option_3.entry.js +136 -511
  653. package/dist/esm/ion-item_8.entry.js +217 -189
  654. package/dist/esm/ion-loading.entry.js +151 -68
  655. package/dist/esm/ion-menu_3.entry.js +181 -137
  656. package/dist/esm/ion-modal.entry.js +528 -458
  657. package/dist/esm/ion-nav_2.entry.js +103 -163
  658. package/dist/esm/ion-picker-column-option.entry.js +39 -39
  659. package/dist/esm/ion-picker-column.entry.js +421 -409
  660. package/dist/esm/ion-picker.entry.js +405 -400
  661. package/dist/esm/ion-popover.entry.js +323 -211
  662. package/dist/esm/ion-progress-bar.entry.js +35 -47
  663. package/dist/esm/ion-radio_2.entry.js +216 -161
  664. package/dist/esm/ion-range.entry.js +307 -249
  665. package/dist/esm/ion-refresher_2.entry.js +174 -121
  666. package/dist/esm/ion-reorder_2.entry.js +59 -53
  667. package/dist/esm/ion-ripple-effect.entry.js +18 -26
  668. package/dist/esm/ion-route_4.entry.js +178 -75
  669. package/dist/esm/ion-searchbar.entry.js +308 -331
  670. package/dist/esm/ion-segment-content.entry.js +2 -2
  671. package/dist/esm/ion-segment-view.entry.js +28 -27
  672. package/dist/esm/ion-segment_2.entry.js +177 -141
  673. package/dist/esm/ion-select-modal.entry.js +49 -69
  674. package/dist/esm/ion-select_3.entry.js +482 -386
  675. package/dist/esm/ion-spinner.entry.js +28 -36
  676. package/dist/esm/ion-split-pane.entry.js +34 -25
  677. package/dist/esm/ion-tab-bar_2.entry.js +115 -178
  678. package/dist/esm/ion-tab_2.entry.js +54 -29
  679. package/dist/esm/ion-text.entry.js +13 -7
  680. package/dist/esm/ion-textarea.entry.js +274 -269
  681. package/dist/esm/ion-toast.entry.js +243 -148
  682. package/dist/esm/ion-toggle.entry.js +184 -187
  683. package/dist/esm/ionic-global-BVB7BrLT.js +151 -0
  684. package/dist/esm/ionic.js +5 -5
  685. package/dist/esm/{ios.transition-C3r-0w96.js → ios.transition-BdhybwLl.js} +14 -20
  686. package/dist/esm/{item-multiple-inputs-C6onMFOo.js → item-multiple-inputs-rU8VaNNg.js} +1 -1
  687. package/dist/esm/{keyboard-BzbtCDwZ.js → keyboard-Cj8mLJeq.js} +4 -5
  688. package/dist/esm/{keyboard-DYGmALa7.js → keyboard-DAF8GNJ9.js} +3 -3
  689. package/dist/esm/keyboard-controller-DEwoa1ev.js +165 -0
  690. package/dist/esm/loader.js +5 -5
  691. package/dist/esm/{md.transition-CPHOF5T9.js → md.transition-B5lqKGCs.js} +8 -10
  692. package/dist/esm/{notch-controller-CsbpmbOz.js → notch-controller-CrUGyHYz.js} +2 -2
  693. package/dist/esm/{overlay-control-label-CODBQrPj.js → overlay-control-label-BSQPZ79H.js} +11 -13
  694. package/dist/esm/{overlays-C1NQMs9y.js → overlays-CjWwtvf1.js} +57 -333
  695. package/dist/esm/{select-option-render-BlKZ2H83.js → select-option-render-C4m76VGH.js} +3 -4
  696. package/dist/esm/{status-tap-BueE8Coq.js → status-tap-DpLhkDWs.js} +3 -4
  697. package/dist/esm/{swipe-back-qmvTRnSq.js → swipe-back-cz4-lyG3.js} +5 -6
  698. package/dist/esm/theme-byZM6qHV.js +48 -0
  699. package/dist/esm/validity-DJztqcrH.js +17 -0
  700. package/dist/html.html-data.json +146 -2713
  701. package/dist/ionic/index.esm.js +1 -1
  702. package/dist/ionic/ionic.esm.js +1 -1
  703. package/dist/ionic/p-0266b7e1.entry.js +4 -0
  704. package/dist/ionic/p-08443c08.entry.js +4 -0
  705. package/dist/ionic/p-08f1ed1c.entry.js +4 -0
  706. package/dist/ionic/p-09b47b7d.entry.js +4 -0
  707. package/dist/ionic/p-0FNc80PN.js +4 -0
  708. package/dist/ionic/p-12589d59.entry.js +4 -0
  709. package/dist/ionic/p-1d2e53e8.entry.js +4 -0
  710. package/dist/ionic/p-1edf0573.entry.js +4 -0
  711. package/dist/ionic/p-214e000a.entry.js +4 -0
  712. package/dist/ionic/p-21a7fb2a.entry.js +4 -0
  713. package/dist/ionic/p-2ce59395.entry.js +4 -0
  714. package/dist/ionic/p-33829e94.entry.js +4 -0
  715. package/dist/ionic/p-374b10cb.entry.js +4 -0
  716. package/dist/ionic/p-3835a020.entry.js +4 -0
  717. package/dist/ionic/p-3c5fdd27.entry.js +4 -0
  718. package/dist/ionic/p-40424a88.entry.js +4 -0
  719. package/dist/ionic/p-48b6835f.entry.js +4 -0
  720. package/dist/ionic/p-4eOQC00Z.js +4 -0
  721. package/dist/ionic/p-5394e1d4.entry.js +4 -0
  722. package/dist/ionic/p-53bac1c9.entry.js +4 -0
  723. package/dist/ionic/p-5506caeb.entry.js +4 -0
  724. package/dist/ionic/p-5993a77f.entry.js +4 -0
  725. package/dist/ionic/p-6277efba.entry.js +4 -0
  726. package/dist/ionic/p-62e71297.entry.js +4 -0
  727. package/dist/ionic/p-6b286c5c.entry.js +4 -0
  728. package/dist/ionic/p-7116e558.entry.js +4 -0
  729. package/dist/ionic/p-74f30659.entry.js +4 -0
  730. package/dist/ionic/p-7bb3e957.entry.js +4 -0
  731. package/dist/ionic/p-82525fb0.entry.js +4 -0
  732. package/dist/ionic/p-865fa114.entry.js +4 -0
  733. package/dist/ionic/p-8a21bdbd.entry.js +4 -0
  734. package/dist/ionic/p-8e1d9e3a.entry.js +4 -0
  735. package/dist/ionic/p-8f3a1995.entry.js +4 -0
  736. package/dist/ionic/p-91c6faf1.entry.js +4 -0
  737. package/dist/ionic/p-9b865fe6.entry.js +4 -0
  738. package/dist/ionic/p-9nmHvEvw.js +4 -0
  739. package/dist/ionic/p-B-FxiyeI.js +4 -0
  740. package/dist/ionic/p-BB0LlG4y.js +4 -0
  741. package/dist/ionic/p-BMPN55of.js +4 -0
  742. package/dist/ionic/p-BQ8oNV0v.js +4 -0
  743. package/dist/ionic/p-BSQPZ79H.js +4 -0
  744. package/dist/ionic/p-BhamHSw3.js +4 -0
  745. package/dist/ionic/p-BjvtSsVI.js +4 -0
  746. package/dist/ionic/p-BkfAWuv6.js +4 -0
  747. package/dist/ionic/p-BmVRXR1y.js +4 -0
  748. package/dist/ionic/p-BnMQxWON.js +4 -0
  749. package/dist/ionic/p-BvabGprD.js +4 -0
  750. package/{components/p-Va26YR7l.js → dist/ionic/p-BwIp10KV.js} +1 -1
  751. package/dist/ionic/p-C-94tAim.js +4 -0
  752. package/dist/ionic/p-C6eME8Ey.js +4 -0
  753. package/dist/ionic/p-CIGNaXM1.js +4 -0
  754. package/dist/ionic/p-CKUuSnDR.js +4 -0
  755. package/dist/ionic/p-CMRtMbJc.js +4 -0
  756. package/dist/ionic/p-CPcPmkGv.js +4 -0
  757. package/dist/ionic/p-CQ_4TirR.js +4 -0
  758. package/dist/ionic/p-CaRuIadB.js +4 -0
  759. package/dist/ionic/p-Cdjxf_yg.js +4 -0
  760. package/dist/ionic/p-ChhhtsGZ.js +5 -0
  761. package/dist/ionic/p-CmKf4pgI.js +4 -0
  762. package/dist/ionic/p-D5t_-oMk.js +4 -0
  763. package/dist/ionic/p-D94b61er.js +4 -0
  764. package/dist/ionic/p-DCI3rXQo.js +4 -0
  765. package/dist/ionic/p-DDhtUaaA.js +4 -0
  766. package/dist/ionic/p-DJztqcrH.js +4 -0
  767. package/dist/ionic/p-DWCzVL3Y.js +4 -0
  768. package/dist/ionic/p-Dn0mqQ_R.js +4 -0
  769. package/dist/ionic/p-I3In7hMC.js +4 -0
  770. package/dist/ionic/p-T71k3C35.js +4 -0
  771. package/dist/ionic/p-TXPDHL13.js +4 -0
  772. package/dist/ionic/p-ZjP4CjeZ.js +4 -0
  773. package/dist/ionic/p-a641d428.entry.js +4 -0
  774. package/dist/ionic/p-ac6ef997.entry.js +4 -0
  775. package/dist/ionic/p-acf0a6af.entry.js +4 -0
  776. package/dist/ionic/p-ad98e3ff.entry.js +4 -0
  777. package/dist/ionic/p-af5166f5.entry.js +4 -0
  778. package/dist/ionic/p-b24dc0a1.entry.js +4 -0
  779. package/dist/ionic/p-ba8a598f.entry.js +4 -0
  780. package/dist/ionic/p-bf7c1f05.entry.js +4 -0
  781. package/dist/ionic/p-byZM6qHV.js +4 -0
  782. package/dist/ionic/p-c3f65965.entry.js +4 -0
  783. package/dist/ionic/p-c8fbe544.entry.js +4 -0
  784. package/dist/ionic/p-cb12f6c3.entry.js +4 -0
  785. package/dist/ionic/p-cec87704.entry.js +4 -0
  786. package/dist/ionic/p-dbfd2d52.entry.js +4 -0
  787. package/dist/ionic/p-e1e5b507.entry.js +4 -0
  788. package/dist/ionic/p-ede019ef.entry.js +4 -0
  789. package/dist/ionic/p-efef6788.entry.js +4 -0
  790. package/dist/ionic/p-f046aa37.entry.js +4 -0
  791. package/dist/ionic/p-f402f5a4.entry.js +4 -0
  792. package/dist/ionic/p-f622796d.entry.js +4 -0
  793. package/dist/ionic/{p-CnIzWLAn.js → p-kJA95YWg.js} +1 -1
  794. package/dist/types/components/accordion/accordion.d.ts +3 -6
  795. package/dist/types/components/accordion-group/accordion-group.d.ts +1 -12
  796. package/dist/types/components/action-sheet/action-sheet-interface.d.ts +7 -3
  797. package/dist/types/components/action-sheet/action-sheet.d.ts +2 -3
  798. package/dist/types/components/alert/alert-interface.d.ts +7 -3
  799. package/dist/types/components/alert/alert.d.ts +2 -3
  800. package/dist/types/components/app/app.d.ts +5 -4
  801. package/dist/types/components/avatar/avatar.d.ts +0 -32
  802. package/dist/types/components/back-button/back-button.d.ts +1 -2
  803. package/dist/types/components/backdrop/backdrop.d.ts +0 -4
  804. package/dist/types/components/badge/badge.d.ts +1 -34
  805. package/dist/types/components/breadcrumb/breadcrumb.d.ts +1 -4
  806. package/dist/types/components/breadcrumbs/breadcrumbs.d.ts +2 -2
  807. package/dist/types/components/button/button.d.ts +8 -23
  808. package/dist/types/components/buttons/buttons.d.ts +1 -5
  809. package/dist/types/components/card/card.d.ts +1 -8
  810. package/dist/types/components/card-content/card-content.d.ts +1 -2
  811. package/dist/types/components/card-header/card-header.d.ts +2 -3
  812. package/dist/types/components/card-subtitle/card-subtitle.d.ts +1 -2
  813. package/dist/types/components/card-title/card-title.d.ts +1 -2
  814. package/dist/types/components/checkbox/checkbox.d.ts +4 -14
  815. package/dist/types/components/chip/chip.d.ts +1 -26
  816. package/dist/types/components/col/col.d.ts +5 -52
  817. package/dist/types/components/content/content.d.ts +0 -3
  818. package/dist/types/components/datetime/datetime.d.ts +1 -26
  819. package/dist/types/components/datetime/utils/data.d.ts +5 -5
  820. package/dist/types/components/datetime-button/datetime-button.d.ts +1 -2
  821. package/dist/types/components/fab/fab.d.ts +0 -4
  822. package/dist/types/components/fab-button/fab-button.d.ts +3 -5
  823. package/dist/types/components/fab-list/fab-list.d.ts +0 -4
  824. package/dist/types/components/footer/footer.d.ts +3 -20
  825. package/dist/types/components/grid/grid.d.ts +0 -4
  826. package/dist/types/components/header/header.d.ts +3 -26
  827. package/dist/types/components/header/header.utils.d.ts +5 -4
  828. package/dist/types/components/img/img.d.ts +1 -2
  829. package/dist/types/components/infinite-scroll/infinite-scroll.d.ts +0 -21
  830. package/dist/types/components/infinite-scroll-content/infinite-scroll-content.d.ts +0 -4
  831. package/dist/types/components/input/input.d.ts +6 -35
  832. package/dist/types/components/input-otp/input-otp.d.ts +0 -37
  833. package/dist/types/components/input-password-toggle/input-password-toggle.d.ts +0 -2
  834. package/dist/types/components/item/item.d.ts +4 -11
  835. package/dist/types/components/item-divider/item-divider.d.ts +1 -2
  836. package/dist/types/components/item-group/item-group.d.ts +0 -4
  837. package/dist/types/components/item-option/item-option.d.ts +1 -18
  838. package/dist/types/components/item-options/item-options.d.ts +0 -4
  839. package/dist/types/components/item-sliding/item-sliding.d.ts +1 -47
  840. package/dist/types/components/item-sliding/test/test.utils.d.ts +0 -13
  841. package/dist/types/components/label/label.d.ts +1 -2
  842. package/dist/types/components/list/list.d.ts +1 -15
  843. package/dist/types/components/list-header/list-header.d.ts +1 -2
  844. package/dist/types/components/loading/loading-interface.d.ts +7 -2
  845. package/dist/types/components/loading/loading.d.ts +2 -3
  846. package/dist/types/components/menu/menu.d.ts +0 -3
  847. package/dist/types/components/menu-button/menu-button.d.ts +1 -3
  848. package/dist/types/components/menu-toggle/menu-toggle.d.ts +0 -3
  849. package/dist/types/components/modal/gestures/sheet.d.ts +1 -1
  850. package/dist/types/components/modal/modal-interface.d.ts +16 -4
  851. package/dist/types/components/modal/modal.d.ts +12 -15
  852. package/dist/types/components/nav/nav-interface.d.ts +1 -10
  853. package/dist/types/components/nav/nav.d.ts +3 -27
  854. package/dist/types/components/nav-link/nav-link.d.ts +0 -4
  855. package/dist/types/components/note/note.d.ts +1 -2
  856. package/dist/types/components/picker/picker.d.ts +1 -2
  857. package/dist/types/components/picker-column/picker-column.d.ts +1 -2
  858. package/dist/types/components/picker-column-option/picker-column-option.d.ts +0 -4
  859. package/dist/types/components/popover/popover-interface.d.ts +6 -3
  860. package/dist/types/components/popover/popover.d.ts +5 -6
  861. package/dist/types/components/progress-bar/progress-bar.d.ts +1 -10
  862. package/dist/types/components/radio/radio.d.ts +1 -2
  863. package/dist/types/components/radio-group/radio-group.d.ts +0 -12
  864. package/dist/types/components/range/range.d.ts +1 -2
  865. package/dist/types/components/refresher/refresher.d.ts +1 -2
  866. package/dist/types/components/refresher-content/refresher-content.d.ts +0 -4
  867. package/dist/types/components/reorder/reorder.d.ts +0 -9
  868. package/dist/types/components/reorder-group/reorder-group.d.ts +0 -4
  869. package/dist/types/components/ripple-effect/ripple-effect.d.ts +0 -4
  870. package/dist/types/components/route/route.d.ts +1 -5
  871. package/dist/types/components/router/router.d.ts +0 -4
  872. package/dist/types/components/router-link/router-link.d.ts +0 -4
  873. package/dist/types/components/router-outlet/router-outlet.d.ts +8 -4
  874. package/dist/types/components/row/row.d.ts +0 -4
  875. package/dist/types/components/searchbar/searchbar.d.ts +11 -57
  876. package/dist/types/components/segment/segment.d.ts +1 -2
  877. package/dist/types/components/segment-button/segment-button.d.ts +1 -2
  878. package/dist/types/components/select/select.d.ts +14 -49
  879. package/dist/types/components/select-modal/select-modal.d.ts +0 -8
  880. package/dist/types/components/select-option/select-option.d.ts +4 -7
  881. package/dist/types/components/select-popover/select-popover.d.ts +0 -3
  882. package/dist/types/components/skeleton-text/skeleton-text.d.ts +0 -4
  883. package/dist/types/components/spinner/spinner.d.ts +0 -15
  884. package/dist/types/components/split-pane/split-pane.d.ts +0 -4
  885. package/dist/types/components/tab/tab.d.ts +0 -4
  886. package/dist/types/components/tab-bar/tab-bar-interface.d.ts +0 -1
  887. package/dist/types/components/tab-bar/tab-bar.d.ts +3 -41
  888. package/dist/types/components/tab-button/tab-button.d.ts +1 -12
  889. package/dist/types/components/tabs/tabs.d.ts +0 -3
  890. package/dist/types/components/text/text.d.ts +1 -2
  891. package/dist/types/components/textarea/textarea.d.ts +4 -53
  892. package/dist/types/components/thumbnail/thumbnail.d.ts +0 -4
  893. package/dist/types/components/title/title.d.ts +0 -4
  894. package/dist/types/components/toast/animations/utils.d.ts +2 -2
  895. package/dist/types/components/toast/toast-interface.d.ts +7 -3
  896. package/dist/types/components/toast/toast.d.ts +2 -19
  897. package/dist/types/components/toggle/toggle.d.ts +1 -15
  898. package/dist/types/components/toolbar/toolbar.d.ts +3 -43
  899. package/dist/types/components.d.ts +263 -2171
  900. package/dist/types/global/ionic-global.d.ts +2 -28
  901. package/dist/types/index.d.ts +1 -1
  902. package/dist/types/interface.d.ts +0 -4
  903. package/dist/types/utils/config.d.ts +3 -114
  904. package/dist/types/utils/focus-trap.d.ts +1 -1
  905. package/dist/types/utils/focus-visible.d.ts +0 -13
  906. package/dist/types/utils/forms/index.d.ts +0 -1
  907. package/dist/types/utils/forms/validity.d.ts +0 -7
  908. package/dist/types/utils/helpers.d.ts +0 -22
  909. package/dist/types/utils/logging/index.d.ts +2 -1
  910. package/dist/types/utils/overlay-control-label.d.ts +9 -11
  911. package/dist/types/utils/overlays-interface.d.ts +1 -31
  912. package/dist/types/utils/overlays.d.ts +12 -10
  913. package/dist/types/utils/test/playwright/drag-element.d.ts +3 -16
  914. package/dist/types/utils/test/playwright/generator.d.ts +2 -31
  915. package/dist/types/utils/test/playwright/playwright-page.d.ts +1 -1
  916. package/dist/types/utils/test/playwright/testExpect.d.ts +1 -1
  917. package/dist/types/utils/theme.d.ts +0 -9
  918. package/hydrate/index.js +10310 -12033
  919. package/hydrate/index.mjs +10310 -12033
  920. package/package.json +56 -17
  921. package/components/ion-divider.d.ts +0 -11
  922. package/components/ion-divider.js +0 -4
  923. package/components/ion-gallery-item.d.ts +0 -11
  924. package/components/ion-gallery-item.js +0 -4
  925. package/components/ion-gallery.d.ts +0 -11
  926. package/components/ion-gallery.js +0 -4
  927. package/components/ion-picker-legacy-column.d.ts +0 -11
  928. package/components/ion-picker-legacy-column.js +0 -4
  929. package/components/ion-picker-legacy.d.ts +0 -11
  930. package/components/ion-picker-legacy.js +0 -4
  931. package/components/p-6hUZIMBp.js +0 -4
  932. package/components/p-9mfpAwJh.js +0 -4
  933. package/components/p-B2aAAEfp.js +0 -4
  934. package/components/p-B2lpqDWK.js +0 -4
  935. package/components/p-BDoEcs72.js +0 -4
  936. package/components/p-BDqjX7Z_.js +0 -4
  937. package/components/p-BE21dB_a.js +0 -4
  938. package/components/p-BFpXpzD-.js +0 -4
  939. package/components/p-BTEOs1at.js +0 -4
  940. package/components/p-BUNIyvqe.js +0 -4
  941. package/components/p-BYSs-jZz.js +0 -4
  942. package/components/p-BYoGvMgh.js +0 -4
  943. package/components/p-BYrCPOBM.js +0 -4
  944. package/components/p-BbVhJs-a.js +0 -4
  945. package/components/p-BhRXIcSN.js +0 -4
  946. package/components/p-BjW8SOqw.js +0 -4
  947. package/components/p-BsiHrVPa.js +0 -4
  948. package/components/p-BwKpO3Is.js +0 -4
  949. package/components/p-Bz8jnuiy.js +0 -4
  950. package/components/p-C-Ea1l5K.js +0 -4
  951. package/components/p-C3X10Pc6.js +0 -4
  952. package/components/p-C53feagD.js +0 -4
  953. package/components/p-CH6jbAEI.js +0 -4
  954. package/components/p-CJE5t2qs.js +0 -4
  955. package/components/p-CODBQrPj.js +0 -4
  956. package/components/p-CUbb1HkU.js +0 -4
  957. package/components/p-CVYFPBs-.js +0 -4
  958. package/components/p-CVoLDZ7z.js +0 -4
  959. package/components/p-CZrORZXS.js +0 -4
  960. package/components/p-Cc3oC60a.js +0 -4
  961. package/components/p-Cl0B-RWe.js +0 -4
  962. package/components/p-CmoUesXp.js +0 -4
  963. package/components/p-CyNW8ypn.js +0 -4
  964. package/components/p-CzxyxYID.js +0 -4
  965. package/components/p-D0Iqw6OZ.js +0 -4
  966. package/components/p-D0LT3Z3i.js +0 -4
  967. package/components/p-D1t981Ih.js +0 -4
  968. package/components/p-D6tqrIYY.js +0 -4
  969. package/components/p-D9C5yWpF.js +0 -4
  970. package/components/p-DCRXgAoM.js +0 -4
  971. package/components/p-DL5wyRub.js +0 -4
  972. package/components/p-DQlXUUDh.js +0 -4
  973. package/components/p-DRWN7QM2.js +0 -4
  974. package/components/p-DaJxRxSQ.js +0 -4
  975. package/components/p-DbmfFkd1.js +0 -4
  976. package/components/p-Dhi5xtNS.js +0 -4
  977. package/components/p-DnwLgh9U.js +0 -4
  978. package/components/p-DoZB3DcY.js +0 -4
  979. package/components/p-DrrpZB81.js +0 -4
  980. package/components/p-DrzWRqnG.js +0 -4
  981. package/components/p-DylrHLJF.js +0 -4
  982. package/components/p-Dypq4kXE.js +0 -4
  983. package/components/p-DzeMJvWL.js +0 -4
  984. package/components/p-Dzk4Tr0X.js +0 -4
  985. package/components/p-Rkm2AOZ2.js +0 -4
  986. package/components/p-UYngqo1f.js +0 -4
  987. package/components/p-asUhrzOB.js +0 -4
  988. package/components/p-fIOYmaqA.js +0 -4
  989. package/components/p-jlwpz7Ms.js +0 -4
  990. package/components/p-kInyVu79.js +0 -4
  991. package/components/p-miSYSxcc.js +0 -4
  992. package/components/p-paDbTUL9.js +0 -4
  993. package/components/p-vXpMhGrs.js +0 -4
  994. package/components/p-znZTPd7u.js +0 -4
  995. package/css/ionic/bundle.ionic.css +0 -1
  996. package/css/ionic/bundle.ionic.css.map +0 -1
  997. package/css/ionic/core.ionic.css +0 -1
  998. package/css/ionic/core.ionic.css.map +0 -1
  999. package/css/ionic/global.bundle.ionic.css +0 -1
  1000. package/css/ionic/global.bundle.ionic.css.map +0 -1
  1001. package/css/ionic/ionic-swiper.ionic.css +0 -1
  1002. package/css/ionic/ionic-swiper.ionic.css.map +0 -1
  1003. package/css/ionic/link.ionic.css +0 -1
  1004. package/css/ionic/link.ionic.css.map +0 -1
  1005. package/css/ionic/structure.ionic.css +0 -1
  1006. package/css/ionic/structure.ionic.css.map +0 -1
  1007. package/css/ionic/typography.ionic.css +0 -1
  1008. package/css/ionic/typography.ionic.css.map +0 -1
  1009. package/css/ionic/utils.bundle.ionic.css +0 -1
  1010. package/css/ionic/utils.bundle.ionic.css.map +0 -1
  1011. package/dist/cjs/caret-down-vtVgfXIs.js +0 -8
  1012. package/dist/cjs/caret-left-CxZXLRv5.js +0 -8
  1013. package/dist/cjs/caret-right-CRCgv98E.js +0 -8
  1014. package/dist/cjs/clear-button-press-controller-2hAy_qdm.js +0 -45
  1015. package/dist/cjs/ion-datetime_3.cjs.entry.js +0 -3242
  1016. package/dist/cjs/ion-divider.cjs.entry.js +0 -51
  1017. package/dist/cjs/ion-gallery-item.cjs.entry.js +0 -59
  1018. package/dist/cjs/ion-gallery.cjs.entry.js +0 -607
  1019. package/dist/cjs/ionic-global-DvEcO0tQ.js +0 -519
  1020. package/dist/cjs/list-a-7GSA6K.js +0 -8
  1021. package/dist/cjs/scroll-hide-controller-DAf_DwKc.js +0 -345
  1022. package/dist/cjs/validity-QmuwEptc.js +0 -51
  1023. package/dist/cjs/x-BTF99yFH.js +0 -8
  1024. package/dist/collection/components/accordion/accordion.ionic.css +0 -201
  1025. package/dist/collection/components/accordion-group/accordion-group.ionic.css +0 -93
  1026. package/dist/collection/components/action-sheet/action-sheet.ionic.css +0 -494
  1027. package/dist/collection/components/alert/alert.ionic.css +0 -787
  1028. package/dist/collection/components/avatar/avatar.ionic.css +0 -385
  1029. package/dist/collection/components/backdrop/backdrop.ionic.css +0 -109
  1030. package/dist/collection/components/badge/badge.ionic.css +0 -272
  1031. package/dist/collection/components/button/button.ionic.css +0 -644
  1032. package/dist/collection/components/buttons/buttons.ionic.css +0 -97
  1033. package/dist/collection/components/card/card.ionic.css +0 -144
  1034. package/dist/collection/components/card-content/card-content.ionic.css +0 -89
  1035. package/dist/collection/components/card-header/card-header.ionic.css +0 -85
  1036. package/dist/collection/components/card-subtitle/card-subtitle.ionic.css +0 -144
  1037. package/dist/collection/components/checkbox/checkbox.ionic.css +0 -543
  1038. package/dist/collection/components/chip/chip.ionic.css +0 -217
  1039. package/dist/collection/components/datetime/datetime.ionic.css +0 -703
  1040. package/dist/collection/components/divider/divider.ionic.css +0 -148
  1041. package/dist/collection/components/divider/divider.ios.css +0 -87
  1042. package/dist/collection/components/divider/divider.js +0 -94
  1043. package/dist/collection/components/divider/divider.md.css +0 -87
  1044. package/dist/collection/components/footer/footer-interface.js +0 -1
  1045. package/dist/collection/components/gallery/gallery-constants.js +0 -12
  1046. package/dist/collection/components/gallery/gallery-interface.js +0 -1
  1047. package/dist/collection/components/gallery/gallery.css +0 -15
  1048. package/dist/collection/components/gallery/gallery.js +0 -679
  1049. package/dist/collection/components/gallery/test/utils.js +0 -100
  1050. package/dist/collection/components/gallery-item/gallery-item.css +0 -49
  1051. package/dist/collection/components/gallery-item/gallery-item.js +0 -99
  1052. package/dist/collection/components/header/header-interface.js +0 -1
  1053. package/dist/collection/components/header/header.ionic.css +0 -250
  1054. package/dist/collection/components/input/input.ionic.css +0 -891
  1055. package/dist/collection/components/input-otp/input-otp.ionic.css +0 -371
  1056. package/dist/collection/components/input-password-toggle/input-password-toggle.ionic.css +0 -78
  1057. package/dist/collection/components/input-password-toggle/input-password-toggle.native.css +0 -61
  1058. package/dist/collection/components/item/item.ionic.css +0 -496
  1059. package/dist/collection/components/item-option/item-option.ionic.css +0 -277
  1060. package/dist/collection/components/item-options/item-options.ionic.css +0 -221
  1061. package/dist/collection/components/item-sliding/item-sliding.ionic.css +0 -211
  1062. package/dist/collection/components/list/list.ionic.css +0 -212
  1063. package/dist/collection/components/list-header/list-header.ionic.css +0 -190
  1064. package/dist/collection/components/menu-button/menu-button.ionic.css +0 -236
  1065. package/dist/collection/components/modal/animations/ionic.enter.js +0 -40
  1066. package/dist/collection/components/modal/animations/ionic.leave.js +0 -28
  1067. package/dist/collection/components/modal/modal.ionic.css +0 -255
  1068. package/dist/collection/components/picker-legacy/animations/ios.enter.js +0 -27
  1069. package/dist/collection/components/picker-legacy/animations/ios.leave.js +0 -23
  1070. package/dist/collection/components/picker-legacy/picker-interface.js +0 -1
  1071. package/dist/collection/components/picker-legacy/picker.ios.css +0 -312
  1072. package/dist/collection/components/picker-legacy/picker.js +0 -891
  1073. package/dist/collection/components/picker-legacy/picker.md.css +0 -299
  1074. package/dist/collection/components/picker-legacy-column/picker-column.ios.css +0 -243
  1075. package/dist/collection/components/picker-legacy-column/picker-column.js +0 -422
  1076. package/dist/collection/components/picker-legacy-column/picker-column.md.css +0 -234
  1077. package/dist/collection/components/picker-legacy-column/test/test.utils.js +0 -43
  1078. package/dist/collection/components/popover/popover.ionic.css +0 -290
  1079. package/dist/collection/components/progress-bar/progress-bar.ionic.css +0 -287
  1080. package/dist/collection/components/radio/radio.ionic.css +0 -422
  1081. package/dist/collection/components/radio-group/radio-group.ionic.css +0 -119
  1082. package/dist/collection/components/range/range.ionic.css +0 -567
  1083. package/dist/collection/components/ripple-effect/ripple-effect.ionic.css +0 -215
  1084. package/dist/collection/components/searchbar/searchbar.ionic.css +0 -622
  1085. package/dist/collection/components/segment/segment.ionic.css +0 -115
  1086. package/dist/collection/components/segment-button/segment-button.ionic.css +0 -352
  1087. package/dist/collection/components/select/select.ionic.css +0 -809
  1088. package/dist/collection/components/select-modal/select-modal.ionic.css +0 -257
  1089. package/dist/collection/components/select-popover/select-popover.ionic.css +0 -255
  1090. package/dist/collection/components/spinner/spinner.native.css +0 -199
  1091. package/dist/collection/components/tab-bar/tab-bar.ionic.css +0 -249
  1092. package/dist/collection/components/tab-button/tab-button.ionic.css +0 -373
  1093. package/dist/collection/components/textarea/textarea.ionic.css +0 -898
  1094. package/dist/collection/components/title/title.ionic.css +0 -127
  1095. package/dist/collection/components/toast/toast.ionic.css +0 -394
  1096. package/dist/collection/components/toggle/toggle.ionic.css +0 -512
  1097. package/dist/collection/components/toolbar/test/image.svg +0 -1
  1098. package/dist/collection/components/toolbar/toolbar.ionic.css +0 -249
  1099. package/dist/collection/utils/css-value-validation.js +0 -39
  1100. package/dist/collection/utils/forms/clear-button-press-controller.js +0 -40
  1101. package/dist/collection/utils/scroll-hide-controller.js +0 -178
  1102. package/dist/esm/caret-down-D1t981Ih.js +0 -6
  1103. package/dist/esm/caret-left-fIOYmaqA.js +0 -6
  1104. package/dist/esm/caret-right-BYSs-jZz.js +0 -6
  1105. package/dist/esm/clear-button-press-controller-C79TPm5p.js +0 -43
  1106. package/dist/esm/ion-datetime_3.entry.js +0 -3238
  1107. package/dist/esm/ion-divider.entry.js +0 -49
  1108. package/dist/esm/ion-gallery-item.entry.js +0 -57
  1109. package/dist/esm/ion-gallery.entry.js +0 -605
  1110. package/dist/esm/ionic-global-CEwbmRLz.js +0 -508
  1111. package/dist/esm/list-Dhi5xtNS.js +0 -6
  1112. package/dist/esm/scroll-hide-controller-CfbtPBWv.js +0 -342
  1113. package/dist/esm/theme-DaJxRxSQ.js +0 -67
  1114. package/dist/esm/validity-BjW8SOqw.js +0 -48
  1115. package/dist/esm/x-BDqjX7Z_.js +0 -6
  1116. package/dist/ionic/p--sroV-k-.js +0 -4
  1117. package/dist/ionic/p-00731d20.entry.js +0 -4
  1118. package/dist/ionic/p-03c20a50.entry.js +0 -4
  1119. package/dist/ionic/p-03ec6673.entry.js +0 -4
  1120. package/dist/ionic/p-0405ec57.entry.js +0 -4
  1121. package/dist/ionic/p-04f16322.entry.js +0 -4
  1122. package/dist/ionic/p-09123f89.entry.js +0 -4
  1123. package/dist/ionic/p-15028853.entry.js +0 -4
  1124. package/dist/ionic/p-16c5db90.entry.js +0 -4
  1125. package/dist/ionic/p-1d1dfb68.entry.js +0 -4
  1126. package/dist/ionic/p-231572a0.entry.js +0 -4
  1127. package/dist/ionic/p-2740db6e.entry.js +0 -4
  1128. package/dist/ionic/p-2a6d4601.entry.js +0 -4
  1129. package/dist/ionic/p-2d8fe33c.entry.js +0 -4
  1130. package/dist/ionic/p-2dbc50d9.entry.js +0 -4
  1131. package/dist/ionic/p-32d3095c.entry.js +0 -4
  1132. package/dist/ionic/p-356cd619.entry.js +0 -4
  1133. package/dist/ionic/p-391bdb60.entry.js +0 -4
  1134. package/dist/ionic/p-3b2ab5b4.entry.js +0 -4
  1135. package/dist/ionic/p-4e3e750a.entry.js +0 -4
  1136. package/dist/ionic/p-4fee0df6.entry.js +0 -4
  1137. package/dist/ionic/p-547d010c.entry.js +0 -4
  1138. package/dist/ionic/p-54895118.entry.js +0 -4
  1139. package/dist/ionic/p-6163d04d.entry.js +0 -4
  1140. package/dist/ionic/p-679c1448.entry.js +0 -4
  1141. package/dist/ionic/p-6de524e5.entry.js +0 -4
  1142. package/dist/ionic/p-764d7ea2.entry.js +0 -4
  1143. package/dist/ionic/p-7k7Q1A38.js +0 -4
  1144. package/dist/ionic/p-81BMEE8Q.js +0 -4
  1145. package/dist/ionic/p-8d6d7acb.entry.js +0 -4
  1146. package/dist/ionic/p-96732fe2.entry.js +0 -4
  1147. package/dist/ionic/p-96c4c1b9.entry.js +0 -4
  1148. package/dist/ionic/p-9745f518.entry.js +0 -4
  1149. package/dist/ionic/p-9a40af3c.entry.js +0 -4
  1150. package/dist/ionic/p-9e725104.entry.js +0 -4
  1151. package/dist/ionic/p-B4Kq2YNk.js +0 -4
  1152. package/dist/ionic/p-BDqjX7Z_.js +0 -4
  1153. package/dist/ionic/p-BTEOs1at.js +0 -4
  1154. package/dist/ionic/p-BYSs-jZz.js +0 -4
  1155. package/dist/ionic/p-BbWo-T8F.js +0 -4
  1156. package/dist/ionic/p-BjW8SOqw.js +0 -4
  1157. package/dist/ionic/p-Bvz8PHo5.js +0 -4
  1158. package/dist/ionic/p-BwKpO3Is.js +0 -4
  1159. package/dist/ionic/p-C0EQceqV.js +0 -5
  1160. package/dist/ionic/p-C1_a9uRb.js +0 -4
  1161. package/dist/ionic/p-C53feagD.js +0 -4
  1162. package/dist/ionic/p-C6WD6qSF.js +0 -4
  1163. package/dist/ionic/p-C7urd_wE.js +0 -4
  1164. package/dist/ionic/p-CCgRIJJv.js +0 -4
  1165. package/dist/ionic/p-CEkwLb3L.js +0 -4
  1166. package/dist/ionic/p-CGFf6My7.js +0 -4
  1167. package/dist/ionic/p-CLUwRxij.js +0 -4
  1168. package/dist/ionic/p-CODBQrPj.js +0 -4
  1169. package/dist/ionic/p-CP_sVwEm.js +0 -4
  1170. package/dist/ionic/p-CSMWpRc0.js +0 -4
  1171. package/dist/ionic/p-CYYo93al.js +0 -4
  1172. package/dist/ionic/p-Cipl19Qe.js +0 -4
  1173. package/dist/ionic/p-Cl0B-RWe.js +0 -4
  1174. package/dist/ionic/p-Cvvva6Z7.js +0 -4
  1175. package/dist/ionic/p-D1t981Ih.js +0 -4
  1176. package/dist/ionic/p-DINFwXlp.js +0 -4
  1177. package/dist/ionic/p-DIvCXVmD.js +0 -4
  1178. package/dist/ionic/p-DTsDGZPd.js +0 -4
  1179. package/dist/ionic/p-DaJxRxSQ.js +0 -4
  1180. package/dist/ionic/p-Dhi5xtNS.js +0 -4
  1181. package/dist/ionic/p-DtQgCTtW.js +0 -4
  1182. package/dist/ionic/p-DuRx6DeQ.js +0 -4
  1183. package/dist/ionic/p-YGLqXqFd.js +0 -4
  1184. package/dist/ionic/p-YIsE5bNG.js +0 -4
  1185. package/dist/ionic/p-a61c2ace.entry.js +0 -4
  1186. package/dist/ionic/p-abb516e3.entry.js +0 -4
  1187. package/dist/ionic/p-b54edee6.entry.js +0 -4
  1188. package/dist/ionic/p-c076ac5c.entry.js +0 -4
  1189. package/dist/ionic/p-c4ff25cb.entry.js +0 -4
  1190. package/dist/ionic/p-c7279756.entry.js +0 -4
  1191. package/dist/ionic/p-c7ebed50.entry.js +0 -4
  1192. package/dist/ionic/p-cd0037e4.entry.js +0 -4
  1193. package/dist/ionic/p-d261938d.entry.js +0 -4
  1194. package/dist/ionic/p-d33dfc12.entry.js +0 -4
  1195. package/dist/ionic/p-d7764330.entry.js +0 -4
  1196. package/dist/ionic/p-defb23a2.entry.js +0 -4
  1197. package/dist/ionic/p-df642ef5.entry.js +0 -4
  1198. package/dist/ionic/p-e2a35249.entry.js +0 -4
  1199. package/dist/ionic/p-e2b952ef.entry.js +0 -4
  1200. package/dist/ionic/p-e77cfd1e.entry.js +0 -4
  1201. package/dist/ionic/p-ecb9d3d3.entry.js +0 -4
  1202. package/dist/ionic/p-efd13adf.entry.js +0 -4
  1203. package/dist/ionic/p-f0904c1d.entry.js +0 -4
  1204. package/dist/ionic/p-f33689f7.entry.js +0 -4
  1205. package/dist/ionic/p-f693efe9.entry.js +0 -4
  1206. package/dist/ionic/p-f788396b.entry.js +0 -4
  1207. package/dist/ionic/p-fIOYmaqA.js +0 -4
  1208. package/dist/ionic/p-fa16fad8.entry.js +0 -4
  1209. package/dist/ionic/p-lMb_45ax.js +0 -4
  1210. package/dist/ionic/p-oadJNPuo.js +0 -4
  1211. package/dist/ionic/p-vXpMhGrs.js +0 -4
  1212. package/dist/ionic/p-wNjWCZVO.js +0 -4
  1213. package/dist/types/components/divider/divider.d.ts +0 -20
  1214. package/dist/types/components/footer/footer-interface.d.ts +0 -1
  1215. package/dist/types/components/gallery/gallery-constants.d.ts +0 -9
  1216. package/dist/types/components/gallery/gallery-interface.d.ts +0 -10
  1217. package/dist/types/components/gallery/gallery.d.ts +0 -218
  1218. package/dist/types/components/gallery/test/utils.d.ts +0 -3
  1219. package/dist/types/components/gallery-item/gallery-item.d.ts +0 -33
  1220. package/dist/types/components/header/header-interface.d.ts +0 -1
  1221. package/dist/types/components/modal/animations/ionic.enter.d.ts +0 -6
  1222. package/dist/types/components/modal/animations/ionic.leave.d.ts +0 -6
  1223. package/dist/types/components/picker-legacy/animations/ios.enter.d.ts +0 -5
  1224. package/dist/types/components/picker-legacy/animations/ios.leave.d.ts +0 -5
  1225. package/dist/types/components/picker-legacy/picker-interface.d.ts +0 -52
  1226. package/dist/types/components/picker-legacy/picker.d.ts +0 -159
  1227. package/dist/types/components/picker-legacy-column/picker-column.d.ts +0 -46
  1228. package/dist/types/components/picker-legacy-column/test/test.utils.d.ts +0 -9
  1229. package/dist/types/utils/css-value-validation.d.ts +0 -21
  1230. package/dist/types/utils/forms/clear-button-press-controller.d.ts +0 -20
  1231. package/dist/types/utils/scroll-hide-controller.d.ts +0 -56
  1232. /package/dist/collection/components/{refresher-content/refresher-content.css → input-password-toggle/input-password-toggle.css} +0 -0
@@ -1,3242 +0,0 @@
1
- /*!
2
- * (C) Ionic http://ionicframework.com - MIT License
3
- */
4
- 'use strict';
5
-
6
- var index = require('./index-C1knGA9x.js');
7
- var caretLeft = require('./caret-left-CxZXLRv5.js');
8
- var caretRight = require('./caret-right-CRCgv98E.js');
9
- var focusVisible = require('./focus-visible-BIj-I3-C.js');
10
- var helpers = require('./helpers-Fh1iXsX9.js');
11
- var overlays = require('./overlays-DYBUkNQu.js');
12
- var dir = require('./dir-Cn0z1rJH.js');
13
- var theme = require('./theme-IlOsGAz7.js');
14
- var index$1 = require('./index-CxDnX7hd.js');
15
- var ionicGlobal = require('./ionic-global-DvEcO0tQ.js');
16
- var format = require('./format-COAsdjOc.js');
17
- var lockController = require('./lock-controller-aDB9wrEf.js');
18
- var animation = require('./animation-qlGmEn5Y.js');
19
- var haptic = require('./haptic-BFgF-QCg.js');
20
- require('./framework-delegate-CJT_QJQI.js');
21
- require('./gesture-controller-dtqlP_q4.js');
22
- require('./capacitor-BixsAzyb.js');
23
-
24
- /**
25
- * Returns the current date as
26
- * an ISO string in the user's
27
- * time zone.
28
- */
29
- const getToday = () => {
30
- /**
31
- * ion-datetime intentionally does not
32
- * parse time zones/do automatic time zone
33
- * conversion when accepting user input.
34
- * However when we get today's date string,
35
- * we want it formatted relative to the user's
36
- * time zone.
37
- *
38
- * When calling toISOString(), the browser
39
- * will convert the date to UTC time by either adding
40
- * or subtracting the time zone offset.
41
- * To work around this, we need to either add
42
- * or subtract the time zone offset to the Date
43
- * object prior to calling toISOString().
44
- * This allows us to get an ISO string
45
- * that is in the user's time zone.
46
- */
47
- return format.removeDateTzOffset(new Date()).toISOString();
48
- };
49
- const minutes = [
50
- 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31,
51
- 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59,
52
- ];
53
- // h11 hour system uses 0-11. Midnight starts at 0:00am.
54
- const hour11 = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11];
55
- // h12 hour system uses 0-12. Midnight starts at 12:00am.
56
- const hour12 = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11];
57
- // h23 hour system uses 0-23. Midnight starts at 0:00.
58
- const hour23 = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23];
59
- // h24 hour system uses 1-24. Midnight starts at 24:00.
60
- const hour24 = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 0];
61
- /**
62
- * Given a locale and a theme,
63
- * return an array with formatted days
64
- * of the week. iOS and Ionic themes should
65
- * display days such as "Mon" or "Tue".
66
- * MD should display days such as "M"
67
- * or "T".
68
- */
69
- const getDaysOfWeek = (locale, theme, firstDayOfWeek = 0) => {
70
- /**
71
- * Nov 1st, 2020 starts on a Sunday.
72
- * ion-datetime assumes weeks start on Sunday,
73
- * but is configurable via `firstDayOfWeek`.
74
- */
75
- const weekdayFormat = theme === 'md' ? 'narrow' : 'short';
76
- const intl = new Intl.DateTimeFormat(locale, { weekday: weekdayFormat });
77
- const startDate = new Date('11/01/2020');
78
- const daysOfWeek = [];
79
- /**
80
- * For each day of the week,
81
- * get the day name.
82
- */
83
- for (let i = firstDayOfWeek; i < firstDayOfWeek + 7; i++) {
84
- const currentDate = new Date(startDate);
85
- currentDate.setDate(currentDate.getDate() + i);
86
- daysOfWeek.push(intl.format(currentDate));
87
- }
88
- return daysOfWeek;
89
- };
90
- /**
91
- * Returns an array containing all of the
92
- * days in a month for a given year. Values are
93
- * aligned with a week calendar starting on
94
- * the firstDayOfWeek value (Sunday by default)
95
- * using null values.
96
- */
97
- const getDaysOfMonth = (month, year, firstDayOfWeek, showAdjacentDays = false) => {
98
- const numDays = format.getNumDaysInMonth(month, year);
99
- let previousNumDays; //previous month number of days
100
- if (month === 1) {
101
- // If the current month is January, the previous month should be December of the previous year.
102
- previousNumDays = format.getNumDaysInMonth(12, year - 1);
103
- }
104
- else {
105
- // Otherwise, the previous month should be the current month - 1 of the same year.
106
- previousNumDays = format.getNumDaysInMonth(month - 1, year);
107
- }
108
- const firstOfMonth = new Date(`${month}/1/${year}`).getDay();
109
- /**
110
- * To get the first day of the month aligned on the correct
111
- * day of the week, we need to determine how many "filler" days
112
- * to generate. These filler days as empty/disabled buttons
113
- * that fill the space of the days of the week before the first
114
- * of the month.
115
- *
116
- * There are two cases here:
117
- *
118
- * 1. If firstOfMonth = 4, firstDayOfWeek = 0 then the offset
119
- * is (4 - (0 + 1)) = 3. Since the offset loop goes from 0 to 3 inclusive,
120
- * this will generate 4 filler days (0, 1, 2, 3), and then day of week 4 will have
121
- * the first day of the month.
122
- *
123
- * 2. If firstOfMonth = 2, firstDayOfWeek = 4 then the offset
124
- * is (6 - (4 - 2)) = 4. Since the offset loop goes from 0 to 4 inclusive,
125
- * this will generate 5 filler days (0, 1, 2, 3, 4), and then day of week 5 will have
126
- * the first day of the month.
127
- */
128
- const offset = firstOfMonth >= firstDayOfWeek ? firstOfMonth - (firstDayOfWeek + 1) : 6 - (firstDayOfWeek - firstOfMonth);
129
- let days = [];
130
- for (let i = 1; i <= numDays; i++) {
131
- days.push({ day: i, dayOfWeek: (offset + i) % 7, isAdjacentDay: false });
132
- }
133
- if (showAdjacentDays) {
134
- for (let i = 0; i <= offset; i++) {
135
- // Using offset create previous month adjacent day, starting from last day
136
- days = [{ day: previousNumDays - i, dayOfWeek: (previousNumDays - i) % 7, isAdjacentDay: true }, ...days];
137
- }
138
- // Calculate positiveOffset
139
- // The calendar will display 42 days (6 rows of 7 columns)
140
- // Knowing this the offset is 41 (we start at index 0)
141
- // minus (the previous offset + the current month days)
142
- const positiveOffset = 41 - (numDays + offset);
143
- for (let i = 0; i < positiveOffset; i++) {
144
- days.push({ day: i + 1, dayOfWeek: (numDays + offset + i) % 7, isAdjacentDay: true });
145
- }
146
- }
147
- else {
148
- for (let i = 0; i <= offset; i++) {
149
- days = [{ day: null, dayOfWeek: null, isAdjacentDay: false }, ...days];
150
- }
151
- }
152
- return days;
153
- };
154
- /**
155
- * Returns an array of pre-defined hour
156
- * values based on the provided hourCycle.
157
- */
158
- const getHourData = (hourCycle) => {
159
- switch (hourCycle) {
160
- case 'h11':
161
- return hour11;
162
- case 'h12':
163
- return hour12;
164
- case 'h23':
165
- return hour23;
166
- case 'h24':
167
- return hour24;
168
- default:
169
- throw new Error(`Invalid hour cycle "${hourCycle}"`);
170
- }
171
- };
172
- /**
173
- * Given a local, reference datetime parts and option
174
- * max/min bound datetime parts, calculate the acceptable
175
- * hour and minute values according to the bounds and locale.
176
- */
177
- const generateTime = (locale, refParts, hourCycle = 'h12', minParts, maxParts, hourValues, minuteValues) => {
178
- const computedHourCycle = format.getHourCycle(locale, hourCycle);
179
- const use24Hour = format.is24Hour(computedHourCycle);
180
- let processedHours = getHourData(computedHourCycle);
181
- let processedMinutes = minutes;
182
- let isAMAllowed = true;
183
- let isPMAllowed = true;
184
- if (hourValues) {
185
- processedHours = processedHours.filter((hour) => hourValues.includes(hour));
186
- }
187
- if (minuteValues) {
188
- processedMinutes = processedMinutes.filter((minute) => minuteValues.includes(minute));
189
- }
190
- if (minParts) {
191
- /**
192
- * If ref day is the same as the
193
- * minimum allowed day, filter hour/minute
194
- * values according to min hour and minute.
195
- */
196
- if (format.isSameDay(refParts, minParts)) {
197
- /**
198
- * Users may not always set the hour/minute for
199
- * min value (i.e. 2021-06-02) so we should allow
200
- * all hours/minutes in that case.
201
- */
202
- if (minParts.hour !== undefined) {
203
- processedHours = processedHours.filter((hour) => {
204
- const convertedHour = refParts.ampm === 'pm' ? (hour + 12) % 24 : hour;
205
- return (use24Hour ? hour : convertedHour) >= minParts.hour;
206
- });
207
- isAMAllowed = minParts.hour < 13;
208
- }
209
- if (minParts.minute !== undefined) {
210
- /**
211
- * The minimum minute range should not be enforced when
212
- * the hour is greater than the min hour.
213
- *
214
- * For example with a minimum range of 09:30, users
215
- * should be able to select 10:00-10:29 and beyond.
216
- */
217
- let isPastMinHour = false;
218
- if (minParts.hour !== undefined && refParts.hour !== undefined) {
219
- if (refParts.hour > minParts.hour) {
220
- isPastMinHour = true;
221
- }
222
- }
223
- processedMinutes = processedMinutes.filter((minute) => {
224
- if (isPastMinHour) {
225
- return true;
226
- }
227
- return minute >= minParts.minute;
228
- });
229
- }
230
- /**
231
- * If ref day is before minimum
232
- * day do not render any hours/minute values
233
- */
234
- }
235
- else if (format.isBefore(refParts, minParts)) {
236
- processedHours = [];
237
- processedMinutes = [];
238
- isAMAllowed = isPMAllowed = false;
239
- }
240
- }
241
- if (maxParts) {
242
- /**
243
- * If ref day is the same as the
244
- * maximum allowed day, filter hour/minute
245
- * values according to max hour and minute.
246
- */
247
- if (format.isSameDay(refParts, maxParts)) {
248
- /**
249
- * Users may not always set the hour/minute for
250
- * max value (i.e. 2021-06-02) so we should allow
251
- * all hours/minutes in that case.
252
- */
253
- if (maxParts.hour !== undefined) {
254
- processedHours = processedHours.filter((hour) => {
255
- const convertedHour = refParts.ampm === 'pm' ? (hour + 12) % 24 : hour;
256
- return (use24Hour ? hour : convertedHour) <= maxParts.hour;
257
- });
258
- isPMAllowed = maxParts.hour >= 12;
259
- }
260
- if (maxParts.minute !== undefined && refParts.hour === maxParts.hour) {
261
- // The available minutes should only be filtered when the hour is the same as the max hour.
262
- // For example if the max hour is 10:30 and the current hour is 10:00,
263
- // users should be able to select 00-30 minutes.
264
- // If the current hour is 09:00, users should be able to select 00-60 minutes.
265
- processedMinutes = processedMinutes.filter((minute) => minute <= maxParts.minute);
266
- }
267
- /**
268
- * If ref day is after minimum
269
- * day do not render any hours/minute values
270
- */
271
- }
272
- else if (format.isAfter(refParts, maxParts)) {
273
- processedHours = [];
274
- processedMinutes = [];
275
- isAMAllowed = isPMAllowed = false;
276
- }
277
- }
278
- return {
279
- hours: processedHours,
280
- minutes: processedMinutes,
281
- am: isAMAllowed,
282
- pm: isPMAllowed,
283
- };
284
- };
285
- /**
286
- * Given DatetimeParts, generate the previous,
287
- * current, and and next months.
288
- */
289
- const generateMonths = (refParts, forcedDate) => {
290
- const current = { month: refParts.month, year: refParts.year, day: refParts.day };
291
- /**
292
- * If we're forcing a month to appear, and it's different from the current month,
293
- * ensure it appears by replacing the next or previous month as appropriate.
294
- */
295
- if (forcedDate !== undefined && (refParts.month !== forcedDate.month || refParts.year !== forcedDate.year)) {
296
- const forced = { month: forcedDate.month, year: forcedDate.year, day: forcedDate.day };
297
- const forcedMonthIsBefore = format.isBefore(forced, current);
298
- return forcedMonthIsBefore
299
- ? [forced, current, format.getNextMonth(refParts)]
300
- : [format.getPreviousMonth(refParts), current, forced];
301
- }
302
- return [format.getPreviousMonth(refParts), current, format.getNextMonth(refParts)];
303
- };
304
- const getMonthColumnData = (locale, refParts, minParts, maxParts, monthValues, formatOptions = {
305
- month: 'long',
306
- }) => {
307
- const { year } = refParts;
308
- const months = [];
309
- if (monthValues !== undefined) {
310
- let processedMonths = monthValues;
311
- if ((maxParts === null || maxParts === void 0 ? void 0 : maxParts.month) !== undefined) {
312
- processedMonths = processedMonths.filter((month) => month <= maxParts.month);
313
- }
314
- if ((minParts === null || minParts === void 0 ? void 0 : minParts.month) !== undefined) {
315
- processedMonths = processedMonths.filter((month) => month >= minParts.month);
316
- }
317
- processedMonths.forEach((processedMonth) => {
318
- const date = new Date(`${processedMonth}/1/${year} GMT+0000`);
319
- const monthString = new Intl.DateTimeFormat(locale, Object.assign(Object.assign({}, formatOptions), { timeZone: 'UTC' })).format(date);
320
- months.push({ text: monthString, value: processedMonth });
321
- });
322
- }
323
- else {
324
- const maxMonth = maxParts && maxParts.year === year ? maxParts.month : 12;
325
- const minMonth = minParts && minParts.year === year ? minParts.month : 1;
326
- for (let i = minMonth; i <= maxMonth; i++) {
327
- /**
328
- *
329
- * There is a bug on iOS 14 where
330
- * Intl.DateTimeFormat takes into account
331
- * the local timezone offset when formatting dates.
332
- *
333
- * Forcing the timezone to 'UTC' fixes the issue. However,
334
- * we should keep this workaround as it is safer. In the event
335
- * this breaks in another browser, we will not be impacted
336
- * because all dates will be interpreted in UTC.
337
- *
338
- * Example:
339
- * new Intl.DateTimeFormat('en-US', { month: 'long' }).format(new Date('Sat Apr 01 2006 00:00:00 GMT-0400 (EDT)')) // "March"
340
- * new Intl.DateTimeFormat('en-US', { month: 'long', timeZone: 'UTC' }).format(new Date('Sat Apr 01 2006 00:00:00 GMT-0400 (EDT)')) // "April"
341
- *
342
- * In certain timezones, iOS 14 shows the wrong
343
- * date for .toUTCString(). To combat this, we
344
- * force all of the timezones to GMT+0000 (UTC).
345
- *
346
- * Example:
347
- * Time Zone: Central European Standard Time
348
- * new Date('1/1/1992').toUTCString() // "Tue, 31 Dec 1991 23:00:00 GMT"
349
- * new Date('1/1/1992 GMT+0000').toUTCString() // "Wed, 01 Jan 1992 00:00:00 GMT"
350
- */
351
- const date = new Date(`${i}/1/${year} GMT+0000`);
352
- const monthString = new Intl.DateTimeFormat(locale, Object.assign(Object.assign({}, formatOptions), { timeZone: 'UTC' })).format(date);
353
- months.push({ text: monthString, value: i });
354
- }
355
- }
356
- return months;
357
- };
358
- /**
359
- * Returns information regarding
360
- * selectable dates (i.e 1st, 2nd, 3rd, etc)
361
- * within a reference month.
362
- * @param locale The locale to format the date with
363
- * @param refParts The reference month/year to generate dates for
364
- * @param minParts The minimum bound on the date that can be returned
365
- * @param maxParts The maximum bound on the date that can be returned
366
- * @param dayValues The allowed date values
367
- * @returns Date data to be used in ion-picker-column
368
- */
369
- const getDayColumnData = (locale, refParts, minParts, maxParts, dayValues, formatOptions = {
370
- day: 'numeric',
371
- }) => {
372
- const { month, year } = refParts;
373
- const days = [];
374
- /**
375
- * If we have max/min bounds that in the same
376
- * month/year as the refParts, we should
377
- * use the define day as the max/min day.
378
- * Otherwise, fallback to the max/min days in a month.
379
- */
380
- const numDaysInMonth = format.getNumDaysInMonth(month, year);
381
- const maxDay = (maxParts === null || maxParts === void 0 ? void 0 : maxParts.day) !== null && (maxParts === null || maxParts === void 0 ? void 0 : maxParts.day) !== undefined && maxParts.year === year && maxParts.month === month
382
- ? maxParts.day
383
- : numDaysInMonth;
384
- const minDay = (minParts === null || minParts === void 0 ? void 0 : minParts.day) !== null && (minParts === null || minParts === void 0 ? void 0 : minParts.day) !== undefined && minParts.year === year && minParts.month === month
385
- ? minParts.day
386
- : 1;
387
- if (dayValues !== undefined) {
388
- let processedDays = dayValues;
389
- processedDays = processedDays.filter((day) => day >= minDay && day <= maxDay);
390
- processedDays.forEach((processedDay) => {
391
- const date = new Date(`${month}/${processedDay}/${year} GMT+0000`);
392
- const dayString = new Intl.DateTimeFormat(locale, Object.assign(Object.assign({}, formatOptions), { timeZone: 'UTC' })).format(date);
393
- days.push({ text: dayString, value: processedDay });
394
- });
395
- }
396
- else {
397
- for (let i = minDay; i <= maxDay; i++) {
398
- const date = new Date(`${month}/${i}/${year} GMT+0000`);
399
- const dayString = new Intl.DateTimeFormat(locale, Object.assign(Object.assign({}, formatOptions), { timeZone: 'UTC' })).format(date);
400
- days.push({ text: dayString, value: i });
401
- }
402
- }
403
- return days;
404
- };
405
- const getYearColumnData = (locale, refParts, minParts, maxParts, yearValues) => {
406
- var _a, _b;
407
- let processedYears = [];
408
- if (yearValues !== undefined) {
409
- processedYears = yearValues;
410
- if ((maxParts === null || maxParts === void 0 ? void 0 : maxParts.year) !== undefined) {
411
- processedYears = processedYears.filter((year) => year <= maxParts.year);
412
- }
413
- if ((minParts === null || minParts === void 0 ? void 0 : minParts.year) !== undefined) {
414
- processedYears = processedYears.filter((year) => year >= minParts.year);
415
- }
416
- }
417
- else {
418
- const { year } = refParts;
419
- const maxYear = (_a = maxParts === null || maxParts === void 0 ? void 0 : maxParts.year) !== null && _a !== void 0 ? _a : year;
420
- const minYear = (_b = minParts === null || minParts === void 0 ? void 0 : minParts.year) !== null && _b !== void 0 ? _b : year - 100;
421
- for (let i = minYear; i <= maxYear; i++) {
422
- processedYears.push(i);
423
- }
424
- }
425
- return processedYears.map((year) => ({
426
- text: format.getYear(locale, { year, month: refParts.month, day: refParts.day }),
427
- value: year,
428
- }));
429
- };
430
- /**
431
- * Given a starting date and an upper bound,
432
- * this functions returns an array of all
433
- * month objects in that range.
434
- */
435
- const getAllMonthsInRange = (currentParts, maxParts) => {
436
- if (currentParts.month === maxParts.month && currentParts.year === maxParts.year) {
437
- return [currentParts];
438
- }
439
- return [currentParts, ...getAllMonthsInRange(format.getNextMonth(currentParts), maxParts)];
440
- };
441
- /**
442
- * Creates and returns picker items
443
- * that represent the days in a month.
444
- * Example: "Thu, Jun 2"
445
- */
446
- const getCombinedDateColumnData = (locale, todayParts, minParts, maxParts, dayValues, monthValues) => {
447
- let items = [];
448
- let parts = [];
449
- /**
450
- * Get all month objects from the min date
451
- * to the max date. Note: Do not use getMonthColumnData
452
- * as that function only generates dates within a
453
- * single year.
454
- */
455
- let months = getAllMonthsInRange(minParts, maxParts);
456
- /**
457
- * Filter out any disallowed month values.
458
- */
459
- if (monthValues) {
460
- months = months.filter(({ month }) => monthValues.includes(month));
461
- }
462
- /**
463
- * Get all of the days in the month.
464
- * From there, generate an array where
465
- * each item has the month, date, and day
466
- * of work as the text.
467
- */
468
- months.forEach((monthObject) => {
469
- const referenceMonth = { month: monthObject.month, day: null, year: monthObject.year };
470
- const monthDays = getDayColumnData(locale, referenceMonth, minParts, maxParts, dayValues, {
471
- month: 'short',
472
- day: 'numeric',
473
- weekday: 'short',
474
- });
475
- const dateParts = [];
476
- const dateColumnItems = [];
477
- monthDays.forEach((dayObject) => {
478
- const isToday = format.isSameDay(Object.assign(Object.assign({}, referenceMonth), { day: dayObject.value }), todayParts);
479
- /**
480
- * Today's date should read as "Today" (localized)
481
- * not the actual date string
482
- */
483
- dateColumnItems.push({
484
- text: isToday ? format.getTodayLabel(locale) : dayObject.text,
485
- value: `${referenceMonth.year}-${referenceMonth.month}-${dayObject.value}`,
486
- });
487
- /**
488
- * When selecting a date in the wheel picker
489
- * we need access to the raw datetime parts data.
490
- * The picker column only accepts values of
491
- * type string or number, so we need to return
492
- * two sets of data: A data set to be passed
493
- * to the picker column, and a data set to
494
- * be used to reference the raw data when
495
- * updating the picker column value.
496
- */
497
- dateParts.push({
498
- month: referenceMonth.month,
499
- year: referenceMonth.year,
500
- day: dayObject.value,
501
- });
502
- });
503
- parts = [...parts, ...dateParts];
504
- items = [...items, ...dateColumnItems];
505
- });
506
- return {
507
- parts,
508
- items,
509
- };
510
- };
511
- const getTimeColumnsData = (locale, refParts, hourCycle, minParts, maxParts, allowedHourValues, allowedMinuteValues) => {
512
- const computedHourCycle = format.getHourCycle(locale, hourCycle);
513
- const use24Hour = format.is24Hour(computedHourCycle);
514
- const { hours, minutes, am, pm } = generateTime(locale, refParts, computedHourCycle, minParts, maxParts, allowedHourValues, allowedMinuteValues);
515
- const hoursItems = hours.map((hour) => {
516
- return {
517
- text: format.getFormattedHour(hour, computedHourCycle),
518
- value: format.getInternalHourValue(hour, use24Hour, refParts.ampm),
519
- };
520
- });
521
- const minutesItems = minutes.map((minute) => {
522
- return {
523
- text: format.addTimePadding(minute),
524
- value: minute,
525
- };
526
- });
527
- const dayPeriodItems = [];
528
- if (am && !use24Hour) {
529
- dayPeriodItems.push({
530
- text: format.getLocalizedDayPeriod(locale, 'am'),
531
- value: 'am',
532
- });
533
- }
534
- if (pm && !use24Hour) {
535
- dayPeriodItems.push({
536
- text: format.getLocalizedDayPeriod(locale, 'pm'),
537
- value: 'pm',
538
- });
539
- }
540
- return {
541
- minutesData: minutesItems,
542
- hoursData: hoursItems,
543
- dayPeriodData: dayPeriodItems,
544
- };
545
- };
546
-
547
- const isYearDisabled = (refYear, minParts, maxParts) => {
548
- if (minParts && minParts.year > refYear) {
549
- return true;
550
- }
551
- if (maxParts && maxParts.year < refYear) {
552
- return true;
553
- }
554
- return false;
555
- };
556
- /**
557
- * Returns true if a given day should
558
- * not be interactive according to its value,
559
- * or the max/min dates.
560
- */
561
- const isDayDisabled = (refParts, minParts, maxParts, dayValues) => {
562
- /**
563
- * If this is a filler date (i.e. padding)
564
- * then the date is disabled.
565
- */
566
- if (refParts.day === null) {
567
- return true;
568
- }
569
- /**
570
- * If user passed in a list of acceptable day values
571
- * check to make sure that the date we are looking
572
- * at is in this array.
573
- */
574
- if (dayValues !== undefined && !dayValues.includes(refParts.day)) {
575
- return true;
576
- }
577
- /**
578
- * Given a min date, perform the following
579
- * checks. If any of them are true, then the
580
- * day should be disabled:
581
- * 1. Is the current year < the min allowed year?
582
- * 2. Is the current year === min allowed year,
583
- * but the current month < the min allowed month?
584
- * 3. Is the current year === min allowed year, the
585
- * current month === min allow month, but the current
586
- * day < the min allowed day?
587
- */
588
- if (minParts && format.isBefore(refParts, minParts)) {
589
- return true;
590
- }
591
- /**
592
- * Given a max date, perform the following
593
- * checks. If any of them are true, then the
594
- * day should be disabled:
595
- * 1. Is the current year > the max allowed year?
596
- * 2. Is the current year === max allowed year,
597
- * but the current month > the max allowed month?
598
- * 3. Is the current year === max allowed year, the
599
- * current month === max allow month, but the current
600
- * day > the max allowed day?
601
- */
602
- if (maxParts && format.isAfter(refParts, maxParts)) {
603
- return true;
604
- }
605
- /**
606
- * If none of these checks
607
- * passed then the date should
608
- * be interactive.
609
- */
610
- return false;
611
- };
612
- /**
613
- * Given a locale, a date, the selected date(s), and today's date,
614
- * generate the state for a given calendar day button.
615
- */
616
- const getCalendarDayState = (locale, refParts, activeParts, todayParts, minParts, maxParts, dayValues) => {
617
- /**
618
- * activeParts signals what day(s) are currently selected in the datetime.
619
- * If multiple="true", this will be an array, but the logic in this util
620
- * is the same whether we have one selected day or many because we're only
621
- * calculating the state for one button. So, we treat a single activeParts value
622
- * the same as an array of length one.
623
- */
624
- const activePartsArray = Array.isArray(activeParts) ? activeParts : [activeParts];
625
- /**
626
- * The day button is active if it is selected, or in other words, if refParts
627
- * matches at least one selected date.
628
- */
629
- const isActive = activePartsArray.find((parts) => format.isSameDay(refParts, parts)) !== undefined;
630
- const isToday = format.isSameDay(refParts, todayParts);
631
- const disabled = isDayDisabled(refParts, minParts, maxParts, dayValues);
632
- /**
633
- * Note that we always return one object regardless of whether activeParts
634
- * was an array, since we pare down to one value for isActive.
635
- */
636
- return {
637
- disabled,
638
- isActive,
639
- isToday,
640
- ariaSelected: isActive ? 'true' : null,
641
- ariaLabel: format.generateDayAriaLabel(locale, isToday, refParts),
642
- text: refParts.day != null ? format.getDay(locale, refParts) : null,
643
- };
644
- };
645
- /**
646
- * Returns `true` if the month is disabled given the
647
- * current date value and min/max date constraints.
648
- */
649
- const isMonthDisabled = (refParts, { minParts, maxParts, }) => {
650
- // If the year is disabled then the month is disabled.
651
- if (isYearDisabled(refParts.year, minParts, maxParts)) {
652
- return true;
653
- }
654
- // If the date value is before the min date, then the month is disabled.
655
- // If the date value is after the max date, then the month is disabled.
656
- if ((minParts && format.isBefore(refParts, minParts)) || (maxParts && format.isAfter(refParts, maxParts))) {
657
- return true;
658
- }
659
- return false;
660
- };
661
- /**
662
- * Given a working date, an optional minimum date range,
663
- * and an optional maximum date range; determine if the
664
- * previous navigation button is disabled.
665
- */
666
- const isPrevMonthDisabled = (refParts, minParts, maxParts) => {
667
- const prevMonth = Object.assign(Object.assign({}, format.getPreviousMonth(refParts)), { day: null });
668
- return isMonthDisabled(prevMonth, {
669
- minParts,
670
- maxParts,
671
- });
672
- };
673
- /**
674
- * Given a working date and a maximum date range,
675
- * determine if the next navigation button is disabled.
676
- */
677
- const isNextMonthDisabled = (refParts, maxParts) => {
678
- const nextMonth = Object.assign(Object.assign({}, format.getNextMonth(refParts)), { day: null });
679
- return isMonthDisabled(nextMonth, {
680
- maxParts,
681
- });
682
- };
683
- /**
684
- * Given the value of the highlightedDates property
685
- * and an ISO string, return the styles to use for
686
- * that date, or undefined if none are found.
687
- */
688
- const getHighlightStyles = (highlightedDates, dateIsoString, el) => {
689
- if (Array.isArray(highlightedDates)) {
690
- const dateStringWithoutTime = dateIsoString.split('T')[0];
691
- const matchingHighlight = highlightedDates.find((hd) => hd.date === dateStringWithoutTime);
692
- if (matchingHighlight) {
693
- return {
694
- textColor: matchingHighlight.textColor,
695
- backgroundColor: matchingHighlight.backgroundColor,
696
- border: matchingHighlight.border,
697
- };
698
- }
699
- }
700
- else {
701
- /**
702
- * Wrap in a try-catch to prevent exceptions in the user's function
703
- * from interrupting the calendar's rendering.
704
- */
705
- try {
706
- return highlightedDates(dateIsoString);
707
- }
708
- catch (e) {
709
- index.printIonError('[ion-datetime] - Exception thrown from provided `highlightedDates` callback. Please check your function and try again.', el, e);
710
- }
711
- }
712
- return undefined;
713
- };
714
-
715
- /**
716
- * If a time zone is provided in the format options, the rendered text could
717
- * differ from what was selected in the Datetime, which could cause
718
- * confusion.
719
- */
720
- const warnIfTimeZoneProvided = (el, formatOptions) => {
721
- var _a, _b, _c, _d;
722
- if (((_a = formatOptions === null || formatOptions === void 0 ? void 0 : formatOptions.date) === null || _a === void 0 ? void 0 : _a.timeZone) ||
723
- ((_b = formatOptions === null || formatOptions === void 0 ? void 0 : formatOptions.date) === null || _b === void 0 ? void 0 : _b.timeZoneName) ||
724
- ((_c = formatOptions === null || formatOptions === void 0 ? void 0 : formatOptions.time) === null || _c === void 0 ? void 0 : _c.timeZone) ||
725
- ((_d = formatOptions === null || formatOptions === void 0 ? void 0 : formatOptions.time) === null || _d === void 0 ? void 0 : _d.timeZoneName)) {
726
- index.printIonWarning('[ion-datetime] - "timeZone" and "timeZoneName" are not supported in "formatOptions".', el);
727
- }
728
- };
729
- const checkForPresentationFormatMismatch = (el, presentation, formatOptions) => {
730
- // formatOptions is not required
731
- if (!formatOptions)
732
- return;
733
- // If formatOptions is provided, the date and/or time objects are required, depending on the presentation
734
- switch (presentation) {
735
- case 'date':
736
- case 'month-year':
737
- case 'month':
738
- case 'year':
739
- if (formatOptions.date === undefined) {
740
- index.printIonWarning(`[ion-datetime] - The '${presentation}' presentation requires a date object in formatOptions.`, el);
741
- }
742
- break;
743
- case 'time':
744
- if (formatOptions.time === undefined) {
745
- index.printIonWarning(`[ion-datetime] - The 'time' presentation requires a time object in formatOptions.`, el);
746
- }
747
- break;
748
- case 'date-time':
749
- case 'time-date':
750
- if (formatOptions.date === undefined && formatOptions.time === undefined) {
751
- index.printIonWarning(`[ion-datetime] - The '${presentation}' presentation requires either a date or time object (or both) in formatOptions.`, el);
752
- }
753
- break;
754
- }
755
- };
756
-
757
- const datetimeIonicCss = () => `: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-cover){width:100%}:host(:not(.datetime-ready)) .datetime-year{position:absolute;pointer-events:none}:host(.datetime-ready) .datetime-year{display:none}: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,::slotted([slot=buttons]),.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-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{-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;cursor:pointer;-webkit-appearance:none;-moz-appearance:none;appearance:none;z-index:0}.calendar-day[disabled]{pointer-events:none}:host .datetime-time{display:-ms-flexbox;display:flex;-ms-flex-pack:justify;justify-content:space-between}:host .time-header{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center}:host .time-body{display:-ms-flexbox;display:flex;border:none;font-family:inherit;font-size:inherit;cursor:pointer;-webkit-appearance:none;-moz-appearance:none;appearance:none}:host(.in-item){position:static}.calendar-month-year{min-width:0}.calendar-month-year-toggle{color:inherit;font-family:inherit;font-size:inherit;font-style:inherit;font-weight:inherit;letter-spacing:inherit;text-align:inherit;text-decoration:inherit;text-indent:inherit;text-overflow:inherit;text-transform:inherit;white-space:inherit;position:relative;border:0;outline:none;background:transparent;cursor:pointer;z-index:1}.calendar-month-year-toggle ion-icon{-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}:host{--background:var(--token-bg-surface-default, var(--token-primitives-base-white, #ffffff));--focus-ring-color:var(--token-border-focus-default, var(--token-primitives-blue-400, #b5c0f7));--focus-ring-width:var(--token-border-radius-025, var(--token-scale-050, 2px));--body-opacity:0;--year-opacity:0}:host .calendar-body{opacity:var(--body-opacity)}:host .datetime-year{opacity:var(--year-opacity)}:host(.datetime-ready) .calendar-body{--body-opacity:1}:host(.datetime-ready) .datetime-year{--year-opacity:1}:host .datetime-header{-webkit-padding-start:var(--token-space-400, var(--token-scale-400, 16px));padding-inline-start:var(--token-space-400, var(--token-scale-400, 16px));-webkit-padding-end:var(--token-space-400, var(--token-scale-400, 16px));padding-inline-end:var(--token-space-400, var(--token-scale-400, 16px));padding-top:var(--token-space-200, var(--token-scale-200, 8px));padding-bottom:var(--token-space-400, var(--token-scale-400, 16px));display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;-ms-flex-align:start;align-items:start;-ms-flex-pack:justify;justify-content:space-between;height:var(--token-scale-1400, 56px);margin-bottom:var(--token-space-200, var(--token-scale-200, 8px));border-bottom:var(--token-border-style-solid, solid) var(--token-border-size-025, var(--token-scale-025, 1px)) var(--token-primitives-neutral-400, #d5d5d5)}:host .datetime-header .datetime-title{font-size:var(--token-font-size-450, 1.125rem);font-weight:var(--token-font-weight-medium, 500);letter-spacing:var(--token-font-letter-spacing-0, 0%);line-height:var(--token-font-line-height-700, var(--token-scale-700, 28px));text-decoration:none;text-transform:none;color:var(--token-primitives-neutral-800, #626262)}:host .datetime-header .datetime-selected-date{font-size:var(--token-font-size-350, 0.875rem);font-weight:var(--token-font-weight-regular, 400);letter-spacing:var(--token-font-letter-spacing-0, 0%);line-height:var(--token-font-line-height-600, var(--token-scale-600, 24px));text-decoration:none;text-transform:none;color:var(--token-primitives-neutral-1000, #3b3b3b)}.calendar-action-buttons{padding-top:var(--token-space-200, var(--token-scale-200, 8px));padding-bottom:var(--token-space-200, var(--token-scale-200, 8px));-ms-flex-align:center;align-items:center;height:var(--token-scale-1400, 56px);-webkit-box-sizing:border-box;box-sizing:border-box}.calendar-month-year{-ms-flex:1 0 0px;flex:1 0 0}.calendar-month-year-toggle{border-radius:var(--token-border-radius-full, 999px);font-size:var(--token-font-size-400, 1rem);font-weight:var(--token-font-weight-medium, 500);letter-spacing:var(--token-font-letter-spacing-1, 1%);line-height:var(--token-font-line-height-600, var(--token-scale-600, 24px));text-decoration:none;text-transform:none;-webkit-padding-start:var(--token-space-400, var(--token-scale-400, 16px));padding-inline-start:var(--token-space-400, var(--token-scale-400, 16px));-webkit-padding-end:var(--token-space-400, var(--token-scale-400, 16px));padding-inline-end:var(--token-space-400, var(--token-scale-400, 16px));padding-top:var(--token-space-200, var(--token-scale-200, 8px));padding-bottom:var(--token-space-200, var(--token-scale-200, 8px));min-width:var(--token-scale-1600, 64px);min-height:var(--token-scale-1000, 40px);border:var(--focus-ring-width) var(--token-border-style-solid, solid) transparent;color:var(--token-semantics-primary-base, var(--token-semantics-primary-700, var(--token-primitives-blue-700, #105cef)))}@media (any-hover: hover){.calendar-month-year-toggle:hover{background:var(--token-primitives-neutral-200, #eae9e9)}}.calendar-month-year-toggle.ion-focused{border-color:var(--focus-ring-color)}.calendar-month-year-toggle.ion-activated{background:var(--token-primitives-neutral-200, #eae9e9)}.calendar-next-prev ion-button.button-has-icon-only{--color:var(--token-primitives-neutral-1000, #3b3b3b);--background-activated:var(--token-primitives-neutral-200, #eae9e9);--background-hover:var(--token-primitives-neutral-200, #eae9e9);--background-hover-opacity:1;min-height:var(--token-scale-1000, 40px)}.calendar-next-prev ion-button.button-has-icon-only.ion-focused::part(native){border:var(--token-border-size-050, var(--token-scale-050, 2px)) var(--token-border-style-solid, solid) var(--token-border-focus-default, var(--token-primitives-blue-400, #b5c0f7));outline:none}.calendar-days-of-week{font-size:var(--token-font-size-300, 0.75rem);font-weight:var(--token-font-weight-medium, 500);letter-spacing:var(--token-font-letter-spacing-2, 1.5%);line-height:var(--token-font-line-height-500, var(--token-scale-500, 20px));text-decoration:none;text-transform:uppercase;-ms-flex-line-pack:center;align-content:center;height:var(--token-scale-1200, 48px);color:var(--token-primitives-neutral-800, #626262)}.calendar-day{border-radius:var(--token-border-radius-full, 999px);-webkit-padding-start:var(--token-space-100, var(--token-scale-100, 4px));padding-inline-start:var(--token-space-100, var(--token-scale-100, 4px));-webkit-padding-end:var(--token-space-100, var(--token-scale-100, 4px));padding-inline-end:var(--token-space-100, var(--token-scale-100, 4px));padding-top:var(--token-space-100, var(--token-scale-100, 4px));padding-bottom:var(--token-space-100, var(--token-scale-100, 4px));font-size:var(--token-font-size-350, 0.875rem);font-weight:var(--token-font-weight-medium, 500);letter-spacing:var(--token-font-letter-spacing-1, 1%);line-height:var(--token-font-line-height-500, var(--token-scale-500, 20px));text-decoration:none;text-transform:none;width:var(--token-scale-1200, 48px);min-width:var(--token-scale-1200, 48px);height:var(--token-scale-1200, 48px);color:var(--token-text-default, var(--token-primitives-neutral-1200, #242424))}.calendar-day[disabled]:not(.calendar-day-constrained){color:var(--token-primitives-neutral-500, #a2a2a2)}.calendar-day.calendar-day-today{color:var(--token-semantics-primary-base, var(--token-semantics-primary-700, var(--token-primitives-blue-700, #105cef)))}.calendar-day.calendar-day-active,.calendar-day.calendar-day-active.calendar-day-adjacent-day{background:var(--token-semantics-primary-100, var(--token-primitives-blue-100, #e9ecfc))}.calendar-day:focus-visible{border:var(--focus-ring-width) var(--token-border-style-solid, solid) var(--focus-ring-color)}@media (any-hover: hover){.calendar-day:not([disabled]):not(:active):hover{background:var(--token-semantics-primary-200, var(--token-primitives-blue-200, #e4e8ff))}}.calendar-day:active,.calendar-day.calendar-day-adjacent-day:active{background:var(--token-bg-primary-subtle-press, var(--token-semantics-primary-300, var(--token-primitives-blue-300, #d0d7fa)))}.calendar-day.calendar-day-adjacent-day{color:var(--token-text-subtlest, var(--token-primitives-neutral-800, #626262))}.calendar-day.calendar-day-active.calendar-day-adjacent-day{color:var(--token-text-default, var(--token-primitives-neutral-1200, #242424))}:host .datetime-time{-webkit-padding-start:var(--token-space-400, var(--token-scale-400, 16px));padding-inline-start:var(--token-space-400, var(--token-scale-400, 16px));-webkit-padding-end:var(--token-space-400, var(--token-scale-400, 16px));padding-inline-end:var(--token-space-400, var(--token-scale-400, 16px));padding-top:var(--token-space-100, var(--token-scale-100, 4px));padding-bottom:var(--token-space-100, var(--token-scale-100, 4px))}:host .datetime-time .time-header{font-size:var(--token-font-size-400, 1rem);font-weight:var(--token-font-weight-medium, 500);letter-spacing:var(--token-font-letter-spacing-1, 1%);line-height:var(--token-font-line-height-600, var(--token-scale-600, 24px));text-decoration:none;text-transform:none;color:var(--token-primitives-neutral-800, #626262)}:host .datetime-time button{-webkit-padding-start:var(--token-space-200, var(--token-scale-200, 8px));padding-inline-start:var(--token-space-200, var(--token-scale-200, 8px));-webkit-padding-end:var(--token-space-200, var(--token-scale-200, 8px));padding-inline-end:var(--token-space-200, var(--token-scale-200, 8px));padding-top:var(--token-space-0, var(--token-scale-0, 0px));padding-bottom:var(--token-space-0, var(--token-scale-0, 0px));font-size:var(--token-font-size-350, 0.875rem);font-weight:var(--token-font-weight-medium, 500);letter-spacing:var(--token-font-letter-spacing-0, 0%);line-height:var(--token-font-line-height-600, var(--token-scale-600, 24px));text-decoration:none;text-transform:none;border-radius:var(--token-border-radius-full, 999px);display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;height:var(--token-scale-800, 32px);background-color:var(--token-primitives-neutral-100, #f3f3f3);color:var(--token-text-default, var(--token-primitives-neutral-1200, #242424))}:host .datetime-footer{padding-left:0;padding-right:0;padding-top:var(--token-space-200, var(--token-scale-200, 8px));padding-bottom:0;margin-left:0;margin-right:0;margin-top:var(--token-space-200, var(--token-scale-200, 8px));margin-bottom:0;border-left:0;border-right:0;border-top:var(--token-border-style-solid, solid) var(--token-border-size-025, var(--token-scale-025, 1px)) var(--token-primitives-neutral-400, #d5d5d5);border-bottom:0}:host .datetime-buttons .datetime-action-buttons,.datetime-action-buttons .datetime-action-buttons-container,::slotted([slot=buttons]){-ms-flex-flow:column;flex-flow:column;-ms-flex-align:stretch;align-items:stretch;gap:var(--token-space-200, var(--token-scale-200, 8px))}`;
758
-
759
- 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-cover){width:100%}:host(:not(.datetime-ready)) .datetime-year{position:absolute;pointer-events:none}:host(.datetime-ready) .datetime-year{display:none}: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,::slotted([slot=buttons]),.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-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{-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;cursor:pointer;-webkit-appearance:none;-moz-appearance:none;appearance:none;z-index:0}.calendar-day[disabled]{pointer-events:none}:host .datetime-time{display:-ms-flexbox;display:flex;-ms-flex-pack:justify;justify-content:space-between}:host .time-header{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center}:host .time-body{display:-ms-flexbox;display:flex;border:none;font-family:inherit;font-size:inherit;cursor:pointer;-webkit-appearance:none;-moz-appearance:none;appearance:none}:host(.in-item){position:static}.calendar-month-year{min-width:0}.calendar-month-year-toggle{color:inherit;font-family:inherit;font-size:inherit;font-style:inherit;font-weight:inherit;letter-spacing:inherit;text-align:inherit;text-decoration:inherit;text-indent:inherit;text-overflow:inherit;text-transform:inherit;white-space:inherit;position:relative;border:0;outline:none;background:transparent;cursor:pointer;z-index:1}.calendar-month-year-toggle ion-icon{-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}:host{}:host(.datetime-size-fixed:not(.datetime-prefer-wheel)){max-width:350px}:host .calendar-body,:host .datetime-year{opacity:0}:host(.datetime-ready) .calendar-body,:host(.datetime-ready) .datetime-year{opacity:1}: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 .calendar-action-buttons ion-button{--background:transparent}.calendar-day{border-radius:50%;font-family:var(--ion-font-family, inherit)}:host .calendar-day[disabled]{opacity:0.4}.calendar-day:not(.calendar-day-adjacent-day):focus{background:current-color(base, 0.2);-webkit-box-shadow:0px 0px 0px 4px current-color(base, 0.2);box-shadow:0px 0px 0px 4px current-color(base, 0.2)}.calendar-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 .calendar-next-prev{display:-ms-flexbox;display:flex;-ms-flex-align:start;align-items:start}.calendar-next-prev ion-button ion-icon[slot=icon-only]{padding-left:0;padding-right:0;padding-top:0;padding-bottom:0;margin-left:0;margin-right:0;margin-top:0;margin-bottom:0}: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-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;background:var(--ion-color-step-300, var(--ion-background-color-step-300, #edeef0));color:var(--ion-text-color, #000)}:host .time-body-active{color:var(--ion-color-base)}:host(.show-month-and-year) .calendar-action-buttons .calendar-month-year-toggle{color:var(--ion-color-base)}.calendar-month-year-toggle::after{right:0;left: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}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 .datetime-action-buttons{-ms-flex-pack:justify;justify-content:space-between}: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-button{color:var(--ion-color-base)}:host .calendar-action-buttons ion-button{margin-left:0;margin-right:0;margin-top:0;margin-bottom:0}:host .calendar-action-buttons .calendar-next-prev{-ms-flex-align:stretch;align-items:stretch}.calendar-next-prev ion-button{--padding-top:0;--padding-bottom:0;--padding-start:5px;--padding-end:5px;-webkit-margin-start:2px;margin-inline-start:2px;-webkit-margin-end:2px;margin-inline-end:2px;min-height:32px}.calendar-next-prev ion-button ion-icon[slot=icon-only]{font-size:1.65em;line-height:0.67}: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([slot=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,::slotted([slot=buttons]){width:100%}`;
760
-
761
- 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-cover){width:100%}:host(:not(.datetime-ready)) .datetime-year{position:absolute;pointer-events:none}:host(.datetime-ready) .datetime-year{display:none}: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,::slotted([slot=buttons]),.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-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{-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;cursor:pointer;-webkit-appearance:none;-moz-appearance:none;appearance:none;z-index:0}.calendar-day[disabled]{pointer-events:none}:host .datetime-time{display:-ms-flexbox;display:flex;-ms-flex-pack:justify;justify-content:space-between}:host .time-header{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center}:host .time-body{display:-ms-flexbox;display:flex;border:none;font-family:inherit;font-size:inherit;cursor:pointer;-webkit-appearance:none;-moz-appearance:none;appearance:none}:host(.in-item){position:static}.calendar-month-year{min-width:0}.calendar-month-year-toggle{color:inherit;font-family:inherit;font-size:inherit;font-style:inherit;font-weight:inherit;letter-spacing:inherit;text-align:inherit;text-decoration:inherit;text-indent:inherit;text-overflow:inherit;text-transform:inherit;white-space:inherit;position:relative;border:0;outline:none;background:transparent;cursor:pointer;z-index:1}.calendar-month-year-toggle ion-icon{-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}:host{}:host(.datetime-size-fixed:not(.datetime-prefer-wheel)){max-width:350px}:host .calendar-body,:host .datetime-year{opacity:0}:host(.datetime-ready) .calendar-body,:host(.datetime-ready) .datetime-year{opacity:1}: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 .calendar-action-buttons ion-button{--background:transparent}.calendar-day{border-radius:50%;font-family:var(--ion-font-family, inherit)}:host .calendar-day[disabled]{opacity:0.4}.calendar-day:not(.calendar-day-adjacent-day):focus{background:current-color(base, 0.2);-webkit-box-shadow:0px 0px 0px 4px current-color(base, 0.2);box-shadow:0px 0px 0px 4px current-color(base, 0.2)}.calendar-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 .calendar-next-prev{display:-ms-flexbox;display:flex;-ms-flex-align:start;align-items:start}.calendar-next-prev ion-button ion-icon[slot=icon-only]{padding-left:0;padding-right:0;padding-top:0;padding-bottom:0;margin-left:0;margin-right:0;margin-top:0;margin-bottom:0}: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-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;background:var(--ion-color-step-300, var(--ion-background-color-step-300, #edeef0));color:var(--ion-text-color, #000)}:host .time-body-active{color:var(--ion-color-base)}:host(.show-month-and-year) .calendar-action-buttons .calendar-month-year-toggle{color:var(--ion-color-base)}.calendar-month-year-toggle::after{right:0;left: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}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 .datetime-action-buttons{-ms-flex-pack:justify;justify-content:space-between}: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-next-prev ion-button{--padding-top:12px;--padding-end:12px;--padding-bottom:12px;--padding-start:12px;--border-radius:50%;margin-left:0;margin-right:0;margin-top:0;margin-bottom:0;width:3rem;height:3rem}.calendar-next-prev ion-button ion-icon[slot=icon-only]{font-size:1.8em}.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}`;
762
-
763
- const Datetime = class {
764
- constructor(hostRef) {
765
- index.registerInstance(this, hostRef);
766
- this.ionCancel = index.createEvent(this, "ionCancel", 7);
767
- this.ionChange = index.createEvent(this, "ionChange", 7);
768
- this.ionValueChange = index.createEvent(this, "ionValueChange", 7);
769
- this.ionFocus = index.createEvent(this, "ionFocus", 7);
770
- this.ionBlur = index.createEvent(this, "ionBlur", 7);
771
- this.ionStyle = index.createEvent(this, "ionStyle", 7);
772
- this.ionRender = index.createEvent(this, "ionRender", 7);
773
- this.inputId = `ion-dt-${datetimeIds++}`;
774
- /**
775
- * Set true only by `visibleCallback`. Lets `hiddenCallback` ignore the
776
- * synthetic "not intersecting" entry IntersectionObserver fires on
777
- * `observe()` when the host mounts offscreen.
778
- *
779
- * Don't reset this in `disconnectedCallback`. Overlays disconnect and
780
- * reconnect the host without re-creating the observers, so a reset there
781
- * makes `hiddenCallback` miss the dismissal.
782
- */
783
- this.hasBeenIntersecting = false;
784
- this.prevPresentation = null;
785
- this.showMonthAndYear = false;
786
- this.activeParts = [];
787
- this.workingParts = {
788
- month: 5,
789
- day: 28,
790
- year: 2021,
791
- hour: 13,
792
- minute: 52,
793
- ampm: 'pm',
794
- isAdjacentDay: false,
795
- };
796
- this.isTimePopoverOpen = false;
797
- /**
798
- * The color to use from your application's color palette.
799
- * Default options are: `"primary"`, `"secondary"`, `"tertiary"`, `"success"`, `"warning"`, `"danger"`, `"light"`, `"medium"`, and `"dark"`.
800
- * For more information on colors, refer to [theming](/docs/theming/basics).
801
- */
802
- this.color = 'primary';
803
- /**
804
- * The name of the control, which is submitted with the form data.
805
- */
806
- this.name = this.inputId;
807
- /**
808
- * If `true`, the user cannot interact with the datetime.
809
- */
810
- this.disabled = false;
811
- /**
812
- * If `true`, the datetime appears normal but the selected date cannot be changed.
813
- */
814
- this.readonly = false;
815
- /**
816
- * If `true`, the datetime calendar displays a six-week (42-day) layout,
817
- * including days from the previous and next months to fill the grid.
818
- * These adjacent days are selectable unless disabled.
819
- */
820
- this.showAdjacentDays = false;
821
- /**
822
- * Which values you want to select. `"date"` will show
823
- * a calendar picker to select the month, day, and year. `"time"`
824
- * will show a time picker to select the hour, minute, and (optionally)
825
- * AM/PM. `"date-time"` will show the date picker first and time picker second.
826
- * `"time-date"` will show the time picker first and date picker second.
827
- */
828
- this.presentation = 'date-time';
829
- /**
830
- * The text to display on the picker's cancel button.
831
- */
832
- this.cancelText = 'Cancel';
833
- /**
834
- * The text to display on the picker's "Done" button.
835
- */
836
- this.doneText = 'Done';
837
- /**
838
- * The text to display on the picker's "Clear" button.
839
- */
840
- this.clearText = 'Clear';
841
- /**
842
- * The locale to use for `ion-datetime`. This
843
- * impacts month and day name formatting.
844
- * The `"default"` value refers to the default
845
- * locale set by your device.
846
- */
847
- this.locale = 'default';
848
- /**
849
- * The first day of the week to use for `ion-datetime`. The
850
- * default value is `0` and represents Sunday.
851
- */
852
- this.firstDayOfWeek = 0;
853
- /**
854
- * If `true`, multiple dates can be selected at once. Only
855
- * applies to `presentation="date"` and `preferWheel="false"`.
856
- */
857
- this.multiple = false;
858
- /**
859
- * If `true`, a header will be shown above the calendar
860
- * picker. This will include both the slotted title, and
861
- * the selected date.
862
- */
863
- this.showDefaultTitle = false;
864
- /**
865
- * If `true`, the default "Cancel" and "OK" buttons
866
- * will be rendered at the bottom of the `ion-datetime`
867
- * component. Developers can also use the `button` slot
868
- * if they want to customize these buttons. If custom
869
- * buttons are set in the `button` slot then the
870
- * default buttons will not be rendered.
871
- */
872
- this.showDefaultButtons = false;
873
- /**
874
- * If `true`, a "Clear" button will be rendered alongside
875
- * the default "Cancel" and "OK" buttons at the bottom of the `ion-datetime`
876
- * component. Developers can also use the `button` slot
877
- * if they want to customize these buttons. If custom
878
- * buttons are set in the `button` slot then the
879
- * default buttons will not be rendered.
880
- */
881
- this.showClearButton = false;
882
- /**
883
- * If `true`, the default "Time" label will be rendered
884
- * for the time selector of the `ion-datetime` component.
885
- * Developers can also use the `time-label` slot
886
- * if they want to customize this label. If a custom
887
- * label is set in the `time-label` slot then the
888
- * default label will not be rendered.
889
- */
890
- this.showDefaultTimeLabel = true;
891
- /**
892
- * If `cover`, the `ion-datetime` will expand to cover the full width of its container.
893
- * If `fixed`, the `ion-datetime` will have a fixed width.
894
- */
895
- this.size = 'fixed';
896
- /**
897
- * If `true`, a wheel picker will be rendered instead of a calendar grid
898
- * where possible. If `false`, a calendar grid will be rendered instead of
899
- * a wheel picker where possible.
900
- *
901
- * A wheel picker can be rendered instead of a grid when `presentation` is
902
- * one of the following values: `"date"`, `"date-time"`, or `"time-date"`.
903
- *
904
- * A wheel picker will always be rendered regardless of
905
- * the `preferWheel` value when `presentation` is one of the following values:
906
- * `"time"`, `"month"`, `"month-year"`, or `"year"`.
907
- */
908
- this.preferWheel = false;
909
- this.warnIfIncorrectValueUsage = () => {
910
- const { multiple, value } = this;
911
- if (!multiple && Array.isArray(value)) {
912
- /**
913
- * We do some processing on the `value` array so
914
- * that it looks more like an array when logged to
915
- * the console.
916
- * Example given ['a', 'b']
917
- * Default toString() behavior: a,b
918
- * Custom behavior: ['a', 'b']
919
- */
920
- index.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".
921
-
922
- Value Passed: [${value.map((v) => `'${v}'`).join(', ')}]
923
- `, this.el);
924
- }
925
- };
926
- this.setValue = (value) => {
927
- this.value = value;
928
- this.ionChange.emit({ value });
929
- };
930
- /**
931
- * Returns the DatetimePart interface
932
- * to use when rendering an initial set of
933
- * data. This should be used when rendering an
934
- * interface in an environment where the `value`
935
- * may not be set. This function works
936
- * by returning the first selected date and then
937
- * falling back to defaultParts if no active date
938
- * is selected.
939
- */
940
- this.getActivePartsWithFallback = () => {
941
- var _a;
942
- const { defaultParts } = this;
943
- return (_a = this.getActivePart()) !== null && _a !== void 0 ? _a : defaultParts;
944
- };
945
- this.getActivePart = () => {
946
- const { activeParts } = this;
947
- return Array.isArray(activeParts) ? activeParts[0] : activeParts;
948
- };
949
- this.closeParentOverlay = (role) => {
950
- const popoverOrModal = this.el.closest('ion-modal, ion-popover');
951
- if (popoverOrModal) {
952
- popoverOrModal.dismiss(undefined, role);
953
- }
954
- };
955
- this.setWorkingParts = (parts) => {
956
- this.workingParts = Object.assign({}, parts);
957
- };
958
- this.setActiveParts = (parts, removeDate = false) => {
959
- /** if the datetime component is in readonly mode,
960
- * allow browsing of the calendar without changing
961
- * the set value
962
- */
963
- if (this.readonly) {
964
- return;
965
- }
966
- const { multiple, minParts, maxParts, activeParts } = this;
967
- /**
968
- * When setting the active parts, it is possible
969
- * to set invalid data. For example,
970
- * when updating January 31 to February,
971
- * February 31 does not exist. As a result
972
- * we need to validate the active parts and
973
- * ensure that we are only setting valid dates.
974
- * Additionally, we need to update the working parts
975
- * too in the event that the validated parts are different.
976
- */
977
- const validatedParts = format.validateParts(parts, minParts, maxParts);
978
- this.setWorkingParts(validatedParts);
979
- if (multiple) {
980
- const activePartsArray = Array.isArray(activeParts) ? activeParts : [activeParts];
981
- if (removeDate) {
982
- this.activeParts = activePartsArray.filter((p) => !format.isSameDay(p, validatedParts));
983
- }
984
- else {
985
- this.activeParts = [...activePartsArray, validatedParts];
986
- }
987
- }
988
- else {
989
- this.activeParts = Object.assign({}, validatedParts);
990
- }
991
- const hasSlottedButtons = this.el.querySelector('[slot="buttons"]') !== null;
992
- if (hasSlottedButtons || this.showDefaultButtons) {
993
- return;
994
- }
995
- this.confirm();
996
- };
997
- this.initializeKeyboardListeners = () => {
998
- const calendarBodyRef = this.calendarBodyRef;
999
- if (!calendarBodyRef) {
1000
- return;
1001
- }
1002
- const root = this.el.shadowRoot;
1003
- /**
1004
- * Get a reference to the month
1005
- * element we are currently viewing.
1006
- */
1007
- const currentMonth = calendarBodyRef.querySelector('.calendar-month:nth-of-type(2)');
1008
- /**
1009
- * When focusing the calendar body, we want to pass focus
1010
- * to the working day, but other days should
1011
- * only be accessible using the arrow keys. Pressing
1012
- * Tab should jump between bodies of selectable content.
1013
- */
1014
- const checkCalendarBodyFocus = (ev) => {
1015
- var _a;
1016
- const record = ev[0];
1017
- /**
1018
- * If calendar body was already focused
1019
- * when this fired or if the calendar body
1020
- * if not currently focused, we should not re-focus
1021
- * the inner day.
1022
- */
1023
- if (((_a = record.oldValue) === null || _a === void 0 ? void 0 : _a.includes('ion-focused')) || !calendarBodyRef.classList.contains('ion-focused')) {
1024
- return;
1025
- }
1026
- this.focusWorkingDay(currentMonth);
1027
- };
1028
- const mo = new MutationObserver(checkCalendarBodyFocus);
1029
- mo.observe(calendarBodyRef, { attributeFilter: ['class'], attributeOldValue: true });
1030
- this.destroyKeyboardMO = () => {
1031
- mo === null || mo === void 0 ? void 0 : mo.disconnect();
1032
- };
1033
- /**
1034
- * We must use keydown not keyup as we want
1035
- * to prevent scrolling when using the arrow keys.
1036
- */
1037
- calendarBodyRef.addEventListener('keydown', (ev) => {
1038
- const activeElement = root.activeElement;
1039
- if (!activeElement || !activeElement.classList.contains('calendar-day')) {
1040
- return;
1041
- }
1042
- const parts = format.getPartsFromCalendarDay(activeElement);
1043
- let partsToFocus;
1044
- switch (ev.key) {
1045
- case 'ArrowDown':
1046
- ev.preventDefault();
1047
- partsToFocus = format.getNextWeek(parts);
1048
- break;
1049
- case 'ArrowUp':
1050
- ev.preventDefault();
1051
- partsToFocus = format.getPreviousWeek(parts);
1052
- break;
1053
- case 'ArrowRight':
1054
- ev.preventDefault();
1055
- partsToFocus = format.getNextDay(parts);
1056
- break;
1057
- case 'ArrowLeft':
1058
- ev.preventDefault();
1059
- partsToFocus = format.getPreviousDay(parts);
1060
- break;
1061
- case 'Home':
1062
- ev.preventDefault();
1063
- partsToFocus = format.getStartOfWeek(parts);
1064
- break;
1065
- case 'End':
1066
- ev.preventDefault();
1067
- partsToFocus = format.getEndOfWeek(parts);
1068
- break;
1069
- case 'PageUp':
1070
- ev.preventDefault();
1071
- partsToFocus = ev.shiftKey ? format.getPreviousYear(parts) : format.getPreviousMonth(parts);
1072
- break;
1073
- case 'PageDown':
1074
- ev.preventDefault();
1075
- partsToFocus = ev.shiftKey ? format.getNextYear(parts) : format.getNextMonth(parts);
1076
- break;
1077
- /**
1078
- * Do not preventDefault here
1079
- * as we do not want to override other
1080
- * browser defaults such as pressing Enter/Space
1081
- * to select a day.
1082
- */
1083
- default:
1084
- return;
1085
- }
1086
- /**
1087
- * If the day we want to move focus to is
1088
- * disabled, do not do anything.
1089
- */
1090
- if (isDayDisabled(partsToFocus, this.minParts, this.maxParts)) {
1091
- return;
1092
- }
1093
- this.setWorkingParts(Object.assign(Object.assign({}, this.workingParts), partsToFocus));
1094
- /**
1095
- * Give view a chance to re-render
1096
- * then move focus to the new working day
1097
- */
1098
- requestAnimationFrame(() => this.focusWorkingDay(currentMonth));
1099
- });
1100
- };
1101
- this.focusWorkingDay = (currentMonth) => {
1102
- /**
1103
- * Get the number of offset days so
1104
- * we know how much to offset our next selector by
1105
- * to grab the correct calendar-day element.
1106
- */
1107
- const { day, month, year } = this.workingParts;
1108
- const firstOfMonth = new Date(`${month}/1/${year}`).getDay();
1109
- const offset = firstOfMonth >= this.firstDayOfWeek
1110
- ? firstOfMonth - this.firstDayOfWeek
1111
- : 7 - (this.firstDayOfWeek - firstOfMonth);
1112
- if (day === null) {
1113
- return;
1114
- }
1115
- /**
1116
- * Get the calendar day element
1117
- * and focus it.
1118
- */
1119
- const dayEl = currentMonth.querySelector(`.calendar-day-wrapper:nth-of-type(${offset + day}) .calendar-day`);
1120
- if (dayEl) {
1121
- dayEl.focus();
1122
- }
1123
- };
1124
- this.processMinParts = () => {
1125
- const { min, defaultParts } = this;
1126
- if (min === undefined) {
1127
- this.minParts = undefined;
1128
- return;
1129
- }
1130
- this.minParts = format.parseMinParts(min, defaultParts);
1131
- };
1132
- this.processMaxParts = () => {
1133
- const { max, defaultParts } = this;
1134
- if (max === undefined) {
1135
- this.maxParts = undefined;
1136
- return;
1137
- }
1138
- this.maxParts = format.parseMaxParts(max, defaultParts);
1139
- };
1140
- this.initializeCalendarListener = () => {
1141
- const calendarBodyRef = this.calendarBodyRef;
1142
- if (!calendarBodyRef) {
1143
- return;
1144
- }
1145
- /**
1146
- * For performance reasons, we only render 3
1147
- * months at a time: The current month, the previous
1148
- * month, and the next month. We have a scroll listener
1149
- * on the calendar body to append/prepend new months.
1150
- *
1151
- * We can do this because Stencil is smart enough to not
1152
- * re-create the .calendar-month containers, but rather
1153
- * update the content within those containers.
1154
- *
1155
- * As an added bonus, WebKit has some troubles with
1156
- * scroll-snap-stop: always, so not rendering all of
1157
- * the months in a row allows us to mostly sidestep
1158
- * that issue.
1159
- */
1160
- const months = calendarBodyRef.querySelectorAll('.calendar-month');
1161
- const startMonth = months[0];
1162
- const workingMonth = months[1];
1163
- const endMonth = months[2];
1164
- const mode = ionicGlobal.getIonMode(this);
1165
- const needsiOSRubberBandFix = mode === 'ios' && typeof navigator !== 'undefined' && navigator.maxTouchPoints > 1;
1166
- /**
1167
- * Before setting up the scroll listener,
1168
- * scroll the middle month into view.
1169
- * scrollIntoView() will scroll entire page
1170
- * if element is not in viewport. Use scrollLeft instead.
1171
- */
1172
- index.writeTask(() => {
1173
- calendarBodyRef.scrollLeft = startMonth.clientWidth * (dir.isRTL(this.el) ? -1 : 1);
1174
- const getChangedMonth = (parts) => {
1175
- const box = calendarBodyRef.getBoundingClientRect();
1176
- /**
1177
- * If the current scroll position is all the way to the left
1178
- * then we have scrolled to the previous month.
1179
- * Otherwise, assume that we have scrolled to the next
1180
- * month. We have a tolerance of 2px to account for
1181
- * sub pixel rendering.
1182
- *
1183
- * Check below the next line ensures that we did not
1184
- * swipe and abort (i.e. we swiped but we are still on the current month).
1185
- */
1186
- const condition = dir.isRTL(this.el) ? calendarBodyRef.scrollLeft >= -2 : calendarBodyRef.scrollLeft <= 2;
1187
- const month = condition ? startMonth : endMonth;
1188
- /**
1189
- * The edge of the month must be lined up with
1190
- * the edge of the calendar body in order for
1191
- * the component to update. Otherwise, it
1192
- * may be the case that the user has paused their
1193
- * swipe or the browser has not finished snapping yet.
1194
- * Rather than check if the x values are equal,
1195
- * we give it a tolerance of 2px to account for
1196
- * sub pixel rendering.
1197
- */
1198
- const monthBox = month.getBoundingClientRect();
1199
- if (Math.abs(monthBox.x - box.x) > 2)
1200
- return;
1201
- /**
1202
- * If we're force-rendering a month, assume we've
1203
- * scrolled to that and return it.
1204
- *
1205
- * If forceRenderDate is ever used in a context where the
1206
- * forced month is not immediately auto-scrolled to, this
1207
- * should be updated to also check whether `month` has the
1208
- * same month and year as the forced date.
1209
- */
1210
- const { forceRenderDate } = this;
1211
- if (forceRenderDate !== undefined) {
1212
- return { month: forceRenderDate.month, year: forceRenderDate.year, day: forceRenderDate.day };
1213
- }
1214
- /**
1215
- * From here, we can determine if the start
1216
- * month or the end month was scrolled into view.
1217
- * If no month was changed, then we can return from
1218
- * the scroll callback early.
1219
- */
1220
- if (month === startMonth) {
1221
- return format.getPreviousMonth(parts);
1222
- }
1223
- else if (month === endMonth) {
1224
- return format.getNextMonth(parts);
1225
- }
1226
- else {
1227
- return;
1228
- }
1229
- };
1230
- const updateActiveMonth = () => {
1231
- if (needsiOSRubberBandFix) {
1232
- calendarBodyRef.style.removeProperty('pointer-events');
1233
- appliediOSRubberBandFix = false;
1234
- }
1235
- /**
1236
- * If the month did not change
1237
- * then we can return early.
1238
- */
1239
- const newDate = getChangedMonth(this.workingParts);
1240
- if (!newDate)
1241
- return;
1242
- const { month, day, year } = newDate;
1243
- if (isMonthDisabled({ month, year, day: null }, {
1244
- minParts: Object.assign(Object.assign({}, this.minParts), { day: null }),
1245
- maxParts: Object.assign(Object.assign({}, this.maxParts), { day: null }),
1246
- })) {
1247
- return;
1248
- }
1249
- /**
1250
- * Prevent scrolling for other browsers
1251
- * to give the DOM time to update and the container
1252
- * time to properly snap.
1253
- */
1254
- calendarBodyRef.style.setProperty('overflow', 'hidden');
1255
- /**
1256
- * Use a writeTask here to ensure
1257
- * that the state is updated and the
1258
- * correct month is scrolled into view
1259
- * in the same frame. This is not
1260
- * typically a problem on newer devices
1261
- * but older/slower device may have a flicker
1262
- * if we did not do this.
1263
- */
1264
- index.writeTask(() => {
1265
- var _a;
1266
- this.setWorkingParts(Object.assign(Object.assign({}, this.workingParts), { month, day: day, year }));
1267
- calendarBodyRef.scrollLeft = workingMonth.clientWidth * (dir.isRTL(this.el) ? -1 : 1);
1268
- calendarBodyRef.style.removeProperty('overflow');
1269
- if (this.resolveForceDateScrolling) {
1270
- this.resolveForceDateScrolling();
1271
- }
1272
- const activeEl = this.el.shadowRoot.activeElement;
1273
- if (activeEl && activeEl.classList.contains('calendar-day')) {
1274
- (_a = activeEl.closest('.calendar-body')) === null || _a === void 0 ? void 0 : _a.focus();
1275
- }
1276
- });
1277
- };
1278
- /**
1279
- * When the container finishes scrolling we
1280
- * need to update the DOM with the selected month.
1281
- */
1282
- let scrollTimeout;
1283
- /**
1284
- * We do not want to attempt to set pointer-events
1285
- * multiple times within a single swipe gesture as
1286
- * that adds unnecessary work to the main thread.
1287
- */
1288
- let appliediOSRubberBandFix = false;
1289
- const scrollCallback = () => {
1290
- if (scrollTimeout) {
1291
- clearTimeout(scrollTimeout);
1292
- }
1293
- /**
1294
- * On iOS it is possible to quickly rubber band
1295
- * the scroll area before the scroll timeout has fired.
1296
- * This results in users reaching the end of the scrollable
1297
- * container before the DOM has updated.
1298
- * By setting `pointer-events: none` we can ensure that
1299
- * subsequent swipes do not happen while the container
1300
- * is snapping.
1301
- */
1302
- if (!appliediOSRubberBandFix && needsiOSRubberBandFix) {
1303
- calendarBodyRef.style.setProperty('pointer-events', 'none');
1304
- appliediOSRubberBandFix = true;
1305
- }
1306
- // Wait ~3 frames
1307
- scrollTimeout = setTimeout(updateActiveMonth, 50);
1308
- };
1309
- calendarBodyRef.addEventListener('scroll', scrollCallback);
1310
- this.destroyCalendarListener = () => {
1311
- calendarBodyRef.removeEventListener('scroll', scrollCallback);
1312
- };
1313
- });
1314
- };
1315
- /**
1316
- * Clean up all listeners except for the overlay
1317
- * listener. This is so that we can re-create the listeners
1318
- * if the datetime has been hidden/presented by a modal or popover.
1319
- */
1320
- this.destroyInteractionListeners = () => {
1321
- const { destroyCalendarListener, destroyKeyboardMO } = this;
1322
- if (destroyCalendarListener !== undefined) {
1323
- destroyCalendarListener();
1324
- }
1325
- if (destroyKeyboardMO !== undefined) {
1326
- destroyKeyboardMO();
1327
- }
1328
- };
1329
- /**
1330
- * TODO(FW-6931): Remove this fallback upon solving the root cause
1331
- * Fallback to ensure the datetime becomes ready even if
1332
- * IntersectionObserver never reports it as intersecting.
1333
- *
1334
- * This is primarily used in environments where the observer
1335
- * might not fire as expected, such as when running under
1336
- * synthetic tests that stub IntersectionObserver.
1337
- */
1338
- this.ensureReadyIfVisible = () => {
1339
- if (this.el.classList.contains('datetime-ready')) {
1340
- return;
1341
- }
1342
- const rect = this.el.getBoundingClientRect();
1343
- if (rect.width === 0 || rect.height === 0) {
1344
- return;
1345
- }
1346
- this.markReady();
1347
- };
1348
- this.markReady = () => {
1349
- if (this.el.classList.contains('datetime-ready')) {
1350
- return;
1351
- }
1352
- this.initializeListeners();
1353
- /**
1354
- * TODO FW-2793: Datetime needs a frame to ensure that it
1355
- * can properly scroll contents into view. As a result
1356
- * we hide the scrollable content until after that frame
1357
- * so users do not see the content quickly shifting. The downside
1358
- * is that the content will pop into view a frame after. Maybe there
1359
- * is a better way to handle this?
1360
- */
1361
- index.writeTask(() => {
1362
- this.el.classList.add('datetime-ready');
1363
- });
1364
- };
1365
- this.loadTimeoutCleanup = () => {
1366
- if (this.loadTimeout) {
1367
- clearTimeout(this.loadTimeout);
1368
- this.loadTimeout = undefined;
1369
- }
1370
- };
1371
- this.processValue = (value) => {
1372
- const hasValue = value !== null && value !== undefined && value !== '' && (!Array.isArray(value) || value.length > 0);
1373
- const valueToProcess = hasValue ? format.parseDate(value) : this.defaultParts;
1374
- const { minParts, maxParts, workingParts, el } = this;
1375
- this.warnIfIncorrectValueUsage();
1376
- /**
1377
- * Return early if the value wasn't parsed correctly, such as
1378
- * if an improperly formatted date string was provided.
1379
- */
1380
- if (!valueToProcess) {
1381
- return;
1382
- }
1383
- /**
1384
- * Datetime should only warn of out of bounds values
1385
- * if set by the user. If the `value` is undefined,
1386
- * we will default to today's date which may be out
1387
- * of bounds. In this case, the warning makes it look
1388
- * like the developer did something wrong which is
1389
- * not true.
1390
- */
1391
- if (hasValue) {
1392
- format.warnIfValueOutOfBounds(valueToProcess, minParts, maxParts);
1393
- }
1394
- /**
1395
- * If there are multiple values, clamp to the last one.
1396
- * This is because the last value is the one that the user
1397
- * has most recently interacted with.
1398
- */
1399
- const singleValue = Array.isArray(valueToProcess) ? valueToProcess[valueToProcess.length - 1] : valueToProcess;
1400
- const targetValue = format.clampDate(singleValue, minParts, maxParts);
1401
- const { month, day, year, hour, minute } = targetValue;
1402
- const ampm = format.parseAmPm(hour);
1403
- /**
1404
- * Since `activeParts` indicates a value that been explicitly selected
1405
- * either by the user or the app, only update `activeParts` if the
1406
- * `value` property is set.
1407
- */
1408
- if (hasValue) {
1409
- if (Array.isArray(valueToProcess)) {
1410
- this.activeParts = [...valueToProcess];
1411
- }
1412
- else {
1413
- this.activeParts = {
1414
- month,
1415
- day,
1416
- year,
1417
- hour,
1418
- minute,
1419
- ampm,
1420
- };
1421
- }
1422
- }
1423
- else {
1424
- /**
1425
- * Reset the active parts if the value is not set.
1426
- * This will clear the selected calendar day when
1427
- * performing a clear action or using the reset() method.
1428
- */
1429
- this.activeParts = [];
1430
- }
1431
- const didChangeMonth = (month !== undefined && month !== workingParts.month) || (year !== undefined && year !== workingParts.year);
1432
- const bodyIsVisible = el.classList.contains('datetime-ready');
1433
- const { isGridStyle, showMonthAndYear } = this;
1434
- if (isGridStyle && didChangeMonth && bodyIsVisible && !showMonthAndYear) {
1435
- /**
1436
- * Only animate if:
1437
- * 1. We're using grid style (wheel style pickers should just jump to new value)
1438
- * 2. The month and/or year actually changed, and both are defined (otherwise there's nothing to animate to)
1439
- * 3. The calendar body is visible (prevents animation when in collapsed datetime-button, for example)
1440
- * 4. The month/year picker is not open (since you wouldn't see the animation anyway)
1441
- */
1442
- this.animateToDate(targetValue);
1443
- }
1444
- else {
1445
- this.setWorkingParts({
1446
- month,
1447
- day,
1448
- year,
1449
- hour,
1450
- minute,
1451
- ampm,
1452
- });
1453
- }
1454
- };
1455
- this.animateToDate = async (targetValue) => {
1456
- const { workingParts } = this;
1457
- /**
1458
- * Tell other render functions that we need to force the
1459
- * target month to appear in place of the actual next/prev month.
1460
- * Because this is a State variable, a rerender will be triggered
1461
- * automatically, updating the rendered months.
1462
- */
1463
- this.forceRenderDate = targetValue;
1464
- /**
1465
- * Flag that we've started scrolling to the forced date.
1466
- * The resolve function will be called by the datetime's
1467
- * scroll listener when it's done updating everything.
1468
- * This is a replacement for making prev/nextMonth async,
1469
- * since the logic we're waiting on is in a listener.
1470
- */
1471
- const forceDateScrollingPromise = new Promise((resolve) => {
1472
- this.resolveForceDateScrolling = resolve;
1473
- });
1474
- /**
1475
- * Animate smoothly to the forced month. This will also update
1476
- * workingParts and correct the surrounding months for us.
1477
- */
1478
- const targetMonthIsBefore = format.isBefore(targetValue, workingParts);
1479
- targetMonthIsBefore ? this.prevMonth() : this.nextMonth();
1480
- await forceDateScrollingPromise;
1481
- this.resolveForceDateScrolling = undefined;
1482
- this.forceRenderDate = undefined;
1483
- };
1484
- this.onFocus = () => {
1485
- this.ionFocus.emit();
1486
- };
1487
- this.onBlur = () => {
1488
- this.ionBlur.emit();
1489
- };
1490
- this.hasValue = () => {
1491
- return this.value != null;
1492
- };
1493
- this.nextMonth = () => {
1494
- const calendarBodyRef = this.calendarBodyRef;
1495
- if (!calendarBodyRef) {
1496
- return;
1497
- }
1498
- const nextMonth = calendarBodyRef.querySelector('.calendar-month:last-of-type');
1499
- if (!nextMonth) {
1500
- return;
1501
- }
1502
- const left = nextMonth.offsetWidth * 2;
1503
- const scrollMode = index.config.getBoolean('animated', true) ? 'smooth' : 'instant';
1504
- calendarBodyRef.scrollTo({
1505
- top: 0,
1506
- left: left * (dir.isRTL(this.el) ? -1 : 1),
1507
- behavior: scrollMode,
1508
- });
1509
- };
1510
- this.prevMonth = () => {
1511
- const calendarBodyRef = this.calendarBodyRef;
1512
- if (!calendarBodyRef) {
1513
- return;
1514
- }
1515
- const prevMonth = calendarBodyRef.querySelector('.calendar-month:first-of-type');
1516
- if (!prevMonth) {
1517
- return;
1518
- }
1519
- const left = prevMonth.offsetWidth * 2;
1520
- const scrollMode = index.config.getBoolean('animated', true) ? 'smooth' : 'instant';
1521
- calendarBodyRef.scrollTo({
1522
- top: 0,
1523
- left: left * (dir.isRTL(this.el) ? 1 : -1),
1524
- behavior: scrollMode,
1525
- });
1526
- };
1527
- this.toggleMonthAndYearView = () => {
1528
- this.showMonthAndYear = !this.showMonthAndYear;
1529
- };
1530
- }
1531
- formatOptionsChanged() {
1532
- const { el, formatOptions, presentation } = this;
1533
- checkForPresentationFormatMismatch(el, presentation, formatOptions);
1534
- warnIfTimeZoneProvided(el, formatOptions);
1535
- }
1536
- disabledChanged() {
1537
- this.emitStyle();
1538
- }
1539
- minChanged() {
1540
- this.processMinParts();
1541
- }
1542
- maxChanged() {
1543
- this.processMaxParts();
1544
- }
1545
- presentationChanged() {
1546
- const { el, formatOptions, presentation } = this;
1547
- checkForPresentationFormatMismatch(el, presentation, formatOptions);
1548
- }
1549
- get isGridStyle() {
1550
- const { presentation, preferWheel } = this;
1551
- const hasDatePresentation = presentation === 'date' || presentation === 'date-time' || presentation === 'time-date';
1552
- return hasDatePresentation && !preferWheel;
1553
- }
1554
- yearValuesChanged() {
1555
- this.parsedYearValues = format.convertToArrayOfNumbers(this.yearValues);
1556
- }
1557
- monthValuesChanged() {
1558
- this.parsedMonthValues = format.convertToArrayOfNumbers(this.monthValues);
1559
- }
1560
- dayValuesChanged() {
1561
- this.parsedDayValues = format.convertToArrayOfNumbers(this.dayValues);
1562
- }
1563
- hourValuesChanged() {
1564
- this.parsedHourValues = format.convertToArrayOfNumbers(this.hourValues);
1565
- }
1566
- minuteValuesChanged() {
1567
- this.parsedMinuteValues = format.convertToArrayOfNumbers(this.minuteValues);
1568
- }
1569
- /**
1570
- * Update the datetime value when the value changes
1571
- */
1572
- async valueChanged() {
1573
- const { value } = this;
1574
- if (this.hasValue()) {
1575
- this.processValue(value);
1576
- }
1577
- this.emitStyle();
1578
- this.ionValueChange.emit({ value });
1579
- }
1580
- /**
1581
- * Confirms the selected datetime value, updates the
1582
- * `value` property, and optionally closes the popover
1583
- * or modal that the datetime was presented in.
1584
- *
1585
- * @param closeOverlay If `true`, closes the parent overlay. Defaults to `false`.
1586
- */
1587
- async confirm(closeOverlay = false) {
1588
- const { isCalendarPicker, activeParts, preferWheel, workingParts } = this;
1589
- /**
1590
- * We only update the value if the presentation is not a calendar picker.
1591
- */
1592
- if (activeParts !== undefined || !isCalendarPicker) {
1593
- const activePartsIsArray = Array.isArray(activeParts);
1594
- if (activePartsIsArray && activeParts.length === 0) {
1595
- if (preferWheel) {
1596
- /**
1597
- * If the datetime is using a wheel picker, but the
1598
- * active parts are empty, then the user has confirmed the
1599
- * initial value (working parts) presented to them.
1600
- */
1601
- this.setValue(format.convertDataToISO(workingParts));
1602
- }
1603
- else {
1604
- this.setValue(undefined);
1605
- }
1606
- }
1607
- else {
1608
- this.setValue(format.convertDataToISO(activeParts));
1609
- }
1610
- }
1611
- if (closeOverlay) {
1612
- this.closeParentOverlay(CONFIRM_ROLE);
1613
- }
1614
- }
1615
- /**
1616
- * Resets the internal state of the datetime but does not update the value.
1617
- * Passing a valid ISO-8601 string will reset the state of the component to the provided date.
1618
- * If no value is provided, the internal state will be reset to the clamped value of the min, max and today.
1619
- *
1620
- * @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.
1621
- */
1622
- async reset(startDate) {
1623
- this.processValue(startDate);
1624
- }
1625
- /**
1626
- * Emits the ionCancel event and
1627
- * optionally closes the popover
1628
- * or modal that the datetime was
1629
- * presented in.
1630
- *
1631
- * @param closeOverlay If `true`, closes the parent overlay. Defaults to `false`.
1632
- */
1633
- async cancel(closeOverlay = false) {
1634
- this.ionCancel.emit();
1635
- if (closeOverlay) {
1636
- this.closeParentOverlay(CANCEL_ROLE);
1637
- }
1638
- }
1639
- /**
1640
- * Returns the default parts the datetime falls back to when no value is set:
1641
- * today's date and time snapped to the closest value allowed by the
1642
- * component's constraints (`min`, `max`, and the `*Values` props).
1643
- *
1644
- * @internal
1645
- */
1646
- async getDefaultPart() {
1647
- return this.defaultParts;
1648
- }
1649
- get isCalendarPicker() {
1650
- const { presentation } = this;
1651
- return presentation === 'date' || presentation === 'date-time' || presentation === 'time-date';
1652
- }
1653
- connectedCallback() {
1654
- this.clearFocusVisible = focusVisible.startFocusVisible(this.el).destroy;
1655
- this.loadTimeout = setTimeout(() => {
1656
- this.ensureReadyIfVisible();
1657
- }, 100);
1658
- }
1659
- disconnectedCallback() {
1660
- if (this.clearFocusVisible) {
1661
- this.clearFocusVisible();
1662
- this.clearFocusVisible = undefined;
1663
- }
1664
- this.loadTimeoutCleanup();
1665
- }
1666
- initializeListeners() {
1667
- this.initializeCalendarListener();
1668
- this.initializeKeyboardListeners();
1669
- }
1670
- componentDidLoad() {
1671
- const { el, intersectionTrackerRef } = this;
1672
- /**
1673
- * If a scrollable element is hidden using `display: none`,
1674
- * it will not have a scroll height meaning we cannot scroll elements
1675
- * into view. As a result, we will need to wait for the datetime to become
1676
- * visible if used inside of a modal or a popover otherwise the scrollable
1677
- * areas will not have the correct values snapped into place.
1678
- */
1679
- const visibleCallback = (entries) => {
1680
- const ev = entries[0];
1681
- if (!ev.isIntersecting) {
1682
- return;
1683
- }
1684
- this.hasBeenIntersecting = true;
1685
- this.markReady();
1686
- };
1687
- const visibleIO = new IntersectionObserver(visibleCallback, { threshold: 0.01, root: el });
1688
- /**
1689
- * Use raf to avoid a race condition between the component loading and
1690
- * its display animation starting (such as when shown in a modal). This
1691
- * could cause the datetime to start at a visibility of 0, erroneously
1692
- * triggering the `hiddenIO` observer below.
1693
- */
1694
- helpers.raf(() => visibleIO === null || visibleIO === void 0 ? void 0 : visibleIO.observe(intersectionTrackerRef));
1695
- /**
1696
- * TODO(FW-6931): Remove this fallback upon solving the root cause
1697
- * Fallback: If IntersectionObserver never reports that the
1698
- * datetime is visible but the host clearly has layout, ensure
1699
- * we still initialize listeners and mark the component as ready.
1700
- *
1701
- * We schedule this after everything has had a chance to run.
1702
- *
1703
- * We also clean up the load timeout to ensure that we don't have multiple timeouts running.
1704
- */
1705
- this.loadTimeoutCleanup();
1706
- this.loadTimeout = setTimeout(() => {
1707
- this.ensureReadyIfVisible();
1708
- }, 100);
1709
- /**
1710
- * We need to clean up listeners when the datetime is hidden
1711
- * in a popover/modal so that we can properly scroll containers
1712
- * back into view if they are re-presented. When the datetime is hidden
1713
- * the scroll areas have scroll widths/heights of 0px, so any snapping
1714
- * we did originally has been lost.
1715
- */
1716
- const hiddenCallback = (entries) => {
1717
- const ev = entries[0];
1718
- if (ev.isIntersecting) {
1719
- return;
1720
- }
1721
- // Ignore the initial "not intersecting" entry IntersectionObserver fires on observe().
1722
- if (!this.hasBeenIntersecting) {
1723
- return;
1724
- }
1725
- this.hasBeenIntersecting = false;
1726
- this.destroyInteractionListeners();
1727
- /**
1728
- * When datetime is hidden, we need to make sure that
1729
- * the month/year picker is closed. Otherwise,
1730
- * it will be open when the datetime re-appears
1731
- * and the scroll area of the calendar grid will be 0.
1732
- * As a result, the wrong month will be shown.
1733
- */
1734
- this.showMonthAndYear = false;
1735
- index.writeTask(() => {
1736
- this.el.classList.remove('datetime-ready');
1737
- });
1738
- };
1739
- const hiddenIO = new IntersectionObserver(hiddenCallback, { threshold: 0, root: el });
1740
- helpers.raf(() => hiddenIO === null || hiddenIO === void 0 ? void 0 : hiddenIO.observe(intersectionTrackerRef));
1741
- /**
1742
- * Datetime uses Ionic components that emit
1743
- * ionFocus and ionBlur. These events are
1744
- * composed meaning they will cross
1745
- * the shadow dom boundary. We need to
1746
- * stop propagation on these events otherwise
1747
- * developers will see 2 ionFocus or 2 ionBlur
1748
- * events at a time.
1749
- */
1750
- const root = helpers.getElementRoot(this.el);
1751
- root.addEventListener('ionFocus', (ev) => ev.stopPropagation());
1752
- root.addEventListener('ionBlur', (ev) => ev.stopPropagation());
1753
- }
1754
- /**
1755
- * When the presentation is changed, all calendar content is recreated,
1756
- * so we need to re-init behavior with the new elements.
1757
- */
1758
- componentDidRender() {
1759
- const { presentation, prevPresentation, calendarBodyRef, minParts, preferWheel, forceRenderDate } = this;
1760
- /**
1761
- * TODO(FW-2165)
1762
- * Remove this when https://bugs.webkit.org/show_bug.cgi?id=235960 is fixed.
1763
- * When using `min`, we add `scroll-snap-align: none`
1764
- * to the disabled month so that users cannot scroll to it.
1765
- * This triggers a bug in WebKit where the scroll position is reset.
1766
- * Since the month change logic is handled by a scroll listener,
1767
- * this causes the month to change leading to `scroll-snap-align`
1768
- * changing again, thus changing the scroll position again and causing
1769
- * an infinite loop.
1770
- * This issue only applies to the calendar grid, so we can disable
1771
- * it if the calendar grid is not being used.
1772
- */
1773
- const hasCalendarGrid = !preferWheel && ['date-time', 'time-date', 'date'].includes(presentation);
1774
- if (minParts !== undefined && hasCalendarGrid && calendarBodyRef) {
1775
- const workingMonth = calendarBodyRef.querySelector('.calendar-month:nth-of-type(1)');
1776
- /**
1777
- * We need to make sure the datetime is not in the process
1778
- * of scrolling to a new datetime value if the value
1779
- * is updated programmatically.
1780
- * Otherwise, the datetime will appear to not scroll at all because
1781
- * we are resetting the scroll position to the center of the view.
1782
- * Prior to the datetime's value being updated programmatically,
1783
- * the calendarBodyRef is scrolled such that the middle month is centered
1784
- * in the view. The below code updates the scroll position so the middle
1785
- * month is also centered in the view. Since the scroll position did not change,
1786
- * the scroll callback in this file does not fire,
1787
- * and the resolveForceDateScrolling promise never resolves.
1788
- */
1789
- if (workingMonth && forceRenderDate === undefined) {
1790
- calendarBodyRef.scrollLeft = workingMonth.clientWidth * (dir.isRTL(this.el) ? -1 : 1);
1791
- }
1792
- }
1793
- if (prevPresentation === null) {
1794
- this.prevPresentation = presentation;
1795
- return;
1796
- }
1797
- if (presentation === prevPresentation) {
1798
- return;
1799
- }
1800
- this.prevPresentation = presentation;
1801
- this.destroyInteractionListeners();
1802
- this.initializeListeners();
1803
- /**
1804
- * The month/year picker from the date interface
1805
- * should be closed as it is not available in non-date
1806
- * interfaces.
1807
- */
1808
- this.showMonthAndYear = false;
1809
- helpers.raf(() => {
1810
- this.ionRender.emit();
1811
- });
1812
- }
1813
- componentWillLoad() {
1814
- const { el, formatOptions, highlightedDates, multiple, presentation, preferWheel } = this;
1815
- if (multiple) {
1816
- if (presentation !== 'date') {
1817
- index.printIonWarning('[ion-datetime] - Multiple date selection is only supported for presentation="date".', el);
1818
- }
1819
- if (preferWheel) {
1820
- index.printIonWarning('[ion-datetime] - Multiple date selection is not supported with preferWheel="true".', el);
1821
- }
1822
- }
1823
- if (highlightedDates !== undefined) {
1824
- if (presentation !== 'date' && presentation !== 'date-time' && presentation !== 'time-date') {
1825
- index.printIonWarning('[ion-datetime] - The highlightedDates property is only supported with the date, date-time, and time-date presentations.', el);
1826
- }
1827
- if (preferWheel) {
1828
- index.printIonWarning('[ion-datetime] - The highlightedDates property is not supported with preferWheel="true".', el);
1829
- }
1830
- }
1831
- if (formatOptions) {
1832
- checkForPresentationFormatMismatch(el, presentation, formatOptions);
1833
- warnIfTimeZoneProvided(el, formatOptions);
1834
- }
1835
- const hourValues = (this.parsedHourValues = format.convertToArrayOfNumbers(this.hourValues));
1836
- const minuteValues = (this.parsedMinuteValues = format.convertToArrayOfNumbers(this.minuteValues));
1837
- const monthValues = (this.parsedMonthValues = format.convertToArrayOfNumbers(this.monthValues));
1838
- const yearValues = (this.parsedYearValues = format.convertToArrayOfNumbers(this.yearValues));
1839
- const dayValues = (this.parsedDayValues = format.convertToArrayOfNumbers(this.dayValues));
1840
- const todayParts = (this.todayParts = format.parseDate(getToday()));
1841
- this.processMinParts();
1842
- this.processMaxParts();
1843
- this.defaultParts = format.getClosestValidDate({
1844
- refParts: todayParts,
1845
- monthValues,
1846
- dayValues,
1847
- yearValues,
1848
- hourValues,
1849
- minuteValues,
1850
- minParts: this.minParts,
1851
- maxParts: this.maxParts,
1852
- });
1853
- this.processValue(this.value);
1854
- this.emitStyle();
1855
- }
1856
- emitStyle() {
1857
- this.ionStyle.emit({
1858
- interactive: true,
1859
- datetime: true,
1860
- 'interactive-disabled': this.disabled,
1861
- });
1862
- }
1863
- /**
1864
- * Universal render methods
1865
- * These are pieces of datetime that
1866
- * are rendered independently of presentation.
1867
- */
1868
- renderFooter() {
1869
- const theme = ionicGlobal.getIonTheme(this);
1870
- const { disabled, readonly, showDefaultButtons, showClearButton } = this;
1871
- /**
1872
- * The cancel, clear, and confirm buttons
1873
- * should not be interactive if the datetime
1874
- * is disabled or readonly.
1875
- */
1876
- const isButtonDisabled = disabled || readonly;
1877
- const confirmFill = theme === 'ionic' ? 'solid' : undefined;
1878
- const hasSlottedButtons = this.el.querySelector('[slot="buttons"]') !== null;
1879
- if (!hasSlottedButtons && !showDefaultButtons && !showClearButton) {
1880
- return;
1881
- }
1882
- const clearButtonClick = () => {
1883
- this.reset();
1884
- this.setValue(undefined);
1885
- };
1886
- /**
1887
- * By default we render two buttons:
1888
- * Cancel - Dismisses the datetime and
1889
- * does not update the `value` prop.
1890
- * OK - Dismisses the datetime and
1891
- * updates the `value` prop.
1892
- */
1893
- return (index.h("div", { class: "datetime-footer" }, index.h("div", { class: "datetime-buttons" }, index.h("div", { class: {
1894
- ['datetime-action-buttons']: true,
1895
- ['has-clear-button']: this.showClearButton,
1896
- } }, index.h("slot", { name: "buttons" }, showDefaultButtons && (index.h("ion-button", { id: "cancel-button", color: this.color, onClick: () => this.cancel(true), disabled: isButtonDisabled }, this.cancelText)), index.h("div", { class: "datetime-action-buttons-container" }, showClearButton && (index.h("ion-button", { id: "clear-button", color: this.color, onClick: () => clearButtonClick(), disabled: isButtonDisabled }, this.clearText)), showDefaultButtons && (index.h("ion-button", { id: "confirm-button", fill: confirmFill, color: this.color, onClick: () => this.confirm(true), disabled: isButtonDisabled }, this.doneText))))))));
1897
- }
1898
- /**
1899
- * Wheel picker render methods
1900
- */
1901
- renderWheelPicker(forcePresentation = this.presentation) {
1902
- /**
1903
- * If presentation="time-date" we switch the
1904
- * order of the render array here instead of
1905
- * manually reordering each date/time picker
1906
- * column with CSS. This allows for additional
1907
- * flexibility if we need to render subsets
1908
- * of the date/time data or do additional ordering
1909
- * within the child render functions.
1910
- */
1911
- const renderArray = forcePresentation === 'time-date'
1912
- ? [this.renderTimePickerColumns(forcePresentation), this.renderDatePickerColumns(forcePresentation)]
1913
- : [this.renderDatePickerColumns(forcePresentation), this.renderTimePickerColumns(forcePresentation)];
1914
- return index.h("ion-picker", { class: overlays.FOCUS_TRAP_DISABLE_CLASS }, renderArray);
1915
- }
1916
- renderDatePickerColumns(forcePresentation) {
1917
- return forcePresentation === 'date-time' || forcePresentation === 'time-date'
1918
- ? this.renderCombinedDatePickerColumn()
1919
- : this.renderIndividualDatePickerColumns(forcePresentation);
1920
- }
1921
- renderCombinedDatePickerColumn() {
1922
- const { defaultParts, disabled, workingParts, locale, minParts, maxParts, todayParts, isDateEnabled } = this;
1923
- const activePart = this.getActivePartsWithFallback();
1924
- /**
1925
- * By default, generate a range of 3 months:
1926
- * Previous month, current month, and next month
1927
- */
1928
- const monthsToRender = generateMonths(workingParts);
1929
- const lastMonth = monthsToRender[monthsToRender.length - 1];
1930
- /**
1931
- * Ensure that users can select the entire window of dates.
1932
- */
1933
- monthsToRender[0].day = 1;
1934
- lastMonth.day = format.getNumDaysInMonth(lastMonth.month, lastMonth.year);
1935
- /**
1936
- * Narrow the dates rendered based on min/max dates (if any).
1937
- * The `min` date is used if the min is after the generated min month.
1938
- * The `max` date is used if the max is before the generated max month.
1939
- * This ensures that the sliding window always stays at 3 months
1940
- * but still allows future dates to be lazily rendered based on any min/max
1941
- * constraints.
1942
- */
1943
- const min = minParts !== undefined && format.isAfter(minParts, monthsToRender[0]) ? minParts : monthsToRender[0];
1944
- const max = maxParts !== undefined && format.isBefore(maxParts, lastMonth) ? maxParts : lastMonth;
1945
- const result = getCombinedDateColumnData(locale, todayParts, min, max, this.parsedDayValues, this.parsedMonthValues);
1946
- let items = result.items;
1947
- const parts = result.parts;
1948
- if (isDateEnabled) {
1949
- items = items.map((itemObject, index$1) => {
1950
- const referenceParts = parts[index$1];
1951
- let disabled;
1952
- try {
1953
- /**
1954
- * The `isDateEnabled` implementation is try-catch wrapped
1955
- * to prevent exceptions in the user's function from
1956
- * interrupting the calendar rendering.
1957
- */
1958
- disabled = !isDateEnabled(format.convertDataToISO(referenceParts));
1959
- }
1960
- catch (e) {
1961
- index.printIonError('[ion-datetime] - Exception thrown from provided `isDateEnabled` function. Please check your function and try again.', e);
1962
- }
1963
- return Object.assign(Object.assign({}, itemObject), { disabled });
1964
- });
1965
- }
1966
- /**
1967
- * If we have selected a day already, then default the column
1968
- * to that value. Otherwise, set it to the default date.
1969
- */
1970
- const todayString = workingParts.day !== null
1971
- ? `${workingParts.year}-${workingParts.month}-${workingParts.day}`
1972
- : `${defaultParts.year}-${defaultParts.month}-${defaultParts.day}`;
1973
- return (index.h("ion-picker-column", { part: WHEEL_PART, "aria-label": "Select a date", class: "date-column", color: this.color, disabled: disabled, value: todayString, onIonChange: (ev) => {
1974
- const { value } = ev.detail;
1975
- const findPart = parts.find(({ month, day, year }) => value === `${year}-${month}-${day}`);
1976
- this.setWorkingParts(Object.assign(Object.assign({}, workingParts), findPart));
1977
- this.setActiveParts(Object.assign(Object.assign({}, activePart), findPart));
1978
- ev.stopPropagation();
1979
- } }, items.map((item) => (index.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)))));
1980
- }
1981
- renderIndividualDatePickerColumns(forcePresentation) {
1982
- const { workingParts, isDateEnabled } = this;
1983
- const shouldRenderMonths = forcePresentation !== 'year' && forcePresentation !== 'time';
1984
- const months = shouldRenderMonths
1985
- ? getMonthColumnData(this.locale, workingParts, this.minParts, this.maxParts, this.parsedMonthValues)
1986
- : [];
1987
- const shouldRenderDays = forcePresentation === 'date';
1988
- let days = shouldRenderDays
1989
- ? getDayColumnData(this.locale, workingParts, this.minParts, this.maxParts, this.parsedDayValues)
1990
- : [];
1991
- if (isDateEnabled) {
1992
- days = days.map((dayObject) => {
1993
- const { value } = dayObject;
1994
- const valueNum = typeof value === 'string' ? parseInt(value) : value;
1995
- const referenceParts = {
1996
- month: workingParts.month,
1997
- day: valueNum,
1998
- year: workingParts.year,
1999
- };
2000
- let disabled;
2001
- try {
2002
- /**
2003
- * The `isDateEnabled` implementation is try-catch wrapped
2004
- * to prevent exceptions in the user's function from
2005
- * interrupting the calendar rendering.
2006
- */
2007
- disabled = !isDateEnabled(format.convertDataToISO(referenceParts));
2008
- }
2009
- catch (e) {
2010
- index.printIonError('[ion-datetime] - Exception thrown from provided `isDateEnabled` function. Please check your function and try again.', e);
2011
- }
2012
- return Object.assign(Object.assign({}, dayObject), { disabled });
2013
- });
2014
- }
2015
- const shouldRenderYears = forcePresentation !== 'month' && forcePresentation !== 'time';
2016
- const years = shouldRenderYears
2017
- ? getYearColumnData(this.locale, this.defaultParts, this.minParts, this.maxParts, this.parsedYearValues)
2018
- : [];
2019
- /**
2020
- * Certain locales show the day before the month.
2021
- */
2022
- const showMonthFirst = format.isMonthFirstLocale(this.locale, { month: 'numeric', day: 'numeric' });
2023
- let renderArray = [];
2024
- if (showMonthFirst) {
2025
- renderArray = [
2026
- this.renderMonthPickerColumn(months),
2027
- this.renderDayPickerColumn(days),
2028
- this.renderYearPickerColumn(years),
2029
- ];
2030
- }
2031
- else {
2032
- renderArray = [
2033
- this.renderDayPickerColumn(days),
2034
- this.renderMonthPickerColumn(months),
2035
- this.renderYearPickerColumn(years),
2036
- ];
2037
- }
2038
- return renderArray;
2039
- }
2040
- renderDayPickerColumn(days) {
2041
- var _a;
2042
- if (days.length === 0) {
2043
- return [];
2044
- }
2045
- const { disabled, workingParts } = this;
2046
- const activePart = this.getActivePartsWithFallback();
2047
- const pickerColumnValue = (_a = (workingParts.day !== null ? workingParts.day : this.defaultParts.day)) !== null && _a !== void 0 ? _a : undefined;
2048
- return (index.h("ion-picker-column", { part: WHEEL_PART, "aria-label": "Select a day", class: "day-column", color: this.color, disabled: disabled, value: pickerColumnValue, onIonChange: (ev) => {
2049
- this.setWorkingParts(Object.assign(Object.assign({}, workingParts), { day: ev.detail.value }));
2050
- this.setActiveParts(Object.assign(Object.assign({}, activePart), { day: ev.detail.value }));
2051
- ev.stopPropagation();
2052
- } }, days.map((day) => (index.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)))));
2053
- }
2054
- renderMonthPickerColumn(months) {
2055
- if (months.length === 0) {
2056
- return [];
2057
- }
2058
- const { disabled, workingParts } = this;
2059
- const activePart = this.getActivePartsWithFallback();
2060
- return (index.h("ion-picker-column", { part: WHEEL_PART, "aria-label": "Select a month", class: "month-column", color: this.color, disabled: disabled, value: workingParts.month, onIonChange: (ev) => {
2061
- this.setWorkingParts(Object.assign(Object.assign({}, workingParts), { month: ev.detail.value }));
2062
- // Month wheel is navigation-only in multi-select mode as a fix for https://github.com/ionic-team/ionic-framework/issues/29673
2063
- if (!this.multiple) {
2064
- this.setActiveParts(Object.assign(Object.assign({}, activePart), { month: ev.detail.value }));
2065
- }
2066
- ev.stopPropagation();
2067
- } }, months.map((month) => (index.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)))));
2068
- }
2069
- renderYearPickerColumn(years) {
2070
- if (years.length === 0) {
2071
- return [];
2072
- }
2073
- const { disabled, workingParts } = this;
2074
- const activePart = this.getActivePartsWithFallback();
2075
- return (index.h("ion-picker-column", { part: WHEEL_PART, "aria-label": "Select a year", class: "year-column", color: this.color, disabled: disabled, value: workingParts.year, onIonChange: (ev) => {
2076
- this.setWorkingParts(Object.assign(Object.assign({}, workingParts), { year: ev.detail.value }));
2077
- // Year wheel is navigation-only in multi-select mode as a fix for https://github.com/ionic-team/ionic-framework/issues/29673
2078
- if (!this.multiple) {
2079
- this.setActiveParts(Object.assign(Object.assign({}, activePart), { year: ev.detail.value }));
2080
- }
2081
- ev.stopPropagation();
2082
- } }, years.map((year) => (index.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)))));
2083
- }
2084
- renderTimePickerColumns(forcePresentation) {
2085
- if (['date', 'month', 'month-year', 'year'].includes(forcePresentation)) {
2086
- return [];
2087
- }
2088
- /**
2089
- * If a user has not selected a date,
2090
- * then we should show all times. If the
2091
- * user has selected a date (even if it has
2092
- * not been confirmed yet), we should apply
2093
- * the max and min restrictions so that the
2094
- * time picker shows values that are
2095
- * appropriate for the selected date.
2096
- */
2097
- const activePart = this.getActivePart();
2098
- const userHasSelectedDate = activePart !== undefined;
2099
- const { hoursData, minutesData, dayPeriodData } = getTimeColumnsData(this.locale, this.workingParts, this.hourCycle, userHasSelectedDate ? this.minParts : undefined, userHasSelectedDate ? this.maxParts : undefined, this.parsedHourValues, this.parsedMinuteValues);
2100
- return [
2101
- this.renderHourPickerColumn(hoursData),
2102
- this.renderMinutePickerColumn(minutesData),
2103
- this.renderDayPeriodPickerColumn(dayPeriodData),
2104
- ];
2105
- }
2106
- renderHourPickerColumn(hoursData) {
2107
- const { disabled, workingParts } = this;
2108
- if (hoursData.length === 0)
2109
- return [];
2110
- const activePart = this.getActivePartsWithFallback();
2111
- return (index.h("ion-picker-column", { part: WHEEL_PART, "aria-label": "Select an hour", color: this.color, disabled: disabled, value: activePart.hour, numericInput: true, onIonChange: (ev) => {
2112
- this.setWorkingParts(Object.assign(Object.assign({}, workingParts), { hour: ev.detail.value }));
2113
- this.setActiveParts(Object.assign(Object.assign({}, this.getActivePartsWithFallback()), { hour: ev.detail.value }));
2114
- ev.stopPropagation();
2115
- } }, hoursData.map((hour) => (index.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)))));
2116
- }
2117
- renderMinutePickerColumn(minutesData) {
2118
- const { disabled, workingParts } = this;
2119
- if (minutesData.length === 0)
2120
- return [];
2121
- const activePart = this.getActivePartsWithFallback();
2122
- return (index.h("ion-picker-column", { part: WHEEL_PART, "aria-label": "Select a minute", color: this.color, disabled: disabled, value: activePart.minute, numericInput: true, onIonChange: (ev) => {
2123
- this.setWorkingParts(Object.assign(Object.assign({}, workingParts), { minute: ev.detail.value }));
2124
- this.setActiveParts(Object.assign(Object.assign({}, this.getActivePartsWithFallback()), { minute: ev.detail.value }));
2125
- ev.stopPropagation();
2126
- } }, minutesData.map((minute) => (index.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)))));
2127
- }
2128
- renderDayPeriodPickerColumn(dayPeriodData) {
2129
- const { disabled, workingParts } = this;
2130
- if (dayPeriodData.length === 0) {
2131
- return [];
2132
- }
2133
- const activePart = this.getActivePartsWithFallback();
2134
- const isDayPeriodRTL = format.isLocaleDayPeriodRTL(this.locale);
2135
- return (index.h("ion-picker-column", { part: WHEEL_PART, "aria-label": "Select a day period", style: isDayPeriodRTL ? { order: '-1' } : {}, color: this.color, disabled: disabled, value: activePart.ampm, onIonChange: (ev) => {
2136
- const hour = format.calculateHourFromAMPM(workingParts, ev.detail.value);
2137
- this.setWorkingParts(Object.assign(Object.assign({}, workingParts), { ampm: ev.detail.value, hour }));
2138
- this.setActiveParts(Object.assign(Object.assign({}, this.getActivePartsWithFallback()), { ampm: ev.detail.value, hour }));
2139
- ev.stopPropagation();
2140
- } }, dayPeriodData.map((dayPeriod) => (index.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)))));
2141
- }
2142
- renderWheelView(forcePresentation) {
2143
- const { locale } = this;
2144
- const showMonthFirst = format.isMonthFirstLocale(locale);
2145
- const columnOrder = showMonthFirst ? 'month-first' : 'year-first';
2146
- return (index.h("div", { class: {
2147
- [`wheel-order-${columnOrder}`]: true,
2148
- } }, this.renderWheelPicker(forcePresentation)));
2149
- }
2150
- /**
2151
- * Grid Render Methods
2152
- */
2153
- renderCalendarHeader(theme) {
2154
- const { disabled, datetimeNextIcon, datetimePreviousIcon, datetimeCollapsedIcon, datetimeExpandedIcon } = this;
2155
- const prevMonthDisabled = disabled || isPrevMonthDisabled(this.workingParts, this.minParts, this.maxParts);
2156
- const nextMonthDisabled = disabled || isNextMonthDisabled(this.workingParts, this.maxParts);
2157
- // don't use the inheritAttributes util because it removes dir from the host, and we still need that
2158
- const hostDir = this.el.getAttribute('dir') || undefined;
2159
- return (index.h("div", { class: "calendar-header", part: "calendar-header" }, index.h("div", { class: "calendar-action-buttons" }, index.h("div", { class: "calendar-month-year" }, index.h("button", { class: {
2160
- 'calendar-month-year-toggle': true,
2161
- 'ion-activatable': true,
2162
- 'ion-focusable': true,
2163
- }, part: "month-year-button", disabled: disabled, "aria-label": this.showMonthAndYear ? 'Hide year picker' : 'Show year picker', onClick: () => this.toggleMonthAndYearView() }, index.h("span", { id: "toggle-wrapper" }, format.getMonthAndYear(this.locale, this.workingParts), theme !== 'ionic' && (index.h("ion-icon", { "aria-hidden": "true", icon: this.showMonthAndYear ? datetimeExpandedIcon : datetimeCollapsedIcon, lazy: false, flipRtl: true }))), theme === 'md' && index.h("ion-ripple-effect", null))), index.h("div", { class: "calendar-next-prev" }, index.h("ion-button", { "aria-label": "Previous month", disabled: prevMonthDisabled, onClick: () => this.prevMonth(), part: "navigation-button previous-button" }, index.h("ion-icon", { dir: hostDir, "aria-hidden": "true", slot: "icon-only", icon: datetimePreviousIcon, lazy: false, flipRtl: true })), index.h("ion-button", { "aria-label": "Next month", disabled: nextMonthDisabled, onClick: () => this.nextMonth(), part: "navigation-button next-button" }, index.h("ion-icon", { dir: hostDir, "aria-hidden": "true", slot: "icon-only", icon: datetimeNextIcon, lazy: false, flipRtl: true })))), index.h("div", { class: "calendar-days-of-week", "aria-hidden": "true", part: "calendar-days-of-week" }, getDaysOfWeek(this.locale, theme, this.firstDayOfWeek % 7).map((d) => {
2164
- return index.h("div", { class: "day-of-week" }, d);
2165
- }))));
2166
- }
2167
- renderMonth(month, year) {
2168
- const { disabled, readonly } = this;
2169
- const yearAllowed = this.parsedYearValues === undefined || this.parsedYearValues.includes(year);
2170
- const monthAllowed = this.parsedMonthValues === undefined || this.parsedMonthValues.includes(month);
2171
- const isCalMonthDisabled = !yearAllowed || !monthAllowed;
2172
- const isDatetimeDisabled = disabled || readonly;
2173
- const swipeDisabled = disabled ||
2174
- isMonthDisabled({
2175
- month,
2176
- year,
2177
- day: null,
2178
- }, {
2179
- // The day is not used when checking if a month is disabled.
2180
- // Users should be able to access the min or max month, even if the
2181
- // min/max date is out of bounds (e.g. min is set to Feb 15, Feb should not be disabled).
2182
- minParts: Object.assign(Object.assign({}, this.minParts), { day: null }),
2183
- maxParts: Object.assign(Object.assign({}, this.maxParts), { day: null }),
2184
- });
2185
- // The working month should never have swipe disabled.
2186
- // Otherwise the CSS scroll snap will not work and the user
2187
- // can free-scroll the calendar.
2188
- const isWorkingMonth = this.workingParts.month === month && this.workingParts.year === year;
2189
- const activePart = this.getActivePartsWithFallback();
2190
- return (index.h("div", { "aria-hidden": !isWorkingMonth ? 'true' : null, class: {
2191
- 'calendar-month': true,
2192
- // Prevents scroll snap swipe gestures for months outside of the min/max bounds
2193
- 'calendar-month-disabled': !isWorkingMonth && swipeDisabled,
2194
- } }, index.h("div", { class: "calendar-month-grid" }, getDaysOfMonth(month, year, this.firstDayOfWeek % 7, this.showAdjacentDays).map((dateObject, index$1) => {
2195
- const { day, dayOfWeek, isAdjacentDay } = dateObject;
2196
- const { el, highlightedDates, isDateEnabled, multiple, showAdjacentDays } = this;
2197
- let _month = month;
2198
- let _year = year;
2199
- if (showAdjacentDays && isAdjacentDay && day !== null) {
2200
- if (day > 20) {
2201
- // Leading with the adjacent day from the previous month
2202
- // if its a adjacent day and is higher than '20' (last week even in feb)
2203
- if (month === 1) {
2204
- _year = year - 1;
2205
- _month = 12;
2206
- }
2207
- else {
2208
- _month = month - 1;
2209
- }
2210
- }
2211
- else if (day < 15) {
2212
- // Leading with the adjacent day from the next month
2213
- // if its a adjacent day and is lower than '15' (first two weeks)
2214
- if (month === 12) {
2215
- _year = year + 1;
2216
- _month = 1;
2217
- }
2218
- else {
2219
- _month = month + 1;
2220
- }
2221
- }
2222
- }
2223
- const referenceParts = { month: _month, day, year: _year, isAdjacentDay };
2224
- const isCalendarPadding = day === null;
2225
- const { isActive, isToday, ariaLabel, ariaSelected, disabled: isDayDisabled, text, } = getCalendarDayState(this.locale, referenceParts, this.activeParts, this.todayParts, this.minParts, this.maxParts, this.parsedDayValues);
2226
- const dateIsoString = format.convertDataToISO(referenceParts);
2227
- let isCalDayDisabled = isCalMonthDisabled || isDayDisabled;
2228
- if (!isCalDayDisabled && isDateEnabled !== undefined) {
2229
- try {
2230
- /**
2231
- * The `isDateEnabled` implementation is try-catch wrapped
2232
- * to prevent exceptions in the user's function from
2233
- * interrupting the calendar rendering.
2234
- */
2235
- isCalDayDisabled = !isDateEnabled(dateIsoString);
2236
- }
2237
- catch (e) {
2238
- index.printIonError('[ion-datetime] - Exception thrown from provided `isDateEnabled` function. Please check your function and try again.', el, e);
2239
- }
2240
- }
2241
- /**
2242
- * Some days are constrained through max & min or allowed dates
2243
- * and also disabled because the component is readonly or disabled.
2244
- * These need to be displayed differently.
2245
- */
2246
- const isCalDayConstrained = isCalDayDisabled && isDatetimeDisabled;
2247
- const isButtonDisabled = isCalDayDisabled || isDatetimeDisabled;
2248
- let dateStyle = undefined;
2249
- /**
2250
- * Custom highlight styles should not override the style for selected dates,
2251
- * nor apply to "filler days" at the start of the grid.
2252
- */
2253
- if (highlightedDates !== undefined && !isActive && day !== null && !isAdjacentDay) {
2254
- dateStyle = getHighlightStyles(highlightedDates, dateIsoString, el);
2255
- }
2256
- let dateParts = undefined;
2257
- // "Filler days" at the beginning of the grid should not get the calendar day
2258
- // CSS parts added to them
2259
- if (!isCalendarPadding && !isAdjacentDay) {
2260
- dateParts = `calendar-day${isActive ? ' active' : ''}${isToday ? ' today' : ''}${isCalDayDisabled ? ' disabled' : ''}`;
2261
- }
2262
- else if (isAdjacentDay) {
2263
- dateParts = `calendar-day${isCalDayDisabled ? ' disabled' : ''}`;
2264
- }
2265
- return (index.h("div", { class: "calendar-day-wrapper" }, index.h("button", {
2266
- // We need to use !important for the inline styles here because
2267
- // otherwise the CSS shadow parts will override these styles.
2268
- // See https://github.com/WICG/webcomponents/issues/847
2269
- // Both the CSS shadow parts and highlightedDates styles are
2270
- // provided by the developer, but highlightedDates styles should
2271
- // always take priority.
2272
- ref: (el) => {
2273
- if (el) {
2274
- el.style.setProperty('color', `${dateStyle ? dateStyle.textColor : ''}`, 'important');
2275
- el.style.setProperty('background-color', `${dateStyle ? dateStyle.backgroundColor : ''}`, 'important');
2276
- el.style.setProperty('border', `${dateStyle ? dateStyle.border : ''}`, 'important');
2277
- }
2278
- }, tabindex: "-1", "data-day": day, "data-month": _month, "data-year": _year, "data-index": index$1, "data-day-of-week": dayOfWeek, disabled: isButtonDisabled, class: {
2279
- 'calendar-day-padding': isCalendarPadding,
2280
- 'calendar-day': true,
2281
- 'calendar-day-active': isActive,
2282
- 'calendar-day-constrained': isCalDayConstrained,
2283
- 'calendar-day-today': isToday,
2284
- 'calendar-day-adjacent-day': isAdjacentDay,
2285
- }, part: dateParts, "aria-hidden": isCalendarPadding ? 'true' : null, "aria-selected": ariaSelected, "aria-label": ariaLabel, onClick: () => {
2286
- if (isCalendarPadding) {
2287
- return;
2288
- }
2289
- if (isAdjacentDay) {
2290
- // The user selected a day outside the current month. Ignore this button, as the month will be re-rendered.
2291
- this.el.blur();
2292
- this.activeParts = Object.assign(Object.assign({}, activePart), referenceParts);
2293
- this.animateToDate(referenceParts);
2294
- this.confirm();
2295
- }
2296
- else {
2297
- this.setWorkingParts(Object.assign(Object.assign({}, this.workingParts), referenceParts));
2298
- // Multiple only needs date info so we can wipe out other fields like time.
2299
- if (multiple) {
2300
- this.setActiveParts(referenceParts, isActive);
2301
- }
2302
- else {
2303
- this.setActiveParts(Object.assign(Object.assign({}, activePart), referenceParts));
2304
- }
2305
- }
2306
- }
2307
- }, text)));
2308
- }))));
2309
- }
2310
- renderCalendarBody() {
2311
- return (index.h("div", { class: "calendar-body ion-focusable", ref: (el) => (this.calendarBodyRef = el), tabindex: "0" }, generateMonths(this.workingParts, this.forceRenderDate).map(({ month, year }) => {
2312
- return this.renderMonth(month, year);
2313
- })));
2314
- }
2315
- renderCalendar(theme) {
2316
- return (index.h("div", { class: "datetime-calendar", key: "datetime-calendar" }, this.renderCalendarHeader(theme), this.renderCalendarBody()));
2317
- }
2318
- renderTimeLabel() {
2319
- const hasSlottedTimeLabel = this.el.querySelector('[slot="time-label"]') !== null;
2320
- if (!hasSlottedTimeLabel && !this.showDefaultTimeLabel) {
2321
- return;
2322
- }
2323
- return index.h("slot", { name: "time-label" }, "Time");
2324
- }
2325
- renderTimeOverlay() {
2326
- const { disabled, hourCycle, isTimePopoverOpen, locale, formatOptions } = this;
2327
- const computedHourCycle = format.getHourCycle(locale, hourCycle);
2328
- const activePart = this.getActivePartsWithFallback();
2329
- return [
2330
- index.h("div", { class: "time-header" }, this.renderTimeLabel()),
2331
- index.h("button", { class: {
2332
- 'time-body': true,
2333
- 'time-body-active': isTimePopoverOpen,
2334
- }, part: `time-button${isTimePopoverOpen ? ' active' : ''}`, "aria-expanded": "false", "aria-haspopup": "true", disabled: disabled, onClick: async (ev) => {
2335
- const { popoverRef } = this;
2336
- if (popoverRef) {
2337
- this.isTimePopoverOpen = true;
2338
- popoverRef.present(new CustomEvent('ionShadowTarget', {
2339
- detail: {
2340
- ionShadowTarget: ev.target,
2341
- },
2342
- }));
2343
- await popoverRef.onWillDismiss();
2344
- this.isTimePopoverOpen = false;
2345
- }
2346
- } }, format.getLocalizedTime(locale, activePart, computedHourCycle, formatOptions === null || formatOptions === void 0 ? void 0 : formatOptions.time)),
2347
- index.h("ion-popover", { alignment: "center", translucent: true, overlayIndex: 1, arrow: false, onWillPresent: (ev) => {
2348
- /**
2349
- * Intersection Observers do not consistently fire between Blink and Webkit
2350
- * when toggling the visibility of the popover and trying to scroll the picker
2351
- * column to the correct time value.
2352
- *
2353
- * This will correctly scroll the element position to the correct time value,
2354
- * before the popover is fully presented.
2355
- */
2356
- const cols = ev.target.querySelectorAll('ion-picker-column');
2357
- // TODO (FW-615): Potentially remove this when intersection observers are fixed in picker column
2358
- cols.forEach((col) => col.scrollActiveItemIntoView());
2359
- }, style: {
2360
- '--offset-y': '-10px',
2361
- '--min-width': 'fit-content',
2362
- },
2363
- // Allow native browser keyboard events to support up/down/home/end key
2364
- // navigation within the time picker.
2365
- keyboardEvents: true, ref: (el) => (this.popoverRef = el) }, this.renderWheelPicker('time')),
2366
- ];
2367
- }
2368
- getHeaderSelectedDateText() {
2369
- var _a;
2370
- const { activeParts, formatOptions, multiple, titleSelectedDatesFormatter } = this;
2371
- const isArray = Array.isArray(activeParts);
2372
- let headerText;
2373
- if (multiple && isArray && activeParts.length !== 1) {
2374
- headerText = `${activeParts.length} days`; // default/fallback for multiple selection
2375
- if (titleSelectedDatesFormatter !== undefined) {
2376
- try {
2377
- headerText = titleSelectedDatesFormatter(format.convertDataToISO(activeParts));
2378
- }
2379
- catch (e) {
2380
- index.printIonError('[ion-datetime] - Exception in provided `titleSelectedDatesFormatter`:', e);
2381
- }
2382
- }
2383
- }
2384
- else {
2385
- // for exactly 1 day selected (multiple set or not), show a formatted version of that
2386
- headerText = format.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' });
2387
- }
2388
- return headerText;
2389
- }
2390
- renderHeader(showExpandedHeader = true) {
2391
- const hasSlottedTitle = this.el.querySelector('[slot="title"]') !== null;
2392
- if (!hasSlottedTitle && !this.showDefaultTitle) {
2393
- return;
2394
- }
2395
- return (index.h("div", { class: "datetime-header", part: "datetime-header" }, index.h("div", { class: "datetime-title", part: "datetime-title" }, index.h("slot", { name: "title" }, "Select Date")), showExpandedHeader && (index.h("div", { class: "datetime-selected-date", part: "datetime-selected-date" }, this.getHeaderSelectedDateText()))));
2396
- }
2397
- /**
2398
- * Render time picker inside of datetime.
2399
- * Do not pass color prop to segment on
2400
- * iOS mode. MD segment has been customized and
2401
- * should take on the color prop, but iOS
2402
- * should just be the default segment.
2403
- */
2404
- renderTime() {
2405
- const { presentation } = this;
2406
- const timeOnlyPresentation = presentation === 'time';
2407
- return (index.h("div", { class: "datetime-time" }, timeOnlyPresentation ? this.renderWheelPicker() : this.renderTimeOverlay()));
2408
- }
2409
- /**
2410
- * Renders the month/year picker that is
2411
- * displayed on the calendar grid.
2412
- * The .datetime-year class has additional
2413
- * styles that let us show/hide the
2414
- * picker when the user clicks on the
2415
- * toggle in the calendar header.
2416
- */
2417
- renderCalendarViewMonthYearPicker() {
2418
- return index.h("div", { class: "datetime-year" }, this.renderWheelView('month-year'));
2419
- }
2420
- /**
2421
- * Render entry point
2422
- * All presentation types are rendered from here.
2423
- */
2424
- renderDatetime(theme) {
2425
- const { presentation, preferWheel } = this;
2426
- /**
2427
- * Certain presentation types have separate grid and wheel displays.
2428
- * If preferWheel is true then we should show a wheel picker instead.
2429
- */
2430
- const hasWheelVariant = presentation === 'date' || presentation === 'date-time' || presentation === 'time-date';
2431
- if (preferWheel && hasWheelVariant) {
2432
- return [this.renderHeader(false), this.renderWheelView(), this.renderFooter()];
2433
- }
2434
- switch (presentation) {
2435
- case 'date-time':
2436
- return [
2437
- this.renderHeader(),
2438
- this.renderCalendar(theme),
2439
- this.renderCalendarViewMonthYearPicker(),
2440
- this.renderTime(),
2441
- this.renderFooter(),
2442
- ];
2443
- case 'time-date':
2444
- return [
2445
- this.renderHeader(),
2446
- this.renderTime(),
2447
- this.renderCalendar(theme),
2448
- this.renderCalendarViewMonthYearPicker(),
2449
- this.renderFooter(),
2450
- ];
2451
- case 'time':
2452
- return [this.renderHeader(false), this.renderTime(), this.renderFooter()];
2453
- case 'month':
2454
- case 'month-year':
2455
- case 'year':
2456
- return [this.renderHeader(false), this.renderWheelView(), this.renderFooter()];
2457
- default:
2458
- return [
2459
- this.renderHeader(),
2460
- this.renderCalendar(theme),
2461
- this.renderCalendarViewMonthYearPicker(),
2462
- this.renderFooter(),
2463
- ];
2464
- }
2465
- }
2466
- /**
2467
- * Get the icon to use for the next icon.
2468
- * Otherwise, use the icon set in the config.
2469
- * If no icon is set in the config, use the default icon.
2470
- */
2471
- get datetimeNextIcon() {
2472
- // Determine the theme and map to default icons
2473
- const theme = ionicGlobal.getIonTheme(this);
2474
- const defaultIcons = {
2475
- ios: index$1.chevronForward,
2476
- ionic: caretRight.caretRightSvg,
2477
- md: index$1.chevronForward,
2478
- };
2479
- // Get the default icon based on the theme, falling back to 'md' icon if necessary
2480
- const defaultIcon = defaultIcons[theme] || defaultIcons.md;
2481
- // Return the configured datetime next icon or the default icon
2482
- return index.config.get('datetimeNextIcon', defaultIcon);
2483
- }
2484
- /**
2485
- * Get the icon to use for the previous icon.
2486
- * Otherwise, use the icon set in the config.
2487
- * If no icon is set in the config, use the default icon.
2488
- */
2489
- get datetimePreviousIcon() {
2490
- // Determine the theme and map to default icons
2491
- const theme = ionicGlobal.getIonTheme(this);
2492
- const defaultIcons = {
2493
- ios: index$1.chevronBack,
2494
- ionic: caretLeft.caretLeftSvg,
2495
- md: index$1.chevronBack,
2496
- };
2497
- // Get the default icon based on the theme, falling back to 'md' icon if necessary
2498
- const defaultIcon = defaultIcons[theme] || defaultIcons.md;
2499
- // Return the configured datetime previous icon or the default icon
2500
- return index.config.get('datetimePreviousIcon', defaultIcon);
2501
- }
2502
- /**
2503
- * Get the icon to use for the show month and year icon.
2504
- * Otherwise, use the icon set in the config.
2505
- * If no icon is set in the config, use the default icon.
2506
- */
2507
- get datetimeCollapsedIcon() {
2508
- // Determine the theme and map to default icons
2509
- const theme = ionicGlobal.getIonTheme(this);
2510
- const defaultIcons = {
2511
- ios: index$1.chevronForward,
2512
- ionic: undefined,
2513
- md: index$1.caretDownSharp,
2514
- };
2515
- // Get the default icon based on the theme, falling back to 'md' icon if necessary
2516
- const defaultIcon = defaultIcons[theme] || defaultIcons.md;
2517
- // Return the configured datetime show month and year icon or the default icon
2518
- return index.config.get('datetimeCollapsedIcon', defaultIcon);
2519
- }
2520
- /**
2521
- * Get the icon to use for the hide month and year icon.
2522
- * Otherwise, use the icon set in the config.
2523
- * If no icon is set in the config, use the default icon.
2524
- */
2525
- get datetimeExpandedIcon() {
2526
- // Determine the theme and map to default icons
2527
- const theme = ionicGlobal.getIonTheme(this);
2528
- const defaultIcons = {
2529
- ios: index$1.chevronDown,
2530
- ionic: undefined,
2531
- md: index$1.caretUpSharp,
2532
- };
2533
- // Get the default icon based on the theme, falling back to 'md' icon if necessary
2534
- const defaultIcon = defaultIcons[theme] || defaultIcons.md;
2535
- // Return the configured datetime hide month and year icon or the default icon
2536
- return index.config.get('datetimeExpandedIcon', defaultIcon);
2537
- }
2538
- render() {
2539
- const { name, value, disabled, el, color, readonly, showMonthAndYear, preferWheel, presentation, size, isGridStyle, } = this;
2540
- const theme$1 = ionicGlobal.getIonTheme(this);
2541
- const isMonthAndYearPresentation = presentation === 'year' || presentation === 'month' || presentation === 'month-year';
2542
- const shouldShowMonthAndYear = showMonthAndYear || isMonthAndYearPresentation;
2543
- const monthYearPickerOpen = showMonthAndYear && !isMonthAndYearPresentation;
2544
- const hasDatePresentation = presentation === 'date' || presentation === 'date-time' || presentation === 'time-date';
2545
- const hasWheelVariant = hasDatePresentation && preferWheel;
2546
- helpers.renderHiddenInput(true, el, name, format.formatValue(value), disabled);
2547
- return (index.h(index.Host, { key: '04fb1740b1d722d20cdbb32b19d9a3b7d3334db0', "aria-disabled": disabled ? 'true' : null, onFocus: this.onFocus, onBlur: this.onBlur, class: Object.assign({}, theme.createColorClasses(color, {
2548
- [theme$1]: true,
2549
- ['datetime-readonly']: readonly,
2550
- ['datetime-disabled']: disabled,
2551
- 'show-month-and-year': shouldShowMonthAndYear,
2552
- 'month-year-picker-open': monthYearPickerOpen,
2553
- [`datetime-presentation-${presentation}`]: true,
2554
- [`datetime-size-${size}`]: true,
2555
- [`datetime-prefer-wheel`]: hasWheelVariant,
2556
- [`datetime-grid`]: isGridStyle,
2557
- })) }, index.h("div", { key: '0cbb85b4c71e521c81b37a98da0123a1c3a15fac', class: "intersection-tracker", ref: (el) => (this.intersectionTrackerRef = el) }), this.renderDatetime(theme$1)));
2558
- }
2559
- get el() { return index.getElement(this); }
2560
- static get watchers() { return {
2561
- "formatOptions": [{
2562
- "formatOptionsChanged": 0
2563
- }],
2564
- "disabled": [{
2565
- "disabledChanged": 0
2566
- }],
2567
- "min": [{
2568
- "minChanged": 0
2569
- }],
2570
- "max": [{
2571
- "maxChanged": 0
2572
- }],
2573
- "presentation": [{
2574
- "presentationChanged": 0
2575
- }],
2576
- "yearValues": [{
2577
- "yearValuesChanged": 0
2578
- }],
2579
- "monthValues": [{
2580
- "monthValuesChanged": 0
2581
- }],
2582
- "dayValues": [{
2583
- "dayValuesChanged": 0
2584
- }],
2585
- "hourValues": [{
2586
- "hourValuesChanged": 0
2587
- }],
2588
- "minuteValues": [{
2589
- "minuteValuesChanged": 0
2590
- }],
2591
- "value": [{
2592
- "valueChanged": 0
2593
- }]
2594
- }; }
2595
- };
2596
- let datetimeIds = 0;
2597
- const CANCEL_ROLE = 'datetime-cancel';
2598
- const CONFIRM_ROLE = 'datetime-confirm';
2599
- const WHEEL_PART = 'wheel';
2600
- const WHEEL_ITEM_PART = 'wheel-item';
2601
- const WHEEL_ITEM_ACTIVE_PART = `active`;
2602
- Datetime.style = {
2603
- ionic: datetimeIonicCss(),
2604
- ios: datetimeIosCss(),
2605
- md: datetimeMdCss()
2606
- };
2607
-
2608
- /**
2609
- * iOS Picker Enter Animation
2610
- */
2611
- const iosEnterAnimation = (baseEl) => {
2612
- const baseAnimation = animation.createAnimation();
2613
- const backdropAnimation = animation.createAnimation();
2614
- const wrapperAnimation = animation.createAnimation();
2615
- backdropAnimation
2616
- .addElement(baseEl.querySelector('ion-backdrop'))
2617
- .fromTo('opacity', 0.01, 'var(--backdrop-opacity)')
2618
- .beforeStyles({
2619
- 'pointer-events': 'none',
2620
- })
2621
- .afterClearStyles(['pointer-events']);
2622
- wrapperAnimation
2623
- .addElement(baseEl.querySelector('.picker-wrapper'))
2624
- .fromTo('transform', 'translateY(100%)', 'translateY(0%)');
2625
- return baseAnimation
2626
- .addElement(baseEl)
2627
- .easing('cubic-bezier(.36,.66,.04,1)')
2628
- .duration(400)
2629
- .addAnimation([backdropAnimation, wrapperAnimation]);
2630
- };
2631
-
2632
- /**
2633
- * iOS Picker Leave Animation
2634
- */
2635
- const iosLeaveAnimation = (baseEl) => {
2636
- const baseAnimation = animation.createAnimation();
2637
- const backdropAnimation = animation.createAnimation();
2638
- const wrapperAnimation = animation.createAnimation();
2639
- backdropAnimation
2640
- .addElement(baseEl.querySelector('ion-backdrop'))
2641
- .fromTo('opacity', 'var(--backdrop-opacity)', 0.01);
2642
- wrapperAnimation
2643
- .addElement(baseEl.querySelector('.picker-wrapper'))
2644
- .fromTo('transform', 'translateY(0%)', 'translateY(100%)');
2645
- return baseAnimation
2646
- .addElement(baseEl)
2647
- .easing('cubic-bezier(.36,.66,.04,1)')
2648
- .duration(400)
2649
- .addAnimation([backdropAnimation, wrapperAnimation]);
2650
- };
2651
-
2652
- const pickerIosCss = () => `.sc-ion-picker-legacy-ios-h{--border-radius:0;--border-style:solid;--min-width:auto;--width:100%;--max-width:500px;--min-height:auto;--max-height:auto;-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;top:0;display:block;position:absolute;width:100%;height:100%;outline:none;font-family:var(--ion-font-family, inherit);contain:strict;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;z-index:1001}.sc-ion-picker-legacy-ios-h{inset-inline-start:0}.overlay-hidden.sc-ion-picker-legacy-ios-h{display:none}.picker-wrapper.sc-ion-picker-legacy-ios{border-radius:var(--border-radius);right:0;left:0;bottom:0;-webkit-margin-start:auto;margin-inline-start:auto;-webkit-margin-end:auto;margin-inline-end:auto;margin-top:auto;margin-bottom:auto;-webkit-transform:translate3d(0, 100%, 0);transform:translate3d(0, 100%, 0);display:-ms-flexbox;display:flex;position:absolute;-ms-flex-direction:column;flex-direction:column;width:var(--width);min-width:var(--min-width);max-width:var(--max-width);height:var(--height);min-height:var(--min-height);max-height:var(--max-height);border-width:var(--border-width);border-style:var(--border-style);border-color:var(--border-color);background:var(--background);contain:strict;overflow:hidden;z-index:10}.picker-toolbar.sc-ion-picker-legacy-ios{width:100%;background:transparent;contain:strict;z-index:1}.picker-button.sc-ion-picker-legacy-ios{border:0;font-family:inherit}.picker-button.sc-ion-picker-legacy-ios:active,.picker-button.sc-ion-picker-legacy-ios:focus{outline:none}.picker-columns.sc-ion-picker-legacy-ios{display:-ms-flexbox;display:flex;position:relative;-ms-flex-pack:center;justify-content:center;margin-bottom:var(--ion-safe-area-bottom, 0);contain:strict;overflow:hidden}.picker-above-highlight.sc-ion-picker-legacy-ios,.picker-below-highlight.sc-ion-picker-legacy-ios{display:none;pointer-events:none}.sc-ion-picker-legacy-ios-h{--background:var(--ion-background-color, #fff);--border-width:1px 0 0;--border-color:var(--ion-item-border-color, var(--ion-border-color, var(--ion-color-step-250, var(--ion-background-color-step-250, #c8c7cc))));--height:260px;--backdrop-opacity:var(--ion-backdrop-opacity, 0.26);color:var(--ion-item-color, var(--ion-text-color, #000))}.picker-toolbar.sc-ion-picker-legacy-ios{display:-ms-flexbox;display:flex;height:44px;border-bottom:0.55px solid var(--border-color)}.picker-toolbar-button.sc-ion-picker-legacy-ios{-ms-flex:1;flex:1;text-align:end}.picker-toolbar-button.sc-ion-picker-legacy-ios:last-child .picker-button.sc-ion-picker-legacy-ios{font-weight:600}.picker-toolbar-button.sc-ion-picker-legacy-ios:first-child{font-weight:normal;text-align:start}.picker-button.sc-ion-picker-legacy-ios,.picker-button.ion-activated.sc-ion-picker-legacy-ios{margin-left:0;margin-right:0;margin-top:0;margin-bottom:0;-webkit-padding-start:1em;padding-inline-start:1em;-webkit-padding-end:1em;padding-inline-end:1em;padding-top:0;padding-bottom:0;height:44px;background:transparent;color:var(--ion-color-primary, #0054e9);font-size:16px}.picker-columns.sc-ion-picker-legacy-ios{height:215px;-webkit-perspective:1000px;perspective:1000px}.picker-above-highlight.sc-ion-picker-legacy-ios{top:0;-webkit-transform:translate3d(0, 0, 90px);transform:translate3d(0, 0, 90px);display:block;position:absolute;width:100%;height:81px;border-bottom:1px solid var(--border-color);background:-webkit-gradient(linear, left top, left bottom, color-stop(20%, var(--background, var(--ion-background-color, #fff))), to(rgba(var(--background-rgb, var(--ion-background-color-rgb, 255, 255, 255)), 0.8)));background:linear-gradient(to bottom, var(--background, var(--ion-background-color, #fff)) 20%, rgba(var(--background-rgb, var(--ion-background-color-rgb, 255, 255, 255)), 0.8) 100%);z-index:10}.picker-above-highlight.sc-ion-picker-legacy-ios{inset-inline-start:0}.picker-below-highlight.sc-ion-picker-legacy-ios{top:115px;-webkit-transform:translate3d(0, 0, 90px);transform:translate3d(0, 0, 90px);display:block;position:absolute;width:100%;height:119px;border-top:1px solid var(--border-color);background:-webkit-gradient(linear, left bottom, left top, color-stop(30%, var(--background, var(--ion-background-color, #fff))), to(rgba(var(--background-rgb, var(--ion-background-color-rgb, 255, 255, 255)), 0.8)));background:linear-gradient(to top, var(--background, var(--ion-background-color, #fff)) 30%, rgba(var(--background-rgb, var(--ion-background-color-rgb, 255, 255, 255)), 0.8) 100%);z-index:11}.picker-below-highlight.sc-ion-picker-legacy-ios{inset-inline-start:0}`;
2653
-
2654
- const pickerMdCss = () => `.sc-ion-picker-legacy-md-h{--border-radius:0;--border-style:solid;--min-width:auto;--width:100%;--max-width:500px;--min-height:auto;--max-height:auto;-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;top:0;display:block;position:absolute;width:100%;height:100%;outline:none;font-family:var(--ion-font-family, inherit);contain:strict;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;z-index:1001}.sc-ion-picker-legacy-md-h{inset-inline-start:0}.overlay-hidden.sc-ion-picker-legacy-md-h{display:none}.picker-wrapper.sc-ion-picker-legacy-md{border-radius:var(--border-radius);right:0;left:0;bottom:0;-webkit-margin-start:auto;margin-inline-start:auto;-webkit-margin-end:auto;margin-inline-end:auto;margin-top:auto;margin-bottom:auto;-webkit-transform:translate3d(0, 100%, 0);transform:translate3d(0, 100%, 0);display:-ms-flexbox;display:flex;position:absolute;-ms-flex-direction:column;flex-direction:column;width:var(--width);min-width:var(--min-width);max-width:var(--max-width);height:var(--height);min-height:var(--min-height);max-height:var(--max-height);border-width:var(--border-width);border-style:var(--border-style);border-color:var(--border-color);background:var(--background);contain:strict;overflow:hidden;z-index:10}.picker-toolbar.sc-ion-picker-legacy-md{width:100%;background:transparent;contain:strict;z-index:1}.picker-button.sc-ion-picker-legacy-md{border:0;font-family:inherit}.picker-button.sc-ion-picker-legacy-md:active,.picker-button.sc-ion-picker-legacy-md:focus{outline:none}.picker-columns.sc-ion-picker-legacy-md{display:-ms-flexbox;display:flex;position:relative;-ms-flex-pack:center;justify-content:center;margin-bottom:var(--ion-safe-area-bottom, 0);contain:strict;overflow:hidden}.picker-above-highlight.sc-ion-picker-legacy-md,.picker-below-highlight.sc-ion-picker-legacy-md{display:none;pointer-events:none}.sc-ion-picker-legacy-md-h{--background:var(--ion-background-color, #fff);--border-width:0.55px 0 0;--border-color:var(--ion-item-border-color, var(--ion-border-color, var(--ion-color-step-150, var(--ion-background-color-step-150, rgba(0, 0, 0, 0.13)))));--height:260px;--backdrop-opacity:var(--ion-backdrop-opacity, 0.26);color:var(--ion-item-color, var(--ion-text-color, #000))}.picker-toolbar.sc-ion-picker-legacy-md{display:-ms-flexbox;display:flex;-ms-flex-pack:end;justify-content:flex-end;height:44px}.picker-button.sc-ion-picker-legacy-md,.picker-button.ion-activated.sc-ion-picker-legacy-md{margin-left:0;margin-right:0;margin-top:0;margin-bottom:0;-webkit-padding-start:1.1em;padding-inline-start:1.1em;-webkit-padding-end:1.1em;padding-inline-end:1.1em;padding-top:0;padding-bottom:0;height:44px;background:transparent;color:var(--ion-color-primary, #0054e9);font-size:14px;font-weight:500;text-transform:uppercase;-webkit-box-shadow:none;box-shadow:none}.picker-columns.sc-ion-picker-legacy-md{height:216px;-webkit-perspective:1800px;perspective:1800px}.picker-above-highlight.sc-ion-picker-legacy-md{top:0;-webkit-transform:translate3d(0, 0, 90px);transform:translate3d(0, 0, 90px);position:absolute;width:100%;height:81px;border-bottom:1px solid var(--ion-item-border-color, var(--ion-border-color, var(--ion-color-step-150, var(--ion-background-color-step-150, rgba(0, 0, 0, 0.13)))));background:-webkit-gradient(linear, left top, left bottom, color-stop(20%, var(--ion-background-color, #fff)), to(rgba(var(--ion-background-color-rgb, 255, 255, 255), 0.8)));background:linear-gradient(to bottom, var(--ion-background-color, #fff) 20%, rgba(var(--ion-background-color-rgb, 255, 255, 255), 0.8) 100%);z-index:10}.picker-above-highlight.sc-ion-picker-legacy-md{inset-inline-start:0}.picker-below-highlight.sc-ion-picker-legacy-md{top:115px;-webkit-transform:translate3d(0, 0, 90px);transform:translate3d(0, 0, 90px);position:absolute;width:100%;height:119px;border-top:1px solid var(--ion-item-border-color, var(--ion-border-color, var(--ion-color-step-150, var(--ion-background-color-step-150, rgba(0, 0, 0, 0.13)))));background:-webkit-gradient(linear, left bottom, left top, color-stop(30%, var(--ion-background-color, #fff)), to(rgba(var(--ion-background-color-rgb, 255, 255, 255), 0.8)));background:linear-gradient(to top, var(--ion-background-color, #fff) 30%, rgba(var(--ion-background-color-rgb, 255, 255, 255), 0.8) 100%);z-index:11}.picker-below-highlight.sc-ion-picker-legacy-md{inset-inline-start:0}`;
2655
-
2656
- const Picker = class {
2657
- constructor(hostRef) {
2658
- index.registerInstance(this, hostRef);
2659
- this.didPresent = index.createEvent(this, "ionPickerDidPresent", 7);
2660
- this.willPresent = index.createEvent(this, "ionPickerWillPresent", 7);
2661
- this.willDismiss = index.createEvent(this, "ionPickerWillDismiss", 7);
2662
- this.didDismiss = index.createEvent(this, "ionPickerDidDismiss", 7);
2663
- this.didPresentShorthand = index.createEvent(this, "didPresent", 7);
2664
- this.willPresentShorthand = index.createEvent(this, "willPresent", 7);
2665
- this.willDismissShorthand = index.createEvent(this, "willDismiss", 7);
2666
- this.didDismissShorthand = index.createEvent(this, "didDismiss", 7);
2667
- this.delegateController = overlays.createDelegateController(this);
2668
- this.lockController = lockController.createLockController();
2669
- this.triggerController = overlays.createTriggerController();
2670
- this.presented = false;
2671
- /** @internal */
2672
- this.hasController = false;
2673
- /**
2674
- * If `true`, the keyboard will be automatically dismissed when the overlay is presented.
2675
- */
2676
- this.keyboardClose = true;
2677
- /**
2678
- * Array of buttons to be displayed at the top of the picker.
2679
- */
2680
- this.buttons = [];
2681
- /**
2682
- * Array of columns to be displayed in the picker.
2683
- */
2684
- this.columns = [];
2685
- /**
2686
- * Number of milliseconds to wait before dismissing the picker.
2687
- */
2688
- this.duration = 0;
2689
- /**
2690
- * If `true`, a backdrop will be displayed behind the picker.
2691
- */
2692
- this.showBackdrop = true;
2693
- /**
2694
- * If `true`, the picker will be dismissed when the backdrop is clicked.
2695
- */
2696
- this.backdropDismiss = true;
2697
- /**
2698
- * If `true`, the picker will animate.
2699
- */
2700
- this.animated = true;
2701
- /**
2702
- * If `true`, the picker will open. If `false`, the picker will close.
2703
- * Use this if you need finer grained control over presentation, otherwise
2704
- * just use the pickerController or the `trigger` property.
2705
- * Note: `isOpen` will not automatically be set back to `false` when
2706
- * the picker dismisses. You will need to do that in your code.
2707
- */
2708
- this.isOpen = false;
2709
- this.onBackdropTap = () => {
2710
- this.dismiss(undefined, overlays.BACKDROP);
2711
- };
2712
- this.dispatchCancelHandler = (ev) => {
2713
- const role = ev.detail.role;
2714
- if (overlays.isCancel(role)) {
2715
- const cancelButton = this.buttons.find((b) => b.role === 'cancel');
2716
- this.callButtonHandler(cancelButton);
2717
- }
2718
- };
2719
- }
2720
- onIsOpenChange(newValue, oldValue) {
2721
- if (newValue === true && oldValue === false) {
2722
- this.present();
2723
- }
2724
- else if (newValue === false && oldValue === true) {
2725
- this.dismiss();
2726
- }
2727
- }
2728
- triggerChanged() {
2729
- const { trigger, el, triggerController } = this;
2730
- if (trigger) {
2731
- triggerController.addClickListener(el, trigger);
2732
- }
2733
- }
2734
- connectedCallback() {
2735
- overlays.prepareOverlay(this.el);
2736
- this.triggerChanged();
2737
- }
2738
- disconnectedCallback() {
2739
- this.triggerController.removeClickListener();
2740
- }
2741
- componentWillLoad() {
2742
- var _a;
2743
- if (!((_a = this.htmlAttributes) === null || _a === void 0 ? void 0 : _a.id)) {
2744
- overlays.setOverlayId(this.el);
2745
- }
2746
- }
2747
- componentDidLoad() {
2748
- index.printIonWarning('[ion-picker-legacy] - ion-picker-legacy and ion-picker-legacy-column have been deprecated in favor of new versions of the ion-picker and ion-picker-column components. These new components display inline with your page content allowing for more presentation flexibility than before.', this.el);
2749
- /**
2750
- * If picker was rendered with isOpen="true"
2751
- * then we should open picker immediately.
2752
- */
2753
- if (this.isOpen === true) {
2754
- helpers.raf(() => this.present());
2755
- }
2756
- /**
2757
- * When binding values in frameworks such as Angular
2758
- * it is possible for the value to be set after the Web Component
2759
- * initializes but before the value watcher is set up in Stencil.
2760
- * As a result, the watcher callback may not be fired.
2761
- * We work around this by manually calling the watcher
2762
- * callback when the component has loaded and the watcher
2763
- * is configured.
2764
- */
2765
- this.triggerChanged();
2766
- }
2767
- /**
2768
- * Present the picker overlay after it has been created.
2769
- */
2770
- async present() {
2771
- const unlock = await this.lockController.lock();
2772
- await this.delegateController.attachViewToDom();
2773
- await overlays.present(this, 'pickerEnter', iosEnterAnimation, iosEnterAnimation, undefined);
2774
- if (this.duration > 0) {
2775
- this.durationTimeout = setTimeout(() => this.dismiss(), this.duration);
2776
- }
2777
- unlock();
2778
- }
2779
- /**
2780
- * Dismiss the picker overlay after it has been presented.
2781
- *
2782
- * @param data Any data to emit in the dismiss events.
2783
- * @param role The role of the element that is dismissing the picker.
2784
- * This can be useful in a button handler for determining which button was
2785
- * clicked to dismiss the picker.
2786
- * Some examples include: ``"cancel"`, `"destructive"`, "selected"`, and `"backdrop"`.
2787
- */
2788
- async dismiss(data, role) {
2789
- const unlock = await this.lockController.lock();
2790
- if (this.durationTimeout) {
2791
- clearTimeout(this.durationTimeout);
2792
- }
2793
- const dismissed = await overlays.dismiss(this, data, role, 'pickerLeave', iosLeaveAnimation, iosLeaveAnimation);
2794
- if (dismissed) {
2795
- this.delegateController.removeViewFromDom();
2796
- }
2797
- unlock();
2798
- return dismissed;
2799
- }
2800
- /**
2801
- * Returns a promise that resolves when the picker did dismiss.
2802
- */
2803
- onDidDismiss() {
2804
- return overlays.eventMethod(this.el, 'ionPickerDidDismiss');
2805
- }
2806
- /**
2807
- * Returns a promise that resolves when the picker will dismiss.
2808
- */
2809
- onWillDismiss() {
2810
- return overlays.eventMethod(this.el, 'ionPickerWillDismiss');
2811
- }
2812
- /**
2813
- * Get the column that matches the specified name.
2814
- *
2815
- * @param name The name of the column.
2816
- */
2817
- getColumn(name) {
2818
- return Promise.resolve(this.columns.find((column) => column.name === name));
2819
- }
2820
- async buttonClick(button) {
2821
- const role = button.role;
2822
- if (overlays.isCancel(role)) {
2823
- return this.dismiss(undefined, role);
2824
- }
2825
- const shouldDismiss = await this.callButtonHandler(button);
2826
- if (shouldDismiss) {
2827
- return this.dismiss(this.getSelected(), button.role);
2828
- }
2829
- return Promise.resolve();
2830
- }
2831
- async callButtonHandler(button) {
2832
- if (button) {
2833
- // a handler has been provided, execute it
2834
- // pass the handler the values from the inputs
2835
- const rtn = await overlays.safeCall(button.handler, this.getSelected());
2836
- if (rtn === false) {
2837
- // if the return value of the handler is false then do not dismiss
2838
- return false;
2839
- }
2840
- }
2841
- return true;
2842
- }
2843
- getSelected() {
2844
- const selected = {};
2845
- this.columns.forEach((col, index) => {
2846
- const selectedColumn = col.selectedIndex !== undefined ? col.options[col.selectedIndex] : undefined;
2847
- selected[col.name] = {
2848
- text: selectedColumn ? selectedColumn.text : undefined,
2849
- value: selectedColumn ? selectedColumn.value : undefined,
2850
- columnIndex: index,
2851
- };
2852
- });
2853
- return selected;
2854
- }
2855
- render() {
2856
- const { htmlAttributes } = this;
2857
- const theme$1 = ionicGlobal.getIonTheme(this);
2858
- return (index.h(index.Host, Object.assign({ key: '681ad6d20efa16f1d6c6f9a7d03caec2b17ff36e', "aria-modal": "true", tabindex: "-1" }, htmlAttributes, { style: {
2859
- zIndex: `${20000 + this.overlayIndex}`,
2860
- }, class: Object.assign({ [theme$1]: true,
2861
- // Used internally for styling
2862
- [`picker-${theme$1}`]: true, 'overlay-hidden': true }, theme.getClassMap(this.cssClass)), onIonBackdropTap: this.onBackdropTap, onIonPickerWillDismiss: this.dispatchCancelHandler }), index.h("ion-backdrop", { key: '6dc71805810955048479c2a6eddce2303161cb8f', visible: this.showBackdrop, tappable: this.backdropDismiss }), index.h("div", { key: '0e61724c261c9d69ba23d3cb9064018942755033', tabindex: "0", "aria-hidden": "true" }), index.h("div", { key: 'a6ca79c9a5fce42b5aad6808802535c723f27fb9', class: "picker-wrapper ion-overlay-wrapper", role: "dialog" }, index.h("div", { key: '7651cbe9d723bba032788d85711e0f7c1dc32c21', class: "picker-toolbar" }, this.buttons.map((b) => (index.h("div", { class: buttonWrapperClass(b) }, index.h("button", { type: "button", onClick: () => this.buttonClick(b), class: buttonClass(b) }, b.text))))), index.h("div", { key: 'd6b83aded670bc74515c337c038503e396ab42cc', class: "picker-columns" }, index.h("div", { key: '1dfef6ed386d7b327dc19397cc9f01c3938fbab9', class: "picker-above-highlight" }), this.presented && this.columns.map((c) => index.h("ion-picker-legacy-column", { col: c })), index.h("div", { key: 'ec8b2f4de073a245f8917a494a681adf5d1f94f6', class: "picker-below-highlight" }))), index.h("div", { key: '8557ce93083feefa5deb6097270d756424f89ab2', tabindex: "0", "aria-hidden": "true" })));
2863
- }
2864
- get el() { return index.getElement(this); }
2865
- static get watchers() { return {
2866
- "isOpen": [{
2867
- "onIsOpenChange": 0
2868
- }],
2869
- "trigger": [{
2870
- "triggerChanged": 0
2871
- }]
2872
- }; }
2873
- };
2874
- const buttonWrapperClass = (button) => {
2875
- return {
2876
- [`picker-toolbar-${button.role}`]: button.role !== undefined,
2877
- 'picker-toolbar-button': true,
2878
- };
2879
- };
2880
- const buttonClass = (button) => {
2881
- return Object.assign({ 'picker-button': true, 'ion-activatable': true }, theme.getClassMap(button.cssClass));
2882
- };
2883
- Picker.style = {
2884
- ios: pickerIosCss(),
2885
- md: pickerMdCss()
2886
- };
2887
-
2888
- const pickerColumnIosCss = () => `.picker-col{display:-ms-flexbox;display:flex;position:relative;-ms-flex:1;flex:1;-ms-flex-pack:center;justify-content:center;height:100%;-webkit-box-sizing:content-box;box-sizing:content-box;contain:content}.picker-opts{position:relative;-ms-flex:1;flex:1;max-width:100%}.picker-opt{top:0;display:block;position:absolute;width:100%;border:0;text-align:center;text-overflow:ellipsis;white-space:nowrap;contain:strict;overflow:hidden;will-change:transform}.picker-opt{inset-inline-start:0}.picker-opt.picker-opt-disabled{pointer-events:none}.picker-opt-disabled{opacity:0}.picker-opts-left{-ms-flex-pack:start;justify-content:flex-start}.picker-opts-right{-ms-flex-pack:end;justify-content:flex-end}.picker-opt:active,.picker-opt:focus{outline:none}.picker-prefix{position:relative;-ms-flex:1;flex:1;text-align:end;white-space:nowrap}.picker-suffix{position:relative;-ms-flex:1;flex:1;text-align:start;white-space:nowrap}.picker-col{-webkit-padding-start:4px;padding-inline-start:4px;-webkit-padding-end:4px;padding-inline-end:4px;padding-top:0;padding-bottom:0;-webkit-transform-style:preserve-3d;transform-style:preserve-3d}.picker-prefix,.picker-suffix,.picker-opts{top:77px;-webkit-transform-style:preserve-3d;transform-style:preserve-3d;color:inherit;font-size:20px;line-height:42px;pointer-events:none}.picker-opt{padding-left:0;padding-right:0;padding-top:0;padding-bottom:0;margin-left:0;margin-right:0;margin-top:0;margin-bottom:0;-webkit-transform-origin:center center;transform-origin:center center;height:46px;-webkit-transform-style:preserve-3d;transform-style:preserve-3d;-webkit-transition-timing-function:ease-out;transition-timing-function:ease-out;background:transparent;color:inherit;font-size:20px;line-height:42px;-webkit-backface-visibility:hidden;backface-visibility:hidden;pointer-events:auto}:host-context([dir=rtl]) .picker-opt{-webkit-transform-origin:calc(100% - center) center;transform-origin:calc(100% - center) center}[dir=rtl] .picker-opt{-webkit-transform-origin:calc(100% - center) center;transform-origin:calc(100% - center) center}@supports selector(:dir(rtl)){.picker-opt:dir(rtl){-webkit-transform-origin:calc(100% - center) center;transform-origin:calc(100% - center) center}}`;
2889
-
2890
- const pickerColumnMdCss = () => `.picker-col{display:-ms-flexbox;display:flex;position:relative;-ms-flex:1;flex:1;-ms-flex-pack:center;justify-content:center;height:100%;-webkit-box-sizing:content-box;box-sizing:content-box;contain:content}.picker-opts{position:relative;-ms-flex:1;flex:1;max-width:100%}.picker-opt{top:0;display:block;position:absolute;width:100%;border:0;text-align:center;text-overflow:ellipsis;white-space:nowrap;contain:strict;overflow:hidden;will-change:transform}.picker-opt{inset-inline-start:0}.picker-opt.picker-opt-disabled{pointer-events:none}.picker-opt-disabled{opacity:0}.picker-opts-left{-ms-flex-pack:start;justify-content:flex-start}.picker-opts-right{-ms-flex-pack:end;justify-content:flex-end}.picker-opt:active,.picker-opt:focus{outline:none}.picker-prefix{position:relative;-ms-flex:1;flex:1;text-align:end;white-space:nowrap}.picker-suffix{position:relative;-ms-flex:1;flex:1;text-align:start;white-space:nowrap}.picker-col{-webkit-padding-start:8px;padding-inline-start:8px;-webkit-padding-end:8px;padding-inline-end:8px;padding-top:0;padding-bottom:0;-webkit-transform-style:preserve-3d;transform-style:preserve-3d}.picker-prefix,.picker-suffix,.picker-opts{top:77px;-webkit-transform-style:preserve-3d;transform-style:preserve-3d;color:inherit;font-size:22px;line-height:42px;pointer-events:none}.picker-opt{margin-left:0;margin-right:0;margin-top:0;margin-bottom:0;padding-left:0;padding-right:0;padding-top:0;padding-bottom:0;height:43px;-webkit-transition-timing-function:ease-out;transition-timing-function:ease-out;background:transparent;color:inherit;font-size:22px;line-height:42px;-webkit-backface-visibility:hidden;backface-visibility:hidden;pointer-events:auto}.picker-prefix,.picker-suffix,.picker-opt.picker-opt-selected{color:var(--ion-color-primary, #0054e9)}`;
2891
-
2892
- const PickerColumnCmp = class {
2893
- constructor(hostRef) {
2894
- index.registerInstance(this, hostRef);
2895
- this.ionPickerColChange = index.createEvent(this, "ionPickerColChange", 7);
2896
- this.optHeight = 0;
2897
- this.rotateFactor = 0;
2898
- this.scaleFactor = 1;
2899
- this.velocity = 0;
2900
- this.y = 0;
2901
- this.noAnimate = true;
2902
- // `colDidChange` is a flag that gets set when the column is changed
2903
- // dynamically. When this flag is set, the column will refresh
2904
- // after the component re-renders to incorporate the new column data.
2905
- // This is necessary because `this.refresh` queries for the option elements,
2906
- // so it needs to wait for the latest elements to be available in the DOM.
2907
- // Ex: column is created with 3 options. User updates the column data
2908
- // to have 5 options. The column will still think it only has 3 options.
2909
- this.colDidChange = false;
2910
- }
2911
- colChanged() {
2912
- this.colDidChange = true;
2913
- }
2914
- async connectedCallback() {
2915
- let pickerRotateFactor = 0;
2916
- let pickerScaleFactor = 0.81;
2917
- const mode = ionicGlobal.getIonMode(this);
2918
- if (mode === 'ios') {
2919
- pickerRotateFactor = -0.46;
2920
- pickerScaleFactor = 1;
2921
- }
2922
- this.rotateFactor = pickerRotateFactor;
2923
- this.scaleFactor = pickerScaleFactor;
2924
- this.gesture = (await Promise.resolve().then(function () { return require('./index-CAvQ7Tka.js'); })).createGesture({
2925
- el: this.el,
2926
- gestureName: 'picker-swipe',
2927
- gesturePriority: 100,
2928
- threshold: 0,
2929
- passive: false,
2930
- onStart: (ev) => this.onStart(ev),
2931
- onMove: (ev) => this.onMove(ev),
2932
- onEnd: (ev) => this.onEnd(ev),
2933
- });
2934
- this.gesture.enable();
2935
- // Options have not been initialized yet
2936
- // Animation must be disabled through the `noAnimate` flag
2937
- // Otherwise, the options will render
2938
- // at the top of the column and transition down
2939
- this.tmrId = setTimeout(() => {
2940
- this.noAnimate = false;
2941
- // After initialization, `refresh()` will be called
2942
- // At this point, animation will be enabled. The options will
2943
- // animate as they are being selected.
2944
- this.refresh(true);
2945
- }, 250);
2946
- }
2947
- componentDidLoad() {
2948
- this.onDomChange();
2949
- }
2950
- componentDidUpdate() {
2951
- // Options may have changed since last update.
2952
- if (this.colDidChange) {
2953
- // Animation must be disabled through the `onDomChange` parameter.
2954
- // Otherwise, the recently added options will render
2955
- // at the top of the column and transition down
2956
- this.onDomChange(true, false);
2957
- this.colDidChange = false;
2958
- }
2959
- }
2960
- disconnectedCallback() {
2961
- if (this.rafId !== undefined)
2962
- cancelAnimationFrame(this.rafId);
2963
- if (this.tmrId)
2964
- clearTimeout(this.tmrId);
2965
- if (this.gesture) {
2966
- this.gesture.destroy();
2967
- this.gesture = undefined;
2968
- }
2969
- }
2970
- emitColChange() {
2971
- this.ionPickerColChange.emit(this.col);
2972
- }
2973
- setSelected(selectedIndex, duration) {
2974
- // if there is a selected index, then figure out it's y position
2975
- // if there isn't a selected index, then just use the top y position
2976
- const y = selectedIndex > -1 ? -(selectedIndex * this.optHeight) : 0;
2977
- this.velocity = 0;
2978
- // set what y position we're at
2979
- if (this.rafId !== undefined)
2980
- cancelAnimationFrame(this.rafId);
2981
- this.update(y, duration, true);
2982
- this.emitColChange();
2983
- }
2984
- update(y, duration, saveY) {
2985
- if (!this.optsEl) {
2986
- return;
2987
- }
2988
- // ensure we've got a good round number :)
2989
- let translateY = 0;
2990
- let translateZ = 0;
2991
- const { col, rotateFactor } = this;
2992
- const prevSelected = col.selectedIndex;
2993
- const selectedIndex = (col.selectedIndex = this.indexForY(-y));
2994
- const durationStr = duration === 0 ? '' : duration + 'ms';
2995
- const scaleStr = `scale(${this.scaleFactor})`;
2996
- const children = this.optsEl.children;
2997
- for (let i = 0; i < children.length; i++) {
2998
- const button = children[i];
2999
- const opt = col.options[i];
3000
- const optOffset = i * this.optHeight + y;
3001
- let transform = '';
3002
- if (rotateFactor !== 0) {
3003
- const rotateX = optOffset * rotateFactor;
3004
- if (Math.abs(rotateX) <= 90) {
3005
- translateY = 0;
3006
- translateZ = 90;
3007
- transform = `rotateX(${rotateX}deg) `;
3008
- }
3009
- else {
3010
- translateY = -9999;
3011
- }
3012
- }
3013
- else {
3014
- translateZ = 0;
3015
- translateY = optOffset;
3016
- }
3017
- const selected = selectedIndex === i;
3018
- transform += `translate3d(0px,${translateY}px,${translateZ}px) `;
3019
- if (this.scaleFactor !== 1 && !selected) {
3020
- transform += scaleStr;
3021
- }
3022
- // Update transition duration
3023
- if (this.noAnimate) {
3024
- opt.duration = 0;
3025
- button.style.transitionDuration = '';
3026
- }
3027
- else if (duration !== opt.duration) {
3028
- opt.duration = duration;
3029
- button.style.transitionDuration = durationStr;
3030
- }
3031
- // Update transform
3032
- if (transform !== opt.transform) {
3033
- opt.transform = transform;
3034
- }
3035
- button.style.transform = transform;
3036
- /**
3037
- * Ensure that the select column
3038
- * item has the selected class
3039
- */
3040
- opt.selected = selected;
3041
- if (selected) {
3042
- button.classList.add(PICKER_OPT_SELECTED);
3043
- }
3044
- else {
3045
- button.classList.remove(PICKER_OPT_SELECTED);
3046
- }
3047
- }
3048
- this.col.prevSelected = prevSelected;
3049
- if (saveY) {
3050
- this.y = y;
3051
- }
3052
- if (this.lastIndex !== selectedIndex) {
3053
- // have not set a last index yet
3054
- haptic.hapticSelectionChanged();
3055
- this.lastIndex = selectedIndex;
3056
- }
3057
- }
3058
- decelerate() {
3059
- if (this.velocity !== 0) {
3060
- // still decelerating
3061
- this.velocity *= DECELERATION_FRICTION;
3062
- // do not let it go slower than a velocity of 1
3063
- this.velocity = this.velocity > 0 ? Math.max(this.velocity, 1) : Math.min(this.velocity, -1);
3064
- let y = this.y + this.velocity;
3065
- if (y > this.minY) {
3066
- // whoops, it's trying to scroll up farther than the options we have!
3067
- y = this.minY;
3068
- this.velocity = 0;
3069
- }
3070
- else if (y < this.maxY) {
3071
- // gahh, it's trying to scroll down farther than we can!
3072
- y = this.maxY;
3073
- this.velocity = 0;
3074
- }
3075
- this.update(y, 0, true);
3076
- const notLockedIn = Math.round(y) % this.optHeight !== 0 || Math.abs(this.velocity) > 1;
3077
- if (notLockedIn) {
3078
- // isn't locked in yet, keep decelerating until it is
3079
- this.rafId = requestAnimationFrame(() => this.decelerate());
3080
- }
3081
- else {
3082
- this.velocity = 0;
3083
- this.emitColChange();
3084
- haptic.hapticSelectionEnd();
3085
- }
3086
- }
3087
- else if (this.y % this.optHeight !== 0) {
3088
- // needs to still get locked into a position so options line up
3089
- const currentPos = Math.abs(this.y % this.optHeight);
3090
- // create a velocity in the direction it needs to scroll
3091
- this.velocity = currentPos > this.optHeight / 2 ? 1 : -1;
3092
- this.decelerate();
3093
- }
3094
- }
3095
- indexForY(y) {
3096
- return Math.min(Math.max(Math.abs(Math.round(y / this.optHeight)), 0), this.col.options.length - 1);
3097
- }
3098
- onStart(detail) {
3099
- // We have to prevent default in order to block scrolling under the picker
3100
- // but we DO NOT have to stop propagation, since we still want
3101
- // some "click" events to capture
3102
- if (detail.event.cancelable) {
3103
- detail.event.preventDefault();
3104
- }
3105
- detail.event.stopPropagation();
3106
- haptic.hapticSelectionStart();
3107
- // reset everything
3108
- if (this.rafId !== undefined)
3109
- cancelAnimationFrame(this.rafId);
3110
- const options = this.col.options;
3111
- let minY = options.length - 1;
3112
- let maxY = 0;
3113
- for (let i = 0; i < options.length; i++) {
3114
- if (!options[i].disabled) {
3115
- minY = Math.min(minY, i);
3116
- maxY = Math.max(maxY, i);
3117
- }
3118
- }
3119
- this.minY = -(minY * this.optHeight);
3120
- this.maxY = -(maxY * this.optHeight);
3121
- }
3122
- onMove(detail) {
3123
- if (detail.event.cancelable) {
3124
- detail.event.preventDefault();
3125
- }
3126
- detail.event.stopPropagation();
3127
- // update the scroll position relative to pointer start position
3128
- let y = this.y + detail.deltaY;
3129
- if (y > this.minY) {
3130
- // scrolling up higher than scroll area
3131
- y = Math.pow(y, 0.8);
3132
- this.bounceFrom = y;
3133
- }
3134
- else if (y < this.maxY) {
3135
- // scrolling down below scroll area
3136
- y += Math.pow(this.maxY - y, 0.9);
3137
- this.bounceFrom = y;
3138
- }
3139
- else {
3140
- this.bounceFrom = 0;
3141
- }
3142
- this.update(y, 0, false);
3143
- }
3144
- onEnd(detail) {
3145
- if (this.bounceFrom > 0) {
3146
- // bounce back up
3147
- this.update(this.minY, 100, true);
3148
- this.emitColChange();
3149
- return;
3150
- }
3151
- else if (this.bounceFrom < 0) {
3152
- // bounce back down
3153
- this.update(this.maxY, 100, true);
3154
- this.emitColChange();
3155
- return;
3156
- }
3157
- this.velocity = helpers.clamp(-MAX_PICKER_SPEED, detail.velocityY * 23, MAX_PICKER_SPEED);
3158
- if (this.velocity === 0 && detail.deltaY === 0) {
3159
- const opt = detail.event.target.closest('.picker-opt');
3160
- if (opt === null || opt === void 0 ? void 0 : opt.hasAttribute('opt-index')) {
3161
- this.setSelected(parseInt(opt.getAttribute('opt-index'), 10), TRANSITION_DURATION);
3162
- }
3163
- }
3164
- else {
3165
- this.y += detail.deltaY;
3166
- if (Math.abs(detail.velocityY) < 0.05) {
3167
- const isScrollingUp = detail.deltaY > 0;
3168
- const optHeightFraction = (Math.abs(this.y) % this.optHeight) / this.optHeight;
3169
- if (isScrollingUp && optHeightFraction > 0.5) {
3170
- this.velocity = Math.abs(this.velocity) * -1;
3171
- }
3172
- else if (!isScrollingUp && optHeightFraction <= 0.5) {
3173
- this.velocity = Math.abs(this.velocity);
3174
- }
3175
- }
3176
- this.decelerate();
3177
- }
3178
- }
3179
- refresh(forceRefresh, animated) {
3180
- var _a;
3181
- let min = this.col.options.length - 1;
3182
- let max = 0;
3183
- const options = this.col.options;
3184
- for (let i = 0; i < options.length; i++) {
3185
- if (!options[i].disabled) {
3186
- min = Math.min(min, i);
3187
- max = Math.max(max, i);
3188
- }
3189
- }
3190
- /**
3191
- * Only update selected value if column has a
3192
- * velocity of 0. If it does not, then the
3193
- * column is animating might land on
3194
- * a value different than the value at
3195
- * selectedIndex
3196
- */
3197
- if (this.velocity !== 0) {
3198
- return;
3199
- }
3200
- const selectedIndex = helpers.clamp(min, (_a = this.col.selectedIndex) !== null && _a !== void 0 ? _a : 0, max);
3201
- if (this.col.prevSelected !== selectedIndex || forceRefresh) {
3202
- const y = selectedIndex * this.optHeight * -1;
3203
- const duration = animated ? TRANSITION_DURATION : 0;
3204
- this.velocity = 0;
3205
- this.update(y, duration, true);
3206
- }
3207
- }
3208
- onDomChange(forceRefresh, animated) {
3209
- const colEl = this.optsEl;
3210
- if (colEl) {
3211
- // DOM READ
3212
- // We perfom a DOM read over a rendered item, this needs to happen after the first render or after the column has changed
3213
- this.optHeight = colEl.firstElementChild ? colEl.firstElementChild.clientHeight : 0;
3214
- }
3215
- this.refresh(forceRefresh, animated);
3216
- }
3217
- render() {
3218
- const col = this.col;
3219
- const theme$1 = ionicGlobal.getIonTheme(this);
3220
- return (index.h(index.Host, { key: 'aed1c1a702e03765d704f6f563fe26df58e68bbf', class: Object.assign({ [theme$1]: true, 'picker-col': true, 'picker-opts-left': this.col.align === 'left', 'picker-opts-right': this.col.align === 'right' }, theme.getClassMap(col.cssClass)), style: {
3221
- 'max-width': this.col.columnWidth,
3222
- } }, col.prefix && (index.h("div", { key: 'a6fae778eec5d57dba4b36b3e448c5c12fe0688b', class: "picker-prefix", style: { width: col.prefixWidth } }, col.prefix)), index.h("div", { key: '1b77354fe5eeeeb4db94fab035a9ef5e45d695ac', class: "picker-opts", style: { maxWidth: col.optionsWidth }, ref: (el) => (this.optsEl = el) }, col.options.map((o, index$1) => (index.h("button", { "aria-label": o.ariaLabel, class: { 'picker-opt': true, 'picker-opt-disabled': !!o.disabled }, "opt-index": index$1 }, o.text)))), col.suffix && (index.h("div", { key: '105286ef7ba6eac0796f5af7d6f1daef7107444a', class: "picker-suffix", style: { width: col.suffixWidth } }, col.suffix))));
3223
- }
3224
- get el() { return index.getElement(this); }
3225
- static get watchers() { return {
3226
- "col": [{
3227
- "colChanged": 0
3228
- }]
3229
- }; }
3230
- };
3231
- const PICKER_OPT_SELECTED = 'picker-opt-selected';
3232
- const DECELERATION_FRICTION = 0.97;
3233
- const MAX_PICKER_SPEED = 90;
3234
- const TRANSITION_DURATION = 150;
3235
- PickerColumnCmp.style = {
3236
- ios: pickerColumnIosCss(),
3237
- md: pickerColumnMdCss()
3238
- };
3239
-
3240
- exports.ion_datetime = Datetime;
3241
- exports.ion_picker_legacy = Picker;
3242
- exports.ion_picker_legacy_column = PickerColumnCmp;