@ionic/core 7.5.1-dev.11697212309.1448948d → 7.5.1-dev.11697219113.17f86185
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-7d2b2808.js → index-a09eac70.js} +1 -1
- 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-365ef6b6.js → md.transition-66b425d0.js} +1 -1
- 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-c994fff0.system.js → p-091c8792.system.js} +1 -1
- package/dist/ionic/{p-22923e47.entry.js → p-0f217f27.entry.js} +1 -1
- package/dist/ionic/{p-b08e4088.system.entry.js → p-1d8d5f9a.system.entry.js} +1 -1
- package/dist/ionic/{p-fcdc853a.system.entry.js → p-2592264d.system.entry.js} +1 -1
- package/dist/ionic/p-2a8eeef7.system.js +4 -0
- package/dist/ionic/{p-5c3e72a8.system.js → p-530b98d8.system.js} +1 -1
- package/dist/ionic/{p-9b9dcc3e.system.entry.js → p-61ca6685.system.entry.js} +1 -1
- package/dist/ionic/{p-4cba3f05.entry.js → p-7eaa585f.entry.js} +1 -1
- package/dist/ionic/{p-e42aaa8b.entry.js → p-8209372c.entry.js} +1 -1
- package/dist/ionic/{p-c05315f5.system.entry.js → p-b2fb0dda.system.entry.js} +1 -1
- package/dist/ionic/{p-e38a5f77.js → p-c44fe9fd.js} +1 -1
- package/dist/ionic/p-de68588d.js +4 -0
- package/dist/ionic/{p-128a98e8.system.js → p-e028178a.system.js} +1 -1
- 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/hydrate/index.js +212 -44
- package/package.json +3 -3
- package/dist/esm-es5/ios.transition-a86d7bbe.js +0 -4
- package/dist/ionic/p-16e44585.js +0 -4
- package/dist/ionic/p-b9047b05.system.js +0 -4
- package/dist/ionic/p-e2bb634f.js +0 -4
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* (C) Ionic http://ionicframework.com - MIT License
|
|
3
3
|
*/
|
|
4
4
|
import { c as createAnimation } from './animation-92066c62.js';
|
|
5
|
-
import { g as getIonPageElement } from './index-
|
|
5
|
+
import { g as getIonPageElement } from './index-a09eac70.js';
|
|
6
6
|
import './index-7a14ecec.js';
|
|
7
7
|
import './helpers-3379ba19.js';
|
|
8
8
|
import './index-b49b173c.js';
|
|
@@ -58,60 +58,134 @@ const createLargeTitleTransition = (rootAnimation, rtl, backDirection, enteringE
|
|
|
58
58
|
if (shouldAnimationForward) {
|
|
59
59
|
const leavingLargeTitleBox = leavingLargeTitle.getBoundingClientRect();
|
|
60
60
|
const enteringBackButtonBox = enteringBackButton.getBoundingClientRect();
|
|
61
|
-
|
|
62
|
-
|
|
61
|
+
const enteringBackButtonTextEl = shadow(enteringBackButton).querySelector('.button-text');
|
|
62
|
+
const enteringBackButtonTextBox = enteringBackButtonTextEl.getBoundingClientRect();
|
|
63
|
+
const leavingLargeTitleTextEl = shadow(leavingLargeTitle).querySelector('.toolbar-title');
|
|
64
|
+
const leavingLargeTitleTextBox = leavingLargeTitleTextEl.getBoundingClientRect();
|
|
65
|
+
animateLargeTitle(rootAnimation, rtl, backDirection, leavingLargeTitle, leavingLargeTitleBox, leavingLargeTitleTextBox, enteringBackButtonTextEl, enteringBackButtonTextBox);
|
|
66
|
+
animateBackButton(rootAnimation, rtl, backDirection, enteringBackButton, enteringBackButtonBox, enteringBackButtonTextEl, enteringBackButtonTextBox, leavingLargeTitle, leavingLargeTitleTextBox);
|
|
63
67
|
}
|
|
64
68
|
else if (shouldAnimationBackward) {
|
|
65
69
|
const enteringLargeTitleBox = enteringLargeTitle.getBoundingClientRect();
|
|
66
70
|
const leavingBackButtonBox = leavingBackButton.getBoundingClientRect();
|
|
67
|
-
|
|
68
|
-
|
|
71
|
+
const leavingBackButtonTextEl = shadow(leavingBackButton).querySelector('.button-text');
|
|
72
|
+
const leavingBackButtonTextBox = leavingBackButtonTextEl.getBoundingClientRect();
|
|
73
|
+
const enteringLargeTitleTextEl = shadow(enteringLargeTitle).querySelector('.toolbar-title');
|
|
74
|
+
const enteringLargeTitleTextBox = enteringLargeTitleTextEl.getBoundingClientRect();
|
|
75
|
+
animateLargeTitle(rootAnimation, rtl, backDirection, enteringLargeTitle, enteringLargeTitleBox, enteringLargeTitleTextBox, leavingBackButtonTextEl, leavingBackButtonTextBox);
|
|
76
|
+
animateBackButton(rootAnimation, rtl, backDirection, leavingBackButton, leavingBackButtonBox, leavingBackButtonTextEl, leavingBackButtonTextBox, enteringLargeTitle, enteringLargeTitleTextBox);
|
|
69
77
|
}
|
|
70
78
|
return {
|
|
71
79
|
forward: shouldAnimationForward,
|
|
72
80
|
backward: shouldAnimationBackward,
|
|
73
81
|
};
|
|
74
82
|
};
|
|
75
|
-
const animateBackButton = (rootAnimation, rtl, backDirection, backButtonEl,
|
|
83
|
+
const animateBackButton = (rootAnimation, rtl, backDirection, backButtonEl, backButtonBox, backButtonTextEl, backButtonTextBox, largeTitleEl, largeTitleTextBox) => {
|
|
84
|
+
var _a, _b;
|
|
76
85
|
const BACK_BUTTON_START_OFFSET = rtl ? `calc(100% - ${backButtonBox.right + 4}px)` : `${backButtonBox.left - 4}px`;
|
|
77
|
-
const START_TEXT_TRANSLATE = rtl ? '7px' : '-7px';
|
|
78
|
-
const END_TEXT_TRANSLATE = rtl ? '-4px' : '4px';
|
|
79
|
-
const ICON_TRANSLATE = rtl ? '-4px' : '4px';
|
|
80
86
|
const TEXT_ORIGIN_X = rtl ? 'right' : 'left';
|
|
81
87
|
const ICON_ORIGIN_X = rtl ? 'left' : 'right';
|
|
88
|
+
const CONTAINER_ORIGIN_X = rtl ? 'right' : 'left';
|
|
89
|
+
/**
|
|
90
|
+
* When the title and back button texts match
|
|
91
|
+
* then they should overlap during the page transition.
|
|
92
|
+
* If the texts do not match up then the back button text scale adjusts
|
|
93
|
+
* to not perfectly match the large title text otherwise the
|
|
94
|
+
* proportions will be incorrect.
|
|
95
|
+
* When the texts match we scale both the width and height to account for
|
|
96
|
+
* font weight differences between the title and back button.
|
|
97
|
+
*/
|
|
98
|
+
const doTitleAndButtonTextsMatch = ((_a = backButtonTextEl.textContent) === null || _a === void 0 ? void 0 : _a.trim()) === ((_b = largeTitleEl.textContent) === null || _b === void 0 ? void 0 : _b.trim());
|
|
99
|
+
const WIDTH_SCALE = largeTitleTextBox.width / backButtonTextBox.width;
|
|
100
|
+
/**
|
|
101
|
+
* We subtract an offset to account for slight sizing/padding
|
|
102
|
+
* differences between the title and the back button.
|
|
103
|
+
*/
|
|
104
|
+
const HEIGHT_SCALE = (largeTitleTextBox.height - LARGE_TITLE_SIZE_OFFSET) / backButtonTextBox.height;
|
|
105
|
+
const TEXT_START_SCALE = doTitleAndButtonTextsMatch
|
|
106
|
+
? `scale(${WIDTH_SCALE}, ${HEIGHT_SCALE})`
|
|
107
|
+
: `scale(${HEIGHT_SCALE})`;
|
|
108
|
+
const TEXT_END_SCALE = 'scale(1)';
|
|
109
|
+
const backButtonIconEl = shadow(backButtonEl).querySelector('ion-icon');
|
|
110
|
+
const backButtonIconBox = backButtonIconEl.getBoundingClientRect();
|
|
111
|
+
/**
|
|
112
|
+
* We need to offset the container by the icon dimensions
|
|
113
|
+
* so that the back button text aligns with the large title
|
|
114
|
+
* text. Otherwise, the back button icon will align with the
|
|
115
|
+
* large title text but the back button text will not.
|
|
116
|
+
*/
|
|
117
|
+
const CONTAINER_START_TRANSLATE_X = rtl
|
|
118
|
+
? `${backButtonIconBox.width / 2 - (backButtonIconBox.right - backButtonBox.right)}px`
|
|
119
|
+
: `${backButtonBox.left - backButtonIconBox.width / 2}px`;
|
|
120
|
+
const CONTAINER_END_TRANSLATE_X = rtl ? `-${window.innerWidth - backButtonBox.right}px` : `${backButtonBox.left}px`;
|
|
121
|
+
/**
|
|
122
|
+
* Back button container should be
|
|
123
|
+
* aligned to the top of the title container
|
|
124
|
+
* so the texts overlap as the back button
|
|
125
|
+
* text begins to fade in.
|
|
126
|
+
*/
|
|
127
|
+
const CONTAINER_START_TRANSLATE_Y = `${largeTitleTextBox.top}px`;
|
|
128
|
+
/**
|
|
129
|
+
* The cloned back button should align exactly with the
|
|
130
|
+
* real back button on the entering page otherwise there will
|
|
131
|
+
* be a layout shift.
|
|
132
|
+
*/
|
|
133
|
+
const CONTAINER_END_TRANSLATE_Y = `${backButtonBox.top}px`;
|
|
134
|
+
/**
|
|
135
|
+
* In the forward direction, the cloned back button
|
|
136
|
+
* container should translate from over the large title
|
|
137
|
+
* to over the back button. In the backward direction,
|
|
138
|
+
* it should translate from over the back button to over
|
|
139
|
+
* the large title.
|
|
140
|
+
*/
|
|
141
|
+
const FORWARD_CONTAINER_KEYFRAMES = [
|
|
142
|
+
{ offset: 0, transform: `translate3d(${CONTAINER_START_TRANSLATE_X}, ${CONTAINER_START_TRANSLATE_Y}, 0)` },
|
|
143
|
+
{ offset: 1, transform: `translate3d(${CONTAINER_END_TRANSLATE_X}, ${CONTAINER_END_TRANSLATE_Y}, 0)` },
|
|
144
|
+
];
|
|
145
|
+
const BACKWARD_CONTAINER_KEYFRAMES = [
|
|
146
|
+
{ offset: 0, transform: `translate3d(${CONTAINER_END_TRANSLATE_X}, ${CONTAINER_END_TRANSLATE_Y}, 0)` },
|
|
147
|
+
{ offset: 1, transform: `translate3d(${CONTAINER_START_TRANSLATE_X}, ${CONTAINER_START_TRANSLATE_Y}, 0)` },
|
|
148
|
+
];
|
|
149
|
+
const CONTAINER_KEYFRAMES = backDirection ? BACKWARD_CONTAINER_KEYFRAMES : FORWARD_CONTAINER_KEYFRAMES;
|
|
150
|
+
/**
|
|
151
|
+
* In the forward direction, the text in the cloned back button
|
|
152
|
+
* should start to be (roughly) the size of the large title
|
|
153
|
+
* and then scale down to be the size of the actual back button.
|
|
154
|
+
* The text should also translate, but that translate is handled
|
|
155
|
+
* by the container keyframes.
|
|
156
|
+
*/
|
|
82
157
|
const FORWARD_TEXT_KEYFRAMES = [
|
|
83
|
-
{
|
|
84
|
-
|
|
85
|
-
opacity: 0,
|
|
86
|
-
transform: `translate3d(${START_TEXT_TRANSLATE}, ${largeTitleBox.top - 40}px, 0) scale(2.1)`,
|
|
87
|
-
},
|
|
88
|
-
{ offset: 1, opacity: 1, transform: `translate3d(${END_TEXT_TRANSLATE}, ${backButtonBox.top - 46}px, 0) scale(1)` },
|
|
158
|
+
{ offset: 0, opacity: 0, transform: TEXT_START_SCALE },
|
|
159
|
+
{ offset: 1, opacity: 1, transform: TEXT_END_SCALE },
|
|
89
160
|
];
|
|
90
161
|
const BACKWARD_TEXT_KEYFRAMES = [
|
|
91
|
-
{ offset: 0, opacity: 1, transform:
|
|
92
|
-
{ offset:
|
|
93
|
-
{
|
|
94
|
-
offset: 1,
|
|
95
|
-
opacity: 0,
|
|
96
|
-
transform: `translate3d(${START_TEXT_TRANSLATE}, ${largeTitleBox.top - 40}px, 0) scale(2.1)`,
|
|
97
|
-
},
|
|
162
|
+
{ offset: 0, opacity: 1, transform: TEXT_END_SCALE },
|
|
163
|
+
{ offset: 1, opacity: 0, transform: TEXT_START_SCALE },
|
|
98
164
|
];
|
|
99
165
|
const TEXT_KEYFRAMES = backDirection ? BACKWARD_TEXT_KEYFRAMES : FORWARD_TEXT_KEYFRAMES;
|
|
166
|
+
/**
|
|
167
|
+
* The icon should scale in/out in the second
|
|
168
|
+
* half of the animation. The icon should also
|
|
169
|
+
* translate, but that translate is handled by the
|
|
170
|
+
* container keyframes.
|
|
171
|
+
*/
|
|
100
172
|
const FORWARD_ICON_KEYFRAMES = [
|
|
101
|
-
{ offset: 0, opacity: 0, transform:
|
|
102
|
-
{ offset:
|
|
173
|
+
{ offset: 0, opacity: 0, transform: 'scale(0.6)' },
|
|
174
|
+
{ offset: 0.6, opacity: 0, transform: 'scale(0.6)' },
|
|
175
|
+
{ offset: 1, opacity: 1, transform: 'scale(1)' },
|
|
103
176
|
];
|
|
104
177
|
const BACKWARD_ICON_KEYFRAMES = [
|
|
105
|
-
{ offset: 0, opacity: 1, transform:
|
|
106
|
-
{ offset: 0.2, opacity: 0, transform:
|
|
107
|
-
{ offset: 1, opacity: 0, transform:
|
|
178
|
+
{ offset: 0, opacity: 1, transform: 'scale(1)' },
|
|
179
|
+
{ offset: 0.2, opacity: 0, transform: 'scale(0.6)' },
|
|
180
|
+
{ offset: 1, opacity: 0, transform: 'scale(0.6)' },
|
|
108
181
|
];
|
|
109
182
|
const ICON_KEYFRAMES = backDirection ? BACKWARD_ICON_KEYFRAMES : FORWARD_ICON_KEYFRAMES;
|
|
110
183
|
const enteringBackButtonTextAnimation = createAnimation();
|
|
111
184
|
const enteringBackButtonIconAnimation = createAnimation();
|
|
185
|
+
const enteringBackButtonAnimation = createAnimation();
|
|
112
186
|
const clonedBackButtonEl = getClonedElement('ion-back-button');
|
|
113
|
-
const
|
|
114
|
-
const
|
|
187
|
+
const clonedBackButtonTextEl = shadow(clonedBackButtonEl).querySelector('.button-text');
|
|
188
|
+
const clonedBackButtonIconEl = shadow(clonedBackButtonEl).querySelector('ion-icon');
|
|
115
189
|
clonedBackButtonEl.text = backButtonEl.text;
|
|
116
190
|
clonedBackButtonEl.mode = backButtonEl.mode;
|
|
117
191
|
clonedBackButtonEl.icon = backButtonEl.icon;
|
|
@@ -119,11 +193,19 @@ const animateBackButton = (rootAnimation, rtl, backDirection, backButtonEl, larg
|
|
|
119
193
|
clonedBackButtonEl.disabled = backButtonEl.disabled;
|
|
120
194
|
clonedBackButtonEl.style.setProperty('display', 'block');
|
|
121
195
|
clonedBackButtonEl.style.setProperty('position', 'fixed');
|
|
122
|
-
enteringBackButtonIconAnimation.addElement(
|
|
123
|
-
enteringBackButtonTextAnimation.addElement(
|
|
196
|
+
enteringBackButtonIconAnimation.addElement(clonedBackButtonIconEl);
|
|
197
|
+
enteringBackButtonTextAnimation.addElement(clonedBackButtonTextEl);
|
|
198
|
+
enteringBackButtonAnimation.addElement(clonedBackButtonEl);
|
|
199
|
+
enteringBackButtonAnimation
|
|
200
|
+
.beforeStyles({
|
|
201
|
+
position: 'absolute',
|
|
202
|
+
top: '0px',
|
|
203
|
+
[CONTAINER_ORIGIN_X]: '0px',
|
|
204
|
+
})
|
|
205
|
+
.keyframes(CONTAINER_KEYFRAMES);
|
|
124
206
|
enteringBackButtonTextAnimation
|
|
125
207
|
.beforeStyles({
|
|
126
|
-
'transform-origin': `${TEXT_ORIGIN_X}
|
|
208
|
+
'transform-origin': `${TEXT_ORIGIN_X} top`,
|
|
127
209
|
})
|
|
128
210
|
.beforeAddWrite(() => {
|
|
129
211
|
backButtonEl.style.setProperty('display', 'none');
|
|
@@ -140,21 +222,91 @@ const animateBackButton = (rootAnimation, rtl, backDirection, backButtonEl, larg
|
|
|
140
222
|
'transform-origin': `${ICON_ORIGIN_X} center`,
|
|
141
223
|
})
|
|
142
224
|
.keyframes(ICON_KEYFRAMES);
|
|
143
|
-
rootAnimation.addAnimation([
|
|
225
|
+
rootAnimation.addAnimation([
|
|
226
|
+
enteringBackButtonTextAnimation,
|
|
227
|
+
enteringBackButtonIconAnimation,
|
|
228
|
+
enteringBackButtonAnimation,
|
|
229
|
+
]);
|
|
144
230
|
};
|
|
145
|
-
const animateLargeTitle = (rootAnimation, rtl, backDirection, largeTitleEl, largeTitleBox,
|
|
146
|
-
|
|
147
|
-
|
|
231
|
+
const animateLargeTitle = (rootAnimation, rtl, backDirection, largeTitleEl, largeTitleBox, largeTitleTextBox, backButtonTextEl, backButtonTextBox) => {
|
|
232
|
+
var _a, _b;
|
|
233
|
+
/**
|
|
234
|
+
* The horizontal transform origin for the large title
|
|
235
|
+
*/
|
|
148
236
|
const ORIGIN_X = rtl ? 'right' : 'left';
|
|
237
|
+
const TITLE_START_OFFSET = rtl ? `calc(100% - ${largeTitleBox.right}px)` : `${largeTitleBox.left}px`;
|
|
238
|
+
/**
|
|
239
|
+
* The cloned large should align exactly with the
|
|
240
|
+
* real large title on the leaving page otherwise there will
|
|
241
|
+
* be a layout shift.
|
|
242
|
+
*/
|
|
243
|
+
const START_TRANSLATE_X = '0px';
|
|
244
|
+
const START_TRANSLATE_Y = `${largeTitleBox.top}px`;
|
|
245
|
+
/**
|
|
246
|
+
* How much to offset the large title translation by.
|
|
247
|
+
* This accounts for differences in sizing between the large
|
|
248
|
+
* title and the back button due to padding and font weight.
|
|
249
|
+
*/
|
|
250
|
+
const LARGE_TITLE_TRANSLATION_OFFSET = 8;
|
|
251
|
+
/**
|
|
252
|
+
* The scaled title should (roughly) overlap the back button.
|
|
253
|
+
* This ensures that the back button and title overlap during
|
|
254
|
+
* the animation. Note that since both elements either fade in
|
|
255
|
+
* or fade out over the course of the animation, neither element
|
|
256
|
+
* will be fully visible on top of the other. As a result, the overlap
|
|
257
|
+
* does not need to be perfect, so approximate values are acceptable here.
|
|
258
|
+
*/
|
|
259
|
+
const END_TRANSLATE_X = rtl
|
|
260
|
+
? `-${window.innerWidth - backButtonTextBox.right - LARGE_TITLE_TRANSLATION_OFFSET}px`
|
|
261
|
+
: `${backButtonTextBox.x - LARGE_TITLE_TRANSLATION_OFFSET}px`;
|
|
262
|
+
/**
|
|
263
|
+
* The top of the scaled large title
|
|
264
|
+
* should match with the top of the
|
|
265
|
+
* back button text element.
|
|
266
|
+
* We subtract 2px to account for the top padding
|
|
267
|
+
* on the large title element.
|
|
268
|
+
*/
|
|
269
|
+
const LARGE_TITLE_TOP_PADDING = 2;
|
|
270
|
+
const END_TRANSLATE_Y = `${backButtonTextBox.y - LARGE_TITLE_TOP_PADDING}px`;
|
|
271
|
+
/**
|
|
272
|
+
* In the forward direction, the large title should start at its
|
|
273
|
+
* normal size and then scale down to be (roughly) the size of the
|
|
274
|
+
* back button on the other view. In the backward direction, the
|
|
275
|
+
* large title should start at (roughly) the size of the back button
|
|
276
|
+
* and then scale up to its original size.
|
|
277
|
+
*
|
|
278
|
+
* Note that since both elements either fade in
|
|
279
|
+
* or fade out over the course of the animation, neither element
|
|
280
|
+
* will be fully visible on top of the other. As a result, the overlap
|
|
281
|
+
* does not need to be perfect, so approximate values are acceptable here.
|
|
282
|
+
*/
|
|
283
|
+
/**
|
|
284
|
+
* When the title and back button texts match
|
|
285
|
+
* then they should overlap during the page transition.
|
|
286
|
+
* If the texts do not match up then the large title text scale adjusts
|
|
287
|
+
* to not perfectly match the back button text otherwise the
|
|
288
|
+
* proportions will be incorrect.
|
|
289
|
+
* When the texts match we scale both the width and height to account for
|
|
290
|
+
* font weight differences between the title and back button.
|
|
291
|
+
*/
|
|
292
|
+
const doTitleAndButtonTextsMatch = ((_a = backButtonTextEl.textContent) === null || _a === void 0 ? void 0 : _a.trim()) === ((_b = largeTitleEl.textContent) === null || _b === void 0 ? void 0 : _b.trim());
|
|
293
|
+
const WIDTH_SCALE = backButtonTextBox.width / largeTitleTextBox.width;
|
|
294
|
+
const HEIGHT_SCALE = backButtonTextBox.height / (largeTitleTextBox.height - LARGE_TITLE_SIZE_OFFSET);
|
|
295
|
+
const START_SCALE = 'scale(1)';
|
|
296
|
+
const END_SCALE = doTitleAndButtonTextsMatch ? `scale(${WIDTH_SCALE}, ${HEIGHT_SCALE})` : `scale(${HEIGHT_SCALE})`;
|
|
149
297
|
const BACKWARDS_KEYFRAMES = [
|
|
150
|
-
{ offset: 0, opacity: 0, transform: `translate3d(${
|
|
298
|
+
{ offset: 0, opacity: 0, transform: `translate3d(${END_TRANSLATE_X}, ${END_TRANSLATE_Y}, 0) ${END_SCALE}` },
|
|
151
299
|
{ offset: 0.1, opacity: 0 },
|
|
152
|
-
{ offset: 1, opacity: 1, transform: `translate3d(
|
|
300
|
+
{ offset: 1, opacity: 1, transform: `translate3d(${START_TRANSLATE_X}, ${START_TRANSLATE_Y}, 0) ${START_SCALE}` },
|
|
153
301
|
];
|
|
154
302
|
const FORWARDS_KEYFRAMES = [
|
|
155
|
-
{
|
|
303
|
+
{
|
|
304
|
+
offset: 0,
|
|
305
|
+
opacity: 0.99,
|
|
306
|
+
transform: `translate3d(${START_TRANSLATE_X}, ${START_TRANSLATE_Y}, 0) ${START_SCALE}`,
|
|
307
|
+
},
|
|
156
308
|
{ offset: 0.6, opacity: 0 },
|
|
157
|
-
{ offset: 1, opacity: 0, transform: `translate3d(${
|
|
309
|
+
{ offset: 1, opacity: 0, transform: `translate3d(${END_TRANSLATE_X}, ${END_TRANSLATE_Y}, 0) ${END_SCALE}` },
|
|
158
310
|
];
|
|
159
311
|
const KEYFRAMES = backDirection ? BACKWARDS_KEYFRAMES : FORWARDS_KEYFRAMES;
|
|
160
312
|
const clonedTitleEl = getClonedElement('ion-title');
|
|
@@ -165,8 +317,14 @@ const animateLargeTitle = (rootAnimation, rtl, backDirection, largeTitleEl, larg
|
|
|
165
317
|
clonedLargeTitleAnimation.addElement(clonedTitleEl);
|
|
166
318
|
clonedLargeTitleAnimation
|
|
167
319
|
.beforeStyles({
|
|
168
|
-
'transform-origin': `${ORIGIN_X}
|
|
169
|
-
|
|
320
|
+
'transform-origin': `${ORIGIN_X} top`,
|
|
321
|
+
/**
|
|
322
|
+
* Since font size changes will cause
|
|
323
|
+
* the dimension of the large title to change
|
|
324
|
+
* we need to set the cloned title height
|
|
325
|
+
* equal to that of the original large title height.
|
|
326
|
+
*/
|
|
327
|
+
height: `${largeTitleBox.height}px`,
|
|
170
328
|
display: '',
|
|
171
329
|
position: 'relative',
|
|
172
330
|
[ORIGIN_X]: TITLE_START_OFFSET,
|
|
@@ -479,5 +637,15 @@ const iosTransitionAnimation = (navEl, opts) => {
|
|
|
479
637
|
throw err;
|
|
480
638
|
}
|
|
481
639
|
};
|
|
640
|
+
/**
|
|
641
|
+
* The scale of the back button during the animation
|
|
642
|
+
* is computed based on the scale of the large title
|
|
643
|
+
* and vice versa. However, we need to account for slight
|
|
644
|
+
* variations in the size of the large title due to
|
|
645
|
+
* padding and font weight. This value should be used to subtract
|
|
646
|
+
* a small amount from the large title height when computing scales
|
|
647
|
+
* to get more accurate scale results.
|
|
648
|
+
*/
|
|
649
|
+
const LARGE_TITLE_SIZE_OFFSET = 10;
|
|
482
650
|
|
|
483
651
|
export { iosTransitionAnimation, shadow };
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* (C) Ionic http://ionicframework.com - MIT License
|
|
3
3
|
*/
|
|
4
4
|
import { c as createAnimation } from './animation-92066c62.js';
|
|
5
|
-
import { g as getIonPageElement } from './index-
|
|
5
|
+
import { g as getIonPageElement } from './index-a09eac70.js';
|
|
6
6
|
import './index-7a14ecec.js';
|
|
7
7
|
import './helpers-3379ba19.js';
|
|
8
8
|
import './index-b49b173c.js';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import{__awaiter,__generator}from"tslib";
|
|
2
2
|
/*!
|
|
3
3
|
* (C) Ionic http://ionicframework.com - MIT License
|
|
4
|
-
*/import{w as writeTask,B as Build}from"./index-b49b173c.js";import{r as raf}from"./helpers-3379ba19.js";var LIFECYCLE_WILL_ENTER="ionViewWillEnter";var LIFECYCLE_DID_ENTER="ionViewDidEnter";var LIFECYCLE_WILL_LEAVE="ionViewWillLeave";var LIFECYCLE_DID_LEAVE="ionViewDidLeave";var LIFECYCLE_WILL_UNLOAD="ionViewWillUnload";var iosTransitionAnimation=function(){return import("./ios.transition-
|
|
4
|
+
*/import{w as writeTask,B as Build}from"./index-b49b173c.js";import{r as raf}from"./helpers-3379ba19.js";var LIFECYCLE_WILL_ENTER="ionViewWillEnter";var LIFECYCLE_DID_ENTER="ionViewDidEnter";var LIFECYCLE_WILL_LEAVE="ionViewWillLeave";var LIFECYCLE_DID_LEAVE="ionViewDidLeave";var LIFECYCLE_WILL_UNLOAD="ionViewWillUnload";var iosTransitionAnimation=function(){return import("./ios.transition-4d1322d6.js")};var mdTransitionAnimation=function(){return import("./md.transition-66b425d0.js")};var transition=function(e){return new Promise((function(n,i){writeTask((function(){beforeTransition(e);runTransition(e).then((function(i){if(i.animation){i.animation.destroy()}afterTransition(e);n(i)}),(function(n){afterTransition(e);i(n)}))}))}))};var beforeTransition=function(e){var n=e.enteringEl;var i=e.leavingEl;setZIndex(n,i,e.direction);if(e.showGoBack){n.classList.add("can-go-back")}else{n.classList.remove("can-go-back")}setPageHidden(n,false);n.style.setProperty("pointer-events","none");if(i){setPageHidden(i,false);i.style.setProperty("pointer-events","none")}};var runTransition=function(e){return __awaiter(void 0,void 0,void 0,(function(){var n,i;return __generator(this,(function(r){switch(r.label){case 0:return[4,getAnimationBuilder(e)];case 1:n=r.sent();i=n&&Build.isBrowser?animation(n,e):noAnimation(e);return[2,i]}}))}))};var afterTransition=function(e){var n=e.enteringEl;var i=e.leavingEl;n.classList.remove("ion-page-invisible");n.style.removeProperty("pointer-events");if(i!==undefined){i.classList.remove("ion-page-invisible");i.style.removeProperty("pointer-events")}};var getAnimationBuilder=function(e){return __awaiter(void 0,void 0,void 0,(function(){var n,i;return __generator(this,(function(r){switch(r.label){case 0:if(!e.leavingEl||!e.animated||e.duration===0){return[2,undefined]}if(e.animationBuilder){return[2,e.animationBuilder]}if(!(e.mode==="ios"))return[3,2];return[4,iosTransitionAnimation()];case 1:i=r.sent().iosTransitionAnimation;return[3,4];case 2:return[4,mdTransitionAnimation()];case 3:i=r.sent().mdTransitionAnimation;r.label=4;case 4:n=i;return[2,n]}}))}))};var animation=function(e,n){return __awaiter(void 0,void 0,void 0,(function(){var i,r;return __generator(this,(function(t){switch(t.label){case 0:return[4,waitForReady(n,true)];case 1:t.sent();i=e(n.baseEl,n);fireWillEvents(n.enteringEl,n.leavingEl);return[4,playTransition(i,n)];case 2:r=t.sent();if(n.progressCallback){n.progressCallback(undefined)}if(r){fireDidEvents(n.enteringEl,n.leavingEl)}return[2,{hasCompleted:r,animation:i}]}}))}))};var noAnimation=function(e){return __awaiter(void 0,void 0,void 0,(function(){var n,i;return __generator(this,(function(r){switch(r.label){case 0:n=e.enteringEl;i=e.leavingEl;return[4,waitForReady(e,false)];case 1:r.sent();fireWillEvents(n,i);fireDidEvents(n,i);return[2,{hasCompleted:true}]}}))}))};var waitForReady=function(e,n){return __awaiter(void 0,void 0,void 0,(function(){var i;return __generator(this,(function(r){switch(r.label){case 0:i=e.deepWait!==undefined?e.deepWait:n;if(!i)return[3,2];return[4,Promise.all([deepReady(e.enteringEl),deepReady(e.leavingEl)])];case 1:r.sent();r.label=2;case 2:return[4,notifyViewReady(e.viewIsReady,e.enteringEl)];case 3:r.sent();return[2]}}))}))};var notifyViewReady=function(e,n){return __awaiter(void 0,void 0,void 0,(function(){return __generator(this,(function(i){switch(i.label){case 0:if(!e)return[3,2];return[4,e(n)];case 1:i.sent();i.label=2;case 2:return[2]}}))}))};var playTransition=function(e,n){var i=n.progressCallback;var r=new Promise((function(n){e.onFinish((function(e){return n(e===1)}))}));if(i){e.progressStart(true);i(e)}else{e.play()}return r};var fireWillEvents=function(e,n){lifecycle(n,LIFECYCLE_WILL_LEAVE);lifecycle(e,LIFECYCLE_WILL_ENTER)};var fireDidEvents=function(e,n){lifecycle(e,LIFECYCLE_DID_ENTER);lifecycle(n,LIFECYCLE_DID_LEAVE)};var lifecycle=function(e,n){if(e){var i=new CustomEvent(n,{bubbles:false,cancelable:false});e.dispatchEvent(i)}};var waitForMount=function(){return new Promise((function(e){return raf((function(){return raf((function(){return e()}))}))}))};var deepReady=function(e){return __awaiter(void 0,void 0,void 0,(function(){var n,i,r;return __generator(this,(function(t){switch(t.label){case 0:n=e;if(!n)return[3,6];if(!(n.componentOnReady!=null))return[3,2];return[4,n.componentOnReady()];case 1:i=t.sent();if(i!=null){return[2]}return[3,4];case 2:if(!(n.__registerHost!=null))return[3,4];r=new Promise((function(e){return raf(e)}));return[4,r];case 3:t.sent();return[2];case 4:return[4,Promise.all(Array.from(n.children).map(deepReady))];case 5:t.sent();t.label=6;case 6:return[2]}}))}))};var setPageHidden=function(e,n){if(n){e.setAttribute("aria-hidden","true");e.classList.add("ion-page-hidden")}else{e.hidden=false;e.removeAttribute("aria-hidden");e.classList.remove("ion-page-hidden")}};var setZIndex=function(e,n,i){if(e!==undefined){e.style.zIndex=i==="back"?"99":"101"}if(n!==undefined){n.style.zIndex="100"}};var getIonPageElement=function(e){if(e.classList.contains("ion-page")){return e}var n=e.querySelector(":scope > .ion-page, :scope > ion-nav, :scope > ion-tabs");if(n){return n}return e};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-es5/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* (C) Ionic http://ionicframework.com - MIT License
|
|
3
3
|
*/
|
|
4
|
-
export{c as createAnimation}from"./animation-92066c62.js";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-
|
|
4
|
+
export{c as createAnimation}from"./animation-92066c62.js";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-a09eac70.js";export{iosTransitionAnimation}from"./ios.transition-4d1322d6.js";export{mdTransitionAnimation}from"./md.transition-66b425d0.js";export{g as getTimeGivenProgression}from"./cubic-bezier-66542bc5.js";export{createGesture}from"./index-ff313b19.js";export{g as getPlatforms,i as initialize,a as isPlatform}from"./ionic-global-246ca78f.js";export{c as componentOnReady}from"./helpers-3379ba19.js";export{I as IonicSafeString,g as getMode,s as setupConfig}from"./config-96c9ace3.js";export{o as openURL}from"./theme-17531cdf.js";export{m as menuController}from"./index-df55802d.js";export{b as actionSheetController,a as alertController,l as loadingController,m as modalController,p as pickerController,c as popoverController,t as toastController}from"./overlays-cec6bac8.js";import"./index-7a14ecec.js";import"./index-b49b173c.js";import"./gesture-controller-0fa396c4.js";import"./index-595d62c9.js";import"./hardware-back-button-39299f84.js";import"./framework-delegate-aa433dea.js";var IonicSlides=function(e){var o=e.swiper,t=e.extendParams;var s={effect:undefined,direction:"horizontal",initialSlide:0,loop:false,parallax:false,slidesPerView:1,spaceBetween:0,speed:300,slidesPerColumn:1,slidesPerColumnFill:"column",slidesPerGroup:1,centeredSlides:false,slidesOffsetBefore:0,slidesOffsetAfter:0,touchEventsTarget:"container",freeMode:false,freeModeMomentum:true,freeModeMomentumRatio:1,freeModeMomentumBounce:true,freeModeMomentumBounceRatio:1,freeModeMomentumVelocityRatio:1,freeModeSticky:false,freeModeMinimumVelocity:.02,autoHeight:false,setWrapperSize:false,zoom:{maxRatio:3,minRatio:1,toggle:false},touchRatio:1,touchAngle:45,simulateTouch:true,touchStartPreventDefault:false,shortSwipes:true,longSwipes:true,longSwipesRatio:.5,longSwipesMs:300,followFinger:true,threshold:0,touchMoveStopPropagation:true,touchReleaseOnEdges:false,iOSEdgeSwipeDetection:false,iOSEdgeSwipeThreshold:20,resistance:true,resistanceRatio:.85,watchSlidesProgress:false,watchSlidesVisibility:false,preventClicks:true,preventClicksPropagation:true,slideToClickedSlide:false,loopAdditionalSlides:0,noSwiping:true,runCallbacksOnInit:true,coverflowEffect:{rotate:50,stretch:0,depth:100,modifier:1,slideShadows:true},flipEffect:{slideShadows:true,limitRotation:true},cubeEffect:{slideShadows:true,shadow:true,shadowOffset:20,shadowScale:.94},fadeEffect:{crossFade:false},a11y:{prevSlideMessage:"Previous slide",nextSlideMessage:"Next slide",firstSlideMessage:"This is the first slide",lastSlideMessage:"This is the last slide"}};if(o.pagination){s.pagination={type:"bullets",clickable:false,hideOnClick:false}}if(o.scrollbar){s.scrollbar={hide:true}}t(s)};export{IonicSlides};
|