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