@ionic/core 8.8.9-dev.11780493937.17fe092d → 8.8.9-dev.11780683233.1c5e9d9b
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/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-content.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-footer.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-7kL3tltU.js +4 -0
- package/components/{p-CPm7KgOP.js → p-BFZBl0TS.js} +1 -1
- 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-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-DAXhdEp5.js → p-CsakePQg.js} +1 -1
- package/components/{p-CgSn4J7d.js → p-D1gEOh9B.js} +1 -1
- package/components/{p-IYdTEyGb.js → p-D3qBmaqi.js} +1 -1
- package/components/{p-Do7NMUwR.js → p-DGn-jQpr.js} +1 -1
- package/components/p-DH4JHV73.js +4 -0
- package/components/{p-DCS3n7Uq.js → p-DYK0qX7x.js} +1 -1
- 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-qclL-gNR.js +4 -0
- package/dist/cjs/ion-app_8.cjs.entry.js +33 -291
- 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 +79 -0
- package/dist/cjs/ion-gallery.cjs.entry.js +96 -14
- package/dist/cjs/ion-img.cjs.entry.js +2 -2
- package/dist/cjs/ion-infinite-scroll_2.cjs.entry.js +3 -3
- 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 +12 -12
- package/dist/cjs/ion-loading.cjs.entry.js +2 -2
- 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 +3 -3
- 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 +1 -1
- package/dist/cjs/ion-select_3.cjs.entry.js +6 -6
- 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 +2 -2
- 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/collection/collection-manifest.json +1 -0
- package/dist/collection/components/content/content.css +0 -56
- package/dist/collection/components/footer/footer.ios.css +0 -13
- package/dist/collection/components/footer/footer.js +18 -65
- package/dist/collection/components/footer/footer.md.css +0 -13
- package/dist/collection/components/footer/footer.utils.js +0 -9
- package/dist/collection/components/gallery/gallery.css +1 -86
- package/dist/collection/components/gallery/gallery.js +85 -16
- package/dist/collection/components/gallery/test/utils.js +13 -13
- package/dist/collection/components/gallery-item/gallery-item.css +87 -0
- package/dist/collection/components/gallery-item/gallery-item.js +95 -0
- package/dist/collection/components/grid/grid.js +2 -2
- package/dist/collection/components/header/header.ionic.css +0 -75
- package/dist/collection/components/header/header.ios.css +0 -75
- package/dist/collection/components/header/header.js +11 -41
- package/dist/collection/components/header/header.md.css +0 -75
- package/dist/collection/components/header/header.utils.js +0 -9
- 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-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 +3 -3
- package/dist/collection/components/select-modal/select-modal.js +1 -1
- package/dist/collection/components/select-option/select-option.js +1 -1
- package/dist/collection/components/select-popover/select-popover.js +2 -2
- 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/css-value-validation.js +14 -0
- package/dist/docs.json +96 -20
- package/dist/esm/ion-app_8.entry.js +33 -291
- 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 +77 -0
- package/dist/esm/ion-gallery.entry.js +96 -14
- package/dist/esm/ion-img.entry.js +2 -2
- package/dist/esm/ion-infinite-scroll_2.entry.js +3 -3
- 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 +12 -12
- package/dist/esm/ion-loading.entry.js +2 -2
- 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 +3 -3
- 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 +1 -1
- package/dist/esm/ion-select_3.entry.js +6 -6
- 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 +2 -2
- 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/html.html-data.json +45 -9
- package/dist/ionic/ionic.esm.js +1 -1
- package/dist/ionic/{p-f7ca50a5.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-bf0c5a8d.entry.js → p-0e9d4e11.entry.js} +1 -1
- 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-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-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-3f18dfe9.entry.js → p-8eca5ba1.entry.js} +1 -1
- package/dist/ionic/{p-f08edb25.entry.js → p-96f52444.entry.js} +1 -1
- package/dist/ionic/{p-f167c55c.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-084c2623.entry.js → p-c5f745b4.entry.js} +1 -1
- package/dist/ionic/{p-52ed96a8.entry.js → p-c781241c.entry.js} +1 -1
- package/dist/ionic/p-cb154afe.entry.js +4 -0
- package/dist/ionic/{p-031df892.entry.js → p-cde69f38.entry.js} +1 -1
- package/dist/ionic/p-d6f0a698.entry.js +4 -0
- 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-e4071bf8.entry.js +4 -0
- 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/ionic/p-fdcbe59a.entry.js +4 -0
- package/dist/types/components/footer/footer.d.ts +2 -12
- package/dist/types/components/footer/footer.utils.d.ts +0 -1
- package/dist/types/components/gallery/gallery.d.ts +33 -8
- package/dist/types/components/gallery/test/utils.d.ts +1 -1
- package/dist/types/components/gallery-item/gallery-item.d.ts +35 -0
- package/dist/types/components/header/header.d.ts +3 -10
- package/dist/types/components/header/header.utils.d.ts +0 -1
- package/dist/types/components.d.ts +41 -12
- package/dist/types/utils/css-value-validation.d.ts +9 -0
- package/hydrate/index.js +334 -421
- package/hydrate/index.mjs +334 -421
- package/package.json +1 -1
- package/components/p-BF5oFX1I.js +0 -4
- package/components/p-CpFORZud.js +0 -4
- package/components/p-GElQZ38c.js +0 -4
- package/components/p-d77Zk1DK.js +0 -4
- package/components/p-hdGd8ben.js +0 -4
- package/dist/collection/utils/on-scroll/collapse-hide.utils.js +0 -168
- package/dist/ionic/p-04b5794c.entry.js +0 -4
- package/dist/ionic/p-2aa7567e.entry.js +0 -4
- package/dist/ionic/p-44d483c2.entry.js +0 -4
- package/dist/ionic/p-ad4d0138.entry.js +0 -4
- package/dist/ionic/p-ff09d2a5.entry.js +0 -4
- package/dist/types/utils/on-scroll/collapse-hide.utils.d.ts +0 -26
|
@@ -6,15 +6,13 @@ import { findIonContent, getScrollElement, printIonContentErrorMsg } from "../..
|
|
|
6
6
|
import { createKeyboardController } from "../../utils/keyboard/keyboard-controller";
|
|
7
7
|
import { config } from "../../global/config";
|
|
8
8
|
import { getIonTheme } from "../../global/ionic-global";
|
|
9
|
-
import { handleFooterFade
|
|
9
|
+
import { handleFooterFade } from "./footer.utils";
|
|
10
10
|
/**
|
|
11
11
|
* @virtualProp {"ios" | "md"} mode - The mode determines the platform behaviors of the component.
|
|
12
12
|
* @virtualProp {"ios" | "md" | "ionic"} theme - The theme determines the visual appearance of the component.
|
|
13
13
|
*/
|
|
14
14
|
export class Footer {
|
|
15
15
|
constructor() {
|
|
16
|
-
this.didLoad = false;
|
|
17
|
-
this.setupToken = 0;
|
|
18
16
|
this.keyboardCtrl = null;
|
|
19
17
|
this.keyboardCtrlPromise = null;
|
|
20
18
|
this.keyboardVisible = false;
|
|
@@ -29,45 +27,25 @@ export class Footer {
|
|
|
29
27
|
this.translucent = false;
|
|
30
28
|
this.checkCollapsibleFooter = () => {
|
|
31
29
|
const theme = getIonTheme(this);
|
|
32
|
-
|
|
33
|
-
const hasFade = collapse === 'fade';
|
|
34
|
-
const hasHide = collapse === 'hide';
|
|
35
|
-
const runIosFade = theme === 'ios' && hasFade;
|
|
36
|
-
if (!runIosFade && !hasHide) {
|
|
37
|
-
this.destroyCollapsibleFooter();
|
|
38
|
-
return;
|
|
39
|
-
}
|
|
40
|
-
// Skip teardown/rebuild when the collapse mode and theme have not changed
|
|
41
|
-
// since the last setup — avoids thrashing listeners and resetting scroll
|
|
42
|
-
// accumulators on unrelated re-renders (e.g. keyboardVisible state flips).
|
|
43
|
-
const activeMode = hasHide ? 'hide' : 'fade';
|
|
44
|
-
if (this.appliedCollapse === activeMode && this.appliedTheme === theme) {
|
|
30
|
+
if (theme !== 'ios') {
|
|
45
31
|
return;
|
|
46
32
|
}
|
|
33
|
+
const { collapse } = this;
|
|
34
|
+
const hasFade = collapse === 'fade';
|
|
47
35
|
this.destroyCollapsibleFooter();
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
this.appliedTheme = theme;
|
|
57
|
-
if (runIosFade) {
|
|
36
|
+
if (hasFade) {
|
|
37
|
+
const appRootSelector = config.get('appRootSelector', 'ion-app');
|
|
38
|
+
const pageEl = this.el.closest(`${appRootSelector},ion-page,.ion-page,page-inner`);
|
|
39
|
+
const contentEl = pageEl ? findIonContent(pageEl) : null;
|
|
40
|
+
if (!contentEl) {
|
|
41
|
+
printIonContentErrorMsg(this.el);
|
|
42
|
+
return;
|
|
43
|
+
}
|
|
58
44
|
this.setupFadeFooter(contentEl);
|
|
59
45
|
}
|
|
60
|
-
else if (hasHide) {
|
|
61
|
-
void this.setupHideFooter(contentEl);
|
|
62
|
-
}
|
|
63
46
|
};
|
|
64
47
|
this.setupFadeFooter = async (contentEl) => {
|
|
65
|
-
const
|
|
66
|
-
const scrollEl = await getScrollElement(contentEl);
|
|
67
|
-
if (token !== this.setupToken) {
|
|
68
|
-
return;
|
|
69
|
-
}
|
|
70
|
-
this.scrollEl = scrollEl;
|
|
48
|
+
const scrollEl = (this.scrollEl = await getScrollElement(contentEl));
|
|
71
49
|
/**
|
|
72
50
|
* Handle fading of toolbars on scroll
|
|
73
51
|
*/
|
|
@@ -79,18 +57,12 @@ export class Footer {
|
|
|
79
57
|
};
|
|
80
58
|
}
|
|
81
59
|
componentDidLoad() {
|
|
82
|
-
this.didLoad = true;
|
|
83
60
|
this.checkCollapsibleFooter();
|
|
84
61
|
}
|
|
85
62
|
componentDidUpdate() {
|
|
86
63
|
this.checkCollapsibleFooter();
|
|
87
64
|
}
|
|
88
65
|
async connectedCallback() {
|
|
89
|
-
// On re-attach (didLoad already true but disconnectedCallback ran since),
|
|
90
|
-
// componentDidLoad will not fire again — re-run setup here.
|
|
91
|
-
if (this.didLoad) {
|
|
92
|
-
this.checkCollapsibleFooter();
|
|
93
|
-
}
|
|
94
66
|
const promise = createKeyboardController(async (keyboardOpen, waitForResize) => {
|
|
95
67
|
/**
|
|
96
68
|
* If the keyboard is hiding, then we need to wait
|
|
@@ -118,7 +90,6 @@ export class Footer {
|
|
|
118
90
|
}
|
|
119
91
|
}
|
|
120
92
|
disconnectedCallback() {
|
|
121
|
-
this.destroyCollapsibleFooter();
|
|
122
93
|
if (this.keyboardCtrlPromise) {
|
|
123
94
|
this.keyboardCtrlPromise.then((ctrl) => ctrl.destroy());
|
|
124
95
|
this.keyboardCtrlPromise = null;
|
|
@@ -128,36 +99,18 @@ export class Footer {
|
|
|
128
99
|
this.keyboardCtrl = null;
|
|
129
100
|
}
|
|
130
101
|
}
|
|
131
|
-
async setupHideFooter(contentEl) {
|
|
132
|
-
const token = ++this.setupToken;
|
|
133
|
-
const scrollEl = await getScrollElement(contentEl);
|
|
134
|
-
// A newer checkCollapsibleFooter ran while we were awaiting — abandon.
|
|
135
|
-
if (token !== this.setupToken) {
|
|
136
|
-
return;
|
|
137
|
-
}
|
|
138
|
-
this.scrollEl = scrollEl;
|
|
139
|
-
this.footerHideCleanup = createFooterHideInteraction(this.el, scrollEl);
|
|
140
|
-
}
|
|
141
102
|
destroyCollapsibleFooter() {
|
|
142
|
-
// Invalidate any in-flight setupHideFooter/setupFadeFooter awaits.
|
|
143
|
-
this.setupToken++;
|
|
144
|
-
if (this.footerHideCleanup) {
|
|
145
|
-
this.footerHideCleanup();
|
|
146
|
-
this.footerHideCleanup = undefined;
|
|
147
|
-
}
|
|
148
103
|
if (this.scrollEl && this.contentScrollCallback) {
|
|
149
104
|
this.scrollEl.removeEventListener('scroll', this.contentScrollCallback);
|
|
150
105
|
this.contentScrollCallback = undefined;
|
|
151
106
|
}
|
|
152
|
-
this.appliedCollapse = undefined;
|
|
153
|
-
this.appliedTheme = undefined;
|
|
154
107
|
}
|
|
155
108
|
render() {
|
|
156
109
|
const { translucent, collapse } = this;
|
|
157
110
|
const theme = getIonTheme(this);
|
|
158
111
|
const tabs = this.el.closest('ion-tabs');
|
|
159
112
|
const tabBar = tabs === null || tabs === void 0 ? void 0 : tabs.querySelector(':scope > ion-tab-bar');
|
|
160
|
-
return (h(Host, { key: '
|
|
113
|
+
return (h(Host, { key: '4a2989a177b47ee26ffa23e2c9f5418773584796', role: "contentinfo", class: {
|
|
161
114
|
[theme]: true,
|
|
162
115
|
// Used internally for styling
|
|
163
116
|
[`footer-${theme}`]: true,
|
|
@@ -165,7 +118,7 @@ export class Footer {
|
|
|
165
118
|
[`footer-translucent-${theme}`]: translucent,
|
|
166
119
|
['footer-toolbar-padding']: !this.keyboardVisible && (!tabBar || tabBar.slot !== 'bottom'),
|
|
167
120
|
[`footer-collapse-${collapse}`]: collapse !== undefined,
|
|
168
|
-
} }, theme === 'ios' && translucent && h("div", { key: '
|
|
121
|
+
} }, theme === 'ios' && translucent && h("div", { key: 'c644963db3e06254014e398ea02189d6127ccf61', class: "footer-background" }), h("slot", { key: '839e33c6c30f5c1c703239a19458ff10da9a5e76' })));
|
|
169
122
|
}
|
|
170
123
|
static get is() { return "ion-footer"; }
|
|
171
124
|
static get originalStyleUrls() {
|
|
@@ -188,15 +141,15 @@ export class Footer {
|
|
|
188
141
|
"type": "string",
|
|
189
142
|
"mutable": false,
|
|
190
143
|
"complexType": {
|
|
191
|
-
"original": "'fade'
|
|
192
|
-
"resolved": "\"fade\" |
|
|
144
|
+
"original": "'fade'",
|
|
145
|
+
"resolved": "\"fade\" | undefined",
|
|
193
146
|
"references": {}
|
|
194
147
|
},
|
|
195
148
|
"required": false,
|
|
196
149
|
"optional": true,
|
|
197
150
|
"docs": {
|
|
198
151
|
"tags": [],
|
|
199
|
-
"text": "Describes the scroll effect that will be applied to the footer.\
|
|
152
|
+
"text": "Describes the scroll effect that will be applied to the footer.\nOnly applies when the theme is `\"ios\"`."
|
|
200
153
|
},
|
|
201
154
|
"getter": false,
|
|
202
155
|
"setter": false,
|
|
@@ -71,19 +71,6 @@ ion-footer.footer-toolbar-padding ion-toolbar:last-of-type {
|
|
|
71
71
|
padding-bottom: var(--ion-safe-area-bottom, 0);
|
|
72
72
|
}
|
|
73
73
|
|
|
74
|
-
ion-footer.footer-collapse-hide {
|
|
75
|
-
transform: translateY(0);
|
|
76
|
-
transition: transform 300ms cubic-bezier(0, 0, 0.2, 1), opacity 300ms cubic-bezier(0, 0, 0.2, 1);
|
|
77
|
-
opacity: 1;
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
ion-footer.footer-collapse-hide.footer-collapse-hide-hidden {
|
|
81
|
-
transform: translateY(var(--footer-hide-slide-y, 0px));
|
|
82
|
-
pointer-events: none;
|
|
83
|
-
transition: transform 200ms cubic-bezier(0.4, 0, 1, 1), opacity 300ms cubic-bezier(0.4, 0, 1, 1);
|
|
84
|
-
opacity: 0;
|
|
85
|
-
}
|
|
86
|
-
|
|
87
74
|
/**
|
|
88
75
|
* Convert a pixels given value into rem
|
|
89
76
|
*
|
|
@@ -3,7 +3,6 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import { readTask, writeTask } from "@stencil/core";
|
|
5
5
|
import { clamp } from "../../utils/helpers";
|
|
6
|
-
import { createCollapseHideInteraction } from "../../utils/on-scroll/collapse-hide.utils";
|
|
7
6
|
export const handleFooterFade = (scrollEl, baseEl) => {
|
|
8
7
|
readTask(() => {
|
|
9
8
|
const scrollTop = scrollEl.scrollTop;
|
|
@@ -32,11 +31,3 @@ export const handleFooterFade = (scrollEl, baseEl) => {
|
|
|
32
31
|
});
|
|
33
32
|
});
|
|
34
33
|
};
|
|
35
|
-
export const createFooterHideInteraction = (footerEl, scrollEl) => createCollapseHideInteraction({
|
|
36
|
-
regionEl: footerEl,
|
|
37
|
-
scrollEl,
|
|
38
|
-
slideCssVar: '--footer-hide-slide-y',
|
|
39
|
-
contentPartnerClass: 'content-footer-hide-scroll-partner',
|
|
40
|
-
contentHiddenClass: 'content-footer-hide-scroll-hidden',
|
|
41
|
-
regionHiddenClass: 'footer-collapse-hide-hidden',
|
|
42
|
-
});
|
|
@@ -1,64 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Convert a pixels given value into rem
|
|
3
|
-
*
|
|
4
|
-
* @param pixels - Value in pixels to be converted (i.e. px)
|
|
5
|
-
* @param context (optional) - Baseline value
|
|
6
|
-
*/
|
|
7
|
-
/**
|
|
8
|
-
* Convert a font size to a dynamic font size.
|
|
9
|
-
* Fonts that participate in Dynamic Type should use
|
|
10
|
-
* dynamic font sizes.
|
|
11
|
-
* @param size - The initial font size including the unit (i.e. px or pt)
|
|
12
|
-
* @param unit (optional) - The unit to convert to. Use this if you want to
|
|
13
|
-
* convert to a unit other than $baselineUnit.
|
|
14
|
-
*/
|
|
15
|
-
/**
|
|
16
|
-
* Convert a font size to a dynamic font size but impose
|
|
17
|
-
* a maximum font size.
|
|
18
|
-
* @param size - The initial font size including the unit (i.e. px or pt)
|
|
19
|
-
* @param maxScale - The maximum scale of the font (i.e. 2.5 for a maximum 250% scale).
|
|
20
|
-
* @param unit (optional) - The unit to convert the initial font size to. Use this if you want to
|
|
21
|
-
* convert to a unit other than $baselineUnit.
|
|
22
|
-
*/
|
|
23
|
-
/**
|
|
24
|
-
* Convert a font size to a dynamic font size but impose
|
|
25
|
-
* a minimum font size.
|
|
26
|
-
* @param size - The initial font size including the unit (i.e. px or pt)
|
|
27
|
-
* @param minScale - The minimum scale of the font (i.e. 0.8 for a minimum 80% scale).
|
|
28
|
-
* @param unit (optional) - The unit to convert the initial font size to. Use this if you want to
|
|
29
|
-
* convert to a unit other than $baselineUnit.
|
|
30
|
-
*/
|
|
31
|
-
/**
|
|
32
|
-
* Convert a font size to a dynamic font size but impose
|
|
33
|
-
* maximum and minimum font sizes.
|
|
34
|
-
* @param size - The initial font size including the unit (i.e. px or pt)
|
|
35
|
-
* @param minScale - The minimum scale of the font (i.e. 0.8 for a minimum 80% scale).
|
|
36
|
-
* @param maxScale - The maximum scale of the font (i.e. 2.5 for a maximum 250% scale).
|
|
37
|
-
* @param unit (optional) - The unit to convert the initial font size to. Use this if you want to
|
|
38
|
-
* convert to a unit other than $baselineUnit.
|
|
39
|
-
*/
|
|
40
|
-
/**
|
|
41
|
-
* A heuristic that applies CSS to tablet
|
|
42
|
-
* viewports.
|
|
43
|
-
*
|
|
44
|
-
* Usage:
|
|
45
|
-
* @include tablet-viewport() {
|
|
46
|
-
* :host {
|
|
47
|
-
* background-color: green;
|
|
48
|
-
* }
|
|
49
|
-
* }
|
|
50
|
-
*/
|
|
51
|
-
/**
|
|
52
|
-
* A heuristic that applies CSS to mobile
|
|
53
|
-
* viewports (i.e. phones, not tablets).
|
|
54
|
-
*
|
|
55
|
-
* Usage:
|
|
56
|
-
* @include mobile-viewport() {
|
|
57
|
-
* :host {
|
|
58
|
-
* background-color: blue;
|
|
59
|
-
* }
|
|
60
|
-
* }
|
|
61
|
-
*/
|
|
62
1
|
:host {
|
|
63
2
|
display: grid;
|
|
64
3
|
grid-template-columns: repeat(var(--internal-gallery-columns, 2), minmax(0, 1fr));
|
|
@@ -68,33 +7,9 @@
|
|
|
68
7
|
gap: var(--internal-gallery-gap, 16px);
|
|
69
8
|
}
|
|
70
9
|
|
|
71
|
-
:host(.gallery-layout-uniform) ::slotted(*) {
|
|
72
|
-
aspect-ratio: 1/1;
|
|
73
|
-
}
|
|
74
|
-
|
|
75
10
|
:host(.gallery-layout-masonry) {
|
|
76
11
|
align-items: start;
|
|
77
12
|
column-gap: var(--internal-gallery-gap, 16px);
|
|
78
13
|
row-gap: 0;
|
|
79
|
-
grid-auto-rows:
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
:host(.gallery-layout-masonry) ::slotted(*) {
|
|
83
|
-
display: block;
|
|
84
|
-
min-height: unset;
|
|
85
|
-
margin-bottom: var(--internal-gallery-gap, 16px);
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
::slotted(*) {
|
|
89
|
-
margin-left: 0;
|
|
90
|
-
margin-right: 0;
|
|
91
|
-
margin-top: 0;
|
|
92
|
-
margin-bottom: 0;
|
|
93
|
-
width: 100%;
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
::slotted(img) {
|
|
97
|
-
display: block;
|
|
98
|
-
object-fit: cover;
|
|
99
|
-
object-position: center;
|
|
14
|
+
grid-auto-rows: 1px;
|
|
100
15
|
}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* (C) Ionic http://ionicframework.com - MIT License
|
|
3
3
|
*/
|
|
4
4
|
import { Host, h } from "@stencil/core";
|
|
5
|
-
import { isValidLengthPercentage } from "../../utils/css-value-validation";
|
|
5
|
+
import { isCssVariable, isValidLengthPercentage } from "../../utils/css-value-validation";
|
|
6
6
|
import { raf } from "../../utils/helpers";
|
|
7
7
|
import { printIonWarning } from "../../utils/logging/index";
|
|
8
8
|
import { getIonTheme } from "../../global/ionic-global";
|
|
@@ -17,11 +17,16 @@ const BREAKPOINTS = {
|
|
|
17
17
|
xxl: 1400,
|
|
18
18
|
};
|
|
19
19
|
const BREAKPOINT_ORDER = ['xs', 'sm', 'md', 'lg', 'xl', 'xxl'];
|
|
20
|
+
/**
|
|
21
|
+
* The tag of the component used to wrap each gallery item.
|
|
22
|
+
*/
|
|
23
|
+
const GALLERY_ITEM_SELECTOR = 'ion-gallery-item';
|
|
20
24
|
/**
|
|
21
25
|
* @virtualProp {"ios" | "md"} mode - The mode determines the platform behaviors of the component.
|
|
22
26
|
* @virtualProp {"ios" | "md" | "ionic"} theme - The theme determines the visual appearance of the component.
|
|
23
27
|
*
|
|
24
|
-
* @slot -
|
|
28
|
+
* @slot - One or more `ion-gallery-item` components, placed in a responsive
|
|
29
|
+
* gallery layout.
|
|
25
30
|
*/
|
|
26
31
|
export class Gallery {
|
|
27
32
|
constructor() {
|
|
@@ -30,6 +35,7 @@ export class Gallery {
|
|
|
30
35
|
this.hasWarnedInvalidColumns = false;
|
|
31
36
|
this.hasWarnedInvalidGap = false;
|
|
32
37
|
this.hasWarnedUnusedOrder = false;
|
|
38
|
+
this.hasWarnedInvalidItems = false;
|
|
33
39
|
/**
|
|
34
40
|
* The visual layout of the gallery. When `uniform`, rows take up the height
|
|
35
41
|
* of the tallest item and are spaced evenly across the gallery. Additionally,
|
|
@@ -46,7 +52,8 @@ export class Gallery {
|
|
|
46
52
|
/**
|
|
47
53
|
* The space between gallery items. Accepts valid CSS [length-percentage](https://developer.mozilla.org/en-US/docs/Web/CSS/Reference/Values/length-percentage)
|
|
48
54
|
* values like `16px`, `1rem`, `20%`, math functions like `calc(10px + 20%)`,
|
|
49
|
-
* or numbers (treated as pixel
|
|
55
|
+
* CSS variables like `var(--app-gallery-gap)`, or numbers (treated as pixel
|
|
56
|
+
* values). Can also be set as a breakpoint map
|
|
50
57
|
* (e.g. `{ xs: '8px', sm: '1rem', md: '24px' }`). Does not accept
|
|
51
58
|
* space-separated values or CSS keyword values like `inherit`, `auto`, etc.
|
|
52
59
|
*/
|
|
@@ -58,6 +65,9 @@ export class Gallery {
|
|
|
58
65
|
* are added or removed from the gallery.
|
|
59
66
|
*/
|
|
60
67
|
this.onSlotChange = () => {
|
|
68
|
+
// Re-observe so newly added items are watched for size changes (e.g. a
|
|
69
|
+
// freshly appended item finishing hydration), then recompute placement.
|
|
70
|
+
this.observeResizes();
|
|
61
71
|
this.scheduleMasonryResize();
|
|
62
72
|
};
|
|
63
73
|
/**
|
|
@@ -101,7 +111,7 @@ export class Gallery {
|
|
|
101
111
|
this.updateResponsiveStyles();
|
|
102
112
|
this.scheduleMasonryResize();
|
|
103
113
|
});
|
|
104
|
-
this.
|
|
114
|
+
this.observeResizes();
|
|
105
115
|
this.scheduleMasonryResize();
|
|
106
116
|
this.warnUnusedOrder();
|
|
107
117
|
}
|
|
@@ -114,6 +124,22 @@ export class Gallery {
|
|
|
114
124
|
(_a = this.resizeObserver) === null || _a === void 0 ? void 0 : _a.disconnect();
|
|
115
125
|
this.resizeObserver = undefined;
|
|
116
126
|
}
|
|
127
|
+
/**
|
|
128
|
+
* Observe the host and each item for size changes. Items are observed in
|
|
129
|
+
* addition to the host so masonry placement is recomputed when an item's
|
|
130
|
+
* rendered height changes — most importantly when a dynamically added
|
|
131
|
+
* `ion-gallery-item` finishes hydrating, which (unlike an `<img>`) emits no
|
|
132
|
+
* `load` event and does not change the host's measured size while collapsed.
|
|
133
|
+
*/
|
|
134
|
+
observeResizes() {
|
|
135
|
+
const observer = this.resizeObserver;
|
|
136
|
+
if (observer === undefined) {
|
|
137
|
+
return;
|
|
138
|
+
}
|
|
139
|
+
observer.disconnect();
|
|
140
|
+
observer.observe(this.el);
|
|
141
|
+
this.getItems().forEach((item) => observer.observe(item));
|
|
142
|
+
}
|
|
117
143
|
/**
|
|
118
144
|
* Listen for the load event on child elements.
|
|
119
145
|
* When the layout is `masonry`, this listener is used to schedule a resize
|
|
@@ -167,9 +193,10 @@ export class Gallery {
|
|
|
167
193
|
return numericColumns;
|
|
168
194
|
}
|
|
169
195
|
/**
|
|
170
|
-
* Normalize a single gap value (`gap` as a number, string
|
|
171
|
-
*
|
|
172
|
-
*
|
|
196
|
+
* Normalize a single gap value (`gap` as a number, a string such as a CSS
|
|
197
|
+
* length-percentage or `var()` reference, or one entry from a `gap`
|
|
198
|
+
* breakpoint map) to a CSS length string. Returns `undefined` when the
|
|
199
|
+
* input cannot be interpreted as a valid CSS length or `var()` reference.
|
|
173
200
|
*/
|
|
174
201
|
sanitizeGap(gap) {
|
|
175
202
|
if (gap === undefined) {
|
|
@@ -186,6 +213,9 @@ export class Gallery {
|
|
|
186
213
|
if (typeof normalizedGap !== 'string') {
|
|
187
214
|
return undefined;
|
|
188
215
|
}
|
|
216
|
+
if (isCssVariable(normalizedGap)) {
|
|
217
|
+
return normalizedGap;
|
|
218
|
+
}
|
|
189
219
|
const isValidCssLength = isValidLengthPercentage(normalizedGap);
|
|
190
220
|
return isValidCssLength ? normalizedGap : undefined;
|
|
191
221
|
}
|
|
@@ -266,7 +296,7 @@ export class Gallery {
|
|
|
266
296
|
if (this.hasWarnedInvalidGap) {
|
|
267
297
|
return;
|
|
268
298
|
}
|
|
269
|
-
printIonWarning(`[ion-gallery] - Invalid "gap" value (${JSON.stringify(gap)}). Expected a non-negative number, CSS length string, or breakpoint map object (e.g. { xs: 8, md: "1rem" }).`, this.el);
|
|
299
|
+
printIonWarning(`[ion-gallery] - Invalid "gap" value (${JSON.stringify(gap)}). Expected a non-negative number, CSS length string, CSS variable (e.g. var(--app-gap)), or breakpoint map object (e.g. { xs: 8, md: "1rem" }).`, this.el);
|
|
270
300
|
this.hasWarnedInvalidGap = true;
|
|
271
301
|
}
|
|
272
302
|
/**
|
|
@@ -338,11 +368,43 @@ export class Gallery {
|
|
|
338
368
|
this.el.style.setProperty('--internal-gallery-gap', `${gap}`);
|
|
339
369
|
}
|
|
340
370
|
/**
|
|
341
|
-
* Return
|
|
342
|
-
*
|
|
371
|
+
* Return the `ion-gallery-item` elements to place in the grid. Each item is a
|
|
372
|
+
* direct grid cell. A direct child that is not an `ion-gallery-item` is
|
|
373
|
+
* treated as a pass-through wrapper (e.g. a layout `<div>`): its box is
|
|
374
|
+
* collapsed with `display: contents` so the nested items participate in the
|
|
375
|
+
* gallery grid. Children that contain no `ion-gallery-item` are ignored.
|
|
343
376
|
*/
|
|
344
377
|
getItems() {
|
|
345
|
-
|
|
378
|
+
const items = [];
|
|
379
|
+
Array.from(this.el.children).forEach((child) => {
|
|
380
|
+
// Standard path: <ion-gallery-item> is a direct child of <ion-gallery>.
|
|
381
|
+
if (child.matches(GALLERY_ITEM_SELECTOR)) {
|
|
382
|
+
items.push(child);
|
|
383
|
+
return;
|
|
384
|
+
}
|
|
385
|
+
// Compatibility path: a wrapper element may contain <ion-gallery-item>
|
|
386
|
+
// components. Collapse the wrapper's box so the items participate in the
|
|
387
|
+
// gallery grid.
|
|
388
|
+
const nestedItems = Array.from(child.querySelectorAll(GALLERY_ITEM_SELECTOR));
|
|
389
|
+
if (nestedItems.length === 0) {
|
|
390
|
+
this.warnInvalidItems();
|
|
391
|
+
return;
|
|
392
|
+
}
|
|
393
|
+
child.style.display = 'contents';
|
|
394
|
+
items.push(...nestedItems);
|
|
395
|
+
});
|
|
396
|
+
return items;
|
|
397
|
+
}
|
|
398
|
+
/**
|
|
399
|
+
* Warn when the gallery has content that is not wrapped in an
|
|
400
|
+
* `ion-gallery-item` component.
|
|
401
|
+
*/
|
|
402
|
+
warnInvalidItems() {
|
|
403
|
+
if (this.hasWarnedInvalidItems) {
|
|
404
|
+
return;
|
|
405
|
+
}
|
|
406
|
+
printIonWarning(`[ion-gallery] - Gallery items must be wrapped in "ion-gallery-item" components. Direct children that are not "ion-gallery-item" (and do not contain one) are ignored.`, this.el);
|
|
407
|
+
this.hasWarnedInvalidItems = true;
|
|
346
408
|
}
|
|
347
409
|
/**
|
|
348
410
|
* Clear the item styles for the given item element.
|
|
@@ -360,12 +422,19 @@ export class Gallery {
|
|
|
360
422
|
clearMasonryStyles() {
|
|
361
423
|
this.getItems().forEach((itemEl) => this.clearItemStyles(itemEl));
|
|
362
424
|
}
|
|
425
|
+
/**
|
|
426
|
+
* Whether the item contains any images that have not finished loading.
|
|
427
|
+
* Used to defer masonry placement until the rendered height is final.
|
|
428
|
+
*/
|
|
429
|
+
hasUnloadedImages(itemEl) {
|
|
430
|
+
return Array.from(itemEl.querySelectorAll('img')).some((img) => !img.complete || img.naturalHeight === 0);
|
|
431
|
+
}
|
|
363
432
|
/**
|
|
364
433
|
* Convert a rendered item height to the number of grid rows it should span.
|
|
365
|
-
* Returns undefined
|
|
434
|
+
* Returns undefined when the item has images that are not fully loaded yet.
|
|
366
435
|
*/
|
|
367
436
|
calculateRowSpan(itemEl, rowHeight, rowGap) {
|
|
368
|
-
if (
|
|
437
|
+
if (this.hasUnloadedImages(itemEl)) {
|
|
369
438
|
return undefined;
|
|
370
439
|
}
|
|
371
440
|
const height = itemEl.getBoundingClientRect().height;
|
|
@@ -452,11 +521,11 @@ export class Gallery {
|
|
|
452
521
|
const { layout } = this;
|
|
453
522
|
const order = this.getOrder();
|
|
454
523
|
const theme = getIonTheme(this);
|
|
455
|
-
return (h(Host, { key: '
|
|
524
|
+
return (h(Host, { key: '2063823917f4ab8430aee0e17ae0f3a2b53341d1', class: {
|
|
456
525
|
[theme]: true,
|
|
457
526
|
[`gallery-layout-${layout}`]: true,
|
|
458
527
|
[`gallery-order-${order}`]: layout === 'masonry' && order !== undefined,
|
|
459
|
-
} }, h("slot", { key: '
|
|
528
|
+
} }, h("slot", { key: '1378f489afb6b05181d2513f664c4efe24ad3598', onSlotchange: this.onSlotChange })));
|
|
460
529
|
}
|
|
461
530
|
static get is() { return "ion-gallery"; }
|
|
462
531
|
static get encapsulation() { return "shadow"; }
|
|
@@ -557,7 +626,7 @@ export class Gallery {
|
|
|
557
626
|
"optional": false,
|
|
558
627
|
"docs": {
|
|
559
628
|
"tags": [],
|
|
560
|
-
"text": "The space between gallery items. Accepts valid CSS [length-percentage](https://developer.mozilla.org/en-US/docs/Web/CSS/Reference/Values/length-percentage)\nvalues like `16px`, `1rem`, `20%`, math functions like `calc(10px + 20%)`,\
|
|
629
|
+
"text": "The space between gallery items. Accepts valid CSS [length-percentage](https://developer.mozilla.org/en-US/docs/Web/CSS/Reference/Values/length-percentage)\nvalues like `16px`, `1rem`, `20%`, math functions like `calc(10px + 20%)`,\nCSS variables like `var(--app-gallery-gap)`, or numbers (treated as pixel\nvalues). Can also be set as a breakpoint map\n(e.g. `{ xs: '8px', sm: '1rem', md: '24px' }`). Does not accept\nspace-separated values or CSS keyword values like `inherit`, `auto`, etc."
|
|
561
630
|
},
|
|
562
631
|
"getter": false,
|
|
563
632
|
"setter": false,
|
|
@@ -6,57 +6,57 @@ export const sharedStyles = `
|
|
|
6
6
|
width: 343px;
|
|
7
7
|
}
|
|
8
8
|
|
|
9
|
-
div {
|
|
9
|
+
ion-gallery-item div {
|
|
10
10
|
color: #fff;
|
|
11
11
|
height: 150px;
|
|
12
12
|
}
|
|
13
13
|
|
|
14
|
-
|
|
14
|
+
ion-gallery-item:nth-child(1) div {
|
|
15
15
|
background: #ff6b6b;
|
|
16
16
|
}
|
|
17
17
|
|
|
18
|
-
|
|
18
|
+
ion-gallery-item:nth-child(2) div {
|
|
19
19
|
background: #4ecdc4;
|
|
20
20
|
}
|
|
21
21
|
|
|
22
|
-
|
|
22
|
+
ion-gallery-item:nth-child(3) div {
|
|
23
23
|
background: #ffe66d;
|
|
24
24
|
color: #333;
|
|
25
25
|
}
|
|
26
26
|
|
|
27
|
-
|
|
27
|
+
ion-gallery-item:nth-child(4) div {
|
|
28
28
|
background: #5f27cd;
|
|
29
29
|
}
|
|
30
30
|
|
|
31
|
-
|
|
31
|
+
ion-gallery-item:nth-child(5) div {
|
|
32
32
|
background: #7f8c8d;
|
|
33
33
|
}
|
|
34
34
|
|
|
35
|
-
|
|
35
|
+
ion-gallery-item:nth-child(6) div {
|
|
36
36
|
background: #ff9f43;
|
|
37
37
|
}
|
|
38
38
|
|
|
39
|
-
|
|
39
|
+
ion-gallery-item:nth-child(7) div {
|
|
40
40
|
background: #ff3f34;
|
|
41
41
|
}
|
|
42
42
|
|
|
43
|
-
|
|
43
|
+
ion-gallery-item:nth-child(8) div {
|
|
44
44
|
background: #2ecc71;
|
|
45
45
|
}
|
|
46
46
|
|
|
47
|
-
|
|
47
|
+
ion-gallery-item:nth-child(9) div {
|
|
48
48
|
background: #34495e;
|
|
49
49
|
}
|
|
50
50
|
|
|
51
|
-
|
|
51
|
+
ion-gallery-item:nth-child(10) div {
|
|
52
52
|
background: #1abc9c;
|
|
53
53
|
}
|
|
54
54
|
|
|
55
|
-
|
|
55
|
+
ion-gallery-item:nth-child(11) div {
|
|
56
56
|
background: #e67e22;
|
|
57
57
|
}
|
|
58
58
|
|
|
59
|
-
|
|
59
|
+
ion-gallery-item:nth-child(12) div {
|
|
60
60
|
background: #9b59b6;
|
|
61
61
|
}
|
|
62
62
|
`;
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Convert a pixels given value into rem
|
|
3
|
+
*
|
|
4
|
+
* @param pixels - Value in pixels to be converted (i.e. px)
|
|
5
|
+
* @param context (optional) - Baseline value
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* Convert a font size to a dynamic font size.
|
|
9
|
+
* Fonts that participate in Dynamic Type should use
|
|
10
|
+
* dynamic font sizes.
|
|
11
|
+
* @param size - The initial font size including the unit (i.e. px or pt)
|
|
12
|
+
* @param unit (optional) - The unit to convert to. Use this if you want to
|
|
13
|
+
* convert to a unit other than $baselineUnit.
|
|
14
|
+
*/
|
|
15
|
+
/**
|
|
16
|
+
* Convert a font size to a dynamic font size but impose
|
|
17
|
+
* a maximum font size.
|
|
18
|
+
* @param size - The initial font size including the unit (i.e. px or pt)
|
|
19
|
+
* @param maxScale - The maximum scale of the font (i.e. 2.5 for a maximum 250% scale).
|
|
20
|
+
* @param unit (optional) - The unit to convert the initial font size to. Use this if you want to
|
|
21
|
+
* convert to a unit other than $baselineUnit.
|
|
22
|
+
*/
|
|
23
|
+
/**
|
|
24
|
+
* Convert a font size to a dynamic font size but impose
|
|
25
|
+
* a minimum font size.
|
|
26
|
+
* @param size - The initial font size including the unit (i.e. px or pt)
|
|
27
|
+
* @param minScale - The minimum scale of the font (i.e. 0.8 for a minimum 80% scale).
|
|
28
|
+
* @param unit (optional) - The unit to convert the initial font size to. Use this if you want to
|
|
29
|
+
* convert to a unit other than $baselineUnit.
|
|
30
|
+
*/
|
|
31
|
+
/**
|
|
32
|
+
* Convert a font size to a dynamic font size but impose
|
|
33
|
+
* maximum and minimum font sizes.
|
|
34
|
+
* @param size - The initial font size including the unit (i.e. px or pt)
|
|
35
|
+
* @param minScale - The minimum scale of the font (i.e. 0.8 for a minimum 80% scale).
|
|
36
|
+
* @param maxScale - The maximum scale of the font (i.e. 2.5 for a maximum 250% scale).
|
|
37
|
+
* @param unit (optional) - The unit to convert the initial font size to. Use this if you want to
|
|
38
|
+
* convert to a unit other than $baselineUnit.
|
|
39
|
+
*/
|
|
40
|
+
/**
|
|
41
|
+
* A heuristic that applies CSS to tablet
|
|
42
|
+
* viewports.
|
|
43
|
+
*
|
|
44
|
+
* Usage:
|
|
45
|
+
* @include tablet-viewport() {
|
|
46
|
+
* :host {
|
|
47
|
+
* background-color: green;
|
|
48
|
+
* }
|
|
49
|
+
* }
|
|
50
|
+
*/
|
|
51
|
+
/**
|
|
52
|
+
* A heuristic that applies CSS to mobile
|
|
53
|
+
* viewports (i.e. phones, not tablets).
|
|
54
|
+
*
|
|
55
|
+
* Usage:
|
|
56
|
+
* @include mobile-viewport() {
|
|
57
|
+
* :host {
|
|
58
|
+
* background-color: blue;
|
|
59
|
+
* }
|
|
60
|
+
* }
|
|
61
|
+
*/
|
|
62
|
+
:host {
|
|
63
|
+
display: block;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
::slotted(*) {
|
|
67
|
+
margin-left: 0;
|
|
68
|
+
margin-right: 0;
|
|
69
|
+
margin-top: 0;
|
|
70
|
+
margin-bottom: 0;
|
|
71
|
+
width: 100%;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
::slotted(img) {
|
|
75
|
+
display: block;
|
|
76
|
+
object-fit: cover;
|
|
77
|
+
object-position: center;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
:host(.in-gallery-layout-uniform) ::slotted(*) {
|
|
81
|
+
aspect-ratio: 1/1;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
:host(.in-gallery-layout-masonry) {
|
|
85
|
+
min-height: unset;
|
|
86
|
+
margin-bottom: var(--internal-gallery-gap, 16px);
|
|
87
|
+
}
|