linkmore-design 1.1.28-alpha.5 → 1.1.28-alpha.7

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.umd.js CHANGED
@@ -293774,9 +293774,9 @@
293774
293774
  var _cloneDeep;
293775
293775
 
293776
293776
  var cloneCol = (_cloneDeep = lodash.cloneDeep(localColumns)) === null || _cloneDeep === void 0 ? void 0 : _cloneDeep.filter(function (item) {
293777
- var _item$title;
293777
+ var _item$title, _item$title2;
293778
293778
 
293779
- return lodash.isFunction(item.title) ? false : ((_item$title = item.title) === null || _item$title === void 0 ? void 0 : _item$title.indexOf(searchValue)) > -1;
293779
+ return lodash.isFunction(item.title) || ((_item$title = item.title) === null || _item$title === void 0 ? void 0 : _item$title.$$typeof) ? true : ((_item$title2 = item.title) === null || _item$title2 === void 0 ? void 0 : _item$title2.indexOf(searchValue)) > -1;
293780
293780
  });
293781
293781
  cloneCol.forEach(function (item, index) {
293782
293782
  if (colStateValue === null || colStateValue === void 0 ? void 0 : colStateValue.hasOwnProperty(item.dataIndex)) {
@@ -293940,7 +293940,6 @@
293940
293940
  }
293941
293941
  };
293942
293942
  });
