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