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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (587) hide show
  1. package/components/index.d.ts +2 -0
  2. package/components/index.js +1 -114
  3. package/components/ion-accordion-group.js +1 -268
  4. package/components/ion-accordion.js +1 -456
  5. package/components/ion-action-sheet.js +1 -6
  6. package/components/ion-alert.js +1 -6
  7. package/components/ion-app.js +1 -132
  8. package/components/ion-avatar.js +1 -41
  9. package/components/ion-back-button.js +1 -130
  10. package/components/ion-backdrop.js +1 -6
  11. package/components/ion-badge.js +1 -47
  12. package/components/ion-breadcrumb.js +1 -137
  13. package/components/ion-breadcrumbs.js +1 -164
  14. package/components/ion-button.js +1 -6
  15. package/components/ion-buttons.js +1 -6
  16. package/components/ion-card-content.js +1 -45
  17. package/components/ion-card-header.js +1 -56
  18. package/components/ion-card-subtitle.js +1 -48
  19. package/components/ion-card-title.js +1 -48
  20. package/components/ion-card.js +1 -107
  21. package/components/ion-checkbox.js +1 -6
  22. package/components/ion-chip.js +1 -66
  23. package/components/ion-col.js +1 -163
  24. package/components/ion-content.js +1 -6
  25. package/components/ion-datetime-button.js +1 -383
  26. package/components/ion-datetime.js +1 -2047
  27. package/components/ion-fab-button.js +1 -151
  28. package/components/ion-fab-list.js +1 -73
  29. package/components/ion-fab.js +1 -101
  30. package/components/ion-footer.js +1 -179
  31. package/components/ion-grid.js +1 -46
  32. package/components/ion-header.js +1 -6
  33. package/components/ion-icon.js +1 -6
  34. package/components/ion-img.js +1 -133
  35. package/components/ion-infinite-scroll-content.js +1 -69
  36. package/components/ion-infinite-scroll.js +1 -236
  37. package/components/ion-input-otp.js +1 -682
  38. package/components/ion-input-password-toggle.js +1 -128
  39. package/components/ion-input.js +1 -646
  40. package/components/ion-item-divider.js +1 -59
  41. package/components/ion-item-group.js +1 -46
  42. package/components/ion-item-option.js +1 -91
  43. package/components/ion-item-options.js +1 -73
  44. package/components/ion-item-sliding.js +1 -457
  45. package/components/ion-item.js +1 -6
  46. package/components/ion-label.js +1 -6
  47. package/components/ion-list-header.js +1 -6
  48. package/components/ion-list.js +1 -6
  49. package/components/ion-loading.js +1 -343
  50. package/components/ion-menu-button.js +1 -109
  51. package/components/ion-menu-toggle.js +1 -64
  52. package/components/ion-menu.js +1 -741
  53. package/components/ion-modal.js +1 -6
  54. package/components/ion-nav-link.js +1 -64
  55. package/components/ion-nav.js +1 -951
  56. package/components/ion-note.js +1 -47
  57. package/components/ion-picker-column-option.js +1 -6
  58. package/components/ion-picker-column.js +1 -6
  59. package/components/ion-picker-legacy-column.js +1 -6
  60. package/components/ion-picker-legacy.js +1 -342
  61. package/components/ion-picker.js +1 -6
  62. package/components/ion-popover.js +1 -6
  63. package/components/ion-progress-bar.js +1 -100
  64. package/components/ion-radio-group.js +1 -6
  65. package/components/ion-radio.js +1 -6
  66. package/components/ion-range.js +1 -844
  67. package/components/ion-refresher-content.js +1 -88
  68. package/components/ion-refresher.js +1 -750
  69. package/components/ion-reorder-group.js +1 -322
  70. package/components/ion-reorder.js +1 -60
  71. package/components/ion-ripple-effect.js +1 -6
  72. package/components/ion-route-redirect.js +1 -45
  73. package/components/ion-route.js +1 -74
  74. package/components/ion-router-link.js +1 -61
  75. package/components/ion-router-outlet.js +1 -226
  76. package/components/ion-router.js +1 -840
  77. package/components/ion-row.js +1 -36
  78. package/components/ion-searchbar.js +1 -540
  79. package/components/ion-segment-button.js +1 -173
  80. package/components/ion-segment-content.js +1 -35
  81. package/components/ion-segment-view.js +1 -142
  82. package/components/ion-segment.js +1 -602
  83. package/components/ion-select-modal.js +1 -6
  84. package/components/ion-select-option.js +1 -46
  85. package/components/ion-select-popover.js +1 -6
  86. package/components/ion-select.js +1 -1035
  87. package/components/ion-skeleton-text.js +1 -64
  88. package/components/ion-spinner.js +1 -6
  89. package/components/ion-split-pane.js +1 -190
  90. package/components/ion-tab-bar.js +1 -135
  91. package/components/ion-tab-button.js +1 -127
  92. package/components/ion-tab.js +1 -82
  93. package/components/ion-tabs.js +1 -204
  94. package/components/ion-text.js +1 -42
  95. package/components/ion-textarea.js +1 -554
  96. package/components/ion-thumbnail.js +1 -36
  97. package/components/ion-title.js +1 -6
  98. package/components/ion-toast.js +1 -938
  99. package/components/ion-toggle.js +1 -360
  100. package/components/ion-toolbar.js +1 -6
  101. package/components/p-1KVKSLu5.js +4 -0
  102. package/{dist/ionic/p-DUt5fQmA.js → components/p-9VcRUwdB.js} +1 -1
  103. package/components/p-ApmKVjaE.js +4 -0
  104. package/components/p-B-hirT0v.js +1 -35
  105. package/components/p-B6FQ0cKR.js +4 -0
  106. package/components/p-B6HaBl3o.js +4 -0
  107. package/components/p-B8b1Ukl9.js +4 -0
  108. package/components/p-BFxT89Wl.js +4 -0
  109. package/components/p-BJoMtgfR.js +4 -0
  110. package/components/p-BNAG-aVv.js +4 -0
  111. package/{dist/ionic/p-D-eFFUkA.js → components/p-BR3tZJmu.js} +1 -1
  112. package/{dist/ionic/p-D0dMcSkw.js → components/p-BS1TtEiJ.js} +1 -1
  113. package/components/p-BSB38Tek.js +4 -0
  114. package/components/p-BTEOs1at.js +1 -192
  115. package/components/p-BTeL5HCK.js +4 -0
  116. package/{dist/ionic/p-DbQ5QkTP.js → components/p-BUbsoBOV.js} +1 -1
  117. package/components/p-BVnB3eEn.js +4 -0
  118. package/components/p-BYDc3hSE.js +4 -0
  119. package/components/p-BagjAGC0.js +4 -0
  120. package/components/p-BegtE7nr.js +4 -0
  121. package/components/p-BgwEQWW6.js +4 -0
  122. package/components/p-Bk2zuNWT.js +4 -0
  123. package/components/p-BmVRXR1y.js +1 -72
  124. package/components/p-Bum_LjMh.js +4 -0
  125. package/components/p-BxwWvu-b.js +4 -0
  126. package/components/p-C4jPsTQa.js +4 -0
  127. package/components/p-C53feagD.js +1 -15
  128. package/{dist/ionic/p-CwgG81ZD.js → components/p-C59ryAuS.js} +1 -1
  129. package/components/p-C7AoMl7c.js +4 -0
  130. package/components/p-CBzELu-H.js +4 -0
  131. package/components/p-CDfQnFrd.js +4 -0
  132. package/components/p-CH0NYjKq.js +4 -0
  133. package/components/p-CIGNaXM1.js +1 -10
  134. package/components/p-CO7fmmxt.js +1 -29
  135. package/components/p-CU1SSH8_.js +4 -0
  136. package/components/p-CVF7ukTk.js +4 -0
  137. package/components/p-CgfaEEem.js +4 -0
  138. package/components/p-CgqKJg96.js +4 -0
  139. package/components/p-Cl0B-RWe.js +1 -452
  140. package/components/p-CneGxKsZ.js +4 -0
  141. package/components/p-CoA-aqGF.js +4 -0
  142. package/{dist/ionic/p-DdR6rpbR.js → components/p-Cq8cQ0NL.js} +1 -1
  143. package/components/p-Csw8xuz4.js +4 -0
  144. package/components/p-CtWGkNnJ.js +1 -162
  145. package/components/p-Cwv-vmkN.js +4 -0
  146. package/{dist/ionic/p-BYEqWnSg.js → components/p-Cy5XSfIk.js} +1 -1
  147. package/components/p-Cyxa_4PV.js +4 -0
  148. package/components/p-Cz5nLPGT.js +4 -0
  149. package/components/p-D13Eaw-8.js +1 -76
  150. package/components/p-D6NJwNJN.js +4 -0
  151. package/components/p-D6Ynv7Xh.js +1 -141
  152. package/components/p-DHsZWn1l.js +4 -0
  153. package/components/p-DJMZehmW.js +4 -0
  154. package/components/p-DJztqcrH.js +1 -14
  155. package/components/p-DYdpXONG.js +4 -0
  156. package/components/p-DgbT0exM.js +4 -0
  157. package/components/p-DiVJyqlX.js +1 -40
  158. package/components/p-Dtdm8lKC.js +1 -44
  159. package/components/p-YLXPWgVj.js +4 -0
  160. package/components/p-ZjP4CjeZ.js +1 -4
  161. package/{dist/ionic/p-DCv9sLH2.js → components/p-ak_d-z48.js} +1 -1
  162. package/components/p-cyNmxje6.js +1 -155
  163. package/components/p-fpbh6w3f.js +4 -0
  164. package/components/p-hHmYLOfE.js +1 -87
  165. package/components/p-kvaDs24J.js +4 -0
  166. package/components/p-vEbVo2hO.js +4 -0
  167. package/dist/cjs/{animation-Bt3H9L1C.js → animation-Dg4yiuR2.js} +1 -1
  168. package/dist/cjs/app-globals-CLI8xCmk.js +11 -0
  169. package/dist/cjs/{button-active-CMc8cD90.js → button-active-FscMI17-.js} +1 -1
  170. package/dist/cjs/{config-C5fsO43a.js → config-BukYi_pW.js} +1 -1
  171. package/dist/cjs/{data-JwZKaIQB.js → data-BYlBjkMU.js} +1 -1
  172. package/dist/cjs/{framework-delegate-DMJRBuDi.js → framework-delegate-CRgp8o_p.js} +1 -1
  173. package/dist/cjs/{hardware-back-button-VCK4V3mG.js → hardware-back-button-C4rMJ5uI.js} +1 -1
  174. package/dist/cjs/{helpers-DrTqNghc.js → helpers-CxTYJdbT.js} +1 -1
  175. package/dist/cjs/{index-094mMFB-.js → index-C845Ti6K.js} +4 -4
  176. package/dist/cjs/{index-DrMUZJj6.js → index-CFUwM5x_.js} +5 -5
  177. package/dist/cjs/{index-D6Wc6v08.js → index-CqT-2gKy.js} +503 -382
  178. package/dist/cjs/{index-CO6eryBo.js → index-MbaBbWXk.js} +2 -2
  179. package/dist/cjs/{index-C534ULug.js → index-YcSftOMz.js} +2 -2
  180. package/dist/cjs/index.cjs.js +12 -12
  181. package/dist/cjs/{input-shims-CuMghsQ-.js → input-shims-Dl5cnc_e.js} +3 -3
  182. package/dist/cjs/{input.utils-B_QROI2g.js → input.utils-DmeJ8dmo.js} +2 -2
  183. package/dist/cjs/ion-accordion_2.cjs.entry.js +23 -15
  184. package/dist/cjs/ion-action-sheet.cjs.entry.js +21 -15
  185. package/dist/cjs/ion-alert.cjs.entry.js +25 -17
  186. package/dist/cjs/ion-app_8.cjs.entry.js +48 -43
  187. package/dist/cjs/ion-avatar_3.cjs.entry.js +12 -12
  188. package/dist/cjs/ion-back-button.cjs.entry.js +7 -7
  189. package/dist/cjs/ion-backdrop.cjs.entry.js +6 -6
  190. package/dist/cjs/ion-breadcrumb_2.cjs.entry.js +20 -14
  191. package/dist/cjs/ion-button_2.cjs.entry.js +36 -18
  192. package/dist/cjs/ion-card_5.cjs.entry.js +23 -23
  193. package/dist/cjs/ion-checkbox.cjs.entry.js +7 -7
  194. package/dist/cjs/ion-chip.cjs.entry.js +6 -6
  195. package/dist/cjs/ion-col_3.cjs.entry.js +8 -8
  196. package/dist/cjs/ion-datetime-button.cjs.entry.js +8 -8
  197. package/dist/cjs/ion-datetime_3.cjs.entry.js +75 -46
  198. package/dist/cjs/ion-fab_3.cjs.entry.js +17 -13
  199. package/dist/cjs/ion-img.cjs.entry.js +8 -6
  200. package/dist/cjs/ion-infinite-scroll_2.cjs.entry.js +17 -13
  201. package/dist/cjs/ion-input-otp.cjs.entry.js +16 -10
  202. package/dist/cjs/ion-input-password-toggle.cjs.entry.js +9 -7
  203. package/dist/cjs/ion-input.cjs.entry.js +21 -13
  204. package/dist/cjs/ion-item-option_3.cjs.entry.js +19 -17
  205. package/dist/cjs/ion-item_8.cjs.entry.js +48 -42
  206. package/dist/cjs/ion-loading.cjs.entry.js +18 -14
  207. package/dist/cjs/ion-menu_3.cjs.entry.js +30 -22
  208. package/dist/cjs/ion-modal.cjs.entry.js +237 -59
  209. package/dist/cjs/ion-nav_2.cjs.entry.js +14 -10
  210. package/dist/cjs/ion-picker-column-option.cjs.entry.js +10 -8
  211. package/dist/cjs/ion-picker-column.cjs.entry.js +11 -7
  212. package/dist/cjs/ion-picker.cjs.entry.js +6 -6
  213. package/dist/cjs/ion-popover.cjs.entry.js +21 -15
  214. package/dist/cjs/ion-progress-bar.cjs.entry.js +7 -7
  215. package/dist/cjs/ion-radio_2.cjs.entry.js +17 -13
  216. package/dist/cjs/ion-range.cjs.entry.js +205 -57
  217. package/dist/cjs/ion-refresher_2.cjs.entry.js +45 -14
  218. package/dist/cjs/ion-reorder_2.cjs.entry.js +13 -11
  219. package/dist/cjs/ion-ripple-effect.cjs.entry.js +4 -4
  220. package/dist/cjs/ion-route_4.cjs.entry.js +20 -10
  221. package/dist/cjs/ion-searchbar.cjs.entry.js +22 -12
  222. package/dist/cjs/ion-segment-content.cjs.entry.js +3 -3
  223. package/dist/cjs/ion-segment-view.cjs.entry.js +13 -8
  224. package/dist/cjs/ion-segment_2.cjs.entry.js +26 -16
  225. package/dist/cjs/ion-select-modal.cjs.entry.js +17 -13
  226. package/dist/cjs/ion-select_3.cjs.entry.js +33 -24
  227. package/dist/cjs/ion-spinner.cjs.entry.js +4 -4
  228. package/dist/cjs/ion-split-pane.cjs.entry.js +15 -9
  229. package/dist/cjs/ion-tab-bar_2.cjs.entry.js +14 -12
  230. package/dist/cjs/ion-tab_2.cjs.entry.js +10 -8
  231. package/dist/cjs/ion-text.cjs.entry.js +4 -4
  232. package/dist/cjs/ion-textarea.cjs.entry.js +20 -14
  233. package/dist/cjs/ion-toast.cjs.entry.js +21 -15
  234. package/dist/cjs/ion-toggle.cjs.entry.js +10 -8
  235. package/dist/cjs/{ionic-global-HMVqOFGO.js → ionic-global-Bc3kJi1Z.js} +1 -1
  236. package/dist/cjs/ionic.cjs.js +5 -5
  237. package/dist/cjs/{ios.transition-BOt_uW73.js → ios.transition-trBiC95R.js} +4 -4
  238. package/dist/cjs/loader.cjs.js +4 -4
  239. package/dist/cjs/{md.transition-Dt968VXB.js → md.transition-CUQECuvD.js} +4 -4
  240. package/dist/cjs/{notch-controller-Bzqhjm4f.js → notch-controller-sD-lTpdc.js} +1 -1
  241. package/dist/cjs/{overlays-B2b-TTbl.js → overlays-C2jiBSNQ.js} +5 -5
  242. package/dist/cjs/{status-tap-g0sWWkXk.js → status-tap-CCJk5VgT.js} +3 -3
  243. package/dist/cjs/{swipe-back-BIayeNOD.js → swipe-back-BGhTQ1CU.js} +2 -2
  244. package/dist/collection/collection-manifest.json +2 -2
  245. package/dist/collection/components/accordion-group/accordion-group.js +4 -2
  246. package/dist/collection/components/action-sheet/action-sheet.js +20 -10
  247. package/dist/collection/components/alert/alert.js +24 -12
  248. package/dist/collection/components/back-button/back-button.js +4 -2
  249. package/dist/collection/components/badge/badge.js +2 -1
  250. package/dist/collection/components/breadcrumb/breadcrumb.js +8 -4
  251. package/dist/collection/components/breadcrumbs/breadcrumbs.js +4 -2
  252. package/dist/collection/components/button/button.js +6 -3
  253. package/dist/collection/components/card/card.js +6 -3
  254. package/dist/collection/components/card-header/card-header.js +2 -1
  255. package/dist/collection/components/card-subtitle/card-subtitle.js +2 -1
  256. package/dist/collection/components/card-title/card-title.js +2 -1
  257. package/dist/collection/components/checkbox/checkbox.js +4 -2
  258. package/dist/collection/components/chip/chip.js +2 -1
  259. package/dist/collection/components/content/content.js +12 -7
  260. package/dist/collection/components/datetime/datetime.js +43 -22
  261. package/dist/collection/components/datetime-button/datetime-button.js +2 -1
  262. package/dist/collection/components/fab-button/fab-button.js +6 -3
  263. package/dist/collection/components/infinite-scroll-content/infinite-scroll-content.js +4 -2
  264. package/dist/collection/components/input/input.js +11 -6
  265. package/dist/collection/components/input-otp/input-otp.js +8 -4
  266. package/dist/collection/components/input-password-toggle/input-password-toggle.js +4 -2
  267. package/dist/collection/components/item/item.js +10 -5
  268. package/dist/collection/components/item-divider/item-divider.js +7 -3
  269. package/dist/collection/components/item-option/item-option.js +6 -3
  270. package/dist/collection/components/item-options/item-options.js +2 -1
  271. package/dist/collection/components/item-sliding/item-sliding.js +2 -1
  272. package/dist/collection/components/label/label.js +6 -3
  273. package/dist/collection/components/list-header/list-header.js +6 -3
  274. package/dist/collection/components/loading/loading.js +22 -11
  275. package/dist/collection/components/menu/menu.js +10 -5
  276. package/dist/collection/components/menu-button/menu-button.js +2 -1
  277. package/dist/collection/components/modal/gestures/sheet.js +120 -12
  278. package/dist/collection/components/modal/gestures/swipe-to-close.js +54 -1
  279. package/dist/collection/components/modal/modal.js +127 -45
  280. package/dist/collection/components/nav/nav.js +89 -45
  281. package/dist/collection/components/nav-link/nav-link.js +9 -5
  282. package/dist/collection/components/note/note.js +2 -1
  283. package/dist/collection/components/picker/picker.js +2 -1
  284. package/dist/collection/components/picker-column/picker-column.js +6 -3
  285. package/dist/collection/components/picker-column-option/picker-column-option.js +2 -1
  286. package/dist/collection/components/picker-legacy/picker.js +24 -12
  287. package/dist/collection/components/picker-legacy-column/picker-column.js +4 -2
  288. package/dist/collection/components/popover/popover.js +33 -17
  289. package/dist/collection/components/progress-bar/progress-bar.js +2 -1
  290. package/dist/collection/components/radio/radio.js +2 -1
  291. package/dist/collection/components/radio-group/radio-group.js +6 -3
  292. package/dist/collection/components/range/range.js +214 -53
  293. package/dist/collection/components/refresher/refresher.js +73 -5
  294. package/dist/collection/components/refresher-content/refresher-content.js +8 -4
  295. package/dist/collection/components/reorder-group/reorder-group.js +6 -3
  296. package/dist/collection/components/route/route.js +4 -2
  297. package/dist/collection/components/router/router.js +10 -5
  298. package/dist/collection/components/router-link/router-link.js +6 -3
  299. package/dist/collection/components/router-outlet/router-outlet.js +18 -9
  300. package/dist/collection/components/searchbar/searchbar.js +11 -6
  301. package/dist/collection/components/segment/segment.js +10 -5
  302. package/dist/collection/components/segment-button/segment-button.js +4 -2
  303. package/dist/collection/components/segment-view/segment-view.ios.css +2 -1
  304. package/dist/collection/components/segment-view/segment-view.js +30 -4
  305. package/dist/collection/components/segment-view/segment-view.md.css +2 -1
  306. package/dist/collection/components/select/select.js +17 -8
  307. package/dist/collection/components/select-modal/select-modal.js +27 -2
  308. package/dist/collection/components/select-popover/select-popover.js +2 -1
  309. package/dist/collection/components/skeleton-text/skeleton-text.js +2 -1
  310. package/dist/collection/components/spinner/spinner.js +4 -2
  311. package/dist/collection/components/tab/tab.js +4 -2
  312. package/dist/collection/components/tab-bar/tab-bar.js +4 -2
  313. package/dist/collection/components/tab-button/tab-button.js +4 -2
  314. package/dist/collection/components/tabs/tabs.js +4 -2
  315. package/dist/collection/components/text/text.js +2 -1
  316. package/dist/collection/components/textarea/textarea.js +10 -7
  317. package/dist/collection/components/title/title.js +4 -2
  318. package/dist/collection/components/toast/toast.js +34 -17
  319. package/dist/collection/components/toggle/toggle.js +4 -2
  320. package/dist/collection/components/toolbar/toolbar.js +2 -1
  321. package/dist/docs.d.ts +37 -0
  322. package/dist/docs.json +1186 -389
  323. package/dist/esm/{animation-Dt8bGnA-.js → animation-CnGMT4ji.js} +1 -1
  324. package/dist/esm/app-globals-DhZjtldk.js +9 -0
  325. package/dist/esm/{button-active-L570Swow.js → button-active-BBx21brx.js} +1 -1
  326. package/dist/esm/{config-mCdtaoPe.js → config-TO1rZH52.js} +1 -1
  327. package/dist/esm/{data-DCORV9FH.js → data-B9iGR5YO.js} +1 -1
  328. package/dist/esm/{framework-delegate-BYawdMXj.js → framework-delegate-CyxE1S_P.js} +1 -1
  329. package/dist/esm/{hardware-back-button-CPLxO-Ev.js → hardware-back-button-CTe4XmL7.js} +1 -1
  330. package/dist/esm/{helpers-DEn3pfjm.js → helpers-Tl8jw6S2.js} +1 -1
  331. package/dist/esm/{index-r2D9DEro.js → index-B-hkiOUh.js} +4 -4
  332. package/dist/esm/{index-CvDIirVx.js → index-B2KwgBLx.js} +5 -5
  333. package/dist/esm/{index-ceb5RaMT.js → index-BtUdxPjv.js} +2 -2
  334. package/dist/esm/{index-C8IsBmNU.js → index-IGIE5vDm.js} +503 -382
  335. package/dist/esm/{index-Bs3kT4bc.js → index-hW6eNZ3o.js} +2 -2
  336. package/dist/esm/index.js +12 -12
  337. package/dist/esm/{input-shims-D6H3ZaWt.js → input-shims-AaDhOpKN.js} +3 -3
  338. package/dist/esm/{input.utils-DrvTa8gz.js → input.utils-Bxa_DQ7-.js} +2 -2
  339. package/dist/esm/ion-accordion_2.entry.js +23 -15
  340. package/dist/esm/ion-action-sheet.entry.js +21 -15
  341. package/dist/esm/ion-alert.entry.js +25 -17
  342. package/dist/esm/ion-app_8.entry.js +48 -43
  343. package/dist/esm/ion-avatar_3.entry.js +12 -12
  344. package/dist/esm/ion-back-button.entry.js +7 -7
  345. package/dist/esm/ion-backdrop.entry.js +6 -6
  346. package/dist/esm/ion-breadcrumb_2.entry.js +20 -14
  347. package/dist/esm/ion-button_2.entry.js +36 -18
  348. package/dist/esm/ion-card_5.entry.js +23 -23
  349. package/dist/esm/ion-checkbox.entry.js +7 -7
  350. package/dist/esm/ion-chip.entry.js +6 -6
  351. package/dist/esm/ion-col_3.entry.js +8 -8
  352. package/dist/esm/ion-datetime-button.entry.js +8 -8
  353. package/dist/esm/ion-datetime_3.entry.js +75 -46
  354. package/dist/esm/ion-fab_3.entry.js +17 -13
  355. package/dist/esm/ion-img.entry.js +8 -6
  356. package/dist/esm/ion-infinite-scroll_2.entry.js +17 -13
  357. package/dist/esm/ion-input-otp.entry.js +16 -10
  358. package/dist/esm/ion-input-password-toggle.entry.js +9 -7
  359. package/dist/esm/ion-input.entry.js +21 -13
  360. package/dist/esm/ion-item-option_3.entry.js +19 -17
  361. package/dist/esm/ion-item_8.entry.js +48 -42
  362. package/dist/esm/ion-loading.entry.js +18 -14
  363. package/dist/esm/ion-menu_3.entry.js +30 -22
  364. package/dist/esm/ion-modal.entry.js +237 -59
  365. package/dist/esm/ion-nav_2.entry.js +14 -10
  366. package/dist/esm/ion-picker-column-option.entry.js +10 -8
  367. package/dist/esm/ion-picker-column.entry.js +11 -7
  368. package/dist/esm/ion-picker.entry.js +6 -6
  369. package/dist/esm/ion-popover.entry.js +21 -15
  370. package/dist/esm/ion-progress-bar.entry.js +7 -7
  371. package/dist/esm/ion-radio_2.entry.js +17 -13
  372. package/dist/esm/ion-range.entry.js +205 -57
  373. package/dist/esm/ion-refresher_2.entry.js +45 -14
  374. package/dist/esm/ion-reorder_2.entry.js +13 -11
  375. package/dist/esm/ion-ripple-effect.entry.js +4 -4
  376. package/dist/esm/ion-route_4.entry.js +20 -10
  377. package/dist/esm/ion-searchbar.entry.js +22 -12
  378. package/dist/esm/ion-segment-content.entry.js +3 -3
  379. package/dist/esm/ion-segment-view.entry.js +13 -8
  380. package/dist/esm/ion-segment_2.entry.js +26 -16
  381. package/dist/esm/ion-select-modal.entry.js +17 -13
  382. package/dist/esm/ion-select_3.entry.js +33 -24
  383. package/dist/esm/ion-spinner.entry.js +4 -4
  384. package/dist/esm/ion-split-pane.entry.js +15 -9
  385. package/dist/esm/ion-tab-bar_2.entry.js +14 -12
  386. package/dist/esm/ion-tab_2.entry.js +10 -8
  387. package/dist/esm/ion-text.entry.js +4 -4
  388. package/dist/esm/ion-textarea.entry.js +20 -14
  389. package/dist/esm/ion-toast.entry.js +21 -15
  390. package/dist/esm/ion-toggle.entry.js +10 -8
  391. package/dist/esm/{ionic-global-CDrldh-5.js → ionic-global-DfbeLwcV.js} +1 -1
  392. package/dist/esm/ionic.js +6 -6
  393. package/dist/esm/{ios.transition-BDzw0_Hm.js → ios.transition--aMF-pDH.js} +4 -4
  394. package/dist/esm/loader.js +5 -5
  395. package/dist/esm/{md.transition-BzDYi3qq.js → md.transition-BEVbfm8j.js} +4 -4
  396. package/dist/esm/{notch-controller-BwelN_JM.js → notch-controller-DAcvKU57.js} +1 -1
  397. package/dist/esm/{overlays-D5YkFThA.js → overlays-F8GHPo-e.js} +5 -5
  398. package/dist/esm/{status-tap-5DQ7Fc4V.js → status-tap-BfJqFSLF.js} +3 -3
  399. package/dist/esm/{swipe-back-BKw2CAHc.js → swipe-back-BZBFwTQV.js} +2 -2
  400. package/dist/html.html-data.json +117 -109
  401. package/dist/ionic/index.esm.js +1 -1
  402. package/dist/ionic/ionic.esm.js +1 -1
  403. package/dist/ionic/p-031b76f7.entry.js +4 -0
  404. package/dist/ionic/p-045a6a42.entry.js +4 -0
  405. package/dist/ionic/p-07506134.entry.js +4 -0
  406. package/dist/ionic/p-084c25b2.entry.js +4 -0
  407. package/dist/ionic/p-0d8b5c38.entry.js +4 -0
  408. package/dist/ionic/p-16813ce7.entry.js +4 -0
  409. package/dist/ionic/p-16b65553.entry.js +4 -0
  410. package/dist/ionic/p-1b02923f.entry.js +4 -0
  411. package/dist/ionic/{p-5c8f7253.entry.js → p-1b169fb6.entry.js} +1 -1
  412. package/dist/ionic/{p-915b3e3d.entry.js → p-23fac490.entry.js} +1 -1
  413. package/dist/ionic/{p-b8551510.entry.js → p-294f4bb5.entry.js} +1 -1
  414. package/dist/ionic/p-2a68388b.entry.js +4 -0
  415. package/dist/ionic/p-2f5a8140.entry.js +4 -0
  416. package/dist/ionic/{p-49d06882.entry.js → p-301c43f8.entry.js} +1 -1
  417. package/dist/ionic/{p-79bd78f9.entry.js → p-370a60ee.entry.js} +1 -1
  418. package/dist/ionic/p-3e143d1d.entry.js +4 -0
  419. package/dist/ionic/p-4819b469.entry.js +4 -0
  420. package/dist/ionic/p-4dd5e8e0.entry.js +4 -0
  421. package/dist/ionic/p-51c11c47.entry.js +4 -0
  422. package/dist/ionic/p-53f750a5.entry.js +4 -0
  423. package/dist/ionic/{p-7cad388a.entry.js → p-6af16209.entry.js} +1 -1
  424. package/dist/ionic/{p-7f98e710.entry.js → p-6b701daa.entry.js} +1 -1
  425. package/dist/ionic/p-6b97f2a3.entry.js +4 -0
  426. package/dist/ionic/p-71e322f7.entry.js +4 -0
  427. package/dist/ionic/p-7620be24.entry.js +4 -0
  428. package/dist/ionic/p-771b27a5.entry.js +4 -0
  429. package/dist/ionic/{p-906bb44d.entry.js → p-7ca71c83.entry.js} +1 -1
  430. package/dist/ionic/{p-11aa58d6.entry.js → p-80cac7a2.entry.js} +1 -1
  431. package/dist/ionic/p-96a2e768.entry.js +4 -0
  432. package/dist/ionic/{p-582824c5.entry.js → p-9833cf63.entry.js} +1 -1
  433. package/dist/ionic/p-9cbc6f1f.entry.js +4 -0
  434. package/dist/ionic/p-9cdbabbb.entry.js +4 -0
  435. package/dist/ionic/p-9eac4eb1.entry.js +4 -0
  436. package/dist/ionic/{p-675b1a31.entry.js → p-9fae83d8.entry.js} +1 -1
  437. package/dist/ionic/p-B8xlpH8p.js +4 -0
  438. package/dist/ionic/{p-C7hRNDhM.js → p-BAt5H1ac.js} +1 -1
  439. package/dist/ionic/p-BW_TRJm8.js +4 -0
  440. package/dist/ionic/{p-DDb5r57F.js → p-Bum7H1fw.js} +1 -1
  441. package/dist/ionic/p-BvFYtOdE.js +4 -0
  442. package/dist/ionic/{p-Dc45iWE4.js → p-BxIcPWoV.js} +1 -1
  443. package/dist/ionic/p-C0JvVFMv.js +4 -0
  444. package/dist/ionic/{p-CTfR9YZG.js → p-CGmVTdWh.js} +1 -1
  445. package/dist/ionic/{p-BOVrCkpJ.js → p-CYbRmDdy.js} +1 -1
  446. package/dist/ionic/{p-MUoJJJwd.js → p-CYvM5g3q.js} +1 -1
  447. package/dist/ionic/p-CmFz1Mjc.js +4 -0
  448. package/dist/ionic/p-CtA-yJYy.js +4 -0
  449. package/dist/ionic/p-D8HJQ1qq.js +4 -0
  450. package/dist/ionic/{p-B0q1YL7N.js → p-DB_iPQC-.js} +1 -1
  451. package/dist/ionic/{p-DNcfiJwE.js → p-DLbbmF9h.js} +1 -1
  452. package/dist/ionic/p-DTPR1Wpn.js +4 -0
  453. package/dist/ionic/p-DjriolRs.js +4 -0
  454. package/dist/ionic/p-DtVZDHlS.js +4 -0
  455. package/dist/ionic/p-IGIE5vDm.js +5 -0
  456. package/dist/ionic/{p-BFvmZNyx.js → p-NFFyoJ4Q.js} +1 -1
  457. package/dist/ionic/p-a805674e.entry.js +4 -0
  458. package/dist/ionic/{p-da7d04cc.entry.js → p-a84f2d21.entry.js} +1 -1
  459. package/dist/ionic/p-aa47f46e.entry.js +4 -0
  460. package/dist/ionic/{p-2668188b.entry.js → p-b325a113.entry.js} +1 -1
  461. package/dist/ionic/{p-d1f54e28.entry.js → p-b440381f.entry.js} +1 -1
  462. package/dist/ionic/p-b6e0ff03.entry.js +4 -0
  463. package/dist/ionic/{p-6f37536a.entry.js → p-bcaa827e.entry.js} +1 -1
  464. package/dist/ionic/{p-fb0271ae.entry.js → p-c3cce9d8.entry.js} +1 -1
  465. package/dist/ionic/{p-b0a7585c.entry.js → p-ca31010f.entry.js} +1 -1
  466. package/dist/ionic/p-d4e8b473.entry.js +4 -0
  467. package/dist/ionic/{p-9575b654.entry.js → p-e663bc5a.entry.js} +1 -1
  468. package/dist/ionic/p-e6c5f060.entry.js +4 -0
  469. package/dist/ionic/{p-652318c3.entry.js → p-e6cedcd7.entry.js} +1 -1
  470. package/dist/ionic/{p-fbb00634.entry.js → p-e863ffe8.entry.js} +1 -1
  471. package/dist/ionic/{p-0ca0fe9c.entry.js → p-f2deaceb.entry.js} +1 -1
  472. package/dist/ionic/{p-ac4eb91d.entry.js → p-f5dfb9a3.entry.js} +1 -1
  473. package/dist/ionic/{p-bce86e56.entry.js → p-f8186550.entry.js} +1 -1
  474. package/dist/ionic/p-fdbc90d4.entry.js +4 -0
  475. package/dist/ionic/p-gbVXD275.js +4 -0
  476. package/dist/ionic/p-hNN3VvaC.js +4 -0
  477. package/dist/types/components/datetime/datetime.d.ts +10 -0
  478. package/dist/types/components/header/header.utils.d.ts +2 -1
  479. package/dist/types/components/item/item.d.ts +2 -0
  480. package/dist/types/components/item-divider/item-divider.d.ts +3 -0
  481. package/dist/types/components/item-option/item-option.d.ts +2 -0
  482. package/dist/types/components/list-header/list-header.d.ts +2 -0
  483. package/dist/types/components/modal/gestures/sheet.d.ts +2 -2
  484. package/dist/types/components/modal/gestures/swipe-to-close.d.ts +2 -2
  485. package/dist/types/components/modal/modal-interface.d.ts +25 -0
  486. package/dist/types/components/modal/modal.d.ts +22 -1
  487. package/dist/types/components/range/range-interface.d.ts +1 -0
  488. package/dist/types/components/range/range.d.ts +44 -4
  489. package/dist/types/components/refresher/refresher-interface.d.ts +7 -0
  490. package/dist/types/components/refresher/refresher.d.ts +16 -3
  491. package/dist/types/components/segment-view/segment-view.d.ts +4 -0
  492. package/dist/types/components/select/select.d.ts +3 -0
  493. package/dist/types/components/select-modal/select-modal.d.ts +4 -0
  494. package/dist/types/components.d.ts +964 -191
  495. package/dist/types/interface.d.ts +2 -2
  496. package/dist/types/stencil-public-runtime.d.ts +126 -14
  497. package/dist/types/utils/gesture/listener.d.ts +2 -1
  498. package/hydrate/index.d.ts +12 -0
  499. package/hydrate/index.js +5632 -1421
  500. package/hydrate/index.mjs +5631 -1422
  501. package/package.json +2 -2
  502. package/components/p-B25GjpND.js +0 -71
  503. package/components/p-BANeLH_G.js +0 -290
  504. package/components/p-BBFQmhcD.js +0 -59
  505. package/components/p-BC-awmYt.js +0 -306
  506. package/components/p-BHbOsu99.js +0 -501
  507. package/components/p-BTlwXR9e.js +0 -73
  508. package/components/p-BcazQttQ.js +0 -612
  509. package/components/p-BdGshsIJ.js +0 -226
  510. package/components/p-BfS7vSpC.js +0 -147
  511. package/components/p-BhRFCLuX.js +0 -675
  512. package/components/p-Bhnhnzjz.js +0 -75
  513. package/components/p-BmcqD0EN.js +0 -153
  514. package/components/p-Boi6hecl.js +0 -115
  515. package/components/p-Bt_moUyl.js +0 -232
  516. package/components/p-Bxl5etF4.js +0 -146
  517. package/components/p-ByjmWt3s.js +0 -139
  518. package/components/p-C04oPyjT.js +0 -54
  519. package/components/p-C6dkQWq2.js +0 -1626
  520. package/components/p-CFZWrvIQ.js +0 -194
  521. package/components/p-CIJwkzL6.js +0 -195
  522. package/components/p-CL12ApCQ.js +0 -820
  523. package/components/p-CXJR56Oq.js +0 -564
  524. package/components/p-Cdm3dKWf.js +0 -108
  525. package/components/p-CslsoGzv.js +0 -192
  526. package/components/p-Cyd00tgZ.js +0 -167
  527. package/components/p-CzAJ3ArC.js +0 -380
  528. package/components/p-CzW34QBh.js +0 -12
  529. package/components/p-D0zXRwcr.js +0 -196
  530. package/components/p-D5hF6rwn.js +0 -339
  531. package/components/p-D8eD2iBA.js +0 -67
  532. package/components/p-DGOrLIyS.js +0 -481
  533. package/components/p-DK2Bn1Mc.js +0 -305
  534. package/components/p-DKRQWlK2.js +0 -598
  535. package/components/p-DNDUsygf.js +0 -128
  536. package/components/p-DTWZF6wg.js +0 -418
  537. package/components/p-DWoUQeZ3.js +0 -3012
  538. package/components/p-DX0w75a9.js +0 -420
  539. package/components/p-Dt8zaCLQ.js +0 -92
  540. package/components/p-DyFBFrV7.js +0 -264
  541. package/components/p-DyHPCMyn.js +0 -39
  542. package/components/p-LgLeKTkH.js +0 -112
  543. package/components/p-NhiRFRn9.js +0 -50
  544. package/components/p-OuiHmXO5.js +0 -646
  545. package/components/p-Wro9IPHE.js +0 -459
  546. package/components/p-aIWC4ZEV.js +0 -305
  547. package/components/p-c-XJ9XhZ.js +0 -915
  548. package/components/p-fVuFT3Wd.js +0 -78
  549. package/components/p-iyo0Toaz.js +0 -2822
  550. package/components/p-l_lso3Zl.js +0 -140
  551. package/components/p-mQp4lwQD.js +0 -1638
  552. package/dist/cjs/app-globals-Ciccnk9_.js +0 -10
  553. package/dist/esm/app-globals-BDSf8fOA.js +0 -8
  554. package/dist/ionic/p-11518b31.entry.js +0 -4
  555. package/dist/ionic/p-221a3d8c.entry.js +0 -4
  556. package/dist/ionic/p-2ac254dc.entry.js +0 -4
  557. package/dist/ionic/p-2bd1ea35.entry.js +0 -4
  558. package/dist/ionic/p-30333874.entry.js +0 -4
  559. package/dist/ionic/p-31db96da.entry.js +0 -4
  560. package/dist/ionic/p-34642fa1.entry.js +0 -4
  561. package/dist/ionic/p-35696017.entry.js +0 -4
  562. package/dist/ionic/p-363d1209.entry.js +0 -4
  563. package/dist/ionic/p-46a38cfd.entry.js +0 -4
  564. package/dist/ionic/p-4eec1a5e.entry.js +0 -4
  565. package/dist/ionic/p-530fcd71.entry.js +0 -4
  566. package/dist/ionic/p-5d6fb6e3.entry.js +0 -4
  567. package/dist/ionic/p-66fbe052.entry.js +0 -4
  568. package/dist/ionic/p-7babec72.entry.js +0 -4
  569. package/dist/ionic/p-82d5bb3d.entry.js +0 -4
  570. package/dist/ionic/p-97eb0812.entry.js +0 -4
  571. package/dist/ionic/p-9b6d46f2.entry.js +0 -4
  572. package/dist/ionic/p-BKc55Xev.js +0 -4
  573. package/dist/ionic/p-Bmgaetn_.js +0 -4
  574. package/dist/ionic/p-C8IsBmNU.js +0 -5
  575. package/dist/ionic/p-CJxh_yLS.js +0 -4
  576. package/dist/ionic/p-DZRJwG4S.js +0 -4
  577. package/dist/ionic/p-a4a9f5ae.entry.js +0 -4
  578. package/dist/ionic/p-b0ebf9f8.entry.js +0 -4
  579. package/dist/ionic/p-be263062.entry.js +0 -4
  580. package/dist/ionic/p-c175d792.entry.js +0 -4
  581. package/dist/ionic/p-cc2a9936.entry.js +0 -4
  582. package/dist/ionic/p-cc45bcbc.entry.js +0 -4
  583. package/dist/ionic/p-d0a2a1ab.entry.js +0 -4
  584. package/dist/ionic/p-e4c57008.entry.js +0 -4
  585. package/dist/ionic/p-e5d6d0f0.entry.js +0 -4
  586. package/dist/ionic/p-f1dfee25.entry.js +0 -4
  587. package/dist/ionic/p-f9f7b9db.entry.js +0 -4
