1 | (function (global, factory) {
|
2 | typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@tarojs/taro'), require('@system.fetch'), require('@system.request'), require('@system.storage'), require('@system.router'), require('@system.prompt'), require('@system.barcode'), require('@system.vibrator'), require('@system.clipboard'), require('@system.sensor'), require('@system.geolocation'), require('@system.share'), require('@system.notification'), require('@system.device'), require('@system.webview'), require('@system.audio'), require('@system.record'), require('@system.contact'), require('@system.sms')) :
|
3 | typeof define === 'function' && define.amd ? define(['exports', '@tarojs/taro', '@system.fetch', '@system.request', '@system.storage', '@system.router', '@system.prompt', '@system.barcode', '@system.vibrator', '@system.clipboard', '@system.sensor', '@system.geolocation', '@system.share', '@system.notification', '@system.device', '@system.webview', '@system.audio', '@system.record', '@system.contact', '@system.sms'], factory) :
|
4 | (factory((global.TaroAuickapp = {}),global.taro,global.fetch,global.quickRequest,global.storage,global.router,global.prompt,global.barcode,global.vibrator,global.clipboard,global.sensor,global.geolocation,global.share,global.notification,global.device,global.webview,global.audio,global.record,global.contact,global.sms));
|
5 | }(this, (function (exports,taro,fetch,quickRequest,storage,router,prompt,barcode,vibrator,clipboard,sensor,geolocation,share,notification,device,webview,audio,record,contact,sms) { 'use strict';
|
6 |
|
7 | fetch = fetch && fetch.hasOwnProperty('default') ? fetch['default'] : fetch;
|
8 | quickRequest = quickRequest && quickRequest.hasOwnProperty('default') ? quickRequest['default'] : quickRequest;
|
9 | storage = storage && storage.hasOwnProperty('default') ? storage['default'] : storage;
|
10 | router = router && router.hasOwnProperty('default') ? router['default'] : router;
|
11 | prompt = prompt && prompt.hasOwnProperty('default') ? prompt['default'] : prompt;
|
12 | barcode = barcode && barcode.hasOwnProperty('default') ? barcode['default'] : barcode;
|
13 | vibrator = vibrator && vibrator.hasOwnProperty('default') ? vibrator['default'] : vibrator;
|
14 | clipboard = clipboard && clipboard.hasOwnProperty('default') ? clipboard['default'] : clipboard;
|
15 | sensor = sensor && sensor.hasOwnProperty('default') ? sensor['default'] : sensor;
|
16 | geolocation = geolocation && geolocation.hasOwnProperty('default') ? geolocation['default'] : geolocation;
|
17 | share = share && share.hasOwnProperty('default') ? share['default'] : share;
|
18 | notification = notification && notification.hasOwnProperty('default') ? notification['default'] : notification;
|
19 | device = device && device.hasOwnProperty('default') ? device['default'] : device;
|
20 | webview = webview && webview.hasOwnProperty('default') ? webview['default'] : webview;
|
21 | audio = audio && audio.hasOwnProperty('default') ? audio['default'] : audio;
|
22 | record = record && record.hasOwnProperty('default') ? record['default'] : record;
|
23 | contact = contact && contact.hasOwnProperty('default') ? contact['default'] : contact;
|
24 | sms = sms && sms.hasOwnProperty('default') ? sms['default'] : sms;
|
25 |
|
26 | function _typeof(obj) {
|
27 | "@babel/helpers - typeof";
|
28 |
|
29 | if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
|
30 | _typeof = function (obj) {
|
31 | return typeof obj;
|
32 | };
|
33 | } else {
|
34 | _typeof = function (obj) {
|
35 | return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
|
36 | };
|
37 | }
|
38 |
|
39 | return _typeof(obj);
|
40 | }
|
41 |
|
42 | function _classCallCheck(instance, Constructor) {
|
43 | if (!(instance instanceof Constructor)) {
|
44 | throw new TypeError("Cannot call a class as a function");
|
45 | }
|
46 | }
|
47 |
|
48 | function _defineProperties(target, props) {
|
49 | for (var i = 0; i < props.length; i++) {
|
50 | var descriptor = props[i];
|
51 | descriptor.enumerable = descriptor.enumerable || false;
|
52 | descriptor.configurable = true;
|
53 | if ("value" in descriptor) descriptor.writable = true;
|
54 | Object.defineProperty(target, descriptor.key, descriptor);
|
55 | }
|
56 | }
|
57 |
|
58 | function _createClass(Constructor, protoProps, staticProps) {
|
59 | if (protoProps) _defineProperties(Constructor.prototype, protoProps);
|
60 | if (staticProps) _defineProperties(Constructor, staticProps);
|
61 | return Constructor;
|
62 | }
|
63 |
|
64 | function _defineProperty(obj, key, value) {
|
65 | if (key in obj) {
|
66 | Object.defineProperty(obj, key, {
|
67 | value: value,
|
68 | enumerable: true,
|
69 | configurable: true,
|
70 | writable: true
|
71 | });
|
72 | } else {
|
73 | obj[key] = value;
|
74 | }
|
75 |
|
76 | return obj;
|
77 | }
|
78 |
|
79 | function _inherits(subClass, superClass) {
|
80 | if (typeof superClass !== "function" && superClass !== null) {
|
81 | throw new TypeError("Super expression must either be null or a function");
|
82 | }
|
83 |
|
84 | subClass.prototype = Object.create(superClass && superClass.prototype, {
|
85 | constructor: {
|
86 | value: subClass,
|
87 | writable: true,
|
88 | configurable: true
|
89 | }
|
90 | });
|
91 | if (superClass) _setPrototypeOf(subClass, superClass);
|
92 | }
|
93 |
|
94 | function _getPrototypeOf(o) {
|
95 | _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) {
|
96 | return o.__proto__ || Object.getPrototypeOf(o);
|
97 | };
|
98 | return _getPrototypeOf(o);
|
99 | }
|
100 |
|
101 | function _setPrototypeOf(o, p) {
|
102 | _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {
|
103 | o.__proto__ = p;
|
104 | return o;
|
105 | };
|
106 |
|
107 | return _setPrototypeOf(o, p);
|
108 | }
|
109 |
|
110 | function _isNativeReflectConstruct() {
|
111 | if (typeof Reflect === "undefined" || !Reflect.construct) return false;
|
112 | if (Reflect.construct.sham) return false;
|
113 | if (typeof Proxy === "function") return true;
|
114 |
|
115 | try {
|
116 | Date.prototype.toString.call(Reflect.construct(Date, [], function () {}));
|
117 | return true;
|
118 | } catch (e) {
|
119 | return false;
|
120 | }
|
121 | }
|
122 |
|
123 | function _assertThisInitialized(self) {
|
124 | if (self === void 0) {
|
125 | throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
126 | }
|
127 |
|
128 | return self;
|
129 | }
|
130 |
|
131 | function _possibleConstructorReturn(self, call) {
|
132 | if (call && (typeof call === "object" || typeof call === "function")) {
|
133 | return call;
|
134 | }
|
135 |
|
136 | return _assertThisInitialized(self);
|
137 | }
|
138 |
|
139 | function _createSuper(Derived) {
|
140 | var hasNativeReflectConstruct = _isNativeReflectConstruct();
|
141 |
|
142 | return function _createSuperInternal() {
|
143 | var Super = _getPrototypeOf(Derived),
|
144 | result;
|
145 |
|
146 | if (hasNativeReflectConstruct) {
|
147 | var NewTarget = _getPrototypeOf(this).constructor;
|
148 |
|
149 | result = Reflect.construct(Super, arguments, NewTarget);
|
150 | } else {
|
151 | result = Super.apply(this, arguments);
|
152 | }
|
153 |
|
154 | return _possibleConstructorReturn(this, result);
|
155 | };
|
156 | }
|
157 |
|
158 | function _toConsumableArray(arr) {
|
159 | return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread();
|
160 | }
|
161 |
|
162 | function _arrayWithoutHoles(arr) {
|
163 | if (Array.isArray(arr)) return _arrayLikeToArray(arr);
|
164 | }
|
165 |
|
166 | function _iterableToArray(iter) {
|
167 | if (typeof Symbol !== "undefined" && Symbol.iterator in Object(iter)) return Array.from(iter);
|
168 | }
|
169 |
|
170 | function _unsupportedIterableToArray(o, minLen) {
|
171 | if (!o) return;
|
172 | if (typeof o === "string") return _arrayLikeToArray(o, minLen);
|
173 | var n = Object.prototype.toString.call(o).slice(8, -1);
|
174 | if (n === "Object" && o.constructor) n = o.constructor.name;
|
175 | if (n === "Map" || n === "Set") return Array.from(o);
|
176 | if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
|
177 | }
|
178 |
|
179 | function _arrayLikeToArray(arr, len) {
|
180 | if (len == null || len > arr.length) len = arr.length;
|
181 |
|
182 | for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
|
183 |
|
184 | return arr2;
|
185 | }
|
186 |
|
187 | function _nonIterableSpread() {
|
188 | throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
189 | }
|
190 |
|
191 | function _createForOfIteratorHelper(o, allowArrayLike) {
|
192 | var it;
|
193 |
|
194 | if (typeof Symbol === "undefined" || o[Symbol.iterator] == null) {
|
195 | if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") {
|
196 | if (it) o = it;
|
197 | var i = 0;
|
198 |
|
199 | var F = function () {};
|
200 |
|
201 | return {
|
202 | s: F,
|
203 | n: function () {
|
204 | if (i >= o.length) return {
|
205 | done: true
|
206 | };
|
207 | return {
|
208 | done: false,
|
209 | value: o[i++]
|
210 | };
|
211 | },
|
212 | e: function (e) {
|
213 | throw e;
|
214 | },
|
215 | f: F
|
216 | };
|
217 | }
|
218 |
|
219 | throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
220 | }
|
221 |
|
222 | var normalCompletion = true,
|
223 | didErr = false,
|
224 | err;
|
225 | return {
|
226 | s: function () {
|
227 | it = o[Symbol.iterator]();
|
228 | },
|
229 | n: function () {
|
230 | var step = it.next();
|
231 | normalCompletion = step.done;
|
232 | return step;
|
233 | },
|
234 | e: function (e) {
|
235 | didErr = true;
|
236 | err = e;
|
237 | },
|
238 | f: function () {
|
239 | try {
|
240 | if (!normalCompletion && it.return != null) it.return();
|
241 | } finally {
|
242 | if (didErr) throw err;
|
243 | }
|
244 | }
|
245 | };
|
246 | }
|
247 |
|
248 |
|
249 | var objectIs = Object.is || function (x, y) {
|
250 | if (x === y) {
|
251 | return x !== 0 || 1 / x === 1 / y;
|
252 | }
|
253 |
|
254 | return x !== x && y !== y;
|
255 | };
|
256 |
|
257 | function shallowEqual(obj1, obj2) {
|
258 | if (_typeof(obj1) !== 'object' && _typeof(obj2) !== 'object') {
|
259 | return obj1 === obj2;
|
260 | }
|
261 |
|
262 | if (obj1 === null && obj2 === null) {
|
263 | return true;
|
264 | }
|
265 |
|
266 | if (obj1 === null || obj2 === null) {
|
267 | return false;
|
268 | }
|
269 |
|
270 | if (objectIs(obj1, obj2)) {
|
271 | return true;
|
272 | }
|
273 |
|
274 | var obj1Keys = obj1 ? Object.keys(obj1) : [];
|
275 | var obj2Keys = obj2 ? Object.keys(obj2) : [];
|
276 |
|
277 | if (obj1Keys.length !== obj2Keys.length) {
|
278 | return false;
|
279 | }
|
280 |
|
281 | for (var i = 0; i < obj1Keys.length; i++) {
|
282 | var obj1KeyItem = obj1Keys[i];
|
283 |
|
284 | if (!obj2.hasOwnProperty(obj1KeyItem) || !objectIs(obj1[obj1KeyItem], obj2[obj1KeyItem])) {
|
285 | return false;
|
286 | }
|
287 | }
|
288 |
|
289 | return true;
|
290 | }
|
291 |
|
292 | var SimpleMap = function () {
|
293 | function SimpleMap() {
|
294 | _classCallCheck(this, SimpleMap);
|
295 |
|
296 | this.cache = [];
|
297 | this.size = 0;
|
298 | }
|
299 |
|
300 | _createClass(SimpleMap, [{
|
301 | key: "set",
|
302 | value: function set(k, v) {
|
303 | var len = this.cache.length;
|
304 |
|
305 | if (!len) {
|
306 | this.cache.push({
|
307 | k: k,
|
308 | v: v
|
309 | });
|
310 | this.size += 1;
|
311 | return;
|
312 | }
|
313 |
|
314 | for (var i = 0; i < len; i++) {
|
315 | var item = this.cache[i];
|
316 |
|
317 | if (item.k === k) {
|
318 | item.v = v;
|
319 | return;
|
320 | }
|
321 | }
|
322 |
|
323 | this.cache.push({
|
324 | k: k,
|
325 | v: v
|
326 | });
|
327 | this.size += 1;
|
328 | }
|
329 | }, {
|
330 | key: "get",
|
331 | value: function get(k) {
|
332 | var len = this.cache.length;
|
333 |
|
334 | if (!len) {
|
335 | return;
|
336 | }
|
337 |
|
338 | for (var i = 0; i < len; i++) {
|
339 | var item = this.cache[i];
|
340 |
|
341 | if (item.k === k) {
|
342 | return item.v;
|
343 | }
|
344 | }
|
345 | }
|
346 | }, {
|
347 | key: "has",
|
348 | value: function has(k) {
|
349 | var len = this.cache.length;
|
350 |
|
351 | if (!len) {
|
352 | return false;
|
353 | }
|
354 |
|
355 | for (var i = 0; i < len; i++) {
|
356 | var item = this.cache[i];
|
357 |
|
358 | if (item.k === k) {
|
359 | return true;
|
360 | }
|
361 | }
|
362 |
|
363 | return false;
|
364 | }
|
365 | }, {
|
366 | key: "delete",
|
367 | value: function _delete(k) {
|
368 | var len = this.cache.length;
|
369 |
|
370 | for (var i = 0; i < len; i++) {
|
371 | var item = this.cache[i];
|
372 |
|
373 | if (item.k === k) {
|
374 | this.cache.splice(i, 1);
|
375 | this.size -= 1;
|
376 | return true;
|
377 | }
|
378 | }
|
379 |
|
380 | return false;
|
381 | }
|
382 | }, {
|
383 | key: "clear",
|
384 | value: function clear() {
|
385 | var len = this.cache.length;
|
386 | this.size = 0;
|
387 |
|
388 | if (!len) {
|
389 | return;
|
390 | }
|
391 |
|
392 | while (len) {
|
393 | this.cache.pop();
|
394 | len--;
|
395 | }
|
396 | }
|
397 | }]);
|
398 |
|
399 | return SimpleMap;
|
400 | }();
|
401 |
|
402 | var nextTick = function nextTick(fn) {
|
403 | var _fn;
|
404 |
|
405 | for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
406 | args[_key - 1] = arguments[_key];
|
407 | }
|
408 |
|
409 | fn = typeof fn === 'function' ? (_fn = fn).bind.apply(_fn, [null].concat(args)) : fn;
|
410 | var timerFunc = setTimeout;
|
411 | timerFunc(fn);
|
412 | };
|
413 |
|
414 | var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
|
415 |
|
416 | function createCommonjsModule(fn, module) {
|
417 | return module = { exports: {} }, fn(module, module.exports), module.exports;
|
418 | }
|
419 |
|
420 | |
421 |
|
422 |
|
423 |
|
424 |
|
425 |
|
426 |
|
427 |
|
428 | var b = "function" === typeof Symbol && Symbol["for"],
|
429 | c = b ? Symbol["for"]("react.element") : 60103,
|
430 | d = b ? Symbol["for"]("react.portal") : 60106,
|
431 | e = b ? Symbol["for"]("react.fragment") : 60107,
|
432 | f = b ? Symbol["for"]("react.strict_mode") : 60108,
|
433 | g = b ? Symbol["for"]("react.profiler") : 60114,
|
434 | h = b ? Symbol["for"]("react.provider") : 60109,
|
435 | k = b ? Symbol["for"]("react.context") : 60110,
|
436 | l = b ? Symbol["for"]("react.async_mode") : 60111,
|
437 | m = b ? Symbol["for"]("react.concurrent_mode") : 60111,
|
438 | n = b ? Symbol["for"]("react.forward_ref") : 60112,
|
439 | p = b ? Symbol["for"]("react.suspense") : 60113,
|
440 | q = b ? Symbol["for"]("react.suspense_list") : 60120,
|
441 | r = b ? Symbol["for"]("react.memo") : 60115,
|
442 | t = b ? Symbol["for"]("react.lazy") : 60116,
|
443 | v = b ? Symbol["for"]("react.block") : 60121,
|
444 | w = b ? Symbol["for"]("react.fundamental") : 60117,
|
445 | x = b ? Symbol["for"]("react.responder") : 60118,
|
446 | y = b ? Symbol["for"]("react.scope") : 60119;
|
447 |
|
448 | function z(a) {
|
449 | if ("object" === _typeof(a) && null !== a) {
|
450 | var u = a.$$typeof;
|
451 |
|
452 | switch (u) {
|
453 | case c:
|
454 | switch (a = a.type, a) {
|
455 | case l:
|
456 | case m:
|
457 | case e:
|
458 | case g:
|
459 | case f:
|
460 | case p:
|
461 | return a;
|
462 |
|
463 | default:
|
464 | switch (a = a && a.$$typeof, a) {
|
465 | case k:
|
466 | case n:
|
467 | case t:
|
468 | case r:
|
469 | case h:
|
470 | return a;
|
471 |
|
472 | default:
|
473 | return u;
|
474 | }
|
475 |
|
476 | }
|
477 |
|
478 | case d:
|
479 | return u;
|
480 | }
|
481 | }
|
482 | }
|
483 |
|
484 | function A(a) {
|
485 | return z(a) === m;
|
486 | }
|
487 |
|
488 | var AsyncMode = l;
|
489 | var ConcurrentMode = m;
|
490 | var ContextConsumer = k;
|
491 | var ContextProvider = h;
|
492 | var Element = c;
|
493 | var ForwardRef = n;
|
494 | var Fragment = e;
|
495 | var Lazy = t;
|
496 | var Memo = r;
|
497 | var Portal = d;
|
498 | var Profiler = g;
|
499 | var StrictMode = f;
|
500 | var Suspense = p;
|
501 |
|
502 | var isAsyncMode = function isAsyncMode(a) {
|
503 | return A(a) || z(a) === l;
|
504 | };
|
505 |
|
506 | var isConcurrentMode = A;
|
507 |
|
508 | var isContextConsumer = function isContextConsumer(a) {
|
509 | return z(a) === k;
|
510 | };
|
511 |
|
512 | var isContextProvider = function isContextProvider(a) {
|
513 | return z(a) === h;
|
514 | };
|
515 |
|
516 | var isElement = function isElement(a) {
|
517 | return "object" === _typeof(a) && null !== a && a.$$typeof === c;
|
518 | };
|
519 |
|
520 | var isForwardRef = function isForwardRef(a) {
|
521 | return z(a) === n;
|
522 | };
|
523 |
|
524 | var isFragment = function isFragment(a) {
|
525 | return z(a) === e;
|
526 | };
|
527 |
|
528 | var isLazy = function isLazy(a) {
|
529 | return z(a) === t;
|
530 | };
|
531 |
|
532 | var isMemo = function isMemo(a) {
|
533 | return z(a) === r;
|
534 | };
|
535 |
|
536 | var isPortal = function isPortal(a) {
|
537 | return z(a) === d;
|
538 | };
|
539 |
|
540 | var isProfiler = function isProfiler(a) {
|
541 | return z(a) === g;
|
542 | };
|
543 |
|
544 | var isStrictMode = function isStrictMode(a) {
|
545 | return z(a) === f;
|
546 | };
|
547 |
|
548 | var isSuspense = function isSuspense(a) {
|
549 | return z(a) === p;
|
550 | };
|
551 |
|
552 | var isValidElementType = function isValidElementType(a) {
|
553 | return "string" === typeof a || "function" === typeof a || a === e || a === m || a === g || a === f || a === p || a === q || "object" === _typeof(a) && null !== a && (a.$$typeof === t || a.$$typeof === r || a.$$typeof === h || a.$$typeof === k || a.$$typeof === n || a.$$typeof === w || a.$$typeof === x || a.$$typeof === y || a.$$typeof === v);
|
554 | };
|
555 |
|
556 | var typeOf = z;
|
557 | var reactIs_production_min = {
|
558 | AsyncMode: AsyncMode,
|
559 | ConcurrentMode: ConcurrentMode,
|
560 | ContextConsumer: ContextConsumer,
|
561 | ContextProvider: ContextProvider,
|
562 | Element: Element,
|
563 | ForwardRef: ForwardRef,
|
564 | Fragment: Fragment,
|
565 | Lazy: Lazy,
|
566 | Memo: Memo,
|
567 | Portal: Portal,
|
568 | Profiler: Profiler,
|
569 | StrictMode: StrictMode,
|
570 | Suspense: Suspense,
|
571 | isAsyncMode: isAsyncMode,
|
572 | isConcurrentMode: isConcurrentMode,
|
573 | isContextConsumer: isContextConsumer,
|
574 | isContextProvider: isContextProvider,
|
575 | isElement: isElement,
|
576 | isForwardRef: isForwardRef,
|
577 | isFragment: isFragment,
|
578 | isLazy: isLazy,
|
579 | isMemo: isMemo,
|
580 | isPortal: isPortal,
|
581 | isProfiler: isProfiler,
|
582 | isStrictMode: isStrictMode,
|
583 | isSuspense: isSuspense,
|
584 | isValidElementType: isValidElementType,
|
585 | typeOf: typeOf
|
586 | };
|
587 |
|
588 | var reactIs_development = createCommonjsModule(function (module, exports) {
|
589 |
|
590 | if (process.env.NODE_ENV !== "production") {
|
591 | (function () {
|
592 |
|
593 |
|
594 | var hasSymbol = typeof Symbol === 'function' && Symbol["for"];
|
595 | var REACT_ELEMENT_TYPE = hasSymbol ? Symbol["for"]('react.element') : 0xeac7;
|
596 | var REACT_PORTAL_TYPE = hasSymbol ? Symbol["for"]('react.portal') : 0xeaca;
|
597 | var REACT_FRAGMENT_TYPE = hasSymbol ? Symbol["for"]('react.fragment') : 0xeacb;
|
598 | var REACT_STRICT_MODE_TYPE = hasSymbol ? Symbol["for"]('react.strict_mode') : 0xeacc;
|
599 | var REACT_PROFILER_TYPE = hasSymbol ? Symbol["for"]('react.profiler') : 0xead2;
|
600 | var REACT_PROVIDER_TYPE = hasSymbol ? Symbol["for"]('react.provider') : 0xeacd;
|
601 | var REACT_CONTEXT_TYPE = hasSymbol ? Symbol["for"]('react.context') : 0xeace;
|
602 |
|
603 |
|
604 | var REACT_ASYNC_MODE_TYPE = hasSymbol ? Symbol["for"]('react.async_mode') : 0xeacf;
|
605 | var REACT_CONCURRENT_MODE_TYPE = hasSymbol ? Symbol["for"]('react.concurrent_mode') : 0xeacf;
|
606 | var REACT_FORWARD_REF_TYPE = hasSymbol ? Symbol["for"]('react.forward_ref') : 0xead0;
|
607 | var REACT_SUSPENSE_TYPE = hasSymbol ? Symbol["for"]('react.suspense') : 0xead1;
|
608 | var REACT_SUSPENSE_LIST_TYPE = hasSymbol ? Symbol["for"]('react.suspense_list') : 0xead8;
|
609 | var REACT_MEMO_TYPE = hasSymbol ? Symbol["for"]('react.memo') : 0xead3;
|
610 | var REACT_LAZY_TYPE = hasSymbol ? Symbol["for"]('react.lazy') : 0xead4;
|
611 | var REACT_BLOCK_TYPE = hasSymbol ? Symbol["for"]('react.block') : 0xead9;
|
612 | var REACT_FUNDAMENTAL_TYPE = hasSymbol ? Symbol["for"]('react.fundamental') : 0xead5;
|
613 | var REACT_RESPONDER_TYPE = hasSymbol ? Symbol["for"]('react.responder') : 0xead6;
|
614 | var REACT_SCOPE_TYPE = hasSymbol ? Symbol["for"]('react.scope') : 0xead7;
|
615 |
|
616 | function isValidElementType(type) {
|
617 | return typeof type === 'string' || typeof type === 'function' ||
|
618 | type === REACT_FRAGMENT_TYPE || type === REACT_CONCURRENT_MODE_TYPE || type === REACT_PROFILER_TYPE || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || type === REACT_SUSPENSE_LIST_TYPE || _typeof(type) === 'object' && type !== null && (type.$$typeof === REACT_LAZY_TYPE || type.$$typeof === REACT_MEMO_TYPE || type.$$typeof === REACT_PROVIDER_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || type.$$typeof === REACT_FORWARD_REF_TYPE || type.$$typeof === REACT_FUNDAMENTAL_TYPE || type.$$typeof === REACT_RESPONDER_TYPE || type.$$typeof === REACT_SCOPE_TYPE || type.$$typeof === REACT_BLOCK_TYPE);
|
619 | }
|
620 |
|
621 | function typeOf(object) {
|
622 | if (_typeof(object) === 'object' && object !== null) {
|
623 | var $$typeof = object.$$typeof;
|
624 |
|
625 | switch ($$typeof) {
|
626 | case REACT_ELEMENT_TYPE:
|
627 | var type = object.type;
|
628 |
|
629 | switch (type) {
|
630 | case REACT_ASYNC_MODE_TYPE:
|
631 | case REACT_CONCURRENT_MODE_TYPE:
|
632 | case REACT_FRAGMENT_TYPE:
|
633 | case REACT_PROFILER_TYPE:
|
634 | case REACT_STRICT_MODE_TYPE:
|
635 | case REACT_SUSPENSE_TYPE:
|
636 | return type;
|
637 |
|
638 | default:
|
639 | var $$typeofType = type && type.$$typeof;
|
640 |
|
641 | switch ($$typeofType) {
|
642 | case REACT_CONTEXT_TYPE:
|
643 | case REACT_FORWARD_REF_TYPE:
|
644 | case REACT_LAZY_TYPE:
|
645 | case REACT_MEMO_TYPE:
|
646 | case REACT_PROVIDER_TYPE:
|
647 | return $$typeofType;
|
648 |
|
649 | default:
|
650 | return $$typeof;
|
651 | }
|
652 |
|
653 | }
|
654 |
|
655 | case REACT_PORTAL_TYPE:
|
656 | return $$typeof;
|
657 | }
|
658 | }
|
659 |
|
660 | return undefined;
|
661 | }
|
662 |
|
663 |
|
664 | var AsyncMode = REACT_ASYNC_MODE_TYPE;
|
665 | var ConcurrentMode = REACT_CONCURRENT_MODE_TYPE;
|
666 | var ContextConsumer = REACT_CONTEXT_TYPE;
|
667 | var ContextProvider = REACT_PROVIDER_TYPE;
|
668 | var Element = REACT_ELEMENT_TYPE;
|
669 | var ForwardRef = REACT_FORWARD_REF_TYPE;
|
670 | var Fragment = REACT_FRAGMENT_TYPE;
|
671 | var Lazy = REACT_LAZY_TYPE;
|
672 | var Memo = REACT_MEMO_TYPE;
|
673 | var Portal = REACT_PORTAL_TYPE;
|
674 | var Profiler = REACT_PROFILER_TYPE;
|
675 | var StrictMode = REACT_STRICT_MODE_TYPE;
|
676 | var Suspense = REACT_SUSPENSE_TYPE;
|
677 | var hasWarnedAboutDeprecatedIsAsyncMode = false;
|
678 |
|
679 | function isAsyncMode(object) {
|
680 | {
|
681 | if (!hasWarnedAboutDeprecatedIsAsyncMode) {
|
682 | hasWarnedAboutDeprecatedIsAsyncMode = true;
|
683 |
|
684 | console['warn']('The ReactIs.isAsyncMode() alias has been deprecated, ' + 'and will be removed in React 17+. Update your code to use ' + 'ReactIs.isConcurrentMode() instead. It has the exact same API.');
|
685 | }
|
686 | }
|
687 | return isConcurrentMode(object) || typeOf(object) === REACT_ASYNC_MODE_TYPE;
|
688 | }
|
689 |
|
690 | function isConcurrentMode(object) {
|
691 | return typeOf(object) === REACT_CONCURRENT_MODE_TYPE;
|
692 | }
|
693 |
|
694 | function isContextConsumer(object) {
|
695 | return typeOf(object) === REACT_CONTEXT_TYPE;
|
696 | }
|
697 |
|
698 | function isContextProvider(object) {
|
699 | return typeOf(object) === REACT_PROVIDER_TYPE;
|
700 | }
|
701 |
|
702 | function isElement(object) {
|
703 | return _typeof(object) === 'object' && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;
|
704 | }
|
705 |
|
706 | function isForwardRef(object) {
|
707 | return typeOf(object) === REACT_FORWARD_REF_TYPE;
|
708 | }
|
709 |
|
710 | function isFragment(object) {
|
711 | return typeOf(object) === REACT_FRAGMENT_TYPE;
|
712 | }
|
713 |
|
714 | function isLazy(object) {
|
715 | return typeOf(object) === REACT_LAZY_TYPE;
|
716 | }
|
717 |
|
718 | function isMemo(object) {
|
719 | return typeOf(object) === REACT_MEMO_TYPE;
|
720 | }
|
721 |
|
722 | function isPortal(object) {
|
723 | return typeOf(object) === REACT_PORTAL_TYPE;
|
724 | }
|
725 |
|
726 | function isProfiler(object) {
|
727 | return typeOf(object) === REACT_PROFILER_TYPE;
|
728 | }
|
729 |
|
730 | function isStrictMode(object) {
|
731 | return typeOf(object) === REACT_STRICT_MODE_TYPE;
|
732 | }
|
733 |
|
734 | function isSuspense(object) {
|
735 | return typeOf(object) === REACT_SUSPENSE_TYPE;
|
736 | }
|
737 |
|
738 | exports.AsyncMode = AsyncMode;
|
739 | exports.ConcurrentMode = ConcurrentMode;
|
740 | exports.ContextConsumer = ContextConsumer;
|
741 | exports.ContextProvider = ContextProvider;
|
742 | exports.Element = Element;
|
743 | exports.ForwardRef = ForwardRef;
|
744 | exports.Fragment = Fragment;
|
745 | exports.Lazy = Lazy;
|
746 | exports.Memo = Memo;
|
747 | exports.Portal = Portal;
|
748 | exports.Profiler = Profiler;
|
749 | exports.StrictMode = StrictMode;
|
750 | exports.Suspense = Suspense;
|
751 | exports.isAsyncMode = isAsyncMode;
|
752 | exports.isConcurrentMode = isConcurrentMode;
|
753 | exports.isContextConsumer = isContextConsumer;
|
754 | exports.isContextProvider = isContextProvider;
|
755 | exports.isElement = isElement;
|
756 | exports.isForwardRef = isForwardRef;
|
757 | exports.isFragment = isFragment;
|
758 | exports.isLazy = isLazy;
|
759 | exports.isMemo = isMemo;
|
760 | exports.isPortal = isPortal;
|
761 | exports.isProfiler = isProfiler;
|
762 | exports.isStrictMode = isStrictMode;
|
763 | exports.isSuspense = isSuspense;
|
764 | exports.isValidElementType = isValidElementType;
|
765 | exports.typeOf = typeOf;
|
766 | })();
|
767 | }
|
768 | });
|
769 | var reactIs_development_1 = reactIs_development.AsyncMode;
|
770 | var reactIs_development_2 = reactIs_development.ConcurrentMode;
|
771 | var reactIs_development_3 = reactIs_development.ContextConsumer;
|
772 | var reactIs_development_4 = reactIs_development.ContextProvider;
|
773 | var reactIs_development_5 = reactIs_development.Element;
|
774 | var reactIs_development_6 = reactIs_development.ForwardRef;
|
775 | var reactIs_development_7 = reactIs_development.Fragment;
|
776 | var reactIs_development_8 = reactIs_development.Lazy;
|
777 | var reactIs_development_9 = reactIs_development.Memo;
|
778 | var reactIs_development_10 = reactIs_development.Portal;
|
779 | var reactIs_development_11 = reactIs_development.Profiler;
|
780 | var reactIs_development_12 = reactIs_development.StrictMode;
|
781 | var reactIs_development_13 = reactIs_development.Suspense;
|
782 | var reactIs_development_14 = reactIs_development.isAsyncMode;
|
783 | var reactIs_development_15 = reactIs_development.isConcurrentMode;
|
784 | var reactIs_development_16 = reactIs_development.isContextConsumer;
|
785 | var reactIs_development_17 = reactIs_development.isContextProvider;
|
786 | var reactIs_development_18 = reactIs_development.isElement;
|
787 | var reactIs_development_19 = reactIs_development.isForwardRef;
|
788 | var reactIs_development_20 = reactIs_development.isFragment;
|
789 | var reactIs_development_21 = reactIs_development.isLazy;
|
790 | var reactIs_development_22 = reactIs_development.isMemo;
|
791 | var reactIs_development_23 = reactIs_development.isPortal;
|
792 | var reactIs_development_24 = reactIs_development.isProfiler;
|
793 | var reactIs_development_25 = reactIs_development.isStrictMode;
|
794 | var reactIs_development_26 = reactIs_development.isSuspense;
|
795 | var reactIs_development_27 = reactIs_development.isValidElementType;
|
796 | var reactIs_development_28 = reactIs_development.typeOf;
|
797 |
|
798 | var reactIs = createCommonjsModule(function (module) {
|
799 |
|
800 | if (process.env.NODE_ENV === 'production') {
|
801 | module.exports = reactIs_production_min;
|
802 | } else {
|
803 | module.exports = reactIs_development;
|
804 | }
|
805 | });
|
806 |
|
807 | |
808 |
|
809 |
|
810 |
|
811 |
|
812 |
|
813 |
|
814 | var getOwnPropertySymbols = Object.getOwnPropertySymbols;
|
815 | var hasOwnProperty = Object.prototype.hasOwnProperty;
|
816 | var propIsEnumerable = Object.prototype.propertyIsEnumerable;
|
817 |
|
818 | function toObject(val) {
|
819 | if (val === null || val === undefined) {
|
820 | throw new TypeError('Object.assign cannot be called with null or undefined');
|
821 | }
|
822 |
|
823 | return Object(val);
|
824 | }
|
825 |
|
826 | function shouldUseNative() {
|
827 | try {
|
828 | if (!Object.assign) {
|
829 | return false;
|
830 | }
|
831 |
|
832 |
|
833 |
|
834 | var test1 = new String('abc');
|
835 |
|
836 | test1[5] = 'de';
|
837 |
|
838 | if (Object.getOwnPropertyNames(test1)[0] === '5') {
|
839 | return false;
|
840 | }
|
841 |
|
842 |
|
843 | var test2 = {};
|
844 |
|
845 | for (var i = 0; i < 10; i++) {
|
846 | test2['_' + String.fromCharCode(i)] = i;
|
847 | }
|
848 |
|
849 | var order2 = Object.getOwnPropertyNames(test2).map(function (n) {
|
850 | return test2[n];
|
851 | });
|
852 |
|
853 | if (order2.join('') !== '0123456789') {
|
854 | return false;
|
855 | }
|
856 |
|
857 |
|
858 | var test3 = {};
|
859 | 'abcdefghijklmnopqrst'.split('').forEach(function (letter) {
|
860 | test3[letter] = letter;
|
861 | });
|
862 |
|
863 | if (Object.keys(Object.assign({}, test3)).join('') !== 'abcdefghijklmnopqrst') {
|
864 | return false;
|
865 | }
|
866 |
|
867 | return true;
|
868 | } catch (err) {
|
869 |
|
870 | return false;
|
871 | }
|
872 | }
|
873 |
|
874 | var objectAssign = shouldUseNative() ? Object.assign : function (target, source) {
|
875 | var from;
|
876 | var to = toObject(target);
|
877 | var symbols;
|
878 |
|
879 | for (var s = 1; s < arguments.length; s++) {
|
880 | from = Object(arguments[s]);
|
881 |
|
882 | for (var key in from) {
|
883 | if (hasOwnProperty.call(from, key)) {
|
884 | to[key] = from[key];
|
885 | }
|
886 | }
|
887 |
|
888 | if (getOwnPropertySymbols) {
|
889 | symbols = getOwnPropertySymbols(from);
|
890 |
|
891 | for (var i = 0; i < symbols.length; i++) {
|
892 | if (propIsEnumerable.call(from, symbols[i])) {
|
893 | to[symbols[i]] = from[symbols[i]];
|
894 | }
|
895 | }
|
896 | }
|
897 | }
|
898 |
|
899 | return to;
|
900 | };
|
901 |
|
902 | |
903 |
|
904 |
|
905 |
|
906 |
|
907 |
|
908 |
|
909 | var ReactPropTypesSecret = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED';
|
910 | var ReactPropTypesSecret_1 = ReactPropTypesSecret;
|
911 |
|
912 | var printWarning = function printWarning() {};
|
913 |
|
914 | if (process.env.NODE_ENV !== 'production') {
|
915 | var ReactPropTypesSecret$1 = ReactPropTypesSecret_1;
|
916 | var loggedTypeFailures = {};
|
917 | var has = Function.call.bind(Object.prototype.hasOwnProperty);
|
918 |
|
919 | printWarning = function printWarning(text) {
|
920 | var message = 'Warning: ' + text;
|
921 |
|
922 | if (typeof console !== 'undefined') {
|
923 | console.error(message);
|
924 | }
|
925 |
|
926 | try {
|
927 |
|
928 |
|
929 |
|
930 | throw new Error(message);
|
931 | } catch (x) {}
|
932 | };
|
933 | }
|
934 | |
935 |
|
936 |
|
937 |
|
938 |
|
939 |
|
940 |
|
941 |
|
942 |
|
943 |
|
944 |
|
945 |
|
946 |
|
947 | function checkPropTypes(typeSpecs, values, location, componentName, getStack) {
|
948 | if (process.env.NODE_ENV !== 'production') {
|
949 | for (var typeSpecName in typeSpecs) {
|
950 | if (has(typeSpecs, typeSpecName)) {
|
951 | var error;
|
952 |
|
953 |
|
954 |
|
955 | try {
|
956 |
|
957 |
|
958 | if (typeof typeSpecs[typeSpecName] !== 'function') {
|
959 | var err = Error((componentName || 'React class') + ': ' + location + ' type `' + typeSpecName + '` is invalid; ' + 'it must be a function, usually from the `prop-types` package, but received `' + _typeof(typeSpecs[typeSpecName]) + '`.');
|
960 | err.name = 'Invariant Violation';
|
961 | throw err;
|
962 | }
|
963 |
|
964 | error = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, ReactPropTypesSecret$1);
|
965 | } catch (ex) {
|
966 | error = ex;
|
967 | }
|
968 |
|
969 | if (error && !(error instanceof Error)) {
|
970 | printWarning((componentName || 'React class') + ': type specification of ' + location + ' `' + typeSpecName + '` is invalid; the type checker ' + 'function must return `null` or an `Error` but returned a ' + _typeof(error) + '. ' + 'You may have forgotten to pass an argument to the type checker ' + 'creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and ' + 'shape all require an argument).');
|
971 | }
|
972 |
|
973 | if (error instanceof Error && !(error.message in loggedTypeFailures)) {
|
974 |
|
975 |
|
976 | loggedTypeFailures[error.message] = true;
|
977 | var stack = getStack ? getStack() : '';
|
978 | printWarning('Failed ' + location + ' type: ' + error.message + (stack != null ? stack : ''));
|
979 | }
|
980 | }
|
981 | }
|
982 | }
|
983 | }
|
984 | |
985 |
|
986 |
|
987 |
|
988 |
|
989 |
|
990 |
|
991 | checkPropTypes.resetWarningCache = function () {
|
992 | if (process.env.NODE_ENV !== 'production') {
|
993 | loggedTypeFailures = {};
|
994 | }
|
995 | };
|
996 |
|
997 | var checkPropTypes_1 = checkPropTypes;
|
998 |
|
999 | var has$1 = Function.call.bind(Object.prototype.hasOwnProperty);
|
1000 |
|
1001 | var printWarning$1 = function printWarning() {};
|
1002 |
|
1003 | if (process.env.NODE_ENV !== 'production') {
|
1004 | printWarning$1 = function printWarning(text) {
|
1005 | var message = 'Warning: ' + text;
|
1006 |
|
1007 | if (typeof console !== 'undefined') {
|
1008 | console.error(message);
|
1009 | }
|
1010 |
|
1011 | try {
|
1012 |
|
1013 |
|
1014 |
|
1015 | throw new Error(message);
|
1016 | } catch (x) {}
|
1017 | };
|
1018 | }
|
1019 |
|
1020 | function emptyFunctionThatReturnsNull() {
|
1021 | return null;
|
1022 | }
|
1023 |
|
1024 | var factoryWithTypeCheckers = function factoryWithTypeCheckers(isValidElement, throwOnDirectAccess) {
|
1025 |
|
1026 | var ITERATOR_SYMBOL = typeof Symbol === 'function' && Symbol.iterator;
|
1027 | var FAUX_ITERATOR_SYMBOL = '@@iterator';
|
1028 |
|
1029 | |
1030 |
|
1031 |
|
1032 |
|
1033 |
|
1034 |
|
1035 |
|
1036 |
|
1037 |
|
1038 |
|
1039 |
|
1040 |
|
1041 |
|
1042 |
|
1043 |
|
1044 | function getIteratorFn(maybeIterable) {
|
1045 | var iteratorFn = maybeIterable && (ITERATOR_SYMBOL && maybeIterable[ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL]);
|
1046 |
|
1047 | if (typeof iteratorFn === 'function') {
|
1048 | return iteratorFn;
|
1049 | }
|
1050 | }
|
1051 | |
1052 |
|
1053 |
|
1054 |
|
1055 |
|
1056 |
|
1057 |
|
1058 |
|
1059 |
|
1060 |
|
1061 |
|
1062 |
|
1063 |
|
1064 |
|
1065 |
|
1066 |
|
1067 |
|
1068 |
|
1069 |
|
1070 |
|
1071 |
|
1072 |
|
1073 |
|
1074 |
|
1075 |
|
1076 |
|
1077 |
|
1078 |
|
1079 |
|
1080 |
|
1081 |
|
1082 |
|
1083 |
|
1084 |
|
1085 |
|
1086 |
|
1087 |
|
1088 |
|
1089 |
|
1090 |
|
1091 |
|
1092 |
|
1093 |
|
1094 |
|
1095 |
|
1096 |
|
1097 |
|
1098 |
|
1099 | var ANONYMOUS = '<<anonymous>>';
|
1100 |
|
1101 |
|
1102 | var ReactPropTypes = {
|
1103 | array: createPrimitiveTypeChecker('array'),
|
1104 | bool: createPrimitiveTypeChecker('boolean'),
|
1105 | func: createPrimitiveTypeChecker('function'),
|
1106 | number: createPrimitiveTypeChecker('number'),
|
1107 | object: createPrimitiveTypeChecker('object'),
|
1108 | string: createPrimitiveTypeChecker('string'),
|
1109 | symbol: createPrimitiveTypeChecker('symbol'),
|
1110 | any: createAnyTypeChecker(),
|
1111 | arrayOf: createArrayOfTypeChecker,
|
1112 | element: createElementTypeChecker(),
|
1113 | elementType: createElementTypeTypeChecker(),
|
1114 | instanceOf: createInstanceTypeChecker,
|
1115 | node: createNodeChecker(),
|
1116 | objectOf: createObjectOfTypeChecker,
|
1117 | oneOf: createEnumTypeChecker,
|
1118 | oneOfType: createUnionTypeChecker,
|
1119 | shape: createShapeTypeChecker,
|
1120 | exact: createStrictShapeTypeChecker
|
1121 | };
|
1122 | |
1123 |
|
1124 |
|
1125 |
|
1126 |
|
1127 |
|
1128 |
|
1129 | function is(x, y) {
|
1130 |
|
1131 | if (x === y) {
|
1132 |
|
1133 |
|
1134 | return x !== 0 || 1 / x === 1 / y;
|
1135 | } else {
|
1136 |
|
1137 | return x !== x && y !== y;
|
1138 | }
|
1139 | }
|
1140 |
|
1141 |
|
1142 | |
1143 |
|
1144 |
|
1145 |
|
1146 |
|
1147 |
|
1148 |
|
1149 |
|
1150 |
|
1151 | function PropTypeError(message) {
|
1152 | this.message = message;
|
1153 | this.stack = '';
|
1154 | }
|
1155 |
|
1156 |
|
1157 | PropTypeError.prototype = Error.prototype;
|
1158 |
|
1159 | function createChainableTypeChecker(validate) {
|
1160 | if (process.env.NODE_ENV !== 'production') {
|
1161 | var manualPropTypeCallCache = {};
|
1162 | var manualPropTypeWarningCount = 0;
|
1163 | }
|
1164 |
|
1165 | function checkType(isRequired, props, propName, componentName, location, propFullName, secret) {
|
1166 | componentName = componentName || ANONYMOUS;
|
1167 | propFullName = propFullName || propName;
|
1168 |
|
1169 | if (secret !== ReactPropTypesSecret_1) {
|
1170 | if (throwOnDirectAccess) {
|
1171 |
|
1172 | var err = new Error('Calling PropTypes validators directly is not supported by the `prop-types` package. ' + 'Use `PropTypes.checkPropTypes()` to call them. ' + 'Read more at http://fb.me/use-check-prop-types');
|
1173 | err.name = 'Invariant Violation';
|
1174 | throw err;
|
1175 | } else if (process.env.NODE_ENV !== 'production' && typeof console !== 'undefined') {
|
1176 |
|
1177 | var cacheKey = componentName + ':' + propName;
|
1178 |
|
1179 | if (!manualPropTypeCallCache[cacheKey] &&
|
1180 | manualPropTypeWarningCount < 3) {
|
1181 | printWarning$1('You are manually calling a React.PropTypes validation ' + 'function for the `' + propFullName + '` prop on `' + componentName + '`. This is deprecated ' + 'and will throw in the standalone `prop-types` package. ' + 'You may be seeing this warning due to a third-party PropTypes ' + 'library. See https://fb.me/react-warning-dont-call-proptypes ' + 'for details.');
|
1182 | manualPropTypeCallCache[cacheKey] = true;
|
1183 | manualPropTypeWarningCount++;
|
1184 | }
|
1185 | }
|
1186 | }
|
1187 |
|
1188 | if (props[propName] == null) {
|
1189 | if (isRequired) {
|
1190 | if (props[propName] === null) {
|
1191 | return new PropTypeError('The ' + location + ' `' + propFullName + '` is marked as required ' + ('in `' + componentName + '`, but its value is `null`.'));
|
1192 | }
|
1193 |
|
1194 | return new PropTypeError('The ' + location + ' `' + propFullName + '` is marked as required in ' + ('`' + componentName + '`, but its value is `undefined`.'));
|
1195 | }
|
1196 |
|
1197 | return null;
|
1198 | } else {
|
1199 | return validate(props, propName, componentName, location, propFullName);
|
1200 | }
|
1201 | }
|
1202 |
|
1203 | var chainedCheckType = checkType.bind(null, false);
|
1204 | chainedCheckType.isRequired = checkType.bind(null, true);
|
1205 | return chainedCheckType;
|
1206 | }
|
1207 |
|
1208 | function createPrimitiveTypeChecker(expectedType) {
|
1209 | function validate(props, propName, componentName, location, propFullName, secret) {
|
1210 | var propValue = props[propName];
|
1211 | var propType = getPropType(propValue);
|
1212 |
|
1213 | if (propType !== expectedType) {
|
1214 |
|
1215 |
|
1216 |
|
1217 | var preciseType = getPreciseType(propValue);
|
1218 | return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + preciseType + '` supplied to `' + componentName + '`, expected ') + ('`' + expectedType + '`.'));
|
1219 | }
|
1220 |
|
1221 | return null;
|
1222 | }
|
1223 |
|
1224 | return createChainableTypeChecker(validate);
|
1225 | }
|
1226 |
|
1227 | function createAnyTypeChecker() {
|
1228 | return createChainableTypeChecker(emptyFunctionThatReturnsNull);
|
1229 | }
|
1230 |
|
1231 | function createArrayOfTypeChecker(typeChecker) {
|
1232 | function validate(props, propName, componentName, location, propFullName) {
|
1233 | if (typeof typeChecker !== 'function') {
|
1234 | return new PropTypeError('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside arrayOf.');
|
1235 | }
|
1236 |
|
1237 | var propValue = props[propName];
|
1238 |
|
1239 | if (!Array.isArray(propValue)) {
|
1240 | var propType = getPropType(propValue);
|
1241 | return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an array.'));
|
1242 | }
|
1243 |
|
1244 | for (var i = 0; i < propValue.length; i++) {
|
1245 | var error = typeChecker(propValue, i, componentName, location, propFullName + '[' + i + ']', ReactPropTypesSecret_1);
|
1246 |
|
1247 | if (error instanceof Error) {
|
1248 | return error;
|
1249 | }
|
1250 | }
|
1251 |
|
1252 | return null;
|
1253 | }
|
1254 |
|
1255 | return createChainableTypeChecker(validate);
|
1256 | }
|
1257 |
|
1258 | function createElementTypeChecker() {
|
1259 | function validate(props, propName, componentName, location, propFullName) {
|
1260 | var propValue = props[propName];
|
1261 |
|
1262 | if (!isValidElement(propValue)) {
|
1263 | var propType = getPropType(propValue);
|
1264 | return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected a single ReactElement.'));
|
1265 | }
|
1266 |
|
1267 | return null;
|
1268 | }
|
1269 |
|
1270 | return createChainableTypeChecker(validate);
|
1271 | }
|
1272 |
|
1273 | function createElementTypeTypeChecker() {
|
1274 | function validate(props, propName, componentName, location, propFullName) {
|
1275 | var propValue = props[propName];
|
1276 |
|
1277 | if (!reactIs.isValidElementType(propValue)) {
|
1278 | var propType = getPropType(propValue);
|
1279 | return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected a single ReactElement type.'));
|
1280 | }
|
1281 |
|
1282 | return null;
|
1283 | }
|
1284 |
|
1285 | return createChainableTypeChecker(validate);
|
1286 | }
|
1287 |
|
1288 | function createInstanceTypeChecker(expectedClass) {
|
1289 | function validate(props, propName, componentName, location, propFullName) {
|
1290 | if (!(props[propName] instanceof expectedClass)) {
|
1291 | var expectedClassName = expectedClass.name || ANONYMOUS;
|
1292 | var actualClassName = getClassName(props[propName]);
|
1293 | return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + actualClassName + '` supplied to `' + componentName + '`, expected ') + ('instance of `' + expectedClassName + '`.'));
|
1294 | }
|
1295 |
|
1296 | return null;
|
1297 | }
|
1298 |
|
1299 | return createChainableTypeChecker(validate);
|
1300 | }
|
1301 |
|
1302 | function createEnumTypeChecker(expectedValues) {
|
1303 | if (!Array.isArray(expectedValues)) {
|
1304 | if (process.env.NODE_ENV !== 'production') {
|
1305 | if (arguments.length > 1) {
|
1306 | printWarning$1('Invalid arguments supplied to oneOf, expected an array, got ' + arguments.length + ' arguments. ' + 'A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z]).');
|
1307 | } else {
|
1308 | printWarning$1('Invalid argument supplied to oneOf, expected an array.');
|
1309 | }
|
1310 | }
|
1311 |
|
1312 | return emptyFunctionThatReturnsNull;
|
1313 | }
|
1314 |
|
1315 | function validate(props, propName, componentName, location, propFullName) {
|
1316 | var propValue = props[propName];
|
1317 |
|
1318 | for (var i = 0; i < expectedValues.length; i++) {
|
1319 | if (is(propValue, expectedValues[i])) {
|
1320 | return null;
|
1321 | }
|
1322 | }
|
1323 |
|
1324 | var valuesString = JSON.stringify(expectedValues, function replacer(key, value) {
|
1325 | var type = getPreciseType(value);
|
1326 |
|
1327 | if (type === 'symbol') {
|
1328 | return String(value);
|
1329 | }
|
1330 |
|
1331 | return value;
|
1332 | });
|
1333 | return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of value `' + String(propValue) + '` ' + ('supplied to `' + componentName + '`, expected one of ' + valuesString + '.'));
|
1334 | }
|
1335 |
|
1336 | return createChainableTypeChecker(validate);
|
1337 | }
|
1338 |
|
1339 | function createObjectOfTypeChecker(typeChecker) {
|
1340 | function validate(props, propName, componentName, location, propFullName) {
|
1341 | if (typeof typeChecker !== 'function') {
|
1342 | return new PropTypeError('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside objectOf.');
|
1343 | }
|
1344 |
|
1345 | var propValue = props[propName];
|
1346 | var propType = getPropType(propValue);
|
1347 |
|
1348 | if (propType !== 'object') {
|
1349 | return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an object.'));
|
1350 | }
|
1351 |
|
1352 | for (var key in propValue) {
|
1353 | if (has$1(propValue, key)) {
|
1354 | var error = typeChecker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret_1);
|
1355 |
|
1356 | if (error instanceof Error) {
|
1357 | return error;
|
1358 | }
|
1359 | }
|
1360 | }
|
1361 |
|
1362 | return null;
|
1363 | }
|
1364 |
|
1365 | return createChainableTypeChecker(validate);
|
1366 | }
|
1367 |
|
1368 | function createUnionTypeChecker(arrayOfTypeCheckers) {
|
1369 | if (!Array.isArray(arrayOfTypeCheckers)) {
|
1370 | process.env.NODE_ENV !== 'production' ? printWarning$1('Invalid argument supplied to oneOfType, expected an instance of array.') : void 0;
|
1371 | return emptyFunctionThatReturnsNull;
|
1372 | }
|
1373 |
|
1374 | for (var i = 0; i < arrayOfTypeCheckers.length; i++) {
|
1375 | var checker = arrayOfTypeCheckers[i];
|
1376 |
|
1377 | if (typeof checker !== 'function') {
|
1378 | printWarning$1('Invalid argument supplied to oneOfType. Expected an array of check functions, but ' + 'received ' + getPostfixForTypeWarning(checker) + ' at index ' + i + '.');
|
1379 | return emptyFunctionThatReturnsNull;
|
1380 | }
|
1381 | }
|
1382 |
|
1383 | function validate(props, propName, componentName, location, propFullName) {
|
1384 | for (var i = 0; i < arrayOfTypeCheckers.length; i++) {
|
1385 | var checker = arrayOfTypeCheckers[i];
|
1386 |
|
1387 | if (checker(props, propName, componentName, location, propFullName, ReactPropTypesSecret_1) == null) {
|
1388 | return null;
|
1389 | }
|
1390 | }
|
1391 |
|
1392 | return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`.'));
|
1393 | }
|
1394 |
|
1395 | return createChainableTypeChecker(validate);
|
1396 | }
|
1397 |
|
1398 | function createNodeChecker() {
|
1399 | function validate(props, propName, componentName, location, propFullName) {
|
1400 | if (!isNode(props[propName])) {
|
1401 | return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`, expected a ReactNode.'));
|
1402 | }
|
1403 |
|
1404 | return null;
|
1405 | }
|
1406 |
|
1407 | return createChainableTypeChecker(validate);
|
1408 | }
|
1409 |
|
1410 | function createShapeTypeChecker(shapeTypes) {
|
1411 | function validate(props, propName, componentName, location, propFullName) {
|
1412 | var propValue = props[propName];
|
1413 | var propType = getPropType(propValue);
|
1414 |
|
1415 | if (propType !== 'object') {
|
1416 | return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type `' + propType + '` ' + ('supplied to `' + componentName + '`, expected `object`.'));
|
1417 | }
|
1418 |
|
1419 | for (var key in shapeTypes) {
|
1420 | var checker = shapeTypes[key];
|
1421 |
|
1422 | if (!checker) {
|
1423 | continue;
|
1424 | }
|
1425 |
|
1426 | var error = checker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret_1);
|
1427 |
|
1428 | if (error) {
|
1429 | return error;
|
1430 | }
|
1431 | }
|
1432 |
|
1433 | return null;
|
1434 | }
|
1435 |
|
1436 | return createChainableTypeChecker(validate);
|
1437 | }
|
1438 |
|
1439 | function createStrictShapeTypeChecker(shapeTypes) {
|
1440 | function validate(props, propName, componentName, location, propFullName) {
|
1441 | var propValue = props[propName];
|
1442 | var propType = getPropType(propValue);
|
1443 |
|
1444 | if (propType !== 'object') {
|
1445 | return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type `' + propType + '` ' + ('supplied to `' + componentName + '`, expected `object`.'));
|
1446 | }
|
1447 |
|
1448 |
|
1449 |
|
1450 | var allKeys = objectAssign({}, props[propName], shapeTypes);
|
1451 |
|
1452 | for (var key in allKeys) {
|
1453 | var checker = shapeTypes[key];
|
1454 |
|
1455 | if (!checker) {
|
1456 | return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` key `' + key + '` supplied to `' + componentName + '`.' + '\nBad object: ' + JSON.stringify(props[propName], null, ' ') + '\nValid keys: ' + JSON.stringify(Object.keys(shapeTypes), null, ' '));
|
1457 | }
|
1458 |
|
1459 | var error = checker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret_1);
|
1460 |
|
1461 | if (error) {
|
1462 | return error;
|
1463 | }
|
1464 | }
|
1465 |
|
1466 | return null;
|
1467 | }
|
1468 |
|
1469 | return createChainableTypeChecker(validate);
|
1470 | }
|
1471 |
|
1472 | function isNode(propValue) {
|
1473 | switch (_typeof(propValue)) {
|
1474 | case 'number':
|
1475 | case 'string':
|
1476 | case 'undefined':
|
1477 | return true;
|
1478 |
|
1479 | case 'boolean':
|
1480 | return !propValue;
|
1481 |
|
1482 | case 'object':
|
1483 | if (Array.isArray(propValue)) {
|
1484 | return propValue.every(isNode);
|
1485 | }
|
1486 |
|
1487 | if (propValue === null || isValidElement(propValue)) {
|
1488 | return true;
|
1489 | }
|
1490 |
|
1491 | var iteratorFn = getIteratorFn(propValue);
|
1492 |
|
1493 | if (iteratorFn) {
|
1494 | var iterator = iteratorFn.call(propValue);
|
1495 | var step;
|
1496 |
|
1497 | if (iteratorFn !== propValue.entries) {
|
1498 | while (!(step = iterator.next()).done) {
|
1499 | if (!isNode(step.value)) {
|
1500 | return false;
|
1501 | }
|
1502 | }
|
1503 | } else {
|
1504 |
|
1505 | while (!(step = iterator.next()).done) {
|
1506 | var entry = step.value;
|
1507 |
|
1508 | if (entry) {
|
1509 | if (!isNode(entry[1])) {
|
1510 | return false;
|
1511 | }
|
1512 | }
|
1513 | }
|
1514 | }
|
1515 | } else {
|
1516 | return false;
|
1517 | }
|
1518 |
|
1519 | return true;
|
1520 |
|
1521 | default:
|
1522 | return false;
|
1523 | }
|
1524 | }
|
1525 |
|
1526 | function isSymbol(propType, propValue) {
|
1527 |
|
1528 | if (propType === 'symbol') {
|
1529 | return true;
|
1530 | }
|
1531 |
|
1532 |
|
1533 | if (!propValue) {
|
1534 | return false;
|
1535 | }
|
1536 |
|
1537 |
|
1538 | if (propValue['@@toStringTag'] === 'Symbol') {
|
1539 | return true;
|
1540 | }
|
1541 |
|
1542 |
|
1543 | if (typeof Symbol === 'function' && propValue instanceof Symbol) {
|
1544 | return true;
|
1545 | }
|
1546 |
|
1547 | return false;
|
1548 | }
|
1549 |
|
1550 |
|
1551 | function getPropType(propValue) {
|
1552 | var propType = _typeof(propValue);
|
1553 |
|
1554 | if (Array.isArray(propValue)) {
|
1555 | return 'array';
|
1556 | }
|
1557 |
|
1558 | if (propValue instanceof RegExp) {
|
1559 |
|
1560 |
|
1561 |
|
1562 | return 'object';
|
1563 | }
|
1564 |
|
1565 | if (isSymbol(propType, propValue)) {
|
1566 | return 'symbol';
|
1567 | }
|
1568 |
|
1569 | return propType;
|
1570 | }
|
1571 |
|
1572 |
|
1573 |
|
1574 | function getPreciseType(propValue) {
|
1575 | if (typeof propValue === 'undefined' || propValue === null) {
|
1576 | return '' + propValue;
|
1577 | }
|
1578 |
|
1579 | var propType = getPropType(propValue);
|
1580 |
|
1581 | if (propType === 'object') {
|
1582 | if (propValue instanceof Date) {
|
1583 | return 'date';
|
1584 | } else if (propValue instanceof RegExp) {
|
1585 | return 'regexp';
|
1586 | }
|
1587 | }
|
1588 |
|
1589 | return propType;
|
1590 | }
|
1591 |
|
1592 |
|
1593 |
|
1594 | function getPostfixForTypeWarning(value) {
|
1595 | var type = getPreciseType(value);
|
1596 |
|
1597 | switch (type) {
|
1598 | case 'array':
|
1599 | case 'object':
|
1600 | return 'an ' + type;
|
1601 |
|
1602 | case 'boolean':
|
1603 | case 'date':
|
1604 | case 'regexp':
|
1605 | return 'a ' + type;
|
1606 |
|
1607 | default:
|
1608 | return type;
|
1609 | }
|
1610 | }
|
1611 |
|
1612 |
|
1613 | function getClassName(propValue) {
|
1614 | if (!propValue.constructor || !propValue.constructor.name) {
|
1615 | return ANONYMOUS;
|
1616 | }
|
1617 |
|
1618 | return propValue.constructor.name;
|
1619 | }
|
1620 |
|
1621 | ReactPropTypes.checkPropTypes = checkPropTypes_1;
|
1622 | ReactPropTypes.resetWarningCache = checkPropTypes_1.resetWarningCache;
|
1623 | ReactPropTypes.PropTypes = ReactPropTypes;
|
1624 | return ReactPropTypes;
|
1625 | };
|
1626 |
|
1627 | function emptyFunction() {}
|
1628 |
|
1629 | function emptyFunctionWithReset() {}
|
1630 |
|
1631 | emptyFunctionWithReset.resetWarningCache = emptyFunction;
|
1632 |
|
1633 | var factoryWithThrowingShims = function factoryWithThrowingShims() {
|
1634 | function shim(props, propName, componentName, location, propFullName, secret) {
|
1635 | if (secret === ReactPropTypesSecret_1) {
|
1636 |
|
1637 | return;
|
1638 | }
|
1639 |
|
1640 | var err = new Error('Calling PropTypes validators directly is not supported by the `prop-types` package. ' + 'Use PropTypes.checkPropTypes() to call them. ' + 'Read more at http://fb.me/use-check-prop-types');
|
1641 | err.name = 'Invariant Violation';
|
1642 | throw err;
|
1643 | }
|
1644 | shim.isRequired = shim;
|
1645 |
|
1646 | function getShim() {
|
1647 | return shim;
|
1648 | }
|
1649 |
|
1650 |
|
1651 | var ReactPropTypes = {
|
1652 | array: shim,
|
1653 | bool: shim,
|
1654 | func: shim,
|
1655 | number: shim,
|
1656 | object: shim,
|
1657 | string: shim,
|
1658 | symbol: shim,
|
1659 | any: shim,
|
1660 | arrayOf: getShim,
|
1661 | element: shim,
|
1662 | elementType: shim,
|
1663 | instanceOf: getShim,
|
1664 | node: shim,
|
1665 | objectOf: getShim,
|
1666 | oneOf: getShim,
|
1667 | oneOfType: getShim,
|
1668 | shape: getShim,
|
1669 | exact: getShim,
|
1670 | checkPropTypes: emptyFunctionWithReset,
|
1671 | resetWarningCache: emptyFunction
|
1672 | };
|
1673 | ReactPropTypes.PropTypes = ReactPropTypes;
|
1674 | return ReactPropTypes;
|
1675 | };
|
1676 |
|
1677 | var propTypes = createCommonjsModule(function (module) {
|
1678 | |
1679 |
|
1680 |
|
1681 |
|
1682 |
|
1683 |
|
1684 | if (process.env.NODE_ENV !== 'production') {
|
1685 | var ReactIs = reactIs;
|
1686 |
|
1687 |
|
1688 | var throwOnDirectAccess = true;
|
1689 | module.exports = factoryWithTypeCheckers(ReactIs.isElement, throwOnDirectAccess);
|
1690 | } else {
|
1691 |
|
1692 |
|
1693 | module.exports = factoryWithThrowingShims();
|
1694 | }
|
1695 | });
|
1696 |
|
1697 |
|
1698 |
|
1699 | var freeGlobal = _typeof(commonjsGlobal) == 'object' && commonjsGlobal && commonjsGlobal.Object === Object && commonjsGlobal;
|
1700 | var _freeGlobal = freeGlobal;
|
1701 |
|
1702 |
|
1703 |
|
1704 | var freeSelf = (typeof self === "undefined" ? "undefined" : _typeof(self)) == 'object' && self && self.Object === Object && self;
|
1705 |
|
1706 |
|
1707 | var root = _freeGlobal || freeSelf || Function('return this')();
|
1708 | var _root = root;
|
1709 |
|
1710 |
|
1711 |
|
1712 | var _Symbol2 = _root.Symbol;
|
1713 | var _Symbol = _Symbol2;
|
1714 |
|
1715 | |
1716 |
|
1717 |
|
1718 |
|
1719 |
|
1720 |
|
1721 |
|
1722 |
|
1723 |
|
1724 | function arrayMap(array, iteratee) {
|
1725 | var index = -1,
|
1726 | length = array == null ? 0 : array.length,
|
1727 | result = Array(length);
|
1728 |
|
1729 | while (++index < length) {
|
1730 | result[index] = iteratee(array[index], index, array);
|
1731 | }
|
1732 |
|
1733 | return result;
|
1734 | }
|
1735 |
|
1736 | var _arrayMap = arrayMap;
|
1737 |
|
1738 | |
1739 |
|
1740 |
|
1741 |
|
1742 |
|
1743 |
|
1744 |
|
1745 |
|
1746 |
|
1747 |
|
1748 |
|
1749 |
|
1750 |
|
1751 |
|
1752 |
|
1753 |
|
1754 |
|
1755 |
|
1756 |
|
1757 |
|
1758 |
|
1759 |
|
1760 |
|
1761 | var isArray = Array.isArray;
|
1762 | var isArray_1 = isArray;
|
1763 |
|
1764 |
|
1765 |
|
1766 | var objectProto = Object.prototype;
|
1767 |
|
1768 |
|
1769 | var hasOwnProperty$1 = objectProto.hasOwnProperty;
|
1770 | |
1771 |
|
1772 |
|
1773 |
|
1774 |
|
1775 |
|
1776 | var nativeObjectToString = objectProto.toString;
|
1777 |
|
1778 |
|
1779 | var symToStringTag = _Symbol ? _Symbol.toStringTag : undefined;
|
1780 | |
1781 |
|
1782 |
|
1783 |
|
1784 |
|
1785 |
|
1786 |
|
1787 |
|
1788 | function getRawTag(value) {
|
1789 | var isOwn = hasOwnProperty$1.call(value, symToStringTag),
|
1790 | tag = value[symToStringTag];
|
1791 |
|
1792 | try {
|
1793 | value[symToStringTag] = undefined;
|
1794 | var unmasked = true;
|
1795 | } catch (e) {}
|
1796 |
|
1797 | var result = nativeObjectToString.call(value);
|
1798 |
|
1799 | if (unmasked) {
|
1800 | if (isOwn) {
|
1801 | value[symToStringTag] = tag;
|
1802 | } else {
|
1803 | delete value[symToStringTag];
|
1804 | }
|
1805 | }
|
1806 |
|
1807 | return result;
|
1808 | }
|
1809 |
|
1810 | var _getRawTag = getRawTag;
|
1811 |
|
1812 |
|
1813 | var objectProto$1 = Object.prototype;
|
1814 | |
1815 |
|
1816 |
|
1817 |
|
1818 |
|
1819 |
|
1820 | var nativeObjectToString$1 = objectProto$1.toString;
|
1821 | |
1822 |
|
1823 |
|
1824 |
|
1825 |
|
1826 |
|
1827 |
|
1828 |
|
1829 | function objectToString(value) {
|
1830 | return nativeObjectToString$1.call(value);
|
1831 | }
|
1832 |
|
1833 | var _objectToString = objectToString;
|
1834 |
|
1835 |
|
1836 |
|
1837 | var nullTag = '[object Null]',
|
1838 | undefinedTag = '[object Undefined]';
|
1839 |
|
1840 |
|
1841 | var symToStringTag$1 = _Symbol ? _Symbol.toStringTag : undefined;
|
1842 | |
1843 |
|
1844 |
|
1845 |
|
1846 |
|
1847 |
|
1848 |
|
1849 |
|
1850 | function baseGetTag(value) {
|
1851 | if (value == null) {
|
1852 | return value === undefined ? undefinedTag : nullTag;
|
1853 | }
|
1854 |
|
1855 | return symToStringTag$1 && symToStringTag$1 in Object(value) ? _getRawTag(value) : _objectToString(value);
|
1856 | }
|
1857 |
|
1858 | var _baseGetTag = baseGetTag;
|
1859 |
|
1860 | |
1861 |
|
1862 |
|
1863 |
|
1864 |
|
1865 |
|
1866 |
|
1867 |
|
1868 |
|
1869 |
|
1870 |
|
1871 |
|
1872 |
|
1873 |
|
1874 |
|
1875 |
|
1876 |
|
1877 |
|
1878 |
|
1879 |
|
1880 |
|
1881 |
|
1882 |
|
1883 |
|
1884 | function isObjectLike(value) {
|
1885 | return value != null && _typeof(value) == 'object';
|
1886 | }
|
1887 |
|
1888 | var isObjectLike_1 = isObjectLike;
|
1889 |
|
1890 |
|
1891 |
|
1892 | var symbolTag = '[object Symbol]';
|
1893 | |
1894 |
|
1895 |
|
1896 |
|
1897 |
|
1898 |
|
1899 |
|
1900 |
|
1901 |
|
1902 |
|
1903 |
|
1904 |
|
1905 |
|
1906 |
|
1907 |
|
1908 |
|
1909 |
|
1910 |
|
1911 | function isSymbol(value) {
|
1912 | return _typeof(value) == 'symbol' || isObjectLike_1(value) && _baseGetTag(value) == symbolTag;
|
1913 | }
|
1914 |
|
1915 | var isSymbol_1 = isSymbol;
|
1916 |
|
1917 |
|
1918 |
|
1919 | var INFINITY = 1 / 0;
|
1920 |
|
1921 |
|
1922 | var symbolProto = _Symbol ? _Symbol.prototype : undefined,
|
1923 | symbolToString = symbolProto ? symbolProto.toString : undefined;
|
1924 | |
1925 |
|
1926 |
|
1927 |
|
1928 |
|
1929 |
|
1930 |
|
1931 |
|
1932 |
|
1933 | function baseToString(value) {
|
1934 |
|
1935 | if (typeof value == 'string') {
|
1936 | return value;
|
1937 | }
|
1938 |
|
1939 | if (isArray_1(value)) {
|
1940 |
|
1941 | return _arrayMap(value, baseToString) + '';
|
1942 | }
|
1943 |
|
1944 | if (isSymbol_1(value)) {
|
1945 | return symbolToString ? symbolToString.call(value) : '';
|
1946 | }
|
1947 |
|
1948 | var result = value + '';
|
1949 | return result == '0' && 1 / value == -INFINITY ? '-0' : result;
|
1950 | }
|
1951 |
|
1952 | var _baseToString = baseToString;
|
1953 |
|
1954 | |
1955 |
|
1956 |
|
1957 |
|
1958 |
|
1959 |
|
1960 |
|
1961 |
|
1962 |
|
1963 |
|
1964 |
|
1965 |
|
1966 |
|
1967 |
|
1968 |
|
1969 |
|
1970 |
|
1971 |
|
1972 |
|
1973 |
|
1974 |
|
1975 |
|
1976 | function toString(value) {
|
1977 | return value == null ? '' : _baseToString(value);
|
1978 | }
|
1979 |
|
1980 | var toString_1 = toString;
|
1981 |
|
1982 | |
1983 |
|
1984 |
|
1985 |
|
1986 |
|
1987 |
|
1988 |
|
1989 |
|
1990 |
|
1991 | function baseSlice(array, start, end) {
|
1992 | var index = -1,
|
1993 | length = array.length;
|
1994 |
|
1995 | if (start < 0) {
|
1996 | start = -start > length ? 0 : length + start;
|
1997 | }
|
1998 |
|
1999 | end = end > length ? length : end;
|
2000 |
|
2001 | if (end < 0) {
|
2002 | end += length;
|
2003 | }
|
2004 |
|
2005 | length = start > end ? 0 : end - start >>> 0;
|
2006 | start >>>= 0;
|
2007 | var result = Array(length);
|
2008 |
|
2009 | while (++index < length) {
|
2010 | result[index] = array[index + start];
|
2011 | }
|
2012 |
|
2013 | return result;
|
2014 | }
|
2015 |
|
2016 | var _baseSlice = baseSlice;
|
2017 |
|
2018 | |
2019 |
|
2020 |
|
2021 |
|
2022 |
|
2023 |
|
2024 |
|
2025 |
|
2026 |
|
2027 |
|
2028 | function castSlice(array, start, end) {
|
2029 | var length = array.length;
|
2030 | end = end === undefined ? length : end;
|
2031 | return !start && end >= length ? array : _baseSlice(array, start, end);
|
2032 | }
|
2033 |
|
2034 | var _castSlice = castSlice;
|
2035 |
|
2036 |
|
2037 | var rsAstralRange = "\\ud800-\\udfff",
|
2038 | rsComboMarksRange = "\\u0300-\\u036f",
|
2039 | reComboHalfMarksRange = "\\ufe20-\\ufe2f",
|
2040 | rsComboSymbolsRange = "\\u20d0-\\u20ff",
|
2041 | rsComboRange = rsComboMarksRange + reComboHalfMarksRange + rsComboSymbolsRange,
|
2042 | rsVarRange = "\\ufe0e\\ufe0f";
|
2043 |
|
2044 |
|
2045 | var rsZWJ = "\\u200d";
|
2046 |
|
2047 |
|
2048 | var reHasUnicode = RegExp('[' + rsZWJ + rsAstralRange + rsComboRange + rsVarRange + ']');
|
2049 | |
2050 |
|
2051 |
|
2052 |
|
2053 |
|
2054 |
|
2055 |
|
2056 |
|
2057 | function hasUnicode(string) {
|
2058 | return reHasUnicode.test(string);
|
2059 | }
|
2060 |
|
2061 | var _hasUnicode = hasUnicode;
|
2062 |
|
2063 | |
2064 |
|
2065 |
|
2066 |
|
2067 |
|
2068 |
|
2069 |
|
2070 | function asciiToArray(string) {
|
2071 | return string.split('');
|
2072 | }
|
2073 |
|
2074 | var _asciiToArray = asciiToArray;
|
2075 |
|
2076 |
|
2077 | var rsAstralRange$1 = "\\ud800-\\udfff",
|
2078 | rsComboMarksRange$1 = "\\u0300-\\u036f",
|
2079 | reComboHalfMarksRange$1 = "\\ufe20-\\ufe2f",
|
2080 | rsComboSymbolsRange$1 = "\\u20d0-\\u20ff",
|
2081 | rsComboRange$1 = rsComboMarksRange$1 + reComboHalfMarksRange$1 + rsComboSymbolsRange$1,
|
2082 | rsVarRange$1 = "\\ufe0e\\ufe0f";
|
2083 |
|
2084 |
|
2085 | var rsAstral = '[' + rsAstralRange$1 + ']',
|
2086 | rsCombo = '[' + rsComboRange$1 + ']',
|
2087 | rsFitz = "\\ud83c[\\udffb-\\udfff]",
|
2088 | rsModifier = '(?:' + rsCombo + '|' + rsFitz + ')',
|
2089 | rsNonAstral = '[^' + rsAstralRange$1 + ']',
|
2090 | rsRegional = "(?:\\ud83c[\\udde6-\\uddff]){2}",
|
2091 | rsSurrPair = "[\\ud800-\\udbff][\\udc00-\\udfff]",
|
2092 | rsZWJ$1 = "\\u200d";
|
2093 |
|
2094 |
|
2095 | var reOptMod = rsModifier + '?',
|
2096 | rsOptVar = '[' + rsVarRange$1 + ']?',
|
2097 | rsOptJoin = '(?:' + rsZWJ$1 + '(?:' + [rsNonAstral, rsRegional, rsSurrPair].join('|') + ')' + rsOptVar + reOptMod + ')*',
|
2098 | rsSeq = rsOptVar + reOptMod + rsOptJoin,
|
2099 | rsSymbol = '(?:' + [rsNonAstral + rsCombo + '?', rsCombo, rsRegional, rsSurrPair, rsAstral].join('|') + ')';
|
2100 |
|
2101 |
|
2102 | var reUnicode = RegExp(rsFitz + '(?=' + rsFitz + ')|' + rsSymbol + rsSeq, 'g');
|
2103 | |
2104 |
|
2105 |
|
2106 |
|
2107 |
|
2108 |
|
2109 |
|
2110 |
|
2111 | function unicodeToArray(string) {
|
2112 | return string.match(reUnicode) || [];
|
2113 | }
|
2114 |
|
2115 | var _unicodeToArray = unicodeToArray;
|
2116 |
|
2117 | |
2118 |
|
2119 |
|
2120 |
|
2121 |
|
2122 |
|
2123 |
|
2124 |
|
2125 | function stringToArray(string) {
|
2126 | return _hasUnicode(string) ? _unicodeToArray(string) : _asciiToArray(string);
|
2127 | }
|
2128 |
|
2129 | var _stringToArray = stringToArray;
|
2130 |
|
2131 | |
2132 |
|
2133 |
|
2134 |
|
2135 |
|
2136 |
|
2137 |
|
2138 |
|
2139 | function createCaseFirst(methodName) {
|
2140 | return function (string) {
|
2141 | string = toString_1(string);
|
2142 | var strSymbols = _hasUnicode(string) ? _stringToArray(string) : undefined;
|
2143 | var chr = strSymbols ? strSymbols[0] : string.charAt(0);
|
2144 | var trailing = strSymbols ? _castSlice(strSymbols, 1).join('') : string.slice(1);
|
2145 | return chr[methodName]() + trailing;
|
2146 | };
|
2147 | }
|
2148 |
|
2149 | var _createCaseFirst = createCaseFirst;
|
2150 |
|
2151 | |
2152 |
|
2153 |
|
2154 |
|
2155 |
|
2156 |
|
2157 |
|
2158 |
|
2159 |
|
2160 |
|
2161 |
|
2162 |
|
2163 |
|
2164 |
|
2165 |
|
2166 |
|
2167 |
|
2168 |
|
2169 | var upperFirst = _createCaseFirst('toUpperCase');
|
2170 | var upperFirst_1 = upperFirst;
|
2171 |
|
2172 | |
2173 |
|
2174 |
|
2175 |
|
2176 |
|
2177 |
|
2178 |
|
2179 |
|
2180 |
|
2181 |
|
2182 |
|
2183 |
|
2184 |
|
2185 |
|
2186 |
|
2187 |
|
2188 | function capitalize(string) {
|
2189 | return upperFirst_1(toString_1(string).toLowerCase());
|
2190 | }
|
2191 |
|
2192 | var capitalize_1 = capitalize;
|
2193 |
|
2194 | |
2195 |
|
2196 |
|
2197 |
|
2198 |
|
2199 |
|
2200 |
|
2201 |
|
2202 |
|
2203 |
|
2204 |
|
2205 |
|
2206 | function arrayReduce(array, iteratee, accumulator, initAccum) {
|
2207 | var index = -1,
|
2208 | length = array == null ? 0 : array.length;
|
2209 |
|
2210 | if (initAccum && length) {
|
2211 | accumulator = array[++index];
|
2212 | }
|
2213 |
|
2214 | while (++index < length) {
|
2215 | accumulator = iteratee(accumulator, array[index], index, array);
|
2216 | }
|
2217 |
|
2218 | return accumulator;
|
2219 | }
|
2220 |
|
2221 | var _arrayReduce = arrayReduce;
|
2222 |
|
2223 | |
2224 |
|
2225 |
|
2226 |
|
2227 |
|
2228 |
|
2229 |
|
2230 | function basePropertyOf(object) {
|
2231 | return function (key) {
|
2232 | return object == null ? undefined : object[key];
|
2233 | };
|
2234 | }
|
2235 |
|
2236 | var _basePropertyOf = basePropertyOf;
|
2237 |
|
2238 |
|
2239 |
|
2240 | var deburredLetters = {
|
2241 |
|
2242 | '\xc0': 'A',
|
2243 | '\xc1': 'A',
|
2244 | '\xc2': 'A',
|
2245 | '\xc3': 'A',
|
2246 | '\xc4': 'A',
|
2247 | '\xc5': 'A',
|
2248 | '\xe0': 'a',
|
2249 | '\xe1': 'a',
|
2250 | '\xe2': 'a',
|
2251 | '\xe3': 'a',
|
2252 | '\xe4': 'a',
|
2253 | '\xe5': 'a',
|
2254 | '\xc7': 'C',
|
2255 | '\xe7': 'c',
|
2256 | '\xd0': 'D',
|
2257 | '\xf0': 'd',
|
2258 | '\xc8': 'E',
|
2259 | '\xc9': 'E',
|
2260 | '\xca': 'E',
|
2261 | '\xcb': 'E',
|
2262 | '\xe8': 'e',
|
2263 | '\xe9': 'e',
|
2264 | '\xea': 'e',
|
2265 | '\xeb': 'e',
|
2266 | '\xcc': 'I',
|
2267 | '\xcd': 'I',
|
2268 | '\xce': 'I',
|
2269 | '\xcf': 'I',
|
2270 | '\xec': 'i',
|
2271 | '\xed': 'i',
|
2272 | '\xee': 'i',
|
2273 | '\xef': 'i',
|
2274 | '\xd1': 'N',
|
2275 | '\xf1': 'n',
|
2276 | '\xd2': 'O',
|
2277 | '\xd3': 'O',
|
2278 | '\xd4': 'O',
|
2279 | '\xd5': 'O',
|
2280 | '\xd6': 'O',
|
2281 | '\xd8': 'O',
|
2282 | '\xf2': 'o',
|
2283 | '\xf3': 'o',
|
2284 | '\xf4': 'o',
|
2285 | '\xf5': 'o',
|
2286 | '\xf6': 'o',
|
2287 | '\xf8': 'o',
|
2288 | '\xd9': 'U',
|
2289 | '\xda': 'U',
|
2290 | '\xdb': 'U',
|
2291 | '\xdc': 'U',
|
2292 | '\xf9': 'u',
|
2293 | '\xfa': 'u',
|
2294 | '\xfb': 'u',
|
2295 | '\xfc': 'u',
|
2296 | '\xdd': 'Y',
|
2297 | '\xfd': 'y',
|
2298 | '\xff': 'y',
|
2299 | '\xc6': 'Ae',
|
2300 | '\xe6': 'ae',
|
2301 | '\xde': 'Th',
|
2302 | '\xfe': 'th',
|
2303 | '\xdf': 'ss',
|
2304 |
|
2305 | "\u0100": 'A',
|
2306 | "\u0102": 'A',
|
2307 | "\u0104": 'A',
|
2308 | "\u0101": 'a',
|
2309 | "\u0103": 'a',
|
2310 | "\u0105": 'a',
|
2311 | "\u0106": 'C',
|
2312 | "\u0108": 'C',
|
2313 | "\u010A": 'C',
|
2314 | "\u010C": 'C',
|
2315 | "\u0107": 'c',
|
2316 | "\u0109": 'c',
|
2317 | "\u010B": 'c',
|
2318 | "\u010D": 'c',
|
2319 | "\u010E": 'D',
|
2320 | "\u0110": 'D',
|
2321 | "\u010F": 'd',
|
2322 | "\u0111": 'd',
|
2323 | "\u0112": 'E',
|
2324 | "\u0114": 'E',
|
2325 | "\u0116": 'E',
|
2326 | "\u0118": 'E',
|
2327 | "\u011A": 'E',
|
2328 | "\u0113": 'e',
|
2329 | "\u0115": 'e',
|
2330 | "\u0117": 'e',
|
2331 | "\u0119": 'e',
|
2332 | "\u011B": 'e',
|
2333 | "\u011C": 'G',
|
2334 | "\u011E": 'G',
|
2335 | "\u0120": 'G',
|
2336 | "\u0122": 'G',
|
2337 | "\u011D": 'g',
|
2338 | "\u011F": 'g',
|
2339 | "\u0121": 'g',
|
2340 | "\u0123": 'g',
|
2341 | "\u0124": 'H',
|
2342 | "\u0126": 'H',
|
2343 | "\u0125": 'h',
|
2344 | "\u0127": 'h',
|
2345 | "\u0128": 'I',
|
2346 | "\u012A": 'I',
|
2347 | "\u012C": 'I',
|
2348 | "\u012E": 'I',
|
2349 | "\u0130": 'I',
|
2350 | "\u0129": 'i',
|
2351 | "\u012B": 'i',
|
2352 | "\u012D": 'i',
|
2353 | "\u012F": 'i',
|
2354 | "\u0131": 'i',
|
2355 | "\u0134": 'J',
|
2356 | "\u0135": 'j',
|
2357 | "\u0136": 'K',
|
2358 | "\u0137": 'k',
|
2359 | "\u0138": 'k',
|
2360 | "\u0139": 'L',
|
2361 | "\u013B": 'L',
|
2362 | "\u013D": 'L',
|
2363 | "\u013F": 'L',
|
2364 | "\u0141": 'L',
|
2365 | "\u013A": 'l',
|
2366 | "\u013C": 'l',
|
2367 | "\u013E": 'l',
|
2368 | "\u0140": 'l',
|
2369 | "\u0142": 'l',
|
2370 | "\u0143": 'N',
|
2371 | "\u0145": 'N',
|
2372 | "\u0147": 'N',
|
2373 | "\u014A": 'N',
|
2374 | "\u0144": 'n',
|
2375 | "\u0146": 'n',
|
2376 | "\u0148": 'n',
|
2377 | "\u014B": 'n',
|
2378 | "\u014C": 'O',
|
2379 | "\u014E": 'O',
|
2380 | "\u0150": 'O',
|
2381 | "\u014D": 'o',
|
2382 | "\u014F": 'o',
|
2383 | "\u0151": 'o',
|
2384 | "\u0154": 'R',
|
2385 | "\u0156": 'R',
|
2386 | "\u0158": 'R',
|
2387 | "\u0155": 'r',
|
2388 | "\u0157": 'r',
|
2389 | "\u0159": 'r',
|
2390 | "\u015A": 'S',
|
2391 | "\u015C": 'S',
|
2392 | "\u015E": 'S',
|
2393 | "\u0160": 'S',
|
2394 | "\u015B": 's',
|
2395 | "\u015D": 's',
|
2396 | "\u015F": 's',
|
2397 | "\u0161": 's',
|
2398 | "\u0162": 'T',
|
2399 | "\u0164": 'T',
|
2400 | "\u0166": 'T',
|
2401 | "\u0163": 't',
|
2402 | "\u0165": 't',
|
2403 | "\u0167": 't',
|
2404 | "\u0168": 'U',
|
2405 | "\u016A": 'U',
|
2406 | "\u016C": 'U',
|
2407 | "\u016E": 'U',
|
2408 | "\u0170": 'U',
|
2409 | "\u0172": 'U',
|
2410 | "\u0169": 'u',
|
2411 | "\u016B": 'u',
|
2412 | "\u016D": 'u',
|
2413 | "\u016F": 'u',
|
2414 | "\u0171": 'u',
|
2415 | "\u0173": 'u',
|
2416 | "\u0174": 'W',
|
2417 | "\u0175": 'w',
|
2418 | "\u0176": 'Y',
|
2419 | "\u0177": 'y',
|
2420 | "\u0178": 'Y',
|
2421 | "\u0179": 'Z',
|
2422 | "\u017B": 'Z',
|
2423 | "\u017D": 'Z',
|
2424 | "\u017A": 'z',
|
2425 | "\u017C": 'z',
|
2426 | "\u017E": 'z',
|
2427 | "\u0132": 'IJ',
|
2428 | "\u0133": 'ij',
|
2429 | "\u0152": 'Oe',
|
2430 | "\u0153": 'oe',
|
2431 | "\u0149": "'n",
|
2432 | "\u017F": 's'
|
2433 | };
|
2434 | |
2435 |
|
2436 |
|
2437 |
|
2438 |
|
2439 |
|
2440 |
|
2441 |
|
2442 |
|
2443 | var deburrLetter = _basePropertyOf(deburredLetters);
|
2444 | var _deburrLetter = deburrLetter;
|
2445 |
|
2446 |
|
2447 |
|
2448 | var reLatin = /[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g;
|
2449 |
|
2450 |
|
2451 | var rsComboMarksRange$2 = "\\u0300-\\u036f",
|
2452 | reComboHalfMarksRange$2 = "\\ufe20-\\ufe2f",
|
2453 | rsComboSymbolsRange$2 = "\\u20d0-\\u20ff",
|
2454 | rsComboRange$2 = rsComboMarksRange$2 + reComboHalfMarksRange$2 + rsComboSymbolsRange$2;
|
2455 |
|
2456 |
|
2457 | var rsCombo$1 = '[' + rsComboRange$2 + ']';
|
2458 | |
2459 |
|
2460 |
|
2461 |
|
2462 |
|
2463 | var reComboMark = RegExp(rsCombo$1, 'g');
|
2464 | |
2465 |
|
2466 |
|
2467 |
|
2468 |
|
2469 |
|
2470 |
|
2471 |
|
2472 |
|
2473 |
|
2474 |
|
2475 |
|
2476 |
|
2477 |
|
2478 |
|
2479 |
|
2480 |
|
2481 |
|
2482 |
|
2483 | function deburr(string) {
|
2484 | string = toString_1(string);
|
2485 | return string && string.replace(reLatin, _deburrLetter).replace(reComboMark, '');
|
2486 | }
|
2487 |
|
2488 | var deburr_1 = deburr;
|
2489 |
|
2490 |
|
2491 | var reAsciiWord = /[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;
|
2492 | |
2493 |
|
2494 |
|
2495 |
|
2496 |
|
2497 |
|
2498 |
|
2499 |
|
2500 | function asciiWords(string) {
|
2501 | return string.match(reAsciiWord) || [];
|
2502 | }
|
2503 |
|
2504 | var _asciiWords = asciiWords;
|
2505 |
|
2506 |
|
2507 | var reHasUnicodeWord = /[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;
|
2508 | |
2509 |
|
2510 |
|
2511 |
|
2512 |
|
2513 |
|
2514 |
|
2515 |
|
2516 | function hasUnicodeWord(string) {
|
2517 | return reHasUnicodeWord.test(string);
|
2518 | }
|
2519 |
|
2520 | var _hasUnicodeWord = hasUnicodeWord;
|
2521 |
|
2522 |
|
2523 | var rsAstralRange$2 = "\\ud800-\\udfff",
|
2524 | rsComboMarksRange$3 = "\\u0300-\\u036f",
|
2525 | reComboHalfMarksRange$3 = "\\ufe20-\\ufe2f",
|
2526 | rsComboSymbolsRange$3 = "\\u20d0-\\u20ff",
|
2527 | rsComboRange$3 = rsComboMarksRange$3 + reComboHalfMarksRange$3 + rsComboSymbolsRange$3,
|
2528 | rsDingbatRange = "\\u2700-\\u27bf",
|
2529 | rsLowerRange = 'a-z\\xdf-\\xf6\\xf8-\\xff',
|
2530 | rsMathOpRange = '\\xac\\xb1\\xd7\\xf7',
|
2531 | rsNonCharRange = '\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf',
|
2532 | rsPunctuationRange = "\\u2000-\\u206f",
|
2533 | rsSpaceRange = " \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",
|
2534 | rsUpperRange = 'A-Z\\xc0-\\xd6\\xd8-\\xde',
|
2535 | rsVarRange$2 = "\\ufe0e\\ufe0f",
|
2536 | rsBreakRange = rsMathOpRange + rsNonCharRange + rsPunctuationRange + rsSpaceRange;
|
2537 |
|
2538 |
|
2539 | var rsApos = "['\u2019]",
|
2540 | rsBreak = '[' + rsBreakRange + ']',
|
2541 | rsCombo$2 = '[' + rsComboRange$3 + ']',
|
2542 | rsDigits = '\\d+',
|
2543 | rsDingbat = '[' + rsDingbatRange + ']',
|
2544 | rsLower = '[' + rsLowerRange + ']',
|
2545 | rsMisc = '[^' + rsAstralRange$2 + rsBreakRange + rsDigits + rsDingbatRange + rsLowerRange + rsUpperRange + ']',
|
2546 | rsFitz$1 = "\\ud83c[\\udffb-\\udfff]",
|
2547 | rsModifier$1 = '(?:' + rsCombo$2 + '|' + rsFitz$1 + ')',
|
2548 | rsNonAstral$1 = '[^' + rsAstralRange$2 + ']',
|
2549 | rsRegional$1 = "(?:\\ud83c[\\udde6-\\uddff]){2}",
|
2550 | rsSurrPair$1 = "[\\ud800-\\udbff][\\udc00-\\udfff]",
|
2551 | rsUpper = '[' + rsUpperRange + ']',
|
2552 | rsZWJ$2 = "\\u200d";
|
2553 |
|
2554 |
|
2555 | var rsMiscLower = '(?:' + rsLower + '|' + rsMisc + ')',
|
2556 | rsMiscUpper = '(?:' + rsUpper + '|' + rsMisc + ')',
|
2557 | rsOptContrLower = '(?:' + rsApos + '(?:d|ll|m|re|s|t|ve))?',
|
2558 | rsOptContrUpper = '(?:' + rsApos + '(?:D|LL|M|RE|S|T|VE))?',
|
2559 | reOptMod$1 = rsModifier$1 + '?',
|
2560 | rsOptVar$1 = '[' + rsVarRange$2 + ']?',
|
2561 | rsOptJoin$1 = '(?:' + rsZWJ$2 + '(?:' + [rsNonAstral$1, rsRegional$1, rsSurrPair$1].join('|') + ')' + rsOptVar$1 + reOptMod$1 + ')*',
|
2562 | rsOrdLower = '\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])',
|
2563 | rsOrdUpper = '\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])',
|
2564 | rsSeq$1 = rsOptVar$1 + reOptMod$1 + rsOptJoin$1,
|
2565 | rsEmoji = '(?:' + [rsDingbat, rsRegional$1, rsSurrPair$1].join('|') + ')' + rsSeq$1;
|
2566 |
|
2567 |
|
2568 | var reUnicodeWord = RegExp([rsUpper + '?' + rsLower + '+' + rsOptContrLower + '(?=' + [rsBreak, rsUpper, '$'].join('|') + ')', rsMiscUpper + '+' + rsOptContrUpper + '(?=' + [rsBreak, rsUpper + rsMiscLower, '$'].join('|') + ')', rsUpper + '?' + rsMiscLower + '+' + rsOptContrLower, rsUpper + '+' + rsOptContrUpper, rsOrdUpper, rsOrdLower, rsDigits, rsEmoji].join('|'), 'g');
|
2569 | |
2570 |
|
2571 |
|
2572 |
|
2573 |
|
2574 |
|
2575 |
|
2576 |
|
2577 | function unicodeWords(string) {
|
2578 | return string.match(reUnicodeWord) || [];
|
2579 | }
|
2580 |
|
2581 | var _unicodeWords = unicodeWords;
|
2582 |
|
2583 | |
2584 |
|
2585 |
|
2586 |
|
2587 |
|
2588 |
|
2589 |
|
2590 |
|
2591 |
|
2592 |
|
2593 |
|
2594 |
|
2595 |
|
2596 |
|
2597 |
|
2598 |
|
2599 |
|
2600 |
|
2601 |
|
2602 |
|
2603 | function words(string, pattern, guard) {
|
2604 | string = toString_1(string);
|
2605 | pattern = guard ? undefined : pattern;
|
2606 |
|
2607 | if (pattern === undefined) {
|
2608 | return _hasUnicodeWord(string) ? _unicodeWords(string) : _asciiWords(string);
|
2609 | }
|
2610 |
|
2611 | return string.match(pattern) || [];
|
2612 | }
|
2613 |
|
2614 | var words_1 = words;
|
2615 |
|
2616 |
|
2617 |
|
2618 | var rsApos$1 = "['\u2019]";
|
2619 |
|
2620 |
|
2621 | var reApos = RegExp(rsApos$1, 'g');
|
2622 | |
2623 |
|
2624 |
|
2625 |
|
2626 |
|
2627 |
|
2628 |
|
2629 |
|
2630 | function createCompounder(callback) {
|
2631 | return function (string) {
|
2632 | return _arrayReduce(words_1(deburr_1(string).replace(reApos, '')), callback, '');
|
2633 | };
|
2634 | }
|
2635 |
|
2636 | var _createCompounder = createCompounder;
|
2637 |
|
2638 | |
2639 |
|
2640 |
|
2641 |
|
2642 |
|
2643 |
|
2644 |
|
2645 |
|
2646 |
|
2647 |
|
2648 |
|
2649 |
|
2650 |
|
2651 |
|
2652 |
|
2653 |
|
2654 |
|
2655 |
|
2656 |
|
2657 |
|
2658 |
|
2659 | var camelCase = _createCompounder(function (result, word, index) {
|
2660 | word = word.toLowerCase();
|
2661 | return result + (index ? capitalize_1(word) : word);
|
2662 | });
|
2663 | var camelCase_1 = camelCase;
|
2664 |
|
2665 | |
2666 |
|
2667 |
|
2668 |
|
2669 |
|
2670 |
|
2671 |
|
2672 |
|
2673 | function overArg(func, transform) {
|
2674 | return function (arg) {
|
2675 | return func(transform(arg));
|
2676 | };
|
2677 | }
|
2678 |
|
2679 | var _overArg = overArg;
|
2680 |
|
2681 |
|
2682 |
|
2683 | var getPrototype = _overArg(Object.getPrototypeOf, Object);
|
2684 | var _getPrototype = getPrototype;
|
2685 |
|
2686 |
|
2687 |
|
2688 | var objectTag = '[object Object]';
|
2689 |
|
2690 |
|
2691 | var funcProto = Function.prototype,
|
2692 | objectProto$2 = Object.prototype;
|
2693 |
|
2694 |
|
2695 | var funcToString = funcProto.toString;
|
2696 |
|
2697 |
|
2698 | var hasOwnProperty$2 = objectProto$2.hasOwnProperty;
|
2699 |
|
2700 |
|
2701 | var objectCtorString = funcToString.call(Object);
|
2702 | |
2703 |
|
2704 |
|
2705 |
|
2706 |
|
2707 |
|
2708 |
|
2709 |
|
2710 |
|
2711 |
|
2712 |
|
2713 |
|
2714 |
|
2715 |
|
2716 |
|
2717 |
|
2718 |
|
2719 |
|
2720 |
|
2721 |
|
2722 |
|
2723 |
|
2724 |
|
2725 |
|
2726 |
|
2727 |
|
2728 |
|
2729 |
|
2730 |
|
2731 | function isPlainObject(value) {
|
2732 | if (!isObjectLike_1(value) || _baseGetTag(value) != objectTag) {
|
2733 | return false;
|
2734 | }
|
2735 |
|
2736 | var proto = _getPrototype(value);
|
2737 |
|
2738 | if (proto === null) {
|
2739 | return true;
|
2740 | }
|
2741 |
|
2742 | var Ctor = hasOwnProperty$2.call(proto, 'constructor') && proto.constructor;
|
2743 | return typeof Ctor == 'function' && Ctor instanceof Ctor && funcToString.call(Ctor) == objectCtorString;
|
2744 | }
|
2745 |
|
2746 | var isPlainObject_1 = isPlainObject;
|
2747 |
|
2748 | function addLeadingSlash$1(str) {
|
2749 | return str[0] === '/' ? str : "/".concat(str);
|
2750 | }
|
2751 | function isEmptyObject(obj) {
|
2752 | if (!obj || !isPlainObject_1(obj)) {
|
2753 | return false;
|
2754 | }
|
2755 |
|
2756 | for (var n in obj) {
|
2757 | if (obj.hasOwnProperty(n)) {
|
2758 | return false;
|
2759 | }
|
2760 | }
|
2761 |
|
2762 | return true;
|
2763 | }
|
2764 | function isUndefined(o) {
|
2765 | return o === undefined;
|
2766 | }
|
2767 | function isFunction(arg) {
|
2768 | return typeof arg === 'function';
|
2769 | }
|
2770 | function isArray$1(arg) {
|
2771 | return Array.isArray(arg);
|
2772 | }
|
2773 | function shakeFnFromObject(obj) {
|
2774 | var newObj;
|
2775 |
|
2776 | if (isArray$1(obj)) {
|
2777 | newObj = [];
|
2778 | var len = obj.length;
|
2779 |
|
2780 | for (var i = 0; i < len; i++) {
|
2781 | newObj.push(shakeFnFromObject(obj[i]));
|
2782 | }
|
2783 | } else if (isPlainObject_1(obj)) {
|
2784 | newObj = {};
|
2785 |
|
2786 | for (var key in obj) {
|
2787 | if (isFunction(obj[key])) {
|
2788 | continue;
|
2789 | }
|
2790 |
|
2791 | var ret = shakeFnFromObject(obj[key]);
|
2792 | newObj[key] = ret;
|
2793 | }
|
2794 | } else {
|
2795 | return obj;
|
2796 | }
|
2797 |
|
2798 | return newObj;
|
2799 | }
|
2800 |
|
2801 | var _loadTime = new Date().getTime().toString();
|
2802 |
|
2803 | var _i = 1;
|
2804 | function getUniqueKey() {
|
2805 | return _loadTime + _i++;
|
2806 | }
|
2807 | var id$1 = 0;
|
2808 |
|
2809 | function genId() {
|
2810 | return String(id$1++);
|
2811 | }
|
2812 |
|
2813 | var compIdsMapper;
|
2814 |
|
2815 | try {
|
2816 | compIdsMapper = new Map();
|
2817 | } catch (error) {
|
2818 | compIdsMapper = new SimpleMap();
|
2819 | }
|
2820 |
|
2821 | function genCompid(key, isNeedCreate) {
|
2822 | if (!taro.Current || !taro.Current.current || !taro.Current.current.$scope) return [];
|
2823 | var prevId = compIdsMapper.get(key);
|
2824 |
|
2825 | if (isNeedCreate) {
|
2826 | var _id = genId();
|
2827 |
|
2828 | compIdsMapper.set(key, _id);
|
2829 | return [prevId, _id];
|
2830 | } else {
|
2831 | var _id2 = prevId || genId();
|
2832 |
|
2833 | !prevId && compIdsMapper.set(key, _id2);
|
2834 | return [null, _id2];
|
2835 | }
|
2836 | }
|
2837 | var prefix = 0;
|
2838 | function genCompPrefix() {
|
2839 | return String(prefix++);
|
2840 | }
|
2841 |
|
2842 | var appGlobal = global || {};
|
2843 | var globalRef = Object.getPrototypeOf(appGlobal) || appGlobal;
|
2844 |
|
2845 | globalRef.cacheData = globalRef.cacheData || {};
|
2846 | function cacheDataSet(key, val) {
|
2847 | globalRef.cacheData[key] = val;
|
2848 | }
|
2849 | function cacheDataGet(key, delelteAfterGet) {
|
2850 | var temp = globalRef.cacheData[key];
|
2851 | delelteAfterGet && delete globalRef.cacheData[key];
|
2852 | return temp;
|
2853 | }
|
2854 | function cacheDataHas(key) {
|
2855 | return key in globalRef.cacheData;
|
2856 | }
|
2857 |
|
2858 | var Manager = function () {
|
2859 | function Manager() {
|
2860 | _classCallCheck(this, Manager);
|
2861 |
|
2862 | _defineProperty(this, "map", {});
|
2863 |
|
2864 | _defineProperty(this, "observers", {});
|
2865 | }
|
2866 |
|
2867 | _createClass(Manager, [{
|
2868 | key: "set",
|
2869 | value: function set() {
|
2870 | var props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
2871 | var compid = arguments.length > 1 ? arguments[1] : undefined;
|
2872 | var previd = arguments.length > 2 ? arguments[2] : undefined;
|
2873 | if (!compid) return;
|
2874 |
|
2875 | if (previd) {
|
2876 | this.observers[compid] = this.observers[previd];
|
2877 | this["delete"](previd);
|
2878 | }
|
2879 |
|
2880 | var observers = this.observers;
|
2881 |
|
2882 | if (!this.map[compid]) {
|
2883 | Object.defineProperty(this.map, compid, {
|
2884 | configurable: true,
|
2885 | get: function get() {
|
2886 | return this["__".concat(compid)];
|
2887 | },
|
2888 | set: function set(props) {
|
2889 | this["__".concat(compid)] = props;
|
2890 | var component = observers[compid] && observers[compid].component;
|
2891 | var ComponentClass = observers[compid] && observers[compid].ComponentClass;
|
2892 | if (!component || !ComponentClass || !component.__isReady) return;
|
2893 | var nextProps = filterProps(ComponentClass.defaultProps, props, component.props);
|
2894 | component.props = nextProps;
|
2895 | nextTick(function () {
|
2896 | component._unsafeCallUpdate = true;
|
2897 | updateComponent(component);
|
2898 | component._unsafeCallUpdate = false;
|
2899 | });
|
2900 | }
|
2901 | });
|
2902 | }
|
2903 |
|
2904 | this.map[compid] = props;
|
2905 | }
|
2906 | }, {
|
2907 | key: "delete",
|
2908 | value: function _delete(compid) {
|
2909 | delete this.map[compid];
|
2910 | delete this.map["__".concat(compid)];
|
2911 | delete this.observers[compid];
|
2912 | }
|
2913 | }]);
|
2914 |
|
2915 | return Manager;
|
2916 | }();
|
2917 |
|
2918 | var propsManager = new Manager();
|
2919 |
|
2920 | var anonymousFnNamePreffix = 'funPrivate';
|
2921 | var routerParamsPrivateKey = '__key_';
|
2922 | var preloadPrivateKey = 'quick$PriPreload';
|
2923 | var PRELOAD_DATA_KEY = 'preload';
|
2924 | var COMP_ID = 'compid';
|
2925 | var preloadInitedComponent = 'quick$PriPreloadComponent';
|
2926 | var pageExtraFns = ['onBackPress', 'onMenuPress', 'onRefresh'];
|
2927 |
|
2928 | function bindProperties(componentConf, ComponentClass, isPage) {
|
2929 | componentConf.properties = ComponentClass.properties || {};
|
2930 | var defaultProps = ComponentClass.defaultProps || {};
|
2931 |
|
2932 | for (var key in defaultProps) {
|
2933 | if (defaultProps.hasOwnProperty(key)) {
|
2934 | componentConf.properties[key] = {
|
2935 | type: null,
|
2936 | value: defaultProps[key]
|
2937 | };
|
2938 | }
|
2939 | }
|
2940 |
|
2941 | if (isPage) {
|
2942 | componentConf.properties[routerParamsPrivateKey] = {
|
2943 | type: null,
|
2944 | value: null
|
2945 | };
|
2946 | componentConf.properties[preloadPrivateKey] = {
|
2947 | type: null,
|
2948 | value: null
|
2949 | };
|
2950 | var defaultParams = ComponentClass.defaultParams || {};
|
2951 |
|
2952 | for (var _key in defaultParams) {
|
2953 | if (defaultParams.hasOwnProperty(_key)) {
|
2954 | componentConf.properties[_key] = {
|
2955 | type: null,
|
2956 | value: null
|
2957 | };
|
2958 | }
|
2959 | }
|
2960 | }
|
2961 |
|
2962 | componentConf.props = [];
|
2963 | Object.keys(componentConf.properties).forEach(function (item) {
|
2964 | componentConf.props.push(item.toLocaleLowerCase());
|
2965 | });
|
2966 | componentConf.props.push(COMP_ID);
|
2967 |
|
2968 | componentConf.onCompidChange = function () {
|
2969 | initComponent.apply(this, [ComponentClass, isPage]);
|
2970 | };
|
2971 | }
|
2972 |
|
2973 | function filterProps() {
|
2974 | var defaultProps = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
2975 | var propsFromPropsManager = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
2976 | var curAllProps = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
2977 | var extraProps = arguments.length > 3 ? arguments[3] : undefined;
|
2978 | var newProps = Object.assign({}, curAllProps, propsFromPropsManager);
|
2979 |
|
2980 | if (!isEmptyObject(defaultProps)) {
|
2981 | for (var propName in defaultProps) {
|
2982 | if (newProps[propName] === undefined) {
|
2983 | newProps[propName] = defaultProps[propName];
|
2984 | }
|
2985 | }
|
2986 | }
|
2987 |
|
2988 | if (extraProps) {
|
2989 | newProps = Object.assign({}, newProps, extraProps);
|
2990 | }
|
2991 |
|
2992 | Object.keys(newProps).forEach(function (propName) {
|
2993 | var camelizePropName = camelCase_1(propName);
|
2994 |
|
2995 | if (camelizePropName !== propName) {
|
2996 | Object.defineProperty(newProps, camelizePropName, {
|
2997 | get: function get() {
|
2998 | return newProps[propName];
|
2999 | }
|
3000 | });
|
3001 | }
|
3002 | });
|
3003 | return newProps;
|
3004 | }
|
3005 |
|
3006 | function processEvent(eventHandlerName, obj) {
|
3007 | if (obj[eventHandlerName]) return;
|
3008 |
|
3009 | obj[eventHandlerName] = function (event) {
|
3010 | if (event) {
|
3011 | var _currentTarget = event.currentTarget;
|
3012 | var target = event.target;
|
3013 | Object.defineProperties(event, {
|
3014 | target: {
|
3015 | configurable: true,
|
3016 | get: function get() {
|
3017 | return Object.assign(target || {}, event.detail);
|
3018 | }
|
3019 | },
|
3020 | currentTarget: {
|
3021 | configurable: true,
|
3022 | get: function get() {
|
3023 | return Object.assign(_currentTarget || target || {}, event.detail);
|
3024 | },
|
3025 | set: function set(target) {
|
3026 | _currentTarget = target;
|
3027 | }
|
3028 | }
|
3029 | });
|
3030 |
|
3031 | if (!event.stopPropagation) {
|
3032 | Object.defineProperty(event, 'stopPropagation', {
|
3033 | value: function value() {}
|
3034 | });
|
3035 | }
|
3036 |
|
3037 | if (!event.preventDefault) {
|
3038 | Object.defineProperty(event, 'preventDefault', {
|
3039 | value: function value() {}
|
3040 | });
|
3041 | }
|
3042 | }
|
3043 |
|
3044 | var scope = this.$component;
|
3045 | var callScope = scope;
|
3046 | var isAnonymousFn = eventHandlerName.indexOf(anonymousFnNamePreffix) > -1;
|
3047 | var realArgs = [];
|
3048 | var detailArgs = [];
|
3049 | var datasetArgs = [];
|
3050 | var isScopeBinded = false;
|
3051 |
|
3052 | var dataset = {};
|
3053 | var currentTarget = event.currentTarget;
|
3054 | var vm = currentTarget._vm || (currentTarget._target ? currentTarget._target._vm : null);
|
3055 | var attr = vm ? vm._externalBinding.template.attr : currentTarget._attr || currentTarget.attr;
|
3056 |
|
3057 | if (attr) {
|
3058 | Object.keys(attr).forEach(function (key) {
|
3059 | if (/^data/.test(key)) {
|
3060 | var item = attr[key];
|
3061 | dataset[key.replace(/^data/, '')] = typeof item === 'function' ? item() : item;
|
3062 | }
|
3063 | });
|
3064 | }
|
3065 |
|
3066 | var bindArgs = {};
|
3067 | var eventType = "on".concat(event.type).toLocaleLowerCase();
|
3068 | if (event.detail && event.detail.__detail) Object.assign(dataset, event.detail.__detail);
|
3069 | Object.keys(dataset).forEach(function (key) {
|
3070 | var keyLower = key.toLocaleLowerCase();
|
3071 |
|
3072 | if (/^e/.test(keyLower)) {
|
3073 |
|
3074 | keyLower = keyLower.replace(/^e/, '');
|
3075 |
|
3076 | if (keyLower.indexOf(eventType) >= 0) {
|
3077 | var argName = keyLower.replace(eventType, '');
|
3078 |
|
3079 | if (/^(a[a-z]|so)$/.test(argName)) {
|
3080 | bindArgs[argName] = dataset[key];
|
3081 | }
|
3082 | }
|
3083 | }
|
3084 | });
|
3085 |
|
3086 | if (event.detail && event.detail.__arguments && event.detail.__arguments.length > 0) {
|
3087 | detailArgs = event.detail.__arguments;
|
3088 | }
|
3089 |
|
3090 |
|
3091 | if (!isAnonymousFn) {
|
3092 | if ('so' in bindArgs) {
|
3093 | if (bindArgs['so'] !== 'this') {
|
3094 | callScope = bindArgs['so'];
|
3095 | }
|
3096 |
|
3097 | isScopeBinded = true;
|
3098 | delete bindArgs['so'];
|
3099 | }
|
3100 |
|
3101 | if (detailArgs.length > 0) {
|
3102 | !isScopeBinded && detailArgs[0] && (callScope = detailArgs[0]);
|
3103 | detailArgs.shift();
|
3104 | }
|
3105 |
|
3106 | if (!isEmptyObject(bindArgs)) {
|
3107 | datasetArgs = Object.keys(bindArgs).sort().map(function (key) {
|
3108 | return bindArgs[key];
|
3109 | });
|
3110 | }
|
3111 |
|
3112 | realArgs = [].concat(_toConsumableArray(datasetArgs), _toConsumableArray(detailArgs), [event]);
|
3113 | } else {
|
3114 |
|
3115 | var _scope = null;
|
3116 |
|
3117 | if ('so' in bindArgs) {
|
3118 | if (bindArgs['so'] !== 'this') {
|
3119 | _scope = bindArgs['so'];
|
3120 | }
|
3121 |
|
3122 | isScopeBinded = true;
|
3123 | delete bindArgs['so'];
|
3124 | }
|
3125 |
|
3126 | if (detailArgs.length > 0) {
|
3127 | !isScopeBinded && detailArgs[0] && (callScope = detailArgs[0]);
|
3128 | detailArgs.shift();
|
3129 | }
|
3130 |
|
3131 | if (!isEmptyObject(bindArgs)) {
|
3132 | datasetArgs = Object.keys(bindArgs).sort().map(function (key) {
|
3133 | return bindArgs[key];
|
3134 | });
|
3135 | }
|
3136 |
|
3137 | realArgs = [_scope].concat(_toConsumableArray(datasetArgs), _toConsumableArray(detailArgs), [event]);
|
3138 | }
|
3139 |
|
3140 | return scope[eventHandlerName].apply(callScope, realArgs);
|
3141 | };
|
3142 | }
|
3143 |
|
3144 | function bindEvents(componentConf, events) {
|
3145 | events.forEach(function (name) {
|
3146 | processEvent(name, componentConf);
|
3147 | });
|
3148 | }
|
3149 |
|
3150 | function bindStaticFns(componentConf, ComponentClass) {
|
3151 | for (var key in ComponentClass) {
|
3152 | typeof ComponentClass[key] === 'function' && (componentConf[key] = ComponentClass[key]);
|
3153 | }
|
3154 |
|
3155 |
|
3156 | Object.getOwnPropertyNames(ComponentClass).forEach(function (key) {
|
3157 | var excludes = ['arguments', 'caller', 'length', 'name', 'prototype'];
|
3158 |
|
3159 | if (excludes.indexOf(key) < 0) {
|
3160 | typeof ComponentClass[key] === 'function' && (componentConf[key] = ComponentClass[key]);
|
3161 | }
|
3162 | });
|
3163 | }
|
3164 |
|
3165 | function getPageUrlParams(url) {
|
3166 | var taroRouterParamsCache = globalRef.taroRouterParamsCache;
|
3167 | var params = {};
|
3168 |
|
3169 | if (taroRouterParamsCache && url) {
|
3170 | url = addLeadingSlash$1(url);
|
3171 | params = taroRouterParamsCache[url] || {};
|
3172 | delete taroRouterParamsCache[url];
|
3173 | }
|
3174 |
|
3175 | return params;
|
3176 | }
|
3177 |
|
3178 | var hasPageInited = false;
|
3179 |
|
3180 | function initComponent(ComponentClass, isPage) {
|
3181 | if (!this.$component || this.$component.__isReady) return;
|
3182 | this.$component.__isReady = true;
|
3183 |
|
3184 | if (isPage && !hasPageInited) {
|
3185 | hasPageInited = true;
|
3186 | }
|
3187 |
|
3188 | if (hasPageInited && !isPage) {
|
3189 | var compid = this.compid;
|
3190 |
|
3191 | if (compid) {
|
3192 | propsManager.observers[compid] = {
|
3193 | component: this.$component,
|
3194 | ComponentClass: ComponentClass
|
3195 | };
|
3196 | }
|
3197 |
|
3198 | var nextProps = filterProps(ComponentClass.defaultProps, propsManager.map[compid], this.$component.props);
|
3199 | this.$component.props = nextProps;
|
3200 | }
|
3201 |
|
3202 | if (hasPageInited || isPage) {
|
3203 | mountComponent(this.$component);
|
3204 | }
|
3205 | }
|
3206 |
|
3207 | function componentTrigger(component, key, args) {
|
3208 | args = args || [];
|
3209 |
|
3210 | if (key === 'componentDidMount') {
|
3211 | if (component['$$hasLoopRef']) {
|
3212 | taro.Current.current = component;
|
3213 | taro.Current.index = 0;
|
3214 | component._disableEffect = true;
|
3215 |
|
3216 | component._createData(component.state, component.props, true);
|
3217 |
|
3218 | component._disableEffect = false;
|
3219 | taro.Current.current = null;
|
3220 | }
|
3221 | }
|
3222 |
|
3223 | if (key === 'componentWillUnmount') {
|
3224 | var compid = component.$scope.compid;
|
3225 | if (compid) propsManager["delete"](compid);
|
3226 | }
|
3227 |
|
3228 | component[key] && typeof component[key] === 'function' && component[key].apply(component, _toConsumableArray(args));
|
3229 |
|
3230 | if (key === 'componentWillMount') {
|
3231 | component._dirty = false;
|
3232 | component._disable = false;
|
3233 | component.state = component.getState();
|
3234 | }
|
3235 |
|
3236 | if (key === 'componentWillUnmount') {
|
3237 | component._dirty = true;
|
3238 | component._disable = true;
|
3239 | component.$router = {
|
3240 | params: {},
|
3241 | path: ''
|
3242 | };
|
3243 | component._pendingStates = [];
|
3244 | component._pendingCallbacks = [];
|
3245 | }
|
3246 | }
|
3247 | function createComponent(ComponentClass, isPage) {
|
3248 | var initData = {
|
3249 | priTaroCompReady: false
|
3250 | };
|
3251 | var componentProps = filterProps(ComponentClass.defaultProps);
|
3252 | var componentInstance = new ComponentClass(componentProps);
|
3253 | componentInstance._constructor && componentInstance._constructor(componentProps);
|
3254 |
|
3255 | try {
|
3256 | taro.Current.current = componentInstance;
|
3257 | taro.Current.index = 0;
|
3258 | componentInstance.state = componentInstance._createData() || componentInstance.state;
|
3259 | } catch (err) {
|
3260 | if (isPage) {
|
3261 | console.warn("[Taro warn] \u8BF7\u7ED9\u9875\u9762\u63D0\u4F9B\u521D\u59CB `state` \u4EE5\u63D0\u9AD8\u521D\u6B21\u6E32\u67D3\u6027\u80FD\uFF01");
|
3262 | } else {
|
3263 | console.warn("[Taro warn] \u8BF7\u7ED9\u7EC4\u4EF6\u63D0\u4F9B\u4E00\u4E2A `defaultProps` \u4EE5\u63D0\u9AD8\u521D\u6B21\u6E32\u67D3\u6027\u80FD\uFF01");
|
3264 | }
|
3265 |
|
3266 | console.warn(err);
|
3267 | }
|
3268 |
|
3269 | initData = Object.assign({}, initData, componentInstance.props, componentInstance.state);
|
3270 | var componentConf = {
|
3271 | data: initData,
|
3272 | onInit: function onInit() {
|
3273 | isPage && (hasPageInited = false);
|
3274 |
|
3275 | if (isPage && cacheDataHas(preloadInitedComponent)) {
|
3276 | this.$component = cacheDataGet(preloadInitedComponent, true);
|
3277 | } else {
|
3278 | this.$component = new ComponentClass({}, isPage);
|
3279 | }
|
3280 |
|
3281 | this.$component._init(this);
|
3282 |
|
3283 | this.$component.render = this.$component._createData;
|
3284 | this.$component.__propTypes = ComponentClass.propTypes;
|
3285 |
|
3286 | if (isPage) {
|
3287 | this.$component.$componentType = 'PAGE';
|
3288 |
|
3289 | if (cacheDataHas(PRELOAD_DATA_KEY)) {
|
3290 | var data = cacheDataGet(PRELOAD_DATA_KEY, true);
|
3291 | this.$component.$router.preload = data;
|
3292 | }
|
3293 |
|
3294 | var options = getPageUrlParams(isPage);
|
3295 | Object.assign(this.$component.$router.params, options);
|
3296 | this.$app.pageInstaceMap = this.$app.pageInstaceMap || {};
|
3297 | this.$app.pageInstaceMap[isPage] = this.$component;
|
3298 |
|
3299 | if (cacheDataHas(options[preloadPrivateKey])) {
|
3300 | this.$component.$preloadData = cacheDataGet(options[preloadPrivateKey], true);
|
3301 | } else {
|
3302 | this.$component.$preloadData = {};
|
3303 | }
|
3304 |
|
3305 |
|
3306 | initComponent.apply(this, [ComponentClass, isPage]);
|
3307 | }
|
3308 |
|
3309 |
|
3310 | this.$watch(COMP_ID, 'onCompidChange');
|
3311 | },
|
3312 | onReady: function onReady() {
|
3313 | if (!isPage) {
|
3314 | initComponent.apply(this, [ComponentClass, isPage]);
|
3315 | }
|
3316 |
|
3317 | var component = this.$component;
|
3318 |
|
3319 | if (!component.__mounted) {
|
3320 | component.__mounted = true;
|
3321 | componentTrigger(component, 'componentDidMount');
|
3322 | }
|
3323 | },
|
3324 | onDestroy: function onDestroy() {
|
3325 | componentTrigger(this.$component, 'componentWillUnmount');
|
3326 | var component = this.$component;
|
3327 | component.hooks.forEach(function (hook) {
|
3328 | if (isFunction(hook.cleanup)) {
|
3329 | hook.cleanup();
|
3330 | }
|
3331 | });
|
3332 | var events = component.$$renderPropsEvents;
|
3333 |
|
3334 | if (isArray$1(events)) {
|
3335 | events.forEach(function (e) {
|
3336 | return taro.eventCenter.off(e);
|
3337 | });
|
3338 | }
|
3339 | }
|
3340 | };
|
3341 |
|
3342 | if (isPage) {
|
3343 | componentConf['onShow'] = function () {
|
3344 | componentTrigger(this.$component, 'componentDidShow');
|
3345 | };
|
3346 |
|
3347 | componentConf['onHide'] = function () {
|
3348 | componentTrigger(this.$component, 'componentDidHide');
|
3349 | };
|
3350 |
|
3351 | pageExtraFns.forEach(function (fn) {
|
3352 | if (componentInstance[fn] && typeof componentInstance[fn] === 'function') {
|
3353 | componentConf[fn] = function () {
|
3354 | var component = this.$component;
|
3355 |
|
3356 | if (component[fn] && typeof component[fn] === 'function') {
|
3357 | return component[fn].apply(component, arguments);
|
3358 | }
|
3359 | };
|
3360 | }
|
3361 | });
|
3362 | globalRef.componentPath = isPage;
|
3363 | addLeadingSlash$1(isPage) && cacheDataSet(addLeadingSlash$1(isPage), ComponentClass);
|
3364 | }
|
3365 |
|
3366 | bindStaticFns(componentConf, ComponentClass);
|
3367 | bindProperties(componentConf, ComponentClass, isPage);
|
3368 | ComponentClass['privateTaroEvent'] && bindEvents(componentConf, ComponentClass['privateTaroEvent']);
|
3369 | return componentConf;
|
3370 | }
|
3371 |
|
3372 | var isDEV = typeof process === 'undefined' || !process.env || process.env.NODE_ENV !== 'production';
|
3373 |
|
3374 | function hasNewLifecycle(component) {
|
3375 | var getDerivedStateFromProps = component.constructor.getDerivedStateFromProps,
|
3376 | getSnapshotBeforeUpdate = component.getSnapshotBeforeUpdate;
|
3377 | return isFunction(getDerivedStateFromProps) || isFunction(getSnapshotBeforeUpdate);
|
3378 | }
|
3379 |
|
3380 | function callGetDerivedStateFromProps(component, props, state) {
|
3381 | var getDerivedStateFromProps = component.constructor.getDerivedStateFromProps;
|
3382 | var newState;
|
3383 |
|
3384 | if (isFunction(getDerivedStateFromProps)) {
|
3385 | var partialState = getDerivedStateFromProps(props, state);
|
3386 |
|
3387 | if (!isUndefined(partialState)) {
|
3388 | newState = Object.assign({}, state, partialState);
|
3389 | } else {
|
3390 | console.warn('getDerivedStateFromProps 没有返回任何内容,这个生命周期必须返回 null 或一个新对象。');
|
3391 | }
|
3392 | }
|
3393 |
|
3394 | return newState;
|
3395 | }
|
3396 |
|
3397 | function callGetSnapshotBeforeUpdate(component, props, state) {
|
3398 | var getSnapshotBeforeUpdate = component.getSnapshotBeforeUpdate;
|
3399 | var snapshot;
|
3400 |
|
3401 | if (isFunction(getSnapshotBeforeUpdate)) {
|
3402 | snapshot = getSnapshotBeforeUpdate.call(component, props, state);
|
3403 | }
|
3404 |
|
3405 | return snapshot;
|
3406 | }
|
3407 |
|
3408 | function mountComponent(component) {
|
3409 | var props = component.props;
|
3410 |
|
3411 | if (!component.__componentWillMountTriggered) {
|
3412 | component._constructor && component._constructor(props);
|
3413 | }
|
3414 |
|
3415 | var newState = callGetDerivedStateFromProps(component, props, component.state);
|
3416 |
|
3417 | if (!isUndefined(newState)) {
|
3418 | component.state = newState;
|
3419 | }
|
3420 |
|
3421 | component._dirty = false;
|
3422 | component._disable = false;
|
3423 | component._isForceUpdate = false;
|
3424 |
|
3425 | if (!component.__componentWillMountTriggered) {
|
3426 | component.__componentWillMountTriggered = true;
|
3427 |
|
3428 | if (!hasNewLifecycle(component)) {
|
3429 | componentTrigger(component, 'componentWillMount');
|
3430 | }
|
3431 | }
|
3432 |
|
3433 | doUpdate(component, props, component.state);
|
3434 | component.prevProps = component.props;
|
3435 | component.prevState = component.state;
|
3436 | }
|
3437 | function updateComponent(component) {
|
3438 | var props = component.props,
|
3439 | __propTypes = component.__propTypes;
|
3440 |
|
3441 | if (isDEV && __propTypes) {
|
3442 | var componentName = component.constructor.name;
|
3443 |
|
3444 | if (isUndefined(componentName)) {
|
3445 | var names = component.constructor.toString().match(/^function\s*([^\s(]+)/);
|
3446 | componentName = isArray$1(names) ? names[0] : 'Component';
|
3447 | }
|
3448 |
|
3449 | propTypes.checkPropTypes(__propTypes, props, 'prop', componentName);
|
3450 | }
|
3451 |
|
3452 | var prevProps = component.prevProps || props;
|
3453 | component.props = prevProps;
|
3454 |
|
3455 | if (component.__mounted && component._unsafeCallUpdate === true && !hasNewLifecycle(component) && component.componentWillReceiveProps) {
|
3456 | component._disable = true;
|
3457 | component.componentWillReceiveProps(props);
|
3458 | component._disable = false;
|
3459 | }
|
3460 |
|
3461 |
|
3462 | var state = component.getState();
|
3463 | var prevState = component.prevState || state;
|
3464 | var stateFromProps = callGetDerivedStateFromProps(component, props, state);
|
3465 |
|
3466 | if (!isUndefined(stateFromProps)) {
|
3467 | state = stateFromProps;
|
3468 | }
|
3469 |
|
3470 | var skip = false;
|
3471 |
|
3472 | if (component.__mounted) {
|
3473 | if (isFunction(component.shouldComponentUpdate) && !component._isForceUpdate && component.shouldComponentUpdate(props, state) === false) {
|
3474 | skip = true;
|
3475 | } else if (!hasNewLifecycle(component) && isFunction(component.componentWillUpdate)) {
|
3476 | component.componentWillUpdate(props, state);
|
3477 | }
|
3478 | }
|
3479 |
|
3480 | component.props = props;
|
3481 | component.state = state;
|
3482 | component._dirty = false;
|
3483 | component._isForceUpdate = false;
|
3484 |
|
3485 | if (!skip) {
|
3486 | doUpdate(component, prevProps, prevState);
|
3487 | }
|
3488 |
|
3489 | component.prevProps = component.props;
|
3490 | component.prevState = component.state;
|
3491 | }
|
3492 |
|
3493 | function injectContextType(component) {
|
3494 | var ctxType = component.constructor.contextType;
|
3495 |
|
3496 | if (ctxType) {
|
3497 | var context = ctxType.context;
|
3498 | var emitter = context.emitter;
|
3499 |
|
3500 | if (emitter === null) {
|
3501 | component.context = context._defaultValue;
|
3502 | return;
|
3503 | }
|
3504 |
|
3505 | if (!component._hasContext) {
|
3506 | component._hasContext = true;
|
3507 | emitter.on(function (_) {
|
3508 | return enqueueRender(component);
|
3509 | });
|
3510 | }
|
3511 |
|
3512 | component.context = emitter.value;
|
3513 | }
|
3514 | }
|
3515 |
|
3516 | function doUpdate(component, prevProps, prevState) {
|
3517 | var state = component.state,
|
3518 | _component$props = component.props,
|
3519 | props = _component$props === void 0 ? {} : _component$props;
|
3520 | var data = state || {};
|
3521 |
|
3522 | if (component._createData) {
|
3523 |
|
3524 | if (component.__isReady) {
|
3525 | injectContextType(component);
|
3526 | taro.Current.current = component;
|
3527 | taro.Current.index = 0;
|
3528 | taro.invokeEffects(component, true);
|
3529 | }
|
3530 |
|
3531 | data = component._createData(state, props) || data;
|
3532 |
|
3533 | if (component.__isReady) {
|
3534 | taro.Current.current = null;
|
3535 | }
|
3536 | }
|
3537 |
|
3538 | data = Object.assign({}, props, data);
|
3539 |
|
3540 | if (component.$usedState && component.$usedState.length) {
|
3541 | var _data = {};
|
3542 | component.$usedState.forEach(function (key) {
|
3543 | var val = taro.internal_safe_get(data, key);
|
3544 |
|
3545 | if (typeof val === 'undefined') {
|
3546 | return;
|
3547 | }
|
3548 |
|
3549 | if (_typeof(val) === 'object') {
|
3550 | if (isEmptyObject(val)) return taro.internal_safe_set(_data, key, val);
|
3551 | val = shakeFnFromObject(val);
|
3552 |
|
3553 | if (!isEmptyObject(val)) taro.internal_safe_set(_data, key, val);
|
3554 | } else {
|
3555 | taro.internal_safe_set(_data, key, val);
|
3556 | }
|
3557 | });
|
3558 | data = _data;
|
3559 | }
|
3560 |
|
3561 | data['priTaroCompReady'] = true;
|
3562 | var __mounted = component.__mounted;
|
3563 | var snapshot;
|
3564 |
|
3565 | if (__mounted) {
|
3566 | snapshot = callGetSnapshotBeforeUpdate(component, prevProps, prevState);
|
3567 | }
|
3568 |
|
3569 |
|
3570 | var cbs = [];
|
3571 |
|
3572 | if (component._pendingCallbacks && component._pendingCallbacks.length) {
|
3573 | cbs = component._pendingCallbacks;
|
3574 | component._pendingCallbacks = [];
|
3575 | }
|
3576 |
|
3577 | Object.keys(data).map(function (item) {
|
3578 | if (!(item in component.$scope)) {
|
3579 | component.$scope.$set(item, data[item]);
|
3580 | } else {
|
3581 | component.$scope[item] = data[item];
|
3582 | }
|
3583 | });
|
3584 |
|
3585 | if (__mounted) {
|
3586 | taro.invokeEffects(component);
|
3587 |
|
3588 | if (component['$$hasLoopRef']) {
|
3589 | taro.Current.current = component;
|
3590 | taro.Current.index = 0;
|
3591 | component._disableEffect = true;
|
3592 |
|
3593 | component._createData(component.state, component.props, true);
|
3594 |
|
3595 | component._disableEffect = false;
|
3596 | taro.Current.current = null;
|
3597 | }
|
3598 |
|
3599 | if (isFunction(component.componentDidUpdate)) {
|
3600 | component.componentDidUpdate(prevProps, prevState, snapshot);
|
3601 | }
|
3602 | }
|
3603 |
|
3604 | if (cbs.length) {
|
3605 | var i = cbs.length;
|
3606 |
|
3607 | while (--i >= 0) {
|
3608 | isFunction(cbs[i]) && cbs[i].call(component);
|
3609 | }
|
3610 | }
|
3611 | }
|
3612 |
|
3613 | var items = [];
|
3614 | function enqueueRender(component) {
|
3615 | var isForceUpdate = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
3616 |
|
3617 | component._isForceUpdate = isForceUpdate;
|
3618 |
|
3619 | if (!component._dirty && (component._dirty = true) && items.push(component) === 1) {
|
3620 | nextTick(function () {
|
3621 | rerender();
|
3622 | });
|
3623 | }
|
3624 | }
|
3625 | function rerender() {
|
3626 | var p;
|
3627 | var list = items;
|
3628 | items = [];
|
3629 |
|
3630 | while (p = list.pop()) {
|
3631 | if (p._dirty) {
|
3632 | updateComponent(p, true);
|
3633 | }
|
3634 | }
|
3635 | }
|
3636 |
|
3637 | var PRELOAD_DATA_KEY$1 = 'preload';
|
3638 |
|
3639 | var BaseComponent = function () {
|
3640 |
|
3641 |
|
3642 |
|
3643 | function BaseComponent() {
|
3644 | var props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
3645 | var isPage = arguments.length > 1 ? arguments[1] : undefined;
|
3646 |
|
3647 | _classCallCheck(this, BaseComponent);
|
3648 |
|
3649 | _defineProperty(this, "__computed", {});
|
3650 |
|
3651 | _defineProperty(this, "__props", {});
|
3652 |
|
3653 | _defineProperty(this, "__isReady", false);
|
3654 |
|
3655 | _defineProperty(this, "__mounted", false);
|
3656 |
|
3657 | _defineProperty(this, "nextProps", {});
|
3658 |
|
3659 | _defineProperty(this, "context", {});
|
3660 |
|
3661 | _defineProperty(this, "_dirty", true);
|
3662 |
|
3663 | _defineProperty(this, "_disable", true);
|
3664 |
|
3665 | _defineProperty(this, "_isForceUpdate", false);
|
3666 |
|
3667 | _defineProperty(this, "_pendingStates", []);
|
3668 |
|
3669 | _defineProperty(this, "_pendingCallbacks", []);
|
3670 |
|
3671 | _defineProperty(this, "$componentType", '');
|
3672 |
|
3673 | _defineProperty(this, "$router", {
|
3674 | params: {},
|
3675 | path: ''
|
3676 | });
|
3677 |
|
3678 | _defineProperty(this, "_afterScheduleEffect", false);
|
3679 |
|
3680 | _defineProperty(this, "_disableEffect", false);
|
3681 |
|
3682 | _defineProperty(this, "hooks", []);
|
3683 |
|
3684 | _defineProperty(this, "effects", []);
|
3685 |
|
3686 | _defineProperty(this, "layoutEffects", []);
|
3687 |
|
3688 | this.state = {};
|
3689 | this.props = props || {};
|
3690 | this.$componentType = isPage ? 'PAGE' : 'COMPONENT';
|
3691 | this.$prefix = genCompPrefix();
|
3692 | this.isTaroComponent = this.$componentType && this.$router && this._pendingStates;
|
3693 | }
|
3694 |
|
3695 | _createClass(BaseComponent, [{
|
3696 | key: "_constructor",
|
3697 | value: function _constructor(props) {
|
3698 | this.props = props || {};
|
3699 | }
|
3700 | }, {
|
3701 | key: "_init",
|
3702 | value: function _init(scope) {
|
3703 | this.$scope = scope;
|
3704 | }
|
3705 | }, {
|
3706 | key: "setState",
|
3707 | value: function setState(state, callback) {
|
3708 | if (state) {
|
3709 | (this._pendingStates = this._pendingStates || []).push(state);
|
3710 | }
|
3711 |
|
3712 | if (isFunction(callback)) {
|
3713 | (this._pendingCallbacks = this._pendingCallbacks || []).push(callback);
|
3714 | }
|
3715 |
|
3716 | if (!this._disable) {
|
3717 | enqueueRender(this, taro.internal_force_update === callback);
|
3718 | }
|
3719 | }
|
3720 | }, {
|
3721 | key: "getState",
|
3722 | value: function getState() {
|
3723 | var _this = this;
|
3724 |
|
3725 | var _pendingStates = this._pendingStates,
|
3726 | state = this.state,
|
3727 | props = this.props;
|
3728 | var stateClone = Object.assign({}, state);
|
3729 | delete stateClone.__data;
|
3730 |
|
3731 | if (!_pendingStates.length) {
|
3732 | return stateClone;
|
3733 | }
|
3734 |
|
3735 | var queue = _pendingStates.concat();
|
3736 |
|
3737 | this._pendingStates.length = 0;
|
3738 | queue.forEach(function (nextState) {
|
3739 | if (typeof nextState === 'function') {
|
3740 | nextState = nextState.call(_this, stateClone, props);
|
3741 | }
|
3742 |
|
3743 | Object.assign(stateClone, nextState);
|
3744 | });
|
3745 | return stateClone;
|
3746 | }
|
3747 | }, {
|
3748 | key: "forceUpdate",
|
3749 | value: function forceUpdate(callback) {
|
3750 | if (typeof callback === 'function') {
|
3751 | (this._pendingCallbacks = this._pendingCallbacks || []).push(callback);
|
3752 | }
|
3753 |
|
3754 | this._isForceUpdate = true;
|
3755 | updateComponent(this);
|
3756 | }
|
3757 | }, {
|
3758 | key: "$preload",
|
3759 | value: function $preload(key, value) {
|
3760 | var preloadData = cacheDataGet(PRELOAD_DATA_KEY$1) || {};
|
3761 |
|
3762 | if (_typeof(key) === 'object') {
|
3763 | for (var k in key) {
|
3764 | preloadData[k] = key[k];
|
3765 | }
|
3766 | } else {
|
3767 | preloadData[key] = value;
|
3768 | }
|
3769 |
|
3770 | cacheDataSet(PRELOAD_DATA_KEY$1, preloadData);
|
3771 | }
|
3772 |
|
3773 | }, {
|
3774 | key: "__triggerPropsFn",
|
3775 | value: function __triggerPropsFn(key, args) {
|
3776 | var keyChain = key.split('.');
|
3777 | var reduxFnPrefix = '__event_';
|
3778 | var reduxFnName = reduxFnPrefix + keyChain.shift();
|
3779 |
|
3780 | if (reduxFnName in this) {
|
3781 | var scope = args.shift();
|
3782 | var fn;
|
3783 |
|
3784 | if (keyChain.length > 0) {
|
3785 | fn = taro.internal_safe_get(this[reduxFnName], keyChain.join('.'));
|
3786 | } else {
|
3787 | fn = this[reduxFnName];
|
3788 | }
|
3789 |
|
3790 | fn.apply(scope, args);
|
3791 | } else {
|
3792 |
|
3793 | var keyLower = key.toLocaleLowerCase();
|
3794 | var payload = {
|
3795 | __isCustomEvt: true,
|
3796 | __arguments: args
|
3797 | };
|
3798 | var detail = {};
|
3799 | var externalBinding = this.$scope._externalBinding;
|
3800 | var attr = this.$scope._attr || this.$scope.attr || externalBinding && externalBinding.template.attr;
|
3801 |
|
3802 | if (attr) {
|
3803 | Object.keys(attr).forEach(function (item) {
|
3804 | if (/^data/.test(item)) {
|
3805 | detail[item.replace(/_/g, '').replace(/^data/, '')] = typeof attr[item] === 'function' ? attr[item]() : attr[item];
|
3806 | }
|
3807 | });
|
3808 | }
|
3809 |
|
3810 | if (Object.keys(detail).length) {
|
3811 | payload.__detail = detail;
|
3812 | }
|
3813 |
|
3814 | this.$scope.$emit(keyLower.replace(/^on/, ''), payload);
|
3815 | }
|
3816 | }
|
3817 | }]);
|
3818 |
|
3819 | return BaseComponent;
|
3820 | }();
|
3821 |
|
3822 | var PureComponent = function (_Component) {
|
3823 | _inherits(PureComponent, _Component);
|
3824 |
|
3825 | var _super = _createSuper(PureComponent);
|
3826 |
|
3827 | function PureComponent() {
|
3828 | var _this;
|
3829 |
|
3830 | _classCallCheck(this, PureComponent);
|
3831 |
|
3832 | for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
3833 | args[_key] = arguments[_key];
|
3834 | }
|
3835 |
|
3836 | _this = _super.call.apply(_super, [this].concat(args));
|
3837 |
|
3838 | _defineProperty(_assertThisInitialized(_this), "isPureComponent", true);
|
3839 |
|
3840 | return _this;
|
3841 | }
|
3842 |
|
3843 | _createClass(PureComponent, [{
|
3844 | key: "shouldComponentUpdate",
|
3845 | value: function shouldComponentUpdate(nextProps, nextState) {
|
3846 | return !shallowEqual(this.props, nextProps) || !shallowEqual(this.state, nextState);
|
3847 | }
|
3848 | }]);
|
3849 |
|
3850 | return PureComponent;
|
3851 | }(BaseComponent);
|
3852 |
|
3853 | function createApp(AppClass) {
|
3854 | var app = new AppClass();
|
3855 | var appConf = {
|
3856 | onCreate: function onCreate(options) {
|
3857 | globalRef.$app = this;
|
3858 | app.$app = this;
|
3859 | app.$app.$router = app.$router = {
|
3860 | params: options
|
3861 | };
|
3862 |
|
3863 | if (app.componentWillMount) {
|
3864 | app.componentWillMount();
|
3865 | }
|
3866 |
|
3867 | if (app.componentDidMount) {
|
3868 | app.componentDidMount();
|
3869 | }
|
3870 | },
|
3871 | onDestroy: function onDestroy() {
|
3872 | if (app.componentWillUnmount) {
|
3873 | app.componentWillUnmount();
|
3874 | }
|
3875 | }
|
3876 | };
|
3877 | return Object.assign(appConf, app);
|
3878 | }
|
3879 |
|
3880 | function request() {
|
3881 | var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
3882 | return new Promise(function (resolve, reject) {
|
3883 | if (typeof options === 'string') {
|
3884 | options = {
|
3885 | url: options
|
3886 | };
|
3887 | }
|
3888 |
|
3889 | var _options = options,
|
3890 | _options$url = _options.url,
|
3891 | url = _options$url === void 0 ? '' : _options$url,
|
3892 | method = _options.method,
|
3893 | _options$dataType = _options.dataType,
|
3894 | dataType = _options$dataType === void 0 ? 'json' : _options$dataType,
|
3895 | _success = _options.success,
|
3896 | _fail = _options.fail,
|
3897 | complete = _options.complete;
|
3898 | var _options2 = options,
|
3899 | header = _options2.header,
|
3900 | _options2$data = _options2.data,
|
3901 | data = _options2$data === void 0 ? '' : _options2$data;
|
3902 |
|
3903 | if (_typeof(header) !== 'object') header = {};
|
3904 |
|
3905 | if (!header['content-type'] && !header['Content-Type']) {
|
3906 | header['Content-Type'] = 'application/json';
|
3907 | }
|
3908 |
|
3909 |
|
3910 | var methodUpper = typeof method === 'string' ? method.toUpperCase() : 'GET';
|
3911 |
|
3912 | if (methodUpper === 'POST' && _typeof(data) === 'object') {
|
3913 | var contentType = header && (header['Content-Type'] || header['content-type']);
|
3914 |
|
3915 | if (contentType === 'application/json') {
|
3916 | data = JSON.stringify(data);
|
3917 | }
|
3918 | }
|
3919 |
|
3920 |
|
3921 | var obj = {
|
3922 | url: url,
|
3923 | data: data,
|
3924 | header: header,
|
3925 | method: methodUpper,
|
3926 | success: function success(res) {
|
3927 | var data = res.data;
|
3928 | if (dataType === 'json') data = JSON.parse(res.data);
|
3929 | var reponse = {
|
3930 | data: data,
|
3931 | statusCode: res.code,
|
3932 | header: res.headers
|
3933 | };
|
3934 | typeof _success === 'function' && _success(reponse);
|
3935 | typeof complete === 'function' && complete(reponse);
|
3936 | resolve(reponse);
|
3937 | },
|
3938 | fail: function fail(err, code) {
|
3939 | var reason = {
|
3940 | err: err,
|
3941 | code: code
|
3942 | };
|
3943 | typeof _fail === 'function' && _fail(reason);
|
3944 | typeof complete === 'function' && complete(reason);
|
3945 | reject(reason);
|
3946 | }
|
3947 | };
|
3948 | fetch.fetch(obj);
|
3949 | });
|
3950 | }
|
3951 | function uploadFile() {
|
3952 | var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
3953 | return new Promise(function (resolve, reject) {
|
3954 | var _options$url2 = options.url,
|
3955 | url = _options$url2 === void 0 ? '' : _options$url2,
|
3956 | filePath = options.filePath,
|
3957 | _options$name = options.name,
|
3958 | name = _options$name === void 0 ? 'file' : _options$name,
|
3959 | _options$formData = options.formData,
|
3960 | formData = _options$formData === void 0 ? {} : _options$formData,
|
3961 | _success2 = options.success,
|
3962 | _fail2 = options.fail,
|
3963 | complete = options.complete;
|
3964 | var header = options.header,
|
3965 | _options$method = options.method,
|
3966 | method = _options$method === void 0 ? 'POST' : _options$method,
|
3967 | _options$files = options.files,
|
3968 | files = _options$files === void 0 ? [] : _options$files,
|
3969 | _options$data = options.data,
|
3970 | data = _options$data === void 0 ? [] : _options$data;
|
3971 | if (_typeof(header) !== 'object') header = {};
|
3972 |
|
3973 | if (files.length === 0) {
|
3974 | files.push({
|
3975 | name: name,
|
3976 | uri: filePath
|
3977 | });
|
3978 | }
|
3979 |
|
3980 | if (data.length === 0) {
|
3981 | data.push(formData);
|
3982 | }
|
3983 |
|
3984 | var methodUpper = typeof method === 'string' ? method.toUpperCase() : 'POST';
|
3985 | var obj = {
|
3986 | url: url,
|
3987 | header: header,
|
3988 | method: methodUpper,
|
3989 | files: files,
|
3990 | data: data,
|
3991 | success: function success(res) {
|
3992 | var data = res.data;
|
3993 | if (dataType === 'json') data = JSON.parse(res.data);
|
3994 | var reponse = {
|
3995 | data: data,
|
3996 | statusCode: res.code,
|
3997 | header: res.headers
|
3998 | };
|
3999 | typeof _success2 === 'function' && _success2(reponse);
|
4000 | typeof complete === 'function' && complete(reponse);
|
4001 | resolve(reponse);
|
4002 | },
|
4003 | fail: function fail(err, code) {
|
4004 | var reason = {
|
4005 | err: err,
|
4006 | code: code
|
4007 | };
|
4008 | typeof _fail2 === 'function' && _fail2(reason);
|
4009 | typeof complete === 'function' && complete(reason);
|
4010 | reject(reason);
|
4011 | }
|
4012 | };
|
4013 | quickRequest.upload(obj);
|
4014 | });
|
4015 | }
|
4016 | function downloadFile() {
|
4017 | var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
4018 | return new Promise(function (resolve, reject) {
|
4019 | var _options$url3 = options.url,
|
4020 | url = _options$url3 === void 0 ? '' : _options$url3,
|
4021 | _options$description = options.description,
|
4022 | description = _options$description === void 0 ? '' : _options$description,
|
4023 | filename = options.filename,
|
4024 | _success3 = options.success,
|
4025 | _fail3 = options.fail,
|
4026 | complete = options.complete;
|
4027 | var header = options.header;
|
4028 | if (_typeof(header) !== 'object') header = {};
|
4029 | var obj = {
|
4030 | url: url,
|
4031 | header: header,
|
4032 | description: description,
|
4033 | data: data,
|
4034 | success: function success(res) {
|
4035 | var data = res.data;
|
4036 | if (dataType === 'json') data = JSON.parse(res.data);
|
4037 | var reponse = {
|
4038 | data: data,
|
4039 | statusCode: res.code,
|
4040 | header: res.headers
|
4041 | };
|
4042 | typeof _success3 === 'function' && _success3(reponse);
|
4043 | typeof complete === 'function' && complete(reponse);
|
4044 | resolve(reponse);
|
4045 | },
|
4046 | fail: function fail(err, code) {
|
4047 | var reason = {
|
4048 | err: err,
|
4049 | code: code
|
4050 | };
|
4051 | typeof _fail3 === 'function' && _fail3(reason);
|
4052 | typeof complete === 'function' && complete(reason);
|
4053 | reject(reason);
|
4054 | }
|
4055 | };
|
4056 | if (filename) obj.filename = filename;
|
4057 | quickRequest.download(obj);
|
4058 | });
|
4059 | }
|
4060 |
|
4061 | function generateUnSupportApi(errText, fnNames) {
|
4062 | var res = {};
|
4063 | fnNames.forEach(function (fnName) {
|
4064 | res[fnName] = function () {
|
4065 | throw new Error(errText);
|
4066 | };
|
4067 | });
|
4068 | return res;
|
4069 | }
|
4070 | function makeSyncPromise(fnName, process) {
|
4071 | var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
4072 | var success = options.success,
|
4073 | fail = options.fail,
|
4074 | complete = options.complete;
|
4075 | var res = {
|
4076 | errMsg: "".concat(fnName, ":ok")
|
4077 | };
|
4078 | return new Promise(function (resolve, reject) {
|
4079 | try {
|
4080 | process && process();
|
4081 | success && success(res);
|
4082 | complete && complete(res);
|
4083 | resolve(res);
|
4084 | } catch (data) {
|
4085 | res.errMsg = "".concat(fnName, ":error");
|
4086 | res.data = data;
|
4087 | fail && fail(res);
|
4088 | complete && complete(res);
|
4089 | reject(res);
|
4090 | }
|
4091 | });
|
4092 | }
|
4093 | function temporarilyNotSupport(apiName) {
|
4094 | return function () {
|
4095 | var errMsg = "\u6682\u65F6\u4E0D\u652F\u6301 API ".concat(apiName);
|
4096 | console.error(errMsg);
|
4097 | return Promise.reject(new Error(errMsg));
|
4098 | };
|
4099 | }
|
4100 |
|
4101 | function setStorage() {
|
4102 | var opts = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
4103 | var key = opts.key,
|
4104 | data = opts.data,
|
4105 | _success = opts.success,
|
4106 | _fail = opts.fail,
|
4107 | complete = opts.complete;
|
4108 | var res = {
|
4109 | errMsg: 'setStorage:ok'
|
4110 | };
|
4111 | return new Promise(function (resolve, reject) {
|
4112 | storage.set({
|
4113 | key: key,
|
4114 | value: JSON.stringify(data),
|
4115 | success: function success() {
|
4116 | _success && _success(res);
|
4117 | complete && complete(res);
|
4118 | resolve(res);
|
4119 | },
|
4120 | fail: function fail(message, code) {
|
4121 | res.errMsg = message;
|
4122 | res.code = code;
|
4123 | _fail && _fail(res);
|
4124 | complete && complete(res);
|
4125 | reject(res);
|
4126 | }
|
4127 | });
|
4128 | });
|
4129 | }
|
4130 | function getStorage() {
|
4131 | var opts = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
4132 | var key = opts.key,
|
4133 | _success2 = opts.success,
|
4134 | _fail2 = opts.fail,
|
4135 | complete = opts.complete;
|
4136 | var res = {
|
4137 | errMsg: 'getStorage:ok'
|
4138 | };
|
4139 | return new Promise(function (resolve, reject) {
|
4140 | storage.get({
|
4141 | key: key,
|
4142 | success: function success(data) {
|
4143 | res.data = data ? JSON.parse(data) : data;
|
4144 | _success2 && _success2(res);
|
4145 | complete && complete(res);
|
4146 | resolve(res);
|
4147 | },
|
4148 | fail: function fail(message, code) {
|
4149 | res.errMsg = message;
|
4150 | res.code = code;
|
4151 | _fail2 && _fail2(res);
|
4152 | complete && complete(res);
|
4153 | reject(res);
|
4154 | }
|
4155 | });
|
4156 | });
|
4157 | }
|
4158 | function getStorageInfo() {
|
4159 | console.log('快应用暂不支持getStorageInfo api');
|
4160 | }
|
4161 | function removeStorage() {
|
4162 | var opts = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
4163 | var key = opts.key,
|
4164 | _success3 = opts.success,
|
4165 | _fail3 = opts.fail,
|
4166 | complete = opts.complete;
|
4167 | var res = {
|
4168 | errMsg: 'removeStorage:ok'
|
4169 | };
|
4170 | return new Promise(function (resolve, reject) {
|
4171 | storage["delete"]({
|
4172 | key: key,
|
4173 | success: function success() {
|
4174 | _success3 && _success3(res);
|
4175 | complete && complete(res);
|
4176 | resolve(res);
|
4177 | },
|
4178 | fail: function fail(message, code) {
|
4179 | res.errMsg = message;
|
4180 | res.code = code;
|
4181 | _fail3 && _fail3(res);
|
4182 | complete && complete(res);
|
4183 | reject(res);
|
4184 | }
|
4185 | });
|
4186 | });
|
4187 | }
|
4188 | function clearStorage() {
|
4189 | return storage.clear();
|
4190 | }
|
4191 | var unSupportApis = ['setStorageSync', 'getStorageSync', 'getStorageInfoSync', 'removeStorageSync', 'clearStorageSync'];
|
4192 | unSupportApis = generateUnSupportApi('快应用暂不支持storage的同步存取', unSupportApis);
|
4193 | var qStorage = {
|
4194 | setStorage: setStorage,
|
4195 | getStorage: getStorage,
|
4196 | getStorageInfo: getStorageInfo,
|
4197 | removeStorage: removeStorage,
|
4198 | clearStorage: clearStorage
|
4199 | };
|
4200 | Object.assign(qStorage, unSupportApis);
|
4201 |
|
4202 | var preloadPrivateKey$1 = 'quick$PriPreload';
|
4203 | var preloadInitedComponent$1 = 'quick$PriPreloadComponent';
|
4204 | function navigateTo() {
|
4205 | var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
4206 | return qappNavigate(options);
|
4207 | }
|
4208 | function redirectTo() {
|
4209 | var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
4210 | return qappNavigate(options, 'replace');
|
4211 | }
|
4212 | function navigateBack() {
|
4213 | router.back();
|
4214 | }
|
4215 | function switchTab() {
|
4216 | var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
4217 | router.clear();
|
4218 | return qappNavigate(options, 'replace');
|
4219 | }
|
4220 | function getCurrentPages$1() {
|
4221 | return router.getLength();
|
4222 | }
|
4223 | function reLaunch() {
|
4224 | var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
4225 | router.clear();
|
4226 | return qappNavigate(options, 'replace');
|
4227 | }
|
4228 |
|
4229 | function qappNavigate() {
|
4230 | var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
4231 | var method = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'push';
|
4232 | var _options$url = options.url,
|
4233 | url = _options$url === void 0 ? '' : _options$url,
|
4234 | success = options.success,
|
4235 | fail = options.fail,
|
4236 | complete = options.complete;
|
4237 | var res = {
|
4238 | errMsg: 'ok'
|
4239 | };
|
4240 | return new Promise(function (resolve, reject) {
|
4241 | var params = {};
|
4242 |
|
4243 | if (!url) {
|
4244 | res.errMsg = 'url不能为空';
|
4245 | fail && fail(res);
|
4246 | reject(res);
|
4247 | return;
|
4248 | }
|
4249 |
|
4250 | params = getUrlParams(url);
|
4251 | var markIndex = url.indexOf('?');
|
4252 | var componentPath = globalRef.componentPath || '';
|
4253 | var parseUrl = url.substr(0, markIndex >= 0 ? markIndex : url.length);
|
4254 | var RelativeReg = /\.\.\//g;
|
4255 |
|
4256 | if (componentPath && RelativeReg.test(parseUrl)) {
|
4257 |
|
4258 | var componentRootDir = componentPath.substr(0, componentPath.lastIndexOf('/'));
|
4259 | var pathArr = parseUrl.split('/');
|
4260 |
|
4261 | var _iterator = _createForOfIteratorHelper(pathArr),
|
4262 | _step;
|
4263 |
|
4264 | try {
|
4265 | for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
4266 | var path = _step.value;
|
4267 |
|
4268 | if (path === '..') {
|
4269 | componentRootDir = componentRootDir.substr(0, componentRootDir.lastIndexOf('/'));
|
4270 | }
|
4271 | }
|
4272 | } catch (err) {
|
4273 | _iterator.e(err);
|
4274 | } finally {
|
4275 | _iterator.f();
|
4276 | }
|
4277 |
|
4278 | parseUrl = componentRootDir + '/' + parseUrl.replace(RelativeReg, '');
|
4279 | }
|
4280 |
|
4281 | parseUrl = addLeadingSlash$1(parseUrl);
|
4282 | globalRef.taroRouterParamsCache = globalRef.taroRouterParamsCache || {};
|
4283 | globalRef.taroRouterParamsCache[parseUrl] = params;
|
4284 |
|
4285 | if (method === 'push' || method === 'replace') {
|
4286 | var Component = cacheDataGet(parseUrl);
|
4287 |
|
4288 | if (Component) {
|
4289 | var component = new Component();
|
4290 |
|
4291 | if (component.componentWillPreload) {
|
4292 | var cacheKey = getUniqueKey();
|
4293 | cacheDataSet(cacheKey, component.componentWillPreload(Object.assign({}, params)));
|
4294 | cacheDataSet(preloadInitedComponent$1, component);
|
4295 | params[preloadPrivateKey$1] = cacheKey;
|
4296 | }
|
4297 | }
|
4298 | }
|
4299 |
|
4300 | try {
|
4301 | router[method]({
|
4302 | uri: parseUrl.substr(0, parseUrl.lastIndexOf('/')),
|
4303 | params: params
|
4304 | });
|
4305 | success && success(res);
|
4306 | complete && complete(res);
|
4307 | resolve(res);
|
4308 | } catch (data) {
|
4309 | res.errMsg = 'error';
|
4310 | res.data = data;
|
4311 | fail && fail(res);
|
4312 | reject(res);
|
4313 | }
|
4314 | });
|
4315 | }
|
4316 |
|
4317 | function getUrlParams() {
|
4318 | var url = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
|
4319 | var params = {};
|
4320 | url = url.replace(/#.*$/, '');
|
4321 | var queryArray = url.split(/[?&]/).slice(1);
|
4322 | queryArray.forEach(function (item) {
|
4323 | var match = item.match(/([^=]+)=([^=]+)/);
|
4324 |
|
4325 | if (match != null) {
|
4326 | params[match[1]] = decodeURIComponent(match[2]);
|
4327 | }
|
4328 | });
|
4329 | return params;
|
4330 | }
|
4331 |
|
4332 | function showToast() {
|
4333 | var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
4334 | var _options$title = options.title,
|
4335 | title = _options$title === void 0 ? '' : _options$title,
|
4336 | _options$duration = options.duration,
|
4337 | duration = _options$duration === void 0 ? 1500 : _options$duration,
|
4338 | success = options.success,
|
4339 | complete = options.complete,
|
4340 | fail = options.fail;
|
4341 | var res = {
|
4342 | errMsg: 'showToast:ok'
|
4343 | };
|
4344 | return new Promise(function (resolve, reject) {
|
4345 | try {
|
4346 | prompt.showToast({
|
4347 | message: title,
|
4348 | duration: duration
|
4349 | });
|
4350 | success && success(res);
|
4351 | complete && complete(res);
|
4352 | resolve(res);
|
4353 | } catch (data) {
|
4354 | res.errMsg = 'showToast: error';
|
4355 | res.data = data;
|
4356 | fail && fail(res);
|
4357 | reject(res);
|
4358 | }
|
4359 | });
|
4360 | }
|
4361 | function showModal() {
|
4362 | var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
4363 | var _options$title2 = options.title,
|
4364 | title = _options$title2 === void 0 ? '' : _options$title2,
|
4365 | _options$content = options.content,
|
4366 | content = _options$content === void 0 ? '' : _options$content,
|
4367 | _options$showCancel = options.showCancel,
|
4368 | showCancel = _options$showCancel === void 0 ? true : _options$showCancel,
|
4369 | _options$cancelText = options.cancelText,
|
4370 | cancelText = _options$cancelText === void 0 ? '取消' : _options$cancelText,
|
4371 | _options$cancelColor = options.cancelColor,
|
4372 | cancelColor = _options$cancelColor === void 0 ? '#000000' : _options$cancelColor,
|
4373 | _options$confirmText = options.confirmText,
|
4374 | confirmText = _options$confirmText === void 0 ? '确定' : _options$confirmText,
|
4375 | _options$confirmColor = options.confirmColor,
|
4376 | confirmColor = _options$confirmColor === void 0 ? '#3CC51F' : _options$confirmColor,
|
4377 | _success = options.success,
|
4378 | _fail = options.fail,
|
4379 | complete = options.complete;
|
4380 | var res = {
|
4381 | errMsg: 'showModel:ok',
|
4382 | confirm: false,
|
4383 | cancel: false
|
4384 | };
|
4385 | var btnList = [{
|
4386 | text: confirmText,
|
4387 | color: confirmColor
|
4388 | }];
|
4389 | showCancel && btnList.push({
|
4390 | text: cancelText,
|
4391 | color: cancelColor
|
4392 | });
|
4393 | return new Promise(function (resolve, reject) {
|
4394 | prompt.showDialog({
|
4395 | title: title,
|
4396 | message: content,
|
4397 | buttons: btnList,
|
4398 | success: function success(data) {
|
4399 | if (showCancel) {
|
4400 | res.confirm = data.index === 0;
|
4401 | res.cancel = data.index === 1;
|
4402 | } else {
|
4403 | res.confirm = true;
|
4404 | }
|
4405 |
|
4406 | _success && _success(res);
|
4407 | complete && complete(res);
|
4408 | resolve(res);
|
4409 | },
|
4410 | cancel: function cancel() {
|
4411 | _success && _success(res);
|
4412 | complete && complete(res);
|
4413 | res.cancel = true;
|
4414 | resolve(res);
|
4415 | },
|
4416 | fail: function fail(data, code) {
|
4417 | res.errMsg = data;
|
4418 | res.code = code;
|
4419 | _fail && _fail(res);
|
4420 | reject(res);
|
4421 | console.log("handling fail, code = ".concat(code), data);
|
4422 | }
|
4423 | });
|
4424 | });
|
4425 | }
|
4426 | function showActionSheet() {
|
4427 | var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
4428 | var itemList = options.itemList,
|
4429 | _options$itemColor = options.itemColor,
|
4430 | itemColor = _options$itemColor === void 0 ? '#000000' : _options$itemColor,
|
4431 | _success2 = options.success,
|
4432 | _fail2 = options.fail,
|
4433 | complete = options.complete;
|
4434 | var res = {
|
4435 | errMsg: 'showActionSheet:ok'
|
4436 | };
|
4437 | return new Promise(function (resolve, reject) {
|
4438 | if (!itemList) {
|
4439 | console.warn('itemList必传');
|
4440 | res.errMsg = 'itemList必传';
|
4441 | reject(res);
|
4442 | return;
|
4443 | }
|
4444 |
|
4445 | prompt.showContextMenu({
|
4446 | itemList: itemList,
|
4447 | itemColor: itemColor,
|
4448 | success: function success(data) {
|
4449 | res.tapIndex = data.index;
|
4450 | _success2 && _success2(res);
|
4451 | complete && complete(res);
|
4452 | resolve(res);
|
4453 | },
|
4454 | cancel: function cancel() {
|
4455 | res.errMsg = 'cancelActionSheet: success';
|
4456 | _success2 && _success2(res);
|
4457 | complete && complete(res);
|
4458 | res.tapIndex = -1;
|
4459 | resolve(res);
|
4460 | },
|
4461 | fail: function fail(data, code) {
|
4462 | res.errMsg = data;
|
4463 | res.code = code;
|
4464 | complete && complete(res);
|
4465 | _fail2 && _fail2(res);
|
4466 | reject(res);
|
4467 | console.log("handling fail, code = ".concat(code), data);
|
4468 | }
|
4469 | });
|
4470 | });
|
4471 | }
|
4472 |
|
4473 | function setNavigationBar(params, fnName) {
|
4474 | var success = params.success,
|
4475 | complete = params.complete,
|
4476 | fail = params.fail;
|
4477 | var res = {
|
4478 | errMsg: "".concat(fnName, ": ok")
|
4479 | };
|
4480 | return new Promise(function (resolve, reject) {
|
4481 | try {
|
4482 | globalRef.eventCenter.trigger('TaroEvent:setNavigationBar', params);
|
4483 | success && success(res);
|
4484 | complete && complete(res);
|
4485 | resolve(res);
|
4486 | } catch (data) {
|
4487 | res.errMsg = "".concat(fnName, ": error");
|
4488 | res.data = data;
|
4489 | fail && fail(res);
|
4490 | reject(res);
|
4491 | }
|
4492 | });
|
4493 | }
|
4494 |
|
4495 | function setNavigationBarTitle(params) {
|
4496 | setNavigationBar(params, 'setNavigationBarTitle');
|
4497 | }
|
4498 | function setNavigationBarColor(params) {
|
4499 | setNavigationBar(params, 'setNavigationBarColor');
|
4500 | }
|
4501 | function startPullDownRefresh() {
|
4502 | var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
4503 | var success = options.success,
|
4504 | complete = options.complete,
|
4505 | fail = options.fail;
|
4506 | var res = {
|
4507 | errMsg: "startPullDownRefresh: ok"
|
4508 | };
|
4509 | return new Promise(function (resolve, reject) {
|
4510 | try {
|
4511 | globalRef.eventCenter.trigger('TaroPage:startPullDownRefresh');
|
4512 | success && success(res);
|
4513 | complete && complete(res);
|
4514 | resolve(res);
|
4515 | } catch (data) {
|
4516 | res.errMsg = 'startPullDownRefresh: error';
|
4517 | res.data = data;
|
4518 | fail && fail(res);
|
4519 | reject(res);
|
4520 | }
|
4521 | });
|
4522 | }
|
4523 | function stopPullDownRefresh() {
|
4524 | var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
4525 | var success = options.success,
|
4526 | complete = options.complete,
|
4527 | fail = options.fail;
|
4528 | var res = {
|
4529 | errMsg: "stopPullDownRefresh: ok"
|
4530 | };
|
4531 | return new Promise(function (resolve, reject) {
|
4532 | try {
|
4533 | globalRef.eventCenter.trigger('TaroPage:stopPullDownRefresh');
|
4534 | success && success(res);
|
4535 | complete && complete(res);
|
4536 | resolve(res);
|
4537 | } catch (data) {
|
4538 | res.errMsg = 'stopPullDownRefresh: error';
|
4539 | res.data = data;
|
4540 | fail && fail(res);
|
4541 | reject(res);
|
4542 | }
|
4543 | });
|
4544 | }
|
4545 |
|
4546 | function scanCode() {
|
4547 | var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
4548 | var _success = options.success,
|
4549 | _fail = options.fail,
|
4550 | _complete = options.complete;
|
4551 | var res = {
|
4552 | errMsg: 'scanCode:ok'
|
4553 | };
|
4554 | return new Promise(function (resolve, reject) {
|
4555 | barcode.scan({
|
4556 | success: function success(data) {
|
4557 | res.result = data.result;
|
4558 | _success && _success(res);
|
4559 | _complete && _complete(res);
|
4560 | resolve(res);
|
4561 | },
|
4562 | cancel: function cancel() {
|
4563 | res.errMsg = 'cancelScanCode: success';
|
4564 | _success && _success(res);
|
4565 | _complete && _complete(res);
|
4566 | res.result = '';
|
4567 | resolve(res);
|
4568 | },
|
4569 | fail: function fail(data, code) {
|
4570 | res.errMsg = data;
|
4571 | res.code = code;
|
4572 | _complete && _complete(res);
|
4573 | _fail && _fail(res);
|
4574 | reject(res);
|
4575 | console.log("scanCode fail, code = ".concat(code), data);
|
4576 | },
|
4577 | complete: function complete() {
|
4578 | _complete && _complete(res);
|
4579 | }
|
4580 | });
|
4581 | });
|
4582 | }
|
4583 | function vibrateShort() {
|
4584 | var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
4585 | return makeSyncPromise('vibrateShort', function () {
|
4586 | vibrator.vibrate({
|
4587 | mode: 'short'
|
4588 | });
|
4589 | }, options);
|
4590 | }
|
4591 | function vibrateLong() {
|
4592 | var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
4593 | return makeSyncPromise('vibrateLong', function () {
|
4594 | vibrator.vibrate({
|
4595 | mode: 'long'
|
4596 | });
|
4597 | }, options);
|
4598 | }
|
4599 | function setClipboardData() {
|
4600 | var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
4601 | var data = options.data,
|
4602 | _success2 = options.success,
|
4603 | _fail2 = options.fail,
|
4604 | _complete2 = options.complete;
|
4605 | var res = {
|
4606 | errMsg: 'setClipboardData:ok'
|
4607 | };
|
4608 | return new Promise(function (resolve, reject) {
|
4609 | clipboard.set({
|
4610 | text: data,
|
4611 | success: function success(data) {
|
4612 | res.result = data.result;
|
4613 | _success2 && _success2(res);
|
4614 | resolve(res);
|
4615 | },
|
4616 | fail: function fail(data, code) {
|
4617 | res.errMsg = data;
|
4618 | res.code = code;
|
4619 | _fail2 && _fail2(res);
|
4620 | reject(res);
|
4621 | },
|
4622 | complete: function complete() {
|
4623 | _complete2 && _complete2(res);
|
4624 | }
|
4625 | });
|
4626 | });
|
4627 | }
|
4628 | function getClipboardData() {
|
4629 | var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
4630 | var _success3 = options.success,
|
4631 | _fail3 = options.fail,
|
4632 | _complete3 = options.complete;
|
4633 | var res = {
|
4634 | errMsg: 'getClipboardData:ok'
|
4635 | };
|
4636 | return new Promise(function (resolve, reject) {
|
4637 | clipboard.get({
|
4638 | success: function success(data) {
|
4639 | res.data = data.text;
|
4640 | _success3 && _success3(res);
|
4641 | resolve(res);
|
4642 | },
|
4643 | fail: function fail(data, code) {
|
4644 | res.errMsg = data;
|
4645 | res.code = code;
|
4646 | _fail3 && _fail3(res);
|
4647 | reject(res);
|
4648 | },
|
4649 | complete: function complete() {
|
4650 | _complete3 && _complete3(res);
|
4651 | }
|
4652 | });
|
4653 | });
|
4654 | }
|
4655 | function startAccelerometer() {
|
4656 | var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
4657 | return makeSyncPromise('startAccelerometer', null, options);
|
4658 | }
|
4659 | function stopAccelerometer() {
|
4660 | var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
4661 | return makeSyncPromise('stopAccelerometer', function () {
|
4662 | sensor.unsubscribeAccelerometer();
|
4663 | }, options);
|
4664 | }
|
4665 | function onAccelerometerChange(callback) {
|
4666 | if (callback) {
|
4667 | sensor.subscribeAccelerometer({
|
4668 | callback: callback
|
4669 | });
|
4670 | }
|
4671 | }
|
4672 | function startCompass() {
|
4673 | var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
4674 | return makeSyncPromise('startCompass', null, options);
|
4675 | }
|
4676 | function stopCompass() {
|
4677 | var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
4678 | return makeSyncPromise('stopCompass', function () {
|
4679 | sensor.unsubscribeCompass();
|
4680 | }, options);
|
4681 | }
|
4682 | function onCompassChange(callback) {
|
4683 | if (callback) {
|
4684 | sensor.subscribeCompass({
|
4685 | callback: callback
|
4686 | });
|
4687 | }
|
4688 | }
|
4689 | function getLocation() {
|
4690 | var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
4691 | var _success4 = options.success,
|
4692 | _fail4 = options.fail,
|
4693 | _complete4 = options.complete;
|
4694 | var res = {
|
4695 | errMsg: 'getLocation:ok'
|
4696 | };
|
4697 | return new Promise(function (resolve, reject) {
|
4698 | geolocation.getLocation({
|
4699 | success: function success(data) {
|
4700 | res.latitude = data.latitude;
|
4701 | res.longitude = data.longitude;
|
4702 | res.accuracy = data.accuracy;
|
4703 | _success4 && _success4(res);
|
4704 | resolve(res);
|
4705 | },
|
4706 | fail: function fail(data, code) {
|
4707 | res.errMsg = data;
|
4708 | res.code = code;
|
4709 | _fail4 && _fail4(res);
|
4710 | reject(res);
|
4711 | },
|
4712 | complete: function complete() {
|
4713 | _complete4 && _complete4(res);
|
4714 | }
|
4715 | });
|
4716 | });
|
4717 | }
|
4718 |
|
4719 | function showShareMenu() {
|
4720 | var opts = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
4721 | var type = opts.type,
|
4722 | data = opts.data,
|
4723 | _success = opts.success,
|
4724 | _fail = opts.fail,
|
4725 | complete = opts.complete;
|
4726 | var res = {
|
4727 | errMsg: 'showShareMenu:ok'
|
4728 | };
|
4729 | return new Promise(function (resolve, reject) {
|
4730 | share.share({
|
4731 | type: type,
|
4732 | data: data,
|
4733 | success: function success() {
|
4734 | _success && _success(res);
|
4735 | complete && complete(res);
|
4736 | resolve(res);
|
4737 | },
|
4738 | fail: function fail(message, code) {
|
4739 | res.errMsg = message;
|
4740 | res.code = code;
|
4741 | _fail && _fail(res);
|
4742 | complete && complete(res);
|
4743 | reject(res);
|
4744 | }
|
4745 | });
|
4746 | });
|
4747 | }
|
4748 |
|
4749 | function showNotification() {
|
4750 | var opts = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
4751 | var contentTitle = opts.contentTitle,
|
4752 | contentText = opts.contentText,
|
4753 | clickAction = opts.clickAction;
|
4754 |
|
4755 | if (clickAction) {
|
4756 | var uri = clickAction.uri;
|
4757 | clickAction.uri = uri.substr(0, url.lastIndexOf('/'));
|
4758 | }
|
4759 |
|
4760 | notification.show({
|
4761 | contentTitle: contentTitle || undefined,
|
4762 | contentText: contentText || undefined,
|
4763 | clickAction: contentText || undefined
|
4764 | });
|
4765 | }
|
4766 |
|
4767 | function getSystemInfo() {
|
4768 | var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
4769 | var _success = options.success,
|
4770 | _fail = options.fail,
|
4771 | _complete = options.complete;
|
4772 | var res = {
|
4773 | errMsg: 'getSystemInfo:ok'
|
4774 | };
|
4775 | return new Promise(function (resolve, reject) {
|
4776 | device.getInfo({
|
4777 | success: function success(data) {
|
4778 | res.result = data;
|
4779 | _success && _success(res);
|
4780 | resolve(res);
|
4781 | },
|
4782 | fail: function fail(data, code) {
|
4783 | res.errMsg = data;
|
4784 | res.code = code;
|
4785 | _fail && _fail(res);
|
4786 | reject(res);
|
4787 | },
|
4788 | complete: function complete() {
|
4789 | _complete && _complete(res);
|
4790 | }
|
4791 | });
|
4792 | });
|
4793 | }
|
4794 | function getSystemId() {
|
4795 | var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
4796 | var _success2 = options.success,
|
4797 | _fail2 = options.fail,
|
4798 | _complete2 = options.complete,
|
4799 | type = options.type;
|
4800 | var res = {
|
4801 | errMsg: 'getSystemId:ok'
|
4802 | };
|
4803 | return new Promise(function (resolve, reject) {
|
4804 | device.getId({
|
4805 | type: type,
|
4806 | success: function success(data) {
|
4807 | res.result = data;
|
4808 | _success2 && _success2(res);
|
4809 | resolve(res);
|
4810 | },
|
4811 | fail: function fail(data, code) {
|
4812 | res.errMsg = data;
|
4813 | res.code = code;
|
4814 | _fail2 && _fail2(res);
|
4815 | reject(res);
|
4816 | },
|
4817 | complete: function complete() {
|
4818 | _complete2 && _complete2(res);
|
4819 | }
|
4820 | });
|
4821 | });
|
4822 | }
|
4823 | function getSystemDeviceId() {
|
4824 | var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
4825 | var _success3 = options.success,
|
4826 | _fail3 = options.fail,
|
4827 | complete = options.complete;
|
4828 | var res = {
|
4829 | errMsg: 'getSystemDeviceId:ok'
|
4830 | };
|
4831 | return new Promise(function (resolve, reject) {
|
4832 | device.getDeviceId({
|
4833 | success: function success(data) {
|
4834 | res.result = data;
|
4835 | _success3 && _success3(res);
|
4836 | resolve(res);
|
4837 | },
|
4838 | fail: function fail(data, code) {
|
4839 | res.errMsg = data;
|
4840 | res.code = code;
|
4841 | _fail3 && _fail3(res);
|
4842 | complete && complete(res);
|
4843 | reject(res);
|
4844 | }
|
4845 | });
|
4846 | });
|
4847 | }
|
4848 | function getSystemUserId() {
|
4849 | var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
4850 | var _success4 = options.success,
|
4851 | _fail4 = options.fail,
|
4852 | complete = options.complete;
|
4853 | var res = {
|
4854 | errMsg: 'getSystemUserId:ok'
|
4855 | };
|
4856 | return new Promise(function (resolve, reject) {
|
4857 | device.getDeviceId({
|
4858 | success: function success(data) {
|
4859 | res.result = data;
|
4860 | _success4 && _success4(res);
|
4861 | resolve(res);
|
4862 | },
|
4863 | fail: function fail(data, code) {
|
4864 | res.errMsg = data;
|
4865 | res.code = code;
|
4866 | _fail4 && _fail4(res);
|
4867 | complete && complete(res);
|
4868 | reject(res);
|
4869 | }
|
4870 | });
|
4871 | });
|
4872 | }
|
4873 | function getSystemAdvertisingId() {
|
4874 | var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
4875 | var _success5 = options.success,
|
4876 | _fail5 = options.fail,
|
4877 | complete = options.complete;
|
4878 | var res = {
|
4879 | errMsg: 'getSystemAdvertisingId:ok'
|
4880 | };
|
4881 | return new Promise(function (resolve, reject) {
|
4882 | device.getAdvertisingId({
|
4883 | success: function success(data) {
|
4884 | res.result = data;
|
4885 | _success5 && _success5(res);
|
4886 | resolve(res);
|
4887 | },
|
4888 | fail: function fail(data, code) {
|
4889 | res.errMsg = data;
|
4890 | res.code = code;
|
4891 | _fail5 && _fail5(res);
|
4892 | complete && complete(res);
|
4893 | reject(res);
|
4894 | }
|
4895 | });
|
4896 | });
|
4897 | }
|
4898 | function getSystemSerial() {
|
4899 | var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
4900 | var _success6 = options.success,
|
4901 | _fail6 = options.fail,
|
4902 | complete = options.complete;
|
4903 | var res = {
|
4904 | errMsg: 'getSystemSerial:ok'
|
4905 | };
|
4906 | return new Promise(function (resolve, reject) {
|
4907 | device.getSerial({
|
4908 | success: function success(data) {
|
4909 | res.result = data;
|
4910 | _success6 && _success6(res);
|
4911 | resolve(res);
|
4912 | },
|
4913 | fail: function fail(data, code) {
|
4914 | res.errMsg = data;
|
4915 | res.code = code;
|
4916 | _fail6 && _fail6(res);
|
4917 | complete && complete(res);
|
4918 | reject(res);
|
4919 | }
|
4920 | });
|
4921 | });
|
4922 | }
|
4923 | function getSystemTotalStorage() {
|
4924 | var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
4925 | var _success7 = options.success,
|
4926 | _fail7 = options.fail,
|
4927 | complete = options.complete;
|
4928 | var res = {
|
4929 | errMsg: 'getSystemTotalStorage:ok'
|
4930 | };
|
4931 | return new Promise(function (resolve, reject) {
|
4932 | device.getTotalStorage({
|
4933 | success: function success(data) {
|
4934 | res.result = data;
|
4935 | _success7 && _success7(res);
|
4936 | resolve(res);
|
4937 | },
|
4938 | fail: function fail(data, code) {
|
4939 | res.errMsg = data;
|
4940 | res.code = code;
|
4941 | _fail7 && _fail7(res);
|
4942 | complete && complete(res);
|
4943 | reject(res);
|
4944 | }
|
4945 | });
|
4946 | });
|
4947 | }
|
4948 | function getSystemAvailableStorage() {
|
4949 | var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
4950 | var _success8 = options.success,
|
4951 | _fail8 = options.fail,
|
4952 | complete = options.complete;
|
4953 | var res = {
|
4954 | errMsg: 'getSystemAvailableStorage:ok'
|
4955 | };
|
4956 | return new Promise(function (resolve, reject) {
|
4957 | device.getAvailableStorage({
|
4958 | success: function success(data) {
|
4959 | res.result = data;
|
4960 | _success8 && _success8(res);
|
4961 | resolve(res);
|
4962 | },
|
4963 | fail: function fail(data, code) {
|
4964 | res.errMsg = data;
|
4965 | res.code = code;
|
4966 | _fail8 && _fail8(res);
|
4967 | complete && complete(res);
|
4968 | reject(res);
|
4969 | }
|
4970 | });
|
4971 | });
|
4972 | }
|
4973 | function getSystemCpuInfo() {
|
4974 | var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
4975 | var _success9 = options.success,
|
4976 | _fail9 = options.fail,
|
4977 | complete = options.complete;
|
4978 | var res = {
|
4979 | errMsg: 'getSystemCpuInfo:ok'
|
4980 | };
|
4981 | return new Promise(function (resolve, reject) {
|
4982 | device.getCpuInfo({
|
4983 | success: function success(data) {
|
4984 | res.result = data;
|
4985 | _success9 && _success9(res);
|
4986 | resolve(res);
|
4987 | },
|
4988 | fail: function fail(data, code) {
|
4989 | res.errMsg = data;
|
4990 | res.code = code;
|
4991 | _fail9 && _fail9(res);
|
4992 | complete && complete(res);
|
4993 | reject(res);
|
4994 | }
|
4995 | });
|
4996 | });
|
4997 | }
|
4998 | function getSystemPlatform() {
|
4999 | return device.platform;
|
5000 | }
|
5001 | var unSupportApis$1 = ['getSystemInfoSync'];
|
5002 | unSupportApis$1 = generateUnSupportApi('快应用暂不支持SystemInfo的同步接口', unSupportApis$1);
|
5003 | var qSystem = {
|
5004 | getSystemInfo: getSystemInfo,
|
5005 | getSystemId: getSystemId,
|
5006 | getSystemDeviceId: getSystemDeviceId,
|
5007 | getSystemUserId: getSystemUserId,
|
5008 | getSystemAdvertisingId: getSystemAdvertisingId,
|
5009 | getSystemSerial: getSystemSerial,
|
5010 | getSystemTotalStorage: getSystemTotalStorage,
|
5011 | getSystemAvailableStorage: getSystemAvailableStorage,
|
5012 | getSystemCpuInfo: getSystemCpuInfo,
|
5013 | getSystemPlatform: getSystemPlatform
|
5014 | };
|
5015 | Object.assign(qSystem, unSupportApis$1);
|
5016 |
|
5017 | function webviewLoadUrl() {
|
5018 | var opts = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
5019 | return webview.loadUrl(opts);
|
5020 | }
|
5021 |
|
5022 | function createInnerAudioContext() {
|
5023 | return audio;
|
5024 | }
|
5025 | function getPlayState() {
|
5026 | var opts = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
5027 | var _success = opts.success,
|
5028 | _fail = opts.fail,
|
5029 | complete = opts.complete;
|
5030 | var res = {
|
5031 | errMsg: 'getPlayState:ok'
|
5032 | };
|
5033 | return new Promise(function (resolve, reject) {
|
5034 | device.getCpuInfo({
|
5035 | success: function success(data) {
|
5036 | res.result = data;
|
5037 | _success && _success(data);
|
5038 | resolve(res);
|
5039 | },
|
5040 | fail: function fail(data, code) {
|
5041 | res.errMsg = data;
|
5042 | res.code = code;
|
5043 | _fail && _fail(res);
|
5044 | complete && complete(res);
|
5045 | reject(res);
|
5046 | }
|
5047 | });
|
5048 | });
|
5049 | }
|
5050 | function startRecord() {
|
5051 | var opts = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
5052 | var duration = opts.duration,
|
5053 | sampleRate = opts.sampleRate,
|
5054 | numberOfChannels = opts.numberOfChannels,
|
5055 | encodeBitRate = opts.encodeBitRate,
|
5056 | format = opts.format,
|
5057 | _success2 = opts.success,
|
5058 | _fail2 = opts.fail,
|
5059 | complete = opts.complete;
|
5060 | var res = {
|
5061 | errMsg: 'startRecord:ok'
|
5062 | };
|
5063 | return new Promise(function (resolve, reject) {
|
5064 | record.start({
|
5065 | duration: duration,
|
5066 | sampleRate: sampleRate,
|
5067 | numberOfChannels: numberOfChannels,
|
5068 | encodeBitRate: encodeBitRate,
|
5069 | format: format,
|
5070 | success: function success(data) {
|
5071 | res.result = data;
|
5072 | _success2 && _success2(data);
|
5073 | resolve(res);
|
5074 | },
|
5075 | fail: function fail(data, code) {
|
5076 | res.errMsg = data;
|
5077 | res.code = code;
|
5078 | _fail2 && _fail2(res);
|
5079 | complete && complete(res);
|
5080 | reject(res);
|
5081 | }
|
5082 | });
|
5083 | });
|
5084 | }
|
5085 | function stopRecord() {
|
5086 | return record.stop();
|
5087 | }
|
5088 |
|
5089 | function getContactPick() {
|
5090 | var opts = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
5091 | var _success = opts.success,
|
5092 | _fail = opts.fail,
|
5093 | complete = opts.complete;
|
5094 | var res = {
|
5095 | errMsg: 'getContactPick:ok'
|
5096 | };
|
5097 | return new Promise(function (resolve, reject) {
|
5098 | contact.pick({
|
5099 | success: function success(data) {
|
5100 | res.result = data;
|
5101 | _success && _success(data);
|
5102 | resolve(res);
|
5103 | },
|
5104 | fail: function fail(data, code) {
|
5105 | res.errMsg = data;
|
5106 | res.code = code;
|
5107 | _fail && _fail(res);
|
5108 | complete && complete(res);
|
5109 | reject(res);
|
5110 | }
|
5111 | });
|
5112 | });
|
5113 | }
|
5114 | function getContactList() {
|
5115 | var opts = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
5116 | var _success2 = opts.success,
|
5117 | _fail2 = opts.fail,
|
5118 | complete = opts.complete;
|
5119 | var res = {
|
5120 | errMsg: 'getContactList:ok'
|
5121 | };
|
5122 | return new Promise(function (resolve, reject) {
|
5123 | contact.list({
|
5124 | success: function success(data) {
|
5125 | res.result = data;
|
5126 | _success2 && _success2(data);
|
5127 | resolve(res);
|
5128 | },
|
5129 | fail: function fail(data, code) {
|
5130 | res.errMsg = data;
|
5131 | res.code = code;
|
5132 | _fail2 && _fail2(res);
|
5133 | complete && complete(res);
|
5134 | reject(res);
|
5135 | }
|
5136 | });
|
5137 | });
|
5138 | }
|
5139 | function sendSms() {
|
5140 | var opts = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
5141 | var address = opts.address,
|
5142 | content = opts.content,
|
5143 | _success3 = opts.success,
|
5144 | _fail3 = opts.fail,
|
5145 | complete = opts.complete;
|
5146 | var res = {
|
5147 | errMsg: 'sendSms:ok'
|
5148 | };
|
5149 | return new Promise(function (resolve, reject) {
|
5150 | sms.send({
|
5151 | address: address,
|
5152 | content: content,
|
5153 | success: function success(data) {
|
5154 | res.result = data;
|
5155 | _success3 && _success3(data);
|
5156 | resolve(res);
|
5157 | },
|
5158 | fail: function fail(data, code) {
|
5159 | res.errMsg = data;
|
5160 | res.code = code;
|
5161 | _fail3 && _fail3(res);
|
5162 | complete && complete(res);
|
5163 | reject(res);
|
5164 | }
|
5165 | });
|
5166 | });
|
5167 | }
|
5168 | function readSmsSafely() {
|
5169 | var opts = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
5170 | var timeout = opts.timeout,
|
5171 | _success4 = opts.success,
|
5172 | _fail4 = opts.fail,
|
5173 | complete = opts.complete;
|
5174 | var res = {
|
5175 | errMsg: 'sendSms:ok'
|
5176 | };
|
5177 | return new Promise(function (resolve, reject) {
|
5178 | sms.readSafely({
|
5179 | timeout: timeout,
|
5180 | success: function success(data) {
|
5181 | res.result = data;
|
5182 | _success4 && _success4(data);
|
5183 | resolve(res);
|
5184 | },
|
5185 | fail: function fail(data, code) {
|
5186 | res.errMsg = data;
|
5187 | res.code = code;
|
5188 | _fail4 && _fail4(res);
|
5189 | complete && complete(res);
|
5190 | reject(res);
|
5191 | }
|
5192 | });
|
5193 | });
|
5194 | }
|
5195 |
|
5196 | var onSocketOpen = temporarilyNotSupport('onSocketOpen');
|
5197 | var onSocketError = temporarilyNotSupport('onSocketError');
|
5198 | var onSocketMessage = temporarilyNotSupport('onSocketMessage');
|
5199 | var onSocketClose = temporarilyNotSupport('onSocketClose');
|
5200 | var onBackgroundAudioPlay = temporarilyNotSupport('onBackgroundAudioPlay');
|
5201 | var onBackgroundAudioPause = temporarilyNotSupport('onBackgroundAudioPause');
|
5202 | var onBackgroundAudioStop = temporarilyNotSupport('onBackgroundAudioStop');
|
5203 | var onNetworkStatusChange = temporarilyNotSupport('onNetworkStatusChange');
|
5204 |
|
5205 |
|
5206 | var onDeviceMotionChange = temporarilyNotSupport('onDeviceMotionChange');
|
5207 | var onBluetoothAdapterStateChange = temporarilyNotSupport('onBluetoothAdapterStateChange');
|
5208 | var onBluetoothDeviceFound = temporarilyNotSupport('onBluetoothDeviceFound');
|
5209 | var onBLEConnectionStateChange = temporarilyNotSupport('onBLEConnectionStateChange');
|
5210 | var onBLECharacteristicValueChange = temporarilyNotSupport('onBLECharacteristicValueChange');
|
5211 | var onBeaconUpdate = temporarilyNotSupport('onBeaconUpdate');
|
5212 | var onBeaconServiceChange = temporarilyNotSupport('onBeaconServiceChange');
|
5213 | var onUserCaptureScreen = temporarilyNotSupport('onUserCaptureScreen');
|
5214 | var onHCEMessage = temporarilyNotSupport('onHCEMessage');
|
5215 | var onGetWifiList = temporarilyNotSupport('onGetWifiList');
|
5216 | var onWifiConnected = temporarilyNotSupport('onWifiConnected');
|
5217 | var setStorageSync = temporarilyNotSupport('setStorageSync');
|
5218 | var getStorageSync = temporarilyNotSupport('getStorageSync');
|
5219 | var getStorageInfoSync = temporarilyNotSupport('getStorageInfoSync');
|
5220 | var removeStorageSync = temporarilyNotSupport('removeStorageSync');
|
5221 | var clearStorageSync = temporarilyNotSupport('clearStorageSync');
|
5222 | var getSystemInfoSync = temporarilyNotSupport('getSystemInfoSync');
|
5223 | var getExtConfigSync = temporarilyNotSupport('getExtConfigSync');
|
5224 | var getLogManager = temporarilyNotSupport('getLogManager');
|
5225 | var onMemoryWarning = temporarilyNotSupport('onMemoryWarning');
|
5226 | var reportAnalytics = temporarilyNotSupport('reportAnalytics');
|
5227 | var navigateToSmartGameProgram = temporarilyNotSupport('navigateToSmartGameProgram');
|
5228 |
|
5229 | var getFileSystemManager = temporarilyNotSupport('getFileSystemManager');
|
5230 |
|
5231 |
|
5232 |
|
5233 | var getRecorderManager = temporarilyNotSupport('getRecorderManager');
|
5234 | var pauseVoice = temporarilyNotSupport('pauseVoice');
|
5235 | var stopVoice = temporarilyNotSupport('stopVoice');
|
5236 | var pauseBackgroundAudio = temporarilyNotSupport('pauseBackgroundAudio');
|
5237 | var stopBackgroundAudio = temporarilyNotSupport('stopBackgroundAudio');
|
5238 | var getBackgroundAudioManager = temporarilyNotSupport('getBackgroundAudioManager');
|
5239 | var createAudioContext = temporarilyNotSupport('createAudioContext');
|
5240 |
|
5241 | var createVideoContext = temporarilyNotSupport('createVideoContext');
|
5242 | var createCameraContext = temporarilyNotSupport('createCameraContext');
|
5243 | var createLivePlayerContext = temporarilyNotSupport('createLivePlayerContext');
|
5244 | var createLivePusherContext = temporarilyNotSupport('createLivePusherContext');
|
5245 |
|
5246 | var createMapContext = temporarilyNotSupport('createMapContext');
|
5247 |
|
5248 | var canIUse = temporarilyNotSupport('canIUse');
|
5249 |
|
5250 |
|
5251 |
|
5252 |
|
5253 | var startDeviceMotionListening = temporarilyNotSupport('startDeviceMotionListening');
|
5254 | var stopDeviceMotionListening = temporarilyNotSupport('stopDeviceMotionListening');
|
5255 |
|
5256 | var hideToast = temporarilyNotSupport('hideToast');
|
5257 | var hideLoading = temporarilyNotSupport('hideLoading');
|
5258 | var showNavigationBarLoading = temporarilyNotSupport('showNavigationBarLoading');
|
5259 | var hideNavigationBarLoading = temporarilyNotSupport('hideNavigationBarLoading');
|
5260 | var createAnimation = temporarilyNotSupport('createAnimation');
|
5261 | var pageScrollTo = temporarilyNotSupport('pageScrollTo');
|
5262 | var createSelectorQuery = temporarilyNotSupport('createSelectorQuery');
|
5263 | var createCanvasContext = temporarilyNotSupport('createCanvasContext');
|
5264 | var createContext = temporarilyNotSupport('createContext');
|
5265 | var drawCanvas = temporarilyNotSupport('drawCanvas');
|
5266 | var hideKeyboard = temporarilyNotSupport('hideKeyboard');
|
5267 |
|
5268 | var createIntersectionObserver = temporarilyNotSupport('createIntersectionObserver');
|
5269 |
|
5270 | var nextTick$1 = temporarilyNotSupport('nextTick');
|
5271 |
|
5272 | var getMenuButtonBoundingClientRect = temporarilyNotSupport('getMenuButtonBoundingClientRect');
|
5273 |
|
5274 | var onWindowResize = temporarilyNotSupport('onWindowResize');
|
5275 | var offWindowResize = temporarilyNotSupport('offWindowResize');
|
5276 |
|
5277 | var arrayBufferToBase64 = temporarilyNotSupport('arrayBufferToBase64');
|
5278 | var base64ToArrayBuffer = temporarilyNotSupport('base64ToArrayBuffer');
|
5279 | var getAccountInfoSync = temporarilyNotSupport('getAccountInfoSync');
|
5280 | var getUpdateManager = temporarilyNotSupport('getUpdateManager');
|
5281 | var createWorker = temporarilyNotSupport('createWorker');
|
5282 |
|
5283 |
|
5284 |
|
5285 |
|
5286 | var connectSocket = temporarilyNotSupport('connectSocket');
|
5287 | var sendSocketMessage = temporarilyNotSupport('sendSocketMessage');
|
5288 | var closeSocket = temporarilyNotSupport('closeSocket');
|
5289 |
|
5290 | var chooseImage = temporarilyNotSupport('chooseImage');
|
5291 | var previewImage = temporarilyNotSupport('previewImage');
|
5292 | var getImageInfo = temporarilyNotSupport('getImageInfo');
|
5293 | var saveImageToPhotosAlbum = temporarilyNotSupport('saveImageToPhotosAlbum');
|
5294 |
|
5295 | var playVoice = temporarilyNotSupport('playVoice');
|
5296 | var setInnerAudioOption = temporarilyNotSupport('setInnerAudioOption');
|
5297 | var getAvailableAudioSources = temporarilyNotSupport('getAvailableAudioSources');
|
5298 | var getBackgroundAudioPlayerState = temporarilyNotSupport('getBackgroundAudioPlayerState');
|
5299 | var playBackgroundAudio = temporarilyNotSupport('playBackgroundAudio');
|
5300 | var seekBackgroundAudio = temporarilyNotSupport('seekBackgroundAudio');
|
5301 | var chooseVideo = temporarilyNotSupport('chooseVideo');
|
5302 | var saveVideoToPhotosAlbum = temporarilyNotSupport('saveVideoToPhotosAlbum');
|
5303 | var loadFontFace = temporarilyNotSupport('loadFontFace');
|
5304 |
|
5305 | var saveFile = temporarilyNotSupport('saveFile');
|
5306 | var getFileInfo = temporarilyNotSupport('getFileInfo');
|
5307 | var getSavedFileList = temporarilyNotSupport('getSavedFileList');
|
5308 | var getSavedFileInfo = temporarilyNotSupport('getSavedFileInfo');
|
5309 | var removeSavedFile = temporarilyNotSupport('removeSavedFile');
|
5310 | var openDocument = temporarilyNotSupport('openDocument');
|
5311 |
|
5312 |
|
5313 |
|
5314 |
|
5315 |
|
5316 |
|
5317 |
|
5318 |
|
5319 |
|
5320 |
|
5321 |
|
5322 |
|
5323 |
|
5324 |
|
5325 | var chooseLocation = temporarilyNotSupport('chooseLocation');
|
5326 | var openLocation = temporarilyNotSupport('openLocation');
|
5327 |
|
5328 |
|
5329 | var getNetworkType = temporarilyNotSupport('getNetworkType');
|
5330 | var makePhoneCall = temporarilyNotSupport('makePhoneCall');
|
5331 |
|
5332 |
|
5333 |
|
5334 | var openBluetoothAdapter = temporarilyNotSupport('openBluetoothAdapter');
|
5335 | var closeBluetoothAdapter = temporarilyNotSupport('closeBluetoothAdapter');
|
5336 | var getBluetoothAdapterState = temporarilyNotSupport('getBluetoothAdapterState');
|
5337 | var startBluetoothDevicesDiscovery = temporarilyNotSupport('startBluetoothDevicesDiscovery');
|
5338 | var stopBluetoothDevicesDiscovery = temporarilyNotSupport('stopBluetoothDevicesDiscovery');
|
5339 | var getBluetoothDevices = temporarilyNotSupport('getBluetoothDevices');
|
5340 | var getConnectedBluetoothDevices = temporarilyNotSupport('getConnectedBluetoothDevices');
|
5341 | var createBLEConnection = temporarilyNotSupport('createBLEConnection');
|
5342 | var closeBLEConnection = temporarilyNotSupport('closeBLEConnection');
|
5343 | var getBLEDeviceServices = temporarilyNotSupport('getBLEDeviceServices');
|
5344 | var getBLEDeviceCharacteristics = temporarilyNotSupport('getBLEDeviceCharacteristics');
|
5345 | var readBLECharacteristicValue = temporarilyNotSupport('readBLECharacteristicValue');
|
5346 | var writeBLECharacteristicValue = temporarilyNotSupport('writeBLECharacteristicValue');
|
5347 | var notifyBLECharacteristicValueChange = temporarilyNotSupport('notifyBLECharacteristicValueChange');
|
5348 | var startBeaconDiscovery = temporarilyNotSupport('startBeaconDiscovery');
|
5349 | var stopBeaconDiscovery = temporarilyNotSupport('stopBeaconDiscovery');
|
5350 | var getBeacons = temporarilyNotSupport('getBeacons');
|
5351 | var setScreenBrightness = temporarilyNotSupport('setScreenBrightness');
|
5352 | var getScreenBrightness = temporarilyNotSupport('getScreenBrightness');
|
5353 | var setKeepScreenOn = temporarilyNotSupport('setKeepScreenOn');
|
5354 |
|
5355 |
|
5356 | var addPhoneContact = temporarilyNotSupport('addPhoneContact');
|
5357 | var getHCEState = temporarilyNotSupport('getHCEState');
|
5358 | var startHCE = temporarilyNotSupport('startHCE');
|
5359 | var stopHCE = temporarilyNotSupport('stopHCE');
|
5360 | var sendHCEMessage = temporarilyNotSupport('sendHCEMessage');
|
5361 | var startWifi = temporarilyNotSupport('startWifi');
|
5362 | var stopWifi = temporarilyNotSupport('stopWifi');
|
5363 | var connectWifi = temporarilyNotSupport('connectWifi');
|
5364 | var getWifiList = temporarilyNotSupport('getWifiList');
|
5365 | var setWifiList = temporarilyNotSupport('setWifiList');
|
5366 | var getConnectedWifi = temporarilyNotSupport('getConnectedWifi');
|
5367 |
|
5368 |
|
5369 | var showLoading = temporarilyNotSupport('showLoading');
|
5370 |
|
5371 |
|
5372 |
|
5373 |
|
5374 | var setTabBarBadge = temporarilyNotSupport('setTabBarBadge');
|
5375 | var removeTabBarBadge = temporarilyNotSupport('removeTabBarBadge');
|
5376 | var showTabBarRedDot = temporarilyNotSupport('showTabBarRedDot');
|
5377 | var hideTabBarRedDot = temporarilyNotSupport('hideTabBarRedDot');
|
5378 | var setTabBarStyle = temporarilyNotSupport('setTabBarStyle');
|
5379 | var setTabBarItem = temporarilyNotSupport('setTabBarItem');
|
5380 | var showTabBar = temporarilyNotSupport('showTabBar');
|
5381 | var hideTabBar = temporarilyNotSupport('hideTabBar');
|
5382 | var setTopBarText = temporarilyNotSupport('setTopBarText');
|
5383 |
|
5384 | var canvasToTempFilePath = temporarilyNotSupport('canvasToTempFilePath');
|
5385 | var canvasGetImageData = temporarilyNotSupport('canvasGetImageData');
|
5386 | var canvasPutImageData = temporarilyNotSupport('canvasPutImageData');
|
5387 | var setBackgroundColor = temporarilyNotSupport('setBackgroundColor');
|
5388 | var setBackgroundTextStyle = temporarilyNotSupport('setBackgroundTextStyle');
|
5389 |
|
5390 | var getExtConfig = temporarilyNotSupport('getExtConfig');
|
5391 |
|
5392 | var login = temporarilyNotSupport('login');
|
5393 | var checkSession = temporarilyNotSupport('checkSession');
|
5394 | var authorize = temporarilyNotSupport('authorize');
|
5395 | var getUserInfo = temporarilyNotSupport('getUserInfo');
|
5396 | var checkIsSupportFacialRecognition = temporarilyNotSupport('checkIsSupportFacialRecognition');
|
5397 | var startFacialRecognitionVerify = temporarilyNotSupport('startFacialRecognitionVerify');
|
5398 | var startFacialRecognitionVerifyAndUploadVideo = temporarilyNotSupport('startFacialRecognitionVerifyAndUploadVideo');
|
5399 | var faceVerifyForPay = temporarilyNotSupport('faceVerifyForPay');
|
5400 | var requestPayment = temporarilyNotSupport('requestPayment');
|
5401 |
|
5402 | var hideShareMenu = temporarilyNotSupport('hideShareMenu');
|
5403 | var updateShareMenu = temporarilyNotSupport('updateShareMenu');
|
5404 | var getShareInfo = temporarilyNotSupport('getShareInfo');
|
5405 | var chooseAddress = temporarilyNotSupport('chooseAddress');
|
5406 | var addCard = temporarilyNotSupport('addCard');
|
5407 | var openCard = temporarilyNotSupport('openCard');
|
5408 | var openSetting = temporarilyNotSupport('openSetting');
|
5409 | var getSetting = temporarilyNotSupport('getSetting');
|
5410 | var getWeRunData = temporarilyNotSupport('getWeRunData');
|
5411 | var navigateToMiniProgram = temporarilyNotSupport('navigateToMiniProgram');
|
5412 | var navigateBackMiniProgram = temporarilyNotSupport('navigateBackMiniProgram');
|
5413 | var chooseInvoice = temporarilyNotSupport('chooseInvoice');
|
5414 | var chooseInvoiceTitle = temporarilyNotSupport('chooseInvoiceTitle');
|
5415 | var checkIsSupportSoterAuthentication = temporarilyNotSupport('checkIsSupportSoterAuthentication');
|
5416 | var startSoterAuthentication = temporarilyNotSupport('startSoterAuthentication');
|
5417 | var checkIsSoterEnrolledInDevice = temporarilyNotSupport('checkIsSoterEnrolledInDevice');
|
5418 | var setEnableDebug = temporarilyNotSupport('setEnableDebug');
|
5419 |
|
5420 |
|
5421 | var ocrIdCard = temporarilyNotSupport('ocrIdCard');
|
5422 | var ocrBankCard = temporarilyNotSupport('ocrBankCard');
|
5423 | var ocrDrivingLicense = temporarilyNotSupport('ocrDrivingLicense');
|
5424 | var ocrVehicleLicense = temporarilyNotSupport('ocrVehicleLicense');
|
5425 | var textReview = temporarilyNotSupport('textReview');
|
5426 | var textToAudio = temporarilyNotSupport('textToAudio');
|
5427 | var imageAudit = temporarilyNotSupport('imageAudit');
|
5428 | var advancedGeneralIdentify = temporarilyNotSupport('advancedGeneralIdentify');
|
5429 | var objectDetectIdentify = temporarilyNotSupport('objectDetectIdentify');
|
5430 | var carClassify = temporarilyNotSupport('carClassify');
|
5431 | var dishClassify = temporarilyNotSupport('dishClassify');
|
5432 | var logoClassify = temporarilyNotSupport('logoClassify');
|
5433 | var animalClassify = temporarilyNotSupport('animalClassify');
|
5434 | var plantClassify = temporarilyNotSupport('plantClassify');
|
5435 |
|
5436 | var getSwanId = temporarilyNotSupport('getSwanId');
|
5437 |
|
5438 | var requestPolymerPayment = temporarilyNotSupport('requestPolymerPayment');
|
5439 |
|
5440 | var navigateToSmartProgram = temporarilyNotSupport('navigateToSmartProgram');
|
5441 | var navigateBackSmartProgram = temporarilyNotSupport('navigateBackSmartProgram');
|
5442 | var preloadSubPackage = temporarilyNotSupport('preloadSubPackage');
|
5443 |
|
5444 |
|
5445 |
|
5446 | var supportApi = Object.freeze({
|
5447 | request: request,
|
5448 | uploadFile: uploadFile,
|
5449 | downloadFile: downloadFile,
|
5450 | setStorage: setStorage,
|
5451 | getStorage: getStorage,
|
5452 | getStorageInfo: getStorageInfo,
|
5453 | removeStorage: removeStorage,
|
5454 | clearStorage: clearStorage,
|
5455 | navigateTo: navigateTo,
|
5456 | redirectTo: redirectTo,
|
5457 | navigateBack: navigateBack,
|
5458 | switchTab: switchTab,
|
5459 | getCurrentPages: getCurrentPages$1,
|
5460 | reLaunch: reLaunch,
|
5461 | showToast: showToast,
|
5462 | showModal: showModal,
|
5463 | showActionSheet: showActionSheet,
|
5464 | setNavigationBarTitle: setNavigationBarTitle,
|
5465 | setNavigationBarColor: setNavigationBarColor,
|
5466 | startPullDownRefresh: startPullDownRefresh,
|
5467 | stopPullDownRefresh: stopPullDownRefresh,
|
5468 | scanCode: scanCode,
|
5469 | vibrateShort: vibrateShort,
|
5470 | vibrateLong: vibrateLong,
|
5471 | setClipboardData: setClipboardData,
|
5472 | getClipboardData: getClipboardData,
|
5473 | startAccelerometer: startAccelerometer,
|
5474 | stopAccelerometer: stopAccelerometer,
|
5475 | onAccelerometerChange: onAccelerometerChange,
|
5476 | startCompass: startCompass,
|
5477 | stopCompass: stopCompass,
|
5478 | onCompassChange: onCompassChange,
|
5479 | getLocation: getLocation,
|
5480 | showShareMenu: showShareMenu,
|
5481 | showNotification: showNotification,
|
5482 | getSystemInfo: getSystemInfo,
|
5483 | getSystemId: getSystemId,
|
5484 | getSystemDeviceId: getSystemDeviceId,
|
5485 | getSystemUserId: getSystemUserId,
|
5486 | getSystemAdvertisingId: getSystemAdvertisingId,
|
5487 | getSystemSerial: getSystemSerial,
|
5488 | getSystemTotalStorage: getSystemTotalStorage,
|
5489 | getSystemAvailableStorage: getSystemAvailableStorage,
|
5490 | getSystemCpuInfo: getSystemCpuInfo,
|
5491 | getSystemPlatform: getSystemPlatform,
|
5492 | webviewLoadUrl: webviewLoadUrl,
|
5493 | createInnerAudioContext: createInnerAudioContext,
|
5494 | getPlayState: getPlayState,
|
5495 | startRecord: startRecord,
|
5496 | stopRecord: stopRecord,
|
5497 | getContactPick: getContactPick,
|
5498 | getContactList: getContactList,
|
5499 | sendSms: sendSms,
|
5500 | readSmsSafely: readSmsSafely,
|
5501 | onSocketOpen: onSocketOpen,
|
5502 | onSocketError: onSocketError,
|
5503 | onSocketMessage: onSocketMessage,
|
5504 | onSocketClose: onSocketClose,
|
5505 | onBackgroundAudioPlay: onBackgroundAudioPlay,
|
5506 | onBackgroundAudioPause: onBackgroundAudioPause,
|
5507 | onBackgroundAudioStop: onBackgroundAudioStop,
|
5508 | onNetworkStatusChange: onNetworkStatusChange,
|
5509 | onDeviceMotionChange: onDeviceMotionChange,
|
5510 | onBluetoothAdapterStateChange: onBluetoothAdapterStateChange,
|
5511 | onBluetoothDeviceFound: onBluetoothDeviceFound,
|
5512 | onBLEConnectionStateChange: onBLEConnectionStateChange,
|
5513 | onBLECharacteristicValueChange: onBLECharacteristicValueChange,
|
5514 | onBeaconUpdate: onBeaconUpdate,
|
5515 | onBeaconServiceChange: onBeaconServiceChange,
|
5516 | onUserCaptureScreen: onUserCaptureScreen,
|
5517 | onHCEMessage: onHCEMessage,
|
5518 | onGetWifiList: onGetWifiList,
|
5519 | onWifiConnected: onWifiConnected,
|
5520 | setStorageSync: setStorageSync,
|
5521 | getStorageSync: getStorageSync,
|
5522 | getStorageInfoSync: getStorageInfoSync,
|
5523 | removeStorageSync: removeStorageSync,
|
5524 | clearStorageSync: clearStorageSync,
|
5525 | getSystemInfoSync: getSystemInfoSync,
|
5526 | getExtConfigSync: getExtConfigSync,
|
5527 | getLogManager: getLogManager,
|
5528 | onMemoryWarning: onMemoryWarning,
|
5529 | reportAnalytics: reportAnalytics,
|
5530 | navigateToSmartGameProgram: navigateToSmartGameProgram,
|
5531 | getFileSystemManager: getFileSystemManager,
|
5532 | getRecorderManager: getRecorderManager,
|
5533 | pauseVoice: pauseVoice,
|
5534 | stopVoice: stopVoice,
|
5535 | pauseBackgroundAudio: pauseBackgroundAudio,
|
5536 | stopBackgroundAudio: stopBackgroundAudio,
|
5537 | getBackgroundAudioManager: getBackgroundAudioManager,
|
5538 | createAudioContext: createAudioContext,
|
5539 | createVideoContext: createVideoContext,
|
5540 | createCameraContext: createCameraContext,
|
5541 | createLivePlayerContext: createLivePlayerContext,
|
5542 | createLivePusherContext: createLivePusherContext,
|
5543 | createMapContext: createMapContext,
|
5544 | canIUse: canIUse,
|
5545 | startDeviceMotionListening: startDeviceMotionListening,
|
5546 | stopDeviceMotionListening: stopDeviceMotionListening,
|
5547 | hideToast: hideToast,
|
5548 | hideLoading: hideLoading,
|
5549 | showNavigationBarLoading: showNavigationBarLoading,
|
5550 | hideNavigationBarLoading: hideNavigationBarLoading,
|
5551 | createAnimation: createAnimation,
|
5552 | pageScrollTo: pageScrollTo,
|
5553 | createSelectorQuery: createSelectorQuery,
|
5554 | createCanvasContext: createCanvasContext,
|
5555 | createContext: createContext,
|
5556 | drawCanvas: drawCanvas,
|
5557 | hideKeyboard: hideKeyboard,
|
5558 | createIntersectionObserver: createIntersectionObserver,
|
5559 | nextTick: nextTick$1,
|
5560 | getMenuButtonBoundingClientRect: getMenuButtonBoundingClientRect,
|
5561 | onWindowResize: onWindowResize,
|
5562 | offWindowResize: offWindowResize,
|
5563 | arrayBufferToBase64: arrayBufferToBase64,
|
5564 | base64ToArrayBuffer: base64ToArrayBuffer,
|
5565 | getAccountInfoSync: getAccountInfoSync,
|
5566 | getUpdateManager: getUpdateManager,
|
5567 | createWorker: createWorker,
|
5568 | connectSocket: connectSocket,
|
5569 | sendSocketMessage: sendSocketMessage,
|
5570 | closeSocket: closeSocket,
|
5571 | chooseImage: chooseImage,
|
5572 | previewImage: previewImage,
|
5573 | getImageInfo: getImageInfo,
|
5574 | saveImageToPhotosAlbum: saveImageToPhotosAlbum,
|
5575 | playVoice: playVoice,
|
5576 | setInnerAudioOption: setInnerAudioOption,
|
5577 | getAvailableAudioSources: getAvailableAudioSources,
|
5578 | getBackgroundAudioPlayerState: getBackgroundAudioPlayerState,
|
5579 | playBackgroundAudio: playBackgroundAudio,
|
5580 | seekBackgroundAudio: seekBackgroundAudio,
|
5581 | chooseVideo: chooseVideo,
|
5582 | saveVideoToPhotosAlbum: saveVideoToPhotosAlbum,
|
5583 | loadFontFace: loadFontFace,
|
5584 | saveFile: saveFile,
|
5585 | getFileInfo: getFileInfo,
|
5586 | getSavedFileList: getSavedFileList,
|
5587 | getSavedFileInfo: getSavedFileInfo,
|
5588 | removeSavedFile: removeSavedFile,
|
5589 | openDocument: openDocument,
|
5590 | chooseLocation: chooseLocation,
|
5591 | openLocation: openLocation,
|
5592 | getNetworkType: getNetworkType,
|
5593 | makePhoneCall: makePhoneCall,
|
5594 | openBluetoothAdapter: openBluetoothAdapter,
|
5595 | closeBluetoothAdapter: closeBluetoothAdapter,
|
5596 | getBluetoothAdapterState: getBluetoothAdapterState,
|
5597 | startBluetoothDevicesDiscovery: startBluetoothDevicesDiscovery,
|
5598 | stopBluetoothDevicesDiscovery: stopBluetoothDevicesDiscovery,
|
5599 | getBluetoothDevices: getBluetoothDevices,
|
5600 | getConnectedBluetoothDevices: getConnectedBluetoothDevices,
|
5601 | createBLEConnection: createBLEConnection,
|
5602 | closeBLEConnection: closeBLEConnection,
|
5603 | getBLEDeviceServices: getBLEDeviceServices,
|
5604 | getBLEDeviceCharacteristics: getBLEDeviceCharacteristics,
|
5605 | readBLECharacteristicValue: readBLECharacteristicValue,
|
5606 | writeBLECharacteristicValue: writeBLECharacteristicValue,
|
5607 | notifyBLECharacteristicValueChange: notifyBLECharacteristicValueChange,
|
5608 | startBeaconDiscovery: startBeaconDiscovery,
|
5609 | stopBeaconDiscovery: stopBeaconDiscovery,
|
5610 | getBeacons: getBeacons,
|
5611 | setScreenBrightness: setScreenBrightness,
|
5612 | getScreenBrightness: getScreenBrightness,
|
5613 | setKeepScreenOn: setKeepScreenOn,
|
5614 | addPhoneContact: addPhoneContact,
|
5615 | getHCEState: getHCEState,
|
5616 | startHCE: startHCE,
|
5617 | stopHCE: stopHCE,
|
5618 | sendHCEMessage: sendHCEMessage,
|
5619 | startWifi: startWifi,
|
5620 | stopWifi: stopWifi,
|
5621 | connectWifi: connectWifi,
|
5622 | getWifiList: getWifiList,
|
5623 | setWifiList: setWifiList,
|
5624 | getConnectedWifi: getConnectedWifi,
|
5625 | showLoading: showLoading,
|
5626 | setTabBarBadge: setTabBarBadge,
|
5627 | removeTabBarBadge: removeTabBarBadge,
|
5628 | showTabBarRedDot: showTabBarRedDot,
|
5629 | hideTabBarRedDot: hideTabBarRedDot,
|
5630 | setTabBarStyle: setTabBarStyle,
|
5631 | setTabBarItem: setTabBarItem,
|
5632 | showTabBar: showTabBar,
|
5633 | hideTabBar: hideTabBar,
|
5634 | setTopBarText: setTopBarText,
|
5635 | canvasToTempFilePath: canvasToTempFilePath,
|
5636 | canvasGetImageData: canvasGetImageData,
|
5637 | canvasPutImageData: canvasPutImageData,
|
5638 | setBackgroundColor: setBackgroundColor,
|
5639 | setBackgroundTextStyle: setBackgroundTextStyle,
|
5640 | getExtConfig: getExtConfig,
|
5641 | login: login,
|
5642 | checkSession: checkSession,
|
5643 | authorize: authorize,
|
5644 | getUserInfo: getUserInfo,
|
5645 | checkIsSupportFacialRecognition: checkIsSupportFacialRecognition,
|
5646 | startFacialRecognitionVerify: startFacialRecognitionVerify,
|
5647 | startFacialRecognitionVerifyAndUploadVideo: startFacialRecognitionVerifyAndUploadVideo,
|
5648 | faceVerifyForPay: faceVerifyForPay,
|
5649 | requestPayment: requestPayment,
|
5650 | hideShareMenu: hideShareMenu,
|
5651 | updateShareMenu: updateShareMenu,
|
5652 | getShareInfo: getShareInfo,
|
5653 | chooseAddress: chooseAddress,
|
5654 | addCard: addCard,
|
5655 | openCard: openCard,
|
5656 | openSetting: openSetting,
|
5657 | getSetting: getSetting,
|
5658 | getWeRunData: getWeRunData,
|
5659 | navigateToMiniProgram: navigateToMiniProgram,
|
5660 | navigateBackMiniProgram: navigateBackMiniProgram,
|
5661 | chooseInvoice: chooseInvoice,
|
5662 | chooseInvoiceTitle: chooseInvoiceTitle,
|
5663 | checkIsSupportSoterAuthentication: checkIsSupportSoterAuthentication,
|
5664 | startSoterAuthentication: startSoterAuthentication,
|
5665 | checkIsSoterEnrolledInDevice: checkIsSoterEnrolledInDevice,
|
5666 | setEnableDebug: setEnableDebug,
|
5667 | ocrIdCard: ocrIdCard,
|
5668 | ocrBankCard: ocrBankCard,
|
5669 | ocrDrivingLicense: ocrDrivingLicense,
|
5670 | ocrVehicleLicense: ocrVehicleLicense,
|
5671 | textReview: textReview,
|
5672 | textToAudio: textToAudio,
|
5673 | imageAudit: imageAudit,
|
5674 | advancedGeneralIdentify: advancedGeneralIdentify,
|
5675 | objectDetectIdentify: objectDetectIdentify,
|
5676 | carClassify: carClassify,
|
5677 | dishClassify: dishClassify,
|
5678 | logoClassify: logoClassify,
|
5679 | animalClassify: animalClassify,
|
5680 | plantClassify: plantClassify,
|
5681 | getSwanId: getSwanId,
|
5682 | requestPolymerPayment: requestPolymerPayment,
|
5683 | navigateToSmartProgram: navigateToSmartProgram,
|
5684 | navigateBackSmartProgram: navigateBackSmartProgram,
|
5685 | preloadSubPackage: preloadSubPackage
|
5686 | });
|
5687 |
|
5688 | function processApis(taro$$1) {
|
5689 | var weApis = Object.assign({}, taro.onAndSyncApis, taro.noPromiseApis, taro.otherApis);
|
5690 | Object.keys(weApis).forEach(function (key) {
|
5691 | taro$$1[key] = function () {
|
5692 | console.log("\u6682\u65F6\u4E0D\u652F\u6301 ".concat(key));
|
5693 | };
|
5694 | });
|
5695 | }
|
5696 |
|
5697 | function canIUseWebp() {
|
5698 | return true;
|
5699 | }
|
5700 |
|
5701 | function pxTransform(size) {
|
5702 | return size + 'px';
|
5703 | }
|
5704 |
|
5705 | function getApp() {
|
5706 | return globalRef.$app || {};
|
5707 | }
|
5708 |
|
5709 | function initNativeApi(taro$$1) {
|
5710 | processApis(taro$$1);
|
5711 | taro$$1.canIUseWebp = canIUseWebp;
|
5712 | taro$$1.initPxTransform = taro.initPxTransform.bind(taro$$1);
|
5713 | taro$$1.pxTransform = pxTransform.bind(taro$$1);
|
5714 | taro$$1.getApp = getApp;
|
5715 | Object.assign(taro$$1, supportApi);
|
5716 | }
|
5717 |
|
5718 |
|
5719 | var Taro = {
|
5720 | Component: BaseComponent,
|
5721 | PureComponent: PureComponent,
|
5722 | createApp: createApp,
|
5723 | initNativeApi: initNativeApi,
|
5724 | Events: taro.Events,
|
5725 | eventCenter: taro.eventCenter,
|
5726 | getEnv: taro.getEnv,
|
5727 | render: taro.render,
|
5728 | ENV_TYPE: taro.ENV_TYPE,
|
5729 | internal_safe_get: taro.internal_safe_get,
|
5730 | internal_safe_set: taro.internal_safe_set,
|
5731 | internal_inline_style: taro.internal_inline_style,
|
5732 | createComponent: createComponent,
|
5733 | internal_get_original: taro.internal_get_original,
|
5734 | interceptors: taro.interceptors,
|
5735 | propsManager: propsManager,
|
5736 | genCompid: genCompid,
|
5737 | useEffect: taro.useEffect,
|
5738 | useLayoutEffect: taro.useLayoutEffect,
|
5739 | useReducer: taro.useReducer,
|
5740 | useState: taro.useState,
|
5741 | useDidShow: taro.useDidShow,
|
5742 | useDidHide: taro.useDidHide,
|
5743 | usePullDownRefresh: taro.usePullDownRefresh,
|
5744 | useReachBottom: taro.useReachBottom,
|
5745 | usePageScroll: taro.usePageScroll,
|
5746 | useRouter: taro.useRouter,
|
5747 | useScope: taro.useScope,
|
5748 | useRef: taro.useRef,
|
5749 | useCallback: taro.useCallback,
|
5750 | useMemo: taro.useMemo,
|
5751 | useImperativeHandle: taro.useImperativeHandle,
|
5752 | useContext: taro.useContext,
|
5753 | createContext: taro.createContext,
|
5754 | memo: taro.memo,
|
5755 | shallowEqual: shallowEqual
|
5756 | };
|
5757 | initNativeApi(Taro);
|
5758 |
|
5759 | exports.Taro = Taro;
|
5760 | exports.default = Taro;
|
5761 |
|
5762 | Object.defineProperty(exports, '__esModule', { value: true });
|
5763 |
|
5764 | })));
|
5765 |
|