@ionic/core 8.8.20-dev.11787158518.168a2fea → 8.8.20-dev.11789504012.1a675914

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 (1221) 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-divider.d.ts +11 -0
  27. package/components/ion-divider.js +4 -0
  28. package/components/ion-fab-button.js +1 -1
  29. package/components/ion-fab-list.js +1 -1
  30. package/components/ion-fab.js +1 -1
  31. package/components/ion-footer.js +1 -1
  32. package/components/ion-gallery-item.d.ts +11 -0
  33. package/components/ion-gallery-item.js +4 -0
  34. package/components/ion-gallery.d.ts +11 -0
  35. package/components/ion-gallery.js +4 -0
  36. package/components/ion-grid.js +1 -1
  37. package/components/ion-header.js +1 -1
  38. package/components/ion-icon.js +1 -1
  39. package/components/ion-img.js +1 -1
  40. package/components/ion-infinite-scroll-content.js +1 -1
  41. package/components/ion-infinite-scroll.js +1 -1
  42. package/components/ion-input-otp.js +1 -1
  43. package/components/ion-input-password-toggle.js +1 -1
  44. package/components/ion-input.js +1 -1
  45. package/components/ion-item-divider.js +1 -1
  46. package/components/ion-item-group.js +1 -1
  47. package/components/ion-item-option.js +1 -1
  48. package/components/ion-item-options.js +1 -1
  49. package/components/ion-item-sliding.js +1 -1
  50. package/components/ion-item.js +1 -1
  51. package/components/ion-label.js +1 -1
  52. package/components/ion-list-header.js +1 -1
  53. package/components/ion-list.js +1 -1
  54. package/components/ion-loading.js +1 -1
  55. package/components/ion-menu-button.js +1 -1
  56. package/components/ion-menu-toggle.js +1 -1
  57. package/components/ion-menu.js +1 -1
  58. package/components/ion-modal.js +1 -1
  59. package/components/ion-nav-link.js +1 -1
  60. package/components/ion-nav.js +1 -1
  61. package/components/ion-note.js +1 -1
  62. package/components/ion-picker-column-option.js +1 -1
  63. package/components/ion-picker-column.js +1 -1
  64. package/components/ion-picker-legacy-column.d.ts +11 -0
  65. package/components/ion-picker-legacy-column.js +4 -0
  66. package/components/ion-picker-legacy.d.ts +11 -0
  67. package/components/ion-picker-legacy.js +4 -0
  68. package/components/ion-picker.js +1 -1
  69. package/components/ion-popover.js +1 -1
  70. package/components/ion-progress-bar.js +1 -1
  71. package/components/ion-radio-group.js +1 -1
  72. package/components/ion-radio.js +1 -1
  73. package/components/ion-range.js +1 -1
  74. package/components/ion-refresher-content.js +1 -1
  75. package/components/ion-refresher.js +1 -1
  76. package/components/ion-reorder-group.js +1 -1
  77. package/components/ion-reorder.js +1 -1
  78. package/components/ion-ripple-effect.js +1 -1
  79. package/components/ion-route-redirect.js +1 -1
  80. package/components/ion-route.js +1 -1
  81. package/components/ion-router-link.js +1 -1
  82. package/components/ion-router-outlet.js +1 -1
  83. package/components/ion-router.js +1 -1
  84. package/components/ion-row.js +1 -1
  85. package/components/ion-searchbar.js +1 -1
  86. package/components/ion-segment-button.js +1 -1
  87. package/components/ion-segment-content.js +1 -1
  88. package/components/ion-segment-view.js +1 -1
  89. package/components/ion-segment.js +1 -1
  90. package/components/ion-select-modal.js +1 -1
  91. package/components/ion-select-option.js +1 -1
  92. package/components/ion-select-popover.js +1 -1
  93. package/components/ion-select.js +1 -1
  94. package/components/ion-skeleton-text.js +1 -1
  95. package/components/ion-spinner.js +1 -1
  96. package/components/ion-split-pane.js +1 -1
  97. package/components/ion-tab-bar.js +1 -1
  98. package/components/ion-tab-button.js +1 -1
  99. package/components/ion-tab.js +1 -1
  100. package/components/ion-tabs.js +1 -1
  101. package/components/ion-text.js +1 -1
  102. package/components/ion-textarea.js +1 -1
  103. package/components/ion-thumbnail.js +1 -1
  104. package/components/ion-title.js +1 -1
  105. package/components/ion-toast.js +1 -1
  106. package/components/ion-toggle.js +1 -1
  107. package/components/ion-toolbar.js +1 -1
  108. package/components/p-0MMiHJhx.js +4 -0
  109. package/components/p-0rXxxCTt.js +4 -0
  110. package/components/{p-DwpKZ6rl.js → p-B2SvA6NE.js} +1 -1
  111. package/components/p-B4GJERAm.js +4 -0
  112. package/components/p-B9_sPaDw.js +4 -0
  113. package/components/p-BE21dB_a.js +4 -0
  114. package/components/p-BJyeT56g.js +4 -0
  115. package/components/p-BTBa_wH7.js +4 -0
  116. package/components/p-BTEOs1at.js +4 -0
  117. package/components/p-BU8Blvqg.js +4 -0
  118. package/components/p-BXXTyrCp.js +4 -0
  119. package/components/p-BXjGM4gW.js +4 -0
  120. package/components/p-BXuZo5-p.js +4 -0
  121. package/components/p-BYRVyMu9.js +4 -0
  122. package/components/{p-ryyf_ItD.js → p-BZwQa9ey.js} +1 -1
  123. package/components/p-BZxBDeEU.js +4 -0
  124. package/components/p-BcWO94Sl.js +4 -0
  125. package/components/p-BjW8SOqw.js +4 -0
  126. package/components/p-Br6q6Rgq.js +4 -0
  127. package/components/p-BwKpO3Is.js +4 -0
  128. package/components/p-BwzRqsq1.js +4 -0
  129. package/components/p-C-cw-bM-.js +4 -0
  130. package/components/p-C0K6CGg9.js +4 -0
  131. package/components/p-C2J-Hvv3.js +4 -0
  132. package/components/p-C3ydXg9O.js +4 -0
  133. package/components/p-C5Bnq_Hm.js +4 -0
  134. package/components/p-C5JYXyPD.js +4 -0
  135. package/components/p-C898H5L0.js +4 -0
  136. package/components/p-C8kcgEG7.js +4 -0
  137. package/components/p-CEz0vNHD.js +4 -0
  138. package/components/p-CH8ypgvS.js +4 -0
  139. package/components/{p-CMLAwl_N.js → p-CKLXmqy1.js} +1 -1
  140. package/components/p-CMtmHGrE.js +4 -0
  141. package/components/p-CNlz8OTE.js +4 -0
  142. package/components/p-CODBQrPj.js +4 -0
  143. package/components/p-CToV3-ig.js +4 -0
  144. package/components/p-CV7PNBGr.js +4 -0
  145. package/components/p-CVYFPBs-.js +4 -0
  146. package/components/p-CgbD1udy.js +4 -0
  147. package/components/p-CjlmHeGM.js +4 -0
  148. package/components/p-ClTdIlic.js +4 -0
  149. package/components/p-CstXr-x9.js +4 -0
  150. package/components/{p-DzRT60Tw.js → p-Cu8FoYIJ.js} +1 -1
  151. package/components/p-CxhjkdQ_.js +4 -0
  152. package/components/p-D0Iqw6OZ.js +4 -0
  153. package/components/p-D12Xsfh7.js +4 -0
  154. package/components/p-DExJ63jR.js +4 -0
  155. package/components/p-DHvfufkW.js +4 -0
  156. package/components/p-DRUGmlKi.js +4 -0
  157. package/components/p-DYq-5riI.js +4 -0
  158. package/components/p-DaJxRxSQ.js +4 -0
  159. package/components/p-Db3A3kHi.js +4 -0
  160. package/components/p-Df6AAcu8.js +4 -0
  161. package/components/p-Dh1f5tAK.js +4 -0
  162. package/components/{p-63OhffQv.js → p-Di8NbWfs.js} +1 -1
  163. package/components/p-DqkLOArC.js +4 -0
  164. package/components/p-DriGEn08.js +4 -0
  165. package/components/p-DylrHLJF.js +4 -0
  166. package/components/p-WeNgVmOy.js +4 -0
  167. package/components/p-Wn4ujuPW.js +4 -0
  168. package/components/p-X6YgGSBf.js +4 -0
  169. package/components/p-dLA3JnNJ.js +4 -0
  170. package/components/p-eRqVSlkn.js +4 -0
  171. package/components/p-fUXE2zLc.js +4 -0
  172. package/components/p-o8OKV5aD.js +4 -0
  173. package/components/p-pztWcmzj.js +4 -0
  174. package/components/p-vXpMhGrs.js +4 -0
  175. package/css/core.css +1 -1
  176. package/css/core.css.map +1 -1
  177. package/css/display.css +1 -1
  178. package/css/display.css.map +1 -1
  179. package/css/flex-utils.css +1 -1
  180. package/css/flex-utils.css.map +1 -1
  181. package/css/float-elements.css.map +1 -1
  182. package/css/global.bundle.css.map +1 -1
  183. package/css/ionic/bundle.ionic.css +1 -0
  184. package/css/ionic/bundle.ionic.css.map +1 -0
  185. package/css/ionic/core.ionic.css +1 -0
  186. package/css/ionic/core.ionic.css.map +1 -0
  187. package/css/ionic/global.bundle.ionic.css +1 -0
  188. package/css/ionic/global.bundle.ionic.css.map +1 -0
  189. package/css/ionic/ionic-swiper.ionic.css +1 -0
  190. package/css/ionic/ionic-swiper.ionic.css.map +1 -0
  191. package/css/ionic/link.ionic.css +1 -0
  192. package/css/ionic/link.ionic.css.map +1 -0
  193. package/css/ionic/structure.ionic.css +1 -0
  194. package/css/ionic/structure.ionic.css.map +1 -0
  195. package/css/ionic/typography.ionic.css +1 -0
  196. package/css/ionic/typography.ionic.css.map +1 -0
  197. package/css/ionic/utils.bundle.ionic.css +1 -0
  198. package/css/ionic/utils.bundle.ionic.css.map +1 -0
  199. package/css/ionic-swiper.css +1 -1
  200. package/css/ionic-swiper.css.map +1 -1
  201. package/css/ionic.bundle.css +1 -1
  202. package/css/ionic.bundle.css.map +1 -1
  203. package/css/normalize.css.map +1 -1
  204. package/css/padding.css.map +1 -1
  205. package/css/palettes/dark.always.css.map +1 -1
  206. package/css/palettes/dark.class.css.map +1 -1
  207. package/css/palettes/dark.system.css.map +1 -1
  208. package/css/palettes/high-contrast-dark.always.css.map +1 -1
  209. package/css/palettes/high-contrast-dark.class.css.map +1 -1
  210. package/css/palettes/high-contrast-dark.system.css.map +1 -1
  211. package/css/palettes/high-contrast.always.css.map +1 -1
  212. package/css/palettes/high-contrast.class.css.map +1 -1
  213. package/css/palettes/high-contrast.system.css.map +1 -1
  214. package/css/structure.css.map +1 -1
  215. package/css/text-alignment.css.map +1 -1
  216. package/css/text-transformation.css.map +1 -1
  217. package/css/typography.css.map +1 -1
  218. package/css/utils.bundle.css +1 -1
  219. package/css/utils.bundle.css.map +1 -1
  220. package/dist/cjs/{animation-C0mOHzej.js → animation-CxRPIayb.js} +6 -6
  221. package/dist/cjs/{app-globals-BREG4twP.js → app-globals-BwvlV6g7.js} +1 -1
  222. package/dist/cjs/{button-active-CVMevT9a.js → button-active-qCQDwE2m.js} +3 -3
  223. package/dist/cjs/{capacitor-DmA66EwP.js → capacitor-CRl0exFC.js} +3 -3
  224. package/dist/cjs/clear-button-press-controller-C7B9kyMa.js +45 -0
  225. package/dist/cjs/{config-CjUbvdPW.js → config-DWdFbSNK.js} +4 -5
  226. package/dist/cjs/{dir-zwDPRE5K.js → dir-DD0jPVH3.js} +3 -2
  227. package/dist/cjs/{focus-visible-CCvKiLh3.js → focus-visible-BIj-I3-C.js} +24 -0
  228. package/dist/cjs/{format-pp0Du3K-.js → format-COAsdjOc.js} +30 -40
  229. package/dist/cjs/{framework-delegate-Dfo5XsGv.js → framework-delegate-IvkF1VuM.js} +10 -6
  230. package/dist/cjs/{gesture-controller-BDUH7687.js → gesture-controller-dtqlP_q4.js} +8 -15
  231. package/dist/cjs/{haptic-Ch-X4gRx.js → haptic-DG25gZzb.js} +4 -3
  232. package/dist/cjs/{helpers-YPQybDph.js → helpers-Dhimwhpn.js} +74 -7
  233. package/dist/cjs/{index-DwlRtFZe.js → index-BJ2-LydH.js} +3 -9
  234. package/dist/cjs/{index-zVCah4Uz.js → index-Bsq0SbXc.js} +2 -2
  235. package/dist/cjs/{index-uvry__L4.js → index-C1knGA9x.js} +65 -33
  236. package/dist/cjs/{index-wOmugbdg.js → index-CxDnX7hd.js} +2 -0
  237. package/dist/cjs/{index-DXsPSne6.js → index-DhDV4RxJ.js} +16 -15
  238. package/dist/cjs/{index-BLdJCcJY.js → index-DuleInoh.js} +5 -5
  239. package/dist/cjs/{index-B7zJsYWS.js → index-YYUVCfP-.js} +3 -3
  240. package/dist/cjs/{index-DDg31ZF5.js → index-yon1HGB7.js} +10 -9
  241. package/dist/cjs/index.cjs.js +18 -18
  242. package/dist/cjs/{input-shims-Cbu1fcye.js → input-shims-BgJcHtqI.js} +23 -20
  243. package/dist/cjs/input.utils--RmR5lVe.js +150 -0
  244. package/dist/cjs/ion-accordion_2.cjs.entry.js +376 -376
  245. package/dist/cjs/ion-action-sheet.cjs.entry.js +87 -179
  246. package/dist/cjs/ion-alert.cjs.entry.js +126 -251
  247. package/dist/cjs/ion-app_8.cjs.entry.js +608 -461
  248. package/dist/cjs/ion-avatar_3.cjs.entry.js +125 -19
  249. package/dist/cjs/ion-back-button.cjs.entry.js +49 -65
  250. package/dist/cjs/ion-backdrop.cjs.entry.js +22 -23
  251. package/dist/cjs/ion-breadcrumb_2.cjs.entry.js +157 -210
  252. package/dist/cjs/ion-button_2.cjs.entry.js +118 -153
  253. package/dist/cjs/ion-card_5.cjs.entry.js +80 -110
  254. package/dist/cjs/ion-checkbox.cjs.entry.js +134 -160
  255. package/dist/cjs/ion-chip.cjs.entry.js +56 -21
  256. package/dist/cjs/ion-col_3.cjs.entry.js +61 -186
  257. package/dist/cjs/ion-datetime-button.cjs.entry.js +248 -256
  258. package/dist/cjs/ion-datetime_3.cjs.entry.js +3210 -0
  259. package/dist/cjs/ion-divider.cjs.entry.js +51 -0
  260. package/dist/cjs/ion-fab_3.cjs.entry.js +109 -155
  261. package/dist/cjs/ion-gallery-item.cjs.entry.js +59 -0
  262. package/dist/cjs/ion-gallery.cjs.entry.js +608 -0
  263. package/dist/cjs/ion-img.cjs.entry.js +17 -35
  264. package/dist/cjs/ion-infinite-scroll_2.cjs.entry.js +157 -109
  265. package/dist/cjs/ion-input-otp.cjs.entry.js +437 -435
  266. package/dist/cjs/ion-input-password-toggle.cjs.entry.js +54 -40
  267. package/dist/cjs/ion-input.cjs.entry.js +305 -351
  268. package/dist/cjs/ion-item-option_3.cjs.entry.js +512 -137
  269. package/dist/cjs/ion-item_8.cjs.entry.js +186 -218
  270. package/dist/cjs/ion-loading.cjs.entry.js +69 -152
  271. package/dist/cjs/ion-menu_3.cjs.entry.js +136 -182
  272. package/dist/cjs/ion-modal.cjs.entry.js +501 -571
  273. package/dist/cjs/ion-nav_2.cjs.entry.js +164 -104
  274. package/dist/cjs/ion-picker-column-option.cjs.entry.js +40 -40
  275. package/dist/cjs/ion-picker-column.cjs.entry.js +410 -422
  276. package/dist/cjs/ion-picker.cjs.entry.js +401 -406
  277. package/dist/cjs/ion-popover.cjs.entry.js +212 -324
  278. package/dist/cjs/ion-progress-bar.cjs.entry.js +48 -36
  279. package/dist/cjs/ion-radio_2.cjs.entry.js +162 -217
  280. package/dist/cjs/ion-range.cjs.entry.js +251 -309
  281. package/dist/cjs/ion-refresher_2.cjs.entry.js +127 -175
  282. package/dist/cjs/ion-reorder_2.cjs.entry.js +47 -60
  283. package/dist/cjs/ion-ripple-effect.cjs.entry.js +26 -18
  284. package/dist/cjs/ion-route_4.cjs.entry.js +76 -179
  285. package/dist/cjs/ion-searchbar.cjs.entry.js +305 -308
  286. package/dist/cjs/ion-segment-content.cjs.entry.js +2 -2
  287. package/dist/cjs/ion-segment-view.cjs.entry.js +27 -28
  288. package/dist/cjs/ion-segment_2.cjs.entry.js +141 -177
  289. package/dist/cjs/ion-select-modal.cjs.entry.js +71 -50
  290. package/dist/cjs/ion-select_3.cjs.entry.js +416 -507
  291. package/dist/cjs/ion-spinner.cjs.entry.js +36 -28
  292. package/dist/cjs/ion-split-pane.cjs.entry.js +25 -34
  293. package/dist/cjs/ion-tab-bar_2.cjs.entry.js +180 -117
  294. package/dist/cjs/ion-tab_2.cjs.entry.js +30 -55
  295. package/dist/cjs/ion-text.cjs.entry.js +7 -13
  296. package/dist/cjs/ion-textarea.cjs.entry.js +310 -303
  297. package/dist/cjs/ion-toast.cjs.entry.js +170 -265
  298. package/dist/cjs/ion-toggle.cjs.entry.js +172 -184
  299. package/dist/cjs/ionic-global-DYLhJaw7.js +519 -0
  300. package/dist/cjs/ionic.cjs.js +4 -4
  301. package/dist/cjs/{ios.transition-zTmJz8T-.js → ios.transition-Blgf-vZU.js} +21 -15
  302. package/dist/cjs/{item-multiple-inputs-BdYSbfKN.js → item-multiple-inputs-DKn76MYO.js} +1 -1
  303. package/dist/cjs/{keyboard-cHxZlTyz.js → keyboard-BgioTbwQ.js} +3 -3
  304. package/dist/cjs/{keyboard-Cix5TVkD.js → keyboard-Otnp8OQI.js} +5 -4
  305. package/dist/cjs/loader.cjs.js +4 -4
  306. package/dist/cjs/{md.transition-nb_4pUXu.js → md.transition-ClgvbGfq.js} +11 -9
  307. package/dist/cjs/notch-controller-0hkmmSGo.js +155 -0
  308. package/dist/cjs/{overlay-control-label-D2sdL2O8.js → overlay-control-label-DnRLQR1t.js} +13 -11
  309. package/dist/cjs/{overlays-KaNVDNqC.js → overlays-Bxjqh2m3.js} +336 -60
  310. package/dist/cjs/scroll-hide-controller-qWMU5yOk.js +345 -0
  311. package/dist/cjs/{select-option-render-pULCGldr.js → select-option-render-BqJEK1N1.js} +4 -3
  312. package/dist/cjs/{status-tap-o9IIymsP.js → status-tap-ClA8u57t.js} +5 -4
  313. package/dist/cjs/{swipe-back-B7X9VOlH.js → swipe-back-4vY7mi8i.js} +6 -5
  314. package/dist/cjs/{theme-Bw0rpaNN.js → theme-IlOsGAz7.js} +26 -7
  315. package/dist/cjs/validity-QmuwEptc.js +51 -0
  316. package/dist/collection/collection-manifest.json +13 -1
  317. package/dist/collection/components/accordion/accordion.ionic.css +201 -0
  318. package/dist/collection/components/accordion/accordion.ios.css +73 -58
  319. package/dist/collection/components/accordion/accordion.js +331 -324
  320. package/dist/collection/components/accordion/accordion.md.css +67 -59
  321. package/dist/collection/components/accordion-group/accordion-group.ionic.css +93 -0
  322. package/dist/collection/components/accordion-group/accordion-group.ios.css +16 -4
  323. package/dist/collection/components/accordion-group/accordion-group.js +69 -56
  324. package/dist/collection/components/accordion-group/accordion-group.md.css +22 -4
  325. package/dist/collection/components/action-sheet/action-sheet.ionic.css +494 -0
  326. package/dist/collection/components/action-sheet/action-sheet.ios.css +184 -54
  327. package/dist/collection/components/action-sheet/action-sheet.js +76 -166
  328. package/dist/collection/components/action-sheet/action-sheet.md.css +179 -55
  329. package/dist/collection/components/action-sheet/test/basic/fixture.js +0 -3
  330. package/dist/collection/components/alert/alert.ionic.css +787 -0
  331. package/dist/collection/components/alert/alert.ios.css +247 -54
  332. package/dist/collection/components/alert/alert.js +113 -236
  333. package/dist/collection/components/alert/alert.md.css +243 -56
  334. package/dist/collection/components/app/app.js +15 -86
  335. package/dist/collection/components/avatar/avatar.ionic.css +385 -0
  336. package/dist/collection/components/avatar/avatar.ios.css +7 -33
  337. package/dist/collection/components/avatar/avatar.js +120 -4
  338. package/dist/collection/components/avatar/avatar.md.css +51 -0
  339. package/dist/collection/components/back-button/back-button.ios.css +60 -48
  340. package/dist/collection/components/back-button/back-button.js +45 -61
  341. package/dist/collection/components/back-button/back-button.md.css +60 -48
  342. package/dist/collection/components/backdrop/backdrop.ionic.css +109 -0
  343. package/dist/collection/components/backdrop/backdrop.ios.css +56 -19
  344. package/dist/collection/components/backdrop/backdrop.js +26 -22
  345. package/dist/collection/components/backdrop/backdrop.md.css +56 -19
  346. package/dist/collection/components/badge/badge.ionic.css +272 -0
  347. package/dist/collection/components/badge/badge.ios.css +137 -12
  348. package/dist/collection/components/badge/badge.js +145 -15
  349. package/dist/collection/components/badge/badge.md.css +122 -12
  350. package/dist/collection/components/breadcrumb/breadcrumb.ios.css +20 -8
  351. package/dist/collection/components/breadcrumb/breadcrumb.js +60 -99
  352. package/dist/collection/components/breadcrumb/breadcrumb.md.css +20 -8
  353. package/dist/collection/components/breadcrumbs/breadcrumbs.ios.css +6 -0
  354. package/dist/collection/components/breadcrumbs/breadcrumbs.js +99 -112
  355. package/dist/collection/components/breadcrumbs/breadcrumbs.md.css +6 -0
  356. package/dist/collection/components/button/button.ionic.css +644 -0
  357. package/dist/collection/components/button/button.ios.css +154 -46
  358. package/dist/collection/components/button/button.js +122 -157
  359. package/dist/collection/components/button/button.md.css +150 -50
  360. package/dist/collection/components/buttons/buttons.ionic.css +97 -0
  361. package/dist/collection/components/buttons/buttons.ios.css +59 -7
  362. package/dist/collection/components/buttons/buttons.js +29 -21
  363. package/dist/collection/components/buttons/buttons.md.css +55 -3
  364. package/dist/collection/components/card/card.ionic.css +144 -0
  365. package/dist/collection/components/card/card.ios.css +65 -14
  366. package/dist/collection/components/card/card.js +61 -63
  367. package/dist/collection/components/card/card.md.css +65 -14
  368. package/dist/collection/components/card-content/card-content.ionic.css +89 -0
  369. package/dist/collection/components/card-content/card-content.ios.css +20 -35
  370. package/dist/collection/components/card-content/card-content.js +12 -10
  371. package/dist/collection/components/card-content/card-content.md.css +20 -35
  372. package/dist/collection/components/card-header/card-header.ionic.css +85 -0
  373. package/dist/collection/components/card-header/card-header.ios.css +27 -15
  374. package/dist/collection/components/card-header/card-header.js +20 -21
  375. package/dist/collection/components/card-header/card-header.md.css +27 -15
  376. package/dist/collection/components/card-subtitle/card-subtitle.ionic.css +144 -0
  377. package/dist/collection/components/card-subtitle/card-subtitle.ios.css +12 -0
  378. package/dist/collection/components/card-subtitle/card-subtitle.js +11 -14
  379. package/dist/collection/components/card-subtitle/card-subtitle.md.css +12 -0
  380. package/dist/collection/components/card-title/card-title.ios.css +73 -0
  381. package/dist/collection/components/card-title/card-title.js +11 -14
  382. package/dist/collection/components/card-title/card-title.md.css +73 -0
  383. package/dist/collection/components/checkbox/checkbox.ionic.css +536 -0
  384. package/dist/collection/components/checkbox/checkbox.ios.css +246 -115
  385. package/dist/collection/components/checkbox/checkbox.js +172 -157
  386. package/dist/collection/components/checkbox/checkbox.md.css +247 -116
  387. package/dist/collection/components/chip/chip.ionic.css +217 -0
  388. package/dist/collection/components/chip/chip.ios.css +67 -14
  389. package/dist/collection/components/chip/chip.js +116 -20
  390. package/dist/collection/components/chip/chip.md.css +67 -14
  391. package/dist/collection/components/col/col.css +192 -4
  392. package/dist/collection/components/col/col.js +212 -186
  393. package/dist/collection/components/content/content.css +47 -2
  394. package/dist/collection/components/content/content.js +78 -102
  395. package/dist/collection/components/datetime/datetime.ionic.css +703 -0
  396. package/dist/collection/components/datetime/datetime.ios.css +304 -148
  397. package/dist/collection/components/datetime/datetime.js +900 -1090
  398. package/dist/collection/components/datetime/datetime.md.css +294 -138
  399. package/dist/collection/components/datetime/utils/data.js +19 -18
  400. package/dist/collection/components/datetime/utils/format.js +11 -21
  401. package/dist/collection/components/datetime/utils/manipulation.js +8 -8
  402. package/dist/collection/components/datetime/utils/parse.js +10 -10
  403. package/dist/collection/components/datetime/utils/state.js +2 -8
  404. package/dist/collection/components/datetime/utils/validate.js +5 -4
  405. package/dist/collection/components/datetime-button/datetime-button.ios.css +6 -5
  406. package/dist/collection/components/datetime-button/datetime-button.js +246 -253
  407. package/dist/collection/components/datetime-button/datetime-button.md.css +6 -5
  408. package/dist/collection/components/divider/divider.ionic.css +148 -0
  409. package/dist/collection/components/divider/divider.ios.css +87 -0
  410. package/dist/collection/components/divider/divider.js +94 -0
  411. package/dist/collection/components/divider/divider.md.css +87 -0
  412. package/dist/collection/components/fab/fab.css +25 -1
  413. package/dist/collection/components/fab/fab.js +22 -25
  414. package/dist/collection/components/fab-button/fab-button.ios.css +18 -6
  415. package/dist/collection/components/fab-button/fab-button.js +79 -117
  416. package/dist/collection/components/fab-button/fab-button.md.css +20 -8
  417. package/dist/collection/components/fab-list/fab-list.css +12 -0
  418. package/dist/collection/components/fab-list/fab-list.js +20 -15
  419. package/dist/collection/components/footer/footer-interface.js +1 -0
  420. package/dist/collection/components/footer/footer.ios.css +33 -6
  421. package/dist/collection/components/footer/footer.js +151 -65
  422. package/dist/collection/components/footer/footer.md.css +40 -0
  423. package/dist/collection/components/gallery/gallery-constants.js +12 -0
  424. package/dist/collection/components/gallery/gallery-interface.js +1 -0
  425. package/dist/collection/components/gallery/gallery.css +15 -0
  426. package/dist/collection/components/gallery/gallery.js +679 -0
  427. package/dist/collection/components/gallery/test/utils.js +100 -0
  428. package/dist/collection/components/gallery-item/gallery-item.css +49 -0
  429. package/dist/collection/components/gallery-item/gallery-item.js +99 -0
  430. package/dist/collection/components/grid/grid.css +12 -0
  431. package/dist/collection/components/grid/grid.js +15 -9
  432. package/dist/collection/components/header/header-interface.js +1 -0
  433. package/dist/collection/components/header/header.ionic.css +250 -0
  434. package/dist/collection/components/header/header.ios.css +178 -133
  435. package/dist/collection/components/header/header.js +202 -70
  436. package/dist/collection/components/header/header.md.css +199 -9
  437. package/dist/collection/components/header/header.utils.js +6 -13
  438. package/dist/collection/components/img/img.js +16 -34
  439. package/dist/collection/components/infinite-scroll/infinite-scroll.js +164 -76
  440. package/dist/collection/components/infinite-scroll-content/infinite-scroll-content.ios.css +12 -0
  441. package/dist/collection/components/infinite-scroll-content/infinite-scroll-content.js +19 -30
  442. package/dist/collection/components/infinite-scroll-content/infinite-scroll-content.md.css +12 -0
  443. package/dist/collection/components/input/input.ionic.css +891 -0
  444. package/dist/collection/components/input/input.ios.css +247 -191
  445. package/dist/collection/components/input/input.js +333 -357
  446. package/dist/collection/components/input/input.md.css +234 -285
  447. package/dist/collection/components/input-otp/input-otp.ionic.css +371 -0
  448. package/dist/collection/components/input-otp/input-otp.ios.css +105 -60
  449. package/dist/collection/components/input-otp/input-otp.js +437 -432
  450. package/dist/collection/components/input-otp/input-otp.md.css +105 -60
  451. package/dist/collection/components/input-password-toggle/input-password-toggle.ionic.css +78 -0
  452. package/dist/collection/components/input-password-toggle/input-password-toggle.js +51 -36
  453. package/dist/collection/components/input-password-toggle/input-password-toggle.native.css +61 -0
  454. package/dist/collection/components/item/item.ionic.css +496 -0
  455. package/dist/collection/components/item/item.ios.css +120 -80
  456. package/dist/collection/components/item/item.js +98 -113
  457. package/dist/collection/components/item/item.md.css +131 -79
  458. package/dist/collection/components/item-divider/item-divider.ios.css +18 -0
  459. package/dist/collection/components/item-divider/item-divider.js +21 -23
  460. package/dist/collection/components/item-divider/item-divider.md.css +18 -0
  461. package/dist/collection/components/item-group/item-group.ios.css +12 -0
  462. package/dist/collection/components/item-group/item-group.js +13 -7
  463. package/dist/collection/components/item-group/item-group.md.css +12 -0
  464. package/dist/collection/components/item-option/item-option.ionic.css +277 -0
  465. package/dist/collection/components/item-option/item-option.ios.css +136 -29
  466. package/dist/collection/components/item-option/item-option.js +92 -56
  467. package/dist/collection/components/item-option/item-option.md.css +136 -29
  468. package/dist/collection/components/item-options/item-options.ionic.css +221 -0
  469. package/dist/collection/components/item-options/item-options.ios.css +77 -34
  470. package/dist/collection/components/item-options/item-options.js +20 -17
  471. package/dist/collection/components/item-options/item-options.md.css +77 -34
  472. package/dist/collection/components/item-sliding/item-sliding.ionic.css +211 -0
  473. package/dist/collection/components/item-sliding/item-sliding.js +441 -61
  474. package/dist/collection/components/item-sliding/{item-sliding.css → item-sliding.native.css} +84 -9
  475. package/dist/collection/components/item-sliding/test/test.utils.js +13 -0
  476. package/dist/collection/components/label/label.ios.css +18 -0
  477. package/dist/collection/components/label/label.js +15 -32
  478. package/dist/collection/components/label/label.md.css +18 -0
  479. package/dist/collection/components/list/list.ionic.css +212 -0
  480. package/dist/collection/components/list/list.ios.css +54 -14
  481. package/dist/collection/components/list/list.js +55 -19
  482. package/dist/collection/components/list/list.md.css +56 -16
  483. package/dist/collection/components/list-header/list-header.ionic.css +190 -0
  484. package/dist/collection/components/list-header/list-header.ios.css +82 -38
  485. package/dist/collection/components/list-header/list-header.js +11 -18
  486. package/dist/collection/components/list-header/list-header.md.css +82 -38
  487. package/dist/collection/components/loading/loading.ios.css +13 -1
  488. package/dist/collection/components/loading/loading.js +62 -143
  489. package/dist/collection/components/loading/loading.md.css +13 -1
  490. package/dist/collection/components/menu/menu.ios.css +15 -3
  491. package/dist/collection/components/menu/menu.js +71 -108
  492. package/dist/collection/components/menu/menu.md.css +15 -3
  493. package/dist/collection/components/menu-button/menu-button.ionic.css +236 -0
  494. package/dist/collection/components/menu-button/menu-button.ios.css +48 -14
  495. package/dist/collection/components/menu-button/menu-button.js +43 -38
  496. package/dist/collection/components/menu-button/menu-button.md.css +49 -15
  497. package/dist/collection/components/menu-toggle/menu-toggle.js +21 -25
  498. package/dist/collection/components/modal/animations/ionic.enter.js +40 -0
  499. package/dist/collection/components/modal/animations/ionic.leave.js +28 -0
  500. package/dist/collection/components/modal/animations/ios.enter.js +1 -1
  501. package/dist/collection/components/modal/animations/md.enter.js +1 -1
  502. package/dist/collection/components/modal/animations/sheet.js +8 -2
  503. package/dist/collection/components/modal/gestures/sheet.js +86 -32
  504. package/dist/collection/components/modal/gestures/swipe-to-close.js +3 -15
  505. package/dist/collection/components/modal/modal.ionic.css +255 -0
  506. package/dist/collection/components/modal/modal.ios.css +178 -70
  507. package/dist/collection/components/modal/modal.js +272 -404
  508. package/dist/collection/components/modal/modal.md.css +178 -70
  509. package/dist/collection/components/modal/safe-area-utils.js +7 -6
  510. package/dist/collection/components/modal/test/fixtures.js +0 -3
  511. package/dist/collection/components/nav/nav.css +7 -1
  512. package/dist/collection/components/nav/nav.js +256 -72
  513. package/dist/collection/components/nav/view-controller.js +1 -7
  514. package/dist/collection/components/nav-link/nav-link.js +14 -21
  515. package/dist/collection/components/note/note.ios.css +12 -0
  516. package/dist/collection/components/note/note.js +11 -14
  517. package/dist/collection/components/note/note.md.css +12 -0
  518. package/dist/collection/components/picker/picker.ios.css +15 -3
  519. package/dist/collection/components/picker/picker.js +398 -403
  520. package/dist/collection/components/picker/picker.md.css +15 -3
  521. package/dist/collection/components/picker-column/picker-column.css +9 -5
  522. package/dist/collection/components/picker-column/picker-column.js +409 -418
  523. package/dist/collection/components/picker-column-option/picker-column-option.ios.css +6 -0
  524. package/dist/collection/components/picker-column-option/picker-column-option.js +42 -38
  525. package/dist/collection/components/picker-column-option/picker-column-option.md.css +7 -6
  526. package/dist/collection/components/picker-legacy/animations/ios.enter.js +27 -0
  527. package/dist/collection/components/picker-legacy/animations/ios.leave.js +23 -0
  528. package/dist/collection/components/picker-legacy/picker-interface.js +1 -0
  529. package/dist/collection/components/picker-legacy/picker.ios.css +312 -0
  530. package/dist/collection/components/picker-legacy/picker.js +891 -0
  531. package/dist/collection/components/picker-legacy/picker.md.css +299 -0
  532. package/dist/collection/components/picker-legacy-column/picker-column.ios.css +243 -0
  533. package/dist/collection/components/picker-legacy-column/picker-column.js +422 -0
  534. package/dist/collection/components/picker-legacy-column/picker-column.md.css +234 -0
  535. package/dist/collection/components/picker-legacy-column/test/test.utils.js +43 -0
  536. package/dist/collection/components/popover/animations/ios.enter.js +2 -1
  537. package/dist/collection/components/popover/animations/md.enter.js +2 -1
  538. package/dist/collection/components/popover/popover.ionic.css +290 -0
  539. package/dist/collection/components/popover/popover.ios.css +15 -2
  540. package/dist/collection/components/popover/popover.js +199 -313
  541. package/dist/collection/components/popover/popover.md.css +15 -2
  542. package/dist/collection/components/popover/test/fixture.js +0 -1
  543. package/dist/collection/components/popover/utils.js +6 -4
  544. package/dist/collection/components/progress-bar/progress-bar.ionic.css +287 -0
  545. package/dist/collection/components/progress-bar/progress-bar.ios.css +48 -17
  546. package/dist/collection/components/progress-bar/progress-bar.js +65 -33
  547. package/dist/collection/components/progress-bar/progress-bar.md.css +48 -17
  548. package/dist/collection/components/radio/radio.ionic.css +422 -0
  549. package/dist/collection/components/radio/radio.ios.css +207 -102
  550. package/dist/collection/components/radio/radio.js +77 -108
  551. package/dist/collection/components/radio/radio.md.css +207 -102
  552. package/dist/collection/components/radio-group/radio-group.ionic.css +119 -0
  553. package/dist/collection/components/radio-group/radio-group.ios.css +43 -19
  554. package/dist/collection/components/radio-group/radio-group.js +113 -107
  555. package/dist/collection/components/radio-group/radio-group.md.css +43 -19
  556. package/dist/collection/components/radio-group/test/fixtures.js +0 -2
  557. package/dist/collection/components/range/range.ionic.css +567 -0
  558. package/dist/collection/components/range/range.ios.css +128 -85
  559. package/dist/collection/components/range/range.js +247 -305
  560. package/dist/collection/components/range/range.md.css +128 -85
  561. package/dist/collection/components/refresher/refresher.ios.css +14 -1
  562. package/dist/collection/components/refresher/refresher.js +88 -117
  563. package/dist/collection/components/refresher/refresher.md.css +15 -2
  564. package/dist/collection/components/refresher-content/refresher-content.js +37 -47
  565. package/dist/collection/components/reorder/reorder.ios.css +6 -0
  566. package/dist/collection/components/reorder/reorder.js +26 -7
  567. package/dist/collection/components/reorder/reorder.md.css +6 -0
  568. package/dist/collection/components/reorder-group/reorder-group.css +6 -0
  569. package/dist/collection/components/reorder-group/reorder-group.js +22 -47
  570. package/dist/collection/components/ripple-effect/{ripple-effect.css → ripple-effect.common.css} +7 -1
  571. package/dist/collection/components/ripple-effect/ripple-effect.ionic.css +215 -0
  572. package/dist/collection/components/ripple-effect/ripple-effect.js +26 -17
  573. package/dist/collection/components/route/route.js +14 -39
  574. package/dist/collection/components/route-redirect/route-redirect.js +0 -31
  575. package/dist/collection/components/router/router.js +37 -37
  576. package/dist/collection/components/router/utils/dom.js +7 -25
  577. package/dist/collection/components/router/utils/matching.js +9 -7
  578. package/dist/collection/components/router/utils/parser.js +1 -1
  579. package/dist/collection/components/router/utils/path.js +1 -0
  580. package/dist/collection/components/router-link/router-link.css +8 -2
  581. package/dist/collection/components/router-link/router-link.js +19 -40
  582. package/dist/collection/components/router-outlet/router-outlet.css +7 -1
  583. package/dist/collection/components/router-outlet/router-outlet.js +25 -83
  584. package/dist/collection/components/row/row.css +16 -0
  585. package/dist/collection/components/row/row.js +9 -2
  586. package/dist/collection/components/searchbar/searchbar.ionic.css +622 -0
  587. package/dist/collection/components/searchbar/searchbar.ios.css +56 -18
  588. package/dist/collection/components/searchbar/searchbar.js +356 -321
  589. package/dist/collection/components/searchbar/searchbar.md.css +56 -18
  590. package/dist/collection/components/segment/segment.ionic.css +115 -0
  591. package/dist/collection/components/segment/segment.ios.css +45 -2
  592. package/dist/collection/components/segment/segment.js +94 -126
  593. package/dist/collection/components/segment/segment.md.css +45 -2
  594. package/dist/collection/components/segment-button/segment-button.ionic.css +352 -0
  595. package/dist/collection/components/segment-button/segment-button.ios.css +146 -105
  596. package/dist/collection/components/segment-button/segment-button.js +46 -49
  597. package/dist/collection/components/segment-button/segment-button.md.css +148 -107
  598. package/dist/collection/components/segment-content/segment-content.js +1 -1
  599. package/dist/collection/components/segment-view/segment-view.ios.css +6 -0
  600. package/dist/collection/components/segment-view/segment-view.js +27 -28
  601. package/dist/collection/components/segment-view/segment-view.md.css +6 -0
  602. package/dist/collection/components/select/select.ionic.css +809 -0
  603. package/dist/collection/components/select/select.ios.css +351 -206
  604. package/dist/collection/components/select/select.js +431 -431
  605. package/dist/collection/components/select/select.md.css +383 -230
  606. package/dist/collection/components/select-modal/select-modal.ionic.css +257 -0
  607. package/dist/collection/components/select-modal/select-modal.ios.css +293 -45
  608. package/dist/collection/components/select-modal/select-modal.js +81 -37
  609. package/dist/collection/components/select-modal/select-modal.md.css +273 -43
  610. package/dist/collection/components/select-modal/test/fixtures.js +1 -8
  611. package/dist/collection/components/select-option/select-option.js +15 -48
  612. package/dist/collection/components/select-popover/select-popover.ionic.css +255 -0
  613. package/dist/collection/components/select-popover/select-popover.ios.css +188 -124
  614. package/dist/collection/components/select-popover/select-popover.js +37 -44
  615. package/dist/collection/components/select-popover/select-popover.md.css +228 -47
  616. package/dist/collection/components/select-popover/test/fixtures.js +1 -8
  617. package/dist/collection/components/skeleton-text/skeleton-text.css +6 -0
  618. package/dist/collection/components/skeleton-text/skeleton-text.js +15 -15
  619. package/dist/collection/components/spinner/{spinner.css → spinner.ionic.css} +78 -10
  620. package/dist/collection/components/spinner/spinner.js +55 -26
  621. package/dist/collection/components/spinner/spinner.native.css +199 -0
  622. package/dist/collection/components/split-pane/split-pane.ios.css +20 -2
  623. package/dist/collection/components/split-pane/split-pane.js +28 -33
  624. package/dist/collection/components/split-pane/split-pane.md.css +20 -2
  625. package/dist/collection/components/tab/tab.js +10 -17
  626. package/dist/collection/components/tab-bar/tab-bar.ionic.css +249 -0
  627. package/dist/collection/components/tab-bar/tab-bar.ios.css +86 -43
  628. package/dist/collection/components/tab-bar/tab-bar.js +190 -44
  629. package/dist/collection/components/tab-bar/tab-bar.md.css +86 -43
  630. package/dist/collection/components/tab-button/tab-button.ionic.css +373 -0
  631. package/dist/collection/components/tab-button/tab-button.ios.css +171 -95
  632. package/dist/collection/components/tab-button/tab-button.js +74 -68
  633. package/dist/collection/components/tab-button/tab-button.md.css +137 -93
  634. package/dist/collection/components/tabs/tabs.css +7 -1
  635. package/dist/collection/components/tabs/tabs.js +23 -33
  636. package/dist/collection/components/text/text.css +6 -0
  637. package/dist/collection/components/text/text.js +7 -12
  638. package/dist/collection/components/textarea/textarea.ionic.css +898 -0
  639. package/dist/collection/components/textarea/textarea.ios.css +329 -221
  640. package/dist/collection/components/textarea/textarea.js +334 -302
  641. package/dist/collection/components/textarea/textarea.md.css +358 -231
  642. package/dist/collection/components/thumbnail/thumbnail.css +6 -0
  643. package/dist/collection/components/thumbnail/thumbnail.js +9 -2
  644. package/dist/collection/components/title/title.ionic.css +127 -0
  645. package/dist/collection/components/title/title.ios.css +32 -4
  646. package/dist/collection/components/title/title.js +13 -23
  647. package/dist/collection/components/title/title.md.css +39 -4
  648. package/dist/collection/components/toast/animations/utils.js +1 -1
  649. package/dist/collection/components/toast/toast.ionic.css +394 -0
  650. package/dist/collection/components/toast/toast.ios.css +84 -45
  651. package/dist/collection/components/toast/toast.js +178 -232
  652. package/dist/collection/components/toast/toast.md.css +84 -45
  653. package/dist/collection/components/toggle/toggle.ionic.css +512 -0
  654. package/dist/collection/components/toggle/toggle.ios.css +247 -127
  655. package/dist/collection/components/toggle/toggle.js +164 -175
  656. package/dist/collection/components/toggle/toggle.md.css +245 -127
  657. package/dist/collection/components/toolbar/test/image.svg +1 -0
  658. package/dist/collection/components/toolbar/toolbar.ionic.css +249 -0
  659. package/dist/collection/components/toolbar/toolbar.ios.css +90 -47
  660. package/dist/collection/components/toolbar/toolbar.js +222 -25
  661. package/dist/collection/components/toolbar/toolbar.md.css +90 -47
  662. package/dist/collection/global/config.js +6 -4
  663. package/dist/collection/global/ionic-global.js +242 -20
  664. package/dist/collection/index.js +1 -1
  665. package/dist/collection/utils/animation/animation.js +3 -3
  666. package/dist/collection/utils/config.js +4 -5
  667. package/dist/collection/utils/css-value-validation.js +39 -0
  668. package/dist/collection/utils/focus-controller/index.js +1 -1
  669. package/dist/collection/utils/focus-trap.js +16 -5
  670. package/dist/collection/utils/focus-visible.js +22 -0
  671. package/dist/collection/utils/forms/clear-button-press-controller.js +40 -0
  672. package/dist/collection/utils/forms/index.js +1 -1
  673. package/dist/collection/utils/forms/validity.js +31 -0
  674. package/dist/collection/utils/framework-delegate.js +9 -5
  675. package/dist/collection/utils/gesture/gesture-controller.js +8 -15
  676. package/dist/collection/utils/gesture/index.js +2 -10
  677. package/dist/collection/utils/hardware-back-button.js +18 -3
  678. package/dist/collection/utils/helpers.js +72 -5
  679. package/dist/collection/utils/input-shims/hacks/scroll-assist.js +5 -4
  680. package/dist/collection/utils/input-shims/hacks/scroll-data.js +2 -1
  681. package/dist/collection/utils/keyboard/keyboard-controller.js +8 -6
  682. package/dist/collection/utils/keyboard/keyboard.js +1 -1
  683. package/dist/collection/utils/logging/index.js +4 -23
  684. package/dist/collection/utils/media.js +1 -0
  685. package/dist/collection/utils/menu-controller/animations/overlay.js +3 -3
  686. package/dist/collection/utils/menu-controller/animations/push.js +2 -1
  687. package/dist/collection/utils/menu-controller/animations/reveal.js +2 -1
  688. package/dist/collection/utils/menu-controller/index.js +2 -1
  689. package/dist/collection/utils/native/haptic.js +3 -2
  690. package/dist/collection/utils/native/keyboard.js +2 -2
  691. package/dist/collection/utils/native/status-bar.js +1 -1
  692. package/dist/collection/utils/overlay-control-label.js +13 -11
  693. package/dist/collection/utils/overlays.js +312 -45
  694. package/dist/collection/utils/platform.js +5 -4
  695. package/dist/collection/utils/rtl/dir.js +3 -2
  696. package/dist/collection/utils/sanitization/index.js +2 -2
  697. package/dist/collection/utils/scroll-hide-controller.js +178 -0
  698. package/dist/collection/utils/select-option-render.js +2 -1
  699. package/dist/collection/utils/slot-mutation-controller.js +2 -1
  700. package/dist/collection/utils/test/playwright/apply-keyboard-focus.js +1 -1
  701. package/dist/collection/utils/test/playwright/drag-element.js +35 -11
  702. package/dist/collection/utils/test/playwright/generator.js +51 -25
  703. package/dist/collection/utils/test/playwright/page/event-spy.js +12 -11
  704. package/dist/collection/utils/test/playwright/page/utils/goto.js +15 -5
  705. package/dist/collection/utils/test/playwright/page/utils/set-content.js +27 -4
  706. package/dist/collection/utils/test/playwright/page/utils/set-ion-viewport.js +3 -2
  707. package/dist/collection/utils/test/press-keys.js +17 -10
  708. package/dist/collection/utils/theme.js +26 -7
  709. package/dist/collection/utils/transition/ios.transition.js +14 -9
  710. package/dist/collection/utils/transition/md.transition.js +4 -3
  711. package/dist/docs.json +10054 -537
  712. package/dist/esm/{animation-CGFdmGk9.js → animation-BsVixxLP.js} +5 -5
  713. package/dist/esm/{app-globals-CYmMeGdU.js → app-globals-rPvWQFXp.js} +1 -1
  714. package/dist/esm/{button-active-BDOsVAiZ.js → button-active-BS8YgJRD.js} +3 -3
  715. package/dist/esm/{capacitor-CFERIeaU.js → capacitor-BnXrCBvt.js} +1 -1
  716. package/dist/esm/clear-button-press-controller-Ci6Q_x5-.js +43 -0
  717. package/dist/esm/{config-DWCzVL3Y.js → config-BwKpO3Is.js} +4 -5
  718. package/dist/esm/{dir-Dojwmvde.js → dir-o8OKV5aD.js} +3 -2
  719. package/dist/esm/{focus-visible-BmVRXR1y.js → focus-visible-vXpMhGrs.js} +23 -1
  720. package/dist/esm/{format-Dcwga61t.js → format-2WlZcMvG.js} +31 -41
  721. package/dist/esm/{framework-delegate-BHTU2Ip9.js → framework-delegate-P5K_3uYw.js} +10 -6
  722. package/dist/esm/{gesture-controller-TXPDHL13.js → gesture-controller-BTEOs1at.js} +8 -15
  723. package/dist/esm/{haptic-Cq4UAeka.js → haptic-ByW74Ow9.js} +4 -3
  724. package/dist/esm/{helpers-CAGf8Wgp.js → helpers-ChPZH7zh.js} +74 -8
  725. package/dist/esm/{index-DcPaH5uL.js → index-Bck1OwMs.js} +3 -9
  726. package/dist/esm/{index-ChhhtsGZ.js → index-C0EQceqV.js} +66 -34
  727. package/dist/esm/{index-Clc-28O1.js → index-C7EAbm0C.js} +5 -4
  728. package/dist/esm/{index-CqneaaGd.js → index-C7F1yJyV.js} +13 -12
  729. package/dist/esm/{index-WlteAIqz.js → index-CXSPjEca.js} +5 -5
  730. package/dist/esm/{index-CKM1DdGm.js → index-Mq5pCWmZ.js} +3 -3
  731. package/dist/esm/{index-BvabGprD.js → index-PnwG0glX.js} +2 -1
  732. package/dist/esm/{index-T0JxBI8V.js → index-niemeDYi.js} +2 -2
  733. package/dist/esm/index.js +17 -18
  734. package/dist/esm/{input-shims-B8sfni1e.js → input-shims-CM5m0K8T.js} +15 -12
  735. package/dist/esm/input.utils-DhJNJPiU.js +147 -0
  736. package/dist/esm/ion-accordion_2.entry.js +376 -376
  737. package/dist/esm/ion-action-sheet.entry.js +87 -179
  738. package/dist/esm/ion-alert.entry.js +126 -251
  739. package/dist/esm/ion-app_8.entry.js +607 -460
  740. package/dist/esm/ion-avatar_3.entry.js +125 -19
  741. package/dist/esm/ion-back-button.entry.js +49 -65
  742. package/dist/esm/ion-backdrop.entry.js +22 -23
  743. package/dist/esm/ion-breadcrumb_2.entry.js +157 -210
  744. package/dist/esm/ion-button_2.entry.js +118 -153
  745. package/dist/esm/ion-card_5.entry.js +80 -110
  746. package/dist/esm/ion-checkbox.entry.js +134 -160
  747. package/dist/esm/ion-chip.entry.js +56 -21
  748. package/dist/esm/ion-col_3.entry.js +61 -186
  749. package/dist/esm/ion-datetime-button.entry.js +248 -256
  750. package/dist/esm/ion-datetime_3.entry.js +3206 -0
  751. package/dist/esm/ion-divider.entry.js +49 -0
  752. package/dist/esm/ion-fab_3.entry.js +109 -155
  753. package/dist/esm/ion-gallery-item.entry.js +57 -0
  754. package/dist/esm/ion-gallery.entry.js +606 -0
  755. package/dist/esm/ion-img.entry.js +17 -35
  756. package/dist/esm/ion-infinite-scroll_2.entry.js +157 -109
  757. package/dist/esm/ion-input-otp.entry.js +437 -435
  758. package/dist/esm/ion-input-password-toggle.entry.js +54 -40
  759. package/dist/esm/ion-input.entry.js +303 -349
  760. package/dist/esm/ion-item-option_3.entry.js +512 -137
  761. package/dist/esm/ion-item_8.entry.js +186 -218
  762. package/dist/esm/ion-loading.entry.js +69 -152
  763. package/dist/esm/ion-menu_3.entry.js +136 -182
  764. package/dist/esm/ion-modal.entry.js +459 -529
  765. package/dist/esm/ion-nav_2.entry.js +164 -104
  766. package/dist/esm/ion-picker-column-option.entry.js +40 -40
  767. package/dist/esm/ion-picker-column.entry.js +410 -422
  768. package/dist/esm/ion-picker.entry.js +401 -406
  769. package/dist/esm/ion-popover.entry.js +212 -324
  770. package/dist/esm/ion-progress-bar.entry.js +48 -36
  771. package/dist/esm/ion-radio_2.entry.js +162 -217
  772. package/dist/esm/ion-range.entry.js +251 -309
  773. package/dist/esm/ion-refresher_2.entry.js +127 -175
  774. package/dist/esm/ion-reorder_2.entry.js +47 -60
  775. package/dist/esm/ion-ripple-effect.entry.js +26 -18
  776. package/dist/esm/ion-route_4.entry.js +76 -179
  777. package/dist/esm/ion-searchbar.entry.js +305 -308
  778. package/dist/esm/ion-segment-content.entry.js +2 -2
  779. package/dist/esm/ion-segment-view.entry.js +27 -28
  780. package/dist/esm/ion-segment_2.entry.js +141 -177
  781. package/dist/esm/ion-select-modal.entry.js +71 -50
  782. package/dist/esm/ion-select_3.entry.js +416 -507
  783. package/dist/esm/ion-spinner.entry.js +36 -28
  784. package/dist/esm/ion-split-pane.entry.js +25 -34
  785. package/dist/esm/ion-tab-bar_2.entry.js +179 -116
  786. package/dist/esm/ion-tab_2.entry.js +30 -55
  787. package/dist/esm/ion-text.entry.js +7 -13
  788. package/dist/esm/ion-textarea.entry.js +309 -302
  789. package/dist/esm/ion-toast.entry.js +149 -244
  790. package/dist/esm/ion-toggle.entry.js +172 -184
  791. package/dist/esm/ionic-global-BJDU78B6.js +508 -0
  792. package/dist/esm/ionic.js +5 -5
  793. package/dist/esm/{ios.transition-DXRCmcbC.js → ios.transition-6oGu53GR.js} +21 -15
  794. package/dist/esm/{item-multiple-inputs-rU8VaNNg.js → item-multiple-inputs-C6onMFOo.js} +1 -1
  795. package/dist/esm/{keyboard-Cj8mLJeq.js → keyboard-XukEYIFf.js} +5 -4
  796. package/dist/esm/{keyboard-DAF8GNJ9.js → keyboard-x-uHYVoq.js} +3 -3
  797. package/dist/esm/loader.js +5 -5
  798. package/dist/esm/{md.transition-BMngO4i_.js → md.transition-Dy5HxiSE.js} +11 -9
  799. package/dist/esm/notch-controller-BYB7mUMg.js +153 -0
  800. package/dist/esm/{overlay-control-label-BSQPZ79H.js → overlay-control-label-CODBQrPj.js} +13 -11
  801. package/dist/esm/{overlays-CPmIs9Ls.js → overlays-C3YvaMgX.js} +333 -57
  802. package/dist/esm/scroll-hide-controller-B3MRYNXh.js +342 -0
  803. package/dist/esm/{select-option-render-C4m76VGH.js → select-option-render-BlKZ2H83.js} +4 -3
  804. package/dist/esm/{status-tap-CHB7KwIb.js → status-tap-DK-ylvU7.js} +5 -4
  805. package/dist/esm/{swipe-back-C9HW1bug.js → swipe-back-DFICtpMC.js} +6 -5
  806. package/dist/esm/theme-DaJxRxSQ.js +67 -0
  807. package/dist/esm/validity-BjW8SOqw.js +48 -0
  808. package/dist/html.html-data.json +2690 -123
  809. package/dist/ionic/index.esm.js +1 -1
  810. package/dist/ionic/ionic.esm.js +1 -1
  811. package/dist/ionic/p--sroV-k-.js +4 -0
  812. package/dist/ionic/p-0115c2fa.entry.js +4 -0
  813. package/dist/ionic/p-0ac15b5f.entry.js +4 -0
  814. package/dist/ionic/p-0b2c58e0.entry.js +4 -0
  815. package/dist/ionic/p-0bfb8d9e.entry.js +4 -0
  816. package/dist/ionic/p-1147fa06.entry.js +4 -0
  817. package/dist/ionic/p-1e45586e.entry.js +4 -0
  818. package/dist/ionic/p-1febf200.entry.js +4 -0
  819. package/dist/ionic/p-208cecae.entry.js +4 -0
  820. package/dist/ionic/p-29f69d29.entry.js +4 -0
  821. package/dist/ionic/p-2b5e04c5.entry.js +4 -0
  822. package/dist/ionic/p-311ef139.entry.js +4 -0
  823. package/dist/ionic/p-3eff3411.entry.js +4 -0
  824. package/dist/ionic/p-3f17704b.entry.js +4 -0
  825. package/dist/ionic/p-46e754ae.entry.js +4 -0
  826. package/dist/ionic/p-4901a10b.entry.js +4 -0
  827. package/dist/ionic/p-4c8178d8.entry.js +4 -0
  828. package/dist/ionic/p-5196bee9.entry.js +4 -0
  829. package/dist/ionic/p-5386b094.entry.js +4 -0
  830. package/dist/ionic/p-54579b68.entry.js +4 -0
  831. package/dist/ionic/p-54baa1af.entry.js +4 -0
  832. package/dist/ionic/p-59e59209.entry.js +4 -0
  833. package/dist/ionic/p-5ad0c670.entry.js +4 -0
  834. package/dist/ionic/p-62602fbd.entry.js +4 -0
  835. package/dist/ionic/p-6b86cb62.entry.js +4 -0
  836. package/dist/ionic/p-7134537b.entry.js +4 -0
  837. package/dist/ionic/p-72eacca0.entry.js +4 -0
  838. package/dist/ionic/p-7ae06f6f.entry.js +4 -0
  839. package/dist/ionic/p-7bde9ee1.entry.js +4 -0
  840. package/dist/ionic/p-7f59020c.entry.js +4 -0
  841. package/dist/ionic/p-7k7Q1A38.js +4 -0
  842. package/dist/ionic/p-87ab986c.entry.js +4 -0
  843. package/dist/ionic/p-9dff6288.entry.js +4 -0
  844. package/dist/ionic/p-9e09cb80.entry.js +4 -0
  845. package/dist/ionic/p-BFhQ1N-L.js +4 -0
  846. package/dist/ionic/p-BG7tpRhR.js +4 -0
  847. package/dist/ionic/p-BITyMTKr.js +4 -0
  848. package/dist/ionic/p-BRPONI7N.js +4 -0
  849. package/dist/ionic/p-BTEOs1at.js +4 -0
  850. package/dist/ionic/p-BVdSuKmt.js +4 -0
  851. package/dist/ionic/p-BYRVyMu9.js +4 -0
  852. package/dist/ionic/p-BjW8SOqw.js +4 -0
  853. package/dist/ionic/p-Bpx1lBiP.js +4 -0
  854. package/dist/ionic/p-BwKpO3Is.js +4 -0
  855. package/dist/ionic/p-C-BLhfUi.js +4 -0
  856. package/dist/ionic/p-C-aO35cw.js +4 -0
  857. package/dist/ionic/p-C0EQceqV.js +5 -0
  858. package/dist/ionic/p-CDrQfM-I.js +4 -0
  859. package/dist/ionic/p-CODBQrPj.js +4 -0
  860. package/dist/ionic/p-CTSaffvS.js +4 -0
  861. package/dist/ionic/p-CaM5HwzM.js +4 -0
  862. package/dist/ionic/p-CgaW5Zy8.js +4 -0
  863. package/dist/ionic/p-Cipl19Qe.js +4 -0
  864. package/dist/ionic/p-CnBfCmL2.js +4 -0
  865. package/dist/ionic/p-D-Xit5Ye.js +4 -0
  866. package/dist/ionic/p-D7LIC84Z.js +4 -0
  867. package/dist/ionic/p-D844sgjq.js +4 -0
  868. package/dist/ionic/p-DWDKFjrH.js +4 -0
  869. package/dist/ionic/p-DaJxRxSQ.js +4 -0
  870. package/dist/ionic/p-DhyWlGap.js +4 -0
  871. package/dist/ionic/p-DiyY-i-5.js +4 -0
  872. package/dist/ionic/p-DrxPmT9E.js +4 -0
  873. package/dist/ionic/p-PnwG0glX.js +4 -0
  874. package/dist/ionic/p-YIsE5bNG.js +4 -0
  875. package/dist/ionic/p-a320cdb2.entry.js +4 -0
  876. package/dist/ionic/p-a37444b3.entry.js +4 -0
  877. package/dist/ionic/p-a4bed36b.entry.js +4 -0
  878. package/dist/ionic/p-a7914fe5.entry.js +4 -0
  879. package/dist/ionic/p-aa298c58.entry.js +4 -0
  880. package/dist/ionic/p-ace3062d.entry.js +4 -0
  881. package/dist/ionic/p-b70775b0.entry.js +4 -0
  882. package/dist/ionic/p-b7c75507.entry.js +4 -0
  883. package/dist/ionic/p-b920f149.entry.js +4 -0
  884. package/dist/ionic/p-c39025c0.entry.js +4 -0
  885. package/dist/ionic/p-c9cda5ce.entry.js +4 -0
  886. package/dist/ionic/p-cc314123.entry.js +4 -0
  887. package/dist/ionic/p-d1f42864.entry.js +4 -0
  888. package/dist/ionic/p-d4506138.entry.js +4 -0
  889. package/dist/ionic/p-dbd06d8d.entry.js +4 -0
  890. package/dist/ionic/p-dda49380.entry.js +4 -0
  891. package/dist/ionic/p-de4e8418.entry.js +4 -0
  892. package/dist/ionic/p-e95618c4.entry.js +4 -0
  893. package/dist/ionic/p-f89fcf62.entry.js +4 -0
  894. package/dist/ionic/p-fcce2dda.entry.js +4 -0
  895. package/dist/ionic/p-fd2a869f.entry.js +4 -0
  896. package/dist/ionic/p-fd95a423.entry.js +4 -0
  897. package/dist/ionic/p-fe14205b.entry.js +4 -0
  898. package/dist/ionic/p-i6iV8hMy.js +4 -0
  899. package/dist/ionic/p-nUlpIttM.js +4 -0
  900. package/dist/ionic/p-o8OKV5aD.js +4 -0
  901. package/dist/ionic/p-vXpMhGrs.js +4 -0
  902. package/dist/ionic/p-zRFin7iz.js +4 -0
  903. package/dist/ionic/p-zn4qAQ_d.js +4 -0
  904. package/dist/types/components/accordion/accordion.d.ts +12 -3
  905. package/dist/types/components/accordion-group/accordion-group.d.ts +12 -1
  906. package/dist/types/components/action-sheet/action-sheet-interface.d.ts +3 -7
  907. package/dist/types/components/action-sheet/action-sheet.d.ts +3 -2
  908. package/dist/types/components/alert/alert-interface.d.ts +3 -7
  909. package/dist/types/components/alert/alert.d.ts +3 -2
  910. package/dist/types/components/app/app.d.ts +4 -5
  911. package/dist/types/components/avatar/avatar.d.ts +32 -0
  912. package/dist/types/components/back-button/back-button.d.ts +8 -1
  913. package/dist/types/components/backdrop/backdrop.d.ts +4 -0
  914. package/dist/types/components/badge/badge.d.ts +34 -1
  915. package/dist/types/components/breadcrumb/breadcrumb.d.ts +14 -1
  916. package/dist/types/components/breadcrumbs/breadcrumbs.d.ts +2 -2
  917. package/dist/types/components/button/button.d.ts +23 -8
  918. package/dist/types/components/buttons/buttons.d.ts +5 -1
  919. package/dist/types/components/card/card.d.ts +8 -1
  920. package/dist/types/components/card-content/card-content.d.ts +2 -1
  921. package/dist/types/components/card-header/card-header.d.ts +3 -2
  922. package/dist/types/components/card-subtitle/card-subtitle.d.ts +2 -1
  923. package/dist/types/components/card-title/card-title.d.ts +2 -1
  924. package/dist/types/components/checkbox/checkbox.d.ts +26 -5
  925. package/dist/types/components/chip/chip.d.ts +26 -1
  926. package/dist/types/components/col/col.d.ts +52 -5
  927. package/dist/types/components/content/content.d.ts +3 -0
  928. package/dist/types/components/datetime/datetime.d.ts +26 -1
  929. package/dist/types/components/datetime/utils/data.d.ts +5 -5
  930. package/dist/types/components/datetime-button/datetime-button.d.ts +2 -1
  931. package/dist/types/components/divider/divider.d.ts +20 -0
  932. package/dist/types/components/fab/fab.d.ts +4 -0
  933. package/dist/types/components/fab-button/fab-button.d.ts +11 -3
  934. package/dist/types/components/fab-list/fab-list.d.ts +4 -0
  935. package/dist/types/components/footer/footer-interface.d.ts +1 -0
  936. package/dist/types/components/footer/footer.d.ts +20 -3
  937. package/dist/types/components/gallery/gallery-constants.d.ts +9 -0
  938. package/dist/types/components/gallery/gallery-interface.d.ts +10 -0
  939. package/dist/types/components/gallery/gallery.d.ts +218 -0
  940. package/dist/types/components/gallery/test/utils.d.ts +3 -0
  941. package/dist/types/components/gallery-item/gallery-item.d.ts +33 -0
  942. package/dist/types/components/grid/grid.d.ts +4 -0
  943. package/dist/types/components/header/header-interface.d.ts +1 -0
  944. package/dist/types/components/header/header.d.ts +26 -3
  945. package/dist/types/components/header/header.utils.d.ts +4 -5
  946. package/dist/types/components/img/img.d.ts +2 -1
  947. package/dist/types/components/infinite-scroll/infinite-scroll.d.ts +21 -0
  948. package/dist/types/components/infinite-scroll-content/infinite-scroll-content.d.ts +4 -0
  949. package/dist/types/components/input/input.d.ts +40 -17
  950. package/dist/types/components/input-otp/input-otp.d.ts +37 -0
  951. package/dist/types/components/input-password-toggle/input-password-toggle.d.ts +14 -0
  952. package/dist/types/components/item/item.d.ts +17 -4
  953. package/dist/types/components/item-divider/item-divider.d.ts +2 -1
  954. package/dist/types/components/item-group/item-group.d.ts +4 -0
  955. package/dist/types/components/item-option/item-option.d.ts +18 -1
  956. package/dist/types/components/item-options/item-options.d.ts +4 -0
  957. package/dist/types/components/item-sliding/item-sliding.d.ts +47 -1
  958. package/dist/types/components/item-sliding/test/test.utils.d.ts +13 -0
  959. package/dist/types/components/label/label.d.ts +2 -1
  960. package/dist/types/components/list/list.d.ts +15 -1
  961. package/dist/types/components/list-header/list-header.d.ts +2 -1
  962. package/dist/types/components/loading/loading-interface.d.ts +2 -7
  963. package/dist/types/components/loading/loading.d.ts +3 -2
  964. package/dist/types/components/menu/menu.d.ts +3 -0
  965. package/dist/types/components/menu-button/menu-button.d.ts +8 -1
  966. package/dist/types/components/menu-toggle/menu-toggle.d.ts +3 -0
  967. package/dist/types/components/modal/animations/ionic.enter.d.ts +6 -0
  968. package/dist/types/components/modal/animations/ionic.leave.d.ts +6 -0
  969. package/dist/types/components/modal/gestures/sheet.d.ts +1 -1
  970. package/dist/types/components/modal/modal-interface.d.ts +4 -16
  971. package/dist/types/components/modal/modal.d.ts +15 -12
  972. package/dist/types/components/nav/nav-interface.d.ts +10 -1
  973. package/dist/types/components/nav/nav.d.ts +27 -3
  974. package/dist/types/components/nav-link/nav-link.d.ts +4 -0
  975. package/dist/types/components/note/note.d.ts +2 -1
  976. package/dist/types/components/picker/picker.d.ts +2 -1
  977. package/dist/types/components/picker-column/picker-column.d.ts +2 -1
  978. package/dist/types/components/picker-column-option/picker-column-option.d.ts +4 -0
  979. package/dist/types/components/picker-legacy/animations/ios.enter.d.ts +5 -0
  980. package/dist/types/components/picker-legacy/animations/ios.leave.d.ts +5 -0
  981. package/dist/types/components/picker-legacy/picker-interface.d.ts +52 -0
  982. package/dist/types/components/picker-legacy/picker.d.ts +159 -0
  983. package/dist/types/components/picker-legacy-column/picker-column.d.ts +46 -0
  984. package/dist/types/components/picker-legacy-column/test/test.utils.d.ts +9 -0
  985. package/dist/types/components/popover/popover-interface.d.ts +3 -6
  986. package/dist/types/components/popover/popover.d.ts +6 -5
  987. package/dist/types/components/progress-bar/progress-bar.d.ts +10 -1
  988. package/dist/types/components/radio/radio.d.ts +2 -1
  989. package/dist/types/components/radio-group/radio-group.d.ts +12 -0
  990. package/dist/types/components/range/range.d.ts +2 -1
  991. package/dist/types/components/refresher/refresher.d.ts +2 -1
  992. package/dist/types/components/refresher-content/refresher-content.d.ts +10 -0
  993. package/dist/types/components/reorder/reorder.d.ts +9 -0
  994. package/dist/types/components/reorder-group/reorder-group.d.ts +4 -0
  995. package/dist/types/components/ripple-effect/ripple-effect.d.ts +4 -0
  996. package/dist/types/components/route/route.d.ts +5 -1
  997. package/dist/types/components/router/router.d.ts +4 -0
  998. package/dist/types/components/router-link/router-link.d.ts +4 -0
  999. package/dist/types/components/router-outlet/router-outlet.d.ts +4 -8
  1000. package/dist/types/components/row/row.d.ts +4 -0
  1001. package/dist/types/components/searchbar/searchbar.d.ts +57 -11
  1002. package/dist/types/components/segment/segment.d.ts +2 -1
  1003. package/dist/types/components/segment-button/segment-button.d.ts +2 -1
  1004. package/dist/types/components/select/select.d.ts +55 -26
  1005. package/dist/types/components/select-modal/select-modal.d.ts +13 -0
  1006. package/dist/types/components/select-option/select-option.d.ts +7 -4
  1007. package/dist/types/components/select-popover/select-popover.d.ts +3 -0
  1008. package/dist/types/components/skeleton-text/skeleton-text.d.ts +4 -0
  1009. package/dist/types/components/spinner/spinner.d.ts +15 -0
  1010. package/dist/types/components/split-pane/split-pane.d.ts +4 -0
  1011. package/dist/types/components/tab/tab.d.ts +4 -0
  1012. package/dist/types/components/tab-bar/tab-bar-interface.d.ts +1 -0
  1013. package/dist/types/components/tab-bar/tab-bar.d.ts +41 -3
  1014. package/dist/types/components/tab-button/tab-button.d.ts +12 -1
  1015. package/dist/types/components/tabs/tabs.d.ts +3 -0
  1016. package/dist/types/components/text/text.d.ts +2 -1
  1017. package/dist/types/components/textarea/textarea.d.ts +58 -16
  1018. package/dist/types/components/thumbnail/thumbnail.d.ts +4 -0
  1019. package/dist/types/components/title/title.d.ts +4 -0
  1020. package/dist/types/components/toast/animations/utils.d.ts +2 -2
  1021. package/dist/types/components/toast/toast-interface.d.ts +3 -7
  1022. package/dist/types/components/toast/toast.d.ts +19 -2
  1023. package/dist/types/components/toggle/toggle.d.ts +18 -1
  1024. package/dist/types/components/toolbar/toolbar.d.ts +43 -3
  1025. package/dist/types/components.d.ts +2171 -263
  1026. package/dist/types/global/ionic-global.d.ts +28 -2
  1027. package/dist/types/index.d.ts +1 -1
  1028. package/dist/types/interface.d.ts +4 -0
  1029. package/dist/types/utils/config.d.ts +133 -3
  1030. package/dist/types/utils/css-value-validation.d.ts +21 -0
  1031. package/dist/types/utils/focus-trap.d.ts +1 -1
  1032. package/dist/types/utils/focus-visible.d.ts +13 -0
  1033. package/dist/types/utils/forms/clear-button-press-controller.d.ts +20 -0
  1034. package/dist/types/utils/forms/index.d.ts +1 -1
  1035. package/dist/types/utils/forms/validity.d.ts +7 -0
  1036. package/dist/types/utils/helpers.d.ts +22 -0
  1037. package/dist/types/utils/logging/index.d.ts +1 -2
  1038. package/dist/types/utils/overlay-control-label.d.ts +11 -9
  1039. package/dist/types/utils/overlays-interface.d.ts +31 -1
  1040. package/dist/types/utils/overlays.d.ts +10 -12
  1041. package/dist/types/utils/scroll-hide-controller.d.ts +56 -0
  1042. package/dist/types/utils/test/playwright/drag-element.d.ts +16 -3
  1043. package/dist/types/utils/test/playwright/generator.d.ts +31 -2
  1044. package/dist/types/utils/test/playwright/playwright-page.d.ts +1 -1
  1045. package/dist/types/utils/test/playwright/testExpect.d.ts +1 -1
  1046. package/dist/types/utils/theme.d.ts +9 -0
  1047. package/hydrate/index.js +12008 -10485
  1048. package/hydrate/index.mjs +12008 -10485
  1049. package/package.json +16 -56
  1050. package/components/p--m5cCjbK.js +0 -4
  1051. package/components/p-1jI5oW-W.js +0 -4
  1052. package/components/p-8FN7p701.js +0 -4
  1053. package/components/p-B4uHHhPK.js +0 -4
  1054. package/components/p-BMPN55of.js +0 -4
  1055. package/components/p-BNJOu1Q2.js +0 -4
  1056. package/components/p-BOvLNVKq.js +0 -4
  1057. package/components/p-BSQPZ79H.js +0 -4
  1058. package/components/p-BeamQXHF.js +0 -4
  1059. package/components/p-BhamHSw3.js +0 -4
  1060. package/components/p-Bjig0DJK.js +0 -4
  1061. package/components/p-BjluhQMI.js +0 -4
  1062. package/components/p-BlsIikdZ.js +0 -4
  1063. package/components/p-BmVRXR1y.js +0 -4
  1064. package/components/p-BqPNzJf6.js +0 -4
  1065. package/components/p-BrD9Xv62.js +0 -4
  1066. package/components/p-BvJqoZ5R.js +0 -4
  1067. package/components/p-Bz6z3Asd.js +0 -4
  1068. package/components/p-C5KYjZWD.js +0 -4
  1069. package/components/p-C6HnVvHO.js +0 -4
  1070. package/components/p-C7jvh5Wy.js +0 -4
  1071. package/components/p-C9BGR5fy.js +0 -4
  1072. package/components/p-CB-y1CdP.js +0 -4
  1073. package/components/p-CEW4RXZO.js +0 -4
  1074. package/components/p-CHH3loEE.js +0 -4
  1075. package/components/p-CIGNaXM1.js +0 -4
  1076. package/components/p-CJKUWjmg.js +0 -4
  1077. package/components/p-C_phlPMC.js +0 -4
  1078. package/components/p-CbhUdtjf.js +0 -4
  1079. package/components/p-CejmQs3h.js +0 -4
  1080. package/components/p-CtZqa4HM.js +0 -4
  1081. package/components/p-D7-vHX0A.js +0 -4
  1082. package/components/p-D9qIVSWm.js +0 -4
  1083. package/components/p-DD5fQ4EQ.js +0 -4
  1084. package/components/p-DE-3iMNW.js +0 -4
  1085. package/components/p-DFvZn99E.js +0 -4
  1086. package/components/p-DHFt2rdc.js +0 -4
  1087. package/components/p-DJztqcrH.js +0 -4
  1088. package/components/p-DM-PrAoh.js +0 -4
  1089. package/components/p-DSzSbVP2.js +0 -4
  1090. package/components/p-DV85C0e0.js +0 -4
  1091. package/components/p-DWCzVL3Y.js +0 -4
  1092. package/components/p-D_RCyzwu.js +0 -4
  1093. package/components/p-D_tD8r3L.js +0 -4
  1094. package/components/p-DaA_8eqt.js +0 -4
  1095. package/components/p-DjCtLZbF.js +0 -4
  1096. package/components/p-Dmd2xqCe.js +0 -4
  1097. package/components/p-Dojwmvde.js +0 -4
  1098. package/components/p-G0TxqHfe.js +0 -4
  1099. package/components/p-G6JR-cr_.js +0 -4
  1100. package/components/p-GG5GhznE.js +0 -4
  1101. package/components/p-LpMHEu3v.js +0 -4
  1102. package/components/p-TXPDHL13.js +0 -4
  1103. package/components/p-UIBJkZf8.js +0 -4
  1104. package/components/p-ZjP4CjeZ.js +0 -4
  1105. package/components/p-_IKFD3ID.js +0 -4
  1106. package/components/p-byZM6qHV.js +0 -4
  1107. package/components/p-dKq2jIum.js +0 -4
  1108. package/components/p-fruGqVHh.js +0 -4
  1109. package/components/p-iYhH60Tc.js +0 -4
  1110. package/components/p-ia3IDdJS.js +0 -4
  1111. package/dist/cjs/hardware-back-button-fqpYh-kd.js +0 -121
  1112. package/dist/cjs/index-DkNv4J_i.js +0 -10
  1113. package/dist/cjs/input.utils-BZdMWVrt.js +0 -35
  1114. package/dist/cjs/ion-datetime.cjs.entry.js +0 -2770
  1115. package/dist/cjs/ionic-global-k6hOWWpn.js +0 -156
  1116. package/dist/cjs/keyboard-controller-PtZoN2GS.js +0 -167
  1117. package/dist/cjs/slot-mutation-controller-DPHmqXdV.js +0 -397
  1118. package/dist/cjs/validity-BpS37YFM.js +0 -19
  1119. package/dist/collection/utils/forms/start-container-controller.js +0 -132
  1120. package/dist/esm/hardware-back-button-gLJHMX_F.js +0 -115
  1121. package/dist/esm/index-ZjP4CjeZ.js +0 -7
  1122. package/dist/esm/input.utils-B1ValN_N.js +0 -33
  1123. package/dist/esm/ion-datetime.entry.js +0 -2768
  1124. package/dist/esm/ionic-global-BVB7BrLT.js +0 -151
  1125. package/dist/esm/keyboard-controller-DEwoa1ev.js +0 -165
  1126. package/dist/esm/slot-mutation-controller-DiE_C9un.js +0 -393
  1127. package/dist/esm/theme-byZM6qHV.js +0 -48
  1128. package/dist/esm/validity-DJztqcrH.js +0 -17
  1129. package/dist/ionic/p-06ec7136.entry.js +0 -4
  1130. package/dist/ionic/p-09fe4fa3.entry.js +0 -4
  1131. package/dist/ionic/p-10d45a07.entry.js +0 -4
  1132. package/dist/ionic/p-208c8a07.entry.js +0 -4
  1133. package/dist/ionic/p-212474fa.entry.js +0 -4
  1134. package/dist/ionic/p-2eef1396.entry.js +0 -4
  1135. package/dist/ionic/p-347e005d.entry.js +0 -4
  1136. package/dist/ionic/p-3a0b3f1d.entry.js +0 -4
  1137. package/dist/ionic/p-3b071259.entry.js +0 -4
  1138. package/dist/ionic/p-40424a88.entry.js +0 -4
  1139. package/dist/ionic/p-4204184c.entry.js +0 -4
  1140. package/dist/ionic/p-47464391.entry.js +0 -4
  1141. package/dist/ionic/p-4eOQC00Z.js +0 -4
  1142. package/dist/ionic/p-4f9c9126.entry.js +0 -4
  1143. package/dist/ionic/p-5JsKPLJD.js +0 -4
  1144. package/dist/ionic/p-5bc485c6.entry.js +0 -4
  1145. package/dist/ionic/p-603a61e6.entry.js +0 -4
  1146. package/dist/ionic/p-60576951.entry.js +0 -4
  1147. package/dist/ionic/p-67a81d33.entry.js +0 -4
  1148. package/dist/ionic/p-6affb775.entry.js +0 -4
  1149. package/dist/ionic/p-6f120c25.entry.js +0 -4
  1150. package/dist/ionic/p-71c82b60.entry.js +0 -4
  1151. package/dist/ionic/p-79325ffe.entry.js +0 -4
  1152. package/dist/ionic/p-7CBuOvEo.js +0 -4
  1153. package/dist/ionic/p-7e4d51fa.entry.js +0 -4
  1154. package/dist/ionic/p-7f5d4664.entry.js +0 -4
  1155. package/dist/ionic/p-80ee82fc.entry.js +0 -4
  1156. package/dist/ionic/p-84af7dbc.entry.js +0 -4
  1157. package/dist/ionic/p-89ca830a.entry.js +0 -4
  1158. package/dist/ionic/p-93b8ec8f.entry.js +0 -4
  1159. package/dist/ionic/p-946f65c2.entry.js +0 -4
  1160. package/dist/ionic/p-9c4b39fb.entry.js +0 -4
  1161. package/dist/ionic/p-B1NEZUzQ.js +0 -4
  1162. package/dist/ionic/p-B1ck5iy-.js +0 -4
  1163. package/dist/ionic/p-B4FrqdW0.js +0 -4
  1164. package/dist/ionic/p-BB0LlG4y.js +0 -4
  1165. package/dist/ionic/p-BMPN55of.js +0 -4
  1166. package/dist/ionic/p-BSQPZ79H.js +0 -4
  1167. package/dist/ionic/p-BYEAtHr-.js +0 -4
  1168. package/dist/ionic/p-BhamHSw3.js +0 -4
  1169. package/dist/ionic/p-BmVRXR1y.js +0 -4
  1170. package/dist/ionic/p-BvabGprD.js +0 -4
  1171. package/dist/ionic/p-C-94tAim.js +0 -4
  1172. package/dist/ionic/p-C-eHZMYE.js +0 -4
  1173. package/dist/ionic/p-CBR_W98Z.js +0 -4
  1174. package/dist/ionic/p-CBWAXjA5.js +0 -4
  1175. package/dist/ionic/p-CIGNaXM1.js +0 -4
  1176. package/dist/ionic/p-CMRtMbJc.js +0 -4
  1177. package/dist/ionic/p-CPcPmkGv.js +0 -4
  1178. package/dist/ionic/p-CaRuIadB.js +0 -4
  1179. package/dist/ionic/p-Cdjxf_yg.js +0 -4
  1180. package/dist/ionic/p-ChhhtsGZ.js +0 -5
  1181. package/dist/ionic/p-CzS1qWve.js +0 -4
  1182. package/dist/ionic/p-D5t_-oMk.js +0 -4
  1183. package/dist/ionic/p-D94_RztK.js +0 -4
  1184. package/dist/ionic/p-DJztqcrH.js +0 -4
  1185. package/dist/ionic/p-DWCzVL3Y.js +0 -4
  1186. package/dist/ionic/p-DjjfauRM.js +0 -4
  1187. package/dist/ionic/p-DkUB-ROc.js +0 -4
  1188. package/dist/ionic/p-Dn0mqQ_R.js +0 -4
  1189. package/dist/ionic/p-Dojwmvde.js +0 -4
  1190. package/dist/ionic/p-DplOqGUv.js +0 -4
  1191. package/dist/ionic/p-Dst_XmZh.js +0 -4
  1192. package/dist/ionic/p-T71k3C35.js +0 -4
  1193. package/dist/ionic/p-TXPDHL13.js +0 -4
  1194. package/dist/ionic/p-UIBJkZf8.js +0 -4
  1195. package/dist/ionic/p-ZjP4CjeZ.js +0 -4
  1196. package/dist/ionic/p-a438b193.entry.js +0 -4
  1197. package/dist/ionic/p-babaaaa7.entry.js +0 -4
  1198. package/dist/ionic/p-be08d500.entry.js +0 -4
  1199. package/dist/ionic/p-be9a4f51.entry.js +0 -4
  1200. package/dist/ionic/p-byZM6qHV.js +0 -4
  1201. package/dist/ionic/p-c00d3092.entry.js +0 -4
  1202. package/dist/ionic/p-c36dc8f5.entry.js +0 -4
  1203. package/dist/ionic/p-c72a7e17.entry.js +0 -4
  1204. package/dist/ionic/p-c8edd88c.entry.js +0 -4
  1205. package/dist/ionic/p-ce0e380b.entry.js +0 -4
  1206. package/dist/ionic/p-ce32912b.entry.js +0 -4
  1207. package/dist/ionic/p-d07cf130.entry.js +0 -4
  1208. package/dist/ionic/p-d27edeb3.entry.js +0 -4
  1209. package/dist/ionic/p-d5d2c506.entry.js +0 -4
  1210. package/dist/ionic/p-d5e31ca9.entry.js +0 -4
  1211. package/dist/ionic/p-de91444f.entry.js +0 -4
  1212. package/dist/ionic/p-ded69ceb.entry.js +0 -4
  1213. package/dist/ionic/p-df72866d.entry.js +0 -4
  1214. package/dist/ionic/p-e47e3151.entry.js +0 -4
  1215. package/dist/ionic/p-e621e5e8.entry.js +0 -4
  1216. package/dist/ionic/p-eea9cf93.entry.js +0 -4
  1217. package/dist/ionic/p-f402f5a4.entry.js +0 -4
  1218. package/dist/ionic/p-fe1bfbcf.entry.js +0 -4
  1219. package/dist/ionic/p-ffb90460.entry.js +0 -4
  1220. package/dist/types/utils/forms/start-container-controller.d.ts +0 -34
  1221. /package/dist/collection/components/{input-password-toggle/input-password-toggle.css → refresher-content/refresher-content.css} +0 -0
