@zat-design/sisyphus-react 3.4.3 → 3.4.4

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 (97) hide show
  1. package/dist/index.esm.css +35 -31
  2. package/dist/less.esm.css +20 -4
  3. package/es/ProConfigProvider/index.d.ts +1 -1
  4. package/es/ProConfigProvider/index.js +22 -1
  5. package/es/ProEditLabel/style/index.less +0 -1
  6. package/es/ProEditTable/components/DndWrapper/index.js +1 -1
  7. package/es/ProEditTable/components/RenderField/index.js +20 -14
  8. package/es/ProEditTable/index.js +17 -10
  9. package/es/ProEnum/components/Group.js +2 -19
  10. package/es/ProForm/components/base/DatePicker/index.js +3 -1
  11. package/es/ProForm/components/base/TextArea/index.js +4 -4
  12. package/es/ProForm/components/combination/FormList/components/ActionButton.d.ts +1 -0
  13. package/es/ProForm/components/combination/FormList/components/ActionButton.js +12 -10
  14. package/es/ProForm/components/combination/FormList/components/BlockFields.js +6 -1
  15. package/es/ProForm/components/combination/FormList/components/ToolbarButton.js +2 -5
  16. package/es/ProForm/components/combination/Group/index.js +3 -2
  17. package/es/ProForm/components/combination/ProModalSelect/hooks/useRequestList.js +2 -1
  18. package/es/ProForm/components/combination/ProModalSelect/index.js +116 -63
  19. package/es/ProForm/components/combination/ProModalSelect/propsType.d.ts +2 -2
  20. package/es/ProForm/components/combination/ProModalSelect/style/index.less +1 -1
  21. package/es/ProForm/components/combination/ProNumberRange/style/index.less +1 -1
  22. package/es/ProForm/components/render/ConfirmWrapper.js +8 -2
  23. package/es/ProForm/components/render/Render.js +12 -9
  24. package/es/ProForm/components/render/RenderFields.d.ts +1 -1
  25. package/es/ProForm/components/render/propsType.d.ts +4 -4
  26. package/es/ProForm/index.js +4 -5
  27. package/es/ProForm/propsType.d.ts +2 -2
  28. package/es/ProForm/style/index.less +23 -5
  29. package/es/ProForm/utils/diffOriginal.js +17 -32
  30. package/es/ProForm/utils/index.d.ts +1 -1
  31. package/es/ProForm/utils/index.js +14 -4
  32. package/es/ProForm/utils/rulesCreator.d.ts +7 -1
  33. package/es/ProForm/utils/rulesCreator.js +45 -3
  34. package/es/ProForm/utils/useRules.js +36 -11
  35. package/es/ProForm/utils/useShouldUpdate.js +4 -4
  36. package/es/ProLayout/components/ProCollapse/index.js +23 -1
  37. package/es/ProLayout/components/ProCollapse/style/index.less +1 -1
  38. package/es/ProThemeTools/component/PrdTools/index.js +12 -50
  39. package/es/ProThemeTools/index.js +0 -1
  40. package/es/ProTree/components/ProTreeSelect/style/index.less +1 -1
  41. package/es/ProTree/style/index.less +5 -0
  42. package/es/ProUpload/style/index.less +1 -1
  43. package/es/assets/view.svg +20 -1
  44. package/es/locale/en_US.d.ts +4 -2
  45. package/es/locale/en_US.js +4 -2
  46. package/es/locale/zh_CN.d.ts +4 -2
  47. package/es/locale/zh_CN.js +4 -2
  48. package/es/style/components.less +0 -3
  49. package/es/style/theme/antd.less +14 -28
  50. package/lib/ProConfigProvider/index.d.ts +1 -1
  51. package/lib/ProConfigProvider/index.js +21 -0
  52. package/lib/ProEditLabel/style/index.less +0 -1
  53. package/lib/ProEditTable/components/DndWrapper/index.js +1 -1
  54. package/lib/ProEditTable/components/RenderField/index.js +18 -12
  55. package/lib/ProEditTable/index.js +17 -10
  56. package/lib/ProEnum/components/Group.js +2 -19
  57. package/lib/ProForm/components/base/DatePicker/index.js +3 -1
  58. package/lib/ProForm/components/base/TextArea/index.js +5 -5
  59. package/lib/ProForm/components/combination/FormList/components/ActionButton.d.ts +1 -0
  60. package/lib/ProForm/components/combination/FormList/components/ActionButton.js +12 -10
  61. package/lib/ProForm/components/combination/FormList/components/BlockFields.js +6 -1
  62. package/lib/ProForm/components/combination/FormList/components/ToolbarButton.js +2 -5
  63. package/lib/ProForm/components/combination/Group/index.js +3 -2
  64. package/lib/ProForm/components/combination/ProModalSelect/hooks/useRequestList.js +2 -1
  65. package/lib/ProForm/components/combination/ProModalSelect/index.js +123 -74
  66. package/lib/ProForm/components/combination/ProModalSelect/propsType.d.ts +2 -2
  67. package/lib/ProForm/components/combination/ProModalSelect/style/index.less +1 -1
  68. package/lib/ProForm/components/combination/ProNumberRange/style/index.less +1 -1
  69. package/lib/ProForm/components/render/ConfirmWrapper.js +8 -2
  70. package/lib/ProForm/components/render/Render.js +12 -9
  71. package/lib/ProForm/components/render/RenderFields.d.ts +1 -1
  72. package/lib/ProForm/components/render/propsType.d.ts +4 -4
  73. package/lib/ProForm/index.js +4 -5
  74. package/lib/ProForm/propsType.d.ts +2 -2
  75. package/lib/ProForm/style/index.less +23 -5
  76. package/lib/ProForm/utils/diffOriginal.js +16 -31
  77. package/lib/ProForm/utils/index.d.ts +1 -1
  78. package/lib/ProForm/utils/index.js +14 -4
  79. package/lib/ProForm/utils/rulesCreator.d.ts +7 -1
  80. package/lib/ProForm/utils/rulesCreator.js +45 -2
  81. package/lib/ProForm/utils/useRules.js +36 -11
  82. package/lib/ProForm/utils/useShouldUpdate.js +4 -4
  83. package/lib/ProLayout/components/ProCollapse/index.js +23 -1
  84. package/lib/ProLayout/components/ProCollapse/style/index.less +1 -1
  85. package/lib/ProThemeTools/component/PrdTools/index.js +12 -50
  86. package/lib/ProThemeTools/index.js +0 -1
  87. package/lib/ProTree/components/ProTreeSelect/style/index.less +1 -1
  88. package/lib/ProTree/style/index.less +5 -0
  89. package/lib/ProUpload/style/index.less +1 -1
  90. package/lib/assets/view.svg +20 -1
  91. package/lib/locale/en_US.d.ts +4 -2
  92. package/lib/locale/en_US.js +4 -2
  93. package/lib/locale/zh_CN.d.ts +4 -2
  94. package/lib/locale/zh_CN.js +4 -2
  95. package/lib/style/components.less +0 -3
  96. package/lib/style/theme/antd.less +14 -28
  97. package/package.json +2 -2
