@ionic/core 8.7.17-dev.11772118942.181221d4 → 8.7.17-dev.11772568074.1d7a4aea

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