@pod-os/elements 0.7.1-92705ee.0 → 0.7.1-a71f01c.0

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 (634) hide show
  1. package/dist/cjs/{animation-5840e4df.js → animation-9bea118f.js} +115 -84
  2. package/dist/cjs/{app-globals-1aedd05c.js → app-globals-6352043e.js} +1 -1
  3. package/dist/cjs/{cubic-bezier-dcb7bfef.js → cubic-bezier-0b702a31.js} +13 -12
  4. package/dist/cjs/data-0c9489d7.js +1510 -0
  5. package/dist/cjs/dir-011f46ea.js +20 -0
  6. package/dist/cjs/elements.cjs.js +5 -5
  7. package/dist/cjs/focus-visible-2624ec15.js +76 -0
  8. package/dist/cjs/framework-delegate-437c0645.js +119 -0
  9. package/dist/cjs/{gesture-controller-fbbe9a65.js → gesture-controller-00a6b02f.js} +6 -2
  10. package/dist/cjs/{haptic-09e73337.js → haptic-7358cb0b.js} +37 -8
  11. package/dist/cjs/{hardware-back-button-01027575.js → hardware-back-button-25372ec7.js} +11 -8
  12. package/dist/cjs/{helpers-398ced09.js → helpers-cb08f5ae.js} +115 -15
  13. package/dist/cjs/{index-2067b305.js → index-1b07c737.js} +35 -24
  14. package/dist/cjs/{index-68ae43d2.js → index-2dc3637c.js} +34 -28
  15. package/dist/cjs/index-57b9fa9e.js +30 -0
  16. package/dist/cjs/{index-d01d9183.js → index-643851c6.js} +34 -19
  17. package/dist/cjs/index-731691ca.js +48 -0
  18. package/dist/cjs/{index-6bbae9b1.js → index-7d56774d.js} +12 -8
  19. package/dist/cjs/index-9fca5d6f.js +140 -0
  20. package/dist/cjs/index-b2a479e4.js +38 -0
  21. package/dist/cjs/{index-b4a9ece2.js → index-eaa0d16e.js} +7 -0
  22. package/dist/cjs/{tap-click-f24cb477.js → index-ed2ce04f.js} +37 -19
  23. package/dist/cjs/{input-shims-e959d9e2.js → input-shims-427999f7.js} +89 -38
  24. package/dist/cjs/ion-accordion-group.cjs.entry.js +205 -0
  25. package/dist/cjs/ion-accordion.cjs.entry.js +336 -0
  26. package/dist/cjs/ion-action-sheet_3.cjs.entry.js +865 -0
  27. package/dist/cjs/{ion-app_45.cjs.entry.js → ion-app_46.cjs.entry.js} +1906 -1492
  28. package/dist/cjs/ion-avatar.cjs.entry.js +2 -2
  29. package/dist/cjs/ion-back-button.cjs.entry.js +12 -11
  30. package/dist/cjs/ion-backdrop.cjs.entry.js +4 -4
  31. package/dist/cjs/ion-breadcrumb.cjs.entry.js +101 -0
  32. package/dist/cjs/ion-breadcrumbs.cjs.entry.js +137 -0
  33. package/dist/cjs/ion-buttons_3.cjs.entry.js +799 -0
  34. package/dist/cjs/ion-card-subtitle.cjs.entry.js +4 -4
  35. package/dist/cjs/{ion-list-header_3.cjs.entry.js → ion-checkbox_4.cjs.entry.js} +124 -23
  36. package/dist/cjs/ion-chip.cjs.entry.js +5 -10
  37. package/dist/cjs/ion-datetime-button.cjs.entry.js +346 -0
  38. package/dist/cjs/ion-datetime.cjs.entry.js +1548 -856
  39. package/dist/cjs/ion-fab-button.cjs.entry.js +26 -9
  40. package/dist/cjs/ion-fab-list.cjs.entry.js +4 -4
  41. package/dist/cjs/ion-fab.cjs.entry.js +15 -13
  42. package/dist/cjs/ion-img.cjs.entry.js +28 -4
  43. package/dist/cjs/ion-infinite-scroll-content.cjs.entry.js +5 -5
  44. package/dist/cjs/ion-infinite-scroll.cjs.entry.js +13 -13
  45. package/dist/cjs/ion-input.cjs.entry.js +57 -23
  46. package/dist/cjs/ion-item-option.cjs.entry.js +8 -8
  47. package/dist/cjs/ion-item-options.cjs.entry.js +5 -5
  48. package/dist/cjs/ion-item-sliding.cjs.entry.js +59 -63
  49. package/dist/cjs/ion-loading.cjs.entry.js +38 -37
  50. package/dist/cjs/ion-menu-button.cjs.entry.js +14 -12
  51. package/dist/cjs/ion-menu-toggle.cjs.entry.js +8 -7
  52. package/dist/cjs/ion-menu.cjs.entry.js +71 -57
  53. package/dist/cjs/ion-modal.cjs.entry.js +1386 -156
  54. package/dist/cjs/ion-nav-link.cjs.entry.js +5 -2
  55. package/dist/cjs/ion-nav.cjs.entry.js +177 -171
  56. package/dist/cjs/ion-picker-column.cjs.entry.js +25 -27
  57. package/dist/cjs/ion-picker.cjs.entry.js +22 -17
  58. package/dist/cjs/ion-popover.cjs.entry.js +1208 -182
  59. package/dist/cjs/ion-range.cjs.entry.js +137 -57
  60. package/dist/cjs/ion-refresher-content.cjs.entry.js +7 -12
  61. package/dist/cjs/ion-refresher.cjs.entry.js +150 -148
  62. package/dist/cjs/ion-reorder-group.cjs.entry.js +42 -35
  63. package/dist/cjs/ion-reorder.cjs.entry.js +5 -4
  64. package/dist/cjs/ion-route-redirect.cjs.entry.js +1 -1
  65. package/dist/cjs/ion-route.cjs.entry.js +1 -1
  66. package/dist/cjs/ion-router-link.cjs.entry.js +5 -5
  67. package/dist/cjs/ion-router-outlet.cjs.entry.js +24 -20
  68. package/dist/cjs/ion-router.cjs.entry.js +291 -194
  69. package/dist/cjs/ion-segment-button.cjs.entry.js +10 -17
  70. package/dist/cjs/ion-segment.cjs.entry.js +127 -26
  71. package/dist/cjs/ion-select-option.cjs.entry.js +3 -3
  72. package/dist/cjs/ion-select.cjs.entry.js +113 -78
  73. package/dist/cjs/ion-slide.cjs.entry.js +3 -3
  74. package/dist/cjs/ion-slides.cjs.entry.js +26 -27
  75. package/dist/cjs/ion-spinner.cjs.entry.js +10 -9
  76. package/dist/cjs/ion-split-pane.cjs.entry.js +16 -12
  77. package/dist/cjs/ion-tab-bar.cjs.entry.js +16 -23
  78. package/dist/cjs/ion-tab-button.cjs.entry.js +6 -6
  79. package/dist/cjs/ion-tab.cjs.entry.js +4 -4
  80. package/dist/cjs/ion-tabs.cjs.entry.js +4 -5
  81. package/dist/cjs/ion-text.cjs.entry.js +3 -3
  82. package/dist/cjs/ion-textarea.cjs.entry.js +31 -29
  83. package/dist/cjs/ion-thumbnail.cjs.entry.js +2 -2
  84. package/dist/cjs/ion-toast.cjs.entry.js +50 -60
  85. package/dist/cjs/ion-toggle.cjs.entry.js +41 -22
  86. package/dist/cjs/ion-virtual-scroll.cjs.entry.js +39 -31
  87. package/dist/cjs/{ionic-global-56e10eb5.js → ionic-global-f2d95fd3.js} +112 -93
  88. package/dist/cjs/{ios.transition-32e4623d.js → ios.transition-0f31ec9a.js} +78 -53
  89. package/dist/cjs/{keyboard-9e8103e4.js → keyboard-79afcba2.js} +6 -3
  90. package/dist/cjs/keyboard-controller-a934d106.js +42 -0
  91. package/dist/cjs/loader.cjs.js +5 -5
  92. package/dist/cjs/{md.transition-169c54f0.js → md.transition-d2a33a23.js} +15 -17
  93. package/dist/cjs/{menu-toggle-util-087678e0.js → menu-toggle-util-0a43ff7c.js} +5 -2
  94. package/dist/cjs/{overlays-49fe9ba7.js → overlays-f7d24abf.js} +190 -72
  95. package/dist/cjs/spinner-configs-cd0abbeb.js +147 -0
  96. package/dist/cjs/{status-tap-ada894ff.js → status-tap-beaa3a71.js} +10 -5
  97. package/dist/cjs/{swipe-back-c4a778df.js → swipe-back-666ea8e6.js} +34 -15
  98. package/dist/cjs/{theme-2259d0f5.js → theme-fc63803b.js} +9 -5
  99. package/dist/collection/collection-manifest.json +10 -4
  100. package/dist/collection/components/pos-rich-link/pos-rich-link.js +1 -1
  101. package/dist/components/ResourceAware.js +5 -0
  102. package/dist/components/action-sheet.js +309 -0
  103. package/dist/{esm/ion-alert.entry.js → components/alert.js} +150 -105
  104. package/dist/{esm/animation-fe6ed422.js → components/animation.js} +115 -84
  105. package/dist/components/app.js +112 -0
  106. package/dist/components/backdrop.js +82 -0
  107. package/dist/components/badge.js +42 -0
  108. package/dist/{esm/button-active-fd9d6d91.js → components/button-active.js} +9 -6
  109. package/dist/components/button.js +207 -0
  110. package/dist/{esm/ion-buttons.entry.js → components/buttons.js} +28 -12
  111. package/dist/components/card-content.js +40 -0
  112. package/dist/components/card-header.js +51 -0
  113. package/dist/components/card-title.js +43 -0
  114. package/dist/components/card.js +102 -0
  115. package/dist/{esm/ion-checkbox.entry.js → components/checkbox.js} +42 -24
  116. package/dist/components/col.js +161 -0
  117. package/dist/components/content.js +356 -0
  118. package/dist/{esm/cubic-bezier-108b8579.js → components/cubic-bezier.js} +13 -12
  119. package/dist/components/data.js +1463 -0
  120. package/dist/components/dir.js +18 -0
  121. package/dist/components/focus-visible.js +74 -0
  122. package/dist/components/footer.js +149 -0
  123. package/dist/components/framework-delegate.js +115 -0
  124. package/dist/{esm/gesture-controller-8f35af24.js → components/gesture-controller.js} +6 -2
  125. package/dist/components/grid.js +41 -0
  126. package/dist/{esm/haptic-c424e670.js → components/haptic.js} +38 -9
  127. package/dist/{esm/hardware-back-button-bb4c578a.js → components/hardware-back-button.js} +11 -8
  128. package/dist/components/header.js +360 -0
  129. package/dist/{esm/helpers-44e3bd9f.js → components/helpers.js} +113 -16
  130. package/dist/components/icon.js +367 -0
  131. package/dist/components/index.d.ts +41 -0
  132. package/dist/components/index.js +123 -0
  133. package/dist/components/index10.js +28 -0
  134. package/dist/{esm/tap-click-a7e55ef5.js → components/index11.js} +37 -19
  135. package/dist/components/index2.js +25 -0
  136. package/dist/{esm/index-8d682224.js → components/index3.js} +12 -8
  137. package/dist/components/index4.js +34 -0
  138. package/dist/components/index5.js +128 -0
  139. package/dist/{esm/index-97199683.js → components/index6.js} +34 -28
  140. package/dist/{esm/index-8a463a85.js → components/index7.js} +35 -24
  141. package/dist/{custom-elements/index.js → components/index8.js} +1049 -20945
  142. package/dist/{esm/index-3a1bd803.js → components/index9.js} +35 -20
  143. package/dist/{custom-elements → components}/input-shims.js +88 -38
  144. package/dist/components/ion-accordion-group.js +228 -0
  145. package/dist/components/ion-accordion.js +365 -0
  146. package/dist/components/ion-action-sheet.js +6 -0
  147. package/dist/components/ion-alert.js +6 -0
  148. package/dist/components/ion-app.js +6 -0
  149. package/dist/components/ion-avatar.js +39 -0
  150. package/dist/components/ion-back-button.js +128 -0
  151. package/dist/components/ion-backdrop.js +6 -0
  152. package/dist/components/ion-badge.js +6 -0
  153. package/dist/components/ion-breadcrumb.js +135 -0
  154. package/dist/components/ion-breadcrumbs.js +158 -0
  155. package/dist/components/ion-button.js +6 -0
  156. package/dist/components/ion-buttons.js +6 -0
  157. package/dist/components/ion-card-content.js +6 -0
  158. package/dist/components/ion-card-header.js +6 -0
  159. package/dist/components/ion-card-subtitle.js +46 -0
  160. package/dist/components/ion-card-title.js +6 -0
  161. package/dist/components/ion-card.js +6 -0
  162. package/dist/components/ion-checkbox.js +6 -0
  163. package/dist/components/ion-chip.js +59 -0
  164. package/dist/components/ion-col.js +6 -0
  165. package/dist/components/ion-content.js +6 -0
  166. package/dist/components/ion-datetime-button.js +375 -0
  167. package/dist/components/ion-datetime.js +1802 -0
  168. package/dist/components/ion-fab-button.js +149 -0
  169. package/dist/components/ion-fab-list.js +62 -0
  170. package/dist/components/ion-fab.js +97 -0
  171. package/dist/components/ion-footer.js +6 -0
  172. package/dist/components/ion-grid.js +6 -0
  173. package/dist/components/ion-header.js +6 -0
  174. package/dist/components/ion-icon.js +6 -0
  175. package/dist/components/ion-img.js +120 -0
  176. package/dist/components/ion-infinite-scroll-content.js +59 -0
  177. package/dist/components/ion-infinite-scroll.js +223 -0
  178. package/dist/components/ion-input.js +352 -0
  179. package/dist/components/ion-item-divider.js +6 -0
  180. package/dist/components/ion-item-group.js +6 -0
  181. package/dist/components/ion-item-option.js +89 -0
  182. package/dist/components/ion-item-options.js +63 -0
  183. package/dist/components/ion-item-sliding.js +419 -0
  184. package/dist/components/ion-item.js +6 -0
  185. package/dist/components/ion-label.js +6 -0
  186. package/dist/components/ion-list-header.js +6 -0
  187. package/dist/components/ion-list.js +6 -0
  188. package/dist/components/ion-loading.js +256 -0
  189. package/dist/components/ion-menu-button.js +107 -0
  190. package/dist/components/ion-menu-toggle.js +62 -0
  191. package/dist/components/ion-menu.js +611 -0
  192. package/dist/components/ion-modal.js +1765 -0
  193. package/dist/components/ion-nav-link.js +65 -0
  194. package/dist/components/ion-nav.js +905 -0
  195. package/dist/components/ion-note.js +6 -0
  196. package/dist/components/ion-picker-column-internal.js +6 -0
  197. package/dist/components/ion-picker-column.js +6 -0
  198. package/dist/components/ion-picker-internal.js +6 -0
  199. package/dist/components/ion-picker.js +263 -0
  200. package/dist/components/ion-popover.js +6 -0
  201. package/dist/components/ion-progress-bar.js +6 -0
  202. package/dist/components/ion-radio-group.js +6 -0
  203. package/dist/components/ion-radio.js +6 -0
  204. package/dist/components/ion-range.js +550 -0
  205. package/dist/components/ion-refresher-content.js +64 -0
  206. package/dist/components/ion-refresher.js +826 -0
  207. package/dist/components/ion-reorder-group.js +303 -0
  208. package/dist/components/ion-reorder.js +58 -0
  209. package/dist/components/ion-ripple-effect.js +6 -0
  210. package/dist/components/ion-route-redirect.js +40 -0
  211. package/dist/components/ion-route.js +68 -0
  212. package/dist/components/ion-router-link.js +59 -0
  213. package/dist/components/ion-router-outlet.js +223 -0
  214. package/dist/components/ion-router.js +852 -0
  215. package/dist/components/ion-row.js +6 -0
  216. package/dist/components/ion-searchbar.js +6 -0
  217. package/dist/components/ion-segment-button.js +128 -0
  218. package/dist/components/ion-segment.js +463 -0
  219. package/dist/components/ion-select-option.js +44 -0
  220. package/dist/components/ion-select-popover.js +6 -0
  221. package/dist/components/ion-select.js +596 -0
  222. package/dist/components/ion-skeleton-text.js +6 -0
  223. package/dist/components/ion-slide.js +38 -0
  224. package/dist/components/ion-slides.js +423 -0
  225. package/dist/components/ion-spinner.js +6 -0
  226. package/dist/components/ion-split-pane.js +179 -0
  227. package/dist/components/ion-tab-bar.js +86 -0
  228. package/dist/components/ion-tab-button.js +132 -0
  229. package/dist/components/ion-tab.js +86 -0
  230. package/dist/components/ion-tabs.js +176 -0
  231. package/dist/components/ion-text.js +40 -0
  232. package/dist/components/ion-textarea.js +287 -0
  233. package/dist/components/ion-thumbnail.js +34 -0
  234. package/dist/components/ion-title.js +6 -0
  235. package/dist/components/ion-toast.js +317 -0
  236. package/dist/components/ion-toggle.js +207 -0
  237. package/dist/components/ion-toolbar.js +6 -0
  238. package/dist/components/ion-virtual-scroll.js +588 -0
  239. package/dist/components/ionic-global.js +226 -0
  240. package/dist/{custom-elements → components}/ios.transition.js +75 -50
  241. package/dist/components/item-divider.js +54 -0
  242. package/dist/components/item-group.js +41 -0
  243. package/dist/components/item.js +323 -0
  244. package/dist/components/keyboard-controller.js +40 -0
  245. package/dist/{custom-elements → components}/keyboard.js +6 -3
  246. package/dist/components/label.js +95 -0
  247. package/dist/components/list-header.js +45 -0
  248. package/dist/components/list.js +66 -0
  249. package/dist/{custom-elements → components}/md.transition.js +12 -14
  250. package/dist/{esm/menu-toggle-util-562dfc9c.js → components/menu-toggle-util.js} +5 -2
  251. package/dist/components/note.js +42 -0
  252. package/dist/{esm/overlays-fc9a0625.js → components/overlays.js} +188 -72
  253. package/dist/components/picker-column-internal.js +315 -0
  254. package/dist/components/picker-column.js +343 -0
  255. package/dist/components/picker-internal.js +486 -0
  256. package/dist/components/popover.js +1440 -0
  257. package/dist/components/pos-app-browser.d.ts +11 -0
  258. package/dist/components/pos-app-browser.js +299 -0
  259. package/dist/components/pos-app-generic.d.ts +11 -0
  260. package/dist/components/pos-app-generic.js +6 -0
  261. package/dist/components/pos-app-generic2.js +194 -0
  262. package/dist/components/pos-app-image-viewer.d.ts +11 -0
  263. package/dist/components/pos-app-image-viewer.js +6 -0
  264. package/dist/components/pos-app-image-viewer2.js +162 -0
  265. package/dist/components/pos-app-rdf-document.d.ts +11 -0
  266. package/dist/components/pos-app-rdf-document.js +6 -0
  267. package/dist/components/pos-app-rdf-document2.js +170 -0
  268. package/dist/components/pos-app.d.ts +11 -0
  269. package/dist/components/pos-app.js +6 -0
  270. package/dist/components/pos-app2.js +53 -0
  271. package/dist/components/pos-description.d.ts +11 -0
  272. package/dist/components/pos-description.js +6 -0
  273. package/dist/components/pos-description2.js +38 -0
  274. package/dist/components/pos-image.d.ts +11 -0
  275. package/dist/components/pos-image.js +6 -0
  276. package/dist/components/pos-image2.js +117 -0
  277. package/dist/components/pos-label.d.ts +11 -0
  278. package/dist/components/pos-label.js +6 -0
  279. package/dist/components/pos-label2.js +38 -0
  280. package/dist/components/pos-literals.d.ts +11 -0
  281. package/dist/components/pos-literals.js +6 -0
  282. package/dist/components/pos-literals2.js +87 -0
  283. package/dist/components/pos-login.d.ts +11 -0
  284. package/dist/components/pos-login.js +6 -0
  285. package/dist/components/pos-login2.js +120 -0
  286. package/dist/components/pos-navigation-bar.d.ts +11 -0
  287. package/dist/components/pos-navigation-bar.js +6 -0
  288. package/dist/components/pos-navigation-bar2.js +52 -0
  289. package/dist/components/pos-picture.d.ts +11 -0
  290. package/dist/components/pos-picture.js +6 -0
  291. package/dist/components/pos-picture2.js +62 -0
  292. package/dist/components/pos-relations.d.ts +11 -0
  293. package/dist/components/pos-relations.js +6 -0
  294. package/dist/components/pos-relations2.js +135 -0
  295. package/dist/components/pos-resource.d.ts +11 -0
  296. package/dist/components/pos-resource.js +6 -0
  297. package/dist/components/pos-resource2.js +126 -0
  298. package/dist/components/pos-reverse-relations.d.ts +11 -0
  299. package/dist/components/pos-reverse-relations.js +6 -0
  300. package/dist/components/pos-reverse-relations2.js +135 -0
  301. package/dist/components/pos-rich-link.d.ts +11 -0
  302. package/dist/components/pos-rich-link.js +6 -0
  303. package/dist/components/pos-rich-link2.js +106 -0
  304. package/dist/components/pos-router.d.ts +11 -0
  305. package/dist/components/pos-router.js +6 -0
  306. package/dist/components/pos-router2.js +813 -0
  307. package/dist/components/pos-subjects.d.ts +11 -0
  308. package/dist/components/pos-subjects.js +6 -0
  309. package/dist/components/pos-subjects2.js +125 -0
  310. package/dist/components/pos-type-badges.d.ts +11 -0
  311. package/dist/components/pos-type-badges.js +6 -0
  312. package/dist/components/pos-type-badges2.js +69 -0
  313. package/dist/components/pos-type-router.d.ts +11 -0
  314. package/dist/components/pos-type-router.js +6 -0
  315. package/dist/components/pos-type-router2.js +241 -0
  316. package/dist/components/progress-bar.js +91 -0
  317. package/dist/components/radio-group.js +139 -0
  318. package/dist/components/radio.js +135 -0
  319. package/dist/components/ripple-effect.js +107 -0
  320. package/dist/components/row.js +31 -0
  321. package/dist/components/searchbar.js +412 -0
  322. package/dist/components/select-popover.js +174 -0
  323. package/dist/components/session.js +202 -0
  324. package/dist/components/skeleton-text.js +46 -0
  325. package/dist/components/spinner.js +224 -0
  326. package/dist/{custom-elements → components}/status-tap.js +8 -4
  327. package/dist/{custom-elements → components}/swipe-back.js +33 -13
  328. package/dist/{custom-elements → components}/swiper.bundle.js +0 -0
  329. package/dist/{esm/theme-d21826a7.js → components/theme.js} +9 -5
  330. package/dist/components/title.js +66 -0
  331. package/dist/components/toolbar.js +87 -0
  332. package/dist/elements/elements.css +1 -1
  333. package/dist/elements/elements.esm.js +1 -1
  334. package/dist/elements/p-00f19b1d.js +4 -0
  335. package/dist/elements/p-0587332d.entry.js +1 -0
  336. package/dist/elements/p-07f54139.entry.js +7 -0
  337. package/dist/elements/{p-cfc0e54d.js → p-0991c811.js} +3 -0
  338. package/dist/elements/p-0a69a563.entry.js +1 -0
  339. package/dist/elements/p-0d284fe0.entry.js +1 -0
  340. package/dist/elements/p-116437b0.entry.js +13 -0
  341. package/dist/elements/p-12880671.entry.js +1 -0
  342. package/dist/elements/p-14ccd586.entry.js +1 -0
  343. package/dist/elements/{p-83d45051.entry.js → p-14df6ac0.entry.js} +1 -1
  344. package/dist/elements/{p-e860be6a.entry.js → p-17079f06.entry.js} +1 -1
  345. package/dist/elements/p-19e4a688.js +4 -0
  346. package/dist/elements/p-1afc4eb4.js +4 -0
  347. package/dist/elements/p-1beaf6bf.js +4 -0
  348. package/dist/elements/p-1d1c6a6f.entry.js +1 -0
  349. package/dist/elements/{p-31d30e42.entry.js → p-1d98f84b.entry.js} +1 -1
  350. package/dist/elements/p-1e617706.entry.js +7 -0
  351. package/dist/elements/p-278ca4c9.js +4 -0
  352. package/dist/elements/p-27f5629c.entry.js +1 -0
  353. package/dist/elements/p-29c0f03f.js +4 -0
  354. package/dist/elements/p-2a629468.entry.js +4 -0
  355. package/dist/elements/p-2da59aca.js +4 -0
  356. package/dist/elements/p-3152143f.js +4 -0
  357. package/dist/elements/p-343ff720.entry.js +7 -0
  358. package/dist/elements/p-36d4c9a8.js +4 -0
  359. package/dist/elements/p-3a30dfb2.entry.js +1 -0
  360. package/dist/elements/p-3c013bf1.entry.js +1 -0
  361. package/dist/elements/{p-74ba1e42.entry.js → p-3c318da5.entry.js} +1 -1
  362. package/dist/elements/p-3cee3222.entry.js +1 -0
  363. package/dist/elements/p-3d0f59af.entry.js +7 -0
  364. package/dist/elements/p-41cb5688.entry.js +1 -0
  365. package/dist/elements/p-480b3c4f.entry.js +1 -0
  366. package/dist/elements/p-4e9d8f18.entry.js +1 -0
  367. package/dist/elements/p-53e23176.js +2 -0
  368. package/dist/elements/p-548524f3.js +4 -0
  369. package/dist/elements/p-5739fa41.entry.js +1 -0
  370. package/dist/elements/p-5808c505.js +1 -0
  371. package/dist/elements/p-58a8cc2a.js +4 -0
  372. package/dist/elements/p-6035415e.entry.js +1 -0
  373. package/dist/elements/p-60eeae90.js +4 -0
  374. package/dist/elements/p-667550a9.entry.js +14 -0
  375. package/dist/elements/p-67777478.entry.js +1 -0
  376. package/dist/elements/p-6ab826e1.entry.js +1 -0
  377. package/dist/elements/p-6f5a2827.entry.js +1 -0
  378. package/dist/elements/p-7916ecc5.entry.js +1 -0
  379. package/dist/elements/p-79f06b80.entry.js +1 -0
  380. package/dist/elements/p-7d0def79.js +5 -0
  381. package/dist/elements/p-8112afea.js +4 -0
  382. package/dist/elements/p-83678d7d.entry.js +4 -0
  383. package/dist/elements/p-87e45c94.entry.js +1 -0
  384. package/dist/elements/p-8f80768f.entry.js +4 -0
  385. package/dist/elements/p-8fe0433b.js +4 -0
  386. package/dist/elements/{p-4cb27b48.entry.js → p-9147d82b.entry.js} +1 -1
  387. package/dist/elements/p-96aeb07a.entry.js +1 -0
  388. package/dist/elements/p-97abb434.entry.js +1 -0
  389. package/dist/elements/p-98497a4b.entry.js +1 -0
  390. package/dist/elements/p-9c719139.js +4 -0
  391. package/dist/elements/p-9ca37332.js +4 -0
  392. package/dist/elements/{p-37de7110.js → p-9d48def2.js} +3 -0
  393. package/dist/elements/p-a805f2f9.entry.js +1 -0
  394. package/dist/elements/p-a86a5bfa.entry.js +1 -0
  395. package/dist/elements/{p-9c1dbe52.entry.js → p-ac34eab7.entry.js} +1 -1
  396. package/dist/elements/p-ad366eab.entry.js +4 -0
  397. package/dist/elements/p-aef3a931.js +7 -0
  398. package/dist/elements/p-b0537eb3.entry.js +1 -0
  399. package/dist/elements/p-b41e66f0.entry.js +1 -0
  400. package/dist/elements/p-b47e7091.entry.js +1 -0
  401. package/dist/elements/p-b840320e.js +4 -0
  402. package/dist/elements/p-b934ac5d.entry.js +1 -0
  403. package/dist/elements/p-bc63f4b6.entry.js +1 -0
  404. package/dist/elements/p-bd12806f.entry.js +1 -0
  405. package/dist/elements/p-bf90022d.entry.js +4 -0
  406. package/dist/elements/p-c16d38d5.js +4 -0
  407. package/dist/elements/p-c84205a3.js +4 -0
  408. package/dist/elements/{p-06675ac7.entry.js → p-cbe318f8.entry.js} +1 -1
  409. package/dist/elements/p-cfed7395.js +4 -0
  410. package/dist/elements/p-d3e75c94.entry.js +1 -0
  411. package/dist/elements/p-d8e7ebf4.entry.js +7 -0
  412. package/dist/elements/p-d9880221.entry.js +4 -0
  413. package/dist/elements/p-da5db8fb.entry.js +1 -0
  414. package/dist/elements/{p-91fe653f.js → p-dcc6b03c.js} +3 -0
  415. package/dist/elements/{p-305e246c.entry.js → p-dd846020.entry.js} +1 -1
  416. package/dist/elements/p-dffd8689.js +4 -0
  417. package/dist/elements/p-e3bcb6e8.entry.js +1 -0
  418. package/dist/elements/p-e495a095.js +4 -0
  419. package/dist/elements/p-e59d9789.entry.js +1 -0
  420. package/dist/elements/p-e5fc7d42.entry.js +1 -0
  421. package/dist/elements/{p-aaa8393e.entry.js → p-eb137e9d.entry.js} +1 -1
  422. package/dist/elements/p-f4e54a17.js +7 -0
  423. package/dist/elements/p-f67d0717.entry.js +1 -0
  424. package/dist/elements/p-f7f4c640.js +1 -0
  425. package/dist/elements/p-f851b91a.js +4 -0
  426. package/dist/elements/p-fb27ee76.entry.js +1 -0
  427. package/dist/elements/p-fbddca35.entry.js +1 -0
  428. package/dist/elements/p-fdac5f3a.js +4 -0
  429. package/dist/elements/p-feb0cea8.entry.js +4 -0
  430. package/dist/esm/animation-801a007a.js +986 -0
  431. package/dist/esm/{app-globals-27d92837.js → app-globals-05a3abfb.js} +1 -1
  432. package/dist/esm/cubic-bezier-538b6253.js +90 -0
  433. package/dist/esm/data-62c81c24.js +1463 -0
  434. package/dist/esm/dir-defb16c6.js +18 -0
  435. package/dist/esm/elements.js +5 -5
  436. package/dist/esm/focus-visible-78d55799.js +74 -0
  437. package/dist/esm/framework-delegate-7e2b767b.js +115 -0
  438. package/dist/esm/gesture-controller-c466ff14.js +195 -0
  439. package/dist/esm/haptic-e7d5ef4d.js +135 -0
  440. package/dist/esm/hardware-back-button-242191a7.js +71 -0
  441. package/dist/esm/helpers-aeff219b.js +410 -0
  442. package/dist/esm/index-0dbaca1a.js +28 -0
  443. package/dist/esm/index-1f3d8582.js +34 -0
  444. package/dist/esm/index-2be9a18b.js +312 -0
  445. package/dist/esm/index-51e4a829.js +137 -0
  446. package/dist/esm/index-6048aed6.js +224 -0
  447. package/dist/esm/index-65ecd543.js +25 -0
  448. package/dist/{custom-elements/tap-click.js → esm/index-b212db1c.js} +37 -19
  449. package/dist/esm/{index-e4deec27.js → index-cb938ffb.js} +7 -1
  450. package/dist/esm/index-d39eb62b.js +463 -0
  451. package/dist/esm/index-ebf7f059.js +128 -0
  452. package/dist/esm/{input-shims-3b48722f.js → input-shims-8a389148.js} +89 -38
  453. package/dist/esm/ion-accordion-group.entry.js +201 -0
  454. package/dist/esm/ion-accordion.entry.js +332 -0
  455. package/dist/esm/ion-action-sheet_3.entry.js +859 -0
  456. package/dist/esm/{ion-app_45.entry.js → ion-app_46.entry.js} +1906 -1493
  457. package/dist/esm/ion-avatar.entry.js +2 -2
  458. package/dist/esm/ion-back-button.entry.js +12 -11
  459. package/dist/esm/ion-backdrop.entry.js +4 -4
  460. package/dist/esm/ion-breadcrumb.entry.js +97 -0
  461. package/dist/esm/ion-breadcrumbs.entry.js +133 -0
  462. package/dist/esm/ion-buttons_3.entry.js +793 -0
  463. package/dist/esm/ion-card-subtitle.entry.js +4 -4
  464. package/dist/esm/{ion-list-header_3.entry.js → ion-checkbox_4.entry.js} +124 -24
  465. package/dist/esm/ion-chip.entry.js +5 -10
  466. package/dist/esm/ion-datetime-button.entry.js +342 -0
  467. package/dist/esm/ion-datetime.entry.js +1548 -856
  468. package/dist/esm/ion-fab-button.entry.js +26 -9
  469. package/dist/esm/ion-fab-list.entry.js +4 -4
  470. package/dist/esm/ion-fab.entry.js +15 -13
  471. package/dist/esm/ion-img.entry.js +28 -4
  472. package/dist/esm/ion-infinite-scroll-content.entry.js +5 -5
  473. package/dist/esm/ion-infinite-scroll.entry.js +13 -13
  474. package/dist/esm/ion-input.entry.js +57 -23
  475. package/dist/esm/ion-item-option.entry.js +8 -8
  476. package/dist/esm/ion-item-options.entry.js +5 -5
  477. package/dist/esm/ion-item-sliding.entry.js +59 -63
  478. package/dist/esm/ion-loading.entry.js +38 -37
  479. package/dist/esm/ion-menu-button.entry.js +14 -12
  480. package/dist/esm/ion-menu-toggle.entry.js +8 -7
  481. package/dist/esm/ion-menu.entry.js +71 -57
  482. package/dist/esm/ion-modal.entry.js +1377 -147
  483. package/dist/esm/ion-nav-link.entry.js +5 -2
  484. package/dist/esm/ion-nav.entry.js +177 -171
  485. package/dist/esm/ion-picker-column.entry.js +25 -27
  486. package/dist/esm/ion-picker.entry.js +22 -17
  487. package/dist/esm/ion-popover.entry.js +1208 -182
  488. package/dist/esm/ion-range.entry.js +137 -57
  489. package/dist/esm/ion-refresher-content.entry.js +7 -12
  490. package/dist/esm/ion-refresher.entry.js +149 -147
  491. package/dist/esm/ion-reorder-group.entry.js +42 -35
  492. package/dist/esm/ion-reorder.entry.js +5 -4
  493. package/dist/esm/ion-route-redirect.entry.js +1 -1
  494. package/dist/esm/ion-route.entry.js +1 -1
  495. package/dist/esm/ion-router-link.entry.js +5 -5
  496. package/dist/esm/ion-router-outlet.entry.js +24 -20
  497. package/dist/esm/ion-router.entry.js +291 -194
  498. package/dist/esm/ion-segment-button.entry.js +10 -17
  499. package/dist/esm/ion-segment.entry.js +127 -26
  500. package/dist/esm/ion-select-option.entry.js +3 -3
  501. package/dist/esm/ion-select.entry.js +113 -78
  502. package/dist/esm/ion-slide.entry.js +3 -3
  503. package/dist/esm/ion-slides.entry.js +26 -27
  504. package/dist/esm/ion-spinner.entry.js +10 -9
  505. package/dist/esm/ion-split-pane.entry.js +16 -12
  506. package/dist/esm/ion-tab-bar.entry.js +16 -23
  507. package/dist/esm/ion-tab-button.entry.js +6 -6
  508. package/dist/esm/ion-tab.entry.js +4 -4
  509. package/dist/esm/ion-tabs.entry.js +4 -5
  510. package/dist/esm/ion-text.entry.js +3 -3
  511. package/dist/esm/ion-textarea.entry.js +31 -29
  512. package/dist/esm/ion-thumbnail.entry.js +2 -2
  513. package/dist/esm/ion-toast.entry.js +50 -60
  514. package/dist/esm/ion-toggle.entry.js +41 -22
  515. package/dist/esm/ion-virtual-scroll.entry.js +39 -31
  516. package/dist/esm/{ionic-global-2e28f7c7.js → ionic-global-6cd57191.js} +112 -93
  517. package/dist/esm/{ios.transition-a783e3cd.js → ios.transition-bbd952f2.js} +78 -53
  518. package/dist/esm/{keyboard-e6abcb80.js → keyboard-413afe04.js} +6 -3
  519. package/dist/esm/keyboard-controller-33693bc2.js +40 -0
  520. package/dist/esm/loader.js +5 -5
  521. package/dist/esm/{md.transition-5a4a8c82.js → md.transition-5170a6d3.js} +15 -17
  522. package/dist/esm/menu-toggle-util-82bf888a.js +12 -0
  523. package/dist/esm/overlays-bd4abb68.js +502 -0
  524. package/dist/esm/spinner-configs-cbcd1f62.js +145 -0
  525. package/dist/esm/{status-tap-69e62ad6.js → status-tap-ad757b8a.js} +10 -5
  526. package/dist/esm/swipe-back-7ef22876.js +69 -0
  527. package/dist/esm/theme-7cf2cab0.js +43 -0
  528. package/dist/types/components.d.ts +0 -13
  529. package/package.json +7 -8
  530. package/dist/cjs/button-active-c14dab31.js +0 -66
  531. package/dist/cjs/focus-visible-16c98640.js +0 -45
  532. package/dist/cjs/framework-delegate-c45292a3.js +0 -37
  533. package/dist/cjs/ion-action-sheet.cjs.entry.js +0 -265
  534. package/dist/cjs/ion-alert.cjs.entry.js +0 -456
  535. package/dist/cjs/ion-buttons.cjs.entry.js +0 -42
  536. package/dist/cjs/ion-checkbox.cjs.entry.js +0 -117
  537. package/dist/cjs/ion-note.cjs.entry.js +0 -29
  538. package/dist/cjs/ion-select-popover.cjs.entry.js +0 -35
  539. package/dist/cjs/spinner-configs-fb16b986.js +0 -112
  540. package/dist/cjs/test-component.cjs.entry.js +0 -13
  541. package/dist/collection/test/TestComponent.js +0 -3
  542. package/dist/collection/test/mockPodOS.js +0 -35
  543. package/dist/collection/test/renderFunctionalComponent.js +0 -8
  544. package/dist/custom-elements/focus-visible.js +0 -43
  545. package/dist/custom-elements/index.d.ts +0 -165
  546. package/dist/elements/p-03bda390.js +0 -1
  547. package/dist/elements/p-0be044f1.entry.js +0 -1
  548. package/dist/elements/p-119c7c6c.entry.js +0 -1
  549. package/dist/elements/p-14c7c3ea.entry.js +0 -1
  550. package/dist/elements/p-1d4a2c61.js +0 -1
  551. package/dist/elements/p-1d894ac4.entry.js +0 -1
  552. package/dist/elements/p-1dafa1ce.entry.js +0 -1
  553. package/dist/elements/p-23b89ccb.entry.js +0 -1
  554. package/dist/elements/p-2c03b9ab.entry.js +0 -1
  555. package/dist/elements/p-346985f2.js +0 -1
  556. package/dist/elements/p-360f1c62.entry.js +0 -1
  557. package/dist/elements/p-373e1f25.entry.js +0 -1
  558. package/dist/elements/p-40547acb.entry.js +0 -1
  559. package/dist/elements/p-40b68014.entry.js +0 -1
  560. package/dist/elements/p-42e4f702.entry.js +0 -1
  561. package/dist/elements/p-489807e5.js +0 -1
  562. package/dist/elements/p-4ad72d54.entry.js +0 -1
  563. package/dist/elements/p-4cca7b5e.entry.js +0 -1
  564. package/dist/elements/p-4f24d306.js +0 -1
  565. package/dist/elements/p-519d6a53.entry.js +0 -1
  566. package/dist/elements/p-536e8e52.entry.js +0 -1
  567. package/dist/elements/p-599bb53f.entry.js +0 -1
  568. package/dist/elements/p-5eb7a546.js +0 -1
  569. package/dist/elements/p-60df2bed.entry.js +0 -1
  570. package/dist/elements/p-65133e33.js +0 -1
  571. package/dist/elements/p-6693fce8.js +0 -1
  572. package/dist/elements/p-689bdcc1.entry.js +0 -1
  573. package/dist/elements/p-70713b3d.entry.js +0 -1
  574. package/dist/elements/p-707d5d76.js +0 -1
  575. package/dist/elements/p-7212b7f2.js +0 -1
  576. package/dist/elements/p-73992898.entry.js +0 -1
  577. package/dist/elements/p-792c1e0f.entry.js +0 -1
  578. package/dist/elements/p-7e5300af.js +0 -2
  579. package/dist/elements/p-8068987c.entry.js +0 -1
  580. package/dist/elements/p-83accf46.entry.js +0 -1
  581. package/dist/elements/p-86635d06.entry.js +0 -1
  582. package/dist/elements/p-874c2b44.js +0 -1
  583. package/dist/elements/p-89c12ce8.entry.js +0 -1
  584. package/dist/elements/p-8bcba3f7.entry.js +0 -1
  585. package/dist/elements/p-8c759f51.entry.js +0 -1
  586. package/dist/elements/p-8f945e6b.entry.js +0 -1
  587. package/dist/elements/p-9300ab6a.js +0 -1
  588. package/dist/elements/p-93cacd51.entry.js +0 -1
  589. package/dist/elements/p-9408d0b4.entry.js +0 -1
  590. package/dist/elements/p-98c79eda.js +0 -1
  591. package/dist/elements/p-99f8abed.js +0 -1
  592. package/dist/elements/p-9ca7e079.js +0 -1
  593. package/dist/elements/p-a4648b74.entry.js +0 -1
  594. package/dist/elements/p-aab0f63c.js +0 -1
  595. package/dist/elements/p-ad4e2295.entry.js +0 -1
  596. package/dist/elements/p-afb8f7d5.entry.js +0 -1
  597. package/dist/elements/p-b055ec44.js +0 -1
  598. package/dist/elements/p-b078d63b.entry.js +0 -1
  599. package/dist/elements/p-b3460325.entry.js +0 -1
  600. package/dist/elements/p-b5406b58.entry.js +0 -1
  601. package/dist/elements/p-b5ef0c91.entry.js +0 -1
  602. package/dist/elements/p-b6ba623e.entry.js +0 -1
  603. package/dist/elements/p-b9926d8b.entry.js +0 -1
  604. package/dist/elements/p-bfd4cfcd.entry.js +0 -1
  605. package/dist/elements/p-c08dd7d0.entry.js +0 -1
  606. package/dist/elements/p-c0db9c51.entry.js +0 -1
  607. package/dist/elements/p-c1e7fbfb.js +0 -1
  608. package/dist/elements/p-ca69d6c9.js +0 -1
  609. package/dist/elements/p-cc4cb1ac.entry.js +0 -1
  610. package/dist/elements/p-cf8a7031.entry.js +0 -1
  611. package/dist/elements/p-cff82b6f.js +0 -1
  612. package/dist/elements/p-d01009b8.entry.js +0 -67
  613. package/dist/elements/p-d6d1e65f.entry.js +0 -1
  614. package/dist/elements/p-d9462b66.entry.js +0 -1
  615. package/dist/elements/p-e2e0fee9.entry.js +0 -1
  616. package/dist/elements/p-e642b266.entry.js +0 -1
  617. package/dist/elements/p-e953934f.entry.js +0 -1
  618. package/dist/elements/p-f0474f46.js +0 -1
  619. package/dist/elements/p-f10a94f6.entry.js +0 -1
  620. package/dist/elements/p-f2426182.entry.js +0 -1
  621. package/dist/elements/p-f327fd21.js +0 -1
  622. package/dist/elements/p-f84987ee.js +0 -1
  623. package/dist/elements/p-f8a3367d.entry.js +0 -1
  624. package/dist/esm/focus-visible-edb28f19.js +0 -43
  625. package/dist/esm/framework-delegate-9cd8048f.js +0 -34
  626. package/dist/esm/ion-action-sheet.entry.js +0 -261
  627. package/dist/esm/ion-note.entry.js +0 -25
  628. package/dist/esm/ion-select-popover.entry.js +0 -31
  629. package/dist/esm/spinner-configs-aaf2a1a9.js +0 -110
  630. package/dist/esm/swipe-back-d84cfc8a.js +0 -50
  631. package/dist/esm/test-component.entry.js +0 -9
  632. package/dist/types/test/TestComponent.d.ts +0 -2
  633. package/dist/types/test/mockPodOS.d.ts +0 -11
  634. package/dist/types/test/renderFunctionalComponent.d.ts +0 -1
