@ionic/vue 8.8.19 → 9.0.0
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/README.md +1 -0
- package/dist/index.js +233 -117
- package/dist/index.js.map +1 -1
- package/dist/types/components/IonPage.d.ts +5 -5
- package/dist/types/components/IonRouterOutlet.d.ts +16 -4
- package/dist/types/components/IonTabBar.d.ts +31 -11
- package/dist/types/components/IonTabButton.d.ts +6 -6
- package/dist/types/components/IonTabs.d.ts +9 -9
- package/dist/types/components/Overlays.d.ts +0 -1
- package/dist/types/controllers.d.ts +1 -9
- package/dist/types/index.d.ts +2 -2
- package/dist/vetur/attributes.json +42 -86
- package/dist/vetur/tags.json +6 -20
- package/dist/web-types.json +59 -242
- package/package.json +20 -10
package/dist/index.js
CHANGED
|
@@ -77,7 +77,7 @@ import { defineCustomElement as defineCustomElement$19 } from '@ionic/core/compo
|
|
|
77
77
|
import { defineCustomElement as defineCustomElement$1a } from '@ionic/core/components/ion-title.js';
|
|
78
78
|
import { defineCustomElement as defineCustomElement$1b } from '@ionic/core/components/ion-toggle.js';
|
|
79
79
|
import { defineCustomElement as defineCustomElement$1c } from '@ionic/core/components/ion-toolbar.js';
|
|
80
|
-
import { LIFECYCLE_WILL_ENTER, LIFECYCLE_DID_ENTER, LIFECYCLE_WILL_LEAVE, LIFECYCLE_DID_LEAVE, initialize, modalController as modalController$1, popoverController as popoverController$1, alertController as alertController$1, actionSheetController as actionSheetController$1, loadingController as loadingController$1,
|
|
80
|
+
import { LIFECYCLE_WILL_ENTER, LIFECYCLE_DID_ENTER, LIFECYCLE_WILL_LEAVE, LIFECYCLE_DID_LEAVE, initialize, modalController as modalController$1, popoverController as popoverController$1, alertController as alertController$1, actionSheetController as actionSheetController$1, loadingController as loadingController$1, toastController as toastController$1 } from '@ionic/core/components';
|
|
81
81
|
export { IonicSafeString, IonicSlides, createAnimation, createGesture, getIonPageElement, getPlatforms, getTimeGivenProgression, iosTransitionAnimation, isPlatform, mdTransitionAnimation, menuController, openURL } from '@ionic/core/components';
|
|
82
82
|
import { defineCustomElement as defineCustomElement$1d } from '@ionic/core/components/ion-back-button.js';
|
|
83
83
|
import { defineCustomElement as defineCustomElement$1e } from '@ionic/core/components/ion-router-outlet.js';
|
|
@@ -91,9 +91,8 @@ import { defineCustomElement as defineCustomElement$1l } from '@ionic/core/compo
|
|
|
91
91
|
import { defineCustomElement as defineCustomElement$1m } from '@ionic/core/components/ion-alert.js';
|
|
92
92
|
import { defineCustomElement as defineCustomElement$1n } from '@ionic/core/components/ion-loading.js';
|
|
93
93
|
import { defineCustomElement as defineCustomElement$1o } from '@ionic/core/components/ion-modal.js';
|
|
94
|
-
import { defineCustomElement as defineCustomElement$1p } from '@ionic/core/components/ion-
|
|
95
|
-
import { defineCustomElement as defineCustomElement$1q } from '@ionic/core/components/ion-
|
|
96
|
-
import { defineCustomElement as defineCustomElement$1r } from '@ionic/core/components/ion-toast.js';
|
|
94
|
+
import { defineCustomElement as defineCustomElement$1p } from '@ionic/core/components/ion-popover.js';
|
|
95
|
+
import { defineCustomElement as defineCustomElement$1q } from '@ionic/core/components/ion-toast.js';
|
|
97
96
|
|
|
98
97
|
const UPDATE_VALUE_EVENT = 'update:modelValue';
|
|
99
98
|
const MODEL_VALUE = 'modelValue';
|
|
@@ -115,8 +114,19 @@ const DEFAULT_EMPTY_PROP$1 = { default: EMPTY_PROP$1 };
|
|
|
115
114
|
const getComponentClasses = (classes) => {
|
|
116
115
|
return classes?.split(' ') || [];
|
|
117
116
|
};
|
|
118
|
-
const
|
|
119
|
-
|
|
117
|
+
const syncElementClasses = (ref, componentClasses, defaultClasses = []) => {
|
|
118
|
+
if (ref?.value) {
|
|
119
|
+
const element = ref.value;
|
|
120
|
+
// makes sure vue classes are on the actual element
|
|
121
|
+
componentClasses.forEach((c) => {
|
|
122
|
+
if (!!c && !element.classList.contains(c)) {
|
|
123
|
+
element.classList.add(c);
|
|
124
|
+
}
|
|
125
|
+
});
|
|
126
|
+
}
|
|
127
|
+
return [...Array.from(ref.value?.classList || []), ...defaultClasses].filter((c, i, self) => {
|
|
128
|
+
return !componentClasses.has(c) && self.indexOf(c) === i;
|
|
129
|
+
});
|
|
120
130
|
};
|
|
121
131
|
/**
|
|
122
132
|
* Create a callback to define a Vue component wrapper around a Web Component.
|
|
@@ -132,8 +142,9 @@ const getElementClasses = (ref, componentClasses, defaultClasses = []) => {
|
|
|
132
142
|
* to customElements.define. Only set if `includeImportCustomElements: true` in your config.
|
|
133
143
|
* @prop modelProp - The prop that v-model binds to (i.e. value)
|
|
134
144
|
* @prop modelUpdateEvent - The event that is fired from your Web Component when the value changes (i.e. ionChange)
|
|
145
|
+
* @prop modelUpdateEventAttribute - Property to read value from when the value changes.
|
|
135
146
|
*/
|
|
136
|
-
const defineContainer = (name, defineCustomElement, componentProps = [], emitProps = [], modelProp, modelUpdateEvent) => {
|
|
147
|
+
const defineContainer = (name, defineCustomElement, componentProps = [], emitProps = [], modelProp, modelUpdateEvent, modelUpdateEventAttribute, transformTagFn) => {
|
|
137
148
|
/**
|
|
138
149
|
* Create a Vue component wrapper around a Web Component.
|
|
139
150
|
* Note: The `props` here are not all properties on a component.
|
|
@@ -178,7 +189,7 @@ const defineContainer = (name, defineCustomElement, componentProps = [], emitPro
|
|
|
178
189
|
*/
|
|
179
190
|
const vModelDirective = {
|
|
180
191
|
created: (el) => {
|
|
181
|
-
const eventsNames =
|
|
192
|
+
const eventsNames = Array.isArray(modelUpdateEvent) ? modelUpdateEvent : [modelUpdateEvent];
|
|
182
193
|
eventsNames.forEach((eventName) => {
|
|
183
194
|
el.addEventListener(eventName, (e) => {
|
|
184
195
|
/**
|
|
@@ -189,7 +200,11 @@ const defineContainer = (name, defineCustomElement, componentProps = [], emitPro
|
|
|
189
200
|
* when ionChange bubbles up from Component B.
|
|
190
201
|
*/
|
|
191
202
|
if (e.target.tagName === el.tagName && modelProp) {
|
|
192
|
-
|
|
203
|
+
const resolvePath = (object, path) => {
|
|
204
|
+
return path.split('.').reduce((value, key) => (value !== undefined ? value[key] : undefined), object);
|
|
205
|
+
};
|
|
206
|
+
const path = (modelUpdateEventAttribute ?? `target.${modelProp}`);
|
|
207
|
+
const modelPropValue = resolvePath(e, path);
|
|
193
208
|
emit(UPDATE_VALUE_EVENT, modelPropValue);
|
|
194
209
|
}
|
|
195
210
|
});
|
|
@@ -203,6 +218,14 @@ const defineContainer = (name, defineCustomElement, componentProps = [], emitPro
|
|
|
203
218
|
const { routerLink } = props;
|
|
204
219
|
if (routerLink === EMPTY_PROP$1)
|
|
205
220
|
return;
|
|
221
|
+
/**
|
|
222
|
+
* Allow modifier key clicks (ctrl/cmd/shift) to open the link in a
|
|
223
|
+
* new tab/window without triggering SPA navigation on the current page.
|
|
224
|
+
*/
|
|
225
|
+
const mouseEv = ev;
|
|
226
|
+
if (mouseEv.metaKey || mouseEv.ctrlKey || mouseEv.shiftKey) {
|
|
227
|
+
return;
|
|
228
|
+
}
|
|
206
229
|
if (navManager !== undefined) {
|
|
207
230
|
/**
|
|
208
231
|
* This prevents the browser from
|
|
@@ -243,7 +266,7 @@ const defineContainer = (name, defineCustomElement, componentProps = [], emitPro
|
|
|
243
266
|
};
|
|
244
267
|
const propsToAdd = {
|
|
245
268
|
ref: containerRef,
|
|
246
|
-
class:
|
|
269
|
+
class: syncElementClasses(containerRef, classes),
|
|
247
270
|
onClick: handleClick,
|
|
248
271
|
};
|
|
249
272
|
/**
|
|
@@ -291,7 +314,8 @@ const defineContainer = (name, defineCustomElement, componentProps = [], emitPro
|
|
|
291
314
|
* vModelDirective is only needed on components that support v-model.
|
|
292
315
|
* As a result, we conditionally call withDirectives with v-model components.
|
|
293
316
|
*/
|
|
294
|
-
const
|
|
317
|
+
const tagName = transformTagFn ? transformTagFn(name) : name;
|
|
318
|
+
const node = h(tagName, propsToAdd, slots.default && slots.default());
|
|
295
319
|
return modelProp === undefined ? node : withDirectives(node, [[vModelDirective]]);
|
|
296
320
|
};
|
|
297
321
|
}, {
|
|
@@ -323,7 +347,7 @@ const IonAccordionGroup = /*@__PURE__*/ defineContainer('ion-accordion-group', d
|
|
|
323
347
|
], [
|
|
324
348
|
'ionChange',
|
|
325
349
|
'ionValueChange'
|
|
326
|
-
], 'value', '
|
|
350
|
+
], 'value', 'ionChange', undefined);
|
|
327
351
|
const IonAvatar = /*@__PURE__*/ defineContainer('ion-avatar', defineCustomElement$2);
|
|
328
352
|
const IonBackdrop = /*@__PURE__*/ defineContainer('ion-backdrop', defineCustomElement$3, [
|
|
329
353
|
'visible',
|
|
@@ -436,7 +460,7 @@ const IonCheckbox = /*@__PURE__*/ defineContainer('ion-checkbox', defineCustomEl
|
|
|
436
460
|
'ionChange',
|
|
437
461
|
'ionFocus',
|
|
438
462
|
'ionBlur'
|
|
439
|
-
], 'checked', '
|
|
463
|
+
], 'checked', 'ionChange', undefined);
|
|
440
464
|
const IonChip = /*@__PURE__*/ defineContainer('ion-chip', defineCustomElement$f, [
|
|
441
465
|
'color',
|
|
442
466
|
'outline',
|
|
@@ -531,7 +555,7 @@ const IonDatetime = /*@__PURE__*/ defineContainer('ion-datetime', defineCustomEl
|
|
|
531
555
|
'ionBlur',
|
|
532
556
|
'ionStyle',
|
|
533
557
|
'ionRender'
|
|
534
|
-
], 'value', '
|
|
558
|
+
], 'value', 'ionChange', undefined);
|
|
535
559
|
const IonDatetimeButton = /*@__PURE__*/ defineContainer('ion-datetime-button', defineCustomElement$j, [
|
|
536
560
|
'color',
|
|
537
561
|
'disabled',
|
|
@@ -647,7 +671,7 @@ const IonInput = /*@__PURE__*/ defineContainer('ion-input', defineCustomElement$
|
|
|
647
671
|
'ionChange',
|
|
648
672
|
'ionBlur',
|
|
649
673
|
'ionFocus'
|
|
650
|
-
], 'value', '
|
|
674
|
+
], 'value', 'ionInput', undefined);
|
|
651
675
|
const IonInputOtp = /*@__PURE__*/ defineContainer('ion-input-otp', defineCustomElement$u, [
|
|
652
676
|
'autocapitalize',
|
|
653
677
|
'color',
|
|
@@ -673,7 +697,7 @@ const IonInputOtp = /*@__PURE__*/ defineContainer('ion-input-otp', defineCustomE
|
|
|
673
697
|
'ionComplete',
|
|
674
698
|
'ionBlur',
|
|
675
699
|
'ionFocus'
|
|
676
|
-
], 'value', '
|
|
700
|
+
], 'value', 'ionInput', undefined);
|
|
677
701
|
const IonInputPasswordToggle = /*@__PURE__*/ defineContainer('ion-input-password-toggle', defineCustomElement$v, [
|
|
678
702
|
'color',
|
|
679
703
|
'showIcon',
|
|
@@ -818,7 +842,7 @@ const IonRadio = /*@__PURE__*/ defineContainer('ion-radio', defineCustomElement$
|
|
|
818
842
|
], [
|
|
819
843
|
'ionFocus',
|
|
820
844
|
'ionBlur'
|
|
821
|
-
], 'value', '
|
|
845
|
+
], 'value', 'ionChange', undefined);
|
|
822
846
|
const IonRadioGroup = /*@__PURE__*/ defineContainer('ion-radio-group', defineCustomElement$P, [
|
|
823
847
|
'allowEmptySelection',
|
|
824
848
|
'compareWith',
|
|
@@ -831,7 +855,7 @@ const IonRadioGroup = /*@__PURE__*/ defineContainer('ion-radio-group', defineCus
|
|
|
831
855
|
], [
|
|
832
856
|
'ionChange',
|
|
833
857
|
'ionValueChange'
|
|
834
|
-
], 'value', '
|
|
858
|
+
], 'value', 'ionChange', undefined);
|
|
835
859
|
const IonRange = /*@__PURE__*/ defineContainer('ion-range', defineCustomElement$Q, [
|
|
836
860
|
'color',
|
|
837
861
|
'debounce',
|
|
@@ -862,7 +886,7 @@ const IonRange = /*@__PURE__*/ defineContainer('ion-range', defineCustomElement$
|
|
|
862
886
|
'ionBlur',
|
|
863
887
|
'ionKnobMoveStart',
|
|
864
888
|
'ionKnobMoveEnd'
|
|
865
|
-
], 'value', '
|
|
889
|
+
], 'value', 'ionInput', undefined);
|
|
866
890
|
const IonRefresher = /*@__PURE__*/ defineContainer('ion-refresher', defineCustomElement$R, [
|
|
867
891
|
'pullMin',
|
|
868
892
|
'pullMax',
|
|
@@ -943,7 +967,7 @@ const IonSearchbar = /*@__PURE__*/ defineContainer('ion-searchbar', defineCustom
|
|
|
943
967
|
'ionBlur',
|
|
944
968
|
'ionFocus',
|
|
945
969
|
'ionStyle'
|
|
946
|
-
], 'value', '
|
|
970
|
+
], 'value', 'ionInput', undefined);
|
|
947
971
|
const IonSegment = /*@__PURE__*/ defineContainer('ion-segment', defineCustomElement$Y, [
|
|
948
972
|
'color',
|
|
949
973
|
'disabled',
|
|
@@ -958,14 +982,14 @@ const IonSegment = /*@__PURE__*/ defineContainer('ion-segment', defineCustomElem
|
|
|
958
982
|
'ionChange',
|
|
959
983
|
'ionSelect',
|
|
960
984
|
'ionStyle'
|
|
961
|
-
], 'value', '
|
|
985
|
+
], 'value', 'ionChange', undefined);
|
|
962
986
|
const IonSegmentButton = /*@__PURE__*/ defineContainer('ion-segment-button', defineCustomElement$Z, [
|
|
963
987
|
'contentId',
|
|
964
988
|
'disabled',
|
|
965
989
|
'layout',
|
|
966
990
|
'type',
|
|
967
991
|
'value'
|
|
968
|
-
], [], 'value', '
|
|
992
|
+
], [], 'value', 'ionChange', undefined);
|
|
969
993
|
const IonSegmentContent = /*@__PURE__*/ defineContainer('ion-segment-content', defineCustomElement$_);
|
|
970
994
|
const IonSegmentView = /*@__PURE__*/ defineContainer('ion-segment-view', defineCustomElement$$, [
|
|
971
995
|
'disabled',
|
|
@@ -1010,7 +1034,7 @@ const IonSelect = /*@__PURE__*/ defineContainer('ion-select', defineCustomElemen
|
|
|
1010
1034
|
'ionFocus',
|
|
1011
1035
|
'ionBlur',
|
|
1012
1036
|
'ionStyle'
|
|
1013
|
-
], 'value', '
|
|
1037
|
+
], 'value', 'ionChange', undefined);
|
|
1014
1038
|
const IonSelectModal = /*@__PURE__*/ defineContainer('ion-select-modal', defineCustomElement$11, [
|
|
1015
1039
|
'header',
|
|
1016
1040
|
'cancelText',
|
|
@@ -1019,7 +1043,10 @@ const IonSelectModal = /*@__PURE__*/ defineContainer('ion-select-modal', defineC
|
|
|
1019
1043
|
]);
|
|
1020
1044
|
const IonSelectOption = /*@__PURE__*/ defineContainer('ion-select-option', defineCustomElement$12, [
|
|
1021
1045
|
'disabled',
|
|
1022
|
-
'value'
|
|
1046
|
+
'value',
|
|
1047
|
+
'description',
|
|
1048
|
+
'labelPlacement',
|
|
1049
|
+
'justify'
|
|
1023
1050
|
]);
|
|
1024
1051
|
const IonSkeletonText = /*@__PURE__*/ defineContainer('ion-skeleton-text', defineCustomElement$13, [
|
|
1025
1052
|
'animated',
|
|
@@ -1088,7 +1115,7 @@ const IonTextarea = /*@__PURE__*/ defineContainer('ion-textarea', defineCustomEl
|
|
|
1088
1115
|
'ionInput',
|
|
1089
1116
|
'ionBlur',
|
|
1090
1117
|
'ionFocus'
|
|
1091
|
-
], 'value', '
|
|
1118
|
+
], 'value', 'ionInput', undefined);
|
|
1092
1119
|
const IonThumbnail = /*@__PURE__*/ defineContainer('ion-thumbnail', defineCustomElement$19);
|
|
1093
1120
|
const IonTitle = /*@__PURE__*/ defineContainer('ion-title', defineCustomElement$1a, [
|
|
1094
1121
|
'color',
|
|
@@ -1117,13 +1144,21 @@ const IonToggle = /*@__PURE__*/ defineContainer('ion-toggle', defineCustomElemen
|
|
|
1117
1144
|
'ionChange',
|
|
1118
1145
|
'ionFocus',
|
|
1119
1146
|
'ionBlur'
|
|
1120
|
-
], 'checked', '
|
|
1147
|
+
], 'checked', 'ionChange', undefined);
|
|
1121
1148
|
const IonToolbar = /*@__PURE__*/ defineContainer('ion-toolbar', defineCustomElement$1c, [
|
|
1122
1149
|
'color'
|
|
1123
1150
|
]);
|
|
1124
1151
|
|
|
1125
1152
|
const useBackButton = (priority, handler) => {
|
|
1126
|
-
|
|
1153
|
+
/**
|
|
1154
|
+
* `Handler` permits returning null, which core's public `register` type
|
|
1155
|
+
* does not accept, so normalize it rather than narrowing the public
|
|
1156
|
+
* `useBackButton` contract.
|
|
1157
|
+
*/
|
|
1158
|
+
const callback = (ev) => ev.detail.register(priority, (processNextHandler) => {
|
|
1159
|
+
const result = handler(processNextHandler);
|
|
1160
|
+
return result === null ? undefined : result;
|
|
1161
|
+
});
|
|
1127
1162
|
const unregister = () => document.removeEventListener("ionBackButton", callback);
|
|
1128
1163
|
document.addEventListener("ionBackButton", callback);
|
|
1129
1164
|
return { unregister };
|
|
@@ -1173,17 +1208,16 @@ const hookNames = {
|
|
|
1173
1208
|
};
|
|
1174
1209
|
const ids = { main: 0 };
|
|
1175
1210
|
const generateId = (type = "main") => {
|
|
1176
|
-
|
|
1177
|
-
const id = ((_a = ids[type]) !== null && _a !== void 0 ? _a : 0) + 1;
|
|
1211
|
+
const id = (ids[type] ?? 0) + 1;
|
|
1178
1212
|
ids[type] = id;
|
|
1179
1213
|
return id.toString();
|
|
1180
1214
|
};
|
|
1181
1215
|
const fireLifecycle = (vueComponent, vueInstance, lifecycle) => {
|
|
1182
|
-
if (vueComponent
|
|
1183
|
-
vueComponent[lifecycle].bind(vueInstance
|
|
1216
|
+
if (vueComponent?.[lifecycle]) {
|
|
1217
|
+
vueComponent[lifecycle].bind(vueInstance?.value)();
|
|
1184
1218
|
}
|
|
1185
|
-
const instance = vueInstance
|
|
1186
|
-
if (instance
|
|
1219
|
+
const instance = vueInstance?.value;
|
|
1220
|
+
if (instance?.[lifecycle]) {
|
|
1187
1221
|
instance[lifecycle]();
|
|
1188
1222
|
}
|
|
1189
1223
|
/**
|
|
@@ -1237,7 +1271,13 @@ const injectHook = (lifecycleType, hook, component) => {
|
|
|
1237
1271
|
}
|
|
1238
1272
|
};
|
|
1239
1273
|
const createHook = (lifecycle) => {
|
|
1240
|
-
return (hook, target = getCurrentInstance()
|
|
1274
|
+
return (hook, target = getCurrentInstance()
|
|
1275
|
+
/**
|
|
1276
|
+
* `injectHook` returns undefined when called outside of `setup()`, but
|
|
1277
|
+
* that path only warns. Keep the published `Function` return so enabling
|
|
1278
|
+
* `strict` does not widen this to `Function | undefined` for consumers.
|
|
1279
|
+
*/
|
|
1280
|
+
) => injectHook(lifecycle, hook, target);
|
|
1241
1281
|
};
|
|
1242
1282
|
const onIonViewWillEnter = createHook(LifecycleHooks.WillEnter);
|
|
1243
1283
|
const onIonViewDidEnter = createHook(LifecycleHooks.DidEnter);
|
|
@@ -1285,7 +1325,7 @@ const IonBackButton = /*@__PURE__*/ defineComponent((_, { attrs, slots }) => {
|
|
|
1285
1325
|
defineCustomElement$1d();
|
|
1286
1326
|
// TODO(FW-2969): type
|
|
1287
1327
|
const ionRouter = inject("navManager");
|
|
1288
|
-
const onClick = () => {
|
|
1328
|
+
const onClick = (ev) => {
|
|
1289
1329
|
/**
|
|
1290
1330
|
* When using ion-back-button outside of
|
|
1291
1331
|
* a routing context, ionRouter is undefined.
|
|
@@ -1293,12 +1333,33 @@ const IonBackButton = /*@__PURE__*/ defineComponent((_, { attrs, slots }) => {
|
|
|
1293
1333
|
if (ionRouter === undefined) {
|
|
1294
1334
|
return;
|
|
1295
1335
|
}
|
|
1296
|
-
|
|
1336
|
+
/**
|
|
1337
|
+
* If ion-back-button is being used inside
|
|
1338
|
+
* of ion-nav (e.g. in a modal) then we should
|
|
1339
|
+
* not interact with the router. The core
|
|
1340
|
+
* ion-back-button component will handle the
|
|
1341
|
+
* nav.pop() in that case.
|
|
1342
|
+
*/
|
|
1343
|
+
const target = ev.target;
|
|
1344
|
+
if (target && target.closest("ion-nav") !== null) {
|
|
1345
|
+
return;
|
|
1346
|
+
}
|
|
1347
|
+
/**
|
|
1348
|
+
* Core resolves `backButtonDefaultHref` itself and only renders the
|
|
1349
|
+
* button once it has a href, so read the config here too or a
|
|
1350
|
+
* config-only back button would be visible but do nothing.
|
|
1351
|
+
*/
|
|
1352
|
+
const defaultHref = attrs["default-href"] ||
|
|
1353
|
+
attrs["defaultHref"] ||
|
|
1354
|
+
getConfig()?.get("backButtonDefaultHref");
|
|
1297
1355
|
const routerAnimation = attrs["router-animation"] || attrs["routerAnimation"];
|
|
1298
1356
|
ionRouter.handleNavigateBack(defaultHref, routerAnimation);
|
|
1299
1357
|
};
|
|
1300
1358
|
return () => {
|
|
1301
|
-
return h("ion-back-button",
|
|
1359
|
+
return h("ion-back-button", {
|
|
1360
|
+
onClick,
|
|
1361
|
+
...attrs,
|
|
1362
|
+
}, slots.default && slots.default());
|
|
1302
1363
|
};
|
|
1303
1364
|
}, {
|
|
1304
1365
|
name: "IonBackButton",
|
|
@@ -1307,7 +1368,6 @@ const IonBackButton = /*@__PURE__*/ defineComponent((_, { attrs, slots }) => {
|
|
|
1307
1368
|
const IonPage = /*@__PURE__*/ defineComponent({
|
|
1308
1369
|
name: "IonPage",
|
|
1309
1370
|
props: {
|
|
1310
|
-
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
1311
1371
|
registerIonPage: { type: Function, default: () => { } },
|
|
1312
1372
|
},
|
|
1313
1373
|
mounted() {
|
|
@@ -1315,7 +1375,11 @@ const IonPage = /*@__PURE__*/ defineComponent({
|
|
|
1315
1375
|
},
|
|
1316
1376
|
setup(_, { attrs, slots }) {
|
|
1317
1377
|
return () => {
|
|
1318
|
-
return h("div",
|
|
1378
|
+
return h("div", {
|
|
1379
|
+
...attrs,
|
|
1380
|
+
["class"]: "ion-page",
|
|
1381
|
+
ref: "ionPage",
|
|
1382
|
+
}, slots.default && slots.default());
|
|
1319
1383
|
};
|
|
1320
1384
|
},
|
|
1321
1385
|
});
|
|
@@ -1328,6 +1392,12 @@ const isViewVisible = (enteringEl) => {
|
|
|
1328
1392
|
const viewDepthKey = Symbol(0);
|
|
1329
1393
|
const IonRouterOutlet = /*@__PURE__*/ defineComponent({
|
|
1330
1394
|
name: "IonRouterOutlet",
|
|
1395
|
+
props: {
|
|
1396
|
+
swipeGesture: {
|
|
1397
|
+
type: Boolean,
|
|
1398
|
+
default: undefined,
|
|
1399
|
+
},
|
|
1400
|
+
},
|
|
1331
1401
|
setup() {
|
|
1332
1402
|
defineCustomElement$1e();
|
|
1333
1403
|
const injectedRoute = inject(routeLocationKey);
|
|
@@ -1342,6 +1412,7 @@ const IonRouterOutlet = /*@__PURE__*/ defineComponent({
|
|
|
1342
1412
|
const id = generateId("ion-router-outlet");
|
|
1343
1413
|
const ionRouter = inject("navManager");
|
|
1344
1414
|
const viewStacks = inject("viewStacks");
|
|
1415
|
+
// TODO(FW-2969): type
|
|
1345
1416
|
const components = shallowRef([]);
|
|
1346
1417
|
let skipTransition = false;
|
|
1347
1418
|
// The base url for this router outlet
|
|
@@ -1405,11 +1476,6 @@ const IonRouterOutlet = /*@__PURE__*/ defineComponent({
|
|
|
1405
1476
|
*/
|
|
1406
1477
|
{ deep: true });
|
|
1407
1478
|
const canStart = () => {
|
|
1408
|
-
const config = getConfig();
|
|
1409
|
-
const swipeEnabled = config &&
|
|
1410
|
-
config.get("swipeBackEnabled", ionRouterOutlet.value.mode === "ios");
|
|
1411
|
-
if (!swipeEnabled)
|
|
1412
|
-
return false;
|
|
1413
1479
|
const stack = viewStacks.getViewStack(id);
|
|
1414
1480
|
if (!stack || stack.length <= 1)
|
|
1415
1481
|
return false;
|
|
@@ -1544,12 +1610,12 @@ See https://ionicframework.com/docs/vue/navigation#ionpage for more information.
|
|
|
1544
1610
|
* going from a non-tabs page to a tabs page.
|
|
1545
1611
|
*/
|
|
1546
1612
|
if (isViewVisible(enteringEl) &&
|
|
1547
|
-
|
|
1613
|
+
leavingViewItem?.ionPageElement !== undefined &&
|
|
1548
1614
|
!isViewVisible(leavingViewItem.ionPageElement)) {
|
|
1549
1615
|
return;
|
|
1550
1616
|
}
|
|
1551
1617
|
fireLifecycle(enteringViewItem.vueComponent, enteringViewItem.vueComponentRef, LIFECYCLE_WILL_ENTER);
|
|
1552
|
-
if (
|
|
1618
|
+
if (leavingViewItem?.ionPageElement &&
|
|
1553
1619
|
enteringViewItem !== leavingViewItem) {
|
|
1554
1620
|
let animationBuilder = routerAnimation;
|
|
1555
1621
|
const leavingEl = leavingViewItem.ionPageElement;
|
|
@@ -1700,9 +1766,16 @@ See https://ionicframework.com/docs/vue/navigation#ionpage for more information.
|
|
|
1700
1766
|
},
|
|
1701
1767
|
render() {
|
|
1702
1768
|
const { components, registerIonPage, injectedRoute } = this;
|
|
1703
|
-
|
|
1769
|
+
/**
|
|
1770
|
+
* Forward props selectively to avoid setting undefined values
|
|
1771
|
+
* that would override the web component's config-based defaults.
|
|
1772
|
+
*/
|
|
1773
|
+
const routerOutletProps = { ref: "ionRouterOutlet" };
|
|
1774
|
+
if (this.$props.swipeGesture !== undefined) {
|
|
1775
|
+
routerOutletProps.swipeGesture = this.$props.swipeGesture;
|
|
1776
|
+
}
|
|
1777
|
+
return h("ion-router-outlet", routerOutletProps, components &&
|
|
1704
1778
|
components.map((c) => {
|
|
1705
|
-
var _a, _b;
|
|
1706
1779
|
let props = {
|
|
1707
1780
|
ref: c.vueComponentRef,
|
|
1708
1781
|
key: c.pathname,
|
|
@@ -1711,7 +1784,7 @@ See https://ionicframework.com/docs/vue/navigation#ionpage for more information.
|
|
|
1711
1784
|
/**
|
|
1712
1785
|
* IonRouterOutlet does not support named outlets.
|
|
1713
1786
|
*/
|
|
1714
|
-
const routePropsOption =
|
|
1787
|
+
const routePropsOption = c.matchedRoute?.props?.default;
|
|
1715
1788
|
/**
|
|
1716
1789
|
* Since IonRouterOutlet renders multiple components,
|
|
1717
1790
|
* each render will cause all props functions to be
|
|
@@ -1722,14 +1795,16 @@ See https://ionicframework.com/docs/vue/navigation#ionpage for more information.
|
|
|
1722
1795
|
* function is called again.
|
|
1723
1796
|
*/
|
|
1724
1797
|
const getPropsFunctionResult = () => {
|
|
1725
|
-
|
|
1726
|
-
const cachedPropsResult = (_a = c.vueComponentData) === null || _a === void 0 ? void 0 : _a.propsFunctionResult;
|
|
1798
|
+
const cachedPropsResult = c.vueComponentData?.propsFunctionResult;
|
|
1727
1799
|
if (cachedPropsResult) {
|
|
1728
1800
|
return cachedPropsResult;
|
|
1729
1801
|
}
|
|
1730
1802
|
else {
|
|
1731
1803
|
const propsFunctionResult = routePropsOption(injectedRoute);
|
|
1732
|
-
c.vueComponentData =
|
|
1804
|
+
c.vueComponentData = {
|
|
1805
|
+
...c.vueComponentData,
|
|
1806
|
+
propsFunctionResult,
|
|
1807
|
+
};
|
|
1733
1808
|
return propsFunctionResult;
|
|
1734
1809
|
}
|
|
1735
1810
|
};
|
|
@@ -1740,7 +1815,10 @@ See https://ionicframework.com/docs/vue/navigation#ionpage for more information.
|
|
|
1740
1815
|
? getPropsFunctionResult()
|
|
1741
1816
|
: routePropsOption
|
|
1742
1817
|
: null;
|
|
1743
|
-
props =
|
|
1818
|
+
props = {
|
|
1819
|
+
...props,
|
|
1820
|
+
...routeProps,
|
|
1821
|
+
};
|
|
1744
1822
|
return h(c.vueComponent, props);
|
|
1745
1823
|
}));
|
|
1746
1824
|
},
|
|
@@ -1785,7 +1863,7 @@ const IonTabButton = /*@__PURE__*/ defineComponent({
|
|
|
1785
1863
|
const { tab, href, _getTabState } = props;
|
|
1786
1864
|
const tabState = _getTabState();
|
|
1787
1865
|
const hasRouterOutlet = tabState.hasRouterOutlet;
|
|
1788
|
-
const tappedTab = tabState.tabs[tab] || {};
|
|
1866
|
+
const tappedTab = tabState.tabs[String(tab)] || {};
|
|
1789
1867
|
const originalHref = tappedTab.originalHref || href;
|
|
1790
1868
|
/**
|
|
1791
1869
|
* If the router outlet is not defined, then the tabs is being used
|
|
@@ -1814,7 +1892,7 @@ const IonTabButton = /*@__PURE__*/ defineComponent({
|
|
|
1814
1892
|
if (ionRouter !== null) {
|
|
1815
1893
|
if (prevActiveTab === tab) {
|
|
1816
1894
|
if (originalHref !== currentHref) {
|
|
1817
|
-
ionRouter.resetTab(tab);
|
|
1895
|
+
ionRouter.resetTab(tab, originalHref);
|
|
1818
1896
|
}
|
|
1819
1897
|
}
|
|
1820
1898
|
else {
|
|
@@ -1823,13 +1901,17 @@ const IonTabButton = /*@__PURE__*/ defineComponent({
|
|
|
1823
1901
|
}
|
|
1824
1902
|
};
|
|
1825
1903
|
return () => {
|
|
1826
|
-
return h("ion-tab-button",
|
|
1904
|
+
return h("ion-tab-button", {
|
|
1905
|
+
onClick,
|
|
1906
|
+
...props,
|
|
1907
|
+
}, slots.default && slots.default());
|
|
1827
1908
|
};
|
|
1828
1909
|
},
|
|
1829
1910
|
});
|
|
1830
1911
|
|
|
1831
1912
|
const WILL_CHANGE = "ionTabsWillChange";
|
|
1832
1913
|
const DID_CHANGE = "ionTabsDidChange";
|
|
1914
|
+
// TODO(FW-2969): types
|
|
1833
1915
|
/**
|
|
1834
1916
|
* Vue 3.2.38 fixed an issue where Web Component
|
|
1835
1917
|
* names are respected using kebab case instead of pascal case.
|
|
@@ -1850,7 +1932,8 @@ const isTab = (node) => {
|
|
|
1850
1932
|
}
|
|
1851
1933
|
return false; // In case the fragment has no children.
|
|
1852
1934
|
}
|
|
1853
|
-
return (node.type &&
|
|
1935
|
+
return (!!node.type &&
|
|
1936
|
+
(node.type.name === "ion-tab" || node.type === IonTab));
|
|
1854
1937
|
};
|
|
1855
1938
|
const IonTabs = /*@__PURE__*/ defineComponent({
|
|
1856
1939
|
name: "IonTabs",
|
|
@@ -1929,7 +2012,9 @@ const IonTabs = /*@__PURE__*/ defineComponent({
|
|
|
1929
2012
|
throw new Error("IonTabs cannot contain an IonRouterOutlet and IonTab at the same time.");
|
|
1930
2013
|
}
|
|
1931
2014
|
if (hasTab) {
|
|
1932
|
-
return h("ion-tabs",
|
|
2015
|
+
return h("ion-tabs", {
|
|
2016
|
+
...props,
|
|
2017
|
+
}, slottedContent);
|
|
1933
2018
|
}
|
|
1934
2019
|
/**
|
|
1935
2020
|
* TODO(ROU-11056)
|
|
@@ -1959,7 +2044,7 @@ const IonTabs = /*@__PURE__*/ defineComponent({
|
|
|
1959
2044
|
},
|
|
1960
2045
|
});
|
|
1961
2046
|
|
|
1962
|
-
const isTabButton = (child) =>
|
|
2047
|
+
const isTabButton = (child) => child.type?.name === "IonTabButton";
|
|
1963
2048
|
/**
|
|
1964
2049
|
* Checks if pathname matches the tab's href using path segment matching.
|
|
1965
2050
|
* Avoids false matches like /home2 matching /home by requiring exact match
|
|
@@ -2008,10 +2093,12 @@ const IonTabBar = defineComponent({
|
|
|
2008
2093
|
hasRouterOutlet: false,
|
|
2009
2094
|
},
|
|
2010
2095
|
tabVnodes: [],
|
|
2011
|
-
|
|
2012
|
-
|
|
2013
|
-
|
|
2014
|
-
|
|
2096
|
+
/**
|
|
2097
|
+
* No-ops until `mounted` swaps in IonTabs' emitters, if IonTabs is
|
|
2098
|
+
* present.
|
|
2099
|
+
*/
|
|
2100
|
+
_tabsWillChange: (() => { }),
|
|
2101
|
+
_tabsDidChange: (() => { }),
|
|
2015
2102
|
};
|
|
2016
2103
|
},
|
|
2017
2104
|
updated() {
|
|
@@ -2028,14 +2115,21 @@ const IonTabBar = defineComponent({
|
|
|
2028
2115
|
* show any child pages if necessary.
|
|
2029
2116
|
*/
|
|
2030
2117
|
const tabState = this.$data.tabState;
|
|
2031
|
-
const
|
|
2032
|
-
const tabs = (this.$data.tabVnodes = getTabs((currentInstance.subTree.children || [])));
|
|
2118
|
+
const tabs = (this.$data.tabVnodes = getTabs((this.$.subTree.children || [])));
|
|
2033
2119
|
tabs.forEach((child) => {
|
|
2034
|
-
|
|
2035
|
-
|
|
2036
|
-
|
|
2120
|
+
/**
|
|
2121
|
+
* `tab` may be undefined. `String()` keeps the key identical to the
|
|
2122
|
+
* one IonTabButton looks up.
|
|
2123
|
+
*/
|
|
2124
|
+
const childProps = child.props ?? {};
|
|
2125
|
+
tabState.tabs[String(childProps.tab)] = {
|
|
2126
|
+
originalHref: childProps.href,
|
|
2127
|
+
currentHref: childProps.href,
|
|
2037
2128
|
ref: child,
|
|
2038
2129
|
};
|
|
2130
|
+
if (!child.component) {
|
|
2131
|
+
return;
|
|
2132
|
+
}
|
|
2039
2133
|
/**
|
|
2040
2134
|
* Passing this prop to each tab button
|
|
2041
2135
|
* lets it be aware of the state that
|
|
@@ -2073,13 +2167,13 @@ const IonTabBar = defineComponent({
|
|
|
2073
2167
|
*/
|
|
2074
2168
|
checkActiveTab(ionRouter) {
|
|
2075
2169
|
const hasRouterOutlet = this.$data.tabState.hasRouterOutlet;
|
|
2076
|
-
const currentRoute = ionRouter
|
|
2170
|
+
const currentRoute = ionRouter?.getCurrentRouteInfo();
|
|
2077
2171
|
const childNodes = this.$data.tabVnodes;
|
|
2078
2172
|
const { tabs, activeTab: prevActiveTab } = this.$data.tabState;
|
|
2079
2173
|
const tabKeys = Object.keys(tabs);
|
|
2080
2174
|
let activeTab = tabKeys.find((key) => {
|
|
2081
2175
|
const href = tabs[key].originalHref;
|
|
2082
|
-
return (
|
|
2176
|
+
return (currentRoute?.pathname && matchesTab(currentRoute.pathname, href));
|
|
2083
2177
|
});
|
|
2084
2178
|
/**
|
|
2085
2179
|
* Tabs is being used as a basic tab navigation,
|
|
@@ -2095,42 +2189,54 @@ const IonTabBar = defineComponent({
|
|
|
2095
2189
|
* it in the tabs state.
|
|
2096
2190
|
*/
|
|
2097
2191
|
childNodes.forEach((child) => {
|
|
2098
|
-
const
|
|
2099
|
-
|
|
2100
|
-
|
|
2101
|
-
|
|
2102
|
-
|
|
2192
|
+
const childProps = child.props ?? {};
|
|
2193
|
+
const tab = tabs[String(childProps.tab)];
|
|
2194
|
+
if (!tab || tab.originalHref !== childProps.href) {
|
|
2195
|
+
tabs[String(childProps.tab)] = {
|
|
2196
|
+
originalHref: childProps.href,
|
|
2197
|
+
currentHref: childProps.href,
|
|
2103
2198
|
ref: child,
|
|
2104
2199
|
};
|
|
2105
2200
|
}
|
|
2106
2201
|
});
|
|
2107
|
-
if (activeTab &&
|
|
2108
|
-
const prevHref =
|
|
2202
|
+
if (activeTab && currentRoute?.pathname) {
|
|
2203
|
+
const prevHref = prevActiveTab
|
|
2204
|
+
? this.$data.tabState.tabs[prevActiveTab].currentHref
|
|
2205
|
+
: undefined;
|
|
2109
2206
|
/**
|
|
2110
2207
|
* If the tabs change or the url changes,
|
|
2111
2208
|
* update the currentHref for the active tab.
|
|
2112
|
-
* Ex: url changes from /tabs/tab1
|
|
2209
|
+
* Ex: url changes from /tabs/tab1 to /tabs/tab1/child.
|
|
2113
2210
|
* If we went to tab2 then back to tab1, we should
|
|
2114
2211
|
* land on /tabs/tab1/child instead of /tabs/tab1.
|
|
2212
|
+
*
|
|
2213
|
+
* Also runs on initial setup so a deep-loaded tab child
|
|
2214
|
+
* records its real pathname instead of `originalHref`.
|
|
2115
2215
|
*/
|
|
2116
|
-
if (activeTab !== prevActiveTab ||
|
|
2117
|
-
prevHref !== (currentRoute === null || currentRoute === void 0 ? void 0 : currentRoute.pathname)) {
|
|
2216
|
+
if (activeTab !== prevActiveTab || prevHref !== currentRoute.pathname) {
|
|
2118
2217
|
/**
|
|
2119
2218
|
* By default the search is `undefined` in Ionic Vue,
|
|
2120
2219
|
* but Vue Router can set the search to the empty string.
|
|
2121
2220
|
* We check for truthy here because empty string is falsy
|
|
2122
2221
|
* and currentRoute.search cannot ever be a boolean.
|
|
2123
2222
|
*/
|
|
2124
|
-
const search =
|
|
2125
|
-
tabs[activeTab] =
|
|
2223
|
+
const search = currentRoute.search ? `?${currentRoute.search}` : "";
|
|
2224
|
+
tabs[activeTab] = {
|
|
2225
|
+
...tabs[activeTab],
|
|
2226
|
+
currentHref: currentRoute.pathname + search,
|
|
2227
|
+
};
|
|
2126
2228
|
}
|
|
2127
2229
|
/**
|
|
2128
2230
|
* If navigating back and the tabs change,
|
|
2129
2231
|
* set the previous tab back to its original href.
|
|
2130
2232
|
*/
|
|
2131
|
-
if (
|
|
2233
|
+
if (prevActiveTab &&
|
|
2234
|
+
currentRoute.routerAction === "pop" &&
|
|
2132
2235
|
activeTab !== prevActiveTab) {
|
|
2133
|
-
tabs[prevActiveTab] =
|
|
2236
|
+
tabs[prevActiveTab] = {
|
|
2237
|
+
...tabs[prevActiveTab],
|
|
2238
|
+
currentHref: tabs[prevActiveTab].originalHref,
|
|
2239
|
+
};
|
|
2134
2240
|
}
|
|
2135
2241
|
}
|
|
2136
2242
|
this.tabSwitch(activeTab, ionRouter);
|
|
@@ -2144,7 +2250,7 @@ const IonTabBar = defineComponent({
|
|
|
2144
2250
|
const childNodes = this.$data.tabVnodes;
|
|
2145
2251
|
const { activeTab: prevActiveTab } = this.$data.tabState;
|
|
2146
2252
|
const tabState = this.$data.tabState;
|
|
2147
|
-
const activeChild = childNodes.find((child) =>
|
|
2253
|
+
const activeChild = childNodes.find((child) => isTabButton(child) && child.props?.tab === activeTab);
|
|
2148
2254
|
const tabBar = this.$refs.ionTabBar;
|
|
2149
2255
|
const tabDidChange = activeTab !== prevActiveTab;
|
|
2150
2256
|
if (tabBar) {
|
|
@@ -2176,12 +2282,14 @@ const IonTabBar = defineComponent({
|
|
|
2176
2282
|
* IonTabs. Instead, data will be passed through
|
|
2177
2283
|
* the provide/inject.
|
|
2178
2284
|
*/
|
|
2179
|
-
const tabBarData = inject("tabBarData");
|
|
2180
|
-
|
|
2181
|
-
|
|
2182
|
-
|
|
2285
|
+
const tabBarData = inject("tabBarData", null);
|
|
2286
|
+
if (tabBarData) {
|
|
2287
|
+
this.$data.tabState.hasRouterOutlet = tabBarData.value.hasRouterOutlet;
|
|
2288
|
+
this.$data._tabsWillChange = tabBarData.value._tabsWillChange;
|
|
2289
|
+
this.$data._tabsDidChange = tabBarData.value._tabsDidChange;
|
|
2290
|
+
}
|
|
2183
2291
|
this.setupTabState(ionRouter);
|
|
2184
|
-
ionRouter
|
|
2292
|
+
ionRouter?.registerHistoryChangeListener(() => this.checkActiveTab(ionRouter));
|
|
2185
2293
|
},
|
|
2186
2294
|
setup(_, { slots }) {
|
|
2187
2295
|
defineCustomElement$1h();
|
|
@@ -2195,7 +2303,10 @@ const userComponents = shallowRef([]);
|
|
|
2195
2303
|
const IonApp = /*@__PURE__*/ defineComponent((_, { attrs, slots }) => {
|
|
2196
2304
|
defineCustomElement$1i();
|
|
2197
2305
|
return () => {
|
|
2198
|
-
return h("ion-app",
|
|
2306
|
+
return h("ion-app", {
|
|
2307
|
+
name: "IonApp",
|
|
2308
|
+
...attrs,
|
|
2309
|
+
}, [slots.default && slots.default(), ...userComponents.value]);
|
|
2199
2310
|
};
|
|
2200
2311
|
}, {
|
|
2201
2312
|
name: "IonApp",
|
|
@@ -2225,7 +2336,7 @@ const VueDelegate = (addFn = addTeleportedUserComponent, removeFn = removeTelepo
|
|
|
2225
2336
|
const div = document.createElement("div");
|
|
2226
2337
|
classes && div.classList.add(...classes);
|
|
2227
2338
|
parentElement.appendChild(div);
|
|
2228
|
-
const hostComponent = h(Teleport, { to: div }, h(componentOrTagName,
|
|
2339
|
+
const hostComponent = h(Teleport, { to: div }, h(componentOrTagName, { ...componentProps }));
|
|
2229
2340
|
/**
|
|
2230
2341
|
* Ionic Framework will use what is returned from `attachViewToDom`
|
|
2231
2342
|
* as the `component` argument in `removeViewFromDom`.
|
|
@@ -2256,7 +2367,7 @@ const IonNav = /*@__PURE__*/ defineComponent((props) => {
|
|
|
2256
2367
|
const removeView = (component) => (views.value = views.value.filter((cmp) => cmp !== component));
|
|
2257
2368
|
const delegate = VueDelegate(addView, removeView);
|
|
2258
2369
|
return () => {
|
|
2259
|
-
return h("ion-nav",
|
|
2370
|
+
return h("ion-nav", { ...props, delegate }, views.value);
|
|
2260
2371
|
};
|
|
2261
2372
|
}, {
|
|
2262
2373
|
name: "IonNav",
|
|
@@ -2295,23 +2406,25 @@ const IonNav = /*@__PURE__*/ defineComponent((props) => {
|
|
|
2295
2406
|
const IonIcon = /*@__PURE__*/ defineComponent((props, { slots }) => {
|
|
2296
2407
|
defineCustomElement$1k();
|
|
2297
2408
|
return () => {
|
|
2298
|
-
var _a, _b;
|
|
2299
2409
|
const { icon, ios, md, mode } = props;
|
|
2300
2410
|
let iconToUse;
|
|
2301
2411
|
const config = getConfig();
|
|
2302
|
-
const iconMode = mode ||
|
|
2412
|
+
const iconMode = mode || config?.get("mode");
|
|
2303
2413
|
if (ios || md) {
|
|
2304
2414
|
if (iconMode === "ios") {
|
|
2305
|
-
iconToUse =
|
|
2415
|
+
iconToUse = ios ?? md ?? icon;
|
|
2306
2416
|
}
|
|
2307
2417
|
else {
|
|
2308
|
-
iconToUse =
|
|
2418
|
+
iconToUse = md ?? ios ?? icon;
|
|
2309
2419
|
}
|
|
2310
2420
|
}
|
|
2311
2421
|
else {
|
|
2312
2422
|
iconToUse = icon;
|
|
2313
2423
|
}
|
|
2314
|
-
return h("ion-icon",
|
|
2424
|
+
return h("ion-icon", {
|
|
2425
|
+
...props,
|
|
2426
|
+
icon: iconToUse,
|
|
2427
|
+
}, slots);
|
|
2315
2428
|
};
|
|
2316
2429
|
}, {
|
|
2317
2430
|
name: "IonIcon",
|
|
@@ -2376,7 +2489,6 @@ const defineOverlayContainer = (name, defineCustomElement, componentProps = [],
|
|
|
2376
2489
|
overlay.value = undefined;
|
|
2377
2490
|
};
|
|
2378
2491
|
const present = async (props) => {
|
|
2379
|
-
var _a;
|
|
2380
2492
|
/**
|
|
2381
2493
|
* Do not open another instance
|
|
2382
2494
|
* if one is already opened.
|
|
@@ -2384,7 +2496,7 @@ const defineOverlayContainer = (name, defineCustomElement, componentProps = [],
|
|
|
2384
2496
|
if (overlay.value) {
|
|
2385
2497
|
await overlay.value;
|
|
2386
2498
|
}
|
|
2387
|
-
if (
|
|
2499
|
+
if (overlay.value?.present) {
|
|
2388
2500
|
await overlay.value.present();
|
|
2389
2501
|
return;
|
|
2390
2502
|
}
|
|
@@ -2416,7 +2528,10 @@ const defineOverlayContainer = (name, defineCustomElement, componentProps = [],
|
|
|
2416
2528
|
delete restOfProps.onIonDragEnd;
|
|
2417
2529
|
}
|
|
2418
2530
|
const component = slots.default && slots.default()[0];
|
|
2419
|
-
overlay.value = controller.create(
|
|
2531
|
+
overlay.value = controller.create({
|
|
2532
|
+
...restOfProps,
|
|
2533
|
+
component,
|
|
2534
|
+
});
|
|
2420
2535
|
overlay.value = await overlay.value;
|
|
2421
2536
|
eventListeners.forEach((eventListener) => {
|
|
2422
2537
|
overlay.value.addEventListener(eventListener.componentEv, () => {
|
|
@@ -2511,7 +2626,7 @@ const defineOverlayContainer = (name, defineCustomElement, componentProps = [],
|
|
|
2511
2626
|
}
|
|
2512
2627
|
return slots;
|
|
2513
2628
|
};
|
|
2514
|
-
return h(name,
|
|
2629
|
+
return h(name, { ...restOfProps, ref: elementRef },
|
|
2515
2630
|
/**
|
|
2516
2631
|
* When binding keepContentsMounted as an attribute
|
|
2517
2632
|
* i.e. <ion-modal keep-contents-mounted></ion-modal>
|
|
@@ -2528,10 +2643,13 @@ const defineOverlayContainer = (name, defineCustomElement, componentProps = [],
|
|
|
2528
2643
|
};
|
|
2529
2644
|
const options = {
|
|
2530
2645
|
name,
|
|
2531
|
-
props:
|
|
2532
|
-
|
|
2533
|
-
|
|
2534
|
-
|
|
2646
|
+
props: {
|
|
2647
|
+
isOpen: DEFAULT_EMPTY_PROP,
|
|
2648
|
+
...componentProps.reduce((acc, prop) => {
|
|
2649
|
+
acc[prop] = DEFAULT_EMPTY_PROP;
|
|
2650
|
+
return acc;
|
|
2651
|
+
}, {}),
|
|
2652
|
+
},
|
|
2535
2653
|
emits: typeof controller !== "undefined"
|
|
2536
2654
|
? ["willPresent", "didPresent", "willDismiss", "didDismiss"]
|
|
2537
2655
|
: undefined,
|
|
@@ -2549,9 +2667,8 @@ const IonActionSheet = /*@__PURE__*/ defineOverlayContainer('ion-action-sheet',
|
|
|
2549
2667
|
const IonAlert = /*@__PURE__*/ defineOverlayContainer('ion-alert', defineCustomElement$1m, ['animated', 'backdropDismiss', 'buttons', 'cssClass', 'enterAnimation', 'header', 'htmlAttributes', 'inputs', 'isOpen', 'keyboardClose', 'leaveAnimation', 'message', 'mode', 'subHeader', 'translucent', 'trigger']);
|
|
2550
2668
|
const IonLoading = /*@__PURE__*/ defineOverlayContainer('ion-loading', defineCustomElement$1n, ['animated', 'backdropDismiss', 'cssClass', 'duration', 'enterAnimation', 'htmlAttributes', 'isOpen', 'keyboardClose', 'leaveAnimation', 'message', 'mode', 'showBackdrop', 'spinner', 'translucent', 'trigger']);
|
|
2551
2669
|
const IonModal = /*@__PURE__*/ defineOverlayContainer('ion-modal', defineCustomElement$1o, ['animated', 'backdropBreakpoint', 'backdropDismiss', 'breakpoints', 'canDismiss', 'enterAnimation', 'expandToScroll', 'focusTrap', 'handle', 'handleBehavior', 'htmlAttributes', 'initialBreakpoint', 'isOpen', 'keepContentsMounted', 'keyboardClose', 'leaveAnimation', 'mode', 'presentingElement', 'showBackdrop', 'trigger'], true);
|
|
2552
|
-
const
|
|
2553
|
-
const
|
|
2554
|
-
const IonToast = /*@__PURE__*/ defineOverlayContainer('ion-toast', defineCustomElement$1r, ['animated', 'buttons', 'color', 'cssClass', 'duration', 'enterAnimation', 'header', 'htmlAttributes', 'icon', 'isOpen', 'keyboardClose', 'layout', 'leaveAnimation', 'message', 'mode', 'position', 'positionAnchor', 'swipeGesture', 'translucent', 'trigger']);
|
|
2670
|
+
const IonPopover = /*@__PURE__*/ defineOverlayContainer('ion-popover', defineCustomElement$1p, ['alignment', 'animated', 'arrow', 'backdropDismiss', 'component', 'componentProps', 'dismissOnSelect', 'enterAnimation', 'event', 'focusTrap', 'htmlAttributes', 'isOpen', 'keepContentsMounted', 'keyboardClose', 'leaveAnimation', 'mode', 'reference', 'showBackdrop', 'side', 'size', 'translucent', 'trigger', 'triggerAction']);
|
|
2671
|
+
const IonToast = /*@__PURE__*/ defineOverlayContainer('ion-toast', defineCustomElement$1q, ['animated', 'buttons', 'color', 'cssClass', 'duration', 'enterAnimation', 'header', 'htmlAttributes', 'icon', 'isOpen', 'keyboardClose', 'layout', 'leaveAnimation', 'message', 'mode', 'position', 'positionAnchor', 'swipeGesture', 'translucent', 'trigger']);
|
|
2555
2672
|
|
|
2556
2673
|
// TODO(FW-2969): types
|
|
2557
2674
|
/**
|
|
@@ -2564,20 +2681,19 @@ const createController = (defineCustomElement, oldController, useDelegate = fals
|
|
|
2564
2681
|
const oldCreate = oldController.create.bind(oldController);
|
|
2565
2682
|
oldController.create = (options) => {
|
|
2566
2683
|
defineCustomElement();
|
|
2567
|
-
return oldCreate(
|
|
2684
|
+
return oldCreate({
|
|
2685
|
+
...options,
|
|
2686
|
+
delegate,
|
|
2687
|
+
});
|
|
2568
2688
|
};
|
|
2569
2689
|
return oldController;
|
|
2570
2690
|
};
|
|
2571
2691
|
const modalController = /*@__PURE__*/ createController(defineCustomElement$1o, modalController$1, true);
|
|
2572
|
-
const popoverController = /*@__PURE__*/ createController(defineCustomElement$
|
|
2692
|
+
const popoverController = /*@__PURE__*/ createController(defineCustomElement$1p, popoverController$1, true);
|
|
2573
2693
|
const alertController = /*@__PURE__*/ createController(defineCustomElement$1m, alertController$1);
|
|
2574
2694
|
const actionSheetController = /*@__PURE__*/ createController(defineCustomElement$1l, actionSheetController$1);
|
|
2575
2695
|
const loadingController = /*@__PURE__*/ createController(defineCustomElement$1n, loadingController$1);
|
|
2576
|
-
|
|
2577
|
-
* @deprecated Use the inline ion-picker component instead.
|
|
2578
|
-
*/
|
|
2579
|
-
const pickerController = /*@__PURE__*/ createController(defineCustomElement$1p, pickerController$1);
|
|
2580
|
-
const toastController = /*@__PURE__*/ createController(defineCustomElement$1r, toastController$1);
|
|
2696
|
+
const toastController = /*@__PURE__*/ createController(defineCustomElement$1q, toastController$1);
|
|
2581
2697
|
|
|
2582
|
-
export { IonAccordion, IonAccordionGroup, IonActionSheet, IonAlert, IonApp, IonAvatar, IonBackButton, IonBackdrop, IonBadge, IonBreadcrumb, IonBreadcrumbs, IonButton, IonButtons, IonCard, IonCardContent, IonCardHeader, IonCardSubtitle, IonCardTitle, IonCheckbox, IonChip, IonCol, IonContent, IonDatetime, IonDatetimeButton, IonFab, IonFabButton, IonFabList, IonFooter, IonGrid, IonHeader, IonIcon, IonImg, IonInfiniteScroll, IonInfiniteScrollContent, IonInput, IonInputOtp, IonInputPasswordToggle, IonItem, IonItemDivider, IonItemGroup, IonItemOption, IonItemOptions, IonItemSliding, IonLabel, IonList, IonListHeader, IonLoading, IonMenu, IonMenuButton, IonMenuToggle, IonModal, IonNav, IonNavLink, IonNote, IonPage, IonPicker, IonPickerColumn, IonPickerColumnOption,
|
|
2698
|
+
export { IonAccordion, IonAccordionGroup, IonActionSheet, IonAlert, IonApp, IonAvatar, IonBackButton, IonBackdrop, IonBadge, IonBreadcrumb, IonBreadcrumbs, IonButton, IonButtons, IonCard, IonCardContent, IonCardHeader, IonCardSubtitle, IonCardTitle, IonCheckbox, IonChip, IonCol, IonContent, IonDatetime, IonDatetimeButton, IonFab, IonFabButton, IonFabList, IonFooter, IonGrid, IonHeader, IonIcon, IonImg, IonInfiniteScroll, IonInfiniteScrollContent, IonInput, IonInputOtp, IonInputPasswordToggle, IonItem, IonItemDivider, IonItemGroup, IonItemOption, IonItemOptions, IonItemSliding, IonLabel, IonList, IonListHeader, IonLoading, IonMenu, IonMenuButton, IonMenuToggle, IonModal, IonNav, IonNavLink, IonNote, IonPage, IonPicker, IonPickerColumn, IonPickerColumnOption, IonPopover, IonProgressBar, IonRadio, IonRadioGroup, IonRange, IonRefresher, IonRefresherContent, IonReorder, IonReorderGroup, IonRippleEffect, IonRouterOutlet, IonRow, IonSearchbar, IonSegment, IonSegmentButton, IonSegmentContent, IonSegmentView, IonSelect, IonSelectModal, IonSelectOption, IonSkeletonText, IonSpinner, IonSplitPane, IonTab, IonTabBar, IonTabButton, IonTabs, IonText, IonTextarea, IonThumbnail, IonTitle, IonToast, IonToggle, IonToolbar, IonicVue, actionSheetController, alertController, loadingController, modalController, onIonViewDidEnter, onIonViewDidLeave, onIonViewWillEnter, onIonViewWillLeave, popoverController, toastController, useBackButton, useIonRouter, useKeyboard };
|
|
2583
2699
|
//# sourceMappingURL=index.js.map
|