@ionic/core 8.7.18 → 8.7.19-dev.11772655618.1af0949f

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 (587) hide show
  1. package/components/index.d.ts +2 -0
  2. package/components/index.js +1 -114
  3. package/components/ion-accordion-group.js +1 -268
  4. package/components/ion-accordion.js +1 -456
  5. package/components/ion-action-sheet.js +1 -6
  6. package/components/ion-alert.js +1 -6
  7. package/components/ion-app.js +1 -132
  8. package/components/ion-avatar.js +1 -41
  9. package/components/ion-back-button.js +1 -130
  10. package/components/ion-backdrop.js +1 -6
  11. package/components/ion-badge.js +1 -47
  12. package/components/ion-breadcrumb.js +1 -137
  13. package/components/ion-breadcrumbs.js +1 -164
  14. package/components/ion-button.js +1 -6
  15. package/components/ion-buttons.js +1 -6
  16. package/components/ion-card-content.js +1 -45
  17. package/components/ion-card-header.js +1 -56
  18. package/components/ion-card-subtitle.js +1 -48
  19. package/components/ion-card-title.js +1 -48
  20. package/components/ion-card.js +1 -107
  21. package/components/ion-checkbox.js +1 -6
  22. package/components/ion-chip.js +1 -66
  23. package/components/ion-col.js +1 -163
  24. package/components/ion-content.js +1 -6
  25. package/components/ion-datetime-button.js +1 -383
  26. package/components/ion-datetime.js +1 -2047
  27. package/components/ion-fab-button.js +1 -151
  28. package/components/ion-fab-list.js +1 -73
  29. package/components/ion-fab.js +1 -101
  30. package/components/ion-footer.js +1 -179
  31. package/components/ion-grid.js +1 -46
  32. package/components/ion-header.js +1 -6
  33. package/components/ion-icon.js +1 -6
  34. package/components/ion-img.js +1 -133
  35. package/components/ion-infinite-scroll-content.js +1 -69
  36. package/components/ion-infinite-scroll.js +1 -236
  37. package/components/ion-input-otp.js +1 -682
  38. package/components/ion-input-password-toggle.js +1 -128
  39. package/components/ion-input.js +1 -646
  40. package/components/ion-item-divider.js +1 -59
  41. package/components/ion-item-group.js +1 -46
  42. package/components/ion-item-option.js +1 -91
  43. package/components/ion-item-options.js +1 -73
  44. package/components/ion-item-sliding.js +1 -457
  45. package/components/ion-item.js +1 -6
  46. package/components/ion-label.js +1 -6
  47. package/components/ion-list-header.js +1 -6
  48. package/components/ion-list.js +1 -6
  49. package/components/ion-loading.js +1 -343
  50. package/components/ion-menu-button.js +1 -109
  51. package/components/ion-menu-toggle.js +1 -64
  52. package/components/ion-menu.js +1 -741
  53. package/components/ion-modal.js +1 -6
  54. package/components/ion-nav-link.js +1 -64
  55. package/components/ion-nav.js +1 -951
  56. package/components/ion-note.js +1 -47
  57. package/components/ion-picker-column-option.js +1 -6
  58. package/components/ion-picker-column.js +1 -6
  59. package/components/ion-picker-legacy-column.js +1 -6
  60. package/components/ion-picker-legacy.js +1 -342
  61. package/components/ion-picker.js +1 -6
  62. package/components/ion-popover.js +1 -6
  63. package/components/ion-progress-bar.js +1 -100
  64. package/components/ion-radio-group.js +1 -6
  65. package/components/ion-radio.js +1 -6
  66. package/components/ion-range.js +1 -844
  67. package/components/ion-refresher-content.js +1 -88
  68. package/components/ion-refresher.js +1 -750
  69. package/components/ion-reorder-group.js +1 -322
  70. package/components/ion-reorder.js +1 -60
  71. package/components/ion-ripple-effect.js +1 -6
  72. package/components/ion-route-redirect.js +1 -45
  73. package/components/ion-route.js +1 -74
  74. package/components/ion-router-link.js +1 -61
  75. package/components/ion-router-outlet.js +1 -226
  76. package/components/ion-router.js +1 -840
  77. package/components/ion-row.js +1 -36
  78. package/components/ion-searchbar.js +1 -540
  79. package/components/ion-segment-button.js +1 -173
  80. package/components/ion-segment-content.js +1 -35
  81. package/components/ion-segment-view.js +1 -142
  82. package/components/ion-segment.js +1 -602
  83. package/components/ion-select-modal.js +1 -6
  84. package/components/ion-select-option.js +1 -46
  85. package/components/ion-select-popover.js +1 -6
  86. package/components/ion-select.js +1 -1035
  87. package/components/ion-skeleton-text.js +1 -64
  88. package/components/ion-spinner.js +1 -6
  89. package/components/ion-split-pane.js +1 -190
  90. package/components/ion-tab-bar.js +1 -135
  91. package/components/ion-tab-button.js +1 -127
  92. package/components/ion-tab.js +1 -82
  93. package/components/ion-tabs.js +1 -204
  94. package/components/ion-text.js +1 -42
  95. package/components/ion-textarea.js +1 -554
  96. package/components/ion-thumbnail.js +1 -36
  97. package/components/ion-title.js +1 -6
  98. package/components/ion-toast.js +1 -938
  99. package/components/ion-toggle.js +1 -360
  100. package/components/ion-toolbar.js +1 -6
  101. package/components/p-1KVKSLu5.js +4 -0
  102. package/{dist/ionic/p-DUt5fQmA.js → components/p-9VcRUwdB.js} +1 -1
  103. package/components/p-ApmKVjaE.js +4 -0
  104. package/components/p-B-hirT0v.js +1 -35
  105. package/components/p-B6FQ0cKR.js +4 -0
  106. package/components/p-B6HaBl3o.js +4 -0
  107. package/components/p-B8b1Ukl9.js +4 -0
  108. package/components/p-BFxT89Wl.js +4 -0
  109. package/components/p-BJoMtgfR.js +4 -0
  110. package/components/p-BNAG-aVv.js +4 -0
  111. package/{dist/ionic/p-D-eFFUkA.js → components/p-BR3tZJmu.js} +1 -1
  112. package/{dist/ionic/p-D0dMcSkw.js → components/p-BS1TtEiJ.js} +1 -1
  113. package/components/p-BSB38Tek.js +4 -0
  114. package/components/p-BTEOs1at.js +1 -192
  115. package/components/p-BTeL5HCK.js +4 -0
  116. package/{dist/ionic/p-DbQ5QkTP.js → components/p-BUbsoBOV.js} +1 -1
  117. package/components/p-BVnB3eEn.js +4 -0
  118. package/components/p-BYDc3hSE.js +4 -0
  119. package/components/p-BagjAGC0.js +4 -0
  120. package/components/p-BegtE7nr.js +4 -0
  121. package/components/p-BgwEQWW6.js +4 -0
  122. package/components/p-Bk2zuNWT.js +4 -0
  123. package/components/p-BmVRXR1y.js +1 -72
  124. package/components/p-Bum_LjMh.js +4 -0
  125. package/components/p-BxwWvu-b.js +4 -0
  126. package/components/p-C4jPsTQa.js +4 -0
  127. package/components/p-C53feagD.js +1 -15
  128. package/{dist/ionic/p-CwgG81ZD.js → components/p-C59ryAuS.js} +1 -1
  129. package/components/p-C7AoMl7c.js +4 -0
  130. package/components/p-CBzELu-H.js +4 -0
  131. package/components/p-CDfQnFrd.js +4 -0
  132. package/components/p-CH0NYjKq.js +4 -0
  133. package/components/p-CIGNaXM1.js +1 -10
  134. package/components/p-CO7fmmxt.js +1 -29
  135. package/components/p-CU1SSH8_.js +4 -0
  136. package/components/p-CVF7ukTk.js +4 -0
  137. package/components/p-CgfaEEem.js +4 -0
  138. package/components/p-CgqKJg96.js +4 -0
  139. package/components/p-Cl0B-RWe.js +1 -452
  140. package/components/p-CneGxKsZ.js +4 -0
  141. package/components/p-CoA-aqGF.js +4 -0
  142. package/{dist/ionic/p-DdR6rpbR.js → components/p-Cq8cQ0NL.js} +1 -1
  143. package/components/p-Csw8xuz4.js +4 -0
  144. package/components/p-CtWGkNnJ.js +1 -162
  145. package/components/p-Cwv-vmkN.js +4 -0
  146. package/{dist/ionic/p-BYEqWnSg.js → components/p-Cy5XSfIk.js} +1 -1
  147. package/components/p-Cyxa_4PV.js +4 -0
  148. package/components/p-Cz5nLPGT.js +4 -0
  149. package/components/p-D13Eaw-8.js +1 -76
  150. package/components/p-D6NJwNJN.js +4 -0
  151. package/components/p-D6Ynv7Xh.js +1 -141
  152. package/components/p-DHsZWn1l.js +4 -0
  153. package/components/p-DJMZehmW.js +4 -0
  154. package/components/p-DJztqcrH.js +1 -14
  155. package/components/p-DYdpXONG.js +4 -0
  156. package/components/p-DgbT0exM.js +4 -0
  157. package/components/p-DiVJyqlX.js +1 -40
  158. package/components/p-Dtdm8lKC.js +1 -44
  159. package/components/p-YLXPWgVj.js +4 -0
  160. package/components/p-ZjP4CjeZ.js +1 -4
  161. package/{dist/ionic/p-DCv9sLH2.js → components/p-ak_d-z48.js} +1 -1
  162. package/components/p-cyNmxje6.js +1 -155
  163. package/components/p-fpbh6w3f.js +4 -0
  164. package/components/p-hHmYLOfE.js +1 -87
  165. package/components/p-kvaDs24J.js +4 -0
  166. package/components/p-vEbVo2hO.js +4 -0
  167. package/dist/cjs/{animation-Bt3H9L1C.js → animation-Dg4yiuR2.js} +1 -1
  168. package/dist/cjs/app-globals-CLI8xCmk.js +11 -0
  169. package/dist/cjs/{button-active-CMc8cD90.js → button-active-FscMI17-.js} +1 -1
  170. package/dist/cjs/{config-C5fsO43a.js → config-BukYi_pW.js} +1 -1
  171. package/dist/cjs/{data-JwZKaIQB.js → data-BYlBjkMU.js} +1 -1
  172. package/dist/cjs/{framework-delegate-DMJRBuDi.js → framework-delegate-CRgp8o_p.js} +1 -1
  173. package/dist/cjs/{hardware-back-button-VCK4V3mG.js → hardware-back-button-C4rMJ5uI.js} +1 -1
  174. package/dist/cjs/{helpers-DrTqNghc.js → helpers-CxTYJdbT.js} +1 -1
  175. package/dist/cjs/{index-094mMFB-.js → index-C845Ti6K.js} +4 -4
  176. package/dist/cjs/{index-DrMUZJj6.js → index-CFUwM5x_.js} +5 -5
  177. package/dist/cjs/{index-D6Wc6v08.js → index-CqT-2gKy.js} +503 -382
  178. package/dist/cjs/{index-CO6eryBo.js → index-MbaBbWXk.js} +2 -2
  179. package/dist/cjs/{index-C534ULug.js → index-YcSftOMz.js} +2 -2
  180. package/dist/cjs/index.cjs.js +12 -12
  181. package/dist/cjs/{input-shims-CuMghsQ-.js → input-shims-Dl5cnc_e.js} +3 -3
  182. package/dist/cjs/{input.utils-B_QROI2g.js → input.utils-DmeJ8dmo.js} +2 -2
  183. package/dist/cjs/ion-accordion_2.cjs.entry.js +23 -15
  184. package/dist/cjs/ion-action-sheet.cjs.entry.js +21 -15
  185. package/dist/cjs/ion-alert.cjs.entry.js +25 -17
  186. package/dist/cjs/ion-app_8.cjs.entry.js +48 -43
  187. package/dist/cjs/ion-avatar_3.cjs.entry.js +12 -12
  188. package/dist/cjs/ion-back-button.cjs.entry.js +7 -7
  189. package/dist/cjs/ion-backdrop.cjs.entry.js +6 -6
  190. package/dist/cjs/ion-breadcrumb_2.cjs.entry.js +20 -14
  191. package/dist/cjs/ion-button_2.cjs.entry.js +36 -18
  192. package/dist/cjs/ion-card_5.cjs.entry.js +23 -23
  193. package/dist/cjs/ion-checkbox.cjs.entry.js +7 -7
  194. package/dist/cjs/ion-chip.cjs.entry.js +6 -6
  195. package/dist/cjs/ion-col_3.cjs.entry.js +8 -8
  196. package/dist/cjs/ion-datetime-button.cjs.entry.js +8 -8
  197. package/dist/cjs/ion-datetime_3.cjs.entry.js +75 -46
  198. package/dist/cjs/ion-fab_3.cjs.entry.js +17 -13
  199. package/dist/cjs/ion-img.cjs.entry.js +8 -6
  200. package/dist/cjs/ion-infinite-scroll_2.cjs.entry.js +17 -13
  201. package/dist/cjs/ion-input-otp.cjs.entry.js +16 -10
  202. package/dist/cjs/ion-input-password-toggle.cjs.entry.js +9 -7
  203. package/dist/cjs/ion-input.cjs.entry.js +21 -13
  204. package/dist/cjs/ion-item-option_3.cjs.entry.js +19 -17
  205. package/dist/cjs/ion-item_8.cjs.entry.js +48 -42
  206. package/dist/cjs/ion-loading.cjs.entry.js +18 -14
  207. package/dist/cjs/ion-menu_3.cjs.entry.js +30 -22
  208. package/dist/cjs/ion-modal.cjs.entry.js +237 -59
  209. package/dist/cjs/ion-nav_2.cjs.entry.js +14 -10
  210. package/dist/cjs/ion-picker-column-option.cjs.entry.js +10 -8
  211. package/dist/cjs/ion-picker-column.cjs.entry.js +11 -7
  212. package/dist/cjs/ion-picker.cjs.entry.js +6 -6
  213. package/dist/cjs/ion-popover.cjs.entry.js +21 -15
  214. package/dist/cjs/ion-progress-bar.cjs.entry.js +7 -7
  215. package/dist/cjs/ion-radio_2.cjs.entry.js +17 -13
  216. package/dist/cjs/ion-range.cjs.entry.js +205 -57
  217. package/dist/cjs/ion-refresher_2.cjs.entry.js +45 -14
  218. package/dist/cjs/ion-reorder_2.cjs.entry.js +13 -11
  219. package/dist/cjs/ion-ripple-effect.cjs.entry.js +4 -4
  220. package/dist/cjs/ion-route_4.cjs.entry.js +20 -10
  221. package/dist/cjs/ion-searchbar.cjs.entry.js +22 -12
  222. package/dist/cjs/ion-segment-content.cjs.entry.js +3 -3
  223. package/dist/cjs/ion-segment-view.cjs.entry.js +13 -8
  224. package/dist/cjs/ion-segment_2.cjs.entry.js +26 -16
  225. package/dist/cjs/ion-select-modal.cjs.entry.js +17 -13
  226. package/dist/cjs/ion-select_3.cjs.entry.js +33 -24
  227. package/dist/cjs/ion-spinner.cjs.entry.js +4 -4
  228. package/dist/cjs/ion-split-pane.cjs.entry.js +15 -9
  229. package/dist/cjs/ion-tab-bar_2.cjs.entry.js +14 -12
  230. package/dist/cjs/ion-tab_2.cjs.entry.js +10 -8
  231. package/dist/cjs/ion-text.cjs.entry.js +4 -4
  232. package/dist/cjs/ion-textarea.cjs.entry.js +20 -14
  233. package/dist/cjs/ion-toast.cjs.entry.js +21 -15
  234. package/dist/cjs/ion-toggle.cjs.entry.js +10 -8
  235. package/dist/cjs/{ionic-global-HMVqOFGO.js → ionic-global-Bc3kJi1Z.js} +1 -1
  236. package/dist/cjs/ionic.cjs.js +5 -5
  237. package/dist/cjs/{ios.transition-BOt_uW73.js → ios.transition-trBiC95R.js} +4 -4
  238. package/dist/cjs/loader.cjs.js +4 -4
  239. package/dist/cjs/{md.transition-Dt968VXB.js → md.transition-CUQECuvD.js} +4 -4
  240. package/dist/cjs/{notch-controller-Bzqhjm4f.js → notch-controller-sD-lTpdc.js} +1 -1
  241. package/dist/cjs/{overlays-B2b-TTbl.js → overlays-C2jiBSNQ.js} +5 -5
  242. package/dist/cjs/{status-tap-g0sWWkXk.js → status-tap-CCJk5VgT.js} +3 -3
  243. package/dist/cjs/{swipe-back-BIayeNOD.js → swipe-back-BGhTQ1CU.js} +2 -2
  244. package/dist/collection/collection-manifest.json +2 -2
  245. package/dist/collection/components/accordion-group/accordion-group.js +4 -2
  246. package/dist/collection/components/action-sheet/action-sheet.js +20 -10
  247. package/dist/collection/components/alert/alert.js +24 -12
  248. package/dist/collection/components/back-button/back-button.js +4 -2
  249. package/dist/collection/components/badge/badge.js +2 -1
  250. package/dist/collection/components/breadcrumb/breadcrumb.js +8 -4
  251. package/dist/collection/components/breadcrumbs/breadcrumbs.js +4 -2
  252. package/dist/collection/components/button/button.js +6 -3
  253. package/dist/collection/components/card/card.js +6 -3
  254. package/dist/collection/components/card-header/card-header.js +2 -1
  255. package/dist/collection/components/card-subtitle/card-subtitle.js +2 -1
  256. package/dist/collection/components/card-title/card-title.js +2 -1
  257. package/dist/collection/components/checkbox/checkbox.js +4 -2
  258. package/dist/collection/components/chip/chip.js +2 -1
  259. package/dist/collection/components/content/content.js +12 -7
  260. package/dist/collection/components/datetime/datetime.js +43 -22
  261. package/dist/collection/components/datetime-button/datetime-button.js +2 -1
  262. package/dist/collection/components/fab-button/fab-button.js +6 -3
  263. package/dist/collection/components/infinite-scroll-content/infinite-scroll-content.js +4 -2
  264. package/dist/collection/components/input/input.js +11 -6
  265. package/dist/collection/components/input-otp/input-otp.js +8 -4
  266. package/dist/collection/components/input-password-toggle/input-password-toggle.js +4 -2
  267. package/dist/collection/components/item/item.js +10 -5
  268. package/dist/collection/components/item-divider/item-divider.js +7 -3
  269. package/dist/collection/components/item-option/item-option.js +6 -3
  270. package/dist/collection/components/item-options/item-options.js +2 -1
  271. package/dist/collection/components/item-sliding/item-sliding.js +2 -1
  272. package/dist/collection/components/label/label.js +6 -3
  273. package/dist/collection/components/list-header/list-header.js +6 -3
  274. package/dist/collection/components/loading/loading.js +22 -11
  275. package/dist/collection/components/menu/menu.js +10 -5
  276. package/dist/collection/components/menu-button/menu-button.js +2 -1
  277. package/dist/collection/components/modal/gestures/sheet.js +120 -12
  278. package/dist/collection/components/modal/gestures/swipe-to-close.js +54 -1
  279. package/dist/collection/components/modal/modal.js +127 -45
  280. package/dist/collection/components/nav/nav.js +89 -45
  281. package/dist/collection/components/nav-link/nav-link.js +9 -5
  282. package/dist/collection/components/note/note.js +2 -1
  283. package/dist/collection/components/picker/picker.js +2 -1
  284. package/dist/collection/components/picker-column/picker-column.js +6 -3
  285. package/dist/collection/components/picker-column-option/picker-column-option.js +2 -1
  286. package/dist/collection/components/picker-legacy/picker.js +24 -12
  287. package/dist/collection/components/picker-legacy-column/picker-column.js +4 -2
  288. package/dist/collection/components/popover/popover.js +33 -17
  289. package/dist/collection/components/progress-bar/progress-bar.js +2 -1
  290. package/dist/collection/components/radio/radio.js +2 -1
  291. package/dist/collection/components/radio-group/radio-group.js +6 -3
  292. package/dist/collection/components/range/range.js +214 -53
  293. package/dist/collection/components/refresher/refresher.js +73 -5
  294. package/dist/collection/components/refresher-content/refresher-content.js +8 -4
  295. package/dist/collection/components/reorder-group/reorder-group.js +6 -3
  296. package/dist/collection/components/route/route.js +4 -2
  297. package/dist/collection/components/router/router.js +10 -5
  298. package/dist/collection/components/router-link/router-link.js +6 -3
  299. package/dist/collection/components/router-outlet/router-outlet.js +18 -9
  300. package/dist/collection/components/searchbar/searchbar.js +11 -6
  301. package/dist/collection/components/segment/segment.js +10 -5
  302. package/dist/collection/components/segment-button/segment-button.js +4 -2
  303. package/dist/collection/components/segment-view/segment-view.ios.css +2 -1
  304. package/dist/collection/components/segment-view/segment-view.js +30 -4
  305. package/dist/collection/components/segment-view/segment-view.md.css +2 -1
  306. package/dist/collection/components/select/select.js +17 -8
  307. package/dist/collection/components/select-modal/select-modal.js +27 -2
  308. package/dist/collection/components/select-popover/select-popover.js +2 -1
  309. package/dist/collection/components/skeleton-text/skeleton-text.js +2 -1
  310. package/dist/collection/components/spinner/spinner.js +4 -2
  311. package/dist/collection/components/tab/tab.js +4 -2
  312. package/dist/collection/components/tab-bar/tab-bar.js +4 -2
  313. package/dist/collection/components/tab-button/tab-button.js +4 -2
  314. package/dist/collection/components/tabs/tabs.js +4 -2
  315. package/dist/collection/components/text/text.js +2 -1
  316. package/dist/collection/components/textarea/textarea.js +10 -7
  317. package/dist/collection/components/title/title.js +4 -2
  318. package/dist/collection/components/toast/toast.js +34 -17
  319. package/dist/collection/components/toggle/toggle.js +4 -2
  320. package/dist/collection/components/toolbar/toolbar.js +2 -1
  321. package/dist/docs.d.ts +37 -0
  322. package/dist/docs.json +1186 -389
  323. package/dist/esm/{animation-Dt8bGnA-.js → animation-CnGMT4ji.js} +1 -1
  324. package/dist/esm/app-globals-DhZjtldk.js +9 -0
  325. package/dist/esm/{button-active-L570Swow.js → button-active-BBx21brx.js} +1 -1
  326. package/dist/esm/{config-mCdtaoPe.js → config-TO1rZH52.js} +1 -1
  327. package/dist/esm/{data-DCORV9FH.js → data-B9iGR5YO.js} +1 -1
  328. package/dist/esm/{framework-delegate-BYawdMXj.js → framework-delegate-CyxE1S_P.js} +1 -1
  329. package/dist/esm/{hardware-back-button-CPLxO-Ev.js → hardware-back-button-CTe4XmL7.js} +1 -1
  330. package/dist/esm/{helpers-DEn3pfjm.js → helpers-Tl8jw6S2.js} +1 -1
  331. package/dist/esm/{index-r2D9DEro.js → index-B-hkiOUh.js} +4 -4
  332. package/dist/esm/{index-CvDIirVx.js → index-B2KwgBLx.js} +5 -5
  333. package/dist/esm/{index-ceb5RaMT.js → index-BtUdxPjv.js} +2 -2
  334. package/dist/esm/{index-C8IsBmNU.js → index-IGIE5vDm.js} +503 -382
  335. package/dist/esm/{index-Bs3kT4bc.js → index-hW6eNZ3o.js} +2 -2
  336. package/dist/esm/index.js +12 -12
  337. package/dist/esm/{input-shims-D6H3ZaWt.js → input-shims-AaDhOpKN.js} +3 -3
  338. package/dist/esm/{input.utils-DrvTa8gz.js → input.utils-Bxa_DQ7-.js} +2 -2
  339. package/dist/esm/ion-accordion_2.entry.js +23 -15
  340. package/dist/esm/ion-action-sheet.entry.js +21 -15
  341. package/dist/esm/ion-alert.entry.js +25 -17
  342. package/dist/esm/ion-app_8.entry.js +48 -43
  343. package/dist/esm/ion-avatar_3.entry.js +12 -12
  344. package/dist/esm/ion-back-button.entry.js +7 -7
  345. package/dist/esm/ion-backdrop.entry.js +6 -6
  346. package/dist/esm/ion-breadcrumb_2.entry.js +20 -14
  347. package/dist/esm/ion-button_2.entry.js +36 -18
  348. package/dist/esm/ion-card_5.entry.js +23 -23
  349. package/dist/esm/ion-checkbox.entry.js +7 -7
  350. package/dist/esm/ion-chip.entry.js +6 -6
  351. package/dist/esm/ion-col_3.entry.js +8 -8
  352. package/dist/esm/ion-datetime-button.entry.js +8 -8
  353. package/dist/esm/ion-datetime_3.entry.js +75 -46
  354. package/dist/esm/ion-fab_3.entry.js +17 -13
  355. package/dist/esm/ion-img.entry.js +8 -6
  356. package/dist/esm/ion-infinite-scroll_2.entry.js +17 -13
  357. package/dist/esm/ion-input-otp.entry.js +16 -10
  358. package/dist/esm/ion-input-password-toggle.entry.js +9 -7
  359. package/dist/esm/ion-input.entry.js +21 -13
  360. package/dist/esm/ion-item-option_3.entry.js +19 -17
  361. package/dist/esm/ion-item_8.entry.js +48 -42
  362. package/dist/esm/ion-loading.entry.js +18 -14
  363. package/dist/esm/ion-menu_3.entry.js +30 -22
  364. package/dist/esm/ion-modal.entry.js +237 -59
  365. package/dist/esm/ion-nav_2.entry.js +14 -10
  366. package/dist/esm/ion-picker-column-option.entry.js +10 -8
  367. package/dist/esm/ion-picker-column.entry.js +11 -7
  368. package/dist/esm/ion-picker.entry.js +6 -6
  369. package/dist/esm/ion-popover.entry.js +21 -15
  370. package/dist/esm/ion-progress-bar.entry.js +7 -7
  371. package/dist/esm/ion-radio_2.entry.js +17 -13
  372. package/dist/esm/ion-range.entry.js +205 -57
  373. package/dist/esm/ion-refresher_2.entry.js +45 -14
  374. package/dist/esm/ion-reorder_2.entry.js +13 -11
  375. package/dist/esm/ion-ripple-effect.entry.js +4 -4
  376. package/dist/esm/ion-route_4.entry.js +20 -10
  377. package/dist/esm/ion-searchbar.entry.js +22 -12
  378. package/dist/esm/ion-segment-content.entry.js +3 -3
  379. package/dist/esm/ion-segment-view.entry.js +13 -8
  380. package/dist/esm/ion-segment_2.entry.js +26 -16
  381. package/dist/esm/ion-select-modal.entry.js +17 -13
  382. package/dist/esm/ion-select_3.entry.js +33 -24
  383. package/dist/esm/ion-spinner.entry.js +4 -4
  384. package/dist/esm/ion-split-pane.entry.js +15 -9
  385. package/dist/esm/ion-tab-bar_2.entry.js +14 -12
  386. package/dist/esm/ion-tab_2.entry.js +10 -8
  387. package/dist/esm/ion-text.entry.js +4 -4
  388. package/dist/esm/ion-textarea.entry.js +20 -14
  389. package/dist/esm/ion-toast.entry.js +21 -15
  390. package/dist/esm/ion-toggle.entry.js +10 -8
  391. package/dist/esm/{ionic-global-CDrldh-5.js → ionic-global-DfbeLwcV.js} +1 -1
  392. package/dist/esm/ionic.js +6 -6
  393. package/dist/esm/{ios.transition-BDzw0_Hm.js → ios.transition--aMF-pDH.js} +4 -4
  394. package/dist/esm/loader.js +5 -5
  395. package/dist/esm/{md.transition-BzDYi3qq.js → md.transition-BEVbfm8j.js} +4 -4
  396. package/dist/esm/{notch-controller-BwelN_JM.js → notch-controller-DAcvKU57.js} +1 -1
  397. package/dist/esm/{overlays-D5YkFThA.js → overlays-F8GHPo-e.js} +5 -5
  398. package/dist/esm/{status-tap-5DQ7Fc4V.js → status-tap-BfJqFSLF.js} +3 -3
  399. package/dist/esm/{swipe-back-BKw2CAHc.js → swipe-back-BZBFwTQV.js} +2 -2
  400. package/dist/html.html-data.json +117 -109
  401. package/dist/ionic/index.esm.js +1 -1
  402. package/dist/ionic/ionic.esm.js +1 -1
  403. package/dist/ionic/p-031b76f7.entry.js +4 -0
  404. package/dist/ionic/p-045a6a42.entry.js +4 -0
  405. package/dist/ionic/p-07506134.entry.js +4 -0
  406. package/dist/ionic/p-084c25b2.entry.js +4 -0
  407. package/dist/ionic/p-0d8b5c38.entry.js +4 -0
  408. package/dist/ionic/p-16813ce7.entry.js +4 -0
  409. package/dist/ionic/p-16b65553.entry.js +4 -0
  410. package/dist/ionic/p-1b02923f.entry.js +4 -0
  411. package/dist/ionic/{p-5c8f7253.entry.js → p-1b169fb6.entry.js} +1 -1
  412. package/dist/ionic/{p-915b3e3d.entry.js → p-23fac490.entry.js} +1 -1
  413. package/dist/ionic/{p-b8551510.entry.js → p-294f4bb5.entry.js} +1 -1
  414. package/dist/ionic/p-2a68388b.entry.js +4 -0
  415. package/dist/ionic/p-2f5a8140.entry.js +4 -0
  416. package/dist/ionic/{p-49d06882.entry.js → p-301c43f8.entry.js} +1 -1
  417. package/dist/ionic/{p-79bd78f9.entry.js → p-370a60ee.entry.js} +1 -1
  418. package/dist/ionic/p-3e143d1d.entry.js +4 -0
  419. package/dist/ionic/p-4819b469.entry.js +4 -0
  420. package/dist/ionic/p-4dd5e8e0.entry.js +4 -0
  421. package/dist/ionic/p-51c11c47.entry.js +4 -0
  422. package/dist/ionic/p-53f750a5.entry.js +4 -0
  423. package/dist/ionic/{p-7cad388a.entry.js → p-6af16209.entry.js} +1 -1
  424. package/dist/ionic/{p-7f98e710.entry.js → p-6b701daa.entry.js} +1 -1
  425. package/dist/ionic/p-6b97f2a3.entry.js +4 -0
  426. package/dist/ionic/p-71e322f7.entry.js +4 -0
  427. package/dist/ionic/p-7620be24.entry.js +4 -0
  428. package/dist/ionic/p-771b27a5.entry.js +4 -0
  429. package/dist/ionic/{p-906bb44d.entry.js → p-7ca71c83.entry.js} +1 -1
  430. package/dist/ionic/{p-11aa58d6.entry.js → p-80cac7a2.entry.js} +1 -1
  431. package/dist/ionic/p-96a2e768.entry.js +4 -0
  432. package/dist/ionic/{p-582824c5.entry.js → p-9833cf63.entry.js} +1 -1
  433. package/dist/ionic/p-9cbc6f1f.entry.js +4 -0
  434. package/dist/ionic/p-9cdbabbb.entry.js +4 -0
  435. package/dist/ionic/p-9eac4eb1.entry.js +4 -0
  436. package/dist/ionic/{p-675b1a31.entry.js → p-9fae83d8.entry.js} +1 -1
  437. package/dist/ionic/p-B8xlpH8p.js +4 -0
  438. package/dist/ionic/{p-C7hRNDhM.js → p-BAt5H1ac.js} +1 -1
  439. package/dist/ionic/p-BW_TRJm8.js +4 -0
  440. package/dist/ionic/{p-DDb5r57F.js → p-Bum7H1fw.js} +1 -1
  441. package/dist/ionic/p-BvFYtOdE.js +4 -0
  442. package/dist/ionic/{p-Dc45iWE4.js → p-BxIcPWoV.js} +1 -1
  443. package/dist/ionic/p-C0JvVFMv.js +4 -0
  444. package/dist/ionic/{p-CTfR9YZG.js → p-CGmVTdWh.js} +1 -1
  445. package/dist/ionic/{p-BOVrCkpJ.js → p-CYbRmDdy.js} +1 -1
  446. package/dist/ionic/{p-MUoJJJwd.js → p-CYvM5g3q.js} +1 -1
  447. package/dist/ionic/p-CmFz1Mjc.js +4 -0
  448. package/dist/ionic/p-CtA-yJYy.js +4 -0
  449. package/dist/ionic/p-D8HJQ1qq.js +4 -0
  450. package/dist/ionic/{p-B0q1YL7N.js → p-DB_iPQC-.js} +1 -1
  451. package/dist/ionic/{p-DNcfiJwE.js → p-DLbbmF9h.js} +1 -1
  452. package/dist/ionic/p-DTPR1Wpn.js +4 -0
  453. package/dist/ionic/p-DjriolRs.js +4 -0
  454. package/dist/ionic/p-DtVZDHlS.js +4 -0
  455. package/dist/ionic/p-IGIE5vDm.js +5 -0
  456. package/dist/ionic/{p-BFvmZNyx.js → p-NFFyoJ4Q.js} +1 -1
  457. package/dist/ionic/p-a805674e.entry.js +4 -0
  458. package/dist/ionic/{p-da7d04cc.entry.js → p-a84f2d21.entry.js} +1 -1
  459. package/dist/ionic/p-aa47f46e.entry.js +4 -0
  460. package/dist/ionic/{p-2668188b.entry.js → p-b325a113.entry.js} +1 -1
  461. package/dist/ionic/{p-d1f54e28.entry.js → p-b440381f.entry.js} +1 -1
  462. package/dist/ionic/p-b6e0ff03.entry.js +4 -0
  463. package/dist/ionic/{p-6f37536a.entry.js → p-bcaa827e.entry.js} +1 -1
  464. package/dist/ionic/{p-fb0271ae.entry.js → p-c3cce9d8.entry.js} +1 -1
  465. package/dist/ionic/{p-b0a7585c.entry.js → p-ca31010f.entry.js} +1 -1
  466. package/dist/ionic/p-d4e8b473.entry.js +4 -0
  467. package/dist/ionic/{p-9575b654.entry.js → p-e663bc5a.entry.js} +1 -1
  468. package/dist/ionic/p-e6c5f060.entry.js +4 -0
  469. package/dist/ionic/{p-652318c3.entry.js → p-e6cedcd7.entry.js} +1 -1
  470. package/dist/ionic/{p-fbb00634.entry.js → p-e863ffe8.entry.js} +1 -1
  471. package/dist/ionic/{p-0ca0fe9c.entry.js → p-f2deaceb.entry.js} +1 -1
  472. package/dist/ionic/{p-ac4eb91d.entry.js → p-f5dfb9a3.entry.js} +1 -1
  473. package/dist/ionic/{p-bce86e56.entry.js → p-f8186550.entry.js} +1 -1
  474. package/dist/ionic/p-fdbc90d4.entry.js +4 -0
  475. package/dist/ionic/p-gbVXD275.js +4 -0
  476. package/dist/ionic/p-hNN3VvaC.js +4 -0
  477. package/dist/types/components/datetime/datetime.d.ts +10 -0
  478. package/dist/types/components/header/header.utils.d.ts +2 -1
  479. package/dist/types/components/item/item.d.ts +2 -0
  480. package/dist/types/components/item-divider/item-divider.d.ts +3 -0
  481. package/dist/types/components/item-option/item-option.d.ts +2 -0
  482. package/dist/types/components/list-header/list-header.d.ts +2 -0
  483. package/dist/types/components/modal/gestures/sheet.d.ts +2 -2
  484. package/dist/types/components/modal/gestures/swipe-to-close.d.ts +2 -2
  485. package/dist/types/components/modal/modal-interface.d.ts +25 -0
  486. package/dist/types/components/modal/modal.d.ts +22 -1
  487. package/dist/types/components/range/range-interface.d.ts +1 -0
  488. package/dist/types/components/range/range.d.ts +44 -4
  489. package/dist/types/components/refresher/refresher-interface.d.ts +7 -0
  490. package/dist/types/components/refresher/refresher.d.ts +16 -3
  491. package/dist/types/components/segment-view/segment-view.d.ts +4 -0
  492. package/dist/types/components/select/select.d.ts +3 -0
  493. package/dist/types/components/select-modal/select-modal.d.ts +4 -0
  494. package/dist/types/components.d.ts +964 -191
  495. package/dist/types/interface.d.ts +2 -2
  496. package/dist/types/stencil-public-runtime.d.ts +126 -14
  497. package/dist/types/utils/gesture/listener.d.ts +2 -1
  498. package/hydrate/index.d.ts +12 -0
  499. package/hydrate/index.js +5632 -1421
  500. package/hydrate/index.mjs +5631 -1422
  501. package/package.json +2 -2
  502. package/components/p-B25GjpND.js +0 -71
  503. package/components/p-BANeLH_G.js +0 -290
  504. package/components/p-BBFQmhcD.js +0 -59
  505. package/components/p-BC-awmYt.js +0 -306
  506. package/components/p-BHbOsu99.js +0 -501
  507. package/components/p-BTlwXR9e.js +0 -73
  508. package/components/p-BcazQttQ.js +0 -612
  509. package/components/p-BdGshsIJ.js +0 -226
  510. package/components/p-BfS7vSpC.js +0 -147
  511. package/components/p-BhRFCLuX.js +0 -675
  512. package/components/p-Bhnhnzjz.js +0 -75
  513. package/components/p-BmcqD0EN.js +0 -153
  514. package/components/p-Boi6hecl.js +0 -115
  515. package/components/p-Bt_moUyl.js +0 -232
  516. package/components/p-Bxl5etF4.js +0 -146
  517. package/components/p-ByjmWt3s.js +0 -139
  518. package/components/p-C04oPyjT.js +0 -54
  519. package/components/p-C6dkQWq2.js +0 -1626
  520. package/components/p-CFZWrvIQ.js +0 -194
  521. package/components/p-CIJwkzL6.js +0 -195
  522. package/components/p-CL12ApCQ.js +0 -820
  523. package/components/p-CXJR56Oq.js +0 -564
  524. package/components/p-Cdm3dKWf.js +0 -108
  525. package/components/p-CslsoGzv.js +0 -192
  526. package/components/p-Cyd00tgZ.js +0 -167
  527. package/components/p-CzAJ3ArC.js +0 -380
  528. package/components/p-CzW34QBh.js +0 -12
  529. package/components/p-D0zXRwcr.js +0 -196
  530. package/components/p-D5hF6rwn.js +0 -339
  531. package/components/p-D8eD2iBA.js +0 -67
  532. package/components/p-DGOrLIyS.js +0 -481
  533. package/components/p-DK2Bn1Mc.js +0 -305
  534. package/components/p-DKRQWlK2.js +0 -598
  535. package/components/p-DNDUsygf.js +0 -128
  536. package/components/p-DTWZF6wg.js +0 -418
  537. package/components/p-DWoUQeZ3.js +0 -3012
  538. package/components/p-DX0w75a9.js +0 -420
  539. package/components/p-Dt8zaCLQ.js +0 -92
  540. package/components/p-DyFBFrV7.js +0 -264
  541. package/components/p-DyHPCMyn.js +0 -39
  542. package/components/p-LgLeKTkH.js +0 -112
  543. package/components/p-NhiRFRn9.js +0 -50
  544. package/components/p-OuiHmXO5.js +0 -646
  545. package/components/p-Wro9IPHE.js +0 -459
  546. package/components/p-aIWC4ZEV.js +0 -305
  547. package/components/p-c-XJ9XhZ.js +0 -915
  548. package/components/p-fVuFT3Wd.js +0 -78
  549. package/components/p-iyo0Toaz.js +0 -2822
  550. package/components/p-l_lso3Zl.js +0 -140
  551. package/components/p-mQp4lwQD.js +0 -1638
  552. package/dist/cjs/app-globals-Ciccnk9_.js +0 -10
  553. package/dist/esm/app-globals-BDSf8fOA.js +0 -8
  554. package/dist/ionic/p-11518b31.entry.js +0 -4
  555. package/dist/ionic/p-221a3d8c.entry.js +0 -4
  556. package/dist/ionic/p-2ac254dc.entry.js +0 -4
  557. package/dist/ionic/p-2bd1ea35.entry.js +0 -4
  558. package/dist/ionic/p-30333874.entry.js +0 -4
  559. package/dist/ionic/p-31db96da.entry.js +0 -4
  560. package/dist/ionic/p-34642fa1.entry.js +0 -4
  561. package/dist/ionic/p-35696017.entry.js +0 -4
  562. package/dist/ionic/p-363d1209.entry.js +0 -4
  563. package/dist/ionic/p-46a38cfd.entry.js +0 -4
  564. package/dist/ionic/p-4eec1a5e.entry.js +0 -4
  565. package/dist/ionic/p-530fcd71.entry.js +0 -4
  566. package/dist/ionic/p-5d6fb6e3.entry.js +0 -4
  567. package/dist/ionic/p-66fbe052.entry.js +0 -4
  568. package/dist/ionic/p-7babec72.entry.js +0 -4
  569. package/dist/ionic/p-82d5bb3d.entry.js +0 -4
  570. package/dist/ionic/p-97eb0812.entry.js +0 -4
  571. package/dist/ionic/p-9b6d46f2.entry.js +0 -4
  572. package/dist/ionic/p-BKc55Xev.js +0 -4
  573. package/dist/ionic/p-Bmgaetn_.js +0 -4
  574. package/dist/ionic/p-C8IsBmNU.js +0 -5
  575. package/dist/ionic/p-CJxh_yLS.js +0 -4
  576. package/dist/ionic/p-DZRJwG4S.js +0 -4
  577. package/dist/ionic/p-a4a9f5ae.entry.js +0 -4
  578. package/dist/ionic/p-b0ebf9f8.entry.js +0 -4
  579. package/dist/ionic/p-be263062.entry.js +0 -4
  580. package/dist/ionic/p-c175d792.entry.js +0 -4
  581. package/dist/ionic/p-cc2a9936.entry.js +0 -4
  582. package/dist/ionic/p-cc45bcbc.entry.js +0 -4
  583. package/dist/ionic/p-d0a2a1ab.entry.js +0 -4
  584. package/dist/ionic/p-e4c57008.entry.js +0 -4
  585. package/dist/ionic/p-e5d6d0f0.entry.js +0 -4
  586. package/dist/ionic/p-f1dfee25.entry.js +0 -4
  587. package/dist/ionic/p-f9f7b9db.entry.js +0 -4
