@ionic/core 8.8.12-dev.11781813448.16e7a064 → 8.8.12-dev.11782342444.186b6e9c

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 (338) hide show
  1. package/components/index.js +1 -1
  2. package/components/ion-action-sheet.js +1 -1
  3. package/components/ion-alert.js +1 -1
  4. package/components/ion-back-button.js +1 -1
  5. package/components/ion-button.js +1 -1
  6. package/components/ion-card.js +1 -1
  7. package/components/ion-chip.js +1 -1
  8. package/components/ion-datetime-button.js +1 -1
  9. package/components/ion-datetime.js +1 -1
  10. package/components/ion-fab-button.js +1 -1
  11. package/components/ion-infinite-scroll-content.js +1 -1
  12. package/components/ion-input-password-toggle.js +1 -1
  13. package/components/ion-input.js +1 -1
  14. package/components/ion-item-option.js +1 -1
  15. package/components/ion-item.js +1 -1
  16. package/components/ion-loading.js +1 -1
  17. package/components/ion-menu-button.js +1 -1
  18. package/components/ion-menu.js +1 -1
  19. package/components/ion-modal.js +1 -1
  20. package/components/ion-popover.js +1 -1
  21. package/components/ion-progress-bar.js +1 -1
  22. package/components/ion-radio.js +1 -1
  23. package/components/ion-range.js +1 -1
  24. package/components/ion-refresher-content.js +1 -1
  25. package/components/ion-refresher.js +1 -1
  26. package/components/ion-reorder-group.js +1 -1
  27. package/components/ion-reorder.js +1 -1
  28. package/components/ion-ripple-effect.js +1 -1
  29. package/components/ion-router-link.js +1 -1
  30. package/components/ion-router-outlet.js +1 -1
  31. package/components/ion-row.js +1 -1
  32. package/components/ion-searchbar.js +1 -1
  33. package/components/ion-segment-button.js +1 -1
  34. package/components/ion-segment-content.js +1 -1
  35. package/components/ion-segment-view.js +1 -1
  36. package/components/ion-segment.js +1 -1
  37. package/components/ion-select-modal.js +1 -1
  38. package/components/ion-select-option.js +1 -1
  39. package/components/ion-select-popover.js +1 -1
  40. package/components/ion-select.js +1 -1
  41. package/components/ion-skeleton-text.js +1 -1
  42. package/components/ion-spinner.js +1 -1
  43. package/components/ion-split-pane.js +1 -1
  44. package/components/ion-tab-bar.js +1 -1
  45. package/components/ion-tab-button.js +1 -1
  46. package/components/ion-tab.js +1 -1
  47. package/components/ion-tabs.js +1 -1
  48. package/components/ion-text.js +1 -1
  49. package/components/ion-textarea.js +1 -1
  50. package/components/ion-thumbnail.js +1 -1
  51. package/components/ion-title.js +1 -1
  52. package/components/ion-toast.js +1 -1
  53. package/components/ion-toggle.js +1 -1
  54. package/components/ion-toolbar.js +1 -1
  55. package/components/p-BSQPZ79H.js +4 -0
  56. package/components/p-BwKpO3Is.js +4 -0
  57. package/components/p-C6x7QJKS.js +4 -0
  58. package/components/p-CHzfYZbv.js +4 -0
  59. package/components/p-CMpqV7Co.js +4 -0
  60. package/components/p-CWo79Ftj.js +4 -0
  61. package/components/p-CgGiBa26.js +4 -0
  62. package/components/p-D4h1H_hh.js +4 -0
  63. package/components/{p-C2lKgrXx.js → p-DEBD4LvH.js} +1 -1
  64. package/components/{p-BSEgsdFI.js → p-DhkITZ-y.js} +1 -1
  65. package/components/p-DiCu-HwG.js +4 -0
  66. package/components/{p-5bE_Wz4Y.js → p-DpV-p5Xs.js} +1 -1
  67. package/components/{p-Cfx4M1Bn.js → p-Dz74mwlk.js} +1 -1
  68. package/components/p-VlRjwhIK.js +4 -0
  69. package/components/{p-BLmJ0zRm.js → p-XJWMAP8m.js} +1 -1
  70. package/components/{p-B60hm8Qv.js → p-r0aq7dpt.js} +1 -1
  71. package/components/p-uTR_dEqg.js +4 -0
  72. package/components/{p-rCa2eL0j.js → p-wk2QqrAo.js} +1 -1
  73. package/dist/cjs/config-DWdFbSNK.js +35 -0
  74. package/dist/cjs/index-C147NqgL.js +414 -0
  75. package/dist/cjs/index.cjs.js +6 -6
  76. package/dist/cjs/ion-action-sheet.cjs.entry.js +27 -7
  77. package/dist/cjs/ion-alert.cjs.entry.js +64 -25
  78. package/dist/cjs/ion-app_8.cjs.entry.js +23 -9
  79. package/dist/cjs/ion-avatar_3.cjs.entry.js +1 -1
  80. package/dist/cjs/ion-col_3.cjs.entry.js +1 -1
  81. package/dist/cjs/{ion-datetime_3.cjs.entry.js → ion-datetime.cjs.entry.js} +1 -639
  82. package/dist/cjs/ion-infinite-scroll_2.cjs.entry.js +3 -2
  83. package/dist/cjs/ion-input.cjs.entry.js +4 -4
  84. package/dist/cjs/ion-item_8.cjs.entry.js +2 -2
  85. package/dist/cjs/ion-loading.cjs.entry.js +10 -5
  86. package/dist/cjs/ion-menu_3.cjs.entry.js +1 -1
  87. package/dist/cjs/ion-modal.cjs.entry.js +21 -10
  88. package/dist/cjs/ion-popover.cjs.entry.js +9 -5
  89. package/dist/cjs/ion-progress-bar.cjs.entry.js +1 -1
  90. package/dist/cjs/ion-radio_2.cjs.entry.js +3 -3
  91. package/dist/cjs/ion-range.cjs.entry.js +3 -3
  92. package/dist/cjs/ion-refresher_2.cjs.entry.js +6 -5
  93. package/dist/cjs/ion-reorder_2.cjs.entry.js +2 -2
  94. package/dist/cjs/ion-ripple-effect.cjs.entry.js +1 -1
  95. package/dist/cjs/ion-route_4.cjs.entry.js +2 -2
  96. package/dist/cjs/ion-searchbar.cjs.entry.js +5 -5
  97. package/dist/cjs/ion-segment-content.cjs.entry.js +1 -1
  98. package/dist/cjs/ion-segment-view.cjs.entry.js +2 -2
  99. package/dist/cjs/ion-segment_2.cjs.entry.js +4 -4
  100. package/dist/cjs/ion-select-modal.cjs.entry.js +84 -30
  101. package/dist/cjs/ion-select_3.cjs.entry.js +406 -48
  102. package/dist/cjs/ion-spinner.cjs.entry.js +1 -1
  103. package/dist/cjs/ion-split-pane.cjs.entry.js +2 -2
  104. package/dist/cjs/ion-tab-bar_2.cjs.entry.js +4 -4
  105. package/dist/cjs/ion-tab_2.cjs.entry.js +3 -3
  106. package/dist/cjs/ion-text.cjs.entry.js +2 -2
  107. package/dist/cjs/ion-textarea.cjs.entry.js +2 -2
  108. package/dist/cjs/ion-toast.cjs.entry.js +6 -5
  109. package/dist/cjs/ion-toggle.cjs.entry.js +3 -3
  110. package/dist/cjs/ionic.cjs.js +1 -1
  111. package/dist/cjs/loader.cjs.js +1 -1
  112. package/dist/cjs/overlay-control-label-D2sdL2O8.js +50 -0
  113. package/dist/cjs/{overlays-TbKsuC-K.js → overlays-DSmSrd_4.js} +26 -7
  114. package/dist/cjs/select-option-render-BUmJxlqW.js +116 -0
  115. package/dist/collection/collection-manifest.json +6 -10
  116. package/dist/collection/components/action-sheet/action-sheet.ios.css +229 -2
  117. package/dist/collection/components/action-sheet/action-sheet.js +24 -5
  118. package/dist/collection/components/action-sheet/action-sheet.md.css +175 -2
  119. package/dist/collection/components/alert/alert.ios.css +280 -10
  120. package/dist/collection/components/alert/alert.js +59 -21
  121. package/dist/collection/components/alert/alert.md.css +269 -20
  122. package/dist/collection/components/input/input.js +8 -8
  123. package/dist/collection/components/loading/loading.js +7 -3
  124. package/dist/collection/components/modal/modal.js +23 -12
  125. package/dist/collection/components/popover/popover.ios.css +15 -0
  126. package/dist/collection/components/popover/popover.js +7 -3
  127. package/dist/collection/components/popover/popover.md.css +15 -0
  128. package/dist/collection/components/progress-bar/progress-bar.js +1 -1
  129. package/dist/collection/components/radio/radio.js +4 -4
  130. package/dist/collection/components/range/range.js +3 -3
  131. package/dist/collection/components/refresher/refresher.js +1 -1
  132. package/dist/collection/components/refresher-content/refresher-content.js +1 -1
  133. package/dist/collection/components/reorder/reorder.js +1 -1
  134. package/dist/collection/components/reorder-group/reorder-group.js +1 -1
  135. package/dist/collection/components/ripple-effect/ripple-effect.js +1 -1
  136. package/dist/collection/components/router-link/router-link.js +2 -2
  137. package/dist/collection/components/router-outlet/router-outlet.js +38 -5
  138. package/dist/collection/components/row/row.js +1 -1
  139. package/dist/collection/components/searchbar/searchbar.js +9 -9
  140. package/dist/collection/components/segment/segment.js +2 -2
  141. package/dist/collection/components/segment-button/segment-button.js +2 -2
  142. package/dist/collection/components/segment-content/segment-content.js +1 -1
  143. package/dist/collection/components/segment-view/segment-view.js +2 -2
  144. package/dist/collection/components/select/select.ios.css +33 -0
  145. package/dist/collection/components/select/select.js +323 -16
  146. package/dist/collection/components/select/select.md.css +33 -0
  147. package/dist/collection/components/select-modal/select-modal.ios.css +219 -0
  148. package/dist/collection/components/select-modal/select-modal.js +79 -26
  149. package/dist/collection/components/select-modal/select-modal.md.css +165 -0
  150. package/dist/collection/components/select-option/select-option.js +65 -1
  151. package/dist/collection/components/select-popover/select-popover.ios.css +219 -0
  152. package/dist/collection/components/select-popover/select-popover.js +78 -26
  153. package/dist/collection/components/select-popover/select-popover.md.css +165 -0
  154. package/dist/collection/components/skeleton-text/skeleton-text.js +2 -2
  155. package/dist/collection/components/spinner/spinner.js +1 -1
  156. package/dist/collection/components/split-pane/split-pane.js +2 -2
  157. package/dist/collection/components/tab/tab.js +2 -2
  158. package/dist/collection/components/tab-bar/tab-bar.js +2 -2
  159. package/dist/collection/components/tab-button/tab-button.js +2 -2
  160. package/dist/collection/components/tabs/tabs.js +1 -1
  161. package/dist/collection/components/text/text.js +2 -2
  162. package/dist/collection/components/textarea/textarea.js +2 -2
  163. package/dist/collection/components/thumbnail/thumbnail.js +1 -1
  164. package/dist/collection/components/title/title.js +2 -2
  165. package/dist/collection/components/toast/toast.js +2 -2
  166. package/dist/collection/components/toggle/toggle.js +3 -3
  167. package/dist/collection/components/toolbar/toolbar.js +2 -2
  168. package/dist/collection/index.js +1 -1
  169. package/dist/collection/utils/overlay-control-label.js +45 -0
  170. package/dist/collection/utils/overlays.js +25 -6
  171. package/dist/collection/utils/sanitization/index.js +255 -14
  172. package/dist/collection/utils/select-option-render.js +111 -0
  173. package/dist/docs.json +479 -1175
  174. package/dist/esm/config-BwKpO3Is.js +31 -0
  175. package/dist/esm/{index-DV3sJJW8.js → index-AlrZKoWR.js} +1 -1
  176. package/dist/esm/index-CtAGDdQq.js +409 -0
  177. package/dist/esm/index.js +3 -2
  178. package/dist/esm/ion-accordion_2.entry.js +1 -1
  179. package/dist/esm/ion-action-sheet.entry.js +27 -7
  180. package/dist/esm/ion-alert.entry.js +63 -24
  181. package/dist/esm/ion-app_8.entry.js +23 -9
  182. package/dist/esm/ion-avatar_3.entry.js +1 -1
  183. package/dist/esm/ion-back-button.entry.js +1 -1
  184. package/dist/esm/ion-breadcrumb_2.entry.js +1 -1
  185. package/dist/esm/ion-col_3.entry.js +1 -1
  186. package/dist/esm/{ion-datetime_3.entry.js → ion-datetime.entry.js} +5 -641
  187. package/dist/esm/ion-fab_3.entry.js +1 -1
  188. package/dist/esm/ion-infinite-scroll_2.entry.js +2 -1
  189. package/dist/esm/ion-input-password-toggle.entry.js +1 -1
  190. package/dist/esm/ion-input.entry.js +5 -5
  191. package/dist/esm/ion-item_8.entry.js +3 -3
  192. package/dist/esm/ion-loading.entry.js +9 -4
  193. package/dist/esm/ion-menu_3.entry.js +2 -2
  194. package/dist/esm/ion-modal.entry.js +21 -10
  195. package/dist/esm/ion-popover.entry.js +9 -5
  196. package/dist/esm/ion-progress-bar.entry.js +1 -1
  197. package/dist/esm/ion-radio_2.entry.js +3 -3
  198. package/dist/esm/ion-range.entry.js +3 -3
  199. package/dist/esm/ion-refresher_2.entry.js +5 -4
  200. package/dist/esm/ion-reorder_2.entry.js +3 -3
  201. package/dist/esm/ion-ripple-effect.entry.js +1 -1
  202. package/dist/esm/ion-route_4.entry.js +2 -2
  203. package/dist/esm/ion-searchbar.entry.js +6 -6
  204. package/dist/esm/ion-segment-content.entry.js +1 -1
  205. package/dist/esm/ion-segment-view.entry.js +2 -2
  206. package/dist/esm/ion-segment_2.entry.js +4 -4
  207. package/dist/esm/ion-select-modal.entry.js +84 -30
  208. package/dist/esm/ion-select_3.entry.js +409 -51
  209. package/dist/esm/ion-spinner.entry.js +1 -1
  210. package/dist/esm/ion-split-pane.entry.js +2 -2
  211. package/dist/esm/ion-tab-bar_2.entry.js +4 -4
  212. package/dist/esm/ion-tab_2.entry.js +3 -3
  213. package/dist/esm/ion-text.entry.js +2 -2
  214. package/dist/esm/ion-textarea.entry.js +2 -2
  215. package/dist/esm/ion-toast.entry.js +5 -4
  216. package/dist/esm/ion-toggle.entry.js +4 -4
  217. package/dist/esm/ionic.js +1 -1
  218. package/dist/esm/loader.js +1 -1
  219. package/dist/esm/overlay-control-label-BSQPZ79H.js +47 -0
  220. package/dist/esm/{overlays-TbiM4mdr.js → overlays-DLNOHWNc.js} +26 -7
  221. package/dist/esm/select-option-render-CZcvbJ--.js +114 -0
  222. package/dist/html.html-data.json +50 -78
  223. package/dist/ionic/index.esm.js +1 -1
  224. package/dist/ionic/ionic.esm.js +1 -1
  225. package/dist/ionic/p-0feac19e.entry.js +4 -0
  226. package/dist/ionic/{p-8fce95d5.entry.js → p-14095ba5.entry.js} +1 -1
  227. package/dist/ionic/p-1c5a5a59.entry.js +4 -0
  228. package/dist/ionic/{p-3a126bca.entry.js → p-259d0d98.entry.js} +1 -1
  229. package/dist/ionic/{p-fabcce6c.entry.js → p-341032b3.entry.js} +1 -1
  230. package/dist/ionic/{p-3a7d1e91.entry.js → p-4502a274.entry.js} +1 -1
  231. package/dist/ionic/p-4621c387.entry.js +4 -0
  232. package/dist/ionic/p-4bb3eb60.entry.js +4 -0
  233. package/dist/ionic/{p-874b4bd8.entry.js → p-51cd1643.entry.js} +1 -1
  234. package/dist/ionic/p-5be4fdc3.entry.js +4 -0
  235. package/dist/ionic/p-5c3ec490.entry.js +4 -0
  236. package/dist/ionic/p-5d1ac2c7.entry.js +4 -0
  237. package/dist/ionic/p-5x6vmGTf.js +4 -0
  238. package/dist/ionic/{p-3ae5f277.entry.js → p-627fabd9.entry.js} +1 -1
  239. package/dist/ionic/{p-e0be05c5.entry.js → p-629e4703.entry.js} +1 -1
  240. package/dist/ionic/p-74c540f5.entry.js +4 -0
  241. package/dist/ionic/{p-5d1da0a2.entry.js → p-76e92a84.entry.js} +1 -1
  242. package/dist/ionic/p-79a36078.entry.js +4 -0
  243. package/dist/ionic/{p-9f1103ce.entry.js → p-7a37b3ce.entry.js} +1 -1
  244. package/dist/ionic/{p-3353c229.entry.js → p-80b44b3c.entry.js} +1 -1
  245. package/dist/ionic/p-8d624ee5.entry.js +4 -0
  246. package/dist/ionic/p-8e00858b.entry.js +4 -0
  247. package/dist/ionic/{p-390ca786.entry.js → p-9177f4ac.entry.js} +1 -1
  248. package/dist/ionic/{p-DV3sJJW8.js → p-AlrZKoWR.js} +1 -1
  249. package/dist/ionic/p-BSQPZ79H.js +4 -0
  250. package/dist/ionic/p-BwKpO3Is.js +4 -0
  251. package/dist/ionic/p-Cg5-OQYy.js +4 -0
  252. package/dist/ionic/p-D3I30-jC.js +4 -0
  253. package/dist/ionic/{p-4858af1f.entry.js → p-a5213260.entry.js} +1 -1
  254. package/dist/ionic/{p-37e720da.entry.js → p-a7628bc7.entry.js} +1 -1
  255. package/dist/ionic/p-aedf1108.entry.js +4 -0
  256. package/dist/ionic/{p-ef4c3bee.entry.js → p-b1599fca.entry.js} +1 -1
  257. package/dist/ionic/{p-84d5ce05.entry.js → p-b9ac1fe0.entry.js} +1 -1
  258. package/dist/ionic/p-c11135d4.entry.js +4 -0
  259. package/dist/ionic/p-c4156e73.entry.js +4 -0
  260. package/dist/ionic/{p-94f2a736.entry.js → p-c93553d2.entry.js} +1 -1
  261. package/dist/ionic/p-ce7992c4.entry.js +4 -0
  262. package/dist/ionic/{p-75dc25ba.entry.js → p-d2c7f046.entry.js} +1 -1
  263. package/dist/ionic/{p-c4d8641b.entry.js → p-d8387b99.entry.js} +1 -1
  264. package/dist/ionic/{p-9a65ac7f.entry.js → p-db1b6738.entry.js} +1 -1
  265. package/dist/ionic/p-ed797c72.entry.js +4 -0
  266. package/dist/ionic/{p-8eb8ee76.entry.js → p-ef93ca92.entry.js} +1 -1
  267. package/dist/ionic/p-f09f9642.entry.js +4 -0
  268. package/dist/ionic/p-f1c06f82.entry.js +4 -0
  269. package/dist/ionic/{p-0fa9c382.entry.js → p-fe4aa1db.entry.js} +1 -1
  270. package/dist/types/components/input/input.d.ts +1 -1
  271. package/dist/types/components/modal/modal.d.ts +11 -4
  272. package/dist/types/components/router-outlet/router-outlet.d.ts +7 -0
  273. package/dist/types/components/searchbar/searchbar.d.ts +1 -1
  274. package/dist/types/components/select/select-interface.d.ts +31 -0
  275. package/dist/types/components/select/select.d.ts +18 -0
  276. package/dist/types/components/select-option/select-option.d.ts +41 -0
  277. package/dist/types/components.d.ts +58 -286
  278. package/dist/types/index.d.ts +1 -1
  279. package/dist/types/interface.d.ts +0 -1
  280. package/dist/types/utils/config.d.ts +0 -8
  281. package/dist/types/utils/overlay-control-label.d.ts +32 -0
  282. package/dist/types/utils/overlays.d.ts +11 -9
  283. package/dist/types/utils/sanitization/index.d.ts +54 -2
  284. package/dist/types/utils/select-option-render.d.ts +53 -0
  285. package/hydrate/index.js +1376 -1141
  286. package/hydrate/index.mjs +1376 -1141
  287. package/package.json +37 -5
  288. package/components/ion-picker-legacy-column.d.ts +0 -11
  289. package/components/ion-picker-legacy-column.js +0 -4
  290. package/components/ion-picker-legacy.d.ts +0 -11
  291. package/components/ion-picker-legacy.js +0 -4
  292. package/components/p-0NRupjzW.js +0 -4
  293. package/components/p-Bth-EzJ0.js +0 -4
  294. package/components/p-CU5rbWAW.js +0 -4
  295. package/components/p-DDWp95gH.js +0 -4
  296. package/components/p-W9CZ2mWX.js +0 -4
  297. package/components/p-dhLYXa7A.js +0 -4
  298. package/components/p-k_E4tX5Z.js +0 -4
  299. package/components/p-nQi4oKcG.js +0 -4
  300. package/components/p-uVRyUM3z.js +0 -4
  301. package/dist/cjs/config-xninhj0J.js +0 -201
  302. package/dist/collection/components/picker-legacy/animations/ios.enter.js +0 -27
  303. package/dist/collection/components/picker-legacy/animations/ios.leave.js +0 -23
  304. package/dist/collection/components/picker-legacy/picker-interface.js +0 -1
  305. package/dist/collection/components/picker-legacy/picker.ios.css +0 -300
  306. package/dist/collection/components/picker-legacy/picker.js +0 -890
  307. package/dist/collection/components/picker-legacy/picker.md.css +0 -287
  308. package/dist/collection/components/picker-legacy-column/picker-column.ios.css +0 -231
  309. package/dist/collection/components/picker-legacy-column/picker-column.js +0 -422
  310. package/dist/collection/components/picker-legacy-column/picker-column.md.css +0 -222
  311. package/dist/collection/components/picker-legacy-column/test/test.utils.js +0 -43
  312. package/dist/esm/config-DQCONYYp.js +0 -195
  313. package/dist/ionic/p-00dbb17e.entry.js +0 -4
  314. package/dist/ionic/p-01f81ea5.entry.js +0 -4
  315. package/dist/ionic/p-0d005398.entry.js +0 -4
  316. package/dist/ionic/p-20b1a044.entry.js +0 -4
  317. package/dist/ionic/p-21eb76d5.entry.js +0 -4
  318. package/dist/ionic/p-27d30585.entry.js +0 -4
  319. package/dist/ionic/p-2bb2cb18.entry.js +0 -4
  320. package/dist/ionic/p-2f55dc1a.entry.js +0 -4
  321. package/dist/ionic/p-30bf9737.entry.js +0 -4
  322. package/dist/ionic/p-3a541154.entry.js +0 -4
  323. package/dist/ionic/p-485fda23.entry.js +0 -4
  324. package/dist/ionic/p-4baa5b82.entry.js +0 -4
  325. package/dist/ionic/p-4dc1c33c.entry.js +0 -4
  326. package/dist/ionic/p-5fc7e542.entry.js +0 -4
  327. package/dist/ionic/p-DzWaWHGc.js +0 -4
  328. package/dist/ionic/p-a21add2f.entry.js +0 -4
  329. package/dist/ionic/p-aa5d6b8f.entry.js +0 -4
  330. package/dist/ionic/p-e847a888.entry.js +0 -4
  331. package/dist/ionic/p-ec090e0a.entry.js +0 -4
  332. package/dist/ionic/p-xOfi7-Zn.js +0 -4
  333. package/dist/types/components/picker-legacy/animations/ios.enter.d.ts +0 -5
  334. package/dist/types/components/picker-legacy/animations/ios.leave.d.ts +0 -5
  335. package/dist/types/components/picker-legacy/picker-interface.d.ts +0 -52
  336. package/dist/types/components/picker-legacy/picker.d.ts +0 -158
  337. package/dist/types/components/picker-legacy-column/picker-column.d.ts +0 -46
  338. package/dist/types/components/picker-legacy-column/test/test.utils.d.ts +0 -9
