@ionic/vue 7.5.3-dev.11698760841.12aff234 → 7.5.3-dev.11698856380.18896dcd

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 (60) hide show
  1. package/dist/components/IonApp.js +25 -0
  2. package/dist/components/IonApp.js.map +7 -0
  3. package/dist/components/IonBackButton.js +28 -0
  4. package/dist/components/IonBackButton.js.map +7 -0
  5. package/dist/components/IonIcon.js +45 -0
  6. package/dist/components/IonIcon.js.map +7 -0
  7. package/dist/components/IonNav.js +15 -0
  8. package/dist/components/IonNav.js.map +7 -0
  9. package/dist/components/IonPage.js +26 -0
  10. package/dist/components/IonPage.js.map +7 -0
  11. package/dist/components/IonRouterOutlet.js +336 -0
  12. package/dist/components/IonRouterOutlet.js.map +7 -0
  13. package/dist/components/IonTabBar.js +126 -0
  14. package/dist/components/IonTabBar.js.map +7 -0
  15. package/dist/components/IonTabButton.js +54 -0
  16. package/dist/components/IonTabButton.js.map +7 -0
  17. package/dist/components/IonTabs.js +77 -0
  18. package/dist/components/IonTabs.js.map +7 -0
  19. package/dist/components/Overlays.js +16 -0
  20. package/dist/components/Overlays.js.map +7 -0
  21. package/dist/hooks/back-button.js +7 -0
  22. package/dist/hooks/back-button.js.map +7 -0
  23. package/dist/hooks/keyboard.js +29 -0
  24. package/dist/hooks/keyboard.js.map +7 -0
  25. package/dist/hooks/lifecycle.js +31 -0
  26. package/dist/hooks/lifecycle.js.map +7 -0
  27. package/dist/hooks/router.js +20 -0
  28. package/dist/hooks/router.js.map +7 -0
  29. package/dist/vetur/attributes.json +1 -1
  30. package/dist/vue-component-lib/overlays.js +142 -0
  31. package/dist/vue-component-lib/overlays.js.map +7 -0
  32. package/dist/vue-component-lib/utils.js +117 -0
  33. package/dist/vue-component-lib/utils.js.map +7 -0
  34. package/dist/web-types.json +2 -2
  35. package/package.json +5 -9
  36. package/dist/index.js +0 -2115
  37. package/dist/index.js.map +0 -1
  38. package/dist/types/components/IonApp.d.ts +0 -16
  39. package/dist/types/components/IonBackButton.d.ts +0 -3
  40. package/dist/types/components/IonIcon.d.ts +0 -27
  41. package/dist/types/components/IonNav.d.ts +0 -4
  42. package/dist/types/components/IonPage.d.ts +0 -15
  43. package/dist/types/components/IonRouterOutlet.d.ts +0 -8
  44. package/dist/types/components/IonTabBar.d.ts +0 -34
  45. package/dist/types/components/IonTabButton.d.ts +0 -33
  46. package/dist/types/components/IonTabs.d.ts +0 -4
  47. package/dist/types/components/Overlays.d.ts +0 -28
  48. package/dist/types/controllers.d.ts +0 -36
  49. package/dist/types/framework-delegate.d.ts +0 -7
  50. package/dist/types/globalExtensions.d.ts +0 -9
  51. package/dist/types/hooks/back-button.d.ts +0 -6
  52. package/dist/types/hooks/keyboard.d.ts +0 -7
  53. package/dist/types/hooks/lifecycle.d.ts +0 -5
  54. package/dist/types/hooks/router.d.ts +0 -21
  55. package/dist/types/index.d.ts +0 -19
  56. package/dist/types/ionic-vue.d.ts +0 -2
  57. package/dist/types/proxies.d.ts +0 -84
  58. package/dist/types/utils.d.ts +0 -14
  59. package/dist/types/vue-component-lib/overlays.d.ts +0 -9
  60. package/dist/types/vue-component-lib/utils.d.ts +0 -20
