@zat-design/sisyphus-react 3.2.1 → 3.2.2

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 (132) hide show
  1. package/dist/index.esm.css +32 -7
  2. package/es/ProEditTable/components/RenderField/index.js +66 -21
  3. package/es/ProEditTable/index.js +11 -4
  4. package/es/ProEditTable/propsType.d.ts +11 -1
  5. package/es/ProForm/components/base/Checkbox/index.d.ts +1 -0
  6. package/es/ProForm/components/base/Checkbox/index.js +5 -3
  7. package/es/ProForm/components/base/DatePicker/index.js +3 -2
  8. package/es/ProForm/components/base/Input/index.js +4 -2
  9. package/es/ProForm/components/base/Input/propsType.d.ts +1 -0
  10. package/es/ProForm/components/base/InputNumber/index.d.ts +1 -0
  11. package/es/ProForm/components/base/InputNumber/index.js +5 -3
  12. package/es/ProForm/components/base/ProCascader/index.js +6 -6
  13. package/es/ProForm/components/base/Radio/index.d.ts +1 -0
  14. package/es/ProForm/components/base/Radio/index.js +4 -2
  15. package/es/ProForm/components/base/RangePicker/index.d.ts +1 -0
  16. package/es/ProForm/components/base/RangePicker/index.js +5 -3
  17. package/es/ProForm/components/base/Select/index.d.ts +1 -0
  18. package/es/ProForm/components/base/Select/index.js +4 -2
  19. package/es/ProForm/components/base/Switch/index.d.ts +1 -0
  20. package/es/ProForm/components/base/Switch/index.js +4 -2
  21. package/es/ProForm/components/base/SwitchCheckbox/index.d.ts +1 -0
  22. package/es/ProForm/components/base/SwitchCheckbox/index.js +4 -2
  23. package/es/ProForm/components/base/TextArea/index.d.ts +1 -0
  24. package/es/ProForm/components/base/TextArea/index.js +4 -3
  25. package/es/ProForm/components/base/TimePicker/index.d.ts +1 -0
  26. package/es/ProForm/components/base/TimePicker/index.js +4 -2
  27. package/es/ProForm/components/combination/Container/index.js +7 -5
  28. package/es/ProForm/components/combination/FormList/index.js +6 -5
  29. package/es/ProForm/components/combination/Group/index.js +6 -3
  30. package/es/ProForm/components/combination/ProAddressBar/index.js +29 -30
  31. package/es/ProForm/components/combination/ProCombination/index.js +11 -11
  32. package/es/ProForm/components/combination/ProModalSelect/index.js +4 -5
  33. package/es/ProForm/components/combination/ProModalSelect/style/index.less +1 -1
  34. package/es/ProForm/components/combination/ProNumberRange/index.d.ts +1 -1
  35. package/es/ProForm/components/combination/ProNumberRange/index.js +7 -7
  36. package/es/ProForm/components/combination/ProRangeLimit/index.d.ts +1 -0
  37. package/es/ProForm/components/combination/ProRangeLimit/index.js +4 -2
  38. package/es/ProForm/components/combination/ProTimeLimit/index.d.ts +1 -0
  39. package/es/ProForm/components/combination/ProTimeLimit/index.js +4 -2
  40. package/es/ProForm/components/render/Render.js +54 -20
  41. package/es/ProForm/components/render/RenderFields.d.ts +1 -0
  42. package/es/ProForm/components/render/RenderFields.js +12 -11
  43. package/es/ProForm/index.js +5 -2
  44. package/es/ProForm/propsType.d.ts +1 -0
  45. package/es/ProForm/style/index.less +49 -42
  46. package/es/ProForm/utils/contrastOriginal.d.ts +10 -1
  47. package/es/ProForm/utils/contrastOriginal.js +15 -18
  48. package/es/ProForm/utils/useChanged.d.ts +15 -1
  49. package/es/ProForm/utils/useChanged.js +27 -8
  50. package/es/ProLayout/components/ProHeader/index.js +1 -0
  51. package/es/ProLayout/components/ProHeader/style/index.less +7 -0
  52. package/es/ProSelect/index.js +6 -3
  53. package/es/ProStep/components/Item/index.js +1 -4
  54. package/es/ProTable/components/RenderColumn/index.js +1 -1
  55. package/es/ProTable/style/index.less +6 -0
  56. package/es/ProTabs/style/index.less +1 -1
  57. package/es/ProThemeTools/component/PrdTools/index.js +21 -20
  58. package/es/ProThemeTools/index.js +2 -1
  59. package/es/ProTree/components/Tree.js +43 -42
  60. package/es/ProTree/style/index.less +0 -6
  61. package/es/ProTreeSelect/index.js +3 -2
  62. package/es/locale/en_US.d.ts +15 -1
  63. package/es/locale/en_US.js +17 -3
  64. package/es/locale/zh_CN.d.ts +15 -1
  65. package/es/locale/zh_CN.js +15 -1
  66. package/es/style/theme/antd.less +8 -3
  67. package/lib/ProEditTable/components/RenderField/index.js +61 -20
  68. package/lib/ProEditTable/index.js +12 -4
  69. package/lib/ProEditTable/propsType.d.ts +11 -1
  70. package/lib/ProForm/components/base/Checkbox/index.d.ts +1 -0
  71. package/lib/ProForm/components/base/Checkbox/index.js +5 -3
  72. package/lib/ProForm/components/base/DatePicker/index.js +3 -2
  73. package/lib/ProForm/components/base/Input/index.js +4 -2
  74. package/lib/ProForm/components/base/Input/propsType.d.ts +1 -0
  75. package/lib/ProForm/components/base/InputNumber/index.d.ts +1 -0
  76. package/lib/ProForm/components/base/InputNumber/index.js +5 -3
  77. package/lib/ProForm/components/base/ProCascader/index.js +6 -6
  78. package/lib/ProForm/components/base/Radio/index.d.ts +1 -0
  79. package/lib/ProForm/components/base/Radio/index.js +4 -2
  80. package/lib/ProForm/components/base/RangePicker/index.d.ts +1 -0
  81. package/lib/ProForm/components/base/RangePicker/index.js +5 -3
  82. package/lib/ProForm/components/base/Select/index.d.ts +1 -0
  83. package/lib/ProForm/components/base/Select/index.js +4 -2
  84. package/lib/ProForm/components/base/Switch/index.d.ts +1 -0
  85. package/lib/ProForm/components/base/Switch/index.js +4 -2
  86. package/lib/ProForm/components/base/SwitchCheckbox/index.d.ts +1 -0
  87. package/lib/ProForm/components/base/SwitchCheckbox/index.js +4 -2
  88. package/lib/ProForm/components/base/TextArea/index.d.ts +1 -0
  89. package/lib/ProForm/components/base/TextArea/index.js +4 -3
  90. package/lib/ProForm/components/base/TimePicker/index.d.ts +1 -0
  91. package/lib/ProForm/components/base/TimePicker/index.js +4 -2
  92. package/lib/ProForm/components/combination/Container/index.js +7 -5
  93. package/lib/ProForm/components/combination/FormList/index.js +6 -5
  94. package/lib/ProForm/components/combination/Group/index.js +6 -3
  95. package/lib/ProForm/components/combination/ProAddressBar/index.js +29 -30
  96. package/lib/ProForm/components/combination/ProCombination/index.js +11 -11
  97. package/lib/ProForm/components/combination/ProModalSelect/index.js +4 -5
  98. package/lib/ProForm/components/combination/ProModalSelect/style/index.less +1 -1
  99. package/lib/ProForm/components/combination/ProNumberRange/index.d.ts +1 -1
  100. package/lib/ProForm/components/combination/ProNumberRange/index.js +7 -7
  101. package/lib/ProForm/components/combination/ProRangeLimit/index.d.ts +1 -0
  102. package/lib/ProForm/components/combination/ProRangeLimit/index.js +4 -2
  103. package/lib/ProForm/components/combination/ProTimeLimit/index.d.ts +1 -0
  104. package/lib/ProForm/components/combination/ProTimeLimit/index.js +4 -2
  105. package/lib/ProForm/components/render/Render.js +53 -21
  106. package/lib/ProForm/components/render/RenderFields.d.ts +1 -0
  107. package/lib/ProForm/components/render/RenderFields.js +12 -11
  108. package/lib/ProForm/index.js +5 -2
  109. package/lib/ProForm/propsType.d.ts +1 -0
  110. package/lib/ProForm/style/index.less +49 -42
  111. package/lib/ProForm/utils/contrastOriginal.d.ts +10 -1
  112. package/lib/ProForm/utils/contrastOriginal.js +14 -17
  113. package/lib/ProForm/utils/useChanged.d.ts +15 -1
  114. package/lib/ProForm/utils/useChanged.js +27 -8
  115. package/lib/ProLayout/components/ProHeader/index.js +1 -0
  116. package/lib/ProLayout/components/ProHeader/style/index.less +7 -0
  117. package/lib/ProSelect/index.js +6 -3
  118. package/lib/ProStep/components/Item/index.js +1 -4
  119. package/lib/ProTable/components/RenderColumn/index.js +1 -1
  120. package/lib/ProTable/style/index.less +6 -0
  121. package/lib/ProTabs/style/index.less +1 -1
  122. package/lib/ProThemeTools/component/PrdTools/index.js +21 -20
  123. package/lib/ProThemeTools/index.js +2 -1
  124. package/lib/ProTree/components/Tree.js +42 -41
  125. package/lib/ProTree/style/index.less +0 -6
  126. package/lib/ProTreeSelect/index.js +3 -2
  127. package/lib/locale/en_US.d.ts +15 -1
  128. package/lib/locale/en_US.js +17 -3
  129. package/lib/locale/zh_CN.d.ts +15 -1
  130. package/lib/locale/zh_CN.js +15 -1
  131. package/lib/style/theme/antd.less +8 -3
  132. package/package.json +1 -1
