linkmore-design 1.1.10 → 1.1.12

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 (235) hide show
  1. package/dist/Button/demos/type.d.ts +2 -0
  2. package/dist/Cascader/demos/formItem.d.ts +2 -0
  3. package/dist/CustomTableOption/index.d.ts +1 -0
  4. package/dist/CustomTableOption/locale/en_US.d.ts +19 -0
  5. package/dist/CustomTableOption/locale/zh_CN.d.ts +19 -0
  6. package/dist/LmEditTable/demos/priceTable.d.ts +2 -0
  7. package/dist/LmEditTable/util.d.ts +1 -0
  8. package/dist/LmFilter/demos/filterControl.d.ts +2 -0
  9. package/dist/Locale/default.d.ts +4 -1
  10. package/dist/Locale/zh_CN.d.ts +4 -1
  11. package/dist/Modal/demos/locale.d.ts +2 -0
  12. package/dist/Modal/locale.d.ts +7 -0
  13. package/dist/Select/demos/formItem.d.ts +2 -0
  14. package/dist/Select/index.d.ts +1 -0
  15. package/dist/TreeSelect/demos/formItem.d.ts +2 -0
  16. package/dist/TreeSelect/index.d.ts +8 -3
  17. package/dist/base.css +1 -0
  18. package/dist/index.umd.js +394 -206
  19. package/dist/index.umd.min.js +6 -6
  20. package/dist/variables.css +45 -12
  21. package/es/Affix/style/index.css +1 -0
  22. package/es/Alert/style/index.css +1 -0
  23. package/es/Approval/style/index.css +1 -0
  24. package/es/AutoComplete/style/index.css +1 -0
  25. package/es/Avatar/style/index.css +1 -0
  26. package/es/Badge/style/index.css +1 -0
  27. package/es/Breadcrumb/style/index.css +1 -0
  28. package/es/Button/style/index.css +4 -1
  29. package/es/Button/style/variables.css +4 -1
  30. package/es/ButtonTags/style/index.css +1 -0
  31. package/es/Calendar/style/index.css +1 -0
  32. package/es/Card/style/index.css +1 -0
  33. package/es/CardTable/style/index.css +7 -9
  34. package/es/CardTable/style/variables.css +7 -9
  35. package/es/Carousel/style/index.css +1 -0
  36. package/es/Cascader/style/index.css +1 -0
  37. package/es/Col/style/index.css +1 -0
  38. package/es/Collapse/style/index.css +1 -0
  39. package/es/Comment/style/index.css +1 -0
  40. package/es/CustomTableOption/cardSort.js +21 -16
  41. package/es/CustomTableOption/columnsSort.js +16 -16
  42. package/es/CustomTableOption/filterSort.js +11 -11
  43. package/es/CustomTableOption/index.d.ts +1 -0
  44. package/es/CustomTableOption/index.js +45 -17
  45. package/es/CustomTableOption/locale/en_US.d.ts +19 -0
  46. package/es/CustomTableOption/locale/en_US.js +19 -0
  47. package/es/CustomTableOption/locale/zh_CN.d.ts +19 -0
  48. package/es/CustomTableOption/locale/zh_CN.js +19 -0
  49. package/es/CustomTableOption/style/index.css +5 -0
  50. package/es/CustomTableOption/style/variables.css +4 -0
  51. package/es/CustomerService/style/index.css +1 -0
  52. package/es/DatePicker/style/index.css +1 -0
  53. package/es/Descriptions/style/index.css +1 -0
  54. package/es/Divider/style/index.css +1 -0
  55. package/es/Drawer/style/index.css +1 -0
  56. package/es/Dropdown/style/index.css +3 -2
  57. package/es/Dropdown/style/variables.css +2 -2
  58. package/es/EditTable/style/index.css +1 -0
  59. package/es/Empty/style/index.css +1 -0
  60. package/es/Filter/style/index.css +1 -0
  61. package/es/Form/style/index.css +1 -0
  62. package/es/FullScreen/style/index.css +1 -0
  63. package/es/Grid/style/index.css +1 -0
  64. package/es/Icon/style/index.css +1 -0
  65. package/es/Image/style/index.css +1 -0
  66. package/es/Input/style/index.css +1 -0
  67. package/es/InputNumber/style/index.css +1 -0
  68. package/es/Layout/style/index.css +1 -0
  69. package/es/LeftTable/index.js +3 -1
  70. package/es/LeftTable/style/index.css +1 -0
  71. package/es/List/style/index.css +1 -0
  72. package/es/LmEditTable/EditTable.js +102 -98
  73. package/es/LmEditTable/style/index.css +23 -0
  74. package/es/LmEditTable/style/variables.css +22 -0
  75. package/es/LmEditTable/util.d.ts +1 -0
  76. package/es/LmEditTable/util.js +27 -0
  77. package/es/LmSelect/style/index.css +1 -0
  78. package/es/LmTable/style/index.css +1 -0
  79. package/es/Locale/default.d.ts +4 -1
  80. package/es/Locale/default.js +3 -1
  81. package/es/Locale/zh_CN.d.ts +4 -1
  82. package/es/Locale/zh_CN.js +3 -1
  83. package/es/Mentions/style/index.css +1 -0
  84. package/es/Menu/style/index.css +1 -0
  85. package/es/Modal/index.js +18 -14
  86. package/es/Modal/locale.d.ts +7 -0
  87. package/es/Modal/locale.js +12 -0
  88. package/es/Modal/style/index.css +1 -0
  89. package/es/PageHeader/style/index.css +1 -0
  90. package/es/Pagination/style/index.css +1 -0
  91. package/es/Popconfirm/style/index.css +1 -0
  92. package/es/Popover/style/index.css +1 -0
  93. package/es/Progress/style/index.css +1 -0
  94. package/es/QuickMenu/style/index.css +6 -0
  95. package/es/QuickMenu/style/variables.css +5 -0
  96. package/es/Rate/style/index.css +1 -0
  97. package/es/Result/style/index.css +1 -0
  98. package/es/Row/style/index.css +1 -0
  99. package/es/Segmented/style/index.css +1 -0
  100. package/es/Select/index.d.ts +1 -0
  101. package/es/Select/index.js +38 -4
  102. package/es/Select/style/index.css +1 -0
  103. package/es/Skeleton/style/index.css +1 -0
  104. package/es/Slider/style/index.css +1 -0
  105. package/es/Space/style/index.css +1 -0
  106. package/es/Spin/style/index.css +1 -0
  107. package/es/Statistic/style/index.css +1 -0
  108. package/es/Steps/style/index.css +1 -0
  109. package/es/Switch/style/index.css +1 -0
  110. package/es/Table/style/index.css +1 -0
  111. package/es/Tabs/style/index.css +1 -0
  112. package/es/Tag/style/index.css +1 -0
  113. package/es/TimePicker/style/index.css +1 -0
  114. package/es/Timeline/style/index.css +1 -0
  115. package/es/Tooltip/style/index.css +1 -0
  116. package/es/Transfer/style/index.css +1 -0
  117. package/es/Tree/style/index.css +1 -0
  118. package/es/TreeSelect/index.d.ts +8 -3
  119. package/es/TreeSelect/index.js +74 -1
  120. package/es/TreeSelect/style/index.css +1 -0
  121. package/es/Typography/style/index.css +1 -0
  122. package/es/Upload/style/index.css +1 -0
  123. package/es/locale-provider/style/index.css +1 -0
  124. package/es/message/style/index.css +1 -0
  125. package/es/notification/style/index.css +1 -0
  126. package/es/styles/main.css +1 -0
  127. package/es/styles/variables.css +45 -12
  128. package/lib/Affix/style/index.css +1 -0
  129. package/lib/Alert/style/index.css +1 -0
  130. package/lib/Approval/style/index.css +1 -0
  131. package/lib/AutoComplete/style/index.css +1 -0
  132. package/lib/Avatar/style/index.css +1 -0
  133. package/lib/Badge/style/index.css +1 -0
  134. package/lib/Breadcrumb/style/index.css +1 -0
  135. package/lib/Button/style/index.css +4 -1
  136. package/lib/Button/style/variables.css +4 -1
  137. package/lib/ButtonTags/style/index.css +1 -0
  138. package/lib/Calendar/style/index.css +1 -0
  139. package/lib/Card/style/index.css +1 -0
  140. package/lib/CardTable/style/index.css +7 -9
  141. package/lib/CardTable/style/variables.css +7 -9
  142. package/lib/Carousel/style/index.css +1 -0
  143. package/lib/Cascader/style/index.css +1 -0
  144. package/lib/Col/style/index.css +1 -0
  145. package/lib/Collapse/style/index.css +1 -0
  146. package/lib/Comment/style/index.css +1 -0
  147. package/lib/CustomTableOption/cardSort.js +20 -15
  148. package/lib/CustomTableOption/columnsSort.js +16 -16
  149. package/lib/CustomTableOption/filterSort.js +11 -11
  150. package/lib/CustomTableOption/index.d.ts +1 -0
  151. package/lib/CustomTableOption/index.js +45 -16
  152. package/lib/CustomTableOption/locale/en_US.d.ts +19 -0
  153. package/lib/CustomTableOption/locale/en_US.js +26 -0
  154. package/lib/CustomTableOption/locale/zh_CN.d.ts +19 -0
  155. package/lib/CustomTableOption/locale/zh_CN.js +26 -0
  156. package/lib/CustomTableOption/style/index.css +5 -0
  157. package/lib/CustomTableOption/style/variables.css +4 -0
  158. package/lib/CustomerService/style/index.css +1 -0
  159. package/lib/DatePicker/style/index.css +1 -0
  160. package/lib/Descriptions/style/index.css +1 -0
  161. package/lib/Divider/style/index.css +1 -0
  162. package/lib/Drawer/style/index.css +1 -0
  163. package/lib/Dropdown/style/index.css +3 -2
  164. package/lib/Dropdown/style/variables.css +2 -2
  165. package/lib/EditTable/style/index.css +1 -0
  166. package/lib/Empty/style/index.css +1 -0
  167. package/lib/Filter/style/index.css +1 -0
  168. package/lib/Form/style/index.css +1 -0
  169. package/lib/FullScreen/style/index.css +1 -0
  170. package/lib/Grid/style/index.css +1 -0
  171. package/lib/Icon/style/index.css +1 -0
  172. package/lib/Image/style/index.css +1 -0
  173. package/lib/Input/style/index.css +1 -0
  174. package/lib/InputNumber/style/index.css +1 -0
  175. package/lib/Layout/style/index.css +1 -0
  176. package/lib/LeftTable/index.js +3 -1
  177. package/lib/LeftTable/style/index.css +1 -0
  178. package/lib/List/style/index.css +1 -0
  179. package/lib/LmEditTable/EditTable.js +101 -96
  180. package/lib/LmEditTable/style/index.css +23 -0
  181. package/lib/LmEditTable/style/variables.css +22 -0
  182. package/lib/LmEditTable/util.d.ts +1 -0
  183. package/lib/LmEditTable/util.js +30 -0
  184. package/lib/LmSelect/style/index.css +1 -0
  185. package/lib/LmTable/style/index.css +1 -0
  186. package/lib/Locale/default.d.ts +4 -1
  187. package/lib/Locale/default.js +4 -1
  188. package/lib/Locale/zh_CN.d.ts +4 -1
  189. package/lib/Locale/zh_CN.js +4 -1
  190. package/lib/Mentions/style/index.css +1 -0
  191. package/lib/Menu/style/index.css +1 -0
  192. package/lib/Modal/index.js +22 -14
  193. package/lib/Modal/locale.d.ts +7 -0
  194. package/lib/Modal/locale.js +25 -0
  195. package/lib/Modal/style/index.css +1 -0
  196. package/lib/PageHeader/style/index.css +1 -0
  197. package/lib/Pagination/style/index.css +1 -0
  198. package/lib/Popconfirm/style/index.css +1 -0
  199. package/lib/Popover/style/index.css +1 -0
  200. package/lib/Progress/style/index.css +1 -0
  201. package/lib/QuickMenu/style/index.css +6 -0
  202. package/lib/QuickMenu/style/variables.css +5 -0
  203. package/lib/Rate/style/index.css +1 -0
  204. package/lib/Result/style/index.css +1 -0
  205. package/lib/Row/style/index.css +1 -0
  206. package/lib/Segmented/style/index.css +1 -0
  207. package/lib/Select/index.d.ts +1 -0
  208. package/lib/Select/index.js +37 -3
  209. package/lib/Select/style/index.css +1 -0
  210. package/lib/Skeleton/style/index.css +1 -0
  211. package/lib/Slider/style/index.css +1 -0
  212. package/lib/Space/style/index.css +1 -0
  213. package/lib/Spin/style/index.css +1 -0
  214. package/lib/Statistic/style/index.css +1 -0
  215. package/lib/Steps/style/index.css +1 -0
  216. package/lib/Switch/style/index.css +1 -0
  217. package/lib/Table/style/index.css +1 -0
  218. package/lib/Tabs/style/index.css +1 -0
  219. package/lib/Tag/style/index.css +1 -0
  220. package/lib/TimePicker/style/index.css +1 -0
  221. package/lib/Timeline/style/index.css +1 -0
  222. package/lib/Tooltip/style/index.css +1 -0
  223. package/lib/Transfer/style/index.css +1 -0
  224. package/lib/Tree/style/index.css +1 -0
  225. package/lib/TreeSelect/index.d.ts +8 -3
  226. package/lib/TreeSelect/index.js +78 -1
  227. package/lib/TreeSelect/style/index.css +1 -0
  228. package/lib/Typography/style/index.css +1 -0
  229. package/lib/Upload/style/index.css +1 -0
  230. package/lib/locale-provider/style/index.css +1 -0
  231. package/lib/message/style/index.css +1 -0
  232. package/lib/notification/style/index.css +1 -0
  233. package/lib/styles/main.css +1 -0
  234. package/lib/styles/variables.css +45 -12
  235. package/package.json +1 -1
