@ionic/react 8.4.6-dev.11741906766.14c01edc → 8.4.6
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/css/core.css.map +1 -1
- package/css/ionic.bundle.css.map +1 -1
- package/dist/index.js +150 -172
- package/dist/index.js.map +1 -1
- package/dist/types/components/CreateAnimation.d.ts +1 -1
- package/dist/types/components/IonApp.d.ts +35 -11
- package/dist/types/components/IonRedirect.d.ts +1 -1
- package/dist/types/components/IonRoute.d.ts +1 -1
- package/dist/types/components/navigation/IonBackButton.d.ts +63 -11
- package/dist/types/components/navigation/IonTabButton.d.ts +30 -8
- package/dist/types/components/navigation/IonTabs.d.ts +44 -37
- package/dist/types/lifecycle/IonLifeCycleHOC.d.ts +1 -1
- package/dist/types/routing/NavManager.d.ts +1 -1
- package/dist/types/routing/OutletPageManager.d.ts +1 -1
- package/dist/types/routing/PageManager.d.ts +1 -1
- package/dist/types/routing/ViewLifeCycleManager.d.ts +1 -1
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import React, { useContext, useRef, useEffect, createElement, useState, useMemo, Fragment as Fragment$1, useCallback } from 'react';
|
|
1
|
+
import React, { useContext, useRef, useEffect, createElement, useState, useMemo, Fragment, useCallback } from 'react';
|
|
3
2
|
import { isPlatform as isPlatform$1, getPlatforms as getPlatforms$1, componentOnReady, createAnimation, actionSheetController, alertController, toastController, modalController, popoverController, pickerController, loadingController, initialize } from '@ionic/core/components';
|
|
4
3
|
export { IonicSafeString, IonicSlides, createAnimation, createGesture, getIonPageElement, getTimeGivenProgression, iosTransitionAnimation, mdTransitionAnimation, openURL } from '@ionic/core/components';
|
|
4
|
+
import { __rest } from 'tslib';
|
|
5
5
|
import ReactDOM, { createPortal } from 'react-dom';
|
|
6
6
|
import { defineCustomElement as defineCustomElement$1 } from '@ionic/core/components/ion-accordion.js';
|
|
7
7
|
import { defineCustomElement as defineCustomElement$2 } from '@ionic/core/components/ion-accordion-group.js';
|
|
@@ -88,13 +88,13 @@ import { defineCustomElement as defineCustomElement$1a } from '@ionic/core/compo
|
|
|
88
88
|
import { defineCustomElement as defineCustomElement$1b } from '@ionic/core/components/ion-action-sheet.js';
|
|
89
89
|
import { defineCustomElement as defineCustomElement$1c } from '@ionic/core/components/ion-modal.js';
|
|
90
90
|
import { defineCustomElement as defineCustomElement$1d } from '@ionic/core/components/ion-popover.js';
|
|
91
|
-
import { defineCustomElement as defineCustomElement$
|
|
92
|
-
import { defineCustomElement as defineCustomElement$
|
|
93
|
-
import { defineCustomElement as defineCustomElement$
|
|
94
|
-
import { defineCustomElement as defineCustomElement$
|
|
95
|
-
import { defineCustomElement as defineCustomElement$
|
|
96
|
-
import { defineCustomElement as defineCustomElement$
|
|
97
|
-
import { defineCustomElement as defineCustomElement$
|
|
91
|
+
import { defineCustomElement as defineCustomElement$1k } from '@ionic/core/components/ion-app.js';
|
|
92
|
+
import { defineCustomElement as defineCustomElement$1j } from '@ionic/core/components/ion-back-button.js';
|
|
93
|
+
import { defineCustomElement as defineCustomElement$1f } from '@ionic/core/components/ion-router-outlet.js';
|
|
94
|
+
import { defineCustomElement as defineCustomElement$1e } from '@ionic/core/components/ion-tab-bar.js';
|
|
95
|
+
import { defineCustomElement as defineCustomElement$1h } from '@ionic/core/components/ion-tab-button.js';
|
|
96
|
+
import { defineCustomElement as defineCustomElement$1i } from '@ionic/core/components/ion-tabs.js';
|
|
97
|
+
import { defineCustomElement as defineCustomElement$1g } from 'ionicons/components/ion-icon.js';
|
|
98
98
|
|
|
99
99
|
const IonLifeCycleContext = /*@__PURE__*/ React.createContext({
|
|
100
100
|
onIonViewWillEnter: () => {
|
|
@@ -321,10 +321,10 @@ const withIonLifeCycle = (WrappedComponent) => {
|
|
|
321
321
|
});
|
|
322
322
|
}
|
|
323
323
|
render() {
|
|
324
|
-
return (
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
324
|
+
return (React.createElement(IonLifeCycleContext.Consumer, null, (context) => {
|
|
325
|
+
this.context = context;
|
|
326
|
+
return React.createElement(WrappedComponent, Object.assign({ ref: this.componentRef }, this.props));
|
|
327
|
+
}));
|
|
328
328
|
}
|
|
329
329
|
};
|
|
330
330
|
};
|
|
@@ -545,7 +545,7 @@ const mergeRefs = (...refs) => {
|
|
|
545
545
|
};
|
|
546
546
|
const createForwardRef$1 = (ReactComponent, displayName) => {
|
|
547
547
|
const forwardRef = (props, ref) => {
|
|
548
|
-
return
|
|
548
|
+
return React.createElement(ReactComponent, Object.assign({}, props, { forwardedRef: ref }));
|
|
549
549
|
};
|
|
550
550
|
forwardRef.displayName = displayName;
|
|
551
551
|
return React.forwardRef(forwardRef);
|
|
@@ -575,7 +575,7 @@ const createReactComponent = (tagName, ReactComponentContext, manipulatePropsFun
|
|
|
575
575
|
attachProps(this.componentEl, this.props, prevProps);
|
|
576
576
|
}
|
|
577
577
|
render() {
|
|
578
|
-
const { children, forwardedRef, style, className, ref,
|
|
578
|
+
const _a = this.props, { children, forwardedRef, style, className, ref } = _a, cProps = __rest(_a, ["children", "forwardedRef", "style", "className", "ref"]);
|
|
579
579
|
let propsToPass = Object.keys(cProps).reduce((acc, name) => {
|
|
580
580
|
const value = cProps[name];
|
|
581
581
|
if (name.indexOf('on') === 0 && name[2] === name[2].toUpperCase()) {
|
|
@@ -597,11 +597,7 @@ const createReactComponent = (tagName, ReactComponentContext, manipulatePropsFun
|
|
|
597
597
|
if (manipulatePropsFunction) {
|
|
598
598
|
propsToPass = manipulatePropsFunction(this.props, propsToPass);
|
|
599
599
|
}
|
|
600
|
-
const newProps = {
|
|
601
|
-
...propsToPass,
|
|
602
|
-
ref: mergeRefs(forwardedRef, this.setComponentElRef),
|
|
603
|
-
style,
|
|
604
|
-
};
|
|
600
|
+
const newProps = Object.assign(Object.assign({}, propsToPass), { ref: mergeRefs(forwardedRef, this.setComponentElRef), style });
|
|
605
601
|
/**
|
|
606
602
|
* We use createElement here instead of
|
|
607
603
|
* React.createElement to work around a
|
|
@@ -699,7 +695,7 @@ const IonToolbar = /*@__PURE__*/ createReactComponent('ion-toolbar', undefined,
|
|
|
699
695
|
const createForwardRef = (ReactComponent, // TODO(FW-2959): type
|
|
700
696
|
displayName) => {
|
|
701
697
|
const forwardRef = (props, ref) => {
|
|
702
|
-
return
|
|
698
|
+
return React.createElement(ReactComponent, Object.assign({}, props, { forwardedRef: ref }));
|
|
703
699
|
};
|
|
704
700
|
forwardRef.displayName = displayName;
|
|
705
701
|
return React.forwardRef(forwardRef);
|
|
@@ -747,7 +743,7 @@ const createRoutingComponent = (tagName, customElement) => {
|
|
|
747
743
|
}
|
|
748
744
|
render() {
|
|
749
745
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
750
|
-
const { children, forwardedRef, style, className, ref,
|
|
746
|
+
const _a = this.props, { children, forwardedRef, style, className, ref } = _a, cProps = __rest(_a, ["children", "forwardedRef", "style", "className", "ref"]);
|
|
751
747
|
const propsToPass = Object.keys(cProps).reduce((acc, name) => {
|
|
752
748
|
if (name.indexOf('on') === 0 && name[2] === name[2].toUpperCase()) {
|
|
753
749
|
const eventName = name.substring(2).toLowerCase();
|
|
@@ -760,11 +756,7 @@ const createRoutingComponent = (tagName, customElement) => {
|
|
|
760
756
|
}
|
|
761
757
|
return acc;
|
|
762
758
|
}, {});
|
|
763
|
-
const newProps = {
|
|
764
|
-
...propsToPass,
|
|
765
|
-
ref: this.stableMergedRefs,
|
|
766
|
-
style,
|
|
767
|
-
};
|
|
759
|
+
const newProps = Object.assign(Object.assign({}, propsToPass), { ref: this.stableMergedRefs, style });
|
|
768
760
|
if (this.props.routerLink && !this.props.href) {
|
|
769
761
|
newProps.href = this.props.routerLink;
|
|
770
762
|
}
|
|
@@ -890,10 +882,11 @@ const createInlineOverlayComponent = (tagName, defineCustomElement, hasDelegateH
|
|
|
890
882
|
this.wrapperRef = React.createRef();
|
|
891
883
|
}
|
|
892
884
|
componentDidMount() {
|
|
885
|
+
var _a, _b, _c;
|
|
893
886
|
this.componentDidUpdate(this.props);
|
|
894
|
-
this.ref.current
|
|
895
|
-
this.ref.current
|
|
896
|
-
this.ref.current
|
|
887
|
+
(_a = this.ref.current) === null || _a === void 0 ? void 0 : _a.addEventListener('ionMount', this.handleIonMount);
|
|
888
|
+
(_b = this.ref.current) === null || _b === void 0 ? void 0 : _b.addEventListener('willPresent', this.handleWillPresent);
|
|
889
|
+
(_c = this.ref.current) === null || _c === void 0 ? void 0 : _c.addEventListener('didDismiss', this.handleDidDismiss);
|
|
897
890
|
}
|
|
898
891
|
componentDidUpdate(prevProps) {
|
|
899
892
|
const node = this.ref.current;
|
|
@@ -903,7 +896,7 @@ const createInlineOverlayComponent = (tagName, defineCustomElement, hasDelegateH
|
|
|
903
896
|
* so they don't get attached twice and called twice.
|
|
904
897
|
*/
|
|
905
898
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
906
|
-
const
|
|
899
|
+
const _a = this.props, cProps = __rest(_a, ["onDidDismiss", "onWillPresent"]);
|
|
907
900
|
attachProps(node, cProps, prevProps);
|
|
908
901
|
}
|
|
909
902
|
componentWillUnmount() {
|
|
@@ -936,7 +929,7 @@ const createInlineOverlayComponent = (tagName, defineCustomElement, hasDelegateH
|
|
|
936
929
|
}
|
|
937
930
|
render() {
|
|
938
931
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
939
|
-
const { children, forwardedRef, style, className, ref,
|
|
932
|
+
const _a = this.props, { children, forwardedRef, style, className, ref } = _a, cProps = __rest(_a, ["children", "forwardedRef", "style", "className", "ref"]);
|
|
940
933
|
const propsToPass = Object.keys(cProps).reduce((acc, name) => {
|
|
941
934
|
if (name.indexOf('on') === 0 && name[2] === name[2].toUpperCase()) {
|
|
942
935
|
const eventName = name.substring(2).toLowerCase();
|
|
@@ -949,11 +942,7 @@ const createInlineOverlayComponent = (tagName, defineCustomElement, hasDelegateH
|
|
|
949
942
|
}
|
|
950
943
|
return acc;
|
|
951
944
|
}, {});
|
|
952
|
-
const newProps = {
|
|
953
|
-
...propsToPass,
|
|
954
|
-
ref: this.stableMergedRefs,
|
|
955
|
-
style,
|
|
956
|
-
};
|
|
945
|
+
const newProps = Object.assign(Object.assign({}, propsToPass), { ref: this.stableMergedRefs, style });
|
|
957
946
|
/**
|
|
958
947
|
* Some overlays need `.ion-page` so content
|
|
959
948
|
* takes up the full size of the parent overlay.
|
|
@@ -1038,7 +1027,7 @@ const IonOverlayManager = ({ onAddOverlay, onRemoveOverlay }) => {
|
|
|
1038
1027
|
onRemoveOverlay(removeOverlay);
|
|
1039
1028
|
}, []);
|
|
1040
1029
|
const addOverlay = (id, component, containerElement) => {
|
|
1041
|
-
const newOverlays = {
|
|
1030
|
+
const newOverlays = Object.assign({}, overlaysRef.current);
|
|
1042
1031
|
newOverlays[id] = { component, containerElement };
|
|
1043
1032
|
/**
|
|
1044
1033
|
* In order for this function to use the latest data
|
|
@@ -1061,7 +1050,7 @@ const IonOverlayManager = ({ onAddOverlay, onRemoveOverlay }) => {
|
|
|
1061
1050
|
setOverlays(newOverlays);
|
|
1062
1051
|
};
|
|
1063
1052
|
const removeOverlay = (id) => {
|
|
1064
|
-
const newOverlays = {
|
|
1053
|
+
const newOverlays = Object.assign({}, overlaysRef.current);
|
|
1065
1054
|
delete newOverlays[id];
|
|
1066
1055
|
/**
|
|
1067
1056
|
* In order for this function to use the latest data
|
|
@@ -1084,24 +1073,27 @@ const IonOverlayManager = ({ onAddOverlay, onRemoveOverlay }) => {
|
|
|
1084
1073
|
setOverlays(newOverlays);
|
|
1085
1074
|
};
|
|
1086
1075
|
const overlayKeys = Object.keys(overlays);
|
|
1087
|
-
return (
|
|
1088
|
-
|
|
1089
|
-
|
|
1090
|
-
|
|
1076
|
+
return (React.createElement(React.Fragment, null, overlayKeys.map((key) => {
|
|
1077
|
+
const overlay = overlays[key];
|
|
1078
|
+
return ReactDOM.createPortal(overlay.component, overlay.containerElement, `overlay-${key}`);
|
|
1079
|
+
})));
|
|
1091
1080
|
};
|
|
1092
1081
|
|
|
1093
|
-
const IonTabButtonInner = /*@__PURE__*/ createReactComponent('ion-tab-button', undefined, undefined, defineCustomElement$
|
|
1094
|
-
const IonTabBarInner = /*@__PURE__*/ createReactComponent('ion-tab-bar', undefined, undefined, defineCustomElement$
|
|
1095
|
-
const IonTabsInner = /*@__PURE__*/ createReactComponent('ion-tabs', undefined, undefined, defineCustomElement$
|
|
1096
|
-
const IonBackButtonInner = /*@__PURE__*/ createReactComponent('ion-back-button', undefined, undefined, defineCustomElement$
|
|
1097
|
-
const IonRouterOutletInner = /*@__PURE__*/ createReactComponent('ion-router-outlet', undefined, undefined, defineCustomElement$
|
|
1098
|
-
const IonAppInner = /*@__PURE__*/ createReactComponent('ion-app', undefined, undefined, defineCustomElement$
|
|
1082
|
+
const IonTabButtonInner = /*@__PURE__*/ createReactComponent('ion-tab-button', undefined, undefined, defineCustomElement$1h);
|
|
1083
|
+
const IonTabBarInner = /*@__PURE__*/ createReactComponent('ion-tab-bar', undefined, undefined, defineCustomElement$1e);
|
|
1084
|
+
const IonTabsInner = /*@__PURE__*/ createReactComponent('ion-tabs', undefined, undefined, defineCustomElement$1i);
|
|
1085
|
+
const IonBackButtonInner = /*@__PURE__*/ createReactComponent('ion-back-button', undefined, undefined, defineCustomElement$1j);
|
|
1086
|
+
const IonRouterOutletInner = /*@__PURE__*/ createReactComponent('ion-router-outlet', undefined, undefined, defineCustomElement$1f);
|
|
1087
|
+
const IonAppInner = /*@__PURE__*/ createReactComponent('ion-app', undefined, undefined, defineCustomElement$1k);
|
|
1099
1088
|
// ionicons
|
|
1100
|
-
const IonIconInner = /*@__PURE__*/ createReactComponent('ion-icon', undefined, undefined, defineCustomElement$
|
|
1089
|
+
const IonIconInner = /*@__PURE__*/ createReactComponent('ion-icon', undefined, undefined, defineCustomElement$1g);
|
|
1101
1090
|
|
|
1102
|
-
|
|
1091
|
+
const IonApp = /*@__PURE__*/ (() => class extends React.Component {
|
|
1103
1092
|
constructor(props) {
|
|
1104
1093
|
super(props);
|
|
1094
|
+
/*
|
|
1095
|
+
Wire up methods to call into IonOverlayManager
|
|
1096
|
+
*/
|
|
1105
1097
|
this.ionContext = {
|
|
1106
1098
|
addOverlay: (id, overlay, containerElement) => {
|
|
1107
1099
|
if (this.addOverlayCallback) {
|
|
@@ -1116,14 +1108,18 @@ class IonApp extends React.Component {
|
|
|
1116
1108
|
};
|
|
1117
1109
|
}
|
|
1118
1110
|
render() {
|
|
1119
|
-
return (
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
|
|
1111
|
+
return (React.createElement(IonContext.Provider, { value: this.ionContext },
|
|
1112
|
+
React.createElement(IonAppInner, Object.assign({}, this.props), this.props.children),
|
|
1113
|
+
React.createElement(IonOverlayManager, { onAddOverlay: (callback) => {
|
|
1114
|
+
this.addOverlayCallback = callback;
|
|
1115
|
+
}, onRemoveOverlay: (callback) => {
|
|
1116
|
+
this.removeOverlayCallback = callback;
|
|
1117
|
+
} })));
|
|
1124
1118
|
}
|
|
1125
|
-
|
|
1126
|
-
|
|
1119
|
+
static get displayName() {
|
|
1120
|
+
return 'IonApp';
|
|
1121
|
+
}
|
|
1122
|
+
})();
|
|
1127
1123
|
|
|
1128
1124
|
const StackContext = React.createContext({
|
|
1129
1125
|
registerIonPage: () => undefined,
|
|
@@ -1187,11 +1183,11 @@ class PageManager extends React.PureComponent {
|
|
|
1187
1183
|
}
|
|
1188
1184
|
render() {
|
|
1189
1185
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
1190
|
-
const { className, children, routeInfo, forwardedRef,
|
|
1191
|
-
return (
|
|
1192
|
-
|
|
1193
|
-
|
|
1194
|
-
|
|
1186
|
+
const _a = this.props, { className, children, routeInfo, forwardedRef } = _a, props = __rest(_a, ["className", "children", "routeInfo", "forwardedRef"]);
|
|
1187
|
+
return (React.createElement(IonLifeCycleContext.Consumer, null, (context) => {
|
|
1188
|
+
this.ionLifeCycleContext = context;
|
|
1189
|
+
return (React.createElement("div", Object.assign({ className: className ? `${className} ion-page` : `ion-page`, ref: this.stableMergedRefs }, props), children));
|
|
1190
|
+
}));
|
|
1195
1191
|
}
|
|
1196
1192
|
static get contextType() {
|
|
1197
1193
|
return StackContext;
|
|
@@ -1203,8 +1199,8 @@ class IonPageInternal extends React.Component {
|
|
|
1203
1199
|
super(props);
|
|
1204
1200
|
}
|
|
1205
1201
|
render() {
|
|
1206
|
-
const { className, children, forwardedRef,
|
|
1207
|
-
return this.context.hasIonicRouter() ? (
|
|
1202
|
+
const _a = this.props, { className, children, forwardedRef } = _a, props = __rest(_a, ["className", "children", "forwardedRef"]);
|
|
1203
|
+
return this.context.hasIonicRouter() ? (React.createElement(PageManager, Object.assign({ className: className ? `${className}` : '', routeInfo: this.context.routeInfo, forwardedRef: forwardedRef }, props), children)) : (React.createElement("div", Object.assign({ className: className ? `ion-page ${className}` : 'ion-page', ref: forwardedRef }, props), children));
|
|
1208
1204
|
}
|
|
1209
1205
|
static get displayName() {
|
|
1210
1206
|
return 'IonPage';
|
|
@@ -1217,7 +1213,8 @@ const IonPage = createForwardRef(IonPageInternal, 'IonPage');
|
|
|
1217
1213
|
|
|
1218
1214
|
const ids = { main: 0 };
|
|
1219
1215
|
const generateId = (type = 'main') => {
|
|
1220
|
-
|
|
1216
|
+
var _a;
|
|
1217
|
+
const id = ((_a = ids[type]) !== null && _a !== void 0 ? _a : 0) + 1;
|
|
1221
1218
|
ids[type] = id;
|
|
1222
1219
|
return id.toString();
|
|
1223
1220
|
};
|
|
@@ -1252,7 +1249,8 @@ const ReactDelegate = (addView, removeView) => {
|
|
|
1252
1249
|
|
|
1253
1250
|
const IonNavInner = createReactComponent('ion-nav', undefined, undefined, defineCustomElement$1l);
|
|
1254
1251
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
1255
|
-
const IonNavInternal = (
|
|
1252
|
+
const IonNavInternal = (_a) => {
|
|
1253
|
+
var { children, forwardedRef } = _a, restOfProps = __rest(_a, ["children", "forwardedRef"]);
|
|
1256
1254
|
const [views, setViews] = useState([]);
|
|
1257
1255
|
/**
|
|
1258
1256
|
* Allows us to create React components that are rendered within
|
|
@@ -1261,7 +1259,7 @@ const IonNavInternal = ({ children, forwardedRef, ...restOfProps }) => {
|
|
|
1261
1259
|
const addView = (view) => setViews((existingViews) => [...existingViews, view]);
|
|
1262
1260
|
const removeView = (view) => setViews((existingViews) => existingViews.filter((v) => v !== view));
|
|
1263
1261
|
const delegate = useMemo(() => ReactDelegate(addView, removeView), []);
|
|
1264
|
-
return (
|
|
1262
|
+
return (React.createElement(IonNavInner, Object.assign({ delegate: delegate, ref: forwardedRef }, restOfProps), views));
|
|
1265
1263
|
};
|
|
1266
1264
|
const IonNav = createForwardRef(IonNavInternal, 'IonNav');
|
|
1267
1265
|
|
|
@@ -1329,11 +1327,12 @@ class OutletPageManager extends React.Component {
|
|
|
1329
1327
|
this.ionLifeCycleContext.ionViewDidLeave();
|
|
1330
1328
|
}
|
|
1331
1329
|
render() {
|
|
1332
|
-
const { StackManager, children, routeInfo,
|
|
1333
|
-
return (
|
|
1334
|
-
|
|
1335
|
-
|
|
1336
|
-
|
|
1330
|
+
const _a = this.props, { StackManager, children, routeInfo } = _a, props = __rest(_a, ["StackManager", "children", "routeInfo"]);
|
|
1331
|
+
return (React.createElement(IonLifeCycleContext.Consumer, null, (context) => {
|
|
1332
|
+
this.ionLifeCycleContext = context;
|
|
1333
|
+
return (React.createElement(StackManager, { routeInfo: routeInfo },
|
|
1334
|
+
React.createElement(IonRouterOutletInner, Object.assign({ setRef: (val) => (this.ionRouterOutlet = val) }, props), children)));
|
|
1335
|
+
}));
|
|
1337
1336
|
}
|
|
1338
1337
|
static get contextType() {
|
|
1339
1338
|
return StackContext;
|
|
@@ -1346,8 +1345,9 @@ class IonRouterOutletContainer extends React.Component {
|
|
|
1346
1345
|
}
|
|
1347
1346
|
render() {
|
|
1348
1347
|
const StackManager = this.context.getStackManager();
|
|
1349
|
-
const { children, forwardedRef,
|
|
1350
|
-
return this.context.hasIonicRouter() ? (props.ionPage ? (
|
|
1348
|
+
const _a = this.props, { children, forwardedRef } = _a, props = __rest(_a, ["children", "forwardedRef"]);
|
|
1349
|
+
return this.context.hasIonicRouter() ? (props.ionPage ? (React.createElement(OutletPageManager, Object.assign({ StackManager: StackManager, routeInfo: this.context.routeInfo }, props), children)) : (React.createElement(StackManager, { routeInfo: this.context.routeInfo },
|
|
1350
|
+
React.createElement(IonRouterOutletInner, Object.assign({}, props, { forwardedRef: forwardedRef }), children)))) : (React.createElement(IonRouterOutletInner, Object.assign({ ref: forwardedRef }, this.props), this.props.children));
|
|
1351
1351
|
}
|
|
1352
1352
|
static get contextType() {
|
|
1353
1353
|
return NavContext;
|
|
@@ -1367,10 +1367,7 @@ if (typeof window !== 'undefined' && window.customElements) {
|
|
|
1367
1367
|
window.customElements.define('ion-tabs', IonTabsElement);
|
|
1368
1368
|
}
|
|
1369
1369
|
}
|
|
1370
|
-
|
|
1371
|
-
shouldComponentUpdate() {
|
|
1372
|
-
return true;
|
|
1373
|
-
}
|
|
1370
|
+
const IonTabs = /*@__PURE__*/ (() => class extends React.Component {
|
|
1374
1371
|
constructor(props) {
|
|
1375
1372
|
super(props);
|
|
1376
1373
|
/**
|
|
@@ -1406,27 +1403,27 @@ class IonTabs extends React.Component {
|
|
|
1406
1403
|
}
|
|
1407
1404
|
}
|
|
1408
1405
|
renderTabsInner(children, outlet) {
|
|
1409
|
-
return (
|
|
1410
|
-
|
|
1411
|
-
|
|
1412
|
-
|
|
1413
|
-
|
|
1414
|
-
|
|
1415
|
-
|
|
1416
|
-
|
|
1417
|
-
|
|
1418
|
-
|
|
1419
|
-
|
|
1420
|
-
}
|
|
1406
|
+
return (React.createElement(IonTabsInner, Object.assign({}, this.props), React.Children.map(children, (child) => {
|
|
1407
|
+
if (React.isValidElement(child)) {
|
|
1408
|
+
const isRouterOutlet = child.type === IonRouterOutlet ||
|
|
1409
|
+
child.type.isRouterOutlet ||
|
|
1410
|
+
(child.type === Fragment && child.props.children[0].type === IonRouterOutlet);
|
|
1411
|
+
if (isRouterOutlet) {
|
|
1412
|
+
/**
|
|
1413
|
+
* The modified outlet needs to be returned to include
|
|
1414
|
+
* the ref.
|
|
1415
|
+
*/
|
|
1416
|
+
return outlet;
|
|
1421
1417
|
}
|
|
1422
|
-
|
|
1423
|
-
|
|
1418
|
+
}
|
|
1419
|
+
return child;
|
|
1420
|
+
})));
|
|
1424
1421
|
}
|
|
1425
1422
|
render() {
|
|
1426
1423
|
let outlet;
|
|
1427
1424
|
// Check if IonTabs has any IonTab children
|
|
1428
1425
|
let hasTab = false;
|
|
1429
|
-
const { className, onIonTabsDidChange, onIonTabsWillChange,
|
|
1426
|
+
const _a = this.props, { className, onIonTabsDidChange, onIonTabsWillChange } = _a, props = __rest(_a, ["className", "onIonTabsDidChange", "onIonTabsWillChange"]);
|
|
1430
1427
|
const children = typeof this.props.children === 'function'
|
|
1431
1428
|
? this.props.children(this.ionTabContextState)
|
|
1432
1429
|
: this.props.children;
|
|
@@ -1438,7 +1435,7 @@ class IonTabs extends React.Component {
|
|
|
1438
1435
|
if (child.type === IonRouterOutlet || child.type.isRouterOutlet) {
|
|
1439
1436
|
outlet = React.cloneElement(child);
|
|
1440
1437
|
}
|
|
1441
|
-
else if (child.type === Fragment
|
|
1438
|
+
else if (child.type === Fragment && child.props.children[0].type === IonRouterOutlet) {
|
|
1442
1439
|
outlet = React.cloneElement(child.props.children[0]);
|
|
1443
1440
|
}
|
|
1444
1441
|
else if (child.type === IonTab) {
|
|
@@ -1449,9 +1446,7 @@ class IonTabs extends React.Component {
|
|
|
1449
1446
|
hasTab = true;
|
|
1450
1447
|
}
|
|
1451
1448
|
this.ionTabContextState.hasRouterOutlet = !!outlet;
|
|
1452
|
-
let childProps = {
|
|
1453
|
-
...this.ionTabContextState.tabBarProps,
|
|
1454
|
-
};
|
|
1449
|
+
let childProps = Object.assign({}, this.ionTabContextState.tabBarProps);
|
|
1455
1450
|
/**
|
|
1456
1451
|
* Only pass these props
|
|
1457
1452
|
* down from IonTabs to IonTabBar
|
|
@@ -1460,16 +1455,10 @@ class IonTabs extends React.Component {
|
|
|
1460
1455
|
* IonTabBar it will be overridden.
|
|
1461
1456
|
*/
|
|
1462
1457
|
if (onIonTabsDidChange !== undefined) {
|
|
1463
|
-
childProps = {
|
|
1464
|
-
...childProps,
|
|
1465
|
-
onIonTabsDidChange,
|
|
1466
|
-
};
|
|
1458
|
+
childProps = Object.assign(Object.assign({}, childProps), { onIonTabsDidChange });
|
|
1467
1459
|
}
|
|
1468
1460
|
if (onIonTabsWillChange !== undefined) {
|
|
1469
|
-
childProps = {
|
|
1470
|
-
...childProps,
|
|
1471
|
-
onIonTabsWillChange,
|
|
1472
|
-
};
|
|
1461
|
+
childProps = Object.assign(Object.assign({}, childProps), { onIonTabsWillChange });
|
|
1473
1462
|
}
|
|
1474
1463
|
this.ionTabContextState.tabBarProps = childProps;
|
|
1475
1464
|
});
|
|
@@ -1480,7 +1469,7 @@ class IonTabs extends React.Component {
|
|
|
1480
1469
|
throw new Error('IonTabs cannot contain an IonRouterOutlet and an IonTab at the same time');
|
|
1481
1470
|
}
|
|
1482
1471
|
if (hasTab) {
|
|
1483
|
-
return
|
|
1472
|
+
return React.createElement(IonTabsInner, Object.assign({}, this.props));
|
|
1484
1473
|
}
|
|
1485
1474
|
/**
|
|
1486
1475
|
* TODO(ROU-11051)
|
|
@@ -1493,17 +1482,14 @@ class IonTabs extends React.Component {
|
|
|
1493
1482
|
* IonTabButton's onClick handler and how the routing
|
|
1494
1483
|
* is handled.
|
|
1495
1484
|
*/
|
|
1496
|
-
return (
|
|
1485
|
+
return (React.createElement(IonTabsContext.Provider, { value: this.ionTabContextState }, this.context.hasIonicRouter() ? (React.createElement(PageManager, Object.assign({ className: className ? `${className}` : '', routeInfo: this.context.routeInfo }, props), this.renderTabsInner(children, outlet))) : (this.renderTabsInner(children, outlet))));
|
|
1497
1486
|
}
|
|
1498
1487
|
static get contextType() {
|
|
1499
1488
|
return NavContext;
|
|
1500
1489
|
}
|
|
1501
|
-
}
|
|
1490
|
+
})();
|
|
1502
1491
|
|
|
1503
|
-
|
|
1504
|
-
shouldComponentUpdate() {
|
|
1505
|
-
return true;
|
|
1506
|
-
}
|
|
1492
|
+
const IonTabButton = /*@__PURE__*/ (() => class extends React.Component {
|
|
1507
1493
|
constructor(props) {
|
|
1508
1494
|
super(props);
|
|
1509
1495
|
this.handleIonTabButtonClick = this.handleIonTabButtonClick.bind(this);
|
|
@@ -1526,13 +1512,13 @@ class IonTabButton extends React.Component {
|
|
|
1526
1512
|
* component would result in duplicate handler calls.
|
|
1527
1513
|
*/
|
|
1528
1514
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
1529
|
-
const
|
|
1530
|
-
return
|
|
1515
|
+
const _a = this.props, rest = __rest(_a, ["onClick"]);
|
|
1516
|
+
return React.createElement(IonTabButtonInner, Object.assign({ onIonTabButtonClick: this.handleIonTabButtonClick }, rest));
|
|
1531
1517
|
}
|
|
1532
1518
|
static get displayName() {
|
|
1533
1519
|
return 'IonTabButton';
|
|
1534
1520
|
}
|
|
1535
|
-
}
|
|
1521
|
+
})();
|
|
1536
1522
|
|
|
1537
1523
|
// TODO(FW-2959): types
|
|
1538
1524
|
class IonTabBarUnwrapped extends React.PureComponent {
|
|
@@ -1542,6 +1528,7 @@ class IonTabBarUnwrapped extends React.PureComponent {
|
|
|
1542
1528
|
this.setActiveTabOnContext = (_tab) => { };
|
|
1543
1529
|
const tabs = {};
|
|
1544
1530
|
React.Children.forEach(props.children, (child) => {
|
|
1531
|
+
var _a, _b, _c, _d;
|
|
1545
1532
|
if (child != null &&
|
|
1546
1533
|
typeof child === 'object' &&
|
|
1547
1534
|
child.props &&
|
|
@@ -1549,8 +1536,8 @@ class IonTabBarUnwrapped extends React.PureComponent {
|
|
|
1549
1536
|
tabs[child.props.tab] = {
|
|
1550
1537
|
originalHref: child.props.href,
|
|
1551
1538
|
currentHref: child.props.href,
|
|
1552
|
-
originalRouteOptions: child.props.href === props.routeInfo
|
|
1553
|
-
currentRouteOptions: child.props.href === props.routeInfo
|
|
1539
|
+
originalRouteOptions: child.props.href === ((_a = props.routeInfo) === null || _a === void 0 ? void 0 : _a.pathname) ? (_b = props.routeInfo) === null || _b === void 0 ? void 0 : _b.routeOptions : undefined,
|
|
1540
|
+
currentRouteOptions: child.props.href === ((_c = props.routeInfo) === null || _c === void 0 ? void 0 : _c.pathname) ? (_d = props.routeInfo) === null || _d === void 0 ? void 0 : _d.routeOptions : undefined,
|
|
1554
1541
|
};
|
|
1555
1542
|
}
|
|
1556
1543
|
});
|
|
@@ -1596,7 +1583,8 @@ class IonTabBarUnwrapped extends React.PureComponent {
|
|
|
1596
1583
|
return false;
|
|
1597
1584
|
}
|
|
1598
1585
|
static getDerivedStateFromProps(props, state) {
|
|
1599
|
-
|
|
1586
|
+
var _a, _b, _c;
|
|
1587
|
+
const tabs = Object.assign({}, state.tabs);
|
|
1600
1588
|
const tabKeys = Object.keys(state.tabs);
|
|
1601
1589
|
const activeTab = tabKeys.find((key) => {
|
|
1602
1590
|
const href = state.tabs[key].originalHref;
|
|
@@ -1624,13 +1612,13 @@ class IonTabBarUnwrapped extends React.PureComponent {
|
|
|
1624
1612
|
const prevHref = state.tabs[prevActiveTab].currentHref;
|
|
1625
1613
|
const prevRouteOptions = state.tabs[prevActiveTab].currentRouteOptions;
|
|
1626
1614
|
if (activeTab !== prevActiveTab ||
|
|
1627
|
-
prevHref !== props.routeInfo
|
|
1628
|
-
prevRouteOptions !== props.routeInfo
|
|
1615
|
+
prevHref !== ((_a = props.routeInfo) === null || _a === void 0 ? void 0 : _a.pathname) ||
|
|
1616
|
+
prevRouteOptions !== ((_b = props.routeInfo) === null || _b === void 0 ? void 0 : _b.routeOptions)) {
|
|
1629
1617
|
tabs[activeTab] = {
|
|
1630
1618
|
originalHref: tabs[activeTab].originalHref,
|
|
1631
1619
|
currentHref: props.routeInfo.pathname + (props.routeInfo.search || ''),
|
|
1632
1620
|
originalRouteOptions: tabs[activeTab].originalRouteOptions,
|
|
1633
|
-
currentRouteOptions: props.routeInfo
|
|
1621
|
+
currentRouteOptions: (_c = props.routeInfo) === null || _c === void 0 ? void 0 : _c.routeOptions,
|
|
1634
1622
|
};
|
|
1635
1623
|
if (props.routeInfo.routeAction === 'pop' && activeTab !== prevActiveTab) {
|
|
1636
1624
|
// If navigating back and the tabs change, set the prev tab back to its original href
|
|
@@ -1650,9 +1638,10 @@ class IonTabBarUnwrapped extends React.PureComponent {
|
|
|
1650
1638
|
};
|
|
1651
1639
|
}
|
|
1652
1640
|
onTabButtonClick(e, onClickFn) {
|
|
1641
|
+
var _a;
|
|
1653
1642
|
const tappedTab = this.state.tabs[e.detail.tab];
|
|
1654
1643
|
const originalHref = tappedTab.originalHref;
|
|
1655
|
-
const hasRouterOutlet = this.props.tabsContext
|
|
1644
|
+
const hasRouterOutlet = (_a = this.props.tabsContext) === null || _a === void 0 ? void 0 : _a.hasRouterOutlet;
|
|
1656
1645
|
/**
|
|
1657
1646
|
* If the router outlet is not defined, then the tabs is being used
|
|
1658
1647
|
* as a basic tab navigation without the router. In this case, we
|
|
@@ -1689,12 +1678,13 @@ class IonTabBarUnwrapped extends React.PureComponent {
|
|
|
1689
1678
|
}
|
|
1690
1679
|
renderTabButton(activeTab) {
|
|
1691
1680
|
return (child) => {
|
|
1681
|
+
var _a, _b;
|
|
1692
1682
|
if (child != null && child.props && (child.type === IonTabButton || child.type.isTabButton)) {
|
|
1693
1683
|
const href = child.props.tab === activeTab
|
|
1694
|
-
? this.props.routeInfo
|
|
1684
|
+
? (_a = this.props.routeInfo) === null || _a === void 0 ? void 0 : _a.pathname
|
|
1695
1685
|
: this.state.tabs[child.props.tab].currentHref;
|
|
1696
1686
|
const routeOptions = child.props.tab === activeTab
|
|
1697
|
-
? this.props.routeInfo
|
|
1687
|
+
? (_b = this.props.routeInfo) === null || _b === void 0 ? void 0 : _b.routeOptions
|
|
1698
1688
|
: this.state.tabs[child.props.tab].currentRouteOptions;
|
|
1699
1689
|
return React.cloneElement(child, {
|
|
1700
1690
|
href,
|
|
@@ -1707,35 +1697,30 @@ class IonTabBarUnwrapped extends React.PureComponent {
|
|
|
1707
1697
|
}
|
|
1708
1698
|
render() {
|
|
1709
1699
|
const { activeTab } = this.state;
|
|
1710
|
-
return (
|
|
1700
|
+
return (React.createElement(IonTabBarInner, Object.assign({}, this.props, { selectedTab: activeTab }), React.Children.map(this.props.children, this.renderTabButton(activeTab))));
|
|
1711
1701
|
}
|
|
1712
1702
|
static get contextType() {
|
|
1713
1703
|
return NavContext;
|
|
1714
1704
|
}
|
|
1715
1705
|
}
|
|
1716
|
-
const IonTabBarContainer = React.memo((
|
|
1706
|
+
const IonTabBarContainer = React.memo((_a) => {
|
|
1707
|
+
var { forwardedRef } = _a, props = __rest(_a, ["forwardedRef"]);
|
|
1717
1708
|
const context = useContext(NavContext);
|
|
1718
1709
|
const tabsContext = useContext(IonTabsContext);
|
|
1719
1710
|
const tabBarRef = forwardedRef || tabsContext.tabBarProps.ref;
|
|
1720
|
-
const updatedTabBarProps = {
|
|
1721
|
-
|
|
1722
|
-
ref: tabBarRef,
|
|
1723
|
-
};
|
|
1724
|
-
return (jsx(IonTabBarUnwrapped, { ref: tabBarRef, ...props, routeInfo: props.routeInfo || context.routeInfo || { pathname: window.location.pathname }, onSetCurrentTab: context.setCurrentTab,
|
|
1711
|
+
const updatedTabBarProps = Object.assign(Object.assign({}, tabsContext.tabBarProps), { ref: tabBarRef });
|
|
1712
|
+
return (React.createElement(IonTabBarUnwrapped, Object.assign({ ref: tabBarRef }, props, { routeInfo: props.routeInfo || context.routeInfo || { pathname: window.location.pathname }, onSetCurrentTab: context.setCurrentTab,
|
|
1725
1713
|
/**
|
|
1726
1714
|
* Tab bar can be used as a standalone component,
|
|
1727
1715
|
* so it cannot be modified directly through
|
|
1728
1716
|
* IonTabs. Instead, props will be passed through
|
|
1729
1717
|
* the context.
|
|
1730
1718
|
*/
|
|
1731
|
-
tabsContext: {
|
|
1732
|
-
...tabsContext,
|
|
1733
|
-
tabBarProps: updatedTabBarProps,
|
|
1734
|
-
}, children: props.children }));
|
|
1719
|
+
tabsContext: Object.assign(Object.assign({}, tabsContext), { tabBarProps: updatedTabBarProps }) }), props.children));
|
|
1735
1720
|
});
|
|
1736
1721
|
const IonTabBar = createForwardRef(IonTabBarContainer, 'IonTabBar');
|
|
1737
1722
|
|
|
1738
|
-
|
|
1723
|
+
const IonBackButton = /*@__PURE__*/ (() => class extends React.Component {
|
|
1739
1724
|
constructor() {
|
|
1740
1725
|
super(...arguments);
|
|
1741
1726
|
this.clickButton = (e) => {
|
|
@@ -1758,7 +1743,7 @@ class IonBackButton extends React.Component {
|
|
|
1758
1743
|
};
|
|
1759
1744
|
}
|
|
1760
1745
|
render() {
|
|
1761
|
-
return
|
|
1746
|
+
return React.createElement(IonBackButtonInner, Object.assign({ onClick: this.clickButton }, this.props));
|
|
1762
1747
|
}
|
|
1763
1748
|
static get displayName() {
|
|
1764
1749
|
return 'IonBackButton';
|
|
@@ -1766,10 +1751,7 @@ class IonBackButton extends React.Component {
|
|
|
1766
1751
|
static get contextType() {
|
|
1767
1752
|
return NavContext;
|
|
1768
1753
|
}
|
|
1769
|
-
|
|
1770
|
-
return true;
|
|
1771
|
-
}
|
|
1772
|
-
}
|
|
1754
|
+
})();
|
|
1773
1755
|
|
|
1774
1756
|
class IonIconContainer extends React.PureComponent {
|
|
1775
1757
|
constructor(props) {
|
|
@@ -1779,22 +1761,23 @@ class IonIconContainer extends React.PureComponent {
|
|
|
1779
1761
|
}
|
|
1780
1762
|
}
|
|
1781
1763
|
render() {
|
|
1782
|
-
|
|
1764
|
+
var _a, _b;
|
|
1765
|
+
const _c = this.props, { icon, ios, md, mode } = _c, rest = __rest(_c, ["icon", "ios", "md", "mode"]);
|
|
1783
1766
|
let iconToUse;
|
|
1784
1767
|
const config = getConfig();
|
|
1785
|
-
const iconMode = mode || config
|
|
1768
|
+
const iconMode = mode || (config === null || config === void 0 ? void 0 : config.get('mode'));
|
|
1786
1769
|
if (ios || md) {
|
|
1787
1770
|
if (iconMode === 'ios') {
|
|
1788
|
-
iconToUse = ios
|
|
1771
|
+
iconToUse = (_a = ios !== null && ios !== void 0 ? ios : md) !== null && _a !== void 0 ? _a : icon;
|
|
1789
1772
|
}
|
|
1790
1773
|
else {
|
|
1791
|
-
iconToUse = md
|
|
1774
|
+
iconToUse = (_b = md !== null && md !== void 0 ? md : ios) !== null && _b !== void 0 ? _b : icon;
|
|
1792
1775
|
}
|
|
1793
1776
|
}
|
|
1794
1777
|
else {
|
|
1795
1778
|
iconToUse = icon;
|
|
1796
1779
|
}
|
|
1797
|
-
return (
|
|
1780
|
+
return (React.createElement(IonIconInner, Object.assign({ ref: this.props.forwardedRef, icon: iconToUse }, rest), this.props.children));
|
|
1798
1781
|
}
|
|
1799
1782
|
static get contextType() {
|
|
1800
1783
|
return NavContext;
|
|
@@ -1809,7 +1792,7 @@ class IonRoute extends React.PureComponent {
|
|
|
1809
1792
|
console.error('You either do not have an Ionic Router package, or your router does not support using <IonRoute>');
|
|
1810
1793
|
return null;
|
|
1811
1794
|
}
|
|
1812
|
-
return
|
|
1795
|
+
return React.createElement(IonRouteInner, Object.assign({}, this.props));
|
|
1813
1796
|
}
|
|
1814
1797
|
static get contextType() {
|
|
1815
1798
|
return NavContext;
|
|
@@ -1823,7 +1806,7 @@ class IonRedirect extends React.PureComponent {
|
|
|
1823
1806
|
console.error('You either do not have an Ionic Router package, or your router does not support using <IonRedirect>');
|
|
1824
1807
|
return null;
|
|
1825
1808
|
}
|
|
1826
|
-
return
|
|
1809
|
+
return React.createElement(IonRedirectInner, Object.assign({}, this.props));
|
|
1827
1810
|
}
|
|
1828
1811
|
static get contextType() {
|
|
1829
1812
|
return NavContext;
|
|
@@ -1886,7 +1869,7 @@ class CreateAnimation extends React.PureComponent {
|
|
|
1886
1869
|
}
|
|
1887
1870
|
render() {
|
|
1888
1871
|
const { children } = this.props;
|
|
1889
|
-
return (
|
|
1872
|
+
return (React.createElement(React.Fragment, null, React.Children.map(children, (child, id) => React.cloneElement(child, { ref: (el) => this.nodes.set(id, el) }))));
|
|
1890
1873
|
}
|
|
1891
1874
|
}
|
|
1892
1875
|
const checkConfig = (animation, currentProps = {}, prevProps = {}) => {
|
|
@@ -1935,19 +1918,20 @@ const checkConfig = (animation, currentProps = {}, prevProps = {}) => {
|
|
|
1935
1918
|
}
|
|
1936
1919
|
};
|
|
1937
1920
|
const checkProgress = (animation, currentProps = {}, prevProps = {}) => {
|
|
1921
|
+
var _a, _b, _c, _d, _e;
|
|
1938
1922
|
const { progressStart, progressStep, progressEnd } = currentProps;
|
|
1939
1923
|
if (progressStart &&
|
|
1940
|
-
(prevProps.progressStart
|
|
1941
|
-
prevProps.progressStart
|
|
1924
|
+
(((_a = prevProps.progressStart) === null || _a === void 0 ? void 0 : _a.forceLinearEasing) !== (progressStart === null || progressStart === void 0 ? void 0 : progressStart.forceLinearEasing) ||
|
|
1925
|
+
((_b = prevProps.progressStart) === null || _b === void 0 ? void 0 : _b.step) !== (progressStart === null || progressStart === void 0 ? void 0 : progressStart.step))) {
|
|
1942
1926
|
animation.progressStart(progressStart.forceLinearEasing, progressStart.step);
|
|
1943
1927
|
}
|
|
1944
|
-
if (progressStep && prevProps.progressStep
|
|
1928
|
+
if (progressStep && ((_c = prevProps.progressStep) === null || _c === void 0 ? void 0 : _c.step) !== (progressStep === null || progressStep === void 0 ? void 0 : progressStep.step)) {
|
|
1945
1929
|
animation.progressStep(progressStep.step);
|
|
1946
1930
|
}
|
|
1947
1931
|
if (progressEnd &&
|
|
1948
|
-
(prevProps.progressEnd
|
|
1949
|
-
prevProps.progressEnd
|
|
1950
|
-
prevProps
|
|
1932
|
+
(((_d = prevProps.progressEnd) === null || _d === void 0 ? void 0 : _d.playTo) !== (progressEnd === null || progressEnd === void 0 ? void 0 : progressEnd.playTo) ||
|
|
1933
|
+
((_e = prevProps.progressEnd) === null || _e === void 0 ? void 0 : _e.step) !== (progressEnd === null || progressEnd === void 0 ? void 0 : progressEnd.step) ||
|
|
1934
|
+
(prevProps === null || prevProps === void 0 ? void 0 : prevProps.dur) !== (progressEnd === null || progressEnd === void 0 ? void 0 : progressEnd.dur))) {
|
|
1951
1935
|
animation.progressEnd(progressEnd.playTo, progressEnd.step, progressEnd.dur);
|
|
1952
1936
|
}
|
|
1953
1937
|
};
|
|
@@ -1977,16 +1961,14 @@ function useController(displayName, controller, defineCustomElement) {
|
|
|
1977
1961
|
if (overlayRef.current) {
|
|
1978
1962
|
return;
|
|
1979
1963
|
}
|
|
1980
|
-
const { onDidDismiss, onWillDismiss, onDidPresent, onWillPresent,
|
|
1964
|
+
const { onDidDismiss, onWillDismiss, onDidPresent, onWillPresent } = options, rest = __rest(options, ["onDidDismiss", "onWillDismiss", "onDidPresent", "onWillPresent"]);
|
|
1981
1965
|
const handleDismiss = (event) => {
|
|
1982
1966
|
if (onDidDismiss) {
|
|
1983
1967
|
onDidDismiss(event);
|
|
1984
1968
|
}
|
|
1985
1969
|
overlayRef.current = undefined;
|
|
1986
1970
|
};
|
|
1987
|
-
overlayRef.current = await controller.create({
|
|
1988
|
-
...rest,
|
|
1989
|
-
});
|
|
1971
|
+
overlayRef.current = await controller.create(Object.assign({}, rest));
|
|
1990
1972
|
attachProps(overlayRef.current, {
|
|
1991
1973
|
[didDismissEventName]: handleDismiss,
|
|
1992
1974
|
[didPresentEventName]: (e) => onDidPresent && onDidPresent(e),
|
|
@@ -2035,7 +2017,7 @@ function useIonAlert() {
|
|
|
2035
2017
|
if (typeof messageOrOptions === 'string') {
|
|
2036
2018
|
return controller.present({
|
|
2037
2019
|
message: messageOrOptions,
|
|
2038
|
-
buttons: buttons
|
|
2020
|
+
buttons: buttons !== null && buttons !== void 0 ? buttons : [{ text: 'Ok' }],
|
|
2039
2021
|
});
|
|
2040
2022
|
}
|
|
2041
2023
|
else {
|
|
@@ -2091,14 +2073,11 @@ function useOverlay(displayName, controller, defineCustomElement, component, com
|
|
|
2091
2073
|
if (overlayRef.current) {
|
|
2092
2074
|
return;
|
|
2093
2075
|
}
|
|
2094
|
-
const { onDidDismiss, onWillDismiss, onDidPresent, onWillPresent,
|
|
2076
|
+
const { onDidDismiss, onWillDismiss, onDidPresent, onWillPresent } = options, rest = __rest(options, ["onDidDismiss", "onWillDismiss", "onDidPresent", "onWillPresent"]);
|
|
2095
2077
|
if (typeof document !== 'undefined') {
|
|
2096
2078
|
containerElRef.current = document.createElement('div');
|
|
2097
2079
|
}
|
|
2098
|
-
overlayRef.current = await controller.create({
|
|
2099
|
-
...rest,
|
|
2100
|
-
component: containerElRef.current,
|
|
2101
|
-
});
|
|
2080
|
+
overlayRef.current = await controller.create(Object.assign(Object.assign({}, rest), { component: containerElRef.current }));
|
|
2102
2081
|
attachProps(overlayRef.current, {
|
|
2103
2082
|
[didDismissEventName]: handleDismiss,
|
|
2104
2083
|
[didPresentEventName]: (e) => onDidPresent && onDidPresent(e),
|
|
@@ -2169,7 +2148,7 @@ function useIonPicker() {
|
|
|
2169
2148
|
if (Array.isArray(columnsOrOptions)) {
|
|
2170
2149
|
return controller.present({
|
|
2171
2150
|
columns: columnsOrOptions,
|
|
2172
|
-
buttons: buttons
|
|
2151
|
+
buttons: buttons !== null && buttons !== void 0 ? buttons : [{ text: 'Ok' }],
|
|
2173
2152
|
});
|
|
2174
2153
|
}
|
|
2175
2154
|
else {
|
|
@@ -2211,9 +2190,7 @@ const setupIonicReact = (config = {}) => {
|
|
|
2211
2190
|
if (typeof document !== 'undefined') {
|
|
2212
2191
|
document.documentElement.classList.add('ion-ce');
|
|
2213
2192
|
}
|
|
2214
|
-
initialize({
|
|
2215
|
-
...config,
|
|
2216
|
-
});
|
|
2193
|
+
initialize(Object.assign({}, config));
|
|
2217
2194
|
};
|
|
2218
2195
|
|
|
2219
2196
|
// TODO(FW-2959): types
|
|
@@ -2256,7 +2233,7 @@ class ViewLifeCycleManager extends React.Component {
|
|
|
2256
2233
|
}
|
|
2257
2234
|
render() {
|
|
2258
2235
|
const { show } = this.state;
|
|
2259
|
-
return (
|
|
2236
|
+
return (React.createElement(IonLifeCycleContext.Provider, { value: this.ionLifeCycleContext }, show && this.props.children));
|
|
2260
2237
|
}
|
|
2261
2238
|
}
|
|
2262
2239
|
|
|
@@ -2476,7 +2453,8 @@ class NavManager extends React.PureComponent {
|
|
|
2476
2453
|
return this.props.stackManager;
|
|
2477
2454
|
}
|
|
2478
2455
|
render() {
|
|
2479
|
-
return (
|
|
2456
|
+
return (React.createElement(NavContext.Provider, { value: Object.assign(Object.assign({}, this.state), { routeInfo: this.props.routeInfo }) },
|
|
2457
|
+
React.createElement(IonRouterContext.Provider, { value: Object.assign(Object.assign({}, this.ionRouterContextValue), { routeInfo: this.props.routeInfo }) }, this.props.children)));
|
|
2480
2458
|
}
|
|
2481
2459
|
}
|
|
2482
2460
|
|