linkmore-design 1.1.13-alpha.4 → 1.1.13-alpha.6

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.
Files changed (118) hide show
  1. package/dist/Button/demos/ghost.d.ts +2 -0
  2. package/dist/Descriptions/Cell.d.ts +1 -0
  3. package/dist/Descriptions/Item.d.ts +1 -0
  4. package/dist/LmDrag/LmDrag.d.ts +4 -0
  5. package/dist/LmDrag/components/DndContainer.d.ts +3 -0
  6. package/dist/LmDrag/components/sortableBox.d.ts +5 -0
  7. package/dist/LmDrag/components/sortableItem.d.ts +7 -0
  8. package/dist/LmDrag/demos/basic.d.ts +2 -0
  9. package/dist/LmDrag/index.d.ts +10 -0
  10. package/dist/LmDrag/style/index.d.ts +1 -0
  11. package/dist/LmDrag/style/variables.d.ts +1 -0
  12. package/dist/LmDrag/wrapper/Root.d.ts +3 -0
  13. package/dist/LmEditTable/EditTable.d.ts +15 -3
  14. package/dist/LmUpload/UploadList/ItemPictureCard.d.ts +2 -1
  15. package/dist/LmUpload/fns/index.d.ts +1 -0
  16. package/dist/QuickMenu/index.d.ts +2 -1
  17. package/dist/Select/index.d.ts +3 -0
  18. package/dist/index.d.ts +2 -0
  19. package/dist/index.umd.js +804 -119
  20. package/dist/index.umd.min.js +9 -9
  21. package/dist/variables.css +67 -25
  22. package/es/Button/index.js +4 -3
  23. package/es/Button/style/index.css +28 -25
  24. package/es/Button/style/variables.css +28 -25
  25. package/es/Descriptions/Cell.d.ts +1 -0
  26. package/es/Descriptions/Cell.js +5 -2
  27. package/es/Descriptions/Item.d.ts +1 -0
  28. package/es/Descriptions/Row.js +6 -1
  29. package/es/InputNumber/index.js +7 -9
  30. package/es/LmDrag/LmDrag.d.ts +4 -0
  31. package/es/LmDrag/LmDrag.js +30 -0
  32. package/es/LmDrag/components/DndContainer.d.ts +3 -0
  33. package/es/LmDrag/components/DndContainer.js +121 -0
  34. package/es/LmDrag/components/sortableBox.d.ts +5 -0
  35. package/es/LmDrag/components/sortableBox.js +23 -0
  36. package/es/LmDrag/components/sortableItem.d.ts +7 -0
  37. package/es/LmDrag/components/sortableItem.js +41 -0
  38. package/es/LmDrag/index.d.ts +10 -0
  39. package/es/LmDrag/index.js +3 -0
  40. package/es/LmDrag/style/index.css +0 -0
  41. package/es/LmDrag/style/index.d.ts +1 -0
  42. package/es/LmDrag/style/index.js +1 -0
  43. package/es/LmDrag/style/variables.css +0 -0
  44. package/es/LmDrag/style/variables.d.ts +1 -0
  45. package/es/LmDrag/style/variables.js +1 -0
  46. package/es/LmDrag/wrapper/Root.d.ts +3 -0
  47. package/es/LmDrag/wrapper/Root.js +12 -0
  48. package/es/LmEditTable/EditTable.d.ts +15 -3
  49. package/es/LmEditTable/EditTable.js +147 -67
  50. package/es/LmEditTable/sortableItemCol.js +38 -11
  51. package/es/LmEditTable/util.js +16 -5
  52. package/es/LmFilter/components/DropdownFIlter.js +27 -6
  53. package/es/LmFilter/style/index.css +12 -0
  54. package/es/LmFilter/style/variables.css +12 -0
  55. package/es/LmUpload/LmUpload.js +2 -1
  56. package/es/LmUpload/UploadList/ItemPictureCard.d.ts +2 -1
  57. package/es/LmUpload/UploadList/ItemPictureCard.js +4 -3
  58. package/es/LmUpload/UploadList/index.js +52 -2
  59. package/es/LmUpload/fns/index.d.ts +1 -0
  60. package/es/LmUpload/fns/index.js +19 -3
  61. package/es/QuickMenu/index.d.ts +2 -1
  62. package/es/QuickMenu/index.js +11 -12
  63. package/es/Select/index.d.ts +3 -0
  64. package/es/Select/index.js +28 -1
  65. package/es/Select/style/index.css +27 -0
  66. package/es/Select/style/variables.css +27 -0
  67. package/es/index.d.ts +2 -0
  68. package/es/index.js +2 -1
  69. package/es/styles/variables.css +67 -25
  70. package/lib/Button/index.js +4 -3
  71. package/lib/Button/style/index.css +28 -25
  72. package/lib/Button/style/variables.css +28 -25
  73. package/lib/Descriptions/Cell.d.ts +1 -0
  74. package/lib/Descriptions/Cell.js +5 -2
  75. package/lib/Descriptions/Item.d.ts +1 -0
  76. package/lib/Descriptions/Row.js +6 -1
  77. package/lib/InputNumber/index.js +9 -9
  78. package/lib/LmDrag/LmDrag.d.ts +4 -0
  79. package/lib/LmDrag/LmDrag.js +44 -0
  80. package/lib/LmDrag/components/DndContainer.d.ts +3 -0
  81. package/lib/LmDrag/components/DndContainer.js +138 -0
  82. package/lib/LmDrag/components/sortableBox.d.ts +5 -0
  83. package/lib/LmDrag/components/sortableBox.js +37 -0
  84. package/lib/LmDrag/components/sortableItem.d.ts +7 -0
  85. package/lib/LmDrag/components/sortableItem.js +54 -0
  86. package/lib/LmDrag/index.d.ts +10 -0
  87. package/lib/LmDrag/index.js +19 -0
  88. package/lib/LmDrag/style/index.css +0 -0
  89. package/lib/LmDrag/style/index.d.ts +1 -0
  90. package/lib/LmDrag/style/index.js +3 -0
  91. package/lib/LmDrag/style/variables.css +0 -0
  92. package/lib/LmDrag/style/variables.d.ts +1 -0
  93. package/lib/LmDrag/style/variables.js +3 -0
  94. package/lib/LmDrag/wrapper/Root.d.ts +3 -0
  95. package/lib/LmDrag/wrapper/Root.js +26 -0
  96. package/lib/LmEditTable/EditTable.d.ts +15 -3
  97. package/lib/LmEditTable/EditTable.js +146 -66
  98. package/lib/LmEditTable/sortableItemCol.js +34 -8
  99. package/lib/LmEditTable/util.js +15 -4
  100. package/lib/LmFilter/components/DropdownFIlter.js +27 -6
  101. package/lib/LmFilter/style/index.css +12 -0
  102. package/lib/LmFilter/style/variables.css +12 -0
  103. package/lib/LmUpload/LmUpload.js +2 -1
  104. package/lib/LmUpload/UploadList/ItemPictureCard.d.ts +2 -1
  105. package/lib/LmUpload/UploadList/ItemPictureCard.js +4 -3
  106. package/lib/LmUpload/UploadList/index.js +53 -2
  107. package/lib/LmUpload/fns/index.d.ts +1 -0
  108. package/lib/LmUpload/fns/index.js +19 -3
  109. package/lib/QuickMenu/index.d.ts +2 -1
  110. package/lib/QuickMenu/index.js +11 -12
  111. package/lib/Select/index.d.ts +3 -0
  112. package/lib/Select/index.js +29 -1
  113. package/lib/Select/style/index.css +27 -0
  114. package/lib/Select/style/variables.css +27 -0
  115. package/lib/index.d.ts +2 -0
  116. package/lib/index.js +15 -1
  117. package/lib/styles/variables.css +67 -25
  118. package/package.json +1 -1
package/dist/index.umd.js CHANGED
@@ -14966,7 +14966,7 @@
14966
14966
 
14967
14967
  var _objectWithoutProperties$1 = /*@__PURE__*/getDefaultExportFromCjs(objectWithoutProperties);
14968
14968
 
14969
- var _excluded$a = ["children", "className", "size", "type", "hover"];
14969
+ var _excluded$a = ["children", "className", "size", "type", "hover", "danger"];
14970
14970
 
14971
14971
  var LMButton = function LMButton(props) {
14972
14972
  var children = props.children,
@@ -14976,6 +14976,7 @@
14976
14976
  type = _props$type === void 0 ? 'default' : _props$type,
14977
14977
  _props$hover = props.hover,
14978
14978
  hover = _props$hover === void 0 ? false : _props$hover,
14979
+ danger = props.danger,
14979
14980
  restProps = _objectWithoutProperties$1(props, _excluded$a);
14980
14981
 
14981
14982
  var globalSize = customizeSize || React__default['default'].useContext(SizeContext$1) || 'middle';
@@ -14985,12 +14986,12 @@
14985
14986
 
14986
14987
  var classs = classnames('lm-button', className, {
14987
14988
  'lm-button-icon-only': !children
14988
- }, _defineProperty$1({}, "lm-button-".concat(size), size), _defineProperty$1({}, "lm-button-".concat(type), type), _defineProperty$1({}, "lm-button-".concat(type, "-hover"), type && hover));
14989
+ }, _defineProperty$1({}, "lm-button-danger", danger), _defineProperty$1({}, "lm-button-".concat(size), size), _defineProperty$1({}, "lm-button-".concat(type), type), _defineProperty$1({}, "lm-button-".concat(type, "-hover"), type && hover));
14989
14990
  return /*#__PURE__*/React__default['default'].createElement(Button, _objectSpread(_objectSpread({}, restProps), {}, {
14990
14991
  className: classs,
14991
14992
  size: size,
14992
14993
  type: type,
14993
- danger: !!restProps.danger
14994
+ danger: !!danger
14994
14995
  }), children);
14995
14996
  };
14996
14997
 
@@ -90798,7 +90799,7 @@
90798
90799
  console.log('报错了!', '报错项:', item, '报错值', filterValue);
90799
90800
  return filterValue;
90800
90801
  }
90801
- }, [type, filterValue]);
90802
+ }, [type, data, filterValue]);
90802
90803
 
