@zat-design/sisyphus-react 3.2.1-beta.7 → 3.2.2-beta.1

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 (32) hide show
  1. package/dist/index.esm.css +38 -32
  2. package/es/ProDrawerForm/style/index.less +59 -59
  3. package/es/ProForm/components/combination/FormList/style/index.less +15 -22
  4. package/es/ProForm/components/render/RenderFields.js +4 -3
  5. package/es/ProLayout/components/ProFooter/style/index.less +8 -7
  6. package/es/ProLayout/components/ProHeader/index.js +1 -0
  7. package/es/ProLayout/components/ProHeader/style/index.less +6 -0
  8. package/es/ProTabs/style/index.less +15 -16
  9. package/es/ProThemeTools/component/PrdTools/index.js +21 -20
  10. package/es/ProThemeTools/index.js +2 -1
  11. package/es/ProTree/components/Tree.js +42 -41
  12. package/es/locale/en_US.d.ts +14 -1
  13. package/es/locale/en_US.js +16 -3
  14. package/es/locale/zh_CN.d.ts +14 -1
  15. package/es/locale/zh_CN.js +14 -1
  16. package/es/style/theme/antd.less +122 -118
  17. package/lib/ProDrawerForm/style/index.less +59 -59
  18. package/lib/ProForm/components/combination/FormList/style/index.less +15 -22
  19. package/lib/ProForm/components/render/RenderFields.js +4 -3
  20. package/lib/ProLayout/components/ProFooter/style/index.less +8 -7
  21. package/lib/ProLayout/components/ProHeader/index.js +1 -0
  22. package/lib/ProLayout/components/ProHeader/style/index.less +6 -0
  23. package/lib/ProTabs/style/index.less +15 -16
  24. package/lib/ProThemeTools/component/PrdTools/index.js +21 -20
  25. package/lib/ProThemeTools/index.js +2 -1
  26. package/lib/ProTree/components/Tree.js +41 -40
  27. package/lib/locale/en_US.d.ts +14 -1
  28. package/lib/locale/en_US.js +16 -3
  29. package/lib/locale/zh_CN.d.ts +14 -1
  30. package/lib/locale/zh_CN.js +14 -1
  31. package/lib/style/theme/antd.less +122 -118
  32. 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';
@@ -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,
@@ -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;
@@ -135,5 +134,19 @@ declare const _default: {
135
134
  ProTimeLimit: {
136
135
  foreverText: string;
137
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
+ };
138
151
  };
139
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',
@@ -121,12 +120,12 @@ export default {
121
120
  ProTreeModal: {
122
121
  checkMsg: 'Please check first',
123
122
  select: 'Please select',
124
- input: 'please enter',
123
+ input: 'Please enter',
125
124
  errorArrayMessage: 'Please return a valid array',
126
125
  selectMin: 'Select at least {min}',
127
126
  selectMax: 'Select at most {max} items',
128
127
  noCheck: 'None selected yet',
129
- checkAll: 'select all',
128
+ checkAll: 'Select all',
130
129
  check: 'selected',
131
130
  clearAll: 'Clear all',
132
131
  checkNumber: '{num} items selected',
@@ -134,5 +133,19 @@ export default {
134
133
  },
135
134
  ProTimeLimit: {
136
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'
137
150
  }
138
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;
@@ -134,5 +133,19 @@ declare const _default: {
134
133
  ProTimeLimit: {
135
134
  foreverText: string;
136
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
+ };
137
150
  };
138
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: '重置列宽',
@@ -133,5 +132,19 @@ export default {
133
132
  },
134
133
  ProTimeLimit: {
135
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: '重置'
136
149
  }
137
150
  };