voyager-ionic-core 7.5.0 → 7.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/components/ion-title.js +1 -1
- package/components/ios.transition.js +209 -41
- package/dist/cjs/{index-d93fb71d.js → index-eccba000.js} +2 -2
- package/dist/cjs/index.cjs.js +3 -3
- package/dist/cjs/ion-app_8.cjs.entry.js +2 -2
- 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/ionic.cjs.js +1 -1
- package/dist/cjs/{ios.transition-a4d545dd.js → ios.transition-5af5991e.js} +210 -42
- package/dist/cjs/{md.transition-80bb961b.js → md.transition-1e740a6a.js} +1 -1
- package/dist/collection/collection-manifest.json +1 -1
- package/dist/collection/components/title/title.ios.css +9 -0
- package/dist/collection/utils/transition/ios.transition.js +209 -41
- package/dist/docs.json +2 -2
- package/dist/esm/{index-7d2b2808.js → index-a09eac70.js} +2 -2
- package/dist/esm/index.js +3 -3
- package/dist/esm/ion-app_8.entry.js +2 -2
- 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/ionic.js +1 -1
- package/dist/esm/{ios.transition-a86d7bbe.js → ios.transition-4d1322d6.js} +210 -42
- package/dist/esm/{md.transition-365ef6b6.js → md.transition-66b425d0.js} +1 -1
- package/dist/esm-es5/index-a09eac70.js +4 -0
- package/dist/esm-es5/index.js +1 -1
- package/dist/esm-es5/ion-app_8.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/ios.transition-4d1322d6.js +4 -0
- package/dist/esm-es5/md.transition-66b425d0.js +4 -0
- package/dist/ionic/index.esm.js +1 -1
- package/dist/ionic/ionic.esm.js +1 -1
- package/dist/ionic/ionic.js +1 -1
- package/dist/ionic/p-091c8792.system.js +4 -0
- package/dist/ionic/p-2a8eeef7.system.js +4 -0
- package/dist/ionic/p-61b192a4.system.entry.js +4 -0
- package/dist/ionic/{p-15decbec.entry.js → p-7423746f.entry.js} +1 -1
- package/dist/ionic/{p-5c3e72a8.system.js → p-755b2917.system.js} +1 -1
- package/dist/ionic/{p-e42aaa8b.entry.js → p-8209372c.entry.js} +1 -1
- package/dist/ionic/{p-a7f8dc42.entry.js → p-9e106f58.entry.js} +1 -1
- package/dist/ionic/p-bb055450.system.entry.js +4 -0
- package/dist/ionic/{p-e38a5f77.js → p-c44fe9fd.js} +1 -1
- package/dist/ionic/p-c575a7b8.system.entry.js +4 -0
- package/dist/ionic/p-de68588d.js +4 -0
- package/dist/ionic/p-e028178a.system.js +4 -0
- package/dist/ionic/{p-ced41304.system.js → p-e0f0d55f.system.js} +1 -1
- package/dist/ionic/{p-f34f001c.entry.js → p-e25cb483.entry.js} +1 -1
- package/dist/ionic/p-eb7d0922.js +4 -0
- package/dist/ionic/p-eb8dc56f.system.entry.js +4 -0
- package/dist/types/components/menu/menu-interface.d.ts +15 -4
- package/dist/types/stencil-public-runtime.d.ts +19 -0
- package/dist/types/utils/menu-controller/index.d.ts +2 -21
- package/hydrate/index.js +220 -44
- package/package.json +5 -5
- package/dist/esm-es5/index-7d2b2808.js +0 -4
- package/dist/esm-es5/ios.transition-a86d7bbe.js +0 -4
- package/dist/esm-es5/md.transition-365ef6b6.js +0 -4
- package/dist/ionic/p-128a98e8.system.js +0 -4
- package/dist/ionic/p-16e44585.js +0 -4
- package/dist/ionic/p-2bbf3ac4.system.entry.js +0 -4
- package/dist/ionic/p-95817276.system.entry.js +0 -4
- package/dist/ionic/p-9b9dcc3e.system.entry.js +0 -4
- package/dist/ionic/p-b9047b05.system.js +0 -4
- package/dist/ionic/p-c05315f5.system.entry.js +0 -4
- package/dist/ionic/p-c994fff0.system.js +0 -4
- package/dist/ionic/p-e2bb634f.js +0 -4
package/components/ion-title.js
CHANGED
|
@@ -5,7 +5,7 @@ import { proxyCustomElement, HTMLElement, createEvent, h, Host } from '@stencil/
|
|
|
5
5
|
import { c as createColorClasses } from './theme.js';
|
|
6
6
|
import { b as getIonMode } from './ionic-global.js';
|
|
7
7
|
|
|
8
|
-
const titleIosCss = ":host{--color:initial;display:-ms-flexbox;display:flex;-ms-flex:1;flex:1;-ms-flex-align:center;align-items:center;-webkit-transform:translateZ(0);transform:translateZ(0);color:var(--color)}:host(.ion-color){color:var(--ion-color-base)}.toolbar-title{display:block;width:100%;text-overflow:ellipsis;white-space:nowrap;overflow:hidden;pointer-events:auto}:host(.title-small) .toolbar-title{white-space:normal}:host{top:0;-webkit-padding-start:90px;padding-inline-start:90px;-webkit-padding-end:90px;padding-inline-end:90px;padding-top:var(--padding-top);padding-bottom:var(--padding-bottom);position:absolute;width:100%;height:100%;-webkit-transform:translateZ(0);transform:translateZ(0);font-size:min(1.0625rem, 20.4px);font-weight:600;text-align:center;-webkit-box-sizing:border-box;box-sizing:border-box;pointer-events:none}@supports (inset-inline-start: 0){:host{inset-inline-start:0}}@supports not (inset-inline-start: 0){:host{left:0}:host-context([dir=rtl]){left:unset;right:unset;right:0}@supports selector(:dir(rtl)){:host:dir(rtl){left:unset;right:unset;right:0}}}:host(.title-small){-webkit-padding-start:9px;padding-inline-start:9px;-webkit-padding-end:9px;padding-inline-end:9px;padding-top:6px;padding-bottom:16px;position:relative;font-size:min(0.8125rem, 23.4px);font-weight:normal}:host(.title-large){-webkit-padding-start:12px;padding-inline-start:12px;-webkit-padding-end:12px;padding-inline-end:12px;padding-top:2px;padding-bottom:4px;-webkit-transform-origin:left center;transform-origin:left center;position:static;-ms-flex-align:end;align-items:flex-end;min-width:100%;font-size:min(2.125rem, 61.2px);font-weight:700;text-align:start}:host(.title-large.title-rtl){-webkit-transform-origin:right center;transform-origin:right center}:host(.title-large.ion-cloned-element){--color:var(--ion-text-color, #000);font-family:var(--ion-font-family)}:host(.title-large) .toolbar-title{-webkit-transform-origin:inherit;transform-origin:inherit}:host-context([dir=rtl]):host(.title-large) .toolbar-title,:host-context([dir=rtl]).title-large .toolbar-title{-webkit-transform-origin:calc(100% - inherit);transform-origin:calc(100% - inherit)}@supports selector(:dir(rtl)){:host(.title-large) .toolbar-title:dir(rtl){-webkit-transform-origin:calc(100% - inherit);transform-origin:calc(100% - inherit)}}";
|
|
8
|
+
const titleIosCss = ":host{--color:initial;display:-ms-flexbox;display:flex;-ms-flex:1;flex:1;-ms-flex-align:center;align-items:center;-webkit-transform:translateZ(0);transform:translateZ(0);color:var(--color)}:host(.ion-color){color:var(--ion-color-base)}.toolbar-title{display:block;width:100%;text-overflow:ellipsis;white-space:nowrap;overflow:hidden;pointer-events:auto}:host(.title-small) .toolbar-title{white-space:normal}:host{top:0;-webkit-padding-start:90px;padding-inline-start:90px;-webkit-padding-end:90px;padding-inline-end:90px;padding-top:var(--padding-top);padding-bottom:var(--padding-bottom);position:absolute;width:100%;height:100%;-webkit-transform:translateZ(0);transform:translateZ(0);font-size:min(1.0625rem, 20.4px);font-weight:600;text-align:center;-webkit-box-sizing:border-box;box-sizing:border-box;pointer-events:none}@supports (inset-inline-start: 0){:host{inset-inline-start:0}}@supports not (inset-inline-start: 0){:host{left:0}:host-context([dir=rtl]){left:unset;right:unset;right:0}@supports selector(:dir(rtl)){:host:dir(rtl){left:unset;right:unset;right:0}}}:host(.title-small){-webkit-padding-start:9px;padding-inline-start:9px;-webkit-padding-end:9px;padding-inline-end:9px;padding-top:6px;padding-bottom:16px;position:relative;font-size:min(0.8125rem, 23.4px);font-weight:normal}:host(.title-large){-webkit-padding-start:12px;padding-inline-start:12px;-webkit-padding-end:12px;padding-inline-end:12px;padding-top:2px;padding-bottom:4px;-webkit-transform-origin:left center;transform-origin:left center;position:static;-ms-flex-align:end;align-items:flex-end;min-width:100%;font-size:min(2.125rem, 61.2px);font-weight:700;text-align:start}:host(.title-large.title-rtl){-webkit-transform-origin:right center;transform-origin:right center}:host(.title-large.ion-cloned-element){--color:var(--ion-text-color, #000);font-family:var(--ion-font-family)}:host(.title-large) .toolbar-title{-webkit-transform-origin:inherit;transform-origin:inherit;width:auto}:host-context([dir=rtl]):host(.title-large) .toolbar-title,:host-context([dir=rtl]).title-large .toolbar-title{-webkit-transform-origin:calc(100% - inherit);transform-origin:calc(100% - inherit)}@supports selector(:dir(rtl)){:host(.title-large) .toolbar-title:dir(rtl){-webkit-transform-origin:calc(100% - inherit);transform-origin:calc(100% - inherit)}}";
|
|
9
9
|
|
|
10
10
|
const titleMdCss = ":host{--color:initial;display:-ms-flexbox;display:flex;-ms-flex:1;flex:1;-ms-flex-align:center;align-items:center;-webkit-transform:translateZ(0);transform:translateZ(0);color:var(--color)}:host(.ion-color){color:var(--ion-color-base)}.toolbar-title{display:block;width:100%;text-overflow:ellipsis;white-space:nowrap;overflow:hidden;pointer-events:auto}:host(.title-small) .toolbar-title{white-space:normal}:host{-webkit-padding-start:20px;padding-inline-start:20px;-webkit-padding-end:20px;padding-inline-end:20px;padding-top:0;padding-bottom:0;font-size:1.25rem;font-weight:500;letter-spacing:0.0125em}:host(.title-small){width:100%;height:100%;font-size:0.9375rem;font-weight:normal}";
|
|
11
11
|
|
|
@@ -55,60 +55,134 @@ const createLargeTitleTransition = (rootAnimation, rtl, backDirection, enteringE
|
|
|
55
55
|
if (shouldAnimationForward) {
|
|
56
56
|
const leavingLargeTitleBox = leavingLargeTitle.getBoundingClientRect();
|
|
57
57
|
const enteringBackButtonBox = enteringBackButton.getBoundingClientRect();
|
|
58
|
-
|
|
59
|
-
|
|
58
|
+
const enteringBackButtonTextEl = shadow(enteringBackButton).querySelector('.button-text');
|
|
59
|
+
const enteringBackButtonTextBox = enteringBackButtonTextEl.getBoundingClientRect();
|
|
60
|
+
const leavingLargeTitleTextEl = shadow(leavingLargeTitle).querySelector('.toolbar-title');
|
|
61
|
+
const leavingLargeTitleTextBox = leavingLargeTitleTextEl.getBoundingClientRect();
|
|
62
|
+
animateLargeTitle(rootAnimation, rtl, backDirection, leavingLargeTitle, leavingLargeTitleBox, leavingLargeTitleTextBox, enteringBackButtonTextEl, enteringBackButtonTextBox);
|
|
63
|
+
animateBackButton(rootAnimation, rtl, backDirection, enteringBackButton, enteringBackButtonBox, enteringBackButtonTextEl, enteringBackButtonTextBox, leavingLargeTitle, leavingLargeTitleTextBox);
|
|
60
64
|
}
|
|
61
65
|
else if (shouldAnimationBackward) {
|
|
62
66
|
const enteringLargeTitleBox = enteringLargeTitle.getBoundingClientRect();
|
|
63
67
|
const leavingBackButtonBox = leavingBackButton.getBoundingClientRect();
|
|
64
|
-
|
|
65
|
-
|
|
68
|
+
const leavingBackButtonTextEl = shadow(leavingBackButton).querySelector('.button-text');
|
|
69
|
+
const leavingBackButtonTextBox = leavingBackButtonTextEl.getBoundingClientRect();
|
|
70
|
+
const enteringLargeTitleTextEl = shadow(enteringLargeTitle).querySelector('.toolbar-title');
|
|
71
|
+
const enteringLargeTitleTextBox = enteringLargeTitleTextEl.getBoundingClientRect();
|
|
72
|
+
animateLargeTitle(rootAnimation, rtl, backDirection, enteringLargeTitle, enteringLargeTitleBox, enteringLargeTitleTextBox, leavingBackButtonTextEl, leavingBackButtonTextBox);
|
|
73
|
+
animateBackButton(rootAnimation, rtl, backDirection, leavingBackButton, leavingBackButtonBox, leavingBackButtonTextEl, leavingBackButtonTextBox, enteringLargeTitle, enteringLargeTitleTextBox);
|
|
66
74
|
}
|
|
67
75
|
return {
|
|
68
76
|
forward: shouldAnimationForward,
|
|
69
77
|
backward: shouldAnimationBackward,
|
|
70
78
|
};
|
|
71
79
|
};
|
|
72
|
-
const animateBackButton = (rootAnimation, rtl, backDirection, backButtonEl,
|
|
80
|
+
const animateBackButton = (rootAnimation, rtl, backDirection, backButtonEl, backButtonBox, backButtonTextEl, backButtonTextBox, largeTitleEl, largeTitleTextBox) => {
|
|
81
|
+
var _a, _b;
|
|
73
82
|
const BACK_BUTTON_START_OFFSET = rtl ? `calc(100% - ${backButtonBox.right + 4}px)` : `${backButtonBox.left - 4}px`;
|
|
74
|
-
const START_TEXT_TRANSLATE = rtl ? '7px' : '-7px';
|
|
75
|
-
const END_TEXT_TRANSLATE = rtl ? '-4px' : '4px';
|
|
76
|
-
const ICON_TRANSLATE = rtl ? '-4px' : '4px';
|
|
77
83
|
const TEXT_ORIGIN_X = rtl ? 'right' : 'left';
|
|
78
84
|
const ICON_ORIGIN_X = rtl ? 'left' : 'right';
|
|
85
|
+
const CONTAINER_ORIGIN_X = rtl ? 'right' : 'left';
|
|
86
|
+
/**
|
|
87
|
+
* When the title and back button texts match
|
|
88
|
+
* then they should overlap during the page transition.
|
|
89
|
+
* If the texts do not match up then the back button text scale adjusts
|
|
90
|
+
* to not perfectly match the large title text otherwise the
|
|
91
|
+
* proportions will be incorrect.
|
|
92
|
+
* When the texts match we scale both the width and height to account for
|
|
93
|
+
* font weight differences between the title and back button.
|
|
94
|
+
*/
|
|
95
|
+
const doTitleAndButtonTextsMatch = ((_a = backButtonTextEl.textContent) === null || _a === void 0 ? void 0 : _a.trim()) === ((_b = largeTitleEl.textContent) === null || _b === void 0 ? void 0 : _b.trim());
|
|
96
|
+
const WIDTH_SCALE = largeTitleTextBox.width / backButtonTextBox.width;
|
|
97
|
+
/**
|
|
98
|
+
* We subtract an offset to account for slight sizing/padding
|
|
99
|
+
* differences between the title and the back button.
|
|
100
|
+
*/
|
|
101
|
+
const HEIGHT_SCALE = (largeTitleTextBox.height - LARGE_TITLE_SIZE_OFFSET) / backButtonTextBox.height;
|
|
102
|
+
const TEXT_START_SCALE = doTitleAndButtonTextsMatch
|
|
103
|
+
? `scale(${WIDTH_SCALE}, ${HEIGHT_SCALE})`
|
|
104
|
+
: `scale(${HEIGHT_SCALE})`;
|
|
105
|
+
const TEXT_END_SCALE = 'scale(1)';
|
|
106
|
+
const backButtonIconEl = shadow(backButtonEl).querySelector('ion-icon');
|
|
107
|
+
const backButtonIconBox = backButtonIconEl.getBoundingClientRect();
|
|
108
|
+
/**
|
|
109
|
+
* We need to offset the container by the icon dimensions
|
|
110
|
+
* so that the back button text aligns with the large title
|
|
111
|
+
* text. Otherwise, the back button icon will align with the
|
|
112
|
+
* large title text but the back button text will not.
|
|
113
|
+
*/
|
|
114
|
+
const CONTAINER_START_TRANSLATE_X = rtl
|
|
115
|
+
? `${backButtonIconBox.width / 2 - (backButtonIconBox.right - backButtonBox.right)}px`
|
|
116
|
+
: `${backButtonBox.left - backButtonIconBox.width / 2}px`;
|
|
117
|
+
const CONTAINER_END_TRANSLATE_X = rtl ? `-${window.innerWidth - backButtonBox.right}px` : `${backButtonBox.left}px`;
|
|
118
|
+
/**
|
|
119
|
+
* Back button container should be
|
|
120
|
+
* aligned to the top of the title container
|
|
121
|
+
* so the texts overlap as the back button
|
|
122
|
+
* text begins to fade in.
|
|
123
|
+
*/
|
|
124
|
+
const CONTAINER_START_TRANSLATE_Y = `${largeTitleTextBox.top}px`;
|
|
125
|
+
/**
|
|
126
|
+
* The cloned back button should align exactly with the
|
|
127
|
+
* real back button on the entering page otherwise there will
|
|
128
|
+
* be a layout shift.
|
|
129
|
+
*/
|
|
130
|
+
const CONTAINER_END_TRANSLATE_Y = `${backButtonBox.top}px`;
|
|
131
|
+
/**
|
|
132
|
+
* In the forward direction, the cloned back button
|
|
133
|
+
* container should translate from over the large title
|
|
134
|
+
* to over the back button. In the backward direction,
|
|
135
|
+
* it should translate from over the back button to over
|
|
136
|
+
* the large title.
|
|
137
|
+
*/
|
|
138
|
+
const FORWARD_CONTAINER_KEYFRAMES = [
|
|
139
|
+
{ offset: 0, transform: `translate3d(${CONTAINER_START_TRANSLATE_X}, ${CONTAINER_START_TRANSLATE_Y}, 0)` },
|
|
140
|
+
{ offset: 1, transform: `translate3d(${CONTAINER_END_TRANSLATE_X}, ${CONTAINER_END_TRANSLATE_Y}, 0)` },
|
|
141
|
+
];
|
|
142
|
+
const BACKWARD_CONTAINER_KEYFRAMES = [
|
|
143
|
+
{ offset: 0, transform: `translate3d(${CONTAINER_END_TRANSLATE_X}, ${CONTAINER_END_TRANSLATE_Y}, 0)` },
|
|
144
|
+
{ offset: 1, transform: `translate3d(${CONTAINER_START_TRANSLATE_X}, ${CONTAINER_START_TRANSLATE_Y}, 0)` },
|
|
145
|
+
];
|
|
146
|
+
const CONTAINER_KEYFRAMES = backDirection ? BACKWARD_CONTAINER_KEYFRAMES : FORWARD_CONTAINER_KEYFRAMES;
|
|
147
|
+
/**
|
|
148
|
+
* In the forward direction, the text in the cloned back button
|
|
149
|
+
* should start to be (roughly) the size of the large title
|
|
150
|
+
* and then scale down to be the size of the actual back button.
|
|
151
|
+
* The text should also translate, but that translate is handled
|
|
152
|
+
* by the container keyframes.
|
|
153
|
+
*/
|
|
79
154
|
const FORWARD_TEXT_KEYFRAMES = [
|
|
80
|
-
{
|
|
81
|
-
|
|
82
|
-
opacity: 0,
|
|
83
|
-
transform: `translate3d(${START_TEXT_TRANSLATE}, ${largeTitleBox.top - 40}px, 0) scale(2.1)`,
|
|
84
|
-
},
|
|
85
|
-
{ offset: 1, opacity: 1, transform: `translate3d(${END_TEXT_TRANSLATE}, ${backButtonBox.top - 46}px, 0) scale(1)` },
|
|
155
|
+
{ offset: 0, opacity: 0, transform: TEXT_START_SCALE },
|
|
156
|
+
{ offset: 1, opacity: 1, transform: TEXT_END_SCALE },
|
|
86
157
|
];
|
|
87
158
|
const BACKWARD_TEXT_KEYFRAMES = [
|
|
88
|
-
{ offset: 0, opacity: 1, transform:
|
|
89
|
-
{ offset:
|
|
90
|
-
{
|
|
91
|
-
offset: 1,
|
|
92
|
-
opacity: 0,
|
|
93
|
-
transform: `translate3d(${START_TEXT_TRANSLATE}, ${largeTitleBox.top - 40}px, 0) scale(2.1)`,
|
|
94
|
-
},
|
|
159
|
+
{ offset: 0, opacity: 1, transform: TEXT_END_SCALE },
|
|
160
|
+
{ offset: 1, opacity: 0, transform: TEXT_START_SCALE },
|
|
95
161
|
];
|
|
96
162
|
const TEXT_KEYFRAMES = backDirection ? BACKWARD_TEXT_KEYFRAMES : FORWARD_TEXT_KEYFRAMES;
|
|
163
|
+
/**
|
|
164
|
+
* The icon should scale in/out in the second
|
|
165
|
+
* half of the animation. The icon should also
|
|
166
|
+
* translate, but that translate is handled by the
|
|
167
|
+
* container keyframes.
|
|
168
|
+
*/
|
|
97
169
|
const FORWARD_ICON_KEYFRAMES = [
|
|
98
|
-
{ offset: 0, opacity: 0, transform:
|
|
99
|
-
{ offset:
|
|
170
|
+
{ offset: 0, opacity: 0, transform: 'scale(0.6)' },
|
|
171
|
+
{ offset: 0.6, opacity: 0, transform: 'scale(0.6)' },
|
|
172
|
+
{ offset: 1, opacity: 1, transform: 'scale(1)' },
|
|
100
173
|
];
|
|
101
174
|
const BACKWARD_ICON_KEYFRAMES = [
|
|
102
|
-
{ offset: 0, opacity: 1, transform:
|
|
103
|
-
{ offset: 0.2, opacity: 0, transform:
|
|
104
|
-
{ offset: 1, opacity: 0, transform:
|
|
175
|
+
{ offset: 0, opacity: 1, transform: 'scale(1)' },
|
|
176
|
+
{ offset: 0.2, opacity: 0, transform: 'scale(0.6)' },
|
|
177
|
+
{ offset: 1, opacity: 0, transform: 'scale(0.6)' },
|
|
105
178
|
];
|
|
106
179
|
const ICON_KEYFRAMES = backDirection ? BACKWARD_ICON_KEYFRAMES : FORWARD_ICON_KEYFRAMES;
|
|
107
180
|
const enteringBackButtonTextAnimation = createAnimation();
|
|
108
181
|
const enteringBackButtonIconAnimation = createAnimation();
|
|
182
|
+
const enteringBackButtonAnimation = createAnimation();
|
|
109
183
|
const clonedBackButtonEl = getClonedElement('ion-back-button');
|
|
110
|
-
const
|
|
111
|
-
const
|
|
184
|
+
const clonedBackButtonTextEl = shadow(clonedBackButtonEl).querySelector('.button-text');
|
|
185
|
+
const clonedBackButtonIconEl = shadow(clonedBackButtonEl).querySelector('ion-icon');
|
|
112
186
|
clonedBackButtonEl.text = backButtonEl.text;
|
|
113
187
|
clonedBackButtonEl.mode = backButtonEl.mode;
|
|
114
188
|
clonedBackButtonEl.icon = backButtonEl.icon;
|
|
@@ -116,11 +190,19 @@ const animateBackButton = (rootAnimation, rtl, backDirection, backButtonEl, larg
|
|
|
116
190
|
clonedBackButtonEl.disabled = backButtonEl.disabled;
|
|
117
191
|
clonedBackButtonEl.style.setProperty('display', 'block');
|
|
118
192
|
clonedBackButtonEl.style.setProperty('position', 'fixed');
|
|
119
|
-
enteringBackButtonIconAnimation.addElement(
|
|
120
|
-
enteringBackButtonTextAnimation.addElement(
|
|
193
|
+
enteringBackButtonIconAnimation.addElement(clonedBackButtonIconEl);
|
|
194
|
+
enteringBackButtonTextAnimation.addElement(clonedBackButtonTextEl);
|
|
195
|
+
enteringBackButtonAnimation.addElement(clonedBackButtonEl);
|
|
196
|
+
enteringBackButtonAnimation
|
|
197
|
+
.beforeStyles({
|
|
198
|
+
position: 'absolute',
|
|
199
|
+
top: '0px',
|
|
200
|
+
[CONTAINER_ORIGIN_X]: '0px',
|
|
201
|
+
})
|
|
202
|
+
.keyframes(CONTAINER_KEYFRAMES);
|
|
121
203
|
enteringBackButtonTextAnimation
|
|
122
204
|
.beforeStyles({
|
|
123
|
-
'transform-origin': `${TEXT_ORIGIN_X}
|
|
205
|
+
'transform-origin': `${TEXT_ORIGIN_X} top`,
|
|
124
206
|
})
|
|
125
207
|
.beforeAddWrite(() => {
|
|
126
208
|
backButtonEl.style.setProperty('display', 'none');
|
|
@@ -137,21 +219,91 @@ const animateBackButton = (rootAnimation, rtl, backDirection, backButtonEl, larg
|
|
|
137
219
|
'transform-origin': `${ICON_ORIGIN_X} center`,
|
|
138
220
|
})
|
|
139
221
|
.keyframes(ICON_KEYFRAMES);
|
|
140
|
-
rootAnimation.addAnimation([
|
|
222
|
+
rootAnimation.addAnimation([
|
|
223
|
+
enteringBackButtonTextAnimation,
|
|
224
|
+
enteringBackButtonIconAnimation,
|
|
225
|
+
enteringBackButtonAnimation,
|
|
226
|
+
]);
|
|
141
227
|
};
|
|
142
|
-
const animateLargeTitle = (rootAnimation, rtl, backDirection, largeTitleEl, largeTitleBox,
|
|
143
|
-
|
|
144
|
-
|
|
228
|
+
const animateLargeTitle = (rootAnimation, rtl, backDirection, largeTitleEl, largeTitleBox, largeTitleTextBox, backButtonTextEl, backButtonTextBox) => {
|
|
229
|
+
var _a, _b;
|
|
230
|
+
/**
|
|
231
|
+
* The horizontal transform origin for the large title
|
|
232
|
+
*/
|
|
145
233
|
const ORIGIN_X = rtl ? 'right' : 'left';
|
|
234
|
+
const TITLE_START_OFFSET = rtl ? `calc(100% - ${largeTitleBox.right}px)` : `${largeTitleBox.left}px`;
|
|
235
|
+
/**
|
|
236
|
+
* The cloned large should align exactly with the
|
|
237
|
+
* real large title on the leaving page otherwise there will
|
|
238
|
+
* be a layout shift.
|
|
239
|
+
*/
|
|
240
|
+
const START_TRANSLATE_X = '0px';
|
|
241
|
+
const START_TRANSLATE_Y = `${largeTitleBox.top}px`;
|
|
242
|
+
/**
|
|
243
|
+
* How much to offset the large title translation by.
|
|
244
|
+
* This accounts for differences in sizing between the large
|
|
245
|
+
* title and the back button due to padding and font weight.
|
|
246
|
+
*/
|
|
247
|
+
const LARGE_TITLE_TRANSLATION_OFFSET = 8;
|
|
248
|
+
/**
|
|
249
|
+
* The scaled title should (roughly) overlap the back button.
|
|
250
|
+
* This ensures that the back button and title overlap during
|
|
251
|
+
* the animation. Note that since both elements either fade in
|
|
252
|
+
* or fade out over the course of the animation, neither element
|
|
253
|
+
* will be fully visible on top of the other. As a result, the overlap
|
|
254
|
+
* does not need to be perfect, so approximate values are acceptable here.
|
|
255
|
+
*/
|
|
256
|
+
const END_TRANSLATE_X = rtl
|
|
257
|
+
? `-${window.innerWidth - backButtonTextBox.right - LARGE_TITLE_TRANSLATION_OFFSET}px`
|
|
258
|
+
: `${backButtonTextBox.x - LARGE_TITLE_TRANSLATION_OFFSET}px`;
|
|
259
|
+
/**
|
|
260
|
+
* The top of the scaled large title
|
|
261
|
+
* should match with the top of the
|
|
262
|
+
* back button text element.
|
|
263
|
+
* We subtract 2px to account for the top padding
|
|
264
|
+
* on the large title element.
|
|
265
|
+
*/
|
|
266
|
+
const LARGE_TITLE_TOP_PADDING = 2;
|
|
267
|
+
const END_TRANSLATE_Y = `${backButtonTextBox.y - LARGE_TITLE_TOP_PADDING}px`;
|
|
268
|
+
/**
|
|
269
|
+
* In the forward direction, the large title should start at its
|
|
270
|
+
* normal size and then scale down to be (roughly) the size of the
|
|
271
|
+
* back button on the other view. In the backward direction, the
|
|
272
|
+
* large title should start at (roughly) the size of the back button
|
|
273
|
+
* and then scale up to its original size.
|
|
274
|
+
*
|
|
275
|
+
* Note that since both elements either fade in
|
|
276
|
+
* or fade out over the course of the animation, neither element
|
|
277
|
+
* will be fully visible on top of the other. As a result, the overlap
|
|
278
|
+
* does not need to be perfect, so approximate values are acceptable here.
|
|
279
|
+
*/
|
|
280
|
+
/**
|
|
281
|
+
* When the title and back button texts match
|
|
282
|
+
* then they should overlap during the page transition.
|
|
283
|
+
* If the texts do not match up then the large title text scale adjusts
|
|
284
|
+
* to not perfectly match the back button text otherwise the
|
|
285
|
+
* proportions will be incorrect.
|
|
286
|
+
* When the texts match we scale both the width and height to account for
|
|
287
|
+
* font weight differences between the title and back button.
|
|
288
|
+
*/
|
|
289
|
+
const doTitleAndButtonTextsMatch = ((_a = backButtonTextEl.textContent) === null || _a === void 0 ? void 0 : _a.trim()) === ((_b = largeTitleEl.textContent) === null || _b === void 0 ? void 0 : _b.trim());
|
|
290
|
+
const WIDTH_SCALE = backButtonTextBox.width / largeTitleTextBox.width;
|
|
291
|
+
const HEIGHT_SCALE = backButtonTextBox.height / (largeTitleTextBox.height - LARGE_TITLE_SIZE_OFFSET);
|
|
292
|
+
const START_SCALE = 'scale(1)';
|
|
293
|
+
const END_SCALE = doTitleAndButtonTextsMatch ? `scale(${WIDTH_SCALE}, ${HEIGHT_SCALE})` : `scale(${HEIGHT_SCALE})`;
|
|
146
294
|
const BACKWARDS_KEYFRAMES = [
|
|
147
|
-
{ offset: 0, opacity: 0, transform: `translate3d(${
|
|
295
|
+
{ offset: 0, opacity: 0, transform: `translate3d(${END_TRANSLATE_X}, ${END_TRANSLATE_Y}, 0) ${END_SCALE}` },
|
|
148
296
|
{ offset: 0.1, opacity: 0 },
|
|
149
|
-
{ offset: 1, opacity: 1, transform: `translate3d(
|
|
297
|
+
{ offset: 1, opacity: 1, transform: `translate3d(${START_TRANSLATE_X}, ${START_TRANSLATE_Y}, 0) ${START_SCALE}` },
|
|
150
298
|
];
|
|
151
299
|
const FORWARDS_KEYFRAMES = [
|
|
152
|
-
{
|
|
300
|
+
{
|
|
301
|
+
offset: 0,
|
|
302
|
+
opacity: 0.99,
|
|
303
|
+
transform: `translate3d(${START_TRANSLATE_X}, ${START_TRANSLATE_Y}, 0) ${START_SCALE}`,
|
|
304
|
+
},
|
|
153
305
|
{ offset: 0.6, opacity: 0 },
|
|
154
|
-
{ offset: 1, opacity: 0, transform: `translate3d(${
|
|
306
|
+
{ offset: 1, opacity: 0, transform: `translate3d(${END_TRANSLATE_X}, ${END_TRANSLATE_Y}, 0) ${END_SCALE}` },
|
|
155
307
|
];
|
|
156
308
|
const KEYFRAMES = backDirection ? BACKWARDS_KEYFRAMES : FORWARDS_KEYFRAMES;
|
|
157
309
|
const clonedTitleEl = getClonedElement('ion-title');
|
|
@@ -162,8 +314,14 @@ const animateLargeTitle = (rootAnimation, rtl, backDirection, largeTitleEl, larg
|
|
|
162
314
|
clonedLargeTitleAnimation.addElement(clonedTitleEl);
|
|
163
315
|
clonedLargeTitleAnimation
|
|
164
316
|
.beforeStyles({
|
|
165
|
-
'transform-origin': `${ORIGIN_X}
|
|
166
|
-
|
|
317
|
+
'transform-origin': `${ORIGIN_X} top`,
|
|
318
|
+
/**
|
|
319
|
+
* Since font size changes will cause
|
|
320
|
+
* the dimension of the large title to change
|
|
321
|
+
* we need to set the cloned title height
|
|
322
|
+
* equal to that of the original large title height.
|
|
323
|
+
*/
|
|
324
|
+
height: `${largeTitleBox.height}px`,
|
|
167
325
|
display: '',
|
|
168
326
|
position: 'relative',
|
|
169
327
|
[ORIGIN_X]: TITLE_START_OFFSET,
|
|
@@ -476,5 +634,15 @@ const iosTransitionAnimation = (navEl, opts) => {
|
|
|
476
634
|
throw err;
|
|
477
635
|
}
|
|
478
636
|
};
|
|
637
|
+
/**
|
|
638
|
+
* The scale of the back button during the animation
|
|
639
|
+
* is computed based on the scale of the large title
|
|
640
|
+
* and vice versa. However, we need to account for slight
|
|
641
|
+
* variations in the size of the large title due to
|
|
642
|
+
* padding and font weight. This value should be used to subtract
|
|
643
|
+
* a small amount from the large title height when computing scales
|
|
644
|
+
* to get more accurate scale results.
|
|
645
|
+
*/
|
|
646
|
+
const LARGE_TITLE_SIZE_OFFSET = 10;
|
|
479
647
|
|
|
480
648
|
export { iosTransitionAnimation, shadow };
|
|
@@ -12,8 +12,8 @@ const LIFECYCLE_WILL_LEAVE = 'ionViewWillLeave';
|
|
|
12
12
|
const LIFECYCLE_DID_LEAVE = 'ionViewDidLeave';
|
|
13
13
|
const LIFECYCLE_WILL_UNLOAD = 'ionViewWillUnload';
|
|
14
14
|
|
|
15
|
-
const iosTransitionAnimation = () => Promise.resolve().then(function () { return require('./ios.transition-
|
|
16
|
-
const mdTransitionAnimation = () => Promise.resolve().then(function () { return require('./md.transition-
|
|
15
|
+
const iosTransitionAnimation = () => Promise.resolve().then(function () { return require('./ios.transition-5af5991e.js'); });
|
|
16
|
+
const mdTransitionAnimation = () => Promise.resolve().then(function () { return require('./md.transition-1e740a6a.js'); });
|
|
17
17
|
// TODO(FW-2832): types
|
|
18
18
|
const transition = (opts) => {
|
|
19
19
|
return new Promise((resolve, reject) => {
|
package/dist/cjs/index.cjs.js
CHANGED
|
@@ -6,9 +6,9 @@
|
|
|
6
6
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
7
7
|
|
|
8
8
|
const animation = require('./animation-c8bdd3c7.js');
|
|
9
|
-
const index = require('./index-
|
|
10
|
-
const ios_transition = require('./ios.transition-
|
|
11
|
-
const md_transition = require('./md.transition-
|
|
9
|
+
const index = require('./index-eccba000.js');
|
|
10
|
+
const ios_transition = require('./ios.transition-5af5991e.js');
|
|
11
|
+
const md_transition = require('./md.transition-1e740a6a.js');
|
|
12
12
|
const cubicBezier = require('./cubic-bezier-6b9222ad.js');
|
|
13
13
|
const index$1 = require('./index-0ee995e4.js');
|
|
14
14
|
const ionicGlobal = require('./ionic-global-fb752503.js');
|
|
@@ -15,7 +15,7 @@ const keyboardController = require('./keyboard-controller-50beb83a.js');
|
|
|
15
15
|
const cubicBezier = require('./cubic-bezier-6b9222ad.js');
|
|
16
16
|
const frameworkDelegate = require('./framework-delegate-c0873a6f.js');
|
|
17
17
|
const lockController = require('./lock-controller-4ae2eb59.js');
|
|
18
|
-
const index$2 = require('./index-
|
|
18
|
+
const index$2 = require('./index-eccba000.js');
|
|
19
19
|
require('./index-cc7dfb7c.js');
|
|
20
20
|
require('./index-306a7476.js');
|
|
21
21
|
require('./keyboard-fd7db491.js');
|
|
@@ -1170,7 +1170,7 @@ const RouterOutlet = class {
|
|
|
1170
1170
|
};
|
|
1171
1171
|
RouterOutlet.style = routerOutletCss;
|
|
1172
1172
|
|
|
1173
|
-
const titleIosCss = ":host{--color:initial;display:-ms-flexbox;display:flex;-ms-flex:1;flex:1;-ms-flex-align:center;align-items:center;-webkit-transform:translateZ(0);transform:translateZ(0);color:var(--color)}:host(.ion-color){color:var(--ion-color-base)}.toolbar-title{display:block;width:100%;text-overflow:ellipsis;white-space:nowrap;overflow:hidden;pointer-events:auto}:host(.title-small) .toolbar-title{white-space:normal}:host{top:0;-webkit-padding-start:90px;padding-inline-start:90px;-webkit-padding-end:90px;padding-inline-end:90px;padding-top:var(--padding-top);padding-bottom:var(--padding-bottom);position:absolute;width:100%;height:100%;-webkit-transform:translateZ(0);transform:translateZ(0);font-size:min(1.0625rem, 20.4px);font-weight:600;text-align:center;-webkit-box-sizing:border-box;box-sizing:border-box;pointer-events:none}@supports (inset-inline-start: 0){:host{inset-inline-start:0}}@supports not (inset-inline-start: 0){:host{left:0}:host-context([dir=rtl]){left:unset;right:unset;right:0}@supports selector(:dir(rtl)){:host:dir(rtl){left:unset;right:unset;right:0}}}:host(.title-small){-webkit-padding-start:9px;padding-inline-start:9px;-webkit-padding-end:9px;padding-inline-end:9px;padding-top:6px;padding-bottom:16px;position:relative;font-size:min(0.8125rem, 23.4px);font-weight:normal}:host(.title-large){-webkit-padding-start:12px;padding-inline-start:12px;-webkit-padding-end:12px;padding-inline-end:12px;padding-top:2px;padding-bottom:4px;-webkit-transform-origin:left center;transform-origin:left center;position:static;-ms-flex-align:end;align-items:flex-end;min-width:100%;font-size:min(2.125rem, 61.2px);font-weight:700;text-align:start}:host(.title-large.title-rtl){-webkit-transform-origin:right center;transform-origin:right center}:host(.title-large.ion-cloned-element){--color:var(--ion-text-color, #000);font-family:var(--ion-font-family)}:host(.title-large) .toolbar-title{-webkit-transform-origin:inherit;transform-origin:inherit}:host-context([dir=rtl]):host(.title-large) .toolbar-title,:host-context([dir=rtl]).title-large .toolbar-title{-webkit-transform-origin:calc(100% - inherit);transform-origin:calc(100% - inherit)}@supports selector(:dir(rtl)){:host(.title-large) .toolbar-title:dir(rtl){-webkit-transform-origin:calc(100% - inherit);transform-origin:calc(100% - inherit)}}";
|
|
1173
|
+
const titleIosCss = ":host{--color:initial;display:-ms-flexbox;display:flex;-ms-flex:1;flex:1;-ms-flex-align:center;align-items:center;-webkit-transform:translateZ(0);transform:translateZ(0);color:var(--color)}:host(.ion-color){color:var(--ion-color-base)}.toolbar-title{display:block;width:100%;text-overflow:ellipsis;white-space:nowrap;overflow:hidden;pointer-events:auto}:host(.title-small) .toolbar-title{white-space:normal}:host{top:0;-webkit-padding-start:90px;padding-inline-start:90px;-webkit-padding-end:90px;padding-inline-end:90px;padding-top:var(--padding-top);padding-bottom:var(--padding-bottom);position:absolute;width:100%;height:100%;-webkit-transform:translateZ(0);transform:translateZ(0);font-size:min(1.0625rem, 20.4px);font-weight:600;text-align:center;-webkit-box-sizing:border-box;box-sizing:border-box;pointer-events:none}@supports (inset-inline-start: 0){:host{inset-inline-start:0}}@supports not (inset-inline-start: 0){:host{left:0}:host-context([dir=rtl]){left:unset;right:unset;right:0}@supports selector(:dir(rtl)){:host:dir(rtl){left:unset;right:unset;right:0}}}:host(.title-small){-webkit-padding-start:9px;padding-inline-start:9px;-webkit-padding-end:9px;padding-inline-end:9px;padding-top:6px;padding-bottom:16px;position:relative;font-size:min(0.8125rem, 23.4px);font-weight:normal}:host(.title-large){-webkit-padding-start:12px;padding-inline-start:12px;-webkit-padding-end:12px;padding-inline-end:12px;padding-top:2px;padding-bottom:4px;-webkit-transform-origin:left center;transform-origin:left center;position:static;-ms-flex-align:end;align-items:flex-end;min-width:100%;font-size:min(2.125rem, 61.2px);font-weight:700;text-align:start}:host(.title-large.title-rtl){-webkit-transform-origin:right center;transform-origin:right center}:host(.title-large.ion-cloned-element){--color:var(--ion-text-color, #000);font-family:var(--ion-font-family)}:host(.title-large) .toolbar-title{-webkit-transform-origin:inherit;transform-origin:inherit;width:auto}:host-context([dir=rtl]):host(.title-large) .toolbar-title,:host-context([dir=rtl]).title-large .toolbar-title{-webkit-transform-origin:calc(100% - inherit);transform-origin:calc(100% - inherit)}@supports selector(:dir(rtl)){:host(.title-large) .toolbar-title:dir(rtl){-webkit-transform-origin:calc(100% - inherit);transform-origin:calc(100% - inherit)}}";
|
|
1174
1174
|
|
|
1175
1175
|
const titleMdCss = ":host{--color:initial;display:-ms-flexbox;display:flex;-ms-flex:1;flex:1;-ms-flex-align:center;align-items:center;-webkit-transform:translateZ(0);transform:translateZ(0);color:var(--color)}:host(.ion-color){color:var(--ion-color-base)}.toolbar-title{display:block;width:100%;text-overflow:ellipsis;white-space:nowrap;overflow:hidden;pointer-events:auto}:host(.title-small) .toolbar-title{white-space:normal}:host{-webkit-padding-start:20px;padding-inline-start:20px;-webkit-padding-end:20px;padding-inline-end:20px;padding-top:0;padding-bottom:0;font-size:1.25rem;font-weight:500;letter-spacing:0.0125em}:host(.title-small){width:100%;height:100%;font-size:0.9375rem;font-weight:normal}";
|
|
1176
1176
|
|
|
@@ -14,7 +14,7 @@ const index$4 = require('./index-cc7dfb7c.js');
|
|
|
14
14
|
const capacitor = require('./capacitor-2ffba62a.js');
|
|
15
15
|
const overlays = require('./overlays-1a734051.js');
|
|
16
16
|
const theme = require('./theme-fbc56b3b.js');
|
|
17
|
-
const index$5 = require('./index-
|
|
17
|
+
const index$5 = require('./index-eccba000.js');
|
|
18
18
|
const ionicGlobal = require('./ionic-global-fb752503.js');
|
|
19
19
|
const keyboard = require('./keyboard-38f2bb7b.js');
|
|
20
20
|
const animation = require('./animation-c8bdd3c7.js');
|
|
@@ -8,7 +8,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
8
8
|
const index = require('./index-305a23dc.js');
|
|
9
9
|
const cubicBezier = require('./cubic-bezier-6b9222ad.js');
|
|
10
10
|
const helpers = require('./helpers-ea4ccbcb.js');
|
|
11
|
-
const index$1 = require('./index-
|
|
11
|
+
const index$1 = require('./index-eccba000.js');
|
|
12
12
|
const ionicGlobal = require('./ionic-global-fb752503.js');
|
|
13
13
|
const frameworkDelegate = require('./framework-delegate-c0873a6f.js');
|
|
14
14
|
|
|
@@ -13,7 +13,7 @@ const index$1 = require('./index-cc7dfb7c.js');
|
|
|
13
13
|
const overlays = require('./overlays-1a734051.js');
|
|
14
14
|
const ionicGlobal = require('./ionic-global-fb752503.js');
|
|
15
15
|
const theme = require('./theme-fbc56b3b.js');
|
|
16
|
-
const index$2 = require('./index-
|
|
16
|
+
const index$2 = require('./index-eccba000.js');
|
|
17
17
|
const animation = require('./animation-c8bdd3c7.js');
|
|
18
18
|
require('./index-306a7476.js');
|
|
19
19
|
require('./hardware-back-button-b67c8e75.js');
|
package/dist/cjs/ionic.cjs.js
CHANGED
|
@@ -10,7 +10,7 @@ const appGlobals = require('./app-globals-fe1ad535.js');
|
|
|
10
10
|
require('./ionic-global-fb752503.js');
|
|
11
11
|
|
|
12
12
|
/*
|
|
13
|
-
Stencil Client Patch Browser v4.
|
|
13
|
+
Stencil Client Patch Browser v4.5.0 | MIT Licensed | https://stenciljs.com
|
|
14
14
|
*/
|
|
15
15
|
const patchBrowser = () => {
|
|
16
16
|
const importMeta = (typeof document === 'undefined' ? new (require('u' + 'rl').URL)('file:' + __filename).href : (document.currentScript && document.currentScript.src || new URL('ionic.cjs.js', document.baseURI).href));
|