@ionic/vue 7.5.3-dev.11698858201.14165f23 → 7.5.3-dev.11699994454.1cbf1283

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.
Files changed (72) hide show
  1. package/dist/index.js +2114 -119
  2. package/dist/index.js.map +1 -7
  3. package/dist/types/components/IonApp.d.ts +16 -0
  4. package/dist/types/components/IonBackButton.d.ts +3 -0
  5. package/dist/types/components/IonIcon.d.ts +27 -0
  6. package/dist/types/components/IonNav.d.ts +4 -0
  7. package/dist/types/components/IonPage.d.ts +15 -0
  8. package/dist/types/components/IonRouterOutlet.d.ts +8 -0
  9. package/dist/types/components/IonTabBar.d.ts +34 -0
  10. package/dist/types/components/IonTabButton.d.ts +33 -0
  11. package/dist/types/components/IonTabs.d.ts +4 -0
  12. package/dist/types/components/Overlays.d.ts +28 -0
  13. package/dist/types/controllers.d.ts +36 -0
  14. package/dist/types/framework-delegate.d.ts +7 -0
  15. package/dist/types/globalExtensions.d.ts +9 -0
  16. package/dist/types/hooks/back-button.d.ts +6 -0
  17. package/dist/types/hooks/keyboard.d.ts +7 -0
  18. package/dist/types/hooks/lifecycle.d.ts +5 -0
  19. package/dist/types/hooks/router.d.ts +21 -0
  20. package/dist/types/index.d.ts +19 -0
  21. package/dist/types/ionic-vue.d.ts +2 -0
  22. package/dist/types/proxies.d.ts +84 -0
  23. package/dist/types/utils.d.ts +14 -0
  24. package/dist/types/vue-component-lib/overlays.d.ts +9 -0
  25. package/dist/types/vue-component-lib/utils.d.ts +20 -0
  26. package/dist/vetur/attributes.json +1 -1
  27. package/dist/web-types.json +2 -2
  28. package/package.json +9 -5
  29. package/dist/components/IonApp.js +0 -25
  30. package/dist/components/IonApp.js.map +0 -7
  31. package/dist/components/IonBackButton.js +0 -28
  32. package/dist/components/IonBackButton.js.map +0 -7
  33. package/dist/components/IonIcon.js +0 -45
  34. package/dist/components/IonIcon.js.map +0 -7
  35. package/dist/components/IonNav.js +0 -15
  36. package/dist/components/IonNav.js.map +0 -7
  37. package/dist/components/IonPage.js +0 -26
  38. package/dist/components/IonPage.js.map +0 -7
  39. package/dist/components/IonRouterOutlet.js +0 -336
  40. package/dist/components/IonRouterOutlet.js.map +0 -7
  41. package/dist/components/IonTabBar.js +0 -126
  42. package/dist/components/IonTabBar.js.map +0 -7
  43. package/dist/components/IonTabButton.js +0 -54
  44. package/dist/components/IonTabButton.js.map +0 -7
  45. package/dist/components/IonTabs.js +0 -77
  46. package/dist/components/IonTabs.js.map +0 -7
  47. package/dist/components/Overlays.js +0 -16
  48. package/dist/components/Overlays.js.map +0 -7
  49. package/dist/controllers.js +0 -69
  50. package/dist/controllers.js.map +0 -7
  51. package/dist/framework-delegate.js +0 -28
  52. package/dist/framework-delegate.js.map +0 -7
  53. package/dist/globalExtensions.js +0 -1
  54. package/dist/globalExtensions.js.map +0 -7
  55. package/dist/hooks/back-button.js +0 -7
  56. package/dist/hooks/back-button.js.map +0 -7
  57. package/dist/hooks/keyboard.js +0 -29
  58. package/dist/hooks/keyboard.js.map +0 -7
  59. package/dist/hooks/lifecycle.js +0 -31
  60. package/dist/hooks/lifecycle.js.map +0 -7
  61. package/dist/hooks/router.js +0 -20
  62. package/dist/hooks/router.js.map +0 -7
  63. package/dist/ionic-vue.js +0 -34
  64. package/dist/ionic-vue.js.map +0 -7
  65. package/dist/proxies.js +0 -796
  66. package/dist/proxies.js.map +0 -7
  67. package/dist/utils.js +0 -51
  68. package/dist/utils.js.map +0 -7
  69. package/dist/vue-component-lib/overlays.js +0 -142
  70. package/dist/vue-component-lib/overlays.js.map +0 -7
  71. package/dist/vue-component-lib/utils.js +0 -117
  72. package/dist/vue-component-lib/utils.js.map +0 -7