@@ -0,0 +1,3206 @@
1
+ /*!
2
+ * (C) Ionic http://ionicframework.com - MIT License
3
+ */
4
+ import { j as printIonError, f as printIonWarning, r as registerInstance, c as createEvent, w as writeTask, e as config, h, d as Host, g as getElement } from './index-C0EQceqV.js';
5
+ import { startFocusVisible } from './focus-visible-vXpMhGrs.js';
6
+ import { r as raf, g as getElementRoot, a as renderHiddenInput, e as clamp } from './helpers-ChPZH7zh.js';
7
+ import { F as FOCUS_TRAP_DISABLE_CLASS, d as createDelegateController, e as createTriggerController, B as BACKDROP, i as isCancel, j as prepareOverlay, k as setOverlayId, f as present, g as dismiss, h as eventMethod, s as safeCall } from './overlays-C3YvaMgX.js';
8
+ import { i as isRTL } from './dir-o8OKV5aD.js';
9
+ import { c as createColorClasses, g as getClassMap } from './theme-DaJxRxSQ.js';
10
+ import { o as chevronForward, c as chevronBack, p as caretDownSharp, l as chevronDown, q as caretUpSharp } from './index-PnwG0glX.js';
11
+ import { b as getIonMode, c as getIonTheme } from './ionic-global-BJDU78B6.js';
12
+ import { r as removeDateTzOffset, g as getNextMonth, a as getPreviousMonth, i as isSameDay, b as getTodayLabel, c as getYear, d as getHourCycle, e as getInternalHourValue, f as getFormattedHour, h as addTimePadding, j as getLocalizedDayPeriod, k as isBefore, l as isAfter, m as is24Hour, n as getNumDaysInMonth, o as getDay, p as generateDayAriaLabel, v as validateParts, q as getPartsFromCalendarDay, s as getNextYear, t as getPreviousYear, u as getEndOfWeek, w as getStartOfWeek, x as getPreviousDay, y as getNextDay, z as getPreviousWeek, A as getNextWeek, B as parseMinParts, C as parseMaxParts, D as parseDate, E as warnIfValueOutOfBounds, F as parseAmPm, G as clampDate, H as convertToArrayOfNumbers, I as convertDataToISO, J as getClosestValidDate, K as isMonthFirstLocale, L as isLocaleDayPeriodRTL, M as calculateHourFromAMPM, N as getMonthAndYear, O as getLocalizedTime, P as getLocalizedDateTime, Q as formatValue } from './format-2WlZcMvG.js';
13
+ import { c as createLockController } from './lock-controller-B-hirT0v.js';
14
+ import { c as createAnimation } from './animation-BsVixxLP.js';
15
+ import { a as hapticSelectionChanged, h as hapticSelectionEnd, b as hapticSelectionStart } from './haptic-ByW74Ow9.js';
16
+ import './framework-delegate-P5K_3uYw.js';
17
+ import './gesture-controller-BTEOs1at.js';
18
+ import './capacitor-BnXrCBvt.js';
19
+
20
+ /**
21
+ * Returns the current date as
22
+ * an ISO string in the user's
23
+ * time zone.
24
+ */
25
+ const getToday = () => {
26
+ /**
27
+ * ion-datetime intentionally does not
28
+ * parse time zones/do automatic time zone
29
+ * conversion when accepting user input.
30
+ * However when we get today's date string,
31
+ * we want it formatted relative to the user's
32
+ * time zone.
33
+ *
34
+ * When calling toISOString(), the browser
35
+ * will convert the date to UTC time by either adding
36
+ * or subtracting the time zone offset.
37
+ * To work around this, we need to either add
38
+ * or subtract the time zone offset to the Date
39
+ * object prior to calling toISOString().
40
+ * This allows us to get an ISO string
41
+ * that is in the user's time zone.
42
+ */
43
+ return removeDateTzOffset(new Date()).toISOString();
44
+ };
45
+ const minutes = [
46
+ 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,
47
+ 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,
48
+ ];
49
+ // h11 hour system uses 0-11. Midnight starts at 0:00am.
50
+ const hour11 = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11];
51
+ // h12 hour system uses 0-12. Midnight starts at 12:00am.
52
+ const hour12 = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11];
53
+ // h23 hour system uses 0-23. Midnight starts at 0:00.
54
+ 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];
55
+ // h24 hour system uses 1-24. Midnight starts at 24:00.
56
+ 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];
57
+ /**
58
+ * Given a locale and a theme,
59
+ * return an array with formatted days
60
+ * of the week. iOS and Ionic themes should
61
+ * display days such as "Mon" or "Tue".
62
+ * MD should display days such as "M"
63
+ * or "T".
64
+ */
65
+ const getDaysOfWeek = (locale, theme, firstDayOfWeek = 0) => {
66
+ /**
67
+ * Nov 1st, 2020 starts on a Sunday.
68
+ * ion-datetime assumes weeks start on Sunday,
69
+ * but is configurable via `firstDayOfWeek`.
70
+ */
71
+ const weekdayFormat = theme === 'md' ? 'narrow' : 'short';
72
+ const intl = new Intl.DateTimeFormat(locale, { weekday: weekdayFormat });
73
+ const startDate = new Date('11/01/2020');
74
+ const daysOfWeek = [];
75
+ /**
76
+ * For each day of the week,
77
+ * get the day name.
78
+ */
79
+ for (let i = firstDayOfWeek; i < firstDayOfWeek + 7; i++) {
80
+ const currentDate = new Date(startDate);
81
+ currentDate.setDate(currentDate.getDate() + i);
82
+ daysOfWeek.push(intl.format(currentDate));
83
+ }
84
+ return daysOfWeek;
85
+ };
86
+ /**
87
+ * Returns an array containing all of the
88
+ * days in a month for a given year. Values are
89
+ * aligned with a week calendar starting on
90
+ * the firstDayOfWeek value (Sunday by default)
91
+ * using null values.
92
+ */
93
+ const getDaysOfMonth = (month, year, firstDayOfWeek, showAdjacentDays = false) => {
94
+ const numDays = getNumDaysInMonth(month, year);
95
+ let previousNumDays; //previous month number of days
96
+ if (month === 1) {
97
+ // If the current month is January, the previous month should be December of the previous year.
98
+ previousNumDays = getNumDaysInMonth(12, year - 1);
99
+ }
100
+ else {
101
+ // Otherwise, the previous month should be the current month - 1 of the same year.
102
+ previousNumDays = getNumDaysInMonth(month - 1, year);
103
+ }
104
+ const firstOfMonth = new Date(`${month}/1/${year}`).getDay();
105
+ /**
106
+ * To get the first day of the month aligned on the correct
107
+ * day of the week, we need to determine how many "filler" days
108
+ * to generate. These filler days as empty/disabled buttons
109
+ * that fill the space of the days of the week before the first
110
+ * of the month.
111
+ *
112
+ * There are two cases here:
113
+ *
114
+ * 1. If firstOfMonth = 4, firstDayOfWeek = 0 then the offset
115
+ * is (4 - (0 + 1)) = 3. Since the offset loop goes from 0 to 3 inclusive,
116
+ * this will generate 4 filler days (0, 1, 2, 3), and then day of week 4 will have
117
+ * the first day of the month.
118
+ *
119
+ * 2. If firstOfMonth = 2, firstDayOfWeek = 4 then the offset
120
+ * is (6 - (4 - 2)) = 4. Since the offset loop goes from 0 to 4 inclusive,
121
+ * this will generate 5 filler days (0, 1, 2, 3, 4), and then day of week 5 will have
122
+ * the first day of the month.
123
+ */
124
+ const offset = firstOfMonth >= firstDayOfWeek ? firstOfMonth - (firstDayOfWeek + 1) : 6 - (firstDayOfWeek - firstOfMonth);
125
+ let days = [];
126
+ for (let i = 1; i <= numDays; i++) {
127
+ days.push({ day: i, dayOfWeek: (offset + i) % 7, isAdjacentDay: false });
128
+ }
129
+ if (showAdjacentDays) {
130
+ for (let i = 0; i <= offset; i++) {
131
+ // Using offset create previous month adjacent day, starting from last day
132
+ days = [{ day: previousNumDays - i, dayOfWeek: (previousNumDays - i) % 7, isAdjacentDay: true }, ...days];
133
+ }
134
+ // Calculate positiveOffset
135
+ // The calendar will display 42 days (6 rows of 7 columns)
136
+ // Knowing this the offset is 41 (we start at index 0)
137
+ // minus (the previous offset + the current month days)
138
+ const positiveOffset = 41 - (numDays + offset);
139
+ for (let i = 0; i < positiveOffset; i++) {
140
+ days.push({ day: i + 1, dayOfWeek: (numDays + offset + i) % 7, isAdjacentDay: true });
141
+ }
142
+ }
143
+ else {
144
+ for (let i = 0; i <= offset; i++) {
145
+ days = [{ day: null, dayOfWeek: null, isAdjacentDay: false }, ...days];
146
+ }
147
+ }
148
+ return days;
149
+ };
150
+ /**
151
+ * Returns an array of pre-defined hour
152
+ * values based on the provided hourCycle.
153
+ */
154
+ const getHourData = (hourCycle) => {
155
+ switch (hourCycle) {
156
+ case 'h11':
157
+ return hour11;
158
+ case 'h12':
159
+ return hour12;
160
+ case 'h23':
161
+ return hour23;
162
+ case 'h24':
163
+ return hour24;
164
+ default:
165
+ throw new Error(`Invalid hour cycle "${hourCycle}"`);
166
+ }
167
+ };
168
+ /**
169
+ * Given a local, reference datetime parts and option
170
+ * max/min bound datetime parts, calculate the acceptable
171
+ * hour and minute values according to the bounds and locale.
172
+ */
173
+ const generateTime = (locale, refParts, hourCycle = 'h12', minParts, maxParts, hourValues, minuteValues) => {
174
+ const computedHourCycle = getHourCycle(locale, hourCycle);
175
+ const use24Hour = is24Hour(computedHourCycle);
176
+ let processedHours = getHourData(computedHourCycle);
177
+ let processedMinutes = minutes;
178
+ let isAMAllowed = true;
179
+ let isPMAllowed = true;
180
+ if (hourValues) {
181
+ processedHours = processedHours.filter((hour) => hourValues.includes(hour));
182
+ }
183
+ if (minuteValues) {
184
+ processedMinutes = processedMinutes.filter((minute) => minuteValues.includes(minute));
185
+ }
186
+ if (minParts) {
187
+ /**
188
+ * If ref day is the same as the
189
+ * minimum allowed day, filter hour/minute
190
+ * values according to min hour and minute.
191
+ */
192
+ if (isSameDay(refParts, minParts)) {
193
+ /**
194
+ * Users may not always set the hour/minute for
195
+ * min value (i.e. 2021-06-02) so we should allow
196
+ * all hours/minutes in that case.
197
+ */
198
+ if (minParts.hour !== undefined) {
199
+ processedHours = processedHours.filter((hour) => {
200
+ const convertedHour = refParts.ampm === 'pm' ? (hour + 12) % 24 : hour;
201
+ return (use24Hour ? hour : convertedHour) >= minParts.hour;
202
+ });
203
+ isAMAllowed = minParts.hour < 13;
204
+ }
205
+ if (minParts.minute !== undefined) {
206
+ /**
207
+ * The minimum minute range should not be enforced when
208
+ * the hour is greater than the min hour.
209
+ *
210
+ * For example with a minimum range of 09:30, users
211
+ * should be able to select 10:00-10:29 and beyond.
212
+ */
213
+ let isPastMinHour = false;
214
+ if (minParts.hour !== undefined && refParts.hour !== undefined) {
215
+ if (refParts.hour > minParts.hour) {
216
+ isPastMinHour = true;
217
+ }
218
+ }
219
+ processedMinutes = processedMinutes.filter((minute) => {
220
+ if (isPastMinHour) {
221
+ return true;
222
+ }
223
+ return minute >= minParts.minute;
224
+ });
225
+ }
226
+ /**
227
+ * If ref day is before minimum
228
+ * day do not render any hours/minute values
229
+ */
230
+ }
231
+ else if (isBefore(refParts, minParts)) {
232
+ processedHours = [];
233
+ processedMinutes = [];
234
+ isAMAllowed = isPMAllowed = false;
235
+ }
236
+ }
237
+ if (maxParts) {
238
+ /**
239
+ * If ref day is the same as the
240
+ * maximum allowed day, filter hour/minute
241
+ * values according to max hour and minute.
242
+ */
243
+ if (isSameDay(refParts, maxParts)) {
244
+ /**
245
+ * Users may not always set the hour/minute for
246
+ * max value (i.e. 2021-06-02) so we should allow
247
+ * all hours/minutes in that case.
248
+ */
249
+ if (maxParts.hour !== undefined) {
250
+ processedHours = processedHours.filter((hour) => {
251
+ const convertedHour = refParts.ampm === 'pm' ? (hour + 12) % 24 : hour;
252
+ return (use24Hour ? hour : convertedHour) <= maxParts.hour;
253
+ });
254
+ isPMAllowed = maxParts.hour >= 12;
255
+ }
256
+ if (maxParts.minute !== undefined && refParts.hour === maxParts.hour) {
257
+ // The available minutes should only be filtered when the hour is the same as the max hour.
258
+ // For example if the max hour is 10:30 and the current hour is 10:00,
259
+ // users should be able to select 00-30 minutes.
260
+ // If the current hour is 09:00, users should be able to select 00-60 minutes.
261
+ processedMinutes = processedMinutes.filter((minute) => minute <= maxParts.minute);
262
+ }
263
+ /**
264
+ * If ref day is after minimum
265
+ * day do not render any hours/minute values
266
+ */
267
+ }
268
+ else if (isAfter(refParts, maxParts)) {
269
+ processedHours = [];
270
+ processedMinutes = [];
271
+ isAMAllowed = isPMAllowed = false;
272
+ }
273
+ }
274
+ return {
275
+ hours: processedHours,
276
+ minutes: processedMinutes,
277
+ am: isAMAllowed,
278
+ pm: isPMAllowed,
279
+ };
280
+ };
281
+ /**
282
+ * Given DatetimeParts, generate the previous,
283
+ * current, and and next months.
284
+ */
285
+ const generateMonths = (refParts, forcedDate) => {
286
+ const current = { month: refParts.month, year: refParts.year, day: refParts.day };
287
+ /**
288
+ * If we're forcing a month to appear, and it's different from the current month,
289
+ * ensure it appears by replacing the next or previous month as appropriate.
290
+ */
291
+ if (forcedDate !== undefined && (refParts.month !== forcedDate.month || refParts.year !== forcedDate.year)) {
292
+ const forced = { month: forcedDate.month, year: forcedDate.year, day: forcedDate.day };
293
+ const forcedMonthIsBefore = isBefore(forced, current);
294
+ return forcedMonthIsBefore
295
+ ? [forced, current, getNextMonth(refParts)]
296
+ : [getPreviousMonth(refParts), current, forced];
297
+ }
298
+ return [getPreviousMonth(refParts), current, getNextMonth(refParts)];
299
+ };
300
+ const getMonthColumnData = (locale, refParts, minParts, maxParts, monthValues, formatOptions = {
301
+ month: 'long',
302
+ }) => {
303
+ const { year } = refParts;
304
+ const months = [];
305
+ if (monthValues !== undefined) {
306
+ let processedMonths = monthValues;
307
+ if ((maxParts === null || maxParts === void 0 ? void 0 : maxParts.month) !== undefined) {
308
+ processedMonths = processedMonths.filter((month) => month <= maxParts.month);
309
+ }
310
+ if ((minParts === null || minParts === void 0 ? void 0 : minParts.month) !== undefined) {
311
+ processedMonths = processedMonths.filter((month) => month >= minParts.month);
312
+ }
313
+ processedMonths.forEach((processedMonth) => {
314
+ const date = new Date(`${processedMonth}/1/${year} GMT+0000`);
315
+ const monthString = new Intl.DateTimeFormat(locale, Object.assign(Object.assign({}, formatOptions), { timeZone: 'UTC' })).format(date);
316
+ months.push({ text: monthString, value: processedMonth });
317
+ });
318
+ }
319
+ else {
320
+ const maxMonth = maxParts && maxParts.year === year ? maxParts.month : 12;
321
+ const minMonth = minParts && minParts.year === year ? minParts.month : 1;
322
+ for (let i = minMonth; i <= maxMonth; i++) {
323
+ /**
324
+ *
325
+ * There is a bug on iOS 14 where
326
+ * Intl.DateTimeFormat takes into account
327
+ * the local timezone offset when formatting dates.
328
+ *
329
+ * Forcing the timezone to 'UTC' fixes the issue. However,
330
+ * we should keep this workaround as it is safer. In the event
331
+ * this breaks in another browser, we will not be impacted
332
+ * because all dates will be interpreted in UTC.
333
+ *
334
+ * Example:
335
+ * new Intl.DateTimeFormat('en-US', { month: 'long' }).format(new Date('Sat Apr 01 2006 00:00:00 GMT-0400 (EDT)')) // "March"
336
+ * new Intl.DateTimeFormat('en-US', { month: 'long', timeZone: 'UTC' }).format(new Date('Sat Apr 01 2006 00:00:00 GMT-0400 (EDT)')) // "April"
337
+ *
338
+ * In certain timezones, iOS 14 shows the wrong
339
+ * date for .toUTCString(). To combat this, we
340
+ * force all of the timezones to GMT+0000 (UTC).
341
+ *
342
+ * Example:
343
+ * Time Zone: Central European Standard Time
344
+ * new Date('1/1/1992').toUTCString() // "Tue, 31 Dec 1991 23:00:00 GMT"
345
+ * new Date('1/1/1992 GMT+0000').toUTCString() // "Wed, 01 Jan 1992 00:00:00 GMT"
346
+ */
347
+ const date = new Date(`${i}/1/${year} GMT+0000`);
348
+ const monthString = new Intl.DateTimeFormat(locale, Object.assign(Object.assign({}, formatOptions), { timeZone: 'UTC' })).format(date);
349
+ months.push({ text: monthString, value: i });
350
+ }
351
+ }
352
+ return months;
353
+ };
354
+ /**
355
+ * Returns information regarding
356
+ * selectable dates (i.e 1st, 2nd, 3rd, etc)
357
+ * within a reference month.
358
+ * @param locale The locale to format the date with
359
+ * @param refParts The reference month/year to generate dates for
360
+ * @param minParts The minimum bound on the date that can be returned
361
+ * @param maxParts The maximum bound on the date that can be returned
362
+ * @param dayValues The allowed date values
363
+ * @returns Date data to be used in ion-picker-column
364
+ */
365
+ const getDayColumnData = (locale, refParts, minParts, maxParts, dayValues, formatOptions = {
366
+ day: 'numeric',
367
+ }) => {
368
+ const { month, year } = refParts;
369
+ const days = [];
370
+ /**
371
+ * If we have max/min bounds that in the same
372
+ * month/year as the refParts, we should
373
+ * use the define day as the max/min day.
374
+ * Otherwise, fallback to the max/min days in a month.
375
+ */
376
+ const numDaysInMonth = getNumDaysInMonth(month, year);
377
+ 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
378
+ ? maxParts.day
379
+ : numDaysInMonth;
380
+ 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
381
+ ? minParts.day
382
+ : 1;
383
+ if (dayValues !== undefined) {
384
+ let processedDays = dayValues;
385
+ processedDays = processedDays.filter((day) => day >= minDay && day <= maxDay);
386
+ processedDays.forEach((processedDay) => {
387
+ const date = new Date(`${month}/${processedDay}/${year} GMT+0000`);
388
+ const dayString = new Intl.DateTimeFormat(locale, Object.assign(Object.assign({}, formatOptions), { timeZone: 'UTC' })).format(date);
389
+ days.push({ text: dayString, value: processedDay });
390
+ });
391
+ }
392
+ else {
393
+ for (let i = minDay; i <= maxDay; i++) {
394
+ const date = new Date(`${month}/${i}/${year} GMT+0000`);
395
+ const dayString = new Intl.DateTimeFormat(locale, Object.assign(Object.assign({}, formatOptions), { timeZone: 'UTC' })).format(date);
396
+ days.push({ text: dayString, value: i });
397
+ }
398
+ }
399
+ return days;
400
+ };
401
+ const getYearColumnData = (locale, refParts, minParts, maxParts, yearValues) => {
402
+ var _a, _b;
403
+ let processedYears = [];
404
+ if (yearValues !== undefined) {
405
+ processedYears = yearValues;
406
+ if ((maxParts === null || maxParts === void 0 ? void 0 : maxParts.year) !== undefined) {
407
+ processedYears = processedYears.filter((year) => year <= maxParts.year);
408
+ }
409
+ if ((minParts === null || minParts === void 0 ? void 0 : minParts.year) !== undefined) {
410
+ processedYears = processedYears.filter((year) => year >= minParts.year);
411
+ }
412
+ }
413
+ else {
414
+ const { year } = refParts;
415
+ const maxYear = (_a = maxParts === null || maxParts === void 0 ? void 0 : maxParts.year) !== null && _a !== void 0 ? _a : year;
416
+ const minYear = (_b = minParts === null || minParts === void 0 ? void 0 : minParts.year) !== null && _b !== void 0 ? _b : year - 100;
417
+ for (let i = minYear; i <= maxYear; i++) {
418
+ processedYears.push(i);
419
+ }
420
+ }
421
+ return processedYears.map((year) => ({
422
+ text: getYear(locale, { year, month: refParts.month, day: refParts.day }),
423
+ value: year,
424
+ }));
425
+ };
426
+ /**
427
+ * Given a starting date and an upper bound,
428
+ * this functions returns an array of all
429
+ * month objects in that range.
430
+ */
431
+ const getAllMonthsInRange = (currentParts, maxParts) => {
432
+ if (currentParts.month === maxParts.month && currentParts.year === maxParts.year) {
433
+ return [currentParts];
434
+ }
435
+ return [currentParts, ...getAllMonthsInRange(getNextMonth(currentParts), maxParts)];
436
+ };
437
+ /**
438
+ * Creates and returns picker items
439
+ * that represent the days in a month.
440
+ * Example: "Thu, Jun 2"
441
+ */
442
+ const getCombinedDateColumnData = (locale, todayParts, minParts, maxParts, dayValues, monthValues) => {
443
+ let items = [];
444
+ let parts = [];
445
+ /**
446
+ * Get all month objects from the min date
447
+ * to the max date. Note: Do not use getMonthColumnData
448
+ * as that function only generates dates within a
449
+ * single year.
450
+ */
451
+ let months = getAllMonthsInRange(minParts, maxParts);
452
+ /**
453
+ * Filter out any disallowed month values.
454
+ */
455
+ if (monthValues) {
456
+ months = months.filter(({ month }) => monthValues.includes(month));
457
+ }
458
+ /**
459
+ * Get all of the days in the month.
460
+ * From there, generate an array where
461
+ * each item has the month, date, and day
462
+ * of work as the text.
463
+ */
464
+ months.forEach((monthObject) => {
465
+ const referenceMonth = { month: monthObject.month, day: null, year: monthObject.year };
466
+ const monthDays = getDayColumnData(locale, referenceMonth, minParts, maxParts, dayValues, {
467
+ month: 'short',
468
+ day: 'numeric',
469
+ weekday: 'short',
470
+ });
471
+ const dateParts = [];
472
+ const dateColumnItems = [];
473
+ monthDays.forEach((dayObject) => {
474
+ const isToday = isSameDay(Object.assign(Object.assign({}, referenceMonth), { day: dayObject.value }), todayParts);
475
+ /**
476
+ * Today's date should read as "Today" (localized)
477
+ * not the actual date string
478
+ */
479
+ dateColumnItems.push({
480
+ text: isToday ? getTodayLabel(locale) : dayObject.text,
481
+ value: `${referenceMonth.year}-${referenceMonth.month}-${dayObject.value}`,
482
+ });
483
+ /**
484
+ * When selecting a date in the wheel picker
485
+ * we need access to the raw datetime parts data.
486
+ * The picker column only accepts values of
487
+ * type string or number, so we need to return
488
+ * two sets of data: A data set to be passed
489
+ * to the picker column, and a data set to
490
+ * be used to reference the raw data when
491
+ * updating the picker column value.
492
+ */
493
+ dateParts.push({
494
+ month: referenceMonth.month,
495
+ year: referenceMonth.year,
496
+ day: dayObject.value,
497
+ });
498
+ });
499
+ parts = [...parts, ...dateParts];
500
+ items = [...items, ...dateColumnItems];
501
+ });
502
+ return {
503
+ parts,
504
+ items,
505
+ };
506
+ };
507
+ const getTimeColumnsData = (locale, refParts, hourCycle, minParts, maxParts, allowedHourValues, allowedMinuteValues) => {
508
+ const computedHourCycle = getHourCycle(locale, hourCycle);
509
+ const use24Hour = is24Hour(computedHourCycle);
510
+ const { hours, minutes, am, pm } = generateTime(locale, refParts, computedHourCycle, minParts, maxParts, allowedHourValues, allowedMinuteValues);
511
+ const hoursItems = hours.map((hour) => {
512
+ return {
513
+ text: getFormattedHour(hour, computedHourCycle),
514
+ value: getInternalHourValue(hour, use24Hour, refParts.ampm),
515
+ };
516
+ });
517
+ const minutesItems = minutes.map((minute) => {
518
+ return {
519
+ text: addTimePadding(minute),
520
+ value: minute,
521
+ };
522
+ });
523
+ const dayPeriodItems = [];
524
+ if (am && !use24Hour) {
525
+ dayPeriodItems.push({
526
+ text: getLocalizedDayPeriod(locale, 'am'),
527
+ value: 'am',
528
+ });
529
+ }
530
+ if (pm && !use24Hour) {
531
+ dayPeriodItems.push({
532
+ text: getLocalizedDayPeriod(locale, 'pm'),
533
+ value: 'pm',
534
+ });
535
+ }
536
+ return {
537
+ minutesData: minutesItems,
538
+ hoursData: hoursItems,
539
+ dayPeriodData: dayPeriodItems,
540
+ };
541
+ };
542
+
543
+ const isYearDisabled = (refYear, minParts, maxParts) => {
544
+ if (minParts && minParts.year > refYear) {
545
+ return true;
546
+ }
547
+ if (maxParts && maxParts.year < refYear) {
548
+ return true;
549
+ }
550
+ return false;
551
+ };
552
+ /**
553
+ * Returns true if a given day should
554
+ * not be interactive according to its value,
555
+ * or the max/min dates.
556
+ */
557
+ const isDayDisabled = (refParts, minParts, maxParts, dayValues) => {
558
+ /**
559
+ * If this is a filler date (i.e. padding)
560
+ * then the date is disabled.
561
+ */
562
+ if (refParts.day === null) {
563
+ return true;
564
+ }
565
+ /**
566
+ * If user passed in a list of acceptable day values
567
+ * check to make sure that the date we are looking
568
+ * at is in this array.
569
+ */
570
+ if (dayValues !== undefined && !dayValues.includes(refParts.day)) {
571
+ return true;
572
+ }
573
+ /**
574
+ * Given a min date, perform the following
575
+ * checks. If any of them are true, then the
576
+ * day should be disabled:
577
+ * 1. Is the current year < the min allowed year?
578
+ * 2. Is the current year === min allowed year,
579
+ * but the current month < the min allowed month?
580
+ * 3. Is the current year === min allowed year, the
581
+ * current month === min allow month, but the current
582
+ * day < the min allowed day?
583
+ */
584
+ if (minParts && isBefore(refParts, minParts)) {
585
+ return true;
586
+ }
587
+ /**
588
+ * Given a max date, perform the following
589
+ * checks. If any of them are true, then the
590
+ * day should be disabled:
591
+ * 1. Is the current year > the max allowed year?
592
+ * 2. Is the current year === max allowed year,
593
+ * but the current month > the max allowed month?
594
+ * 3. Is the current year === max allowed year, the
595
+ * current month === max allow month, but the current
596
+ * day > the max allowed day?
597
+ */
598
+ if (maxParts && isAfter(refParts, maxParts)) {
599
+ return true;
600
+ }
601
+ /**
602
+ * If none of these checks
603
+ * passed then the date should
604
+ * be interactive.
605
+ */
606
+ return false;
607
+ };
608
+ /**
609
+ * Given a locale, a date, the selected date(s), and today's date,
610
+ * generate the state for a given calendar day button.
611
+ */
612
+ const getCalendarDayState = (locale, refParts, activeParts, todayParts, minParts, maxParts, dayValues) => {
613
+ /**
614
+ * activeParts signals what day(s) are currently selected in the datetime.
615
+ * If multiple="true", this will be an array, but the logic in this util
616
+ * is the same whether we have one selected day or many because we're only
617
+ * calculating the state for one button. So, we treat a single activeParts value
618
+ * the same as an array of length one.
619
+ */
620
+ const activePartsArray = Array.isArray(activeParts) ? activeParts : [activeParts];
621
+ /**
622
+ * The day button is active if it is selected, or in other words, if refParts
623
+ * matches at least one selected date.
624
+ */
625
+ const isActive = activePartsArray.find((parts) => isSameDay(refParts, parts)) !== undefined;
626
+ const isToday = isSameDay(refParts, todayParts);
627
+ const disabled = isDayDisabled(refParts, minParts, maxParts, dayValues);
628
+ /**
629
+ * Note that we always return one object regardless of whether activeParts
630
+ * was an array, since we pare down to one value for isActive.
631
+ */
632
+ return {
633
+ disabled,
634
+ isActive,
635
+ isToday,
636
+ ariaSelected: isActive ? 'true' : null,
637
+ ariaLabel: generateDayAriaLabel(locale, isToday, refParts),
638
+ text: refParts.day != null ? getDay(locale, refParts) : null,
639
+ };
640
+ };
641
+ /**
642
+ * Returns `true` if the month is disabled given the
643
+ * current date value and min/max date constraints.
644
+ */
645
+ const isMonthDisabled = (refParts, { minParts, maxParts, }) => {
646
+ // If the year is disabled then the month is disabled.
647
+ if (isYearDisabled(refParts.year, minParts, maxParts)) {
648
+ return true;
649
+ }
650
+ // If the date value is before the min date, then the month is disabled.
651
+ // If the date value is after the max date, then the month is disabled.
652
+ if ((minParts && isBefore(refParts, minParts)) || (maxParts && isAfter(refParts, maxParts))) {
653
+ return true;
654
+ }
655
+ return false;
656
+ };
657
+ /**
658
+ * Given a working date, an optional minimum date range,
659
+ * and an optional maximum date range; determine if the
660
+ * previous navigation button is disabled.
661
+ */
662
+ const isPrevMonthDisabled = (refParts, minParts, maxParts) => {
663
+ const prevMonth = Object.assign(Object.assign({}, getPreviousMonth(refParts)), { day: null });
664
+ return isMonthDisabled(prevMonth, {
665
+ minParts,
666
+ maxParts,
667
+ });
668
+ };
669
+ /**
670
+ * Given a working date and a maximum date range,
671
+ * determine if the next navigation button is disabled.
672
+ */
673
+ const isNextMonthDisabled = (refParts, maxParts) => {
674
+ const nextMonth = Object.assign(Object.assign({}, getNextMonth(refParts)), { day: null });
675
+ return isMonthDisabled(nextMonth, {
676
+ maxParts,
677
+ });
678
+ };
679
+ /**
680
+ * Given the value of the highlightedDates property
681
+ * and an ISO string, return the styles to use for
682
+ * that date, or undefined if none are found.
683
+ */
684
+ const getHighlightStyles = (highlightedDates, dateIsoString, el) => {
685
+ if (Array.isArray(highlightedDates)) {
686
+ const dateStringWithoutTime = dateIsoString.split('T')[0];
687
+ const matchingHighlight = highlightedDates.find((hd) => hd.date === dateStringWithoutTime);
688
+ if (matchingHighlight) {
689
+ return {
690
+ textColor: matchingHighlight.textColor,
691
+ backgroundColor: matchingHighlight.backgroundColor,
692
+ border: matchingHighlight.border,
693
+ };
694
+ }
695
+ }
696
+ else {
697
+ /**
698
+ * Wrap in a try-catch to prevent exceptions in the user's function
699
+ * from interrupting the calendar's rendering.
700
+ */
701
+ try {
702
+ return highlightedDates(dateIsoString);
703
+ }
704
+ catch (e) {
705
+ printIonError('[ion-datetime] - Exception thrown from provided `highlightedDates` callback. Please check your function and try again.', el, e);
706
+ }
707
+ }
708
+ return undefined;
709
+ };
710
+
711
+ /**
712
+ * If a time zone is provided in the format options, the rendered text could
713
+ * differ from what was selected in the Datetime, which could cause
714
+ * confusion.
715
+ */
716
+ const warnIfTimeZoneProvided = (el, formatOptions) => {
717
+ var _a, _b, _c, _d;
718
+ if (((_a = formatOptions === null || formatOptions === void 0 ? void 0 : formatOptions.date) === null || _a === void 0 ? void 0 : _a.timeZone) ||
719
+ ((_b = formatOptions === null || formatOptions === void 0 ? void 0 : formatOptions.date) === null || _b === void 0 ? void 0 : _b.timeZoneName) ||
720
+ ((_c = formatOptions === null || formatOptions === void 0 ? void 0 : formatOptions.time) === null || _c === void 0 ? void 0 : _c.timeZone) ||
721
+ ((_d = formatOptions === null || formatOptions === void 0 ? void 0 : formatOptions.time) === null || _d === void 0 ? void 0 : _d.timeZoneName)) {
722
+ printIonWarning('[ion-datetime] - "timeZone" and "timeZoneName" are not supported in "formatOptions".', el);
723
+ }
724
+ };
725
+ const checkForPresentationFormatMismatch = (el, presentation, formatOptions) => {
726
+ // formatOptions is not required
727
+ if (!formatOptions)
728
+ return;
729
+ // If formatOptions is provided, the date and/or time objects are required, depending on the presentation
730
+ switch (presentation) {
731
+ case 'date':
732
+ case 'month-year':
733
+ case 'month':
734
+ case 'year':
735
+ if (formatOptions.date === undefined) {
736
+ printIonWarning(`[ion-datetime] - The '${presentation}' presentation requires a date object in formatOptions.`, el);
737
+ }
738
+ break;
739
+ case 'time':
740
+ if (formatOptions.time === undefined) {
741
+ printIonWarning(`[ion-datetime] - The 'time' presentation requires a time object in formatOptions.`, el);
742
+ }
743
+ break;
744
+ case 'date-time':
745
+ case 'time-date':
746
+ if (formatOptions.date === undefined && formatOptions.time === undefined) {
747
+ printIonWarning(`[ion-datetime] - The '${presentation}' presentation requires either a date or time object (or both) in formatOptions.`, el);
748
+ }
749
+ break;
750
+ }
751
+ };
752
+
753
+ 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))}`;
754
+
755
+ 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%}`;
756
+
757
+ 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}`;
758
+
759
+ const Datetime = class {
760
+ constructor(hostRef) {
761
+ registerInstance(this, hostRef);
762
+ this.ionCancel = createEvent(this, "ionCancel", 7);
763
+ this.ionChange = createEvent(this, "ionChange", 7);
764
+ this.ionValueChange = createEvent(this, "ionValueChange", 7);
765
+ this.ionFocus = createEvent(this, "ionFocus", 7);
766
+ this.ionBlur = createEvent(this, "ionBlur", 7);
767
+ this.ionStyle = createEvent(this, "ionStyle", 7);
768
+ this.ionRender = createEvent(this, "ionRender", 7);
769
+ this.inputId = `ion-dt-${datetimeIds++}`;
770
+ /**
771
+ * Set true only by `visibleCallback`. Lets `hiddenCallback` ignore the
772
+ * synthetic "not intersecting" entry IntersectionObserver fires on
773
+ * `observe()` when the host mounts offscreen.
774
+ *
775
+ * Don't reset this in `disconnectedCallback`. Overlays disconnect and
776
+ * reconnect the host without re-creating the observers, so a reset there
777
+ * makes `hiddenCallback` miss the dismissal.
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, refer to [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
+ 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 = 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) => !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 = getPartsFromCalendarDay(activeElement);
1039
+ let partsToFocus;
1040
+ switch (ev.key) {
1041
+ case 'ArrowDown':
1042
+ ev.preventDefault();
1043
+ partsToFocus = getNextWeek(parts);
1044
+ break;
1045
+ case 'ArrowUp':
1046
+ ev.preventDefault();
1047
+ partsToFocus = getPreviousWeek(parts);
1048
+ break;
1049
+ case 'ArrowRight':
1050
+ ev.preventDefault();
1051
+ partsToFocus = getNextDay(parts);
1052
+ break;
1053
+ case 'ArrowLeft':
1054
+ ev.preventDefault();
1055
+ partsToFocus = getPreviousDay(parts);
1056
+ break;
1057
+ case 'Home':
1058
+ ev.preventDefault();
1059
+ partsToFocus = getStartOfWeek(parts);
1060
+ break;
1061
+ case 'End':
1062
+ ev.preventDefault();
1063
+ partsToFocus = getEndOfWeek(parts);
1064
+ break;
1065
+ case 'PageUp':
1066
+ ev.preventDefault();
1067
+ partsToFocus = ev.shiftKey ? getPreviousYear(parts) : getPreviousMonth(parts);
1068
+ break;
1069
+ case 'PageDown':
1070
+ ev.preventDefault();
1071
+ partsToFocus = ev.shiftKey ? getNextYear(parts) : 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 = 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 = 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 = 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
+ writeTask(() => {
1169
+ calendarBodyRef.scrollLeft = startMonth.clientWidth * (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 = 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 getPreviousMonth(parts);
1218
+ }
1219
+ else if (month === endMonth) {
1220
+ return 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
+ writeTask(() => {
1261
+ var _a;
1262
+ this.setWorkingParts(Object.assign(Object.assign({}, this.workingParts), { month, day: day, year }));
1263
+ calendarBodyRef.scrollLeft = workingMonth.clientWidth * (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
+ 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 ? 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
+ 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 = clampDate(singleValue, minParts, maxParts);
1397
+ const { month, day, year, hour, minute } = targetValue;
1398
+ const ampm = 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 = 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 = config.getBoolean('animated', true) ? 'smooth' : 'instant';
1500
+ calendarBodyRef.scrollTo({
1501
+ top: 0,
1502
+ left: left * (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 = config.getBoolean('animated', true) ? 'smooth' : 'instant';
1517
+ calendarBodyRef.scrollTo({
1518
+ top: 0,
1519
+ left: left * (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 = convertToArrayOfNumbers(this.yearValues);
1552
+ }
1553
+ monthValuesChanged() {
1554
+ this.parsedMonthValues = convertToArrayOfNumbers(this.monthValues);
1555
+ }
1556
+ dayValuesChanged() {
1557
+ this.parsedDayValues = convertToArrayOfNumbers(this.dayValues);
1558
+ }
1559
+ hourValuesChanged() {
1560
+ this.parsedHourValues = convertToArrayOfNumbers(this.hourValues);
1561
+ }
1562
+ minuteValuesChanged() {
1563
+ this.parsedMinuteValues = 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(convertDataToISO(workingParts));
1598
+ }
1599
+ else {
1600
+ this.setValue(undefined);
1601
+ }
1602
+ }
1603
+ else {
1604
+ this.setValue(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 = 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
+ }
1662
+ initializeListeners() {
1663
+ this.initializeCalendarListener();
1664
+ this.initializeKeyboardListeners();
1665
+ }
1666
+ componentDidLoad() {
1667
+ const { el, intersectionTrackerRef } = this;
1668
+ /**
1669
+ * If a scrollable element is hidden using `display: none`,
1670
+ * it will not have a scroll height meaning we cannot scroll elements
1671
+ * into view. As a result, we will need to wait for the datetime to become
1672
+ * visible if used inside of a modal or a popover otherwise the scrollable
1673
+ * areas will not have the correct values snapped into place.
1674
+ */
1675
+ const visibleCallback = (entries) => {
1676
+ const ev = entries[0];
1677
+ if (!ev.isIntersecting) {
1678
+ return;
1679
+ }
1680
+ this.hasBeenIntersecting = true;
1681
+ this.markReady();
1682
+ };
1683
+ const visibleIO = new IntersectionObserver(visibleCallback, { threshold: 0.01, root: el });
1684
+ /**
1685
+ * Use raf to avoid a race condition between the component loading and
1686
+ * its display animation starting (such as when shown in a modal). This
1687
+ * could cause the datetime to start at a visibility of 0, erroneously
1688
+ * triggering the `hiddenIO` observer below.
1689
+ */
1690
+ raf(() => visibleIO === null || visibleIO === void 0 ? void 0 : visibleIO.observe(intersectionTrackerRef));
1691
+ /**
1692
+ * TODO(FW-6931): Remove this fallback upon solving the root cause
1693
+ * Fallback: If IntersectionObserver never reports that the
1694
+ * datetime is visible but the host clearly has layout, ensure
1695
+ * we still initialize listeners and mark the component as ready.
1696
+ *
1697
+ * We schedule this after everything has had a chance to run.
1698
+ *
1699
+ * We also clean up the load timeout to ensure that we don't have multiple timeouts running.
1700
+ */
1701
+ this.loadTimeoutCleanup();
1702
+ this.loadTimeout = setTimeout(() => {
1703
+ this.ensureReadyIfVisible();
1704
+ }, 100);
1705
+ /**
1706
+ * We need to clean up listeners when the datetime is hidden
1707
+ * in a popover/modal so that we can properly scroll containers
1708
+ * back into view if they are re-presented. When the datetime is hidden
1709
+ * the scroll areas have scroll widths/heights of 0px, so any snapping
1710
+ * we did originally has been lost.
1711
+ */
1712
+ const hiddenCallback = (entries) => {
1713
+ const ev = entries[0];
1714
+ if (ev.isIntersecting) {
1715
+ return;
1716
+ }
1717
+ // Ignore the initial "not intersecting" entry IntersectionObserver fires on observe().
1718
+ if (!this.hasBeenIntersecting) {
1719
+ return;
1720
+ }
1721
+ this.hasBeenIntersecting = false;
1722
+ this.destroyInteractionListeners();
1723
+ /**
1724
+ * When datetime is hidden, we need to make sure that
1725
+ * the month/year picker is closed. Otherwise,
1726
+ * it will be open when the datetime re-appears
1727
+ * and the scroll area of the calendar grid will be 0.
1728
+ * As a result, the wrong month will be shown.
1729
+ */
1730
+ this.showMonthAndYear = false;
1731
+ writeTask(() => {
1732
+ this.el.classList.remove('datetime-ready');
1733
+ });
1734
+ };
1735
+ const hiddenIO = new IntersectionObserver(hiddenCallback, { threshold: 0, root: el });
1736
+ raf(() => hiddenIO === null || hiddenIO === void 0 ? void 0 : hiddenIO.observe(intersectionTrackerRef));
1737
+ /**
1738
+ * Datetime uses Ionic components that emit
1739
+ * ionFocus and ionBlur. These events are
1740
+ * composed meaning they will cross
1741
+ * the shadow dom boundary. We need to
1742
+ * stop propagation on these events otherwise
1743
+ * developers will see 2 ionFocus or 2 ionBlur
1744
+ * events at a time.
1745
+ */
1746
+ const root = getElementRoot(this.el);
1747
+ root.addEventListener('ionFocus', (ev) => ev.stopPropagation());
1748
+ root.addEventListener('ionBlur', (ev) => ev.stopPropagation());
1749
+ }
1750
+ /**
1751
+ * When the presentation is changed, all calendar content is recreated,
1752
+ * so we need to re-init behavior with the new elements.
1753
+ */
1754
+ componentDidRender() {
1755
+ const { presentation, prevPresentation, calendarBodyRef, minParts, preferWheel, forceRenderDate } = this;
1756
+ /**
1757
+ * TODO(FW-2165)
1758
+ * Remove this when https://bugs.webkit.org/show_bug.cgi?id=235960 is fixed.
1759
+ * When using `min`, we add `scroll-snap-align: none`
1760
+ * to the disabled month so that users cannot scroll to it.
1761
+ * This triggers a bug in WebKit where the scroll position is reset.
1762
+ * Since the month change logic is handled by a scroll listener,
1763
+ * this causes the month to change leading to `scroll-snap-align`
1764
+ * changing again, thus changing the scroll position again and causing
1765
+ * an infinite loop.
1766
+ * This issue only applies to the calendar grid, so we can disable
1767
+ * it if the calendar grid is not being used.
1768
+ */
1769
+ const hasCalendarGrid = !preferWheel && ['date-time', 'time-date', 'date'].includes(presentation);
1770
+ if (minParts !== undefined && hasCalendarGrid && calendarBodyRef) {
1771
+ const workingMonth = calendarBodyRef.querySelector('.calendar-month:nth-of-type(1)');
1772
+ /**
1773
+ * We need to make sure the datetime is not in the process
1774
+ * of scrolling to a new datetime value if the value
1775
+ * is updated programmatically.
1776
+ * Otherwise, the datetime will appear to not scroll at all because
1777
+ * we are resetting the scroll position to the center of the view.
1778
+ * Prior to the datetime's value being updated programmatically,
1779
+ * the calendarBodyRef is scrolled such that the middle month is centered
1780
+ * in the view. The below code updates the scroll position so the middle
1781
+ * month is also centered in the view. Since the scroll position did not change,
1782
+ * the scroll callback in this file does not fire,
1783
+ * and the resolveForceDateScrolling promise never resolves.
1784
+ */
1785
+ if (workingMonth && forceRenderDate === undefined) {
1786
+ calendarBodyRef.scrollLeft = workingMonth.clientWidth * (isRTL(this.el) ? -1 : 1);
1787
+ }
1788
+ }
1789
+ if (prevPresentation === null) {
1790
+ this.prevPresentation = presentation;
1791
+ return;
1792
+ }
1793
+ if (presentation === prevPresentation) {
1794
+ return;
1795
+ }
1796
+ this.prevPresentation = presentation;
1797
+ this.destroyInteractionListeners();
1798
+ this.initializeListeners();
1799
+ /**
1800
+ * The month/year picker from the date interface
1801
+ * should be closed as it is not available in non-date
1802
+ * interfaces.
1803
+ */
1804
+ this.showMonthAndYear = false;
1805
+ raf(() => {
1806
+ this.ionRender.emit();
1807
+ });
1808
+ }
1809
+ componentWillLoad() {
1810
+ const { el, formatOptions, highlightedDates, multiple, presentation, preferWheel } = this;
1811
+ if (multiple) {
1812
+ if (presentation !== 'date') {
1813
+ printIonWarning('[ion-datetime] - Multiple date selection is only supported for presentation="date".', el);
1814
+ }
1815
+ if (preferWheel) {
1816
+ printIonWarning('[ion-datetime] - Multiple date selection is not supported with preferWheel="true".', el);
1817
+ }
1818
+ }
1819
+ if (highlightedDates !== undefined) {
1820
+ if (presentation !== 'date' && presentation !== 'date-time' && presentation !== 'time-date') {
1821
+ printIonWarning('[ion-datetime] - The highlightedDates property is only supported with the date, date-time, and time-date presentations.', el);
1822
+ }
1823
+ if (preferWheel) {
1824
+ printIonWarning('[ion-datetime] - The highlightedDates property is not supported with preferWheel="true".', el);
1825
+ }
1826
+ }
1827
+ if (formatOptions) {
1828
+ checkForPresentationFormatMismatch(el, presentation, formatOptions);
1829
+ warnIfTimeZoneProvided(el, formatOptions);
1830
+ }
1831
+ const hourValues = (this.parsedHourValues = convertToArrayOfNumbers(this.hourValues));
1832
+ const minuteValues = (this.parsedMinuteValues = convertToArrayOfNumbers(this.minuteValues));
1833
+ const monthValues = (this.parsedMonthValues = convertToArrayOfNumbers(this.monthValues));
1834
+ const yearValues = (this.parsedYearValues = convertToArrayOfNumbers(this.yearValues));
1835
+ const dayValues = (this.parsedDayValues = convertToArrayOfNumbers(this.dayValues));
1836
+ const todayParts = (this.todayParts = parseDate(getToday()));
1837
+ this.processMinParts();
1838
+ this.processMaxParts();
1839
+ this.defaultParts = getClosestValidDate({
1840
+ refParts: todayParts,
1841
+ monthValues,
1842
+ dayValues,
1843
+ yearValues,
1844
+ hourValues,
1845
+ minuteValues,
1846
+ minParts: this.minParts,
1847
+ maxParts: this.maxParts,
1848
+ });
1849
+ this.processValue(this.value);
1850
+ this.emitStyle();
1851
+ }
1852
+ emitStyle() {
1853
+ this.ionStyle.emit({
1854
+ interactive: true,
1855
+ datetime: true,
1856
+ 'interactive-disabled': this.disabled,
1857
+ });
1858
+ }
1859
+ /**
1860
+ * Universal render methods
1861
+ * These are pieces of datetime that
1862
+ * are rendered independently of presentation.
1863
+ */
1864
+ renderFooter() {
1865
+ const theme = getIonTheme(this);
1866
+ const { disabled, readonly, showDefaultButtons, showClearButton } = this;
1867
+ /**
1868
+ * The cancel, clear, and confirm buttons
1869
+ * should not be interactive if the datetime
1870
+ * is disabled or readonly.
1871
+ */
1872
+ const isButtonDisabled = disabled || readonly;
1873
+ const confirmFill = theme === 'ionic' ? 'solid' : undefined;
1874
+ const hasSlottedButtons = this.el.querySelector('[slot="buttons"]') !== null;
1875
+ if (!hasSlottedButtons && !showDefaultButtons && !showClearButton) {
1876
+ return;
1877
+ }
1878
+ const clearButtonClick = () => {
1879
+ this.reset();
1880
+ this.setValue(undefined);
1881
+ };
1882
+ /**
1883
+ * By default we render two buttons:
1884
+ * Cancel - Dismisses the datetime and
1885
+ * does not update the `value` prop.
1886
+ * OK - Dismisses the datetime and
1887
+ * updates the `value` prop.
1888
+ */
1889
+ return (h("div", { class: "datetime-footer" }, h("div", { class: "datetime-buttons" }, h("div", { class: {
1890
+ ['datetime-action-buttons']: true,
1891
+ ['has-clear-button']: this.showClearButton,
1892
+ } }, h("slot", { name: "buttons" }, showDefaultButtons && (h("ion-button", { id: "cancel-button", color: this.color, onClick: () => this.cancel(true), disabled: isButtonDisabled }, this.cancelText)), h("div", { class: "datetime-action-buttons-container" }, showClearButton && (h("ion-button", { id: "clear-button", color: this.color, onClick: () => clearButtonClick(), disabled: isButtonDisabled }, this.clearText)), showDefaultButtons && (h("ion-button", { id: "confirm-button", fill: confirmFill, color: this.color, onClick: () => this.confirm(true), disabled: isButtonDisabled }, this.doneText))))))));
1893
+ }
1894
+ /**
1895
+ * Wheel picker render methods
1896
+ */
1897
+ renderWheelPicker(forcePresentation = this.presentation) {
1898
+ /**
1899
+ * If presentation="time-date" we switch the
1900
+ * order of the render array here instead of
1901
+ * manually reordering each date/time picker
1902
+ * column with CSS. This allows for additional
1903
+ * flexibility if we need to render subsets
1904
+ * of the date/time data or do additional ordering
1905
+ * within the child render functions.
1906
+ */
1907
+ const renderArray = forcePresentation === 'time-date'
1908
+ ? [this.renderTimePickerColumns(forcePresentation), this.renderDatePickerColumns(forcePresentation)]
1909
+ : [this.renderDatePickerColumns(forcePresentation), this.renderTimePickerColumns(forcePresentation)];
1910
+ return h("ion-picker", { class: FOCUS_TRAP_DISABLE_CLASS }, renderArray);
1911
+ }
1912
+ renderDatePickerColumns(forcePresentation) {
1913
+ return forcePresentation === 'date-time' || forcePresentation === 'time-date'
1914
+ ? this.renderCombinedDatePickerColumn()
1915
+ : this.renderIndividualDatePickerColumns(forcePresentation);
1916
+ }
1917
+ renderCombinedDatePickerColumn() {
1918
+ const { defaultParts, disabled, workingParts, locale, minParts, maxParts, todayParts, isDateEnabled } = this;
1919
+ const activePart = this.getActivePartsWithFallback();
1920
+ /**
1921
+ * By default, generate a range of 3 months:
1922
+ * Previous month, current month, and next month
1923
+ */
1924
+ const monthsToRender = generateMonths(workingParts);
1925
+ const lastMonth = monthsToRender[monthsToRender.length - 1];
1926
+ /**
1927
+ * Ensure that users can select the entire window of dates.
1928
+ */
1929
+ monthsToRender[0].day = 1;
1930
+ lastMonth.day = getNumDaysInMonth(lastMonth.month, lastMonth.year);
1931
+ /**
1932
+ * Narrow the dates rendered based on min/max dates (if any).
1933
+ * The `min` date is used if the min is after the generated min month.
1934
+ * The `max` date is used if the max is before the generated max month.
1935
+ * This ensures that the sliding window always stays at 3 months
1936
+ * but still allows future dates to be lazily rendered based on any min/max
1937
+ * constraints.
1938
+ */
1939
+ const min = minParts !== undefined && isAfter(minParts, monthsToRender[0]) ? minParts : monthsToRender[0];
1940
+ const max = maxParts !== undefined && isBefore(maxParts, lastMonth) ? maxParts : lastMonth;
1941
+ const result = getCombinedDateColumnData(locale, todayParts, min, max, this.parsedDayValues, this.parsedMonthValues);
1942
+ let items = result.items;
1943
+ const parts = result.parts;
1944
+ if (isDateEnabled) {
1945
+ items = items.map((itemObject, index) => {
1946
+ const referenceParts = parts[index];
1947
+ let disabled;
1948
+ try {
1949
+ /**
1950
+ * The `isDateEnabled` implementation is try-catch wrapped
1951
+ * to prevent exceptions in the user's function from
1952
+ * interrupting the calendar rendering.
1953
+ */
1954
+ disabled = !isDateEnabled(convertDataToISO(referenceParts));
1955
+ }
1956
+ catch (e) {
1957
+ printIonError('[ion-datetime] - Exception thrown from provided `isDateEnabled` function. Please check your function and try again.', e);
1958
+ }
1959
+ return Object.assign(Object.assign({}, itemObject), { disabled });
1960
+ });
1961
+ }
1962
+ /**
1963
+ * If we have selected a day already, then default the column
1964
+ * to that value. Otherwise, set it to the default date.
1965
+ */
1966
+ const todayString = workingParts.day !== null
1967
+ ? `${workingParts.year}-${workingParts.month}-${workingParts.day}`
1968
+ : `${defaultParts.year}-${defaultParts.month}-${defaultParts.day}`;
1969
+ return (h("ion-picker-column", { part: WHEEL_PART, "aria-label": "Select a date", class: "date-column", color: this.color, disabled: disabled, value: todayString, onIonChange: (ev) => {
1970
+ const { value } = ev.detail;
1971
+ const findPart = parts.find(({ month, day, year }) => value === `${year}-${month}-${day}`);
1972
+ this.setWorkingParts(Object.assign(Object.assign({}, workingParts), findPart));
1973
+ this.setActiveParts(Object.assign(Object.assign({}, activePart), findPart));
1974
+ ev.stopPropagation();
1975
+ } }, items.map((item) => (h("ion-picker-column-option", { part: item.value === todayString ? `${WHEEL_ITEM_PART} ${WHEEL_ITEM_ACTIVE_PART}` : WHEEL_ITEM_PART, key: item.value, disabled: item.disabled, value: item.value }, item.text)))));
1976
+ }
1977
+ renderIndividualDatePickerColumns(forcePresentation) {
1978
+ const { workingParts, isDateEnabled } = this;
1979
+ const shouldRenderMonths = forcePresentation !== 'year' && forcePresentation !== 'time';
1980
+ const months = shouldRenderMonths
1981
+ ? getMonthColumnData(this.locale, workingParts, this.minParts, this.maxParts, this.parsedMonthValues)
1982
+ : [];
1983
+ const shouldRenderDays = forcePresentation === 'date';
1984
+ let days = shouldRenderDays
1985
+ ? getDayColumnData(this.locale, workingParts, this.minParts, this.maxParts, this.parsedDayValues)
1986
+ : [];
1987
+ if (isDateEnabled) {
1988
+ days = days.map((dayObject) => {
1989
+ const { value } = dayObject;
1990
+ const valueNum = typeof value === 'string' ? parseInt(value) : value;
1991
+ const referenceParts = {
1992
+ month: workingParts.month,
1993
+ day: valueNum,
1994
+ year: workingParts.year,
1995
+ };
1996
+ let disabled;
1997
+ try {
1998
+ /**
1999
+ * The `isDateEnabled` implementation is try-catch wrapped
2000
+ * to prevent exceptions in the user's function from
2001
+ * interrupting the calendar rendering.
2002
+ */
2003
+ disabled = !isDateEnabled(convertDataToISO(referenceParts));
2004
+ }
2005
+ catch (e) {
2006
+ printIonError('[ion-datetime] - Exception thrown from provided `isDateEnabled` function. Please check your function and try again.', e);
2007
+ }
2008
+ return Object.assign(Object.assign({}, dayObject), { disabled });
2009
+ });
2010
+ }
2011
+ const shouldRenderYears = forcePresentation !== 'month' && forcePresentation !== 'time';
2012
+ const years = shouldRenderYears
2013
+ ? getYearColumnData(this.locale, this.defaultParts, this.minParts, this.maxParts, this.parsedYearValues)
2014
+ : [];
2015
+ /**
2016
+ * Certain locales show the day before the month.
2017
+ */
2018
+ const showMonthFirst = isMonthFirstLocale(this.locale, { month: 'numeric', day: 'numeric' });
2019
+ let renderArray = [];
2020
+ if (showMonthFirst) {
2021
+ renderArray = [
2022
+ this.renderMonthPickerColumn(months),
2023
+ this.renderDayPickerColumn(days),
2024
+ this.renderYearPickerColumn(years),
2025
+ ];
2026
+ }
2027
+ else {
2028
+ renderArray = [
2029
+ this.renderDayPickerColumn(days),
2030
+ this.renderMonthPickerColumn(months),
2031
+ this.renderYearPickerColumn(years),
2032
+ ];
2033
+ }
2034
+ return renderArray;
2035
+ }
2036
+ renderDayPickerColumn(days) {
2037
+ var _a;
2038
+ if (days.length === 0) {
2039
+ return [];
2040
+ }
2041
+ const { disabled, workingParts } = this;
2042
+ const activePart = this.getActivePartsWithFallback();
2043
+ const pickerColumnValue = (_a = (workingParts.day !== null ? workingParts.day : this.defaultParts.day)) !== null && _a !== void 0 ? _a : undefined;
2044
+ return (h("ion-picker-column", { part: WHEEL_PART, "aria-label": "Select a day", class: "day-column", color: this.color, disabled: disabled, value: pickerColumnValue, onIonChange: (ev) => {
2045
+ this.setWorkingParts(Object.assign(Object.assign({}, workingParts), { day: ev.detail.value }));
2046
+ this.setActiveParts(Object.assign(Object.assign({}, activePart), { day: ev.detail.value }));
2047
+ ev.stopPropagation();
2048
+ } }, days.map((day) => (h("ion-picker-column-option", { part: day.value === pickerColumnValue ? `${WHEEL_ITEM_PART} ${WHEEL_ITEM_ACTIVE_PART}` : WHEEL_ITEM_PART, key: day.value, disabled: day.disabled, value: day.value }, day.text)))));
2049
+ }
2050
+ renderMonthPickerColumn(months) {
2051
+ if (months.length === 0) {
2052
+ return [];
2053
+ }
2054
+ const { disabled, workingParts } = this;
2055
+ const activePart = this.getActivePartsWithFallback();
2056
+ return (h("ion-picker-column", { part: WHEEL_PART, "aria-label": "Select a month", class: "month-column", color: this.color, disabled: disabled, value: workingParts.month, onIonChange: (ev) => {
2057
+ this.setWorkingParts(Object.assign(Object.assign({}, workingParts), { month: ev.detail.value }));
2058
+ // Month wheel is navigation-only in multi-select mode as a fix for https://github.com/ionic-team/ionic-framework/issues/29673
2059
+ if (!this.multiple) {
2060
+ this.setActiveParts(Object.assign(Object.assign({}, activePart), { month: ev.detail.value }));
2061
+ }
2062
+ ev.stopPropagation();
2063
+ } }, months.map((month) => (h("ion-picker-column-option", { part: month.value === workingParts.month ? `${WHEEL_ITEM_PART} ${WHEEL_ITEM_ACTIVE_PART}` : WHEEL_ITEM_PART, key: month.value, disabled: month.disabled, value: month.value }, month.text)))));
2064
+ }
2065
+ renderYearPickerColumn(years) {
2066
+ if (years.length === 0) {
2067
+ return [];
2068
+ }
2069
+ const { disabled, workingParts } = this;
2070
+ const activePart = this.getActivePartsWithFallback();
2071
+ return (h("ion-picker-column", { part: WHEEL_PART, "aria-label": "Select a year", class: "year-column", color: this.color, disabled: disabled, value: workingParts.year, onIonChange: (ev) => {
2072
+ this.setWorkingParts(Object.assign(Object.assign({}, workingParts), { year: ev.detail.value }));
2073
+ // Year wheel is navigation-only in multi-select mode as a fix for https://github.com/ionic-team/ionic-framework/issues/29673
2074
+ if (!this.multiple) {
2075
+ this.setActiveParts(Object.assign(Object.assign({}, activePart), { year: ev.detail.value }));
2076
+ }
2077
+ ev.stopPropagation();
2078
+ } }, years.map((year) => (h("ion-picker-column-option", { part: year.value === workingParts.year ? `${WHEEL_ITEM_PART} ${WHEEL_ITEM_ACTIVE_PART}` : WHEEL_ITEM_PART, key: year.value, disabled: year.disabled, value: year.value }, year.text)))));
2079
+ }
2080
+ renderTimePickerColumns(forcePresentation) {
2081
+ if (['date', 'month', 'month-year', 'year'].includes(forcePresentation)) {
2082
+ return [];
2083
+ }
2084
+ /**
2085
+ * If a user has not selected a date,
2086
+ * then we should show all times. If the
2087
+ * user has selected a date (even if it has
2088
+ * not been confirmed yet), we should apply
2089
+ * the max and min restrictions so that the
2090
+ * time picker shows values that are
2091
+ * appropriate for the selected date.
2092
+ */
2093
+ const activePart = this.getActivePart();
2094
+ const userHasSelectedDate = activePart !== undefined;
2095
+ const { hoursData, minutesData, dayPeriodData } = getTimeColumnsData(this.locale, this.workingParts, this.hourCycle, userHasSelectedDate ? this.minParts : undefined, userHasSelectedDate ? this.maxParts : undefined, this.parsedHourValues, this.parsedMinuteValues);
2096
+ return [
2097
+ this.renderHourPickerColumn(hoursData),
2098
+ this.renderMinutePickerColumn(minutesData),
2099
+ this.renderDayPeriodPickerColumn(dayPeriodData),
2100
+ ];
2101
+ }
2102
+ renderHourPickerColumn(hoursData) {
2103
+ const { disabled, workingParts } = this;
2104
+ if (hoursData.length === 0)
2105
+ return [];
2106
+ const activePart = this.getActivePartsWithFallback();
2107
+ return (h("ion-picker-column", { part: WHEEL_PART, "aria-label": "Select an hour", color: this.color, disabled: disabled, value: activePart.hour, numericInput: true, onIonChange: (ev) => {
2108
+ this.setWorkingParts(Object.assign(Object.assign({}, workingParts), { hour: ev.detail.value }));
2109
+ this.setActiveParts(Object.assign(Object.assign({}, this.getActivePartsWithFallback()), { hour: ev.detail.value }));
2110
+ ev.stopPropagation();
2111
+ } }, hoursData.map((hour) => (h("ion-picker-column-option", { part: hour.value === activePart.hour ? `${WHEEL_ITEM_PART} ${WHEEL_ITEM_ACTIVE_PART}` : WHEEL_ITEM_PART, key: hour.value, disabled: hour.disabled, value: hour.value }, hour.text)))));
2112
+ }
2113
+ renderMinutePickerColumn(minutesData) {
2114
+ const { disabled, workingParts } = this;
2115
+ if (minutesData.length === 0)
2116
+ return [];
2117
+ const activePart = this.getActivePartsWithFallback();
2118
+ return (h("ion-picker-column", { part: WHEEL_PART, "aria-label": "Select a minute", color: this.color, disabled: disabled, value: activePart.minute, numericInput: true, onIonChange: (ev) => {
2119
+ this.setWorkingParts(Object.assign(Object.assign({}, workingParts), { minute: ev.detail.value }));
2120
+ this.setActiveParts(Object.assign(Object.assign({}, this.getActivePartsWithFallback()), { minute: ev.detail.value }));
2121
+ ev.stopPropagation();
2122
+ } }, minutesData.map((minute) => (h("ion-picker-column-option", { part: minute.value === activePart.minute ? `${WHEEL_ITEM_PART} ${WHEEL_ITEM_ACTIVE_PART}` : WHEEL_ITEM_PART, key: minute.value, disabled: minute.disabled, value: minute.value }, minute.text)))));
2123
+ }
2124
+ renderDayPeriodPickerColumn(dayPeriodData) {
2125
+ const { disabled, workingParts } = this;
2126
+ if (dayPeriodData.length === 0) {
2127
+ return [];
2128
+ }
2129
+ const activePart = this.getActivePartsWithFallback();
2130
+ const isDayPeriodRTL = isLocaleDayPeriodRTL(this.locale);
2131
+ return (h("ion-picker-column", { part: WHEEL_PART, "aria-label": "Select a day period", style: isDayPeriodRTL ? { order: '-1' } : {}, color: this.color, disabled: disabled, value: activePart.ampm, onIonChange: (ev) => {
2132
+ const hour = calculateHourFromAMPM(workingParts, ev.detail.value);
2133
+ this.setWorkingParts(Object.assign(Object.assign({}, workingParts), { ampm: ev.detail.value, hour }));
2134
+ this.setActiveParts(Object.assign(Object.assign({}, this.getActivePartsWithFallback()), { ampm: ev.detail.value, hour }));
2135
+ ev.stopPropagation();
2136
+ } }, dayPeriodData.map((dayPeriod) => (h("ion-picker-column-option", { part: dayPeriod.value === activePart.ampm ? `${WHEEL_ITEM_PART} ${WHEEL_ITEM_ACTIVE_PART}` : WHEEL_ITEM_PART, key: dayPeriod.value, disabled: dayPeriod.disabled, value: dayPeriod.value }, dayPeriod.text)))));
2137
+ }
2138
+ renderWheelView(forcePresentation) {
2139
+ const { locale } = this;
2140
+ const showMonthFirst = isMonthFirstLocale(locale);
2141
+ const columnOrder = showMonthFirst ? 'month-first' : 'year-first';
2142
+ return (h("div", { class: {
2143
+ [`wheel-order-${columnOrder}`]: true,
2144
+ } }, this.renderWheelPicker(forcePresentation)));
2145
+ }
2146
+ /**
2147
+ * Grid Render Methods
2148
+ */
2149
+ renderCalendarHeader(theme) {
2150
+ const { disabled, datetimeNextIcon, datetimePreviousIcon, datetimeCollapsedIcon, datetimeExpandedIcon } = this;
2151
+ const prevMonthDisabled = disabled || isPrevMonthDisabled(this.workingParts, this.minParts, this.maxParts);
2152
+ const nextMonthDisabled = disabled || isNextMonthDisabled(this.workingParts, this.maxParts);
2153
+ // don't use the inheritAttributes util because it removes dir from the host, and we still need that
2154
+ const hostDir = this.el.getAttribute('dir') || undefined;
2155
+ return (h("div", { class: "calendar-header", part: "calendar-header" }, h("div", { class: "calendar-action-buttons" }, h("div", { class: "calendar-month-year" }, h("button", { class: {
2156
+ 'calendar-month-year-toggle': true,
2157
+ 'ion-activatable': true,
2158
+ 'ion-focusable': true,
2159
+ }, part: "month-year-button", disabled: disabled, "aria-label": this.showMonthAndYear ? 'Hide year picker' : 'Show year picker', onClick: () => this.toggleMonthAndYearView() }, h("span", { id: "toggle-wrapper" }, getMonthAndYear(this.locale, this.workingParts), theme !== 'ionic' && (h("ion-icon", { "aria-hidden": "true", icon: this.showMonthAndYear ? datetimeExpandedIcon : datetimeCollapsedIcon, lazy: false, flipRtl: true }))), theme === 'md' && h("ion-ripple-effect", null))), h("div", { class: "calendar-next-prev" }, h("ion-button", { "aria-label": "Previous month", disabled: prevMonthDisabled, onClick: () => this.prevMonth(), part: "navigation-button previous-button" }, h("ion-icon", { dir: hostDir, "aria-hidden": "true", slot: "icon-only", icon: datetimePreviousIcon, lazy: false, flipRtl: true })), h("ion-button", { "aria-label": "Next month", disabled: nextMonthDisabled, onClick: () => this.nextMonth(), part: "navigation-button next-button" }, h("ion-icon", { dir: hostDir, "aria-hidden": "true", slot: "icon-only", icon: datetimeNextIcon, lazy: false, flipRtl: true })))), h("div", { class: "calendar-days-of-week", "aria-hidden": "true", part: "calendar-days-of-week" }, getDaysOfWeek(this.locale, theme, this.firstDayOfWeek % 7).map((d) => {
2160
+ return h("div", { class: "day-of-week" }, d);
2161
+ }))));
2162
+ }
2163
+ renderMonth(month, year) {
2164
+ const { disabled, readonly } = this;
2165
+ const yearAllowed = this.parsedYearValues === undefined || this.parsedYearValues.includes(year);
2166
+ const monthAllowed = this.parsedMonthValues === undefined || this.parsedMonthValues.includes(month);
2167
+ const isCalMonthDisabled = !yearAllowed || !monthAllowed;
2168
+ const isDatetimeDisabled = disabled || readonly;
2169
+ const swipeDisabled = disabled ||
2170
+ isMonthDisabled({
2171
+ month,
2172
+ year,
2173
+ day: null,
2174
+ }, {
2175
+ // The day is not used when checking if a month is disabled.
2176
+ // Users should be able to access the min or max month, even if the
2177
+ // min/max date is out of bounds (e.g. min is set to Feb 15, Feb should not be disabled).
2178
+ minParts: Object.assign(Object.assign({}, this.minParts), { day: null }),
2179
+ maxParts: Object.assign(Object.assign({}, this.maxParts), { day: null }),
2180
+ });
2181
+ // The working month should never have swipe disabled.
2182
+ // Otherwise the CSS scroll snap will not work and the user
2183
+ // can free-scroll the calendar.
2184
+ const isWorkingMonth = this.workingParts.month === month && this.workingParts.year === year;
2185
+ const activePart = this.getActivePartsWithFallback();
2186
+ return (h("div", { "aria-hidden": !isWorkingMonth ? 'true' : null, class: {
2187
+ 'calendar-month': true,
2188
+ // Prevents scroll snap swipe gestures for months outside of the min/max bounds
2189
+ 'calendar-month-disabled': !isWorkingMonth && swipeDisabled,
2190
+ } }, h("div", { class: "calendar-month-grid" }, getDaysOfMonth(month, year, this.firstDayOfWeek % 7, this.showAdjacentDays).map((dateObject, index) => {
2191
+ const { day, dayOfWeek, isAdjacentDay } = dateObject;
2192
+ const { el, highlightedDates, isDateEnabled, multiple, showAdjacentDays } = this;
2193
+ let _month = month;
2194
+ let _year = year;
2195
+ if (showAdjacentDays && isAdjacentDay && day !== null) {
2196
+ if (day > 20) {
2197
+ // Leading with the adjacent day from the previous month
2198
+ // if its a adjacent day and is higher than '20' (last week even in feb)
2199
+ if (month === 1) {
2200
+ _year = year - 1;
2201
+ _month = 12;
2202
+ }
2203
+ else {
2204
+ _month = month - 1;
2205
+ }
2206
+ }
2207
+ else if (day < 15) {
2208
+ // Leading with the adjacent day from the next month
2209
+ // if its a adjacent day and is lower than '15' (first two weeks)
2210
+ if (month === 12) {
2211
+ _year = year + 1;
2212
+ _month = 1;
2213
+ }
2214
+ else {
2215
+ _month = month + 1;
2216
+ }
2217
+ }
2218
+ }
2219
+ const referenceParts = { month: _month, day, year: _year, isAdjacentDay };
2220
+ const isCalendarPadding = day === null;
2221
+ const { isActive, isToday, ariaLabel, ariaSelected, disabled: isDayDisabled, text, } = getCalendarDayState(this.locale, referenceParts, this.activeParts, this.todayParts, this.minParts, this.maxParts, this.parsedDayValues);
2222
+ const dateIsoString = convertDataToISO(referenceParts);
2223
+ let isCalDayDisabled = isCalMonthDisabled || isDayDisabled;
2224
+ if (!isCalDayDisabled && isDateEnabled !== undefined) {
2225
+ try {
2226
+ /**
2227
+ * The `isDateEnabled` implementation is try-catch wrapped
2228
+ * to prevent exceptions in the user's function from
2229
+ * interrupting the calendar rendering.
2230
+ */
2231
+ isCalDayDisabled = !isDateEnabled(dateIsoString);
2232
+ }
2233
+ catch (e) {
2234
+ printIonError('[ion-datetime] - Exception thrown from provided `isDateEnabled` function. Please check your function and try again.', el, e);
2235
+ }
2236
+ }
2237
+ /**
2238
+ * Some days are constrained through max & min or allowed dates
2239
+ * and also disabled because the component is readonly or disabled.
2240
+ * These need to be displayed differently.
2241
+ */
2242
+ const isCalDayConstrained = isCalDayDisabled && isDatetimeDisabled;
2243
+ const isButtonDisabled = isCalDayDisabled || isDatetimeDisabled;
2244
+ let dateStyle = undefined;
2245
+ /**
2246
+ * Custom highlight styles should not override the style for selected dates,
2247
+ * nor apply to "filler days" at the start of the grid.
2248
+ */
2249
+ if (highlightedDates !== undefined && !isActive && day !== null && !isAdjacentDay) {
2250
+ dateStyle = getHighlightStyles(highlightedDates, dateIsoString, el);
2251
+ }
2252
+ let dateParts = undefined;
2253
+ // "Filler days" at the beginning of the grid should not get the calendar day
2254
+ // CSS parts added to them
2255
+ if (!isCalendarPadding && !isAdjacentDay) {
2256
+ dateParts = `calendar-day${isActive ? ' active' : ''}${isToday ? ' today' : ''}${isCalDayDisabled ? ' disabled' : ''}`;
2257
+ }
2258
+ else if (isAdjacentDay) {
2259
+ dateParts = `calendar-day${isCalDayDisabled ? ' disabled' : ''}`;
2260
+ }
2261
+ return (h("div", { class: "calendar-day-wrapper" }, h("button", {
2262
+ // We need to use !important for the inline styles here because
2263
+ // otherwise the CSS shadow parts will override these styles.
2264
+ // See https://github.com/WICG/webcomponents/issues/847
2265
+ // Both the CSS shadow parts and highlightedDates styles are
2266
+ // provided by the developer, but highlightedDates styles should
2267
+ // always take priority.
2268
+ ref: (el) => {
2269
+ if (el) {
2270
+ el.style.setProperty('color', `${dateStyle ? dateStyle.textColor : ''}`, 'important');
2271
+ el.style.setProperty('background-color', `${dateStyle ? dateStyle.backgroundColor : ''}`, 'important');
2272
+ el.style.setProperty('border', `${dateStyle ? dateStyle.border : ''}`, 'important');
2273
+ }
2274
+ }, tabindex: "-1", "data-day": day, "data-month": _month, "data-year": _year, "data-index": index, "data-day-of-week": dayOfWeek, disabled: isButtonDisabled, class: {
2275
+ 'calendar-day-padding': isCalendarPadding,
2276
+ 'calendar-day': true,
2277
+ 'calendar-day-active': isActive,
2278
+ 'calendar-day-constrained': isCalDayConstrained,
2279
+ 'calendar-day-today': isToday,
2280
+ 'calendar-day-adjacent-day': isAdjacentDay,
2281
+ }, part: dateParts, "aria-hidden": isCalendarPadding ? 'true' : null, "aria-selected": ariaSelected, "aria-label": ariaLabel, onClick: () => {
2282
+ if (isCalendarPadding) {
2283
+ return;
2284
+ }
2285
+ if (isAdjacentDay) {
2286
+ // The user selected a day outside the current month. Ignore this button, as the month will be re-rendered.
2287
+ this.el.blur();
2288
+ this.activeParts = Object.assign(Object.assign({}, activePart), referenceParts);
2289
+ this.animateToDate(referenceParts);
2290
+ this.confirm();
2291
+ }
2292
+ else {
2293
+ this.setWorkingParts(Object.assign(Object.assign({}, this.workingParts), referenceParts));
2294
+ // Multiple only needs date info so we can wipe out other fields like time.
2295
+ if (multiple) {
2296
+ this.setActiveParts(referenceParts, isActive);
2297
+ }
2298
+ else {
2299
+ this.setActiveParts(Object.assign(Object.assign({}, activePart), referenceParts));
2300
+ }
2301
+ }
2302
+ }
2303
+ }, text)));
2304
+ }))));
2305
+ }
2306
+ renderCalendarBody() {
2307
+ return (h("div", { class: "calendar-body ion-focusable", ref: (el) => (this.calendarBodyRef = el), tabindex: "0" }, generateMonths(this.workingParts, this.forceRenderDate).map(({ month, year }) => {
2308
+ return this.renderMonth(month, year);
2309
+ })));
2310
+ }
2311
+ renderCalendar(theme) {
2312
+ return (h("div", { class: "datetime-calendar", key: "datetime-calendar" }, this.renderCalendarHeader(theme), this.renderCalendarBody()));
2313
+ }
2314
+ renderTimeLabel() {
2315
+ const hasSlottedTimeLabel = this.el.querySelector('[slot="time-label"]') !== null;
2316
+ if (!hasSlottedTimeLabel && !this.showDefaultTimeLabel) {
2317
+ return;
2318
+ }
2319
+ return h("slot", { name: "time-label" }, "Time");
2320
+ }
2321
+ renderTimeOverlay() {
2322
+ const { disabled, hourCycle, isTimePopoverOpen, locale, formatOptions } = this;
2323
+ const computedHourCycle = getHourCycle(locale, hourCycle);
2324
+ const activePart = this.getActivePartsWithFallback();
2325
+ return [
2326
+ h("div", { class: "time-header" }, this.renderTimeLabel()),
2327
+ h("button", { class: {
2328
+ 'time-body': true,
2329
+ 'time-body-active': isTimePopoverOpen,
2330
+ }, part: `time-button${isTimePopoverOpen ? ' active' : ''}`, "aria-expanded": "false", "aria-haspopup": "true", disabled: disabled, onClick: async (ev) => {
2331
+ const { popoverRef } = this;
2332
+ if (popoverRef) {
2333
+ this.isTimePopoverOpen = true;
2334
+ popoverRef.present(new CustomEvent('ionShadowTarget', {
2335
+ detail: {
2336
+ ionShadowTarget: ev.target,
2337
+ },
2338
+ }));
2339
+ await popoverRef.onWillDismiss();
2340
+ this.isTimePopoverOpen = false;
2341
+ }
2342
+ } }, getLocalizedTime(locale, activePart, computedHourCycle, formatOptions === null || formatOptions === void 0 ? void 0 : formatOptions.time)),
2343
+ h("ion-popover", { alignment: "center", translucent: true, overlayIndex: 1, arrow: false, onWillPresent: (ev) => {
2344
+ /**
2345
+ * Intersection Observers do not consistently fire between Blink and Webkit
2346
+ * when toggling the visibility of the popover and trying to scroll the picker
2347
+ * column to the correct time value.
2348
+ *
2349
+ * This will correctly scroll the element position to the correct time value,
2350
+ * before the popover is fully presented.
2351
+ */
2352
+ const cols = ev.target.querySelectorAll('ion-picker-column');
2353
+ // TODO (FW-615): Potentially remove this when intersection observers are fixed in picker column
2354
+ cols.forEach((col) => col.scrollActiveItemIntoView());
2355
+ }, style: {
2356
+ '--offset-y': '-10px',
2357
+ '--min-width': 'fit-content',
2358
+ },
2359
+ // Allow native browser keyboard events to support up/down/home/end key
2360
+ // navigation within the time picker.
2361
+ keyboardEvents: true, ref: (el) => (this.popoverRef = el) }, this.renderWheelPicker('time')),
2362
+ ];
2363
+ }
2364
+ getHeaderSelectedDateText() {
2365
+ var _a;
2366
+ const { activeParts, formatOptions, multiple, titleSelectedDatesFormatter } = this;
2367
+ const isArray = Array.isArray(activeParts);
2368
+ let headerText;
2369
+ if (multiple && isArray && activeParts.length !== 1) {
2370
+ headerText = `${activeParts.length} days`; // default/fallback for multiple selection
2371
+ if (titleSelectedDatesFormatter !== undefined) {
2372
+ try {
2373
+ headerText = titleSelectedDatesFormatter(convertDataToISO(activeParts));
2374
+ }
2375
+ catch (e) {
2376
+ printIonError('[ion-datetime] - Exception in provided `titleSelectedDatesFormatter`:', e);
2377
+ }
2378
+ }
2379
+ }
2380
+ else {
2381
+ // for exactly 1 day selected (multiple set or not), show a formatted version of that
2382
+ headerText = getLocalizedDateTime(this.locale, this.getActivePartsWithFallback(), (_a = formatOptions === null || formatOptions === void 0 ? void 0 : formatOptions.date) !== null && _a !== void 0 ? _a : { weekday: 'short', month: 'short', day: 'numeric' });
2383
+ }
2384
+ return headerText;
2385
+ }
2386
+ renderHeader(showExpandedHeader = true) {
2387
+ const hasSlottedTitle = this.el.querySelector('[slot="title"]') !== null;
2388
+ if (!hasSlottedTitle && !this.showDefaultTitle) {
2389
+ return;
2390
+ }
2391
+ return (h("div", { class: "datetime-header", part: "datetime-header" }, h("div", { class: "datetime-title", part: "datetime-title" }, h("slot", { name: "title" }, "Select Date")), showExpandedHeader && (h("div", { class: "datetime-selected-date", part: "datetime-selected-date" }, this.getHeaderSelectedDateText()))));
2392
+ }
2393
+ /**
2394
+ * Render time picker inside of datetime.
2395
+ * Do not pass color prop to segment on
2396
+ * iOS mode. MD segment has been customized and
2397
+ * should take on the color prop, but iOS
2398
+ * should just be the default segment.
2399
+ */
2400
+ renderTime() {
2401
+ const { presentation } = this;
2402
+ const timeOnlyPresentation = presentation === 'time';
2403
+ return (h("div", { class: "datetime-time" }, timeOnlyPresentation ? this.renderWheelPicker() : this.renderTimeOverlay()));
2404
+ }
2405
+ /**
2406
+ * Renders the month/year picker that is
2407
+ * displayed on the calendar grid.
2408
+ * The .datetime-year class has additional
2409
+ * styles that let us show/hide the
2410
+ * picker when the user clicks on the
2411
+ * toggle in the calendar header.
2412
+ */
2413
+ renderCalendarViewMonthYearPicker() {
2414
+ return h("div", { class: "datetime-year" }, this.renderWheelView('month-year'));
2415
+ }
2416
+ /**
2417
+ * Render entry point
2418
+ * All presentation types are rendered from here.
2419
+ */
2420
+ renderDatetime(theme) {
2421
+ const { presentation, preferWheel } = this;
2422
+ /**
2423
+ * Certain presentation types have separate grid and wheel displays.
2424
+ * If preferWheel is true then we should show a wheel picker instead.
2425
+ */
2426
+ const hasWheelVariant = presentation === 'date' || presentation === 'date-time' || presentation === 'time-date';
2427
+ if (preferWheel && hasWheelVariant) {
2428
+ return [this.renderHeader(false), this.renderWheelView(), this.renderFooter()];
2429
+ }
2430
+ switch (presentation) {
2431
+ case 'date-time':
2432
+ return [
2433
+ this.renderHeader(),
2434
+ this.renderCalendar(theme),
2435
+ this.renderCalendarViewMonthYearPicker(),
2436
+ this.renderTime(),
2437
+ this.renderFooter(),
2438
+ ];
2439
+ case 'time-date':
2440
+ return [
2441
+ this.renderHeader(),
2442
+ this.renderTime(),
2443
+ this.renderCalendar(theme),
2444
+ this.renderCalendarViewMonthYearPicker(),
2445
+ this.renderFooter(),
2446
+ ];
2447
+ case 'time':
2448
+ return [this.renderHeader(false), this.renderTime(), this.renderFooter()];
2449
+ case 'month':
2450
+ case 'month-year':
2451
+ case 'year':
2452
+ return [this.renderHeader(false), this.renderWheelView(), this.renderFooter()];
2453
+ default:
2454
+ return [
2455
+ this.renderHeader(),
2456
+ this.renderCalendar(theme),
2457
+ this.renderCalendarViewMonthYearPicker(),
2458
+ this.renderFooter(),
2459
+ ];
2460
+ }
2461
+ }
2462
+ /**
2463
+ * Get the icon to use for the next icon.
2464
+ * Use the icon set in the config.
2465
+ * If no icon is set in the config, use the default icon.
2466
+ */
2467
+ get datetimeNextIcon() {
2468
+ // Return the configured datetime next icon or the default icon
2469
+ return config.get('datetimeNextIcon', chevronForward);
2470
+ }
2471
+ /**
2472
+ * Get the icon to use for the previous icon.
2473
+ * Use the icon set in the config.
2474
+ * If no icon is set in the config, use the default icon.
2475
+ */
2476
+ get datetimePreviousIcon() {
2477
+ // Return the configured datetime previous icon or the default icon
2478
+ return config.get('datetimePreviousIcon', chevronBack);
2479
+ }
2480
+ /**
2481
+ * Get the icon to use for the show month and year icon.
2482
+ * Use the icon set in the config.
2483
+ * If no icon is set in the config, use the default icon.
2484
+ */
2485
+ get datetimeCollapsedIcon() {
2486
+ // Determine the theme and map to the default icon
2487
+ const theme = getIonTheme(this);
2488
+ const defaultIcon = theme === 'ios' ? chevronForward : caretDownSharp;
2489
+ // Return the configured datetime show month and year icon or the default icon
2490
+ return config.get('datetimeCollapsedIcon', defaultIcon);
2491
+ }
2492
+ /**
2493
+ * Get the icon to use for the hide month and year icon.
2494
+ * Use the icon set in the config.
2495
+ * If no icon is set in the config, use the default icon.
2496
+ */
2497
+ get datetimeExpandedIcon() {
2498
+ // Determine the theme and map to the default icon
2499
+ const theme = getIonTheme(this);
2500
+ const defaultIcon = theme === 'ios' ? chevronDown : caretUpSharp;
2501
+ // Return the configured datetime hide month and year icon or the default icon
2502
+ return config.get('datetimeExpandedIcon', defaultIcon);
2503
+ }
2504
+ render() {
2505
+ const { name, value, disabled, el, color, readonly, showMonthAndYear, preferWheel, presentation, size, isGridStyle, } = this;
2506
+ const theme = getIonTheme(this);
2507
+ const isMonthAndYearPresentation = presentation === 'year' || presentation === 'month' || presentation === 'month-year';
2508
+ const shouldShowMonthAndYear = showMonthAndYear || isMonthAndYearPresentation;
2509
+ const monthYearPickerOpen = showMonthAndYear && !isMonthAndYearPresentation;
2510
+ const hasDatePresentation = presentation === 'date' || presentation === 'date-time' || presentation === 'time-date';
2511
+ const hasWheelVariant = hasDatePresentation && preferWheel;
2512
+ renderHiddenInput(true, el, name, formatValue(value), disabled);
2513
+ return (h(Host, { key: '81d6d431595fc287861af22aff9cad3b94f4ce97', "aria-disabled": disabled ? 'true' : null, onFocus: this.onFocus, onBlur: this.onBlur, class: Object.assign({}, createColorClasses(color, {
2514
+ [theme]: true,
2515
+ ['datetime-readonly']: readonly,
2516
+ ['datetime-disabled']: disabled,
2517
+ 'show-month-and-year': shouldShowMonthAndYear,
2518
+ 'month-year-picker-open': monthYearPickerOpen,
2519
+ [`datetime-presentation-${presentation}`]: true,
2520
+ [`datetime-size-${size}`]: true,
2521
+ [`datetime-prefer-wheel`]: hasWheelVariant,
2522
+ [`datetime-grid`]: isGridStyle,
2523
+ })) }, h("div", { key: 'a5043ea9c7cabb5333edf82c8563fac2f6488086', class: "intersection-tracker", ref: (el) => (this.intersectionTrackerRef = el) }), this.renderDatetime(theme)));
2524
+ }
2525
+ get el() { return getElement(this); }
2526
+ static get watchers() { return {
2527
+ "formatOptions": [{
2528
+ "formatOptionsChanged": 0
2529
+ }],
2530
+ "disabled": [{
2531
+ "disabledChanged": 0
2532
+ }],
2533
+ "min": [{
2534
+ "minChanged": 0
2535
+ }],
2536
+ "max": [{
2537
+ "maxChanged": 0
2538
+ }],
2539
+ "presentation": [{
2540
+ "presentationChanged": 0
2541
+ }],
2542
+ "yearValues": [{
2543
+ "yearValuesChanged": 0
2544
+ }],
2545
+ "monthValues": [{
2546
+ "monthValuesChanged": 0
2547
+ }],
2548
+ "dayValues": [{
2549
+ "dayValuesChanged": 0
2550
+ }],
2551
+ "hourValues": [{
2552
+ "hourValuesChanged": 0
2553
+ }],
2554
+ "minuteValues": [{
2555
+ "minuteValuesChanged": 0
2556
+ }],
2557
+ "value": [{
2558
+ "valueChanged": 0
2559
+ }]
2560
+ }; }
2561
+ };
2562
+ let datetimeIds = 0;
2563
+ const CANCEL_ROLE = 'datetime-cancel';
2564
+ const CONFIRM_ROLE = 'datetime-confirm';
2565
+ const WHEEL_PART = 'wheel';
2566
+ const WHEEL_ITEM_PART = 'wheel-item';
2567
+ const WHEEL_ITEM_ACTIVE_PART = `active`;
2568
+ Datetime.style = {
2569
+ ionic: datetimeIonicCss(),
2570
+ ios: datetimeIosCss(),
2571
+ md: datetimeMdCss()
2572
+ };
2573
+
2574
+ /**
2575
+ * iOS Picker Enter Animation
2576
+ */
2577
+ const iosEnterAnimation = (baseEl) => {
2578
+ const baseAnimation = createAnimation();
2579
+ const backdropAnimation = createAnimation();
2580
+ const wrapperAnimation = createAnimation();
2581
+ backdropAnimation
2582
+ .addElement(baseEl.querySelector('ion-backdrop'))
2583
+ .fromTo('opacity', 0.01, 'var(--backdrop-opacity)')
2584
+ .beforeStyles({
2585
+ 'pointer-events': 'none',
2586
+ })
2587
+ .afterClearStyles(['pointer-events']);
2588
+ wrapperAnimation
2589
+ .addElement(baseEl.querySelector('.picker-wrapper'))
2590
+ .fromTo('transform', 'translateY(100%)', 'translateY(0%)');
2591
+ return baseAnimation
2592
+ .addElement(baseEl)
2593
+ .easing('cubic-bezier(.36,.66,.04,1)')
2594
+ .duration(400)
2595
+ .addAnimation([backdropAnimation, wrapperAnimation]);
2596
+ };
2597
+
2598
+ /**
2599
+ * iOS Picker Leave Animation
2600
+ */
2601
+ const iosLeaveAnimation = (baseEl) => {
2602
+ const baseAnimation = createAnimation();
2603
+ const backdropAnimation = createAnimation();
2604
+ const wrapperAnimation = createAnimation();
2605
+ backdropAnimation
2606
+ .addElement(baseEl.querySelector('ion-backdrop'))
2607
+ .fromTo('opacity', 'var(--backdrop-opacity)', 0.01);
2608
+ wrapperAnimation
2609
+ .addElement(baseEl.querySelector('.picker-wrapper'))
2610
+ .fromTo('transform', 'translateY(0%)', 'translateY(100%)');
2611
+ return baseAnimation
2612
+ .addElement(baseEl)
2613
+ .easing('cubic-bezier(.36,.66,.04,1)')
2614
+ .duration(400)
2615
+ .addAnimation([backdropAnimation, wrapperAnimation]);
2616
+ };
2617
+
2618
+ 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}`;
2619
+
2620
+ 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}`;
2621
+
2622
+ const Picker = class {
2623
+ constructor(hostRef) {
2624
+ registerInstance(this, hostRef);
2625
+ this.didPresent = createEvent(this, "ionPickerDidPresent", 7);
2626
+ this.willPresent = createEvent(this, "ionPickerWillPresent", 7);
2627
+ this.willDismiss = createEvent(this, "ionPickerWillDismiss", 7);
2628
+ this.didDismiss = createEvent(this, "ionPickerDidDismiss", 7);
2629
+ this.didPresentShorthand = createEvent(this, "didPresent", 7);
2630
+ this.willPresentShorthand = createEvent(this, "willPresent", 7);
2631
+ this.willDismissShorthand = createEvent(this, "willDismiss", 7);
2632
+ this.didDismissShorthand = createEvent(this, "didDismiss", 7);
2633
+ this.delegateController = createDelegateController(this);
2634
+ this.lockController = createLockController();
2635
+ this.triggerController = createTriggerController();
2636
+ this.presented = false;
2637
+ /** @internal */
2638
+ this.hasController = false;
2639
+ /**
2640
+ * If `true`, the keyboard will be automatically dismissed when the overlay is presented.
2641
+ */
2642
+ this.keyboardClose = true;
2643
+ /**
2644
+ * Array of buttons to be displayed at the top of the picker.
2645
+ */
2646
+ this.buttons = [];
2647
+ /**
2648
+ * Array of columns to be displayed in the picker.
2649
+ */
2650
+ this.columns = [];
2651
+ /**
2652
+ * Number of milliseconds to wait before dismissing the picker.
2653
+ */
2654
+ this.duration = 0;
2655
+ /**
2656
+ * If `true`, a backdrop will be displayed behind the picker.
2657
+ */
2658
+ this.showBackdrop = true;
2659
+ /**
2660
+ * If `true`, the picker will be dismissed when the backdrop is clicked.
2661
+ */
2662
+ this.backdropDismiss = true;
2663
+ /**
2664
+ * If `true`, the picker will animate.
2665
+ */
2666
+ this.animated = true;
2667
+ /**
2668
+ * If `true`, the picker will open. If `false`, the picker will close.
2669
+ * Use this if you need finer grained control over presentation, otherwise
2670
+ * just use the pickerController or the `trigger` property.
2671
+ * Note: `isOpen` will not automatically be set back to `false` when
2672
+ * the picker dismisses. You will need to do that in your code.
2673
+ */
2674
+ this.isOpen = false;
2675
+ this.onBackdropTap = () => {
2676
+ this.dismiss(undefined, BACKDROP);
2677
+ };
2678
+ this.dispatchCancelHandler = (ev) => {
2679
+ const role = ev.detail.role;
2680
+ if (isCancel(role)) {
2681
+ const cancelButton = this.buttons.find((b) => b.role === 'cancel');
2682
+ this.callButtonHandler(cancelButton);
2683
+ }
2684
+ };
2685
+ }
2686
+ onIsOpenChange(newValue, oldValue) {
2687
+ if (newValue === true && oldValue === false) {
2688
+ this.present();
2689
+ }
2690
+ else if (newValue === false && oldValue === true) {
2691
+ this.dismiss();
2692
+ }
2693
+ }
2694
+ triggerChanged() {
2695
+ const { trigger, el, triggerController } = this;
2696
+ if (trigger) {
2697
+ triggerController.addClickListener(el, trigger);
2698
+ }
2699
+ }
2700
+ connectedCallback() {
2701
+ prepareOverlay(this.el);
2702
+ this.triggerChanged();
2703
+ }
2704
+ disconnectedCallback() {
2705
+ this.triggerController.removeClickListener();
2706
+ }
2707
+ componentWillLoad() {
2708
+ var _a;
2709
+ if (!((_a = this.htmlAttributes) === null || _a === void 0 ? void 0 : _a.id)) {
2710
+ setOverlayId(this.el);
2711
+ }
2712
+ }
2713
+ componentDidLoad() {
2714
+ 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);
2715
+ /**
2716
+ * If picker was rendered with isOpen="true"
2717
+ * then we should open picker immediately.
2718
+ */
2719
+ if (this.isOpen === true) {
2720
+ raf(() => this.present());
2721
+ }
2722
+ /**
2723
+ * When binding values in frameworks such as Angular
2724
+ * it is possible for the value to be set after the Web Component
2725
+ * initializes but before the value watcher is set up in Stencil.
2726
+ * As a result, the watcher callback may not be fired.
2727
+ * We work around this by manually calling the watcher
2728
+ * callback when the component has loaded and the watcher
2729
+ * is configured.
2730
+ */
2731
+ this.triggerChanged();
2732
+ }
2733
+ /**
2734
+ * Present the picker overlay after it has been created.
2735
+ */
2736
+ async present() {
2737
+ const unlock = await this.lockController.lock();
2738
+ await this.delegateController.attachViewToDom();
2739
+ await present(this, 'pickerEnter', iosEnterAnimation, iosEnterAnimation, undefined);
2740
+ if (this.duration > 0) {
2741
+ this.durationTimeout = setTimeout(() => this.dismiss(), this.duration);
2742
+ }
2743
+ unlock();
2744
+ }
2745
+ /**
2746
+ * Dismiss the picker overlay after it has been presented.
2747
+ *
2748
+ * @param data Any data to emit in the dismiss events.
2749
+ * @param role The role of the element that is dismissing the picker.
2750
+ * This can be useful in a button handler for determining which button was
2751
+ * clicked to dismiss the picker.
2752
+ * Some examples include: ``"cancel"`, `"destructive"`, "selected"`, and `"backdrop"`.
2753
+ */
2754
+ async dismiss(data, role) {
2755
+ const unlock = await this.lockController.lock();
2756
+ if (this.durationTimeout) {
2757
+ clearTimeout(this.durationTimeout);
2758
+ }
2759
+ const dismissed = await dismiss(this, data, role, 'pickerLeave', iosLeaveAnimation, iosLeaveAnimation);
2760
+ if (dismissed) {
2761
+ this.delegateController.removeViewFromDom();
2762
+ }
2763
+ unlock();
2764
+ return dismissed;
2765
+ }
2766
+ /**
2767
+ * Returns a promise that resolves when the picker did dismiss.
2768
+ */
2769
+ onDidDismiss() {
2770
+ return eventMethod(this.el, 'ionPickerDidDismiss');
2771
+ }
2772
+ /**
2773
+ * Returns a promise that resolves when the picker will dismiss.
2774
+ */
2775
+ onWillDismiss() {
2776
+ return eventMethod(this.el, 'ionPickerWillDismiss');
2777
+ }
2778
+ /**
2779
+ * Get the column that matches the specified name.
2780
+ *
2781
+ * @param name The name of the column.
2782
+ */
2783
+ getColumn(name) {
2784
+ return Promise.resolve(this.columns.find((column) => column.name === name));
2785
+ }
2786
+ async buttonClick(button) {
2787
+ const role = button.role;
2788
+ if (isCancel(role)) {
2789
+ return this.dismiss(undefined, role);
2790
+ }
2791
+ const shouldDismiss = await this.callButtonHandler(button);
2792
+ if (shouldDismiss) {
2793
+ return this.dismiss(this.getSelected(), button.role);
2794
+ }
2795
+ return Promise.resolve();
2796
+ }
2797
+ async callButtonHandler(button) {
2798
+ if (button) {
2799
+ // a handler has been provided, execute it
2800
+ // pass the handler the values from the inputs
2801
+ const rtn = await safeCall(button.handler, this.getSelected());
2802
+ if (rtn === false) {
2803
+ // if the return value of the handler is false then do not dismiss
2804
+ return false;
2805
+ }
2806
+ }
2807
+ return true;
2808
+ }
2809
+ getSelected() {
2810
+ const selected = {};
2811
+ this.columns.forEach((col, index) => {
2812
+ const selectedColumn = col.selectedIndex !== undefined ? col.options[col.selectedIndex] : undefined;
2813
+ selected[col.name] = {
2814
+ text: selectedColumn ? selectedColumn.text : undefined,
2815
+ value: selectedColumn ? selectedColumn.value : undefined,
2816
+ columnIndex: index,
2817
+ };
2818
+ });
2819
+ return selected;
2820
+ }
2821
+ render() {
2822
+ const { htmlAttributes } = this;
2823
+ const theme = getIonTheme(this);
2824
+ return (h(Host, Object.assign({ key: '2933574a887dec034d63c9fb7e72c6f89ba41eee', "aria-modal": "true", tabindex: "-1" }, htmlAttributes, { style: {
2825
+ zIndex: `${20000 + this.overlayIndex}`,
2826
+ }, class: Object.assign({ [theme]: true,
2827
+ // Used internally for styling
2828
+ [`picker-${theme}`]: true, 'overlay-hidden': true }, getClassMap(this.cssClass)), onIonBackdropTap: this.onBackdropTap, onIonPickerWillDismiss: this.dispatchCancelHandler }), h("ion-backdrop", { key: 'da408d6f273dbdee101ee0fecd534122f3adae4b', visible: this.showBackdrop, tappable: this.backdropDismiss }), h("div", { key: 'b2c0b56573828c54e6915c7134f8efdf6d3dd447', tabindex: "0", "aria-hidden": "true" }), h("div", { key: '471ececc34bad0850caaaa7bc0617342e631c813', class: "picker-wrapper ion-overlay-wrapper", role: "dialog" }, h("div", { key: '5a22a05ee03d39b89a0a40b4d8b1babc72fd0ec3', class: "picker-toolbar" }, this.buttons.map((b) => (h("div", { class: buttonWrapperClass(b) }, h("button", { type: "button", onClick: () => this.buttonClick(b), class: buttonClass(b) }, b.text))))), h("div", { key: '779ff00e285f24b7b3a22a3a1f2bc73f81852301', class: "picker-columns" }, h("div", { key: '317a4efb359487d4f4815696551c98c2ad2c9f6d', class: "picker-above-highlight" }), this.presented && this.columns.map((c) => h("ion-picker-legacy-column", { col: c })), h("div", { key: 'b38fcc0d168d8f41eac7b90aef48d2c7354e442a', class: "picker-below-highlight" }))), h("div", { key: '05dbb5a72979c720eb1c2810e5023d402a2a16d0', tabindex: "0", "aria-hidden": "true" })));
2829
+ }
2830
+ get el() { return getElement(this); }
2831
+ static get watchers() { return {
2832
+ "isOpen": [{
2833
+ "onIsOpenChange": 0
2834
+ }],
2835
+ "trigger": [{
2836
+ "triggerChanged": 0
2837
+ }]
2838
+ }; }
2839
+ };
2840
+ const buttonWrapperClass = (button) => {
2841
+ return {
2842
+ [`picker-toolbar-${button.role}`]: button.role !== undefined,
2843
+ 'picker-toolbar-button': true,
2844
+ };
2845
+ };
2846
+ const buttonClass = (button) => {
2847
+ return Object.assign({ 'picker-button': true, 'ion-activatable': true }, getClassMap(button.cssClass));
2848
+ };
2849
+ Picker.style = {
2850
+ ios: pickerIosCss(),
2851
+ md: pickerMdCss()
2852
+ };
2853
+
2854
+ 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}}`;
2855
+
2856
+ 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)}`;
2857
+
2858
+ const PickerColumnCmp = class {
2859
+ constructor(hostRef) {
2860
+ registerInstance(this, hostRef);
2861
+ this.ionPickerColChange = createEvent(this, "ionPickerColChange", 7);
2862
+ this.optHeight = 0;
2863
+ this.rotateFactor = 0;
2864
+ this.scaleFactor = 1;
2865
+ this.velocity = 0;
2866
+ this.y = 0;
2867
+ this.noAnimate = true;
2868
+ // `colDidChange` is a flag that gets set when the column is changed
2869
+ // dynamically. When this flag is set, the column will refresh
2870
+ // after the component re-renders to incorporate the new column data.
2871
+ // This is necessary because `this.refresh` queries for the option elements,
2872
+ // so it needs to wait for the latest elements to be available in the DOM.
2873
+ // Ex: column is created with 3 options. User updates the column data
2874
+ // to have 5 options. The column will still think it only has 3 options.
2875
+ this.colDidChange = false;
2876
+ }
2877
+ colChanged() {
2878
+ this.colDidChange = true;
2879
+ }
2880
+ async connectedCallback() {
2881
+ let pickerRotateFactor = 0;
2882
+ let pickerScaleFactor = 0.81;
2883
+ const mode = getIonMode(this);
2884
+ if (mode === 'ios') {
2885
+ pickerRotateFactor = -0.46;
2886
+ pickerScaleFactor = 1;
2887
+ }
2888
+ this.rotateFactor = pickerRotateFactor;
2889
+ this.scaleFactor = pickerScaleFactor;
2890
+ this.gesture = (await import('./index-Bck1OwMs.js')).createGesture({
2891
+ el: this.el,
2892
+ gestureName: 'picker-swipe',
2893
+ gesturePriority: 100,
2894
+ threshold: 0,
2895
+ passive: false,
2896
+ onStart: (ev) => this.onStart(ev),
2897
+ onMove: (ev) => this.onMove(ev),
2898
+ onEnd: (ev) => this.onEnd(ev),
2899
+ });
2900
+ this.gesture.enable();
2901
+ // Options have not been initialized yet
2902
+ // Animation must be disabled through the `noAnimate` flag
2903
+ // Otherwise, the options will render
2904
+ // at the top of the column and transition down
2905
+ this.tmrId = setTimeout(() => {
2906
+ this.noAnimate = false;
2907
+ // After initialization, `refresh()` will be called
2908
+ // At this point, animation will be enabled. The options will
2909
+ // animate as they are being selected.
2910
+ this.refresh(true);
2911
+ }, 250);
2912
+ }
2913
+ componentDidLoad() {
2914
+ this.onDomChange();
2915
+ }
2916
+ componentDidUpdate() {
2917
+ // Options may have changed since last update.
2918
+ if (this.colDidChange) {
2919
+ // Animation must be disabled through the `onDomChange` parameter.
2920
+ // Otherwise, the recently added options will render
2921
+ // at the top of the column and transition down
2922
+ this.onDomChange(true, false);
2923
+ this.colDidChange = false;
2924
+ }
2925
+ }
2926
+ disconnectedCallback() {
2927
+ if (this.rafId !== undefined)
2928
+ cancelAnimationFrame(this.rafId);
2929
+ if (this.tmrId)
2930
+ clearTimeout(this.tmrId);
2931
+ if (this.gesture) {
2932
+ this.gesture.destroy();
2933
+ this.gesture = undefined;
2934
+ }
2935
+ }
2936
+ emitColChange() {
2937
+ this.ionPickerColChange.emit(this.col);
2938
+ }
2939
+ setSelected(selectedIndex, duration) {
2940
+ // if there is a selected index, then figure out it's y position
2941
+ // if there isn't a selected index, then just use the top y position
2942
+ const y = selectedIndex > -1 ? -(selectedIndex * this.optHeight) : 0;
2943
+ this.velocity = 0;
2944
+ // set what y position we're at
2945
+ if (this.rafId !== undefined)
2946
+ cancelAnimationFrame(this.rafId);
2947
+ this.update(y, duration, true);
2948
+ this.emitColChange();
2949
+ }
2950
+ update(y, duration, saveY) {
2951
+ if (!this.optsEl) {
2952
+ return;
2953
+ }
2954
+ // ensure we've got a good round number :)
2955
+ let translateY = 0;
2956
+ let translateZ = 0;
2957
+ const { col, rotateFactor } = this;
2958
+ const prevSelected = col.selectedIndex;
2959
+ const selectedIndex = (col.selectedIndex = this.indexForY(-y));
2960
+ const durationStr = duration === 0 ? '' : duration + 'ms';
2961
+ const scaleStr = `scale(${this.scaleFactor})`;
2962
+ const children = this.optsEl.children;
2963
+ for (let i = 0; i < children.length; i++) {
2964
+ const button = children[i];
2965
+ const opt = col.options[i];
2966
+ const optOffset = i * this.optHeight + y;
2967
+ let transform = '';
2968
+ if (rotateFactor !== 0) {
2969
+ const rotateX = optOffset * rotateFactor;
2970
+ if (Math.abs(rotateX) <= 90) {
2971
+ translateY = 0;
2972
+ translateZ = 90;
2973
+ transform = `rotateX(${rotateX}deg) `;
2974
+ }
2975
+ else {
2976
+ translateY = -9999;
2977
+ }
2978
+ }
2979
+ else {
2980
+ translateZ = 0;
2981
+ translateY = optOffset;
2982
+ }
2983
+ const selected = selectedIndex === i;
2984
+ transform += `translate3d(0px,${translateY}px,${translateZ}px) `;
2985
+ if (this.scaleFactor !== 1 && !selected) {
2986
+ transform += scaleStr;
2987
+ }
2988
+ // Update transition duration
2989
+ if (this.noAnimate) {
2990
+ opt.duration = 0;
2991
+ button.style.transitionDuration = '';
2992
+ }
2993
+ else if (duration !== opt.duration) {
2994
+ opt.duration = duration;
2995
+ button.style.transitionDuration = durationStr;
2996
+ }
2997
+ // Update transform
2998
+ if (transform !== opt.transform) {
2999
+ opt.transform = transform;
3000
+ }
3001
+ button.style.transform = transform;
3002
+ /**
3003
+ * Ensure that the select column
3004
+ * item has the selected class
3005
+ */
3006
+ opt.selected = selected;
3007
+ if (selected) {
3008
+ button.classList.add(PICKER_OPT_SELECTED);
3009
+ }
3010
+ else {
3011
+ button.classList.remove(PICKER_OPT_SELECTED);
3012
+ }
3013
+ }
3014
+ this.col.prevSelected = prevSelected;
3015
+ if (saveY) {
3016
+ this.y = y;
3017
+ }
3018
+ if (this.lastIndex !== selectedIndex) {
3019
+ // have not set a last index yet
3020
+ hapticSelectionChanged();
3021
+ this.lastIndex = selectedIndex;
3022
+ }
3023
+ }
3024
+ decelerate() {
3025
+ if (this.velocity !== 0) {
3026
+ // still decelerating
3027
+ this.velocity *= DECELERATION_FRICTION;
3028
+ // do not let it go slower than a velocity of 1
3029
+ this.velocity = this.velocity > 0 ? Math.max(this.velocity, 1) : Math.min(this.velocity, -1);
3030
+ let y = this.y + this.velocity;
3031
+ if (y > this.minY) {
3032
+ // whoops, it's trying to scroll up farther than the options we have!
3033
+ y = this.minY;
3034
+ this.velocity = 0;
3035
+ }
3036
+ else if (y < this.maxY) {
3037
+ // gahh, it's trying to scroll down farther than we can!
3038
+ y = this.maxY;
3039
+ this.velocity = 0;
3040
+ }
3041
+ this.update(y, 0, true);
3042
+ const notLockedIn = Math.round(y) % this.optHeight !== 0 || Math.abs(this.velocity) > 1;
3043
+ if (notLockedIn) {
3044
+ // isn't locked in yet, keep decelerating until it is
3045
+ this.rafId = requestAnimationFrame(() => this.decelerate());
3046
+ }
3047
+ else {
3048
+ this.velocity = 0;
3049
+ this.emitColChange();
3050
+ hapticSelectionEnd();
3051
+ }
3052
+ }
3053
+ else if (this.y % this.optHeight !== 0) {
3054
+ // needs to still get locked into a position so options line up
3055
+ const currentPos = Math.abs(this.y % this.optHeight);
3056
+ // create a velocity in the direction it needs to scroll
3057
+ this.velocity = currentPos > this.optHeight / 2 ? 1 : -1;
3058
+ this.decelerate();
3059
+ }
3060
+ }
3061
+ indexForY(y) {
3062
+ return Math.min(Math.max(Math.abs(Math.round(y / this.optHeight)), 0), this.col.options.length - 1);
3063
+ }
3064
+ onStart(detail) {
3065
+ // We have to prevent default in order to block scrolling under the picker
3066
+ // but we DO NOT have to stop propagation, since we still want
3067
+ // some "click" events to capture
3068
+ if (detail.event.cancelable) {
3069
+ detail.event.preventDefault();
3070
+ }
3071
+ detail.event.stopPropagation();
3072
+ hapticSelectionStart();
3073
+ // reset everything
3074
+ if (this.rafId !== undefined)
3075
+ cancelAnimationFrame(this.rafId);
3076
+ const options = this.col.options;
3077
+ let minY = options.length - 1;
3078
+ let maxY = 0;
3079
+ for (let i = 0; i < options.length; i++) {
3080
+ if (!options[i].disabled) {
3081
+ minY = Math.min(minY, i);
3082
+ maxY = Math.max(maxY, i);
3083
+ }
3084
+ }
3085
+ this.minY = -(minY * this.optHeight);
3086
+ this.maxY = -(maxY * this.optHeight);
3087
+ }
3088
+ onMove(detail) {
3089
+ if (detail.event.cancelable) {
3090
+ detail.event.preventDefault();
3091
+ }
3092
+ detail.event.stopPropagation();
3093
+ // update the scroll position relative to pointer start position
3094
+ let y = this.y + detail.deltaY;
3095
+ if (y > this.minY) {
3096
+ // scrolling up higher than scroll area
3097
+ y = Math.pow(y, 0.8);
3098
+ this.bounceFrom = y;
3099
+ }
3100
+ else if (y < this.maxY) {
3101
+ // scrolling down below scroll area
3102
+ y += Math.pow(this.maxY - y, 0.9);
3103
+ this.bounceFrom = y;
3104
+ }
3105
+ else {
3106
+ this.bounceFrom = 0;
3107
+ }
3108
+ this.update(y, 0, false);
3109
+ }
3110
+ onEnd(detail) {
3111
+ if (this.bounceFrom > 0) {
3112
+ // bounce back up
3113
+ this.update(this.minY, 100, true);
3114
+ this.emitColChange();
3115
+ return;
3116
+ }
3117
+ else if (this.bounceFrom < 0) {
3118
+ // bounce back down
3119
+ this.update(this.maxY, 100, true);
3120
+ this.emitColChange();
3121
+ return;
3122
+ }
3123
+ this.velocity = clamp(-MAX_PICKER_SPEED, detail.velocityY * 23, MAX_PICKER_SPEED);
3124
+ if (this.velocity === 0 && detail.deltaY === 0) {
3125
+ const opt = detail.event.target.closest('.picker-opt');
3126
+ if (opt === null || opt === void 0 ? void 0 : opt.hasAttribute('opt-index')) {
3127
+ this.setSelected(parseInt(opt.getAttribute('opt-index'), 10), TRANSITION_DURATION);
3128
+ }
3129
+ }
3130
+ else {
3131
+ this.y += detail.deltaY;
3132
+ if (Math.abs(detail.velocityY) < 0.05) {
3133
+ const isScrollingUp = detail.deltaY > 0;
3134
+ const optHeightFraction = (Math.abs(this.y) % this.optHeight) / this.optHeight;
3135
+ if (isScrollingUp && optHeightFraction > 0.5) {
3136
+ this.velocity = Math.abs(this.velocity) * -1;
3137
+ }
3138
+ else if (!isScrollingUp && optHeightFraction <= 0.5) {
3139
+ this.velocity = Math.abs(this.velocity);
3140
+ }
3141
+ }
3142
+ this.decelerate();
3143
+ }
3144
+ }
3145
+ refresh(forceRefresh, animated) {
3146
+ var _a;
3147
+ let min = this.col.options.length - 1;
3148
+ let max = 0;
3149
+ const options = this.col.options;
3150
+ for (let i = 0; i < options.length; i++) {
3151
+ if (!options[i].disabled) {
3152
+ min = Math.min(min, i);
3153
+ max = Math.max(max, i);
3154
+ }
3155
+ }
3156
+ /**
3157
+ * Only update selected value if column has a
3158
+ * velocity of 0. If it does not, then the
3159
+ * column is animating might land on
3160
+ * a value different than the value at
3161
+ * selectedIndex
3162
+ */
3163
+ if (this.velocity !== 0) {
3164
+ return;
3165
+ }
3166
+ const selectedIndex = clamp(min, (_a = this.col.selectedIndex) !== null && _a !== void 0 ? _a : 0, max);
3167
+ if (this.col.prevSelected !== selectedIndex || forceRefresh) {
3168
+ const y = selectedIndex * this.optHeight * -1;
3169
+ const duration = animated ? TRANSITION_DURATION : 0;
3170
+ this.velocity = 0;
3171
+ this.update(y, duration, true);
3172
+ }
3173
+ }
3174
+ onDomChange(forceRefresh, animated) {
3175
+ const colEl = this.optsEl;
3176
+ if (colEl) {
3177
+ // DOM READ
3178
+ // We perfom a DOM read over a rendered item, this needs to happen after the first render or after the column has changed
3179
+ this.optHeight = colEl.firstElementChild ? colEl.firstElementChild.clientHeight : 0;
3180
+ }
3181
+ this.refresh(forceRefresh, animated);
3182
+ }
3183
+ render() {
3184
+ const col = this.col;
3185
+ const theme = getIonTheme(this);
3186
+ return (h(Host, { key: '5b6d8dc5f07aab52638415d5645d7f1b757b0143', class: Object.assign({ [theme]: true, 'picker-col': true, 'picker-opts-left': this.col.align === 'left', 'picker-opts-right': this.col.align === 'right' }, getClassMap(col.cssClass)), style: {
3187
+ 'max-width': this.col.columnWidth,
3188
+ } }, col.prefix && (h("div", { key: '38aec7368a95d580870d6b18c5b588e6393e61c4', class: "picker-prefix", style: { width: col.prefixWidth } }, col.prefix)), h("div", { key: 'ab861124d971cad93881e04b0240afa0ee5df1ae', class: "picker-opts", style: { maxWidth: col.optionsWidth }, ref: (el) => (this.optsEl = el) }, col.options.map((o, index) => (h("button", { "aria-label": o.ariaLabel, class: { 'picker-opt': true, 'picker-opt-disabled': !!o.disabled }, "opt-index": index }, o.text)))), col.suffix && (h("div", { key: '4c3bc8f9d46bf4c1501d0980516f698314e4f8be', class: "picker-suffix", style: { width: col.suffixWidth } }, col.suffix))));
3189
+ }
3190
+ get el() { return getElement(this); }
3191
+ static get watchers() { return {
3192
+ "col": [{
3193
+ "colChanged": 0
3194
+ }]
3195
+ }; }
3196
+ };
3197
+ const PICKER_OPT_SELECTED = 'picker-opt-selected';
3198
+ const DECELERATION_FRICTION = 0.97;
3199
+ const MAX_PICKER_SPEED = 90;
3200
+ const TRANSITION_DURATION = 150;
3201
+ PickerColumnCmp.style = {
3202
+ ios: pickerColumnIosCss(),
3203
+ md: pickerColumnMdCss()
3204
+ };
3205
+
3206
+ export { Datetime as ion_datetime, Picker as ion_picker_legacy, PickerColumnCmp as ion_picker_legacy_column };