@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.
- package/dist/index.esm.css +35 -31
- package/dist/less.esm.css +20 -4
- package/es/ProConfigProvider/index.d.ts +1 -1
- package/es/ProConfigProvider/index.js +22 -1
- package/es/ProEditLabel/style/index.less +0 -1
- package/es/ProEditTable/components/DndWrapper/index.js +1 -1
- package/es/ProEditTable/components/RenderField/index.js +20 -14
- package/es/ProEditTable/index.js +17 -10
- package/es/ProEnum/components/Group.js +2 -19
- package/es/ProForm/components/base/DatePicker/index.js +3 -1
- package/es/ProForm/components/base/TextArea/index.js +4 -4
- package/es/ProForm/components/combination/FormList/components/ActionButton.d.ts +1 -0
- package/es/ProForm/components/combination/FormList/components/ActionButton.js +12 -10
- package/es/ProForm/components/combination/FormList/components/BlockFields.js +6 -1
- package/es/ProForm/components/combination/FormList/components/ToolbarButton.js +2 -5
- package/es/ProForm/components/combination/Group/index.js +3 -2
- package/es/ProForm/components/combination/ProModalSelect/hooks/useRequestList.js +2 -1
- package/es/ProForm/components/combination/ProModalSelect/index.js +116 -63
- package/es/ProForm/components/combination/ProModalSelect/propsType.d.ts +2 -2
- package/es/ProForm/components/combination/ProModalSelect/style/index.less +1 -1
- package/es/ProForm/components/combination/ProNumberRange/style/index.less +1 -1
- package/es/ProForm/components/render/ConfirmWrapper.js +8 -2
- package/es/ProForm/components/render/Render.js +12 -9
- package/es/ProForm/components/render/RenderFields.d.ts +1 -1
- package/es/ProForm/components/render/propsType.d.ts +4 -4
- package/es/ProForm/index.js +4 -5
- package/es/ProForm/propsType.d.ts +2 -2
- package/es/ProForm/style/index.less +23 -5
- package/es/ProForm/utils/diffOriginal.js +17 -32
- package/es/ProForm/utils/index.d.ts +1 -1
- package/es/ProForm/utils/index.js +14 -4
- package/es/ProForm/utils/rulesCreator.d.ts +7 -1
- package/es/ProForm/utils/rulesCreator.js +45 -3
- package/es/ProForm/utils/useRules.js +36 -11
- package/es/ProForm/utils/useShouldUpdate.js +4 -4
- package/es/ProLayout/components/ProCollapse/index.js +23 -1
- package/es/ProLayout/components/ProCollapse/style/index.less +1 -1
- package/es/ProThemeTools/component/PrdTools/index.js +12 -50
- package/es/ProThemeTools/index.js +0 -1
- package/es/ProTree/components/ProTreeSelect/style/index.less +1 -1
- package/es/ProTree/style/index.less +5 -0
- package/es/ProUpload/style/index.less +1 -1
- package/es/assets/view.svg +20 -1
- package/es/locale/en_US.d.ts +4 -2
- package/es/locale/en_US.js +4 -2
- package/es/locale/zh_CN.d.ts +4 -2
- package/es/locale/zh_CN.js +4 -2
- package/es/style/components.less +0 -3
- package/es/style/theme/antd.less +14 -28
- package/lib/ProConfigProvider/index.d.ts +1 -1
- package/lib/ProConfigProvider/index.js +21 -0
- package/lib/ProEditLabel/style/index.less +0 -1
- package/lib/ProEditTable/components/DndWrapper/index.js +1 -1
- package/lib/ProEditTable/components/RenderField/index.js +18 -12
- package/lib/ProEditTable/index.js +17 -10
- package/lib/ProEnum/components/Group.js +2 -19
- package/lib/ProForm/components/base/DatePicker/index.js +3 -1
- package/lib/ProForm/components/base/TextArea/index.js +5 -5
- package/lib/ProForm/components/combination/FormList/components/ActionButton.d.ts +1 -0
- package/lib/ProForm/components/combination/FormList/components/ActionButton.js +12 -10
- package/lib/ProForm/components/combination/FormList/components/BlockFields.js +6 -1
- package/lib/ProForm/components/combination/FormList/components/ToolbarButton.js +2 -5
- package/lib/ProForm/components/combination/Group/index.js +3 -2
- package/lib/ProForm/components/combination/ProModalSelect/hooks/useRequestList.js +2 -1
- package/lib/ProForm/components/combination/ProModalSelect/index.js +123 -74
- package/lib/ProForm/components/combination/ProModalSelect/propsType.d.ts +2 -2
- package/lib/ProForm/components/combination/ProModalSelect/style/index.less +1 -1
- package/lib/ProForm/components/combination/ProNumberRange/style/index.less +1 -1
- package/lib/ProForm/components/render/ConfirmWrapper.js +8 -2
- package/lib/ProForm/components/render/Render.js +12 -9
- package/lib/ProForm/components/render/RenderFields.d.ts +1 -1
- package/lib/ProForm/components/render/propsType.d.ts +4 -4
- package/lib/ProForm/index.js +4 -5
- package/lib/ProForm/propsType.d.ts +2 -2
- package/lib/ProForm/style/index.less +23 -5
- package/lib/ProForm/utils/diffOriginal.js +16 -31
- package/lib/ProForm/utils/index.d.ts +1 -1
- package/lib/ProForm/utils/index.js +14 -4
- package/lib/ProForm/utils/rulesCreator.d.ts +7 -1
- package/lib/ProForm/utils/rulesCreator.js +45 -2
- package/lib/ProForm/utils/useRules.js +36 -11
- package/lib/ProForm/utils/useShouldUpdate.js +4 -4
- package/lib/ProLayout/components/ProCollapse/index.js +23 -1
- package/lib/ProLayout/components/ProCollapse/style/index.less +1 -1
- package/lib/ProThemeTools/component/PrdTools/index.js +12 -50
- package/lib/ProThemeTools/index.js +0 -1
- package/lib/ProTree/components/ProTreeSelect/style/index.less +1 -1
- package/lib/ProTree/style/index.less +5 -0
- package/lib/ProUpload/style/index.less +1 -1
- package/lib/assets/view.svg +20 -1
- package/lib/locale/en_US.d.ts +4 -2
- package/lib/locale/en_US.js +4 -2
- package/lib/locale/zh_CN.d.ts +4 -2
- package/lib/locale/zh_CN.js +4 -2
- package/lib/style/components.less +0 -3
- package/lib/style/theme/antd.less +14 -28
- 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,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 =
|
|
13
|
-
var
|
|
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
|
-
|
|
29
|
-
|
|
30
|
-
|
|
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:
|
|
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)(
|
|
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
|
|
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
|
-
|
|
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 =
|
|
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) ?
|
|
143
|
+
var _required = (0, _lodash.isFunction)(required) ? required(_currentValues, {
|
|
144
144
|
form: form,
|
|
145
145
|
index: index,
|
|
146
146
|
namePath: namePath
|
|
147
|
-
})
|
|
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,
|
|
@@ -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:
|
|
154
|
+
value: ProForm === null || ProForm === void 0 ? void 0 : ProForm.labelAlign,
|
|
150
155
|
onChange: function onChange(e) {
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
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,
|
|
@@ -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
|
+
}
|
package/lib/assets/view.svg
CHANGED
|
@@ -1 +1,20 @@
|
|
|
1
|
-
<?xml version="1.0"
|
|
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>
|
package/lib/locale/en_US.d.ts
CHANGED
|
@@ -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
|
-
|
|
35
|
-
|
|
35
|
+
halfRuleText: string;
|
|
36
|
+
formListActions: string[];
|
|
37
|
+
formListConfirmMessage: string;
|
|
36
38
|
};
|
|
37
39
|
ProAction: {
|
|
38
40
|
errorMessage: string;
|
package/lib/locale/en_US.js
CHANGED
|
@@ -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
|
-
|
|
41
|
-
|
|
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',
|
package/lib/locale/zh_CN.d.ts
CHANGED
|
@@ -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
|
-
|
|
35
|
-
|
|
35
|
+
halfRuleText: string;
|
|
36
|
+
formListActions: string[];
|
|
37
|
+
formListConfirmMessage: string;
|
|
36
38
|
};
|
|
37
39
|
ProAction: {
|
|
38
40
|
errorMessage: string;
|
package/lib/locale/zh_CN.js
CHANGED
|
@@ -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
|
-
|
|
41
|
-
|
|
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:
|
|
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
|
-
|
|
35
|
-
|
|
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
|
-
|
|
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
|
-
>
|
|
721
|
-
>
|
|
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
|
-
>
|
|
738
|
-
>
|
|
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
|
+
"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": "
|
|
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",
|