@@ -29,6 +29,8 @@ var _lodash = require("lodash");
29
29
 
30
30
  var _react = _interopRequireWildcard(require("react"));
31
31
 
32
+ var _ahooks = require("ahooks");
33
+
32
34
  var _immer = require("immer");
33
35
 
34
36
  var _DndContainer = _interopRequireDefault(require("./DndContainer"));
@@ -269,11 +271,21 @@ var Opetate = function Opetate(_ref) {
269
271
  options = _ref$options === void 0 ? ['add', 'delete'] : _ref$options,
270
272
  getLength = _ref.getLength,
271
273
  quickOpetateClearAll = _ref.quickOpetateClearAll;
274
+
275
+ var appendChildren = function appendChildren() {
276
+ handleAdd === null || handleAdd === void 0 ? void 0 : handleAdd(record, true);
277
+ };
278
+
279
+ var appendAdd = function appendAdd() {
280
+ handleAdd === null || handleAdd === void 0 ? void 0 : handleAdd(record);
281
+ };
282
+
272
283
  return /*#__PURE__*/_react.default.createElement("div", {
273
284
  style: {
274
285
  display: 'flex',
275
286
  alignItems: 'center',
276
- justifyContent: 'center'
287
+ justifyContent: 'flex-start',
288
+ marginLeft: '-4px'
277
289
  }
278
290
  }, options.includes('delete') && /*#__PURE__*/_react.default.createElement(_linkmoreDesign.Button, {
279
291
  type: "link",
@@ -288,7 +300,27 @@ var Opetate = function Opetate(_ref) {
288
300
  onClick: function onClick() {
289
301
  return handleDelete(record[rowKey]);
290
302
  }
291
- }), options.includes('add') && /*#__PURE__*/_react.default.createElement(_linkmoreDesign.Button, {
303
+ }), (options === null || options === void 0 ? void 0 : options.includes('add')) && (options === null || options === void 0 ? void 0 : options.includes('addInChildren')) ? /*#__PURE__*/_react.default.createElement(_linkmoreDesign.Popover, {
304
+ placement: "bottom",
305
+ overlayClassName: 'lm_table_append_add_popover',
306
+ open: open,
307
+ title: null,
308
+ content: /*#__PURE__*/_react.default.createElement("ul", null, /*#__PURE__*/_react.default.createElement("li", {
309
+ onClick: appendAdd
310
+ }, "\u6DFB\u52A0\u5E73\u7EA7"), /*#__PURE__*/_react.default.createElement("li", {
311
+ onClick: appendChildren
312
+ }, "\u6DFB\u52A0\u5B50\u7EA7")),
313
+ trigger: "hover"
314
+ }, /*#__PURE__*/_react.default.createElement(_linkmoreDesign.Button, {
315
+ type: "link",
316
+ size: "small",
317
+ icon: /*#__PURE__*/_react.default.createElement(_linkmoreDesign.IconFont, {
318
+ type: "lmweb-plus-circle-fill",
319
+ style: {
320
+ fontSize: 16
321
+ }
322
+ })
323
+ })) : /*#__PURE__*/_react.default.createElement(_linkmoreDesign.Button, {
292
324
  type: "link",
293
325
  size: "small",
294
326
  icon: /*#__PURE__*/_react.default.createElement(_linkmoreDesign.IconFont, {
@@ -298,7 +330,7 @@ var Opetate = function Opetate(_ref) {
298
330
  }
299
331
  }),
300
332
  onClick: function onClick() {
301
- return handleAdd(record);
333
+ return handleAdd(record, (options === null || options === void 0 ? void 0 : options.includes('addInChildren')) ? true : false);
302
334
  }
303
335
  }));
304
336
  }; // const isValidValue = (verifyValue) => {
@@ -715,35 +747,39 @@ var EditTable = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
715
747
  recordCreatorProps = props.recordCreatorProps,
716
748
  _props$shouldUpdate = props.shouldUpdate,
717
749
  shouldUpdate = _props$shouldUpdate === void 0 ? false : _props$shouldUpdate,
718
- resetProps = __rest(props, ["value", "columns", "isEdit", "isAdd", "onChange", "rowKey", "rowHoverEdit", "isUseForm", "isHoverEdit", "useQuickOpetate", "quickOpetateClearAll", "rowSelection", "sortOpen", "colSortOpen", "filterChange", "size", "recordCreatorProps", "shouldUpdate"]);
750
+ 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([]);
719
751
 
720
- var _useState5 = (0, _react.useState)([]),
721
- _useState6 = (0, _slicedToArray2.default)(_useState5, 2),
722
- dataSource = _useState6[0],
723
- setDataSource = _useState6[1]; // const [count, setCount] = useState(0);
724
752
 
753
+ var _useControllableValue = (0, _ahooks.useControllableValue)({
754
+ value: (0, _util.checkRowKeyByDataSource)(props.value, _rowKey),
755
+ onChange: props.onChange
756
+ }),
757
+ _useControllableValue2 = (0, _slicedToArray2.default)(_useControllableValue, 2),
758
+ dataSource = _useControllableValue2[0],
759
+ setDataSource = _useControllableValue2[1]; // const [count, setCount] = useState(0);
725
760
 
726
- var _useState7 = (0, _react.useState)({}),
761
+
762
+ var _useState5 = (0, _react.useState)({}),
763
+ _useState6 = (0, _slicedToArray2.default)(_useState5, 2),
764
+ _valid = _useState6[0],
765
+ setValid = _useState6[1];
766
+
767
+ var _useState7 = (0, _react.useState)([]),
727
768
  _useState8 = (0, _slicedToArray2.default)(_useState7, 2),
728
- _valid = _useState8[0],
729
- setValid = _useState8[1];
769
+ localRowSelectList = _useState8[0],
770
+ setLocalRowSelectList = _useState8[1];
730
771
 
731
772
  var _useState9 = (0, _react.useState)([]),
732
773
  _useState10 = (0, _slicedToArray2.default)(_useState9, 2),
733
- localRowSelectList = _useState10[0],
734
- setLocalRowSelectList = _useState10[1];
735
-
736
- var _useState11 = (0, _react.useState)([]),
737
- _useState12 = (0, _slicedToArray2.default)(_useState11, 2),
738
- sortEditTable = _useState12[0],
739
- setCallBackFalg = _useState12[1];
774
+ sortEditTable = _useState10[0],
775
+ setCallBackFalg = _useState10[1];
740
776
  /** 当前展开的列 */
741
777
 
742
778
 
743
- var _useState13 = (0, _react.useState)([]),
744
- _useState14 = (0, _slicedToArray2.default)(_useState13, 2),
745
- expandedRowKeys = _useState14[0],
746
- setExpandedRowKeys = _useState14[1];
779
+ var _useState11 = (0, _react.useState)([]),
780
+ _useState12 = (0, _slicedToArray2.default)(_useState11, 2),
781
+ expandedRowKeys = _useState12[0],
782
+ setExpandedRowKeys = _useState12[1];
747
783
 
748
784
  var dataSourceRef = (0, _react.useRef)([]);
749
785
  var sortDataSorceRef = (0, _react.useRef)([]);
@@ -757,12 +793,7 @@ var EditTable = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
757
793
  var newIndex = cloneArr.findIndex(function (v) {
758
794
  return v[_rowKey] === over;
759
795
  });
760
-
761
- if (onChange) {
762
- onChange === null || onChange === void 0 ? void 0 : onChange((0, _sortable.arrayMove)(cloneArr, oldIndex, newIndex));
763
- } else {
764
- setDataSource((0, _sortable.arrayMove)(cloneArr, oldIndex, newIndex));
765
- }
796
+ setDataSource((0, _sortable.arrayMove)(cloneArr, oldIndex, newIndex));
766
797
  };