@@ -1,941 +1,4 @@
1
1
  /*!
2
2
  * (C) Ionic http://ionicframework.com - MIT License
3
3
  */
4
- import { f as printIonWarning, p as proxyCustomElement, H, e as createEvent, c as config, j as printIonError, h, d as Host } from './p-DWoUQeZ3.js';
5
- import { E as ENABLE_HTML_CONTENT_DEFAULT, a as sanitizeDOMString } from './p-CIJwkzL6.js';
6
- import { g as getElementRoot, r as raf } from './p-D5hF6rwn.js';
7
- import { c as createLockController } from './p-B-hirT0v.js';
8
- import { O as OVERLAY_GESTURE_PRIORITY, d as createDelegateController, e as createTriggerController, i as isCancel, j as prepareOverlay, k as setOverlayId, f as present, g as dismiss, h as eventMethod, s as safeCall, G as GESTURE } from './p-c-XJ9XhZ.js';
9
- import { c as createColorClasses, g as getClassMap } from './p-DiVJyqlX.js';
10
- import { b as getIonMode } from './p-Bxl5etF4.js';
11
- import { c as createAnimation } from './p-CL12ApCQ.js';
12
- import { w as win } from './p-ZjP4CjeZ.js';
13
- import { createGesture } from './p-Cl0B-RWe.js';
14
- import { d as defineCustomElement$3 } from './p-Wro9IPHE.js';
15
- import { d as defineCustomElement$2 } from './p-LgLeKTkH.js';
16
-
17
- /**
18
- * Calculate the CSS top and bottom position of the toast, to be used
19
- * as starting points for the animation keyframes.
20
- *
21
- * The default animations for both MD and iOS
22
- * use translateY, which calculates from the
23
- * top edge of the screen. This behavior impacts
24
- * how we compute the offset when a toast has
25
- * position='bottom' since we need to calculate from
26
- * the bottom edge of the screen instead.
27
- *
28
- * @param position The value of the toast's position prop.
29
- * @param positionAnchor The element the toast should be anchored to,
30
- * if applicable.
31
- * @param mode The toast component's mode (md, ios, etc).
32
- * @param toast A reference to the toast element itself.
33
- */
34
- function getAnimationPosition(position, positionAnchor, mode, toast) {
35
- /**
36
- * Start with a predefined offset from the edge the toast will be
37
- * positioned relative to, whether on the screen or anchor element.
38
- */
39
- let offset;
40
- if (mode === 'md') {
41
- offset = position === 'top' ? 8 : -8;
42
- }
43
- else {
44
- offset = position === 'top' ? 10 : -10;
45
- }
46
- /**
47
- * If positionAnchor is defined, add in the distance from the target
48
- * screen edge to the target anchor edge. For position="top", the
49
- * bottom anchor edge is targeted. For position="bottom", the top
50
- * anchor edge is targeted.
51
- */
52
- if (positionAnchor && win) {
53
- warnIfAnchorIsHidden(positionAnchor, toast);
54
- const box = positionAnchor.getBoundingClientRect();
55
- if (position === 'top') {
56
- offset += box.bottom;
57
- }
58
- else if (position === 'bottom') {
59
- /**
60
- * Just box.top is the distance from the top edge of the screen
61
- * to the top edge of the anchor. We want to calculate from the
62
- * bottom edge of the screen instead.
63
- */
64
- offset -= win.innerHeight - box.top;
65
- }
66
- /**
67
- * We don't include safe area here because that should already be
68
- * accounted for when checking the position of the anchor.
69
- */
70
- return {
71
- top: `${offset}px`,
72
- bottom: `${offset}px`,
73
- };
74
- }
75
- else {
76
- return {
77
- top: `calc(${offset}px + var(--ion-safe-area-top, 0px))`,
78
- bottom: `calc(${offset}px - var(--ion-safe-area-bottom, 0px))`,
79
- };
80
- }
81
- }
82
- /**
83
- * If the anchor element is hidden, getBoundingClientRect()
84
- * will return all 0s for it, which can cause unexpected
85
- * results in the position calculation when animating.
86
- */
87
- function warnIfAnchorIsHidden(positionAnchor, toast) {
88
- if (positionAnchor.offsetParent === null) {
89
- printIonWarning('[ion-toast] - The positionAnchor element for ion-toast was found in the DOM, but appears to be hidden. This may lead to unexpected positioning of the toast.', toast);
90
- }
91
- }
92
- /**
93
- * Returns the top offset required to place
94
- * the toast in the middle of the screen.
95
- * Only needed when position="toast".
96
- * @param toastHeight - The height of the ion-toast element
97
- * @param wrapperHeight - The height of the .toast-wrapper element
98
- * inside the toast's shadow root.
99
- */
100
- const getOffsetForMiddlePosition = (toastHeight, wrapperHeight) => {
101
- return Math.floor(toastHeight / 2 - wrapperHeight / 2);
102
- };
103
-
104
- /**
105
- * iOS Toast Enter Animation
106
- */
107
- const iosEnterAnimation = (baseEl, opts) => {
108
- const baseAnimation = createAnimation();
109
- const wrapperAnimation = createAnimation();
110
- const { position, top, bottom } = opts;
111
- const root = getElementRoot(baseEl);
112
- const wrapperEl = root.querySelector('.toast-wrapper');
113
- wrapperAnimation.addElement(wrapperEl);
114
- switch (position) {
115
- case 'top':
116
- wrapperAnimation.fromTo('transform', 'translateY(-100%)', `translateY(${top})`);
117
- break;
118
- case 'middle':
119
- const topPosition = getOffsetForMiddlePosition(baseEl.clientHeight, wrapperEl.clientHeight);
120
- wrapperEl.style.top = `${topPosition}px`;
121
- wrapperAnimation.fromTo('opacity', 0.01, 1);
122
- break;
123
- default:
124
- wrapperAnimation.fromTo('transform', 'translateY(100%)', `translateY(${bottom})`);
125
- break;
126
- }
127
- return baseAnimation.easing('cubic-bezier(.155,1.105,.295,1.12)').duration(400).addAnimation(wrapperAnimation);
128
- };
129
-
130
- /**
131
- * iOS Toast Leave Animation
132
- */
133
- const iosLeaveAnimation = (baseEl, opts) => {
134
- const baseAnimation = createAnimation();
135
- const wrapperAnimation = createAnimation();
136
- const { position, top, bottom } = opts;
137
- const root = getElementRoot(baseEl);
138
- const wrapperEl = root.querySelector('.toast-wrapper');
139
- wrapperAnimation.addElement(wrapperEl);
140
- switch (position) {
141
- case 'top':
142
- wrapperAnimation.fromTo('transform', `translateY(${top})`, 'translateY(-100%)');
143
- break;
144
- case 'middle':
145
- wrapperAnimation.fromTo('opacity', 0.99, 0);
146
- break;
147
- default:
148
- wrapperAnimation.fromTo('transform', `translateY(${bottom})`, 'translateY(100%)');
149
- break;
150
- }
151
- return baseAnimation.easing('cubic-bezier(.36,.66,.04,1)').duration(300).addAnimation(wrapperAnimation);
152
- };
153
-
154
- /**
155
- * MD Toast Enter Animation
156
- */
157
- const mdEnterAnimation = (baseEl, opts) => {
158
- const baseAnimation = createAnimation();
159
- const wrapperAnimation = createAnimation();
160
- const { position, top, bottom } = opts;
161
- const root = getElementRoot(baseEl);
162
- const wrapperEl = root.querySelector('.toast-wrapper');
163
- wrapperAnimation.addElement(wrapperEl);
164
- switch (position) {
165
- case 'top':
166
- wrapperEl.style.setProperty('transform', `translateY(${top})`);
167
- wrapperAnimation.fromTo('opacity', 0.01, 1);
168
- break;
169
- case 'middle':
170
- const topPosition = getOffsetForMiddlePosition(baseEl.clientHeight, wrapperEl.clientHeight);
171
- wrapperEl.style.top = `${topPosition}px`;
172
- wrapperAnimation.fromTo('opacity', 0.01, 1);
173
- break;
174
- default:
175
- wrapperEl.style.setProperty('transform', `translateY(${bottom})`);
176
- wrapperAnimation.fromTo('opacity', 0.01, 1);
177
- break;
178
- }
179
- return baseAnimation.easing('cubic-bezier(.36,.66,.04,1)').duration(400).addAnimation(wrapperAnimation);
180
- };
181
-
182
- /**
183
- * md Toast Leave Animation
184
- */
185
- const mdLeaveAnimation = (baseEl) => {
186
- const baseAnimation = createAnimation();
187
- const wrapperAnimation = createAnimation();
188
- const root = getElementRoot(baseEl);
189
- const wrapperEl = root.querySelector('.toast-wrapper');
190
- wrapperAnimation.addElement(wrapperEl).fromTo('opacity', 0.99, 0);
191
- return baseAnimation.easing('cubic-bezier(.36,.66,.04,1)').duration(300).addAnimation(wrapperAnimation);
192
- };
193
-
194
- /**
195
- * Create a gesture that allows the Toast
196
- * to be swiped to dismiss.
197
- * @param el - The Toast element
198
- * @param toastPosition - The last computed position of the Toast. This is computed in the "present" method.
199
- * @param onDismiss - A callback to fire when the Toast was swiped to dismiss.
200
- */
201
- const createSwipeToDismissGesture = (el, toastPosition, onDismiss) => {
202
- /**
203
- * Users should swipe on the visible toast wrapper
204
- * rather than on ion-toast which covers the entire screen.
205
- * When testing the class instance the inner wrapper will not
206
- * be defined. As a result, we use a placeholder element in those environments.
207
- */
208
- const wrapperEl = getElementRoot(el).querySelector('.toast-wrapper');
209
- const hostElHeight = el.clientHeight;
210
- const wrapperElBox = wrapperEl.getBoundingClientRect();
211
- /**
212
- * The maximum amount that
213
- * the toast can be swiped. This should
214
- * account for the wrapper element's height
215
- * too so the toast can be swiped offscreen
216
- * completely.
217
- */
218
- let MAX_SWIPE_DISTANCE = 0;
219
- /**
220
- * The step value at which a toast
221
- * is eligible for dismissing via gesture.
222
- */
223
- const DISMISS_THRESHOLD = 0.5;
224
- /**
225
- * The middle position Toast starts 50% of the way
226
- * through the animation, so we need to use this
227
- * as the starting point for our step values.
228
- */
229
- const STEP_OFFSET = el.position === 'middle' ? 0.5 : 0;
230
- /**
231
- * When the Toast is at the top users will be
232
- * swiping up. As a result, the delta values will be
233
- * negative numbers which will result in negative steps
234
- * and thresholds. As a result, we need to make those numbers
235
- * positive.
236
- */
237
- const INVERSION_FACTOR = el.position === 'top' ? -1 : 1;
238
- /**
239
- * The top offset that places the
240
- * toast in the middle of the screen.
241
- * Only needed when position="middle".
242
- */
243
- const topPosition = getOffsetForMiddlePosition(hostElHeight, wrapperElBox.height);
244
- const SWIPE_UP_DOWN_KEYFRAMES = [
245
- { offset: 0, transform: `translateY(-${topPosition + wrapperElBox.height}px)` },
246
- { offset: 0.5, transform: `translateY(0px)` },
247
- { offset: 1, transform: `translateY(${topPosition + wrapperElBox.height}px)` },
248
- ];
249
- const swipeAnimation = createAnimation('toast-swipe-to-dismiss-animation')
250
- .addElement(wrapperEl)
251
- /**
252
- * The specific value here does not actually
253
- * matter. We just need this to be a positive
254
- * value so the animation does not jump
255
- * to the end when the user beings to drag.
256
- */
257
- .duration(100);
258
- switch (el.position) {
259
- case 'middle':
260
- MAX_SWIPE_DISTANCE = hostElHeight + wrapperElBox.height;
261
- swipeAnimation.keyframes(SWIPE_UP_DOWN_KEYFRAMES);
262
- /**
263
- * Toast can be swiped up or down but
264
- * should start in the middle of the screen.
265
- */
266
- swipeAnimation.progressStart(true, 0.5);
267
- break;
268
- case 'top':
269
- /**
270
- * The bottom edge of the wrapper
271
- * includes the distance between the top
272
- * of the screen and the top of the wrapper
273
- * as well as the wrapper height so the wrapper
274
- * can be dragged fully offscreen.
275
- */
276
- MAX_SWIPE_DISTANCE = wrapperElBox.bottom;
277
- swipeAnimation.keyframes([
278
- { offset: 0, transform: `translateY(${toastPosition.top})` },
279
- { offset: 1, transform: 'translateY(-100%)' },
280
- ]);
281
- swipeAnimation.progressStart(true, 0);
282
- break;
283
- case 'bottom':
284
- default:
285
- /**
286
- * This computes the distance between the
287
- * top of the wrapper and the bottom of the
288
- * screen including the height of the wrapper
289
- * element so it can be dragged fully offscreen.
290
- */
291
- MAX_SWIPE_DISTANCE = hostElHeight - wrapperElBox.top;
292
- swipeAnimation.keyframes([
293
- { offset: 0, transform: `translateY(${toastPosition.bottom})` },
294
- { offset: 1, transform: 'translateY(100%)' },
295
- ]);
296
- swipeAnimation.progressStart(true, 0);
297
- break;
298
- }
299
- const computeStep = (delta) => {
300
- return (delta * INVERSION_FACTOR) / MAX_SWIPE_DISTANCE;
301
- };
302
- const onMove = (detail) => {
303
- const step = STEP_OFFSET + computeStep(detail.deltaY);
304
- swipeAnimation.progressStep(step);
305
- };
306
- const onEnd = (detail) => {
307
- const velocity = detail.velocityY;
308
- const threshold = ((detail.deltaY + velocity * 1000) / MAX_SWIPE_DISTANCE) * INVERSION_FACTOR;
309
- /**
310
- * Disable the gesture for the remainder of the animation.
311
- * It will be re-enabled if the toast animates back to
312
- * its initial presented position.
313
- */
314
- gesture.enable(false);
315
- let shouldDismiss = true;
316
- let playTo = 1;
317
- let step = 0;
318
- let remainingDistance = 0;
319
- if (el.position === 'middle') {
320
- /**
321
- * A middle positioned Toast appears
322
- * in the middle of the screen (at animation offset 0.5).
323
- * As a result, the threshold will be calculated relative
324
- * to this starting position. In other words at animation offset 0.5
325
- * the threshold will be 0. We want the middle Toast to be eligible
326
- * for dismiss when the user has swiped either half way up or down the
327
- * screen. As a result, we divide DISMISS_THRESHOLD in half. We also
328
- * consider when the threshold is a negative in the event the
329
- * user drags up (since the deltaY will also be negative).
330
- */
331
- shouldDismiss = threshold >= DISMISS_THRESHOLD / 2 || threshold <= -0.5 / 2;
332
- /**
333
- * Since we are replacing the keyframes
334
- * below the animation always starts from
335
- * the beginning of the new keyframes.
336
- * Similarly, we are always playing to
337
- * the end of the new keyframes.
338
- */
339
- playTo = 1;
340
- step = 0;
341
- /**
342
- * The Toast should animate from wherever its
343
- * current position is to the desired end state.
344
- *
345
- * To begin, we get the current position of the
346
- * Toast for its starting state.
347
- */
348
- const wrapperElBox = wrapperEl.getBoundingClientRect();
349
- const startOffset = wrapperElBox.top - topPosition;
350
- const startPosition = `${startOffset}px`;
351
- /**
352
- * If the deltaY is negative then the user is swiping
353
- * up, so the Toast should animate to the top of the screen.
354
- * If the deltaY is positive then the user is swiping
355
- * down, so the Toast should animate to the bottom of the screen.
356
- * We also account for when the deltaY is 0, but realistically
357
- * that should never happen because it means the user did not drag
358
- * the toast.
359
- */
360
- const offsetFactor = detail.deltaY <= 0 ? -1 : 1;
361
- const endOffset = (topPosition + wrapperElBox.height) * offsetFactor;
362
- /**
363
- * If the Toast should dismiss
364
- * then we need to figure out which edge of
365
- * the screen it should animate towards.
366
- * By default, the Toast will come
367
- * back to its default state in the
368
- * middle of the screen.
369
- */
370
- const endPosition = shouldDismiss ? `${endOffset}px` : '0px';
371
- const KEYFRAMES = [
372
- { offset: 0, transform: `translateY(${startPosition})` },
373
- { offset: 1, transform: `translateY(${endPosition})` },
374
- ];
375
- swipeAnimation.keyframes(KEYFRAMES);
376
- /**
377
- * Compute the remaining amount of pixels the
378
- * toast needs to move to be fully dismissed.
379
- */
380
- remainingDistance = endOffset - startOffset;
381
- }
382
- else {
383
- shouldDismiss = threshold >= DISMISS_THRESHOLD;
384
- playTo = shouldDismiss ? 1 : 0;
385
- step = computeStep(detail.deltaY);
386
- /**
387
- * Compute the remaining amount of pixels the
388
- * toast needs to move to be fully dismissed.
389
- */
390
- const remainingStepAmount = shouldDismiss ? 1 - step : step;
391
- remainingDistance = remainingStepAmount * MAX_SWIPE_DISTANCE;
392
- }
393
- /**
394
- * The animation speed should depend on how quickly
395
- * the user flicks the toast across the screen. However,
396
- * it should be no slower than 200ms.
397
- * We use Math.abs on the remainingDistance because that value
398
- * can be negative when swiping up on a middle position toast.
399
- */
400
- const duration = Math.min(Math.abs(remainingDistance) / Math.abs(velocity), 200);
401
- swipeAnimation
402
- .onFinish(() => {
403
- if (shouldDismiss) {
404
- onDismiss();
405
- swipeAnimation.destroy();
406
- }
407
- else {
408
- if (el.position === 'middle') {
409
- /**
410
- * If the toast snapped back to
411
- * the middle of the screen we need
412
- * to reset the keyframes
413
- * so the toast can be swiped
414
- * up or down again.
415
- */
416
- swipeAnimation.keyframes(SWIPE_UP_DOWN_KEYFRAMES).progressStart(true, 0.5);
417
- }
418
- else {
419
- swipeAnimation.progressStart(true, 0);
420
- }
421
- /**
422
- * If the toast did not dismiss then
423
- * the user should be able to swipe again.
424
- */
425
- gesture.enable(true);
426
- }
427
- /**
428
- * This must be a one time callback
429
- * otherwise a new callback will
430
- * be added every time onEnd runs.
431
- */
432
- }, { oneTimeCallback: true })
433
- .progressEnd(playTo, step, duration);
434
- };
435
- const gesture = createGesture({
436
- el: wrapperEl,
437
- gestureName: 'toast-swipe-to-dismiss',
438
- gesturePriority: OVERLAY_GESTURE_PRIORITY,
439
- /**
440
- * Toast only supports vertical swipes.
441
- * This needs to be updated if we later
442
- * support horizontal swipes.
443
- */
444
- direction: 'y',
445
- onMove,
446
- onEnd,
447
- });
448
- return gesture;
449
- };
450
-
451
- const toastIosCss = ":host{--border-width:0;--border-style:none;--border-color:initial;--box-shadow:none;--min-width:auto;--width:auto;--min-height:auto;--height:auto;--max-height:auto;--white-space:normal;top:0;display:block;position:absolute;width:100%;height:100%;outline:none;color:var(--color);font-family:var(--ion-font-family, inherit);contain:strict;z-index:1001;pointer-events:none}:host{inset-inline-start:0}:host(.overlay-hidden){display:none}:host(.ion-color){--button-color:inherit;color:var(--ion-color-contrast)}:host(.ion-color) .toast-button-cancel{color:inherit}:host(.ion-color) .toast-wrapper{background:var(--ion-color-base)}.toast-wrapper{border-radius:var(--border-radius);width:var(--width);min-width:var(--min-width);max-width:var(--max-width);height:var(--height);min-height:var(--min-height);max-height:var(--max-height);border-width:var(--border-width);border-style:var(--border-style);border-color:var(--border-color);background:var(--background);-webkit-box-shadow:var(--box-shadow);box-shadow:var(--box-shadow);pointer-events:auto}.toast-wrapper{inset-inline-start:var(--start);inset-inline-end:var(--end)}.toast-wrapper.toast-top{-webkit-transform:translate3d(0, -100%, 0);transform:translate3d(0, -100%, 0);top:0}.toast-wrapper.toast-bottom{-webkit-transform:translate3d(0, 100%, 0);transform:translate3d(0, 100%, 0);bottom:0}.toast-container{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;height:inherit;min-height:inherit;max-height:inherit;contain:content}.toast-layout-stacked .toast-container{-ms-flex-wrap:wrap;flex-wrap:wrap}.toast-layout-baseline .toast-content{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;-ms-flex-pack:center;justify-content:center}.toast-icon{-webkit-margin-start:16px;margin-inline-start:16px}.toast-content{-ms-flex:1;flex:1;min-width:0}.toast-message{-ms-flex:1;flex:1;white-space:var(--white-space)}.toast-button-group{display:-ms-flexbox;display:flex}.toast-layout-stacked .toast-button-group{-ms-flex-pack:end;justify-content:end;width:100%}.toast-button{border:0;outline:none;color:var(--button-color);z-index:0}.toast-icon,.toast-button-icon{font-size:1.4em}.toast-button-inner{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center}@media (any-hover: hover){.toast-button:hover{cursor:pointer}}:host{--background:var(--ion-color-step-50, var(--ion-background-color-step-50, #f2f2f2));--border-radius:14px;--button-color:var(--ion-color-primary, #0054e9);--color:var(--ion-color-step-850, var(--ion-text-color-step-150, #262626));--max-width:700px;--max-height:478px;--start:10px;--end:10px;font-size:clamp(14px, 0.875rem, 43.4px)}.toast-wrapper{-webkit-margin-start:auto;margin-inline-start:auto;-webkit-margin-end:auto;margin-inline-end:auto;margin-top:auto;margin-bottom:auto;display:block;position:absolute;z-index:10}@supports ((-webkit-backdrop-filter: blur(0)) or (backdrop-filter: blur(0))){:host(.toast-translucent) .toast-wrapper{background:rgba(var(--ion-background-color-rgb, 255, 255, 255), 0.8);-webkit-backdrop-filter:saturate(180%) blur(20px);backdrop-filter:saturate(180%) blur(20px)}:host(.ion-color.toast-translucent) .toast-wrapper{background:rgba(var(--ion-color-base-rgb), 0.8)}}.toast-wrapper.toast-middle{opacity:0.01}.toast-content{-webkit-padding-start:15px;padding-inline-start:15px;-webkit-padding-end:15px;padding-inline-end:15px;padding-top:15px;padding-bottom:15px}.toast-header{margin-bottom:2px;font-weight:500}.toast-button{-webkit-padding-start:15px;padding-inline-start:15px;-webkit-padding-end:15px;padding-inline-end:15px;padding-top:10px;padding-bottom:10px;min-height:44px;-webkit-transition:background-color, opacity 100ms linear;transition:background-color, opacity 100ms linear;border:0;background-color:transparent;font-family:var(--ion-font-family);font-size:clamp(17px, 1.0625rem, 21.998px);font-weight:500;overflow:hidden}.toast-button.ion-activated{opacity:0.4}@media (any-hover: hover){.toast-button:hover{opacity:0.6}}";
452
-
453
- const toastMdCss = ":host{--border-width:0;--border-style:none;--border-color:initial;--box-shadow:none;--min-width:auto;--width:auto;--min-height:auto;--height:auto;--max-height:auto;--white-space:normal;top:0;display:block;position:absolute;width:100%;height:100%;outline:none;color:var(--color);font-family:var(--ion-font-family, inherit);contain:strict;z-index:1001;pointer-events:none}:host{inset-inline-start:0}:host(.overlay-hidden){display:none}:host(.ion-color){--button-color:inherit;color:var(--ion-color-contrast)}:host(.ion-color) .toast-button-cancel{color:inherit}:host(.ion-color) .toast-wrapper{background:var(--ion-color-base)}.toast-wrapper{border-radius:var(--border-radius);width:var(--width);min-width:var(--min-width);max-width:var(--max-width);height:var(--height);min-height:var(--min-height);max-height:var(--max-height);border-width:var(--border-width);border-style:var(--border-style);border-color:var(--border-color);background:var(--background);-webkit-box-shadow:var(--box-shadow);box-shadow:var(--box-shadow);pointer-events:auto}.toast-wrapper{inset-inline-start:var(--start);inset-inline-end:var(--end)}.toast-wrapper.toast-top{-webkit-transform:translate3d(0, -100%, 0);transform:translate3d(0, -100%, 0);top:0}.toast-wrapper.toast-bottom{-webkit-transform:translate3d(0, 100%, 0);transform:translate3d(0, 100%, 0);bottom:0}.toast-container{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;height:inherit;min-height:inherit;max-height:inherit;contain:content}.toast-layout-stacked .toast-container{-ms-flex-wrap:wrap;flex-wrap:wrap}.toast-layout-baseline .toast-content{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;-ms-flex-pack:center;justify-content:center}.toast-icon{-webkit-margin-start:16px;margin-inline-start:16px}.toast-content{-ms-flex:1;flex:1;min-width:0}.toast-message{-ms-flex:1;flex:1;white-space:var(--white-space)}.toast-button-group{display:-ms-flexbox;display:flex}.toast-layout-stacked .toast-button-group{-ms-flex-pack:end;justify-content:end;width:100%}.toast-button{border:0;outline:none;color:var(--button-color);z-index:0}.toast-icon,.toast-button-icon{font-size:1.4em}.toast-button-inner{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center}@media (any-hover: hover){.toast-button:hover{cursor:pointer}}:host{--background:var(--ion-color-step-800, var(--ion-background-color-step-800, #333333));--border-radius:4px;--box-shadow:0 3px 5px -1px rgba(0, 0, 0, 0.2), 0 6px 10px 0 rgba(0, 0, 0, 0.14), 0 1px 18px 0 rgba(0, 0, 0, 0.12);--button-color:var(--ion-color-primary, #0054e9);--color:var(--ion-color-step-50, var(--ion-text-color-step-950, #f2f2f2));--max-width:700px;--start:8px;--end:8px;font-size:0.875rem}.toast-wrapper{-webkit-margin-start:auto;margin-inline-start:auto;-webkit-margin-end:auto;margin-inline-end:auto;margin-top:auto;margin-bottom:auto;display:block;position:absolute;opacity:0.01;z-index:10}.toast-content{-webkit-padding-start:16px;padding-inline-start:16px;-webkit-padding-end:16px;padding-inline-end:16px;padding-top:14px;padding-bottom:14px}.toast-header{margin-bottom:2px;font-weight:500;line-height:1.25rem}.toast-message{line-height:1.25rem}.toast-layout-baseline .toast-button-group-start{-webkit-margin-start:8px;margin-inline-start:8px}.toast-layout-stacked .toast-button-group-start{-webkit-margin-end:8px;margin-inline-end:8px;margin-top:8px}.toast-layout-baseline .toast-button-group-end{-webkit-margin-end:8px;margin-inline-end:8px}.toast-layout-stacked .toast-button-group-end{-webkit-margin-end:8px;margin-inline-end:8px;margin-bottom:8px}.toast-button{-webkit-padding-start:15px;padding-inline-start:15px;-webkit-padding-end:15px;padding-inline-end:15px;padding-top:10px;padding-bottom:10px;position:relative;background-color:transparent;font-family:var(--ion-font-family);font-size:0.875rem;font-weight:500;letter-spacing:0.84px;text-transform:uppercase;overflow:hidden}.toast-button-cancel{color:var(--ion-color-step-100, var(--ion-text-color-step-900, #e6e6e6))}.toast-button-icon-only{border-radius:50%;-webkit-padding-start:9px;padding-inline-start:9px;-webkit-padding-end:9px;padding-inline-end:9px;padding-top:9px;padding-bottom:9px;width:36px;height:36px}@media (any-hover: hover){.toast-button:hover{background-color:rgba(var(--ion-color-primary-rgb, 0, 84, 233), 0.08)}.toast-button-cancel:hover{background-color:rgba(var(--ion-background-color-rgb, 255, 255, 255), 0.08)}}";
454
-
455
- const Toast = /*@__PURE__*/ proxyCustomElement(class Toast extends H {
456
- constructor(registerHost) {
457
- super();
458
- if (registerHost !== false) {
459
- this.__registerHost();
460
- }
461
- this.__attachShadow();
462
- this.didPresent = createEvent(this, "ionToastDidPresent", 7);
463
- this.willPresent = createEvent(this, "ionToastWillPresent", 7);
464
- this.willDismiss = createEvent(this, "ionToastWillDismiss", 7);
465
- this.didDismiss = createEvent(this, "ionToastDidDismiss", 7);
466
- this.didPresentShorthand = createEvent(this, "didPresent", 7);
467
- this.willPresentShorthand = createEvent(this, "willPresent", 7);
468
- this.willDismissShorthand = createEvent(this, "willDismiss", 7);
469
- this.didDismissShorthand = createEvent(this, "didDismiss", 7);
470
- this.delegateController = createDelegateController(this);
471
- this.lockController = createLockController();
472
- this.triggerController = createTriggerController();
473
- this.customHTMLEnabled = config.get('innerHTMLTemplatesEnabled', ENABLE_HTML_CONTENT_DEFAULT);
474
- this.presented = false;
475
- /**
476
- * When `true`, content inside of .toast-content
477
- * will have aria-hidden elements removed causing
478
- * screen readers to announce the remaining content.
479
- */
480
- this.revealContentToScreenReader = false;
481
- /** @internal */
482
- this.hasController = false;
483
- /**
484
- * How many milliseconds to wait before hiding the toast. By default, it will show
485
- * until `dismiss()` is called.
486
- */
487
- this.duration = config.getNumber('toastDuration', 0);
488
- /**
489
- * Defines how the message and buttons are laid out in the toast.
490
- * 'baseline': The message and the buttons will appear on the same line.
491
- * Message text may wrap within the message container.
492
- * 'stacked': The buttons containers and message will stack on top
493
- * of each other. Use this if you have long text in your buttons.
494
- */
495
- this.layout = 'baseline';
496
- /**
497
- * If `true`, the keyboard will be automatically dismissed when the overlay is presented.
498
- */
499
- this.keyboardClose = false;
500
- /**
501
- * The starting position of the toast on the screen. Can be tweaked further
502
- * using the `positionAnchor` property.
503
- */
504
- this.position = 'bottom';
505
- /**
506
- * If `true`, the toast will be translucent.
507
- * Only applies when the mode is `"ios"` and the device supports
508
- * [`backdrop-filter`](https://developer.mozilla.org/en-US/docs/Web/CSS/backdrop-filter#Browser_compatibility).
509
- */
510
- this.translucent = false;
511
- /**
512
- * If `true`, the toast will animate.
513
- */
514
- this.animated = true;
515
- /**
516
- * If `true`, the toast will open. If `false`, the toast will close.
517
- * Use this if you need finer grained control over presentation, otherwise
518
- * just use the toastController or the `trigger` property.
519
- * Note: `isOpen` will not automatically be set back to `false` when
520
- * the toast dismisses. You will need to do that in your code.
521
- */
522
- this.isOpen = false;
523
- this.dispatchCancelHandler = (ev) => {
524
- const role = ev.detail.role;
525
- if (isCancel(role)) {
526
- const cancelButton = this.getButtons().find((b) => b.role === 'cancel');
527
- this.callButtonHandler(cancelButton);
528
- }
529
- };
530
- /**
531
- * Create a new swipe gesture so Toast
532
- * can be swiped to dismiss.
533
- */
534
- this.createSwipeGesture = (toastPosition) => {
535
- const gesture = (this.gesture = createSwipeToDismissGesture(this.el, toastPosition, () => {
536
- /**
537
- * If the gesture completed then
538
- * we should dismiss the toast.
539
- */
540
- this.dismiss(undefined, GESTURE);
541
- }));
542
- gesture.enable(true);
543
- };
544
- /**
545
- * Destroy an existing swipe gesture
546
- * so Toast can no longer be swiped to dismiss.
547
- */
548
- this.destroySwipeGesture = () => {
549
- const { gesture } = this;
550
- if (gesture === undefined) {
551
- return;
552
- }
553
- gesture.destroy();
554
- this.gesture = undefined;
555
- };
556
- /**
557
- * Returns `true` if swipeGesture
558
- * is configured to a value that enables the swipe behavior.
559
- * Returns `false` otherwise.
560
- */
561
- this.prefersSwipeGesture = () => {
562
- const { swipeGesture } = this;
563
- return swipeGesture === 'vertical';
564
- };
565
- }
566
- swipeGestureChanged() {
567
- /**
568
- * If the Toast is presented, then we need to destroy
569
- * any actives gestures before a new gesture is potentially
570
- * created below.
571
- *
572
- * If the Toast is dismissed, then no gesture should be available
573
- * since the Toast is not visible. This case should never
574
- * happen since the "dismiss" method handles destroying
575
- * any active swipe gestures, but we keep this code
576
- * around to handle the first case.
577
- */
578
- this.destroySwipeGesture();
579
- /**
580
- * A new swipe gesture should only be created
581
- * if the Toast is presented. If the Toast is not
582
- * yet presented then the "present" method will
583
- * handle calling the swipe gesture setup function.
584
- */
585
- if (this.presented && this.prefersSwipeGesture()) {
586
- /**
587
- * If the Toast is presented then
588
- * lastPresentedPosition is defined.
589
- */
590
- this.createSwipeGesture(this.lastPresentedPosition);
591
- }
592
- }
593
- onIsOpenChange(newValue, oldValue) {
594
- if (newValue === true && oldValue === false) {
595
- this.present();
596
- }
597
- else if (newValue === false && oldValue === true) {
598
- this.dismiss();
599
- }
600
- }
601
- triggerChanged() {
602
- const { trigger, el, triggerController } = this;
603
- if (trigger) {
604
- triggerController.addClickListener(el, trigger);
605
- }
606
- }
607
- connectedCallback() {
608
- prepareOverlay(this.el);
609
- this.triggerChanged();
610
- }
611
- disconnectedCallback() {
612
- this.triggerController.removeClickListener();
613
- }
614
- componentWillLoad() {
615
- var _a;
616
- if (!((_a = this.htmlAttributes) === null || _a === void 0 ? void 0 : _a.id)) {
617
- setOverlayId(this.el);
618
- }
619
- }
620
- componentDidLoad() {
621
- /**
622
- * If toast was rendered with isOpen="true"
623
- * then we should open toast immediately.
624
- */
625
- if (this.isOpen === true) {
626
- raf(() => this.present());
627
- }
628
- /**
629
- * When binding values in frameworks such as Angular
630
- * it is possible for the value to be set after the Web Component
631
- * initializes but before the value watcher is set up in Stencil.
632
- * As a result, the watcher callback may not be fired.
633
- * We work around this by manually calling the watcher
634
- * callback when the component has loaded and the watcher
635
- * is configured.
636
- */
637
- this.triggerChanged();
638
- }
639
- /**
640
- * Present the toast overlay after it has been created.
641
- */
642
- async present() {
643
- const unlock = await this.lockController.lock();
644
- await this.delegateController.attachViewToDom();
645
- const { el, position } = this;
646
- const anchor = this.getAnchorElement();
647
- const animationPosition = getAnimationPosition(position, anchor, getIonMode(this), el);
648
- /**
649
- * Cache the calculated position of the toast, so we can re-use it
650
- * in the dismiss animation.
651
- */
652
- this.lastPresentedPosition = animationPosition;
653
- await present(this, 'toastEnter', iosEnterAnimation, mdEnterAnimation, {
654
- position,
655
- top: animationPosition.top,
656
- bottom: animationPosition.bottom,
657
- });
658
- /**
659
- * Content is revealed to screen readers after
660
- * the transition to avoid jank since this
661
- * state updates will cause a re-render.
662
- */
663
- this.revealContentToScreenReader = true;
664
- if (this.duration > 0) {
665
- this.durationTimeout = setTimeout(() => this.dismiss(undefined, 'timeout'), this.duration);
666
- }
667
- /**
668
- * If the Toast has a swipe gesture then we can
669
- * create the gesture so users can swipe the
670
- * presented Toast.
671
- */
672
- if (this.prefersSwipeGesture()) {
673
- this.createSwipeGesture(animationPosition);
674
- }
675
- unlock();
676
- }
677
- /**
678
- * Dismiss the toast overlay after it has been presented.
679
- * This is a no-op if the overlay has not been presented yet. If you want
680
- * to remove an overlay from the DOM that was never presented, use the
681
- * [remove](https://developer.mozilla.org/en-US/docs/Web/API/Element/remove) method.
682
- *
683
- * @param data Any data to emit in the dismiss events.
684
- * @param role The role of the element that is dismissing the toast.
685
- * This can be useful in a button handler for determining which button was
686
- * clicked to dismiss the toast.
687
- * Some examples include: `"cancel"`, `"destructive"`, `"selected"`, and `"backdrop"`.
688
- */
689
- async dismiss(data, role) {
690
- var _a, _b;
691
- const unlock = await this.lockController.lock();
692
- const { durationTimeout, position, lastPresentedPosition } = this;
693
- if (durationTimeout) {
694
- clearTimeout(durationTimeout);
695
- }
696
- const dismissed = await dismiss(this, data, role, 'toastLeave', iosLeaveAnimation, mdLeaveAnimation,
697
- /**
698
- * Fetch the cached position that was calculated back in the present
699
- * animation. We always want to animate the dismiss from the same
700
- * position the present stopped at, so the animation looks continuous.
701
- */
702
- {
703
- position,
704
- top: (_a = lastPresentedPosition === null || lastPresentedPosition === void 0 ? void 0 : lastPresentedPosition.top) !== null && _a !== void 0 ? _a : '',
705
- bottom: (_b = lastPresentedPosition === null || lastPresentedPosition === void 0 ? void 0 : lastPresentedPosition.bottom) !== null && _b !== void 0 ? _b : '',
706
- });
707
- if (dismissed) {
708
- this.delegateController.removeViewFromDom();
709
- this.revealContentToScreenReader = false;
710
- }
711
- this.lastPresentedPosition = undefined;
712
- /**
713
- * If the Toast has a swipe gesture then we can
714
- * safely destroy it now that it is dismissed.
715
- */
716
- this.destroySwipeGesture();
717
- unlock();
718
- return dismissed;
719
- }
720
- /**
721
- * Returns a promise that resolves when the toast did dismiss.
722
- */
723
- onDidDismiss() {
724
- return eventMethod(this.el, 'ionToastDidDismiss');
725
- }
726
- /**
727
- * Returns a promise that resolves when the toast will dismiss.
728
- */
729
- onWillDismiss() {
730
- return eventMethod(this.el, 'ionToastWillDismiss');
731
- }
732
- getButtons() {
733
- const buttons = this.buttons
734
- ? this.buttons.map((b) => {
735
- return typeof b === 'string' ? { text: b } : b;
736
- })
737
- : [];
738
- return buttons;
739
- }
740
- /**
741
- * Returns the element specified by the positionAnchor prop,
742
- * or undefined if prop's value is an ID string and the element
743
- * is not found in the DOM.
744
- */
745
- getAnchorElement() {
746
- const { position, positionAnchor, el } = this;
747
- /**
748
- * If positionAnchor is undefined then
749
- * no anchor should be used when presenting the toast.
750
- */
751
- if (positionAnchor === undefined) {
752
- return;
753
- }
754
- if (position === 'middle' && positionAnchor !== undefined) {
755
- printIonWarning('[ion-toast] - The positionAnchor property is ignored when using position="middle".', this.el);
756
- return undefined;
757
- }
758
- if (typeof positionAnchor === 'string') {
759
- /**
760
- * If the anchor is defined as an ID, find the element.
761
- * We do this on every present so the toast doesn't need
762
- * to account for the surrounding DOM changing since the
763
- * last time it was presented.
764
- */
765
- const foundEl = document.getElementById(positionAnchor);
766
- if (foundEl === null) {
767
- printIonWarning(`[ion-toast] - An anchor element with an ID of "${positionAnchor}" was not found in the DOM.`, el);
768
- return undefined;
769
- }
770
- return foundEl;
771
- }
772
- if (positionAnchor instanceof H) {
773
- return positionAnchor;
774
- }
775
- printIonWarning('[ion-toast] - Invalid positionAnchor value:', positionAnchor, el);
776
- return undefined;
777
- }
778
- async buttonClick(button) {
779
- const role = button.role;
780
- if (isCancel(role)) {
781
- return this.dismiss(undefined, role);
782
- }
783
- const shouldDismiss = await this.callButtonHandler(button);
784
- if (shouldDismiss) {
785
- return this.dismiss(undefined, role);
786
- }
787
- return Promise.resolve();
788
- }
789
- async callButtonHandler(button) {
790
- if (button === null || button === void 0 ? void 0 : button.handler) {
791
- // a handler has been provided, execute it
792
- // pass the handler the values from the inputs
793
- try {
794
- const rtn = await safeCall(button.handler);
795
- if (rtn === false) {
796
- // if the return value of the handler is false then do not dismiss
797
- return false;
798
- }
799
- }
800
- catch (e) {
801
- printIonError('[ion-toast] - Exception in callButtonHandler:', e);
802
- }
803
- }
804
- return true;
805
- }
806
- renderButtons(buttons, side) {
807
- if (buttons.length === 0) {
808
- return;
809
- }
810
- const mode = getIonMode(this);
811
- const buttonGroupsClasses = {
812
- 'toast-button-group': true,
813
- [`toast-button-group-${side}`]: true,
814
- };
815
- return (h("div", { class: buttonGroupsClasses }, buttons.map((b) => (h("button", Object.assign({}, b.htmlAttributes, { type: "button", class: buttonClass(b), tabIndex: 0, onClick: () => this.buttonClick(b), part: buttonPart(b) }), h("div", { class: "toast-button-inner" }, b.icon && (h("ion-icon", { "aria-hidden": "true", icon: b.icon, slot: b.text === undefined ? 'icon-only' : undefined, class: "toast-button-icon" })), b.text), mode === 'md' && (h("ion-ripple-effect", { type: b.icon !== undefined && b.text === undefined ? 'unbounded' : 'bounded' })))))));
816
- }
817
- /**
818
- * Render the `message` property.
819
- * @param key - A key to give the element a stable identity. This is used to improve compatibility with screen readers.
820
- * @param ariaHidden - If "true" then content will be hidden from screen readers.
821
- */
822
- renderToastMessage(key, ariaHidden = null) {
823
- const { customHTMLEnabled, message } = this;
824
- if (customHTMLEnabled) {
825
- return (h("div", { key: key, "aria-hidden": ariaHidden, class: "toast-message", part: "message", innerHTML: sanitizeDOMString(message) }));
826
- }
827
- return (h("div", { key: key, "aria-hidden": ariaHidden, class: "toast-message", part: "message" }, message));
828
- }
829
- /**
830
- * Render the `header` property.
831
- * @param key - A key to give the element a stable identity. This is used to improve compatibility with screen readers.
832
- * @param ariaHidden - If "true" then content will be hidden from screen readers.
833
- */
834
- renderHeader(key, ariaHidden = null) {
835
- return (h("div", { key: key, class: "toast-header", "aria-hidden": ariaHidden, part: "header" }, this.header));
836
- }
837
- render() {
838
- const { layout, el, revealContentToScreenReader, header, message } = this;
839
- const allButtons = this.getButtons();
840
- const startButtons = allButtons.filter((b) => b.side === 'start');
841
- const endButtons = allButtons.filter((b) => b.side !== 'start');
842
- const mode = getIonMode(this);
843
- const wrapperClass = {
844
- 'toast-wrapper': true,
845
- [`toast-${this.position}`]: true,
846
- [`toast-layout-${layout}`]: true,
847
- };
848
- /**
849
- * Stacked buttons are only meant to be
850
- * used with one type of button.
851
- */
852
- if (layout === 'stacked' && startButtons.length > 0 && endButtons.length > 0) {
853
- printIonWarning('[ion-toast] - This toast is using start and end buttons with the stacked toast layout. We recommend following the best practice of using either start or end buttons with the stacked toast layout.', el);
854
- }
855
- return (h(Host, Object.assign({ key: '4a303f9ebb69614e9dca677d9d80a4a275de0d85', tabindex: "-1" }, this.htmlAttributes, { style: {
856
- zIndex: `${60000 + this.overlayIndex}`,
857
- }, class: createColorClasses(this.color, Object.assign(Object.assign({ [mode]: true }, getClassMap(this.cssClass)), { 'overlay-hidden': true, 'toast-translucent': this.translucent })), onIonToastWillDismiss: this.dispatchCancelHandler }), h("div", { key: '4f58fcbba8dce9834eab743fc91715935216f3d0', class: wrapperClass }, h("div", { key: 'bbc7b73b186432bd4be8247c5de2ce3b2551fb0a', class: "toast-container", part: "container" }, this.renderButtons(startButtons, 'start'), this.icon !== undefined && (h("ion-icon", { key: '0b953478eb739ceb864373416183bfbf5ce2f9f1', class: "toast-icon", part: "icon", icon: this.icon, lazy: false, "aria-hidden": "true" })), h("div", { key: '7a63497d1c0440256218426194851a969b042ca6', class: "toast-content", role: "status", "aria-atomic": "true", "aria-live": "polite" }, !revealContentToScreenReader && header !== undefined && this.renderHeader('oldHeader', 'true'), !revealContentToScreenReader && message !== undefined && this.renderToastMessage('oldMessage', 'true'), revealContentToScreenReader && header !== undefined && this.renderHeader('header'), revealContentToScreenReader && message !== undefined && this.renderToastMessage('header')), this.renderButtons(endButtons, 'end')))));
858
- }
859
- get el() { return this; }
860
- static get watchers() { return {
861
- "swipeGesture": ["swipeGestureChanged"],
862
- "isOpen": ["onIsOpenChange"],
863
- "trigger": ["triggerChanged"]
864
- }; }
865
- static get style() { return {
866
- ios: toastIosCss,
867
- md: toastMdCss
868
- }; }
869
- }, [289, "ion-toast", {
870
- "overlayIndex": [2, "overlay-index"],
871
- "delegate": [16],
872
- "hasController": [4, "has-controller"],
873
- "color": [513],
874
- "enterAnimation": [16],
875
- "leaveAnimation": [16],
876
- "cssClass": [1, "css-class"],
877
- "duration": [2],
878
- "header": [1],
879
- "layout": [1],
880
- "message": [1],
881
- "keyboardClose": [4, "keyboard-close"],
882
- "position": [1],
883
- "positionAnchor": [1, "position-anchor"],
884
- "buttons": [16],
885
- "translucent": [4],
886
- "animated": [4],
887
- "icon": [1],
888
- "htmlAttributes": [16],
889
- "swipeGesture": [1, "swipe-gesture"],
890
- "isOpen": [4, "is-open"],
891
- "trigger": [1],
892
- "revealContentToScreenReader": [32],
893
- "present": [64],
894
- "dismiss": [64],
895
- "onDidDismiss": [64],
896
- "onWillDismiss": [64]
897
- }, undefined, {
898
- "swipeGesture": ["swipeGestureChanged"],
899
- "isOpen": ["onIsOpenChange"],
900
- "trigger": ["triggerChanged"]
901
- }]);
902
- const buttonClass = (button) => {
903
- return {
904
- 'toast-button': true,
905
- 'toast-button-icon-only': button.icon !== undefined && button.text === undefined,
906
- [`toast-button-${button.role}`]: button.role !== undefined,
907
- 'ion-focusable': true,
908
- 'ion-activatable': true,
909
- };
910
- };
911
- const buttonPart = (button) => {
912
- return isCancel(button.role) ? 'button cancel' : 'button';
913
- };
914
- function defineCustomElement$1() {
915
- if (typeof customElements === "undefined") {
916
- return;
917
- }
918
- const components = ["ion-toast", "ion-icon", "ion-ripple-effect"];
919
- components.forEach(tagName => { switch (tagName) {
920
- case "ion-toast":
921
- if (!customElements.get(tagName)) {
922
- customElements.define(tagName, Toast);
923
- }
924
- break;
925
- case "ion-icon":
926
- if (!customElements.get(tagName)) {
927
- defineCustomElement$3();
928
- }
929
- break;
930
- case "ion-ripple-effect":
931
- if (!customElements.get(tagName)) {
932
- defineCustomElement$2();
933
- }
934
- break;
935
- } });
936
- }
937
-
938
- const IonToast = Toast;
939
- const defineCustomElement = defineCustomElement$1;
940
-
941
- export { IonToast, defineCustomElement };
4
+ import{f as t,p as o,H as e,e as i,c as a,j as s,h as n,d as r,t as d}from"./p-BJoMtgfR.js";import{E as l,a as p}from"./p-BUbsoBOV.js";import{g as c,r as h}from"./p-DgbT0exM.js";import{c as m}from"./p-B-hirT0v.js";import{O as b,d as u,e as g,i as f,j as x,k as w,f as v,g as y,h as k,s as j,G as C}from"./p-Cq8cQ0NL.js";import{c as D,g as T}from"./p-DiVJyqlX.js";import{b as Y}from"./p-CDfQnFrd.js";import{c as z}from"./p-Csw8xuz4.js";import{w as $}from"./p-ZjP4CjeZ.js";import{createGesture as M}from"./p-Cl0B-RWe.js";import{d as O}from"./p-YLXPWgVj.js";import{d as E}from"./p-fpbh6w3f.js";const A=(t,o)=>Math.floor(t/2-o/2),P=(t,o)=>{const e=z(),i=z(),{position:a,top:s,bottom:n}=o,r=c(t).querySelector(".toast-wrapper");switch(i.addElement(r),a){case"top":i.fromTo("transform","translateY(-100%)",`translateY(${s})`);break;case"middle":const o=A(t.clientHeight,r.clientHeight);r.style.top=o+"px",i.fromTo("opacity",.01,1);break;default:i.fromTo("transform","translateY(100%)",`translateY(${n})`)}return e.easing("cubic-bezier(.155,1.105,.295,1.12)").duration(400).addAnimation(i)},W=(t,o)=>{const e=z(),i=z(),{position:a,top:s,bottom:n}=o,r=c(t).querySelector(".toast-wrapper");switch(i.addElement(r),a){case"top":i.fromTo("transform",`translateY(${s})`,"translateY(-100%)");break;case"middle":i.fromTo("opacity",.99,0);break;default:i.fromTo("transform",`translateY(${n})`,"translateY(100%)")}return e.easing("cubic-bezier(.36,.66,.04,1)").duration(300).addAnimation(i)},B=(t,o)=>{const e=z(),i=z(),{position:a,top:s,bottom:n}=o,r=c(t).querySelector(".toast-wrapper");switch(i.addElement(r),a){case"top":r.style.setProperty("transform",`translateY(${s})`),i.fromTo("opacity",.01,1);break;case"middle":const o=A(t.clientHeight,r.clientHeight);r.style.top=o+"px",i.fromTo("opacity",.01,1);break;default:r.style.setProperty("transform",`translateY(${n})`),i.fromTo("opacity",.01,1)}return e.easing("cubic-bezier(.36,.66,.04,1)").duration(400).addAnimation(i)},I=t=>{const o=z(),e=z(),i=c(t).querySelector(".toast-wrapper");return e.addElement(i).fromTo("opacity",.99,0),o.easing("cubic-bezier(.36,.66,.04,1)").duration(300).addAnimation(e)},G=o(class extends e{constructor(t){super(),!1!==t&&this.__registerHost(),this.__attachShadow(),this.didPresent=i(this,"ionToastDidPresent",7),this.willPresent=i(this,"ionToastWillPresent",7),this.willDismiss=i(this,"ionToastWillDismiss",7),this.didDismiss=i(this,"ionToastDidDismiss",7),this.didPresentShorthand=i(this,"didPresent",7),this.willPresentShorthand=i(this,"willPresent",7),this.willDismissShorthand=i(this,"willDismiss",7),this.didDismissShorthand=i(this,"didDismiss",7),this.delegateController=u(this),this.lockController=m(),this.triggerController=g(),this.customHTMLEnabled=a.get("innerHTMLTemplatesEnabled",l),this.presented=!1,this.revealContentToScreenReader=!1,this.hasController=!1,this.duration=a.getNumber("toastDuration",0),this.layout="baseline",this.keyboardClose=!1,this.position="bottom",this.translucent=!1,this.animated=!0,this.isOpen=!1,this.dispatchCancelHandler=t=>{if(f(t.detail.role)){const t=this.getButtons().find((t=>"cancel"===t.role));this.callButtonHandler(t)}},this.createSwipeGesture=t=>{const o=this.gesture=((t,o,e)=>{const i=c(t).querySelector(".toast-wrapper"),a=t.clientHeight,s=i.getBoundingClientRect();let n=0;const r="middle"===t.position?.5:0,d="top"===t.position?-1:1,l=A(a,s.height),p=[{offset:0,transform:`translateY(-${l+s.height}px)`},{offset:.5,transform:"translateY(0px)"},{offset:1,transform:`translateY(${l+s.height}px)`}],h=z("toast-swipe-to-dismiss-animation").addElement(i).duration(100);switch(t.position){case"middle":n=a+s.height,h.keyframes(p),h.progressStart(!0,.5);break;case"top":n=s.bottom,h.keyframes([{offset:0,transform:`translateY(${o.top})`},{offset:1,transform:"translateY(-100%)"}]),h.progressStart(!0,0);break;default:n=a-s.top,h.keyframes([{offset:0,transform:`translateY(${o.bottom})`},{offset:1,transform:"translateY(100%)"}]),h.progressStart(!0,0)}const m=t=>t*d/n,u=M({el:i,gestureName:"toast-swipe-to-dismiss",gesturePriority:b,direction:"y",onMove:t=>{const o=r+m(t.deltaY);h.progressStep(o)},onEnd:o=>{const a=o.velocityY,s=(o.deltaY+1e3*a)/n*d;u.enable(!1);let r=!0,c=1,b=0,g=0;if("middle"===t.position){r=s>=.25||s<=-.25,c=1,b=0;const t=i.getBoundingClientRect(),e=t.top-l,a=(l+t.height)*(o.deltaY<=0?-1:1);h.keyframes([{offset:0,transform:`translateY(${e+"px"})`},{offset:1,transform:`translateY(${r?a+"px":"0px"})`}]),g=a-e}else r=s>=.5,c=r?1:0,b=m(o.deltaY),g=(r?1-b:b)*n;const f=Math.min(Math.abs(g)/Math.abs(a),200);h.onFinish((()=>{r?(e(),h.destroy()):("middle"===t.position?h.keyframes(p).progressStart(!0,.5):h.progressStart(!0,0),u.enable(!0))}),{oneTimeCallback:!0}).progressEnd(c,b,f)}});return u})(this.el,t,(()=>{this.dismiss(void 0,C)}));o.enable(!0)},this.destroySwipeGesture=()=>{const{gesture:t}=this;void 0!==t&&(t.destroy(),this.gesture=void 0)},this.prefersSwipeGesture=()=>{const{swipeGesture:t}=this;return"vertical"===t}}swipeGestureChanged(){this.destroySwipeGesture(),this.presented&&this.prefersSwipeGesture()&&this.createSwipeGesture(this.lastPresentedPosition)}onIsOpenChange(t,o){!0===t&&!1===o?this.present():!1===t&&!0===o&&this.dismiss()}triggerChanged(){const{trigger:t,el:o,triggerController:e}=this;t&&e.addClickListener(o,t)}connectedCallback(){x(this.el),this.triggerChanged()}disconnectedCallback(){this.triggerController.removeClickListener()}componentWillLoad(){var t;(null===(t=this.htmlAttributes)||void 0===t?void 0:t.id)||w(this.el)}componentDidLoad(){!0===this.isOpen&&h((()=>this.present())),this.triggerChanged()}async present(){const o=await this.lockController.lock();await this.delegateController.attachViewToDom();const{el:e,position:i}=this,a=function(o,e,i,a){let s;if(s="md"===i?"top"===o?8:-8:"top"===o?10:-10,e&&$){!function(o,e){null===o.offsetParent&&t("[ion-toast] - The positionAnchor element for ion-toast was found in the DOM, but appears to be hidden. This may lead to unexpected positioning of the toast.",e)}(e,a);const i=e.getBoundingClientRect();return"top"===o?s+=i.bottom:"bottom"===o&&(s-=$.innerHeight-i.top),{top:s+"px",bottom:s+"px"}}return{top:`calc(${s}px + var(--ion-safe-area-top, 0px))`,bottom:`calc(${s}px - var(--ion-safe-area-bottom, 0px))`}}(i,this.getAnchorElement(),Y(this),e);this.lastPresentedPosition=a,await v(this,"toastEnter",P,B,{position:i,top:a.top,bottom:a.bottom}),this.revealContentToScreenReader=!0,this.duration>0&&(this.durationTimeout=setTimeout((()=>this.dismiss(void 0,"timeout")),this.duration)),this.prefersSwipeGesture()&&this.createSwipeGesture(a),o()}async dismiss(t,o){var e,i;const a=await this.lockController.lock(),{durationTimeout:s,position:n,lastPresentedPosition:r}=this;s&&clearTimeout(s);const d=await y(this,t,o,"toastLeave",W,I,{position:n,top:null!==(e=null==r?void 0:r.top)&&void 0!==e?e:"",bottom:null!==(i=null==r?void 0:r.bottom)&&void 0!==i?i:""});return d&&(this.delegateController.removeViewFromDom(),this.revealContentToScreenReader=!1),this.lastPresentedPosition=void 0,this.destroySwipeGesture(),a(),d}onDidDismiss(){return k(this.el,"ionToastDidDismiss")}onWillDismiss(){return k(this.el,"ionToastWillDismiss")}getButtons(){return this.buttons?this.buttons.map((t=>"string"==typeof t?{text:t}:t)):[]}getAnchorElement(){const{position:o,positionAnchor:i,el:a}=this;if(void 0!==i)if("middle"!==o||void 0===i){if("string"==typeof i){const o=document.getElementById(i);return null===o?void t(`[ion-toast] - An anchor element with an ID of "${i}" was not found in the DOM.`,a):o}if(i instanceof e)return i;t("[ion-toast] - Invalid positionAnchor value:",i,a)}else t('[ion-toast] - The positionAnchor property is ignored when using position="middle".',this.el)}async buttonClick(t){const o=t.role;return f(o)||await this.callButtonHandler(t)?this.dismiss(void 0,o):Promise.resolve()}async callButtonHandler(t){if(null==t?void 0:t.handler)try{if(!1===await j(t.handler))return!1}catch(t){s("[ion-toast] - Exception in callButtonHandler:",t)}return!0}renderButtons(t,o){if(0===t.length)return;const e=Y(this);return n("div",{class:{"toast-button-group":!0,["toast-button-group-"+o]:!0}},t.map((t=>n("button",Object.assign({},t.htmlAttributes,{type:"button",class:L(t),tabIndex:0,onClick:()=>this.buttonClick(t),part:H(t)}),n("div",{class:"toast-button-inner"},t.icon&&n("ion-icon",{"aria-hidden":"true",icon:t.icon,slot:void 0===t.text?"icon-only":void 0,class:"toast-button-icon"}),t.text),"md"===e&&n("ion-ripple-effect",{type:void 0!==t.icon&&void 0===t.text?"unbounded":"bounded"})))))}renderToastMessage(t,o=null){const{customHTMLEnabled:e,message:i}=this;return e?n("div",{key:t,"aria-hidden":o,class:"toast-message",part:"message",innerHTML:p(i)}):n("div",{key:t,"aria-hidden":o,class:"toast-message",part:"message"},i)}renderHeader(t,o=null){return n("div",{key:t,class:"toast-header","aria-hidden":o,part:"header"},this.header)}render(){const{layout:o,el:e,revealContentToScreenReader:i,header:a,message:s}=this,d=this.getButtons(),l=d.filter((t=>"start"===t.side)),p=d.filter((t=>"start"!==t.side)),c=Y(this),h={"toast-wrapper":!0,["toast-"+this.position]:!0,["toast-layout-"+o]:!0};return"stacked"===o&&l.length>0&&p.length>0&&t("[ion-toast] - This toast is using start and end buttons with the stacked toast layout. We recommend following the best practice of using either start or end buttons with the stacked toast layout.",e),n(r,Object.assign({key:"4a303f9ebb69614e9dca677d9d80a4a275de0d85",tabindex:"-1"},this.htmlAttributes,{style:{zIndex:""+(6e4+this.overlayIndex)},class:D(this.color,Object.assign(Object.assign({[c]:!0},T(this.cssClass)),{"overlay-hidden":!0,"toast-translucent":this.translucent})),onIonToastWillDismiss:this.dispatchCancelHandler}),n("div",{key:"4f58fcbba8dce9834eab743fc91715935216f3d0",class:h},n("div",{key:"bbc7b73b186432bd4be8247c5de2ce3b2551fb0a",class:"toast-container",part:"container"},this.renderButtons(l,"start"),void 0!==this.icon&&n("ion-icon",{key:"0b953478eb739ceb864373416183bfbf5ce2f9f1",class:"toast-icon",part:"icon",icon:this.icon,lazy:!1,"aria-hidden":"true"}),n("div",{key:"7a63497d1c0440256218426194851a969b042ca6",class:"toast-content",role:"status","aria-atomic":"true","aria-live":"polite"},!i&&void 0!==a&&this.renderHeader("oldHeader","true"),!i&&void 0!==s&&this.renderToastMessage("oldMessage","true"),i&&void 0!==a&&this.renderHeader("header"),i&&void 0!==s&&this.renderToastMessage("header")),this.renderButtons(p,"end"))))}get el(){return this}static get watchers(){return{swipeGesture:[{swipeGestureChanged:0}],isOpen:[{onIsOpenChange:0}],trigger:[{triggerChanged:0}]}}static get style(){return{ios:":host{--border-width:0;--border-style:none;--border-color:initial;--box-shadow:none;--min-width:auto;--width:auto;--min-height:auto;--height:auto;--max-height:auto;--white-space:normal;top:0;display:block;position:absolute;width:100%;height:100%;outline:none;color:var(--color);font-family:var(--ion-font-family, inherit);contain:strict;z-index:1001;pointer-events:none}:host{inset-inline-start:0}:host(.overlay-hidden){display:none}:host(.ion-color){--button-color:inherit;color:var(--ion-color-contrast)}:host(.ion-color) .toast-button-cancel{color:inherit}:host(.ion-color) .toast-wrapper{background:var(--ion-color-base)}.toast-wrapper{border-radius:var(--border-radius);width:var(--width);min-width:var(--min-width);max-width:var(--max-width);height:var(--height);min-height:var(--min-height);max-height:var(--max-height);border-width:var(--border-width);border-style:var(--border-style);border-color:var(--border-color);background:var(--background);-webkit-box-shadow:var(--box-shadow);box-shadow:var(--box-shadow);pointer-events:auto}.toast-wrapper{inset-inline-start:var(--start);inset-inline-end:var(--end)}.toast-wrapper.toast-top{-webkit-transform:translate3d(0, -100%, 0);transform:translate3d(0, -100%, 0);top:0}.toast-wrapper.toast-bottom{-webkit-transform:translate3d(0, 100%, 0);transform:translate3d(0, 100%, 0);bottom:0}.toast-container{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;height:inherit;min-height:inherit;max-height:inherit;contain:content}.toast-layout-stacked .toast-container{-ms-flex-wrap:wrap;flex-wrap:wrap}.toast-layout-baseline .toast-content{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;-ms-flex-pack:center;justify-content:center}.toast-icon{-webkit-margin-start:16px;margin-inline-start:16px}.toast-content{-ms-flex:1;flex:1;min-width:0}.toast-message{-ms-flex:1;flex:1;white-space:var(--white-space)}.toast-button-group{display:-ms-flexbox;display:flex}.toast-layout-stacked .toast-button-group{-ms-flex-pack:end;justify-content:end;width:100%}.toast-button{border:0;outline:none;color:var(--button-color);z-index:0}.toast-icon,.toast-button-icon{font-size:1.4em}.toast-button-inner{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center}@media (any-hover: hover){.toast-button:hover{cursor:pointer}}:host{--background:var(--ion-color-step-50, var(--ion-background-color-step-50, #f2f2f2));--border-radius:14px;--button-color:var(--ion-color-primary, #0054e9);--color:var(--ion-color-step-850, var(--ion-text-color-step-150, #262626));--max-width:700px;--max-height:478px;--start:10px;--end:10px;font-size:clamp(14px, 0.875rem, 43.4px)}.toast-wrapper{-webkit-margin-start:auto;margin-inline-start:auto;-webkit-margin-end:auto;margin-inline-end:auto;margin-top:auto;margin-bottom:auto;display:block;position:absolute;z-index:10}@supports ((-webkit-backdrop-filter: blur(0)) or (backdrop-filter: blur(0))){:host(.toast-translucent) .toast-wrapper{background:rgba(var(--ion-background-color-rgb, 255, 255, 255), 0.8);-webkit-backdrop-filter:saturate(180%) blur(20px);backdrop-filter:saturate(180%) blur(20px)}:host(.ion-color.toast-translucent) .toast-wrapper{background:rgba(var(--ion-color-base-rgb), 0.8)}}.toast-wrapper.toast-middle{opacity:0.01}.toast-content{-webkit-padding-start:15px;padding-inline-start:15px;-webkit-padding-end:15px;padding-inline-end:15px;padding-top:15px;padding-bottom:15px}.toast-header{margin-bottom:2px;font-weight:500}.toast-button{-webkit-padding-start:15px;padding-inline-start:15px;-webkit-padding-end:15px;padding-inline-end:15px;padding-top:10px;padding-bottom:10px;min-height:44px;-webkit-transition:background-color, opacity 100ms linear;transition:background-color, opacity 100ms linear;border:0;background-color:transparent;font-family:var(--ion-font-family);font-size:clamp(17px, 1.0625rem, 21.998px);font-weight:500;overflow:hidden}.toast-button.ion-activated{opacity:0.4}@media (any-hover: hover){.toast-button:hover{opacity:0.6}}",md:":host{--border-width:0;--border-style:none;--border-color:initial;--box-shadow:none;--min-width:auto;--width:auto;--min-height:auto;--height:auto;--max-height:auto;--white-space:normal;top:0;display:block;position:absolute;width:100%;height:100%;outline:none;color:var(--color);font-family:var(--ion-font-family, inherit);contain:strict;z-index:1001;pointer-events:none}:host{inset-inline-start:0}:host(.overlay-hidden){display:none}:host(.ion-color){--button-color:inherit;color:var(--ion-color-contrast)}:host(.ion-color) .toast-button-cancel{color:inherit}:host(.ion-color) .toast-wrapper{background:var(--ion-color-base)}.toast-wrapper{border-radius:var(--border-radius);width:var(--width);min-width:var(--min-width);max-width:var(--max-width);height:var(--height);min-height:var(--min-height);max-height:var(--max-height);border-width:var(--border-width);border-style:var(--border-style);border-color:var(--border-color);background:var(--background);-webkit-box-shadow:var(--box-shadow);box-shadow:var(--box-shadow);pointer-events:auto}.toast-wrapper{inset-inline-start:var(--start);inset-inline-end:var(--end)}.toast-wrapper.toast-top{-webkit-transform:translate3d(0, -100%, 0);transform:translate3d(0, -100%, 0);top:0}.toast-wrapper.toast-bottom{-webkit-transform:translate3d(0, 100%, 0);transform:translate3d(0, 100%, 0);bottom:0}.toast-container{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;height:inherit;min-height:inherit;max-height:inherit;contain:content}.toast-layout-stacked .toast-container{-ms-flex-wrap:wrap;flex-wrap:wrap}.toast-layout-baseline .toast-content{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;-ms-flex-pack:center;justify-content:center}.toast-icon{-webkit-margin-start:16px;margin-inline-start:16px}.toast-content{-ms-flex:1;flex:1;min-width:0}.toast-message{-ms-flex:1;flex:1;white-space:var(--white-space)}.toast-button-group{display:-ms-flexbox;display:flex}.toast-layout-stacked .toast-button-group{-ms-flex-pack:end;justify-content:end;width:100%}.toast-button{border:0;outline:none;color:var(--button-color);z-index:0}.toast-icon,.toast-button-icon{font-size:1.4em}.toast-button-inner{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center}@media (any-hover: hover){.toast-button:hover{cursor:pointer}}:host{--background:var(--ion-color-step-800, var(--ion-background-color-step-800, #333333));--border-radius:4px;--box-shadow:0 3px 5px -1px rgba(0, 0, 0, 0.2), 0 6px 10px 0 rgba(0, 0, 0, 0.14), 0 1px 18px 0 rgba(0, 0, 0, 0.12);--button-color:var(--ion-color-primary, #0054e9);--color:var(--ion-color-step-50, var(--ion-text-color-step-950, #f2f2f2));--max-width:700px;--start:8px;--end:8px;font-size:0.875rem}.toast-wrapper{-webkit-margin-start:auto;margin-inline-start:auto;-webkit-margin-end:auto;margin-inline-end:auto;margin-top:auto;margin-bottom:auto;display:block;position:absolute;opacity:0.01;z-index:10}.toast-content{-webkit-padding-start:16px;padding-inline-start:16px;-webkit-padding-end:16px;padding-inline-end:16px;padding-top:14px;padding-bottom:14px}.toast-header{margin-bottom:2px;font-weight:500;line-height:1.25rem}.toast-message{line-height:1.25rem}.toast-layout-baseline .toast-button-group-start{-webkit-margin-start:8px;margin-inline-start:8px}.toast-layout-stacked .toast-button-group-start{-webkit-margin-end:8px;margin-inline-end:8px;margin-top:8px}.toast-layout-baseline .toast-button-group-end{-webkit-margin-end:8px;margin-inline-end:8px}.toast-layout-stacked .toast-button-group-end{-webkit-margin-end:8px;margin-inline-end:8px;margin-bottom:8px}.toast-button{-webkit-padding-start:15px;padding-inline-start:15px;-webkit-padding-end:15px;padding-inline-end:15px;padding-top:10px;padding-bottom:10px;position:relative;background-color:transparent;font-family:var(--ion-font-family);font-size:0.875rem;font-weight:500;letter-spacing:0.84px;text-transform:uppercase;overflow:hidden}.toast-button-cancel{color:var(--ion-color-step-100, var(--ion-text-color-step-900, #e6e6e6))}.toast-button-icon-only{border-radius:50%;-webkit-padding-start:9px;padding-inline-start:9px;-webkit-padding-end:9px;padding-inline-end:9px;padding-top:9px;padding-bottom:9px;width:36px;height:36px}@media (any-hover: hover){.toast-button:hover{background-color:rgba(var(--ion-color-primary-rgb, 0, 84, 233), 0.08)}.toast-button-cancel:hover{background-color:rgba(var(--ion-background-color-rgb, 255, 255, 255), 0.08)}}"}}},[33,"ion-toast",{overlayIndex:[2,"overlay-index"],delegate:[16],hasController:[4,"has-controller"],color:[513],enterAnimation:[16],leaveAnimation:[16],cssClass:[1,"css-class"],duration:[2],header:[1],layout:[1],message:[1],keyboardClose:[4,"keyboard-close"],position:[1],positionAnchor:[1,"position-anchor"],buttons:[16],translucent:[4],animated:[4],icon:[1],htmlAttributes:[16],swipeGesture:[1,"swipe-gesture"],isOpen:[4,"is-open"],trigger:[1],revealContentToScreenReader:[32],present:[64],dismiss:[64],onDidDismiss:[64],onWillDismiss:[64]},void 0,{swipeGesture:[{swipeGestureChanged:0}],isOpen:[{onIsOpenChange:0}],trigger:[{triggerChanged:0}]}]),L=t=>({"toast-button":!0,"toast-button-icon-only":void 0!==t.icon&&void 0===t.text,["toast-button-"+t.role]:void 0!==t.role,"ion-focusable":!0,"ion-activatable":!0}),H=t=>f(t.role)?"button cancel":"button",R=G,V=function(){"undefined"!=typeof customElements&&["ion-toast","ion-icon","ion-ripple-effect"].forEach((t=>{switch(t){case"ion-toast":customElements.get(d(t))||customElements.define(d(t),G);break;case"ion-icon":customElements.get(d(t))||O();break;case"ion-ripple-effect":customElements.get(d(t))||E()}}))};export{R as IonToast,V as defineCustomElement}