@ionic/core 8.8.9-dev.11781024903.1e4268e5 → 8.8.9-dev.11781201980.1b6e8398
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-gallery-item.d.ts +11 -0
- package/components/ion-gallery-item.js +4 -0
- package/components/ion-gallery.js +1 -1
- package/components/ion-grid.js +1 -1
- package/components/ion-header.js +1 -1
- package/components/ion-img.js +1 -1
- package/components/ion-infinite-scroll-content.js +1 -1
- package/components/ion-infinite-scroll.js +1 -1
- package/components/ion-input-otp.js +1 -1
- package/components/ion-input-password-toggle.js +1 -1
- package/components/ion-input.js +1 -1
- package/components/ion-item-divider.js +1 -1
- package/components/ion-item-group.js +1 -1
- package/components/ion-item-option.js +1 -1
- package/components/ion-item-options.js +1 -1
- package/components/ion-item-sliding.js +1 -1
- package/components/ion-item.js +1 -1
- package/components/ion-label.js +1 -1
- package/components/ion-list-header.js +1 -1
- package/components/ion-list.js +1 -1
- package/components/ion-loading.js +1 -1
- package/components/ion-menu-button.js +1 -1
- package/components/ion-menu-toggle.js +1 -1
- package/components/ion-menu.js +1 -1
- package/components/ion-modal.js +1 -1
- package/components/ion-nav-link.js +1 -1
- package/components/ion-nav.js +1 -1
- package/components/ion-note.js +1 -1
- package/components/ion-picker-column-option.js +1 -1
- package/components/ion-picker-legacy-column.js +1 -1
- package/components/ion-picker-legacy.js +1 -1
- package/components/ion-popover.js +1 -1
- package/components/ion-progress-bar.js +1 -1
- package/components/ion-radio-group.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-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-BFZBl0TS.js +4 -0
- package/components/{p-pvh0bjpw.js → p-BVi3gqm6.js} +1 -1
- package/components/{p-D6g8ud1e.js → p-BVk7LVs0.js} +1 -1
- package/components/{p-B9MABkWm.js → p-BdUtZxku.js} +1 -1
- package/components/{p-CzC_ZSgb.js → p-Be8tHurp.js} +1 -1
- package/components/p-C0U8YqYW.js +4 -0
- package/components/{p-C8kBejTT.js → p-CG3ZV6ON.js} +1 -1
- package/components/{p-CBS0sBAa.js → p-CaqTORfV.js} +1 -1
- package/components/{p-D2mReIu8.js → p-CkA0SI9d.js} +1 -1
- package/components/p-Cmql_g3_.js +4 -0
- package/components/p-CsakePQg.js +4 -0
- package/components/{p-CgSn4J7d.js → p-D1gEOh9B.js} +1 -1
- package/components/p-D3qBmaqi.js +4 -0
- package/components/{p-Do7NMUwR.js → p-DGn-jQpr.js} +1 -1
- package/components/p-DH4JHV73.js +4 -0
- package/components/p-DYK0qX7x.js +4 -0
- package/components/{p-Dp2x0MpA.js → p-DfV7pOtM.js} +1 -1
- package/components/{p-BhkGOA7t.js → p-F3N54OKJ.js} +1 -1
- package/components/{p-CgZLVOCc.js → p-MPREydZp.js} +1 -1
- package/components/{p-kKYBfhbe.js → p-OFfrVDLw.js} +1 -1
- package/components/p-iZO3WzZT.js +4 -0
- package/components/{p-LB-QPk3e.js → p-qclL-gNR.js} +1 -1
- package/dist/cjs/index-BJlwOs11.js +171 -0
- package/dist/cjs/index.cjs.js +1 -1
- package/dist/cjs/ion-action-sheet.cjs.entry.js +5 -5
- package/dist/cjs/ion-alert.cjs.entry.js +9 -25
- package/dist/cjs/ion-app_8.cjs.entry.js +7 -7
- package/dist/cjs/ion-avatar_3.cjs.entry.js +2 -2
- package/dist/cjs/ion-col_3.cjs.entry.js +4 -4
- package/dist/cjs/ion-datetime_3.cjs.entry.js +4 -4
- package/dist/cjs/ion-gallery-item.cjs.entry.js +60 -0
- package/dist/cjs/ion-gallery.cjs.entry.js +91 -13
- package/dist/cjs/ion-img.cjs.entry.js +2 -2
- package/dist/cjs/ion-infinite-scroll_2.cjs.entry.js +4 -4
- package/dist/cjs/ion-input-otp.cjs.entry.js +3 -3
- package/dist/cjs/ion-input-password-toggle.cjs.entry.js +3 -3
- package/dist/cjs/ion-input.cjs.entry.js +4 -4
- package/dist/cjs/ion-item-option_3.cjs.entry.js +4 -4
- package/dist/cjs/ion-item_8.cjs.entry.js +16 -15
- package/dist/cjs/ion-loading.cjs.entry.js +3 -3
- package/dist/cjs/ion-menu_3.cjs.entry.js +6 -6
- package/dist/cjs/ion-modal.cjs.entry.js +4 -4
- package/dist/cjs/ion-nav_2.cjs.entry.js +2 -2
- package/dist/cjs/ion-picker-column-option.cjs.entry.js +2 -2
- package/dist/cjs/ion-popover.cjs.entry.js +2 -2
- package/dist/cjs/ion-progress-bar.cjs.entry.js +1 -1
- package/dist/cjs/ion-radio_2.cjs.entry.js +5 -5
- package/dist/cjs/ion-range.cjs.entry.js +3 -3
- package/dist/cjs/ion-refresher_2.cjs.entry.js +4 -4
- package/dist/cjs/ion-reorder_2.cjs.entry.js +3 -3
- package/dist/cjs/ion-ripple-effect.cjs.entry.js +1 -1
- package/dist/cjs/ion-route_4.cjs.entry.js +2 -2
- package/dist/cjs/ion-searchbar.cjs.entry.js +4 -4
- 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 +10 -30
- package/dist/cjs/ion-select_3.cjs.entry.js +43 -102
- 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 +3 -3
- package/dist/cjs/ion-toast.cjs.entry.js +3 -3
- 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/select-option-render-C7klBX2H.js +81 -0
- package/dist/collection/collection-manifest.json +2 -1
- package/dist/collection/components/action-sheet/action-sheet.ionic.css +506 -163
- package/dist/collection/components/action-sheet/action-sheet.ios.css +27 -288
- package/dist/collection/components/action-sheet/action-sheet.md.css +27 -228
- package/dist/collection/components/alert/alert.ionic.css +797 -416
- package/dist/collection/components/alert/alert.ios.css +40 -402
- package/dist/collection/components/alert/alert.js +4 -20
- package/dist/collection/components/alert/alert.md.css +50 -385
- package/dist/collection/components/gallery/gallery.css +1 -86
- package/dist/collection/components/gallery/gallery.js +92 -13
- package/dist/collection/components/gallery/test/utils.js +16 -16
- package/dist/collection/components/gallery-item/gallery-item.css +88 -0
- package/dist/collection/components/gallery-item/gallery-item.js +100 -0
- package/dist/collection/components/grid/grid.js +2 -2
- package/dist/collection/components/header/header.js +2 -2
- package/dist/collection/components/img/img.js +2 -2
- package/dist/collection/components/infinite-scroll/infinite-scroll.js +1 -1
- package/dist/collection/components/infinite-scroll-content/infinite-scroll-content.js +2 -2
- package/dist/collection/components/input/input.js +4 -4
- package/dist/collection/components/input-otp/input-otp.js +3 -3
- package/dist/collection/components/input-password-toggle/input-password-toggle.js +3 -3
- package/dist/collection/components/item/item.ionic.css +17 -5
- package/dist/collection/components/item/item.js +3 -2
- package/dist/collection/components/item-divider/item-divider.js +2 -2
- package/dist/collection/components/item-group/item-group.js +1 -1
- package/dist/collection/components/item-option/item-option.js +2 -2
- package/dist/collection/components/item-options/item-options.js +1 -1
- package/dist/collection/components/item-sliding/item-sliding.js +1 -1
- package/dist/collection/components/label/label.js +2 -2
- package/dist/collection/components/list/list.js +1 -1
- package/dist/collection/components/list-header/list-header.js +2 -2
- package/dist/collection/components/loading/loading.js +2 -2
- package/dist/collection/components/menu/menu.js +2 -2
- package/dist/collection/components/menu-button/menu-button.js +2 -2
- package/dist/collection/components/menu-toggle/menu-toggle.js +2 -2
- package/dist/collection/components/modal/modal.js +4 -4
- package/dist/collection/components/nav/nav.js +1 -1
- package/dist/collection/components/nav-link/nav-link.js +1 -1
- package/dist/collection/components/note/note.js +2 -2
- package/dist/collection/components/picker-column-option/picker-column-option.js +2 -2
- package/dist/collection/components/picker-legacy/picker.js +2 -2
- package/dist/collection/components/picker-legacy-column/picker-column.js +2 -2
- package/dist/collection/components/popover/popover.js +2 -2
- package/dist/collection/components/progress-bar/progress-bar.js +1 -1
- package/dist/collection/components/radio/radio.js +3 -3
- package/dist/collection/components/radio-group/radio-group.js +2 -2
- 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 +2 -2
- package/dist/collection/components/reorder/reorder.js +2 -2
- 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/router-link/router-link.js +2 -2
- package/dist/collection/components/router-outlet/router-outlet.js +1 -1
- package/dist/collection/components/row/row.js +2 -2
- package/dist/collection/components/searchbar/searchbar.js +4 -4
- 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.js +32 -72
- package/dist/collection/components/select-modal/select-modal.ionic.css +29 -139
- package/dist/collection/components/select-modal/select-modal.ios.css +7 -379
- package/dist/collection/components/select-modal/select-modal.js +5 -25
- package/dist/collection/components/select-modal/select-modal.md.css +7 -319
- package/dist/collection/components/select-option/select-option.js +1 -39
- package/dist/collection/components/select-popover/select-popover.ionic.css +376 -129
- package/dist/collection/components/select-popover/select-popover.ios.css +69 -252
- package/dist/collection/components/select-popover/select-popover.js +6 -25
- package/dist/collection/components/select-popover/select-popover.md.css +27 -273
- 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 +3 -3
- package/dist/collection/components/thumbnail/thumbnail.js +2 -2
- 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/utils/sanitization/index.js +14 -255
- package/dist/collection/utils/select-option-render.js +24 -59
- package/dist/docs.json +87 -69
- package/dist/esm/index-D4ugF_sT.js +168 -0
- package/dist/esm/index.js +1 -1
- package/dist/esm/ion-action-sheet.entry.js +5 -5
- package/dist/esm/ion-alert.entry.js +9 -25
- package/dist/esm/ion-app_8.entry.js +7 -7
- package/dist/esm/ion-avatar_3.entry.js +2 -2
- package/dist/esm/ion-col_3.entry.js +4 -4
- package/dist/esm/ion-datetime_3.entry.js +4 -4
- package/dist/esm/ion-gallery-item.entry.js +58 -0
- package/dist/esm/ion-gallery.entry.js +91 -13
- package/dist/esm/ion-img.entry.js +2 -2
- package/dist/esm/ion-infinite-scroll_2.entry.js +4 -4
- package/dist/esm/ion-input-otp.entry.js +3 -3
- package/dist/esm/ion-input-password-toggle.entry.js +3 -3
- package/dist/esm/ion-input.entry.js +4 -4
- package/dist/esm/ion-item-option_3.entry.js +4 -4
- package/dist/esm/ion-item_8.entry.js +16 -15
- package/dist/esm/ion-loading.entry.js +3 -3
- package/dist/esm/ion-menu_3.entry.js +6 -6
- package/dist/esm/ion-modal.entry.js +4 -4
- package/dist/esm/ion-nav_2.entry.js +2 -2
- package/dist/esm/ion-picker-column-option.entry.js +2 -2
- package/dist/esm/ion-popover.entry.js +2 -2
- package/dist/esm/ion-progress-bar.entry.js +1 -1
- package/dist/esm/ion-radio_2.entry.js +5 -5
- package/dist/esm/ion-range.entry.js +3 -3
- package/dist/esm/ion-refresher_2.entry.js +4 -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 +2 -2
- package/dist/esm/ion-searchbar.entry.js +4 -4
- 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 +10 -30
- package/dist/esm/ion-select_3.entry.js +43 -102
- 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 +3 -3
- package/dist/esm/ion-toast.entry.js +3 -3
- package/dist/esm/ion-toggle.entry.js +3 -3
- package/dist/esm/ionic.js +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/esm/select-option-render-B2qc5ZP7.js +79 -0
- package/dist/html.html-data.json +42 -27
- package/dist/ionic/index.esm.js +1 -1
- package/dist/ionic/ionic.esm.js +1 -1
- package/dist/ionic/{p-f52856cb.entry.js → p-0592c549.entry.js} +1 -1
- package/dist/ionic/{p-67c2d349.entry.js → p-0aa510cd.entry.js} +1 -1
- package/dist/ionic/{p-9ccfb733.entry.js → p-0cd5fd9d.entry.js} +1 -1
- package/dist/ionic/p-0e9d4e11.entry.js +4 -0
- package/dist/ionic/{p-497f6391.entry.js → p-11a38333.entry.js} +1 -1
- package/dist/ionic/{p-0030507d.entry.js → p-1a009a51.entry.js} +1 -1
- package/dist/ionic/{p-7186786e.entry.js → p-23e524f8.entry.js} +1 -1
- package/dist/ionic/{p-1439fecb.entry.js → p-2826761a.entry.js} +1 -1
- package/dist/ionic/{p-93315d96.entry.js → p-2c4170d8.entry.js} +1 -1
- package/dist/ionic/p-2d5a2511.entry.js +4 -0
- package/dist/ionic/{p-7f294078.entry.js → p-3706ea52.entry.js} +1 -1
- package/dist/ionic/{p-b69add0e.entry.js → p-3e376501.entry.js} +1 -1
- package/dist/ionic/{p-c684a3b6.entry.js → p-44597202.entry.js} +1 -1
- package/dist/ionic/{p-8458f1b6.entry.js → p-4a27a79a.entry.js} +1 -1
- package/dist/ionic/{p-b7235e85.entry.js → p-4f07113d.entry.js} +1 -1
- package/dist/ionic/{p-88e7f52a.entry.js → p-52b85650.entry.js} +1 -1
- package/dist/ionic/{p-199bffb3.entry.js → p-5a6e0ae1.entry.js} +1 -1
- package/dist/ionic/p-6906dca7.entry.js +4 -0
- package/dist/ionic/p-75a1ca50.entry.js +4 -0
- package/dist/ionic/{p-19a1ff9a.entry.js → p-7b09c19d.entry.js} +1 -1
- package/dist/ionic/{p-76c70824.entry.js → p-7b886782.entry.js} +1 -1
- package/dist/ionic/p-7da8b262.entry.js +4 -0
- package/dist/ionic/{p-89eab395.entry.js → p-82c05be2.entry.js} +1 -1
- package/dist/ionic/{p-b653f4c2.entry.js → p-83c0eb9b.entry.js} +1 -1
- package/dist/ionic/{p-b4fd91b8.entry.js → p-85ff1314.entry.js} +1 -1
- package/dist/ionic/p-88048796.entry.js +4 -0
- package/dist/ionic/{p-3f18dfe9.entry.js → p-8eca5ba1.entry.js} +1 -1
- package/dist/ionic/p-96f52444.entry.js +4 -0
- package/dist/ionic/p-CFjI63GE.js +4 -0
- package/dist/ionic/p-CWJdc8f_.js +4 -0
- package/dist/ionic/{p-f2f740aa.entry.js → p-a3b047e0.entry.js} +1 -1
- package/dist/ionic/{p-40d9e029.entry.js → p-a73caa5e.entry.js} +1 -1
- package/dist/ionic/{p-1ad16c09.entry.js → p-b0dfd018.entry.js} +1 -1
- package/dist/ionic/{p-a3f9be52.entry.js → p-b6130fe4.entry.js} +1 -1
- package/dist/ionic/p-c0558552.entry.js +4 -0
- package/dist/ionic/{p-084c2623.entry.js → p-c5f745b4.entry.js} +1 -1
- package/dist/ionic/{p-bc3d68ff.entry.js → p-c781241c.entry.js} +1 -1
- package/dist/ionic/p-cb154afe.entry.js +4 -0
- package/dist/ionic/{p-b847907d.entry.js → p-cde69f38.entry.js} +1 -1
- package/dist/ionic/{p-70ee89c9.entry.js → p-d6f0a698.entry.js} +1 -1
- package/dist/ionic/{p-dd2981d0.entry.js → p-d9804d04.entry.js} +1 -1
- package/dist/ionic/{p-7054a1b9.entry.js → p-e342b205.entry.js} +1 -1
- package/dist/ionic/{p-9dfbe98d.entry.js → p-e8916b04.entry.js} +1 -1
- package/dist/ionic/{p-dac1d4de.entry.js → p-f10f8f95.entry.js} +1 -1
- package/dist/types/components/gallery/gallery.d.ts +41 -8
- package/dist/types/components/gallery/test/utils.d.ts +2 -1
- package/dist/types/components/gallery-item/gallery-item.d.ts +33 -0
- package/dist/types/components/select/select-interface.d.ts +0 -8
- package/dist/types/components/select-option/select-option.d.ts +0 -32
- package/dist/types/components.d.ts +33 -18
- package/dist/types/utils/sanitization/index.d.ts +2 -54
- package/dist/types/utils/select-option-render.d.ts +0 -31
- package/hydrate/index.js +380 -645
- package/hydrate/index.mjs +380 -645
- package/package.json +1 -1
- package/components/p-BP_TU_4l.js +0 -4
- package/components/p-BqTwa6uT.js +0 -4
- package/components/p-Bxiu1dAN.js +0 -4
- package/components/p-C91NnY87.js +0 -4
- package/components/p-CODBQrPj.js +0 -4
- package/components/p-GElQZ38c.js +0 -4
- package/components/p-WdrzoonY.js +0 -4
- package/components/p-h64_gZrH.js +0 -4
- package/components/p-sehKq5RI.js +0 -4
- package/dist/cjs/index-Dm4Dm7Vg.js +0 -414
- package/dist/cjs/overlay-control-label-DnRLQR1t.js +0 -52
- package/dist/cjs/select-option-render-DQyZnlF5.js +0 -116
- package/dist/collection/utils/overlay-control-label.js +0 -47
- package/dist/esm/index-Bmyj8b0z.js +0 -409
- package/dist/esm/overlay-control-label-CODBQrPj.js +0 -49
- package/dist/esm/select-option-render-QGJ9tZHa.js +0 -114
- package/dist/ionic/p-18ed37e3.entry.js +0 -4
- package/dist/ionic/p-2049aa81.entry.js +0 -4
- package/dist/ionic/p-290778c1.entry.js +0 -4
- package/dist/ionic/p-2aa7567e.entry.js +0 -4
- package/dist/ionic/p-2e7e3da1.entry.js +0 -4
- package/dist/ionic/p-CODBQrPj.js +0 -4
- package/dist/ionic/p-CxRK9GyE.js +0 -4
- package/dist/ionic/p-NqPMS7BP.js +0 -4
- package/dist/ionic/p-c94fbdab.entry.js +0 -4
- package/dist/ionic/p-e89848b2.entry.js +0 -4
- package/dist/ionic/p-ff09d2a5.entry.js +0 -4
- package/dist/types/utils/overlay-control-label.d.ts +0 -34
|
@@ -1,116 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* (C) Ionic http://ionicframework.com - MIT License
|
|
3
|
-
*/
|
|
4
|
-
'use strict';
|
|
5
|
-
|
|
6
|
-
var index = require('./index-CzcLEdQ5.js');
|
|
7
|
-
var index$1 = require('./index-Dm4Dm7Vg.js');
|
|
8
|
-
|
|
9
|
-
/**
|
|
10
|
-
* Converts a DOM node into a Stencil VNode (or text string) so the
|
|
11
|
-
* resulting tree is rendered through the component's normal render
|
|
12
|
-
* path. Rendering through Stencil ensures that scoped CSS classes
|
|
13
|
-
* (e.g. `sc-ion-action-sheet-ionic`) are applied to every element.
|
|
14
|
-
*
|
|
15
|
-
* Highly recommended to pre-sanitize the source DOM (see
|
|
16
|
-
* `getOptionContent` in select.tsx). This function performs pure
|
|
17
|
-
* structural conversion — no security filtering.
|
|
18
|
-
*
|
|
19
|
-
* Preserves attributes only — properties set imperatively on the source
|
|
20
|
-
* element (e.g. `input.value` after a user types) won't carry through.
|
|
21
|
-
* In practice this isn't a concern: interactive controls shouldn't
|
|
22
|
-
* appear in select-option rich content since they'd nest inside the
|
|
23
|
-
* overlay's button/radio/checkbox wrapper, which is invalid HTML and
|
|
24
|
-
* an accessibility issue.
|
|
25
|
-
*
|
|
26
|
-
* @param node - The DOM node to convert. Text nodes become strings,
|
|
27
|
-
* element nodes become VNodes, and any other node types are skipped.
|
|
28
|
-
* @param keyPrefix - String prefix used to build a stable VNode key,
|
|
29
|
-
* so Stencil's diff can preserve elements across re-renders.
|
|
30
|
-
* @param index - Position of this node among its siblings. Combined
|
|
31
|
-
* with `keyPrefix` to form the final unique key.
|
|
32
|
-
* @returns The converted VNode, a text string, or `null` if the node
|
|
33
|
-
* type isn't supported.
|
|
34
|
-
*
|
|
35
|
-
* @internal Exported only so it can be unit tested; not part of the
|
|
36
|
-
* public API.
|
|
37
|
-
*/
|
|
38
|
-
const cloneToVNode = (node, keyPrefix, index$1) => {
|
|
39
|
-
var _a;
|
|
40
|
-
if (node.nodeType === Node.TEXT_NODE) {
|
|
41
|
-
return (_a = node.textContent) !== null && _a !== void 0 ? _a : '';
|
|
42
|
-
}
|
|
43
|
-
if (node.nodeType !== Node.ELEMENT_NODE) {
|
|
44
|
-
return null;
|
|
45
|
-
}
|
|
46
|
-
const el = node;
|
|
47
|
-
const tag = el.tagName.toLowerCase();
|
|
48
|
-
const key = `${keyPrefix}-${index$1}`;
|
|
49
|
-
const attrs = { key };
|
|
50
|
-
for (let i = 0; i < el.attributes.length; i++) {
|
|
51
|
-
const attr = el.attributes.item(i);
|
|
52
|
-
attrs[attr.name] = attr.value;
|
|
53
|
-
}
|
|
54
|
-
const children = Array.from(el.childNodes)
|
|
55
|
-
.map((child, i) => cloneToVNode(child, key, i))
|
|
56
|
-
.filter((c) => c !== null);
|
|
57
|
-
return index.h(tag, attrs, children);
|
|
58
|
-
};
|
|
59
|
-
/**
|
|
60
|
-
* Renders cloned DOM content as Stencil JSX. Walking the source DOM
|
|
61
|
-
* into VNodes (rather than injecting it via innerHTML) keeps the
|
|
62
|
-
* content inside Stencil's render path, so scoped CSS classes are
|
|
63
|
-
* applied automatically and component attributes like `size` or
|
|
64
|
-
* `color` survive intact.
|
|
65
|
-
*
|
|
66
|
-
* Span elements should be used when this content renders within buttons,
|
|
67
|
-
* depending on the select interface. Buttons can only have phrasing
|
|
68
|
-
* content to prevent accessibility issues.
|
|
69
|
-
*
|
|
70
|
-
* @param id - Unique identifier for generating stable virtual DOM keys.
|
|
71
|
-
* @param content - The HTMLElement container whose child nodes will be cloned.
|
|
72
|
-
* @param className - CSS class applied to the wrapper element.
|
|
73
|
-
* @param useSpan - Whether to use a span element instead of a div for the wrapper.
|
|
74
|
-
*/
|
|
75
|
-
const renderClonedContent = (id, content, className, useSpan = false) => {
|
|
76
|
-
const Tag = useSpan ? 'span' : 'div';
|
|
77
|
-
const keyPrefix = `${className}-${id}`;
|
|
78
|
-
index$1.sanitizeDOMTree(content);
|
|
79
|
-
return (index.h(Tag, { class: className, key: keyPrefix }, Array.from(content.childNodes).map((child, i) => cloneToVNode(child, keyPrefix, i))));
|
|
80
|
-
};
|
|
81
|
-
/**
|
|
82
|
-
* Renders the label content for a select option within an overlay
|
|
83
|
-
* interface based on the presence of rich content.
|
|
84
|
-
*
|
|
85
|
-
* Span elements should be used when this content renders within buttons,
|
|
86
|
-
* depending on the select interface. Buttons can only have phrasing
|
|
87
|
-
* content to prevent accessibility issues.
|
|
88
|
-
*
|
|
89
|
-
* @param option - The content option data containing label, slots,
|
|
90
|
-
* and description.
|
|
91
|
-
* @param className - The base CSS class for the label element.
|
|
92
|
-
* @param useSpan - Whether to use a span element instead of a div for the label.
|
|
93
|
-
*/
|
|
94
|
-
const renderOptionLabel = (option, className, useSpan = false) => {
|
|
95
|
-
const { id, label, startContent, endContent, description } = option;
|
|
96
|
-
const hasRichContent = !!startContent || !!endContent || !!description;
|
|
97
|
-
const Tag = useSpan ? 'span' : 'div';
|
|
98
|
-
// Render simple string label if there is no rich content to display
|
|
99
|
-
if (!hasRichContent && (typeof label === 'string' || !label)) {
|
|
100
|
-
return (index.h(Tag, { class: className, key: `${className}-${id}` }, label));
|
|
101
|
-
}
|
|
102
|
-
// Render the main label
|
|
103
|
-
const labelEl = typeof label === 'string' || !label ? (
|
|
104
|
-
// Label is a simple string or undefined
|
|
105
|
-
index.h(Tag, { key: `${className}-label-${id}` }, label)) : (
|
|
106
|
-
// Label is an HTMLElement with potential rich content
|
|
107
|
-
renderClonedContent(id, label, `${className}-text`, useSpan));
|
|
108
|
-
// No rich content, render just the label
|
|
109
|
-
if (!hasRichContent) {
|
|
110
|
-
return (index.h(Tag, { class: className, key: `${className}-${id}` }, labelEl));
|
|
111
|
-
}
|
|
112
|
-
// Render label with rich content (start, end, description)
|
|
113
|
-
return (index.h(Tag, { class: `${className} ${className}-has-rich-content`, key: `${className}-${id}` }, startContent && renderClonedContent(id, startContent, 'select-option-start', useSpan), index.h(Tag, { class: "select-option-content", key: `${className}-content-${id}` }, labelEl, description && (index.h(Tag, { class: "select-option-description", key: `${className}-desc-${id}` }, description))), endContent && renderClonedContent(id, endContent, 'select-option-end', useSpan)));
|
|
114
|
-
};
|
|
115
|
-
|
|
116
|
-
exports.renderOptionLabel = renderOptionLabel;
|
|
@@ -1,47 +0,0 @@
|
|
|
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 theme, 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 theme's established
|
|
8
|
-
* option-row layout:
|
|
9
|
-
* - `ionic`: always `"start"`.
|
|
10
|
-
* - `ios`: `"start"` for radio in `alert` and `popover`. The `modal`
|
|
11
|
-
* interface flips iOS radio back to `"end"`. Checkbox is always
|
|
12
|
-
* `"end"` on iOS.
|
|
13
|
-
* - everything else (e.g. `md`): `"end"`.
|
|
14
|
-
*
|
|
15
|
-
* `interfaceType` is optional; only `"modal"` changes the result, so
|
|
16
|
-
* callers that aren't a modal can omit it.
|
|
17
|
-
*
|
|
18
|
-
* Used by `alert`, `select-popover`, and `select-modal` as the fallback
|
|
19
|
-
* when an option doesn't explicitly set `labelPlacement`.
|
|
20
|
-
*/
|
|
21
|
-
export const getOverlayLabelPlacement = (theme, control, interfaceType) => {
|
|
22
|
-
if (theme === 'ionic' || (theme === 'ios' && control === 'radio' && interfaceType !== 'modal')) {
|
|
23
|
-
return 'start';
|
|
24
|
-
}
|
|
25
|
-
return 'end';
|
|
26
|
-
};
|
|
27
|
-
/**
|
|
28
|
-
* Returns the default `justify` for a radio or checkbox option rendered
|
|
29
|
-
* inside an overlay. Defaults follow each theme's option-row layout:
|
|
30
|
-
* - `ionic`: always `"space-between"`.
|
|
31
|
-
* - `ios`: `"space-between"` for radio in `alert` and `popover`. The
|
|
32
|
-
* `modal` interface falls back to `"start"`. Checkbox is always `"start"`
|
|
33
|
-
* on iOS.
|
|
34
|
-
* - everything else (e.g. `md`): `"start"`.
|
|
35
|
-
*
|
|
36
|
-
* `interfaceType` is optional; only `"modal"` changes the result, so
|
|
37
|
-
* callers that aren't a modal can omit it.
|
|
38
|
-
*
|
|
39
|
-
* Used by `alert`, `select-popover`, and `select-modal` as the fallback when
|
|
40
|
-
* an option doesn't explicitly set `justify`.
|
|
41
|
-
*/
|
|
42
|
-
export const getOverlayLabelJustify = (theme, control, interfaceType) => {
|
|
43
|
-
if (theme === 'ionic' || (theme === 'ios' && control === 'radio' && interfaceType !== 'modal')) {
|
|
44
|
-
return 'space-between';
|
|
45
|
-
}
|
|
46
|
-
return 'start';
|
|
47
|
-
};
|
|
@@ -1,409 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* (C) Ionic http://ionicframework.com - MIT License
|
|
3
|
-
*/
|
|
4
|
-
import { j as printIonError } from './index-Omi_TcwW.js';
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* Sanitize an untrusted HTML string.
|
|
8
|
-
*
|
|
9
|
-
* Parses the string into a detached DOM, removes blocked tags, strips
|
|
10
|
-
* attributes outside the `allowedAttributes` list (refer `sanitizeElement`),
|
|
11
|
-
* and scrubs script-scheme URLs. Returns the sanitized 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; both apply the same attribute policy.
|
|
17
|
-
*
|
|
18
|
-
* @param untrustedString - The HTML string to sanitize. Pass an
|
|
19
|
-
* `IonicSafeString` to bypass sanitization, or `undefined` to short-circuit.
|
|
20
|
-
* @returns The sanitized HTML string, or `undefined` if the input was
|
|
21
|
-
* `undefined`. Returns `''` if sanitization fails or the input contains
|
|
22
|
-
* an inline `onload=` handler.
|
|
23
|
-
*/
|
|
24
|
-
const sanitizeDOMString = (untrustedString) => {
|
|
25
|
-
try {
|
|
26
|
-
if (untrustedString instanceof IonicSafeString) {
|
|
27
|
-
return untrustedString.value;
|
|
28
|
-
}
|
|
29
|
-
if (!isSanitizerEnabled() || typeof untrustedString !== 'string' || untrustedString === '') {
|
|
30
|
-
return untrustedString;
|
|
31
|
-
}
|
|
32
|
-
/**
|
|
33
|
-
* onload is fired when appending to a document
|
|
34
|
-
* fragment in Chrome. If a string
|
|
35
|
-
* contains onload then we should not
|
|
36
|
-
* attempt to add this to the fragment.
|
|
37
|
-
*/
|
|
38
|
-
if (untrustedString.includes('onload=')) {
|
|
39
|
-
return '';
|
|
40
|
-
}
|
|
41
|
-
/**
|
|
42
|
-
* Create a document fragment
|
|
43
|
-
* separate from the main DOM,
|
|
44
|
-
* create a div to do our work in
|
|
45
|
-
*/
|
|
46
|
-
const documentFragment = document.createDocumentFragment();
|
|
47
|
-
const workingDiv = document.createElement('div');
|
|
48
|
-
documentFragment.appendChild(workingDiv);
|
|
49
|
-
workingDiv.innerHTML = untrustedString;
|
|
50
|
-
/**
|
|
51
|
-
* Remove any elements
|
|
52
|
-
* that are blocked
|
|
53
|
-
*/
|
|
54
|
-
blockedTags.forEach((blockedTag) => {
|
|
55
|
-
const getElementsToRemove = documentFragment.querySelectorAll(blockedTag);
|
|
56
|
-
for (let elementIndex = getElementsToRemove.length - 1; elementIndex >= 0; elementIndex--) {
|
|
57
|
-
const element = getElementsToRemove[elementIndex];
|
|
58
|
-
if (element.parentNode) {
|
|
59
|
-
element.parentNode.removeChild(element);
|
|
60
|
-
}
|
|
61
|
-
else {
|
|
62
|
-
documentFragment.removeChild(element);
|
|
63
|
-
}
|
|
64
|
-
/**
|
|
65
|
-
* We still need to sanitize
|
|
66
|
-
* the children of this element
|
|
67
|
-
* as they are left behind
|
|
68
|
-
*/
|
|
69
|
-
const childElements = getElementChildren(element);
|
|
70
|
-
/* eslint-disable-next-line */
|
|
71
|
-
for (let childIndex = 0; childIndex < childElements.length; childIndex++) {
|
|
72
|
-
sanitizeElement(childElements[childIndex]);
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
});
|
|
76
|
-
/**
|
|
77
|
-
* Go through remaining elements and remove
|
|
78
|
-
* non-allowed attribs
|
|
79
|
-
*/
|
|
80
|
-
// IE does not support .children on document fragments, only .childNodes
|
|
81
|
-
const dfChildren = getElementChildren(documentFragment);
|
|
82
|
-
/* eslint-disable-next-line */
|
|
83
|
-
for (let childIndex = 0; childIndex < dfChildren.length; childIndex++) {
|
|
84
|
-
sanitizeElement(dfChildren[childIndex]);
|
|
85
|
-
}
|
|
86
|
-
// Append document fragment to div
|
|
87
|
-
const fragmentDiv = document.createElement('div');
|
|
88
|
-
fragmentDiv.appendChild(documentFragment);
|
|
89
|
-
// First child is always the div we did our work in
|
|
90
|
-
const getInnerDiv = fragmentDiv.querySelector('div');
|
|
91
|
-
return getInnerDiv !== null ? getInnerDiv.innerHTML : fragmentDiv.innerHTML;
|
|
92
|
-
}
|
|
93
|
-
catch (err) {
|
|
94
|
-
printIonError('sanitizeDOMString', err);
|
|
95
|
-
return '';
|
|
96
|
-
}
|
|
97
|
-
};
|
|
98
|
-
/**
|
|
99
|
-
* Sanitize an entire trusted DOM tree in place.
|
|
100
|
-
*
|
|
101
|
-
* Removes blocked tags (`script`, `iframe`, etc.) from the subtree and
|
|
102
|
-
* then sanitizes attributes on every remaining element using the same
|
|
103
|
-
* allowlist policy as `sanitizeDOMString` (refer `sanitizeElement`).
|
|
104
|
-
* Component presentational attributes (`size`, `color`, `shape`, inline
|
|
105
|
-
* SVG, `aria-*`, `data-*`) are preserved; `style`, event handlers (`on*`),
|
|
106
|
-
* form/navigation-hijack attributes, script-scheme URLs, and non-image
|
|
107
|
-
* `data:` URLs are stripped.
|
|
108
|
-
*
|
|
109
|
-
* Use this when you have a DOM tree the developer controls (e.g.
|
|
110
|
-
* cloned slot content from a component) and you need to render it
|
|
111
|
-
* elsewhere safely.
|
|
112
|
-
*
|
|
113
|
-
* @param root - The root element whose subtree will be sanitized in
|
|
114
|
-
* place. No-op when the sanitizer is disabled via `Ionic.config`.
|
|
115
|
-
*/
|
|
116
|
-
const sanitizeDOMTree = (root) => {
|
|
117
|
-
if (!isSanitizerEnabled()) {
|
|
118
|
-
return;
|
|
119
|
-
}
|
|
120
|
-
blockedTags.forEach((tag) => {
|
|
121
|
-
const matches = root.querySelectorAll(tag);
|
|
122
|
-
for (let i = matches.length - 1; i >= 0; i--) {
|
|
123
|
-
matches[i].remove();
|
|
124
|
-
}
|
|
125
|
-
});
|
|
126
|
-
sanitizeElement(root);
|
|
127
|
-
};
|
|
128
|
-
/**
|
|
129
|
-
* Clean up current element based on allowed attributes
|
|
130
|
-
* and then recursively dig down into any child elements to
|
|
131
|
-
* clean those up as well
|
|
132
|
-
*/
|
|
133
|
-
// TODO(FW-2832): type (using Element triggers other type errors as well)
|
|
134
|
-
const sanitizeElement = (element) => {
|
|
135
|
-
// IE uses childNodes, so ignore nodes that are not elements
|
|
136
|
-
if (element.nodeType && element.nodeType !== 1) {
|
|
137
|
-
return;
|
|
138
|
-
}
|
|
139
|
-
/**
|
|
140
|
-
* If attributes is not a NamedNodeMap
|
|
141
|
-
* then we should remove the element entirely.
|
|
142
|
-
* This helps avoid DOM Clobbering attacks where
|
|
143
|
-
* attributes is overridden.
|
|
144
|
-
*/
|
|
145
|
-
if (typeof NamedNodeMap !== 'undefined' && !(element.attributes instanceof NamedNodeMap)) {
|
|
146
|
-
element.remove();
|
|
147
|
-
return;
|
|
148
|
-
}
|
|
149
|
-
/**
|
|
150
|
-
* Always strip `style` (CSS injection, `background:url()` beaconing, UI
|
|
151
|
-
* spoofing). It is never on the allowlist, but it is removed explicitly
|
|
152
|
-
* here because some engines (e.g. jsdom) don't enumerate the CSSOM-backed
|
|
153
|
-
* `style` attribute in `element.attributes`, which would let the loop
|
|
154
|
-
* below skip over it.
|
|
155
|
-
*/
|
|
156
|
-
element.removeAttribute('style');
|
|
157
|
-
for (let i = element.attributes.length - 1; i >= 0; i--) {
|
|
158
|
-
const attribute = element.attributes.item(i);
|
|
159
|
-
const attributeName = attribute.name;
|
|
160
|
-
const lowerName = attributeName.toLowerCase();
|
|
161
|
-
/**
|
|
162
|
-
* Remove any attribute that is not on the allowlist. This drops event
|
|
163
|
-
* handlers (`on*`), `style`, the form/navigation-hijack attributes
|
|
164
|
-
* (`formaction`, `action`, `target`), namespaced attributes like
|
|
165
|
-
* `xlink:href`, and anything else not explicitly known to be safe.
|
|
166
|
-
*/
|
|
167
|
-
if (!isAttributeAllowed(lowerName)) {
|
|
168
|
-
element.removeAttribute(attributeName);
|
|
169
|
-
continue;
|
|
170
|
-
}
|
|
171
|
-
// clean up any allowed attribs
|
|
172
|
-
// that attempt to do any JS funny-business
|
|
173
|
-
const attributeValue = attribute.value;
|
|
174
|
-
if (attributeValue == null) {
|
|
175
|
-
continue;
|
|
176
|
-
}
|
|
177
|
-
/**
|
|
178
|
-
* Scrub dangerous schemes from the value. The value is normalized first
|
|
179
|
-
* (whitespace and ASCII control characters removed) so entity-obfuscated
|
|
180
|
-
* payloads such as `java	script:`, which the parser decodes to
|
|
181
|
-
* `java\tscript:`, are still caught. Normalizing the value also covers
|
|
182
|
-
* namespaced attributes, where the previous `element[attributeName]`
|
|
183
|
-
* property reflection returned `undefined` and let them slip through.
|
|
184
|
-
*/
|
|
185
|
-
const normalizedValue = attributeValue.replace(controlCharactersAndWhitespace, '').toLowerCase();
|
|
186
|
-
// Script schemes are never allowed, on any attribute.
|
|
187
|
-
if (normalizedValue.includes('javascript:') || normalizedValue.includes('vbscript:')) {
|
|
188
|
-
element.removeAttribute(attributeName);
|
|
189
|
-
continue;
|
|
190
|
-
}
|
|
191
|
-
/**
|
|
192
|
-
* For URL-bearing attributes, allow `data:` URIs only for raster
|
|
193
|
-
* images. Document-bearing types (`text/html`, `image/svg+xml`,
|
|
194
|
-
* `application/*`, etc.) can carry markup or script when navigated to
|
|
195
|
-
* or rendered, so they are stripped, while safe image types are kept so
|
|
196
|
-
* inline images keep working.
|
|
197
|
-
*/
|
|
198
|
-
if (urlAttributes.includes(lowerName) &&
|
|
199
|
-
normalizedValue.startsWith('data:') &&
|
|
200
|
-
!safeDataImageUri.test(normalizedValue)) {
|
|
201
|
-
element.removeAttribute(attributeName);
|
|
202
|
-
}
|
|
203
|
-
}
|
|
204
|
-
/**
|
|
205
|
-
* Sanitize any nested children
|
|
206
|
-
*/
|
|
207
|
-
const childElements = getElementChildren(element);
|
|
208
|
-
/* eslint-disable-next-line */
|
|
209
|
-
for (let i = 0; i < childElements.length; i++) {
|
|
210
|
-
sanitizeElement(childElements[i]);
|
|
211
|
-
}
|
|
212
|
-
};
|
|
213
|
-
/**
|
|
214
|
-
* IE doesn't always support .children
|
|
215
|
-
* so we revert to .childNodes instead
|
|
216
|
-
*/
|
|
217
|
-
// TODO(FW-2832): type
|
|
218
|
-
const getElementChildren = (el) => {
|
|
219
|
-
return el.children != null ? el.children : el.childNodes;
|
|
220
|
-
};
|
|
221
|
-
const isSanitizerEnabled = () => {
|
|
222
|
-
var _a;
|
|
223
|
-
const win = window;
|
|
224
|
-
const config = (_a = win === null || win === void 0 ? void 0 : win.Ionic) === null || _a === void 0 ? void 0 : _a.config;
|
|
225
|
-
if (config) {
|
|
226
|
-
if (config.get) {
|
|
227
|
-
return config.get('sanitizerEnabled', true);
|
|
228
|
-
}
|
|
229
|
-
else {
|
|
230
|
-
return config.sanitizerEnabled === true || config.sanitizerEnabled === undefined;
|
|
231
|
-
}
|
|
232
|
-
}
|
|
233
|
-
return true;
|
|
234
|
-
};
|
|
235
|
-
/**
|
|
236
|
-
* Mirror known custom-element DOM properties onto attributes so they
|
|
237
|
-
* survive `cloneNode`. Call this on a DOM subtree before cloning it for
|
|
238
|
-
* rendering elsewhere (e.g. cloning slotted option content into an
|
|
239
|
-
* overlay).
|
|
240
|
-
*
|
|
241
|
-
* Only sets the attribute when the property holds a non-empty string
|
|
242
|
-
* and the attribute isn't already present, so existing attributes
|
|
243
|
-
* take precedence.
|
|
244
|
-
*
|
|
245
|
-
* @param root - The root element whose subtree (and itself) will be
|
|
246
|
-
* inspected.
|
|
247
|
-
*/
|
|
248
|
-
const reflectPropertiesToAttributes = (root) => {
|
|
249
|
-
const candidates = [];
|
|
250
|
-
if (root.tagName in elementPropsToReflect) {
|
|
251
|
-
candidates.push(root);
|
|
252
|
-
}
|
|
253
|
-
for (const tagName of Object.keys(elementPropsToReflect)) {
|
|
254
|
-
candidates.push(...Array.from(root.querySelectorAll(tagName.toLowerCase())));
|
|
255
|
-
}
|
|
256
|
-
for (const el of candidates) {
|
|
257
|
-
if (!(el.tagName in elementPropsToReflect)) {
|
|
258
|
-
continue;
|
|
259
|
-
}
|
|
260
|
-
const props = elementPropsToReflect[el.tagName];
|
|
261
|
-
for (const prop of props) {
|
|
262
|
-
const value = el[prop];
|
|
263
|
-
if (typeof value === 'string' && value.length > 0 && !el.hasAttribute(prop)) {
|
|
264
|
-
el.setAttribute(prop, value);
|
|
265
|
-
}
|
|
266
|
-
}
|
|
267
|
-
}
|
|
268
|
-
};
|
|
269
|
-
/**
|
|
270
|
-
* Attribute names that are always safe to keep. Covers global HTML
|
|
271
|
-
* attributes, the Ionic component presentational props that cloned rich
|
|
272
|
-
* content (e.g. `ion-select-option` markup) relies on, and the inert SVG
|
|
273
|
-
* presentation attributes used by inline icons.
|
|
274
|
-
*
|
|
275
|
-
* `aria-*` and `data-*` are allowed separately by prefix (refer
|
|
276
|
-
* `allowedAttributePrefixes`) since they are inert and not worth
|
|
277
|
-
* enumerating. URL-bearing names (`href`, `src`) are allowed here, but
|
|
278
|
-
* their values are still scrubbed for script schemes in `sanitizeElement`.
|
|
279
|
-
*
|
|
280
|
-
* Notably absent: `style`, event handlers (`on*`), and the
|
|
281
|
-
* form/navigation-hijack attributes (`formaction`, `action`, `target`),
|
|
282
|
-
* which are therefore stripped.
|
|
283
|
-
*/
|
|
284
|
-
const allowedAttributes = [
|
|
285
|
-
// Global / structural
|
|
286
|
-
'class',
|
|
287
|
-
'id',
|
|
288
|
-
'slot',
|
|
289
|
-
'name',
|
|
290
|
-
'title',
|
|
291
|
-
'alt',
|
|
292
|
-
'lang',
|
|
293
|
-
'dir',
|
|
294
|
-
'role',
|
|
295
|
-
'type',
|
|
296
|
-
'value',
|
|
297
|
-
'disabled',
|
|
298
|
-
'width',
|
|
299
|
-
'height',
|
|
300
|
-
'href',
|
|
301
|
-
'src',
|
|
302
|
-
// Ionic component presentational props
|
|
303
|
-
'color',
|
|
304
|
-
'size',
|
|
305
|
-
'shape',
|
|
306
|
-
'fill',
|
|
307
|
-
'expand',
|
|
308
|
-
'mode',
|
|
309
|
-
'theme',
|
|
310
|
-
'icon',
|
|
311
|
-
'label',
|
|
312
|
-
'label-placement',
|
|
313
|
-
'justify',
|
|
314
|
-
'inset',
|
|
315
|
-
'lines',
|
|
316
|
-
'ios',
|
|
317
|
-
'md',
|
|
318
|
-
// SVG presentation attributes (compared lowercased, e.g. `viewBox`)
|
|
319
|
-
'xmlns',
|
|
320
|
-
'viewbox',
|
|
321
|
-
'preserveaspectratio',
|
|
322
|
-
'stroke',
|
|
323
|
-
'stroke-width',
|
|
324
|
-
'stroke-linecap',
|
|
325
|
-
'stroke-linejoin',
|
|
326
|
-
'stroke-opacity',
|
|
327
|
-
'stroke-dasharray',
|
|
328
|
-
'fill-rule',
|
|
329
|
-
'fill-opacity',
|
|
330
|
-
'clip-rule',
|
|
331
|
-
'd',
|
|
332
|
-
'points',
|
|
333
|
-
'cx',
|
|
334
|
-
'cy',
|
|
335
|
-
'r',
|
|
336
|
-
'rx',
|
|
337
|
-
'ry',
|
|
338
|
-
'x',
|
|
339
|
-
'y',
|
|
340
|
-
'x1',
|
|
341
|
-
'y1',
|
|
342
|
-
'x2',
|
|
343
|
-
'y2',
|
|
344
|
-
'transform',
|
|
345
|
-
'opacity',
|
|
346
|
-
];
|
|
347
|
-
/**
|
|
348
|
-
* Attribute-name prefixes that are always safe to keep. `aria-*` and
|
|
349
|
-
* `data-*` attributes cannot execute script or load resources, so they are
|
|
350
|
-
* allowed wholesale rather than enumerated by name.
|
|
351
|
-
*/
|
|
352
|
-
const allowedAttributePrefixes = ['aria-', 'data-'];
|
|
353
|
-
/**
|
|
354
|
-
* Whether an attribute name (already lowercased) is safe to keep, by exact
|
|
355
|
-
* match or by an allowed prefix.
|
|
356
|
-
*/
|
|
357
|
-
const isAttributeAllowed = (lowerName) => {
|
|
358
|
-
if (allowedAttributes.includes(lowerName)) {
|
|
359
|
-
return true;
|
|
360
|
-
}
|
|
361
|
-
return allowedAttributePrefixes.some((prefix) => lowerName.startsWith(prefix));
|
|
362
|
-
};
|
|
363
|
-
/**
|
|
364
|
-
* Matches ASCII control characters and whitespace (including the
|
|
365
|
-
* non-breaking space). Used to normalize attribute values before matching
|
|
366
|
-
* a URL scheme so entity-obfuscated payloads such as `java	script:`
|
|
367
|
-
* (decoded by the parser to `java\tscript:`) can't smuggle a scheme past
|
|
368
|
-
* the check.
|
|
369
|
-
*/
|
|
370
|
-
// eslint-disable-next-line no-control-regex -- matching control characters is the point
|
|
371
|
-
const controlCharactersAndWhitespace = /[\u0000-\u0020\u007f-\u00a0]/g;
|
|
372
|
-
/**
|
|
373
|
-
* Attributes whose values are URLs. Their values are scheme-checked in
|
|
374
|
-
* `sanitizeElement` (e.g. `data:` filtering) beyond the script-scheme scrub
|
|
375
|
-
* applied to every attribute.
|
|
376
|
-
*/
|
|
377
|
-
const urlAttributes = ['href', 'src'];
|
|
378
|
-
/**
|
|
379
|
-
* Matches a `data:` URI for a raster image type that cannot carry script.
|
|
380
|
-
* `image/svg+xml` is deliberately excluded (SVG can execute script), as are
|
|
381
|
-
* document types like `text/html` and `application/*`. The value is already
|
|
382
|
-
* lowercased and whitespace-stripped before this is tested.
|
|
383
|
-
*/
|
|
384
|
-
const safeDataImageUri = /^data:image\/(?:png|jpe?g|gif|webp|bmp|avif|x-icon|vnd\.microsoft\.icon)[;,]/;
|
|
385
|
-
/**
|
|
386
|
-
* Tags removed entirely (with their subtree) before attribute sanitization.
|
|
387
|
-
* Exported so tests can assert the set without hardcoding it.
|
|
388
|
-
*/
|
|
389
|
-
const blockedTags = ['script', 'style', 'iframe', 'meta', 'link', 'object', 'embed', 'base'];
|
|
390
|
-
/**
|
|
391
|
-
* Properties on custom elements that frameworks (Vue, Angular) often
|
|
392
|
-
* set as DOM properties rather than attributes. `cloneNode` only copies
|
|
393
|
-
* attributes, so these values are lost when slotted content is cloned
|
|
394
|
-
* into an overlay. For each known custom element, we mirror the listed
|
|
395
|
-
* properties onto attributes so the cloned copy still has the data it
|
|
396
|
-
* needs to render.
|
|
397
|
-
*
|
|
398
|
-
* Keyed by uppercased tagName so the lookup matches `Element.tagName`.
|
|
399
|
-
*/
|
|
400
|
-
const elementPropsToReflect = {
|
|
401
|
-
'ION-ICON': ['icon', 'name', 'src', 'ios', 'md'],
|
|
402
|
-
};
|
|
403
|
-
class IonicSafeString {
|
|
404
|
-
constructor(value) {
|
|
405
|
-
this.value = value;
|
|
406
|
-
}
|
|
407
|
-
}
|
|
408
|
-
|
|
409
|
-
export { IonicSafeString as I, sanitizeDOMTree as a, reflectPropertiesToAttributes as r, sanitizeDOMString as s };
|
|
@@ -1,49 +0,0 @@
|
|
|
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 theme, 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 theme's established
|
|
8
|
-
* option-row layout:
|
|
9
|
-
* - `ionic`: always `"start"`.
|
|
10
|
-
* - `ios`: `"start"` for radio in `alert` and `popover`. The `modal`
|
|
11
|
-
* interface flips iOS radio back to `"end"`. Checkbox is always
|
|
12
|
-
* `"end"` on iOS.
|
|
13
|
-
* - everything else (e.g. `md`): `"end"`.
|
|
14
|
-
*
|
|
15
|
-
* `interfaceType` is optional; only `"modal"` changes the result, so
|
|
16
|
-
* callers that aren't a modal can omit it.
|
|
17
|
-
*
|
|
18
|
-
* Used by `alert`, `select-popover`, and `select-modal` as the fallback
|
|
19
|
-
* when an option doesn't explicitly set `labelPlacement`.
|
|
20
|
-
*/
|
|
21
|
-
const getOverlayLabelPlacement = (theme, control, interfaceType) => {
|
|
22
|
-
if (theme === 'ionic' || (theme === 'ios' && control === 'radio' && interfaceType !== 'modal')) {
|
|
23
|
-
return 'start';
|
|
24
|
-
}
|
|
25
|
-
return 'end';
|
|
26
|
-
};
|
|
27
|
-
/**
|
|
28
|
-
* Returns the default `justify` for a radio or checkbox option rendered
|
|
29
|
-
* inside an overlay. Defaults follow each theme's option-row layout:
|
|
30
|
-
* - `ionic`: always `"space-between"`.
|
|
31
|
-
* - `ios`: `"space-between"` for radio in `alert` and `popover`. The
|
|
32
|
-
* `modal` interface falls back to `"start"`. Checkbox is always `"start"`
|
|
33
|
-
* on iOS.
|
|
34
|
-
* - everything else (e.g. `md`): `"start"`.
|
|
35
|
-
*
|
|
36
|
-
* `interfaceType` is optional; only `"modal"` changes the result, so
|
|
37
|
-
* callers that aren't a modal can omit it.
|
|
38
|
-
*
|
|
39
|
-
* Used by `alert`, `select-popover`, and `select-modal` as the fallback when
|
|
40
|
-
* an option doesn't explicitly set `justify`.
|
|
41
|
-
*/
|
|
42
|
-
const getOverlayLabelJustify = (theme, control, interfaceType) => {
|
|
43
|
-
if (theme === 'ionic' || (theme === 'ios' && control === 'radio' && interfaceType !== 'modal')) {
|
|
44
|
-
return 'space-between';
|
|
45
|
-
}
|
|
46
|
-
return 'start';
|
|
47
|
-
};
|
|
48
|
-
|
|
49
|
-
export { getOverlayLabelPlacement as a, getOverlayLabelJustify as g };
|