@amazon-devices/react-navigation__routers 7.0.9000000000 → 8.0.9000000000-rn-83
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/SystemBundles/b6cc62e27d70be8722b0e7aef9fd04a870d49127e6c724fe934d1f8ca4ff8177.bundle +1298 -0
- package/SystemBundles/b6cc62e27d70be8722b0e7aef9fd04a870d49127e6c724fe934d1f8ca4ff8177.map +373 -0
- package/SystemModules/amzn__react-navigation__routers-8.modules.txt +9 -0
- package/SystemModules/amzn__react-navigation__routers-8.private.modules.txt +1 -0
- package/SystemModules/keplerscript-system-bundle-config.json +4 -4
- package/kepler-compatibility.json +2 -2
- package/lib/module/BaseRouter.js +6 -4
- package/lib/module/BaseRouter.js.map +1 -1
- package/lib/module/CommonActions.js +48 -7
- package/lib/module/CommonActions.js.map +1 -1
- package/lib/module/DrawerRouter.js +6 -6
- package/lib/module/DrawerRouter.js.map +1 -1
- package/lib/module/StackRouter.js +261 -80
- package/lib/module/StackRouter.js.map +1 -1
- package/lib/module/TabRouter.js +117 -34
- package/lib/module/TabRouter.js.map +1 -1
- package/lib/module/createParamsFromAction.js +16 -0
- package/lib/module/createParamsFromAction.js.map +1 -0
- package/lib/module/createRouteFromAction.js +21 -0
- package/lib/module/createRouteFromAction.js.map +1 -0
- package/lib/module/index.js +8 -6
- package/lib/module/index.js.map +1 -1
- package/lib/module/package.json +1 -0
- package/lib/module/types.js +2 -0
- package/lib/module/types.js.map +1 -1
- package/lib/typescript/package.json +1 -0
- package/lib/typescript/src/BaseRouter.d.ts +23 -20
- package/lib/typescript/src/BaseRouter.d.ts.map +1 -1
- package/lib/typescript/src/CommonActions.d.ts +66 -18
- package/lib/typescript/src/CommonActions.d.ts.map +1 -1
- package/lib/typescript/src/DrawerRouter.d.ts +18 -6
- package/lib/typescript/src/DrawerRouter.d.ts.map +1 -1
- package/lib/typescript/src/StackRouter.d.ts +73 -11
- package/lib/typescript/src/StackRouter.d.ts.map +1 -1
- package/lib/typescript/src/TabRouter.d.ts +24 -4
- package/lib/typescript/src/TabRouter.d.ts.map +1 -1
- package/lib/typescript/src/createParamsFromAction.d.ts +13 -0
- package/lib/typescript/src/createParamsFromAction.d.ts.map +1 -0
- package/lib/typescript/src/createRouteFromAction.d.ts +17 -0
- package/lib/typescript/src/createRouteFromAction.d.ts.map +1 -0
- package/lib/typescript/src/index.d.ts +4 -4
- package/lib/typescript/src/index.d.ts.map +1 -1
- package/lib/typescript/src/types.d.ts +1 -2
- package/lib/typescript/src/types.d.ts.map +1 -1
- package/oss-attribution/attribution.txt +0 -0
- package/oss-attribution/licenseInfos.json +1 -0
- package/package.json +80 -1
- package/src/BaseRouter.tsx +11 -6
- package/src/CommonActions.tsx +147 -56
- package/src/DrawerRouter.tsx +15 -13
- package/src/StackRouter.tsx +437 -199
- package/src/TabRouter.tsx +192 -53
- package/src/createParamsFromAction.tsx +22 -0
- package/src/createRouteFromAction.tsx +24 -0
- package/src/index.tsx +4 -4
- package/src/types.tsx +5 -5
- package/SystemBundles/b274ab157641de9520fe27a8e8049450e176a8ce2fedd3283fcb46c038bc6247.bundle +0 -3497
- package/SystemBundles/b274ab157641de9520fe27a8e8049450e176a8ce2fedd3283fcb46c038bc6247.map +0 -987
- package/SystemModules/amzn__react-navigation__routers-7.modules.txt +0 -21
- package/SystemModules/amzn__react-navigation__routers-7.private.modules.txt +0 -12
- package/THIRD_PARTY_NOTICES.txt +0 -24
- package/lib/commonjs/BaseRouter.js +0 -61
- package/lib/commonjs/BaseRouter.js.map +0 -1
- package/lib/commonjs/CommonActions.js +0 -53
- package/lib/commonjs/CommonActions.js.map +0 -1
- package/lib/commonjs/DrawerRouter.js +0 -154
- package/lib/commonjs/DrawerRouter.js.map +0 -1
- package/lib/commonjs/StackRouter.js +0 -310
- package/lib/commonjs/StackRouter.js.map +0 -1
- package/lib/commonjs/TabRouter.js +0 -253
- package/lib/commonjs/TabRouter.js.map +0 -1
- package/lib/commonjs/index.js +0 -80
- package/lib/commonjs/index.js.map +0 -1
- package/lib/commonjs/types.js +0 -6
- package/lib/commonjs/types.js.map +0 -1
package/SystemBundles/b274ab157641de9520fe27a8e8049450e176a8ce2fedd3283fcb46c038bc6247.bundle
DELETED
|
@@ -1,3497 +0,0 @@
|
|
|
1
|
-
var __BUNDLE_START_TIME__=this.nativePerformanceNow?nativePerformanceNow():Date.now(),__DEV__=false,process=this.process||{},__METRO_GLOBAL_PREFIX__='';process.env=process.env||{};process.env.NODE_ENV=process.env.NODE_ENV||"production";
|
|
2
|
-
(function (global) {
|
|
3
|
-
/**
|
|
4
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
5
|
-
*
|
|
6
|
-
* This source code is licensed under the MIT license found in the
|
|
7
|
-
* LICENSE file in the root directory of this source tree.
|
|
8
|
-
*
|
|
9
|
-
* @format
|
|
10
|
-
*
|
|
11
|
-
* @nolint
|
|
12
|
-
* @polyfill
|
|
13
|
-
*/
|
|
14
|
-
|
|
15
|
-
'use client';
|
|
16
|
-
|
|
17
|
-
/* eslint-disable no-shadow, eqeqeq, no-unused-vars, no-control-regex */
|
|
18
|
-
|
|
19
|
-
/**
|
|
20
|
-
* This pipes all of our console logging functions to native logging so that
|
|
21
|
-
* JavaScript errors in required modules show up in Xcode via NSLog.
|
|
22
|
-
*/
|
|
23
|
-
var inspect = function () {
|
|
24
|
-
// Copyright Joyent, Inc. and other Node contributors.
|
|
25
|
-
//
|
|
26
|
-
// Permission is hereby granted, free of charge, to any person obtaining a
|
|
27
|
-
// copy of this software and associated documentation files (the
|
|
28
|
-
// "Software"), to deal in the Software without restriction, including
|
|
29
|
-
// without limitation the rights to use, copy, modify, merge, publish,
|
|
30
|
-
// distribute, sublicense, and/or sell copies of the Software, and to permit
|
|
31
|
-
// persons to whom the Software is furnished to do so, subject to the
|
|
32
|
-
// following conditions:
|
|
33
|
-
//
|
|
34
|
-
// The above copyright notice and this permission notice shall be included
|
|
35
|
-
// in all copies or substantial portions of the Software.
|
|
36
|
-
//
|
|
37
|
-
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
|
38
|
-
// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|
39
|
-
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
|
|
40
|
-
// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
|
|
41
|
-
// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
|
|
42
|
-
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
|
|
43
|
-
// USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
44
|
-
//
|
|
45
|
-
// https://github.com/joyent/node/blob/master/lib/util.js
|
|
46
|
-
|
|
47
|
-
function inspect(obj, opts) {
|
|
48
|
-
var ctx = {
|
|
49
|
-
seen: [],
|
|
50
|
-
formatValueCalls: 0,
|
|
51
|
-
stylize: stylizeNoColor
|
|
52
|
-
};
|
|
53
|
-
return formatValue(ctx, obj, opts.depth);
|
|
54
|
-
}
|
|
55
|
-
function stylizeNoColor(str, styleType) {
|
|
56
|
-
return str;
|
|
57
|
-
}
|
|
58
|
-
function arrayToHash(array) {
|
|
59
|
-
var hash = {};
|
|
60
|
-
array.forEach(function (val, idx) {
|
|
61
|
-
hash[val] = true;
|
|
62
|
-
});
|
|
63
|
-
return hash;
|
|
64
|
-
}
|
|
65
|
-
function formatValue(ctx, value, recurseTimes) {
|
|
66
|
-
ctx.formatValueCalls++;
|
|
67
|
-
if (ctx.formatValueCalls > 200) {
|
|
68
|
-
return `[TOO BIG formatValueCalls ${ctx.formatValueCalls} exceeded limit of 200]`;
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
// Primitive types cannot have properties
|
|
72
|
-
var primitive = formatPrimitive(ctx, value);
|
|
73
|
-
if (primitive) {
|
|
74
|
-
return primitive;
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
// Look up the keys of the object.
|
|
78
|
-
var keys = Object.keys(value);
|
|
79
|
-
var visibleKeys = arrayToHash(keys);
|
|
80
|
-
|
|
81
|
-
// IE doesn't make error fields non-enumerable
|
|
82
|
-
// http://msdn.microsoft.com/en-us/library/ie/dww52sbt(v=vs.94).aspx
|
|
83
|
-
if (isError(value) && (keys.indexOf('message') >= 0 || keys.indexOf('description') >= 0)) {
|
|
84
|
-
return formatError(value);
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
// Some type of object without properties can be shortcutted.
|
|
88
|
-
if (keys.length === 0) {
|
|
89
|
-
if (isFunction(value)) {
|
|
90
|
-
var name = value.name ? ': ' + value.name : '';
|
|
91
|
-
return ctx.stylize('[Function' + name + ']', 'special');
|
|
92
|
-
}
|
|
93
|
-
if (isRegExp(value)) {
|
|
94
|
-
return ctx.stylize(RegExp.prototype.toString.call(value), 'regexp');
|
|
95
|
-
}
|
|
96
|
-
if (isDate(value)) {
|
|
97
|
-
return ctx.stylize(Date.prototype.toString.call(value), 'date');
|
|
98
|
-
}
|
|
99
|
-
if (isError(value)) {
|
|
100
|
-
return formatError(value);
|
|
101
|
-
}
|
|
102
|
-
}
|
|
103
|
-
var base = '',
|
|
104
|
-
array = false,
|
|
105
|
-
braces = ['{', '}'];
|
|
106
|
-
|
|
107
|
-
// Make Array say that they are Array
|
|
108
|
-
if (isArray(value)) {
|
|
109
|
-
array = true;
|
|
110
|
-
braces = ['[', ']'];
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
// Make functions say that they are functions
|
|
114
|
-
if (isFunction(value)) {
|
|
115
|
-
var n = value.name ? ': ' + value.name : '';
|
|
116
|
-
base = ' [Function' + n + ']';
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
// Make RegExps say that they are RegExps
|
|
120
|
-
if (isRegExp(value)) {
|
|
121
|
-
base = ' ' + RegExp.prototype.toString.call(value);
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
// Make dates with properties first say the date
|
|
125
|
-
if (isDate(value)) {
|
|
126
|
-
base = ' ' + Date.prototype.toUTCString.call(value);
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
// Make error with message first say the error
|
|
130
|
-
if (isError(value)) {
|
|
131
|
-
base = ' ' + formatError(value);
|
|
132
|
-
}
|
|
133
|
-
if (keys.length === 0 && (!array || value.length == 0)) {
|
|
134
|
-
return braces[0] + base + braces[1];
|
|
135
|
-
}
|
|
136
|
-
if (recurseTimes < 0) {
|
|
137
|
-
if (isRegExp(value)) {
|
|
138
|
-
return ctx.stylize(RegExp.prototype.toString.call(value), 'regexp');
|
|
139
|
-
} else {
|
|
140
|
-
return ctx.stylize('[Object]', 'special');
|
|
141
|
-
}
|
|
142
|
-
}
|
|
143
|
-
ctx.seen.push(value);
|
|
144
|
-
var output;
|
|
145
|
-
if (array) {
|
|
146
|
-
output = formatArray(ctx, value, recurseTimes, visibleKeys, keys);
|
|
147
|
-
} else {
|
|
148
|
-
output = keys.map(function (key) {
|
|
149
|
-
return formatProperty(ctx, value, recurseTimes, visibleKeys, key, array);
|
|
150
|
-
});
|
|
151
|
-
}
|
|
152
|
-
ctx.seen.pop();
|
|
153
|
-
return reduceToSingleString(output, base, braces);
|
|
154
|
-
}
|
|
155
|
-
function formatPrimitive(ctx, value) {
|
|
156
|
-
if (isUndefined(value)) return ctx.stylize('undefined', 'undefined');
|
|
157
|
-
if (isString(value)) {
|
|
158
|
-
var simple = "'" + JSON.stringify(value).replace(/^"|"$/g, '').replace(/'/g, "\\'").replace(/\\"/g, '"') + "'";
|
|
159
|
-
return ctx.stylize(simple, 'string');
|
|
160
|
-
}
|
|
161
|
-
if (isNumber(value)) return ctx.stylize('' + value, 'number');
|
|
162
|
-
if (isBoolean(value)) return ctx.stylize('' + value, 'boolean');
|
|
163
|
-
// For some reason typeof null is "object", so special case here.
|
|
164
|
-
if (isNull(value)) return ctx.stylize('null', 'null');
|
|
165
|
-
}
|
|
166
|
-
function formatError(value) {
|
|
167
|
-
return '[' + Error.prototype.toString.call(value) + ']';
|
|
168
|
-
}
|
|
169
|
-
function formatArray(ctx, value, recurseTimes, visibleKeys, keys) {
|
|
170
|
-
var output = [];
|
|
171
|
-
for (var i = 0, l = value.length; i < l; ++i) {
|
|
172
|
-
if (hasOwnProperty(value, String(i))) {
|
|
173
|
-
output.push(formatProperty(ctx, value, recurseTimes, visibleKeys, String(i), true));
|
|
174
|
-
} else {
|
|
175
|
-
output.push('');
|
|
176
|
-
}
|
|
177
|
-
}
|
|
178
|
-
keys.forEach(function (key) {
|
|
179
|
-
if (!key.match(/^\d+$/)) {
|
|
180
|
-
output.push(formatProperty(ctx, value, recurseTimes, visibleKeys, key, true));
|
|
181
|
-
}
|
|
182
|
-
});
|
|
183
|
-
return output;
|
|
184
|
-
}
|
|
185
|
-
function formatProperty(ctx, value, recurseTimes, visibleKeys, key, array) {
|
|
186
|
-
var name, str, desc;
|
|
187
|
-
desc = Object.getOwnPropertyDescriptor(value, key) || {
|
|
188
|
-
value: value[key]
|
|
189
|
-
};
|
|
190
|
-
if (desc.get) {
|
|
191
|
-
if (desc.set) {
|
|
192
|
-
str = ctx.stylize('[Getter/Setter]', 'special');
|
|
193
|
-
} else {
|
|
194
|
-
str = ctx.stylize('[Getter]', 'special');
|
|
195
|
-
}
|
|
196
|
-
} else {
|
|
197
|
-
if (desc.set) {
|
|
198
|
-
str = ctx.stylize('[Setter]', 'special');
|
|
199
|
-
}
|
|
200
|
-
}
|
|
201
|
-
if (!hasOwnProperty(visibleKeys, key)) {
|
|
202
|
-
name = '[' + key + ']';
|
|
203
|
-
}
|
|
204
|
-
if (!str) {
|
|
205
|
-
if (ctx.seen.indexOf(desc.value) < 0) {
|
|
206
|
-
if (isNull(recurseTimes)) {
|
|
207
|
-
str = formatValue(ctx, desc.value, null);
|
|
208
|
-
} else {
|
|
209
|
-
str = formatValue(ctx, desc.value, recurseTimes - 1);
|
|
210
|
-
}
|
|
211
|
-
if (str.indexOf('\n') > -1) {
|
|
212
|
-
if (array) {
|
|
213
|
-
str = str.split('\n').map(function (line) {
|
|
214
|
-
return ' ' + line;
|
|
215
|
-
}).join('\n').slice(2);
|
|
216
|
-
} else {
|
|
217
|
-
str = '\n' + str.split('\n').map(function (line) {
|
|
218
|
-
return ' ' + line;
|
|
219
|
-
}).join('\n');
|
|
220
|
-
}
|
|
221
|
-
}
|
|
222
|
-
} else {
|
|
223
|
-
str = ctx.stylize('[Circular]', 'special');
|
|
224
|
-
}
|
|
225
|
-
}
|
|
226
|
-
if (isUndefined(name)) {
|
|
227
|
-
if (array && key.match(/^\d+$/)) {
|
|
228
|
-
return str;
|
|
229
|
-
}
|
|
230
|
-
name = JSON.stringify('' + key);
|
|
231
|
-
if (name.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)) {
|
|
232
|
-
name = name.slice(1, name.length - 1);
|
|
233
|
-
name = ctx.stylize(name, 'name');
|
|
234
|
-
} else {
|
|
235
|
-
name = name.replace(/'/g, "\\'").replace(/\\"/g, '"').replace(/(^"|"$)/g, "'");
|
|
236
|
-
name = ctx.stylize(name, 'string');
|
|
237
|
-
}
|
|
238
|
-
}
|
|
239
|
-
return name + ': ' + str;
|
|
240
|
-
}
|
|
241
|
-
function reduceToSingleString(output, base, braces) {
|
|
242
|
-
var numLinesEst = 0;
|
|
243
|
-
var length = output.reduce(function (prev, cur) {
|
|
244
|
-
numLinesEst++;
|
|
245
|
-
if (cur.indexOf('\n') >= 0) numLinesEst++;
|
|
246
|
-
return prev + cur.replace(/\u001b\[\d\d?m/g, '').length + 1;
|
|
247
|
-
}, 0);
|
|
248
|
-
if (length > 60) {
|
|
249
|
-
return braces[0] + (base === '' ? '' : base + '\n ') + ' ' + output.join(',\n ') + ' ' + braces[1];
|
|
250
|
-
}
|
|
251
|
-
return braces[0] + base + ' ' + output.join(', ') + ' ' + braces[1];
|
|
252
|
-
}
|
|
253
|
-
|
|
254
|
-
// NOTE: These type checking functions intentionally don't use `instanceof`
|
|
255
|
-
// because it is fragile and can be easily faked with `Object.create()`.
|
|
256
|
-
function isArray(ar) {
|
|
257
|
-
return Array.isArray(ar);
|
|
258
|
-
}
|
|
259
|
-
function isBoolean(arg) {
|
|
260
|
-
return typeof arg === 'boolean';
|
|
261
|
-
}
|
|
262
|
-
function isNull(arg) {
|
|
263
|
-
return arg === null;
|
|
264
|
-
}
|
|
265
|
-
function isNumber(arg) {
|
|
266
|
-
return typeof arg === 'number';
|
|
267
|
-
}
|
|
268
|
-
function isString(arg) {
|
|
269
|
-
return typeof arg === 'string';
|
|
270
|
-
}
|
|
271
|
-
function isUndefined(arg) {
|
|
272
|
-
return arg === undefined;
|
|
273
|
-
}
|
|
274
|
-
function isRegExp(re) {
|
|
275
|
-
return isObject(re) && objectToString(re) === '[object RegExp]';
|
|
276
|
-
}
|
|
277
|
-
function isObject(arg) {
|
|
278
|
-
return typeof arg === 'object' && arg !== null;
|
|
279
|
-
}
|
|
280
|
-
function isDate(d) {
|
|
281
|
-
return isObject(d) && objectToString(d) === '[object Date]';
|
|
282
|
-
}
|
|
283
|
-
function isError(e) {
|
|
284
|
-
return isObject(e) && (objectToString(e) === '[object Error]' || e instanceof Error);
|
|
285
|
-
}
|
|
286
|
-
function isFunction(arg) {
|
|
287
|
-
return typeof arg === 'function';
|
|
288
|
-
}
|
|
289
|
-
function objectToString(o) {
|
|
290
|
-
return Object.prototype.toString.call(o);
|
|
291
|
-
}
|
|
292
|
-
function hasOwnProperty(obj, prop) {
|
|
293
|
-
return Object.prototype.hasOwnProperty.call(obj, prop);
|
|
294
|
-
}
|
|
295
|
-
return inspect;
|
|
296
|
-
}();
|
|
297
|
-
var INDEX_COLUMN_NAME = '(index)';
|
|
298
|
-
var LOG_LEVELS = {
|
|
299
|
-
trace: 0,
|
|
300
|
-
info: 1,
|
|
301
|
-
warn: 2,
|
|
302
|
-
error: 3
|
|
303
|
-
};
|
|
304
|
-
function getNativeLogFunction(level) {
|
|
305
|
-
return function () {
|
|
306
|
-
var str;
|
|
307
|
-
if (arguments.length === 1 && typeof arguments[0] === 'string') {
|
|
308
|
-
str = arguments[0];
|
|
309
|
-
} else {
|
|
310
|
-
str = Array.prototype.map.call(arguments, function (arg) {
|
|
311
|
-
return inspect(arg, {
|
|
312
|
-
depth: 10
|
|
313
|
-
});
|
|
314
|
-
}).join(', ');
|
|
315
|
-
}
|
|
316
|
-
|
|
317
|
-
// TRICKY
|
|
318
|
-
// If more than one argument is provided, the code above collapses them all
|
|
319
|
-
// into a single formatted string. This transform wraps string arguments in
|
|
320
|
-
// single quotes (e.g. "foo" -> "'foo'") which then breaks the "Warning:"
|
|
321
|
-
// check below. So it's important that we look at the first argument, rather
|
|
322
|
-
// than the formatted argument string.
|
|
323
|
-
var firstArg = arguments[0];
|
|
324
|
-
var logLevel = level;
|
|
325
|
-
if (typeof firstArg === 'string' && firstArg.slice(0, 9) === 'Warning: ' && logLevel >= LOG_LEVELS.error) {
|
|
326
|
-
// React warnings use console.error so that a stack trace is shown,
|
|
327
|
-
// but we don't (currently) want these to show a redbox
|
|
328
|
-
// (Note: Logic duplicated in ExceptionsManager.js.)
|
|
329
|
-
logLevel = LOG_LEVELS.warn;
|
|
330
|
-
}
|
|
331
|
-
if (groupStack.length) {
|
|
332
|
-
str = groupFormat('', str);
|
|
333
|
-
}
|
|
334
|
-
global.nativeLoggingHook(str, logLevel);
|
|
335
|
-
};
|
|
336
|
-
}
|
|
337
|
-
function repeat(element, n) {
|
|
338
|
-
return Array.apply(null, Array(n)).map(function () {
|
|
339
|
-
return element;
|
|
340
|
-
});
|
|
341
|
-
}
|
|
342
|
-
function formatCellValue(cell, key) {
|
|
343
|
-
if (key === INDEX_COLUMN_NAME) {
|
|
344
|
-
return cell[key];
|
|
345
|
-
}
|
|
346
|
-
if (cell.hasOwnProperty(key)) {
|
|
347
|
-
var cellValue = cell[key];
|
|
348
|
-
switch (typeof cellValue) {
|
|
349
|
-
case 'function':
|
|
350
|
-
return 'ƒ';
|
|
351
|
-
case 'string':
|
|
352
|
-
return "'" + cellValue + "'";
|
|
353
|
-
case 'object':
|
|
354
|
-
return cellValue == null ? 'null' : '{…}';
|
|
355
|
-
}
|
|
356
|
-
return String(cellValue);
|
|
357
|
-
}
|
|
358
|
-
return '';
|
|
359
|
-
}
|
|
360
|
-
function consoleTablePolyfill(data, columns) {
|
|
361
|
-
var rows;
|
|
362
|
-
|
|
363
|
-
// convert object -> array
|
|
364
|
-
if (Array.isArray(data)) {
|
|
365
|
-
rows = data.map(function (row, index) {
|
|
366
|
-
var processedRow = {};
|
|
367
|
-
processedRow[INDEX_COLUMN_NAME] = String(index);
|
|
368
|
-
Object.assign(processedRow, row);
|
|
369
|
-
return processedRow;
|
|
370
|
-
});
|
|
371
|
-
} else {
|
|
372
|
-
rows = [];
|
|
373
|
-
for (var key in data) {
|
|
374
|
-
if (data.hasOwnProperty(key)) {
|
|
375
|
-
var processedRow = {};
|
|
376
|
-
processedRow[INDEX_COLUMN_NAME] = key;
|
|
377
|
-
Object.assign(processedRow, data[key]);
|
|
378
|
-
rows.push(processedRow);
|
|
379
|
-
}
|
|
380
|
-
}
|
|
381
|
-
}
|
|
382
|
-
if (rows.length === 0) {
|
|
383
|
-
global.nativeLoggingHook('', LOG_LEVELS.info);
|
|
384
|
-
return;
|
|
385
|
-
}
|
|
386
|
-
if (Array.isArray(columns)) {
|
|
387
|
-
columns = [INDEX_COLUMN_NAME].concat(columns);
|
|
388
|
-
} else {
|
|
389
|
-
columns = Array.from(rows.reduce(function (columnSet, row) {
|
|
390
|
-
Object.keys(row).forEach(function (key) {
|
|
391
|
-
return columnSet.add(key);
|
|
392
|
-
});
|
|
393
|
-
return columnSet;
|
|
394
|
-
}, new Set()));
|
|
395
|
-
}
|
|
396
|
-
var stringRows = [];
|
|
397
|
-
var columnWidths = [];
|
|
398
|
-
|
|
399
|
-
// Convert each cell to a string. Also
|
|
400
|
-
// figure out max cell width for each column
|
|
401
|
-
columns.forEach(function (k, i) {
|
|
402
|
-
columnWidths[i] = k.length;
|
|
403
|
-
for (var j = 0; j < rows.length; j++) {
|
|
404
|
-
var cellStr = formatCellValue(rows[j], k);
|
|
405
|
-
stringRows[j] = stringRows[j] || [];
|
|
406
|
-
stringRows[j][i] = cellStr;
|
|
407
|
-
columnWidths[i] = Math.max(columnWidths[i], cellStr.length);
|
|
408
|
-
}
|
|
409
|
-
});
|
|
410
|
-
|
|
411
|
-
// Join all elements in the row into a single string with | separators
|
|
412
|
-
// (appends extra spaces to each cell to make separators | aligned)
|
|
413
|
-
function joinRow(row, space) {
|
|
414
|
-
var cells = row.map(function (cell, i) {
|
|
415
|
-
var extraSpaces = repeat(' ', columnWidths[i] - cell.length).join('');
|
|
416
|
-
return cell + extraSpaces;
|
|
417
|
-
});
|
|
418
|
-
space = space || ' ';
|
|
419
|
-
return '| ' + cells.join(space + '|' + space) + ' |';
|
|
420
|
-
}
|
|
421
|
-
var separators = columnWidths.map(function (columnWidth) {
|
|
422
|
-
return repeat('-', columnWidth).join('');
|
|
423
|
-
});
|
|
424
|
-
var separatorRow = joinRow(separators);
|
|
425
|
-
var header = joinRow(columns);
|
|
426
|
-
var table = [header, separatorRow];
|
|
427
|
-
for (var i = 0; i < rows.length; i++) {
|
|
428
|
-
table.push(joinRow(stringRows[i]));
|
|
429
|
-
}
|
|
430
|
-
|
|
431
|
-
// Notice extra empty line at the beginning.
|
|
432
|
-
// Native logging hook adds "RCTLog >" at the front of every
|
|
433
|
-
// logged string, which would shift the header and screw up
|
|
434
|
-
// the table
|
|
435
|
-
global.nativeLoggingHook('\n' + table.join('\n'), LOG_LEVELS.info);
|
|
436
|
-
}
|
|
437
|
-
var GROUP_PAD = "\u2502"; // Box light vertical
|
|
438
|
-
var GROUP_OPEN = "\u2510"; // Box light down+left
|
|
439
|
-
var GROUP_CLOSE = "\u2518"; // Box light up+left
|
|
440
|
-
|
|
441
|
-
var groupStack = [];
|
|
442
|
-
function groupFormat(prefix, msg) {
|
|
443
|
-
// Insert group formatting before the console message
|
|
444
|
-
return groupStack.join('') + prefix + ' ' + (msg || '');
|
|
445
|
-
}
|
|
446
|
-
function consoleGroupPolyfill(label) {
|
|
447
|
-
global.nativeLoggingHook(groupFormat(GROUP_OPEN, label), LOG_LEVELS.info);
|
|
448
|
-
groupStack.push(GROUP_PAD);
|
|
449
|
-
}
|
|
450
|
-
function consoleGroupCollapsedPolyfill(label) {
|
|
451
|
-
global.nativeLoggingHook(groupFormat(GROUP_CLOSE, label), LOG_LEVELS.info);
|
|
452
|
-
groupStack.push(GROUP_PAD);
|
|
453
|
-
}
|
|
454
|
-
function consoleGroupEndPolyfill() {
|
|
455
|
-
groupStack.pop();
|
|
456
|
-
global.nativeLoggingHook(groupFormat(GROUP_CLOSE), LOG_LEVELS.info);
|
|
457
|
-
}
|
|
458
|
-
function consoleAssertPolyfill(expression, label) {
|
|
459
|
-
if (!expression) {
|
|
460
|
-
global.nativeLoggingHook('Assertion failed: ' + label, LOG_LEVELS.error);
|
|
461
|
-
}
|
|
462
|
-
}
|
|
463
|
-
function stub() {}
|
|
464
|
-
if (global.nativeLoggingHook) {
|
|
465
|
-
var originalConsole = global.console;
|
|
466
|
-
// Preserve the original `console` as `originalConsole`
|
|
467
|
-
|
|
468
|
-
global.console = Object.assign({
|
|
469
|
-
time: stub,
|
|
470
|
-
timeEnd: stub,
|
|
471
|
-
timeStamp: stub,
|
|
472
|
-
count: stub,
|
|
473
|
-
countReset: stub
|
|
474
|
-
}, originalConsole != null ? originalConsole : {}, {
|
|
475
|
-
error: getNativeLogFunction(LOG_LEVELS.error),
|
|
476
|
-
info: getNativeLogFunction(LOG_LEVELS.info),
|
|
477
|
-
log: getNativeLogFunction(LOG_LEVELS.info),
|
|
478
|
-
warn: getNativeLogFunction(LOG_LEVELS.warn),
|
|
479
|
-
trace: getNativeLogFunction(LOG_LEVELS.trace),
|
|
480
|
-
debug: getNativeLogFunction(LOG_LEVELS.trace),
|
|
481
|
-
table: consoleTablePolyfill,
|
|
482
|
-
group: consoleGroupPolyfill,
|
|
483
|
-
groupEnd: consoleGroupEndPolyfill,
|
|
484
|
-
groupCollapsed: consoleGroupCollapsedPolyfill,
|
|
485
|
-
assert: consoleAssertPolyfill
|
|
486
|
-
});
|
|
487
|
-
|
|
488
|
-
// TODO(T206796580): This was copy-pasted from ExceptionsManager.js
|
|
489
|
-
// Delete the copy there after the c++ pipeline is rolled out everywhere.
|
|
490
|
-
if (global.RN$useAlwaysAvailableJSErrorHandling === true) {
|
|
491
|
-
var stringifySafe = function stringifySafe(arg) {
|
|
492
|
-
return inspect(arg, {
|
|
493
|
-
depth: 10
|
|
494
|
-
}).replace(/\n\s*/g, ' ');
|
|
495
|
-
};
|
|
496
|
-
var originalConsoleError = console.error;
|
|
497
|
-
console.reportErrorsAsExceptions = true;
|
|
498
|
-
console.error = function () {
|
|
499
|
-
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
500
|
-
args[_key] = arguments[_key];
|
|
501
|
-
}
|
|
502
|
-
originalConsoleError.apply(this, args);
|
|
503
|
-
if (!console.reportErrorsAsExceptions) {
|
|
504
|
-
return;
|
|
505
|
-
}
|
|
506
|
-
if (global.RN$inExceptionHandler != null && global.RN$inExceptionHandler()) {
|
|
507
|
-
return;
|
|
508
|
-
}
|
|
509
|
-
var error;
|
|
510
|
-
var firstArg = args[0];
|
|
511
|
-
if (firstArg != null && firstArg.stack) {
|
|
512
|
-
// RN$handleException will console.error this with high enough fidelity.
|
|
513
|
-
error = firstArg;
|
|
514
|
-
} else {
|
|
515
|
-
if (typeof firstArg === 'string' && firstArg.startsWith('Warning: ')) {
|
|
516
|
-
// React warnings use console.error so that a stack trace is shown, but
|
|
517
|
-
// we don't (currently) want these to show a redbox
|
|
518
|
-
return;
|
|
519
|
-
}
|
|
520
|
-
var message = args.map(function (arg) {
|
|
521
|
-
return typeof arg === 'string' ? arg : stringifySafe(arg);
|
|
522
|
-
}).join(' ');
|
|
523
|
-
error = new Error(message);
|
|
524
|
-
error.name = 'console.error';
|
|
525
|
-
}
|
|
526
|
-
var isFatal = false;
|
|
527
|
-
var reportToConsole = false;
|
|
528
|
-
global.RN$handleException(error, isFatal, reportToConsole);
|
|
529
|
-
};
|
|
530
|
-
}
|
|
531
|
-
Object.defineProperty(console, '_isPolyfilled', {
|
|
532
|
-
value: true,
|
|
533
|
-
enumerable: false
|
|
534
|
-
});
|
|
535
|
-
|
|
536
|
-
// If available, also call the original `console` method since that is
|
|
537
|
-
// sometimes useful. Ex: on OS X, this will let you see rich output in
|
|
538
|
-
// the Safari Web Inspector console.
|
|
539
|
-
} else if (!global.console) {
|
|
540
|
-
var log = global.print || stub;
|
|
541
|
-
global.console = {
|
|
542
|
-
debug: log,
|
|
543
|
-
error: log,
|
|
544
|
-
info: log,
|
|
545
|
-
log: log,
|
|
546
|
-
trace: log,
|
|
547
|
-
warn: log,
|
|
548
|
-
assert: function assert(expression, label) {
|
|
549
|
-
if (!expression) {
|
|
550
|
-
log('Assertion failed: ' + label);
|
|
551
|
-
}
|
|
552
|
-
},
|
|
553
|
-
clear: stub,
|
|
554
|
-
count: stub,
|
|
555
|
-
countReset: stub,
|
|
556
|
-
dir: stub,
|
|
557
|
-
dirxml: stub,
|
|
558
|
-
group: stub,
|
|
559
|
-
groupCollapsed: stub,
|
|
560
|
-
groupEnd: stub,
|
|
561
|
-
profile: stub,
|
|
562
|
-
profileEnd: stub,
|
|
563
|
-
table: stub,
|
|
564
|
-
time: stub,
|
|
565
|
-
timeEnd: stub,
|
|
566
|
-
timeStamp: stub
|
|
567
|
-
};
|
|
568
|
-
Object.defineProperty(console, '_isPolyfilled', {
|
|
569
|
-
value: true,
|
|
570
|
-
enumerable: false
|
|
571
|
-
});
|
|
572
|
-
}
|
|
573
|
-
})(typeof globalThis !== 'undefined' ? globalThis : typeof global !== 'undefined' ? global : typeof window !== 'undefined' ? window : this);
|
|
574
|
-
(function (global) {
|
|
575
|
-
var _inGuard = 0;
|
|
576
|
-
var _globalHandler = global.RN$useAlwaysAvailableJSErrorHandling === true ? global.RN$handleException : function (e, isFatal) {
|
|
577
|
-
throw e;
|
|
578
|
-
};
|
|
579
|
-
var ErrorUtils = {
|
|
580
|
-
setGlobalHandler: function setGlobalHandler(fun) {
|
|
581
|
-
_globalHandler = fun;
|
|
582
|
-
},
|
|
583
|
-
getGlobalHandler: function getGlobalHandler() {
|
|
584
|
-
return _globalHandler;
|
|
585
|
-
},
|
|
586
|
-
reportError: function reportError(error) {
|
|
587
|
-
_globalHandler && _globalHandler(error, false);
|
|
588
|
-
},
|
|
589
|
-
reportFatalError: function reportFatalError(error) {
|
|
590
|
-
_globalHandler && _globalHandler(error, true);
|
|
591
|
-
},
|
|
592
|
-
applyWithGuard: function applyWithGuard(fun, context, args, unused_onError, unused_name) {
|
|
593
|
-
try {
|
|
594
|
-
_inGuard++;
|
|
595
|
-
return fun.apply(context, args);
|
|
596
|
-
} catch (e) {
|
|
597
|
-
ErrorUtils.reportError(e);
|
|
598
|
-
} finally {
|
|
599
|
-
_inGuard--;
|
|
600
|
-
}
|
|
601
|
-
return null;
|
|
602
|
-
},
|
|
603
|
-
applyWithGuardIfNeeded: function applyWithGuardIfNeeded(fun, context, args) {
|
|
604
|
-
if (ErrorUtils.inGuard()) {
|
|
605
|
-
return fun.apply(context, args);
|
|
606
|
-
} else {
|
|
607
|
-
ErrorUtils.applyWithGuard(fun, context, args);
|
|
608
|
-
}
|
|
609
|
-
return null;
|
|
610
|
-
},
|
|
611
|
-
inGuard: function inGuard() {
|
|
612
|
-
return !!_inGuard;
|
|
613
|
-
},
|
|
614
|
-
guard: function guard(fun, name, context) {
|
|
615
|
-
var _ref;
|
|
616
|
-
if (typeof fun !== 'function') {
|
|
617
|
-
console.warn('A function must be passed to ErrorUtils.guard, got ', fun);
|
|
618
|
-
return null;
|
|
619
|
-
}
|
|
620
|
-
var guardName = (_ref = name != null ? name : fun.name) != null ? _ref : '<generated guard>';
|
|
621
|
-
function guarded() {
|
|
622
|
-
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
623
|
-
args[_key] = arguments[_key];
|
|
624
|
-
}
|
|
625
|
-
return ErrorUtils.applyWithGuard(fun, context != null ? context : this, args, null, guardName);
|
|
626
|
-
}
|
|
627
|
-
return guarded;
|
|
628
|
-
}
|
|
629
|
-
};
|
|
630
|
-
global.ErrorUtils = ErrorUtils;
|
|
631
|
-
})(typeof globalThis !== 'undefined' ? globalThis : typeof global !== 'undefined' ? global : typeof window !== 'undefined' ? window : this);
|
|
632
|
-
__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) {
|
|
633
|
-
"use strict";
|
|
634
|
-
|
|
635
|
-
Object.defineProperty(exports, "__esModule", {
|
|
636
|
-
value: true
|
|
637
|
-
});
|
|
638
|
-
exports.default = undefined;
|
|
639
|
-
/**
|
|
640
|
-
* Base router object that can be used when writing custom routers.
|
|
641
|
-
* This provides few helper methods to handle common actions such as `RESET`.
|
|
642
|
-
*/
|
|
643
|
-
var BaseRouter = {
|
|
644
|
-
getStateForAction: function getStateForAction(state, action) {
|
|
645
|
-
switch (action.type) {
|
|
646
|
-
case 'SET_PARAMS':
|
|
647
|
-
{
|
|
648
|
-
var index = action.source ? state.routes.findIndex(function (r) {
|
|
649
|
-
return r.key === action.source;
|
|
650
|
-
}) : state.index;
|
|
651
|
-
if (index === -1) {
|
|
652
|
-
return null;
|
|
653
|
-
}
|
|
654
|
-
return Object.assign({}, state, {
|
|
655
|
-
routes: state.routes.map(function (r, i) {
|
|
656
|
-
return i === index ? Object.assign({}, r, {
|
|
657
|
-
params: Object.assign({}, r.params, action.payload.params)
|
|
658
|
-
}) : r;
|
|
659
|
-
})
|
|
660
|
-
});
|
|
661
|
-
}
|
|
662
|
-
case 'RESET':
|
|
663
|
-
{
|
|
664
|
-
var nextState = action.payload;
|
|
665
|
-
if (nextState.routes.length === 0 || nextState.routes.some(function (route) {
|
|
666
|
-
return !state.routeNames.includes(route.name);
|
|
667
|
-
})) {
|
|
668
|
-
return null;
|
|
669
|
-
}
|
|
670
|
-
if (nextState.stale === false) {
|
|
671
|
-
if (state.routeNames.length !== nextState.routeNames.length || nextState.routeNames.some(function (name) {
|
|
672
|
-
return !state.routeNames.includes(name);
|
|
673
|
-
})) {
|
|
674
|
-
return null;
|
|
675
|
-
}
|
|
676
|
-
return Object.assign({}, nextState, {
|
|
677
|
-
routes: nextState.routes.map(function (route) {
|
|
678
|
-
return route.key ? route : Object.assign({}, route, {
|
|
679
|
-
key: `${route.name}-${(0, _$$_REQUIRE(_dependencyMap[0]).nanoid)()}`
|
|
680
|
-
});
|
|
681
|
-
})
|
|
682
|
-
});
|
|
683
|
-
}
|
|
684
|
-
return nextState;
|
|
685
|
-
}
|
|
686
|
-
default:
|
|
687
|
-
return null;
|
|
688
|
-
}
|
|
689
|
-
},
|
|
690
|
-
shouldActionChangeFocus: function shouldActionChangeFocus(action) {
|
|
691
|
-
return action.type === 'NAVIGATE';
|
|
692
|
-
}
|
|
693
|
-
};
|
|
694
|
-
var _default = exports.default = BaseRouter;
|
|
695
|
-
},"4e814a93075c75141026",["e03db9aacb1ee503cd26"]);
|
|
696
|
-
__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) {
|
|
697
|
-
Object.defineProperty(exports, "__esModule", {
|
|
698
|
-
value: true
|
|
699
|
-
});
|
|
700
|
-
exports.nanoid = exports.customAlphabet = undefined;
|
|
701
|
-
// This alphabet uses `A-Za-z0-9_-` symbols. The genetic algorithm helped
|
|
702
|
-
// optimize the gzip compression for this alphabet.
|
|
703
|
-
var urlAlphabet = 'ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW';
|
|
704
|
-
var customAlphabet = exports.customAlphabet = function customAlphabet(alphabet, size) {
|
|
705
|
-
return function () {
|
|
706
|
-
var id = '';
|
|
707
|
-
// A compact alternative for `for (var i = 0; i < step; i++)`.
|
|
708
|
-
var i = size;
|
|
709
|
-
while (i--) {
|
|
710
|
-
// `| 0` is more compact and faster than `Math.floor()`.
|
|
711
|
-
id += alphabet[Math.random() * alphabet.length | 0];
|
|
712
|
-
}
|
|
713
|
-
return id;
|
|
714
|
-
};
|
|
715
|
-
};
|
|
716
|
-
var nanoid = exports.nanoid = function nanoid() {
|
|
717
|
-
var size = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 21;
|
|
718
|
-
var id = '';
|
|
719
|
-
// A compact alternative for `for (var i = 0; i < step; i++)`.
|
|
720
|
-
var i = size;
|
|
721
|
-
while (i--) {
|
|
722
|
-
// `| 0` is more compact and faster than `Math.floor()`.
|
|
723
|
-
id += urlAlphabet[Math.random() * 64 | 0];
|
|
724
|
-
}
|
|
725
|
-
return id;
|
|
726
|
-
};
|
|
727
|
-
},"e03db9aacb1ee503cd26",[]);
|
|
728
|
-
__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) {
|
|
729
|
-
"use strict";
|
|
730
|
-
|
|
731
|
-
Object.defineProperty(exports, "__esModule", {
|
|
732
|
-
value: true
|
|
733
|
-
});
|
|
734
|
-
exports.goBack = goBack;
|
|
735
|
-
exports.navigate = navigate;
|
|
736
|
-
exports.reset = reset;
|
|
737
|
-
exports.setParams = setParams;
|
|
738
|
-
function goBack() {
|
|
739
|
-
return {
|
|
740
|
-
type: 'GO_BACK'
|
|
741
|
-
};
|
|
742
|
-
}
|
|
743
|
-
|
|
744
|
-
// eslint-disable-next-line no-redeclare
|
|
745
|
-
|
|
746
|
-
// eslint-disable-next-line no-redeclare
|
|
747
|
-
function navigate() {
|
|
748
|
-
if (typeof (arguments.length <= 0 ? undefined : arguments[0]) === 'string') {
|
|
749
|
-
return {
|
|
750
|
-
type: 'NAVIGATE',
|
|
751
|
-
payload: {
|
|
752
|
-
name: arguments.length <= 0 ? undefined : arguments[0],
|
|
753
|
-
params: arguments.length <= 1 ? undefined : arguments[1]
|
|
754
|
-
}
|
|
755
|
-
};
|
|
756
|
-
} else {
|
|
757
|
-
var payload = (arguments.length <= 0 ? undefined : arguments[0]) || {};
|
|
758
|
-
if (!payload.hasOwnProperty('key') && !payload.hasOwnProperty('name')) {
|
|
759
|
-
throw new Error('You need to specify name or key when calling navigate with an object as the argument. See https://reactnavigation.org/docs/navigation-actions#navigate for usage.');
|
|
760
|
-
}
|
|
761
|
-
return {
|
|
762
|
-
type: 'NAVIGATE',
|
|
763
|
-
payload: payload
|
|
764
|
-
};
|
|
765
|
-
}
|
|
766
|
-
}
|
|
767
|
-
function reset(state) {
|
|
768
|
-
return {
|
|
769
|
-
type: 'RESET',
|
|
770
|
-
payload: state
|
|
771
|
-
};
|
|
772
|
-
}
|
|
773
|
-
function setParams(params) {
|
|
774
|
-
return {
|
|
775
|
-
type: 'SET_PARAMS',
|
|
776
|
-
payload: {
|
|
777
|
-
params: params
|
|
778
|
-
}
|
|
779
|
-
};
|
|
780
|
-
}
|
|
781
|
-
},"6224880bf3a3483be0e5",[]);
|
|
782
|
-
__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) {
|
|
783
|
-
"use strict";
|
|
784
|
-
|
|
785
|
-
var _excluded = ["defaultStatus"];
|
|
786
|
-
Object.defineProperty(exports, "__esModule", {
|
|
787
|
-
value: true
|
|
788
|
-
});
|
|
789
|
-
exports.DrawerActions = undefined;
|
|
790
|
-
exports.default = DrawerRouter;
|
|
791
|
-
var _TabRouter = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[0]));
|
|
792
|
-
function _getRequireWildcardCache(e) {
|
|
793
|
-
if ("function" != typeof WeakMap) return null;
|
|
794
|
-
var r = new WeakMap(),
|
|
795
|
-
t = new WeakMap();
|
|
796
|
-
return (_getRequireWildcardCache = function _getRequireWildcardCache(e) {
|
|
797
|
-
return e ? t : r;
|
|
798
|
-
})(e);
|
|
799
|
-
}
|
|
800
|
-
function _interopRequireWildcard(e, r) {
|
|
801
|
-
if (!r && e && e.__esModule) return e;
|
|
802
|
-
if (null === e || "object" != typeof e && "function" != typeof e) return {
|
|
803
|
-
default: e
|
|
804
|
-
};
|
|
805
|
-
var t = _getRequireWildcardCache(r);
|
|
806
|
-
if (t && t.has(e)) return t.get(e);
|
|
807
|
-
var n = {
|
|
808
|
-
__proto__: null
|
|
809
|
-
},
|
|
810
|
-
a = Object.defineProperty && Object.getOwnPropertyDescriptor;
|
|
811
|
-
for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) {
|
|
812
|
-
var i = a ? Object.getOwnPropertyDescriptor(e, u) : null;
|
|
813
|
-
i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u];
|
|
814
|
-
}
|
|
815
|
-
return n.default = e, t && t.set(e, n), n;
|
|
816
|
-
}
|
|
817
|
-
var DrawerActions = exports.DrawerActions = Object.assign({}, _TabRouter.TabActions, {
|
|
818
|
-
openDrawer: function openDrawer() {
|
|
819
|
-
return {
|
|
820
|
-
type: 'OPEN_DRAWER'
|
|
821
|
-
};
|
|
822
|
-
},
|
|
823
|
-
closeDrawer: function closeDrawer() {
|
|
824
|
-
return {
|
|
825
|
-
type: 'CLOSE_DRAWER'
|
|
826
|
-
};
|
|
827
|
-
},
|
|
828
|
-
toggleDrawer: function toggleDrawer() {
|
|
829
|
-
return {
|
|
830
|
-
type: 'TOGGLE_DRAWER'
|
|
831
|
-
};
|
|
832
|
-
}
|
|
833
|
-
});
|
|
834
|
-
function DrawerRouter(_ref) {
|
|
835
|
-
var _ref$defaultStatus = _ref.defaultStatus,
|
|
836
|
-
defaultStatus = _ref$defaultStatus === undefined ? 'closed' : _ref$defaultStatus,
|
|
837
|
-
rest = _$$_REQUIRE(_dependencyMap[1])(_ref, _excluded);
|
|
838
|
-
var router = (0, _TabRouter.default)(rest);
|
|
839
|
-
var isDrawerInHistory = function isDrawerInHistory(state) {
|
|
840
|
-
var _state$history;
|
|
841
|
-
return Boolean((_state$history = state.history) === null || _state$history === undefined ? undefined : _state$history.some(function (it) {
|
|
842
|
-
return it.type === 'drawer';
|
|
843
|
-
}));
|
|
844
|
-
};
|
|
845
|
-
var addDrawerToHistory = function addDrawerToHistory(state) {
|
|
846
|
-
if (isDrawerInHistory(state)) {
|
|
847
|
-
return state;
|
|
848
|
-
}
|
|
849
|
-
return Object.assign({}, state, {
|
|
850
|
-
history: [].concat(_$$_REQUIRE(_dependencyMap[2])(state.history), [{
|
|
851
|
-
type: 'drawer',
|
|
852
|
-
status: defaultStatus === 'open' ? 'closed' : 'open'
|
|
853
|
-
}])
|
|
854
|
-
});
|
|
855
|
-
};
|
|
856
|
-
var removeDrawerFromHistory = function removeDrawerFromHistory(state) {
|
|
857
|
-
if (!isDrawerInHistory(state)) {
|
|
858
|
-
return state;
|
|
859
|
-
}
|
|
860
|
-
return Object.assign({}, state, {
|
|
861
|
-
history: state.history.filter(function (it) {
|
|
862
|
-
return it.type !== 'drawer';
|
|
863
|
-
})
|
|
864
|
-
});
|
|
865
|
-
};
|
|
866
|
-
var openDrawer = function openDrawer(state) {
|
|
867
|
-
if (defaultStatus === 'open') {
|
|
868
|
-
return removeDrawerFromHistory(state);
|
|
869
|
-
}
|
|
870
|
-
return addDrawerToHistory(state);
|
|
871
|
-
};
|
|
872
|
-
var closeDrawer = function closeDrawer(state) {
|
|
873
|
-
if (defaultStatus === 'open') {
|
|
874
|
-
return addDrawerToHistory(state);
|
|
875
|
-
}
|
|
876
|
-
return removeDrawerFromHistory(state);
|
|
877
|
-
};
|
|
878
|
-
return Object.assign({}, router, {
|
|
879
|
-
type: 'drawer',
|
|
880
|
-
getInitialState: function getInitialState(_ref2) {
|
|
881
|
-
var routeNames = _ref2.routeNames,
|
|
882
|
-
routeParamList = _ref2.routeParamList,
|
|
883
|
-
routeGetIdList = _ref2.routeGetIdList;
|
|
884
|
-
var state = router.getInitialState({
|
|
885
|
-
routeNames: routeNames,
|
|
886
|
-
routeParamList: routeParamList,
|
|
887
|
-
routeGetIdList: routeGetIdList
|
|
888
|
-
});
|
|
889
|
-
return Object.assign({}, state, {
|
|
890
|
-
default: defaultStatus,
|
|
891
|
-
stale: false,
|
|
892
|
-
type: 'drawer',
|
|
893
|
-
key: `drawer-${(0, _$$_REQUIRE(_dependencyMap[3]).nanoid)()}`
|
|
894
|
-
});
|
|
895
|
-
},
|
|
896
|
-
getRehydratedState: function getRehydratedState(partialState, _ref3) {
|
|
897
|
-
var routeNames = _ref3.routeNames,
|
|
898
|
-
routeParamList = _ref3.routeParamList,
|
|
899
|
-
routeGetIdList = _ref3.routeGetIdList;
|
|
900
|
-
if (partialState.stale === false) {
|
|
901
|
-
return partialState;
|
|
902
|
-
}
|
|
903
|
-
var state = router.getRehydratedState(partialState, {
|
|
904
|
-
routeNames: routeNames,
|
|
905
|
-
routeParamList: routeParamList,
|
|
906
|
-
routeGetIdList: routeGetIdList
|
|
907
|
-
});
|
|
908
|
-
if (isDrawerInHistory(partialState)) {
|
|
909
|
-
// Re-sync the drawer entry in history to correct it if it was wrong
|
|
910
|
-
state = removeDrawerFromHistory(state);
|
|
911
|
-
state = addDrawerToHistory(state);
|
|
912
|
-
}
|
|
913
|
-
return Object.assign({}, state, {
|
|
914
|
-
default: defaultStatus,
|
|
915
|
-
type: 'drawer',
|
|
916
|
-
key: `drawer-${(0, _$$_REQUIRE(_dependencyMap[3]).nanoid)()}`
|
|
917
|
-
});
|
|
918
|
-
},
|
|
919
|
-
getStateForRouteFocus: function getStateForRouteFocus(state, key) {
|
|
920
|
-
var result = router.getStateForRouteFocus(state, key);
|
|
921
|
-
return closeDrawer(result);
|
|
922
|
-
},
|
|
923
|
-
getStateForAction: function getStateForAction(state, action, options) {
|
|
924
|
-
switch (action.type) {
|
|
925
|
-
case 'OPEN_DRAWER':
|
|
926
|
-
return openDrawer(state);
|
|
927
|
-
case 'CLOSE_DRAWER':
|
|
928
|
-
return closeDrawer(state);
|
|
929
|
-
case 'TOGGLE_DRAWER':
|
|
930
|
-
if (isDrawerInHistory(state)) {
|
|
931
|
-
return removeDrawerFromHistory(state);
|
|
932
|
-
}
|
|
933
|
-
return addDrawerToHistory(state);
|
|
934
|
-
case 'JUMP_TO':
|
|
935
|
-
case 'NAVIGATE':
|
|
936
|
-
{
|
|
937
|
-
var result = router.getStateForAction(state, action, options);
|
|
938
|
-
if (result != null && result.index !== state.index) {
|
|
939
|
-
return closeDrawer(result);
|
|
940
|
-
}
|
|
941
|
-
return result;
|
|
942
|
-
}
|
|
943
|
-
case 'GO_BACK':
|
|
944
|
-
if (isDrawerInHistory(state)) {
|
|
945
|
-
return removeDrawerFromHistory(state);
|
|
946
|
-
}
|
|
947
|
-
return router.getStateForAction(state, action, options);
|
|
948
|
-
default:
|
|
949
|
-
return router.getStateForAction(state, action, options);
|
|
950
|
-
}
|
|
951
|
-
},
|
|
952
|
-
actionCreators: DrawerActions
|
|
953
|
-
});
|
|
954
|
-
}
|
|
955
|
-
},"fbd71b33b1fab08b6b66",["c822e55e1302f6e881d8","a2c8e692f78bae5b8b98","838d7a057beeb5db50df","e03db9aacb1ee503cd26"]);
|
|
956
|
-
__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) {
|
|
957
|
-
"use strict";
|
|
958
|
-
|
|
959
|
-
Object.defineProperty(exports, "__esModule", {
|
|
960
|
-
value: true
|
|
961
|
-
});
|
|
962
|
-
exports.TabActions = undefined;
|
|
963
|
-
exports.default = TabRouter;
|
|
964
|
-
var _BaseRouter = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[0]));
|
|
965
|
-
function _interopRequireDefault(e) {
|
|
966
|
-
return e && e.__esModule ? e : {
|
|
967
|
-
default: e
|
|
968
|
-
};
|
|
969
|
-
}
|
|
970
|
-
var TYPE_ROUTE = 'route';
|
|
971
|
-
var TabActions = exports.TabActions = {
|
|
972
|
-
jumpTo: function jumpTo(name, params) {
|
|
973
|
-
return {
|
|
974
|
-
type: 'JUMP_TO',
|
|
975
|
-
payload: {
|
|
976
|
-
name: name,
|
|
977
|
-
params: params
|
|
978
|
-
}
|
|
979
|
-
};
|
|
980
|
-
}
|
|
981
|
-
};
|
|
982
|
-
var getRouteHistory = function getRouteHistory(routes, index, backBehavior, initialRouteName) {
|
|
983
|
-
var history = [{
|
|
984
|
-
type: TYPE_ROUTE,
|
|
985
|
-
key: routes[index].key
|
|
986
|
-
}];
|
|
987
|
-
var initialRouteIndex;
|
|
988
|
-
switch (backBehavior) {
|
|
989
|
-
case 'order':
|
|
990
|
-
for (var i = index; i > 0; i--) {
|
|
991
|
-
history.unshift({
|
|
992
|
-
type: TYPE_ROUTE,
|
|
993
|
-
key: routes[i - 1].key
|
|
994
|
-
});
|
|
995
|
-
}
|
|
996
|
-
break;
|
|
997
|
-
case 'firstRoute':
|
|
998
|
-
if (index !== 0) {
|
|
999
|
-
history.unshift({
|
|
1000
|
-
type: TYPE_ROUTE,
|
|
1001
|
-
key: routes[0].key
|
|
1002
|
-
});
|
|
1003
|
-
}
|
|
1004
|
-
break;
|
|
1005
|
-
case 'initialRoute':
|
|
1006
|
-
initialRouteIndex = routes.findIndex(function (route) {
|
|
1007
|
-
return route.name === initialRouteName;
|
|
1008
|
-
});
|
|
1009
|
-
initialRouteIndex = initialRouteIndex === -1 ? 0 : initialRouteIndex;
|
|
1010
|
-
if (index !== initialRouteIndex) {
|
|
1011
|
-
history.unshift({
|
|
1012
|
-
type: TYPE_ROUTE,
|
|
1013
|
-
key: routes[initialRouteIndex].key
|
|
1014
|
-
});
|
|
1015
|
-
}
|
|
1016
|
-
break;
|
|
1017
|
-
case 'history':
|
|
1018
|
-
// The history will fill up on navigation
|
|
1019
|
-
break;
|
|
1020
|
-
}
|
|
1021
|
-
return history;
|
|
1022
|
-
};
|
|
1023
|
-
var changeIndex = function changeIndex(state, index, backBehavior, initialRouteName) {
|
|
1024
|
-
var history;
|
|
1025
|
-
if (backBehavior === 'history') {
|
|
1026
|
-
var currentKey = state.routes[index].key;
|
|
1027
|
-
history = state.history.filter(function (it) {
|
|
1028
|
-
return it.type === 'route' ? it.key !== currentKey : false;
|
|
1029
|
-
}).concat({
|
|
1030
|
-
type: TYPE_ROUTE,
|
|
1031
|
-
key: currentKey
|
|
1032
|
-
});
|
|
1033
|
-
} else {
|
|
1034
|
-
history = getRouteHistory(state.routes, index, backBehavior, initialRouteName);
|
|
1035
|
-
}
|
|
1036
|
-
return Object.assign({}, state, {
|
|
1037
|
-
index: index,
|
|
1038
|
-
history: history
|
|
1039
|
-
});
|
|
1040
|
-
};
|
|
1041
|
-
function TabRouter(_ref) {
|
|
1042
|
-
var initialRouteName = _ref.initialRouteName,
|
|
1043
|
-
_ref$backBehavior = _ref.backBehavior,
|
|
1044
|
-
backBehavior = _ref$backBehavior === undefined ? 'firstRoute' : _ref$backBehavior;
|
|
1045
|
-
var router = Object.assign({}, _BaseRouter.default, {
|
|
1046
|
-
type: 'tab',
|
|
1047
|
-
getInitialState: function getInitialState(_ref2) {
|
|
1048
|
-
var routeNames = _ref2.routeNames,
|
|
1049
|
-
routeParamList = _ref2.routeParamList;
|
|
1050
|
-
var index = initialRouteName !== undefined && routeNames.includes(initialRouteName) ? routeNames.indexOf(initialRouteName) : 0;
|
|
1051
|
-
var routes = routeNames.map(function (name) {
|
|
1052
|
-
return {
|
|
1053
|
-
name: name,
|
|
1054
|
-
key: `${name}-${(0, _$$_REQUIRE(_dependencyMap[1]).nanoid)()}`,
|
|
1055
|
-
params: routeParamList[name]
|
|
1056
|
-
};
|
|
1057
|
-
});
|
|
1058
|
-
var history = getRouteHistory(routes, index, backBehavior, initialRouteName);
|
|
1059
|
-
return {
|
|
1060
|
-
stale: false,
|
|
1061
|
-
type: 'tab',
|
|
1062
|
-
key: `tab-${(0, _$$_REQUIRE(_dependencyMap[1]).nanoid)()}`,
|
|
1063
|
-
index: index,
|
|
1064
|
-
routeNames: routeNames,
|
|
1065
|
-
history: history,
|
|
1066
|
-
routes: routes
|
|
1067
|
-
};
|
|
1068
|
-
},
|
|
1069
|
-
getRehydratedState: function getRehydratedState(partialState, _ref3) {
|
|
1070
|
-
var _ref4, _ref5;
|
|
1071
|
-
var routeNames = _ref3.routeNames,
|
|
1072
|
-
routeParamList = _ref3.routeParamList;
|
|
1073
|
-
var _state$routes, _state$history;
|
|
1074
|
-
var state = partialState;
|
|
1075
|
-
if (state.stale === false) {
|
|
1076
|
-
return state;
|
|
1077
|
-
}
|
|
1078
|
-
var routes = routeNames.map(function (name) {
|
|
1079
|
-
var route = state.routes.find(function (r) {
|
|
1080
|
-
return r.name === name;
|
|
1081
|
-
});
|
|
1082
|
-
return Object.assign({}, route, {
|
|
1083
|
-
name: name,
|
|
1084
|
-
key: route && route.name === name && route.key ? route.key : `${name}-${(0, _$$_REQUIRE(_dependencyMap[1]).nanoid)()}`,
|
|
1085
|
-
params: routeParamList[name] !== undefined ? Object.assign({}, routeParamList[name], route ? route.params : undefined) : route ? route.params : undefined
|
|
1086
|
-
});
|
|
1087
|
-
});
|
|
1088
|
-
var index = Math.min(Math.max(routeNames.indexOf((_state$routes = state.routes[(_ref4 = state === null || state === undefined ? undefined : state.index) != null ? _ref4 : 0]) === null || _state$routes === undefined ? undefined : _state$routes.name), 0), routes.length - 1);
|
|
1089
|
-
var history = (_ref5 = (_state$history = state.history) === null || _state$history === undefined ? undefined : _state$history.filter(function (it) {
|
|
1090
|
-
return routes.find(function (r) {
|
|
1091
|
-
return r.key === it.key;
|
|
1092
|
-
});
|
|
1093
|
-
})) != null ? _ref5 : [];
|
|
1094
|
-
return changeIndex({
|
|
1095
|
-
stale: false,
|
|
1096
|
-
type: 'tab',
|
|
1097
|
-
key: `tab-${(0, _$$_REQUIRE(_dependencyMap[1]).nanoid)()}`,
|
|
1098
|
-
index: index,
|
|
1099
|
-
routeNames: routeNames,
|
|
1100
|
-
history: history,
|
|
1101
|
-
routes: routes
|
|
1102
|
-
}, index, backBehavior, initialRouteName);
|
|
1103
|
-
},
|
|
1104
|
-
getStateForRouteNamesChange: function getStateForRouteNamesChange(state, _ref6) {
|
|
1105
|
-
var routeNames = _ref6.routeNames,
|
|
1106
|
-
routeParamList = _ref6.routeParamList,
|
|
1107
|
-
routeKeyChanges = _ref6.routeKeyChanges;
|
|
1108
|
-
var routes = routeNames.map(function (name) {
|
|
1109
|
-
return state.routes.find(function (r) {
|
|
1110
|
-
return r.name === name && !routeKeyChanges.includes(r.name);
|
|
1111
|
-
}) || {
|
|
1112
|
-
name: name,
|
|
1113
|
-
key: `${name}-${(0, _$$_REQUIRE(_dependencyMap[1]).nanoid)()}`,
|
|
1114
|
-
params: routeParamList[name]
|
|
1115
|
-
};
|
|
1116
|
-
});
|
|
1117
|
-
var index = Math.max(0, routeNames.indexOf(state.routes[state.index].name));
|
|
1118
|
-
var history = state.history.filter(
|
|
1119
|
-
// Type will always be 'route' for tabs, but could be different in a router extending this (e.g. drawer)
|
|
1120
|
-
function (it) {
|
|
1121
|
-
return it.type !== 'route' || routes.find(function (r) {
|
|
1122
|
-
return r.key === it.key;
|
|
1123
|
-
});
|
|
1124
|
-
});
|
|
1125
|
-
if (!history.length) {
|
|
1126
|
-
history = getRouteHistory(routes, index, backBehavior, initialRouteName);
|
|
1127
|
-
}
|
|
1128
|
-
return Object.assign({}, state, {
|
|
1129
|
-
history: history,
|
|
1130
|
-
routeNames: routeNames,
|
|
1131
|
-
routes: routes,
|
|
1132
|
-
index: index
|
|
1133
|
-
});
|
|
1134
|
-
},
|
|
1135
|
-
getStateForRouteFocus: function getStateForRouteFocus(state, key) {
|
|
1136
|
-
var index = state.routes.findIndex(function (r) {
|
|
1137
|
-
return r.key === key;
|
|
1138
|
-
});
|
|
1139
|
-
if (index === -1 || index === state.index) {
|
|
1140
|
-
return state;
|
|
1141
|
-
}
|
|
1142
|
-
return changeIndex(state, index, backBehavior, initialRouteName);
|
|
1143
|
-
},
|
|
1144
|
-
getStateForAction: function getStateForAction(state, action, _ref7) {
|
|
1145
|
-
var routeParamList = _ref7.routeParamList,
|
|
1146
|
-
routeGetIdList = _ref7.routeGetIdList;
|
|
1147
|
-
switch (action.type) {
|
|
1148
|
-
case 'JUMP_TO':
|
|
1149
|
-
case 'NAVIGATE':
|
|
1150
|
-
{
|
|
1151
|
-
var index = -1;
|
|
1152
|
-
if (action.type === 'NAVIGATE' && action.payload.key) {
|
|
1153
|
-
index = state.routes.findIndex(function (route) {
|
|
1154
|
-
return route.key === action.payload.key;
|
|
1155
|
-
});
|
|
1156
|
-
} else {
|
|
1157
|
-
index = state.routes.findIndex(function (route) {
|
|
1158
|
-
return route.name === action.payload.name;
|
|
1159
|
-
});
|
|
1160
|
-
}
|
|
1161
|
-
if (index === -1) {
|
|
1162
|
-
return null;
|
|
1163
|
-
}
|
|
1164
|
-
return changeIndex(Object.assign({}, state, {
|
|
1165
|
-
routes: state.routes.map(function (route, i) {
|
|
1166
|
-
if (i !== index) {
|
|
1167
|
-
return route;
|
|
1168
|
-
}
|
|
1169
|
-
var getId = routeGetIdList[route.name];
|
|
1170
|
-
var currentId = getId === null || getId === undefined ? undefined : getId({
|
|
1171
|
-
params: route.params
|
|
1172
|
-
});
|
|
1173
|
-
var nextId = getId === null || getId === undefined ? undefined : getId({
|
|
1174
|
-
params: action.payload.params
|
|
1175
|
-
});
|
|
1176
|
-
var key = currentId === nextId ? route.key : `${route.name}-${(0, _$$_REQUIRE(_dependencyMap[1]).nanoid)()}`;
|
|
1177
|
-
var params;
|
|
1178
|
-
if (action.type === 'NAVIGATE' && action.payload.merge && currentId === nextId) {
|
|
1179
|
-
params = action.payload.params !== undefined || routeParamList[route.name] !== undefined ? Object.assign({}, routeParamList[route.name], route.params, action.payload.params) : route.params;
|
|
1180
|
-
} else {
|
|
1181
|
-
params = routeParamList[route.name] !== undefined ? Object.assign({}, routeParamList[route.name], action.payload.params) : action.payload.params;
|
|
1182
|
-
}
|
|
1183
|
-
var path = action.type === 'NAVIGATE' && action.payload.path != null ? action.payload.path : route.path;
|
|
1184
|
-
return params !== route.params || path !== route.path ? Object.assign({}, route, {
|
|
1185
|
-
key: key,
|
|
1186
|
-
path: path,
|
|
1187
|
-
params: params
|
|
1188
|
-
}) : route;
|
|
1189
|
-
})
|
|
1190
|
-
}), index, backBehavior, initialRouteName);
|
|
1191
|
-
}
|
|
1192
|
-
case 'GO_BACK':
|
|
1193
|
-
{
|
|
1194
|
-
if (state.history.length === 1) {
|
|
1195
|
-
return null;
|
|
1196
|
-
}
|
|
1197
|
-
var previousKey = state.history[state.history.length - 2].key;
|
|
1198
|
-
var _index = state.routes.findIndex(function (route) {
|
|
1199
|
-
return route.key === previousKey;
|
|
1200
|
-
});
|
|
1201
|
-
if (_index === -1) {
|
|
1202
|
-
return null;
|
|
1203
|
-
}
|
|
1204
|
-
return Object.assign({}, state, {
|
|
1205
|
-
history: state.history.slice(0, -1),
|
|
1206
|
-
index: _index
|
|
1207
|
-
});
|
|
1208
|
-
}
|
|
1209
|
-
default:
|
|
1210
|
-
return _BaseRouter.default.getStateForAction(state, action);
|
|
1211
|
-
}
|
|
1212
|
-
},
|
|
1213
|
-
shouldActionChangeFocus: function shouldActionChangeFocus(action) {
|
|
1214
|
-
return action.type === 'NAVIGATE';
|
|
1215
|
-
},
|
|
1216
|
-
actionCreators: TabActions
|
|
1217
|
-
});
|
|
1218
|
-
return router;
|
|
1219
|
-
}
|
|
1220
|
-
},"c822e55e1302f6e881d8",["4e814a93075c75141026","e03db9aacb1ee503cd26"]);
|
|
1221
|
-
__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) {
|
|
1222
|
-
function _objectWithoutProperties(e, t) {
|
|
1223
|
-
if (null == e) return {};
|
|
1224
|
-
var o,
|
|
1225
|
-
r,
|
|
1226
|
-
i = _$$_REQUIRE(_dependencyMap[0])(e, t);
|
|
1227
|
-
if (Object.getOwnPropertySymbols) {
|
|
1228
|
-
var n = Object.getOwnPropertySymbols(e);
|
|
1229
|
-
for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]);
|
|
1230
|
-
}
|
|
1231
|
-
return i;
|
|
1232
|
-
}
|
|
1233
|
-
module.exports = _objectWithoutProperties, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
|
1234
|
-
},"a2c8e692f78bae5b8b98",["5927789db7c756c318ed"]);
|
|
1235
|
-
__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) {
|
|
1236
|
-
function _objectWithoutPropertiesLoose(r, e) {
|
|
1237
|
-
if (null == r) return {};
|
|
1238
|
-
var t = {};
|
|
1239
|
-
for (var n in r) if ({}.hasOwnProperty.call(r, n)) {
|
|
1240
|
-
if (-1 !== e.indexOf(n)) continue;
|
|
1241
|
-
t[n] = r[n];
|
|
1242
|
-
}
|
|
1243
|
-
return t;
|
|
1244
|
-
}
|
|
1245
|
-
module.exports = _objectWithoutPropertiesLoose, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
|
1246
|
-
},"5927789db7c756c318ed",[]);
|
|
1247
|
-
__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) {
|
|
1248
|
-
function _toConsumableArray(r) {
|
|
1249
|
-
return _$$_REQUIRE(_dependencyMap[0])(r) || _$$_REQUIRE(_dependencyMap[1])(r) || _$$_REQUIRE(_dependencyMap[2])(r) || _$$_REQUIRE(_dependencyMap[3])();
|
|
1250
|
-
}
|
|
1251
|
-
module.exports = _toConsumableArray, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
|
1252
|
-
},"838d7a057beeb5db50df",["a425fd4fe3cf47759e99","67d028b72bb61755baea","e7044bb724c5bd68e2cc","b4810fa44dd496b7d9f5"]);
|
|
1253
|
-
__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) {
|
|
1254
|
-
function _arrayWithoutHoles(r) {
|
|
1255
|
-
if (Array.isArray(r)) return _$$_REQUIRE(_dependencyMap[0])(r);
|
|
1256
|
-
}
|
|
1257
|
-
module.exports = _arrayWithoutHoles, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
|
1258
|
-
},"a425fd4fe3cf47759e99",["378be3062418cfac9327"]);
|
|
1259
|
-
__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) {
|
|
1260
|
-
function _arrayLikeToArray(r, a) {
|
|
1261
|
-
(null == a || a > r.length) && (a = r.length);
|
|
1262
|
-
for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e];
|
|
1263
|
-
return n;
|
|
1264
|
-
}
|
|
1265
|
-
module.exports = _arrayLikeToArray, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
|
1266
|
-
},"378be3062418cfac9327",[]);
|
|
1267
|
-
__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) {
|
|
1268
|
-
function _iterableToArray(r) {
|
|
1269
|
-
if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r);
|
|
1270
|
-
}
|
|
1271
|
-
module.exports = _iterableToArray, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
|
1272
|
-
},"67d028b72bb61755baea",[]);
|
|
1273
|
-
__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) {
|
|
1274
|
-
function _unsupportedIterableToArray(r, a) {
|
|
1275
|
-
if (r) {
|
|
1276
|
-
if ("string" == typeof r) return _$$_REQUIRE(_dependencyMap[0])(r, a);
|
|
1277
|
-
var t = {}.toString.call(r).slice(8, -1);
|
|
1278
|
-
return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _$$_REQUIRE(_dependencyMap[0])(r, a) : undefined;
|
|
1279
|
-
}
|
|
1280
|
-
}
|
|
1281
|
-
module.exports = _unsupportedIterableToArray, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
|
1282
|
-
},"e7044bb724c5bd68e2cc",["378be3062418cfac9327"]);
|
|
1283
|
-
__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) {
|
|
1284
|
-
function _nonIterableSpread() {
|
|
1285
|
-
throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
1286
|
-
}
|
|
1287
|
-
module.exports = _nonIterableSpread, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
|
1288
|
-
},"b4810fa44dd496b7d9f5",[]);
|
|
1289
|
-
__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) {
|
|
1290
|
-
"use strict";
|
|
1291
|
-
|
|
1292
|
-
Object.defineProperty(exports, "__esModule", {
|
|
1293
|
-
value: true
|
|
1294
|
-
});
|
|
1295
|
-
exports.StackActions = undefined;
|
|
1296
|
-
exports.default = StackRouter;
|
|
1297
|
-
var _BaseRouter = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[0]));
|
|
1298
|
-
function _interopRequireDefault(e) {
|
|
1299
|
-
return e && e.__esModule ? e : {
|
|
1300
|
-
default: e
|
|
1301
|
-
};
|
|
1302
|
-
}
|
|
1303
|
-
var StackActions = exports.StackActions = {
|
|
1304
|
-
replace: function replace(name, params) {
|
|
1305
|
-
return {
|
|
1306
|
-
type: 'REPLACE',
|
|
1307
|
-
payload: {
|
|
1308
|
-
name: name,
|
|
1309
|
-
params: params
|
|
1310
|
-
}
|
|
1311
|
-
};
|
|
1312
|
-
},
|
|
1313
|
-
push: function push(name, params) {
|
|
1314
|
-
return {
|
|
1315
|
-
type: 'PUSH',
|
|
1316
|
-
payload: {
|
|
1317
|
-
name: name,
|
|
1318
|
-
params: params
|
|
1319
|
-
}
|
|
1320
|
-
};
|
|
1321
|
-
},
|
|
1322
|
-
pop: function pop() {
|
|
1323
|
-
var count = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 1;
|
|
1324
|
-
return {
|
|
1325
|
-
type: 'POP',
|
|
1326
|
-
payload: {
|
|
1327
|
-
count: count
|
|
1328
|
-
}
|
|
1329
|
-
};
|
|
1330
|
-
},
|
|
1331
|
-
popToTop: function popToTop() {
|
|
1332
|
-
return {
|
|
1333
|
-
type: 'POP_TO_TOP'
|
|
1334
|
-
};
|
|
1335
|
-
}
|
|
1336
|
-
};
|
|
1337
|
-
function StackRouter(options) {
|
|
1338
|
-
var router = Object.assign({}, _BaseRouter.default, {
|
|
1339
|
-
type: 'stack',
|
|
1340
|
-
getInitialState: function getInitialState(_ref) {
|
|
1341
|
-
var routeNames = _ref.routeNames,
|
|
1342
|
-
routeParamList = _ref.routeParamList;
|
|
1343
|
-
var initialRouteName = options.initialRouteName !== undefined && routeNames.includes(options.initialRouteName) ? options.initialRouteName : routeNames[0];
|
|
1344
|
-
return {
|
|
1345
|
-
stale: false,
|
|
1346
|
-
type: 'stack',
|
|
1347
|
-
key: `stack-${(0, _$$_REQUIRE(_dependencyMap[1]).nanoid)()}`,
|
|
1348
|
-
index: 0,
|
|
1349
|
-
routeNames: routeNames,
|
|
1350
|
-
routes: [{
|
|
1351
|
-
key: `${initialRouteName}-${(0, _$$_REQUIRE(_dependencyMap[1]).nanoid)()}`,
|
|
1352
|
-
name: initialRouteName,
|
|
1353
|
-
params: routeParamList[initialRouteName]
|
|
1354
|
-
}]
|
|
1355
|
-
};
|
|
1356
|
-
},
|
|
1357
|
-
getRehydratedState: function getRehydratedState(partialState, _ref2) {
|
|
1358
|
-
var routeNames = _ref2.routeNames,
|
|
1359
|
-
routeParamList = _ref2.routeParamList;
|
|
1360
|
-
var state = partialState;
|
|
1361
|
-
if (state.stale === false) {
|
|
1362
|
-
return state;
|
|
1363
|
-
}
|
|
1364
|
-
var routes = state.routes.filter(function (route) {
|
|
1365
|
-
return routeNames.includes(route.name);
|
|
1366
|
-
}).map(function (route) {
|
|
1367
|
-
return Object.assign({}, route, {
|
|
1368
|
-
key: route.key || `${route.name}-${(0, _$$_REQUIRE(_dependencyMap[1]).nanoid)()}`,
|
|
1369
|
-
params: routeParamList[route.name] !== undefined ? Object.assign({}, routeParamList[route.name], route.params) : route.params
|
|
1370
|
-
});
|
|
1371
|
-
});
|
|
1372
|
-
if (routes.length === 0) {
|
|
1373
|
-
var initialRouteName = options.initialRouteName !== undefined ? options.initialRouteName : routeNames[0];
|
|
1374
|
-
routes.push({
|
|
1375
|
-
key: `${initialRouteName}-${(0, _$$_REQUIRE(_dependencyMap[1]).nanoid)()}`,
|
|
1376
|
-
name: initialRouteName,
|
|
1377
|
-
params: routeParamList[initialRouteName]
|
|
1378
|
-
});
|
|
1379
|
-
}
|
|
1380
|
-
return {
|
|
1381
|
-
stale: false,
|
|
1382
|
-
type: 'stack',
|
|
1383
|
-
key: `stack-${(0, _$$_REQUIRE(_dependencyMap[1]).nanoid)()}`,
|
|
1384
|
-
index: routes.length - 1,
|
|
1385
|
-
routeNames: routeNames,
|
|
1386
|
-
routes: routes
|
|
1387
|
-
};
|
|
1388
|
-
},
|
|
1389
|
-
getStateForRouteNamesChange: function getStateForRouteNamesChange(state, _ref3) {
|
|
1390
|
-
var routeNames = _ref3.routeNames,
|
|
1391
|
-
routeParamList = _ref3.routeParamList,
|
|
1392
|
-
routeKeyChanges = _ref3.routeKeyChanges;
|
|
1393
|
-
var routes = state.routes.filter(function (route) {
|
|
1394
|
-
return routeNames.includes(route.name) && !routeKeyChanges.includes(route.name);
|
|
1395
|
-
});
|
|
1396
|
-
if (routes.length === 0) {
|
|
1397
|
-
var initialRouteName = options.initialRouteName !== undefined && routeNames.includes(options.initialRouteName) ? options.initialRouteName : routeNames[0];
|
|
1398
|
-
routes.push({
|
|
1399
|
-
key: `${initialRouteName}-${(0, _$$_REQUIRE(_dependencyMap[1]).nanoid)()}`,
|
|
1400
|
-
name: initialRouteName,
|
|
1401
|
-
params: routeParamList[initialRouteName]
|
|
1402
|
-
});
|
|
1403
|
-
}
|
|
1404
|
-
return Object.assign({}, state, {
|
|
1405
|
-
routeNames: routeNames,
|
|
1406
|
-
routes: routes,
|
|
1407
|
-
index: Math.min(state.index, routes.length - 1)
|
|
1408
|
-
});
|
|
1409
|
-
},
|
|
1410
|
-
getStateForRouteFocus: function getStateForRouteFocus(state, key) {
|
|
1411
|
-
var index = state.routes.findIndex(function (r) {
|
|
1412
|
-
return r.key === key;
|
|
1413
|
-
});
|
|
1414
|
-
if (index === -1 || index === state.index) {
|
|
1415
|
-
return state;
|
|
1416
|
-
}
|
|
1417
|
-
return Object.assign({}, state, {
|
|
1418
|
-
index: index,
|
|
1419
|
-
routes: state.routes.slice(0, index + 1)
|
|
1420
|
-
});
|
|
1421
|
-
},
|
|
1422
|
-
getStateForAction: function getStateForAction(state, action, options) {
|
|
1423
|
-
var routeParamList = options.routeParamList;
|
|
1424
|
-
switch (action.type) {
|
|
1425
|
-
case 'REPLACE':
|
|
1426
|
-
{
|
|
1427
|
-
var index = action.target === state.key && action.source ? state.routes.findIndex(function (r) {
|
|
1428
|
-
return r.key === action.source;
|
|
1429
|
-
}) : state.index;
|
|
1430
|
-
if (index === -1) {
|
|
1431
|
-
return null;
|
|
1432
|
-
}
|
|
1433
|
-
var _action$payload = action.payload,
|
|
1434
|
-
name = _action$payload.name,
|
|
1435
|
-
key = _action$payload.key,
|
|
1436
|
-
params = _action$payload.params;
|
|
1437
|
-
if (!state.routeNames.includes(name)) {
|
|
1438
|
-
return null;
|
|
1439
|
-
}
|
|
1440
|
-
return Object.assign({}, state, {
|
|
1441
|
-
routes: state.routes.map(function (route, i) {
|
|
1442
|
-
return i === index ? {
|
|
1443
|
-
key: key !== undefined ? key : `${name}-${(0, _$$_REQUIRE(_dependencyMap[1]).nanoid)()}`,
|
|
1444
|
-
name: name,
|
|
1445
|
-
params: routeParamList[name] !== undefined ? Object.assign({}, routeParamList[name], params) : params
|
|
1446
|
-
} : route;
|
|
1447
|
-
})
|
|
1448
|
-
});
|
|
1449
|
-
}
|
|
1450
|
-
case 'PUSH':
|
|
1451
|
-
if (state.routeNames.includes(action.payload.name)) {
|
|
1452
|
-
var getId = options.routeGetIdList[action.payload.name];
|
|
1453
|
-
var id = getId === null || getId === undefined ? undefined : getId({
|
|
1454
|
-
params: action.payload.params
|
|
1455
|
-
});
|
|
1456
|
-
var route = id ? state.routes.find(function (route) {
|
|
1457
|
-
return route.name === action.payload.name && id === (getId === null || getId === undefined ? undefined : getId({
|
|
1458
|
-
params: route.params
|
|
1459
|
-
}));
|
|
1460
|
-
}) : undefined;
|
|
1461
|
-
var routes;
|
|
1462
|
-
if (route) {
|
|
1463
|
-
routes = state.routes.filter(function (r) {
|
|
1464
|
-
return r.key !== route.key;
|
|
1465
|
-
});
|
|
1466
|
-
routes.push(Object.assign({}, route, {
|
|
1467
|
-
params: routeParamList[action.payload.name] !== undefined ? Object.assign({}, routeParamList[action.payload.name], action.payload.params) : action.payload.params
|
|
1468
|
-
}));
|
|
1469
|
-
} else {
|
|
1470
|
-
routes = [].concat(_$$_REQUIRE(_dependencyMap[2])(state.routes), [{
|
|
1471
|
-
key: `${action.payload.name}-${(0, _$$_REQUIRE(_dependencyMap[1]).nanoid)()}`,
|
|
1472
|
-
name: action.payload.name,
|
|
1473
|
-
params: routeParamList[action.payload.name] !== undefined ? Object.assign({}, routeParamList[action.payload.name], action.payload.params) : action.payload.params
|
|
1474
|
-
}]);
|
|
1475
|
-
}
|
|
1476
|
-
return Object.assign({}, state, {
|
|
1477
|
-
index: routes.length - 1,
|
|
1478
|
-
routes: routes
|
|
1479
|
-
});
|
|
1480
|
-
}
|
|
1481
|
-
return null;
|
|
1482
|
-
case 'POP':
|
|
1483
|
-
{
|
|
1484
|
-
var _index = action.target === state.key && action.source ? state.routes.findIndex(function (r) {
|
|
1485
|
-
return r.key === action.source;
|
|
1486
|
-
}) : state.index;
|
|
1487
|
-
if (_index > 0) {
|
|
1488
|
-
var count = Math.max(_index - action.payload.count + 1, 1);
|
|
1489
|
-
var _routes = state.routes.slice(0, count).concat(state.routes.slice(_index + 1));
|
|
1490
|
-
return Object.assign({}, state, {
|
|
1491
|
-
index: _routes.length - 1,
|
|
1492
|
-
routes: _routes
|
|
1493
|
-
});
|
|
1494
|
-
}
|
|
1495
|
-
return null;
|
|
1496
|
-
}
|
|
1497
|
-
case 'POP_TO_TOP':
|
|
1498
|
-
return router.getStateForAction(state, {
|
|
1499
|
-
type: 'POP',
|
|
1500
|
-
payload: {
|
|
1501
|
-
count: state.routes.length - 1
|
|
1502
|
-
}
|
|
1503
|
-
}, options);
|
|
1504
|
-
case 'NAVIGATE':
|
|
1505
|
-
if (action.payload.name !== undefined && !state.routeNames.includes(action.payload.name)) {
|
|
1506
|
-
return null;
|
|
1507
|
-
}
|
|
1508
|
-
if (action.payload.key || action.payload.name) {
|
|
1509
|
-
var _action$payload$path;
|
|
1510
|
-
// If the route already exists, navigate to that
|
|
1511
|
-
var _index2 = -1;
|
|
1512
|
-
var _getId =
|
|
1513
|
-
// `getId` and `key` can't be used together
|
|
1514
|
-
action.payload.key === undefined && action.payload.name !== undefined ? options.routeGetIdList[action.payload.name] : undefined;
|
|
1515
|
-
var _id = _getId === null || _getId === undefined ? undefined : _getId({
|
|
1516
|
-
params: action.payload.params
|
|
1517
|
-
});
|
|
1518
|
-
if (_id) {
|
|
1519
|
-
_index2 = state.routes.findIndex(function (route) {
|
|
1520
|
-
return route.name === action.payload.name && _id === (_getId === null || _getId === undefined ? undefined : _getId({
|
|
1521
|
-
params: route.params
|
|
1522
|
-
}));
|
|
1523
|
-
});
|
|
1524
|
-
} else if (state.routes[state.index].name === action.payload.name && action.payload.key === undefined || state.routes[state.index].key === action.payload.key) {
|
|
1525
|
-
_index2 = state.index;
|
|
1526
|
-
} else {
|
|
1527
|
-
for (var i = state.routes.length - 1; i >= 0; i--) {
|
|
1528
|
-
if (state.routes[i].name === action.payload.name && action.payload.key === undefined || state.routes[i].key === action.payload.key) {
|
|
1529
|
-
_index2 = i;
|
|
1530
|
-
break;
|
|
1531
|
-
}
|
|
1532
|
-
}
|
|
1533
|
-
}
|
|
1534
|
-
if (_index2 === -1 && action.payload.key && action.payload.name === undefined) {
|
|
1535
|
-
return null;
|
|
1536
|
-
}
|
|
1537
|
-
if (_index2 === -1 && action.payload.name !== undefined) {
|
|
1538
|
-
var _action$payload$key;
|
|
1539
|
-
var _routes2 = [].concat(_$$_REQUIRE(_dependencyMap[2])(state.routes), [{
|
|
1540
|
-
key: (_action$payload$key = action.payload.key) != null ? _action$payload$key : `${action.payload.name}-${(0, _$$_REQUIRE(_dependencyMap[1]).nanoid)()}`,
|
|
1541
|
-
name: action.payload.name,
|
|
1542
|
-
path: action.payload.path,
|
|
1543
|
-
params: routeParamList[action.payload.name] !== undefined ? Object.assign({}, routeParamList[action.payload.name], action.payload.params) : action.payload.params
|
|
1544
|
-
}]);
|
|
1545
|
-
return Object.assign({}, state, {
|
|
1546
|
-
routes: _routes2,
|
|
1547
|
-
index: _routes2.length - 1
|
|
1548
|
-
});
|
|
1549
|
-
}
|
|
1550
|
-
var _route = state.routes[_index2];
|
|
1551
|
-
var _params;
|
|
1552
|
-
if (action.payload.merge) {
|
|
1553
|
-
_params = action.payload.params !== undefined || routeParamList[_route.name] !== undefined ? Object.assign({}, routeParamList[_route.name], _route.params, action.payload.params) : _route.params;
|
|
1554
|
-
} else {
|
|
1555
|
-
_params = routeParamList[_route.name] !== undefined ? Object.assign({}, routeParamList[_route.name], action.payload.params) : action.payload.params;
|
|
1556
|
-
}
|
|
1557
|
-
return Object.assign({}, state, {
|
|
1558
|
-
index: _index2,
|
|
1559
|
-
routes: [].concat(_$$_REQUIRE(_dependencyMap[2])(state.routes.slice(0, _index2)), [_params !== _route.params || action.payload.path && action.payload.path !== _route.path ? Object.assign({}, _route, {
|
|
1560
|
-
path: (_action$payload$path = action.payload.path) != null ? _action$payload$path : _route.path,
|
|
1561
|
-
params: _params
|
|
1562
|
-
}) : state.routes[_index2]])
|
|
1563
|
-
});
|
|
1564
|
-
}
|
|
1565
|
-
return null;
|
|
1566
|
-
case 'GO_BACK':
|
|
1567
|
-
if (state.index > 0) {
|
|
1568
|
-
return router.getStateForAction(state, {
|
|
1569
|
-
type: 'POP',
|
|
1570
|
-
payload: {
|
|
1571
|
-
count: 1
|
|
1572
|
-
},
|
|
1573
|
-
target: action.target,
|
|
1574
|
-
source: action.source
|
|
1575
|
-
}, options);
|
|
1576
|
-
}
|
|
1577
|
-
return null;
|
|
1578
|
-
default:
|
|
1579
|
-
return _BaseRouter.default.getStateForAction(state, action);
|
|
1580
|
-
}
|
|
1581
|
-
},
|
|
1582
|
-
actionCreators: StackActions
|
|
1583
|
-
});
|
|
1584
|
-
return router;
|
|
1585
|
-
}
|
|
1586
|
-
},"536b900fdd2382601bd3",["4e814a93075c75141026","e03db9aacb1ee503cd26","838d7a057beeb5db50df"]);
|
|
1587
|
-
__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) {
|
|
1588
|
-
"use strict";
|
|
1589
|
-
|
|
1590
|
-
Object.defineProperty(exports, "__esModule", {
|
|
1591
|
-
value: true
|
|
1592
|
-
});
|
|
1593
|
-
var _exportNames = {
|
|
1594
|
-
CommonActions: true,
|
|
1595
|
-
BaseRouter: true,
|
|
1596
|
-
DrawerActions: true,
|
|
1597
|
-
DrawerRouter: true,
|
|
1598
|
-
StackActions: true,
|
|
1599
|
-
StackRouter: true,
|
|
1600
|
-
TabActions: true,
|
|
1601
|
-
TabRouter: true
|
|
1602
|
-
};
|
|
1603
|
-
Object.defineProperty(exports, "BaseRouter", {
|
|
1604
|
-
enumerable: true,
|
|
1605
|
-
get: function get() {
|
|
1606
|
-
return _BaseRouter.default;
|
|
1607
|
-
}
|
|
1608
|
-
});
|
|
1609
|
-
exports.CommonActions = undefined;
|
|
1610
|
-
Object.defineProperty(exports, "DrawerActions", {
|
|
1611
|
-
enumerable: true,
|
|
1612
|
-
get: function get() {
|
|
1613
|
-
return _DrawerRouter.DrawerActions;
|
|
1614
|
-
}
|
|
1615
|
-
});
|
|
1616
|
-
Object.defineProperty(exports, "DrawerRouter", {
|
|
1617
|
-
enumerable: true,
|
|
1618
|
-
get: function get() {
|
|
1619
|
-
return _DrawerRouter.default;
|
|
1620
|
-
}
|
|
1621
|
-
});
|
|
1622
|
-
Object.defineProperty(exports, "StackActions", {
|
|
1623
|
-
enumerable: true,
|
|
1624
|
-
get: function get() {
|
|
1625
|
-
return _StackRouter.StackActions;
|
|
1626
|
-
}
|
|
1627
|
-
});
|
|
1628
|
-
Object.defineProperty(exports, "StackRouter", {
|
|
1629
|
-
enumerable: true,
|
|
1630
|
-
get: function get() {
|
|
1631
|
-
return _StackRouter.default;
|
|
1632
|
-
}
|
|
1633
|
-
});
|
|
1634
|
-
Object.defineProperty(exports, "TabActions", {
|
|
1635
|
-
enumerable: true,
|
|
1636
|
-
get: function get() {
|
|
1637
|
-
return _TabRouter.TabActions;
|
|
1638
|
-
}
|
|
1639
|
-
});
|
|
1640
|
-
Object.defineProperty(exports, "TabRouter", {
|
|
1641
|
-
enumerable: true,
|
|
1642
|
-
get: function get() {
|
|
1643
|
-
return _TabRouter.default;
|
|
1644
|
-
}
|
|
1645
|
-
});
|
|
1646
|
-
var CommonActions = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[0]));
|
|
1647
|
-
exports.CommonActions = CommonActions;
|
|
1648
|
-
var _BaseRouter = _interopRequireDefault(_$$_REQUIRE(_dependencyMap[1]));
|
|
1649
|
-
var _DrawerRouter = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[2]));
|
|
1650
|
-
var _StackRouter = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[3]));
|
|
1651
|
-
var _TabRouter = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[4]));
|
|
1652
|
-
Object.keys(_$$_REQUIRE(_dependencyMap[5])).forEach(function (key) {
|
|
1653
|
-
if (key === "default" || key === "__esModule") return;
|
|
1654
|
-
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
1655
|
-
if (key in exports && exports[key] === _$$_REQUIRE(_dependencyMap[5])[key]) return;
|
|
1656
|
-
Object.defineProperty(exports, key, {
|
|
1657
|
-
enumerable: true,
|
|
1658
|
-
get: function get() {
|
|
1659
|
-
return _$$_REQUIRE(_dependencyMap[5])[key];
|
|
1660
|
-
}
|
|
1661
|
-
});
|
|
1662
|
-
});
|
|
1663
|
-
function _interopRequireDefault(e) {
|
|
1664
|
-
return e && e.__esModule ? e : {
|
|
1665
|
-
default: e
|
|
1666
|
-
};
|
|
1667
|
-
}
|
|
1668
|
-
function _getRequireWildcardCache(e) {
|
|
1669
|
-
if ("function" != typeof WeakMap) return null;
|
|
1670
|
-
var r = new WeakMap(),
|
|
1671
|
-
t = new WeakMap();
|
|
1672
|
-
return (_getRequireWildcardCache = function _getRequireWildcardCache(e) {
|
|
1673
|
-
return e ? t : r;
|
|
1674
|
-
})(e);
|
|
1675
|
-
}
|
|
1676
|
-
function _interopRequireWildcard(e, r) {
|
|
1677
|
-
if (!r && e && e.__esModule) return e;
|
|
1678
|
-
if (null === e || "object" != typeof e && "function" != typeof e) return {
|
|
1679
|
-
default: e
|
|
1680
|
-
};
|
|
1681
|
-
var t = _getRequireWildcardCache(r);
|
|
1682
|
-
if (t && t.has(e)) return t.get(e);
|
|
1683
|
-
var n = {
|
|
1684
|
-
__proto__: null
|
|
1685
|
-
},
|
|
1686
|
-
a = Object.defineProperty && Object.getOwnPropertyDescriptor;
|
|
1687
|
-
for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) {
|
|
1688
|
-
var i = a ? Object.getOwnPropertyDescriptor(e, u) : null;
|
|
1689
|
-
i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u];
|
|
1690
|
-
}
|
|
1691
|
-
return n.default = e, t && t.set(e, n), n;
|
|
1692
|
-
}
|
|
1693
|
-
},"a0b9da8c3bf2cee70b92",["6224880bf3a3483be0e5","4e814a93075c75141026","fbd71b33b1fab08b6b66","536b900fdd2382601bd3","c822e55e1302f6e881d8","76321e829a38224d0f30"]);
|
|
1694
|
-
__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) {
|
|
1695
|
-
"use strict";
|
|
1696
|
-
|
|
1697
|
-
Object.defineProperty(exports, "__esModule", {
|
|
1698
|
-
value: true
|
|
1699
|
-
});
|
|
1700
|
-
},"76321e829a38224d0f30",[]);
|
|
1701
|
-
__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) {
|
|
1702
|
-
Object.defineProperty(exports, "__esModule", {
|
|
1703
|
-
value: true
|
|
1704
|
-
});
|
|
1705
|
-
exports.default = undefined;
|
|
1706
|
-
/**
|
|
1707
|
-
* Base router object that can be used when writing custom routers.
|
|
1708
|
-
* This provides few helper methods to handle common actions such as `RESET`.
|
|
1709
|
-
*/
|
|
1710
|
-
var BaseRouter = {
|
|
1711
|
-
getStateForAction: function getStateForAction(state, action) {
|
|
1712
|
-
switch (action.type) {
|
|
1713
|
-
case 'SET_PARAMS':
|
|
1714
|
-
{
|
|
1715
|
-
var index = action.source ? state.routes.findIndex(function (r) {
|
|
1716
|
-
return r.key === action.source;
|
|
1717
|
-
}) : state.index;
|
|
1718
|
-
if (index === -1) {
|
|
1719
|
-
return null;
|
|
1720
|
-
}
|
|
1721
|
-
return Object.assign({}, state, {
|
|
1722
|
-
routes: state.routes.map(function (r, i) {
|
|
1723
|
-
return i === index ? Object.assign({}, r, {
|
|
1724
|
-
params: Object.assign({}, r.params, action.payload.params)
|
|
1725
|
-
}) : r;
|
|
1726
|
-
})
|
|
1727
|
-
});
|
|
1728
|
-
}
|
|
1729
|
-
case 'RESET':
|
|
1730
|
-
{
|
|
1731
|
-
var nextState = action.payload;
|
|
1732
|
-
if (nextState.routes.length === 0 || nextState.routes.some(function (route) {
|
|
1733
|
-
return !state.routeNames.includes(route.name);
|
|
1734
|
-
})) {
|
|
1735
|
-
return null;
|
|
1736
|
-
}
|
|
1737
|
-
if (nextState.stale === false) {
|
|
1738
|
-
if (state.routeNames.length !== nextState.routeNames.length || nextState.routeNames.some(function (name) {
|
|
1739
|
-
return !state.routeNames.includes(name);
|
|
1740
|
-
})) {
|
|
1741
|
-
return null;
|
|
1742
|
-
}
|
|
1743
|
-
return Object.assign({}, nextState, {
|
|
1744
|
-
routes: nextState.routes.map(function (route) {
|
|
1745
|
-
return route.key ? route : Object.assign({}, route, {
|
|
1746
|
-
key: `${route.name}-${(0, _$$_REQUIRE(_dependencyMap[0]).nanoid)()}`
|
|
1747
|
-
});
|
|
1748
|
-
})
|
|
1749
|
-
});
|
|
1750
|
-
}
|
|
1751
|
-
return nextState;
|
|
1752
|
-
}
|
|
1753
|
-
default:
|
|
1754
|
-
return null;
|
|
1755
|
-
}
|
|
1756
|
-
},
|
|
1757
|
-
shouldActionChangeFocus: function shouldActionChangeFocus(action) {
|
|
1758
|
-
return action.type === 'NAVIGATE';
|
|
1759
|
-
}
|
|
1760
|
-
};
|
|
1761
|
-
var _default = exports.default = BaseRouter;
|
|
1762
|
-
},"b02ddfcf5d1b27936f8d",["e03db9aacb1ee503cd26"]);
|
|
1763
|
-
__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) {
|
|
1764
|
-
Object.defineProperty(exports, "__esModule", {
|
|
1765
|
-
value: true
|
|
1766
|
-
});
|
|
1767
|
-
exports.goBack = goBack;
|
|
1768
|
-
exports.navigate = navigate;
|
|
1769
|
-
exports.reset = reset;
|
|
1770
|
-
exports.setParams = setParams;
|
|
1771
|
-
function goBack() {
|
|
1772
|
-
return {
|
|
1773
|
-
type: 'GO_BACK'
|
|
1774
|
-
};
|
|
1775
|
-
}
|
|
1776
|
-
|
|
1777
|
-
// eslint-disable-next-line no-redeclare
|
|
1778
|
-
|
|
1779
|
-
// eslint-disable-next-line no-redeclare
|
|
1780
|
-
function navigate() {
|
|
1781
|
-
if (typeof (arguments.length <= 0 ? undefined : arguments[0]) === 'string') {
|
|
1782
|
-
return {
|
|
1783
|
-
type: 'NAVIGATE',
|
|
1784
|
-
payload: {
|
|
1785
|
-
name: arguments.length <= 0 ? undefined : arguments[0],
|
|
1786
|
-
params: arguments.length <= 1 ? undefined : arguments[1]
|
|
1787
|
-
}
|
|
1788
|
-
};
|
|
1789
|
-
} else {
|
|
1790
|
-
var payload = (arguments.length <= 0 ? undefined : arguments[0]) || {};
|
|
1791
|
-
if (!payload.hasOwnProperty('key') && !payload.hasOwnProperty('name')) {
|
|
1792
|
-
throw new Error('You need to specify name or key when calling navigate with an object as the argument. See https://reactnavigation.org/docs/navigation-actions#navigate for usage.');
|
|
1793
|
-
}
|
|
1794
|
-
return {
|
|
1795
|
-
type: 'NAVIGATE',
|
|
1796
|
-
payload: payload
|
|
1797
|
-
};
|
|
1798
|
-
}
|
|
1799
|
-
}
|
|
1800
|
-
function reset(state) {
|
|
1801
|
-
return {
|
|
1802
|
-
type: 'RESET',
|
|
1803
|
-
payload: state
|
|
1804
|
-
};
|
|
1805
|
-
}
|
|
1806
|
-
function setParams(params) {
|
|
1807
|
-
return {
|
|
1808
|
-
type: 'SET_PARAMS',
|
|
1809
|
-
payload: {
|
|
1810
|
-
params: params
|
|
1811
|
-
}
|
|
1812
|
-
};
|
|
1813
|
-
}
|
|
1814
|
-
},"6bfbc90eac4c2d2e67a4",[]);
|
|
1815
|
-
__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) {
|
|
1816
|
-
Object.defineProperty(exports, "__esModule", {
|
|
1817
|
-
value: true
|
|
1818
|
-
});
|
|
1819
|
-
exports.DrawerActions = undefined;
|
|
1820
|
-
exports.default = DrawerRouter;
|
|
1821
|
-
var _toConsumableArray2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1]));
|
|
1822
|
-
var _objectWithoutProperties2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2]));
|
|
1823
|
-
var _TabRouter = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[3]));
|
|
1824
|
-
var _excluded = ["defaultStatus"];
|
|
1825
|
-
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
|
|
1826
|
-
var DrawerActions = exports.DrawerActions = Object.assign({}, _TabRouter.TabActions, {
|
|
1827
|
-
openDrawer: function openDrawer() {
|
|
1828
|
-
return {
|
|
1829
|
-
type: 'OPEN_DRAWER'
|
|
1830
|
-
};
|
|
1831
|
-
},
|
|
1832
|
-
closeDrawer: function closeDrawer() {
|
|
1833
|
-
return {
|
|
1834
|
-
type: 'CLOSE_DRAWER'
|
|
1835
|
-
};
|
|
1836
|
-
},
|
|
1837
|
-
toggleDrawer: function toggleDrawer() {
|
|
1838
|
-
return {
|
|
1839
|
-
type: 'TOGGLE_DRAWER'
|
|
1840
|
-
};
|
|
1841
|
-
}
|
|
1842
|
-
});
|
|
1843
|
-
function DrawerRouter(_ref) {
|
|
1844
|
-
var _ref$defaultStatus = _ref.defaultStatus,
|
|
1845
|
-
defaultStatus = _ref$defaultStatus === undefined ? 'closed' : _ref$defaultStatus,
|
|
1846
|
-
rest = (0, _objectWithoutProperties2.default)(_ref, _excluded);
|
|
1847
|
-
var router = (0, _TabRouter.default)(rest);
|
|
1848
|
-
var isDrawerInHistory = function isDrawerInHistory(state) {
|
|
1849
|
-
var _state$history;
|
|
1850
|
-
return Boolean((_state$history = state.history) === null || _state$history === undefined ? undefined : _state$history.some(function (it) {
|
|
1851
|
-
return it.type === 'drawer';
|
|
1852
|
-
}));
|
|
1853
|
-
};
|
|
1854
|
-
var addDrawerToHistory = function addDrawerToHistory(state) {
|
|
1855
|
-
if (isDrawerInHistory(state)) {
|
|
1856
|
-
return state;
|
|
1857
|
-
}
|
|
1858
|
-
return Object.assign({}, state, {
|
|
1859
|
-
history: [].concat((0, _toConsumableArray2.default)(state.history), [{
|
|
1860
|
-
type: 'drawer',
|
|
1861
|
-
status: defaultStatus === 'open' ? 'closed' : 'open'
|
|
1862
|
-
}])
|
|
1863
|
-
});
|
|
1864
|
-
};
|
|
1865
|
-
var removeDrawerFromHistory = function removeDrawerFromHistory(state) {
|
|
1866
|
-
if (!isDrawerInHistory(state)) {
|
|
1867
|
-
return state;
|
|
1868
|
-
}
|
|
1869
|
-
return Object.assign({}, state, {
|
|
1870
|
-
history: state.history.filter(function (it) {
|
|
1871
|
-
return it.type !== 'drawer';
|
|
1872
|
-
})
|
|
1873
|
-
});
|
|
1874
|
-
};
|
|
1875
|
-
var openDrawer = function openDrawer(state) {
|
|
1876
|
-
if (defaultStatus === 'open') {
|
|
1877
|
-
return removeDrawerFromHistory(state);
|
|
1878
|
-
}
|
|
1879
|
-
return addDrawerToHistory(state);
|
|
1880
|
-
};
|
|
1881
|
-
var closeDrawer = function closeDrawer(state) {
|
|
1882
|
-
if (defaultStatus === 'open') {
|
|
1883
|
-
return addDrawerToHistory(state);
|
|
1884
|
-
}
|
|
1885
|
-
return removeDrawerFromHistory(state);
|
|
1886
|
-
};
|
|
1887
|
-
return Object.assign({}, router, {
|
|
1888
|
-
type: 'drawer',
|
|
1889
|
-
getInitialState: function getInitialState(_ref2) {
|
|
1890
|
-
var routeNames = _ref2.routeNames,
|
|
1891
|
-
routeParamList = _ref2.routeParamList,
|
|
1892
|
-
routeGetIdList = _ref2.routeGetIdList;
|
|
1893
|
-
var state = router.getInitialState({
|
|
1894
|
-
routeNames: routeNames,
|
|
1895
|
-
routeParamList: routeParamList,
|
|
1896
|
-
routeGetIdList: routeGetIdList
|
|
1897
|
-
});
|
|
1898
|
-
return Object.assign({}, state, {
|
|
1899
|
-
default: defaultStatus,
|
|
1900
|
-
stale: false,
|
|
1901
|
-
type: 'drawer',
|
|
1902
|
-
key: `drawer-${(0, _$$_REQUIRE(_dependencyMap[4]).nanoid)()}`
|
|
1903
|
-
});
|
|
1904
|
-
},
|
|
1905
|
-
getRehydratedState: function getRehydratedState(partialState, _ref3) {
|
|
1906
|
-
var routeNames = _ref3.routeNames,
|
|
1907
|
-
routeParamList = _ref3.routeParamList,
|
|
1908
|
-
routeGetIdList = _ref3.routeGetIdList;
|
|
1909
|
-
if (partialState.stale === false) {
|
|
1910
|
-
return partialState;
|
|
1911
|
-
}
|
|
1912
|
-
var state = router.getRehydratedState(partialState, {
|
|
1913
|
-
routeNames: routeNames,
|
|
1914
|
-
routeParamList: routeParamList,
|
|
1915
|
-
routeGetIdList: routeGetIdList
|
|
1916
|
-
});
|
|
1917
|
-
if (isDrawerInHistory(partialState)) {
|
|
1918
|
-
// Re-sync the drawer entry in history to correct it if it was wrong
|
|
1919
|
-
state = removeDrawerFromHistory(state);
|
|
1920
|
-
state = addDrawerToHistory(state);
|
|
1921
|
-
}
|
|
1922
|
-
return Object.assign({}, state, {
|
|
1923
|
-
default: defaultStatus,
|
|
1924
|
-
type: 'drawer',
|
|
1925
|
-
key: `drawer-${(0, _$$_REQUIRE(_dependencyMap[4]).nanoid)()}`
|
|
1926
|
-
});
|
|
1927
|
-
},
|
|
1928
|
-
getStateForRouteFocus: function getStateForRouteFocus(state, key) {
|
|
1929
|
-
var result = router.getStateForRouteFocus(state, key);
|
|
1930
|
-
return closeDrawer(result);
|
|
1931
|
-
},
|
|
1932
|
-
getStateForAction: function getStateForAction(state, action, options) {
|
|
1933
|
-
switch (action.type) {
|
|
1934
|
-
case 'OPEN_DRAWER':
|
|
1935
|
-
return openDrawer(state);
|
|
1936
|
-
case 'CLOSE_DRAWER':
|
|
1937
|
-
return closeDrawer(state);
|
|
1938
|
-
case 'TOGGLE_DRAWER':
|
|
1939
|
-
if (isDrawerInHistory(state)) {
|
|
1940
|
-
return removeDrawerFromHistory(state);
|
|
1941
|
-
}
|
|
1942
|
-
return addDrawerToHistory(state);
|
|
1943
|
-
case 'JUMP_TO':
|
|
1944
|
-
case 'NAVIGATE':
|
|
1945
|
-
{
|
|
1946
|
-
var result = router.getStateForAction(state, action, options);
|
|
1947
|
-
if (result != null && result.index !== state.index) {
|
|
1948
|
-
return closeDrawer(result);
|
|
1949
|
-
}
|
|
1950
|
-
return result;
|
|
1951
|
-
}
|
|
1952
|
-
case 'GO_BACK':
|
|
1953
|
-
if (isDrawerInHistory(state)) {
|
|
1954
|
-
return removeDrawerFromHistory(state);
|
|
1955
|
-
}
|
|
1956
|
-
return router.getStateForAction(state, action, options);
|
|
1957
|
-
default:
|
|
1958
|
-
return router.getStateForAction(state, action, options);
|
|
1959
|
-
}
|
|
1960
|
-
},
|
|
1961
|
-
actionCreators: DrawerActions
|
|
1962
|
-
});
|
|
1963
|
-
}
|
|
1964
|
-
},"36b338faa6c2364d674f",["277a84013d7e1a1ace05","838d7a057beeb5db50df","a2c8e692f78bae5b8b98","88d6ccdfe66b5db63cff","e03db9aacb1ee503cd26"]);
|
|
1965
|
-
__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) {
|
|
1966
|
-
function _interopRequireDefault(e) {
|
|
1967
|
-
return e && e.__esModule ? e : {
|
|
1968
|
-
"default": e
|
|
1969
|
-
};
|
|
1970
|
-
}
|
|
1971
|
-
module.exports = _interopRequireDefault, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
|
1972
|
-
},"277a84013d7e1a1ace05",[]);
|
|
1973
|
-
__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) {
|
|
1974
|
-
Object.defineProperty(exports, "__esModule", {
|
|
1975
|
-
value: true
|
|
1976
|
-
});
|
|
1977
|
-
exports.TabActions = undefined;
|
|
1978
|
-
exports.default = TabRouter;
|
|
1979
|
-
var _BaseRouter = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1]));
|
|
1980
|
-
var TYPE_ROUTE = 'route';
|
|
1981
|
-
var TabActions = exports.TabActions = {
|
|
1982
|
-
jumpTo: function jumpTo(name, params) {
|
|
1983
|
-
return {
|
|
1984
|
-
type: 'JUMP_TO',
|
|
1985
|
-
payload: {
|
|
1986
|
-
name: name,
|
|
1987
|
-
params: params
|
|
1988
|
-
}
|
|
1989
|
-
};
|
|
1990
|
-
}
|
|
1991
|
-
};
|
|
1992
|
-
var getRouteHistory = function getRouteHistory(routes, index, backBehavior, initialRouteName) {
|
|
1993
|
-
var history = [{
|
|
1994
|
-
type: TYPE_ROUTE,
|
|
1995
|
-
key: routes[index].key
|
|
1996
|
-
}];
|
|
1997
|
-
var initialRouteIndex;
|
|
1998
|
-
switch (backBehavior) {
|
|
1999
|
-
case 'order':
|
|
2000
|
-
for (var i = index; i > 0; i--) {
|
|
2001
|
-
history.unshift({
|
|
2002
|
-
type: TYPE_ROUTE,
|
|
2003
|
-
key: routes[i - 1].key
|
|
2004
|
-
});
|
|
2005
|
-
}
|
|
2006
|
-
break;
|
|
2007
|
-
case 'firstRoute':
|
|
2008
|
-
if (index !== 0) {
|
|
2009
|
-
history.unshift({
|
|
2010
|
-
type: TYPE_ROUTE,
|
|
2011
|
-
key: routes[0].key
|
|
2012
|
-
});
|
|
2013
|
-
}
|
|
2014
|
-
break;
|
|
2015
|
-
case 'initialRoute':
|
|
2016
|
-
initialRouteIndex = routes.findIndex(function (route) {
|
|
2017
|
-
return route.name === initialRouteName;
|
|
2018
|
-
});
|
|
2019
|
-
initialRouteIndex = initialRouteIndex === -1 ? 0 : initialRouteIndex;
|
|
2020
|
-
if (index !== initialRouteIndex) {
|
|
2021
|
-
history.unshift({
|
|
2022
|
-
type: TYPE_ROUTE,
|
|
2023
|
-
key: routes[initialRouteIndex].key
|
|
2024
|
-
});
|
|
2025
|
-
}
|
|
2026
|
-
break;
|
|
2027
|
-
case 'history':
|
|
2028
|
-
// The history will fill up on navigation
|
|
2029
|
-
break;
|
|
2030
|
-
}
|
|
2031
|
-
return history;
|
|
2032
|
-
};
|
|
2033
|
-
var changeIndex = function changeIndex(state, index, backBehavior, initialRouteName) {
|
|
2034
|
-
var history;
|
|
2035
|
-
if (backBehavior === 'history') {
|
|
2036
|
-
var currentKey = state.routes[index].key;
|
|
2037
|
-
history = state.history.filter(function (it) {
|
|
2038
|
-
return it.type === 'route' ? it.key !== currentKey : false;
|
|
2039
|
-
}).concat({
|
|
2040
|
-
type: TYPE_ROUTE,
|
|
2041
|
-
key: currentKey
|
|
2042
|
-
});
|
|
2043
|
-
} else {
|
|
2044
|
-
history = getRouteHistory(state.routes, index, backBehavior, initialRouteName);
|
|
2045
|
-
}
|
|
2046
|
-
return Object.assign({}, state, {
|
|
2047
|
-
index: index,
|
|
2048
|
-
history: history
|
|
2049
|
-
});
|
|
2050
|
-
};
|
|
2051
|
-
function TabRouter(_ref) {
|
|
2052
|
-
var initialRouteName = _ref.initialRouteName,
|
|
2053
|
-
_ref$backBehavior = _ref.backBehavior,
|
|
2054
|
-
backBehavior = _ref$backBehavior === undefined ? 'firstRoute' : _ref$backBehavior;
|
|
2055
|
-
var router = Object.assign({}, _BaseRouter.default, {
|
|
2056
|
-
type: 'tab',
|
|
2057
|
-
getInitialState: function getInitialState(_ref2) {
|
|
2058
|
-
var routeNames = _ref2.routeNames,
|
|
2059
|
-
routeParamList = _ref2.routeParamList;
|
|
2060
|
-
var index = initialRouteName !== undefined && routeNames.includes(initialRouteName) ? routeNames.indexOf(initialRouteName) : 0;
|
|
2061
|
-
var routes = routeNames.map(function (name) {
|
|
2062
|
-
return {
|
|
2063
|
-
name: name,
|
|
2064
|
-
key: `${name}-${(0, _$$_REQUIRE(_dependencyMap[2]).nanoid)()}`,
|
|
2065
|
-
params: routeParamList[name]
|
|
2066
|
-
};
|
|
2067
|
-
});
|
|
2068
|
-
var history = getRouteHistory(routes, index, backBehavior, initialRouteName);
|
|
2069
|
-
return {
|
|
2070
|
-
stale: false,
|
|
2071
|
-
type: 'tab',
|
|
2072
|
-
key: `tab-${(0, _$$_REQUIRE(_dependencyMap[2]).nanoid)()}`,
|
|
2073
|
-
index: index,
|
|
2074
|
-
routeNames: routeNames,
|
|
2075
|
-
history: history,
|
|
2076
|
-
routes: routes
|
|
2077
|
-
};
|
|
2078
|
-
},
|
|
2079
|
-
getRehydratedState: function getRehydratedState(partialState, _ref3) {
|
|
2080
|
-
var _ref4, _ref5;
|
|
2081
|
-
var routeNames = _ref3.routeNames,
|
|
2082
|
-
routeParamList = _ref3.routeParamList;
|
|
2083
|
-
var _state$routes, _state$history;
|
|
2084
|
-
var state = partialState;
|
|
2085
|
-
if (state.stale === false) {
|
|
2086
|
-
return state;
|
|
2087
|
-
}
|
|
2088
|
-
var routes = routeNames.map(function (name) {
|
|
2089
|
-
var route = state.routes.find(function (r) {
|
|
2090
|
-
return r.name === name;
|
|
2091
|
-
});
|
|
2092
|
-
return Object.assign({}, route, {
|
|
2093
|
-
name: name,
|
|
2094
|
-
key: route && route.name === name && route.key ? route.key : `${name}-${(0, _$$_REQUIRE(_dependencyMap[2]).nanoid)()}`,
|
|
2095
|
-
params: routeParamList[name] !== undefined ? Object.assign({}, routeParamList[name], route ? route.params : undefined) : route ? route.params : undefined
|
|
2096
|
-
});
|
|
2097
|
-
});
|
|
2098
|
-
var index = Math.min(Math.max(routeNames.indexOf((_state$routes = state.routes[(_ref4 = state === null || state === undefined ? undefined : state.index) != null ? _ref4 : 0]) === null || _state$routes === undefined ? undefined : _state$routes.name), 0), routes.length - 1);
|
|
2099
|
-
var history = (_ref5 = (_state$history = state.history) === null || _state$history === undefined ? undefined : _state$history.filter(function (it) {
|
|
2100
|
-
return routes.find(function (r) {
|
|
2101
|
-
return r.key === it.key;
|
|
2102
|
-
});
|
|
2103
|
-
})) != null ? _ref5 : [];
|
|
2104
|
-
return changeIndex({
|
|
2105
|
-
stale: false,
|
|
2106
|
-
type: 'tab',
|
|
2107
|
-
key: `tab-${(0, _$$_REQUIRE(_dependencyMap[2]).nanoid)()}`,
|
|
2108
|
-
index: index,
|
|
2109
|
-
routeNames: routeNames,
|
|
2110
|
-
history: history,
|
|
2111
|
-
routes: routes
|
|
2112
|
-
}, index, backBehavior, initialRouteName);
|
|
2113
|
-
},
|
|
2114
|
-
getStateForRouteNamesChange: function getStateForRouteNamesChange(state, _ref6) {
|
|
2115
|
-
var routeNames = _ref6.routeNames,
|
|
2116
|
-
routeParamList = _ref6.routeParamList,
|
|
2117
|
-
routeKeyChanges = _ref6.routeKeyChanges;
|
|
2118
|
-
var routes = routeNames.map(function (name) {
|
|
2119
|
-
return state.routes.find(function (r) {
|
|
2120
|
-
return r.name === name && !routeKeyChanges.includes(r.name);
|
|
2121
|
-
}) || {
|
|
2122
|
-
name: name,
|
|
2123
|
-
key: `${name}-${(0, _$$_REQUIRE(_dependencyMap[2]).nanoid)()}`,
|
|
2124
|
-
params: routeParamList[name]
|
|
2125
|
-
};
|
|
2126
|
-
});
|
|
2127
|
-
var index = Math.max(0, routeNames.indexOf(state.routes[state.index].name));
|
|
2128
|
-
var history = state.history.filter(
|
|
2129
|
-
// Type will always be 'route' for tabs, but could be different in a router extending this (e.g. drawer)
|
|
2130
|
-
function (it) {
|
|
2131
|
-
return it.type !== 'route' || routes.find(function (r) {
|
|
2132
|
-
return r.key === it.key;
|
|
2133
|
-
});
|
|
2134
|
-
});
|
|
2135
|
-
if (!history.length) {
|
|
2136
|
-
history = getRouteHistory(routes, index, backBehavior, initialRouteName);
|
|
2137
|
-
}
|
|
2138
|
-
return Object.assign({}, state, {
|
|
2139
|
-
history: history,
|
|
2140
|
-
routeNames: routeNames,
|
|
2141
|
-
routes: routes,
|
|
2142
|
-
index: index
|
|
2143
|
-
});
|
|
2144
|
-
},
|
|
2145
|
-
getStateForRouteFocus: function getStateForRouteFocus(state, key) {
|
|
2146
|
-
var index = state.routes.findIndex(function (r) {
|
|
2147
|
-
return r.key === key;
|
|
2148
|
-
});
|
|
2149
|
-
if (index === -1 || index === state.index) {
|
|
2150
|
-
return state;
|
|
2151
|
-
}
|
|
2152
|
-
return changeIndex(state, index, backBehavior, initialRouteName);
|
|
2153
|
-
},
|
|
2154
|
-
getStateForAction: function getStateForAction(state, action, _ref7) {
|
|
2155
|
-
var routeParamList = _ref7.routeParamList,
|
|
2156
|
-
routeGetIdList = _ref7.routeGetIdList;
|
|
2157
|
-
switch (action.type) {
|
|
2158
|
-
case 'JUMP_TO':
|
|
2159
|
-
case 'NAVIGATE':
|
|
2160
|
-
{
|
|
2161
|
-
var index = -1;
|
|
2162
|
-
if (action.type === 'NAVIGATE' && action.payload.key) {
|
|
2163
|
-
index = state.routes.findIndex(function (route) {
|
|
2164
|
-
return route.key === action.payload.key;
|
|
2165
|
-
});
|
|
2166
|
-
} else {
|
|
2167
|
-
index = state.routes.findIndex(function (route) {
|
|
2168
|
-
return route.name === action.payload.name;
|
|
2169
|
-
});
|
|
2170
|
-
}
|
|
2171
|
-
if (index === -1) {
|
|
2172
|
-
return null;
|
|
2173
|
-
}
|
|
2174
|
-
return changeIndex(Object.assign({}, state, {
|
|
2175
|
-
routes: state.routes.map(function (route, i) {
|
|
2176
|
-
if (i !== index) {
|
|
2177
|
-
return route;
|
|
2178
|
-
}
|
|
2179
|
-
var getId = routeGetIdList[route.name];
|
|
2180
|
-
var currentId = getId === null || getId === undefined ? undefined : getId({
|
|
2181
|
-
params: route.params
|
|
2182
|
-
});
|
|
2183
|
-
var nextId = getId === null || getId === undefined ? undefined : getId({
|
|
2184
|
-
params: action.payload.params
|
|
2185
|
-
});
|
|
2186
|
-
var key = currentId === nextId ? route.key : `${route.name}-${(0, _$$_REQUIRE(_dependencyMap[2]).nanoid)()}`;
|
|
2187
|
-
var params;
|
|
2188
|
-
if (action.type === 'NAVIGATE' && action.payload.merge && currentId === nextId) {
|
|
2189
|
-
params = action.payload.params !== undefined || routeParamList[route.name] !== undefined ? Object.assign({}, routeParamList[route.name], route.params, action.payload.params) : route.params;
|
|
2190
|
-
} else {
|
|
2191
|
-
params = routeParamList[route.name] !== undefined ? Object.assign({}, routeParamList[route.name], action.payload.params) : action.payload.params;
|
|
2192
|
-
}
|
|
2193
|
-
var path = action.type === 'NAVIGATE' && action.payload.path != null ? action.payload.path : route.path;
|
|
2194
|
-
return params !== route.params || path !== route.path ? Object.assign({}, route, {
|
|
2195
|
-
key: key,
|
|
2196
|
-
path: path,
|
|
2197
|
-
params: params
|
|
2198
|
-
}) : route;
|
|
2199
|
-
})
|
|
2200
|
-
}), index, backBehavior, initialRouteName);
|
|
2201
|
-
}
|
|
2202
|
-
case 'GO_BACK':
|
|
2203
|
-
{
|
|
2204
|
-
if (state.history.length === 1) {
|
|
2205
|
-
return null;
|
|
2206
|
-
}
|
|
2207
|
-
var previousKey = state.history[state.history.length - 2].key;
|
|
2208
|
-
var _index = state.routes.findIndex(function (route) {
|
|
2209
|
-
return route.key === previousKey;
|
|
2210
|
-
});
|
|
2211
|
-
if (_index === -1) {
|
|
2212
|
-
return null;
|
|
2213
|
-
}
|
|
2214
|
-
return Object.assign({}, state, {
|
|
2215
|
-
history: state.history.slice(0, -1),
|
|
2216
|
-
index: _index
|
|
2217
|
-
});
|
|
2218
|
-
}
|
|
2219
|
-
default:
|
|
2220
|
-
return _BaseRouter.default.getStateForAction(state, action);
|
|
2221
|
-
}
|
|
2222
|
-
},
|
|
2223
|
-
shouldActionChangeFocus: function shouldActionChangeFocus(action) {
|
|
2224
|
-
return action.type === 'NAVIGATE';
|
|
2225
|
-
},
|
|
2226
|
-
actionCreators: TabActions
|
|
2227
|
-
});
|
|
2228
|
-
return router;
|
|
2229
|
-
}
|
|
2230
|
-
},"88d6ccdfe66b5db63cff",["277a84013d7e1a1ace05","b02ddfcf5d1b27936f8d","e03db9aacb1ee503cd26"]);
|
|
2231
|
-
__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) {
|
|
2232
|
-
Object.defineProperty(exports, "__esModule", {
|
|
2233
|
-
value: true
|
|
2234
|
-
});
|
|
2235
|
-
exports.StackActions = undefined;
|
|
2236
|
-
exports.default = StackRouter;
|
|
2237
|
-
var _toConsumableArray2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1]));
|
|
2238
|
-
var _BaseRouter = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2]));
|
|
2239
|
-
var StackActions = exports.StackActions = {
|
|
2240
|
-
replace: function replace(name, params) {
|
|
2241
|
-
return {
|
|
2242
|
-
type: 'REPLACE',
|
|
2243
|
-
payload: {
|
|
2244
|
-
name: name,
|
|
2245
|
-
params: params
|
|
2246
|
-
}
|
|
2247
|
-
};
|
|
2248
|
-
},
|
|
2249
|
-
push: function push(name, params) {
|
|
2250
|
-
return {
|
|
2251
|
-
type: 'PUSH',
|
|
2252
|
-
payload: {
|
|
2253
|
-
name: name,
|
|
2254
|
-
params: params
|
|
2255
|
-
}
|
|
2256
|
-
};
|
|
2257
|
-
},
|
|
2258
|
-
pop: function pop() {
|
|
2259
|
-
var count = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 1;
|
|
2260
|
-
return {
|
|
2261
|
-
type: 'POP',
|
|
2262
|
-
payload: {
|
|
2263
|
-
count: count
|
|
2264
|
-
}
|
|
2265
|
-
};
|
|
2266
|
-
},
|
|
2267
|
-
popToTop: function popToTop() {
|
|
2268
|
-
return {
|
|
2269
|
-
type: 'POP_TO_TOP'
|
|
2270
|
-
};
|
|
2271
|
-
}
|
|
2272
|
-
};
|
|
2273
|
-
function StackRouter(options) {
|
|
2274
|
-
var router = Object.assign({}, _BaseRouter.default, {
|
|
2275
|
-
type: 'stack',
|
|
2276
|
-
getInitialState: function getInitialState(_ref) {
|
|
2277
|
-
var routeNames = _ref.routeNames,
|
|
2278
|
-
routeParamList = _ref.routeParamList;
|
|
2279
|
-
var initialRouteName = options.initialRouteName !== undefined && routeNames.includes(options.initialRouteName) ? options.initialRouteName : routeNames[0];
|
|
2280
|
-
return {
|
|
2281
|
-
stale: false,
|
|
2282
|
-
type: 'stack',
|
|
2283
|
-
key: `stack-${(0, _$$_REQUIRE(_dependencyMap[3]).nanoid)()}`,
|
|
2284
|
-
index: 0,
|
|
2285
|
-
routeNames: routeNames,
|
|
2286
|
-
routes: [{
|
|
2287
|
-
key: `${initialRouteName}-${(0, _$$_REQUIRE(_dependencyMap[3]).nanoid)()}`,
|
|
2288
|
-
name: initialRouteName,
|
|
2289
|
-
params: routeParamList[initialRouteName]
|
|
2290
|
-
}]
|
|
2291
|
-
};
|
|
2292
|
-
},
|
|
2293
|
-
getRehydratedState: function getRehydratedState(partialState, _ref2) {
|
|
2294
|
-
var routeNames = _ref2.routeNames,
|
|
2295
|
-
routeParamList = _ref2.routeParamList;
|
|
2296
|
-
var state = partialState;
|
|
2297
|
-
if (state.stale === false) {
|
|
2298
|
-
return state;
|
|
2299
|
-
}
|
|
2300
|
-
var routes = state.routes.filter(function (route) {
|
|
2301
|
-
return routeNames.includes(route.name);
|
|
2302
|
-
}).map(function (route) {
|
|
2303
|
-
return Object.assign({}, route, {
|
|
2304
|
-
key: route.key || `${route.name}-${(0, _$$_REQUIRE(_dependencyMap[3]).nanoid)()}`,
|
|
2305
|
-
params: routeParamList[route.name] !== undefined ? Object.assign({}, routeParamList[route.name], route.params) : route.params
|
|
2306
|
-
});
|
|
2307
|
-
});
|
|
2308
|
-
if (routes.length === 0) {
|
|
2309
|
-
var initialRouteName = options.initialRouteName !== undefined ? options.initialRouteName : routeNames[0];
|
|
2310
|
-
routes.push({
|
|
2311
|
-
key: `${initialRouteName}-${(0, _$$_REQUIRE(_dependencyMap[3]).nanoid)()}`,
|
|
2312
|
-
name: initialRouteName,
|
|
2313
|
-
params: routeParamList[initialRouteName]
|
|
2314
|
-
});
|
|
2315
|
-
}
|
|
2316
|
-
return {
|
|
2317
|
-
stale: false,
|
|
2318
|
-
type: 'stack',
|
|
2319
|
-
key: `stack-${(0, _$$_REQUIRE(_dependencyMap[3]).nanoid)()}`,
|
|
2320
|
-
index: routes.length - 1,
|
|
2321
|
-
routeNames: routeNames,
|
|
2322
|
-
routes: routes
|
|
2323
|
-
};
|
|
2324
|
-
},
|
|
2325
|
-
getStateForRouteNamesChange: function getStateForRouteNamesChange(state, _ref3) {
|
|
2326
|
-
var routeNames = _ref3.routeNames,
|
|
2327
|
-
routeParamList = _ref3.routeParamList,
|
|
2328
|
-
routeKeyChanges = _ref3.routeKeyChanges;
|
|
2329
|
-
var routes = state.routes.filter(function (route) {
|
|
2330
|
-
return routeNames.includes(route.name) && !routeKeyChanges.includes(route.name);
|
|
2331
|
-
});
|
|
2332
|
-
if (routes.length === 0) {
|
|
2333
|
-
var initialRouteName = options.initialRouteName !== undefined && routeNames.includes(options.initialRouteName) ? options.initialRouteName : routeNames[0];
|
|
2334
|
-
routes.push({
|
|
2335
|
-
key: `${initialRouteName}-${(0, _$$_REQUIRE(_dependencyMap[3]).nanoid)()}`,
|
|
2336
|
-
name: initialRouteName,
|
|
2337
|
-
params: routeParamList[initialRouteName]
|
|
2338
|
-
});
|
|
2339
|
-
}
|
|
2340
|
-
return Object.assign({}, state, {
|
|
2341
|
-
routeNames: routeNames,
|
|
2342
|
-
routes: routes,
|
|
2343
|
-
index: Math.min(state.index, routes.length - 1)
|
|
2344
|
-
});
|
|
2345
|
-
},
|
|
2346
|
-
getStateForRouteFocus: function getStateForRouteFocus(state, key) {
|
|
2347
|
-
var index = state.routes.findIndex(function (r) {
|
|
2348
|
-
return r.key === key;
|
|
2349
|
-
});
|
|
2350
|
-
if (index === -1 || index === state.index) {
|
|
2351
|
-
return state;
|
|
2352
|
-
}
|
|
2353
|
-
return Object.assign({}, state, {
|
|
2354
|
-
index: index,
|
|
2355
|
-
routes: state.routes.slice(0, index + 1)
|
|
2356
|
-
});
|
|
2357
|
-
},
|
|
2358
|
-
getStateForAction: function getStateForAction(state, action, options) {
|
|
2359
|
-
var routeParamList = options.routeParamList;
|
|
2360
|
-
switch (action.type) {
|
|
2361
|
-
case 'REPLACE':
|
|
2362
|
-
{
|
|
2363
|
-
var index = action.target === state.key && action.source ? state.routes.findIndex(function (r) {
|
|
2364
|
-
return r.key === action.source;
|
|
2365
|
-
}) : state.index;
|
|
2366
|
-
if (index === -1) {
|
|
2367
|
-
return null;
|
|
2368
|
-
}
|
|
2369
|
-
var _action$payload = action.payload,
|
|
2370
|
-
name = _action$payload.name,
|
|
2371
|
-
key = _action$payload.key,
|
|
2372
|
-
params = _action$payload.params;
|
|
2373
|
-
if (!state.routeNames.includes(name)) {
|
|
2374
|
-
return null;
|
|
2375
|
-
}
|
|
2376
|
-
return Object.assign({}, state, {
|
|
2377
|
-
routes: state.routes.map(function (route, i) {
|
|
2378
|
-
return i === index ? {
|
|
2379
|
-
key: key !== undefined ? key : `${name}-${(0, _$$_REQUIRE(_dependencyMap[3]).nanoid)()}`,
|
|
2380
|
-
name: name,
|
|
2381
|
-
params: routeParamList[name] !== undefined ? Object.assign({}, routeParamList[name], params) : params
|
|
2382
|
-
} : route;
|
|
2383
|
-
})
|
|
2384
|
-
});
|
|
2385
|
-
}
|
|
2386
|
-
case 'PUSH':
|
|
2387
|
-
if (state.routeNames.includes(action.payload.name)) {
|
|
2388
|
-
var getId = options.routeGetIdList[action.payload.name];
|
|
2389
|
-
var id = getId === null || getId === undefined ? undefined : getId({
|
|
2390
|
-
params: action.payload.params
|
|
2391
|
-
});
|
|
2392
|
-
var route = id ? state.routes.find(function (route) {
|
|
2393
|
-
return route.name === action.payload.name && id === (getId === null || getId === undefined ? undefined : getId({
|
|
2394
|
-
params: route.params
|
|
2395
|
-
}));
|
|
2396
|
-
}) : undefined;
|
|
2397
|
-
var routes;
|
|
2398
|
-
if (route) {
|
|
2399
|
-
routes = state.routes.filter(function (r) {
|
|
2400
|
-
return r.key !== route.key;
|
|
2401
|
-
});
|
|
2402
|
-
routes.push(Object.assign({}, route, {
|
|
2403
|
-
params: routeParamList[action.payload.name] !== undefined ? Object.assign({}, routeParamList[action.payload.name], action.payload.params) : action.payload.params
|
|
2404
|
-
}));
|
|
2405
|
-
} else {
|
|
2406
|
-
routes = [].concat((0, _toConsumableArray2.default)(state.routes), [{
|
|
2407
|
-
key: `${action.payload.name}-${(0, _$$_REQUIRE(_dependencyMap[3]).nanoid)()}`,
|
|
2408
|
-
name: action.payload.name,
|
|
2409
|
-
params: routeParamList[action.payload.name] !== undefined ? Object.assign({}, routeParamList[action.payload.name], action.payload.params) : action.payload.params
|
|
2410
|
-
}]);
|
|
2411
|
-
}
|
|
2412
|
-
return Object.assign({}, state, {
|
|
2413
|
-
index: routes.length - 1,
|
|
2414
|
-
routes: routes
|
|
2415
|
-
});
|
|
2416
|
-
}
|
|
2417
|
-
return null;
|
|
2418
|
-
case 'POP':
|
|
2419
|
-
{
|
|
2420
|
-
var _index = action.target === state.key && action.source ? state.routes.findIndex(function (r) {
|
|
2421
|
-
return r.key === action.source;
|
|
2422
|
-
}) : state.index;
|
|
2423
|
-
if (_index > 0) {
|
|
2424
|
-
var count = Math.max(_index - action.payload.count + 1, 1);
|
|
2425
|
-
var _routes = state.routes.slice(0, count).concat(state.routes.slice(_index + 1));
|
|
2426
|
-
return Object.assign({}, state, {
|
|
2427
|
-
index: _routes.length - 1,
|
|
2428
|
-
routes: _routes
|
|
2429
|
-
});
|
|
2430
|
-
}
|
|
2431
|
-
return null;
|
|
2432
|
-
}
|
|
2433
|
-
case 'POP_TO_TOP':
|
|
2434
|
-
return router.getStateForAction(state, {
|
|
2435
|
-
type: 'POP',
|
|
2436
|
-
payload: {
|
|
2437
|
-
count: state.routes.length - 1
|
|
2438
|
-
}
|
|
2439
|
-
}, options);
|
|
2440
|
-
case 'NAVIGATE':
|
|
2441
|
-
if (action.payload.name !== undefined && !state.routeNames.includes(action.payload.name)) {
|
|
2442
|
-
return null;
|
|
2443
|
-
}
|
|
2444
|
-
if (action.payload.key || action.payload.name) {
|
|
2445
|
-
var _action$payload$path;
|
|
2446
|
-
// If the route already exists, navigate to that
|
|
2447
|
-
var _index2 = -1;
|
|
2448
|
-
var _getId =
|
|
2449
|
-
// `getId` and `key` can't be used together
|
|
2450
|
-
action.payload.key === undefined && action.payload.name !== undefined ? options.routeGetIdList[action.payload.name] : undefined;
|
|
2451
|
-
var _id = _getId === null || _getId === undefined ? undefined : _getId({
|
|
2452
|
-
params: action.payload.params
|
|
2453
|
-
});
|
|
2454
|
-
if (_id) {
|
|
2455
|
-
_index2 = state.routes.findIndex(function (route) {
|
|
2456
|
-
return route.name === action.payload.name && _id === (_getId === null || _getId === undefined ? undefined : _getId({
|
|
2457
|
-
params: route.params
|
|
2458
|
-
}));
|
|
2459
|
-
});
|
|
2460
|
-
} else if (state.routes[state.index].name === action.payload.name && action.payload.key === undefined || state.routes[state.index].key === action.payload.key) {
|
|
2461
|
-
_index2 = state.index;
|
|
2462
|
-
} else {
|
|
2463
|
-
for (var i = state.routes.length - 1; i >= 0; i--) {
|
|
2464
|
-
if (state.routes[i].name === action.payload.name && action.payload.key === undefined || state.routes[i].key === action.payload.key) {
|
|
2465
|
-
_index2 = i;
|
|
2466
|
-
break;
|
|
2467
|
-
}
|
|
2468
|
-
}
|
|
2469
|
-
}
|
|
2470
|
-
if (_index2 === -1 && action.payload.key && action.payload.name === undefined) {
|
|
2471
|
-
return null;
|
|
2472
|
-
}
|
|
2473
|
-
if (_index2 === -1 && action.payload.name !== undefined) {
|
|
2474
|
-
var _action$payload$key;
|
|
2475
|
-
var _routes2 = [].concat((0, _toConsumableArray2.default)(state.routes), [{
|
|
2476
|
-
key: (_action$payload$key = action.payload.key) != null ? _action$payload$key : `${action.payload.name}-${(0, _$$_REQUIRE(_dependencyMap[3]).nanoid)()}`,
|
|
2477
|
-
name: action.payload.name,
|
|
2478
|
-
path: action.payload.path,
|
|
2479
|
-
params: routeParamList[action.payload.name] !== undefined ? Object.assign({}, routeParamList[action.payload.name], action.payload.params) : action.payload.params
|
|
2480
|
-
}]);
|
|
2481
|
-
return Object.assign({}, state, {
|
|
2482
|
-
routes: _routes2,
|
|
2483
|
-
index: _routes2.length - 1
|
|
2484
|
-
});
|
|
2485
|
-
}
|
|
2486
|
-
var _route = state.routes[_index2];
|
|
2487
|
-
var _params;
|
|
2488
|
-
if (action.payload.merge) {
|
|
2489
|
-
_params = action.payload.params !== undefined || routeParamList[_route.name] !== undefined ? Object.assign({}, routeParamList[_route.name], _route.params, action.payload.params) : _route.params;
|
|
2490
|
-
} else {
|
|
2491
|
-
_params = routeParamList[_route.name] !== undefined ? Object.assign({}, routeParamList[_route.name], action.payload.params) : action.payload.params;
|
|
2492
|
-
}
|
|
2493
|
-
return Object.assign({}, state, {
|
|
2494
|
-
index: _index2,
|
|
2495
|
-
routes: [].concat((0, _toConsumableArray2.default)(state.routes.slice(0, _index2)), [_params !== _route.params || action.payload.path && action.payload.path !== _route.path ? Object.assign({}, _route, {
|
|
2496
|
-
path: (_action$payload$path = action.payload.path) != null ? _action$payload$path : _route.path,
|
|
2497
|
-
params: _params
|
|
2498
|
-
}) : state.routes[_index2]])
|
|
2499
|
-
});
|
|
2500
|
-
}
|
|
2501
|
-
return null;
|
|
2502
|
-
case 'GO_BACK':
|
|
2503
|
-
if (state.index > 0) {
|
|
2504
|
-
return router.getStateForAction(state, {
|
|
2505
|
-
type: 'POP',
|
|
2506
|
-
payload: {
|
|
2507
|
-
count: 1
|
|
2508
|
-
},
|
|
2509
|
-
target: action.target,
|
|
2510
|
-
source: action.source
|
|
2511
|
-
}, options);
|
|
2512
|
-
}
|
|
2513
|
-
return null;
|
|
2514
|
-
default:
|
|
2515
|
-
return _BaseRouter.default.getStateForAction(state, action);
|
|
2516
|
-
}
|
|
2517
|
-
},
|
|
2518
|
-
actionCreators: StackActions
|
|
2519
|
-
});
|
|
2520
|
-
return router;
|
|
2521
|
-
}
|
|
2522
|
-
},"1d666e2a5547a2fa33f1",["277a84013d7e1a1ace05","838d7a057beeb5db50df","b02ddfcf5d1b27936f8d","e03db9aacb1ee503cd26"]);
|
|
2523
|
-
__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) {
|
|
2524
|
-
Object.defineProperty(exports, "__esModule", {
|
|
2525
|
-
value: true
|
|
2526
|
-
});
|
|
2527
|
-
var _exportNames = {
|
|
2528
|
-
CommonActions: true,
|
|
2529
|
-
BaseRouter: true,
|
|
2530
|
-
DrawerActions: true,
|
|
2531
|
-
DrawerRouter: true,
|
|
2532
|
-
StackActions: true,
|
|
2533
|
-
StackRouter: true,
|
|
2534
|
-
TabActions: true,
|
|
2535
|
-
TabRouter: true
|
|
2536
|
-
};
|
|
2537
|
-
Object.defineProperty(exports, "BaseRouter", {
|
|
2538
|
-
enumerable: true,
|
|
2539
|
-
get: function get() {
|
|
2540
|
-
return _BaseRouter.default;
|
|
2541
|
-
}
|
|
2542
|
-
});
|
|
2543
|
-
exports.CommonActions = undefined;
|
|
2544
|
-
Object.defineProperty(exports, "DrawerActions", {
|
|
2545
|
-
enumerable: true,
|
|
2546
|
-
get: function get() {
|
|
2547
|
-
return _DrawerRouter.DrawerActions;
|
|
2548
|
-
}
|
|
2549
|
-
});
|
|
2550
|
-
Object.defineProperty(exports, "DrawerRouter", {
|
|
2551
|
-
enumerable: true,
|
|
2552
|
-
get: function get() {
|
|
2553
|
-
return _DrawerRouter.default;
|
|
2554
|
-
}
|
|
2555
|
-
});
|
|
2556
|
-
Object.defineProperty(exports, "StackActions", {
|
|
2557
|
-
enumerable: true,
|
|
2558
|
-
get: function get() {
|
|
2559
|
-
return _StackRouter.StackActions;
|
|
2560
|
-
}
|
|
2561
|
-
});
|
|
2562
|
-
Object.defineProperty(exports, "StackRouter", {
|
|
2563
|
-
enumerable: true,
|
|
2564
|
-
get: function get() {
|
|
2565
|
-
return _StackRouter.default;
|
|
2566
|
-
}
|
|
2567
|
-
});
|
|
2568
|
-
Object.defineProperty(exports, "TabActions", {
|
|
2569
|
-
enumerable: true,
|
|
2570
|
-
get: function get() {
|
|
2571
|
-
return _TabRouter.TabActions;
|
|
2572
|
-
}
|
|
2573
|
-
});
|
|
2574
|
-
Object.defineProperty(exports, "TabRouter", {
|
|
2575
|
-
enumerable: true,
|
|
2576
|
-
get: function get() {
|
|
2577
|
-
return _TabRouter.default;
|
|
2578
|
-
}
|
|
2579
|
-
});
|
|
2580
|
-
var CommonActions = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[0]));
|
|
2581
|
-
exports.CommonActions = CommonActions;
|
|
2582
|
-
var _BaseRouter = _$$_REQUIRE(_dependencyMap[1])(_$$_REQUIRE(_dependencyMap[2]));
|
|
2583
|
-
var _DrawerRouter = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[3]));
|
|
2584
|
-
var _StackRouter = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[4]));
|
|
2585
|
-
var _TabRouter = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[5]));
|
|
2586
|
-
Object.keys(_$$_REQUIRE(_dependencyMap[6])).forEach(function (key) {
|
|
2587
|
-
if (key === "default" || key === "__esModule") return;
|
|
2588
|
-
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
2589
|
-
if (key in exports && exports[key] === _$$_REQUIRE(_dependencyMap[6])[key]) return;
|
|
2590
|
-
Object.defineProperty(exports, key, {
|
|
2591
|
-
enumerable: true,
|
|
2592
|
-
get: function get() {
|
|
2593
|
-
return _$$_REQUIRE(_dependencyMap[6])[key];
|
|
2594
|
-
}
|
|
2595
|
-
});
|
|
2596
|
-
});
|
|
2597
|
-
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
|
|
2598
|
-
},"e045dec1c8244fccaf7b",["6bfbc90eac4c2d2e67a4","277a84013d7e1a1ace05","b02ddfcf5d1b27936f8d","36b338faa6c2364d674f","1d666e2a5547a2fa33f1","88d6ccdfe66b5db63cff","12c309785643d3823400"]);
|
|
2599
|
-
__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) {
|
|
2600
|
-
Object.defineProperty(exports, "__esModule", {
|
|
2601
|
-
value: true
|
|
2602
|
-
});
|
|
2603
|
-
},"12c309785643d3823400",[]);
|
|
2604
|
-
__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) {
|
|
2605
|
-
Object.defineProperty(exports, "__esModule", {
|
|
2606
|
-
value: true
|
|
2607
|
-
});
|
|
2608
|
-
exports.default = undefined;
|
|
2609
|
-
/**
|
|
2610
|
-
* Base router object that can be used when writing custom routers.
|
|
2611
|
-
* This provides few helper methods to handle common actions such as `RESET`.
|
|
2612
|
-
*/
|
|
2613
|
-
var BaseRouter = {
|
|
2614
|
-
getStateForAction: function getStateForAction(state, action) {
|
|
2615
|
-
switch (action.type) {
|
|
2616
|
-
case 'SET_PARAMS':
|
|
2617
|
-
{
|
|
2618
|
-
var index = action.source ? state.routes.findIndex(function (r) {
|
|
2619
|
-
return r.key === action.source;
|
|
2620
|
-
}) : state.index;
|
|
2621
|
-
if (index === -1) {
|
|
2622
|
-
return null;
|
|
2623
|
-
}
|
|
2624
|
-
return Object.assign({}, state, {
|
|
2625
|
-
routes: state.routes.map(function (r, i) {
|
|
2626
|
-
return i === index ? Object.assign({}, r, {
|
|
2627
|
-
params: Object.assign({}, r.params, action.payload.params)
|
|
2628
|
-
}) : r;
|
|
2629
|
-
})
|
|
2630
|
-
});
|
|
2631
|
-
}
|
|
2632
|
-
case 'RESET':
|
|
2633
|
-
{
|
|
2634
|
-
var nextState = action.payload;
|
|
2635
|
-
if (nextState.routes.length === 0 || nextState.routes.some(function (route) {
|
|
2636
|
-
return !state.routeNames.includes(route.name);
|
|
2637
|
-
})) {
|
|
2638
|
-
return null;
|
|
2639
|
-
}
|
|
2640
|
-
if (nextState.stale === false) {
|
|
2641
|
-
if (state.routeNames.length !== nextState.routeNames.length || nextState.routeNames.some(function (name) {
|
|
2642
|
-
return !state.routeNames.includes(name);
|
|
2643
|
-
})) {
|
|
2644
|
-
return null;
|
|
2645
|
-
}
|
|
2646
|
-
return Object.assign({}, nextState, {
|
|
2647
|
-
routes: nextState.routes.map(function (route) {
|
|
2648
|
-
return route.key ? route : Object.assign({}, route, {
|
|
2649
|
-
key: `${route.name}-${(0, _$$_REQUIRE(_dependencyMap[0]).nanoid)()}`
|
|
2650
|
-
});
|
|
2651
|
-
})
|
|
2652
|
-
});
|
|
2653
|
-
}
|
|
2654
|
-
return nextState;
|
|
2655
|
-
}
|
|
2656
|
-
default:
|
|
2657
|
-
return null;
|
|
2658
|
-
}
|
|
2659
|
-
},
|
|
2660
|
-
shouldActionChangeFocus: function shouldActionChangeFocus(action) {
|
|
2661
|
-
return action.type === 'NAVIGATE';
|
|
2662
|
-
}
|
|
2663
|
-
};
|
|
2664
|
-
var _default = exports.default = BaseRouter;
|
|
2665
|
-
},"cc50ab09498b013d1d6d",["e03db9aacb1ee503cd26"]);
|
|
2666
|
-
__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) {
|
|
2667
|
-
Object.defineProperty(exports, "__esModule", {
|
|
2668
|
-
value: true
|
|
2669
|
-
});
|
|
2670
|
-
exports.goBack = goBack;
|
|
2671
|
-
exports.navigate = navigate;
|
|
2672
|
-
exports.reset = reset;
|
|
2673
|
-
exports.setParams = setParams;
|
|
2674
|
-
function goBack() {
|
|
2675
|
-
return {
|
|
2676
|
-
type: 'GO_BACK'
|
|
2677
|
-
};
|
|
2678
|
-
}
|
|
2679
|
-
|
|
2680
|
-
// eslint-disable-next-line no-redeclare
|
|
2681
|
-
|
|
2682
|
-
// eslint-disable-next-line no-redeclare
|
|
2683
|
-
function navigate() {
|
|
2684
|
-
if (typeof (arguments.length <= 0 ? undefined : arguments[0]) === 'string') {
|
|
2685
|
-
return {
|
|
2686
|
-
type: 'NAVIGATE',
|
|
2687
|
-
payload: {
|
|
2688
|
-
name: arguments.length <= 0 ? undefined : arguments[0],
|
|
2689
|
-
params: arguments.length <= 1 ? undefined : arguments[1]
|
|
2690
|
-
}
|
|
2691
|
-
};
|
|
2692
|
-
} else {
|
|
2693
|
-
var payload = (arguments.length <= 0 ? undefined : arguments[0]) || {};
|
|
2694
|
-
if (!payload.hasOwnProperty('key') && !payload.hasOwnProperty('name')) {
|
|
2695
|
-
throw new Error('You need to specify name or key when calling navigate with an object as the argument. See https://reactnavigation.org/docs/navigation-actions#navigate for usage.');
|
|
2696
|
-
}
|
|
2697
|
-
return {
|
|
2698
|
-
type: 'NAVIGATE',
|
|
2699
|
-
payload: payload
|
|
2700
|
-
};
|
|
2701
|
-
}
|
|
2702
|
-
}
|
|
2703
|
-
function reset(state) {
|
|
2704
|
-
return {
|
|
2705
|
-
type: 'RESET',
|
|
2706
|
-
payload: state
|
|
2707
|
-
};
|
|
2708
|
-
}
|
|
2709
|
-
function setParams(params) {
|
|
2710
|
-
return {
|
|
2711
|
-
type: 'SET_PARAMS',
|
|
2712
|
-
payload: {
|
|
2713
|
-
params: params
|
|
2714
|
-
}
|
|
2715
|
-
};
|
|
2716
|
-
}
|
|
2717
|
-
},"000944072e226c3923ad",[]);
|
|
2718
|
-
__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) {
|
|
2719
|
-
Object.defineProperty(exports, "__esModule", {
|
|
2720
|
-
value: true
|
|
2721
|
-
});
|
|
2722
|
-
exports.DrawerActions = undefined;
|
|
2723
|
-
exports.default = DrawerRouter;
|
|
2724
|
-
var _toConsumableArray2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1]));
|
|
2725
|
-
var _objectWithoutProperties2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2]));
|
|
2726
|
-
var _TabRouter = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[3]));
|
|
2727
|
-
var _excluded = ["defaultStatus"];
|
|
2728
|
-
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
|
|
2729
|
-
var DrawerActions = exports.DrawerActions = Object.assign({}, _TabRouter.TabActions, {
|
|
2730
|
-
openDrawer: function openDrawer() {
|
|
2731
|
-
return {
|
|
2732
|
-
type: 'OPEN_DRAWER'
|
|
2733
|
-
};
|
|
2734
|
-
},
|
|
2735
|
-
closeDrawer: function closeDrawer() {
|
|
2736
|
-
return {
|
|
2737
|
-
type: 'CLOSE_DRAWER'
|
|
2738
|
-
};
|
|
2739
|
-
},
|
|
2740
|
-
toggleDrawer: function toggleDrawer() {
|
|
2741
|
-
return {
|
|
2742
|
-
type: 'TOGGLE_DRAWER'
|
|
2743
|
-
};
|
|
2744
|
-
}
|
|
2745
|
-
});
|
|
2746
|
-
function DrawerRouter(_ref) {
|
|
2747
|
-
var _ref$defaultStatus = _ref.defaultStatus,
|
|
2748
|
-
defaultStatus = _ref$defaultStatus === undefined ? 'closed' : _ref$defaultStatus,
|
|
2749
|
-
rest = (0, _objectWithoutProperties2.default)(_ref, _excluded);
|
|
2750
|
-
var router = (0, _TabRouter.default)(rest);
|
|
2751
|
-
var isDrawerInHistory = function isDrawerInHistory(state) {
|
|
2752
|
-
var _state$history;
|
|
2753
|
-
return Boolean((_state$history = state.history) == null ? undefined : _state$history.some(function (it) {
|
|
2754
|
-
return it.type === 'drawer';
|
|
2755
|
-
}));
|
|
2756
|
-
};
|
|
2757
|
-
var addDrawerToHistory = function addDrawerToHistory(state) {
|
|
2758
|
-
if (isDrawerInHistory(state)) {
|
|
2759
|
-
return state;
|
|
2760
|
-
}
|
|
2761
|
-
return Object.assign({}, state, {
|
|
2762
|
-
history: [].concat((0, _toConsumableArray2.default)(state.history), [{
|
|
2763
|
-
type: 'drawer',
|
|
2764
|
-
status: defaultStatus === 'open' ? 'closed' : 'open'
|
|
2765
|
-
}])
|
|
2766
|
-
});
|
|
2767
|
-
};
|
|
2768
|
-
var removeDrawerFromHistory = function removeDrawerFromHistory(state) {
|
|
2769
|
-
if (!isDrawerInHistory(state)) {
|
|
2770
|
-
return state;
|
|
2771
|
-
}
|
|
2772
|
-
return Object.assign({}, state, {
|
|
2773
|
-
history: state.history.filter(function (it) {
|
|
2774
|
-
return it.type !== 'drawer';
|
|
2775
|
-
})
|
|
2776
|
-
});
|
|
2777
|
-
};
|
|
2778
|
-
var openDrawer = function openDrawer(state) {
|
|
2779
|
-
if (defaultStatus === 'open') {
|
|
2780
|
-
return removeDrawerFromHistory(state);
|
|
2781
|
-
}
|
|
2782
|
-
return addDrawerToHistory(state);
|
|
2783
|
-
};
|
|
2784
|
-
var closeDrawer = function closeDrawer(state) {
|
|
2785
|
-
if (defaultStatus === 'open') {
|
|
2786
|
-
return addDrawerToHistory(state);
|
|
2787
|
-
}
|
|
2788
|
-
return removeDrawerFromHistory(state);
|
|
2789
|
-
};
|
|
2790
|
-
return Object.assign({}, router, {
|
|
2791
|
-
type: 'drawer',
|
|
2792
|
-
getInitialState: function getInitialState(_ref2) {
|
|
2793
|
-
var routeNames = _ref2.routeNames,
|
|
2794
|
-
routeParamList = _ref2.routeParamList,
|
|
2795
|
-
routeGetIdList = _ref2.routeGetIdList;
|
|
2796
|
-
var state = router.getInitialState({
|
|
2797
|
-
routeNames: routeNames,
|
|
2798
|
-
routeParamList: routeParamList,
|
|
2799
|
-
routeGetIdList: routeGetIdList
|
|
2800
|
-
});
|
|
2801
|
-
return Object.assign({}, state, {
|
|
2802
|
-
default: defaultStatus,
|
|
2803
|
-
stale: false,
|
|
2804
|
-
type: 'drawer',
|
|
2805
|
-
key: `drawer-${(0, _$$_REQUIRE(_dependencyMap[4]).nanoid)()}`
|
|
2806
|
-
});
|
|
2807
|
-
},
|
|
2808
|
-
getRehydratedState: function getRehydratedState(partialState, _ref3) {
|
|
2809
|
-
var routeNames = _ref3.routeNames,
|
|
2810
|
-
routeParamList = _ref3.routeParamList,
|
|
2811
|
-
routeGetIdList = _ref3.routeGetIdList;
|
|
2812
|
-
if (partialState.stale === false) {
|
|
2813
|
-
return partialState;
|
|
2814
|
-
}
|
|
2815
|
-
var state = router.getRehydratedState(partialState, {
|
|
2816
|
-
routeNames: routeNames,
|
|
2817
|
-
routeParamList: routeParamList,
|
|
2818
|
-
routeGetIdList: routeGetIdList
|
|
2819
|
-
});
|
|
2820
|
-
if (isDrawerInHistory(partialState)) {
|
|
2821
|
-
// Re-sync the drawer entry in history to correct it if it was wrong
|
|
2822
|
-
state = removeDrawerFromHistory(state);
|
|
2823
|
-
state = addDrawerToHistory(state);
|
|
2824
|
-
}
|
|
2825
|
-
return Object.assign({}, state, {
|
|
2826
|
-
default: defaultStatus,
|
|
2827
|
-
type: 'drawer',
|
|
2828
|
-
key: `drawer-${(0, _$$_REQUIRE(_dependencyMap[4]).nanoid)()}`
|
|
2829
|
-
});
|
|
2830
|
-
},
|
|
2831
|
-
getStateForRouteFocus: function getStateForRouteFocus(state, key) {
|
|
2832
|
-
var result = router.getStateForRouteFocus(state, key);
|
|
2833
|
-
return closeDrawer(result);
|
|
2834
|
-
},
|
|
2835
|
-
getStateForAction: function getStateForAction(state, action, options) {
|
|
2836
|
-
switch (action.type) {
|
|
2837
|
-
case 'OPEN_DRAWER':
|
|
2838
|
-
return openDrawer(state);
|
|
2839
|
-
case 'CLOSE_DRAWER':
|
|
2840
|
-
return closeDrawer(state);
|
|
2841
|
-
case 'TOGGLE_DRAWER':
|
|
2842
|
-
if (isDrawerInHistory(state)) {
|
|
2843
|
-
return removeDrawerFromHistory(state);
|
|
2844
|
-
}
|
|
2845
|
-
return addDrawerToHistory(state);
|
|
2846
|
-
case 'JUMP_TO':
|
|
2847
|
-
case 'NAVIGATE':
|
|
2848
|
-
{
|
|
2849
|
-
var result = router.getStateForAction(state, action, options);
|
|
2850
|
-
if (result != null && result.index !== state.index) {
|
|
2851
|
-
return closeDrawer(result);
|
|
2852
|
-
}
|
|
2853
|
-
return result;
|
|
2854
|
-
}
|
|
2855
|
-
case 'GO_BACK':
|
|
2856
|
-
if (isDrawerInHistory(state)) {
|
|
2857
|
-
return removeDrawerFromHistory(state);
|
|
2858
|
-
}
|
|
2859
|
-
return router.getStateForAction(state, action, options);
|
|
2860
|
-
default:
|
|
2861
|
-
return router.getStateForAction(state, action, options);
|
|
2862
|
-
}
|
|
2863
|
-
},
|
|
2864
|
-
actionCreators: DrawerActions
|
|
2865
|
-
});
|
|
2866
|
-
}
|
|
2867
|
-
},"a84ba97c7150cdcf5967",["277a84013d7e1a1ace05","838d7a057beeb5db50df","a2c8e692f78bae5b8b98","b409790239ad0cd46252","e03db9aacb1ee503cd26"]);
|
|
2868
|
-
__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) {
|
|
2869
|
-
Object.defineProperty(exports, "__esModule", {
|
|
2870
|
-
value: true
|
|
2871
|
-
});
|
|
2872
|
-
exports.TabActions = undefined;
|
|
2873
|
-
exports.default = TabRouter;
|
|
2874
|
-
var _BaseRouter = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1]));
|
|
2875
|
-
var TYPE_ROUTE = 'route';
|
|
2876
|
-
var TabActions = exports.TabActions = {
|
|
2877
|
-
jumpTo: function jumpTo(name, params) {
|
|
2878
|
-
return {
|
|
2879
|
-
type: 'JUMP_TO',
|
|
2880
|
-
payload: {
|
|
2881
|
-
name: name,
|
|
2882
|
-
params: params
|
|
2883
|
-
}
|
|
2884
|
-
};
|
|
2885
|
-
}
|
|
2886
|
-
};
|
|
2887
|
-
var getRouteHistory = function getRouteHistory(routes, index, backBehavior, initialRouteName) {
|
|
2888
|
-
var history = [{
|
|
2889
|
-
type: TYPE_ROUTE,
|
|
2890
|
-
key: routes[index].key
|
|
2891
|
-
}];
|
|
2892
|
-
var initialRouteIndex;
|
|
2893
|
-
switch (backBehavior) {
|
|
2894
|
-
case 'order':
|
|
2895
|
-
for (var i = index; i > 0; i--) {
|
|
2896
|
-
history.unshift({
|
|
2897
|
-
type: TYPE_ROUTE,
|
|
2898
|
-
key: routes[i - 1].key
|
|
2899
|
-
});
|
|
2900
|
-
}
|
|
2901
|
-
break;
|
|
2902
|
-
case 'firstRoute':
|
|
2903
|
-
if (index !== 0) {
|
|
2904
|
-
history.unshift({
|
|
2905
|
-
type: TYPE_ROUTE,
|
|
2906
|
-
key: routes[0].key
|
|
2907
|
-
});
|
|
2908
|
-
}
|
|
2909
|
-
break;
|
|
2910
|
-
case 'initialRoute':
|
|
2911
|
-
initialRouteIndex = routes.findIndex(function (route) {
|
|
2912
|
-
return route.name === initialRouteName;
|
|
2913
|
-
});
|
|
2914
|
-
initialRouteIndex = initialRouteIndex === -1 ? 0 : initialRouteIndex;
|
|
2915
|
-
if (index !== initialRouteIndex) {
|
|
2916
|
-
history.unshift({
|
|
2917
|
-
type: TYPE_ROUTE,
|
|
2918
|
-
key: routes[initialRouteIndex].key
|
|
2919
|
-
});
|
|
2920
|
-
}
|
|
2921
|
-
break;
|
|
2922
|
-
case 'history':
|
|
2923
|
-
// The history will fill up on navigation
|
|
2924
|
-
break;
|
|
2925
|
-
}
|
|
2926
|
-
return history;
|
|
2927
|
-
};
|
|
2928
|
-
var changeIndex = function changeIndex(state, index, backBehavior, initialRouteName) {
|
|
2929
|
-
var history;
|
|
2930
|
-
if (backBehavior === 'history') {
|
|
2931
|
-
var currentKey = state.routes[index].key;
|
|
2932
|
-
history = state.history.filter(function (it) {
|
|
2933
|
-
return it.type === 'route' ? it.key !== currentKey : false;
|
|
2934
|
-
}).concat({
|
|
2935
|
-
type: TYPE_ROUTE,
|
|
2936
|
-
key: currentKey
|
|
2937
|
-
});
|
|
2938
|
-
} else {
|
|
2939
|
-
history = getRouteHistory(state.routes, index, backBehavior, initialRouteName);
|
|
2940
|
-
}
|
|
2941
|
-
return Object.assign({}, state, {
|
|
2942
|
-
index: index,
|
|
2943
|
-
history: history
|
|
2944
|
-
});
|
|
2945
|
-
};
|
|
2946
|
-
function TabRouter(_ref) {
|
|
2947
|
-
var initialRouteName = _ref.initialRouteName,
|
|
2948
|
-
_ref$backBehavior = _ref.backBehavior,
|
|
2949
|
-
backBehavior = _ref$backBehavior === undefined ? 'firstRoute' : _ref$backBehavior;
|
|
2950
|
-
var router = Object.assign({}, _BaseRouter.default, {
|
|
2951
|
-
type: 'tab',
|
|
2952
|
-
getInitialState: function getInitialState(_ref2) {
|
|
2953
|
-
var routeNames = _ref2.routeNames,
|
|
2954
|
-
routeParamList = _ref2.routeParamList;
|
|
2955
|
-
var index = initialRouteName !== undefined && routeNames.includes(initialRouteName) ? routeNames.indexOf(initialRouteName) : 0;
|
|
2956
|
-
var routes = routeNames.map(function (name) {
|
|
2957
|
-
return {
|
|
2958
|
-
name: name,
|
|
2959
|
-
key: `${name}-${(0, _$$_REQUIRE(_dependencyMap[2]).nanoid)()}`,
|
|
2960
|
-
params: routeParamList[name]
|
|
2961
|
-
};
|
|
2962
|
-
});
|
|
2963
|
-
var history = getRouteHistory(routes, index, backBehavior, initialRouteName);
|
|
2964
|
-
return {
|
|
2965
|
-
stale: false,
|
|
2966
|
-
type: 'tab',
|
|
2967
|
-
key: `tab-${(0, _$$_REQUIRE(_dependencyMap[2]).nanoid)()}`,
|
|
2968
|
-
index: index,
|
|
2969
|
-
routeNames: routeNames,
|
|
2970
|
-
history: history,
|
|
2971
|
-
routes: routes
|
|
2972
|
-
};
|
|
2973
|
-
},
|
|
2974
|
-
getRehydratedState: function getRehydratedState(partialState, _ref3) {
|
|
2975
|
-
var _state$routes, _state$index, _state$history$filter, _state$history;
|
|
2976
|
-
var routeNames = _ref3.routeNames,
|
|
2977
|
-
routeParamList = _ref3.routeParamList;
|
|
2978
|
-
var state = partialState;
|
|
2979
|
-
if (state.stale === false) {
|
|
2980
|
-
return state;
|
|
2981
|
-
}
|
|
2982
|
-
var routes = routeNames.map(function (name) {
|
|
2983
|
-
var route = state.routes.find(function (r) {
|
|
2984
|
-
return r.name === name;
|
|
2985
|
-
});
|
|
2986
|
-
return Object.assign({}, route, {
|
|
2987
|
-
name: name,
|
|
2988
|
-
key: route && route.name === name && route.key ? route.key : `${name}-${(0, _$$_REQUIRE(_dependencyMap[2]).nanoid)()}`,
|
|
2989
|
-
params: routeParamList[name] !== undefined ? Object.assign({}, routeParamList[name], route ? route.params : undefined) : route ? route.params : undefined
|
|
2990
|
-
});
|
|
2991
|
-
});
|
|
2992
|
-
var index = Math.min(Math.max(routeNames.indexOf((_state$routes = state.routes[(_state$index = state == null ? undefined : state.index) != null ? _state$index : 0]) == null ? undefined : _state$routes.name), 0), routes.length - 1);
|
|
2993
|
-
var history = (_state$history$filter = (_state$history = state.history) == null ? undefined : _state$history.filter(function (it) {
|
|
2994
|
-
return routes.find(function (r) {
|
|
2995
|
-
return r.key === it.key;
|
|
2996
|
-
});
|
|
2997
|
-
})) != null ? _state$history$filter : [];
|
|
2998
|
-
return changeIndex({
|
|
2999
|
-
stale: false,
|
|
3000
|
-
type: 'tab',
|
|
3001
|
-
key: `tab-${(0, _$$_REQUIRE(_dependencyMap[2]).nanoid)()}`,
|
|
3002
|
-
index: index,
|
|
3003
|
-
routeNames: routeNames,
|
|
3004
|
-
history: history,
|
|
3005
|
-
routes: routes
|
|
3006
|
-
}, index, backBehavior, initialRouteName);
|
|
3007
|
-
},
|
|
3008
|
-
getStateForRouteNamesChange: function getStateForRouteNamesChange(state, _ref4) {
|
|
3009
|
-
var routeNames = _ref4.routeNames,
|
|
3010
|
-
routeParamList = _ref4.routeParamList,
|
|
3011
|
-
routeKeyChanges = _ref4.routeKeyChanges;
|
|
3012
|
-
var routes = routeNames.map(function (name) {
|
|
3013
|
-
return state.routes.find(function (r) {
|
|
3014
|
-
return r.name === name && !routeKeyChanges.includes(r.name);
|
|
3015
|
-
}) || {
|
|
3016
|
-
name: name,
|
|
3017
|
-
key: `${name}-${(0, _$$_REQUIRE(_dependencyMap[2]).nanoid)()}`,
|
|
3018
|
-
params: routeParamList[name]
|
|
3019
|
-
};
|
|
3020
|
-
});
|
|
3021
|
-
var index = Math.max(0, routeNames.indexOf(state.routes[state.index].name));
|
|
3022
|
-
var history = state.history.filter(
|
|
3023
|
-
// Type will always be 'route' for tabs, but could be different in a router extending this (e.g. drawer)
|
|
3024
|
-
function (it) {
|
|
3025
|
-
return it.type !== 'route' || routes.find(function (r) {
|
|
3026
|
-
return r.key === it.key;
|
|
3027
|
-
});
|
|
3028
|
-
});
|
|
3029
|
-
if (!history.length) {
|
|
3030
|
-
history = getRouteHistory(routes, index, backBehavior, initialRouteName);
|
|
3031
|
-
}
|
|
3032
|
-
return Object.assign({}, state, {
|
|
3033
|
-
history: history,
|
|
3034
|
-
routeNames: routeNames,
|
|
3035
|
-
routes: routes,
|
|
3036
|
-
index: index
|
|
3037
|
-
});
|
|
3038
|
-
},
|
|
3039
|
-
getStateForRouteFocus: function getStateForRouteFocus(state, key) {
|
|
3040
|
-
var index = state.routes.findIndex(function (r) {
|
|
3041
|
-
return r.key === key;
|
|
3042
|
-
});
|
|
3043
|
-
if (index === -1 || index === state.index) {
|
|
3044
|
-
return state;
|
|
3045
|
-
}
|
|
3046
|
-
return changeIndex(state, index, backBehavior, initialRouteName);
|
|
3047
|
-
},
|
|
3048
|
-
getStateForAction: function getStateForAction(state, action, _ref5) {
|
|
3049
|
-
var routeParamList = _ref5.routeParamList,
|
|
3050
|
-
routeGetIdList = _ref5.routeGetIdList;
|
|
3051
|
-
switch (action.type) {
|
|
3052
|
-
case 'JUMP_TO':
|
|
3053
|
-
case 'NAVIGATE':
|
|
3054
|
-
{
|
|
3055
|
-
var index = -1;
|
|
3056
|
-
if (action.type === 'NAVIGATE' && action.payload.key) {
|
|
3057
|
-
index = state.routes.findIndex(function (route) {
|
|
3058
|
-
return route.key === action.payload.key;
|
|
3059
|
-
});
|
|
3060
|
-
} else {
|
|
3061
|
-
index = state.routes.findIndex(function (route) {
|
|
3062
|
-
return route.name === action.payload.name;
|
|
3063
|
-
});
|
|
3064
|
-
}
|
|
3065
|
-
if (index === -1) {
|
|
3066
|
-
return null;
|
|
3067
|
-
}
|
|
3068
|
-
return changeIndex(Object.assign({}, state, {
|
|
3069
|
-
routes: state.routes.map(function (route, i) {
|
|
3070
|
-
if (i !== index) {
|
|
3071
|
-
return route;
|
|
3072
|
-
}
|
|
3073
|
-
var getId = routeGetIdList[route.name];
|
|
3074
|
-
var currentId = getId == null ? undefined : getId({
|
|
3075
|
-
params: route.params
|
|
3076
|
-
});
|
|
3077
|
-
var nextId = getId == null ? undefined : getId({
|
|
3078
|
-
params: action.payload.params
|
|
3079
|
-
});
|
|
3080
|
-
var key = currentId === nextId ? route.key : `${route.name}-${(0, _$$_REQUIRE(_dependencyMap[2]).nanoid)()}`;
|
|
3081
|
-
var params;
|
|
3082
|
-
if (action.type === 'NAVIGATE' && action.payload.merge && currentId === nextId) {
|
|
3083
|
-
params = action.payload.params !== undefined || routeParamList[route.name] !== undefined ? Object.assign({}, routeParamList[route.name], route.params, action.payload.params) : route.params;
|
|
3084
|
-
} else {
|
|
3085
|
-
params = routeParamList[route.name] !== undefined ? Object.assign({}, routeParamList[route.name], action.payload.params) : action.payload.params;
|
|
3086
|
-
}
|
|
3087
|
-
var path = action.type === 'NAVIGATE' && action.payload.path != null ? action.payload.path : route.path;
|
|
3088
|
-
return params !== route.params || path !== route.path ? Object.assign({}, route, {
|
|
3089
|
-
key: key,
|
|
3090
|
-
path: path,
|
|
3091
|
-
params: params
|
|
3092
|
-
}) : route;
|
|
3093
|
-
})
|
|
3094
|
-
}), index, backBehavior, initialRouteName);
|
|
3095
|
-
}
|
|
3096
|
-
case 'GO_BACK':
|
|
3097
|
-
{
|
|
3098
|
-
if (state.history.length === 1) {
|
|
3099
|
-
return null;
|
|
3100
|
-
}
|
|
3101
|
-
var previousKey = state.history[state.history.length - 2].key;
|
|
3102
|
-
var _index = state.routes.findIndex(function (route) {
|
|
3103
|
-
return route.key === previousKey;
|
|
3104
|
-
});
|
|
3105
|
-
if (_index === -1) {
|
|
3106
|
-
return null;
|
|
3107
|
-
}
|
|
3108
|
-
return Object.assign({}, state, {
|
|
3109
|
-
history: state.history.slice(0, -1),
|
|
3110
|
-
index: _index
|
|
3111
|
-
});
|
|
3112
|
-
}
|
|
3113
|
-
default:
|
|
3114
|
-
return _BaseRouter.default.getStateForAction(state, action);
|
|
3115
|
-
}
|
|
3116
|
-
},
|
|
3117
|
-
shouldActionChangeFocus: function shouldActionChangeFocus(action) {
|
|
3118
|
-
return action.type === 'NAVIGATE';
|
|
3119
|
-
},
|
|
3120
|
-
actionCreators: TabActions
|
|
3121
|
-
});
|
|
3122
|
-
return router;
|
|
3123
|
-
}
|
|
3124
|
-
},"b409790239ad0cd46252",["277a84013d7e1a1ace05","cc50ab09498b013d1d6d","e03db9aacb1ee503cd26"]);
|
|
3125
|
-
__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) {
|
|
3126
|
-
Object.defineProperty(exports, "__esModule", {
|
|
3127
|
-
value: true
|
|
3128
|
-
});
|
|
3129
|
-
exports.StackActions = undefined;
|
|
3130
|
-
exports.default = StackRouter;
|
|
3131
|
-
var _toConsumableArray2 = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[1]));
|
|
3132
|
-
var _BaseRouter = _$$_REQUIRE(_dependencyMap[0])(_$$_REQUIRE(_dependencyMap[2]));
|
|
3133
|
-
var StackActions = exports.StackActions = {
|
|
3134
|
-
replace: function replace(name, params) {
|
|
3135
|
-
return {
|
|
3136
|
-
type: 'REPLACE',
|
|
3137
|
-
payload: {
|
|
3138
|
-
name: name,
|
|
3139
|
-
params: params
|
|
3140
|
-
}
|
|
3141
|
-
};
|
|
3142
|
-
},
|
|
3143
|
-
push: function push(name, params) {
|
|
3144
|
-
return {
|
|
3145
|
-
type: 'PUSH',
|
|
3146
|
-
payload: {
|
|
3147
|
-
name: name,
|
|
3148
|
-
params: params
|
|
3149
|
-
}
|
|
3150
|
-
};
|
|
3151
|
-
},
|
|
3152
|
-
pop: function pop() {
|
|
3153
|
-
var count = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 1;
|
|
3154
|
-
return {
|
|
3155
|
-
type: 'POP',
|
|
3156
|
-
payload: {
|
|
3157
|
-
count: count
|
|
3158
|
-
}
|
|
3159
|
-
};
|
|
3160
|
-
},
|
|
3161
|
-
popToTop: function popToTop() {
|
|
3162
|
-
return {
|
|
3163
|
-
type: 'POP_TO_TOP'
|
|
3164
|
-
};
|
|
3165
|
-
}
|
|
3166
|
-
};
|
|
3167
|
-
function StackRouter(options) {
|
|
3168
|
-
var router = Object.assign({}, _BaseRouter.default, {
|
|
3169
|
-
type: 'stack',
|
|
3170
|
-
getInitialState: function getInitialState(_ref) {
|
|
3171
|
-
var routeNames = _ref.routeNames,
|
|
3172
|
-
routeParamList = _ref.routeParamList;
|
|
3173
|
-
var initialRouteName = options.initialRouteName !== undefined && routeNames.includes(options.initialRouteName) ? options.initialRouteName : routeNames[0];
|
|
3174
|
-
return {
|
|
3175
|
-
stale: false,
|
|
3176
|
-
type: 'stack',
|
|
3177
|
-
key: `stack-${(0, _$$_REQUIRE(_dependencyMap[3]).nanoid)()}`,
|
|
3178
|
-
index: 0,
|
|
3179
|
-
routeNames: routeNames,
|
|
3180
|
-
routes: [{
|
|
3181
|
-
key: `${initialRouteName}-${(0, _$$_REQUIRE(_dependencyMap[3]).nanoid)()}`,
|
|
3182
|
-
name: initialRouteName,
|
|
3183
|
-
params: routeParamList[initialRouteName]
|
|
3184
|
-
}]
|
|
3185
|
-
};
|
|
3186
|
-
},
|
|
3187
|
-
getRehydratedState: function getRehydratedState(partialState, _ref2) {
|
|
3188
|
-
var routeNames = _ref2.routeNames,
|
|
3189
|
-
routeParamList = _ref2.routeParamList;
|
|
3190
|
-
var state = partialState;
|
|
3191
|
-
if (state.stale === false) {
|
|
3192
|
-
return state;
|
|
3193
|
-
}
|
|
3194
|
-
var routes = state.routes.filter(function (route) {
|
|
3195
|
-
return routeNames.includes(route.name);
|
|
3196
|
-
}).map(function (route) {
|
|
3197
|
-
return Object.assign({}, route, {
|
|
3198
|
-
key: route.key || `${route.name}-${(0, _$$_REQUIRE(_dependencyMap[3]).nanoid)()}`,
|
|
3199
|
-
params: routeParamList[route.name] !== undefined ? Object.assign({}, routeParamList[route.name], route.params) : route.params
|
|
3200
|
-
});
|
|
3201
|
-
});
|
|
3202
|
-
if (routes.length === 0) {
|
|
3203
|
-
var initialRouteName = options.initialRouteName !== undefined ? options.initialRouteName : routeNames[0];
|
|
3204
|
-
routes.push({
|
|
3205
|
-
key: `${initialRouteName}-${(0, _$$_REQUIRE(_dependencyMap[3]).nanoid)()}`,
|
|
3206
|
-
name: initialRouteName,
|
|
3207
|
-
params: routeParamList[initialRouteName]
|
|
3208
|
-
});
|
|
3209
|
-
}
|
|
3210
|
-
return {
|
|
3211
|
-
stale: false,
|
|
3212
|
-
type: 'stack',
|
|
3213
|
-
key: `stack-${(0, _$$_REQUIRE(_dependencyMap[3]).nanoid)()}`,
|
|
3214
|
-
index: routes.length - 1,
|
|
3215
|
-
routeNames: routeNames,
|
|
3216
|
-
routes: routes
|
|
3217
|
-
};
|
|
3218
|
-
},
|
|
3219
|
-
getStateForRouteNamesChange: function getStateForRouteNamesChange(state, _ref3) {
|
|
3220
|
-
var routeNames = _ref3.routeNames,
|
|
3221
|
-
routeParamList = _ref3.routeParamList,
|
|
3222
|
-
routeKeyChanges = _ref3.routeKeyChanges;
|
|
3223
|
-
var routes = state.routes.filter(function (route) {
|
|
3224
|
-
return routeNames.includes(route.name) && !routeKeyChanges.includes(route.name);
|
|
3225
|
-
});
|
|
3226
|
-
if (routes.length === 0) {
|
|
3227
|
-
var initialRouteName = options.initialRouteName !== undefined && routeNames.includes(options.initialRouteName) ? options.initialRouteName : routeNames[0];
|
|
3228
|
-
routes.push({
|
|
3229
|
-
key: `${initialRouteName}-${(0, _$$_REQUIRE(_dependencyMap[3]).nanoid)()}`,
|
|
3230
|
-
name: initialRouteName,
|
|
3231
|
-
params: routeParamList[initialRouteName]
|
|
3232
|
-
});
|
|
3233
|
-
}
|
|
3234
|
-
return Object.assign({}, state, {
|
|
3235
|
-
routeNames: routeNames,
|
|
3236
|
-
routes: routes,
|
|
3237
|
-
index: Math.min(state.index, routes.length - 1)
|
|
3238
|
-
});
|
|
3239
|
-
},
|
|
3240
|
-
getStateForRouteFocus: function getStateForRouteFocus(state, key) {
|
|
3241
|
-
var index = state.routes.findIndex(function (r) {
|
|
3242
|
-
return r.key === key;
|
|
3243
|
-
});
|
|
3244
|
-
if (index === -1 || index === state.index) {
|
|
3245
|
-
return state;
|
|
3246
|
-
}
|
|
3247
|
-
return Object.assign({}, state, {
|
|
3248
|
-
index: index,
|
|
3249
|
-
routes: state.routes.slice(0, index + 1)
|
|
3250
|
-
});
|
|
3251
|
-
},
|
|
3252
|
-
getStateForAction: function getStateForAction(state, action, options) {
|
|
3253
|
-
var routeParamList = options.routeParamList;
|
|
3254
|
-
switch (action.type) {
|
|
3255
|
-
case 'REPLACE':
|
|
3256
|
-
{
|
|
3257
|
-
var index = action.target === state.key && action.source ? state.routes.findIndex(function (r) {
|
|
3258
|
-
return r.key === action.source;
|
|
3259
|
-
}) : state.index;
|
|
3260
|
-
if (index === -1) {
|
|
3261
|
-
return null;
|
|
3262
|
-
}
|
|
3263
|
-
var _action$payload = action.payload,
|
|
3264
|
-
name = _action$payload.name,
|
|
3265
|
-
key = _action$payload.key,
|
|
3266
|
-
params = _action$payload.params;
|
|
3267
|
-
if (!state.routeNames.includes(name)) {
|
|
3268
|
-
return null;
|
|
3269
|
-
}
|
|
3270
|
-
return Object.assign({}, state, {
|
|
3271
|
-
routes: state.routes.map(function (route, i) {
|
|
3272
|
-
return i === index ? {
|
|
3273
|
-
key: key !== undefined ? key : `${name}-${(0, _$$_REQUIRE(_dependencyMap[3]).nanoid)()}`,
|
|
3274
|
-
name: name,
|
|
3275
|
-
params: routeParamList[name] !== undefined ? Object.assign({}, routeParamList[name], params) : params
|
|
3276
|
-
} : route;
|
|
3277
|
-
})
|
|
3278
|
-
});
|
|
3279
|
-
}
|
|
3280
|
-
case 'PUSH':
|
|
3281
|
-
if (state.routeNames.includes(action.payload.name)) {
|
|
3282
|
-
var getId = options.routeGetIdList[action.payload.name];
|
|
3283
|
-
var id = getId == null ? undefined : getId({
|
|
3284
|
-
params: action.payload.params
|
|
3285
|
-
});
|
|
3286
|
-
var route = id ? state.routes.find(function (route) {
|
|
3287
|
-
return route.name === action.payload.name && id === (getId == null ? undefined : getId({
|
|
3288
|
-
params: route.params
|
|
3289
|
-
}));
|
|
3290
|
-
}) : undefined;
|
|
3291
|
-
var routes;
|
|
3292
|
-
if (route) {
|
|
3293
|
-
routes = state.routes.filter(function (r) {
|
|
3294
|
-
return r.key !== route.key;
|
|
3295
|
-
});
|
|
3296
|
-
routes.push(Object.assign({}, route, {
|
|
3297
|
-
params: routeParamList[action.payload.name] !== undefined ? Object.assign({}, routeParamList[action.payload.name], action.payload.params) : action.payload.params
|
|
3298
|
-
}));
|
|
3299
|
-
} else {
|
|
3300
|
-
routes = [].concat((0, _toConsumableArray2.default)(state.routes), [{
|
|
3301
|
-
key: `${action.payload.name}-${(0, _$$_REQUIRE(_dependencyMap[3]).nanoid)()}`,
|
|
3302
|
-
name: action.payload.name,
|
|
3303
|
-
params: routeParamList[action.payload.name] !== undefined ? Object.assign({}, routeParamList[action.payload.name], action.payload.params) : action.payload.params
|
|
3304
|
-
}]);
|
|
3305
|
-
}
|
|
3306
|
-
return Object.assign({}, state, {
|
|
3307
|
-
index: routes.length - 1,
|
|
3308
|
-
routes: routes
|
|
3309
|
-
});
|
|
3310
|
-
}
|
|
3311
|
-
return null;
|
|
3312
|
-
case 'POP':
|
|
3313
|
-
{
|
|
3314
|
-
var _index = action.target === state.key && action.source ? state.routes.findIndex(function (r) {
|
|
3315
|
-
return r.key === action.source;
|
|
3316
|
-
}) : state.index;
|
|
3317
|
-
if (_index > 0) {
|
|
3318
|
-
var _count = Math.max(_index - action.payload.count + 1, 1);
|
|
3319
|
-
var _routes = state.routes.slice(0, _count).concat(state.routes.slice(_index + 1));
|
|
3320
|
-
return Object.assign({}, state, {
|
|
3321
|
-
index: _routes.length - 1,
|
|
3322
|
-
routes: _routes
|
|
3323
|
-
});
|
|
3324
|
-
}
|
|
3325
|
-
return null;
|
|
3326
|
-
}
|
|
3327
|
-
case 'POP_TO_TOP':
|
|
3328
|
-
return router.getStateForAction(state, {
|
|
3329
|
-
type: 'POP',
|
|
3330
|
-
payload: {
|
|
3331
|
-
count: state.routes.length - 1
|
|
3332
|
-
}
|
|
3333
|
-
}, options);
|
|
3334
|
-
case 'NAVIGATE':
|
|
3335
|
-
if (action.payload.name !== undefined && !state.routeNames.includes(action.payload.name)) {
|
|
3336
|
-
return null;
|
|
3337
|
-
}
|
|
3338
|
-
if (action.payload.key || action.payload.name) {
|
|
3339
|
-
var _action$payload$path;
|
|
3340
|
-
// If the route already exists, navigate to that
|
|
3341
|
-
var _index2 = -1;
|
|
3342
|
-
var _getId =
|
|
3343
|
-
// `getId` and `key` can't be used together
|
|
3344
|
-
action.payload.key === undefined && action.payload.name !== undefined ? options.routeGetIdList[action.payload.name] : undefined;
|
|
3345
|
-
var _id = _getId == null ? undefined : _getId({
|
|
3346
|
-
params: action.payload.params
|
|
3347
|
-
});
|
|
3348
|
-
if (_id) {
|
|
3349
|
-
_index2 = state.routes.findIndex(function (route) {
|
|
3350
|
-
return route.name === action.payload.name && _id === (_getId == null ? undefined : _getId({
|
|
3351
|
-
params: route.params
|
|
3352
|
-
}));
|
|
3353
|
-
});
|
|
3354
|
-
} else if (state.routes[state.index].name === action.payload.name && action.payload.key === undefined || state.routes[state.index].key === action.payload.key) {
|
|
3355
|
-
_index2 = state.index;
|
|
3356
|
-
} else {
|
|
3357
|
-
for (var i = state.routes.length - 1; i >= 0; i--) {
|
|
3358
|
-
if (state.routes[i].name === action.payload.name && action.payload.key === undefined || state.routes[i].key === action.payload.key) {
|
|
3359
|
-
_index2 = i;
|
|
3360
|
-
break;
|
|
3361
|
-
}
|
|
3362
|
-
}
|
|
3363
|
-
}
|
|
3364
|
-
if (_index2 === -1 && action.payload.key && action.payload.name === undefined) {
|
|
3365
|
-
return null;
|
|
3366
|
-
}
|
|
3367
|
-
if (_index2 === -1 && action.payload.name !== undefined) {
|
|
3368
|
-
var _action$payload$key;
|
|
3369
|
-
var _routes2 = [].concat((0, _toConsumableArray2.default)(state.routes), [{
|
|
3370
|
-
key: (_action$payload$key = action.payload.key) != null ? _action$payload$key : `${action.payload.name}-${(0, _$$_REQUIRE(_dependencyMap[3]).nanoid)()}`,
|
|
3371
|
-
name: action.payload.name,
|
|
3372
|
-
path: action.payload.path,
|
|
3373
|
-
params: routeParamList[action.payload.name] !== undefined ? Object.assign({}, routeParamList[action.payload.name], action.payload.params) : action.payload.params
|
|
3374
|
-
}]);
|
|
3375
|
-
return Object.assign({}, state, {
|
|
3376
|
-
routes: _routes2,
|
|
3377
|
-
index: _routes2.length - 1
|
|
3378
|
-
});
|
|
3379
|
-
}
|
|
3380
|
-
var _route = state.routes[_index2];
|
|
3381
|
-
var _params;
|
|
3382
|
-
if (action.payload.merge) {
|
|
3383
|
-
_params = action.payload.params !== undefined || routeParamList[_route.name] !== undefined ? Object.assign({}, routeParamList[_route.name], _route.params, action.payload.params) : _route.params;
|
|
3384
|
-
} else {
|
|
3385
|
-
_params = routeParamList[_route.name] !== undefined ? Object.assign({}, routeParamList[_route.name], action.payload.params) : action.payload.params;
|
|
3386
|
-
}
|
|
3387
|
-
return Object.assign({}, state, {
|
|
3388
|
-
index: _index2,
|
|
3389
|
-
routes: [].concat((0, _toConsumableArray2.default)(state.routes.slice(0, _index2)), [_params !== _route.params || action.payload.path && action.payload.path !== _route.path ? Object.assign({}, _route, {
|
|
3390
|
-
path: (_action$payload$path = action.payload.path) != null ? _action$payload$path : _route.path,
|
|
3391
|
-
params: _params
|
|
3392
|
-
}) : state.routes[_index2]])
|
|
3393
|
-
});
|
|
3394
|
-
}
|
|
3395
|
-
return null;
|
|
3396
|
-
case 'GO_BACK':
|
|
3397
|
-
if (state.index > 0) {
|
|
3398
|
-
return router.getStateForAction(state, {
|
|
3399
|
-
type: 'POP',
|
|
3400
|
-
payload: {
|
|
3401
|
-
count: 1
|
|
3402
|
-
},
|
|
3403
|
-
target: action.target,
|
|
3404
|
-
source: action.source
|
|
3405
|
-
}, options);
|
|
3406
|
-
}
|
|
3407
|
-
return null;
|
|
3408
|
-
default:
|
|
3409
|
-
return _BaseRouter.default.getStateForAction(state, action);
|
|
3410
|
-
}
|
|
3411
|
-
},
|
|
3412
|
-
actionCreators: StackActions
|
|
3413
|
-
});
|
|
3414
|
-
return router;
|
|
3415
|
-
}
|
|
3416
|
-
},"b83a4992ae2366e63a19",["277a84013d7e1a1ace05","838d7a057beeb5db50df","cc50ab09498b013d1d6d","e03db9aacb1ee503cd26"]);
|
|
3417
|
-
__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) {
|
|
3418
|
-
Object.defineProperty(exports, "__esModule", {
|
|
3419
|
-
value: true
|
|
3420
|
-
});
|
|
3421
|
-
var _exportNames = {
|
|
3422
|
-
CommonActions: true,
|
|
3423
|
-
BaseRouter: true,
|
|
3424
|
-
DrawerActions: true,
|
|
3425
|
-
DrawerRouter: true,
|
|
3426
|
-
StackActions: true,
|
|
3427
|
-
StackRouter: true,
|
|
3428
|
-
TabActions: true,
|
|
3429
|
-
TabRouter: true
|
|
3430
|
-
};
|
|
3431
|
-
Object.defineProperty(exports, "BaseRouter", {
|
|
3432
|
-
enumerable: true,
|
|
3433
|
-
get: function get() {
|
|
3434
|
-
return _BaseRouter.default;
|
|
3435
|
-
}
|
|
3436
|
-
});
|
|
3437
|
-
exports.CommonActions = undefined;
|
|
3438
|
-
Object.defineProperty(exports, "DrawerActions", {
|
|
3439
|
-
enumerable: true,
|
|
3440
|
-
get: function get() {
|
|
3441
|
-
return _DrawerRouter.DrawerActions;
|
|
3442
|
-
}
|
|
3443
|
-
});
|
|
3444
|
-
Object.defineProperty(exports, "DrawerRouter", {
|
|
3445
|
-
enumerable: true,
|
|
3446
|
-
get: function get() {
|
|
3447
|
-
return _DrawerRouter.default;
|
|
3448
|
-
}
|
|
3449
|
-
});
|
|
3450
|
-
Object.defineProperty(exports, "StackActions", {
|
|
3451
|
-
enumerable: true,
|
|
3452
|
-
get: function get() {
|
|
3453
|
-
return _StackRouter.StackActions;
|
|
3454
|
-
}
|
|
3455
|
-
});
|
|
3456
|
-
Object.defineProperty(exports, "StackRouter", {
|
|
3457
|
-
enumerable: true,
|
|
3458
|
-
get: function get() {
|
|
3459
|
-
return _StackRouter.default;
|
|
3460
|
-
}
|
|
3461
|
-
});
|
|
3462
|
-
Object.defineProperty(exports, "TabActions", {
|
|
3463
|
-
enumerable: true,
|
|
3464
|
-
get: function get() {
|
|
3465
|
-
return _TabRouter.TabActions;
|
|
3466
|
-
}
|
|
3467
|
-
});
|
|
3468
|
-
Object.defineProperty(exports, "TabRouter", {
|
|
3469
|
-
enumerable: true,
|
|
3470
|
-
get: function get() {
|
|
3471
|
-
return _TabRouter.default;
|
|
3472
|
-
}
|
|
3473
|
-
});
|
|
3474
|
-
var CommonActions = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[0]));
|
|
3475
|
-
exports.CommonActions = CommonActions;
|
|
3476
|
-
var _BaseRouter = _$$_REQUIRE(_dependencyMap[1])(_$$_REQUIRE(_dependencyMap[2]));
|
|
3477
|
-
var _DrawerRouter = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[3]));
|
|
3478
|
-
var _StackRouter = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[4]));
|
|
3479
|
-
var _TabRouter = _interopRequireWildcard(_$$_REQUIRE(_dependencyMap[5]));
|
|
3480
|
-
Object.keys(_$$_REQUIRE(_dependencyMap[6])).forEach(function (key) {
|
|
3481
|
-
if (key === "default" || key === "__esModule") return;
|
|
3482
|
-
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
3483
|
-
if (key in exports && exports[key] === _$$_REQUIRE(_dependencyMap[6])[key]) return;
|
|
3484
|
-
Object.defineProperty(exports, key, {
|
|
3485
|
-
enumerable: true,
|
|
3486
|
-
get: function get() {
|
|
3487
|
-
return _$$_REQUIRE(_dependencyMap[6])[key];
|
|
3488
|
-
}
|
|
3489
|
-
});
|
|
3490
|
-
});
|
|
3491
|
-
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
|
|
3492
|
-
},"683d3e0e1152b4734793",["000944072e226c3923ad","277a84013d7e1a1ace05","cc50ab09498b013d1d6d","a84ba97c7150cdcf5967","b83a4992ae2366e63a19","b409790239ad0cd46252","2ad167c587979ba4fdb7"]);
|
|
3493
|
-
__d(function (global, _$$_REQUIRE, _$$_IMPORT_DEFAULT, _$$_IMPORT_ALL, module, exports, _dependencyMap) {
|
|
3494
|
-
Object.defineProperty(exports, "__esModule", {
|
|
3495
|
-
value: true
|
|
3496
|
-
});
|
|
3497
|
-
},"2ad167c587979ba4fdb7",[]);
|