@amwaljs/checkout-button 0.3.1 → 0.3.2

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 (888) hide show
  1. package/README.md +1 -1
  2. package/dist/checkout/checkout.esm.js +1 -1
  3. package/dist/checkout/{p-c03b6161.entry.js → p-00045a8c.entry.js} +1 -1
  4. package/dist/checkout/p-01bbe74f.entry.js +1 -0
  5. package/dist/checkout/p-051412fa.entry.js +1 -0
  6. package/dist/checkout/p-09cbe586.entry.js +4 -0
  7. package/dist/checkout/{p-439ad699.entry.js → p-0a85a01f.entry.js} +2 -2
  8. package/dist/checkout/{p-d5652cd4.entry.js → p-0bbfeb3c.entry.js} +1 -1
  9. package/dist/checkout/{p-4ae1a390.entry.js → p-0d96b482.entry.js} +1 -1
  10. package/dist/checkout/{p-DUa_5Mmb.js → p-0f03cd28.js} +2 -2
  11. package/dist/checkout/p-104d7733.entry.js +1 -0
  12. package/dist/checkout/{p-8036cf49.entry.js → p-10ad151a.entry.js} +5 -5
  13. package/dist/checkout/p-112455b1.js +1 -0
  14. package/dist/checkout/p-11beffea.entry.js +1 -0
  15. package/dist/checkout/p-13245fd4.js +1 -0
  16. package/dist/checkout/p-13741a94.entry.js +1 -0
  17. package/dist/checkout/p-14ea2c82.entry.js +1 -0
  18. package/dist/checkout/p-167dc7a7.entry.js +4 -0
  19. package/dist/checkout/p-1a749b59.entry.js +1 -0
  20. package/dist/checkout/p-1c718939.entry.js +1 -0
  21. package/dist/checkout/{p-11205aeb.entry.js → p-1cbb13f2.entry.js} +1 -1
  22. package/dist/checkout/{p-46ff73b3.entry.js → p-20df5234.entry.js} +1 -1
  23. package/dist/checkout/p-24068b1c.entry.js +1 -0
  24. package/dist/checkout/{p-7006753a.entry.js → p-28ccecc7.entry.js} +2 -2
  25. package/dist/checkout/p-361649c3.js +4 -0
  26. package/dist/{components/p-DoR35tr_.js → checkout/p-39ad94cf.js} +2 -2
  27. package/dist/checkout/p-3b75b22a.js +5 -0
  28. package/dist/checkout/p-3b80783d.js +8 -0
  29. package/dist/checkout/p-3d3eefc3.js +4 -0
  30. package/dist/checkout/p-3e1e3453.js +4 -0
  31. package/dist/checkout/p-3e681e57.js +4 -0
  32. package/dist/checkout/{p-bf933eb6.entry.js → p-3e8da476.entry.js} +1 -1
  33. package/dist/checkout/{p-1dc08181.entry.js → p-4028c0d2.entry.js} +1 -1
  34. package/dist/checkout/p-44c91c42.entry.js +1 -0
  35. package/dist/checkout/p-464f5a60.entry.js +1 -0
  36. package/dist/checkout/p-46b7ee7f.entry.js +1 -0
  37. package/dist/checkout/p-48784250.entry.js +1 -0
  38. package/dist/{components/p-wiOwkFtc.js → checkout/p-4be20bf2.js} +1 -1
  39. package/dist/{components/p-Dl_WhQZu.js → checkout/p-4f78d3a0.js} +2 -2
  40. package/dist/checkout/{p-4da4ecc4.entry.js → p-529bce3f.entry.js} +1 -1
  41. package/dist/checkout/p-536a0294.js +4 -0
  42. package/dist/checkout/{p-eae2d3f2.entry.js → p-5eecd5ef.entry.js} +1 -1
  43. package/dist/checkout/p-64257c8d.entry.js +1 -0
  44. package/dist/checkout/{p-5903b3af.entry.js → p-64bd1dd3.entry.js} +1 -1
  45. package/dist/checkout/{p-9b7d7231.entry.js → p-68a4caba.entry.js} +1 -1
  46. package/dist/checkout/{p-978b3762.entry.js → p-69242ed6.entry.js} +1 -1
  47. package/dist/checkout/{p-62b7c8b0.entry.js → p-6d886d7e.entry.js} +1 -1
  48. package/dist/checkout/{p-ofaUly0p.js → p-6fa979e3.js} +2 -2
  49. package/dist/checkout/p-6fb474f3.entry.js +1 -0
  50. package/dist/checkout/p-77104220.js +7 -0
  51. package/dist/checkout/{p-aba43d04.entry.js → p-79ec3e4b.entry.js} +1 -1
  52. package/dist/checkout/{p-cd2c344b.entry.js → p-7b51bf67.entry.js} +2 -2
  53. package/dist/checkout/p-7f0004c9.js +4 -0
  54. package/dist/checkout/p-7fe50ab4.entry.js +1 -0
  55. package/dist/checkout/p-880b451c.entry.js +4 -0
  56. package/dist/checkout/p-886dad62.entry.js +1 -0
  57. package/dist/checkout/p-886e8746.entry.js +1 -0
  58. package/dist/checkout/p-88abdf59.js +4 -0
  59. package/dist/checkout/{p-f845e91b.entry.js → p-8a97a411.entry.js} +1 -1
  60. package/dist/checkout/p-8af3c6cc.entry.js +1 -0
  61. package/dist/checkout/{p-8b015c21.entry.js → p-8c022f5d.entry.js} +1 -1
  62. package/dist/checkout/{p-56e307eb.entry.js → p-91855eae.entry.js} +1 -1
  63. package/dist/checkout/{p-ca257d45.entry.js → p-9185e55b.entry.js} +1 -1
  64. package/dist/checkout/{p-4b34896c.entry.js → p-926eda98.entry.js} +1 -1
  65. package/dist/checkout/p-93e5b313.entry.js +4 -0
  66. package/dist/checkout/{p-4a86b731.entry.js → p-97024acb.entry.js} +1 -1
  67. package/dist/checkout/p-99e447f9.js +1 -0
  68. package/dist/{components/p-BgOwfqIY.js → checkout/p-9b519de5.js} +2 -2
  69. package/dist/checkout/{p-b8245f6a.entry.js → p-9b65a6e5.entry.js} +1 -1
  70. package/dist/checkout/{p-53ae9dd0.entry.js → p-9cc1fdfb.entry.js} +1 -1
  71. package/dist/checkout/{p-8fc1287a.entry.js → p-9f26fb71.entry.js} +1 -1
  72. package/dist/checkout/p-9f41a631.entry.js +1 -0
  73. package/dist/checkout/{p-5f005b5e.entry.js → p-a2ce8858.entry.js} +1 -1
  74. package/dist/checkout/{p-e4d0702d.entry.js → p-a3fca65c.entry.js} +1 -1
  75. package/dist/checkout/{p-d370e756.entry.js → p-a6056eb1.entry.js} +2 -2
  76. package/dist/checkout/{p-c929d6ea.entry.js → p-a7b2cbb9.entry.js} +1 -1
  77. package/dist/{components/p-Dwo-QLgs.js → checkout/p-ab16e6ce.js} +1 -1
  78. package/dist/checkout/{p-63db3363.entry.js → p-ab9a18c4.entry.js} +1 -1
  79. package/dist/checkout/p-b038db20.js +4 -0
  80. package/dist/checkout/p-b4ad8642.entry.js +1 -0
  81. package/dist/checkout/p-b4cf78ad.entry.js +1 -0
  82. package/dist/checkout/p-b7be2ec0.js +4 -0
  83. package/dist/checkout/p-b84d9e44.js +4 -0
  84. package/dist/{components/p-CwRU9ccI.js → checkout/p-b8fdd517.js} +1 -1
  85. package/dist/checkout/{p-d799009b.entry.js → p-b9d8ab12.entry.js} +1 -1
  86. package/dist/checkout/p-bb1f698e.js +4 -0
  87. package/dist/checkout/p-bd17be25.js +4 -0
  88. package/dist/checkout/p-bd4df0bc.entry.js +1 -0
  89. package/dist/checkout/p-c152bdea.js +4 -0
  90. package/dist/checkout/{p-f22v7XAM.js → p-c30e2b28.js} +2 -2
  91. package/dist/checkout/{p-c2296aa1.entry.js → p-c61a3d5d.entry.js} +1 -1
  92. package/dist/checkout/p-c6ee4bb6.entry.js +1 -0
  93. package/dist/checkout/p-c771a565.entry.js +1 -0
  94. package/dist/checkout/{p-3c9a8bee.entry.js → p-c82b2823.entry.js} +1 -1
  95. package/dist/checkout/p-c8f7d1b5.entry.js +1 -0
  96. package/dist/checkout/p-ceef30cd.entry.js +1 -0
  97. package/dist/checkout/p-d5733333.entry.js +1 -0
  98. package/dist/checkout/p-d5bba69c.entry.js +1 -0
  99. package/dist/checkout/p-d60b2328.js +4 -0
  100. package/dist/checkout/p-d60e05e2.entry.js +1 -0
  101. package/dist/checkout/p-d6b04157.entry.js +1 -0
  102. package/dist/checkout/p-d7a430bf.js +2 -0
  103. package/dist/checkout/{p-B3WORC1a.js → p-d839c693.js} +1 -1
  104. package/dist/checkout/{p-141f2eab.entry.js → p-d9dfb3ae.entry.js} +3 -3
  105. package/dist/checkout/p-dc51d318.js +5 -0
  106. package/dist/checkout/p-ddbe30b8.entry.js +1 -0
  107. package/dist/checkout/p-de418dd1.entry.js +1 -0
  108. package/dist/checkout/{p-b4000357.entry.js → p-defa5f72.entry.js} +2 -2
  109. package/dist/checkout/{p-b90c064e.entry.js → p-df0fa5e1.entry.js} +2 -2
  110. package/dist/checkout/{p-c8740acc.entry.js → p-e0f073f1.entry.js} +3 -3
  111. package/dist/checkout/p-e237d611.entry.js +1 -0
  112. package/dist/checkout/p-ea71fb8d.entry.js +1 -0
  113. package/dist/checkout/{p-95563c4c.entry.js → p-eda93a0b.entry.js} +1 -1
  114. package/dist/checkout/p-eee05053.entry.js +1 -0
  115. package/dist/checkout/{p-95431a73.entry.js → p-f8460dc4.entry.js} +1 -1
  116. package/dist/checkout/p-f875507d.entry.js +1 -0
  117. package/dist/checkout/p-faf06441.js +4 -0
  118. package/dist/checkout/p-fb147065.entry.js +1 -0
  119. package/dist/checkout/{p-af32124b.entry.js → p-fb45cdd1.entry.js} +1 -1
  120. package/dist/cjs/_commonjsHelpers-537d719a.js +20 -0
  121. package/dist/cjs/amwal-checkout-button_5.cjs.entry.js +1298 -2881
  122. package/dist/cjs/amwal-installments-guide.cjs.entry.js +42 -43
  123. package/dist/cjs/amwal-pos.cjs.entry.js +3180 -3452
  124. package/dist/cjs/amwal-widget-modal.cjs.entry.js +162 -175
  125. package/dist/cjs/amwal-widget.cjs.entry.js +314 -343
  126. package/dist/cjs/{animation-BhN-MT4J.js → animation-26241cb2.js} +2 -2
  127. package/dist/cjs/{app-globals-NtXImkuk.js → app-globals-42a13029.js} +1 -1
  128. package/dist/cjs/{ar-CbT6TM-Q.js → ar-3a6829a4.js} +10 -4
  129. package/dist/cjs/{capacitor-CqhugS19.js → capacitor-a9365f60.js} +1 -1
  130. package/dist/cjs/checkout.cjs.js +19 -16
  131. package/dist/cjs/{data-UgkxeXMB.js → data-19081291.js} +1 -1
  132. package/dist/cjs/{form-controller-DRf0gBOg.js → form-controller-3ffb27b1.js} +1 -1
  133. package/dist/cjs/{framework-delegate-D-6PUvOi.js → framework-delegate-ab2cc190.js} +1 -1
  134. package/dist/cjs/{gesture-controller-IMq9Cgi2.js → gesture-controller-b1c0efac.js} +1 -1
  135. package/dist/cjs/{haptic-CC9tl6g8.js → haptic-80174512.js} +1 -1
  136. package/dist/cjs/{hardware-back-button-C2D2eOk8.js → hardware-back-button-ddfefd22.js} +3 -3
  137. package/dist/cjs/{helpers-B4vhh9gt.js → helpers-72ba682d.js} +4 -1
  138. package/dist/cjs/i18n-18ad02d5.js +13 -0
  139. package/dist/cjs/{index-CKcQE8Zg.js → index-0d0b84fb.js} +4 -3
  140. package/dist/cjs/{index-6eOg4xTk.js → index-2602a653.js} +0 -1
  141. package/dist/cjs/{index-DZA7ogU0.js → index-2cd1a895.js} +4 -4
  142. package/dist/cjs/index-7522b3a9.js +2256 -0
  143. package/dist/cjs/{index-bc_r9XRf.js → index-9b7d2c31.js} +9 -9
  144. package/dist/cjs/{index-q1ImtF5k.js → index-ce06e6a3.js} +3 -3
  145. package/dist/cjs/{index-XMjUjboS.js → index-da554121.js} +3 -3
  146. package/dist/cjs/{input-shims-CCRbO2DB.js → input-shims-1a8ed779.js} +6 -6
  147. package/dist/cjs/{input.utils-CyVgmmWQ.js → input.utils-67143876.js} +3 -3
  148. package/dist/cjs/ion-accordion-group.cjs.entry.js +199 -203
  149. package/dist/cjs/ion-accordion.cjs.entry.js +305 -305
  150. package/dist/cjs/ion-action-sheet_3.cjs.entry.js +695 -705
  151. package/dist/cjs/ion-app.cjs.entry.js +95 -93
  152. package/dist/cjs/ion-avatar.cjs.entry.js +14 -12
  153. package/dist/cjs/ion-back-button.cjs.entry.js +78 -76
  154. package/dist/cjs/ion-backdrop.cjs.entry.js +44 -42
  155. package/dist/cjs/ion-badge.cjs.entry.js +19 -17
  156. package/dist/cjs/ion-breadcrumb.cjs.entry.js +86 -84
  157. package/dist/cjs/ion-breadcrumbs.cjs.entry.js +120 -124
  158. package/dist/cjs/ion-buttons_3.cjs.entry.js +822 -822
  159. package/dist/cjs/ion-card-content.cjs.entry.js +19 -17
  160. package/dist/cjs/ion-card-header.cjs.entry.js +22 -20
  161. package/dist/cjs/ion-card-subtitle.cjs.entry.js +20 -18
  162. package/dist/cjs/ion-card-title.cjs.entry.js +20 -18
  163. package/dist/cjs/ion-card.cjs.entry.js +55 -53
  164. package/dist/cjs/ion-checkbox_7.cjs.entry.js +862 -882
  165. package/dist/cjs/ion-chip.cjs.entry.js +24 -22
  166. package/dist/cjs/ion-col.cjs.entry.js +110 -108
  167. package/dist/cjs/ion-content.cjs.entry.js +376 -374
  168. package/dist/cjs/ion-datetime-button.cjs.entry.js +330 -328
  169. package/dist/cjs/ion-datetime.cjs.entry.js +1547 -1567
  170. package/dist/cjs/ion-fab-button.cjs.entry.js +78 -76
  171. package/dist/cjs/ion-fab-list.cjs.entry.js +31 -31
  172. package/dist/cjs/ion-fab.cjs.entry.js +58 -58
  173. package/dist/cjs/ion-footer.cjs.entry.js +94 -92
  174. package/dist/cjs/ion-grid.cjs.entry.js +17 -15
  175. package/dist/cjs/ion-header.cjs.entry.js +143 -141
  176. package/dist/cjs/ion-icon.cjs.entry.js +104 -112
  177. package/dist/cjs/ion-img.cjs.entry.js +83 -83
  178. package/dist/cjs/ion-infinite-scroll-content.cjs.entry.js +34 -32
  179. package/dist/cjs/ion-infinite-scroll.cjs.entry.js +174 -176
  180. package/dist/cjs/ion-input.cjs.entry.js +447 -453
  181. package/dist/cjs/ion-item-divider.cjs.entry.js +23 -21
  182. package/dist/cjs/ion-item-group.cjs.entry.js +20 -18
  183. package/dist/cjs/ion-item-option.cjs.entry.js +45 -43
  184. package/dist/cjs/ion-item-options.cjs.entry.js +40 -38
  185. package/dist/cjs/ion-item-sliding.cjs.entry.js +391 -391
  186. package/dist/cjs/ion-loading.cjs.entry.js +162 -164
  187. package/dist/cjs/ion-menu-button.cjs.entry.js +60 -58
  188. package/dist/cjs/ion-menu-toggle.cjs.entry.js +36 -34
  189. package/dist/cjs/ion-menu.cjs.entry.js +606 -612
  190. package/dist/cjs/ion-modal.cjs.entry.js +551 -553
  191. package/dist/cjs/ion-nav-link.cjs.entry.js +17 -15
  192. package/dist/cjs/ion-nav.cjs.entry.js +823 -825
  193. package/dist/cjs/ion-note.cjs.entry.js +19 -17
  194. package/dist/cjs/ion-picker-column.cjs.entry.js +327 -327
  195. package/dist/cjs/ion-picker.cjs.entry.js +198 -200
  196. package/dist/cjs/ion-popover.cjs.entry.js +326 -330
  197. package/dist/cjs/ion-progress-bar.cjs.entry.js +44 -42
  198. package/dist/cjs/ion-range.cjs.entry.js +644 -654
  199. package/dist/cjs/ion-refresher-content.cjs.entry.js +53 -51
  200. package/dist/cjs/ion-refresher.cjs.entry.js +586 -586
  201. package/dist/cjs/ion-reorder-group.cjs.entry.js +252 -252
  202. package/dist/cjs/ion-reorder.cjs.entry.js +26 -24
  203. package/dist/cjs/ion-route-redirect.cjs.entry.js +19 -21
  204. package/dist/cjs/ion-route.cjs.entry.js +37 -41
  205. package/dist/cjs/ion-router-link.cjs.entry.js +31 -29
  206. package/dist/cjs/ion-router-outlet.cjs.entry.js +178 -178
  207. package/dist/cjs/ion-router.cjs.entry.js +266 -264
  208. package/dist/cjs/ion-row.cjs.entry.js +12 -10
  209. package/dist/cjs/ion-searchbar.cjs.entry.js +388 -396
  210. package/dist/cjs/ion-segment-button.cjs.entry.js +96 -96
  211. package/dist/cjs/ion-segment.cjs.entry.js +414 -420
  212. package/dist/cjs/ion-select-option.cjs.entry.js +16 -14
  213. package/dist/cjs/ion-select.cjs.entry.js +693 -699
  214. package/dist/cjs/ion-skeleton-text.cjs.entry.js +35 -33
  215. package/dist/cjs/ion-spinner.cjs.entry.js +50 -48
  216. package/dist/cjs/ion-split-pane.cjs.entry.js +120 -124
  217. package/dist/cjs/ion-tab-bar.cjs.entry.js +66 -66
  218. package/dist/cjs/ion-tab-button.cjs.entry.js +82 -80
  219. package/dist/cjs/ion-tab.cjs.entry.js +50 -50
  220. package/dist/cjs/ion-tabs.cjs.entry.js +134 -132
  221. package/dist/cjs/ion-textarea.cjs.entry.js +396 -400
  222. package/dist/cjs/ion-thumbnail.cjs.entry.js +12 -10
  223. package/dist/cjs/ion-title.cjs.entry.js +43 -43
  224. package/dist/cjs/ion-toast.cjs.entry.js +371 -375
  225. package/dist/cjs/ion-toggle.cjs.entry.js +230 -230
  226. package/dist/cjs/ion-toolbar.cjs.entry.js +61 -59
  227. package/dist/cjs/{ionic-global-DRLi5Iq3.js → ionic-global-3915f1f1.js} +55 -58
  228. package/dist/cjs/{ios.transition-D4vyO_a_.js → ios.transition-b9c0b967.js} +5 -5
  229. package/dist/cjs/{keyboard-iyHR2ZF4.js → keyboard-5d4b83b3.js} +3 -3
  230. package/dist/cjs/{keyboard-DuKzsHsS.js → keyboard-bc8ebbf7.js} +1 -1
  231. package/dist/cjs/{keyboard-controller-rH21qC_2.js → keyboard-controller-c6633754.js} +2 -2
  232. package/dist/cjs/loader.cjs.js +19 -8
  233. package/dist/cjs/{md.transition-Dkxy3kpE.js → md.transition-830acbb7.js} +5 -5
  234. package/dist/cjs/{menu-toggle-util-CmPuayU0.js → menu-toggle-util-315c26b3.js} +1 -1
  235. package/dist/cjs/{notch-controller-Dtpow1eD.js → notch-controller-dcf09601.js} +2 -2
  236. package/dist/cjs/{overlays-Bc8tk6t5.js → overlays-08819e3f.js} +6 -6
  237. package/dist/cjs/{refresher.utils-CPl6gciv.js → refresher.utils-e41509f7.js} +3 -3
  238. package/dist/cjs/{status-tap-XtIhF72O.js → status-tap-ec021cb4.js} +4 -4
  239. package/dist/cjs/{swipe-back-C9j0kufI.js → swipe-back-3d3a5129.js} +4 -4
  240. package/dist/collection/collection-manifest.json +8 -8
  241. package/dist/collection/components/amwal-checkout-button/amwal-checkout-button.js +1714 -1888
  242. package/dist/collection/components/amwal-checkout-button/amwal-checkout-button.stories.js +84 -84
  243. package/dist/collection/components/amwal-installments-guide/amwal-installments-guide.js +75 -80
  244. package/dist/collection/components/amwal-installments-guide/amwal-installments-guide.stories.js +25 -25
  245. package/dist/collection/components/amwal-installments-timeline/amwal-installments-timeline.js +506 -569
  246. package/dist/collection/components/amwal-installments-timeline/amwal-installments-timeline.stories.js +80 -80
  247. package/dist/collection/components/amwal-pos/amwal-pos.js +1022 -1094
  248. package/dist/collection/components/amwal-pos/amwal-pos.stories.js +209 -209
  249. package/dist/collection/components/amwal-widget/amwal-widget-modal.js +326 -350
  250. package/dist/collection/components/amwal-widget/amwal-widget.js +673 -736
  251. package/dist/collection/components/amwal-widget/amwal-widget.stories.js +184 -184
  252. package/dist/collection/lang/i18n.js +7 -7
  253. package/dist/components/amwal-checkout-button.d.ts +2 -2
  254. package/dist/components/amwal-checkout-button.js +3811 -1
  255. package/dist/components/amwal-installments-guide.d.ts +2 -2
  256. package/dist/components/amwal-installments-guide.js +75 -1
  257. package/dist/components/amwal-installments-timeline.d.ts +2 -2
  258. package/dist/components/amwal-installments-timeline.js +6 -1
  259. package/dist/components/amwal-pos.d.ts +2 -2
  260. package/dist/components/amwal-pos.js +3391 -1
  261. package/dist/components/amwal-widget-modal.d.ts +2 -2
  262. package/dist/components/amwal-widget-modal.js +6 -1
  263. package/dist/components/amwal-widget.d.ts +2 -2
  264. package/dist/components/amwal-widget.js +389 -1
  265. package/dist/components/index.d.ts +0 -6
  266. package/dist/components/index.js +6 -1
  267. package/dist/components/ion-accordion-group.js +248 -1
  268. package/dist/components/ion-accordion.js +353 -1
  269. package/dist/components/ion-action-sheet.js +6 -1
  270. package/dist/components/ion-alert.js +6 -1
  271. package/dist/components/ion-app.js +125 -1
  272. package/dist/components/ion-avatar.js +39 -1
  273. package/dist/components/ion-back-button.js +127 -1
  274. package/dist/components/ion-backdrop.js +6 -1
  275. package/dist/components/ion-badge.js +46 -1
  276. package/dist/components/ion-breadcrumb.js +131 -1
  277. package/dist/components/ion-breadcrumbs.js +152 -1
  278. package/dist/components/ion-button.js +6 -1
  279. package/dist/components/ion-buttons.js +6 -1
  280. package/dist/components/ion-card-content.js +43 -1
  281. package/dist/components/ion-card-header.js +50 -1
  282. package/dist/components/ion-card-subtitle.js +47 -1
  283. package/dist/components/ion-card-title.js +47 -1
  284. package/dist/components/ion-card.js +98 -1
  285. package/dist/components/ion-checkbox.js +6 -1
  286. package/dist/components/ion-chip.js +59 -1
  287. package/dist/components/ion-col.js +186 -2
  288. package/dist/components/ion-content.js +440 -1
  289. package/dist/components/ion-datetime-button.js +378 -1
  290. package/dist/components/ion-datetime.js +1961 -2
  291. package/dist/components/ion-fab-button.js +130 -1
  292. package/dist/components/ion-fab-list.js +56 -1
  293. package/dist/components/ion-fab.js +90 -1
  294. package/dist/components/ion-footer.js +152 -2
  295. package/dist/components/ion-grid.js +41 -1
  296. package/dist/components/ion-header.js +356 -2
  297. package/dist/components/ion-icon.js +6 -1
  298. package/dist/components/ion-img.js +124 -1
  299. package/dist/components/ion-infinite-scroll-content.js +69 -1
  300. package/dist/components/ion-infinite-scroll.js +209 -1
  301. package/dist/components/ion-input.js +564 -1
  302. package/dist/components/ion-item-divider.js +51 -1
  303. package/dist/components/ion-item-group.js +44 -1
  304. package/dist/components/ion-item-option.js +85 -1
  305. package/dist/components/ion-item-options.js +67 -1
  306. package/dist/components/ion-item-sliding.js +449 -1
  307. package/dist/components/ion-item.js +6 -1
  308. package/dist/components/ion-label.js +6 -1
  309. package/dist/components/ion-list-header.js +6 -1
  310. package/dist/components/ion-list.js +6 -1
  311. package/dist/components/ion-loading.js +325 -3
  312. package/dist/components/ion-menu-button.js +100 -1
  313. package/dist/components/ion-menu-toggle.js +57 -1
  314. package/dist/components/ion-menu.js +679 -1
  315. package/dist/components/ion-modal.js +1775 -3
  316. package/dist/components/ion-nav-link.js +63 -2
  317. package/dist/components/ion-nav.js +945 -2
  318. package/dist/components/ion-note.js +6 -1
  319. package/dist/components/ion-picker-column-internal.js +6 -1
  320. package/dist/components/ion-picker-column.js +6 -1
  321. package/dist/components/ion-picker-internal.js +6 -1
  322. package/dist/components/ion-picker.js +317 -3
  323. package/dist/components/ion-popover.js +6 -1
  324. package/dist/components/ion-progress-bar.js +79 -1
  325. package/dist/components/ion-radio-group.js +6 -1
  326. package/dist/components/ion-radio.js +6 -1
  327. package/dist/components/ion-range.js +778 -2
  328. package/dist/components/ion-refresher-content.js +90 -1
  329. package/dist/components/ion-refresher.js +652 -1
  330. package/dist/components/ion-reorder-group.js +300 -1
  331. package/dist/components/ion-reorder.js +58 -1
  332. package/dist/components/ion-ripple-effect.js +6 -1
  333. package/dist/components/ion-route-redirect.js +42 -1
  334. package/dist/components/ion-route.js +66 -1
  335. package/dist/components/ion-router-link.js +60 -1
  336. package/dist/components/ion-router-outlet.js +219 -1
  337. package/dist/components/ion-router.js +833 -3
  338. package/dist/components/ion-row.js +34 -1
  339. package/dist/components/ion-searchbar.js +472 -1
  340. package/dist/components/ion-segment-button.js +139 -1
  341. package/dist/components/ion-segment.js +472 -1
  342. package/dist/components/ion-select-option.js +42 -1
  343. package/dist/components/ion-select-popover.js +6 -1
  344. package/dist/components/ion-select.js +864 -1
  345. package/dist/components/ion-skeleton-text.js +59 -1
  346. package/dist/components/ion-spinner.js +6 -1
  347. package/dist/components/ion-split-pane.js +166 -1
  348. package/dist/components/ion-tab-bar.js +95 -1
  349. package/dist/components/ion-tab-button.js +125 -1
  350. package/dist/components/ion-tab.js +80 -1
  351. package/dist/components/ion-tabs.js +176 -1
  352. package/dist/components/ion-text.js +6 -1
  353. package/dist/components/ion-textarea.js +496 -1
  354. package/dist/components/ion-thumbnail.js +34 -1
  355. package/dist/components/ion-title.js +71 -1
  356. package/dist/components/ion-toast.js +914 -3
  357. package/dist/components/ion-toggle.js +282 -1
  358. package/dist/components/ion-toolbar.js +91 -1
  359. package/dist/components/p-01b49f83.js +269 -0
  360. package/dist/{esm/ios.transition-DMsViooj.js → components/p-02b77441.js} +2 -5
  361. package/dist/components/p-02bc6b21.js +203 -0
  362. package/dist/components/p-031ed92d.js +389 -0
  363. package/dist/components/p-03803c7d.js +369 -0
  364. package/dist/components/p-089e034e.js +234 -0
  365. package/dist/components/p-0dc7a5ff.js +512 -0
  366. package/dist/components/p-110f8490.js +566 -0
  367. package/dist/components/p-112455b1.js +17 -0
  368. package/dist/{esm/index-BMJhFU53.js → components/p-1596e301.js} +4 -4
  369. package/dist/components/p-1785e30a.js +318 -0
  370. package/dist/{esm/helpers-C6kqtbmV.js → components/p-2bb89b46.js} +5 -2
  371. package/dist/components/p-2d7d745d.js +224 -0
  372. package/dist/components/p-2fc99fef.js +262 -0
  373. package/dist/{esm/input-shims-DSFPFhb7.js → components/p-3296ebd9.js} +4 -6
  374. package/dist/{esm/data-Cl-_yBA0.js → components/p-39ad94cf.js} +2 -2
  375. package/dist/{esm/capacitor-CG3xQUND.js → components/p-3d3eefc3.js} +1 -1
  376. package/dist/{esm/form-controller-xetTxjL6.js → components/p-3e1d2896.js} +1 -1
  377. package/dist/{esm/keyboard-controller-CqGCg8tB.js → components/p-3e1e3453.js} +2 -2
  378. package/dist/{esm/md.transition-BQT2r4ED.js → components/p-503328f2.js} +2 -5
  379. package/dist/components/p-51c44f42.js +98 -0
  380. package/dist/components/p-5280b372.js +42 -0
  381. package/dist/{esm/index-DuUXGZp2.js → components/p-53e2dbe4.js} +3 -3
  382. package/dist/components/p-5441c730.js +851 -0
  383. package/dist/{esm/refresher.utils-D4tPnZsM.js → components/p-74e68924.js} +4 -4
  384. package/dist/{esm/framework-delegate-D_uGiYYw.js → components/p-76525f0f.js} +1 -1
  385. package/dist/{esm/index-CcopIPA0.js → components/p-77104220.js} +6 -4
  386. package/dist/components/p-77ccb793.js +185 -0
  387. package/dist/components/p-83e529db.js +380 -0
  388. package/dist/{esm/animation-DRf3dwMu.js → components/p-89c4c5cb.js} +2 -2
  389. package/dist/components/p-8b3d1e06.js +67 -0
  390. package/dist/components/p-901c16c5.js +210 -0
  391. package/dist/components/p-93e2a608.js +374 -0
  392. package/dist/components/p-95c79593.js +43 -0
  393. package/dist/components/p-96073863.js +82 -0
  394. package/dist/components/p-99e447f9.js +13 -0
  395. package/dist/{esm/keyboard-DgiyREKb.js → components/p-9b519de5.js} +1 -1
  396. package/dist/{esm/input.utils-BuIvhxo3.js → components/p-9d350d61.js} +3 -3
  397. package/dist/{esm/notch-controller-CQeDnZLe.js → components/p-9df67c24.js} +2 -2
  398. package/dist/components/p-a0e691dd.js +39 -0
  399. package/dist/components/p-ab10d1ae.js +47 -0
  400. package/dist/components/p-abc01c5d.js +194 -0
  401. package/dist/components/p-abd248d1.js +196 -0
  402. package/dist/{esm/haptic-D5jGzBs8.js → components/p-af073aaf.js} +2 -2
  403. package/dist/{esm/swipe-back-DE05lWQD.js → components/p-b32529b9.js} +3 -4
  404. package/dist/{esm/index-C75BfBAE.js → components/p-b8fdd517.js} +1 -2
  405. package/dist/components/p-cebc113f.js +38 -0
  406. package/dist/components/p-d25fd077.js +331 -0
  407. package/dist/{esm/menu-toggle-util-wdO31cdC.js → components/p-d3596f64.js} +1 -1
  408. package/dist/{esm/keyboard-DcbqYXj5.js → components/p-d60b2328.js} +1 -3
  409. package/dist/components/p-d69dc32f.js +97 -0
  410. package/dist/{esm/hardware-back-button-CzxcJiYO.js → components/p-d72e8d7b.js} +2 -3
  411. package/dist/{esm/ar-B3WORC1a.js → components/p-d839c693.js} +12 -5
  412. package/dist/{esm/index-D8d_89Nl.js → components/p-e187a77c.js} +1 -1
  413. package/dist/components/p-e65ea9fb.js +1379 -0
  414. package/dist/components/p-ec0e3f3f.js +2040 -0
  415. package/dist/components/p-ecb4db1c.js +64 -0
  416. package/dist/{esm/gesture-controller-CukVBo5-.js → components/p-f728a68f.js} +1 -1
  417. package/dist/components/p-f7e3c502.js +73 -0
  418. package/dist/components/p-fe463a42.js +272 -0
  419. package/dist/esm/_commonjsHelpers-9943807e.js +17 -0
  420. package/dist/esm/amwal-checkout-button_5.entry.js +1296 -2881
  421. package/dist/esm/amwal-installments-guide.entry.js +40 -43
  422. package/dist/esm/amwal-pos.entry.js +3178 -3452
  423. package/dist/esm/amwal-widget-modal.entry.js +160 -175
  424. package/dist/esm/amwal-widget.entry.js +312 -343
  425. package/dist/esm/animation-a6d5c3b1.js +1063 -0
  426. package/dist/esm/{app-globals-BHnkZZiH.js → app-globals-c817b28b.js} +1 -1
  427. package/dist/esm/ar-7d2629bf.js +51 -0
  428. package/dist/esm/capacitor-ba4337da.js +13 -0
  429. package/dist/esm/checkout.js +18 -16
  430. package/dist/esm/config-8e06237c.js +171 -0
  431. package/dist/esm/cubic-bezier-874f336d.js +90 -0
  432. package/dist/esm/data-8916315d.js +1628 -0
  433. package/dist/esm/dir-1d4aa386.js +18 -0
  434. package/dist/esm/focus-visible-32968d3d.js +75 -0
  435. package/dist/esm/form-controller-b1aa7393.js +64 -0
  436. package/dist/esm/framework-delegate-de1aa369.js +140 -0
  437. package/dist/esm/gesture-controller-58ffa500.js +195 -0
  438. package/dist/esm/haptic-4d4d8eb1.js +206 -0
  439. package/dist/esm/hardware-back-button-f93acff0.js +116 -0
  440. package/dist/esm/helpers-f0dcbd72.js +418 -0
  441. package/dist/esm/i18n-53f85411.js +13 -0
  442. package/dist/esm/{index-CNcx43L8.js → index-0b560278.js} +4 -4
  443. package/dist/esm/index-5894dd63.js +196 -0
  444. package/dist/esm/{index-DUF6JAQL.js → index-5a126e54.js} +6 -6
  445. package/dist/esm/index-5e663431.js +128 -0
  446. package/dist/esm/index-8cc94b11.js +2219 -0
  447. package/dist/esm/index-afdf867c.js +26 -0
  448. package/dist/esm/index-d9b41a43.js +34 -0
  449. package/dist/esm/index-f6dce931.js +466 -0
  450. package/dist/esm/index-fb97e55c.js +7 -0
  451. package/dist/esm/input-shims-75d4750d.js +617 -0
  452. package/dist/esm/input.utils-79bde07f.js +138 -0
  453. package/dist/esm/ion-accordion-group.entry.js +197 -203
  454. package/dist/esm/ion-accordion.entry.js +303 -305
  455. package/dist/esm/ion-action-sheet_3.entry.js +693 -705
  456. package/dist/esm/ion-app.entry.js +93 -93
  457. package/dist/esm/ion-avatar.entry.js +12 -12
  458. package/dist/esm/ion-back-button.entry.js +76 -76
  459. package/dist/esm/ion-backdrop.entry.js +42 -42
  460. package/dist/esm/ion-badge.entry.js +17 -17
  461. package/dist/esm/ion-breadcrumb.entry.js +84 -84
  462. package/dist/esm/ion-breadcrumbs.entry.js +118 -124
  463. package/dist/esm/ion-buttons_3.entry.js +820 -822
  464. package/dist/esm/ion-card-content.entry.js +17 -17
  465. package/dist/esm/ion-card-header.entry.js +20 -20
  466. package/dist/esm/ion-card-subtitle.entry.js +18 -18
  467. package/dist/esm/ion-card-title.entry.js +18 -18
  468. package/dist/esm/ion-card.entry.js +53 -53
  469. package/dist/esm/ion-checkbox_7.entry.js +860 -882
  470. package/dist/esm/ion-chip.entry.js +22 -22
  471. package/dist/esm/ion-col.entry.js +108 -108
  472. package/dist/esm/ion-content.entry.js +374 -374
  473. package/dist/esm/ion-datetime-button.entry.js +328 -328
  474. package/dist/esm/ion-datetime.entry.js +1545 -1567
  475. package/dist/esm/ion-fab-button.entry.js +76 -76
  476. package/dist/esm/ion-fab-list.entry.js +29 -31
  477. package/dist/esm/ion-fab.entry.js +56 -58
  478. package/dist/esm/ion-footer.entry.js +92 -92
  479. package/dist/esm/ion-grid.entry.js +15 -15
  480. package/dist/esm/ion-header.entry.js +141 -141
  481. package/dist/esm/ion-icon.entry.js +102 -112
  482. package/dist/esm/ion-img.entry.js +81 -83
  483. package/dist/esm/ion-infinite-scroll-content.entry.js +32 -32
  484. package/dist/esm/ion-infinite-scroll.entry.js +172 -176
  485. package/dist/esm/ion-input.entry.js +445 -453
  486. package/dist/esm/ion-item-divider.entry.js +21 -21
  487. package/dist/esm/ion-item-group.entry.js +18 -18
  488. package/dist/esm/ion-item-option.entry.js +43 -43
  489. package/dist/esm/ion-item-options.entry.js +38 -38
  490. package/dist/esm/ion-item-sliding.entry.js +389 -391
  491. package/dist/esm/ion-loading.entry.js +160 -164
  492. package/dist/esm/ion-menu-button.entry.js +58 -58
  493. package/dist/esm/ion-menu-toggle.entry.js +34 -34
  494. package/dist/esm/ion-menu.entry.js +604 -612
  495. package/dist/esm/ion-modal.entry.js +549 -553
  496. package/dist/esm/ion-nav-link.entry.js +15 -15
  497. package/dist/esm/ion-nav.entry.js +821 -825
  498. package/dist/esm/ion-note.entry.js +17 -17
  499. package/dist/esm/ion-picker-column.entry.js +325 -327
  500. package/dist/esm/ion-picker.entry.js +196 -200
  501. package/dist/esm/ion-popover.entry.js +324 -330
  502. package/dist/esm/ion-progress-bar.entry.js +42 -42
  503. package/dist/esm/ion-range.entry.js +642 -654
  504. package/dist/esm/ion-refresher-content.entry.js +51 -51
  505. package/dist/esm/ion-refresher.entry.js +584 -586
  506. package/dist/esm/ion-reorder-group.entry.js +250 -252
  507. package/dist/esm/ion-reorder.entry.js +24 -24
  508. package/dist/esm/ion-route-redirect.entry.js +17 -21
  509. package/dist/esm/ion-route.entry.js +35 -41
  510. package/dist/esm/ion-router-link.entry.js +29 -29
  511. package/dist/esm/ion-router-outlet.entry.js +176 -178
  512. package/dist/esm/ion-router.entry.js +264 -264
  513. package/dist/esm/ion-row.entry.js +10 -10
  514. package/dist/esm/ion-searchbar.entry.js +386 -396
  515. package/dist/esm/ion-segment-button.entry.js +94 -96
  516. package/dist/esm/ion-segment.entry.js +412 -420
  517. package/dist/esm/ion-select-option.entry.js +14 -14
  518. package/dist/esm/ion-select.entry.js +691 -699
  519. package/dist/esm/ion-skeleton-text.entry.js +33 -33
  520. package/dist/esm/ion-spinner.entry.js +48 -48
  521. package/dist/esm/ion-split-pane.entry.js +118 -124
  522. package/dist/esm/ion-tab-bar.entry.js +64 -66
  523. package/dist/esm/ion-tab-button.entry.js +80 -80
  524. package/dist/esm/ion-tab.entry.js +48 -50
  525. package/dist/esm/ion-tabs.entry.js +132 -132
  526. package/dist/esm/ion-textarea.entry.js +394 -400
  527. package/dist/esm/ion-thumbnail.entry.js +10 -10
  528. package/dist/esm/ion-title.entry.js +41 -43
  529. package/dist/esm/ion-toast.entry.js +369 -375
  530. package/dist/esm/ion-toggle.entry.js +228 -230
  531. package/dist/esm/ion-toolbar.entry.js +59 -59
  532. package/dist/esm/{ionic-global-DXXzPLPc.js → ionic-global-0b7766cb.js} +55 -58
  533. package/dist/esm/ios.transition-22fb53bc.js +651 -0
  534. package/dist/esm/keyboard-1f073554.js +82 -0
  535. package/dist/esm/keyboard-96b6e80b.js +146 -0
  536. package/dist/esm/keyboard-controller-5a2f625f.js +165 -0
  537. package/dist/esm/loader.js +17 -8
  538. package/dist/esm/lock-controller-632e3c10.js +38 -0
  539. package/dist/esm/md.transition-f6ff9834.js +57 -0
  540. package/dist/esm/menu-toggle-util-594849ff.js +12 -0
  541. package/dist/esm/notch-controller-d511b3b3.js +153 -0
  542. package/dist/esm/{overlays-SBLrmFy6.js → overlays-642a91df.js} +7 -7
  543. package/dist/esm/polyfills/core-js.js +11 -0
  544. package/dist/esm/polyfills/css-shim.js +1 -0
  545. package/dist/esm/polyfills/dom.js +79 -0
  546. package/dist/esm/polyfills/es5-html-element.js +1 -0
  547. package/dist/esm/polyfills/index.js +34 -0
  548. package/dist/esm/polyfills/system.js +6 -0
  549. package/dist/esm/refresher.utils-19137568.js +196 -0
  550. package/dist/esm/{status-tap-CjxQA4Bj.js → status-tap-bb6959a8.js} +4 -4
  551. package/dist/esm/swipe-back-6cec4c33.js +79 -0
  552. package/dist/esm/theme-35c700b7.js +43 -0
  553. package/dist/esm/watch-options-7bf43687.js +47 -0
  554. package/dist/node_modules/@ionic/core/dist/collection/components/accordion/accordion.ios.css +193 -0
  555. package/dist/node_modules/@ionic/core/dist/collection/components/accordion/accordion.md.css +135 -0
  556. package/dist/node_modules/@ionic/core/dist/collection/components/accordion-group/accordion-group.ios.css +127 -0
  557. package/dist/node_modules/@ionic/core/dist/collection/components/accordion-group/accordion-group.md.css +229 -0
  558. package/dist/node_modules/@ionic/core/dist/collection/components/action-sheet/action-sheet.ios.css +456 -0
  559. package/dist/node_modules/@ionic/core/dist/collection/components/action-sheet/action-sheet.md.css +384 -0
  560. package/dist/node_modules/@ionic/core/dist/collection/components/alert/alert.ios.css +755 -0
  561. package/dist/node_modules/@ionic/core/dist/collection/components/alert/alert.md.css +770 -0
  562. package/dist/node_modules/@ionic/core/dist/collection/components/app/app.css +17 -0
  563. package/dist/node_modules/@ionic/core/dist/collection/components/avatar/avatar.ios.css +132 -0
  564. package/dist/node_modules/@ionic/core/dist/collection/components/avatar/avatar.md.css +132 -0
  565. package/dist/node_modules/@ionic/core/dist/collection/components/back-button/back-button.ios.css +372 -0
  566. package/dist/node_modules/@ionic/core/dist/collection/components/back-button/back-button.md.css +385 -0
  567. package/dist/node_modules/@ionic/core/dist/collection/components/backdrop/backdrop.ios.css +136 -0
  568. package/dist/node_modules/@ionic/core/dist/collection/components/backdrop/backdrop.md.css +136 -0
  569. package/dist/node_modules/@ionic/core/dist/collection/components/badge/badge.ios.css +168 -0
  570. package/dist/node_modules/@ionic/core/dist/collection/components/badge/badge.md.css +164 -0
  571. package/dist/node_modules/@ionic/core/dist/collection/components/breadcrumb/breadcrumb.ios.css +326 -0
  572. package/dist/node_modules/@ionic/core/dist/collection/components/breadcrumb/breadcrumb.md.css +310 -0
  573. package/dist/node_modules/@ionic/core/dist/collection/components/breadcrumbs/breadcrumbs.ios.css +81 -0
  574. package/dist/node_modules/@ionic/core/dist/collection/components/breadcrumbs/breadcrumbs.md.css +80 -0
  575. package/dist/node_modules/@ionic/core/dist/collection/components/button/button.ios.css +596 -0
  576. package/dist/node_modules/@ionic/core/dist/collection/components/button/button.md.css +517 -0
  577. package/dist/node_modules/@ionic/core/dist/collection/components/buttons/buttons.ios.css +279 -0
  578. package/dist/node_modules/@ionic/core/dist/collection/components/buttons/buttons.md.css +299 -0
  579. package/dist/node_modules/@ionic/core/dist/collection/components/card/card.ios.css +203 -0
  580. package/dist/node_modules/@ionic/core/dist/collection/components/card/card.md.css +198 -0
  581. package/dist/node_modules/@ionic/core/dist/collection/components/card-content/card-content.ios.css +163 -0
  582. package/dist/node_modules/@ionic/core/dist/collection/components/card-content/card-content.md.css +165 -0
  583. package/dist/node_modules/@ionic/core/dist/collection/components/card-header/card-header.ios.css +141 -0
  584. package/dist/node_modules/@ionic/core/dist/collection/components/card-header/card-header.md.css +138 -0
  585. package/dist/node_modules/@ionic/core/dist/collection/components/card-subtitle/card-subtitle.ios.css +138 -0
  586. package/dist/node_modules/@ionic/core/dist/collection/components/card-subtitle/card-subtitle.md.css +136 -0
  587. package/dist/node_modules/@ionic/core/dist/collection/components/card-title/card-title.ios.css +137 -0
  588. package/dist/node_modules/@ionic/core/dist/collection/components/card-title/card-title.md.css +137 -0
  589. package/dist/node_modules/@ionic/core/dist/collection/components/checkbox/checkbox.ios.css +536 -0
  590. package/dist/node_modules/@ionic/core/dist/collection/components/checkbox/checkbox.md.css +552 -0
  591. package/dist/node_modules/@ionic/core/dist/collection/components/chip/chip.ios.css +212 -0
  592. package/dist/node_modules/@ionic/core/dist/collection/components/chip/chip.md.css +207 -0
  593. package/dist/node_modules/@ionic/core/dist/collection/components/col/col.css +200 -0
  594. package/dist/node_modules/@ionic/core/dist/collection/components/content/content.css +282 -0
  595. package/dist/node_modules/@ionic/core/dist/collection/components/datetime/datetime.ios.css +850 -0
  596. package/dist/node_modules/@ionic/core/dist/collection/components/datetime/datetime.md.css +706 -0
  597. package/dist/node_modules/@ionic/core/dist/collection/components/datetime-button/datetime-button.css +100 -0
  598. package/dist/node_modules/@ionic/core/dist/collection/components/fab/fab.css +366 -0
  599. package/dist/node_modules/@ionic/core/dist/collection/components/fab-button/fab-button.ios.css +422 -0
  600. package/dist/node_modules/@ionic/core/dist/collection/components/fab-button/fab-button.md.css +393 -0
  601. package/dist/node_modules/@ionic/core/dist/collection/components/fab-list/fab-list.css +240 -0
  602. package/dist/node_modules/@ionic/core/dist/collection/components/footer/footer.ios.css +146 -0
  603. package/dist/node_modules/@ionic/core/dist/collection/components/footer/footer.md.css +129 -0
  604. package/dist/node_modules/@ionic/core/dist/collection/components/grid/grid.css +235 -0
  605. package/dist/node_modules/@ionic/core/dist/collection/components/header/header.ios.css +250 -0
  606. package/dist/node_modules/@ionic/core/dist/collection/components/header/header.md.css +133 -0
  607. package/dist/node_modules/@ionic/core/dist/collection/components/img/img.css +12 -0
  608. package/dist/node_modules/@ionic/core/dist/collection/components/infinite-scroll/infinite-scroll.css +8 -0
  609. package/dist/node_modules/@ionic/core/dist/collection/components/infinite-scroll-content/infinite-scroll-content.ios.css +156 -0
  610. package/dist/node_modules/@ionic/core/dist/collection/components/infinite-scroll-content/infinite-scroll-content.md.css +156 -0
  611. package/dist/node_modules/@ionic/core/dist/collection/components/input/input.ios.css +833 -0
  612. package/dist/node_modules/@ionic/core/dist/collection/components/input/input.md.css +1446 -0
  613. package/dist/node_modules/@ionic/core/dist/collection/components/item/item.ios.css +815 -0
  614. package/dist/node_modules/@ionic/core/dist/collection/components/item/item.md.css +1187 -0
  615. package/dist/node_modules/@ionic/core/dist/collection/components/item-divider/item-divider.ios.css +351 -0
  616. package/dist/node_modules/@ionic/core/dist/collection/components/item-divider/item-divider.md.css +417 -0
  617. package/dist/node_modules/@ionic/core/dist/collection/components/item-group/item-group.ios.css +114 -0
  618. package/dist/node_modules/@ionic/core/dist/collection/components/item-group/item-group.md.css +114 -0
  619. package/dist/node_modules/@ionic/core/dist/collection/components/item-option/item-option.ios.css +242 -0
  620. package/dist/node_modules/@ionic/core/dist/collection/components/item-option/item-option.md.css +236 -0
  621. package/dist/node_modules/@ionic/core/dist/collection/components/item-options/item-options.ios.css +287 -0
  622. package/dist/node_modules/@ionic/core/dist/collection/components/item-options/item-options.md.css +284 -0
  623. package/dist/node_modules/@ionic/core/dist/collection/components/item-sliding/item-sliding.css +121 -0
  624. package/dist/node_modules/@ionic/core/dist/collection/components/label/label.ios.css +334 -0
  625. package/dist/node_modules/@ionic/core/dist/collection/components/label/label.md.css +421 -0
  626. package/dist/node_modules/@ionic/core/dist/collection/components/list/list.ios.css +242 -0
  627. package/dist/node_modules/@ionic/core/dist/collection/components/list/list.md.css +287 -0
  628. package/dist/node_modules/@ionic/core/dist/collection/components/list-header/list-header.ios.css +285 -0
  629. package/dist/node_modules/@ionic/core/dist/collection/components/list-header/list-header.md.css +266 -0
  630. package/dist/node_modules/@ionic/core/dist/collection/components/loading/loading.ios.css +205 -0
  631. package/dist/node_modules/@ionic/core/dist/collection/components/loading/loading.md.css +196 -0
  632. package/dist/node_modules/@ionic/core/dist/collection/components/menu/menu.ios.css +378 -0
  633. package/dist/node_modules/@ionic/core/dist/collection/components/menu/menu.md.css +374 -0
  634. package/dist/node_modules/@ionic/core/dist/collection/components/menu-button/menu-button.ios.css +279 -0
  635. package/dist/node_modules/@ionic/core/dist/collection/components/menu-button/menu-button.md.css +282 -0
  636. package/dist/node_modules/@ionic/core/dist/collection/components/menu-toggle/menu-toggle.css +3 -0
  637. package/dist/node_modules/@ionic/core/dist/collection/components/modal/modal.ios.css +357 -0
  638. package/dist/node_modules/@ionic/core/dist/collection/components/modal/modal.md.css +272 -0
  639. package/dist/node_modules/@ionic/core/dist/collection/components/nav/nav.css +64 -0
  640. package/dist/node_modules/@ionic/core/dist/collection/components/note/note.ios.css +127 -0
  641. package/dist/node_modules/@ionic/core/dist/collection/components/note/note.md.css +127 -0
  642. package/dist/node_modules/@ionic/core/dist/collection/components/picker/picker.ios.css +367 -0
  643. package/dist/node_modules/@ionic/core/dist/collection/components/picker/picker.md.css +354 -0
  644. package/dist/node_modules/@ionic/core/dist/collection/components/picker-column/picker-column.ios.css +255 -0
  645. package/dist/node_modules/@ionic/core/dist/collection/components/picker-column/picker-column.md.css +246 -0
  646. package/dist/node_modules/@ionic/core/dist/collection/components/picker-column-internal/picker-column-internal.ios.css +138 -0
  647. package/dist/node_modules/@ionic/core/dist/collection/components/picker-column-internal/picker-column-internal.md.css +196 -0
  648. package/dist/node_modules/@ionic/core/dist/collection/components/picker-internal/picker-internal.ios.css +262 -0
  649. package/dist/node_modules/@ionic/core/dist/collection/components/picker-internal/picker-internal.md.css +258 -0
  650. package/dist/node_modules/@ionic/core/dist/collection/components/popover/popover.ios.css +366 -0
  651. package/dist/node_modules/@ionic/core/dist/collection/components/popover/popover.md.css +266 -0
  652. package/dist/node_modules/@ionic/core/dist/collection/components/progress-bar/progress-bar.ios.css +261 -0
  653. package/dist/node_modules/@ionic/core/dist/collection/components/progress-bar/progress-bar.md.css +261 -0
  654. package/dist/node_modules/@ionic/core/dist/collection/components/radio/radio.ios.css +557 -0
  655. package/dist/node_modules/@ionic/core/dist/collection/components/radio/radio.md.css +580 -0
  656. package/dist/node_modules/@ionic/core/dist/collection/components/range/range.ios.css +660 -0
  657. package/dist/node_modules/@ionic/core/dist/collection/components/range/range.md.css +819 -0
  658. package/dist/node_modules/@ionic/core/dist/collection/components/refresher/refresher.ios.css +321 -0
  659. package/dist/node_modules/@ionic/core/dist/collection/components/refresher/refresher.md.css +316 -0
  660. package/dist/node_modules/@ionic/core/dist/collection/components/reorder/reorder.ios.css +77 -0
  661. package/dist/node_modules/@ionic/core/dist/collection/components/reorder/reorder.md.css +77 -0
  662. package/dist/node_modules/@ionic/core/dist/collection/components/reorder-group/reorder-group.css +89 -0
  663. package/dist/node_modules/@ionic/core/dist/collection/components/ripple-effect/ripple-effect.css +113 -0
  664. package/dist/node_modules/@ionic/core/dist/collection/components/router-link/router-link.css +84 -0
  665. package/dist/node_modules/@ionic/core/dist/collection/components/router-outlet/router-outlet.css +64 -0
  666. package/dist/node_modules/@ionic/core/dist/collection/components/row/row.css +136 -0
  667. package/dist/node_modules/@ionic/core/dist/collection/components/searchbar/searchbar.ios.css +477 -0
  668. package/dist/node_modules/@ionic/core/dist/collection/components/searchbar/searchbar.md.css +456 -0
  669. package/dist/node_modules/@ionic/core/dist/collection/components/segment/segment.ios.css +224 -0
  670. package/dist/node_modules/@ionic/core/dist/collection/components/segment/segment.md.css +214 -0
  671. package/dist/node_modules/@ionic/core/dist/collection/components/segment-button/segment-button.ios.css +520 -0
  672. package/dist/node_modules/@ionic/core/dist/collection/components/segment-button/segment-button.md.css +506 -0
  673. package/dist/node_modules/@ionic/core/dist/collection/components/select/select.ios.css +787 -0
  674. package/dist/node_modules/@ionic/core/dist/collection/components/select/select.md.css +1374 -0
  675. package/dist/node_modules/@ionic/core/dist/collection/components/select-option/select-option.css +3 -0
  676. package/dist/node_modules/@ionic/core/dist/collection/components/select-popover/select-popover.ios.css +190 -0
  677. package/dist/node_modules/@ionic/core/dist/collection/components/select-popover/select-popover.md.css +212 -0
  678. package/dist/node_modules/@ionic/core/dist/collection/components/skeleton-text/skeleton-text.css +108 -0
  679. package/dist/node_modules/@ionic/core/dist/collection/components/spinner/spinner.css +232 -0
  680. package/dist/node_modules/@ionic/core/dist/collection/components/split-pane/split-pane.ios.css +265 -0
  681. package/dist/node_modules/@ionic/core/dist/collection/components/split-pane/split-pane.md.css +265 -0
  682. package/dist/node_modules/@ionic/core/dist/collection/components/tab/tab.css +4 -0
  683. package/dist/node_modules/@ionic/core/dist/collection/components/tab-bar/tab-bar.ios.css +252 -0
  684. package/dist/node_modules/@ionic/core/dist/collection/components/tab-bar/tab-bar.md.css +239 -0
  685. package/dist/node_modules/@ionic/core/dist/collection/components/tab-button/tab-button.ios.css +477 -0
  686. package/dist/node_modules/@ionic/core/dist/collection/components/tab-button/tab-button.md.css +501 -0
  687. package/dist/node_modules/@ionic/core/dist/collection/components/tabs/tabs.css +74 -0
  688. package/dist/node_modules/@ionic/core/dist/collection/components/text/text.css +58 -0
  689. package/dist/node_modules/@ionic/core/dist/collection/components/textarea/textarea.ios.css +987 -0
  690. package/dist/node_modules/@ionic/core/dist/collection/components/textarea/textarea.md.css +1553 -0
  691. package/dist/node_modules/@ionic/core/dist/collection/components/thumbnail/thumbnail.css +76 -0
  692. package/dist/node_modules/@ionic/core/dist/collection/components/title/title.ios.css +183 -0
  693. package/dist/node_modules/@ionic/core/dist/collection/components/title/title.md.css +102 -0
  694. package/dist/node_modules/@ionic/core/dist/collection/components/toast/toast.ios.css +399 -0
  695. package/dist/node_modules/@ionic/core/dist/collection/components/toast/toast.md.css +429 -0
  696. package/dist/node_modules/@ionic/core/dist/collection/components/toggle/toggle.ios.css +680 -0
  697. package/dist/node_modules/@ionic/core/dist/collection/components/toggle/toggle.md.css +625 -0
  698. package/dist/node_modules/@ionic/core/dist/collection/components/toolbar/toolbar.ios.css +265 -0
  699. package/dist/node_modules/@ionic/core/dist/collection/components/toolbar/toolbar.md.css +244 -0
  700. package/dist/node_modules/ionicons/dist/collection/components/icon/icon.css +144 -0
  701. package/dist/types/components/amwal-checkout-button/amwal-checkout-button.d.ts +327 -327
  702. package/dist/types/components/amwal-checkout-button/amwal-checkout-button.stories.d.ts +34 -34
  703. package/dist/types/components/amwal-installments-guide/amwal-installments-guide.d.ts +14 -14
  704. package/dist/types/components/amwal-installments-guide/amwal-installments-guide.stories.d.ts +17 -17
  705. package/dist/types/components/amwal-installments-timeline/amwal-installments-timeline.d.ts +106 -106
  706. package/dist/types/components/amwal-installments-timeline/amwal-installments-timeline.stories.d.ts +67 -67
  707. package/dist/types/components/amwal-pos/amwal-pos.d.ts +228 -228
  708. package/dist/types/components/amwal-pos/amwal-pos.stories.d.ts +185 -185
  709. package/dist/types/components/amwal-widget/amwal-widget-modal.d.ts +56 -56
  710. package/dist/types/components/amwal-widget/amwal-widget.d.ts +165 -165
  711. package/dist/types/components/amwal-widget/amwal-widget.stories.d.ts +101 -101
  712. package/dist/types/components.d.ts +0 -206
  713. package/dist/types/lang/i18n.d.ts +1 -1
  714. package/dist/types/stencil-public-runtime.d.ts +21 -191
  715. package/loader/cdn.js +3 -1
  716. package/loader/index.cjs.js +3 -1
  717. package/loader/index.d.ts +1 -4
  718. package/loader/index.es2017.js +3 -1
  719. package/loader/index.js +3 -1
  720. package/loader/package.json +11 -0
  721. package/package.json +28 -34
  722. package/dist/checkout/p-0161d109.entry.js +0 -1
  723. package/dist/checkout/p-0a8ef1ec.entry.js +0 -1
  724. package/dist/checkout/p-10a72fbe.entry.js +0 -1
  725. package/dist/checkout/p-12ed4081.entry.js +0 -1
  726. package/dist/checkout/p-13c36adc.entry.js +0 -1
  727. package/dist/checkout/p-194b17d8.entry.js +0 -1
  728. package/dist/checkout/p-272a1ffd.entry.js +0 -1
  729. package/dist/checkout/p-307af48b.entry.js +0 -1
  730. package/dist/checkout/p-3207674d.entry.js +0 -1
  731. package/dist/checkout/p-3208e56f.entry.js +0 -1
  732. package/dist/checkout/p-4426eb3b.entry.js +0 -1
  733. package/dist/checkout/p-458da59f.entry.js +0 -1
  734. package/dist/checkout/p-46e69508.entry.js +0 -1
  735. package/dist/checkout/p-49046c16.entry.js +0 -4
  736. package/dist/checkout/p-53dc0e86.entry.js +0 -1
  737. package/dist/checkout/p-5a6fc9fd.entry.js +0 -1
  738. package/dist/checkout/p-5e65653a.entry.js +0 -1
  739. package/dist/checkout/p-5f124c24.entry.js +0 -1
  740. package/dist/checkout/p-6a8ad104.entry.js +0 -1
  741. package/dist/checkout/p-76fb4325.entry.js +0 -1
  742. package/dist/checkout/p-78db60fb.entry.js +0 -1
  743. package/dist/checkout/p-8e34a1bb.entry.js +0 -1
  744. package/dist/checkout/p-91474b10.entry.js +0 -1
  745. package/dist/checkout/p-93OyAGoo.js +0 -2
  746. package/dist/checkout/p-94a57258.entry.js +0 -1
  747. package/dist/checkout/p-BEVStXwd.js +0 -7
  748. package/dist/checkout/p-BQu7QPd5.js +0 -4
  749. package/dist/checkout/p-BR7SJd-v.js +0 -4
  750. package/dist/checkout/p-BcFRJSFv.js +0 -4
  751. package/dist/checkout/p-BcUxrseY.js +0 -1
  752. package/dist/checkout/p-BdG893XR.js +0 -4
  753. package/dist/checkout/p-BgOwfqIY.js +0 -4
  754. package/dist/checkout/p-Bm9bMvCb.js +0 -4
  755. package/dist/checkout/p-C03M5ZSM.js +0 -1
  756. package/dist/checkout/p-C6kqtbmV.js +0 -4
  757. package/dist/checkout/p-C75BfBAE.js +0 -1
  758. package/dist/checkout/p-CVrvo9Qz.js +0 -4
  759. package/dist/checkout/p-ChixdDt6.js +0 -4
  760. package/dist/checkout/p-Cjnmql4G.js +0 -8
  761. package/dist/checkout/p-D0I0TqZU.js +0 -4
  762. package/dist/checkout/p-D2NxOvQ8.js +0 -4
  763. package/dist/checkout/p-D8d_89Nl.js +0 -4
  764. package/dist/checkout/p-DAhcxcAh.js +0 -4
  765. package/dist/checkout/p-DDtPO7yO.js +0 -4
  766. package/dist/checkout/p-DKg_dYcq.js +0 -4
  767. package/dist/checkout/p-DMAPbDyG.js +0 -4
  768. package/dist/checkout/p-DihS-5gH.js +0 -4
  769. package/dist/checkout/p-DkrNcwKK.js +0 -5
  770. package/dist/checkout/p-Dzj_jqIY.js +0 -4
  771. package/dist/checkout/p-E8AXUhZ3.js +0 -7
  772. package/dist/checkout/p-Ufaww5Lq.js +0 -4
  773. package/dist/checkout/p-a90efa79.entry.js +0 -1
  774. package/dist/checkout/p-abd12b84.entry.js +0 -1
  775. package/dist/checkout/p-abe1becc.entry.js +0 -1
  776. package/dist/checkout/p-b2f66c60.entry.js +0 -4
  777. package/dist/checkout/p-b45f5952.entry.js +0 -1
  778. package/dist/checkout/p-c2240d19.entry.js +0 -1
  779. package/dist/checkout/p-c28b4374.entry.js +0 -1
  780. package/dist/checkout/p-cb2db223.entry.js +0 -1
  781. package/dist/checkout/p-cb3967fc.entry.js +0 -1
  782. package/dist/checkout/p-cef16f11.entry.js +0 -1
  783. package/dist/checkout/p-df1b4347.entry.js +0 -4
  784. package/dist/checkout/p-e4bc42fb.entry.js +0 -1
  785. package/dist/checkout/p-e785fb8a.entry.js +0 -1
  786. package/dist/checkout/p-e8bd206a.entry.js +0 -1
  787. package/dist/checkout/p-ef749875.entry.js +0 -1
  788. package/dist/checkout/p-f157b6b2.entry.js +0 -4
  789. package/dist/checkout/p-f351a19a.entry.js +0 -1
  790. package/dist/checkout/p-ff2e59e3.entry.js +0 -1
  791. package/dist/checkout/p-hAETByzF.js +0 -5
  792. package/dist/checkout/p-vn1iXXUO.js +0 -9
  793. package/dist/cjs/i18n-uGNv9SLK.js +0 -13
  794. package/dist/cjs/index-DncWzXDA.js +0 -3738
  795. package/dist/components/p-55BwDerf.js +0 -8
  796. package/dist/components/p-B-M4K7iJ.js +0 -7
  797. package/dist/components/p-B-hirT0v.js +0 -4
  798. package/dist/components/p-B3WORC1a.js +0 -1
  799. package/dist/components/p-B5XH2zAk.js +0 -1
  800. package/dist/components/p-B5ZghgSh.js +0 -4
  801. package/dist/components/p-BEVStXwd.js +0 -7
  802. package/dist/components/p-BH0TCnxk.js +0 -4
  803. package/dist/components/p-BIA8A9ZO.js +0 -1
  804. package/dist/components/p-BOkYKP6F.js +0 -1
  805. package/dist/components/p-BOm0KT2x.js +0 -1
  806. package/dist/components/p-Bb_Zji0h.js +0 -4
  807. package/dist/components/p-BmVRXR1y.js +0 -4
  808. package/dist/components/p-BnQDByf2.js +0 -1
  809. package/dist/components/p-BoxjYI-Q.js +0 -4
  810. package/dist/components/p-BriBxgcM.js +0 -1
  811. package/dist/components/p-BwKjt_Dc.js +0 -4
  812. package/dist/components/p-Bx78uXfc.js +0 -5
  813. package/dist/components/p-C-20JWsp.js +0 -4
  814. package/dist/components/p-C03M5ZSM.js +0 -1
  815. package/dist/components/p-C53feagD.js +0 -4
  816. package/dist/components/p-CLrB3zV0.js +0 -4
  817. package/dist/components/p-CN34uOrj.js +0 -9
  818. package/dist/components/p-CQmcNwZM.js +0 -4
  819. package/dist/components/p-CYd0Smt1.js +0 -1
  820. package/dist/components/p-CgPXSjzI.js +0 -4
  821. package/dist/components/p-Cho32MPa.js +0 -4
  822. package/dist/components/p-ClE6rMJs.js +0 -4
  823. package/dist/components/p-Cm9b7fIl.js +0 -1
  824. package/dist/components/p-CukVBo5-.js +0 -4
  825. package/dist/components/p-D2NxOvQ8.js +0 -4
  826. package/dist/components/p-D4DqwBlW.js +0 -4
  827. package/dist/components/p-D7YY0NXg.js +0 -4
  828. package/dist/components/p-D8OVJo1v.js +0 -7
  829. package/dist/components/p-DKg_dYcq.js +0 -4
  830. package/dist/components/p-DLVYPrYs.js +0 -1
  831. package/dist/components/p-DMmSL7_l.js +0 -1
  832. package/dist/components/p-DOPF2QRF.js +0 -1
  833. package/dist/components/p-DTgJTJD6.js +0 -1
  834. package/dist/components/p-DiVJyqlX.js +0 -4
  835. package/dist/components/p-DrS88eFz.js +0 -1
  836. package/dist/components/p-Dtdm8lKC.js +0 -4
  837. package/dist/components/p-DuZ7hY1a.js +0 -4
  838. package/dist/components/p-Dx-C8Ob_.js +0 -7
  839. package/dist/components/p-DxEgz9x_.js +0 -1
  840. package/dist/components/p-DxSo4SXG.js +0 -1
  841. package/dist/components/p-HSPzo8it.js +0 -1
  842. package/dist/components/p-OrwCUtWu.js +0 -4
  843. package/dist/components/p-UgkI2Wa4.js +0 -1
  844. package/dist/components/p-VeNdmYSo.js +0 -1
  845. package/dist/components/p-YbpebnFS.js +0 -4
  846. package/dist/components/p-ZjP4CjeZ.js +0 -4
  847. package/dist/components/p-_VuKPdkD.js +0 -4
  848. package/dist/components/p-aWL6BxTN.js +0 -4
  849. package/dist/components/p-hHmYLOfE.js +0 -4
  850. package/dist/components/p-qoI-S7yk.js +0 -4
  851. package/dist/components/p-uXV7tzS3.js +0 -1
  852. package/dist/components/p-yu3xCFhr.js +0 -7
  853. package/dist/components/p-zp5f483d.js +0 -1
  854. package/dist/esm/i18n-C_AfxZ5D.js +0 -13
  855. package/dist/esm/index-93OyAGoo.js +0 -3721
  856. /package/dist/checkout/{p-B-hirT0v.js → p-01ad898f.js} +0 -0
  857. /package/dist/checkout/{p-DiVJyqlX.js → p-350e7423.js} +0 -0
  858. /package/dist/checkout/{p-sObYyvOy.js → p-52b4c112.js} +0 -0
  859. /package/dist/checkout/{p-BmVRXR1y.js → p-620fa0ec.js} +0 -0
  860. /package/dist/checkout/{p-hHmYLOfE.js → p-94286cc3.js} +0 -0
  861. /package/dist/checkout/{p-D4RIp70E.js → p-9efbca93.js} +0 -0
  862. /package/dist/checkout/{p-Dtdm8lKC.js → p-9f4ac833.js} +0 -0
  863. /package/dist/checkout/{p-yu3xCFhr.js → p-b2289937.js} +0 -0
  864. /package/dist/checkout/{p-C53feagD.js → p-d5862637.js} +0 -0
  865. /package/dist/checkout/{p-ZjP4CjeZ.js → p-d7fe59ee.js} +0 -0
  866. /package/dist/{components/p-CYPPT3AE.js → checkout/p-e187a77c.js} +0 -0
  867. /package/dist/checkout/{p-CukVBo5-.js → p-f728a68f.js} +0 -0
  868. /package/dist/cjs/{compare-with-utils-JlLIkecm.js → compare-with-utils-adbe64a6.js} +0 -0
  869. /package/dist/cjs/{config-ptk2Lf4l.js → config-e2a8c0c7.js} +0 -0
  870. /package/dist/cjs/{cubic-bezier-Bv3PvaRI.js → cubic-bezier-5ff9b04e.js} +0 -0
  871. /package/dist/cjs/{dir-Br-7_bel.js → dir-374f13f2.js} +0 -0
  872. /package/dist/cjs/{focus-visible-Da2o6bTP.js → focus-visible-b7381162.js} +0 -0
  873. /package/dist/cjs/{index-CH3IFTaK.js → index-071786b4.js} +0 -0
  874. /package/dist/cjs/{index-D3mJ1Cix.js → index-a281cac3.js} +0 -0
  875. /package/dist/cjs/{lock-controller-58TZFRHC.js → lock-controller-e2dfece6.js} +0 -0
  876. /package/dist/cjs/{spinner-configs-BN41iw42.js → spinner-configs-036ebfd8.js} +0 -0
  877. /package/dist/cjs/{theme-DbHdw1Nx.js → theme-12dec869.js} +0 -0
  878. /package/dist/cjs/{watch-options-DOFUPyuf.js → watch-options-1cccbe6a.js} +0 -0
  879. /package/dist/{esm/lock-controller-B-hirT0v.js → components/p-01ad898f.js} +0 -0
  880. /package/dist/{esm/theme-DiVJyqlX.js → components/p-350e7423.js} +0 -0
  881. /package/dist/{esm/focus-visible-BmVRXR1y.js → components/p-620fa0ec.js} +0 -0
  882. /package/dist/{esm/cubic-bezier-hHmYLOfE.js → components/p-94286cc3.js} +0 -0
  883. /package/dist/{esm/watch-options-Dtdm8lKC.js → components/p-9f4ac833.js} +0 -0
  884. /package/dist/{esm/config-yu3xCFhr.js → components/p-b2289937.js} +0 -0
  885. /package/dist/{esm/dir-C53feagD.js → components/p-d5862637.js} +0 -0
  886. /package/dist/{esm/index-ZjP4CjeZ.js → components/p-d7fe59ee.js} +0 -0
  887. /package/dist/esm/{compare-with-utils-sObYyvOy.js → compare-with-utils-d58be312.js} +0 -0
  888. /package/dist/esm/{spinner-configs-D4RIp70E.js → spinner-configs-c9fb0813.js} +0 -0
