@ionic/core 8.8.14-dev.11784037956.17449639 → 8.8.14-dev.11784216165.1ecbf364
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.
- package/components/index.js +1 -1
- package/components/ion-action-sheet.js +1 -1
- package/components/ion-alert.js +1 -1
- package/components/ion-back-button.js +1 -1
- package/components/ion-button.js +1 -1
- package/components/ion-card.js +1 -1
- package/components/ion-chip.js +1 -1
- package/components/ion-datetime-button.js +1 -1
- package/components/ion-datetime.js +1 -1
- package/components/ion-fab-button.js +1 -1
- package/components/ion-img.js +1 -1
- package/components/ion-infinite-scroll-content.js +1 -1
- package/components/ion-input-password-toggle.js +1 -1
- package/components/ion-input.js +1 -1
- package/components/ion-item-option.js +1 -1
- package/components/ion-item.js +1 -1
- package/components/ion-loading.js +1 -1
- package/components/ion-menu-button.js +1 -1
- package/components/ion-menu.js +1 -1
- package/components/ion-modal.js +1 -1
- package/components/ion-nav.js +1 -1
- package/components/ion-popover.js +1 -1
- package/components/ion-progress-bar.js +1 -1
- package/components/ion-radio.js +1 -1
- package/components/ion-range.js +1 -1
- package/components/ion-refresher-content.js +1 -1
- package/components/ion-refresher.js +1 -1
- package/components/ion-reorder-group.js +1 -1
- package/components/ion-reorder.js +1 -1
- package/components/ion-ripple-effect.js +1 -1
- package/components/ion-router-link.js +1 -1
- package/components/ion-router-outlet.js +1 -1
- package/components/ion-router.js +1 -1
- package/components/ion-row.js +1 -1
- package/components/ion-searchbar.js +1 -1
- package/components/ion-segment-button.js +1 -1
- package/components/ion-segment-content.js +1 -1
- package/components/ion-segment-view.js +1 -1
- package/components/ion-segment.js +1 -1
- package/components/ion-select-modal.js +1 -1
- package/components/ion-select-option.js +1 -1
- package/components/ion-select-popover.js +1 -1
- package/components/ion-select.js +1 -1
- package/components/ion-skeleton-text.js +1 -1
- package/components/ion-spinner.js +1 -1
- package/components/ion-split-pane.js +1 -1
- package/components/ion-tab-bar.js +1 -1
- package/components/ion-tab-button.js +1 -1
- package/components/ion-tab.js +1 -1
- package/components/ion-tabs.js +1 -1
- package/components/ion-text.js +1 -1
- package/components/ion-textarea.js +1 -1
- package/components/ion-thumbnail.js +1 -1
- package/components/ion-title.js +1 -1
- package/components/ion-toast.js +1 -1
- package/components/ion-toggle.js +1 -1
- package/components/ion-toolbar.js +1 -1
- package/components/p-279dFMvg.js +4 -0
- package/components/p-BSQPZ79H.js +4 -0
- package/components/{p-BHrrc-3d.js → p-Buf_7zcy.js} +1 -1
- package/components/p-BwKpO3Is.js +4 -0
- package/components/p-C-Rx1zny.js +4 -0
- package/components/p-CHzfYZbv.js +4 -0
- package/components/p-D4h1H_hh.js +4 -0
- package/components/{p-BSEgsdFI.js → p-DhkITZ-y.js} +1 -1
- package/components/{p-5bE_Wz4Y.js → p-DpV-p5Xs.js} +1 -1
- package/components/{p-Cfx4M1Bn.js → p-Dz74mwlk.js} +1 -1
- package/components/p-LMGfIvTf.js +4 -0
- package/components/{p-BLmJ0zRm.js → p-XJWMAP8m.js} +1 -1
- package/components/p-_lHSumhG.js +4 -0
- package/components/p-j9Da6cYO.js +4 -0
- package/components/p-jOtMJMv8.js +4 -0
- package/components/{p-B60hm8Qv.js → p-r0aq7dpt.js} +1 -1
- package/components/p-uTR_dEqg.js +4 -0
- package/components/{p-rCa2eL0j.js → p-wk2QqrAo.js} +1 -1
- package/dist/cjs/config-DWdFbSNK.js +35 -0
- package/dist/cjs/index-Cueg3U4w.js +429 -0
- package/dist/cjs/index.cjs.js +6 -6
- package/dist/cjs/ion-action-sheet.cjs.entry.js +27 -7
- package/dist/cjs/ion-alert.cjs.entry.js +64 -25
- package/dist/cjs/ion-app_8.cjs.entry.js +23 -9
- package/dist/cjs/ion-avatar_3.cjs.entry.js +1 -1
- package/dist/cjs/ion-col_3.cjs.entry.js +1 -1
- package/dist/cjs/{ion-datetime_3.cjs.entry.js → ion-datetime.cjs.entry.js} +1 -639
- package/dist/cjs/ion-img.cjs.entry.js +3 -1
- package/dist/cjs/ion-infinite-scroll_2.cjs.entry.js +3 -2
- package/dist/cjs/ion-input.cjs.entry.js +4 -4
- package/dist/cjs/ion-item_8.cjs.entry.js +2 -2
- package/dist/cjs/ion-loading.cjs.entry.js +10 -5
- package/dist/cjs/ion-menu_3.cjs.entry.js +1 -1
- package/dist/cjs/ion-modal.cjs.entry.js +23 -33
- package/dist/cjs/ion-nav_2.cjs.entry.js +2 -115
- package/dist/cjs/ion-popover.cjs.entry.js +9 -5
- package/dist/cjs/ion-progress-bar.cjs.entry.js +1 -1
- package/dist/cjs/ion-radio_2.cjs.entry.js +3 -3
- package/dist/cjs/ion-range.cjs.entry.js +3 -3
- package/dist/cjs/ion-refresher_2.cjs.entry.js +6 -5
- package/dist/cjs/ion-reorder_2.cjs.entry.js +2 -2
- package/dist/cjs/ion-ripple-effect.cjs.entry.js +1 -1
- package/dist/cjs/ion-route_4.cjs.entry.js +18 -4
- package/dist/cjs/ion-searchbar.cjs.entry.js +5 -5
- package/dist/cjs/ion-segment-content.cjs.entry.js +1 -1
- package/dist/cjs/ion-segment-view.cjs.entry.js +2 -2
- package/dist/cjs/ion-segment_2.cjs.entry.js +4 -4
- package/dist/cjs/ion-select-modal.cjs.entry.js +84 -30
- package/dist/cjs/ion-select_3.cjs.entry.js +407 -49
- package/dist/cjs/ion-spinner.cjs.entry.js +1 -1
- package/dist/cjs/ion-split-pane.cjs.entry.js +2 -2
- package/dist/cjs/ion-tab-bar_2.cjs.entry.js +4 -4
- package/dist/cjs/ion-tab_2.cjs.entry.js +3 -3
- package/dist/cjs/ion-text.cjs.entry.js +2 -2
- package/dist/cjs/ion-textarea.cjs.entry.js +2 -2
- package/dist/cjs/ion-toast.cjs.entry.js +6 -5
- package/dist/cjs/ion-toggle.cjs.entry.js +3 -3
- package/dist/cjs/ionic.cjs.js +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/overlay-control-label-D2sdL2O8.js +50 -0
- package/dist/cjs/{overlays-B9UiYZ4R.js → overlays-DSmSrd_4.js} +27 -30
- package/dist/cjs/select-option-render-DTF50t5r.js +124 -0
- package/dist/collection/collection-manifest.json +6 -10
- package/dist/collection/components/action-sheet/action-sheet.ios.css +229 -2
- package/dist/collection/components/action-sheet/action-sheet.js +24 -5
- package/dist/collection/components/action-sheet/action-sheet.md.css +175 -2
- package/dist/collection/components/alert/alert.ios.css +280 -10
- package/dist/collection/components/alert/alert.js +59 -21
- package/dist/collection/components/alert/alert.md.css +269 -20
- package/dist/collection/components/img/img.js +6 -1
- package/dist/collection/components/input/input.js +8 -8
- package/dist/collection/components/loading/loading.js +7 -3
- package/dist/collection/components/modal/gestures/sheet.js +0 -8
- package/dist/collection/components/modal/gestures/swipe-to-close.js +0 -8
- package/dist/collection/components/modal/modal.ios.css +0 -8
- package/dist/collection/components/modal/modal.js +23 -17
- package/dist/collection/components/modal/modal.md.css +0 -8
- package/dist/collection/components/nav/nav.js +4 -219
- package/dist/collection/components/popover/popover.ios.css +15 -0
- package/dist/collection/components/popover/popover.js +7 -3
- package/dist/collection/components/popover/popover.md.css +15 -0
- package/dist/collection/components/progress-bar/progress-bar.js +1 -1
- package/dist/collection/components/radio/radio.js +4 -4
- package/dist/collection/components/range/range.js +3 -3
- package/dist/collection/components/refresher/refresher.js +1 -1
- package/dist/collection/components/refresher-content/refresher-content.js +1 -1
- package/dist/collection/components/reorder/reorder.js +1 -1
- package/dist/collection/components/reorder-group/reorder-group.js +1 -1
- package/dist/collection/components/ripple-effect/ripple-effect.js +1 -1
- package/dist/collection/components/route/route.js +1 -1
- package/dist/collection/components/router/utils/dom.js +22 -3
- package/dist/collection/components/router-link/router-link.js +2 -2
- package/dist/collection/components/router-outlet/router-outlet.js +38 -5
- package/dist/collection/components/row/row.js +1 -1
- package/dist/collection/components/searchbar/searchbar.js +9 -9
- package/dist/collection/components/segment/segment.js +2 -2
- package/dist/collection/components/segment-button/segment-button.js +2 -2
- package/dist/collection/components/segment-content/segment-content.js +1 -1
- package/dist/collection/components/segment-view/segment-view.js +2 -2
- package/dist/collection/components/select/select.ios.css +33 -0
- package/dist/collection/components/select/select.js +323 -16
- package/dist/collection/components/select/select.md.css +33 -0
- package/dist/collection/components/select-modal/select-modal.ios.css +219 -0
- package/dist/collection/components/select-modal/select-modal.js +79 -26
- package/dist/collection/components/select-modal/select-modal.md.css +165 -0
- package/dist/collection/components/select-option/select-option.js +67 -3
- package/dist/collection/components/select-popover/select-popover.ios.css +219 -0
- package/dist/collection/components/select-popover/select-popover.js +78 -26
- package/dist/collection/components/select-popover/select-popover.md.css +165 -0
- package/dist/collection/components/skeleton-text/skeleton-text.js +2 -2
- package/dist/collection/components/spinner/spinner.js +1 -1
- package/dist/collection/components/split-pane/split-pane.js +2 -2
- package/dist/collection/components/tab/tab.js +2 -2
- package/dist/collection/components/tab-bar/tab-bar.js +2 -2
- package/dist/collection/components/tab-button/tab-button.js +2 -2
- package/dist/collection/components/tabs/tabs.js +1 -1
- package/dist/collection/components/text/text.js +2 -2
- package/dist/collection/components/textarea/textarea.js +2 -2
- package/dist/collection/components/thumbnail/thumbnail.js +1 -1
- package/dist/collection/components/title/title.js +2 -2
- package/dist/collection/components/toast/toast.js +2 -2
- package/dist/collection/components/toggle/toggle.js +3 -3
- package/dist/collection/components/toolbar/toolbar.js +2 -2
- package/dist/collection/index.js +1 -1
- package/dist/collection/utils/overlay-control-label.js +45 -0
- package/dist/collection/utils/overlays.js +26 -29
- package/dist/collection/utils/sanitization/index.js +274 -18
- package/dist/collection/utils/select-option-render.js +119 -0
- package/dist/docs.json +497 -1189
- package/dist/esm/config-BwKpO3Is.js +31 -0
- package/dist/esm/{index-DV3sJJW8.js → index-AlrZKoWR.js} +1 -1
- package/dist/esm/index-DQSkZyOJ.js +424 -0
- package/dist/esm/index.js +3 -2
- package/dist/esm/ion-accordion_2.entry.js +1 -1
- package/dist/esm/ion-action-sheet.entry.js +27 -7
- package/dist/esm/ion-alert.entry.js +63 -24
- package/dist/esm/ion-app_8.entry.js +23 -9
- package/dist/esm/ion-avatar_3.entry.js +1 -1
- package/dist/esm/ion-back-button.entry.js +1 -1
- package/dist/esm/ion-breadcrumb_2.entry.js +1 -1
- package/dist/esm/ion-col_3.entry.js +1 -1
- package/dist/esm/{ion-datetime_3.entry.js → ion-datetime.entry.js} +5 -641
- package/dist/esm/ion-fab_3.entry.js +1 -1
- package/dist/esm/ion-img.entry.js +4 -2
- package/dist/esm/ion-infinite-scroll_2.entry.js +2 -1
- package/dist/esm/ion-input-password-toggle.entry.js +1 -1
- package/dist/esm/ion-input.entry.js +5 -5
- package/dist/esm/ion-item_8.entry.js +3 -3
- package/dist/esm/ion-loading.entry.js +9 -4
- package/dist/esm/ion-menu_3.entry.js +2 -2
- package/dist/esm/ion-modal.entry.js +23 -33
- package/dist/esm/ion-nav_2.entry.js +3 -116
- package/dist/esm/ion-popover.entry.js +9 -5
- package/dist/esm/ion-progress-bar.entry.js +1 -1
- package/dist/esm/ion-radio_2.entry.js +3 -3
- package/dist/esm/ion-range.entry.js +3 -3
- package/dist/esm/ion-refresher_2.entry.js +5 -4
- package/dist/esm/ion-reorder_2.entry.js +3 -3
- package/dist/esm/ion-ripple-effect.entry.js +1 -1
- package/dist/esm/ion-route_4.entry.js +18 -4
- package/dist/esm/ion-searchbar.entry.js +6 -6
- package/dist/esm/ion-segment-content.entry.js +1 -1
- package/dist/esm/ion-segment-view.entry.js +2 -2
- package/dist/esm/ion-segment_2.entry.js +4 -4
- package/dist/esm/ion-select-modal.entry.js +84 -30
- package/dist/esm/ion-select_3.entry.js +410 -52
- package/dist/esm/ion-spinner.entry.js +1 -1
- package/dist/esm/ion-split-pane.entry.js +2 -2
- package/dist/esm/ion-tab-bar_2.entry.js +4 -4
- package/dist/esm/ion-tab_2.entry.js +3 -3
- package/dist/esm/ion-text.entry.js +2 -2
- package/dist/esm/ion-textarea.entry.js +2 -2
- package/dist/esm/ion-toast.entry.js +5 -4
- package/dist/esm/ion-toggle.entry.js +4 -4
- package/dist/esm/ionic.js +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/esm/overlay-control-label-BSQPZ79H.js +47 -0
- package/dist/esm/{overlays-Bmfhux69.js → overlays-DLNOHWNc.js} +28 -31
- package/dist/esm/select-option-render-B8nWZRnd.js +122 -0
- package/dist/html.html-data.json +52 -80
- package/dist/ionic/index.esm.js +1 -1
- package/dist/ionic/ionic.esm.js +1 -1
- package/dist/ionic/p-038eb991.entry.js +4 -0
- package/dist/ionic/{p-3a126bca.entry.js → p-259d0d98.entry.js} +1 -1
- package/dist/ionic/{p-fabcce6c.entry.js → p-341032b3.entry.js} +1 -1
- package/dist/ionic/{p-3a7d1e91.entry.js → p-4502a274.entry.js} +1 -1
- package/dist/ionic/p-4621c387.entry.js +4 -0
- package/dist/ionic/p-4ace7762.entry.js +4 -0
- package/dist/ionic/p-4bb3eb60.entry.js +4 -0
- package/dist/ionic/p-4e9ec5c5.entry.js +4 -0
- package/dist/ionic/{p-874b4bd8.entry.js → p-51cd1643.entry.js} +1 -1
- package/dist/ionic/p-5c3ec490.entry.js +4 -0
- package/dist/ionic/p-5d1ac2c7.entry.js +4 -0
- package/dist/ionic/{p-3ae5f277.entry.js → p-627fabd9.entry.js} +1 -1
- package/dist/ionic/{p-e0be05c5.entry.js → p-629e4703.entry.js} +1 -1
- package/dist/ionic/p-700795f6.entry.js +4 -0
- package/dist/ionic/{p-5d1da0a2.entry.js → p-76e92a84.entry.js} +1 -1
- package/dist/ionic/p-79a36078.entry.js +4 -0
- package/dist/ionic/{p-9f1103ce.entry.js → p-7a37b3ce.entry.js} +1 -1
- package/dist/ionic/{p-3353c229.entry.js → p-80b44b3c.entry.js} +1 -1
- package/dist/ionic/p-913b218a.entry.js +4 -0
- package/dist/ionic/{p-390ca786.entry.js → p-9177f4ac.entry.js} +1 -1
- package/dist/ionic/{p-DV3sJJW8.js → p-AlrZKoWR.js} +1 -1
- package/dist/ionic/p-BDtODLZ4.js +4 -0
- package/dist/ionic/p-BSQPZ79H.js +4 -0
- package/dist/ionic/p-BwKpO3Is.js +4 -0
- package/dist/ionic/p-Cg5-OQYy.js +4 -0
- package/dist/ionic/p-DCOvXkOm.js +4 -0
- package/dist/ionic/p-a18dcb3c.entry.js +4 -0
- package/dist/ionic/{p-4858af1f.entry.js → p-a5213260.entry.js} +1 -1
- package/dist/ionic/{p-37e720da.entry.js → p-a7628bc7.entry.js} +1 -1
- package/dist/ionic/p-a9a33367.entry.js +4 -0
- package/dist/ionic/p-ad728198.entry.js +4 -0
- package/dist/ionic/{p-ef4c3bee.entry.js → p-b1599fca.entry.js} +1 -1
- package/dist/ionic/{p-84d5ce05.entry.js → p-b9ac1fe0.entry.js} +1 -1
- package/dist/ionic/p-bfc8c629.entry.js +4 -0
- package/dist/ionic/p-c08e666a.entry.js +4 -0
- package/dist/ionic/p-c474f471.entry.js +4 -0
- package/dist/ionic/{p-cf91e738.entry.js → p-c93553d2.entry.js} +1 -1
- package/dist/ionic/p-ce7992c4.entry.js +4 -0
- package/dist/ionic/{p-75dc25ba.entry.js → p-d2c7f046.entry.js} +1 -1
- package/dist/ionic/{p-c4d8641b.entry.js → p-d8387b99.entry.js} +1 -1
- package/dist/ionic/{p-9a65ac7f.entry.js → p-db1b6738.entry.js} +1 -1
- package/dist/ionic/p-ed797c72.entry.js +4 -0
- package/dist/ionic/{p-8eb8ee76.entry.js → p-ef93ca92.entry.js} +1 -1
- package/dist/ionic/p-f09f9642.entry.js +4 -0
- package/dist/ionic/p-f1c06f82.entry.js +4 -0
- package/dist/ionic/p-f718fccb.entry.js +4 -0
- package/dist/ionic/{p-0fa9c382.entry.js → p-fe4aa1db.entry.js} +1 -1
- package/dist/types/components/img/img.d.ts +2 -0
- package/dist/types/components/input/input.d.ts +1 -1
- package/dist/types/components/modal/modal.d.ts +11 -4
- package/dist/types/components/nav/nav-interface.d.ts +0 -1
- package/dist/types/components/nav/nav.d.ts +2 -22
- package/dist/types/components/route/route.d.ts +1 -1
- package/dist/types/components/router-outlet/router-outlet.d.ts +7 -0
- package/dist/types/components/searchbar/searchbar.d.ts +1 -1
- package/dist/types/components/select/select-interface.d.ts +31 -0
- package/dist/types/components/select/select.d.ts +18 -0
- package/dist/types/components/select-option/select-option.d.ts +42 -1
- package/dist/types/components.d.ts +74 -303
- package/dist/types/index.d.ts +1 -1
- package/dist/types/interface.d.ts +0 -1
- package/dist/types/utils/config.d.ts +0 -8
- package/dist/types/utils/overlay-control-label.d.ts +32 -0
- package/dist/types/utils/overlays.d.ts +11 -9
- package/dist/types/utils/sanitization/index.d.ts +58 -2
- package/dist/types/utils/select-option-render.d.ts +53 -0
- package/hydrate/index.js +1410 -1292
- package/hydrate/index.mjs +1410 -1292
- package/package.json +37 -5
- package/components/ion-picker-legacy-column.d.ts +0 -11
- package/components/ion-picker-legacy-column.js +0 -4
- package/components/ion-picker-legacy.d.ts +0 -11
- package/components/ion-picker-legacy.js +0 -4
- package/components/p-B1BWKArA.js +0 -4
- package/components/p-B4PlLGHT.js +0 -4
- package/components/p-BFsEcwW9.js +0 -4
- package/components/p-CFRyvUvJ.js +0 -4
- package/components/p-CU5rbWAW.js +0 -4
- package/components/p-CgLiHbz0.js +0 -4
- package/components/p-MLyEeL3Q.js +0 -4
- package/components/p-PgMVWD8U.js +0 -4
- package/components/p-k_E4tX5Z.js +0 -4
- package/dist/cjs/config-xninhj0J.js +0 -201
- package/dist/collection/components/picker-legacy/animations/ios.enter.js +0 -27
- package/dist/collection/components/picker-legacy/animations/ios.leave.js +0 -23
- package/dist/collection/components/picker-legacy/picker-interface.js +0 -1
- package/dist/collection/components/picker-legacy/picker.ios.css +0 -300
- package/dist/collection/components/picker-legacy/picker.js +0 -890
- package/dist/collection/components/picker-legacy/picker.md.css +0 -287
- package/dist/collection/components/picker-legacy-column/picker-column.ios.css +0 -231
- package/dist/collection/components/picker-legacy-column/picker-column.js +0 -422
- package/dist/collection/components/picker-legacy-column/picker-column.md.css +0 -222
- package/dist/collection/components/picker-legacy-column/test/test.utils.js +0 -43
- package/dist/esm/config-DQCONYYp.js +0 -195
- package/dist/ionic/p-01f81ea5.entry.js +0 -4
- package/dist/ionic/p-02473803.entry.js +0 -4
- package/dist/ionic/p-20b1a044.entry.js +0 -4
- package/dist/ionic/p-21eb76d5.entry.js +0 -4
- package/dist/ionic/p-27d30585.entry.js +0 -4
- package/dist/ionic/p-2bb2cb18.entry.js +0 -4
- package/dist/ionic/p-2f529a55.entry.js +0 -4
- package/dist/ionic/p-485fda23.entry.js +0 -4
- package/dist/ionic/p-48fa7fb1.entry.js +0 -4
- package/dist/ionic/p-4baa5b82.entry.js +0 -4
- package/dist/ionic/p-4d9181c7.entry.js +0 -4
- package/dist/ionic/p-50e1194a.entry.js +0 -4
- package/dist/ionic/p-532eb373.entry.js +0 -4
- package/dist/ionic/p-8fce95d5.entry.js +0 -4
- package/dist/ionic/p-B0zdMdR0.js +0 -4
- package/dist/ionic/p-DzWaWHGc.js +0 -4
- package/dist/ionic/p-a21add2f.entry.js +0 -4
- package/dist/ionic/p-ab60b48a.entry.js +0 -4
- package/dist/ionic/p-ec090e0a.entry.js +0 -4
- package/dist/ionic/p-f386f6ae.entry.js +0 -4
- package/dist/ionic/p-f994dc44.entry.js +0 -4
- package/dist/ionic/p-fd76f647.entry.js +0 -4
- package/dist/ionic/p-fda60562.entry.js +0 -4
- package/dist/types/components/picker-legacy/animations/ios.enter.d.ts +0 -5
- package/dist/types/components/picker-legacy/animations/ios.leave.d.ts +0 -5
- package/dist/types/components/picker-legacy/picker-interface.d.ts +0 -52
- package/dist/types/components/picker-legacy/picker.d.ts +0 -158
- package/dist/types/components/picker-legacy-column/picker-column.d.ts +0 -46
- 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: '
|
|
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: '
|
|
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: '
|
|
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: '
|
|
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: '
|
|
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: '
|
|
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: '
|
|
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: '
|
|
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: '
|
|
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: '
|
|
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"; }
|
package/dist/collection/index.js
CHANGED
|
@@ -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,
|
|
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-
|
|
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-
|
|
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) {
|
|
@@ -497,29 +516,7 @@ export const present = async (overlay, name, iosEnterAnimation, mdEnterAnimation
|
|
|
497
516
|
* to the overlay container.
|
|
498
517
|
*/
|
|
499
518
|
if (overlay.keyboardClose && (document.activeElement === null || !overlay.el.contains(document.activeElement))) {
|
|
500
|
-
|
|
501
|
-
* Some overlays (e.g. modal) put the dialog role and label on the
|
|
502
|
-
* `.ion-overlay-wrapper` rather than the host. Screen readers need
|
|
503
|
-
* focus on the element with role="dialog" to properly announce and
|
|
504
|
-
* navigate the dialog. The `[tabindex]` qualifier ensures we only
|
|
505
|
-
* target such a wrapper when it is actually focusable; otherwise
|
|
506
|
-
* (e.g. picker-legacy, whose role="dialog" wrapper has no tabindex)
|
|
507
|
-
* `focus()` would be a no-op, so we fall back to the host.
|
|
508
|
-
*/
|
|
509
|
-
const overlayWrapper = getElementRoot(overlay.el).querySelector('[role="dialog"][tabindex]');
|
|
510
|
-
const focusTarget = overlayWrapper !== null && overlayWrapper !== void 0 ? overlayWrapper : overlay.el;
|
|
511
|
-
/**
|
|
512
|
-
* `preventScroll` keeps this a pure focus move so the viewport does not
|
|
513
|
-
* jump when the wrapper is partially off-screen (e.g. a sheet modal).
|
|
514
|
-
* Guard the options call so an older engine that mishandles it can never
|
|
515
|
-
* reject present(); we fall back to a plain focus() in that case.
|
|
516
|
-
*/
|
|
517
|
-
try {
|
|
518
|
-
focusTarget.focus({ preventScroll: true });
|
|
519
|
-
}
|
|
520
|
-
catch (_c) {
|
|
521
|
-
focusTarget.focus();
|
|
522
|
-
}
|
|
519
|
+
overlay.el.focus();
|
|
523
520
|
}
|
|
524
521
|
/**
|
|
525
522
|
* If this overlay was previously dismissed without being
|
|
@@ -3,8 +3,26 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import { printIonError } from "../logging/index";
|
|
5
5
|
/**
|
|
6
|
-
*
|
|
7
|
-
*
|
|
6
|
+
* Sanitize an untrusted HTML string.
|
|
7
|
+
*
|
|
8
|
+
* Parses the string into a detached DOM, removes blocked tags, strips
|
|
9
|
+
* attributes outside the narrow `domStringAllowedAttributes` list (refer
|
|
10
|
+
* `sanitizeElement`), and scrubs script-scheme URLs. Returns the sanitized
|
|
11
|
+
* HTML string.
|
|
12
|
+
*
|
|
13
|
+
* Use this when you have an HTML string from an unknown source and need to
|
|
14
|
+
* render it via `innerHTML`. Use `sanitizeDOMTree` instead when you already
|
|
15
|
+
* have a DOM tree and want to sanitize it in place without a string round
|
|
16
|
+
* trip. The two apply the same dangerous-vector scrubbing but different
|
|
17
|
+
* attribute allowlists: this path stays narrow so existing consumers
|
|
18
|
+
* (toast, loading, alert message, etc.) are unaffected, while
|
|
19
|
+
* `sanitizeDOMTree` uses the wider rich-content allowlist.
|
|
20
|
+
*
|
|
21
|
+
* @param untrustedString - The HTML string to sanitize. Pass an
|
|
22
|
+
* `IonicSafeString` to bypass sanitization, or `undefined` to short-circuit.
|
|
23
|
+
* @returns The sanitized HTML string, or `undefined` if the input was
|
|
24
|
+
* `undefined`. Returns `''` if sanitization fails or the input contains
|
|
25
|
+
* an inline `onload=` handler.
|
|
8
26
|
*/
|
|
9
27
|
export const sanitizeDOMString = (untrustedString) => {
|
|
10
28
|
try {
|
|
@@ -54,7 +72,7 @@ export const sanitizeDOMString = (untrustedString) => {
|
|
|
54
72
|
const childElements = getElementChildren(element);
|
|
55
73
|
/* eslint-disable-next-line */
|
|
56
74
|
for (let childIndex = 0; childIndex < childElements.length; childIndex++) {
|
|
57
|
-
sanitizeElement(childElements[childIndex]);
|
|
75
|
+
sanitizeElement(childElements[childIndex], domStringAllowedAttributes);
|
|
58
76
|
}
|
|
59
77
|
}
|
|
60
78
|
});
|
|
@@ -66,7 +84,7 @@ export const sanitizeDOMString = (untrustedString) => {
|
|
|
66
84
|
const dfChildren = getElementChildren(documentFragment);
|
|
67
85
|
/* eslint-disable-next-line */
|
|
68
86
|
for (let childIndex = 0; childIndex < dfChildren.length; childIndex++) {
|
|
69
|
-
sanitizeElement(dfChildren[childIndex]);
|
|
87
|
+
sanitizeElement(dfChildren[childIndex], domStringAllowedAttributes);
|
|
70
88
|
}
|
|
71
89
|
// Append document fragment to div
|
|
72
90
|
const fragmentDiv = document.createElement('div');
|
|
@@ -80,13 +98,43 @@ export const sanitizeDOMString = (untrustedString) => {
|
|
|
80
98
|
return '';
|
|
81
99
|
}
|
|
82
100
|
};
|
|
101
|
+
/**
|
|
102
|
+
* Sanitize an entire trusted DOM tree in place.
|
|
103
|
+
*
|
|
104
|
+
* Removes blocked tags (`script`, `iframe`, etc.) from the subtree and
|
|
105
|
+
* then sanitizes attributes on every remaining element using the wider
|
|
106
|
+
* `richContentAllowedAttributes` allowlist (refer `sanitizeElement`).
|
|
107
|
+
* Component presentational attributes (`size`, `color`, `shape`, inline
|
|
108
|
+
* SVG, `aria-*`, `data-*`) are preserved; `style`, event handlers (`on*`),
|
|
109
|
+
* form/navigation-hijack attributes, script-scheme URLs, and non-image
|
|
110
|
+
* `data:` URLs are stripped.
|
|
111
|
+
*
|
|
112
|
+
* Use this when you have a DOM tree the developer controls (e.g.
|
|
113
|
+
* cloned slot content from a component) and you need to render it
|
|
114
|
+
* elsewhere safely.
|
|
115
|
+
*
|
|
116
|
+
* @param root - The root element whose subtree will be sanitized in
|
|
117
|
+
* place. No-op when the sanitizer is disabled via `Ionic.config`.
|
|
118
|
+
*/
|
|
119
|
+
export const sanitizeDOMTree = (root) => {
|
|
120
|
+
if (!isSanitizerEnabled()) {
|
|
121
|
+
return;
|
|
122
|
+
}
|
|
123
|
+
blockedTags.forEach((tag) => {
|
|
124
|
+
const matches = root.querySelectorAll(tag);
|
|
125
|
+
for (let i = matches.length - 1; i >= 0; i--) {
|
|
126
|
+
matches[i].remove();
|
|
127
|
+
}
|
|
128
|
+
});
|
|
129
|
+
sanitizeElement(root, richContentAllowedAttributes, richContentAllowedAttributePrefixes);
|
|
130
|
+
};
|
|
83
131
|
/**
|
|
84
132
|
* Clean up current element based on allowed attributes
|
|
85
133
|
* and then recursively dig down into any child elements to
|
|
86
134
|
* clean those up as well
|
|
87
135
|
*/
|
|
88
136
|
// TODO(FW-2832): type (using Element triggers other type errors as well)
|
|
89
|
-
const sanitizeElement = (element) => {
|
|
137
|
+
const sanitizeElement = (element, allowedAttributes, allowedAttributePrefixes = []) => {
|
|
90
138
|
// IE uses childNodes, so ignore nodes that are not elements
|
|
91
139
|
if (element.nodeType && element.nodeType !== 1) {
|
|
92
140
|
return;
|
|
@@ -101,29 +149,60 @@ const sanitizeElement = (element) => {
|
|
|
101
149
|
element.remove();
|
|
102
150
|
return;
|
|
103
151
|
}
|
|
152
|
+
/**
|
|
153
|
+
* Always strip `style` (CSS injection, `background:url()` beaconing, UI
|
|
154
|
+
* spoofing). It is never on the allowlist, but it is removed explicitly
|
|
155
|
+
* here because some engines (e.g. jsdom) don't enumerate the CSSOM-backed
|
|
156
|
+
* `style` attribute in `element.attributes`, which would let the loop
|
|
157
|
+
* below skip over it.
|
|
158
|
+
*/
|
|
159
|
+
element.removeAttribute('style');
|
|
104
160
|
for (let i = element.attributes.length - 1; i >= 0; i--) {
|
|
105
161
|
const attribute = element.attributes.item(i);
|
|
106
162
|
const attributeName = attribute.name;
|
|
107
|
-
|
|
108
|
-
|
|
163
|
+
const lowerName = attributeName.toLowerCase();
|
|
164
|
+
/**
|
|
165
|
+
* Remove any attribute that is not on the allowlist. This drops event
|
|
166
|
+
* handlers (`on*`), `style`, the form/navigation-hijack attributes
|
|
167
|
+
* (`formaction`, `action`, `target`), namespaced attributes like
|
|
168
|
+
* `xlink:href`, and anything else not explicitly known to be safe.
|
|
169
|
+
*/
|
|
170
|
+
if (!isAttributeAllowed(lowerName, allowedAttributes, allowedAttributePrefixes)) {
|
|
109
171
|
element.removeAttribute(attributeName);
|
|
110
172
|
continue;
|
|
111
173
|
}
|
|
112
174
|
// clean up any allowed attribs
|
|
113
175
|
// that attempt to do any JS funny-business
|
|
114
176
|
const attributeValue = attribute.value;
|
|
177
|
+
if (attributeValue == null) {
|
|
178
|
+
continue;
|
|
179
|
+
}
|
|
115
180
|
/**
|
|
116
|
-
*
|
|
117
|
-
*
|
|
118
|
-
* such as
|
|
181
|
+
* Scrub dangerous schemes from the value. The value is normalized first
|
|
182
|
+
* (whitespace and ASCII control characters removed) so entity-obfuscated
|
|
183
|
+
* payloads such as `java	script:`, which the parser decodes to
|
|
184
|
+
* `java\tscript:`, are still caught. Normalizing the value also covers
|
|
185
|
+
* namespaced attributes, where the previous `element[attributeName]`
|
|
186
|
+
* property reflection returned `undefined` and let them slip through.
|
|
119
187
|
*/
|
|
120
|
-
const
|
|
121
|
-
|
|
122
|
-
if ((
|
|
123
|
-
|
|
188
|
+
const normalizedValue = attributeValue.replace(controlCharactersAndWhitespace, '').toLowerCase();
|
|
189
|
+
// Script schemes are never allowed, on any attribute.
|
|
190
|
+
if (normalizedValue.includes('javascript:') || normalizedValue.includes('vbscript:')) {
|
|
191
|
+
element.removeAttribute(attributeName);
|
|
192
|
+
continue;
|
|
193
|
+
}
|
|
194
|
+
/**
|
|
195
|
+
* For URL-bearing attributes, allow `data:` URIs only for raster
|
|
196
|
+
* images. Document-bearing types (`text/html`, `image/svg+xml`,
|
|
197
|
+
* `application/*`, etc.) can carry markup or script when navigated to
|
|
198
|
+
* or rendered, so they are stripped, while safe image types are kept so
|
|
199
|
+
* inline images keep working.
|
|
200
|
+
*/
|
|
201
|
+
if (urlAttributes.includes(lowerName) &&
|
|
202
|
+
normalizedValue.startsWith('data:') &&
|
|
203
|
+
!safeDataImageUri.test(normalizedValue)) {
|
|
124
204
|
element.removeAttribute(attributeName);
|
|
125
205
|
}
|
|
126
|
-
/* eslint-enable */
|
|
127
206
|
}
|
|
128
207
|
/**
|
|
129
208
|
* Sanitize any nested children
|
|
@@ -131,7 +210,7 @@ const sanitizeElement = (element) => {
|
|
|
131
210
|
const childElements = getElementChildren(element);
|
|
132
211
|
/* eslint-disable-next-line */
|
|
133
212
|
for (let i = 0; i < childElements.length; i++) {
|
|
134
|
-
sanitizeElement(childElements[i]);
|
|
213
|
+
sanitizeElement(childElements[i], allowedAttributes, allowedAttributePrefixes);
|
|
135
214
|
}
|
|
136
215
|
};
|
|
137
216
|
/**
|
|
@@ -156,8 +235,185 @@ const isSanitizerEnabled = () => {
|
|
|
156
235
|
}
|
|
157
236
|
return true;
|
|
158
237
|
};
|
|
159
|
-
|
|
160
|
-
|
|
238
|
+
/**
|
|
239
|
+
* Mirror known custom-element DOM properties onto attributes so they
|
|
240
|
+
* survive `cloneNode`. Call this on a DOM subtree before cloning it for
|
|
241
|
+
* rendering elsewhere (e.g. cloning slotted option content into an
|
|
242
|
+
* overlay).
|
|
243
|
+
*
|
|
244
|
+
* Only sets the attribute when the property holds a non-empty string
|
|
245
|
+
* and the attribute isn't already present, so existing attributes
|
|
246
|
+
* take precedence.
|
|
247
|
+
*
|
|
248
|
+
* @param root - The root element whose subtree (and itself) will be
|
|
249
|
+
* inspected.
|
|
250
|
+
*/
|
|
251
|
+
export const reflectPropertiesToAttributes = (root) => {
|
|
252
|
+
const candidates = [];
|
|
253
|
+
if (root.tagName in elementPropsToReflect) {
|
|
254
|
+
candidates.push(root);
|
|
255
|
+
}
|
|
256
|
+
for (const tagName of Object.keys(elementPropsToReflect)) {
|
|
257
|
+
candidates.push(...Array.from(root.querySelectorAll(tagName.toLowerCase())));
|
|
258
|
+
}
|
|
259
|
+
for (const el of candidates) {
|
|
260
|
+
if (!(el.tagName in elementPropsToReflect)) {
|
|
261
|
+
continue;
|
|
262
|
+
}
|
|
263
|
+
const props = elementPropsToReflect[el.tagName];
|
|
264
|
+
for (const prop of props) {
|
|
265
|
+
const value = el[prop];
|
|
266
|
+
if (typeof value === 'string' && value.length > 0 && !el.hasAttribute(prop)) {
|
|
267
|
+
el.setAttribute(prop, value);
|
|
268
|
+
}
|
|
269
|
+
}
|
|
270
|
+
}
|
|
271
|
+
};
|
|
272
|
+
/**
|
|
273
|
+
* Attribute allowlist for `sanitizeDOMString`. Intentionally narrow: this
|
|
274
|
+
* path sanitizes developer HTML strings rendered via `innerHTML` by
|
|
275
|
+
* `ion-toast`, `ion-loading`, the `ion-alert` message,
|
|
276
|
+
* `ion-refresher-content`, and `ion-infinite-scroll-content`, so the list
|
|
277
|
+
* is kept to the minimum those have always needed. Broadening it here would
|
|
278
|
+
* change sanitization output for all of those consumers, so the wider
|
|
279
|
+
* rich-content allowlist below is deliberately scoped to `sanitizeDOMTree`
|
|
280
|
+
* instead.
|
|
281
|
+
*/
|
|
282
|
+
const domStringAllowedAttributes = ['class', 'id', 'href', 'src', 'name', 'slot'];
|
|
283
|
+
/**
|
|
284
|
+
* Attribute allowlist for `sanitizeDOMTree` (the select rich-content path).
|
|
285
|
+
* Covers global HTML attributes, the Ionic component presentational props
|
|
286
|
+
* that cloned rich content (e.g. `ion-select-option` markup) relies on, and
|
|
287
|
+
* the inert SVG presentation attributes used by inline icons.
|
|
288
|
+
*
|
|
289
|
+
* `aria-*` and `data-*` are allowed separately by prefix (refer
|
|
290
|
+
* `richContentAllowedAttributePrefixes`) since they are inert and not worth
|
|
291
|
+
* enumerating. URL-bearing names (`href`, `src`) are allowed here, but
|
|
292
|
+
* their values are still scrubbed for script schemes in `sanitizeElement`.
|
|
293
|
+
*
|
|
294
|
+
* Notably absent: `style`, event handlers (`on*`), and the
|
|
295
|
+
* form/navigation-hijack attributes (`formaction`, `action`, `target`),
|
|
296
|
+
* which are therefore stripped.
|
|
297
|
+
*/
|
|
298
|
+
const richContentAllowedAttributes = [
|
|
299
|
+
// Global / structural
|
|
300
|
+
'class',
|
|
301
|
+
'id',
|
|
302
|
+
'slot',
|
|
303
|
+
'name',
|
|
304
|
+
'title',
|
|
305
|
+
'alt',
|
|
306
|
+
'lang',
|
|
307
|
+
'dir',
|
|
308
|
+
'role',
|
|
309
|
+
'type',
|
|
310
|
+
'value',
|
|
311
|
+
'disabled',
|
|
312
|
+
'width',
|
|
313
|
+
'height',
|
|
314
|
+
'href',
|
|
315
|
+
'src',
|
|
316
|
+
// Ionic component presentational props
|
|
317
|
+
'color',
|
|
318
|
+
'size',
|
|
319
|
+
'shape',
|
|
320
|
+
'fill',
|
|
321
|
+
'expand',
|
|
322
|
+
'mode',
|
|
323
|
+
'theme',
|
|
324
|
+
'icon',
|
|
325
|
+
'label',
|
|
326
|
+
'label-placement',
|
|
327
|
+
'justify',
|
|
328
|
+
'inset',
|
|
329
|
+
'lines',
|
|
330
|
+
'ios',
|
|
331
|
+
'md',
|
|
332
|
+
// SVG presentation attributes (compared lowercased, e.g. `viewBox`)
|
|
333
|
+
'xmlns',
|
|
334
|
+
'viewbox',
|
|
335
|
+
'preserveaspectratio',
|
|
336
|
+
'stroke',
|
|
337
|
+
'stroke-width',
|
|
338
|
+
'stroke-linecap',
|
|
339
|
+
'stroke-linejoin',
|
|
340
|
+
'stroke-opacity',
|
|
341
|
+
'stroke-dasharray',
|
|
342
|
+
'fill-rule',
|
|
343
|
+
'fill-opacity',
|
|
344
|
+
'clip-rule',
|
|
345
|
+
'd',
|
|
346
|
+
'points',
|
|
347
|
+
'cx',
|
|
348
|
+
'cy',
|
|
349
|
+
'r',
|
|
350
|
+
'rx',
|
|
351
|
+
'ry',
|
|
352
|
+
'x',
|
|
353
|
+
'y',
|
|
354
|
+
'x1',
|
|
355
|
+
'y1',
|
|
356
|
+
'x2',
|
|
357
|
+
'y2',
|
|
358
|
+
'transform',
|
|
359
|
+
'opacity',
|
|
360
|
+
];
|
|
361
|
+
/**
|
|
362
|
+
* Attribute-name prefixes that are always safe to keep in the rich-content
|
|
363
|
+
* path. `aria-*` and `data-*` attributes cannot execute script or load
|
|
364
|
+
* resources, so they are allowed wholesale rather than enumerated by name.
|
|
365
|
+
*/
|
|
366
|
+
const richContentAllowedAttributePrefixes = ['aria-', 'data-'];
|
|
367
|
+
/**
|
|
368
|
+
* Whether an attribute name (already lowercased) is safe to keep, by exact
|
|
369
|
+
* match or by an allowed prefix.
|
|
370
|
+
*/
|
|
371
|
+
const isAttributeAllowed = (lowerName, allowedAttributes, allowedAttributePrefixes) => {
|
|
372
|
+
if (allowedAttributes.includes(lowerName)) {
|
|
373
|
+
return true;
|
|
374
|
+
}
|
|
375
|
+
return allowedAttributePrefixes.some((prefix) => lowerName.startsWith(prefix));
|
|
376
|
+
};
|
|
377
|
+
/**
|
|
378
|
+
* Matches ASCII control characters and whitespace (including the
|
|
379
|
+
* non-breaking space). Used to normalize attribute values before matching
|
|
380
|
+
* a URL scheme so entity-obfuscated payloads such as `java	script:`
|
|
381
|
+
* (decoded by the parser to `java\tscript:`) can't smuggle a scheme past
|
|
382
|
+
* the check.
|
|
383
|
+
*/
|
|
384
|
+
// eslint-disable-next-line no-control-regex -- matching control characters is the point
|
|
385
|
+
const controlCharactersAndWhitespace = /[\u0000-\u0020\u007f-\u00a0]/g;
|
|
386
|
+
/**
|
|
387
|
+
* Attributes whose values are URLs. Their values are scheme-checked in
|
|
388
|
+
* `sanitizeElement` (e.g. `data:` filtering) beyond the script-scheme scrub
|
|
389
|
+
* applied to every attribute.
|
|
390
|
+
*/
|
|
391
|
+
const urlAttributes = ['href', 'src'];
|
|
392
|
+
/**
|
|
393
|
+
* Matches a `data:` URI for a raster image type that cannot carry script.
|
|
394
|
+
* `image/svg+xml` is deliberately excluded (SVG can execute script), as are
|
|
395
|
+
* document types like `text/html` and `application/*`. The value is already
|
|
396
|
+
* lowercased and whitespace-stripped before this is tested.
|
|
397
|
+
*/
|
|
398
|
+
const safeDataImageUri = /^data:image\/(?:png|jpe?g|gif|webp|bmp|avif|x-icon|vnd\.microsoft\.icon)[;,]/;
|
|
399
|
+
/**
|
|
400
|
+
* Tags removed entirely (with their subtree) before attribute sanitization.
|
|
401
|
+
* Exported so tests can assert the set without hardcoding it.
|
|
402
|
+
*/
|
|
403
|
+
export const blockedTags = ['script', 'style', 'iframe', 'meta', 'link', 'object', 'embed', 'base'];
|
|
404
|
+
/**
|
|
405
|
+
* Properties on custom elements that frameworks (Vue, Angular) often
|
|
406
|
+
* set as DOM properties rather than attributes. `cloneNode` only copies
|
|
407
|
+
* attributes, so these values are lost when slotted content is cloned
|
|
408
|
+
* into an overlay. For each known custom element, we mirror the listed
|
|
409
|
+
* properties onto attributes so the cloned copy still has the data it
|
|
410
|
+
* needs to render.
|
|
411
|
+
*
|
|
412
|
+
* Keyed by uppercased tagName so the lookup matches `Element.tagName`.
|
|
413
|
+
*/
|
|
414
|
+
const elementPropsToReflect = {
|
|
415
|
+
'ION-ICON': ['icon', 'name', 'src', 'ios', 'md'],
|
|
416
|
+
};
|
|
161
417
|
export class IonicSafeString {
|
|
162
418
|
constructor(value) {
|
|
163
419
|
this.value = value;
|