@@ -36,7 +36,7 @@ export declare const isNullValue: (value: any) => boolean;
36
36
  * @param arr 值
37
37
  * @returns boole
38
38
  */
39
- export declare const isNotFullArray: (arr: any, length: any) => boolean;
39
+ export declare const isNotFullArray: (arr: any, length: any, required: any) => boolean;
40
40
  /**
41
41
  * 判断数组中值是否都为空 全部为空则为true
42
42
  * @param arr 值
@@ -21,6 +21,7 @@ var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers
21
21
  var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
22
22
  var _react = require("react");
23
23
  var _lodash = _interopRequireWildcard(require("lodash"));
24
+ var _moment = _interopRequireDefault(require("moment"));
24
25
  var getLayout = exports.getLayout = function getLayout(params) {
25
26
  var _params$span = params.span,
26
27
  span = _params$span === void 0 ? 8 : _params$span,
@@ -58,7 +59,7 @@ var useControlled = exports.useControlled = function useControlled(props) {
58
59
  var isSelect = exports.isSelect = function isSelect(props) {
59
60
  var dataSource = props.dataSource,
60
61
  type = props.type;
61
- return (dataSource === null || dataSource === void 0 ? void 0 : dataSource.length) || ['Select', 'ProSelect', 'ProEnum', 'DatePicker', 'RangePicker', 'ProAddressBar', 'ProTimeLimit', 'ProModalSelect', 'ProTreeModal', 'ProUpload'].includes(type);
62
+ return (dataSource === null || dataSource === void 0 ? void 0 : dataSource.length) || ['Select', 'ProSelect', 'ProEnum', 'DatePicker', 'RangePicker', 'ProAddressBar', 'ProTimeLimit', 'ProModalSelect', 'ProTreeModal', 'ProUpload', 'TimePicker'].includes(type);
62
63
  };
63
64
  /**
64
65
  * Input TextArea 移除前后空格
@@ -138,8 +139,8 @@ var splitNameStr = exports.splitNameStr = function splitNameStr(name) {
138
139
  // 过滤掉字段名中包含 '-' 的字段
139
140
  var filterInternalFields = exports.filterInternalFields = function filterInternalFields(values) {
140
141
  var nextValues = values;
141
- // fix: braft-editor对象不可遍历
142
- if (values === null || values === void 0 ? void 0 : values._immutable) {
142
+ // fix: braft-editor对象不可遍历 Moment不过滤
143
+ if ((values === null || values === void 0 ? void 0 : values._immutable) || _moment.default.isMoment(values)) {
143
144
  return nextValues;
144
145
  }
145
146
  if (Array.isArray(nextValues)) {
@@ -187,10 +188,15 @@ var isNullValue = exports.isNullValue = function isNullValue(value) {
187
188
  * @param arr 值
188
189
  * @returns boole
189
190
  */