767
798
 
768
799
  var onColSortEnd = function onColSortEnd(active, over) {
@@ -785,8 +816,9 @@ var EditTable = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
785
816
  var handleDelete = function handleDelete(key) {
786
817
  var nValue = dataSource.filter(function (item) {
787
818
  return item[_rowKey] !== key;
788
- });
789
- onChange === null || onChange === void 0 ? void 0 : onChange(nValue);
819
+ }); // onChange?.(nValue)
820
+
821
+ setDataSource(nValue);
790
822
  };
791
823
  /** 点击添加按钮添加 */
792
824
 
@@ -798,14 +830,14 @@ var EditTable = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
798
830
  var res = (0, _immer.produce)(dataSourceRef.current, function (draft) {
799
831
  draft.push(Object.assign((0, _defineProperty2.default)({}, _rowKey, "".concat(Date.now())), addDataInfo || {}));
800
832
  });
801
- setDataSource(res);
802
- onChange === null || onChange === void 0 ? void 0 : onChange(res);
833
+ setDataSource(res); // onChange?.(res)
803
834
  };
804
835
 
805
836
  (0, _react.useEffect)(function () {
806
837
  var _a;
807
838
 
808
839
  dataSourceRef.current = dataSource;
840
+ deepDataSourceRef.current = (0, _util.deepDataSourcePreKeys)(dataSource, _rowKey);
809
841
 
810
842
  if (sortOpen) {
811
843
  var dataSourceKeys = dataSource === null || dataSource === void 0 ? void 0 : dataSource.map(function (item) {
@@ -910,12 +942,7 @@ var EditTable = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
910
942
  }
911
943
  }
912
944
  });
913
-
914
- if (onChange) {
915
- onChange === null || onChange === void 0 ? void 0 : onChange(res);
916
- } else {
917
- setDataSource(res);
918
- }
945
+ setDataSource(res);
919
946
  };
