@nutui/nutui-react 2.0.4-beta.0 → 2.0.5-beta.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,7 +1,7 @@
1
- import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
2
1
  import _defineProperty from "@babel/runtime/helpers/defineProperty";
2
+ import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
3
3
  import _typeof from "@babel/runtime/helpers/typeof";
4
- var _excluded = ["children", "className"];
4
+ var _excluded = ["style", "className", "children"];
5
5
  function ownKeys(object, enumerableOnly) {
6
6
  var keys = Object.keys(object);
7
7
  if (Object.getOwnPropertySymbols) {
@@ -23,9 +23,9 @@ function _objectSpread(target) {
23
23
  }
24
24
  return target;
25
25
  }
26
+ import * as React from "react";
26
27
  import React__default, { createContext, useContext } from "react";
27
28
  import classNames from "classnames";
28
- import { C as ComponentDefaults } from "./typings.js";
29
29
  var commonjsGlobal = typeof globalThis !== "undefined" ? globalThis : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : {};
30
30
  var INFINITY = 1 / 0;
31
31
  var symbolTag = "[object Symbol]";
@@ -304,6 +304,670 @@ function words(string, pattern, guard) {
304
304
  return string.match(pattern) || [];
305
305
  }
306
306
  var lodash_kebabcase = kebabCase;
307
+ var lodash_isequalExports = {};
308
+ var lodash_isequal = {
309
+ get exports() {
310
+ return lodash_isequalExports;
311
+ },
312
+ set exports(v) {
313
+ lodash_isequalExports = v;
314
+ }
315
+ };
316
+ (function(module, exports) {
317
+ var LARGE_ARRAY_SIZE = 200;
318
+ var HASH_UNDEFINED = "__lodash_hash_undefined__";
319
+ var COMPARE_PARTIAL_FLAG = 1, COMPARE_UNORDERED_FLAG = 2;
320
+ var MAX_SAFE_INTEGER = 9007199254740991;
321
+ var argsTag = "[object Arguments]", arrayTag = "[object Array]", asyncTag = "[object AsyncFunction]", boolTag = "[object Boolean]", dateTag = "[object Date]", errorTag = "[object Error]", funcTag = "[object Function]", genTag = "[object GeneratorFunction]", mapTag = "[object Map]", numberTag = "[object Number]", nullTag = "[object Null]", objectTag = "[object Object]", promiseTag = "[object Promise]", proxyTag = "[object Proxy]", regexpTag = "[object RegExp]", setTag = "[object Set]", stringTag = "[object String]", symbolTag2 = "[object Symbol]", undefinedTag = "[object Undefined]", weakMapTag = "[object WeakMap]";
322
+ var arrayBufferTag = "[object ArrayBuffer]", dataViewTag = "[object DataView]", float32Tag = "[object Float32Array]", float64Tag = "[object Float64Array]", int8Tag = "[object Int8Array]", int16Tag = "[object Int16Array]", int32Tag = "[object Int32Array]", uint8Tag = "[object Uint8Array]", uint8ClampedTag = "[object Uint8ClampedArray]", uint16Tag = "[object Uint16Array]", uint32Tag = "[object Uint32Array]";
323
+ var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
324
+ var reIsHostCtor = /^\[object .+?Constructor\]$/;
325
+ var reIsUint = /^(?:0|[1-9]\d*)$/;
326
+ var typedArrayTags = {};
327
+ typedArrayTags[float32Tag] = typedArrayTags[float64Tag] = typedArrayTags[int8Tag] = typedArrayTags[int16Tag] = typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] = typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] = typedArrayTags[uint32Tag] = true;
328
+ typedArrayTags[argsTag] = typedArrayTags[arrayTag] = typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] = typedArrayTags[dataViewTag] = typedArrayTags[dateTag] = typedArrayTags[errorTag] = typedArrayTags[funcTag] = typedArrayTags[mapTag] = typedArrayTags[numberTag] = typedArrayTags[objectTag] = typedArrayTags[regexpTag] = typedArrayTags[setTag] = typedArrayTags[stringTag] = typedArrayTags[weakMapTag] = false;
329
+ var freeGlobal2 = _typeof(commonjsGlobal) == "object" && commonjsGlobal && commonjsGlobal.Object === Object && commonjsGlobal;
330
+ var freeSelf2 = (typeof self === "undefined" ? "undefined" : _typeof(self)) == "object" && self && self.Object === Object && self;
331
+ var root2 = freeGlobal2 || freeSelf2 || Function("return this")();
332
+ var freeExports = exports && !exports.nodeType && exports;
333
+ var freeModule = freeExports && true && module && !module.nodeType && module;
334
+ var moduleExports = freeModule && freeModule.exports === freeExports;
335
+ var freeProcess = moduleExports && freeGlobal2.process;
336
+ var nodeUtil = function() {
337
+ try {
338
+ return freeProcess && freeProcess.binding && freeProcess.binding("util");
339
+ } catch (e) {
340
+ }
341
+ }();
342
+ var nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray;
343
+ function arrayFilter(array, predicate) {
344
+ var index = -1, length = array == null ? 0 : array.length, resIndex = 0, result = [];
345
+ while (++index < length) {
346
+ var value = array[index];
347
+ if (predicate(value, index, array)) {
348
+ result[resIndex++] = value;
349
+ }
350
+ }
351
+ return result;
352
+ }
353
+ function arrayPush(array, values) {
354
+ var index = -1, length = values.length, offset = array.length;
355
+ while (++index < length) {
356
+ array[offset + index] = values[index];
357
+ }
358
+ return array;
359
+ }
360
+ function arraySome(array, predicate) {
361
+ var index = -1, length = array == null ? 0 : array.length;
362
+ while (++index < length) {
363
+ if (predicate(array[index], index, array)) {
364
+ return true;
365
+ }
366
+ }
367
+ return false;
368
+ }
369
+ function baseTimes(n, iteratee) {
370
+ var index = -1, result = Array(n);
371
+ while (++index < n) {
372
+ result[index] = iteratee(index);
373
+ }
374
+ return result;
375
+ }
376
+ function baseUnary(func) {
377
+ return function(value) {
378
+ return func(value);
379
+ };
380
+ }
381
+ function cacheHas(cache, key) {
382
+ return cache.has(key);
383
+ }
384
+ function getValue(object, key) {
385
+ return object == null ? void 0 : object[key];
386
+ }
387
+ function mapToArray(map) {
388
+ var index = -1, result = Array(map.size);
389
+ map.forEach(function(value, key) {
390
+ result[++index] = [key, value];
391
+ });
392
+ return result;
393
+ }
394
+ function overArg(func, transform) {
395
+ return function(arg) {
396
+ return func(transform(arg));
397
+ };
398
+ }
399
+ function setToArray(set) {
400
+ var index = -1, result = Array(set.size);
401
+ set.forEach(function(value) {
402
+ result[++index] = value;
403
+ });
404
+ return result;
405
+ }
406
+ var arrayProto = Array.prototype, funcProto = Function.prototype, objectProto2 = Object.prototype;
407
+ var coreJsData = root2["__core-js_shared__"];
408
+ var funcToString = funcProto.toString;
409
+ var hasOwnProperty = objectProto2.hasOwnProperty;
410
+ var maskSrcKey = function() {
411
+ var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || "");
412
+ return uid ? "Symbol(src)_1." + uid : "";
413
+ }();
414
+ var nativeObjectToString = objectProto2.toString;
415
+ var reIsNative = RegExp("^" + funcToString.call(hasOwnProperty).replace(reRegExpChar, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$");
416
+ var Buffer = moduleExports ? root2.Buffer : void 0, _Symbol = root2.Symbol, Uint8Array = root2.Uint8Array, propertyIsEnumerable = objectProto2.propertyIsEnumerable, splice = arrayProto.splice, symToStringTag = _Symbol ? _Symbol.toStringTag : void 0;
417
+ var nativeGetSymbols = Object.getOwnPropertySymbols, nativeIsBuffer = Buffer ? Buffer.isBuffer : void 0, nativeKeys = overArg(Object.keys, Object);
418
+ var DataView = getNative(root2, "DataView"), Map = getNative(root2, "Map"), Promise2 = getNative(root2, "Promise"), Set = getNative(root2, "Set"), WeakMap = getNative(root2, "WeakMap"), nativeCreate = getNative(Object, "create");
419
+ var dataViewCtorString = toSource(DataView), mapCtorString = toSource(Map), promiseCtorString = toSource(Promise2), setCtorString = toSource(Set), weakMapCtorString = toSource(WeakMap);
420
+ var symbolProto2 = _Symbol ? _Symbol.prototype : void 0, symbolValueOf = symbolProto2 ? symbolProto2.valueOf : void 0;
421
+ function Hash(entries) {
422
+ var index = -1, length = entries == null ? 0 : entries.length;
423
+ this.clear();
424
+ while (++index < length) {
425
+ var entry = entries[index];
426
+ this.set(entry[0], entry[1]);
427
+ }
428
+ }
429
+ function hashClear() {
430
+ this.__data__ = nativeCreate ? nativeCreate(null) : {};
431
+ this.size = 0;
432
+ }
433
+ function hashDelete(key) {
434
+ var result = this.has(key) && delete this.__data__[key];
435
+ this.size -= result ? 1 : 0;
436
+ return result;
437
+ }
438
+ function hashGet(key) {
439
+ var data = this.__data__;
440
+ if (nativeCreate) {
441
+ var result = data[key];
442
+ return result === HASH_UNDEFINED ? void 0 : result;
443
+ }
444
+ return hasOwnProperty.call(data, key) ? data[key] : void 0;
445
+ }
446
+ function hashHas(key) {
447
+ var data = this.__data__;
448
+ return nativeCreate ? data[key] !== void 0 : hasOwnProperty.call(data, key);
449
+ }
450
+ function hashSet(key, value) {
451
+ var data = this.__data__;
452
+ this.size += this.has(key) ? 0 : 1;
453
+ data[key] = nativeCreate && value === void 0 ? HASH_UNDEFINED : value;
454
+ return this;
455
+ }
456
+ Hash.prototype.clear = hashClear;
457
+ Hash.prototype["delete"] = hashDelete;
458
+ Hash.prototype.get = hashGet;
459
+ Hash.prototype.has = hashHas;
460
+ Hash.prototype.set = hashSet;
461
+ function ListCache(entries) {
462
+ var index = -1, length = entries == null ? 0 : entries.length;
463
+ this.clear();
464
+ while (++index < length) {
465
+ var entry = entries[index];
466
+ this.set(entry[0], entry[1]);
467
+ }
468
+ }
469
+ function listCacheClear() {
470
+ this.__data__ = [];
471
+ this.size = 0;
472
+ }
473
+ function listCacheDelete(key) {
474
+ var data = this.__data__, index = assocIndexOf(data, key);
475
+ if (index < 0) {
476
+ return false;
477
+ }
478
+ var lastIndex = data.length - 1;
479
+ if (index == lastIndex) {
480
+ data.pop();
481
+ } else {
482
+ splice.call(data, index, 1);
483
+ }
484
+ --this.size;
485
+ return true;
486
+ }
487
+ function listCacheGet(key) {
488
+ var data = this.__data__, index = assocIndexOf(data, key);
489
+ return index < 0 ? void 0 : data[index][1];
490
+ }
491
+ function listCacheHas(key) {
492
+ return assocIndexOf(this.__data__, key) > -1;
493
+ }
494
+ function listCacheSet(key, value) {
495
+ var data = this.__data__, index = assocIndexOf(data, key);
496
+ if (index < 0) {
497
+ ++this.size;
498
+ data.push([key, value]);
499
+ } else {
500
+ data[index][1] = value;
501
+ }
502
+ return this;
503
+ }
504
+ ListCache.prototype.clear = listCacheClear;
505
+ ListCache.prototype["delete"] = listCacheDelete;
506
+ ListCache.prototype.get = listCacheGet;
507
+ ListCache.prototype.has = listCacheHas;
508
+ ListCache.prototype.set = listCacheSet;
509
+ function MapCache(entries) {
510
+ var index = -1, length = entries == null ? 0 : entries.length;
511
+ this.clear();
512
+ while (++index < length) {
513
+ var entry = entries[index];
514
+ this.set(entry[0], entry[1]);
515
+ }
516
+ }
517
+ function mapCacheClear() {
518
+ this.size = 0;
519
+ this.__data__ = {
520
+ "hash": new Hash(),
521
+ "map": new (Map || ListCache)(),
522
+ "string": new Hash()
523
+ };
524
+ }
525
+ function mapCacheDelete(key) {
526
+ var result = getMapData(this, key)["delete"](key);
527
+ this.size -= result ? 1 : 0;
528
+ return result;
529
+ }
530
+ function mapCacheGet(key) {
531
+ return getMapData(this, key).get(key);
532
+ }
533
+ function mapCacheHas(key) {
534
+ return getMapData(this, key).has(key);
535
+ }
536
+ function mapCacheSet(key, value) {
537
+ var data = getMapData(this, key), size = data.size;
538
+ data.set(key, value);
539
+ this.size += data.size == size ? 0 : 1;
540
+ return this;
541
+ }
542
+ MapCache.prototype.clear = mapCacheClear;
543
+ MapCache.prototype["delete"] = mapCacheDelete;
544
+ MapCache.prototype.get = mapCacheGet;
545
+ MapCache.prototype.has = mapCacheHas;
546
+ MapCache.prototype.set = mapCacheSet;
547
+ function SetCache(values) {
548
+ var index = -1, length = values == null ? 0 : values.length;
549
+ this.__data__ = new MapCache();
550
+ while (++index < length) {
551
+ this.add(values[index]);
552
+ }
553
+ }
554
+ function setCacheAdd(value) {
555
+ this.__data__.set(value, HASH_UNDEFINED);
556
+ return this;
557
+ }
558
+ function setCacheHas(value) {
559
+ return this.__data__.has(value);
560
+ }
561
+ SetCache.prototype.add = SetCache.prototype.push = setCacheAdd;
562
+ SetCache.prototype.has = setCacheHas;
563
+ function Stack(entries) {
564
+ var data = this.__data__ = new ListCache(entries);
565
+ this.size = data.size;
566
+ }
567
+ function stackClear() {
568
+ this.__data__ = new ListCache();
569
+ this.size = 0;
570
+ }
571
+ function stackDelete(key) {
572
+ var data = this.__data__, result = data["delete"](key);
573
+ this.size = data.size;
574
+ return result;
575
+ }
576
+ function stackGet(key) {
577
+ return this.__data__.get(key);
578
+ }
579
+ function stackHas(key) {
580
+ return this.__data__.has(key);
581
+ }
582
+ function stackSet(key, value) {
583
+ var data = this.__data__;
584
+ if (data instanceof ListCache) {
585
+ var pairs = data.__data__;
586
+ if (!Map || pairs.length < LARGE_ARRAY_SIZE - 1) {
587
+ pairs.push([key, value]);
588
+ this.size = ++data.size;
589
+ return this;
590
+ }
591
+ data = this.__data__ = new MapCache(pairs);
592
+ }
593
+ data.set(key, value);
594
+ this.size = data.size;
595
+ return this;
596
+ }
597
+ Stack.prototype.clear = stackClear;
598
+ Stack.prototype["delete"] = stackDelete;
599
+ Stack.prototype.get = stackGet;
600
+ Stack.prototype.has = stackHas;
601
+ Stack.prototype.set = stackSet;
602
+ function arrayLikeKeys(value, inherited) {
603
+ var isArr = isArray(value), isArg = !isArr && isArguments(value), isBuff = !isArr && !isArg && isBuffer(value), isType = !isArr && !isArg && !isBuff && isTypedArray(value), skipIndexes = isArr || isArg || isBuff || isType, result = skipIndexes ? baseTimes(value.length, String) : [], length = result.length;
604
+ for (var key in value) {
605
+ if ((inherited || hasOwnProperty.call(value, key)) && !(skipIndexes && // Safari 9 has enumerable `arguments.length` in strict mode.
606
+ (key == "length" || // Node.js 0.10 has enumerable non-index properties on buffers.
607
+ isBuff && (key == "offset" || key == "parent") || // PhantomJS 2 has enumerable non-index properties on typed arrays.
608
+ isType && (key == "buffer" || key == "byteLength" || key == "byteOffset") || // Skip index properties.
609
+ isIndex(key, length)))) {
610
+ result.push(key);
611
+ }
612
+ }
613
+ return result;
614
+ }
615
+ function assocIndexOf(array, key) {
616
+ var length = array.length;
617
+ while (length--) {
618
+ if (eq(array[length][0], key)) {
619
+ return length;
620
+ }
621
+ }
622
+ return -1;
623
+ }
624
+ function baseGetAllKeys(object, keysFunc, symbolsFunc) {
625
+ var result = keysFunc(object);
626
+ return isArray(object) ? result : arrayPush(result, symbolsFunc(object));
627
+ }
628
+ function baseGetTag(value) {
629
+ if (value == null) {
630
+ return value === void 0 ? undefinedTag : nullTag;
631
+ }
632
+ return symToStringTag && symToStringTag in Object(value) ? getRawTag(value) : objectToString2(value);
633
+ }
634
+ function baseIsArguments(value) {
635
+ return isObjectLike2(value) && baseGetTag(value) == argsTag;
636
+ }
637
+ function baseIsEqual(value, other, bitmask, customizer, stack) {
638
+ if (value === other) {
639
+ return true;
640
+ }
641
+ if (value == null || other == null || !isObjectLike2(value) && !isObjectLike2(other)) {
642
+ return value !== value && other !== other;
643
+ }
644
+ return baseIsEqualDeep(value, other, bitmask, customizer, baseIsEqual, stack);
645
+ }
646
+ function baseIsEqualDeep(object, other, bitmask, customizer, equalFunc, stack) {
647
+ var objIsArr = isArray(object), othIsArr = isArray(other), objTag = objIsArr ? arrayTag : getTag(object), othTag = othIsArr ? arrayTag : getTag(other);
648
+ objTag = objTag == argsTag ? objectTag : objTag;
649
+ othTag = othTag == argsTag ? objectTag : othTag;
650
+ var objIsObj = objTag == objectTag, othIsObj = othTag == objectTag, isSameTag = objTag == othTag;
651
+ if (isSameTag && isBuffer(object)) {
652
+ if (!isBuffer(other)) {
653
+ return false;
654
+ }
655
+ objIsArr = true;
656
+ objIsObj = false;
657
+ }
658
+ if (isSameTag && !objIsObj) {
659
+ stack || (stack = new Stack());
660
+ return objIsArr || isTypedArray(object) ? equalArrays(object, other, bitmask, customizer, equalFunc, stack) : equalByTag(object, other, objTag, bitmask, customizer, equalFunc, stack);
661
+ }
662
+ if (!(bitmask & COMPARE_PARTIAL_FLAG)) {
663
+ var objIsWrapped = objIsObj && hasOwnProperty.call(object, "__wrapped__"), othIsWrapped = othIsObj && hasOwnProperty.call(other, "__wrapped__");
664
+ if (objIsWrapped || othIsWrapped) {
665
+ var objUnwrapped = objIsWrapped ? object.value() : object, othUnwrapped = othIsWrapped ? other.value() : other;
666
+ stack || (stack = new Stack());
667
+ return equalFunc(objUnwrapped, othUnwrapped, bitmask, customizer, stack);
668
+ }
669
+ }
670
+ if (!isSameTag) {
671
+ return false;
672
+ }
673
+ stack || (stack = new Stack());
674
+ return equalObjects(object, other, bitmask, customizer, equalFunc, stack);
675
+ }
676
+ function baseIsNative(value) {
677
+ if (!isObject(value) || isMasked(value)) {
678
+ return false;
679
+ }
680
+ var pattern = isFunction(value) ? reIsNative : reIsHostCtor;
681
+ return pattern.test(toSource(value));
682
+ }
683
+ function baseIsTypedArray(value) {
684
+ return isObjectLike2(value) && isLength(value.length) && !!typedArrayTags[baseGetTag(value)];
685
+ }
686
+ function baseKeys(object) {
687
+ if (!isPrototype(object)) {
688
+ return nativeKeys(object);
689
+ }
690
+ var result = [];
691
+ for (var key in Object(object)) {
692
+ if (hasOwnProperty.call(object, key) && key != "constructor") {
693
+ result.push(key);
694
+ }
695
+ }
696
+ return result;
697
+ }
698
+ function equalArrays(array, other, bitmask, customizer, equalFunc, stack) {
699
+ var isPartial = bitmask & COMPARE_PARTIAL_FLAG, arrLength = array.length, othLength = other.length;
700
+ if (arrLength != othLength && !(isPartial && othLength > arrLength)) {
701
+ return false;
702
+ }
703
+ var stacked = stack.get(array);
704
+ if (stacked && stack.get(other)) {
705
+ return stacked == other;
706
+ }
707
+ var index = -1, result = true, seen = bitmask & COMPARE_UNORDERED_FLAG ? new SetCache() : void 0;
708
+ stack.set(array, other);
709
+ stack.set(other, array);
710
+ while (++index < arrLength) {
711
+ var arrValue = array[index], othValue = other[index];
712
+ if (customizer) {
713
+ var compared = isPartial ? customizer(othValue, arrValue, index, other, array, stack) : customizer(arrValue, othValue, index, array, other, stack);
714
+ }
715
+ if (compared !== void 0) {
716
+ if (compared) {
717
+ continue;
718
+ }
719
+ result = false;
720
+ break;
721
+ }
722
+ if (seen) {
723
+ if (!arraySome(other, function(othValue2, othIndex) {
724
+ if (!cacheHas(seen, othIndex) && (arrValue === othValue2 || equalFunc(arrValue, othValue2, bitmask, customizer, stack))) {
725
+ return seen.push(othIndex);
726
+ }
727
+ })) {
728
+ result = false;
729
+ break;
730
+ }
731
+ } else if (!(arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack))) {
732
+ result = false;
733
+ break;
734
+ }
735
+ }
736
+ stack["delete"](array);
737
+ stack["delete"](other);
738
+ return result;
739
+ }
740
+ function equalByTag(object, other, tag, bitmask, customizer, equalFunc, stack) {
741
+ switch (tag) {
742
+ case dataViewTag:
743
+ if (object.byteLength != other.byteLength || object.byteOffset != other.byteOffset) {
744
+ return false;
745
+ }
746
+ object = object.buffer;
747
+ other = other.buffer;
748
+ case arrayBufferTag:
749
+ if (object.byteLength != other.byteLength || !equalFunc(new Uint8Array(object), new Uint8Array(other))) {
750
+ return false;
751
+ }
752
+ return true;
753
+ case boolTag:
754
+ case dateTag:
755
+ case numberTag:
756
+ return eq(+object, +other);
757
+ case errorTag:
758
+ return object.name == other.name && object.message == other.message;
759
+ case regexpTag:
760
+ case stringTag:
761
+ return object == other + "";
762
+ case mapTag:
763
+ var convert = mapToArray;
764
+ case setTag:
765
+ var isPartial = bitmask & COMPARE_PARTIAL_FLAG;
766
+ convert || (convert = setToArray);
767
+ if (object.size != other.size && !isPartial) {
768
+ return false;
769
+ }
770
+ var stacked = stack.get(object);
771
+ if (stacked) {
772
+ return stacked == other;
773
+ }
774
+ bitmask |= COMPARE_UNORDERED_FLAG;
775
+ stack.set(object, other);
776
+ var result = equalArrays(convert(object), convert(other), bitmask, customizer, equalFunc, stack);
777
+ stack["delete"](object);
778
+ return result;
779
+ case symbolTag2:
780
+ if (symbolValueOf) {
781
+ return symbolValueOf.call(object) == symbolValueOf.call(other);
782
+ }
783
+ }
784
+ return false;
785
+ }
786
+ function equalObjects(object, other, bitmask, customizer, equalFunc, stack) {
787
+ var isPartial = bitmask & COMPARE_PARTIAL_FLAG, objProps = getAllKeys(object), objLength = objProps.length, othProps = getAllKeys(other), othLength = othProps.length;
788
+ if (objLength != othLength && !isPartial) {
789
+ return false;
790
+ }
791
+ var index = objLength;
792
+ while (index--) {
793
+ var key = objProps[index];
794
+ if (!(isPartial ? key in other : hasOwnProperty.call(other, key))) {
795
+ return false;
796
+ }
797
+ }
798
+ var stacked = stack.get(object);
799
+ if (stacked && stack.get(other)) {
800
+ return stacked == other;
801
+ }
802
+ var result = true;
803
+ stack.set(object, other);
804
+ stack.set(other, object);
805
+ var skipCtor = isPartial;
806
+ while (++index < objLength) {
807
+ key = objProps[index];
808
+ var objValue = object[key], othValue = other[key];
809
+ if (customizer) {
810
+ var compared = isPartial ? customizer(othValue, objValue, key, other, object, stack) : customizer(objValue, othValue, key, object, other, stack);
811
+ }
812
+ if (!(compared === void 0 ? objValue === othValue || equalFunc(objValue, othValue, bitmask, customizer, stack) : compared)) {
813
+ result = false;
814
+ break;
815
+ }
816
+ skipCtor || (skipCtor = key == "constructor");
817
+ }
818
+ if (result && !skipCtor) {
819
+ var objCtor = object.constructor, othCtor = other.constructor;
820
+ if (objCtor != othCtor && "constructor" in object && "constructor" in other && !(typeof objCtor == "function" && objCtor instanceof objCtor && typeof othCtor == "function" && othCtor instanceof othCtor)) {
821
+ result = false;
822
+ }
823
+ }
824
+ stack["delete"](object);
825
+ stack["delete"](other);
826
+ return result;
827
+ }
828
+ function getAllKeys(object) {
829
+ return baseGetAllKeys(object, keys, getSymbols);
830
+ }
831
+ function getMapData(map, key) {
832
+ var data = map.__data__;
833
+ return isKeyable(key) ? data[typeof key == "string" ? "string" : "hash"] : data.map;
834
+ }
835
+ function getNative(object, key) {
836
+ var value = getValue(object, key);
837
+ return baseIsNative(value) ? value : void 0;
838
+ }
839
+ function getRawTag(value) {
840
+ var isOwn = hasOwnProperty.call(value, symToStringTag), tag = value[symToStringTag];
841
+ try {
842
+ value[symToStringTag] = void 0;
843
+ var unmasked = true;
844
+ } catch (e) {
845
+ }
846
+ var result = nativeObjectToString.call(value);
847
+ if (unmasked) {
848
+ if (isOwn) {
849
+ value[symToStringTag] = tag;
850
+ } else {
851
+ delete value[symToStringTag];
852
+ }
853
+ }
854
+ return result;
855
+ }
856
+ var getSymbols = !nativeGetSymbols ? stubArray : function(object) {
857
+ if (object == null) {
858
+ return [];
859
+ }
860
+ object = Object(object);
861
+ return arrayFilter(nativeGetSymbols(object), function(symbol) {
862
+ return propertyIsEnumerable.call(object, symbol);
863
+ });
864
+ };
865
+ var getTag = baseGetTag;
866
+ if (DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag || Map && getTag(new Map()) != mapTag || Promise2 && getTag(Promise2.resolve()) != promiseTag || Set && getTag(new Set()) != setTag || WeakMap && getTag(new WeakMap()) != weakMapTag) {
867
+ getTag = function getTag2(value) {
868
+ var result = baseGetTag(value), Ctor = result == objectTag ? value.constructor : void 0, ctorString = Ctor ? toSource(Ctor) : "";
869
+ if (ctorString) {
870
+ switch (ctorString) {
871
+ case dataViewCtorString:
872
+ return dataViewTag;
873
+ case mapCtorString:
874
+ return mapTag;
875
+ case promiseCtorString:
876
+ return promiseTag;
877
+ case setCtorString:
878
+ return setTag;
879
+ case weakMapCtorString:
880
+ return weakMapTag;
881
+ }
882
+ }
883
+ return result;
884
+ };
885
+ }
886
+ function isIndex(value, length) {
887
+ length = length == null ? MAX_SAFE_INTEGER : length;
888
+ return !!length && (typeof value == "number" || reIsUint.test(value)) && value > -1 && value % 1 == 0 && value < length;
889
+ }
890
+ function isKeyable(value) {
891
+ var type = _typeof(value);
892
+ return type == "string" || type == "number" || type == "symbol" || type == "boolean" ? value !== "__proto__" : value === null;
893
+ }
894
+ function isMasked(func) {
895
+ return !!maskSrcKey && maskSrcKey in func;
896
+ }
897
+ function isPrototype(value) {
898
+ var Ctor = value && value.constructor, proto = typeof Ctor == "function" && Ctor.prototype || objectProto2;
899
+ return value === proto;
900
+ }
901
+ function objectToString2(value) {
902
+ return nativeObjectToString.call(value);
903
+ }
904
+ function toSource(func) {
905
+ if (func != null) {
906
+ try {
907
+ return funcToString.call(func);
908
+ } catch (e) {
909
+ }
910
+ try {
911
+ return func + "";
912
+ } catch (e) {
913
+ }
914
+ }
915
+ return "";
916
+ }
917
+ function eq(value, other) {
918
+ return value === other || value !== value && other !== other;
919
+ }
920
+ var isArguments = baseIsArguments(function() {
921
+ return arguments;
922
+ }()) ? baseIsArguments : function(value) {
923
+ return isObjectLike2(value) && hasOwnProperty.call(value, "callee") && !propertyIsEnumerable.call(value, "callee");
924
+ };
925
+ var isArray = Array.isArray;
926
+ function isArrayLike(value) {
927
+ return value != null && isLength(value.length) && !isFunction(value);
928
+ }
929
+ var isBuffer = nativeIsBuffer || stubFalse;
930
+ function isEqual(value, other) {
931
+ return baseIsEqual(value, other);
932
+ }
933
+ function isFunction(value) {
934
+ if (!isObject(value)) {
935
+ return false;
936
+ }
937
+ var tag = baseGetTag(value);
938
+ return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag;
939
+ }
940
+ function isLength(value) {
941
+ return typeof value == "number" && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
942
+ }
943
+ function isObject(value) {
944
+ var type = _typeof(value);
945
+ return value != null && (type == "object" || type == "function");
946
+ }
947
+ function isObjectLike2(value) {
948
+ return value != null && _typeof(value) == "object";
949
+ }
950
+ var isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray;
951
+ function keys(object) {
952
+ return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object);
953
+ }
954
+ function stubArray() {
955
+ return [];
956
+ }
957
+ function stubFalse() {
958
+ return false;
959
+ }
960
+ module.exports = isEqual;
961
+ })(lodash_isequal, lodash_isequalExports);
962
+ var isequal = lodash_isequalExports;
963
+ function useMemo(getValue, condition, shouldUpdate) {
964
+ var cacheRef = React.useRef({});
965
+ if (!("value" in cacheRef.current) || shouldUpdate(cacheRef.current.condition, condition)) {
966
+ cacheRef.current.value = getValue();
967
+ cacheRef.current.condition = condition;
968
+ }
969
+ return cacheRef.current.value;
970
+ }
307
971
  var zhCN = {
308
972
  save: "保存",
309
973
  confirm: "确认",
@@ -439,9 +1103,6 @@ var zhCN = {
439
1103
  errorCanvasTips: "当前环境不支持Canvas"
440
1104
  }
441
1105
  };
