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