920
947
 
921
948
  var reWriteOriginSource = function reWriteOriginSource(rowKey, rowValue, dataIndex, nextValue) {
@@ -956,12 +983,7 @@ var EditTable = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
956
983
  };
957
984
 
958
985
  var res = filter(dataSource, key);
959
-
960
- if (onChange) {
961
- onChange === null || onChange === void 0 ? void 0 : onChange(res);
962
- } else {
963
- setDataSource(res);
964
- }
986
+ setDataSource(res);
965
987
  } else {
966
988
  if (((_c = dataSourceRef.current) === null || _c === void 0 ? void 0 : _c.length) === 1 && !quickOpetateClearAll) {
967
989
  return false;
@@ -977,27 +999,37 @@ var EditTable = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
977
999
  }
978
1000
  });
979
1001
 
980
- if (onChange) {
981
- onChange === null || onChange === void 0 ? void 0 : onChange(_res);
982
- } else {
983
- setDataSource(_res);
984
- }
1002
+ setDataSource(_res);
985
1003
  }
986
1004
  };
987
1005
  /** 快捷添加 */
988
1006
 
989
1007
 
990
- var handleTableRowAdd = function handleTableRowAdd(record) {
1008
+ var handleTableRowAdd = function handleTableRowAdd(record, isAppendInChindren) {
991
1009
  var _a, _b;
992
1010
 
993
1011
  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;
994
1012
  var res = (0, _immer.produce)(dataSourceRef.current, function (draft) {
1013
+ var _a, _b, _c, _d;
1014
+
995
1015
  if (preKeys.length > 1) {
996
1016
  var deeps = function deeps(children) {
997
1017
  children === null || children === void 0 ? void 0 : children.forEach(function (item, index) {
1018
+ var _a;
1019
+
998
1020
  if (preKeys === null || preKeys === void 0 ? void 0 : preKeys.includes(item[_rowKey])) {
999
1021
  if (item[_rowKey] === record[_rowKey]) {
1000
- children.splice(index + 1, 0, (0, _defineProperty2.default)({}, _rowKey, "".concat(Date.now())));
1022
+ if (isAppendInChindren) {
1023
+ if (item === null || item === void 0 ? void 0 : item.children) {
1024
+ (_a = item === null || item === void 0 ? void 0 : item.children) === null || _a === void 0 ? void 0 : _a.push((0, _defineProperty2.default)({}, _rowKey, "".concat(Date.now())));
1025
+ } else {
1026
+ item.children = [(0, _defineProperty2.default)({}, _rowKey, "".concat(Date.now()))];
1027
+ }
1028
+
1029
+ !expandedRowKeys.includes(item[_rowKey]) && setExpandedRowKeys([].concat((0, _toConsumableArray2.default)(expandedRowKeys), [item[_rowKey]]));
1030
+ } else {
1031
+ children.splice(index + 1, 0, (0, _defineProperty2.default)({}, _rowKey, "".concat(Date.now())));
1032
+ }
1001
1033
  } else if (item.children) {
1002
1034
  deeps(item.children);
1003
1035
  }
@@ -1012,16 +1044,21 @@ var EditTable = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
1012
1044
  });
1013
1045
 
1014
1046
  if (index !== -1) {
1015
- draft.splice(index + 1, 0, (0, _defineProperty2.default)({}, _rowKey, "".concat(Date.now())));
1047
+ if (isAppendInChindren) {
1048
+ if ((_a = draft[index].children) === null || _a === void 0 ? void 0 : _a.length) {
1049
+ (_b = draft[index].children) === null || _b === void 0 ? void 0 : _b.push((0, _defineProperty2.default)({}, _rowKey, "".concat(Date.now())));
1050
+ } else {
1051
+ draft[index].children = [(0, _defineProperty2.default)({}, _rowKey, "".concat(Date.now()))];
1052
+ }
1053
+
1054
+ !expandedRowKeys.includes((_c = draft[index]) === null || _c === void 0 ? void 0 : _c[_rowKey]) && setExpandedRowKeys([].concat((0, _toConsumableArray2.default)(expandedRowKeys), [(_d = draft[index]) === null || _d === void 0 ? void 0 : _d[_rowKey]]));
1055
+ } else {
1056
+ draft.splice(index + 1, 0, (0, _defineProperty2.default)({}, _rowKey, "".concat(Date.now())));
1057
+ }
1016
1058
  }
1017
1059
  }
1018
1060
  });
1019
-
1020
- if (onChange) {
1021
- onChange === null || onChange === void 0 ? void 0 : onChange(res);
1022
- } else {
1023
- setDataSource(res);
1024
- }
1061
+ setDataSource(res);
1025
1062
  };
1026
1063
 
1027
1064
  var handleCopy = function handleCopy(key, value) {
@@ -1030,12 +1067,7 @@ var EditTable = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
1030
1067
  return item[key] = value;
1031
1068
  });
1032
1069
  });