@@ -0,0 +1,1765 @@
1
+ import { proxyCustomElement, HTMLElement, createEvent, writeTask, h, Host } from '@stencil/core/internal/client';
2
+ import { g as getIonMode, c as config } from './ionic-global.js';
3
+ import { f as findClosestIonContent, i as isIonContent, d as disableContentScrollY, r as resetContentScrollY, a as findIonContent, p as printIonContentErrorMsg } from './index5.js';
4
+ import { C as CoreDelegate, a as attachComponent, d as detachComponent } from './framework-delegate.js';
5
+ import { g as getElementRoot, l as clamp, r as raf, e as inheritAttributes } from './helpers.js';
6
+ import { KEYBOARD_DID_OPEN } from './keyboard.js';
7
+ import { p as printIonWarning } from './index4.js';
8
+ import { w as win } from './index10.js';
9
+ import { G as GESTURE, B as BACKDROP, p as prepareOverlay, a as present, b as activeAnimations, d as dismiss, e as eventMethod } from './overlays.js';
10
+ import { g as getClassMap } from './theme.js';
11
+ import { d as deepReady } from './index7.js';
12
+ import { c as createAnimation } from './animation.js';
13
+ import { g as getTimeGivenProgression } from './cubic-bezier.js';
14
+ import { createGesture } from './index9.js';
15
+ import { d as defineCustomElement$2 } from './backdrop.js';
16
+
17
+ /*!
18
+ * (C) Ionic http://ionicframework.com - MIT License
19
+ */
20
+ var Style;
21
+ (function (Style) {
22
+ Style["Dark"] = "DARK";
23
+ Style["Light"] = "LIGHT";
24
+ Style["Default"] = "DEFAULT";
25
+ })(Style || (Style = {}));
26
+ const StatusBar = {
27
+ getEngine() {
28
+ var _a;
29
+ return ((_a = win === null || win === void 0 ? void 0 : win.Capacitor) === null || _a === void 0 ? void 0 : _a.isPluginAvailable('StatusBar')) && (win === null || win === void 0 ? void 0 : win.Capacitor.Plugins.StatusBar);
30
+ },
31
+ supportsDefaultStatusBarStyle() {
32
+ var _a;
33
+ /**
34
+ * The 'DEFAULT' status bar style was added
35
+ * to the @capacitor/status-bar plugin in Capacitor 3.
36
+ * PluginHeaders is only supported in Capacitor 3+,
37
+ * so we can use this to detect Capacitor 3.
38
+ */
39
+ return !!((_a = win === null || win === void 0 ? void 0 : win.Capacitor) === null || _a === void 0 ? void 0 : _a.PluginHeaders);
40
+ },
41
+ setStyle(options) {
42
+ const engine = this.getEngine();
43
+ if (!engine) {
44
+ return;
45
+ }
46
+ engine.setStyle(options);
47
+ },
48
+ getStyle: async function () {
49
+ const engine = this.getEngine();
50
+ if (!engine) {
51
+ return Style.Default;
52
+ }
53
+ const { style } = await engine.getInfo();
54
+ return style;
55
+ },
56
+ };
57
+
58
+ /*!
59
+ * (C) Ionic http://ionicframework.com - MIT License
60
+ */
61
+ /**
62
+ * Use y = mx + b to
63
+ * figure out the backdrop value
64
+ * at a particular x coordinate. This
65
+ * is useful when the backdrop does
66
+ * not begin to fade in until after
67
+ * the 0 breakpoint.
68
+ */
69
+ const getBackdropValueForSheet = (x, backdropBreakpoint) => {
70
+ /**
71
+ * We will use these points:
72
+ * (backdropBreakpoint, 0)
73
+ * (maxBreakpoint, 1)
74
+ * We know that at the beginning breakpoint,
75
+ * the backdrop will be hidden. We also
76
+ * know that at the maxBreakpoint, the backdrop
77
+ * must be fully visible. maxBreakpoint should
78
+ * always be 1 even if the maximum value
79
+ * of the breakpoints array is not 1 since
80
+ * the animation runs from a progress of 0
81
+ * to a progress of 1.
82
+ * m = (y2 - y1) / (x2 - x1)
83
+ *
84
+ * This is simplified from:
85
+ * m = (1 - 0) / (maxBreakpoint - backdropBreakpoint)
86
+ *
87
+ * If the backdropBreakpoint is 1, we return 0 as the
88
+ * backdrop is completely hidden.
89
+ *
90
+ */
91
+ if (backdropBreakpoint === 1) {
92
+ return 0;
93
+ }
94
+ const slope = 1 / (1 - backdropBreakpoint);
95
+ /**
96
+ * From here, compute b which is
97
+ * the backdrop opacity if the offset
98
+ * is 0. If the backdrop does not
99
+ * begin to fade in until after the
100
+ * 0 breakpoint, this b value will be
101
+ * negative. This is fine as we never pass
102
+ * b directly into the animation keyframes.
103
+ * b = y - mx
104
+ * Use a known point: (backdropBreakpoint, 0)
105
+ * This is simplified from:
106
+ * b = 0 - (backdropBreakpoint * slope)
107
+ */
108
+ const b = -(backdropBreakpoint * slope);
109
+ /**
110
+ * Finally, we can now determine the
111
+ * backdrop offset given an arbitrary
112
+ * gesture offset.
113
+ */
114
+ return x * slope + b;
115
+ };
116
+ /**
117
+ * The tablet/desktop card modal activates
118
+ * when the window width is >= 768.
119
+ * At that point, the presenting element
120
+ * is not transformed, so we do not need to
121
+ * adjust the status bar color.
122
+ *
123
+ * Note: We check supportsDefaultStatusBarStyle so that
124
+ * Capacitor <= 2 users do not get their status bar
125
+ * stuck in an inconsistent state due to a lack of
126
+ * support for Style.Default.
127
+ */
128
+ const setCardStatusBarDark = () => {
129
+ if (!win || win.innerWidth >= 768 || !StatusBar.supportsDefaultStatusBarStyle()) {
130
+ return;
131
+ }
132
+ StatusBar.setStyle({ style: Style.Dark });
133
+ };
134
+ const setCardStatusBarDefault = (defaultStyle = Style.Default) => {
135
+ if (!win || win.innerWidth >= 768 || !StatusBar.supportsDefaultStatusBarStyle()) {
136
+ return;
137
+ }
138
+ StatusBar.setStyle({ style: defaultStyle });
139
+ };
140
+
141
+ /*!
142
+ * (C) Ionic http://ionicframework.com - MIT License
143
+ */
144
+ const handleCanDismiss = async (el, animation) => {
145
+ /**
146
+ * If canDismiss is not a function
147
+ * then we can return early. If canDismiss is `true`,
148
+ * then canDismissBlocksGesture is `false` as canDismiss
149
+ * will never interrupt the gesture. As a result,
150
+ * this code block is never reached. If canDismiss is `false`,
151
+ * then we never dismiss.
152
+ */
153
+ if (typeof el.canDismiss !== 'function') {
154
+ return;
155
+ }
156
+ /**
157
+ * Run the canDismiss callback.
158
+ * If the function returns `true`,
159
+ * then we can proceed with dismiss.
160
+ */
161
+ const shouldDismiss = await el.canDismiss(undefined, GESTURE);
162
+ if (!shouldDismiss) {
163
+ return;
164
+ }
165
+ /**
166
+ * If canDismiss resolved after the snap
167
+ * back animation finished, we can
168
+ * dismiss immediately.
169
+ *
170
+ * If canDismiss resolved before the snap
171
+ * back animation finished, we need to
172
+ * wait until the snap back animation is
173
+ * done before dismissing.
174
+ */
175
+ if (animation.isRunning()) {
176
+ animation.onFinish(() => {
177
+ el.dismiss(undefined, 'handler');
178
+ }, { oneTimeCallback: true });
179
+ }
180
+ else {
181
+ el.dismiss(undefined, 'handler');
182
+ }
183
+ };
184
+ /**
185
+ * This function lets us simulate a realistic spring-like animation
186
+ * when swiping down on the modal.
187
+ * There are two forces that we need to use to compute the spring physics:
188
+ *
189
+ * 1. Stiffness, k: This is a measure of resistance applied a spring.
190
+ * 2. Dampening, c: This value has the effect of reducing or preventing oscillation.
191
+ *
192
+ * Using these two values, we can calculate the Spring Force and the Dampening Force
193
+ * to compute the total force applied to a spring.
194
+ *
195
+ * Spring Force: This force pulls a spring back into its equilibrium position.
196
+ * Hooke's Law tells us that that spring force (FS) = kX.
197
+ * k is the stiffness of a spring, and X is the displacement of the spring from its
198
+ * equilibrium position. In this case, it is the amount by which the free end
199
+ * of a spring was displaced (stretched/pushed) from its "relaxed" position.
200
+ *
201
+ * Dampening Force: This force slows down motion. Without it, a spring would oscillate forever.
202
+ * The dampening force, FD, can be found via this formula: FD = -cv
203
+ * where c the dampening value and v is velocity.
204
+ *
205
+ * Therefore, the resulting force that is exerted on the block is:
206
+ * F = FS + FD = -kX - cv
207
+ *
208
+ * Newton's 2nd Law tells us that F = ma:
209
+ * ma = -kX - cv.
210
+ *
211
+ * For Ionic's purposes, we can assume that m = 1:
212
+ * a = -kX - cv
213
+ *
214
+ * Imagine a block attached to the end of a spring. At equilibrium
215
+ * the block is at position x = 1.
216
+ * Pressing on the block moves it to position x = 0;
217
+ * So, to calculate the displacement, we need to take the
218
+ * current position and subtract the previous position from it.
219
+ * X = x - x0 = 0 - 1 = -1.
220
+ *
221
+ * For Ionic's purposes, we are only pushing on the spring modal
222
+ * so we have a max position of 1.
223
+ * As a result, we can expand displacement to this formula:
224
+ * X = x - 1
225
+ *
226
+ * a = -k(x - 1) - cv
227
+ *
228
+ * We can represent the motion of something as a function of time: f(t) = x.
229
+ * The derivative of position gives us the velocity: f'(t)
230
+ * The derivative of the velocity gives us the acceleration: f''(t)
231
+ *
232
+ * We can substitute the formula above with these values:
233
+ *
234
+ * f"(t) = -k * (f(t) - 1) - c * f'(t)
235
+ *
236
+ * This is called a differential equation.
237
+ *
238
+ * We know that at t = 0, we are at x = 0 because the modal does not move: f(0) = 0
239
+ * This means our velocity is also zero: f'(0) = 0.
240
+ *
241
+ * We can cheat a bit and plug the formula into Wolfram Alpha.
242
+ * However, we need to pick stiffness and dampening values:
243
+ * k = 0.57
244
+ * c = 15
245
+ *
246
+ * I picked these as they are fairly close to native iOS's spring effect
247
+ * with the modal.
248
+ *
249
+ * What we plug in is this: f(0) = 0; f'(0) = 0; f''(t) = -0.57(f(t) - 1) - 15f'(t)
250
+ *
251
+ * The result is a formula that lets us calculate the acceleration
252
+ * for a given time t.
253
+ * Note: This is the approximate form of the solution. Wolfram Alpha will
254
+ * give you a complex differential equation too.
255
+ */
256
+ const calculateSpringStep = (t) => {
257
+ return 0.00255275 * 2.71828 ** (-14.9619 * t) - 1.00255 * 2.71828 ** (-0.0380968 * t) + 1;
258
+ };
259
+
260
+ /*!
261
+ * (C) Ionic http://ionicframework.com - MIT License
262
+ */
263
+ // Defaults for the card swipe animation
264
+ const SwipeToCloseDefaults = {
265
+ MIN_PRESENTING_SCALE: 0.93,
266
+ };
267
+ const createSwipeToCloseGesture = (el, animation, statusBarStyle, onDismiss) => {
268
+ /**
269
+ * The step value at which a card modal
270
+ * is eligible for dismissing via gesture.
271
+ */
272
+ const DISMISS_THRESHOLD = 0.5;
273
+ const height = el.offsetHeight;
274
+ let isOpen = false;
275
+ let canDismissBlocksGesture = false;
276
+ let contentEl = null;
277
+ let scrollEl = null;
278
+ const canDismissMaxStep = 0.2;
279
+ let initialScrollY = true;
280
+ let lastStep = 0;
281
+ const getScrollY = () => {
282
+ if (contentEl && isIonContent(contentEl)) {
283
+ return contentEl.scrollY;
284
+ /**
285
+ * Custom scroll containers are intended to be
286
+ * used with virtual scrolling, so we assume
287
+ * there is scrolling in this case.
288
+ */
289
+ }
290
+ else {
291
+ return true;
292
+ }
293
+ };
294
+ const canStart = (detail) => {
295
+ const target = detail.event.target;
296
+ if (target === null || !target.closest) {
297
+ return true;
298
+ }
299
+ /**
300
+ * If we are swiping on the content,
301
+ * swiping should only be possible if
302
+ * the content is scrolled all the way
303
+ * to the top so that we do not interfere
304
+ * with scrolling.
305
+ *
306
+ * We cannot assume that the `ion-content`
307
+ * target will remain consistent between
308
+ * swipes. For example, when using
309
+ * ion-nav within a card modal it is
310
+ * possible to swipe, push a view, and then
311
+ * swipe again. The target content will not
312
+ * be the same between swipes.
313
+ */
314
+ contentEl = findClosestIonContent(target);
315
+ if (contentEl) {
316
+ /**
317
+ * The card should never swipe to close
318
+ * on the content with a refresher.
319
+ * Note: We cannot solve this by making the
320
+ * swipeToClose gesture have a higher priority
321
+ * than the refresher gesture as the iOS native
322
+ * refresh gesture uses a scroll listener in
323
+ * addition to a gesture.
324
+ *
325
+ * Note: Do not use getScrollElement here
326
+ * because we need this to be a synchronous
327
+ * operation, and getScrollElement is
328
+ * asynchronous.
329
+ */
330
+ if (isIonContent(contentEl)) {
331
+ const root = getElementRoot(contentEl);
332
+ scrollEl = root.querySelector('.inner-scroll');
333
+ }
334
+ else {
335
+ scrollEl = contentEl;
336
+ }
337
+ const hasRefresherInContent = !!contentEl.querySelector('ion-refresher');
338
+ return !hasRefresherInContent && scrollEl.scrollTop === 0;
339
+ }
340
+ /**
341
+ * Card should be swipeable on all
342
+ * parts of the modal except for the footer.
343
+ */
344
+ const footer = target.closest('ion-footer');
345
+ if (footer === null) {
346
+ return true;
347
+ }
348
+ return false;
349
+ };
350
+ const onStart = (detail) => {
351
+ const { deltaY } = detail;
352
+ /**
353
+ * Get the initial scrollY value so
354
+ * that we can correctly reset the scrollY
355
+ * prop when the gesture ends.
356
+ */
357
+ initialScrollY = getScrollY();
358
+ /**
359
+ * If canDismiss is anything other than `true`
360
+ * then users should be able to swipe down
361
+ * until a threshold is hit. At that point,
362
+ * the card modal should not proceed any further.
363
+ * TODO (FW-937)
364
+ * Remove undefined check
365
+ */
366
+ canDismissBlocksGesture = el.canDismiss !== undefined && el.canDismiss !== true;
367
+ /**
368
+ * If we are pulling down, then
369
+ * it is possible we are pulling on the
370
+ * content. We do not want scrolling to
371
+ * happen at the same time as the gesture.
372
+ */
373
+ if (deltaY > 0 && contentEl) {
374
+ disableContentScrollY(contentEl);
375
+ }
376
+ animation.progressStart(true, isOpen ? 1 : 0);
377
+ };
378
+ const onMove = (detail) => {
379
+ const { deltaY } = detail;
380
+ /**
381
+ * If we are pulling down, then
382
+ * it is possible we are pulling on the
383
+ * content. We do not want scrolling to
384
+ * happen at the same time as the gesture.
385
+ */
386
+ if (deltaY > 0 && contentEl) {
387
+ disableContentScrollY(contentEl);
388
+ }
389
+ /**
390
+ * If we are swiping on the content
391
+ * then the swipe gesture should only
392
+ * happen if we are pulling down.
393
+ *
394
+ * However, if we pull up and
395
+ * then down such that the scroll position
396
+ * returns to 0, we should be able to swipe
397
+ * the card.
398
+ */
399
+ const step = detail.deltaY / height;
400
+ /**
401
+ * Check if user is swiping down and
402
+ * if we have a canDismiss value that
403
+ * should block the gesture from
404
+ * proceeding,
405
+ */
406
+ const isAttemptingDismissWithCanDismiss = step >= 0 && canDismissBlocksGesture;
407
+ /**
408
+ * If we are blocking the gesture from dismissing,
409
+ * set the max step value so that the sheet cannot be
410
+ * completely hidden.
411
+ */
412
+ const maxStep = isAttemptingDismissWithCanDismiss ? canDismissMaxStep : 0.9999;
413
+ /**
414
+ * If we are blocking the gesture from
415
+ * dismissing, calculate the spring modifier value
416
+ * this will be added to the starting breakpoint
417
+ * value to give the gesture a spring-like feeling.
418
+ * Note that the starting breakpoint is always 0,
419
+ * so we omit adding 0 to the result.
420
+ */
421
+ const processedStep = isAttemptingDismissWithCanDismiss ? calculateSpringStep(step / maxStep) : step;
422
+ const clampedStep = clamp(0.0001, processedStep, maxStep);
423
+ animation.progressStep(clampedStep);
424
+ /**
425
+ * When swiping down half way, the status bar style
426
+ * should be reset to its default value.
427
+ *
428
+ * We track lastStep so that we do not fire these
429
+ * functions on every onMove, only when the user has
430
+ * crossed a certain threshold.
431
+ */
432
+ if (clampedStep >= DISMISS_THRESHOLD && lastStep < DISMISS_THRESHOLD) {
433
+ setCardStatusBarDefault(statusBarStyle);
434
+ /**
435
+ * However, if we swipe back up, then the
436
+ * status bar style should be set to have light
437
+ * text on a dark background.
438
+ */
439
+ }
440
+ else if (clampedStep < DISMISS_THRESHOLD && lastStep >= DISMISS_THRESHOLD) {
441
+ setCardStatusBarDark();
442
+ }
443
+ lastStep = clampedStep;
444
+ };
445
+ const onEnd = (detail) => {
446
+ const velocity = detail.velocityY;
447
+ const step = detail.deltaY / height;
448
+ const isAttemptingDismissWithCanDismiss = step >= 0 && canDismissBlocksGesture;
449
+ const maxStep = isAttemptingDismissWithCanDismiss ? canDismissMaxStep : 0.9999;
450
+ const processedStep = isAttemptingDismissWithCanDismiss ? calculateSpringStep(step / maxStep) : step;
451
+ const clampedStep = clamp(0.0001, processedStep, maxStep);
452
+ const threshold = (detail.deltaY + velocity * 1000) / height;
453
+ /**
454
+ * If canDismiss blocks
455
+ * the swipe gesture, then the
456
+ * animation can never complete until
457
+ * canDismiss is checked.
458
+ */
459
+ const shouldComplete = !isAttemptingDismissWithCanDismiss && threshold >= DISMISS_THRESHOLD;
460
+ let newStepValue = shouldComplete ? -0.001 : 0.001;
461
+ if (!shouldComplete) {
462
+ animation.easing('cubic-bezier(1, 0, 0.68, 0.28)');
463
+ newStepValue += getTimeGivenProgression([0, 0], [1, 0], [0.68, 0.28], [1, 1], clampedStep)[0];
464
+ }
465
+ else {
466
+ animation.easing('cubic-bezier(0.32, 0.72, 0, 1)');
467
+ newStepValue += getTimeGivenProgression([0, 0], [0.32, 0.72], [0, 1], [1, 1], clampedStep)[0];
468
+ }
469
+ const duration = shouldComplete
470
+ ? computeDuration(step * height, velocity)
471
+ : computeDuration((1 - clampedStep) * height, velocity);
472
+ isOpen = shouldComplete;
473
+ gesture.enable(false);
474
+ if (contentEl) {
475
+ resetContentScrollY(contentEl, initialScrollY);
476
+ }
477
+ animation
478
+ .onFinish(() => {
479
+ if (!shouldComplete) {
480
+ gesture.enable(true);
481
+ }
482
+ })
483
+ .progressEnd(shouldComplete ? 1 : 0, newStepValue, duration);
484
+ /**
485
+ * If the canDismiss value blocked the gesture
486
+ * from proceeding, then we should ignore whatever
487
+ * shouldComplete is. Whether or not the modal
488
+ * animation should complete is now determined by
489
+ * canDismiss.
490
+ *
491
+ * If the user swiped >25% of the way
492
+ * to the max step, then we should
493
+ * check canDismiss. 25% was chosen
494
+ * to avoid accidental swipes.
495
+ */
496
+ if (isAttemptingDismissWithCanDismiss && clampedStep > maxStep / 4) {
497
+ handleCanDismiss(el, animation);
498
+ }
499
+ else if (shouldComplete) {
500
+ onDismiss();
501
+ }
502
+ };
503
+ const gesture = createGesture({
504
+ el,
505
+ gestureName: 'modalSwipeToClose',
506
+ gesturePriority: 39,
507
+ direction: 'y',
508
+ threshold: 10,
509
+ canStart,
510
+ onStart,
511
+ onMove,
512
+ onEnd,
513
+ });
514
+ return gesture;
515
+ };
516
+ const computeDuration = (remaining, velocity) => {
517
+ return clamp(400, remaining / Math.abs(velocity * 1.1), 500);
518
+ };
519
+
520
+ /*!
521
+ * (C) Ionic http://ionicframework.com - MIT License
522
+ */
523
+ const createSheetEnterAnimation = (opts) => {
524
+ const { currentBreakpoint, backdropBreakpoint } = opts;
525
+ /**
526
+ * If the backdropBreakpoint is undefined, then the backdrop
527
+ * should always fade in. If the backdropBreakpoint came before the
528
+ * current breakpoint, then the backdrop should be fading in.
529
+ */
530
+ const shouldShowBackdrop = backdropBreakpoint === undefined || backdropBreakpoint < currentBreakpoint;
531
+ const initialBackdrop = shouldShowBackdrop ? `calc(var(--backdrop-opacity) * ${currentBreakpoint})` : '0';
532
+ const backdropAnimation = createAnimation('backdropAnimation').fromTo('opacity', 0, initialBackdrop);
533
+ if (shouldShowBackdrop) {
534
+ backdropAnimation
535
+ .beforeStyles({
536
+ 'pointer-events': 'none',
537
+ })
538
+ .afterClearStyles(['pointer-events']);
539
+ }
540
+ const wrapperAnimation = createAnimation('wrapperAnimation').keyframes([
541
+ { offset: 0, opacity: 1, transform: 'translateY(100%)' },
542
+ { offset: 1, opacity: 1, transform: `translateY(${100 - currentBreakpoint * 100}%)` },
543
+ ]);
544
+ return { wrapperAnimation, backdropAnimation };
545
+ };
546
+ const createSheetLeaveAnimation = (opts) => {
547
+ const { currentBreakpoint, backdropBreakpoint } = opts;
548
+ /**
549
+ * Backdrop does not always fade in from 0 to 1 if backdropBreakpoint
550
+ * is defined, so we need to account for that offset by figuring out
551
+ * what the current backdrop value should be.
552
+ */
553
+ const backdropValue = `calc(var(--backdrop-opacity) * ${getBackdropValueForSheet(currentBreakpoint, backdropBreakpoint)})`;
554
+ const defaultBackdrop = [
555
+ { offset: 0, opacity: backdropValue },
556
+ { offset: 1, opacity: 0 },
557
+ ];
558
+ const customBackdrop = [
559
+ { offset: 0, opacity: backdropValue },
560
+ { offset: backdropBreakpoint, opacity: 0 },
561
+ { offset: 1, opacity: 0 },
562
+ ];
563
+ const backdropAnimation = createAnimation('backdropAnimation').keyframes(backdropBreakpoint !== 0 ? customBackdrop : defaultBackdrop);
564
+ const wrapperAnimation = createAnimation('wrapperAnimation').keyframes([
565
+ { offset: 0, opacity: 1, transform: `translateY(${100 - currentBreakpoint * 100}%)` },
566
+ { offset: 1, opacity: 1, transform: `translateY(100%)` },
567
+ ]);
568
+ return { wrapperAnimation, backdropAnimation };
569
+ };
570
+
571
+ /*!
572
+ * (C) Ionic http://ionicframework.com - MIT License
573
+ */
574
+ const createEnterAnimation$1 = () => {
575
+ const backdropAnimation = createAnimation()
576
+ .fromTo('opacity', 0.01, 'var(--backdrop-opacity)')
577
+ .beforeStyles({
578
+ 'pointer-events': 'none',
579
+ })
580
+ .afterClearStyles(['pointer-events']);
581
+ const wrapperAnimation = createAnimation().fromTo('transform', 'translateY(100vh)', 'translateY(0vh)');
582
+ return { backdropAnimation, wrapperAnimation };
583
+ };
584
+ /**
585
+ * iOS Modal Enter Animation for the Card presentation style
586
+ */
587
+ const iosEnterAnimation = (baseEl, opts) => {
588
+ const { presentingEl, currentBreakpoint } = opts;
589
+ const root = getElementRoot(baseEl);
590
+ const { wrapperAnimation, backdropAnimation } = currentBreakpoint !== undefined ? createSheetEnterAnimation(opts) : createEnterAnimation$1();
591
+ backdropAnimation.addElement(root.querySelector('ion-backdrop'));
592
+ wrapperAnimation.addElement(root.querySelectorAll('.modal-wrapper, .modal-shadow')).beforeStyles({ opacity: 1 });
593
+ const baseAnimation = createAnimation('entering-base')
594
+ .addElement(baseEl)
595
+ .easing('cubic-bezier(0.32,0.72,0,1)')
596
+ .duration(500)
597
+ .addAnimation(wrapperAnimation);
598
+ if (presentingEl) {
599
+ const isMobile = window.innerWidth < 768;
600
+ const hasCardModal = presentingEl.tagName === 'ION-MODAL' && presentingEl.presentingElement !== undefined;
601
+ const presentingElRoot = getElementRoot(presentingEl);
602
+ const presentingAnimation = createAnimation().beforeStyles({
603
+ transform: 'translateY(0)',
604
+ 'transform-origin': 'top center',
605
+ overflow: 'hidden',
606
+ });
607
+ const bodyEl = document.body;
608
+ if (isMobile) {
609
+ /**
610
+ * Fallback for browsers that does not support `max()` (ex: Firefox)
611
+ * No need to worry about statusbar padding since engines like Gecko
612
+ * are not used as the engine for standalone Cordova/Capacitor apps
613
+ */
614
+ const transformOffset = !CSS.supports('width', 'max(0px, 1px)') ? '30px' : 'max(30px, var(--ion-safe-area-top))';
615
+ const modalTransform = hasCardModal ? '-10px' : transformOffset;
616
+ const toPresentingScale = SwipeToCloseDefaults.MIN_PRESENTING_SCALE;
617
+ const finalTransform = `translateY(${modalTransform}) scale(${toPresentingScale})`;
618
+ presentingAnimation
619
+ .afterStyles({
620
+ transform: finalTransform,
621
+ })
622
+ .beforeAddWrite(() => bodyEl.style.setProperty('background-color', 'black'))
623
+ .addElement(presentingEl)
624
+ .keyframes([
625
+ { offset: 0, filter: 'contrast(1)', transform: 'translateY(0px) scale(1)', borderRadius: '0px' },
626
+ { offset: 1, filter: 'contrast(0.85)', transform: finalTransform, borderRadius: '10px 10px 0 0' },
627
+ ]);
628
+ baseAnimation.addAnimation(presentingAnimation);
629
+ }
630
+ else {
631
+ baseAnimation.addAnimation(backdropAnimation);
632
+ if (!hasCardModal) {
633
+ wrapperAnimation.fromTo('opacity', '0', '1');
634
+ }
635
+ else {
636
+ const toPresentingScale = hasCardModal ? SwipeToCloseDefaults.MIN_PRESENTING_SCALE : 1;
637
+ const finalTransform = `translateY(-10px) scale(${toPresentingScale})`;
638
+ presentingAnimation
639
+ .afterStyles({
640
+ transform: finalTransform,
641
+ })
642
+ .addElement(presentingElRoot.querySelector('.modal-wrapper'))
643
+ .keyframes([
644
+ { offset: 0, filter: 'contrast(1)', transform: 'translateY(0) scale(1)' },
645
+ { offset: 1, filter: 'contrast(0.85)', transform: finalTransform },
646
+ ]);
647
+ const shadowAnimation = createAnimation()
648
+ .afterStyles({
649
+ transform: finalTransform,
650
+ })
651
+ .addElement(presentingElRoot.querySelector('.modal-shadow'))
652
+ .keyframes([
653
+ { offset: 0, opacity: '1', transform: 'translateY(0) scale(1)' },
654
+ { offset: 1, opacity: '0', transform: finalTransform },
655
+ ]);
656
+ baseAnimation.addAnimation([presentingAnimation, shadowAnimation]);
657
+ }
658
+ }
659
+ }
660
+ else {
661
+ baseAnimation.addAnimation(backdropAnimation);
662
+ }
663
+ return baseAnimation;
664
+ };
665
+
666
+ /*!
667
+ * (C) Ionic http://ionicframework.com - MIT License
668
+ */
669
+ const createLeaveAnimation$1 = () => {
670
+ const backdropAnimation = createAnimation().fromTo('opacity', 'var(--backdrop-opacity)', 0);
671
+ const wrapperAnimation = createAnimation().fromTo('transform', 'translateY(0vh)', 'translateY(100vh)');
672
+ return { backdropAnimation, wrapperAnimation };
673
+ };
674
+ /**
675
+ * iOS Modal Leave Animation
676
+ */
677
+ const iosLeaveAnimation = (baseEl, opts, duration = 500) => {
678
+ const { presentingEl, currentBreakpoint } = opts;
679
+ const root = getElementRoot(baseEl);
680
+ const { wrapperAnimation, backdropAnimation } = currentBreakpoint !== undefined ? createSheetLeaveAnimation(opts) : createLeaveAnimation$1();
681
+ backdropAnimation.addElement(root.querySelector('ion-backdrop'));
682
+ wrapperAnimation.addElement(root.querySelectorAll('.modal-wrapper, .modal-shadow')).beforeStyles({ opacity: 1 });
683
+ const baseAnimation = createAnimation('leaving-base')
684
+ .addElement(baseEl)
685
+ .easing('cubic-bezier(0.32,0.72,0,1)')
686
+ .duration(duration)
687
+ .addAnimation(wrapperAnimation);
688
+ if (presentingEl) {
689
+ const isMobile = window.innerWidth < 768;
690
+ const hasCardModal = presentingEl.tagName === 'ION-MODAL' && presentingEl.presentingElement !== undefined;
691
+ const presentingElRoot = getElementRoot(presentingEl);
692
+ const presentingAnimation = createAnimation()
693
+ .beforeClearStyles(['transform'])
694
+ .afterClearStyles(['transform'])
695
+ .onFinish((currentStep) => {
696
+ // only reset background color if this is the last card-style modal
697
+ if (currentStep !== 1) {
698
+ return;
699
+ }
700
+ presentingEl.style.setProperty('overflow', '');
701
+ const numModals = Array.from(bodyEl.querySelectorAll('ion-modal')).filter((m) => m.presentingElement !== undefined).length;
702
+ if (numModals <= 1) {
703
+ bodyEl.style.setProperty('background-color', '');
704
+ }
705
+ });
706
+ const bodyEl = document.body;
707
+ if (isMobile) {
708
+ const transformOffset = !CSS.supports('width', 'max(0px, 1px)') ? '30px' : 'max(30px, var(--ion-safe-area-top))';
709
+ const modalTransform = hasCardModal ? '-10px' : transformOffset;
710
+ const toPresentingScale = SwipeToCloseDefaults.MIN_PRESENTING_SCALE;
711
+ const finalTransform = `translateY(${modalTransform}) scale(${toPresentingScale})`;
712
+ presentingAnimation.addElement(presentingEl).keyframes([
713
+ { offset: 0, filter: 'contrast(0.85)', transform: finalTransform, borderRadius: '10px 10px 0 0' },
714
+ { offset: 1, filter: 'contrast(1)', transform: 'translateY(0px) scale(1)', borderRadius: '0px' },
715
+ ]);
716
+ baseAnimation.addAnimation(presentingAnimation);
717
+ }
718
+ else {
719
+ baseAnimation.addAnimation(backdropAnimation);
720
+ if (!hasCardModal) {
721
+ wrapperAnimation.fromTo('opacity', '1', '0');
722
+ }
723
+ else {
724
+ const toPresentingScale = hasCardModal ? SwipeToCloseDefaults.MIN_PRESENTING_SCALE : 1;
725
+ const finalTransform = `translateY(-10px) scale(${toPresentingScale})`;
726
+ presentingAnimation
727
+ .addElement(presentingElRoot.querySelector('.modal-wrapper'))
728
+ .afterStyles({
729
+ transform: 'translate3d(0, 0, 0)',
730
+ })
731
+ .keyframes([
732
+ { offset: 0, filter: 'contrast(0.85)', transform: finalTransform },
733
+ { offset: 1, filter: 'contrast(1)', transform: 'translateY(0) scale(1)' },
734
+ ]);
735
+ const shadowAnimation = createAnimation()
736
+ .addElement(presentingElRoot.querySelector('.modal-shadow'))
737
+ .afterStyles({
738
+ transform: 'translateY(0) scale(1)',
739
+ })
740
+ .keyframes([
741
+ { offset: 0, opacity: '0', transform: finalTransform },
742
+ { offset: 1, opacity: '1', transform: 'translateY(0) scale(1)' },
743
+ ]);
744
+ baseAnimation.addAnimation([presentingAnimation, shadowAnimation]);
745
+ }
746
+ }
747
+ }
748
+ else {
749
+ baseAnimation.addAnimation(backdropAnimation);
750
+ }
751
+ return baseAnimation;
752
+ };
753
+
754
+ /*!
755
+ * (C) Ionic http://ionicframework.com - MIT License
756
+ */
757
+ const createEnterAnimation = () => {
758
+ const backdropAnimation = createAnimation()
759
+ .fromTo('opacity', 0.01, 'var(--backdrop-opacity)')
760
+ .beforeStyles({
761
+ 'pointer-events': 'none',
762
+ })
763
+ .afterClearStyles(['pointer-events']);
764
+ const wrapperAnimation = createAnimation().keyframes([
765
+ { offset: 0, opacity: 0.01, transform: 'translateY(40px)' },
766
+ { offset: 1, opacity: 1, transform: `translateY(0px)` },
767
+ ]);
768
+ return { backdropAnimation, wrapperAnimation };
769
+ };
770
+ /**
771
+ * Md Modal Enter Animation
772
+ */
773
+ const mdEnterAnimation = (baseEl, opts) => {
774
+ const { currentBreakpoint } = opts;
775
+ const root = getElementRoot(baseEl);
776
+ const { wrapperAnimation, backdropAnimation } = currentBreakpoint !== undefined ? createSheetEnterAnimation(opts) : createEnterAnimation();
777
+ backdropAnimation.addElement(root.querySelector('ion-backdrop'));
778
+ wrapperAnimation.addElement(root.querySelector('.modal-wrapper'));
779
+ return createAnimation()
780
+ .addElement(baseEl)
781
+ .easing('cubic-bezier(0.36,0.66,0.04,1)')
782
+ .duration(280)
783
+ .addAnimation([backdropAnimation, wrapperAnimation]);
784
+ };
785
+
786
+ /*!
787
+ * (C) Ionic http://ionicframework.com - MIT License
788
+ */
789
+ const createLeaveAnimation = () => {
790
+ const backdropAnimation = createAnimation().fromTo('opacity', 'var(--backdrop-opacity)', 0);
791
+ const wrapperAnimation = createAnimation().keyframes([
792
+ { offset: 0, opacity: 0.99, transform: `translateY(0px)` },
793
+ { offset: 1, opacity: 0, transform: 'translateY(40px)' },
794
+ ]);
795
+ return { backdropAnimation, wrapperAnimation };
796
+ };
797
+ /**
798
+ * Md Modal Leave Animation
799
+ */
800
+ const mdLeaveAnimation = (baseEl, opts) => {
801
+ const { currentBreakpoint } = opts;
802
+ const root = getElementRoot(baseEl);
803
+ const { wrapperAnimation, backdropAnimation } = currentBreakpoint !== undefined ? createSheetLeaveAnimation(opts) : createLeaveAnimation();
804
+ backdropAnimation.addElement(root.querySelector('ion-backdrop'));
805
+ wrapperAnimation.addElement(root.querySelector('.modal-wrapper'));
806
+ return createAnimation()
807
+ .easing('cubic-bezier(0.47,0,0.745,0.715)')
808
+ .duration(200)
809
+ .addAnimation([backdropAnimation, wrapperAnimation]);
810
+ };
811
+
812
+ /*!
813
+ * (C) Ionic http://ionicframework.com - MIT License
814
+ */
815
+ const createSheetGesture = (baseEl, backdropEl, wrapperEl, initialBreakpoint, backdropBreakpoint, animation, breakpoints = [], getCurrentBreakpoint, onDismiss, onBreakpointChange) => {
816
+ // Defaults for the sheet swipe animation
817
+ const defaultBackdrop = [
818
+ { offset: 0, opacity: 'var(--backdrop-opacity)' },
819
+ { offset: 1, opacity: 0.01 },
820
+ ];
821
+ const customBackdrop = [
822
+ { offset: 0, opacity: 'var(--backdrop-opacity)' },
823
+ { offset: 1 - backdropBreakpoint, opacity: 0 },
824
+ { offset: 1, opacity: 0 },
825
+ ];
826
+ const SheetDefaults = {
827
+ WRAPPER_KEYFRAMES: [
828
+ { offset: 0, transform: 'translateY(0%)' },
829
+ { offset: 1, transform: 'translateY(100%)' },
830
+ ],
831
+ BACKDROP_KEYFRAMES: backdropBreakpoint !== 0 ? customBackdrop : defaultBackdrop,
832
+ };
833
+ const contentEl = baseEl.querySelector('ion-content');
834
+ const height = wrapperEl.clientHeight;
835
+ let currentBreakpoint = initialBreakpoint;
836
+ let offset = 0;
837
+ let canDismissBlocksGesture = false;
838
+ const canDismissMaxStep = 0.95;
839
+ const wrapperAnimation = animation.childAnimations.find((ani) => ani.id === 'wrapperAnimation');
840
+ const backdropAnimation = animation.childAnimations.find((ani) => ani.id === 'backdropAnimation');
841
+ const maxBreakpoint = breakpoints[breakpoints.length - 1];
842
+ const minBreakpoint = breakpoints[0];
843
+ const enableBackdrop = () => {
844
+ baseEl.style.setProperty('pointer-events', 'auto');
845
+ backdropEl.style.setProperty('pointer-events', 'auto');
846
+ /**
847
+ * When the backdrop is enabled, elements such
848
+ * as inputs should not be focusable outside
849
+ * the sheet.
850
+ */
851
+ baseEl.classList.remove('ion-disable-focus-trap');
852
+ };
853
+ const disableBackdrop = () => {
854
+ baseEl.style.setProperty('pointer-events', 'none');
855
+ backdropEl.style.setProperty('pointer-events', 'none');
856
+ /**
857
+ * When the backdrop is enabled, elements such
858
+ * as inputs should not be focusable outside
859
+ * the sheet.
860
+ * Adding this class disables focus trapping
861
+ * for the sheet temporarily.
862
+ */
863
+ baseEl.classList.add('ion-disable-focus-trap');
864
+ };
865
+ /**
866
+ * After the entering animation completes,
867
+ * we need to set the animation to go from
868
+ * offset 0 to offset 1 so that users can
869
+ * swipe in any direction. We then set the
870
+ * animation offset to the current breakpoint
871
+ * so there is no flickering.
872
+ */
873
+ if (wrapperAnimation && backdropAnimation) {
874
+ wrapperAnimation.keyframes([...SheetDefaults.WRAPPER_KEYFRAMES]);
875
+ backdropAnimation.keyframes([...SheetDefaults.BACKDROP_KEYFRAMES]);
876
+ animation.progressStart(true, 1 - currentBreakpoint);
877
+ /**
878
+ * If backdrop is not enabled, then content
879
+ * behind modal should be clickable. To do this, we need
880
+ * to remove pointer-events from ion-modal as a whole.
881
+ * ion-backdrop and .modal-wrapper always have pointer-events: auto
882
+ * applied, so the modal content can still be interacted with.
883
+ */
884
+ const shouldEnableBackdrop = currentBreakpoint > backdropBreakpoint;
885
+ if (shouldEnableBackdrop) {
886
+ enableBackdrop();
887
+ }
888
+ else {
889
+ disableBackdrop();
890
+ }
891
+ }
892
+ if (contentEl && currentBreakpoint !== maxBreakpoint) {
893
+ contentEl.scrollY = false;
894
+ }
895
+ const canStart = (detail) => {
896
+ /**
897
+ * If the sheet is fully expanded and
898
+ * the user is swiping on the content,
899
+ * the gesture should not start to
900
+ * allow for scrolling on the content.
901
+ */
902
+ const content = detail.event.target.closest('ion-content');
903
+ currentBreakpoint = getCurrentBreakpoint();
904
+ if (currentBreakpoint === 1 && content) {
905
+ return false;
906
+ }
907
+ return true;
908
+ };
909
+ const onStart = () => {
910
+ /**
911
+ * If canDismiss is anything other than `true`
912
+ * then users should be able to swipe down
913
+ * until a threshold is hit. At that point,
914
+ * the card modal should not proceed any further.
915
+ *
916
+ * canDismiss is never fired via gesture if there is
917
+ * no 0 breakpoint. However, it can be fired if the user
918
+ * presses Esc or the hardware back button.
919
+ * TODO (FW-937)
920
+ * Remove undefined check
921
+ */
922
+ canDismissBlocksGesture = baseEl.canDismiss !== undefined && baseEl.canDismiss !== true && minBreakpoint === 0;
923
+ /**
924
+ * If swiping on the content
925
+ * we should disable scrolling otherwise
926
+ * the sheet will expand and the content will scroll.
927
+ */
928
+ if (contentEl) {
929
+ contentEl.scrollY = false;
930
+ }
931
+ raf(() => {
932
+ /**
933
+ * Dismisses the open keyboard when the sheet drag gesture is started.
934
+ * Sets the focus onto the modal element.
935
+ */
936
+ baseEl.focus();
937
+ });
938
+ animation.progressStart(true, 1 - currentBreakpoint);
939
+ };
940
+ const onMove = (detail) => {
941
+ /**
942
+ * Given the change in gesture position on the Y axis,
943
+ * compute where the offset of the animation should be
944
+ * relative to where the user dragged.
945
+ */
946
+ const initialStep = 1 - currentBreakpoint;
947
+ const secondToLastBreakpoint = breakpoints.length > 1 ? 1 - breakpoints[1] : undefined;
948
+ const step = initialStep + detail.deltaY / height;
949
+ const isAttemptingDismissWithCanDismiss = secondToLastBreakpoint !== undefined && step >= secondToLastBreakpoint && canDismissBlocksGesture;
950
+ /**
951
+ * If we are blocking the gesture from dismissing,
952
+ * set the max step value so that the sheet cannot be
953
+ * completely hidden.
954
+ */
955
+ const maxStep = isAttemptingDismissWithCanDismiss ? canDismissMaxStep : 0.9999;
956
+ /**
957
+ * If we are blocking the gesture from
958
+ * dismissing, calculate the spring modifier value
959
+ * this will be added to the starting breakpoint
960
+ * value to give the gesture a spring-like feeling.
961
+ * Note that when isAttemptingDismissWithCanDismiss is true,
962
+ * the modifier is always added to the breakpoint that
963
+ * appears right after the 0 breakpoint.
964
+ *
965
+ * Note that this modifier is essentially the progression
966
+ * between secondToLastBreakpoint and maxStep which is
967
+ * why we subtract secondToLastBreakpoint. This lets us get
968
+ * the result as a value from 0 to 1.
969
+ */
970
+ const processedStep = isAttemptingDismissWithCanDismiss && secondToLastBreakpoint !== undefined
971
+ ? secondToLastBreakpoint +
972
+ calculateSpringStep((step - secondToLastBreakpoint) / (maxStep - secondToLastBreakpoint))
973
+ : step;
974
+ offset = clamp(0.0001, processedStep, maxStep);
975
+ animation.progressStep(offset);
976
+ };
977
+ const onEnd = (detail) => {
978
+ /**
979
+ * When the gesture releases, we need to determine
980
+ * the closest breakpoint to snap to.
981
+ */
982
+ const velocity = detail.velocityY;
983
+ const threshold = (detail.deltaY + velocity * 350) / height;
984
+ const diff = currentBreakpoint - threshold;
985
+ const closest = breakpoints.reduce((a, b) => {
986
+ return Math.abs(b - diff) < Math.abs(a - diff) ? b : a;
987
+ });
988
+ moveSheetToBreakpoint({
989
+ breakpoint: closest,
990
+ breakpointOffset: offset,
991
+ canDismiss: canDismissBlocksGesture,
992
+ });
993
+ };
994
+ const moveSheetToBreakpoint = (options) => {
995
+ const { breakpoint, canDismiss, breakpointOffset } = options;
996
+ /**
997
+ * canDismiss should only prevent snapping
998
+ * when users are trying to dismiss. If canDismiss
999
+ * is present but the user is trying to swipe upwards,
1000
+ * we should allow that to happen,
1001
+ */
1002
+ const shouldPreventDismiss = canDismiss && breakpoint === 0;
1003
+ const snapToBreakpoint = shouldPreventDismiss ? currentBreakpoint : breakpoint;
1004
+ const shouldRemainOpen = snapToBreakpoint !== 0;
1005
+ currentBreakpoint = 0;
1006
+ /**
1007
+ * Update the animation so that it plays from
1008
+ * the last offset to the closest snap point.
1009
+ */
1010
+ if (wrapperAnimation && backdropAnimation) {
1011
+ wrapperAnimation.keyframes([
1012
+ { offset: 0, transform: `translateY(${breakpointOffset * 100}%)` },
1013
+ { offset: 1, transform: `translateY(${(1 - snapToBreakpoint) * 100}%)` },
1014
+ ]);
1015
+ backdropAnimation.keyframes([
1016
+ {
1017
+ offset: 0,
1018
+ opacity: `calc(var(--backdrop-opacity) * ${getBackdropValueForSheet(1 - breakpointOffset, backdropBreakpoint)})`,
1019
+ },
1020
+ {
1021
+ offset: 1,
1022
+ opacity: `calc(var(--backdrop-opacity) * ${getBackdropValueForSheet(snapToBreakpoint, backdropBreakpoint)})`,
1023
+ },
1024
+ ]);
1025
+ animation.progressStep(0);
1026
+ }
1027
+ /**
1028
+ * Gesture should remain disabled until the
1029
+ * snapping animation completes.
1030
+ */
1031
+ gesture.enable(false);
1032
+ if (shouldPreventDismiss) {
1033
+ handleCanDismiss(baseEl, animation);
1034
+ }
1035
+ else if (!shouldRemainOpen) {
1036
+ onDismiss();
1037
+ }
1038
+ return new Promise((resolve) => {
1039
+ animation
1040
+ .onFinish(() => {
1041
+ if (shouldRemainOpen) {
1042
+ /**
1043
+ * Once the snapping animation completes,
1044
+ * we need to reset the animation to go
1045
+ * from 0 to 1 so users can swipe in any direction.
1046
+ * We then set the animation offset to the current
1047
+ * breakpoint so that it starts at the snapped position.
1048
+ */
1049
+ if (wrapperAnimation && backdropAnimation) {
1050
+ raf(() => {
1051
+ wrapperAnimation.keyframes([...SheetDefaults.WRAPPER_KEYFRAMES]);
1052
+ backdropAnimation.keyframes([...SheetDefaults.BACKDROP_KEYFRAMES]);
1053
+ animation.progressStart(true, 1 - snapToBreakpoint);
1054
+ currentBreakpoint = snapToBreakpoint;
1055
+ onBreakpointChange(currentBreakpoint);
1056
+ /**
1057
+ * If the sheet is fully expanded, we can safely
1058
+ * enable scrolling again.
1059
+ */
1060
+ if (contentEl && currentBreakpoint === breakpoints[breakpoints.length - 1]) {
1061
+ contentEl.scrollY = true;
1062
+ }
1063
+ /**
1064
+ * Backdrop should become enabled
1065
+ * after the backdropBreakpoint value
1066
+ */
1067
+ const shouldEnableBackdrop = currentBreakpoint > backdropBreakpoint;
1068
+ if (shouldEnableBackdrop) {
1069
+ enableBackdrop();
1070
+ }
1071
+ else {
1072
+ disableBackdrop();
1073
+ }
1074
+ gesture.enable(true);
1075
+ resolve();
1076
+ });
1077
+ }
1078
+ else {
1079
+ gesture.enable(true);
1080
+ resolve();
1081
+ }
1082
+ }
1083
+ else {
1084
+ resolve();
1085
+ }
1086
+ /**
1087
+ * This must be a one time callback
1088
+ * otherwise a new callback will
1089
+ * be added every time onEnd runs.
1090
+ */
1091
+ }, { oneTimeCallback: true })
1092
+ .progressEnd(1, 0, 500);
1093
+ });
1094
+ };
1095
+ const gesture = createGesture({
1096
+ el: wrapperEl,
1097
+ gestureName: 'modalSheet',
1098
+ gesturePriority: 40,
1099
+ direction: 'y',
1100
+ threshold: 10,
1101
+ canStart,
1102
+ onStart,
1103
+ onMove,
1104
+ onEnd,
1105
+ });
1106
+ return {
1107
+ gesture,
1108
+ moveSheetToBreakpoint,
1109
+ };
1110
+ };
1111
+
1112
+ const modalIosCss = ":host{--width:100%;--min-width:auto;--max-width:auto;--height:100%;--min-height:auto;--max-height:auto;--overflow:hidden;--border-radius:0;--border-width:0;--border-style:none;--border-color:transparent;--background:var(--ion-background-color, #fff);--box-shadow:none;--backdrop-opacity:0;left:0;right:0;top:0;bottom:0;display:flex;position:absolute;align-items:center;justify-content:center;outline:none;contain:strict}.modal-wrapper,ion-backdrop{pointer-events:auto}:host(.overlay-hidden){display:none}.modal-wrapper,.modal-shadow{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);box-shadow:var(--box-shadow);overflow:var(--overflow);z-index:10}.modal-shadow{position:absolute;background:transparent}@media only screen and (min-width: 768px) and (min-height: 600px){:host{--width:600px;--height:500px;--ion-safe-area-top:0px;--ion-safe-area-bottom:0px;--ion-safe-area-right:0px;--ion-safe-area-left:0px}}@media only screen and (min-width: 768px) and (min-height: 768px){:host{--width:600px;--height:600px}}.modal-handle{left:0px;right:0px;top:5px;border-radius:8px;margin-left:auto;margin-right:auto;position:absolute;width:36px;height:5px;transform:translateZ(0);border:0;background:var(--ion-color-step-350, #c0c0be);cursor:pointer;z-index:11}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){.modal-handle{margin-left:unset;margin-right:unset;-webkit-margin-start:auto;margin-inline-start:auto;-webkit-margin-end:auto;margin-inline-end:auto}}.modal-handle::before{padding-left:4px;padding-right:4px;padding-top:4px;padding-bottom:4px;position:absolute;width:36px;height:5px;transform:translate(-50%, -50%);content:\"\"}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){.modal-handle::before{padding-left:unset;padding-right:unset;-webkit-padding-start:4px;padding-inline-start:4px;-webkit-padding-end:4px;padding-inline-end:4px}}:host(.modal-sheet){--height:calc(100% - (var(--ion-safe-area-top) + 10px))}:host(.modal-sheet) .modal-wrapper,:host(.modal-sheet) .modal-shadow{position:absolute;bottom:0}:host{--backdrop-opacity:var(--ion-backdrop-opacity, 0.4)}:host(.modal-card),:host(.modal-sheet){--border-radius:10px}@media only screen and (min-width: 768px) and (min-height: 600px){:host{--border-radius:10px}}.modal-wrapper{transform:translate3d(0, 100%, 0)}@media screen and (max-width: 767px){@supports (width: 1px){:host(.modal-card){--height:calc(100% - max(30px, var(--ion-safe-area-top)) - 10px)}}@supports not (width: 1px){:host(.modal-card){--height:calc(100% - 40px)}}:host(.modal-card) .modal-wrapper{border-top-left-radius:var(--border-radius);border-top-right-radius:var(--border-radius);border-bottom-right-radius:0;border-bottom-left-radius:0}:host-context([dir=rtl]):host(.modal-card) .modal-wrapper,:host-context([dir=rtl]).modal-card .modal-wrapper{border-top-left-radius:var(--border-radius);border-top-right-radius:var(--border-radius);border-bottom-right-radius:0;border-bottom-left-radius:0}:host(.modal-card){--backdrop-opacity:0;--width:100%;align-items:flex-end}:host(.modal-card) .modal-shadow{display:none}:host(.modal-card) ion-backdrop{pointer-events:none}}@media screen and (min-width: 768px){:host(.modal-card){--width:calc(100% - 120px);--height:calc(100% - (120px + var(--ion-safe-area-top) + var(--ion-safe-area-bottom)));--max-width:720px;--max-height:1000px;--backdrop-opacity:0;--box-shadow:0px 0px 30px 10px rgba(0, 0, 0, 0.1);transition:all 0.5s ease-in-out}:host(.modal-card) .modal-wrapper{box-shadow:none}:host(.modal-card) .modal-shadow{box-shadow:var(--box-shadow)}}:host(.modal-sheet) .modal-wrapper{border-top-left-radius:var(--border-radius);border-top-right-radius:var(--border-radius);border-bottom-right-radius:0;border-bottom-left-radius:0}:host-context([dir=rtl]):host(.modal-sheet) .modal-wrapper,:host-context([dir=rtl]).modal-sheet .modal-wrapper{border-top-left-radius:var(--border-radius);border-top-right-radius:var(--border-radius);border-bottom-right-radius:0;border-bottom-left-radius:0}";
1113
+
1114
+ const modalMdCss = ":host{--width:100%;--min-width:auto;--max-width:auto;--height:100%;--min-height:auto;--max-height:auto;--overflow:hidden;--border-radius:0;--border-width:0;--border-style:none;--border-color:transparent;--background:var(--ion-background-color, #fff);--box-shadow:none;--backdrop-opacity:0;left:0;right:0;top:0;bottom:0;display:flex;position:absolute;align-items:center;justify-content:center;outline:none;contain:strict}.modal-wrapper,ion-backdrop{pointer-events:auto}:host(.overlay-hidden){display:none}.modal-wrapper,.modal-shadow{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);box-shadow:var(--box-shadow);overflow:var(--overflow);z-index:10}.modal-shadow{position:absolute;background:transparent}@media only screen and (min-width: 768px) and (min-height: 600px){:host{--width:600px;--height:500px;--ion-safe-area-top:0px;--ion-safe-area-bottom:0px;--ion-safe-area-right:0px;--ion-safe-area-left:0px}}@media only screen and (min-width: 768px) and (min-height: 768px){:host{--width:600px;--height:600px}}.modal-handle{left:0px;right:0px;top:5px;border-radius:8px;margin-left:auto;margin-right:auto;position:absolute;width:36px;height:5px;transform:translateZ(0);border:0;background:var(--ion-color-step-350, #c0c0be);cursor:pointer;z-index:11}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){.modal-handle{margin-left:unset;margin-right:unset;-webkit-margin-start:auto;margin-inline-start:auto;-webkit-margin-end:auto;margin-inline-end:auto}}.modal-handle::before{padding-left:4px;padding-right:4px;padding-top:4px;padding-bottom:4px;position:absolute;width:36px;height:5px;transform:translate(-50%, -50%);content:\"\"}@supports (margin-inline-start: 0) or (-webkit-margin-start: 0){.modal-handle::before{padding-left:unset;padding-right:unset;-webkit-padding-start:4px;padding-inline-start:4px;-webkit-padding-end:4px;padding-inline-end:4px}}:host(.modal-sheet){--height:calc(100% - (var(--ion-safe-area-top) + 10px))}:host(.modal-sheet) .modal-wrapper,:host(.modal-sheet) .modal-shadow{position:absolute;bottom:0}:host{--backdrop-opacity:var(--ion-backdrop-opacity, 0.32)}@media only screen and (min-width: 768px) and (min-height: 600px){:host{--border-radius:2px;--box-shadow:0 28px 48px rgba(0, 0, 0, 0.4)}}.modal-wrapper{transform:translate3d(0, 40px, 0);opacity:0.01}";
1115
+
1116
+ const Modal = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
1117
+ constructor() {
1118
+ super();
1119
+ this.__registerHost();
1120
+ this.__attachShadow();
1121
+ this.didPresent = createEvent(this, "ionModalDidPresent", 7);
1122
+ this.willPresent = createEvent(this, "ionModalWillPresent", 7);
1123
+ this.willDismiss = createEvent(this, "ionModalWillDismiss", 7);
1124
+ this.didDismiss = createEvent(this, "ionModalDidDismiss", 7);
1125
+ this.ionBreakpointDidChange = createEvent(this, "ionBreakpointDidChange", 7);
1126
+ this.didPresentShorthand = createEvent(this, "didPresent", 7);
1127
+ this.willPresentShorthand = createEvent(this, "willPresent", 7);
1128
+ this.willDismissShorthand = createEvent(this, "willDismiss", 7);
1129
+ this.didDismissShorthand = createEvent(this, "didDismiss", 7);
1130
+ this.modalIndex = modalIds++;
1131
+ this.coreDelegate = CoreDelegate();
1132
+ this.isSheetModal = false;
1133
+ this.inheritedAttributes = {};
1134
+ this.inline = false;
1135
+ // Whether or not modal is being dismissed via gesture
1136
+ this.gestureAnimationDismissing = false;
1137
+ this.presented = false;
1138
+ /** @internal */
1139
+ this.hasController = false;
1140
+ /**
1141
+ * If `true`, the keyboard will be automatically dismissed when the overlay is presented.
1142
+ */
1143
+ this.keyboardClose = true;
1144
+ /**
1145
+ * A decimal value between 0 and 1 that indicates the
1146
+ * point after which the backdrop will begin to fade in
1147
+ * when using a sheet modal. Prior to this point, the
1148
+ * backdrop will be hidden and the content underneath
1149
+ * the sheet can be interacted with. This value is exclusive
1150
+ * meaning the backdrop will become active after the value
1151
+ * specified.
1152
+ */
1153
+ this.backdropBreakpoint = 0;
1154
+ /**
1155
+ * The interaction behavior for the sheet modal when the handle is pressed.
1156
+ *
1157
+ * Defaults to `"none"`, which means the modal will not change size or position when the handle is pressed.
1158
+ * Set to `"cycle"` to let the modal cycle between available breakpoints when pressed.
1159
+ *
1160
+ * Handle behavior is unavailable when the `handle` property is set to `false` or
1161
+ * when the `breakpoints` property is not set (using a fullscreen or card modal).
1162
+ */
1163
+ this.handleBehavior = 'none';
1164
+ /**
1165
+ * If `true`, the modal will be dismissed when the backdrop is clicked.
1166
+ */
1167
+ this.backdropDismiss = true;
1168
+ /**
1169
+ * If `true`, a backdrop will be displayed behind the modal.
1170
+ * This property controls whether or not the backdrop
1171
+ * darkens the screen when the modal is presented.
1172
+ * It does not control whether or not the backdrop
1173
+ * is active or present in the DOM.
1174
+ */
1175
+ this.showBackdrop = true;
1176
+ /**
1177
+ * If `true`, the modal will animate.
1178
+ */
1179
+ this.animated = true;
1180
+ /**
1181
+ * If `true`, the modal can be swiped to dismiss. Only applies in iOS mode.
1182
+ * @deprecated - To prevent modals from dismissing, use canDismiss instead.
1183
+ */
1184
+ this.swipeToClose = false;
1185
+ /**
1186
+ * If `true`, the modal will open. If `false`, the modal will close.
1187
+ * Use this if you need finer grained control over presentation, otherwise
1188
+ * just use the modalController or the `trigger` property.
1189
+ * Note: `isOpen` will not automatically be set back to `false` when
1190
+ * the modal dismisses. You will need to do that in your code.
1191
+ */
1192
+ this.isOpen = false;
1193
+ /**
1194
+ * If `true`, the component passed into `ion-modal` will
1195
+ * automatically be mounted when the modal is created. The
1196
+ * component will remain mounted even when the modal is dismissed.
1197
+ * However, the component will be destroyed when the modal is
1198
+ * destroyed. This property is not reactive and should only be
1199
+ * used when initially creating a modal.
1200
+ *
1201
+ * Note: This feature only applies to inline modals in JavaScript
1202
+ * frameworks such as Angular, React, and Vue.
1203
+ */
1204
+ this.keepContentsMounted = false;
1205
+ this.configureTriggerInteraction = () => {
1206
+ const { trigger, el, destroyTriggerInteraction } = this;
1207
+ if (destroyTriggerInteraction) {
1208
+ destroyTriggerInteraction();
1209
+ }
1210
+ const triggerEl = trigger !== undefined ? document.getElementById(trigger) : null;
1211
+ if (!triggerEl) {
1212
+ return;
1213
+ }
1214
+ const configureTriggerInteraction = (trigEl, modalEl) => {
1215
+ const openModal = () => {
1216
+ modalEl.present();
1217
+ };
1218
+ trigEl.addEventListener('click', openModal);
1219
+ return () => {
1220
+ trigEl.removeEventListener('click', openModal);
1221
+ };
1222
+ };
1223
+ this.destroyTriggerInteraction = configureTriggerInteraction(triggerEl, el);
1224
+ };
1225
+ this.onHandleClick = () => {
1226
+ const { sheetTransition, handleBehavior } = this;
1227
+ if (handleBehavior !== 'cycle' || sheetTransition !== undefined) {
1228
+ /**
1229
+ * The sheet modal should not advance to the next breakpoint
1230
+ * if the handle behavior is not `cycle` or if the handle
1231
+ * is clicked while the sheet is moving to a breakpoint.
1232
+ */
1233
+ return;
1234
+ }
1235
+ this.moveToNextBreakpoint();
1236
+ };
1237
+ this.onBackdropTap = () => {
1238
+ const { sheetTransition } = this;
1239
+ if (sheetTransition !== undefined) {
1240
+ /**
1241
+ * When the handle is double clicked at the largest breakpoint,
1242
+ * it will start to move to the first breakpoint. While transitioning,
1243
+ * the backdrop will often receive the second click. We prevent the
1244
+ * backdrop from dismissing the modal while moving between breakpoints.
1245
+ */
1246
+ return;
1247
+ }
1248
+ this.dismiss(undefined, BACKDROP);
1249
+ };
1250
+ this.onLifecycle = (modalEvent) => {
1251
+ const el = this.usersElement;
1252
+ const name = LIFECYCLE_MAP[modalEvent.type];
1253
+ if (el && name) {
1254
+ const ev = new CustomEvent(name, {
1255
+ bubbles: false,
1256
+ cancelable: false,
1257
+ detail: modalEvent.detail,
1258
+ });
1259
+ el.dispatchEvent(ev);
1260
+ }
1261
+ };
1262
+ }
1263
+ onIsOpenChange(newValue, oldValue) {
1264
+ if (newValue === true && oldValue === false) {
1265
+ this.present();
1266
+ }
1267
+ else if (newValue === false && oldValue === true) {
1268
+ this.dismiss();
1269
+ }
1270
+ }
1271
+ onTriggerChange() {
1272
+ this.configureTriggerInteraction();
1273
+ }
1274
+ async swipeToCloseChanged(enable) {
1275
+ if (this.gesture) {
1276
+ this.gesture.enable(enable);
1277
+ }
1278
+ else if (enable) {
1279
+ await this.initSwipeToClose();
1280
+ }
1281
+ }
1282
+ breakpointsChanged(breakpoints) {
1283
+ if (breakpoints !== undefined) {
1284
+ this.sortedBreakpoints = breakpoints.sort((a, b) => a - b);
1285
+ }
1286
+ }
1287
+ connectedCallback() {
1288
+ const { configureTriggerInteraction, el } = this;
1289
+ prepareOverlay(el);
1290
+ configureTriggerInteraction();
1291
+ }
1292
+ disconnectedCallback() {
1293
+ const { destroyTriggerInteraction } = this;
1294
+ if (destroyTriggerInteraction) {
1295
+ destroyTriggerInteraction();
1296
+ }
1297
+ }
1298
+ componentWillLoad() {
1299
+ const { breakpoints, initialBreakpoint, swipeToClose, el } = this;
1300
+ this.inheritedAttributes = inheritAttributes(el, ['aria-label', 'role']);
1301
+ /**
1302
+ * If user has custom ID set then we should
1303
+ * not assign the default incrementing ID.
1304
+ */
1305
+ this.modalId = this.el.hasAttribute('id') ? this.el.getAttribute('id') : `ion-modal-${this.modalIndex}`;
1306
+ const isSheetModal = (this.isSheetModal = breakpoints !== undefined && initialBreakpoint !== undefined);
1307
+ if (isSheetModal) {
1308
+ this.currentBreakpoint = this.initialBreakpoint;
1309
+ }
1310
+ if (breakpoints !== undefined && initialBreakpoint !== undefined && !breakpoints.includes(initialBreakpoint)) {
1311
+ printIonWarning('Your breakpoints array must include the initialBreakpoint value.');
1312
+ }
1313
+ if (swipeToClose) {
1314
+ printIonWarning('swipeToClose has been deprecated in favor of canDismiss.\n\nIf you want a card modal to be swipeable, set canDismiss to `true`. In the next major release of Ionic, swipeToClose will be removed, and all card modals will be swipeable by default.');
1315
+ }
1316
+ }
1317
+ componentDidLoad() {
1318
+ /**
1319
+ * If modal was rendered with isOpen="true"
1320
+ * then we should open modal immediately.
1321
+ */
1322
+ if (this.isOpen === true) {
1323
+ raf(() => this.present());
1324
+ }
1325
+ this.breakpointsChanged(this.breakpoints);
1326
+ }
1327
+ /**
1328
+ * Determines whether or not an overlay
1329
+ * is being used inline or via a controller/JS
1330
+ * and returns the correct delegate.
1331
+ * By default, subsequent calls to getDelegate
1332
+ * will use a cached version of the delegate.
1333
+ * This is useful for calling dismiss after
1334
+ * present so that the correct delegate is given.
1335
+ */
1336
+ getDelegate(force = false) {
1337
+ if (this.workingDelegate && !force) {
1338
+ return {
1339
+ delegate: this.workingDelegate,
1340
+ inline: this.inline,
1341
+ };
1342
+ }
1343
+ /**
1344
+ * If using overlay inline
1345
+ * we potentially need to use the coreDelegate
1346
+ * so that this works in vanilla JS apps.
1347
+ * If a developer has presented this component
1348
+ * via a controller, then we can assume
1349
+ * the component is already in the
1350
+ * correct place.
1351
+ */
1352
+ const parentEl = this.el.parentNode;
1353
+ const inline = (this.inline = parentEl !== null && !this.hasController);
1354
+ const delegate = (this.workingDelegate = inline ? this.delegate || this.coreDelegate : this.delegate);
1355
+ return { inline, delegate };
1356
+ }
1357
+ /**
1358
+ * Determines whether or not the
1359
+ * modal is allowed to dismiss based
1360
+ * on the state of the canDismiss prop.
1361
+ */
1362
+ async checkCanDismiss(data, role) {
1363
+ const { canDismiss } = this;
1364
+ /**
1365
+ * TODO (FW-937) - Remove the following check in
1366
+ * the next major release of Ionic.
1367
+ */
1368
+ if (canDismiss === undefined) {
1369
+ return true;
1370
+ }
1371
+ if (typeof canDismiss === 'function') {
1372
+ return canDismiss(data, role);
1373
+ }
1374
+ return canDismiss;
1375
+ }
1376
+ /**
1377
+ * Present the modal overlay after it has been created.
1378
+ */
1379
+ async present() {
1380
+ if (this.presented) {
1381
+ return;
1382
+ }
1383
+ /**
1384
+ * When using an inline modal
1385
+ * and dismissing a modal it is possible to
1386
+ * quickly present the modal while it is
1387
+ * dismissing. We need to await any current
1388
+ * transition to allow the dismiss to finish
1389
+ * before presenting again.
1390
+ */
1391
+ if (this.currentTransition !== undefined) {
1392
+ await this.currentTransition;
1393
+ }
1394
+ /**
1395
+ * If the modal is presented multiple times (inline modals), we
1396
+ * need to reset the current breakpoint to the initial breakpoint.
1397
+ */
1398
+ this.currentBreakpoint = this.initialBreakpoint;
1399
+ const data = Object.assign(Object.assign({}, this.componentProps), { modal: this.el });
1400
+ const { inline, delegate } = this.getDelegate(true);
1401
+ this.usersElement = await attachComponent(delegate, this.el, this.component, ['ion-page'], data, inline);
1402
+ await deepReady(this.usersElement);
1403
+ writeTask(() => this.el.classList.add('show-modal'));
1404
+ this.currentTransition = present(this, 'modalEnter', iosEnterAnimation, mdEnterAnimation, {
1405
+ presentingEl: this.presentingElement,
1406
+ currentBreakpoint: this.initialBreakpoint,
1407
+ backdropBreakpoint: this.backdropBreakpoint,
1408
+ });
1409
+ /**
1410
+ * TODO (FW-937) - In the next major release of Ionic, all card modals
1411
+ * will be swipeable by default. canDismiss will be used to determine if the
1412
+ * modal can be dismissed. This check should change to check the presence of
1413
+ * presentingElement instead.
1414
+ *
1415
+ * If we did not do this check, then not using swipeToClose would mean you could
1416
+ * not run canDismiss on swipe as there would be no swipe gesture created.
1417
+ */
1418
+ const hasCardModal = this.presentingElement !== undefined && (this.swipeToClose || this.canDismiss !== undefined);
1419
+ /**
1420
+ * We need to change the status bar at the
1421
+ * start of the animation so that it completes
1422
+ * by the time the card animation is done.
1423
+ */
1424
+ if (hasCardModal && getIonMode(this) === 'ios') {
1425
+ // Cache the original status bar color before the modal is presented
1426
+ this.statusBarStyle = await StatusBar.getStyle();
1427
+ setCardStatusBarDark();
1428
+ }
1429
+ await this.currentTransition;
1430
+ if (this.isSheetModal) {
1431
+ this.initSheetGesture();
1432
+ }
1433
+ else if (hasCardModal) {
1434
+ await this.initSwipeToClose();
1435
+ }
1436
+ /* tslint:disable-next-line */
1437
+ if (typeof window !== 'undefined') {
1438
+ this.keyboardOpenCallback = () => {
1439
+ if (this.gesture) {
1440
+ /**
1441
+ * When the native keyboard is opened and the webview
1442
+ * is resized, the gesture implementation will become unresponsive
1443
+ * and enter a free-scroll mode.
1444
+ *
1445
+ * When the keyboard is opened, we disable the gesture for
1446
+ * a single frame and re-enable once the contents have repositioned
1447
+ * from the keyboard placement.
1448
+ */
1449
+ this.gesture.enable(false);
1450
+ raf(() => {
1451
+ if (this.gesture) {
1452
+ this.gesture.enable(true);
1453
+ }
1454
+ });
1455
+ }
1456
+ };
1457
+ window.addEventListener(KEYBOARD_DID_OPEN, this.keyboardOpenCallback);
1458
+ }
1459
+ this.currentTransition = undefined;
1460
+ }
1461
+ initSwipeToClose() {
1462
+ var _a;
1463
+ if (getIonMode(this) !== 'ios') {
1464
+ return;
1465
+ }
1466
+ const { el } = this;
1467
+ // All of the elements needed for the swipe gesture
1468
+ // should be in the DOM and referenced by now, except
1469
+ // for the presenting el
1470
+ const animationBuilder = this.leaveAnimation || config.get('modalLeave', iosLeaveAnimation);
1471
+ const ani = (this.animation = animationBuilder(el, { presentingEl: this.presentingElement }));
1472
+ const contentEl = findIonContent(el);
1473
+ if (!contentEl) {
1474
+ printIonContentErrorMsg(el);
1475
+ return;
1476
+ }
1477
+ const statusBarStyle = (_a = this.statusBarStyle) !== null && _a !== void 0 ? _a : Style.Default;
1478
+ this.gesture = createSwipeToCloseGesture(el, ani, statusBarStyle, () => {
1479
+ /**
1480
+ * While the gesture animation is finishing
1481
+ * it is possible for a user to tap the backdrop.
1482
+ * This would result in the dismiss animation
1483
+ * being played again. Typically this is avoided
1484
+ * by setting `presented = false` on the overlay
1485
+ * component; however, we cannot do that here as
1486
+ * that would prevent the element from being
1487
+ * removed from the DOM.
1488
+ */
1489
+ this.gestureAnimationDismissing = true;
1490
+ this.animation.onFinish(async () => {
1491
+ await this.dismiss(undefined, GESTURE);
1492
+ this.gestureAnimationDismissing = false;
1493
+ });
1494
+ });
1495
+ this.gesture.enable(true);
1496
+ }
1497
+ initSheetGesture() {
1498
+ const { wrapperEl, initialBreakpoint, backdropBreakpoint } = this;
1499
+ if (!wrapperEl || initialBreakpoint === undefined) {
1500
+ return;
1501
+ }
1502
+ const animationBuilder = this.enterAnimation || config.get('modalEnter', iosEnterAnimation);
1503
+ const ani = (this.animation = animationBuilder(this.el, {
1504
+ presentingEl: this.presentingElement,
1505
+ currentBreakpoint: initialBreakpoint,
1506
+ backdropBreakpoint,
1507
+ }));
1508
+ ani.progressStart(true, 1);
1509
+ const { gesture, moveSheetToBreakpoint } = createSheetGesture(this.el, this.backdropEl, wrapperEl, initialBreakpoint, backdropBreakpoint, ani, this.sortedBreakpoints, () => { var _a; return (_a = this.currentBreakpoint) !== null && _a !== void 0 ? _a : 0; }, () => this.sheetOnDismiss(), (breakpoint) => {
1510
+ if (this.currentBreakpoint !== breakpoint) {
1511
+ this.currentBreakpoint = breakpoint;
1512
+ this.ionBreakpointDidChange.emit({ breakpoint });
1513
+ }
1514
+ });
1515
+ this.gesture = gesture;
1516
+ this.moveSheetToBreakpoint = moveSheetToBreakpoint;
1517
+ this.gesture.enable(true);
1518
+ }
1519
+ sheetOnDismiss() {
1520
+ /**
1521
+ * While the gesture animation is finishing
1522
+ * it is possible for a user to tap the backdrop.
1523
+ * This would result in the dismiss animation
1524
+ * being played again. Typically this is avoided
1525
+ * by setting `presented = false` on the overlay
1526
+ * component; however, we cannot do that here as
1527
+ * that would prevent the element from being
1528
+ * removed from the DOM.
1529
+ */
1530
+ this.gestureAnimationDismissing = true;
1531
+ this.animation.onFinish(async () => {
1532
+ this.currentBreakpoint = 0;
1533
+ this.ionBreakpointDidChange.emit({ breakpoint: this.currentBreakpoint });
1534
+ await this.dismiss(undefined, GESTURE);
1535
+ this.gestureAnimationDismissing = false;
1536
+ });
1537
+ }
1538
+ /**
1539
+ * Dismiss the modal overlay after it has been presented.
1540
+ *
1541
+ * @param data Any data to emit in the dismiss events.
1542
+ * @param role The role of the element that is dismissing the modal. For example, 'cancel' or 'backdrop'.
1543
+ */
1544
+ async dismiss(data, role) {
1545
+ var _a;
1546
+ if (this.gestureAnimationDismissing && role !== GESTURE) {
1547
+ return false;
1548
+ }
1549
+ /**
1550
+ * If a canDismiss handler is responsible
1551
+ * for calling the dismiss method, we should
1552
+ * not run the canDismiss check again.
1553
+ */
1554
+ if (role !== 'handler' && !(await this.checkCanDismiss(data, role))) {
1555
+ return false;
1556
+ }
1557
+ /**
1558
+ * We need to start the status bar change
1559
+ * before the animation so that the change
1560
+ * finishes when the dismiss animation does.
1561
+ * TODO (FW-937)
1562
+ */
1563
+ const hasCardModal = this.presentingElement !== undefined && (this.swipeToClose || this.canDismiss !== undefined);
1564
+ if (hasCardModal && getIonMode(this) === 'ios') {
1565
+ setCardStatusBarDefault(this.statusBarStyle);
1566
+ }
1567
+ /* tslint:disable-next-line */
1568
+ if (typeof window !== 'undefined' && this.keyboardOpenCallback) {
1569
+ window.removeEventListener(KEYBOARD_DID_OPEN, this.keyboardOpenCallback);
1570
+ }
1571
+ /**
1572
+ * When using an inline modal
1573
+ * and presenting a modal it is possible to
1574
+ * quickly dismiss the modal while it is
1575
+ * presenting. We need to await any current
1576
+ * transition to allow the present to finish
1577
+ * before dismissing again.
1578
+ */
1579
+ if (this.currentTransition !== undefined) {
1580
+ await this.currentTransition;
1581
+ }
1582
+ const enteringAnimation = activeAnimations.get(this) || [];
1583
+ this.currentTransition = dismiss(this, data, role, 'modalLeave', iosLeaveAnimation, mdLeaveAnimation, {
1584
+ presentingEl: this.presentingElement,
1585
+ currentBreakpoint: (_a = this.currentBreakpoint) !== null && _a !== void 0 ? _a : this.initialBreakpoint,
1586
+ backdropBreakpoint: this.backdropBreakpoint,
1587
+ });
1588
+ const dismissed = await this.currentTransition;
1589
+ if (dismissed) {
1590
+ const { delegate } = this.getDelegate();
1591
+ await detachComponent(delegate, this.usersElement);
1592
+ writeTask(() => this.el.classList.remove('show-modal'));
1593
+ if (this.animation) {
1594
+ this.animation.destroy();
1595
+ }
1596
+ if (this.gesture) {
1597
+ this.gesture.destroy();
1598
+ }
1599
+ enteringAnimation.forEach((ani) => ani.destroy());
1600
+ }
1601
+ this.currentBreakpoint = undefined;
1602
+ this.currentTransition = undefined;
1603
+ this.animation = undefined;
1604
+ return dismissed;
1605
+ }
1606
+ /**
1607
+ * Returns a promise that resolves when the modal did dismiss.
1608
+ */
1609
+ onDidDismiss() {
1610
+ return eventMethod(this.el, 'ionModalDidDismiss');
1611
+ }
1612
+ /**
1613
+ * Returns a promise that resolves when the modal will dismiss.
1614
+ */
1615
+ onWillDismiss() {
1616
+ return eventMethod(this.el, 'ionModalWillDismiss');
1617
+ }
1618
+ /**
1619
+ * Move a sheet style modal to a specific breakpoint. The breakpoint value must
1620
+ * be a value defined in your `breakpoints` array.
1621
+ */
1622
+ async setCurrentBreakpoint(breakpoint) {
1623
+ if (!this.isSheetModal) {
1624
+ printIonWarning('setCurrentBreakpoint is only supported on sheet modals.');
1625
+ return;
1626
+ }
1627
+ if (!this.breakpoints.includes(breakpoint)) {
1628
+ printIonWarning(`Attempted to set invalid breakpoint value ${breakpoint}. Please double check that the breakpoint value is part of your defined breakpoints.`);
1629
+ return;
1630
+ }
1631
+ const { currentBreakpoint, moveSheetToBreakpoint, canDismiss, breakpoints } = this;
1632
+ if (currentBreakpoint === breakpoint) {
1633
+ return;
1634
+ }
1635
+ if (moveSheetToBreakpoint) {
1636
+ this.sheetTransition = moveSheetToBreakpoint({
1637
+ breakpoint,
1638
+ breakpointOffset: 1 - currentBreakpoint,
1639
+ canDismiss: canDismiss !== undefined && canDismiss !== true && breakpoints[0] === 0,
1640
+ });
1641
+ await this.sheetTransition;
1642
+ this.sheetTransition = undefined;
1643
+ }
1644
+ }
1645
+ /**
1646
+ * Returns the current breakpoint of a sheet style modal
1647
+ */
1648
+ async getCurrentBreakpoint() {
1649
+ return this.currentBreakpoint;
1650
+ }
1651
+ async moveToNextBreakpoint() {
1652
+ const { breakpoints, currentBreakpoint } = this;
1653
+ if (!breakpoints || currentBreakpoint == null) {
1654
+ /**
1655
+ * If the modal does not have breakpoints and/or the current
1656
+ * breakpoint is not set, we can't move to the next breakpoint.
1657
+ */
1658
+ return false;
1659
+ }
1660
+ const allowedBreakpoints = breakpoints.filter((b) => b !== 0);
1661
+ const currentBreakpointIndex = allowedBreakpoints.indexOf(currentBreakpoint);
1662
+ const nextBreakpointIndex = (currentBreakpointIndex + 1) % allowedBreakpoints.length;
1663
+ const nextBreakpoint = allowedBreakpoints[nextBreakpointIndex];
1664
+ /**
1665
+ * Sets the current breakpoint to the next available breakpoint.
1666
+ * If the current breakpoint is the last breakpoint, we set the current
1667
+ * breakpoint to the first non-zero breakpoint to avoid dismissing the sheet.
1668
+ */
1669
+ await this.setCurrentBreakpoint(nextBreakpoint);
1670
+ return true;
1671
+ }
1672
+ render() {
1673
+ const { handle, isSheetModal, presentingElement, htmlAttributes, handleBehavior, inheritedAttributes } = this;
1674
+ const showHandle = handle !== false && isSheetModal;
1675
+ const mode = getIonMode(this);
1676
+ const { modalId } = this;
1677
+ const isCardModal = presentingElement !== undefined && mode === 'ios';
1678
+ const isHandleCycle = handleBehavior === 'cycle';
1679
+ return (h(Host, Object.assign({ "no-router": true, tabindex: "-1" }, htmlAttributes, { style: {
1680
+ zIndex: `${20000 + this.overlayIndex}`,
1681
+ }, class: Object.assign({ [mode]: true, ['modal-default']: !isCardModal && !isSheetModal, [`modal-card`]: isCardModal, [`modal-sheet`]: isSheetModal, 'overlay-hidden': true }, getClassMap(this.cssClass)), id: modalId, onIonBackdropTap: this.onBackdropTap, onIonModalDidPresent: this.onLifecycle, onIonModalWillPresent: this.onLifecycle, onIonModalWillDismiss: this.onLifecycle, onIonModalDidDismiss: this.onLifecycle }), h("ion-backdrop", { ref: (el) => (this.backdropEl = el), visible: this.showBackdrop, tappable: this.backdropDismiss, part: "backdrop" }), mode === 'ios' && h("div", { class: "modal-shadow" }), h("div", Object.assign({
1682
+ /*
1683
+ role and aria-modal must be used on the
1684
+ same element. They must also be set inside the
1685
+ shadow DOM otherwise ion-button will not be highlighted
1686
+ when using VoiceOver: https://bugs.webkit.org/show_bug.cgi?id=247134
1687
+ */
1688
+ role: "dialog"
1689
+ }, inheritedAttributes, { "aria-modal": "true", class: "modal-wrapper ion-overlay-wrapper", part: "content", ref: (el) => (this.wrapperEl = el) }), showHandle && (h("button", { class: "modal-handle",
1690
+ // Prevents the handle from receiving keyboard focus when it does not cycle
1691
+ tabIndex: !isHandleCycle ? -1 : 0, "aria-label": "Activate to adjust the size of the dialog overlaying the screen", onClick: isHandleCycle ? this.onHandleClick : undefined, part: "handle" })), h("slot", null))));
1692
+ }
1693
+ get el() { return this; }
1694
+ static get watchers() { return {
1695
+ "isOpen": ["onIsOpenChange"],
1696
+ "trigger": ["onTriggerChange"],
1697
+ "swipeToClose": ["swipeToCloseChanged"]
1698
+ }; }
1699
+ static get style() { return {
1700
+ ios: modalIosCss,
1701
+ md: modalMdCss
1702
+ }; }
1703
+ }, [33, "ion-modal", {
1704
+ "hasController": [4, "has-controller"],
1705
+ "overlayIndex": [2, "overlay-index"],
1706
+ "delegate": [16],
1707
+ "keyboardClose": [4, "keyboard-close"],
1708
+ "enterAnimation": [16],
1709
+ "leaveAnimation": [16],
1710
+ "breakpoints": [16],
1711
+ "initialBreakpoint": [2, "initial-breakpoint"],
1712
+ "backdropBreakpoint": [2, "backdrop-breakpoint"],
1713
+ "handle": [4],
1714
+ "handleBehavior": [1, "handle-behavior"],
1715
+ "component": [1],
1716
+ "componentProps": [16],
1717
+ "cssClass": [1, "css-class"],
1718
+ "backdropDismiss": [4, "backdrop-dismiss"],
1719
+ "showBackdrop": [4, "show-backdrop"],
1720
+ "animated": [4],
1721
+ "swipeToClose": [4, "swipe-to-close"],
1722
+ "presentingElement": [16],
1723
+ "htmlAttributes": [16],
1724
+ "isOpen": [4, "is-open"],
1725
+ "trigger": [1],
1726
+ "keepContentsMounted": [4, "keep-contents-mounted"],
1727
+ "canDismiss": [4, "can-dismiss"],
1728
+ "presented": [32],
1729
+ "present": [64],
1730
+ "dismiss": [64],
1731
+ "onDidDismiss": [64],
1732
+ "onWillDismiss": [64],
1733
+ "setCurrentBreakpoint": [64],
1734
+ "getCurrentBreakpoint": [64]
1735
+ }]);
1736
+ const LIFECYCLE_MAP = {
1737
+ ionModalDidPresent: 'ionViewDidEnter',
1738
+ ionModalWillPresent: 'ionViewWillEnter',
1739
+ ionModalWillDismiss: 'ionViewWillLeave',
1740
+ ionModalDidDismiss: 'ionViewDidLeave',
1741
+ };
1742
+ let modalIds = 0;
1743
+ function defineCustomElement$1() {
1744
+ if (typeof customElements === "undefined") {
1745
+ return;
1746
+ }
1747
+ const components = ["ion-modal", "ion-backdrop"];
1748
+ components.forEach(tagName => { switch (tagName) {
1749
+ case "ion-modal":
1750
+ if (!customElements.get(tagName)) {
1751
+ customElements.define(tagName, Modal);
1752
+ }
1753
+ break;
1754
+ case "ion-backdrop":
1755
+ if (!customElements.get(tagName)) {
1756
+ defineCustomElement$2();
1757
+ }
1758
+ break;
1759
+ } });
1760
+ }
1761
+
1762
+ const IonModal = Modal;
1763
+ const defineCustomElement = defineCustomElement$1;
1764
+
1765
+ export { IonModal, defineCustomElement };