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
@@ -54,7 +54,7 @@ import { PlusCircleOutlined } from '@ant-design/icons';
54
54
  import moment from 'moment';
55
55
  import { arrayMove } from '@dnd-kit/sortable';
56
56
  import { Button, Checkbox, IconFont, Input, InputNumber, Radio, Select, Table, Switch, DatePicker, Form, Popover } from 'linkmore-design';
57
- import { get, set, isFunction, omit, isEqual, pick, isBoolean } from 'lodash';
57
+ import { get, set, isFunction, omit, isEqual, pick, isBoolean, isObject } from 'lodash';
58
58
  import React, { forwardRef, useContext, useEffect, useImperativeHandle, useMemo, useRef, useState, memo, useCallback } from 'react';
59
59
  import { useControllableValue } from 'ahooks';
60
60
  import { produce } from 'immer';
@@ -461,7 +461,16 @@ var EditableCell = function EditableCell(props) {
461
461
  };
462
462
 
463
463
  var Control = function Control(con) {
464
+ var _a;
465
+
464
466
  var resultComponentProps = isFunction(componentProps) ? componentProps === null || componentProps === void 0 ? void 0 : componentProps(record, col) : componentProps;
467
+
468
+ if (isFunction(componentProps) && ((_a = col === null || col === void 0 ? void 0 : col.newOptions) === null || _a === void 0 ? void 0 : _a.length)) {
469
+ resultComponentProps = Object.assign(Object.assign({}, resultComponentProps), {
470
+ options: col === null || col === void 0 ? void 0 : col.newOptions
471
+ });
472
+ }
473
+
465
474
  var clearAttrComponentProps = omit(resultComponentProps, ['optionOnly', 'isOnlyValue', 'quickcopy']);
466
475
 
467
476
  switch (con) {
@@ -488,8 +497,7 @@ var EditableCell = function EditableCell(props) {
488
497
 
489
498
  case 'inputRange':
490
499
  return /*#__PURE__*/React.createElement(InputRange, Object.assign({
491
- onChange: handleFormItemChange,
492
- ref: inputRef
500
+ onChange: handleFormItemChange
493
501
  }, resultComponentProps, {
494
502
  record: record,
495
503
  rowIndex: rowIndex,
@@ -582,7 +590,6 @@ var EditableCell = function EditableCell(props) {
582
590
  return /*#__PURE__*/React.createElement(Opetate, Object.assign({
583
591
  record: record,
584
592
  rowKey: rowKey,
585
- ref: inputRef,
586
593
  handleAdd: handleTableRowAdd,
587
594
  handleDelete: handleTableRowDelete,
588
595
  getLength: getLength,
@@ -591,7 +598,8 @@ var EditableCell = function EditableCell(props) {
591
598
 
592
599
  case 'render':
593
600
  {
594
- var render = resultComponentProps.render;
601
+ var _resultComponentProps = resultComponentProps,
602
+ render = _resultComponentProps.render;
595
603
  var fromData = form.getFieldsValue();
596
604
  return render === null || render === void 0 ? void 0 : render(Object.assign(Object.assign({}, !isObjEmpty(fromData) ? Object.assign(Object.assign({}, record), _defineProperty({}, dataIndex, fromData[dataIndex])) : record), {
597
605
  onChange: save
@@ -700,7 +708,8 @@ var EditableCell = function EditableCell(props) {
700
708
  var MemoEditableCell = /*#__PURE__*/memo(EditableCell, function (prev, next) {
701
709
  var pickProps = ['record', 'colIndex'];
702
710
  var p = pick(prev, pickProps);
703
- var n = pick(next, pickProps); // console.log(prev, next, '22', checkMemoShouldUploadSpecialFun(prev, next), isEqual(p, n))
711
+ var n = pick(next, pickProps);
712
+ console.log(prev, next, 222); // console.log(prev, next, '22', checkMemoShouldUploadSpecialFun(prev, next), isEqual(p, n))
704
713
 
705
714
  /** TODO: 在record中带有children,子列表数据修改之后,会导致父级的record对比不一样 */
706
715
 
@@ -711,6 +720,8 @@ var MemoEditableCell = /*#__PURE__*/memo(EditableCell, function (prev, next) {
711
720
  return isEqual(p, n);
712
721
  });
713
722
  var EditTable = /*#__PURE__*/forwardRef(function (props, ref) {
723
+ var _a, _b;
724
+
714
725
  var defaultData = props.value,
715
726
  columns = props.columns,
716
727
  isEdit = props.isEdit,
@@ -754,19 +765,31 @@ var EditTable = /*#__PURE__*/forwardRef(function (props, ref) {
754
765
  var _useState7 = useState({}),
755
766
  _useState8 = _slicedToArray(_useState7, 2),
756
767
  _valid = _useState8[0],
757
- setValid = _useState8[1];
768
+ setValid = _useState8[1]; // const [localRowSelectList, setLocalRowSelectList] = useState([])
758
769
 
759
- var _useState9 = useState([]),
760
- _useState10 = _slicedToArray(_useState9, 2),
761
- localRowSelectList = _useState10[0],
762
- setLocalRowSelectList = _useState10[1];
770
+
771
+ var transformRowSelect = function transformRowSelect(selectedRowKeys, selectedRows, info) {
772
+ var _a;
773
+
774
+ return (_a = rowSelection === null || rowSelection === void 0 ? void 0 : rowSelection.onChange) === null || _a === void 0 ? void 0 : _a.call(rowSelection, selectedRowKeys, selectedRows, info);
775
+ };
776
+
777
+ var _useControllableValue3 = useControllableValue({
778
+ value: {
779
+ selectedRows: (rowSelection === null || rowSelection === void 0 ? void 0 : rowSelection.selectedRows) || (rowSelection === null || rowSelection === void 0 ? void 0 : rowSelection.selectedRowKeys) || []
780
+ },
781
+ onChange: (rowSelection === null || rowSelection === void 0 ? void 0 : rowSelection.onChange) ? transformRowSelect : undefined
782
+ }),
783
+ _useControllableValue4 = _slicedToArray(_useControllableValue3, 2),
784
+ localRowSelectList = _useControllableValue4[0],
785
+ setLocalRowSelectList = _useControllableValue4[1];
763
786
  /** 当前展开的列 */
764
787
 
765
788
 
766
- var _useState11 = useState([]),
767
- _useState12 = _slicedToArray(_useState11, 2),
768
- expandedRowKeys = _useState12[0],
769
- setExpandedRowKeys = _useState12[1];
789
+ var _useState9 = useState([]),
790
+ _useState10 = _slicedToArray(_useState9, 2),
791
+ expandedRowKeys = _useState10[0],
792
+ setExpandedRowKeys = _useState10[1];
770
793
 
771
794
  var dataSourceRef = useRef(dataSource);
772
795
  var deepDataSourceRef = useRef(deepDataSourcePreKeys(dataSource, _rowKey));
@@ -810,25 +833,20 @@ var EditTable = /*#__PURE__*/forwardRef(function (props, ref) {
810
833
  setDataSource(res); // onChange?.(res)
811
834
  };
812
835
  /** 本地缓存一个选择数据 */
836
+ // useEffect(() => {
837
+ // if (rowSelection) {
838
+ // const { selectedRowKeys } = rowSelection
839
+ // if (selectedRowKeys) {
840
+ // setLocalRowSelectList(localRowSelectList || [])
841
+ // }
842
+ // }
843
+ // }, [rowSelection])
844
+ // const editTableRowChange = (selectRows) => {
845
+ // setLocalRowSelectList(selectRows)
846
+ // ;(rowSelection?.onChange as any)?.(selectRows)
847
+ // }
813
848
 
814
849
 
815
- useEffect(function () {
816
- if (rowSelection) {
817
- var selectedRowKeys = rowSelection.selectedRowKeys;
818
-
819
- if (selectedRowKeys) {
820
- setLocalRowSelectList(localRowSelectList || []);
821
- }
822
- }
823
- }, [rowSelection]);
824
-
825
- var editTableRowChange = function editTableRowChange(selectRows) {
826
- var _a;
827
-
828
- setLocalRowSelectList(selectRows);
829
- (_a = rowSelection === null || rowSelection === void 0 ? void 0 : rowSelection.onChange) === null || _a === void 0 ? void 0 : _a.call(rowSelection, selectRows);
830
- };
831
-
832
850
  var handleSave = function handleSave(row, options) {
833
851
  var _a, _b;
834
852
 
@@ -918,7 +936,8 @@ var EditTable = /*#__PURE__*/forwardRef(function (props, ref) {
918
936
  var handleTableRowDelete = function handleTableRowDelete(key) {
919
937
  var _a, _b, _c;
920
938
 
921
- var preKeys = (_b = (_a = deepDataSourceRef === null || deepDataSourceRef === void 0 ? void 0 : deepDataSourceRef.current) === null || _a === void 0 ? void 0 : _a[key]) === null || _b === void 0 ? void 0 : _b.preKeys;
939
+ var rkey = isObject(key) ? key[_rowKey] : key;
940
+ var preKeys = (_b = (_a = deepDataSourceRef === null || deepDataSourceRef === void 0 ? void 0 : deepDataSourceRef.current) === null || _a === void 0 ? void 0 : _a[rkey]) === null || _b === void 0 ? void 0 : _b.preKeys;
922
941
 
923
942
  if (preKeys.length > 1) {
924
943
  /** 说明删除的是children中的数据 */
@@ -962,30 +981,46 @@ var EditTable = /*#__PURE__*/forwardRef(function (props, ref) {
962
981
  /** 快捷添加 */
963
982
 
964
983
 
965
- var handleTableRowAdd = function handleTableRowAdd(record, isAppendInChindren) {
984
+ var handleTableRowAdd = function handleTableRowAdd(record, isAppendInChindren, defaultRecord) {
966
985
  var _a, _b;
967
986
 
968
- var preKeys = (_b = (_a = deepDataSourceRef === null || deepDataSourceRef === void 0 ? void 0 : deepDataSourceRef.current) === null || _a === void 0 ? void 0 : _a[record[_rowKey]]) === null || _b === void 0 ? void 0 : _b.preKeys;
987
+ var rkey = isObject(record) ? record[_rowKey] : record;
988
+ var preKeys = (_b = (_a = deepDataSourceRef === null || deepDataSourceRef === void 0 ? void 0 : deepDataSourceRef.current) === null || _a === void 0 ? void 0 : _a[rkey]) === null || _b === void 0 ? void 0 : _b.preKeys;
989
+ console.log(record, isAppendInChindren, defaultRecord, '333', preKeys);
969
990
  var res = produce(dataSourceRef.current, function (draft) {
970
- var _a, _b, _c, _d;
991
+ var _a, _b, _c, _d, _e;
971
992
 
972
- if (preKeys.length > 1) {
993
+ if ((preKeys === null || preKeys === void 0 ? void 0 : preKeys.length) > 1) {
973
994
  var deeps = function deeps(children) {
974
995
  children === null || children === void 0 ? void 0 : children.forEach(function (item, index) {
975
- var _a;
996
+ var _a, _b;
976
997
 
977
998
  if (preKeys === null || preKeys === void 0 ? void 0 : preKeys.includes(item[_rowKey])) {
978
- if (item[_rowKey] === record[_rowKey]) {
999
+ if (item[_rowKey] === rkey) {
979
1000
  if (isAppendInChindren) {
980
1001
  if (item === null || item === void 0 ? void 0 : item.children) {
981
- (_a = item === null || item === void 0 ? void 0 : item.children) === null || _a === void 0 ? void 0 : _a.push(_defineProperty({}, _rowKey, "".concat(Date.now())));
1002
+ if (Array.isArray(defaultRecord)) {
1003
+ var _a2;
1004
+
1005
+ (_a = item === null || item === void 0 ? void 0 : item.children) === null || _a === void 0 ? void 0 : (_a2 = _a).push.apply(_a2, _toConsumableArray(defaultRecord));
1006
+ } else {
1007
+ (_b = item === null || item === void 0 ? void 0 : item.children) === null || _b === void 0 ? void 0 : _b.push(defaultRecord || _defineProperty({}, _rowKey, "".concat(Date.now())));
1008
+ }
982
1009
  } else {
983
- item.children = [_defineProperty({}, _rowKey, "".concat(Date.now()))];
1010
+ if (Array.isArray(defaultRecord)) {
1011
+ item.children = _toConsumableArray(defaultRecord);
1012
+ } else {
1013
+ item.children = [defaultRecord || _defineProperty({}, _rowKey, "".concat(Date.now()))];
1014
+ }
984
1015
  }
985
1016
 
986
1017
  !expandedRowKeys.includes(item[_rowKey]) && setExpandedRowKeys([].concat(_toConsumableArray(expandedRowKeys), [item[_rowKey]]));
987
1018
  } else {
988
- children.splice(index + 1, 0, _defineProperty({}, _rowKey, "".concat(Date.now())));
1019
+ if (Array.isArray(defaultRecord)) {
1020
+ children.splice.apply(children, [index + 1, 0].concat(_toConsumableArray(defaultRecord)));
1021
+ } else {
1022
+ children.splice(index + 1, 0, defaultRecord || _defineProperty({}, _rowKey, "".concat(Date.now())));
1023
+ }
989
1024
  }
990
1025
  } else if (item.children) {
991
1026
  deeps(item.children);
@@ -997,20 +1032,32 @@ var EditTable = /*#__PURE__*/forwardRef(function (props, ref) {
997
1032
  deeps(draft);
998
1033
  } else {
999
1034
  var index = draft.findIndex(function (item) {
1000
- return record[_rowKey] === item[_rowKey];
1035
+ return rkey === item[_rowKey];
1001
1036
  });
1002
1037
 
1003
1038
  if (index !== -1) {
1004
1039
  if (isAppendInChindren) {
1005
1040
  if ((_a = draft[index].children) === null || _a === void 0 ? void 0 : _a.length) {
1006
- (_b = draft[index].children) === null || _b === void 0 ? void 0 : _b.push(_defineProperty({}, _rowKey, "".concat(Date.now())));
1041
+ if (Array.isArray(defaultRecord)) {
1042
+ var _b2;
1043
+
1044
+ (_b = draft[index].children) === null || _b === void 0 ? void 0 : (_b2 = _b).push.apply(_b2, _toConsumableArray(defaultRecord));
1045
+ } else {
1046
+ (_c = draft[index].children) === null || _c === void 0 ? void 0 : _c.push(defaultRecord || _defineProperty({}, _rowKey, "".concat(Date.now())));
1047
+ }
1007
1048
  } else {
1008
- draft[index].children = [_defineProperty({}, _rowKey, "".concat(Date.now()))];
1049
+ draft[index].children = Array.isArray(defaultRecord) ? _toConsumableArray(defaultRecord) : [defaultRecord || _defineProperty({}, _rowKey, "".concat(Date.now()))];
1009
1050
  }
1010
1051
 
1011
- !expandedRowKeys.includes((_c = draft[index]) === null || _c === void 0 ? void 0 : _c[_rowKey]) && setExpandedRowKeys([].concat(_toConsumableArray(expandedRowKeys), [(_d = draft[index]) === null || _d === void 0 ? void 0 : _d[_rowKey]]));
1052
+ !expandedRowKeys.includes((_d = draft[index]) === null || _d === void 0 ? void 0 : _d[_rowKey]) && setExpandedRowKeys([].concat(_toConsumableArray(expandedRowKeys), [(_e = draft[index]) === null || _e === void 0 ? void 0 : _e[_rowKey]]));
1012
1053
  } else {
1013
- draft.splice(index + 1, 0, _defineProperty({}, _rowKey, "".concat(Date.now())));
1054
+ if (Array.isArray(defaultRecord)) {
1055
+ console.log(1);
1056
+ draft.splice.apply(draft, [index + 1, 0].concat(_toConsumableArray(defaultRecord)));
1057
+ } else {
1058
+ console.log(2);
1059
+ draft.splice(index + 1, 0, defaultRecord || _defineProperty({}, _rowKey, "".concat(Date.now())));
1060
+ }
1014
1061
  }
1015
1062
  }
1016
1063
  }
@@ -1035,8 +1082,9 @@ var EditTable = /*#__PURE__*/forwardRef(function (props, ref) {
1035
1082
  var hasOnlyOptionsDatas = columns.filter(function (item) {
1036
1083
  var _a;
1037
1084
 
1038
- return (_a = item === null || item === void 0 ? void 0 : item.componentProps) === null || _a === void 0 ? void 0 : _a.optionOnly;
1039
- });
1085
+ var resultComponentProps = isFunction(item === null || item === void 0 ? void 0 : item.componentProps) ? (_a = item === null || item === void 0 ? void 0 : item.componentProps) === null || _a === void 0 ? void 0 : _a.call(item, {}, item) : item === null || item === void 0 ? void 0 : item.componentProps;
1086
+ return resultComponentProps === null || resultComponentProps === void 0 ? void 0 : resultComponentProps.optionOnly;
1087
+ }); // const hasOnlyOptionsDatas = columns.filter((item) => item?.componentProps?.optionOnly)
1040
1088
 
1041
1089
  if (hasOnlyOptionsDatas.length) {
1042
1090
  return hasOnlyOptionsDatas === null || hasOnlyOptionsDatas === void 0 ? void 0 : hasOnlyOptionsDatas.map(function (item) {
@@ -1050,9 +1098,13 @@ var EditTable = /*#__PURE__*/forwardRef(function (props, ref) {
1050
1098
 
1051
1099
  var DisableOptions = useMemo(function () {
1052
1100
  var newColumns = columns === null || columns === void 0 ? void 0 : columns.map(function (item) {
1053
- var _ref5 = item.componentProps || {},
1054
- optionOnly = _ref5.optionOnly,
1055
- options = _ref5.options;
1101
+ var _a;
1102
+
1103
+ var resultComponentProps = isFunction(item.componentProps) ? (_a = item.componentProps) === null || _a === void 0 ? void 0 : _a.call(item, {}, item) : item.componentProps;
1104
+
1105
+ var _ref9 = resultComponentProps || {},
1106
+ optionOnly = _ref9.optionOnly,
1107
+ options = _ref9.options;
1056
1108
 
1057
1109
  if (optionOnly && options) {
1058
1110
  var dataIndex = item.dataIndex;
@@ -1064,6 +1116,13 @@ var EditTable = /*#__PURE__*/forwardRef(function (props, ref) {
1064
1116
  disabled: !!dataIndexData.includes(o === null || o === void 0 ? void 0 : o.value)
1065
1117
  });
1066
1118
  });
1119
+
1120
+ if (isFunction(item.componentProps)) {
1121
+ return Object.assign(Object.assign({}, item), {
1122
+ newOptions: newOptions
1123
+ });
1124
+ }
1125
+
1067
1126
  return Object.assign(Object.assign({}, item), {
1068
1127
  componentProps: Object.assign(Object.assign({}, item.componentProps), {
1069
1128
  options: newOptions
@@ -1091,7 +1150,7 @@ var EditTable = /*#__PURE__*/forwardRef(function (props, ref) {
1091
1150
  fixed: 'left',
1092
1151
  render: function render(_, record) {
1093
1152
  return /*#__PURE__*/React.createElement(DragHandle, {
1094
- id: record[_rowKey] || record.id
1153
+ id: record[_rowKey] || (record === null || record === void 0 ? void 0 : record.id)
1095
1154
  });
1096
1155
  }
1097
1156
  } : null, indexCol ? isBoolean(indexCol) ? {
@@ -1235,6 +1294,25 @@ var EditTable = /*#__PURE__*/forwardRef(function (props, ref) {
1235
1294
  useImperativeHandle(ref, function () {
1236
1295
  return {
1237
1296
  setRow: handleSave,
1297
+ getCheckboxRecords: function getCheckboxRecords() {
1298
+ return localRowSelectList.selectedRows;
1299
+ },
1300
+ deleteRowData: function deleteRowData(data) {
1301
+ return handleTableRowDelete(data);
1302
+ },
1303
+ addRowData: function addRowData(data, defaultValue, addInChild) {
1304
+ return handleTableRowAdd(data, addInChild, defaultValue);
1305
+ },
1306
+ clearSelect: function clearSelect() {
1307
+ setLocalRowSelectList({
1308
+ selectedRows: []
1309
+ });
1310
+ },
1311
+ customSetCheckboxRecords: function customSetCheckboxRecords(value) {
1312
+ setLocalRowSelectList({
1313
+ selectedRows: value
1314
+ });
1315
+ },
1238
1316
  valid: function valid() {
1239
1317
  return _valid;
1240
1318
  }
@@ -1300,17 +1378,18 @@ var EditTable = /*#__PURE__*/forwardRef(function (props, ref) {
1300
1378
  bordered: true,
1301
1379
  pagination: false,
1302
1380
  // components={tableComponents}
1303
- rowSelection: !rowSelection ? undefined : {
1381
+ rowSelection: !rowSelection ? undefined : Object.assign(Object.assign({
1304
1382
  fixed: true,
1305
1383
  type: 'checkbox',
1306
- columnWidth: 36,
1307
- selectedRowKeys: localRowSelectList === null || localRowSelectList === void 0 ? void 0 : localRowSelectList.map(function (v) {
1308
- return v[_rowKey];
1384
+ columnWidth: 36
1385
+ }, rowSelection), {
1386
+ selectedRowKeys: (_a = localRowSelectList === null || localRowSelectList === void 0 ? void 0 : localRowSelectList.selectedRows) === null || _a === void 0 ? void 0 : _a.map(function (v) {
1387
+ return isObject(v) ? v[_rowKey] : v;
1309
1388
  }),
1310
- onChange: function onChange(selectedRowKeys, selectedRows) {
1311
- editTableRowChange(selectedRows);
1389
+ onChange: function onChange(selectedRowKeys, selectedRows, info) {
1390
+ setLocalRowSelectList(selectedRowKeys, selectedRows, info);
1312
1391
  }
1313
- },
1392
+ }),
1314
1393
  dataSource: dataSource
1315
1394
  })))), isShowAddAction && /*#__PURE__*/React.createElement(Button, {
1316
1395
  className: "lm_editTable_add_bar",
@@ -1341,17 +1420,18 @@ var EditTable = /*#__PURE__*/forwardRef(function (props, ref) {
1341
1420
  return setExpandedRowKeys(expandedRows);
1342
1421
  }
1343
1422
  },
1344
- rowSelection: !rowSelection ? undefined : {
1423
+ rowSelection: !rowSelection ? undefined : Object.assign(Object.assign({
1345
1424
  fixed: true,
1346
1425
  type: 'checkbox',
1347
- columnWidth: 36,
1348
- selectedRowKeys: localRowSelectList === null || localRowSelectList === void 0 ? void 0 : localRowSelectList.map(function (v) {
1349
- return v[_rowKey];
1426
+ columnWidth: 36
1427
+ }, rowSelection), {
1428
+ selectedRowKeys: (_b = localRowSelectList === null || localRowSelectList === void 0 ? void 0 : localRowSelectList.selectedRows) === null || _b === void 0 ? void 0 : _b.map(function (v) {
1429
+ return isObject(v) ? v[_rowKey] : v;
1350
1430
  }),
1351
- onChange: function onChange(selectedRowKeys, selectedRows) {
1352
- editTableRowChange(selectedRows);
1431
+ onChange: function onChange(selectedRowKeys, selectedRows, info) {
1432
+ setLocalRowSelectList(selectedRowKeys, selectedRows, info);
1353
1433
  }
1354
- },
1434
+ }),
1355
1435
  dataSource: dataSource
1356
1436
  })), isShowAddAction && /*#__PURE__*/React.createElement(Button, {
1357
1437
  className: "lm_editTable_add_bar",
@@ -12,22 +12,49 @@ var __rest = this && this.__rest || function (s, e) {
12
12
  };
13
13
 
14
14
  import React, { forwardRef } from 'react';
15
- import { useSortable } from '@dnd-kit/sortable';
16
- import { CSS } from '@dnd-kit/utilities';
15
+ import { useSortable } from '@dnd-kit/sortable'; // import { omit } from 'lodash'
16
+
17
+ import { CSS } from '@dnd-kit/utilities'; // interface ItemType {
18
+ // children: React.ReactNode
19
+ // }
20
+ // interface ItemInstance {}
21
+ // @ts-ignore
22
+
17
23
  var Item = /*#__PURE__*/forwardRef(function (_a, ref) {
18
24
  var children = _a.children,
19
- props = __rest(_a, ["children"]);
20
-
21
- return /*#__PURE__*/React.createElement("th", Object.assign({}, props, children.props, {
22
- ref: ref
23
- })); // <th {...props} ref={ref as any}>
24
- // {/* {(children as any)?.props?.children || children} */}
25
- // { children }
26
- // </th>
25
+ props = __rest(_a, ["children"]); // const rProps = omit({ ...props, ...children.props }, [
26
+ // 'isSticky',
27
+ // 'colStart',
28
+ // 'colEnd',
29
+ // 'prefixCls',
30
+ // 'fixLeft',
31
+ // 'fixRight',
32
+ // 'lastFixLeft',
33
+ // 'firstFixRight',
34
+ // 'lastFixRight',
35
+ // 'firstFixLeft',
36
+ // 'isSticky',
37
+ // 'additionalProps',
38
+ // 'rowType',
39
+ // ])
40
+
41
+
42
+ return (
43
+ /*#__PURE__*/
44
+ // <th {...rProps} ref={ref as any} />
45
+ React.createElement("th", Object.assign({}, props, children.props, {
46
+ ref: ref
47
+ })) // <th {...props} ref={ref as any}>
48
+ // {(children as any)?.props?.children || children}
49
+ // </th>
50
+
51
+ );
27
52
  });
28
53
  export default function SortableItem(props) {
54
+ var id = props.id;
55
+
29
56
  var _useSortable = useSortable({
30
- id: props.id
57
+ id: id
31
58
  }),
32
59
  attributes = _useSortable.attributes,
33
60
  listeners = _useSortable.listeners,
@@ -1,6 +1,6 @@
1
1
  import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
2
2
  import _toConsumableArray from "@babel/runtime/helpers/esm/toConsumableArray";
3
- import { keyBy, isEqual, pick } from 'lodash';
3
+ import { keyBy, isEqual, pick, isFunction } from 'lodash';
4
4
  export function isObjEmpty(obj) {
5
5
  var _a;
6
6
 
@@ -61,7 +61,7 @@ export function getExpandStatus(children) {
61
61
  return isExpandRow(children) ? (_e = (_d = (_c = (_b = (_a = children === null || children === void 0 ? void 0 : children[0]) === null || _a === void 0 ? void 0 : _a.props) === null || _b === void 0 ? void 0 : _b.children) === null || _c === void 0 ? void 0 : _c[1]) === null || _d === void 0 ? void 0 : _d.props) === null || _e === void 0 ? void 0 : _e['aria-label'] : '';
62
62
  }
63
63
  export function checkMemoShouldUploadSpecialFun(prev, next) {
64
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
64
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r;
65
65
 
66
66
  var checkExpandStatus = getExpandStatus(prev.children) === getExpandStatus(next.children);
67
67
 
@@ -86,7 +86,14 @@ export function checkMemoShouldUploadSpecialFun(prev, next) {
86
86
  }
87
87
 
88
88
  if ((((_c = prevCol === null || prevCol === void 0 ? void 0 : prevCol.componentProps) === null || _c === void 0 ? void 0 : _c.optionOnly) || ((_d = nextCol === null || nextCol === void 0 ? void 0 : nextCol.componentProps) === null || _d === void 0 ? void 0 : _d.optionOnly)) && !isEqual((_e = prevCol === null || prevCol === void 0 ? void 0 : prevCol.componentProps) === null || _e === void 0 ? void 0 : _e.options, (_f = nextCol === null || nextCol === void 0 ? void 0 : nextCol.componentProps) === null || _f === void 0 ? void 0 : _f.options)) {
89
- // return isEqual(prevCol?.componentProps?.options, nextCol?.componentProps?.options)
89
+ return false;
90
+ }
91
+
92
+ if ((((_g = prevCol === null || prevCol === void 0 ? void 0 : prevCol.componentProps) === null || _g === void 0 ? void 0 : _g.options) || ((_h = nextCol === null || nextCol === void 0 ? void 0 : nextCol.componentProps) === null || _h === void 0 ? void 0 : _h.options)) && !isEqual((_j = prevCol === null || prevCol === void 0 ? void 0 : prevCol.componentProps) === null || _j === void 0 ? void 0 : _j.options, (_k = nextCol === null || nextCol === void 0 ? void 0 : nextCol.componentProps) === null || _k === void 0 ? void 0 : _k.options)) {
93
+ return false;
94
+ }
95
+
96
+ if ((isFunction(prevCol === null || prevCol === void 0 ? void 0 : prevCol.componentProps) || isFunction(nextCol === null || nextCol === void 0 ? void 0 : nextCol.componentProps)) && !isEqual(prevCol.newOptions, nextCol.newOptions) && !isEqual(prevCol === null || prevCol === void 0 ? void 0 : prevCol.componentProps, nextCol === null || nextCol === void 0 ? void 0 : nextCol.componentProps)) {
90
97
  return false;
91
98
  }
92
99
 
@@ -95,13 +102,17 @@ export function checkMemoShouldUploadSpecialFun(prev, next) {
95
102
  return false;
96
103
  }
97
104
 
105
+ if (next.className.indexOf('drag-visible') > -1) {
106
+ return isEqual(prev.style, next.style);
107
+ }
108
+
98
109
  if (next.className.indexOf('ant-table-selection-column') > -1) {
99
- return isEqual((_h = (_g = prev.children) === null || _g === void 0 ? void 0 : _g[1]) === null || _h === void 0 ? void 0 : _h.props, (_k = (_j = next.children) === null || _j === void 0 ? void 0 : _j[1]) === null || _k === void 0 ? void 0 : _k.props);
110
+ return isEqual((_m = (_l = prev.children) === null || _l === void 0 ? void 0 : _l[1]) === null || _m === void 0 ? void 0 : _m.props, (_p = (_o = next.children) === null || _o === void 0 ? void 0 : _o[1]) === null || _p === void 0 ? void 0 : _p.props);
100
111
  }
101
112
  /** 如果启用了快速复制功能,需要实时判断rowIndex与getLength */
102
113
 
103
114
 
104
- if (((_l = prevCol === null || prevCol === void 0 ? void 0 : prevCol.componentProps) === null || _l === void 0 ? void 0 : _l.quickcopy) || ((_m = nextCol === null || nextCol === void 0 ? void 0 : nextCol.componentProps) === null || _m === void 0 ? void 0 : _m.quickcopy)) {
115
+ if (((_q = prevCol === null || prevCol === void 0 ? void 0 : prevCol.componentProps) === null || _q === void 0 ? void 0 : _q.quickcopy) || ((_r = nextCol === null || nextCol === void 0 ? void 0 : nextCol.componentProps) === null || _r === void 0 ? void 0 : _r.quickcopy)) {
105
116
  var pickProps = ['record', 'colIndex', 'rowIndex', 'getLength'];
106
117
  var p = pick(prev, pickProps);
107
118
  var n = pick(next, pickProps);
@@ -201,7 +201,7 @@ var ItemLabel = /*#__PURE__*/_react.default.memo(function (_ref3) {
201
201
  } catch (error) {
202
202
  return filterValue;
203
203
  }
204
- }, [type, filterValue]);
204
+ }, [type, data, filterValue]);
205
205
 
206
206
  if (isString) {
207
207
  return /*#__PURE__*/_react.default.createElement("span", null, String);
@@ -216,7 +216,8 @@ var FilterItem = /*#__PURE__*/_react.default.memo(function (_ref4) {
216
216
  var filterValue = instance.filterValue,
217
217
  setFilterValue = instance.setFilterValue;
218
218
  var title = item.title,
219
- colon = item.colon; // 是否有筛选值/是否处于筛选状态
219
+ colon = item.colon,
220
+ clearIconTrigger = item.clearIconTrigger; // 是否有筛选值/是否处于筛选状态
220
221
 
221
222
  var active = (0, _react.useMemo)(function () {
222
223
  return (0, _utils.getIsHas)(filterValue);
@@ -231,6 +232,29 @@ var FilterItem = /*#__PURE__*/_react.default.memo(function (_ref4) {
231
232
  e.stopPropagation();
232
233
  setFilterValue((0, _utils.getValueForType)(item.type));
233
234
  }
235
+ }; // Icon展示方式
236
+
237
+
238
+ var Icon = function Icon() {
239
+ // hover时出现清空
240
+ if (clearIconTrigger === 'hover') {
241
+ return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_linkmoreDesign.IconFont, {
242
+ type: "lmweb-close-circle-fill",
243
+ onClick: handleClear,
244
+ className: "icon_clear"
245
+ }), /*#__PURE__*/_react.default.createElement(_linkmoreDesign.IconFont, {
246
+ type: "lmweb-down",
247
+ className: "icon_down"
248
+ }));
249
+ } // 日期类型并且未选中时返回日期自带icon
250
+
251
+
252
+ if (item.type === 'date' && !active) return null; // 选中时展示清楚按钮
253
+
254
+ return /*#__PURE__*/_react.default.createElement(_linkmoreDesign.IconFont, {
255
+ type: active ? 'lmweb-close-circle-fill' : 'lmweb-down',
256
+ onClick: handleClear
257
+ });
234
258
  };
235
259
 
236
260
  return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, (title || showColon) && /*#__PURE__*/_react.default.createElement("div", {
@@ -244,10 +268,7 @@ var FilterItem = /*#__PURE__*/_react.default.memo(function (_ref4) {
244
268
  item: item
245
269
  })), /*#__PURE__*/_react.default.createElement("div", {
246
270
  className: "filter_item_icon addon_after"
247
- }, item.type !== 'date' || active ? /*#__PURE__*/_react.default.createElement(_linkmoreDesign.IconFont, {
248
- type: active ? 'lmweb-close-circle-fill' : 'lmweb-down',
249
- onClick: handleClear
250
- }) : null));
271
+ }, /*#__PURE__*/_react.default.createElement(Icon, null)));
251
272
  });
252
273
  /*
253
274
  * css样式控制
@@ -108,6 +108,18 @@
108
108
  .lm_filter_basic_item .filter_item_icon.addon_before {
109
109
  color: var(--font-color);
110
110
  }
111
+ .lm_filter_basic_item .filter_item_icon .icon_clear {
112
+ display: none;
113
+ opacity: 0;
114
+ }
115
+ .lm_filter_basic_item .filter_item_icon:hover .icon_down {
116
+ display: none;
117
+ opacity: 0;
118
+ }
119
+ .lm_filter_basic_item .filter_item_icon:hover .icon_clear {
120
+ display: inline-block;
121
+ opacity: 1;
122
+ }
111
123
  .lm_filter_basic_item.expand .filter_item_icon.addon_after {
112
124
  transform: rotateX(180deg);
113
125
  }
@@ -108,6 +108,18 @@
108
108
  .lm_filter_basic_item .filter_item_icon.addon_before {
109
109
  color: var(--font-color);
110
110
  }
111
+ .lm_filter_basic_item .filter_item_icon .icon_clear {
112
+ display: none;
113
+ opacity: 0;
114
+ }
115
+ .lm_filter_basic_item .filter_item_icon:hover .icon_down {
116
+ display: none;
117
+ opacity: 0;
118
+ }
119
+ .lm_filter_basic_item .filter_item_icon:hover .icon_clear {
120
+ display: inline-block;
121
+ opacity: 1;
122
+ }
111
123
  .lm_filter_basic_item.expand .filter_item_icon.addon_after {
112
124
  transform: rotateX(180deg);
113
125
  }
@@ -73,7 +73,7 @@ var LmUpload = function LmUpload(_a, ref) {
73
73
  size: 100,
74
74
  fileSize: 10,
75
75
  fileSizeType: 'M',
76
- uid: 'uid',
76
+ uid: 'fileName',
77
77
  accept: '',
78
78
  type: ['jpg', 'jpeg', 'png'],
79
79
  listType: 'card',
@@ -88,6 +88,7 @@ var LmUpload = function LmUpload(_a, ref) {
88
88
  itemRender: null,
89
89
  enabledPreview: true,
90
90
  enabledCrop: false,
91
+ enableDrag: false,
91
92
  enabledOss: false,
92
93
  // oss配置
93
94
  ossConfig: function ossConfig() {
@@ -1,6 +1,7 @@
1
- declare const PictureItem: ({ file, index, instance }: {
1
+ declare const PictureItem: ({ file, index, instance, listeners }: {
2
2
  file: any;
3
3
  index: any;
4
4
  instance: any;
5
+ listeners: any;
5
6
  }) => JSX.Element;
6
7
  export default PictureItem;
@@ -64,7 +64,8 @@ var renderThumb = function renderThumb(file) {
64
64
  var PictureItem = function PictureItem(_ref) {
65
65
  var file = _ref.file,
66
66
  index = _ref.index,
67
- instance = _ref.instance;
67
+ instance = _ref.instance,
68
+ listeners = _ref.listeners;
68
69
  var dispatch = instance.dispatch,
69
70
  readOnly = instance.readOnly,
70
71
  size = instance.size,
@@ -121,13 +122,13 @@ var PictureItem = function PictureItem(_ref) {
121
122
  });
122
123
  };
123
124
 
124
- return /*#__PURE__*/React.createElement("div", {
125
+ return /*#__PURE__*/React.createElement("div", Object.assign({
125
126
  className: cn('lm_upload_item', 'lm_upload_item_card', isError && 'lm_upload_item_error'),
126
127
  style: {
127
128
  height: size,
128
129
  width: size
129
130
  }
130
- }, /*#__PURE__*/React.createElement("div", {
131
+ }, listeners || {}), /*#__PURE__*/React.createElement("div", {
131
132
  className: "lm_upload_item_thumb"
132
133
  }, isError || !isImg ? renderThumb(resetFile) : /*#__PURE__*/React.createElement(Image, {
133
134
  width: resetSize.width,