1033
-
1034
- if (onChange) {
1035
- onChange === null || onChange === void 0 ? void 0 : onChange(res);
1036
- } else {
1037
- setDataSource(res);
1038
- }
1070
+ setDataSource(res);
1039
1071
  };
1040
1072
  /** 判断columne中有没有带optionOnly参数 */
1041
1073
 
@@ -1059,9 +1091,9 @@ var EditTable = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
1059
1091
 
1060
1092
  var DisableOptions = (0, _react.useMemo)(function () {
1061
1093
  var newColumns = columns === null || columns === void 0 ? void 0 : columns.map(function (item) {
1062
- var _ref3 = item.componentProps || {},
1063
- optionOnly = _ref3.optionOnly,
1064
- options = _ref3.options;
1094
+ var _ref5 = item.componentProps || {},
1095
+ optionOnly = _ref5.optionOnly,
1096
+ options = _ref5.options;
1065
1097
 
1066
1098
  if (optionOnly && options) {
1067
1099
  var dataIndex = item.dataIndex;
@@ -1108,6 +1140,7 @@ var EditTable = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
1108
1140
  width: 68,
1109
1141
  fixed: 'right',
1110
1142
  editable: 'lm_edit_opetate',
1143
+ className: 'lm_edit_opetate',
1111
1144
  componentProps: {
1112
1145
  options: Array.isArray(useQuickOpetate) ? useQuickOpetate : ['add', 'delete']
1113
1146
  }
@@ -1151,7 +1184,7 @@ var EditTable = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
1151
1184
  editable = col.editable,
1152
1185
  relevanceCols = col.relevanceCols;
1153
1186
 
1154
- if ((col === null || col === void 0 ? void 0 : col.fixed) || hasDisableOptions && hasDisableOptions.includes(dataIndex) || ((_a = col.componentProps) === null || _a === void 0 ? void 0 : _a.options) || editable === 'render' || !!relevanceCols || !!shouldUpdate) {
1187
+ if ((col === null || col === void 0 ? void 0 : col.fixed) || hasDisableOptions && hasDisableOptions.includes(dataIndex) || ((_a = col.componentProps) === null || _a === void 0 ? void 0 : _a.options) || editable === 'render' || !!relevanceCols || !!shouldUpdate || !!record.children) {
1155
1188
  return true;
1156
1189
  }
1157
1190
 
@@ -1255,34 +1288,6 @@ var EditTable = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
1255
1288
  components: component
1256
1289
  }, resetProps);
1257
1290
  }, [resultColumns, dataSource, sortOpen, colSortOpen, size]);
1258
- (0, _react.useEffect)(function () {
1259
- // setDataSource(defaultData?.map((v, idx) => ({ ...v, [rowKey]: v[rowKey] || `v${idx + 1}` })))
1260
- var addRowKey = function addRowKey(children, pkey) {
1261
- return children === null || children === void 0 ? void 0 : children.map(function (item, index) {
1262
- if (item.children) {
1263
- var _Object$assign5;
1264
-
1265
- var rchildren = addRowKey(item.children, "".concat(pkey, "_").concat(index + 1));
1266
- return Object.assign(Object.assign({}, item), (_Object$assign5 = {}, (0, _defineProperty2.default)(_Object$assign5, _rowKey, item[_rowKey] || "".concat(pkey, "_").concat(index + 1)), (0, _defineProperty2.default)(_Object$assign5, "children", rchildren), _Object$assign5));
1267
- }
1268
-
1269
- return Object.assign(Object.assign({}, item), (0, _defineProperty2.default)({}, _rowKey, item[_rowKey] || "".concat(pkey, "_").concat(index + 1)));
1270
- });
1271
- };
1272
-
1273
- var res = defaultData === null || defaultData === void 0 ? void 0 : defaultData.map(function (v, idx) {
1274
- if (v.children) {
1275
- var _Object$assign7;
1276
-
1277
- var rchildren = addRowKey(v.children, v[_rowKey] || "v".concat(idx + 1));
1278
- return Object.assign(Object.assign({}, v), (_Object$assign7 = {}, (0, _defineProperty2.default)(_Object$assign7, _rowKey, v[_rowKey] || "v".concat(idx + 1)), (0, _defineProperty2.default)(_Object$assign7, "children", rchildren), _Object$assign7));
1279
- }
1280
-
1281
- return Object.assign(Object.assign({}, v), (0, _defineProperty2.default)({}, _rowKey, v[_rowKey] || "v".concat(idx + 1)));
1282
- });
1283
- deepDataSourceRef.current = (0, _util.deepDataSourcePreKeys)(res, _rowKey);
1284
- setDataSource(res);
1285
- }, [defaultData]);
1286
1291
  (0, _react.useImperativeHandle)(ref, function () {
1287
1292
  return {
1288
1293
  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;
@@ -604,3 +609,21 @@ p {
604
609
  color: var(--color-85);
605
610
  margin-left: 0 !important;
606
611
  }
612
+ .lm_table_append_add_popover .ant-popover-inner-content {
613
+ padding: 0px;
614
+ }
615
+ .lm_table_append_add_popover .ant-popover-inner-content ul {
616
+ margin: 0;
617
+ }
618
+ .lm_table_append_add_popover .ant-popover-inner-content ul li {
619
+ font-size: 12px;
620
+ padding: 4px 8px;
621
+ height: 24px;
622
+ display: flex;
623
+ align-items: center;
624
+ justify-content: center;
625
+ cursor: pointer;
626
+ }
627
+ .lm_table_append_add_popover .ant-popover-inner-content ul li:hover {
628
+ background-color: var(--color-15);
629
+ }
@@ -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;
@@ -93,3 +97,21 @@
93
97
  color: var(--color-85);
94
98
  margin-left: 0 !important;
95
99
  }
100
+ .lm_table_append_add_popover .ant-popover-inner-content {
101
+ padding: 0px;
102
+ }
103
+ .lm_table_append_add_popover .ant-popover-inner-content ul {
104
+ margin: 0;
105
+ }
106
+ .lm_table_append_add_popover .ant-popover-inner-content ul li {
107
+ font-size: 12px;
108
+ padding: 4px 8px;
109
+ height: 24px;
110
+ display: flex;
111
+ align-items: center;
112
+ justify-content: center;
113
+ cursor: pointer;
114
+ }
115
+ .lm_table_append_add_popover .ant-popover-inner-content ul li:hover {
116
+ background-color: var(--color-15);
117
+ }
@@ -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
  };
@@ -5,11 +5,14 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
5
5
  Object.defineProperty(exports, "__esModule", {
6
6
  value: true
7
7
  });
8
+ exports.checkRowKeyByDataSource = checkRowKeyByDataSource;
8
9
  exports.deepDataSourcePreKeys = deepDataSourcePreKeys;
9
10
  exports.default = void 0;
10
11
  exports.isExpandRow = isExpandRow;
11
12
  exports.isObjEmpty = isObjEmpty;
12
13
 
14
+ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
15
+
13
16
  var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
14
17
 
15
18
  var _lodash = require("lodash");
@@ -45,6 +48,33 @@ function isExpandRow(children) {
45
48
  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']);
46
49
  }
47
50
 
51
+ function checkRowKeyByDataSource(dataSource, rowKey) {
52
+ var addRowKey = function addRowKey(children, pkey) {
53
+ return children === null || children === void 0 ? void 0 : children.map(function (item, index) {
54
+ if (item.children) {
55
+ var _Object$assign;
56
+
57
+ var rchildren = addRowKey(item.children, "".concat(pkey, "_").concat(index + 1));
58
+ return Object.assign(Object.assign({}, item), (_Object$assign = {}, (0, _defineProperty2.default)(_Object$assign, rowKey, item[rowKey] || "".concat(pkey, "_").concat(index + 1)), (0, _defineProperty2.default)(_Object$assign, "children", rchildren), _Object$assign));
59
+ }
60
+
61
+ return Object.assign(Object.assign({}, item), (0, _defineProperty2.default)({}, rowKey, item[rowKey] || "".concat(pkey, "_").concat(index + 1)));
62
+ });
63
+ };
64
+
65
+ var res = dataSource === null || dataSource === void 0 ? void 0 : dataSource.map(function (v, idx) {
66
+ if (v.children) {
67
+ var _Object$assign3;
68
+
69
+ var rchildren = addRowKey(v.children, v[rowKey] || "v".concat(idx + 1));
70
+ return Object.assign(Object.assign({}, v), (_Object$assign3 = {}, (0, _defineProperty2.default)(_Object$assign3, rowKey, v[rowKey] || "v".concat(idx + 1)), (0, _defineProperty2.default)(_Object$assign3, "children", rchildren), _Object$assign3));
71
+ }
72
+
73
+ return Object.assign(Object.assign({}, v), (0, _defineProperty2.default)({}, rowKey, v[rowKey] || "v".concat(idx + 1)));
74
+ });
75
+ return res;
76
+ }
77
+
48
78
  var _default = {
49
79
  isObjEmpty: isObjEmpty
50
80
  };
@@ -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;
@@ -15,6 +15,8 @@ var _en_US3 = _interopRequireDefault(require("antd/es/date-picker/locale/en_US")
15
15
 
16
16
  var _en_US4 = _interopRequireDefault(require("antd/es/time-picker/locale/en_US"));
17
17
 
18
+ var _en_US5 = _interopRequireDefault(require("../CustomTableOption/locale/en_US"));
19
+
18
20
  /* eslint-disable no-template-curly-in-string */
19
21
  var typeTemplate = '${label} is not a valid ${type}';
20
22
  var localeValues = {
@@ -140,7 +142,8 @@ var localeValues = {
140
142
  },
141
143
  Image: {
142
144
  preview: 'Preview'
143
- }
145
+ },
146
+ CustomTableOption: _en_US5.default
144
147
  };
145
148
  var _default = localeValues;
146
149
  exports.default = _default;
@@ -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;
@@ -15,6 +15,8 @@ var _zh_CN3 = _interopRequireDefault(require("antd/es/date-picker/locale/zh_CN")
15
15
 
16
16
  var _zh_CN4 = _interopRequireDefault(require("antd/es/time-picker/locale/zh_CN"));
17
17
 
18
+ var _zh_CN5 = _interopRequireDefault(require("../CustomTableOption/locale/zh_CN"));
19
+
18
20
  /* eslint-disable no-template-curly-in-string */
19
21
  var typeTemplate = '${label}不是一个有效的${type}';
20
22
  var localeValues = {
@@ -139,7 +141,8 @@ var localeValues = {
139
141
  },
140
142
  Image: {
141
143
  preview: '预览'
142
- }
144
+ },
145
+ CustomTableOption: _zh_CN5.default
143
146
  };
144
147
  var _default = localeValues;
145
148
  exports.default = _default;
@@ -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;
@@ -19,6 +19,10 @@ var _classnames = _interopRequireDefault(require("classnames"));
19
19
 
20
20
  var _SizeContext = _interopRequireDefault(require("../ConfigProvider/SizeContext"));
21
21
 
22
+ var _LocaleReceiver = _interopRequireDefault(require("../locale-provider/LocaleReceiver"));
23
+
24
+ var _locale = require("./locale");
25
+
22
26
  var __rest = void 0 && (void 0).__rest || function (s, e) {
23
27
  var t = {};
24
28
 
@@ -40,34 +44,38 @@ var CLMModal = function CLMModal(props) {
40
44
  size = _props$size === void 0 ? 'default' : _props$size,
41
45
  onOk = props.onOk,
42
46
  onCancel = props.onCancel,
43
- _props$okText = props.okText,
44
- okText = _props$okText === void 0 ? '确定' : _props$okText,
45
- _props$cancelText = props.cancelText,
46
- cancelText = _props$cancelText === void 0 ? '取消' : _props$cancelText,
47
47
  visible = props.visible,
48
48
  open = props.open,
49
- other = __rest(props, ["wrapClassName", "size", "onOk", "onCancel", "okText", "cancelText", "visible", "open"]);
49
+ other = __rest(props, ["wrapClassName", "size", "onOk", "onCancel", "visible", "open"]);
50
50
 
51
51
  var defaultFooterSize = _react.default.useContext(_SizeContext.default) || 'middle';
52
- return /*#__PURE__*/_react.default.createElement(_modal.default, Object.assign({
53
- wrapClassName: (0, _classnames.default)(wrapClassName, prefixCls),
54
- width: size === 'default' ? 552 : 416,
55
- footer: [/*#__PURE__*/_react.default.createElement(_Button.default, {
52
+
53
+ var defaultFooter = /*#__PURE__*/_react.default.createElement(_LocaleReceiver.default, {
54
+ componentName: "Modal",
55
+ defaultLocale: (0, _locale.getConfirmLocale)()
56
+ }, function (contextLocale) {
57
+ var okText = props.okText,
58
+ cancelText = props.cancelText;
59
+ return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_Button.default, Object.assign({
56
60
  onClick: onCancel,
57
61
  key: 'canncel_button',
58
62
  size: defaultFooterSize
59
- }, cancelText), /*#__PURE__*/_react.default.createElement(_Button.default, {
63
+ }, props.cancelButtonProps), cancelText || contextLocale.cancelText), /*#__PURE__*/_react.default.createElement(_Button.default, Object.assign({
60
64
  type: "primary",
61
65
  onClick: onOk,
62
66
  key: 'ok_button',
63
67
  size: defaultFooterSize
64
- }, okText)]
68
+ }, props.okButtonProps), okText !== null && okText !== void 0 ? okText : contextLocale.okText));
69
+ });
70
+
71
+ return /*#__PURE__*/_react.default.createElement(_modal.default, Object.assign({
72
+ wrapClassName: (0, _classnames.default)(wrapClassName, prefixCls),
73
+ width: size === 'default' ? 552 : 416,
74
+ footer: defaultFooter
65
75
  }, other, {
66
76
  onOk: onOk,
67
77
  onCancel: onCancel,
68
- okText: okText,
69
- visible: visible || open,
70
- cancelText: cancelText
78
+ visible: visible || open
71
79
  }));
72
80
  };
73
81
 
@@ -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;