@@ -12,6 +12,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
12
12
  import { CheckOutlined, CloseOutlined } from '@ant-design/icons';
13
13
  import { useState, useEffect } from 'react';
14
14
  import { setThemes, setTableNoStripe } from '../../utils/index';
15
+ import locale from '../../../locale';
15
16
  var connect = function connect(Component) {
16
17
  var ComponentWrapper = function ComponentWrapper(props) {
17
18
  return _jsx(Component, _objectSpread({}, props));
@@ -62,8 +63,8 @@ var PrdTools = function PrdTools(_ref) {
62
63
  }, []);
63
64
  return _jsxs(NewDrawer, {
64
65
  className: "pro-theme-prd-tools-drawer",
65
- width: 320,
66
- title: "\u5168\u5C40\u6837\u5F0F\u81EA\u5B9A\u4E49",
66
+ width: 400,
67
+ title: "".concat(locale.ProThemeTools.title),
67
68
  placement: "right",
68
69
  onClose: onClose,
69
70
  open: visible,
@@ -77,7 +78,7 @@ var PrdTools = function PrdTools(_ref) {
77
78
  }), _jsxs("div", {
78
79
  className: "pro-theme-tools-space",
79
80
  children: [_jsx("p", {
80
- children: "\u4E3B\u9898\u8272"
81
+ children: "".concat(locale.ProThemeTools.themeColor)
81
82
  }), _jsx("ul", {
82
83
  className: "pro-theme-color",
83
84
  children: active.map(function (item, index) {
@@ -108,7 +109,7 @@ var PrdTools = function PrdTools(_ref) {
108
109
  children: [_jsx("div", {
109
110
  className: "pro-theme-tools-item",
110
111
  children: _jsx("p", {
111
- children: "\u5E03\u5C40"
112
+ children: "".concat(locale.ProThemeTools.layout)
112
113
  })
113
114
  }), _jsx("div", {
114
115
  className: "pro-theme-tools-item",
@@ -124,13 +125,13 @@ var PrdTools = function PrdTools(_ref) {
124
125
  },
125
126
  children: [_jsx(_Radio.Button, {
126
127
  value: 0.5,
127
- children: "\u7D27\u51D1"
128
+ children: "".concat(locale.ProThemeTools.layoutMode[0])
128
129
  }), _jsx(_Radio.Button, {
129
130
  value: 1,
130
- children: "\u5E38\u89C4"
131
+ children: "".concat(locale.ProThemeTools.layoutMode[1])
131
132
  }), _jsx(_Radio.Button, {
132
133
  value: 1.5,
133
- children: "\u5BBD\u677E"
134
+ children: "".concat(locale.ProThemeTools.layoutMode[2])
134
135
  })]
135
136
  })
136
137
  })]
@@ -139,7 +140,7 @@ var PrdTools = function PrdTools(_ref) {
139
140
  children: [_jsx("div", {
140
141
  className: "pro-theme-tools-item",
141
142
  children: _jsx("p", {
142
- children: "\u8868\u5355\u6807\u9898"
143
+ children: "".concat(locale.ProThemeTools.formLabel)
143
144
  })
144
145
  }), _jsx("div", {
145
146
  className: "pro-theme-tools-item",
@@ -176,10 +177,10 @@ var PrdTools = function PrdTools(_ref) {
176
177
  },
177
178
  children: [_jsx(_Radio.Button, {
178
179
  value: "left",
179
- children: "\u5DE6\u5BF9\u9F50"
180
+ children: "".concat(locale.ProThemeTools.flex[0])
180
181
  }), _jsx(_Radio.Button, {
181
182
  value: "right",
182
- children: "\u53F3\u5BF9\u9F50"
183
+ children: "".concat(locale.ProThemeTools.flex[1])
183
184
  })]
184
185
  })
185
186
  })]
@@ -188,13 +189,13 @@ var PrdTools = function PrdTools(_ref) {
188
189
  children: [_jsx("div", {
189
190
  className: "pro-theme-tools-item",
190
191
  children: _jsx("p", {
191
- children: "\u5927\u5B57\u53F7\u6A21\u5F0F"
192
+ children: "".concat(locale.ProThemeTools.bigText)
192
193
  })
193
194
  }), _jsx("div", {
194
195
  className: "pro-theme-tools-item",
195
196
  children: _jsx(_Switch, {
196
- checkedChildren: "\u5F00",
197
- unCheckedChildren: "\u5173",
197
+ checkedChildren: "".concat(locale.ProThemeTools.switchText[0]),
198
+ unCheckedChildren: "".concat(locale.ProThemeTools.switchText[1]),
198
199
  checked: state.zauiBigText,
199
200
  onClick: function onClick(value) {
200
201
  setState(_objectSpread(_objectSpread({}, state), {}, {
@@ -212,13 +213,13 @@ var PrdTools = function PrdTools(_ref) {
212
213
  children: [_jsx("div", {
213
214
  className: "pro-theme-tools-item",
214
215
  children: _jsx("p", {
215
- children: "\u8868\u683C\u8FB9\u6846"
216
+ children: "".concat(locale.ProThemeTools.tableBorder)
216
217
  })
217
218
  }), _jsx("div", {
218
219
  className: "pro-theme-tools-item",
219
220
  children: _jsx(_Switch, {
220
- checkedChildren: "\u5F00",
221
- unCheckedChildren: "\u5173",
221
+ checkedChildren: "".concat(locale.ProThemeTools.switchText[0]),
222
+ unCheckedChildren: "".concat(locale.ProThemeTools.switchText[1]),
222
223
  checked: state.zauiTableBorder,
223
224
  onClick: function onClick(value) {
224
225
  setState(_objectSpread(_objectSpread({}, state), {}, {
@@ -235,13 +236,13 @@ var PrdTools = function PrdTools(_ref) {
235
236
  children: [_jsx("div", {
236
237
  className: "pro-theme-tools-item",
237
238
  children: _jsx("p", {
238
- children: "\u8868\u683C\u6591\u9A6C\u7EB9"
239
+ children: "".concat(locale.ProThemeTools.tableStripe)
239
240
  })
240
241
  }), _jsx("div", {
241
242
  className: "pro-theme-tools-item",
242
243
  children: _jsx(_Switch, {
243
- checkedChildren: "\u5F00",
244
- unCheckedChildren: "\u5173",
244
+ checkedChildren: "".concat(locale.ProThemeTools.switchText[0]),
245
+ unCheckedChildren: "".concat(locale.ProThemeTools.switchText[1]),
245
246
  checked: state.zauiStripe,
246
247
  onClick: function onClick(value) {
247
248
  setState(_objectSpread(_objectSpread({}, state), {}, {
@@ -272,7 +273,7 @@ var PrdTools = function PrdTools(_ref) {
272
273
  }]);
273
274
  onReset();
274
275
  },
275
- children: "\u91CD\u7F6E"
276
+ children: "".concat(locale.ProThemeTools.reset)
276
277
  })]
277
278
  });
278
279
  };
@@ -14,6 +14,7 @@ import { useEffect, useState } from 'react';
14
14
  import classnames from 'classnames';
15
15
  import { getKebabCase, setThemes, setTableNoStripe, setTableBorder, getMapKebabCase, getMapHumpCase } from './utils/index';
16
16
  import { PrdTools } from './component';
17
+ import locale from '../locale';
17
18
  var defaultCacheTime = 1; // 配置保存时间为一天
18
19
  var defaultThemeConfig = {
19
20
  zauiBrand: '#006AFF',
@@ -89,7 +90,7 @@ var ProThemeTools = function ProThemeTools(_ref) {
89
90
  input.select();
90
91
  if (document.execCommand('copy')) {
91
92
  document.execCommand('copy');
92
- _message.success('复制成功!');
93
+ _message.success("".concat(locale.ProThemeTools.copySuccess));
93
94
  }
94
95
  document.body.removeChild(input);
95
96
  };
@@ -14,7 +14,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
14
14
  *@Description: 树每行节点渲染组件,复选时阻止点击事件冒泡,只有点击树节点文本会向上触发onSelect事件
15
15
  */
16
16
  /* eslint-disable no-plusplus */
17
- import React, { useEffect, useMemo, useState } from 'react';
17
+ import React, { useEffect, useState } from 'react';
18
18
  import { useSetState } from 'ahooks';
19
19
  import { CaretDownOutlined } from '@ant-design/icons';
20
20
  import SearchTitle from './SearchTitle';
@@ -125,7 +125,7 @@ function List(props) {
125
125
  _useState2 = _slicedToArray(_useState, 2),
126
126
  open = _useState2[0],
127
127
  setOpen = _useState2[1];
128
- var operateButton = menu && menu(item === null || item === void 0 ? void 0 : item.value, item);
128
+ var operateButton = menu && menu(item === null || item === void 0 ? void 0 : item[fieldNameValue], item);
129
129
  operateButton === null || operateButton === void 0 ? void 0 : operateButton.map(function (item, i) {
130
130
  return _jsx(React.Fragment, {
131
131
  children: item
@@ -263,32 +263,19 @@ function List(props) {
263
263
  })]
264
264
  }, onlyKey);
265
265
  };
266
- var _treeData = useMemo(function () {
267
- function fn() {
268
- var loop = function loop(data, index) {
269
- index++;
270
- var treeRow = data.map(function (item) {
271
- var nodeClass = 'pro-tree-tree-node ';
272
- var isChecked = false;
273
- if (currentClickTreeNode === item[fieldNameValue]) {
274
- nodeClass += ' checked';
275
- isChecked = true;
276
- }
277
- var title = showCodeName ? "".concat(item[fieldNameValue], "-").concat(item[fieldNameLabel]) : item[fieldNameLabel];
278
- if (item[fieldNames.children]) {
279
- return {
280
- title: _jsx(TreeNodeRow, {
281
- nodeClass: nodeClass,
282
- item: item,
283
- index: index,
284
- title: title,
285
- isChecked: isChecked,
286
- onlyKey: item[fieldNameValue]
287
- }),
288
- key: item[fieldNameValue],
289
- children: loop(item[fieldNames.children], index)
290
- };
291
- }
266
+ // const _treeData = useMemo(() => {
267
+ function fn() {
268
+ var loop = function loop(data, index) {
269
+ index++;
270
+ var treeRow = data.map(function (item) {
271
+ var nodeClass = 'pro-tree-tree-node ';
272
+ var isChecked = false;
273
+ if (currentClickTreeNode === item[fieldNameValue]) {
274
+ nodeClass += ' checked';
275
+ isChecked = true;
276
+ }
277
+ var title = showCodeName ? "".concat(item[fieldNameValue], "-").concat(item[fieldNameLabel]) : item[fieldNameLabel];
278
+ if (item[fieldNames.children]) {
292
279
  return {
293
280
  title: _jsx(TreeNodeRow, {
294
281
  nodeClass: nodeClass,
@@ -298,23 +285,37 @@ function List(props) {
298
285
  isChecked: isChecked,
299
286
  onlyKey: item[fieldNameValue]
300
287
  }),
301
- key: item[fieldNameValue]
288
+ key: item[fieldNameValue],
289
+ children: loop(item[fieldNames.children], index)
302
290
  };
303
- });
304
- return treeRow; // .filter((item) => item);
305
- };
291
+ }
292
+ return {
293
+ title: _jsx(TreeNodeRow, {
294
+ nodeClass: nodeClass,
295
+ item: item,
296
+ index: index,
297
+ title: title,
298
+ isChecked: isChecked,
299
+ onlyKey: item[fieldNameValue]
300
+ }),
301
+ key: item[fieldNameValue]
302
+ };
303
+ });
304
+ return treeRow; // .filter((item) => item);
305
+ };
306
306
 
307
- if ((other === null || other === void 0 ? void 0 : other.mode) === 'view') {
308
- return;
309
- }
310
- var newTreeData = originalTreeData;
311
- if (searchStr) {
312
- newTreeData = filterCheckedNodes(originalTreeData, [], searchStr, fieldNames);
313
- }
314
- return loop(newTreeData, -1);
307
+ if ((other === null || other === void 0 ? void 0 : other.mode) === 'view') {
308
+ return;
309
+ }
310
+ var newTreeData = originalTreeData;
311
+ if (searchStr) {
312
+ newTreeData = filterCheckedNodes(originalTreeData, [], searchStr, fieldNames);
315
313
  }
316
- return fn();
317
- }, [searchStr, expandedKeys, showCodeName, originalTreeData, currentClickTreeNode]);
314
+ return loop(newTreeData, -1);
315
+ }
316
+ // return fn();
317
+ // }, [searchStr, expandedKeys, showCodeName, originalTreeData, currentClickTreeNode]);
318
+ var _treeData = fn();
318
319
  var onExpand = function onExpand(newExpandedKeys) {
319
320
  setState({
320
321
  expandedKeys: newExpandedKeys,
@@ -315,12 +315,6 @@
315
315
  }
316
316
  }
317
317
 
318
- // 中意全局样式覆盖
319
- // .pro-form.pro-form-view .ant-form-item * {
320
- // line-height: 1!important;
321
- // height: auto!important;
322
- // min-height: auto!important;
323
- // }
324
318
  // 重置ant-form view模式样式ant-tree样式
325
319
  .pro-form.pro-form-view .ant-form-item .pro-tree * {
326
320
  line-height: 1 !important;
@@ -145,9 +145,10 @@ export var ProTreeSelect = function ProTreeSelect(props, ref) {
145
145
  _message.error(msg);
146
146
  return;
147
147
  }
148
+ var resultData = transferDataSource(data, showCodeName);
148
149
  setState({
149
- selectList: data || [],
150
- origDataSource: data || []
150
+ selectList: resultData || [],
151
+ origDataSource: resultData || []
151
152
  });
152
153
  };
153
154
  // 配置了异步数据源,拉取枚举数据逻辑 如果有code不掉接口从local里根据code取值
@@ -38,7 +38,6 @@ declare const _default: {
38
38
  errorMessage: string;
39
39
  defaultTitle: string;
40
40
  };
41
- ProWaterMark: {};
42
41
  ProTable: {
43
42
  noData: string;
44
43
  resetColumnWidth: string;
@@ -94,6 +93,7 @@ declare const _default: {
94
93
  save: string;
95
94
  custom: string;
96
95
  operation: string;
96
+ total: string;
97
97
  onlyOneLineMsg: string;
98
98
  deletePoConfirmMsg: string;
99
99
  mulDeletePoConfirmMsg: string;
@@ -134,5 +134,19 @@ declare const _default: {
134
134
  ProTimeLimit: {
135
135
  foreverText: string;
136
136
  };
137
+ ProThemeTools: {
138
+ title: string;
139
+ copySuccess: string;
140
+ layout: string;
141
+ layoutMode: string[];
142
+ themeColor: string;
143
+ formLabel: string;
144
+ bigText: string;
145
+ flex: string[];
146
+ switchText: string[];
147
+ tableBorder: string;
148
+ tableStripe: string;
149
+ reset: string;
150
+ };
137
151
  };
138
152
  export default _default;
@@ -38,7 +38,6 @@ export default {
38
38
  errorMessage: 'The configuration config for ProAction must be data',
39
39
  defaultTitle: 'Are you sure delete it?'
40
40
  },
41
- ProWaterMark: {},
42
41
  ProTable: {
43
42
  noData: 'No data',
44
43
  resetColumnWidth: 'Reset column width',
@@ -94,6 +93,7 @@ export default {
94
93
  save: 'Save',
95
94
  custom: 'Custom',
96
95
  operation: 'Operation',
96
+ total: '{total} items in total',
97
97
  onlyOneLineMsg: 'Please save the data first',
98
98
  deletePoConfirmMsg: 'Are you sure you want to delete this row of data?',
99
99
  mulDeletePoConfirmMsg: 'Are you sure you want to delete the selected data?'
@@ -120,12 +120,12 @@ export default {
120
120
  ProTreeModal: {
121
121
  checkMsg: 'Please check first',
122
122
  select: 'Please select',
123
- input: 'please enter',
123
+ input: 'Please enter',
124
124
  errorArrayMessage: 'Please return a valid array',
125
125
  selectMin: 'Select at least {min}',
126
126
  selectMax: 'Select at most {max} items',
127
127
  noCheck: 'None selected yet',
128
- checkAll: 'select all',
128
+ checkAll: 'Select all',
129
129
  check: 'selected',
130
130
  clearAll: 'Clear all',
131
131
  checkNumber: '{num} items selected',
@@ -133,5 +133,19 @@ export default {
133
133
  },
134
134
  ProTimeLimit: {
135
135
  foreverText: 'long term'
136
+ },
137
+ ProThemeTools: {
138
+ title: 'Global style customization ',
139
+ copySuccess: 'Copy success! ',
140
+ layout: 'Layout',
141
+ layoutMode: ['Compact ', 'Regular', 'Loose'],
142
+ themeColor: 'Theme color',
143
+ formLabel: 'Form label',
144
+ bigText: 'Large text mode',
145
+ flex: ['Left align ', 'Right align'],
146
+ switchText: ['on', 'off'],
147
+ tableBorder: 'Table border',
148
+ tableStripe: 'Table zebra',
149
+ reset: 'Reset'
136
150
  }
137
151
  };
@@ -38,7 +38,6 @@ declare const _default: {
38
38
  errorMessage: string;
39
39
  defaultTitle: string;
40
40
  };
41
- ProWaterMark: {};
42
41
  ProTable: {
43
42
  noData: string;
44
43
  resetColumnWidth: string;
@@ -94,6 +93,7 @@ declare const _default: {
94
93
  operation: string;
95
94
  noData: string;
96
95
  clickAdd: string;
96
+ total: string;
97
97
  onlyOneLineMsg: string;
98
98
  deletePoConfirmMsg: string;
99
99
  mulDeletePoConfirmMsg: string;
@@ -133,5 +133,19 @@ declare const _default: {
133
133
  ProTimeLimit: {
134
134
  foreverText: string;
135
135
  };
136
+ ProThemeTools: {
137
+ title: string;
138
+ copySuccess: string;
139
+ layout: string;
140
+ layoutMode: string[];
141
+ themeColor: string;
142
+ formLabel: string;
143
+ bigText: string;
144
+ flex: string[];
145
+ switchText: string[];
146
+ tableBorder: string;
147
+ tableStripe: string;
148
+ reset: string;
149
+ };
136
150
  };
137
151
  export default _default;
@@ -38,7 +38,6 @@ export default {
38
38
  errorMessage: 'ProAction 配置 config 必须为数据',
39
39
  defaultTitle: '确认删除吗?'
40
40
  },
41
- ProWaterMark: {},
42
41
  ProTable: {
43
42
  noData: '暂无数据',
44
43
  resetColumnWidth: '重置列宽',
@@ -94,6 +93,7 @@ export default {
94
93
  operation: '操作',
95
94
  noData: '暂无数据',
96
95
  clickAdd: '点击添加',
96
+ total: '共{total}条',
97
97
  onlyOneLineMsg: '请先保存数据',
98
98
  deletePoConfirmMsg: '您确定要删除该行数据吗?',
99
99
  mulDeletePoConfirmMsg: '您确定要删除选中的数据吗?'
@@ -132,5 +132,19 @@ export default {
132
132
  },
133
133
  ProTimeLimit: {
134
134
  foreverText: '长期'
135
+ },
136
+ ProThemeTools: {
137
+ title: '全局样式自定义',
138
+ copySuccess: '复制成功!',
139
+ layout: '布局',
140
+ layoutMode: ['紧凑', '常规', '宽松'],
141
+ themeColor: '主题色',
142
+ formLabel: '表单标题',
143
+ bigText: '大字号模式',
144
+ flex: ['左对齐', '右对齐'],
145
+ switchText: ['开', '关'],
146
+ tableBorder: '表格边框',
147
+ tableStripe: '表格斑马纹',
148
+ reset: '重置'
135
149
  }
136
150
  };
@@ -258,7 +258,7 @@
258
258
  & td,
259
259
  & td.ant-table-cell-fix-right,
260
260
  & td.ant-table-cell-fix-left {
261
- background-color: #fff;
261
+ background-color: #fff !important;
262
262
  }
263
263
 
264
264
  & td {
@@ -267,10 +267,10 @@
267
267
  }
268
268
 
269
269
  .ant-table-row:nth-child(odd) {
270
- background-color: @zaui-table-strip-bg;
270
+ background-color: @zaui-table-strip-bg !important;
271
271
 
272
272
  & td {
273
- background-color: @zaui-table-strip-bg;
273
+ background-color: @zaui-table-strip-bg !important;
274
274
  }
275
275
  }
276
276
  }
@@ -339,6 +339,11 @@
339
339
  }
340
340
 
341
341
  &.ant-tabs-card {
342
+ .ant-tabs-tab {
343
+ padding : 8px calc(var(--zaui-space-size-md, 16px)*var(--zaui-size, 1)) !important;
344
+ margin-right: 10px !important;
345
+ }
346
+
342
347
  .ant-tabs-nav .ant-tabs-tab-btn {
343
348
  font-size: var(--zaui-font-size, 14px);
344
349
  }
@@ -6,6 +6,8 @@ Object.defineProperty(exports, "__esModule", {
6
6
  value: true
7
7
  });
8
8
  exports.default = void 0;
9
+ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
10
+ var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
9
11
  var _regeneratorRuntime2 = _interopRequireDefault(require("@babel/runtime/helpers/regeneratorRuntime"));
10
12
  var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
11
13
  var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
@@ -14,6 +16,7 @@ var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/h
14
16
  var _jsxRuntime = require("react/jsx-runtime");
15
17
  var _react = _interopRequireWildcard(require("react"));
16
18
  var _antd = require("antd");
19
+ var _classnames = _interopRequireDefault(require("classnames"));
17
20
  var _lodash = require("lodash");
18
21
  var _valueType = _interopRequireDefault(require("../../../ProForm/utils/valueType"));
19
22
  var _transform = _interopRequireDefault(require("../../utils/transform"));
@@ -22,14 +25,15 @@ var componentMap = _interopRequireWildcard(require("../../../ProForm/components"
22
25
  var _Container = _interopRequireDefault(require("../../../ProForm/components/Container"));
23
26
  var _transformNames = _interopRequireDefault(require("../../../ProForm/utils/transformNames"));
24
27
  var _useFieldProps = require("../../../ProForm/utils/useFieldProps");
28
+ var _useChanged3 = require("../../../ProForm/utils/useChanged");
25
29
  var _useRules = _interopRequireDefault(require("../../../ProForm/utils/useRules"));
26
30
  var _utils = require("../../../ProForm/utils");
27
31
  var _locale = _interopRequireDefault(require("../../../locale"));
28
- var _excluded = ["type", "valueType", "names", "fieldProps", "labelRequired", "editRender", "component", "viewRender", "title", "originTitle", "label", "dataIndex", "formItemProps", "isEditable", "required", "rules"];
32
+ var _excluded = ["type", "valueType", "names", "fieldProps", "labelRequired", "editRender", "component", "viewRender", "title", "originTitle", "label", "dataIndex", "formItemProps", "isEditable", "required", "rules", "equalWith", "className"];
29
33
  /* eslint-disable prefer-destructuring */
30
34
  /* eslint-disable prefer-const */
31
35
  var RenderField = function RenderField(_ref) {
32
- var _type, _type$replace, _fieldProps2, _fieldProps3, _fieldProps4, _names, _formItemChildProps$p, _TargetComponent4;
36
+ var _type, _type$replace, _fieldProps2, _fieldProps3, _fieldProps4, _names, _formItemChildProps$p, _TargetComponent4, _classNames;
33
37
  var value = _ref.text,
34
38
  record = _ref.record,
35
39
  index = _ref.index,
@@ -54,6 +58,8 @@ var RenderField = function RenderField(_ref) {
54
58
  required = _column$required === void 0 ? false : _column$required,
55
59
  _column$rules = column.rules,
56
60
  rules = _column$rules === void 0 ? [] : _column$rules,
61
+ equalWith = column.equalWith,
62
+ className = column.className,
57
63
  resetProps = (0, _objectWithoutProperties2.default)(column, _excluded);
58
64
  // editRender弃用使用component同ProForm
59
65
  var _editRender = component || editRender;
@@ -68,7 +74,9 @@ var RenderField = function RenderField(_ref) {
68
74
  setState = config.setState,
69
75
  name = config.name,
70
76
  virtualKey = config.virtualKey,
71
- viewEmpty = config.viewEmpty;
77
+ viewEmpty = config.viewEmpty,
78
+ originalValues = config.originalValues,
79
+ originalTip = config.originalTip;
72
80
  var _fieldProps = fieldProps || formItemProps || {};
73
81
  var _rules = rules || [];
74
82
  var _required = required;
@@ -182,13 +190,23 @@ var RenderField = function RenderField(_ref) {
182
190
  return [].concat((0, _toConsumableArray2.default)(baseName), [index, key]);
183
191
  });
184
192
  }
193
+ var originalName = cellName;
194
+ var originalNames = names;
195
+ if (virtualKey) {
196
+ var _cellName$slice, _names2, _names2$map;
197
+ originalName = [].concat((0, _toConsumableArray2.default)(name), (0, _toConsumableArray2.default)(cellName === null || cellName === void 0 ? void 0 : (_cellName$slice = cellName.slice) === null || _cellName$slice === void 0 ? void 0 : _cellName$slice.call(cellName, 1)));
198
+ originalNames = (_names2 = names) === null || _names2 === void 0 ? void 0 : (_names2$map = _names2.map) === null || _names2$map === void 0 ? void 0 : _names2$map.call(_names2, function (item) {
199
+ var _item$slice;
200
+ return [].concat((0, _toConsumableArray2.default)(name), (0, _toConsumableArray2.default)(item === null || item === void 0 ? void 0 : (_item$slice = item.slice) === null || _item$slice === void 0 ? void 0 : _item$slice.call(item, 1)));
201
+ });
202
+ }
185
203
  /**
186
204
  * 配置names时,基于formItem的normalize与getValueProps进行值类型转换
187
205
  * @returns {}
188
206
  */
189
207
  var namesTransform = function namesTransform() {
190
- var _names2;
191
- if (!((_names2 = names) === null || _names2 === void 0 ? void 0 : _names2.length)) {
208
+ var _names3;
209
+ if (!((_names3 = names) === null || _names3 === void 0 ? void 0 : _names3.length)) {
192
210
  return {};
193
211
  }
194
212
  var namesStr = [baseName, index, dataIndex];
@@ -348,14 +366,6 @@ var RenderField = function RenderField(_ref) {
348
366
  d: Date.now()
349
367
  }
350
368
  });
351
- // if (virtualKey) {
352
- // // 单行编辑时需要 强制更新视图
353
- // setState({
354
- // forceUpdate: {
355
- // d: Date.now(),
356
- // },
357
- // });
358
- // }
359
369
  case 30:
360
370
  case "end":
361
371
  return _context.stop();
@@ -444,6 +454,20 @@ var RenderField = function RenderField(_ref) {
444
454
  return _ref3.apply(this, arguments);
445
455
  };
446
456
  }();
457
+ // 判断当前字段是否变更
458
+ var _useChanged = (0, _useChanged3.useChanged)({
459
+ name: cellName,
460
+ names: names,
461
+ namesStr: [].concat((0, _toConsumableArray2.default)(baseName), [index, dataIndex]),
462
+ originalName: originalName,
463
+ originalNames: originalNames,
464
+ originalValues: originalValues,
465
+ form: form,
466
+ equalWith: equalWith
467
+ }),
468
+ _useChanged2 = (0, _slicedToArray2.default)(_useChanged, 2),
469
+ changed = _useChanged2[0],
470
+ originalValue = _useChanged2[1];
447
471
  var componentProps = (0, _objectSpread2.default)((0, _objectSpread2.default)((0, _objectSpread2.default)({
448
472
  form: form,
449
473
  name: cellName,
@@ -484,15 +508,32 @@ var RenderField = function RenderField(_ref) {
484
508
  if (!isEditing) {
485
509
  delete _formItemProps.rules;
486
510
  }
511
+ var _className = (0, _classnames.default)((_classNames = {}, (0, _defineProperty2.default)(_classNames, className, className), (0, _defineProperty2.default)(_classNames, 'pro-form-item-changed', changed), _classNames));
512
+ var originalTitle = (0, _jsxRuntime.jsxs)(_antd.Space, {
513
+ children: ["\u521D\u59CB\u503C\uFF1A", /*#__PURE__*/_react.default.isValidElement(TargetComponent) ? /*#__PURE__*/_react.default.cloneElement(TargetComponent, (0, _objectSpread2.default)((0, _objectSpread2.default)({}, (0, _lodash.omit)(componentProps, ['onFieldChange'])), {}, {
514
+ isView: true,
515
+ value: originalValue,
516
+ checked: type === 'Switch' ? originalValue : undefined
517
+ })) : (0, _jsxRuntime.jsx)(TargetComponent, (0, _objectSpread2.default)((0, _objectSpread2.default)({}, (0, _lodash.omit)(componentProps, ['onFieldChange'])), {}, {
518
+ isView: true,
519
+ value: originalValue,
520
+ checked: type === 'Switch' ? originalValue : undefined
521
+ }))]
522
+ });
523
+ var FormItem = (0, _jsxRuntime.jsx)(_antd.Form.Item, (0, _objectSpread2.default)((0, _objectSpread2.default)({
524
+ validateFirst: true
525
+ }, (0, _lodash.omit)(_formItemProps, ['render', 'cache', 'key', 'width', 'hiddenNames', 'name'])), {}, {
526
+ className: _className,
527
+ name: cellName,
528
+ children: /*#__PURE__*/_react.default.isValidElement(TargetComponent) ? /*#__PURE__*/_react.default.cloneElement(TargetComponent, (0, _objectSpread2.default)({}, (0, _lodash.omit)(componentProps, ['onFieldChange']))) : (0, _jsxRuntime.jsx)(TargetComponent, (0, _objectSpread2.default)({}, (0, _lodash.omit)(componentProps, ['onFieldChange'])))
529
+ }));
487
530
  return (0, _jsxRuntime.jsx)(_useFieldProps.FieldProvider, {
488
531
  value: componentProps === null || componentProps === void 0 ? void 0 : componentProps.otherProps,
489
- children: (0, _jsxRuntime.jsx)(_antd.Form.Item, (0, _objectSpread2.default)((0, _objectSpread2.default)({
490
- validateFirst: true,
491
- noStyle: !isEditing
492
- }, (0, _lodash.omit)(_formItemProps, ['render', 'cache', 'key', 'width', 'hiddenNames', 'name'])), {}, {
493
- name: cellName,
494
- children: /*#__PURE__*/_react.default.isValidElement(TargetComponent) ? /*#__PURE__*/_react.default.cloneElement(TargetComponent, (0, _objectSpread2.default)({}, (0, _lodash.omit)(componentProps, ['onFieldChange']))) : (0, _jsxRuntime.jsx)(TargetComponent, (0, _objectSpread2.default)({}, (0, _lodash.omit)(componentProps, ['onFieldChange'])))
495
- }))
532
+ children: !originalTip || ['FormList', 'ProEditTable'].includes(type) ? FormItem : (0, _jsxRuntime.jsx)(_antd.Tooltip, {
533
+ title: originalTitle,
534
+ open: changed ? undefined : false,
535
+ children: FormItem
536
+ })
496
537
  });
497
538
  };
498
539
  var _default = exports.default = RenderField;