90803
90804
  if (isString) {
90804
90805
  return /*#__PURE__*/React__default['default'].createElement("span", null, String);
@@ -90812,7 +90813,8 @@
90812
90813
  var filterValue = instance.filterValue,
90813
90814
  setFilterValue = instance.setFilterValue;
90814
90815
  var title = item.title,
90815
- colon = item.colon; // 是否有筛选值/是否处于筛选状态
90816
+ colon = item.colon,
90817
+ clearIconTrigger = item.clearIconTrigger; // 是否有筛选值/是否处于筛选状态
90816
90818
 
90817
90819
  var active = React.useMemo(function () {
90818
90820
  return getIsHas(filterValue);
@@ -90827,6 +90829,29 @@
90827
90829
  e.stopPropagation();
90828
90830
  setFilterValue(getValueForType(item.type));
90829
90831
  }
90832
+ }; // Icon展示方式
90833
+
90834
+
90835
+ var Icon = function Icon() {
90836
+ // hover时出现清空
90837
+ if (clearIconTrigger === 'hover') {
90838
+ return /*#__PURE__*/React__default['default'].createElement(React__default['default'].Fragment, null, /*#__PURE__*/React__default['default'].createElement(IconFont, {
90839
+ type: "lmweb-close-circle-fill",
90840
+ onClick: handleClear,
90841
+ className: "icon_clear"
90842
+ }), /*#__PURE__*/React__default['default'].createElement(IconFont, {
90843
+ type: "lmweb-down",
90844
+ className: "icon_down"
90845
+ }));
90846
+ } // 日期类型并且未选中时返回日期自带icon
90847
+
90848
+
90849
+ if (item.type === 'date' && !active) return null; // 选中时展示清楚按钮
90850
+
90851
+ return /*#__PURE__*/React__default['default'].createElement(IconFont, {
90852
+ type: active ? 'lmweb-close-circle-fill' : 'lmweb-down',
90853
+ onClick: handleClear
90854
+ });
90830
90855
  };
90831
90856
 
90832
90857
  return /*#__PURE__*/React__default['default'].createElement(React__default['default'].Fragment, null, (title || showColon) && /*#__PURE__*/React__default['default'].createElement("div", {
@@ -90840,10 +90865,7 @@
90840
90865
  item: item
90841
90866
  })), /*#__PURE__*/React__default['default'].createElement("div", {
90842
90867
  className: "filter_item_icon addon_after"
90843
- }, item.type !== 'date' || active ? /*#__PURE__*/React__default['default'].createElement(IconFont, {
90844
- type: active ? 'lmweb-close-circle-fill' : 'lmweb-down',
90845
- onClick: handleClear
90846
- }) : null));
90868
+ }, /*#__PURE__*/React__default['default'].createElement(Icon, null)));
90847
90869
  });