442
- var defaultProps = _objectSpread(_objectSpread({}, ComponentDefaults), {}, {
443
- locale: zhCN
444
- });
445
1106
  var classPrefix = "nut-configprovider";
446
1107
  var defaultConfigRef = {
447
1108
  current: {
@@ -467,17 +1128,25 @@ function convertThemeVarsToCSSVars(themeVars) {
467
1128
  return cssVars;
468
1129
  }
469
1130
  var ConfigProvider = function ConfigProvider2(props) {
470
- var _defaultProps$props = _objectSpread(_objectSpread({}, defaultProps), props), children = _defaultProps$props.children, className = _defaultProps$props.className, config = _objectWithoutProperties(_defaultProps$props, _excluded);
471
- var parentConfig = useConfig();
472
- var style = _objectSpread(_objectSpread({}, convertThemeVarsToCSSVars(config.theme || {})), config.style);
1131
+ var style = props.style, className = props.className, children = props.children, config = _objectWithoutProperties(props, _excluded);
1132
+ var mergedConfig = useMemo(function() {
1133
+ return _objectSpread(_objectSpread({}, getDefaultConfig()), config);
1134
+ }, [config], function(prev, next) {
1135
+ return prev.some(function(prevTheme, index) {
1136
+ var nextTheme = next[index];
1137
+ return !isequal(prevTheme, nextTheme);
1138
+ });
1139
+ });
1140
+ var cssVarStyle = React__default.useMemo(function() {
1141
+ return convertThemeVarsToCSSVars(mergedConfig.theme || {});
1142
+ }, [mergedConfig.theme]);
473
1143
  return React__default.createElement(ConfigContext.Provider, {
474
- value: _objectSpread(_objectSpread({}, parentConfig), config)
1144
+ value: mergedConfig
475
1145
  }, React__default.createElement("div", {
476
1146
  className: classNames(classPrefix, className),
477
- style
1147
+ style: _objectSpread(_objectSpread({}, cssVarStyle), style)
478
1148
  }, children));
479
1149
  };
480
- ConfigProvider.defaultProps = defaultProps;
481
1150
  ConfigProvider.displayName = "NutConfigProvider";
482
1151
  export {
483
1152
  ConfigProvider as C,