@arco-design/mobile-react 2.36.0 → 2.36.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +24 -0
- package/README.en-US.md +2 -2
- package/README.md +2 -2
- package/cjs/carousel/index.js +8 -7
- package/cjs/ellipsis/components/js-ellipsis.js +3 -1
- package/cjs/form/form-item.d.ts +33 -2
- package/cjs/form/form-item.js +142 -121
- package/cjs/form/index.js +3 -1
- package/cjs/form/linked-container.d.ts +1 -1
- package/cjs/form/linked-container.js +4 -0
- package/cjs/form/style/css/index.css +4 -1
- package/cjs/form/style/index.less +6 -1
- package/cjs/form/type.d.ts +24 -1
- package/cjs/form/type.js +10 -2
- package/cjs/form/useForm.d.ts +2 -17
- package/cjs/form/useForm.js +98 -17
- package/cjs/form/utils.d.ts +2 -0
- package/cjs/form/utils.js +42 -2
- package/cjs/input/index.js +1 -1
- package/cjs/popover/hooks/usePosition.js +26 -8
- package/cjs/radio/group.js +1 -1
- package/cjs/radio/type.d.ts +2 -2
- package/dist/index.js +3021 -370
- package/dist/index.min.js +4 -4
- package/dist/style.css +4 -1
- package/dist/style.min.css +1 -1
- package/esm/carousel/index.js +8 -7
- package/esm/ellipsis/components/js-ellipsis.js +3 -1
- package/esm/form/form-item.d.ts +33 -2
- package/esm/form/form-item.js +143 -122
- package/esm/form/index.js +3 -1
- package/esm/form/linked-container.d.ts +1 -1
- package/esm/form/linked-container.js +4 -0
- package/esm/form/style/css/index.css +4 -1
- package/esm/form/style/index.less +6 -1
- package/esm/form/type.d.ts +24 -1
- package/esm/form/type.js +8 -1
- package/esm/form/useForm.d.ts +2 -17
- package/esm/form/useForm.js +97 -17
- package/esm/form/utils.d.ts +2 -0
- package/esm/form/utils.js +31 -1
- package/esm/input/index.js +1 -1
- package/esm/popover/hooks/usePosition.js +26 -8
- package/esm/radio/group.js +1 -1
- package/esm/radio/type.d.ts +2 -2
- package/esnext/carousel/index.js +7 -5
- package/esnext/ellipsis/components/js-ellipsis.js +2 -0
- package/esnext/form/form-item.d.ts +33 -2
- package/esnext/form/form-item.js +85 -71
- package/esnext/form/index.js +2 -1
- package/esnext/form/linked-container.d.ts +1 -1
- package/esnext/form/linked-container.js +3 -0
- package/esnext/form/style/css/index.css +4 -1
- package/esnext/form/style/index.less +6 -1
- package/esnext/form/type.d.ts +24 -1
- package/esnext/form/type.js +7 -0
- package/esnext/form/useForm.d.ts +2 -17
- package/esnext/form/useForm.js +72 -13
- package/esnext/form/utils.d.ts +2 -0
- package/esnext/form/utils.js +26 -0
- package/esnext/input/index.js +1 -1
- package/esnext/popover/hooks/usePosition.js +32 -12
- package/esnext/radio/group.js +3 -1
- package/esnext/radio/type.d.ts +2 -2
- package/package.json +3 -3
- package/umd/carousel/index.js +8 -7
- package/umd/ellipsis/components/js-ellipsis.js +3 -1
- package/umd/form/form-item.d.ts +33 -2
- package/umd/form/form-item.js +142 -121
- package/umd/form/index.js +3 -1
- package/umd/form/linked-container.d.ts +1 -1
- package/umd/form/linked-container.js +4 -0
- package/umd/form/style/css/index.css +4 -1
- package/umd/form/style/index.less +6 -1
- package/umd/form/type.d.ts +24 -1
- package/umd/form/type.js +9 -1
- package/umd/form/useForm.d.ts +2 -17
- package/umd/form/useForm.js +98 -21
- package/umd/form/utils.d.ts +2 -0
- package/umd/form/utils.js +40 -5
- package/umd/input/index.js +1 -1
- package/umd/popover/hooks/usePosition.js +26 -8
- package/umd/radio/group.js +1 -1
- package/umd/radio/type.d.ts +2 -2
package/dist/index.js
CHANGED
@@ -112,7 +112,7 @@
|
|
112
112
|
* ```
|
113
113
|
*/
|
114
114
|
|
115
|
-
function isArray$
|
115
|
+
function isArray$2(obj) {
|
116
116
|
return opt.call(obj) === '[object Array]';
|
117
117
|
}
|
118
118
|
/**
|
@@ -130,7 +130,7 @@
|
|
130
130
|
* ```
|
131
131
|
*/
|
132
132
|
|
133
|
-
function isObject$
|
133
|
+
function isObject$3(obj) {
|
134
134
|
return opt.call(obj) === '[object Object]';
|
135
135
|
}
|
136
136
|
/**
|
@@ -204,7 +204,7 @@
|
|
204
204
|
* ```
|
205
205
|
*/
|
206
206
|
|
207
|
-
function isFunction(obj) {
|
207
|
+
function isFunction$1(obj) {
|
208
208
|
return Object.prototype.toString.call(obj).toLowerCase() === '[object function]';
|
209
209
|
}
|
210
210
|
/**
|
@@ -223,7 +223,7 @@
|
|
223
223
|
*/
|
224
224
|
|
225
225
|
function isEmptyArray(obj) {
|
226
|
-
return isArray$
|
226
|
+
return isArray$2(obj) && !(obj === null || obj === void 0 ? void 0 : obj.length);
|
227
227
|
}
|
228
228
|
/**
|
229
229
|
* 深比较两个对象是否相等
|
@@ -247,7 +247,7 @@
|
|
247
247
|
return obj === sub;
|
248
248
|
}
|
249
249
|
|
250
|
-
if (isFunction(obj) && isFunction(sub)) {
|
250
|
+
if (isFunction$1(obj) && isFunction$1(sub)) {
|
251
251
|
return obj === sub || obj.toString() === sub.toString();
|
252
252
|
}
|
253
253
|
|
@@ -300,9 +300,9 @@
|
|
300
300
|
|
301
301
|
if (isString(v)) {
|
302
302
|
classNames.push(v);
|
303
|
-
} else if (isArray$
|
303
|
+
} else if (isArray$2(v)) {
|
304
304
|
classNames = classNames.concat(v);
|
305
|
-
} else if (isObject$
|
305
|
+
} else if (isObject$3(v)) {
|
306
306
|
Object.keys(v).forEach(function (k) {
|
307
307
|
if (v[k]) {
|
308
308
|
classNames.push(k);
|
@@ -1975,7 +1975,7 @@
|
|
1975
1975
|
Object.keys(originMT).forEach(function (key) {
|
1976
1976
|
var originValue = originMT[key];
|
1977
1977
|
var curValue = newMT === null || newMT === void 0 ? void 0 : newMT[key];
|
1978
|
-
targetMT[key] = isObject$
|
1978
|
+
targetMT[key] = isObject$3(originValue) ? __assign$2(__assign$2({}, originValue), curValue) : curValue || originValue;
|
1979
1979
|
});
|
1980
1980
|
}
|
1981
1981
|
|
@@ -3695,7 +3695,7 @@
|
|
3695
3695
|
Object.keys(this.rules).forEach(function (key) {
|
3696
3696
|
var spPromiseGroup = [];
|
3697
3697
|
|
3698
|
-
if (isArray$
|
3698
|
+
if (isArray$2(_this.rules[key])) {
|
3699
3699
|
for (var i = 0; i < _this.rules[key].length; i++) {
|
3700
3700
|
var rule = _this.rules[key][i];
|
3701
3701
|
|
@@ -4702,7 +4702,7 @@
|
|
4702
4702
|
};
|
4703
4703
|
}
|
4704
4704
|
|
4705
|
-
function isObject$
|
4705
|
+
function isObject$2(obj) {
|
4706
4706
|
return Object.prototype.toString.call(obj) === '[object Object]';
|
4707
4707
|
}
|
4708
4708
|
|
@@ -4719,7 +4719,7 @@
|
|
4719
4719
|
// Avoid console warning
|
4720
4720
|
var __SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED = CopyReactDOM.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
|
4721
4721
|
|
4722
|
-
if (isObject$
|
4722
|
+
if (isObject$2(__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED)) {
|
4723
4723
|
__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.usingClientEntryPoint = skipWarning;
|
4724
4724
|
}
|
4725
4725
|
};
|
@@ -5581,7 +5581,7 @@
|
|
5581
5581
|
var NAN = 0 / 0;
|
5582
5582
|
|
5583
5583
|
/** `Object#toString` result references. */
|
5584
|
-
var symbolTag = '[object Symbol]';
|
5584
|
+
var symbolTag$2 = '[object Symbol]';
|
5585
5585
|
|
5586
5586
|
/** Used to match leading and trailing whitespace. */
|
5587
5587
|
var reTrim = /^\s+|\s+$/g;
|
@@ -5599,23 +5599,23 @@
|
|
5599
5599
|
var freeParseInt = parseInt;
|
5600
5600
|
|
5601
5601
|
/** Detect free variable `global` from Node.js. */
|
5602
|
-
var freeGlobal = typeof commonjsGlobal == 'object' && commonjsGlobal && commonjsGlobal.Object === Object && commonjsGlobal;
|
5602
|
+
var freeGlobal$1 = typeof commonjsGlobal == 'object' && commonjsGlobal && commonjsGlobal.Object === Object && commonjsGlobal;
|
5603
5603
|
|
5604
5604
|
/** Detect free variable `self`. */
|
5605
|
-
var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
|
5605
|
+
var freeSelf$1 = typeof self == 'object' && self && self.Object === Object && self;
|
5606
5606
|
|
5607
5607
|
/** Used as a reference to the global object. */
|
5608
|
-
var root$
|
5608
|
+
var root$2 = freeGlobal$1 || freeSelf$1 || Function('return this')();
|
5609
5609
|
|
5610
5610
|
/** Used for built-in method references. */
|
5611
|
-
var objectProto = Object.prototype;
|
5611
|
+
var objectProto$d = Object.prototype;
|
5612
5612
|
|
5613
5613
|
/**
|
5614
5614
|
* Used to resolve the
|
5615
5615
|
* [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
|
5616
5616
|
* of values.
|
5617
5617
|
*/
|
5618
|
-
var objectToString = objectProto.toString;
|
5618
|
+
var objectToString$1 = objectProto$d.toString;
|
5619
5619
|
|
5620
5620
|
/* Built-in method references for those with the same name as other `lodash` methods. */
|
5621
5621
|
var nativeMax = Math.max,
|
@@ -5638,7 +5638,7 @@
|
|
5638
5638
|
* // => Logs the number of milliseconds it took for the deferred invocation.
|
5639
5639
|
*/
|
5640
5640
|
var now = function() {
|
5641
|
-
return root$
|
5641
|
+
return root$2.Date.now();
|
5642
5642
|
};
|
5643
5643
|
|
5644
5644
|
/**
|
@@ -5711,7 +5711,7 @@
|
|
5711
5711
|
throw new TypeError(FUNC_ERROR_TEXT);
|
5712
5712
|
}
|
5713
5713
|
wait = toNumber(wait) || 0;
|
5714
|
-
if (isObject(options)) {
|
5714
|
+
if (isObject$1(options)) {
|
5715
5715
|
leading = !!options.leading;
|
5716
5716
|
maxing = 'maxWait' in options;
|
5717
5717
|
maxWait = maxing ? nativeMax(toNumber(options.maxWait) || 0, wait) : maxWait;
|
@@ -5868,7 +5868,7 @@
|
|
5868
5868
|
if (typeof func != 'function') {
|
5869
5869
|
throw new TypeError(FUNC_ERROR_TEXT);
|
5870
5870
|
}
|
5871
|
-
if (isObject(options)) {
|
5871
|
+
if (isObject$1(options)) {
|
5872
5872
|
leading = 'leading' in options ? !!options.leading : leading;
|
5873
5873
|
trailing = 'trailing' in options ? !!options.trailing : trailing;
|
5874
5874
|
}
|
@@ -5904,7 +5904,7 @@
|
|
5904
5904
|
* _.isObject(null);
|
5905
5905
|
* // => false
|
5906
5906
|
*/
|
5907
|
-
function isObject(value) {
|
5907
|
+
function isObject$1(value) {
|
5908
5908
|
var type = typeof value;
|
5909
5909
|
return !!value && (type == 'object' || type == 'function');
|
5910
5910
|
}
|
@@ -5933,7 +5933,7 @@
|
|
5933
5933
|
* _.isObjectLike(null);
|
5934
5934
|
* // => false
|
5935
5935
|
*/
|
5936
|
-
function isObjectLike(value) {
|
5936
|
+
function isObjectLike$1(value) {
|
5937
5937
|
return !!value && typeof value == 'object';
|
5938
5938
|
}
|
5939
5939
|
|
@@ -5956,7 +5956,7 @@
|
|
5956
5956
|
*/
|
5957
5957
|
function isSymbol(value) {
|
5958
5958
|
return typeof value == 'symbol' ||
|
5959
|
-
(isObjectLike(value) && objectToString.call(value) == symbolTag);
|
5959
|
+
(isObjectLike$1(value) && objectToString$1.call(value) == symbolTag$2);
|
5960
5960
|
}
|
5961
5961
|
|
5962
5962
|
/**
|
@@ -5989,9 +5989,9 @@
|
|
5989
5989
|
if (isSymbol(value)) {
|
5990
5990
|
return NAN;
|
5991
5991
|
}
|
5992
|
-
if (isObject(value)) {
|
5992
|
+
if (isObject$1(value)) {
|
5993
5993
|
var other = typeof value.valueOf == 'function' ? value.valueOf() : value;
|
5994
|
-
value = isObject(other) ? (other + '') : other;
|
5994
|
+
value = isObject$1(other) ? (other + '') : other;
|
5995
5995
|
}
|
5996
5996
|
if (typeof value != 'string') {
|
5997
5997
|
return value === 0 ? value : +value;
|
@@ -10947,12 +10947,6 @@
|
|
10947
10947
|
|
10948
10948
|
stopPropagation && e.stopPropagation();
|
10949
10949
|
|
10950
|
-
if (bouncingRef.current) {
|
10951
|
-
bouncingRef.current = false;
|
10952
|
-
jumpTo(index, false);
|
10953
|
-
return;
|
10954
|
-
}
|
10955
|
-
|
10956
10950
|
if (!touchStartedRef.current) {
|
10957
10951
|
return;
|
10958
10952
|
}
|
@@ -10964,7 +10958,14 @@
|
|
10964
10958
|
return;
|
10965
10959
|
}
|
10966
10960
|
|
10967
|
-
touchMovedRef.current = false;
|
10961
|
+
touchMovedRef.current = false; // bugfix: 回弹判断逻辑需在touchMovedRef标识重置逻辑之后,否则会在触发回弹后导致标识无法重置引起滑动判断问题
|
10962
|
+
// @en bugfix: The logic for the bounce judgment needs to be after the touchMovedRef reset logic, otherwise it will cause the problem of slide judgment after the bounce is triggered.
|
10963
|
+
|
10964
|
+
if (bouncingRef.current) {
|
10965
|
+
bouncingRef.current = false;
|
10966
|
+
jumpTo(index, false);
|
10967
|
+
return;
|
10968
|
+
}
|
10968
10969
|
|
10969
10970
|
if (posAdjustingRef.current || touchStoppedRef.current) {
|
10970
10971
|
return;
|
@@ -12317,12 +12318,12 @@
|
|
12317
12318
|
var inBrowser = typeof window !== 'undefined'; // 判断根元素
|
12318
12319
|
// @en Determine the root element
|
12319
12320
|
|
12320
|
-
var root = inBrowser ? window : global; // 根据id清除对应的animationFrame
|
12321
|
+
var root$1 = inBrowser ? window : global; // 根据id清除对应的animationFrame
|
12321
12322
|
// @en Clear the corresponding animationFrame according to the id
|
12322
12323
|
|
12323
12324
|
function cancelRaf(id) {
|
12324
|
-
var cancelAnimationFrame = root.cancelAnimationFrame || root.clearTimeout;
|
12325
|
-
cancelAnimationFrame.call(root, id);
|
12325
|
+
var cancelAnimationFrame = root$1.cancelAnimationFrame || root$1.clearTimeout;
|
12326
|
+
cancelAnimationFrame.call(root$1, id);
|
12326
12327
|
} // 计算现在时间
|
12327
12328
|
// @en Calculate the current time
|
12328
12329
|
|
@@ -12340,8 +12341,8 @@
|
|
12340
12341
|
|
12341
12342
|
|
12342
12343
|
function raf(fn) {
|
12343
|
-
var requestAnimationFrame = root.requestAnimationFrame || rafPolyfill;
|
12344
|
-
return requestAnimationFrame.call(root, fn);
|
12344
|
+
var requestAnimationFrame = root$1.requestAnimationFrame || rafPolyfill;
|
12345
|
+
return requestAnimationFrame.call(root$1, fn);
|
12345
12346
|
} // 补0成需要的格式
|
12346
12347
|
// @en Fill 0 into the required format
|
12347
12348
|
|
@@ -13224,7 +13225,7 @@
|
|
13224
13225
|
}));
|
13225
13226
|
});
|
13226
13227
|
|
13227
|
-
var isArray = function isArray(dt) {
|
13228
|
+
var isArray$1 = function isArray(dt) {
|
13228
13229
|
return dt ? Array.isArray(dt[0]) : false;
|
13229
13230
|
};
|
13230
13231
|
|
@@ -13281,7 +13282,7 @@
|
|
13281
13282
|
var innerData = React.useMemo(function () {
|
13282
13283
|
var newData;
|
13283
13284
|
|
13284
|
-
if (isArray(data)) {
|
13285
|
+
if (isArray$1(data)) {
|
13285
13286
|
if (isStrOrNum(data)) {
|
13286
13287
|
newData = data.map(function (item) {
|
13287
13288
|
return item.map(function (cell) {
|
@@ -14930,7 +14931,7 @@
|
|
14930
14931
|
* */
|
14931
14932
|
|
14932
14933
|
function isCascadeArray(options) {
|
14933
|
-
return typeof options[0] === 'object' && !isArray$
|
14934
|
+
return typeof options[0] === 'object' && !isArray$2(options[0]);
|
14934
14935
|
}
|
14935
14936
|
/**
|
14936
14937
|
* 格式化传入的数组
|
@@ -16341,9 +16342,11 @@
|
|
16341
16342
|
currentText += temp;
|
16342
16343
|
l = m;
|
16343
16344
|
}
|
16344
|
-
} // Remove the
|
16345
|
+
} // Remove the last character if it is orphaned high-surrogate characters (indicative of incomplete emoji).
|
16345
16346
|
|
16346
16347
|
|
16348
|
+
currentText = currentText.replace(/[\uD800-\uDBFF]+$/, ''); // Remove the exclude char at the end of the content.
|
16349
|
+
|
16347
16350
|
while (endExcludes && endExcludes.includes(currentText[currentText.length - 1])) {
|
16348
16351
|
currentText = currentText.slice(0, -1);
|
16349
16352
|
} // Callback after reflow.
|
@@ -17789,188 +17792,2860 @@
|
|
17789
17792
|
|
17790
17793
|
});
|
17791
17794
|
|
17792
|
-
|
17795
|
+
// 注意:自动识别form关联组件的依据,请勿轻易改变代码结构
|
17796
|
+
// Notice: Automatically identify the basis of the associated component of the form, DO NOT change the code structure.
|
17797
|
+
var FormInternalComponentType;
|
17793
17798
|
|
17794
|
-
|
17795
|
-
|
17796
|
-
|
17797
|
-
|
17798
|
-
|
17799
|
-
|
17800
|
-
|
17801
|
-
|
17802
|
-
|
17803
|
-
|
17804
|
-
|
17805
|
-
|
17806
|
-
|
17807
|
-
|
17808
|
-
|
17809
|
-
},
|
17810
|
-
registerField: function registerField(_name, _self) {
|
17811
|
-
return function () {};
|
17812
|
-
},
|
17813
|
-
resetFields: defaultFunc,
|
17814
|
-
validateFields: defaultFunc,
|
17815
|
-
submit: defaultFunc,
|
17816
|
-
getInternalHooks: function getInternalHooks() {
|
17817
|
-
return {
|
17818
|
-
registerField: defaultFunc,
|
17819
|
-
setInitialValues: defaultFunc,
|
17820
|
-
setCallbacks: defaultFunc
|
17821
|
-
};
|
17822
|
-
}
|
17823
|
-
}; // 在field的静态的状态下设置
|
17799
|
+
(function (FormInternalComponentType) {
|
17800
|
+
FormInternalComponentType["Input"] = "Input";
|
17801
|
+
FormInternalComponentType["Textarea"] = "Textarea";
|
17802
|
+
FormInternalComponentType["Checkbox"] = "Checkbox";
|
17803
|
+
FormInternalComponentType["CheckboxGroup"] = "CheckboxGroup";
|
17804
|
+
FormInternalComponentType["DatePicker"] = "DatePicker";
|
17805
|
+
FormInternalComponentType["Picker"] = "Picker";
|
17806
|
+
FormInternalComponentType["Radio"] = "Radio";
|
17807
|
+
FormInternalComponentType["RadioGroup"] = "RadioGroup";
|
17808
|
+
FormInternalComponentType["Slider"] = "Slider";
|
17809
|
+
FormInternalComponentType["Switch"] = "Switch";
|
17810
|
+
FormInternalComponentType["ImagePicker"] = "ImagePicker";
|
17811
|
+
FormInternalComponentType["Rate"] = "Rate";
|
17812
|
+
FormInternalComponentType["Stepper"] = "Stepper";
|
17813
|
+
})(FormInternalComponentType || (FormInternalComponentType = {}));
|
17824
17814
|
|
17825
|
-
var
|
17826
|
-
/** @class */
|
17827
|
-
function () {
|
17828
|
-
function FormData() {
|
17829
|
-
var _this = this;
|
17815
|
+
var ValidateStatus;
|
17830
17816
|
|
17831
|
-
|
17817
|
+
(function (ValidateStatus) {
|
17818
|
+
ValidateStatus["Init"] = "init";
|
17819
|
+
ValidateStatus["Error"] = "error";
|
17820
|
+
ValidateStatus["Warning"] = "warning";
|
17821
|
+
ValidateStatus["Validating"] = "validating";
|
17822
|
+
ValidateStatus["Success"] = "success";
|
17823
|
+
})(ValidateStatus || (ValidateStatus = {}));
|
17832
17824
|
|
17833
|
-
|
17825
|
+
var ValueChangeType;
|
17834
17826
|
|
17835
|
-
|
17827
|
+
(function (ValueChangeType) {
|
17828
|
+
/* form update */
|
17829
|
+
ValueChangeType[ValueChangeType["Update"] = 0] = "Update";
|
17830
|
+
/* form clear */
|
17836
17831
|
|
17837
|
-
|
17832
|
+
ValueChangeType[ValueChangeType["Reset"] = 1] = "Reset";
|
17833
|
+
})(ValueChangeType || (ValueChangeType = {}));
|
17838
17834
|
|
17839
|
-
|
17840
|
-
|
17841
|
-
|
17835
|
+
/**
|
17836
|
+
* Removes all key-value entries from the list cache.
|
17837
|
+
*
|
17838
|
+
* @private
|
17839
|
+
* @name clear
|
17840
|
+
* @memberOf ListCache
|
17841
|
+
*/
|
17842
|
+
function listCacheClear() {
|
17843
|
+
this.__data__ = [];
|
17844
|
+
this.size = 0;
|
17845
|
+
}
|
17842
17846
|
|
17843
|
-
|
17844
|
-
}, {});
|
17845
|
-
_this._formData = __assign$3(__assign$3({}, _this._formData), values);
|
17846
|
-
var onValuesChange = _this._callbacks.onValuesChange;
|
17847
|
-
onValuesChange && onValuesChange(values, _this._formData);
|
17847
|
+
var _listCacheClear = listCacheClear;
|
17848
17848
|
|
17849
|
-
|
17849
|
+
/**
|
17850
|
+
* Performs a
|
17851
|
+
* [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
|
17852
|
+
* comparison between two values to determine if they are equivalent.
|
17853
|
+
*
|
17854
|
+
* @static
|
17855
|
+
* @memberOf _
|
17856
|
+
* @since 4.0.0
|
17857
|
+
* @category Lang
|
17858
|
+
* @param {*} value The value to compare.
|
17859
|
+
* @param {*} other The other value to compare.
|
17860
|
+
* @returns {boolean} Returns `true` if the values are equivalent, else `false`.
|
17861
|
+
* @example
|
17862
|
+
*
|
17863
|
+
* var object = { 'a': 1 };
|
17864
|
+
* var other = { 'a': 1 };
|
17865
|
+
*
|
17866
|
+
* _.eq(object, object);
|
17867
|
+
* // => true
|
17868
|
+
*
|
17869
|
+
* _.eq(object, other);
|
17870
|
+
* // => false
|
17871
|
+
*
|
17872
|
+
* _.eq('a', 'a');
|
17873
|
+
* // => true
|
17874
|
+
*
|
17875
|
+
* _.eq('a', Object('a'));
|
17876
|
+
* // => false
|
17877
|
+
*
|
17878
|
+
* _.eq(NaN, NaN);
|
17879
|
+
* // => true
|
17880
|
+
*/
|
17881
|
+
function eq(value, other) {
|
17882
|
+
return value === other || (value !== value && other !== other);
|
17883
|
+
}
|
17850
17884
|
|
17851
|
-
|
17852
|
-
};
|
17885
|
+
var eq_1 = eq;
|
17853
17886
|
|
17854
|
-
|
17855
|
-
|
17887
|
+
/**
|
17888
|
+
* Gets the index at which the `key` is found in `array` of key-value pairs.
|
17889
|
+
*
|
17890
|
+
* @private
|
17891
|
+
* @param {Array} array The array to inspect.
|
17892
|
+
* @param {*} key The key to search for.
|
17893
|
+
* @returns {number} Returns the index of the matched value, else `-1`.
|
17894
|
+
*/
|
17895
|
+
function assocIndexOf(array, key) {
|
17896
|
+
var length = array.length;
|
17897
|
+
while (length--) {
|
17898
|
+
if (eq_1(array[length][0], key)) {
|
17899
|
+
return length;
|
17900
|
+
}
|
17901
|
+
}
|
17902
|
+
return -1;
|
17903
|
+
}
|
17856
17904
|
|
17857
|
-
|
17858
|
-
_this._formData = __assign$3(__assign$3({}, _this._formData), (_b = {}, _b[name] = value, _b));
|
17859
|
-
var onValuesChange = _this._callbacks.onValuesChange;
|
17860
|
-
onValuesChange && onValuesChange((_c = {}, _c[name] = value, _c), _this._formData);
|
17905
|
+
var _assocIndexOf = assocIndexOf;
|
17861
17906
|
|
17862
|
-
|
17907
|
+
/** Used for built-in method references. */
|
17908
|
+
var arrayProto = Array.prototype;
|
17863
17909
|
|
17864
|
-
|
17865
|
-
|
17910
|
+
/** Built-in value references. */
|
17911
|
+
var splice = arrayProto.splice;
|
17866
17912
|
|
17867
|
-
|
17868
|
-
|
17869
|
-
|
17913
|
+
/**
|
17914
|
+
* Removes `key` and its value from the list cache.
|
17915
|
+
*
|
17916
|
+
* @private
|
17917
|
+
* @name delete
|
17918
|
+
* @memberOf ListCache
|
17919
|
+
* @param {string} key The key of the value to remove.
|
17920
|
+
* @returns {boolean} Returns `true` if the entry was removed, else `false`.
|
17921
|
+
*/
|
17922
|
+
function listCacheDelete(key) {
|
17923
|
+
var data = this.__data__,
|
17924
|
+
index = _assocIndexOf(data, key);
|
17870
17925
|
|
17871
|
-
|
17926
|
+
if (index < 0) {
|
17927
|
+
return false;
|
17928
|
+
}
|
17929
|
+
var lastIndex = data.length - 1;
|
17930
|
+
if (index == lastIndex) {
|
17931
|
+
data.pop();
|
17932
|
+
} else {
|
17933
|
+
splice.call(data, index, 1);
|
17934
|
+
}
|
17935
|
+
--this.size;
|
17936
|
+
return true;
|
17937
|
+
}
|
17872
17938
|
|
17873
|
-
|
17874
|
-
fieldObj.onValueChange(values[fieldName], oldValues[fieldName]);
|
17875
|
-
}
|
17876
|
-
});
|
17877
|
-
};
|
17939
|
+
var _listCacheDelete = listCacheDelete;
|
17878
17940
|
|
17879
|
-
|
17880
|
-
|
17881
|
-
|
17882
|
-
|
17883
|
-
|
17884
|
-
|
17941
|
+
/**
|
17942
|
+
* Gets the list cache value for `key`.
|
17943
|
+
*
|
17944
|
+
* @private
|
17945
|
+
* @name get
|
17946
|
+
* @memberOf ListCache
|
17947
|
+
* @param {string} key The key of the value to get.
|
17948
|
+
* @returns {*} Returns the entry value.
|
17949
|
+
*/
|
17950
|
+
function listCacheGet(key) {
|
17951
|
+
var data = this.__data__,
|
17952
|
+
index = _assocIndexOf(data, key);
|
17885
17953
|
|
17886
|
-
|
17887
|
-
|
17954
|
+
return index < 0 ? undefined : data[index][1];
|
17955
|
+
}
|
17888
17956
|
|
17889
|
-
|
17890
|
-
var _a;
|
17957
|
+
var _listCacheGet = listCacheGet;
|
17891
17958
|
|
17892
|
-
|
17893
|
-
|
17959
|
+
/**
|
17960
|
+
* Checks if a list cache value for `key` exists.
|
17961
|
+
*
|
17962
|
+
* @private
|
17963
|
+
* @name has
|
17964
|
+
* @memberOf ListCache
|
17965
|
+
* @param {string} key The key of the entry to check.
|
17966
|
+
* @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
|
17967
|
+
*/
|
17968
|
+
function listCacheHas(key) {
|
17969
|
+
return _assocIndexOf(this.__data__, key) > -1;
|
17970
|
+
}
|
17894
17971
|
|
17895
|
-
|
17896
|
-
var _a;
|
17972
|
+
var _listCacheHas = listCacheHas;
|
17897
17973
|
|
17898
|
-
|
17974
|
+
/**
|
17975
|
+
* Sets the list cache `key` to `value`.
|
17976
|
+
*
|
17977
|
+
* @private
|
17978
|
+
* @name set
|
17979
|
+
* @memberOf ListCache
|
17980
|
+
* @param {string} key The key of the value to set.
|
17981
|
+
* @param {*} value The value to set.
|
17982
|
+
* @returns {Object} Returns the list cache instance.
|
17983
|
+
*/
|
17984
|
+
function listCacheSet(key, value) {
|
17985
|
+
var data = this.__data__,
|
17986
|
+
index = _assocIndexOf(data, key);
|
17899
17987
|
|
17900
|
-
|
17901
|
-
|
17902
|
-
|
17988
|
+
if (index < 0) {
|
17989
|
+
++this.size;
|
17990
|
+
data.push([key, value]);
|
17991
|
+
} else {
|
17992
|
+
data[index][1] = value;
|
17993
|
+
}
|
17994
|
+
return this;
|
17995
|
+
}
|
17903
17996
|
|
17904
|
-
|
17905
|
-
};
|
17997
|
+
var _listCacheSet = listCacheSet;
|
17906
17998
|
|
17907
|
-
|
17908
|
-
|
17909
|
-
|
17910
|
-
|
17999
|
+
/**
|
18000
|
+
* Creates an list cache object.
|
18001
|
+
*
|
18002
|
+
* @private
|
18003
|
+
* @constructor
|
18004
|
+
* @param {Array} [entries] The key-value pairs to cache.
|
18005
|
+
*/
|
18006
|
+
function ListCache(entries) {
|
18007
|
+
var index = -1,
|
18008
|
+
length = entries == null ? 0 : entries.length;
|
17911
18009
|
|
17912
|
-
|
18010
|
+
this.clear();
|
18011
|
+
while (++index < length) {
|
18012
|
+
var entry = entries[index];
|
18013
|
+
this.set(entry[0], entry[1]);
|
18014
|
+
}
|
18015
|
+
}
|
17913
18016
|
|
17914
|
-
|
17915
|
-
|
17916
|
-
|
18017
|
+
// Add methods to `ListCache`.
|
18018
|
+
ListCache.prototype.clear = _listCacheClear;
|
18019
|
+
ListCache.prototype['delete'] = _listCacheDelete;
|
18020
|
+
ListCache.prototype.get = _listCacheGet;
|
18021
|
+
ListCache.prototype.has = _listCacheHas;
|
18022
|
+
ListCache.prototype.set = _listCacheSet;
|
17917
18023
|
|
17918
|
-
|
17919
|
-
}, {});
|
17920
|
-
};
|
18024
|
+
var _ListCache = ListCache;
|
17921
18025
|
|
17922
|
-
|
17923
|
-
|
18026
|
+
/**
|
18027
|
+
* Removes all key-value entries from the stack.
|
18028
|
+
*
|
18029
|
+
* @private
|
18030
|
+
* @name clear
|
18031
|
+
* @memberOf Stack
|
18032
|
+
*/
|
18033
|
+
function stackClear() {
|
18034
|
+
this.__data__ = new _ListCache;
|
18035
|
+
this.size = 0;
|
18036
|
+
}
|
17924
18037
|
|
17925
|
-
|
18038
|
+
var _stackClear = stackClear;
|
17926
18039
|
|
17927
|
-
|
17928
|
-
|
17929
|
-
|
18040
|
+
/**
|
18041
|
+
* Removes `key` and its value from the stack.
|
18042
|
+
*
|
18043
|
+
* @private
|
18044
|
+
* @name delete
|
18045
|
+
* @memberOf Stack
|
18046
|
+
* @param {string} key The key of the value to remove.
|
18047
|
+
* @returns {boolean} Returns `true` if the entry was removed, else `false`.
|
18048
|
+
*/
|
18049
|
+
function stackDelete(key) {
|
18050
|
+
var data = this.__data__,
|
18051
|
+
result = data['delete'](key);
|
17930
18052
|
|
17931
|
-
|
17932
|
-
|
18053
|
+
this.size = data.size;
|
18054
|
+
return result;
|
18055
|
+
}
|
17933
18056
|
|
17934
|
-
|
17935
|
-
var _a, _b;
|
18057
|
+
var _stackDelete = stackDelete;
|
17936
18058
|
|
17937
|
-
|
17938
|
-
|
18059
|
+
/**
|
18060
|
+
* Gets the stack value for `key`.
|
18061
|
+
*
|
18062
|
+
* @private
|
18063
|
+
* @name get
|
18064
|
+
* @memberOf Stack
|
18065
|
+
* @param {string} key The key of the value to get.
|
18066
|
+
* @returns {*} Returns the entry value.
|
18067
|
+
*/
|
18068
|
+
function stackGet(key) {
|
18069
|
+
return this.__data__.get(key);
|
18070
|
+
}
|
17939
18071
|
|
17940
|
-
|
17941
|
-
_this._initialValues = __assign$3(__assign$3({}, _this._initialValues), (_a = {}, _a[name] = initialValue, _a));
|
18072
|
+
var _stackGet = stackGet;
|
17942
18073
|
|
17943
|
-
|
17944
|
-
|
18074
|
+
/**
|
18075
|
+
* Checks if a stack value for `key` exists.
|
18076
|
+
*
|
18077
|
+
* @private
|
18078
|
+
* @name has
|
18079
|
+
* @memberOf Stack
|
18080
|
+
* @param {string} key The key of the entry to check.
|
18081
|
+
* @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
|
18082
|
+
*/
|
18083
|
+
function stackHas(key) {
|
18084
|
+
return this.__data__.has(key);
|
18085
|
+
}
|
17945
18086
|
|
17946
|
-
|
17947
|
-
if (name in _this._fieldsList) {
|
17948
|
-
delete _this._fieldsList[name];
|
17949
|
-
delete _this._formData[name];
|
17950
|
-
}
|
17951
|
-
};
|
17952
|
-
};
|
18087
|
+
var _stackHas = stackHas;
|
17953
18088
|
|
17954
|
-
|
17955
|
-
|
18089
|
+
/** Detect free variable `global` from Node.js. */
|
18090
|
+
var freeGlobal = typeof commonjsGlobal == 'object' && commonjsGlobal && commonjsGlobal.Object === Object && commonjsGlobal;
|
17956
18091
|
|
17957
|
-
|
17958
|
-
};
|
18092
|
+
var _freeGlobal = freeGlobal;
|
17959
18093
|
|
17960
|
-
|
17961
|
-
|
17962
|
-
};
|
18094
|
+
/** Detect free variable `self`. */
|
18095
|
+
var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
|
17963
18096
|
|
17964
|
-
|
17965
|
-
|
17966
|
-
|
17967
|
-
|
17968
|
-
|
17969
|
-
|
17970
|
-
|
17971
|
-
|
17972
|
-
|
17973
|
-
|
18097
|
+
/** Used as a reference to the global object. */
|
18098
|
+
var root = _freeGlobal || freeSelf || Function('return this')();
|
18099
|
+
|
18100
|
+
var _root = root;
|
18101
|
+
|
18102
|
+
/** Built-in value references. */
|
18103
|
+
var Symbol = _root.Symbol;
|
18104
|
+
|
18105
|
+
var _Symbol = Symbol;
|
18106
|
+
|
18107
|
+
/** Used for built-in method references. */
|
18108
|
+
var objectProto$c = Object.prototype;
|
18109
|
+
|
18110
|
+
/** Used to check objects for own properties. */
|
18111
|
+
var hasOwnProperty$9 = objectProto$c.hasOwnProperty;
|
18112
|
+
|
18113
|
+
/**
|
18114
|
+
* Used to resolve the
|
18115
|
+
* [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
|
18116
|
+
* of values.
|
18117
|
+
*/
|
18118
|
+
var nativeObjectToString$1 = objectProto$c.toString;
|
18119
|
+
|
18120
|
+
/** Built-in value references. */
|
18121
|
+
var symToStringTag$1 = _Symbol ? _Symbol.toStringTag : undefined;
|
18122
|
+
|
18123
|
+
/**
|
18124
|
+
* A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.
|
18125
|
+
*
|
18126
|
+
* @private
|
18127
|
+
* @param {*} value The value to query.
|
18128
|
+
* @returns {string} Returns the raw `toStringTag`.
|
18129
|
+
*/
|
18130
|
+
function getRawTag(value) {
|
18131
|
+
var isOwn = hasOwnProperty$9.call(value, symToStringTag$1),
|
18132
|
+
tag = value[symToStringTag$1];
|
18133
|
+
|
18134
|
+
try {
|
18135
|
+
value[symToStringTag$1] = undefined;
|
18136
|
+
var unmasked = true;
|
18137
|
+
} catch (e) {}
|
18138
|
+
|
18139
|
+
var result = nativeObjectToString$1.call(value);
|
18140
|
+
if (unmasked) {
|
18141
|
+
if (isOwn) {
|
18142
|
+
value[symToStringTag$1] = tag;
|
18143
|
+
} else {
|
18144
|
+
delete value[symToStringTag$1];
|
18145
|
+
}
|
18146
|
+
}
|
18147
|
+
return result;
|
18148
|
+
}
|
18149
|
+
|
18150
|
+
var _getRawTag = getRawTag;
|
18151
|
+
|
18152
|
+
/** Used for built-in method references. */
|
18153
|
+
var objectProto$b = Object.prototype;
|
18154
|
+
|
18155
|
+
/**
|
18156
|
+
* Used to resolve the
|
18157
|
+
* [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
|
18158
|
+
* of values.
|
18159
|
+
*/
|
18160
|
+
var nativeObjectToString = objectProto$b.toString;
|
18161
|
+
|
18162
|
+
/**
|
18163
|
+
* Converts `value` to a string using `Object.prototype.toString`.
|
18164
|
+
*
|
18165
|
+
* @private
|
18166
|
+
* @param {*} value The value to convert.
|
18167
|
+
* @returns {string} Returns the converted string.
|
18168
|
+
*/
|
18169
|
+
function objectToString(value) {
|
18170
|
+
return nativeObjectToString.call(value);
|
18171
|
+
}
|
18172
|
+
|
18173
|
+
var _objectToString = objectToString;
|
18174
|
+
|
18175
|
+
/** `Object#toString` result references. */
|
18176
|
+
var nullTag = '[object Null]',
|
18177
|
+
undefinedTag = '[object Undefined]';
|
18178
|
+
|
18179
|
+
/** Built-in value references. */
|
18180
|
+
var symToStringTag = _Symbol ? _Symbol.toStringTag : undefined;
|
18181
|
+
|
18182
|
+
/**
|
18183
|
+
* The base implementation of `getTag` without fallbacks for buggy environments.
|
18184
|
+
*
|
18185
|
+
* @private
|
18186
|
+
* @param {*} value The value to query.
|
18187
|
+
* @returns {string} Returns the `toStringTag`.
|
18188
|
+
*/
|
18189
|
+
function baseGetTag(value) {
|
18190
|
+
if (value == null) {
|
18191
|
+
return value === undefined ? undefinedTag : nullTag;
|
18192
|
+
}
|
18193
|
+
return (symToStringTag && symToStringTag in Object(value))
|
18194
|
+
? _getRawTag(value)
|
18195
|
+
: _objectToString(value);
|
18196
|
+
}
|
18197
|
+
|
18198
|
+
var _baseGetTag = baseGetTag;
|
18199
|
+
|
18200
|
+
/**
|
18201
|
+
* Checks if `value` is the
|
18202
|
+
* [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
|
18203
|
+
* of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
|
18204
|
+
*
|
18205
|
+
* @static
|
18206
|
+
* @memberOf _
|
18207
|
+
* @since 0.1.0
|
18208
|
+
* @category Lang
|
18209
|
+
* @param {*} value The value to check.
|
18210
|
+
* @returns {boolean} Returns `true` if `value` is an object, else `false`.
|
18211
|
+
* @example
|
18212
|
+
*
|
18213
|
+
* _.isObject({});
|
18214
|
+
* // => true
|
18215
|
+
*
|
18216
|
+
* _.isObject([1, 2, 3]);
|
18217
|
+
* // => true
|
18218
|
+
*
|
18219
|
+
* _.isObject(_.noop);
|
18220
|
+
* // => true
|
18221
|
+
*
|
18222
|
+
* _.isObject(null);
|
18223
|
+
* // => false
|
18224
|
+
*/
|
18225
|
+
function isObject(value) {
|
18226
|
+
var type = typeof value;
|
18227
|
+
return value != null && (type == 'object' || type == 'function');
|
18228
|
+
}
|
18229
|
+
|
18230
|
+
var isObject_1 = isObject;
|
18231
|
+
|
18232
|
+
/** `Object#toString` result references. */
|
18233
|
+
var asyncTag = '[object AsyncFunction]',
|
18234
|
+
funcTag$2 = '[object Function]',
|
18235
|
+
genTag$1 = '[object GeneratorFunction]',
|
18236
|
+
proxyTag = '[object Proxy]';
|
18237
|
+
|
18238
|
+
/**
|
18239
|
+
* Checks if `value` is classified as a `Function` object.
|
18240
|
+
*
|
18241
|
+
* @static
|
18242
|
+
* @memberOf _
|
18243
|
+
* @since 0.1.0
|
18244
|
+
* @category Lang
|
18245
|
+
* @param {*} value The value to check.
|
18246
|
+
* @returns {boolean} Returns `true` if `value` is a function, else `false`.
|
18247
|
+
* @example
|
18248
|
+
*
|
18249
|
+
* _.isFunction(_);
|
18250
|
+
* // => true
|
18251
|
+
*
|
18252
|
+
* _.isFunction(/abc/);
|
18253
|
+
* // => false
|
18254
|
+
*/
|
18255
|
+
function isFunction(value) {
|
18256
|
+
if (!isObject_1(value)) {
|
18257
|
+
return false;
|
18258
|
+
}
|
18259
|
+
// The use of `Object#toString` avoids issues with the `typeof` operator
|
18260
|
+
// in Safari 9 which returns 'object' for typed arrays and other constructors.
|
18261
|
+
var tag = _baseGetTag(value);
|
18262
|
+
return tag == funcTag$2 || tag == genTag$1 || tag == asyncTag || tag == proxyTag;
|
18263
|
+
}
|
18264
|
+
|
18265
|
+
var isFunction_1 = isFunction;
|
18266
|
+
|
18267
|
+
/** Used to detect overreaching core-js shims. */
|
18268
|
+
var coreJsData = _root['__core-js_shared__'];
|
18269
|
+
|
18270
|
+
var _coreJsData = coreJsData;
|
18271
|
+
|
18272
|
+
/** Used to detect methods masquerading as native. */
|
18273
|
+
var maskSrcKey = (function() {
|
18274
|
+
var uid = /[^.]+$/.exec(_coreJsData && _coreJsData.keys && _coreJsData.keys.IE_PROTO || '');
|
18275
|
+
return uid ? ('Symbol(src)_1.' + uid) : '';
|
18276
|
+
}());
|
18277
|
+
|
18278
|
+
/**
|
18279
|
+
* Checks if `func` has its source masked.
|
18280
|
+
*
|
18281
|
+
* @private
|
18282
|
+
* @param {Function} func The function to check.
|
18283
|
+
* @returns {boolean} Returns `true` if `func` is masked, else `false`.
|
18284
|
+
*/
|
18285
|
+
function isMasked(func) {
|
18286
|
+
return !!maskSrcKey && (maskSrcKey in func);
|
18287
|
+
}
|
18288
|
+
|
18289
|
+
var _isMasked = isMasked;
|
18290
|
+
|
18291
|
+
/** Used for built-in method references. */
|
18292
|
+
var funcProto$1 = Function.prototype;
|
18293
|
+
|
18294
|
+
/** Used to resolve the decompiled source of functions. */
|
18295
|
+
var funcToString$1 = funcProto$1.toString;
|
18296
|
+
|
18297
|
+
/**
|
18298
|
+
* Converts `func` to its source code.
|
18299
|
+
*
|
18300
|
+
* @private
|
18301
|
+
* @param {Function} func The function to convert.
|
18302
|
+
* @returns {string} Returns the source code.
|
18303
|
+
*/
|
18304
|
+
function toSource(func) {
|
18305
|
+
if (func != null) {
|
18306
|
+
try {
|
18307
|
+
return funcToString$1.call(func);
|
18308
|
+
} catch (e) {}
|
18309
|
+
try {
|
18310
|
+
return (func + '');
|
18311
|
+
} catch (e) {}
|
18312
|
+
}
|
18313
|
+
return '';
|
18314
|
+
}
|
18315
|
+
|
18316
|
+
var _toSource = toSource;
|
18317
|
+
|
18318
|
+
/**
|
18319
|
+
* Used to match `RegExp`
|
18320
|
+
* [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).
|
18321
|
+
*/
|
18322
|
+
var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
|
18323
|
+
|
18324
|
+
/** Used to detect host constructors (Safari). */
|
18325
|
+
var reIsHostCtor = /^\[object .+?Constructor\]$/;
|
18326
|
+
|
18327
|
+
/** Used for built-in method references. */
|
18328
|
+
var funcProto = Function.prototype,
|
18329
|
+
objectProto$a = Object.prototype;
|
18330
|
+
|
18331
|
+
/** Used to resolve the decompiled source of functions. */
|
18332
|
+
var funcToString = funcProto.toString;
|
18333
|
+
|
18334
|
+
/** Used to check objects for own properties. */
|
18335
|
+
var hasOwnProperty$8 = objectProto$a.hasOwnProperty;
|
18336
|
+
|
18337
|
+
/** Used to detect if a method is native. */
|
18338
|
+
var reIsNative = RegExp('^' +
|
18339
|
+
funcToString.call(hasOwnProperty$8).replace(reRegExpChar, '\\$&')
|
18340
|
+
.replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$'
|
18341
|
+
);
|
18342
|
+
|
18343
|
+
/**
|
18344
|
+
* The base implementation of `_.isNative` without bad shim checks.
|
18345
|
+
*
|
18346
|
+
* @private
|
18347
|
+
* @param {*} value The value to check.
|
18348
|
+
* @returns {boolean} Returns `true` if `value` is a native function,
|
18349
|
+
* else `false`.
|
18350
|
+
*/
|
18351
|
+
function baseIsNative(value) {
|
18352
|
+
if (!isObject_1(value) || _isMasked(value)) {
|
18353
|
+
return false;
|
18354
|
+
}
|
18355
|
+
var pattern = isFunction_1(value) ? reIsNative : reIsHostCtor;
|
18356
|
+
return pattern.test(_toSource(value));
|
18357
|
+
}
|
18358
|
+
|
18359
|
+
var _baseIsNative = baseIsNative;
|
18360
|
+
|
18361
|
+
/**
|
18362
|
+
* Gets the value at `key` of `object`.
|
18363
|
+
*
|
18364
|
+
* @private
|
18365
|
+
* @param {Object} [object] The object to query.
|
18366
|
+
* @param {string} key The key of the property to get.
|
18367
|
+
* @returns {*} Returns the property value.
|
18368
|
+
*/
|
18369
|
+
function getValue(object, key) {
|
18370
|
+
return object == null ? undefined : object[key];
|
18371
|
+
}
|
18372
|
+
|
18373
|
+
var _getValue = getValue;
|
18374
|
+
|
18375
|
+
/**
|
18376
|
+
* Gets the native function at `key` of `object`.
|
18377
|
+
*
|
18378
|
+
* @private
|
18379
|
+
* @param {Object} object The object to query.
|
18380
|
+
* @param {string} key The key of the method to get.
|
18381
|
+
* @returns {*} Returns the function if it's native, else `undefined`.
|
18382
|
+
*/
|
18383
|
+
function getNative(object, key) {
|
18384
|
+
var value = _getValue(object, key);
|
18385
|
+
return _baseIsNative(value) ? value : undefined;
|
18386
|
+
}
|
18387
|
+
|
18388
|
+
var _getNative = getNative;
|
18389
|
+
|
18390
|
+
/* Built-in method references that are verified to be native. */
|
18391
|
+
var Map$1 = _getNative(_root, 'Map');
|
18392
|
+
|
18393
|
+
var _Map = Map$1;
|
18394
|
+
|
18395
|
+
/* Built-in method references that are verified to be native. */
|
18396
|
+
var nativeCreate = _getNative(Object, 'create');
|
18397
|
+
|
18398
|
+
var _nativeCreate = nativeCreate;
|
18399
|
+
|
18400
|
+
/**
|
18401
|
+
* Removes all key-value entries from the hash.
|
18402
|
+
*
|
18403
|
+
* @private
|
18404
|
+
* @name clear
|
18405
|
+
* @memberOf Hash
|
18406
|
+
*/
|
18407
|
+
function hashClear() {
|
18408
|
+
this.__data__ = _nativeCreate ? _nativeCreate(null) : {};
|
18409
|
+
this.size = 0;
|
18410
|
+
}
|
18411
|
+
|
18412
|
+
var _hashClear = hashClear;
|
18413
|
+
|
18414
|
+
/**
|
18415
|
+
* Removes `key` and its value from the hash.
|
18416
|
+
*
|
18417
|
+
* @private
|
18418
|
+
* @name delete
|
18419
|
+
* @memberOf Hash
|
18420
|
+
* @param {Object} hash The hash to modify.
|
18421
|
+
* @param {string} key The key of the value to remove.
|
18422
|
+
* @returns {boolean} Returns `true` if the entry was removed, else `false`.
|
18423
|
+
*/
|
18424
|
+
function hashDelete(key) {
|
18425
|
+
var result = this.has(key) && delete this.__data__[key];
|
18426
|
+
this.size -= result ? 1 : 0;
|
18427
|
+
return result;
|
18428
|
+
}
|
18429
|
+
|
18430
|
+
var _hashDelete = hashDelete;
|
18431
|
+
|
18432
|
+
/** Used to stand-in for `undefined` hash values. */
|
18433
|
+
var HASH_UNDEFINED$1 = '__lodash_hash_undefined__';
|
18434
|
+
|
18435
|
+
/** Used for built-in method references. */
|
18436
|
+
var objectProto$9 = Object.prototype;
|
18437
|
+
|
18438
|
+
/** Used to check objects for own properties. */
|
18439
|
+
var hasOwnProperty$7 = objectProto$9.hasOwnProperty;
|
18440
|
+
|
18441
|
+
/**
|
18442
|
+
* Gets the hash value for `key`.
|
18443
|
+
*
|
18444
|
+
* @private
|
18445
|
+
* @name get
|
18446
|
+
* @memberOf Hash
|
18447
|
+
* @param {string} key The key of the value to get.
|
18448
|
+
* @returns {*} Returns the entry value.
|
18449
|
+
*/
|
18450
|
+
function hashGet(key) {
|
18451
|
+
var data = this.__data__;
|
18452
|
+
if (_nativeCreate) {
|
18453
|
+
var result = data[key];
|
18454
|
+
return result === HASH_UNDEFINED$1 ? undefined : result;
|
18455
|
+
}
|
18456
|
+
return hasOwnProperty$7.call(data, key) ? data[key] : undefined;
|
18457
|
+
}
|
18458
|
+
|
18459
|
+
var _hashGet = hashGet;
|
18460
|
+
|
18461
|
+
/** Used for built-in method references. */
|
18462
|
+
var objectProto$8 = Object.prototype;
|
18463
|
+
|
18464
|
+
/** Used to check objects for own properties. */
|
18465
|
+
var hasOwnProperty$6 = objectProto$8.hasOwnProperty;
|
18466
|
+
|
18467
|
+
/**
|
18468
|
+
* Checks if a hash value for `key` exists.
|
18469
|
+
*
|
18470
|
+
* @private
|
18471
|
+
* @name has
|
18472
|
+
* @memberOf Hash
|
18473
|
+
* @param {string} key The key of the entry to check.
|
18474
|
+
* @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
|
18475
|
+
*/
|
18476
|
+
function hashHas(key) {
|
18477
|
+
var data = this.__data__;
|
18478
|
+
return _nativeCreate ? (data[key] !== undefined) : hasOwnProperty$6.call(data, key);
|
18479
|
+
}
|
18480
|
+
|
18481
|
+
var _hashHas = hashHas;
|
18482
|
+
|
18483
|
+
/** Used to stand-in for `undefined` hash values. */
|
18484
|
+
var HASH_UNDEFINED = '__lodash_hash_undefined__';
|
18485
|
+
|
18486
|
+
/**
|
18487
|
+
* Sets the hash `key` to `value`.
|
18488
|
+
*
|
18489
|
+
* @private
|
18490
|
+
* @name set
|
18491
|
+
* @memberOf Hash
|
18492
|
+
* @param {string} key The key of the value to set.
|
18493
|
+
* @param {*} value The value to set.
|
18494
|
+
* @returns {Object} Returns the hash instance.
|
18495
|
+
*/
|
18496
|
+
function hashSet(key, value) {
|
18497
|
+
var data = this.__data__;
|
18498
|
+
this.size += this.has(key) ? 0 : 1;
|
18499
|
+
data[key] = (_nativeCreate && value === undefined) ? HASH_UNDEFINED : value;
|
18500
|
+
return this;
|
18501
|
+
}
|
18502
|
+
|
18503
|
+
var _hashSet = hashSet;
|
18504
|
+
|
18505
|
+
/**
|
18506
|
+
* Creates a hash object.
|
18507
|
+
*
|
18508
|
+
* @private
|
18509
|
+
* @constructor
|
18510
|
+
* @param {Array} [entries] The key-value pairs to cache.
|
18511
|
+
*/
|
18512
|
+
function Hash(entries) {
|
18513
|
+
var index = -1,
|
18514
|
+
length = entries == null ? 0 : entries.length;
|
18515
|
+
|
18516
|
+
this.clear();
|
18517
|
+
while (++index < length) {
|
18518
|
+
var entry = entries[index];
|
18519
|
+
this.set(entry[0], entry[1]);
|
18520
|
+
}
|
18521
|
+
}
|
18522
|
+
|
18523
|
+
// Add methods to `Hash`.
|
18524
|
+
Hash.prototype.clear = _hashClear;
|
18525
|
+
Hash.prototype['delete'] = _hashDelete;
|
18526
|
+
Hash.prototype.get = _hashGet;
|
18527
|
+
Hash.prototype.has = _hashHas;
|
18528
|
+
Hash.prototype.set = _hashSet;
|
18529
|
+
|
18530
|
+
var _Hash = Hash;
|
18531
|
+
|
18532
|
+
/**
|
18533
|
+
* Removes all key-value entries from the map.
|
18534
|
+
*
|
18535
|
+
* @private
|
18536
|
+
* @name clear
|
18537
|
+
* @memberOf MapCache
|
18538
|
+
*/
|
18539
|
+
function mapCacheClear() {
|
18540
|
+
this.size = 0;
|
18541
|
+
this.__data__ = {
|
18542
|
+
'hash': new _Hash,
|
18543
|
+
'map': new (_Map || _ListCache),
|
18544
|
+
'string': new _Hash
|
18545
|
+
};
|
18546
|
+
}
|
18547
|
+
|
18548
|
+
var _mapCacheClear = mapCacheClear;
|
18549
|
+
|
18550
|
+
/**
|
18551
|
+
* Checks if `value` is suitable for use as unique object key.
|
18552
|
+
*
|
18553
|
+
* @private
|
18554
|
+
* @param {*} value The value to check.
|
18555
|
+
* @returns {boolean} Returns `true` if `value` is suitable, else `false`.
|
18556
|
+
*/
|
18557
|
+
function isKeyable(value) {
|
18558
|
+
var type = typeof value;
|
18559
|
+
return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')
|
18560
|
+
? (value !== '__proto__')
|
18561
|
+
: (value === null);
|
18562
|
+
}
|
18563
|
+
|
18564
|
+
var _isKeyable = isKeyable;
|
18565
|
+
|
18566
|
+
/**
|
18567
|
+
* Gets the data for `map`.
|
18568
|
+
*
|
18569
|
+
* @private
|
18570
|
+
* @param {Object} map The map to query.
|
18571
|
+
* @param {string} key The reference key.
|
18572
|
+
* @returns {*} Returns the map data.
|
18573
|
+
*/
|
18574
|
+
function getMapData(map, key) {
|
18575
|
+
var data = map.__data__;
|
18576
|
+
return _isKeyable(key)
|
18577
|
+
? data[typeof key == 'string' ? 'string' : 'hash']
|
18578
|
+
: data.map;
|
18579
|
+
}
|
18580
|
+
|
18581
|
+
var _getMapData = getMapData;
|
18582
|
+
|
18583
|
+
/**
|
18584
|
+
* Removes `key` and its value from the map.
|
18585
|
+
*
|
18586
|
+
* @private
|
18587
|
+
* @name delete
|
18588
|
+
* @memberOf MapCache
|
18589
|
+
* @param {string} key The key of the value to remove.
|
18590
|
+
* @returns {boolean} Returns `true` if the entry was removed, else `false`.
|
18591
|
+
*/
|
18592
|
+
function mapCacheDelete(key) {
|
18593
|
+
var result = _getMapData(this, key)['delete'](key);
|
18594
|
+
this.size -= result ? 1 : 0;
|
18595
|
+
return result;
|
18596
|
+
}
|
18597
|
+
|
18598
|
+
var _mapCacheDelete = mapCacheDelete;
|
18599
|
+
|
18600
|
+
/**
|
18601
|
+
* Gets the map value for `key`.
|
18602
|
+
*
|
18603
|
+
* @private
|
18604
|
+
* @name get
|
18605
|
+
* @memberOf MapCache
|
18606
|
+
* @param {string} key The key of the value to get.
|
18607
|
+
* @returns {*} Returns the entry value.
|
18608
|
+
*/
|
18609
|
+
function mapCacheGet(key) {
|
18610
|
+
return _getMapData(this, key).get(key);
|
18611
|
+
}
|
18612
|
+
|
18613
|
+
var _mapCacheGet = mapCacheGet;
|
18614
|
+
|
18615
|
+
/**
|
18616
|
+
* Checks if a map value for `key` exists.
|
18617
|
+
*
|
18618
|
+
* @private
|
18619
|
+
* @name has
|
18620
|
+
* @memberOf MapCache
|
18621
|
+
* @param {string} key The key of the entry to check.
|
18622
|
+
* @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
|
18623
|
+
*/
|
18624
|
+
function mapCacheHas(key) {
|
18625
|
+
return _getMapData(this, key).has(key);
|
18626
|
+
}
|
18627
|
+
|
18628
|
+
var _mapCacheHas = mapCacheHas;
|
18629
|
+
|
18630
|
+
/**
|
18631
|
+
* Sets the map `key` to `value`.
|
18632
|
+
*
|
18633
|
+
* @private
|
18634
|
+
* @name set
|
18635
|
+
* @memberOf MapCache
|
18636
|
+
* @param {string} key The key of the value to set.
|
18637
|
+
* @param {*} value The value to set.
|
18638
|
+
* @returns {Object} Returns the map cache instance.
|
18639
|
+
*/
|
18640
|
+
function mapCacheSet(key, value) {
|
18641
|
+
var data = _getMapData(this, key),
|
18642
|
+
size = data.size;
|
18643
|
+
|
18644
|
+
data.set(key, value);
|
18645
|
+
this.size += data.size == size ? 0 : 1;
|
18646
|
+
return this;
|
18647
|
+
}
|
18648
|
+
|
18649
|
+
var _mapCacheSet = mapCacheSet;
|
18650
|
+
|
18651
|
+
/**
|
18652
|
+
* Creates a map cache object to store key-value pairs.
|
18653
|
+
*
|
18654
|
+
* @private
|
18655
|
+
* @constructor
|
18656
|
+
* @param {Array} [entries] The key-value pairs to cache.
|
18657
|
+
*/
|
18658
|
+
function MapCache(entries) {
|
18659
|
+
var index = -1,
|
18660
|
+
length = entries == null ? 0 : entries.length;
|
18661
|
+
|
18662
|
+
this.clear();
|
18663
|
+
while (++index < length) {
|
18664
|
+
var entry = entries[index];
|
18665
|
+
this.set(entry[0], entry[1]);
|
18666
|
+
}
|
18667
|
+
}
|
18668
|
+
|
18669
|
+
// Add methods to `MapCache`.
|
18670
|
+
MapCache.prototype.clear = _mapCacheClear;
|
18671
|
+
MapCache.prototype['delete'] = _mapCacheDelete;
|
18672
|
+
MapCache.prototype.get = _mapCacheGet;
|
18673
|
+
MapCache.prototype.has = _mapCacheHas;
|
18674
|
+
MapCache.prototype.set = _mapCacheSet;
|
18675
|
+
|
18676
|
+
var _MapCache = MapCache;
|
18677
|
+
|
18678
|
+
/** Used as the size to enable large array optimizations. */
|
18679
|
+
var LARGE_ARRAY_SIZE = 200;
|
18680
|
+
|
18681
|
+
/**
|
18682
|
+
* Sets the stack `key` to `value`.
|
18683
|
+
*
|
18684
|
+
* @private
|
18685
|
+
* @name set
|
18686
|
+
* @memberOf Stack
|
18687
|
+
* @param {string} key The key of the value to set.
|
18688
|
+
* @param {*} value The value to set.
|
18689
|
+
* @returns {Object} Returns the stack cache instance.
|
18690
|
+
*/
|
18691
|
+
function stackSet(key, value) {
|
18692
|
+
var data = this.__data__;
|
18693
|
+
if (data instanceof _ListCache) {
|
18694
|
+
var pairs = data.__data__;
|
18695
|
+
if (!_Map || (pairs.length < LARGE_ARRAY_SIZE - 1)) {
|
18696
|
+
pairs.push([key, value]);
|
18697
|
+
this.size = ++data.size;
|
18698
|
+
return this;
|
18699
|
+
}
|
18700
|
+
data = this.__data__ = new _MapCache(pairs);
|
18701
|
+
}
|
18702
|
+
data.set(key, value);
|
18703
|
+
this.size = data.size;
|
18704
|
+
return this;
|
18705
|
+
}
|
18706
|
+
|
18707
|
+
var _stackSet = stackSet;
|
18708
|
+
|
18709
|
+
/**
|
18710
|
+
* Creates a stack cache object to store key-value pairs.
|
18711
|
+
*
|
18712
|
+
* @private
|
18713
|
+
* @constructor
|
18714
|
+
* @param {Array} [entries] The key-value pairs to cache.
|
18715
|
+
*/
|
18716
|
+
function Stack(entries) {
|
18717
|
+
var data = this.__data__ = new _ListCache(entries);
|
18718
|
+
this.size = data.size;
|
18719
|
+
}
|
18720
|
+
|
18721
|
+
// Add methods to `Stack`.
|
18722
|
+
Stack.prototype.clear = _stackClear;
|
18723
|
+
Stack.prototype['delete'] = _stackDelete;
|
18724
|
+
Stack.prototype.get = _stackGet;
|
18725
|
+
Stack.prototype.has = _stackHas;
|
18726
|
+
Stack.prototype.set = _stackSet;
|
18727
|
+
|
18728
|
+
var _Stack = Stack;
|
18729
|
+
|
18730
|
+
/**
|
18731
|
+
* A specialized version of `_.forEach` for arrays without support for
|
18732
|
+
* iteratee shorthands.
|
18733
|
+
*
|
18734
|
+
* @private
|
18735
|
+
* @param {Array} [array] The array to iterate over.
|
18736
|
+
* @param {Function} iteratee The function invoked per iteration.
|
18737
|
+
* @returns {Array} Returns `array`.
|
18738
|
+
*/
|
18739
|
+
function arrayEach(array, iteratee) {
|
18740
|
+
var index = -1,
|
18741
|
+
length = array == null ? 0 : array.length;
|
18742
|
+
|
18743
|
+
while (++index < length) {
|
18744
|
+
if (iteratee(array[index], index, array) === false) {
|
18745
|
+
break;
|
18746
|
+
}
|
18747
|
+
}
|
18748
|
+
return array;
|
18749
|
+
}
|
18750
|
+
|
18751
|
+
var _arrayEach = arrayEach;
|
18752
|
+
|
18753
|
+
var defineProperty = (function() {
|
18754
|
+
try {
|
18755
|
+
var func = _getNative(Object, 'defineProperty');
|
18756
|
+
func({}, '', {});
|
18757
|
+
return func;
|
18758
|
+
} catch (e) {}
|
18759
|
+
}());
|
18760
|
+
|
18761
|
+
var _defineProperty$1 = defineProperty;
|
18762
|
+
|
18763
|
+
/**
|
18764
|
+
* The base implementation of `assignValue` and `assignMergeValue` without
|
18765
|
+
* value checks.
|
18766
|
+
*
|
18767
|
+
* @private
|
18768
|
+
* @param {Object} object The object to modify.
|
18769
|
+
* @param {string} key The key of the property to assign.
|
18770
|
+
* @param {*} value The value to assign.
|
18771
|
+
*/
|
18772
|
+
function baseAssignValue(object, key, value) {
|
18773
|
+
if (key == '__proto__' && _defineProperty$1) {
|
18774
|
+
_defineProperty$1(object, key, {
|
18775
|
+
'configurable': true,
|
18776
|
+
'enumerable': true,
|
18777
|
+
'value': value,
|
18778
|
+
'writable': true
|
18779
|
+
});
|
18780
|
+
} else {
|
18781
|
+
object[key] = value;
|
18782
|
+
}
|
18783
|
+
}
|
18784
|
+
|
18785
|
+
var _baseAssignValue = baseAssignValue;
|
18786
|
+
|
18787
|
+
/** Used for built-in method references. */
|
18788
|
+
var objectProto$7 = Object.prototype;
|
18789
|
+
|
18790
|
+
/** Used to check objects for own properties. */
|
18791
|
+
var hasOwnProperty$5 = objectProto$7.hasOwnProperty;
|
18792
|
+
|
18793
|
+
/**
|
18794
|
+
* Assigns `value` to `key` of `object` if the existing value is not equivalent
|
18795
|
+
* using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
|
18796
|
+
* for equality comparisons.
|
18797
|
+
*
|
18798
|
+
* @private
|
18799
|
+
* @param {Object} object The object to modify.
|
18800
|
+
* @param {string} key The key of the property to assign.
|
18801
|
+
* @param {*} value The value to assign.
|
18802
|
+
*/
|
18803
|
+
function assignValue(object, key, value) {
|
18804
|
+
var objValue = object[key];
|
18805
|
+
if (!(hasOwnProperty$5.call(object, key) && eq_1(objValue, value)) ||
|
18806
|
+
(value === undefined && !(key in object))) {
|
18807
|
+
_baseAssignValue(object, key, value);
|
18808
|
+
}
|
18809
|
+
}
|
18810
|
+
|
18811
|
+
var _assignValue = assignValue;
|
18812
|
+
|
18813
|
+
/**
|
18814
|
+
* Copies properties of `source` to `object`.
|
18815
|
+
*
|
18816
|
+
* @private
|
18817
|
+
* @param {Object} source The object to copy properties from.
|
18818
|
+
* @param {Array} props The property identifiers to copy.
|
18819
|
+
* @param {Object} [object={}] The object to copy properties to.
|
18820
|
+
* @param {Function} [customizer] The function to customize copied values.
|
18821
|
+
* @returns {Object} Returns `object`.
|
18822
|
+
*/
|
18823
|
+
function copyObject(source, props, object, customizer) {
|
18824
|
+
var isNew = !object;
|
18825
|
+
object || (object = {});
|
18826
|
+
|
18827
|
+
var index = -1,
|
18828
|
+
length = props.length;
|
18829
|
+
|
18830
|
+
while (++index < length) {
|
18831
|
+
var key = props[index];
|
18832
|
+
|
18833
|
+
var newValue = customizer
|
18834
|
+
? customizer(object[key], source[key], key, object, source)
|
18835
|
+
: undefined;
|
18836
|
+
|
18837
|
+
if (newValue === undefined) {
|
18838
|
+
newValue = source[key];
|
18839
|
+
}
|
18840
|
+
if (isNew) {
|
18841
|
+
_baseAssignValue(object, key, newValue);
|
18842
|
+
} else {
|
18843
|
+
_assignValue(object, key, newValue);
|
18844
|
+
}
|
18845
|
+
}
|
18846
|
+
return object;
|
18847
|
+
}
|
18848
|
+
|
18849
|
+
var _copyObject = copyObject;
|
18850
|
+
|
18851
|
+
/**
|
18852
|
+
* The base implementation of `_.times` without support for iteratee shorthands
|
18853
|
+
* or max array length checks.
|
18854
|
+
*
|
18855
|
+
* @private
|
18856
|
+
* @param {number} n The number of times to invoke `iteratee`.
|
18857
|
+
* @param {Function} iteratee The function invoked per iteration.
|
18858
|
+
* @returns {Array} Returns the array of results.
|
18859
|
+
*/
|
18860
|
+
function baseTimes(n, iteratee) {
|
18861
|
+
var index = -1,
|
18862
|
+
result = Array(n);
|
18863
|
+
|
18864
|
+
while (++index < n) {
|
18865
|
+
result[index] = iteratee(index);
|
18866
|
+
}
|
18867
|
+
return result;
|
18868
|
+
}
|
18869
|
+
|
18870
|
+
var _baseTimes = baseTimes;
|
18871
|
+
|
18872
|
+
/**
|
18873
|
+
* Checks if `value` is object-like. A value is object-like if it's not `null`
|
18874
|
+
* and has a `typeof` result of "object".
|
18875
|
+
*
|
18876
|
+
* @static
|
18877
|
+
* @memberOf _
|
18878
|
+
* @since 4.0.0
|
18879
|
+
* @category Lang
|
18880
|
+
* @param {*} value The value to check.
|
18881
|
+
* @returns {boolean} Returns `true` if `value` is object-like, else `false`.
|
18882
|
+
* @example
|
18883
|
+
*
|
18884
|
+
* _.isObjectLike({});
|
18885
|
+
* // => true
|
18886
|
+
*
|
18887
|
+
* _.isObjectLike([1, 2, 3]);
|
18888
|
+
* // => true
|
18889
|
+
*
|
18890
|
+
* _.isObjectLike(_.noop);
|
18891
|
+
* // => false
|
18892
|
+
*
|
18893
|
+
* _.isObjectLike(null);
|
18894
|
+
* // => false
|
18895
|
+
*/
|
18896
|
+
function isObjectLike(value) {
|
18897
|
+
return value != null && typeof value == 'object';
|
18898
|
+
}
|
18899
|
+
|
18900
|
+
var isObjectLike_1 = isObjectLike;
|
18901
|
+
|
18902
|
+
/** `Object#toString` result references. */
|
18903
|
+
var argsTag$2 = '[object Arguments]';
|
18904
|
+
|
18905
|
+
/**
|
18906
|
+
* The base implementation of `_.isArguments`.
|
18907
|
+
*
|
18908
|
+
* @private
|
18909
|
+
* @param {*} value The value to check.
|
18910
|
+
* @returns {boolean} Returns `true` if `value` is an `arguments` object,
|
18911
|
+
*/
|
18912
|
+
function baseIsArguments(value) {
|
18913
|
+
return isObjectLike_1(value) && _baseGetTag(value) == argsTag$2;
|
18914
|
+
}
|
18915
|
+
|
18916
|
+
var _baseIsArguments = baseIsArguments;
|
18917
|
+
|
18918
|
+
/** Used for built-in method references. */
|
18919
|
+
var objectProto$6 = Object.prototype;
|
18920
|
+
|
18921
|
+
/** Used to check objects for own properties. */
|
18922
|
+
var hasOwnProperty$4 = objectProto$6.hasOwnProperty;
|
18923
|
+
|
18924
|
+
/** Built-in value references. */
|
18925
|
+
var propertyIsEnumerable$1 = objectProto$6.propertyIsEnumerable;
|
18926
|
+
|
18927
|
+
/**
|
18928
|
+
* Checks if `value` is likely an `arguments` object.
|
18929
|
+
*
|
18930
|
+
* @static
|
18931
|
+
* @memberOf _
|
18932
|
+
* @since 0.1.0
|
18933
|
+
* @category Lang
|
18934
|
+
* @param {*} value The value to check.
|
18935
|
+
* @returns {boolean} Returns `true` if `value` is an `arguments` object,
|
18936
|
+
* else `false`.
|
18937
|
+
* @example
|
18938
|
+
*
|
18939
|
+
* _.isArguments(function() { return arguments; }());
|
18940
|
+
* // => true
|
18941
|
+
*
|
18942
|
+
* _.isArguments([1, 2, 3]);
|
18943
|
+
* // => false
|
18944
|
+
*/
|
18945
|
+
var isArguments = _baseIsArguments(function() { return arguments; }()) ? _baseIsArguments : function(value) {
|
18946
|
+
return isObjectLike_1(value) && hasOwnProperty$4.call(value, 'callee') &&
|
18947
|
+
!propertyIsEnumerable$1.call(value, 'callee');
|
18948
|
+
};
|
18949
|
+
|
18950
|
+
var isArguments_1 = isArguments;
|
18951
|
+
|
18952
|
+
/**
|
18953
|
+
* Checks if `value` is classified as an `Array` object.
|
18954
|
+
*
|
18955
|
+
* @static
|
18956
|
+
* @memberOf _
|
18957
|
+
* @since 0.1.0
|
18958
|
+
* @category Lang
|
18959
|
+
* @param {*} value The value to check.
|
18960
|
+
* @returns {boolean} Returns `true` if `value` is an array, else `false`.
|
18961
|
+
* @example
|
18962
|
+
*
|
18963
|
+
* _.isArray([1, 2, 3]);
|
18964
|
+
* // => true
|
18965
|
+
*
|
18966
|
+
* _.isArray(document.body.children);
|
18967
|
+
* // => false
|
18968
|
+
*
|
18969
|
+
* _.isArray('abc');
|
18970
|
+
* // => false
|
18971
|
+
*
|
18972
|
+
* _.isArray(_.noop);
|
18973
|
+
* // => false
|
18974
|
+
*/
|
18975
|
+
var isArray = Array.isArray;
|
18976
|
+
|
18977
|
+
var isArray_1 = isArray;
|
18978
|
+
|
18979
|
+
/**
|
18980
|
+
* This method returns `false`.
|
18981
|
+
*
|
18982
|
+
* @static
|
18983
|
+
* @memberOf _
|
18984
|
+
* @since 4.13.0
|
18985
|
+
* @category Util
|
18986
|
+
* @returns {boolean} Returns `false`.
|
18987
|
+
* @example
|
18988
|
+
*
|
18989
|
+
* _.times(2, _.stubFalse);
|
18990
|
+
* // => [false, false]
|
18991
|
+
*/
|
18992
|
+
function stubFalse() {
|
18993
|
+
return false;
|
18994
|
+
}
|
18995
|
+
|
18996
|
+
var stubFalse_1 = stubFalse;
|
18997
|
+
|
18998
|
+
var isBuffer_1 = createCommonjsModule(function (module, exports) {
|
18999
|
+
/** Detect free variable `exports`. */
|
19000
|
+
var freeExports = exports && !exports.nodeType && exports;
|
19001
|
+
|
19002
|
+
/** Detect free variable `module`. */
|
19003
|
+
var freeModule = freeExports && 'object' == 'object' && module && !module.nodeType && module;
|
19004
|
+
|
19005
|
+
/** Detect the popular CommonJS extension `module.exports`. */
|
19006
|
+
var moduleExports = freeModule && freeModule.exports === freeExports;
|
19007
|
+
|
19008
|
+
/** Built-in value references. */
|
19009
|
+
var Buffer = moduleExports ? _root.Buffer : undefined;
|
19010
|
+
|
19011
|
+
/* Built-in method references for those with the same name as other `lodash` methods. */
|
19012
|
+
var nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined;
|
19013
|
+
|
19014
|
+
/**
|
19015
|
+
* Checks if `value` is a buffer.
|
19016
|
+
*
|
19017
|
+
* @static
|
19018
|
+
* @memberOf _
|
19019
|
+
* @since 4.3.0
|
19020
|
+
* @category Lang
|
19021
|
+
* @param {*} value The value to check.
|
19022
|
+
* @returns {boolean} Returns `true` if `value` is a buffer, else `false`.
|
19023
|
+
* @example
|
19024
|
+
*
|
19025
|
+
* _.isBuffer(new Buffer(2));
|
19026
|
+
* // => true
|
19027
|
+
*
|
19028
|
+
* _.isBuffer(new Uint8Array(2));
|
19029
|
+
* // => false
|
19030
|
+
*/
|
19031
|
+
var isBuffer = nativeIsBuffer || stubFalse_1;
|
19032
|
+
|
19033
|
+
module.exports = isBuffer;
|
19034
|
+
});
|
19035
|
+
|
19036
|
+
/** Used as references for various `Number` constants. */
|
19037
|
+
var MAX_SAFE_INTEGER$1 = 9007199254740991;
|
19038
|
+
|
19039
|
+
/** Used to detect unsigned integer values. */
|
19040
|
+
var reIsUint = /^(?:0|[1-9]\d*)$/;
|
19041
|
+
|
19042
|
+
/**
|
19043
|
+
* Checks if `value` is a valid array-like index.
|
19044
|
+
*
|
19045
|
+
* @private
|
19046
|
+
* @param {*} value The value to check.
|
19047
|
+
* @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.
|
19048
|
+
* @returns {boolean} Returns `true` if `value` is a valid index, else `false`.
|
19049
|
+
*/
|
19050
|
+
function isIndex(value, length) {
|
19051
|
+
var type = typeof value;
|
19052
|
+
length = length == null ? MAX_SAFE_INTEGER$1 : length;
|
19053
|
+
|
19054
|
+
return !!length &&
|
19055
|
+
(type == 'number' ||
|
19056
|
+
(type != 'symbol' && reIsUint.test(value))) &&
|
19057
|
+
(value > -1 && value % 1 == 0 && value < length);
|
19058
|
+
}
|
19059
|
+
|
19060
|
+
var _isIndex = isIndex;
|
19061
|
+
|
19062
|
+
/** Used as references for various `Number` constants. */
|
19063
|
+
var MAX_SAFE_INTEGER = 9007199254740991;
|
19064
|
+
|
19065
|
+
/**
|
19066
|
+
* Checks if `value` is a valid array-like length.
|
19067
|
+
*
|
19068
|
+
* **Note:** This method is loosely based on
|
19069
|
+
* [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).
|
19070
|
+
*
|
19071
|
+
* @static
|
19072
|
+
* @memberOf _
|
19073
|
+
* @since 4.0.0
|
19074
|
+
* @category Lang
|
19075
|
+
* @param {*} value The value to check.
|
19076
|
+
* @returns {boolean} Returns `true` if `value` is a valid length, else `false`.
|
19077
|
+
* @example
|
19078
|
+
*
|
19079
|
+
* _.isLength(3);
|
19080
|
+
* // => true
|
19081
|
+
*
|
19082
|
+
* _.isLength(Number.MIN_VALUE);
|
19083
|
+
* // => false
|
19084
|
+
*
|
19085
|
+
* _.isLength(Infinity);
|
19086
|
+
* // => false
|
19087
|
+
*
|
19088
|
+
* _.isLength('3');
|
19089
|
+
* // => false
|
19090
|
+
*/
|
19091
|
+
function isLength(value) {
|
19092
|
+
return typeof value == 'number' &&
|
19093
|
+
value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
|
19094
|
+
}
|
19095
|
+
|
19096
|
+
var isLength_1 = isLength;
|
19097
|
+
|
19098
|
+
/** `Object#toString` result references. */
|
19099
|
+
var argsTag$1 = '[object Arguments]',
|
19100
|
+
arrayTag$1 = '[object Array]',
|
19101
|
+
boolTag$2 = '[object Boolean]',
|
19102
|
+
dateTag$2 = '[object Date]',
|
19103
|
+
errorTag$1 = '[object Error]',
|
19104
|
+
funcTag$1 = '[object Function]',
|
19105
|
+
mapTag$4 = '[object Map]',
|
19106
|
+
numberTag$2 = '[object Number]',
|
19107
|
+
objectTag$2 = '[object Object]',
|
19108
|
+
regexpTag$2 = '[object RegExp]',
|
19109
|
+
setTag$4 = '[object Set]',
|
19110
|
+
stringTag$2 = '[object String]',
|
19111
|
+
weakMapTag$2 = '[object WeakMap]';
|
19112
|
+
|
19113
|
+
var arrayBufferTag$2 = '[object ArrayBuffer]',
|
19114
|
+
dataViewTag$3 = '[object DataView]',
|
19115
|
+
float32Tag$2 = '[object Float32Array]',
|
19116
|
+
float64Tag$2 = '[object Float64Array]',
|
19117
|
+
int8Tag$2 = '[object Int8Array]',
|
19118
|
+
int16Tag$2 = '[object Int16Array]',
|
19119
|
+
int32Tag$2 = '[object Int32Array]',
|
19120
|
+
uint8Tag$2 = '[object Uint8Array]',
|
19121
|
+
uint8ClampedTag$2 = '[object Uint8ClampedArray]',
|
19122
|
+
uint16Tag$2 = '[object Uint16Array]',
|
19123
|
+
uint32Tag$2 = '[object Uint32Array]';
|
19124
|
+
|
19125
|
+
/** Used to identify `toStringTag` values of typed arrays. */
|
19126
|
+
var typedArrayTags = {};
|
19127
|
+
typedArrayTags[float32Tag$2] = typedArrayTags[float64Tag$2] =
|
19128
|
+
typedArrayTags[int8Tag$2] = typedArrayTags[int16Tag$2] =
|
19129
|
+
typedArrayTags[int32Tag$2] = typedArrayTags[uint8Tag$2] =
|
19130
|
+
typedArrayTags[uint8ClampedTag$2] = typedArrayTags[uint16Tag$2] =
|
19131
|
+
typedArrayTags[uint32Tag$2] = true;
|
19132
|
+
typedArrayTags[argsTag$1] = typedArrayTags[arrayTag$1] =
|
19133
|
+
typedArrayTags[arrayBufferTag$2] = typedArrayTags[boolTag$2] =
|
19134
|
+
typedArrayTags[dataViewTag$3] = typedArrayTags[dateTag$2] =
|
19135
|
+
typedArrayTags[errorTag$1] = typedArrayTags[funcTag$1] =
|
19136
|
+
typedArrayTags[mapTag$4] = typedArrayTags[numberTag$2] =
|
19137
|
+
typedArrayTags[objectTag$2] = typedArrayTags[regexpTag$2] =
|
19138
|
+
typedArrayTags[setTag$4] = typedArrayTags[stringTag$2] =
|
19139
|
+
typedArrayTags[weakMapTag$2] = false;
|
19140
|
+
|
19141
|
+
/**
|
19142
|
+
* The base implementation of `_.isTypedArray` without Node.js optimizations.
|
19143
|
+
*
|
19144
|
+
* @private
|
19145
|
+
* @param {*} value The value to check.
|
19146
|
+
* @returns {boolean} Returns `true` if `value` is a typed array, else `false`.
|
19147
|
+
*/
|
19148
|
+
function baseIsTypedArray(value) {
|
19149
|
+
return isObjectLike_1(value) &&
|
19150
|
+
isLength_1(value.length) && !!typedArrayTags[_baseGetTag(value)];
|
19151
|
+
}
|
19152
|
+
|
19153
|
+
var _baseIsTypedArray = baseIsTypedArray;
|
19154
|
+
|
19155
|
+
/**
|
19156
|
+
* The base implementation of `_.unary` without support for storing metadata.
|
19157
|
+
*
|
19158
|
+
* @private
|
19159
|
+
* @param {Function} func The function to cap arguments for.
|
19160
|
+
* @returns {Function} Returns the new capped function.
|
19161
|
+
*/
|
19162
|
+
function baseUnary(func) {
|
19163
|
+
return function(value) {
|
19164
|
+
return func(value);
|
19165
|
+
};
|
19166
|
+
}
|
19167
|
+
|
19168
|
+
var _baseUnary = baseUnary;
|
19169
|
+
|
19170
|
+
var _nodeUtil = createCommonjsModule(function (module, exports) {
|
19171
|
+
/** Detect free variable `exports`. */
|
19172
|
+
var freeExports = exports && !exports.nodeType && exports;
|
19173
|
+
|
19174
|
+
/** Detect free variable `module`. */
|
19175
|
+
var freeModule = freeExports && 'object' == 'object' && module && !module.nodeType && module;
|
19176
|
+
|
19177
|
+
/** Detect the popular CommonJS extension `module.exports`. */
|
19178
|
+
var moduleExports = freeModule && freeModule.exports === freeExports;
|
19179
|
+
|
19180
|
+
/** Detect free variable `process` from Node.js. */
|
19181
|
+
var freeProcess = moduleExports && _freeGlobal.process;
|
19182
|
+
|
19183
|
+
/** Used to access faster Node.js helpers. */
|
19184
|
+
var nodeUtil = (function() {
|
19185
|
+
try {
|
19186
|
+
// Use `util.types` for Node.js 10+.
|
19187
|
+
var types = freeModule && freeModule.require && freeModule.require('util').types;
|
19188
|
+
|
19189
|
+
if (types) {
|
19190
|
+
return types;
|
19191
|
+
}
|
19192
|
+
|
19193
|
+
// Legacy `process.binding('util')` for Node.js < 10.
|
19194
|
+
return freeProcess && freeProcess.binding && freeProcess.binding('util');
|
19195
|
+
} catch (e) {}
|
19196
|
+
}());
|
19197
|
+
|
19198
|
+
module.exports = nodeUtil;
|
19199
|
+
});
|
19200
|
+
|
19201
|
+
/* Node.js helper references. */
|
19202
|
+
var nodeIsTypedArray = _nodeUtil && _nodeUtil.isTypedArray;
|
19203
|
+
|
19204
|
+
/**
|
19205
|
+
* Checks if `value` is classified as a typed array.
|
19206
|
+
*
|
19207
|
+
* @static
|
19208
|
+
* @memberOf _
|
19209
|
+
* @since 3.0.0
|
19210
|
+
* @category Lang
|
19211
|
+
* @param {*} value The value to check.
|
19212
|
+
* @returns {boolean} Returns `true` if `value` is a typed array, else `false`.
|
19213
|
+
* @example
|
19214
|
+
*
|
19215
|
+
* _.isTypedArray(new Uint8Array);
|
19216
|
+
* // => true
|
19217
|
+
*
|
19218
|
+
* _.isTypedArray([]);
|
19219
|
+
* // => false
|
19220
|
+
*/
|
19221
|
+
var isTypedArray = nodeIsTypedArray ? _baseUnary(nodeIsTypedArray) : _baseIsTypedArray;
|
19222
|
+
|
19223
|
+
var isTypedArray_1 = isTypedArray;
|
19224
|
+
|
19225
|
+
/** Used for built-in method references. */
|
19226
|
+
var objectProto$5 = Object.prototype;
|
19227
|
+
|
19228
|
+
/** Used to check objects for own properties. */
|
19229
|
+
var hasOwnProperty$3 = objectProto$5.hasOwnProperty;
|
19230
|
+
|
19231
|
+
/**
|
19232
|
+
* Creates an array of the enumerable property names of the array-like `value`.
|
19233
|
+
*
|
19234
|
+
* @private
|
19235
|
+
* @param {*} value The value to query.
|
19236
|
+
* @param {boolean} inherited Specify returning inherited property names.
|
19237
|
+
* @returns {Array} Returns the array of property names.
|
19238
|
+
*/
|
19239
|
+
function arrayLikeKeys(value, inherited) {
|
19240
|
+
var isArr = isArray_1(value),
|
19241
|
+
isArg = !isArr && isArguments_1(value),
|
19242
|
+
isBuff = !isArr && !isArg && isBuffer_1(value),
|
19243
|
+
isType = !isArr && !isArg && !isBuff && isTypedArray_1(value),
|
19244
|
+
skipIndexes = isArr || isArg || isBuff || isType,
|
19245
|
+
result = skipIndexes ? _baseTimes(value.length, String) : [],
|
19246
|
+
length = result.length;
|
19247
|
+
|
19248
|
+
for (var key in value) {
|
19249
|
+
if ((inherited || hasOwnProperty$3.call(value, key)) &&
|
19250
|
+
!(skipIndexes && (
|
19251
|
+
// Safari 9 has enumerable `arguments.length` in strict mode.
|
19252
|
+
key == 'length' ||
|
19253
|
+
// Node.js 0.10 has enumerable non-index properties on buffers.
|
19254
|
+
(isBuff && (key == 'offset' || key == 'parent')) ||
|
19255
|
+
// PhantomJS 2 has enumerable non-index properties on typed arrays.
|
19256
|
+
(isType && (key == 'buffer' || key == 'byteLength' || key == 'byteOffset')) ||
|
19257
|
+
// Skip index properties.
|
19258
|
+
_isIndex(key, length)
|
19259
|
+
))) {
|
19260
|
+
result.push(key);
|
19261
|
+
}
|
19262
|
+
}
|
19263
|
+
return result;
|
19264
|
+
}
|
19265
|
+
|
19266
|
+
var _arrayLikeKeys = arrayLikeKeys;
|
19267
|
+
|
19268
|
+
/** Used for built-in method references. */
|
19269
|
+
var objectProto$4 = Object.prototype;
|
19270
|
+
|
19271
|
+
/**
|
19272
|
+
* Checks if `value` is likely a prototype object.
|
19273
|
+
*
|
19274
|
+
* @private
|
19275
|
+
* @param {*} value The value to check.
|
19276
|
+
* @returns {boolean} Returns `true` if `value` is a prototype, else `false`.
|
19277
|
+
*/
|
19278
|
+
function isPrototype(value) {
|
19279
|
+
var Ctor = value && value.constructor,
|
19280
|
+
proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto$4;
|
19281
|
+
|
19282
|
+
return value === proto;
|
19283
|
+
}
|
19284
|
+
|
19285
|
+
var _isPrototype = isPrototype;
|
19286
|
+
|
19287
|
+
/**
|
19288
|
+
* Creates a unary function that invokes `func` with its argument transformed.
|
19289
|
+
*
|
19290
|
+
* @private
|
19291
|
+
* @param {Function} func The function to wrap.
|
19292
|
+
* @param {Function} transform The argument transform.
|
19293
|
+
* @returns {Function} Returns the new function.
|
19294
|
+
*/
|
19295
|
+
function overArg(func, transform) {
|
19296
|
+
return function(arg) {
|
19297
|
+
return func(transform(arg));
|
19298
|
+
};
|
19299
|
+
}
|
19300
|
+
|
19301
|
+
var _overArg = overArg;
|
19302
|
+
|
19303
|
+
/* Built-in method references for those with the same name as other `lodash` methods. */
|
19304
|
+
var nativeKeys = _overArg(Object.keys, Object);
|
19305
|
+
|
19306
|
+
var _nativeKeys = nativeKeys;
|
19307
|
+
|
19308
|
+
/** Used for built-in method references. */
|
19309
|
+
var objectProto$3 = Object.prototype;
|
19310
|
+
|
19311
|
+
/** Used to check objects for own properties. */
|
19312
|
+
var hasOwnProperty$2 = objectProto$3.hasOwnProperty;
|
19313
|
+
|
19314
|
+
/**
|
19315
|
+
* The base implementation of `_.keys` which doesn't treat sparse arrays as dense.
|
19316
|
+
*
|
19317
|
+
* @private
|
19318
|
+
* @param {Object} object The object to query.
|
19319
|
+
* @returns {Array} Returns the array of property names.
|
19320
|
+
*/
|
19321
|
+
function baseKeys(object) {
|
19322
|
+
if (!_isPrototype(object)) {
|
19323
|
+
return _nativeKeys(object);
|
19324
|
+
}
|
19325
|
+
var result = [];
|
19326
|
+
for (var key in Object(object)) {
|
19327
|
+
if (hasOwnProperty$2.call(object, key) && key != 'constructor') {
|
19328
|
+
result.push(key);
|
19329
|
+
}
|
19330
|
+
}
|
19331
|
+
return result;
|
19332
|
+
}
|
19333
|
+
|
19334
|
+
var _baseKeys = baseKeys;
|
19335
|
+
|
19336
|
+
/**
|
19337
|
+
* Checks if `value` is array-like. A value is considered array-like if it's
|
19338
|
+
* not a function and has a `value.length` that's an integer greater than or
|
19339
|
+
* equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.
|
19340
|
+
*
|
19341
|
+
* @static
|
19342
|
+
* @memberOf _
|
19343
|
+
* @since 4.0.0
|
19344
|
+
* @category Lang
|
19345
|
+
* @param {*} value The value to check.
|
19346
|
+
* @returns {boolean} Returns `true` if `value` is array-like, else `false`.
|
19347
|
+
* @example
|
19348
|
+
*
|
19349
|
+
* _.isArrayLike([1, 2, 3]);
|
19350
|
+
* // => true
|
19351
|
+
*
|
19352
|
+
* _.isArrayLike(document.body.children);
|
19353
|
+
* // => true
|
19354
|
+
*
|
19355
|
+
* _.isArrayLike('abc');
|
19356
|
+
* // => true
|
19357
|
+
*
|
19358
|
+
* _.isArrayLike(_.noop);
|
19359
|
+
* // => false
|
19360
|
+
*/
|
19361
|
+
function isArrayLike(value) {
|
19362
|
+
return value != null && isLength_1(value.length) && !isFunction_1(value);
|
19363
|
+
}
|
19364
|
+
|
19365
|
+
var isArrayLike_1 = isArrayLike;
|
19366
|
+
|
19367
|
+
/**
|
19368
|
+
* Creates an array of the own enumerable property names of `object`.
|
19369
|
+
*
|
19370
|
+
* **Note:** Non-object values are coerced to objects. See the
|
19371
|
+
* [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)
|
19372
|
+
* for more details.
|
19373
|
+
*
|
19374
|
+
* @static
|
19375
|
+
* @since 0.1.0
|
19376
|
+
* @memberOf _
|
19377
|
+
* @category Object
|
19378
|
+
* @param {Object} object The object to query.
|
19379
|
+
* @returns {Array} Returns the array of property names.
|
19380
|
+
* @example
|
19381
|
+
*
|
19382
|
+
* function Foo() {
|
19383
|
+
* this.a = 1;
|
19384
|
+
* this.b = 2;
|
19385
|
+
* }
|
19386
|
+
*
|
19387
|
+
* Foo.prototype.c = 3;
|
19388
|
+
*
|
19389
|
+
* _.keys(new Foo);
|
19390
|
+
* // => ['a', 'b'] (iteration order is not guaranteed)
|
19391
|
+
*
|
19392
|
+
* _.keys('hi');
|
19393
|
+
* // => ['0', '1']
|
19394
|
+
*/
|
19395
|
+
function keys(object) {
|
19396
|
+
return isArrayLike_1(object) ? _arrayLikeKeys(object) : _baseKeys(object);
|
19397
|
+
}
|
19398
|
+
|
19399
|
+
var keys_1 = keys;
|
19400
|
+
|
19401
|
+
/**
|
19402
|
+
* The base implementation of `_.assign` without support for multiple sources
|
19403
|
+
* or `customizer` functions.
|
19404
|
+
*
|
19405
|
+
* @private
|
19406
|
+
* @param {Object} object The destination object.
|
19407
|
+
* @param {Object} source The source object.
|
19408
|
+
* @returns {Object} Returns `object`.
|
19409
|
+
*/
|
19410
|
+
function baseAssign(object, source) {
|
19411
|
+
return object && _copyObject(source, keys_1(source), object);
|
19412
|
+
}
|
19413
|
+
|
19414
|
+
var _baseAssign = baseAssign;
|
19415
|
+
|
19416
|
+
/**
|
19417
|
+
* This function is like
|
19418
|
+
* [`Object.keys`](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)
|
19419
|
+
* except that it includes inherited enumerable properties.
|
19420
|
+
*
|
19421
|
+
* @private
|
19422
|
+
* @param {Object} object The object to query.
|
19423
|
+
* @returns {Array} Returns the array of property names.
|
19424
|
+
*/
|
19425
|
+
function nativeKeysIn(object) {
|
19426
|
+
var result = [];
|
19427
|
+
if (object != null) {
|
19428
|
+
for (var key in Object(object)) {
|
19429
|
+
result.push(key);
|
19430
|
+
}
|
19431
|
+
}
|
19432
|
+
return result;
|
19433
|
+
}
|
19434
|
+
|
19435
|
+
var _nativeKeysIn = nativeKeysIn;
|
19436
|
+
|
19437
|
+
/** Used for built-in method references. */
|
19438
|
+
var objectProto$2 = Object.prototype;
|
19439
|
+
|
19440
|
+
/** Used to check objects for own properties. */
|
19441
|
+
var hasOwnProperty$1 = objectProto$2.hasOwnProperty;
|
19442
|
+
|
19443
|
+
/**
|
19444
|
+
* The base implementation of `_.keysIn` which doesn't treat sparse arrays as dense.
|
19445
|
+
*
|
19446
|
+
* @private
|
19447
|
+
* @param {Object} object The object to query.
|
19448
|
+
* @returns {Array} Returns the array of property names.
|
19449
|
+
*/
|
19450
|
+
function baseKeysIn(object) {
|
19451
|
+
if (!isObject_1(object)) {
|
19452
|
+
return _nativeKeysIn(object);
|
19453
|
+
}
|
19454
|
+
var isProto = _isPrototype(object),
|
19455
|
+
result = [];
|
19456
|
+
|
19457
|
+
for (var key in object) {
|
19458
|
+
if (!(key == 'constructor' && (isProto || !hasOwnProperty$1.call(object, key)))) {
|
19459
|
+
result.push(key);
|
19460
|
+
}
|
19461
|
+
}
|
19462
|
+
return result;
|
19463
|
+
}
|
19464
|
+
|
19465
|
+
var _baseKeysIn = baseKeysIn;
|
19466
|
+
|
19467
|
+
/**
|
19468
|
+
* Creates an array of the own and inherited enumerable property names of `object`.
|
19469
|
+
*
|
19470
|
+
* **Note:** Non-object values are coerced to objects.
|
19471
|
+
*
|
19472
|
+
* @static
|
19473
|
+
* @memberOf _
|
19474
|
+
* @since 3.0.0
|
19475
|
+
* @category Object
|
19476
|
+
* @param {Object} object The object to query.
|
19477
|
+
* @returns {Array} Returns the array of property names.
|
19478
|
+
* @example
|
19479
|
+
*
|
19480
|
+
* function Foo() {
|
19481
|
+
* this.a = 1;
|
19482
|
+
* this.b = 2;
|
19483
|
+
* }
|
19484
|
+
*
|
19485
|
+
* Foo.prototype.c = 3;
|
19486
|
+
*
|
19487
|
+
* _.keysIn(new Foo);
|
19488
|
+
* // => ['a', 'b', 'c'] (iteration order is not guaranteed)
|
19489
|
+
*/
|
19490
|
+
function keysIn(object) {
|
19491
|
+
return isArrayLike_1(object) ? _arrayLikeKeys(object, true) : _baseKeysIn(object);
|
19492
|
+
}
|
19493
|
+
|
19494
|
+
var keysIn_1 = keysIn;
|
19495
|
+
|
19496
|
+
/**
|
19497
|
+
* The base implementation of `_.assignIn` without support for multiple sources
|
19498
|
+
* or `customizer` functions.
|
19499
|
+
*
|
19500
|
+
* @private
|
19501
|
+
* @param {Object} object The destination object.
|
19502
|
+
* @param {Object} source The source object.
|
19503
|
+
* @returns {Object} Returns `object`.
|
19504
|
+
*/
|
19505
|
+
function baseAssignIn(object, source) {
|
19506
|
+
return object && _copyObject(source, keysIn_1(source), object);
|
19507
|
+
}
|
19508
|
+
|
19509
|
+
var _baseAssignIn = baseAssignIn;
|
19510
|
+
|
19511
|
+
var _cloneBuffer = createCommonjsModule(function (module, exports) {
|
19512
|
+
/** Detect free variable `exports`. */
|
19513
|
+
var freeExports = exports && !exports.nodeType && exports;
|
19514
|
+
|
19515
|
+
/** Detect free variable `module`. */
|
19516
|
+
var freeModule = freeExports && 'object' == 'object' && module && !module.nodeType && module;
|
19517
|
+
|
19518
|
+
/** Detect the popular CommonJS extension `module.exports`. */
|
19519
|
+
var moduleExports = freeModule && freeModule.exports === freeExports;
|
19520
|
+
|
19521
|
+
/** Built-in value references. */
|
19522
|
+
var Buffer = moduleExports ? _root.Buffer : undefined,
|
19523
|
+
allocUnsafe = Buffer ? Buffer.allocUnsafe : undefined;
|
19524
|
+
|
19525
|
+
/**
|
19526
|
+
* Creates a clone of `buffer`.
|
19527
|
+
*
|
19528
|
+
* @private
|
19529
|
+
* @param {Buffer} buffer The buffer to clone.
|
19530
|
+
* @param {boolean} [isDeep] Specify a deep clone.
|
19531
|
+
* @returns {Buffer} Returns the cloned buffer.
|
19532
|
+
*/
|
19533
|
+
function cloneBuffer(buffer, isDeep) {
|
19534
|
+
if (isDeep) {
|
19535
|
+
return buffer.slice();
|
19536
|
+
}
|
19537
|
+
var length = buffer.length,
|
19538
|
+
result = allocUnsafe ? allocUnsafe(length) : new buffer.constructor(length);
|
19539
|
+
|
19540
|
+
buffer.copy(result);
|
19541
|
+
return result;
|
19542
|
+
}
|
19543
|
+
|
19544
|
+
module.exports = cloneBuffer;
|
19545
|
+
});
|
19546
|
+
|
19547
|
+
/**
|
19548
|
+
* Copies the values of `source` to `array`.
|
19549
|
+
*
|
19550
|
+
* @private
|
19551
|
+
* @param {Array} source The array to copy values from.
|
19552
|
+
* @param {Array} [array=[]] The array to copy values to.
|
19553
|
+
* @returns {Array} Returns `array`.
|
19554
|
+
*/
|
19555
|
+
function copyArray(source, array) {
|
19556
|
+
var index = -1,
|
19557
|
+
length = source.length;
|
19558
|
+
|
19559
|
+
array || (array = Array(length));
|
19560
|
+
while (++index < length) {
|
19561
|
+
array[index] = source[index];
|
19562
|
+
}
|
19563
|
+
return array;
|
19564
|
+
}
|
19565
|
+
|
19566
|
+
var _copyArray = copyArray;
|
19567
|
+
|
19568
|
+
/**
|
19569
|
+
* A specialized version of `_.filter` for arrays without support for
|
19570
|
+
* iteratee shorthands.
|
19571
|
+
*
|
19572
|
+
* @private
|
19573
|
+
* @param {Array} [array] The array to iterate over.
|
19574
|
+
* @param {Function} predicate The function invoked per iteration.
|
19575
|
+
* @returns {Array} Returns the new filtered array.
|
19576
|
+
*/
|
19577
|
+
function arrayFilter(array, predicate) {
|
19578
|
+
var index = -1,
|
19579
|
+
length = array == null ? 0 : array.length,
|
19580
|
+
resIndex = 0,
|
19581
|
+
result = [];
|
19582
|
+
|
19583
|
+
while (++index < length) {
|
19584
|
+
var value = array[index];
|
19585
|
+
if (predicate(value, index, array)) {
|
19586
|
+
result[resIndex++] = value;
|
19587
|
+
}
|
19588
|
+
}
|
19589
|
+
return result;
|
19590
|
+
}
|
19591
|
+
|
19592
|
+
var _arrayFilter = arrayFilter;
|
19593
|
+
|
19594
|
+
/**
|
19595
|
+
* This method returns a new empty array.
|
19596
|
+
*
|
19597
|
+
* @static
|
19598
|
+
* @memberOf _
|
19599
|
+
* @since 4.13.0
|
19600
|
+
* @category Util
|
19601
|
+
* @returns {Array} Returns the new empty array.
|
19602
|
+
* @example
|
19603
|
+
*
|
19604
|
+
* var arrays = _.times(2, _.stubArray);
|
19605
|
+
*
|
19606
|
+
* console.log(arrays);
|
19607
|
+
* // => [[], []]
|
19608
|
+
*
|
19609
|
+
* console.log(arrays[0] === arrays[1]);
|
19610
|
+
* // => false
|
19611
|
+
*/
|
19612
|
+
function stubArray() {
|
19613
|
+
return [];
|
19614
|
+
}
|
19615
|
+
|
19616
|
+
var stubArray_1 = stubArray;
|
19617
|
+
|
19618
|
+
/** Used for built-in method references. */
|
19619
|
+
var objectProto$1 = Object.prototype;
|
19620
|
+
|
19621
|
+
/** Built-in value references. */
|
19622
|
+
var propertyIsEnumerable = objectProto$1.propertyIsEnumerable;
|
19623
|
+
|
19624
|
+
/* Built-in method references for those with the same name as other `lodash` methods. */
|
19625
|
+
var nativeGetSymbols$1 = Object.getOwnPropertySymbols;
|
19626
|
+
|
19627
|
+
/**
|
19628
|
+
* Creates an array of the own enumerable symbols of `object`.
|
19629
|
+
*
|
19630
|
+
* @private
|
19631
|
+
* @param {Object} object The object to query.
|
19632
|
+
* @returns {Array} Returns the array of symbols.
|
19633
|
+
*/
|
19634
|
+
var getSymbols = !nativeGetSymbols$1 ? stubArray_1 : function(object) {
|
19635
|
+
if (object == null) {
|
19636
|
+
return [];
|
19637
|
+
}
|
19638
|
+
object = Object(object);
|
19639
|
+
return _arrayFilter(nativeGetSymbols$1(object), function(symbol) {
|
19640
|
+
return propertyIsEnumerable.call(object, symbol);
|
19641
|
+
});
|
19642
|
+
};
|
19643
|
+
|
19644
|
+
var _getSymbols = getSymbols;
|
19645
|
+
|
19646
|
+
/**
|
19647
|
+
* Copies own symbols of `source` to `object`.
|
19648
|
+
*
|
19649
|
+
* @private
|
19650
|
+
* @param {Object} source The object to copy symbols from.
|
19651
|
+
* @param {Object} [object={}] The object to copy symbols to.
|
19652
|
+
* @returns {Object} Returns `object`.
|
19653
|
+
*/
|
19654
|
+
function copySymbols(source, object) {
|
19655
|
+
return _copyObject(source, _getSymbols(source), object);
|
19656
|
+
}
|
19657
|
+
|
19658
|
+
var _copySymbols = copySymbols;
|
19659
|
+
|
19660
|
+
/**
|
19661
|
+
* Appends the elements of `values` to `array`.
|
19662
|
+
*
|
19663
|
+
* @private
|
19664
|
+
* @param {Array} array The array to modify.
|
19665
|
+
* @param {Array} values The values to append.
|
19666
|
+
* @returns {Array} Returns `array`.
|
19667
|
+
*/
|
19668
|
+
function arrayPush(array, values) {
|
19669
|
+
var index = -1,
|
19670
|
+
length = values.length,
|
19671
|
+
offset = array.length;
|
19672
|
+
|
19673
|
+
while (++index < length) {
|
19674
|
+
array[offset + index] = values[index];
|
19675
|
+
}
|
19676
|
+
return array;
|
19677
|
+
}
|
19678
|
+
|
19679
|
+
var _arrayPush = arrayPush;
|
19680
|
+
|
19681
|
+
/** Built-in value references. */
|
19682
|
+
var getPrototype = _overArg(Object.getPrototypeOf, Object);
|
19683
|
+
|
19684
|
+
var _getPrototype = getPrototype;
|
19685
|
+
|
19686
|
+
/* Built-in method references for those with the same name as other `lodash` methods. */
|
19687
|
+
var nativeGetSymbols = Object.getOwnPropertySymbols;
|
19688
|
+
|
19689
|
+
/**
|
19690
|
+
* Creates an array of the own and inherited enumerable symbols of `object`.
|
19691
|
+
*
|
19692
|
+
* @private
|
19693
|
+
* @param {Object} object The object to query.
|
19694
|
+
* @returns {Array} Returns the array of symbols.
|
19695
|
+
*/
|
19696
|
+
var getSymbolsIn = !nativeGetSymbols ? stubArray_1 : function(object) {
|
19697
|
+
var result = [];
|
19698
|
+
while (object) {
|
19699
|
+
_arrayPush(result, _getSymbols(object));
|
19700
|
+
object = _getPrototype(object);
|
19701
|
+
}
|
19702
|
+
return result;
|
19703
|
+
};
|
19704
|
+
|
19705
|
+
var _getSymbolsIn = getSymbolsIn;
|
19706
|
+
|
19707
|
+
/**
|
19708
|
+
* Copies own and inherited symbols of `source` to `object`.
|
19709
|
+
*
|
19710
|
+
* @private
|
19711
|
+
* @param {Object} source The object to copy symbols from.
|
19712
|
+
* @param {Object} [object={}] The object to copy symbols to.
|
19713
|
+
* @returns {Object} Returns `object`.
|
19714
|
+
*/
|
19715
|
+
function copySymbolsIn(source, object) {
|
19716
|
+
return _copyObject(source, _getSymbolsIn(source), object);
|
19717
|
+
}
|
19718
|
+
|
19719
|
+
var _copySymbolsIn = copySymbolsIn;
|
19720
|
+
|
19721
|
+
/**
|
19722
|
+
* The base implementation of `getAllKeys` and `getAllKeysIn` which uses
|
19723
|
+
* `keysFunc` and `symbolsFunc` to get the enumerable property names and
|
19724
|
+
* symbols of `object`.
|
19725
|
+
*
|
19726
|
+
* @private
|
19727
|
+
* @param {Object} object The object to query.
|
19728
|
+
* @param {Function} keysFunc The function to get the keys of `object`.
|
19729
|
+
* @param {Function} symbolsFunc The function to get the symbols of `object`.
|
19730
|
+
* @returns {Array} Returns the array of property names and symbols.
|
19731
|
+
*/
|
19732
|
+
function baseGetAllKeys(object, keysFunc, symbolsFunc) {
|
19733
|
+
var result = keysFunc(object);
|
19734
|
+
return isArray_1(object) ? result : _arrayPush(result, symbolsFunc(object));
|
19735
|
+
}
|
19736
|
+
|
19737
|
+
var _baseGetAllKeys = baseGetAllKeys;
|
19738
|
+
|
19739
|
+
/**
|
19740
|
+
* Creates an array of own enumerable property names and symbols of `object`.
|
19741
|
+
*
|
19742
|
+
* @private
|
19743
|
+
* @param {Object} object The object to query.
|
19744
|
+
* @returns {Array} Returns the array of property names and symbols.
|
19745
|
+
*/
|
19746
|
+
function getAllKeys(object) {
|
19747
|
+
return _baseGetAllKeys(object, keys_1, _getSymbols);
|
19748
|
+
}
|
19749
|
+
|
19750
|
+
var _getAllKeys = getAllKeys;
|
19751
|
+
|
19752
|
+
/**
|
19753
|
+
* Creates an array of own and inherited enumerable property names and
|
19754
|
+
* symbols of `object`.
|
19755
|
+
*
|
19756
|
+
* @private
|
19757
|
+
* @param {Object} object The object to query.
|
19758
|
+
* @returns {Array} Returns the array of property names and symbols.
|
19759
|
+
*/
|
19760
|
+
function getAllKeysIn(object) {
|
19761
|
+
return _baseGetAllKeys(object, keysIn_1, _getSymbolsIn);
|
19762
|
+
}
|
19763
|
+
|
19764
|
+
var _getAllKeysIn = getAllKeysIn;
|
19765
|
+
|
19766
|
+
/* Built-in method references that are verified to be native. */
|
19767
|
+
var DataView = _getNative(_root, 'DataView');
|
19768
|
+
|
19769
|
+
var _DataView = DataView;
|
19770
|
+
|
19771
|
+
/* Built-in method references that are verified to be native. */
|
19772
|
+
var Promise$1 = _getNative(_root, 'Promise');
|
19773
|
+
|
19774
|
+
var _Promise = Promise$1;
|
19775
|
+
|
19776
|
+
/* Built-in method references that are verified to be native. */
|
19777
|
+
var Set = _getNative(_root, 'Set');
|
19778
|
+
|
19779
|
+
var _Set = Set;
|
19780
|
+
|
19781
|
+
/* Built-in method references that are verified to be native. */
|
19782
|
+
var WeakMap$1 = _getNative(_root, 'WeakMap');
|
19783
|
+
|
19784
|
+
var _WeakMap = WeakMap$1;
|
19785
|
+
|
19786
|
+
/** `Object#toString` result references. */
|
19787
|
+
var mapTag$3 = '[object Map]',
|
19788
|
+
objectTag$1 = '[object Object]',
|
19789
|
+
promiseTag = '[object Promise]',
|
19790
|
+
setTag$3 = '[object Set]',
|
19791
|
+
weakMapTag$1 = '[object WeakMap]';
|
19792
|
+
|
19793
|
+
var dataViewTag$2 = '[object DataView]';
|
19794
|
+
|
19795
|
+
/** Used to detect maps, sets, and weakmaps. */
|
19796
|
+
var dataViewCtorString = _toSource(_DataView),
|
19797
|
+
mapCtorString = _toSource(_Map),
|
19798
|
+
promiseCtorString = _toSource(_Promise),
|
19799
|
+
setCtorString = _toSource(_Set),
|
19800
|
+
weakMapCtorString = _toSource(_WeakMap);
|
19801
|
+
|
19802
|
+
/**
|
19803
|
+
* Gets the `toStringTag` of `value`.
|
19804
|
+
*
|
19805
|
+
* @private
|
19806
|
+
* @param {*} value The value to query.
|
19807
|
+
* @returns {string} Returns the `toStringTag`.
|
19808
|
+
*/
|
19809
|
+
var getTag = _baseGetTag;
|
19810
|
+
|
19811
|
+
// Fallback for data views, maps, sets, and weak maps in IE 11 and promises in Node.js < 6.
|
19812
|
+
if ((_DataView && getTag(new _DataView(new ArrayBuffer(1))) != dataViewTag$2) ||
|
19813
|
+
(_Map && getTag(new _Map) != mapTag$3) ||
|
19814
|
+
(_Promise && getTag(_Promise.resolve()) != promiseTag) ||
|
19815
|
+
(_Set && getTag(new _Set) != setTag$3) ||
|
19816
|
+
(_WeakMap && getTag(new _WeakMap) != weakMapTag$1)) {
|
19817
|
+
getTag = function(value) {
|
19818
|
+
var result = _baseGetTag(value),
|
19819
|
+
Ctor = result == objectTag$1 ? value.constructor : undefined,
|
19820
|
+
ctorString = Ctor ? _toSource(Ctor) : '';
|
19821
|
+
|
19822
|
+
if (ctorString) {
|
19823
|
+
switch (ctorString) {
|
19824
|
+
case dataViewCtorString: return dataViewTag$2;
|
19825
|
+
case mapCtorString: return mapTag$3;
|
19826
|
+
case promiseCtorString: return promiseTag;
|
19827
|
+
case setCtorString: return setTag$3;
|
19828
|
+
case weakMapCtorString: return weakMapTag$1;
|
19829
|
+
}
|
19830
|
+
}
|
19831
|
+
return result;
|
19832
|
+
};
|
19833
|
+
}
|
19834
|
+
|
19835
|
+
var _getTag = getTag;
|
19836
|
+
|
19837
|
+
/** Used for built-in method references. */
|
19838
|
+
var objectProto = Object.prototype;
|
19839
|
+
|
19840
|
+
/** Used to check objects for own properties. */
|
19841
|
+
var hasOwnProperty = objectProto.hasOwnProperty;
|
19842
|
+
|
19843
|
+
/**
|
19844
|
+
* Initializes an array clone.
|
19845
|
+
*
|
19846
|
+
* @private
|
19847
|
+
* @param {Array} array The array to clone.
|
19848
|
+
* @returns {Array} Returns the initialized clone.
|
19849
|
+
*/
|
19850
|
+
function initCloneArray(array) {
|
19851
|
+
var length = array.length,
|
19852
|
+
result = new array.constructor(length);
|
19853
|
+
|
19854
|
+
// Add properties assigned by `RegExp#exec`.
|
19855
|
+
if (length && typeof array[0] == 'string' && hasOwnProperty.call(array, 'index')) {
|
19856
|
+
result.index = array.index;
|
19857
|
+
result.input = array.input;
|
19858
|
+
}
|
19859
|
+
return result;
|
19860
|
+
}
|
19861
|
+
|
19862
|
+
var _initCloneArray = initCloneArray;
|
19863
|
+
|
19864
|
+
/** Built-in value references. */
|
19865
|
+
var Uint8Array = _root.Uint8Array;
|
19866
|
+
|
19867
|
+
var _Uint8Array = Uint8Array;
|
19868
|
+
|
19869
|
+
/**
|
19870
|
+
* Creates a clone of `arrayBuffer`.
|
19871
|
+
*
|
19872
|
+
* @private
|
19873
|
+
* @param {ArrayBuffer} arrayBuffer The array buffer to clone.
|
19874
|
+
* @returns {ArrayBuffer} Returns the cloned array buffer.
|
19875
|
+
*/
|
19876
|
+
function cloneArrayBuffer(arrayBuffer) {
|
19877
|
+
var result = new arrayBuffer.constructor(arrayBuffer.byteLength);
|
19878
|
+
new _Uint8Array(result).set(new _Uint8Array(arrayBuffer));
|
19879
|
+
return result;
|
19880
|
+
}
|
19881
|
+
|
19882
|
+
var _cloneArrayBuffer = cloneArrayBuffer;
|
19883
|
+
|
19884
|
+
/**
|
19885
|
+
* Creates a clone of `dataView`.
|
19886
|
+
*
|
19887
|
+
* @private
|
19888
|
+
* @param {Object} dataView The data view to clone.
|
19889
|
+
* @param {boolean} [isDeep] Specify a deep clone.
|
19890
|
+
* @returns {Object} Returns the cloned data view.
|
19891
|
+
*/
|
19892
|
+
function cloneDataView(dataView, isDeep) {
|
19893
|
+
var buffer = isDeep ? _cloneArrayBuffer(dataView.buffer) : dataView.buffer;
|
19894
|
+
return new dataView.constructor(buffer, dataView.byteOffset, dataView.byteLength);
|
19895
|
+
}
|
19896
|
+
|
19897
|
+
var _cloneDataView = cloneDataView;
|
19898
|
+
|
19899
|
+
/** Used to match `RegExp` flags from their coerced string values. */
|
19900
|
+
var reFlags = /\w*$/;
|
19901
|
+
|
19902
|
+
/**
|
19903
|
+
* Creates a clone of `regexp`.
|
19904
|
+
*
|
19905
|
+
* @private
|
19906
|
+
* @param {Object} regexp The regexp to clone.
|
19907
|
+
* @returns {Object} Returns the cloned regexp.
|
19908
|
+
*/
|
19909
|
+
function cloneRegExp(regexp) {
|
19910
|
+
var result = new regexp.constructor(regexp.source, reFlags.exec(regexp));
|
19911
|
+
result.lastIndex = regexp.lastIndex;
|
19912
|
+
return result;
|
19913
|
+
}
|
19914
|
+
|
19915
|
+
var _cloneRegExp = cloneRegExp;
|
19916
|
+
|
19917
|
+
/** Used to convert symbols to primitives and strings. */
|
19918
|
+
var symbolProto = _Symbol ? _Symbol.prototype : undefined,
|
19919
|
+
symbolValueOf = symbolProto ? symbolProto.valueOf : undefined;
|
19920
|
+
|
19921
|
+
/**
|
19922
|
+
* Creates a clone of the `symbol` object.
|
19923
|
+
*
|
19924
|
+
* @private
|
19925
|
+
* @param {Object} symbol The symbol object to clone.
|
19926
|
+
* @returns {Object} Returns the cloned symbol object.
|
19927
|
+
*/
|
19928
|
+
function cloneSymbol(symbol) {
|
19929
|
+
return symbolValueOf ? Object(symbolValueOf.call(symbol)) : {};
|
19930
|
+
}
|
19931
|
+
|
19932
|
+
var _cloneSymbol = cloneSymbol;
|
19933
|
+
|
19934
|
+
/**
|
19935
|
+
* Creates a clone of `typedArray`.
|
19936
|
+
*
|
19937
|
+
* @private
|
19938
|
+
* @param {Object} typedArray The typed array to clone.
|
19939
|
+
* @param {boolean} [isDeep] Specify a deep clone.
|
19940
|
+
* @returns {Object} Returns the cloned typed array.
|
19941
|
+
*/
|
19942
|
+
function cloneTypedArray(typedArray, isDeep) {
|
19943
|
+
var buffer = isDeep ? _cloneArrayBuffer(typedArray.buffer) : typedArray.buffer;
|
19944
|
+
return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length);
|
19945
|
+
}
|
19946
|
+
|
19947
|
+
var _cloneTypedArray = cloneTypedArray;
|
19948
|
+
|
19949
|
+
/** `Object#toString` result references. */
|
19950
|
+
var boolTag$1 = '[object Boolean]',
|
19951
|
+
dateTag$1 = '[object Date]',
|
19952
|
+
mapTag$2 = '[object Map]',
|
19953
|
+
numberTag$1 = '[object Number]',
|
19954
|
+
regexpTag$1 = '[object RegExp]',
|
19955
|
+
setTag$2 = '[object Set]',
|
19956
|
+
stringTag$1 = '[object String]',
|
19957
|
+
symbolTag$1 = '[object Symbol]';
|
19958
|
+
|
19959
|
+
var arrayBufferTag$1 = '[object ArrayBuffer]',
|
19960
|
+
dataViewTag$1 = '[object DataView]',
|
19961
|
+
float32Tag$1 = '[object Float32Array]',
|
19962
|
+
float64Tag$1 = '[object Float64Array]',
|
19963
|
+
int8Tag$1 = '[object Int8Array]',
|
19964
|
+
int16Tag$1 = '[object Int16Array]',
|
19965
|
+
int32Tag$1 = '[object Int32Array]',
|
19966
|
+
uint8Tag$1 = '[object Uint8Array]',
|
19967
|
+
uint8ClampedTag$1 = '[object Uint8ClampedArray]',
|
19968
|
+
uint16Tag$1 = '[object Uint16Array]',
|
19969
|
+
uint32Tag$1 = '[object Uint32Array]';
|
19970
|
+
|
19971
|
+
/**
|
19972
|
+
* Initializes an object clone based on its `toStringTag`.
|
19973
|
+
*
|
19974
|
+
* **Note:** This function only supports cloning values with tags of
|
19975
|
+
* `Boolean`, `Date`, `Error`, `Map`, `Number`, `RegExp`, `Set`, or `String`.
|
19976
|
+
*
|
19977
|
+
* @private
|
19978
|
+
* @param {Object} object The object to clone.
|
19979
|
+
* @param {string} tag The `toStringTag` of the object to clone.
|
19980
|
+
* @param {boolean} [isDeep] Specify a deep clone.
|
19981
|
+
* @returns {Object} Returns the initialized clone.
|
19982
|
+
*/
|
19983
|
+
function initCloneByTag(object, tag, isDeep) {
|
19984
|
+
var Ctor = object.constructor;
|
19985
|
+
switch (tag) {
|
19986
|
+
case arrayBufferTag$1:
|
19987
|
+
return _cloneArrayBuffer(object);
|
19988
|
+
|
19989
|
+
case boolTag$1:
|
19990
|
+
case dateTag$1:
|
19991
|
+
return new Ctor(+object);
|
19992
|
+
|
19993
|
+
case dataViewTag$1:
|
19994
|
+
return _cloneDataView(object, isDeep);
|
19995
|
+
|
19996
|
+
case float32Tag$1: case float64Tag$1:
|
19997
|
+
case int8Tag$1: case int16Tag$1: case int32Tag$1:
|
19998
|
+
case uint8Tag$1: case uint8ClampedTag$1: case uint16Tag$1: case uint32Tag$1:
|
19999
|
+
return _cloneTypedArray(object, isDeep);
|
20000
|
+
|
20001
|
+
case mapTag$2:
|
20002
|
+
return new Ctor;
|
20003
|
+
|
20004
|
+
case numberTag$1:
|
20005
|
+
case stringTag$1:
|
20006
|
+
return new Ctor(object);
|
20007
|
+
|
20008
|
+
case regexpTag$1:
|
20009
|
+
return _cloneRegExp(object);
|
20010
|
+
|
20011
|
+
case setTag$2:
|
20012
|
+
return new Ctor;
|
20013
|
+
|
20014
|
+
case symbolTag$1:
|
20015
|
+
return _cloneSymbol(object);
|
20016
|
+
}
|
20017
|
+
}
|
20018
|
+
|
20019
|
+
var _initCloneByTag = initCloneByTag;
|
20020
|
+
|
20021
|
+
/** Built-in value references. */
|
20022
|
+
var objectCreate = Object.create;
|
20023
|
+
|
20024
|
+
/**
|
20025
|
+
* The base implementation of `_.create` without support for assigning
|
20026
|
+
* properties to the created object.
|
20027
|
+
*
|
20028
|
+
* @private
|
20029
|
+
* @param {Object} proto The object to inherit from.
|
20030
|
+
* @returns {Object} Returns the new object.
|
20031
|
+
*/
|
20032
|
+
var baseCreate = (function() {
|
20033
|
+
function object() {}
|
20034
|
+
return function(proto) {
|
20035
|
+
if (!isObject_1(proto)) {
|
20036
|
+
return {};
|
20037
|
+
}
|
20038
|
+
if (objectCreate) {
|
20039
|
+
return objectCreate(proto);
|
20040
|
+
}
|
20041
|
+
object.prototype = proto;
|
20042
|
+
var result = new object;
|
20043
|
+
object.prototype = undefined;
|
20044
|
+
return result;
|
20045
|
+
};
|
20046
|
+
}());
|
20047
|
+
|
20048
|
+
var _baseCreate = baseCreate;
|
20049
|
+
|
20050
|
+
/**
|
20051
|
+
* Initializes an object clone.
|
20052
|
+
*
|
20053
|
+
* @private
|
20054
|
+
* @param {Object} object The object to clone.
|
20055
|
+
* @returns {Object} Returns the initialized clone.
|
20056
|
+
*/
|
20057
|
+
function initCloneObject(object) {
|
20058
|
+
return (typeof object.constructor == 'function' && !_isPrototype(object))
|
20059
|
+
? _baseCreate(_getPrototype(object))
|
20060
|
+
: {};
|
20061
|
+
}
|
20062
|
+
|
20063
|
+
var _initCloneObject = initCloneObject;
|
20064
|
+
|
20065
|
+
/** `Object#toString` result references. */
|
20066
|
+
var mapTag$1 = '[object Map]';
|
20067
|
+
|
20068
|
+
/**
|
20069
|
+
* The base implementation of `_.isMap` without Node.js optimizations.
|
20070
|
+
*
|
20071
|
+
* @private
|
20072
|
+
* @param {*} value The value to check.
|
20073
|
+
* @returns {boolean} Returns `true` if `value` is a map, else `false`.
|
20074
|
+
*/
|
20075
|
+
function baseIsMap(value) {
|
20076
|
+
return isObjectLike_1(value) && _getTag(value) == mapTag$1;
|
20077
|
+
}
|
20078
|
+
|
20079
|
+
var _baseIsMap = baseIsMap;
|
20080
|
+
|
20081
|
+
/* Node.js helper references. */
|
20082
|
+
var nodeIsMap = _nodeUtil && _nodeUtil.isMap;
|
20083
|
+
|
20084
|
+
/**
|
20085
|
+
* Checks if `value` is classified as a `Map` object.
|
20086
|
+
*
|
20087
|
+
* @static
|
20088
|
+
* @memberOf _
|
20089
|
+
* @since 4.3.0
|
20090
|
+
* @category Lang
|
20091
|
+
* @param {*} value The value to check.
|
20092
|
+
* @returns {boolean} Returns `true` if `value` is a map, else `false`.
|
20093
|
+
* @example
|
20094
|
+
*
|
20095
|
+
* _.isMap(new Map);
|
20096
|
+
* // => true
|
20097
|
+
*
|
20098
|
+
* _.isMap(new WeakMap);
|
20099
|
+
* // => false
|
20100
|
+
*/
|
20101
|
+
var isMap = nodeIsMap ? _baseUnary(nodeIsMap) : _baseIsMap;
|
20102
|
+
|
20103
|
+
var isMap_1 = isMap;
|
20104
|
+
|
20105
|
+
/** `Object#toString` result references. */
|
20106
|
+
var setTag$1 = '[object Set]';
|
20107
|
+
|
20108
|
+
/**
|
20109
|
+
* The base implementation of `_.isSet` without Node.js optimizations.
|
20110
|
+
*
|
20111
|
+
* @private
|
20112
|
+
* @param {*} value The value to check.
|
20113
|
+
* @returns {boolean} Returns `true` if `value` is a set, else `false`.
|
20114
|
+
*/
|
20115
|
+
function baseIsSet(value) {
|
20116
|
+
return isObjectLike_1(value) && _getTag(value) == setTag$1;
|
20117
|
+
}
|
20118
|
+
|
20119
|
+
var _baseIsSet = baseIsSet;
|
20120
|
+
|
20121
|
+
/* Node.js helper references. */
|
20122
|
+
var nodeIsSet = _nodeUtil && _nodeUtil.isSet;
|
20123
|
+
|
20124
|
+
/**
|
20125
|
+
* Checks if `value` is classified as a `Set` object.
|
20126
|
+
*
|
20127
|
+
* @static
|
20128
|
+
* @memberOf _
|
20129
|
+
* @since 4.3.0
|
20130
|
+
* @category Lang
|
20131
|
+
* @param {*} value The value to check.
|
20132
|
+
* @returns {boolean} Returns `true` if `value` is a set, else `false`.
|
20133
|
+
* @example
|
20134
|
+
*
|
20135
|
+
* _.isSet(new Set);
|
20136
|
+
* // => true
|
20137
|
+
*
|
20138
|
+
* _.isSet(new WeakSet);
|
20139
|
+
* // => false
|
20140
|
+
*/
|
20141
|
+
var isSet = nodeIsSet ? _baseUnary(nodeIsSet) : _baseIsSet;
|
20142
|
+
|
20143
|
+
var isSet_1 = isSet;
|
20144
|
+
|
20145
|
+
/** Used to compose bitmasks for cloning. */
|
20146
|
+
var CLONE_DEEP_FLAG$1 = 1,
|
20147
|
+
CLONE_FLAT_FLAG = 2,
|
20148
|
+
CLONE_SYMBOLS_FLAG$1 = 4;
|
20149
|
+
|
20150
|
+
/** `Object#toString` result references. */
|
20151
|
+
var argsTag = '[object Arguments]',
|
20152
|
+
arrayTag = '[object Array]',
|
20153
|
+
boolTag = '[object Boolean]',
|
20154
|
+
dateTag = '[object Date]',
|
20155
|
+
errorTag = '[object Error]',
|
20156
|
+
funcTag = '[object Function]',
|
20157
|
+
genTag = '[object GeneratorFunction]',
|
20158
|
+
mapTag = '[object Map]',
|
20159
|
+
numberTag = '[object Number]',
|
20160
|
+
objectTag = '[object Object]',
|
20161
|
+
regexpTag = '[object RegExp]',
|
20162
|
+
setTag = '[object Set]',
|
20163
|
+
stringTag = '[object String]',
|
20164
|
+
symbolTag = '[object Symbol]',
|
20165
|
+
weakMapTag = '[object WeakMap]';
|
20166
|
+
|
20167
|
+
var arrayBufferTag = '[object ArrayBuffer]',
|
20168
|
+
dataViewTag = '[object DataView]',
|
20169
|
+
float32Tag = '[object Float32Array]',
|
20170
|
+
float64Tag = '[object Float64Array]',
|
20171
|
+
int8Tag = '[object Int8Array]',
|
20172
|
+
int16Tag = '[object Int16Array]',
|
20173
|
+
int32Tag = '[object Int32Array]',
|
20174
|
+
uint8Tag = '[object Uint8Array]',
|
20175
|
+
uint8ClampedTag = '[object Uint8ClampedArray]',
|
20176
|
+
uint16Tag = '[object Uint16Array]',
|
20177
|
+
uint32Tag = '[object Uint32Array]';
|
20178
|
+
|
20179
|
+
/** Used to identify `toStringTag` values supported by `_.clone`. */
|
20180
|
+
var cloneableTags = {};
|
20181
|
+
cloneableTags[argsTag] = cloneableTags[arrayTag] =
|
20182
|
+
cloneableTags[arrayBufferTag] = cloneableTags[dataViewTag] =
|
20183
|
+
cloneableTags[boolTag] = cloneableTags[dateTag] =
|
20184
|
+
cloneableTags[float32Tag] = cloneableTags[float64Tag] =
|
20185
|
+
cloneableTags[int8Tag] = cloneableTags[int16Tag] =
|
20186
|
+
cloneableTags[int32Tag] = cloneableTags[mapTag] =
|
20187
|
+
cloneableTags[numberTag] = cloneableTags[objectTag] =
|
20188
|
+
cloneableTags[regexpTag] = cloneableTags[setTag] =
|
20189
|
+
cloneableTags[stringTag] = cloneableTags[symbolTag] =
|
20190
|
+
cloneableTags[uint8Tag] = cloneableTags[uint8ClampedTag] =
|
20191
|
+
cloneableTags[uint16Tag] = cloneableTags[uint32Tag] = true;
|
20192
|
+
cloneableTags[errorTag] = cloneableTags[funcTag] =
|
20193
|
+
cloneableTags[weakMapTag] = false;
|
20194
|
+
|
20195
|
+
/**
|
20196
|
+
* The base implementation of `_.clone` and `_.cloneDeep` which tracks
|
20197
|
+
* traversed objects.
|
20198
|
+
*
|
20199
|
+
* @private
|
20200
|
+
* @param {*} value The value to clone.
|
20201
|
+
* @param {boolean} bitmask The bitmask flags.
|
20202
|
+
* 1 - Deep clone
|
20203
|
+
* 2 - Flatten inherited properties
|
20204
|
+
* 4 - Clone symbols
|
20205
|
+
* @param {Function} [customizer] The function to customize cloning.
|
20206
|
+
* @param {string} [key] The key of `value`.
|
20207
|
+
* @param {Object} [object] The parent object of `value`.
|
20208
|
+
* @param {Object} [stack] Tracks traversed objects and their clone counterparts.
|
20209
|
+
* @returns {*} Returns the cloned value.
|
20210
|
+
*/
|
20211
|
+
function baseClone(value, bitmask, customizer, key, object, stack) {
|
20212
|
+
var result,
|
20213
|
+
isDeep = bitmask & CLONE_DEEP_FLAG$1,
|
20214
|
+
isFlat = bitmask & CLONE_FLAT_FLAG,
|
20215
|
+
isFull = bitmask & CLONE_SYMBOLS_FLAG$1;
|
20216
|
+
|
20217
|
+
if (customizer) {
|
20218
|
+
result = object ? customizer(value, key, object, stack) : customizer(value);
|
20219
|
+
}
|
20220
|
+
if (result !== undefined) {
|
20221
|
+
return result;
|
20222
|
+
}
|
20223
|
+
if (!isObject_1(value)) {
|
20224
|
+
return value;
|
20225
|
+
}
|
20226
|
+
var isArr = isArray_1(value);
|
20227
|
+
if (isArr) {
|
20228
|
+
result = _initCloneArray(value);
|
20229
|
+
if (!isDeep) {
|
20230
|
+
return _copyArray(value, result);
|
20231
|
+
}
|
20232
|
+
} else {
|
20233
|
+
var tag = _getTag(value),
|
20234
|
+
isFunc = tag == funcTag || tag == genTag;
|
20235
|
+
|
20236
|
+
if (isBuffer_1(value)) {
|
20237
|
+
return _cloneBuffer(value, isDeep);
|
20238
|
+
}
|
20239
|
+
if (tag == objectTag || tag == argsTag || (isFunc && !object)) {
|
20240
|
+
result = (isFlat || isFunc) ? {} : _initCloneObject(value);
|
20241
|
+
if (!isDeep) {
|
20242
|
+
return isFlat
|
20243
|
+
? _copySymbolsIn(value, _baseAssignIn(result, value))
|
20244
|
+
: _copySymbols(value, _baseAssign(result, value));
|
20245
|
+
}
|
20246
|
+
} else {
|
20247
|
+
if (!cloneableTags[tag]) {
|
20248
|
+
return object ? value : {};
|
20249
|
+
}
|
20250
|
+
result = _initCloneByTag(value, tag, isDeep);
|
20251
|
+
}
|
20252
|
+
}
|
20253
|
+
// Check for circular references and return its corresponding clone.
|
20254
|
+
stack || (stack = new _Stack);
|
20255
|
+
var stacked = stack.get(value);
|
20256
|
+
if (stacked) {
|
20257
|
+
return stacked;
|
20258
|
+
}
|
20259
|
+
stack.set(value, result);
|
20260
|
+
|
20261
|
+
if (isSet_1(value)) {
|
20262
|
+
value.forEach(function(subValue) {
|
20263
|
+
result.add(baseClone(subValue, bitmask, customizer, subValue, value, stack));
|
20264
|
+
});
|
20265
|
+
} else if (isMap_1(value)) {
|
20266
|
+
value.forEach(function(subValue, key) {
|
20267
|
+
result.set(key, baseClone(subValue, bitmask, customizer, key, value, stack));
|
20268
|
+
});
|
20269
|
+
}
|
20270
|
+
|
20271
|
+
var keysFunc = isFull
|
20272
|
+
? (isFlat ? _getAllKeysIn : _getAllKeys)
|
20273
|
+
: (isFlat ? keysIn_1 : keys_1);
|
20274
|
+
|
20275
|
+
var props = isArr ? undefined : keysFunc(value);
|
20276
|
+
_arrayEach(props || value, function(subValue, key) {
|
20277
|
+
if (props) {
|
20278
|
+
key = subValue;
|
20279
|
+
subValue = value[key];
|
20280
|
+
}
|
20281
|
+
// Recursively populate clone (susceptible to call stack limits).
|
20282
|
+
_assignValue(result, key, baseClone(subValue, bitmask, customizer, key, value, stack));
|
20283
|
+
});
|
20284
|
+
return result;
|
20285
|
+
}
|
20286
|
+
|
20287
|
+
var _baseClone = baseClone;
|
20288
|
+
|
20289
|
+
/** Used to compose bitmasks for cloning. */
|
20290
|
+
var CLONE_DEEP_FLAG = 1,
|
20291
|
+
CLONE_SYMBOLS_FLAG = 4;
|
20292
|
+
|
20293
|
+
/**
|
20294
|
+
* This method is like `_.cloneWith` except that it recursively clones `value`.
|
20295
|
+
*
|
20296
|
+
* @static
|
20297
|
+
* @memberOf _
|
20298
|
+
* @since 4.0.0
|
20299
|
+
* @category Lang
|
20300
|
+
* @param {*} value The value to recursively clone.
|
20301
|
+
* @param {Function} [customizer] The function to customize cloning.
|
20302
|
+
* @returns {*} Returns the deep cloned value.
|
20303
|
+
* @see _.cloneWith
|
20304
|
+
* @example
|
20305
|
+
*
|
20306
|
+
* function customizer(value) {
|
20307
|
+
* if (_.isElement(value)) {
|
20308
|
+
* return value.cloneNode(true);
|
20309
|
+
* }
|
20310
|
+
* }
|
20311
|
+
*
|
20312
|
+
* var el = _.cloneDeepWith(document.body, customizer);
|
20313
|
+
*
|
20314
|
+
* console.log(el === document.body);
|
20315
|
+
* // => false
|
20316
|
+
* console.log(el.nodeName);
|
20317
|
+
* // => 'BODY'
|
20318
|
+
* console.log(el.childNodes.length);
|
20319
|
+
* // => 20
|
20320
|
+
*/
|
20321
|
+
function cloneDeepWith(value, customizer) {
|
20322
|
+
customizer = typeof customizer == 'function' ? customizer : undefined;
|
20323
|
+
return _baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG, customizer);
|
20324
|
+
}
|
20325
|
+
|
20326
|
+
var cloneDeepWith_1 = cloneDeepWith;
|
20327
|
+
|
20328
|
+
var isFieldRequired = function isFieldRequired(rules) {
|
20329
|
+
if (rules === void 0) {
|
20330
|
+
rules = [];
|
20331
|
+
}
|
20332
|
+
|
20333
|
+
return (rules || []).some(function (rule) {
|
20334
|
+
return rule === null || rule === void 0 ? void 0 : rule.required;
|
20335
|
+
});
|
20336
|
+
};
|
20337
|
+
var getErrorAndWarnings = function getErrorAndWarnings(result) {
|
20338
|
+
var errors = [];
|
20339
|
+
var warnings = [];
|
20340
|
+
var errorTypes = [];
|
20341
|
+
result.map(function (_a) {
|
20342
|
+
var _b = _a.message,
|
20343
|
+
message = _b === void 0 ? [] : _b,
|
20344
|
+
_c = _a.validateLevel,
|
20345
|
+
validateLevel = _c === void 0 ? 'error' : _c,
|
20346
|
+
resultErrorTypes = _a.errorTypes;
|
20347
|
+
|
20348
|
+
if (!(message === null || message === void 0 ? void 0 : message.length)) {
|
20349
|
+
return;
|
20350
|
+
}
|
20351
|
+
|
20352
|
+
if (validateLevel === 'warning') {
|
20353
|
+
warnings = __spreadArrays$1(warnings, message);
|
20354
|
+
} else {
|
20355
|
+
errors = __spreadArrays$1(errors, message);
|
20356
|
+
errorTypes = __spreadArrays$1(errorTypes, resultErrorTypes);
|
20357
|
+
}
|
20358
|
+
});
|
20359
|
+
return {
|
20360
|
+
warnings: warnings,
|
20361
|
+
errors: errors,
|
20362
|
+
errorTypes: errorTypes
|
20363
|
+
};
|
20364
|
+
};
|
20365
|
+
var getDefaultValueForInterComponent = function getDefaultValueForInterComponent(componentType) {
|
20366
|
+
switch (componentType) {
|
20367
|
+
case FormInternalComponentType.Input:
|
20368
|
+
case FormInternalComponentType.Textarea:
|
20369
|
+
return undefined;
|
20370
|
+
|
20371
|
+
case FormInternalComponentType.CheckboxGroup:
|
20372
|
+
return [];
|
20373
|
+
|
20374
|
+
case FormInternalComponentType.RadioGroup:
|
20375
|
+
return null;
|
20376
|
+
|
20377
|
+
case FormInternalComponentType.Slider:
|
20378
|
+
case FormInternalComponentType.Rate:
|
20379
|
+
return 0;
|
20380
|
+
|
20381
|
+
default:
|
20382
|
+
return undefined;
|
20383
|
+
}
|
20384
|
+
};
|
20385
|
+
function deepClone(value) {
|
20386
|
+
return cloneDeepWith_1(value, function (val) {
|
20387
|
+
if (!isObject$3(val) && !isArray$2(val)) {
|
20388
|
+
return val;
|
20389
|
+
}
|
20390
|
+
});
|
20391
|
+
}
|
20392
|
+
|
20393
|
+
var defaultFunc = function defaultFunc() {};
|
20394
|
+
|
20395
|
+
var defaultFormDataMethods = {
|
20396
|
+
getFieldValue: function getFieldValue(name) {
|
20397
|
+
return name;
|
20398
|
+
},
|
20399
|
+
getFieldsValue: function getFieldsValue(_names) {
|
20400
|
+
return {};
|
20401
|
+
},
|
20402
|
+
getFieldError: function getFieldError(_name) {
|
20403
|
+
return [];
|
20404
|
+
},
|
20405
|
+
setFieldValue: function setFieldValue(_name, _value) {
|
20406
|
+
return true;
|
20407
|
+
},
|
20408
|
+
setFieldsValue: function setFieldsValue(_values) {
|
20409
|
+
return true;
|
20410
|
+
},
|
20411
|
+
registerField: function registerField(_name, _self) {
|
20412
|
+
return function () {};
|
20413
|
+
},
|
20414
|
+
resetFields: defaultFunc,
|
20415
|
+
validateFields: defaultFunc,
|
20416
|
+
submit: defaultFunc,
|
20417
|
+
getInternalHooks: function getInternalHooks() {
|
20418
|
+
return {
|
20419
|
+
registerField: defaultFunc,
|
20420
|
+
setInitialValues: defaultFunc,
|
20421
|
+
setCallbacks: defaultFunc,
|
20422
|
+
getInitialValue: defaultFunc,
|
20423
|
+
setInitialValue: defaultFunc,
|
20424
|
+
innerSetFieldsValue: defaultFunc,
|
20425
|
+
innerSetFieldValue: defaultFunc
|
20426
|
+
};
|
20427
|
+
}
|
20428
|
+
}; // 在field的静态的状态下设置
|
20429
|
+
|
20430
|
+
var FormData =
|
20431
|
+
/** @class */
|
20432
|
+
function () {
|
20433
|
+
function FormData() {
|
20434
|
+
var _this = this;
|
20435
|
+
|
20436
|
+
this._formData = {}; // 数据源
|
20437
|
+
|
20438
|
+
this._fieldsList = {}; // 字段列表
|
20439
|
+
|
20440
|
+
this._initialValues = {}; // 初始值
|
20441
|
+
|
20442
|
+
this._callbacks = {};
|
20443
|
+
|
20444
|
+
this.commonSetFieldsValue = function (values, changeType) {
|
20445
|
+
var oldValues = Object.keys(values).reduce(function (acc, key) {
|
20446
|
+
var _a;
|
20447
|
+
|
20448
|
+
return __assign$3(__assign$3({}, acc), (_a = {}, _a[key] = _this.getFieldValue(key), _a));
|
20449
|
+
}, {});
|
20450
|
+
_this._formData = __assign$3(__assign$3({}, _this._formData), values);
|
20451
|
+
|
20452
|
+
_this.notifyField(values, oldValues, changeType);
|
20453
|
+
};
|
20454
|
+
|
20455
|
+
this.setFieldsValue = function (values) {
|
20456
|
+
_this.commonSetFieldsValue(values);
|
20457
|
+
|
20458
|
+
var onValuesChange = _this._callbacks.onValuesChange;
|
20459
|
+
onValuesChange === null || onValuesChange === void 0 ? void 0 : onValuesChange(values, _this._formData);
|
20460
|
+
return true;
|
20461
|
+
};
|
20462
|
+
|
20463
|
+
this.innerSetFieldsValue = function (values, changeType) {
|
20464
|
+
_this.commonSetFieldsValue(values, changeType);
|
20465
|
+
|
20466
|
+
var _a = _this._callbacks,
|
20467
|
+
onValuesChange = _a.onValuesChange,
|
20468
|
+
onChange = _a.onChange;
|
20469
|
+
onValuesChange === null || onValuesChange === void 0 ? void 0 : onValuesChange(values, _this._formData);
|
20470
|
+
onChange === null || onChange === void 0 ? void 0 : onChange(values, _this._formData);
|
20471
|
+
return true;
|
20472
|
+
};
|
20473
|
+
|
20474
|
+
this.commonSetFieldValue = function (name, value, changeType) {
|
20475
|
+
var _a, _b, _c;
|
20476
|
+
|
20477
|
+
var oldValues = (_a = {}, _a[name] = _this.getFieldValue(name), _a);
|
20478
|
+
_this._formData = __assign$3(__assign$3({}, _this._formData), (_b = {}, _b[name] = value, _b));
|
20479
|
+
|
20480
|
+
_this.notifyField((_c = {}, _c[name] = value, _c), oldValues, changeType);
|
20481
|
+
};
|
20482
|
+
|
20483
|
+
this.setFieldValue = function (name, value) {
|
20484
|
+
var _a;
|
20485
|
+
|
20486
|
+
_this.commonSetFieldValue(name, value);
|
20487
|
+
|
20488
|
+
var onValuesChange = _this._callbacks.onValuesChange;
|
20489
|
+
onValuesChange && onValuesChange((_a = {}, _a[name] = value, _a), _this.getFieldsValue());
|
20490
|
+
return true;
|
20491
|
+
};
|
20492
|
+
|
20493
|
+
this.innerSetFieldValue = function (name, value, changeType) {
|
20494
|
+
var _a, _b;
|
20495
|
+
|
20496
|
+
_this.commonSetFieldValue(name, value, changeType);
|
20497
|
+
|
20498
|
+
var _c = _this._callbacks,
|
20499
|
+
onValuesChange = _c.onValuesChange,
|
20500
|
+
onChange = _c.onChange;
|
20501
|
+
onValuesChange && onValuesChange((_a = {}, _a[name] = value, _a), _this._formData);
|
20502
|
+
onChange && onChange((_b = {}, _b[name] = value, _b), _this._formData);
|
20503
|
+
return true;
|
20504
|
+
};
|
20505
|
+
|
20506
|
+
this.notifyField = function (values, oldValues, changeType) {
|
20507
|
+
if (changeType === void 0) {
|
20508
|
+
changeType = ValueChangeType.Update;
|
20509
|
+
}
|
20510
|
+
|
20511
|
+
Object.keys(values).map(function (fieldName) {
|
20512
|
+
var _a;
|
20513
|
+
|
20514
|
+
var fieldObj = ((_a = _this._fieldsList) === null || _a === void 0 ? void 0 : _a[fieldName]) || null;
|
20515
|
+
|
20516
|
+
if (fieldObj) {
|
20517
|
+
fieldObj.onValueChange(values[fieldName], oldValues[fieldName], {
|
20518
|
+
changeType: changeType
|
20519
|
+
});
|
20520
|
+
}
|
20521
|
+
});
|
20522
|
+
};
|
20523
|
+
|
20524
|
+
this.getFieldsValue = function (names) {
|
20525
|
+
if (names) {
|
20526
|
+
return names.map(function (name) {
|
20527
|
+
return _this.getFieldValue(name);
|
20528
|
+
});
|
20529
|
+
}
|
20530
|
+
|
20531
|
+
return deepClone(_this._formData);
|
20532
|
+
};
|
20533
|
+
|
20534
|
+
this.getFieldValue = function (name) {
|
20535
|
+
var _a;
|
20536
|
+
|
20537
|
+
return deepClone((_a = _this._formData) === null || _a === void 0 ? void 0 : _a[name]);
|
20538
|
+
};
|
20539
|
+
|
20540
|
+
this.getFieldError = function (name) {
|
20541
|
+
var _a;
|
20542
|
+
|
20543
|
+
var field = ((_a = _this._fieldsList) === null || _a === void 0 ? void 0 : _a[name]) || null;
|
20544
|
+
|
20545
|
+
if (field) {
|
20546
|
+
return field.getFieldError();
|
20547
|
+
}
|
20548
|
+
|
20549
|
+
return [];
|
20550
|
+
};
|
20551
|
+
|
20552
|
+
this.getFieldsError = function (names) {
|
20553
|
+
var fields = names || Object.keys(_this._fieldsList);
|
20554
|
+
return fields.reduce(function (pre, name) {
|
20555
|
+
var _a;
|
20556
|
+
|
20557
|
+
var theField = (_a = _this._fieldsList) === null || _a === void 0 ? void 0 : _a[name];
|
20558
|
+
|
20559
|
+
if (theField) {
|
20560
|
+
pre[name] = theField === null || theField === void 0 ? void 0 : theField.getFieldError();
|
20561
|
+
}
|
20562
|
+
|
20563
|
+
return pre;
|
20564
|
+
}, {});
|
20565
|
+
};
|
20566
|
+
|
20567
|
+
this.isFieldTouched = function (name) {
|
20568
|
+
var _a;
|
20569
|
+
|
20570
|
+
var field = ((_a = _this._fieldsList) === null || _a === void 0 ? void 0 : _a[name]) || null;
|
20571
|
+
|
20572
|
+
if (field) {
|
20573
|
+
return field.isFieldTouched();
|
20574
|
+
}
|
20575
|
+
|
20576
|
+
return false;
|
20577
|
+
};
|
20578
|
+
|
20579
|
+
this.registerField = function (name, self) {
|
20580
|
+
var _a, _b;
|
20581
|
+
|
20582
|
+
_this._fieldsList[name] = self;
|
20583
|
+
var initialValue = self.props.initialValue;
|
20584
|
+
|
20585
|
+
if (initialValue !== undefined && name) {
|
20586
|
+
_this._initialValues = __assign$3(__assign$3({}, _this._initialValues), (_a = {}, _a[name] = initialValue, _a));
|
20587
|
+
|
20588
|
+
_this.setFieldsValue(__assign$3(__assign$3({}, _this._formData), (_b = {}, _b[name] = initialValue, _b)));
|
20589
|
+
}
|
20590
|
+
|
20591
|
+
return function () {
|
20592
|
+
if (name in _this._fieldsList) {
|
20593
|
+
delete _this._fieldsList[name];
|
20594
|
+
delete _this._formData[name];
|
20595
|
+
}
|
20596
|
+
};
|
20597
|
+
};
|
20598
|
+
|
20599
|
+
this.setInitialValues = function (initVal) {
|
20600
|
+
_this._initialValues = deepClone(initVal || {});
|
20601
|
+
|
20602
|
+
_this.setFieldsValue(initVal);
|
20603
|
+
};
|
20604
|
+
|
20605
|
+
this.setInitialValue = function (fieldName, value) {
|
20606
|
+
if (!fieldName) {
|
20607
|
+
return;
|
20608
|
+
}
|
20609
|
+
|
20610
|
+
_this._initialValues[fieldName] = value;
|
20611
|
+
|
20612
|
+
_this.setFieldValue(fieldName, value);
|
20613
|
+
};
|
20614
|
+
|
20615
|
+
this.getInitialValue = function (fieldName) {
|
20616
|
+
return _this._initialValues[fieldName];
|
20617
|
+
};
|
20618
|
+
|
20619
|
+
this.resetFields = function () {
|
20620
|
+
var oldValues = __assign$3({}, _this._formData);
|
20621
|
+
|
20622
|
+
var initialValues = {};
|
20623
|
+
Object.keys(_this._formData).forEach(function (fieldName) {
|
20624
|
+
var _a;
|
20625
|
+
|
20626
|
+
var fieldObj = ((_a = _this._fieldsList) === null || _a === void 0 ? void 0 : _a[fieldName]) || null;
|
20627
|
+
|
20628
|
+
if (fieldObj) {
|
20629
|
+
initialValues[fieldName] = fieldObj.getInitialValue();
|
20630
|
+
}
|
20631
|
+
});
|
20632
|
+
var onValuesChange = _this._callbacks.onValuesChange;
|
20633
|
+
onValuesChange && onValuesChange(initialValues, _this._formData);
|
20634
|
+
_this._formData = initialValues;
|
20635
|
+
|
20636
|
+
_this.notifyField(initialValues, oldValues, ValueChangeType.Reset);
|
20637
|
+
};
|
20638
|
+
|
20639
|
+
this.validateFields = function () {
|
20640
|
+
var promiseList = [];
|
20641
|
+
Object.values(_this._fieldsList).forEach(function (entity) {
|
20642
|
+
var promise = entity.validateField();
|
20643
|
+
promiseList.push(promise.then(function (errors) {
|
20644
|
+
return errors;
|
20645
|
+
}));
|
20646
|
+
});
|
20647
|
+
var summaryPromise = new es6Promise.Promise(function (resolve, reject) {
|
20648
|
+
es6Promise.Promise.all(promiseList).then(function (res) {
|
17974
20649
|
var errorResults = res.filter(function (item) {
|
17975
20650
|
var _a;
|
17976
20651
|
|
@@ -17990,7 +20665,7 @@
|
|
17990
20665
|
this.submit = function () {
|
17991
20666
|
_this.validateFields().then(function (result) {
|
17992
20667
|
var onSubmit = _this._callbacks.onSubmit;
|
17993
|
-
onSubmit === null || onSubmit === void 0 ? void 0 : onSubmit(_this.
|
20668
|
+
onSubmit === null || onSubmit === void 0 ? void 0 : onSubmit(_this.getFieldsValue(), result);
|
17994
20669
|
}).catch(function (e) {
|
17995
20670
|
var onSubmitFailed = _this._callbacks.onSubmitFailed;
|
17996
20671
|
|
@@ -17998,7 +20673,7 @@
|
|
17998
20673
|
return;
|
17999
20674
|
}
|
18000
20675
|
|
18001
|
-
onSubmitFailed(_this.
|
20676
|
+
onSubmitFailed(_this.getFieldsValue(), e);
|
18002
20677
|
});
|
18003
20678
|
};
|
18004
20679
|
|
@@ -18027,7 +20702,11 @@
|
|
18027
20702
|
return {
|
18028
20703
|
registerField: _this.registerField,
|
18029
20704
|
setInitialValues: _this.setInitialValues,
|
18030
|
-
setCallbacks: _this.setCallbacks
|
20705
|
+
setCallbacks: _this.setCallbacks,
|
20706
|
+
getInitialValue: _this.getInitialValue,
|
20707
|
+
setInitialValue: _this.setInitialValue,
|
20708
|
+
innerSetFieldsValue: _this.innerSetFieldsValue,
|
20709
|
+
innerSetFieldValue: _this.innerSetFieldValue
|
18031
20710
|
};
|
18032
20711
|
};
|
18033
20712
|
}
|
@@ -18058,74 +20737,6 @@
|
|
18058
20737
|
layout: 'horizontal'
|
18059
20738
|
});
|
18060
20739
|
|
18061
|
-
// 注意:自动识别form关联组件的依据,请勿轻易改变代码结构
|
18062
|
-
// Notice: Automatically identify the basis of the associated component of the form, DO NOT change the code structure.
|
18063
|
-
var FormInternalComponentType;
|
18064
|
-
|
18065
|
-
(function (FormInternalComponentType) {
|
18066
|
-
FormInternalComponentType["Input"] = "Input";
|
18067
|
-
FormInternalComponentType["Textarea"] = "Textarea";
|
18068
|
-
FormInternalComponentType["Checkbox"] = "Checkbox";
|
18069
|
-
FormInternalComponentType["CheckboxGroup"] = "CheckboxGroup";
|
18070
|
-
FormInternalComponentType["DatePicker"] = "DatePicker";
|
18071
|
-
FormInternalComponentType["Picker"] = "Picker";
|
18072
|
-
FormInternalComponentType["Radio"] = "Radio";
|
18073
|
-
FormInternalComponentType["RadioGroup"] = "RadioGroup";
|
18074
|
-
FormInternalComponentType["Slider"] = "Slider";
|
18075
|
-
FormInternalComponentType["Switch"] = "Switch";
|
18076
|
-
FormInternalComponentType["ImagePicker"] = "ImagePicker";
|
18077
|
-
FormInternalComponentType["Rate"] = "Rate";
|
18078
|
-
FormInternalComponentType["Stepper"] = "Stepper";
|
18079
|
-
})(FormInternalComponentType || (FormInternalComponentType = {}));
|
18080
|
-
|
18081
|
-
var ValidateStatus;
|
18082
|
-
|
18083
|
-
(function (ValidateStatus) {
|
18084
|
-
ValidateStatus["Init"] = "init";
|
18085
|
-
ValidateStatus["Error"] = "error";
|
18086
|
-
ValidateStatus["Warning"] = "warning";
|
18087
|
-
ValidateStatus["Validating"] = "validating";
|
18088
|
-
ValidateStatus["Success"] = "success";
|
18089
|
-
})(ValidateStatus || (ValidateStatus = {}));
|
18090
|
-
|
18091
|
-
var isFieldRequired = function isFieldRequired(rules) {
|
18092
|
-
if (rules === void 0) {
|
18093
|
-
rules = [];
|
18094
|
-
}
|
18095
|
-
|
18096
|
-
return (rules || []).some(function (rule) {
|
18097
|
-
return rule === null || rule === void 0 ? void 0 : rule.required;
|
18098
|
-
});
|
18099
|
-
};
|
18100
|
-
var getErrorAndWarnings = function getErrorAndWarnings(result) {
|
18101
|
-
var errors = [];
|
18102
|
-
var warnings = [];
|
18103
|
-
var errorTypes = [];
|
18104
|
-
result.map(function (_a) {
|
18105
|
-
var _b = _a.message,
|
18106
|
-
message = _b === void 0 ? [] : _b,
|
18107
|
-
_c = _a.validateLevel,
|
18108
|
-
validateLevel = _c === void 0 ? 'error' : _c,
|
18109
|
-
resultErrorTypes = _a.errorTypes;
|
18110
|
-
|
18111
|
-
if (!(message === null || message === void 0 ? void 0 : message.length)) {
|
18112
|
-
return;
|
18113
|
-
}
|
18114
|
-
|
18115
|
-
if (validateLevel === 'warning') {
|
18116
|
-
warnings = __spreadArrays$1(warnings, message);
|
18117
|
-
} else {
|
18118
|
-
errors = __spreadArrays$1(errors, message);
|
18119
|
-
errorTypes = __spreadArrays$1(errorTypes, resultErrorTypes);
|
18120
|
-
}
|
18121
|
-
});
|
18122
|
-
return {
|
18123
|
-
warnings: warnings,
|
18124
|
-
errors: errors,
|
18125
|
-
errorTypes: errorTypes
|
18126
|
-
};
|
18127
|
-
};
|
18128
|
-
|
18129
20740
|
function DefaultPickerLinkedContainer(_a) {
|
18130
20741
|
var value = _a.value;
|
18131
20742
|
|
@@ -18150,6 +20761,10 @@
|
|
18150
20761
|
|
18151
20762
|
var className = prefixCls + "-form-picker-link-container";
|
18152
20763
|
var dateTimeStr = React.useMemo(function () {
|
20764
|
+
if (ts === undefined) {
|
20765
|
+
return '';
|
20766
|
+
}
|
20767
|
+
|
18153
20768
|
if (typeof ts === 'number') {
|
18154
20769
|
return formatDateTimeStr(ts, types);
|
18155
20770
|
}
|
@@ -18186,14 +20801,12 @@
|
|
18186
20801
|
__extends$1(FormItemInner, _super);
|
18187
20802
|
|
18188
20803
|
function FormItemInner(props, context) {
|
18189
|
-
var _a;
|
18190
|
-
|
18191
20804
|
var _this = _super.call(this, props) || this;
|
18192
20805
|
|
18193
20806
|
_this._errors = [];
|
18194
20807
|
_this._touched = false;
|
18195
20808
|
|
18196
|
-
_this.onValueChange = function (curValue, preValue) {
|
20809
|
+
_this.onValueChange = function (curValue, preValue, info) {
|
18197
20810
|
_this._touched = true;
|
18198
20811
|
var shouldUpdate = _this.props.shouldUpdate;
|
18199
20812
|
|
@@ -18205,9 +20818,33 @@
|
|
18205
20818
|
return;
|
18206
20819
|
}
|
18207
20820
|
|
20821
|
+
if ((info === null || info === void 0 ? void 0 : info.changeType) === ValueChangeType.Reset) {
|
20822
|
+
_this.props.onValidateStatusChange({
|
20823
|
+
errors: [],
|
20824
|
+
warnings: [],
|
20825
|
+
errorTypes: []
|
20826
|
+
});
|
20827
|
+
|
20828
|
+
_this._errors = [];
|
20829
|
+
}
|
20830
|
+
|
18208
20831
|
_this.forceUpdate();
|
18209
20832
|
};
|
18210
20833
|
|
20834
|
+
_this.getInitialValue = function () {
|
20835
|
+
var _a, _b;
|
20836
|
+
|
20837
|
+
var _c = _this.props,
|
20838
|
+
children = _c.children,
|
20839
|
+
displayType = _c.displayType;
|
20840
|
+
|
20841
|
+
var getInitialValue = _this.context.form.getInternalHooks().getInitialValue;
|
20842
|
+
|
20843
|
+
var childrenType = displayType || ((_a = children.type) === null || _a === void 0 ? void 0 : _a.displayName); // get user-defined initialValue or if not defined
|
20844
|
+
|
20845
|
+
return (_b = getInitialValue(_this.props.field)) !== null && _b !== void 0 ? _b : getDefaultValueForInterComponent(childrenType);
|
20846
|
+
};
|
20847
|
+
|
18211
20848
|
_this.getFieldError = function () {
|
18212
20849
|
return _this._errors;
|
18213
20850
|
};
|
@@ -18216,7 +20853,17 @@
|
|
18216
20853
|
return _this._touched;
|
18217
20854
|
};
|
18218
20855
|
|
18219
|
-
_this.
|
20856
|
+
_this.getAllRuleValidateTriggers = function () {
|
20857
|
+
var _a;
|
20858
|
+
|
20859
|
+
return ((_a = _this.props.rules) === null || _a === void 0 ? void 0 : _a.map(function (rule) {
|
20860
|
+
return rule.validateTrigger;
|
20861
|
+
}).flat().filter(function (v) {
|
20862
|
+
return !!v;
|
20863
|
+
})) || [];
|
20864
|
+
};
|
20865
|
+
|
20866
|
+
_this.validateField = function (validateTrigger) {
|
18220
20867
|
var _a;
|
18221
20868
|
|
18222
20869
|
var validateMessages = _this.context.validateMessages;
|
@@ -18225,12 +20872,18 @@
|
|
18225
20872
|
field = _b.field,
|
18226
20873
|
rules = _b.rules,
|
18227
20874
|
onValidateStatusChange = _b.onValidateStatusChange;
|
18228
|
-
var value = getFieldValue(field);
|
20875
|
+
var value = getFieldValue(field); // rules: if validateTrigger is not defined, all rules will be validated
|
20876
|
+
// if validateTrigger is defined, only rules with validateTrigger or without rule.validateTrigger will be validated
|
20877
|
+
|
20878
|
+
var curRules = validateTrigger ? rules === null || rules === void 0 ? void 0 : rules.filter(function (rule) {
|
20879
|
+
var triggerList = [].concat(rule.validateTrigger || validateTrigger);
|
20880
|
+
return triggerList.includes(validateTrigger);
|
20881
|
+
}) : rules;
|
18229
20882
|
|
18230
|
-
if ((
|
20883
|
+
if ((curRules === null || curRules === void 0 ? void 0 : curRules.length) && field) {
|
18231
20884
|
var fieldDom_1 = _this.props.getFormItemRef();
|
18232
20885
|
|
18233
|
-
var fieldValidator_1 = new Validator((_a = {}, _a[field] =
|
20886
|
+
var fieldValidator_1 = new Validator((_a = {}, _a[field] = curRules, _a), {
|
18234
20887
|
validateMessages: validateMessages
|
18235
20888
|
});
|
18236
20889
|
return new es6Promise.Promise(function (resolve) {
|
@@ -18269,20 +20922,25 @@
|
|
18269
20922
|
};
|
18270
20923
|
|
18271
20924
|
_this.setFieldData = function (value) {
|
18272
|
-
var
|
18273
|
-
|
18274
|
-
|
20925
|
+
var _a = _this.props,
|
20926
|
+
field = _a.field,
|
20927
|
+
_b = _a.trigger,
|
20928
|
+
trigger = _b === void 0 ? 'onChange' : _b;
|
20929
|
+
|
20930
|
+
var innerSetFieldValue = _this.context.form.getInternalHooks().innerSetFieldValue;
|
20931
|
+
|
20932
|
+
innerSetFieldValue(field, value);
|
18275
20933
|
|
18276
|
-
_this.validateField();
|
20934
|
+
_this.validateField(trigger);
|
18277
20935
|
};
|
18278
20936
|
|
18279
|
-
_this.
|
20937
|
+
_this.innerTriggerFunctionWithValueFirst = function (value) {
|
18280
20938
|
var _a, _b;
|
18281
20939
|
|
18282
20940
|
var args = [];
|
18283
20941
|
|
18284
|
-
for (var _i =
|
18285
|
-
args[_i -
|
20942
|
+
for (var _i = 1; _i < arguments.length; _i++) {
|
20943
|
+
args[_i - 1] = arguments[_i];
|
18286
20944
|
}
|
18287
20945
|
|
18288
20946
|
_this.setFieldData(value);
|
@@ -18293,29 +20951,23 @@
|
|
18293
20951
|
trigger = _d === void 0 ? 'onChange' : _d;
|
18294
20952
|
|
18295
20953
|
if (trigger && ((_a = children.props) === null || _a === void 0 ? void 0 : _a[trigger])) {
|
18296
|
-
(_b = children.props) === null || _b === void 0 ? void 0 : _b[trigger].apply(_b, __spreadArrays$1([
|
20954
|
+
(_b = children.props) === null || _b === void 0 ? void 0 : _b[trigger].apply(_b, __spreadArrays$1([value], args));
|
18297
20955
|
}
|
18298
20956
|
};
|
18299
20957
|
|
18300
|
-
_this.
|
20958
|
+
_this.innerOnInputFunction = function (_, value) {
|
18301
20959
|
var _a, _b;
|
18302
20960
|
|
18303
20961
|
var args = [];
|
18304
20962
|
|
18305
|
-
for (var _i =
|
18306
|
-
args[_i -
|
20963
|
+
for (var _i = 2; _i < arguments.length; _i++) {
|
20964
|
+
args[_i - 2] = arguments[_i];
|
18307
20965
|
}
|
18308
20966
|
|
18309
20967
|
_this.setFieldData(value);
|
18310
20968
|
|
18311
|
-
var
|
18312
|
-
|
18313
|
-
_d = _c.trigger,
|
18314
|
-
trigger = _d === void 0 ? 'onChange' : _d;
|
18315
|
-
|
18316
|
-
if (trigger && ((_a = children.props) === null || _a === void 0 ? void 0 : _a[trigger])) {
|
18317
|
-
(_b = children.props) === null || _b === void 0 ? void 0 : _b[trigger].apply(_b, __spreadArrays$1([value], args));
|
18318
|
-
}
|
20969
|
+
var children = _this.props.children;
|
20970
|
+
(_b = (_a = children.props) === null || _a === void 0 ? void 0 : _a.onInput) === null || _b === void 0 ? void 0 : _b.call.apply(_b, __spreadArrays$1([_a, _, value], args));
|
18319
20971
|
};
|
18320
20972
|
|
18321
20973
|
_this.innerClearFunction = function () {
|
@@ -18339,8 +20991,8 @@
|
|
18339
20991
|
_this.destroyField = function () {};
|
18340
20992
|
|
18341
20993
|
if ((props === null || props === void 0 ? void 0 : props.initialValue) && props.field) {
|
18342
|
-
var
|
18343
|
-
|
20994
|
+
var setInitialValue = context.form.getInternalHooks().setInitialValue;
|
20995
|
+
setInitialValue(props.field, props.initialValue);
|
18344
20996
|
}
|
18345
20997
|
|
18346
20998
|
return _this;
|
@@ -18356,110 +21008,89 @@
|
|
18356
21008
|
};
|
18357
21009
|
|
18358
21010
|
FormItemInner.prototype.renderChildren = function () {
|
18359
|
-
var _a;
|
18360
|
-
|
18361
21011
|
var _this = this;
|
18362
21012
|
|
18363
|
-
var _b, _c
|
21013
|
+
var _a, _b, _c;
|
18364
21014
|
|
18365
|
-
var
|
18366
|
-
children =
|
18367
|
-
field =
|
18368
|
-
|
18369
|
-
trigger =
|
18370
|
-
|
18371
|
-
triggerPropsField =
|
18372
|
-
displayType =
|
21015
|
+
var _d = this.props,
|
21016
|
+
children = _d.children,
|
21017
|
+
field = _d.field,
|
21018
|
+
_e = _d.trigger,
|
21019
|
+
trigger = _e === void 0 ? 'onChange' : _e,
|
21020
|
+
_f = _d.triggerPropsField,
|
21021
|
+
triggerPropsField = _f === void 0 ? 'value' : _f,
|
21022
|
+
displayType = _d.displayType,
|
21023
|
+
disabled = _d.disabled;
|
18373
21024
|
var getFieldValue = this.context.form.getFieldValue;
|
18374
|
-
var
|
18375
|
-
|
21025
|
+
var childrenProps = {
|
21026
|
+
disabled: disabled
|
21027
|
+
}; // inject validateTriggers of rules
|
21028
|
+
|
21029
|
+
this.getAllRuleValidateTriggers().forEach(function (triggerName) {
|
21030
|
+
childrenProps[triggerName] = function (e) {
|
21031
|
+
var _a, _b;
|
21032
|
+
|
21033
|
+
_this.validateField(triggerName);
|
21034
|
+
|
21035
|
+
(_b = (_a = children === null || children === void 0 ? void 0 : children.props) === null || _a === void 0 ? void 0 : _a[triggerName]) === null || _b === void 0 ? void 0 : _b.call(_a, e);
|
21036
|
+
};
|
21037
|
+
});
|
21038
|
+
var childrenType = displayType || ((_a = children.type) === null || _a === void 0 ? void 0 : _a.displayName);
|
18376
21039
|
|
18377
21040
|
switch (childrenType) {
|
18378
21041
|
case FormInternalComponentType.Input:
|
18379
21042
|
case FormInternalComponentType.Textarea:
|
18380
|
-
|
18381
|
-
|
18382
|
-
|
18383
|
-
onClear: this.innerClearFunction,
|
18384
|
-
disabled: this.props.disabled
|
18385
|
-
};
|
18386
|
-
break;
|
18387
|
-
|
18388
|
-
case FormInternalComponentType.Checkbox:
|
18389
|
-
case FormInternalComponentType.Radio:
|
18390
|
-
case FormInternalComponentType.Slider:
|
18391
|
-
case FormInternalComponentType.RadioGroup:
|
18392
|
-
case FormInternalComponentType.CheckboxGroup:
|
18393
|
-
props = {
|
18394
|
-
value: getFieldValue(field),
|
18395
|
-
onChange: this.innerTriggerFunctionWithValueFirst,
|
18396
|
-
disabled: this.props.disabled
|
18397
|
-
};
|
21043
|
+
childrenProps.value = getFieldValue(field) || '';
|
21044
|
+
childrenProps.onInput = this.innerOnInputFunction;
|
21045
|
+
childrenProps.onClear = this.innerClearFunction;
|
18398
21046
|
break;
|
18399
21047
|
|
18400
21048
|
case FormInternalComponentType.DatePicker:
|
18401
|
-
|
18402
|
-
|
18403
|
-
|
18404
|
-
|
18405
|
-
|
18406
|
-
|
18407
|
-
|
18408
|
-
|
18409
|
-
});
|
18410
|
-
}
|
21049
|
+
childrenProps.currentTs = getFieldValue(field);
|
21050
|
+
childrenProps.onChange = this.innerTriggerFunctionWithValueFirst;
|
21051
|
+
|
21052
|
+
childrenProps.renderLinkedContainer = ((_b = children.props) === null || _b === void 0 ? void 0 : _b.renderLinkedContainer) || function (ts, types) {
|
21053
|
+
return /*#__PURE__*/React__default["default"].createElement(DefaultDatePickerLinkedContainer, {
|
21054
|
+
ts: ts,
|
21055
|
+
types: types
|
21056
|
+
});
|
18411
21057
|
};
|
21058
|
+
|
18412
21059
|
break;
|
18413
21060
|
|
18414
21061
|
case FormInternalComponentType.Picker:
|
18415
|
-
|
18416
|
-
|
18417
|
-
|
18418
|
-
|
18419
|
-
|
18420
|
-
|
18421
|
-
|
18422
|
-
});
|
18423
|
-
}
|
21062
|
+
childrenProps.value = getFieldValue(field) || '';
|
21063
|
+
childrenProps.onChange = this.innerTriggerFunctionWithValueFirst;
|
21064
|
+
|
21065
|
+
childrenProps.renderLinkedContainer = ((_c = children.props) === null || _c === void 0 ? void 0 : _c.renderLinkedContainer) || function (val) {
|
21066
|
+
return /*#__PURE__*/React__default["default"].createElement(DefaultPickerLinkedContainer, {
|
21067
|
+
value: val
|
21068
|
+
});
|
18424
21069
|
};
|
21070
|
+
|
18425
21071
|
break;
|
18426
21072
|
|
18427
21073
|
case FormInternalComponentType.Switch:
|
18428
|
-
|
18429
|
-
|
18430
|
-
onChange: this.innerTriggerFunctionWithValueFirst,
|
18431
|
-
disabled: this.props.disabled
|
18432
|
-
};
|
21074
|
+
childrenProps.checked = Boolean(getFieldValue(field));
|
21075
|
+
childrenProps.onChange = this.innerTriggerFunctionWithValueFirst;
|
18433
21076
|
break;
|
18434
21077
|
|
18435
21078
|
case FormInternalComponentType.ImagePicker:
|
18436
|
-
|
18437
|
-
|
18438
|
-
onChange: this.innerTriggerFunctionWithValueFirst,
|
18439
|
-
disabled: this.props.disabled
|
18440
|
-
};
|
21079
|
+
childrenProps.images = getFieldValue(field);
|
21080
|
+
childrenProps.onChange = this.innerTriggerFunctionWithValueFirst;
|
18441
21081
|
break;
|
18442
21082
|
|
18443
21083
|
default:
|
18444
|
-
|
18445
|
-
|
18446
|
-
|
18447
|
-
|
18448
|
-
props[trigger] = function (newValue) {
|
18449
|
-
var args = [];
|
21084
|
+
if (triggerPropsField) {
|
21085
|
+
childrenProps[triggerPropsField] = getFieldValue(field);
|
21086
|
+
} // inject the validated result
|
18450
21087
|
|
18451
|
-
for (var _i = 1; _i < arguments.length; _i++) {
|
18452
|
-
args[_i - 1] = arguments[_i];
|
18453
|
-
}
|
18454
|
-
|
18455
|
-
_this.setFieldData(newValue);
|
18456
|
-
|
18457
|
-
originTrigger_1 && originTrigger_1.apply(void 0, __spreadArrays$1([newValue], args));
|
18458
|
-
};
|
18459
21088
|
|
21089
|
+
childrenProps.error = this._errors;
|
21090
|
+
childrenProps[trigger] = this.innerTriggerFunctionWithValueFirst;
|
18460
21091
|
}
|
18461
21092
|
|
18462
|
-
return /*#__PURE__*/React__default["default"].cloneElement(children,
|
21093
|
+
return /*#__PURE__*/React__default["default"].cloneElement(children, childrenProps);
|
18463
21094
|
};
|
18464
21095
|
|
18465
21096
|
FormItemInner.prototype.render = function () {
|
@@ -18570,6 +21201,7 @@
|
|
18570
21201
|
formInstance = props.form,
|
18571
21202
|
children = props.children,
|
18572
21203
|
onValuesChange = props.onValuesChange,
|
21204
|
+
onChange = props.onChange,
|
18573
21205
|
onSubmit = props.onSubmit,
|
18574
21206
|
onSubmitFailed = props.onSubmitFailed,
|
18575
21207
|
disabled = props.disabled;
|
@@ -18584,7 +21216,8 @@
|
|
18584
21216
|
setCallbacks({
|
18585
21217
|
onValuesChange: onValuesChange,
|
18586
21218
|
onSubmit: onSubmit,
|
18587
|
-
onSubmitFailed: onSubmitFailed
|
21219
|
+
onSubmitFailed: onSubmitFailed,
|
21220
|
+
onChange: onChange
|
18588
21221
|
});
|
18589
21222
|
|
18590
21223
|
if (!initRef.current) {
|
@@ -23115,7 +25748,7 @@
|
|
23115
25748
|
function renderInput(_a) {
|
23116
25749
|
var prefixCls = _a.prefixCls;
|
23117
25750
|
var prefix = prefixCls + "-input";
|
23118
|
-
return renderWrapper(prefix, type, /*#__PURE__*/React__default["default"].createElement("input", __assign$3({}, nativeProps, {
|
25751
|
+
return renderWrapper(prefix, type + " single-line", /*#__PURE__*/React__default["default"].createElement("input", __assign$3({}, nativeProps, {
|
23119
25752
|
id: id,
|
23120
25753
|
name: name,
|
23121
25754
|
maxLength: maxLength,
|
@@ -24734,10 +27367,10 @@
|
|
24734
27367
|
setDirectionState = _k[2];
|
24735
27368
|
|
24736
27369
|
var getOffset = React.useCallback(function (dir) {
|
24737
|
-
return getDefaultValue(isObject$
|
27370
|
+
return getDefaultValue(isObject$3(edgeOffset) ? edgeOffset[dir] : edgeOffset, defaultEdgeOffset[dir]);
|
24738
27371
|
}, [edgeOffset]);
|
24739
27372
|
var getAutoDirection = React.useCallback(function (dir) {
|
24740
|
-
return getDefaultValue(isObject$
|
27373
|
+
return getDefaultValue(isObject$3(useAutoDirection) ? useAutoDirection[dir] : useAutoDirection, defaultAutoDirection);
|
24741
27374
|
}, [useAutoDirection]);
|
24742
27375
|
React.useEffect(function () {
|
24743
27376
|
setDirectionState(direction);
|
@@ -24851,20 +27484,38 @@
|
|
24851
27484
|
|
24852
27485
|
|
24853
27486
|
if (verticalAuto) {
|
24854
|
-
var
|
24855
|
-
var popoverBottom = childRect.top + (newConfig.top && newConfig.height ? newConfig.top + newConfig.height : 0); // 顶部安全距离不够,调整到底部
|
24856
|
-
// @en The top safety distance is not enough, adjust to the bottom
|
24857
|
-
|
24858
|
-
if (directionState.indexOf('top') !== -1 && popoverTop < topOffset) {
|
27487
|
+
var setToBottom = function setToBottom() {
|
24859
27488
|
newConfig.top = verticalOffset + childRect.height;
|
24860
27489
|
newConfig.bottom = null;
|
24861
27490
|
onAdjustDirection('bottom');
|
24862
|
-
}
|
24863
|
-
|
24864
|
-
|
27491
|
+
};
|
27492
|
+
|
27493
|
+
var setToTop = function setToTop() {
|
24865
27494
|
newConfig.top = null;
|
24866
27495
|
newConfig.bottom = verticalOffset + childRect.height;
|
24867
27496
|
onAdjustDirection('top');
|
27497
|
+
}; // 判断上下空间是否都不足以展示气泡内容
|
27498
|
+
// @en Determine whether there is insufficient space both above and below to display content
|
27499
|
+
|
27500
|
+
|
27501
|
+
var isPopoverTooTall = window.innerHeight - topOffset - bottomOffset < 2 * (newConfig.height || 0) + 2 * verticalOffset + childRect.height;
|
27502
|
+
|
27503
|
+
if (isPopoverTooTall) {
|
27504
|
+
var spaceAbove = childRect.top;
|
27505
|
+
var spaceBelow = window.innerHeight - childRect.bottom;
|
27506
|
+
spaceAbove > spaceBelow ? setToTop() : setToBottom();
|
27507
|
+
} else {
|
27508
|
+
var popoverTop = childRect.bottom - (newConfig.bottom && newConfig.height ? newConfig.bottom + newConfig.height : 0);
|
27509
|
+
var popoverBottom = childRect.top + (newConfig.top && newConfig.height ? newConfig.top + newConfig.height : 0); // 顶部安全距离不够,调整到底部
|
27510
|
+
// @en The top safety distance is not enough, adjust to the bottom
|
27511
|
+
|
27512
|
+
if (directionState.indexOf('top') !== -1 && popoverTop < topOffset) {
|
27513
|
+
setToBottom();
|
27514
|
+
} else if ( // 底部安全距离不够,调整到顶部
|
27515
|
+
// @en The bottom safety distance is not enough, adjust to the top
|
27516
|
+
directionState.indexOf('bottom') !== -1 && popoverBottom + bottomOffset > window.innerHeight) {
|
27517
|
+
setToTop();
|
27518
|
+
}
|
24868
27519
|
}
|
24869
27520
|
} // 挂载在全局的气泡需要计算相对屏幕的位置
|
24870
27521
|
// @en Bubble mounted in the global needs to calculate the position relative to the screen
|
@@ -25179,7 +27830,7 @@
|
|
25179
27830
|
var closeTimer = React.useRef(0);
|
25180
27831
|
/** 垂直方向自适应 */
|
25181
27832
|
|
25182
|
-
var autoVerticalDirection = getDefaultValue(isObject$
|
27833
|
+
var autoVerticalDirection = getDefaultValue(isObject$3(useAutoDirection) ? useAutoDirection.vertical : useAutoDirection, defaultAutoDirection);
|
25183
27834
|
|
25184
27835
|
var popoverDisappear = function popoverDisappear() {
|
25185
27836
|
onVisibleChange(false);
|
@@ -26645,7 +29296,7 @@
|
|
26645
29296
|
layout: layout,
|
26646
29297
|
disabled: disabled,
|
26647
29298
|
icons: icons,
|
26648
|
-
value: groupValue === void 0 ? [] : [groupValue],
|
29299
|
+
value: groupValue === void 0 || groupValue === null ? [] : [groupValue],
|
26649
29300
|
onChange: handleChange
|
26650
29301
|
}
|
26651
29302
|
}, children, !children && options && options.map(function (option) {
|
@@ -27907,7 +30558,7 @@
|
|
27907
30558
|
});
|
27908
30559
|
|
27909
30560
|
var getWidth = function getWidth(idx) {
|
27910
|
-
if (isArray$
|
30561
|
+
if (isArray$2(width)) {
|
27911
30562
|
return width[idx];
|
27912
30563
|
}
|
27913
30564
|
|