@@ -1,1626 +0,0 @@
1
- /*!
2
- * (C) Ionic http://ionicframework.com - MIT License
3
- */
4
- import { p as proxyCustomElement, H, e as createEvent, f as printIonWarning, h, d as Host } from './p-DWoUQeZ3.js';
5
- import { B as BACKDROP, j as prepareOverlay, k as setOverlayId, f as present, n as focusFirstDescendant, g as dismiss, h as eventMethod, F as FOCUS_TRAP_DISABLE_CLASS } from './p-c-XJ9XhZ.js';
6
- import { C as CoreDelegate, a as attachComponent, d as detachComponent } from './p-l_lso3Zl.js';
7
- import { g as getElementRoot, r as raf, a as addEventListener, k as hasLazyBuild } from './p-D5hF6rwn.js';
8
- import { c as createLockController } from './p-B-hirT0v.js';
9
- import { b as getIonMode, a as isPlatform } from './p-Bxl5etF4.js';
10
- import { g as getClassMap } from './p-DiVJyqlX.js';
11
- import { e as deepReady, w as waitForMount } from './p-DTWZF6wg.js';
12
- import { c as createAnimation } from './p-CL12ApCQ.js';
13
- import { d as defineCustomElement$1 } from './p-Bhnhnzjz.js';
14
-
15
- /**
16
- * Shared per-frame cache for safe-area insets. Avoids creating a temporary
17
- * DOM element and forcing a synchronous reflow on every call within the same
18
- * frame (e.g., multiple popovers presenting simultaneously). Invalidated
19
- * after the next animation frame so values stay fresh across orientation
20
- * changes and viewport resizes.
21
- */
22
- let cachedInsets = null;
23
- let cacheInvalidationScheduled = false;
24
- /**
25
- * Resolves the current --ion-safe-area-* CSS custom property values
26
- * to actual pixel numbers. A temporary element is needed because
27
- * getComputedStyle on :root returns the declared value of custom
28
- * properties (e.g. "env(safe-area-inset-top)") rather than a
29
- * resolved number. By assigning them to standard padding properties,
30
- * the browser resolves the value.
31
- *
32
- * Results are cached for the current frame to avoid repeated reflows.
33
- */
34
- const getSafeAreaInsets = (doc) => {
35
- if (cachedInsets !== null) {
36
- return cachedInsets;
37
- }
38
- if (doc.body === null) {
39
- return { top: 0, bottom: 0, left: 0, right: 0 };
40
- }
41
- const el = doc.createElement('div');
42
- el.style.cssText =
43
- 'position:fixed;visibility:hidden;pointer-events:none;top:0;left:0;' +
44
- 'padding-top:var(--ion-safe-area-top,0px);' +
45
- 'padding-bottom:var(--ion-safe-area-bottom,0px);' +
46
- 'padding-left:var(--ion-safe-area-left,0px);' +
47
- 'padding-right:var(--ion-safe-area-right,0px);';
48
- doc.body.appendChild(el);
49
- const style = getComputedStyle(el);
50
- const insets = {
51
- top: parseFloat(style.paddingTop) || 0,
52
- bottom: parseFloat(style.paddingBottom) || 0,
53
- left: parseFloat(style.paddingLeft) || 0,
54
- right: parseFloat(style.paddingRight) || 0,
55
- };
56
- el.remove();
57
- cachedInsets = insets;
58
- if (!cacheInvalidationScheduled) {
59
- cacheInvalidationScheduled = true;
60
- raf(() => {
61
- cachedInsets = null;
62
- cacheInvalidationScheduled = false;
63
- });
64
- }
65
- return insets;
66
- };
67
- /**
68
- * Returns the dimensions of the popover
69
- * arrow on `ios` mode. If arrow is disabled
70
- * returns (0, 0).
71
- */
72
- const getArrowDimensions = (arrowEl) => {
73
- if (!arrowEl) {
74
- return { arrowWidth: 0, arrowHeight: 0 };
75
- }
76
- const { width, height } = arrowEl.getBoundingClientRect();
77
- return { arrowWidth: width, arrowHeight: height };
78
- };
79
- /**
80
- * Returns the recommended dimensions of the popover
81
- * that takes into account whether or not the width
82
- * should match the trigger width.
83
- */
84
- const getPopoverDimensions = (size, contentEl, triggerEl) => {
85
- const contentDimentions = contentEl.getBoundingClientRect();
86
- const contentHeight = contentDimentions.height;
87
- let contentWidth = contentDimentions.width;
88
- if (size === 'cover' && triggerEl) {
89
- const triggerDimensions = triggerEl.getBoundingClientRect();
90
- contentWidth = triggerDimensions.width;
91
- }
92
- return {
93
- contentWidth,
94
- contentHeight,
95
- };
96
- };
97
- const configureDismissInteraction = (triggerEl, triggerAction, popoverEl, parentPopoverEl) => {
98
- let dismissCallbacks = [];
99
- const root = getElementRoot(parentPopoverEl);
100
- const parentContentEl = root.querySelector('.popover-content');
101
- switch (triggerAction) {
102
- case 'hover':
103
- dismissCallbacks = [
104
- {
105
- /**
106
- * Do not use mouseover here
107
- * as this will causes the event to
108
- * be dispatched on each underlying
109
- * element rather than on the popover
110
- * content as a whole.
111
- */
112
- eventName: 'mouseenter',
113
- callback: (ev) => {
114
- /**
115
- * Do not dismiss the popover is we
116
- * are hovering over its trigger.
117
- * This would be easier if we used mouseover
118
- * but this would cause the event to be dispatched
119
- * more often than we would like, potentially
120
- * causing performance issues.
121
- */
122
- const element = document.elementFromPoint(ev.clientX, ev.clientY);
123
- if (element === triggerEl) {
124
- return;
125
- }
126
- popoverEl.dismiss(undefined, undefined, false);
127
- },
128
- },
129
- ];
130
- break;
131
- case 'context-menu':
132
- case 'click':
133
- default:
134
- dismissCallbacks = [
135
- {
136
- eventName: 'click',
137
- callback: (ev) => {
138
- /**
139
- * Do not dismiss the popover is we
140
- * are hovering over its trigger.
141
- */
142
- const target = ev.target;
143
- const closestTrigger = target.closest('[data-ion-popover-trigger]');
144
- if (closestTrigger === triggerEl) {
145
- /**
146
- * stopPropagation here so if the
147
- * popover has dismissOnSelect="true"
148
- * the popover does not dismiss since
149
- * we just clicked a trigger element.
150
- */
151
- ev.stopPropagation();
152
- return;
153
- }
154
- popoverEl.dismiss(undefined, undefined, false);
155
- },
156
- },
157
- ];
158
- break;
159
- }
160
- dismissCallbacks.forEach(({ eventName, callback }) => parentContentEl.addEventListener(eventName, callback));
161
- return () => {
162
- dismissCallbacks.forEach(({ eventName, callback }) => parentContentEl.removeEventListener(eventName, callback));
163
- };
164
- };
165
- /**
166
- * Configures the triggerEl to respond
167
- * to user interaction based upon the triggerAction
168
- * prop that devs have defined.
169
- */
170
- const configureTriggerInteraction = (triggerEl, triggerAction, popoverEl) => {
171
- let triggerCallbacks = [];
172
- /**
173
- * Based upon the kind of trigger interaction
174
- * the user wants, we setup the correct event
175
- * listeners.
176
- */
177
- switch (triggerAction) {
178
- case 'hover':
179
- let hoverTimeout;
180
- triggerCallbacks = [
181
- {
182
- eventName: 'mouseenter',
183
- callback: async (ev) => {
184
- ev.stopPropagation();
185
- if (hoverTimeout) {
186
- clearTimeout(hoverTimeout);
187
- }
188
- /**
189
- * Hovering over a trigger should not
190
- * immediately open the next popover.
191
- */
192
- hoverTimeout = setTimeout(() => {
193
- raf(() => {
194
- popoverEl.presentFromTrigger(ev);
195
- hoverTimeout = undefined;
196
- });
197
- }, 100);
198
- },
199
- },
200
- {
201
- eventName: 'mouseleave',
202
- callback: (ev) => {
203
- if (hoverTimeout) {
204
- clearTimeout(hoverTimeout);
205
- }
206
- /**
207
- * If mouse is over another popover
208
- * that is not this popover then we should
209
- * close this popover.
210
- */
211
- const target = ev.relatedTarget;
212
- if (!target) {
213
- return;
214
- }
215
- if (target.closest('ion-popover') !== popoverEl) {
216
- popoverEl.dismiss(undefined, undefined, false);
217
- }
218
- },
219
- },
220
- {
221
- /**
222
- * stopPropagation here prevents the popover
223
- * from dismissing when dismiss-on-select="true".
224
- */
225
- eventName: 'click',
226
- callback: (ev) => ev.stopPropagation(),
227
- },
228
- {
229
- eventName: 'ionPopoverActivateTrigger',
230
- callback: (ev) => popoverEl.presentFromTrigger(ev, true),
231
- },
232
- ];
233
- break;
234
- case 'context-menu':
235
- triggerCallbacks = [
236
- {
237
- eventName: 'contextmenu',
238
- callback: (ev) => {
239
- /**
240
- * Prevents the platform context
241
- * menu from appearing.
242
- */
243
- ev.preventDefault();
244
- popoverEl.presentFromTrigger(ev);
245
- },
246
- },
247
- {
248
- eventName: 'click',
249
- callback: (ev) => ev.stopPropagation(),
250
- },
251
- {
252
- eventName: 'ionPopoverActivateTrigger',
253
- callback: (ev) => popoverEl.presentFromTrigger(ev, true),
254
- },
255
- ];
256
- break;
257
- case 'click':
258
- default:
259
- triggerCallbacks = [
260
- {
261
- /**
262
- * Do not do a stopPropagation() here
263
- * because if you had two click triggers
264
- * then clicking the first trigger and then
265
- * clicking the second trigger would not cause
266
- * the first popover to dismiss.
267
- */
268
- eventName: 'click',
269
- callback: (ev) => popoverEl.presentFromTrigger(ev),
270
- },
271
- {
272
- eventName: 'ionPopoverActivateTrigger',
273
- callback: (ev) => popoverEl.presentFromTrigger(ev, true),
274
- },
275
- ];
276
- break;
277
- }
278
- triggerCallbacks.forEach(({ eventName, callback }) => triggerEl.addEventListener(eventName, callback));
279
- triggerEl.setAttribute('data-ion-popover-trigger', 'true');
280
- return () => {
281
- triggerCallbacks.forEach(({ eventName, callback }) => triggerEl.removeEventListener(eventName, callback));
282
- triggerEl.removeAttribute('data-ion-popover-trigger');
283
- };
284
- };
285
- /**
286
- * Returns the index of an ion-item in an array of ion-items.
287
- */
288
- const getIndexOfItem = (items, item) => {
289
- if (!item || item.tagName !== 'ION-ITEM') {
290
- return -1;
291
- }
292
- return items.findIndex((el) => el === item);
293
- };
294
- /**
295
- * Given an array of elements and a currently focused ion-item
296
- * returns the next ion-item relative to the focused one or
297
- * undefined.
298
- */
299
- const getNextItem = (items, currentItem) => {
300
- const currentItemIndex = getIndexOfItem(items, currentItem);
301
- return items[currentItemIndex + 1];
302
- };
303
- /**
304
- * Given an array of elements and a currently focused ion-item
305
- * returns the previous ion-item relative to the focused one or
306
- * undefined.
307
- */
308
- const getPrevItem = (items, currentItem) => {
309
- const currentItemIndex = getIndexOfItem(items, currentItem);
310
- return items[currentItemIndex - 1];
311
- };
312
- /** Focus the internal button of the ion-item */
313
- const focusItem = (item) => {
314
- const root = getElementRoot(item);
315
- const button = root.querySelector('button');
316
- if (button) {
317
- raf(() => button.focus());
318
- }
319
- };
320
- /**
321
- * Returns `true` if `el` has been designated
322
- * as a trigger element for an ion-popover.
323
- */
324
- const isTriggerElement = (el) => el.hasAttribute('data-ion-popover-trigger');
325
- const configureKeyboardInteraction = (popoverEl) => {
326
- const callback = async (ev) => {
327
- var _a;
328
- const activeElement = document.activeElement;
329
- let items = [];
330
- const targetTagName = (_a = ev.target) === null || _a === void 0 ? void 0 : _a.tagName;
331
- /**
332
- * Only handle custom keyboard interactions for the host popover element
333
- * and children ion-item elements.
334
- */
335
- if (targetTagName !== 'ION-POPOVER' && targetTagName !== 'ION-ITEM') {
336
- return;
337
- }
338
- /**
339
- * Complex selectors with :not() are :not supported
340
- * in older versions of Chromium so we need to do a
341
- * try/catch here so errors are not thrown.
342
- */
343
- try {
344
- /**
345
- * Select all ion-items that are not children of child popovers.
346
- * i.e. only select ion-item elements that are part of this popover
347
- */
348
- items = Array.from(popoverEl.querySelectorAll('ion-item:not(ion-popover ion-popover *):not([disabled])'));
349
- /* eslint-disable-next-line */
350
- }
351
- catch (_b) { }
352
- switch (ev.key) {
353
- /**
354
- * If we are in a child popover
355
- * then pressing the left arrow key
356
- * should close this popover and move
357
- * focus to the popover that presented
358
- * this one.
359
- */
360
- case 'ArrowLeft':
361
- const parentPopover = await popoverEl.getParentPopover();
362
- if (parentPopover) {
363
- popoverEl.dismiss(undefined, undefined, false);
364
- }
365
- break;
366
- /**
367
- * ArrowDown should move focus to the next focusable ion-item.
368
- */
369
- case 'ArrowDown':
370
- // Disable movement/scroll with keyboard
371
- ev.preventDefault();
372
- const nextItem = getNextItem(items, activeElement);
373
- if (nextItem !== undefined) {
374
- focusItem(nextItem);
375
- }
376
- break;
377
- /**
378
- * ArrowUp should move focus to the previous focusable ion-item.
379
- */
380
- case 'ArrowUp':
381
- // Disable movement/scroll with keyboard
382
- ev.preventDefault();
383
- const prevItem = getPrevItem(items, activeElement);
384
- if (prevItem !== undefined) {
385
- focusItem(prevItem);
386
- }
387
- break;
388
- /**
389
- * Home should move focus to the first focusable ion-item.
390
- */
391
- case 'Home':
392
- ev.preventDefault();
393
- const firstItem = items[0];
394
- if (firstItem !== undefined) {
395
- focusItem(firstItem);
396
- }
397
- break;
398
- /**
399
- * End should move focus to the last focusable ion-item.
400
- */
401
- case 'End':
402
- ev.preventDefault();
403
- const lastItem = items[items.length - 1];
404
- if (lastItem !== undefined) {
405
- focusItem(lastItem);
406
- }
407
- break;
408
- /**
409
- * ArrowRight, Spacebar, or Enter should activate
410
- * the currently focused trigger item to open a
411
- * popover if the element is a trigger item.
412
- */
413
- case 'ArrowRight':
414
- case ' ':
415
- case 'Enter':
416
- if (activeElement && isTriggerElement(activeElement)) {
417
- const rightEvent = new CustomEvent('ionPopoverActivateTrigger');
418
- activeElement.dispatchEvent(rightEvent);
419
- }
420
- break;
421
- }
422
- };
423
- popoverEl.addEventListener('keydown', callback);
424
- return () => popoverEl.removeEventListener('keydown', callback);
425
- };
426
- /**
427
- * Positions a popover by taking into account
428
- * the reference point, preferred side, alignment
429
- * and viewport dimensions.
430
- */
431
- const getPopoverPosition = (isRTL, contentWidth, contentHeight, arrowWidth, arrowHeight, reference, side, align, defaultPosition, triggerEl, event) => {
432
- var _a;
433
- let referenceCoordinates = {
434
- top: 0,
435
- left: 0,
436
- width: 0,
437
- height: 0,
438
- };
439
- /**
440
- * Calculate position relative to the
441
- * x-y coordinates in the event that
442
- * was passed in
443
- */
444
- switch (reference) {
445
- case 'event':
446
- if (!event) {
447
- return defaultPosition;
448
- }
449
- const mouseEv = event;
450
- referenceCoordinates = {
451
- top: mouseEv.clientY,
452
- left: mouseEv.clientX,
453
- width: 1,
454
- height: 1,
455
- };
456
- break;
457
- /**
458
- * Calculate position relative to the bounding
459
- * box on either the trigger element
460
- * specified via the `trigger` prop or
461
- * the target specified on the event
462
- * that was passed in.
463
- */
464
- case 'trigger':
465
- default:
466
- const customEv = event;
467
- /**
468
- * ionShadowTarget is used when we need to align the
469
- * popover with an element inside of the shadow root
470
- * of an Ionic component. Ex: Presenting a popover
471
- * by clicking on the collapsed indicator inside
472
- * of `ion-breadcrumb` and centering it relative
473
- * to the indicator rather than `ion-breadcrumb`
474
- * as a whole.
475
- */
476
- const actualTriggerEl = (triggerEl ||
477
- ((_a = customEv === null || customEv === void 0 ? void 0 : customEv.detail) === null || _a === void 0 ? void 0 : _a.ionShadowTarget) ||
478
- (customEv === null || customEv === void 0 ? void 0 : customEv.target));
479
- if (!actualTriggerEl) {
480
- return defaultPosition;
481
- }
482
- const triggerBoundingBox = actualTriggerEl.getBoundingClientRect();
483
- referenceCoordinates = {
484
- top: triggerBoundingBox.top,
485
- left: triggerBoundingBox.left,
486
- width: triggerBoundingBox.width,
487
- height: triggerBoundingBox.height,
488
- };
489
- break;
490
- }
491
- /**
492
- * Get top/left offset that would allow
493
- * popover to be positioned on the
494
- * preferred side of the reference.
495
- */
496
- const coordinates = calculatePopoverSide(side, referenceCoordinates, contentWidth, contentHeight, arrowWidth, arrowHeight, isRTL);
497
- /**
498
- * Get the top/left adjustments that
499
- * would allow the popover content
500
- * to have the correct alignment.
501
- */
502
- const alignedCoordinates = calculatePopoverAlign(align, side, referenceCoordinates, contentWidth, contentHeight);
503
- const top = coordinates.top + alignedCoordinates.top;
504
- const left = coordinates.left + alignedCoordinates.left;
505
- const { arrowTop, arrowLeft } = calculateArrowPosition(side, arrowWidth, arrowHeight, top, left, contentWidth, contentHeight, isRTL);
506
- const { originX, originY } = calculatePopoverOrigin(side, align, isRTL);
507
- return { top, left, referenceCoordinates, arrowTop, arrowLeft, originX, originY };
508
- };
509
- /**
510
- * Determines the transform-origin
511
- * of the popover animation so that it
512
- * is in line with what the side and alignment
513
- * prop values are. Currently only used
514
- * with the MD animation.
515
- */
516
- const calculatePopoverOrigin = (side, align, isRTL) => {
517
- switch (side) {
518
- case 'top':
519
- return { originX: getOriginXAlignment(align), originY: 'bottom' };
520
- case 'bottom':
521
- return { originX: getOriginXAlignment(align), originY: 'top' };
522
- case 'left':
523
- return { originX: 'right', originY: getOriginYAlignment(align) };
524
- case 'right':
525
- return { originX: 'left', originY: getOriginYAlignment(align) };
526
- case 'start':
527
- return { originX: isRTL ? 'left' : 'right', originY: getOriginYAlignment(align) };
528
- case 'end':
529
- return { originX: isRTL ? 'right' : 'left', originY: getOriginYAlignment(align) };
530
- }
531
- };
532
- const getOriginXAlignment = (align) => {
533
- switch (align) {
534
- case 'start':
535
- return 'left';
536
- case 'center':
537
- return 'center';
538
- case 'end':
539
- return 'right';
540
- }
541
- };
542
- const getOriginYAlignment = (align) => {
543
- switch (align) {
544
- case 'start':
545
- return 'top';
546
- case 'center':
547
- return 'center';
548
- case 'end':
549
- return 'bottom';
550
- }
551
- };
552
- /**
553
- * Calculates where the arrow positioning
554
- * should be relative to the popover content.
555
- */
556
- const calculateArrowPosition = (side, arrowWidth, arrowHeight, top, left, contentWidth, contentHeight, isRTL) => {
557
- /**
558
- * Note: When side is left, right, start, or end, the arrow is
559
- * been rotated using a `transform`, so to move the arrow up or down
560
- * by its dimension, you need to use `arrowWidth`.
561
- */
562
- const leftPosition = {
563
- arrowTop: top + contentHeight / 2 - arrowWidth / 2,
564
- arrowLeft: left + contentWidth - arrowWidth / 2,
565
- };
566
- /**
567
- * Move the arrow to the left by arrowWidth and then
568
- * again by half of its width because we have rotated
569
- * the arrow using a transform.
570
- */
571
- const rightPosition = { arrowTop: top + contentHeight / 2 - arrowWidth / 2, arrowLeft: left - arrowWidth * 1.5 };
572
- switch (side) {
573
- case 'top':
574
- return { arrowTop: top + contentHeight, arrowLeft: left + contentWidth / 2 - arrowWidth / 2 };
575
- case 'bottom':
576
- return { arrowTop: top - arrowHeight, arrowLeft: left + contentWidth / 2 - arrowWidth / 2 };
577
- case 'left':
578
- return leftPosition;
579
- case 'right':
580
- return rightPosition;
581
- case 'start':
582
- return isRTL ? rightPosition : leftPosition;
583
- case 'end':
584
- return isRTL ? leftPosition : rightPosition;
585
- default:
586
- return { arrowTop: 0, arrowLeft: 0 };
587
- }
588
- };
589
- /**
590
- * Calculates the required top/left
591
- * values needed to position the popover
592
- * content on the side specified in the
593
- * `side` prop.
594
- */
595
- const calculatePopoverSide = (side, triggerBoundingBox, contentWidth, contentHeight, arrowWidth, arrowHeight, isRTL) => {
596
- const sideLeft = {
597
- top: triggerBoundingBox.top,
598
- left: triggerBoundingBox.left - contentWidth - arrowWidth,
599
- };
600
- const sideRight = {
601
- top: triggerBoundingBox.top,
602
- left: triggerBoundingBox.left + triggerBoundingBox.width + arrowWidth,
603
- };
604
- switch (side) {
605
- case 'top':
606
- return {
607
- top: triggerBoundingBox.top - contentHeight - arrowHeight,
608
- left: triggerBoundingBox.left,
609
- };
610
- case 'right':
611
- return sideRight;
612
- case 'bottom':
613
- return {
614
- top: triggerBoundingBox.top + triggerBoundingBox.height + arrowHeight,
615
- left: triggerBoundingBox.left,
616
- };
617
- case 'left':
618
- return sideLeft;
619
- case 'start':
620
- return isRTL ? sideRight : sideLeft;
621
- case 'end':
622
- return isRTL ? sideLeft : sideRight;
623
- }
624
- };
625
- /**
626
- * Calculates the required top/left
627
- * offset values needed to provide the
628
- * correct alignment regardless while taking
629
- * into account the side the popover is on.
630
- */
631
- const calculatePopoverAlign = (align, side, triggerBoundingBox, contentWidth, contentHeight) => {
632
- switch (align) {
633
- case 'center':
634
- return calculatePopoverCenterAlign(side, triggerBoundingBox, contentWidth, contentHeight);
635
- case 'end':
636
- return calculatePopoverEndAlign(side, triggerBoundingBox, contentWidth, contentHeight);
637
- case 'start':
638
- default:
639
- return { top: 0, left: 0 };
640
- }
641
- };
642
- /**
643
- * Calculate the end alignment for
644
- * the popover. If side is on the x-axis
645
- * then the align values refer to the top
646
- * and bottom margins of the content.
647
- * If side is on the y-axis then the
648
- * align values refer to the left and right
649
- * margins of the content.
650
- */
651
- const calculatePopoverEndAlign = (side, triggerBoundingBox, contentWidth, contentHeight) => {
652
- switch (side) {
653
- case 'start':
654
- case 'end':
655
- case 'left':
656
- case 'right':
657
- return {
658
- top: -(contentHeight - triggerBoundingBox.height),
659
- left: 0,
660
- };
661
- case 'top':
662
- case 'bottom':
663
- default:
664
- return {
665
- top: 0,
666
- left: -(contentWidth - triggerBoundingBox.width),
667
- };
668
- }
669
- };
670
- /**
671
- * Calculate the center alignment for
672
- * the popover. If side is on the x-axis
673
- * then the align values refer to the top
674
- * and bottom margins of the content.
675
- * If side is on the y-axis then the
676
- * align values refer to the left and right
677
- * margins of the content.
678
- */
679
- const calculatePopoverCenterAlign = (side, triggerBoundingBox, contentWidth, contentHeight) => {
680
- switch (side) {
681
- case 'start':
682
- case 'end':
683
- case 'left':
684
- case 'right':
685
- return {
686
- top: -(contentHeight / 2 - triggerBoundingBox.height / 2),
687
- left: 0,
688
- };
689
- case 'top':
690
- case 'bottom':
691
- default:
692
- return {
693
- top: 0,
694
- left: -(contentWidth / 2 - triggerBoundingBox.width / 2),
695
- };
696
- }
697
- };
698
- /**
699
- * Adjusts popover positioning coordinates
700
- * such that popover does not appear offscreen
701
- * or overlapping safe area bounds.
702
- *
703
- * @internal - This is not part of the public API.
704
- */
705
- const calculateWindowAdjustment = (side, coordTop, coordLeft, bodyPadding, bodyWidth, bodyHeight, contentWidth, contentHeight, safeArea, contentOriginX, contentOriginY, triggerCoordinates, coordArrowTop = 0, coordArrowLeft = 0, arrowHeight = 0) => {
706
- let arrowTop = coordArrowTop;
707
- const arrowLeft = coordArrowLeft;
708
- let left = coordLeft;
709
- let top = coordTop;
710
- let bottom;
711
- let originX = contentOriginX;
712
- let originY = contentOriginY;
713
- let checkSafeAreaLeft = false;
714
- let checkSafeAreaRight = false;
715
- let checkSafeAreaTop = false;
716
- let checkSafeAreaBottom = false;
717
- const triggerTop = triggerCoordinates
718
- ? triggerCoordinates.top + triggerCoordinates.height
719
- : bodyHeight / 2 - contentHeight / 2;
720
- const triggerHeight = triggerCoordinates ? triggerCoordinates.height : 0;
721
- let addPopoverBottomClass = false;
722
- const hideArrow = false;
723
- /**
724
- * Adjust popover so it does not
725
- * go off the left of the screen.
726
- */
727
- if (left < bodyPadding + safeArea.left) {
728
- left = bodyPadding;
729
- checkSafeAreaLeft = true;
730
- originX = 'left';
731
- /**
732
- * Adjust popover so it does not
733
- * go off the right of the screen.
734
- */
735
- }
736
- else if (contentWidth + bodyPadding + left + safeArea.right > bodyWidth) {
737
- checkSafeAreaRight = true;
738
- left = bodyWidth - contentWidth - bodyPadding;
739
- originX = 'right';
740
- }
741
- /**
742
- * Adjust popover so it does not
743
- * go off the bottom of the screen
744
- * or overlap the bottom safe area.
745
- * If popover is on the left or the right of
746
- * the trigger, then we should not adjust top
747
- * margins.
748
- */
749
- if (triggerTop + triggerHeight + contentHeight > bodyHeight - safeArea.bottom &&
750
- (side === 'top' || side === 'bottom')) {
751
- /**
752
- * Calculate where the popover top would be if flipped
753
- * above the trigger. Check whether that position clears
754
- * the top safe area with room for bodyPadding.
755
- */
756
- const idealFlipTop = triggerTop - contentHeight - triggerHeight - (arrowHeight - 1);
757
- if (idealFlipTop >= safeArea.top + bodyPadding) {
758
- /**
759
- * Popover fits above the trigger without overlapping
760
- * the top safe area. Use the ideal position directly —
761
- * no safe-area CSS vars needed since it clears both edges.
762
- */
763
- top = idealFlipTop;
764
- arrowTop = top + contentHeight;
765
- originY = 'bottom';
766
- addPopoverBottomClass = true;
767
- }
768
- else {
769
- /**
770
- * Can't flip above the trigger. Constrain the bottom
771
- * edge while keeping the top near the trigger. This
772
- * creates a scrollable area anchored to the trigger.
773
- */
774
- bottom = bodyPadding;
775
- checkSafeAreaBottom = true;
776
- /**
777
- * When the trigger is near the bottom of the screen,
778
- * the calculated top may be at or past the bottom
779
- * constraint, leaving zero visible height. In that
780
- * case, pull top up to the top safe area so the
781
- * popover fills the available space between safe areas.
782
- */
783
- const bottomEdge = bodyHeight - safeArea.bottom - bodyPadding;
784
- if (top >= bottomEdge) {
785
- top = safeArea.top + bodyPadding;
786
- checkSafeAreaTop = true;
787
- }
788
- }
789
- }
790
- return {
791
- top,
792
- left,
793
- bottom,
794
- originX,
795
- originY,
796
- checkSafeAreaLeft,
797
- checkSafeAreaRight,
798
- checkSafeAreaTop,
799
- checkSafeAreaBottom,
800
- arrowTop,
801
- arrowLeft,
802
- addPopoverBottomClass,
803
- hideArrow,
804
- };
805
- };
806
- const shouldShowArrow = (side, didAdjustBounds = false, ev, trigger) => {
807
- /**
808
- * If no event provided and
809
- * we do not have a trigger,
810
- * then this popover was likely
811
- * presented via the popoverController
812
- * or users called `present` manually.
813
- * In this case, the arrow should not be
814
- * shown as we do not have a reference.
815
- */
816
- if (!ev && !trigger) {
817
- return false;
818
- }
819
- /**
820
- * If popover is on the left or the right
821
- * of a trigger, but we needed to adjust the
822
- * popover due to screen bounds, then we should
823
- * hide the arrow as it will never be pointing
824
- * at the trigger.
825
- */
826
- if (side !== 'top' && side !== 'bottom' && didAdjustBounds) {
827
- return false;
828
- }
829
- return true;
830
- };
831
-
832
- const POPOVER_IOS_BODY_PADDING = 5;
833
- /**
834
- * Minimum edge margin for iOS popovers ensures visual spacing from screen
835
- * edges on devices without safe areas (e.g., older iPhones without notches).
836
- * Previously this was a hardcoded `safeAreaMargin = 25` that served dual
837
- * purpose: safe-area avoidance AND visual spacing. Now that actual safe-area
838
- * insets are read dynamically, this floor preserves the visual spacing when
839
- * safe-area values are 0.
840
- */
841
- const POPOVER_IOS_MIN_EDGE_MARGIN = 25;
842
- /**
843
- * iOS Popover Enter Animation
844
- */
845
- // TODO(FW-2832): types
846
- const iosEnterAnimation = (baseEl, opts) => {
847
- var _a;
848
- const { event: ev, size, trigger, reference, side, align } = opts;
849
- const doc = baseEl.ownerDocument;
850
- const isRTL = doc.dir === 'rtl';
851
- const bodyWidth = doc.defaultView.innerWidth;
852
- const bodyHeight = doc.defaultView.innerHeight;
853
- const root = getElementRoot(baseEl);
854
- const contentEl = root.querySelector('.popover-content');
855
- const arrowEl = root.querySelector('.popover-arrow');
856
- const referenceSizeEl = trigger || ((_a = ev === null || ev === void 0 ? void 0 : ev.detail) === null || _a === void 0 ? void 0 : _a.ionShadowTarget) || (ev === null || ev === void 0 ? void 0 : ev.target);
857
- const { contentWidth, contentHeight } = getPopoverDimensions(size, contentEl, referenceSizeEl);
858
- const { arrowWidth, arrowHeight } = getArrowDimensions(arrowEl);
859
- const defaultPosition = {
860
- top: bodyHeight / 2 - contentHeight / 2,
861
- left: bodyWidth / 2 - contentWidth / 2,
862
- originX: isRTL ? 'right' : 'left',
863
- originY: 'top',
864
- };
865
- const results = getPopoverPosition(isRTL, contentWidth, contentHeight, arrowWidth, arrowHeight, reference, side, align, defaultPosition, trigger, ev);
866
- const padding = size === 'cover' ? 0 : POPOVER_IOS_BODY_PADDING;
867
- const rawSafeArea = getSafeAreaInsets(doc);
868
- const safeArea = size === 'cover'
869
- ? { top: 0, bottom: 0, left: 0, right: 0 }
870
- : {
871
- top: Math.max(rawSafeArea.top, POPOVER_IOS_MIN_EDGE_MARGIN),
872
- bottom: Math.max(rawSafeArea.bottom, POPOVER_IOS_MIN_EDGE_MARGIN),
873
- left: Math.max(rawSafeArea.left, POPOVER_IOS_MIN_EDGE_MARGIN),
874
- right: Math.max(rawSafeArea.right, POPOVER_IOS_MIN_EDGE_MARGIN),
875
- };
876
- const { originX, originY, top, left, bottom, checkSafeAreaLeft, checkSafeAreaRight, checkSafeAreaTop, checkSafeAreaBottom, arrowTop, arrowLeft, addPopoverBottomClass} = calculateWindowAdjustment(side, results.top, results.left, padding, bodyWidth, bodyHeight, contentWidth, contentHeight, safeArea, results.originX, results.originY, results.referenceCoordinates, results.arrowTop, results.arrowLeft, arrowHeight);
877
- const baseAnimation = createAnimation();
878
- const backdropAnimation = createAnimation();
879
- const contentAnimation = createAnimation();
880
- backdropAnimation
881
- .addElement(root.querySelector('ion-backdrop'))
882
- .fromTo('opacity', 0.01, 'var(--backdrop-opacity)')
883
- .beforeStyles({
884
- 'pointer-events': 'none',
885
- })
886
- .afterClearStyles(['pointer-events']);
887
- // In Chromium, if the wrapper animates, the backdrop filter doesn't work.
888
- // The Chromium team stated that this behavior is expected and not a bug. The element animating opacity creates a backdrop root for the backdrop-filter.
889
- // To get around this, instead of animating the wrapper, animate both the arrow and content.
890
- // https://bugs.chromium.org/p/chromium/issues/detail?id=1148826
891
- contentAnimation
892
- .addElement(root.querySelector('.popover-arrow'))
893
- .addElement(root.querySelector('.popover-content'))
894
- .fromTo('opacity', 0.01, 1);
895
- // TODO(FW-4376) Ensure that arrow also blurs when translucent
896
- return baseAnimation
897
- .easing('ease')
898
- .duration(100)
899
- .beforeAddWrite(() => {
900
- if (size === 'cover') {
901
- baseEl.style.setProperty('--width', `${contentWidth}px`);
902
- }
903
- if (addPopoverBottomClass) {
904
- baseEl.classList.add('popover-bottom');
905
- }
906
- if (bottom !== undefined) {
907
- let bottomValue = `${bottom}px`;
908
- if (checkSafeAreaBottom) {
909
- bottomValue = `${bottom}px + var(--ion-safe-area-bottom, 0px)`;
910
- }
911
- contentEl.style.setProperty('bottom', `calc(${bottomValue})`);
912
- }
913
- const safeAreaLeft = ' + var(--ion-safe-area-left, 0px)';
914
- const safeAreaRight = ' - var(--ion-safe-area-right, 0px)';
915
- let leftValue = `${left}px`;
916
- if (checkSafeAreaLeft) {
917
- leftValue = `${left}px${safeAreaLeft}`;
918
- }
919
- if (checkSafeAreaRight) {
920
- leftValue = `${left}px${safeAreaRight}`;
921
- }
922
- let topValue = `${top}px`;
923
- if (checkSafeAreaTop) {
924
- topValue = `${top}px + var(--ion-safe-area-top, 0px)`;
925
- }
926
- contentEl.style.setProperty('top', `calc(${topValue} + var(--offset-y, 0))`);
927
- contentEl.style.setProperty('left', `calc(${leftValue} + var(--offset-x, 0))`);
928
- contentEl.style.setProperty('transform-origin', `${originY} ${originX}`);
929
- if (arrowEl !== null) {
930
- const didAdjustBounds = results.top !== top || results.left !== left;
931
- const showArrow = shouldShowArrow(side, didAdjustBounds, ev, trigger);
932
- if (showArrow) {
933
- arrowEl.style.setProperty('top', `calc(${arrowTop}px + var(--offset-y, 0))`);
934
- arrowEl.style.setProperty('left', `calc(${arrowLeft}px + var(--offset-x, 0))`);
935
- }
936
- else {
937
- arrowEl.style.setProperty('display', 'none');
938
- }
939
- }
940
- })
941
- .addAnimation([backdropAnimation, contentAnimation]);
942
- };
943
-
944
- /**
945
- * iOS Popover Leave Animation
946
- */
947
- const iosLeaveAnimation = (baseEl) => {
948
- const root = getElementRoot(baseEl);
949
- const contentEl = root.querySelector('.popover-content');
950
- const arrowEl = root.querySelector('.popover-arrow');
951
- const baseAnimation = createAnimation();
952
- const backdropAnimation = createAnimation();
953
- const contentAnimation = createAnimation();
954
- backdropAnimation.addElement(root.querySelector('ion-backdrop')).fromTo('opacity', 'var(--backdrop-opacity)', 0);
955
- contentAnimation
956
- .addElement(root.querySelector('.popover-arrow'))
957
- .addElement(root.querySelector('.popover-content'))
958
- .fromTo('opacity', 0.99, 0);
959
- return baseAnimation
960
- .easing('ease')
961
- .afterAddWrite(() => {
962
- baseEl.style.removeProperty('--width');
963
- baseEl.classList.remove('popover-bottom');
964
- contentEl.style.removeProperty('top');
965
- contentEl.style.removeProperty('left');
966
- contentEl.style.removeProperty('bottom');
967
- contentEl.style.removeProperty('transform-origin');
968
- if (arrowEl) {
969
- arrowEl.style.removeProperty('top');
970
- arrowEl.style.removeProperty('left');
971
- arrowEl.style.removeProperty('display');
972
- }
973
- })
974
- .duration(300)
975
- .addAnimation([backdropAnimation, contentAnimation]);
976
- };
977
-
978
- const POPOVER_MD_BODY_PADDING = 12;
979
- /**
980
- * Md Popover Enter Animation
981
- */
982
- // TODO(FW-2832): types
983
- const mdEnterAnimation = (baseEl, opts) => {
984
- var _a;
985
- const { event: ev, size, trigger, reference, side, align } = opts;
986
- const doc = baseEl.ownerDocument;
987
- const isRTL = doc.dir === 'rtl';
988
- const bodyWidth = doc.defaultView.innerWidth;
989
- const bodyHeight = doc.defaultView.innerHeight;
990
- const root = getElementRoot(baseEl);
991
- const contentEl = root.querySelector('.popover-content');
992
- const referenceSizeEl = trigger || ((_a = ev === null || ev === void 0 ? void 0 : ev.detail) === null || _a === void 0 ? void 0 : _a.ionShadowTarget) || (ev === null || ev === void 0 ? void 0 : ev.target);
993
- const { contentWidth, contentHeight } = getPopoverDimensions(size, contentEl, referenceSizeEl);
994
- const defaultPosition = {
995
- top: bodyHeight / 2 - contentHeight / 2,
996
- left: bodyWidth / 2 - contentWidth / 2,
997
- originX: isRTL ? 'right' : 'left',
998
- originY: 'top',
999
- };
1000
- const results = getPopoverPosition(isRTL, contentWidth, contentHeight, 0, 0, reference, side, align, defaultPosition, trigger, ev);
1001
- const padding = size === 'cover' ? 0 : POPOVER_MD_BODY_PADDING;
1002
- // MD mode now applies safe-area insets (previously passed 0, ignoring all safe areas).
1003
- // This is needed for Android edge-to-edge (API 36+) where system bars overlap content.
1004
- const safeArea = size === 'cover' ? { top: 0, bottom: 0, left: 0, right: 0 } : getSafeAreaInsets(doc);
1005
- const { originX, originY, top, left, bottom, checkSafeAreaLeft, checkSafeAreaRight, checkSafeAreaTop, checkSafeAreaBottom, addPopoverBottomClass, } = calculateWindowAdjustment(side, results.top, results.left, padding, bodyWidth, bodyHeight, contentWidth, contentHeight, safeArea, results.originX, results.originY, results.referenceCoordinates);
1006
- const safeAreaLeftCalc = ' + var(--ion-safe-area-left, 0px)';
1007
- const safeAreaRightCalc = ' - var(--ion-safe-area-right, 0px)';
1008
- let leftValue = `${left}px`;
1009
- if (checkSafeAreaLeft) {
1010
- leftValue = `${left}px${safeAreaLeftCalc}`;
1011
- }
1012
- if (checkSafeAreaRight) {
1013
- leftValue = `${left}px${safeAreaRightCalc}`;
1014
- }
1015
- let topValue = `${top}px`;
1016
- if (checkSafeAreaTop) {
1017
- topValue = `${top}px + var(--ion-safe-area-top, 0px)`;
1018
- }
1019
- const baseAnimation = createAnimation();
1020
- const backdropAnimation = createAnimation();
1021
- const wrapperAnimation = createAnimation();
1022
- const contentAnimation = createAnimation();
1023
- const viewportAnimation = createAnimation();
1024
- backdropAnimation
1025
- .addElement(root.querySelector('ion-backdrop'))
1026
- .fromTo('opacity', 0.01, 'var(--backdrop-opacity)')
1027
- .beforeStyles({
1028
- 'pointer-events': 'none',
1029
- })
1030
- .afterClearStyles(['pointer-events']);
1031
- wrapperAnimation.addElement(root.querySelector('.popover-wrapper')).duration(150).fromTo('opacity', 0.01, 1);
1032
- contentAnimation
1033
- .addElement(contentEl)
1034
- .beforeStyles({
1035
- top: `calc(${topValue} + var(--offset-y, 0px))`,
1036
- left: `calc(${leftValue} + var(--offset-x, 0px))`,
1037
- 'transform-origin': `${originY} ${originX}`,
1038
- })
1039
- .beforeAddWrite(() => {
1040
- if (bottom !== undefined) {
1041
- let bottomValue = `${bottom}px`;
1042
- if (checkSafeAreaBottom) {
1043
- bottomValue = `${bottom}px + var(--ion-safe-area-bottom, 0px)`;
1044
- }
1045
- contentEl.style.setProperty('bottom', `calc(${bottomValue})`);
1046
- }
1047
- })
1048
- .fromTo('transform', 'scale(0.8)', 'scale(1)');
1049
- viewportAnimation.addElement(root.querySelector('.popover-viewport')).fromTo('opacity', 0.01, 1);
1050
- return baseAnimation
1051
- .easing('cubic-bezier(0.36,0.66,0.04,1)')
1052
- .duration(300)
1053
- .beforeAddWrite(() => {
1054
- if (size === 'cover') {
1055
- baseEl.style.setProperty('--width', `${contentWidth}px`);
1056
- }
1057
- if (addPopoverBottomClass) {
1058
- baseEl.classList.add('popover-bottom');
1059
- }
1060
- })
1061
- .addAnimation([backdropAnimation, wrapperAnimation, contentAnimation, viewportAnimation]);
1062
- };
1063
-
1064
- /**
1065
- * Md Popover Leave Animation
1066
- */
1067
- const mdLeaveAnimation = (baseEl) => {
1068
- const root = getElementRoot(baseEl);
1069
- const contentEl = root.querySelector('.popover-content');
1070
- const baseAnimation = createAnimation();
1071
- const backdropAnimation = createAnimation();
1072
- const wrapperAnimation = createAnimation();
1073
- backdropAnimation.addElement(root.querySelector('ion-backdrop')).fromTo('opacity', 'var(--backdrop-opacity)', 0);
1074
- wrapperAnimation.addElement(root.querySelector('.popover-wrapper')).fromTo('opacity', 0.99, 0);
1075
- return baseAnimation
1076
- .easing('ease')
1077
- .afterAddWrite(() => {
1078
- baseEl.style.removeProperty('--width');
1079
- baseEl.classList.remove('popover-bottom');
1080
- contentEl.style.removeProperty('top');
1081
- contentEl.style.removeProperty('left');
1082
- contentEl.style.removeProperty('bottom');
1083
- contentEl.style.removeProperty('transform-origin');
1084
- })
1085
- .duration(150)
1086
- .addAnimation([backdropAnimation, wrapperAnimation]);
1087
- };
1088
-
1089
- const popoverIosCss = ":host{--background:var(--ion-background-color, #fff);--min-width:0;--min-height:0;--max-width:auto;--height:auto;--offset-x:0px;--offset-y:0px;left:0;right:0;top:0;bottom:0;display:-ms-flexbox;display:flex;position:fixed;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;outline:none;color:var(--ion-text-color, #000);z-index:1001}:host(.popover-nested){pointer-events:none}:host(.popover-nested) .popover-wrapper{pointer-events:auto}:host(.overlay-hidden){display:none}.popover-wrapper{z-index:10}.popover-content{display:-ms-flexbox;display:flex;position:absolute;-ms-flex-direction:column;flex-direction:column;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);background:var(--background);-webkit-box-shadow:var(--box-shadow);box-shadow:var(--box-shadow);overflow:auto;z-index:10}::slotted(.popover-viewport){--ion-safe-area-top:0px;--ion-safe-area-right:0px;--ion-safe-area-bottom:0px;--ion-safe-area-left:0px;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column}:host(.popover-nested.popover-side-left){--offset-x:5px}:host(.popover-nested.popover-side-right){--offset-x:-5px}:host(.popover-nested.popover-side-start){--offset-x:5px}:host-context([dir=rtl]):host(.popover-nested.popover-side-start),:host-context([dir=rtl]).popover-nested.popover-side-start{--offset-x:-5px}@supports selector(:dir(rtl)){:host(.popover-nested.popover-side-start:dir(rtl)){--offset-x:-5px}}:host(.popover-nested.popover-side-end){--offset-x:-5px}:host-context([dir=rtl]):host(.popover-nested.popover-side-end),:host-context([dir=rtl]).popover-nested.popover-side-end{--offset-x:5px}@supports selector(:dir(rtl)){:host(.popover-nested.popover-side-end:dir(rtl)){--offset-x:5px}}:host{--width:200px;--max-height:90%;--box-shadow:none;--backdrop-opacity:var(--ion-backdrop-opacity, 0.08)}:host(.popover-desktop){--box-shadow:0px 4px 16px 0px rgba(0, 0, 0, 0.12)}.popover-content{border-radius:10px}:host(.popover-desktop) .popover-content{border:0.5px solid var(--ion-color-step-100, var(--ion-background-color-step-100, #e6e6e6))}.popover-arrow{display:block;position:absolute;width:20px;height:10px;overflow:hidden;z-index:11}.popover-arrow::after{top:3px;border-radius:3px;position:absolute;width:14px;height:14px;-webkit-transform:rotate(45deg);transform:rotate(45deg);background:var(--background);content:\"\";z-index:10}.popover-arrow::after{inset-inline-start:3px}:host(.popover-bottom) .popover-arrow{top:auto;bottom:-10px}:host(.popover-bottom) .popover-arrow::after{top:-6px}:host(.popover-side-left) .popover-arrow{-webkit-transform:rotate(90deg);transform:rotate(90deg)}:host(.popover-side-right) .popover-arrow{-webkit-transform:rotate(-90deg);transform:rotate(-90deg)}:host(.popover-side-top) .popover-arrow{-webkit-transform:rotate(180deg);transform:rotate(180deg)}:host(.popover-side-start) .popover-arrow{-webkit-transform:rotate(90deg);transform:rotate(90deg)}:host-context([dir=rtl]):host(.popover-side-start) .popover-arrow,:host-context([dir=rtl]).popover-side-start .popover-arrow{-webkit-transform:rotate(-90deg);transform:rotate(-90deg)}@supports selector(:dir(rtl)){:host(.popover-side-start:dir(rtl)) .popover-arrow{-webkit-transform:rotate(-90deg);transform:rotate(-90deg)}}:host(.popover-side-end) .popover-arrow{-webkit-transform:rotate(-90deg);transform:rotate(-90deg)}:host-context([dir=rtl]):host(.popover-side-end) .popover-arrow,:host-context([dir=rtl]).popover-side-end .popover-arrow{-webkit-transform:rotate(90deg);transform:rotate(90deg)}@supports selector(:dir(rtl)){:host(.popover-side-end:dir(rtl)) .popover-arrow{-webkit-transform:rotate(90deg);transform:rotate(90deg)}}.popover-arrow,.popover-content{opacity:0}@supports ((-webkit-backdrop-filter: blur(0)) or (backdrop-filter: blur(0))){:host(.popover-translucent) .popover-content,:host(.popover-translucent) .popover-arrow::after{background:rgba(var(--ion-background-color-rgb, 255, 255, 255), 0.8);-webkit-backdrop-filter:saturate(180%) blur(20px);backdrop-filter:saturate(180%) blur(20px)}}";
1090
-
1091
- const popoverMdCss = ":host{--background:var(--ion-background-color, #fff);--min-width:0;--min-height:0;--max-width:auto;--height:auto;--offset-x:0px;--offset-y:0px;left:0;right:0;top:0;bottom:0;display:-ms-flexbox;display:flex;position:fixed;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;outline:none;color:var(--ion-text-color, #000);z-index:1001}:host(.popover-nested){pointer-events:none}:host(.popover-nested) .popover-wrapper{pointer-events:auto}:host(.overlay-hidden){display:none}.popover-wrapper{z-index:10}.popover-content{display:-ms-flexbox;display:flex;position:absolute;-ms-flex-direction:column;flex-direction:column;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);background:var(--background);-webkit-box-shadow:var(--box-shadow);box-shadow:var(--box-shadow);overflow:auto;z-index:10}::slotted(.popover-viewport){--ion-safe-area-top:0px;--ion-safe-area-right:0px;--ion-safe-area-bottom:0px;--ion-safe-area-left:0px;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column}:host(.popover-nested.popover-side-left){--offset-x:5px}:host(.popover-nested.popover-side-right){--offset-x:-5px}:host(.popover-nested.popover-side-start){--offset-x:5px}:host-context([dir=rtl]):host(.popover-nested.popover-side-start),:host-context([dir=rtl]).popover-nested.popover-side-start{--offset-x:-5px}@supports selector(:dir(rtl)){:host(.popover-nested.popover-side-start:dir(rtl)){--offset-x:-5px}}:host(.popover-nested.popover-side-end){--offset-x:-5px}:host-context([dir=rtl]):host(.popover-nested.popover-side-end),:host-context([dir=rtl]).popover-nested.popover-side-end{--offset-x:5px}@supports selector(:dir(rtl)){:host(.popover-nested.popover-side-end:dir(rtl)){--offset-x:5px}}:host{--width:250px;--max-height:90%;--box-shadow:0 5px 5px -3px rgba(0, 0, 0, 0.2), 0 8px 10px 1px rgba(0, 0, 0, 0.14), 0 3px 14px 2px rgba(0, 0, 0, 0.12);--backdrop-opacity:var(--ion-backdrop-opacity, 0.32)}.popover-content{border-radius:4px;-webkit-transform-origin:left top;transform-origin:left top}:host-context([dir=rtl]) .popover-content{-webkit-transform-origin:right top;transform-origin:right top}[dir=rtl] .popover-content{-webkit-transform-origin:right top;transform-origin:right top}@supports selector(:dir(rtl)){.popover-content:dir(rtl){-webkit-transform-origin:right top;transform-origin:right top}}.popover-viewport{-webkit-transition-delay:100ms;transition-delay:100ms}.popover-wrapper{opacity:0}";
1092
-
1093
- const Popover = /*@__PURE__*/ proxyCustomElement(class Popover extends H {
1094
- constructor(registerHost) {
1095
- super();
1096
- if (registerHost !== false) {
1097
- this.__registerHost();
1098
- }
1099
- this.__attachShadow();
1100
- this.didPresent = createEvent(this, "ionPopoverDidPresent", 7);
1101
- this.willPresent = createEvent(this, "ionPopoverWillPresent", 7);
1102
- this.willDismiss = createEvent(this, "ionPopoverWillDismiss", 7);
1103
- this.didDismiss = createEvent(this, "ionPopoverDidDismiss", 7);
1104
- this.didPresentShorthand = createEvent(this, "didPresent", 7);
1105
- this.willPresentShorthand = createEvent(this, "willPresent", 7);
1106
- this.willDismissShorthand = createEvent(this, "willDismiss", 7);
1107
- this.didDismissShorthand = createEvent(this, "didDismiss", 7);
1108
- this.ionMount = createEvent(this, "ionMount", 7);
1109
- this.parentPopover = null;
1110
- this.coreDelegate = CoreDelegate();
1111
- this.lockController = createLockController();
1112
- this.inline = false;
1113
- this.focusDescendantOnPresent = false;
1114
- this.presented = false;
1115
- /** @internal */
1116
- this.hasController = false;
1117
- /**
1118
- * If `true`, the keyboard will be automatically dismissed when the overlay is presented.
1119
- */
1120
- this.keyboardClose = true;
1121
- /**
1122
- * If `true`, the popover will be dismissed when the backdrop is clicked.
1123
- */
1124
- this.backdropDismiss = true;
1125
- /**
1126
- * If `true`, a backdrop will be displayed behind the popover.
1127
- * This property controls whether or not the backdrop
1128
- * darkens the screen when the popover is presented.
1129
- * It does not control whether or not the backdrop
1130
- * is active or present in the DOM.
1131
- */
1132
- this.showBackdrop = true;
1133
- /**
1134
- * If `true`, the popover will be translucent.
1135
- * Only applies when the mode is `"ios"` and the device supports
1136
- * [`backdrop-filter`](https://developer.mozilla.org/en-US/docs/Web/CSS/backdrop-filter#Browser_compatibility).
1137
- */
1138
- this.translucent = false;
1139
- /**
1140
- * If `true`, the popover will animate.
1141
- */
1142
- this.animated = true;
1143
- /**
1144
- * Describes what kind of interaction with the trigger that
1145
- * should cause the popover to open. Does not apply when the `trigger`
1146
- * property is `undefined`.
1147
- * If `"click"`, the popover will be presented when the trigger is left clicked.
1148
- * If `"hover"`, the popover will be presented when a pointer hovers over the trigger.
1149
- * If `"context-menu"`, the popover will be presented when the trigger is right
1150
- * clicked on desktop and long pressed on mobile. This will also prevent your
1151
- * device's normal context menu from appearing.
1152
- */
1153
- this.triggerAction = 'click';
1154
- /**
1155
- * Describes how to calculate the popover width.
1156
- * If `"cover"`, the popover width will match the width of the trigger.
1157
- * If `"auto"`, the popover width will be set to a static default value.
1158
- */
1159
- this.size = 'auto';
1160
- /**
1161
- * If `true`, the popover will be automatically
1162
- * dismissed when the content has been clicked.
1163
- */
1164
- this.dismissOnSelect = false;
1165
- /**
1166
- * Describes what to position the popover relative to.
1167
- * If `"trigger"`, the popover will be positioned relative
1168
- * to the trigger button. If passing in an event, this is
1169
- * determined via event.target.
1170
- * If `"event"`, the popover will be positioned relative
1171
- * to the x/y coordinates of the trigger action. If passing
1172
- * in an event, this is determined via event.clientX and event.clientY.
1173
- */
1174
- this.reference = 'trigger';
1175
- /**
1176
- * Describes which side of the `reference` point to position
1177
- * the popover on. The `"start"` and `"end"` values are RTL-aware,
1178
- * and the `"left"` and `"right"` values are not.
1179
- */
1180
- this.side = 'bottom';
1181
- /**
1182
- * If `true`, the popover will display an arrow that points at the
1183
- * `reference` when running in `ios` mode. Does not apply in `md` mode.
1184
- */
1185
- this.arrow = true;
1186
- /**
1187
- * If `true`, the popover will open. If `false`, the popover will close.
1188
- * Use this if you need finer grained control over presentation, otherwise
1189
- * just use the popoverController or the `trigger` property.
1190
- * Note: `isOpen` will not automatically be set back to `false` when
1191
- * the popover dismisses. You will need to do that in your code.
1192
- */
1193
- this.isOpen = false;
1194
- /**
1195
- * @internal
1196
- *
1197
- * If `true` the popover will not register its own keyboard event handlers.
1198
- * This allows the contents of the popover to handle their own keyboard interactions.
1199
- *
1200
- * If `false`, the popover will register its own keyboard event handlers for
1201
- * navigating `ion-list` items within a popover (up/down/home/end/etc.).
1202
- * This will also cancel browser keyboard event bindings to prevent scroll
1203
- * behavior in a popover using a list of items.
1204
- */
1205
- this.keyboardEvents = false;
1206
- /**
1207
- * If `true`, focus will not be allowed to move outside of this overlay.
1208
- * If `false`, focus will be allowed to move outside of the overlay.
1209
- *
1210
- * In most scenarios this property should remain set to `true`. Setting
1211
- * this property to `false` can cause severe accessibility issues as users
1212
- * relying on assistive technologies may be able to move focus into
1213
- * a confusing state. We recommend only setting this to `false` when
1214
- * absolutely necessary.
1215
- *
1216
- * Developers may want to consider disabling focus trapping if this
1217
- * overlay presents a non-Ionic overlay from a 3rd party library.
1218
- * Developers would disable focus trapping on the Ionic overlay
1219
- * when presenting the 3rd party overlay and then re-enable
1220
- * focus trapping when dismissing the 3rd party overlay and moving
1221
- * focus back to the Ionic overlay.
1222
- */
1223
- this.focusTrap = true;
1224
- /**
1225
- * If `true`, the component passed into `ion-popover` will
1226
- * automatically be mounted when the popover is created. The
1227
- * component will remain mounted even when the popover is dismissed.
1228
- * However, the component will be destroyed when the popover is
1229
- * destroyed. This property is not reactive and should only be
1230
- * used when initially creating a popover.
1231
- *
1232
- * Note: This feature only applies to inline popovers in JavaScript
1233
- * frameworks such as Angular, React, and Vue.
1234
- */
1235
- this.keepContentsMounted = false;
1236
- this.onBackdropTap = () => {
1237
- this.dismiss(undefined, BACKDROP);
1238
- };
1239
- this.onLifecycle = (modalEvent) => {
1240
- const el = this.usersElement;
1241
- const name = LIFECYCLE_MAP[modalEvent.type];
1242
- if (el && name) {
1243
- const event = new CustomEvent(name, {
1244
- bubbles: false,
1245
- cancelable: false,
1246
- detail: modalEvent.detail,
1247
- });
1248
- el.dispatchEvent(event);
1249
- }
1250
- };
1251
- this.configureTriggerInteraction = () => {
1252
- const { trigger, triggerAction, el, destroyTriggerInteraction } = this;
1253
- if (destroyTriggerInteraction) {
1254
- destroyTriggerInteraction();
1255
- }
1256
- if (trigger === undefined) {
1257
- return;
1258
- }
1259
- const triggerEl = (this.triggerEl = trigger !== undefined ? document.getElementById(trigger) : null);
1260
- if (!triggerEl) {
1261
- printIonWarning(`[ion-popover] - A trigger element with the ID "${trigger}" was not found in the DOM. The trigger element must be in the DOM when the "trigger" property is set on ion-popover.`, this.el);
1262
- return;
1263
- }
1264
- this.destroyTriggerInteraction = configureTriggerInteraction(triggerEl, triggerAction, el);
1265
- };
1266
- this.configureKeyboardInteraction = () => {
1267
- const { destroyKeyboardInteraction, el } = this;
1268
- if (destroyKeyboardInteraction) {
1269
- destroyKeyboardInteraction();
1270
- }
1271
- this.destroyKeyboardInteraction = configureKeyboardInteraction(el);
1272
- };
1273
- this.configureDismissInteraction = () => {
1274
- const { destroyDismissInteraction, parentPopover, triggerAction, triggerEl, el } = this;
1275
- if (!parentPopover || !triggerEl) {
1276
- return;
1277
- }
1278
- if (destroyDismissInteraction) {
1279
- destroyDismissInteraction();
1280
- }
1281
- this.destroyDismissInteraction = configureDismissInteraction(triggerEl, triggerAction, el, parentPopover);
1282
- };
1283
- }
1284
- onTriggerChange() {
1285
- this.configureTriggerInteraction();
1286
- }
1287
- onIsOpenChange(newValue, oldValue) {
1288
- if (newValue === true && oldValue === false) {
1289
- this.present();
1290
- }
1291
- else if (newValue === false && oldValue === true) {
1292
- this.dismiss();
1293
- }
1294
- }
1295
- connectedCallback() {
1296
- const { configureTriggerInteraction, el } = this;
1297
- prepareOverlay(el);
1298
- configureTriggerInteraction();
1299
- }
1300
- disconnectedCallback() {
1301
- const { destroyTriggerInteraction } = this;
1302
- if (destroyTriggerInteraction) {
1303
- destroyTriggerInteraction();
1304
- }
1305
- if (this.headerResizeObserver) {
1306
- this.headerResizeObserver.disconnect();
1307
- this.headerResizeObserver = undefined;
1308
- }
1309
- }
1310
- componentWillLoad() {
1311
- var _a, _b;
1312
- const { el } = this;
1313
- const popoverId = (_b = (_a = this.htmlAttributes) === null || _a === void 0 ? void 0 : _a.id) !== null && _b !== void 0 ? _b : setOverlayId(el);
1314
- this.parentPopover = el.closest(`ion-popover:not(#${popoverId})`);
1315
- if (this.alignment === undefined) {
1316
- this.alignment = getIonMode(this) === 'ios' ? 'center' : 'start';
1317
- }
1318
- }
1319
- componentDidLoad() {
1320
- const { parentPopover, isOpen } = this;
1321
- /**
1322
- * If popover was rendered with isOpen="true"
1323
- * then we should open popover immediately.
1324
- */
1325
- if (isOpen === true) {
1326
- raf(() => this.present());
1327
- }
1328
- if (parentPopover) {
1329
- addEventListener(parentPopover, 'ionPopoverWillDismiss', () => {
1330
- this.dismiss(undefined, undefined, false);
1331
- });
1332
- }
1333
- /**
1334
- * When binding values in frameworks such as Angular
1335
- * it is possible for the value to be set after the Web Component
1336
- * initializes but before the value watcher is set up in Stencil.
1337
- * As a result, the watcher callback may not be fired.
1338
- * We work around this by manually calling the watcher
1339
- * callback when the component has loaded and the watcher
1340
- * is configured.
1341
- */
1342
- this.configureTriggerInteraction();
1343
- }
1344
- /**
1345
- * When opening a popover from a trigger, we should not be
1346
- * modifying the `event` prop from inside the component.
1347
- * Additionally, when pressing the "Right" arrow key, we need
1348
- * to shift focus to the first descendant in the newly presented
1349
- * popover.
1350
- *
1351
- * @internal
1352
- */
1353
- async presentFromTrigger(event, focusDescendant = false) {
1354
- this.focusDescendantOnPresent = focusDescendant;
1355
- await this.present(event);
1356
- this.focusDescendantOnPresent = false;
1357
- }
1358
- /**
1359
- * Determines whether or not an overlay
1360
- * is being used inline or via a controller/JS
1361
- * and returns the correct delegate.
1362
- * By default, subsequent calls to getDelegate
1363
- * will use a cached version of the delegate.
1364
- * This is useful for calling dismiss after
1365
- * present so that the correct delegate is given.
1366
- */
1367
- getDelegate(force = false) {
1368
- if (this.workingDelegate && !force) {
1369
- return {
1370
- delegate: this.workingDelegate,
1371
- inline: this.inline,
1372
- };
1373
- }
1374
- /**
1375
- * If using overlay inline
1376
- * we potentially need to use the coreDelegate
1377
- * so that this works in vanilla JS apps.
1378
- * If a developer has presented this component
1379
- * via a controller, then we can assume
1380
- * the component is already in the
1381
- * correct place.
1382
- */
1383
- const parentEl = this.el.parentNode;
1384
- const inline = (this.inline = parentEl !== null && !this.hasController);
1385
- const delegate = (this.workingDelegate = inline ? this.delegate || this.coreDelegate : this.delegate);
1386
- return { inline, delegate };
1387
- }
1388
- /**
1389
- * Present the popover overlay after it has been created.
1390
- * Developers can pass a mouse, touch, or pointer event
1391
- * to position the popover relative to where that event
1392
- * was dispatched.
1393
- *
1394
- * @param event The event to position the popover relative to.
1395
- */
1396
- async present(event) {
1397
- const unlock = await this.lockController.lock();
1398
- if (this.presented) {
1399
- unlock();
1400
- return;
1401
- }
1402
- const { el } = this;
1403
- const { inline, delegate } = this.getDelegate(true);
1404
- /**
1405
- * Emit ionMount so JS Frameworks have an opportunity
1406
- * to add the child component to the DOM. The child
1407
- * component will be assigned to this.usersElement below.
1408
- */
1409
- this.ionMount.emit();
1410
- this.usersElement = await attachComponent(delegate, el, this.component, ['popover-viewport'], this.componentProps, inline);
1411
- this.recalculateContentOnHeaderReady();
1412
- if (!this.keyboardEvents) {
1413
- this.configureKeyboardInteraction();
1414
- }
1415
- this.configureDismissInteraction();
1416
- /**
1417
- * When using the lazy loaded build of Stencil, we need to wait
1418
- * for every Stencil component instance to be ready before presenting
1419
- * otherwise there can be a flash of unstyled content. With the
1420
- * custom elements bundle we need to wait for the JS framework
1421
- * mount the inner contents of the overlay otherwise WebKit may
1422
- * get the transition incorrect.
1423
- */
1424
- if (hasLazyBuild(el)) {
1425
- await deepReady(this.usersElement);
1426
- /**
1427
- * If keepContentsMounted="true" then the
1428
- * JS Framework has already mounted the inner
1429
- * contents so there is no need to wait.
1430
- * Otherwise, we need to wait for the JS
1431
- * Framework to mount the inner contents
1432
- * of this component.
1433
- */
1434
- }
1435
- else if (!this.keepContentsMounted) {
1436
- await waitForMount();
1437
- }
1438
- await present(this, 'popoverEnter', iosEnterAnimation, mdEnterAnimation, {
1439
- event: event || this.event,
1440
- size: this.size,
1441
- trigger: this.triggerEl,
1442
- reference: this.reference,
1443
- side: this.side,
1444
- align: this.alignment,
1445
- });
1446
- /**
1447
- * If popover is nested and was
1448
- * presented using the "Right" arrow key,
1449
- * we need to move focus to the first
1450
- * descendant inside of the popover.
1451
- */
1452
- if (this.focusDescendantOnPresent) {
1453
- focusFirstDescendant(el);
1454
- }
1455
- unlock();
1456
- }
1457
- /**
1458
- * Watch the header for height changes and trigger content dimension
1459
- * recalculation when the header has a height > 0. This sets the offset-top
1460
- * of the content to the height of the header correctly.
1461
- */
1462
- recalculateContentOnHeaderReady() {
1463
- var _a;
1464
- const popoverContent = (_a = this.el.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector('.popover-content');
1465
- if (!popoverContent) {
1466
- return;
1467
- }
1468
- const contentContainer = this.usersElement || popoverContent;
1469
- const header = contentContainer.querySelector('ion-header');
1470
- const contentElements = contentContainer.querySelectorAll('ion-content');
1471
- if (!header || contentElements.length === 0) {
1472
- return;
1473
- }
1474
- this.headerResizeObserver = new ResizeObserver(async () => {
1475
- var _a;
1476
- if (header.offsetHeight > 0) {
1477
- (_a = this.headerResizeObserver) === null || _a === void 0 ? void 0 : _a.disconnect();
1478
- this.headerResizeObserver = undefined;
1479
- for (const contentEl of contentElements) {
1480
- await contentEl.recalculateDimensions();
1481
- }
1482
- }
1483
- });
1484
- this.headerResizeObserver.observe(header);
1485
- }
1486
- /**
1487
- * Dismiss the popover overlay after it has been presented.
1488
- * This is a no-op if the overlay has not been presented yet. If you want
1489
- * to remove an overlay from the DOM that was never presented, use the
1490
- * [remove](https://developer.mozilla.org/en-US/docs/Web/API/Element/remove) method.
1491
- *
1492
- * @param data Any data to emit in the dismiss events.
1493
- * @param role The role of the element that is dismissing the popover. For example, `cancel` or `backdrop`.
1494
- * @param dismissParentPopover If `true`, dismissing this popover will also dismiss
1495
- * a parent popover if this popover is nested. Defaults to `true`.
1496
- */
1497
- async dismiss(data, role, dismissParentPopover = true) {
1498
- const unlock = await this.lockController.lock();
1499
- const { destroyKeyboardInteraction, destroyDismissInteraction } = this;
1500
- if (dismissParentPopover && this.parentPopover) {
1501
- this.parentPopover.dismiss(data, role, dismissParentPopover);
1502
- }
1503
- const shouldDismiss = await dismiss(this, data, role, 'popoverLeave', iosLeaveAnimation, mdLeaveAnimation, this.event);
1504
- if (shouldDismiss) {
1505
- if (destroyKeyboardInteraction) {
1506
- destroyKeyboardInteraction();
1507
- this.destroyKeyboardInteraction = undefined;
1508
- }
1509
- if (destroyDismissInteraction) {
1510
- destroyDismissInteraction();
1511
- this.destroyDismissInteraction = undefined;
1512
- }
1513
- /**
1514
- * If using popover inline
1515
- * we potentially need to use the coreDelegate
1516
- * so that this works in vanilla JS apps
1517
- */
1518
- const { delegate } = this.getDelegate();
1519
- await detachComponent(delegate, this.usersElement);
1520
- }
1521
- unlock();
1522
- return shouldDismiss;
1523
- }
1524
- /**
1525
- * @internal
1526
- */
1527
- async getParentPopover() {
1528
- return this.parentPopover;
1529
- }
1530
- /**
1531
- * Returns a promise that resolves when the popover did dismiss.
1532
- */
1533
- onDidDismiss() {
1534
- return eventMethod(this.el, 'ionPopoverDidDismiss');
1535
- }
1536
- /**
1537
- * Returns a promise that resolves when the popover will dismiss.
1538
- */
1539
- onWillDismiss() {
1540
- return eventMethod(this.el, 'ionPopoverWillDismiss');
1541
- }
1542
- render() {
1543
- const mode = getIonMode(this);
1544
- const { onLifecycle, parentPopover, dismissOnSelect, side, arrow, htmlAttributes, focusTrap } = this;
1545
- const desktop = isPlatform('desktop');
1546
- const enableArrow = arrow && !parentPopover;
1547
- return (h(Host, Object.assign({ key: '2edd8333c630efbce59071f8a383e4326e928dbc', "aria-modal": "true", "no-router": true, tabindex: "-1" }, htmlAttributes, { style: {
1548
- zIndex: `${20000 + this.overlayIndex}`,
1549
- }, class: Object.assign(Object.assign({}, getClassMap(this.cssClass)), { [mode]: true, 'popover-translucent': this.translucent, 'overlay-hidden': true, 'popover-desktop': desktop, [`popover-side-${side}`]: true, [FOCUS_TRAP_DISABLE_CLASS]: focusTrap === false, 'popover-nested': !!parentPopover }), onIonPopoverDidPresent: onLifecycle, onIonPopoverWillPresent: onLifecycle, onIonPopoverWillDismiss: onLifecycle, onIonPopoverDidDismiss: onLifecycle, onIonBackdropTap: this.onBackdropTap }), !parentPopover && h("ion-backdrop", { key: 'aac4e68b08197534375e8ea3f8c9ea0c10ab2af4', tappable: this.backdropDismiss, visible: this.showBackdrop, part: "backdrop" }), h("div", { key: 'b7f4ebf57d4148b32856b0075d286f454be8de5d', class: "popover-wrapper ion-overlay-wrapper", onClick: dismissOnSelect ? () => this.dismiss() : undefined }, enableArrow && h("div", { key: '607d94c28d73e8e957175a7c0f6e8a99ec4dcd53', class: "popover-arrow", part: "arrow" }), h("div", { key: '4366a5a5de550c09895e923f345583508e1ec30c', class: "popover-content", part: "content" }, h("slot", { key: 'eb7886fbc99c15b667b7d825d24f1c12d9380f03' })))));
1550
- }
1551
- get el() { return this; }
1552
- static get watchers() { return {
1553
- "trigger": ["onTriggerChange"],
1554
- "triggerAction": ["onTriggerChange"],
1555
- "isOpen": ["onIsOpenChange"]
1556
- }; }
1557
- static get style() { return {
1558
- ios: popoverIosCss,
1559
- md: popoverMdCss
1560
- }; }
1561
- }, [289, "ion-popover", {
1562
- "hasController": [4, "has-controller"],
1563
- "delegate": [16],
1564
- "overlayIndex": [2, "overlay-index"],
1565
- "enterAnimation": [16],
1566
- "leaveAnimation": [16],
1567
- "component": [1],
1568
- "componentProps": [16],
1569
- "keyboardClose": [4, "keyboard-close"],
1570
- "cssClass": [1, "css-class"],
1571
- "backdropDismiss": [4, "backdrop-dismiss"],
1572
- "event": [8],
1573
- "showBackdrop": [4, "show-backdrop"],
1574
- "translucent": [4],
1575
- "animated": [4],
1576
- "htmlAttributes": [16],
1577
- "triggerAction": [1, "trigger-action"],
1578
- "trigger": [1],
1579
- "size": [1],
1580
- "dismissOnSelect": [4, "dismiss-on-select"],
1581
- "reference": [1],
1582
- "side": [1],
1583
- "alignment": [1025],
1584
- "arrow": [4],
1585
- "isOpen": [4, "is-open"],
1586
- "keyboardEvents": [4, "keyboard-events"],
1587
- "focusTrap": [4, "focus-trap"],
1588
- "keepContentsMounted": [4, "keep-contents-mounted"],
1589
- "presented": [32],
1590
- "presentFromTrigger": [64],
1591
- "present": [64],
1592
- "dismiss": [64],
1593
- "getParentPopover": [64],
1594
- "onDidDismiss": [64],
1595
- "onWillDismiss": [64]
1596
- }, undefined, {
1597
- "trigger": ["onTriggerChange"],
1598
- "triggerAction": ["onTriggerChange"],
1599
- "isOpen": ["onIsOpenChange"]
1600
- }]);
1601
- const LIFECYCLE_MAP = {
1602
- ionPopoverDidPresent: 'ionViewDidEnter',
1603
- ionPopoverWillPresent: 'ionViewWillEnter',
1604
- ionPopoverWillDismiss: 'ionViewWillLeave',
1605
- ionPopoverDidDismiss: 'ionViewDidLeave',
1606
- };
1607
- function defineCustomElement() {
1608
- if (typeof customElements === "undefined") {
1609
- return;
1610
- }
1611
- const components = ["ion-popover", "ion-backdrop"];
1612
- components.forEach(tagName => { switch (tagName) {
1613
- case "ion-popover":
1614
- if (!customElements.get(tagName)) {
1615
- customElements.define(tagName, Popover);
1616
- }
1617
- break;
1618
- case "ion-backdrop":
1619
- if (!customElements.get(tagName)) {
1620
- defineCustomElement$1();
1621
- }
1622
- break;
1623
- } });
1624
- }
1625
-
1626
- export { Popover as P, defineCustomElement as d };