voyager-ionic-core 8.7.6 → 8.7.11
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/button.js +3 -7
- package/components/checkbox.js +64 -13
- package/components/header.js +42 -4
- package/components/index2.js +74 -3
- package/components/ion-accordion.js +93 -14
- package/components/ion-datetime.js +35 -2
- package/components/ion-input.js +6 -13
- package/components/ion-select.js +59 -10
- package/components/ion-textarea.js +5 -12
- package/components/ion-toggle.js +63 -16
- package/components/radio-group.js +60 -7
- package/components/validity.js +17 -0
- package/dist/cjs/{index-CD5Rjp23.js → index-094mMFB-.js} +76 -5
- package/dist/cjs/index.cjs.js +3 -3
- package/dist/cjs/ion-accordion_2.cjs.entry.js +91 -13
- package/dist/cjs/ion-app_8.cjs.entry.js +43 -5
- package/dist/cjs/ion-button_2.cjs.entry.js +3 -7
- package/dist/cjs/ion-checkbox.cjs.entry.js +61 -12
- package/dist/cjs/ion-datetime_3.cjs.entry.js +35 -2
- package/dist/cjs/ion-input.cjs.entry.js +6 -13
- package/dist/cjs/ion-modal.cjs.entry.js +1 -1
- package/dist/cjs/ion-nav_2.cjs.entry.js +1 -1
- package/dist/cjs/ion-popover.cjs.entry.js +1 -1
- package/dist/cjs/ion-radio_2.cjs.entry.js +57 -6
- package/dist/cjs/ion-select_3.cjs.entry.js +56 -9
- package/dist/cjs/ion-textarea.cjs.entry.js +5 -12
- package/dist/cjs/ion-toggle.cjs.entry.js +59 -14
- package/dist/cjs/ionic.cjs.js +1 -1
- package/dist/cjs/{ios.transition-j9CclgEW.js → ios.transition-BOt_uW73.js} +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/{md.transition-CwFyRSfv.js → md.transition-Dt968VXB.js} +1 -1
- package/dist/cjs/validity-BpS37YFM.js +19 -0
- package/dist/collection/components/accordion/accordion.js +93 -14
- package/dist/collection/components/button/button.js +3 -7
- package/dist/collection/components/checkbox/checkbox.js +68 -13
- package/dist/collection/components/datetime/datetime.js +35 -2
- package/dist/collection/components/header/header.ios.css +27 -1
- package/dist/collection/components/header/header.js +5 -4
- package/dist/collection/components/header/header.utils.js +37 -0
- package/dist/collection/components/input/input.js +6 -14
- package/dist/collection/components/radio-group/radio-group.js +64 -7
- package/dist/collection/components/select/select.js +60 -12
- package/dist/collection/components/textarea/textarea.js +5 -13
- package/dist/collection/components/toggle/toggle.js +63 -16
- package/dist/collection/utils/forms/index.js +1 -0
- package/dist/collection/utils/forms/validity.js +15 -0
- package/dist/collection/utils/test/playwright/page/utils/set-content.js +7 -0
- package/dist/collection/utils/test/playwright/page/utils/spy-on-event.js +32 -0
- package/dist/collection/utils/transition/index.js +74 -3
- package/dist/docs.json +1 -1
- package/dist/esm/{index-D6G2seR8.js → index-r2D9DEro.js} +76 -5
- package/dist/esm/index.js +3 -3
- package/dist/esm/ion-accordion_2.entry.js +91 -13
- package/dist/esm/ion-app_8.entry.js +43 -5
- package/dist/esm/ion-button_2.entry.js +3 -7
- package/dist/esm/ion-checkbox.entry.js +61 -12
- package/dist/esm/ion-datetime_3.entry.js +35 -2
- package/dist/esm/ion-input.entry.js +6 -13
- package/dist/esm/ion-modal.entry.js +1 -1
- package/dist/esm/ion-nav_2.entry.js +1 -1
- package/dist/esm/ion-popover.entry.js +1 -1
- package/dist/esm/ion-radio_2.entry.js +57 -6
- package/dist/esm/ion-select_3.entry.js +56 -9
- package/dist/esm/ion-textarea.entry.js +5 -12
- package/dist/esm/ion-toggle.entry.js +59 -14
- package/dist/esm/ionic.js +1 -1
- package/dist/esm/{ios.transition-Bpq9ixwv.js → ios.transition-BDzw0_Hm.js} +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/esm/{md.transition-zOA0oanq.js → md.transition-BzDYi3qq.js} +1 -1
- package/dist/esm/validity-DJztqcrH.js +17 -0
- package/dist/ionic/index.esm.js +1 -1
- package/dist/ionic/ionic.esm.js +1 -1
- package/dist/ionic/p-40c261a3.entry.js +4 -0
- package/dist/ionic/p-43ed1ef5.entry.js +4 -0
- package/dist/ionic/p-4e41ea20.entry.js +4 -0
- package/dist/ionic/{p-323421af.entry.js → p-5a39a99a.entry.js} +1 -1
- package/dist/ionic/p-5fb517e4.entry.js +4 -0
- package/dist/ionic/p-7380261c.entry.js +4 -0
- package/dist/ionic/{p-9a36e2e7.entry.js → p-95bddd49.entry.js} +1 -1
- package/dist/ionic/{p-DPhQmGJN.js → p-C7hRNDhM.js} +1 -1
- package/dist/ionic/p-DJztqcrH.js +4 -0
- package/dist/ionic/p-DUt5fQmA.js +4 -0
- package/dist/ionic/{p-9R1XyICs.js → p-DZRJwG4S.js} +1 -1
- package/dist/ionic/p-c19f63d0.entry.js +4 -0
- package/dist/ionic/p-cb93126d.entry.js +4 -0
- package/dist/ionic/p-d0a2a1ab.entry.js +4 -0
- package/dist/ionic/p-d1f54e28.entry.js +4 -0
- package/dist/ionic/p-d3014190.entry.js +4 -0
- package/dist/ionic/{p-de7b5fa3.entry.js → p-e16b69e1.entry.js} +1 -1
- package/dist/ionic/svg/checkbox-outline.svg +1 -0
- package/dist/ionic/svg/checkbox-sharp.svg +1 -0
- package/dist/ionic/svg/checkbox.svg +1 -0
- package/dist/ionic/svg/checkmark-circle-outline.svg +1 -0
- package/dist/ionic/svg/checkmark-circle-sharp.svg +1 -0
- package/dist/ionic/svg/checkmark-circle.svg +1 -0
- package/dist/ionic/svg/checkmark-done-circle-outline.svg +1 -0
- package/dist/ionic/svg/checkmark-done-circle-sharp.svg +1 -0
- package/dist/ionic/svg/checkmark-done-circle.svg +1 -0
- package/dist/ionic/svg/checkmark-done-outline.svg +1 -0
- package/dist/ionic/svg/checkmark-done-sharp.svg +1 -0
- package/dist/ionic/svg/checkmark-done.svg +1 -0
- package/dist/ionic/svg/checkmark-outline.svg +1 -0
- package/dist/ionic/svg/checkmark-sharp.svg +1 -0
- package/dist/ionic/svg/checkmark.svg +1 -0
- package/dist/ionic/svg/chevron-back-circle-outline.svg +1 -0
- package/dist/ionic/svg/chevron-back-circle-sharp.svg +1 -0
- package/dist/ionic/svg/chevron-back-circle.svg +1 -0
- package/dist/ionic/svg/chevron-back-outline.svg +1 -0
- package/dist/ionic/svg/chevron-back-sharp.svg +1 -0
- package/dist/ionic/svg/chevron-back.svg +1 -0
- package/dist/ionic/svg/chevron-collapse-outline.svg +1 -0
- package/dist/ionic/svg/chevron-collapse-sharp.svg +1 -0
- package/dist/ionic/svg/chevron-collapse.svg +1 -0
- package/dist/ionic/svg/chevron-down-circle-outline.svg +1 -0
- package/dist/ionic/svg/chevron-down-circle-sharp.svg +1 -0
- package/dist/ionic/svg/chevron-down-circle.svg +1 -0
- package/dist/ionic/svg/chevron-down-outline.svg +1 -0
- package/dist/ionic/svg/chevron-down-sharp.svg +1 -0
- package/dist/ionic/svg/chevron-down.svg +1 -0
- package/dist/ionic/svg/chevron-expand-outline.svg +1 -0
- package/dist/ionic/svg/chevron-expand-sharp.svg +1 -0
- package/dist/ionic/svg/chevron-expand.svg +1 -0
- package/dist/ionic/svg/chevron-forward-circle-outline.svg +1 -0
- package/dist/ionic/svg/chevron-forward-circle-sharp.svg +1 -0
- package/dist/ionic/svg/chevron-forward-circle.svg +1 -0
- package/dist/ionic/svg/chevron-forward-outline.svg +1 -0
- package/dist/ionic/svg/chevron-forward-sharp.svg +1 -0
- package/dist/ionic/svg/chevron-forward.svg +1 -0
- package/dist/ionic/svg/chevron-up-circle-outline.svg +1 -0
- package/dist/ionic/svg/chevron-up-circle-sharp.svg +1 -0
- package/dist/ionic/svg/chevron-up-circle.svg +1 -0
- package/dist/ionic/svg/chevron-up-outline.svg +1 -0
- package/dist/ionic/svg/chevron-up-sharp.svg +1 -0
- package/dist/ionic/svg/chevron-up.svg +1 -0
- package/dist/ionic/svg/clipboard-outline.svg +1 -0
- package/dist/ionic/svg/clipboard-sharp.svg +1 -0
- package/dist/ionic/svg/clipboard.svg +1 -0
- package/dist/ionic/svg/close-circle-outline.svg +1 -0
- package/dist/ionic/svg/close-circle-sharp.svg +1 -0
- package/dist/ionic/svg/close-circle.svg +1 -0
- package/dist/ionic/svg/close-outline.svg +1 -0
- package/dist/ionic/svg/close-sharp.svg +1 -0
- package/dist/ionic/svg/close.svg +1 -0
- package/dist/ionic/svg/cloud-circle-outline.svg +1 -0
- package/dist/ionic/svg/cloud-circle-sharp.svg +1 -0
- package/dist/ionic/svg/cloud-circle.svg +1 -0
- package/dist/ionic/svg/cloud-done-outline.svg +1 -0
- package/dist/ionic/svg/cloud-done-sharp.svg +1 -0
- package/dist/ionic/svg/cloud-done.svg +1 -0
- package/dist/ionic/svg/cloud-download-outline.svg +1 -0
- package/dist/ionic/svg/cloud-download-sharp.svg +1 -0
- package/dist/ionic/svg/cloud-download.svg +1 -0
- package/dist/ionic/svg/cloud-offline-outline.svg +1 -0
- package/dist/ionic/svg/cloud-offline-sharp.svg +1 -0
- package/dist/ionic/svg/cloud-offline.svg +1 -0
- package/dist/ionic/svg/cloud-outline.svg +1 -0
- package/dist/ionic/svg/cloud-sharp.svg +1 -0
- package/dist/ionic/svg/cloud-upload-outline.svg +1 -0
- package/dist/ionic/svg/cloud-upload-sharp.svg +1 -0
- package/dist/ionic/svg/cloud-upload.svg +1 -0
- package/dist/ionic/svg/cloud.svg +1 -0
- package/dist/ionic/svg/cloudy-night-outline.svg +1 -0
- package/dist/ionic/svg/cloudy-night-sharp.svg +1 -0
- package/dist/ionic/svg/cloudy-night.svg +1 -0
- package/dist/ionic/svg/cloudy-outline.svg +1 -0
- package/dist/ionic/svg/cloudy-sharp.svg +1 -0
- package/dist/ionic/svg/cloudy.svg +1 -0
- package/dist/ionic/svg/code-download-outline.svg +1 -0
- package/dist/ionic/svg/code-download-sharp.svg +1 -0
- package/dist/ionic/svg/code-download.svg +1 -0
- package/dist/ionic/svg/code-outline.svg +1 -0
- package/dist/ionic/svg/code-sharp.svg +1 -0
- package/dist/ionic/svg/code-slash-outline.svg +1 -0
- package/dist/ionic/svg/code-slash-sharp.svg +1 -0
- package/dist/ionic/svg/code-slash.svg +1 -0
- package/dist/ionic/svg/code-working-outline.svg +1 -0
- package/dist/ionic/svg/code-working-sharp.svg +1 -0
- package/dist/ionic/svg/code-working.svg +1 -0
- package/dist/ionic/svg/code.svg +1 -0
- package/dist/ionic/svg/cog-outline.svg +1 -0
- package/dist/ionic/svg/cog-sharp.svg +1 -0
- package/dist/ionic/svg/cog.svg +1 -0
- package/dist/ionic/svg/color-fill-outline.svg +1 -0
- package/dist/ionic/svg/color-fill-sharp.svg +1 -0
- package/dist/ionic/svg/color-fill.svg +1 -0
- package/dist/ionic/svg/color-filter-outline.svg +1 -0
- package/dist/ionic/svg/color-filter-sharp.svg +1 -0
- package/dist/ionic/svg/color-filter.svg +1 -0
- package/dist/ionic/svg/color-palette-outline.svg +1 -0
- package/dist/ionic/svg/color-palette-sharp.svg +1 -0
- package/dist/ionic/svg/color-palette.svg +1 -0
- package/dist/ionic/svg/color-wand-outline.svg +1 -0
- package/dist/ionic/svg/color-wand-sharp.svg +1 -0
- package/dist/ionic/svg/color-wand.svg +1 -0
- package/dist/ionic/svg/compass-outline.svg +1 -0
- package/dist/ionic/svg/compass-sharp.svg +1 -0
- package/dist/ionic/svg/compass.svg +1 -0
- package/dist/ionic/svg/construct-outline.svg +1 -0
- package/dist/ionic/svg/construct-sharp.svg +1 -0
- package/dist/ionic/svg/construct.svg +1 -0
- package/dist/ionic/svg/contract-outline.svg +1 -0
- package/dist/ionic/svg/contract-sharp.svg +1 -0
- package/dist/ionic/svg/contract.svg +1 -0
- package/dist/ionic/svg/contrast-outline.svg +1 -0
- package/dist/ionic/svg/contrast-sharp.svg +1 -0
- package/dist/ionic/svg/contrast.svg +1 -0
- package/dist/ionic/svg/copy-outline.svg +1 -0
- package/dist/ionic/svg/copy-sharp.svg +1 -0
- package/dist/ionic/svg/copy.svg +1 -0
- package/dist/ionic/svg/create-outline.svg +1 -0
- package/dist/ionic/svg/create-sharp.svg +1 -0
- package/dist/ionic/svg/create.svg +1 -0
- package/dist/ionic/svg/crop-outline.svg +1 -0
- package/dist/ionic/svg/crop-sharp.svg +1 -0
- package/dist/ionic/svg/crop.svg +1 -0
- package/dist/ionic/svg/cube-outline.svg +1 -0
- package/dist/ionic/svg/cube-sharp.svg +1 -0
- package/dist/ionic/svg/cube.svg +1 -0
- package/dist/ionic/svg/cut-outline.svg +1 -0
- package/dist/ionic/svg/cut-sharp.svg +1 -0
- package/dist/ionic/svg/cut.svg +1 -0
- package/dist/ionic/svg/desktop-outline.svg +1 -0
- package/dist/ionic/svg/desktop-sharp.svg +1 -0
- package/dist/ionic/svg/desktop.svg +1 -0
- package/dist/ionic/svg/diamond-outline.svg +1 -0
- package/dist/ionic/svg/diamond-sharp.svg +1 -0
- package/dist/ionic/svg/diamond.svg +1 -0
- package/dist/ionic/svg/dice-outline.svg +1 -0
- package/dist/ionic/svg/dice-sharp.svg +1 -0
- package/dist/ionic/svg/dice.svg +1 -0
- package/dist/ionic/svg/disc-outline.svg +1 -0
- package/dist/ionic/svg/disc-sharp.svg +1 -0
- package/dist/ionic/svg/disc.svg +1 -0
- package/dist/ionic/svg/document-attach-outline.svg +1 -0
- package/dist/ionic/svg/document-attach-sharp.svg +1 -0
- package/dist/ionic/svg/document-attach.svg +1 -0
- package/dist/ionic/svg/document-lock-outline.svg +1 -0
- package/dist/ionic/svg/document-lock-sharp.svg +1 -0
- package/dist/ionic/svg/document-lock.svg +1 -0
- package/dist/ionic/svg/document-outline.svg +1 -0
- package/dist/types/components/accordion/accordion.d.ts +18 -1
- package/dist/types/components/checkbox/checkbox.d.ts +9 -2
- package/dist/types/components/datetime/datetime.d.ts +10 -0
- package/dist/types/components/header/header.utils.d.ts +10 -0
- package/dist/types/components/input/input.d.ts +0 -4
- package/dist/types/components/radio-group/radio-group.d.ts +9 -1
- package/dist/types/components/select/select.d.ts +7 -1
- package/dist/types/components/textarea/textarea.d.ts +0 -4
- package/dist/types/components/toggle/toggle.d.ts +7 -2
- package/dist/types/utils/forms/index.d.ts +1 -0
- package/dist/types/utils/forms/validity.d.ts +10 -0
- package/dist/types/utils/transition/index.d.ts +9 -0
- package/hydrate/index.js +687 -413
- package/hydrate/index.mjs +687 -413
- package/package.json +4 -4
- package/dist/ionic/p-1c8a476d.entry.js +0 -4
- package/dist/ionic/p-3355a2ff.entry.js +0 -4
- package/dist/ionic/p-4efea47a.entry.js +0 -4
- package/dist/ionic/p-62e50f80.entry.js +0 -4
- package/dist/ionic/p-785026d7.entry.js +0 -4
- package/dist/ionic/p-78c74a3e.entry.js +0 -4
- package/dist/ionic/p-7bcfc421.entry.js +0 -4
- package/dist/ionic/p-83fc84e7.entry.js +0 -4
- package/dist/ionic/p-913a7c1e.entry.js +0 -4
- package/dist/ionic/p-CMhMiYSX.js +0 -4
- package/dist/ionic/p-c17c0a01.entry.js +0 -4
|
@@ -10,11 +10,22 @@ const iosTransitionAnimation = () => import('./ios.transition');
|
|
|
10
10
|
const mdTransitionAnimation = () => import('./md.transition');
|
|
11
11
|
const focusController = createFocusController();
|
|
12
12
|
// TODO(FW-2832): types
|
|
13
|
+
/**
|
|
14
|
+
* Executes the main page transition.
|
|
15
|
+
* It also manages the lifecycle of header visibility (if any)
|
|
16
|
+
* to prevent visual flickering in iOS. The flickering only
|
|
17
|
+
* occurs for a condensed header that is placed above the content.
|
|
18
|
+
*
|
|
19
|
+
* @param opts Options for the transition.
|
|
20
|
+
* @returns A promise that resolves when the transition is complete.
|
|
21
|
+
*/
|
|
13
22
|
export const transition = (opts) => {
|
|
14
23
|
return new Promise((resolve, reject) => {
|
|
15
24
|
writeTask(() => {
|
|
16
|
-
|
|
17
|
-
|
|
25
|
+
const transitioningInactiveHeader = getIosIonHeader(opts);
|
|
26
|
+
beforeTransition(opts, transitioningInactiveHeader);
|
|
27
|
+
runTransition(opts)
|
|
28
|
+
.then((result) => {
|
|
18
29
|
if (result.animation) {
|
|
19
30
|
result.animation.destroy();
|
|
20
31
|
}
|
|
@@ -23,15 +34,21 @@ export const transition = (opts) => {
|
|
|
23
34
|
}, (error) => {
|
|
24
35
|
afterTransition(opts);
|
|
25
36
|
reject(error);
|
|
37
|
+
})
|
|
38
|
+
.finally(() => {
|
|
39
|
+
// Ensure that the header is restored to its original state.
|
|
40
|
+
setHeaderTransitionClass(transitioningInactiveHeader, false);
|
|
26
41
|
});
|
|
27
42
|
});
|
|
28
43
|
});
|
|
29
44
|
};
|
|
30
|
-
const beforeTransition = (opts) => {
|
|
45
|
+
const beforeTransition = (opts, transitioningInactiveHeader) => {
|
|
31
46
|
const enteringEl = opts.enteringEl;
|
|
32
47
|
const leavingEl = opts.leavingEl;
|
|
33
48
|
focusController.saveViewFocus(leavingEl);
|
|
34
49
|
setZIndex(enteringEl, leavingEl, opts.direction);
|
|
50
|
+
// Prevent flickering of the header by adding a class.
|
|
51
|
+
setHeaderTransitionClass(transitioningInactiveHeader, true);
|
|
35
52
|
if (opts.showGoBack) {
|
|
36
53
|
enteringEl.classList.add('can-go-back');
|
|
37
54
|
}
|
|
@@ -220,6 +237,39 @@ const setZIndex = (enteringEl, leavingEl, direction) => {
|
|
|
220
237
|
leavingEl.style.zIndex = '100';
|
|
221
238
|
}
|
|
222
239
|
};
|
|
240
|
+
/**
|
|
241
|
+
* Add a class to ensure that the header (if any)
|
|
242
|
+
* does not flicker during the transition. By adding the
|
|
243
|
+
* transitioning class, we ensure that the header has
|
|
244
|
+
* the necessary styles to prevent the following flickers:
|
|
245
|
+
* 1. When entering a page with a condensed header, the
|
|
246
|
+
* header should never be visible. However,
|
|
247
|
+
* it briefly renders the background color while
|
|
248
|
+
* the transition is occurring.
|
|
249
|
+
* 2. When leaving a page with a condensed header, the
|
|
250
|
+
* header has an opacity of 0 and the pages
|
|
251
|
+
* have a z-index which causes the entering page to
|
|
252
|
+
* briefly show it's content underneath the leaving page.
|
|
253
|
+
* 3. When entering a page or leaving a page with a fade
|
|
254
|
+
* header, the header should not have a background color.
|
|
255
|
+
* However, it briefly shows the background color while
|
|
256
|
+
* the transition is occurring.
|
|
257
|
+
*
|
|
258
|
+
* @param header The header element to modify.
|
|
259
|
+
* @param isTransitioning Whether the transition is occurring.
|
|
260
|
+
*/
|
|
261
|
+
const setHeaderTransitionClass = (header, isTransitioning) => {
|
|
262
|
+
if (!header) {
|
|
263
|
+
return;
|
|
264
|
+
}
|
|
265
|
+
const transitionClass = 'header-transitioning';
|
|
266
|
+
if (isTransitioning) {
|
|
267
|
+
header.classList.add(transitionClass);
|
|
268
|
+
}
|
|
269
|
+
else {
|
|
270
|
+
header.classList.remove(transitionClass);
|
|
271
|
+
}
|
|
272
|
+
};
|
|
223
273
|
export const getIonPageElement = (element) => {
|
|
224
274
|
if (element.classList.contains('ion-page')) {
|
|
225
275
|
return element;
|
|
@@ -231,3 +281,24 @@ export const getIonPageElement = (element) => {
|
|
|
231
281
|
// idk, return the original element so at least something animates and we don't have a null pointer
|
|
232
282
|
return element;
|
|
233
283
|
};
|
|
284
|
+
/**
|
|
285
|
+
* Retrieves the ion-header element from a page based on the
|
|
286
|
+
* direction of the transition.
|
|
287
|
+
*
|
|
288
|
+
* @param opts Options for the transition.
|
|
289
|
+
* @returns The ion-header element or null if not found or not in 'ios' mode.
|
|
290
|
+
*/
|
|
291
|
+
const getIosIonHeader = (opts) => {
|
|
292
|
+
const enteringEl = opts.enteringEl;
|
|
293
|
+
const leavingEl = opts.leavingEl;
|
|
294
|
+
const direction = opts.direction;
|
|
295
|
+
const mode = opts.mode;
|
|
296
|
+
if (mode !== 'ios') {
|
|
297
|
+
return null;
|
|
298
|
+
}
|
|
299
|
+
const element = direction === 'back' ? leavingEl : enteringEl;
|
|
300
|
+
if (!element) {
|
|
301
|
+
return null;
|
|
302
|
+
}
|
|
303
|
+
return element.querySelector('ion-header');
|
|
304
|
+
};
|
package/dist/docs.json
CHANGED
|
@@ -118,15 +118,26 @@ const createFocusController = () => {
|
|
|
118
118
|
};
|
|
119
119
|
const LAST_FOCUS = 'ion-last-focus';
|
|
120
120
|
|
|
121
|
-
const iosTransitionAnimation = () => import('./ios.transition-
|
|
122
|
-
const mdTransitionAnimation = () => import('./md.transition-
|
|
121
|
+
const iosTransitionAnimation = () => import('./ios.transition-BDzw0_Hm.js');
|
|
122
|
+
const mdTransitionAnimation = () => import('./md.transition-BzDYi3qq.js');
|
|
123
123
|
const focusController = createFocusController();
|
|
124
124
|
// TODO(FW-2832): types
|
|
125
|
+
/**
|
|
126
|
+
* Executes the main page transition.
|
|
127
|
+
* It also manages the lifecycle of header visibility (if any)
|
|
128
|
+
* to prevent visual flickering in iOS. The flickering only
|
|
129
|
+
* occurs for a condensed header that is placed above the content.
|
|
130
|
+
*
|
|
131
|
+
* @param opts Options for the transition.
|
|
132
|
+
* @returns A promise that resolves when the transition is complete.
|
|
133
|
+
*/
|
|
125
134
|
const transition = (opts) => {
|
|
126
135
|
return new Promise((resolve, reject) => {
|
|
127
136
|
writeTask(() => {
|
|
128
|
-
|
|
129
|
-
|
|
137
|
+
const transitioningInactiveHeader = getIosIonHeader(opts);
|
|
138
|
+
beforeTransition(opts, transitioningInactiveHeader);
|
|
139
|
+
runTransition(opts)
|
|
140
|
+
.then((result) => {
|
|
130
141
|
if (result.animation) {
|
|
131
142
|
result.animation.destroy();
|
|
132
143
|
}
|
|
@@ -135,15 +146,21 @@ const transition = (opts) => {
|
|
|
135
146
|
}, (error) => {
|
|
136
147
|
afterTransition(opts);
|
|
137
148
|
reject(error);
|
|
149
|
+
})
|
|
150
|
+
.finally(() => {
|
|
151
|
+
// Ensure that the header is restored to its original state.
|
|
152
|
+
setHeaderTransitionClass(transitioningInactiveHeader, false);
|
|
138
153
|
});
|
|
139
154
|
});
|
|
140
155
|
});
|
|
141
156
|
};
|
|
142
|
-
const beforeTransition = (opts) => {
|
|
157
|
+
const beforeTransition = (opts, transitioningInactiveHeader) => {
|
|
143
158
|
const enteringEl = opts.enteringEl;
|
|
144
159
|
const leavingEl = opts.leavingEl;
|
|
145
160
|
focusController.saveViewFocus(leavingEl);
|
|
146
161
|
setZIndex(enteringEl, leavingEl, opts.direction);
|
|
162
|
+
// Prevent flickering of the header by adding a class.
|
|
163
|
+
setHeaderTransitionClass(transitioningInactiveHeader, true);
|
|
147
164
|
if (opts.showGoBack) {
|
|
148
165
|
enteringEl.classList.add('can-go-back');
|
|
149
166
|
}
|
|
@@ -332,6 +349,39 @@ const setZIndex = (enteringEl, leavingEl, direction) => {
|
|
|
332
349
|
leavingEl.style.zIndex = '100';
|
|
333
350
|
}
|
|
334
351
|
};
|
|
352
|
+
/**
|
|
353
|
+
* Add a class to ensure that the header (if any)
|
|
354
|
+
* does not flicker during the transition. By adding the
|
|
355
|
+
* transitioning class, we ensure that the header has
|
|
356
|
+
* the necessary styles to prevent the following flickers:
|
|
357
|
+
* 1. When entering a page with a condensed header, the
|
|
358
|
+
* header should never be visible. However,
|
|
359
|
+
* it briefly renders the background color while
|
|
360
|
+
* the transition is occurring.
|
|
361
|
+
* 2. When leaving a page with a condensed header, the
|
|
362
|
+
* header has an opacity of 0 and the pages
|
|
363
|
+
* have a z-index which causes the entering page to
|
|
364
|
+
* briefly show it's content underneath the leaving page.
|
|
365
|
+
* 3. When entering a page or leaving a page with a fade
|
|
366
|
+
* header, the header should not have a background color.
|
|
367
|
+
* However, it briefly shows the background color while
|
|
368
|
+
* the transition is occurring.
|
|
369
|
+
*
|
|
370
|
+
* @param header The header element to modify.
|
|
371
|
+
* @param isTransitioning Whether the transition is occurring.
|
|
372
|
+
*/
|
|
373
|
+
const setHeaderTransitionClass = (header, isTransitioning) => {
|
|
374
|
+
if (!header) {
|
|
375
|
+
return;
|
|
376
|
+
}
|
|
377
|
+
const transitionClass = 'header-transitioning';
|
|
378
|
+
if (isTransitioning) {
|
|
379
|
+
header.classList.add(transitionClass);
|
|
380
|
+
}
|
|
381
|
+
else {
|
|
382
|
+
header.classList.remove(transitionClass);
|
|
383
|
+
}
|
|
384
|
+
};
|
|
335
385
|
const getIonPageElement = (element) => {
|
|
336
386
|
if (element.classList.contains('ion-page')) {
|
|
337
387
|
return element;
|
|
@@ -343,5 +393,26 @@ const getIonPageElement = (element) => {
|
|
|
343
393
|
// idk, return the original element so at least something animates and we don't have a null pointer
|
|
344
394
|
return element;
|
|
345
395
|
};
|
|
396
|
+
/**
|
|
397
|
+
* Retrieves the ion-header element from a page based on the
|
|
398
|
+
* direction of the transition.
|
|
399
|
+
*
|
|
400
|
+
* @param opts Options for the transition.
|
|
401
|
+
* @returns The ion-header element or null if not found or not in 'ios' mode.
|
|
402
|
+
*/
|
|
403
|
+
const getIosIonHeader = (opts) => {
|
|
404
|
+
const enteringEl = opts.enteringEl;
|
|
405
|
+
const leavingEl = opts.leavingEl;
|
|
406
|
+
const direction = opts.direction;
|
|
407
|
+
const mode = opts.mode;
|
|
408
|
+
if (mode !== 'ios') {
|
|
409
|
+
return null;
|
|
410
|
+
}
|
|
411
|
+
const element = direction === 'back' ? leavingEl : enteringEl;
|
|
412
|
+
if (!element) {
|
|
413
|
+
return null;
|
|
414
|
+
}
|
|
415
|
+
return element.querySelector('ion-header');
|
|
416
|
+
};
|
|
346
417
|
|
|
347
418
|
export { LIFECYCLE_WILL_ENTER as L, LIFECYCLE_DID_ENTER as a, LIFECYCLE_WILL_LEAVE as b, LIFECYCLE_DID_LEAVE as c, LIFECYCLE_WILL_UNLOAD as d, deepReady as e, getIonPageElement as g, lifecycle as l, setPageHidden as s, transition as t, waitForMount as w };
|
package/dist/esm/index.js
CHANGED
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
* (C) Ionic http://ionicframework.com - MIT License
|
|
3
3
|
*/
|
|
4
4
|
export { c as createAnimation } from './animation-Dt8bGnA-.js';
|
|
5
|
-
export { a as LIFECYCLE_DID_ENTER, c as LIFECYCLE_DID_LEAVE, L as LIFECYCLE_WILL_ENTER, b as LIFECYCLE_WILL_LEAVE, d as LIFECYCLE_WILL_UNLOAD, g as getIonPageElement } from './index-
|
|
6
|
-
export { iosTransitionAnimation } from './ios.transition-
|
|
7
|
-
export { mdTransitionAnimation } from './md.transition-
|
|
5
|
+
export { a as LIFECYCLE_DID_ENTER, c as LIFECYCLE_DID_LEAVE, L as LIFECYCLE_WILL_ENTER, b as LIFECYCLE_WILL_LEAVE, d as LIFECYCLE_WILL_UNLOAD, g as getIonPageElement } from './index-r2D9DEro.js';
|
|
6
|
+
export { iosTransitionAnimation } from './ios.transition-BDzw0_Hm.js';
|
|
7
|
+
export { mdTransitionAnimation } from './md.transition-BzDYi3qq.js';
|
|
8
8
|
export { g as getTimeGivenProgression } from './cubic-bezier-hHmYLOfE.js';
|
|
9
9
|
export { createGesture } from './index-CfgBF1SE.js';
|
|
10
10
|
export { g as getPlatforms, i as initialize, a as isPlatform } from './ionic-global-CDrldh-5.js';
|
|
@@ -13,10 +13,57 @@ const accordionMdCss = ":host{display:block;position:relative;width:100%;backgro
|
|
|
13
13
|
const Accordion = class {
|
|
14
14
|
constructor(hostRef) {
|
|
15
15
|
registerInstance(this, hostRef);
|
|
16
|
-
this.
|
|
16
|
+
this.accordionGroupUpdateHandler = () => {
|
|
17
|
+
/**
|
|
18
|
+
* Determine if this update will cause an actual state change.
|
|
19
|
+
* We only want to mark as "interacted" if the state is changing.
|
|
20
|
+
*/
|
|
21
|
+
const accordionGroup = this.accordionGroupEl;
|
|
22
|
+
if (accordionGroup) {
|
|
23
|
+
const value = accordionGroup.value;
|
|
24
|
+
const accordionValue = this.value;
|
|
25
|
+
const shouldExpand = Array.isArray(value) ? value.includes(accordionValue) : value === accordionValue;
|
|
26
|
+
const isExpanded = this.state === 4 /* AccordionState.Expanded */ || this.state === 8 /* AccordionState.Expanding */;
|
|
27
|
+
const stateWillChange = shouldExpand !== isExpanded;
|
|
28
|
+
/**
|
|
29
|
+
* Only mark as interacted if:
|
|
30
|
+
* 1. This is not the first update we've received with a defined value
|
|
31
|
+
* 2. The state is actually changing (prevents redundant updates from enabling animations)
|
|
32
|
+
*/
|
|
33
|
+
if (this.hasReceivedFirstUpdate && stateWillChange) {
|
|
34
|
+
this.hasInteracted = true;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Only count this as the first update if the group value is defined.
|
|
38
|
+
* This prevents the initial undefined value from the group's componentDidLoad
|
|
39
|
+
* from being treated as the first real update.
|
|
40
|
+
*/
|
|
41
|
+
if (value !== undefined) {
|
|
42
|
+
this.hasReceivedFirstUpdate = true;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
this.updateState();
|
|
46
|
+
};
|
|
17
47
|
this.state = 1 /* AccordionState.Collapsed */;
|
|
18
48
|
this.isNext = false;
|
|
19
49
|
this.isPrevious = false;
|
|
50
|
+
/**
|
|
51
|
+
* Tracks whether a user-initiated interaction has occurred.
|
|
52
|
+
* Animations are disabled until the first interaction happens.
|
|
53
|
+
* This prevents the accordion from animating when it's programmatically
|
|
54
|
+
* set to an expanded or collapsed state on initial load.
|
|
55
|
+
*/
|
|
56
|
+
this.hasInteracted = false;
|
|
57
|
+
/**
|
|
58
|
+
* Tracks if this accordion has ever been expanded.
|
|
59
|
+
* Used to prevent the first expansion from animating.
|
|
60
|
+
*/
|
|
61
|
+
this.hasEverBeenExpanded = false;
|
|
62
|
+
/**
|
|
63
|
+
* Tracks if this accordion has received its first update from the group.
|
|
64
|
+
* Used to distinguish initial programmatic sets from user interactions.
|
|
65
|
+
*/
|
|
66
|
+
this.hasReceivedFirstUpdate = false;
|
|
20
67
|
/**
|
|
21
68
|
* The value of the accordion. Defaults to an autogenerated
|
|
22
69
|
* value.
|
|
@@ -121,10 +168,15 @@ const Accordion = class {
|
|
|
121
168
|
iconEl.setAttribute('aria-hidden', 'true');
|
|
122
169
|
ionItem.appendChild(iconEl);
|
|
123
170
|
};
|
|
124
|
-
this.expandAccordion = (
|
|
171
|
+
this.expandAccordion = () => {
|
|
125
172
|
const { contentEl, contentElWrapper } = this;
|
|
126
|
-
|
|
173
|
+
/**
|
|
174
|
+
* If the content elements aren't available yet, just set the state.
|
|
175
|
+
* This happens on initial render before the DOM is ready.
|
|
176
|
+
*/
|
|
177
|
+
if (contentEl === undefined || contentElWrapper === undefined) {
|
|
127
178
|
this.state = 4 /* AccordionState.Expanded */;
|
|
179
|
+
this.hasEverBeenExpanded = true;
|
|
128
180
|
return;
|
|
129
181
|
}
|
|
130
182
|
if (this.state === 4 /* AccordionState.Expanded */) {
|
|
@@ -133,6 +185,11 @@ const Accordion = class {
|
|
|
133
185
|
if (this.currentRaf !== undefined) {
|
|
134
186
|
cancelAnimationFrame(this.currentRaf);
|
|
135
187
|
}
|
|
188
|
+
/**
|
|
189
|
+
* Mark that this accordion has been expanded at least once.
|
|
190
|
+
* This allows subsequent expansions to animate.
|
|
191
|
+
*/
|
|
192
|
+
this.hasEverBeenExpanded = true;
|
|
136
193
|
if (this.shouldAnimate()) {
|
|
137
194
|
raf(() => {
|
|
138
195
|
this.state = 8 /* AccordionState.Expanding */;
|
|
@@ -150,9 +207,13 @@ const Accordion = class {
|
|
|
150
207
|
this.state = 4 /* AccordionState.Expanded */;
|
|
151
208
|
}
|
|
152
209
|
};
|
|
153
|
-
this.collapseAccordion = (
|
|
210
|
+
this.collapseAccordion = () => {
|
|
154
211
|
const { contentEl } = this;
|
|
155
|
-
|
|
212
|
+
/**
|
|
213
|
+
* If the content element isn't available yet, just set the state.
|
|
214
|
+
* This happens on initial render before the DOM is ready.
|
|
215
|
+
*/
|
|
216
|
+
if (contentEl === undefined) {
|
|
156
217
|
this.state = 1 /* AccordionState.Collapsed */;
|
|
157
218
|
return;
|
|
158
219
|
}
|
|
@@ -187,6 +248,18 @@ const Accordion = class {
|
|
|
187
248
|
* of what is set in the config.
|
|
188
249
|
*/
|
|
189
250
|
this.shouldAnimate = () => {
|
|
251
|
+
/**
|
|
252
|
+
* Don't animate until after the first user interaction.
|
|
253
|
+
* This prevents animations on initial load when accordions
|
|
254
|
+
* start in an expanded or collapsed state programmatically.
|
|
255
|
+
*
|
|
256
|
+
* Additionally, don't animate the very first expansion even if
|
|
257
|
+
* hasInteracted is true. This handles edge cases like React StrictMode
|
|
258
|
+
* where effects run twice and might incorrectly mark as interacted.
|
|
259
|
+
*/
|
|
260
|
+
if (!this.hasInteracted || !this.hasEverBeenExpanded) {
|
|
261
|
+
return false;
|
|
262
|
+
}
|
|
190
263
|
if (typeof window === 'undefined') {
|
|
191
264
|
return false;
|
|
192
265
|
}
|
|
@@ -203,7 +276,7 @@ const Accordion = class {
|
|
|
203
276
|
}
|
|
204
277
|
return true;
|
|
205
278
|
};
|
|
206
|
-
this.updateState = async (
|
|
279
|
+
this.updateState = async () => {
|
|
207
280
|
const accordionGroup = this.accordionGroupEl;
|
|
208
281
|
const accordionValue = this.value;
|
|
209
282
|
if (!accordionGroup) {
|
|
@@ -212,11 +285,11 @@ const Accordion = class {
|
|
|
212
285
|
const value = accordionGroup.value;
|
|
213
286
|
const shouldExpand = Array.isArray(value) ? value.includes(accordionValue) : value === accordionValue;
|
|
214
287
|
if (shouldExpand) {
|
|
215
|
-
this.expandAccordion(
|
|
288
|
+
this.expandAccordion();
|
|
216
289
|
this.isNext = this.isPrevious = false;
|
|
217
290
|
}
|
|
218
291
|
else {
|
|
219
|
-
this.collapseAccordion(
|
|
292
|
+
this.collapseAccordion();
|
|
220
293
|
/**
|
|
221
294
|
* When using popout or inset,
|
|
222
295
|
* the collapsed accordion items
|
|
@@ -264,14 +337,14 @@ const Accordion = class {
|
|
|
264
337
|
var _a;
|
|
265
338
|
const accordionGroupEl = (this.accordionGroupEl = (_a = this.el) === null || _a === void 0 ? void 0 : _a.closest('ion-accordion-group'));
|
|
266
339
|
if (accordionGroupEl) {
|
|
267
|
-
this.updateState(
|
|
268
|
-
addEventListener(accordionGroupEl, 'ionValueChange', this.
|
|
340
|
+
this.updateState();
|
|
341
|
+
addEventListener(accordionGroupEl, 'ionValueChange', this.accordionGroupUpdateHandler);
|
|
269
342
|
}
|
|
270
343
|
}
|
|
271
344
|
disconnectedCallback() {
|
|
272
345
|
const accordionGroupEl = this.accordionGroupEl;
|
|
273
346
|
if (accordionGroupEl) {
|
|
274
|
-
removeEventListener(accordionGroupEl, 'ionValueChange', this.
|
|
347
|
+
removeEventListener(accordionGroupEl, 'ionValueChange', this.accordionGroupUpdateHandler);
|
|
275
348
|
}
|
|
276
349
|
}
|
|
277
350
|
componentDidLoad() {
|
|
@@ -295,6 +368,11 @@ const Accordion = class {
|
|
|
295
368
|
const { accordionGroupEl, disabled, readonly, value, state } = this;
|
|
296
369
|
if (disabled || readonly)
|
|
297
370
|
return;
|
|
371
|
+
/**
|
|
372
|
+
* Mark that the user has interacted with the accordion.
|
|
373
|
+
* This enables animations for all future state changes.
|
|
374
|
+
*/
|
|
375
|
+
this.hasInteracted = true;
|
|
298
376
|
if (accordionGroupEl) {
|
|
299
377
|
/**
|
|
300
378
|
* Because the accordion group may or may
|
|
@@ -315,7 +393,7 @@ const Accordion = class {
|
|
|
315
393
|
const headerPart = expanded ? 'header expanded' : 'header';
|
|
316
394
|
const contentPart = expanded ? 'content expanded' : 'content';
|
|
317
395
|
this.setAria(expanded);
|
|
318
|
-
return (h(Host, { key: '
|
|
396
|
+
return (h(Host, { key: '9c90bce01eff7e5774a19f69c872f3761d66cf3c', class: {
|
|
319
397
|
[mode]: true,
|
|
320
398
|
'accordion-expanding': this.state === 8 /* AccordionState.Expanding */,
|
|
321
399
|
'accordion-expanded': this.state === 4 /* AccordionState.Expanded */,
|
|
@@ -326,7 +404,7 @@ const Accordion = class {
|
|
|
326
404
|
'accordion-disabled': disabled,
|
|
327
405
|
'accordion-readonly': readonly,
|
|
328
406
|
'accordion-animated': this.shouldAnimate(),
|
|
329
|
-
} }, h("div", { key: '
|
|
407
|
+
} }, h("div", { key: 'cab40d5bcf3c93fd78e70b6d3906a541e725837d', onClick: () => this.toggleExpanded(), id: "header", part: headerPart, "aria-controls": "content", ref: (headerEl) => (this.headerEl = headerEl) }, h("slot", { key: '672bc7fb3f9e18076b41e20fc9eaeab7cafcf3a2', name: "header" })), h("div", { key: 'fd777ca5b4ab04aa4f44c339d58c8cd987c52bcb', id: "content", part: contentPart, role: "region", "aria-labelledby": "header", ref: (contentEl) => (this.contentEl = contentEl) }, h("div", { key: '0aad70a71e2cd2c16b2e98fa0bdd40421d95fe16', id: "content-wrapper", ref: (contentElWrapper) => (this.contentElWrapper = contentElWrapper) }, h("slot", { key: 'd630e10ac7c56b4dbf943b523f26759b83aead55', name: "content" })))));
|
|
330
408
|
}
|
|
331
409
|
static get delegatesFocus() { return true; }
|
|
332
410
|
get el() { return getElement(this); }
|
|
@@ -12,7 +12,7 @@ import { c as createKeyboardController } from './keyboard-controller-BaaVITYt.js
|
|
|
12
12
|
import { g as getTimeGivenProgression } from './cubic-bezier-hHmYLOfE.js';
|
|
13
13
|
import { a as attachComponent, d as detachComponent } from './framework-delegate-BYawdMXj.js';
|
|
14
14
|
import { c as createLockController } from './lock-controller-B-hirT0v.js';
|
|
15
|
-
import { t as transition } from './index-
|
|
15
|
+
import { t as transition } from './index-r2D9DEro.js';
|
|
16
16
|
import './index-ZjP4CjeZ.js';
|
|
17
17
|
import './keyboard-CUw4ekVy.js';
|
|
18
18
|
import './capacitor-CFERIeaU.js';
|
|
@@ -708,6 +708,8 @@ Footer.style = {
|
|
|
708
708
|
};
|
|
709
709
|
|
|
710
710
|
const TRANSITION = 'all 0.2s ease-in-out';
|
|
711
|
+
const ROLE_NONE = 'none';
|
|
712
|
+
const ROLE_BANNER = 'banner';
|
|
711
713
|
const cloneElement = (tagName) => {
|
|
712
714
|
const getCachedEl = document.querySelector(`${tagName}.ion-cloned-element`);
|
|
713
715
|
if (getCachedEl !== null) {
|
|
@@ -834,6 +836,7 @@ const setHeaderActive = (headerIndex, active = true) => {
|
|
|
834
836
|
const toolbars = headerIndex.toolbars;
|
|
835
837
|
const ionTitles = toolbars.map((toolbar) => toolbar.ionTitleEl);
|
|
836
838
|
if (active) {
|
|
839
|
+
headerEl.setAttribute('role', ROLE_BANNER);
|
|
837
840
|
headerEl.classList.remove('header-collapse-condense-inactive');
|
|
838
841
|
ionTitles.forEach((ionTitle) => {
|
|
839
842
|
if (ionTitle) {
|
|
@@ -842,6 +845,16 @@ const setHeaderActive = (headerIndex, active = true) => {
|
|
|
842
845
|
});
|
|
843
846
|
}
|
|
844
847
|
else {
|
|
848
|
+
/**
|
|
849
|
+
* There can only be one banner landmark per page.
|
|
850
|
+
* By default, all ion-headers have the banner role.
|
|
851
|
+
* This causes an accessibility issue when using a
|
|
852
|
+
* condensed header since there are two ion-headers
|
|
853
|
+
* on the page at once (active and inactive).
|
|
854
|
+
* To solve this, the role needs to be toggled
|
|
855
|
+
* based on which header is active.
|
|
856
|
+
*/
|
|
857
|
+
headerEl.setAttribute('role', ROLE_NONE);
|
|
845
858
|
headerEl.classList.add('header-collapse-condense-inactive');
|
|
846
859
|
/**
|
|
847
860
|
* The small title should only be accessed by screen readers
|
|
@@ -901,8 +914,32 @@ const handleHeaderFade = (scrollEl, baseEl, condenseHeader) => {
|
|
|
901
914
|
});
|
|
902
915
|
});
|
|
903
916
|
};
|
|
917
|
+
/**
|
|
918
|
+
* Get the role type for the ion-header.
|
|
919
|
+
*
|
|
920
|
+
* @param isInsideMenu If ion-header is inside ion-menu.
|
|
921
|
+
* @param isCondensed If ion-header has collapse="condense".
|
|
922
|
+
* @param mode The current mode.
|
|
923
|
+
* @returns 'none' if inside ion-menu or if condensed in md
|
|
924
|
+
* mode, otherwise 'banner'.
|
|
925
|
+
*/
|
|
926
|
+
const getRoleType = (isInsideMenu, isCondensed, mode) => {
|
|
927
|
+
// If the header is inside a menu, it should not have the banner role.
|
|
928
|
+
if (isInsideMenu) {
|
|
929
|
+
return ROLE_NONE;
|
|
930
|
+
}
|
|
931
|
+
/**
|
|
932
|
+
* Only apply role="none" to `md` mode condensed headers
|
|
933
|
+
* since the large header is never shown.
|
|
934
|
+
*/
|
|
935
|
+
if (isCondensed && mode === 'md') {
|
|
936
|
+
return ROLE_NONE;
|
|
937
|
+
}
|
|
938
|
+
// Default to banner role.
|
|
939
|
+
return ROLE_BANNER;
|
|
940
|
+
};
|
|
904
941
|
|
|
905
|
-
const headerIosCss = "ion-header{display:block;position:relative;-ms-flex-order:-1;order:-1;width:100%;z-index:10}ion-header ion-toolbar:first-of-type{padding-top:var(--ion-safe-area-top, 0)}.header-ios ion-toolbar:last-of-type{--border-width:0 0 0.55px}@supports ((-webkit-backdrop-filter: blur(0)) or (backdrop-filter: blur(0))){.header-background{left:0;right:0;top:0;bottom:0;position:absolute;-webkit-backdrop-filter:saturate(180%) blur(20px);backdrop-filter:saturate(180%) blur(20px)}.header-translucent-ios ion-toolbar{--opacity:.8}.header-collapse-condense-inactive .header-background{-webkit-backdrop-filter:blur(20px);backdrop-filter:blur(20px)}}.header-ios.ion-no-border ion-toolbar:last-of-type{--border-width:0}.header-collapse-fade ion-toolbar{--opacity-scale:inherit}.header-collapse-condense{z-index:9}.header-collapse-condense ion-toolbar{position:-webkit-sticky;position:sticky;top:0}.header-collapse-condense ion-toolbar:first-of-type{padding-top:0px;z-index:1}.header-collapse-condense ion-toolbar{
|
|
942
|
+
const headerIosCss = "ion-header{display:block;position:relative;-ms-flex-order:-1;order:-1;width:100%;z-index:10}ion-header ion-toolbar:first-of-type{padding-top:var(--ion-safe-area-top, 0)}.header-ios ion-toolbar:last-of-type{--border-width:0 0 0.55px}@supports ((-webkit-backdrop-filter: blur(0)) or (backdrop-filter: blur(0))){.header-background{left:0;right:0;top:0;bottom:0;position:absolute;-webkit-backdrop-filter:saturate(180%) blur(20px);backdrop-filter:saturate(180%) blur(20px)}.header-translucent-ios ion-toolbar{--opacity:.8}.header-collapse-condense-inactive .header-background{-webkit-backdrop-filter:blur(20px);backdrop-filter:blur(20px)}}.header-ios.ion-no-border ion-toolbar:last-of-type{--border-width:0}.header-collapse-fade ion-toolbar{--opacity-scale:inherit}.header-collapse-fade.header-transitioning ion-toolbar{--background:transparent;--border-style:none}.header-collapse-condense{z-index:9}.header-collapse-condense ion-toolbar{position:-webkit-sticky;position:sticky;top:0}.header-collapse-condense ion-toolbar:first-of-type{padding-top:0px;z-index:1}.header-collapse-condense ion-toolbar{z-index:0}.header-collapse-condense ion-toolbar:last-of-type{--border-width:0px}.header-collapse-condense ion-toolbar ion-searchbar{padding-top:0px;padding-bottom:13px}.header-collapse-main{--opacity-scale:1}.header-collapse-main ion-toolbar{--opacity-scale:inherit}.header-collapse-main ion-toolbar.in-toolbar ion-title,.header-collapse-main ion-toolbar.in-toolbar ion-buttons{-webkit-transition:all 0.2s ease-in-out;transition:all 0.2s ease-in-out}.header-collapse-condense ion-toolbar,.header-collapse-condense-inactive.header-transitioning:not(.header-collapse-condense) ion-toolbar{--background:var(--ion-background-color, #fff)}.header-collapse-condense-inactive.header-transitioning:not(.header-collapse-condense) ion-toolbar{--border-style:none;--opacity-scale:1}.header-collapse-condense-inactive:not(.header-collapse-condense) ion-toolbar.in-toolbar ion-title,.header-collapse-condense-inactive:not(.header-collapse-condense) ion-toolbar.in-toolbar ion-buttons.buttons-collapse{opacity:0;pointer-events:none}.header-collapse-condense-inactive.header-collapse-condense ion-toolbar.in-toolbar ion-title,.header-collapse-condense-inactive.header-collapse-condense ion-toolbar.in-toolbar ion-buttons.buttons-collapse{visibility:hidden}ion-header.header-ios:not(.header-collapse-main):has(~ion-content ion-header.header-ios[collapse=condense],~ion-content ion-header.header-ios.header-collapse-condense){opacity:0}";
|
|
906
943
|
|
|
907
944
|
const headerMdCss = "ion-header{display:block;position:relative;-ms-flex-order:-1;order:-1;width:100%;z-index:10}ion-header ion-toolbar:first-of-type{padding-top:var(--ion-safe-area-top, 0)}.header-md{-webkit-box-shadow:0 2px 4px -1px rgba(0, 0, 0, 0.2), 0 4px 5px 0 rgba(0, 0, 0, 0.14), 0 1px 10px 0 rgba(0, 0, 0, 0.12);box-shadow:0 2px 4px -1px rgba(0, 0, 0, 0.2), 0 4px 5px 0 rgba(0, 0, 0, 0.14), 0 1px 10px 0 rgba(0, 0, 0, 0.12)}.header-collapse-condense{display:none}.header-md.ion-no-border{-webkit-box-shadow:none;box-shadow:none}";
|
|
908
945
|
|
|
@@ -1042,16 +1079,17 @@ const Header = class {
|
|
|
1042
1079
|
const { translucent, inheritedAttributes } = this;
|
|
1043
1080
|
const mode = getIonMode(this);
|
|
1044
1081
|
const collapse = this.collapse || 'none';
|
|
1082
|
+
const isCondensed = collapse === 'condense';
|
|
1045
1083
|
// banner role must be at top level, so remove role if inside a menu
|
|
1046
|
-
const roleType = hostContext('ion-menu', this.el)
|
|
1047
|
-
return (h(Host, Object.assign({ key: '
|
|
1084
|
+
const roleType = getRoleType(hostContext('ion-menu', this.el), isCondensed, mode);
|
|
1085
|
+
return (h(Host, Object.assign({ key: '863c4568cd7b8c0ec55109f193bbbaed68a1346e', role: roleType, class: {
|
|
1048
1086
|
[mode]: true,
|
|
1049
1087
|
// Used internally for styling
|
|
1050
1088
|
[`header-${mode}`]: true,
|
|
1051
1089
|
[`header-translucent`]: this.translucent,
|
|
1052
1090
|
[`header-collapse-${collapse}`]: true,
|
|
1053
1091
|
[`header-translucent-${mode}`]: this.translucent,
|
|
1054
|
-
} }, inheritedAttributes), mode === 'ios' && translucent && h("div", { key: '
|
|
1092
|
+
} }, inheritedAttributes), mode === 'ios' && translucent && h("div", { key: '25c3bdce328b0b35607d154c8b8374679313d881', class: "header-background" }), h("slot", { key: 'b44fab0a9be7920b9650da26117c783e751e1702' })));
|
|
1055
1093
|
}
|
|
1056
1094
|
get el() { return getElement(this); }
|
|
1057
1095
|
};
|
|
@@ -213,11 +213,7 @@ const Button = class {
|
|
|
213
213
|
target,
|
|
214
214
|
};
|
|
215
215
|
let fill = this.fill;
|
|
216
|
-
|
|
217
|
-
* We check both undefined and null to
|
|
218
|
-
* work around https://github.com/ionic-team/stencil/issues/3586.
|
|
219
|
-
*/
|
|
220
|
-
if (fill == null) {
|
|
216
|
+
if (fill === undefined) {
|
|
221
217
|
fill = this.inToolbar || this.inListHeader ? 'clear' : 'solid';
|
|
222
218
|
}
|
|
223
219
|
/**
|
|
@@ -230,7 +226,7 @@ const Button = class {
|
|
|
230
226
|
{
|
|
231
227
|
type !== 'button' && this.renderHiddenButton();
|
|
232
228
|
}
|
|
233
|
-
return (h(Host, { key: '
|
|
229
|
+
return (h(Host, { key: 'ed82ea53705523f9afc5f1a9addff44cc6424f27', onClick: this.handleClick, "aria-disabled": disabled ? 'true' : null, class: createColorClasses$1(color, {
|
|
234
230
|
[mode]: true,
|
|
235
231
|
[buttonType]: true,
|
|
236
232
|
[`${buttonType}-${expand}`]: expand !== undefined,
|
|
@@ -245,7 +241,7 @@ const Button = class {
|
|
|
245
241
|
'button-disabled': disabled,
|
|
246
242
|
'ion-activatable': true,
|
|
247
243
|
'ion-focusable': true,
|
|
248
|
-
}) }, h(TagType, Object.assign({ key: '
|
|
244
|
+
}) }, h(TagType, Object.assign({ key: 'fadec13053469dd0405bbbc61b70ced568aa4826' }, attrs, { class: "button-native", part: "native", disabled: disabled, onFocus: this.onFocus, onBlur: this.onBlur }, inheritedAttributes), h("span", { key: '6bf0e5144fb1148002e88038522402b789689d2c', class: "button-inner" }, h("slot", { key: '25da0ca155cfa9e2754842c34f4fd09f576ac2d2', name: "icon-only", onSlotchange: this.slotChanged }), h("slot", { key: '51414065bb11953ec9d818f8d9353589bc9072c5', name: "start" }), h("slot", { key: 'c9b5f8842aeabd20628df2f4600f1257ea913d8d' }), h("slot", { key: '478dd3671c7be1909fc84e672f0fa8dfe6082263', name: "end" })), mode === 'md' && h("ion-ripple-effect", { key: 'e1d55f85a55144d743f58a5914cd116cb065fa8c', type: this.rippleType }))));
|
|
249
245
|
}
|
|
250
246
|
get el() { return getElement(this); }
|
|
251
247
|
static get watchers() { return {
|