linkmore-design 1.1.10 → 1.1.11

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 (222) hide show
  1. package/dist/Button/demos/type.d.ts +2 -0
  2. package/dist/CustomTableOption/index.d.ts +1 -0
  3. package/dist/CustomTableOption/locale/en_US.d.ts +19 -0
  4. package/dist/CustomTableOption/locale/zh_CN.d.ts +19 -0
  5. package/dist/LmEditTable/demos/priceTable.d.ts +2 -0
  6. package/dist/LmEditTable/util.d.ts +1 -0
  7. package/dist/LmFilter/demos/filterControl.d.ts +2 -0
  8. package/dist/Locale/default.d.ts +4 -1
  9. package/dist/Locale/zh_CN.d.ts +4 -1
  10. package/dist/Modal/demos/locale.d.ts +2 -0
  11. package/dist/Modal/locale.d.ts +7 -0
  12. package/dist/base.css +1 -0
  13. package/dist/index.umd.js +212 -173
  14. package/dist/index.umd.min.js +6 -6
  15. package/dist/variables.css +27 -12
  16. package/es/Affix/style/index.css +1 -0
  17. package/es/Alert/style/index.css +1 -0
  18. package/es/Approval/style/index.css +1 -0
  19. package/es/AutoComplete/style/index.css +1 -0
  20. package/es/Avatar/style/index.css +1 -0
  21. package/es/Badge/style/index.css +1 -0
  22. package/es/Breadcrumb/style/index.css +1 -0
  23. package/es/Button/style/index.css +4 -1
  24. package/es/Button/style/variables.css +4 -1
  25. package/es/ButtonTags/style/index.css +1 -0
  26. package/es/Calendar/style/index.css +1 -0
  27. package/es/Card/style/index.css +1 -0
  28. package/es/CardTable/style/index.css +7 -9
  29. package/es/CardTable/style/variables.css +7 -9
  30. package/es/Carousel/style/index.css +1 -0
  31. package/es/Cascader/style/index.css +1 -0
  32. package/es/Col/style/index.css +1 -0
  33. package/es/Collapse/style/index.css +1 -0
  34. package/es/Comment/style/index.css +1 -0
  35. package/es/CustomTableOption/cardSort.js +21 -16
  36. package/es/CustomTableOption/columnsSort.js +16 -16
  37. package/es/CustomTableOption/filterSort.js +11 -11
  38. package/es/CustomTableOption/index.d.ts +1 -0
  39. package/es/CustomTableOption/index.js +45 -17
  40. package/es/CustomTableOption/locale/en_US.d.ts +19 -0
  41. package/es/CustomTableOption/locale/en_US.js +19 -0
  42. package/es/CustomTableOption/locale/zh_CN.d.ts +19 -0
  43. package/es/CustomTableOption/locale/zh_CN.js +19 -0
  44. package/es/CustomTableOption/style/index.css +5 -0
  45. package/es/CustomTableOption/style/variables.css +4 -0
  46. package/es/CustomerService/style/index.css +1 -0
  47. package/es/DatePicker/style/index.css +1 -0
  48. package/es/Descriptions/style/index.css +1 -0
  49. package/es/Divider/style/index.css +1 -0
  50. package/es/Drawer/style/index.css +1 -0
  51. package/es/Dropdown/style/index.css +3 -2
  52. package/es/Dropdown/style/variables.css +2 -2
  53. package/es/EditTable/style/index.css +1 -0
  54. package/es/Empty/style/index.css +1 -0
  55. package/es/Filter/style/index.css +1 -0
  56. package/es/Form/style/index.css +1 -0
  57. package/es/FullScreen/style/index.css +1 -0
  58. package/es/Grid/style/index.css +1 -0
  59. package/es/Icon/style/index.css +1 -0
  60. package/es/Image/style/index.css +1 -0
  61. package/es/Input/style/index.css +1 -0
  62. package/es/InputNumber/style/index.css +1 -0
  63. package/es/Layout/style/index.css +1 -0
  64. package/es/LeftTable/index.js +3 -1
  65. package/es/LeftTable/style/index.css +1 -0
  66. package/es/List/style/index.css +1 -0
  67. package/es/LmEditTable/EditTable.js +39 -88
  68. package/es/LmEditTable/style/index.css +5 -0
  69. package/es/LmEditTable/style/variables.css +4 -0
  70. package/es/LmEditTable/util.d.ts +1 -0
  71. package/es/LmEditTable/util.js +27 -0
  72. package/es/LmSelect/style/index.css +1 -0
  73. package/es/LmTable/style/index.css +1 -0
  74. package/es/Locale/default.d.ts +4 -1
  75. package/es/Locale/default.js +3 -1
  76. package/es/Locale/zh_CN.d.ts +4 -1
  77. package/es/Locale/zh_CN.js +3 -1
  78. package/es/Mentions/style/index.css +1 -0
  79. package/es/Menu/style/index.css +1 -0
  80. package/es/Modal/index.js +18 -14
  81. package/es/Modal/locale.d.ts +7 -0
  82. package/es/Modal/locale.js +12 -0
  83. package/es/Modal/style/index.css +1 -0
  84. package/es/PageHeader/style/index.css +1 -0
  85. package/es/Pagination/style/index.css +1 -0
  86. package/es/Popconfirm/style/index.css +1 -0
  87. package/es/Popover/style/index.css +1 -0
  88. package/es/Progress/style/index.css +1 -0
  89. package/es/QuickMenu/style/index.css +6 -0
  90. package/es/QuickMenu/style/variables.css +5 -0
  91. package/es/Rate/style/index.css +1 -0
  92. package/es/Result/style/index.css +1 -0
  93. package/es/Row/style/index.css +1 -0
  94. package/es/Segmented/style/index.css +1 -0
  95. package/es/Select/style/index.css +1 -0
  96. package/es/Skeleton/style/index.css +1 -0
  97. package/es/Slider/style/index.css +1 -0
  98. package/es/Space/style/index.css +1 -0
  99. package/es/Spin/style/index.css +1 -0
  100. package/es/Statistic/style/index.css +1 -0
  101. package/es/Steps/style/index.css +1 -0
  102. package/es/Switch/style/index.css +1 -0
  103. package/es/Table/style/index.css +1 -0
  104. package/es/Tabs/style/index.css +1 -0
  105. package/es/Tag/style/index.css +1 -0
  106. package/es/TimePicker/style/index.css +1 -0
  107. package/es/Timeline/style/index.css +1 -0
  108. package/es/Tooltip/style/index.css +1 -0
  109. package/es/Transfer/style/index.css +1 -0
  110. package/es/Tree/style/index.css +1 -0
  111. package/es/TreeSelect/style/index.css +1 -0
  112. package/es/Typography/style/index.css +1 -0
  113. package/es/Upload/style/index.css +1 -0
  114. package/es/locale-provider/style/index.css +1 -0
  115. package/es/message/style/index.css +1 -0
  116. package/es/notification/style/index.css +1 -0
  117. package/es/styles/main.css +1 -0
  118. package/es/styles/variables.css +27 -12
  119. package/lib/Affix/style/index.css +1 -0
  120. package/lib/Alert/style/index.css +1 -0
  121. package/lib/Approval/style/index.css +1 -0
  122. package/lib/AutoComplete/style/index.css +1 -0
  123. package/lib/Avatar/style/index.css +1 -0
  124. package/lib/Badge/style/index.css +1 -0
  125. package/lib/Breadcrumb/style/index.css +1 -0
  126. package/lib/Button/style/index.css +4 -1
  127. package/lib/Button/style/variables.css +4 -1
  128. package/lib/ButtonTags/style/index.css +1 -0
  129. package/lib/Calendar/style/index.css +1 -0
  130. package/lib/Card/style/index.css +1 -0
  131. package/lib/CardTable/style/index.css +7 -9
  132. package/lib/CardTable/style/variables.css +7 -9
  133. package/lib/Carousel/style/index.css +1 -0
  134. package/lib/Cascader/style/index.css +1 -0
  135. package/lib/Col/style/index.css +1 -0
  136. package/lib/Collapse/style/index.css +1 -0
  137. package/lib/Comment/style/index.css +1 -0
  138. package/lib/CustomTableOption/cardSort.js +20 -15
  139. package/lib/CustomTableOption/columnsSort.js +16 -16
  140. package/lib/CustomTableOption/filterSort.js +11 -11
  141. package/lib/CustomTableOption/index.d.ts +1 -0
  142. package/lib/CustomTableOption/index.js +45 -16
  143. package/lib/CustomTableOption/locale/en_US.d.ts +19 -0
  144. package/lib/CustomTableOption/locale/en_US.js +26 -0
  145. package/lib/CustomTableOption/locale/zh_CN.d.ts +19 -0
  146. package/lib/CustomTableOption/locale/zh_CN.js +26 -0
  147. package/lib/CustomTableOption/style/index.css +5 -0
  148. package/lib/CustomTableOption/style/variables.css +4 -0
  149. package/lib/CustomerService/style/index.css +1 -0
  150. package/lib/DatePicker/style/index.css +1 -0
  151. package/lib/Descriptions/style/index.css +1 -0
  152. package/lib/Divider/style/index.css +1 -0
  153. package/lib/Drawer/style/index.css +1 -0
  154. package/lib/Dropdown/style/index.css +3 -2
  155. package/lib/Dropdown/style/variables.css +2 -2
  156. package/lib/EditTable/style/index.css +1 -0
  157. package/lib/Empty/style/index.css +1 -0
  158. package/lib/Filter/style/index.css +1 -0
  159. package/lib/Form/style/index.css +1 -0
  160. package/lib/FullScreen/style/index.css +1 -0
  161. package/lib/Grid/style/index.css +1 -0
  162. package/lib/Icon/style/index.css +1 -0
  163. package/lib/Image/style/index.css +1 -0
  164. package/lib/Input/style/index.css +1 -0
  165. package/lib/InputNumber/style/index.css +1 -0
  166. package/lib/Layout/style/index.css +1 -0
  167. package/lib/LeftTable/index.js +3 -1
  168. package/lib/LeftTable/style/index.css +1 -0
  169. package/lib/List/style/index.css +1 -0
  170. package/lib/LmEditTable/EditTable.js +39 -87
  171. package/lib/LmEditTable/style/index.css +5 -0
  172. package/lib/LmEditTable/style/variables.css +4 -0
  173. package/lib/LmEditTable/util.d.ts +1 -0
  174. package/lib/LmEditTable/util.js +30 -0
  175. package/lib/LmSelect/style/index.css +1 -0
  176. package/lib/LmTable/style/index.css +1 -0
  177. package/lib/Locale/default.d.ts +4 -1
  178. package/lib/Locale/default.js +4 -1
  179. package/lib/Locale/zh_CN.d.ts +4 -1
  180. package/lib/Locale/zh_CN.js +4 -1
  181. package/lib/Mentions/style/index.css +1 -0
  182. package/lib/Menu/style/index.css +1 -0
  183. package/lib/Modal/index.js +22 -14
  184. package/lib/Modal/locale.d.ts +7 -0
  185. package/lib/Modal/locale.js +25 -0
  186. package/lib/Modal/style/index.css +1 -0
  187. package/lib/PageHeader/style/index.css +1 -0
  188. package/lib/Pagination/style/index.css +1 -0
  189. package/lib/Popconfirm/style/index.css +1 -0
  190. package/lib/Popover/style/index.css +1 -0
  191. package/lib/Progress/style/index.css +1 -0
  192. package/lib/QuickMenu/style/index.css +6 -0
  193. package/lib/QuickMenu/style/variables.css +5 -0
  194. package/lib/Rate/style/index.css +1 -0
  195. package/lib/Result/style/index.css +1 -0
  196. package/lib/Row/style/index.css +1 -0
  197. package/lib/Segmented/style/index.css +1 -0
  198. package/lib/Select/style/index.css +1 -0
  199. package/lib/Skeleton/style/index.css +1 -0
  200. package/lib/Slider/style/index.css +1 -0
  201. package/lib/Space/style/index.css +1 -0
  202. package/lib/Spin/style/index.css +1 -0
  203. package/lib/Statistic/style/index.css +1 -0
  204. package/lib/Steps/style/index.css +1 -0
  205. package/lib/Switch/style/index.css +1 -0
  206. package/lib/Table/style/index.css +1 -0
  207. package/lib/Tabs/style/index.css +1 -0
  208. package/lib/Tag/style/index.css +1 -0
  209. package/lib/TimePicker/style/index.css +1 -0
  210. package/lib/Timeline/style/index.css +1 -0
  211. package/lib/Tooltip/style/index.css +1 -0
  212. package/lib/Transfer/style/index.css +1 -0
  213. package/lib/Tree/style/index.css +1 -0
  214. package/lib/TreeSelect/style/index.css +1 -0
  215. package/lib/Typography/style/index.css +1 -0
  216. package/lib/Upload/style/index.css +1 -0
  217. package/lib/locale-provider/style/index.css +1 -0
  218. package/lib/message/style/index.css +1 -0
  219. package/lib/notification/style/index.css +1 -0
  220. package/lib/styles/main.css +1 -0
  221. package/lib/styles/variables.css +27 -12
  222. package/package.json +1 -1
