@kne/super-select 0.1.11 → 0.1.12
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/README.md +6 -6
- package/dist/index.js +57 -2594
- package/dist/index.js.map +1 -1
- package/dist/index.modern.js +54 -2594
- package/dist/index.modern.js.map +1 -1
- package/package.json +4 -2
package/dist/index.modern.js
CHANGED
|
@@ -3,8 +3,12 @@ import { createContext } from '@kne/global-context';
|
|
|
3
3
|
import useResize from '@kne/use-resize';
|
|
4
4
|
import useControlValue from '@kne/use-control-value';
|
|
5
5
|
import classnames from 'classnames';
|
|
6
|
+
import isEqual from 'lodash/isEqual';
|
|
7
|
+
import last from 'lodash/last';
|
|
6
8
|
import { Modal, App, Dropdown, Flex, Tag, Checkbox, List, Row, Col, Button, Popover } from 'antd';
|
|
7
9
|
import { CloseCircleFilled, DownOutlined, CheckOutlined } from '@ant-design/icons';
|
|
10
|
+
import { isNotEmpty } from '@kne/is-empty';
|
|
11
|
+
import get from 'lodash/get';
|
|
8
12
|
import SimpleBar from 'simplebar-react';
|
|
9
13
|
import 'simplebar-react/dist/simplebar.min.css';
|
|
10
14
|
import SearchInput from '@kne/search-input';
|
|
@@ -35,2211 +39,6 @@ const {
|
|
|
35
39
|
useContext
|
|
36
40
|
} = context;
|
|
37
41
|
|
|
38
|
-
/**
|
|
39
|
-
* Removes all key-value entries from the list cache.
|
|
40
|
-
*
|
|
41
|
-
* @private
|
|
42
|
-
* @name clear
|
|
43
|
-
* @memberOf ListCache
|
|
44
|
-
*/
|
|
45
|
-
function listCacheClear() {
|
|
46
|
-
this.__data__ = [];
|
|
47
|
-
this.size = 0;
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
var _listCacheClear = listCacheClear;
|
|
51
|
-
|
|
52
|
-
/**
|
|
53
|
-
* Performs a
|
|
54
|
-
* [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
|
|
55
|
-
* comparison between two values to determine if they are equivalent.
|
|
56
|
-
*
|
|
57
|
-
* @static
|
|
58
|
-
* @memberOf _
|
|
59
|
-
* @since 4.0.0
|
|
60
|
-
* @category Lang
|
|
61
|
-
* @param {*} value The value to compare.
|
|
62
|
-
* @param {*} other The other value to compare.
|
|
63
|
-
* @returns {boolean} Returns `true` if the values are equivalent, else `false`.
|
|
64
|
-
* @example
|
|
65
|
-
*
|
|
66
|
-
* var object = { 'a': 1 };
|
|
67
|
-
* var other = { 'a': 1 };
|
|
68
|
-
*
|
|
69
|
-
* _.eq(object, object);
|
|
70
|
-
* // => true
|
|
71
|
-
*
|
|
72
|
-
* _.eq(object, other);
|
|
73
|
-
* // => false
|
|
74
|
-
*
|
|
75
|
-
* _.eq('a', 'a');
|
|
76
|
-
* // => true
|
|
77
|
-
*
|
|
78
|
-
* _.eq('a', Object('a'));
|
|
79
|
-
* // => false
|
|
80
|
-
*
|
|
81
|
-
* _.eq(NaN, NaN);
|
|
82
|
-
* // => true
|
|
83
|
-
*/
|
|
84
|
-
function eq(value, other) {
|
|
85
|
-
return value === other || (value !== value && other !== other);
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
var eq_1 = eq;
|
|
89
|
-
|
|
90
|
-
/**
|
|
91
|
-
* Gets the index at which the `key` is found in `array` of key-value pairs.
|
|
92
|
-
*
|
|
93
|
-
* @private
|
|
94
|
-
* @param {Array} array The array to inspect.
|
|
95
|
-
* @param {*} key The key to search for.
|
|
96
|
-
* @returns {number} Returns the index of the matched value, else `-1`.
|
|
97
|
-
*/
|
|
98
|
-
function assocIndexOf(array, key) {
|
|
99
|
-
var length = array.length;
|
|
100
|
-
while (length--) {
|
|
101
|
-
if (eq_1(array[length][0], key)) {
|
|
102
|
-
return length;
|
|
103
|
-
}
|
|
104
|
-
}
|
|
105
|
-
return -1;
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
var _assocIndexOf = assocIndexOf;
|
|
109
|
-
|
|
110
|
-
/** Used for built-in method references. */
|
|
111
|
-
var arrayProto = Array.prototype;
|
|
112
|
-
|
|
113
|
-
/** Built-in value references. */
|
|
114
|
-
var splice = arrayProto.splice;
|
|
115
|
-
|
|
116
|
-
/**
|
|
117
|
-
* Removes `key` and its value from the list cache.
|
|
118
|
-
*
|
|
119
|
-
* @private
|
|
120
|
-
* @name delete
|
|
121
|
-
* @memberOf ListCache
|
|
122
|
-
* @param {string} key The key of the value to remove.
|
|
123
|
-
* @returns {boolean} Returns `true` if the entry was removed, else `false`.
|
|
124
|
-
*/
|
|
125
|
-
function listCacheDelete(key) {
|
|
126
|
-
var data = this.__data__,
|
|
127
|
-
index = _assocIndexOf(data, key);
|
|
128
|
-
|
|
129
|
-
if (index < 0) {
|
|
130
|
-
return false;
|
|
131
|
-
}
|
|
132
|
-
var lastIndex = data.length - 1;
|
|
133
|
-
if (index == lastIndex) {
|
|
134
|
-
data.pop();
|
|
135
|
-
} else {
|
|
136
|
-
splice.call(data, index, 1);
|
|
137
|
-
}
|
|
138
|
-
--this.size;
|
|
139
|
-
return true;
|
|
140
|
-
}
|
|
141
|
-
|
|
142
|
-
var _listCacheDelete = listCacheDelete;
|
|
143
|
-
|
|
144
|
-
/**
|
|
145
|
-
* Gets the list cache value for `key`.
|
|
146
|
-
*
|
|
147
|
-
* @private
|
|
148
|
-
* @name get
|
|
149
|
-
* @memberOf ListCache
|
|
150
|
-
* @param {string} key The key of the value to get.
|
|
151
|
-
* @returns {*} Returns the entry value.
|
|
152
|
-
*/
|
|
153
|
-
function listCacheGet(key) {
|
|
154
|
-
var data = this.__data__,
|
|
155
|
-
index = _assocIndexOf(data, key);
|
|
156
|
-
|
|
157
|
-
return index < 0 ? undefined : data[index][1];
|
|
158
|
-
}
|
|
159
|
-
|
|
160
|
-
var _listCacheGet = listCacheGet;
|
|
161
|
-
|
|
162
|
-
/**
|
|
163
|
-
* Checks if a list cache value for `key` exists.
|
|
164
|
-
*
|
|
165
|
-
* @private
|
|
166
|
-
* @name has
|
|
167
|
-
* @memberOf ListCache
|
|
168
|
-
* @param {string} key The key of the entry to check.
|
|
169
|
-
* @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
|
|
170
|
-
*/
|
|
171
|
-
function listCacheHas(key) {
|
|
172
|
-
return _assocIndexOf(this.__data__, key) > -1;
|
|
173
|
-
}
|
|
174
|
-
|
|
175
|
-
var _listCacheHas = listCacheHas;
|
|
176
|
-
|
|
177
|
-
/**
|
|
178
|
-
* Sets the list cache `key` to `value`.
|
|
179
|
-
*
|
|
180
|
-
* @private
|
|
181
|
-
* @name set
|
|
182
|
-
* @memberOf ListCache
|
|
183
|
-
* @param {string} key The key of the value to set.
|
|
184
|
-
* @param {*} value The value to set.
|
|
185
|
-
* @returns {Object} Returns the list cache instance.
|
|
186
|
-
*/
|
|
187
|
-
function listCacheSet(key, value) {
|
|
188
|
-
var data = this.__data__,
|
|
189
|
-
index = _assocIndexOf(data, key);
|
|
190
|
-
|
|
191
|
-
if (index < 0) {
|
|
192
|
-
++this.size;
|
|
193
|
-
data.push([key, value]);
|
|
194
|
-
} else {
|
|
195
|
-
data[index][1] = value;
|
|
196
|
-
}
|
|
197
|
-
return this;
|
|
198
|
-
}
|
|
199
|
-
|
|
200
|
-
var _listCacheSet = listCacheSet;
|
|
201
|
-
|
|
202
|
-
/**
|
|
203
|
-
* Creates an list cache object.
|
|
204
|
-
*
|
|
205
|
-
* @private
|
|
206
|
-
* @constructor
|
|
207
|
-
* @param {Array} [entries] The key-value pairs to cache.
|
|
208
|
-
*/
|
|
209
|
-
function ListCache(entries) {
|
|
210
|
-
var index = -1,
|
|
211
|
-
length = entries == null ? 0 : entries.length;
|
|
212
|
-
|
|
213
|
-
this.clear();
|
|
214
|
-
while (++index < length) {
|
|
215
|
-
var entry = entries[index];
|
|
216
|
-
this.set(entry[0], entry[1]);
|
|
217
|
-
}
|
|
218
|
-
}
|
|
219
|
-
|
|
220
|
-
// Add methods to `ListCache`.
|
|
221
|
-
ListCache.prototype.clear = _listCacheClear;
|
|
222
|
-
ListCache.prototype['delete'] = _listCacheDelete;
|
|
223
|
-
ListCache.prototype.get = _listCacheGet;
|
|
224
|
-
ListCache.prototype.has = _listCacheHas;
|
|
225
|
-
ListCache.prototype.set = _listCacheSet;
|
|
226
|
-
|
|
227
|
-
var _ListCache = ListCache;
|
|
228
|
-
|
|
229
|
-
/**
|
|
230
|
-
* Removes all key-value entries from the stack.
|
|
231
|
-
*
|
|
232
|
-
* @private
|
|
233
|
-
* @name clear
|
|
234
|
-
* @memberOf Stack
|
|
235
|
-
*/
|
|
236
|
-
function stackClear() {
|
|
237
|
-
this.__data__ = new _ListCache;
|
|
238
|
-
this.size = 0;
|
|
239
|
-
}
|
|
240
|
-
|
|
241
|
-
var _stackClear = stackClear;
|
|
242
|
-
|
|
243
|
-
/**
|
|
244
|
-
* Removes `key` and its value from the stack.
|
|
245
|
-
*
|
|
246
|
-
* @private
|
|
247
|
-
* @name delete
|
|
248
|
-
* @memberOf Stack
|
|
249
|
-
* @param {string} key The key of the value to remove.
|
|
250
|
-
* @returns {boolean} Returns `true` if the entry was removed, else `false`.
|
|
251
|
-
*/
|
|
252
|
-
function stackDelete(key) {
|
|
253
|
-
var data = this.__data__,
|
|
254
|
-
result = data['delete'](key);
|
|
255
|
-
|
|
256
|
-
this.size = data.size;
|
|
257
|
-
return result;
|
|
258
|
-
}
|
|
259
|
-
|
|
260
|
-
var _stackDelete = stackDelete;
|
|
261
|
-
|
|
262
|
-
/**
|
|
263
|
-
* Gets the stack value for `key`.
|
|
264
|
-
*
|
|
265
|
-
* @private
|
|
266
|
-
* @name get
|
|
267
|
-
* @memberOf Stack
|
|
268
|
-
* @param {string} key The key of the value to get.
|
|
269
|
-
* @returns {*} Returns the entry value.
|
|
270
|
-
*/
|
|
271
|
-
function stackGet(key) {
|
|
272
|
-
return this.__data__.get(key);
|
|
273
|
-
}
|
|
274
|
-
|
|
275
|
-
var _stackGet = stackGet;
|
|
276
|
-
|
|
277
|
-
/**
|
|
278
|
-
* Checks if a stack value for `key` exists.
|
|
279
|
-
*
|
|
280
|
-
* @private
|
|
281
|
-
* @name has
|
|
282
|
-
* @memberOf Stack
|
|
283
|
-
* @param {string} key The key of the entry to check.
|
|
284
|
-
* @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
|
|
285
|
-
*/
|
|
286
|
-
function stackHas(key) {
|
|
287
|
-
return this.__data__.has(key);
|
|
288
|
-
}
|
|
289
|
-
|
|
290
|
-
var _stackHas = stackHas;
|
|
291
|
-
|
|
292
|
-
var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
|
|
293
|
-
|
|
294
|
-
function createCommonjsModule(fn) {
|
|
295
|
-
var module = { exports: {} };
|
|
296
|
-
return fn(module, module.exports), module.exports;
|
|
297
|
-
}
|
|
298
|
-
|
|
299
|
-
/** Detect free variable `global` from Node.js. */
|
|
300
|
-
|
|
301
|
-
var freeGlobal = typeof commonjsGlobal == 'object' && commonjsGlobal && commonjsGlobal.Object === Object && commonjsGlobal;
|
|
302
|
-
|
|
303
|
-
var _freeGlobal = freeGlobal;
|
|
304
|
-
|
|
305
|
-
/** Detect free variable `self`. */
|
|
306
|
-
var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
|
|
307
|
-
|
|
308
|
-
/** Used as a reference to the global object. */
|
|
309
|
-
var root = _freeGlobal || freeSelf || Function('return this')();
|
|
310
|
-
|
|
311
|
-
var _root = root;
|
|
312
|
-
|
|
313
|
-
/** Built-in value references. */
|
|
314
|
-
var Symbol = _root.Symbol;
|
|
315
|
-
|
|
316
|
-
var _Symbol = Symbol;
|
|
317
|
-
|
|
318
|
-
/** Used for built-in method references. */
|
|
319
|
-
var objectProto$b = Object.prototype;
|
|
320
|
-
|
|
321
|
-
/** Used to check objects for own properties. */
|
|
322
|
-
var hasOwnProperty$8 = objectProto$b.hasOwnProperty;
|
|
323
|
-
|
|
324
|
-
/**
|
|
325
|
-
* Used to resolve the
|
|
326
|
-
* [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
|
|
327
|
-
* of values.
|
|
328
|
-
*/
|
|
329
|
-
var nativeObjectToString$1 = objectProto$b.toString;
|
|
330
|
-
|
|
331
|
-
/** Built-in value references. */
|
|
332
|
-
var symToStringTag$1 = _Symbol ? _Symbol.toStringTag : undefined;
|
|
333
|
-
|
|
334
|
-
/**
|
|
335
|
-
* A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.
|
|
336
|
-
*
|
|
337
|
-
* @private
|
|
338
|
-
* @param {*} value The value to query.
|
|
339
|
-
* @returns {string} Returns the raw `toStringTag`.
|
|
340
|
-
*/
|
|
341
|
-
function getRawTag(value) {
|
|
342
|
-
var isOwn = hasOwnProperty$8.call(value, symToStringTag$1),
|
|
343
|
-
tag = value[symToStringTag$1];
|
|
344
|
-
|
|
345
|
-
try {
|
|
346
|
-
value[symToStringTag$1] = undefined;
|
|
347
|
-
var unmasked = true;
|
|
348
|
-
} catch (e) {}
|
|
349
|
-
|
|
350
|
-
var result = nativeObjectToString$1.call(value);
|
|
351
|
-
if (unmasked) {
|
|
352
|
-
if (isOwn) {
|
|
353
|
-
value[symToStringTag$1] = tag;
|
|
354
|
-
} else {
|
|
355
|
-
delete value[symToStringTag$1];
|
|
356
|
-
}
|
|
357
|
-
}
|
|
358
|
-
return result;
|
|
359
|
-
}
|
|
360
|
-
|
|
361
|
-
var _getRawTag = getRawTag;
|
|
362
|
-
|
|
363
|
-
/** Used for built-in method references. */
|
|
364
|
-
var objectProto$a = Object.prototype;
|
|
365
|
-
|
|
366
|
-
/**
|
|
367
|
-
* Used to resolve the
|
|
368
|
-
* [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
|
|
369
|
-
* of values.
|
|
370
|
-
*/
|
|
371
|
-
var nativeObjectToString = objectProto$a.toString;
|
|
372
|
-
|
|
373
|
-
/**
|
|
374
|
-
* Converts `value` to a string using `Object.prototype.toString`.
|
|
375
|
-
*
|
|
376
|
-
* @private
|
|
377
|
-
* @param {*} value The value to convert.
|
|
378
|
-
* @returns {string} Returns the converted string.
|
|
379
|
-
*/
|
|
380
|
-
function objectToString(value) {
|
|
381
|
-
return nativeObjectToString.call(value);
|
|
382
|
-
}
|
|
383
|
-
|
|
384
|
-
var _objectToString = objectToString;
|
|
385
|
-
|
|
386
|
-
/** `Object#toString` result references. */
|
|
387
|
-
var nullTag = '[object Null]',
|
|
388
|
-
undefinedTag = '[object Undefined]';
|
|
389
|
-
|
|
390
|
-
/** Built-in value references. */
|
|
391
|
-
var symToStringTag = _Symbol ? _Symbol.toStringTag : undefined;
|
|
392
|
-
|
|
393
|
-
/**
|
|
394
|
-
* The base implementation of `getTag` without fallbacks for buggy environments.
|
|
395
|
-
*
|
|
396
|
-
* @private
|
|
397
|
-
* @param {*} value The value to query.
|
|
398
|
-
* @returns {string} Returns the `toStringTag`.
|
|
399
|
-
*/
|
|
400
|
-
function baseGetTag(value) {
|
|
401
|
-
if (value == null) {
|
|
402
|
-
return value === undefined ? undefinedTag : nullTag;
|
|
403
|
-
}
|
|
404
|
-
return (symToStringTag && symToStringTag in Object(value))
|
|
405
|
-
? _getRawTag(value)
|
|
406
|
-
: _objectToString(value);
|
|
407
|
-
}
|
|
408
|
-
|
|
409
|
-
var _baseGetTag = baseGetTag;
|
|
410
|
-
|
|
411
|
-
/**
|
|
412
|
-
* Checks if `value` is the
|
|
413
|
-
* [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
|
|
414
|
-
* of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
|
|
415
|
-
*
|
|
416
|
-
* @static
|
|
417
|
-
* @memberOf _
|
|
418
|
-
* @since 0.1.0
|
|
419
|
-
* @category Lang
|
|
420
|
-
* @param {*} value The value to check.
|
|
421
|
-
* @returns {boolean} Returns `true` if `value` is an object, else `false`.
|
|
422
|
-
* @example
|
|
423
|
-
*
|
|
424
|
-
* _.isObject({});
|
|
425
|
-
* // => true
|
|
426
|
-
*
|
|
427
|
-
* _.isObject([1, 2, 3]);
|
|
428
|
-
* // => true
|
|
429
|
-
*
|
|
430
|
-
* _.isObject(_.noop);
|
|
431
|
-
* // => true
|
|
432
|
-
*
|
|
433
|
-
* _.isObject(null);
|
|
434
|
-
* // => false
|
|
435
|
-
*/
|
|
436
|
-
function isObject(value) {
|
|
437
|
-
var type = typeof value;
|
|
438
|
-
return value != null && (type == 'object' || type == 'function');
|
|
439
|
-
}
|
|
440
|
-
|
|
441
|
-
var isObject_1 = isObject;
|
|
442
|
-
|
|
443
|
-
/** `Object#toString` result references. */
|
|
444
|
-
var asyncTag = '[object AsyncFunction]',
|
|
445
|
-
funcTag$1 = '[object Function]',
|
|
446
|
-
genTag = '[object GeneratorFunction]',
|
|
447
|
-
proxyTag = '[object Proxy]';
|
|
448
|
-
|
|
449
|
-
/**
|
|
450
|
-
* Checks if `value` is classified as a `Function` object.
|
|
451
|
-
*
|
|
452
|
-
* @static
|
|
453
|
-
* @memberOf _
|
|
454
|
-
* @since 0.1.0
|
|
455
|
-
* @category Lang
|
|
456
|
-
* @param {*} value The value to check.
|
|
457
|
-
* @returns {boolean} Returns `true` if `value` is a function, else `false`.
|
|
458
|
-
* @example
|
|
459
|
-
*
|
|
460
|
-
* _.isFunction(_);
|
|
461
|
-
* // => true
|
|
462
|
-
*
|
|
463
|
-
* _.isFunction(/abc/);
|
|
464
|
-
* // => false
|
|
465
|
-
*/
|
|
466
|
-
function isFunction(value) {
|
|
467
|
-
if (!isObject_1(value)) {
|
|
468
|
-
return false;
|
|
469
|
-
}
|
|
470
|
-
// The use of `Object#toString` avoids issues with the `typeof` operator
|
|
471
|
-
// in Safari 9 which returns 'object' for typed arrays and other constructors.
|
|
472
|
-
var tag = _baseGetTag(value);
|
|
473
|
-
return tag == funcTag$1 || tag == genTag || tag == asyncTag || tag == proxyTag;
|
|
474
|
-
}
|
|
475
|
-
|
|
476
|
-
var isFunction_1 = isFunction;
|
|
477
|
-
|
|
478
|
-
/** Used to detect overreaching core-js shims. */
|
|
479
|
-
var coreJsData = _root['__core-js_shared__'];
|
|
480
|
-
|
|
481
|
-
var _coreJsData = coreJsData;
|
|
482
|
-
|
|
483
|
-
/** Used to detect methods masquerading as native. */
|
|
484
|
-
var maskSrcKey = (function() {
|
|
485
|
-
var uid = /[^.]+$/.exec(_coreJsData && _coreJsData.keys && _coreJsData.keys.IE_PROTO || '');
|
|
486
|
-
return uid ? ('Symbol(src)_1.' + uid) : '';
|
|
487
|
-
}());
|
|
488
|
-
|
|
489
|
-
/**
|
|
490
|
-
* Checks if `func` has its source masked.
|
|
491
|
-
*
|
|
492
|
-
* @private
|
|
493
|
-
* @param {Function} func The function to check.
|
|
494
|
-
* @returns {boolean} Returns `true` if `func` is masked, else `false`.
|
|
495
|
-
*/
|
|
496
|
-
function isMasked(func) {
|
|
497
|
-
return !!maskSrcKey && (maskSrcKey in func);
|
|
498
|
-
}
|
|
499
|
-
|
|
500
|
-
var _isMasked = isMasked;
|
|
501
|
-
|
|
502
|
-
/** Used for built-in method references. */
|
|
503
|
-
var funcProto$1 = Function.prototype;
|
|
504
|
-
|
|
505
|
-
/** Used to resolve the decompiled source of functions. */
|
|
506
|
-
var funcToString$1 = funcProto$1.toString;
|
|
507
|
-
|
|
508
|
-
/**
|
|
509
|
-
* Converts `func` to its source code.
|
|
510
|
-
*
|
|
511
|
-
* @private
|
|
512
|
-
* @param {Function} func The function to convert.
|
|
513
|
-
* @returns {string} Returns the source code.
|
|
514
|
-
*/
|
|
515
|
-
function toSource(func) {
|
|
516
|
-
if (func != null) {
|
|
517
|
-
try {
|
|
518
|
-
return funcToString$1.call(func);
|
|
519
|
-
} catch (e) {}
|
|
520
|
-
try {
|
|
521
|
-
return (func + '');
|
|
522
|
-
} catch (e) {}
|
|
523
|
-
}
|
|
524
|
-
return '';
|
|
525
|
-
}
|
|
526
|
-
|
|
527
|
-
var _toSource = toSource;
|
|
528
|
-
|
|
529
|
-
/**
|
|
530
|
-
* Used to match `RegExp`
|
|
531
|
-
* [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).
|
|
532
|
-
*/
|
|
533
|
-
var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
|
|
534
|
-
|
|
535
|
-
/** Used to detect host constructors (Safari). */
|
|
536
|
-
var reIsHostCtor = /^\[object .+?Constructor\]$/;
|
|
537
|
-
|
|
538
|
-
/** Used for built-in method references. */
|
|
539
|
-
var funcProto = Function.prototype,
|
|
540
|
-
objectProto$9 = Object.prototype;
|
|
541
|
-
|
|
542
|
-
/** Used to resolve the decompiled source of functions. */
|
|
543
|
-
var funcToString = funcProto.toString;
|
|
544
|
-
|
|
545
|
-
/** Used to check objects for own properties. */
|
|
546
|
-
var hasOwnProperty$7 = objectProto$9.hasOwnProperty;
|
|
547
|
-
|
|
548
|
-
/** Used to detect if a method is native. */
|
|
549
|
-
var reIsNative = RegExp('^' +
|
|
550
|
-
funcToString.call(hasOwnProperty$7).replace(reRegExpChar, '\\$&')
|
|
551
|
-
.replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$'
|
|
552
|
-
);
|
|
553
|
-
|
|
554
|
-
/**
|
|
555
|
-
* The base implementation of `_.isNative` without bad shim checks.
|
|
556
|
-
*
|
|
557
|
-
* @private
|
|
558
|
-
* @param {*} value The value to check.
|
|
559
|
-
* @returns {boolean} Returns `true` if `value` is a native function,
|
|
560
|
-
* else `false`.
|
|
561
|
-
*/
|
|
562
|
-
function baseIsNative(value) {
|
|
563
|
-
if (!isObject_1(value) || _isMasked(value)) {
|
|
564
|
-
return false;
|
|
565
|
-
}
|
|
566
|
-
var pattern = isFunction_1(value) ? reIsNative : reIsHostCtor;
|
|
567
|
-
return pattern.test(_toSource(value));
|
|
568
|
-
}
|
|
569
|
-
|
|
570
|
-
var _baseIsNative = baseIsNative;
|
|
571
|
-
|
|
572
|
-
/**
|
|
573
|
-
* Gets the value at `key` of `object`.
|
|
574
|
-
*
|
|
575
|
-
* @private
|
|
576
|
-
* @param {Object} [object] The object to query.
|
|
577
|
-
* @param {string} key The key of the property to get.
|
|
578
|
-
* @returns {*} Returns the property value.
|
|
579
|
-
*/
|
|
580
|
-
function getValue(object, key) {
|
|
581
|
-
return object == null ? undefined : object[key];
|
|
582
|
-
}
|
|
583
|
-
|
|
584
|
-
var _getValue = getValue;
|
|
585
|
-
|
|
586
|
-
/**
|
|
587
|
-
* Gets the native function at `key` of `object`.
|
|
588
|
-
*
|
|
589
|
-
* @private
|
|
590
|
-
* @param {Object} object The object to query.
|
|
591
|
-
* @param {string} key The key of the method to get.
|
|
592
|
-
* @returns {*} Returns the function if it's native, else `undefined`.
|
|
593
|
-
*/
|
|
594
|
-
function getNative(object, key) {
|
|
595
|
-
var value = _getValue(object, key);
|
|
596
|
-
return _baseIsNative(value) ? value : undefined;
|
|
597
|
-
}
|
|
598
|
-
|
|
599
|
-
var _getNative = getNative;
|
|
600
|
-
|
|
601
|
-
/* Built-in method references that are verified to be native. */
|
|
602
|
-
var Map = _getNative(_root, 'Map');
|
|
603
|
-
|
|
604
|
-
var _Map = Map;
|
|
605
|
-
|
|
606
|
-
/* Built-in method references that are verified to be native. */
|
|
607
|
-
var nativeCreate = _getNative(Object, 'create');
|
|
608
|
-
|
|
609
|
-
var _nativeCreate = nativeCreate;
|
|
610
|
-
|
|
611
|
-
/**
|
|
612
|
-
* Removes all key-value entries from the hash.
|
|
613
|
-
*
|
|
614
|
-
* @private
|
|
615
|
-
* @name clear
|
|
616
|
-
* @memberOf Hash
|
|
617
|
-
*/
|
|
618
|
-
function hashClear() {
|
|
619
|
-
this.__data__ = _nativeCreate ? _nativeCreate(null) : {};
|
|
620
|
-
this.size = 0;
|
|
621
|
-
}
|
|
622
|
-
|
|
623
|
-
var _hashClear = hashClear;
|
|
624
|
-
|
|
625
|
-
/**
|
|
626
|
-
* Removes `key` and its value from the hash.
|
|
627
|
-
*
|
|
628
|
-
* @private
|
|
629
|
-
* @name delete
|
|
630
|
-
* @memberOf Hash
|
|
631
|
-
* @param {Object} hash The hash to modify.
|
|
632
|
-
* @param {string} key The key of the value to remove.
|
|
633
|
-
* @returns {boolean} Returns `true` if the entry was removed, else `false`.
|
|
634
|
-
*/
|
|
635
|
-
function hashDelete(key) {
|
|
636
|
-
var result = this.has(key) && delete this.__data__[key];
|
|
637
|
-
this.size -= result ? 1 : 0;
|
|
638
|
-
return result;
|
|
639
|
-
}
|
|
640
|
-
|
|
641
|
-
var _hashDelete = hashDelete;
|
|
642
|
-
|
|
643
|
-
/** Used to stand-in for `undefined` hash values. */
|
|
644
|
-
var HASH_UNDEFINED$2 = '__lodash_hash_undefined__';
|
|
645
|
-
|
|
646
|
-
/** Used for built-in method references. */
|
|
647
|
-
var objectProto$8 = Object.prototype;
|
|
648
|
-
|
|
649
|
-
/** Used to check objects for own properties. */
|
|
650
|
-
var hasOwnProperty$6 = objectProto$8.hasOwnProperty;
|
|
651
|
-
|
|
652
|
-
/**
|
|
653
|
-
* Gets the hash value for `key`.
|
|
654
|
-
*
|
|
655
|
-
* @private
|
|
656
|
-
* @name get
|
|
657
|
-
* @memberOf Hash
|
|
658
|
-
* @param {string} key The key of the value to get.
|
|
659
|
-
* @returns {*} Returns the entry value.
|
|
660
|
-
*/
|
|
661
|
-
function hashGet(key) {
|
|
662
|
-
var data = this.__data__;
|
|
663
|
-
if (_nativeCreate) {
|
|
664
|
-
var result = data[key];
|
|
665
|
-
return result === HASH_UNDEFINED$2 ? undefined : result;
|
|
666
|
-
}
|
|
667
|
-
return hasOwnProperty$6.call(data, key) ? data[key] : undefined;
|
|
668
|
-
}
|
|
669
|
-
|
|
670
|
-
var _hashGet = hashGet;
|
|
671
|
-
|
|
672
|
-
/** Used for built-in method references. */
|
|
673
|
-
var objectProto$7 = Object.prototype;
|
|
674
|
-
|
|
675
|
-
/** Used to check objects for own properties. */
|
|
676
|
-
var hasOwnProperty$5 = objectProto$7.hasOwnProperty;
|
|
677
|
-
|
|
678
|
-
/**
|
|
679
|
-
* Checks if a hash value for `key` exists.
|
|
680
|
-
*
|
|
681
|
-
* @private
|
|
682
|
-
* @name has
|
|
683
|
-
* @memberOf Hash
|
|
684
|
-
* @param {string} key The key of the entry to check.
|
|
685
|
-
* @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
|
|
686
|
-
*/
|
|
687
|
-
function hashHas(key) {
|
|
688
|
-
var data = this.__data__;
|
|
689
|
-
return _nativeCreate ? (data[key] !== undefined) : hasOwnProperty$5.call(data, key);
|
|
690
|
-
}
|
|
691
|
-
|
|
692
|
-
var _hashHas = hashHas;
|
|
693
|
-
|
|
694
|
-
/** Used to stand-in for `undefined` hash values. */
|
|
695
|
-
var HASH_UNDEFINED$1 = '__lodash_hash_undefined__';
|
|
696
|
-
|
|
697
|
-
/**
|
|
698
|
-
* Sets the hash `key` to `value`.
|
|
699
|
-
*
|
|
700
|
-
* @private
|
|
701
|
-
* @name set
|
|
702
|
-
* @memberOf Hash
|
|
703
|
-
* @param {string} key The key of the value to set.
|
|
704
|
-
* @param {*} value The value to set.
|
|
705
|
-
* @returns {Object} Returns the hash instance.
|
|
706
|
-
*/
|
|
707
|
-
function hashSet(key, value) {
|
|
708
|
-
var data = this.__data__;
|
|
709
|
-
this.size += this.has(key) ? 0 : 1;
|
|
710
|
-
data[key] = (_nativeCreate && value === undefined) ? HASH_UNDEFINED$1 : value;
|
|
711
|
-
return this;
|
|
712
|
-
}
|
|
713
|
-
|
|
714
|
-
var _hashSet = hashSet;
|
|
715
|
-
|
|
716
|
-
/**
|
|
717
|
-
* Creates a hash object.
|
|
718
|
-
*
|
|
719
|
-
* @private
|
|
720
|
-
* @constructor
|
|
721
|
-
* @param {Array} [entries] The key-value pairs to cache.
|
|
722
|
-
*/
|
|
723
|
-
function Hash(entries) {
|
|
724
|
-
var index = -1,
|
|
725
|
-
length = entries == null ? 0 : entries.length;
|
|
726
|
-
|
|
727
|
-
this.clear();
|
|
728
|
-
while (++index < length) {
|
|
729
|
-
var entry = entries[index];
|
|
730
|
-
this.set(entry[0], entry[1]);
|
|
731
|
-
}
|
|
732
|
-
}
|
|
733
|
-
|
|
734
|
-
// Add methods to `Hash`.
|
|
735
|
-
Hash.prototype.clear = _hashClear;
|
|
736
|
-
Hash.prototype['delete'] = _hashDelete;
|
|
737
|
-
Hash.prototype.get = _hashGet;
|
|
738
|
-
Hash.prototype.has = _hashHas;
|
|
739
|
-
Hash.prototype.set = _hashSet;
|
|
740
|
-
|
|
741
|
-
var _Hash = Hash;
|
|
742
|
-
|
|
743
|
-
/**
|
|
744
|
-
* Removes all key-value entries from the map.
|
|
745
|
-
*
|
|
746
|
-
* @private
|
|
747
|
-
* @name clear
|
|
748
|
-
* @memberOf MapCache
|
|
749
|
-
*/
|
|
750
|
-
function mapCacheClear() {
|
|
751
|
-
this.size = 0;
|
|
752
|
-
this.__data__ = {
|
|
753
|
-
'hash': new _Hash,
|
|
754
|
-
'map': new (_Map || _ListCache),
|
|
755
|
-
'string': new _Hash
|
|
756
|
-
};
|
|
757
|
-
}
|
|
758
|
-
|
|
759
|
-
var _mapCacheClear = mapCacheClear;
|
|
760
|
-
|
|
761
|
-
/**
|
|
762
|
-
* Checks if `value` is suitable for use as unique object key.
|
|
763
|
-
*
|
|
764
|
-
* @private
|
|
765
|
-
* @param {*} value The value to check.
|
|
766
|
-
* @returns {boolean} Returns `true` if `value` is suitable, else `false`.
|
|
767
|
-
*/
|
|
768
|
-
function isKeyable(value) {
|
|
769
|
-
var type = typeof value;
|
|
770
|
-
return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')
|
|
771
|
-
? (value !== '__proto__')
|
|
772
|
-
: (value === null);
|
|
773
|
-
}
|
|
774
|
-
|
|
775
|
-
var _isKeyable = isKeyable;
|
|
776
|
-
|
|
777
|
-
/**
|
|
778
|
-
* Gets the data for `map`.
|
|
779
|
-
*
|
|
780
|
-
* @private
|
|
781
|
-
* @param {Object} map The map to query.
|
|
782
|
-
* @param {string} key The reference key.
|
|
783
|
-
* @returns {*} Returns the map data.
|
|
784
|
-
*/
|
|
785
|
-
function getMapData(map, key) {
|
|
786
|
-
var data = map.__data__;
|
|
787
|
-
return _isKeyable(key)
|
|
788
|
-
? data[typeof key == 'string' ? 'string' : 'hash']
|
|
789
|
-
: data.map;
|
|
790
|
-
}
|
|
791
|
-
|
|
792
|
-
var _getMapData = getMapData;
|
|
793
|
-
|
|
794
|
-
/**
|
|
795
|
-
* Removes `key` and its value from the map.
|
|
796
|
-
*
|
|
797
|
-
* @private
|
|
798
|
-
* @name delete
|
|
799
|
-
* @memberOf MapCache
|
|
800
|
-
* @param {string} key The key of the value to remove.
|
|
801
|
-
* @returns {boolean} Returns `true` if the entry was removed, else `false`.
|
|
802
|
-
*/
|
|
803
|
-
function mapCacheDelete(key) {
|
|
804
|
-
var result = _getMapData(this, key)['delete'](key);
|
|
805
|
-
this.size -= result ? 1 : 0;
|
|
806
|
-
return result;
|
|
807
|
-
}
|
|
808
|
-
|
|
809
|
-
var _mapCacheDelete = mapCacheDelete;
|
|
810
|
-
|
|
811
|
-
/**
|
|
812
|
-
* Gets the map value for `key`.
|
|
813
|
-
*
|
|
814
|
-
* @private
|
|
815
|
-
* @name get
|
|
816
|
-
* @memberOf MapCache
|
|
817
|
-
* @param {string} key The key of the value to get.
|
|
818
|
-
* @returns {*} Returns the entry value.
|
|
819
|
-
*/
|
|
820
|
-
function mapCacheGet(key) {
|
|
821
|
-
return _getMapData(this, key).get(key);
|
|
822
|
-
}
|
|
823
|
-
|
|
824
|
-
var _mapCacheGet = mapCacheGet;
|
|
825
|
-
|
|
826
|
-
/**
|
|
827
|
-
* Checks if a map value for `key` exists.
|
|
828
|
-
*
|
|
829
|
-
* @private
|
|
830
|
-
* @name has
|
|
831
|
-
* @memberOf MapCache
|
|
832
|
-
* @param {string} key The key of the entry to check.
|
|
833
|
-
* @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
|
|
834
|
-
*/
|
|
835
|
-
function mapCacheHas(key) {
|
|
836
|
-
return _getMapData(this, key).has(key);
|
|
837
|
-
}
|
|
838
|
-
|
|
839
|
-
var _mapCacheHas = mapCacheHas;
|
|
840
|
-
|
|
841
|
-
/**
|
|
842
|
-
* Sets the map `key` to `value`.
|
|
843
|
-
*
|
|
844
|
-
* @private
|
|
845
|
-
* @name set
|
|
846
|
-
* @memberOf MapCache
|
|
847
|
-
* @param {string} key The key of the value to set.
|
|
848
|
-
* @param {*} value The value to set.
|
|
849
|
-
* @returns {Object} Returns the map cache instance.
|
|
850
|
-
*/
|
|
851
|
-
function mapCacheSet(key, value) {
|
|
852
|
-
var data = _getMapData(this, key),
|
|
853
|
-
size = data.size;
|
|
854
|
-
|
|
855
|
-
data.set(key, value);
|
|
856
|
-
this.size += data.size == size ? 0 : 1;
|
|
857
|
-
return this;
|
|
858
|
-
}
|
|
859
|
-
|
|
860
|
-
var _mapCacheSet = mapCacheSet;
|
|
861
|
-
|
|
862
|
-
/**
|
|
863
|
-
* Creates a map cache object to store key-value pairs.
|
|
864
|
-
*
|
|
865
|
-
* @private
|
|
866
|
-
* @constructor
|
|
867
|
-
* @param {Array} [entries] The key-value pairs to cache.
|
|
868
|
-
*/
|
|
869
|
-
function MapCache(entries) {
|
|
870
|
-
var index = -1,
|
|
871
|
-
length = entries == null ? 0 : entries.length;
|
|
872
|
-
|
|
873
|
-
this.clear();
|
|
874
|
-
while (++index < length) {
|
|
875
|
-
var entry = entries[index];
|
|
876
|
-
this.set(entry[0], entry[1]);
|
|
877
|
-
}
|
|
878
|
-
}
|
|
879
|
-
|
|
880
|
-
// Add methods to `MapCache`.
|
|
881
|
-
MapCache.prototype.clear = _mapCacheClear;
|
|
882
|
-
MapCache.prototype['delete'] = _mapCacheDelete;
|
|
883
|
-
MapCache.prototype.get = _mapCacheGet;
|
|
884
|
-
MapCache.prototype.has = _mapCacheHas;
|
|
885
|
-
MapCache.prototype.set = _mapCacheSet;
|
|
886
|
-
|
|
887
|
-
var _MapCache = MapCache;
|
|
888
|
-
|
|
889
|
-
/** Used as the size to enable large array optimizations. */
|
|
890
|
-
var LARGE_ARRAY_SIZE = 200;
|
|
891
|
-
|
|
892
|
-
/**
|
|
893
|
-
* Sets the stack `key` to `value`.
|
|
894
|
-
*
|
|
895
|
-
* @private
|
|
896
|
-
* @name set
|
|
897
|
-
* @memberOf Stack
|
|
898
|
-
* @param {string} key The key of the value to set.
|
|
899
|
-
* @param {*} value The value to set.
|
|
900
|
-
* @returns {Object} Returns the stack cache instance.
|
|
901
|
-
*/
|
|
902
|
-
function stackSet(key, value) {
|
|
903
|
-
var data = this.__data__;
|
|
904
|
-
if (data instanceof _ListCache) {
|
|
905
|
-
var pairs = data.__data__;
|
|
906
|
-
if (!_Map || (pairs.length < LARGE_ARRAY_SIZE - 1)) {
|
|
907
|
-
pairs.push([key, value]);
|
|
908
|
-
this.size = ++data.size;
|
|
909
|
-
return this;
|
|
910
|
-
}
|
|
911
|
-
data = this.__data__ = new _MapCache(pairs);
|
|
912
|
-
}
|
|
913
|
-
data.set(key, value);
|
|
914
|
-
this.size = data.size;
|
|
915
|
-
return this;
|
|
916
|
-
}
|
|
917
|
-
|
|
918
|
-
var _stackSet = stackSet;
|
|
919
|
-
|
|
920
|
-
/**
|
|
921
|
-
* Creates a stack cache object to store key-value pairs.
|
|
922
|
-
*
|
|
923
|
-
* @private
|
|
924
|
-
* @constructor
|
|
925
|
-
* @param {Array} [entries] The key-value pairs to cache.
|
|
926
|
-
*/
|
|
927
|
-
function Stack(entries) {
|
|
928
|
-
var data = this.__data__ = new _ListCache(entries);
|
|
929
|
-
this.size = data.size;
|
|
930
|
-
}
|
|
931
|
-
|
|
932
|
-
// Add methods to `Stack`.
|
|
933
|
-
Stack.prototype.clear = _stackClear;
|
|
934
|
-
Stack.prototype['delete'] = _stackDelete;
|
|
935
|
-
Stack.prototype.get = _stackGet;
|
|
936
|
-
Stack.prototype.has = _stackHas;
|
|
937
|
-
Stack.prototype.set = _stackSet;
|
|
938
|
-
|
|
939
|
-
var _Stack = Stack;
|
|
940
|
-
|
|
941
|
-
/** Used to stand-in for `undefined` hash values. */
|
|
942
|
-
var HASH_UNDEFINED = '__lodash_hash_undefined__';
|
|
943
|
-
|
|
944
|
-
/**
|
|
945
|
-
* Adds `value` to the array cache.
|
|
946
|
-
*
|
|
947
|
-
* @private
|
|
948
|
-
* @name add
|
|
949
|
-
* @memberOf SetCache
|
|
950
|
-
* @alias push
|
|
951
|
-
* @param {*} value The value to cache.
|
|
952
|
-
* @returns {Object} Returns the cache instance.
|
|
953
|
-
*/
|
|
954
|
-
function setCacheAdd(value) {
|
|
955
|
-
this.__data__.set(value, HASH_UNDEFINED);
|
|
956
|
-
return this;
|
|
957
|
-
}
|
|
958
|
-
|
|
959
|
-
var _setCacheAdd = setCacheAdd;
|
|
960
|
-
|
|
961
|
-
/**
|
|
962
|
-
* Checks if `value` is in the array cache.
|
|
963
|
-
*
|
|
964
|
-
* @private
|
|
965
|
-
* @name has
|
|
966
|
-
* @memberOf SetCache
|
|
967
|
-
* @param {*} value The value to search for.
|
|
968
|
-
* @returns {number} Returns `true` if `value` is found, else `false`.
|
|
969
|
-
*/
|
|
970
|
-
function setCacheHas(value) {
|
|
971
|
-
return this.__data__.has(value);
|
|
972
|
-
}
|
|
973
|
-
|
|
974
|
-
var _setCacheHas = setCacheHas;
|
|
975
|
-
|
|
976
|
-
/**
|
|
977
|
-
*
|
|
978
|
-
* Creates an array cache object to store unique values.
|
|
979
|
-
*
|
|
980
|
-
* @private
|
|
981
|
-
* @constructor
|
|
982
|
-
* @param {Array} [values] The values to cache.
|
|
983
|
-
*/
|
|
984
|
-
function SetCache(values) {
|
|
985
|
-
var index = -1,
|
|
986
|
-
length = values == null ? 0 : values.length;
|
|
987
|
-
|
|
988
|
-
this.__data__ = new _MapCache;
|
|
989
|
-
while (++index < length) {
|
|
990
|
-
this.add(values[index]);
|
|
991
|
-
}
|
|
992
|
-
}
|
|
993
|
-
|
|
994
|
-
// Add methods to `SetCache`.
|
|
995
|
-
SetCache.prototype.add = SetCache.prototype.push = _setCacheAdd;
|
|
996
|
-
SetCache.prototype.has = _setCacheHas;
|
|
997
|
-
|
|
998
|
-
var _SetCache = SetCache;
|
|
999
|
-
|
|
1000
|
-
/**
|
|
1001
|
-
* A specialized version of `_.some` for arrays without support for iteratee
|
|
1002
|
-
* shorthands.
|
|
1003
|
-
*
|
|
1004
|
-
* @private
|
|
1005
|
-
* @param {Array} [array] The array to iterate over.
|
|
1006
|
-
* @param {Function} predicate The function invoked per iteration.
|
|
1007
|
-
* @returns {boolean} Returns `true` if any element passes the predicate check,
|
|
1008
|
-
* else `false`.
|
|
1009
|
-
*/
|
|
1010
|
-
function arraySome(array, predicate) {
|
|
1011
|
-
var index = -1,
|
|
1012
|
-
length = array == null ? 0 : array.length;
|
|
1013
|
-
|
|
1014
|
-
while (++index < length) {
|
|
1015
|
-
if (predicate(array[index], index, array)) {
|
|
1016
|
-
return true;
|
|
1017
|
-
}
|
|
1018
|
-
}
|
|
1019
|
-
return false;
|
|
1020
|
-
}
|
|
1021
|
-
|
|
1022
|
-
var _arraySome = arraySome;
|
|
1023
|
-
|
|
1024
|
-
/**
|
|
1025
|
-
* Checks if a `cache` value for `key` exists.
|
|
1026
|
-
*
|
|
1027
|
-
* @private
|
|
1028
|
-
* @param {Object} cache The cache to query.
|
|
1029
|
-
* @param {string} key The key of the entry to check.
|
|
1030
|
-
* @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
|
|
1031
|
-
*/
|
|
1032
|
-
function cacheHas(cache, key) {
|
|
1033
|
-
return cache.has(key);
|
|
1034
|
-
}
|
|
1035
|
-
|
|
1036
|
-
var _cacheHas = cacheHas;
|
|
1037
|
-
|
|
1038
|
-
/** Used to compose bitmasks for value comparisons. */
|
|
1039
|
-
var COMPARE_PARTIAL_FLAG$3 = 1,
|
|
1040
|
-
COMPARE_UNORDERED_FLAG$1 = 2;
|
|
1041
|
-
|
|
1042
|
-
/**
|
|
1043
|
-
* A specialized version of `baseIsEqualDeep` for arrays with support for
|
|
1044
|
-
* partial deep comparisons.
|
|
1045
|
-
*
|
|
1046
|
-
* @private
|
|
1047
|
-
* @param {Array} array The array to compare.
|
|
1048
|
-
* @param {Array} other The other array to compare.
|
|
1049
|
-
* @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
|
|
1050
|
-
* @param {Function} customizer The function to customize comparisons.
|
|
1051
|
-
* @param {Function} equalFunc The function to determine equivalents of values.
|
|
1052
|
-
* @param {Object} stack Tracks traversed `array` and `other` objects.
|
|
1053
|
-
* @returns {boolean} Returns `true` if the arrays are equivalent, else `false`.
|
|
1054
|
-
*/
|
|
1055
|
-
function equalArrays(array, other, bitmask, customizer, equalFunc, stack) {
|
|
1056
|
-
var isPartial = bitmask & COMPARE_PARTIAL_FLAG$3,
|
|
1057
|
-
arrLength = array.length,
|
|
1058
|
-
othLength = other.length;
|
|
1059
|
-
|
|
1060
|
-
if (arrLength != othLength && !(isPartial && othLength > arrLength)) {
|
|
1061
|
-
return false;
|
|
1062
|
-
}
|
|
1063
|
-
// Check that cyclic values are equal.
|
|
1064
|
-
var arrStacked = stack.get(array);
|
|
1065
|
-
var othStacked = stack.get(other);
|
|
1066
|
-
if (arrStacked && othStacked) {
|
|
1067
|
-
return arrStacked == other && othStacked == array;
|
|
1068
|
-
}
|
|
1069
|
-
var index = -1,
|
|
1070
|
-
result = true,
|
|
1071
|
-
seen = (bitmask & COMPARE_UNORDERED_FLAG$1) ? new _SetCache : undefined;
|
|
1072
|
-
|
|
1073
|
-
stack.set(array, other);
|
|
1074
|
-
stack.set(other, array);
|
|
1075
|
-
|
|
1076
|
-
// Ignore non-index properties.
|
|
1077
|
-
while (++index < arrLength) {
|
|
1078
|
-
var arrValue = array[index],
|
|
1079
|
-
othValue = other[index];
|
|
1080
|
-
|
|
1081
|
-
if (customizer) {
|
|
1082
|
-
var compared = isPartial
|
|
1083
|
-
? customizer(othValue, arrValue, index, other, array, stack)
|
|
1084
|
-
: customizer(arrValue, othValue, index, array, other, stack);
|
|
1085
|
-
}
|
|
1086
|
-
if (compared !== undefined) {
|
|
1087
|
-
if (compared) {
|
|
1088
|
-
continue;
|
|
1089
|
-
}
|
|
1090
|
-
result = false;
|
|
1091
|
-
break;
|
|
1092
|
-
}
|
|
1093
|
-
// Recursively compare arrays (susceptible to call stack limits).
|
|
1094
|
-
if (seen) {
|
|
1095
|
-
if (!_arraySome(other, function(othValue, othIndex) {
|
|
1096
|
-
if (!_cacheHas(seen, othIndex) &&
|
|
1097
|
-
(arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack))) {
|
|
1098
|
-
return seen.push(othIndex);
|
|
1099
|
-
}
|
|
1100
|
-
})) {
|
|
1101
|
-
result = false;
|
|
1102
|
-
break;
|
|
1103
|
-
}
|
|
1104
|
-
} else if (!(
|
|
1105
|
-
arrValue === othValue ||
|
|
1106
|
-
equalFunc(arrValue, othValue, bitmask, customizer, stack)
|
|
1107
|
-
)) {
|
|
1108
|
-
result = false;
|
|
1109
|
-
break;
|
|
1110
|
-
}
|
|
1111
|
-
}
|
|
1112
|
-
stack['delete'](array);
|
|
1113
|
-
stack['delete'](other);
|
|
1114
|
-
return result;
|
|
1115
|
-
}
|
|
1116
|
-
|
|
1117
|
-
var _equalArrays = equalArrays;
|
|
1118
|
-
|
|
1119
|
-
/** Built-in value references. */
|
|
1120
|
-
var Uint8Array = _root.Uint8Array;
|
|
1121
|
-
|
|
1122
|
-
var _Uint8Array = Uint8Array;
|
|
1123
|
-
|
|
1124
|
-
/**
|
|
1125
|
-
* Converts `map` to its key-value pairs.
|
|
1126
|
-
*
|
|
1127
|
-
* @private
|
|
1128
|
-
* @param {Object} map The map to convert.
|
|
1129
|
-
* @returns {Array} Returns the key-value pairs.
|
|
1130
|
-
*/
|
|
1131
|
-
function mapToArray(map) {
|
|
1132
|
-
var index = -1,
|
|
1133
|
-
result = Array(map.size);
|
|
1134
|
-
|
|
1135
|
-
map.forEach(function(value, key) {
|
|
1136
|
-
result[++index] = [key, value];
|
|
1137
|
-
});
|
|
1138
|
-
return result;
|
|
1139
|
-
}
|
|
1140
|
-
|
|
1141
|
-
var _mapToArray = mapToArray;
|
|
1142
|
-
|
|
1143
|
-
/**
|
|
1144
|
-
* Converts `set` to an array of its values.
|
|
1145
|
-
*
|
|
1146
|
-
* @private
|
|
1147
|
-
* @param {Object} set The set to convert.
|
|
1148
|
-
* @returns {Array} Returns the values.
|
|
1149
|
-
*/
|
|
1150
|
-
function setToArray(set) {
|
|
1151
|
-
var index = -1,
|
|
1152
|
-
result = Array(set.size);
|
|
1153
|
-
|
|
1154
|
-
set.forEach(function(value) {
|
|
1155
|
-
result[++index] = value;
|
|
1156
|
-
});
|
|
1157
|
-
return result;
|
|
1158
|
-
}
|
|
1159
|
-
|
|
1160
|
-
var _setToArray = setToArray;
|
|
1161
|
-
|
|
1162
|
-
/** Used to compose bitmasks for value comparisons. */
|
|
1163
|
-
var COMPARE_PARTIAL_FLAG$2 = 1,
|
|
1164
|
-
COMPARE_UNORDERED_FLAG = 2;
|
|
1165
|
-
|
|
1166
|
-
/** `Object#toString` result references. */
|
|
1167
|
-
var boolTag$1 = '[object Boolean]',
|
|
1168
|
-
dateTag$1 = '[object Date]',
|
|
1169
|
-
errorTag$1 = '[object Error]',
|
|
1170
|
-
mapTag$2 = '[object Map]',
|
|
1171
|
-
numberTag$1 = '[object Number]',
|
|
1172
|
-
regexpTag$1 = '[object RegExp]',
|
|
1173
|
-
setTag$2 = '[object Set]',
|
|
1174
|
-
stringTag$1 = '[object String]',
|
|
1175
|
-
symbolTag$1 = '[object Symbol]';
|
|
1176
|
-
|
|
1177
|
-
var arrayBufferTag$1 = '[object ArrayBuffer]',
|
|
1178
|
-
dataViewTag$2 = '[object DataView]';
|
|
1179
|
-
|
|
1180
|
-
/** Used to convert symbols to primitives and strings. */
|
|
1181
|
-
var symbolProto$1 = _Symbol ? _Symbol.prototype : undefined,
|
|
1182
|
-
symbolValueOf = symbolProto$1 ? symbolProto$1.valueOf : undefined;
|
|
1183
|
-
|
|
1184
|
-
/**
|
|
1185
|
-
* A specialized version of `baseIsEqualDeep` for comparing objects of
|
|
1186
|
-
* the same `toStringTag`.
|
|
1187
|
-
*
|
|
1188
|
-
* **Note:** This function only supports comparing values with tags of
|
|
1189
|
-
* `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`.
|
|
1190
|
-
*
|
|
1191
|
-
* @private
|
|
1192
|
-
* @param {Object} object The object to compare.
|
|
1193
|
-
* @param {Object} other The other object to compare.
|
|
1194
|
-
* @param {string} tag The `toStringTag` of the objects to compare.
|
|
1195
|
-
* @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
|
|
1196
|
-
* @param {Function} customizer The function to customize comparisons.
|
|
1197
|
-
* @param {Function} equalFunc The function to determine equivalents of values.
|
|
1198
|
-
* @param {Object} stack Tracks traversed `object` and `other` objects.
|
|
1199
|
-
* @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
|
|
1200
|
-
*/
|
|
1201
|
-
function equalByTag(object, other, tag, bitmask, customizer, equalFunc, stack) {
|
|
1202
|
-
switch (tag) {
|
|
1203
|
-
case dataViewTag$2:
|
|
1204
|
-
if ((object.byteLength != other.byteLength) ||
|
|
1205
|
-
(object.byteOffset != other.byteOffset)) {
|
|
1206
|
-
return false;
|
|
1207
|
-
}
|
|
1208
|
-
object = object.buffer;
|
|
1209
|
-
other = other.buffer;
|
|
1210
|
-
|
|
1211
|
-
case arrayBufferTag$1:
|
|
1212
|
-
if ((object.byteLength != other.byteLength) ||
|
|
1213
|
-
!equalFunc(new _Uint8Array(object), new _Uint8Array(other))) {
|
|
1214
|
-
return false;
|
|
1215
|
-
}
|
|
1216
|
-
return true;
|
|
1217
|
-
|
|
1218
|
-
case boolTag$1:
|
|
1219
|
-
case dateTag$1:
|
|
1220
|
-
case numberTag$1:
|
|
1221
|
-
// Coerce booleans to `1` or `0` and dates to milliseconds.
|
|
1222
|
-
// Invalid dates are coerced to `NaN`.
|
|
1223
|
-
return eq_1(+object, +other);
|
|
1224
|
-
|
|
1225
|
-
case errorTag$1:
|
|
1226
|
-
return object.name == other.name && object.message == other.message;
|
|
1227
|
-
|
|
1228
|
-
case regexpTag$1:
|
|
1229
|
-
case stringTag$1:
|
|
1230
|
-
// Coerce regexes to strings and treat strings, primitives and objects,
|
|
1231
|
-
// as equal. See http://www.ecma-international.org/ecma-262/7.0/#sec-regexp.prototype.tostring
|
|
1232
|
-
// for more details.
|
|
1233
|
-
return object == (other + '');
|
|
1234
|
-
|
|
1235
|
-
case mapTag$2:
|
|
1236
|
-
var convert = _mapToArray;
|
|
1237
|
-
|
|
1238
|
-
case setTag$2:
|
|
1239
|
-
var isPartial = bitmask & COMPARE_PARTIAL_FLAG$2;
|
|
1240
|
-
convert || (convert = _setToArray);
|
|
1241
|
-
|
|
1242
|
-
if (object.size != other.size && !isPartial) {
|
|
1243
|
-
return false;
|
|
1244
|
-
}
|
|
1245
|
-
// Assume cyclic values are equal.
|
|
1246
|
-
var stacked = stack.get(object);
|
|
1247
|
-
if (stacked) {
|
|
1248
|
-
return stacked == other;
|
|
1249
|
-
}
|
|
1250
|
-
bitmask |= COMPARE_UNORDERED_FLAG;
|
|
1251
|
-
|
|
1252
|
-
// Recursively compare objects (susceptible to call stack limits).
|
|
1253
|
-
stack.set(object, other);
|
|
1254
|
-
var result = _equalArrays(convert(object), convert(other), bitmask, customizer, equalFunc, stack);
|
|
1255
|
-
stack['delete'](object);
|
|
1256
|
-
return result;
|
|
1257
|
-
|
|
1258
|
-
case symbolTag$1:
|
|
1259
|
-
if (symbolValueOf) {
|
|
1260
|
-
return symbolValueOf.call(object) == symbolValueOf.call(other);
|
|
1261
|
-
}
|
|
1262
|
-
}
|
|
1263
|
-
return false;
|
|
1264
|
-
}
|
|
1265
|
-
|
|
1266
|
-
var _equalByTag = equalByTag;
|
|
1267
|
-
|
|
1268
|
-
/**
|
|
1269
|
-
* Appends the elements of `values` to `array`.
|
|
1270
|
-
*
|
|
1271
|
-
* @private
|
|
1272
|
-
* @param {Array} array The array to modify.
|
|
1273
|
-
* @param {Array} values The values to append.
|
|
1274
|
-
* @returns {Array} Returns `array`.
|
|
1275
|
-
*/
|
|
1276
|
-
function arrayPush(array, values) {
|
|
1277
|
-
var index = -1,
|
|
1278
|
-
length = values.length,
|
|
1279
|
-
offset = array.length;
|
|
1280
|
-
|
|
1281
|
-
while (++index < length) {
|
|
1282
|
-
array[offset + index] = values[index];
|
|
1283
|
-
}
|
|
1284
|
-
return array;
|
|
1285
|
-
}
|
|
1286
|
-
|
|
1287
|
-
var _arrayPush = arrayPush;
|
|
1288
|
-
|
|
1289
|
-
/**
|
|
1290
|
-
* Checks if `value` is classified as an `Array` object.
|
|
1291
|
-
*
|
|
1292
|
-
* @static
|
|
1293
|
-
* @memberOf _
|
|
1294
|
-
* @since 0.1.0
|
|
1295
|
-
* @category Lang
|
|
1296
|
-
* @param {*} value The value to check.
|
|
1297
|
-
* @returns {boolean} Returns `true` if `value` is an array, else `false`.
|
|
1298
|
-
* @example
|
|
1299
|
-
*
|
|
1300
|
-
* _.isArray([1, 2, 3]);
|
|
1301
|
-
* // => true
|
|
1302
|
-
*
|
|
1303
|
-
* _.isArray(document.body.children);
|
|
1304
|
-
* // => false
|
|
1305
|
-
*
|
|
1306
|
-
* _.isArray('abc');
|
|
1307
|
-
* // => false
|
|
1308
|
-
*
|
|
1309
|
-
* _.isArray(_.noop);
|
|
1310
|
-
* // => false
|
|
1311
|
-
*/
|
|
1312
|
-
var isArray = Array.isArray;
|
|
1313
|
-
|
|
1314
|
-
var isArray_1 = isArray;
|
|
1315
|
-
|
|
1316
|
-
/**
|
|
1317
|
-
* The base implementation of `getAllKeys` and `getAllKeysIn` which uses
|
|
1318
|
-
* `keysFunc` and `symbolsFunc` to get the enumerable property names and
|
|
1319
|
-
* symbols of `object`.
|
|
1320
|
-
*
|
|
1321
|
-
* @private
|
|
1322
|
-
* @param {Object} object The object to query.
|
|
1323
|
-
* @param {Function} keysFunc The function to get the keys of `object`.
|
|
1324
|
-
* @param {Function} symbolsFunc The function to get the symbols of `object`.
|
|
1325
|
-
* @returns {Array} Returns the array of property names and symbols.
|
|
1326
|
-
*/
|
|
1327
|
-
function baseGetAllKeys(object, keysFunc, symbolsFunc) {
|
|
1328
|
-
var result = keysFunc(object);
|
|
1329
|
-
return isArray_1(object) ? result : _arrayPush(result, symbolsFunc(object));
|
|
1330
|
-
}
|
|
1331
|
-
|
|
1332
|
-
var _baseGetAllKeys = baseGetAllKeys;
|
|
1333
|
-
|
|
1334
|
-
/**
|
|
1335
|
-
* A specialized version of `_.filter` for arrays without support for
|
|
1336
|
-
* iteratee shorthands.
|
|
1337
|
-
*
|
|
1338
|
-
* @private
|
|
1339
|
-
* @param {Array} [array] The array to iterate over.
|
|
1340
|
-
* @param {Function} predicate The function invoked per iteration.
|
|
1341
|
-
* @returns {Array} Returns the new filtered array.
|
|
1342
|
-
*/
|
|
1343
|
-
function arrayFilter(array, predicate) {
|
|
1344
|
-
var index = -1,
|
|
1345
|
-
length = array == null ? 0 : array.length,
|
|
1346
|
-
resIndex = 0,
|
|
1347
|
-
result = [];
|
|
1348
|
-
|
|
1349
|
-
while (++index < length) {
|
|
1350
|
-
var value = array[index];
|
|
1351
|
-
if (predicate(value, index, array)) {
|
|
1352
|
-
result[resIndex++] = value;
|
|
1353
|
-
}
|
|
1354
|
-
}
|
|
1355
|
-
return result;
|
|
1356
|
-
}
|
|
1357
|
-
|
|
1358
|
-
var _arrayFilter = arrayFilter;
|
|
1359
|
-
|
|
1360
|
-
/**
|
|
1361
|
-
* This method returns a new empty array.
|
|
1362
|
-
*
|
|
1363
|
-
* @static
|
|
1364
|
-
* @memberOf _
|
|
1365
|
-
* @since 4.13.0
|
|
1366
|
-
* @category Util
|
|
1367
|
-
* @returns {Array} Returns the new empty array.
|
|
1368
|
-
* @example
|
|
1369
|
-
*
|
|
1370
|
-
* var arrays = _.times(2, _.stubArray);
|
|
1371
|
-
*
|
|
1372
|
-
* console.log(arrays);
|
|
1373
|
-
* // => [[], []]
|
|
1374
|
-
*
|
|
1375
|
-
* console.log(arrays[0] === arrays[1]);
|
|
1376
|
-
* // => false
|
|
1377
|
-
*/
|
|
1378
|
-
function stubArray() {
|
|
1379
|
-
return [];
|
|
1380
|
-
}
|
|
1381
|
-
|
|
1382
|
-
var stubArray_1 = stubArray;
|
|
1383
|
-
|
|
1384
|
-
/** Used for built-in method references. */
|
|
1385
|
-
var objectProto$6 = Object.prototype;
|
|
1386
|
-
|
|
1387
|
-
/** Built-in value references. */
|
|
1388
|
-
var propertyIsEnumerable$1 = objectProto$6.propertyIsEnumerable;
|
|
1389
|
-
|
|
1390
|
-
/* Built-in method references for those with the same name as other `lodash` methods. */
|
|
1391
|
-
var nativeGetSymbols = Object.getOwnPropertySymbols;
|
|
1392
|
-
|
|
1393
|
-
/**
|
|
1394
|
-
* Creates an array of the own enumerable symbols of `object`.
|
|
1395
|
-
*
|
|
1396
|
-
* @private
|
|
1397
|
-
* @param {Object} object The object to query.
|
|
1398
|
-
* @returns {Array} Returns the array of symbols.
|
|
1399
|
-
*/
|
|
1400
|
-
var getSymbols = !nativeGetSymbols ? stubArray_1 : function(object) {
|
|
1401
|
-
if (object == null) {
|
|
1402
|
-
return [];
|
|
1403
|
-
}
|
|
1404
|
-
object = Object(object);
|
|
1405
|
-
return _arrayFilter(nativeGetSymbols(object), function(symbol) {
|
|
1406
|
-
return propertyIsEnumerable$1.call(object, symbol);
|
|
1407
|
-
});
|
|
1408
|
-
};
|
|
1409
|
-
|
|
1410
|
-
var _getSymbols = getSymbols;
|
|
1411
|
-
|
|
1412
|
-
/**
|
|
1413
|
-
* The base implementation of `_.times` without support for iteratee shorthands
|
|
1414
|
-
* or max array length checks.
|
|
1415
|
-
*
|
|
1416
|
-
* @private
|
|
1417
|
-
* @param {number} n The number of times to invoke `iteratee`.
|
|
1418
|
-
* @param {Function} iteratee The function invoked per iteration.
|
|
1419
|
-
* @returns {Array} Returns the array of results.
|
|
1420
|
-
*/
|
|
1421
|
-
function baseTimes(n, iteratee) {
|
|
1422
|
-
var index = -1,
|
|
1423
|
-
result = Array(n);
|
|
1424
|
-
|
|
1425
|
-
while (++index < n) {
|
|
1426
|
-
result[index] = iteratee(index);
|
|
1427
|
-
}
|
|
1428
|
-
return result;
|
|
1429
|
-
}
|
|
1430
|
-
|
|
1431
|
-
var _baseTimes = baseTimes;
|
|
1432
|
-
|
|
1433
|
-
/**
|
|
1434
|
-
* Checks if `value` is object-like. A value is object-like if it's not `null`
|
|
1435
|
-
* and has a `typeof` result of "object".
|
|
1436
|
-
*
|
|
1437
|
-
* @static
|
|
1438
|
-
* @memberOf _
|
|
1439
|
-
* @since 4.0.0
|
|
1440
|
-
* @category Lang
|
|
1441
|
-
* @param {*} value The value to check.
|
|
1442
|
-
* @returns {boolean} Returns `true` if `value` is object-like, else `false`.
|
|
1443
|
-
* @example
|
|
1444
|
-
*
|
|
1445
|
-
* _.isObjectLike({});
|
|
1446
|
-
* // => true
|
|
1447
|
-
*
|
|
1448
|
-
* _.isObjectLike([1, 2, 3]);
|
|
1449
|
-
* // => true
|
|
1450
|
-
*
|
|
1451
|
-
* _.isObjectLike(_.noop);
|
|
1452
|
-
* // => false
|
|
1453
|
-
*
|
|
1454
|
-
* _.isObjectLike(null);
|
|
1455
|
-
* // => false
|
|
1456
|
-
*/
|
|
1457
|
-
function isObjectLike(value) {
|
|
1458
|
-
return value != null && typeof value == 'object';
|
|
1459
|
-
}
|
|
1460
|
-
|
|
1461
|
-
var isObjectLike_1 = isObjectLike;
|
|
1462
|
-
|
|
1463
|
-
/** `Object#toString` result references. */
|
|
1464
|
-
var argsTag$2 = '[object Arguments]';
|
|
1465
|
-
|
|
1466
|
-
/**
|
|
1467
|
-
* The base implementation of `_.isArguments`.
|
|
1468
|
-
*
|
|
1469
|
-
* @private
|
|
1470
|
-
* @param {*} value The value to check.
|
|
1471
|
-
* @returns {boolean} Returns `true` if `value` is an `arguments` object,
|
|
1472
|
-
*/
|
|
1473
|
-
function baseIsArguments(value) {
|
|
1474
|
-
return isObjectLike_1(value) && _baseGetTag(value) == argsTag$2;
|
|
1475
|
-
}
|
|
1476
|
-
|
|
1477
|
-
var _baseIsArguments = baseIsArguments;
|
|
1478
|
-
|
|
1479
|
-
/** Used for built-in method references. */
|
|
1480
|
-
var objectProto$5 = Object.prototype;
|
|
1481
|
-
|
|
1482
|
-
/** Used to check objects for own properties. */
|
|
1483
|
-
var hasOwnProperty$4 = objectProto$5.hasOwnProperty;
|
|
1484
|
-
|
|
1485
|
-
/** Built-in value references. */
|
|
1486
|
-
var propertyIsEnumerable = objectProto$5.propertyIsEnumerable;
|
|
1487
|
-
|
|
1488
|
-
/**
|
|
1489
|
-
* Checks if `value` is likely an `arguments` object.
|
|
1490
|
-
*
|
|
1491
|
-
* @static
|
|
1492
|
-
* @memberOf _
|
|
1493
|
-
* @since 0.1.0
|
|
1494
|
-
* @category Lang
|
|
1495
|
-
* @param {*} value The value to check.
|
|
1496
|
-
* @returns {boolean} Returns `true` if `value` is an `arguments` object,
|
|
1497
|
-
* else `false`.
|
|
1498
|
-
* @example
|
|
1499
|
-
*
|
|
1500
|
-
* _.isArguments(function() { return arguments; }());
|
|
1501
|
-
* // => true
|
|
1502
|
-
*
|
|
1503
|
-
* _.isArguments([1, 2, 3]);
|
|
1504
|
-
* // => false
|
|
1505
|
-
*/
|
|
1506
|
-
var isArguments = _baseIsArguments(function() { return arguments; }()) ? _baseIsArguments : function(value) {
|
|
1507
|
-
return isObjectLike_1(value) && hasOwnProperty$4.call(value, 'callee') &&
|
|
1508
|
-
!propertyIsEnumerable.call(value, 'callee');
|
|
1509
|
-
};
|
|
1510
|
-
|
|
1511
|
-
var isArguments_1 = isArguments;
|
|
1512
|
-
|
|
1513
|
-
/**
|
|
1514
|
-
* This method returns `false`.
|
|
1515
|
-
*
|
|
1516
|
-
* @static
|
|
1517
|
-
* @memberOf _
|
|
1518
|
-
* @since 4.13.0
|
|
1519
|
-
* @category Util
|
|
1520
|
-
* @returns {boolean} Returns `false`.
|
|
1521
|
-
* @example
|
|
1522
|
-
*
|
|
1523
|
-
* _.times(2, _.stubFalse);
|
|
1524
|
-
* // => [false, false]
|
|
1525
|
-
*/
|
|
1526
|
-
function stubFalse() {
|
|
1527
|
-
return false;
|
|
1528
|
-
}
|
|
1529
|
-
|
|
1530
|
-
var stubFalse_1 = stubFalse;
|
|
1531
|
-
|
|
1532
|
-
var isBuffer_1 = createCommonjsModule(function (module, exports) {
|
|
1533
|
-
/** Detect free variable `exports`. */
|
|
1534
|
-
var freeExports = exports && !exports.nodeType && exports;
|
|
1535
|
-
|
|
1536
|
-
/** Detect free variable `module`. */
|
|
1537
|
-
var freeModule = freeExports && 'object' == 'object' && module && !module.nodeType && module;
|
|
1538
|
-
|
|
1539
|
-
/** Detect the popular CommonJS extension `module.exports`. */
|
|
1540
|
-
var moduleExports = freeModule && freeModule.exports === freeExports;
|
|
1541
|
-
|
|
1542
|
-
/** Built-in value references. */
|
|
1543
|
-
var Buffer = moduleExports ? _root.Buffer : undefined;
|
|
1544
|
-
|
|
1545
|
-
/* Built-in method references for those with the same name as other `lodash` methods. */
|
|
1546
|
-
var nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined;
|
|
1547
|
-
|
|
1548
|
-
/**
|
|
1549
|
-
* Checks if `value` is a buffer.
|
|
1550
|
-
*
|
|
1551
|
-
* @static
|
|
1552
|
-
* @memberOf _
|
|
1553
|
-
* @since 4.3.0
|
|
1554
|
-
* @category Lang
|
|
1555
|
-
* @param {*} value The value to check.
|
|
1556
|
-
* @returns {boolean} Returns `true` if `value` is a buffer, else `false`.
|
|
1557
|
-
* @example
|
|
1558
|
-
*
|
|
1559
|
-
* _.isBuffer(new Buffer(2));
|
|
1560
|
-
* // => true
|
|
1561
|
-
*
|
|
1562
|
-
* _.isBuffer(new Uint8Array(2));
|
|
1563
|
-
* // => false
|
|
1564
|
-
*/
|
|
1565
|
-
var isBuffer = nativeIsBuffer || stubFalse_1;
|
|
1566
|
-
|
|
1567
|
-
module.exports = isBuffer;
|
|
1568
|
-
});
|
|
1569
|
-
|
|
1570
|
-
/** Used as references for various `Number` constants. */
|
|
1571
|
-
var MAX_SAFE_INTEGER$1 = 9007199254740991;
|
|
1572
|
-
|
|
1573
|
-
/** Used to detect unsigned integer values. */
|
|
1574
|
-
var reIsUint = /^(?:0|[1-9]\d*)$/;
|
|
1575
|
-
|
|
1576
|
-
/**
|
|
1577
|
-
* Checks if `value` is a valid array-like index.
|
|
1578
|
-
*
|
|
1579
|
-
* @private
|
|
1580
|
-
* @param {*} value The value to check.
|
|
1581
|
-
* @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.
|
|
1582
|
-
* @returns {boolean} Returns `true` if `value` is a valid index, else `false`.
|
|
1583
|
-
*/
|
|
1584
|
-
function isIndex(value, length) {
|
|
1585
|
-
var type = typeof value;
|
|
1586
|
-
length = length == null ? MAX_SAFE_INTEGER$1 : length;
|
|
1587
|
-
|
|
1588
|
-
return !!length &&
|
|
1589
|
-
(type == 'number' ||
|
|
1590
|
-
(type != 'symbol' && reIsUint.test(value))) &&
|
|
1591
|
-
(value > -1 && value % 1 == 0 && value < length);
|
|
1592
|
-
}
|
|
1593
|
-
|
|
1594
|
-
var _isIndex = isIndex;
|
|
1595
|
-
|
|
1596
|
-
/** Used as references for various `Number` constants. */
|
|
1597
|
-
var MAX_SAFE_INTEGER = 9007199254740991;
|
|
1598
|
-
|
|
1599
|
-
/**
|
|
1600
|
-
* Checks if `value` is a valid array-like length.
|
|
1601
|
-
*
|
|
1602
|
-
* **Note:** This method is loosely based on
|
|
1603
|
-
* [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).
|
|
1604
|
-
*
|
|
1605
|
-
* @static
|
|
1606
|
-
* @memberOf _
|
|
1607
|
-
* @since 4.0.0
|
|
1608
|
-
* @category Lang
|
|
1609
|
-
* @param {*} value The value to check.
|
|
1610
|
-
* @returns {boolean} Returns `true` if `value` is a valid length, else `false`.
|
|
1611
|
-
* @example
|
|
1612
|
-
*
|
|
1613
|
-
* _.isLength(3);
|
|
1614
|
-
* // => true
|
|
1615
|
-
*
|
|
1616
|
-
* _.isLength(Number.MIN_VALUE);
|
|
1617
|
-
* // => false
|
|
1618
|
-
*
|
|
1619
|
-
* _.isLength(Infinity);
|
|
1620
|
-
* // => false
|
|
1621
|
-
*
|
|
1622
|
-
* _.isLength('3');
|
|
1623
|
-
* // => false
|
|
1624
|
-
*/
|
|
1625
|
-
function isLength(value) {
|
|
1626
|
-
return typeof value == 'number' &&
|
|
1627
|
-
value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
|
|
1628
|
-
}
|
|
1629
|
-
|
|
1630
|
-
var isLength_1 = isLength;
|
|
1631
|
-
|
|
1632
|
-
/** `Object#toString` result references. */
|
|
1633
|
-
var argsTag$1 = '[object Arguments]',
|
|
1634
|
-
arrayTag$1 = '[object Array]',
|
|
1635
|
-
boolTag = '[object Boolean]',
|
|
1636
|
-
dateTag = '[object Date]',
|
|
1637
|
-
errorTag = '[object Error]',
|
|
1638
|
-
funcTag = '[object Function]',
|
|
1639
|
-
mapTag$1 = '[object Map]',
|
|
1640
|
-
numberTag = '[object Number]',
|
|
1641
|
-
objectTag$2 = '[object Object]',
|
|
1642
|
-
regexpTag = '[object RegExp]',
|
|
1643
|
-
setTag$1 = '[object Set]',
|
|
1644
|
-
stringTag = '[object String]',
|
|
1645
|
-
weakMapTag$1 = '[object WeakMap]';
|
|
1646
|
-
|
|
1647
|
-
var arrayBufferTag = '[object ArrayBuffer]',
|
|
1648
|
-
dataViewTag$1 = '[object DataView]',
|
|
1649
|
-
float32Tag = '[object Float32Array]',
|
|
1650
|
-
float64Tag = '[object Float64Array]',
|
|
1651
|
-
int8Tag = '[object Int8Array]',
|
|
1652
|
-
int16Tag = '[object Int16Array]',
|
|
1653
|
-
int32Tag = '[object Int32Array]',
|
|
1654
|
-
uint8Tag = '[object Uint8Array]',
|
|
1655
|
-
uint8ClampedTag = '[object Uint8ClampedArray]',
|
|
1656
|
-
uint16Tag = '[object Uint16Array]',
|
|
1657
|
-
uint32Tag = '[object Uint32Array]';
|
|
1658
|
-
|
|
1659
|
-
/** Used to identify `toStringTag` values of typed arrays. */
|
|
1660
|
-
var typedArrayTags = {};
|
|
1661
|
-
typedArrayTags[float32Tag] = typedArrayTags[float64Tag] =
|
|
1662
|
-
typedArrayTags[int8Tag] = typedArrayTags[int16Tag] =
|
|
1663
|
-
typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] =
|
|
1664
|
-
typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] =
|
|
1665
|
-
typedArrayTags[uint32Tag] = true;
|
|
1666
|
-
typedArrayTags[argsTag$1] = typedArrayTags[arrayTag$1] =
|
|
1667
|
-
typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] =
|
|
1668
|
-
typedArrayTags[dataViewTag$1] = typedArrayTags[dateTag] =
|
|
1669
|
-
typedArrayTags[errorTag] = typedArrayTags[funcTag] =
|
|
1670
|
-
typedArrayTags[mapTag$1] = typedArrayTags[numberTag] =
|
|
1671
|
-
typedArrayTags[objectTag$2] = typedArrayTags[regexpTag] =
|
|
1672
|
-
typedArrayTags[setTag$1] = typedArrayTags[stringTag] =
|
|
1673
|
-
typedArrayTags[weakMapTag$1] = false;
|
|
1674
|
-
|
|
1675
|
-
/**
|
|
1676
|
-
* The base implementation of `_.isTypedArray` without Node.js optimizations.
|
|
1677
|
-
*
|
|
1678
|
-
* @private
|
|
1679
|
-
* @param {*} value The value to check.
|
|
1680
|
-
* @returns {boolean} Returns `true` if `value` is a typed array, else `false`.
|
|
1681
|
-
*/
|
|
1682
|
-
function baseIsTypedArray(value) {
|
|
1683
|
-
return isObjectLike_1(value) &&
|
|
1684
|
-
isLength_1(value.length) && !!typedArrayTags[_baseGetTag(value)];
|
|
1685
|
-
}
|
|
1686
|
-
|
|
1687
|
-
var _baseIsTypedArray = baseIsTypedArray;
|
|
1688
|
-
|
|
1689
|
-
/**
|
|
1690
|
-
* The base implementation of `_.unary` without support for storing metadata.
|
|
1691
|
-
*
|
|
1692
|
-
* @private
|
|
1693
|
-
* @param {Function} func The function to cap arguments for.
|
|
1694
|
-
* @returns {Function} Returns the new capped function.
|
|
1695
|
-
*/
|
|
1696
|
-
function baseUnary(func) {
|
|
1697
|
-
return function(value) {
|
|
1698
|
-
return func(value);
|
|
1699
|
-
};
|
|
1700
|
-
}
|
|
1701
|
-
|
|
1702
|
-
var _baseUnary = baseUnary;
|
|
1703
|
-
|
|
1704
|
-
var _nodeUtil = createCommonjsModule(function (module, exports) {
|
|
1705
|
-
/** Detect free variable `exports`. */
|
|
1706
|
-
var freeExports = exports && !exports.nodeType && exports;
|
|
1707
|
-
|
|
1708
|
-
/** Detect free variable `module`. */
|
|
1709
|
-
var freeModule = freeExports && 'object' == 'object' && module && !module.nodeType && module;
|
|
1710
|
-
|
|
1711
|
-
/** Detect the popular CommonJS extension `module.exports`. */
|
|
1712
|
-
var moduleExports = freeModule && freeModule.exports === freeExports;
|
|
1713
|
-
|
|
1714
|
-
/** Detect free variable `process` from Node.js. */
|
|
1715
|
-
var freeProcess = moduleExports && _freeGlobal.process;
|
|
1716
|
-
|
|
1717
|
-
/** Used to access faster Node.js helpers. */
|
|
1718
|
-
var nodeUtil = (function() {
|
|
1719
|
-
try {
|
|
1720
|
-
// Use `util.types` for Node.js 10+.
|
|
1721
|
-
var types = freeModule && freeModule.require && freeModule.require('util').types;
|
|
1722
|
-
|
|
1723
|
-
if (types) {
|
|
1724
|
-
return types;
|
|
1725
|
-
}
|
|
1726
|
-
|
|
1727
|
-
// Legacy `process.binding('util')` for Node.js < 10.
|
|
1728
|
-
return freeProcess && freeProcess.binding && freeProcess.binding('util');
|
|
1729
|
-
} catch (e) {}
|
|
1730
|
-
}());
|
|
1731
|
-
|
|
1732
|
-
module.exports = nodeUtil;
|
|
1733
|
-
});
|
|
1734
|
-
|
|
1735
|
-
/* Node.js helper references. */
|
|
1736
|
-
var nodeIsTypedArray = _nodeUtil && _nodeUtil.isTypedArray;
|
|
1737
|
-
|
|
1738
|
-
/**
|
|
1739
|
-
* Checks if `value` is classified as a typed array.
|
|
1740
|
-
*
|
|
1741
|
-
* @static
|
|
1742
|
-
* @memberOf _
|
|
1743
|
-
* @since 3.0.0
|
|
1744
|
-
* @category Lang
|
|
1745
|
-
* @param {*} value The value to check.
|
|
1746
|
-
* @returns {boolean} Returns `true` if `value` is a typed array, else `false`.
|
|
1747
|
-
* @example
|
|
1748
|
-
*
|
|
1749
|
-
* _.isTypedArray(new Uint8Array);
|
|
1750
|
-
* // => true
|
|
1751
|
-
*
|
|
1752
|
-
* _.isTypedArray([]);
|
|
1753
|
-
* // => false
|
|
1754
|
-
*/
|
|
1755
|
-
var isTypedArray = nodeIsTypedArray ? _baseUnary(nodeIsTypedArray) : _baseIsTypedArray;
|
|
1756
|
-
|
|
1757
|
-
var isTypedArray_1 = isTypedArray;
|
|
1758
|
-
|
|
1759
|
-
/** Used for built-in method references. */
|
|
1760
|
-
var objectProto$4 = Object.prototype;
|
|
1761
|
-
|
|
1762
|
-
/** Used to check objects for own properties. */
|
|
1763
|
-
var hasOwnProperty$3 = objectProto$4.hasOwnProperty;
|
|
1764
|
-
|
|
1765
|
-
/**
|
|
1766
|
-
* Creates an array of the enumerable property names of the array-like `value`.
|
|
1767
|
-
*
|
|
1768
|
-
* @private
|
|
1769
|
-
* @param {*} value The value to query.
|
|
1770
|
-
* @param {boolean} inherited Specify returning inherited property names.
|
|
1771
|
-
* @returns {Array} Returns the array of property names.
|
|
1772
|
-
*/
|
|
1773
|
-
function arrayLikeKeys(value, inherited) {
|
|
1774
|
-
var isArr = isArray_1(value),
|
|
1775
|
-
isArg = !isArr && isArguments_1(value),
|
|
1776
|
-
isBuff = !isArr && !isArg && isBuffer_1(value),
|
|
1777
|
-
isType = !isArr && !isArg && !isBuff && isTypedArray_1(value),
|
|
1778
|
-
skipIndexes = isArr || isArg || isBuff || isType,
|
|
1779
|
-
result = skipIndexes ? _baseTimes(value.length, String) : [],
|
|
1780
|
-
length = result.length;
|
|
1781
|
-
|
|
1782
|
-
for (var key in value) {
|
|
1783
|
-
if ((inherited || hasOwnProperty$3.call(value, key)) &&
|
|
1784
|
-
!(skipIndexes && (
|
|
1785
|
-
// Safari 9 has enumerable `arguments.length` in strict mode.
|
|
1786
|
-
key == 'length' ||
|
|
1787
|
-
// Node.js 0.10 has enumerable non-index properties on buffers.
|
|
1788
|
-
(isBuff && (key == 'offset' || key == 'parent')) ||
|
|
1789
|
-
// PhantomJS 2 has enumerable non-index properties on typed arrays.
|
|
1790
|
-
(isType && (key == 'buffer' || key == 'byteLength' || key == 'byteOffset')) ||
|
|
1791
|
-
// Skip index properties.
|
|
1792
|
-
_isIndex(key, length)
|
|
1793
|
-
))) {
|
|
1794
|
-
result.push(key);
|
|
1795
|
-
}
|
|
1796
|
-
}
|
|
1797
|
-
return result;
|
|
1798
|
-
}
|
|
1799
|
-
|
|
1800
|
-
var _arrayLikeKeys = arrayLikeKeys;
|
|
1801
|
-
|
|
1802
|
-
/** Used for built-in method references. */
|
|
1803
|
-
var objectProto$3 = Object.prototype;
|
|
1804
|
-
|
|
1805
|
-
/**
|
|
1806
|
-
* Checks if `value` is likely a prototype object.
|
|
1807
|
-
*
|
|
1808
|
-
* @private
|
|
1809
|
-
* @param {*} value The value to check.
|
|
1810
|
-
* @returns {boolean} Returns `true` if `value` is a prototype, else `false`.
|
|
1811
|
-
*/
|
|
1812
|
-
function isPrototype(value) {
|
|
1813
|
-
var Ctor = value && value.constructor,
|
|
1814
|
-
proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto$3;
|
|
1815
|
-
|
|
1816
|
-
return value === proto;
|
|
1817
|
-
}
|
|
1818
|
-
|
|
1819
|
-
var _isPrototype = isPrototype;
|
|
1820
|
-
|
|
1821
|
-
/**
|
|
1822
|
-
* Creates a unary function that invokes `func` with its argument transformed.
|
|
1823
|
-
*
|
|
1824
|
-
* @private
|
|
1825
|
-
* @param {Function} func The function to wrap.
|
|
1826
|
-
* @param {Function} transform The argument transform.
|
|
1827
|
-
* @returns {Function} Returns the new function.
|
|
1828
|
-
*/
|
|
1829
|
-
function overArg(func, transform) {
|
|
1830
|
-
return function(arg) {
|
|
1831
|
-
return func(transform(arg));
|
|
1832
|
-
};
|
|
1833
|
-
}
|
|
1834
|
-
|
|
1835
|
-
var _overArg = overArg;
|
|
1836
|
-
|
|
1837
|
-
/* Built-in method references for those with the same name as other `lodash` methods. */
|
|
1838
|
-
var nativeKeys = _overArg(Object.keys, Object);
|
|
1839
|
-
|
|
1840
|
-
var _nativeKeys = nativeKeys;
|
|
1841
|
-
|
|
1842
|
-
/** Used for built-in method references. */
|
|
1843
|
-
var objectProto$2 = Object.prototype;
|
|
1844
|
-
|
|
1845
|
-
/** Used to check objects for own properties. */
|
|
1846
|
-
var hasOwnProperty$2 = objectProto$2.hasOwnProperty;
|
|
1847
|
-
|
|
1848
|
-
/**
|
|
1849
|
-
* The base implementation of `_.keys` which doesn't treat sparse arrays as dense.
|
|
1850
|
-
*
|
|
1851
|
-
* @private
|
|
1852
|
-
* @param {Object} object The object to query.
|
|
1853
|
-
* @returns {Array} Returns the array of property names.
|
|
1854
|
-
*/
|
|
1855
|
-
function baseKeys(object) {
|
|
1856
|
-
if (!_isPrototype(object)) {
|
|
1857
|
-
return _nativeKeys(object);
|
|
1858
|
-
}
|
|
1859
|
-
var result = [];
|
|
1860
|
-
for (var key in Object(object)) {
|
|
1861
|
-
if (hasOwnProperty$2.call(object, key) && key != 'constructor') {
|
|
1862
|
-
result.push(key);
|
|
1863
|
-
}
|
|
1864
|
-
}
|
|
1865
|
-
return result;
|
|
1866
|
-
}
|
|
1867
|
-
|
|
1868
|
-
var _baseKeys = baseKeys;
|
|
1869
|
-
|
|
1870
|
-
/**
|
|
1871
|
-
* Checks if `value` is array-like. A value is considered array-like if it's
|
|
1872
|
-
* not a function and has a `value.length` that's an integer greater than or
|
|
1873
|
-
* equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.
|
|
1874
|
-
*
|
|
1875
|
-
* @static
|
|
1876
|
-
* @memberOf _
|
|
1877
|
-
* @since 4.0.0
|
|
1878
|
-
* @category Lang
|
|
1879
|
-
* @param {*} value The value to check.
|
|
1880
|
-
* @returns {boolean} Returns `true` if `value` is array-like, else `false`.
|
|
1881
|
-
* @example
|
|
1882
|
-
*
|
|
1883
|
-
* _.isArrayLike([1, 2, 3]);
|
|
1884
|
-
* // => true
|
|
1885
|
-
*
|
|
1886
|
-
* _.isArrayLike(document.body.children);
|
|
1887
|
-
* // => true
|
|
1888
|
-
*
|
|
1889
|
-
* _.isArrayLike('abc');
|
|
1890
|
-
* // => true
|
|
1891
|
-
*
|
|
1892
|
-
* _.isArrayLike(_.noop);
|
|
1893
|
-
* // => false
|
|
1894
|
-
*/
|
|
1895
|
-
function isArrayLike(value) {
|
|
1896
|
-
return value != null && isLength_1(value.length) && !isFunction_1(value);
|
|
1897
|
-
}
|
|
1898
|
-
|
|
1899
|
-
var isArrayLike_1 = isArrayLike;
|
|
1900
|
-
|
|
1901
|
-
/**
|
|
1902
|
-
* Creates an array of the own enumerable property names of `object`.
|
|
1903
|
-
*
|
|
1904
|
-
* **Note:** Non-object values are coerced to objects. See the
|
|
1905
|
-
* [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)
|
|
1906
|
-
* for more details.
|
|
1907
|
-
*
|
|
1908
|
-
* @static
|
|
1909
|
-
* @since 0.1.0
|
|
1910
|
-
* @memberOf _
|
|
1911
|
-
* @category Object
|
|
1912
|
-
* @param {Object} object The object to query.
|
|
1913
|
-
* @returns {Array} Returns the array of property names.
|
|
1914
|
-
* @example
|
|
1915
|
-
*
|
|
1916
|
-
* function Foo() {
|
|
1917
|
-
* this.a = 1;
|
|
1918
|
-
* this.b = 2;
|
|
1919
|
-
* }
|
|
1920
|
-
*
|
|
1921
|
-
* Foo.prototype.c = 3;
|
|
1922
|
-
*
|
|
1923
|
-
* _.keys(new Foo);
|
|
1924
|
-
* // => ['a', 'b'] (iteration order is not guaranteed)
|
|
1925
|
-
*
|
|
1926
|
-
* _.keys('hi');
|
|
1927
|
-
* // => ['0', '1']
|
|
1928
|
-
*/
|
|
1929
|
-
function keys(object) {
|
|
1930
|
-
return isArrayLike_1(object) ? _arrayLikeKeys(object) : _baseKeys(object);
|
|
1931
|
-
}
|
|
1932
|
-
|
|
1933
|
-
var keys_1 = keys;
|
|
1934
|
-
|
|
1935
|
-
/**
|
|
1936
|
-
* Creates an array of own enumerable property names and symbols of `object`.
|
|
1937
|
-
*
|
|
1938
|
-
* @private
|
|
1939
|
-
* @param {Object} object The object to query.
|
|
1940
|
-
* @returns {Array} Returns the array of property names and symbols.
|
|
1941
|
-
*/
|
|
1942
|
-
function getAllKeys(object) {
|
|
1943
|
-
return _baseGetAllKeys(object, keys_1, _getSymbols);
|
|
1944
|
-
}
|
|
1945
|
-
|
|
1946
|
-
var _getAllKeys = getAllKeys;
|
|
1947
|
-
|
|
1948
|
-
/** Used to compose bitmasks for value comparisons. */
|
|
1949
|
-
var COMPARE_PARTIAL_FLAG$1 = 1;
|
|
1950
|
-
|
|
1951
|
-
/** Used for built-in method references. */
|
|
1952
|
-
var objectProto$1 = Object.prototype;
|
|
1953
|
-
|
|
1954
|
-
/** Used to check objects for own properties. */
|
|
1955
|
-
var hasOwnProperty$1 = objectProto$1.hasOwnProperty;
|
|
1956
|
-
|
|
1957
|
-
/**
|
|
1958
|
-
* A specialized version of `baseIsEqualDeep` for objects with support for
|
|
1959
|
-
* partial deep comparisons.
|
|
1960
|
-
*
|
|
1961
|
-
* @private
|
|
1962
|
-
* @param {Object} object The object to compare.
|
|
1963
|
-
* @param {Object} other The other object to compare.
|
|
1964
|
-
* @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
|
|
1965
|
-
* @param {Function} customizer The function to customize comparisons.
|
|
1966
|
-
* @param {Function} equalFunc The function to determine equivalents of values.
|
|
1967
|
-
* @param {Object} stack Tracks traversed `object` and `other` objects.
|
|
1968
|
-
* @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
|
|
1969
|
-
*/
|
|
1970
|
-
function equalObjects(object, other, bitmask, customizer, equalFunc, stack) {
|
|
1971
|
-
var isPartial = bitmask & COMPARE_PARTIAL_FLAG$1,
|
|
1972
|
-
objProps = _getAllKeys(object),
|
|
1973
|
-
objLength = objProps.length,
|
|
1974
|
-
othProps = _getAllKeys(other),
|
|
1975
|
-
othLength = othProps.length;
|
|
1976
|
-
|
|
1977
|
-
if (objLength != othLength && !isPartial) {
|
|
1978
|
-
return false;
|
|
1979
|
-
}
|
|
1980
|
-
var index = objLength;
|
|
1981
|
-
while (index--) {
|
|
1982
|
-
var key = objProps[index];
|
|
1983
|
-
if (!(isPartial ? key in other : hasOwnProperty$1.call(other, key))) {
|
|
1984
|
-
return false;
|
|
1985
|
-
}
|
|
1986
|
-
}
|
|
1987
|
-
// Check that cyclic values are equal.
|
|
1988
|
-
var objStacked = stack.get(object);
|
|
1989
|
-
var othStacked = stack.get(other);
|
|
1990
|
-
if (objStacked && othStacked) {
|
|
1991
|
-
return objStacked == other && othStacked == object;
|
|
1992
|
-
}
|
|
1993
|
-
var result = true;
|
|
1994
|
-
stack.set(object, other);
|
|
1995
|
-
stack.set(other, object);
|
|
1996
|
-
|
|
1997
|
-
var skipCtor = isPartial;
|
|
1998
|
-
while (++index < objLength) {
|
|
1999
|
-
key = objProps[index];
|
|
2000
|
-
var objValue = object[key],
|
|
2001
|
-
othValue = other[key];
|
|
2002
|
-
|
|
2003
|
-
if (customizer) {
|
|
2004
|
-
var compared = isPartial
|
|
2005
|
-
? customizer(othValue, objValue, key, other, object, stack)
|
|
2006
|
-
: customizer(objValue, othValue, key, object, other, stack);
|
|
2007
|
-
}
|
|
2008
|
-
// Recursively compare objects (susceptible to call stack limits).
|
|
2009
|
-
if (!(compared === undefined
|
|
2010
|
-
? (objValue === othValue || equalFunc(objValue, othValue, bitmask, customizer, stack))
|
|
2011
|
-
: compared
|
|
2012
|
-
)) {
|
|
2013
|
-
result = false;
|
|
2014
|
-
break;
|
|
2015
|
-
}
|
|
2016
|
-
skipCtor || (skipCtor = key == 'constructor');
|
|
2017
|
-
}
|
|
2018
|
-
if (result && !skipCtor) {
|
|
2019
|
-
var objCtor = object.constructor,
|
|
2020
|
-
othCtor = other.constructor;
|
|
2021
|
-
|
|
2022
|
-
// Non `Object` object instances with different constructors are not equal.
|
|
2023
|
-
if (objCtor != othCtor &&
|
|
2024
|
-
('constructor' in object && 'constructor' in other) &&
|
|
2025
|
-
!(typeof objCtor == 'function' && objCtor instanceof objCtor &&
|
|
2026
|
-
typeof othCtor == 'function' && othCtor instanceof othCtor)) {
|
|
2027
|
-
result = false;
|
|
2028
|
-
}
|
|
2029
|
-
}
|
|
2030
|
-
stack['delete'](object);
|
|
2031
|
-
stack['delete'](other);
|
|
2032
|
-
return result;
|
|
2033
|
-
}
|
|
2034
|
-
|
|
2035
|
-
var _equalObjects = equalObjects;
|
|
2036
|
-
|
|
2037
|
-
/* Built-in method references that are verified to be native. */
|
|
2038
|
-
var DataView = _getNative(_root, 'DataView');
|
|
2039
|
-
|
|
2040
|
-
var _DataView = DataView;
|
|
2041
|
-
|
|
2042
|
-
/* Built-in method references that are verified to be native. */
|
|
2043
|
-
var Promise$1 = _getNative(_root, 'Promise');
|
|
2044
|
-
|
|
2045
|
-
var _Promise = Promise$1;
|
|
2046
|
-
|
|
2047
|
-
/* Built-in method references that are verified to be native. */
|
|
2048
|
-
var Set = _getNative(_root, 'Set');
|
|
2049
|
-
|
|
2050
|
-
var _Set = Set;
|
|
2051
|
-
|
|
2052
|
-
/* Built-in method references that are verified to be native. */
|
|
2053
|
-
var WeakMap = _getNative(_root, 'WeakMap');
|
|
2054
|
-
|
|
2055
|
-
var _WeakMap = WeakMap;
|
|
2056
|
-
|
|
2057
|
-
/** `Object#toString` result references. */
|
|
2058
|
-
var mapTag = '[object Map]',
|
|
2059
|
-
objectTag$1 = '[object Object]',
|
|
2060
|
-
promiseTag = '[object Promise]',
|
|
2061
|
-
setTag = '[object Set]',
|
|
2062
|
-
weakMapTag = '[object WeakMap]';
|
|
2063
|
-
|
|
2064
|
-
var dataViewTag = '[object DataView]';
|
|
2065
|
-
|
|
2066
|
-
/** Used to detect maps, sets, and weakmaps. */
|
|
2067
|
-
var dataViewCtorString = _toSource(_DataView),
|
|
2068
|
-
mapCtorString = _toSource(_Map),
|
|
2069
|
-
promiseCtorString = _toSource(_Promise),
|
|
2070
|
-
setCtorString = _toSource(_Set),
|
|
2071
|
-
weakMapCtorString = _toSource(_WeakMap);
|
|
2072
|
-
|
|
2073
|
-
/**
|
|
2074
|
-
* Gets the `toStringTag` of `value`.
|
|
2075
|
-
*
|
|
2076
|
-
* @private
|
|
2077
|
-
* @param {*} value The value to query.
|
|
2078
|
-
* @returns {string} Returns the `toStringTag`.
|
|
2079
|
-
*/
|
|
2080
|
-
var getTag = _baseGetTag;
|
|
2081
|
-
|
|
2082
|
-
// Fallback for data views, maps, sets, and weak maps in IE 11 and promises in Node.js < 6.
|
|
2083
|
-
if ((_DataView && getTag(new _DataView(new ArrayBuffer(1))) != dataViewTag) ||
|
|
2084
|
-
(_Map && getTag(new _Map) != mapTag) ||
|
|
2085
|
-
(_Promise && getTag(_Promise.resolve()) != promiseTag) ||
|
|
2086
|
-
(_Set && getTag(new _Set) != setTag) ||
|
|
2087
|
-
(_WeakMap && getTag(new _WeakMap) != weakMapTag)) {
|
|
2088
|
-
getTag = function(value) {
|
|
2089
|
-
var result = _baseGetTag(value),
|
|
2090
|
-
Ctor = result == objectTag$1 ? value.constructor : undefined,
|
|
2091
|
-
ctorString = Ctor ? _toSource(Ctor) : '';
|
|
2092
|
-
|
|
2093
|
-
if (ctorString) {
|
|
2094
|
-
switch (ctorString) {
|
|
2095
|
-
case dataViewCtorString: return dataViewTag;
|
|
2096
|
-
case mapCtorString: return mapTag;
|
|
2097
|
-
case promiseCtorString: return promiseTag;
|
|
2098
|
-
case setCtorString: return setTag;
|
|
2099
|
-
case weakMapCtorString: return weakMapTag;
|
|
2100
|
-
}
|
|
2101
|
-
}
|
|
2102
|
-
return result;
|
|
2103
|
-
};
|
|
2104
|
-
}
|
|
2105
|
-
|
|
2106
|
-
var _getTag = getTag;
|
|
2107
|
-
|
|
2108
|
-
/** Used to compose bitmasks for value comparisons. */
|
|
2109
|
-
var COMPARE_PARTIAL_FLAG = 1;
|
|
2110
|
-
|
|
2111
|
-
/** `Object#toString` result references. */
|
|
2112
|
-
var argsTag = '[object Arguments]',
|
|
2113
|
-
arrayTag = '[object Array]',
|
|
2114
|
-
objectTag = '[object Object]';
|
|
2115
|
-
|
|
2116
|
-
/** Used for built-in method references. */
|
|
2117
|
-
var objectProto = Object.prototype;
|
|
2118
|
-
|
|
2119
|
-
/** Used to check objects for own properties. */
|
|
2120
|
-
var hasOwnProperty = objectProto.hasOwnProperty;
|
|
2121
|
-
|
|
2122
|
-
/**
|
|
2123
|
-
* A specialized version of `baseIsEqual` for arrays and objects which performs
|
|
2124
|
-
* deep comparisons and tracks traversed objects enabling objects with circular
|
|
2125
|
-
* references to be compared.
|
|
2126
|
-
*
|
|
2127
|
-
* @private
|
|
2128
|
-
* @param {Object} object The object to compare.
|
|
2129
|
-
* @param {Object} other The other object to compare.
|
|
2130
|
-
* @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.
|
|
2131
|
-
* @param {Function} customizer The function to customize comparisons.
|
|
2132
|
-
* @param {Function} equalFunc The function to determine equivalents of values.
|
|
2133
|
-
* @param {Object} [stack] Tracks traversed `object` and `other` objects.
|
|
2134
|
-
* @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
|
|
2135
|
-
*/
|
|
2136
|
-
function baseIsEqualDeep(object, other, bitmask, customizer, equalFunc, stack) {
|
|
2137
|
-
var objIsArr = isArray_1(object),
|
|
2138
|
-
othIsArr = isArray_1(other),
|
|
2139
|
-
objTag = objIsArr ? arrayTag : _getTag(object),
|
|
2140
|
-
othTag = othIsArr ? arrayTag : _getTag(other);
|
|
2141
|
-
|
|
2142
|
-
objTag = objTag == argsTag ? objectTag : objTag;
|
|
2143
|
-
othTag = othTag == argsTag ? objectTag : othTag;
|
|
2144
|
-
|
|
2145
|
-
var objIsObj = objTag == objectTag,
|
|
2146
|
-
othIsObj = othTag == objectTag,
|
|
2147
|
-
isSameTag = objTag == othTag;
|
|
2148
|
-
|
|
2149
|
-
if (isSameTag && isBuffer_1(object)) {
|
|
2150
|
-
if (!isBuffer_1(other)) {
|
|
2151
|
-
return false;
|
|
2152
|
-
}
|
|
2153
|
-
objIsArr = true;
|
|
2154
|
-
objIsObj = false;
|
|
2155
|
-
}
|
|
2156
|
-
if (isSameTag && !objIsObj) {
|
|
2157
|
-
stack || (stack = new _Stack);
|
|
2158
|
-
return (objIsArr || isTypedArray_1(object))
|
|
2159
|
-
? _equalArrays(object, other, bitmask, customizer, equalFunc, stack)
|
|
2160
|
-
: _equalByTag(object, other, objTag, bitmask, customizer, equalFunc, stack);
|
|
2161
|
-
}
|
|
2162
|
-
if (!(bitmask & COMPARE_PARTIAL_FLAG)) {
|
|
2163
|
-
var objIsWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'),
|
|
2164
|
-
othIsWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__');
|
|
2165
|
-
|
|
2166
|
-
if (objIsWrapped || othIsWrapped) {
|
|
2167
|
-
var objUnwrapped = objIsWrapped ? object.value() : object,
|
|
2168
|
-
othUnwrapped = othIsWrapped ? other.value() : other;
|
|
2169
|
-
|
|
2170
|
-
stack || (stack = new _Stack);
|
|
2171
|
-
return equalFunc(objUnwrapped, othUnwrapped, bitmask, customizer, stack);
|
|
2172
|
-
}
|
|
2173
|
-
}
|
|
2174
|
-
if (!isSameTag) {
|
|
2175
|
-
return false;
|
|
2176
|
-
}
|
|
2177
|
-
stack || (stack = new _Stack);
|
|
2178
|
-
return _equalObjects(object, other, bitmask, customizer, equalFunc, stack);
|
|
2179
|
-
}
|
|
2180
|
-
|
|
2181
|
-
var _baseIsEqualDeep = baseIsEqualDeep;
|
|
2182
|
-
|
|
2183
|
-
/**
|
|
2184
|
-
* The base implementation of `_.isEqual` which supports partial comparisons
|
|
2185
|
-
* and tracks traversed objects.
|
|
2186
|
-
*
|
|
2187
|
-
* @private
|
|
2188
|
-
* @param {*} value The value to compare.
|
|
2189
|
-
* @param {*} other The other value to compare.
|
|
2190
|
-
* @param {boolean} bitmask The bitmask flags.
|
|
2191
|
-
* 1 - Unordered comparison
|
|
2192
|
-
* 2 - Partial comparison
|
|
2193
|
-
* @param {Function} [customizer] The function to customize comparisons.
|
|
2194
|
-
* @param {Object} [stack] Tracks traversed `value` and `other` objects.
|
|
2195
|
-
* @returns {boolean} Returns `true` if the values are equivalent, else `false`.
|
|
2196
|
-
*/
|
|
2197
|
-
function baseIsEqual(value, other, bitmask, customizer, stack) {
|
|
2198
|
-
if (value === other) {
|
|
2199
|
-
return true;
|
|
2200
|
-
}
|
|
2201
|
-
if (value == null || other == null || (!isObjectLike_1(value) && !isObjectLike_1(other))) {
|
|
2202
|
-
return value !== value && other !== other;
|
|
2203
|
-
}
|
|
2204
|
-
return _baseIsEqualDeep(value, other, bitmask, customizer, baseIsEqual, stack);
|
|
2205
|
-
}
|
|
2206
|
-
|
|
2207
|
-
var _baseIsEqual = baseIsEqual;
|
|
2208
|
-
|
|
2209
|
-
/**
|
|
2210
|
-
* Performs a deep comparison between two values to determine if they are
|
|
2211
|
-
* equivalent.
|
|
2212
|
-
*
|
|
2213
|
-
* **Note:** This method supports comparing arrays, array buffers, booleans,
|
|
2214
|
-
* date objects, error objects, maps, numbers, `Object` objects, regexes,
|
|
2215
|
-
* sets, strings, symbols, and typed arrays. `Object` objects are compared
|
|
2216
|
-
* by their own, not inherited, enumerable properties. Functions and DOM
|
|
2217
|
-
* nodes are compared by strict equality, i.e. `===`.
|
|
2218
|
-
*
|
|
2219
|
-
* @static
|
|
2220
|
-
* @memberOf _
|
|
2221
|
-
* @since 0.1.0
|
|
2222
|
-
* @category Lang
|
|
2223
|
-
* @param {*} value The value to compare.
|
|
2224
|
-
* @param {*} other The other value to compare.
|
|
2225
|
-
* @returns {boolean} Returns `true` if the values are equivalent, else `false`.
|
|
2226
|
-
* @example
|
|
2227
|
-
*
|
|
2228
|
-
* var object = { 'a': 1 };
|
|
2229
|
-
* var other = { 'a': 1 };
|
|
2230
|
-
*
|
|
2231
|
-
* _.isEqual(object, other);
|
|
2232
|
-
* // => true
|
|
2233
|
-
*
|
|
2234
|
-
* object === other;
|
|
2235
|
-
* // => false
|
|
2236
|
-
*/
|
|
2237
|
-
function isEqual(value, other) {
|
|
2238
|
-
return _baseIsEqual(value, other);
|
|
2239
|
-
}
|
|
2240
|
-
|
|
2241
|
-
var isEqual_1 = isEqual;
|
|
2242
|
-
|
|
2243
42
|
var style$4 = {"select-input":"_d8lGc","disabled":"_3kjwO","wrap":"_dsTM2","select-input-inner":"_NQoX9","large":"_T8ZX8","small":"_1B72H","select-input-icon":"_g8QC-","placeholder":"_r3q69","overlay-content":"_zEqGe","overlay":"_ybN30","select-input-prefix":"_4Pw75","select-input-suffix":"_Wd4pE"};
|
|
2244
43
|
|
|
2245
44
|
const _excluded$1 = ["children"];
|
|
@@ -2265,7 +64,7 @@ const ModalContent = _ref => {
|
|
|
2265
64
|
} = others;
|
|
2266
65
|
const [value, setValue] = useState(propsValue);
|
|
2267
66
|
useEffect(() => {
|
|
2268
|
-
if (open && !
|
|
67
|
+
if (open && !isEqual(value, propsValue)) {
|
|
2269
68
|
setValue(propsValue);
|
|
2270
69
|
}
|
|
2271
70
|
}, [open]);
|
|
@@ -2346,15 +145,6 @@ const SelectInput = forwardRef((p, ref) => {
|
|
|
2346
145
|
[props.valueKey]: props.selectedAllValue.value,
|
|
2347
146
|
[props.labelKey]: props.selectedAllValue.label
|
|
2348
147
|
};
|
|
2349
|
-
const [stateValue, setValue] = useControlValue(props);
|
|
2350
|
-
const value = stateValue || [];
|
|
2351
|
-
const [searchText, setSearchText] = useState('');
|
|
2352
|
-
const [open, setOpen] = useState(false);
|
|
2353
|
-
const [hover, setHover] = useState(false);
|
|
2354
|
-
const [inputWidth, setInputWidth] = useState(0);
|
|
2355
|
-
const inputRef = useResize(el => {
|
|
2356
|
-
setInputWidth(el.clientWidth);
|
|
2357
|
-
});
|
|
2358
148
|
const {
|
|
2359
149
|
children,
|
|
2360
150
|
prefix,
|
|
@@ -2375,6 +165,29 @@ const SelectInput = forwardRef((p, ref) => {
|
|
|
2375
165
|
labelKey,
|
|
2376
166
|
valueKey
|
|
2377
167
|
} = props;
|
|
168
|
+
const transformValue = value => {
|
|
169
|
+
if (single) {
|
|
170
|
+
return isNotEmpty(value) ? [value] : [];
|
|
171
|
+
} else {
|
|
172
|
+
return Array.isArray(value) ? value : [];
|
|
173
|
+
}
|
|
174
|
+
};
|
|
175
|
+
const [value, setValue] = useControlValue(Object.assign({}, props, {
|
|
176
|
+
onChange: value => {
|
|
177
|
+
props.onChange && props.onChange(props.single ? last(value) : value);
|
|
178
|
+
}
|
|
179
|
+
}, 'value' in props ? {
|
|
180
|
+
value: transformValue(props.value)
|
|
181
|
+
} : {
|
|
182
|
+
defaultValue: transformValue(props.defaultValue)
|
|
183
|
+
}));
|
|
184
|
+
const [searchProps, setSearchProps] = useState({});
|
|
185
|
+
const [open, setOpen] = useState(false);
|
|
186
|
+
const [hover, setHover] = useState(false);
|
|
187
|
+
const [inputWidth, setInputWidth] = useState(0);
|
|
188
|
+
const inputRef = useResize(el => {
|
|
189
|
+
setInputWidth(el.clientWidth);
|
|
190
|
+
});
|
|
2378
191
|
const popupOverlayWidth = numberToPx(Math.max(inputWidth, pxToNumber(overlayWidth)));
|
|
2379
192
|
const {
|
|
2380
193
|
message
|
|
@@ -2479,8 +292,8 @@ const SelectInput = forwardRef((p, ref) => {
|
|
|
2479
292
|
props,
|
|
2480
293
|
value: value,
|
|
2481
294
|
setValue,
|
|
2482
|
-
|
|
2483
|
-
|
|
295
|
+
searchProps,
|
|
296
|
+
setSearchProps,
|
|
2484
297
|
hover,
|
|
2485
298
|
inputWidth,
|
|
2486
299
|
onAdd,
|
|
@@ -2518,356 +331,6 @@ const SelectInput = forwardRef((p, ref) => {
|
|
|
2518
331
|
}), /*#__PURE__*/React.createElement(ModalContent, contextProps, renderModal)));
|
|
2519
332
|
});
|
|
2520
333
|
|
|
2521
|
-
/** `Object#toString` result references. */
|
|
2522
|
-
var symbolTag = '[object Symbol]';
|
|
2523
|
-
|
|
2524
|
-
/**
|
|
2525
|
-
* Checks if `value` is classified as a `Symbol` primitive or object.
|
|
2526
|
-
*
|
|
2527
|
-
* @static
|
|
2528
|
-
* @memberOf _
|
|
2529
|
-
* @since 4.0.0
|
|
2530
|
-
* @category Lang
|
|
2531
|
-
* @param {*} value The value to check.
|
|
2532
|
-
* @returns {boolean} Returns `true` if `value` is a symbol, else `false`.
|
|
2533
|
-
* @example
|
|
2534
|
-
*
|
|
2535
|
-
* _.isSymbol(Symbol.iterator);
|
|
2536
|
-
* // => true
|
|
2537
|
-
*
|
|
2538
|
-
* _.isSymbol('abc');
|
|
2539
|
-
* // => false
|
|
2540
|
-
*/
|
|
2541
|
-
function isSymbol(value) {
|
|
2542
|
-
return typeof value == 'symbol' ||
|
|
2543
|
-
(isObjectLike_1(value) && _baseGetTag(value) == symbolTag);
|
|
2544
|
-
}
|
|
2545
|
-
|
|
2546
|
-
var isSymbol_1 = isSymbol;
|
|
2547
|
-
|
|
2548
|
-
/** Used to match property names within property paths. */
|
|
2549
|
-
var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,
|
|
2550
|
-
reIsPlainProp = /^\w*$/;
|
|
2551
|
-
|
|
2552
|
-
/**
|
|
2553
|
-
* Checks if `value` is a property name and not a property path.
|
|
2554
|
-
*
|
|
2555
|
-
* @private
|
|
2556
|
-
* @param {*} value The value to check.
|
|
2557
|
-
* @param {Object} [object] The object to query keys on.
|
|
2558
|
-
* @returns {boolean} Returns `true` if `value` is a property name, else `false`.
|
|
2559
|
-
*/
|
|
2560
|
-
function isKey(value, object) {
|
|
2561
|
-
if (isArray_1(value)) {
|
|
2562
|
-
return false;
|
|
2563
|
-
}
|
|
2564
|
-
var type = typeof value;
|
|
2565
|
-
if (type == 'number' || type == 'symbol' || type == 'boolean' ||
|
|
2566
|
-
value == null || isSymbol_1(value)) {
|
|
2567
|
-
return true;
|
|
2568
|
-
}
|
|
2569
|
-
return reIsPlainProp.test(value) || !reIsDeepProp.test(value) ||
|
|
2570
|
-
(object != null && value in Object(object));
|
|
2571
|
-
}
|
|
2572
|
-
|
|
2573
|
-
var _isKey = isKey;
|
|
2574
|
-
|
|
2575
|
-
/** Error message constants. */
|
|
2576
|
-
var FUNC_ERROR_TEXT = 'Expected a function';
|
|
2577
|
-
|
|
2578
|
-
/**
|
|
2579
|
-
* Creates a function that memoizes the result of `func`. If `resolver` is
|
|
2580
|
-
* provided, it determines the cache key for storing the result based on the
|
|
2581
|
-
* arguments provided to the memoized function. By default, the first argument
|
|
2582
|
-
* provided to the memoized function is used as the map cache key. The `func`
|
|
2583
|
-
* is invoked with the `this` binding of the memoized function.
|
|
2584
|
-
*
|
|
2585
|
-
* **Note:** The cache is exposed as the `cache` property on the memoized
|
|
2586
|
-
* function. Its creation may be customized by replacing the `_.memoize.Cache`
|
|
2587
|
-
* constructor with one whose instances implement the
|
|
2588
|
-
* [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object)
|
|
2589
|
-
* method interface of `clear`, `delete`, `get`, `has`, and `set`.
|
|
2590
|
-
*
|
|
2591
|
-
* @static
|
|
2592
|
-
* @memberOf _
|
|
2593
|
-
* @since 0.1.0
|
|
2594
|
-
* @category Function
|
|
2595
|
-
* @param {Function} func The function to have its output memoized.
|
|
2596
|
-
* @param {Function} [resolver] The function to resolve the cache key.
|
|
2597
|
-
* @returns {Function} Returns the new memoized function.
|
|
2598
|
-
* @example
|
|
2599
|
-
*
|
|
2600
|
-
* var object = { 'a': 1, 'b': 2 };
|
|
2601
|
-
* var other = { 'c': 3, 'd': 4 };
|
|
2602
|
-
*
|
|
2603
|
-
* var values = _.memoize(_.values);
|
|
2604
|
-
* values(object);
|
|
2605
|
-
* // => [1, 2]
|
|
2606
|
-
*
|
|
2607
|
-
* values(other);
|
|
2608
|
-
* // => [3, 4]
|
|
2609
|
-
*
|
|
2610
|
-
* object.a = 2;
|
|
2611
|
-
* values(object);
|
|
2612
|
-
* // => [1, 2]
|
|
2613
|
-
*
|
|
2614
|
-
* // Modify the result cache.
|
|
2615
|
-
* values.cache.set(object, ['a', 'b']);
|
|
2616
|
-
* values(object);
|
|
2617
|
-
* // => ['a', 'b']
|
|
2618
|
-
*
|
|
2619
|
-
* // Replace `_.memoize.Cache`.
|
|
2620
|
-
* _.memoize.Cache = WeakMap;
|
|
2621
|
-
*/
|
|
2622
|
-
function memoize(func, resolver) {
|
|
2623
|
-
if (typeof func != 'function' || (resolver != null && typeof resolver != 'function')) {
|
|
2624
|
-
throw new TypeError(FUNC_ERROR_TEXT);
|
|
2625
|
-
}
|
|
2626
|
-
var memoized = function() {
|
|
2627
|
-
var args = arguments,
|
|
2628
|
-
key = resolver ? resolver.apply(this, args) : args[0],
|
|
2629
|
-
cache = memoized.cache;
|
|
2630
|
-
|
|
2631
|
-
if (cache.has(key)) {
|
|
2632
|
-
return cache.get(key);
|
|
2633
|
-
}
|
|
2634
|
-
var result = func.apply(this, args);
|
|
2635
|
-
memoized.cache = cache.set(key, result) || cache;
|
|
2636
|
-
return result;
|
|
2637
|
-
};
|
|
2638
|
-
memoized.cache = new (memoize.Cache || _MapCache);
|
|
2639
|
-
return memoized;
|
|
2640
|
-
}
|
|
2641
|
-
|
|
2642
|
-
// Expose `MapCache`.
|
|
2643
|
-
memoize.Cache = _MapCache;
|
|
2644
|
-
|
|
2645
|
-
var memoize_1 = memoize;
|
|
2646
|
-
|
|
2647
|
-
/** Used as the maximum memoize cache size. */
|
|
2648
|
-
var MAX_MEMOIZE_SIZE = 500;
|
|
2649
|
-
|
|
2650
|
-
/**
|
|
2651
|
-
* A specialized version of `_.memoize` which clears the memoized function's
|
|
2652
|
-
* cache when it exceeds `MAX_MEMOIZE_SIZE`.
|
|
2653
|
-
*
|
|
2654
|
-
* @private
|
|
2655
|
-
* @param {Function} func The function to have its output memoized.
|
|
2656
|
-
* @returns {Function} Returns the new memoized function.
|
|
2657
|
-
*/
|
|
2658
|
-
function memoizeCapped(func) {
|
|
2659
|
-
var result = memoize_1(func, function(key) {
|
|
2660
|
-
if (cache.size === MAX_MEMOIZE_SIZE) {
|
|
2661
|
-
cache.clear();
|
|
2662
|
-
}
|
|
2663
|
-
return key;
|
|
2664
|
-
});
|
|
2665
|
-
|
|
2666
|
-
var cache = result.cache;
|
|
2667
|
-
return result;
|
|
2668
|
-
}
|
|
2669
|
-
|
|
2670
|
-
var _memoizeCapped = memoizeCapped;
|
|
2671
|
-
|
|
2672
|
-
/** Used to match property names within property paths. */
|
|
2673
|
-
var rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g;
|
|
2674
|
-
|
|
2675
|
-
/** Used to match backslashes in property paths. */
|
|
2676
|
-
var reEscapeChar = /\\(\\)?/g;
|
|
2677
|
-
|
|
2678
|
-
/**
|
|
2679
|
-
* Converts `string` to a property path array.
|
|
2680
|
-
*
|
|
2681
|
-
* @private
|
|
2682
|
-
* @param {string} string The string to convert.
|
|
2683
|
-
* @returns {Array} Returns the property path array.
|
|
2684
|
-
*/
|
|
2685
|
-
var stringToPath = _memoizeCapped(function(string) {
|
|
2686
|
-
var result = [];
|
|
2687
|
-
if (string.charCodeAt(0) === 46 /* . */) {
|
|
2688
|
-
result.push('');
|
|
2689
|
-
}
|
|
2690
|
-
string.replace(rePropName, function(match, number, quote, subString) {
|
|
2691
|
-
result.push(quote ? subString.replace(reEscapeChar, '$1') : (number || match));
|
|
2692
|
-
});
|
|
2693
|
-
return result;
|
|
2694
|
-
});
|
|
2695
|
-
|
|
2696
|
-
var _stringToPath = stringToPath;
|
|
2697
|
-
|
|
2698
|
-
/**
|
|
2699
|
-
* A specialized version of `_.map` for arrays without support for iteratee
|
|
2700
|
-
* shorthands.
|
|
2701
|
-
*
|
|
2702
|
-
* @private
|
|
2703
|
-
* @param {Array} [array] The array to iterate over.
|
|
2704
|
-
* @param {Function} iteratee The function invoked per iteration.
|
|
2705
|
-
* @returns {Array} Returns the new mapped array.
|
|
2706
|
-
*/
|
|
2707
|
-
function arrayMap(array, iteratee) {
|
|
2708
|
-
var index = -1,
|
|
2709
|
-
length = array == null ? 0 : array.length,
|
|
2710
|
-
result = Array(length);
|
|
2711
|
-
|
|
2712
|
-
while (++index < length) {
|
|
2713
|
-
result[index] = iteratee(array[index], index, array);
|
|
2714
|
-
}
|
|
2715
|
-
return result;
|
|
2716
|
-
}
|
|
2717
|
-
|
|
2718
|
-
var _arrayMap = arrayMap;
|
|
2719
|
-
|
|
2720
|
-
/** Used as references for various `Number` constants. */
|
|
2721
|
-
var INFINITY$1 = 1 / 0;
|
|
2722
|
-
|
|
2723
|
-
/** Used to convert symbols to primitives and strings. */
|
|
2724
|
-
var symbolProto = _Symbol ? _Symbol.prototype : undefined,
|
|
2725
|
-
symbolToString = symbolProto ? symbolProto.toString : undefined;
|
|
2726
|
-
|
|
2727
|
-
/**
|
|
2728
|
-
* The base implementation of `_.toString` which doesn't convert nullish
|
|
2729
|
-
* values to empty strings.
|
|
2730
|
-
*
|
|
2731
|
-
* @private
|
|
2732
|
-
* @param {*} value The value to process.
|
|
2733
|
-
* @returns {string} Returns the string.
|
|
2734
|
-
*/
|
|
2735
|
-
function baseToString(value) {
|
|
2736
|
-
// Exit early for strings to avoid a performance hit in some environments.
|
|
2737
|
-
if (typeof value == 'string') {
|
|
2738
|
-
return value;
|
|
2739
|
-
}
|
|
2740
|
-
if (isArray_1(value)) {
|
|
2741
|
-
// Recursively convert values (susceptible to call stack limits).
|
|
2742
|
-
return _arrayMap(value, baseToString) + '';
|
|
2743
|
-
}
|
|
2744
|
-
if (isSymbol_1(value)) {
|
|
2745
|
-
return symbolToString ? symbolToString.call(value) : '';
|
|
2746
|
-
}
|
|
2747
|
-
var result = (value + '');
|
|
2748
|
-
return (result == '0' && (1 / value) == -INFINITY$1) ? '-0' : result;
|
|
2749
|
-
}
|
|
2750
|
-
|
|
2751
|
-
var _baseToString = baseToString;
|
|
2752
|
-
|
|
2753
|
-
/**
|
|
2754
|
-
* Converts `value` to a string. An empty string is returned for `null`
|
|
2755
|
-
* and `undefined` values. The sign of `-0` is preserved.
|
|
2756
|
-
*
|
|
2757
|
-
* @static
|
|
2758
|
-
* @memberOf _
|
|
2759
|
-
* @since 4.0.0
|
|
2760
|
-
* @category Lang
|
|
2761
|
-
* @param {*} value The value to convert.
|
|
2762
|
-
* @returns {string} Returns the converted string.
|
|
2763
|
-
* @example
|
|
2764
|
-
*
|
|
2765
|
-
* _.toString(null);
|
|
2766
|
-
* // => ''
|
|
2767
|
-
*
|
|
2768
|
-
* _.toString(-0);
|
|
2769
|
-
* // => '-0'
|
|
2770
|
-
*
|
|
2771
|
-
* _.toString([1, 2, 3]);
|
|
2772
|
-
* // => '1,2,3'
|
|
2773
|
-
*/
|
|
2774
|
-
function toString(value) {
|
|
2775
|
-
return value == null ? '' : _baseToString(value);
|
|
2776
|
-
}
|
|
2777
|
-
|
|
2778
|
-
var toString_1 = toString;
|
|
2779
|
-
|
|
2780
|
-
/**
|
|
2781
|
-
* Casts `value` to a path array if it's not one.
|
|
2782
|
-
*
|
|
2783
|
-
* @private
|
|
2784
|
-
* @param {*} value The value to inspect.
|
|
2785
|
-
* @param {Object} [object] The object to query keys on.
|
|
2786
|
-
* @returns {Array} Returns the cast property path array.
|
|
2787
|
-
*/
|
|
2788
|
-
function castPath(value, object) {
|
|
2789
|
-
if (isArray_1(value)) {
|
|
2790
|
-
return value;
|
|
2791
|
-
}
|
|
2792
|
-
return _isKey(value, object) ? [value] : _stringToPath(toString_1(value));
|
|
2793
|
-
}
|
|
2794
|
-
|
|
2795
|
-
var _castPath = castPath;
|
|
2796
|
-
|
|
2797
|
-
/** Used as references for various `Number` constants. */
|
|
2798
|
-
var INFINITY = 1 / 0;
|
|
2799
|
-
|
|
2800
|
-
/**
|
|
2801
|
-
* Converts `value` to a string key if it's not a string or symbol.
|
|
2802
|
-
*
|
|
2803
|
-
* @private
|
|
2804
|
-
* @param {*} value The value to inspect.
|
|
2805
|
-
* @returns {string|symbol} Returns the key.
|
|
2806
|
-
*/
|
|
2807
|
-
function toKey(value) {
|
|
2808
|
-
if (typeof value == 'string' || isSymbol_1(value)) {
|
|
2809
|
-
return value;
|
|
2810
|
-
}
|
|
2811
|
-
var result = (value + '');
|
|
2812
|
-
return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
|
|
2813
|
-
}
|
|
2814
|
-
|
|
2815
|
-
var _toKey = toKey;
|
|
2816
|
-
|
|
2817
|
-
/**
|
|
2818
|
-
* The base implementation of `_.get` without support for default values.
|
|
2819
|
-
*
|
|
2820
|
-
* @private
|
|
2821
|
-
* @param {Object} object The object to query.
|
|
2822
|
-
* @param {Array|string} path The path of the property to get.
|
|
2823
|
-
* @returns {*} Returns the resolved value.
|
|
2824
|
-
*/
|
|
2825
|
-
function baseGet(object, path) {
|
|
2826
|
-
path = _castPath(path, object);
|
|
2827
|
-
|
|
2828
|
-
var index = 0,
|
|
2829
|
-
length = path.length;
|
|
2830
|
-
|
|
2831
|
-
while (object != null && index < length) {
|
|
2832
|
-
object = object[_toKey(path[index++])];
|
|
2833
|
-
}
|
|
2834
|
-
return (index && index == length) ? object : undefined;
|
|
2835
|
-
}
|
|
2836
|
-
|
|
2837
|
-
var _baseGet = baseGet;
|
|
2838
|
-
|
|
2839
|
-
/**
|
|
2840
|
-
* Gets the value at `path` of `object`. If the resolved value is
|
|
2841
|
-
* `undefined`, the `defaultValue` is returned in its place.
|
|
2842
|
-
*
|
|
2843
|
-
* @static
|
|
2844
|
-
* @memberOf _
|
|
2845
|
-
* @since 3.7.0
|
|
2846
|
-
* @category Object
|
|
2847
|
-
* @param {Object} object The object to query.
|
|
2848
|
-
* @param {Array|string} path The path of the property to get.
|
|
2849
|
-
* @param {*} [defaultValue] The value returned for `undefined` resolved values.
|
|
2850
|
-
* @returns {*} Returns the resolved value.
|
|
2851
|
-
* @example
|
|
2852
|
-
*
|
|
2853
|
-
* var object = { 'a': [{ 'b': { 'c': 3 } }] };
|
|
2854
|
-
*
|
|
2855
|
-
* _.get(object, 'a[0].b.c');
|
|
2856
|
-
* // => 3
|
|
2857
|
-
*
|
|
2858
|
-
* _.get(object, ['a', '0', 'b', 'c']);
|
|
2859
|
-
* // => 3
|
|
2860
|
-
*
|
|
2861
|
-
* _.get(object, 'a.b.c', 'default');
|
|
2862
|
-
* // => 'default'
|
|
2863
|
-
*/
|
|
2864
|
-
function get(object, path, defaultValue) {
|
|
2865
|
-
var result = object == null ? undefined : _baseGet(object, path);
|
|
2866
|
-
return result === undefined ? defaultValue : result;
|
|
2867
|
-
}
|
|
2868
|
-
|
|
2869
|
-
var get_1 = get;
|
|
2870
|
-
|
|
2871
334
|
var style$3 = {"selected-all":"_prlgN"};
|
|
2872
335
|
|
|
2873
336
|
const SelectedAll = () => {
|
|
@@ -2903,7 +366,7 @@ const SelectedAll = () => {
|
|
|
2903
366
|
}, locale.selectAll)));
|
|
2904
367
|
};
|
|
2905
368
|
const computedIsSelectAll = (value, selectedAllValue, valueKey = 'value') => {
|
|
2906
|
-
return (value == null ? void 0 : value.length) === 1 &&
|
|
369
|
+
return (value == null ? void 0 : value.length) === 1 && get(value, `[0][${valueKey}]`) === selectedAllValue[valueKey];
|
|
2907
370
|
};
|
|
2908
371
|
|
|
2909
372
|
var style$2 = {"label":"_l3KoW","tag-list":"_CCPzb","tag-container":"_dKZHi","tag-container-inner":"_oijCI","tag":"_WmnnS","tag-inner":"_TMcFl"};
|
|
@@ -3048,8 +511,8 @@ const SelectList = forwardRef((_ref, ref) => {
|
|
|
3048
511
|
const {
|
|
3049
512
|
props,
|
|
3050
513
|
value,
|
|
3051
|
-
|
|
3052
|
-
|
|
514
|
+
searchProps,
|
|
515
|
+
setSearchProps
|
|
3053
516
|
} = targetProps;
|
|
3054
517
|
const {
|
|
3055
518
|
isPopup,
|
|
@@ -3071,9 +534,11 @@ const SelectList = forwardRef((_ref, ref) => {
|
|
|
3071
534
|
'is-popup': isPopup
|
|
3072
535
|
}),
|
|
3073
536
|
placeholder: searchPlaceholder,
|
|
3074
|
-
value: searchText,
|
|
537
|
+
value: searchProps.searchText,
|
|
3075
538
|
onSearch: value => {
|
|
3076
|
-
|
|
539
|
+
setSearchProps(searchProps => Object.assign({}, searchProps, {
|
|
540
|
+
searchText: value
|
|
541
|
+
}));
|
|
3077
542
|
},
|
|
3078
543
|
simple: isPopup,
|
|
3079
544
|
showSearchButton: !isPopup
|
|
@@ -3087,24 +552,22 @@ const SelectList = forwardRef((_ref, ref) => {
|
|
|
3087
552
|
className: classnames(style$1['list'], 'select-list-scroll-list', {
|
|
3088
553
|
'is-popup': isPopup
|
|
3089
554
|
}),
|
|
3090
|
-
searchProps:
|
|
3091
|
-
searchText
|
|
3092
|
-
},
|
|
555
|
+
searchProps: searchProps,
|
|
3093
556
|
getSearchProps: getSearchProps,
|
|
3094
557
|
api: Object.assign({}, options ? {
|
|
3095
558
|
data: {
|
|
3096
559
|
options,
|
|
3097
|
-
|
|
560
|
+
searchProps
|
|
3098
561
|
},
|
|
3099
562
|
loader: ({
|
|
3100
563
|
data
|
|
3101
564
|
}) => {
|
|
3102
565
|
const {
|
|
3103
566
|
options,
|
|
3104
|
-
|
|
567
|
+
searchProps
|
|
3105
568
|
} = data;
|
|
3106
569
|
if (typeof getSearchCallback === 'function') {
|
|
3107
|
-
const newOptions = options.filter(item => getSearchCallback(
|
|
570
|
+
const newOptions = options.filter(item => getSearchCallback(searchProps, item));
|
|
3108
571
|
return {
|
|
3109
572
|
pageData: newOptions
|
|
3110
573
|
};
|
|
@@ -3140,15 +603,14 @@ const SelectList = forwardRef((_ref, ref) => {
|
|
|
3140
603
|
var style = {"list":"_DrEYJ","is-popup":"_KgWTX","header":"_Vmbrg","col":"_dJmfs","body":"_704J1","is-selected-all":"_qU5zU","is-selected":"_MzyWg","is-disabled":"_5luTv","right-options":"_UXi-g","no-padding-btn":"_iaCir","tag":"_JkYqS","tag-inner":"_VZlBL","single-checked":"_Eiz-u","select-search":"_temy6","tags-search":"_7phL2","descriptions":"_ttNK9","descriptions-col-label":"_xU-i7","descriptions-col-content":"_SvfzQ"};
|
|
3141
604
|
|
|
3142
605
|
const SelectTableList = forwardRef((p, ref) => {
|
|
3143
|
-
const [filter, setFilter] = useState({});
|
|
3144
606
|
const [tagSearchText, setTagSearchText] = useState('');
|
|
3145
607
|
const props = Object.assign({}, {
|
|
3146
608
|
overlayWidth: '600px',
|
|
3147
609
|
filterRender: contextProps => {
|
|
3148
610
|
const {
|
|
3149
611
|
props,
|
|
3150
|
-
|
|
3151
|
-
|
|
612
|
+
searchProps,
|
|
613
|
+
setSearchProps
|
|
3152
614
|
} = contextProps;
|
|
3153
615
|
const {
|
|
3154
616
|
isPopup,
|
|
@@ -3167,9 +629,9 @@ const SelectTableList = forwardRef((p, ref) => {
|
|
|
3167
629
|
'is-popup': isPopup
|
|
3168
630
|
}),
|
|
3169
631
|
placeholder: searchPlaceholder,
|
|
3170
|
-
value:
|
|
632
|
+
value: searchProps.searchText || '',
|
|
3171
633
|
onSearch: value => {
|
|
3172
|
-
|
|
634
|
+
setSearchProps(searchProps => Object.assign({}, searchProps, {
|
|
3173
635
|
searchText: value
|
|
3174
636
|
}));
|
|
3175
637
|
},
|
|
@@ -3218,7 +680,8 @@ const SelectTableList = forwardRef((p, ref) => {
|
|
|
3218
680
|
searchPlaceholder,
|
|
3219
681
|
allowSelectedAll,
|
|
3220
682
|
labelKey,
|
|
3221
|
-
valueKey
|
|
683
|
+
valueKey,
|
|
684
|
+
searchProps
|
|
3222
685
|
} = props;
|
|
3223
686
|
const isSelectedAll = computedIsSelectAll(value, selectedAllValue, valueKey);
|
|
3224
687
|
return /*#__PURE__*/React.createElement(Row, {
|
|
@@ -3226,10 +689,7 @@ const SelectTableList = forwardRef((p, ref) => {
|
|
|
3226
689
|
ref: bodyRef
|
|
3227
690
|
}, /*#__PURE__*/React.createElement(Col, {
|
|
3228
691
|
span: single ? 24 : 16
|
|
3229
|
-
}, /*#__PURE__*/React.createElement("div", null, filterRender(Object.assign({}, targetProps, {
|
|
3230
|
-
filter,
|
|
3231
|
-
setFilter
|
|
3232
|
-
}))), /*#__PURE__*/React.createElement(Row, {
|
|
692
|
+
}, /*#__PURE__*/React.createElement("div", null, filterRender(Object.assign({}, targetProps))), /*#__PURE__*/React.createElement(Row, {
|
|
3233
693
|
wrap: false,
|
|
3234
694
|
className: classnames(style['header'], 'select-table-list-header')
|
|
3235
695
|
}, !single && /*#__PURE__*/React.createElement(Col, {
|
|
@@ -3267,22 +727,22 @@ const SelectTableList = forwardRef((p, ref) => {
|
|
|
3267
727
|
className: classnames(style['list'], 'select-table-list-scroll-list', {
|
|
3268
728
|
'is-popup': isPopup
|
|
3269
729
|
}),
|
|
3270
|
-
searchProps:
|
|
730
|
+
searchProps: searchProps,
|
|
3271
731
|
getSearchProps: getSearchProps,
|
|
3272
732
|
api: Object.assign({}, options ? {
|
|
3273
733
|
data: {
|
|
3274
734
|
options,
|
|
3275
|
-
|
|
735
|
+
searchProps
|
|
3276
736
|
},
|
|
3277
737
|
loader: ({
|
|
3278
738
|
data
|
|
3279
739
|
}) => {
|
|
3280
740
|
const {
|
|
3281
741
|
options,
|
|
3282
|
-
|
|
742
|
+
searchProps
|
|
3283
743
|
} = data;
|
|
3284
744
|
if (typeof getSearchCallback === 'function') {
|
|
3285
|
-
const newOptions = options.filter(item => getSearchCallback(
|
|
745
|
+
const newOptions = options.filter(item => getSearchCallback(searchProps, item, targetProps));
|
|
3286
746
|
return {
|
|
3287
747
|
pageData: newOptions
|
|
3288
748
|
};
|
|
@@ -3344,7 +804,7 @@ const SelectTableList = forwardRef((p, ref) => {
|
|
|
3344
804
|
key: name,
|
|
3345
805
|
span: span,
|
|
3346
806
|
className: classnames(style['col'], 'select-table-list-col')
|
|
3347
|
-
}, typeof getValueOf === 'function' ? getValueOf(item, contextProps) :
|
|
807
|
+
}, typeof getValueOf === 'function' ? getValueOf(item, contextProps) : get(item, name));
|
|
3348
808
|
}))), single && /*#__PURE__*/React.createElement(Col, {
|
|
3349
809
|
className: classnames(style['col'], style['single-checked'], 'select-table-list-col')
|
|
3350
810
|
}, isChecked && /*#__PURE__*/React.createElement(CheckOutlined, null)));
|
|
@@ -3400,7 +860,7 @@ const SelectTableList = forwardRef((p, ref) => {
|
|
|
3400
860
|
}, title), /*#__PURE__*/React.createElement(Col, {
|
|
3401
861
|
className: style['descriptions-col-content'],
|
|
3402
862
|
span: 16
|
|
3403
|
-
}, typeof getValueOf === 'function' ? getValueOf(item, targetProps) :
|
|
863
|
+
}, typeof getValueOf === 'function' ? getValueOf(item, targetProps) : get(item, name)));
|
|
3404
864
|
}))
|
|
3405
865
|
}, /*#__PURE__*/React.createElement("span", {
|
|
3406
866
|
className: style['tag-inner']
|