@ionic/core 8.4.4-dev.11738618213.1e9f211b → 8.4.4-dev.11738772061.152d6e09
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/checkbox.js +6 -4
- package/components/index6.js +11 -3
- package/components/ion-select.js +6 -4
- package/components/ion-tab-button.js +1 -1
- package/components/ion-tab.js +6 -2
- package/components/ion-toggle.js +6 -4
- package/components/modal.js +259 -35
- package/components/ripple-effect.js +2 -4
- package/components/toolbar.js +2 -2
- package/css/core.css.map +1 -1
- package/css/ionic.bundle.css.map +1 -1
- package/dist/cjs/{data-21dc0f81.js → data-108e531d.js} +1 -1
- package/dist/cjs/{index-5b6a7459.js → index-0d762bba.js} +1 -1
- package/dist/cjs/{index-5915f9b3.js → index-2a46a047.js} +11 -3
- package/dist/cjs/{index-8e789962.js → index-3652c918.js} +1 -1
- package/dist/cjs/{index-f05acd21.js → index-e975c92b.js} +3 -3
- package/dist/cjs/index.cjs.js +6 -6
- package/dist/cjs/{input-shims-9e59ef62.js → input-shims-cd05268a.js} +4 -2
- package/dist/cjs/{input.utils-611cde0b.js → input.utils-ffb2f81b.js} +1 -1
- package/dist/cjs/ion-accordion_2.cjs.entry.js +1 -1
- package/dist/cjs/ion-action-sheet.cjs.entry.js +2 -2
- package/dist/cjs/ion-alert.cjs.entry.js +2 -2
- package/dist/cjs/ion-app_8.cjs.entry.js +7 -7
- package/dist/cjs/ion-button_2.cjs.entry.js +1 -1
- package/dist/cjs/ion-checkbox.cjs.entry.js +5 -4
- package/dist/cjs/ion-datetime-button.cjs.entry.js +2 -2
- package/dist/cjs/ion-datetime_3.cjs.entry.js +3 -3
- package/dist/cjs/ion-infinite-scroll_2.cjs.entry.js +2 -2
- package/dist/cjs/ion-input-password-toggle.cjs.entry.js +1 -1
- package/dist/cjs/ion-input.cjs.entry.js +2 -2
- package/dist/cjs/ion-item-option_3.cjs.entry.js +2 -2
- package/dist/cjs/ion-loading.cjs.entry.js +2 -2
- package/dist/cjs/ion-menu_3.cjs.entry.js +3 -3
- package/dist/cjs/ion-modal.cjs.entry.js +262 -39
- package/dist/cjs/ion-nav_2.cjs.entry.js +2 -2
- package/dist/cjs/ion-popover.cjs.entry.js +3 -3
- package/dist/cjs/ion-range.cjs.entry.js +2 -2
- package/dist/cjs/ion-refresher_2.cjs.entry.js +2 -2
- package/dist/cjs/ion-reorder_2.cjs.entry.js +2 -2
- package/dist/cjs/ion-ripple-effect.cjs.entry.js +2 -4
- package/dist/cjs/ion-select-modal.cjs.entry.js +2 -2
- package/dist/cjs/ion-select_3.cjs.entry.js +7 -6
- package/dist/cjs/ion-tab-bar_2.cjs.entry.js +1 -1
- package/dist/cjs/ion-tab_2.cjs.entry.js +6 -2
- package/dist/cjs/ion-textarea.cjs.entry.js +2 -2
- package/dist/cjs/ion-toast.cjs.entry.js +2 -2
- package/dist/cjs/ion-toggle.cjs.entry.js +5 -4
- package/dist/cjs/ionic.cjs.js +1 -1
- package/dist/cjs/{ios.transition-cf40433b.js → ios.transition-0e664e88.js} +2 -2
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/{md.transition-ededf99f.js → md.transition-2e8aef2c.js} +2 -2
- package/dist/cjs/{overlays-aa669eb8.js → overlays-65fdaff6.js} +1 -1
- package/dist/cjs/{status-tap-37681226.js → status-tap-d74f1429.js} +3 -2
- package/dist/collection/components/checkbox/checkbox.js +23 -4
- package/dist/collection/components/modal/animations/ios.enter.js +50 -4
- package/dist/collection/components/modal/animations/ios.leave.js +24 -2
- package/dist/collection/components/modal/animations/md.enter.js +52 -5
- package/dist/collection/components/modal/animations/md.leave.js +26 -3
- package/dist/collection/components/modal/animations/sheet.js +11 -2
- package/dist/collection/components/modal/gestures/sheet.js +79 -10
- package/dist/collection/components/modal/modal.ios.css +16 -0
- package/dist/collection/components/modal/modal.js +32 -7
- package/dist/collection/components/modal/modal.md.css +6 -0
- package/dist/collection/components/ripple-effect/ripple-effect.js +2 -4
- package/dist/collection/components/select/select.js +23 -4
- package/dist/collection/components/tab/tab.js +6 -2
- package/dist/collection/components/tab-button/tab-button.js +1 -1
- package/dist/collection/components/toggle/toggle.js +23 -4
- package/dist/collection/components/toolbar/toolbar.js +6 -2
- package/dist/collection/utils/logging/index.js +10 -3
- package/dist/docs.json +115 -2
- package/dist/esm/{data-ae11fd43.js → data-b3284b5e.js} +1 -1
- package/dist/esm/{index-3ad7f18b.js → index-2f7fde3d.js} +3 -3
- package/dist/esm/{index-9b0d46f4.js → index-6ad967f3.js} +11 -3
- package/dist/esm/{index-24b48b06.js → index-cb21eccb.js} +1 -1
- package/dist/esm/{index-5cc724f3.js → index-efb8ecdf.js} +1 -1
- package/dist/esm/index.js +6 -6
- package/dist/esm/{input-shims-0314bbe5.js → input-shims-2fd7c6ef.js} +4 -2
- package/dist/esm/{input.utils-09c71bc7.js → input.utils-961c9f17.js} +1 -1
- package/dist/esm/ion-accordion_2.entry.js +1 -1
- package/dist/esm/ion-action-sheet.entry.js +2 -2
- package/dist/esm/ion-alert.entry.js +2 -2
- package/dist/esm/ion-app_8.entry.js +7 -7
- package/dist/esm/ion-button_2.entry.js +1 -1
- package/dist/esm/ion-checkbox.entry.js +5 -4
- package/dist/esm/ion-datetime-button.entry.js +2 -2
- package/dist/esm/ion-datetime_3.entry.js +3 -3
- package/dist/esm/ion-infinite-scroll_2.entry.js +2 -2
- package/dist/esm/ion-input-password-toggle.entry.js +1 -1
- package/dist/esm/ion-input.entry.js +2 -2
- package/dist/esm/ion-item-option_3.entry.js +2 -2
- package/dist/esm/ion-loading.entry.js +2 -2
- package/dist/esm/ion-menu_3.entry.js +3 -3
- package/dist/esm/ion-modal.entry.js +262 -39
- package/dist/esm/ion-nav_2.entry.js +2 -2
- package/dist/esm/ion-popover.entry.js +3 -3
- package/dist/esm/ion-range.entry.js +2 -2
- package/dist/esm/ion-refresher_2.entry.js +2 -2
- package/dist/esm/ion-reorder_2.entry.js +2 -2
- package/dist/esm/ion-ripple-effect.entry.js +2 -4
- package/dist/esm/ion-select-modal.entry.js +2 -2
- package/dist/esm/ion-select_3.entry.js +7 -6
- package/dist/esm/ion-tab-bar_2.entry.js +1 -1
- package/dist/esm/ion-tab_2.entry.js +6 -2
- package/dist/esm/ion-textarea.entry.js +2 -2
- package/dist/esm/ion-toast.entry.js +2 -2
- package/dist/esm/ion-toggle.entry.js +5 -4
- package/dist/esm/ionic.js +1 -1
- package/dist/esm/{ios.transition-4ee1a3af.js → ios.transition-b1da3753.js} +2 -2
- package/dist/esm/loader.js +1 -1
- package/dist/esm/{md.transition-5106a0d2.js → md.transition-571b3859.js} +2 -2
- package/dist/esm/{overlays-e7b9d6d9.js → overlays-5deab4de.js} +1 -1
- package/dist/esm/{status-tap-f472b09f.js → status-tap-79eac0ac.js} +3 -2
- package/dist/esm-es5/{data-ae11fd43.js → data-b3284b5e.js} +1 -1
- package/dist/esm-es5/{index-3ad7f18b.js → index-2f7fde3d.js} +1 -1
- package/dist/esm-es5/index-6ad967f3.js +4 -0
- package/dist/esm-es5/{index-24b48b06.js → index-cb21eccb.js} +1 -1
- package/dist/esm-es5/{index-5cc724f3.js → index-efb8ecdf.js} +1 -1
- package/dist/esm-es5/index.js +1 -1
- package/dist/esm-es5/input-shims-2fd7c6ef.js +4 -0
- package/dist/esm-es5/{input.utils-09c71bc7.js → input.utils-961c9f17.js} +1 -1
- package/dist/esm-es5/ion-accordion_2.entry.js +1 -1
- package/dist/esm-es5/ion-action-sheet.entry.js +1 -1
- package/dist/esm-es5/ion-alert.entry.js +1 -1
- package/dist/esm-es5/ion-app_8.entry.js +1 -1
- package/dist/esm-es5/ion-button_2.entry.js +1 -1
- package/dist/esm-es5/ion-checkbox.entry.js +1 -1
- package/dist/esm-es5/ion-datetime-button.entry.js +1 -1
- package/dist/esm-es5/ion-datetime_3.entry.js +1 -1
- package/dist/esm-es5/ion-infinite-scroll_2.entry.js +1 -1
- package/dist/esm-es5/ion-input-password-toggle.entry.js +1 -1
- package/dist/esm-es5/ion-input.entry.js +1 -1
- package/dist/esm-es5/ion-item-option_3.entry.js +1 -1
- package/dist/esm-es5/ion-loading.entry.js +1 -1
- package/dist/esm-es5/ion-menu_3.entry.js +1 -1
- package/dist/esm-es5/ion-modal.entry.js +1 -1
- package/dist/esm-es5/ion-nav_2.entry.js +1 -1
- package/dist/esm-es5/ion-popover.entry.js +1 -1
- package/dist/esm-es5/ion-range.entry.js +1 -1
- package/dist/esm-es5/ion-refresher_2.entry.js +1 -1
- package/dist/esm-es5/ion-reorder_2.entry.js +1 -1
- package/dist/esm-es5/ion-ripple-effect.entry.js +1 -1
- package/dist/esm-es5/ion-select-modal.entry.js +1 -1
- package/dist/esm-es5/ion-select_3.entry.js +1 -1
- package/dist/esm-es5/ion-tab-bar_2.entry.js +1 -1
- package/dist/esm-es5/ion-tab_2.entry.js +1 -1
- package/dist/esm-es5/ion-textarea.entry.js +1 -1
- package/dist/esm-es5/ion-toast.entry.js +1 -1
- package/dist/esm-es5/ion-toggle.entry.js +1 -1
- package/dist/esm-es5/ionic.js +1 -1
- package/dist/esm-es5/{ios.transition-4ee1a3af.js → ios.transition-b1da3753.js} +1 -1
- package/dist/esm-es5/loader.js +1 -1
- package/dist/esm-es5/{md.transition-5106a0d2.js → md.transition-571b3859.js} +1 -1
- package/dist/esm-es5/{overlays-e7b9d6d9.js → overlays-5deab4de.js} +1 -1
- package/dist/esm-es5/status-tap-79eac0ac.js +4 -0
- package/dist/html.html-data.json +16 -0
- package/dist/ionic/index.esm.js +1 -1
- package/dist/ionic/ionic.esm.js +1 -1
- package/dist/ionic/p-017be83b.entry.js +4 -0
- package/dist/ionic/p-0430c2e0.entry.js +4 -0
- package/dist/ionic/{p-6499df44.system.entry.js → p-05b74e45.system.entry.js} +1 -1
- package/dist/ionic/{p-21e5e7e4.js → p-0af823e1.js} +1 -1
- package/dist/ionic/{p-0c06e09b.system.js → p-0eb35a7f.system.js} +1 -1
- package/dist/ionic/{p-797eeea8.system.entry.js → p-1199e388.system.entry.js} +1 -1
- package/dist/ionic/{p-c9f3a539.entry.js → p-120fb79a.entry.js} +1 -1
- package/dist/ionic/p-147e2d39.system.entry.js +4 -0
- package/dist/ionic/{p-e563a35c.entry.js → p-15d18206.entry.js} +1 -1
- package/dist/ionic/{p-d60342e3.js → p-1a5bc5f7.js} +1 -1
- package/dist/ionic/{p-96cc4814.js → p-1ab13b2b.js} +1 -1
- package/dist/ionic/{p-f1acf541.system.entry.js → p-2346ab53.system.entry.js} +1 -1
- package/dist/ionic/{p-37cb43bd.system.entry.js → p-248318e0.system.entry.js} +1 -1
- package/dist/ionic/{p-a882acef.system.entry.js → p-2507278c.system.entry.js} +1 -1
- package/dist/ionic/{p-e6635685.js → p-28706c6f.js} +1 -1
- package/dist/ionic/{p-6b280620.entry.js → p-2da9c8a7.entry.js} +1 -1
- package/dist/ionic/{p-b335ffed.system.entry.js → p-302b50bb.system.entry.js} +1 -1
- package/dist/ionic/p-322c5fb4.system.js +1 -1
- package/dist/ionic/{p-f687573e.system.js → p-343b6b1d.system.js} +1 -1
- package/dist/ionic/p-4c98e2cf.system.js +4 -0
- package/dist/ionic/p-577bc414.entry.js +4 -0
- package/dist/ionic/{p-66640ff7.system.entry.js → p-585b455c.system.entry.js} +1 -1
- package/dist/ionic/{p-c449820c.system.js → p-5c08627a.system.js} +1 -1
- package/dist/ionic/{p-9ee1e8a6.entry.js → p-5c9eb9af.entry.js} +1 -1
- package/dist/ionic/{p-9e33104d.entry.js → p-61db139d.entry.js} +1 -1
- package/dist/ionic/p-67222c16.system.js +4 -0
- package/dist/ionic/{p-32d44024.system.entry.js → p-6933c482.system.entry.js} +1 -1
- package/dist/ionic/p-6c95736e.entry.js +4 -0
- package/dist/ionic/p-6d32975a.entry.js +4 -0
- package/dist/ionic/{p-12a722b8.system.entry.js → p-6dfb0f39.system.entry.js} +1 -1
- package/dist/ionic/{p-bc36ad98.system.entry.js → p-744c8672.system.entry.js} +1 -1
- package/dist/ionic/{p-5823babc.system.entry.js → p-74e3f0af.system.entry.js} +2 -2
- package/dist/ionic/p-7513b0c4.js +4 -0
- package/dist/ionic/p-783411f1.entry.js +4 -0
- package/dist/ionic/{p-508d024a.entry.js → p-7a02f476.entry.js} +1 -1
- package/dist/ionic/{p-efaffe74.entry.js → p-7a6eaf9e.entry.js} +1 -1
- package/dist/ionic/{p-e7ed4a7f.system.js → p-7de1e42c.system.js} +1 -1
- package/dist/ionic/{p-2fc0dafe.entry.js → p-8694928f.entry.js} +1 -1
- package/dist/ionic/{p-da074ff7.entry.js → p-89bf08c7.entry.js} +1 -1
- package/dist/ionic/{p-69666e8a.system.entry.js → p-8ac07653.system.entry.js} +2 -2
- package/dist/ionic/{p-c29f8157.system.entry.js → p-8cfba7e9.system.entry.js} +1 -1
- package/dist/ionic/{p-a61cba41.entry.js → p-92763d3d.entry.js} +1 -1
- package/dist/ionic/{p-d18ab582.system.entry.js → p-933727f9.system.entry.js} +1 -1
- package/dist/ionic/{p-06e58c4e.js → p-9343a445.js} +1 -1
- package/dist/ionic/{p-45693d7e.entry.js → p-948e6c6a.entry.js} +1 -1
- package/dist/ionic/{p-2799c6d3.system.entry.js → p-9b122e3c.system.entry.js} +1 -1
- package/dist/ionic/{p-4439fc2a.entry.js → p-9b428d25.entry.js} +1 -1
- package/dist/ionic/{p-b2272f51.system.entry.js → p-9f364443.system.entry.js} +1 -1
- package/dist/ionic/{p-ca065903.system.entry.js → p-a090bce8.system.entry.js} +1 -1
- package/dist/ionic/{p-ddaa748a.system.entry.js → p-a0eb506c.system.entry.js} +1 -1
- package/dist/ionic/p-a3db8ee3.js +4 -0
- package/dist/ionic/{p-14e159ea.system.entry.js → p-a4a2420e.system.entry.js} +1 -1
- package/dist/ionic/{p-9ea607bd.system.js → p-a88dec0d.system.js} +2 -2
- package/dist/ionic/{p-942b5e13.entry.js → p-a8f2c254.entry.js} +1 -1
- package/dist/ionic/{p-a49378bb.system.entry.js → p-ab674093.system.entry.js} +1 -1
- package/dist/ionic/{p-0aa833fb.system.js → p-ada36597.system.js} +1 -1
- package/dist/ionic/{p-9fa07aec.entry.js → p-b1eb86fd.entry.js} +1 -1
- package/dist/ionic/{p-a4565eb5.system.js → p-b3c60433.system.js} +1 -1
- package/dist/ionic/{p-d6841eac.js → p-b6efeab8.js} +1 -1
- package/dist/ionic/{p-ebf042e0.system.entry.js → p-bdf2cb2e.system.entry.js} +1 -1
- package/dist/ionic/{p-f9a53abb.system.js → p-c4238c12.system.js} +1 -1
- package/dist/ionic/{p-b82d4cab.js → p-cb13696c.js} +1 -1
- package/dist/ionic/{p-1046866e.system.entry.js → p-cba1f9bc.system.entry.js} +1 -1
- package/dist/ionic/p-d1c5b60e.system.js +4 -0
- package/dist/ionic/{p-5da94421.system.js → p-d22e2a38.system.js} +1 -1
- package/dist/ionic/{p-2bd0ae94.system.entry.js → p-d6eaffb1.system.entry.js} +1 -1
- package/dist/ionic/p-d7dd8fb1.entry.js +4 -0
- package/dist/ionic/{p-19a5be0a.entry.js → p-e06057c9.entry.js} +1 -1
- package/dist/ionic/{p-1e010627.system.entry.js → p-e09d6392.system.entry.js} +2 -2
- package/dist/ionic/p-e3171ff3.entry.js +4 -0
- package/dist/ionic/p-e6376b93.system.entry.js +4 -0
- package/dist/ionic/{p-a43467d8.entry.js → p-e76dae93.entry.js} +1 -1
- package/dist/ionic/p-e8d56122.js +4 -0
- package/dist/ionic/{p-b79ba17c.entry.js → p-eef505e8.entry.js} +1 -1
- package/dist/ionic/{p-61e3f887.entry.js → p-f1060cd8.entry.js} +1 -1
- package/dist/ionic/{p-1fe02220.system.entry.js → p-f1120724.system.entry.js} +1 -1
- package/dist/ionic/{p-88e63c7d.js → p-f1c4dcd4.js} +1 -1
- package/dist/ionic/{p-982315a6.entry.js → p-f63c2d12.entry.js} +1 -1
- package/dist/ionic/{p-e4f69534.system.entry.js → p-fbd41a7e.system.entry.js} +1 -1
- package/dist/ionic/{p-19ec4f42.entry.js → p-fceec762.entry.js} +1 -1
- package/dist/types/components/checkbox/checkbox.d.ts +6 -0
- package/dist/types/components/modal/animations/sheet.d.ts +1 -0
- package/dist/types/components/modal/gestures/sheet.d.ts +1 -1
- package/dist/types/components/modal/modal-interface.d.ts +1 -0
- package/dist/types/components/modal/modal.d.ts +11 -0
- package/dist/types/components/select/select.d.ts +6 -0
- package/dist/types/components/toggle/toggle.d.ts +6 -0
- package/dist/types/components/toolbar/toolbar.d.ts +4 -0
- package/dist/types/components.d.ts +32 -0
- package/dist/types/utils/config.d.ts +9 -0
- package/dist/types/utils/logging/index.d.ts +13 -1
- package/hydrate/index.js +301 -59
- package/hydrate/index.mjs +301 -59
- package/package.json +1 -1
- package/dist/esm-es5/index-9b0d46f4.js +0 -4
- package/dist/esm-es5/input-shims-0314bbe5.js +0 -4
- package/dist/esm-es5/status-tap-f472b09f.js +0 -4
- package/dist/ionic/p-0303d0f8.js +0 -4
- package/dist/ionic/p-06fee233.js +0 -4
- package/dist/ionic/p-17474161.system.js +0 -4
- package/dist/ionic/p-1d8761e6.entry.js +0 -4
- package/dist/ionic/p-2172893e.system.entry.js +0 -4
- package/dist/ionic/p-2690b1de.js +0 -4
- package/dist/ionic/p-2b9b78c7.entry.js +0 -4
- package/dist/ionic/p-4ec778aa.entry.js +0 -4
- package/dist/ionic/p-5ab1b709.entry.js +0 -4
- package/dist/ionic/p-8b8be2fd.entry.js +0 -4
- package/dist/ionic/p-908d6080.entry.js +0 -4
- package/dist/ionic/p-98ff6b32.entry.js +0 -4
- package/dist/ionic/p-dfb78785.system.js +0 -4
- package/dist/ionic/p-e85d901b.system.entry.js +0 -4
- package/dist/ionic/p-eba29931.entry.js +0 -4
- package/dist/ionic/p-ff4b7e40.system.js +0 -4
|
@@ -7,7 +7,7 @@ import { clamp, raf, getElementRoot } from "../../../utils/helpers";
|
|
|
7
7
|
import { FOCUS_TRAP_DISABLE_CLASS } from "../../../utils/overlays";
|
|
8
8
|
import { getBackdropValueForSheet } from "../utils";
|
|
9
9
|
import { calculateSpringStep, handleCanDismiss } from "./utils";
|
|
10
|
-
export const createSheetGesture = (baseEl, backdropEl, wrapperEl, initialBreakpoint, backdropBreakpoint, animation, breakpoints = [], getCurrentBreakpoint, onDismiss, onBreakpointChange) => {
|
|
10
|
+
export const createSheetGesture = (baseEl, backdropEl, wrapperEl, initialBreakpoint, backdropBreakpoint, animation, breakpoints = [], expandToScroll, getCurrentBreakpoint, onDismiss, onBreakpointChange) => {
|
|
11
11
|
// Defaults for the sheet swipe animation
|
|
12
12
|
const defaultBackdrop = [
|
|
13
13
|
{ offset: 0, opacity: 'var(--backdrop-opacity)' },
|
|
@@ -24,6 +24,10 @@ export const createSheetGesture = (baseEl, backdropEl, wrapperEl, initialBreakpo
|
|
|
24
24
|
{ offset: 1, transform: 'translateY(100%)' },
|
|
25
25
|
],
|
|
26
26
|
BACKDROP_KEYFRAMES: backdropBreakpoint !== 0 ? customBackdrop : defaultBackdrop,
|
|
27
|
+
CONTENT_KEYFRAMES: [
|
|
28
|
+
{ offset: 0, maxHeight: '100%' },
|
|
29
|
+
{ offset: 1, maxHeight: '0%' },
|
|
30
|
+
],
|
|
27
31
|
};
|
|
28
32
|
const contentEl = baseEl.querySelector('ion-content');
|
|
29
33
|
const height = wrapperEl.clientHeight;
|
|
@@ -31,10 +35,11 @@ export const createSheetGesture = (baseEl, backdropEl, wrapperEl, initialBreakpo
|
|
|
31
35
|
let offset = 0;
|
|
32
36
|
let canDismissBlocksGesture = false;
|
|
33
37
|
const canDismissMaxStep = 0.95;
|
|
34
|
-
const wrapperAnimation = animation.childAnimations.find((ani) => ani.id === 'wrapperAnimation');
|
|
35
|
-
const backdropAnimation = animation.childAnimations.find((ani) => ani.id === 'backdropAnimation');
|
|
36
38
|
const maxBreakpoint = breakpoints[breakpoints.length - 1];
|
|
37
39
|
const minBreakpoint = breakpoints[0];
|
|
40
|
+
const wrapperAnimation = animation.childAnimations.find((ani) => ani.id === 'wrapperAnimation');
|
|
41
|
+
const backdropAnimation = animation.childAnimations.find((ani) => ani.id === 'backdropAnimation');
|
|
42
|
+
const contentAnimation = animation.childAnimations.find((ani) => ani.id === 'contentAnimation');
|
|
38
43
|
const enableBackdrop = () => {
|
|
39
44
|
baseEl.style.setProperty('pointer-events', 'auto');
|
|
40
45
|
backdropEl.style.setProperty('pointer-events', 'auto');
|
|
@@ -57,6 +62,31 @@ export const createSheetGesture = (baseEl, backdropEl, wrapperEl, initialBreakpo
|
|
|
57
62
|
*/
|
|
58
63
|
baseEl.classList.add(FOCUS_TRAP_DISABLE_CLASS);
|
|
59
64
|
};
|
|
65
|
+
/**
|
|
66
|
+
* Toggles the visible modal footer when `expandToScroll` is disabled.
|
|
67
|
+
* @param footer The footer to show.
|
|
68
|
+
*/
|
|
69
|
+
const swapFooterVisibility = (footer) => {
|
|
70
|
+
const originalFooter = baseEl.querySelector('ion-footer');
|
|
71
|
+
if (!originalFooter) {
|
|
72
|
+
return;
|
|
73
|
+
}
|
|
74
|
+
const clonedFooter = wrapperEl.nextElementSibling;
|
|
75
|
+
const footerToHide = footer === 'original' ? clonedFooter : originalFooter;
|
|
76
|
+
const footerToShow = footer === 'original' ? originalFooter : clonedFooter;
|
|
77
|
+
footerToShow.style.removeProperty('display');
|
|
78
|
+
footerToShow.removeAttribute('aria-hidden');
|
|
79
|
+
const page = baseEl.querySelector('.ion-page');
|
|
80
|
+
if (footer === 'original') {
|
|
81
|
+
page.style.removeProperty('padding-bottom');
|
|
82
|
+
}
|
|
83
|
+
else {
|
|
84
|
+
const pagePadding = footerToShow.clientHeight;
|
|
85
|
+
page.style.setProperty('padding-bottom', `${pagePadding}px`);
|
|
86
|
+
}
|
|
87
|
+
footerToHide.style.setProperty('display', 'none');
|
|
88
|
+
footerToHide.setAttribute('aria-hidden', 'true');
|
|
89
|
+
};
|
|
60
90
|
/**
|
|
61
91
|
* After the entering animation completes,
|
|
62
92
|
* we need to set the animation to go from
|
|
@@ -68,6 +98,7 @@ export const createSheetGesture = (baseEl, backdropEl, wrapperEl, initialBreakpo
|
|
|
68
98
|
if (wrapperAnimation && backdropAnimation) {
|
|
69
99
|
wrapperAnimation.keyframes([...SheetDefaults.WRAPPER_KEYFRAMES]);
|
|
70
100
|
backdropAnimation.keyframes([...SheetDefaults.BACKDROP_KEYFRAMES]);
|
|
101
|
+
contentAnimation === null || contentAnimation === void 0 ? void 0 : contentAnimation.keyframes([...SheetDefaults.CONTENT_KEYFRAMES]);
|
|
71
102
|
animation.progressStart(true, 1 - currentBreakpoint);
|
|
72
103
|
/**
|
|
73
104
|
* If backdrop is not enabled, then content
|
|
@@ -84,7 +115,7 @@ export const createSheetGesture = (baseEl, backdropEl, wrapperEl, initialBreakpo
|
|
|
84
115
|
disableBackdrop();
|
|
85
116
|
}
|
|
86
117
|
}
|
|
87
|
-
if (contentEl && currentBreakpoint !== maxBreakpoint) {
|
|
118
|
+
if (contentEl && currentBreakpoint !== maxBreakpoint && expandToScroll) {
|
|
88
119
|
contentEl.scrollY = false;
|
|
89
120
|
}
|
|
90
121
|
const canStart = (detail) => {
|
|
@@ -98,6 +129,13 @@ export const createSheetGesture = (baseEl, backdropEl, wrapperEl, initialBreakpo
|
|
|
98
129
|
*/
|
|
99
130
|
const contentEl = findClosestIonContent(detail.event.target);
|
|
100
131
|
currentBreakpoint = getCurrentBreakpoint();
|
|
132
|
+
/**
|
|
133
|
+
* If we have expandToScroll disabled, we should not allow the swipe gesture to start
|
|
134
|
+
* if the content is being swiped.
|
|
135
|
+
*/
|
|
136
|
+
if (!expandToScroll && contentEl) {
|
|
137
|
+
return false;
|
|
138
|
+
}
|
|
101
139
|
if (currentBreakpoint === 1 && contentEl) {
|
|
102
140
|
/**
|
|
103
141
|
* The modal should never swipe to close on the content with a refresher.
|
|
@@ -128,6 +166,15 @@ export const createSheetGesture = (baseEl, backdropEl, wrapperEl, initialBreakpo
|
|
|
128
166
|
* Remove undefined check
|
|
129
167
|
*/
|
|
130
168
|
canDismissBlocksGesture = baseEl.canDismiss !== undefined && baseEl.canDismiss !== true && minBreakpoint === 0;
|
|
169
|
+
/**
|
|
170
|
+
* If expandToScroll is disabled, we need to swap
|
|
171
|
+
* the footer visibility to the original, so if the modal
|
|
172
|
+
* is dismissed, the footer dismisses with the modal
|
|
173
|
+
* and doesn't stay on the screen after the modal is gone.
|
|
174
|
+
*/
|
|
175
|
+
if (!expandToScroll) {
|
|
176
|
+
swapFooterVisibility('original');
|
|
177
|
+
}
|
|
131
178
|
/**
|
|
132
179
|
* If we are pulling down, then it is possible we are pulling on the content.
|
|
133
180
|
* We do not want scrolling to happen at the same time as the gesture.
|
|
@@ -243,6 +290,19 @@ export const createSheetGesture = (baseEl, backdropEl, wrapperEl, initialBreakpo
|
|
|
243
290
|
opacity: `calc(var(--backdrop-opacity) * ${getBackdropValueForSheet(snapToBreakpoint, backdropBreakpoint)})`,
|
|
244
291
|
},
|
|
245
292
|
]);
|
|
293
|
+
if (contentAnimation) {
|
|
294
|
+
/**
|
|
295
|
+
* The modal content should scroll at any breakpoint when expandToScroll
|
|
296
|
+
* is disabled. In order to do this, the content needs to be completely
|
|
297
|
+
* viewable so scrolling can access everything. Otherwise, the default
|
|
298
|
+
* behavior would show the content off the screen and only allow
|
|
299
|
+
* scrolling when the sheet is fully expanded.
|
|
300
|
+
*/
|
|
301
|
+
contentAnimation.keyframes([
|
|
302
|
+
{ offset: 0, maxHeight: `${(1 - breakpointOffset) * 100}%` },
|
|
303
|
+
{ offset: 1, maxHeight: `${snapToBreakpoint * 100}%` },
|
|
304
|
+
]);
|
|
305
|
+
}
|
|
246
306
|
animation.progressStep(0);
|
|
247
307
|
}
|
|
248
308
|
/**
|
|
@@ -250,6 +310,14 @@ export const createSheetGesture = (baseEl, backdropEl, wrapperEl, initialBreakpo
|
|
|
250
310
|
* snapping animation completes.
|
|
251
311
|
*/
|
|
252
312
|
gesture.enable(false);
|
|
313
|
+
/**
|
|
314
|
+
* If expandToScroll is disabled, we need to swap
|
|
315
|
+
* the footer visibility to the cloned one so the footer
|
|
316
|
+
* doesn't flicker when the sheet's height is animated.
|
|
317
|
+
*/
|
|
318
|
+
if (!expandToScroll && shouldRemainOpen) {
|
|
319
|
+
swapFooterVisibility('cloned');
|
|
320
|
+
}
|
|
253
321
|
if (shouldPreventDismiss) {
|
|
254
322
|
handleCanDismiss(baseEl, animation);
|
|
255
323
|
}
|
|
@@ -257,13 +325,13 @@ export const createSheetGesture = (baseEl, backdropEl, wrapperEl, initialBreakpo
|
|
|
257
325
|
onDismiss();
|
|
258
326
|
}
|
|
259
327
|
/**
|
|
260
|
-
*
|
|
261
|
-
*
|
|
262
|
-
*
|
|
263
|
-
*
|
|
264
|
-
*
|
|
328
|
+
* Enables scrolling immediately if the sheet is about to fully expand
|
|
329
|
+
* or if it allows scrolling at any breakpoint. Without this, there would
|
|
330
|
+
* be a ~500ms delay while the modal animation completes, causing a
|
|
331
|
+
* noticeable lag. Native iOS allows scrolling as soon as the gesture is
|
|
332
|
+
* released, so we align with that behavior.
|
|
265
333
|
*/
|
|
266
|
-
if (contentEl && snapToBreakpoint === breakpoints[breakpoints.length - 1]) {
|
|
334
|
+
if (contentEl && (snapToBreakpoint === breakpoints[breakpoints.length - 1] || !expandToScroll)) {
|
|
267
335
|
contentEl.scrollY = true;
|
|
268
336
|
}
|
|
269
337
|
return new Promise((resolve) => {
|
|
@@ -281,6 +349,7 @@ export const createSheetGesture = (baseEl, backdropEl, wrapperEl, initialBreakpo
|
|
|
281
349
|
raf(() => {
|
|
282
350
|
wrapperAnimation.keyframes([...SheetDefaults.WRAPPER_KEYFRAMES]);
|
|
283
351
|
backdropAnimation.keyframes([...SheetDefaults.BACKDROP_KEYFRAMES]);
|
|
352
|
+
contentAnimation === null || contentAnimation === void 0 ? void 0 : contentAnimation.keyframes([...SheetDefaults.CONTENT_KEYFRAMES]);
|
|
284
353
|
animation.progressStart(true, 1 - snapToBreakpoint);
|
|
285
354
|
currentBreakpoint = snapToBreakpoint;
|
|
286
355
|
onBreakpointChange(currentBreakpoint);
|
|
@@ -201,6 +201,12 @@ ion-backdrop {
|
|
|
201
201
|
bottom: 0;
|
|
202
202
|
}
|
|
203
203
|
|
|
204
|
+
:host(.modal-sheet.modal-no-expand-scroll) ion-footer {
|
|
205
|
+
position: absolute;
|
|
206
|
+
bottom: 0;
|
|
207
|
+
width: var(--width);
|
|
208
|
+
}
|
|
209
|
+
|
|
204
210
|
/**
|
|
205
211
|
* Convert a font size to a dynamic font size.
|
|
206
212
|
* Fonts that participate in Dynamic Type should use
|
|
@@ -325,4 +331,14 @@ ion-backdrop {
|
|
|
325
331
|
border-start-end-radius: var(--border-radius);
|
|
326
332
|
border-end-end-radius: 0;
|
|
327
333
|
border-end-start-radius: 0;
|
|
334
|
+
}
|
|
335
|
+
|
|
336
|
+
/**
|
|
337
|
+
* Sheet modals require an additional padding as mentioned in the
|
|
338
|
+
* `core.scss` file. However, there's a workaround that requires
|
|
339
|
+
* a cloned footer to be added to the modal. This is only necessary
|
|
340
|
+
* because the core styles are not being applied to the cloned footer.
|
|
341
|
+
*/
|
|
342
|
+
:host(.modal-sheet.modal-no-expand-scroll) ion-footer ion-toolbar:first-of-type {
|
|
343
|
+
padding-top: 6px;
|
|
328
344
|
}
|
|
@@ -86,6 +86,7 @@ export class Modal {
|
|
|
86
86
|
this.enterAnimation = undefined;
|
|
87
87
|
this.leaveAnimation = undefined;
|
|
88
88
|
this.breakpoints = undefined;
|
|
89
|
+
this.expandToScroll = true;
|
|
89
90
|
this.initialBreakpoint = undefined;
|
|
90
91
|
this.backdropBreakpoint = 0;
|
|
91
92
|
this.handle = undefined;
|
|
@@ -301,6 +302,7 @@ export class Modal {
|
|
|
301
302
|
presentingEl: presentingElement,
|
|
302
303
|
currentBreakpoint: this.initialBreakpoint,
|
|
303
304
|
backdropBreakpoint: this.backdropBreakpoint,
|
|
305
|
+
expandToScroll: this.expandToScroll,
|
|
304
306
|
});
|
|
305
307
|
/* tslint:disable-next-line */
|
|
306
308
|
if (typeof window !== 'undefined') {
|
|
@@ -351,7 +353,10 @@ export class Modal {
|
|
|
351
353
|
// should be in the DOM and referenced by now, except
|
|
352
354
|
// for the presenting el
|
|
353
355
|
const animationBuilder = this.leaveAnimation || config.get('modalLeave', iosLeaveAnimation);
|
|
354
|
-
const ani = (this.animation = animationBuilder(el, {
|
|
356
|
+
const ani = (this.animation = animationBuilder(el, {
|
|
357
|
+
presentingEl: this.presentingElement,
|
|
358
|
+
expandToScroll: this.expandToScroll,
|
|
359
|
+
}));
|
|
355
360
|
const contentEl = findIonContent(el);
|
|
356
361
|
if (!contentEl) {
|
|
357
362
|
printIonContentErrorMsg(el);
|
|
@@ -396,9 +401,10 @@ export class Modal {
|
|
|
396
401
|
presentingEl: this.presentingElement,
|
|
397
402
|
currentBreakpoint: initialBreakpoint,
|
|
398
403
|
backdropBreakpoint,
|
|
404
|
+
expandToScroll: this.expandToScroll,
|
|
399
405
|
}));
|
|
400
406
|
ani.progressStart(true, 1);
|
|
401
|
-
const { gesture, moveSheetToBreakpoint } = createSheetGesture(this.el, this.backdropEl, wrapperEl, initialBreakpoint, backdropBreakpoint, ani, this.sortedBreakpoints, () => { var _a; return (_a = this.currentBreakpoint) !== null && _a !== void 0 ? _a : 0; }, () => this.sheetOnDismiss(), (breakpoint) => {
|
|
407
|
+
const { gesture, moveSheetToBreakpoint } = createSheetGesture(this.el, this.backdropEl, wrapperEl, initialBreakpoint, backdropBreakpoint, ani, this.sortedBreakpoints, this.expandToScroll, () => { var _a; return (_a = this.currentBreakpoint) !== null && _a !== void 0 ? _a : 0; }, () => this.sheetOnDismiss(), (breakpoint) => {
|
|
402
408
|
if (this.currentBreakpoint !== breakpoint) {
|
|
403
409
|
this.currentBreakpoint = breakpoint;
|
|
404
410
|
this.ionBreakpointDidChange.emit({ breakpoint });
|
|
@@ -476,6 +482,7 @@ export class Modal {
|
|
|
476
482
|
presentingEl: presentingElement,
|
|
477
483
|
currentBreakpoint: (_a = this.currentBreakpoint) !== null && _a !== void 0 ? _a : this.initialBreakpoint,
|
|
478
484
|
backdropBreakpoint: this.backdropBreakpoint,
|
|
485
|
+
expandToScroll: this.expandToScroll,
|
|
479
486
|
});
|
|
480
487
|
if (dismissed) {
|
|
481
488
|
const { delegate } = this.getDelegate();
|
|
@@ -561,23 +568,23 @@ export class Modal {
|
|
|
561
568
|
return true;
|
|
562
569
|
}
|
|
563
570
|
render() {
|
|
564
|
-
const { handle, isSheetModal, presentingElement, htmlAttributes, handleBehavior, inheritedAttributes, focusTrap } = this;
|
|
571
|
+
const { handle, isSheetModal, presentingElement, htmlAttributes, handleBehavior, inheritedAttributes, focusTrap, expandToScroll, } = this;
|
|
565
572
|
const showHandle = handle !== false && isSheetModal;
|
|
566
573
|
const mode = getIonMode(this);
|
|
567
574
|
const isCardModal = presentingElement !== undefined && mode === 'ios';
|
|
568
575
|
const isHandleCycle = handleBehavior === 'cycle';
|
|
569
|
-
return (h(Host, Object.assign({ key: '
|
|
576
|
+
return (h(Host, Object.assign({ key: 'ff15df63e72caaeb0a4ad68e9eedeaaa7d3f3bde', "no-router": true, tabindex: "-1" }, htmlAttributes, { style: {
|
|
570
577
|
zIndex: `${20000 + this.overlayIndex}`,
|
|
571
|
-
}, class: Object.assign({ [mode]: true, ['modal-default']: !isCardModal && !isSheetModal, [`modal-card`]: isCardModal, [`modal-sheet`]: isSheetModal, 'overlay-hidden': true, [FOCUS_TRAP_DISABLE_CLASS]: focusTrap === false }, getClassMap(this.cssClass)), onIonBackdropTap: this.onBackdropTap, onIonModalDidPresent: this.onLifecycle, onIonModalWillPresent: this.onLifecycle, onIonModalWillDismiss: this.onLifecycle, onIonModalDidDismiss: this.onLifecycle }), h("ion-backdrop", { key: '
|
|
578
|
+
}, class: Object.assign({ [mode]: true, ['modal-default']: !isCardModal && !isSheetModal, [`modal-card`]: isCardModal, [`modal-sheet`]: isSheetModal, [`modal-no-expand-scroll`]: isSheetModal && !expandToScroll, 'overlay-hidden': true, [FOCUS_TRAP_DISABLE_CLASS]: focusTrap === false }, getClassMap(this.cssClass)), onIonBackdropTap: this.onBackdropTap, onIonModalDidPresent: this.onLifecycle, onIonModalWillPresent: this.onLifecycle, onIonModalWillDismiss: this.onLifecycle, onIonModalDidDismiss: this.onLifecycle }), h("ion-backdrop", { key: '27a73655779af9d175a829d3d2d29e42fd2a63ee', ref: (el) => (this.backdropEl = el), visible: this.showBackdrop, tappable: this.backdropDismiss, part: "backdrop" }), mode === 'ios' && h("div", { key: '406a65080087e7895026ecc2f04e9d707439e86f', class: "modal-shadow" }), h("div", Object.assign({ key: '8e410eb925374158996c82cbbd522f07d741679e',
|
|
572
579
|
/*
|
|
573
580
|
role and aria-modal must be used on the
|
|
574
581
|
same element. They must also be set inside the
|
|
575
582
|
shadow DOM otherwise ion-button will not be highlighted
|
|
576
583
|
when using VoiceOver: https://bugs.webkit.org/show_bug.cgi?id=247134
|
|
577
584
|
*/
|
|
578
|
-
role: "dialog" }, inheritedAttributes, { "aria-modal": "true", class: "modal-wrapper ion-overlay-wrapper", part: "content", ref: (el) => (this.wrapperEl = el) }), showHandle && (h("button", { key: '
|
|
585
|
+
role: "dialog" }, inheritedAttributes, { "aria-modal": "true", class: "modal-wrapper ion-overlay-wrapper", part: "content", ref: (el) => (this.wrapperEl = el) }), showHandle && (h("button", { key: '7326c969ebe5a70a35e83b09d3db2bb848c90e47', class: "modal-handle",
|
|
579
586
|
// Prevents the handle from receiving keyboard focus when it does not cycle
|
|
580
|
-
tabIndex: !isHandleCycle ? -1 : 0, "aria-label": "Activate to adjust the size of the dialog overlaying the screen", onClick: isHandleCycle ? this.onHandleClick : undefined, part: "handle" })), h("slot", { key: '
|
|
587
|
+
tabIndex: !isHandleCycle ? -1 : 0, "aria-label": "Activate to adjust the size of the dialog overlaying the screen", onClick: isHandleCycle ? this.onHandleClick : undefined, part: "handle" })), h("slot", { key: '0b65cdb9e337a27edf437b9e754e79f1449c217d' }))));
|
|
581
588
|
}
|
|
582
589
|
static get is() { return "ion-modal"; }
|
|
583
590
|
static get encapsulation() { return "shadow"; }
|
|
@@ -735,6 +742,24 @@ export class Modal {
|
|
|
735
742
|
"text": "The breakpoints to use when creating a sheet modal. Each value in the\narray must be a decimal between 0 and 1 where 0 indicates the modal is fully\nclosed and 1 indicates the modal is fully open. Values are relative\nto the height of the modal, not the height of the screen. One of the values in this\narray must be the value of the `initialBreakpoint` property.\nFor example: [0, .25, .5, 1]"
|
|
736
743
|
}
|
|
737
744
|
},
|
|
745
|
+
"expandToScroll": {
|
|
746
|
+
"type": "boolean",
|
|
747
|
+
"mutable": false,
|
|
748
|
+
"complexType": {
|
|
749
|
+
"original": "boolean",
|
|
750
|
+
"resolved": "boolean",
|
|
751
|
+
"references": {}
|
|
752
|
+
},
|
|
753
|
+
"required": false,
|
|
754
|
+
"optional": false,
|
|
755
|
+
"docs": {
|
|
756
|
+
"tags": [],
|
|
757
|
+
"text": "Controls whether scrolling or dragging within the sheet modal expands\nit to a larger breakpoint. This only takes effect when `breakpoints`\nand `initialBreakpoint` are set.\n\nIf `true`, scrolling or dragging anywhere in the modal will first expand\nit to the next breakpoint. Once fully expanded, scrolling will affect the content.\nIf `false`, scrolling will always affect the content, and the modal will only expand\nwhen dragging the header or handle."
|
|
758
|
+
},
|
|
759
|
+
"attribute": "expand-to-scroll",
|
|
760
|
+
"reflect": false,
|
|
761
|
+
"defaultValue": "true"
|
|
762
|
+
},
|
|
738
763
|
"initialBreakpoint": {
|
|
739
764
|
"type": "number",
|
|
740
765
|
"mutable": false,
|
|
@@ -201,6 +201,12 @@ ion-backdrop {
|
|
|
201
201
|
bottom: 0;
|
|
202
202
|
}
|
|
203
203
|
|
|
204
|
+
:host(.modal-sheet.modal-no-expand-scroll) ion-footer {
|
|
205
|
+
position: absolute;
|
|
206
|
+
bottom: 0;
|
|
207
|
+
width: var(--width);
|
|
208
|
+
}
|
|
209
|
+
|
|
204
210
|
/**
|
|
205
211
|
* Convert a font size to a dynamic font size.
|
|
206
212
|
* Fonts that participate in Dynamic Type should use
|
|
@@ -136,12 +136,10 @@ export class RippleEffect {
|
|
|
136
136
|
static get elementRef() { return "el"; }
|
|
137
137
|
}
|
|
138
138
|
const removeRipple = (ripple) => {
|
|
139
|
-
if (!ripple.parentNode)
|
|
140
|
-
return;
|
|
141
139
|
ripple.classList.add('fade-out');
|
|
142
|
-
|
|
140
|
+
setTimeout(() => {
|
|
143
141
|
ripple.remove();
|
|
144
|
-
},
|
|
142
|
+
}, 200);
|
|
145
143
|
};
|
|
146
144
|
const PADDING = 10;
|
|
147
145
|
const INITIAL_ORIGIN_SCALE = 0.5;
|
|
@@ -91,6 +91,7 @@ export class Select {
|
|
|
91
91
|
this.expandedIcon = undefined;
|
|
92
92
|
this.shape = undefined;
|
|
93
93
|
this.value = undefined;
|
|
94
|
+
this.required = false;
|
|
94
95
|
}
|
|
95
96
|
styleChanged() {
|
|
96
97
|
this.emitStyle();
|
|
@@ -628,8 +629,8 @@ export class Select {
|
|
|
628
629
|
return renderedLabel;
|
|
629
630
|
}
|
|
630
631
|
renderListbox() {
|
|
631
|
-
const { disabled, inputId, isExpanded } = this;
|
|
632
|
-
return (h("button", { disabled: disabled, id: inputId, "aria-label": this.ariaLabel, "aria-haspopup": "dialog", "aria-expanded": `${isExpanded}`, onFocus: this.onFocus, onBlur: this.onBlur, ref: (focusEl) => (this.focusEl = focusEl) }));
|
|
632
|
+
const { disabled, inputId, isExpanded, required } = this;
|
|
633
|
+
return (h("button", { disabled: disabled, id: inputId, "aria-label": this.ariaLabel, "aria-haspopup": "dialog", "aria-expanded": `${isExpanded}`, "aria-required": `${required}`, onFocus: this.onFocus, onBlur: this.onBlur, ref: (focusEl) => (this.focusEl = focusEl) }));
|
|
633
634
|
}
|
|
634
635
|
render() {
|
|
635
636
|
const { disabled, el, isExpanded, expandedIcon, labelPlacement, justify, placeholder, fill, shape, name, value } = this;
|
|
@@ -660,7 +661,7 @@ export class Select {
|
|
|
660
661
|
* TODO(FW-5592): Remove hasStartEndSlots condition
|
|
661
662
|
*/
|
|
662
663
|
const labelShouldFloat = labelPlacement === 'stacked' || (labelPlacement === 'floating' && (hasValue || isExpanded || hasStartEndSlots));
|
|
663
|
-
return (h(Host, { key: '
|
|
664
|
+
return (h(Host, { key: '491cf1b0e3aa31e7c9cfad3e87d83eb54272312a', onClick: this.onClick, class: createColorClasses(this.color, {
|
|
664
665
|
[mode]: true,
|
|
665
666
|
'in-item': inItem,
|
|
666
667
|
'in-item-color': hostContext('ion-item.ion-color', el),
|
|
@@ -676,7 +677,7 @@ export class Select {
|
|
|
676
677
|
[`select-justify-${justify}`]: justifyEnabled,
|
|
677
678
|
[`select-shape-${shape}`]: shape !== undefined,
|
|
678
679
|
[`select-label-placement-${labelPlacement}`]: true,
|
|
679
|
-
}) }, h("label", { key: '
|
|
680
|
+
}) }, h("label", { key: '07bf3cb57bd1121383d8c746e3ac49da38300082', class: "select-wrapper", id: "select-label" }, this.renderLabelContainer(), h("div", { key: '884facd18342797576bbacc761d18d83c52762e3', class: "select-wrapper-inner" }, h("slot", { key: 'c4f2a2a7a76f52db15f9a0b806017caea443c47a', name: "start" }), h("div", { key: '235cf383f268cc74412722cd31e246cbd4c2abe5', class: "native-wrapper", ref: (el) => (this.nativeWrapperEl = el), part: "container" }, this.renderSelectText(), this.renderListbox()), h("slot", { key: '1481302e11c494d49dfd80a7aaf743f7e851558f', name: "end" }), !hasFloatingOrStackedLabel && this.renderSelectIcon()), hasFloatingOrStackedLabel && this.renderSelectIcon(), shouldRenderHighlight && h("div", { key: '8a45ea9280651695c8e5435f266c286f3e3f6a18', class: "select-highlight" }))));
|
|
680
681
|
}
|
|
681
682
|
static get is() { return "ion-select"; }
|
|
682
683
|
static get encapsulation() { return "shadow"; }
|
|
@@ -1042,6 +1043,24 @@ export class Select {
|
|
|
1042
1043
|
},
|
|
1043
1044
|
"attribute": "value",
|
|
1044
1045
|
"reflect": false
|
|
1046
|
+
},
|
|
1047
|
+
"required": {
|
|
1048
|
+
"type": "boolean",
|
|
1049
|
+
"mutable": false,
|
|
1050
|
+
"complexType": {
|
|
1051
|
+
"original": "boolean",
|
|
1052
|
+
"resolved": "boolean",
|
|
1053
|
+
"references": {}
|
|
1054
|
+
},
|
|
1055
|
+
"required": false,
|
|
1056
|
+
"optional": false,
|
|
1057
|
+
"docs": {
|
|
1058
|
+
"tags": [],
|
|
1059
|
+
"text": "If true, screen readers will announce it as a required field. This property\nworks only for accessibility purposes, it will not prevent the form from\nsubmitting if the value is invalid."
|
|
1060
|
+
},
|
|
1061
|
+
"attribute": "required",
|
|
1062
|
+
"reflect": false,
|
|
1063
|
+
"defaultValue": "false"
|
|
1045
1064
|
}
|
|
1046
1065
|
};
|
|
1047
1066
|
}
|
|
@@ -31,6 +31,10 @@ export class Tab {
|
|
|
31
31
|
}
|
|
32
32
|
changeActive(isActive) {
|
|
33
33
|
if (isActive) {
|
|
34
|
+
// ensure tabindex gets updated before setting focus to the element
|
|
35
|
+
setTimeout(() => {
|
|
36
|
+
this.el.focus();
|
|
37
|
+
}, 50);
|
|
34
38
|
this.prepareLazyLoaded();
|
|
35
39
|
}
|
|
36
40
|
}
|
|
@@ -48,10 +52,10 @@ export class Tab {
|
|
|
48
52
|
}
|
|
49
53
|
render() {
|
|
50
54
|
const { tab, active, component } = this;
|
|
51
|
-
return (h(Host, { key: '
|
|
55
|
+
return (h(Host, { key: '30783785d1c744b8a186f0bda7cd21af2742c575', role: "tabpanel", "aria-hidden": !active ? 'true' : null, "aria-labelledby": `tab-button-${tab}`, class: {
|
|
52
56
|
'ion-page': component === undefined,
|
|
53
57
|
'tab-hidden': !active,
|
|
54
|
-
} }, h("slot", { key: '
|
|
58
|
+
}, tabIndex: !active ? '-1' : '0' }, h("slot", { key: '4fde7aa68c3149eae4bc3a5045303f31bf818b0b' })));
|
|
55
59
|
}
|
|
56
60
|
static get is() { return "ion-tab"; }
|
|
57
61
|
static get encapsulation() { return "shadow"; }
|
|
@@ -82,7 +82,7 @@ export class TabButton {
|
|
|
82
82
|
'ion-activatable': true,
|
|
83
83
|
'ion-selectable': true,
|
|
84
84
|
'ion-focusable': true,
|
|
85
|
-
} }, h("a", Object.assign({ key: '
|
|
85
|
+
} }, h("a", Object.assign({ key: '2f32e70232c7872b14e9ead1d1c31c98ad3577b4' }, attrs, { class: "button-native", part: "native", role: "tab", "aria-selected": selected ? 'true' : null, "aria-disabled": disabled ? 'true' : null, tabindex: disabled ? '-1' : '0' }, inheritedAttributes), h("span", { key: '5c9467b16e36a526a20f460980ec45022f464c3a', class: "button-inner" }, h("slot", { key: 'eefd60fac84ff01366a0f82f6ad71782ee7351e9' })), mode === 'md' && h("ion-ripple-effect", { key: '0d3452ae46e47f2d50c0198668c42e00e1a4d7bf', type: "unbounded" }))));
|
|
86
86
|
}
|
|
87
87
|
static get is() { return "ion-tab-button"; }
|
|
88
88
|
static get encapsulation() { return "shadow"; }
|
|
@@ -71,6 +71,7 @@ export class Toggle {
|
|
|
71
71
|
this.labelPlacement = 'start';
|
|
72
72
|
this.justify = undefined;
|
|
73
73
|
this.alignment = undefined;
|
|
74
|
+
this.required = false;
|
|
74
75
|
}
|
|
75
76
|
disabledChanged() {
|
|
76
77
|
if (this.gesture) {
|
|
@@ -152,12 +153,12 @@ export class Toggle {
|
|
|
152
153
|
return this.el.textContent !== '';
|
|
153
154
|
}
|
|
154
155
|
render() {
|
|
155
|
-
const { activated, color, checked, disabled, el, justify, labelPlacement, inputId, name, alignment } = this;
|
|
156
|
+
const { activated, color, checked, disabled, el, justify, labelPlacement, inputId, name, alignment, required } = this;
|
|
156
157
|
const mode = getIonMode(this);
|
|
157
158
|
const value = this.getValue();
|
|
158
159
|
const rtl = isRTL(el) ? 'rtl' : 'ltr';
|
|
159
160
|
renderHiddenInput(true, el, name, checked ? value : '', disabled);
|
|
160
|
-
return (h(Host, { key: '
|
|
161
|
+
return (h(Host, { key: 'ed75573caa6e37011f1453dd7f723fb9bd8a3656', onClick: this.onClick, class: createColorClasses(color, {
|
|
161
162
|
[mode]: true,
|
|
162
163
|
'in-item': hostContext('ion-item', el),
|
|
163
164
|
'toggle-activated': activated,
|
|
@@ -167,10 +168,10 @@ export class Toggle {
|
|
|
167
168
|
[`toggle-alignment-${alignment}`]: alignment !== undefined,
|
|
168
169
|
[`toggle-label-placement-${labelPlacement}`]: true,
|
|
169
170
|
[`toggle-${rtl}`]: true,
|
|
170
|
-
}) }, h("label", { key: '
|
|
171
|
+
}) }, h("label", { key: '484860e2a33f4d123904edb96159f0e1972d3add', class: "toggle-wrapper" }, h("input", Object.assign({ key: '360b53080aacfd99a9ff60ffb5219816bd4163ee', type: "checkbox", role: "switch", "aria-checked": `${checked}`, checked: checked, disabled: disabled, id: inputId, onFocus: () => this.onFocus(), onBlur: () => this.onBlur(), ref: (focusEl) => (this.focusEl = focusEl), required: required }, this.inheritedAttributes)), h("div", { key: 'f7239fa668fe11257239ea30cf0198e4f3274f6b', class: {
|
|
171
172
|
'label-text-wrapper': true,
|
|
172
173
|
'label-text-wrapper-hidden': !this.hasLabel,
|
|
173
|
-
}, part: "label" }, h("slot", { key: '
|
|
174
|
+
}, part: "label" }, h("slot", { key: '9495a4a39889822ee68e0d89dc5a2f863d1feb3c' })), h("div", { key: '55f1eb08c4b705e94fbcf02220bbe1d292f06155', class: "native-wrapper" }, this.renderToggleControl()))));
|
|
174
175
|
}
|
|
175
176
|
static get is() { return "ion-toggle"; }
|
|
176
177
|
static get encapsulation() { return "shadow"; }
|
|
@@ -352,6 +353,24 @@ export class Toggle {
|
|
|
352
353
|
},
|
|
353
354
|
"attribute": "alignment",
|
|
354
355
|
"reflect": false
|
|
356
|
+
},
|
|
357
|
+
"required": {
|
|
358
|
+
"type": "boolean",
|
|
359
|
+
"mutable": false,
|
|
360
|
+
"complexType": {
|
|
361
|
+
"original": "boolean",
|
|
362
|
+
"resolved": "boolean",
|
|
363
|
+
"references": {}
|
|
364
|
+
},
|
|
365
|
+
"required": false,
|
|
366
|
+
"optional": false,
|
|
367
|
+
"docs": {
|
|
368
|
+
"tags": [],
|
|
369
|
+
"text": "If true, screen readers will announce it as a required field. This property\nworks only for accessibility purposes, it will not prevent the form from\nsubmitting if the value is invalid."
|
|
370
|
+
},
|
|
371
|
+
"attribute": "required",
|
|
372
|
+
"reflect": false,
|
|
373
|
+
"defaultValue": "false"
|
|
355
374
|
}
|
|
356
375
|
};
|
|
357
376
|
}
|
|
@@ -12,6 +12,10 @@ import { getIonMode } from "../../global/ionic-global";
|
|
|
12
12
|
* @slot secondary - Content is placed to the left of the toolbar text in `ios` mode, and directly to the right in `md` mode.
|
|
13
13
|
* @slot primary - Content is placed to the right of the toolbar text in `ios` mode, and to the far right in `md` mode.
|
|
14
14
|
* @slot end - Content is placed to the right of the toolbar text in LTR, and to the left in RTL.
|
|
15
|
+
*
|
|
16
|
+
* @part background - The background of the toolbar, covering the entire area behind the toolbar content.
|
|
17
|
+
* @part container - The container that wraps all toolbar content, including the default slot and named slot content.
|
|
18
|
+
* @part content - The container for the default slot, wrapping content provided without a named slot.
|
|
15
19
|
*/
|
|
16
20
|
export class Toolbar {
|
|
17
21
|
constructor() {
|
|
@@ -62,10 +66,10 @@ export class Toolbar {
|
|
|
62
66
|
this.childrenStyles.forEach((value) => {
|
|
63
67
|
Object.assign(childStyles, value);
|
|
64
68
|
});
|
|
65
|
-
return (h(Host, { key: '
|
|
69
|
+
return (h(Host, { key: '4fdc9ae82a93237cc28ceb95b0ebd8069b62839d', class: Object.assign(Object.assign({}, childStyles), createColorClasses(this.color, {
|
|
66
70
|
[mode]: true,
|
|
67
71
|
'in-toolbar': hostContext('ion-toolbar', this.el),
|
|
68
|
-
})) }, h("div", { key: '
|
|
72
|
+
})) }, h("div", { key: '443a216362bbbf1c149ed12140d52b0f0ea2d664', class: "toolbar-background", part: "background" }), h("div", { key: '1df87f4027d605e42757a13d4828df45b90a4fdc', class: "toolbar-container", part: "container" }, h("slot", { key: 'f66f34972be8e3f4915b9c6f5808600dbaedb1ea', name: "start" }), h("slot", { key: '14f38b0975e956f404c4eb3ee56f2055c6615276', name: "secondary" }), h("div", { key: '75ba5953a25c7544793484d2b245792cb0a5af75', class: "toolbar-content", part: "content" }, h("slot", { key: '149dfa58ff7106f318fecb4134e7c69edf8bc231' })), h("slot", { key: '807ab9ad21d7f1d9d427a4086460bcb9e5e8c019', name: "primary" }), h("slot", { key: 'bd2f9da95d2fa8e74dc6e0666587ceecbba99d9f', name: "end" }))));
|
|
69
73
|
}
|
|
70
74
|
static get is() { return "ion-toolbar"; }
|
|
71
75
|
static get encapsulation() { return "shadow"; }
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* (C) Ionic http://ionicframework.com - MIT License
|
|
3
3
|
*/
|
|
4
|
+
import { config } from "../../global/config";
|
|
4
5
|
/**
|
|
5
6
|
* Logs a warning to the console with an Ionic prefix
|
|
6
7
|
* to indicate the library that is warning the developer.
|
|
@@ -8,9 +9,12 @@
|
|
|
8
9
|
* @param message - The string message to be logged to the console.
|
|
9
10
|
*/
|
|
10
11
|
export const printIonWarning = (message, ...params) => {
|
|
11
|
-
|
|
12
|
+
const logLevel = config.get('logLevel', "WARN" /* LogLevel.WARN */);
|
|
13
|
+
if (["WARN" /* LogLevel.WARN */].includes(logLevel)) {
|
|
14
|
+
return console.warn(`[Ionic Warning]: ${message}`, ...params);
|
|
15
|
+
}
|
|
12
16
|
};
|
|
13
|
-
|
|
17
|
+
/**
|
|
14
18
|
* Logs an error to the console with an Ionic prefix
|
|
15
19
|
* to indicate the library that is warning the developer.
|
|
16
20
|
*
|
|
@@ -18,7 +22,10 @@ export const printIonWarning = (message, ...params) => {
|
|
|
18
22
|
* @param params - Additional arguments to supply to the console.error.
|
|
19
23
|
*/
|
|
20
24
|
export const printIonError = (message, ...params) => {
|
|
21
|
-
|
|
25
|
+
const logLevel = config.get('logLevel', "ERROR" /* LogLevel.ERROR */);
|
|
26
|
+
if (["ERROR" /* LogLevel.ERROR */, "WARN" /* LogLevel.WARN */].includes(logLevel)) {
|
|
27
|
+
return console.error(`[Ionic Error]: ${message}`, ...params);
|
|
28
|
+
}
|
|
22
29
|
};
|
|
23
30
|
/**
|
|
24
31
|
* Prints an error informing developers that an implementation requires an element to be used
|