@@ -56,6 +56,7 @@ import { arrayMove } from '@dnd-kit/sortable';
56
56
  import { Button, Checkbox, IconFont, Input, InputNumber, Radio, Select, Table, Switch, DatePicker, Form } from 'linkmore-design';
57
57
  import { get, set, isFunction, omit } from 'lodash';
58
58
  import React, { forwardRef, useContext, useEffect, useImperativeHandle, useMemo, useRef, useState, memo, useCallback } from 'react';
59
+ import { useControllableValue } from 'ahooks';
59
60
  import { produce } from 'immer';
60
61
  import DndContainer from './DndContainer';
61
62
  import SortableBox from './sortableBox';
@@ -64,7 +65,7 @@ import SortableItem from './sortableItem';
64
65
  import ColSortableItem from './sortableItemCol';
65
66
  import DragHandle from './DragHandle';
66
67
  import UploadOss from '../UploadOss';
67
- import { isObjEmpty, deepDataSourcePreKeys, isExpandRow } from './util';
68
+ import { isObjEmpty, deepDataSourcePreKeys, isExpandRow, checkRowKeyByDataSource } from './util';
68
69
  import cls from "classnames";
69
70
  var UploadBtn = UploadOss.UploadBtn;
70
71
  var EditableContext = /*#__PURE__*/React.createContext(null); // 表格行
