@ionic/vue 8.8.18 → 8.8.19-dev.11786730389.1a1927bf
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 +225 -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
|
});
|
|
@@ -243,7 +258,7 @@ const defineContainer = (name, defineCustomElement, componentProps = [], emitPro
|
|
|
243
258
|
};
|
|
244
259
|
const propsToAdd = {
|
|
245
260
|
ref: containerRef,
|
|
246
|
-
class:
|
|
261
|
+
class: syncElementClasses(containerRef, classes),
|
|
247
262
|
onClick: handleClick,
|
|
248
263
|
};
|
|
249
264
|
/**
|
|
@@ -291,7 +306,8 @@ const defineContainer = (name, defineCustomElement, componentProps = [], emitPro
|
|
|
291
306
|
* vModelDirective is only needed on components that support v-model.
|
|
292
307
|
* As a result, we conditionally call withDirectives with v-model components.
|
|
293
308
|
*/
|
|
294
|
-
const
|
|
309
|
+
const tagName = transformTagFn ? transformTagFn(name) : name;
|
|
310
|
+
const node = h(tagName, propsToAdd, slots.default && slots.default());
|
|
295
311
|
return modelProp === undefined ? node : withDirectives(node, [[vModelDirective]]);
|
|
296
312
|
};
|
|
297
313
|
}, {
|
|
@@ -323,7 +339,7 @@ const IonAccordionGroup = /*@__PURE__*/ defineContainer('ion-accordion-group', d
|
|
|
323
339
|
], [
|
|
324
340
|
'ionChange',
|
|
325
341
|
'ionValueChange'
|
|
326
|
-
], 'value', '
|
|
342
|
+
], 'value', 'ionChange', undefined);
|
|
327
343
|
const IonAvatar = /*@__PURE__*/ defineContainer('ion-avatar', defineCustomElement$2);
|
|
328
344
|
const IonBackdrop = /*@__PURE__*/ defineContainer('ion-backdrop', defineCustomElement$3, [
|
|
329
345
|
'visible',
|
|
@@ -436,7 +452,7 @@ const IonCheckbox = /*@__PURE__*/ defineContainer('ion-checkbox', defineCustomEl
|
|
|
436
452
|
'ionChange',
|
|
437
453
|
'ionFocus',
|
|
438
454
|
'ionBlur'
|
|
439
|
-
], 'checked', '
|
|
455
|
+
], 'checked', 'ionChange', undefined);
|
|
440
456
|
const IonChip = /*@__PURE__*/ defineContainer('ion-chip', defineCustomElement$f, [
|
|
441
457
|
'color',
|
|
442
458
|
'outline',
|
|
@@ -531,7 +547,7 @@ const IonDatetime = /*@__PURE__*/ defineContainer('ion-datetime', defineCustomEl
|
|
|
531
547
|
'ionBlur',
|
|
532
548
|
'ionStyle',
|
|
533
549
|
'ionRender'
|
|
534
|
-
], 'value', '
|
|
550
|
+
], 'value', 'ionChange', undefined);
|
|
535
551
|
const IonDatetimeButton = /*@__PURE__*/ defineContainer('ion-datetime-button', defineCustomElement$j, [
|
|
536
552
|
'color',
|
|
537
553
|
'disabled',
|
|
@@ -647,7 +663,7 @@ const IonInput = /*@__PURE__*/ defineContainer('ion-input', defineCustomElement$
|
|
|
647
663
|
'ionChange',
|
|
648
664
|
'ionBlur',
|
|
649
665
|
'ionFocus'
|
|
650
|
-
], 'value', '
|
|
666
|
+
], 'value', 'ionInput', undefined);
|
|
651
667
|
const IonInputOtp = /*@__PURE__*/ defineContainer('ion-input-otp', defineCustomElement$u, [
|
|
652
668
|
'autocapitalize',
|
|
653
669
|
'color',
|
|
@@ -673,7 +689,7 @@ const IonInputOtp = /*@__PURE__*/ defineContainer('ion-input-otp', defineCustomE
|
|
|
673
689
|
'ionComplete',
|
|
674
690
|
'ionBlur',
|
|
675
691
|
'ionFocus'
|
|
676
|
-
], 'value', '
|
|
692
|
+
], 'value', 'ionInput', undefined);
|
|
677
693
|
const IonInputPasswordToggle = /*@__PURE__*/ defineContainer('ion-input-password-toggle', defineCustomElement$v, [
|
|
678
694
|
'color',
|
|
679
695
|
'showIcon',
|
|
@@ -818,7 +834,7 @@ const IonRadio = /*@__PURE__*/ defineContainer('ion-radio', defineCustomElement$
|
|
|
818
834
|
], [
|
|
819
835
|
'ionFocus',
|
|
820
836
|
'ionBlur'
|
|
821
|
-
], 'value', '
|
|
837
|
+
], 'value', 'ionChange', undefined);
|
|
822
838
|
const IonRadioGroup = /*@__PURE__*/ defineContainer('ion-radio-group', defineCustomElement$P, [
|
|
823
839
|
'allowEmptySelection',
|
|
824
840
|
'compareWith',
|
|
@@ -831,7 +847,7 @@ const IonRadioGroup = /*@__PURE__*/ defineContainer('ion-radio-group', defineCus
|
|
|
831
847
|
], [
|
|
832
848
|
'ionChange',
|
|
833
849
|
'ionValueChange'
|
|
834
|
-
], 'value', '
|
|
850
|
+
], 'value', 'ionChange', undefined);
|
|
835
851
|
const IonRange = /*@__PURE__*/ defineContainer('ion-range', defineCustomElement$Q, [
|
|
836
852
|
'color',
|
|
837
853
|
'debounce',
|
|
@@ -862,7 +878,7 @@ const IonRange = /*@__PURE__*/ defineContainer('ion-range', defineCustomElement$
|
|
|
862
878
|
'ionBlur',
|
|
863
879
|
'ionKnobMoveStart',
|
|
864
880
|
'ionKnobMoveEnd'
|
|
865
|
-
], 'value', '
|
|
881
|
+
], 'value', 'ionInput', undefined);
|
|
866
882
|
const IonRefresher = /*@__PURE__*/ defineContainer('ion-refresher', defineCustomElement$R, [
|
|
867
883
|
'pullMin',
|
|
868
884
|
'pullMax',
|
|
@@ -943,7 +959,7 @@ const IonSearchbar = /*@__PURE__*/ defineContainer('ion-searchbar', defineCustom
|
|
|
943
959
|
'ionBlur',
|
|
944
960
|
'ionFocus',
|
|
945
961
|
'ionStyle'
|
|
946
|
-
], 'value', '
|
|
962
|
+
], 'value', 'ionInput', undefined);
|
|
947
963
|
const IonSegment = /*@__PURE__*/ defineContainer('ion-segment', defineCustomElement$Y, [
|
|
948
964
|
'color',
|
|
949
965
|
'disabled',
|
|
@@ -958,14 +974,14 @@ const IonSegment = /*@__PURE__*/ defineContainer('ion-segment', defineCustomElem
|
|
|
958
974
|
'ionChange',
|
|
959
975
|
'ionSelect',
|
|
960
976
|
'ionStyle'
|
|
961
|
-
], 'value', '
|
|
977
|
+
], 'value', 'ionChange', undefined);
|
|
962
978
|
const IonSegmentButton = /*@__PURE__*/ defineContainer('ion-segment-button', defineCustomElement$Z, [
|
|
963
979
|
'contentId',
|
|
964
980
|
'disabled',
|
|
965
981
|
'layout',
|
|
966
982
|
'type',
|
|
967
983
|
'value'
|
|
968
|
-
], [], 'value', '
|
|
984
|
+
], [], 'value', 'ionChange', undefined);
|
|
969
985
|
const IonSegmentContent = /*@__PURE__*/ defineContainer('ion-segment-content', defineCustomElement$_);
|
|
970
986
|
const IonSegmentView = /*@__PURE__*/ defineContainer('ion-segment-view', defineCustomElement$$, [
|
|
971
987
|
'disabled',
|
|
@@ -1010,7 +1026,7 @@ const IonSelect = /*@__PURE__*/ defineContainer('ion-select', defineCustomElemen
|
|
|
1010
1026
|
'ionFocus',
|
|
1011
1027
|
'ionBlur',
|
|
1012
1028
|
'ionStyle'
|
|
1013
|
-
], 'value', '
|
|
1029
|
+
], 'value', 'ionChange', undefined);
|
|
1014
1030
|
const IonSelectModal = /*@__PURE__*/ defineContainer('ion-select-modal', defineCustomElement$11, [
|
|
1015
1031
|
'header',
|
|
1016
1032
|
'cancelText',
|
|
@@ -1019,7 +1035,10 @@ const IonSelectModal = /*@__PURE__*/ defineContainer('ion-select-modal', defineC
|
|
|
1019
1035
|
]);
|
|
1020
1036
|
const IonSelectOption = /*@__PURE__*/ defineContainer('ion-select-option', defineCustomElement$12, [
|
|
1021
1037
|
'disabled',
|
|
1022
|
-
'value'
|
|
1038
|
+
'value',
|
|
1039
|
+
'description',
|
|
1040
|
+
'labelPlacement',
|
|
1041
|
+
'justify'
|
|
1023
1042
|
]);
|
|
1024
1043
|
const IonSkeletonText = /*@__PURE__*/ defineContainer('ion-skeleton-text', defineCustomElement$13, [
|
|
1025
1044
|
'animated',
|
|
@@ -1088,7 +1107,7 @@ const IonTextarea = /*@__PURE__*/ defineContainer('ion-textarea', defineCustomEl
|
|
|
1088
1107
|
'ionInput',
|
|
1089
1108
|
'ionBlur',
|
|
1090
1109
|
'ionFocus'
|
|
1091
|
-
], 'value', '
|
|
1110
|
+
], 'value', 'ionInput', undefined);
|
|
1092
1111
|
const IonThumbnail = /*@__PURE__*/ defineContainer('ion-thumbnail', defineCustomElement$19);
|
|
1093
1112
|
const IonTitle = /*@__PURE__*/ defineContainer('ion-title', defineCustomElement$1a, [
|
|
1094
1113
|
'color',
|
|
@@ -1117,13 +1136,21 @@ const IonToggle = /*@__PURE__*/ defineContainer('ion-toggle', defineCustomElemen
|
|
|
1117
1136
|
'ionChange',
|
|
1118
1137
|
'ionFocus',
|
|
1119
1138
|
'ionBlur'
|
|
1120
|
-
], 'checked', '
|
|
1139
|
+
], 'checked', 'ionChange', undefined);
|
|
1121
1140
|
const IonToolbar = /*@__PURE__*/ defineContainer('ion-toolbar', defineCustomElement$1c, [
|
|
1122
1141
|
'color'
|
|
1123
1142
|
]);
|
|
1124
1143
|
|
|
1125
1144
|
const useBackButton = (priority, handler) => {
|
|
1126
|
-
|
|
1145
|
+
/**
|
|
1146
|
+
* `Handler` permits returning null, which core's public `register` type
|
|
1147
|
+
* does not accept, so normalize it rather than narrowing the public
|
|
1148
|
+
* `useBackButton` contract.
|
|
1149
|
+
*/
|
|
1150
|
+
const callback = (ev) => ev.detail.register(priority, (processNextHandler) => {
|
|
1151
|
+
const result = handler(processNextHandler);
|
|
1152
|
+
return result === null ? undefined : result;
|
|
1153
|
+
});
|
|
1127
1154
|
const unregister = () => document.removeEventListener("ionBackButton", callback);
|
|
1128
1155
|
document.addEventListener("ionBackButton", callback);
|
|
1129
1156
|
return { unregister };
|
|
@@ -1173,17 +1200,16 @@ const hookNames = {
|
|
|
1173
1200
|
};
|
|
1174
1201
|
const ids = { main: 0 };
|
|
1175
1202
|
const generateId = (type = "main") => {
|
|
1176
|
-
|
|
1177
|
-
const id = ((_a = ids[type]) !== null && _a !== void 0 ? _a : 0) + 1;
|
|
1203
|
+
const id = (ids[type] ?? 0) + 1;
|
|
1178
1204
|
ids[type] = id;
|
|
1179
1205
|
return id.toString();
|
|
1180
1206
|
};
|
|
1181
1207
|
const fireLifecycle = (vueComponent, vueInstance, lifecycle) => {
|
|
1182
|
-
if (vueComponent
|
|
1183
|
-
vueComponent[lifecycle].bind(vueInstance
|
|
1208
|
+
if (vueComponent?.[lifecycle]) {
|
|
1209
|
+
vueComponent[lifecycle].bind(vueInstance?.value)();
|
|
1184
1210
|
}
|
|
1185
|
-
const instance = vueInstance
|
|
1186
|
-
if (instance
|
|
1211
|
+
const instance = vueInstance?.value;
|
|
1212
|
+
if (instance?.[lifecycle]) {
|
|
1187
1213
|
instance[lifecycle]();
|
|
1188
1214
|
}
|
|
1189
1215
|
/**
|
|
@@ -1237,7 +1263,13 @@ const injectHook = (lifecycleType, hook, component) => {
|
|
|
1237
1263
|
}
|
|
1238
1264
|
};
|
|
1239
1265
|
const createHook = (lifecycle) => {
|
|
1240
|
-
return (hook, target = getCurrentInstance()
|
|
1266
|
+
return (hook, target = getCurrentInstance()
|
|
1267
|
+
/**
|
|
1268
|
+
* `injectHook` returns undefined when called outside of `setup()`, but
|
|
1269
|
+
* that path only warns. Keep the published `Function` return so enabling
|
|
1270
|
+
* `strict` does not widen this to `Function | undefined` for consumers.
|
|
1271
|
+
*/
|
|
1272
|
+
) => injectHook(lifecycle, hook, target);
|
|
1241
1273
|
};
|
|
1242
1274
|
const onIonViewWillEnter = createHook(LifecycleHooks.WillEnter);
|
|
1243
1275
|
const onIonViewDidEnter = createHook(LifecycleHooks.DidEnter);
|
|
@@ -1285,7 +1317,7 @@ const IonBackButton = /*@__PURE__*/ defineComponent((_, { attrs, slots }) => {
|
|
|
1285
1317
|
defineCustomElement$1d();
|
|
1286
1318
|
// TODO(FW-2969): type
|
|
1287
1319
|
const ionRouter = inject("navManager");
|
|
1288
|
-
const onClick = () => {
|
|
1320
|
+
const onClick = (ev) => {
|
|
1289
1321
|
/**
|
|
1290
1322
|
* When using ion-back-button outside of
|
|
1291
1323
|
* a routing context, ionRouter is undefined.
|
|
@@ -1293,12 +1325,33 @@ const IonBackButton = /*@__PURE__*/ defineComponent((_, { attrs, slots }) => {
|
|
|
1293
1325
|
if (ionRouter === undefined) {
|
|
1294
1326
|
return;
|
|
1295
1327
|
}
|
|
1296
|
-
|
|
1328
|
+
/**
|
|
1329
|
+
* If ion-back-button is being used inside
|
|
1330
|
+
* of ion-nav (e.g. in a modal) then we should
|
|
1331
|
+
* not interact with the router. The core
|
|
1332
|
+
* ion-back-button component will handle the
|
|
1333
|
+
* nav.pop() in that case.
|
|
1334
|
+
*/
|
|
1335
|
+
const target = ev.target;
|
|
1336
|
+
if (target && target.closest("ion-nav") !== null) {
|
|
1337
|
+
return;
|
|
1338
|
+
}
|
|
1339
|
+
/**
|
|
1340
|
+
* Core resolves `backButtonDefaultHref` itself and only renders the
|
|
1341
|
+
* button once it has a href, so read the config here too or a
|
|
1342
|
+
* config-only back button would be visible but do nothing.
|
|
1343
|
+
*/
|
|
1344
|
+
const defaultHref = attrs["default-href"] ||
|
|
1345
|
+
attrs["defaultHref"] ||
|
|
1346
|
+
getConfig()?.get("backButtonDefaultHref");
|
|
1297
1347
|
const routerAnimation = attrs["router-animation"] || attrs["routerAnimation"];
|
|
1298
1348
|
ionRouter.handleNavigateBack(defaultHref, routerAnimation);
|
|
1299
1349
|
};
|
|
1300
1350
|
return () => {
|
|
1301
|
-
return h("ion-back-button",
|
|
1351
|
+
return h("ion-back-button", {
|
|
1352
|
+
onClick,
|
|
1353
|
+
...attrs,
|
|
1354
|
+
}, slots.default && slots.default());
|
|
1302
1355
|
};
|
|
1303
1356
|
}, {
|
|
1304
1357
|
name: "IonBackButton",
|
|
@@ -1307,7 +1360,6 @@ const IonBackButton = /*@__PURE__*/ defineComponent((_, { attrs, slots }) => {
|
|
|
1307
1360
|
const IonPage = /*@__PURE__*/ defineComponent({
|
|
1308
1361
|
name: "IonPage",
|
|
1309
1362
|
props: {
|
|
1310
|
-
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
1311
1363
|
registerIonPage: { type: Function, default: () => { } },
|
|
1312
1364
|
},
|
|
1313
1365
|
mounted() {
|
|
@@ -1315,7 +1367,11 @@ const IonPage = /*@__PURE__*/ defineComponent({
|
|
|
1315
1367
|
},
|
|
1316
1368
|
setup(_, { attrs, slots }) {
|
|
1317
1369
|
return () => {
|
|
1318
|
-
return h("div",
|
|
1370
|
+
return h("div", {
|
|
1371
|
+
...attrs,
|
|
1372
|
+
["class"]: "ion-page",
|
|
1373
|
+
ref: "ionPage",
|
|
1374
|
+
}, slots.default && slots.default());
|
|
1319
1375
|
};
|
|
1320
1376
|
},
|
|
1321
1377
|
});
|
|
@@ -1328,6 +1384,12 @@ const isViewVisible = (enteringEl) => {
|
|
|
1328
1384
|
const viewDepthKey = Symbol(0);
|
|
1329
1385
|
const IonRouterOutlet = /*@__PURE__*/ defineComponent({
|
|
1330
1386
|
name: "IonRouterOutlet",
|
|
1387
|
+
props: {
|
|
1388
|
+
swipeGesture: {
|
|
1389
|
+
type: Boolean,
|
|
1390
|
+
default: undefined,
|
|
1391
|
+
},
|
|
1392
|
+
},
|
|
1331
1393
|
setup() {
|
|
1332
1394
|
defineCustomElement$1e();
|
|
1333
1395
|
const injectedRoute = inject(routeLocationKey);
|
|
@@ -1342,6 +1404,7 @@ const IonRouterOutlet = /*@__PURE__*/ defineComponent({
|
|
|
1342
1404
|
const id = generateId("ion-router-outlet");
|
|
1343
1405
|
const ionRouter = inject("navManager");
|
|
1344
1406
|
const viewStacks = inject("viewStacks");
|
|
1407
|
+
// TODO(FW-2969): type
|
|
1345
1408
|
const components = shallowRef([]);
|
|
1346
1409
|
let skipTransition = false;
|
|
1347
1410
|
// The base url for this router outlet
|
|
@@ -1405,11 +1468,6 @@ const IonRouterOutlet = /*@__PURE__*/ defineComponent({
|
|
|
1405
1468
|
*/
|
|
1406
1469
|
{ deep: true });
|
|
1407
1470
|
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
1471
|
const stack = viewStacks.getViewStack(id);
|
|
1414
1472
|
if (!stack || stack.length <= 1)
|
|
1415
1473
|
return false;
|
|
@@ -1544,12 +1602,12 @@ See https://ionicframework.com/docs/vue/navigation#ionpage for more information.
|
|
|
1544
1602
|
* going from a non-tabs page to a tabs page.
|
|
1545
1603
|
*/
|
|
1546
1604
|
if (isViewVisible(enteringEl) &&
|
|
1547
|
-
|
|
1605
|
+
leavingViewItem?.ionPageElement !== undefined &&
|
|
1548
1606
|
!isViewVisible(leavingViewItem.ionPageElement)) {
|
|
1549
1607
|
return;
|
|
1550
1608
|
}
|
|
1551
1609
|
fireLifecycle(enteringViewItem.vueComponent, enteringViewItem.vueComponentRef, LIFECYCLE_WILL_ENTER);
|
|
1552
|
-
if (
|
|
1610
|
+
if (leavingViewItem?.ionPageElement &&
|
|
1553
1611
|
enteringViewItem !== leavingViewItem) {
|
|
1554
1612
|
let animationBuilder = routerAnimation;
|
|
1555
1613
|
const leavingEl = leavingViewItem.ionPageElement;
|
|
@@ -1700,9 +1758,16 @@ See https://ionicframework.com/docs/vue/navigation#ionpage for more information.
|
|
|
1700
1758
|
},
|
|
1701
1759
|
render() {
|
|
1702
1760
|
const { components, registerIonPage, injectedRoute } = this;
|
|
1703
|
-
|
|
1761
|
+
/**
|
|
1762
|
+
* Forward props selectively to avoid setting undefined values
|
|
1763
|
+
* that would override the web component's config-based defaults.
|
|
1764
|
+
*/
|
|
1765
|
+
const routerOutletProps = { ref: "ionRouterOutlet" };
|
|
1766
|
+
if (this.$props.swipeGesture !== undefined) {
|
|
1767
|
+
routerOutletProps.swipeGesture = this.$props.swipeGesture;
|
|
1768
|
+
}
|
|
1769
|
+
return h("ion-router-outlet", routerOutletProps, components &&
|
|
1704
1770
|
components.map((c) => {
|
|
1705
|
-
var _a, _b;
|
|
1706
1771
|
let props = {
|
|
1707
1772
|
ref: c.vueComponentRef,
|
|
1708
1773
|
key: c.pathname,
|
|
@@ -1711,7 +1776,7 @@ See https://ionicframework.com/docs/vue/navigation#ionpage for more information.
|
|
|
1711
1776
|
/**
|
|
1712
1777
|
* IonRouterOutlet does not support named outlets.
|
|
1713
1778
|
*/
|
|
1714
|
-
const routePropsOption =
|
|
1779
|
+
const routePropsOption = c.matchedRoute?.props?.default;
|
|
1715
1780
|
/**
|
|
1716
1781
|
* Since IonRouterOutlet renders multiple components,
|
|
1717
1782
|
* each render will cause all props functions to be
|
|
@@ -1722,14 +1787,16 @@ See https://ionicframework.com/docs/vue/navigation#ionpage for more information.
|
|
|
1722
1787
|
* function is called again.
|
|
1723
1788
|
*/
|
|
1724
1789
|
const getPropsFunctionResult = () => {
|
|
1725
|
-
|
|
1726
|
-
const cachedPropsResult = (_a = c.vueComponentData) === null || _a === void 0 ? void 0 : _a.propsFunctionResult;
|
|
1790
|
+
const cachedPropsResult = c.vueComponentData?.propsFunctionResult;
|
|
1727
1791
|
if (cachedPropsResult) {
|
|
1728
1792
|
return cachedPropsResult;
|
|
1729
1793
|
}
|
|
1730
1794
|
else {
|
|
1731
1795
|
const propsFunctionResult = routePropsOption(injectedRoute);
|
|
1732
|
-
c.vueComponentData =
|
|
1796
|
+
c.vueComponentData = {
|
|
1797
|
+
...c.vueComponentData,
|
|
1798
|
+
propsFunctionResult,
|
|
1799
|
+
};
|
|
1733
1800
|
return propsFunctionResult;
|
|
1734
1801
|
}
|
|
1735
1802
|
};
|
|
@@ -1740,7 +1807,10 @@ See https://ionicframework.com/docs/vue/navigation#ionpage for more information.
|
|
|
1740
1807
|
? getPropsFunctionResult()
|
|
1741
1808
|
: routePropsOption
|
|
1742
1809
|
: null;
|
|
1743
|
-
props =
|
|
1810
|
+
props = {
|
|
1811
|
+
...props,
|
|
1812
|
+
...routeProps,
|
|
1813
|
+
};
|
|
1744
1814
|
return h(c.vueComponent, props);
|
|
1745
1815
|
}));
|
|
1746
1816
|
},
|
|
@@ -1785,7 +1855,7 @@ const IonTabButton = /*@__PURE__*/ defineComponent({
|
|
|
1785
1855
|
const { tab, href, _getTabState } = props;
|
|
1786
1856
|
const tabState = _getTabState();
|
|
1787
1857
|
const hasRouterOutlet = tabState.hasRouterOutlet;
|
|
1788
|
-
const tappedTab = tabState.tabs[tab] || {};
|
|
1858
|
+
const tappedTab = tabState.tabs[String(tab)] || {};
|
|
1789
1859
|
const originalHref = tappedTab.originalHref || href;
|
|
1790
1860
|
/**
|
|
1791
1861
|
* If the router outlet is not defined, then the tabs is being used
|
|
@@ -1814,7 +1884,7 @@ const IonTabButton = /*@__PURE__*/ defineComponent({
|
|
|
1814
1884
|
if (ionRouter !== null) {
|
|
1815
1885
|
if (prevActiveTab === tab) {
|
|
1816
1886
|
if (originalHref !== currentHref) {
|
|
1817
|
-
ionRouter.resetTab(tab);
|
|
1887
|
+
ionRouter.resetTab(tab, originalHref);
|
|
1818
1888
|
}
|
|
1819
1889
|
}
|
|
1820
1890
|
else {
|
|
@@ -1823,13 +1893,17 @@ const IonTabButton = /*@__PURE__*/ defineComponent({
|
|
|
1823
1893
|
}
|
|
1824
1894
|
};
|
|
1825
1895
|
return () => {
|
|
1826
|
-
return h("ion-tab-button",
|
|
1896
|
+
return h("ion-tab-button", {
|
|
1897
|
+
onClick,
|
|
1898
|
+
...props,
|
|
1899
|
+
}, slots.default && slots.default());
|
|
1827
1900
|
};
|
|
1828
1901
|
},
|
|
1829
1902
|
});
|
|
1830
1903
|
|
|
1831
1904
|
const WILL_CHANGE = "ionTabsWillChange";
|
|
1832
1905
|
const DID_CHANGE = "ionTabsDidChange";
|
|
1906
|
+
// TODO(FW-2969): types
|
|
1833
1907
|
/**
|
|
1834
1908
|
* Vue 3.2.38 fixed an issue where Web Component
|
|
1835
1909
|
* names are respected using kebab case instead of pascal case.
|
|
@@ -1850,7 +1924,8 @@ const isTab = (node) => {
|
|
|
1850
1924
|
}
|
|
1851
1925
|
return false; // In case the fragment has no children.
|
|
1852
1926
|
}
|
|
1853
|
-
return (node.type &&
|
|
1927
|
+
return (!!node.type &&
|
|
1928
|
+
(node.type.name === "ion-tab" || node.type === IonTab));
|
|
1854
1929
|
};
|
|
1855
1930
|
const IonTabs = /*@__PURE__*/ defineComponent({
|
|
1856
1931
|
name: "IonTabs",
|
|
@@ -1929,7 +2004,9 @@ const IonTabs = /*@__PURE__*/ defineComponent({
|
|
|
1929
2004
|
throw new Error("IonTabs cannot contain an IonRouterOutlet and IonTab at the same time.");
|
|
1930
2005
|
}
|
|
1931
2006
|
if (hasTab) {
|
|
1932
|
-
return h("ion-tabs",
|
|
2007
|
+
return h("ion-tabs", {
|
|
2008
|
+
...props,
|
|
2009
|
+
}, slottedContent);
|
|
1933
2010
|
}
|
|
1934
2011
|
/**
|
|
1935
2012
|
* TODO(ROU-11056)
|
|
@@ -1959,7 +2036,7 @@ const IonTabs = /*@__PURE__*/ defineComponent({
|
|
|
1959
2036
|
},
|
|
1960
2037
|
});
|
|
1961
2038
|
|
|
1962
|
-
const isTabButton = (child) =>
|
|
2039
|
+
const isTabButton = (child) => child.type?.name === "IonTabButton";
|
|
1963
2040
|
/**
|
|
1964
2041
|
* Checks if pathname matches the tab's href using path segment matching.
|
|
1965
2042
|
* Avoids false matches like /home2 matching /home by requiring exact match
|
|
@@ -2008,10 +2085,12 @@ const IonTabBar = defineComponent({
|
|
|
2008
2085
|
hasRouterOutlet: false,
|
|
2009
2086
|
},
|
|
2010
2087
|
tabVnodes: [],
|
|
2011
|
-
|
|
2012
|
-
|
|
2013
|
-
|
|
2014
|
-
|
|
2088
|
+
/**
|
|
2089
|
+
* No-ops until `mounted` swaps in IonTabs' emitters, if IonTabs is
|
|
2090
|
+
* present.
|
|
2091
|
+
*/
|
|
2092
|
+
_tabsWillChange: (() => { }),
|
|
2093
|
+
_tabsDidChange: (() => { }),
|
|
2015
2094
|
};
|
|
2016
2095
|
},
|
|
2017
2096
|
updated() {
|
|
@@ -2028,14 +2107,21 @@ const IonTabBar = defineComponent({
|
|
|
2028
2107
|
* show any child pages if necessary.
|
|
2029
2108
|
*/
|
|
2030
2109
|
const tabState = this.$data.tabState;
|
|
2031
|
-
const
|
|
2032
|
-
const tabs = (this.$data.tabVnodes = getTabs((currentInstance.subTree.children || [])));
|
|
2110
|
+
const tabs = (this.$data.tabVnodes = getTabs((this.$.subTree.children || [])));
|
|
2033
2111
|
tabs.forEach((child) => {
|
|
2034
|
-
|
|
2035
|
-
|
|
2036
|
-
|
|
2112
|
+
/**
|
|
2113
|
+
* `tab` may be undefined. `String()` keeps the key identical to the
|
|
2114
|
+
* one IonTabButton looks up.
|
|
2115
|
+
*/
|
|
2116
|
+
const childProps = child.props ?? {};
|
|
2117
|
+
tabState.tabs[String(childProps.tab)] = {
|
|
2118
|
+
originalHref: childProps.href,
|
|
2119
|
+
currentHref: childProps.href,
|
|
2037
2120
|
ref: child,
|
|
2038
2121
|
};
|
|
2122
|
+
if (!child.component) {
|
|
2123
|
+
return;
|
|
2124
|
+
}
|
|
2039
2125
|
/**
|
|
2040
2126
|
* Passing this prop to each tab button
|
|
2041
2127
|
* lets it be aware of the state that
|
|
@@ -2073,13 +2159,13 @@ const IonTabBar = defineComponent({
|
|
|
2073
2159
|
*/
|
|
2074
2160
|
checkActiveTab(ionRouter) {
|
|
2075
2161
|
const hasRouterOutlet = this.$data.tabState.hasRouterOutlet;
|
|
2076
|
-
const currentRoute = ionRouter
|
|
2162
|
+
const currentRoute = ionRouter?.getCurrentRouteInfo();
|
|
2077
2163
|
const childNodes = this.$data.tabVnodes;
|
|
2078
2164
|
const { tabs, activeTab: prevActiveTab } = this.$data.tabState;
|
|
2079
2165
|
const tabKeys = Object.keys(tabs);
|
|
2080
2166
|
let activeTab = tabKeys.find((key) => {
|
|
2081
2167
|
const href = tabs[key].originalHref;
|
|
2082
|
-
return (
|
|
2168
|
+
return (currentRoute?.pathname && matchesTab(currentRoute.pathname, href));
|
|
2083
2169
|
});
|
|
2084
2170
|
/**
|
|
2085
2171
|
* Tabs is being used as a basic tab navigation,
|
|
@@ -2095,42 +2181,54 @@ const IonTabBar = defineComponent({
|
|
|
2095
2181
|
* it in the tabs state.
|
|
2096
2182
|
*/
|
|
2097
2183
|
childNodes.forEach((child) => {
|
|
2098
|
-
const
|
|
2099
|
-
|
|
2100
|
-
|
|
2101
|
-
|
|
2102
|
-
|
|
2184
|
+
const childProps = child.props ?? {};
|
|
2185
|
+
const tab = tabs[String(childProps.tab)];
|
|
2186
|
+
if (!tab || tab.originalHref !== childProps.href) {
|
|
2187
|
+
tabs[String(childProps.tab)] = {
|
|
2188
|
+
originalHref: childProps.href,
|
|
2189
|
+
currentHref: childProps.href,
|
|
2103
2190
|
ref: child,
|
|
2104
2191
|
};
|
|
2105
2192
|
}
|
|
2106
2193
|
});
|
|
2107
|
-
if (activeTab &&
|
|
2108
|
-
const prevHref =
|
|
2194
|
+
if (activeTab && currentRoute?.pathname) {
|
|
2195
|
+
const prevHref = prevActiveTab
|
|
2196
|
+
? this.$data.tabState.tabs[prevActiveTab].currentHref
|
|
2197
|
+
: undefined;
|
|
2109
2198
|
/**
|
|
2110
2199
|
* If the tabs change or the url changes,
|
|
2111
2200
|
* update the currentHref for the active tab.
|
|
2112
|
-
* Ex: url changes from /tabs/tab1
|
|
2201
|
+
* Ex: url changes from /tabs/tab1 to /tabs/tab1/child.
|
|
2113
2202
|
* If we went to tab2 then back to tab1, we should
|
|
2114
2203
|
* land on /tabs/tab1/child instead of /tabs/tab1.
|
|
2204
|
+
*
|
|
2205
|
+
* Also runs on initial setup so a deep-loaded tab child
|
|
2206
|
+
* records its real pathname instead of `originalHref`.
|
|
2115
2207
|
*/
|
|
2116
|
-
if (activeTab !== prevActiveTab ||
|
|
2117
|
-
prevHref !== (currentRoute === null || currentRoute === void 0 ? void 0 : currentRoute.pathname)) {
|
|
2208
|
+
if (activeTab !== prevActiveTab || prevHref !== currentRoute.pathname) {
|
|
2118
2209
|
/**
|
|
2119
2210
|
* By default the search is `undefined` in Ionic Vue,
|
|
2120
2211
|
* but Vue Router can set the search to the empty string.
|
|
2121
2212
|
* We check for truthy here because empty string is falsy
|
|
2122
2213
|
* and currentRoute.search cannot ever be a boolean.
|
|
2123
2214
|
*/
|
|
2124
|
-
const search =
|
|
2125
|
-
tabs[activeTab] =
|
|
2215
|
+
const search = currentRoute.search ? `?${currentRoute.search}` : "";
|
|
2216
|
+
tabs[activeTab] = {
|
|
2217
|
+
...tabs[activeTab],
|
|
2218
|
+
currentHref: currentRoute.pathname + search,
|
|
2219
|
+
};
|
|
2126
2220
|
}
|
|
2127
2221
|
/**
|
|
2128
2222
|
* If navigating back and the tabs change,
|
|
2129
2223
|
* set the previous tab back to its original href.
|
|
2130
2224
|
*/
|
|
2131
|
-
if (
|
|
2225
|
+
if (prevActiveTab &&
|
|
2226
|
+
currentRoute.routerAction === "pop" &&
|
|
2132
2227
|
activeTab !== prevActiveTab) {
|
|
2133
|
-
tabs[prevActiveTab] =
|
|
2228
|
+
tabs[prevActiveTab] = {
|
|
2229
|
+
...tabs[prevActiveTab],
|
|
2230
|
+
currentHref: tabs[prevActiveTab].originalHref,
|
|
2231
|
+
};
|
|
2134
2232
|
}
|
|
2135
2233
|
}
|
|
2136
2234
|
this.tabSwitch(activeTab, ionRouter);
|
|
@@ -2144,7 +2242,7 @@ const IonTabBar = defineComponent({
|
|
|
2144
2242
|
const childNodes = this.$data.tabVnodes;
|
|
2145
2243
|
const { activeTab: prevActiveTab } = this.$data.tabState;
|
|
2146
2244
|
const tabState = this.$data.tabState;
|
|
2147
|
-
const activeChild = childNodes.find((child) =>
|
|
2245
|
+
const activeChild = childNodes.find((child) => isTabButton(child) && child.props?.tab === activeTab);
|
|
2148
2246
|
const tabBar = this.$refs.ionTabBar;
|
|
2149
2247
|
const tabDidChange = activeTab !== prevActiveTab;
|
|
2150
2248
|
if (tabBar) {
|
|
@@ -2176,12 +2274,14 @@ const IonTabBar = defineComponent({
|
|
|
2176
2274
|
* IonTabs. Instead, data will be passed through
|
|
2177
2275
|
* the provide/inject.
|
|
2178
2276
|
*/
|
|
2179
|
-
const tabBarData = inject("tabBarData");
|
|
2180
|
-
|
|
2181
|
-
|
|
2182
|
-
|
|
2277
|
+
const tabBarData = inject("tabBarData", null);
|
|
2278
|
+
if (tabBarData) {
|
|
2279
|
+
this.$data.tabState.hasRouterOutlet = tabBarData.value.hasRouterOutlet;
|
|
2280
|
+
this.$data._tabsWillChange = tabBarData.value._tabsWillChange;
|
|
2281
|
+
this.$data._tabsDidChange = tabBarData.value._tabsDidChange;
|
|
2282
|
+
}
|
|
2183
2283
|
this.setupTabState(ionRouter);
|
|
2184
|
-
ionRouter
|
|
2284
|
+
ionRouter?.registerHistoryChangeListener(() => this.checkActiveTab(ionRouter));
|
|
2185
2285
|
},
|
|
2186
2286
|
setup(_, { slots }) {
|
|
2187
2287
|
defineCustomElement$1h();
|
|
@@ -2195,7 +2295,10 @@ const userComponents = shallowRef([]);
|
|
|
2195
2295
|
const IonApp = /*@__PURE__*/ defineComponent((_, { attrs, slots }) => {
|
|
2196
2296
|
defineCustomElement$1i();
|
|
2197
2297
|
return () => {
|
|
2198
|
-
return h("ion-app",
|
|
2298
|
+
return h("ion-app", {
|
|
2299
|
+
name: "IonApp",
|
|
2300
|
+
...attrs,
|
|
2301
|
+
}, [slots.default && slots.default(), ...userComponents.value]);
|
|
2199
2302
|
};
|
|
2200
2303
|
}, {
|
|
2201
2304
|
name: "IonApp",
|
|
@@ -2225,7 +2328,7 @@ const VueDelegate = (addFn = addTeleportedUserComponent, removeFn = removeTelepo
|
|
|
2225
2328
|
const div = document.createElement("div");
|
|
2226
2329
|
classes && div.classList.add(...classes);
|
|
2227
2330
|
parentElement.appendChild(div);
|
|
2228
|
-
const hostComponent = h(Teleport, { to: div }, h(componentOrTagName,
|
|
2331
|
+
const hostComponent = h(Teleport, { to: div }, h(componentOrTagName, { ...componentProps }));
|
|
2229
2332
|
/**
|
|
2230
2333
|
* Ionic Framework will use what is returned from `attachViewToDom`
|
|
2231
2334
|
* as the `component` argument in `removeViewFromDom`.
|
|
@@ -2256,7 +2359,7 @@ const IonNav = /*@__PURE__*/ defineComponent((props) => {
|
|
|
2256
2359
|
const removeView = (component) => (views.value = views.value.filter((cmp) => cmp !== component));
|
|
2257
2360
|
const delegate = VueDelegate(addView, removeView);
|
|
2258
2361
|
return () => {
|
|
2259
|
-
return h("ion-nav",
|
|
2362
|
+
return h("ion-nav", { ...props, delegate }, views.value);
|
|
2260
2363
|
};
|
|
2261
2364
|
}, {
|
|
2262
2365
|
name: "IonNav",
|
|
@@ -2295,23 +2398,25 @@ const IonNav = /*@__PURE__*/ defineComponent((props) => {
|
|
|
2295
2398
|
const IonIcon = /*@__PURE__*/ defineComponent((props, { slots }) => {
|
|
2296
2399
|
defineCustomElement$1k();
|
|
2297
2400
|
return () => {
|
|
2298
|
-
var _a, _b;
|
|
2299
2401
|
const { icon, ios, md, mode } = props;
|
|
2300
2402
|
let iconToUse;
|
|
2301
2403
|
const config = getConfig();
|
|
2302
|
-
const iconMode = mode ||
|
|
2404
|
+
const iconMode = mode || config?.get("mode");
|
|
2303
2405
|
if (ios || md) {
|
|
2304
2406
|
if (iconMode === "ios") {
|
|
2305
|
-
iconToUse =
|
|
2407
|
+
iconToUse = ios ?? md ?? icon;
|
|
2306
2408
|
}
|
|
2307
2409
|
else {
|
|
2308
|
-
iconToUse =
|
|
2410
|
+
iconToUse = md ?? ios ?? icon;
|
|
2309
2411
|
}
|
|
2310
2412
|
}
|
|
2311
2413
|
else {
|
|
2312
2414
|
iconToUse = icon;
|
|
2313
2415
|
}
|
|
2314
|
-
return h("ion-icon",
|
|
2416
|
+
return h("ion-icon", {
|
|
2417
|
+
...props,
|
|
2418
|
+
icon: iconToUse,
|
|
2419
|
+
}, slots);
|
|
2315
2420
|
};
|
|
2316
2421
|
}, {
|
|
2317
2422
|
name: "IonIcon",
|
|
@@ -2376,7 +2481,6 @@ const defineOverlayContainer = (name, defineCustomElement, componentProps = [],
|
|
|
2376
2481
|
overlay.value = undefined;
|
|
2377
2482
|
};
|
|
2378
2483
|
const present = async (props) => {
|
|
2379
|
-
var _a;
|
|
2380
2484
|
/**
|
|
2381
2485
|
* Do not open another instance
|
|
2382
2486
|
* if one is already opened.
|
|
@@ -2384,7 +2488,7 @@ const defineOverlayContainer = (name, defineCustomElement, componentProps = [],
|
|
|
2384
2488
|
if (overlay.value) {
|
|
2385
2489
|
await overlay.value;
|
|
2386
2490
|
}
|
|
2387
|
-
if (
|
|
2491
|
+
if (overlay.value?.present) {
|
|
2388
2492
|
await overlay.value.present();
|
|
2389
2493
|
return;
|
|
2390
2494
|
}
|
|
@@ -2416,7 +2520,10 @@ const defineOverlayContainer = (name, defineCustomElement, componentProps = [],
|
|
|
2416
2520
|
delete restOfProps.onIonDragEnd;
|
|
2417
2521
|
}
|
|
2418
2522
|
const component = slots.default && slots.default()[0];
|
|
2419
|
-
overlay.value = controller.create(
|
|
2523
|
+
overlay.value = controller.create({
|
|
2524
|
+
...restOfProps,
|
|
2525
|
+
component,
|
|
2526
|
+
});
|
|
2420
2527
|
overlay.value = await overlay.value;
|
|
2421
2528
|
eventListeners.forEach((eventListener) => {
|
|
2422
2529
|
overlay.value.addEventListener(eventListener.componentEv, () => {
|
|
@@ -2511,7 +2618,7 @@ const defineOverlayContainer = (name, defineCustomElement, componentProps = [],
|
|
|
2511
2618
|
}
|
|
2512
2619
|
return slots;
|
|
2513
2620
|
};
|
|
2514
|
-
return h(name,
|
|
2621
|
+
return h(name, { ...restOfProps, ref: elementRef },
|
|
2515
2622
|
/**
|
|
2516
2623
|
* When binding keepContentsMounted as an attribute
|
|
2517
2624
|
* i.e. <ion-modal keep-contents-mounted></ion-modal>
|
|
@@ -2528,10 +2635,13 @@ const defineOverlayContainer = (name, defineCustomElement, componentProps = [],
|
|
|
2528
2635
|
};
|
|
2529
2636
|
const options = {
|
|
2530
2637
|
name,
|
|
2531
|
-
props:
|
|
2532
|
-
|
|
2533
|
-
|
|
2534
|
-
|
|
2638
|
+
props: {
|
|
2639
|
+
isOpen: DEFAULT_EMPTY_PROP,
|
|
2640
|
+
...componentProps.reduce((acc, prop) => {
|
|
2641
|
+
acc[prop] = DEFAULT_EMPTY_PROP;
|
|
2642
|
+
return acc;
|
|
2643
|
+
}, {}),
|
|
2644
|
+
},
|
|
2535
2645
|
emits: typeof controller !== "undefined"
|
|
2536
2646
|
? ["willPresent", "didPresent", "willDismiss", "didDismiss"]
|
|
2537
2647
|
: undefined,
|
|
@@ -2549,9 +2659,8 @@ const IonActionSheet = /*@__PURE__*/ defineOverlayContainer('ion-action-sheet',
|
|
|
2549
2659
|
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
2660
|
const IonLoading = /*@__PURE__*/ defineOverlayContainer('ion-loading', defineCustomElement$1n, ['animated', 'backdropDismiss', 'cssClass', 'duration', 'enterAnimation', 'htmlAttributes', 'isOpen', 'keyboardClose', 'leaveAnimation', 'message', 'mode', 'showBackdrop', 'spinner', 'translucent', 'trigger']);
|
|
2551
2661
|
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']);
|
|
2662
|
+
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']);
|
|
2663
|
+
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
2664
|
|
|
2556
2665
|
// TODO(FW-2969): types
|
|
2557
2666
|
/**
|
|
@@ -2564,20 +2673,19 @@ const createController = (defineCustomElement, oldController, useDelegate = fals
|
|
|
2564
2673
|
const oldCreate = oldController.create.bind(oldController);
|
|
2565
2674
|
oldController.create = (options) => {
|
|
2566
2675
|
defineCustomElement();
|
|
2567
|
-
return oldCreate(
|
|
2676
|
+
return oldCreate({
|
|
2677
|
+
...options,
|
|
2678
|
+
delegate,
|
|
2679
|
+
});
|
|
2568
2680
|
};
|
|
2569
2681
|
return oldController;
|
|
2570
2682
|
};
|
|
2571
2683
|
const modalController = /*@__PURE__*/ createController(defineCustomElement$1o, modalController$1, true);
|
|
2572
|
-
const popoverController = /*@__PURE__*/ createController(defineCustomElement$
|
|
2684
|
+
const popoverController = /*@__PURE__*/ createController(defineCustomElement$1p, popoverController$1, true);
|
|
2573
2685
|
const alertController = /*@__PURE__*/ createController(defineCustomElement$1m, alertController$1);
|
|
2574
2686
|
const actionSheetController = /*@__PURE__*/ createController(defineCustomElement$1l, actionSheetController$1);
|
|
2575
2687
|
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);
|
|
2688
|
+
const toastController = /*@__PURE__*/ createController(defineCustomElement$1q, toastController$1);
|
|
2581
2689
|
|
|
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,
|
|
2690
|
+
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
2691
|
//# sourceMappingURL=index.js.map
|