@zat-design/sisyphus-react 3.1.5 → 3.2.0-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.esm.css +176 -251
- package/es/ProAction/index.js +7 -5
- package/es/ProAction/index.less +3 -2
- package/es/ProConfigProvider/index.d.ts +2 -0
- package/es/ProConfigProvider/index.js +23 -2
- package/es/ProDownload/utils.js +6 -3
- package/es/ProDrawerForm/components/ProDrawer/index.js +6 -4
- package/es/ProDrawerForm/index.js +5 -3
- package/es/ProDrawerForm/style/index.less +15 -11
- package/es/ProEditLabel/style/index.less +2 -2
- package/es/ProEditTable/components/ActionButton/index.js +3 -2
- package/es/ProEditTable/components/RenderField/index.js +2 -1
- package/es/ProEditTable/index.js +7 -6
- package/es/ProEditTable/style/index.less +15 -8
- package/es/ProEditTable/utils/config.d.ts +8 -8
- package/es/ProEditTable/utils/config.js +20 -12
- package/es/ProEditTable/utils/index.js +3 -2
- package/es/ProEnum/hooks/useEnumRequest.js +17 -10
- package/es/ProEnum/index.js +9 -4
- package/es/ProEnum/style/index.less +1 -1
- package/es/ProForm/components/FormFooter/index.js +16 -20
- package/es/ProForm/components/base/Input/index.js +4 -3
- package/es/ProForm/components/base/InputNumber/index.js +4 -3
- package/es/ProForm/components/base/RangePicker/index.js +0 -3
- package/es/ProForm/components/base/Select/index.js +2 -1
- package/es/ProForm/components/base/Switch/index.js +9 -5
- package/es/ProForm/components/base/SwitchCheckbox/index.js +2 -1
- package/es/ProForm/components/base/TextArea/index.js +4 -2
- package/es/ProForm/components/base/TextArea/index.less +1 -1
- package/es/ProForm/components/combination/Container/style/index.less +0 -1
- package/es/ProForm/components/combination/FormList/components/ActionButton.js +13 -17
- package/es/ProForm/components/combination/FormList/components/ToolbarButton.js +2 -1
- package/es/ProForm/components/combination/FormList/style/index.less +20 -19
- package/es/ProForm/components/combination/Group/index.js +2 -2
- package/es/ProForm/components/combination/ProAddressBar/index.js +83 -63
- package/es/ProForm/components/combination/ProAddressBar/propsType.d.ts +3 -2
- package/es/ProForm/components/combination/ProModalSelect/index.js +76 -15
- package/es/ProForm/components/combination/ProModalSelect/propsType.d.ts +1 -0
- package/es/ProForm/components/combination/ProModalSelect/style/index.less +3 -3
- package/es/ProForm/components/combination/ProNumberRange/index.js +3 -2
- package/es/ProForm/components/combination/ProNumberRange/style/index.less +1 -1
- package/es/ProForm/components/combination/ProRangeLimit/index.d.ts +1 -1
- package/es/ProForm/components/combination/ProRangeLimit/index.js +3 -7
- package/es/ProForm/components/combination/ProTimeLimit/index.d.ts +10 -5
- package/es/ProForm/components/combination/ProTimeLimit/index.js +4 -11
- package/es/ProForm/components/combination/ProTimeLimit/style/index.less +18 -1
- package/es/ProForm/components/old/EnumSelect/style/index.less +7 -8
- package/es/ProForm/components/render/Render.js +4 -2
- package/es/ProForm/components/render/RenderFields.js +10 -6
- package/es/ProForm/components/render/propsType.d.ts +5 -4
- package/es/ProForm/index.js +14 -2
- package/es/ProForm/style/index.less +77 -169
- package/es/ProForm/utils/index.d.ts +1 -1
- package/es/ProForm/utils/index.js +7 -2
- package/es/ProForm/utils/rulesCreator.js +2 -1
- package/es/ProForm/utils/useRules.js +4 -3
- package/es/ProForm/utils/useShouldUpdate.js +16 -16
- package/es/ProLayout/components/Layout/Menu/OpenMenu/index.js +6 -0
- package/es/ProLayout/components/Layout/Menu/OpenMenu/style/index.less +7 -8
- package/es/ProLayout/components/Layout/Notice/index.js +3 -2
- package/es/ProLayout/components/ProCollapse/style/index.less +4 -4
- package/es/ProLayout/components/ProHeader/components/Copy/index.js +2 -1
- package/es/{old → ProLayout/components/ProHeader/components}/ProBackBtn/index.js +2 -1
- package/es/ProLayout/components/ProHeader/components/ProBackBtn/style/index.less +21 -0
- package/es/ProLayout/components/ProHeader/components/index.d.ts +1 -0
- package/es/ProLayout/components/ProHeader/components/index.js +2 -1
- package/es/ProLayout/components/ProHeader/index.js +9 -6
- package/es/ProLayout/components/ProHeader/style/index.less +16 -7
- package/es/ProLayout/utils/index.js +1 -1
- package/es/ProSelect/index.d.ts +3 -3
- package/es/ProSelect/index.js +4 -2
- package/es/ProStep/components/Step/index.js +3 -1
- package/es/ProStep/style/index.less +0 -1
- package/es/ProTable/components/RenderColumn/index.d.ts +5 -5
- package/es/ProTable/components/RenderColumn/index.js +41 -25
- package/es/ProTable/index.js +10 -8
- package/es/ProTable/propsType.d.ts +2 -0
- package/es/ProTable/style/index.less +14 -1
- package/es/ProTable/useAntdTable.d.ts +12 -4
- package/es/ProTable/useAntdTable.js +18 -6
- package/es/ProTable/utils.d.ts +1 -1
- package/es/ProTable/utils.js +258 -201
- package/es/ProTabs/style/index.less +1 -1
- package/es/ProThemeTools/component/PrdTools/index.js +1 -1
- package/es/ProThemeTools/component/PrdTools/style/index.less +3 -3
- package/es/ProThemeTools/index.d.ts +2 -2
- package/es/ProThemeTools/index.js +24 -17
- package/es/ProThemeTools/propsType.d.ts +8 -6
- package/es/ProThemeTools/style/index.less +2 -2
- package/es/ProThemeTools/utils/index.d.ts +7 -0
- package/es/ProThemeTools/utils/index.js +19 -1
- package/es/ProTree/components/ProTree.js +6 -5
- package/es/ProTree/components/SearchTitle.d.ts +2 -2
- package/es/ProTree/components/SearchTitle.js +11 -1
- package/es/ProTree/components/Tree.js +9 -2
- package/es/ProTree/style/index.less +193 -141
- package/es/ProTreeModal/components/List.js +0 -14
- package/es/ProTreeModal/components/Trigger.js +9 -3
- package/es/ProTreeModal/index.js +29 -13
- package/es/ProTreeModal/style/index.less +2 -6
- package/es/ProUpload/components/ButtonRender.js +5 -2
- package/es/ProUpload/components/DragRender.js +8 -8
- package/es/ProUpload/components/Example.js +3 -1
- package/es/ProUpload/components/ImageRender.js +8 -6
- package/es/ProUpload/index.js +8 -6
- package/es/ProUpload/style/index.less +41 -39
- package/es/index.d.ts +2 -1
- package/es/index.js +2 -1
- package/es/locale/en_US.d.ts +138 -0
- package/es/locale/en_US.js +137 -0
- package/es/locale/index.d.ts +13 -0
- package/es/locale/index.js +32 -0
- package/es/locale/zh_CN.d.ts +137 -0
- package/es/locale/zh_CN.js +136 -0
- package/es/old/ProEditableTable/style/index.less +1 -2
- package/es/style/components.less +0 -1
- package/es/style/core/normalize.less +1 -2
- package/es/style/theme/antd.less +3 -4
- package/es/style/theme/index.less +80 -79
- package/es/style/theme/tokens.less +1 -0
- package/lib/ProAction/index.js +7 -5
- package/lib/ProAction/index.less +3 -2
- package/lib/ProConfigProvider/index.d.ts +2 -0
- package/lib/ProConfigProvider/index.js +22 -2
- package/lib/ProDownload/utils.js +4 -3
- package/lib/ProDrawerForm/components/ProDrawer/index.js +6 -4
- package/lib/ProDrawerForm/index.js +5 -3
- package/lib/ProDrawerForm/style/index.less +15 -11
- package/lib/ProEditLabel/style/index.less +2 -2
- package/lib/ProEditTable/components/ActionButton/index.js +3 -2
- package/lib/ProEditTable/components/RenderField/index.js +4 -1
- package/lib/ProEditTable/index.js +7 -6
- package/lib/ProEditTable/style/index.less +15 -8
- package/lib/ProEditTable/utils/config.d.ts +8 -8
- package/lib/ProEditTable/utils/config.js +20 -12
- package/lib/ProEditTable/utils/index.js +3 -2
- package/lib/ProEnum/hooks/useEnumRequest.js +17 -10
- package/lib/ProEnum/index.js +9 -4
- package/lib/ProEnum/style/index.less +1 -1
- package/lib/ProForm/components/FormFooter/index.js +16 -19
- package/lib/ProForm/components/base/Input/index.js +4 -3
- package/lib/ProForm/components/base/InputNumber/index.js +4 -3
- package/lib/ProForm/components/base/RangePicker/index.js +1 -4
- package/lib/ProForm/components/base/Select/index.js +2 -1
- package/lib/ProForm/components/base/Switch/index.js +8 -5
- package/lib/ProForm/components/base/SwitchCheckbox/index.js +2 -1
- package/lib/ProForm/components/base/TextArea/index.js +4 -2
- package/lib/ProForm/components/base/TextArea/index.less +1 -1
- package/lib/ProForm/components/combination/Container/style/index.less +0 -1
- package/lib/ProForm/components/combination/FormList/components/ActionButton.js +13 -17
- package/lib/ProForm/components/combination/FormList/components/ToolbarButton.js +2 -1
- package/lib/ProForm/components/combination/FormList/style/index.less +20 -19
- package/lib/ProForm/components/combination/Group/index.js +2 -2
- package/lib/ProForm/components/combination/ProAddressBar/index.js +78 -60
- package/lib/ProForm/components/combination/ProAddressBar/propsType.d.ts +3 -2
- package/lib/ProForm/components/combination/ProModalSelect/index.js +76 -15
- package/lib/ProForm/components/combination/ProModalSelect/propsType.d.ts +1 -0
- package/lib/ProForm/components/combination/ProModalSelect/style/index.less +3 -3
- package/lib/ProForm/components/combination/ProNumberRange/index.js +3 -2
- package/lib/ProForm/components/combination/ProNumberRange/style/index.less +1 -1
- package/lib/ProForm/components/combination/ProRangeLimit/index.d.ts +1 -1
- package/lib/ProForm/components/combination/ProRangeLimit/index.js +3 -7
- package/lib/ProForm/components/combination/ProTimeLimit/index.d.ts +10 -5
- package/lib/ProForm/components/combination/ProTimeLimit/index.js +4 -11
- package/lib/ProForm/components/combination/ProTimeLimit/style/index.less +18 -1
- package/lib/ProForm/components/old/EnumSelect/style/index.less +7 -8
- package/lib/ProForm/components/old/InputRange/index.js +0 -1
- package/lib/ProForm/components/old/ProCertValidity/index.js +1 -1
- package/lib/ProForm/components/render/Render.js +5 -2
- package/lib/ProForm/components/render/RenderFields.js +9 -5
- package/lib/ProForm/components/render/propsType.d.ts +5 -4
- package/lib/ProForm/index.js +14 -2
- package/lib/ProForm/style/index.less +77 -169
- package/lib/ProForm/utils/index.d.ts +1 -1
- package/lib/ProForm/utils/index.js +7 -2
- package/lib/ProForm/utils/rulesCreator.js +2 -1
- package/lib/ProForm/utils/useRules.js +4 -3
- package/lib/ProForm/utils/useShouldUpdate.js +16 -16
- package/lib/ProLayout/components/Layout/Menu/OpenMenu/index.js +6 -0
- package/lib/ProLayout/components/Layout/Menu/OpenMenu/style/index.less +7 -8
- package/lib/ProLayout/components/Layout/Notice/index.js +3 -2
- package/lib/ProLayout/components/ProCollapse/style/index.less +4 -4
- package/lib/ProLayout/components/ProHeader/components/Copy/index.js +2 -1
- package/lib/{old → ProLayout/components/ProHeader/components}/ProBackBtn/index.js +3 -1
- package/lib/ProLayout/components/ProHeader/components/ProBackBtn/style/index.less +21 -0
- package/lib/ProLayout/components/ProHeader/components/index.d.ts +1 -0
- package/lib/ProLayout/components/ProHeader/components/index.js +8 -1
- package/lib/ProLayout/components/ProHeader/index.js +9 -6
- package/lib/ProLayout/components/ProHeader/style/index.less +16 -7
- package/lib/ProLayout/utils/index.js +1 -1
- package/lib/ProSelect/index.d.ts +3 -3
- package/lib/ProSelect/index.js +4 -2
- package/lib/ProStep/components/Step/index.js +3 -1
- package/lib/ProStep/style/index.less +0 -1
- package/lib/ProTable/components/RenderColumn/index.d.ts +5 -5
- package/lib/ProTable/components/RenderColumn/index.js +38 -24
- package/lib/ProTable/components/TableResizable/index.js +8 -0
- package/lib/ProTable/index.js +10 -8
- package/lib/ProTable/propsType.d.ts +2 -0
- package/lib/ProTable/style/index.less +14 -1
- package/lib/ProTable/useAntdTable.d.ts +12 -4
- package/lib/ProTable/useAntdTable.js +19 -6
- package/lib/ProTable/utils.d.ts +1 -1
- package/lib/ProTable/utils.js +258 -201
- package/lib/ProTabs/index.js +1 -0
- package/lib/ProTabs/style/index.less +1 -1
- package/lib/ProThemeTools/component/PrdTools/index.js +1 -1
- package/lib/ProThemeTools/component/PrdTools/style/index.less +3 -3
- package/lib/ProThemeTools/index.d.ts +2 -2
- package/lib/ProThemeTools/index.js +24 -16
- package/lib/ProThemeTools/propsType.d.ts +8 -6
- package/lib/ProThemeTools/style/index.less +2 -2
- package/lib/ProThemeTools/utils/index.d.ts +7 -0
- package/lib/ProThemeTools/utils/index.js +20 -2
- package/lib/ProTree/components/ProTree.js +6 -5
- package/lib/ProTree/components/SearchTitle.d.ts +2 -2
- package/lib/ProTree/components/SearchTitle.js +11 -1
- package/lib/ProTree/components/Tree.js +16 -2
- package/lib/ProTree/index.js +0 -1
- package/lib/ProTree/style/index.less +193 -141
- package/lib/ProTreeModal/components/List.js +0 -14
- package/lib/ProTreeModal/components/Tree.js +1 -0
- package/lib/ProTreeModal/components/Trigger.js +10 -3
- package/lib/ProTreeModal/index.js +29 -13
- package/lib/ProTreeModal/style/index.less +2 -6
- package/lib/ProUpload/components/ButtonRender.js +5 -2
- package/lib/ProUpload/components/DragRender.js +8 -8
- package/lib/ProUpload/components/Example.js +3 -1
- package/lib/ProUpload/components/ImageRender.js +8 -6
- package/lib/ProUpload/index.js +14 -5
- package/lib/ProUpload/style/index.less +41 -39
- package/lib/index.d.ts +2 -1
- package/lib/index.js +13 -1
- package/lib/locale/en_US.d.ts +138 -0
- package/lib/locale/en_US.js +143 -0
- package/lib/locale/index.d.ts +13 -0
- package/lib/locale/index.js +41 -0
- package/lib/locale/zh_CN.d.ts +137 -0
- package/lib/locale/zh_CN.js +142 -0
- package/lib/old/ProCertValidity/index.js +1 -1
- package/lib/old/ProEditableTable/style/index.less +1 -2
- package/lib/style/components.less +0 -1
- package/lib/style/core/normalize.less +1 -2
- package/lib/style/theme/antd.less +3 -4
- package/lib/style/theme/index.less +80 -79
- package/lib/style/theme/tokens.less +1 -0
- package/package.json +1 -1
- package/typings.d.ts +2 -0
- package/es/old/ProBackBtn/style/index.less +0 -19
- package/lib/old/ProBackBtn/style/index.less +0 -19
- /package/es/{old → ProLayout/components/ProHeader/components}/ProBackBtn/index.d.ts +0 -0
- /package/es/{old → ProLayout/components/ProHeader/components}/ProBackBtn/propsType.d.ts +0 -0
- /package/es/{old → ProLayout/components/ProHeader/components}/ProBackBtn/propsType.js +0 -0
- /package/lib/{old → ProLayout/components/ProHeader/components}/ProBackBtn/index.d.ts +0 -0
- /package/lib/{old → ProLayout/components/ProHeader/components}/ProBackBtn/propsType.d.ts +0 -0
- /package/lib/{old → ProLayout/components/ProHeader/components}/ProBackBtn/propsType.js +0 -0
|
@@ -56,7 +56,7 @@
|
|
|
56
56
|
text-indent : 5px;
|
|
57
57
|
}
|
|
58
58
|
}
|
|
59
|
-
|
|
59
|
+
|
|
60
60
|
.drag-wrapper {
|
|
61
61
|
display: flex;
|
|
62
62
|
.drag-icon {
|
|
@@ -110,12 +110,12 @@
|
|
|
110
110
|
line-height: 1;
|
|
111
111
|
content : "*";
|
|
112
112
|
}
|
|
113
|
-
|
|
113
|
+
|
|
114
114
|
&.is-required-left {
|
|
115
115
|
&::after {
|
|
116
116
|
display: none;
|
|
117
117
|
}
|
|
118
|
-
|
|
118
|
+
|
|
119
119
|
&::before {
|
|
120
120
|
position : static;
|
|
121
121
|
top : 0;
|
|
@@ -140,6 +140,13 @@
|
|
|
140
140
|
.ant-table-cell-fix-left,
|
|
141
141
|
.ant-table-cell-fix-right {
|
|
142
142
|
background-color: var(--zaui-table-header-bg, #f2f3f5);
|
|
143
|
+
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
.ant-table-cell-fix-right-first {
|
|
148
|
+
&::after {
|
|
149
|
+
box-shadow: inset -10px 0 8px -8px rgba(0, 0, 0, 0.15);
|
|
143
150
|
}
|
|
144
151
|
}
|
|
145
152
|
|
|
@@ -175,12 +182,12 @@
|
|
|
175
182
|
line-height: 1;
|
|
176
183
|
content : "*";
|
|
177
184
|
}
|
|
178
|
-
|
|
185
|
+
|
|
179
186
|
&.is-required-left {
|
|
180
187
|
&::after {
|
|
181
188
|
display: none;
|
|
182
189
|
}
|
|
183
|
-
|
|
190
|
+
|
|
184
191
|
&::before {
|
|
185
192
|
position : static;
|
|
186
193
|
top : 0;
|
|
@@ -282,7 +289,7 @@
|
|
|
282
289
|
}
|
|
283
290
|
|
|
284
291
|
.pro-edit-table-header {
|
|
285
|
-
margin-bottom: var(--zaui-space-size-md
|
|
292
|
+
margin-bottom: calc(var(--zaui-space-size-md; 16px) * var(--zaui-size; 1));
|
|
286
293
|
}
|
|
287
294
|
|
|
288
295
|
.pro-edit-table-toolbar-fixed {
|
|
@@ -300,11 +307,11 @@
|
|
|
300
307
|
display: flex;
|
|
301
308
|
align-items: center;
|
|
302
309
|
padding: 0 var(--zaui-space-size-xs, 4px);
|
|
303
|
-
|
|
310
|
+
|
|
304
311
|
&:first-child {
|
|
305
312
|
padding-left: 0;
|
|
306
313
|
}
|
|
307
|
-
|
|
314
|
+
|
|
308
315
|
span:nth-child(2) {
|
|
309
316
|
margin-left: var(--zaui-space-size-xs, 4px);
|
|
310
317
|
}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
export declare const defaultBtnNameMap: {
|
|
2
|
-
add:
|
|
3
|
-
edit:
|
|
4
|
-
copy:
|
|
5
|
-
delete:
|
|
6
|
-
mulDelete:
|
|
7
|
-
save:
|
|
8
|
-
cancel:
|
|
9
|
-
custom:
|
|
2
|
+
add: any;
|
|
3
|
+
edit: any;
|
|
4
|
+
copy: any;
|
|
5
|
+
delete: any;
|
|
6
|
+
mulDelete: any;
|
|
7
|
+
save: any;
|
|
8
|
+
cancel: any;
|
|
9
|
+
custom: any;
|
|
10
10
|
};
|
|
11
11
|
export declare const iconMap: {
|
|
12
12
|
add: JSX.Element;
|
|
@@ -13,16 +13,18 @@ var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers
|
|
|
13
13
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
14
14
|
var _icons = require("@ant-design/icons");
|
|
15
15
|
var _antd = require("antd");
|
|
16
|
+
var _lodash = require("lodash");
|
|
16
17
|
var _tools = require("./tools");
|
|
18
|
+
var _locale = _interopRequireDefault(require("../../locale"));
|
|
17
19
|
var defaultBtnNameMap = exports.defaultBtnNameMap = {
|
|
18
|
-
add:
|
|
19
|
-
edit:
|
|
20
|
-
copy:
|
|
21
|
-
delete:
|
|
22
|
-
mulDelete:
|
|
23
|
-
save:
|
|
24
|
-
cancel:
|
|
25
|
-
custom:
|
|
20
|
+
add: _locale.default.ProEditTable.add,
|
|
21
|
+
edit: _locale.default.ProEditTable.edit,
|
|
22
|
+
copy: _locale.default.ProEditTable.copy,
|
|
23
|
+
delete: _locale.default.ProEditTable.delete,
|
|
24
|
+
mulDelete: _locale.default.ProEditTable.mulDelete,
|
|
25
|
+
save: _locale.default.ProEditTable.save,
|
|
26
|
+
cancel: _locale.default.ProEditTable.cancel,
|
|
27
|
+
custom: _locale.default.ProEditTable.custom
|
|
26
28
|
};
|
|
27
29
|
// 默认按钮配置
|
|
28
30
|
var iconMap = exports.iconMap = {
|
|
@@ -68,7 +70,7 @@ var actions = exports.actions = {
|
|
|
68
70
|
},
|
|
69
71
|
save: function () {
|
|
70
72
|
var _save = (0, _asyncToGenerator2.default)( /*#__PURE__*/(0, _regeneratorRuntime2.default)().mark(function _callee(_ref2) {
|
|
71
|
-
var record, editingKeys, setState, form, rowName, virtualRowName, result, updateData, nextEditingKeys;
|
|
73
|
+
var record, editingKeys, setState, form, rowName, virtualRowName, result, updateData, nextEditingKeys, values;
|
|
72
74
|
return (0, _regeneratorRuntime2.default)().wrap(function _callee$(_context) {
|
|
73
75
|
while (1) switch (_context.prev = _context.next) {
|
|
74
76
|
case 0:
|
|
@@ -86,11 +88,14 @@ var actions = exports.actions = {
|
|
|
86
88
|
} else {
|
|
87
89
|
delete record.isEditing;
|
|
88
90
|
}
|
|
89
|
-
|
|
91
|
+
// 防止value引用不变, 值不更新 - (自定义组件)
|
|
92
|
+
values = form.getFieldsValue();
|
|
93
|
+
(0, _lodash.set)(values, rowName, record);
|
|
94
|
+
form.setFieldsValue(values);
|
|
90
95
|
setState({
|
|
91
96
|
editingKeys: nextEditingKeys
|
|
92
97
|
});
|
|
93
|
-
case
|
|
98
|
+
case 10:
|
|
94
99
|
case "end":
|
|
95
100
|
return _context.stop();
|
|
96
101
|
}
|
|
@@ -130,7 +135,10 @@ var actions = exports.actions = {
|
|
|
130
135
|
selectedRowKeys: [record.rowKey]
|
|
131
136
|
});
|
|
132
137
|
} else {
|
|
133
|
-
|
|
138
|
+
// 防止value引用不变, 值不更新 - (自定义组件)
|
|
139
|
+
var values = form.getFieldsValue();
|
|
140
|
+
(0, _lodash.set)(values, virtualRowName, record);
|
|
141
|
+
form.setFieldsValue(values);
|
|
134
142
|
}
|
|
135
143
|
},
|
|
136
144
|
delete: function _delete(_ref4) {
|
|
@@ -24,6 +24,7 @@ var _tools = require("./tools");
|
|
|
24
24
|
var _ProTooltip = _interopRequireDefault(require("../../ProTooltip"));
|
|
25
25
|
var _components = require("../components");
|
|
26
26
|
var _tip = _interopRequireDefault(require("../../assets/tip.svg"));
|
|
27
|
+
var _locale = _interopRequireDefault(require("../../locale"));
|
|
27
28
|
var _excluded = ["type", "label", "show", "needConfirm", "onHandle", "onClick"],
|
|
28
29
|
_excluded2 = ["title", "icon"];
|
|
29
30
|
// 渲染操作栏
|
|
@@ -145,7 +146,7 @@ var getActionColumn = function getActionColumn(config) {
|
|
|
145
146
|
return action;
|
|
146
147
|
});
|
|
147
148
|
return {
|
|
148
|
-
title:
|
|
149
|
+
title: _locale.default.ProEditTable.operation,
|
|
149
150
|
key: 'action',
|
|
150
151
|
fixed: 'right',
|
|
151
152
|
width: actionWidth || (virtualKey ? '120px' : '60px'),
|
|
@@ -345,7 +346,7 @@ var transformColumns = exports.transformColumns = function transformColumns() {
|
|
|
345
346
|
if (disabled || isView) {
|
|
346
347
|
// 查看模式下过滤操作栏
|
|
347
348
|
_columns = _columns.filter(function (item) {
|
|
348
|
-
return item.title !==
|
|
349
|
+
return item.title !== _locale.default.ProEditTable.operation;
|
|
349
350
|
});
|
|
350
351
|
} else {
|
|
351
352
|
var validateKeys = _columns.filter(function (i) {
|
|
@@ -13,6 +13,7 @@ var _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/typeof"));
|
|
|
13
13
|
var _react = require("react");
|
|
14
14
|
var _ahooks = require("ahooks");
|
|
15
15
|
var _utils = require("../utils");
|
|
16
|
+
var _locale = _interopRequireDefault(require("../../locale"));
|
|
16
17
|
require("../utils/eventCenter");
|
|
17
18
|
var useEnumRequest = function useEnumRequest(props, dispatch) {
|
|
18
19
|
var _ref = props || {},
|
|
@@ -41,7 +42,8 @@ var useEnumRequest = function useEnumRequest(props, dispatch) {
|
|
|
41
42
|
_ref$dics = _ref.dics,
|
|
42
43
|
dics = _ref$dics === void 0 ? {} : _ref$dics;
|
|
43
44
|
if ((0, _typeof2.default)(dataSource) === 'object' && dataSource === null) {
|
|
44
|
-
|
|
45
|
+
var _locale$ProEnum;
|
|
46
|
+
throw new Error(_locale.default === null || _locale.default === void 0 ? void 0 : (_locale$ProEnum = _locale.default.ProEnum) === null || _locale$ProEnum === void 0 ? void 0 : _locale$ProEnum.errorDataSource);
|
|
45
47
|
}
|
|
46
48
|
var logDebug = function logDebug(msg) {
|
|
47
49
|
if (props.debugger) {
|
|
@@ -56,7 +58,7 @@ var useEnumRequest = function useEnumRequest(props, dispatch) {
|
|
|
56
58
|
}, useRequest === null || useRequest === void 0 ? void 0 : useRequest.options), {}, {
|
|
57
59
|
setCache: function () {
|
|
58
60
|
var _setCache = (0, _asyncToGenerator2.default)( /*#__PURE__*/(0, _regeneratorRuntime2.default)().mark(function _callee(res) {
|
|
59
|
-
var response, _useRequest$options, ignoreCodes, cacheData;
|
|
61
|
+
var response, _locale$ProEnum2, _useRequest$options, ignoreCodes, cacheData;
|
|
60
62
|
return (0, _regeneratorRuntime2.default)().wrap(function _callee$(_context) {
|
|
61
63
|
while (1) switch (_context.prev = _context.next) {
|
|
62
64
|
case 0:
|
|
@@ -73,7 +75,7 @@ var useEnumRequest = function useEnumRequest(props, dispatch) {
|
|
|
73
75
|
_context.next = 9;
|
|
74
76
|
break;
|
|
75
77
|
}
|
|
76
|
-
throw new Error(
|
|
78
|
+
throw new Error(_locale.default === null || _locale.default === void 0 ? void 0 : (_locale$ProEnum2 = _locale.default.ProEnum) === null || _locale$ProEnum2 === void 0 ? void 0 : _locale$ProEnum2.errorMessage);
|
|
77
79
|
case 9:
|
|
78
80
|
res.data = response;
|
|
79
81
|
case 10:
|
|
@@ -105,8 +107,9 @@ var useEnumRequest = function useEnumRequest(props, dispatch) {
|
|
|
105
107
|
});
|
|
106
108
|
if (main) {
|
|
107
109
|
setTimeout(function () {
|
|
110
|
+
var _locale$ProEnum3;
|
|
108
111
|
window.eventCenter.publish('zat-design-pro-component-event', res.data);
|
|
109
|
-
logDebug(
|
|
112
|
+
logDebug(_locale.default === null || _locale.default === void 0 ? void 0 : (_locale$ProEnum3 = _locale.default.ProEnum) === null || _locale$ProEnum3 === void 0 ? void 0 : _locale$ProEnum3.mainInitByRequest);
|
|
110
113
|
}, 10000);
|
|
111
114
|
}
|
|
112
115
|
return _context.abrupt("return", res);
|
|
@@ -131,8 +134,9 @@ var useEnumRequest = function useEnumRequest(props, dispatch) {
|
|
|
131
134
|
});
|
|
132
135
|
if (main) {
|
|
133
136
|
setTimeout(function () {
|
|
137
|
+
var _locale$ProEnum4;
|
|
134
138
|
window.eventCenter.publish('zat-design-pro-component-event', res.data);
|
|
135
|
-
logDebug(
|
|
139
|
+
logDebug(_locale.default === null || _locale.default === void 0 ? void 0 : (_locale$ProEnum4 = _locale.default.ProEnum) === null || _locale$ProEnum4 === void 0 ? void 0 : _locale$ProEnum4.mainInitByCache);
|
|
136
140
|
}, 10000);
|
|
137
141
|
}
|
|
138
142
|
return res;
|
|
@@ -142,14 +146,15 @@ var useEnumRequest = function useEnumRequest(props, dispatch) {
|
|
|
142
146
|
status = _res$status === void 0 ? 200 : _res$status,
|
|
143
147
|
msg = res.message;
|
|
144
148
|
if (status !== 200) {
|
|
145
|
-
|
|
149
|
+
var _locale$ProEnum5;
|
|
150
|
+
throw new Error(_locale.default === null || _locale.default === void 0 ? void 0 : (_locale$ProEnum5 = _locale.default.ProEnum) === null || _locale$ProEnum5 === void 0 ? void 0 : _locale$ProEnum5.requestError);
|
|
146
151
|
}
|
|
147
152
|
}
|
|
148
153
|
})),
|
|
149
154
|
run = _useRequestFunc.run;
|
|
150
155
|
var mergeData = /*#__PURE__*/function () {
|
|
151
156
|
var _ref2 = (0, _asyncToGenerator2.default)( /*#__PURE__*/(0, _regeneratorRuntime2.default)().mark(function _callee2() {
|
|
152
|
-
var cacheData, _useRequest$options2, _useRequest$options3, enumData, cacheCodes, codes, ignoreCodes, diff, response, res;
|
|
157
|
+
var cacheData, _useRequest$options2, _useRequest$options3, enumData, cacheCodes, codes, ignoreCodes, diff, response, res, _locale$ProEnum6;
|
|
153
158
|
return (0, _regeneratorRuntime2.default)().wrap(function _callee2$(_context2) {
|
|
154
159
|
while (1) switch (_context2.prev = _context2.next) {
|
|
155
160
|
case 0:
|
|
@@ -189,7 +194,7 @@ var useEnumRequest = function useEnumRequest(props, dispatch) {
|
|
|
189
194
|
_context2.next = 18;
|
|
190
195
|
break;
|
|
191
196
|
}
|
|
192
|
-
throw new Error(
|
|
197
|
+
throw new Error(_locale.default === null || _locale.default === void 0 ? void 0 : (_locale$ProEnum6 = _locale.default.ProEnum) === null || _locale$ProEnum6 === void 0 ? void 0 : _locale$ProEnum6.errorMessage);
|
|
193
198
|
case 18:
|
|
194
199
|
_context2.next = 21;
|
|
195
200
|
break;
|
|
@@ -279,12 +284,14 @@ var useEnumRequest = function useEnumRequest(props, dispatch) {
|
|
|
279
284
|
};
|
|
280
285
|
(0, _react.useEffect)(function () {
|
|
281
286
|
if (main) {
|
|
287
|
+
var _locale$ProEnum7;
|
|
282
288
|
window.eventCenter.publish('zat-design-pro-component-event', {});
|
|
283
|
-
logDebug(
|
|
289
|
+
logDebug(_locale.default === null || _locale.default === void 0 ? void 0 : (_locale$ProEnum7 = _locale.default.ProEnum) === null || _locale$ProEnum7 === void 0 ? void 0 : _locale$ProEnum7.mainInitOnce);
|
|
284
290
|
}
|
|
285
291
|
if (!main && share) {
|
|
292
|
+
var _locale$ProEnum8;
|
|
286
293
|
window.eventCenter.subscribe('zat-design-pro-component-event', shareProEnumDic);
|
|
287
|
-
logDebug(
|
|
294
|
+
logDebug(_locale.default === null || _locale.default === void 0 ? void 0 : (_locale$ProEnum8 = _locale.default.ProEnum) === null || _locale$ProEnum8 === void 0 ? void 0 : _locale$ProEnum8.sonInitEvent);
|
|
288
295
|
}
|
|
289
296
|
return function () {
|
|
290
297
|
window.eventCenter.unsubscribe('zat-design-pro-component-event', shareProEnumDic);
|
package/lib/ProEnum/index.js
CHANGED
|
@@ -23,6 +23,7 @@ var _Container = _interopRequireDefault(require("../ProForm/components/Container
|
|
|
23
23
|
var _utils = require("./utils");
|
|
24
24
|
var _getEnumLabel = _interopRequireDefault(require("./utils/getEnumLabel"));
|
|
25
25
|
var _useEnum = _interopRequireDefault(require("./hooks/useEnum"));
|
|
26
|
+
var _locale = _interopRequireDefault(require("../locale"));
|
|
26
27
|
require("./style/index.less");
|
|
27
28
|
var _excluded = ["code", "type", "dataSource", "useRequest", "value", "component", "onChange", "transformResponse", "otherProps"],
|
|
28
29
|
_excluded2 = ["fieldNames", "clear", "cacheKey"];
|
|
@@ -88,7 +89,8 @@ var ProEnum = function ProEnum(props) {
|
|
|
88
89
|
if (transformResponse && typeof transformResponse === 'function') {
|
|
89
90
|
var responseData = transformResponse(res);
|
|
90
91
|
if ((0, _typeof2.default)(responseData) !== 'object') {
|
|
91
|
-
|
|
92
|
+
var _locale$ProEnum;
|
|
93
|
+
return _antd.message.error((_locale$ProEnum = _locale.default.ProEnum) === null || _locale$ProEnum === void 0 ? void 0 : _locale$ProEnum.errorMessage);
|
|
92
94
|
}
|
|
93
95
|
setData(responseData);
|
|
94
96
|
} else {
|
|
@@ -98,7 +100,8 @@ var ProEnum = function ProEnum(props) {
|
|
|
98
100
|
data = res.data;
|
|
99
101
|
if (status === 200) {
|
|
100
102
|
if ((0, _typeof2.default)(data) !== 'object') {
|
|
101
|
-
|
|
103
|
+
var _locale$ProEnum2;
|
|
104
|
+
return _antd.message.error((_locale$ProEnum2 = _locale.default.ProEnum) === null || _locale$ProEnum2 === void 0 ? void 0 : _locale$ProEnum2.errorMessage);
|
|
102
105
|
}
|
|
103
106
|
if (Array.isArray(data)) {
|
|
104
107
|
setData((0, _toConsumableArray2.default)(data));
|
|
@@ -142,7 +145,8 @@ var ProEnum = function ProEnum(props) {
|
|
|
142
145
|
if (!(useRequest === null || useRequest === void 0 ? void 0 : useRequest.service) && transformResponse) {
|
|
143
146
|
list = transformResponse(list);
|
|
144
147
|
if (!Array.isArray(list)) {
|
|
145
|
-
|
|
148
|
+
var _locale$ProEnum3;
|
|
149
|
+
console.error((_locale$ProEnum3 = _locale.default.ProEnum) === null || _locale$ProEnum3 === void 0 ? void 0 : _locale$ProEnum3.errorArrayMessage);
|
|
146
150
|
list = [];
|
|
147
151
|
}
|
|
148
152
|
}
|
|
@@ -204,7 +208,8 @@ var ProEnum = function ProEnum(props) {
|
|
|
204
208
|
}
|
|
205
209
|
};
|
|
206
210
|
if (!code && !dataSource && !useRequest) {
|
|
207
|
-
|
|
211
|
+
var _locale$ProEnum4;
|
|
212
|
+
_antd.message.error(_locale.default === null || _locale.default === void 0 ? void 0 : (_locale$ProEnum4 = _locale.default.ProEnum) === null || _locale$ProEnum4 === void 0 ? void 0 : _locale$ProEnum4.errorNoEnumType);
|
|
208
213
|
return;
|
|
209
214
|
}
|
|
210
215
|
var transToLabel = function transToLabel(value) {
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
align-items: center;
|
|
10
10
|
justify-content: center;
|
|
11
11
|
margin-right: var(--zaui-space-size-sm);
|
|
12
|
-
|
|
12
|
+
margin-bottom: calc(var(--zaui-space-size-sm; 8px) * var(--zaui-size; 1));
|
|
13
13
|
padding: var(--zaui-space-size-xs) 10px;
|
|
14
14
|
background-color: #f5f5f5;
|
|
15
15
|
border-radius: var(--zaui-space-size-xs);
|
|
@@ -10,6 +10,7 @@ var _jsxRuntime = require("react/jsx-runtime");
|
|
|
10
10
|
var _antd = require("antd");
|
|
11
11
|
var _react = require("react");
|
|
12
12
|
var _ProConfigProvider = require("../../../ProConfigProvider");
|
|
13
|
+
var _locale = _interopRequireDefault(require("../../../locale"));
|
|
13
14
|
var PRO_FORM_CACHE = exports.PRO_FORM_CACHE = 'PRO_FORM_CACHE';
|
|
14
15
|
var FormFooter = function FormFooter(props) {
|
|
15
16
|
var initialConfig = (0, _ProConfigProvider.useProConfig)('FormFooter');
|
|
@@ -53,24 +54,20 @@ var FormFooter = function FormFooter(props) {
|
|
|
53
54
|
}
|
|
54
55
|
onCancel();
|
|
55
56
|
};
|
|
56
|
-
return (
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
})), children]
|
|
72
|
-
})
|
|
73
|
-
// </div>
|
|
74
|
-
);
|
|
57
|
+
return (0, _jsxRuntime.jsxs)(_antd.Space, {
|
|
58
|
+
children: [(0, _jsxRuntime.jsx)(_antd.Button, (0, _objectSpread2.default)((0, _objectSpread2.default)({
|
|
59
|
+
type: "primary",
|
|
60
|
+
htmlType: onOk ? 'button' : 'submit',
|
|
61
|
+
onClick: _onOk,
|
|
62
|
+
disabled: confirmLoading,
|
|
63
|
+
loading: confirmLoading
|
|
64
|
+
}, okButtonProps), {}, {
|
|
65
|
+
children: okChildren || okText || "".concat(_locale.default.ProForm.search)
|
|
66
|
+
})), (0, _jsxRuntime.jsx)(_antd.Button, (0, _objectSpread2.default)((0, _objectSpread2.default)({
|
|
67
|
+
onClick: _onCancel
|
|
68
|
+
}, cancelButtonProps), {}, {
|
|
69
|
+
children: cancelChildren || cancelText || "".concat(_locale.default.ProForm.reset)
|
|
70
|
+
})), children]
|
|
71
|
+
});
|
|
75
72
|
};
|
|
76
73
|
var _default = exports.default = FormFooter;
|
|
@@ -9,8 +9,10 @@ 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 _lodash = require("lodash");
|
|
12
13
|
var _ProConfigProvider = require("../../../../ProConfigProvider");
|
|
13
14
|
var _Container = _interopRequireDefault(require("../../Container"));
|
|
15
|
+
var _locale = _interopRequireDefault(require("../../../../locale"));
|
|
14
16
|
var _excluded = ["label", "form", "placeholder", "fieldName", "otherProps"];
|
|
15
17
|
// 参数优先级
|
|
16
18
|
// 组件内默认值 < config默认值 < props
|
|
@@ -34,8 +36,7 @@ var Input = function Input(props) {
|
|
|
34
36
|
return (0, _jsxRuntime.jsx)(_antd.Input, (0, _objectSpread2.default)((0, _objectSpread2.default)({
|
|
35
37
|
allowClear: true,
|
|
36
38
|
autoComplete: "off",
|
|
37
|
-
placeholder: placeholder ||
|
|
38
|
-
|
|
39
|
-
}, initialConfig), rest));
|
|
39
|
+
placeholder: placeholder || "".concat(_locale.default.ProForm.inputPlaceholder)
|
|
40
|
+
}, (0, _lodash.omit)(initialConfig, ['trim'])), rest));
|
|
40
41
|
};
|
|
41
42
|
var _default = exports.default = Input;
|
|
@@ -19,6 +19,7 @@ var _lodash = require("lodash");
|
|
|
19
19
|
var _ProConfigProvider = require("../../../../ProConfigProvider");
|
|
20
20
|
var _Container = _interopRequireDefault(require("../../Container"));
|
|
21
21
|
var _index = require("../../../utils/index");
|
|
22
|
+
var _locale = _interopRequireDefault(require("../../../../locale"));
|
|
22
23
|
var _excluded = ["placeholder", "className", "otherProps", "range", "min", "max", "onBlur"];
|
|
23
24
|
var calc = _utils.tools.calc;
|
|
24
25
|
var rangeReg = /^[([](-?\d+(\.\d+)?)?,\s*(-?\d+(\.\d+)?)?[)\]]$/;
|
|
@@ -106,9 +107,9 @@ var InputNumber = function InputNumber(props) {
|
|
|
106
107
|
var _max;
|
|
107
108
|
if (range) {
|
|
108
109
|
if (rest.precision === undefined) {
|
|
109
|
-
console.warn('
|
|
110
|
+
console.warn('When using [range], you must pass in [precision]');
|
|
110
111
|
} else if (!rangeReg.test(range)) {
|
|
111
|
-
console.warn('"range"
|
|
112
|
+
console.warn('" range "format is wrong, the reference:" (a, b) ", "[a, b]", "(a, b] [a, b)", "');
|
|
112
113
|
} else {
|
|
113
114
|
var _range$replace$split = range.replace(' ', '').split(','),
|
|
114
115
|
_range$replace$split2 = (0, _slicedToArray2.default)(_range$replace$split, 2),
|
|
@@ -244,7 +245,7 @@ var InputNumber = function InputNumber(props) {
|
|
|
244
245
|
};
|
|
245
246
|
return (0, _jsxRuntime.jsx)(_antd.InputNumber, (0, _objectSpread2.default)((0, _objectSpread2.default)((0, _objectSpread2.default)((0, _objectSpread2.default)({
|
|
246
247
|
autoComplete: "off",
|
|
247
|
-
placeholder: placeholder || "
|
|
248
|
+
placeholder: placeholder || "".concat(_locale.default.ProForm.inputPlaceholder).concat(label !== null && label !== void 0 ? label : ''),
|
|
248
249
|
className: _className
|
|
249
250
|
}, valueProps), initialConfig), rest), {}, {
|
|
250
251
|
onBlur: handleBlur,
|
|
@@ -13,7 +13,7 @@ var _lodash = require("lodash");
|
|
|
13
13
|
var _moment = _interopRequireDefault(require("moment"));
|
|
14
14
|
var _ProConfigProvider = require("../../../../ProConfigProvider");
|
|
15
15
|
var _Container = _interopRequireDefault(require("../../Container"));
|
|
16
|
-
var _excluded = ["format", "otherProps", "separator"];
|
|
16
|
+
var _excluded = ["format", "otherProps", "separator"]; // @ts-check
|
|
17
17
|
var AntRangePicker = _antd.DatePicker.RangePicker;
|
|
18
18
|
var RangePicker = function RangePicker(props) {
|
|
19
19
|
var _props$format = props.format,
|
|
@@ -54,9 +54,6 @@ var RangePicker = function RangePicker(props) {
|
|
|
54
54
|
var _res = (0, _objectSpread2.default)((0, _objectSpread2.default)({}, rest), {}, {
|
|
55
55
|
showTime: !rest.showTime && valueType === 'dateTime' || rest.showTime
|
|
56
56
|
});
|
|
57
|
-
if (_res === null || _res === void 0 ? void 0 : _res.placeholder) {
|
|
58
|
-
_res === null || _res === void 0 ? true : delete _res.placeholder;
|
|
59
|
-
}
|
|
60
57
|
// 字符串时间格式兼容
|
|
61
58
|
if (Array.isArray(_res.value) && (0, _lodash.isString)(_res.value[0]) && (0, _lodash.isString)(_res.value[1])) {
|
|
62
59
|
_res.value = [(0, _moment.default)(_res.value[0]), (0, _moment.default)(_res.value[1])];
|
|
@@ -11,6 +11,7 @@ var _jsxRuntime = require("react/jsx-runtime");
|
|
|
11
11
|
var _antd = require("antd");
|
|
12
12
|
var _Container = _interopRequireDefault(require("../../Container"));
|
|
13
13
|
var _ProConfigProvider = require("../../../../ProConfigProvider");
|
|
14
|
+
var _locale = _interopRequireDefault(require("../../../../locale"));
|
|
14
15
|
var _excluded = ["dataSource", "fieldNames", "otherProps", "scrollFollowParent"];
|
|
15
16
|
var Select = function Select(props) {
|
|
16
17
|
var _props$dataSource = props.dataSource,
|
|
@@ -65,7 +66,7 @@ var Select = function Select(props) {
|
|
|
65
66
|
}
|
|
66
67
|
}
|
|
67
68
|
return (0, _jsxRuntime.jsx)(_antd.Select, (0, _objectSpread2.default)((0, _objectSpread2.default)((0, _objectSpread2.default)({
|
|
68
|
-
placeholder: "
|
|
69
|
+
placeholder: "".concat(_locale.default.ProForm.selectPlaceHolder),
|
|
69
70
|
allowClear: true,
|
|
70
71
|
getPopupContainer: function getPopupContainer(trigger) {
|
|
71
72
|
return scrollFollowParent ? trigger.parentElement : document.body;
|
|
@@ -12,6 +12,7 @@ var _antd = require("antd");
|
|
|
12
12
|
var _lodash = require("lodash");
|
|
13
13
|
var _ProConfigProvider = require("../../../../ProConfigProvider");
|
|
14
14
|
var _Container = _interopRequireDefault(require("../../Container"));
|
|
15
|
+
var _locale = _interopRequireDefault(require("../../../../locale"));
|
|
15
16
|
var _excluded = ["disabled", "otherProps"];
|
|
16
17
|
var Switch = function Switch(props) {
|
|
17
18
|
var disabled = props.disabled,
|
|
@@ -30,13 +31,15 @@ var Switch = function Switch(props) {
|
|
|
30
31
|
}
|
|
31
32
|
return (0, _jsxRuntime.jsx)(_Container.default, {
|
|
32
33
|
viewEmpty: viewEmpty,
|
|
33
|
-
children: res.checked === true ?
|
|
34
|
+
children: res.checked === true ? "".concat(_locale.default.ProForm.switchText[0]) : "".concat(_locale.default.ProForm.switchText[1])
|
|
34
35
|
});
|
|
35
36
|
}
|
|
36
|
-
return (0, _jsxRuntime.jsx)(_antd.Switch, (0, _objectSpread2.default)((0, _objectSpread2.default)({
|
|
37
|
+
return (0, _jsxRuntime.jsx)(_antd.Switch, (0, _objectSpread2.default)((0, _objectSpread2.default)((0, _objectSpread2.default)({
|
|
37
38
|
disabled: disabled,
|
|
38
|
-
checkedChildren: "
|
|
39
|
-
unCheckedChildren: "
|
|
40
|
-
}, config), res)
|
|
39
|
+
checkedChildren: "".concat(_locale.default.ProForm.switchText[0]),
|
|
40
|
+
unCheckedChildren: "".concat(_locale.default.ProForm.switchText[1])
|
|
41
|
+
}, config), res), {}, {
|
|
42
|
+
id: "switch_only" // 解决点击label联动的问题
|
|
43
|
+
}));
|
|
41
44
|
};
|
|
42
45
|
var _default = exports.default = Switch;
|
|
@@ -11,6 +11,7 @@ var _jsxRuntime = require("react/jsx-runtime");
|
|
|
11
11
|
var _antd = require("antd");
|
|
12
12
|
var _lodash = require("lodash");
|
|
13
13
|
var _ProConfigProvider = require("../../../../ProConfigProvider");
|
|
14
|
+
var _locale = _interopRequireDefault(require("../../../../locale"));
|
|
14
15
|
var _excluded = ["onChange", "disabled", "value", "otherProps"];
|
|
15
16
|
var SwitchCheckbox = function SwitchCheckbox(props) {
|
|
16
17
|
var onChange = props.onChange,
|
|
@@ -46,7 +47,7 @@ var SwitchCheckbox = function SwitchCheckbox(props) {
|
|
|
46
47
|
children: restProps.label
|
|
47
48
|
}), (0, _jsxRuntime.jsx)("span", {
|
|
48
49
|
className: "switch-checkbox-view-value",
|
|
49
|
-
children: restProps.checked === true ?
|
|
50
|
+
children: restProps.checked === true ? "".concat(_locale.default.ProForm.switchText[0]) : "".concat(_locale.default.ProForm.switchText[1])
|
|
50
51
|
})]
|
|
51
52
|
});
|
|
52
53
|
}
|
|
@@ -9,8 +9,10 @@ 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 _lodash = require("lodash");
|
|
12
13
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
13
14
|
var _ProConfigProvider = require("../../../../ProConfigProvider");
|
|
15
|
+
var _locale = _interopRequireDefault(require("../../../../locale"));
|
|
14
16
|
require("./index.less");
|
|
15
17
|
var _excluded = ["placeholder", "otherProps", "className"];
|
|
16
18
|
var TextArea = _antd.Input.TextArea;
|
|
@@ -37,11 +39,11 @@ var TextAreaDef = function TextAreaDef(props) {
|
|
|
37
39
|
return (0, _jsxRuntime.jsx)(TextArea, (0, _objectSpread2.default)((0, _objectSpread2.default)((0, _objectSpread2.default)({
|
|
38
40
|
showCount: true,
|
|
39
41
|
autoComplete: "off",
|
|
40
|
-
placeholder: placeholder || "
|
|
42
|
+
placeholder: placeholder || "".concat(_locale.default.ProForm.inputPlaceholder).concat(label || ''),
|
|
41
43
|
autoSize: {
|
|
42
44
|
minRows: 4
|
|
43
45
|
}
|
|
44
|
-
}, initialConfig), rest), {}, {
|
|
46
|
+
}, (0, _lodash.omit)(initialConfig, ['trim'])), rest), {}, {
|
|
45
47
|
disabled: disabled,
|
|
46
48
|
className: _className
|
|
47
49
|
}));
|