@@ -5,7 +5,7 @@ import { Host, h } from "@stencil/core";
5
5
  import { getIonMode } from "../../global/ionic-global";
6
6
  export class Thumbnail {
7
7
  render() {
8
- return (h(Host, { key: 'b250e01664238f1dca8f9757b15bc3d5d9387ffa', class: getIonMode(this) }, h("slot", { key: '72cb568bccabc983c5186a7596ef6c6d4ebf5ad9' })));
8
+ return (h(Host, { key: '833e947c683b482a78f8f0df8c9a68e99478bbaa', class: getIonMode(this) }, h("slot", { key: '6d1e9e686db88d91379f14121058dbf035d8ded2' })));
9
9
  }
10
10
  static get is() { return "ion-thumbnail"; }
11
11
  static get encapsulation() { return "shadow"; }
@@ -23,11 +23,11 @@ export class ToolbarTitle {
23
23
  render() {
24
24
  const mode = getIonMode(this);
25
25
  const size = this.getSize();
26
- return (h(Host, { key: '44e63f8439df64c470692904427b417e19406476', class: createColorClasses(this.color, {
26
+ return (h(Host, { key: 'd9317e8e66cb6112717f5a9c252658777efbd873', class: createColorClasses(this.color, {
27
27
  [mode]: true,
28
28
  [`title-${size}`]: true,
29
29
  'title-rtl': document.dir === 'rtl',
30
- }) }, h("div", { key: '784cf60a0db16045391891cc8fad0c7dbeba4039', class: "toolbar-title" }, h("slot", { key: '0c720a50479ba257e8756337aeb9b0ab7516a227' }))));
30
+ }) }, h("div", { key: 'a4d011d6d409bf006d8efe33667002edb109820a', class: "toolbar-title" }, h("slot", { key: '4ca3303b957a0e5387f1e9058e5adb4c6275afcc' }))));
31
31
  }
32
32
  static get is() { return "ion-title"; }
33
33
  static get encapsulation() { return "shadow"; }
@@ -417,9 +417,9 @@ export class Toast {
417
417
  if (layout === 'stacked' && startButtons.length > 0 && endButtons.length > 0) {
418
418
  printIonWarning('[ion-toast] - This toast is using start and end buttons with the stacked toast layout. We recommend following the best practice of using either start or end buttons with the stacked toast layout.', el);
419
419
  }
420
- return (h(Host, Object.assign({ key: 'b5256edcf33d0ef51e6c5080c84e1ca58abe2ae0', tabindex: "-1" }, this.htmlAttributes, { style: {
420
+ return (h(Host, Object.assign({ key: '2acb2cd2e12ea0082986495929e4a596d4da2f38', tabindex: "-1" }, this.htmlAttributes, { style: {
421
421
  zIndex: `${60000 + this.overlayIndex}`,
422
- }, class: createColorClasses(this.color, Object.assign(Object.assign({ [mode]: true }, getClassMap(this.cssClass)), { 'overlay-hidden': true, 'toast-translucent': this.translucent })), onIonToastWillDismiss: this.dispatchCancelHandler }), h("div", { key: '0860f7e895d8bc66e44c4d924ca569f4cbb1a749', class: wrapperClass, part: "wrapper" }, h("div", { key: '28784199c880a3f664677c8f5560b7caa8903251', class: "toast-container", part: "container" }, this.renderButtons(startButtons, 'start'), this.icon !== undefined && (h("ion-icon", { key: '0a63ba1336ad43d2aec14e49055eb46c112359c2', class: "toast-icon", part: "icon", icon: this.icon, lazy: false, "aria-hidden": "true" })), h("div", { key: 'ecec8107af582dc55d4b3828dd7f3054a29f26b1', class: "toast-content", part: "content", role: "status", "aria-atomic": "true", "aria-live": "polite" }, !revealContentToScreenReader && header !== undefined && this.renderHeader('oldHeader', 'true'), !revealContentToScreenReader && message !== undefined && this.renderToastMessage('oldMessage', 'true'), revealContentToScreenReader && header !== undefined && this.renderHeader('header'), revealContentToScreenReader && message !== undefined && this.renderToastMessage('header')), this.renderButtons(endButtons, 'end')))));
422
+ }, class: createColorClasses(this.color, Object.assign(Object.assign({ [mode]: true }, getClassMap(this.cssClass)), { 'overlay-hidden': true, 'toast-translucent': this.translucent })), onIonToastWillDismiss: this.dispatchCancelHandler }), h("div", { key: '8b24ba5d3d51d1ab94b9bf6bb5d6e4b8bb3248a7', class: wrapperClass, part: "wrapper" }, h("div", { key: 'e1ebdf4f0425cc7b1e2688667ee9a2b3c545804a', class: "toast-container", part: "container" }, this.renderButtons(startButtons, 'start'), this.icon !== undefined && (h("ion-icon", { key: '552b1ab8f4e72882cc8e878579c7a594119677e1', class: "toast-icon", part: "icon", icon: this.icon, lazy: false, "aria-hidden": "true" })), h("div", { key: '8ac8d64f632fbedadb180132c83043474466bee0', class: "toast-content", part: "content", role: "status", "aria-atomic": "true", "aria-live": "polite" }, !revealContentToScreenReader && header !== undefined && this.renderHeader('oldHeader', 'true'), !revealContentToScreenReader && message !== undefined && this.renderToastMessage('oldMessage', 'true'), revealContentToScreenReader && header !== undefined && this.renderHeader('header'), revealContentToScreenReader && message !== undefined && this.renderToastMessage('header')), this.renderButtons(endButtons, 'end')))));
423
423
  }
424
424
  static get is() { return "ion-toast"; }
425
425
  static get encapsulation() { return "shadow"; }
@@ -287,7 +287,7 @@ export class Toggle {
287
287
  const value = this.getValue();
288
288
  const rtl = isRTL(el) ? 'rtl' : 'ltr';
289
289
  renderHiddenInput(true, el, name, checked ? value : '', disabled);
290
- return (h(Host, { key: '736e1dcfca34fd41f6f0632652e7f86d6996a232', role: "switch", "aria-checked": `${checked}`, "aria-describedby": this.hintTextId, "aria-invalid": this.isInvalid ? 'true' : undefined, onClick: this.onClick, "aria-labelledby": hasLabel ? inputLabelId : null, "aria-label": inheritedAttributes['aria-label'] || null, "aria-disabled": disabled ? 'true' : null, "aria-required": required ? 'true' : undefined, tabindex: disabled ? undefined : 0, onKeyDown: this.onKeyDown, onFocus: this.onFocus, onBlur: this.onBlur, class: createColorClasses(color, {
290
+ return (h(Host, { key: 'ab093ddb505af61685cbb8571af1e765fc0292f8', role: "switch", "aria-checked": `${checked}`, "aria-describedby": this.hintTextId, "aria-invalid": this.isInvalid ? 'true' : undefined, onClick: this.onClick, "aria-labelledby": hasLabel ? inputLabelId : null, "aria-label": inheritedAttributes['aria-label'] || null, "aria-disabled": disabled ? 'true' : null, "aria-required": required ? 'true' : undefined, tabindex: disabled ? undefined : 0, onKeyDown: this.onKeyDown, onFocus: this.onFocus, onBlur: this.onBlur, class: createColorClasses(color, {
291
291
  [mode]: true,
292
292
  'in-item': hostContext('ion-item', el),
293
293
  'toggle-activated': activated,
@@ -297,10 +297,10 @@ export class Toggle {
297
297
  [`toggle-alignment-${alignment}`]: alignment !== undefined,
298
298
  [`toggle-label-placement-${labelPlacement}`]: true,
299
299
  [`toggle-${rtl}`]: true,
300
- }) }, h("label", { key: 'e697739fd3964c1c6c23331cf7e38a9841c46a6a', class: "toggle-wrapper", htmlFor: inputId }, h("input", Object.assign({ key: '3d500b8c1bc879591249d183c1abb3f5f26aff6b', type: "checkbox", role: "switch", "aria-checked": `${checked}`, checked: checked, disabled: disabled, id: inputId, required: required }, inheritedAttributes)), h("div", { key: 'e38f3fe0e66b4ca434fd81514f5ef771c2960841', class: {
300
+ }) }, h("label", { key: 'b4b05e458fcbc767e4392ae43e647b075780cad0', class: "toggle-wrapper", htmlFor: inputId }, h("input", Object.assign({ key: 'c09100447011c51d5b49b4400ec7d72012e3bc6f', type: "checkbox", role: "switch", "aria-checked": `${checked}`, checked: checked, disabled: disabled, id: inputId, required: required }, inheritedAttributes)), h("div", { key: '71cf059a999ae572a20127b76907e010ace486ad', class: {
301
301
  'label-text-wrapper': true,
302
302
  'label-text-wrapper-hidden': !hasLabel,
303
- }, part: "label", id: inputLabelId, onClick: this.onDivLabelClick }, h("slot", { key: '006dd3558264d69ab020c07005b348adc4ecdd5b' }), this.renderHintText()), h("div", { key: 'dd4e52de31caabee41ec1bc58efecd1e213368c9', class: "native-wrapper" }, this.renderToggleControl()))));
303
+ }, part: "label", id: inputLabelId, onClick: this.onDivLabelClick }, h("slot", { key: 'c480b96a0ddd926568f73291d71253d6f74438c7' }), this.renderHintText()), h("div", { key: '96a2cbd1673e051a78f8b2b16535ecd3f0ed4339', class: "native-wrapper" }, this.renderToggleControl()))));
304
304
  }
305
305
  static get is() { return "ion-toggle"; }
306
306
  static get encapsulation() { return "shadow"; }
@@ -65,10 +65,10 @@ export class Toolbar {
65
65
  this.childrenStyles.forEach((value) => {
66
66
  Object.assign(childStyles, value);
67
67
  });
68
- return (h(Host, { key: 'b849db2863778dee6c5a251bffa1b3a657aeb036', class: Object.assign(Object.assign({}, childStyles), createColorClasses(this.color, {
68
+ return (h(Host, { key: '40bad6fa7e94262438da4bbe037dcf8a5fa2df22', class: Object.assign(Object.assign({}, childStyles), createColorClasses(this.color, {
69
69
  [mode]: true,
70
70
  'in-toolbar': hostContext('ion-toolbar', this.el),
71
- })) }, h("div", { key: '67f5bba9c4f527c3f35bfe1313a2b85741f9b246', class: "toolbar-background", part: "background" }), h("div", { key: '085e8c68f056e5b0deb9d1606431fbeb45dae8e5', class: "toolbar-container", part: "container" }, h("slot", { key: '15227c79c3baf883fd8c43fdb7e1313453933c79', name: "start" }), h("slot", { key: '0b8a7f7e685aa31c80d9bc03446ccc3a9d07e0e8', name: "secondary" }), h("div", { key: '57e4628c1fa89df79dd80456259db961bb691404', class: "toolbar-content", part: "content" }, h("slot", { key: '82c2f6e1acf8d96db259bd8baf295881801edbd5' })), h("slot", { key: 'b2d4afb15214199f206c0a5e08b581e4c9c2f58a', name: "primary" }), h("slot", { key: 'bfb909a0c472f8834046c2ea23bef2f562167ad3', name: "end" }))));
71
+ })) }, h("div", { key: 'df44c9f0fe3958116ab860b0dad79c53b89f6c59', class: "toolbar-background", part: "background" }), h("div", { key: '2169ffa576875b8d5624211cc0b4bf86191562bc', class: "toolbar-container", part: "container" }, h("slot", { key: 'c8910dcf1ce98ab427fd89c3396a67c2a75bdd07', name: "start" }), h("slot", { key: '05da24d5ef96b9eebd83b534ce02c1f7bcd06680', name: "secondary" }), h("div", { key: '090fea1541e7e2b6ad74a6ded4eadffdb471ccce', class: "toolbar-content", part: "content" }, h("slot", { key: '507e143f92f6fa59ff23d94026411fa2c74f2f8e' })), h("slot", { key: 'f79fdee472e657e26a910cb89d7551943e40e440', name: "primary" }), h("slot", { key: 'dd40fe9ed490cf4346c642e195fdb524dc6cc4f5', name: "end" }))));
72
72
  }
73
73
  static get is() { return "ion-toolbar"; }
74
74
  static get encapsulation() { return "shadow"; }
@@ -17,5 +17,5 @@ export { getMode, setupConfig } from './utils/config';
17
17
  export { openURL } from './utils/theme';
18
18
  export { LIFECYCLE_WILL_ENTER, LIFECYCLE_DID_ENTER, LIFECYCLE_WILL_LEAVE, LIFECYCLE_DID_LEAVE, LIFECYCLE_WILL_UNLOAD, } from './components/nav/constants';
19
19
  export { menuController } from './utils/menu-controller';
20
- export { alertController, actionSheetController, modalController, loadingController, pickerController, popoverController, toastController, } from './utils/overlays';
20
+ export { alertController, actionSheetController, modalController, loadingController, popoverController, toastController, } from './utils/overlays';
21
21
  export { IonicSlides } from './components/slides/IonicSlides';
@@ -0,0 +1,45 @@
1
+ /*!
2
+ * (C) Ionic http://ionicframework.com - MIT License
3
+ */
4
+ // TODO(FW-6886, FW-6892, FW-6891): Remove this file in favor of the Modular Ionic component config. Each overlay will be able to select its own defaults for label placement and justify based on the interface and mode, so this utility will no longer be necessary.
5
+ /**
6
+ * Returns the default `labelPlacement` for a radio or checkbox option
7
+ * rendered inside an overlay. Defaults follow each mode's established
8
+ * option-row layout:
9
+ * - `ios`: `"start"` for radio in `alert` and `popover`. The `modal`
10
+ * interface flips iOS radio back to `"end"`. Checkbox is always
11
+ * `"end"` on iOS.
12
+ * - everything else (e.g. `md`): `"end"`.
13
+ *
14
+ * `interfaceType` is optional; only `"modal"` changes the result, so
15
+ * callers that aren't a modal can omit it.
16
+ *
17
+ * Used by `select-popover` and `select-modal` as the fallback when an
18
+ * option doesn't explicitly set `labelPlacement`.
19
+ */
20
+ export const getOverlayLabelPlacement = (mode, control, interfaceType) => {
21
+ if (mode === 'ios' && control === 'radio' && interfaceType !== 'modal') {
22
+ return 'start';
23
+ }
24
+ return 'end';
25
+ };
26
+ /**
27
+ * Returns the default `justify` for a radio or checkbox option rendered
28
+ * inside an overlay. Defaults follow each mode's option-row layout:
29
+ * - `ios`: `"space-between"` for radio in `alert` and `popover`. The
30
+ * `modal` interface falls back to `"start"`. Checkbox is always `"start"`
31
+ * on iOS.
32
+ * - everything else (e.g. `md`): `"start"`.
33
+ *
34
+ * `interfaceType` is optional; only `"modal"` changes the result, so
35
+ * callers that aren't a modal can omit it.
36
+ *
37
+ * Used by `select-popover` and `select-modal` as the fallback when an
38
+ * option doesn't explicitly set `justify`.
39
+ */
40
+ export const getOverlayLabelJustify = (mode, control, interfaceType) => {
41
+ if (mode === 'ios' && control === 'radio' && interfaceType !== 'modal') {
42
+ return 'space-between';
43
+ }
44
+ return 'start';
45
+ };
@@ -39,10 +39,6 @@ export const alertController = /*@__PURE__*/ createController('ion-alert');
39
39
  export const actionSheetController = /*@__PURE__*/ createController('ion-action-sheet');
40
40
  export const loadingController = /*@__PURE__*/ createController('ion-loading');
41
41
  export const modalController = /*@__PURE__*/ createController('ion-modal');
42
- /**
43
- * @deprecated Use the inline ion-picker component instead.
44
- */
45
- export const pickerController = /*@__PURE__*/ createController('ion-picker-legacy');
46
42
  export const popoverController = /*@__PURE__*/ createController('ion-popover');
47
43
  export const toastController = /*@__PURE__*/ createController('ion-toast');
48
44
  /**
@@ -136,7 +132,7 @@ const focusElementInOverlay = (hostToFocus, overlay) => {
136
132
  * Should NOT include: Toast
137
133
  */
138
134
  const trapKeyboardFocus = (ev, doc) => {
139
- const lastOverlay = getPresentedOverlay(doc, 'ion-alert,ion-action-sheet,ion-loading,ion-modal,ion-picker-legacy,ion-popover');
135
+ const lastOverlay = getPresentedOverlay(doc, 'ion-alert,ion-action-sheet,ion-loading,ion-modal,ion-popover');
140
136
  const target = ev.target;
141
137
  /**
142
138
  * If no active overlay, ignore this event.
@@ -370,7 +366,7 @@ export const dismissOverlay = (doc, data, role, overlayTag, id) => {
370
366
  */
371
367
  export const getOverlays = (doc, selector) => {
372
368
  if (selector === undefined) {
373
- selector = 'ion-alert,ion-action-sheet,ion-loading,ion-modal,ion-picker-legacy,ion-popover,ion-toast';
369
+ selector = 'ion-alert,ion-action-sheet,ion-loading,ion-modal,ion-popover,ion-toast';
374
370
  }
375
371
  return Array.from(doc.querySelectorAll(selector)).filter((c) => c.overlayIndex > 0);
376
372
  };
@@ -432,6 +428,29 @@ export const setRootAriaHidden = (hidden = false) => {
432
428
  viewContainer.removeAttribute('aria-hidden');
433
429
  }
434
430
  };
431
+ /**
432
+ * Cleans up root `aria-hidden` and `backdrop-no-scroll` when
433
+ * an overlay is removed from the DOM without going through
434
+ * the `dismiss()` flow (e.g., when a framework unmounts the
435
+ * overlay during a route change).
436
+ *
437
+ * Should be called from an overlay's `disconnectedCallback`
438
+ * when the overlay was still presented at the time of removal.
439
+ */
440
+ export const cleanupRootFocusTrapAccessibility = () => {
441
+ if (typeof document === 'undefined') {
442
+ return;
443
+ }
444
+ const remainingOverlays = getPresentedOverlays(document);
445
+ const hasRemainingLocking = remainingOverlays.some((o) => {
446
+ const el = o;
447
+ return el.tagName !== 'ION-TOAST' && el.focusTrap !== false && isBackdropAlwaysBlocking(el);
448
+ });
449
+ if (!hasRemainingLocking) {
450
+ setRootAriaHidden(false);
451
+ document.body.classList.remove(BACKDROP_NO_SCROLL);
452
+ }
453
+ };
435
454
  export const present = async (overlay, name, iosEnterAnimation, mdEnterAnimation, opts) => {
436
455
  var _a, _b;
437
456
  if (overlay.presented) {
@@ -3,8 +3,22 @@
3
3
  */
4
4
  import { printIonError } from "../logging/index";
5
5
  /**
6
- * Does a simple sanitization of all elements
7
- * in an untrusted string
6
+ * Sanitize an untrusted HTML string.
7
+ *
8
+ * Parses the string into a detached DOM, removes blocked tags, strips
9
+ * attributes outside the `allowedAttributes` list (refer `sanitizeElement`),
10
+ * and scrubs script-scheme URLs. Returns the sanitized HTML string.
11
+ *
12
+ * Use this when you have an HTML string from an unknown source and need to
13
+ * render it via `innerHTML`. Use `sanitizeDOMTree` instead when you already
14
+ * have a DOM tree and want to sanitize it in place without a string round
15
+ * trip; both apply the same attribute policy.
16
+ *
17
+ * @param untrustedString - The HTML string to sanitize. Pass an
18
+ * `IonicSafeString` to bypass sanitization, or `undefined` to short-circuit.
19
+ * @returns The sanitized HTML string, or `undefined` if the input was
20
+ * `undefined`. Returns `''` if sanitization fails or the input contains
21
+ * an inline `onload=` handler.
8
22
  */
9
23
  export const sanitizeDOMString = (untrustedString) => {
10
24
  try {
@@ -80,6 +94,36 @@ export const sanitizeDOMString = (untrustedString) => {
80
94
  return '';
81
95
  }
82
96
  };
97
+ /**
98
+ * Sanitize an entire trusted DOM tree in place.
99
+ *
100
+ * Removes blocked tags (`script`, `iframe`, etc.) from the subtree and
101
+ * then sanitizes attributes on every remaining element using the same
102
+ * allowlist policy as `sanitizeDOMString` (refer `sanitizeElement`).
103
+ * Component presentational attributes (`size`, `color`, `shape`, inline
104
+ * SVG, `aria-*`, `data-*`) are preserved; `style`, event handlers (`on*`),
105
+ * form/navigation-hijack attributes, script-scheme URLs, and non-image
106
+ * `data:` URLs are stripped.
107
+ *
108
+ * Use this when you have a DOM tree the developer controls (e.g.
109
+ * cloned slot content from a component) and you need to render it
110
+ * elsewhere safely.
111
+ *
112
+ * @param root - The root element whose subtree will be sanitized in
113
+ * place. No-op when the sanitizer is disabled via `Ionic.config`.
114
+ */
115
+ export const sanitizeDOMTree = (root) => {
116
+ if (!isSanitizerEnabled()) {
117
+ return;
118
+ }
119
+ blockedTags.forEach((tag) => {
120
+ const matches = root.querySelectorAll(tag);
121
+ for (let i = matches.length - 1; i >= 0; i--) {
122
+ matches[i].remove();
123
+ }
124
+ });
125
+ sanitizeElement(root);
126
+ };
83
127
  /**
84
128
  * Clean up current element based on allowed attributes
85
129
  * and then recursively dig down into any child elements to
@@ -101,29 +145,60 @@ const sanitizeElement = (element) => {
101
145
  element.remove();
102
146
  return;
103
147
  }
148
+ /**
149
+ * Always strip `style` (CSS injection, `background:url()` beaconing, UI
150
+ * spoofing). It is never on the allowlist, but it is removed explicitly
151
+ * here because some engines (e.g. jsdom) don't enumerate the CSSOM-backed
152
+ * `style` attribute in `element.attributes`, which would let the loop
153
+ * below skip over it.
154
+ */
155
+ element.removeAttribute('style');
104
156
  for (let i = element.attributes.length - 1; i >= 0; i--) {
105
157
  const attribute = element.attributes.item(i);
106
158
  const attributeName = attribute.name;
107
- // remove non-allowed attribs
108
- if (!allowedAttributes.includes(attributeName.toLowerCase())) {
159
+ const lowerName = attributeName.toLowerCase();
160
+ /**
161
+ * Remove any attribute that is not on the allowlist. This drops event
162
+ * handlers (`on*`), `style`, the form/navigation-hijack attributes
163
+ * (`formaction`, `action`, `target`), namespaced attributes like
164
+ * `xlink:href`, and anything else not explicitly known to be safe.
165
+ */
166
+ if (!isAttributeAllowed(lowerName)) {
109
167
  element.removeAttribute(attributeName);
110
168
  continue;
111
169
  }
112
170
  // clean up any allowed attribs
113
171
  // that attempt to do any JS funny-business
114
172
  const attributeValue = attribute.value;
173
+ if (attributeValue == null) {
174
+ continue;
175
+ }
115
176
  /**
116
- * We also need to check the property value
117
- * as javascript: can allow special characters
118
- * such as 	 and still be valid (i.e. java	script)
177
+ * Scrub dangerous schemes from the value. The value is normalized first
178
+ * (whitespace and ASCII control characters removed) so entity-obfuscated
179
+ * payloads such as `java	script:`, which the parser decodes to
180
+ * `java\tscript:`, are still caught. Normalizing the value also covers
181
+ * namespaced attributes, where the previous `element[attributeName]`
182
+ * property reflection returned `undefined` and let them slip through.
119
183
  */
120
- const propertyValue = element[attributeName];
121
- /* eslint-disable */
122
- if ((attributeValue != null && attributeValue.toLowerCase().includes('javascript:')) ||
123
- (propertyValue != null && propertyValue.toLowerCase().includes('javascript:'))) {
184
+ const normalizedValue = attributeValue.replace(controlCharactersAndWhitespace, '').toLowerCase();
185
+ // Script schemes are never allowed, on any attribute.
186
+ if (normalizedValue.includes('javascript:') || normalizedValue.includes('vbscript:')) {
187
+ element.removeAttribute(attributeName);
188
+ continue;
189
+ }
190
+ /**
191
+ * For URL-bearing attributes, allow `data:` URIs only for raster
192
+ * images. Document-bearing types (`text/html`, `image/svg+xml`,
193
+ * `application/*`, etc.) can carry markup or script when navigated to
194
+ * or rendered, so they are stripped, while safe image types are kept so
195
+ * inline images keep working.
196
+ */
197
+ if (urlAttributes.includes(lowerName) &&
198
+ normalizedValue.startsWith('data:') &&
199
+ !safeDataImageUri.test(normalizedValue)) {
124
200
  element.removeAttribute(attributeName);
125
201
  }
126
- /* eslint-enable */
127
202
  }
128
203
  /**
129
204
  * Sanitize any nested children
@@ -156,8 +231,174 @@ const isSanitizerEnabled = () => {
156
231
  }
157
232
  return true;
158
233
  };
159
- const allowedAttributes = ['class', 'id', 'href', 'src', 'name', 'slot'];
160
- const blockedTags = ['script', 'style', 'iframe', 'meta', 'link', 'object', 'embed'];
234
+ /**
235
+ * Mirror known custom-element DOM properties onto attributes so they
236
+ * survive `cloneNode`. Call this on a DOM subtree before cloning it for
237
+ * rendering elsewhere (e.g. cloning slotted option content into an
238
+ * overlay).
239
+ *
240
+ * Only sets the attribute when the property holds a non-empty string
241
+ * and the attribute isn't already present, so existing attributes
242
+ * take precedence.
243
+ *
244
+ * @param root - The root element whose subtree (and itself) will be
245
+ * inspected.
246
+ */
247
+ export const reflectPropertiesToAttributes = (root) => {
248
+ const candidates = [];
249
+ if (root.tagName in elementPropsToReflect) {
250
+ candidates.push(root);
251
+ }
252
+ for (const tagName of Object.keys(elementPropsToReflect)) {
253
+ candidates.push(...Array.from(root.querySelectorAll(tagName.toLowerCase())));
254
+ }
255
+ for (const el of candidates) {
256
+ if (!(el.tagName in elementPropsToReflect)) {
257
+ continue;
258
+ }
259
+ const props = elementPropsToReflect[el.tagName];
260
+ for (const prop of props) {
261
+ const value = el[prop];
262
+ if (typeof value === 'string' && value.length > 0 && !el.hasAttribute(prop)) {
263
+ el.setAttribute(prop, value);
264
+ }
265
+ }
266
+ }
267
+ };
268
+ /**
269
+ * Attribute names that are always safe to keep. Covers global HTML
270
+ * attributes, the Ionic component presentational props that cloned rich
271
+ * content (e.g. `ion-select-option` markup) relies on, and the inert SVG
272
+ * presentation attributes used by inline icons.
273
+ *
274
+ * `aria-*` and `data-*` are allowed separately by prefix (refer
275
+ * `allowedAttributePrefixes`) since they are inert and not worth
276
+ * enumerating. URL-bearing names (`href`, `src`) are allowed here, but
277
+ * their values are still scrubbed for script schemes in `sanitizeElement`.
278
+ *
279
+ * Notably absent: `style`, event handlers (`on*`), and the
280
+ * form/navigation-hijack attributes (`formaction`, `action`, `target`),
281
+ * which are therefore stripped.
282
+ */
283
+ const allowedAttributes = [
284
+ // Global / structural
285
+ 'class',
286
+ 'id',
287
+ 'slot',
288
+ 'name',
289
+ 'title',
290
+ 'alt',
291
+ 'lang',
292
+ 'dir',
293
+ 'role',
294
+ 'type',
295
+ 'value',
296
+ 'disabled',
297
+ 'width',
298
+ 'height',
299
+ 'href',
300
+ 'src',
301
+ // Ionic component presentational props
302
+ 'color',
303
+ 'size',
304
+ 'shape',
305
+ 'fill',
306
+ 'expand',
307
+ 'mode',
308
+ 'theme',
309
+ 'icon',
310
+ 'label',
311
+ 'label-placement',
312
+ 'justify',
313
+ 'inset',
314
+ 'lines',
315
+ 'ios',
316
+ 'md',
317
+ // SVG presentation attributes (compared lowercased, e.g. `viewBox`)
318
+ 'xmlns',
319
+ 'viewbox',
320
+ 'preserveaspectratio',
321
+ 'stroke',
322
+ 'stroke-width',
323
+ 'stroke-linecap',
324
+ 'stroke-linejoin',
325
+ 'stroke-opacity',
326
+ 'stroke-dasharray',
327
+ 'fill-rule',
328
+ 'fill-opacity',
329
+ 'clip-rule',
330
+ 'd',
331
+ 'points',
332
+ 'cx',
333
+ 'cy',
334
+ 'r',
335
+ 'rx',
336
+ 'ry',
337
+ 'x',
338
+ 'y',
339
+ 'x1',
340
+ 'y1',
341
+ 'x2',
342
+ 'y2',
343
+ 'transform',
344
+ 'opacity',
345
+ ];
346
+ /**
347
+ * Attribute-name prefixes that are always safe to keep. `aria-*` and
348
+ * `data-*` attributes cannot execute script or load resources, so they are
349
+ * allowed wholesale rather than enumerated by name.
350
+ */
351
+ const allowedAttributePrefixes = ['aria-', 'data-'];
352
+ /**
353
+ * Whether an attribute name (already lowercased) is safe to keep, by exact
354
+ * match or by an allowed prefix.
355
+ */
356
+ const isAttributeAllowed = (lowerName) => {
357
+ if (allowedAttributes.includes(lowerName)) {
358
+ return true;
359
+ }
360
+ return allowedAttributePrefixes.some((prefix) => lowerName.startsWith(prefix));
361
+ };
362
+ /**
363
+ * Matches ASCII control characters and whitespace (including the
364
+ * non-breaking space). Used to normalize attribute values before matching
365
+ * a URL scheme so entity-obfuscated payloads such as `java	script:`
366
+ * (decoded by the parser to `java\tscript:`) can't smuggle a scheme past
367
+ * the check.
368
+ */
369
+ // eslint-disable-next-line no-control-regex -- matching control characters is the point
370
+ const controlCharactersAndWhitespace = /[\u0000-\u0020\u007f-\u00a0]/g;
371
+ /**
372
+ * Attributes whose values are URLs. Their values are scheme-checked in
373
+ * `sanitizeElement` (e.g. `data:` filtering) beyond the script-scheme scrub
374
+ * applied to every attribute.
375
+ */
376
+ const urlAttributes = ['href', 'src'];
377
+ /**
378
+ * Matches a `data:` URI for a raster image type that cannot carry script.
379
+ * `image/svg+xml` is deliberately excluded (SVG can execute script), as are
380
+ * document types like `text/html` and `application/*`. The value is already
381
+ * lowercased and whitespace-stripped before this is tested.
382
+ */
383
+ const safeDataImageUri = /^data:image\/(?:png|jpe?g|gif|webp|bmp|avif|x-icon|vnd\.microsoft\.icon)[;,]/;
384
+ /**
385
+ * Tags removed entirely (with their subtree) before attribute sanitization.
386
+ * Exported so tests can assert the set without hardcoding it.
387
+ */
388
+ export const blockedTags = ['script', 'style', 'iframe', 'meta', 'link', 'object', 'embed', 'base'];
389
+ /**
390
+ * Properties on custom elements that frameworks (Vue, Angular) often
391
+ * set as DOM properties rather than attributes. `cloneNode` only copies
392
+ * attributes, so these values are lost when slotted content is cloned
393
+ * into an overlay. For each known custom element, we mirror the listed
394
+ * properties onto attributes so the cloned copy still has the data it
395
+ * needs to render.
396
+ *
397
+ * Keyed by uppercased tagName so the lookup matches `Element.tagName`.
398
+ */
399
+ const elementPropsToReflect = {
400
+ 'ION-ICON': ['icon', 'name', 'src', 'ios', 'md'],
401
+ };
161
402
  export class IonicSafeString {
162
403
  constructor(value) {
163
404
  this.value = value;
@@ -0,0 +1,111 @@
1
+ /*!
2
+ * (C) Ionic http://ionicframework.com - MIT License
3
+ */
4
+ import { h } from "@stencil/core";
5
+ import { sanitizeDOMTree } from "./sanitization/index";
6
+ /**
7
+ * Converts a DOM node into a Stencil VNode (or text string) so the
8
+ * resulting tree is rendered through the component's normal render
9
+ * path. Rendering through Stencil ensures that scoped CSS classes
10
+ * (e.g. `sc-ion-action-sheet-ionic`) are applied to every element.
11
+ *
12
+ * Highly recommended to pre-sanitize the source DOM (see
13
+ * `getOptionContent` in select.tsx). This function performs pure
14
+ * structural conversion — no security filtering.
15
+ *
16
+ * Preserves attributes only — properties set imperatively on the source
17
+ * element (e.g. `input.value` after a user types) won't carry through.
18
+ * In practice this isn't a concern: interactive controls shouldn't
19
+ * appear in select-option rich content since they'd nest inside the
20
+ * overlay's button/radio/checkbox wrapper, which is invalid HTML and
21
+ * an accessibility issue.
22
+ *
23
+ * @param node - The DOM node to convert. Text nodes become strings,
24
+ * element nodes become VNodes, and any other node types are skipped.
25
+ * @param keyPrefix - String prefix used to build a stable VNode key,
26
+ * so Stencil's diff can preserve elements across re-renders.
27
+ * @param index - Position of this node among its siblings. Combined
28
+ * with `keyPrefix` to form the final unique key.
29
+ * @returns The converted VNode, a text string, or `null` if the node
30
+ * type isn't supported.
31
+ *
32
+ * @internal Exported only so it can be unit tested; not part of the
33
+ * public API.
34
+ */
35
+ export const cloneToVNode = (node, keyPrefix, index) => {
36
+ var _a;
37
+ if (node.nodeType === Node.TEXT_NODE) {
38
+ return (_a = node.textContent) !== null && _a !== void 0 ? _a : '';
39
+ }
40
+ if (node.nodeType !== Node.ELEMENT_NODE) {
41
+ return null;
42
+ }
43
+ const el = node;
44
+ const tag = el.tagName.toLowerCase();
45
+ const key = `${keyPrefix}-${index}`;
46
+ const attrs = { key };
47
+ for (let i = 0; i < el.attributes.length; i++) {
48
+ const attr = el.attributes.item(i);
49
+ attrs[attr.name] = attr.value;
50
+ }
51
+ const children = Array.from(el.childNodes)
52
+ .map((child, i) => cloneToVNode(child, key, i))
53
+ .filter((c) => c !== null);
54
+ return h(tag, attrs, children);
55
+ };
56
+ /**
57
+ * Renders cloned DOM content as Stencil JSX. Walking the source DOM
58
+ * into VNodes (rather than injecting it via innerHTML) keeps the
59
+ * content inside Stencil's render path, so scoped CSS classes are
60
+ * applied automatically and component attributes like `size` or
61
+ * `color` survive intact.
62
+ *
63
+ * Span elements should be used when this content renders within buttons,
64
+ * depending on the select interface. Buttons can only have phrasing
65
+ * content to prevent accessibility issues.
66
+ *
67
+ * @param id - Unique identifier for generating stable virtual DOM keys.
68
+ * @param content - The HTMLElement container whose child nodes will be cloned.
69
+ * @param className - CSS class applied to the wrapper element.
70
+ * @param useSpan - Whether to use a span element instead of a div for the wrapper.
71
+ */
72
+ const renderClonedContent = (id, content, className, useSpan = false) => {
73
+ const Tag = useSpan ? 'span' : 'div';
74
+ const keyPrefix = `${className}-${id}`;
75
+ sanitizeDOMTree(content);
76
+ return (h(Tag, { class: className, key: keyPrefix }, Array.from(content.childNodes).map((child, i) => cloneToVNode(child, keyPrefix, i))));
77
+ };
78
+ /**
79
+ * Renders the label content for a select option within an overlay
80
+ * interface based on the presence of rich content.
81
+ *
82
+ * Span elements should be used when this content renders within buttons,
83
+ * depending on the select interface. Buttons can only have phrasing
84
+ * content to prevent accessibility issues.
85
+ *
86
+ * @param option - The content option data containing label, slots,
87
+ * and description.
88
+ * @param className - The base CSS class for the label element.
89
+ * @param useSpan - Whether to use a span element instead of a div for the label.
90
+ */
91
+ export const renderOptionLabel = (option, className, useSpan = false) => {
92
+ const { id, label, startContent, endContent, description } = option;
93
+ const hasRichContent = !!startContent || !!endContent || !!description;
94
+ const Tag = useSpan ? 'span' : 'div';
95
+ // Render simple string label if there is no rich content to display
96
+ if (!hasRichContent && (typeof label === 'string' || !label)) {
97
+ return (h(Tag, { class: className, key: `${className}-${id}` }, label));
98
+ }
99
+ // Render the main label
100
+ const labelEl = typeof label === 'string' || !label ? (
101
+ // Label is a simple string or undefined
102
+ h(Tag, { key: `${className}-label-${id}` }, label)) : (
103
+ // Label is an HTMLElement with potential rich content
104
+ renderClonedContent(id, label, `${className}-text`, useSpan));
105
+ // No rich content, render just the label
106
+ if (!hasRichContent) {
107
+ return (h(Tag, { class: className, key: `${className}-${id}` }, labelEl));
108
+ }
109
+ // Render label with rich content (start, end, description)
110
+ return (h(Tag, { class: `${className} ${className}-has-rich-content`, key: `${className}-${id}` }, startContent && renderClonedContent(id, startContent, 'select-option-start', useSpan), h(Tag, { class: "select-option-content", key: `${className}-content-${id}` }, labelEl, description && (h(Tag, { class: "select-option-description", key: `${className}-desc-${id}` }, description))), endContent && renderClonedContent(id, endContent, 'select-option-end', useSpan)));
111
+ };