@@ -241,7 +242,8 @@ var Opetate = function Opetate(_ref) {
241
242
  style: {
242
243
  display: 'flex',
243
244
  alignItems: 'center',
244
- justifyContent: 'center'
245
+ justifyContent: 'flex-start',
246
+ marginLeft: '-4px'
245
247
  }
246
248
  }, options.includes('delete') && /*#__PURE__*/React.createElement(Button, {
247
249
  type: "link",
@@ -683,35 +685,39 @@ var EditTable = /*#__PURE__*/forwardRef(function (props, ref) {
683
685
  recordCreatorProps = props.recordCreatorProps,
684
686
  _props$shouldUpdate = props.shouldUpdate,
685
687
  shouldUpdate = _props$shouldUpdate === void 0 ? false : _props$shouldUpdate,
686
- resetProps = __rest(props, ["value", "columns", "isEdit", "isAdd", "onChange", "rowKey", "rowHoverEdit", "isUseForm", "isHoverEdit", "useQuickOpetate", "quickOpetateClearAll", "rowSelection", "sortOpen", "colSortOpen", "filterChange", "size", "recordCreatorProps", "shouldUpdate"]);
688
+ resetProps = __rest(props, ["value", "columns", "isEdit", "isAdd", "onChange", "rowKey", "rowHoverEdit", "isUseForm", "isHoverEdit", "useQuickOpetate", "quickOpetateClearAll", "rowSelection", "sortOpen", "colSortOpen", "filterChange", "size", "recordCreatorProps", "shouldUpdate"]); // const [dataSource, setDataSource] = useState([]);
689
+
690
+
691
+ var _useControllableValue = useControllableValue({
692
+ value: checkRowKeyByDataSource(props.value, _rowKey),
693
+ onChange: props.onChange
694
+ }),
695
+ _useControllableValue2 = _slicedToArray(_useControllableValue, 2),
696
+ dataSource = _useControllableValue2[0],
697
+ setDataSource = _useControllableValue2[1]; // const [count, setCount] = useState(0);
687
698
 
688
- var _useState5 = useState([]),
689
- _useState6 = _slicedToArray(_useState5, 2),
690
- dataSource = _useState6[0],
691
- setDataSource = _useState6[1]; // const [count, setCount] = useState(0);
692
699
 
700
+ var _useState5 = useState({}),
701
+ _useState6 = _slicedToArray(_useState5, 2),
702
+ _valid = _useState6[0],
703
+ setValid = _useState6[1];
693
704
 
694
- var _useState7 = useState({}),
705
+ var _useState7 = useState([]),
695
706
  _useState8 = _slicedToArray(_useState7, 2),
696
- _valid = _useState8[0],
697
- setValid = _useState8[1];
707
+ localRowSelectList = _useState8[0],
708
+ setLocalRowSelectList = _useState8[1];
698
709
 
699
710
  var _useState9 = useState([]),
700
711
  _useState10 = _slicedToArray(_useState9, 2),
701
- localRowSelectList = _useState10[0],
702
- setLocalRowSelectList = _useState10[1];
703
-
704
- var _useState11 = useState([]),
705
- _useState12 = _slicedToArray(_useState11, 2),
706
- sortEditTable = _useState12[0],
707
- setCallBackFalg = _useState12[1];
712
+ sortEditTable = _useState10[0],
713
+ setCallBackFalg = _useState10[1];
708
714
  /** 当前展开的列 */
709
715
 
710
716
 
711
- var _useState13 = useState([]),
712
- _useState14 = _slicedToArray(_useState13, 2),
713
- expandedRowKeys = _useState14[0],
714
- setExpandedRowKeys = _useState14[1];
717
+ var _useState11 = useState([]),
718
+ _useState12 = _slicedToArray(_useState11, 2),
719
+ expandedRowKeys = _useState12[0],
720
+ setExpandedRowKeys = _useState12[1];
715
721
 
716
722
  var dataSourceRef = useRef([]);
717
723
  var sortDataSorceRef = useRef([]);
@@ -726,12 +732,7 @@ var EditTable = /*#__PURE__*/forwardRef(function (props, ref) {
726
732
  var newIndex = cloneArr.findIndex(function (v) {
727
733
  return v[_rowKey] === over;
728
734
  });
729
-
730
- if (onChange) {
731
- onChange === null || onChange === void 0 ? void 0 : onChange(arrayMove(cloneArr, oldIndex, newIndex));
732
- } else {
733
- setDataSource(arrayMove(cloneArr, oldIndex, newIndex));
734
- }
735
+ setDataSource(arrayMove(cloneArr, oldIndex, newIndex));
735
736
  };
736
737
 
737
738
  var onColSortEnd = function onColSortEnd(active, over) {
@@ -754,8 +755,9 @@ var EditTable = /*#__PURE__*/forwardRef(function (props, ref) {
754
755
  var handleDelete = function handleDelete(key) {
755
756
  var nValue = dataSource.filter(function (item) {
756
757
  return item[_rowKey] !== key;
757
- });
758
- onChange === null || onChange === void 0 ? void 0 : onChange(nValue);
758
+ }); // onChange?.(nValue)
759
+
760
+ setDataSource(nValue);
759
761
  };
760
762
  /** 点击添加按钮添加 */
761
763
 
@@ -767,14 +769,14 @@ var EditTable = /*#__PURE__*/forwardRef(function (props, ref) {
767
769
  var res = produce(dataSourceRef.current, function (draft) {
768
770
  draft.push(Object.assign(_defineProperty({}, _rowKey, "".concat(Date.now())), addDataInfo || {}));
769
771
  });
770
- setDataSource(res);
771
- onChange === null || onChange === void 0 ? void 0 : onChange(res);
772
+ setDataSource(res); // onChange?.(res)
772
773
  };
773
774
 
774
775
  useEffect(function () {
775
776
  var _a;
776
777
 
777
778
  dataSourceRef.current = dataSource;
779
+ deepDataSourceRef.current = deepDataSourcePreKeys(dataSource, _rowKey);
778
780
 
779
781
  if (sortOpen) {
780
782
  var dataSourceKeys = dataSource === null || dataSource === void 0 ? void 0 : dataSource.map(function (item) {
@@ -879,12 +881,7 @@ var EditTable = /*#__PURE__*/forwardRef(function (props, ref) {
879
881
  }
880
882
  }
881
883
  });
882
-
883
- if (onChange) {
884
- onChange === null || onChange === void 0 ? void 0 : onChange(res);
885
- } else {
886
- setDataSource(res);
887
- }
884
+ setDataSource(res);
888
885
  };
889
886
 
890
887
  var reWriteOriginSource = function reWriteOriginSource(rowKey, rowValue, dataIndex, nextValue) {
@@ -925,12 +922,7 @@ var EditTable = /*#__PURE__*/forwardRef(function (props, ref) {
925
922
  };
926
923
 
927
924
  var res = filter(dataSource, key);
928
-
929
- if (onChange) {
930
- onChange === null || onChange === void 0 ? void 0 : onChange(res);
931
- } else {
932
- setDataSource(res);
933
- }
925
+ setDataSource(res);
934
926
  } else {
935
927
  if (((_c = dataSourceRef.current) === null || _c === void 0 ? void 0 : _c.length) === 1 && !quickOpetateClearAll) {
936
928
  return false;
@@ -946,11 +938,7 @@ var EditTable = /*#__PURE__*/forwardRef(function (props, ref) {
946
938
  }
947
939
  });
948
940
 
949
- if (onChange) {
950
- onChange === null || onChange === void 0 ? void 0 : onChange(_res);
951
- } else {
952
- setDataSource(_res);
953
- }
941
+ setDataSource(_res);
954
942
  }
955
943
  };
956
944
  /** 快捷添加 */
@@ -985,12 +973,7 @@ var EditTable = /*#__PURE__*/forwardRef(function (props, ref) {
985
973
  }
986
974
  }
987
975
  });
988
-
989
- if (onChange) {
990
- onChange === null || onChange === void 0 ? void 0 : onChange(res);
991
- } else {
992
- setDataSource(res);
993
- }
976
+ setDataSource(res);
994
977
  };
995
978
 
996
979
  var handleCopy = function handleCopy(key, value) {
@@ -999,12 +982,7 @@ var EditTable = /*#__PURE__*/forwardRef(function (props, ref) {
999
982
  return item[key] = value;
1000
983
  });
1001
984
  });
1002
-
1003
- if (onChange) {
1004
- onChange === null || onChange === void 0 ? void 0 : onChange(res);
1005
- } else {
1006
- setDataSource(res);
1007
- }
985
+ setDataSource(res);
1008
986
  };
1009
987
  /** 判断columne中有没有带optionOnly参数 */
1010
988
 
@@ -1077,6 +1055,7 @@ var EditTable = /*#__PURE__*/forwardRef(function (props, ref) {
1077
1055
  width: 68,
1078
1056
  fixed: 'right',
1079
1057
  editable: 'lm_edit_opetate',
1058
+ className: 'lm_edit_opetate',
1080
1059
  componentProps: {
1081
1060
  options: Array.isArray(useQuickOpetate) ? useQuickOpetate : ['add', 'delete']
1082
1061
  }
@@ -1224,34 +1203,6 @@ var EditTable = /*#__PURE__*/forwardRef(function (props, ref) {
1224
1203
  components: component
1225
1204
  }, resetProps);
1226
1205
  }, [resultColumns, dataSource, sortOpen, colSortOpen, size]);
1227
- useEffect(function () {
1228
- // setDataSource(defaultData?.map((v, idx) => ({ ...v, [rowKey]: v[rowKey] || `v${idx + 1}` })))
1229
- var addRowKey = function addRowKey(children, pkey) {
1230
- return children === null || children === void 0 ? void 0 : children.map(function (item, index) {
1231
- if (item.children) {
1232
- var _Object$assign5;
1233
-
1234
- var rchildren = addRowKey(item.children, "".concat(pkey, "_").concat(index + 1));
1235
- return Object.assign(Object.assign({}, item), (_Object$assign5 = {}, _defineProperty(_Object$assign5, _rowKey, item[_rowKey] || "".concat(pkey, "_").concat(index + 1)), _defineProperty(_Object$assign5, "children", rchildren), _Object$assign5));
1236
- }
1237
-
1238
- return Object.assign(Object.assign({}, item), _defineProperty({}, _rowKey, item[_rowKey] || "".concat(pkey, "_").concat(index + 1)));
1239
- });
1240
- };
1241
-
1242
- var res = defaultData === null || defaultData === void 0 ? void 0 : defaultData.map(function (v, idx) {
1243
- if (v.children) {
1244
- var _Object$assign7;
1245
-
1246
- var rchildren = addRowKey(v.children, v[_rowKey] || "v".concat(idx + 1));
1247
- return Object.assign(Object.assign({}, v), (_Object$assign7 = {}, _defineProperty(_Object$assign7, _rowKey, v[_rowKey] || "v".concat(idx + 1)), _defineProperty(_Object$assign7, "children", rchildren), _Object$assign7));
1248
- }
1249
-
1250
- return Object.assign(Object.assign({}, v), _defineProperty({}, _rowKey, v[_rowKey] || "v".concat(idx + 1)));
1251
- });
1252
- deepDataSourceRef.current = deepDataSourcePreKeys(res, _rowKey);
1253
- setDataSource(res);
1254
- }, [defaultData]);
1255
1206
  useImperativeHandle(ref, function () {
1256
1207
  return {
1257
1208
  setRow: handleSave,
@@ -198,6 +198,7 @@
198
198
  --font-size-base: 14px;
199
199
  --font-size-lg: calc(var(--font-size-base) + 2px);
200
200
  --font-size-sm: 12px;
201
+ --border-radius: 2px;
201
202
  --color-contrast: #fff;
202
203
  --color-100: #000;
203
204
  --color-85: #262626;
@@ -579,6 +580,10 @@ p {
579
580
  .lm_editTable_warpper .ant-table .ant-table-tbody > .ant-table-measure-row > td {
580
581
  padding: 0 !important;
581
582
  }
583
+ .lm_editTable_warpper .lm_edit_opetate {
584
+ padding-left: 8px;
585
+ padding-right: 8px;
586
+ }
582
587
  .lm_editTable_warpper .ant-picker {
583
588
  height: 24px !important;
584
589
  padding: 2px 8px;
@@ -68,6 +68,10 @@
68
68
  .lm_editTable_warpper .ant-table .ant-table-tbody > .ant-table-measure-row > td {
69
69
  padding: 0 !important;
70
70
  }
71
+ .lm_editTable_warpper .lm_edit_opetate {
72
+ padding-left: 8px;
73
+ padding-right: 8px;
74
+ }
71
75
  .lm_editTable_warpper .ant-picker {
72
76
  height: 24px !important;
73
77
  padding: 2px 8px;
@@ -1,6 +1,7 @@
1
1
  export declare function isObjEmpty(obj: Record<string, any>): boolean;
2
2
  export declare function deepDataSourcePreKeys(dataSource: any[], rowKey: string): any;
3
3
  export declare function isExpandRow(children: any): boolean;
4
+ export declare function checkRowKeyByDataSource(dataSource: any, rowKey: any): any;
4
5
  declare const _default: {
5
6
  isObjEmpty: typeof isObjEmpty;
6
7
  };
@@ -1,3 +1,4 @@
1
+ import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
1
2
  import _toConsumableArray from "@babel/runtime/helpers/esm/toConsumableArray";
2
3
  import { keyBy } from 'lodash';
3
4
  export function isObjEmpty(obj) {
@@ -28,6 +29,32 @@ export function isExpandRow(children) {
28
29
 
29
30
  return ['Collapse row', 'Expand row'].includes((_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']);
30
31
  }
32
+ export function checkRowKeyByDataSource(dataSource, rowKey) {
33
+ var addRowKey = function addRowKey(children, pkey) {
34
+ return children === null || children === void 0 ? void 0 : children.map(function (item, index) {
35
+ if (item.children) {
36
+ var _Object$assign;
37
+
38
+ var rchildren = addRowKey(item.children, "".concat(pkey, "_").concat(index + 1));
39
+ return Object.assign(Object.assign({}, item), (_Object$assign = {}, _defineProperty(_Object$assign, rowKey, item[rowKey] || "".concat(pkey, "_").concat(index + 1)), _defineProperty(_Object$assign, "children", rchildren), _Object$assign));
40
+ }
41
+
42
+ return Object.assign(Object.assign({}, item), _defineProperty({}, rowKey, item[rowKey] || "".concat(pkey, "_").concat(index + 1)));
43
+ });
44
+ };
45
+
46
+ var res = dataSource === null || dataSource === void 0 ? void 0 : dataSource.map(function (v, idx) {
47
+ if (v.children) {
48
+ var _Object$assign3;
49
+
50
+ var rchildren = addRowKey(v.children, v[rowKey] || "v".concat(idx + 1));
51
+ return Object.assign(Object.assign({}, v), (_Object$assign3 = {}, _defineProperty(_Object$assign3, rowKey, v[rowKey] || "v".concat(idx + 1)), _defineProperty(_Object$assign3, "children", rchildren), _Object$assign3));
52
+ }
53
+
54
+ return Object.assign(Object.assign({}, v), _defineProperty({}, rowKey, v[rowKey] || "v".concat(idx + 1)));
55
+ });
56
+ return res;
57
+ }
31
58
  export default {
32
59
  isObjEmpty: isObjEmpty
33
60
  };
@@ -198,6 +198,7 @@
198
198
  --font-size-base: 14px;
199
199
  --font-size-lg: calc(var(--font-size-base) + 2px);
200
200
  --font-size-sm: 12px;
201
+ --border-radius: 2px;
201
202
  --color-contrast: #fff;
202
203
  --color-100: #000;
203
204
  --color-85: #262626;
@@ -198,6 +198,7 @@
198
198
  --font-size-base: 14px;
199
199
  --font-size-lg: calc(var(--font-size-base) + 2px);
200
200
  --font-size-sm: 12px;
201
+ --border-radius: 2px;
201
202
  --color-contrast: #fff;
202
203
  --color-100: #000;
203
204
  --color-85: #262626;
@@ -1,3 +1,6 @@
1
1
  import type { Locale } from 'antd/es/locale-provider';
2
- declare const localeValues: Locale;
2
+ interface ILocal extends Locale {
3
+ CustomTableOption?: any;
4
+ }
5
+ declare const localeValues: ILocal;
3
6
  export default localeValues;
@@ -3,6 +3,7 @@ import Pagination from 'rc-pagination/lib/locale/en_US';
3
3
  import Calendar from 'antd/es/calendar/locale/en_US';
4
4
  import DatePicker from 'antd/es/date-picker/locale/en_US';
5
5
  import TimePicker from 'antd/es/time-picker/locale/en_US';
6
+ import CustomTableOption from '../CustomTableOption/locale/en_US';
6
7
  var typeTemplate = '${label} is not a valid ${type}';
7
8
  var localeValues = {
8
9
  locale: 'en',
@@ -127,6 +128,7 @@ var localeValues = {
127
128
  },
128
129
  Image: {
129
130
  preview: 'Preview'
130
- }
131
+ },
132
+ CustomTableOption: CustomTableOption
131
133
  };
132
134
  export default localeValues;
@@ -1,3 +1,6 @@
1
1
  import type { Locale } from 'antd/es/locale-provider';
2
- declare const localeValues: Locale;
2
+ interface ILocal extends Locale {
3
+ CustomTableOption?: any;
4
+ }
5
+ declare const localeValues: ILocal;
3
6
  export default localeValues;
@@ -3,6 +3,7 @@ import Pagination from 'rc-pagination/lib/locale/zh_CN';
3
3
  import Calendar from 'antd/es/calendar/locale/zh_CN';
4
4
  import DatePicker from 'antd/es/date-picker/locale/zh_CN';
5
5
  import TimePicker from 'antd/es/time-picker/locale/zh_CN';
6
+ import CustomTableOption from '../CustomTableOption/locale/zh_CN';
6
7
  var typeTemplate = '${label}不是一个有效的${type}';
7
8
  var localeValues = {
8
9
  locale: 'zh-cn',
@@ -126,6 +127,7 @@ var localeValues = {
126
127
  },
127
128
  Image: {
128
129
  preview: '预览'
129
- }
130
+ },
131
+ CustomTableOption: CustomTableOption
130
132
  };
131
133
  export default localeValues;
@@ -198,6 +198,7 @@
198
198
  --font-size-base: 14px;
199
199
  --font-size-lg: calc(var(--font-size-base) + 2px);
200
200
  --font-size-sm: 12px;
201
+ --border-radius: 2px;
201
202
  --color-contrast: #fff;
202
203
  --color-100: #000;
203
204
  --color-85: #262626;
@@ -198,6 +198,7 @@
198
198
  --font-size-base: 14px;
199
199
  --font-size-lg: calc(var(--font-size-base) + 2px);
200
200
  --font-size-sm: 12px;
201
+ --border-radius: 2px;
201
202
  --color-contrast: #fff;
202
203
  --color-100: #000;
203
204
  --color-85: #262626;
package/es/Modal/index.js CHANGED
@@ -18,6 +18,8 @@ import React from 'react';
18
18
  import Button from '../Button';
19
19
  import classNames from 'classnames';
20
20
  import SizeContext from '../ConfigProvider/SizeContext';
21
+ import LocaleReceiver from '../locale-provider/LocaleReceiver';
22
+ import { getConfirmLocale } from './locale';
21
23
  var prefixCls = 'lm_modal';
22
24
 
23
25
  var CLMModal = function CLMModal(props) {
@@ -26,34 +28,36 @@ var CLMModal = function CLMModal(props) {
26
28
  size = _props$size === void 0 ? 'default' : _props$size,
27
29
  onOk = props.onOk,
28
30
  onCancel = props.onCancel,
29
- _props$okText = props.okText,
30
- okText = _props$okText === void 0 ? '确定' : _props$okText,
31
- _props$cancelText = props.cancelText,
32
- cancelText = _props$cancelText === void 0 ? '取消' : _props$cancelText,
33
31
  visible = props.visible,
34
32
  open = props.open,
35
- other = __rest(props, ["wrapClassName", "size", "onOk", "onCancel", "okText", "cancelText", "visible", "open"]);
33
+ other = __rest(props, ["wrapClassName", "size", "onOk", "onCancel", "visible", "open"]);
36
34
 
37
35
  var defaultFooterSize = React.useContext(SizeContext) || 'middle';
38
- return /*#__PURE__*/React.createElement(_Modal, Object.assign({
39
- wrapClassName: classNames(wrapClassName, prefixCls),
40
- width: size === 'default' ? 552 : 416,
41
- footer: [/*#__PURE__*/React.createElement(Button, {
36
+ var defaultFooter = /*#__PURE__*/React.createElement(LocaleReceiver, {
37
+ componentName: "Modal",
38
+ defaultLocale: getConfirmLocale()
39
+ }, function (contextLocale) {
40
+ var okText = props.okText,
41
+ cancelText = props.cancelText;
42
+ return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Button, Object.assign({
42
43
  onClick: onCancel,
43
44
  key: 'canncel_button',
44
45
  size: defaultFooterSize
45
- }, cancelText), /*#__PURE__*/React.createElement(Button, {
46
+ }, props.cancelButtonProps), cancelText || contextLocale.cancelText), /*#__PURE__*/React.createElement(Button, Object.assign({
46
47
  type: "primary",
47
48
  onClick: onOk,
48
49
  key: 'ok_button',
49
50
  size: defaultFooterSize
50
- }, okText)]
51
+ }, props.okButtonProps), okText !== null && okText !== void 0 ? okText : contextLocale.okText));
52
+ });
53
+ return /*#__PURE__*/React.createElement(_Modal, Object.assign({
54
+ wrapClassName: classNames(wrapClassName, prefixCls),
55
+ width: size === 'default' ? 552 : 416,
56
+ footer: defaultFooter
51
57
  }, other, {
52
58
  onOk: onOk,
53
59
  onCancel: onCancel,
54
- okText: okText,
55
- visible: visible || open,
56
- cancelText: cancelText
60
+ visible: visible || open
57
61
  }));
58
62
  };
59
63
 
@@ -0,0 +1,7 @@
1
+ export interface ModalLocale {
2
+ okText: string;
3
+ cancelText: string;
4
+ justOkText: string;
5
+ }
6
+ export declare function changeConfirmLocale(newLocale?: ModalLocale): void;
7
+ export declare function getConfirmLocale(): ModalLocale;
@@ -0,0 +1,12 @@
1
+ import defaultLocale from '../Locale/default';
2
+ var runtimeLocale = Object.assign({}, defaultLocale.Modal);
3
+ export function changeConfirmLocale(newLocale) {
4
+ if (newLocale) {
5
+ runtimeLocale = Object.assign(Object.assign({}, runtimeLocale), newLocale);
6
+ } else {
7
+ runtimeLocale = Object.assign({}, defaultLocale.Modal);
8
+ }
9
+ }
10
+ export function getConfirmLocale() {
11
+ return runtimeLocale;
12
+ }
@@ -198,6 +198,7 @@
198
198
  --font-size-base: 14px;
199
199
  --font-size-lg: calc(var(--font-size-base) + 2px);
200
200
  --font-size-sm: 12px;
201
+ --border-radius: 2px;
201
202
  --color-contrast: #fff;
202
203
  --color-100: #000;
203
204
  --color-85: #262626;
@@ -198,6 +198,7 @@
198
198
  --font-size-base: 14px;
199
199
  --font-size-lg: calc(var(--font-size-base) + 2px);
200
200
  --font-size-sm: 12px;
201
+ --border-radius: 2px;
201
202
  --color-contrast: #fff;
202
203
  --color-100: #000;
203
204
  --color-85: #262626;
@@ -198,6 +198,7 @@
198
198
  --font-size-base: 14px;
199
199
  --font-size-lg: calc(var(--font-size-base) + 2px);
200
200
  --font-size-sm: 12px;
201
+ --border-radius: 2px;
201
202
  --color-contrast: #fff;
202
203
  --color-100: #000;
203
204
  --color-85: #262626;
@@ -198,6 +198,7 @@
198
198
  --font-size-base: 14px;
199
199
  --font-size-lg: calc(var(--font-size-base) + 2px);
200
200
  --font-size-sm: 12px;
201
+ --border-radius: 2px;
201
202
  --color-contrast: #fff;
202
203
  --color-100: #000;
203
204
  --color-85: #262626;
@@ -198,6 +198,7 @@
198
198
  --font-size-base: 14px;
199
199
  --font-size-lg: calc(var(--font-size-base) + 2px);
200
200
  --font-size-sm: 12px;
201
+ --border-radius: 2px;
201
202
  --color-contrast: #fff;
202
203
  --color-100: #000;
203
204
  --color-85: #262626;
@@ -198,6 +198,7 @@
198
198
  --font-size-base: 14px;
199
199
  --font-size-lg: calc(var(--font-size-base) + 2px);
200
200
  --font-size-sm: 12px;
201
+ --border-radius: 2px;
201
202
  --color-contrast: #fff;
202
203
  --color-100: #000;
203
204
  --color-85: #262626;
@@ -198,6 +198,7 @@
198
198
  --font-size-base: 14px;
199
199
  --font-size-lg: calc(var(--font-size-base) + 2px);
200
200
  --font-size-sm: 12px;
201
+ --border-radius: 2px;
201
202
  --color-contrast: #fff;
202
203
  --color-100: #000;
203
204
  --color-85: #262626;
@@ -516,6 +517,11 @@ p {
516
517
  z-index: 999;
517
518
  background-color: #fff;
518
519
  }
520
+ .lm_quick_menu .ant-btn {
521
+ border: 0;
522
+ border-radius: 4px;
523
+ box-shadow: 0px 12px 48px 0px rgba(0, 0, 0, 0.03), 0px 9px 28px 0px rgba(0, 0, 0, 0.05), 0px 6px 16px 0px rgba(0, 0, 0, 0.08);
524
+ }
519
525
  .lm_quick_menu .lm_menu_list {
520
526
  position: relative;
521
527
  width: 0;
@@ -5,6 +5,11 @@
5
5
  z-index: 999;
6
6
  background-color: #fff;
7
7
  }
8
+ .lm_quick_menu .ant-btn {
9
+ border: 0;
10
+ border-radius: 4px;
11
+ box-shadow: 0px 12px 48px 0px rgba(0, 0, 0, 0.03), 0px 9px 28px 0px rgba(0, 0, 0, 0.05), 0px 6px 16px 0px rgba(0, 0, 0, 0.08);
12
+ }
8
13
  .lm_quick_menu .lm_menu_list {
9
14
  position: relative;
10
15
  width: 0;
@@ -198,6 +198,7 @@
198
198
  --font-size-base: 14px;
199
199
  --font-size-lg: calc(var(--font-size-base) + 2px);
200
200
  --font-size-sm: 12px;
201
+ --border-radius: 2px;
201
202
  --color-contrast: #fff;
202
203
  --color-100: #000;
203
204
  --color-85: #262626;
@@ -198,6 +198,7 @@
198
198
  --font-size-base: 14px;
199
199
  --font-size-lg: calc(var(--font-size-base) + 2px);
200
200
  --font-size-sm: 12px;
201
+ --border-radius: 2px;
201
202
  --color-contrast: #fff;
202
203
  --color-100: #000;
203
204
  --color-85: #262626;
@@ -198,6 +198,7 @@
198
198
  --font-size-base: 14px;
199
199
  --font-size-lg: calc(var(--font-size-base) + 2px);
200
200
  --font-size-sm: 12px;
201
+ --border-radius: 2px;
201
202
  --color-contrast: #fff;
202
203
  --color-100: #000;
203
204
  --color-85: #262626;
@@ -198,6 +198,7 @@
198
198
  --font-size-base: 14px;
199
199
  --font-size-lg: calc(var(--font-size-base) + 2px);
200
200
  --font-size-sm: 12px;
201
+ --border-radius: 2px;
201
202
  --color-contrast: #fff;
202
203
  --color-100: #000;
203
204
  --color-85: #262626;
@@ -198,6 +198,7 @@
198
198
  --font-size-base: 14px;
199
199
  --font-size-lg: calc(var(--font-size-base) + 2px);
200
200
  --font-size-sm: 12px;
201
+ --border-radius: 2px;
201
202
  --color-contrast: #fff;
202
203
  --color-100: #000;
203
204
  --color-85: #262626;
@@ -198,6 +198,7 @@
198
198
  --font-size-base: 14px;
199
199
  --font-size-lg: calc(var(--font-size-base) + 2px);
200
200
  --font-size-sm: 12px;
201
+ --border-radius: 2px;
201
202
  --color-contrast: #fff;
202
203
  --color-100: #000;
203
204
  --color-85: #262626;
@@ -198,6 +198,7 @@
198
198
  --font-size-base: 14px;
199
199
  --font-size-lg: calc(var(--font-size-base) + 2px);
200
200
  --font-size-sm: 12px;
201
+ --border-radius: 2px;
201
202
  --color-contrast: #fff;
202
203
  --color-100: #000;
203
204
  --color-85: #262626;
@@ -198,6 +198,7 @@
198
198
  --font-size-base: 14px;
199
199
  --font-size-lg: calc(var(--font-size-base) + 2px);
200
200
  --font-size-sm: 12px;
201
+ --border-radius: 2px;
201
202
  --color-contrast: #fff;
202
203
  --color-100: #000;
203
204
  --color-85: #262626;
@@ -198,6 +198,7 @@
198
198
  --font-size-base: 14px;
199
199
  --font-size-lg: calc(var(--font-size-base) + 2px);
200
200
  --font-size-sm: 12px;
201
+ --border-radius: 2px;
201
202
  --color-contrast: #fff;
202
203
  --color-100: #000;
203
204
  --color-85: #262626;