190
- var isNotFullArray = exports.isNotFullArray = function isNotFullArray(arr, length) {
191
+ var isNotFullArray = exports.isNotFullArray = function isNotFullArray(arr, length, required) {
191
192
  if (!Array.isArray(arr)) {
192
193
  return false;
193
194
  }
195
+ if (Array.isArray(required) && required.some(function (item) {
196
+ return item === false;
197
+ })) {
198
+ return false;
199
+ }
194
200
  if (arr.length < length) return true;
195
201
  return arr.some(function (item) {
196
202
  if (item === undefined || item === null) {
@@ -311,6 +317,10 @@ function initialValuesToNames() {
311
317
  values[key] = formInitialValue;
312
318
  }
313
319
  }
320
+ // 给FormList默认增加一行
321
+ if (item.type === 'FormList' && !item.initialValue && !(0, _lodash.get)(values, item.name)) {
322
+ item.initialValue = [{}];
323
+ }
314
324
  });
315
325
  return values;
316
326
  }
@@ -1 +1,7 @@
1
- export declare const rulesCreator: (rules: any, label: any, isSelect: any) => any[];
1
+ export declare const rulesCreator: ({ rules, label, isSelect, names, required }: {
2
+ rules: any;
3
+ label: any;
4
+ isSelect: any;
5
+ names: any;
6
+ required: any;
7
+ }) => any[];
@@ -1,5 +1,6 @@
1
1
  "use strict";
2
2
 
3
+ var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
3
4
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
4
5
  Object.defineProperty(exports, "__esModule", {
5
6
  value: true
@@ -9,9 +10,23 @@ var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/obje
9
10
  var _utils = require("@zat-design/utils");
10
11
  var _lodash = require("lodash");
11
12
  var _index = require("./index");
12
- var _locale = _interopRequireDefault(require("../../locale"));
13
- var rulesCreator = exports.rulesCreator = function rulesCreator(rules, label, isSelect) {
13
+ var _locale = _interopRequireWildcard(require("../../locale"));
14
+ var getNonEmptyValuesByIndex = function getNonEmptyValuesByIndex(required, valueArray) {
15
+ var result = [];
16
+ required.forEach(function (item, index) {
17
+ if (item && !valueArray[index] && !(0, _lodash.isNumber)(valueArray[index])) {
18
+ result.push(index + 1);
19
+ }
20
+ });
21
+ return result;
22
+ };
23
+ var rulesCreator = exports.rulesCreator = function rulesCreator(_ref) {
14
24
  var _result;
25
+ var rules = _ref.rules,
26
+ label = _ref.label,
27
+ isSelect = _ref.isSelect,
28
+ names = _ref.names,
29
+ required = _ref.required;
15
30
  var message = "".concat(isSelect ? "".concat(_locale.default.ProForm.selectPlaceHolder) : "".concat(_locale.default.ProForm.inputPlaceholder)).concat(_locale.default.ProForm.ruleText).concat((0, _lodash.isString)(label) ? label : '');
16
31
  var result = [];
17
32
  result = rules.map(function (ruleItem) {
@@ -36,6 +51,34 @@ var rulesCreator = exports.rulesCreator = function rulesCreator(rules, label, is
36
51
  }
37
52
  return rule;
38
53
  });
54
+ if ((names === null || names === void 0 ? void 0 : names.length) && (required === null || required === void 0 ? void 0 : required.length)) {
55
+ var customRequired = {
56
+ validator: function validator(rules, value) {
57
+ var _errorValues3;
58
+ var errorValues = getNonEmptyValuesByIndex(required, value);
59
+ if ((value === null || value === void 0 ? void 0 : value.length) === 2) {
60
+ var _errorValues;
61
+ errorValues = errorValues.map(function (item) {
62
+ var _locale$ProForm;
63
+ return _locale.default === null || _locale.default === void 0 ? void 0 : (_locale$ProForm = _locale.default.ProForm) === null || _locale$ProForm === void 0 ? void 0 : _locale$ProForm.ruleStartEndText[item - 1];
64
+ });
65
+ if ((_errorValues = errorValues) === null || _errorValues === void 0 ? void 0 : _errorValues.length) {
66
+ var _locale$ProForm2, _errorValues2;
67
+ return Promise.reject(new Error("".concat(_locale.default === null || _locale.default === void 0 ? void 0 : (_locale$ProForm2 = _locale.default.ProForm) === null || _locale$ProForm2 === void 0 ? void 0 : _locale$ProForm2.inputPlaceholder).concat((_errorValues2 = errorValues) === null || _errorValues2 === void 0 ? void 0 : _errorValues2.join(','))));
68
+ }
69
+ }
70
+ // 校验为true的值是否存在
71
+ if (Array.isArray(value) && ((_errorValues3 = errorValues) === null || _errorValues3 === void 0 ? void 0 : _errorValues3.length)) {
72
+ var _locale$ProForm3, _errorValues4;
73
+ return Promise.reject(new Error("".concat((0, _locale.formatMessage)(_locale.default === null || _locale.default === void 0 ? void 0 : (_locale$ProForm3 = _locale.default.ProForm) === null || _locale$ProForm3 === void 0 ? void 0 : _locale$ProForm3.halfRuleText, {
74
+ total: (_errorValues4 = errorValues) === null || _errorValues4 === void 0 ? void 0 : _errorValues4.join(',')
75
+ }))));
76
+ }
77
+ return Promise.resolve();
78
+ }
79
+ };
80
+ result.push(customRequired);
81
+ }
39
82
  if (!((_result = result) === null || _result === void 0 ? void 0 : _result.length)) {
40
83
  result = [{
41
84
  required: false
@@ -20,19 +20,26 @@ var useRules = function useRules(props) {
20
20
  labelRequired = props.labelRequired,
21
21
  type = props.type;
22
22
  var _label = (0, _lodash.isString)(label) ? label : '';
23
+ var requiredRule = Array.isArray(rules) && (rules === null || rules === void 0 ? void 0 : rules.find(function (rule) {
24
+ return 'required' in rule;
25
+ }));
26
+ var allRequired = required === true || Array.isArray(required) && required.every(function (item) {
27
+ return item === true;
28
+ });
23
29
  // 根据 required 添加 rules, names 字段会添加数组的必填校验
24
30
  var internalRule = (0, _react.useMemo)(function () {
25
31
  var result = {
26
32
  rules: rules || []
27
33
  };
28
- if (required === true) {
29
- var requiredRule = Array.isArray(rules) && (rules === null || rules === void 0 ? void 0 : rules.find(function (rule) {
30
- return 'required' in rule;
31
- }));
34
+ // Group required: true时,直接走完整校验
35
+ if (allRequired && type === 'Group') {
36
+ return result;
37
+ }
38
+ if (allRequired) {
32
39
  if (!requiredRule) {
33
40
  var message = isSelect ? "".concat(_locale.default.ProForm.selectPlaceHolder).concat(_label) : "".concat(_locale.default.ProForm.inputPlaceholder).concat(_label);
34
41
  var rule = {
35
- required: required,
42
+ required: allRequired,
36
43
  message: message
37
44
  };
38
45
  // names字段的必填校验
@@ -50,22 +57,40 @@ var useRules = function useRules(props) {
50
57
  return result;
51
58
  }, [rules, required]);
52
59
  // type转换为内置rules
53
- internalRule.rules = internalRule.rules && (0, _rulesCreator.rulesCreator)(internalRule.rules, _label, isSelect);
60
+ internalRule.rules = internalRule.rules && (0, _rulesCreator.rulesCreator)({
61
+ rules: internalRule.rules,
62
+ label: _label,
63
+ isSelect: isSelect,
64
+ names: names,
65
+ required: required
66
+ });
54
67
  (0, _react.useEffect)(function () {
68
+ if (type === 'Group' && (allRequired || requiredRule)) {
69
+ var customRequired = {
70
+ validator: function validator(rules, value) {
71
+ // 完整性校验, 数组有值且值不完整则校验不通过
72
+ if (Array.isArray(value) && (0, _index.isNotFullArray)(value, names.length, required)) {
73
+ return Promise.reject(new Error("".concat(_locale.default.ProForm.completeText).concat(_label)));
74
+ }
75
+ return Promise.resolve();
76
+ }
77
+ };
78
+ // 插入rules第一条,完整性校验大于自定义
79
+ internalRule.rules.unshift(customRequired);
80
+ return;
81
+ }
55
82
  // 添加完整性校验
56
83
  if (names && !(0, _lodash.isBoolean)(labelRequired)) {
57
- var customRequired = {
84
+ var _customRequired = {
58
85
  validator: function validator(rules, value) {
59
86
  // 完整性校验, 空数组不校验, 数组有值且值不完整则校验不通过
60
- if (Array.isArray(value) && !(0, _index.isNullArray)(value) && (0, _index.isNotFullArray)(value, names.length)) {
87
+ if (Array.isArray(value) && !(0, _index.isNullArray)(value) && (0, _index.isNotFullArray)(value, names.length, required)) {
61
88
  return Promise.reject(new Error("".concat(_locale.default.ProForm.completeText).concat(_label)));
62
89
  }
63
90
  return Promise.resolve();
64
91
  }
65
92
  };
66
- if (!(type === 'Group' && Array.isArray(names) && !required)) {
67
- internalRule.rules.push(customRequired);
68
- }
93
+ internalRule.rules.unshift(_customRequired);
69
94
  }
70
95
  }, [internalRule]);
71
96
  return internalRule;
@@ -91,11 +91,11 @@ var useShouldUpdate = function useShouldUpdate(props) {
91
91
  disabledRef.current = disabled;
92
92
  }
93
93
  if ((0, _lodash.isFunction)(required)) {
94
- requiredRef.current = Boolean(required(values, {
94
+ requiredRef.current = required(values, {
95
95
  form: form,
96
96
  index: index,
97
97
  namePath: namePath
98
- }));
98
+ });
99
99
  } else {
100
100
  requiredRef.current = required;
101
101
  }
@@ -140,11 +140,11 @@ var useShouldUpdate = function useShouldUpdate(props) {
140
140
  index: index,
141
141
  namePath: namePath
142
142
  })) : disabled;
143
- var _required = (0, _lodash.isFunction)(required) ? Boolean(required(_currentValues, {
143
+ var _required = (0, _lodash.isFunction)(required) ? required(_currentValues, {
144
144
  form: form,
145
145
  index: index,
146
146
  namePath: namePath
147
- })) : required;
147
+ }) : required;
148
148
  var _rules = (0, _lodash.isFunction)(rules) ? rules(_currentValues, {
149
149
  form: form,
150
150
  index: index,
@@ -8,6 +8,7 @@ exports.default = void 0;
8
8
  var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
9
9
  var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
10
10
  var _jsxRuntime = require("react/jsx-runtime");
11
+ var _react = require("react");
11
12
  var _antd = require("antd");
12
13
  var _icons = require("@ant-design/icons");
13
14
  var _classnames = _interopRequireDefault(require("classnames"));
@@ -40,7 +41,8 @@ var ProCollapse = function ProCollapse(props) {
40
41
  'pro-collapse': true,
41
42
  'pro-collapse-level2': level === '2',
42
43
  'pro-collapse-list': titleList === null || titleList === void 0 ? void 0 : titleList.length,
43
- 'pro-collapse-no-title': !title
44
+ 'pro-collapse-no-title': !title,
45
+ 'pro-collapse-no-level1-title': !title && level !== '2'
44
46
  }, "".concat(className), className));
45
47
  var content = (0, _jsxRuntime.jsx)("div", {
46
48
  className: "pro-collapse-content",
@@ -109,6 +111,26 @@ var ProCollapse = function ProCollapse(props) {
109
111
  }), content]
110
112
  });
111
113
  };
114
+ // 当pro-layout-content只存在一个card时,高度动态计算
115
+ (0, _react.useLayoutEffect)(function () {
116
+ var proCollapseContent = document.querySelector('.pro-layout-content');
117
+ if (!proCollapseContent) {
118
+ return;
119
+ }
120
+ var proCollapseNoTitles = proCollapseContent.querySelectorAll('.pro-collapse-no-level1-title');
121
+ var proCollapses = proCollapseContent.querySelectorAll('.pro-collapse');
122
+ if (proCollapseNoTitles.length === 1 && proCollapses.length === 1) {
123
+ var rect = proCollapseNoTitles[0].getBoundingClientRect();
124
+ if ((rect === null || rect === void 0 ? void 0 : rect.height) < window.innerHeight - rect.top) {
125
+ proCollapseNoTitles[0].style.minHeight = "calc(100vh - ".concat(rect.top + 16, "px)");
126
+ }
127
+ }
128
+ return function () {
129
+ if (proCollapseNoTitles.length === 1 && proCollapses.length === 1) {
130
+ proCollapseNoTitles[0].style.minHeight = 'auto'; // 移除 minHeight 的设置
131
+ }
132
+ };
133
+ });
112
134
  return (0, _jsxRuntime.jsx)("div", {
113
135
  id: id,
114
136
  style: style,
@@ -23,7 +23,7 @@
23
23
 
24
24
  &.@{ant-prefix}-collapse {
25
25
  .pro-collapse-panel {
26
- margin-bottom: calc(var(--zaui-space-size-md; 16px) * var(--zaui-size; 1));
26
+ margin-bottom: 16px;
27
27
  }
28
28
  }
29
29
 
@@ -12,6 +12,7 @@ var _icons = require("@ant-design/icons");
12
12
  var _antd = require("antd");
13
13
  var _react = require("react");
14
14
  var _index = require("../../utils/index");
15
+ var _ProConfigProvider = require("../../../ProConfigProvider");
15
16
  var _locale = _interopRequireDefault(require("../../../locale"));
16
17
  var connect = function connect(Component) {
17
18
  var ComponentWrapper = function ComponentWrapper(props) {
@@ -29,6 +30,10 @@ var PrdTools = function PrdTools(_ref) {
29
30
  tableBorder = _ref.tableBorder,
30
31
  tableStripe = _ref.tableStripe,
31
32
  prefixCls = _ref.prefixCls;
33
+ var _useProConfig = (0, _ProConfigProvider.useProConfig)(),
34
+ config = _useProConfig.state,
35
+ dispatch = _useProConfig.dispatch;
36
+ var ProForm = config.ProForm;
32
37
  var _useState = (0, _react.useState)([{
33
38
  color: '#006AFF',
34
39
  active: true
@@ -146,35 +151,16 @@ var PrdTools = function PrdTools(_ref) {
146
151
  }), (0, _jsxRuntime.jsx)("div", {
147
152
  className: "pro-theme-tools-item",
148
153
  children: (0, _jsxRuntime.jsxs)(_antd.Radio.Group, {
149
- value: state.zauiFormAlign,
154
+ value: ProForm === null || ProForm === void 0 ? void 0 : ProForm.labelAlign,
150
155
  onChange: function onChange(e) {
151
- var after = e.target.value === 'left' ? 'inline' : 'none';
152
- var before = e.target.value === 'right' ? 'inline' : 'none';
153
- // 遍历添加className
154
- var formItemLabels = document.querySelectorAll(".".concat(prefixCls, "-form-item-label"));
155
- // 遍历元素列表,为每个元素添加新的 class
156
- formItemLabels.forEach(function (label) {
157
- var _label$classList, _label$classList$valu, _label$classList2, _label$classList2$val;
158
- if (!label) {
159
- return false;
160
- }
161
- if (e.target.value === 'left' && !((_label$classList = label.classList) === null || _label$classList === void 0 ? void 0 : (_label$classList$valu = _label$classList.value) === null || _label$classList$valu === void 0 ? void 0 : _label$classList$valu.includes("".concat(prefixCls, "-form-item-label-left")))) {
162
- label.classList.add("".concat(prefixCls, "-form-item-label-left"));
163
- }
164
- if (e.target.value === 'right' && ((_label$classList2 = label.classList) === null || _label$classList2 === void 0 ? void 0 : (_label$classList2$val = _label$classList2.value) === null || _label$classList2$val === void 0 ? void 0 : _label$classList2$val.includes("".concat(prefixCls, "-form-item-label-left")))) {
165
- label.classList.remove("".concat(prefixCls, "-form-item-label-left"));
156
+ dispatch({
157
+ type: 'setWithLocal',
158
+ payload: {
159
+ ProForm: {
160
+ labelAlign: e.target.value
161
+ }
166
162
  }
167
163
  });
168
- setState((0, _objectSpread2.default)((0, _objectSpread2.default)({}, state), {}, {
169
- zauiFormAlign: e.target.value,
170
- zauiFormRequiredAfter: after,
171
- zauiFormRequiredBefore: before
172
- }));
173
- (0, _index.setThemes)({
174
- 'zaui-form-align': e.target.value,
175
- 'zaui-form-required-after': after,
176
- 'zaui-form-required-before': before
177
- });
178
164
  },
179
165
  children: [(0, _jsxRuntime.jsx)(_antd.Radio.Button, {
180
166
  value: "left",
@@ -185,30 +171,6 @@ var PrdTools = function PrdTools(_ref) {
185
171
  })]
186
172
  })
187
173
  })]
188
- }), (0, _jsxRuntime.jsxs)("div", {
189
- className: "pro-theme-tools-box pro-theme-tools-space pro-theme-tools-small-space",
190
- children: [(0, _jsxRuntime.jsx)("div", {
191
- className: "pro-theme-tools-item",
192
- children: (0, _jsxRuntime.jsx)("p", {
193
- children: "".concat(_locale.default.ProThemeTools.bigText)
194
- })
195
- }), (0, _jsxRuntime.jsx)("div", {
196
- className: "pro-theme-tools-item",
197
- children: (0, _jsxRuntime.jsx)(_antd.Switch, {
198
- checkedChildren: "".concat(_locale.default.ProThemeTools.switchText[0]),
199
- unCheckedChildren: "".concat(_locale.default.ProThemeTools.switchText[1]),
200
- checked: state.zauiBigText,
201
- onClick: function onClick(value) {
202
- setState((0, _objectSpread2.default)((0, _objectSpread2.default)({}, state), {}, {
203
- zauiBaseFontSize: value ? 2 : 0,
204
- zauiBigText: value
205
- }));
206
- (0, _index.setThemes)({
207
- 'zaui-base-font-size': value ? '2px' : '0px'
208
- });
209
- }
210
- })
211
- })]
212
174
  }), tableBorder && (0, _jsxRuntime.jsxs)("div", {
213
175
  className: "pro-theme-tools-box pro-theme-tools-space pro-theme-tools-small-space",
214
176
  children: [(0, _jsxRuntime.jsx)("div", {
@@ -73,7 +73,6 @@ var ProThemeTools = function ProThemeTools(_ref) {
73
73
  (0, _index.setThemes)({
74
74
  'zaui-brand': '#006AFF',
75
75
  'zaui-text': '#343434',
76
- 'zaui-form-align': 'left',
77
76
  'zaui-form-required-after': 'inline',
78
77
  'zaui-form-required-before': 'none',
79
78
  'zaui-size': 1,
@@ -113,4 +113,4 @@
113
113
  }
114
114
  }
115
115
  }
116
- }
116
+ }
@@ -336,3 +336,8 @@
336
336
  .pro-form.pro-form-view .@{ant-prefix}-form-item .pro-tree .@{ant-prefix}-tree-checkbox * {
337
337
  height: 16px !important;
338
338
  }
339
+
340
+ // 解决双滚动条
341
+ .@{ant-prefix}-select-dropdown.pro-tree-select-drop-down-container.checkable-tree{
342
+ overflow: hidden!important;
343
+ }
@@ -324,7 +324,7 @@
324
324
  }
325
325
 
326
326
  .proupload-modal-preview {
327
- .ant-modal {
327
+ .@{ant-prefix}-modal {
328
328
  width: 600px;
329
329
  }
330
330
  }
@@ -1 +1,20 @@
1
- <?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1664364279428" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2737" xmlns:xlink="http://www.w3.org/1999/xlink" width="24" height="24"><path d="M801.605818 104.727273a117.666909 117.666909 0 0 1 117.434182 109.940363l0.232727 7.726546v246.597818a34.909091 34.909091 0 0 1-69.492363 4.747636l-0.325819-4.747636V222.394182c0-24.669091-18.618182-44.962909-42.635636-47.569455l-5.213091-0.279272H222.394182c-24.669091 0-44.962909 18.618182-47.569455 42.635636l-0.279272 5.213091v579.211636c0 24.669091 18.618182 44.962909 42.635636 47.569455l5.213091 0.279272h243.246545a34.909091 34.909091 0 0 1 4.747637 69.492364l-4.747637 0.325818H222.394182a117.666909 117.666909 0 0 1-117.434182-109.940363l-0.232727-7.726546V222.394182a117.666909 117.666909 0 0 1 109.940363-117.434182l7.726546-0.232727h579.211636zM448.558545 585.728a34.909091 34.909091 0 1 1 0 69.818182h-116.363636a34.909091 34.909091 0 1 1 0-69.818182h116.363636z m232.727273-232.727273a34.909091 34.909091 0 1 1 0 69.818182h-349.090909a34.909091 34.909091 0 1 1 0-69.818182h349.090909z" p-id="2738"></path><path d="M699.764364 490.356364a186.181818 186.181818 0 1 1 0 372.363636 186.181818 186.181818 0 0 1 0-372.363636z m0 69.818181a116.363636 116.363636 0 1 0 0 232.727273 116.363636 116.363636 0 0 0 0-232.727273z" p-id="2739"></path><path d="M798.673455 769.349818a34.909091 34.909091 0 0 1 49.338181 0l82.292364 82.245818a34.909091 34.909091 0 1 1-49.338182 49.384728l-82.292363-82.292364a34.909091 34.909091 0 0 1 0-49.338182z" p-id="2740"></path></svg>
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <svg width="19px" height="15px" viewBox="0 0 19 15" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
3
+ <title>icon-dropdown-searchlist</title>
4
+ <g id="页面-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
5
+ <g id="询报价录入交互说明" transform="translate(-531, -308)" fill="#999999" fill-rule="nonzero">
6
+ <g id="Dropdown/下拉弹窗切换/default备份-2" transform="translate(215, 299)">
7
+ <g id="编组-2" transform="translate(288, 1)">
8
+ <g id="编组" transform="translate(22, 0)">
9
+ <g id="icon-dropdown-searchlist" transform="translate(6, 8)">
10
+ <path d="M18.8595156,13.853235 L15.9118005,9.83277831 C16.9574103,8.79234063 17.6131433,7.33016175 17.6131433,5.70884872 C17.6131433,2.56113225 15.1539732,0 12.1315716,0 C9.10917008,0 6.65,2.56113225 6.65,5.70884872 C6.65,8.85656518 9.10917008,11.4176974 12.1315716,11.4176974 C13.1052358,11.4176974 14.0179175,11.1493815 14.811375,10.6841104 L17.7693681,14.7188392 C17.9043518,14.9029496 18.1078551,15 18.3147844,15 C18.4593609,15 18.6059929,14.952902 18.7293283,14.8537108 C19.0314999,14.6139391 19.0890564,14.1657945 18.8595156,13.853235 Z M8.02107811,5.70813511 C8.02107811,3.34681256 9.86494177,1.42649857 12.1322568,1.42649857 C14.3995719,1.42649857 16.2434356,3.34681256 16.2434356,5.70813511 C16.2434356,8.06945766 14.3995719,9.98977165 12.1322568,9.98977165 C9.86494177,9.98977165 8.02107811,8.06945766 8.02107811,5.70813511 Z" id="形状"></path>
11
+ <path d="M4.9875,2.34375 L0.7125,2.34375 C0.3192,2.34375 0,2.02875 0,1.640625 C0,1.2525 0.3192,0.9375 0.7125,0.9375 L4.9875,0.9375 C5.3808,0.9375 5.7,1.2525 5.7,1.640625 C5.7,2.02875 5.3808,2.34375 4.9875,2.34375 Z" id="路径"></path>
12
+ <path d="M3.95833333,7.96875 L0.791666667,7.96875 C0.354666667,7.96875 0,7.65445313 0,7.265625 C0,6.8775 0.354666667,6.5625 0.791666667,6.5625 L3.95833333,6.5625 C4.39533333,6.5625 4.75,6.8775 4.75,7.265625 C4.75,7.65445313 4.39533333,7.96875 3.95833333,7.96875 Z" id="路径"></path>
13
+ <path d="M7.89230769,13.59375 L0.657692308,13.59375 C0.294646154,13.59375 0,13.2794531 0,12.890625 C0,12.5017969 0.294646154,12.1875 0.657692308,12.1875 L7.89230769,12.1875 C8.25535385,12.1875 8.55,12.5017969 8.55,12.890625 C8.55,13.2794531 8.25535385,13.59375 7.89230769,13.59375 Z" id="路径"></path>
14
+ </g>
15
+ </g>
16
+ </g>
17
+ </g>
18
+ </g>
19
+ </g>
20
+ </svg>
@@ -27,12 +27,14 @@ declare const _default: {
27
27
  inputPlaceholder: string;
28
28
  selectPlaceHolder: string;
29
29
  switchText: string[];
30
+ ruleStartEndText: string[];
30
31
  search: string;
31
32
  reset: string;
32
33
  ruleText: string;
33
34
  completeText: string;
34
- formList_actions: string[];
35
- formList_confirmMessage: string;
35
+ halfRuleText: string;
36
+ formListActions: string[];
37
+ formListConfirmMessage: string;
36
38
  };
37
39
  ProAction: {
38
40
  errorMessage: string;
@@ -33,12 +33,14 @@ var _default = exports.default = {
33
33
  inputPlaceholder: 'Please enter',
34
34
  selectPlaceHolder: 'Please select',
35
35
  switchText: ['Yes', 'No'],
36
+ ruleStartEndText: ['start value', 'end value'],
36
37
  search: 'Search',
37
38
  reset: 'Reset',
38
39
  ruleText: 'correct',
39
40
  completeText: 'enter in full',
40
- formList_actions: ['Add', 'Delete', 'Copy', 'Move up', 'Move down', 'Add a new line'],
41
- formList_confirmMessage: 'Are you sure delete it?'
41
+ halfRuleText: 'Enter the value of ({total})',
42
+ formListActions: ['Add', 'Delete', 'Copy', 'Move up', 'Move down', 'Add a new line'],
43
+ formListConfirmMessage: 'Are you sure delete it?'
42
44
  },
43
45
  ProAction: {
44
46
  errorMessage: 'The configuration config for ProAction must be data',
@@ -27,12 +27,14 @@ declare const _default: {
27
27
  inputPlaceholder: string;
28
28
  selectPlaceHolder: string;
29
29
  switchText: string[];
30
+ ruleStartEndText: string[];
30
31
  search: string;
31
32
  reset: string;
32
33
  ruleText: string;
33
34
  completeText: string;
34
- formList_actions: string[];
35
- formList_confirmMessage: string;
35
+ halfRuleText: string;
36
+ formListActions: string[];
37
+ formListConfirmMessage: string;
36
38
  };
37
39
  ProAction: {
38
40
  errorMessage: string;
@@ -33,12 +33,14 @@ var _default = exports.default = {
33
33
  inputPlaceholder: '请输入',
34
34
  selectPlaceHolder: '请选择',
35
35
  switchText: ['是', '否'],
36
+ ruleStartEndText: ['起始值', '截止值'],
36
37
  search: '查询',
37
38
  reset: '重置',
38
39
  ruleText: '正确的',
39
40
  completeText: '请完整输入',
40
- formList_actions: ['新增', '删除', '复制', '上移', '下移', '新增一行'],
41
- formList_confirmMessage: '确认删除吗?'
41
+ halfRuleText: '请输入第({total})个表单的值',
42
+ formListActions: ['新增', '删除', '复制', '上移', '下移', '新增一行'],
43
+ formListConfirmMessage: '确认删除吗?'
42
44
  },
43
45
  ProAction: {
44
46
  errorMessage: 'ProAction 配置 config 必须为数据',
@@ -19,13 +19,10 @@
19
19
  @import '../ProEditTable/style/index';
20
20
  @import '../ProEditLabel/style/index';
21
21
 
22
-
23
22
  // 通用
24
23
  @import '../ProIcon/style/index';
25
24
  @import '../ProThemeTools/style/index';
26
25
  @import '../ProDownload/style/index';
27
26
 
28
-
29
-
30
27
  // old 待废弃
31
28
  @import '../old/ProEditableTable/style/index';
@@ -24,48 +24,34 @@
24
24
  // label 超过130px换行
25
25
  .@{ant-prefix}-form-item-label {
26
26
  flex: 0 0 @zaui-form-label-width;
27
- padding-right: @zaui-space-size-md;
27
+ padding-right: 16px;
28
28
  overflow: initial;
29
29
  line-height: 1;
30
30
  white-space: pre-wrap;
31
- text-align: @zaui-form-align;
32
31
 
33
32
  .@{ant-prefix}-form-item-required {
34
- &::after {
35
- display: block;
33
+ position: relative;
34
+ &::before {
35
+ position: absolute;
36
+ top: calc(50% - 7px);
37
+ left: -8px;
38
+ margin: 0;
36
39
  }
37
40
  }
38
41
 
39
42
  & > label {
40
43
  word-break: break-word;
41
44
 
45
+ // 隐藏冒号
42
46
  &::after {
43
47
  display: none;
44
- margin: 0;
45
48
  }
46
49
  }
47
50
 
48
- & .@{ant-prefix}-form-item-required::before {
49
- display: inline-block;
50
- }
51
-
52
51
  &.@{ant-prefix}-form-item-label-left {
53
52
  & > .@{ant-prefix}-form-item-required::before {
54
- display: none;
55
- }
56
-
57
- & > .@{ant-prefix}-form-item-required::after {
58
- margin-top: 1px;
59
- color: #ff4d4f;
60
- font-size: var(--zaui-font-size, 14px);
61
- line-height: 1;
62
- content: '*';
63
- }
64
- }
65
-
66
- &:not(.@{ant-prefix}-form-item-label-left) {
67
- & > .@{ant-prefix}-form-item-required::after {
68
- display: none;
53
+ right: -10px;
54
+ left: unset;
69
55
  }
70
56
  }
71
57
  }
@@ -717,8 +703,8 @@
717
703
 
718
704
  // tooltip样式重载
719
705
  .@{ant-prefix}-tooltip {
720
- > .ant-tooltip-content {
721
- > .ant-tooltip-inner {
706
+ > .@{ant-prefix}-tooltip-content {
707
+ > .@{ant-prefix}-tooltip-inner {
722
708
  color: rgb(29, 33, 41);
723
709
  background-color: #fff;
724
710
  box-shadow: 0 3px 6px -4px rgba(0, 0, 0, 0.12), 0 6px 16px 0 rgba(0, 0, 0, 0.08),
@@ -734,8 +720,8 @@
734
720
  }
735
721
  }
736
722
  }
737
- > .ant-tooltip-arrow {
738
- > .ant-tooltip-arrow-content {
723
+ > .@{ant-prefix}-tooltip-arrow {
724
+ > .@{ant-prefix}-tooltip-arrow-content {
739
725
  --antd-arrow-background-color: linear-gradient(
740
726
  to right bottom,
741
727
  rgba(255, 255, 255, 0.95),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zat-design/sisyphus-react",
3
- "version": "3.4.3",
3
+ "version": "3.4.4",
4
4
  "license": "Apache-2.0",
5
5
  "main": "lib/index.js",
6
6
  "module": "es/index.js",
@@ -58,7 +58,7 @@
58
58
  "@dnd-kit/sortable": "^7.0.2",
59
59
  "@dnd-kit/utilities": "^3.2.1",
60
60
  "@pansy/react-watermark": "^3.1.13",
61
- "@zat-design/utils": "^1.1.16",
61
+ "@zat-design/utils": "1.1.16",
62
62
  "ahooks": "3.7.4",
63
63
  "antd": "4.24.8",
64
64
  "big.js": "^6.2.1",