@kne/super-select 0.1.8 → 0.1.10
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 +39 -2
- package/dist/index.css +117 -1
- package/dist/index.css.map +1 -1
- package/dist/index.js +539 -1157
- package/dist/index.js.map +1 -1
- package/dist/index.modern.js +535 -1159
- package/dist/index.modern.js.map +1 -1
- package/package.json +2 -2
package/dist/index.modern.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import React, { useState, useEffect } from 'react';
|
|
1
|
+
import React, { useState, useEffect, useRef, Fragment } from 'react';
|
|
2
2
|
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 { Modal, App, Dropdown, Flex, Tag, Checkbox, List } from 'antd';
|
|
6
|
+
import { Modal, App, Dropdown, Flex, Tag, Checkbox, List, Row, Col, Button, Popover } from 'antd';
|
|
7
7
|
import { CloseCircleFilled, DownOutlined, CheckOutlined } from '@ant-design/icons';
|
|
8
8
|
import SimpleBar from 'simplebar-react';
|
|
9
9
|
import 'simplebar-react/dist/simplebar.min.css';
|
|
@@ -316,17 +316,17 @@ var Symbol = _root.Symbol;
|
|
|
316
316
|
var _Symbol = Symbol;
|
|
317
317
|
|
|
318
318
|
/** Used for built-in method references. */
|
|
319
|
-
var objectProto$
|
|
319
|
+
var objectProto$b = Object.prototype;
|
|
320
320
|
|
|
321
321
|
/** Used to check objects for own properties. */
|
|
322
|
-
var hasOwnProperty$
|
|
322
|
+
var hasOwnProperty$8 = objectProto$b.hasOwnProperty;
|
|
323
323
|
|
|
324
324
|
/**
|
|
325
325
|
* Used to resolve the
|
|
326
326
|
* [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
|
|
327
327
|
* of values.
|
|
328
328
|
*/
|
|
329
|
-
var nativeObjectToString$1 = objectProto$
|
|
329
|
+
var nativeObjectToString$1 = objectProto$b.toString;
|
|
330
330
|
|
|
331
331
|
/** Built-in value references. */
|
|
332
332
|
var symToStringTag$1 = _Symbol ? _Symbol.toStringTag : undefined;
|
|
@@ -339,7 +339,7 @@ var symToStringTag$1 = _Symbol ? _Symbol.toStringTag : undefined;
|
|
|
339
339
|
* @returns {string} Returns the raw `toStringTag`.
|
|
340
340
|
*/
|
|
341
341
|
function getRawTag(value) {
|
|
342
|
-
var isOwn = hasOwnProperty$
|
|
342
|
+
var isOwn = hasOwnProperty$8.call(value, symToStringTag$1),
|
|
343
343
|
tag = value[symToStringTag$1];
|
|
344
344
|
|
|
345
345
|
try {
|
|
@@ -361,14 +361,14 @@ function getRawTag(value) {
|
|
|
361
361
|
var _getRawTag = getRawTag;
|
|
362
362
|
|
|
363
363
|
/** Used for built-in method references. */
|
|
364
|
-
var objectProto$
|
|
364
|
+
var objectProto$a = Object.prototype;
|
|
365
365
|
|
|
366
366
|
/**
|
|
367
367
|
* Used to resolve the
|
|
368
368
|
* [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
|
|
369
369
|
* of values.
|
|
370
370
|
*/
|
|
371
|
-
var nativeObjectToString = objectProto$
|
|
371
|
+
var nativeObjectToString = objectProto$a.toString;
|
|
372
372
|
|
|
373
373
|
/**
|
|
374
374
|
* Converts `value` to a string using `Object.prototype.toString`.
|
|
@@ -500,10 +500,10 @@ function isMasked(func) {
|
|
|
500
500
|
var _isMasked = isMasked;
|
|
501
501
|
|
|
502
502
|
/** Used for built-in method references. */
|
|
503
|
-
var funcProto$
|
|
503
|
+
var funcProto$1 = Function.prototype;
|
|
504
504
|
|
|
505
505
|
/** Used to resolve the decompiled source of functions. */
|
|
506
|
-
var funcToString$
|
|
506
|
+
var funcToString$1 = funcProto$1.toString;
|
|
507
507
|
|
|
508
508
|
/**
|
|
509
509
|
* Converts `func` to its source code.
|
|
@@ -515,7 +515,7 @@ var funcToString$2 = funcProto$2.toString;
|
|
|
515
515
|
function toSource(func) {
|
|
516
516
|
if (func != null) {
|
|
517
517
|
try {
|
|
518
|
-
return funcToString$
|
|
518
|
+
return funcToString$1.call(func);
|
|
519
519
|
} catch (e) {}
|
|
520
520
|
try {
|
|
521
521
|
return (func + '');
|
|
@@ -536,18 +536,18 @@ var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
|
|
|
536
536
|
var reIsHostCtor = /^\[object .+?Constructor\]$/;
|
|
537
537
|
|
|
538
538
|
/** Used for built-in method references. */
|
|
539
|
-
var funcProto
|
|
540
|
-
objectProto$
|
|
539
|
+
var funcProto = Function.prototype,
|
|
540
|
+
objectProto$9 = Object.prototype;
|
|
541
541
|
|
|
542
542
|
/** Used to resolve the decompiled source of functions. */
|
|
543
|
-
var funcToString
|
|
543
|
+
var funcToString = funcProto.toString;
|
|
544
544
|
|
|
545
545
|
/** Used to check objects for own properties. */
|
|
546
|
-
var hasOwnProperty$
|
|
546
|
+
var hasOwnProperty$7 = objectProto$9.hasOwnProperty;
|
|
547
547
|
|
|
548
548
|
/** Used to detect if a method is native. */
|
|
549
549
|
var reIsNative = RegExp('^' +
|
|
550
|
-
funcToString
|
|
550
|
+
funcToString.call(hasOwnProperty$7).replace(reRegExpChar, '\\$&')
|
|
551
551
|
.replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$'
|
|
552
552
|
);
|
|
553
553
|
|
|
@@ -644,10 +644,10 @@ var _hashDelete = hashDelete;
|
|
|
644
644
|
var HASH_UNDEFINED$2 = '__lodash_hash_undefined__';
|
|
645
645
|
|
|
646
646
|
/** Used for built-in method references. */
|
|
647
|
-
var objectProto$
|
|
647
|
+
var objectProto$8 = Object.prototype;
|
|
648
648
|
|
|
649
649
|
/** Used to check objects for own properties. */
|
|
650
|
-
var hasOwnProperty$
|
|
650
|
+
var hasOwnProperty$6 = objectProto$8.hasOwnProperty;
|
|
651
651
|
|
|
652
652
|
/**
|
|
653
653
|
* Gets the hash value for `key`.
|
|
@@ -664,16 +664,16 @@ function hashGet(key) {
|
|
|
664
664
|
var result = data[key];
|
|
665
665
|
return result === HASH_UNDEFINED$2 ? undefined : result;
|
|
666
666
|
}
|
|
667
|
-
return hasOwnProperty$
|
|
667
|
+
return hasOwnProperty$6.call(data, key) ? data[key] : undefined;
|
|
668
668
|
}
|
|
669
669
|
|
|
670
670
|
var _hashGet = hashGet;
|
|
671
671
|
|
|
672
672
|
/** Used for built-in method references. */
|
|
673
|
-
var objectProto$
|
|
673
|
+
var objectProto$7 = Object.prototype;
|
|
674
674
|
|
|
675
675
|
/** Used to check objects for own properties. */
|
|
676
|
-
var hasOwnProperty$
|
|
676
|
+
var hasOwnProperty$5 = objectProto$7.hasOwnProperty;
|
|
677
677
|
|
|
678
678
|
/**
|
|
679
679
|
* Checks if a hash value for `key` exists.
|
|
@@ -686,7 +686,7 @@ var hasOwnProperty$8 = objectProto$a.hasOwnProperty;
|
|
|
686
686
|
*/
|
|
687
687
|
function hashHas(key) {
|
|
688
688
|
var data = this.__data__;
|
|
689
|
-
return _nativeCreate ? (data[key] !== undefined) : hasOwnProperty$
|
|
689
|
+
return _nativeCreate ? (data[key] !== undefined) : hasOwnProperty$5.call(data, key);
|
|
690
690
|
}
|
|
691
691
|
|
|
692
692
|
var _hashHas = hashHas;
|
|
@@ -1382,10 +1382,10 @@ function stubArray() {
|
|
|
1382
1382
|
var stubArray_1 = stubArray;
|
|
1383
1383
|
|
|
1384
1384
|
/** Used for built-in method references. */
|
|
1385
|
-
var objectProto$
|
|
1385
|
+
var objectProto$6 = Object.prototype;
|
|
1386
1386
|
|
|
1387
1387
|
/** Built-in value references. */
|
|
1388
|
-
var propertyIsEnumerable$1 = objectProto$
|
|
1388
|
+
var propertyIsEnumerable$1 = objectProto$6.propertyIsEnumerable;
|
|
1389
1389
|
|
|
1390
1390
|
/* Built-in method references for those with the same name as other `lodash` methods. */
|
|
1391
1391
|
var nativeGetSymbols = Object.getOwnPropertySymbols;
|
|
@@ -1477,13 +1477,13 @@ function baseIsArguments(value) {
|
|
|
1477
1477
|
var _baseIsArguments = baseIsArguments;
|
|
1478
1478
|
|
|
1479
1479
|
/** Used for built-in method references. */
|
|
1480
|
-
var objectProto$
|
|
1480
|
+
var objectProto$5 = Object.prototype;
|
|
1481
1481
|
|
|
1482
1482
|
/** Used to check objects for own properties. */
|
|
1483
|
-
var hasOwnProperty$
|
|
1483
|
+
var hasOwnProperty$4 = objectProto$5.hasOwnProperty;
|
|
1484
1484
|
|
|
1485
1485
|
/** Built-in value references. */
|
|
1486
|
-
var propertyIsEnumerable = objectProto$
|
|
1486
|
+
var propertyIsEnumerable = objectProto$5.propertyIsEnumerable;
|
|
1487
1487
|
|
|
1488
1488
|
/**
|
|
1489
1489
|
* Checks if `value` is likely an `arguments` object.
|
|
@@ -1504,7 +1504,7 @@ var propertyIsEnumerable = objectProto$8.propertyIsEnumerable;
|
|
|
1504
1504
|
* // => false
|
|
1505
1505
|
*/
|
|
1506
1506
|
var isArguments = _baseIsArguments(function() { return arguments; }()) ? _baseIsArguments : function(value) {
|
|
1507
|
-
return isObjectLike_1(value) && hasOwnProperty$
|
|
1507
|
+
return isObjectLike_1(value) && hasOwnProperty$4.call(value, 'callee') &&
|
|
1508
1508
|
!propertyIsEnumerable.call(value, 'callee');
|
|
1509
1509
|
};
|
|
1510
1510
|
|
|
@@ -1638,7 +1638,7 @@ var argsTag$1 = '[object Arguments]',
|
|
|
1638
1638
|
funcTag = '[object Function]',
|
|
1639
1639
|
mapTag$1 = '[object Map]',
|
|
1640
1640
|
numberTag = '[object Number]',
|
|
1641
|
-
objectTag$
|
|
1641
|
+
objectTag$2 = '[object Object]',
|
|
1642
1642
|
regexpTag = '[object RegExp]',
|
|
1643
1643
|
setTag$1 = '[object Set]',
|
|
1644
1644
|
stringTag = '[object String]',
|
|
@@ -1668,7 +1668,7 @@ typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] =
|
|
|
1668
1668
|
typedArrayTags[dataViewTag$1] = typedArrayTags[dateTag] =
|
|
1669
1669
|
typedArrayTags[errorTag] = typedArrayTags[funcTag] =
|
|
1670
1670
|
typedArrayTags[mapTag$1] = typedArrayTags[numberTag] =
|
|
1671
|
-
typedArrayTags[objectTag$
|
|
1671
|
+
typedArrayTags[objectTag$2] = typedArrayTags[regexpTag] =
|
|
1672
1672
|
typedArrayTags[setTag$1] = typedArrayTags[stringTag] =
|
|
1673
1673
|
typedArrayTags[weakMapTag$1] = false;
|
|
1674
1674
|
|
|
@@ -1757,10 +1757,10 @@ var isTypedArray = nodeIsTypedArray ? _baseUnary(nodeIsTypedArray) : _baseIsType
|
|
|
1757
1757
|
var isTypedArray_1 = isTypedArray;
|
|
1758
1758
|
|
|
1759
1759
|
/** Used for built-in method references. */
|
|
1760
|
-
var objectProto$
|
|
1760
|
+
var objectProto$4 = Object.prototype;
|
|
1761
1761
|
|
|
1762
1762
|
/** Used to check objects for own properties. */
|
|
1763
|
-
var hasOwnProperty$
|
|
1763
|
+
var hasOwnProperty$3 = objectProto$4.hasOwnProperty;
|
|
1764
1764
|
|
|
1765
1765
|
/**
|
|
1766
1766
|
* Creates an array of the enumerable property names of the array-like `value`.
|
|
@@ -1780,7 +1780,7 @@ function arrayLikeKeys(value, inherited) {
|
|
|
1780
1780
|
length = result.length;
|
|
1781
1781
|
|
|
1782
1782
|
for (var key in value) {
|
|
1783
|
-
if ((inherited || hasOwnProperty$
|
|
1783
|
+
if ((inherited || hasOwnProperty$3.call(value, key)) &&
|
|
1784
1784
|
!(skipIndexes && (
|
|
1785
1785
|
// Safari 9 has enumerable `arguments.length` in strict mode.
|
|
1786
1786
|
key == 'length' ||
|
|
@@ -1800,7 +1800,7 @@ function arrayLikeKeys(value, inherited) {
|
|
|
1800
1800
|
var _arrayLikeKeys = arrayLikeKeys;
|
|
1801
1801
|
|
|
1802
1802
|
/** Used for built-in method references. */
|
|
1803
|
-
var objectProto$
|
|
1803
|
+
var objectProto$3 = Object.prototype;
|
|
1804
1804
|
|
|
1805
1805
|
/**
|
|
1806
1806
|
* Checks if `value` is likely a prototype object.
|
|
@@ -1811,7 +1811,7 @@ var objectProto$6 = Object.prototype;
|
|
|
1811
1811
|
*/
|
|
1812
1812
|
function isPrototype(value) {
|
|
1813
1813
|
var Ctor = value && value.constructor,
|
|
1814
|
-
proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto$
|
|
1814
|
+
proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto$3;
|
|
1815
1815
|
|
|
1816
1816
|
return value === proto;
|
|
1817
1817
|
}
|
|
@@ -1840,10 +1840,10 @@ var nativeKeys = _overArg(Object.keys, Object);
|
|
|
1840
1840
|
var _nativeKeys = nativeKeys;
|
|
1841
1841
|
|
|
1842
1842
|
/** Used for built-in method references. */
|
|
1843
|
-
var objectProto$
|
|
1843
|
+
var objectProto$2 = Object.prototype;
|
|
1844
1844
|
|
|
1845
1845
|
/** Used to check objects for own properties. */
|
|
1846
|
-
var hasOwnProperty$
|
|
1846
|
+
var hasOwnProperty$2 = objectProto$2.hasOwnProperty;
|
|
1847
1847
|
|
|
1848
1848
|
/**
|
|
1849
1849
|
* The base implementation of `_.keys` which doesn't treat sparse arrays as dense.
|
|
@@ -1858,7 +1858,7 @@ function baseKeys(object) {
|
|
|
1858
1858
|
}
|
|
1859
1859
|
var result = [];
|
|
1860
1860
|
for (var key in Object(object)) {
|
|
1861
|
-
if (hasOwnProperty$
|
|
1861
|
+
if (hasOwnProperty$2.call(object, key) && key != 'constructor') {
|
|
1862
1862
|
result.push(key);
|
|
1863
1863
|
}
|
|
1864
1864
|
}
|
|
@@ -1949,10 +1949,10 @@ var _getAllKeys = getAllKeys;
|
|
|
1949
1949
|
var COMPARE_PARTIAL_FLAG$1 = 1;
|
|
1950
1950
|
|
|
1951
1951
|
/** Used for built-in method references. */
|
|
1952
|
-
var objectProto$
|
|
1952
|
+
var objectProto$1 = Object.prototype;
|
|
1953
1953
|
|
|
1954
1954
|
/** Used to check objects for own properties. */
|
|
1955
|
-
var hasOwnProperty$
|
|
1955
|
+
var hasOwnProperty$1 = objectProto$1.hasOwnProperty;
|
|
1956
1956
|
|
|
1957
1957
|
/**
|
|
1958
1958
|
* A specialized version of `baseIsEqualDeep` for objects with support for
|
|
@@ -1980,7 +1980,7 @@ function equalObjects(object, other, bitmask, customizer, equalFunc, stack) {
|
|
|
1980
1980
|
var index = objLength;
|
|
1981
1981
|
while (index--) {
|
|
1982
1982
|
var key = objProps[index];
|
|
1983
|
-
if (!(isPartial ? key in other : hasOwnProperty$
|
|
1983
|
+
if (!(isPartial ? key in other : hasOwnProperty$1.call(other, key))) {
|
|
1984
1984
|
return false;
|
|
1985
1985
|
}
|
|
1986
1986
|
}
|
|
@@ -2056,7 +2056,7 @@ var _WeakMap = WeakMap;
|
|
|
2056
2056
|
|
|
2057
2057
|
/** `Object#toString` result references. */
|
|
2058
2058
|
var mapTag = '[object Map]',
|
|
2059
|
-
objectTag$
|
|
2059
|
+
objectTag$1 = '[object Object]',
|
|
2060
2060
|
promiseTag = '[object Promise]',
|
|
2061
2061
|
setTag = '[object Set]',
|
|
2062
2062
|
weakMapTag = '[object WeakMap]';
|
|
@@ -2087,7 +2087,7 @@ if ((_DataView && getTag(new _DataView(new ArrayBuffer(1))) != dataViewTag) ||
|
|
|
2087
2087
|
(_WeakMap && getTag(new _WeakMap) != weakMapTag)) {
|
|
2088
2088
|
getTag = function(value) {
|
|
2089
2089
|
var result = _baseGetTag(value),
|
|
2090
|
-
Ctor = result == objectTag$
|
|
2090
|
+
Ctor = result == objectTag$1 ? value.constructor : undefined,
|
|
2091
2091
|
ctorString = Ctor ? _toSource(Ctor) : '';
|
|
2092
2092
|
|
|
2093
2093
|
if (ctorString) {
|
|
@@ -2111,13 +2111,13 @@ var COMPARE_PARTIAL_FLAG = 1;
|
|
|
2111
2111
|
/** `Object#toString` result references. */
|
|
2112
2112
|
var argsTag = '[object Arguments]',
|
|
2113
2113
|
arrayTag = '[object Array]',
|
|
2114
|
-
objectTag
|
|
2114
|
+
objectTag = '[object Object]';
|
|
2115
2115
|
|
|
2116
2116
|
/** Used for built-in method references. */
|
|
2117
|
-
var objectProto
|
|
2117
|
+
var objectProto = Object.prototype;
|
|
2118
2118
|
|
|
2119
2119
|
/** Used to check objects for own properties. */
|
|
2120
|
-
var hasOwnProperty
|
|
2120
|
+
var hasOwnProperty = objectProto.hasOwnProperty;
|
|
2121
2121
|
|
|
2122
2122
|
/**
|
|
2123
2123
|
* A specialized version of `baseIsEqual` for arrays and objects which performs
|
|
@@ -2139,11 +2139,11 @@ function baseIsEqualDeep(object, other, bitmask, customizer, equalFunc, stack) {
|
|
|
2139
2139
|
objTag = objIsArr ? arrayTag : _getTag(object),
|
|
2140
2140
|
othTag = othIsArr ? arrayTag : _getTag(other);
|
|
2141
2141
|
|
|
2142
|
-
objTag = objTag == argsTag ? objectTag
|
|
2143
|
-
othTag = othTag == argsTag ? objectTag
|
|
2142
|
+
objTag = objTag == argsTag ? objectTag : objTag;
|
|
2143
|
+
othTag = othTag == argsTag ? objectTag : othTag;
|
|
2144
2144
|
|
|
2145
|
-
var objIsObj = objTag == objectTag
|
|
2146
|
-
othIsObj = othTag == objectTag
|
|
2145
|
+
var objIsObj = objTag == objectTag,
|
|
2146
|
+
othIsObj = othTag == objectTag,
|
|
2147
2147
|
isSameTag = objTag == othTag;
|
|
2148
2148
|
|
|
2149
2149
|
if (isSameTag && isBuffer_1(object)) {
|
|
@@ -2160,8 +2160,8 @@ function baseIsEqualDeep(object, other, bitmask, customizer, equalFunc, stack) {
|
|
|
2160
2160
|
: _equalByTag(object, other, objTag, bitmask, customizer, equalFunc, stack);
|
|
2161
2161
|
}
|
|
2162
2162
|
if (!(bitmask & COMPARE_PARTIAL_FLAG)) {
|
|
2163
|
-
var objIsWrapped = objIsObj && hasOwnProperty
|
|
2164
|
-
othIsWrapped = othIsObj && hasOwnProperty
|
|
2163
|
+
var objIsWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'),
|
|
2164
|
+
othIsWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__');
|
|
2165
2165
|
|
|
2166
2166
|
if (objIsWrapped || othIsWrapped) {
|
|
2167
2167
|
var objUnwrapped = objIsWrapped ? object.value() : object,
|
|
@@ -2240,7 +2240,7 @@ function isEqual(value, other) {
|
|
|
2240
2240
|
|
|
2241
2241
|
var isEqual_1 = isEqual;
|
|
2242
2242
|
|
|
2243
|
-
var style$
|
|
2243
|
+
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
2244
|
|
|
2245
2245
|
const _excluded$1 = ["children"];
|
|
2246
2246
|
const numberToPx = val => {
|
|
@@ -2248,7 +2248,10 @@ const numberToPx = val => {
|
|
|
2248
2248
|
};
|
|
2249
2249
|
const pxToNumber = value => {
|
|
2250
2250
|
if (!value) return 0;
|
|
2251
|
-
|
|
2251
|
+
if (Number.isInteger(value)) {
|
|
2252
|
+
return value;
|
|
2253
|
+
}
|
|
2254
|
+
const match = value.toString().match(/^\d*(\.\d*)?/);
|
|
2252
2255
|
return match ? Number(match[0]) : 0;
|
|
2253
2256
|
};
|
|
2254
2257
|
const ModalContent = _ref => {
|
|
@@ -2299,6 +2302,8 @@ const SelectInput = p => {
|
|
|
2299
2302
|
placeholder: locale.placeholder,
|
|
2300
2303
|
searchPlaceholder: locale.search,
|
|
2301
2304
|
allowSelectedAll: false,
|
|
2305
|
+
labelKey: 'label',
|
|
2306
|
+
valueKey: 'value',
|
|
2302
2307
|
selectedAllValue: {
|
|
2303
2308
|
value: 'all',
|
|
2304
2309
|
label: locale.selectAll
|
|
@@ -2337,6 +2342,10 @@ const SelectInput = p => {
|
|
|
2337
2342
|
}, p, {
|
|
2338
2343
|
locale
|
|
2339
2344
|
});
|
|
2345
|
+
props.selectedAllValue = {
|
|
2346
|
+
[props.valueKey]: props.selectedAllValue.value,
|
|
2347
|
+
[props.labelKey]: props.selectedAllValue.label
|
|
2348
|
+
};
|
|
2340
2349
|
const [stateValue, setValue] = useControlValue(props);
|
|
2341
2350
|
const value = stateValue || [];
|
|
2342
2351
|
const [searchText, setSearchText] = useState('');
|
|
@@ -2362,7 +2371,9 @@ const SelectInput = p => {
|
|
|
2362
2371
|
selectedAllValue,
|
|
2363
2372
|
overlayWidth,
|
|
2364
2373
|
placement,
|
|
2365
|
-
renderModal
|
|
2374
|
+
renderModal,
|
|
2375
|
+
labelKey,
|
|
2376
|
+
valueKey
|
|
2366
2377
|
} = props;
|
|
2367
2378
|
const popupOverlayWidth = numberToPx(Math.max(inputWidth, pxToNumber(overlayWidth)));
|
|
2368
2379
|
const {
|
|
@@ -2378,7 +2389,7 @@ const SelectInput = p => {
|
|
|
2378
2389
|
const onRemove = (item, currentSetValue) => {
|
|
2379
2390
|
(currentSetValue || setValue)(value => {
|
|
2380
2391
|
const newValue = value.slice(0);
|
|
2381
|
-
const index = value.findIndex(currentItem => currentItem
|
|
2392
|
+
const index = value.findIndex(currentItem => currentItem[valueKey] === item[valueKey]);
|
|
2382
2393
|
if (index > -1) {
|
|
2383
2394
|
newValue.splice(index, 1);
|
|
2384
2395
|
}
|
|
@@ -2391,7 +2402,7 @@ const SelectInput = p => {
|
|
|
2391
2402
|
return value;
|
|
2392
2403
|
}
|
|
2393
2404
|
const newValue = value.slice(0);
|
|
2394
|
-
const index = value.findIndex(currentItem => currentItem
|
|
2405
|
+
const index = value.findIndex(currentItem => currentItem[valueKey] === item[valueKey]);
|
|
2395
2406
|
if (index === -1) {
|
|
2396
2407
|
newValue.push(item);
|
|
2397
2408
|
}
|
|
@@ -2401,7 +2412,7 @@ const SelectInput = p => {
|
|
|
2401
2412
|
const onSelect = (item, currentSetValue) => {
|
|
2402
2413
|
(currentSetValue || setValue)(value => {
|
|
2403
2414
|
const newValue = (value || []).slice(0);
|
|
2404
|
-
const index = newValue.findIndex(currentItem => currentItem
|
|
2415
|
+
const index = newValue.findIndex(currentItem => currentItem[valueKey] === item[valueKey]);
|
|
2405
2416
|
if (index === -1 && !checkMaxLength(newValue, maxLength)) {
|
|
2406
2417
|
return value;
|
|
2407
2418
|
}
|
|
@@ -2415,9 +2426,9 @@ const SelectInput = p => {
|
|
|
2415
2426
|
};
|
|
2416
2427
|
const inputInnerRender = (props = {}) => /*#__PURE__*/React.createElement(Flex, _extends({}, props, {
|
|
2417
2428
|
ref: inputRef,
|
|
2418
|
-
className: classnames(className, style$
|
|
2419
|
-
[style$
|
|
2420
|
-
[style$
|
|
2429
|
+
className: classnames(className, style$4['select-input'], 'select-input', {
|
|
2430
|
+
[style$4['wrap']]: labelWrap,
|
|
2431
|
+
[style$4['disabled']]: disabled
|
|
2421
2432
|
}),
|
|
2422
2433
|
justify: "space-between",
|
|
2423
2434
|
onMouseOver: () => {
|
|
@@ -2429,27 +2440,27 @@ const SelectInput = p => {
|
|
|
2429
2440
|
}), (() => {
|
|
2430
2441
|
const current = typeof prefix === 'function' ? prefix(contextProps) : prefix;
|
|
2431
2442
|
return current && /*#__PURE__*/React.createElement("span", {
|
|
2432
|
-
className: classnames(style$
|
|
2443
|
+
className: classnames(style$4['select-input-prefix'], 'select-input-prefix'),
|
|
2433
2444
|
onClick: e => {
|
|
2434
2445
|
e.stopPropagation();
|
|
2435
2446
|
}
|
|
2436
2447
|
}, current);
|
|
2437
2448
|
})(), /*#__PURE__*/React.createElement("div", {
|
|
2438
|
-
className: classnames(style$
|
|
2439
|
-
}, value.length > 0 ? single || value[0]
|
|
2449
|
+
className: classnames(style$4['select-input-inner'], 'select-input-inner')
|
|
2450
|
+
}, value.length > 0 ? single || value[0][valueKey] === selectedAllValue[valueKey] ? value[0][labelKey] : value.map(item => {
|
|
2440
2451
|
return /*#__PURE__*/React.createElement(Tag, {
|
|
2441
|
-
key: item
|
|
2452
|
+
key: item[valueKey],
|
|
2442
2453
|
closable: true,
|
|
2443
2454
|
bordered: false,
|
|
2444
2455
|
onClose: e => {
|
|
2445
2456
|
e.preventDefault();
|
|
2446
2457
|
onRemove(item);
|
|
2447
2458
|
}
|
|
2448
|
-
}, item
|
|
2459
|
+
}, item[labelKey]);
|
|
2449
2460
|
}) : /*#__PURE__*/React.createElement("span", {
|
|
2450
|
-
className: classnames(style$
|
|
2461
|
+
className: classnames(style$4['placeholder'], 'select-input-placeholder')
|
|
2451
2462
|
}, placeholder)), /*#__PURE__*/React.createElement("div", {
|
|
2452
|
-
className: classnames(style$
|
|
2463
|
+
className: classnames(style$4['select-input-icon'], 'select-input-icon')
|
|
2453
2464
|
}, !disabled && allowClear && hover && value.length > 0 ? /*#__PURE__*/React.createElement(CloseCircleFilled, {
|
|
2454
2465
|
onClick: e => {
|
|
2455
2466
|
e.stopPropagation();
|
|
@@ -2458,7 +2469,7 @@ const SelectInput = p => {
|
|
|
2458
2469
|
}) : /*#__PURE__*/React.createElement(DownOutlined, null)), (() => {
|
|
2459
2470
|
const current = typeof suffix === 'function' ? suffix(contextProps) : suffix;
|
|
2460
2471
|
return current && /*#__PURE__*/React.createElement("span", {
|
|
2461
|
-
className: classnames(style$
|
|
2472
|
+
className: classnames(style$4['select-input-suffix'], 'select-input-suffix'),
|
|
2462
2473
|
onClick: e => {
|
|
2463
2474
|
e.stopPropagation();
|
|
2464
2475
|
}
|
|
@@ -2486,13 +2497,13 @@ const SelectInput = p => {
|
|
|
2486
2497
|
onOpenChange: setOpen,
|
|
2487
2498
|
placement: placement,
|
|
2488
2499
|
arrow: false,
|
|
2489
|
-
overlayClassName: classnames(style$
|
|
2500
|
+
overlayClassName: classnames(style$4['overlay'], overlayClassName),
|
|
2490
2501
|
trigger: "click",
|
|
2491
2502
|
dropdownRender: () => /*#__PURE__*/React.createElement("div", {
|
|
2492
2503
|
style: {
|
|
2493
2504
|
'--overlay-width': popupOverlayWidth
|
|
2494
2505
|
},
|
|
2495
|
-
className: classnames(style$
|
|
2506
|
+
className: classnames(style$4['overlay-content'], 'over-content'),
|
|
2496
2507
|
onClick: e => {
|
|
2497
2508
|
e.stopPropagation();
|
|
2498
2509
|
}
|
|
@@ -2854,7 +2865,7 @@ function get(object, path, defaultValue) {
|
|
|
2854
2865
|
|
|
2855
2866
|
var get_1 = get;
|
|
2856
2867
|
|
|
2857
|
-
var style$
|
|
2868
|
+
var style$3 = {"selected-all":"_prlgN"};
|
|
2858
2869
|
|
|
2859
2870
|
const SelectedAll = () => {
|
|
2860
2871
|
const {
|
|
@@ -2865,14 +2876,15 @@ const SelectedAll = () => {
|
|
|
2865
2876
|
const {
|
|
2866
2877
|
unit,
|
|
2867
2878
|
selectedAllValue,
|
|
2868
|
-
locale
|
|
2879
|
+
locale,
|
|
2880
|
+
valueKey
|
|
2869
2881
|
} = Object.assign({}, {
|
|
2870
2882
|
unit: number => locale.numberOf.replace('%s', number)
|
|
2871
2883
|
}, props);
|
|
2872
|
-
const isSelectedAll = computedIsSelectAll(value, selectedAllValue);
|
|
2884
|
+
const isSelectedAll = computedIsSelectAll(value, selectedAllValue, valueKey);
|
|
2873
2885
|
return /*#__PURE__*/React.createElement(Flex, {
|
|
2874
2886
|
justify: "space-between",
|
|
2875
|
-
className: classnames(style$
|
|
2887
|
+
className: classnames(style$3['selected-all'], 'selected-all')
|
|
2876
2888
|
}, /*#__PURE__*/React.createElement(Flex, {
|
|
2877
2889
|
gap: 8
|
|
2878
2890
|
}, /*#__PURE__*/React.createElement("span", null, locale.selected, ":"), /*#__PURE__*/React.createElement("span", null, isSelectedAll ? selectedAllValue.label : typeof unit === 'function' ? unit(value.length) : value.length)), /*#__PURE__*/React.createElement("span", null, /*#__PURE__*/React.createElement(Checkbox, {
|
|
@@ -2887,11 +2899,11 @@ const SelectedAll = () => {
|
|
|
2887
2899
|
}
|
|
2888
2900
|
}, locale.selectAll)));
|
|
2889
2901
|
};
|
|
2890
|
-
const computedIsSelectAll = (value, selectedAllValue) => {
|
|
2891
|
-
return (value == null ? void 0 : value.length) === 1 && get_1(value,
|
|
2902
|
+
const computedIsSelectAll = (value, selectedAllValue, valueKey = 'value') => {
|
|
2903
|
+
return (value == null ? void 0 : value.length) === 1 && get_1(value, `[0][${valueKey}]`) === selectedAllValue[valueKey];
|
|
2892
2904
|
};
|
|
2893
2905
|
|
|
2894
|
-
var style$
|
|
2906
|
+
var style$2 = {"label":"_l3KoW","tag-list":"_CCPzb","tag-container":"_dKZHi","tag-container-inner":"_oijCI","tag":"_WmnnS","tag-inner":"_TMcFl"};
|
|
2895
2907
|
|
|
2896
2908
|
const SelectedTagList = () => {
|
|
2897
2909
|
const {
|
|
@@ -2902,23 +2914,25 @@ const SelectedTagList = () => {
|
|
|
2902
2914
|
const {
|
|
2903
2915
|
locale,
|
|
2904
2916
|
single,
|
|
2905
|
-
maxLength
|
|
2917
|
+
maxLength,
|
|
2918
|
+
labelKey,
|
|
2919
|
+
valueKey
|
|
2906
2920
|
} = Object.assign({}, props);
|
|
2907
2921
|
return /*#__PURE__*/React.createElement(Flex, {
|
|
2908
|
-
className: classnames(style$
|
|
2922
|
+
className: classnames(style$2['tag-list'], 'selected-tag-list'),
|
|
2909
2923
|
gap: 8
|
|
2910
2924
|
}, /*#__PURE__*/React.createElement("div", {
|
|
2911
|
-
className: style$
|
|
2925
|
+
className: style$2['label']
|
|
2912
2926
|
}, locale.selected, !single && value.length > 0 && `(${value.length}${Number.isInteger(maxLength) ? `/${maxLength}` : ''})`, ":"), /*#__PURE__*/React.createElement(SimpleBar, {
|
|
2913
|
-
className: style$
|
|
2927
|
+
className: style$2['tag-container']
|
|
2914
2928
|
}, /*#__PURE__*/React.createElement(Flex, {
|
|
2915
2929
|
gap: 8,
|
|
2916
2930
|
wrap: true,
|
|
2917
|
-
className: style$
|
|
2931
|
+
className: style$2['tag-container-inner']
|
|
2918
2932
|
}, value.map(item => {
|
|
2919
2933
|
return /*#__PURE__*/React.createElement(Tag, {
|
|
2920
|
-
className: style$
|
|
2921
|
-
key: item
|
|
2934
|
+
className: style$2['tag'],
|
|
2935
|
+
key: item[valueKey],
|
|
2922
2936
|
closable: true,
|
|
2923
2937
|
bordered: false,
|
|
2924
2938
|
onClose: e => {
|
|
@@ -2926,1105 +2940,467 @@ const SelectedTagList = () => {
|
|
|
2926
2940
|
onRemove(item);
|
|
2927
2941
|
}
|
|
2928
2942
|
}, /*#__PURE__*/React.createElement("span", {
|
|
2929
|
-
className: style$
|
|
2930
|
-
}, item
|
|
2943
|
+
className: style$2['tag-inner']
|
|
2944
|
+
}, item[labelKey]));
|
|
2931
2945
|
}))));
|
|
2932
2946
|
};
|
|
2933
2947
|
|
|
2934
|
-
var
|
|
2935
|
-
try {
|
|
2936
|
-
var func = _getNative(Object, 'defineProperty');
|
|
2937
|
-
func({}, '', {});
|
|
2938
|
-
return func;
|
|
2939
|
-
} catch (e) {}
|
|
2940
|
-
}());
|
|
2941
|
-
|
|
2942
|
-
var _defineProperty = defineProperty;
|
|
2943
|
-
|
|
2944
|
-
/**
|
|
2945
|
-
* The base implementation of `assignValue` and `assignMergeValue` without
|
|
2946
|
-
* value checks.
|
|
2947
|
-
*
|
|
2948
|
-
* @private
|
|
2949
|
-
* @param {Object} object The object to modify.
|
|
2950
|
-
* @param {string} key The key of the property to assign.
|
|
2951
|
-
* @param {*} value The value to assign.
|
|
2952
|
-
*/
|
|
2953
|
-
function baseAssignValue(object, key, value) {
|
|
2954
|
-
if (key == '__proto__' && _defineProperty) {
|
|
2955
|
-
_defineProperty(object, key, {
|
|
2956
|
-
'configurable': true,
|
|
2957
|
-
'enumerable': true,
|
|
2958
|
-
'value': value,
|
|
2959
|
-
'writable': true
|
|
2960
|
-
});
|
|
2961
|
-
} else {
|
|
2962
|
-
object[key] = value;
|
|
2963
|
-
}
|
|
2964
|
-
}
|
|
2965
|
-
|
|
2966
|
-
var _baseAssignValue = baseAssignValue;
|
|
2967
|
-
|
|
2968
|
-
/**
|
|
2969
|
-
* This function is like `assignValue` except that it doesn't assign
|
|
2970
|
-
* `undefined` values.
|
|
2971
|
-
*
|
|
2972
|
-
* @private
|
|
2973
|
-
* @param {Object} object The object to modify.
|
|
2974
|
-
* @param {string} key The key of the property to assign.
|
|
2975
|
-
* @param {*} value The value to assign.
|
|
2976
|
-
*/
|
|
2977
|
-
function assignMergeValue(object, key, value) {
|
|
2978
|
-
if ((value !== undefined && !eq_1(object[key], value)) ||
|
|
2979
|
-
(value === undefined && !(key in object))) {
|
|
2980
|
-
_baseAssignValue(object, key, value);
|
|
2981
|
-
}
|
|
2982
|
-
}
|
|
2948
|
+
var style$1 = {"list":"_IsXdU","is-popup":"_-dvpa","default-list":"_QD1Mz","is-selected-all":"_M-mOy","default-list-item":"_KtOsz","is-selected":"_TQhBB","single-checked":"_2rUrh","is-disabled":"_NbwX5","selected-all":"_vN2Fx","selected-tag":"_6oITk","select-search":"_iAH9D"};
|
|
2983
2949
|
|
|
2984
|
-
|
|
2950
|
+
const _excluded = ["children"];
|
|
2951
|
+
const SelectList = _ref => {
|
|
2952
|
+
let {
|
|
2953
|
+
children
|
|
2954
|
+
} = _ref,
|
|
2955
|
+
p = _objectWithoutPropertiesLoose(_ref, _excluded);
|
|
2956
|
+
const props = Object.assign({}, {
|
|
2957
|
+
renderItemContent: ({
|
|
2958
|
+
item,
|
|
2959
|
+
props
|
|
2960
|
+
}) => {
|
|
2961
|
+
const {
|
|
2962
|
+
labelKey
|
|
2963
|
+
} = props;
|
|
2964
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
|
|
2965
|
+
className: 'select-list-item-label'
|
|
2966
|
+
}, item[labelKey]), item.description && /*#__PURE__*/React.createElement("div", {
|
|
2967
|
+
className: 'select-list-item-description'
|
|
2968
|
+
}, item.description));
|
|
2969
|
+
},
|
|
2970
|
+
renderItem: contextProps => {
|
|
2971
|
+
const {
|
|
2972
|
+
item,
|
|
2973
|
+
props,
|
|
2974
|
+
isSelectedAll,
|
|
2975
|
+
value,
|
|
2976
|
+
onSelect,
|
|
2977
|
+
setValue,
|
|
2978
|
+
onOpenChange
|
|
2979
|
+
} = contextProps;
|
|
2980
|
+
const {
|
|
2981
|
+
single,
|
|
2982
|
+
isPopup,
|
|
2983
|
+
renderItemContent,
|
|
2984
|
+
valueKey
|
|
2985
|
+
} = props;
|
|
2986
|
+
const isChecked = value.some(target => target[valueKey] === item[valueKey]);
|
|
2987
|
+
return /*#__PURE__*/React.createElement(List.Item, {
|
|
2988
|
+
className: classnames(style$1['default-list-item'], 'select-list-item', {
|
|
2989
|
+
[style$1['is-selected']]: isChecked,
|
|
2990
|
+
[style$1['is-disabled']]: item.disabled
|
|
2991
|
+
}),
|
|
2992
|
+
key: item[valueKey],
|
|
2993
|
+
onClick: () => {
|
|
2994
|
+
if (item.disabled) {
|
|
2995
|
+
return;
|
|
2996
|
+
}
|
|
2997
|
+
if (isSelectedAll) {
|
|
2998
|
+
return;
|
|
2999
|
+
}
|
|
3000
|
+
if (single) {
|
|
3001
|
+
setValue([item]);
|
|
3002
|
+
} else {
|
|
3003
|
+
onSelect(item);
|
|
3004
|
+
}
|
|
3005
|
+
if (isPopup && single) {
|
|
3006
|
+
onOpenChange(false);
|
|
3007
|
+
}
|
|
3008
|
+
}
|
|
3009
|
+
}, !single && /*#__PURE__*/React.createElement(Flex, null, /*#__PURE__*/React.createElement(Checkbox, {
|
|
3010
|
+
checked: isSelectedAll || isChecked,
|
|
3011
|
+
disabled: isSelectedAll || item.disabled
|
|
3012
|
+
})), /*#__PURE__*/React.createElement(Flex, {
|
|
3013
|
+
vertical: true,
|
|
3014
|
+
gag: 8,
|
|
3015
|
+
flex: 1,
|
|
3016
|
+
className: 'select-list-item-content'
|
|
3017
|
+
}, renderItemContent(contextProps)), single && /*#__PURE__*/React.createElement("div", {
|
|
3018
|
+
className: style$1['single-checked']
|
|
3019
|
+
}, isChecked && /*#__PURE__*/React.createElement(CheckOutlined, null)));
|
|
3020
|
+
},
|
|
3021
|
+
renderList: contextProps => {
|
|
3022
|
+
const {
|
|
3023
|
+
props,
|
|
3024
|
+
isSelectedAll,
|
|
3025
|
+
list
|
|
3026
|
+
} = contextProps;
|
|
3027
|
+
const {
|
|
3028
|
+
renderItem
|
|
3029
|
+
} = props;
|
|
3030
|
+
return /*#__PURE__*/React.createElement(List, {
|
|
3031
|
+
className: classnames(style$1['default-list'], {
|
|
3032
|
+
[style$1['is-selected-all']]: isSelectedAll
|
|
3033
|
+
}),
|
|
3034
|
+
size: "small",
|
|
3035
|
+
dataSource: list,
|
|
3036
|
+
renderItem: item => renderItem(Object.assign({}, contextProps, {
|
|
3037
|
+
item
|
|
3038
|
+
}))
|
|
3039
|
+
});
|
|
3040
|
+
}
|
|
3041
|
+
}, p);
|
|
3042
|
+
return /*#__PURE__*/React.createElement(SelectInput, props, targetProps => {
|
|
3043
|
+
const {
|
|
3044
|
+
props,
|
|
3045
|
+
value,
|
|
3046
|
+
searchText,
|
|
3047
|
+
setSearchText
|
|
3048
|
+
} = targetProps;
|
|
3049
|
+
const {
|
|
3050
|
+
isPopup,
|
|
3051
|
+
getSearchProps,
|
|
3052
|
+
getSearchCallback,
|
|
3053
|
+
searchPlaceholder,
|
|
3054
|
+
valueKey,
|
|
3055
|
+
single,
|
|
3056
|
+
allowSelectedAll,
|
|
3057
|
+
showSelectedTag,
|
|
3058
|
+
api,
|
|
3059
|
+
options,
|
|
3060
|
+
renderList,
|
|
3061
|
+
selectedAllValue
|
|
3062
|
+
} = props;
|
|
3063
|
+
const components = {
|
|
3064
|
+
search: (api && typeof getSearchProps === 'function' || options && typeof getSearchCallback === 'function') && /*#__PURE__*/React.createElement(SearchInput, {
|
|
3065
|
+
className: classnames(style$1['select-search'], 'select-list-search', {
|
|
3066
|
+
'is-popup': isPopup
|
|
3067
|
+
}),
|
|
3068
|
+
placeholder: searchPlaceholder,
|
|
3069
|
+
value: searchText,
|
|
3070
|
+
onSearch: value => {
|
|
3071
|
+
setSearchText(value);
|
|
3072
|
+
},
|
|
3073
|
+
simple: isPopup,
|
|
3074
|
+
showSearchButton: !isPopup
|
|
3075
|
+
}),
|
|
3076
|
+
selectedAll: /*#__PURE__*/React.createElement("div", {
|
|
3077
|
+
className: classnames(style$1['selected-all'], 'select-list-selected-all', {
|
|
3078
|
+
'is-popup': isPopup
|
|
3079
|
+
})
|
|
3080
|
+
}, !single && allowSelectedAll && /*#__PURE__*/React.createElement(SelectedAll, null)),
|
|
3081
|
+
fetchList: /*#__PURE__*/React.createElement(FetchScrollLoader, _extends({}, props, {
|
|
3082
|
+
className: classnames(style$1['list'], 'select-list-scroll-list', {
|
|
3083
|
+
'is-popup': isPopup
|
|
3084
|
+
}),
|
|
3085
|
+
searchProps: {
|
|
3086
|
+
searchText
|
|
3087
|
+
},
|
|
3088
|
+
getSearchProps: getSearchProps,
|
|
3089
|
+
api: Object.assign({}, options ? {
|
|
3090
|
+
data: {
|
|
3091
|
+
options,
|
|
3092
|
+
searchText
|
|
3093
|
+
},
|
|
3094
|
+
loader: ({
|
|
3095
|
+
data
|
|
3096
|
+
}) => {
|
|
3097
|
+
const {
|
|
3098
|
+
options,
|
|
3099
|
+
searchText
|
|
3100
|
+
} = data;
|
|
3101
|
+
if (typeof getSearchCallback === 'function') {
|
|
3102
|
+
const newOptions = options.filter(item => getSearchCallback(searchText, item));
|
|
3103
|
+
return {
|
|
3104
|
+
pageData: newOptions
|
|
3105
|
+
};
|
|
3106
|
+
}
|
|
3107
|
+
return {
|
|
3108
|
+
pageData: options
|
|
3109
|
+
};
|
|
3110
|
+
}
|
|
3111
|
+
} : api)
|
|
3112
|
+
}), fetchProps => {
|
|
3113
|
+
const isSelectedAll = computedIsSelectAll(value, selectedAllValue, valueKey);
|
|
3114
|
+
return renderList(Object.assign({}, fetchProps, targetProps, {
|
|
3115
|
+
isSelectedAll
|
|
3116
|
+
}));
|
|
3117
|
+
}),
|
|
3118
|
+
selectedTag: showSelectedTag && /*#__PURE__*/React.createElement("div", {
|
|
3119
|
+
className: classnames(style$1['selected-tag'], 'select-list-selected-tag', {
|
|
3120
|
+
'is-popup': isPopup
|
|
3121
|
+
})
|
|
3122
|
+
}, /*#__PURE__*/React.createElement(SelectedTagList, null))
|
|
3123
|
+
};
|
|
3124
|
+
if (typeof children === 'function') {
|
|
3125
|
+
return children(Object.assign({}, targetProps, {
|
|
3126
|
+
components
|
|
3127
|
+
}));
|
|
3128
|
+
}
|
|
3129
|
+
return /*#__PURE__*/React.createElement(Flex, {
|
|
3130
|
+
vertical: true
|
|
3131
|
+
}, components.search, components.selectedAll, components.fetchList, components.selectedTag);
|
|
3132
|
+
});
|
|
3133
|
+
};
|
|
2985
3134
|
|
|
2986
|
-
|
|
2987
|
-
* Creates a base function for methods like `_.forIn` and `_.forOwn`.
|
|
2988
|
-
*
|
|
2989
|
-
* @private
|
|
2990
|
-
* @param {boolean} [fromRight] Specify iterating from right to left.
|
|
2991
|
-
* @returns {Function} Returns the new base function.
|
|
2992
|
-
*/
|
|
2993
|
-
function createBaseFor(fromRight) {
|
|
2994
|
-
return function(object, iteratee, keysFunc) {
|
|
2995
|
-
var index = -1,
|
|
2996
|
-
iterable = Object(object),
|
|
2997
|
-
props = keysFunc(object),
|
|
2998
|
-
length = props.length;
|
|
3135
|
+
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"};
|
|
2999
3136
|
|
|
3000
|
-
|
|
3001
|
-
|
|
3002
|
-
|
|
3003
|
-
|
|
3137
|
+
const SelectTableList = p => {
|
|
3138
|
+
const [filter, setFilter] = useState({});
|
|
3139
|
+
const [tagSearchText, setTagSearchText] = useState('');
|
|
3140
|
+
const props = Object.assign({}, {
|
|
3141
|
+
overlayWidth: '600px',
|
|
3142
|
+
filterRender: contextProps => {
|
|
3143
|
+
const {
|
|
3144
|
+
props,
|
|
3145
|
+
filter,
|
|
3146
|
+
setFilter
|
|
3147
|
+
} = contextProps;
|
|
3148
|
+
const {
|
|
3149
|
+
isPopup,
|
|
3150
|
+
searchPlaceholder,
|
|
3151
|
+
api,
|
|
3152
|
+
getSearchProps,
|
|
3153
|
+
options,
|
|
3154
|
+
getSearchCallback,
|
|
3155
|
+
labelKey
|
|
3156
|
+
} = props;
|
|
3157
|
+
if (!(api && typeof getSearchProps === 'function' || options && typeof getSearchCallback === 'function')) {
|
|
3158
|
+
return null;
|
|
3159
|
+
}
|
|
3160
|
+
return /*#__PURE__*/React.createElement(SearchInput, {
|
|
3161
|
+
className: classnames(style['select-search'], 'select-list-search', {
|
|
3162
|
+
'is-popup': isPopup
|
|
3163
|
+
}),
|
|
3164
|
+
placeholder: searchPlaceholder,
|
|
3165
|
+
value: filter.searchText || '',
|
|
3166
|
+
onSearch: value => {
|
|
3167
|
+
setFilter(filter => Object.assign({}, filter, {
|
|
3168
|
+
searchText: value
|
|
3169
|
+
}));
|
|
3170
|
+
},
|
|
3171
|
+
simple: isPopup,
|
|
3172
|
+
showSearchButton: !isPopup
|
|
3173
|
+
});
|
|
3174
|
+
},
|
|
3175
|
+
getTagSearchCallback: (tagSearchText, item, contextProps) => {
|
|
3176
|
+
const {
|
|
3177
|
+
props
|
|
3178
|
+
} = contextProps;
|
|
3179
|
+
const {
|
|
3180
|
+
labelKey
|
|
3181
|
+
} = props;
|
|
3182
|
+
if (!tagSearchText) {
|
|
3183
|
+
return true;
|
|
3004
3184
|
}
|
|
3005
|
-
|
|
3006
|
-
return object;
|
|
3007
|
-
};
|
|
3008
|
-
}
|
|
3009
|
-
|
|
3010
|
-
var _createBaseFor = createBaseFor;
|
|
3011
|
-
|
|
3012
|
-
/**
|
|
3013
|
-
* The base implementation of `baseForOwn` which iterates over `object`
|
|
3014
|
-
* properties returned by `keysFunc` and invokes `iteratee` for each property.
|
|
3015
|
-
* Iteratee functions may exit iteration early by explicitly returning `false`.
|
|
3016
|
-
*
|
|
3017
|
-
* @private
|
|
3018
|
-
* @param {Object} object The object to iterate over.
|
|
3019
|
-
* @param {Function} iteratee The function invoked per iteration.
|
|
3020
|
-
* @param {Function} keysFunc The function to get the keys of `object`.
|
|
3021
|
-
* @returns {Object} Returns `object`.
|
|
3022
|
-
*/
|
|
3023
|
-
var baseFor = _createBaseFor();
|
|
3024
|
-
|
|
3025
|
-
var _baseFor = baseFor;
|
|
3026
|
-
|
|
3027
|
-
var _cloneBuffer = createCommonjsModule(function (module, exports) {
|
|
3028
|
-
/** Detect free variable `exports`. */
|
|
3029
|
-
var freeExports = exports && !exports.nodeType && exports;
|
|
3030
|
-
|
|
3031
|
-
/** Detect free variable `module`. */
|
|
3032
|
-
var freeModule = freeExports && 'object' == 'object' && module && !module.nodeType && module;
|
|
3033
|
-
|
|
3034
|
-
/** Detect the popular CommonJS extension `module.exports`. */
|
|
3035
|
-
var moduleExports = freeModule && freeModule.exports === freeExports;
|
|
3036
|
-
|
|
3037
|
-
/** Built-in value references. */
|
|
3038
|
-
var Buffer = moduleExports ? _root.Buffer : undefined,
|
|
3039
|
-
allocUnsafe = Buffer ? Buffer.allocUnsafe : undefined;
|
|
3040
|
-
|
|
3041
|
-
/**
|
|
3042
|
-
* Creates a clone of `buffer`.
|
|
3043
|
-
*
|
|
3044
|
-
* @private
|
|
3045
|
-
* @param {Buffer} buffer The buffer to clone.
|
|
3046
|
-
* @param {boolean} [isDeep] Specify a deep clone.
|
|
3047
|
-
* @returns {Buffer} Returns the cloned buffer.
|
|
3048
|
-
*/
|
|
3049
|
-
function cloneBuffer(buffer, isDeep) {
|
|
3050
|
-
if (isDeep) {
|
|
3051
|
-
return buffer.slice();
|
|
3052
|
-
}
|
|
3053
|
-
var length = buffer.length,
|
|
3054
|
-
result = allocUnsafe ? allocUnsafe(length) : new buffer.constructor(length);
|
|
3055
|
-
|
|
3056
|
-
buffer.copy(result);
|
|
3057
|
-
return result;
|
|
3058
|
-
}
|
|
3059
|
-
|
|
3060
|
-
module.exports = cloneBuffer;
|
|
3061
|
-
});
|
|
3062
|
-
|
|
3063
|
-
/**
|
|
3064
|
-
* Creates a clone of `arrayBuffer`.
|
|
3065
|
-
*
|
|
3066
|
-
* @private
|
|
3067
|
-
* @param {ArrayBuffer} arrayBuffer The array buffer to clone.
|
|
3068
|
-
* @returns {ArrayBuffer} Returns the cloned array buffer.
|
|
3069
|
-
*/
|
|
3070
|
-
function cloneArrayBuffer(arrayBuffer) {
|
|
3071
|
-
var result = new arrayBuffer.constructor(arrayBuffer.byteLength);
|
|
3072
|
-
new _Uint8Array(result).set(new _Uint8Array(arrayBuffer));
|
|
3073
|
-
return result;
|
|
3074
|
-
}
|
|
3075
|
-
|
|
3076
|
-
var _cloneArrayBuffer = cloneArrayBuffer;
|
|
3077
|
-
|
|
3078
|
-
/**
|
|
3079
|
-
* Creates a clone of `typedArray`.
|
|
3080
|
-
*
|
|
3081
|
-
* @private
|
|
3082
|
-
* @param {Object} typedArray The typed array to clone.
|
|
3083
|
-
* @param {boolean} [isDeep] Specify a deep clone.
|
|
3084
|
-
* @returns {Object} Returns the cloned typed array.
|
|
3085
|
-
*/
|
|
3086
|
-
function cloneTypedArray(typedArray, isDeep) {
|
|
3087
|
-
var buffer = isDeep ? _cloneArrayBuffer(typedArray.buffer) : typedArray.buffer;
|
|
3088
|
-
return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length);
|
|
3089
|
-
}
|
|
3090
|
-
|
|
3091
|
-
var _cloneTypedArray = cloneTypedArray;
|
|
3092
|
-
|
|
3093
|
-
/**
|
|
3094
|
-
* Copies the values of `source` to `array`.
|
|
3095
|
-
*
|
|
3096
|
-
* @private
|
|
3097
|
-
* @param {Array} source The array to copy values from.
|
|
3098
|
-
* @param {Array} [array=[]] The array to copy values to.
|
|
3099
|
-
* @returns {Array} Returns `array`.
|
|
3100
|
-
*/
|
|
3101
|
-
function copyArray(source, array) {
|
|
3102
|
-
var index = -1,
|
|
3103
|
-
length = source.length;
|
|
3104
|
-
|
|
3105
|
-
array || (array = Array(length));
|
|
3106
|
-
while (++index < length) {
|
|
3107
|
-
array[index] = source[index];
|
|
3108
|
-
}
|
|
3109
|
-
return array;
|
|
3110
|
-
}
|
|
3111
|
-
|
|
3112
|
-
var _copyArray = copyArray;
|
|
3113
|
-
|
|
3114
|
-
/** Built-in value references. */
|
|
3115
|
-
var objectCreate = Object.create;
|
|
3116
|
-
|
|
3117
|
-
/**
|
|
3118
|
-
* The base implementation of `_.create` without support for assigning
|
|
3119
|
-
* properties to the created object.
|
|
3120
|
-
*
|
|
3121
|
-
* @private
|
|
3122
|
-
* @param {Object} proto The object to inherit from.
|
|
3123
|
-
* @returns {Object} Returns the new object.
|
|
3124
|
-
*/
|
|
3125
|
-
var baseCreate = (function() {
|
|
3126
|
-
function object() {}
|
|
3127
|
-
return function(proto) {
|
|
3128
|
-
if (!isObject_1(proto)) {
|
|
3129
|
-
return {};
|
|
3130
|
-
}
|
|
3131
|
-
if (objectCreate) {
|
|
3132
|
-
return objectCreate(proto);
|
|
3133
|
-
}
|
|
3134
|
-
object.prototype = proto;
|
|
3135
|
-
var result = new object;
|
|
3136
|
-
object.prototype = undefined;
|
|
3137
|
-
return result;
|
|
3138
|
-
};
|
|
3139
|
-
}());
|
|
3140
|
-
|
|
3141
|
-
var _baseCreate = baseCreate;
|
|
3142
|
-
|
|
3143
|
-
/** Built-in value references. */
|
|
3144
|
-
var getPrototype = _overArg(Object.getPrototypeOf, Object);
|
|
3145
|
-
|
|
3146
|
-
var _getPrototype = getPrototype;
|
|
3147
|
-
|
|
3148
|
-
/**
|
|
3149
|
-
* Initializes an object clone.
|
|
3150
|
-
*
|
|
3151
|
-
* @private
|
|
3152
|
-
* @param {Object} object The object to clone.
|
|
3153
|
-
* @returns {Object} Returns the initialized clone.
|
|
3154
|
-
*/
|
|
3155
|
-
function initCloneObject(object) {
|
|
3156
|
-
return (typeof object.constructor == 'function' && !_isPrototype(object))
|
|
3157
|
-
? _baseCreate(_getPrototype(object))
|
|
3158
|
-
: {};
|
|
3159
|
-
}
|
|
3160
|
-
|
|
3161
|
-
var _initCloneObject = initCloneObject;
|
|
3162
|
-
|
|
3163
|
-
/**
|
|
3164
|
-
* This method is like `_.isArrayLike` except that it also checks if `value`
|
|
3165
|
-
* is an object.
|
|
3166
|
-
*
|
|
3167
|
-
* @static
|
|
3168
|
-
* @memberOf _
|
|
3169
|
-
* @since 4.0.0
|
|
3170
|
-
* @category Lang
|
|
3171
|
-
* @param {*} value The value to check.
|
|
3172
|
-
* @returns {boolean} Returns `true` if `value` is an array-like object,
|
|
3173
|
-
* else `false`.
|
|
3174
|
-
* @example
|
|
3175
|
-
*
|
|
3176
|
-
* _.isArrayLikeObject([1, 2, 3]);
|
|
3177
|
-
* // => true
|
|
3178
|
-
*
|
|
3179
|
-
* _.isArrayLikeObject(document.body.children);
|
|
3180
|
-
* // => true
|
|
3181
|
-
*
|
|
3182
|
-
* _.isArrayLikeObject('abc');
|
|
3183
|
-
* // => false
|
|
3184
|
-
*
|
|
3185
|
-
* _.isArrayLikeObject(_.noop);
|
|
3186
|
-
* // => false
|
|
3187
|
-
*/
|
|
3188
|
-
function isArrayLikeObject(value) {
|
|
3189
|
-
return isObjectLike_1(value) && isArrayLike_1(value);
|
|
3190
|
-
}
|
|
3191
|
-
|
|
3192
|
-
var isArrayLikeObject_1 = isArrayLikeObject;
|
|
3193
|
-
|
|
3194
|
-
/** `Object#toString` result references. */
|
|
3195
|
-
var objectTag = '[object Object]';
|
|
3196
|
-
|
|
3197
|
-
/** Used for built-in method references. */
|
|
3198
|
-
var funcProto = Function.prototype,
|
|
3199
|
-
objectProto$2 = Object.prototype;
|
|
3200
|
-
|
|
3201
|
-
/** Used to resolve the decompiled source of functions. */
|
|
3202
|
-
var funcToString = funcProto.toString;
|
|
3203
|
-
|
|
3204
|
-
/** Used to check objects for own properties. */
|
|
3205
|
-
var hasOwnProperty$2 = objectProto$2.hasOwnProperty;
|
|
3206
|
-
|
|
3207
|
-
/** Used to infer the `Object` constructor. */
|
|
3208
|
-
var objectCtorString = funcToString.call(Object);
|
|
3209
|
-
|
|
3210
|
-
/**
|
|
3211
|
-
* Checks if `value` is a plain object, that is, an object created by the
|
|
3212
|
-
* `Object` constructor or one with a `[[Prototype]]` of `null`.
|
|
3213
|
-
*
|
|
3214
|
-
* @static
|
|
3215
|
-
* @memberOf _
|
|
3216
|
-
* @since 0.8.0
|
|
3217
|
-
* @category Lang
|
|
3218
|
-
* @param {*} value The value to check.
|
|
3219
|
-
* @returns {boolean} Returns `true` if `value` is a plain object, else `false`.
|
|
3220
|
-
* @example
|
|
3221
|
-
*
|
|
3222
|
-
* function Foo() {
|
|
3223
|
-
* this.a = 1;
|
|
3224
|
-
* }
|
|
3225
|
-
*
|
|
3226
|
-
* _.isPlainObject(new Foo);
|
|
3227
|
-
* // => false
|
|
3228
|
-
*
|
|
3229
|
-
* _.isPlainObject([1, 2, 3]);
|
|
3230
|
-
* // => false
|
|
3231
|
-
*
|
|
3232
|
-
* _.isPlainObject({ 'x': 0, 'y': 0 });
|
|
3233
|
-
* // => true
|
|
3234
|
-
*
|
|
3235
|
-
* _.isPlainObject(Object.create(null));
|
|
3236
|
-
* // => true
|
|
3237
|
-
*/
|
|
3238
|
-
function isPlainObject(value) {
|
|
3239
|
-
if (!isObjectLike_1(value) || _baseGetTag(value) != objectTag) {
|
|
3240
|
-
return false;
|
|
3241
|
-
}
|
|
3242
|
-
var proto = _getPrototype(value);
|
|
3243
|
-
if (proto === null) {
|
|
3244
|
-
return true;
|
|
3245
|
-
}
|
|
3246
|
-
var Ctor = hasOwnProperty$2.call(proto, 'constructor') && proto.constructor;
|
|
3247
|
-
return typeof Ctor == 'function' && Ctor instanceof Ctor &&
|
|
3248
|
-
funcToString.call(Ctor) == objectCtorString;
|
|
3249
|
-
}
|
|
3250
|
-
|
|
3251
|
-
var isPlainObject_1 = isPlainObject;
|
|
3252
|
-
|
|
3253
|
-
/**
|
|
3254
|
-
* Gets the value at `key`, unless `key` is "__proto__" or "constructor".
|
|
3255
|
-
*
|
|
3256
|
-
* @private
|
|
3257
|
-
* @param {Object} object The object to query.
|
|
3258
|
-
* @param {string} key The key of the property to get.
|
|
3259
|
-
* @returns {*} Returns the property value.
|
|
3260
|
-
*/
|
|
3261
|
-
function safeGet(object, key) {
|
|
3262
|
-
if (key === 'constructor' && typeof object[key] === 'function') {
|
|
3263
|
-
return;
|
|
3264
|
-
}
|
|
3265
|
-
|
|
3266
|
-
if (key == '__proto__') {
|
|
3267
|
-
return;
|
|
3268
|
-
}
|
|
3269
|
-
|
|
3270
|
-
return object[key];
|
|
3271
|
-
}
|
|
3272
|
-
|
|
3273
|
-
var _safeGet = safeGet;
|
|
3274
|
-
|
|
3275
|
-
/** Used for built-in method references. */
|
|
3276
|
-
var objectProto$1 = Object.prototype;
|
|
3277
|
-
|
|
3278
|
-
/** Used to check objects for own properties. */
|
|
3279
|
-
var hasOwnProperty$1 = objectProto$1.hasOwnProperty;
|
|
3280
|
-
|
|
3281
|
-
/**
|
|
3282
|
-
* Assigns `value` to `key` of `object` if the existing value is not equivalent
|
|
3283
|
-
* using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
|
|
3284
|
-
* for equality comparisons.
|
|
3285
|
-
*
|
|
3286
|
-
* @private
|
|
3287
|
-
* @param {Object} object The object to modify.
|
|
3288
|
-
* @param {string} key The key of the property to assign.
|
|
3289
|
-
* @param {*} value The value to assign.
|
|
3290
|
-
*/
|
|
3291
|
-
function assignValue(object, key, value) {
|
|
3292
|
-
var objValue = object[key];
|
|
3293
|
-
if (!(hasOwnProperty$1.call(object, key) && eq_1(objValue, value)) ||
|
|
3294
|
-
(value === undefined && !(key in object))) {
|
|
3295
|
-
_baseAssignValue(object, key, value);
|
|
3296
|
-
}
|
|
3297
|
-
}
|
|
3298
|
-
|
|
3299
|
-
var _assignValue = assignValue;
|
|
3300
|
-
|
|
3301
|
-
/**
|
|
3302
|
-
* Copies properties of `source` to `object`.
|
|
3303
|
-
*
|
|
3304
|
-
* @private
|
|
3305
|
-
* @param {Object} source The object to copy properties from.
|
|
3306
|
-
* @param {Array} props The property identifiers to copy.
|
|
3307
|
-
* @param {Object} [object={}] The object to copy properties to.
|
|
3308
|
-
* @param {Function} [customizer] The function to customize copied values.
|
|
3309
|
-
* @returns {Object} Returns `object`.
|
|
3310
|
-
*/
|
|
3311
|
-
function copyObject(source, props, object, customizer) {
|
|
3312
|
-
var isNew = !object;
|
|
3313
|
-
object || (object = {});
|
|
3314
|
-
|
|
3315
|
-
var index = -1,
|
|
3316
|
-
length = props.length;
|
|
3317
|
-
|
|
3318
|
-
while (++index < length) {
|
|
3319
|
-
var key = props[index];
|
|
3320
|
-
|
|
3321
|
-
var newValue = customizer
|
|
3322
|
-
? customizer(object[key], source[key], key, object, source)
|
|
3323
|
-
: undefined;
|
|
3324
|
-
|
|
3325
|
-
if (newValue === undefined) {
|
|
3326
|
-
newValue = source[key];
|
|
3327
|
-
}
|
|
3328
|
-
if (isNew) {
|
|
3329
|
-
_baseAssignValue(object, key, newValue);
|
|
3330
|
-
} else {
|
|
3331
|
-
_assignValue(object, key, newValue);
|
|
3332
|
-
}
|
|
3333
|
-
}
|
|
3334
|
-
return object;
|
|
3335
|
-
}
|
|
3336
|
-
|
|
3337
|
-
var _copyObject = copyObject;
|
|
3338
|
-
|
|
3339
|
-
/**
|
|
3340
|
-
* This function is like
|
|
3341
|
-
* [`Object.keys`](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)
|
|
3342
|
-
* except that it includes inherited enumerable properties.
|
|
3343
|
-
*
|
|
3344
|
-
* @private
|
|
3345
|
-
* @param {Object} object The object to query.
|
|
3346
|
-
* @returns {Array} Returns the array of property names.
|
|
3347
|
-
*/
|
|
3348
|
-
function nativeKeysIn(object) {
|
|
3349
|
-
var result = [];
|
|
3350
|
-
if (object != null) {
|
|
3351
|
-
for (var key in Object(object)) {
|
|
3352
|
-
result.push(key);
|
|
3353
|
-
}
|
|
3354
|
-
}
|
|
3355
|
-
return result;
|
|
3356
|
-
}
|
|
3357
|
-
|
|
3358
|
-
var _nativeKeysIn = nativeKeysIn;
|
|
3359
|
-
|
|
3360
|
-
/** Used for built-in method references. */
|
|
3361
|
-
var objectProto = Object.prototype;
|
|
3362
|
-
|
|
3363
|
-
/** Used to check objects for own properties. */
|
|
3364
|
-
var hasOwnProperty = objectProto.hasOwnProperty;
|
|
3365
|
-
|
|
3366
|
-
/**
|
|
3367
|
-
* The base implementation of `_.keysIn` which doesn't treat sparse arrays as dense.
|
|
3368
|
-
*
|
|
3369
|
-
* @private
|
|
3370
|
-
* @param {Object} object The object to query.
|
|
3371
|
-
* @returns {Array} Returns the array of property names.
|
|
3372
|
-
*/
|
|
3373
|
-
function baseKeysIn(object) {
|
|
3374
|
-
if (!isObject_1(object)) {
|
|
3375
|
-
return _nativeKeysIn(object);
|
|
3376
|
-
}
|
|
3377
|
-
var isProto = _isPrototype(object),
|
|
3378
|
-
result = [];
|
|
3379
|
-
|
|
3380
|
-
for (var key in object) {
|
|
3381
|
-
if (!(key == 'constructor' && (isProto || !hasOwnProperty.call(object, key)))) {
|
|
3382
|
-
result.push(key);
|
|
3383
|
-
}
|
|
3384
|
-
}
|
|
3385
|
-
return result;
|
|
3386
|
-
}
|
|
3387
|
-
|
|
3388
|
-
var _baseKeysIn = baseKeysIn;
|
|
3389
|
-
|
|
3390
|
-
/**
|
|
3391
|
-
* Creates an array of the own and inherited enumerable property names of `object`.
|
|
3392
|
-
*
|
|
3393
|
-
* **Note:** Non-object values are coerced to objects.
|
|
3394
|
-
*
|
|
3395
|
-
* @static
|
|
3396
|
-
* @memberOf _
|
|
3397
|
-
* @since 3.0.0
|
|
3398
|
-
* @category Object
|
|
3399
|
-
* @param {Object} object The object to query.
|
|
3400
|
-
* @returns {Array} Returns the array of property names.
|
|
3401
|
-
* @example
|
|
3402
|
-
*
|
|
3403
|
-
* function Foo() {
|
|
3404
|
-
* this.a = 1;
|
|
3405
|
-
* this.b = 2;
|
|
3406
|
-
* }
|
|
3407
|
-
*
|
|
3408
|
-
* Foo.prototype.c = 3;
|
|
3409
|
-
*
|
|
3410
|
-
* _.keysIn(new Foo);
|
|
3411
|
-
* // => ['a', 'b', 'c'] (iteration order is not guaranteed)
|
|
3412
|
-
*/
|
|
3413
|
-
function keysIn(object) {
|
|
3414
|
-
return isArrayLike_1(object) ? _arrayLikeKeys(object, true) : _baseKeysIn(object);
|
|
3415
|
-
}
|
|
3416
|
-
|
|
3417
|
-
var keysIn_1 = keysIn;
|
|
3418
|
-
|
|
3419
|
-
/**
|
|
3420
|
-
* Converts `value` to a plain object flattening inherited enumerable string
|
|
3421
|
-
* keyed properties of `value` to own properties of the plain object.
|
|
3422
|
-
*
|
|
3423
|
-
* @static
|
|
3424
|
-
* @memberOf _
|
|
3425
|
-
* @since 3.0.0
|
|
3426
|
-
* @category Lang
|
|
3427
|
-
* @param {*} value The value to convert.
|
|
3428
|
-
* @returns {Object} Returns the converted plain object.
|
|
3429
|
-
* @example
|
|
3430
|
-
*
|
|
3431
|
-
* function Foo() {
|
|
3432
|
-
* this.b = 2;
|
|
3433
|
-
* }
|
|
3434
|
-
*
|
|
3435
|
-
* Foo.prototype.c = 3;
|
|
3436
|
-
*
|
|
3437
|
-
* _.assign({ 'a': 1 }, new Foo);
|
|
3438
|
-
* // => { 'a': 1, 'b': 2 }
|
|
3439
|
-
*
|
|
3440
|
-
* _.assign({ 'a': 1 }, _.toPlainObject(new Foo));
|
|
3441
|
-
* // => { 'a': 1, 'b': 2, 'c': 3 }
|
|
3442
|
-
*/
|
|
3443
|
-
function toPlainObject(value) {
|
|
3444
|
-
return _copyObject(value, keysIn_1(value));
|
|
3445
|
-
}
|
|
3446
|
-
|
|
3447
|
-
var toPlainObject_1 = toPlainObject;
|
|
3448
|
-
|
|
3449
|
-
/**
|
|
3450
|
-
* A specialized version of `baseMerge` for arrays and objects which performs
|
|
3451
|
-
* deep merges and tracks traversed objects enabling objects with circular
|
|
3452
|
-
* references to be merged.
|
|
3453
|
-
*
|
|
3454
|
-
* @private
|
|
3455
|
-
* @param {Object} object The destination object.
|
|
3456
|
-
* @param {Object} source The source object.
|
|
3457
|
-
* @param {string} key The key of the value to merge.
|
|
3458
|
-
* @param {number} srcIndex The index of `source`.
|
|
3459
|
-
* @param {Function} mergeFunc The function to merge values.
|
|
3460
|
-
* @param {Function} [customizer] The function to customize assigned values.
|
|
3461
|
-
* @param {Object} [stack] Tracks traversed source values and their merged
|
|
3462
|
-
* counterparts.
|
|
3463
|
-
*/
|
|
3464
|
-
function baseMergeDeep(object, source, key, srcIndex, mergeFunc, customizer, stack) {
|
|
3465
|
-
var objValue = _safeGet(object, key),
|
|
3466
|
-
srcValue = _safeGet(source, key),
|
|
3467
|
-
stacked = stack.get(srcValue);
|
|
3468
|
-
|
|
3469
|
-
if (stacked) {
|
|
3470
|
-
_assignMergeValue(object, key, stacked);
|
|
3471
|
-
return;
|
|
3472
|
-
}
|
|
3473
|
-
var newValue = customizer
|
|
3474
|
-
? customizer(objValue, srcValue, (key + ''), object, source, stack)
|
|
3475
|
-
: undefined;
|
|
3476
|
-
|
|
3477
|
-
var isCommon = newValue === undefined;
|
|
3478
|
-
|
|
3479
|
-
if (isCommon) {
|
|
3480
|
-
var isArr = isArray_1(srcValue),
|
|
3481
|
-
isBuff = !isArr && isBuffer_1(srcValue),
|
|
3482
|
-
isTyped = !isArr && !isBuff && isTypedArray_1(srcValue);
|
|
3483
|
-
|
|
3484
|
-
newValue = srcValue;
|
|
3485
|
-
if (isArr || isBuff || isTyped) {
|
|
3486
|
-
if (isArray_1(objValue)) {
|
|
3487
|
-
newValue = objValue;
|
|
3488
|
-
}
|
|
3489
|
-
else if (isArrayLikeObject_1(objValue)) {
|
|
3490
|
-
newValue = _copyArray(objValue);
|
|
3491
|
-
}
|
|
3492
|
-
else if (isBuff) {
|
|
3493
|
-
isCommon = false;
|
|
3494
|
-
newValue = _cloneBuffer(srcValue, true);
|
|
3495
|
-
}
|
|
3496
|
-
else if (isTyped) {
|
|
3497
|
-
isCommon = false;
|
|
3498
|
-
newValue = _cloneTypedArray(srcValue, true);
|
|
3499
|
-
}
|
|
3500
|
-
else {
|
|
3501
|
-
newValue = [];
|
|
3502
|
-
}
|
|
3503
|
-
}
|
|
3504
|
-
else if (isPlainObject_1(srcValue) || isArguments_1(srcValue)) {
|
|
3505
|
-
newValue = objValue;
|
|
3506
|
-
if (isArguments_1(objValue)) {
|
|
3507
|
-
newValue = toPlainObject_1(objValue);
|
|
3508
|
-
}
|
|
3509
|
-
else if (!isObject_1(objValue) || isFunction_1(objValue)) {
|
|
3510
|
-
newValue = _initCloneObject(srcValue);
|
|
3511
|
-
}
|
|
3512
|
-
}
|
|
3513
|
-
else {
|
|
3514
|
-
isCommon = false;
|
|
3515
|
-
}
|
|
3516
|
-
}
|
|
3517
|
-
if (isCommon) {
|
|
3518
|
-
// Recursively merge objects and arrays (susceptible to call stack limits).
|
|
3519
|
-
stack.set(srcValue, newValue);
|
|
3520
|
-
mergeFunc(newValue, srcValue, srcIndex, customizer, stack);
|
|
3521
|
-
stack['delete'](srcValue);
|
|
3522
|
-
}
|
|
3523
|
-
_assignMergeValue(object, key, newValue);
|
|
3524
|
-
}
|
|
3525
|
-
|
|
3526
|
-
var _baseMergeDeep = baseMergeDeep;
|
|
3527
|
-
|
|
3528
|
-
/**
|
|
3529
|
-
* The base implementation of `_.merge` without support for multiple sources.
|
|
3530
|
-
*
|
|
3531
|
-
* @private
|
|
3532
|
-
* @param {Object} object The destination object.
|
|
3533
|
-
* @param {Object} source The source object.
|
|
3534
|
-
* @param {number} srcIndex The index of `source`.
|
|
3535
|
-
* @param {Function} [customizer] The function to customize merged values.
|
|
3536
|
-
* @param {Object} [stack] Tracks traversed source values and their merged
|
|
3537
|
-
* counterparts.
|
|
3538
|
-
*/
|
|
3539
|
-
function baseMerge(object, source, srcIndex, customizer, stack) {
|
|
3540
|
-
if (object === source) {
|
|
3541
|
-
return;
|
|
3542
|
-
}
|
|
3543
|
-
_baseFor(source, function(srcValue, key) {
|
|
3544
|
-
stack || (stack = new _Stack);
|
|
3545
|
-
if (isObject_1(srcValue)) {
|
|
3546
|
-
_baseMergeDeep(object, source, key, srcIndex, baseMerge, customizer, stack);
|
|
3547
|
-
}
|
|
3548
|
-
else {
|
|
3549
|
-
var newValue = customizer
|
|
3550
|
-
? customizer(_safeGet(object, key), srcValue, (key + ''), object, source, stack)
|
|
3551
|
-
: undefined;
|
|
3552
|
-
|
|
3553
|
-
if (newValue === undefined) {
|
|
3554
|
-
newValue = srcValue;
|
|
3555
|
-
}
|
|
3556
|
-
_assignMergeValue(object, key, newValue);
|
|
3557
|
-
}
|
|
3558
|
-
}, keysIn_1);
|
|
3559
|
-
}
|
|
3560
|
-
|
|
3561
|
-
var _baseMerge = baseMerge;
|
|
3562
|
-
|
|
3563
|
-
/**
|
|
3564
|
-
* This method returns the first argument it receives.
|
|
3565
|
-
*
|
|
3566
|
-
* @static
|
|
3567
|
-
* @since 0.1.0
|
|
3568
|
-
* @memberOf _
|
|
3569
|
-
* @category Util
|
|
3570
|
-
* @param {*} value Any value.
|
|
3571
|
-
* @returns {*} Returns `value`.
|
|
3572
|
-
* @example
|
|
3573
|
-
*
|
|
3574
|
-
* var object = { 'a': 1 };
|
|
3575
|
-
*
|
|
3576
|
-
* console.log(_.identity(object) === object);
|
|
3577
|
-
* // => true
|
|
3578
|
-
*/
|
|
3579
|
-
function identity(value) {
|
|
3580
|
-
return value;
|
|
3581
|
-
}
|
|
3582
|
-
|
|
3583
|
-
var identity_1 = identity;
|
|
3584
|
-
|
|
3585
|
-
/**
|
|
3586
|
-
* A faster alternative to `Function#apply`, this function invokes `func`
|
|
3587
|
-
* with the `this` binding of `thisArg` and the arguments of `args`.
|
|
3588
|
-
*
|
|
3589
|
-
* @private
|
|
3590
|
-
* @param {Function} func The function to invoke.
|
|
3591
|
-
* @param {*} thisArg The `this` binding of `func`.
|
|
3592
|
-
* @param {Array} args The arguments to invoke `func` with.
|
|
3593
|
-
* @returns {*} Returns the result of `func`.
|
|
3594
|
-
*/
|
|
3595
|
-
function apply(func, thisArg, args) {
|
|
3596
|
-
switch (args.length) {
|
|
3597
|
-
case 0: return func.call(thisArg);
|
|
3598
|
-
case 1: return func.call(thisArg, args[0]);
|
|
3599
|
-
case 2: return func.call(thisArg, args[0], args[1]);
|
|
3600
|
-
case 3: return func.call(thisArg, args[0], args[1], args[2]);
|
|
3601
|
-
}
|
|
3602
|
-
return func.apply(thisArg, args);
|
|
3603
|
-
}
|
|
3604
|
-
|
|
3605
|
-
var _apply = apply;
|
|
3606
|
-
|
|
3607
|
-
/* Built-in method references for those with the same name as other `lodash` methods. */
|
|
3608
|
-
var nativeMax = Math.max;
|
|
3609
|
-
|
|
3610
|
-
/**
|
|
3611
|
-
* A specialized version of `baseRest` which transforms the rest array.
|
|
3612
|
-
*
|
|
3613
|
-
* @private
|
|
3614
|
-
* @param {Function} func The function to apply a rest parameter to.
|
|
3615
|
-
* @param {number} [start=func.length-1] The start position of the rest parameter.
|
|
3616
|
-
* @param {Function} transform The rest array transform.
|
|
3617
|
-
* @returns {Function} Returns the new function.
|
|
3618
|
-
*/
|
|
3619
|
-
function overRest(func, start, transform) {
|
|
3620
|
-
start = nativeMax(start === undefined ? (func.length - 1) : start, 0);
|
|
3621
|
-
return function() {
|
|
3622
|
-
var args = arguments,
|
|
3623
|
-
index = -1,
|
|
3624
|
-
length = nativeMax(args.length - start, 0),
|
|
3625
|
-
array = Array(length);
|
|
3626
|
-
|
|
3627
|
-
while (++index < length) {
|
|
3628
|
-
array[index] = args[start + index];
|
|
3629
|
-
}
|
|
3630
|
-
index = -1;
|
|
3631
|
-
var otherArgs = Array(start + 1);
|
|
3632
|
-
while (++index < start) {
|
|
3633
|
-
otherArgs[index] = args[index];
|
|
3634
|
-
}
|
|
3635
|
-
otherArgs[start] = transform(array);
|
|
3636
|
-
return _apply(func, this, otherArgs);
|
|
3637
|
-
};
|
|
3638
|
-
}
|
|
3639
|
-
|
|
3640
|
-
var _overRest = overRest;
|
|
3641
|
-
|
|
3642
|
-
/**
|
|
3643
|
-
* Creates a function that returns `value`.
|
|
3644
|
-
*
|
|
3645
|
-
* @static
|
|
3646
|
-
* @memberOf _
|
|
3647
|
-
* @since 2.4.0
|
|
3648
|
-
* @category Util
|
|
3649
|
-
* @param {*} value The value to return from the new function.
|
|
3650
|
-
* @returns {Function} Returns the new constant function.
|
|
3651
|
-
* @example
|
|
3652
|
-
*
|
|
3653
|
-
* var objects = _.times(2, _.constant({ 'a': 1 }));
|
|
3654
|
-
*
|
|
3655
|
-
* console.log(objects);
|
|
3656
|
-
* // => [{ 'a': 1 }, { 'a': 1 }]
|
|
3657
|
-
*
|
|
3658
|
-
* console.log(objects[0] === objects[1]);
|
|
3659
|
-
* // => true
|
|
3660
|
-
*/
|
|
3661
|
-
function constant(value) {
|
|
3662
|
-
return function() {
|
|
3663
|
-
return value;
|
|
3664
|
-
};
|
|
3665
|
-
}
|
|
3666
|
-
|
|
3667
|
-
var constant_1 = constant;
|
|
3668
|
-
|
|
3669
|
-
/**
|
|
3670
|
-
* The base implementation of `setToString` without support for hot loop shorting.
|
|
3671
|
-
*
|
|
3672
|
-
* @private
|
|
3673
|
-
* @param {Function} func The function to modify.
|
|
3674
|
-
* @param {Function} string The `toString` result.
|
|
3675
|
-
* @returns {Function} Returns `func`.
|
|
3676
|
-
*/
|
|
3677
|
-
var baseSetToString = !_defineProperty ? identity_1 : function(func, string) {
|
|
3678
|
-
return _defineProperty(func, 'toString', {
|
|
3679
|
-
'configurable': true,
|
|
3680
|
-
'enumerable': false,
|
|
3681
|
-
'value': constant_1(string),
|
|
3682
|
-
'writable': true
|
|
3683
|
-
});
|
|
3684
|
-
};
|
|
3685
|
-
|
|
3686
|
-
var _baseSetToString = baseSetToString;
|
|
3687
|
-
|
|
3688
|
-
/** Used to detect hot functions by number of calls within a span of milliseconds. */
|
|
3689
|
-
var HOT_COUNT = 800,
|
|
3690
|
-
HOT_SPAN = 16;
|
|
3691
|
-
|
|
3692
|
-
/* Built-in method references for those with the same name as other `lodash` methods. */
|
|
3693
|
-
var nativeNow = Date.now;
|
|
3694
|
-
|
|
3695
|
-
/**
|
|
3696
|
-
* Creates a function that'll short out and invoke `identity` instead
|
|
3697
|
-
* of `func` when it's called `HOT_COUNT` or more times in `HOT_SPAN`
|
|
3698
|
-
* milliseconds.
|
|
3699
|
-
*
|
|
3700
|
-
* @private
|
|
3701
|
-
* @param {Function} func The function to restrict.
|
|
3702
|
-
* @returns {Function} Returns the new shortable function.
|
|
3703
|
-
*/
|
|
3704
|
-
function shortOut(func) {
|
|
3705
|
-
var count = 0,
|
|
3706
|
-
lastCalled = 0;
|
|
3707
|
-
|
|
3708
|
-
return function() {
|
|
3709
|
-
var stamp = nativeNow(),
|
|
3710
|
-
remaining = HOT_SPAN - (stamp - lastCalled);
|
|
3711
|
-
|
|
3712
|
-
lastCalled = stamp;
|
|
3713
|
-
if (remaining > 0) {
|
|
3714
|
-
if (++count >= HOT_COUNT) {
|
|
3715
|
-
return arguments[0];
|
|
3716
|
-
}
|
|
3717
|
-
} else {
|
|
3718
|
-
count = 0;
|
|
3719
|
-
}
|
|
3720
|
-
return func.apply(undefined, arguments);
|
|
3721
|
-
};
|
|
3722
|
-
}
|
|
3723
|
-
|
|
3724
|
-
var _shortOut = shortOut;
|
|
3725
|
-
|
|
3726
|
-
/**
|
|
3727
|
-
* Sets the `toString` method of `func` to return `string`.
|
|
3728
|
-
*
|
|
3729
|
-
* @private
|
|
3730
|
-
* @param {Function} func The function to modify.
|
|
3731
|
-
* @param {Function} string The `toString` result.
|
|
3732
|
-
* @returns {Function} Returns `func`.
|
|
3733
|
-
*/
|
|
3734
|
-
var setToString = _shortOut(_baseSetToString);
|
|
3735
|
-
|
|
3736
|
-
var _setToString = setToString;
|
|
3737
|
-
|
|
3738
|
-
/**
|
|
3739
|
-
* The base implementation of `_.rest` which doesn't validate or coerce arguments.
|
|
3740
|
-
*
|
|
3741
|
-
* @private
|
|
3742
|
-
* @param {Function} func The function to apply a rest parameter to.
|
|
3743
|
-
* @param {number} [start=func.length-1] The start position of the rest parameter.
|
|
3744
|
-
* @returns {Function} Returns the new function.
|
|
3745
|
-
*/
|
|
3746
|
-
function baseRest(func, start) {
|
|
3747
|
-
return _setToString(_overRest(func, start, identity_1), func + '');
|
|
3748
|
-
}
|
|
3749
|
-
|
|
3750
|
-
var _baseRest = baseRest;
|
|
3751
|
-
|
|
3752
|
-
/**
|
|
3753
|
-
* Checks if the given arguments are from an iteratee call.
|
|
3754
|
-
*
|
|
3755
|
-
* @private
|
|
3756
|
-
* @param {*} value The potential iteratee value argument.
|
|
3757
|
-
* @param {*} index The potential iteratee index or key argument.
|
|
3758
|
-
* @param {*} object The potential iteratee object argument.
|
|
3759
|
-
* @returns {boolean} Returns `true` if the arguments are from an iteratee call,
|
|
3760
|
-
* else `false`.
|
|
3761
|
-
*/
|
|
3762
|
-
function isIterateeCall(value, index, object) {
|
|
3763
|
-
if (!isObject_1(object)) {
|
|
3764
|
-
return false;
|
|
3765
|
-
}
|
|
3766
|
-
var type = typeof index;
|
|
3767
|
-
if (type == 'number'
|
|
3768
|
-
? (isArrayLike_1(object) && _isIndex(index, object.length))
|
|
3769
|
-
: (type == 'string' && index in object)
|
|
3770
|
-
) {
|
|
3771
|
-
return eq_1(object[index], value);
|
|
3772
|
-
}
|
|
3773
|
-
return false;
|
|
3774
|
-
}
|
|
3775
|
-
|
|
3776
|
-
var _isIterateeCall = isIterateeCall;
|
|
3777
|
-
|
|
3778
|
-
/**
|
|
3779
|
-
* Creates a function like `_.assign`.
|
|
3780
|
-
*
|
|
3781
|
-
* @private
|
|
3782
|
-
* @param {Function} assigner The function to assign values.
|
|
3783
|
-
* @returns {Function} Returns the new assigner function.
|
|
3784
|
-
*/
|
|
3785
|
-
function createAssigner(assigner) {
|
|
3786
|
-
return _baseRest(function(object, sources) {
|
|
3787
|
-
var index = -1,
|
|
3788
|
-
length = sources.length,
|
|
3789
|
-
customizer = length > 1 ? sources[length - 1] : undefined,
|
|
3790
|
-
guard = length > 2 ? sources[2] : undefined;
|
|
3791
|
-
|
|
3792
|
-
customizer = (assigner.length > 3 && typeof customizer == 'function')
|
|
3793
|
-
? (length--, customizer)
|
|
3794
|
-
: undefined;
|
|
3795
|
-
|
|
3796
|
-
if (guard && _isIterateeCall(sources[0], sources[1], guard)) {
|
|
3797
|
-
customizer = length < 3 ? undefined : customizer;
|
|
3798
|
-
length = 1;
|
|
3799
|
-
}
|
|
3800
|
-
object = Object(object);
|
|
3801
|
-
while (++index < length) {
|
|
3802
|
-
var source = sources[index];
|
|
3803
|
-
if (source) {
|
|
3804
|
-
assigner(object, source, index, customizer);
|
|
3805
|
-
}
|
|
3806
|
-
}
|
|
3807
|
-
return object;
|
|
3808
|
-
});
|
|
3809
|
-
}
|
|
3810
|
-
|
|
3811
|
-
var _createAssigner = createAssigner;
|
|
3812
|
-
|
|
3813
|
-
/**
|
|
3814
|
-
* This method is like `_.assign` except that it recursively merges own and
|
|
3815
|
-
* inherited enumerable string keyed properties of source objects into the
|
|
3816
|
-
* destination object. Source properties that resolve to `undefined` are
|
|
3817
|
-
* skipped if a destination value exists. Array and plain object properties
|
|
3818
|
-
* are merged recursively. Other objects and value types are overridden by
|
|
3819
|
-
* assignment. Source objects are applied from left to right. Subsequent
|
|
3820
|
-
* sources overwrite property assignments of previous sources.
|
|
3821
|
-
*
|
|
3822
|
-
* **Note:** This method mutates `object`.
|
|
3823
|
-
*
|
|
3824
|
-
* @static
|
|
3825
|
-
* @memberOf _
|
|
3826
|
-
* @since 0.5.0
|
|
3827
|
-
* @category Object
|
|
3828
|
-
* @param {Object} object The destination object.
|
|
3829
|
-
* @param {...Object} [sources] The source objects.
|
|
3830
|
-
* @returns {Object} Returns `object`.
|
|
3831
|
-
* @example
|
|
3832
|
-
*
|
|
3833
|
-
* var object = {
|
|
3834
|
-
* 'a': [{ 'b': 2 }, { 'd': 4 }]
|
|
3835
|
-
* };
|
|
3836
|
-
*
|
|
3837
|
-
* var other = {
|
|
3838
|
-
* 'a': [{ 'c': 3 }, { 'e': 5 }]
|
|
3839
|
-
* };
|
|
3840
|
-
*
|
|
3841
|
-
* _.merge(object, other);
|
|
3842
|
-
* // => { 'a': [{ 'b': 2, 'c': 3 }, { 'd': 4, 'e': 5 }] }
|
|
3843
|
-
*/
|
|
3844
|
-
_createAssigner(function(object, source, srcIndex) {
|
|
3845
|
-
_baseMerge(object, source, srcIndex);
|
|
3846
|
-
});
|
|
3847
|
-
|
|
3848
|
-
var style = {"list":"_IsXdU","is-popup":"_-dvpa","default-list":"_QD1Mz","is-selected-all":"_M-mOy","default-list-item":"_KtOsz","is-selected":"_TQhBB","single-checked":"_2rUrh","is-disabled":"_NbwX5","selected-all":"_vN2Fx","selected-tag":"_6oITk","select-search":"_iAH9D"};
|
|
3849
|
-
|
|
3850
|
-
const _excluded = ["children"];
|
|
3851
|
-
const SelectList = _ref => {
|
|
3852
|
-
let {
|
|
3853
|
-
children
|
|
3854
|
-
} = _ref,
|
|
3855
|
-
p = _objectWithoutPropertiesLoose(_ref, _excluded);
|
|
3856
|
-
const props = Object.assign({}, {
|
|
3857
|
-
renderItemContent: ({
|
|
3858
|
-
item
|
|
3859
|
-
}) => {
|
|
3860
|
-
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
|
|
3861
|
-
className: 'select-list-item-label'
|
|
3862
|
-
}, item.label), item.description && /*#__PURE__*/React.createElement("div", {
|
|
3863
|
-
className: 'select-list-item-description'
|
|
3864
|
-
}, item.description));
|
|
3865
|
-
},
|
|
3866
|
-
renderItem: contextProps => {
|
|
3867
|
-
const {
|
|
3868
|
-
item,
|
|
3869
|
-
props,
|
|
3870
|
-
isSelectedAll,
|
|
3871
|
-
value,
|
|
3872
|
-
onSelect,
|
|
3873
|
-
setValue,
|
|
3874
|
-
onOpenChange
|
|
3875
|
-
} = contextProps;
|
|
3876
|
-
const {
|
|
3877
|
-
single,
|
|
3878
|
-
isPopup,
|
|
3879
|
-
renderItemContent
|
|
3880
|
-
} = props;
|
|
3881
|
-
const isChecked = value.some(target => target.value === item.value);
|
|
3882
|
-
return /*#__PURE__*/React.createElement(List.Item, {
|
|
3883
|
-
className: classnames(style['default-list-item'], 'select-list-item', {
|
|
3884
|
-
[style['is-selected']]: isChecked
|
|
3885
|
-
}),
|
|
3886
|
-
key: item.value,
|
|
3887
|
-
onClick: () => {
|
|
3888
|
-
if (item.disabled) {
|
|
3889
|
-
return;
|
|
3890
|
-
}
|
|
3891
|
-
if (isSelectedAll) {
|
|
3892
|
-
return;
|
|
3893
|
-
}
|
|
3894
|
-
if (single) {
|
|
3895
|
-
setValue([item]);
|
|
3896
|
-
} else {
|
|
3897
|
-
onSelect(item);
|
|
3898
|
-
}
|
|
3899
|
-
if (isPopup && single) {
|
|
3900
|
-
onOpenChange(false);
|
|
3901
|
-
}
|
|
3902
|
-
}
|
|
3903
|
-
}, !single && /*#__PURE__*/React.createElement(Flex, null, /*#__PURE__*/React.createElement(Checkbox, {
|
|
3904
|
-
checked: isSelectedAll || isChecked,
|
|
3905
|
-
disabled: isSelectedAll || item.disabled
|
|
3906
|
-
})), /*#__PURE__*/React.createElement(Flex, {
|
|
3907
|
-
vertical: true,
|
|
3908
|
-
gag: 8,
|
|
3909
|
-
flex: 1,
|
|
3910
|
-
className: 'select-list-item-content'
|
|
3911
|
-
}, renderItemContent(contextProps)), single && /*#__PURE__*/React.createElement("div", {
|
|
3912
|
-
className: style['single-checked']
|
|
3913
|
-
}, isChecked && /*#__PURE__*/React.createElement(CheckOutlined, null)));
|
|
3914
|
-
},
|
|
3915
|
-
renderList: contextProps => {
|
|
3916
|
-
const {
|
|
3917
|
-
props,
|
|
3918
|
-
isSelectedAll,
|
|
3919
|
-
list
|
|
3920
|
-
} = contextProps;
|
|
3921
|
-
const {
|
|
3922
|
-
renderItem
|
|
3923
|
-
} = props;
|
|
3924
|
-
return /*#__PURE__*/React.createElement(List, {
|
|
3925
|
-
className: classnames(style['default-list'], {
|
|
3926
|
-
[style['is-selected-all']]: isSelectedAll
|
|
3927
|
-
}),
|
|
3928
|
-
size: "small",
|
|
3929
|
-
dataSource: list,
|
|
3930
|
-
renderItem: item => renderItem(Object.assign({}, contextProps, {
|
|
3931
|
-
item
|
|
3932
|
-
}))
|
|
3933
|
-
});
|
|
3185
|
+
return item[labelKey].indexOf(tagSearchText) > -1;
|
|
3934
3186
|
}
|
|
3935
3187
|
}, p);
|
|
3188
|
+
const bodyRef = useRef(null);
|
|
3936
3189
|
return /*#__PURE__*/React.createElement(SelectInput, props, targetProps => {
|
|
3937
3190
|
const {
|
|
3938
3191
|
props,
|
|
3939
3192
|
value,
|
|
3940
|
-
|
|
3941
|
-
|
|
3193
|
+
setValue,
|
|
3194
|
+
onSelect,
|
|
3195
|
+
onRemove,
|
|
3196
|
+
onOpenChange
|
|
3942
3197
|
} = targetProps;
|
|
3943
3198
|
const {
|
|
3944
|
-
|
|
3945
|
-
|
|
3199
|
+
filterRender,
|
|
3200
|
+
columns,
|
|
3201
|
+
options,
|
|
3946
3202
|
getSearchCallback,
|
|
3947
|
-
|
|
3948
|
-
|
|
3949
|
-
|
|
3203
|
+
getTagSearchCallback,
|
|
3204
|
+
api,
|
|
3205
|
+
selectedAllValue,
|
|
3206
|
+
isPopup,
|
|
3207
|
+
locale,
|
|
3950
3208
|
single,
|
|
3209
|
+
maxLength,
|
|
3210
|
+
getSearchProps,
|
|
3211
|
+
searchPlaceholder,
|
|
3951
3212
|
allowSelectedAll,
|
|
3952
|
-
|
|
3953
|
-
|
|
3954
|
-
options,
|
|
3955
|
-
renderList,
|
|
3956
|
-
selectedAllValue
|
|
3213
|
+
labelKey,
|
|
3214
|
+
valueKey
|
|
3957
3215
|
} = props;
|
|
3958
|
-
const
|
|
3959
|
-
|
|
3960
|
-
|
|
3961
|
-
|
|
3962
|
-
|
|
3963
|
-
|
|
3964
|
-
|
|
3965
|
-
|
|
3966
|
-
|
|
3967
|
-
|
|
3968
|
-
|
|
3969
|
-
|
|
3216
|
+
const isSelectedAll = computedIsSelectAll(value, selectedAllValue, valueKey);
|
|
3217
|
+
return /*#__PURE__*/React.createElement(Row, {
|
|
3218
|
+
wrap: false,
|
|
3219
|
+
ref: bodyRef
|
|
3220
|
+
}, /*#__PURE__*/React.createElement(Col, {
|
|
3221
|
+
span: single ? 24 : 16
|
|
3222
|
+
}, /*#__PURE__*/React.createElement("div", null, filterRender(Object.assign({}, targetProps, {
|
|
3223
|
+
filter,
|
|
3224
|
+
setFilter
|
|
3225
|
+
}))), /*#__PURE__*/React.createElement(Row, {
|
|
3226
|
+
wrap: false,
|
|
3227
|
+
className: classnames(style['header'], 'select-table-list-header')
|
|
3228
|
+
}, !single && /*#__PURE__*/React.createElement(Col, {
|
|
3229
|
+
className: classnames(style['col'], 'select-table-list-col')
|
|
3230
|
+
}, allowSelectedAll ? /*#__PURE__*/React.createElement(Checkbox, {
|
|
3231
|
+
checked: isSelectedAll,
|
|
3232
|
+
onChange: e => {
|
|
3233
|
+
const checked = e.target.checked;
|
|
3234
|
+
if (!checked) {
|
|
3235
|
+
setValue([]);
|
|
3236
|
+
} else {
|
|
3237
|
+
setValue([selectedAllValue]);
|
|
3238
|
+
}
|
|
3239
|
+
}
|
|
3240
|
+
}) : /*#__PURE__*/React.createElement(Checkbox, {
|
|
3241
|
+
style: {
|
|
3242
|
+
visibility: 'hidden'
|
|
3243
|
+
}
|
|
3244
|
+
})), /*#__PURE__*/React.createElement(Col, {
|
|
3245
|
+
flex: 1
|
|
3246
|
+
}, /*#__PURE__*/React.createElement(Row, {
|
|
3247
|
+
wrap: false
|
|
3248
|
+
}, columns.map(column => {
|
|
3249
|
+
const {
|
|
3250
|
+
name,
|
|
3251
|
+
title,
|
|
3252
|
+
span
|
|
3253
|
+
} = column;
|
|
3254
|
+
return /*#__PURE__*/React.createElement(Col, {
|
|
3255
|
+
key: name,
|
|
3256
|
+
span: span,
|
|
3257
|
+
className: classnames(style['col'], 'select-table-list-col')
|
|
3258
|
+
}, title);
|
|
3259
|
+
})))), /*#__PURE__*/React.createElement(FetchScrollLoader, _extends({}, props, {
|
|
3260
|
+
className: classnames(style['list'], 'select-table-list-scroll-list', {
|
|
3261
|
+
'is-popup': isPopup
|
|
3970
3262
|
}),
|
|
3971
|
-
|
|
3972
|
-
|
|
3973
|
-
|
|
3974
|
-
|
|
3975
|
-
|
|
3976
|
-
|
|
3977
|
-
|
|
3978
|
-
|
|
3979
|
-
|
|
3980
|
-
|
|
3981
|
-
|
|
3982
|
-
api: Object.assign({}, options ? {
|
|
3983
|
-
data: {
|
|
3263
|
+
searchProps: filter,
|
|
3264
|
+
getSearchProps: getSearchProps,
|
|
3265
|
+
api: Object.assign({}, options ? {
|
|
3266
|
+
data: {
|
|
3267
|
+
options,
|
|
3268
|
+
filter
|
|
3269
|
+
},
|
|
3270
|
+
loader: ({
|
|
3271
|
+
data
|
|
3272
|
+
}) => {
|
|
3273
|
+
const {
|
|
3984
3274
|
options,
|
|
3985
|
-
|
|
3986
|
-
}
|
|
3987
|
-
|
|
3988
|
-
|
|
3989
|
-
}) => {
|
|
3990
|
-
console.log(data);
|
|
3991
|
-
const {
|
|
3992
|
-
options,
|
|
3993
|
-
searchText
|
|
3994
|
-
} = data;
|
|
3995
|
-
if (typeof getSearchCallback === 'function') {
|
|
3996
|
-
const newOptions = options.filter(item => getSearchCallback(searchText, item));
|
|
3997
|
-
return {
|
|
3998
|
-
pageData: newOptions
|
|
3999
|
-
};
|
|
4000
|
-
}
|
|
3275
|
+
filter
|
|
3276
|
+
} = data;
|
|
3277
|
+
if (typeof getSearchCallback === 'function') {
|
|
3278
|
+
const newOptions = options.filter(item => getSearchCallback(filter, item, targetProps));
|
|
4001
3279
|
return {
|
|
4002
|
-
pageData:
|
|
3280
|
+
pageData: newOptions
|
|
4003
3281
|
};
|
|
4004
3282
|
}
|
|
4005
|
-
|
|
4006
|
-
|
|
4007
|
-
|
|
4008
|
-
|
|
4009
|
-
|
|
4010
|
-
|
|
4011
|
-
|
|
4012
|
-
|
|
4013
|
-
|
|
4014
|
-
|
|
4015
|
-
|
|
4016
|
-
}
|
|
4017
|
-
|
|
4018
|
-
|
|
4019
|
-
|
|
4020
|
-
|
|
4021
|
-
|
|
4022
|
-
|
|
4023
|
-
|
|
4024
|
-
|
|
4025
|
-
|
|
3283
|
+
return {
|
|
3284
|
+
pageData: options
|
|
3285
|
+
};
|
|
3286
|
+
}
|
|
3287
|
+
} : api)
|
|
3288
|
+
}), fetchProps => {
|
|
3289
|
+
const {
|
|
3290
|
+
list
|
|
3291
|
+
} = fetchProps;
|
|
3292
|
+
const contextProps = Object.assign({}, fetchProps, targetProps, {
|
|
3293
|
+
isSelectedAll
|
|
3294
|
+
});
|
|
3295
|
+
return list.map(item => {
|
|
3296
|
+
const isChecked = value.some(target => target[valueKey] === item[valueKey]);
|
|
3297
|
+
return /*#__PURE__*/React.createElement(Row, {
|
|
3298
|
+
wrap: false,
|
|
3299
|
+
key: item[valueKey],
|
|
3300
|
+
className: classnames(style['body'], 'select-table-list-body', [{
|
|
3301
|
+
[style['is-selected-all']]: isSelectedAll,
|
|
3302
|
+
[style['is-selected']]: isChecked,
|
|
3303
|
+
[style['is-disabled']]: item.disabled
|
|
3304
|
+
}]),
|
|
3305
|
+
onClick: () => {
|
|
3306
|
+
if (item.disabled) {
|
|
3307
|
+
return;
|
|
3308
|
+
}
|
|
3309
|
+
if (isSelectedAll) {
|
|
3310
|
+
return;
|
|
3311
|
+
}
|
|
3312
|
+
if (single) {
|
|
3313
|
+
setValue([item]);
|
|
3314
|
+
} else {
|
|
3315
|
+
onSelect(item);
|
|
3316
|
+
}
|
|
3317
|
+
if (isPopup && single) {
|
|
3318
|
+
onOpenChange(false);
|
|
3319
|
+
}
|
|
3320
|
+
}
|
|
3321
|
+
}, !single && /*#__PURE__*/React.createElement(Col, {
|
|
3322
|
+
className: classnames(style['col'], 'select-table-list-col')
|
|
3323
|
+
}, /*#__PURE__*/React.createElement(Checkbox, {
|
|
3324
|
+
disabled: item.disabled || isSelectedAll,
|
|
3325
|
+
checked: isSelectedAll || isChecked
|
|
3326
|
+
})), /*#__PURE__*/React.createElement(Col, {
|
|
3327
|
+
flex: 1
|
|
3328
|
+
}, /*#__PURE__*/React.createElement(Row, {
|
|
3329
|
+
wrap: false
|
|
3330
|
+
}, columns.map(column => {
|
|
3331
|
+
const {
|
|
3332
|
+
name,
|
|
3333
|
+
span,
|
|
3334
|
+
getValueOf
|
|
3335
|
+
} = column;
|
|
3336
|
+
return /*#__PURE__*/React.createElement(Col, {
|
|
3337
|
+
key: name,
|
|
3338
|
+
span: span,
|
|
3339
|
+
className: classnames(style['col'], 'select-table-list-col')
|
|
3340
|
+
}, typeof getValueOf === 'function' ? getValueOf(item, contextProps) : get_1(item, name));
|
|
3341
|
+
}))), single && /*#__PURE__*/React.createElement(Col, {
|
|
3342
|
+
className: classnames(style['col'], style['single-checked'], 'select-table-list-col')
|
|
3343
|
+
}, isChecked && /*#__PURE__*/React.createElement(CheckOutlined, null)));
|
|
3344
|
+
});
|
|
3345
|
+
})), !single && /*#__PURE__*/React.createElement(Col, {
|
|
3346
|
+
className: classnames(style['right-options']),
|
|
3347
|
+
span: 8
|
|
3348
|
+
}, /*#__PURE__*/React.createElement(SearchInput, {
|
|
3349
|
+
className: style['tags-search'],
|
|
3350
|
+
placeholder: searchPlaceholder,
|
|
3351
|
+
value: tagSearchText,
|
|
3352
|
+
onSearch: value => {
|
|
3353
|
+
setTagSearchText(value);
|
|
3354
|
+
},
|
|
3355
|
+
showSearchButton: false
|
|
3356
|
+
}), /*#__PURE__*/React.createElement(Row, {
|
|
3357
|
+
wrap: false,
|
|
3358
|
+
justify: 'space-between',
|
|
3359
|
+
align: 'middle'
|
|
3360
|
+
}, /*#__PURE__*/React.createElement(Col, null, locale.selected, value.length > 0 && `(${value.length}${Number.isInteger(maxLength) ? `/${maxLength}` : ''})`, ":"), /*#__PURE__*/React.createElement(Col, null, /*#__PURE__*/React.createElement(Button, {
|
|
3361
|
+
className: style['no-padding-btn'],
|
|
3362
|
+
type: "link",
|
|
3363
|
+
onClick: () => {
|
|
3364
|
+
setValue([]);
|
|
3365
|
+
}
|
|
3366
|
+
}, "\u79FB\u9664\u5168\u90E8"))), /*#__PURE__*/React.createElement(SimpleBar, null, /*#__PURE__*/React.createElement(Flex, {
|
|
3367
|
+
wrap: true,
|
|
3368
|
+
gap: 8
|
|
3369
|
+
}, value.filter(item => getTagSearchCallback(tagSearchText, item, targetProps)).map(item => {
|
|
3370
|
+
return /*#__PURE__*/React.createElement(Tag, {
|
|
3371
|
+
className: style['tag'],
|
|
3372
|
+
key: item[valueKey],
|
|
3373
|
+
closable: true,
|
|
3374
|
+
bordered: false,
|
|
3375
|
+
onClose: e => {
|
|
3376
|
+
e.preventDefault();
|
|
3377
|
+
onRemove(item);
|
|
3378
|
+
}
|
|
3379
|
+
}, /*#__PURE__*/React.createElement(Popover, {
|
|
3380
|
+
getPopupContainer: () => bodyRef.current,
|
|
3381
|
+
content: /*#__PURE__*/React.createElement(Row, {
|
|
3382
|
+
className: style['descriptions']
|
|
3383
|
+
}, columns.map(({
|
|
3384
|
+
name,
|
|
3385
|
+
title,
|
|
3386
|
+
getValueOf
|
|
3387
|
+
}) => {
|
|
3388
|
+
return /*#__PURE__*/React.createElement(Fragment, {
|
|
3389
|
+
key: name
|
|
3390
|
+
}, /*#__PURE__*/React.createElement(Col, {
|
|
3391
|
+
span: 8,
|
|
3392
|
+
className: style['descriptions-col-label']
|
|
3393
|
+
}, title), /*#__PURE__*/React.createElement(Col, {
|
|
3394
|
+
className: style['descriptions-col-content'],
|
|
3395
|
+
span: 16
|
|
3396
|
+
}, typeof getValueOf === 'function' ? getValueOf(item, targetProps) : get_1(item, name)));
|
|
3397
|
+
}))
|
|
3398
|
+
}, /*#__PURE__*/React.createElement("span", {
|
|
3399
|
+
className: style['tag-inner']
|
|
3400
|
+
}, item[labelKey])));
|
|
3401
|
+
})))));
|
|
4026
3402
|
});
|
|
4027
3403
|
};
|
|
4028
3404
|
|
|
4029
|
-
export { SelectInput, SelectedAll, SelectedTagList, SelectList as default };
|
|
3405
|
+
export { SelectInput, SelectTableList, SelectedAll, SelectedTagList, SelectList as default };
|
|
4030
3406
|
//# sourceMappingURL=index.modern.js.map
|