@ionic/react 7.5.3-dev.11698856380.18896dcd → 7.5.3-dev.11698858201.14165f23
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/CreateAnimation.js +107 -0
- package/dist/components/CreateAnimation.js.map +7 -0
- package/dist/components/IonActionSheet.js +8 -0
- package/dist/components/IonActionSheet.js.map +7 -0
- package/dist/components/IonAlert.js +8 -0
- package/dist/components/IonAlert.js.map +7 -0
- package/dist/components/IonApp.js +42 -0
- package/dist/components/IonApp.js.map +7 -0
- package/dist/components/IonIcon.js +39 -0
- package/dist/components/IonIcon.js.map +7 -0
- package/dist/components/IonLoading.js +8 -0
- package/dist/components/IonLoading.js.map +7 -0
- package/dist/components/IonModal.js +9 -0
- package/dist/components/IonModal.js.map +7 -0
- package/dist/components/IonOverlayManager.js +29 -0
- package/dist/components/IonOverlayManager.js.map +7 -0
- package/dist/components/IonPage.js +31 -0
- package/dist/components/IonPage.js.map +7 -0
- package/dist/components/IonPicker.js +8 -0
- package/dist/components/IonPicker.js.map +7 -0
- package/dist/components/IonPopover.js +8 -0
- package/dist/components/IonPopover.js.map +7 -0
- package/dist/components/IonRedirect.js +19 -0
- package/dist/components/IonRedirect.js.map +7 -0
- package/dist/components/IonRoute.js +17 -0
- package/dist/components/IonRoute.js.map +7 -0
- package/dist/components/IonRouterContext.js +32 -0
- package/dist/components/IonRouterContext.js.map +7 -0
- package/dist/components/IonRouterOutlet.js +24 -0
- package/dist/components/IonRouterOutlet.js.map +7 -0
- package/dist/components/IonToast.js +8 -0
- package/dist/components/IonToast.js.map +7 -0
- package/dist/components/IonicReactProps.js +2 -0
- package/dist/components/IonicReactProps.js.map +7 -0
- package/dist/components/__tests__/utils.spec.js +50 -0
- package/dist/components/__tests__/utils.spec.js.map +7 -0
- package/dist/components/createControllerComponent.js +80 -0
- package/dist/components/createControllerComponent.js.map +7 -0
- package/dist/components/createInlineOverlayComponent.js +114 -0
- package/dist/components/createInlineOverlayComponent.js.map +7 -0
- package/dist/components/createOverlayComponent.js +88 -0
- package/dist/components/createOverlayComponent.js.map +7 -0
- package/dist/components/createRoutingComponent.js +79 -0
- package/dist/components/createRoutingComponent.js.map +7 -0
- package/dist/components/hrefprops.js +2 -0
- package/dist/components/hrefprops.js.map +7 -0
- package/dist/components/index.js +126 -0
- package/dist/components/index.js.map +7 -0
- package/dist/components/inner-proxies.js +30 -0
- package/dist/components/inner-proxies.js.map +7 -0
- package/dist/components/navigation/IonBackButton.js +31 -0
- package/dist/components/navigation/IonBackButton.js.map +7 -0
- package/dist/components/navigation/IonNav.js +21 -0
- package/dist/components/navigation/IonNav.js.map +7 -0
- package/dist/components/navigation/IonTabBar.js +173 -0
- package/dist/components/navigation/IonTabBar.js.map +7 -0
- package/dist/components/navigation/IonTabButton.js +30 -0
- package/dist/components/navigation/IonTabButton.js.map +7 -0
- package/dist/components/navigation/IonTabs.js +103 -0
- package/dist/components/navigation/IonTabs.js.map +7 -0
- package/dist/components/navigation/IonTabsContext.js +7 -0
- package/dist/components/navigation/IonTabsContext.js.map +7 -0
- package/dist/components/proxies.js +131 -0
- package/dist/components/proxies.js.map +7 -0
- package/dist/components/react-component-lib/createComponent.js +58 -0
- package/dist/components/react-component-lib/createComponent.js.map +7 -0
- package/dist/components/react-component-lib/createOverlayComponent.js +86 -0
- package/dist/components/react-component-lib/createOverlayComponent.js.map +7 -0
- package/dist/components/react-component-lib/index.js +4 -0
- package/dist/components/react-component-lib/index.js.map +7 -0
- package/dist/components/react-component-lib/interfaces.js +2 -0
- package/dist/components/react-component-lib/interfaces.js.map +7 -0
- package/dist/components/react-component-lib/utils/attachProps.js +92 -0
- package/dist/components/react-component-lib/utils/attachProps.js.map +7 -0
- package/dist/components/react-component-lib/utils/case.js +4 -0
- package/dist/components/react-component-lib/utils/case.js.map +7 -0
- package/dist/components/react-component-lib/utils/dev.js +14 -0
- package/dist/components/react-component-lib/utils/dev.js.map +7 -0
- package/dist/components/react-component-lib/utils/index.js +31 -0
- package/dist/components/react-component-lib/utils/index.js.map +7 -0
- package/dist/components/routing-proxies.js +29 -0
- package/dist/components/routing-proxies.js.map +7 -0
- package/dist/components/utils/detachProps.js +24 -0
- package/dist/components/utils/detachProps.js.map +7 -0
- package/dist/components/utils/index.js +26 -0
- package/dist/components/utils/index.js.map +7 -0
- package/dist/components/utils/ionRenderToString.js +36 -0
- package/dist/components/utils/ionRenderToString.js.map +7 -0
- package/dist/contexts/IonContext.js +11 -0
- package/dist/contexts/IonContext.js.map +7 -0
- package/dist/contexts/IonLifeCycleContext.js +185 -0
- package/dist/contexts/IonLifeCycleContext.js.map +7 -0
- package/dist/contexts/NavContext.js +36 -0
- package/dist/contexts/NavContext.js.map +7 -0
- package/dist/framework-delegate.js +30 -0
- package/dist/framework-delegate.js.map +7 -0
- package/dist/hooks/HookOverlayOptions.js +2 -0
- package/dist/hooks/HookOverlayOptions.js.map +7 -0
- package/dist/hooks/__tests__/hooks.spec.js +6 -0
- package/dist/hooks/__tests__/hooks.spec.js.map +7 -0
- package/dist/hooks/useController.js +45 -0
- package/dist/hooks/useController.js.map +7 -0
- package/dist/hooks/useIonActionSheet.js +27 -0
- package/dist/hooks/useIonActionSheet.js.map +7 -0
- package/dist/hooks/useIonAlert.js +23 -0
- package/dist/hooks/useIonAlert.js.map +7 -0
- package/dist/hooks/useIonLoading.js +28 -0
- package/dist/hooks/useIonLoading.js.map +7 -0
- package/dist/hooks/useIonModal.js +22 -0
- package/dist/hooks/useIonModal.js.map +7 -0
- package/dist/hooks/useIonPicker.js +27 -0
- package/dist/hooks/useIonPicker.js.map +7 -0
- package/dist/hooks/useIonPopover.js +22 -0
- package/dist/hooks/useIonPopover.js.map +7 -0
- package/dist/hooks/useIonToast.js +23 -0
- package/dist/hooks/useIonToast.js.map +7 -0
- package/dist/hooks/useOverlay.js +67 -0
- package/dist/hooks/useOverlay.js.map +7 -0
- package/dist/index.js +8 -2443
- package/dist/index.js.map +7 -1
- package/dist/lifecycle/IonLifeCycleHOC.js +41 -0
- package/dist/lifecycle/IonLifeCycleHOC.js.map +7 -0
- package/dist/lifecycle/hooks.js +52 -0
- package/dist/lifecycle/hooks.js.map +7 -0
- package/dist/lifecycle/index.js +4 -0
- package/dist/lifecycle/index.js.map +7 -0
- package/dist/models/ReactComponentOrElement.js +2 -0
- package/dist/models/ReactComponentOrElement.js.map +7 -0
- package/dist/models/RouteAction.js +2 -0
- package/dist/models/RouteAction.js.map +7 -0
- package/dist/models/RouteInfo.js +2 -0
- package/dist/models/RouteInfo.js.map +7 -0
- package/dist/models/RouterDirection.js +2 -0
- package/dist/models/RouterDirection.js.map +7 -0
- package/dist/models/RouterOptions.js +2 -0
- package/dist/models/RouterOptions.js.map +7 -0
- package/dist/models/index.js +7 -0
- package/dist/models/index.js.map +7 -0
- package/dist/routing/LocationHistory.js +140 -0
- package/dist/routing/LocationHistory.js.map +7 -0
- package/dist/routing/NavManager.js +76 -0
- package/dist/routing/NavManager.js.map +7 -0
- package/dist/routing/OutletPageManager.js +69 -0
- package/dist/routing/OutletPageManager.js.map +7 -0
- package/dist/routing/PageManager.js +60 -0
- package/dist/routing/PageManager.js.map +7 -0
- package/dist/routing/RouteManagerContext.js +15 -0
- package/dist/routing/RouteManagerContext.js.map +7 -0
- package/dist/routing/StackContext.js +7 -0
- package/dist/routing/StackContext.js.map +7 -0
- package/dist/routing/ViewItem.js +2 -0
- package/dist/routing/ViewItem.js.map +7 -0
- package/dist/routing/ViewLifeCycleManager.js +36 -0
- package/dist/routing/ViewLifeCycleManager.js.map +7 -0
- package/dist/routing/ViewStacks.js +49 -0
- package/dist/routing/ViewStacks.js.map +7 -0
- package/dist/routing/__tests__/LocationHistory.spec.js +185 -0
- package/dist/routing/__tests__/LocationHistory.spec.js.map +7 -0
- package/dist/routing/index.js +9 -0
- package/dist/routing/index.js.map +7 -0
- package/dist/utils/HTMLElementSSR.js +4 -0
- package/dist/utils/HTMLElementSSR.js.map +7 -0
- package/dist/utils/generateId.js +8 -0
- package/dist/utils/generateId.js.map +7 -0
- package/package.json +5 -12
- package/dist/types/components/CreateAnimation.d.ts +0 -71
- package/dist/types/components/IonActionSheet.d.ts +0 -3
- package/dist/types/components/IonAlert.d.ts +0 -3
- package/dist/types/components/IonApp.d.ts +0 -41
- package/dist/types/components/IonIcon.d.ts +0 -16
- package/dist/types/components/IonLoading.d.ts +0 -3
- package/dist/types/components/IonModal.d.ts +0 -3
- package/dist/types/components/IonOverlayManager.d.ts +0 -15
- package/dist/types/components/IonPage.d.ts +0 -3
- package/dist/types/components/IonPicker.d.ts +0 -3
- package/dist/types/components/IonPopover.d.ts +0 -3
- package/dist/types/components/IonRedirect.d.ts +0 -16
- package/dist/types/components/IonRoute.d.ts +0 -17
- package/dist/types/components/IonRouterContext.d.ts +0 -42
- package/dist/types/components/IonRouterOutlet.d.ts +0 -8
- package/dist/types/components/IonToast.d.ts +0 -3
- package/dist/types/components/IonicReactProps.d.ts +0 -6
- package/dist/types/components/__tests__/utils.spec.d.ts +0 -1
- package/dist/types/components/createControllerComponent.d.ts +0 -19
- package/dist/types/components/createInlineOverlayComponent.d.ts +0 -2
- package/dist/types/components/createOverlayComponent.d.ts +0 -20
- package/dist/types/components/createRoutingComponent.d.ts +0 -2
- package/dist/types/components/hrefprops.d.ts +0 -9
- package/dist/types/components/index.d.ts +0 -35
- package/dist/types/components/inner-proxies.d.ts +0 -14
- package/dist/types/components/navigation/IonBackButton.d.ts +0 -68
- package/dist/types/components/navigation/IonNav.d.ts +0 -5
- package/dist/types/components/navigation/IonTabBar.d.ts +0 -15
- package/dist/types/components/navigation/IonTabButton.d.ts +0 -40
- package/dist/types/components/navigation/IonTabs.d.ts +0 -49
- package/dist/types/components/navigation/IonTabsContext.d.ts +0 -6
- package/dist/types/components/proxies.d.ts +0 -66
- package/dist/types/components/react-component-lib/createComponent.d.ts +0 -10
- package/dist/types/components/react-component-lib/createOverlayComponent.d.ts +0 -21
- package/dist/types/components/react-component-lib/index.d.ts +0 -2
- package/dist/types/components/react-component-lib/interfaces.d.ts +0 -29
- package/dist/types/components/react-component-lib/utils/attachProps.d.ts +0 -16
- package/dist/types/components/react-component-lib/utils/case.d.ts +0 -2
- package/dist/types/components/react-component-lib/utils/dev.d.ts +0 -2
- package/dist/types/components/react-component-lib/utils/index.d.ts +0 -10
- package/dist/types/components/routing-proxies.d.ts +0 -44
- package/dist/types/components/utils/detachProps.d.ts +0 -8
- package/dist/types/components/utils/index.d.ts +0 -8
- package/dist/types/components/utils/ionRenderToString.d.ts +0 -2
- package/dist/types/contexts/IonContext.d.ts +0 -7
- package/dist/types/contexts/IonLifeCycleContext.d.ts +0 -72
- package/dist/types/contexts/NavContext.d.ts +0 -17
- package/dist/types/framework-delegate.d.ts +0 -2
- package/dist/types/hooks/HookOverlayOptions.d.ts +0 -7
- package/dist/types/hooks/__tests__/hooks.spec.d.ts +0 -0
- package/dist/types/hooks/useController.d.ts +0 -12
- package/dist/types/hooks/useIonActionSheet.d.ts +0 -26
- package/dist/types/hooks/useIonAlert.d.ts +0 -26
- package/dist/types/hooks/useIonLoading.d.ts +0 -27
- package/dist/types/hooks/useIonModal.d.ts +0 -17
- package/dist/types/hooks/useIonPicker.d.ts +0 -26
- package/dist/types/hooks/useIonPopover.d.ts +0 -17
- package/dist/types/hooks/useIonToast.d.ts +0 -26
- package/dist/types/hooks/useOverlay.d.ts +0 -13
- package/dist/types/index.d.ts +0 -7
- package/dist/types/lifecycle/IonLifeCycleHOC.d.ts +0 -31
- package/dist/types/lifecycle/hooks.d.ts +0 -5
- package/dist/types/lifecycle/index.d.ts +0 -2
- package/dist/types/models/ReactComponentOrElement.d.ts +0 -2
- package/dist/types/models/RouteAction.d.ts +0 -1
- package/dist/types/models/RouteInfo.d.ts +0 -19
- package/dist/types/models/RouterDirection.d.ts +0 -1
- package/dist/types/models/RouterOptions.d.ts +0 -10
- package/dist/types/models/index.d.ts +0 -5
- package/dist/types/routing/LocationHistory.d.ts +0 -20
- package/dist/types/routing/NavManager.d.ts +0 -38
- package/dist/types/routing/OutletPageManager.d.ts +0 -26
- package/dist/types/routing/PageManager.d.ts +0 -25
- package/dist/types/routing/RouteManagerContext.d.ts +0 -16
- package/dist/types/routing/StackContext.d.ts +0 -7
- package/dist/types/routing/ViewItem.d.ts +0 -12
- package/dist/types/routing/ViewLifeCycleManager.d.ts +0 -42
- package/dist/types/routing/ViewStacks.d.ts +0 -19
- package/dist/types/routing/__tests__/LocationHistory.spec.d.ts +0 -1
- package/dist/types/routing/index.d.ts +0 -7
- package/dist/types/utils/HTMLElementSSR.d.ts +0 -4
- package/dist/types/utils/generateId.d.ts +0 -1
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
import { createAnimation } from "@ionic/core/components";
|
|
3
|
+
import React from "react";
|
|
4
|
+
export class CreateAnimation extends React.PureComponent {
|
|
5
|
+
constructor(props) {
|
|
6
|
+
super(props);
|
|
7
|
+
this.nodes = /* @__PURE__ */ new Map();
|
|
8
|
+
this.animation = createAnimation(props.id);
|
|
9
|
+
}
|
|
10
|
+
setupAnimation(props) {
|
|
11
|
+
const animation = this.animation;
|
|
12
|
+
if (this.nodes.size > 0) {
|
|
13
|
+
animation.addElement(Array.from(this.nodes.values()));
|
|
14
|
+
}
|
|
15
|
+
checkConfig(animation, props);
|
|
16
|
+
checkPlayback(animation, props);
|
|
17
|
+
}
|
|
18
|
+
componentDidMount() {
|
|
19
|
+
const props = this.props;
|
|
20
|
+
this.setupAnimation(props);
|
|
21
|
+
}
|
|
22
|
+
componentDidUpdate(prevProps) {
|
|
23
|
+
const animation = this.animation;
|
|
24
|
+
const props = this.props;
|
|
25
|
+
checkConfig(animation, props, prevProps);
|
|
26
|
+
checkProgress(animation, props, prevProps);
|
|
27
|
+
checkPlayback(animation, props, prevProps);
|
|
28
|
+
}
|
|
29
|
+
render() {
|
|
30
|
+
const { children } = this.props;
|
|
31
|
+
return /* @__PURE__ */ React.createElement(React.Fragment, null, React.Children.map(
|
|
32
|
+
children,
|
|
33
|
+
(child, id) => React.cloneElement(child, { ref: (el) => this.nodes.set(id, el) })
|
|
34
|
+
));
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
const checkConfig = (animation, currentProps = {}, prevProps = {}) => {
|
|
38
|
+
const reservedProps = [
|
|
39
|
+
"children",
|
|
40
|
+
"progressStart",
|
|
41
|
+
"progressStep",
|
|
42
|
+
"progressEnd",
|
|
43
|
+
"pause",
|
|
44
|
+
"stop",
|
|
45
|
+
"destroy",
|
|
46
|
+
"play",
|
|
47
|
+
"from",
|
|
48
|
+
"to",
|
|
49
|
+
"fromTo",
|
|
50
|
+
"onFinish"
|
|
51
|
+
];
|
|
52
|
+
for (const key in currentProps) {
|
|
53
|
+
if (
|
|
54
|
+
// eslint-disable-next-line no-prototype-builtins
|
|
55
|
+
currentProps.hasOwnProperty(key) && !reservedProps.includes(key) && currentProps[key] !== prevProps[key]
|
|
56
|
+
) {
|
|
57
|
+
animation[key](currentProps[key]);
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
const fromValues = currentProps.from;
|
|
61
|
+
if (fromValues && fromValues !== prevProps.from) {
|
|
62
|
+
const values = Array.isArray(fromValues) ? fromValues : [fromValues];
|
|
63
|
+
values.forEach((val) => animation.from(val.property, val.value));
|
|
64
|
+
}
|
|
65
|
+
const toValues = currentProps.to;
|
|
66
|
+
if (toValues && toValues !== prevProps.to) {
|
|
67
|
+
const values = Array.isArray(toValues) ? toValues : [toValues];
|
|
68
|
+
values.forEach((val) => animation.to(val.property, val.value));
|
|
69
|
+
}
|
|
70
|
+
const fromToValues = currentProps.fromTo;
|
|
71
|
+
if (fromToValues && fromToValues !== prevProps.fromTo) {
|
|
72
|
+
const values = Array.isArray(fromToValues) ? fromToValues : [fromToValues];
|
|
73
|
+
values.forEach((val) => animation.fromTo(val.property, val.fromValue, val.toValue));
|
|
74
|
+
}
|
|
75
|
+
const onFinishValues = currentProps.onFinish;
|
|
76
|
+
if (onFinishValues && onFinishValues !== prevProps.onFinish) {
|
|
77
|
+
const values = Array.isArray(onFinishValues) ? onFinishValues : [onFinishValues];
|
|
78
|
+
values.forEach((val) => animation.onFinish(val.callback, val.opts));
|
|
79
|
+
}
|
|
80
|
+
};
|
|
81
|
+
const checkProgress = (animation, currentProps = {}, prevProps = {}) => {
|
|
82
|
+
const { progressStart, progressStep, progressEnd } = currentProps;
|
|
83
|
+
if (progressStart && (prevProps.progressStart?.forceLinearEasing !== progressStart?.forceLinearEasing || prevProps.progressStart?.step !== progressStart?.step)) {
|
|
84
|
+
animation.progressStart(progressStart.forceLinearEasing, progressStart.step);
|
|
85
|
+
}
|
|
86
|
+
if (progressStep && prevProps.progressStep?.step !== progressStep?.step) {
|
|
87
|
+
animation.progressStep(progressStep.step);
|
|
88
|
+
}
|
|
89
|
+
if (progressEnd && (prevProps.progressEnd?.playTo !== progressEnd?.playTo || prevProps.progressEnd?.step !== progressEnd?.step || prevProps?.dur !== progressEnd?.dur)) {
|
|
90
|
+
animation.progressEnd(progressEnd.playTo, progressEnd.step, progressEnd.dur);
|
|
91
|
+
}
|
|
92
|
+
};
|
|
93
|
+
const checkPlayback = (animation, currentProps = {}, prevProps = {}) => {
|
|
94
|
+
if (!prevProps.play && currentProps.play) {
|
|
95
|
+
animation.play();
|
|
96
|
+
}
|
|
97
|
+
if (!prevProps.pause && currentProps.pause) {
|
|
98
|
+
animation.pause();
|
|
99
|
+
}
|
|
100
|
+
if (!prevProps.stop && currentProps.stop) {
|
|
101
|
+
animation.stop();
|
|
102
|
+
}
|
|
103
|
+
if (!prevProps.destroy && currentProps.destroy) {
|
|
104
|
+
animation.destroy();
|
|
105
|
+
}
|
|
106
|
+
};
|
|
107
|
+
//# sourceMappingURL=CreateAnimation.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/components/CreateAnimation.tsx"],
|
|
4
|
+
"sourcesContent": ["import type {\n Animation,\n AnimationCallbackOptions,\n AnimationDirection,\n AnimationFill,\n AnimationKeyFrames,\n AnimationLifecycle,\n} from '@ionic/core/components';\nimport { createAnimation } from '@ionic/core/components';\nimport type { PropsWithChildren } from 'react';\nimport React from 'react';\n\n// TODO(FW-2959): types\n\ninterface PartialPropertyValue {\n property: string;\n value: any;\n}\ninterface PropertyValue {\n property: string;\n fromValue: any;\n toValue: any;\n}\n\nexport interface CreateAnimationProps {\n delay?: number;\n direction?: AnimationDirection;\n duration?: number;\n easing?: string;\n fill?: AnimationFill;\n iterations?: number;\n id?: string;\n\n afterAddRead?: () => void;\n afterAddWrite?: () => void;\n afterClearStyles?: string[];\n afterStyles?: { [property: string]: any };\n afterAddClass?: string | string[];\n afterRemoveClass?: string | string[];\n\n beforeAddRead?: () => void;\n beforeAddWrite?: () => void;\n beforeClearStyles?: string[];\n beforeStyles?: { [property: string]: any };\n beforeAddClass?: string | string[];\n beforeRemoveClass?: string | string[];\n\n onFinish?: { callback: AnimationLifecycle; opts?: AnimationCallbackOptions };\n\n keyframes?: AnimationKeyFrames;\n from?: PartialPropertyValue[] | PartialPropertyValue;\n to?: PartialPropertyValue[] | PartialPropertyValue;\n fromTo?: PropertyValue[] | PropertyValue;\n\n play?: boolean;\n pause?: boolean;\n stop?: boolean;\n destroy?: boolean;\n\n progressStart?: { forceLinearEasing: boolean; step?: number };\n progressStep?: { step: number };\n progressEnd?: { playTo: 0 | 1 | undefined; step: number; dur?: number };\n}\n\nexport class CreateAnimation extends React.PureComponent<PropsWithChildren<CreateAnimationProps>> {\n nodes: Map<number, HTMLElement> = new Map();\n animation: Animation;\n\n constructor(props: any) {\n super(props);\n\n this.animation = createAnimation(props.id);\n }\n\n setupAnimation(props: any) {\n const animation = this.animation;\n\n if (this.nodes.size > 0) {\n animation.addElement(Array.from(this.nodes.values()));\n }\n\n checkConfig(animation, props);\n checkPlayback(animation, props);\n }\n\n componentDidMount() {\n const props = this.props;\n this.setupAnimation(props);\n }\n\n componentDidUpdate(prevProps: any) {\n const animation = this.animation;\n\n const props = this.props;\n\n checkConfig(animation, props, prevProps);\n checkProgress(animation, props, prevProps);\n checkPlayback(animation, props, prevProps);\n }\n\n render() {\n const { children } = this.props;\n return (\n <>\n {React.Children.map(children, (child, id) =>\n React.cloneElement(child as any, { ref: (el: any) => this.nodes.set(id, el) })\n )}\n </>\n );\n }\n}\n\nconst checkConfig = (animation: Animation, currentProps: any = {}, prevProps: any = {}) => {\n const reservedProps = [\n 'children',\n 'progressStart',\n 'progressStep',\n 'progressEnd',\n 'pause',\n 'stop',\n 'destroy',\n 'play',\n 'from',\n 'to',\n 'fromTo',\n 'onFinish',\n ];\n for (const key in currentProps) {\n if (\n // eslint-disable-next-line no-prototype-builtins\n currentProps.hasOwnProperty(key) &&\n !reservedProps.includes(key) &&\n currentProps[key] !== prevProps[key]\n ) {\n (animation as any)[key]((currentProps as any)[key]);\n }\n }\n\n const fromValues = currentProps.from;\n if (fromValues && fromValues !== prevProps.from) {\n const values = Array.isArray(fromValues) ? fromValues : [fromValues];\n values.forEach((val) => animation.from(val.property, val.value));\n }\n\n const toValues = currentProps.to;\n if (toValues && toValues !== prevProps.to) {\n const values = Array.isArray(toValues) ? toValues : [toValues];\n values.forEach((val) => animation.to(val.property, val.value));\n }\n\n const fromToValues = currentProps.fromTo;\n if (fromToValues && fromToValues !== prevProps.fromTo) {\n const values = Array.isArray(fromToValues) ? fromToValues : [fromToValues];\n values.forEach((val) => animation.fromTo(val.property, val.fromValue, val.toValue));\n }\n\n const onFinishValues = currentProps.onFinish;\n if (onFinishValues && onFinishValues !== prevProps.onFinish) {\n const values = Array.isArray(onFinishValues) ? onFinishValues : [onFinishValues];\n values.forEach((val) => animation.onFinish(val.callback, val.opts));\n }\n};\n\nconst checkProgress = (animation: Animation, currentProps: any = {}, prevProps: any = {}) => {\n const { progressStart, progressStep, progressEnd } = currentProps;\n\n if (\n progressStart &&\n (prevProps.progressStart?.forceLinearEasing !== progressStart?.forceLinearEasing ||\n prevProps.progressStart?.step !== progressStart?.step)\n ) {\n animation.progressStart(progressStart.forceLinearEasing, progressStart.step);\n }\n\n if (progressStep && prevProps.progressStep?.step !== progressStep?.step) {\n animation.progressStep(progressStep.step);\n }\n\n if (\n progressEnd &&\n (prevProps.progressEnd?.playTo !== progressEnd?.playTo ||\n prevProps.progressEnd?.step !== progressEnd?.step ||\n prevProps?.dur !== progressEnd?.dur)\n ) {\n animation.progressEnd(progressEnd.playTo, progressEnd.step, progressEnd.dur);\n }\n};\n\nconst checkPlayback = (animation: Animation, currentProps: any = {}, prevProps: any = {}) => {\n if (!prevProps.play && currentProps.play) {\n animation.play();\n }\n\n if (!prevProps.pause && currentProps.pause) {\n animation.pause();\n }\n\n if (!prevProps.stop && currentProps.stop) {\n animation.stop();\n }\n\n if (!prevProps.destroy && currentProps.destroy) {\n animation.destroy();\n }\n};\n"],
|
|
5
|
+
"mappings": "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",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
import { defineCustomElement } from "@ionic/core/components/ion-action-sheet.js";
|
|
3
|
+
import { createInlineOverlayComponent } from "./createInlineOverlayComponent";
|
|
4
|
+
export const IonActionSheet = /* @__PURE__ */ createInlineOverlayComponent(
|
|
5
|
+
"ion-action-sheet",
|
|
6
|
+
defineCustomElement
|
|
7
|
+
);
|
|
8
|
+
//# sourceMappingURL=IonActionSheet.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/components/IonActionSheet.tsx"],
|
|
4
|
+
"sourcesContent": ["import type { JSX } from '@ionic/core/components';\nimport { defineCustomElement } from '@ionic/core/components/ion-action-sheet.js';\n\nimport { createInlineOverlayComponent } from './createInlineOverlayComponent';\n\nexport const IonActionSheet = /*@__PURE__*/ createInlineOverlayComponent<JSX.IonActionSheet, HTMLIonActionSheetElement>(\n 'ion-action-sheet',\n defineCustomElement\n);\n"],
|
|
5
|
+
"mappings": ";AACA,SAAS,2BAA2B;AAEpC,SAAS,oCAAoC;AAEtC,aAAM,iBAA+B;AAAA,EAC1C;AAAA,EACA;AACF;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
import { defineCustomElement } from "@ionic/core/components/ion-alert.js";
|
|
3
|
+
import { createInlineOverlayComponent } from "./createInlineOverlayComponent";
|
|
4
|
+
export const IonAlert = /* @__PURE__ */ createInlineOverlayComponent(
|
|
5
|
+
"ion-alert",
|
|
6
|
+
defineCustomElement
|
|
7
|
+
);
|
|
8
|
+
//# sourceMappingURL=IonAlert.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/components/IonAlert.tsx"],
|
|
4
|
+
"sourcesContent": ["import type { JSX } from '@ionic/core/components';\nimport { defineCustomElement } from '@ionic/core/components/ion-alert.js';\n\nimport { createInlineOverlayComponent } from './createInlineOverlayComponent';\n\nexport const IonAlert = /*@__PURE__*/ createInlineOverlayComponent<JSX.IonAlert, HTMLIonAlertElement>(\n 'ion-alert',\n defineCustomElement\n);\n"],
|
|
5
|
+
"mappings": ";AACA,SAAS,2BAA2B;AAEpC,SAAS,oCAAoC;AAEtC,aAAM,WAAyB;AAAA,EACpC;AAAA,EACA;AACF;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
import React from "react";
|
|
3
|
+
import { IonContext } from "../contexts/IonContext";
|
|
4
|
+
import { IonOverlayManager } from "./IonOverlayManager";
|
|
5
|
+
import { IonAppInner } from "./inner-proxies";
|
|
6
|
+
export const IonApp = /* @__PURE__ */ (() => class extends React.Component {
|
|
7
|
+
constructor(props) {
|
|
8
|
+
super(props);
|
|
9
|
+
/*
|
|
10
|
+
Wire up methods to call into IonOverlayManager
|
|
11
|
+
*/
|
|
12
|
+
this.ionContext = {
|
|
13
|
+
addOverlay: (id, overlay, containerElement) => {
|
|
14
|
+
if (this.addOverlayCallback) {
|
|
15
|
+
this.addOverlayCallback(id, overlay, containerElement);
|
|
16
|
+
}
|
|
17
|
+
},
|
|
18
|
+
removeOverlay: (id) => {
|
|
19
|
+
if (this.removeOverlayCallback) {
|
|
20
|
+
this.removeOverlayCallback(id);
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
render() {
|
|
26
|
+
return /* @__PURE__ */ React.createElement(IonContext.Provider, { value: this.ionContext }, /* @__PURE__ */ React.createElement(IonAppInner, { ...this.props }, this.props.children), /* @__PURE__ */ React.createElement(
|
|
27
|
+
IonOverlayManager,
|
|
28
|
+
{
|
|
29
|
+
onAddOverlay: (callback) => {
|
|
30
|
+
this.addOverlayCallback = callback;
|
|
31
|
+
},
|
|
32
|
+
onRemoveOverlay: (callback) => {
|
|
33
|
+
this.removeOverlayCallback = callback;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
));
|
|
37
|
+
}
|
|
38
|
+
static get displayName() {
|
|
39
|
+
return "IonApp";
|
|
40
|
+
}
|
|
41
|
+
})();
|
|
42
|
+
//# sourceMappingURL=IonApp.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/components/IonApp.tsx"],
|
|
4
|
+
"sourcesContent": ["import type { JSX as LocalJSX } from '@ionic/core/components';\nimport React from 'react';\n\nimport type { IonContextInterface } from '../contexts/IonContext';\nimport { IonContext } from '../contexts/IonContext';\nimport type { ReactComponentOrElement } from '../models';\n\nimport { IonOverlayManager } from './IonOverlayManager';\nimport type { IonicReactProps } from './IonicReactProps';\nimport { IonAppInner } from './inner-proxies';\n\ntype Props = LocalJSX.IonApp &\n IonicReactProps & {\n ref?: React.Ref<HTMLIonAppElement>;\n };\n\nexport const IonApp = /*@__PURE__*/ (() =>\n class extends React.Component<Props> {\n addOverlayCallback?: (id: string, overlay: ReactComponentOrElement, containerElement: HTMLDivElement) => void;\n removeOverlayCallback?: (id: string) => void;\n\n constructor(props: Props) {\n super(props);\n }\n\n /*\n Wire up methods to call into IonOverlayManager\n */\n ionContext: IonContextInterface = {\n addOverlay: (id: string, overlay: ReactComponentOrElement, containerElement: HTMLDivElement) => {\n if (this.addOverlayCallback) {\n this.addOverlayCallback(id, overlay, containerElement);\n }\n },\n removeOverlay: (id: string) => {\n if (this.removeOverlayCallback) {\n this.removeOverlayCallback(id);\n }\n },\n };\n\n render() {\n return (\n <IonContext.Provider value={this.ionContext}>\n <IonAppInner {...this.props}>{this.props.children}</IonAppInner>\n <IonOverlayManager\n onAddOverlay={(callback) => {\n this.addOverlayCallback = callback;\n }}\n onRemoveOverlay={(callback) => {\n this.removeOverlayCallback = callback;\n }}\n />\n </IonContext.Provider>\n );\n }\n\n static get displayName() {\n return 'IonApp';\n }\n })();\n"],
|
|
5
|
+
"mappings": ";AACA,OAAO,WAAW;AAGlB,SAAS,kBAAkB;AAG3B,SAAS,yBAAyB;AAElC,SAAS,mBAAmB;AAOrB,aAAM,SAAwB,uBACnC,cAAc,MAAM,UAAiB;AAAA,EAInC,YAAY,OAAc;AACxB,UAAM,KAAK;AAMb;AAAA;AAAA;AAAA,sBAAkC;AAAA,MAChC,YAAY,CAAC,IAAY,SAAkC,qBAAqC;AAC9F,YAAI,KAAK,oBAAoB;AAC3B,eAAK,mBAAmB,IAAI,SAAS,gBAAgB;AAAA,QACvD;AAAA,MACF;AAAA,MACA,eAAe,CAAC,OAAe;AAC7B,YAAI,KAAK,uBAAuB;AAC9B,eAAK,sBAAsB,EAAE;AAAA,QAC/B;AAAA,MACF;AAAA,IACF;AAAA,EAhBA;AAAA,EAkBA,SAAS;AACP,WACE,oCAAC,WAAW,UAAX,EAAoB,OAAO,KAAK,cAC/B,oCAAC,eAAa,GAAG,KAAK,SAAQ,KAAK,MAAM,QAAS,GAClD;AAAA,MAAC;AAAA;AAAA,QACC,cAAc,CAAC,aAAa;AAC1B,eAAK,qBAAqB;AAAA,QAC5B;AAAA,QACA,iBAAiB,CAAC,aAAa;AAC7B,eAAK,wBAAwB;AAAA,QAC/B;AAAA;AAAA,IACF,CACF;AAAA,EAEJ;AAAA,EAEA,WAAW,cAAc;AACvB,WAAO;AAAA,EACT;AACF,GAAG;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
import React from "react";
|
|
3
|
+
import { NavContext } from "../contexts/NavContext";
|
|
4
|
+
import { IonIconInner } from "./inner-proxies";
|
|
5
|
+
import { createForwardRef, getConfig } from "./utils";
|
|
6
|
+
class IonIconContainer extends React.PureComponent {
|
|
7
|
+
constructor(props) {
|
|
8
|
+
super(props);
|
|
9
|
+
if (this.props.name) {
|
|
10
|
+
console.warn(
|
|
11
|
+
'In Ionic React, you import icons from "ionicons/icons" and set the icon you imported to the "icon" property. Setting the "name" property has no effect.'
|
|
12
|
+
);
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
render() {
|
|
16
|
+
const { icon, ios, md, mode, ...rest } = this.props;
|
|
17
|
+
let iconToUse;
|
|
18
|
+
const config = getConfig();
|
|
19
|
+
const iconMode = mode || config?.get("mode");
|
|
20
|
+
if (ios || md) {
|
|
21
|
+
if (iconMode === "ios") {
|
|
22
|
+
iconToUse = ios ?? md ?? icon;
|
|
23
|
+
} else {
|
|
24
|
+
iconToUse = md ?? ios ?? icon;
|
|
25
|
+
}
|
|
26
|
+
} else {
|
|
27
|
+
iconToUse = icon;
|
|
28
|
+
}
|
|
29
|
+
return /* @__PURE__ */ React.createElement(IonIconInner, { ref: this.props.forwardedRef, icon: iconToUse, ...rest }, this.props.children);
|
|
30
|
+
}
|
|
31
|
+
static get contextType() {
|
|
32
|
+
return NavContext;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
export const IonIcon = createForwardRef(
|
|
36
|
+
IonIconContainer,
|
|
37
|
+
"IonIcon"
|
|
38
|
+
);
|
|
39
|
+
//# sourceMappingURL=IonIcon.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/components/IonIcon.tsx"],
|
|
4
|
+
"sourcesContent": ["import React from 'react';\n\nimport { NavContext } from '../contexts/NavContext';\n\nimport type { IonicReactProps } from './IonicReactProps';\nimport { IonIconInner } from './inner-proxies';\nimport { createForwardRef, getConfig } from './utils';\n\ninterface IonIconProps {\n color?: string;\n flipRtl?: boolean;\n icon?: string;\n ios?: string;\n lazy?: boolean;\n md?: string;\n mode?: 'ios' | 'md';\n name?: string;\n size?: string;\n src?: string;\n}\n\ntype InternalProps = IonIconProps & {\n forwardedRef?: React.ForwardedRef<HTMLIonIconElement>;\n};\n\nclass IonIconContainer extends React.PureComponent<InternalProps> {\n constructor(props: InternalProps) {\n super(props);\n if (this.props.name) {\n console.warn(\n 'In Ionic React, you import icons from \"ionicons/icons\" and set the icon you imported to the \"icon\" property. Setting the \"name\" property has no effect.'\n );\n }\n }\n\n render() {\n const { icon, ios, md, mode, ...rest } = this.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 (\n <IonIconInner ref={this.props.forwardedRef} icon={iconToUse} {...rest}>\n {this.props.children}\n </IonIconInner>\n );\n }\n\n static get contextType() {\n return NavContext;\n }\n}\n\nexport const IonIcon = createForwardRef<IonIconProps & IonicReactProps, HTMLIonIconElement>(\n IonIconContainer,\n 'IonIcon'\n);\n"],
|
|
5
|
+
"mappings": ";AAAA,OAAO,WAAW;AAElB,SAAS,kBAAkB;AAG3B,SAAS,oBAAoB;AAC7B,SAAS,kBAAkB,iBAAiB;AAmB5C,MAAM,yBAAyB,MAAM,cAA6B;AAAA,EAChE,YAAY,OAAsB;AAChC,UAAM,KAAK;AACX,QAAI,KAAK,MAAM,MAAM;AACnB,cAAQ;AAAA,QACN;AAAA,MACF;AAAA,IACF;AAAA,EACF;AAAA,EAEA,SAAS;AACP,UAAM,EAAE,MAAM,KAAK,IAAI,MAAM,GAAG,KAAK,IAAI,KAAK;AAE9C,QAAI;AAEJ,UAAM,SAAS,UAAU;AACzB,UAAM,WAAW,QAAQ,QAAQ,IAAI,MAAM;AAE3C,QAAI,OAAO,IAAI;AACb,UAAI,aAAa,OAAO;AACtB,oBAAY,OAAO,MAAM;AAAA,MAC3B,OAAO;AACL,oBAAY,MAAM,OAAO;AAAA,MAC3B;AAAA,IACF,OAAO;AACL,kBAAY;AAAA,IACd;AAEA,WACE,oCAAC,gBAAa,KAAK,KAAK,MAAM,cAAc,MAAM,WAAY,GAAG,QAC9D,KAAK,MAAM,QACd;AAAA,EAEJ;AAAA,EAEA,WAAW,cAAc;AACvB,WAAO;AAAA,EACT;AACF;AAEO,aAAM,UAAU;AAAA,EACrB;AAAA,EACA;AACF;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
import { defineCustomElement } from "@ionic/core/components/ion-loading.js";
|
|
3
|
+
import { createInlineOverlayComponent } from "./createInlineOverlayComponent";
|
|
4
|
+
export const IonLoading = /* @__PURE__ */ createInlineOverlayComponent(
|
|
5
|
+
"ion-loading",
|
|
6
|
+
defineCustomElement
|
|
7
|
+
);
|
|
8
|
+
//# sourceMappingURL=IonLoading.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/components/IonLoading.tsx"],
|
|
4
|
+
"sourcesContent": ["import type { JSX } from '@ionic/core/components';\nimport { defineCustomElement } from '@ionic/core/components/ion-loading.js';\n\nimport { createInlineOverlayComponent } from './createInlineOverlayComponent';\n\nexport const IonLoading = /*@__PURE__*/ createInlineOverlayComponent<JSX.IonLoading, HTMLIonLoadingElement>(\n 'ion-loading',\n defineCustomElement\n);\n"],
|
|
5
|
+
"mappings": ";AACA,SAAS,2BAA2B;AAEpC,SAAS,oCAAoC;AAEtC,aAAM,aAA2B;AAAA,EACtC;AAAA,EACA;AACF;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
import { defineCustomElement } from "@ionic/core/components/ion-modal.js";
|
|
3
|
+
import { createInlineOverlayComponent } from "./createInlineOverlayComponent";
|
|
4
|
+
export const IonModal = /* @__PURE__ */ createInlineOverlayComponent(
|
|
5
|
+
"ion-modal",
|
|
6
|
+
defineCustomElement,
|
|
7
|
+
true
|
|
8
|
+
);
|
|
9
|
+
//# sourceMappingURL=IonModal.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/components/IonModal.tsx"],
|
|
4
|
+
"sourcesContent": ["import type { JSX } from '@ionic/core/components';\nimport { defineCustomElement } from '@ionic/core/components/ion-modal.js';\n\nimport { createInlineOverlayComponent } from './createInlineOverlayComponent';\n\nexport const IonModal = /*@__PURE__*/ createInlineOverlayComponent<JSX.IonModal, HTMLIonModalElement>(\n 'ion-modal',\n defineCustomElement,\n true\n);\n"],
|
|
5
|
+
"mappings": ";AACA,SAAS,2BAA2B;AAEpC,SAAS,oCAAoC;AAEtC,aAAM,WAAyB;AAAA,EACpC;AAAA,EACA;AAAA,EACA;AACF;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
import React, { useEffect, useRef, useState } from "react";
|
|
3
|
+
import ReactDOM from "react-dom";
|
|
4
|
+
export const IonOverlayManager = ({ onAddOverlay, onRemoveOverlay }) => {
|
|
5
|
+
const [overlays, setOverlays] = useState({});
|
|
6
|
+
const overlaysRef = useRef({});
|
|
7
|
+
useEffect(() => {
|
|
8
|
+
onAddOverlay(addOverlay);
|
|
9
|
+
onRemoveOverlay(removeOverlay);
|
|
10
|
+
}, []);
|
|
11
|
+
const addOverlay = (id, component, containerElement) => {
|
|
12
|
+
const newOverlays = { ...overlaysRef.current };
|
|
13
|
+
newOverlays[id] = { component, containerElement };
|
|
14
|
+
overlaysRef.current = newOverlays;
|
|
15
|
+
setOverlays(newOverlays);
|
|
16
|
+
};
|
|
17
|
+
const removeOverlay = (id) => {
|
|
18
|
+
const newOverlays = { ...overlaysRef.current };
|
|
19
|
+
delete newOverlays[id];
|
|
20
|
+
overlaysRef.current = newOverlays;
|
|
21
|
+
setOverlays(newOverlays);
|
|
22
|
+
};
|
|
23
|
+
const overlayKeys = Object.keys(overlays);
|
|
24
|
+
return /* @__PURE__ */ React.createElement(React.Fragment, null, overlayKeys.map((key) => {
|
|
25
|
+
const overlay = overlays[key];
|
|
26
|
+
return ReactDOM.createPortal(overlay.component, overlay.containerElement, `overlay-${key}`);
|
|
27
|
+
}));
|
|
28
|
+
};
|
|
29
|
+
//# sourceMappingURL=IonOverlayManager.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/components/IonOverlayManager.tsx"],
|
|
4
|
+
"sourcesContent": ["import React, { useEffect, useRef, useState } from 'react';\nimport ReactDOM from 'react-dom';\n\nimport type { ReactComponentOrElement } from '../models';\n\ninterface IonOverlayManagerProps {\n onAddOverlay: (\n callback: (id: string, component: ReactComponentOrElement, containerElement: HTMLDivElement) => void\n ) => void;\n onRemoveOverlay: (callback: (id: string) => void) => void;\n}\n\n/**\n * Manages overlays that are added via the useOverlay hook.\n * This is a standalone component so changes to its children don't cause other descendant\n * components to re-render when overlays are added. However, we need to communicate with the IonContext\n * that is set up in <IonApp />, so we register callbacks so when overlays are added to IonContext,\n * they ultimately added here.\n */\nexport const IonOverlayManager: React.FC<IonOverlayManagerProps> = ({ onAddOverlay, onRemoveOverlay }) => {\n type OverlaysList = {\n [key: string]: {\n component: any; // TODO(FW-2959): type\n containerElement: HTMLDivElement;\n };\n };\n\n /**\n * Because of the way we're passing around the addOverlay and removeOverlay\n * callbacks, by the time they finally get called, they use a stale reference\n * to the state that only has the initial values. So if two overlays are opened\n * at the same time, both using useIonModal or similar (such as through nesting),\n * the second will erase the first from the overlays list. This causes the content\n * of the first overlay to unmount.\n *\n * We wrap the state in useRef to ensure the two callbacks always use the most\n * up-to-date version.\n *\n * Further reading: https://stackoverflow.com/a/56554056\n */\n const [overlays, setOverlays] = useState<OverlaysList>({});\n const overlaysRef = useRef<OverlaysList>({});\n\n useEffect(() => {\n /* Setup the callbacks that get called from <IonApp /> */\n onAddOverlay(addOverlay);\n onRemoveOverlay(removeOverlay);\n }, []);\n\n const addOverlay = (id: string, component: ReactComponentOrElement, containerElement: HTMLDivElement) => {\n const newOverlays = { ...overlaysRef.current };\n newOverlays[id] = { component, containerElement };\n\n /**\n * In order for this function to use the latest data\n * we need to update the ref synchronously.\n * However, updating a ref does not cause a re-render\n * which is why we still update the state.\n *\n * Note that updating the ref in the body\n * of IonOverlayManager is not sufficient\n * because that relies on overlaysRef being\n * updated as part of React's render loop. State updates\n * are batched, so updating the state twice in quick succession does\n * not necessarily result in 2 separate render calls.\n * This means if two modals are added one after the other,\n * the first modal will not have been added to\n * overlaysRef since React has not re-rendered yet.\n * More info: https://react.dev/reference/react/useState#setstate-caveats\n */\n overlaysRef.current = newOverlays;\n setOverlays(newOverlays);\n };\n\n const removeOverlay = (id: string) => {\n const newOverlays = { ...overlaysRef.current };\n delete newOverlays[id];\n\n /**\n * In order for this function to use the latest data\n * we need to update the ref synchronously.\n * However, updating a ref does not cause a re-render\n * which is why we still update the state.\n *\n * Note that updating the ref in the body\n * of IonOverlayManager is not sufficient\n * because that relies on overlaysRef being\n * updated as part of React's render loop. State updates\n * are batched, so updating the state twice in quick succession does\n * not necessarily result in 2 separate render calls.\n * This means if two modals are added one after the other,\n * the first modal will not have been added to\n * overlaysRef since React has not re-rendered yet.\n * More info: https://react.dev/reference/react/useState#setstate-caveats\n */\n overlaysRef.current = newOverlays;\n setOverlays(newOverlays);\n };\n\n const overlayKeys = Object.keys(overlays);\n\n return (\n <>\n {overlayKeys.map((key) => {\n const overlay = overlays[key];\n return ReactDOM.createPortal(overlay.component, overlay.containerElement, `overlay-${key}`);\n })}\n </>\n );\n};\n"],
|
|
5
|
+
"mappings": ";AAAA,OAAO,SAAS,WAAW,QAAQ,gBAAgB;AACnD,OAAO,cAAc;AAkBd,aAAM,oBAAsD,CAAC,EAAE,cAAc,gBAAgB,MAAM;AAqBxG,QAAM,CAAC,UAAU,WAAW,IAAI,SAAuB,CAAC,CAAC;AACzD,QAAM,cAAc,OAAqB,CAAC,CAAC;AAE3C,YAAU,MAAM;AAEd,iBAAa,UAAU;AACvB,oBAAgB,aAAa;AAAA,EAC/B,GAAG,CAAC,CAAC;AAEL,QAAM,aAAa,CAAC,IAAY,WAAoC,qBAAqC;AACvG,UAAM,cAAc,EAAE,GAAG,YAAY,QAAQ;AAC7C,gBAAY,EAAE,IAAI,EAAE,WAAW,iBAAiB;AAmBhD,gBAAY,UAAU;AACtB,gBAAY,WAAW;AAAA,EACzB;AAEA,QAAM,gBAAgB,CAAC,OAAe;AACpC,UAAM,cAAc,EAAE,GAAG,YAAY,QAAQ;AAC7C,WAAO,YAAY,EAAE;AAmBrB,gBAAY,UAAU;AACtB,gBAAY,WAAW;AAAA,EACzB;AAEA,QAAM,cAAc,OAAO,KAAK,QAAQ;AAExC,SACE,0DACG,YAAY,IAAI,CAAC,QAAQ;AACxB,UAAM,UAAU,SAAS,GAAG;AAC5B,WAAO,SAAS,aAAa,QAAQ,WAAW,QAAQ,kBAAkB,WAAW,GAAG,EAAE;AAAA,EAC5F,CAAC,CACH;AAEJ;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
import React from "react";
|
|
3
|
+
import { NavContext } from "../contexts/NavContext";
|
|
4
|
+
import PageManager from "../routing/PageManager";
|
|
5
|
+
import { createForwardRef } from "./utils";
|
|
6
|
+
class IonPageInternal extends React.Component {
|
|
7
|
+
constructor(props) {
|
|
8
|
+
super(props);
|
|
9
|
+
}
|
|
10
|
+
render() {
|
|
11
|
+
const { className, children, forwardedRef, ...props } = this.props;
|
|
12
|
+
return this.context.hasIonicRouter() ? /* @__PURE__ */ React.createElement(
|
|
13
|
+
PageManager,
|
|
14
|
+
{
|
|
15
|
+
className: className ? `${className}` : "",
|
|
16
|
+
routeInfo: this.context.routeInfo,
|
|
17
|
+
forwardedRef,
|
|
18
|
+
...props
|
|
19
|
+
},
|
|
20
|
+
children
|
|
21
|
+
) : /* @__PURE__ */ React.createElement("div", { className: className ? `ion-page ${className}` : "ion-page", ref: forwardedRef, ...props }, children);
|
|
22
|
+
}
|
|
23
|
+
static get displayName() {
|
|
24
|
+
return "IonPage";
|
|
25
|
+
}
|
|
26
|
+
static get contextType() {
|
|
27
|
+
return NavContext;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
export const IonPage = createForwardRef(IonPageInternal, "IonPage");
|
|
31
|
+
//# sourceMappingURL=IonPage.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/components/IonPage.tsx"],
|
|
4
|
+
"sourcesContent": ["import React from 'react';\n\nimport { NavContext } from '../contexts/NavContext';\nimport PageManager from '../routing/PageManager';\n\nimport type { IonicReactProps } from './IonicReactProps';\nimport { createForwardRef } from './utils';\n\n// eslint-disable-next-line @typescript-eslint/no-empty-interface\ninterface IonPageProps extends IonicReactProps {}\n\ninterface IonPageInternalProps extends IonPageProps {\n forwardedRef?: React.ForwardedRef<HTMLDivElement>;\n}\n\nclass IonPageInternal extends React.Component<IonPageInternalProps> {\n context!: React.ContextType<typeof NavContext>;\n\n constructor(props: IonPageInternalProps) {\n super(props);\n }\n\n render() {\n const { className, children, forwardedRef, ...props } = this.props;\n\n return this.context.hasIonicRouter() ? (\n <PageManager\n className={className ? `${className}` : ''}\n routeInfo={this.context.routeInfo}\n forwardedRef={forwardedRef}\n {...props}\n >\n {children}\n </PageManager>\n ) : (\n <div className={className ? `ion-page ${className}` : 'ion-page'} ref={forwardedRef} {...props}>\n {children}\n </div>\n );\n }\n\n static get displayName() {\n return 'IonPage';\n }\n\n static get contextType() {\n return NavContext;\n }\n}\n\nexport const IonPage = createForwardRef(IonPageInternal, 'IonPage');\n"],
|
|
5
|
+
"mappings": ";AAAA,OAAO,WAAW;AAElB,SAAS,kBAAkB;AAC3B,OAAO,iBAAiB;AAGxB,SAAS,wBAAwB;AASjC,MAAM,wBAAwB,MAAM,UAAgC;AAAA,EAGlE,YAAY,OAA6B;AACvC,UAAM,KAAK;AAAA,EACb;AAAA,EAEA,SAAS;AACP,UAAM,EAAE,WAAW,UAAU,cAAc,GAAG,MAAM,IAAI,KAAK;AAE7D,WAAO,KAAK,QAAQ,eAAe,IACjC;AAAA,MAAC;AAAA;AAAA,QACC,WAAW,YAAY,GAAG,SAAS,KAAK;AAAA,QACxC,WAAW,KAAK,QAAQ;AAAA,QACxB;AAAA,QACC,GAAG;AAAA;AAAA,MAEH;AAAA,IACH,IAEA,oCAAC,SAAI,WAAW,YAAY,YAAY,SAAS,KAAK,YAAY,KAAK,cAAe,GAAG,SACtF,QACH;AAAA,EAEJ;AAAA,EAEA,WAAW,cAAc;AACvB,WAAO;AAAA,EACT;AAAA,EAEA,WAAW,cAAc;AACvB,WAAO;AAAA,EACT;AACF;AAEO,aAAM,UAAU,iBAAiB,iBAAiB,SAAS;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
import { defineCustomElement } from "@ionic/core/components/ion-picker.js";
|
|
3
|
+
import { createInlineOverlayComponent } from "./createInlineOverlayComponent";
|
|
4
|
+
export const IonPicker = /* @__PURE__ */ createInlineOverlayComponent(
|
|
5
|
+
"ion-picker",
|
|
6
|
+
defineCustomElement
|
|
7
|
+
);
|
|
8
|
+
//# sourceMappingURL=IonPicker.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/components/IonPicker.tsx"],
|
|
4
|
+
"sourcesContent": ["import type { JSX } from '@ionic/core/components';\nimport { defineCustomElement } from '@ionic/core/components/ion-picker.js';\n\nimport { createInlineOverlayComponent } from './createInlineOverlayComponent';\n\nexport const IonPicker = /*@__PURE__*/ createInlineOverlayComponent<JSX.IonPicker, HTMLIonPickerElement>(\n 'ion-picker',\n defineCustomElement\n);\n"],
|
|
5
|
+
"mappings": ";AACA,SAAS,2BAA2B;AAEpC,SAAS,oCAAoC;AAEtC,aAAM,YAA0B;AAAA,EACrC;AAAA,EACA;AACF;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
import { defineCustomElement } from "@ionic/core/components/ion-popover.js";
|
|
3
|
+
import { createInlineOverlayComponent } from "./createInlineOverlayComponent";
|
|
4
|
+
export const IonPopover = /* @__PURE__ */ createInlineOverlayComponent(
|
|
5
|
+
"ion-popover",
|
|
6
|
+
defineCustomElement
|
|
7
|
+
);
|
|
8
|
+
//# sourceMappingURL=IonPopover.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/components/IonPopover.tsx"],
|
|
4
|
+
"sourcesContent": ["import type { JSX } from '@ionic/core/components';\nimport { defineCustomElement } from '@ionic/core/components/ion-popover.js';\n\nimport { createInlineOverlayComponent } from './createInlineOverlayComponent';\n\nexport const IonPopover = /*@__PURE__*/ createInlineOverlayComponent<JSX.IonPopover, HTMLIonPopoverElement>(\n 'ion-popover',\n defineCustomElement\n);\n"],
|
|
5
|
+
"mappings": ";AACA,SAAS,2BAA2B;AAEpC,SAAS,oCAAoC;AAEtC,aAAM,aAA2B;AAAA,EACtC;AAAA,EACA;AACF;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
import React from "react";
|
|
3
|
+
import { NavContext } from "../contexts/NavContext";
|
|
4
|
+
export class IonRedirect extends React.PureComponent {
|
|
5
|
+
render() {
|
|
6
|
+
const IonRedirectInner = this.context.getIonRedirect();
|
|
7
|
+
if (!this.context.hasIonicRouter() || !IonRedirect) {
|
|
8
|
+
console.error(
|
|
9
|
+
"You either do not have an Ionic Router package, or your router does not support using <IonRedirect>"
|
|
10
|
+
);
|
|
11
|
+
return null;
|
|
12
|
+
}
|
|
13
|
+
return /* @__PURE__ */ React.createElement(IonRedirectInner, { ...this.props });
|
|
14
|
+
}
|
|
15
|
+
static get contextType() {
|
|
16
|
+
return NavContext;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
//# sourceMappingURL=IonRedirect.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/components/IonRedirect.tsx"],
|
|
4
|
+
"sourcesContent": ["import React from 'react';\n\nimport { NavContext } from '../contexts/NavContext';\n\nexport interface IonRedirectProps {\n path?: string;\n exact?: boolean;\n to: string;\n routerOptions?: unknown;\n}\n\n// eslint-disable-next-line @typescript-eslint/no-empty-interface\ninterface IonRedirectState {}\n\nexport class IonRedirect extends React.PureComponent<IonRedirectProps, IonRedirectState> {\n context!: React.ContextType<typeof NavContext>;\n\n render() {\n const IonRedirectInner = this.context.getIonRedirect();\n\n if (!this.context.hasIonicRouter() || !IonRedirect) {\n console.error(\n 'You either do not have an Ionic Router package, or your router does not support using <IonRedirect>'\n );\n return null;\n }\n\n return <IonRedirectInner {...this.props} />;\n }\n\n static get contextType() {\n return NavContext;\n }\n}\n"],
|
|
5
|
+
"mappings": ";AAAA,OAAO,WAAW;AAElB,SAAS,kBAAkB;AAYpB,aAAM,oBAAoB,MAAM,cAAkD;AAAA,EAGvF,SAAS;AACP,UAAM,mBAAmB,KAAK,QAAQ,eAAe;AAErD,QAAI,CAAC,KAAK,QAAQ,eAAe,KAAK,CAAC,aAAa;AAClD,cAAQ;AAAA,QACN;AAAA,MACF;AACA,aAAO;AAAA,IACT;AAEA,WAAO,oCAAC,oBAAkB,GAAG,KAAK,OAAO;AAAA,EAC3C;AAAA,EAEA,WAAW,cAAc;AACvB,WAAO;AAAA,EACT;AACF;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
import React from "react";
|
|
3
|
+
import { NavContext } from "../contexts/NavContext";
|
|
4
|
+
export class IonRoute extends React.PureComponent {
|
|
5
|
+
render() {
|
|
6
|
+
const IonRouteInner = this.context.getIonRoute();
|
|
7
|
+
if (!this.context.hasIonicRouter() || !IonRoute) {
|
|
8
|
+
console.error("You either do not have an Ionic Router package, or your router does not support using <IonRoute>");
|
|
9
|
+
return null;
|
|
10
|
+
}
|
|
11
|
+
return /* @__PURE__ */ React.createElement(IonRouteInner, { ...this.props });
|
|
12
|
+
}
|
|
13
|
+
static get contextType() {
|
|
14
|
+
return NavContext;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
//# sourceMappingURL=IonRoute.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/components/IonRoute.tsx"],
|
|
4
|
+
"sourcesContent": ["import React from 'react';\n\nimport { NavContext } from '../contexts/NavContext';\n\nexport interface IonRouteProps {\n path?: string;\n exact?: boolean;\n show?: boolean;\n render: (props?: any) => JSX.Element; // TODO(FW-2959): type\n disableIonPageManagement?: boolean;\n}\n\n// eslint-disable-next-line @typescript-eslint/no-empty-interface\ninterface IonRouteState {}\n\nexport class IonRoute extends React.PureComponent<IonRouteProps, IonRouteState> {\n context!: React.ContextType<typeof NavContext>;\n\n render() {\n const IonRouteInner = this.context.getIonRoute();\n\n if (!this.context.hasIonicRouter() || !IonRoute) {\n console.error('You either do not have an Ionic Router package, or your router does not support using <IonRoute>');\n return null;\n }\n\n return <IonRouteInner {...this.props} />;\n }\n\n static get contextType() {\n return NavContext;\n }\n}\n"],
|
|
5
|
+
"mappings": ";AAAA,OAAO,WAAW;AAElB,SAAS,kBAAkB;AAapB,aAAM,iBAAiB,MAAM,cAA4C;AAAA,EAG9E,SAAS;AACP,UAAM,gBAAgB,KAAK,QAAQ,YAAY;AAE/C,QAAI,CAAC,KAAK,QAAQ,eAAe,KAAK,CAAC,UAAU;AAC/C,cAAQ,MAAM,kGAAkG;AAChH,aAAO;AAAA,IACT;AAEA,WAAO,oCAAC,iBAAe,GAAG,KAAK,OAAO;AAAA,EACxC;AAAA,EAEA,WAAW,cAAc;AACvB,WAAO;AAAA,EACT;AACF;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
import React, { useContext, useMemo } from "react";
|
|
3
|
+
export const IonRouterContext = React.createContext({
|
|
4
|
+
routeInfo: void 0,
|
|
5
|
+
// TODO(FW-2959): type
|
|
6
|
+
push: () => {
|
|
7
|
+
throw new Error("An Ionic Router is required for IonRouterContext");
|
|
8
|
+
},
|
|
9
|
+
back: () => {
|
|
10
|
+
throw new Error("An Ionic Router is required for IonRouterContext");
|
|
11
|
+
},
|
|
12
|
+
canGoBack: () => {
|
|
13
|
+
throw new Error("An Ionic Router is required for IonRouterContext");
|
|
14
|
+
},
|
|
15
|
+
nativeBack: () => {
|
|
16
|
+
throw new Error("An Ionic Router is required for IonRouterContext");
|
|
17
|
+
}
|
|
18
|
+
});
|
|
19
|
+
export function useIonRouter() {
|
|
20
|
+
const context = useContext(IonRouterContext);
|
|
21
|
+
return useMemo(
|
|
22
|
+
() => ({
|
|
23
|
+
back: context.back,
|
|
24
|
+
push: context.push,
|
|
25
|
+
goBack: context.back,
|
|
26
|
+
canGoBack: context.canGoBack,
|
|
27
|
+
routeInfo: context.routeInfo
|
|
28
|
+
}),
|
|
29
|
+
[context.back, context.push, context.canGoBack, context.routeInfo]
|
|
30
|
+
);
|
|
31
|
+
}
|
|
32
|
+
//# sourceMappingURL=IonRouterContext.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/components/IonRouterContext.tsx"],
|
|
4
|
+
"sourcesContent": ["import type { AnimationBuilder } from '@ionic/core/components';\nimport React, { useContext, useMemo } from 'react';\n\nimport type { RouteAction, RouterDirection, RouterOptions } from '../models';\nimport type { RouteInfo } from '../models/RouteInfo';\n\nexport interface IonRouterContextState {\n routeInfo: RouteInfo;\n push: (\n pathname: string,\n routerDirection?: RouterDirection,\n routeAction?: RouteAction,\n routerOptions?: RouterOptions,\n animationBuilder?: AnimationBuilder\n ) => void;\n back: (animationBuilder?: AnimationBuilder) => void;\n canGoBack: () => boolean;\n nativeBack: () => void;\n}\n\nexport const IonRouterContext = React.createContext<IonRouterContextState>({\n routeInfo: undefined as any, // TODO(FW-2959): type\n push: () => {\n throw new Error('An Ionic Router is required for IonRouterContext');\n },\n back: () => {\n throw new Error('An Ionic Router is required for IonRouterContext');\n },\n canGoBack: () => {\n throw new Error('An Ionic Router is required for IonRouterContext');\n },\n nativeBack: () => {\n throw new Error('An Ionic Router is required for IonRouterContext');\n },\n});\n\n/**\n * A hook for more direct control over routing in an Ionic React application. Allows you to pass additional meta-data to the router before the call to the native router.\n */\nexport function useIonRouter(): UseIonRouterResult {\n const context = useContext(IonRouterContext);\n\n return useMemo(\n () => ({\n back: context.back,\n push: context.push,\n goBack: context.back,\n canGoBack: context.canGoBack,\n routeInfo: context.routeInfo,\n }),\n [context.back, context.push, context.canGoBack, context.routeInfo]\n );\n}\n\nexport type UseIonRouterResult = {\n /**\n * @deprecated - Use goBack instead\n * @param animationBuilder - Optional - A custom transition animation to use\n */\n back(animationBuilder?: AnimationBuilder): void;\n /**\n * Navigates to a new pathname\n * @param pathname - The path to navigate to\n * @param routerDirection - Optional - The RouterDirection to use for transition purposes, defaults to 'forward'\n * @param routeAction - Optional - The RouteAction to use for history purposes, defaults to 'push'\n * @param routerOptions - Optional - Any additional parameters to pass to the router\n * @param animationBuilder - Optional - A custom transition animation to use\n */\n push(\n pathname: string,\n routerDirection?: RouterDirection,\n routeAction?: RouteAction,\n routerOptions?: RouterOptions,\n animationBuilder?: AnimationBuilder\n ): void;\n /**\n * Navigates backwards in history, using the IonRouter to determine history\n * @param animationBuilder - Optional - A custom transition animation to use\n */\n goBack(animationBuilder?: AnimationBuilder): void;\n /**\n * Determines if there are any additional routes in the the Router's history. However, routing is not prevented if the browser's history has more entries. Returns true if more entries exist, false if not.\n */\n canGoBack(): boolean;\n routeInfo: RouteInfo;\n};\n"],
|
|
5
|
+
"mappings": ";AACA,OAAO,SAAS,YAAY,eAAe;AAmBpC,aAAM,mBAAmB,MAAM,cAAqC;AAAA,EACzE,WAAW;AAAA;AAAA,EACX,MAAM,MAAM;AACV,UAAM,IAAI,MAAM,kDAAkD;AAAA,EACpE;AAAA,EACA,MAAM,MAAM;AACV,UAAM,IAAI,MAAM,kDAAkD;AAAA,EACpE;AAAA,EACA,WAAW,MAAM;AACf,UAAM,IAAI,MAAM,kDAAkD;AAAA,EACpE;AAAA,EACA,YAAY,MAAM;AAChB,UAAM,IAAI,MAAM,kDAAkD;AAAA,EACpE;AACF,CAAC;AAKM,gBAAS,eAAmC;AACjD,QAAM,UAAU,WAAW,gBAAgB;AAE3C,SAAO;AAAA,IACL,OAAO;AAAA,MACL,MAAM,QAAQ;AAAA,MACd,MAAM,QAAQ;AAAA,MACd,QAAQ,QAAQ;AAAA,MAChB,WAAW,QAAQ;AAAA,MACnB,WAAW,QAAQ;AAAA,IACrB;AAAA,IACA,CAAC,QAAQ,MAAM,QAAQ,MAAM,QAAQ,WAAW,QAAQ,SAAS;AAAA,EACnE;AACF;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
import React from "react";
|
|
3
|
+
import { NavContext } from "../contexts/NavContext";
|
|
4
|
+
import OutletPageManager from "../routing/OutletPageManager";
|
|
5
|
+
import { IonRouterOutletInner } from "./inner-proxies";
|
|
6
|
+
import { createForwardRef } from "./utils";
|
|
7
|
+
class IonRouterOutletContainer extends React.Component {
|
|
8
|
+
constructor(props) {
|
|
9
|
+
super(props);
|
|
10
|
+
}
|
|
11
|
+
render() {
|
|
12
|
+
const StackManager = this.context.getStackManager();
|
|
13
|
+
const { children, forwardedRef, ...props } = this.props;
|
|
14
|
+
return this.context.hasIonicRouter() ? props.ionPage ? /* @__PURE__ */ React.createElement(OutletPageManager, { StackManager, routeInfo: this.context.routeInfo, ...props }, children) : /* @__PURE__ */ React.createElement(StackManager, { routeInfo: this.context.routeInfo }, /* @__PURE__ */ React.createElement(IonRouterOutletInner, { ...props, forwardedRef }, children)) : /* @__PURE__ */ React.createElement(IonRouterOutletInner, { ref: forwardedRef, ...this.props }, this.props.children);
|
|
15
|
+
}
|
|
16
|
+
static get contextType() {
|
|
17
|
+
return NavContext;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
export const IonRouterOutlet = createForwardRef(
|
|
21
|
+
IonRouterOutletContainer,
|
|
22
|
+
"IonRouterOutlet"
|
|
23
|
+
);
|
|
24
|
+
//# sourceMappingURL=IonRouterOutlet.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/components/IonRouterOutlet.tsx"],
|
|
4
|
+
"sourcesContent": ["import type { JSX as LocalJSX } from '@ionic/core/components';\nimport React from 'react';\n\nimport { NavContext } from '../contexts/NavContext';\nimport OutletPageManager from '../routing/OutletPageManager';\n\nimport type { IonicReactProps } from './IonicReactProps';\nimport { IonRouterOutletInner } from './inner-proxies';\nimport { createForwardRef } from './utils';\n\ntype Props = LocalJSX.IonRouterOutlet & {\n basePath?: string;\n ref?: React.Ref<any>;\n ionPage?: boolean;\n};\n\ninterface InternalProps extends Props {\n forwardedRef?: React.ForwardedRef<HTMLIonRouterOutletElement>;\n}\n\n// eslint-disable-next-line @typescript-eslint/no-empty-interface\ninterface InternalState {}\n\nclass IonRouterOutletContainer extends React.Component<InternalProps, InternalState> {\n context!: React.ContextType<typeof NavContext>;\n\n constructor(props: InternalProps) {\n super(props);\n }\n\n render() {\n const StackManager = this.context.getStackManager();\n const { children, forwardedRef, ...props } = this.props;\n\n return this.context.hasIonicRouter() ? (\n props.ionPage ? (\n <OutletPageManager StackManager={StackManager} routeInfo={this.context.routeInfo} {...props}>\n {children}\n </OutletPageManager>\n ) : (\n <StackManager routeInfo={this.context.routeInfo}>\n <IonRouterOutletInner {...props} forwardedRef={forwardedRef}>\n {children}\n </IonRouterOutletInner>\n </StackManager>\n )\n ) : (\n <IonRouterOutletInner ref={forwardedRef} {...this.props}>\n {this.props.children}\n </IonRouterOutletInner>\n );\n }\n\n static get contextType() {\n return NavContext;\n }\n}\n\nexport const IonRouterOutlet = createForwardRef<Props & IonicReactProps, HTMLIonRouterOutletElement>(\n IonRouterOutletContainer,\n 'IonRouterOutlet'\n);\n"],
|
|
5
|
+
"mappings": ";AACA,OAAO,WAAW;AAElB,SAAS,kBAAkB;AAC3B,OAAO,uBAAuB;AAG9B,SAAS,4BAA4B;AACrC,SAAS,wBAAwB;AAejC,MAAM,iCAAiC,MAAM,UAAwC;AAAA,EAGnF,YAAY,OAAsB;AAChC,UAAM,KAAK;AAAA,EACb;AAAA,EAEA,SAAS;AACP,UAAM,eAAe,KAAK,QAAQ,gBAAgB;AAClD,UAAM,EAAE,UAAU,cAAc,GAAG,MAAM,IAAI,KAAK;AAElD,WAAO,KAAK,QAAQ,eAAe,IACjC,MAAM,UACJ,oCAAC,qBAAkB,cAA4B,WAAW,KAAK,QAAQ,WAAY,GAAG,SACnF,QACH,IAEA,oCAAC,gBAAa,WAAW,KAAK,QAAQ,aACpC,oCAAC,wBAAsB,GAAG,OAAO,gBAC9B,QACH,CACF,IAGF,oCAAC,wBAAqB,KAAK,cAAe,GAAG,KAAK,SAC/C,KAAK,MAAM,QACd;AAAA,EAEJ;AAAA,EAEA,WAAW,cAAc;AACvB,WAAO;AAAA,EACT;AACF;AAEO,aAAM,kBAAkB;AAAA,EAC7B;AAAA,EACA;AACF;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
import { defineCustomElement } from "@ionic/core/components/ion-toast.js";
|
|
3
|
+
import { createInlineOverlayComponent } from "./createInlineOverlayComponent";
|
|
4
|
+
export const IonToast = /* @__PURE__ */ createInlineOverlayComponent(
|
|
5
|
+
"ion-toast",
|
|
6
|
+
defineCustomElement
|
|
7
|
+
);
|
|
8
|
+
//# sourceMappingURL=IonToast.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/components/IonToast.tsx"],
|
|
4
|
+
"sourcesContent": ["import type { JSX } from '@ionic/core/components';\nimport { defineCustomElement } from '@ionic/core/components/ion-toast.js';\n\nimport { createInlineOverlayComponent } from './createInlineOverlayComponent';\n\nexport const IonToast = /*@__PURE__*/ createInlineOverlayComponent<JSX.IonToast, HTMLIonToastElement>(\n 'ion-toast',\n defineCustomElement\n);\n"],
|
|
5
|
+
"mappings": ";AACA,SAAS,2BAA2B;AAEpC,SAAS,oCAAoC;AAEtC,aAAM,WAAyB;AAAA,EACpC;AAAA,EACA;AACF;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|