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

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