293943
- console.log(sortMenu, 'sortMenu');
293944
293943
  return /*#__PURE__*/React__default['default'].createElement("div", {
293945
293944
  className: "lm_custom_option_columns"
293946
293945
  }, /*#__PURE__*/React__default['default'].createElement("div", {
@@ -313337,9 +313336,9 @@
313337
313336
  return lodash.keyBy(deepDataSource, rowKey);
313338
313337
  }
313339
313338
  function isExpandRow(children) {
313340
- var _children$, _children$$props, _children$$props$chil, _children$$props$chil2, _children$$props$chil3;
313339
+ var _children$, _children$$props, _children$$props$chil, _children$$props$chil2, _children$$props$chil3, _children$2, _children$2$props, _children$2$props$chi, _children$2$props$chi2, _children$2$props$chi3, _children$2$props$chi4;
313341
313340
 
313342
- return ['Collapse row', 'Expand row'].includes(children === null || children === void 0 ? void 0 : (_children$ = children[0]) === null || _children$ === void 0 ? void 0 : (_children$$props = _children$.props) === null || _children$$props === void 0 ? void 0 : (_children$$props$chil = _children$$props.children) === null || _children$$props$chil === void 0 ? void 0 : (_children$$props$chil2 = _children$$props$chil[1]) === null || _children$$props$chil2 === void 0 ? void 0 : (_children$$props$chil3 = _children$$props$chil2.props) === null || _children$$props$chil3 === void 0 ? void 0 : _children$$props$chil3['aria-label']);
313341
+ return ['Collapse row', 'Expand row'].includes(children === null || children === void 0 ? void 0 : (_children$ = children[0]) === null || _children$ === void 0 ? void 0 : (_children$$props = _children$.props) === null || _children$$props === void 0 ? void 0 : (_children$$props$chil = _children$$props.children) === null || _children$$props$chil === void 0 ? void 0 : (_children$$props$chil2 = _children$$props$chil[1]) === null || _children$$props$chil2 === void 0 ? void 0 : (_children$$props$chil3 = _children$$props$chil2.props) === null || _children$$props$chil3 === void 0 ? void 0 : _children$$props$chil3['aria-label']) || (children === null || children === void 0 ? void 0 : (_children$2 = children[0]) === null || _children$2 === void 0 ? void 0 : (_children$2$props = _children$2.props) === null || _children$2$props === void 0 ? void 0 : (_children$2$props$chi = _children$2$props.children) === null || _children$2$props$chi === void 0 ? void 0 : (_children$2$props$chi2 = _children$2$props$chi[1]) === null || _children$2$props$chi2 === void 0 ? void 0 : (_children$2$props$chi3 = _children$2$props$chi2.props) === null || _children$2$props$chi3 === void 0 ? void 0 : (_children$2$props$chi4 = _children$2$props$chi3.className) === null || _children$2$props$chi4 === void 0 ? void 0 : _children$2$props$chi4.indexOf('ant-table-row-expand-icon')) > -1;
313343
313342
  }
313344
313343
  function checkRowKeyByDataSource(dataSource, rowKey) {
313345
313344
  var addRowKey = function addRowKey(children, pkey) {
@@ -313368,9 +313367,9 @@
313368
313367
  return res || [];
313369
313368
  }
313370
313369
  function getExpandStatus(children) {
313371
- var _children$2, _children$2$props, _children$2$props$chi, _children$2$props$chi2, _children$2$props$chi3;
313370
+ var _children$3, _children$3$props, _children$3$props$chi, _children$3$props$chi2, _children$3$props$chi3;
313372
313371
 
313373
- return isExpandRow(children) ? children === null || children === void 0 ? void 0 : (_children$2 = children[0]) === null || _children$2 === void 0 ? void 0 : (_children$2$props = _children$2.props) === null || _children$2$props === void 0 ? void 0 : (_children$2$props$chi = _children$2$props.children) === null || _children$2$props$chi === void 0 ? void 0 : (_children$2$props$chi2 = _children$2$props$chi[1]) === null || _children$2$props$chi2 === void 0 ? void 0 : (_children$2$props$chi3 = _children$2$props$chi2.props) === null || _children$2$props$chi3 === void 0 ? void 0 : _children$2$props$chi3['aria-label'] : '';
313372
+ return isExpandRow(children) ? children === null || children === void 0 ? void 0 : (_children$3 = children[0]) === null || _children$3 === void 0 ? void 0 : (_children$3$props = _children$3.props) === null || _children$3$props === void 0 ? void 0 : (_children$3$props$chi = _children$3$props.children) === null || _children$3$props$chi === void 0 ? void 0 : (_children$3$props$chi2 = _children$3$props$chi[1]) === null || _children$3$props$chi2 === void 0 ? void 0 : (_children$3$props$chi3 = _children$3$props$chi2.props) === null || _children$3$props$chi3 === void 0 ? void 0 : _children$3$props$chi3['aria-label'] : '';
313374
313373
  }
313375
313374
  function checkMemoShouldUploadSpecialFun(prev, next) {
313376
313375
  var _prevCol$componentPro, _nextCol$componentPro, _prevCol$componentPro2, _nextCol$componentPro2, _prevCol$componentPro3, _nextCol$componentPro3, _prevCol$componentPro4, _nextCol$componentPro4, _prevCol$componentPro5, _nextCol$componentPro5, _next$className, _prevCol$componentPro6, _nextCol$componentPro6;
@@ -314280,7 +314279,13 @@
314280
314279
  onClick: toggleEdit
314281
314280
  }, childNode);
314282
314281
  } else if (isEdit && editable) {
314283
- childNode = /*#__PURE__*/React__default['default'].createElement(React__default['default'].Fragment, null, isExpandRow(childNode) && childNode[0], /*#__PURE__*/React__default['default'].createElement(Form$4.Item, _objectSpread(_objectSpread({
314282
+ childNode = /*#__PURE__*/React__default['default'].createElement("div", {
314283
+ style: {
314284
+ display: 'flex',
314285
+ flexDirection: 'row',
314286
+ flexWrap: 'nowrap'
314287
+ }
314288
+ }, isExpandRow(childNode) && childNode[0], /*#__PURE__*/React__default['default'].createElement(Form$4.Item, _objectSpread(_objectSpread({
314284
314289
  errorPlacement: "right",
314285
314290
  valuePropName: editable === 'switch' ? 'checked' : 'value',
314286
314291
  style: {
@@ -314292,7 +314297,13 @@
314292
314297
  }), Control(editable)));
314293
314298
 
314294
314299
  if (editable === 'input' && ((resultComponentProps === null || resultComponentProps === void 0 ? void 0 : resultComponentProps.addonBefore) || (resultComponentProps === null || resultComponentProps === void 0 ? void 0 : resultComponentProps.addonAfter))) {
314295
- childNode = /*#__PURE__*/React__default['default'].createElement(React__default['default'].Fragment, null, isExpandRow(childNode) && childNode[0], /*#__PURE__*/React__default['default'].createElement(Form$4.Item, _objectSpread(_objectSpread({
314300
+ childNode = /*#__PURE__*/React__default['default'].createElement("div", {
314301
+ style: {
314302
+ display: 'flex',
314303
+ flexDirection: 'row',
314304
+ flexWrap: 'nowrap'
314305
+ }
314306
+ }, isExpandRow(childNode) && childNode[0], /*#__PURE__*/React__default['default'].createElement(Form$4.Item, _objectSpread(_objectSpread({
314296
314307
  errorPlacement: "right",
314297
314308
  style: {
314298
314309
  margin: 0
@@ -314498,80 +314509,7 @@
314498
314509
  draft.push(_objectSpread(_defineProperty$1({}, _rowKey, "".concat(Date.now())), addDataInfo || {}));
314499
314510
  });
314500
314511
  setDataSource(res);
314501
- }, 40);
314502
-
314503
- var handleSave = function handleSave(row, options) {
314504
- var _deepDataSourceRef$cu, _deepDataSourceRef$cu2;
314505
-
314506
- var preKeys = deepDataSourceRef === null || deepDataSourceRef === void 0 ? void 0 : (_deepDataSourceRef$cu = deepDataSourceRef.current) === null || _deepDataSourceRef$cu === void 0 ? void 0 : (_deepDataSourceRef$cu2 = _deepDataSourceRef$cu[row[_rowKey]]) === null || _deepDataSourceRef$cu2 === void 0 ? void 0 : _deepDataSourceRef$cu2.preKeys;
314507
- var res = fn(dataSourceRef.current, function (draft) {
314508
- if (options === null || options === void 0 ? void 0 : options.only) {
314509
- var _options$only = options === null || options === void 0 ? void 0 : options.only,
314510
- key = _options$only.key,
314511
- value = _options$only.value;
314512
-
314513
- if ((preKeys === null || preKeys === void 0 ? void 0 : preKeys.length) > 1) {
314514
- var deeps = function deeps(children) {
314515
- children === null || children === void 0 ? void 0 : children.forEach(function (item) {
314516
- if (preKeys.includes(item[_rowKey])) {
314517
- if (item[_rowKey] === row[_rowKey]) {
314518
- var _Object$keys;
314519
-
314520
- children === null || children === void 0 ? void 0 : children.forEach(function (c) {
314521
- c[key] = value;
314522
- });
314523
- (_Object$keys = Object.keys(item)) === null || _Object$keys === void 0 ? void 0 : _Object$keys.forEach(function (v) {
314524
- item[v] = row[v] || item[v];
314525
- });
314526
- } else if (item.children) {
314527
- deeps(item.children);
314528
- }
314529
- }
314530
- });
314531
- };
314532
-
314533
- deeps(draft);
314534
- } else {
314535
- draft === null || draft === void 0 ? void 0 : draft.forEach(function (item, index) {
314536
- if (row[_rowKey] === item[_rowKey]) {
314537
- draft[index] = row;
314538
- } else {
314539
- draft[index][key] = value;
314540
- }
314541
- });
314542
- }
314543
- } else {
314544
- if ((preKeys === null || preKeys === void 0 ? void 0 : preKeys.length) > 1) {
314545
- var _deeps = function _deeps(children) {
314546
- children === null || children === void 0 ? void 0 : children.forEach(function (item) {
314547
- if (preKeys.includes(item[_rowKey])) {
314548
- if (item[_rowKey] === row[_rowKey]) {
314549
- var _Object$keys2;
314550
-
314551
- (_Object$keys2 = Object.keys(row)) === null || _Object$keys2 === void 0 ? void 0 : _Object$keys2.forEach(function (v) {
314552
- item[v] = row[v] || item[v];
314553
- });
314554
- } else if (item.children) {
314555
- _deeps(item.children);
314556
- }
314557
- }
314558
- });
314559
- };
314560
-
314561
- _deeps(draft);
314562
- } else {
314563
- var index = draft.findIndex(function (item) {
314564
- return row[_rowKey] === item[_rowKey];
314565
- });
314566
-
314567
- if (index !== -1) {
314568
- draft[index] = row;
314569
- }
314570
- }
314571
- }
314572
- });
314573
- setDataSource(res);
314574
- }; // const reWriteOriginSource = (rowKey: string, rowValue, dataIndex: number, nextValue) => {
314512
+ }, 40); // const reWriteOriginSource = (rowKey: string, rowValue, dataIndex: number, nextValue) => {
314575
314513
  // setDataSource((prevDataSource) => {
314576
314514
  // return prevDataSource?.map((item) => {
314577
314515
  // if (get(item, rowKey) === rowValue) {
@@ -314585,12 +314523,11 @@
314585
314523
 
314586
314524
  /** 删除当前行 */
314587
314525
 
314588
-
314589
314526
  var handleTableRowDelete = lodash.debounce(function (key) {
314590
- var _deepDataSourceRef$cu3, _deepDataSourceRef$cu4;
314527
+ var _deepDataSourceRef$cu, _deepDataSourceRef$cu2;
314591
314528
 
314592
314529
  var rkey = lodash.isObject(key) ? key[_rowKey] : key;
314593
- var preKeys = deepDataSourceRef === null || deepDataSourceRef === void 0 ? void 0 : (_deepDataSourceRef$cu3 = deepDataSourceRef.current) === null || _deepDataSourceRef$cu3 === void 0 ? void 0 : (_deepDataSourceRef$cu4 = _deepDataSourceRef$cu3[rkey]) === null || _deepDataSourceRef$cu4 === void 0 ? void 0 : _deepDataSourceRef$cu4.preKeys;
314530
+ var preKeys = deepDataSourceRef === null || deepDataSourceRef === void 0 ? void 0 : (_deepDataSourceRef$cu = deepDataSourceRef.current) === null || _deepDataSourceRef$cu === void 0 ? void 0 : (_deepDataSourceRef$cu2 = _deepDataSourceRef$cu[rkey]) === null || _deepDataSourceRef$cu2 === void 0 ? void 0 : _deepDataSourceRef$cu2.preKeys;
314594
314531
 
314595
314532
  if (preKeys.length > 1) {
314596
314533
  /** 说明删除的是children中的数据 */
@@ -314638,10 +314575,10 @@
314638
314575
  /** 替换当前行 */
314639
314576
 
314640
314577
  var handleTableRowReplace = lodash.debounce(function (record, defaultRecord) {
314641
- var _deepDataSourceRef$cu5, _deepDataSourceRef$cu6;
314578
+ var _deepDataSourceRef$cu3, _deepDataSourceRef$cu4;
314642
314579
 
314643
314580
  var rkey = lodash.isObject(record) ? record[_rowKey] : record;
314644
- var preKeys = deepDataSourceRef === null || deepDataSourceRef === void 0 ? void 0 : (_deepDataSourceRef$cu5 = deepDataSourceRef.current) === null || _deepDataSourceRef$cu5 === void 0 ? void 0 : (_deepDataSourceRef$cu6 = _deepDataSourceRef$cu5[rkey]) === null || _deepDataSourceRef$cu6 === void 0 ? void 0 : _deepDataSourceRef$cu6.preKeys; // const res = cloneDeep(dataSourceRef.current)
314581
+ var preKeys = deepDataSourceRef === null || deepDataSourceRef === void 0 ? void 0 : (_deepDataSourceRef$cu3 = deepDataSourceRef.current) === null || _deepDataSourceRef$cu3 === void 0 ? void 0 : (_deepDataSourceRef$cu4 = _deepDataSourceRef$cu3[rkey]) === null || _deepDataSourceRef$cu4 === void 0 ? void 0 : _deepDataSourceRef$cu4.preKeys; // const res = cloneDeep(dataSourceRef.current)
314645
314582
 
314646
314583
  var deep = function deep(children) {
314647
314584
  return children.map(function (item) {
@@ -314660,14 +314597,14 @@
314660
314597
 
314661
314598
  var res = deep(dataSourceRef.current);
314662
314599
  setDataSource(res);
314663
- }, 40);
314600
+ }, 20);
314664
314601
  /** 快捷添加 */
314665
314602
 
314666
314603
  var handleTableRowAdd = lodash.debounce(function (record, isAppendInChindren, defaultRecord) {
314667
- var _deepDataSourceRef$cu7, _deepDataSourceRef$cu8;
314604
+ var _deepDataSourceRef$cu5, _deepDataSourceRef$cu6;
314668
314605
 
314669
314606
  var rkey = lodash.isObject(record) ? record[_rowKey] : record;
314670
- var preKeys = deepDataSourceRef === null || deepDataSourceRef === void 0 ? void 0 : (_deepDataSourceRef$cu7 = deepDataSourceRef.current) === null || _deepDataSourceRef$cu7 === void 0 ? void 0 : (_deepDataSourceRef$cu8 = _deepDataSourceRef$cu7[rkey]) === null || _deepDataSourceRef$cu8 === void 0 ? void 0 : _deepDataSourceRef$cu8.preKeys;
314607
+ var preKeys = deepDataSourceRef === null || deepDataSourceRef === void 0 ? void 0 : (_deepDataSourceRef$cu5 = deepDataSourceRef.current) === null || _deepDataSourceRef$cu5 === void 0 ? void 0 : (_deepDataSourceRef$cu6 = _deepDataSourceRef$cu5[rkey]) === null || _deepDataSourceRef$cu6 === void 0 ? void 0 : _deepDataSourceRef$cu6.preKeys;
314671
314608
  var res = fn(dataSourceRef.current, function (draft) {
314672
314609
  if ((preKeys === null || preKeys === void 0 ? void 0 : preKeys.length) > 1) {
314673
314610
  var deeps = function deeps(children) {
@@ -314745,8 +314682,87 @@
314745
314682
  });
314746
314683
  setDataSource(res);
314747
314684
  }, 50);
314685
+
314686
+ var handleSave = function handleSave(row, options) {
314687
+ var _deepDataSourceRef$cu7, _deepDataSourceRef$cu8;
314688
+
314689
+ var preKeys = deepDataSourceRef === null || deepDataSourceRef === void 0 ? void 0 : (_deepDataSourceRef$cu7 = deepDataSourceRef.current) === null || _deepDataSourceRef$cu7 === void 0 ? void 0 : (_deepDataSourceRef$cu8 = _deepDataSourceRef$cu7[row[_rowKey]]) === null || _deepDataSourceRef$cu8 === void 0 ? void 0 : _deepDataSourceRef$cu8.preKeys;
314690
+
314691
+ if (options === null || options === void 0 ? void 0 : options.only) {
314692
+ var res = fn(dataSourceRef.current, function (draft) {
314693
+ if (options === null || options === void 0 ? void 0 : options.only) {
314694
+ var _options$only = options === null || options === void 0 ? void 0 : options.only,
314695
+ key = _options$only.key,
314696
+ value = _options$only.value;
314697
+
314698
+ if ((preKeys === null || preKeys === void 0 ? void 0 : preKeys.length) > 1) {
314699
+ var deeps = function deeps(children) {
314700
+ children === null || children === void 0 ? void 0 : children.forEach(function (item) {
314701
+ if (preKeys.includes(item[_rowKey])) {
314702
+ if (item[_rowKey] === row[_rowKey]) {
314703
+ var _Object$keys;
314704
+
314705
+ children === null || children === void 0 ? void 0 : children.forEach(function (c) {
314706
+ c[key] = value;
314707
+ });
314708
+ (_Object$keys = Object.keys(item)) === null || _Object$keys === void 0 ? void 0 : _Object$keys.forEach(function (v) {
314709
+ item[v] = row[v] || item[v];
314710
+ });
314711
+ } else if (item.children) {
314712
+ deeps(item.children);
314713
+ }
314714
+ }
314715
+ });
314716
+ };
314717
+
314718
+ deeps(draft);
314719
+ } else {
314720
+ draft === null || draft === void 0 ? void 0 : draft.forEach(function (item, index) {
314721
+ if (row[_rowKey] === item[_rowKey]) {
314722
+ draft[index] = row;
314723
+ } else {
314724
+ draft[index][key] = value;
314725
+ }
314726
+ });
314727
+ }
314728
+ } else {
314729
+ if ((preKeys === null || preKeys === void 0 ? void 0 : preKeys.length) > 1) {
314730
+ var _deeps = function _deeps(children) {
314731
+ children === null || children === void 0 ? void 0 : children.forEach(function (item) {
314732
+ if (preKeys.includes(item[_rowKey])) {
314733
+ if (item[_rowKey] === row[_rowKey]) {
314734
+ var _Object$keys2;
314735
+
314736
+ (_Object$keys2 = Object.keys(row)) === null || _Object$keys2 === void 0 ? void 0 : _Object$keys2.forEach(function (v) {
314737
+ item[v] = row[v] || item[v];
314738
+ });
314739
+ } else if (item.children) {
314740
+ _deeps(item.children);
314741
+ }
314742
+ }
314743
+ });
314744
+ };
314745
+
314746
+ _deeps(draft);
314747
+ } else {
314748
+ var index = draft.findIndex(function (item) {
314749
+ return row[_rowKey] === item[_rowKey];
314750
+ });
314751
+
314752
+ if (index !== -1) {
314753
+ draft[index] = row;
314754
+ }
314755
+ }
314756
+ }
314757
+ });
314758
+ setDataSource(res);
314759
+ } else {
314760
+ handleTableRowReplace(row[_rowKey], row);
314761
+ }
314762
+ };
314748
314763
  /** 快捷刷子功能 */
314749
314764
 
314765
+
314750
314766
  var handleCopy = function handleCopy(key, value, type, rowIndex) {
314751
314767
  var res = fn(dataSourceRef.current, function (draft) {
314752
314768
  draft === null || draft === void 0 ? void 0 : draft.forEach(function (item, index) {
@@ -315356,6 +315372,29 @@
315356
315372
  };
315357
315373
  }
315358
315374
  }, []);
315375
+ var checkFormItem = React.useMemo(function () {
315376
+ var arr = [];
315377
+ columns.forEach(function (item) {
315378
+ if (item.children) {
315379
+ var _item$children3;
315380
+
315381
+ (_item$children3 = item.children) === null || _item$children3 === void 0 ? void 0 : _item$children3.forEach(function (c) {
315382
+ arr.push( /*#__PURE__*/React__default['default'].createElement(Form$4.Item, _objectSpread({
315383
+ noStyle: true,
315384
+ key: c.dataIndex,
315385
+ name: c.dataIndex
315386
+ }, (c === null || c === void 0 ? void 0 : c['formProps']) || {}), c.dataIndex || 'text'));
315387
+ });
315388
+ } else {
315389
+ arr.push( /*#__PURE__*/React__default['default'].createElement(Form$4.Item, _objectSpread({
315390
+ noStyle: true,
315391
+ key: item.dataIndex,
315392
+ name: item.dataIndex
315393
+ }, (item === null || item === void 0 ? void 0 : item['formProps']) || {}), item.dataIndex || 'text'));
315394
+ }
315395
+ });
315396
+ return arr;
315397
+ }, [columns]);
315359
315398
 
315360
315399
  if (colSortOpen) {
315361
315400
  var _localRowSelectList$s;
@@ -315407,13 +315446,7 @@
315407
315446
  }, /*#__PURE__*/React__default['default'].createElement(Form$4, {
315408
315447
  form: checkForm,
315409
315448
  component: false
315410
- }, columns.map(function (item) {
315411
- return /*#__PURE__*/React__default['default'].createElement(Form$4.Item, _objectSpread({
315412
- noStyle: true,
315413
- key: item.dataIndex,
315414
- name: item.dataIndex
315415
- }, (item === null || item === void 0 ? void 0 : item['formProps']) || {}), item.dataIndex || 'text');
315416
- }))));
315449
+ }, checkFormItem)));
315417
315450
  } // @ts-ignore
315418
315451
 
315419
315452
 
@@ -315473,13 +315506,7 @@
315473
315506
  }, /*#__PURE__*/React__default['default'].createElement(Form$4, {
315474
315507
  form: checkForm,
315475
315508
  component: false
315476
- }, columns.map(function (item) {
315477
- return /*#__PURE__*/React__default['default'].createElement(Form$4.Item, _objectSpread({
315478
- noStyle: true,
315479
- key: item.dataIndex,
315480
- name: item.dataIndex
315481
- }, (item === null || item === void 0 ? void 0 : item['formProps']) || {}), item.dataIndex || 'text');
315482
- }))));
315509
+ }, checkFormItem)));
315483
315510
  });
315484
315511
  var LmEditTable = /*#__PURE__*/React.memo(EditTable$1);
315485
315512