@@ -1,14 +1,16 @@
1
1
  'use strict';
2
2
 
3
- var index$1 = require('./index-DncWzXDA.js');
4
- var focusVisible = require('./focus-visible-Da2o6bTP.js');
5
- var helpers = require('./helpers-B4vhh9gt.js');
6
- var index = require('./index-CH3IFTaK.js');
7
- var dir = require('./dir-Br-7_bel.js');
8
- var theme = require('./theme-DbHdw1Nx.js');
9
- var index$2 = require('./index-6eOg4xTk.js');
10
- var ionicGlobal = require('./ionic-global-DRLi5Iq3.js');
11
- var data = require('./data-UgkxeXMB.js');
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ const index$1 = require('./index-7522b3a9.js');
6
+ const focusVisible = require('./focus-visible-b7381162.js');
7
+ const helpers = require('./helpers-72ba682d.js');
8
+ const index = require('./index-071786b4.js');
9
+ const dir = require('./dir-374f13f2.js');
10
+ const theme = require('./theme-12dec869.js');
11
+ const index$2 = require('./index-2602a653.js');
12
+ const ionicGlobal = require('./ionic-global-3915f1f1.js');
13
+ const data = require('./data-19081291.js');
12
14
 
13
15
  /*!
14
16
  * (C) Ionic http://ionicframework.com - MIT License
@@ -225,1640 +227,1618 @@ const checkForPresentationFormatMismatch = (el, presentation, formatOptions) =>
225
227
  }
226
228
  };
227
229
 
228
- const datetimeIosCss = () => `:host{display:flex;flex-flow:column;background:var(--background);overflow:hidden}ion-picker-column-internal{min-width:26px}: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: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{order:3;text-align:end}:host .wheel-order-year-first .month-column{order:2;text-align:end}:host .wheel-order-year-first .year-column{order:1;text-align:start}:host .datetime-calendar,:host .datetime-year{display:flex;flex:1 1 auto;flex-flow:column}:host(.show-month-and-year) .datetime-year{display:flex}@supports (background: -webkit-named-image(apple-pay-logo-black)) and (not (aspect-ratio: 1/1)){: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{position:absolute;visibility:hidden;pointer-events:none}@supports (inset-inline-start: 0){: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{inset-inline-start:-99999px}}@supports not (inset-inline-start: 0){: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{left:-99999px}:host-context([dir=rtl]):host(.show-month-and-year) .calendar-next-prev,:host-context([dir=rtl]).show-month-and-year .calendar-next-prev,:host-context([dir=rtl]):host(.show-month-and-year) .calendar-days-of-week,:host-context([dir=rtl]).show-month-and-year .calendar-days-of-week,:host-context([dir=rtl]):host(.show-month-and-year) .calendar-body,:host-context([dir=rtl]).show-month-and-year .calendar-body,:host-context([dir=rtl]):host(.show-month-and-year) .datetime-time,:host-context([dir=rtl]).show-month-and-year .datetime-time{left:unset;right:unset;right:-99999px}@supports selector(:dir(rtl)){:host(.show-month-and-year:dir(rtl)) .calendar-next-prev,:host(.show-month-and-year:dir(rtl)) .calendar-days-of-week,:host(.show-month-and-year:dir(rtl)) .calendar-body,:host(.show-month-and-year:dir(rtl)) .datetime-time{left:unset;right:unset;right:-99999px}}}}@supports (not (background: -webkit-named-image(apple-pay-logo-black))) or ((background: -webkit-named-image(apple-pay-logo-black)) and (aspect-ratio: 1/1)){: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:flex;justify-content:space-between}.datetime-action-buttons .datetime-action-buttons-container{display:flex}:host .calendar-action-buttons{display:flex;justify-content:space-between}:host .calendar-action-buttons ion-item,:host .calendar-action-buttons ion-button{--background:translucent}:host .calendar-action-buttons ion-item ion-label{display:flex;align-items:center;width:auto}:host .calendar-action-buttons ion-item ion-icon{-webkit-padding-start:4px;padding-inline-start:4px;-webkit-padding-end:0;padding-inline-end:0;padding-top:0;padding-bottom:0}: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:flex;flex-grow:1;scroll-snap-type:x mandatory;overflow-x:scroll;overflow-y:hidden;scrollbar-width:none;outline:none}:host .calendar-body .calendar-month{display:flex;flex-flow:column;scroll-snap-align:start;scroll-snap-stop:always;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:flex;align-items: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:flex;position:relative;align-items:center;justify-content:center;border:none;outline:none;background:none;color:currentColor;font-family:var(--ion-font-family, inherit);cursor:pointer;appearance:none;z-index:0}:host .calendar-day[disabled]{pointer-events:none;opacity:0.4}.calendar-day:focus{background: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:flex;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:flex;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:flex;border:none;background:var(--ion-color-step-300, #edeef0);color:var(--ion-text-color, #000);font-family:inherit;font-size:inherit;cursor:pointer;appearance:none}:host .time-body-active{color:var(--ion-color-base)}:host(.in-item){position:static}:host(.show-month-and-year) .calendar-action-buttons ion-item{--color:var(--ion-color-base)}:host{--background:var(--ion-color-light, #ffffff);--background-rgb:var(--ion-color-light-rgb);--title-color:var(--ion-color-step-600, #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, #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}:host .calendar-action-buttons ion-item{--padding-start:16px;--background-hover:transparent;--background-activated:transparent;font-size:min(1rem, 25.6px);font-weight:600}:host .calendar-action-buttons ion-item 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, #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;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)}:host .calendar-day.calendar-day-today{color:var(--ion-color-base)}:host .calendar-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 .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, #cccccc)}:host .datetime-buttons ::slotted(ion-buttons),:host .datetime-buttons ion-buttons{display:flex;align-items:center;justify-content:space-between}:host .datetime-action-buttons{width:100%}`;
230
+ const datetimeIosCss = ":host{display:flex;flex-flow:column;background:var(--background);overflow:hidden}ion-picker-column-internal{min-width:26px}: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: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{order:3;text-align:end}:host .wheel-order-year-first .month-column{order:2;text-align:end}:host .wheel-order-year-first .year-column{order:1;text-align:start}:host .datetime-calendar,:host .datetime-year{display:flex;flex:1 1 auto;flex-flow:column}:host(.show-month-and-year) .datetime-year{display:flex}@supports (background: -webkit-named-image(apple-pay-logo-black)) and (not (aspect-ratio: 1/1)){: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{position:absolute;visibility:hidden;pointer-events:none}@supports (inset-inline-start: 0){: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{inset-inline-start:-99999px}}@supports not (inset-inline-start: 0){: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{left:-99999px}:host-context([dir=rtl]):host(.show-month-and-year) .calendar-next-prev,:host-context([dir=rtl]).show-month-and-year .calendar-next-prev,:host-context([dir=rtl]):host(.show-month-and-year) .calendar-days-of-week,:host-context([dir=rtl]).show-month-and-year .calendar-days-of-week,:host-context([dir=rtl]):host(.show-month-and-year) .calendar-body,:host-context([dir=rtl]).show-month-and-year .calendar-body,:host-context([dir=rtl]):host(.show-month-and-year) .datetime-time,:host-context([dir=rtl]).show-month-and-year .datetime-time{left:unset;right:unset;right:-99999px}@supports selector(:dir(rtl)){:host(.show-month-and-year:dir(rtl)) .calendar-next-prev,:host(.show-month-and-year:dir(rtl)) .calendar-days-of-week,:host(.show-month-and-year:dir(rtl)) .calendar-body,:host(.show-month-and-year:dir(rtl)) .datetime-time{left:unset;right:unset;right:-99999px}}}}@supports (not (background: -webkit-named-image(apple-pay-logo-black))) or ((background: -webkit-named-image(apple-pay-logo-black)) and (aspect-ratio: 1/1)){: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:flex;justify-content:space-between}.datetime-action-buttons .datetime-action-buttons-container{display:flex}:host .calendar-action-buttons{display:flex;justify-content:space-between}:host .calendar-action-buttons ion-item,:host .calendar-action-buttons ion-button{--background:translucent}:host .calendar-action-buttons ion-item ion-label{display:flex;align-items:center;width:auto}:host .calendar-action-buttons ion-item ion-icon{-webkit-padding-start:4px;padding-inline-start:4px;-webkit-padding-end:0;padding-inline-end:0;padding-top:0;padding-bottom:0}: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:flex;flex-grow:1;scroll-snap-type:x mandatory;overflow-x:scroll;overflow-y:hidden;scrollbar-width:none;outline:none}:host .calendar-body .calendar-month{display:flex;flex-flow:column;scroll-snap-align:start;scroll-snap-stop:always;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:flex;align-items: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:flex;position:relative;align-items:center;justify-content:center;border:none;outline:none;background:none;color:currentColor;font-family:var(--ion-font-family, inherit);cursor:pointer;appearance:none;z-index:0}:host .calendar-day[disabled]{pointer-events:none;opacity:0.4}.calendar-day:focus{background: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:flex;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:flex;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:flex;border:none;background:var(--ion-color-step-300, #edeef0);color:var(--ion-text-color, #000);font-family:inherit;font-size:inherit;cursor:pointer;appearance:none}:host .time-body-active{color:var(--ion-color-base)}:host(.in-item){position:static}:host(.show-month-and-year) .calendar-action-buttons ion-item{--color:var(--ion-color-base)}:host{--background:var(--ion-color-light, #ffffff);--background-rgb:var(--ion-color-light-rgb);--title-color:var(--ion-color-step-600, #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, #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}:host .calendar-action-buttons ion-item{--padding-start:16px;--background-hover:transparent;--background-activated:transparent;font-size:min(1rem, 25.6px);font-weight:600}:host .calendar-action-buttons ion-item 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, #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;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)}:host .calendar-day.calendar-day-today{color:var(--ion-color-base)}:host .calendar-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 .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, #cccccc)}:host .datetime-buttons ::slotted(ion-buttons),:host .datetime-buttons ion-buttons{display:flex;align-items:center;justify-content:space-between}:host .datetime-action-buttons{width:100%}";
229
231
 
230
- const datetimeMdCss = () => `:host{display:flex;flex-flow:column;background:var(--background);overflow:hidden}ion-picker-column-internal{min-width:26px}: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: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{order:3;text-align:end}:host .wheel-order-year-first .month-column{order:2;text-align:end}:host .wheel-order-year-first .year-column{order:1;text-align:start}:host .datetime-calendar,:host .datetime-year{display:flex;flex:1 1 auto;flex-flow:column}:host(.show-month-and-year) .datetime-year{display:flex}@supports (background: -webkit-named-image(apple-pay-logo-black)) and (not (aspect-ratio: 1/1)){: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{position:absolute;visibility:hidden;pointer-events:none}@supports (inset-inline-start: 0){: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{inset-inline-start:-99999px}}@supports not (inset-inline-start: 0){: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{left:-99999px}:host-context([dir=rtl]):host(.show-month-and-year) .calendar-next-prev,:host-context([dir=rtl]).show-month-and-year .calendar-next-prev,:host-context([dir=rtl]):host(.show-month-and-year) .calendar-days-of-week,:host-context([dir=rtl]).show-month-and-year .calendar-days-of-week,:host-context([dir=rtl]):host(.show-month-and-year) .calendar-body,:host-context([dir=rtl]).show-month-and-year .calendar-body,:host-context([dir=rtl]):host(.show-month-and-year) .datetime-time,:host-context([dir=rtl]).show-month-and-year .datetime-time{left:unset;right:unset;right:-99999px}@supports selector(:dir(rtl)){:host(.show-month-and-year:dir(rtl)) .calendar-next-prev,:host(.show-month-and-year:dir(rtl)) .calendar-days-of-week,:host(.show-month-and-year:dir(rtl)) .calendar-body,:host(.show-month-and-year:dir(rtl)) .datetime-time{left:unset;right:unset;right:-99999px}}}}@supports (not (background: -webkit-named-image(apple-pay-logo-black))) or ((background: -webkit-named-image(apple-pay-logo-black)) and (aspect-ratio: 1/1)){: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:flex;justify-content:space-between}.datetime-action-buttons .datetime-action-buttons-container{display:flex}:host .calendar-action-buttons{display:flex;justify-content:space-between}:host .calendar-action-buttons ion-item,:host .calendar-action-buttons ion-button{--background:translucent}:host .calendar-action-buttons ion-item ion-label{display:flex;align-items:center;width:auto}:host .calendar-action-buttons ion-item ion-icon{-webkit-padding-start:4px;padding-inline-start:4px;-webkit-padding-end:0;padding-inline-end:0;padding-top:0;padding-bottom:0}: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:flex;flex-grow:1;scroll-snap-type:x mandatory;overflow-x:scroll;overflow-y:hidden;scrollbar-width:none;outline:none}:host .calendar-body .calendar-month{display:flex;flex-flow:column;scroll-snap-align:start;scroll-snap-stop:always;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:flex;align-items: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:flex;position:relative;align-items:center;justify-content:center;border:none;outline:none;background:none;color:currentColor;font-family:var(--ion-font-family, inherit);cursor:pointer;appearance:none;z-index:0}:host .calendar-day[disabled]{pointer-events:none;opacity:0.4}.calendar-day:focus{background: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:flex;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:flex;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:flex;border:none;background:var(--ion-color-step-300, #edeef0);color:var(--ion-text-color, #000);font-family:inherit;font-size:inherit;cursor:pointer;appearance:none}:host .time-body-active{color:var(--ion-color-base)}:host(.in-item){position:static}:host(.show-month-and-year) .calendar-action-buttons ion-item{--color:var(--ion-color-base)}:host{--background:var(--ion-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 .datetime-calendar .calendar-action-buttons ion-item{--padding-start:20px}:host .calendar-action-buttons ion-item,:host .calendar-action-buttons ion-button{--color:var(--ion-color-step-650, #595959)}: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, 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{color:var(--ion-color-contrast)}.calendar-day.calendar-day-active{border:1px solid var(--ion-color-base);background:var(--ion-color-base)}: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, #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:flex;align-items:center;justify-content:flex-end}`;
232
+ const datetimeMdCss = ":host{display:flex;flex-flow:column;background:var(--background);overflow:hidden}ion-picker-column-internal{min-width:26px}: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: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{order:3;text-align:end}:host .wheel-order-year-first .month-column{order:2;text-align:end}:host .wheel-order-year-first .year-column{order:1;text-align:start}:host .datetime-calendar,:host .datetime-year{display:flex;flex:1 1 auto;flex-flow:column}:host(.show-month-and-year) .datetime-year{display:flex}@supports (background: -webkit-named-image(apple-pay-logo-black)) and (not (aspect-ratio: 1/1)){: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{position:absolute;visibility:hidden;pointer-events:none}@supports (inset-inline-start: 0){: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{inset-inline-start:-99999px}}@supports not (inset-inline-start: 0){: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{left:-99999px}:host-context([dir=rtl]):host(.show-month-and-year) .calendar-next-prev,:host-context([dir=rtl]).show-month-and-year .calendar-next-prev,:host-context([dir=rtl]):host(.show-month-and-year) .calendar-days-of-week,:host-context([dir=rtl]).show-month-and-year .calendar-days-of-week,:host-context([dir=rtl]):host(.show-month-and-year) .calendar-body,:host-context([dir=rtl]).show-month-and-year .calendar-body,:host-context([dir=rtl]):host(.show-month-and-year) .datetime-time,:host-context([dir=rtl]).show-month-and-year .datetime-time{left:unset;right:unset;right:-99999px}@supports selector(:dir(rtl)){:host(.show-month-and-year:dir(rtl)) .calendar-next-prev,:host(.show-month-and-year:dir(rtl)) .calendar-days-of-week,:host(.show-month-and-year:dir(rtl)) .calendar-body,:host(.show-month-and-year:dir(rtl)) .datetime-time{left:unset;right:unset;right:-99999px}}}}@supports (not (background: -webkit-named-image(apple-pay-logo-black))) or ((background: -webkit-named-image(apple-pay-logo-black)) and (aspect-ratio: 1/1)){: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:flex;justify-content:space-between}.datetime-action-buttons .datetime-action-buttons-container{display:flex}:host .calendar-action-buttons{display:flex;justify-content:space-between}:host .calendar-action-buttons ion-item,:host .calendar-action-buttons ion-button{--background:translucent}:host .calendar-action-buttons ion-item ion-label{display:flex;align-items:center;width:auto}:host .calendar-action-buttons ion-item ion-icon{-webkit-padding-start:4px;padding-inline-start:4px;-webkit-padding-end:0;padding-inline-end:0;padding-top:0;padding-bottom:0}: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:flex;flex-grow:1;scroll-snap-type:x mandatory;overflow-x:scroll;overflow-y:hidden;scrollbar-width:none;outline:none}:host .calendar-body .calendar-month{display:flex;flex-flow:column;scroll-snap-align:start;scroll-snap-stop:always;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:flex;align-items: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:flex;position:relative;align-items:center;justify-content:center;border:none;outline:none;background:none;color:currentColor;font-family:var(--ion-font-family, inherit);cursor:pointer;appearance:none;z-index:0}:host .calendar-day[disabled]{pointer-events:none;opacity:0.4}.calendar-day:focus{background: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:flex;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:flex;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:flex;border:none;background:var(--ion-color-step-300, #edeef0);color:var(--ion-text-color, #000);font-family:inherit;font-size:inherit;cursor:pointer;appearance:none}:host .time-body-active{color:var(--ion-color-base)}:host(.in-item){position:static}:host(.show-month-and-year) .calendar-action-buttons ion-item{--color:var(--ion-color-base)}:host{--background:var(--ion-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 .datetime-calendar .calendar-action-buttons ion-item{--padding-start:20px}:host .calendar-action-buttons ion-item,:host .calendar-action-buttons ion-button{--color:var(--ion-color-step-650, #595959)}: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, 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{color:var(--ion-color-contrast)}.calendar-day.calendar-day-active{border:1px solid var(--ion-color-base);background:var(--ion-color-base)}: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, #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:flex;align-items:center;justify-content:flex-end}";
231
233
 
232
234
  const Datetime = class {
233
- constructor(hostRef) {
234
- index$1.registerInstance(this, hostRef);
235
- this.ionCancel = index$1.createEvent(this, "ionCancel", 7);
236
- this.ionChange = index$1.createEvent(this, "ionChange", 7);
237
- this.ionValueChange = index$1.createEvent(this, "ionValueChange", 7);
238
- this.ionFocus = index$1.createEvent(this, "ionFocus", 7);
239
- this.ionBlur = index$1.createEvent(this, "ionBlur", 7);
240
- this.ionStyle = index$1.createEvent(this, "ionStyle", 7);
241
- this.ionRender = index$1.createEvent(this, "ionRender", 7);
242
- this.inputId = `ion-dt-${datetimeIds++}`;
243
- this.prevPresentation = null;
244
- this.warnIfIncorrectValueUsage = () => {
245
- const { multiple, value } = this;
246
- if (!multiple && Array.isArray(value)) {
247
- /**
248
- * We do some processing on the `value` array so
249
- * that it looks more like an array when logged to
250
- * the console.
251
- * Example given ['a', 'b']
252
- * Default toString() behavior: a,b
253
- * Custom behavior: ['a', 'b']
254
- */
255
- index.printIonWarning(`ion-datetime was passed an array of values, but multiple="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".
235
+ constructor(hostRef) {
236
+ index$1.registerInstance(this, hostRef);
237
+ this.ionCancel = index$1.createEvent(this, "ionCancel", 7);
238
+ this.ionChange = index$1.createEvent(this, "ionChange", 7);
239
+ this.ionValueChange = index$1.createEvent(this, "ionValueChange", 7);
240
+ this.ionFocus = index$1.createEvent(this, "ionFocus", 7);
241
+ this.ionBlur = index$1.createEvent(this, "ionBlur", 7);
242
+ this.ionStyle = index$1.createEvent(this, "ionStyle", 7);
243
+ this.ionRender = index$1.createEvent(this, "ionRender", 7);
244
+ this.inputId = `ion-dt-${datetimeIds++}`;
245
+ this.prevPresentation = null;
246
+ this.warnIfIncorrectValueUsage = () => {
247
+ const { multiple, value } = this;
248
+ if (!multiple && Array.isArray(value)) {
249
+ /**
250
+ * We do some processing on the `value` array so
251
+ * that it looks more like an array when logged to
252
+ * the console.
253
+ * Example given ['a', 'b']
254
+ * Default toString() behavior: a,b
255
+ * Custom behavior: ['a', 'b']
256
+ */
257
+ index.printIonWarning(`ion-datetime was passed an array of values, but multiple="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".
256
258
 
257
259
  Value Passed: [${value.map((v) => `'${v}'`).join(', ')}]
258
260
  `, this.el);
259
- }
260
- };
261
- this.setValue = (value) => {
262
- this.value = value;
263
- this.ionChange.emit({ value });
264
- };
265
- /**
266
- * Returns the DatetimePart interface
267
- * to use when rendering an initial set of
268
- * data. This should be used when rendering an
269
- * interface in an environment where the `value`
270
- * may not be set. This function works
271
- * by returning the first selected date and then
272
- * falling back to defaultParts if no active date
273
- * is selected.
274
- */
275
- this.getActivePartsWithFallback = () => {
276
- var _a;
277
- const { defaultParts } = this;
278
- return (_a = this.getActivePart()) !== null && _a !== void 0 ? _a : defaultParts;
279
- };
280
- this.getActivePart = () => {
281
- const { activeParts } = this;
282
- return Array.isArray(activeParts) ? activeParts[0] : activeParts;
283
- };
284
- this.closeParentOverlay = () => {
285
- const popoverOrModal = this.el.closest('ion-modal, ion-popover');
286
- if (popoverOrModal) {
287
- popoverOrModal.dismiss();
288
- }
289
- };
290
- this.setWorkingParts = (parts) => {
291
- this.workingParts = Object.assign({}, parts);
292
- };
293
- this.setActiveParts = (parts, removeDate = false) => {
294
- /** if the datetime component is in readonly mode,
295
- * allow browsing of the calendar without changing
296
- * the set value
297
- */
298
- if (this.readonly) {
299
- return;
300
- }
301
- const { multiple, minParts, maxParts, activeParts } = this;
302
- /**
303
- * When setting the active parts, it is possible
304
- * to set invalid data. For example,
305
- * when updating January 31 to February,
306
- * February 31 does not exist. As a result
307
- * we need to validate the active parts and
308
- * ensure that we are only setting valid dates.
309
- * Additionally, we need to update the working parts
310
- * too in the event that the validated parts are different.
311
- */
312
- const validatedParts = data.validateParts(parts, minParts, maxParts);
313
- this.setWorkingParts(validatedParts);
314
- if (multiple) {
315
- const activePartsArray = Array.isArray(activeParts) ? activeParts : [activeParts];
316
- if (removeDate) {
317
- this.activeParts = activePartsArray.filter((p) => !data.isSameDay(p, validatedParts));
318
- }
319
- else {
320
- this.activeParts = [...activePartsArray, validatedParts];
321
- }
322
- }
323
- else {
324
- this.activeParts = Object.assign({}, validatedParts);
325
- }
326
- const hasSlottedButtons = this.el.querySelector('[slot="buttons"]') !== null;
327
- if (hasSlottedButtons || this.showDefaultButtons) {
328
- return;
329
- }
330
- this.confirm();
331
- };
332
- this.initializeKeyboardListeners = () => {
333
- const calendarBodyRef = this.calendarBodyRef;
334
- if (!calendarBodyRef) {
335
- return;
336
- }
337
- const root = this.el.shadowRoot;
338
- /**
339
- * Get a reference to the month
340
- * element we are currently viewing.
341
- */
342
- const currentMonth = calendarBodyRef.querySelector('.calendar-month:nth-of-type(2)');
343
- /**
344
- * When focusing the calendar body, we want to pass focus
345
- * to the working day, but other days should
346
- * only be accessible using the arrow keys. Pressing
347
- * Tab should jump between bodies of selectable content.
348
- */
349
- const checkCalendarBodyFocus = (ev) => {
350
- var _a;
351
- const record = ev[0];
352
- /**
353
- * If calendar body was already focused
354
- * when this fired or if the calendar body
355
- * if not currently focused, we should not re-focus
356
- * the inner day.
357
- */
358
- if (((_a = record.oldValue) === null || _a === void 0 ? void 0 : _a.includes('ion-focused')) || !calendarBodyRef.classList.contains('ion-focused')) {
359
- return;
360
- }
361
- this.focusWorkingDay(currentMonth);
362
- };
363
- const mo = new MutationObserver(checkCalendarBodyFocus);
364
- mo.observe(calendarBodyRef, { attributeFilter: ['class'], attributeOldValue: true });
365
- this.destroyKeyboardMO = () => {
366
- mo === null || mo === void 0 ? void 0 : mo.disconnect();
367
- };
368
- /**
369
- * We must use keydown not keyup as we want
370
- * to prevent scrolling when using the arrow keys.
371
- */
372
- calendarBodyRef.addEventListener('keydown', (ev) => {
373
- const activeElement = root.activeElement;
374
- if (!activeElement || !activeElement.classList.contains('calendar-day')) {
375
- return;
376
- }
377
- const parts = data.getPartsFromCalendarDay(activeElement);
378
- let partsToFocus;
379
- switch (ev.key) {
380
- case 'ArrowDown':
381
- ev.preventDefault();
382
- partsToFocus = data.getNextWeek(parts);
383
- break;
384
- case 'ArrowUp':
385
- ev.preventDefault();
386
- partsToFocus = data.getPreviousWeek(parts);
387
- break;
388
- case 'ArrowRight':
389
- ev.preventDefault();
390
- partsToFocus = data.getNextDay(parts);
391
- break;
392
- case 'ArrowLeft':
393
- ev.preventDefault();
394
- partsToFocus = data.getPreviousDay(parts);
395
- break;
396
- case 'Home':
397
- ev.preventDefault();
398
- partsToFocus = data.getStartOfWeek(parts);
399
- break;
400
- case 'End':
401
- ev.preventDefault();
402
- partsToFocus = data.getEndOfWeek(parts);
403
- break;
404
- case 'PageUp':
405
- ev.preventDefault();
406
- partsToFocus = ev.shiftKey ? data.getPreviousYear(parts) : data.getPreviousMonth(parts);
407
- break;
408
- case 'PageDown':
409
- ev.preventDefault();
410
- partsToFocus = ev.shiftKey ? data.getNextYear(parts) : data.getNextMonth(parts);
411
- break;
412
- /**
413
- * Do not preventDefault here
414
- * as we do not want to override other
415
- * browser defaults such as pressing Enter/Space
416
- * to select a day.
417
- */
418
- default:
419
- return;
420
- }
421
- /**
422
- * If the day we want to move focus to is
423
- * disabled, do not do anything.
424
- */
425
- if (isDayDisabled(partsToFocus, this.minParts, this.maxParts)) {
426
- return;
427
- }
428
- this.setWorkingParts(Object.assign(Object.assign({}, this.workingParts), partsToFocus));
429
- /**
430
- * Give view a chance to re-render
431
- * then move focus to the new working day
432
- */
433
- requestAnimationFrame(() => this.focusWorkingDay(currentMonth));
434
- });
435
- };
436
- this.focusWorkingDay = (currentMonth) => {
437
- /**
438
- * Get the number of padding days so
439
- * we know how much to offset our next selector by
440
- * to grab the correct calendar-day element.
441
- */
442
- const padding = currentMonth.querySelectorAll('.calendar-day-padding');
443
- const { day } = this.workingParts;
444
- if (day === null) {
445
- return;
446
- }
447
- /**
448
- * Get the calendar day element
449
- * and focus it.
450
- */
451
- const dayEl = currentMonth.querySelector(`.calendar-day-wrapper:nth-of-type(${padding.length + day}) .calendar-day`);
452
- if (dayEl) {
453
- dayEl.focus();
454
- }
455
- };
456
- this.processMinParts = () => {
457
- const { min, defaultParts } = this;
458
- if (min === undefined) {
459
- this.minParts = undefined;
460
- return;
461
- }
462
- this.minParts = data.parseMinParts(min, defaultParts);
463
- };
464
- this.processMaxParts = () => {
465
- const { max, defaultParts } = this;
466
- if (max === undefined) {
467
- this.maxParts = undefined;
468
- return;
469
- }
470
- this.maxParts = data.parseMaxParts(max, defaultParts);
471
- };
472
- this.initializeCalendarListener = () => {
473
- const calendarBodyRef = this.calendarBodyRef;
474
- if (!calendarBodyRef) {
475
- return;
476
- }
477
- /**
478
- * For performance reasons, we only render 3
479
- * months at a time: The current month, the previous
480
- * month, and the next month. We have a scroll listener
481
- * on the calendar body to append/prepend new months.
482
- *
483
- * We can do this because Stencil is smart enough to not
484
- * re-create the .calendar-month containers, but rather
485
- * update the content within those containers.
486
- *
487
- * As an added bonus, WebKit has some troubles with
488
- * scroll-snap-stop: always, so not rendering all of
489
- * the months in a row allows us to mostly sidestep
490
- * that issue.
491
- */
492
- const months = calendarBodyRef.querySelectorAll('.calendar-month');
493
- const startMonth = months[0];
494
- const workingMonth = months[1];
495
- const endMonth = months[2];
496
- const mode = ionicGlobal.getIonMode(this);
497
- const needsiOSRubberBandFix = mode === 'ios' && typeof navigator !== 'undefined' && navigator.maxTouchPoints > 1;
498
- /**
499
- * Before setting up the scroll listener,
500
- * scroll the middle month into view.
501
- * scrollIntoView() will scroll entire page
502
- * if element is not in viewport. Use scrollLeft instead.
503
- */
504
- index$1.writeTask(() => {
505
- calendarBodyRef.scrollLeft = startMonth.clientWidth * (dir.isRTL(this.el) ? -1 : 1);
506
- const getChangedMonth = (parts) => {
507
- const box = calendarBodyRef.getBoundingClientRect();
508
- /**
509
- * If the current scroll position is all the way to the left
510
- * then we have scrolled to the previous month.
511
- * Otherwise, assume that we have scrolled to the next
512
- * month. We have a tolerance of 2px to account for
513
- * sub pixel rendering.
514
- *
515
- * Check below the next line ensures that we did not
516
- * swipe and abort (i.e. we swiped but we are still on the current month).
517
- */
518
- const month = calendarBodyRef.scrollLeft <= 2 ? startMonth : endMonth;
519
- /**
520
- * The edge of the month must be lined up with
521
- * the edge of the calendar body in order for
522
- * the component to update. Otherwise, it
523
- * may be the case that the user has paused their
524
- * swipe or the browser has not finished snapping yet.
525
- * Rather than check if the x values are equal,
526
- * we give it a tolerance of 2px to account for
527
- * sub pixel rendering.
528
- */
529
- const monthBox = month.getBoundingClientRect();
530
- if (Math.abs(monthBox.x - box.x) > 2)
531
- return;
532
- /**
533
- * If we're force-rendering a month, assume we've
534
- * scrolled to that and return it.
535
- *
536
- * If forceRenderDate is ever used in a context where the
537
- * forced month is not immediately auto-scrolled to, this
538
- * should be updated to also check whether `month` has the
539
- * same month and year as the forced date.
540
- */
541
- const { forceRenderDate } = this;
542
- if (forceRenderDate !== undefined) {
543
- return { month: forceRenderDate.month, year: forceRenderDate.year, day: forceRenderDate.day };
544
- }
545
- /**
546
- * From here, we can determine if the start
547
- * month or the end month was scrolled into view.
548
- * If no month was changed, then we can return from
549
- * the scroll callback early.
550
- */
551
- if (month === startMonth) {
552
- return data.getPreviousMonth(parts);
553
- }
554
- else if (month === endMonth) {
555
- return data.getNextMonth(parts);
556
- }
557
- else {
558
- return;
559
- }
560
- };
561
- const updateActiveMonth = () => {
562
- if (needsiOSRubberBandFix) {
563
- calendarBodyRef.style.removeProperty('pointer-events');
564
- appliediOSRubberBandFix = false;
565
- }
566
- /**
567
- * If the month did not change
568
- * then we can return early.
569
- */
570
- const newDate = getChangedMonth(this.workingParts);
571
- if (!newDate)
572
- return;
573
- const { month, day, year } = newDate;
574
- if (isMonthDisabled({ month, year, day: null }, {
575
- minParts: Object.assign(Object.assign({}, this.minParts), { day: null }),
576
- maxParts: Object.assign(Object.assign({}, this.maxParts), { day: null }),
577
- })) {
578
- return;
579
- }
580
- /**
581
- * Prevent scrolling for other browsers
582
- * to give the DOM time to update and the container
583
- * time to properly snap.
584
- */
585
- calendarBodyRef.style.setProperty('overflow', 'hidden');
586
- /**
587
- * Use a writeTask here to ensure
588
- * that the state is updated and the
589
- * correct month is scrolled into view
590
- * in the same frame. This is not
591
- * typically a problem on newer devices
592
- * but older/slower device may have a flicker
593
- * if we did not do this.
594
- */
595
- index$1.writeTask(() => {
596
- this.setWorkingParts(Object.assign(Object.assign({}, this.workingParts), { month, day: day, year }));
597
- calendarBodyRef.scrollLeft = workingMonth.clientWidth * (dir.isRTL(this.el) ? -1 : 1);
598
- calendarBodyRef.style.removeProperty('overflow');
599
- if (this.resolveForceDateScrolling) {
600
- this.resolveForceDateScrolling();
601
- }
602
- });
603
- };
604
- /**
605
- * When the container finishes scrolling we
606
- * need to update the DOM with the selected month.
607
- */
608
- let scrollTimeout;
609
- /**
610
- * We do not want to attempt to set pointer-events
611
- * multiple times within a single swipe gesture as
612
- * that adds unnecessary work to the main thread.
613
- */
614
- let appliediOSRubberBandFix = false;
615
- const scrollCallback = () => {
616
- if (scrollTimeout) {
617
- clearTimeout(scrollTimeout);
618
- }
619
- /**
620
- * On iOS it is possible to quickly rubber band
621
- * the scroll area before the scroll timeout has fired.
622
- * This results in users reaching the end of the scrollable
623
- * container before the DOM has updated.
624
- * By setting `pointer-events: none` we can ensure that
625
- * subsequent swipes do not happen while the container
626
- * is snapping.
627
- */
628
- if (!appliediOSRubberBandFix && needsiOSRubberBandFix) {
629
- calendarBodyRef.style.setProperty('pointer-events', 'none');
630
- appliediOSRubberBandFix = true;
631
- }
632
- // Wait ~3 frames
633
- scrollTimeout = setTimeout(updateActiveMonth, 50);
634
- };
635
- calendarBodyRef.addEventListener('scroll', scrollCallback);
636
- this.destroyCalendarListener = () => {
637
- calendarBodyRef.removeEventListener('scroll', scrollCallback);
638
- };
639
- });
640
- };
641
- /**
642
- * Clean up all listeners except for the overlay
643
- * listener. This is so that we can re-create the listeners
644
- * if the datetime has been hidden/presented by a modal or popover.
645
- */
646
- this.destroyInteractionListeners = () => {
647
- const { destroyCalendarListener, destroyKeyboardMO } = this;
648
- if (destroyCalendarListener !== undefined) {
649
- destroyCalendarListener();
650
- }
651
- if (destroyKeyboardMO !== undefined) {
652
- destroyKeyboardMO();
653
- }
654
- };
655
- this.processValue = (value) => {
656
- const hasValue = value !== null && value !== undefined && (!Array.isArray(value) || value.length > 0);
657
- const valueToProcess = hasValue ? data.parseDate(value) : this.defaultParts;
658
- const { minParts, maxParts, workingParts, el } = this;
659
- this.warnIfIncorrectValueUsage();
660
- /**
661
- * Return early if the value wasn't parsed correctly, such as
662
- * if an improperly formatted date string was provided.
663
- */
664
- if (!valueToProcess) {
665
- return;
666
- }
667
- /**
668
- * Datetime should only warn of out of bounds values
669
- * if set by the user. If the `value` is undefined,
670
- * we will default to today's date which may be out
671
- * of bounds. In this case, the warning makes it look
672
- * like the developer did something wrong which is
673
- * not true.
674
- */
675
- if (hasValue) {
676
- data.warnIfValueOutOfBounds(valueToProcess, minParts, maxParts);
677
- }
678
- /**
679
- * If there are multiple values, pick an arbitrary one to clamp to. This way,
680
- * if the values are across months, we always show at least one of them. Note
681
- * that the values don't necessarily have to be in order.
682
- */
683
- const singleValue = Array.isArray(valueToProcess) ? valueToProcess[0] : valueToProcess;
684
- const targetValue = data.clampDate(singleValue, minParts, maxParts);
685
- const { month, day, year, hour, minute } = targetValue;
686
- const ampm = data.parseAmPm(hour);
687
- /**
688
- * Since `activeParts` indicates a value that
689
- * been explicitly selected either by the
690
- * user or the app, only update `activeParts`
691
- * if the `value` property is set.
692
- */
693
- if (hasValue) {
694
- if (Array.isArray(valueToProcess)) {
695
- this.activeParts = [...valueToProcess];
696
- }
697
- else {
698
- this.activeParts = {
699
- month,
700
- day,
701
- year,
702
- hour,
703
- minute,
704
- ampm,
705
- };
706
- }
707
- }
708
- else {
709
- /**
710
- * Reset the active parts if the value is not set.
711
- * This will clear the selected calendar day when
712
- * performing a clear action or using the reset() method.
713
- */
714
- this.activeParts = [];
715
- }
716
- /**
717
- * Only animate if:
718
- * 1. We're using grid style (wheel style pickers should just jump to new value)
719
- * 2. The month and/or year actually changed, and both are defined (otherwise there's nothing to animate to)
720
- * 3. The calendar body is visible (prevents animation when in collapsed datetime-button, for example)
721
- * 4. The month/year picker is not open (since you wouldn't see the animation anyway)
722
- */
723
- const didChangeMonth = (month !== undefined && month !== workingParts.month) || (year !== undefined && year !== workingParts.year);
724
- const bodyIsVisible = el.classList.contains('datetime-ready');
725
- const { isGridStyle, showMonthAndYear } = this;
726
- let areAllSelectedDatesInSameMonth = true;
727
- if (Array.isArray(valueToProcess)) {
728
- const firstMonth = valueToProcess[0].month;
729
- for (const date of valueToProcess) {
730
- if (date.month !== firstMonth) {
731
- areAllSelectedDatesInSameMonth = false;
732
- break;
733
- }
734
- }
735
- }
736
- /**
737
- * If there is more than one date selected
738
- * and the dates aren't all in the same month,
739
- * then we should neither animate to the date
740
- * nor update the working parts because we do
741
- * not know which date the user wants to view.
742
- */
743
- if (areAllSelectedDatesInSameMonth) {
744
- if (isGridStyle && didChangeMonth && bodyIsVisible && !showMonthAndYear) {
745
- this.animateToDate(targetValue);
746
- }
747
- else {
748
- /**
749
- * We only need to do this if we didn't just animate to a new month,
750
- * since that calls prevMonth/nextMonth which calls setWorkingParts for us.
751
- */
752
- this.setWorkingParts({
753
- month,
754
- day,
755
- year,
756
- hour,
757
- minute,
758
- ampm,
759
- });
760
- }
761
- }
762
- };
763
- this.animateToDate = async (targetValue) => {
764
- const { workingParts } = this;
765
- /**
766
- * Tell other render functions that we need to force the
767
- * target month to appear in place of the actual next/prev month.
768
- * Because this is a State variable, a rerender will be triggered
769
- * automatically, updating the rendered months.
770
- */
771
- this.forceRenderDate = targetValue;
772
- /**
773
- * Flag that we've started scrolling to the forced date.
774
- * The resolve function will be called by the datetime's
775
- * scroll listener when it's done updating everything.
776
- * This is a replacement for making prev/nextMonth async,
777
- * since the logic we're waiting on is in a listener.
778
- */
779
- const forceDateScrollingPromise = new Promise((resolve) => {
780
- this.resolveForceDateScrolling = resolve;
781
- });
782
- /**
783
- * Animate smoothly to the forced month. This will also update
784
- * workingParts and correct the surrounding months for us.
785
- */
786
- const targetMonthIsBefore = data.isBefore(targetValue, workingParts);
787
- targetMonthIsBefore ? this.prevMonth() : this.nextMonth();
788
- await forceDateScrollingPromise;
789
- this.resolveForceDateScrolling = undefined;
790
- this.forceRenderDate = undefined;
791
- };
792
- this.onFocus = () => {
793
- this.ionFocus.emit();
794
- };
795
- this.onBlur = () => {
796
- this.ionBlur.emit();
797
- };
798
- this.hasValue = () => {
799
- return this.value != null;
800
- };
801
- this.nextMonth = () => {
802
- const calendarBodyRef = this.calendarBodyRef;
803
- if (!calendarBodyRef) {
804
- return;
805
- }
806
- const nextMonth = calendarBodyRef.querySelector('.calendar-month:last-of-type');
807
- if (!nextMonth) {
808
- return;
809
- }
810
- const left = nextMonth.offsetWidth * 2;
811
- calendarBodyRef.scrollTo({
812
- top: 0,
813
- left: left * (dir.isRTL(this.el) ? -1 : 1),
814
- behavior: 'smooth',
815
- });
816
- };
817
- this.prevMonth = () => {
818
- const calendarBodyRef = this.calendarBodyRef;
819
- if (!calendarBodyRef) {
820
- return;
821
- }
822
- const prevMonth = calendarBodyRef.querySelector('.calendar-month:first-of-type');
823
- if (!prevMonth) {
824
- return;
825
- }
826
- calendarBodyRef.scrollTo({
827
- top: 0,
828
- left: 0,
829
- behavior: 'smooth',
830
- });
831
- };
832
- this.toggleMonthAndYearView = () => {
833
- this.showMonthAndYear = !this.showMonthAndYear;
834
- };
835
- this.showMonthAndYear = false;
836
- this.activeParts = [];
837
- this.workingParts = {
838
- month: 5,
839
- day: 28,
840
- year: 2021,
841
- hour: 13,
842
- minute: 52,
843
- ampm: 'pm',
844
- };
845
- this.isTimePopoverOpen = false;
846
- this.forceRenderDate = undefined;
847
- this.color = 'primary';
848
- this.name = this.inputId;
849
- this.disabled = false;
850
- this.formatOptions = undefined;
851
- this.readonly = false;
852
- this.isDateEnabled = undefined;
853
- this.min = undefined;
854
- this.max = undefined;
855
- this.presentation = 'date-time';
856
- this.cancelText = 'Cancel';
857
- this.doneText = 'Done';
858
- this.clearText = 'Clear';
859
- this.yearValues = undefined;
860
- this.monthValues = undefined;
861
- this.dayValues = undefined;
862
- this.hourValues = undefined;
863
- this.minuteValues = undefined;
864
- this.locale = 'default';
865
- this.firstDayOfWeek = 0;
866
- this.titleSelectedDatesFormatter = undefined;
867
- this.multiple = false;
868
- this.highlightedDates = undefined;
869
- this.value = undefined;
870
- this.showDefaultTitle = false;
871
- this.showDefaultButtons = false;
872
- this.showClearButton = false;
873
- this.showDefaultTimeLabel = true;
874
- this.hourCycle = undefined;
875
- this.size = 'fixed';
876
- this.preferWheel = false;
877
- }
878
- formatOptionsChanged() {
879
- const { el, formatOptions, presentation } = this;
880
- checkForPresentationFormatMismatch(el, presentation, formatOptions);
881
- warnIfTimeZoneProvided(el, formatOptions);
882
- }
883
- disabledChanged() {
884
- this.emitStyle();
885
- }
886
- minChanged() {
887
- this.processMinParts();
888
- }
889
- maxChanged() {
890
- this.processMaxParts();
891
- }
892
- presentationChanged() {
893
- const { el, formatOptions, presentation } = this;
894
- checkForPresentationFormatMismatch(el, presentation, formatOptions);
895
- }
896
- get isGridStyle() {
897
- const { presentation, preferWheel } = this;
898
- const hasDatePresentation = presentation === 'date' || presentation === 'date-time' || presentation === 'time-date';
899
- return hasDatePresentation && !preferWheel;
900
- }
901
- yearValuesChanged() {
902
- this.parsedYearValues = data.convertToArrayOfNumbers(this.yearValues);
903
- }
904
- monthValuesChanged() {
905
- this.parsedMonthValues = data.convertToArrayOfNumbers(this.monthValues);
906
- }
907
- dayValuesChanged() {
908
- this.parsedDayValues = data.convertToArrayOfNumbers(this.dayValues);
909
- }
910
- hourValuesChanged() {
911
- this.parsedHourValues = data.convertToArrayOfNumbers(this.hourValues);
912
- }
913
- minuteValuesChanged() {
914
- this.parsedMinuteValues = data.convertToArrayOfNumbers(this.minuteValues);
915
- }
261
+ }
262
+ };
263
+ this.setValue = (value) => {
264
+ this.value = value;
265
+ this.ionChange.emit({ value });
266
+ };
916
267
  /**
917
- * Update the datetime value when the value changes
268
+ * Returns the DatetimePart interface
269
+ * to use when rendering an initial set of
270
+ * data. This should be used when rendering an
271
+ * interface in an environment where the `value`
272
+ * may not be set. This function works
273
+ * by returning the first selected date and then
274
+ * falling back to defaultParts if no active date
275
+ * is selected.
918
276
  */
919
- async valueChanged() {
920
- const { value } = this;
921
- if (this.hasValue()) {
922
- this.processValue(value);
277
+ this.getActivePartsWithFallback = () => {
278
+ var _a;
279
+ const { defaultParts } = this;
280
+ return (_a = this.getActivePart()) !== null && _a !== void 0 ? _a : defaultParts;
281
+ };
282
+ this.getActivePart = () => {
283
+ const { activeParts } = this;
284
+ return Array.isArray(activeParts) ? activeParts[0] : activeParts;
285
+ };
286
+ this.closeParentOverlay = () => {
287
+ const popoverOrModal = this.el.closest('ion-modal, ion-popover');
288
+ if (popoverOrModal) {
289
+ popoverOrModal.dismiss();
290
+ }
291
+ };
292
+ this.setWorkingParts = (parts) => {
293
+ this.workingParts = Object.assign({}, parts);
294
+ };
295
+ this.setActiveParts = (parts, removeDate = false) => {
296
+ /** if the datetime component is in readonly mode,
297
+ * allow browsing of the calendar without changing
298
+ * the set value
299
+ */
300
+ if (this.readonly) {
301
+ return;
302
+ }
303
+ const { multiple, minParts, maxParts, activeParts } = this;
304
+ /**
305
+ * When setting the active parts, it is possible
306
+ * to set invalid data. For example,
307
+ * when updating January 31 to February,
308
+ * February 31 does not exist. As a result
309
+ * we need to validate the active parts and
310
+ * ensure that we are only setting valid dates.
311
+ * Additionally, we need to update the working parts
312
+ * too in the event that the validated parts are different.
313
+ */
314
+ const validatedParts = data.validateParts(parts, minParts, maxParts);
315
+ this.setWorkingParts(validatedParts);
316
+ if (multiple) {
317
+ const activePartsArray = Array.isArray(activeParts) ? activeParts : [activeParts];
318
+ if (removeDate) {
319
+ this.activeParts = activePartsArray.filter((p) => !data.isSameDay(p, validatedParts));
923
320
  }
924
- this.emitStyle();
925
- this.ionValueChange.emit({ value });
926
- }
927
- /**
928
- * Confirms the selected datetime value, updates the
929
- * `value` property, and optionally closes the popover
930
- * or modal that the datetime was presented in.
931
- */
932
- async confirm(closeOverlay = false) {
933
- const { isCalendarPicker, activeParts, preferWheel, workingParts } = this;
321
+ else {
322
+ this.activeParts = [...activePartsArray, validatedParts];
323
+ }
324
+ }
325
+ else {
326
+ this.activeParts = Object.assign({}, validatedParts);
327
+ }
328
+ const hasSlottedButtons = this.el.querySelector('[slot="buttons"]') !== null;
329
+ if (hasSlottedButtons || this.showDefaultButtons) {
330
+ return;
331
+ }
332
+ this.confirm();
333
+ };
334
+ this.initializeKeyboardListeners = () => {
335
+ const calendarBodyRef = this.calendarBodyRef;
336
+ if (!calendarBodyRef) {
337
+ return;
338
+ }
339
+ const root = this.el.shadowRoot;
340
+ /**
341
+ * Get a reference to the month
342
+ * element we are currently viewing.
343
+ */
344
+ const currentMonth = calendarBodyRef.querySelector('.calendar-month:nth-of-type(2)');
345
+ /**
346
+ * When focusing the calendar body, we want to pass focus
347
+ * to the working day, but other days should
348
+ * only be accessible using the arrow keys. Pressing
349
+ * Tab should jump between bodies of selectable content.
350
+ */
351
+ const checkCalendarBodyFocus = (ev) => {
352
+ var _a;
353
+ const record = ev[0];
934
354
  /**
935
- * We only update the value if the presentation is not a calendar picker.
355
+ * If calendar body was already focused
356
+ * when this fired or if the calendar body
357
+ * if not currently focused, we should not re-focus
358
+ * the inner day.
936
359
  */
937
- if (activeParts !== undefined || !isCalendarPicker) {
938
- const activePartsIsArray = Array.isArray(activeParts);
939
- if (activePartsIsArray && activeParts.length === 0) {
940
- if (preferWheel) {
941
- /**
942
- * If the datetime is using a wheel picker, but the
943
- * active parts are empty, then the user has confirmed the
944
- * initial value (working parts) presented to them.
945
- */
946
- this.setValue(data.convertDataToISO(workingParts));
947
- }
948
- else {
949
- this.setValue(undefined);
950
- }
951
- }
952
- else {
953
- this.setValue(data.convertDataToISO(activeParts));
954
- }
360
+ if (((_a = record.oldValue) === null || _a === void 0 ? void 0 : _a.includes('ion-focused')) || !calendarBodyRef.classList.contains('ion-focused')) {
361
+ return;
955
362
  }
956
- if (closeOverlay) {
957
- this.closeParentOverlay();
363
+ this.focusWorkingDay(currentMonth);
364
+ };
365
+ const mo = new MutationObserver(checkCalendarBodyFocus);
366
+ mo.observe(calendarBodyRef, { attributeFilter: ['class'], attributeOldValue: true });
367
+ this.destroyKeyboardMO = () => {
368
+ mo === null || mo === void 0 ? void 0 : mo.disconnect();
369
+ };
370
+ /**
371
+ * We must use keydown not keyup as we want
372
+ * to prevent scrolling when using the arrow keys.
373
+ */
374
+ calendarBodyRef.addEventListener('keydown', (ev) => {
375
+ const activeElement = root.activeElement;
376
+ if (!activeElement || !activeElement.classList.contains('calendar-day')) {
377
+ return;
958
378
  }
959
- }
960
- /**
961
- * Resets the internal state of the datetime but does not update the value.
962
- * Passing a valid ISO-8601 string will reset the state of the component to the provided date.
963
- * If no value is provided, the internal state will be reset to the clamped value of the min, max and today.
964
- */
965
- async reset(startDate) {
966
- this.processValue(startDate);
967
- }
968
- /**
969
- * Emits the ionCancel event and
970
- * optionally closes the popover
971
- * or modal that the datetime was
972
- * presented in.
973
- */
974
- async cancel(closeOverlay = false) {
975
- this.ionCancel.emit();
976
- if (closeOverlay) {
977
- this.closeParentOverlay();
379
+ const parts = data.getPartsFromCalendarDay(activeElement);
380
+ let partsToFocus;
381
+ switch (ev.key) {
382
+ case 'ArrowDown':
383
+ ev.preventDefault();
384
+ partsToFocus = data.getNextWeek(parts);
385
+ break;
386
+ case 'ArrowUp':
387
+ ev.preventDefault();
388
+ partsToFocus = data.getPreviousWeek(parts);
389
+ break;
390
+ case 'ArrowRight':
391
+ ev.preventDefault();
392
+ partsToFocus = data.getNextDay(parts);
393
+ break;
394
+ case 'ArrowLeft':
395
+ ev.preventDefault();
396
+ partsToFocus = data.getPreviousDay(parts);
397
+ break;
398
+ case 'Home':
399
+ ev.preventDefault();
400
+ partsToFocus = data.getStartOfWeek(parts);
401
+ break;
402
+ case 'End':
403
+ ev.preventDefault();
404
+ partsToFocus = data.getEndOfWeek(parts);
405
+ break;
406
+ case 'PageUp':
407
+ ev.preventDefault();
408
+ partsToFocus = ev.shiftKey ? data.getPreviousYear(parts) : data.getPreviousMonth(parts);
409
+ break;
410
+ case 'PageDown':
411
+ ev.preventDefault();
412
+ partsToFocus = ev.shiftKey ? data.getNextYear(parts) : data.getNextMonth(parts);
413
+ break;
414
+ /**
415
+ * Do not preventDefault here
416
+ * as we do not want to override other
417
+ * browser defaults such as pressing Enter/Space
418
+ * to select a day.
419
+ */
420
+ default:
421
+ return;
978
422
  }
979
- }
980
- get isCalendarPicker() {
981
- const { presentation } = this;
982
- return presentation === 'date' || presentation === 'date-time' || presentation === 'time-date';
983
- }
984
- connectedCallback() {
985
- this.clearFocusVisible = focusVisible.startFocusVisible(this.el).destroy;
986
- }
987
- disconnectedCallback() {
988
- if (this.clearFocusVisible) {
989
- this.clearFocusVisible();
990
- this.clearFocusVisible = undefined;
423
+ /**
424
+ * If the day we want to move focus to is
425
+ * disabled, do not do anything.
426
+ */
427
+ if (isDayDisabled(partsToFocus, this.minParts, this.maxParts)) {
428
+ return;
991
429
  }
992
- }
993
- initializeListeners() {
994
- this.initializeCalendarListener();
995
- this.initializeKeyboardListeners();
996
- }
997
- componentDidLoad() {
998
- const { el, intersectionTrackerRef } = this;
430
+ this.setWorkingParts(Object.assign(Object.assign({}, this.workingParts), partsToFocus));
999
431
  /**
1000
- * If a scrollable element is hidden using `display: none`,
1001
- * it will not have a scroll height meaning we cannot scroll elements
1002
- * into view. As a result, we will need to wait for the datetime to become
1003
- * visible if used inside of a modal or a popover otherwise the scrollable
1004
- * areas will not have the correct values snapped into place.
432
+ * Give view a chance to re-render
433
+ * then move focus to the new working day
1005
434
  */
1006
- const visibleCallback = (entries) => {
1007
- const ev = entries[0];
1008
- if (!ev.isIntersecting) {
1009
- return;
435
+ requestAnimationFrame(() => this.focusWorkingDay(currentMonth));
436
+ });
437
+ };
438
+ this.focusWorkingDay = (currentMonth) => {
439
+ /**
440
+ * Get the number of padding days so
441
+ * we know how much to offset our next selector by
442
+ * to grab the correct calendar-day element.
443
+ */
444
+ const padding = currentMonth.querySelectorAll('.calendar-day-padding');
445
+ const { day } = this.workingParts;
446
+ if (day === null) {
447
+ return;
448
+ }
449
+ /**
450
+ * Get the calendar day element
451
+ * and focus it.
452
+ */
453
+ const dayEl = currentMonth.querySelector(`.calendar-day-wrapper:nth-of-type(${padding.length + day}) .calendar-day`);
454
+ if (dayEl) {
455
+ dayEl.focus();
456
+ }
457
+ };
458
+ this.processMinParts = () => {
459
+ const { min, defaultParts } = this;
460
+ if (min === undefined) {
461
+ this.minParts = undefined;
462
+ return;
463
+ }
464
+ this.minParts = data.parseMinParts(min, defaultParts);
465
+ };
466
+ this.processMaxParts = () => {
467
+ const { max, defaultParts } = this;
468
+ if (max === undefined) {
469
+ this.maxParts = undefined;
470
+ return;
471
+ }
472
+ this.maxParts = data.parseMaxParts(max, defaultParts);
473
+ };
474
+ this.initializeCalendarListener = () => {
475
+ const calendarBodyRef = this.calendarBodyRef;
476
+ if (!calendarBodyRef) {
477
+ return;
478
+ }
479
+ /**
480
+ * For performance reasons, we only render 3
481
+ * months at a time: The current month, the previous
482
+ * month, and the next month. We have a scroll listener
483
+ * on the calendar body to append/prepend new months.
484
+ *
485
+ * We can do this because Stencil is smart enough to not
486
+ * re-create the .calendar-month containers, but rather
487
+ * update the content within those containers.
488
+ *
489
+ * As an added bonus, WebKit has some troubles with
490
+ * scroll-snap-stop: always, so not rendering all of
491
+ * the months in a row allows us to mostly sidestep
492
+ * that issue.
493
+ */
494
+ const months = calendarBodyRef.querySelectorAll('.calendar-month');
495
+ const startMonth = months[0];
496
+ const workingMonth = months[1];
497
+ const endMonth = months[2];
498
+ const mode = ionicGlobal.getIonMode(this);
499
+ const needsiOSRubberBandFix = mode === 'ios' && typeof navigator !== 'undefined' && navigator.maxTouchPoints > 1;
500
+ /**
501
+ * Before setting up the scroll listener,
502
+ * scroll the middle month into view.
503
+ * scrollIntoView() will scroll entire page
504
+ * if element is not in viewport. Use scrollLeft instead.
505
+ */
506
+ index$1.writeTask(() => {
507
+ calendarBodyRef.scrollLeft = startMonth.clientWidth * (dir.isRTL(this.el) ? -1 : 1);
508
+ const getChangedMonth = (parts) => {
509
+ const box = calendarBodyRef.getBoundingClientRect();
510
+ /**
511
+ * If the current scroll position is all the way to the left
512
+ * then we have scrolled to the previous month.
513
+ * Otherwise, assume that we have scrolled to the next
514
+ * month. We have a tolerance of 2px to account for
515
+ * sub pixel rendering.
516
+ *
517
+ * Check below the next line ensures that we did not
518
+ * swipe and abort (i.e. we swiped but we are still on the current month).
519
+ */
520
+ const month = calendarBodyRef.scrollLeft <= 2 ? startMonth : endMonth;
521
+ /**
522
+ * The edge of the month must be lined up with
523
+ * the edge of the calendar body in order for
524
+ * the component to update. Otherwise, it
525
+ * may be the case that the user has paused their
526
+ * swipe or the browser has not finished snapping yet.
527
+ * Rather than check if the x values are equal,
528
+ * we give it a tolerance of 2px to account for
529
+ * sub pixel rendering.
530
+ */
531
+ const monthBox = month.getBoundingClientRect();
532
+ if (Math.abs(monthBox.x - box.x) > 2)
533
+ return;
534
+ /**
535
+ * If we're force-rendering a month, assume we've
536
+ * scrolled to that and return it.
537
+ *
538
+ * If forceRenderDate is ever used in a context where the
539
+ * forced month is not immediately auto-scrolled to, this
540
+ * should be updated to also check whether `month` has the
541
+ * same month and year as the forced date.
542
+ */
543
+ const { forceRenderDate } = this;
544
+ if (forceRenderDate !== undefined) {
545
+ return { month: forceRenderDate.month, year: forceRenderDate.year, day: forceRenderDate.day };
546
+ }
547
+ /**
548
+ * From here, we can determine if the start
549
+ * month or the end month was scrolled into view.
550
+ * If no month was changed, then we can return from
551
+ * the scroll callback early.
552
+ */
553
+ if (month === startMonth) {
554
+ return data.getPreviousMonth(parts);
555
+ }
556
+ else if (month === endMonth) {
557
+ return data.getNextMonth(parts);
558
+ }
559
+ else {
560
+ return;
561
+ }
562
+ };
563
+ const updateActiveMonth = () => {
564
+ if (needsiOSRubberBandFix) {
565
+ calendarBodyRef.style.removeProperty('pointer-events');
566
+ appliediOSRubberBandFix = false;
567
+ }
568
+ /**
569
+ * If the month did not change
570
+ * then we can return early.
571
+ */
572
+ const newDate = getChangedMonth(this.workingParts);
573
+ if (!newDate)
574
+ return;
575
+ const { month, day, year } = newDate;
576
+ if (isMonthDisabled({ month, year, day: null }, {
577
+ minParts: Object.assign(Object.assign({}, this.minParts), { day: null }),
578
+ maxParts: Object.assign(Object.assign({}, this.maxParts), { day: null }),
579
+ })) {
580
+ return;
581
+ }
582
+ /**
583
+ * Prevent scrolling for other browsers
584
+ * to give the DOM time to update and the container
585
+ * time to properly snap.
586
+ */
587
+ calendarBodyRef.style.setProperty('overflow', 'hidden');
588
+ /**
589
+ * Use a writeTask here to ensure
590
+ * that the state is updated and the
591
+ * correct month is scrolled into view
592
+ * in the same frame. This is not
593
+ * typically a problem on newer devices
594
+ * but older/slower device may have a flicker
595
+ * if we did not do this.
596
+ */
597
+ index$1.writeTask(() => {
598
+ this.setWorkingParts(Object.assign(Object.assign({}, this.workingParts), { month, day: day, year }));
599
+ calendarBodyRef.scrollLeft = workingMonth.clientWidth * (dir.isRTL(this.el) ? -1 : 1);
600
+ calendarBodyRef.style.removeProperty('overflow');
601
+ if (this.resolveForceDateScrolling) {
602
+ this.resolveForceDateScrolling();
1010
603
  }
1011
- this.initializeListeners();
1012
- /**
1013
- * TODO FW-2793: Datetime needs a frame to ensure that it
1014
- * can properly scroll contents into view. As a result
1015
- * we hide the scrollable content until after that frame
1016
- * so users do not see the content quickly shifting. The downside
1017
- * is that the content will pop into view a frame after. Maybe there
1018
- * is a better way to handle this?
1019
- */
1020
- index$1.writeTask(() => {
1021
- this.el.classList.add('datetime-ready');
1022
- });
604
+ });
1023
605
  };
1024
- const visibleIO = new IntersectionObserver(visibleCallback, { threshold: 0.01, root: el });
1025
606
  /**
1026
- * Use raf to avoid a race condition between the component loading and
1027
- * its display animation starting (such as when shown in a modal). This
1028
- * could cause the datetime to start at a visibility of 0, erroneously
1029
- * triggering the `hiddenIO` observer below.
607
+ * When the container finishes scrolling we
608
+ * need to update the DOM with the selected month.
1030
609
  */
1031
- helpers.raf(() => visibleIO === null || visibleIO === void 0 ? void 0 : visibleIO.observe(intersectionTrackerRef));
610
+ let scrollTimeout;
1032
611
  /**
1033
- * We need to clean up listeners when the datetime is hidden
1034
- * in a popover/modal so that we can properly scroll containers
1035
- * back into view if they are re-presented. When the datetime is hidden
1036
- * the scroll areas have scroll widths/heights of 0px, so any snapping
1037
- * we did originally has been lost.
612
+ * We do not want to attempt to set pointer-events
613
+ * multiple times within a single swipe gesture as
614
+ * that adds unnecessary work to the main thread.
1038
615
  */
1039
- const hiddenCallback = (entries) => {
1040
- const ev = entries[0];
1041
- if (ev.isIntersecting) {
1042
- return;
1043
- }
1044
- this.destroyInteractionListeners();
1045
- /**
1046
- * When datetime is hidden, we need to make sure that
1047
- * the month/year picker is closed. Otherwise,
1048
- * it will be open when the datetime re-appears
1049
- * and the scroll area of the calendar grid will be 0.
1050
- * As a result, the wrong month will be shown.
1051
- */
1052
- this.showMonthAndYear = false;
1053
- index$1.writeTask(() => {
1054
- this.el.classList.remove('datetime-ready');
1055
- });
616
+ let appliediOSRubberBandFix = false;
617
+ const scrollCallback = () => {
618
+ if (scrollTimeout) {
619
+ clearTimeout(scrollTimeout);
620
+ }
621
+ /**
622
+ * On iOS it is possible to quickly rubber band
623
+ * the scroll area before the scroll timeout has fired.
624
+ * This results in users reaching the end of the scrollable
625
+ * container before the DOM has updated.
626
+ * By setting `pointer-events: none` we can ensure that
627
+ * subsequent swipes do not happen while the container
628
+ * is snapping.
629
+ */
630
+ if (!appliediOSRubberBandFix && needsiOSRubberBandFix) {
631
+ calendarBodyRef.style.setProperty('pointer-events', 'none');
632
+ appliediOSRubberBandFix = true;
633
+ }
634
+ // Wait ~3 frames
635
+ scrollTimeout = setTimeout(updateActiveMonth, 50);
1056
636
  };
1057
- const hiddenIO = new IntersectionObserver(hiddenCallback, { threshold: 0, root: el });
1058
- helpers.raf(() => hiddenIO === null || hiddenIO === void 0 ? void 0 : hiddenIO.observe(intersectionTrackerRef));
1059
- /**
1060
- * Datetime uses Ionic components that emit
1061
- * ionFocus and ionBlur. These events are
1062
- * composed meaning they will cross
1063
- * the shadow dom boundary. We need to
1064
- * stop propagation on these events otherwise
1065
- * developers will see 2 ionFocus or 2 ionBlur
1066
- * events at a time.
1067
- */
1068
- const root = helpers.getElementRoot(this.el);
1069
- root.addEventListener('ionFocus', (ev) => ev.stopPropagation());
1070
- root.addEventListener('ionBlur', (ev) => ev.stopPropagation());
1071
- }
637
+ calendarBodyRef.addEventListener('scroll', scrollCallback);
638
+ this.destroyCalendarListener = () => {
639
+ calendarBodyRef.removeEventListener('scroll', scrollCallback);
640
+ };
641
+ });
642
+ };
1072
643
  /**
1073
- * When the presentation is changed, all calendar content is recreated,
1074
- * so we need to re-init behavior with the new elements.
644
+ * Clean up all listeners except for the overlay
645
+ * listener. This is so that we can re-create the listeners
646
+ * if the datetime has been hidden/presented by a modal or popover.
1075
647
  */
1076
- componentDidRender() {
1077
- const { presentation, prevPresentation, calendarBodyRef, minParts, preferWheel, forceRenderDate } = this;
648
+ this.destroyInteractionListeners = () => {
649
+ const { destroyCalendarListener, destroyKeyboardMO } = this;
650
+ if (destroyCalendarListener !== undefined) {
651
+ destroyCalendarListener();
652
+ }
653
+ if (destroyKeyboardMO !== undefined) {
654
+ destroyKeyboardMO();
655
+ }
656
+ };
657
+ this.processValue = (value) => {
658
+ const hasValue = value !== null && value !== undefined && (!Array.isArray(value) || value.length > 0);
659
+ const valueToProcess = hasValue ? data.parseDate(value) : this.defaultParts;
660
+ const { minParts, maxParts, workingParts, el } = this;
661
+ this.warnIfIncorrectValueUsage();
662
+ /**
663
+ * Return early if the value wasn't parsed correctly, such as
664
+ * if an improperly formatted date string was provided.
665
+ */
666
+ if (!valueToProcess) {
667
+ return;
668
+ }
669
+ /**
670
+ * Datetime should only warn of out of bounds values
671
+ * if set by the user. If the `value` is undefined,
672
+ * we will default to today's date which may be out
673
+ * of bounds. In this case, the warning makes it look
674
+ * like the developer did something wrong which is
675
+ * not true.
676
+ */
677
+ if (hasValue) {
678
+ data.warnIfValueOutOfBounds(valueToProcess, minParts, maxParts);
679
+ }
680
+ /**
681
+ * If there are multiple values, pick an arbitrary one to clamp to. This way,
682
+ * if the values are across months, we always show at least one of them. Note
683
+ * that the values don't necessarily have to be in order.
684
+ */
685
+ const singleValue = Array.isArray(valueToProcess) ? valueToProcess[0] : valueToProcess;
686
+ const targetValue = data.clampDate(singleValue, minParts, maxParts);
687
+ const { month, day, year, hour, minute } = targetValue;
688
+ const ampm = data.parseAmPm(hour);
689
+ /**
690
+ * Since `activeParts` indicates a value that
691
+ * been explicitly selected either by the
692
+ * user or the app, only update `activeParts`
693
+ * if the `value` property is set.
694
+ */
695
+ if (hasValue) {
696
+ if (Array.isArray(valueToProcess)) {
697
+ this.activeParts = [...valueToProcess];
698
+ }
699
+ else {
700
+ this.activeParts = {
701
+ month,
702
+ day,
703
+ year,
704
+ hour,
705
+ minute,
706
+ ampm,
707
+ };
708
+ }
709
+ }
710
+ else {
1078
711
  /**
1079
- * TODO(FW-2165)
1080
- * Remove this when https://bugs.webkit.org/show_bug.cgi?id=235960 is fixed.
1081
- * When using `min`, we add `scroll-snap-align: none`
1082
- * to the disabled month so that users cannot scroll to it.
1083
- * This triggers a bug in WebKit where the scroll position is reset.
1084
- * Since the month change logic is handled by a scroll listener,
1085
- * this causes the month to change leading to `scroll-snap-align`
1086
- * changing again, thus changing the scroll position again and causing
1087
- * an infinite loop.
1088
- * This issue only applies to the calendar grid, so we can disable
1089
- * it if the calendar grid is not being used.
712
+ * Reset the active parts if the value is not set.
713
+ * This will clear the selected calendar day when
714
+ * performing a clear action or using the reset() method.
1090
715
  */
1091
- const hasCalendarGrid = !preferWheel && ['date-time', 'time-date', 'date'].includes(presentation);
1092
- if (minParts !== undefined && hasCalendarGrid && calendarBodyRef) {
1093
- const workingMonth = calendarBodyRef.querySelector('.calendar-month:nth-of-type(1)');
1094
- /**
1095
- * We need to make sure the datetime is not in the process
1096
- * of scrolling to a new datetime value if the value
1097
- * is updated programmatically.
1098
- * Otherwise, the datetime will appear to not scroll at all because
1099
- * we are resetting the scroll position to the center of the view.
1100
- * Prior to the datetime's value being updated programmatically,
1101
- * the calendarBodyRef is scrolled such that the middle month is centered
1102
- * in the view. The below code updates the scroll position so the middle
1103
- * month is also centered in the view. Since the scroll position did not change,
1104
- * the scroll callback in this file does not fire,
1105
- * and the resolveForceDateScrolling promise never resolves.
1106
- */
1107
- if (workingMonth && forceRenderDate === undefined) {
1108
- calendarBodyRef.scrollLeft = workingMonth.clientWidth * (dir.isRTL(this.el) ? -1 : 1);
1109
- }
716
+ this.activeParts = [];
717
+ }
718
+ /**
719
+ * Only animate if:
720
+ * 1. We're using grid style (wheel style pickers should just jump to new value)
721
+ * 2. The month and/or year actually changed, and both are defined (otherwise there's nothing to animate to)
722
+ * 3. The calendar body is visible (prevents animation when in collapsed datetime-button, for example)
723
+ * 4. The month/year picker is not open (since you wouldn't see the animation anyway)
724
+ */
725
+ const didChangeMonth = (month !== undefined && month !== workingParts.month) || (year !== undefined && year !== workingParts.year);
726
+ const bodyIsVisible = el.classList.contains('datetime-ready');
727
+ const { isGridStyle, showMonthAndYear } = this;
728
+ let areAllSelectedDatesInSameMonth = true;
729
+ if (Array.isArray(valueToProcess)) {
730
+ const firstMonth = valueToProcess[0].month;
731
+ for (const date of valueToProcess) {
732
+ if (date.month !== firstMonth) {
733
+ areAllSelectedDatesInSameMonth = false;
734
+ break;
735
+ }
1110
736
  }
1111
- if (prevPresentation === null) {
1112
- this.prevPresentation = presentation;
1113
- return;
737
+ }
738
+ /**
739
+ * If there is more than one date selected
740
+ * and the dates aren't all in the same month,
741
+ * then we should neither animate to the date
742
+ * nor update the working parts because we do
743
+ * not know which date the user wants to view.
744
+ */
745
+ if (areAllSelectedDatesInSameMonth) {
746
+ if (isGridStyle && didChangeMonth && bodyIsVisible && !showMonthAndYear) {
747
+ this.animateToDate(targetValue);
1114
748
  }
1115
- if (presentation === prevPresentation) {
1116
- return;
749
+ else {
750
+ /**
751
+ * We only need to do this if we didn't just animate to a new month,
752
+ * since that calls prevMonth/nextMonth which calls setWorkingParts for us.
753
+ */
754
+ this.setWorkingParts({
755
+ month,
756
+ day,
757
+ year,
758
+ hour,
759
+ minute,
760
+ ampm,
761
+ });
1117
762
  }
1118
- this.prevPresentation = presentation;
1119
- this.destroyInteractionListeners();
1120
- this.initializeListeners();
1121
- /**
1122
- * The month/year picker from the date interface
1123
- * should be closed as it is not available in non-date
1124
- * interfaces.
1125
- */
1126
- this.showMonthAndYear = false;
1127
- helpers.raf(() => {
1128
- this.ionRender.emit();
1129
- });
763
+ }
764
+ };
765
+ this.animateToDate = async (targetValue) => {
766
+ const { workingParts } = this;
767
+ /**
768
+ * Tell other render functions that we need to force the
769
+ * target month to appear in place of the actual next/prev month.
770
+ * Because this is a State variable, a rerender will be triggered
771
+ * automatically, updating the rendered months.
772
+ */
773
+ this.forceRenderDate = targetValue;
774
+ /**
775
+ * Flag that we've started scrolling to the forced date.
776
+ * The resolve function will be called by the datetime's
777
+ * scroll listener when it's done updating everything.
778
+ * This is a replacement for making prev/nextMonth async,
779
+ * since the logic we're waiting on is in a listener.
780
+ */
781
+ const forceDateScrollingPromise = new Promise((resolve) => {
782
+ this.resolveForceDateScrolling = resolve;
783
+ });
784
+ /**
785
+ * Animate smoothly to the forced month. This will also update
786
+ * workingParts and correct the surrounding months for us.
787
+ */
788
+ const targetMonthIsBefore = data.isBefore(targetValue, workingParts);
789
+ targetMonthIsBefore ? this.prevMonth() : this.nextMonth();
790
+ await forceDateScrollingPromise;
791
+ this.resolveForceDateScrolling = undefined;
792
+ this.forceRenderDate = undefined;
793
+ };
794
+ this.onFocus = () => {
795
+ this.ionFocus.emit();
796
+ };
797
+ this.onBlur = () => {
798
+ this.ionBlur.emit();
799
+ };
800
+ this.hasValue = () => {
801
+ return this.value != null;
802
+ };
803
+ this.nextMonth = () => {
804
+ const calendarBodyRef = this.calendarBodyRef;
805
+ if (!calendarBodyRef) {
806
+ return;
807
+ }
808
+ const nextMonth = calendarBodyRef.querySelector('.calendar-month:last-of-type');
809
+ if (!nextMonth) {
810
+ return;
811
+ }
812
+ const left = nextMonth.offsetWidth * 2;
813
+ calendarBodyRef.scrollTo({
814
+ top: 0,
815
+ left: left * (dir.isRTL(this.el) ? -1 : 1),
816
+ behavior: 'smooth',
817
+ });
818
+ };
819
+ this.prevMonth = () => {
820
+ const calendarBodyRef = this.calendarBodyRef;
821
+ if (!calendarBodyRef) {
822
+ return;
823
+ }
824
+ const prevMonth = calendarBodyRef.querySelector('.calendar-month:first-of-type');
825
+ if (!prevMonth) {
826
+ return;
827
+ }
828
+ calendarBodyRef.scrollTo({
829
+ top: 0,
830
+ left: 0,
831
+ behavior: 'smooth',
832
+ });
833
+ };
834
+ this.toggleMonthAndYearView = () => {
835
+ this.showMonthAndYear = !this.showMonthAndYear;
836
+ };
837
+ this.showMonthAndYear = false;
838
+ this.activeParts = [];
839
+ this.workingParts = {
840
+ month: 5,
841
+ day: 28,
842
+ year: 2021,
843
+ hour: 13,
844
+ minute: 52,
845
+ ampm: 'pm',
846
+ };
847
+ this.isTimePopoverOpen = false;
848
+ this.forceRenderDate = undefined;
849
+ this.color = 'primary';
850
+ this.name = this.inputId;
851
+ this.disabled = false;
852
+ this.formatOptions = undefined;
853
+ this.readonly = false;
854
+ this.isDateEnabled = undefined;
855
+ this.min = undefined;
856
+ this.max = undefined;
857
+ this.presentation = 'date-time';
858
+ this.cancelText = 'Cancel';
859
+ this.doneText = 'Done';
860
+ this.clearText = 'Clear';
861
+ this.yearValues = undefined;
862
+ this.monthValues = undefined;
863
+ this.dayValues = undefined;
864
+ this.hourValues = undefined;
865
+ this.minuteValues = undefined;
866
+ this.locale = 'default';
867
+ this.firstDayOfWeek = 0;
868
+ this.titleSelectedDatesFormatter = undefined;
869
+ this.multiple = false;
870
+ this.highlightedDates = undefined;
871
+ this.value = undefined;
872
+ this.showDefaultTitle = false;
873
+ this.showDefaultButtons = false;
874
+ this.showClearButton = false;
875
+ this.showDefaultTimeLabel = true;
876
+ this.hourCycle = undefined;
877
+ this.size = 'fixed';
878
+ this.preferWheel = false;
879
+ }
880
+ formatOptionsChanged() {
881
+ const { el, formatOptions, presentation } = this;
882
+ checkForPresentationFormatMismatch(el, presentation, formatOptions);
883
+ warnIfTimeZoneProvided(el, formatOptions);
884
+ }
885
+ disabledChanged() {
886
+ this.emitStyle();
887
+ }
888
+ minChanged() {
889
+ this.processMinParts();
890
+ }
891
+ maxChanged() {
892
+ this.processMaxParts();
893
+ }
894
+ presentationChanged() {
895
+ const { el, formatOptions, presentation } = this;
896
+ checkForPresentationFormatMismatch(el, presentation, formatOptions);
897
+ }
898
+ get isGridStyle() {
899
+ const { presentation, preferWheel } = this;
900
+ const hasDatePresentation = presentation === 'date' || presentation === 'date-time' || presentation === 'time-date';
901
+ return hasDatePresentation && !preferWheel;
902
+ }
903
+ yearValuesChanged() {
904
+ this.parsedYearValues = data.convertToArrayOfNumbers(this.yearValues);
905
+ }
906
+ monthValuesChanged() {
907
+ this.parsedMonthValues = data.convertToArrayOfNumbers(this.monthValues);
908
+ }
909
+ dayValuesChanged() {
910
+ this.parsedDayValues = data.convertToArrayOfNumbers(this.dayValues);
911
+ }
912
+ hourValuesChanged() {
913
+ this.parsedHourValues = data.convertToArrayOfNumbers(this.hourValues);
914
+ }
915
+ minuteValuesChanged() {
916
+ this.parsedMinuteValues = data.convertToArrayOfNumbers(this.minuteValues);
917
+ }
918
+ /**
919
+ * Update the datetime value when the value changes
920
+ */
921
+ async valueChanged() {
922
+ const { value } = this;
923
+ if (this.hasValue()) {
924
+ this.processValue(value);
1130
925
  }
1131
- componentWillLoad() {
1132
- const { el, formatOptions, highlightedDates, multiple, presentation, preferWheel } = this;
1133
- if (multiple) {
1134
- if (presentation !== 'date') {
1135
- index.printIonWarning('Multiple date selection is only supported for presentation="date".', el);
1136
- }
1137
- if (preferWheel) {
1138
- index.printIonWarning('Multiple date selection is not supported with preferWheel="true".', el);
1139
- }
1140
- }
1141
- if (highlightedDates !== undefined) {
1142
- if (presentation !== 'date' && presentation !== 'date-time' && presentation !== 'time-date') {
1143
- index.printIonWarning('The highlightedDates property is only supported with the date, date-time, and time-date presentations.', el);
1144
- }
1145
- if (preferWheel) {
1146
- index.printIonWarning('The highlightedDates property is not supported with preferWheel="true".', el);
1147
- }
926
+ this.emitStyle();
927
+ this.ionValueChange.emit({ value });
928
+ }
929
+ /**
930
+ * Confirms the selected datetime value, updates the
931
+ * `value` property, and optionally closes the popover
932
+ * or modal that the datetime was presented in.
933
+ */
934
+ async confirm(closeOverlay = false) {
935
+ const { isCalendarPicker, activeParts, preferWheel, workingParts } = this;
936
+ /**
937
+ * We only update the value if the presentation is not a calendar picker.
938
+ */
939
+ if (activeParts !== undefined || !isCalendarPicker) {
940
+ const activePartsIsArray = Array.isArray(activeParts);
941
+ if (activePartsIsArray && activeParts.length === 0) {
942
+ if (preferWheel) {
943
+ /**
944
+ * If the datetime is using a wheel picker, but the
945
+ * active parts are empty, then the user has confirmed the
946
+ * initial value (working parts) presented to them.
947
+ */
948
+ this.setValue(data.convertDataToISO(workingParts));
1148
949
  }
1149
- if (formatOptions) {
1150
- checkForPresentationFormatMismatch(el, presentation, formatOptions);
1151
- warnIfTimeZoneProvided(el, formatOptions);
950
+ else {
951
+ this.setValue(undefined);
1152
952
  }
1153
- const hourValues = (this.parsedHourValues = data.convertToArrayOfNumbers(this.hourValues));
1154
- const minuteValues = (this.parsedMinuteValues = data.convertToArrayOfNumbers(this.minuteValues));
1155
- const monthValues = (this.parsedMonthValues = data.convertToArrayOfNumbers(this.monthValues));
1156
- const yearValues = (this.parsedYearValues = data.convertToArrayOfNumbers(this.yearValues));
1157
- const dayValues = (this.parsedDayValues = data.convertToArrayOfNumbers(this.dayValues));
1158
- const todayParts = (this.todayParts = data.parseDate(data.getToday()));
1159
- this.processMinParts();
1160
- this.processMaxParts();
1161
- this.defaultParts = data.getClosestValidDate({
1162
- refParts: todayParts,
1163
- monthValues,
1164
- dayValues,
1165
- yearValues,
1166
- hourValues,
1167
- minuteValues,
1168
- minParts: this.minParts,
1169
- maxParts: this.maxParts,
1170
- });
1171
- this.processValue(this.value);
1172
- this.emitStyle();
953
+ }
954
+ else {
955
+ this.setValue(data.convertDataToISO(activeParts));
956
+ }
957
+ }
958
+ if (closeOverlay) {
959
+ this.closeParentOverlay();
960
+ }
961
+ }
962
+ /**
963
+ * Resets the internal state of the datetime but does not update the value.
964
+ * Passing a valid ISO-8601 string will reset the state of the component to the provided date.
965
+ * If no value is provided, the internal state will be reset to the clamped value of the min, max and today.
966
+ */
967
+ async reset(startDate) {
968
+ this.processValue(startDate);
969
+ }
970
+ /**
971
+ * Emits the ionCancel event and
972
+ * optionally closes the popover
973
+ * or modal that the datetime was
974
+ * presented in.
975
+ */
976
+ async cancel(closeOverlay = false) {
977
+ this.ionCancel.emit();
978
+ if (closeOverlay) {
979
+ this.closeParentOverlay();
1173
980
  }
1174
- emitStyle() {
1175
- this.ionStyle.emit({
1176
- interactive: true,
1177
- datetime: true,
1178
- 'interactive-disabled': this.disabled,
1179
- });
981
+ }
982
+ get isCalendarPicker() {
983
+ const { presentation } = this;
984
+ return presentation === 'date' || presentation === 'date-time' || presentation === 'time-date';
985
+ }
986
+ connectedCallback() {
987
+ this.clearFocusVisible = focusVisible.startFocusVisible(this.el).destroy;
988
+ }
989
+ disconnectedCallback() {
990
+ if (this.clearFocusVisible) {
991
+ this.clearFocusVisible();
992
+ this.clearFocusVisible = undefined;
1180
993
  }
994
+ }
995
+ initializeListeners() {
996
+ this.initializeCalendarListener();
997
+ this.initializeKeyboardListeners();
998
+ }
999
+ componentDidLoad() {
1000
+ const { el, intersectionTrackerRef } = this;
1181
1001
  /**
1182
- * Universal render methods
1183
- * These are pieces of datetime that
1184
- * are rendered independently of presentation.
1002
+ * If a scrollable element is hidden using `display: none`,
1003
+ * it will not have a scroll height meaning we cannot scroll elements
1004
+ * into view. As a result, we will need to wait for the datetime to become
1005
+ * visible if used inside of a modal or a popover otherwise the scrollable
1006
+ * areas will not have the correct values snapped into place.
1185
1007
  */
1186
- renderFooter() {
1187
- const { disabled, readonly, showDefaultButtons, showClearButton } = this;
1188
- /**
1189
- * The cancel, clear, and confirm buttons
1190
- * should not be interactive if the datetime
1191
- * is disabled or readonly.
1192
- */
1193
- const isButtonDisabled = disabled || readonly;
1194
- const hasSlottedButtons = this.el.querySelector('[slot="buttons"]') !== null;
1195
- if (!hasSlottedButtons && !showDefaultButtons && !showClearButton) {
1196
- return;
1197
- }
1198
- const clearButtonClick = () => {
1199
- this.reset();
1200
- this.setValue(undefined);
1201
- };
1202
- /**
1203
- * By default we render two buttons:
1204
- * Cancel - Dismisses the datetime and
1205
- * does not update the `value` prop.
1206
- * OK - Dismisses the datetime and
1207
- * updates the `value` prop.
1208
- */
1209
- return (index$1.h("div", { class: "datetime-footer" }, index$1.h("div", { class: "datetime-buttons" }, index$1.h("div", { class: {
1210
- ['datetime-action-buttons']: true,
1211
- ['has-clear-button']: this.showClearButton,
1212
- } }, index$1.h("slot", { name: "buttons" }, index$1.h("ion-buttons", null, showDefaultButtons && (index$1.h("ion-button", { id: "cancel-button", color: this.color, onClick: () => this.cancel(true), disabled: isButtonDisabled }, this.cancelText)), index$1.h("div", { class: "datetime-action-buttons-container" }, showClearButton && (index$1.h("ion-button", { id: "clear-button", color: this.color, onClick: () => clearButtonClick(), disabled: isButtonDisabled }, this.clearText)), showDefaultButtons && (index$1.h("ion-button", { id: "confirm-button", color: this.color, onClick: () => this.confirm(true), disabled: isButtonDisabled }, this.doneText)))))))));
1008
+ const visibleCallback = (entries) => {
1009
+ const ev = entries[0];
1010
+ if (!ev.isIntersecting) {
1011
+ return;
1012
+ }
1013
+ this.initializeListeners();
1014
+ /**
1015
+ * TODO FW-2793: Datetime needs a frame to ensure that it
1016
+ * can properly scroll contents into view. As a result
1017
+ * we hide the scrollable content until after that frame
1018
+ * so users do not see the content quickly shifting. The downside
1019
+ * is that the content will pop into view a frame after. Maybe there
1020
+ * is a better way to handle this?
1021
+ */
1022
+ index$1.writeTask(() => {
1023
+ this.el.classList.add('datetime-ready');
1024
+ });
1025
+ };
1026
+ const visibleIO = new IntersectionObserver(visibleCallback, { threshold: 0.01, root: el });
1027
+ /**
1028
+ * Use raf to avoid a race condition between the component loading and
1029
+ * its display animation starting (such as when shown in a modal). This
1030
+ * could cause the datetime to start at a visibility of 0, erroneously
1031
+ * triggering the `hiddenIO` observer below.
1032
+ */
1033
+ helpers.raf(() => visibleIO === null || visibleIO === void 0 ? void 0 : visibleIO.observe(intersectionTrackerRef));
1034
+ /**
1035
+ * We need to clean up listeners when the datetime is hidden
1036
+ * in a popover/modal so that we can properly scroll containers
1037
+ * back into view if they are re-presented. When the datetime is hidden
1038
+ * the scroll areas have scroll widths/heights of 0px, so any snapping
1039
+ * we did originally has been lost.
1040
+ */
1041
+ const hiddenCallback = (entries) => {
1042
+ const ev = entries[0];
1043
+ if (ev.isIntersecting) {
1044
+ return;
1045
+ }
1046
+ this.destroyInteractionListeners();
1047
+ /**
1048
+ * When datetime is hidden, we need to make sure that
1049
+ * the month/year picker is closed. Otherwise,
1050
+ * it will be open when the datetime re-appears
1051
+ * and the scroll area of the calendar grid will be 0.
1052
+ * As a result, the wrong month will be shown.
1053
+ */
1054
+ this.showMonthAndYear = false;
1055
+ index$1.writeTask(() => {
1056
+ this.el.classList.remove('datetime-ready');
1057
+ });
1058
+ };
1059
+ const hiddenIO = new IntersectionObserver(hiddenCallback, { threshold: 0, root: el });
1060
+ helpers.raf(() => hiddenIO === null || hiddenIO === void 0 ? void 0 : hiddenIO.observe(intersectionTrackerRef));
1061
+ /**
1062
+ * Datetime uses Ionic components that emit
1063
+ * ionFocus and ionBlur. These events are
1064
+ * composed meaning they will cross
1065
+ * the shadow dom boundary. We need to
1066
+ * stop propagation on these events otherwise
1067
+ * developers will see 2 ionFocus or 2 ionBlur
1068
+ * events at a time.
1069
+ */
1070
+ const root = helpers.getElementRoot(this.el);
1071
+ root.addEventListener('ionFocus', (ev) => ev.stopPropagation());
1072
+ root.addEventListener('ionBlur', (ev) => ev.stopPropagation());
1073
+ }
1074
+ /**
1075
+ * When the presentation is changed, all calendar content is recreated,
1076
+ * so we need to re-init behavior with the new elements.
1077
+ */
1078
+ componentDidRender() {
1079
+ const { presentation, prevPresentation, calendarBodyRef, minParts, preferWheel, forceRenderDate } = this;
1080
+ /**
1081
+ * TODO(FW-2165)
1082
+ * Remove this when https://bugs.webkit.org/show_bug.cgi?id=235960 is fixed.
1083
+ * When using `min`, we add `scroll-snap-align: none`
1084
+ * to the disabled month so that users cannot scroll to it.
1085
+ * This triggers a bug in WebKit where the scroll position is reset.
1086
+ * Since the month change logic is handled by a scroll listener,
1087
+ * this causes the month to change leading to `scroll-snap-align`
1088
+ * changing again, thus changing the scroll position again and causing
1089
+ * an infinite loop.
1090
+ * This issue only applies to the calendar grid, so we can disable
1091
+ * it if the calendar grid is not being used.
1092
+ */
1093
+ const hasCalendarGrid = !preferWheel && ['date-time', 'time-date', 'date'].includes(presentation);
1094
+ if (minParts !== undefined && hasCalendarGrid && calendarBodyRef) {
1095
+ const workingMonth = calendarBodyRef.querySelector('.calendar-month:nth-of-type(1)');
1096
+ /**
1097
+ * We need to make sure the datetime is not in the process
1098
+ * of scrolling to a new datetime value if the value
1099
+ * is updated programmatically.
1100
+ * Otherwise, the datetime will appear to not scroll at all because
1101
+ * we are resetting the scroll position to the center of the view.
1102
+ * Prior to the datetime's value being updated programmatically,
1103
+ * the calendarBodyRef is scrolled such that the middle month is centered
1104
+ * in the view. The below code updates the scroll position so the middle
1105
+ * month is also centered in the view. Since the scroll position did not change,
1106
+ * the scroll callback in this file does not fire,
1107
+ * and the resolveForceDateScrolling promise never resolves.
1108
+ */
1109
+ if (workingMonth && forceRenderDate === undefined) {
1110
+ calendarBodyRef.scrollLeft = workingMonth.clientWidth * (dir.isRTL(this.el) ? -1 : 1);
1111
+ }
1112
+ }
1113
+ if (prevPresentation === null) {
1114
+ this.prevPresentation = presentation;
1115
+ return;
1116
+ }
1117
+ if (presentation === prevPresentation) {
1118
+ return;
1213
1119
  }
1120
+ this.prevPresentation = presentation;
1121
+ this.destroyInteractionListeners();
1122
+ this.initializeListeners();
1214
1123
  /**
1215
- * Wheel picker render methods
1124
+ * The month/year picker from the date interface
1125
+ * should be closed as it is not available in non-date
1126
+ * interfaces.
1216
1127
  */
1217
- renderWheelPicker(forcePresentation = this.presentation) {
1218
- /**
1219
- * If presentation="time-date" we switch the
1220
- * order of the render array here instead of
1221
- * manually reordering each date/time picker
1222
- * column with CSS. This allows for additional
1223
- * flexibility if we need to render subsets
1224
- * of the date/time data or do additional ordering
1225
- * within the child render functions.
1226
- */
1227
- const renderArray = forcePresentation === 'time-date'
1228
- ? [this.renderTimePickerColumns(forcePresentation), this.renderDatePickerColumns(forcePresentation)]
1229
- : [this.renderDatePickerColumns(forcePresentation), this.renderTimePickerColumns(forcePresentation)];
1230
- return index$1.h("ion-picker-internal", null, renderArray);
1128
+ this.showMonthAndYear = false;
1129
+ helpers.raf(() => {
1130
+ this.ionRender.emit();
1131
+ });
1132
+ }
1133
+ componentWillLoad() {
1134
+ const { el, formatOptions, highlightedDates, multiple, presentation, preferWheel } = this;
1135
+ if (multiple) {
1136
+ if (presentation !== 'date') {
1137
+ index.printIonWarning('Multiple date selection is only supported for presentation="date".', el);
1138
+ }
1139
+ if (preferWheel) {
1140
+ index.printIonWarning('Multiple date selection is not supported with preferWheel="true".', el);
1141
+ }
1231
1142
  }
1232
- renderDatePickerColumns(forcePresentation) {
1233
- return forcePresentation === 'date-time' || forcePresentation === 'time-date'
1234
- ? this.renderCombinedDatePickerColumn()
1235
- : this.renderIndividualDatePickerColumns(forcePresentation);
1143
+ if (highlightedDates !== undefined) {
1144
+ if (presentation !== 'date' && presentation !== 'date-time' && presentation !== 'time-date') {
1145
+ index.printIonWarning('The highlightedDates property is only supported with the date, date-time, and time-date presentations.', el);
1146
+ }
1147
+ if (preferWheel) {
1148
+ index.printIonWarning('The highlightedDates property is not supported with preferWheel="true".', el);
1149
+ }
1236
1150
  }
1237
- renderCombinedDatePickerColumn() {
1238
- const { defaultParts, disabled, workingParts, locale, minParts, maxParts, todayParts, isDateEnabled } = this;
1239
- const activePart = this.getActivePartsWithFallback();
1240
- /**
1241
- * By default, generate a range of 3 months:
1242
- * Previous month, current month, and next month
1243
- */
1244
- const monthsToRender = data.generateMonths(workingParts);
1245
- const lastMonth = monthsToRender[monthsToRender.length - 1];
1246
- /**
1247
- * Ensure that users can select the entire window of dates.
1248
- */
1249
- monthsToRender[0].day = 1;
1250
- lastMonth.day = data.getNumDaysInMonth(lastMonth.month, lastMonth.year);
1251
- /**
1252
- * Narrow the dates rendered based on min/max dates (if any).
1253
- * The `min` date is used if the min is after the generated min month.
1254
- * The `max` date is used if the max is before the generated max month.
1255
- * This ensures that the sliding window always stays at 3 months
1256
- * but still allows future dates to be lazily rendered based on any min/max
1257
- * constraints.
1258
- */
1259
- const min = minParts !== undefined && data.isAfter(minParts, monthsToRender[0]) ? minParts : monthsToRender[0];
1260
- const max = maxParts !== undefined && data.isBefore(maxParts, lastMonth) ? maxParts : lastMonth;
1261
- const result = data.getCombinedDateColumnData(locale, todayParts, min, max, this.parsedDayValues, this.parsedMonthValues);
1262
- let items = result.items;
1263
- const parts = result.parts;
1264
- if (isDateEnabled) {
1265
- items = items.map((itemObject, index$1) => {
1266
- const referenceParts = parts[index$1];
1267
- let disabled;
1268
- try {
1269
- /**
1270
- * The `isDateEnabled` implementation is try-catch wrapped
1271
- * to prevent exceptions in the user's function from
1272
- * interrupting the calendar rendering.
1273
- */
1274
- disabled = !isDateEnabled(data.convertDataToISO(referenceParts));
1275
- }
1276
- catch (e) {
1277
- index.printIonError('Exception thrown from provided `isDateEnabled` function. Please check your function and try again.', e);
1278
- }
1279
- return Object.assign(Object.assign({}, itemObject), { disabled });
1280
- });
1281
- }
1282
- /**
1283
- * If we have selected a day already, then default the column
1284
- * to that value. Otherwise, set it to the default date.
1285
- */
1286
- const todayString = workingParts.day !== null
1287
- ? `${workingParts.year}-${workingParts.month}-${workingParts.day}`
1288
- : `${defaultParts.year}-${defaultParts.month}-${defaultParts.day}`;
1289
- return (index$1.h("ion-picker-column-internal", { class: "date-column", color: this.color, disabled: disabled, items: items, value: todayString, onIonChange: (ev) => {
1290
- // TODO(FW-1823) Remove this when iOS 14 support is dropped.
1291
- // Due to a Safari 14 issue we need to destroy
1292
- // the scroll listener before we update state
1293
- // and trigger a re-render.
1294
- if (this.destroyCalendarListener) {
1295
- this.destroyCalendarListener();
1296
- }
1297
- const { value } = ev.detail;
1298
- const findPart = parts.find(({ month, day, year }) => value === `${year}-${month}-${day}`);
1299
- this.setWorkingParts(Object.assign(Object.assign({}, workingParts), findPart));
1300
- this.setActiveParts(Object.assign(Object.assign({}, activePart), findPart));
1301
- // We can re-attach the scroll listener after
1302
- // the working parts have been updated.
1303
- this.initializeCalendarListener();
1304
- ev.stopPropagation();
1305
- } }));
1151
+ if (formatOptions) {
1152
+ checkForPresentationFormatMismatch(el, presentation, formatOptions);
1153
+ warnIfTimeZoneProvided(el, formatOptions);
1306
1154
  }
1307
- renderIndividualDatePickerColumns(forcePresentation) {
1308
- const { workingParts, isDateEnabled } = this;
1309
- const shouldRenderMonths = forcePresentation !== 'year' && forcePresentation !== 'time';
1310
- const months = shouldRenderMonths
1311
- ? data.getMonthColumnData(this.locale, workingParts, this.minParts, this.maxParts, this.parsedMonthValues)
1312
- : [];
1313
- const shouldRenderDays = forcePresentation === 'date';
1314
- let days = shouldRenderDays
1315
- ? data.getDayColumnData(this.locale, workingParts, this.minParts, this.maxParts, this.parsedDayValues)
1316
- : [];
1317
- if (isDateEnabled) {
1318
- days = days.map((dayObject) => {
1319
- const { value } = dayObject;
1320
- const valueNum = typeof value === 'string' ? parseInt(value) : value;
1321
- const referenceParts = {
1322
- month: workingParts.month,
1323
- day: valueNum,
1324
- year: workingParts.year,
1325
- };
1326
- let disabled;
1327
- try {
1328
- /**
1329
- * The `isDateEnabled` implementation is try-catch wrapped
1330
- * to prevent exceptions in the user's function from
1331
- * interrupting the calendar rendering.
1332
- */
1333
- disabled = !isDateEnabled(data.convertDataToISO(referenceParts));
1334
- }
1335
- catch (e) {
1336
- index.printIonError('Exception thrown from provided `isDateEnabled` function. Please check your function and try again.', e);
1337
- }
1338
- return Object.assign(Object.assign({}, dayObject), { disabled });
1339
- });
1340
- }
1341
- const shouldRenderYears = forcePresentation !== 'month' && forcePresentation !== 'time';
1342
- const years = shouldRenderYears
1343
- ? data.getYearColumnData(this.locale, this.defaultParts, this.minParts, this.maxParts, this.parsedYearValues)
1344
- : [];
1345
- /**
1346
- * Certain locales show the day before the month.
1347
- */
1348
- const showMonthFirst = data.isMonthFirstLocale(this.locale, { month: 'numeric', day: 'numeric' });
1349
- let renderArray = [];
1350
- if (showMonthFirst) {
1351
- renderArray = [
1352
- this.renderMonthPickerColumn(months),
1353
- this.renderDayPickerColumn(days),
1354
- this.renderYearPickerColumn(years),
1355
- ];
1356
- }
1357
- else {
1358
- renderArray = [
1359
- this.renderDayPickerColumn(days),
1360
- this.renderMonthPickerColumn(months),
1361
- this.renderYearPickerColumn(years),
1362
- ];
1363
- }
1364
- return renderArray;
1155
+ const hourValues = (this.parsedHourValues = data.convertToArrayOfNumbers(this.hourValues));
1156
+ const minuteValues = (this.parsedMinuteValues = data.convertToArrayOfNumbers(this.minuteValues));
1157
+ const monthValues = (this.parsedMonthValues = data.convertToArrayOfNumbers(this.monthValues));
1158
+ const yearValues = (this.parsedYearValues = data.convertToArrayOfNumbers(this.yearValues));
1159
+ const dayValues = (this.parsedDayValues = data.convertToArrayOfNumbers(this.dayValues));
1160
+ const todayParts = (this.todayParts = data.parseDate(data.getToday()));
1161
+ this.processMinParts();
1162
+ this.processMaxParts();
1163
+ this.defaultParts = data.getClosestValidDate({
1164
+ refParts: todayParts,
1165
+ monthValues,
1166
+ dayValues,
1167
+ yearValues,
1168
+ hourValues,
1169
+ minuteValues,
1170
+ minParts: this.minParts,
1171
+ maxParts: this.maxParts,
1172
+ });
1173
+ this.processValue(this.value);
1174
+ this.emitStyle();
1175
+ }
1176
+ emitStyle() {
1177
+ this.ionStyle.emit({
1178
+ interactive: true,
1179
+ datetime: true,
1180
+ 'interactive-disabled': this.disabled,
1181
+ });
1182
+ }
1183
+ /**
1184
+ * Universal render methods
1185
+ * These are pieces of datetime that
1186
+ * are rendered independently of presentation.
1187
+ */
1188
+ renderFooter() {
1189
+ const { disabled, readonly, showDefaultButtons, showClearButton } = this;
1190
+ /**
1191
+ * The cancel, clear, and confirm buttons
1192
+ * should not be interactive if the datetime
1193
+ * is disabled or readonly.
1194
+ */
1195
+ const isButtonDisabled = disabled || readonly;
1196
+ const hasSlottedButtons = this.el.querySelector('[slot="buttons"]') !== null;
1197
+ if (!hasSlottedButtons && !showDefaultButtons && !showClearButton) {
1198
+ return;
1365
1199
  }
1366
- renderDayPickerColumn(days) {
1367
- var _a;
1368
- if (days.length === 0) {
1369
- return [];
1200
+ const clearButtonClick = () => {
1201
+ this.reset();
1202
+ this.setValue(undefined);
1203
+ };
1204
+ /**
1205
+ * By default we render two buttons:
1206
+ * Cancel - Dismisses the datetime and
1207
+ * does not update the `value` prop.
1208
+ * OK - Dismisses the datetime and
1209
+ * updates the `value` prop.
1210
+ */
1211
+ return (index$1.h("div", { class: "datetime-footer" }, index$1.h("div", { class: "datetime-buttons" }, index$1.h("div", { class: {
1212
+ ['datetime-action-buttons']: true,
1213
+ ['has-clear-button']: this.showClearButton,
1214
+ } }, index$1.h("slot", { name: "buttons" }, index$1.h("ion-buttons", null, showDefaultButtons && (index$1.h("ion-button", { id: "cancel-button", color: this.color, onClick: () => this.cancel(true), disabled: isButtonDisabled }, this.cancelText)), index$1.h("div", { class: "datetime-action-buttons-container" }, showClearButton && (index$1.h("ion-button", { id: "clear-button", color: this.color, onClick: () => clearButtonClick(), disabled: isButtonDisabled }, this.clearText)), showDefaultButtons && (index$1.h("ion-button", { id: "confirm-button", color: this.color, onClick: () => this.confirm(true), disabled: isButtonDisabled }, this.doneText)))))))));
1215
+ }
1216
+ /**
1217
+ * Wheel picker render methods
1218
+ */
1219
+ renderWheelPicker(forcePresentation = this.presentation) {
1220
+ /**
1221
+ * If presentation="time-date" we switch the
1222
+ * order of the render array here instead of
1223
+ * manually reordering each date/time picker
1224
+ * column with CSS. This allows for additional
1225
+ * flexibility if we need to render subsets
1226
+ * of the date/time data or do additional ordering
1227
+ * within the child render functions.
1228
+ */
1229
+ const renderArray = forcePresentation === 'time-date'
1230
+ ? [this.renderTimePickerColumns(forcePresentation), this.renderDatePickerColumns(forcePresentation)]
1231
+ : [this.renderDatePickerColumns(forcePresentation), this.renderTimePickerColumns(forcePresentation)];
1232
+ return index$1.h("ion-picker-internal", null, renderArray);
1233
+ }
1234
+ renderDatePickerColumns(forcePresentation) {
1235
+ return forcePresentation === 'date-time' || forcePresentation === 'time-date'
1236
+ ? this.renderCombinedDatePickerColumn()
1237
+ : this.renderIndividualDatePickerColumns(forcePresentation);
1238
+ }
1239
+ renderCombinedDatePickerColumn() {
1240
+ const { defaultParts, disabled, workingParts, locale, minParts, maxParts, todayParts, isDateEnabled } = this;
1241
+ const activePart = this.getActivePartsWithFallback();
1242
+ /**
1243
+ * By default, generate a range of 3 months:
1244
+ * Previous month, current month, and next month
1245
+ */
1246
+ const monthsToRender = data.generateMonths(workingParts);
1247
+ const lastMonth = monthsToRender[monthsToRender.length - 1];
1248
+ /**
1249
+ * Ensure that users can select the entire window of dates.
1250
+ */
1251
+ monthsToRender[0].day = 1;
1252
+ lastMonth.day = data.getNumDaysInMonth(lastMonth.month, lastMonth.year);
1253
+ /**
1254
+ * Narrow the dates rendered based on min/max dates (if any).
1255
+ * The `min` date is used if the min is after the generated min month.
1256
+ * The `max` date is used if the max is before the generated max month.
1257
+ * This ensures that the sliding window always stays at 3 months
1258
+ * but still allows future dates to be lazily rendered based on any min/max
1259
+ * constraints.
1260
+ */
1261
+ const min = minParts !== undefined && data.isAfter(minParts, monthsToRender[0]) ? minParts : monthsToRender[0];
1262
+ const max = maxParts !== undefined && data.isBefore(maxParts, lastMonth) ? maxParts : lastMonth;
1263
+ const result = data.getCombinedDateColumnData(locale, todayParts, min, max, this.parsedDayValues, this.parsedMonthValues);
1264
+ let items = result.items;
1265
+ const parts = result.parts;
1266
+ if (isDateEnabled) {
1267
+ items = items.map((itemObject, index$1) => {
1268
+ const referenceParts = parts[index$1];
1269
+ let disabled;
1270
+ try {
1271
+ /**
1272
+ * The `isDateEnabled` implementation is try-catch wrapped
1273
+ * to prevent exceptions in the user's function from
1274
+ * interrupting the calendar rendering.
1275
+ */
1276
+ disabled = !isDateEnabled(data.convertDataToISO(referenceParts));
1370
1277
  }
1371
- const { disabled, workingParts } = this;
1372
- const activePart = this.getActivePartsWithFallback();
1373
- return (index$1.h("ion-picker-column-internal", { class: "day-column", color: this.color, disabled: disabled, items: days, value: (_a = (workingParts.day !== null ? workingParts.day : this.defaultParts.day)) !== null && _a !== void 0 ? _a : undefined, onIonChange: (ev) => {
1374
- // TODO(FW-1823) Remove this when iOS 14 support is dropped.
1375
- // Due to a Safari 14 issue we need to destroy
1376
- // the scroll listener before we update state
1377
- // and trigger a re-render.
1378
- if (this.destroyCalendarListener) {
1379
- this.destroyCalendarListener();
1380
- }
1381
- this.setWorkingParts(Object.assign(Object.assign({}, workingParts), { day: ev.detail.value }));
1382
- this.setActiveParts(Object.assign(Object.assign({}, activePart), { day: ev.detail.value }));
1383
- // We can re-attach the scroll listener after
1384
- // the working parts have been updated.
1385
- this.initializeCalendarListener();
1386
- ev.stopPropagation();
1387
- } }));
1388
- }
1389
- renderMonthPickerColumn(months) {
1390
- if (months.length === 0) {
1391
- return [];
1278
+ catch (e) {
1279
+ index.printIonError('Exception thrown from provided `isDateEnabled` function. Please check your function and try again.', e);
1392
1280
  }
1393
- const { disabled, workingParts } = this;
1394
- const activePart = this.getActivePartsWithFallback();
1395
- return (index$1.h("ion-picker-column-internal", { class: "month-column", color: this.color, disabled: disabled, items: months, value: workingParts.month, onIonChange: (ev) => {
1396
- // TODO(FW-1823) Remove this when iOS 14 support is dropped.
1397
- // Due to a Safari 14 issue we need to destroy
1398
- // the scroll listener before we update state
1399
- // and trigger a re-render.
1400
- if (this.destroyCalendarListener) {
1401
- this.destroyCalendarListener();
1402
- }
1403
- this.setWorkingParts(Object.assign(Object.assign({}, workingParts), { month: ev.detail.value }));
1404
- this.setActiveParts(Object.assign(Object.assign({}, activePart), { month: ev.detail.value }));
1405
- // We can re-attach the scroll listener after
1406
- // the working parts have been updated.
1407
- this.initializeCalendarListener();
1408
- ev.stopPropagation();
1409
- } }));
1281
+ return Object.assign(Object.assign({}, itemObject), { disabled });
1282
+ });
1410
1283
  }
1411
- renderYearPickerColumn(years) {
1412
- if (years.length === 0) {
1413
- return [];
1284
+ /**
1285
+ * If we have selected a day already, then default the column
1286
+ * to that value. Otherwise, set it to the default date.
1287
+ */
1288
+ const todayString = workingParts.day !== null
1289
+ ? `${workingParts.year}-${workingParts.month}-${workingParts.day}`
1290
+ : `${defaultParts.year}-${defaultParts.month}-${defaultParts.day}`;
1291
+ return (index$1.h("ion-picker-column-internal", { class: "date-column", color: this.color, disabled: disabled, items: items, value: todayString, onIonChange: (ev) => {
1292
+ // TODO(FW-1823) Remove this when iOS 14 support is dropped.
1293
+ // Due to a Safari 14 issue we need to destroy
1294
+ // the scroll listener before we update state
1295
+ // and trigger a re-render.
1296
+ if (this.destroyCalendarListener) {
1297
+ this.destroyCalendarListener();
1414
1298
  }
1415
- const { disabled, workingParts } = this;
1416
- const activePart = this.getActivePartsWithFallback();
1417
- return (index$1.h("ion-picker-column-internal", { class: "year-column", color: this.color, disabled: disabled, items: years, value: workingParts.year, onIonChange: (ev) => {
1418
- // TODO(FW-1823) Remove this when iOS 14 support is dropped.
1419
- // Due to a Safari 14 issue we need to destroy
1420
- // the scroll listener before we update state
1421
- // and trigger a re-render.
1422
- if (this.destroyCalendarListener) {
1423
- this.destroyCalendarListener();
1424
- }
1425
- this.setWorkingParts(Object.assign(Object.assign({}, workingParts), { year: ev.detail.value }));
1426
- this.setActiveParts(Object.assign(Object.assign({}, activePart), { year: ev.detail.value }));
1427
- // We can re-attach the scroll listener after
1428
- // the working parts have been updated.
1429
- this.initializeCalendarListener();
1430
- ev.stopPropagation();
1431
- } }));
1432
- }
1433
- renderTimePickerColumns(forcePresentation) {
1434
- if (['date', 'month', 'month-year', 'year'].includes(forcePresentation)) {
1435
- return [];
1299
+ const { value } = ev.detail;
1300
+ const findPart = parts.find(({ month, day, year }) => value === `${year}-${month}-${day}`);
1301
+ this.setWorkingParts(Object.assign(Object.assign({}, workingParts), findPart));
1302
+ this.setActiveParts(Object.assign(Object.assign({}, activePart), findPart));
1303
+ // We can re-attach the scroll listener after
1304
+ // the working parts have been updated.
1305
+ this.initializeCalendarListener();
1306
+ ev.stopPropagation();
1307
+ } }));
1308
+ }
1309
+ renderIndividualDatePickerColumns(forcePresentation) {
1310
+ const { workingParts, isDateEnabled } = this;
1311
+ const shouldRenderMonths = forcePresentation !== 'year' && forcePresentation !== 'time';
1312
+ const months = shouldRenderMonths
1313
+ ? data.getMonthColumnData(this.locale, workingParts, this.minParts, this.maxParts, this.parsedMonthValues)
1314
+ : [];
1315
+ const shouldRenderDays = forcePresentation === 'date';
1316
+ let days = shouldRenderDays
1317
+ ? data.getDayColumnData(this.locale, workingParts, this.minParts, this.maxParts, this.parsedDayValues)
1318
+ : [];
1319
+ if (isDateEnabled) {
1320
+ days = days.map((dayObject) => {
1321
+ const { value } = dayObject;
1322
+ const valueNum = typeof value === 'string' ? parseInt(value) : value;
1323
+ const referenceParts = {
1324
+ month: workingParts.month,
1325
+ day: valueNum,
1326
+ year: workingParts.year,
1327
+ };
1328
+ let disabled;
1329
+ try {
1330
+ /**
1331
+ * The `isDateEnabled` implementation is try-catch wrapped
1332
+ * to prevent exceptions in the user's function from
1333
+ * interrupting the calendar rendering.
1334
+ */
1335
+ disabled = !isDateEnabled(data.convertDataToISO(referenceParts));
1436
1336
  }
1437
- /**
1438
- * If a user has not selected a date,
1439
- * then we should show all times. If the
1440
- * user has selected a date (even if it has
1441
- * not been confirmed yet), we should apply
1442
- * the max and min restrictions so that the
1443
- * time picker shows values that are
1444
- * appropriate for the selected date.
1445
- */
1446
- const activePart = this.getActivePart();
1447
- const userHasSelectedDate = activePart !== undefined;
1448
- const { hoursData, minutesData, dayPeriodData } = data.getTimeColumnsData(this.locale, this.workingParts, this.hourCycle, userHasSelectedDate ? this.minParts : undefined, userHasSelectedDate ? this.maxParts : undefined, this.parsedHourValues, this.parsedMinuteValues);
1449
- return [
1450
- this.renderHourPickerColumn(hoursData),
1451
- this.renderMinutePickerColumn(minutesData),
1452
- this.renderDayPeriodPickerColumn(dayPeriodData),
1453
- ];
1454
- }
1455
- renderHourPickerColumn(hoursData) {
1456
- const { disabled, workingParts } = this;
1457
- if (hoursData.length === 0)
1458
- return [];
1459
- const activePart = this.getActivePartsWithFallback();
1460
- return (index$1.h("ion-picker-column-internal", { color: this.color, disabled: disabled, value: activePart.hour, items: hoursData, numericInput: true, onIonChange: (ev) => {
1461
- this.setWorkingParts(Object.assign(Object.assign({}, workingParts), { hour: ev.detail.value }));
1462
- this.setActiveParts(Object.assign(Object.assign({}, activePart), { hour: ev.detail.value }));
1463
- ev.stopPropagation();
1464
- } }));
1465
- }
1466
- renderMinutePickerColumn(minutesData) {
1467
- const { disabled, workingParts } = this;
1468
- if (minutesData.length === 0)
1469
- return [];
1470
- const activePart = this.getActivePartsWithFallback();
1471
- return (index$1.h("ion-picker-column-internal", { color: this.color, disabled: disabled, value: activePart.minute, items: minutesData, numericInput: true, onIonChange: (ev) => {
1472
- this.setWorkingParts(Object.assign(Object.assign({}, workingParts), { minute: ev.detail.value }));
1473
- this.setActiveParts(Object.assign(Object.assign({}, activePart), { minute: ev.detail.value }));
1474
- ev.stopPropagation();
1475
- } }));
1476
- }
1477
- renderDayPeriodPickerColumn(dayPeriodData) {
1478
- const { disabled, workingParts } = this;
1479
- if (dayPeriodData.length === 0) {
1480
- return [];
1337
+ catch (e) {
1338
+ index.printIonError('Exception thrown from provided `isDateEnabled` function. Please check your function and try again.', e);
1481
1339
  }
1482
- const activePart = this.getActivePartsWithFallback();
1483
- const isDayPeriodRTL = data.isLocaleDayPeriodRTL(this.locale);
1484
- return (index$1.h("ion-picker-column-internal", { style: isDayPeriodRTL ? { order: '-1' } : {}, color: this.color, disabled: disabled, value: activePart.ampm, items: dayPeriodData, onIonChange: (ev) => {
1485
- const hour = data.calculateHourFromAMPM(workingParts, ev.detail.value);
1486
- this.setWorkingParts(Object.assign(Object.assign({}, workingParts), { ampm: ev.detail.value, hour }));
1487
- this.setActiveParts(Object.assign(Object.assign({}, activePart), { ampm: ev.detail.value, hour }));
1488
- ev.stopPropagation();
1489
- } }));
1490
- }
1491
- renderWheelView(forcePresentation) {
1492
- const { locale } = this;
1493
- const showMonthFirst = data.isMonthFirstLocale(locale);
1494
- const columnOrder = showMonthFirst ? 'month-first' : 'year-first';
1495
- return (index$1.h("div", { class: {
1496
- [`wheel-order-${columnOrder}`]: true,
1497
- } }, this.renderWheelPicker(forcePresentation)));
1340
+ return Object.assign(Object.assign({}, dayObject), { disabled });
1341
+ });
1498
1342
  }
1343
+ const shouldRenderYears = forcePresentation !== 'month' && forcePresentation !== 'time';
1344
+ const years = shouldRenderYears
1345
+ ? data.getYearColumnData(this.locale, this.defaultParts, this.minParts, this.maxParts, this.parsedYearValues)
1346
+ : [];
1499
1347
  /**
1500
- * Grid Render Methods
1348
+ * Certain locales show the day before the month.
1501
1349
  */
1502
- renderCalendarHeader(mode) {
1503
- const { disabled } = this;
1504
- const expandedIcon = mode === 'ios' ? index$2.chevronDown : index$2.caretUpSharp;
1505
- const collapsedIcon = mode === 'ios' ? index$2.chevronForward : index$2.caretDownSharp;
1506
- const prevMonthDisabled = disabled || isPrevMonthDisabled(this.workingParts, this.minParts, this.maxParts);
1507
- const nextMonthDisabled = disabled || isNextMonthDisabled(this.workingParts, this.maxParts);
1508
- // don't use the inheritAttributes util because it removes dir from the host, and we still need that
1509
- const hostDir = this.el.getAttribute('dir') || undefined;
1510
- return (index$1.h("div", { class: "calendar-header" }, index$1.h("div", { class: "calendar-action-buttons" }, index$1.h("div", { class: "calendar-month-year" }, index$1.h("ion-item", { part: "month-year-button", ref: (el) => (this.monthYearToggleItemRef = el), button: true, "aria-label": "Show year picker", detail: false, lines: "none", disabled: disabled, onClick: () => {
1511
- var _a;
1512
- this.toggleMonthAndYearView();
1513
- /**
1514
- * TODO: FW-3547
1515
- *
1516
- * Currently there is not a way to set the aria-label on the inner button
1517
- * on the `ion-item` and have it be reactive to changes. This is a workaround
1518
- * until we either refactor `ion-item` to a button or Stencil adds a way to
1519
- * have reactive props for built-in properties, such as `aria-label`.
1520
- */
1521
- const { monthYearToggleItemRef } = this;
1522
- if (monthYearToggleItemRef) {
1523
- const btn = (_a = monthYearToggleItemRef.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector('.item-native');
1524
- if (btn) {
1525
- const monthYearAriaLabel = this.showMonthAndYear ? 'Hide year picker' : 'Show year picker';
1526
- btn.setAttribute('aria-label', monthYearAriaLabel);
1527
- }
1528
- }
1529
- } }, index$1.h("ion-label", null, data.getMonthAndYear(this.locale, this.workingParts), index$1.h("ion-icon", { "aria-hidden": "true", icon: this.showMonthAndYear ? expandedIcon : collapsedIcon, lazy: false, flipRtl: true })))), index$1.h("div", { class: "calendar-next-prev" }, index$1.h("ion-buttons", null, index$1.h("ion-button", { "aria-label": "Previous month", disabled: prevMonthDisabled, onClick: () => this.prevMonth() }, index$1.h("ion-icon", { dir: hostDir, "aria-hidden": "true", slot: "icon-only", icon: index$2.chevronBack, lazy: false, flipRtl: true })), index$1.h("ion-button", { "aria-label": "Next month", disabled: nextMonthDisabled, onClick: () => this.nextMonth() }, index$1.h("ion-icon", { dir: hostDir, "aria-hidden": "true", slot: "icon-only", icon: index$2.chevronForward, lazy: false, flipRtl: true }))))), index$1.h("div", { class: "calendar-days-of-week", "aria-hidden": "true" }, data.getDaysOfWeek(this.locale, mode, this.firstDayOfWeek % 7).map((d) => {
1530
- return index$1.h("div", { class: "day-of-week" }, d);
1531
- }))));
1350
+ const showMonthFirst = data.isMonthFirstLocale(this.locale, { month: 'numeric', day: 'numeric' });
1351
+ let renderArray = [];
1352
+ if (showMonthFirst) {
1353
+ renderArray = [
1354
+ this.renderMonthPickerColumn(months),
1355
+ this.renderDayPickerColumn(days),
1356
+ this.renderYearPickerColumn(years),
1357
+ ];
1532
1358
  }
1533
- renderMonth(month, year) {
1534
- const { disabled, readonly } = this;
1535
- const yearAllowed = this.parsedYearValues === undefined || this.parsedYearValues.includes(year);
1536
- const monthAllowed = this.parsedMonthValues === undefined || this.parsedMonthValues.includes(month);
1537
- const isCalMonthDisabled = !yearAllowed || !monthAllowed;
1538
- const isDatetimeDisabled = disabled || readonly;
1539
- const swipeDisabled = disabled ||
1540
- isMonthDisabled({
1541
- month,
1542
- year,
1543
- day: null,
1544
- }, {
1545
- // The day is not used when checking if a month is disabled.
1546
- // Users should be able to access the min or max month, even if the
1547
- // min/max date is out of bounds (e.g. min is set to Feb 15, Feb should not be disabled).
1548
- minParts: Object.assign(Object.assign({}, this.minParts), { day: null }),
1549
- maxParts: Object.assign(Object.assign({}, this.maxParts), { day: null }),
1550
- });
1551
- // The working month should never have swipe disabled.
1552
- // Otherwise the CSS scroll snap will not work and the user
1553
- // can free-scroll the calendar.
1554
- const isWorkingMonth = this.workingParts.month === month && this.workingParts.year === year;
1555
- const activePart = this.getActivePartsWithFallback();
1556
- return (index$1.h("div", { "aria-hidden": !isWorkingMonth ? 'true' : null, class: {
1557
- 'calendar-month': true,
1558
- // Prevents scroll snap swipe gestures for months outside of the min/max bounds
1559
- 'calendar-month-disabled': !isWorkingMonth && swipeDisabled,
1560
- } }, index$1.h("div", { class: "calendar-month-grid" }, data.getDaysOfMonth(month, year, this.firstDayOfWeek % 7).map((dateObject, index$2) => {
1561
- const { day, dayOfWeek } = dateObject;
1562
- const { el, highlightedDates, isDateEnabled, multiple } = this;
1563
- const referenceParts = { month, day, year };
1564
- const isCalendarPadding = day === null;
1565
- const { isActive, isToday, ariaLabel, ariaSelected, disabled: isDayDisabled, text, } = getCalendarDayState(this.locale, referenceParts, this.activeParts, this.todayParts, this.minParts, this.maxParts, this.parsedDayValues);
1566
- const dateIsoString = data.convertDataToISO(referenceParts);
1567
- let isCalDayDisabled = isCalMonthDisabled || isDayDisabled;
1568
- if (!isCalDayDisabled && isDateEnabled !== undefined) {
1569
- try {
1570
- /**
1571
- * The `isDateEnabled` implementation is try-catch wrapped
1572
- * to prevent exceptions in the user's function from
1573
- * interrupting the calendar rendering.
1574
- */
1575
- isCalDayDisabled = !isDateEnabled(dateIsoString);
1576
- }
1577
- catch (e) {
1578
- index.printIonError('Exception thrown from provided `isDateEnabled` function. Please check your function and try again.', el, e);
1579
- }
1580
- }
1581
- /**
1582
- * Some days are constrained through max & min or allowed dates
1583
- * and also disabled because the component is readonly or disabled.
1584
- * These need to be displayed differently.
1585
- */
1586
- const isCalDayConstrained = isCalDayDisabled && isDatetimeDisabled;
1587
- const isButtonDisabled = isCalDayDisabled || isDatetimeDisabled;
1588
- let dateStyle = undefined;
1589
- /**
1590
- * Custom highlight styles should not override the style for selected dates,
1591
- * nor apply to "filler days" at the start of the grid.
1592
- */
1593
- if (highlightedDates !== undefined && !isActive && day !== null) {
1594
- dateStyle = getHighlightStyles(highlightedDates, dateIsoString, el);
1595
- }
1596
- let dateParts = undefined;
1597
- // "Filler days" at the beginning of the grid should not get the calendar day
1598
- // CSS parts added to them
1599
- if (!isCalendarPadding) {
1600
- dateParts = `calendar-day${isActive ? ' active' : ''}${isToday ? ' today' : ''}${isCalDayDisabled ? ' disabled' : ''}`;
1601
- }
1602
- return (index$1.h("div", { class: "calendar-day-wrapper" }, index$1.h("button", {
1603
- // We need to use !important for the inline styles here because
1604
- // otherwise the CSS shadow parts will override these styles.
1605
- // See https://github.com/WICG/webcomponents/issues/847
1606
- // Both the CSS shadow parts and highlightedDates styles are
1607
- // provided by the developer, but highlightedDates styles should
1608
- // always take priority.
1609
- ref: (el) => {
1610
- if (el) {
1611
- el.style.setProperty('color', `${dateStyle ? dateStyle.textColor : ''}`, 'important');
1612
- el.style.setProperty('background-color', `${dateStyle ? dateStyle.backgroundColor : ''}`, 'important');
1613
- }
1614
- }, tabindex: "-1", "data-day": day, "data-month": month, "data-year": year, "data-index": index$2, "data-day-of-week": dayOfWeek, disabled: isButtonDisabled, class: {
1615
- 'calendar-day-padding': isCalendarPadding,
1616
- 'calendar-day': true,
1617
- 'calendar-day-active': isActive,
1618
- 'calendar-day-constrained': isCalDayConstrained,
1619
- 'calendar-day-today': isToday,
1620
- }, part: dateParts, "aria-hidden": isCalendarPadding ? 'true' : null, "aria-selected": ariaSelected, "aria-label": ariaLabel, onClick: () => {
1621
- if (isCalendarPadding) {
1622
- return;
1623
- }
1624
- this.setWorkingParts(Object.assign(Object.assign({}, this.workingParts), { month,
1625
- day,
1626
- year }));
1627
- // multiple only needs date info, so we can wipe out other fields like time
1628
- if (multiple) {
1629
- this.setActiveParts({
1630
- month,
1631
- day,
1632
- year,
1633
- }, isActive);
1634
- }
1635
- else {
1636
- this.setActiveParts(Object.assign(Object.assign({}, activePart), { month,
1637
- day,
1638
- year }));
1639
- }
1640
- }
1641
- }, text)));
1642
- }))));
1359
+ else {
1360
+ renderArray = [
1361
+ this.renderDayPickerColumn(days),
1362
+ this.renderMonthPickerColumn(months),
1363
+ this.renderYearPickerColumn(years),
1364
+ ];
1643
1365
  }
1644
- renderCalendarBody() {
1645
- return (index$1.h("div", { class: "calendar-body ion-focusable", ref: (el) => (this.calendarBodyRef = el), tabindex: "0" }, data.generateMonths(this.workingParts, this.forceRenderDate).map(({ month, year }) => {
1646
- return this.renderMonth(month, year);
1647
- })));
1366
+ return renderArray;
1367
+ }
1368
+ renderDayPickerColumn(days) {
1369
+ var _a;
1370
+ if (days.length === 0) {
1371
+ return [];
1648
1372
  }
1649
- renderCalendar(mode) {
1650
- return (index$1.h("div", { class: "datetime-calendar", key: "datetime-calendar" }, this.renderCalendarHeader(mode), this.renderCalendarBody()));
1373
+ const { disabled, workingParts } = this;
1374
+ const activePart = this.getActivePartsWithFallback();
1375
+ return (index$1.h("ion-picker-column-internal", { class: "day-column", color: this.color, disabled: disabled, items: days, value: (_a = (workingParts.day !== null ? workingParts.day : this.defaultParts.day)) !== null && _a !== void 0 ? _a : undefined, onIonChange: (ev) => {
1376
+ // TODO(FW-1823) Remove this when iOS 14 support is dropped.
1377
+ // Due to a Safari 14 issue we need to destroy
1378
+ // the scroll listener before we update state
1379
+ // and trigger a re-render.
1380
+ if (this.destroyCalendarListener) {
1381
+ this.destroyCalendarListener();
1382
+ }
1383
+ this.setWorkingParts(Object.assign(Object.assign({}, workingParts), { day: ev.detail.value }));
1384
+ this.setActiveParts(Object.assign(Object.assign({}, activePart), { day: ev.detail.value }));
1385
+ // We can re-attach the scroll listener after
1386
+ // the working parts have been updated.
1387
+ this.initializeCalendarListener();
1388
+ ev.stopPropagation();
1389
+ } }));
1390
+ }
1391
+ renderMonthPickerColumn(months) {
1392
+ if (months.length === 0) {
1393
+ return [];
1651
1394
  }
1652
- renderTimeLabel() {
1653
- const hasSlottedTimeLabel = this.el.querySelector('[slot="time-label"]') !== null;
1654
- if (!hasSlottedTimeLabel && !this.showDefaultTimeLabel) {
1655
- return;
1395
+ const { disabled, workingParts } = this;
1396
+ const activePart = this.getActivePartsWithFallback();
1397
+ return (index$1.h("ion-picker-column-internal", { class: "month-column", color: this.color, disabled: disabled, items: months, value: workingParts.month, onIonChange: (ev) => {
1398
+ // TODO(FW-1823) Remove this when iOS 14 support is dropped.
1399
+ // Due to a Safari 14 issue we need to destroy
1400
+ // the scroll listener before we update state
1401
+ // and trigger a re-render.
1402
+ if (this.destroyCalendarListener) {
1403
+ this.destroyCalendarListener();
1656
1404
  }
1657
- return index$1.h("slot", { name: "time-label" }, "Time");
1405
+ this.setWorkingParts(Object.assign(Object.assign({}, workingParts), { month: ev.detail.value }));
1406
+ this.setActiveParts(Object.assign(Object.assign({}, activePart), { month: ev.detail.value }));
1407
+ // We can re-attach the scroll listener after
1408
+ // the working parts have been updated.
1409
+ this.initializeCalendarListener();
1410
+ ev.stopPropagation();
1411
+ } }));
1412
+ }
1413
+ renderYearPickerColumn(years) {
1414
+ if (years.length === 0) {
1415
+ return [];
1658
1416
  }
1659
- renderTimeOverlay() {
1660
- const { disabled, hourCycle, isTimePopoverOpen, locale, formatOptions } = this;
1661
- const computedHourCycle = data.getHourCycle(locale, hourCycle);
1662
- const activePart = this.getActivePartsWithFallback();
1663
- return [
1664
- index$1.h("div", { class: "time-header" }, this.renderTimeLabel()),
1665
- index$1.h("button", { class: {
1666
- 'time-body': true,
1667
- 'time-body-active': isTimePopoverOpen,
1668
- }, part: `time-button${isTimePopoverOpen ? ' active' : ''}`, "aria-expanded": "false", "aria-haspopup": "true", disabled: disabled, onClick: async (ev) => {
1669
- const { popoverRef } = this;
1670
- if (popoverRef) {
1671
- this.isTimePopoverOpen = true;
1672
- popoverRef.present(new CustomEvent('ionShadowTarget', {
1673
- detail: {
1674
- ionShadowTarget: ev.target,
1675
- },
1676
- }));
1677
- await popoverRef.onWillDismiss();
1678
- this.isTimePopoverOpen = false;
1679
- }
1680
- } }, data.getLocalizedTime(locale, activePart, computedHourCycle, formatOptions === null || formatOptions === void 0 ? void 0 : formatOptions.time)),
1681
- index$1.h("ion-popover", { alignment: "center", translucent: true, overlayIndex: 1, arrow: false, onWillPresent: (ev) => {
1682
- /**
1683
- * Intersection Observers do not consistently fire between Blink and Webkit
1684
- * when toggling the visibility of the popover and trying to scroll the picker
1685
- * column to the correct time value.
1686
- *
1687
- * This will correctly scroll the element position to the correct time value,
1688
- * before the popover is fully presented.
1689
- */
1690
- const cols = ev.target.querySelectorAll('ion-picker-column-internal');
1691
- // TODO (FW-615): Potentially remove this when intersection observers are fixed in picker column
1692
- cols.forEach((col) => col.scrollActiveItemIntoView());
1693
- }, style: {
1694
- '--offset-y': '-10px',
1695
- '--min-width': 'fit-content',
1696
- },
1697
- // Allow native browser keyboard events to support up/down/home/end key
1698
- // navigation within the time picker.
1699
- keyboardEvents: true, ref: (el) => (this.popoverRef = el) }, this.renderWheelPicker('time')),
1700
- ];
1417
+ const { disabled, workingParts } = this;
1418
+ const activePart = this.getActivePartsWithFallback();
1419
+ return (index$1.h("ion-picker-column-internal", { class: "year-column", color: this.color, disabled: disabled, items: years, value: workingParts.year, onIonChange: (ev) => {
1420
+ // TODO(FW-1823) Remove this when iOS 14 support is dropped.
1421
+ // Due to a Safari 14 issue we need to destroy
1422
+ // the scroll listener before we update state
1423
+ // and trigger a re-render.
1424
+ if (this.destroyCalendarListener) {
1425
+ this.destroyCalendarListener();
1426
+ }
1427
+ this.setWorkingParts(Object.assign(Object.assign({}, workingParts), { year: ev.detail.value }));
1428
+ this.setActiveParts(Object.assign(Object.assign({}, activePart), { year: ev.detail.value }));
1429
+ // We can re-attach the scroll listener after
1430
+ // the working parts have been updated.
1431
+ this.initializeCalendarListener();
1432
+ ev.stopPropagation();
1433
+ } }));
1434
+ }
1435
+ renderTimePickerColumns(forcePresentation) {
1436
+ if (['date', 'month', 'month-year', 'year'].includes(forcePresentation)) {
1437
+ return [];
1701
1438
  }
1702
- getHeaderSelectedDateText() {
1439
+ /**
1440
+ * If a user has not selected a date,
1441
+ * then we should show all times. If the
1442
+ * user has selected a date (even if it has
1443
+ * not been confirmed yet), we should apply
1444
+ * the max and min restrictions so that the
1445
+ * time picker shows values that are
1446
+ * appropriate for the selected date.
1447
+ */
1448
+ const activePart = this.getActivePart();
1449
+ const userHasSelectedDate = activePart !== undefined;
1450
+ const { hoursData, minutesData, dayPeriodData } = data.getTimeColumnsData(this.locale, this.workingParts, this.hourCycle, userHasSelectedDate ? this.minParts : undefined, userHasSelectedDate ? this.maxParts : undefined, this.parsedHourValues, this.parsedMinuteValues);
1451
+ return [
1452
+ this.renderHourPickerColumn(hoursData),
1453
+ this.renderMinutePickerColumn(minutesData),
1454
+ this.renderDayPeriodPickerColumn(dayPeriodData),
1455
+ ];
1456
+ }
1457
+ renderHourPickerColumn(hoursData) {
1458
+ const { disabled, workingParts } = this;
1459
+ if (hoursData.length === 0)
1460
+ return [];
1461
+ const activePart = this.getActivePartsWithFallback();
1462
+ return (index$1.h("ion-picker-column-internal", { color: this.color, disabled: disabled, value: activePart.hour, items: hoursData, numericInput: true, onIonChange: (ev) => {
1463
+ this.setWorkingParts(Object.assign(Object.assign({}, workingParts), { hour: ev.detail.value }));
1464
+ this.setActiveParts(Object.assign(Object.assign({}, activePart), { hour: ev.detail.value }));
1465
+ ev.stopPropagation();
1466
+ } }));
1467
+ }
1468
+ renderMinutePickerColumn(minutesData) {
1469
+ const { disabled, workingParts } = this;
1470
+ if (minutesData.length === 0)
1471
+ return [];
1472
+ const activePart = this.getActivePartsWithFallback();
1473
+ return (index$1.h("ion-picker-column-internal", { color: this.color, disabled: disabled, value: activePart.minute, items: minutesData, numericInput: true, onIonChange: (ev) => {
1474
+ this.setWorkingParts(Object.assign(Object.assign({}, workingParts), { minute: ev.detail.value }));
1475
+ this.setActiveParts(Object.assign(Object.assign({}, activePart), { minute: ev.detail.value }));
1476
+ ev.stopPropagation();
1477
+ } }));
1478
+ }
1479
+ renderDayPeriodPickerColumn(dayPeriodData) {
1480
+ const { disabled, workingParts } = this;
1481
+ if (dayPeriodData.length === 0) {
1482
+ return [];
1483
+ }
1484
+ const activePart = this.getActivePartsWithFallback();
1485
+ const isDayPeriodRTL = data.isLocaleDayPeriodRTL(this.locale);
1486
+ return (index$1.h("ion-picker-column-internal", { style: isDayPeriodRTL ? { order: '-1' } : {}, color: this.color, disabled: disabled, value: activePart.ampm, items: dayPeriodData, onIonChange: (ev) => {
1487
+ const hour = data.calculateHourFromAMPM(workingParts, ev.detail.value);
1488
+ this.setWorkingParts(Object.assign(Object.assign({}, workingParts), { ampm: ev.detail.value, hour }));
1489
+ this.setActiveParts(Object.assign(Object.assign({}, activePart), { ampm: ev.detail.value, hour }));
1490
+ ev.stopPropagation();
1491
+ } }));
1492
+ }
1493
+ renderWheelView(forcePresentation) {
1494
+ const { locale } = this;
1495
+ const showMonthFirst = data.isMonthFirstLocale(locale);
1496
+ const columnOrder = showMonthFirst ? 'month-first' : 'year-first';
1497
+ return (index$1.h("div", { class: {
1498
+ [`wheel-order-${columnOrder}`]: true,
1499
+ } }, this.renderWheelPicker(forcePresentation)));
1500
+ }
1501
+ /**
1502
+ * Grid Render Methods
1503
+ */
1504
+ renderCalendarHeader(mode) {
1505
+ const { disabled } = this;
1506
+ const expandedIcon = mode === 'ios' ? index$2.chevronDown : index$2.caretUpSharp;
1507
+ const collapsedIcon = mode === 'ios' ? index$2.chevronForward : index$2.caretDownSharp;
1508
+ const prevMonthDisabled = disabled || isPrevMonthDisabled(this.workingParts, this.minParts, this.maxParts);
1509
+ const nextMonthDisabled = disabled || isNextMonthDisabled(this.workingParts, this.maxParts);
1510
+ // don't use the inheritAttributes util because it removes dir from the host, and we still need that
1511
+ const hostDir = this.el.getAttribute('dir') || undefined;
1512
+ return (index$1.h("div", { class: "calendar-header" }, index$1.h("div", { class: "calendar-action-buttons" }, index$1.h("div", { class: "calendar-month-year" }, index$1.h("ion-item", { part: "month-year-button", ref: (el) => (this.monthYearToggleItemRef = el), button: true, "aria-label": "Show year picker", detail: false, lines: "none", disabled: disabled, onClick: () => {
1703
1513
  var _a;
1704
- const { activeParts, formatOptions, multiple, titleSelectedDatesFormatter } = this;
1705
- const isArray = Array.isArray(activeParts);
1706
- let headerText;
1707
- if (multiple && isArray && activeParts.length !== 1) {
1708
- headerText = `${activeParts.length} days`; // default/fallback for multiple selection
1709
- if (titleSelectedDatesFormatter !== undefined) {
1710
- try {
1711
- headerText = titleSelectedDatesFormatter(data.convertDataToISO(activeParts));
1712
- }
1713
- catch (e) {
1714
- index.printIonError('Exception in provided `titleSelectedDatesFormatter`: ', e);
1715
- }
1716
- }
1514
+ this.toggleMonthAndYearView();
1515
+ /**
1516
+ * TODO: FW-3547
1517
+ *
1518
+ * Currently there is not a way to set the aria-label on the inner button
1519
+ * on the `ion-item` and have it be reactive to changes. This is a workaround
1520
+ * until we either refactor `ion-item` to a button or Stencil adds a way to
1521
+ * have reactive props for built-in properties, such as `aria-label`.
1522
+ */
1523
+ const { monthYearToggleItemRef } = this;
1524
+ if (monthYearToggleItemRef) {
1525
+ const btn = (_a = monthYearToggleItemRef.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector('.item-native');
1526
+ if (btn) {
1527
+ const monthYearAriaLabel = this.showMonthAndYear ? 'Hide year picker' : 'Show year picker';
1528
+ btn.setAttribute('aria-label', monthYearAriaLabel);
1529
+ }
1717
1530
  }
1718
- else {
1719
- // for exactly 1 day selected (multiple set or not), show a formatted version of that
1720
- headerText = data.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' });
1531
+ } }, index$1.h("ion-label", null, data.getMonthAndYear(this.locale, this.workingParts), index$1.h("ion-icon", { "aria-hidden": "true", icon: this.showMonthAndYear ? expandedIcon : collapsedIcon, lazy: false, flipRtl: true })))), index$1.h("div", { class: "calendar-next-prev" }, index$1.h("ion-buttons", null, index$1.h("ion-button", { "aria-label": "Previous month", disabled: prevMonthDisabled, onClick: () => this.prevMonth() }, index$1.h("ion-icon", { dir: hostDir, "aria-hidden": "true", slot: "icon-only", icon: index$2.chevronBack, lazy: false, flipRtl: true })), index$1.h("ion-button", { "aria-label": "Next month", disabled: nextMonthDisabled, onClick: () => this.nextMonth() }, index$1.h("ion-icon", { dir: hostDir, "aria-hidden": "true", slot: "icon-only", icon: index$2.chevronForward, lazy: false, flipRtl: true }))))), index$1.h("div", { class: "calendar-days-of-week", "aria-hidden": "true" }, data.getDaysOfWeek(this.locale, mode, this.firstDayOfWeek % 7).map((d) => {
1532
+ return index$1.h("div", { class: "day-of-week" }, d);
1533
+ }))));
1534
+ }
1535
+ renderMonth(month, year) {
1536
+ const { disabled, readonly } = this;
1537
+ const yearAllowed = this.parsedYearValues === undefined || this.parsedYearValues.includes(year);
1538
+ const monthAllowed = this.parsedMonthValues === undefined || this.parsedMonthValues.includes(month);
1539
+ const isCalMonthDisabled = !yearAllowed || !monthAllowed;
1540
+ const isDatetimeDisabled = disabled || readonly;
1541
+ const swipeDisabled = disabled ||
1542
+ isMonthDisabled({
1543
+ month,
1544
+ year,
1545
+ day: null,
1546
+ }, {
1547
+ // The day is not used when checking if a month is disabled.
1548
+ // Users should be able to access the min or max month, even if the
1549
+ // min/max date is out of bounds (e.g. min is set to Feb 15, Feb should not be disabled).
1550
+ minParts: Object.assign(Object.assign({}, this.minParts), { day: null }),
1551
+ maxParts: Object.assign(Object.assign({}, this.maxParts), { day: null }),
1552
+ });
1553
+ // The working month should never have swipe disabled.
1554
+ // Otherwise the CSS scroll snap will not work and the user
1555
+ // can free-scroll the calendar.
1556
+ const isWorkingMonth = this.workingParts.month === month && this.workingParts.year === year;
1557
+ const activePart = this.getActivePartsWithFallback();
1558
+ return (index$1.h("div", { "aria-hidden": !isWorkingMonth ? 'true' : null, class: {
1559
+ 'calendar-month': true,
1560
+ // Prevents scroll snap swipe gestures for months outside of the min/max bounds
1561
+ 'calendar-month-disabled': !isWorkingMonth && swipeDisabled,
1562
+ } }, index$1.h("div", { class: "calendar-month-grid" }, data.getDaysOfMonth(month, year, this.firstDayOfWeek % 7).map((dateObject, index$2) => {
1563
+ const { day, dayOfWeek } = dateObject;
1564
+ const { el, highlightedDates, isDateEnabled, multiple } = this;
1565
+ const referenceParts = { month, day, year };
1566
+ const isCalendarPadding = day === null;
1567
+ const { isActive, isToday, ariaLabel, ariaSelected, disabled: isDayDisabled, text, } = getCalendarDayState(this.locale, referenceParts, this.activeParts, this.todayParts, this.minParts, this.maxParts, this.parsedDayValues);
1568
+ const dateIsoString = data.convertDataToISO(referenceParts);
1569
+ let isCalDayDisabled = isCalMonthDisabled || isDayDisabled;
1570
+ if (!isCalDayDisabled && isDateEnabled !== undefined) {
1571
+ try {
1572
+ /**
1573
+ * The `isDateEnabled` implementation is try-catch wrapped
1574
+ * to prevent exceptions in the user's function from
1575
+ * interrupting the calendar rendering.
1576
+ */
1577
+ isCalDayDisabled = !isDateEnabled(dateIsoString);
1721
1578
  }
1722
- return headerText;
1723
- }
1724
- renderHeader(showExpandedHeader = true) {
1725
- const hasSlottedTitle = this.el.querySelector('[slot="title"]') !== null;
1726
- if (!hasSlottedTitle && !this.showDefaultTitle) {
1579
+ catch (e) {
1580
+ index.printIonError('Exception thrown from provided `isDateEnabled` function. Please check your function and try again.', el, e);
1581
+ }
1582
+ }
1583
+ /**
1584
+ * Some days are constrained through max & min or allowed dates
1585
+ * and also disabled because the component is readonly or disabled.
1586
+ * These need to be displayed differently.
1587
+ */
1588
+ const isCalDayConstrained = isCalDayDisabled && isDatetimeDisabled;
1589
+ const isButtonDisabled = isCalDayDisabled || isDatetimeDisabled;
1590
+ let dateStyle = undefined;
1591
+ /**
1592
+ * Custom highlight styles should not override the style for selected dates,
1593
+ * nor apply to "filler days" at the start of the grid.
1594
+ */
1595
+ if (highlightedDates !== undefined && !isActive && day !== null) {
1596
+ dateStyle = getHighlightStyles(highlightedDates, dateIsoString, el);
1597
+ }
1598
+ let dateParts = undefined;
1599
+ // "Filler days" at the beginning of the grid should not get the calendar day
1600
+ // CSS parts added to them
1601
+ if (!isCalendarPadding) {
1602
+ dateParts = `calendar-day${isActive ? ' active' : ''}${isToday ? ' today' : ''}${isCalDayDisabled ? ' disabled' : ''}`;
1603
+ }
1604
+ return (index$1.h("div", { class: "calendar-day-wrapper" }, index$1.h("button", {
1605
+ // We need to use !important for the inline styles here because
1606
+ // otherwise the CSS shadow parts will override these styles.
1607
+ // See https://github.com/WICG/webcomponents/issues/847
1608
+ // Both the CSS shadow parts and highlightedDates styles are
1609
+ // provided by the developer, but highlightedDates styles should
1610
+ // always take priority.
1611
+ ref: (el) => {
1612
+ if (el) {
1613
+ el.style.setProperty('color', `${dateStyle ? dateStyle.textColor : ''}`, 'important');
1614
+ el.style.setProperty('background-color', `${dateStyle ? dateStyle.backgroundColor : ''}`, 'important');
1615
+ }
1616
+ }, tabindex: "-1", "data-day": day, "data-month": month, "data-year": year, "data-index": index$2, "data-day-of-week": dayOfWeek, disabled: isButtonDisabled, class: {
1617
+ 'calendar-day-padding': isCalendarPadding,
1618
+ 'calendar-day': true,
1619
+ 'calendar-day-active': isActive,
1620
+ 'calendar-day-constrained': isCalDayConstrained,
1621
+ 'calendar-day-today': isToday,
1622
+ }, part: dateParts, "aria-hidden": isCalendarPadding ? 'true' : null, "aria-selected": ariaSelected, "aria-label": ariaLabel, onClick: () => {
1623
+ if (isCalendarPadding) {
1727
1624
  return;
1625
+ }
1626
+ this.setWorkingParts(Object.assign(Object.assign({}, this.workingParts), { month,
1627
+ day,
1628
+ year }));
1629
+ // multiple only needs date info, so we can wipe out other fields like time
1630
+ if (multiple) {
1631
+ this.setActiveParts({
1632
+ month,
1633
+ day,
1634
+ year,
1635
+ }, isActive);
1636
+ }
1637
+ else {
1638
+ this.setActiveParts(Object.assign(Object.assign({}, activePart), { month,
1639
+ day,
1640
+ year }));
1641
+ }
1728
1642
  }
1729
- return (index$1.h("div", { class: "datetime-header" }, index$1.h("div", { class: "datetime-title" }, index$1.h("slot", { name: "title" }, "Select Date")), showExpandedHeader && index$1.h("div", { class: "datetime-selected-date" }, this.getHeaderSelectedDateText())));
1643
+ }, text)));
1644
+ }))));
1645
+ }
1646
+ renderCalendarBody() {
1647
+ return (index$1.h("div", { class: "calendar-body ion-focusable", ref: (el) => (this.calendarBodyRef = el), tabindex: "0" }, data.generateMonths(this.workingParts, this.forceRenderDate).map(({ month, year }) => {
1648
+ return this.renderMonth(month, year);
1649
+ })));
1650
+ }
1651
+ renderCalendar(mode) {
1652
+ return (index$1.h("div", { class: "datetime-calendar", key: "datetime-calendar" }, this.renderCalendarHeader(mode), this.renderCalendarBody()));
1653
+ }
1654
+ renderTimeLabel() {
1655
+ const hasSlottedTimeLabel = this.el.querySelector('[slot="time-label"]') !== null;
1656
+ if (!hasSlottedTimeLabel && !this.showDefaultTimeLabel) {
1657
+ return;
1730
1658
  }
1731
- /**
1732
- * Render time picker inside of datetime.
1733
- * Do not pass color prop to segment on
1734
- * iOS mode. MD segment has been customized and
1735
- * should take on the color prop, but iOS
1736
- * should just be the default segment.
1737
- */
1738
- renderTime() {
1739
- const { presentation } = this;
1740
- const timeOnlyPresentation = presentation === 'time';
1741
- return (index$1.h("div", { class: "datetime-time" }, timeOnlyPresentation ? this.renderWheelPicker() : this.renderTimeOverlay()));
1659
+ return index$1.h("slot", { name: "time-label" }, "Time");
1660
+ }
1661
+ renderTimeOverlay() {
1662
+ const { disabled, hourCycle, isTimePopoverOpen, locale, formatOptions } = this;
1663
+ const computedHourCycle = data.getHourCycle(locale, hourCycle);
1664
+ const activePart = this.getActivePartsWithFallback();
1665
+ return [
1666
+ index$1.h("div", { class: "time-header" }, this.renderTimeLabel()),
1667
+ index$1.h("button", { class: {
1668
+ 'time-body': true,
1669
+ 'time-body-active': isTimePopoverOpen,
1670
+ }, part: `time-button${isTimePopoverOpen ? ' active' : ''}`, "aria-expanded": "false", "aria-haspopup": "true", disabled: disabled, onClick: async (ev) => {
1671
+ const { popoverRef } = this;
1672
+ if (popoverRef) {
1673
+ this.isTimePopoverOpen = true;
1674
+ popoverRef.present(new CustomEvent('ionShadowTarget', {
1675
+ detail: {
1676
+ ionShadowTarget: ev.target,
1677
+ },
1678
+ }));
1679
+ await popoverRef.onWillDismiss();
1680
+ this.isTimePopoverOpen = false;
1681
+ }
1682
+ } }, data.getLocalizedTime(locale, activePart, computedHourCycle, formatOptions === null || formatOptions === void 0 ? void 0 : formatOptions.time)),
1683
+ index$1.h("ion-popover", { alignment: "center", translucent: true, overlayIndex: 1, arrow: false, onWillPresent: (ev) => {
1684
+ /**
1685
+ * Intersection Observers do not consistently fire between Blink and Webkit
1686
+ * when toggling the visibility of the popover and trying to scroll the picker
1687
+ * column to the correct time value.
1688
+ *
1689
+ * This will correctly scroll the element position to the correct time value,
1690
+ * before the popover is fully presented.
1691
+ */
1692
+ const cols = ev.target.querySelectorAll('ion-picker-column-internal');
1693
+ // TODO (FW-615): Potentially remove this when intersection observers are fixed in picker column
1694
+ cols.forEach((col) => col.scrollActiveItemIntoView());
1695
+ }, style: {
1696
+ '--offset-y': '-10px',
1697
+ '--min-width': 'fit-content',
1698
+ },
1699
+ // Allow native browser keyboard events to support up/down/home/end key
1700
+ // navigation within the time picker.
1701
+ keyboardEvents: true, ref: (el) => (this.popoverRef = el) }, this.renderWheelPicker('time')),
1702
+ ];
1703
+ }
1704
+ getHeaderSelectedDateText() {
1705
+ var _a;
1706
+ const { activeParts, formatOptions, multiple, titleSelectedDatesFormatter } = this;
1707
+ const isArray = Array.isArray(activeParts);
1708
+ let headerText;
1709
+ if (multiple && isArray && activeParts.length !== 1) {
1710
+ headerText = `${activeParts.length} days`; // default/fallback for multiple selection
1711
+ if (titleSelectedDatesFormatter !== undefined) {
1712
+ try {
1713
+ headerText = titleSelectedDatesFormatter(data.convertDataToISO(activeParts));
1714
+ }
1715
+ catch (e) {
1716
+ index.printIonError('Exception in provided `titleSelectedDatesFormatter`: ', e);
1717
+ }
1718
+ }
1742
1719
  }
1743
- /**
1744
- * Renders the month/year picker that is
1745
- * displayed on the calendar grid.
1746
- * The .datetime-year class has additional
1747
- * styles that let us show/hide the
1748
- * picker when the user clicks on the
1749
- * toggle in the calendar header.
1750
- */
1751
- renderCalendarViewMonthYearPicker() {
1752
- return index$1.h("div", { class: "datetime-year" }, this.renderWheelView('month-year'));
1720
+ else {
1721
+ // for exactly 1 day selected (multiple set or not), show a formatted version of that
1722
+ headerText = data.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' });
1753
1723
  }
1724
+ return headerText;
1725
+ }
1726
+ renderHeader(showExpandedHeader = true) {
1727
+ const hasSlottedTitle = this.el.querySelector('[slot="title"]') !== null;
1728
+ if (!hasSlottedTitle && !this.showDefaultTitle) {
1729
+ return;
1730
+ }
1731
+ return (index$1.h("div", { class: "datetime-header" }, index$1.h("div", { class: "datetime-title" }, index$1.h("slot", { name: "title" }, "Select Date")), showExpandedHeader && index$1.h("div", { class: "datetime-selected-date" }, this.getHeaderSelectedDateText())));
1732
+ }
1733
+ /**
1734
+ * Render time picker inside of datetime.
1735
+ * Do not pass color prop to segment on
1736
+ * iOS mode. MD segment has been customized and
1737
+ * should take on the color prop, but iOS
1738
+ * should just be the default segment.
1739
+ */
1740
+ renderTime() {
1741
+ const { presentation } = this;
1742
+ const timeOnlyPresentation = presentation === 'time';
1743
+ return (index$1.h("div", { class: "datetime-time" }, timeOnlyPresentation ? this.renderWheelPicker() : this.renderTimeOverlay()));
1744
+ }
1745
+ /**
1746
+ * Renders the month/year picker that is
1747
+ * displayed on the calendar grid.
1748
+ * The .datetime-year class has additional
1749
+ * styles that let us show/hide the
1750
+ * picker when the user clicks on the
1751
+ * toggle in the calendar header.
1752
+ */
1753
+ renderCalendarViewMonthYearPicker() {
1754
+ return index$1.h("div", { class: "datetime-year" }, this.renderWheelView('month-year'));
1755
+ }
1756
+ /**
1757
+ * Render entry point
1758
+ * All presentation types are rendered from here.
1759
+ */
1760
+ renderDatetime(mode) {
1761
+ const { presentation, preferWheel } = this;
1754
1762
  /**
1755
- * Render entry point
1756
- * All presentation types are rendered from here.
1763
+ * Certain presentation types have separate grid and wheel displays.
1764
+ * If preferWheel is true then we should show a wheel picker instead.
1757
1765
  */
1758
- renderDatetime(mode) {
1759
- const { presentation, preferWheel } = this;
1760
- /**
1761
- * Certain presentation types have separate grid and wheel displays.
1762
- * If preferWheel is true then we should show a wheel picker instead.
1763
- */
1764
- const hasWheelVariant = presentation === 'date' || presentation === 'date-time' || presentation === 'time-date';
1765
- if (preferWheel && hasWheelVariant) {
1766
- return [this.renderHeader(false), this.renderWheelView(), this.renderFooter()];
1767
- }
1768
- switch (presentation) {
1769
- case 'date-time':
1770
- return [
1771
- this.renderHeader(),
1772
- this.renderCalendar(mode),
1773
- this.renderCalendarViewMonthYearPicker(),
1774
- this.renderTime(),
1775
- this.renderFooter(),
1776
- ];
1777
- case 'time-date':
1778
- return [
1779
- this.renderHeader(),
1780
- this.renderTime(),
1781
- this.renderCalendar(mode),
1782
- this.renderCalendarViewMonthYearPicker(),
1783
- this.renderFooter(),
1784
- ];
1785
- case 'time':
1786
- return [this.renderHeader(false), this.renderTime(), this.renderFooter()];
1787
- case 'month':
1788
- case 'month-year':
1789
- case 'year':
1790
- return [this.renderHeader(false), this.renderWheelView(), this.renderFooter()];
1791
- default:
1792
- return [
1793
- this.renderHeader(),
1794
- this.renderCalendar(mode),
1795
- this.renderCalendarViewMonthYearPicker(),
1796
- this.renderFooter(),
1797
- ];
1798
- }
1766
+ const hasWheelVariant = presentation === 'date' || presentation === 'date-time' || presentation === 'time-date';
1767
+ if (preferWheel && hasWheelVariant) {
1768
+ return [this.renderHeader(false), this.renderWheelView(), this.renderFooter()];
1799
1769
  }
1800
- render() {
1801
- const { name, value, disabled, el, color, readonly, showMonthAndYear, preferWheel, presentation, size, isGridStyle, } = this;
1802
- const mode = ionicGlobal.getIonMode(this);
1803
- const isMonthAndYearPresentation = presentation === 'year' || presentation === 'month' || presentation === 'month-year';
1804
- const shouldShowMonthAndYear = showMonthAndYear || isMonthAndYearPresentation;
1805
- const monthYearPickerOpen = showMonthAndYear && !isMonthAndYearPresentation;
1806
- const hasDatePresentation = presentation === 'date' || presentation === 'date-time' || presentation === 'time-date';
1807
- const hasWheelVariant = hasDatePresentation && preferWheel;
1808
- helpers.renderHiddenInput(true, el, name, data.formatValue(value), disabled);
1809
- return (index$1.h(index$1.Host, { key: '8490192beb6c5c6064ed8f2a7be2d51846f84f36', "aria-disabled": disabled ? 'true' : null, onFocus: this.onFocus, onBlur: this.onBlur, class: Object.assign({}, theme.createColorClasses(color, {
1810
- [mode]: true,
1811
- ['datetime-readonly']: readonly,
1812
- ['datetime-disabled']: disabled,
1813
- 'show-month-and-year': shouldShowMonthAndYear,
1814
- 'month-year-picker-open': monthYearPickerOpen,
1815
- [`datetime-presentation-${presentation}`]: true,
1816
- [`datetime-size-${size}`]: true,
1817
- [`datetime-prefer-wheel`]: hasWheelVariant,
1818
- [`datetime-grid`]: isGridStyle,
1819
- })) }, index$1.h("div", { key: 'a2959c07ed871f9004a2f11ab1385a5a7b5737fd', class: "intersection-tracker", ref: (el) => (this.intersectionTrackerRef = el) }), this.renderDatetime(mode)));
1770
+ switch (presentation) {
1771
+ case 'date-time':
1772
+ return [
1773
+ this.renderHeader(),
1774
+ this.renderCalendar(mode),
1775
+ this.renderCalendarViewMonthYearPicker(),
1776
+ this.renderTime(),
1777
+ this.renderFooter(),
1778
+ ];
1779
+ case 'time-date':
1780
+ return [
1781
+ this.renderHeader(),
1782
+ this.renderTime(),
1783
+ this.renderCalendar(mode),
1784
+ this.renderCalendarViewMonthYearPicker(),
1785
+ this.renderFooter(),
1786
+ ];
1787
+ case 'time':
1788
+ return [this.renderHeader(false), this.renderTime(), this.renderFooter()];
1789
+ case 'month':
1790
+ case 'month-year':
1791
+ case 'year':
1792
+ return [this.renderHeader(false), this.renderWheelView(), this.renderFooter()];
1793
+ default:
1794
+ return [
1795
+ this.renderHeader(),
1796
+ this.renderCalendar(mode),
1797
+ this.renderCalendarViewMonthYearPicker(),
1798
+ this.renderFooter(),
1799
+ ];
1820
1800
  }
1821
- get el() { return index$1.getElement(this); }
1822
- static get watchers() { return {
1823
- "formatOptions": [{
1824
- "formatOptionsChanged": 0
1825
- }],
1826
- "disabled": [{
1827
- "disabledChanged": 0
1828
- }],
1829
- "min": [{
1830
- "minChanged": 0
1831
- }],
1832
- "max": [{
1833
- "maxChanged": 0
1834
- }],
1835
- "presentation": [{
1836
- "presentationChanged": 0
1837
- }],
1838
- "yearValues": [{
1839
- "yearValuesChanged": 0
1840
- }],
1841
- "monthValues": [{
1842
- "monthValuesChanged": 0
1843
- }],
1844
- "dayValues": [{
1845
- "dayValuesChanged": 0
1846
- }],
1847
- "hourValues": [{
1848
- "hourValuesChanged": 0
1849
- }],
1850
- "minuteValues": [{
1851
- "minuteValuesChanged": 0
1852
- }],
1853
- "value": [{
1854
- "valueChanged": 0
1855
- }]
1856
- }; }
1801
+ }
1802
+ render() {
1803
+ const { name, value, disabled, el, color, readonly, showMonthAndYear, preferWheel, presentation, size, isGridStyle, } = this;
1804
+ const mode = ionicGlobal.getIonMode(this);
1805
+ const isMonthAndYearPresentation = presentation === 'year' || presentation === 'month' || presentation === 'month-year';
1806
+ const shouldShowMonthAndYear = showMonthAndYear || isMonthAndYearPresentation;
1807
+ const monthYearPickerOpen = showMonthAndYear && !isMonthAndYearPresentation;
1808
+ const hasDatePresentation = presentation === 'date' || presentation === 'date-time' || presentation === 'time-date';
1809
+ const hasWheelVariant = hasDatePresentation && preferWheel;
1810
+ helpers.renderHiddenInput(true, el, name, data.formatValue(value), disabled);
1811
+ return (index$1.h(index$1.Host, { key: '8490192beb6c5c6064ed8f2a7be2d51846f84f36', "aria-disabled": disabled ? 'true' : null, onFocus: this.onFocus, onBlur: this.onBlur, class: Object.assign({}, theme.createColorClasses(color, {
1812
+ [mode]: true,
1813
+ ['datetime-readonly']: readonly,
1814
+ ['datetime-disabled']: disabled,
1815
+ 'show-month-and-year': shouldShowMonthAndYear,
1816
+ 'month-year-picker-open': monthYearPickerOpen,
1817
+ [`datetime-presentation-${presentation}`]: true,
1818
+ [`datetime-size-${size}`]: true,
1819
+ [`datetime-prefer-wheel`]: hasWheelVariant,
1820
+ [`datetime-grid`]: isGridStyle,
1821
+ })) }, index$1.h("div", { key: 'a2959c07ed871f9004a2f11ab1385a5a7b5737fd', class: "intersection-tracker", ref: (el) => (this.intersectionTrackerRef = el) }), this.renderDatetime(mode)));
1822
+ }
1823
+ get el() { return index$1.getElement(this); }
1824
+ static get watchers() { return {
1825
+ "formatOptions": ["formatOptionsChanged"],
1826
+ "disabled": ["disabledChanged"],
1827
+ "min": ["minChanged"],
1828
+ "max": ["maxChanged"],
1829
+ "presentation": ["presentationChanged"],
1830
+ "yearValues": ["yearValuesChanged"],
1831
+ "monthValues": ["monthValuesChanged"],
1832
+ "dayValues": ["dayValuesChanged"],
1833
+ "hourValues": ["hourValuesChanged"],
1834
+ "minuteValues": ["minuteValuesChanged"],
1835
+ "value": ["valueChanged"]
1836
+ }; }
1857
1837
  };
1858
1838
  let datetimeIds = 0;
1859
1839
  Datetime.style = {
1860
- ios: datetimeIosCss(),
1861
- md: datetimeMdCss()
1840
+ ios: datetimeIosCss,
1841
+ md: datetimeMdCss
1862
1842
  };
1863
1843
 
1864
1844
  exports.ion_datetime = Datetime;