package/dist/index.js CHANGED
@@ -1,120 +1,2115 @@
1
- export * from "./proxies";
2
- export { UseBackButtonResult, useBackButton } from "./hooks/back-button";
3
- export { UseKeyboardResult, useKeyboard } from "./hooks/keyboard";
4
- export {
5
- onIonViewWillEnter,
6
- onIonViewDidEnter,
7
- onIonViewWillLeave,
8
- onIonViewDidLeave
9
- } from "./hooks/lifecycle";
10
- export { UseIonRouterResult, useIonRouter } from "./hooks/router";
11
- export { IonicVue } from "./ionic-vue";
12
- export { IonBackButton } from "./components/IonBackButton";
13
- export { IonPage } from "./components/IonPage";
14
- export { IonRouterOutlet } from "./components/IonRouterOutlet";
15
- export { IonTabButton } from "./components/IonTabButton";
16
- export { IonTabs } from "./components/IonTabs";
17
- export { IonTabBar } from "./components/IonTabBar";
18
- export { IonNav } from "./components/IonNav";
19
- export { IonIcon } from "./components/IonIcon";
20
- export { IonApp } from "./components/IonApp";
21
- export * from "./components/Overlays";
22
- export {
23
- modalController,
24
- popoverController,
25
- alertController,
26
- actionSheetController,
27
- loadingController,
28
- pickerController,
29
- toastController
30
- } from "./controllers";
31
- export * from "./globalExtensions";
32
- export {
33
- createAnimation,
34
- createGesture,
35
- iosTransitionAnimation,
36
- mdTransitionAnimation,
37
- IonicSlides,
38
- getPlatforms,
39
- isPlatform,
40
- menuController,
41
- getTimeGivenProgression,
42
- getIonPageElement,
43
- openURL,
44
- Animation,
45
- AnimationBuilder,
46
- AnimationCallbackOptions,
47
- AnimationDirection,
48
- AnimationFill,
49
- AnimationKeyFrames,
50
- AnimationLifecycle,
51
- Gesture,
52
- GestureConfig,
53
- GestureDetail,
54
- NavComponentWithProps,
55
- SpinnerTypes,
56
- AccordionGroupCustomEvent,
57
- AccordionGroupChangeEventDetail,
58
- BreadcrumbCustomEvent,
59
- BreadcrumbCollapsedClickEventDetail,
60
- ActionSheetOptions,
61
- ActionSheetButton,
62
- AlertOptions,
63
- AlertInput,
64
- AlertButton,
65
- BackButtonEvent,
66
- CheckboxCustomEvent,
67
- CheckboxChangeEventDetail,
68
- DatetimeCustomEvent,
69
- DatetimeChangeEventDetail,
70
- InfiniteScrollCustomEvent,
71
- InputCustomEvent,
72
- InputChangeEventDetail,
73
- ItemReorderEventDetail,
74
- ItemReorderCustomEvent,
75
- ItemSlidingCustomEvent,
76
- IonicSafeString,
77
- LoadingOptions,
78
- MenuCustomEvent,
79
- ModalOptions,
80
- NavCustomEvent,
81
- PickerOptions,
82
- PickerButton,
83
- PickerColumn,
84
- PickerColumnOption,
85
- Platforms,
86
- PlatformConfig,
87
- PopoverOptions,
88
- RadioGroupCustomEvent,
89
- RadioGroupChangeEventDetail,
90
- RangeCustomEvent,
91
- RangeChangeEventDetail,
92
- RangeKnobMoveStartEventDetail,
93
- RangeKnobMoveEndEventDetail,
94
- RefresherCustomEvent,
95
- RefresherEventDetail,
96
- RouterEventDetail,
97
- RouterCustomEvent,
98
- ScrollBaseCustomEvent,
99
- ScrollBaseDetail,
100
- ScrollDetail,
101
- ScrollCustomEvent,
102
- SearchbarCustomEvent,
103
- SearchbarChangeEventDetail,
104
- SearchbarInputEventDetail,
105
- SegmentChangeEventDetail,
106
- SegmentCustomEvent,
107
- SegmentValue,
108
- SelectChangeEventDetail,
109
- SelectCustomEvent,
110
- TabsCustomEvent,
111
- TextareaChangeEventDetail,
112
- TextareaCustomEvent,
113
- ToastOptions,
114
- ToastButton,
115
- ToastLayout,
116
- ToggleChangeEventDetail,
117
- ToggleCustomEvent,
118
- TransitionOptions
119
- } from "@ionic/core/components";
1
+ import { defineComponent, ref, getCurrentInstance, inject, h, computed, provide, shallowRef, watch, onUnmounted, Teleport, onMounted } from 'vue';
2
+ import { defineCustomElement } from '@ionic/core/components/ion-accordion.js';
3
+ import { defineCustomElement as defineCustomElement$1 } from '@ionic/core/components/ion-accordion-group.js';
4
+ import { defineCustomElement as defineCustomElement$2 } from '@ionic/core/components/ion-avatar.js';
5
+ import { defineCustomElement as defineCustomElement$3 } from '@ionic/core/components/ion-backdrop.js';
6
+ import { defineCustomElement as defineCustomElement$4 } from '@ionic/core/components/ion-badge.js';
7
+ import { defineCustomElement as defineCustomElement$5 } from '@ionic/core/components/ion-breadcrumb.js';
8
+ import { defineCustomElement as defineCustomElement$6 } from '@ionic/core/components/ion-breadcrumbs.js';
9
+ import { defineCustomElement as defineCustomElement$7 } from '@ionic/core/components/ion-button.js';
10
+ import { defineCustomElement as defineCustomElement$8 } from '@ionic/core/components/ion-buttons.js';
11
+ import { defineCustomElement as defineCustomElement$9 } from '@ionic/core/components/ion-card.js';
12
+ import { defineCustomElement as defineCustomElement$a } from '@ionic/core/components/ion-card-content.js';
13
+ import { defineCustomElement as defineCustomElement$b } from '@ionic/core/components/ion-card-header.js';
14
+ import { defineCustomElement as defineCustomElement$c } from '@ionic/core/components/ion-card-subtitle.js';
15
+ import { defineCustomElement as defineCustomElement$d } from '@ionic/core/components/ion-card-title.js';
16
+ import { defineCustomElement as defineCustomElement$e } from '@ionic/core/components/ion-checkbox.js';
17
+ import { defineCustomElement as defineCustomElement$f } from '@ionic/core/components/ion-chip.js';
18
+ import { defineCustomElement as defineCustomElement$g } from '@ionic/core/components/ion-col.js';
19
+ import { defineCustomElement as defineCustomElement$h } from '@ionic/core/components/ion-content.js';
20
+ import { defineCustomElement as defineCustomElement$i } from '@ionic/core/components/ion-datetime.js';
21
+ import { defineCustomElement as defineCustomElement$j } from '@ionic/core/components/ion-datetime-button.js';
22
+ import { defineCustomElement as defineCustomElement$k } from '@ionic/core/components/ion-fab.js';
23
+ import { defineCustomElement as defineCustomElement$l } from '@ionic/core/components/ion-fab-button.js';
24
+ import { defineCustomElement as defineCustomElement$m } from '@ionic/core/components/ion-fab-list.js';
25
+ import { defineCustomElement as defineCustomElement$n } from '@ionic/core/components/ion-footer.js';
26
+ import { defineCustomElement as defineCustomElement$o } from '@ionic/core/components/ion-grid.js';
27
+ import { defineCustomElement as defineCustomElement$p } from '@ionic/core/components/ion-header.js';
28
+ import { defineCustomElement as defineCustomElement$q } from '@ionic/core/components/ion-img.js';
29
+ import { defineCustomElement as defineCustomElement$r } from '@ionic/core/components/ion-infinite-scroll.js';
30
+ import { defineCustomElement as defineCustomElement$s } from '@ionic/core/components/ion-infinite-scroll-content.js';
31
+ import { defineCustomElement as defineCustomElement$t } from '@ionic/core/components/ion-input.js';
32
+ import { defineCustomElement as defineCustomElement$u } from '@ionic/core/components/ion-item.js';
33
+ import { defineCustomElement as defineCustomElement$v } from '@ionic/core/components/ion-item-divider.js';
34
+ import { defineCustomElement as defineCustomElement$w } from '@ionic/core/components/ion-item-group.js';
35
+ import { defineCustomElement as defineCustomElement$x } from '@ionic/core/components/ion-item-option.js';
36
+ import { defineCustomElement as defineCustomElement$y } from '@ionic/core/components/ion-item-options.js';
37
+ import { defineCustomElement as defineCustomElement$z } from '@ionic/core/components/ion-item-sliding.js';
38
+ import { defineCustomElement as defineCustomElement$A } from '@ionic/core/components/ion-label.js';
39
+ import { defineCustomElement as defineCustomElement$B } from '@ionic/core/components/ion-list.js';
40
+ import { defineCustomElement as defineCustomElement$C } from '@ionic/core/components/ion-list-header.js';
41
+ import { defineCustomElement as defineCustomElement$D } from '@ionic/core/components/ion-menu.js';
42
+ import { defineCustomElement as defineCustomElement$E } from '@ionic/core/components/ion-menu-button.js';
43
+ import { defineCustomElement as defineCustomElement$F } from '@ionic/core/components/ion-menu-toggle.js';
44
+ import { defineCustomElement as defineCustomElement$19 } from '@ionic/core/components/ion-nav.js';
45
+ import { defineCustomElement as defineCustomElement$G } from '@ionic/core/components/ion-nav-link.js';
46
+ import { defineCustomElement as defineCustomElement$H } from '@ionic/core/components/ion-note.js';
47
+ import { defineCustomElement as defineCustomElement$I } from '@ionic/core/components/ion-progress-bar.js';
48
+ import { defineCustomElement as defineCustomElement$J } from '@ionic/core/components/ion-radio.js';
49
+ import { defineCustomElement as defineCustomElement$K } from '@ionic/core/components/ion-radio-group.js';
50
+ import { defineCustomElement as defineCustomElement$L } from '@ionic/core/components/ion-range.js';
51
+ import { defineCustomElement as defineCustomElement$M } from '@ionic/core/components/ion-refresher.js';
52
+ import { defineCustomElement as defineCustomElement$N } from '@ionic/core/components/ion-refresher-content.js';
53
+ import { defineCustomElement as defineCustomElement$O } from '@ionic/core/components/ion-reorder.js';
54
+ import { defineCustomElement as defineCustomElement$P } from '@ionic/core/components/ion-reorder-group.js';
55
+ import { defineCustomElement as defineCustomElement$Q } from '@ionic/core/components/ion-ripple-effect.js';
56
+ import { defineCustomElement as defineCustomElement$R } from '@ionic/core/components/ion-row.js';
57
+ import { defineCustomElement as defineCustomElement$S } from '@ionic/core/components/ion-searchbar.js';
58
+ import { defineCustomElement as defineCustomElement$T } from '@ionic/core/components/ion-segment.js';
59
+ import { defineCustomElement as defineCustomElement$U } from '@ionic/core/components/ion-segment-button.js';
60
+ import { defineCustomElement as defineCustomElement$V } from '@ionic/core/components/ion-select.js';
61
+ import { defineCustomElement as defineCustomElement$W } from '@ionic/core/components/ion-select-option.js';
62
+ import { defineCustomElement as defineCustomElement$X } from '@ionic/core/components/ion-skeleton-text.js';
63
+ import { defineCustomElement as defineCustomElement$Y } from '@ionic/core/components/ion-spinner.js';
64
+ import { defineCustomElement as defineCustomElement$Z } from '@ionic/core/components/ion-split-pane.js';
65
+ import { defineCustomElement as defineCustomElement$_ } from '@ionic/core/components/ion-text.js';
66
+ import { defineCustomElement as defineCustomElement$$ } from '@ionic/core/components/ion-textarea.js';
67
+ import { defineCustomElement as defineCustomElement$10 } from '@ionic/core/components/ion-thumbnail.js';
68
+ import { defineCustomElement as defineCustomElement$11 } from '@ionic/core/components/ion-title.js';
69
+ import { defineCustomElement as defineCustomElement$12 } from '@ionic/core/components/ion-toggle.js';
70
+ import { defineCustomElement as defineCustomElement$13 } from '@ionic/core/components/ion-toolbar.js';
71
+ import { LIFECYCLE_WILL_ENTER, LIFECYCLE_DID_ENTER, LIFECYCLE_WILL_LEAVE, LIFECYCLE_DID_LEAVE, initialize, popoverController as popoverController$1, alertController as alertController$1, actionSheetController as actionSheetController$1, loadingController as loadingController$1, pickerController as pickerController$1, toastController as toastController$1, modalController as modalController$1 } from '@ionic/core/components';
72
+ export { IonicSafeString, IonicSlides, createAnimation, createGesture, getIonPageElement, getPlatforms, getTimeGivenProgression, iosTransitionAnimation, isPlatform, mdTransitionAnimation, menuController, openURL } from '@ionic/core/components';
73
+ import { defineCustomElement as defineCustomElement$14 } from '@ionic/core/components/ion-back-button.js';
74
+ import { defineCustomElement as defineCustomElement$15 } from '@ionic/core/components/ion-router-outlet.js';
75
+ import { routeLocationKey, useRoute, matchedRouteKey } from 'vue-router';
76
+ import { defineCustomElement as defineCustomElement$16 } from '@ionic/core/components/ion-tab-button.js';
77
+ import { defineCustomElement as defineCustomElement$17 } from '@ionic/core/components/ion-tab-bar.js';
78
+ import { defineCustomElement as defineCustomElement$18 } from '@ionic/core/components/ion-app.js';
79
+ import { defineCustomElement as defineCustomElement$1a } from 'ionicons/components/ion-icon.js';
80
+ import { defineCustomElement as defineCustomElement$1b } from '@ionic/core/components/ion-action-sheet.js';
81
+ import { defineCustomElement as defineCustomElement$1c } from '@ionic/core/components/ion-alert.js';
82
+ import { defineCustomElement as defineCustomElement$1d } from '@ionic/core/components/ion-loading.js';
83
+ import { defineCustomElement as defineCustomElement$1e } from '@ionic/core/components/ion-picker.js';
84
+ import { defineCustomElement as defineCustomElement$1f } from '@ionic/core/components/ion-toast.js';
85
+ import { defineCustomElement as defineCustomElement$1g } from '@ionic/core/components/ion-modal.js';
86
+ import { defineCustomElement as defineCustomElement$1h } from '@ionic/core/components/ion-popover.js';
87
+
88
+ // @ts-nocheck
89
+ const UPDATE_VALUE_EVENT = 'update:modelValue';
90
+ const MODEL_VALUE = 'modelValue';
91
+ const ROUTER_LINK_VALUE = 'routerLink';
92
+ const NAV_MANAGER = 'navManager';
93
+ const ROUTER_PROP_PREFIX = 'router';
94
+ const ARIA_PROP_PREFIX = 'aria';
95
+ /**
96
+ * Starting in Vue 3.1.0, all properties are
97
+ * added as keys to the props object, even if
98
+ * they are not being used. In order to correctly
99
+ * account for both value props and v-model props,
100
+ * we need to check if the key exists for Vue <3.1.0
101
+ * and then check if it is not undefined for Vue >= 3.1.0.
102
+ * See https://github.com/vuejs/vue-next/issues/3889
103
+ */
104
+ const EMPTY_PROP = Symbol();
105
+ const DEFAULT_EMPTY_PROP = { default: EMPTY_PROP };
106
+ const getComponentClasses = (classes) => {
107
+ return (classes === null || classes === void 0 ? void 0 : classes.split(' ')) || [];
108
+ };
109
+ const getElementClasses = (ref, componentClasses, defaultClasses = []) => {
110
+ var _a;
111
+ return [...Array.from(((_a = ref.value) === null || _a === void 0 ? void 0 : _a.classList) || []), ...defaultClasses].filter((c, i, self) => !componentClasses.has(c) && self.indexOf(c) === i);
112
+ };
113
+ /**
114
+ * Create a callback to define a Vue component wrapper around a Web Component.
115
+ *
116
+ * @prop name - The component tag name (i.e. `ion-button`)
117
+ * @prop componentProps - An array of properties on the
118
+ * component. These usually match up with the @Prop definitions
119
+ * in each component's TSX file.
120
+ * @prop customElement - An option custom element instance to pass
121
+ * to customElements.define. Only set if `includeImportCustomElements: true` in your config.
122
+ * @prop modelProp - The prop that v-model binds to (i.e. value)
123
+ * @prop modelUpdateEvent - The event that is fired from your Web Component when the value changes (i.e. ionChange)
124
+ * @prop externalModelUpdateEvent - The external event to fire from your Vue component when modelUpdateEvent fires. This is used for ensuring that v-model references have been
125
+ * correctly updated when a user's event callback fires.
126
+ */
127
+ const defineContainer = (name, defineCustomElement, componentProps = [], modelProp, modelUpdateEvent, externalModelUpdateEvent) => {
128
+ /**
129
+ * Create a Vue component wrapper around a Web Component.
130
+ * Note: The `props` here are not all properties on a component.
131
+ * They refer to whatever properties are set on an instance of a component.
132
+ */
133
+ if (defineCustomElement !== undefined) {
134
+ defineCustomElement();
135
+ }
136
+ const Container = defineComponent((props, { attrs, slots, emit }) => {
137
+ var _a;
138
+ let modelPropValue = props[modelProp];
139
+ const containerRef = ref();
140
+ const classes = new Set(getComponentClasses(attrs.class));
141
+ const onVnodeBeforeMount = (vnode) => {
142
+ // Add a listener to tell Vue to update the v-model
143
+ if (vnode.el) {
144
+ const eventsNames = Array.isArray(modelUpdateEvent) ? modelUpdateEvent : [modelUpdateEvent];
145
+ eventsNames.forEach((eventName) => {
146
+ vnode.el.addEventListener(eventName.toLowerCase(), (e) => {
147
+ modelPropValue = (e === null || e === void 0 ? void 0 : e.target)[modelProp];
148
+ emit(UPDATE_VALUE_EVENT, modelPropValue);
149
+ /**
150
+ * We need to emit the change event here
151
+ * rather than on the web component to ensure
152
+ * that any v-model bindings have been updated.
153
+ * Otherwise, the developer will listen on the
154
+ * native web component, but the v-model will
155
+ * not have been updated yet.
156
+ */
157
+ if (externalModelUpdateEvent) {
158
+ emit(externalModelUpdateEvent, e);
159
+ }
160
+ });
161
+ });
162
+ }
163
+ };
164
+ const currentInstance = getCurrentInstance();
165
+ const hasRouter = (_a = currentInstance === null || currentInstance === void 0 ? void 0 : currentInstance.appContext) === null || _a === void 0 ? void 0 : _a.provides[NAV_MANAGER];
166
+ const navManager = hasRouter ? inject(NAV_MANAGER) : undefined;
167
+ const handleRouterLink = (ev) => {
168
+ const { routerLink } = props;
169
+ if (routerLink === EMPTY_PROP)
170
+ return;
171
+ if (navManager !== undefined) {
172
+ let navigationPayload = { event: ev };
173
+ for (const key in props) {
174
+ const value = props[key];
175
+ if (props.hasOwnProperty(key) && key.startsWith(ROUTER_PROP_PREFIX) && value !== EMPTY_PROP) {
176
+ navigationPayload[key] = value;
177
+ }
178
+ }
179
+ navManager.navigate(navigationPayload);
180
+ }
181
+ else {
182
+ console.warn('Tried to navigate, but no router was found. Make sure you have mounted Vue Router.');
183
+ }
184
+ };
185
+ return () => {
186
+ modelPropValue = props[modelProp];
187
+ getComponentClasses(attrs.class).forEach((value) => {
188
+ classes.add(value);
189
+ });
190
+ const oldClick = props.onClick;
191
+ const handleClick = (ev) => {
192
+ if (oldClick !== undefined) {
193
+ oldClick(ev);
194
+ }
195
+ if (!ev.defaultPrevented) {
196
+ handleRouterLink(ev);
197
+ }
198
+ };
199
+ let propsToAdd = {
200
+ ref: containerRef,
201
+ class: getElementClasses(containerRef, classes),
202
+ onClick: handleClick,
203
+ onVnodeBeforeMount: modelUpdateEvent ? onVnodeBeforeMount : undefined,
204
+ };
205
+ /**
206
+ * We can use Object.entries here
207
+ * to avoid the hasOwnProperty check,
208
+ * but that would require 2 iterations
209
+ * where as this only requires 1.
210
+ */
211
+ for (const key in props) {
212
+ const value = props[key];
213
+ if ((props.hasOwnProperty(key) && value !== EMPTY_PROP) || key.startsWith(ARIA_PROP_PREFIX)) {
214
+ propsToAdd[key] = value;
215
+ }
216
+ }
217
+ if (modelProp) {
218
+ /**
219
+ * If form value property was set using v-model
220
+ * then we should use that value.
221
+ * Otherwise, check to see if form value property
222
+ * was set as a static value (i.e. no v-model).
223
+ */
224
+ if (props[MODEL_VALUE] !== EMPTY_PROP) {
225
+ propsToAdd = Object.assign(Object.assign({}, propsToAdd), { [modelProp]: props[MODEL_VALUE] });
226
+ }
227
+ else if (modelPropValue !== EMPTY_PROP) {
228
+ propsToAdd = Object.assign(Object.assign({}, propsToAdd), { [modelProp]: modelPropValue });
229
+ }
230
+ }
231
+ return h(name, propsToAdd, slots.default && slots.default());
232
+ };
233
+ });
234
+ if (typeof Container !== 'function') {
235
+ Container.name = name;
236
+ Container.props = {
237
+ [ROUTER_LINK_VALUE]: DEFAULT_EMPTY_PROP,
238
+ };
239
+ componentProps.forEach((componentProp) => {
240
+ Container.props[componentProp] = DEFAULT_EMPTY_PROP;
241
+ });
242
+ if (modelProp) {
243
+ Container.props[MODEL_VALUE] = DEFAULT_EMPTY_PROP;
244
+ Container.emits = [UPDATE_VALUE_EVENT, externalModelUpdateEvent];
245
+ }
246
+ }
247
+ return Container;
248
+ };
249
+
250
+ /* eslint-disable */
251
+ const IonAccordion = /*@__PURE__*/ defineContainer('ion-accordion', defineCustomElement, [
252
+ 'value',
253
+ 'disabled',
254
+ 'readonly',
255
+ 'toggleIcon',
256
+ 'toggleIconSlot'
257
+ ]);
258
+ const IonAccordionGroup = /*@__PURE__*/ defineContainer('ion-accordion-group', defineCustomElement$1, [
259
+ 'animated',
260
+ 'multiple',
261
+ 'value',
262
+ 'disabled',
263
+ 'readonly',
264
+ 'expand',
265
+ 'ionChange',
266
+ 'ionValueChange'
267
+ ], 'value', 'v-ion-change', 'ionChange');
268
+ const IonAvatar = /*@__PURE__*/ defineContainer('ion-avatar', defineCustomElement$2);
269
+ const IonBackdrop = /*@__PURE__*/ defineContainer('ion-backdrop', defineCustomElement$3, [
270
+ 'visible',
271
+ 'tappable',
272
+ 'stopPropagation',
273
+ 'ionBackdropTap'
274
+ ]);
275
+ const IonBadge = /*@__PURE__*/ defineContainer('ion-badge', defineCustomElement$4, [
276
+ 'color'
277
+ ]);
278
+ const IonBreadcrumb = /*@__PURE__*/ defineContainer('ion-breadcrumb', defineCustomElement$5, [
279
+ 'collapsed',
280
+ 'last',
281
+ 'showCollapsedIndicator',
282
+ 'color',
283
+ 'active',
284
+ 'disabled',
285
+ 'download',
286
+ 'href',
287
+ 'rel',
288
+ 'separator',
289
+ 'target',
290
+ 'routerDirection',
291
+ 'routerAnimation',
292
+ 'ionFocus',
293
+ 'ionBlur',
294
+ 'collapsedClick'
295
+ ]);
296
+ const IonBreadcrumbs = /*@__PURE__*/ defineContainer('ion-breadcrumbs', defineCustomElement$6, [
297
+ 'color',
298
+ 'maxItems',
299
+ 'itemsBeforeCollapse',
300
+ 'itemsAfterCollapse',
301
+ 'ionCollapsedClick'
302
+ ]);
303
+ const IonButton = /*@__PURE__*/ defineContainer('ion-button', defineCustomElement$7, [
304
+ 'color',
305
+ 'buttonType',
306
+ 'disabled',
307
+ 'expand',
308
+ 'fill',
309
+ 'routerDirection',
310
+ 'routerAnimation',
311
+ 'download',
312
+ 'href',
313
+ 'rel',
314
+ 'shape',
315
+ 'size',
316
+ 'strong',
317
+ 'target',
318
+ 'type',
319
+ 'form',
320
+ 'ionFocus',
321
+ 'ionBlur'
322
+ ]);
323
+ const IonButtons = /*@__PURE__*/ defineContainer('ion-buttons', defineCustomElement$8, [
324
+ 'collapse'
325
+ ]);
326
+ const IonCard = /*@__PURE__*/ defineContainer('ion-card', defineCustomElement$9, [
327
+ 'color',
328
+ 'button',
329
+ 'type',
330
+ 'disabled',
331
+ 'download',
332
+ 'href',
333
+ 'rel',
334
+ 'routerDirection',
335
+ 'routerAnimation',
336
+ 'target'
337
+ ]);
338
+ const IonCardContent = /*@__PURE__*/ defineContainer('ion-card-content', defineCustomElement$a);
339
+ const IonCardHeader = /*@__PURE__*/ defineContainer('ion-card-header', defineCustomElement$b, [
340
+ 'color',
341
+ 'translucent'
342
+ ]);
343
+ const IonCardSubtitle = /*@__PURE__*/ defineContainer('ion-card-subtitle', defineCustomElement$c, [
344
+ 'color'
345
+ ]);
346
+ const IonCardTitle = /*@__PURE__*/ defineContainer('ion-card-title', defineCustomElement$d, [
347
+ 'color'
348
+ ]);
349
+ const IonCheckbox = /*@__PURE__*/ defineContainer('ion-checkbox', defineCustomElement$e, [
350
+ 'color',
351
+ 'name',
352
+ 'checked',
353
+ 'indeterminate',
354
+ 'disabled',
355
+ 'value',
356
+ 'labelPlacement',
357
+ 'justify',
358
+ 'alignment',
359
+ 'legacy',
360
+ 'ionChange',
361
+ 'ionFocus',
362
+ 'ionBlur',
363
+ 'ionStyle'
364
+ ], 'checked', 'v-ion-change', 'ionChange');
365
+ const IonChip = /*@__PURE__*/ defineContainer('ion-chip', defineCustomElement$f, [
366
+ 'color',
367
+ 'outline',
368
+ 'disabled'
369
+ ]);
370
+ const IonCol = /*@__PURE__*/ defineContainer('ion-col', defineCustomElement$g, [
371
+ 'offset',
372
+ 'offsetXs',
373
+ 'offsetSm',
374
+ 'offsetMd',
375
+ 'offsetLg',
376
+ 'offsetXl',
377
+ 'pull',
378
+ 'pullXs',
379
+ 'pullSm',
380
+ 'pullMd',
381
+ 'pullLg',
382
+ 'pullXl',
383
+ 'push',
384
+ 'pushXs',
385
+ 'pushSm',
386
+ 'pushMd',
387
+ 'pushLg',
388
+ 'pushXl',
389
+ 'size',
390
+ 'sizeXs',
391
+ 'sizeSm',
392
+ 'sizeMd',
393
+ 'sizeLg',
394
+ 'sizeXl'
395
+ ]);
396
+ const IonContent = /*@__PURE__*/ defineContainer('ion-content', defineCustomElement$h, [
397
+ 'color',
398
+ 'fullscreen',
399
+ 'forceOverscroll',
400
+ 'scrollX',
401
+ 'scrollY',
402
+ 'scrollEvents',
403
+ 'ionScrollStart',
404
+ 'ionScroll',
405
+ 'ionScrollEnd'
406
+ ]);
407
+ const IonDatetime = /*@__PURE__*/ defineContainer('ion-datetime', defineCustomElement$i, [
408
+ 'color',
409
+ 'name',
410
+ 'disabled',
411
+ 'readonly',
412
+ 'isDateEnabled',
413
+ 'min',
414
+ 'max',
415
+ 'presentation',
416
+ 'cancelText',
417
+ 'doneText',
418
+ 'clearText',
419
+ 'yearValues',
420
+ 'monthValues',
421
+ 'dayValues',
422
+ 'hourValues',
423
+ 'minuteValues',
424
+ 'locale',
425
+ 'firstDayOfWeek',
426
+ 'titleSelectedDatesFormatter',
427
+ 'multiple',
428
+ 'highlightedDates',
429
+ 'value',
430
+ 'showDefaultTitle',
431
+ 'showDefaultButtons',
432
+ 'showClearButton',
433
+ 'showDefaultTimeLabel',
434
+ 'hourCycle',
435
+ 'size',
436
+ 'preferWheel',
437
+ 'ionCancel',
438
+ 'ionChange',
439
+ 'ionValueChange',
440
+ 'ionFocus',
441
+ 'ionBlur',
442
+ 'ionStyle',
443
+ 'ionRender'
444
+ ], 'value', 'v-ion-change', 'ionChange');
445
+ const IonDatetimeButton = /*@__PURE__*/ defineContainer('ion-datetime-button', defineCustomElement$j, [
446
+ 'color',
447
+ 'disabled',
448
+ 'datetime'
449
+ ]);
450
+ const IonFab = /*@__PURE__*/ defineContainer('ion-fab', defineCustomElement$k, [
451
+ 'horizontal',
452
+ 'vertical',
453
+ 'edge',
454
+ 'activated'
455
+ ]);
456
+ const IonFabButton = /*@__PURE__*/ defineContainer('ion-fab-button', defineCustomElement$l, [
457
+ 'color',
458
+ 'activated',
459
+ 'disabled',
460
+ 'download',
461
+ 'href',
462
+ 'rel',
463
+ 'routerDirection',
464
+ 'routerAnimation',
465
+ 'target',
466
+ 'show',
467
+ 'translucent',
468
+ 'type',
469
+ 'size',
470
+ 'closeIcon',
471
+ 'ionFocus',
472
+ 'ionBlur'
473
+ ]);
474
+ const IonFabList = /*@__PURE__*/ defineContainer('ion-fab-list', defineCustomElement$m, [
475
+ 'activated',
476
+ 'side'
477
+ ]);
478
+ const IonFooter = /*@__PURE__*/ defineContainer('ion-footer', defineCustomElement$n, [
479
+ 'collapse',
480
+ 'translucent'
481
+ ]);
482
+ const IonGrid = /*@__PURE__*/ defineContainer('ion-grid', defineCustomElement$o, [
483
+ 'fixed'
484
+ ]);
485
+ const IonHeader = /*@__PURE__*/ defineContainer('ion-header', defineCustomElement$p, [
486
+ 'collapse',
487
+ 'translucent'
488
+ ]);
489
+ const IonImg = /*@__PURE__*/ defineContainer('ion-img', defineCustomElement$q, [
490
+ 'alt',
491
+ 'src',
492
+ 'ionImgWillLoad',
493
+ 'ionImgDidLoad',
494
+ 'ionError'
495
+ ]);
496
+ const IonInfiniteScroll = /*@__PURE__*/ defineContainer('ion-infinite-scroll', defineCustomElement$r, [
497
+ 'threshold',
498
+ 'disabled',
499
+ 'position',
500
+ 'ionInfinite'
501
+ ]);
502
+ const IonInfiniteScrollContent = /*@__PURE__*/ defineContainer('ion-infinite-scroll-content', defineCustomElement$s, [
503
+ 'loadingSpinner',
504
+ 'loadingText'
505
+ ]);
506
+ const IonInput = /*@__PURE__*/ defineContainer('ion-input', defineCustomElement$t, [
507
+ 'color',
508
+ 'accept',
509
+ 'autocapitalize',
510
+ 'autocomplete',
511
+ 'autocorrect',
512
+ 'autofocus',
513
+ 'clearInput',
514
+ 'clearOnEdit',
515
+ 'counter',
516
+ 'counterFormatter',
517
+ 'debounce',
518
+ 'disabled',
519
+ 'enterkeyhint',
520
+ 'errorText',
521
+ 'fill',
522
+ 'inputmode',
523
+ 'helperText',
524
+ 'label',
525
+ 'labelPlacement',
526
+ 'legacy',
527
+ 'max',
528
+ 'maxlength',
529
+ 'min',
530
+ 'minlength',
531
+ 'multiple',
532
+ 'name',
533
+ 'pattern',
534
+ 'placeholder',
535
+ 'readonly',
536
+ 'required',
537
+ 'shape',
538
+ 'spellcheck',
539
+ 'step',
540
+ 'size',
541
+ 'type',
542
+ 'value',
543
+ 'ionInput',
544
+ 'ionChange',
545
+ 'ionBlur',
546
+ 'ionFocus',
547
+ 'ionStyle'
548
+ ], 'value', 'v-ion-input', 'ionInput');
549
+ const IonItem = /*@__PURE__*/ defineContainer('ion-item', defineCustomElement$u, [
550
+ 'color',
551
+ 'button',
552
+ 'detail',
553
+ 'detailIcon',
554
+ 'disabled',
555
+ 'download',
556
+ 'fill',
557
+ 'shape',
558
+ 'href',
559
+ 'rel',
560
+ 'lines',
561
+ 'counter',
562
+ 'routerAnimation',
563
+ 'routerDirection',
564
+ 'target',
565
+ 'type',
566
+ 'counterFormatter'
567
+ ]);
568
+ const IonItemDivider = /*@__PURE__*/ defineContainer('ion-item-divider', defineCustomElement$v, [
569
+ 'color',
570
+ 'sticky'
571
+ ]);
572
+ const IonItemGroup = /*@__PURE__*/ defineContainer('ion-item-group', defineCustomElement$w);
573
+ const IonItemOption = /*@__PURE__*/ defineContainer('ion-item-option', defineCustomElement$x, [
574
+ 'color',
575
+ 'disabled',
576
+ 'download',
577
+ 'expandable',
578
+ 'href',
579
+ 'rel',
580
+ 'target',
581
+ 'type'
582
+ ]);
583
+ const IonItemOptions = /*@__PURE__*/ defineContainer('ion-item-options', defineCustomElement$y, [
584
+ 'side',
585
+ 'ionSwipe'
586
+ ]);
587
+ const IonItemSliding = /*@__PURE__*/ defineContainer('ion-item-sliding', defineCustomElement$z, [
588
+ 'disabled',
589
+ 'ionDrag'
590
+ ]);
591
+ const IonLabel = /*@__PURE__*/ defineContainer('ion-label', defineCustomElement$A, [
592
+ 'color',
593
+ 'position',
594
+ 'ionColor',
595
+ 'ionStyle'
596
+ ]);
597
+ const IonList = /*@__PURE__*/ defineContainer('ion-list', defineCustomElement$B, [
598
+ 'lines',
599
+ 'inset'
600
+ ]);
601
+ const IonListHeader = /*@__PURE__*/ defineContainer('ion-list-header', defineCustomElement$C, [
602
+ 'color',
603
+ 'lines'
604
+ ]);
605
+ const IonMenu = /*@__PURE__*/ defineContainer('ion-menu', defineCustomElement$D, [
606
+ 'contentId',
607
+ 'menuId',
608
+ 'type',
609
+ 'disabled',
610
+ 'side',
611
+ 'swipeGesture',
612
+ 'maxEdgeStart',
613
+ 'ionWillOpen',
614
+ 'ionWillClose',
615
+ 'ionDidOpen',
616
+ 'ionDidClose',
617
+ 'ionMenuChange'
618
+ ]);
619
+ const IonMenuButton = /*@__PURE__*/ defineContainer('ion-menu-button', defineCustomElement$E, [
620
+ 'color',
621
+ 'disabled',
622
+ 'menu',
623
+ 'autoHide',
624
+ 'type'
625
+ ]);
626
+ const IonMenuToggle = /*@__PURE__*/ defineContainer('ion-menu-toggle', defineCustomElement$F, [
627
+ 'menu',
628
+ 'autoHide'
629
+ ]);
630
+ const IonNavLink = /*@__PURE__*/ defineContainer('ion-nav-link', defineCustomElement$G, [
631
+ 'component',
632
+ 'componentProps',
633
+ 'routerDirection',
634
+ 'routerAnimation'
635
+ ]);
636
+ const IonNote = /*@__PURE__*/ defineContainer('ion-note', defineCustomElement$H, [
637
+ 'color'
638
+ ]);
639
+ const IonProgressBar = /*@__PURE__*/ defineContainer('ion-progress-bar', defineCustomElement$I, [
640
+ 'type',
641
+ 'reversed',
642
+ 'value',
643
+ 'buffer',
644
+ 'color'
645
+ ]);
646
+ const IonRadio = /*@__PURE__*/ defineContainer('ion-radio', defineCustomElement$J, [
647
+ 'color',
648
+ 'name',
649
+ 'disabled',
650
+ 'value',
651
+ 'labelPlacement',
652
+ 'legacy',
653
+ 'justify',
654
+ 'alignment',
655
+ 'ionStyle',
656
+ 'ionFocus',
657
+ 'ionBlur'
658
+ ], 'value', 'v-ion-change', 'ionChange');
659
+ const IonRadioGroup = /*@__PURE__*/ defineContainer('ion-radio-group', defineCustomElement$K, [
660
+ 'allowEmptySelection',
661
+ 'name',
662
+ 'value',
663
+ 'ionChange',
664
+ 'ionValueChange'
665
+ ], 'value', 'v-ion-change', 'ionChange');
666
+ const IonRange = /*@__PURE__*/ defineContainer('ion-range', defineCustomElement$L, [
667
+ 'color',
668
+ 'debounce',
669
+ 'name',
670
+ 'label',
671
+ 'dualKnobs',
672
+ 'min',
673
+ 'max',
674
+ 'pin',
675
+ 'pinFormatter',
676
+ 'snaps',
677
+ 'step',
678
+ 'ticks',
679
+ 'activeBarStart',
680
+ 'disabled',
681
+ 'value',
682
+ 'labelPlacement',
683
+ 'legacy',
684
+ 'ionChange',
685
+ 'ionInput',
686
+ 'ionStyle',
687
+ 'ionFocus',
688
+ 'ionBlur',
689
+ 'ionKnobMoveStart',
690
+ 'ionKnobMoveEnd'
691
+ ], 'value', 'v-ion-change', 'ionChange');
692
+ const IonRefresher = /*@__PURE__*/ defineContainer('ion-refresher', defineCustomElement$M, [
693
+ 'pullMin',
694
+ 'pullMax',
695
+ 'closeDuration',
696
+ 'snapbackDuration',
697
+ 'pullFactor',
698
+ 'disabled',
699
+ 'ionRefresh',
700
+ 'ionPull',
701
+ 'ionStart'
702
+ ]);
703
+ const IonRefresherContent = /*@__PURE__*/ defineContainer('ion-refresher-content', defineCustomElement$N, [
704
+ 'pullingIcon',
705
+ 'pullingText',
706
+ 'refreshingSpinner',
707
+ 'refreshingText'
708
+ ]);
709
+ const IonReorder = /*@__PURE__*/ defineContainer('ion-reorder', defineCustomElement$O);
710
+ const IonReorderGroup = /*@__PURE__*/ defineContainer('ion-reorder-group', defineCustomElement$P, [
711
+ 'disabled',
712
+ 'ionItemReorder'
713
+ ]);
714
+ const IonRippleEffect = /*@__PURE__*/ defineContainer('ion-ripple-effect', defineCustomElement$Q, [
715
+ 'type'
716
+ ]);
717
+ const IonRow = /*@__PURE__*/ defineContainer('ion-row', defineCustomElement$R);
718
+ const IonSearchbar = /*@__PURE__*/ defineContainer('ion-searchbar', defineCustomElement$S, [
719
+ 'color',
720
+ 'animated',
721
+ 'autocomplete',
722
+ 'autocorrect',
723
+ 'cancelButtonIcon',
724
+ 'cancelButtonText',
725
+ 'clearIcon',
726
+ 'debounce',
727
+ 'disabled',
728
+ 'inputmode',
729
+ 'enterkeyhint',
730
+ 'name',
731
+ 'placeholder',
732
+ 'searchIcon',
733
+ 'showCancelButton',
734
+ 'showClearButton',
735
+ 'spellcheck',
736
+ 'type',
737
+ 'value',
738
+ 'ionInput',
739
+ 'ionChange',
740
+ 'ionCancel',
741
+ 'ionClear',
742
+ 'ionBlur',
743
+ 'ionFocus',
744
+ 'ionStyle'
745
+ ], 'value', 'v-ion-input', 'ionInput');
746
+ const IonSegment = /*@__PURE__*/ defineContainer('ion-segment', defineCustomElement$T, [
747
+ 'color',
748
+ 'disabled',
749
+ 'scrollable',
750
+ 'swipeGesture',
751
+ 'value',
752
+ 'selectOnFocus',
753
+ 'ionChange',
754
+ 'ionSelect',
755
+ 'ionStyle'
756
+ ], 'value', 'v-ion-change', 'ionChange');
757
+ const IonSegmentButton = /*@__PURE__*/ defineContainer('ion-segment-button', defineCustomElement$U, [
758
+ 'disabled',
759
+ 'layout',
760
+ 'type',
761
+ 'value'
762
+ ], 'value', 'v-ion-change', 'ionChange');
763
+ const IonSelect = /*@__PURE__*/ defineContainer('ion-select', defineCustomElement$V, [
764
+ 'cancelText',
765
+ 'color',
766
+ 'compareWith',
767
+ 'disabled',
768
+ 'fill',
769
+ 'interface',
770
+ 'interfaceOptions',
771
+ 'justify',
772
+ 'label',
773
+ 'labelPlacement',
774
+ 'legacy',
775
+ 'multiple',
776
+ 'name',
777
+ 'okText',
778
+ 'placeholder',
779
+ 'selectedText',
780
+ 'toggleIcon',
781
+ 'expandedIcon',
782
+ 'shape',
783
+ 'value',
784
+ 'ionChange',
785
+ 'ionCancel',
786
+ 'ionDismiss',
787
+ 'ionFocus',
788
+ 'ionBlur',
789
+ 'ionStyle'
790
+ ], 'value', 'v-ion-change', 'ionChange');
791
+ const IonSelectOption = /*@__PURE__*/ defineContainer('ion-select-option', defineCustomElement$W, [
792
+ 'disabled',
793
+ 'value'
794
+ ]);
795
+ const IonSkeletonText = /*@__PURE__*/ defineContainer('ion-skeleton-text', defineCustomElement$X, [
796
+ 'animated'
797
+ ]);
798
+ const IonSpinner = /*@__PURE__*/ defineContainer('ion-spinner', defineCustomElement$Y, [
799
+ 'color',
800
+ 'duration',
801
+ 'name',
802
+ 'paused'
803
+ ]);
804
+ const IonSplitPane = /*@__PURE__*/ defineContainer('ion-split-pane', defineCustomElement$Z, [
805
+ 'contentId',
806
+ 'disabled',
807
+ 'when',
808
+ 'ionSplitPaneVisible'
809
+ ]);
810
+ const IonText = /*@__PURE__*/ defineContainer('ion-text', defineCustomElement$_, [
811
+ 'color'
812
+ ]);
813
+ const IonTextarea = /*@__PURE__*/ defineContainer('ion-textarea', defineCustomElement$$, [
814
+ 'color',
815
+ 'autocapitalize',
816
+ 'autofocus',
817
+ 'clearOnEdit',
818
+ 'debounce',
819
+ 'disabled',
820
+ 'fill',
821
+ 'inputmode',
822
+ 'enterkeyhint',
823
+ 'maxlength',
824
+ 'minlength',
825
+ 'name',
826
+ 'placeholder',
827
+ 'readonly',
828
+ 'required',
829
+ 'spellcheck',
830
+ 'cols',
831
+ 'rows',
832
+ 'wrap',
833
+ 'autoGrow',
834
+ 'value',
835
+ 'counter',
836
+ 'counterFormatter',
837
+ 'errorText',
838
+ 'helperText',
839
+ 'label',
840
+ 'labelPlacement',
841
+ 'legacy',
842
+ 'shape',
843
+ 'ionChange',
844
+ 'ionInput',
845
+ 'ionStyle',
846
+ 'ionBlur',
847
+ 'ionFocus'
848
+ ], 'value', 'v-ion-input', 'ionInput');
849
+ const IonThumbnail = /*@__PURE__*/ defineContainer('ion-thumbnail', defineCustomElement$10);
850
+ const IonTitle = /*@__PURE__*/ defineContainer('ion-title', defineCustomElement$11, [
851
+ 'color',
852
+ 'size',
853
+ 'ionStyle'
854
+ ]);
855
+ const IonToggle = /*@__PURE__*/ defineContainer('ion-toggle', defineCustomElement$12, [
856
+ 'color',
857
+ 'name',
858
+ 'checked',
859
+ 'disabled',
860
+ 'value',
861
+ 'enableOnOffLabels',
862
+ 'labelPlacement',
863
+ 'legacy',
864
+ 'justify',
865
+ 'alignment',
866
+ 'ionChange',
867
+ 'ionFocus',
868
+ 'ionBlur',
869
+ 'ionStyle'
870
+ ], 'checked', 'v-ion-change', 'ionChange');
871
+ const IonToolbar = /*@__PURE__*/ defineContainer('ion-toolbar', defineCustomElement$13, [
872
+ 'color'
873
+ ]);
874
+
875
+ const useBackButton = (priority, handler) => {
876
+ const callback = (ev) => ev.detail.register(priority, handler);
877
+ const unregister = () => document.removeEventListener("ionBackButton", callback);
878
+ document.addEventListener("ionBackButton", callback);
879
+ return { unregister };
880
+ };
881
+
882
+ const useKeyboard = () => {
883
+ const isOpen = ref(false);
884
+ const keyboardHeight = ref(0);
885
+ const showCallback = (ev) => {
886
+ isOpen.value = true;
887
+ keyboardHeight.value = ev.detail.keyboardHeight;
888
+ };
889
+ const hideCallback = () => {
890
+ isOpen.value = false;
891
+ keyboardHeight.value = 0;
892
+ };
893
+ const unregister = () => {
894
+ if (typeof window !== "undefined") {
895
+ window.removeEventListener("ionKeyboardDidShow", showCallback);
896
+ window.removeEventListener("ionKeyboardDidHide", hideCallback);
897
+ }
898
+ };
899
+ if (typeof window !== "undefined") {
900
+ window.addEventListener("ionKeyboardDidShow", showCallback);
901
+ window.addEventListener("ionKeyboardDidHide", hideCallback);
902
+ }
903
+ return {
904
+ isOpen,
905
+ keyboardHeight,
906
+ unregister,
907
+ };
908
+ };
909
+
910
+ // TODO(FW-2969): types
911
+ var LifecycleHooks;
912
+ (function (LifecycleHooks) {
913
+ LifecycleHooks["WillEnter"] = "onIonViewWillEnter";
914
+ LifecycleHooks["DidEnter"] = "onIonViewDidEnter";
915
+ LifecycleHooks["WillLeave"] = "onIonViewWillLeave";
916
+ LifecycleHooks["DidLeave"] = "onIonViewDidLeave";
917
+ })(LifecycleHooks || (LifecycleHooks = {}));
918
+ const hookNames = {
919
+ [LIFECYCLE_WILL_ENTER]: LifecycleHooks.WillEnter,
920
+ [LIFECYCLE_DID_ENTER]: LifecycleHooks.DidEnter,
921
+ [LIFECYCLE_WILL_LEAVE]: LifecycleHooks.WillLeave,
922
+ [LIFECYCLE_DID_LEAVE]: LifecycleHooks.DidLeave,
923
+ };
924
+ const ids = { main: 0 };
925
+ const generateId = (type = "main") => {
926
+ var _a;
927
+ const id = ((_a = ids[type]) !== null && _a !== void 0 ? _a : 0) + 1;
928
+ ids[type] = id;
929
+ return id.toString();
930
+ };
931
+ const fireLifecycle = (vueComponent, vueInstance, lifecycle) => {
932
+ if (vueComponent === null || vueComponent === void 0 ? void 0 : vueComponent[lifecycle]) {
933
+ vueComponent[lifecycle].bind(vueInstance === null || vueInstance === void 0 ? void 0 : vueInstance.value)();
934
+ }
935
+ const instance = vueInstance === null || vueInstance === void 0 ? void 0 : vueInstance.value;
936
+ if (instance === null || instance === void 0 ? void 0 : instance[lifecycle]) {
937
+ instance[lifecycle]();
938
+ }
939
+ /**
940
+ * Fire any Composition API
941
+ * Ionic Lifecycle hooks
942
+ */
943
+ if (instance) {
944
+ const hook = hookNames[lifecycle];
945
+ const hooks = instance[hook];
946
+ if (hooks) {
947
+ hooks.forEach((hook) => hook());
948
+ }
949
+ }
950
+ };
951
+ const getConfig = () => {
952
+ if (typeof window !== "undefined") {
953
+ const Ionic = window.Ionic;
954
+ if (Ionic && Ionic.config) {
955
+ return Ionic.config;
956
+ }
957
+ }
958
+ return null;
959
+ };
960
+
961
+ /**
962
+ * Creates an returns a function that
963
+ * can be used to provide a lifecycle hook.
964
+ */
965
+ const injectHook = (lifecycleType, hook, component) => {
966
+ if (component) {
967
+ // Add to public instance so it is accessible to IonRouterOutlet
968
+ const target = component;
969
+ const hooks = target.proxy[lifecycleType] || (target.proxy[lifecycleType] = []);
970
+ /**
971
+ * Define property on public instances using `setup` syntax in Vue 3.x
972
+ */
973
+ if (target.exposed) {
974
+ target.exposed[lifecycleType] = hooks;
975
+ }
976
+ const wrappedHook = (...args) => {
977
+ if (target.isUnmounted) {
978
+ return;
979
+ }
980
+ return args ? hook(...args) : hook();
981
+ };
982
+ hooks.push(wrappedHook);
983
+ return wrappedHook;
984
+ }
985
+ else {
986
+ console.warn("[@ionic/vue]: Ionic Lifecycle Hooks can only be used during execution of setup().");
987
+ }
988
+ };
989
+ const createHook = (lifecycle) => {
990
+ return (hook, target = getCurrentInstance()) => injectHook(lifecycle, hook, target);
991
+ };
992
+ const onIonViewWillEnter = createHook(LifecycleHooks.WillEnter);
993
+ const onIonViewDidEnter = createHook(LifecycleHooks.DidEnter);
994
+ const onIonViewWillLeave = createHook(LifecycleHooks.WillLeave);
995
+ const onIonViewDidLeave = createHook(LifecycleHooks.DidLeave);
996
+
997
+ /**
998
+ * Used to navigate within Vue Router
999
+ * while controlling the animation.
1000
+ */
1001
+ const useIonRouter = () => {
1002
+ const { canGoBack, goBack, goForward, handleNavigate } = inject("navManager");
1003
+ const navigate = (location, routerDirection, routerAction, routerAnimation) => handleNavigate(location, routerAction, routerDirection, routerAnimation);
1004
+ const push = (location, routerAnimation) => navigate(location, "forward", "push", routerAnimation);
1005
+ const replace = (location, routerAnimation) => navigate(location, "root", "replace", routerAnimation);
1006
+ const back = (routerAnimation) => goBack(routerAnimation);
1007
+ const forward = (routerAnimation) => goForward(routerAnimation);
1008
+ return {
1009
+ canGoBack,
1010
+ push,
1011
+ replace,
1012
+ back,
1013
+ forward,
1014
+ navigate,
1015
+ };
1016
+ };
1017
+
1018
+ // TODO(FW-2969): types
1019
+ /**
1020
+ * We need to make sure that the web component fires an event
1021
+ * that will not conflict with the user's @ionChange binding,
1022
+ * otherwise the binding's callback will fire before any
1023
+ * v-model values have been updated.
1024
+ */
1025
+ const toKebabCase = (eventName) => {
1026
+ const kebabConvert = (name) => name.replace(/([a-z0-9]|(?=[A-Z]))([A-Z])/g, "$1-$2").toLowerCase();
1027
+ switch (eventName) {
1028
+ case "ionInput":
1029
+ return "v-ion-input";
1030
+ case "ionChange":
1031
+ return "v-ion-change";
1032
+ default:
1033
+ return kebabConvert(eventName);
1034
+ }
1035
+ };
1036
+ const getHelperFunctions = () => {
1037
+ return {
1038
+ ael: (el, eventName, cb, opts) => el.addEventListener(toKebabCase(eventName), cb, opts),
1039
+ rel: (el, eventName, cb, opts) => el.removeEventListener(toKebabCase(eventName), cb, opts),
1040
+ ce: (eventName, opts) => new CustomEvent(toKebabCase(eventName), opts),
1041
+ };
1042
+ };
1043
+ const IonicVue = {
1044
+ async install(_, config = {}) {
1045
+ /**
1046
+ * By default Ionic Framework hides elements that
1047
+ * are not hydrated, but in the CE build there is no
1048
+ * hydration.
1049
+ * TODO FW-2797: Remove when all integrations have been
1050
+ * migrated to CE build.
1051
+ */
1052
+ if (typeof document !== "undefined") {
1053
+ document.documentElement.classList.add("ion-ce");
1054
+ }
1055
+ const { ael, rel, ce } = getHelperFunctions();
1056
+ initialize(Object.assign(Object.assign({}, config), { _ael: ael, _rel: rel, _ce: ce }));
1057
+ },
1058
+ };
1059
+
1060
+ const IonBackButton = /*@__PURE__*/ defineComponent((_, { attrs, slots }) => {
1061
+ defineCustomElement$14();
1062
+ // TODO(FW-2969): type
1063
+ const ionRouter = inject("navManager");
1064
+ const onClick = () => {
1065
+ /**
1066
+ * When using ion-back-button outside of
1067
+ * a routing context, ionRouter is undefined.
1068
+ */
1069
+ if (ionRouter === undefined) {
1070
+ return;
1071
+ }
1072
+ const defaultHref = attrs["default-href"] || attrs["defaultHref"];
1073
+ const routerAnimation = attrs["router-animation"] || attrs["routerAnimation"];
1074
+ ionRouter.handleNavigateBack(defaultHref, routerAnimation);
1075
+ };
1076
+ return () => {
1077
+ return h("ion-back-button", Object.assign({ onClick }, attrs), slots.default && slots.default());
1078
+ };
1079
+ });
1080
+ IonBackButton.name = "IonBackButton";
1081
+
1082
+ const IonPage = /*@__PURE__*/ defineComponent({
1083
+ name: "IonPage",
1084
+ props: {
1085
+ // eslint-disable-next-line @typescript-eslint/no-empty-function
1086
+ registerIonPage: { type: Function, default: () => { } },
1087
+ },
1088
+ mounted() {
1089
+ this.$props.registerIonPage(this.$refs.ionPage);
1090
+ },
1091
+ setup(_, { attrs, slots }) {
1092
+ return () => {
1093
+ return h("div", Object.assign(Object.assign({}, attrs), { ["class"]: "ion-page", ref: "ionPage" }), slots.default && slots.default());
1094
+ };
1095
+ },
1096
+ });
1097
+
1098
+ // TODO(FW-2969): types
1099
+ const isViewVisible = (enteringEl) => {
1100
+ return (!enteringEl.classList.contains("ion-page-hidden") &&
1101
+ !enteringEl.classList.contains("ion-page-invisible"));
1102
+ };
1103
+ const viewDepthKey = Symbol(0);
1104
+ const IonRouterOutlet = /*@__PURE__*/ defineComponent({
1105
+ name: "IonRouterOutlet",
1106
+ setup() {
1107
+ defineCustomElement$15();
1108
+ const injectedRoute = inject(routeLocationKey);
1109
+ const route = useRoute();
1110
+ const depth = inject(viewDepthKey, 0);
1111
+ const matchedRouteRef = computed(() => route.matched[depth]);
1112
+ let previousMatchedRouteRef;
1113
+ let previousMatchedPath;
1114
+ provide(viewDepthKey, depth + 1);
1115
+ provide(matchedRouteKey, matchedRouteRef);
1116
+ const ionRouterOutlet = ref();
1117
+ const id = generateId("ion-router-outlet");
1118
+ const ionRouter = inject("navManager");
1119
+ const viewStacks = inject("viewStacks");
1120
+ const components = shallowRef([]);
1121
+ let skipTransition = false;
1122
+ // The base url for this router outlet
1123
+ let parentOutletPath;
1124
+ /**
1125
+ * Note: Do not listen for matchedRouteRef by itself here
1126
+ * as the callback will not fire for parameterized routes (i.e. /page/:id).
1127
+ * So going from /page/1 to /page/2 would not fire this callback if we
1128
+ * only listened for changes to matchedRouteRef.
1129
+ */
1130
+ watch(() => [route, matchedRouteRef.value], ([currentRoute, currentMatchedRouteRef]) => {
1131
+ /**
1132
+ * This callback checks whether or not a router outlet
1133
+ * needs to respond to a change in the matched route.
1134
+ * It handles a few cases:
1135
+ * 1. The matched route is undefined. This means that
1136
+ * the matched route is not applicable to this outlet.
1137
+ * For example, a /settings route is not applicable
1138
+ * to a /tabs/... route.
1139
+ *
1140
+ * Note: When going back to a tabs outlet from a non-tabs outlet,
1141
+ * the tabs outlet should NOT attempt a page transition from the
1142
+ * previous tab to the active tab. To do this we compare the current
1143
+ * route with the previous route. Unfortunately, we cannot rely on the
1144
+ * previous value provided by Vue in the watch callback. This is because
1145
+ * when coming back to the tabs context, the previous matched route will
1146
+ * be undefined (because nothing in the tabs context matches /settings)
1147
+ * but the current matched route will be defined and so a transition
1148
+ * will always occur.
1149
+ *
1150
+ * 2. The matched route is defined and is different than
1151
+ * the previously matched route. This is the most
1152
+ * common case such as when you go from /page1 to /page2.
1153
+ *
1154
+ * 3. The matched route is the same but the parameters are different.
1155
+ * This is a special case for parameterized routes (i.e. /page/:id).
1156
+ * When going from /page/1 to /page/2, the matched route object will
1157
+ * be the same, but we still need to perform a page transition. To do this
1158
+ * we check if the parameters are different (i.e. 1 vs 2). To avoid enumerating
1159
+ * all of the keys in the params object, we check the url path to
1160
+ * see if they are different after ensuring we are in a parameterized route.
1161
+ */
1162
+ if (currentMatchedRouteRef !== undefined) {
1163
+ const matchedDifferentRoutes = currentMatchedRouteRef !== previousMatchedRouteRef;
1164
+ const matchedDifferentParameterRoutes = currentRoute.matched[currentRoute.matched.length - 1] ===
1165
+ currentMatchedRouteRef &&
1166
+ currentRoute.path !== previousMatchedPath;
1167
+ if (matchedDifferentRoutes || matchedDifferentParameterRoutes) {
1168
+ setupViewItem(matchedRouteRef);
1169
+ }
1170
+ }
1171
+ previousMatchedRouteRef = currentMatchedRouteRef;
1172
+ previousMatchedPath = currentRoute.path;
1173
+ });
1174
+ const canStart = () => {
1175
+ const config = getConfig();
1176
+ const swipeEnabled = config &&
1177
+ config.get("swipeBackEnabled", ionRouterOutlet.value.mode === "ios");
1178
+ if (!swipeEnabled)
1179
+ return false;
1180
+ const stack = viewStacks.getViewStack(id);
1181
+ if (!stack || stack.length <= 1)
1182
+ return false;
1183
+ /**
1184
+ * We only want to outlet of the entering view
1185
+ * to respond to this gesture, so check
1186
+ * to make sure the view is in the outlet we want.
1187
+ */
1188
+ const routeInfo = ionRouter.getLeavingRouteInfo();
1189
+ const enteringViewItem = viewStacks.findViewItemByRouteInfo({ pathname: routeInfo.pushedByRoute || "" }, id);
1190
+ return !!enteringViewItem;
1191
+ };
1192
+ const onStart = async () => {
1193
+ const routeInfo = ionRouter.getLeavingRouteInfo();
1194
+ const { routerAnimation } = routeInfo;
1195
+ const enteringViewItem = viewStacks.findViewItemByRouteInfo({ pathname: routeInfo.pushedByRoute || "" }, id);
1196
+ const leavingViewItem = viewStacks.findViewItemByRouteInfo(routeInfo, id);
1197
+ if (leavingViewItem) {
1198
+ let animationBuilder = routerAnimation;
1199
+ const enteringEl = enteringViewItem.ionPageElement;
1200
+ const leavingEl = leavingViewItem.ionPageElement;
1201
+ /**
1202
+ * If we are going back from a page that
1203
+ * was presented using a custom animation
1204
+ * we should default to using that
1205
+ * unless the developer explicitly
1206
+ * provided another animation.
1207
+ */
1208
+ const customAnimation = enteringViewItem.routerAnimation;
1209
+ if (animationBuilder === undefined && customAnimation !== undefined) {
1210
+ animationBuilder = customAnimation;
1211
+ }
1212
+ leavingViewItem.routerAnimation = animationBuilder;
1213
+ await transition(enteringEl, leavingEl, "back", ionRouter.canGoBack(2), true, animationBuilder);
1214
+ }
1215
+ return Promise.resolve();
1216
+ };
1217
+ const onEnd = (shouldContinue) => {
1218
+ if (shouldContinue) {
1219
+ skipTransition = true;
1220
+ /**
1221
+ * Use the same logic as clicking
1222
+ * ion-back-button to determine where
1223
+ * to go back to.
1224
+ */
1225
+ ionRouter.handleNavigateBack();
1226
+ }
1227
+ else {
1228
+ /**
1229
+ * In the event that the swipe
1230
+ * gesture was aborted, we should
1231
+ * re-hide the page that was going to enter.
1232
+ */
1233
+ const routeInfo = ionRouter.getCurrentRouteInfo();
1234
+ const enteringViewItem = viewStacks.findViewItemByRouteInfo({ pathname: routeInfo.pushedByRoute || "" }, id);
1235
+ enteringViewItem.ionPageElement.setAttribute("aria-hidden", "true");
1236
+ enteringViewItem.ionPageElement.classList.add("ion-page-hidden");
1237
+ }
1238
+ };
1239
+ watch(ionRouterOutlet, () => {
1240
+ ionRouterOutlet.value.swipeHandler = {
1241
+ canStart,
1242
+ onStart,
1243
+ onEnd,
1244
+ };
1245
+ });
1246
+ const transition = async (enteringEl, leavingEl, direction, showGoBack, progressAnimation, animationBuilder) => {
1247
+ if (skipTransition) {
1248
+ skipTransition = false;
1249
+ return Promise.resolve(false);
1250
+ }
1251
+ if (enteringEl === leavingEl) {
1252
+ return Promise.resolve(false);
1253
+ }
1254
+ enteringEl.classList.add("ion-page-invisible");
1255
+ const hasRootDirection = direction === undefined || direction === "root" || direction === "none";
1256
+ const result = await ionRouterOutlet.value.commit(enteringEl, leavingEl, {
1257
+ /**
1258
+ * replace operations result in a direction of none.
1259
+ * These typically do not have need animations, so we set
1260
+ * the duration to 0. However, if a developer explicitly
1261
+ * passes an animationBuilder, we should assume that
1262
+ * they want an animation to be played even
1263
+ * though it is a replace operation.
1264
+ */
1265
+ duration: hasRootDirection && animationBuilder === undefined ? 0 : undefined,
1266
+ direction,
1267
+ showGoBack,
1268
+ progressAnimation,
1269
+ animationBuilder,
1270
+ });
1271
+ return result;
1272
+ };
1273
+ const handlePageTransition = async () => {
1274
+ const routeInfo = ionRouter.getCurrentRouteInfo();
1275
+ const { routerDirection, routerAction, routerAnimation, prevRouteLastPathname, delta, } = routeInfo;
1276
+ const enteringViewItem = viewStacks.findViewItemByRouteInfo(routeInfo, id);
1277
+ let leavingViewItem = viewStacks.findLeavingViewItemByRouteInfo(routeInfo, id);
1278
+ const enteringEl = enteringViewItem.ionPageElement;
1279
+ /**
1280
+ * All views that can be transitioned to must have
1281
+ * an `<ion-page>` element for transitions and lifecycle
1282
+ * methods to work properly.
1283
+ */
1284
+ if (enteringEl === undefined) {
1285
+ console.warn(`[@ionic/vue Warning]: The view you are trying to render for path ${routeInfo.pathname} does not have the required <ion-page> component. Transitions and lifecycle methods may not work as expected.
1286
+
1287
+ See https://ionicframework.com/docs/vue/navigation#ionpage for more information.`);
1288
+ }
1289
+ if (enteringViewItem === leavingViewItem)
1290
+ return;
1291
+ if (!leavingViewItem && prevRouteLastPathname) {
1292
+ leavingViewItem = viewStacks.findViewItemByPathname(prevRouteLastPathname, id);
1293
+ }
1294
+ /**
1295
+ * If the entering view is already
1296
+ * visible, then no transition is needed.
1297
+ * This is most common when navigating
1298
+ * from a tabs page to a non-tabs page
1299
+ * and then back to the tabs page.
1300
+ * Even when the tabs context navigated away,
1301
+ * the inner tabs page was still active.
1302
+ * This also avoids an issue where
1303
+ * the previous tabs page is incorrectly
1304
+ * unmounted since it would automatically
1305
+ * unmount the previous view.
1306
+ *
1307
+ * This should also only apply to entering and
1308
+ * leaving items in the same router outlet (i.e.
1309
+ * Tab1 and Tab2), otherwise this will
1310
+ * return early for swipe to go back when
1311
+ * going from a non-tabs page to a tabs page.
1312
+ */
1313
+ if (isViewVisible(enteringEl) &&
1314
+ (leavingViewItem === null || leavingViewItem === void 0 ? void 0 : leavingViewItem.ionPageElement) !== undefined &&
1315
+ !isViewVisible(leavingViewItem.ionPageElement)) {
1316
+ return;
1317
+ }
1318
+ fireLifecycle(enteringViewItem.vueComponent, enteringViewItem.vueComponentRef, LIFECYCLE_WILL_ENTER);
1319
+ if ((leavingViewItem === null || leavingViewItem === void 0 ? void 0 : leavingViewItem.ionPageElement) &&
1320
+ enteringViewItem !== leavingViewItem) {
1321
+ let animationBuilder = routerAnimation;
1322
+ const leavingEl = leavingViewItem.ionPageElement;
1323
+ fireLifecycle(leavingViewItem.vueComponent, leavingViewItem.vueComponentRef, LIFECYCLE_WILL_LEAVE);
1324
+ /**
1325
+ * If we are going back from a page that
1326
+ * was presented using a custom animation
1327
+ * we should default to using that
1328
+ * unless the developer explicitly
1329
+ * provided another animation.
1330
+ */
1331
+ const customAnimation = enteringViewItem.routerAnimation;
1332
+ if (animationBuilder === undefined &&
1333
+ routerDirection === "back" &&
1334
+ customAnimation !== undefined) {
1335
+ animationBuilder = customAnimation;
1336
+ }
1337
+ leavingViewItem.routerAnimation = animationBuilder;
1338
+ await transition(enteringEl, leavingEl, routerDirection, !!routeInfo.pushedByRoute, false, animationBuilder);
1339
+ leavingEl.classList.add("ion-page-hidden");
1340
+ leavingEl.setAttribute("aria-hidden", "true");
1341
+ const usingLinearNavigation = viewStacks.size() === 1;
1342
+ if (routerAction === "replace") {
1343
+ leavingViewItem.mount = false;
1344
+ leavingViewItem.ionPageElement = undefined;
1345
+ leavingViewItem.ionRoute = false;
1346
+ }
1347
+ else if (!(routerAction === "push" && routerDirection === "forward")) {
1348
+ const shouldLeavingViewBeRemoved = routerDirection !== "none" &&
1349
+ leavingViewItem &&
1350
+ enteringViewItem !== leavingViewItem;
1351
+ if (shouldLeavingViewBeRemoved) {
1352
+ leavingViewItem.mount = false;
1353
+ leavingViewItem.ionPageElement = undefined;
1354
+ leavingViewItem.ionRoute = false;
1355
+ /**
1356
+ * router.go() expects navigation to be
1357
+ * linear. If an app is using multiple stacks then
1358
+ * it is not using linear navigation. As a result, router.go()
1359
+ * will not give the results that developers are expecting.
1360
+ */
1361
+ if (usingLinearNavigation) {
1362
+ viewStacks.unmountLeavingViews(id, enteringViewItem, delta);
1363
+ }
1364
+ }
1365
+ }
1366
+ else if (usingLinearNavigation) {
1367
+ viewStacks.mountIntermediaryViews(id, leavingViewItem, delta);
1368
+ }
1369
+ fireLifecycle(leavingViewItem.vueComponent, leavingViewItem.vueComponentRef, LIFECYCLE_DID_LEAVE);
1370
+ }
1371
+ else {
1372
+ /**
1373
+ * If there is no leaving element, just show
1374
+ * the entering element. Wrap it in an raf
1375
+ * in case ion-content's fullscreen callback
1376
+ * is running. Otherwise we'd have a flicker.
1377
+ */
1378
+ requestAnimationFrame(() => enteringEl.classList.remove("ion-page-invisible"));
1379
+ }
1380
+ fireLifecycle(enteringViewItem.vueComponent, enteringViewItem.vueComponentRef, LIFECYCLE_DID_ENTER);
1381
+ components.value = viewStacks.getChildrenToRender(id);
1382
+ };
1383
+ const setupViewItem = (matchedRouteRef) => {
1384
+ const firstMatchedRoute = route.matched[0];
1385
+ if (!parentOutletPath) {
1386
+ parentOutletPath = firstMatchedRoute.path;
1387
+ }
1388
+ /**
1389
+ * If no matched route, do not do anything in this outlet.
1390
+ * If there is a match, but it the first matched path
1391
+ * is not the root path for this outlet, then this view
1392
+ * change needs to be rendered in a different outlet.
1393
+ * We also add an exception for when the matchedRouteRef is
1394
+ * equal to the first matched route (i.e. the base router outlet).
1395
+ * This logic is mainly to help nested outlets/multi-tab
1396
+ * setups work better.
1397
+ */
1398
+ if (!matchedRouteRef.value ||
1399
+ (matchedRouteRef.value !== firstMatchedRoute &&
1400
+ firstMatchedRoute.path !== parentOutletPath)) {
1401
+ return;
1402
+ }
1403
+ const currentRoute = ionRouter.getCurrentRouteInfo();
1404
+ let enteringViewItem = viewStacks.findViewItemByRouteInfo(currentRoute, id);
1405
+ if (!enteringViewItem) {
1406
+ enteringViewItem = viewStacks.createViewItem(id, matchedRouteRef.value.components.default, matchedRouteRef.value, currentRoute);
1407
+ viewStacks.add(enteringViewItem);
1408
+ }
1409
+ if (!enteringViewItem.mount) {
1410
+ enteringViewItem.mount = true;
1411
+ enteringViewItem.registerCallback = () => {
1412
+ handlePageTransition();
1413
+ enteringViewItem.registerCallback = undefined;
1414
+ };
1415
+ }
1416
+ else {
1417
+ handlePageTransition();
1418
+ }
1419
+ components.value = viewStacks.getChildrenToRender(id);
1420
+ };
1421
+ if (matchedRouteRef.value) {
1422
+ setupViewItem(matchedRouteRef);
1423
+ }
1424
+ /**
1425
+ * Remove stack data for this outlet
1426
+ * when outlet is destroyed otherwise
1427
+ * we will see cached view data.
1428
+ */
1429
+ onUnmounted(() => viewStacks.clear(id));
1430
+ const registerIonPage = (viewItem, ionPageEl) => {
1431
+ const oldIonPageEl = viewItem.ionPageElement;
1432
+ viewStacks.registerIonPage(viewItem, ionPageEl);
1433
+ /**
1434
+ * If there is a registerCallback,
1435
+ * then this component is being registered
1436
+ * as a result of a navigation change.
1437
+ */
1438
+ if (viewItem.registerCallback) {
1439
+ /**
1440
+ * Page should be hidden initially
1441
+ * to avoid flickering.
1442
+ */
1443
+ ionPageEl.classList.add("ion-page-invisible");
1444
+ viewItem.registerCallback();
1445
+ /**
1446
+ * If there is no registerCallback, then
1447
+ * this component is likely being re-registered
1448
+ * as a result of a hot module replacement.
1449
+ * We need to see if the oldIonPageEl has
1450
+ * .ion-page-invisible. If it does not then we
1451
+ * need to remove it from the new ionPageEl otherwise
1452
+ * the page will be hidden when it is replaced.
1453
+ */
1454
+ }
1455
+ else if (oldIonPageEl &&
1456
+ !oldIonPageEl.classList.contains("ion-page-invisible")) {
1457
+ ionPageEl.classList.remove("ion-page-invisible");
1458
+ }
1459
+ };
1460
+ return {
1461
+ id,
1462
+ components,
1463
+ injectedRoute,
1464
+ ionRouterOutlet,
1465
+ registerIonPage,
1466
+ };
1467
+ },
1468
+ render() {
1469
+ const { components, registerIonPage, injectedRoute } = this;
1470
+ return h("ion-router-outlet", { ref: "ionRouterOutlet" }, components &&
1471
+ components.map((c) => {
1472
+ var _a, _b;
1473
+ let props = {
1474
+ ref: c.vueComponentRef,
1475
+ key: c.pathname,
1476
+ registerIonPage: (ionPageEl) => registerIonPage(c, ionPageEl),
1477
+ };
1478
+ /**
1479
+ * IonRouterOutlet does not support named outlets.
1480
+ */
1481
+ const routePropsOption = (_b = (_a = c.matchedRoute) === null || _a === void 0 ? void 0 : _a.props) === null || _b === void 0 ? void 0 : _b.default;
1482
+ /**
1483
+ * Since IonRouterOutlet renders multiple components,
1484
+ * each render will cause all props functions to be
1485
+ * called again. As a result, we need to cache the function
1486
+ * result and provide it on each render so that the props
1487
+ * are not lost when navigating from and back to a page.
1488
+ * When a component is destroyed and re-created, the
1489
+ * function is called again.
1490
+ */
1491
+ const getPropsFunctionResult = () => {
1492
+ var _a;
1493
+ const cachedPropsResult = (_a = c.vueComponentData) === null || _a === void 0 ? void 0 : _a.propsFunctionResult;
1494
+ if (cachedPropsResult) {
1495
+ return cachedPropsResult;
1496
+ }
1497
+ else {
1498
+ const propsFunctionResult = routePropsOption(injectedRoute);
1499
+ c.vueComponentData = Object.assign(Object.assign({}, c.vueComponentData), { propsFunctionResult });
1500
+ return propsFunctionResult;
1501
+ }
1502
+ };
1503
+ const routeProps = routePropsOption
1504
+ ? routePropsOption === true
1505
+ ? c.params
1506
+ : typeof routePropsOption === "function"
1507
+ ? getPropsFunctionResult()
1508
+ : routePropsOption
1509
+ : null;
1510
+ props = Object.assign(Object.assign({}, props), routeProps);
1511
+ return h(c.vueComponent, props);
1512
+ }));
1513
+ },
1514
+ });
1515
+
1516
+ const IonTabButton = /*@__PURE__*/ defineComponent({
1517
+ name: "IonTabButton",
1518
+ props: {
1519
+ _getTabState: {
1520
+ type: Function,
1521
+ default: () => {
1522
+ return {};
1523
+ },
1524
+ },
1525
+ disabled: Boolean,
1526
+ download: String,
1527
+ href: String,
1528
+ rel: String,
1529
+ layout: String,
1530
+ selected: Boolean,
1531
+ tab: String,
1532
+ target: String,
1533
+ },
1534
+ setup(props, { slots }) {
1535
+ defineCustomElement$16();
1536
+ // TODO(FW-2969): type
1537
+ const ionRouter = inject("navManager");
1538
+ const onClick = (ev) => {
1539
+ if (ev.cancelable) {
1540
+ ev.preventDefault();
1541
+ }
1542
+ /**
1543
+ * Keeping track of the originalHref
1544
+ * (i.e. /tabs/tab1) lets us redirect
1545
+ * users back to a child page using currentHref
1546
+ * (i.e. /tabs/tab1/child).
1547
+ */
1548
+ const { tab, href, _getTabState } = props;
1549
+ const tabState = _getTabState();
1550
+ const tappedTab = tabState.tabs[tab] || {};
1551
+ const originalHref = tappedTab.originalHref || href;
1552
+ const currentHref = tappedTab.currentHref || href;
1553
+ const prevActiveTab = tabState.activeTab;
1554
+ /**
1555
+ * If we are still on the same
1556
+ * tab as before, but the base href
1557
+ * does not equal the current href,
1558
+ * then we must be on a child page and
1559
+ * should direct users back to the root
1560
+ * of the tab.
1561
+ */
1562
+ if (prevActiveTab === tab) {
1563
+ if (originalHref !== currentHref) {
1564
+ ionRouter.resetTab(tab);
1565
+ }
1566
+ }
1567
+ else {
1568
+ ionRouter.changeTab(tab, currentHref);
1569
+ }
1570
+ };
1571
+ return () => {
1572
+ return h("ion-tab-button", Object.assign({ onClick }, props), slots.default && slots.default());
1573
+ };
1574
+ },
1575
+ });
1576
+
1577
+ const WILL_CHANGE = "ionTabsWillChange";
1578
+ const DID_CHANGE = "ionTabsDidChange";
1579
+ // TODO(FW-2969): types
1580
+ const IonTabs = /*@__PURE__*/ defineComponent({
1581
+ name: "IonTabs",
1582
+ emits: [WILL_CHANGE, DID_CHANGE],
1583
+ render() {
1584
+ var _a;
1585
+ const { $slots: slots, $emit } = this;
1586
+ const slottedContent = slots.default && slots.default();
1587
+ let routerOutlet;
1588
+ /**
1589
+ * Developers must pass an ion-router-outlet
1590
+ * inside of ion-tabs.
1591
+ */
1592
+ if (slottedContent && slottedContent.length > 0) {
1593
+ routerOutlet = slottedContent.find((child) => child.type && child.type.name === "IonRouterOutlet");
1594
+ }
1595
+ if (!routerOutlet) {
1596
+ throw new Error("IonTabs must contain an IonRouterOutlet. See https://ionicframework.com/docs/vue/navigation#working-with-tabs for more information.");
1597
+ }
1598
+ let childrenToRender = [
1599
+ h("div", {
1600
+ class: "tabs-inner",
1601
+ style: {
1602
+ position: "relative",
1603
+ flex: "1",
1604
+ contain: "layout size style",
1605
+ },
1606
+ }, routerOutlet),
1607
+ ];
1608
+ /**
1609
+ * If ion-tab-bar has slot="top" it needs to be
1610
+ * rendered before `.tabs-inner` otherwise it will
1611
+ * not show above the tab content.
1612
+ */
1613
+ if (slottedContent && slottedContent.length > 0) {
1614
+ /**
1615
+ * Render all content except for router outlet
1616
+ * since that needs to be inside of `.tabs-inner`.
1617
+ */
1618
+ const filteredContent = slottedContent.filter((child) => !child.type ||
1619
+ (child.type && child.type.name !== "IonRouterOutlet"));
1620
+ const slottedTabBar = filteredContent.find((child) => child.type && child.type.name === "IonTabBar");
1621
+ const hasTopSlotTabBar = slottedTabBar && ((_a = slottedTabBar.props) === null || _a === void 0 ? void 0 : _a.slot) === "top";
1622
+ if (slottedTabBar) {
1623
+ if (!slottedTabBar.props) {
1624
+ slottedTabBar.props = {};
1625
+ }
1626
+ /**
1627
+ * ionTabsWillChange and ionTabsDidChange are
1628
+ * fired from `ion-tabs`, so we need to pass these down
1629
+ * as props so they can fire when the active tab changes.
1630
+ * TODO: We may want to move logic from the tab bar into here
1631
+ * so we do not have code split across two components.
1632
+ */
1633
+ slottedTabBar.props._tabsWillChange = (tab) => $emit(WILL_CHANGE, { tab });
1634
+ slottedTabBar.props._tabsDidChange = (tab) => $emit(DID_CHANGE, { tab });
1635
+ }
1636
+ if (hasTopSlotTabBar) {
1637
+ childrenToRender = [...filteredContent, ...childrenToRender];
1638
+ }
1639
+ else {
1640
+ childrenToRender = [...childrenToRender, ...filteredContent];
1641
+ }
1642
+ }
1643
+ return h("ion-tabs", {
1644
+ style: {
1645
+ display: "flex",
1646
+ position: "absolute",
1647
+ top: "0",
1648
+ left: "0",
1649
+ right: "0",
1650
+ bottom: "0",
1651
+ "flex-direction": "column",
1652
+ width: "100%",
1653
+ height: "100%",
1654
+ contain: "layout size style",
1655
+ "z-index": "0",
1656
+ },
1657
+ }, childrenToRender);
1658
+ },
1659
+ });
1660
+
1661
+ const isTabButton = (child) => { var _a; return ((_a = child.type) === null || _a === void 0 ? void 0 : _a.name) === "IonTabButton"; };
1662
+ const getTabs = (nodes) => {
1663
+ let tabs = [];
1664
+ nodes.forEach((node) => {
1665
+ if (isTabButton(node)) {
1666
+ tabs.push(node);
1667
+ }
1668
+ else if (Array.isArray(node.children) && node.children.length > 1) {
1669
+ const childTabs = getTabs(node.children);
1670
+ tabs = [...tabs, ...childTabs];
1671
+ }
1672
+ });
1673
+ return tabs;
1674
+ };
1675
+ const IonTabBar = defineComponent({
1676
+ name: "IonTabBar",
1677
+ props: {
1678
+ /* eslint-disable @typescript-eslint/no-empty-function */
1679
+ _tabsWillChange: { type: Function, default: () => { } },
1680
+ _tabsDidChange: { type: Function, default: () => { } },
1681
+ /* eslint-enable @typescript-eslint/no-empty-function */
1682
+ },
1683
+ data() {
1684
+ return {
1685
+ tabState: {
1686
+ activeTab: undefined,
1687
+ tabs: {},
1688
+ },
1689
+ tabVnodes: [],
1690
+ };
1691
+ },
1692
+ updated() {
1693
+ this.setupTabState(inject("navManager"));
1694
+ },
1695
+ methods: {
1696
+ setupTabState(ionRouter) {
1697
+ /**
1698
+ * For each tab, we need to keep track of its
1699
+ * base href as well as any child page that
1700
+ * is active in its stack so that when we go back
1701
+ * to a tab from another tab, we can correctly
1702
+ * show any child pages if necessary.
1703
+ */
1704
+ const tabState = this.$data.tabState;
1705
+ const currentInstance = getCurrentInstance();
1706
+ const tabs = (this.$data.tabVnodes = getTabs((currentInstance.subTree.children || [])));
1707
+ tabs.forEach((child) => {
1708
+ tabState.tabs[child.props.tab] = {
1709
+ originalHref: child.props.href,
1710
+ currentHref: child.props.href,
1711
+ ref: child,
1712
+ };
1713
+ /**
1714
+ * Passing this prop to each tab button
1715
+ * lets it be aware of the state that
1716
+ * ion-tab-bar is managing for it.
1717
+ */
1718
+ child.component.props._getTabState = () => tabState;
1719
+ });
1720
+ this.checkActiveTab(ionRouter);
1721
+ },
1722
+ checkActiveTab(ionRouter) {
1723
+ const currentRoute = ionRouter.getCurrentRouteInfo();
1724
+ const childNodes = this.$data.tabVnodes;
1725
+ const { tabs, activeTab: prevActiveTab } = this.$data.tabState;
1726
+ const tabState = this.$data.tabState;
1727
+ const tabKeys = Object.keys(tabs);
1728
+ const activeTab = tabKeys.find((key) => {
1729
+ const href = tabs[key].originalHref;
1730
+ return currentRoute.pathname.startsWith(href);
1731
+ });
1732
+ /**
1733
+ * For each tab, check to see if the
1734
+ * base href has changed. If so, update
1735
+ * it in the tabs state.
1736
+ */
1737
+ childNodes.forEach((child) => {
1738
+ const tab = tabs[child.props.tab];
1739
+ if (!tab || tab.originalHref !== child.props.href) {
1740
+ tabs[child.props.tab] = {
1741
+ originalHref: child.props.href,
1742
+ currentHref: child.props.href,
1743
+ ref: child,
1744
+ };
1745
+ }
1746
+ });
1747
+ if (activeTab && prevActiveTab) {
1748
+ const prevHref = this.$data.tabState.tabs[prevActiveTab].currentHref;
1749
+ /**
1750
+ * If the tabs change or the url changes,
1751
+ * update the currentHref for the active tab.
1752
+ * Ex: url changes from /tabs/tab1 --> /tabs/tab1/child
1753
+ * If we went to tab2 then back to tab1, we should
1754
+ * land on /tabs/tab1/child instead of /tabs/tab1.
1755
+ */
1756
+ if (activeTab !== prevActiveTab || prevHref !== currentRoute.pathname) {
1757
+ /**
1758
+ * By default the search is `undefined` in Ionic Vue,
1759
+ * but Vue Router can set the search to the empty string.
1760
+ * We check for truthy here because empty string is falsy
1761
+ * and currentRoute.search cannot ever be a boolean.
1762
+ */
1763
+ const search = currentRoute.search ? `?${currentRoute.search}` : "";
1764
+ tabs[activeTab] = Object.assign(Object.assign({}, tabs[activeTab]), { currentHref: currentRoute.pathname + search });
1765
+ }
1766
+ /**
1767
+ * If navigating back and the tabs change,
1768
+ * set the previous tab back to its original href.
1769
+ */
1770
+ if (currentRoute.routerAction === "pop" &&
1771
+ activeTab !== prevActiveTab) {
1772
+ tabs[prevActiveTab] = Object.assign(Object.assign({}, tabs[prevActiveTab]), { currentHref: tabs[prevActiveTab].originalHref });
1773
+ }
1774
+ }
1775
+ const activeChild = childNodes.find((child) => { var _a; return isTabButton(child) && ((_a = child.props) === null || _a === void 0 ? void 0 : _a.tab) === activeTab; });
1776
+ const tabBar = this.$refs.ionTabBar;
1777
+ const tabDidChange = activeTab !== prevActiveTab;
1778
+ if (tabBar) {
1779
+ if (activeChild) {
1780
+ tabDidChange && this.$props._tabsWillChange(activeTab);
1781
+ ionRouter.handleSetCurrentTab(activeTab);
1782
+ tabBar.selectedTab = tabState.activeTab = activeTab;
1783
+ tabDidChange && this.$props._tabsDidChange(activeTab);
1784
+ /**
1785
+ * When going to a tab that does
1786
+ * not have an associated ion-tab-button
1787
+ * we need to remove the selected state from
1788
+ * the old tab.
1789
+ */
1790
+ }
1791
+ else {
1792
+ tabBar.selectedTab = tabState.activeTab = "";
1793
+ }
1794
+ }
1795
+ },
1796
+ },
1797
+ mounted() {
1798
+ const ionRouter = inject("navManager");
1799
+ this.setupTabState(ionRouter);
1800
+ ionRouter.registerHistoryChangeListener(() => this.checkActiveTab(ionRouter));
1801
+ },
1802
+ setup(_, { slots }) {
1803
+ defineCustomElement$17();
1804
+ return () => {
1805
+ return h("ion-tab-bar", { ref: "ionTabBar" }, slots.default && slots.default());
1806
+ };
1807
+ },
1808
+ });
1809
+
1810
+ const userComponents = shallowRef([]);
1811
+ const IonApp = /*@__PURE__*/ defineComponent((_, { attrs, slots }) => {
1812
+ defineCustomElement$18();
1813
+ return () => {
1814
+ return h("ion-app", Object.assign({}, attrs), [slots.default && slots.default(), ...userComponents.value]);
1815
+ };
1816
+ });
1817
+ IonApp.name = "IonApp";
1818
+ /**
1819
+ * When rendering user components inside of
1820
+ * ion-modal, or ion-popover the component
1821
+ * needs to be created inside of the current application
1822
+ * context otherwise libraries such as vue-i18n or vuex
1823
+ * will not work properly.
1824
+ *
1825
+ * `userComponents` renders teleported components as children
1826
+ * of `ion-app` within the current application context.
1827
+ */
1828
+ const addTeleportedUserComponent = (component) => {
1829
+ userComponents.value = [...userComponents.value, component];
1830
+ };
1831
+ const removeTeleportedUserComponent = (component) => {
1832
+ userComponents.value = userComponents.value.filter((cmp) => cmp !== component);
1833
+ };
1834
+
1835
+ const VueDelegate = (addFn = addTeleportedUserComponent, removeFn = removeTeleportedUserComponent) => {
1836
+ // `h` doesn't provide a type for the component argument
1837
+ const refMap = new WeakMap();
1838
+ // TODO(FW-2969): types
1839
+ const attachViewToDom = (parentElement, componentOrTagName, componentProps = {}, classes) => {
1840
+ const div = document.createElement("div");
1841
+ classes && div.classList.add(...classes);
1842
+ parentElement.appendChild(div);
1843
+ const hostComponent = h(Teleport, { to: div }, h(componentOrTagName, Object.assign({}, componentProps)));
1844
+ /**
1845
+ * Ionic Framework will use what is returned from `attachViewToDom`
1846
+ * as the `component` argument in `removeViewFromDom`.
1847
+ *
1848
+ * We will store a reference to the div element and the host component,
1849
+ * so we can later look-up and unmount the correct instance.
1850
+ */
1851
+ refMap.set(div, hostComponent);
1852
+ addFn(hostComponent);
1853
+ return Promise.resolve(div);
1854
+ };
1855
+ const removeViewFromDom = (_container, component) => {
1856
+ const hostComponent = refMap.get(component);
1857
+ hostComponent && removeFn(hostComponent);
1858
+ return Promise.resolve();
1859
+ };
1860
+ return { attachViewToDom, removeViewFromDom };
1861
+ };
1862
+
1863
+ const IonNav = /*@__PURE__*/ defineComponent(() => {
1864
+ defineCustomElement$19();
1865
+ const views = shallowRef([]);
1866
+ /**
1867
+ * Allows us to create the component
1868
+ * within the Vue application context.
1869
+ */
1870
+ const addView = (component) => (views.value = [...views.value, component]);
1871
+ const removeView = (component) => (views.value = views.value.filter((cmp) => cmp !== component));
1872
+ const delegate = VueDelegate(addView, removeView);
1873
+ return () => {
1874
+ return h("ion-nav", { delegate }, views.value);
1875
+ };
1876
+ });
1877
+ IonNav.name = "IonNav";
1878
+
1879
+ const IonIcon = /*@__PURE__*/ defineComponent({
1880
+ name: "IonIcon",
1881
+ props: {
1882
+ color: String,
1883
+ flipRtl: Boolean,
1884
+ icon: String,
1885
+ ios: String,
1886
+ lazy: String,
1887
+ md: String,
1888
+ mode: String,
1889
+ name: String,
1890
+ size: String,
1891
+ src: String,
1892
+ },
1893
+ setup(props, { slots }) {
1894
+ defineCustomElement$1a();
1895
+ return () => {
1896
+ var _a, _b;
1897
+ const { icon, ios, md, mode } = props;
1898
+ let iconToUse;
1899
+ const config = getConfig();
1900
+ const iconMode = mode || (config === null || config === void 0 ? void 0 : config.get("mode"));
1901
+ if (ios || md) {
1902
+ if (iconMode === "ios") {
1903
+ iconToUse = (_a = ios !== null && ios !== void 0 ? ios : md) !== null && _a !== void 0 ? _a : icon;
1904
+ }
1905
+ else {
1906
+ iconToUse = (_b = md !== null && md !== void 0 ? md : ios) !== null && _b !== void 0 ? _b : icon;
1907
+ }
1908
+ }
1909
+ else {
1910
+ iconToUse = icon;
1911
+ }
1912
+ return h("ion-icon", Object.assign(Object.assign({}, props), { icon: iconToUse }), slots);
1913
+ };
1914
+ },
1915
+ });
1916
+
1917
+ const EMPTY_PROP$1 = Symbol();
1918
+ const DEFAULT_EMPTY_PROP$1 = { default: EMPTY_PROP$1 };
1919
+ const defineOverlayContainer = (name, defineCustomElement, componentProps = [], hasDelegateHost, controller) => {
1920
+ const createControllerComponent = () => {
1921
+ return defineComponent((props, { slots, emit }) => {
1922
+ const eventListeners = [
1923
+ { componentEv: `${name}-will-present`, frameworkEv: 'willPresent' },
1924
+ { componentEv: `${name}-did-present`, frameworkEv: 'didPresent' },
1925
+ { componentEv: `${name}-will-dismiss`, frameworkEv: 'willDismiss' },
1926
+ { componentEv: `${name}-did-dismiss`, frameworkEv: 'didDismiss' },
1927
+ ];
1928
+ if (defineCustomElement !== undefined) {
1929
+ defineCustomElement();
1930
+ }
1931
+ const overlay = ref();
1932
+ const onVnodeMounted = async () => {
1933
+ const isOpen = props.isOpen;
1934
+ isOpen && (await present(props));
1935
+ };
1936
+ const onVnodeUpdated = async (node, prevNode) => {
1937
+ const isOpen = node.props.isOpen;
1938
+ const prevIsOpen = prevNode.props.isOpen;
1939
+ /**
1940
+ * Do not do anything if this prop
1941
+ * did not change.
1942
+ */
1943
+ if (isOpen === prevIsOpen)
1944
+ return;
1945
+ if (isOpen) {
1946
+ await present(props);
1947
+ }
1948
+ else {
1949
+ await dismiss();
1950
+ }
1951
+ };
1952
+ const onVnodeBeforeUnmount = async () => {
1953
+ await dismiss();
1954
+ };
1955
+ const dismiss = async () => {
1956
+ if (!overlay.value)
1957
+ return;
1958
+ await overlay.value;
1959
+ overlay.value = overlay.value.dismiss();
1960
+ await overlay.value;
1961
+ overlay.value = undefined;
1962
+ };
1963
+ const present = async (props) => {
1964
+ var _a;
1965
+ /**
1966
+ * Do not open another instance
1967
+ * if one is already opened.
1968
+ */
1969
+ if (overlay.value) {
1970
+ await overlay.value;
1971
+ }
1972
+ if ((_a = overlay.value) === null || _a === void 0 ? void 0 : _a.present) {
1973
+ await overlay.value.present();
1974
+ return;
1975
+ }
1976
+ let restOfProps = {};
1977
+ /**
1978
+ * We can use Object.entries here
1979
+ * to avoid the hasOwnProperty check,
1980
+ * but that would require 2 iterations
1981
+ * where as this only requires 1.
1982
+ */
1983
+ for (const key in props) {
1984
+ const value = props[key];
1985
+ if (props.hasOwnProperty(key) && value !== EMPTY_PROP$1) {
1986
+ restOfProps[key] = value;
1987
+ }
1988
+ }
1989
+ /**
1990
+ * These are getting passed as props.
1991
+ * Potentially a Vue bug with Web Components?
1992
+ */
1993
+ delete restOfProps.onWillPresent;
1994
+ delete restOfProps.onDidPresent;
1995
+ delete restOfProps.onWillDismiss;
1996
+ delete restOfProps.onDidDismiss;
1997
+ const component = slots.default && slots.default()[0];
1998
+ overlay.value = controller.create(Object.assign(Object.assign({}, restOfProps), { component }));
1999
+ overlay.value = await overlay.value;
2000
+ eventListeners.forEach(eventListener => {
2001
+ overlay.value.addEventListener(eventListener.componentEv, () => {
2002
+ emit(eventListener.frameworkEv);
2003
+ });
2004
+ });
2005
+ await overlay.value.present();
2006
+ };
2007
+ return () => {
2008
+ return h('div', {
2009
+ style: { display: 'none' },
2010
+ onVnodeMounted,
2011
+ onVnodeUpdated,
2012
+ onVnodeBeforeUnmount,
2013
+ isOpen: props.isOpen === true
2014
+ });
2015
+ };
2016
+ });
2017
+ };
2018
+ const createInlineComponent = () => {
2019
+ return defineComponent((props, { slots }) => {
2020
+ if (defineCustomElement !== undefined) {
2021
+ defineCustomElement();
2022
+ }
2023
+ const isOpen = ref(false);
2024
+ const elementRef = ref();
2025
+ onMounted(() => {
2026
+ elementRef.value.addEventListener('ion-mount', () => isOpen.value = true);
2027
+ elementRef.value.addEventListener('will-present', () => isOpen.value = true);
2028
+ elementRef.value.addEventListener('did-dismiss', () => isOpen.value = false);
2029
+ });
2030
+ return () => {
2031
+ let restOfProps = {};
2032
+ /**
2033
+ * We can use Object.entries here
2034
+ * to avoid the hasOwnProperty check,
2035
+ * but that would require 2 iterations
2036
+ * where as this only requires 1.
2037
+ */
2038
+ for (const key in props) {
2039
+ const value = props[key];
2040
+ if (props.hasOwnProperty(key) && value !== EMPTY_PROP$1) {
2041
+ restOfProps[key] = value;
2042
+ }
2043
+ }
2044
+ /**
2045
+ * Some overlays need a wrapper element so content
2046
+ * takes up the full size of the parent overlay.
2047
+ */
2048
+ const renderChildren = () => {
2049
+ if (hasDelegateHost) {
2050
+ return h('div', { className: 'ion-delegate-host ion-page' }, slots);
2051
+ }
2052
+ return slots;
2053
+ };
2054
+ return h(name, Object.assign(Object.assign({}, restOfProps), { ref: elementRef }),
2055
+ /**
2056
+ * When binding keepContentsMounted as an attribute
2057
+ * i.e. <ion-modal keep-contents-mounted></ion-modal>
2058
+ * the value of the prop will be the empty string which is
2059
+ * why we still call renderChildren() in that case.
2060
+ */
2061
+ (isOpen.value || restOfProps.keepContentsMounted || restOfProps.keepContentsMounted === '') ? renderChildren() : undefined);
2062
+ };
2063
+ });
2064
+ };
2065
+ const Container = (controller !== undefined) ? createControllerComponent() : createInlineComponent();
2066
+ Container.name = name;
2067
+ Container.props = {
2068
+ 'isOpen': DEFAULT_EMPTY_PROP$1
2069
+ };
2070
+ componentProps.forEach(componentProp => {
2071
+ Container.props[componentProp] = DEFAULT_EMPTY_PROP$1;
2072
+ });
2073
+ if (controller !== undefined) {
2074
+ Container.emits = ['willPresent', 'didPresent', 'willDismiss', 'didDismiss'];
2075
+ }
2076
+ return Container;
2077
+ };
2078
+
2079
+ /**
2080
+ * This is an autogenerated file created by 'scripts/copy-overlays.js'.
2081
+ * Changes made to this file will be overwritten on build.
2082
+ */
2083
+ const IonActionSheet = /*@__PURE__*/ defineOverlayContainer('ion-action-sheet', defineCustomElement$1b, ['animated', 'backdropDismiss', 'buttons', 'cssClass', 'enterAnimation', 'header', 'htmlAttributes', 'isOpen', 'keyboardClose', 'leaveAnimation', 'mode', 'subHeader', 'translucent', 'trigger']);
2084
+ const IonAlert = /*@__PURE__*/ defineOverlayContainer('ion-alert', defineCustomElement$1c, ['animated', 'backdropDismiss', 'buttons', 'cssClass', 'enterAnimation', 'header', 'htmlAttributes', 'inputs', 'isOpen', 'keyboardClose', 'leaveAnimation', 'message', 'mode', 'subHeader', 'translucent', 'trigger']);
2085
+ const IonLoading = /*@__PURE__*/ defineOverlayContainer('ion-loading', defineCustomElement$1d, ['animated', 'backdropDismiss', 'cssClass', 'duration', 'enterAnimation', 'htmlAttributes', 'isOpen', 'keyboardClose', 'leaveAnimation', 'message', 'mode', 'showBackdrop', 'spinner', 'translucent', 'trigger']);
2086
+ const IonPicker = /*@__PURE__*/ defineOverlayContainer('ion-picker', defineCustomElement$1e, ['animated', 'backdropDismiss', 'buttons', 'columns', 'cssClass', 'duration', 'enterAnimation', 'htmlAttributes', 'isOpen', 'keyboardClose', 'leaveAnimation', 'mode', 'showBackdrop', 'trigger']);
2087
+ const IonToast = /*@__PURE__*/ defineOverlayContainer('ion-toast', defineCustomElement$1f, ['animated', 'buttons', 'color', 'cssClass', 'duration', 'enterAnimation', 'header', 'htmlAttributes', 'icon', 'isOpen', 'keyboardClose', 'layout', 'leaveAnimation', 'message', 'mode', 'position', 'positionAnchor', 'translucent', 'trigger']);
2088
+ const IonModal = /*@__PURE__*/ defineOverlayContainer('ion-modal', defineCustomElement$1g, ['animated', 'backdropBreakpoint', 'backdropDismiss', 'breakpoints', 'canDismiss', 'enterAnimation', 'handle', 'handleBehavior', 'htmlAttributes', 'initialBreakpoint', 'isOpen', 'keepContentsMounted', 'keyboardClose', 'leaveAnimation', 'mode', 'presentingElement', 'showBackdrop', 'trigger'], true);
2089
+ const IonPopover = /*@__PURE__*/ defineOverlayContainer('ion-popover', defineCustomElement$1h, ['alignment', 'animated', 'arrow', 'backdropDismiss', 'component', 'componentProps', 'dismissOnSelect', 'enterAnimation', 'event', 'htmlAttributes', 'isOpen', 'keepContentsMounted', 'keyboardClose', 'leaveAnimation', 'mode', 'reference', 'showBackdrop', 'side', 'size', 'translucent', 'trigger', 'triggerAction']);
2090
+
2091
+ // TODO(FW-2969): types
2092
+ /**
2093
+ * Wrap the controllers export from @ionic/core
2094
+ * register the underlying Web Component and
2095
+ * (optionally) provide a framework delegate.
2096
+ */
2097
+ const createController = (defineCustomElement, oldController, useDelegate = false) => {
2098
+ const delegate = useDelegate ? VueDelegate() : undefined;
2099
+ const oldCreate = oldController.create.bind(oldController);
2100
+ oldController.create = (options) => {
2101
+ defineCustomElement();
2102
+ return oldCreate(Object.assign(Object.assign({}, options), { delegate }));
2103
+ };
2104
+ return oldController;
2105
+ };
2106
+ const modalController = /*@__PURE__*/ createController(defineCustomElement$1g, modalController$1, true);
2107
+ const popoverController = /*@__PURE__*/ createController(defineCustomElement$1h, popoverController$1, true);
2108
+ const alertController = /*@__PURE__*/ createController(defineCustomElement$1c, alertController$1);
2109
+ const actionSheetController = /*@__PURE__*/ createController(defineCustomElement$1b, actionSheetController$1);
2110
+ const loadingController = /*@__PURE__*/ createController(defineCustomElement$1d, loadingController$1);
2111
+ const pickerController = /*@__PURE__*/ createController(defineCustomElement$1e, pickerController$1);
2112
+ const toastController = /*@__PURE__*/ createController(defineCustomElement$1f, toastController$1);
2113
+
2114
+ 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, IonItem, IonItemDivider, IonItemGroup, IonItemOption, IonItemOptions, IonItemSliding, IonLabel, IonList, IonListHeader, IonLoading, IonMenu, IonMenuButton, IonMenuToggle, IonModal, IonNav, IonNavLink, IonNote, IonPage, IonPicker, IonPopover, IonProgressBar, IonRadio, IonRadioGroup, IonRange, IonRefresher, IonRefresherContent, IonReorder, IonReorderGroup, IonRippleEffect, IonRouterOutlet, IonRow, IonSearchbar, IonSegment, IonSegmentButton, IonSelect, IonSelectOption, IonSkeletonText, IonSpinner, IonSplitPane, IonTabBar, IonTabButton, IonTabs, IonText, IonTextarea, IonThumbnail, IonTitle, IonToast, IonToggle, IonToolbar, IonicVue, actionSheetController, alertController, loadingController, modalController, onIonViewDidEnter, onIonViewDidLeave, onIonViewWillEnter, onIonViewWillLeave, pickerController, popoverController, toastController, useBackButton, useIonRouter, useKeyboard };
120
2115
  //# sourceMappingURL=index.js.map