@@ -0,0 +1,25 @@
1
+ import { defineCustomElement } from "@ionic/core/components/ion-app.js";
2
+ import { h, defineComponent, shallowRef } from "vue";
3
+ const userComponents = shallowRef([]);
4
+ export const IonApp = /* @__PURE__ */ defineComponent((_, { attrs, slots }) => {
5
+ defineCustomElement();
6
+ return () => {
7
+ return h(
8
+ "ion-app",
9
+ {
10
+ ...attrs
11
+ },
12
+ [slots.default && slots.default(), ...userComponents.value]
13
+ );
14
+ };
15
+ });
16
+ IonApp.name = "IonApp";
17
+ export const addTeleportedUserComponent = (component) => {
18
+ userComponents.value = [...userComponents.value, component];
19
+ };
20
+ export const removeTeleportedUserComponent = (component) => {
21
+ userComponents.value = userComponents.value.filter(
22
+ (cmp) => cmp !== component
23
+ );
24
+ };
25
+ //# sourceMappingURL=IonApp.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/components/IonApp.ts"],
4
+ "sourcesContent": ["import { defineCustomElement } from \"@ionic/core/components/ion-app.js\";\nimport type { VNode } from \"vue\";\nimport { h, defineComponent, shallowRef } from \"vue\";\n\nconst userComponents = shallowRef([]);\nexport const IonApp = /*@__PURE__*/ defineComponent((_, { attrs, slots }) => {\n defineCustomElement();\n return () => {\n return h(\n \"ion-app\",\n {\n ...attrs,\n },\n [slots.default && slots.default(), ...userComponents.value]\n );\n };\n});\n\nIonApp.name = \"IonApp\";\n\n/**\n * When rendering user components inside of\n * ion-modal, or ion-popover the component\n * needs to be created inside of the current application\n * context otherwise libraries such as vue-i18n or vuex\n * will not work properly.\n *\n * `userComponents` renders teleported components as children\n * of `ion-app` within the current application context.\n */\nexport const addTeleportedUserComponent = (component: VNode) => {\n userComponents.value = [...userComponents.value, component];\n};\n\nexport const removeTeleportedUserComponent = (component: VNode) => {\n userComponents.value = userComponents.value.filter(\n (cmp) => cmp !== component\n );\n};\n"],
5
+ "mappings": "AAAA,SAAS,2BAA2B;AAEpC,SAAS,GAAG,iBAAiB,kBAAkB;AAE/C,MAAM,iBAAiB,WAAW,CAAC,CAAC;AAC7B,aAAM,SAAuB,gCAAgB,CAAC,GAAG,EAAE,OAAO,MAAM,MAAM;AAC3E,sBAAoB;AACpB,SAAO,MAAM;AACX,WAAO;AAAA,MACL;AAAA,MACA;AAAA,QACE,GAAG;AAAA,MACL;AAAA,MACA,CAAC,MAAM,WAAW,MAAM,QAAQ,GAAG,GAAG,eAAe,KAAK;AAAA,IAC5D;AAAA,EACF;AACF,CAAC;AAED,OAAO,OAAO;AAYP,aAAM,6BAA6B,CAAC,cAAqB;AAC9D,iBAAe,QAAQ,CAAC,GAAG,eAAe,OAAO,SAAS;AAC5D;AAEO,aAAM,gCAAgC,CAAC,cAAqB;AACjE,iBAAe,QAAQ,eAAe,MAAM;AAAA,IAC1C,CAAC,QAAQ,QAAQ;AAAA,EACnB;AACF;",
6
+ "names": []
7
+ }
@@ -0,0 +1,28 @@
1
+ import { defineCustomElement } from "@ionic/core/components/ion-back-button.js";
2
+ import { h, inject, defineComponent } from "vue";
3
+ export const IonBackButton = /* @__PURE__ */ defineComponent(
4
+ (_, { attrs, slots }) => {
5
+ defineCustomElement();
6
+ const ionRouter = inject("navManager");
7
+ const onClick = () => {
8
+ if (ionRouter === void 0) {
9
+ return;
10
+ }
11
+ const defaultHref = attrs["default-href"] || attrs["defaultHref"];
12
+ const routerAnimation = attrs["router-animation"] || attrs["routerAnimation"];
13
+ ionRouter.handleNavigateBack(defaultHref, routerAnimation);
14
+ };
15
+ return () => {
16
+ return h(
17
+ "ion-back-button",
18
+ {
19
+ onClick,
20
+ ...attrs
21
+ },
22
+ slots.default && slots.default()
23
+ );
24
+ };
25
+ }
26
+ );
27
+ IonBackButton.name = "IonBackButton";
28
+ //# sourceMappingURL=IonBackButton.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/components/IonBackButton.ts"],
4
+ "sourcesContent": ["import { defineCustomElement } from \"@ionic/core/components/ion-back-button.js\";\nimport { h, inject, defineComponent } from \"vue\";\n\nexport const IonBackButton = /*@__PURE__*/ defineComponent(\n (_, { attrs, slots }) => {\n defineCustomElement();\n\n // TODO(FW-2969): type\n const ionRouter: any = inject(\"navManager\");\n\n const onClick = () => {\n /**\n * When using ion-back-button outside of\n * a routing context, ionRouter is undefined.\n */\n if (ionRouter === undefined) {\n return;\n }\n\n const defaultHref = attrs[\"default-href\"] || attrs[\"defaultHref\"];\n const routerAnimation =\n attrs[\"router-animation\"] || attrs[\"routerAnimation\"];\n\n ionRouter.handleNavigateBack(defaultHref, routerAnimation);\n };\n\n return () => {\n return h(\n \"ion-back-button\",\n {\n onClick,\n ...attrs,\n },\n slots.default && slots.default()\n );\n };\n }\n);\n\nIonBackButton.name = \"IonBackButton\";\n"],
5
+ "mappings": "AAAA,SAAS,2BAA2B;AACpC,SAAS,GAAG,QAAQ,uBAAuB;AAEpC,aAAM,gBAA8B;AAAA,EACzC,CAAC,GAAG,EAAE,OAAO,MAAM,MAAM;AACvB,wBAAoB;AAGpB,UAAM,YAAiB,OAAO,YAAY;AAE1C,UAAM,UAAU,MAAM;AAKpB,UAAI,cAAc,QAAW;AAC3B;AAAA,MACF;AAEA,YAAM,cAAc,MAAM,cAAc,KAAK,MAAM,aAAa;AAChE,YAAM,kBACJ,MAAM,kBAAkB,KAAK,MAAM,iBAAiB;AAEtD,gBAAU,mBAAmB,aAAa,eAAe;AAAA,IAC3D;AAEA,WAAO,MAAM;AACX,aAAO;AAAA,QACL;AAAA,QACA;AAAA,UACE;AAAA,UACA,GAAG;AAAA,QACL;AAAA,QACA,MAAM,WAAW,MAAM,QAAQ;AAAA,MACjC;AAAA,IACF;AAAA,EACF;AACF;AAEA,cAAc,OAAO;",
6
+ "names": []
7
+ }
@@ -0,0 +1,45 @@
1
+ import { defineCustomElement } from "ionicons/components/ion-icon.js";
2
+ import { h, defineComponent } from "vue";
3
+ import { getConfig } from "../utils";
4
+ export const IonIcon = /* @__PURE__ */ defineComponent({
5
+ name: "IonIcon",
6
+ props: {
7
+ color: String,
8
+ flipRtl: Boolean,
9
+ icon: String,
10
+ ios: String,
11
+ lazy: String,
12
+ md: String,
13
+ mode: String,
14
+ name: String,
15
+ size: String,
16
+ src: String
17
+ },
18
+ setup(props, { slots }) {
19
+ defineCustomElement();
20
+ return () => {
21
+ const { icon, ios, md, mode } = props;
22
+ let iconToUse;
23
+ const config = getConfig();
24
+ const iconMode = mode || config?.get("mode");
25
+ if (ios || md) {
26
+ if (iconMode === "ios") {
27
+ iconToUse = ios ?? md ?? icon;
28
+ } else {
29
+ iconToUse = md ?? ios ?? icon;
30
+ }
31
+ } else {
32
+ iconToUse = icon;
33
+ }
34
+ return h(
35
+ "ion-icon",
36
+ {
37
+ ...props,
38
+ icon: iconToUse
39
+ },
40
+ slots
41
+ );
42
+ };
43
+ }
44
+ });
45
+ //# sourceMappingURL=IonIcon.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/components/IonIcon.ts"],
4
+ "sourcesContent": ["import { defineCustomElement } from \"ionicons/components/ion-icon.js\";\nimport { h, defineComponent } from \"vue\";\n\nimport { getConfig } from \"../utils\";\n\nexport const IonIcon = /*@__PURE__*/ defineComponent({\n name: \"IonIcon\",\n props: {\n color: String,\n flipRtl: Boolean,\n icon: String,\n ios: String,\n lazy: String,\n md: String,\n mode: String,\n name: String,\n size: String,\n src: String,\n },\n setup(props, { slots }) {\n defineCustomElement();\n return () => {\n const { icon, ios, md, mode } = props;\n\n let iconToUse: typeof icon;\n\n const config = getConfig();\n const iconMode = mode || config?.get(\"mode\");\n\n if (ios || md) {\n if (iconMode === \"ios\") {\n iconToUse = ios ?? md ?? icon;\n } else {\n iconToUse = md ?? ios ?? icon;\n }\n } else {\n iconToUse = icon;\n }\n\n return h(\n \"ion-icon\",\n {\n ...props,\n icon: iconToUse,\n },\n slots\n );\n };\n },\n});\n"],
5
+ "mappings": "AAAA,SAAS,2BAA2B;AACpC,SAAS,GAAG,uBAAuB;AAEnC,SAAS,iBAAiB;AAEnB,aAAM,UAAwB,gCAAgB;AAAA,EACnD,MAAM;AAAA,EACN,OAAO;AAAA,IACL,OAAO;AAAA,IACP,SAAS;AAAA,IACT,MAAM;AAAA,IACN,KAAK;AAAA,IACL,MAAM;AAAA,IACN,IAAI;AAAA,IACJ,MAAM;AAAA,IACN,MAAM;AAAA,IACN,MAAM;AAAA,IACN,KAAK;AAAA,EACP;AAAA,EACA,MAAM,OAAO,EAAE,MAAM,GAAG;AACtB,wBAAoB;AACpB,WAAO,MAAM;AACX,YAAM,EAAE,MAAM,KAAK,IAAI,KAAK,IAAI;AAEhC,UAAI;AAEJ,YAAM,SAAS,UAAU;AACzB,YAAM,WAAW,QAAQ,QAAQ,IAAI,MAAM;AAE3C,UAAI,OAAO,IAAI;AACb,YAAI,aAAa,OAAO;AACtB,sBAAY,OAAO,MAAM;AAAA,QAC3B,OAAO;AACL,sBAAY,MAAM,OAAO;AAAA,QAC3B;AAAA,MACF,OAAO;AACL,oBAAY;AAAA,MACd;AAEA,aAAO;AAAA,QACL;AAAA,QACA;AAAA,UACE,GAAG;AAAA,UACH,MAAM;AAAA,QACR;AAAA,QACA;AAAA,MACF;AAAA,IACF;AAAA,EACF;AACF,CAAC;",
6
+ "names": []
7
+ }
@@ -0,0 +1,15 @@
1
+ import { defineCustomElement } from "@ionic/core/components/ion-nav.js";
2
+ import { defineComponent, h, shallowRef } from "vue";
3
+ import { VueDelegate } from "../framework-delegate";
4
+ export const IonNav = /* @__PURE__ */ defineComponent(() => {
5
+ defineCustomElement();
6
+ const views = shallowRef([]);
7
+ const addView = (component) => views.value = [...views.value, component];
8
+ const removeView = (component) => views.value = views.value.filter((cmp) => cmp !== component);
9
+ const delegate = VueDelegate(addView, removeView);
10
+ return () => {
11
+ return h("ion-nav", { delegate }, views.value);
12
+ };
13
+ });
14
+ IonNav.name = "IonNav";
15
+ //# sourceMappingURL=IonNav.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/components/IonNav.ts"],
4
+ "sourcesContent": ["import { defineCustomElement } from \"@ionic/core/components/ion-nav.js\";\nimport type { VNode } from \"vue\";\nimport { defineComponent, h, shallowRef } from \"vue\";\n\nimport { VueDelegate } from \"../framework-delegate\";\n\nexport const IonNav = /*@__PURE__*/ defineComponent(() => {\n defineCustomElement();\n const views = shallowRef([]);\n\n /**\n * Allows us to create the component\n * within the Vue application context.\n */\n const addView = (component: VNode) =>\n (views.value = [...views.value, component]);\n const removeView = (component: VNode) =>\n (views.value = views.value.filter((cmp) => cmp !== component));\n\n const delegate = VueDelegate(addView, removeView);\n return () => {\n return h(\"ion-nav\", { delegate }, views.value);\n };\n});\n\nIonNav.name = \"IonNav\";\n"],
5
+ "mappings": "AAAA,SAAS,2BAA2B;AAEpC,SAAS,iBAAiB,GAAG,kBAAkB;AAE/C,SAAS,mBAAmB;AAErB,aAAM,SAAuB,gCAAgB,MAAM;AACxD,sBAAoB;AACpB,QAAM,QAAQ,WAAW,CAAC,CAAC;AAM3B,QAAM,UAAU,CAAC,cACd,MAAM,QAAQ,CAAC,GAAG,MAAM,OAAO,SAAS;AAC3C,QAAM,aAAa,CAAC,cACjB,MAAM,QAAQ,MAAM,MAAM,OAAO,CAAC,QAAQ,QAAQ,SAAS;AAE9D,QAAM,WAAW,YAAY,SAAS,UAAU;AAChD,SAAO,MAAM;AACX,WAAO,EAAE,WAAW,EAAE,SAAS,GAAG,MAAM,KAAK;AAAA,EAC/C;AACF,CAAC;AAED,OAAO,OAAO;",
6
+ "names": []
7
+ }
@@ -0,0 +1,26 @@
1
+ import { h, defineComponent } from "vue";
2
+ export const IonPage = /* @__PURE__ */ defineComponent({
3
+ name: "IonPage",
4
+ props: {
5
+ // eslint-disable-next-line @typescript-eslint/no-empty-function
6
+ registerIonPage: { type: Function, default: () => {
7
+ } }
8
+ },
9
+ mounted() {
10
+ this.$props.registerIonPage(this.$refs.ionPage);
11
+ },
12
+ setup(_, { attrs, slots }) {
13
+ return () => {
14
+ return h(
15
+ "div",
16
+ {
17
+ ...attrs,
18
+ ["class"]: "ion-page",
19
+ ref: "ionPage"
20
+ },
21
+ slots.default && slots.default()
22
+ );
23
+ };
24
+ }
25
+ });
26
+ //# sourceMappingURL=IonPage.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/components/IonPage.ts"],
4
+ "sourcesContent": ["import { h, defineComponent } from \"vue\";\n\nexport const IonPage = /*@__PURE__*/ defineComponent({\n name: \"IonPage\",\n props: {\n // eslint-disable-next-line @typescript-eslint/no-empty-function\n registerIonPage: { type: Function, default: () => {} },\n },\n mounted() {\n this.$props.registerIonPage(this.$refs.ionPage);\n },\n setup(_, { attrs, slots }) {\n return () => {\n return h(\n \"div\",\n {\n ...attrs,\n [\"class\"]: \"ion-page\",\n ref: \"ionPage\",\n },\n slots.default && slots.default()\n );\n };\n },\n});\n"],
5
+ "mappings": "AAAA,SAAS,GAAG,uBAAuB;AAE5B,aAAM,UAAwB,gCAAgB;AAAA,EACnD,MAAM;AAAA,EACN,OAAO;AAAA;AAAA,IAEL,iBAAiB,EAAE,MAAM,UAAU,SAAS,MAAM;AAAA,IAAC,EAAE;AAAA,EACvD;AAAA,EACA,UAAU;AACR,SAAK,OAAO,gBAAgB,KAAK,MAAM,OAAO;AAAA,EAChD;AAAA,EACA,MAAM,GAAG,EAAE,OAAO,MAAM,GAAG;AACzB,WAAO,MAAM;AACX,aAAO;AAAA,QACL;AAAA,QACA;AAAA,UACE,GAAG;AAAA,UACH,CAAC,OAAO,GAAG;AAAA,UACX,KAAK;AAAA,QACP;AAAA,QACA,MAAM,WAAW,MAAM,QAAQ;AAAA,MACjC;AAAA,IACF;AAAA,EACF;AACF,CAAC;",
6
+ "names": []
7
+ }
@@ -0,0 +1,336 @@
1
+ import {
2
+ LIFECYCLE_DID_ENTER,
3
+ LIFECYCLE_DID_LEAVE,
4
+ LIFECYCLE_WILL_ENTER,
5
+ LIFECYCLE_WILL_LEAVE
6
+ } from "@ionic/core/components";
7
+ import { defineCustomElement } from "@ionic/core/components/ion-router-outlet.js";
8
+ import {
9
+ h,
10
+ defineComponent,
11
+ ref,
12
+ computed,
13
+ inject,
14
+ provide,
15
+ watch,
16
+ shallowRef,
17
+ onUnmounted
18
+ } from "vue";
19
+ import { matchedRouteKey, routeLocationKey, useRoute } from "vue-router";
20
+ import { fireLifecycle, generateId, getConfig } from "../utils";
21
+ const isViewVisible = (enteringEl) => {
22
+ return !enteringEl.classList.contains("ion-page-hidden") && !enteringEl.classList.contains("ion-page-invisible");
23
+ };
24
+ const viewDepthKey = Symbol(0);
25
+ export const IonRouterOutlet = /* @__PURE__ */ defineComponent({
26
+ name: "IonRouterOutlet",
27
+ setup() {
28
+ defineCustomElement();
29
+ const injectedRoute = inject(routeLocationKey);
30
+ const route = useRoute();
31
+ const depth = inject(viewDepthKey, 0);
32
+ const matchedRouteRef = computed(() => route.matched[depth]);
33
+ let previousMatchedRouteRef;
34
+ let previousMatchedPath;
35
+ provide(viewDepthKey, depth + 1);
36
+ provide(matchedRouteKey, matchedRouteRef);
37
+ const ionRouterOutlet = ref();
38
+ const id = generateId("ion-router-outlet");
39
+ const ionRouter = inject("navManager");
40
+ const viewStacks = inject("viewStacks");
41
+ const components = shallowRef([]);
42
+ let skipTransition = false;
43
+ let parentOutletPath;
44
+ watch(
45
+ () => [route, matchedRouteRef.value],
46
+ ([currentRoute, currentMatchedRouteRef]) => {
47
+ if (currentMatchedRouteRef !== void 0) {
48
+ const matchedDifferentRoutes = currentMatchedRouteRef !== previousMatchedRouteRef;
49
+ const matchedDifferentParameterRoutes = currentRoute.matched[currentRoute.matched.length - 1] === currentMatchedRouteRef && currentRoute.path !== previousMatchedPath;
50
+ if (matchedDifferentRoutes || matchedDifferentParameterRoutes) {
51
+ setupViewItem(matchedRouteRef);
52
+ }
53
+ }
54
+ previousMatchedRouteRef = currentMatchedRouteRef;
55
+ previousMatchedPath = currentRoute.path;
56
+ }
57
+ );
58
+ const canStart = () => {
59
+ const config = getConfig();
60
+ const swipeEnabled = config && config.get("swipeBackEnabled", ionRouterOutlet.value.mode === "ios");
61
+ if (!swipeEnabled)
62
+ return false;
63
+ const stack = viewStacks.getViewStack(id);
64
+ if (!stack || stack.length <= 1)
65
+ return false;
66
+ const routeInfo = ionRouter.getLeavingRouteInfo();
67
+ const enteringViewItem = viewStacks.findViewItemByRouteInfo(
68
+ { pathname: routeInfo.pushedByRoute || "" },
69
+ id
70
+ );
71
+ return !!enteringViewItem;
72
+ };
73
+ const onStart = async () => {
74
+ const routeInfo = ionRouter.getLeavingRouteInfo();
75
+ const { routerAnimation } = routeInfo;
76
+ const enteringViewItem = viewStacks.findViewItemByRouteInfo(
77
+ { pathname: routeInfo.pushedByRoute || "" },
78
+ id
79
+ );
80
+ const leavingViewItem = viewStacks.findViewItemByRouteInfo(routeInfo, id);
81
+ if (leavingViewItem) {
82
+ let animationBuilder = routerAnimation;
83
+ const enteringEl = enteringViewItem.ionPageElement;
84
+ const leavingEl = leavingViewItem.ionPageElement;
85
+ const customAnimation = enteringViewItem.routerAnimation;
86
+ if (animationBuilder === void 0 && customAnimation !== void 0) {
87
+ animationBuilder = customAnimation;
88
+ }
89
+ leavingViewItem.routerAnimation = animationBuilder;
90
+ await transition(
91
+ enteringEl,
92
+ leavingEl,
93
+ "back",
94
+ ionRouter.canGoBack(2),
95
+ true,
96
+ animationBuilder
97
+ );
98
+ }
99
+ return Promise.resolve();
100
+ };
101
+ const onEnd = (shouldContinue) => {
102
+ if (shouldContinue) {
103
+ skipTransition = true;
104
+ ionRouter.handleNavigateBack();
105
+ } else {
106
+ const routeInfo = ionRouter.getCurrentRouteInfo();
107
+ const enteringViewItem = viewStacks.findViewItemByRouteInfo(
108
+ { pathname: routeInfo.pushedByRoute || "" },
109
+ id
110
+ );
111
+ enteringViewItem.ionPageElement.setAttribute("aria-hidden", "true");
112
+ enteringViewItem.ionPageElement.classList.add("ion-page-hidden");
113
+ }
114
+ };
115
+ watch(ionRouterOutlet, () => {
116
+ ionRouterOutlet.value.swipeHandler = {
117
+ canStart,
118
+ onStart,
119
+ onEnd
120
+ };
121
+ });
122
+ const transition = async (enteringEl, leavingEl, direction, showGoBack, progressAnimation, animationBuilder) => {
123
+ if (skipTransition) {
124
+ skipTransition = false;
125
+ return Promise.resolve(false);
126
+ }
127
+ if (enteringEl === leavingEl) {
128
+ return Promise.resolve(false);
129
+ }
130
+ enteringEl.classList.add("ion-page-invisible");
131
+ const hasRootDirection = direction === void 0 || direction === "root" || direction === "none";
132
+ const result = await ionRouterOutlet.value.commit(enteringEl, leavingEl, {
133
+ /**
134
+ * replace operations result in a direction of none.
135
+ * These typically do not have need animations, so we set
136
+ * the duration to 0. However, if a developer explicitly
137
+ * passes an animationBuilder, we should assume that
138
+ * they want an animation to be played even
139
+ * though it is a replace operation.
140
+ */
141
+ duration: hasRootDirection && animationBuilder === void 0 ? 0 : void 0,
142
+ direction,
143
+ showGoBack,
144
+ progressAnimation,
145
+ animationBuilder
146
+ });
147
+ return result;
148
+ };
149
+ const handlePageTransition = async () => {
150
+ const routeInfo = ionRouter.getCurrentRouteInfo();
151
+ const {
152
+ routerDirection,
153
+ routerAction,
154
+ routerAnimation,
155
+ prevRouteLastPathname,
156
+ delta
157
+ } = routeInfo;
158
+ const enteringViewItem = viewStacks.findViewItemByRouteInfo(
159
+ routeInfo,
160
+ id
161
+ );
162
+ let leavingViewItem = viewStacks.findLeavingViewItemByRouteInfo(
163
+ routeInfo,
164
+ id
165
+ );
166
+ const enteringEl = enteringViewItem.ionPageElement;
167
+ if (enteringEl === void 0) {
168
+ 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.
169
+
170
+ See https://ionicframework.com/docs/vue/navigation#ionpage for more information.`);
171
+ }
172
+ if (enteringViewItem === leavingViewItem)
173
+ return;
174
+ if (!leavingViewItem && prevRouteLastPathname) {
175
+ leavingViewItem = viewStacks.findViewItemByPathname(
176
+ prevRouteLastPathname,
177
+ id
178
+ );
179
+ }
180
+ if (isViewVisible(enteringEl) && leavingViewItem?.ionPageElement !== void 0 && !isViewVisible(leavingViewItem.ionPageElement)) {
181
+ return;
182
+ }
183
+ fireLifecycle(
184
+ enteringViewItem.vueComponent,
185
+ enteringViewItem.vueComponentRef,
186
+ LIFECYCLE_WILL_ENTER
187
+ );
188
+ if (leavingViewItem?.ionPageElement && enteringViewItem !== leavingViewItem) {
189
+ let animationBuilder = routerAnimation;
190
+ const leavingEl = leavingViewItem.ionPageElement;
191
+ fireLifecycle(
192
+ leavingViewItem.vueComponent,
193
+ leavingViewItem.vueComponentRef,
194
+ LIFECYCLE_WILL_LEAVE
195
+ );
196
+ const customAnimation = enteringViewItem.routerAnimation;
197
+ if (animationBuilder === void 0 && routerDirection === "back" && customAnimation !== void 0) {
198
+ animationBuilder = customAnimation;
199
+ }
200
+ leavingViewItem.routerAnimation = animationBuilder;
201
+ await transition(
202
+ enteringEl,
203
+ leavingEl,
204
+ routerDirection,
205
+ !!routeInfo.pushedByRoute,
206
+ false,
207
+ animationBuilder
208
+ );
209
+ leavingEl.classList.add("ion-page-hidden");
210
+ leavingEl.setAttribute("aria-hidden", "true");
211
+ const usingLinearNavigation = viewStacks.size() === 1;
212
+ if (routerAction === "replace") {
213
+ leavingViewItem.mount = false;
214
+ leavingViewItem.ionPageElement = void 0;
215
+ leavingViewItem.ionRoute = false;
216
+ } else if (!(routerAction === "push" && routerDirection === "forward")) {
217
+ const shouldLeavingViewBeRemoved = routerDirection !== "none" && leavingViewItem && enteringViewItem !== leavingViewItem;
218
+ if (shouldLeavingViewBeRemoved) {
219
+ leavingViewItem.mount = false;
220
+ leavingViewItem.ionPageElement = void 0;
221
+ leavingViewItem.ionRoute = false;
222
+ if (usingLinearNavigation) {
223
+ viewStacks.unmountLeavingViews(id, enteringViewItem, delta);
224
+ }
225
+ }
226
+ } else if (usingLinearNavigation) {
227
+ viewStacks.mountIntermediaryViews(id, leavingViewItem, delta);
228
+ }
229
+ fireLifecycle(
230
+ leavingViewItem.vueComponent,
231
+ leavingViewItem.vueComponentRef,
232
+ LIFECYCLE_DID_LEAVE
233
+ );
234
+ } else {
235
+ requestAnimationFrame(
236
+ () => enteringEl.classList.remove("ion-page-invisible")
237
+ );
238
+ }
239
+ fireLifecycle(
240
+ enteringViewItem.vueComponent,
241
+ enteringViewItem.vueComponentRef,
242
+ LIFECYCLE_DID_ENTER
243
+ );
244
+ components.value = viewStacks.getChildrenToRender(id);
245
+ };
246
+ const setupViewItem = (matchedRouteRef2) => {
247
+ const firstMatchedRoute = route.matched[0];
248
+ if (!parentOutletPath) {
249
+ parentOutletPath = firstMatchedRoute.path;
250
+ }
251
+ if (!matchedRouteRef2.value || matchedRouteRef2.value !== firstMatchedRoute && firstMatchedRoute.path !== parentOutletPath) {
252
+ return;
253
+ }
254
+ const currentRoute = ionRouter.getCurrentRouteInfo();
255
+ let enteringViewItem = viewStacks.findViewItemByRouteInfo(
256
+ currentRoute,
257
+ id
258
+ );
259
+ if (!enteringViewItem) {
260
+ enteringViewItem = viewStacks.createViewItem(
261
+ id,
262
+ matchedRouteRef2.value.components.default,
263
+ matchedRouteRef2.value,
264
+ currentRoute
265
+ );
266
+ viewStacks.add(enteringViewItem);
267
+ }
268
+ if (!enteringViewItem.mount) {
269
+ enteringViewItem.mount = true;
270
+ enteringViewItem.registerCallback = () => {
271
+ handlePageTransition();
272
+ enteringViewItem.registerCallback = void 0;
273
+ };
274
+ } else {
275
+ handlePageTransition();
276
+ }
277
+ components.value = viewStacks.getChildrenToRender(id);
278
+ };
279
+ if (matchedRouteRef.value) {
280
+ setupViewItem(matchedRouteRef);
281
+ }
282
+ onUnmounted(() => viewStacks.clear(id));
283
+ const registerIonPage = (viewItem, ionPageEl) => {
284
+ const oldIonPageEl = viewItem.ionPageElement;
285
+ viewStacks.registerIonPage(viewItem, ionPageEl);
286
+ if (viewItem.registerCallback) {
287
+ ionPageEl.classList.add("ion-page-invisible");
288
+ viewItem.registerCallback();
289
+ } else if (oldIonPageEl && !oldIonPageEl.classList.contains("ion-page-invisible")) {
290
+ ionPageEl.classList.remove("ion-page-invisible");
291
+ }
292
+ };
293
+ return {
294
+ id,
295
+ components,
296
+ injectedRoute,
297
+ ionRouterOutlet,
298
+ registerIonPage
299
+ };
300
+ },
301
+ render() {
302
+ const { components, registerIonPage, injectedRoute } = this;
303
+ return h(
304
+ "ion-router-outlet",
305
+ { ref: "ionRouterOutlet" },
306
+ components && components.map((c) => {
307
+ let props = {
308
+ ref: c.vueComponentRef,
309
+ key: c.pathname,
310
+ registerIonPage: (ionPageEl) => registerIonPage(c, ionPageEl)
311
+ };
312
+ const routePropsOption = c.matchedRoute?.props?.default;
313
+ const getPropsFunctionResult = () => {
314
+ const cachedPropsResult = c.vueComponentData?.propsFunctionResult;
315
+ if (cachedPropsResult) {
316
+ return cachedPropsResult;
317
+ } else {
318
+ const propsFunctionResult = routePropsOption(injectedRoute);
319
+ c.vueComponentData = {
320
+ ...c.vueComponentData,
321
+ propsFunctionResult
322
+ };
323
+ return propsFunctionResult;
324
+ }
325
+ };
326
+ const routeProps = routePropsOption ? routePropsOption === true ? c.params : typeof routePropsOption === "function" ? getPropsFunctionResult() : routePropsOption : null;
327
+ props = {
328
+ ...props,
329
+ ...routeProps
330
+ };
331
+ return h(c.vueComponent, props);
332
+ })
333
+ );
334
+ }
335
+ });
336
+ //# sourceMappingURL=IonRouterOutlet.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/components/IonRouterOutlet.ts"],
4
+ "sourcesContent": ["import type { AnimationBuilder } from \"@ionic/core/components\";\nimport {\n LIFECYCLE_DID_ENTER,\n LIFECYCLE_DID_LEAVE,\n LIFECYCLE_WILL_ENTER,\n LIFECYCLE_WILL_LEAVE,\n} from \"@ionic/core/components\";\nimport { defineCustomElement } from \"@ionic/core/components/ion-router-outlet.js\";\nimport {\n h,\n defineComponent,\n ref,\n computed,\n inject,\n provide,\n watch,\n shallowRef,\n onUnmounted,\n} from \"vue\";\nimport type { InjectionKey, Ref } from \"vue\";\nimport { matchedRouteKey, routeLocationKey, useRoute } from \"vue-router\";\n\nimport { fireLifecycle, generateId, getConfig } from \"../utils\";\n\n// TODO(FW-2969): types\n\nconst isViewVisible = (enteringEl: HTMLElement) => {\n return (\n !enteringEl.classList.contains(\"ion-page-hidden\") &&\n !enteringEl.classList.contains(\"ion-page-invisible\")\n );\n};\n\nconst viewDepthKey: InjectionKey<0> = Symbol(0);\nexport const IonRouterOutlet = /*@__PURE__*/ defineComponent({\n name: \"IonRouterOutlet\",\n setup() {\n defineCustomElement();\n\n const injectedRoute = inject(routeLocationKey)!;\n const route = useRoute();\n const depth = inject(viewDepthKey, 0);\n const matchedRouteRef: any = computed(() => route.matched[depth]);\n let previousMatchedRouteRef: Ref | undefined;\n let previousMatchedPath: string | undefined;\n\n provide(viewDepthKey, depth + 1);\n provide(matchedRouteKey, matchedRouteRef);\n\n const ionRouterOutlet = ref();\n const id = generateId(\"ion-router-outlet\");\n\n const ionRouter: any = inject(\"navManager\");\n const viewStacks: any = inject(\"viewStacks\");\n\n const components = shallowRef([]);\n\n let skipTransition = false;\n\n // The base url for this router outlet\n let parentOutletPath: string;\n\n /**\n * Note: Do not listen for matchedRouteRef by itself here\n * as the callback will not fire for parameterized routes (i.e. /page/:id).\n * So going from /page/1 to /page/2 would not fire this callback if we\n * only listened for changes to matchedRouteRef.\n */\n watch(\n () => [route, matchedRouteRef.value],\n ([currentRoute, currentMatchedRouteRef]) => {\n /**\n * This callback checks whether or not a router outlet\n * needs to respond to a change in the matched route.\n * It handles a few cases:\n * 1. The matched route is undefined. This means that\n * the matched route is not applicable to this outlet.\n * For example, a /settings route is not applicable\n * to a /tabs/... route.\n *\n * Note: When going back to a tabs outlet from a non-tabs outlet,\n * the tabs outlet should NOT attempt a page transition from the\n * previous tab to the active tab. To do this we compare the current\n * route with the previous route. Unfortunately, we cannot rely on the\n * previous value provided by Vue in the watch callback. This is because\n * when coming back to the tabs context, the previous matched route will\n * be undefined (because nothing in the tabs context matches /settings)\n * but the current matched route will be defined and so a transition\n * will always occur.\n *\n * 2. The matched route is defined and is different than\n * the previously matched route. This is the most\n * common case such as when you go from /page1 to /page2.\n *\n * 3. The matched route is the same but the parameters are different.\n * This is a special case for parameterized routes (i.e. /page/:id).\n * When going from /page/1 to /page/2, the matched route object will\n * be the same, but we still need to perform a page transition. To do this\n * we check if the parameters are different (i.e. 1 vs 2). To avoid enumerating\n * all of the keys in the params object, we check the url path to\n * see if they are different after ensuring we are in a parameterized route.\n */\n if (currentMatchedRouteRef !== undefined) {\n const matchedDifferentRoutes =\n currentMatchedRouteRef !== previousMatchedRouteRef;\n const matchedDifferentParameterRoutes =\n currentRoute.matched[currentRoute.matched.length - 1] ===\n currentMatchedRouteRef &&\n currentRoute.path !== previousMatchedPath;\n\n if (matchedDifferentRoutes || matchedDifferentParameterRoutes) {\n setupViewItem(matchedRouteRef);\n }\n }\n\n previousMatchedRouteRef = currentMatchedRouteRef;\n previousMatchedPath = currentRoute.path;\n }\n );\n\n const canStart = () => {\n const config = getConfig();\n const swipeEnabled =\n config &&\n config.get(\"swipeBackEnabled\", ionRouterOutlet.value.mode === \"ios\");\n if (!swipeEnabled) return false;\n\n const stack = viewStacks.getViewStack(id);\n if (!stack || stack.length <= 1) return false;\n\n /**\n * We only want to outlet of the entering view\n * to respond to this gesture, so check\n * to make sure the view is in the outlet we want.\n */\n const routeInfo = ionRouter.getLeavingRouteInfo();\n const enteringViewItem = viewStacks.findViewItemByRouteInfo(\n { pathname: routeInfo.pushedByRoute || \"\" },\n id\n );\n\n return !!enteringViewItem;\n };\n const onStart = async () => {\n const routeInfo = ionRouter.getLeavingRouteInfo();\n const { routerAnimation } = routeInfo;\n const enteringViewItem = viewStacks.findViewItemByRouteInfo(\n { pathname: routeInfo.pushedByRoute || \"\" },\n id\n );\n const leavingViewItem = viewStacks.findViewItemByRouteInfo(routeInfo, id);\n\n if (leavingViewItem) {\n let animationBuilder = routerAnimation;\n const enteringEl = enteringViewItem.ionPageElement;\n const leavingEl = leavingViewItem.ionPageElement;\n\n /**\n * If we are going back from a page that\n * was presented using a custom animation\n * we should default to using that\n * unless the developer explicitly\n * provided another animation.\n */\n const customAnimation = enteringViewItem.routerAnimation;\n if (animationBuilder === undefined && customAnimation !== undefined) {\n animationBuilder = customAnimation;\n }\n\n leavingViewItem.routerAnimation = animationBuilder;\n\n await transition(\n enteringEl,\n leavingEl,\n \"back\",\n ionRouter.canGoBack(2),\n true,\n animationBuilder\n );\n }\n\n return Promise.resolve();\n };\n\n const onEnd = (shouldContinue: boolean) => {\n if (shouldContinue) {\n skipTransition = true;\n\n /**\n * Use the same logic as clicking\n * ion-back-button to determine where\n * to go back to.\n */\n ionRouter.handleNavigateBack();\n } else {\n /**\n * In the event that the swipe\n * gesture was aborted, we should\n * re-hide the page that was going to enter.\n */\n const routeInfo = ionRouter.getCurrentRouteInfo();\n const enteringViewItem = viewStacks.findViewItemByRouteInfo(\n { pathname: routeInfo.pushedByRoute || \"\" },\n id\n );\n enteringViewItem.ionPageElement.setAttribute(\"aria-hidden\", \"true\");\n enteringViewItem.ionPageElement.classList.add(\"ion-page-hidden\");\n }\n };\n\n watch(ionRouterOutlet, () => {\n ionRouterOutlet.value.swipeHandler = {\n canStart,\n onStart,\n onEnd,\n };\n });\n\n const transition = async (\n enteringEl: HTMLElement,\n leavingEl: HTMLElement,\n direction: any,\n showGoBack: boolean,\n progressAnimation: boolean,\n animationBuilder?: AnimationBuilder\n ) => {\n if (skipTransition) {\n skipTransition = false;\n return Promise.resolve(false);\n }\n\n if (enteringEl === leavingEl) {\n return Promise.resolve(false);\n }\n\n enteringEl.classList.add(\"ion-page-invisible\");\n\n const hasRootDirection =\n direction === undefined || direction === \"root\" || direction === \"none\";\n const result = await ionRouterOutlet.value.commit(enteringEl, leavingEl, {\n /**\n * replace operations result in a direction of none.\n * These typically do not have need animations, so we set\n * the duration to 0. However, if a developer explicitly\n * passes an animationBuilder, we should assume that\n * they want an animation to be played even\n * though it is a replace operation.\n */\n duration:\n hasRootDirection && animationBuilder === undefined ? 0 : undefined,\n direction,\n showGoBack,\n progressAnimation,\n animationBuilder,\n });\n\n return result;\n };\n\n const handlePageTransition = async () => {\n const routeInfo = ionRouter.getCurrentRouteInfo();\n const {\n routerDirection,\n routerAction,\n routerAnimation,\n prevRouteLastPathname,\n delta,\n } = routeInfo;\n\n const enteringViewItem = viewStacks.findViewItemByRouteInfo(\n routeInfo,\n id\n );\n let leavingViewItem = viewStacks.findLeavingViewItemByRouteInfo(\n routeInfo,\n id\n );\n const enteringEl = enteringViewItem.ionPageElement;\n\n /**\n * All views that can be transitioned to must have\n * an `<ion-page>` element for transitions and lifecycle\n * methods to work properly.\n */\n if (enteringEl === undefined) {\n 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.\n\nSee https://ionicframework.com/docs/vue/navigation#ionpage for more information.`);\n }\n if (enteringViewItem === leavingViewItem) return;\n\n if (!leavingViewItem && prevRouteLastPathname) {\n leavingViewItem = viewStacks.findViewItemByPathname(\n prevRouteLastPathname,\n id\n );\n }\n\n /**\n * If the entering view is already\n * visible, then no transition is needed.\n * This is most common when navigating\n * from a tabs page to a non-tabs page\n * and then back to the tabs page.\n * Even when the tabs context navigated away,\n * the inner tabs page was still active.\n * This also avoids an issue where\n * the previous tabs page is incorrectly\n * unmounted since it would automatically\n * unmount the previous view.\n *\n * This should also only apply to entering and\n * leaving items in the same router outlet (i.e.\n * Tab1 and Tab2), otherwise this will\n * return early for swipe to go back when\n * going from a non-tabs page to a tabs page.\n */\n if (\n isViewVisible(enteringEl) &&\n leavingViewItem?.ionPageElement !== undefined &&\n !isViewVisible(leavingViewItem.ionPageElement)\n ) {\n return;\n }\n\n fireLifecycle(\n enteringViewItem.vueComponent,\n enteringViewItem.vueComponentRef,\n LIFECYCLE_WILL_ENTER\n );\n\n if (\n leavingViewItem?.ionPageElement &&\n enteringViewItem !== leavingViewItem\n ) {\n let animationBuilder = routerAnimation;\n const leavingEl = leavingViewItem.ionPageElement;\n\n fireLifecycle(\n leavingViewItem.vueComponent,\n leavingViewItem.vueComponentRef,\n LIFECYCLE_WILL_LEAVE\n );\n\n /**\n * If we are going back from a page that\n * was presented using a custom animation\n * we should default to using that\n * unless the developer explicitly\n * provided another animation.\n */\n const customAnimation = enteringViewItem.routerAnimation;\n if (\n animationBuilder === undefined &&\n routerDirection === \"back\" &&\n customAnimation !== undefined\n ) {\n animationBuilder = customAnimation;\n }\n\n leavingViewItem.routerAnimation = animationBuilder;\n\n await transition(\n enteringEl,\n leavingEl,\n routerDirection,\n !!routeInfo.pushedByRoute,\n false,\n animationBuilder\n );\n\n leavingEl.classList.add(\"ion-page-hidden\");\n leavingEl.setAttribute(\"aria-hidden\", \"true\");\n\n const usingLinearNavigation = viewStacks.size() === 1;\n\n if (routerAction === \"replace\") {\n leavingViewItem.mount = false;\n leavingViewItem.ionPageElement = undefined;\n leavingViewItem.ionRoute = false;\n } else if (\n !(routerAction === \"push\" && routerDirection === \"forward\")\n ) {\n const shouldLeavingViewBeRemoved =\n routerDirection !== \"none\" &&\n leavingViewItem &&\n enteringViewItem !== leavingViewItem;\n if (shouldLeavingViewBeRemoved) {\n leavingViewItem.mount = false;\n leavingViewItem.ionPageElement = undefined;\n leavingViewItem.ionRoute = false;\n\n /**\n * router.go() expects navigation to be\n * linear. If an app is using multiple stacks then\n * it is not using linear navigation. As a result, router.go()\n * will not give the results that developers are expecting.\n */\n if (usingLinearNavigation) {\n viewStacks.unmountLeavingViews(id, enteringViewItem, delta);\n }\n }\n } else if (usingLinearNavigation) {\n viewStacks.mountIntermediaryViews(id, leavingViewItem, delta);\n }\n\n fireLifecycle(\n leavingViewItem.vueComponent,\n leavingViewItem.vueComponentRef,\n LIFECYCLE_DID_LEAVE\n );\n } else {\n /**\n * If there is no leaving element, just show\n * the entering element. Wrap it in an raf\n * in case ion-content's fullscreen callback\n * is running. Otherwise we'd have a flicker.\n */\n requestAnimationFrame(() =>\n enteringEl.classList.remove(\"ion-page-invisible\")\n );\n }\n\n fireLifecycle(\n enteringViewItem.vueComponent,\n enteringViewItem.vueComponentRef,\n LIFECYCLE_DID_ENTER\n );\n\n components.value = viewStacks.getChildrenToRender(id);\n };\n\n const setupViewItem = (matchedRouteRef: any) => {\n const firstMatchedRoute = route.matched[0];\n if (!parentOutletPath) {\n parentOutletPath = firstMatchedRoute.path;\n }\n\n /**\n * If no matched route, do not do anything in this outlet.\n * If there is a match, but it the first matched path\n * is not the root path for this outlet, then this view\n * change needs to be rendered in a different outlet.\n * We also add an exception for when the matchedRouteRef is\n * equal to the first matched route (i.e. the base router outlet).\n * This logic is mainly to help nested outlets/multi-tab\n * setups work better.\n */\n if (\n !matchedRouteRef.value ||\n (matchedRouteRef.value !== firstMatchedRoute &&\n firstMatchedRoute.path !== parentOutletPath)\n ) {\n return;\n }\n\n const currentRoute = ionRouter.getCurrentRouteInfo();\n let enteringViewItem = viewStacks.findViewItemByRouteInfo(\n currentRoute,\n id\n );\n\n if (!enteringViewItem) {\n enteringViewItem = viewStacks.createViewItem(\n id,\n matchedRouteRef.value.components.default,\n matchedRouteRef.value,\n currentRoute\n );\n viewStacks.add(enteringViewItem);\n }\n\n if (!enteringViewItem.mount) {\n enteringViewItem.mount = true;\n enteringViewItem.registerCallback = () => {\n handlePageTransition();\n enteringViewItem.registerCallback = undefined;\n };\n } else {\n handlePageTransition();\n }\n\n components.value = viewStacks.getChildrenToRender(id);\n };\n\n if (matchedRouteRef.value) {\n setupViewItem(matchedRouteRef);\n }\n\n /**\n * Remove stack data for this outlet\n * when outlet is destroyed otherwise\n * we will see cached view data.\n */\n onUnmounted(() => viewStacks.clear(id));\n\n const registerIonPage = (viewItem: any, ionPageEl: HTMLElement) => {\n const oldIonPageEl = viewItem.ionPageElement;\n\n viewStacks.registerIonPage(viewItem, ionPageEl);\n\n /**\n * If there is a registerCallback,\n * then this component is being registered\n * as a result of a navigation change.\n */\n if (viewItem.registerCallback) {\n /**\n * Page should be hidden initially\n * to avoid flickering.\n */\n ionPageEl.classList.add(\"ion-page-invisible\");\n viewItem.registerCallback();\n\n /**\n * If there is no registerCallback, then\n * this component is likely being re-registered\n * as a result of a hot module replacement.\n * We need to see if the oldIonPageEl has\n * .ion-page-invisible. If it does not then we\n * need to remove it from the new ionPageEl otherwise\n * the page will be hidden when it is replaced.\n */\n } else if (\n oldIonPageEl &&\n !oldIonPageEl.classList.contains(\"ion-page-invisible\")\n ) {\n ionPageEl.classList.remove(\"ion-page-invisible\");\n }\n };\n return {\n id,\n components,\n injectedRoute,\n ionRouterOutlet,\n registerIonPage,\n };\n },\n render() {\n const { components, registerIonPage, injectedRoute } = this;\n\n return h(\n \"ion-router-outlet\",\n { ref: \"ionRouterOutlet\" },\n components &&\n components.map((c: any) => {\n let props = {\n ref: c.vueComponentRef,\n key: c.pathname,\n registerIonPage: (ionPageEl: HTMLElement) =>\n registerIonPage(c, ionPageEl),\n };\n\n /**\n * IonRouterOutlet does not support named outlets.\n */\n const routePropsOption = c.matchedRoute?.props?.default;\n\n /**\n * Since IonRouterOutlet renders multiple components,\n * each render will cause all props functions to be\n * called again. As a result, we need to cache the function\n * result and provide it on each render so that the props\n * are not lost when navigating from and back to a page.\n * When a component is destroyed and re-created, the\n * function is called again.\n */\n const getPropsFunctionResult = () => {\n const cachedPropsResult = c.vueComponentData?.propsFunctionResult;\n if (cachedPropsResult) {\n return cachedPropsResult;\n } else {\n const propsFunctionResult = routePropsOption(injectedRoute);\n c.vueComponentData = {\n ...c.vueComponentData,\n propsFunctionResult,\n };\n return propsFunctionResult;\n }\n };\n const routeProps = routePropsOption\n ? routePropsOption === true\n ? c.params\n : typeof routePropsOption === \"function\"\n ? getPropsFunctionResult()\n : routePropsOption\n : null;\n\n props = {\n ...props,\n ...routeProps,\n };\n\n return h(c.vueComponent, props);\n })\n );\n },\n});\n"],
5
+ "mappings": "AACA;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SAAS,2BAA2B;AACpC;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAEP,SAAS,iBAAiB,kBAAkB,gBAAgB;AAE5D,SAAS,eAAe,YAAY,iBAAiB;AAIrD,MAAM,gBAAgB,CAAC,eAA4B;AACjD,SACE,CAAC,WAAW,UAAU,SAAS,iBAAiB,KAChD,CAAC,WAAW,UAAU,SAAS,oBAAoB;AAEvD;AAEA,MAAM,eAAgC,OAAO,CAAC;AACvC,aAAM,kBAAgC,gCAAgB;AAAA,EAC3D,MAAM;AAAA,EACN,QAAQ;AACN,wBA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