90848
90870
  /*
90849
90871
  * css样式控制
@@ -181482,10 +181504,11 @@
181482
181504
  }, [uid]); // 从对象中读取存在的指定属性
181483
181505
 
181484
181506
  var getFileHasValue = React.useCallback(function (obj) {
181507
+ if (!obj) return '';
181485
181508
  var extend = [uid, 'fileName'];
181486
181509
  var val = '';
181487
181510
  extend.forEach(function (v) {
181488
- if (!val) val = obj[v];
181511
+ if (!val && obj[v]) val = obj[v];
181489
181512
  });
181490
181513
  return val;
181491
181514
  }, [uid]); // 获取当前的文件列表
@@ -181903,7 +181926,21 @@
181903
181926
  var _props$onDownload;
181904
181927
 
181905
181928
  (_props$onDownload = props.onDownload) === null || _props$onDownload === void 0 ? void 0 : _props$onDownload.call(props, file);
181906
- }, [props.onDownload]);
181929
+ }, [props.onDownload]); // 拖拽移动事件
181930
+
181931
+ var move = React.useCallback(function (active, over, fileList) {
181932
+ var _props$onMove;
181933
+
181934
+ (_props$onMove = props.onMove) === null || _props$onMove === void 0 ? void 0 : _props$onMove.call(props, active, over, fileList);
181935
+ onChange === null || onChange === void 0 ? void 0 : onChange({
181936
+ file: active,
181937
+ fileList: fileList
181938
+ });
181939
+ dispatch({
181940
+ type: 'changeFileList',
181941
+ fileList: fileList
181942
+ });
181943
+ }, [props.onMove, onChange, dispatch]);
181907
181944
  var CoreMethods = {
181908
181945
  getIsMaxCount: getIsMaxCount,
181909
181946
  getFileHasValue: getFileHasValue,
@@ -181913,7 +181950,8 @@
181913
181950
  getUploadStatus: getUploadStatus,
181914
181951
  remove: remove,
181915
181952
  preview: preview,
181916
- download: download
181953
+ download: download,
181954
+ move: move
181917
181955
  };
181918
181956
  var RefMethods = {
181919
181957
  getState: function getState() {
@@ -182184,7 +182222,8 @@
182184
182222
  var PictureItem$1 = function PictureItem(_ref) {
182185
182223
  var file = _ref.file,
182186
182224
  index = _ref.index,
182187
- instance = _ref.instance;
182225
+ instance = _ref.instance,
182226
+ listeners = _ref.listeners;
182188
182227
  var dispatch = instance.dispatch,
182189
182228
  readOnly = instance.readOnly,
182190
182229
  size = instance.size,
@@ -182241,13 +182280,13 @@
182241
182280
  });
182242
182281
  };
182243
182282
 
182244
- return /*#__PURE__*/React__default['default'].createElement("div", {
182283
+ return /*#__PURE__*/React__default['default'].createElement("div", _objectSpread({
182245
182284
  className: classnames('lm_upload_item', 'lm_upload_item_card', isError && 'lm_upload_item_error'),
182246
182285
  style: {
182247
182286
  height: size,
182248
182287
  width: size
182249
182288
  }
182250
- }, /*#__PURE__*/React__default['default'].createElement("div", {
182289
+ }, listeners || {}), /*#__PURE__*/React__default['default'].createElement("div", {
182251
182290
  className: "lm_upload_item_thumb"
182252
182291
  }, isError || !isImg ? renderThumb(resetFile) : /*#__PURE__*/React__default['default'].createElement(Image$1, {
182253
182292
  width: resetSize.width,
@@ -182299,11 +182338,15 @@
182299
182338
 
182300
182339
  var LmUploadList = function LmUploadList(_ref) {
182301
182340
  var instance = _ref.instance;
182302
- var getFileHasValue = instance.getFileHasValue,
182341
+ var uid = instance.uid,
182342
+ getFileHasValue = instance.getFileHasValue,
182303
182343
  getFileList = instance.getFileList,
182304
182344
  itemRender = instance.itemRender,
182305
182345
  listType = instance.listType,
182306
- showUploadList = instance.showUploadList;
182346
+ showUploadList = instance.showUploadList,
182347
+ enableDrag = instance.enableDrag,
182348
+ fileNames = instance.fileNames,
182349
+ move = instance.move;
182307
182350
  if (!showUploadList) return null;
182308
182351
  var fileList = React.useMemo(function () {
182309
182352
  var _getFileList;
@@ -182312,6 +182355,51 @@
182312
182355
  return a.seq - b.seq;
182313
182356
  });
182314
182357
  }, [getFileList]);
182358
+
182359
+ var handleMove = function handleMove(active, over, fileList) {
182360
+ try {
182361
+ var fileMap = fileList.map(function (v) {
182362
+ if (getFileHasValue(v) === getFileHasValue(active)) {
182363
+ return _objectSpread(_objectSpread({}, v), {}, {
182364
+ seq: over[fileNames.seq]
182365
+ });
182366
+ }
182367
+
182368
+ if (getFileHasValue(v) === getFileHasValue(over)) {
182369
+ return _objectSpread(_objectSpread({}, v), {}, {
182370
+ seq: active[fileNames.seq]
182371
+ });
182372
+ }
182373
+
182374
+ return v;
182375
+ });
182376
+ move(active, over, fileMap);
182377
+ } catch (error) {
182378
+ console.log('移动出现了错误', error);
182379
+ }
182380
+ };
182381
+
182382
+ if (enableDrag) {
182383
+ return /*#__PURE__*/React__default['default'].createElement(LmDrag$1, {
182384
+ options: fileList,
182385
+ rowKey: uid,
182386
+ move: handleMove
182387
+ }, function (_ref2) {
182388
+ var item = _ref2.item,
182389
+ listeners = _ref2.listeners,
182390
+ index = _ref2.index;
182391
+ return render$1(itemRender || RenderItem, {
182392
+ type: listType,
182393
+ key: getFileHasValue(item) || index,
182394
+ index: index,
182395
+ file: item,
182396
+ fileList: fileList,
182397
+ instance: instance,
182398
+ listeners: listeners
182399
+ });
182400
+ });
182401
+ }
182402
+
182315
182403
  return /*#__PURE__*/React__default['default'].createElement(React__default['default'].Fragment, null, fileList === null || fileList === void 0 ? void 0 : fileList.map(function (file, idx) {
182316
182404
  return render$1(itemRender || RenderItem, {
182317
182405
  type: listType,
@@ -182542,7 +182630,7 @@
182542
182630
  size: 100,
182543
182631
  fileSize: 10,
182544
182632
  fileSizeType: 'M',
182545
- uid: 'uid',
182633
+ uid: 'fileName',
182546
182634
  accept: '',
182547
182635
  type: ['jpg', 'jpeg', 'png'],
182548
182636
  listType: 'card',
@@ -182557,6 +182645,7 @@
182557
182645
  itemRender: null,
182558
182646
  enabledPreview: true,
182559
182647
  enabledCrop: false,
182648
+ enableDrag: false,
182560
182649
  enabledOss: false,
182561
182650
  // oss配置
182562
182651
  ossConfig: function ossConfig() {
@@ -188614,8 +188703,7 @@
188614
188703
 
188615
188704
  var _excluded$1j = ["children", "className", "disabled", "size"];
188616
188705
  var prefixCls$3 = 'lm_input-number';
188617
-
188618
- var LMInputNumber = function LMInputNumber(props) {
188706
+ var LMInputNumber = /*#__PURE__*/React.forwardRef(function (props, ref) {
188619
188707
  var children = props.children,
188620
188708
  className = props.className,
188621
188709
  customDisabled = props.disabled,
@@ -188629,24 +188717,24 @@
188629
188717
  var size = React__default['default'].useContext(SizeContext$1);
188630
188718
  var mergeSize = customizeSize || size;
188631
188719
  return /*#__PURE__*/React__default['default'].createElement(InputNumber$1, _objectSpread(_objectSpread({
188720
+ ref: ref,
188632
188721
  className: classnames(className, prefixCls$3),
188633
188722
  placeholder: "\u8BF7\u8F93\u5165"
188634
188723
  }, rest), {}, {
188635
188724
  size: mergeSize,
188636
188725
  disabled: mergedDisabled
188637
188726
  }));
188638
- };
188639
-
188727
+ });
188640
188728
  var CInputNumber = LMInputNumber;
188641
-
188642
- CInputNumber.Price = function (props) {
188729
+ CInputNumber.Price = /*#__PURE__*/React.forwardRef(function (props, ref) {
188643
188730
  return /*#__PURE__*/React__default['default'].createElement(InputNumber$1, _objectSpread({
188644
188731
  prefix: "\uFFE5",
188732
+ ref: ref,
188645
188733
  formatter: function formatter(value) {
188646
188734
  return "".concat(value).replace(/\B(?=(\d{3})+(?!\d))/g, ',');
188647
188735
  }
188648
188736
  }, props));
188649
- };
188737
+ });
188650
188738
 
188651
188739
  var getRenderPropValue = function getRenderPropValue(propValue) {
188652
188740
  if (!propValue) {
@@ -227256,6 +227344,20 @@
227256
227344
  return Math.sqrt(Math.pow(p1.x - p2.x, 2) + Math.pow(p1.y - p2.y, 2));
227257
227345
  }
227258
227346
 
227347
+ function getRelativeTransformOrigin(event, rect) {
227348
+ const eventCoordinates = getEventCoordinates(event);
227349
+
227350
+ if (!eventCoordinates) {
227351
+ return '0 0';
227352
+ }
227353
+
227354
+ const transformOrigin = {
227355
+ x: (eventCoordinates.x - rect.left) / rect.width * 100,
227356
+ y: (eventCoordinates.y - rect.top) / rect.height * 100
227357
+ };
227358
+ return `${transformOrigin.x}% ${transformOrigin.y}%`;
227359
+ }
227360
+
227259
227361
  /**
227260
227362
  * Sort collisions from smallest to greatest value
227261
227363
  */
@@ -229649,6 +229751,237 @@
229649
229751
  };
229650
229752
  }
229651
229753
 
229754
+ const defaultDropAnimation = {
229755
+ duration: 250,
229756
+ easing: 'ease',
229757
+ dragSourceOpacity: 0
229758
+ };
229759
+ function useDropAnimation({
229760
+ animate,
229761
+ adjustScale,
229762
+ activeId,
229763
+ draggableNodes,
229764
+ duration,
229765
+ dragSourceOpacity,
229766
+ easing,
229767
+ node,
229768
+ transform
229769
+ }) {
229770
+ const [dropAnimationComplete, setDropAnimationComplete] = React.useState(false);
229771
+ useIsomorphicLayoutEffect$a(() => {
229772
+ var _draggableNodes$activ;
229773
+
229774
+ if (!animate || !activeId || !easing || !duration) {
229775
+ if (animate) {
229776
+ setDropAnimationComplete(true);
229777
+ }
229778
+
229779
+ return;
229780
+ }
229781
+
229782
+ const finalNode = (_draggableNodes$activ = draggableNodes[activeId]) == null ? void 0 : _draggableNodes$activ.node.current;
229783
+
229784
+ if (transform && node && finalNode && finalNode.parentNode !== null) {
229785
+ const fromNode = getMeasurableNode(node);
229786
+
229787
+ if (fromNode) {
229788
+ const from = fromNode.getBoundingClientRect();
229789
+ const to = getTransformAgnosticClientRect(finalNode);
229790
+ const delta = {
229791
+ x: from.left - to.left,
229792
+ y: from.top - to.top
229793
+ };
229794
+
229795
+ if (Math.abs(delta.x) || Math.abs(delta.y)) {
229796
+ const scaleDelta = {
229797
+ scaleX: adjustScale ? to.width * transform.scaleX / from.width : 1,
229798
+ scaleY: adjustScale ? to.height * transform.scaleY / from.height : 1
229799
+ };
229800
+ const finalTransform = CSS.Transform.toString({
229801
+ x: transform.x - delta.x,
229802
+ y: transform.y - delta.y,
229803
+ ...scaleDelta
229804
+ });
229805
+ const originalOpacity = finalNode.style.opacity;
229806
+
229807
+ if (dragSourceOpacity != null) {
229808
+ finalNode.style.opacity = `${dragSourceOpacity}`;
229809
+ }
229810
+
229811
+ const nodeAnimation = node.animate([{
229812
+ transform: CSS.Transform.toString(transform)
229813
+ }, {
229814
+ transform: finalTransform
229815
+ }], {
229816
+ easing,
229817
+ duration
229818
+ });
229819
+
229820
+ nodeAnimation.onfinish = () => {
229821
+ node.style.display = 'none';
229822
+ setDropAnimationComplete(true);
229823
+
229824
+ if (finalNode && dragSourceOpacity != null) {
229825
+ finalNode.style.opacity = originalOpacity;
229826
+ }
229827
+ };
229828
+
229829
+ return;
229830
+ }
229831
+ }
229832
+ }
229833
+
229834
+ setDropAnimationComplete(true);
229835
+ }, [animate, activeId, adjustScale, draggableNodes, duration, easing, dragSourceOpacity, node, transform]);
229836
+ useIsomorphicLayoutEffect$a(() => {
229837
+ if (dropAnimationComplete) {
229838
+ setDropAnimationComplete(false);
229839
+ }
229840
+ }, [dropAnimationComplete]);
229841
+ return dropAnimationComplete;
229842
+ }
229843
+
229844
+ const defaultTransform = {
229845
+ x: 0,
229846
+ y: 0,
229847
+ scaleX: 1,
229848
+ scaleY: 1
229849
+ };
229850
+
229851
+ const defaultTransition = activatorEvent => {
229852
+ const isKeyboardActivator = isKeyboardEvent(activatorEvent);
229853
+ return isKeyboardActivator ? 'transform 250ms ease' : undefined;
229854
+ };
229855
+
229856
+ const DragOverlay = /*#__PURE__*/React__default['default'].memo(({
229857
+ adjustScale = false,
229858
+ children,
229859
+ dropAnimation = defaultDropAnimation,
229860
+ style: styleProp,
229861
+ transition = defaultTransition,
229862
+ modifiers,
229863
+ wrapperElement = 'div',
229864
+ className,
229865
+ zIndex = 999
229866
+ }) => {
229867
+ var _active$id, _attributesSnapshot$c;
229868
+
229869
+ const {
229870
+ active,
229871
+ activeNodeRect,
229872
+ containerNodeRect,
229873
+ draggableNodes,
229874
+ activatorEvent,
229875
+ over,
229876
+ dragOverlay,
229877
+ scrollableAncestors,
229878
+ scrollableAncestorRects,
229879
+ windowRect
229880
+ } = useDndContext();
229881
+ const transform = React.useContext(ActiveDraggableContext);
229882
+ const modifiedTransform = applyModifiers(modifiers, {
229883
+ activatorEvent,
229884
+ active,
229885
+ activeNodeRect,
229886
+ containerNodeRect,
229887
+ draggingNodeRect: dragOverlay.rect,
229888
+ over,
229889
+ overlayNodeRect: dragOverlay.rect,
229890
+ scrollableAncestors,
229891
+ scrollableAncestorRects,
229892
+ transform,
229893
+ windowRect
229894
+ });
229895
+ const isDragging = active !== null;
229896
+ const finalTransform = adjustScale ? modifiedTransform : { ...modifiedTransform,
229897
+ scaleX: 1,
229898
+ scaleY: 1
229899
+ };
229900
+ const initialRect = useLazyMemo(previousValue => {
229901
+ if (isDragging) {
229902
+ if (previousValue) {
229903
+ return previousValue;
229904
+ }
229905
+
229906
+ if (!activeNodeRect) {
229907
+ return null;
229908
+ }
229909
+
229910
+ return { ...activeNodeRect
229911
+ };
229912
+ }
229913
+
229914
+ return null;
229915
+ }, [isDragging, activeNodeRect]);
229916
+ const style = initialRect ? {
229917
+ position: 'fixed',
229918
+ width: initialRect.width,
229919
+ height: initialRect.height,
229920
+ top: initialRect.top,
229921
+ left: initialRect.left,
229922
+ zIndex,
229923
+ transform: CSS.Transform.toString(finalTransform),
229924
+ touchAction: 'none',
229925
+ transformOrigin: adjustScale && activatorEvent ? getRelativeTransformOrigin(activatorEvent, initialRect) : undefined,
229926
+ transition: typeof transition === 'function' ? transition(activatorEvent) : transition,
229927
+ ...styleProp
229928
+ } : undefined;
229929
+ const attributes = isDragging ? {
229930
+ style,
229931
+ children,
229932
+ className,
229933
+ transform: finalTransform
229934
+ } : undefined;
229935
+ const attributesSnapshot = React.useRef(attributes);
229936
+ const derivedAttributes = attributes != null ? attributes : attributesSnapshot.current;
229937
+ const {
229938
+ children: finalChildren,
229939
+ transform: _,
229940
+ ...otherAttributes
229941
+ } = derivedAttributes != null ? derivedAttributes : {};
229942
+ const prevActiveId = React.useRef((_active$id = active == null ? void 0 : active.id) != null ? _active$id : null);
229943
+ const dropAnimationComplete = useDropAnimation({
229944
+ animate: Boolean(dropAnimation && prevActiveId.current && !active),
229945
+ adjustScale,
229946
+ activeId: prevActiveId.current,
229947
+ draggableNodes,
229948
+ duration: dropAnimation == null ? void 0 : dropAnimation.duration,
229949
+ easing: dropAnimation == null ? void 0 : dropAnimation.easing,
229950
+ dragSourceOpacity: dropAnimation == null ? void 0 : dropAnimation.dragSourceOpacity,
229951
+ node: dragOverlay.nodeRef.current,
229952
+ transform: (_attributesSnapshot$c = attributesSnapshot.current) == null ? void 0 : _attributesSnapshot$c.transform
229953
+ });
229954
+ const shouldRender = Boolean(finalChildren && (children || dropAnimation && !dropAnimationComplete));
229955
+ React.useEffect(() => {
229956
+ if ((active == null ? void 0 : active.id) !== prevActiveId.current) {
229957
+ var _active$id2;
229958
+
229959
+ prevActiveId.current = (_active$id2 = active == null ? void 0 : active.id) != null ? _active$id2 : null;
229960
+ }
229961
+
229962
+ if (active && attributesSnapshot.current !== attributes) {
229963
+ attributesSnapshot.current = attributes;
229964
+ }
229965
+ }, [active, attributes]);
229966
+ React.useEffect(() => {
229967
+ if (dropAnimationComplete) {
229968
+ attributesSnapshot.current = undefined;
229969
+ }
229970
+ }, [dropAnimationComplete]);
229971
+
229972
+ if (!shouldRender) {
229973
+ return null;
229974
+ }
229975
+
229976
+ return React__default['default'].createElement(InternalContext.Provider, {
229977
+ value: defaultInternalContext
229978
+ }, React__default['default'].createElement(ActiveDraggableContext.Provider, {
229979
+ value: defaultTransform
229980
+ }, React__default['default'].createElement(wrapperElement, { ...otherAttributes,
229981
+ ref: dragOverlay.setRef
229982
+ }, finalChildren)));
229983
+ });
229984
+
229652
229985
  /**
229653
229986
  * Move an array item to a different position. Returns a new array with the item moved to the new position.
229654
229987
  */
@@ -229938,7 +230271,7 @@
229938
230271
 
229939
230272
  return newIndex !== index && containerId === previousContainerId;
229940
230273
  };
229941
- const defaultTransition = {
230274
+ const defaultTransition$1 = {
229942
230275
  duration: 200,
229943
230276
  easing: 'ease'
229944
230277
  };
@@ -230009,7 +230342,7 @@
230009
230342
  id,
230010
230343
  strategy: localStrategy,
230011
230344
  resizeObserverConfig,
230012
- transition = defaultTransition
230345
+ transition = defaultTransition$1
230013
230346
  }) {
230014
230347
  const {
230015
230348
  items,
@@ -288287,7 +288620,7 @@
288287
288620
 
288288
288621
  LMRadio.Button = Radio$1.Button;
288289
288622
 
288290
- var _excluded$2h = ["children", "className", "size", "disabled", "dropdownClassName", "options", "value", "defaultLabel"];
288623
+ var _excluded$2h = ["children", "className", "size", "disabled", "dropdownClassName", "options", "value", "defaultLabel", "suffix", "icon", "iconClick"];
288291
288624
  var prefixCls$7 = 'lm_select';
288292
288625
  var CLMSelect$1 = /*#__PURE__*/React.forwardRef(function (props, ref) {
288293
288626
  var children = props.children,
@@ -288298,6 +288631,9 @@
288298
288631
  options = props.options,
288299
288632
  value = props.value,
288300
288633
  defaultLabel = props.defaultLabel,
288634
+ suffix = props.suffix,
288635
+ icon = props.icon,
288636
+ iconClick = props.iconClick,
288301
288637
  rest = _objectWithoutProperties$1(props, _excluded$2h); // ===================== Size =====================
288302
288638
 
288303
288639
 
@@ -288336,6 +288672,29 @@
288336
288672
  if (value && !hasOption) return defaultLabel !== null && defaultLabel !== void 0 ? defaultLabel : value;
288337
288673
  return value;
288338
288674
  }, [value, defaultLabel, hasOption]);
288675
+
288676
+ if (icon) {
288677
+ return /*#__PURE__*/React__default['default'].createElement("div", {
288678
+ className: 'lm_select_has_icon',
288679
+ style: props.style
288680
+ }, /*#__PURE__*/React__default['default'].createElement(Select$2, _objectSpread(_objectSpread({
288681
+ className: classnames(className, prefixCls$7),
288682
+ size: size,
288683
+ ref: ref,
288684
+ value: resetValue,
288685
+ options: options,
288686
+ disabled: mergedDisabled || undefined
288687
+ }, rest), {}, {
288688
+ dropdownClassName: classnames('lm_select_dropdown', dropdownClassName)
288689
+ }), children), /*#__PURE__*/React__default['default'].createElement(LMButton, {
288690
+ size: size,
288691
+ onClick: iconClick,
288692
+ className: 'lm_select_icon_button',
288693
+ disabled: mergedDisabled || undefined,
288694
+ icon: icon
288695
+ }));
288696
+ }
288697
+
288339
288698
  return /*#__PURE__*/React__default['default'].createElement(Select$2, _objectSpread(_objectSpread({
288340
288699
  className: classnames(className, prefixCls$7),
288341
288700
  size: size,
@@ -312524,20 +312883,46 @@
312524
312883
  var SortableItem$2 = /*#__PURE__*/React.memo(SortableItem$1);
312525
312884
 
312526
312885
  var _excluded$2S = ["children"];
312886
+ // children: React.ReactNode
312887
+ // }
312888
+ // interface ItemInstance {}
312889
+ // @ts-ignore
312890
+
312527
312891
  var Item$5 = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
312528
312892
  var children = _ref.children,
312529
312893
  props = _objectWithoutProperties$1(_ref, _excluded$2S);
312530
312894
 
312531
- return /*#__PURE__*/React__default['default'].createElement("th", _objectSpread(_objectSpread(_objectSpread({}, props), children.props), {}, {
312532
- ref: ref
312533
- })); // <th {...props} ref={ref as any}>
312534
- // {/* {(children as any)?.props?.children || children} */}
312535
- // { children }
312536
- // </th>
312895
+ // const rProps = omit({ ...props, ...children.props }, [
312896
+ // 'isSticky',
312897
+ // 'colStart',
312898
+ // 'colEnd',
312899
+ // 'prefixCls',
312900
+ // 'fixLeft',
312901
+ // 'fixRight',
312902
+ // 'lastFixLeft',
312903
+ // 'firstFixRight',
312904
+ // 'lastFixRight',
312905
+ // 'firstFixLeft',
312906
+ // 'isSticky',
312907
+ // 'additionalProps',
312908
+ // 'rowType',
312909
+ // ])
312910
+ return (
312911
+ /*#__PURE__*/
312912
+ // <th {...rProps} ref={ref as any} />
312913
+ React__default['default'].createElement("th", _objectSpread(_objectSpread(_objectSpread({}, props), children.props), {}, {
312914
+ ref: ref
312915
+ })) // <th {...props} ref={ref as any}>
312916
+ // {(children as any)?.props?.children || children}
312917
+ // </th>
312918
+
312919
+ );
312537
312920
  });
312538
312921
  function SortableItem$3(props) {
312922
+ var id = props.id;
312923
+
312539
312924
  var _useSortable = useSortable({
312540
- id: props.id
312925
+ id: id
312541
312926
  }),
312542
312927
  attributes = _useSortable.attributes,
312543
312928
  listeners = _useSortable.listeners,
@@ -312643,7 +313028,7 @@
312643
313028
  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'] : '';
312644
313029
  }
312645
313030
  function checkMemoShouldUploadSpecialFun(prev, next) {
312646
- var _prevCol$componentPro, _nextCol$componentPro, _prevCol$componentPro2, _nextCol$componentPro2, _prevCol$componentPro3, _nextCol$componentPro3, _prevCol$componentPro4, _nextCol$componentPro4;
313031
+ var _prevCol$componentPro, _nextCol$componentPro, _prevCol$componentPro2, _nextCol$componentPro2, _prevCol$componentPro3, _nextCol$componentPro3, _prevCol$componentPro4, _nextCol$componentPro4, _prevCol$componentPro5, _nextCol$componentPro5, _prevCol$componentPro6, _nextCol$componentPro6;
312647
313032
 
312648
313033
  var checkExpandStatus = getExpandStatus(prev.children) === getExpandStatus(next.children);
312649
313034
 
@@ -312668,7 +313053,14 @@
312668
313053
  }
312669
313054
 
312670
313055
  if (((prevCol === null || prevCol === void 0 ? void 0 : (_prevCol$componentPro2 = prevCol.componentProps) === null || _prevCol$componentPro2 === void 0 ? void 0 : _prevCol$componentPro2.optionOnly) || (nextCol === null || nextCol === void 0 ? void 0 : (_nextCol$componentPro2 = nextCol.componentProps) === null || _nextCol$componentPro2 === void 0 ? void 0 : _nextCol$componentPro2.optionOnly)) && !lodash.isEqual(prevCol === null || prevCol === void 0 ? void 0 : (_prevCol$componentPro3 = prevCol.componentProps) === null || _prevCol$componentPro3 === void 0 ? void 0 : _prevCol$componentPro3.options, nextCol === null || nextCol === void 0 ? void 0 : (_nextCol$componentPro3 = nextCol.componentProps) === null || _nextCol$componentPro3 === void 0 ? void 0 : _nextCol$componentPro3.options)) {
312671
- // return isEqual(prevCol?.componentProps?.options, nextCol?.componentProps?.options)
313056
+ return false;
313057
+ }
313058
+
313059
+ if (((prevCol === null || prevCol === void 0 ? void 0 : (_prevCol$componentPro4 = prevCol.componentProps) === null || _prevCol$componentPro4 === void 0 ? void 0 : _prevCol$componentPro4.options) || (nextCol === null || nextCol === void 0 ? void 0 : (_nextCol$componentPro4 = nextCol.componentProps) === null || _nextCol$componentPro4 === void 0 ? void 0 : _nextCol$componentPro4.options)) && !lodash.isEqual(prevCol === null || prevCol === void 0 ? void 0 : (_prevCol$componentPro5 = prevCol.componentProps) === null || _prevCol$componentPro5 === void 0 ? void 0 : _prevCol$componentPro5.options, nextCol === null || nextCol === void 0 ? void 0 : (_nextCol$componentPro5 = nextCol.componentProps) === null || _nextCol$componentPro5 === void 0 ? void 0 : _nextCol$componentPro5.options)) {
313060
+ return false;
313061
+ }
313062
+
313063
+ if ((lodash.isFunction(prevCol === null || prevCol === void 0 ? void 0 : prevCol.componentProps) || lodash.isFunction(nextCol === null || nextCol === void 0 ? void 0 : nextCol.componentProps)) && !lodash.isEqual(prevCol.newOptions, nextCol.newOptions) && !lodash.isEqual(prevCol === null || prevCol === void 0 ? void 0 : prevCol.componentProps, nextCol === null || nextCol === void 0 ? void 0 : nextCol.componentProps)) {
312672
313064
  return false;
312673
313065
  }
312674
313066
 
@@ -312677,6 +313069,10 @@
312677
313069
  return false;
312678
313070
  }
312679
313071
 
313072
+ if (next.className.indexOf('drag-visible') > -1) {
313073
+ return lodash.isEqual(prev.style, next.style);
313074
+ }
313075
+
312680
313076
  if (next.className.indexOf('ant-table-selection-column') > -1) {
312681
313077
  var _prev$children, _prev$children$, _next$children, _next$children$;
312682
313078
 
@@ -312685,7 +313081,7 @@
312685
313081
  /** 如果启用了快速复制功能,需要实时判断rowIndex与getLength */
312686
313082
 
312687
313083
 
312688
- if ((prevCol === null || prevCol === void 0 ? void 0 : (_prevCol$componentPro4 = prevCol.componentProps) === null || _prevCol$componentPro4 === void 0 ? void 0 : _prevCol$componentPro4.quickcopy) || (nextCol === null || nextCol === void 0 ? void 0 : (_nextCol$componentPro4 = nextCol.componentProps) === null || _nextCol$componentPro4 === void 0 ? void 0 : _nextCol$componentPro4.quickcopy)) {
313084
+ if ((prevCol === null || prevCol === void 0 ? void 0 : (_prevCol$componentPro6 = prevCol.componentProps) === null || _prevCol$componentPro6 === void 0 ? void 0 : _prevCol$componentPro6.quickcopy) || (nextCol === null || nextCol === void 0 ? void 0 : (_nextCol$componentPro6 = nextCol.componentProps) === null || _nextCol$componentPro6 === void 0 ? void 0 : _nextCol$componentPro6.quickcopy)) {
312689
313085
  var pickProps = ['record', 'colIndex', 'rowIndex', 'getLength'];
312690
313086
  var p = lodash.pick(prev, pickProps);
312691
313087
  var n = lodash.pick(next, pickProps);
@@ -313121,7 +313517,16 @@
313121
313517
  };
313122
313518
 
313123
313519
  var Control = function Control(con) {
313520
+ var _col$newOptions;
313521
+
313124
313522
  var resultComponentProps = lodash.isFunction(componentProps) ? componentProps === null || componentProps === void 0 ? void 0 : componentProps(record, col) : componentProps;
313523
+
313524
+ if (lodash.isFunction(componentProps) && (col === null || col === void 0 ? void 0 : (_col$newOptions = col.newOptions) === null || _col$newOptions === void 0 ? void 0 : _col$newOptions.length)) {
313525
+ resultComponentProps = _objectSpread(_objectSpread({}, resultComponentProps), {}, {
313526
+ options: col === null || col === void 0 ? void 0 : col.newOptions
313527
+ });
313528
+ }
313529
+
313125
313530
  var clearAttrComponentProps = lodash.omit(resultComponentProps, ['optionOnly', 'isOnlyValue', 'quickcopy']);
313126
313531
 
313127
313532
  switch (con) {
@@ -313148,8 +313553,7 @@
313148
313553
 
313149
313554
  case 'inputRange':
313150
313555
  return /*#__PURE__*/React__default['default'].createElement(InputRange$1, _objectSpread(_objectSpread({
313151
- onChange: handleFormItemChange,
313152
- ref: inputRef
313556
+ onChange: handleFormItemChange
313153
313557
  }, resultComponentProps), {}, {
313154
313558
  record: record,
313155
313559
  rowIndex: rowIndex,
@@ -313242,7 +313646,6 @@
313242
313646
  return /*#__PURE__*/React__default['default'].createElement(Opetate$1, _objectSpread({
313243
313647
  record: record,
313244
313648
  rowKey: rowKey,
313245
- ref: inputRef,
313246
313649
  handleAdd: handleTableRowAdd,
313247
313650
  handleDelete: handleTableRowDelete,
313248
313651
  getLength: getLength,
@@ -313251,7 +313654,8 @@
313251
313654
 
313252
313655
  case 'render':
313253
313656
  {
313254
- var render = resultComponentProps.render;
313657
+ var _resultComponentProps = resultComponentProps,
313658
+ render = _resultComponentProps.render;
313255
313659
  var fromData = form.getFieldsValue();
313256
313660
  return render === null || render === void 0 ? void 0 : render(_objectSpread(_objectSpread({}, !isObjEmpty(fromData) ? _objectSpread(_objectSpread({}, record), {}, _defineProperty$1({}, dataIndex, fromData[dataIndex])) : record), {}, {
313257
313661
  onChange: save
@@ -313360,7 +313764,8 @@
313360
313764
  var MemoEditableCell = /*#__PURE__*/React.memo(EditableCell$1, function (prev, next) {
313361
313765
  var pickProps = ['record', 'colIndex'];
313362
313766
  var p = lodash.pick(prev, pickProps);
313363
- var n = lodash.pick(next, pickProps); // console.log(prev, next, '22', checkMemoShouldUploadSpecialFun(prev, next), isEqual(p, n))
313767
+ var n = lodash.pick(next, pickProps);
313768
+ console.log(prev, next, 222); // console.log(prev, next, '22', checkMemoShouldUploadSpecialFun(prev, next), isEqual(p, n))
313364
313769
 
313365
313770
  /** TODO: 在record中带有children,子列表数据修改之后,会导致父级的record对比不一样 */
313366
313771
 
@@ -313371,6 +313776,8 @@
313371
313776
  return lodash.isEqual(p, n);
313372
313777
  });
313373
313778
  var EditTable$1 = /*#__PURE__*/React.forwardRef(function (props, ref) {
313779
+ var _localRowSelectList$s2;
313780
+
313374
313781
  var defaultData = props.value,
313375
313782
  columns = props.columns,
313376
313783
  isEdit = props.isEdit,
@@ -313411,19 +313818,31 @@
313411
313818
  var _useState7 = React.useState({}),
313412
313819
  _useState8 = _slicedToArray$1(_useState7, 2),
313413
313820
  _valid = _useState8[0],
313414
- setValid = _useState8[1];
313821
+ setValid = _useState8[1]; // const [localRowSelectList, setLocalRowSelectList] = useState([])
313415
313822
 
313416
- var _useState9 = React.useState([]),
313417
- _useState10 = _slicedToArray$1(_useState9, 2),
313418
- localRowSelectList = _useState10[0],
313419
- setLocalRowSelectList = _useState10[1];
313823
+
313824
+ var transformRowSelect = function transformRowSelect(selectedRowKeys, selectedRows, info) {
313825
+ var _rowSelection$onChang;
313826
+
313827
+ return rowSelection === null || rowSelection === void 0 ? void 0 : (_rowSelection$onChang = rowSelection.onChange) === null || _rowSelection$onChang === void 0 ? void 0 : _rowSelection$onChang.call(rowSelection, selectedRowKeys, selectedRows, info);
313828
+ };
313829
+
313830
+ var _useControllableValue3 = useControllableValue({
313831
+ value: {
313832
+ selectedRows: (rowSelection === null || rowSelection === void 0 ? void 0 : rowSelection.selectedRows) || (rowSelection === null || rowSelection === void 0 ? void 0 : rowSelection.selectedRowKeys) || []
313833
+ },
313834
+ onChange: (rowSelection === null || rowSelection === void 0 ? void 0 : rowSelection.onChange) ? transformRowSelect : undefined
313835
+ }),
313836
+ _useControllableValue4 = _slicedToArray$1(_useControllableValue3, 2),
313837
+ localRowSelectList = _useControllableValue4[0],
313838
+ setLocalRowSelectList = _useControllableValue4[1];
313420
313839
  /** 当前展开的列 */
313421
313840
 
313422
313841
 
313423
- var _useState11 = React.useState([]),
313424
- _useState12 = _slicedToArray$1(_useState11, 2),
313425
- expandedRowKeys = _useState12[0],
313426
- setExpandedRowKeys = _useState12[1];
313842
+ var _useState9 = React.useState([]),
313843
+ _useState10 = _slicedToArray$1(_useState9, 2),
313844
+ expandedRowKeys = _useState10[0],
313845
+ setExpandedRowKeys = _useState10[1];
313427
313846
 
313428
313847
  var dataSourceRef = React.useRef(dataSource);
313429
313848
  var deepDataSourceRef = React.useRef(deepDataSourcePreKeys(dataSource, _rowKey));
@@ -313467,25 +313886,20 @@
313467
313886
  setDataSource(res); // onChange?.(res)
313468
313887
  };
313469
313888
  /** 本地缓存一个选择数据 */
313889
+ // useEffect(() => {
313890
+ // if (rowSelection) {
313891
+ // const { selectedRowKeys } = rowSelection
313892
+ // if (selectedRowKeys) {
313893
+ // setLocalRowSelectList(localRowSelectList || [])
313894
+ // }
313895
+ // }
313896
+ // }, [rowSelection])
313897
+ // const editTableRowChange = (selectRows) => {
313898
+ // setLocalRowSelectList(selectRows)
313899
+ // ;(rowSelection?.onChange as any)?.(selectRows)
313900
+ // }
313470
313901
 
313471
313902
 
313472
- React.useEffect(function () {
313473
- if (rowSelection) {
313474
- var selectedRowKeys = rowSelection.selectedRowKeys;
313475
-
313476
- if (selectedRowKeys) {
313477
- setLocalRowSelectList(localRowSelectList || []);
313478
- }
313479
- }
313480
- }, [rowSelection]);
313481
-
313482
- var editTableRowChange = function editTableRowChange(selectRows) {
313483
- var _rowSelection$onChang;
313484
-
313485
- setLocalRowSelectList(selectRows);
313486
- rowSelection === null || rowSelection === void 0 ? void 0 : (_rowSelection$onChang = rowSelection.onChange) === null || _rowSelection$onChang === void 0 ? void 0 : _rowSelection$onChang.call(rowSelection, selectRows);
313487
- };
313488
-
313489
313903
  var handleSave = function handleSave(row, options) {
313490
313904
  var _deepDataSourceRef$cu, _deepDataSourceRef$cu2;
313491
313905
 
@@ -313575,7 +313989,8 @@
313575
313989
  var handleTableRowDelete = function handleTableRowDelete(key) {
313576
313990
  var _deepDataSourceRef$cu3, _deepDataSourceRef$cu4;
313577
313991
 
313578
- var preKeys = deepDataSourceRef === null || deepDataSourceRef === void 0 ? void 0 : (_deepDataSourceRef$cu3 = deepDataSourceRef.current) === null || _deepDataSourceRef$cu3 === void 0 ? void 0 : (_deepDataSourceRef$cu4 = _deepDataSourceRef$cu3[key]) === null || _deepDataSourceRef$cu4 === void 0 ? void 0 : _deepDataSourceRef$cu4.preKeys;
313992
+ var rkey = lodash.isObject(key) ? key[_rowKey] : key;
313993
+ 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;
313579
313994
 
313580
313995
  if (preKeys.length > 1) {
313581
313996
  /** 说明删除的是children中的数据 */
@@ -313621,28 +314036,44 @@
313621
314036
  /** 快捷添加 */
313622
314037
 
313623
314038
 
313624
- var handleTableRowAdd = function handleTableRowAdd(record, isAppendInChindren) {
314039
+ var handleTableRowAdd = function handleTableRowAdd(record, isAppendInChindren, defaultRecord) {
313625
314040
  var _deepDataSourceRef$cu5, _deepDataSourceRef$cu6;
313626
314041
 
313627
- var preKeys = deepDataSourceRef === null || deepDataSourceRef === void 0 ? void 0 : (_deepDataSourceRef$cu5 = deepDataSourceRef.current) === null || _deepDataSourceRef$cu5 === void 0 ? void 0 : (_deepDataSourceRef$cu6 = _deepDataSourceRef$cu5[record[_rowKey]]) === null || _deepDataSourceRef$cu6 === void 0 ? void 0 : _deepDataSourceRef$cu6.preKeys;
314042
+ var rkey = lodash.isObject(record) ? record[_rowKey] : record;
314043
+ 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;
314044
+ console.log(record, isAppendInChindren, defaultRecord, '333', preKeys);
313628
314045
  var res = fn(dataSourceRef.current, function (draft) {
313629
- if (preKeys.length > 1) {
314046
+ if ((preKeys === null || preKeys === void 0 ? void 0 : preKeys.length) > 1) {
313630
314047
  var deeps = function deeps(children) {
313631
314048
  children === null || children === void 0 ? void 0 : children.forEach(function (item, index) {
313632
314049
  if (preKeys === null || preKeys === void 0 ? void 0 : preKeys.includes(item[_rowKey])) {
313633
- if (item[_rowKey] === record[_rowKey]) {
314050
+ if (item[_rowKey] === rkey) {
313634
314051
  if (isAppendInChindren) {
313635
314052
  if (item === null || item === void 0 ? void 0 : item.children) {
313636
- var _item$children;
314053
+ if (Array.isArray(defaultRecord)) {
314054
+ var _item$children;
314055
+
314056
+ item === null || item === void 0 ? void 0 : (_item$children = item.children) === null || _item$children === void 0 ? void 0 : _item$children.push.apply(_item$children, _toConsumableArray$1(defaultRecord));
314057
+ } else {
314058
+ var _item$children2;
313637
314059
 
313638
- item === null || item === void 0 ? void 0 : (_item$children = item.children) === null || _item$children === void 0 ? void 0 : _item$children.push(_defineProperty$1({}, _rowKey, "".concat(Date.now())));
314060
+ item === null || item === void 0 ? void 0 : (_item$children2 = item.children) === null || _item$children2 === void 0 ? void 0 : _item$children2.push(defaultRecord || _defineProperty$1({}, _rowKey, "".concat(Date.now())));
314061
+ }
313639
314062
  } else {
313640
- item.children = [_defineProperty$1({}, _rowKey, "".concat(Date.now()))];
314063
+ if (Array.isArray(defaultRecord)) {
314064
+ item.children = _toConsumableArray$1(defaultRecord);
314065
+ } else {
314066
+ item.children = [defaultRecord || _defineProperty$1({}, _rowKey, "".concat(Date.now()))];
314067
+ }
313641
314068
  }
313642
314069
 
313643
314070
  !expandedRowKeys.includes(item[_rowKey]) && setExpandedRowKeys([].concat(_toConsumableArray$1(expandedRowKeys), [item[_rowKey]]));
313644
314071
  } else {
313645
- children.splice(index + 1, 0, _defineProperty$1({}, _rowKey, "".concat(Date.now())));
314072
+ if (Array.isArray(defaultRecord)) {
314073
+ children.splice.apply(children, [index + 1, 0].concat(_toConsumableArray$1(defaultRecord)));
314074
+ } else {
314075
+ children.splice(index + 1, 0, defaultRecord || _defineProperty$1({}, _rowKey, "".concat(Date.now())));
314076
+ }
313646
314077
  }
313647
314078
  } else if (item.children) {
313648
314079
  deeps(item.children);
@@ -313654,7 +314085,7 @@
313654
314085
  deeps(draft);
313655
314086
  } else {
313656
314087
  var index = draft.findIndex(function (item) {
313657
- return record[_rowKey] === item[_rowKey];
314088
+ return rkey === item[_rowKey];
313658
314089
  });
313659
314090
 
313660
314091
  if (index !== -1) {
@@ -313662,16 +314093,28 @@
313662
314093
  var _draft$index$children, _draft$index, _draft$index2;
313663
314094
 
313664
314095
  if ((_draft$index$children = draft[index].children) === null || _draft$index$children === void 0 ? void 0 : _draft$index$children.length) {
313665
- var _draft$index$children2;
314096
+ if (Array.isArray(defaultRecord)) {
314097
+ var _draft$index$children2;
313666
314098
 
313667
- (_draft$index$children2 = draft[index].children) === null || _draft$index$children2 === void 0 ? void 0 : _draft$index$children2.push(_defineProperty$1({}, _rowKey, "".concat(Date.now())));
314099
+ (_draft$index$children2 = draft[index].children) === null || _draft$index$children2 === void 0 ? void 0 : _draft$index$children2.push.apply(_draft$index$children2, _toConsumableArray$1(defaultRecord));
314100
+ } else {
314101
+ var _draft$index$children3;
314102
+
314103
+ (_draft$index$children3 = draft[index].children) === null || _draft$index$children3 === void 0 ? void 0 : _draft$index$children3.push(defaultRecord || _defineProperty$1({}, _rowKey, "".concat(Date.now())));
314104
+ }
313668
314105
  } else {
313669
- draft[index].children = [_defineProperty$1({}, _rowKey, "".concat(Date.now()))];
314106
+ draft[index].children = Array.isArray(defaultRecord) ? _toConsumableArray$1(defaultRecord) : [defaultRecord || _defineProperty$1({}, _rowKey, "".concat(Date.now()))];
313670
314107
  }
313671
314108
 
313672
314109
  !expandedRowKeys.includes((_draft$index = draft[index]) === null || _draft$index === void 0 ? void 0 : _draft$index[_rowKey]) && setExpandedRowKeys([].concat(_toConsumableArray$1(expandedRowKeys), [(_draft$index2 = draft[index]) === null || _draft$index2 === void 0 ? void 0 : _draft$index2[_rowKey]]));
313673
314110
  } else {
313674
- draft.splice(index + 1, 0, _defineProperty$1({}, _rowKey, "".concat(Date.now())));
314111
+ if (Array.isArray(defaultRecord)) {
314112
+ console.log(1);
314113
+ draft.splice.apply(draft, [index + 1, 0].concat(_toConsumableArray$1(defaultRecord)));
314114
+ } else {
314115
+ console.log(2);
314116
+ draft.splice(index + 1, 0, defaultRecord || _defineProperty$1({}, _rowKey, "".concat(Date.now())));
314117
+ }
313675
314118
  }
313676
314119
  }
313677
314120
  }
@@ -313696,8 +314139,9 @@
313696
314139
  var hasOnlyOptionsDatas = columns.filter(function (item) {
313697
314140
  var _item$componentProps;
313698
314141
 
313699
- return item === null || item === void 0 ? void 0 : (_item$componentProps = item.componentProps) === null || _item$componentProps === void 0 ? void 0 : _item$componentProps.optionOnly;
313700
- });
314142
+ var resultComponentProps = lodash.isFunction(item === null || item === void 0 ? void 0 : item.componentProps) ? item === null || item === void 0 ? void 0 : (_item$componentProps = item.componentProps) === null || _item$componentProps === void 0 ? void 0 : _item$componentProps.call(item, {}, item) : item === null || item === void 0 ? void 0 : item.componentProps;
314143
+ return resultComponentProps === null || resultComponentProps === void 0 ? void 0 : resultComponentProps.optionOnly;
314144
+ }); // const hasOnlyOptionsDatas = columns.filter((item) => item?.componentProps?.optionOnly)
313701
314145
 
313702
314146
  if (hasOnlyOptionsDatas.length) {
313703
314147
  return hasOnlyOptionsDatas === null || hasOnlyOptionsDatas === void 0 ? void 0 : hasOnlyOptionsDatas.map(function (item) {
@@ -313711,9 +314155,13 @@
313711
314155
 
313712
314156
  var DisableOptions = React.useMemo(function () {
313713
314157
  var newColumns = columns === null || columns === void 0 ? void 0 : columns.map(function (item) {
313714
- var _ref8 = item.componentProps || {},
313715
- optionOnly = _ref8.optionOnly,
313716
- options = _ref8.options;
314158
+ var _item$componentProps2;
314159
+
314160
+ var resultComponentProps = lodash.isFunction(item.componentProps) ? (_item$componentProps2 = item.componentProps) === null || _item$componentProps2 === void 0 ? void 0 : _item$componentProps2.call(item, {}, item) : item.componentProps;
314161
+
314162
+ var _ref12 = resultComponentProps || {},
314163
+ optionOnly = _ref12.optionOnly,
314164
+ options = _ref12.options;
313717
314165
 
313718
314166
  if (optionOnly && options) {
313719
314167
  var dataIndex = item.dataIndex;
@@ -313725,6 +314173,13 @@
313725
314173
  disabled: !!dataIndexData.includes(o === null || o === void 0 ? void 0 : o.value)
313726
314174
  });
313727
314175
  });
314176
+
314177
+ if (lodash.isFunction(item.componentProps)) {
314178
+ return _objectSpread(_objectSpread({}, item), {}, {
314179
+ newOptions: newOptions
314180
+ });
314181
+ }
314182
+
313728
314183
  return _objectSpread(_objectSpread({}, item), {}, {
313729
314184
  componentProps: _objectSpread(_objectSpread({}, item.componentProps), {}, {
313730
314185
  options: newOptions
@@ -313754,7 +314209,7 @@
313754
314209
  fixed: 'left',
313755
314210
  render: function render(_, record) {
313756
314211
  return /*#__PURE__*/React__default['default'].createElement(Dragger$1, {
313757
- id: record[_rowKey] || record.id
314212
+ id: record[_rowKey] || (record === null || record === void 0 ? void 0 : record.id)
313758
314213
  });
313759
314214
  }
313760
314215
  } : null, indexCol ? lodash.isBoolean(indexCol) ? {
@@ -313880,10 +314335,10 @@
313880
314335
  setDataSource(arrayMove(cloneArr, oldIndex, newIndex));
313881
314336
  };
313882
314337
 
313883
- var colDraggableContainer = React.useCallback(function (_ref9) {
314338
+ var colDraggableContainer = React.useCallback(function (_ref13) {
313884
314339
  var _React$Children;
313885
314340
 
313886
- var props = _extends$2({}, _ref9);
314341
+ var props = _extends$2({}, _ref13);
313887
314342
 
313888
314343
  return /*#__PURE__*/React__default['default'].createElement("tr", null, (_React$Children = React__default['default'].Children) === null || _React$Children === void 0 ? void 0 : _React$Children.map(props.children, function (child) {
313889
314344
  var _child$props, _child$props$column;
@@ -313900,6 +314355,25 @@
313900
314355
  React.useImperativeHandle(ref, function () {
313901
314356
  return {
313902
314357
  setRow: handleSave,
314358
+ getCheckboxRecords: function getCheckboxRecords() {
314359
+ return localRowSelectList.selectedRows;
314360
+ },
314361
+ deleteRowData: function deleteRowData(data) {
314362
+ return handleTableRowDelete(data);
314363
+ },
314364
+ addRowData: function addRowData(data, defaultValue, addInChild) {
314365
+ return handleTableRowAdd(data, addInChild, defaultValue);
314366
+ },
314367
+ clearSelect: function clearSelect() {
314368
+ setLocalRowSelectList({
314369
+ selectedRows: []
314370
+ });
314371
+ },
314372
+ customSetCheckboxRecords: function customSetCheckboxRecords(value) {
314373
+ setLocalRowSelectList({
314374
+ selectedRows: value
314375
+ });
314376
+ },
313903
314377
  valid: function valid() {
313904
314378
  return _valid;
313905
314379
  }
@@ -313950,6 +314424,8 @@
313950
314424
  }, resetProps));
313951
314425
 
313952
314426
  if (colSortOpen) {
314427
+ var _localRowSelectList$s;
314428
+
313953
314429
  return /*#__PURE__*/React__default['default'].createElement("div", {
313954
314430
  className: "lm_editTable_warpper"
313955
314431
  }, /*#__PURE__*/React__default['default'].createElement(DndContainer$2, {
@@ -313965,17 +314441,18 @@
313965
314441
  bordered: true,
313966
314442
  pagination: false,
313967
314443
  // components={tableComponents}
313968
- rowSelection: !rowSelection ? undefined : {
314444
+ rowSelection: !rowSelection ? undefined : _objectSpread(_objectSpread({
313969
314445
  fixed: true,
313970
314446
  type: 'checkbox',
313971
- columnWidth: 36,
313972
- selectedRowKeys: localRowSelectList === null || localRowSelectList === void 0 ? void 0 : localRowSelectList.map(function (v) {
313973
- return v[_rowKey];
314447
+ columnWidth: 36
314448
+ }, rowSelection), {}, {
314449
+ selectedRowKeys: localRowSelectList === null || localRowSelectList === void 0 ? void 0 : (_localRowSelectList$s = localRowSelectList.selectedRows) === null || _localRowSelectList$s === void 0 ? void 0 : _localRowSelectList$s.map(function (v) {
314450
+ return lodash.isObject(v) ? v[_rowKey] : v;
313974
314451
  }),
313975
- onChange: function onChange(selectedRowKeys, selectedRows) {
313976
- editTableRowChange(selectedRows);
314452
+ onChange: function onChange(selectedRowKeys, selectedRows, info) {
314453
+ setLocalRowSelectList(selectedRowKeys, selectedRows, info);
313977
314454
  }
313978
- },
314455
+ }),
313979
314456
  dataSource: dataSource
313980
314457
  })))), isShowAddAction && /*#__PURE__*/React__default['default'].createElement(LMButton, {
313981
314458
  className: "lm_editTable_add_bar",
@@ -314006,17 +314483,18 @@
314006
314483
  return setExpandedRowKeys(expandedRows);
314007
314484
  }
314008
314485
  },
314009
- rowSelection: !rowSelection ? undefined : {
314486
+ rowSelection: !rowSelection ? undefined : _objectSpread(_objectSpread({
314010
314487
  fixed: true,
314011
314488
  type: 'checkbox',
314012
- columnWidth: 36,
314013
- selectedRowKeys: localRowSelectList === null || localRowSelectList === void 0 ? void 0 : localRowSelectList.map(function (v) {
314014
- return v[_rowKey];
314489
+ columnWidth: 36
314490
+ }, rowSelection), {}, {
314491
+ selectedRowKeys: localRowSelectList === null || localRowSelectList === void 0 ? void 0 : (_localRowSelectList$s2 = localRowSelectList.selectedRows) === null || _localRowSelectList$s2 === void 0 ? void 0 : _localRowSelectList$s2.map(function (v) {
314492
+ return lodash.isObject(v) ? v[_rowKey] : v;
314015
314493
  }),
314016
- onChange: function onChange(selectedRowKeys, selectedRows) {
314017
- editTableRowChange(selectedRows);
314494
+ onChange: function onChange(selectedRowKeys, selectedRows, info) {
314495
+ setLocalRowSelectList(selectedRowKeys, selectedRows, info);
314018
314496
  }
314019
- },
314497
+ }),
314020
314498
  dataSource: dataSource
314021
314499
  })), isShowAddAction && /*#__PURE__*/React__default['default'].createElement(LMButton, {
314022
314500
  className: "lm_editTable_add_bar",
@@ -314060,7 +314538,8 @@
314060
314538
  top = _props$top === void 0 ? '104px' : _props$top,
314061
314539
  _props$menuData = props.menuData,
314062
314540
  menuData = _props$menuData === void 0 ? [] : _props$menuData,
314063
- warpElement = props.warpElement;
314541
+ warpElement = props.warpElement,
314542
+ root = props.root;
314064
314543
  var idTopInfo = React.useRef({});
314065
314544
 
314066
314545
  var _useState = React.useState(false),
@@ -314120,11 +314599,13 @@
314120
314599
  var scrollama = require('scrollama');
314121
314600
 
314122
314601
  menuTimeEventRef.current = scrollama();
314602
+ console.log(getTargetElement$1(warpElement || document), '--getTargetElement(warpElement || document)');
314123
314603
  (_menuTimeEventRef$cur2 = menuTimeEventRef.current) === null || _menuTimeEventRef$cur2 === void 0 ? void 0 : (_menuTimeEventRef$cur3 = _menuTimeEventRef$cur2.setup({
314124
314604
  step: filterMenuData.map(function (item) {
314125
314605
  return document.getElementById("".concat(item.menuId));
314126
314606
  }).filter(Boolean),
314127
- container: getTargetElement$1(warpElement || document)
314607
+ container: getTargetElement$1(warpElement || document),
314608
+ root: root ? getTargetElement$1(root) : undefined
314128
314609
  })) === null || _menuTimeEventRef$cur3 === void 0 ? void 0 : _menuTimeEventRef$cur3.onStepEnter(function (_ref) {
314129
314610
  var element = _ref.element;
314130
314611
  updateActiveToc(element.id);
@@ -314156,12 +314637,6 @@
314156
314637
  wait: 50
314157
314638
  });
314158
314639
 
314159
- var bindDom = function bindDom() {
314160
- if (!Object.keys(idTopInfo.current).length) {
314161
- setKeysDom();
314162
- }
314163
- };
314164
-
314165
314640
  var handleScroll = function handleScroll() {
314166
314641
  setScrollOpenStatus(true);
314167
314642
  };
@@ -314176,10 +314651,6 @@
314176
314651
  var _getTargetElement2;
314177
314652
 
314178
314653
  // bindScroller();
314179
- setTimeout(function () {
314180
- bindDom();
314181
- bindScroller();
314182
- }, 200);
314183
314654
  (_getTargetElement2 = getTargetElement$1(warpElement || document)) === null || _getTargetElement2 === void 0 ? void 0 : _getTargetElement2.addEventListener('scroll', handleScroll, {
314184
314655
  once: true
314185
314656
  });
@@ -314189,6 +314660,12 @@
314189
314660
  (_getTargetElement3 = getTargetElement$1(warpElement || document)) === null || _getTargetElement3 === void 0 ? void 0 : _getTargetElement3.removeEventListener('scroll', handleScroll);
314190
314661
  };
314191
314662
  }, []);
314663
+ React.useEffect(function () {
314664
+ setTimeout(function () {
314665
+ setKeysDom();
314666
+ bindScroller();
314667
+ }, 200);
314668
+ }, [filterMenuData]);
314192
314669
  return /*#__PURE__*/React__default['default'].createElement("div", {
314193
314670
  className: classnames(prefixCls$a),
314194
314671
  onMouseEnter: function onMouseEnter() {
@@ -321757,6 +322234,7 @@
321757
322234
  var itemPrefixCls = _ref.itemPrefixCls,
321758
322235
  component = _ref.component,
321759
322236
  span = _ref.span,
322237
+ rowSpan = _ref.rowSpan,
321760
322238
  className = _ref.className,
321761
322239
  style = _ref.style,
321762
322240
  labelStyle = _ref.labelStyle,
@@ -321773,7 +322251,8 @@
321773
322251
  return /*#__PURE__*/React.createElement(Component, {
321774
322252
  className: classnames((_classNames = {}, _defineProperty$1(_classNames, "".concat(itemPrefixCls, "-item-label"), notEmpty(label)), _defineProperty$1(_classNames, "".concat(itemPrefixCls, "-item-content"), notEmpty(content)), _classNames), className),
321775
322253
  style: style,
321776
- colSpan: span
322254
+ colSpan: span,
322255
+ rowSpan: rowSpan
321777
322256
  }, notEmpty(label) && /*#__PURE__*/React.createElement("span", {
321778
322257
  style: labelStyle
321779
322258
  }, label), notEmpty(content) && /*#__PURE__*/React.createElement("span", {
@@ -321784,7 +322263,8 @@
321784
322263
  return /*#__PURE__*/React.createElement(Component, {
321785
322264
  className: classnames("".concat(itemPrefixCls, "-item"), className),
321786
322265
  style: style,
321787
- colSpan: span
322266
+ colSpan: span,
322267
+ rowSpan: rowSpan
321788
322268
  }, /*#__PURE__*/React.createElement("div", {
321789
322269
  className: "".concat(itemPrefixCls, "-item-container")
321790
322270
  }, (label || label === 0) && /*#__PURE__*/React.createElement("span", {
@@ -321818,6 +322298,8 @@
321818
322298
  contentStyle = _ref3$props.contentStyle,
321819
322299
  _ref3$props$span = _ref3$props.span,
321820
322300
  span = _ref3$props$span === void 0 ? 1 : _ref3$props$span,
322301
+ _ref3$props$rowSpan = _ref3$props.rowSpan,
322302
+ rowSpan = _ref3$props$rowSpan === void 0 ? 1 : _ref3$props$rowSpan,
321821
322303
  key = _ref3.key;
321822
322304
 
321823
322305
  if (typeof component === 'string') {
@@ -321828,6 +322310,7 @@
321828
322310
  labelStyle: _objectSpread(_objectSpread({}, rootLabelStyle), labelStyle),
321829
322311
  contentStyle: _objectSpread(_objectSpread({}, rootContentStyle), contentStyle),
321830
322312
  span: span,
322313
+ rowSpan: rowSpan,
321831
322314
  colon: colon,
321832
322315
  component: component,
321833
322316
  itemPrefixCls: itemPrefixCls,
@@ -321842,6 +322325,7 @@
321842
322325
  className: className,
321843
322326
  style: _objectSpread(_objectSpread(_objectSpread({}, rootLabelStyle), style), labelStyle),
321844
322327
  span: 1,
322328
+ rowSpan: rowSpan,
321845
322329
  colon: colon,
321846
322330
  component: component[0],
321847
322331
  itemPrefixCls: itemPrefixCls,
@@ -321852,6 +322336,7 @@
321852
322336
  className: className,
321853
322337
  style: _objectSpread(_objectSpread(_objectSpread({}, rootContentStyle), style), contentStyle),
321854
322338
  span: span * 2 - 1,
322339
+ rowSpan: rowSpan,
321855
322340
  component: component[1],
321856
322341
  itemPrefixCls: itemPrefixCls,
321857
322342
  bordered: bordered,
@@ -324941,6 +325426,205 @@
324941
325426
 
324942
325427
  var LmImageViewer$1 = /*#__PURE__*/React.forwardRef(LmImageViewer);
324943
325428
 
325429
+ var SortableItem$4 = function SortableItem(_ref) {
325430
+ var index = _ref.index,
325431
+ item = _ref.item,
325432
+ instance = _ref.instance;
325433
+ var children = instance.children,
325434
+ rowKey = instance.rowKey;
325435
+
325436
+ var _useSortable = useSortable({
325437
+ id: item[rowKey] || index,
325438
+ data: {
325439
+ item: item
325440
+ }
325441
+ }),
325442
+ attributes = _useSortable.attributes,
325443
+ listeners = _useSortable.listeners,
325444
+ setNodeRef = _useSortable.setNodeRef,
325445
+ transform = _useSortable.transform,
325446
+ transition = _useSortable.transition;
325447
+
325448
+ var resetStyle = React.useMemo(function () {
325449
+ return {
325450
+ transform: CSS.Transform.toString(transform),
325451
+ transition: transition
325452
+ };
325453
+ }, [transform, transition]);
325454
+ return /*#__PURE__*/React__default['default'].createElement(React__default['default'].Fragment, null, /*#__PURE__*/React__default['default'].createElement("div", _objectSpread({
325455
+ className: "lm_drag_item",
325456
+ ref: setNodeRef,
325457
+ style: resetStyle
325458
+ }, attributes), children === null || children === void 0 ? void 0 : children({
325459
+ item: item,
325460
+ listeners: listeners,
325461
+ index: index
325462
+ })));
325463
+ };
325464
+
325465
+ var SortableItem$5 = /*#__PURE__*/React__default['default'].memo(SortableItem$4);
325466
+
325467
+ var SortableBox$3 = function SortableBox(_ref) {
325468
+ var instance = _ref.instance;
325469
+ var items = instance.items,
325470
+ rowKey = instance.rowKey,
325471
+ options = instance.options;
325472
+ return /*#__PURE__*/React__default['default'].createElement(SortableContext$1, {
325473
+ items: items,
325474
+ strategy: rectSortingStrategy
325475
+ }, options === null || options === void 0 ? void 0 : options.map(function (item, idx) {
325476
+ return /*#__PURE__*/React__default['default'].createElement(SortableItem$5, {
325477
+ instance: instance,
325478
+ index: idx,
325479
+ key: item[rowKey] || idx,
325480
+ item: item
325481
+ });
325482
+ }));
325483
+ };
325484
+
325485
+ var SortableBox$4 = /*#__PURE__*/React__default['default'].memo(SortableBox$3);
325486
+
325487
+ var DragOver = /*#__PURE__*/React__default['default'].memo(function (_ref) {
325488
+ var instance = _ref.instance;
325489
+ var isDragging = instance.isDragging,
325490
+ activeId = instance.activeId,
325491
+ rowKey = instance.rowKey,
325492
+ children = instance.children,
325493
+ options = instance.options;
325494
+ var item = activeId && options.find(function (v) {
325495
+ return v[rowKey] === activeId;
325496
+ });
325497
+ return /*#__PURE__*/React__default['default'].createElement(DragOverlay, {
325498
+ adjustScale: false
325499
+ }, isDragging ? children({
325500
+ item: item,
325501
+ listeners: {}
325502
+ }) : null);
325503
+ });
325504
+ /*
325505
+ * restrictToParentElement 拖拽限制在父元素内
325506
+ */
325507
+ // 可拖拽容器
325508
+
325509
+ var DndContainer$3 = function DndContainer(_ref2) {
325510
+ var options = _ref2.options,
325511
+ rowKey = _ref2.rowKey,
325512
+ children = _ref2.children,
325513
+ move = _ref2.move;
325514
+
325515
+ var _React$useState = React__default['default'].useState(false),
325516
+ _React$useState2 = _slicedToArray$1(_React$useState, 2),
325517
+ isDragging = _React$useState2[0],
325518
+ setIsDragging = _React$useState2[1]; // 是否拖拽中
325519
+
325520
+
325521
+ var _React$useState3 = React__default['default'].useState(null),
325522
+ _React$useState4 = _slicedToArray$1(_React$useState3, 2),
325523
+ activeId = _React$useState4[0],
325524
+ setActiveId = _React$useState4[1]; // 是否拖拽中
325525
+
325526
+
325527
+ var sensors = useSensors(useSensor(PointerSensor), useSensor(KeyboardSensor, {
325528
+ coordinateGetter: sortableKeyboardCoordinates
325529
+ }));
325530
+
325531
+ var handleMove = function handleMove(activeItem, overItem) {
325532
+ var fileMap = options.map(function (v) {
325533
+ if (v[rowKey] === activeItem[rowKey]) {
325534
+ return _objectSpread({}, overItem);
325535
+ }
325536
+
325537
+ if (v[rowKey] === overItem[rowKey]) {
325538
+ return _objectSpread({}, activeItem);
325539
+ }
325540
+
325541
+ return v;
325542
+ });
325543
+ move === null || move === void 0 ? void 0 : move(activeItem, overItem, fileMap);
325544
+ }; // 开始拖拽
325545
+
325546
+
325547
+ var handleDragStart = function handleDragStart(_ref3) {
325548
+ var active = _ref3.active;
325549
+ setIsDragging(true);
325550
+
325551
+ if (!active) {
325552
+ return;
325553
+ }
325554
+
325555
+ setActiveId(active.id);
325556
+ }; // 拖拽结束
325557
+
325558
+
325559
+ var handleDragEnd = function handleDragEnd(event) {
325560
+ var active = event.active,
325561
+ over = event.over;
325562
+ setActiveId(null); // 未移入时触发
325563
+
325564
+ if (!(over === null || over === void 0 ? void 0 : over.id)) {
325565
+ return;
325566
+ } // 移入时触发更新数据
325567
+
325568
+
325569
+ if (active.id !== over.id) {
325570
+ handleMove(active.data.current.item, over.data.current.item);
325571
+ }
325572
+ };
325573
+
325574
+ var instance = {
325575
+ isDragging: isDragging,
325576
+ activeId: activeId,
325577
+ options: options,
325578
+ rowKey: rowKey,
325579
+ children: children,
325580
+ move: move,
325581
+ items: options === null || options === void 0 ? void 0 : options.map(function (v) {
325582
+ return v[rowKey];
325583
+ })
325584
+ };
325585
+ return /*#__PURE__*/React__default['default'].createElement(DndContext, {
325586
+ sensors: sensors,
325587
+ onDragStart: handleDragStart,
325588
+ onDragEnd: handleDragEnd,
325589
+ onDragCancel: function onDragCancel() {
325590
+ return setActiveId(null);
325591
+ },
325592
+ modifiers: [restrictToParentElement],
325593
+ collisionDetection: closestCenter
325594
+ }, /*#__PURE__*/React__default['default'].createElement(SortableBox$4, {
325595
+ instance: instance
325596
+ }), /*#__PURE__*/React__default['default'].createElement(DragOver, {
325597
+ instance: instance
325598
+ }));
325599
+ };
325600
+
325601
+ var Root$1 = function Root(props, ref) {
325602
+ // 向外暴露出的方法
325603
+ React.useImperativeHandle(ref, function () {
325604
+ return {};
325605
+ });
325606
+ return /*#__PURE__*/React__default['default'].createElement(DndContainer$3, _objectSpread({}, props));
325607
+ };
325608
+
325609
+ var Root$2 = /*#__PURE__*/React.forwardRef(Root$1);
325610
+
325611
+ var LmDrag = function LmDrag(_ref, ref) {
325612
+ var resetProps = _extends$2({}, _ref);
325613
+
325614
+ var defaultRef = React.useRef(null);
325615
+
325616
+ var defaultProps = _objectSpread({
325617
+ options: [],
325618
+ rowKey: 'id'
325619
+ }, resetProps);
325620
+
325621
+ return /*#__PURE__*/React__default['default'].createElement(Root$2, _objectSpread({
325622
+ ref: ref || defaultRef
325623
+ }, defaultProps));
325624
+ };
325625
+
325626
+ var LmDrag$1 = /*#__PURE__*/React.forwardRef(LmDrag);
325627
+
324944
325628
  exports.Alert = Alert$1;
324945
325629
  exports.Approval = LMApproval;
324946
325630
  exports.AutoComplete = RefAutoComplete$1;
@@ -324983,6 +325667,7 @@
324983
325667
  exports.Layout = Layout$1;
324984
325668
  exports.LeftTable = LeftSide;
324985
325669
  exports.List = List$2;
325670
+ exports.LmDrag = LmDrag$1;
324986
325671
  exports.LmEditTable = LmEditTable;
324987
325672
  exports.LmFilter = LmFilter$1;
324988
325673
  exports.LmImgList = LmImgList;