@ionic/core 8.8.18-dev.11786487682.1e6f798f → 8.8.18-dev.11786663039.1d61e2fe

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