@zat-design/sisyphus-react 3.2.2 → 3.3.0-beta.10
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/README.md +7 -0
- package/dist/index.esm.css +89 -37
- package/es/ProAction/index.less +3 -0
- package/es/ProDownload/index.js +9 -6
- package/es/ProDownload/style/index.less +5 -2
- package/es/ProDrawerForm/index.js +1 -15
- package/es/ProDrawerForm/style/index.less +76 -73
- package/es/ProEditLabel/style/index.less +12 -9
- package/es/ProEditTable/components/RenderField/index.js +6 -4
- package/es/ProEditTable/index.js +37 -22
- package/es/ProEditTable/style/index.less +57 -47
- package/es/ProEditTable/utils/config.d.ts +1 -1
- package/es/ProEditTable/utils/config.js +3 -3
- package/es/ProEnum/index.js +7 -18
- package/es/ProEnum/propsType.d.ts +1 -0
- package/es/ProEnum/style/index.less +3 -0
- package/es/ProForm/components/base/DatePicker/index.d.ts +2 -2
- package/es/ProForm/components/base/DatePicker/index.js +5 -8
- package/es/ProForm/components/base/RangePicker/index.d.ts +3 -2
- package/es/ProForm/components/base/RangePicker/index.js +3 -5
- package/es/ProForm/components/base/SwitchCheckbox/style/index.less +3 -0
- package/es/ProForm/components/base/TextArea/index.less +4 -3
- package/es/ProForm/components/base/TimePicker/index.js +3 -3
- package/es/ProForm/components/base/TimePicker/style/index.less +4 -1
- package/es/ProForm/components/combination/Container/style/index.less +6 -3
- package/es/ProForm/components/combination/FormList/style/index.less +20 -24
- package/es/ProForm/components/combination/Group/style/index.less +18 -15
- package/es/ProForm/components/combination/ProAddressBar/style/index.less +6 -3
- package/es/ProForm/components/combination/ProCombination/style/index.less +5 -2
- package/es/ProForm/components/combination/ProModalSelect/hooks/useRequestList.js +6 -1
- package/es/ProForm/components/combination/ProModalSelect/index.js +23 -25
- package/es/ProForm/components/combination/ProModalSelect/style/index.less +32 -11
- package/es/ProForm/components/combination/ProNumberRange/style/index.less +13 -10
- package/es/ProForm/components/combination/ProRangeLimit/index.d.ts +2 -2
- package/es/ProForm/components/combination/ProRangeLimit/index.js +6 -6
- package/es/ProForm/components/combination/ProTimeLimit/hooks/useControlled.d.ts +2 -2
- package/es/ProForm/components/combination/ProTimeLimit/hooks/useControlled.js +2 -2
- package/es/ProForm/components/combination/ProTimeLimit/index.d.ts +2 -2
- package/es/ProForm/components/combination/ProTimeLimit/index.js +4 -4
- package/es/ProForm/components/combination/ProTimeLimit/style/index.less +9 -6
- package/es/ProForm/components/old/ProCertValidity/index.js +16 -16
- package/es/ProForm/components/old/ProCertValidity/propsType.d.ts +4 -4
- package/es/ProForm/components/render/Render.js +14 -23
- package/es/ProForm/components/render/RenderFields.js +10 -7
- package/es/ProForm/style/index.less +46 -44
- package/es/ProForm/utils/rulesCreator.js +2 -1
- package/es/ProForm/utils/useRules.js +6 -5
- package/es/ProIcon/style/index.less +4 -1
- package/es/ProLayout/components/Layout/Header/style/index.less +1 -1
- package/es/ProLayout/components/Layout/Menu/FoldMenu/style/index.less +10 -7
- package/es/ProLayout/components/Layout/Menu/OpenMenu/style/index.less +31 -28
- package/es/ProLayout/components/Layout/Menu/SideMenu/style/index.less +14 -11
- package/es/ProLayout/components/Layout/Menu/style/index.less +2 -0
- package/es/ProLayout/components/Layout/Notice/style/index.less +3 -0
- package/es/ProLayout/components/ProCollapse/style/index.less +27 -24
- package/es/ProLayout/components/ProFooter/style/index.less +11 -7
- package/es/ProLayout/components/ProHeader/components/ProBackBtn/style/index.less +4 -1
- package/es/ProLayout/components/ProHeader/index.js +4 -4
- package/es/ProLayout/components/ProHeader/style/index.less +12 -11
- package/es/ProLayout/style/index.less +10 -7
- package/es/ProSelect/index.less +3 -0
- package/es/ProStep/index.js +2 -2
- package/es/ProStep/style/index.less +3 -0
- package/es/ProTable/index.js +15 -7
- package/es/ProTable/style/index.less +76 -54
- package/es/ProTable/utils.d.ts +1 -1
- package/es/ProTable/utils.js +52 -33
- package/es/ProTabs/style/index.less +25 -23
- package/es/ProThemeTools/component/PrdTools/index.d.ts +1 -1
- package/es/ProThemeTools/component/PrdTools/index.js +7 -6
- package/es/ProThemeTools/component/PrdTools/style/index.less +6 -6
- package/es/ProThemeTools/index.d.ts +1 -1
- package/es/ProThemeTools/index.js +7 -2
- package/es/ProThemeTools/propsType.d.ts +4 -0
- package/es/ProThemeTools/style/index.less +6 -3
- package/es/ProThemeTools/utils/index.d.ts +1 -1
- package/es/ProThemeTools/utils/index.js +2 -1
- package/es/ProTooltip/style/index.less +3 -0
- package/es/ProTree/components/CloseIcon.js +2 -4
- package/es/ProTree/components/ProTree.js +27 -11
- package/es/ProTree/components/Tree.js +1 -1
- package/es/ProTree/propsType.d.ts +2 -2
- package/es/ProTree/style/index.less +29 -26
- package/es/ProTree/utils.d.ts +6 -0
- package/es/ProTree/utils.js +11 -0
- package/es/ProTreeModal/components/CloseIcon.js +2 -4
- package/es/ProTreeModal/components/Trigger.d.ts +3 -0
- package/es/ProTreeModal/components/Trigger.js +79 -19
- package/es/ProTreeModal/index.js +38 -6
- package/es/ProTreeModal/propsType.d.ts +5 -2
- package/es/ProTreeModal/style/index.less +96 -92
- package/es/ProTreeSelect/index.js +6 -4
- package/es/ProTreeSelect/propsType.d.ts +2 -0
- package/es/ProTreeSelect/style/index.less +25 -22
- package/es/ProUpload/components/DragRender.js +7 -4
- package/es/ProUpload/components/ImageRender.js +8 -5
- package/es/ProUpload/index.js +11 -7
- package/es/ProUpload/style/index.less +13 -4
- package/es/ProViewer/index.js +3 -1
- package/es/ProViewer/style/index.less +6 -3
- package/es/locale/en_US.d.ts +4 -0
- package/es/locale/en_US.js +5 -1
- package/es/locale/index.js +2 -2
- package/es/locale/zh_CN.d.ts +4 -0
- package/es/locale/zh_CN.js +6 -2
- package/es/old/ProCertValidity/index.js +16 -16
- package/es/old/ProCertValidity/propsType.d.ts +4 -4
- package/es/old/ProEditableTable/utils.d.ts +5 -5
- package/es/old/ProEditableTable/utils.js +5 -5
- package/es/style/core/compatible.less +6 -6
- package/es/style/theme/antd.less +272 -253
- package/lib/ProAction/index.less +3 -0
- package/lib/ProDownload/index.js +9 -6
- package/lib/ProDownload/style/index.less +5 -2
- package/lib/ProDrawerForm/index.js +0 -14
- package/lib/ProDrawerForm/style/index.less +76 -73
- package/lib/ProEditLabel/style/index.less +12 -9
- package/lib/ProEditTable/components/RenderField/index.js +6 -4
- package/lib/ProEditTable/index.js +35 -20
- package/lib/ProEditTable/style/index.less +57 -47
- package/lib/ProEditTable/utils/config.d.ts +1 -1
- package/lib/ProEditTable/utils/config.js +3 -3
- package/lib/ProEnum/index.js +6 -17
- package/lib/ProEnum/propsType.d.ts +1 -0
- package/lib/ProEnum/style/index.less +3 -0
- package/lib/ProForm/components/base/DatePicker/index.d.ts +2 -2
- package/lib/ProForm/components/base/DatePicker/index.js +5 -8
- package/lib/ProForm/components/base/RangePicker/index.d.ts +3 -2
- package/lib/ProForm/components/base/RangePicker/index.js +4 -4
- package/lib/ProForm/components/base/SwitchCheckbox/style/index.less +3 -0
- package/lib/ProForm/components/base/TextArea/index.less +4 -3
- package/lib/ProForm/components/base/TimePicker/index.js +3 -3
- package/lib/ProForm/components/base/TimePicker/style/index.less +4 -1
- package/lib/ProForm/components/combination/Container/style/index.less +6 -3
- package/lib/ProForm/components/combination/FormList/style/index.less +20 -24
- package/lib/ProForm/components/combination/Group/style/index.less +18 -15
- package/lib/ProForm/components/combination/ProAddressBar/style/index.less +6 -3
- package/lib/ProForm/components/combination/ProCombination/style/index.less +5 -2
- package/lib/ProForm/components/combination/ProModalSelect/hooks/useRequestList.js +7 -1
- package/lib/ProForm/components/combination/ProModalSelect/index.js +23 -25
- package/lib/ProForm/components/combination/ProModalSelect/style/index.less +32 -11
- package/lib/ProForm/components/combination/ProNumberRange/style/index.less +13 -10
- package/lib/ProForm/components/combination/ProRangeLimit/index.d.ts +2 -2
- package/lib/ProForm/components/combination/ProRangeLimit/index.js +6 -6
- package/lib/ProForm/components/combination/ProTimeLimit/hooks/useControlled.d.ts +2 -2
- package/lib/ProForm/components/combination/ProTimeLimit/hooks/useControlled.js +2 -2
- package/lib/ProForm/components/combination/ProTimeLimit/index.d.ts +2 -2
- package/lib/ProForm/components/combination/ProTimeLimit/index.js +4 -4
- package/lib/ProForm/components/combination/ProTimeLimit/style/index.less +9 -6
- package/lib/ProForm/components/old/ProCertValidity/index.js +16 -16
- package/lib/ProForm/components/old/ProCertValidity/propsType.d.ts +4 -4
- package/lib/ProForm/components/render/Render.js +14 -23
- package/lib/ProForm/components/render/RenderFields.js +9 -6
- package/lib/ProForm/style/index.less +46 -44
- package/lib/ProForm/utils/rulesCreator.js +2 -1
- package/lib/ProForm/utils/useRules.js +5 -4
- package/lib/ProIcon/style/index.less +4 -1
- package/lib/ProLayout/components/Layout/Header/style/index.less +1 -1
- package/lib/ProLayout/components/Layout/Menu/FoldMenu/style/index.less +10 -7
- package/lib/ProLayout/components/Layout/Menu/OpenMenu/style/index.less +31 -28
- package/lib/ProLayout/components/Layout/Menu/SideMenu/style/index.less +14 -11
- package/lib/ProLayout/components/Layout/Menu/style/index.less +2 -0
- package/lib/ProLayout/components/Layout/Notice/style/index.less +3 -0
- package/lib/ProLayout/components/ProCollapse/style/index.less +27 -24
- package/lib/ProLayout/components/ProFooter/style/index.less +11 -7
- package/lib/ProLayout/components/ProHeader/components/ProBackBtn/style/index.less +4 -1
- package/lib/ProLayout/components/ProHeader/index.js +4 -4
- package/lib/ProLayout/components/ProHeader/style/index.less +12 -11
- package/lib/ProLayout/style/index.less +10 -7
- package/lib/ProSelect/index.less +3 -0
- package/lib/ProStep/index.js +1 -1
- package/lib/ProStep/style/index.less +3 -0
- package/lib/ProTable/index.js +14 -6
- package/lib/ProTable/style/index.less +76 -54
- package/lib/ProTable/utils.d.ts +1 -1
- package/lib/ProTable/utils.js +52 -33
- package/lib/ProTabs/style/index.less +25 -23
- package/lib/ProThemeTools/component/PrdTools/index.d.ts +1 -1
- package/lib/ProThemeTools/component/PrdTools/index.js +7 -6
- package/lib/ProThemeTools/component/PrdTools/style/index.less +6 -6
- package/lib/ProThemeTools/index.d.ts +1 -1
- package/lib/ProThemeTools/index.js +7 -2
- package/lib/ProThemeTools/propsType.d.ts +4 -0
- package/lib/ProThemeTools/style/index.less +6 -3
- package/lib/ProThemeTools/utils/index.d.ts +1 -1
- package/lib/ProThemeTools/utils/index.js +2 -1
- package/lib/ProTooltip/style/index.less +3 -0
- package/lib/ProTree/components/CloseIcon.js +2 -4
- package/lib/ProTree/components/ProTree.js +26 -10
- package/lib/ProTree/components/Tree.js +1 -1
- package/lib/ProTree/propsType.d.ts +2 -2
- package/lib/ProTree/style/index.less +29 -26
- package/lib/ProTree/utils.d.ts +6 -0
- package/lib/ProTree/utils.js +12 -0
- package/lib/ProTreeModal/components/CloseIcon.js +2 -4
- package/lib/ProTreeModal/components/Trigger.d.ts +3 -0
- package/lib/ProTreeModal/components/Trigger.js +74 -18
- package/lib/ProTreeModal/index.js +38 -6
- package/lib/ProTreeModal/propsType.d.ts +5 -2
- package/lib/ProTreeModal/style/index.less +96 -92
- package/lib/ProTreeSelect/index.js +6 -4
- package/lib/ProTreeSelect/propsType.d.ts +2 -0
- package/lib/ProTreeSelect/style/index.less +25 -22
- package/lib/ProUpload/components/DragRender.js +7 -4
- package/lib/ProUpload/components/ImageRender.js +8 -5
- package/lib/ProUpload/index.js +11 -7
- package/lib/ProUpload/style/index.less +13 -4
- package/lib/ProViewer/index.js +4 -3
- package/lib/ProViewer/style/index.less +6 -3
- package/lib/locale/en_US.d.ts +4 -0
- package/lib/locale/en_US.js +5 -1
- package/lib/locale/index.js +2 -2
- package/lib/locale/zh_CN.d.ts +4 -0
- package/lib/locale/zh_CN.js +6 -2
- package/lib/old/ProCertValidity/index.js +16 -16
- package/lib/old/ProCertValidity/propsType.d.ts +4 -4
- package/lib/old/ProEditableTable/utils.d.ts +5 -5
- package/lib/old/ProEditableTable/utils.js +5 -5
- package/lib/style/core/compatible.less +6 -6
- package/lib/style/theme/antd.less +272 -253
- package/package.json +3 -2
- package/typings.d.ts +0 -6
|
@@ -9,7 +9,7 @@ var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/obje
|
|
|
9
9
|
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
10
10
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
11
11
|
var _antd = require("antd");
|
|
12
|
-
var
|
|
12
|
+
var _dayjs = _interopRequireDefault(require("dayjs"));
|
|
13
13
|
var _react = require("react");
|
|
14
14
|
var _excluded = ["value", "onChange", "disabled", "isRange", "getPopupContainer", "showForever", "proformmode"]; // @ts-nocheck
|
|
15
15
|
var RangePicker = _antd.DatePicker.RangePicker;
|
|
@@ -50,37 +50,37 @@ var ProCertValidity = exports.ProCertValidity = /*#__PURE__*/(0, _react.forwardR
|
|
|
50
50
|
forever = _value2.forever;
|
|
51
51
|
if (forever === 'Y') {
|
|
52
52
|
return {
|
|
53
|
-
range: [(0,
|
|
53
|
+
range: [(0, _dayjs.default)('9999-01-01'), (0, _dayjs.default)('9999-01-01')],
|
|
54
54
|
forever: true
|
|
55
55
|
};
|
|
56
56
|
}
|
|
57
57
|
if (startTime && endTime) {
|
|
58
|
-
var tempStartDate = (0,
|
|
59
|
-
var tempEndDate = (0,
|
|
58
|
+
var tempStartDate = (0, _dayjs.default)(startTime).format(defaultFormatDate);
|
|
59
|
+
var tempEndDate = (0, _dayjs.default)(endTime).format(defaultFormatDate);
|
|
60
60
|
if ((!forever || forever === 'N') && !checkIsForever(tempStartDate) && !checkIsForever(tempEndDate)) {
|
|
61
61
|
return {
|
|
62
|
-
range: [(0,
|
|
62
|
+
range: [(0, _dayjs.default)(startTime), (0, _dayjs.default)(endTime)],
|
|
63
63
|
forever: false
|
|
64
64
|
};
|
|
65
65
|
}
|
|
66
66
|
if (checkIsForever(tempStartDate) && checkIsForever(tempEndDate) && !isChange.current) {
|
|
67
67
|
return {
|
|
68
|
-
range: [(0,
|
|
68
|
+
range: [(0, _dayjs.default)('9999-01-01'), (0, _dayjs.default)('9999-01-01')],
|
|
69
69
|
forever: true
|
|
70
70
|
};
|
|
71
71
|
}
|
|
72
72
|
}
|
|
73
73
|
} else {
|
|
74
74
|
if (typeof value === 'string' || value._isAMomentObject) {
|
|
75
|
-
var tempDate = (0,
|
|
75
|
+
var tempDate = (0, _dayjs.default)(value).format(defaultFormatDate);
|
|
76
76
|
if (tempDate && tempDate === '9999-01-01') {
|
|
77
77
|
return {
|
|
78
|
-
range: (0,
|
|
78
|
+
range: (0, _dayjs.default)('9999-01-01'),
|
|
79
79
|
forever: true
|
|
80
80
|
};
|
|
81
81
|
}
|
|
82
82
|
return {
|
|
83
|
-
range: (0,
|
|
83
|
+
range: (0, _dayjs.default)(value),
|
|
84
84
|
forever: false
|
|
85
85
|
};
|
|
86
86
|
}
|
|
@@ -89,21 +89,21 @@ var ProCertValidity = exports.ProCertValidity = /*#__PURE__*/(0, _react.forwardR
|
|
|
89
89
|
_forever = _value3.forever;
|
|
90
90
|
if (_forever === 'Y') {
|
|
91
91
|
return {
|
|
92
|
-
range: (0,
|
|
92
|
+
range: (0, _dayjs.default)('9999-01-01'),
|
|
93
93
|
forever: true
|
|
94
94
|
};
|
|
95
95
|
}
|
|
96
96
|
if (dateTime) {
|
|
97
|
-
var _tempDate = (0,
|
|
97
|
+
var _tempDate = (0, _dayjs.default)(dateTime).format(defaultFormatDate);
|
|
98
98
|
if ((!_forever || _forever === 'N') && _tempDate !== '9999-01-01') {
|
|
99
99
|
return {
|
|
100
|
-
range: (0,
|
|
100
|
+
range: (0, _dayjs.default)(dateTime),
|
|
101
101
|
forever: false
|
|
102
102
|
};
|
|
103
103
|
}
|
|
104
104
|
if (_tempDate && _tempDate === '9999-01-01' && !isChange.current) {
|
|
105
105
|
return {
|
|
106
|
-
range: (0,
|
|
106
|
+
range: (0, _dayjs.default)('9999-01-01'),
|
|
107
107
|
forever: true
|
|
108
108
|
};
|
|
109
109
|
}
|
|
@@ -113,8 +113,8 @@ var ProCertValidity = exports.ProCertValidity = /*#__PURE__*/(0, _react.forwardR
|
|
|
113
113
|
}, [value, (_value4 = value) === null || _value4 === void 0 ? void 0 : _value4.dateTime]);
|
|
114
114
|
var changeRangeTime = function changeRangeTime(values) {
|
|
115
115
|
onChange({
|
|
116
|
-
startTime: values ? (0,
|
|
117
|
-
endTime: values ? (0,
|
|
116
|
+
startTime: values ? (0, _dayjs.default)(values === null || values === void 0 ? void 0 : values[0]).format(defaultFormatDate) : null,
|
|
117
|
+
endTime: values ? (0, _dayjs.default)(values === null || values === void 0 ? void 0 : values[1]).format(defaultFormatDate) : null,
|
|
118
118
|
forever: 'N'
|
|
119
119
|
});
|
|
120
120
|
};
|
|
@@ -142,7 +142,7 @@ var ProCertValidity = exports.ProCertValidity = /*#__PURE__*/(0, _react.forwardR
|
|
|
142
142
|
if (rangeTime.forever) {
|
|
143
143
|
_value = '长期';
|
|
144
144
|
} else {
|
|
145
|
-
_value = rangeTime.range ? (0,
|
|
145
|
+
_value = rangeTime.range ? (0, _dayjs.default)(rangeTime.range).format(defaultFormatDate) : null;
|
|
146
146
|
}
|
|
147
147
|
return (0, _jsxRuntime.jsx)(_antd.Input, {
|
|
148
148
|
value: _value,
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { DatePickerProps, RangePickerProps } from 'antd/es/date-picker';
|
|
2
|
-
import
|
|
2
|
+
import dayjs from 'dayjs';
|
|
3
3
|
interface ICertValidityValuePropsType {
|
|
4
|
-
dateTime?:
|
|
4
|
+
dateTime?: dayjs.Dayjs | string;
|
|
5
5
|
forever?: string;
|
|
6
6
|
}
|
|
7
7
|
interface ICertValidityRangeValuePropsType {
|
|
8
|
-
startTime?:
|
|
9
|
-
endTime?:
|
|
8
|
+
startTime?: dayjs.Dayjs | string;
|
|
9
|
+
endTime?: dayjs.Dayjs | string;
|
|
10
10
|
forever?: string;
|
|
11
11
|
}
|
|
12
12
|
interface IProCertValidityExtraPropsType {
|
|
@@ -361,9 +361,7 @@ var Render = function Render(props) {
|
|
|
361
361
|
};
|
|
362
362
|
}
|
|
363
363
|
// 需要过滤掉的form_item的key
|
|
364
|
-
var filterFormItemKey = ['onFieldChange',
|
|
365
|
-
// 'shouldUpdate',
|
|
366
|
-
'namePath', 'isView', 'parentNames', 'space', 'before', 'after'];
|
|
364
|
+
var filterFormItemKey = ['onFieldChange', 'shouldUpdate', 'namePath', 'isView', 'parentNames', 'space', 'before', 'after'];
|
|
367
365
|
if (type === 'FormList') {
|
|
368
366
|
lastComponentProps.disabled = lastDisabled;
|
|
369
367
|
var lessMode = lastComponentProps.mode === 'less';
|
|
@@ -387,31 +385,24 @@ var Render = function Render(props) {
|
|
|
387
385
|
span: 24 // 默认占一行
|
|
388
386
|
});
|
|
389
387
|
}
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
// return (
|
|
393
|
-
// <Form.Item shouldUpdate={_otherFormItemProps.shouldUpdate} noStyle>
|
|
394
|
-
// {() => {
|
|
395
|
-
// return (
|
|
396
|
-
// <Form.Item
|
|
397
|
-
// {...omit(_otherFormItemProps, filterFormItemKey)}
|
|
398
|
-
// // @ts-ignore
|
|
399
|
-
// _internalItemRender={internalItemRender}
|
|
400
|
-
// className={_className}
|
|
401
|
-
// >
|
|
402
|
-
// {child}
|
|
403
|
-
// </Form.Item>
|
|
404
|
-
// );
|
|
405
|
-
// }}
|
|
406
|
-
// </Form.Item>
|
|
407
|
-
// );
|
|
408
|
-
// }
|
|
409
|
-
var formItem = (0, _jsxRuntime.jsx)(_antd.Form.Item, (0, _objectSpread2.default)((0, _objectSpread2.default)({}, (0, _lodash.omit)(_otherFormItemProps, filterFormItemKey)), {}, {
|
|
388
|
+
|
|
389
|
+
var orgFormItem = (0, _jsxRuntime.jsx)(_antd.Form.Item, (0, _objectSpread2.default)((0, _objectSpread2.default)({}, (0, _lodash.omit)(_otherFormItemProps, filterFormItemKey)), {}, {
|
|
410
390
|
// @ts-ignore
|
|
411
391
|
_internalItemRender: internalItemRender,
|
|
412
392
|
className: _className,
|
|
413
393
|
children: child
|
|
414
394
|
}));
|
|
395
|
+
var formItem = orgFormItem;
|
|
396
|
+
// 当存在shouldUpdate时捕获所有form变更(防止表单onchange设置form值时无法更新的问题)
|
|
397
|
+
if (_otherFormItemProps.shouldUpdate) {
|
|
398
|
+
formItem = (0, _jsxRuntime.jsx)(_antd.Form.Item, {
|
|
399
|
+
shouldUpdate: _otherFormItemProps.shouldUpdate,
|
|
400
|
+
noStyle: true,
|
|
401
|
+
children: function children() {
|
|
402
|
+
return orgFormItem;
|
|
403
|
+
}
|
|
404
|
+
});
|
|
405
|
+
}
|
|
415
406
|
// 不渲染tooltip
|
|
416
407
|
if (!originalTip || ['FormList', 'ProEditTable'].includes(type)) {
|
|
417
408
|
return formItem;
|
|
@@ -74,8 +74,7 @@ var RenderFields = function RenderFields(props) {
|
|
|
74
74
|
formItemChildProps = _column$formItemChild === void 0 ? {} : _column$formItemChild,
|
|
75
75
|
_column$fieldProps = column.fieldProps,
|
|
76
76
|
fieldProps = _column$fieldProps === void 0 ? {} : _column$fieldProps,
|
|
77
|
-
|
|
78
|
-
disabled = _column$disabled === void 0 ? false : _column$disabled,
|
|
77
|
+
disabled = column.disabled,
|
|
79
78
|
equalWith = column.equalWith,
|
|
80
79
|
_column$clearNotShow = column.clearNotShow,
|
|
81
80
|
clearNotShow = _column$clearNotShow === void 0 ? outerClearNotShow : _column$clearNotShow,
|
|
@@ -138,17 +137,21 @@ var RenderFields = function RenderFields(props) {
|
|
|
138
137
|
dataSource: dataSource,
|
|
139
138
|
type: _type
|
|
140
139
|
});
|
|
141
|
-
var
|
|
140
|
+
var placeholderHandle = function placeholderHandle() {
|
|
141
|
+
var _label = (0, _lodash.isString)(label) ? label : '';
|
|
142
|
+
var _formLabel = (0, _lodash.isString)(formLabel) ? formLabel : '';
|
|
143
|
+
return placeholder || "".concat(_isSelect ? "".concat(_locale.default.ProForm.selectPlaceHolder) : "".concat(_locale.default.ProForm.inputPlaceholder)).concat(_label || _formLabel || '');
|
|
144
|
+
};
|
|
142
145
|
// 表单组件Props 兼容2.0版本
|
|
143
146
|
var _fieldProps = (0, _objectSpread2.default)((0, _objectSpread2.default)({}, formItemChildProps), fieldProps);
|
|
144
147
|
if ((0, _lodash.isBoolean)(formDisabled)) {
|
|
145
148
|
_fieldProps.disabled = formDisabled;
|
|
146
149
|
}
|
|
147
150
|
var componentProps = (0, _objectSpread2.default)((0, _objectSpread2.default)({
|
|
148
|
-
disabledStrictly: true
|
|
151
|
+
disabledStrictly: true,
|
|
152
|
+
placeholder: placeholderHandle()
|
|
149
153
|
}, _fieldProps), {}, {
|
|
150
|
-
disabled: _disabled
|
|
151
|
-
placeholder: _placeholder
|
|
154
|
+
disabled: _disabled
|
|
152
155
|
});
|
|
153
156
|
// switch与SwitchCheckbox单独添加valuePropName
|
|
154
157
|
if (['Switch', 'SwitchCheckbox'].includes(_type)) {
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
@root-entry-name: 'default';
|
|
2
|
+
@import (reference) '~antd/es/style/themes/index.less';
|
|
1
3
|
@import '../components/base/SwitchCheckbox/style/index.less';
|
|
2
4
|
@import '../components/base/TextArea/index.less';
|
|
3
5
|
@import '../components/combination/FormList/style/index.less';
|
|
@@ -11,8 +13,8 @@
|
|
|
11
13
|
@import '../components/old/EnumSelect/style/index.less';
|
|
12
14
|
|
|
13
15
|
.pro-form {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
+
&.@{ant-prefix}-form-vertical {
|
|
17
|
+
.@{ant-prefix}-form-item .@{ant-prefix}-form-item-label {
|
|
16
18
|
flex: none !important;
|
|
17
19
|
}
|
|
18
20
|
|
|
@@ -23,66 +25,66 @@
|
|
|
23
25
|
margin-bottom: 0;
|
|
24
26
|
padding-top: 6px;
|
|
25
27
|
|
|
26
|
-
|
|
28
|
+
.@{ant-prefix}-space-align-center {
|
|
27
29
|
align-items: normal;
|
|
28
30
|
}
|
|
29
31
|
}
|
|
30
32
|
}
|
|
31
33
|
|
|
32
|
-
|
|
34
|
+
&.@{ant-prefix}-form {
|
|
33
35
|
margin-bottom: calc(var(--zaui-space-size-md; 16px) * var(--zaui-size; 1));
|
|
34
36
|
}
|
|
35
37
|
|
|
36
38
|
.pro-collapse-level2 {
|
|
37
|
-
|
|
39
|
+
.@{ant-prefix}-collapse-item {
|
|
38
40
|
margin-bottom: 0 !important;
|
|
39
41
|
}
|
|
40
42
|
}
|
|
41
43
|
|
|
42
|
-
|
|
44
|
+
.@{ant-prefix}-form-item-control-input {
|
|
43
45
|
flex-grow: 1;
|
|
44
46
|
max-width: 100%;
|
|
45
47
|
}
|
|
46
48
|
|
|
47
|
-
span
|
|
49
|
+
span.@{ant-prefix}-input-clear-icon {
|
|
48
50
|
display: unset;
|
|
49
51
|
visibility: hidden;
|
|
50
52
|
}
|
|
51
53
|
|
|
52
|
-
|
|
54
|
+
.@{ant-prefix}-input-affix-wrapper:hover span.@{ant-prefix}-input-clear-icon {
|
|
53
55
|
display: unset;
|
|
54
56
|
visibility: unset;
|
|
55
57
|
}
|
|
56
58
|
|
|
57
|
-
|
|
59
|
+
.@{ant-prefix}-input-affix-wrapper:hover span.@{ant-prefix}-input-clear-icon[class~='ant-input-clear-icon-hidden'] {
|
|
58
60
|
display: unset;
|
|
59
61
|
visibility: hidden;
|
|
60
62
|
}
|
|
61
63
|
|
|
62
64
|
&.pro-form-view {
|
|
63
|
-
|
|
65
|
+
.@{ant-prefix}-form-item-label {
|
|
64
66
|
label {
|
|
65
67
|
color: var(--zaui-aide-text, #939599);
|
|
66
68
|
}
|
|
67
69
|
}
|
|
68
70
|
|
|
69
|
-
|
|
71
|
+
.@{ant-prefix}-form-item {
|
|
70
72
|
margin-bottom: 0 !important;
|
|
71
73
|
}
|
|
72
74
|
|
|
73
|
-
|
|
74
|
-
|
|
75
|
+
.@{ant-prefix}-form-item {
|
|
76
|
+
.@{ant-prefix}-tree-icon-hide input {
|
|
75
77
|
display: none !important;
|
|
76
78
|
}
|
|
77
79
|
}
|
|
78
80
|
}
|
|
79
81
|
|
|
80
|
-
|
|
82
|
+
.@{ant-prefix}-picker-range {
|
|
81
83
|
width: 100%;
|
|
82
84
|
}
|
|
83
85
|
|
|
84
86
|
.pro-form-list-line {
|
|
85
|
-
|
|
87
|
+
.@{ant-prefix}-row {
|
|
86
88
|
width: 100%;
|
|
87
89
|
}
|
|
88
90
|
}
|
|
@@ -101,20 +103,20 @@
|
|
|
101
103
|
}
|
|
102
104
|
}
|
|
103
105
|
|
|
104
|
-
|
|
106
|
+
.@{ant-prefix}-form-item {
|
|
105
107
|
margin-bottom: calc(var(--zaui-space-size-md; 16px) * var(--zaui-size; 1)) !important;
|
|
106
108
|
|
|
107
109
|
&.pro-form-item-width-auto {
|
|
108
|
-
|
|
110
|
+
.@{ant-prefix}-form-item-control-input {
|
|
109
111
|
flex-grow: inherit;
|
|
110
112
|
}
|
|
111
113
|
|
|
112
|
-
|
|
114
|
+
.@{ant-prefix}-form-item-control-input-content {
|
|
113
115
|
flex: initial;
|
|
114
116
|
}
|
|
115
117
|
}
|
|
116
118
|
|
|
117
|
-
|
|
119
|
+
.@{ant-prefix}-form-item-tooltip {
|
|
118
120
|
svg {
|
|
119
121
|
width: 14px;
|
|
120
122
|
height: 14px;
|
|
@@ -125,53 +127,53 @@
|
|
|
125
127
|
|
|
126
128
|
// 比较原始值场景下 不同时候的样式
|
|
127
129
|
&.pro-form-item-changed {
|
|
128
|
-
span
|
|
129
|
-
|
|
130
|
-
|
|
130
|
+
span.@{ant-prefix}-input-affix-wrapper,
|
|
131
|
+
.@{ant-prefix}-select-selector,
|
|
132
|
+
.@{ant-prefix}-picker {
|
|
131
133
|
background: @zaui-contract-bg !important;
|
|
132
134
|
|
|
133
135
|
input {
|
|
134
136
|
background: @zaui-contract-bg;
|
|
135
137
|
}
|
|
136
|
-
|
|
138
|
+
.@{ant-prefix}-select-selection-placeholder {
|
|
137
139
|
z-index: 9;
|
|
138
140
|
}
|
|
139
141
|
}
|
|
140
142
|
|
|
141
|
-
|
|
143
|
+
.@{ant-prefix}-form-item-control-input-content > span {
|
|
142
144
|
background: @zaui-contract-bg;
|
|
143
145
|
padding: 4px 8px;
|
|
144
146
|
border-radius: 4px;
|
|
145
147
|
}
|
|
146
148
|
}
|
|
147
149
|
|
|
148
|
-
|
|
150
|
+
.@{ant-prefix}-row {
|
|
149
151
|
width: 100%;
|
|
150
152
|
}
|
|
151
153
|
|
|
152
|
-
|
|
154
|
+
.@{ant-prefix}-col.@{ant-prefix}-col-0 {
|
|
153
155
|
display: none;
|
|
154
156
|
}
|
|
155
157
|
|
|
156
|
-
|
|
158
|
+
.@{ant-prefix}-form-item-explain {
|
|
157
159
|
height: auto;
|
|
158
160
|
|
|
159
|
-
|
|
161
|
+
.@{ant-prefix}-form-item-explain-error {
|
|
160
162
|
font-size: var(--zaui-font-size, 14px);
|
|
161
163
|
}
|
|
162
164
|
}
|
|
163
165
|
|
|
164
|
-
|
|
166
|
+
.@{ant-prefix}-input-number {
|
|
165
167
|
width: 100%;
|
|
166
168
|
}
|
|
167
169
|
|
|
168
170
|
.pro-number-range {
|
|
169
|
-
|
|
171
|
+
.@{ant-prefix}-input-number {
|
|
170
172
|
width: calc(50% - 20px);
|
|
171
173
|
}
|
|
172
174
|
|
|
173
175
|
.range-right {
|
|
174
|
-
|
|
176
|
+
.@{ant-prefix}-input-number {
|
|
175
177
|
border-left: none;
|
|
176
178
|
}
|
|
177
179
|
|
|
@@ -185,11 +187,11 @@
|
|
|
185
187
|
}
|
|
186
188
|
}
|
|
187
189
|
|
|
188
|
-
|
|
190
|
+
.@{ant-prefix}-form-item-hidden {
|
|
189
191
|
display: none;
|
|
190
192
|
}
|
|
191
193
|
|
|
192
|
-
|
|
194
|
+
.@{ant-prefix}-form-item-label {
|
|
193
195
|
> label {
|
|
194
196
|
white-space: pre-wrap;
|
|
195
197
|
}
|
|
@@ -199,7 +201,7 @@
|
|
|
199
201
|
margin-left: @zaui-space-size-sm;
|
|
200
202
|
}
|
|
201
203
|
|
|
202
|
-
|
|
204
|
+
.@{ant-prefix}-form-item-has-error {
|
|
203
205
|
.group-separator {
|
|
204
206
|
color: var(--ant-error-color);
|
|
205
207
|
border-color: var(--ant-error-color);
|
|
@@ -229,16 +231,16 @@
|
|
|
229
231
|
border-left-width: 1px;
|
|
230
232
|
}
|
|
231
233
|
|
|
232
|
-
&
|
|
234
|
+
& .@{ant-prefix}-input-rtl.site-input-right {
|
|
233
235
|
border-right-width: 0;
|
|
234
236
|
}
|
|
235
237
|
|
|
236
|
-
&
|
|
237
|
-
&
|
|
238
|
+
& .@{ant-prefix}-input-rtl.site-input-right:hover,
|
|
239
|
+
& .@{ant-prefix}-input-rtl.site-input-right:focus {
|
|
238
240
|
border-right-width: 1px;
|
|
239
241
|
}
|
|
240
242
|
|
|
241
|
-
|
|
243
|
+
.@{ant-prefix}-form-item {
|
|
242
244
|
margin-bottom: 0;
|
|
243
245
|
}
|
|
244
246
|
|
|
@@ -248,18 +250,18 @@
|
|
|
248
250
|
}
|
|
249
251
|
|
|
250
252
|
.site-input-left {
|
|
251
|
-
|
|
253
|
+
.@{ant-prefix}-input-number {
|
|
252
254
|
border-right: none;
|
|
253
255
|
}
|
|
254
256
|
}
|
|
255
257
|
|
|
256
258
|
.site-input-right {
|
|
257
|
-
|
|
259
|
+
.@{ant-prefix}-input-number {
|
|
258
260
|
border-left: none;
|
|
259
261
|
}
|
|
260
262
|
}
|
|
261
263
|
|
|
262
|
-
|
|
264
|
+
&.@{ant-prefix}-input-group.@{ant-prefix}-input-group-compact > *:not(:last-child) {
|
|
263
265
|
margin-right: 0;
|
|
264
266
|
}
|
|
265
267
|
|
|
@@ -267,7 +269,7 @@
|
|
|
267
269
|
border-top-right-radius: 0 !important;
|
|
268
270
|
border-bottom-right-radius: 0 !important;
|
|
269
271
|
|
|
270
|
-
>
|
|
272
|
+
> .@{ant-prefix}-select-selector {
|
|
271
273
|
border-top-right-radius: 0 !important;
|
|
272
274
|
border-bottom-right-radius: 0 !important;
|
|
273
275
|
}
|
|
@@ -277,14 +279,14 @@
|
|
|
277
279
|
border-top-left-radius: 0 !important;
|
|
278
280
|
border-bottom-left-radius: 0 !important;
|
|
279
281
|
|
|
280
|
-
>
|
|
282
|
+
> .@{ant-prefix}-select-selector {
|
|
281
283
|
border-top-left-radius: 0 !important;
|
|
282
284
|
border-bottom-left-radius: 0 !important;
|
|
283
285
|
}
|
|
284
286
|
}
|
|
285
287
|
}
|
|
286
288
|
|
|
287
|
-
|
|
289
|
+
.@{ant-prefix}-input-group.@{ant-prefix}-input-group-compact > * {
|
|
288
290
|
float: none;
|
|
289
291
|
vertical-align: top;
|
|
290
292
|
}
|
|
@@ -7,11 +7,12 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
exports.rulesCreator = void 0;
|
|
8
8
|
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
|
|
9
9
|
var _utils = require("@zat-design/utils");
|
|
10
|
+
var _lodash = require("lodash");
|
|
10
11
|
var _index = require("./index");
|
|
11
12
|
var _locale = _interopRequireDefault(require("../../locale"));
|
|
12
13
|
var rulesCreator = exports.rulesCreator = function rulesCreator(rules, label, isSelect) {
|
|
13
14
|
var _result;
|
|
14
|
-
var message = "".concat(isSelect ? "".concat(_locale.default.ProForm.selectPlaceHolder) : "".concat(_locale.default.ProForm.inputPlaceholder)).concat(_locale.default.ProForm.ruleText).concat(label
|
|
15
|
+
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 : '');
|
|
15
16
|
var result = [];
|
|
16
17
|
result = rules.map(function (ruleItem) {
|
|
17
18
|
var rule = (0, _objectSpread2.default)({}, ruleItem);
|
|
@@ -19,6 +19,7 @@ var useRules = function useRules(props) {
|
|
|
19
19
|
names = props.names,
|
|
20
20
|
labelRequired = props.labelRequired,
|
|
21
21
|
type = props.type;
|
|
22
|
+
var _label = (0, _lodash.isString)(label) ? label : '';
|
|
22
23
|
// 根据 required 添加 rules, names 字段会添加数组的必填校验
|
|
23
24
|
var internalRule = (0, _react.useMemo)(function () {
|
|
24
25
|
var result = {
|
|
@@ -29,7 +30,7 @@ var useRules = function useRules(props) {
|
|
|
29
30
|
return 'required' in rule;
|
|
30
31
|
}));
|
|
31
32
|
if (!requiredRule) {
|
|
32
|
-
var message = isSelect ? "".concat(_locale.default.ProForm.selectPlaceHolder).concat(
|
|
33
|
+
var message = isSelect ? "".concat(_locale.default.ProForm.selectPlaceHolder).concat(_label) : "".concat(_locale.default.ProForm.inputPlaceholder).concat(_label);
|
|
33
34
|
var rule = {
|
|
34
35
|
required: required,
|
|
35
36
|
message: message
|
|
@@ -38,7 +39,7 @@ var useRules = function useRules(props) {
|
|
|
38
39
|
if (names === null || names === void 0 ? void 0 : names.length) {
|
|
39
40
|
rule.validator = function (_, value) {
|
|
40
41
|
if (!value || (0, _index.isNullArray)(value)) {
|
|
41
|
-
return Promise.reject(new Error("".concat(_locale.default.ProForm.inputPlaceholder).concat(
|
|
42
|
+
return Promise.reject(new Error("".concat(_locale.default.ProForm.inputPlaceholder).concat(_label)));
|
|
42
43
|
}
|
|
43
44
|
return Promise.resolve();
|
|
44
45
|
};
|
|
@@ -49,7 +50,7 @@ var useRules = function useRules(props) {
|
|
|
49
50
|
return result;
|
|
50
51
|
}, [rules, required]);
|
|
51
52
|
// type转换为内置rules
|
|
52
|
-
internalRule.rules = internalRule.rules && (0, _rulesCreator.rulesCreator)(internalRule.rules,
|
|
53
|
+
internalRule.rules = internalRule.rules && (0, _rulesCreator.rulesCreator)(internalRule.rules, _label, isSelect);
|
|
53
54
|
(0, _react.useEffect)(function () {
|
|
54
55
|
// 添加完整性校验
|
|
55
56
|
if (names && !(0, _lodash.isBoolean)(labelRequired) || type === 'Group' && Array.isArray(names) && required) {
|
|
@@ -57,7 +58,7 @@ var useRules = function useRules(props) {
|
|
|
57
58
|
validator: function validator(rules, value) {
|
|
58
59
|
// 完整性校验, 空数组不校验, 数组有值且值不完整则校验不通过
|
|
59
60
|
if (Array.isArray(value) && !(0, _index.isNullArray)(value) && (0, _index.isNotFullArray)(value, names.length)) {
|
|
60
|
-
return Promise.reject(new Error("".concat(_locale.default.ProForm.completeText).concat(
|
|
61
|
+
return Promise.reject(new Error("".concat(_locale.default.ProForm.completeText).concat(_label)));
|
|
61
62
|
}
|
|
62
63
|
return Promise.resolve();
|
|
63
64
|
}
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
@root-entry-name: 'default';
|
|
2
|
+
@import (reference) '~antd/es/style/themes/index.less';
|
|
3
|
+
|
|
1
4
|
.pro-icon {
|
|
2
5
|
cursor: pointer;
|
|
3
6
|
|
|
@@ -17,7 +20,7 @@
|
|
|
17
20
|
display: inline-block;
|
|
18
21
|
}
|
|
19
22
|
|
|
20
|
-
|
|
23
|
+
&.@{ant-prefix}-btn-icon-only {
|
|
21
24
|
width : auto;
|
|
22
25
|
height : auto;
|
|
23
26
|
padding: 0;
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
@root-entry-name: 'default';
|
|
2
|
+
@import (reference) '~antd/es/style/themes/index.less';
|
|
3
|
+
|
|
1
4
|
.pro-layout-menu-fold-list {
|
|
2
5
|
padding-top: 4px;
|
|
3
6
|
overflow-y : auto;
|
|
@@ -73,28 +76,28 @@
|
|
|
73
76
|
top: 80px !important
|
|
74
77
|
}
|
|
75
78
|
|
|
76
|
-
.pro-layout-menu-tooltip.pro-layout-menu-tooltip-nav-open
|
|
77
|
-
.pro-layout-menu-tooltip.pro-layout-menu-tooltip-nav-open
|
|
79
|
+
.pro-layout-menu-tooltip.pro-layout-menu-tooltip-nav-open.@{ant-prefix}-popover-placement-rightBottom,
|
|
80
|
+
.pro-layout-menu-tooltip.pro-layout-menu-tooltip-nav-open.@{ant-prefix}-popover-placement-rightTop {
|
|
78
81
|
left: 220px !important
|
|
79
82
|
}
|
|
80
83
|
|
|
81
|
-
.pro-layout-menu-tooltip
|
|
82
|
-
.pro-layout-menu-tooltip
|
|
84
|
+
.pro-layout-menu-tooltip.@{ant-prefix}-popover-placement-rightBottom,
|
|
85
|
+
.pro-layout-menu-tooltip.@{ant-prefix}-popover-placement-rightTop {
|
|
83
86
|
position : fixed;
|
|
84
87
|
z-index : 1001;
|
|
85
88
|
left : 49px !important;
|
|
86
89
|
padding-left: 0
|
|
87
90
|
}
|
|
88
91
|
|
|
89
|
-
.pro-layout-menu-tooltip
|
|
92
|
+
.pro-layout-menu-tooltip .@{ant-prefix}-popover-inner-content {
|
|
90
93
|
padding: 0
|
|
91
94
|
}
|
|
92
95
|
|
|
93
|
-
.pro-layout-menu-tooltip
|
|
96
|
+
.pro-layout-menu-tooltip .@{ant-prefix}-popover-content>.@{ant-prefix}-popover-arrow {
|
|
94
97
|
display: none
|
|
95
98
|
}
|
|
96
99
|
|
|
97
|
-
.pro-layout-menu-tooltip
|
|
100
|
+
.pro-layout-menu-tooltip .@{ant-prefix}-popover-content .@{ant-prefix}-popover-inner {
|
|
98
101
|
padding : 0;
|
|
99
102
|
box-shadow: 2px 0px 5px 0px rgba(0, 55, 93, 0.1);
|
|
100
103
|
}
|