@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
|
@@ -20,7 +20,7 @@ var _reactSvg = require("react-svg");
|
|
|
20
20
|
var _arrow = _interopRequireDefault(require("../../../assets/arrow.svg"));
|
|
21
21
|
var _components = require("./components");
|
|
22
22
|
var _getEnumLabel = _interopRequireDefault(require("../../../ProEnum/utils/getEnumLabel"));
|
|
23
|
-
var
|
|
23
|
+
var _locale = _interopRequireDefault(require("../../../locale"));
|
|
24
24
|
/* eslint-disable react/no-array-index-key */
|
|
25
25
|
|
|
26
26
|
var formatAmount = _utils.tools.formatAmount;
|
|
@@ -317,7 +317,7 @@ var ProHeader = function ProHeader(props) {
|
|
|
317
317
|
// value为null或者undefined返回'-'
|
|
318
318
|
var val = String(value).includes('undefined') || !value ? '-' : value;
|
|
319
319
|
if (type === 'version' && val) {
|
|
320
|
-
val = "
|
|
320
|
+
val = "".concat(_locale.default.ProHeader.versionTitle).concat(val);
|
|
321
321
|
}
|
|
322
322
|
// 面包屑样式
|
|
323
323
|
var breadcrumbCls = (0, _classnames2.default)({
|
|
@@ -387,12 +387,15 @@ var ProHeader = function ProHeader(props) {
|
|
|
387
387
|
var onConfirm = function onConfirm() {
|
|
388
388
|
if (!isConfirmBack) {
|
|
389
389
|
onBack && onBack();
|
|
390
|
+
if (!onBack) {
|
|
391
|
+
window.history.back();
|
|
392
|
+
}
|
|
390
393
|
return false;
|
|
391
394
|
}
|
|
392
395
|
_antd.Modal.confirm((0, _objectSpread2.default)({
|
|
393
|
-
title:
|
|
394
|
-
okText:
|
|
395
|
-
cancelText:
|
|
396
|
+
title: "".concat(_locale.default.ProHeader.confirmTitle),
|
|
397
|
+
okText: "".concat(_locale.default.ProHeader.confirm),
|
|
398
|
+
cancelText: "".concat(_locale.default.ProHeader.cancel),
|
|
396
399
|
onOk: function onOk() {
|
|
397
400
|
onBack && onBack();
|
|
398
401
|
}
|
|
@@ -417,7 +420,7 @@ var ProHeader = function ProHeader(props) {
|
|
|
417
420
|
}),
|
|
418
421
|
children: (0, _jsxRuntime.jsxs)(_antd.Space, {
|
|
419
422
|
size: backState ? 4 : 0,
|
|
420
|
-
children: [backState ? (0, _jsxRuntime.jsx)(
|
|
423
|
+
children: [backState ? (0, _jsxRuntime.jsx)(_components.ProBackBtn, {
|
|
421
424
|
onBack: onConfirm
|
|
422
425
|
}) : null, (0, _jsxRuntime.jsx)(_antd.Breadcrumb, {
|
|
423
426
|
separator: ">",
|
|
@@ -1,16 +1,25 @@
|
|
|
1
|
+
@import '../components/ProBackBtn/style/index';
|
|
2
|
+
|
|
1
3
|
.pro-header {
|
|
2
4
|
background-color: var(--zaui-base-bg, #ffffff);
|
|
3
|
-
padding :
|
|
5
|
+
padding : 24px 0 0 0;
|
|
4
6
|
|
|
5
7
|
&.pro-header-no-back {
|
|
6
8
|
.pro-header-top {
|
|
7
9
|
padding-left: 0;
|
|
8
10
|
}
|
|
11
|
+
|
|
12
|
+
.pro-header-left {
|
|
13
|
+
&.pro-header-left-space {
|
|
14
|
+
margin-left: 0 !important;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
}
|
|
9
18
|
}
|
|
10
19
|
|
|
11
20
|
&.pro-header-no-describe {
|
|
12
21
|
box-shadow : none;
|
|
13
|
-
margin-bottom: var(--zaui-space-size-md
|
|
22
|
+
margin-bottom: calc(var(--zaui-space-size-md; 16px) * var(--zaui-size; 1));
|
|
14
23
|
|
|
15
24
|
.pro-header-title,
|
|
16
25
|
.pro-header-top {
|
|
@@ -21,7 +30,7 @@
|
|
|
21
30
|
|
|
22
31
|
&.pro-header-fixed.pro-header-no-describe {
|
|
23
32
|
.pro-header-top {
|
|
24
|
-
padding-bottom:
|
|
33
|
+
padding-bottom: calc(var(--zaui-space-size-md; 16px) * var(--zaui-size; 1) - var(--zaui-space-size-xs; 4px) * var(--zaui-size; 1));
|
|
25
34
|
}
|
|
26
35
|
}
|
|
27
36
|
|
|
@@ -111,7 +120,7 @@
|
|
|
111
120
|
display : flex;
|
|
112
121
|
justify-content: space-between;
|
|
113
122
|
align-items : center;
|
|
114
|
-
margin-bottom : var(--zaui-space-size-sm
|
|
123
|
+
margin-bottom : calc(var(--zaui-space-size-sm; 8px) * var(--zaui-size; 1));
|
|
115
124
|
padding : 0 var(--zaui-space-size-md, 16px);
|
|
116
125
|
|
|
117
126
|
.pro-header-left {
|
|
@@ -265,7 +274,7 @@
|
|
|
265
274
|
li {
|
|
266
275
|
margin-right : 52px;
|
|
267
276
|
margin-top : 4px;
|
|
268
|
-
margin-bottom:
|
|
277
|
+
margin-bottom: calc(var(--zaui-space-size-md; 16px) * var(--zaui-size; 1));
|
|
269
278
|
|
|
270
279
|
&:last-child {
|
|
271
280
|
margin-right: 0;
|
|
@@ -303,9 +312,9 @@
|
|
|
303
312
|
.pro-header-describe {
|
|
304
313
|
display : flex;
|
|
305
314
|
flex-wrap : wrap;
|
|
306
|
-
font-size : 14px;
|
|
315
|
+
font-size : var(--zaui-font-size, 14px);
|
|
307
316
|
padding : 0 var(--zaui-space-size-md, 16px);
|
|
308
|
-
padding-bottom:
|
|
317
|
+
padding-bottom: calc(var(--zaui-space-size-md; 16px) * var(--zaui-size; 1) - var(--zaui-space-size-xs; 4px) * var(--zaui-size; 1));
|
|
309
318
|
|
|
310
319
|
li {
|
|
311
320
|
margin-left: var(--zaui-space-card, 32px);
|
|
@@ -10,8 +10,8 @@ exports.transformMenus = exports.transformMenu = void 0;
|
|
|
10
10
|
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
|
|
11
11
|
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
|
|
12
12
|
var _lodash = require("lodash");
|
|
13
|
-
/* eslint-disable no-mixed-operators */
|
|
14
13
|
/* eslint-disable prefer-destructuring */
|
|
14
|
+
/* eslint-disable no-mixed-operators */
|
|
15
15
|
|
|
16
16
|
/**
|
|
17
17
|
* 通过URL获取对应keyIdPath
|
package/lib/ProSelect/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { PropSelectProps } from './propsType';
|
|
2
|
+
import { PropSelectProps, ProSelectAction } from './propsType';
|
|
3
3
|
import './index.less';
|
|
4
|
-
export declare const ProSelect: (props: PropSelectProps, ref: React.Ref<
|
|
5
|
-
declare const _default: React.ForwardRefExoticComponent<PropSelectProps & React.RefAttributes<
|
|
4
|
+
export declare const ProSelect: (props: PropSelectProps, ref: React.Ref<ProSelectAction> | undefined) => JSX.Element;
|
|
5
|
+
declare const _default: React.ForwardRefExoticComponent<PropSelectProps & React.RefAttributes<ProSelectAction>>;
|
|
6
6
|
export default _default;
|
package/lib/ProSelect/index.js
CHANGED
|
@@ -16,11 +16,13 @@ var _react = _interopRequireWildcard(require("react"));
|
|
|
16
16
|
var _lodash = require("lodash");
|
|
17
17
|
var _ProConfigProvider = require("../ProConfigProvider");
|
|
18
18
|
var _Container = _interopRequireDefault(require("../ProForm/components/Container"));
|
|
19
|
-
require("./index.less");
|
|
20
19
|
var _AdaptiveTooltip = _interopRequireDefault(require("./components/AdaptiveTooltip"));
|
|
20
|
+
var _locale = _interopRequireDefault(require("../locale"));
|
|
21
|
+
require("./index.less");
|
|
21
22
|
var _excluded = ["dataSource", "defaultDisableValue", "useRequest", "fieldNames", "tooltip", "otherProps", "labelInValue", "scrollFollowParent", "defaultOne", "onSearch", "optionRender", "onChange", "updateDataSource", "transformResponse"];
|
|
22
23
|
var Option = _antd.Select.Option;
|
|
23
24
|
var ProSelect = exports.ProSelect = function ProSelect(props, ref) {
|
|
25
|
+
var _locale$ProSelect;
|
|
24
26
|
var _ref = (0, _ProConfigProvider.useProConfig)('ProSelect') || {},
|
|
25
27
|
_ref$fieldNames = _ref.fieldNames,
|
|
26
28
|
proSelectFieldNames = _ref$fieldNames === void 0 ? {} : _ref$fieldNames;
|
|
@@ -262,7 +264,7 @@ var ProSelect = exports.ProSelect = function ProSelect(props, ref) {
|
|
|
262
264
|
return value;
|
|
263
265
|
};
|
|
264
266
|
return (0, _jsxRuntime.jsx)(_antd.Select, (0, _objectSpread2.default)((0, _objectSpread2.default)({
|
|
265
|
-
placeholder:
|
|
267
|
+
placeholder: _locale.default === null || _locale.default === void 0 ? void 0 : (_locale$ProSelect = _locale.default.ProSelect) === null || _locale$ProSelect === void 0 ? void 0 : _locale$ProSelect.select,
|
|
266
268
|
allowClear: true,
|
|
267
269
|
showArrow: true,
|
|
268
270
|
loading: fetchFunction === null || fetchFunction === void 0 ? void 0 : fetchFunction.loading,
|
|
@@ -14,7 +14,9 @@ var _lodash = require("lodash");
|
|
|
14
14
|
var _reactSvg = require("react-svg");
|
|
15
15
|
var _catalog = _interopRequireDefault(require("../../../assets/catalog.svg"));
|
|
16
16
|
var _Anchor = _interopRequireDefault(require("../Anchor"));
|
|
17
|
+
var _locale = _interopRequireDefault(require("../../../locale"));
|
|
17
18
|
var Step = exports.Step = function Step(_ref) {
|
|
19
|
+
var _locale$ProStep;
|
|
18
20
|
var fixedTop = _ref.fixedTop,
|
|
19
21
|
_ref$dataSource = _ref.dataSource,
|
|
20
22
|
dataSource = _ref$dataSource === void 0 ? [] : _ref$dataSource,
|
|
@@ -69,7 +71,7 @@ var Step = exports.Step = function Step(_ref) {
|
|
|
69
71
|
className: "menu-icon",
|
|
70
72
|
src: _catalog.default
|
|
71
73
|
}), onOff && (0, _jsxRuntime.jsx)("div", {
|
|
72
|
-
children:
|
|
74
|
+
children: _locale.default === null || _locale.default === void 0 ? void 0 : (_locale$ProStep = _locale.default.ProStep) === null || _locale$ProStep === void 0 ? void 0 : _locale$ProStep.catalogue
|
|
73
75
|
})]
|
|
74
76
|
}), options.map(function (item) {
|
|
75
77
|
return (0, _jsxRuntime.jsx)(_react.default.Fragment, {
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { FC } from 'react';
|
|
2
|
-
import { ProTableValueType } from '../../propsType';
|
|
3
2
|
interface Props {
|
|
4
|
-
valueType?:
|
|
5
|
-
|
|
3
|
+
valueType?: string;
|
|
4
|
+
node?: any;
|
|
6
5
|
value?: any;
|
|
7
|
-
|
|
6
|
+
currentValue?: any;
|
|
8
7
|
copyable?: boolean;
|
|
8
|
+
originalTip?: boolean;
|
|
9
9
|
ellipsis?: any;
|
|
10
10
|
width?: number | string;
|
|
11
|
-
|
|
11
|
+
originalValue?: any;
|
|
12
12
|
}
|
|
13
13
|
declare const RenderColumn: FC<Props>;
|
|
14
14
|
export default RenderColumn;
|
|
@@ -9,33 +9,51 @@ var _jsxRuntime = require("react/jsx-runtime");
|
|
|
9
9
|
var _antd = require("antd");
|
|
10
10
|
var _icons = require("@ant-design/icons");
|
|
11
11
|
var _reactSvg = require("react-svg");
|
|
12
|
-
var _ProForm = _interopRequireDefault(require("../../../ProForm"));
|
|
13
|
-
var _getEnumLabel = _interopRequireDefault(require("../../../ProEnum/utils/getEnumLabel"));
|
|
14
12
|
var _copy = _interopRequireDefault(require("../../../assets/copy.svg"));
|
|
15
13
|
var Paragraph = _antd.Typography.Paragraph,
|
|
16
14
|
Text = _antd.Typography.Text;
|
|
17
15
|
// @ts-ignore
|
|
18
16
|
var RenderColumn = function RenderColumn(props) {
|
|
19
17
|
var valueType = props.valueType,
|
|
20
|
-
code = props.code,
|
|
21
18
|
value = props.value,
|
|
22
|
-
|
|
19
|
+
node = props.node,
|
|
20
|
+
currentValue = props.currentValue,
|
|
23
21
|
copyable = props.copyable,
|
|
24
22
|
ellipsis = props.ellipsis,
|
|
25
23
|
width = props.width,
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
var
|
|
30
|
-
if (
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
24
|
+
originalValue = props.originalValue,
|
|
25
|
+
originalTip = props.originalTip;
|
|
26
|
+
if (originalValue !== undefined) {
|
|
27
|
+
var renderNode = value ? node : '-';
|
|
28
|
+
if (ellipsis || originalTip) {
|
|
29
|
+
if (ellipsis) {
|
|
30
|
+
renderNode = (0, _jsxRuntime.jsx)(Text, {
|
|
31
|
+
style: {
|
|
32
|
+
width: currentValue === '-' ? 32.5 : width
|
|
33
|
+
},
|
|
34
|
+
ellipsis: {
|
|
35
|
+
tooltip: false
|
|
36
|
+
},
|
|
37
|
+
children: ellipsis ? currentValue : renderNode
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
return (0, _jsxRuntime.jsx)(_antd.Tooltip, {
|
|
41
|
+
className: "varied-cell",
|
|
42
|
+
style: {
|
|
43
|
+
width: width
|
|
44
|
+
},
|
|
45
|
+
title: originalTip ? (0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
46
|
+
children: ["\u521D\u59CB\u503C\uFF1A", originalValue, (0, _jsxRuntime.jsx)("br", {}), ellipsis ? "\u5F53\u524D\u503C\uFF1A".concat(currentValue) : undefined]
|
|
47
|
+
}) : node,
|
|
48
|
+
children: renderNode
|
|
49
|
+
});
|
|
34
50
|
}
|
|
35
|
-
return (0, _jsxRuntime.jsx)(
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
51
|
+
return (0, _jsxRuntime.jsx)("span", {
|
|
52
|
+
className: "varied-cell",
|
|
53
|
+
style: {
|
|
54
|
+
width: width
|
|
55
|
+
},
|
|
56
|
+
children: renderNode
|
|
39
57
|
});
|
|
40
58
|
}
|
|
41
59
|
if (copyable) {
|
|
@@ -46,25 +64,21 @@ var RenderColumn = function RenderColumn(props) {
|
|
|
46
64
|
width: width
|
|
47
65
|
} : undefined,
|
|
48
66
|
ellipsis: ellipsis ? {
|
|
49
|
-
tooltip:
|
|
67
|
+
tooltip: node
|
|
50
68
|
} : false,
|
|
51
69
|
copyable: {
|
|
52
|
-
text:
|
|
70
|
+
text: node,
|
|
53
71
|
icon: [(0, _jsxRuntime.jsx)(_reactSvg.ReactSVG, {
|
|
54
72
|
className: "drag-icon",
|
|
55
73
|
src: _copy.default
|
|
56
74
|
}, "copy-icon"), (0, _jsxRuntime.jsx)(_icons.CheckOutlined, {}, "copied-icon")],
|
|
57
75
|
tooltips: ['复制', '复制成功']
|
|
58
76
|
},
|
|
59
|
-
children:
|
|
77
|
+
children: node
|
|
60
78
|
})
|
|
61
79
|
});
|
|
62
80
|
}
|
|
63
81
|
if (ellipsis) {
|
|
64
|
-
var node = value;
|
|
65
|
-
if (['enumName', 'enumCodeName'].includes(valueType)) {
|
|
66
|
-
node = (0, _getEnumLabel.default)(typeof code === 'function' ? code() : code, value, valueType === 'enumCodeName');
|
|
67
|
-
}
|
|
68
82
|
return value ? (0, _jsxRuntime.jsx)(Text, {
|
|
69
83
|
style: {
|
|
70
84
|
width: width
|
|
@@ -76,6 +90,6 @@ var RenderColumn = function RenderColumn(props) {
|
|
|
76
90
|
children: node
|
|
77
91
|
}) : '-';
|
|
78
92
|
}
|
|
79
|
-
return
|
|
93
|
+
return value ? node : '-';
|
|
80
94
|
};
|
|
81
95
|
var _default = exports.default = RenderColumn;
|
|
@@ -15,6 +15,14 @@ var _classnames = _interopRequireDefault(require("classnames"));
|
|
|
15
15
|
var _index = require("../../index");
|
|
16
16
|
var _utils = require("../../utils");
|
|
17
17
|
var _excluded = ["onDrag", "width", "minwidth"];
|
|
18
|
+
/*
|
|
19
|
+
* @Author: chongyang wanchongyang@zhongan.io
|
|
20
|
+
* @Date: 2023-02-23 17:47:46
|
|
21
|
+
* @LastEditors: chongyang wanchongyang@zhongan.io
|
|
22
|
+
* @LastEditTime: 2023-03-07 20:18:22
|
|
23
|
+
* @FilePath: /za-material-warehouse/src/ProTable/TableResizable.tsx
|
|
24
|
+
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
|
|
25
|
+
*/
|
|
18
26
|
var ResizableTitle = function ResizableTitle(props) {
|
|
19
27
|
var _restProps$className;
|
|
20
28
|
var onDrag = props.onDrag,
|
package/lib/ProTable/index.js
CHANGED
|
@@ -27,7 +27,8 @@ var _empty = _interopRequireDefault(require("../assets/empty.png"));
|
|
|
27
27
|
var _reset = _interopRequireDefault(require("../assets/reset.svg"));
|
|
28
28
|
var _customColumn = _interopRequireDefault(require("../assets/customColumn.svg"));
|
|
29
29
|
var _utils3 = require("./utils");
|
|
30
|
-
var
|
|
30
|
+
var _locale = _interopRequireDefault(require("../locale"));
|
|
31
|
+
var _excluded = ["tableId", "headerRender", "footerRender", "quickConfig", "stripe", "columns", "className", "summary", "emptyText", "originalDataSource"],
|
|
31
32
|
_excluded2 = ["resizeColumn", "columnConfig", "cacheTime", "storage"];
|
|
32
33
|
var defaultCacheTime = 1; // columns 配置保存时间为一天
|
|
33
34
|
// 全局上下文
|
|
@@ -37,7 +38,7 @@ var defaultPage = exports.defaultPage = {
|
|
|
37
38
|
pageSize: 10
|
|
38
39
|
};
|
|
39
40
|
function ProTable(props) {
|
|
40
|
-
var _curTableConfig$pathK;
|
|
41
|
+
var _locale$ProTable, _curTableConfig$pathK, _locale$ProTable2, _locale$ProTable3, _locale$ProTable4, _locale$ProTable5;
|
|
41
42
|
var _ref = (0, _index.useProConfig)('globalConfig') || {},
|
|
42
43
|
configStorage = _ref.storage; // 获取全局缓存位置配置
|
|
43
44
|
var _ref2 = (0, _index.useProConfig)('ProTable') || {},
|
|
@@ -54,7 +55,8 @@ function ProTable(props) {
|
|
|
54
55
|
className = props.className,
|
|
55
56
|
summary = props.summary,
|
|
56
57
|
_props$emptyText = props.emptyText,
|
|
57
|
-
emptyText = _props$emptyText === void 0 ?
|
|
58
|
+
emptyText = _props$emptyText === void 0 ? _locale.default === null || _locale.default === void 0 ? void 0 : (_locale$ProTable = _locale.default.ProTable) === null || _locale$ProTable === void 0 ? void 0 : _locale$ProTable.noData : _props$emptyText,
|
|
59
|
+
originalDataSource = props.originalDataSource,
|
|
58
60
|
restProps = (0, _objectWithoutProperties2.default)(props, _excluded);
|
|
59
61
|
var quickTableConfig = quickConfig ? (0, _objectSpread4.default)({
|
|
60
62
|
// resizeColumn: true,
|
|
@@ -165,7 +167,7 @@ function ProTable(props) {
|
|
|
165
167
|
return !(item === null || item === void 0 ? void 0 : item.delete);
|
|
166
168
|
});
|
|
167
169
|
newColumns === null || newColumns === void 0 ? void 0 : newColumns.forEach(function (item) {
|
|
168
|
-
(0, _utils3.formatColumn)(item);
|
|
170
|
+
(0, _utils3.formatColumn)(item, originalDataSource);
|
|
169
171
|
});
|
|
170
172
|
return newColumns;
|
|
171
173
|
}, [curColumns, handleResize]);
|
|
@@ -284,9 +286,9 @@ function ProTable(props) {
|
|
|
284
286
|
src: _reset.default
|
|
285
287
|
}),
|
|
286
288
|
onClick: resetColumnWidth,
|
|
287
|
-
children:
|
|
289
|
+
children: _locale.default === null || _locale.default === void 0 ? void 0 : (_locale$ProTable2 = _locale.default.ProTable) === null || _locale$ProTable2 === void 0 ? void 0 : _locale$ProTable2.resetColumnWidth
|
|
288
290
|
}), columnConfig && (0, _jsxRuntime.jsx)(_index.ProTreeModal, {
|
|
289
|
-
title:
|
|
291
|
+
title: _locale.default === null || _locale.default === void 0 ? void 0 : (_locale$ProTable3 = _locale.default.ProTable) === null || _locale$ProTable3 === void 0 ? void 0 : _locale$ProTable3.customColumns,
|
|
290
292
|
span: 8,
|
|
291
293
|
mode: "list",
|
|
292
294
|
draggable: true,
|
|
@@ -301,7 +303,7 @@ function ProTable(props) {
|
|
|
301
303
|
wrapper: "span",
|
|
302
304
|
src: _customColumn.default
|
|
303
305
|
}),
|
|
304
|
-
children:
|
|
306
|
+
children: _locale.default === null || _locale.default === void 0 ? void 0 : (_locale$ProTable4 = _locale.default.ProTable) === null || _locale$ProTable4 === void 0 ? void 0 : _locale$ProTable4.customColumns
|
|
305
307
|
})
|
|
306
308
|
})]
|
|
307
309
|
})]
|
|
@@ -318,7 +320,7 @@ function ProTable(props) {
|
|
|
318
320
|
className: "ant-empty-image",
|
|
319
321
|
children: (0, _jsxRuntime.jsx)("img", {
|
|
320
322
|
src: _empty.default,
|
|
321
|
-
alt:
|
|
323
|
+
alt: _locale.default === null || _locale.default === void 0 ? void 0 : (_locale$ProTable5 = _locale.default.ProTable) === null || _locale$ProTable5 === void 0 ? void 0 : _locale$ProTable5.noData
|
|
322
324
|
})
|
|
323
325
|
}), (0, _jsxRuntime.jsx)("div", {
|
|
324
326
|
className: "ant-empty-description",
|
|
@@ -26,6 +26,7 @@ export interface ProTableColumn extends Omit<ColumnType<any>, 'dataIndex'> {
|
|
|
26
26
|
precision?: number;
|
|
27
27
|
code?: string | string[] | (() => string);
|
|
28
28
|
copyable?: boolean;
|
|
29
|
+
originalTip?: boolean;
|
|
29
30
|
prefix?: string | ReactNode | ((value: any, record?: any, index?: number) => any);
|
|
30
31
|
suffix?: string | ReactNode | ((value: any, record?: any, index?: number) => any);
|
|
31
32
|
tooltip?: ReactNode | {
|
|
@@ -53,6 +54,7 @@ export interface ProTableProps extends Omit<TableProps<any>, 'summary' | 'column
|
|
|
53
54
|
*/
|
|
54
55
|
stripe?: boolean;
|
|
55
56
|
columns: ProTableColumn[];
|
|
57
|
+
originalDataSource?: any[];
|
|
56
58
|
}
|
|
57
59
|
export type ProTableValueType = 'percentage' | 'permillage' | 'thousandth' | 'datePicker' | 'enumName' | 'enumCodeName' | 'address' | 'thousandthCNY' | 'date' | 'dateTime' | 'dateStartTime' | 'dateEndTime' | 'dateStartEndTime';
|
|
58
60
|
export interface Response<T = any> {
|
|
@@ -54,6 +54,19 @@
|
|
|
54
54
|
}
|
|
55
55
|
}
|
|
56
56
|
|
|
57
|
+
.ant-table-body {
|
|
58
|
+
.ant-table-cell .varied-cell {
|
|
59
|
+
margin-left: -8px;
|
|
60
|
+
background: var(--zaui-contract-bg, #fffaa1);
|
|
61
|
+
padding: var(--zaui-space-size-xs, 4px) var(--zaui-space-size-sm, 8px);
|
|
62
|
+
border-radius: var(--zaui-border-radius, 4px);
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
.varied-cell.empty-cell {
|
|
66
|
+
width: 24.5px;
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
|
|
57
70
|
.copyable-table-cell {
|
|
58
71
|
|
|
59
72
|
|
|
@@ -140,7 +153,7 @@
|
|
|
140
153
|
.column-config {
|
|
141
154
|
display : flex;
|
|
142
155
|
justify-content: space-between;
|
|
143
|
-
margin-bottom : var(--zaui-space-size-md
|
|
156
|
+
margin-bottom : calc(var(--zaui-space-size-md; 16px) * var(--zaui-size; 1));
|
|
144
157
|
|
|
145
158
|
.right-actions {
|
|
146
159
|
display : flex;
|
|
@@ -14,11 +14,15 @@ declare function useAntdTable<I, R extends Record<string, any>, S extends Servic
|
|
|
14
14
|
getCheckboxProps: () => {
|
|
15
15
|
className: string;
|
|
16
16
|
};
|
|
17
|
-
selections: boolean | {
|
|
17
|
+
selections: boolean | ({
|
|
18
18
|
key: string;
|
|
19
19
|
text: string;
|
|
20
20
|
onSelect: (changeableRowKeys: Key[]) => void;
|
|
21
|
-
}
|
|
21
|
+
} | {
|
|
22
|
+
key: string;
|
|
23
|
+
text: any;
|
|
24
|
+
onSelect: () => Promise<void>;
|
|
25
|
+
})[];
|
|
22
26
|
};
|
|
23
27
|
searchValues: I;
|
|
24
28
|
allSelected: boolean;
|
|
@@ -56,11 +60,15 @@ declare function useAntdTable<I, R extends Record<string, any>, S extends Servic
|
|
|
56
60
|
getCheckboxProps: () => {
|
|
57
61
|
className: string;
|
|
58
62
|
};
|
|
59
|
-
selections: boolean | {
|
|
63
|
+
selections: boolean | ({
|
|
60
64
|
key: string;
|
|
61
65
|
text: string;
|
|
62
66
|
onSelect: (changeableRowKeys: Key[]) => void;
|
|
63
|
-
}
|
|
67
|
+
} | {
|
|
68
|
+
key: string;
|
|
69
|
+
text: any;
|
|
70
|
+
onSelect: () => Promise<void>;
|
|
71
|
+
})[];
|
|
64
72
|
};
|
|
65
73
|
pagination: {
|
|
66
74
|
current: number;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
+
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
|
|
4
5
|
Object.defineProperty(exports, "__esModule", {
|
|
5
6
|
value: true
|
|
6
7
|
});
|
|
@@ -17,6 +18,7 @@ var _lodash = require("lodash");
|
|
|
17
18
|
var _antd = require("antd");
|
|
18
19
|
var _index = require("./index");
|
|
19
20
|
var _utils = require("./utils");
|
|
21
|
+
var _locale = _interopRequireWildcard(require("../locale"));
|
|
20
22
|
var _excluded = ["page", "filters", "sorter"];
|
|
21
23
|
var useDefaultOptions = function useDefaultOptions(options) {
|
|
22
24
|
var _useState = (0, _react.useState)((options === null || options === void 0 ? void 0 : options.page) || _index.defaultPage),
|
|
@@ -30,6 +32,7 @@ var useDefaultOptions = function useDefaultOptions(options) {
|
|
|
30
32
|
});
|
|
31
33
|
};
|
|
32
34
|
function useAntdTable(service, options, useRequestOptions) {
|
|
35
|
+
var _locale$ProTable2, _locale$ProTable3, _locale$ProTable4, _locale$ProTable5;
|
|
33
36
|
var _useSetState = (0, _ahooks.useSetState)({
|
|
34
37
|
data: [],
|
|
35
38
|
total: 0,
|
|
@@ -110,7 +113,8 @@ function useAntdTable(service, options, useRequestOptions) {
|
|
|
110
113
|
_ref2$total = _ref2.total,
|
|
111
114
|
total = _ref2$total === void 0 ? 0 : _ref2$total;
|
|
112
115
|
if (list !== null && !Array.isArray(list)) {
|
|
113
|
-
|
|
116
|
+
var _locale$ProTable;
|
|
117
|
+
return _antd.message.error(_locale.default === null || _locale.default === void 0 ? void 0 : (_locale$ProTable = _locale.default.ProTable) === null || _locale$ProTable === void 0 ? void 0 : _locale$ProTable.transformResponseMsg);
|
|
114
118
|
}
|
|
115
119
|
setState({
|
|
116
120
|
total: total,
|
|
@@ -346,7 +350,9 @@ function useAntdTable(service, options, useRequestOptions) {
|
|
|
346
350
|
},
|
|
347
351
|
selections: rowSelections ? [{
|
|
348
352
|
key: 'currentPage',
|
|
349
|
-
text:
|
|
353
|
+
text: (0, _locale.formatMessage)(_locale.default === null || _locale.default === void 0 ? void 0 : (_locale$ProTable2 = _locale.default.ProTable) === null || _locale$ProTable2 === void 0 ? void 0 : _locale$ProTable2.selectCurPage, {
|
|
354
|
+
total: (data === null || data === void 0 ? void 0 : data.length) || 0
|
|
355
|
+
}),
|
|
350
356
|
onSelect: function onSelect(changeableRowKeys) {
|
|
351
357
|
setState({
|
|
352
358
|
allSelected: false,
|
|
@@ -356,7 +362,9 @@ function useAntdTable(service, options, useRequestOptions) {
|
|
|
356
362
|
}
|
|
357
363
|
}, {
|
|
358
364
|
key: 'all',
|
|
359
|
-
text:
|
|
365
|
+
text: (0, _locale.formatMessage)(_locale.default === null || _locale.default === void 0 ? void 0 : (_locale$ProTable3 = _locale.default.ProTable) === null || _locale$ProTable3 === void 0 ? void 0 : _locale$ProTable3.selectAll, {
|
|
366
|
+
total: total
|
|
367
|
+
}),
|
|
360
368
|
onSelect: function () {
|
|
361
369
|
var _onSelect = (0, _asyncToGenerator2.default)( /*#__PURE__*/(0, _regeneratorRuntime2.default)().mark(function _callee2(changeableRowKeys) {
|
|
362
370
|
return (0, _regeneratorRuntime2.default)().wrap(function _callee2$(_context2) {
|
|
@@ -380,7 +388,7 @@ function useAntdTable(service, options, useRequestOptions) {
|
|
|
380
388
|
}()
|
|
381
389
|
}, {
|
|
382
390
|
key: 'uncheckAll',
|
|
383
|
-
text:
|
|
391
|
+
text: _locale.default === null || _locale.default === void 0 ? void 0 : (_locale$ProTable4 = _locale.default.ProTable) === null || _locale$ProTable4 === void 0 ? void 0 : _locale$ProTable4.deselect,
|
|
384
392
|
onSelect: function () {
|
|
385
393
|
var _onSelect2 = (0, _asyncToGenerator2.default)( /*#__PURE__*/(0, _regeneratorRuntime2.default)().mark(function _callee3() {
|
|
386
394
|
return (0, _regeneratorRuntime2.default)().wrap(function _callee3$(_context3) {
|
|
@@ -404,7 +412,9 @@ function useAntdTable(service, options, useRequestOptions) {
|
|
|
404
412
|
}()
|
|
405
413
|
}] : false
|
|
406
414
|
};
|
|
407
|
-
var selectedTip = allSelected || selectedRowKeys.length ?
|
|
415
|
+
var selectedTip = allSelected || selectedRowKeys.length ? (0, _locale.formatMessage)(_locale.default === null || _locale.default === void 0 ? void 0 : (_locale$ProTable5 = _locale.default.ProTable) === null || _locale$ProTable5 === void 0 ? void 0 : _locale$ProTable5.selectAll, {
|
|
416
|
+
selectedNum: allSelected ? total : selectedRowKeys === null || selectedRowKeys === void 0 ? void 0 : selectedRowKeys.length
|
|
417
|
+
}) : null;
|
|
408
418
|
var pagination = {
|
|
409
419
|
current: page.pageNum,
|
|
410
420
|
pageSize: page.pageSize,
|
|
@@ -413,8 +423,11 @@ function useAntdTable(service, options, useRequestOptions) {
|
|
|
413
423
|
onPaginationChange: true,
|
|
414
424
|
total: total,
|
|
415
425
|
showTotal: function showTotal(total) {
|
|
426
|
+
var _locale$ProTable6;
|
|
416
427
|
if (!total) return;
|
|
417
|
-
return
|
|
428
|
+
return (0, _locale.formatMessage)(_locale.default === null || _locale.default === void 0 ? void 0 : (_locale$ProTable6 = _locale.default.ProTable) === null || _locale$ProTable6 === void 0 ? void 0 : _locale$ProTable6.total, {
|
|
429
|
+
total: total
|
|
430
|
+
});
|
|
418
431
|
},
|
|
419
432
|
onShowSizeChange: handlePageChange,
|
|
420
433
|
onChange: handlePageChange
|
package/lib/ProTable/utils.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { ProTableColumn } from './propsType';
|
|
3
|
-
export declare const formatColumn: (column: ProTableColumn) => void;
|
|
3
|
+
export declare const formatColumn: (column: ProTableColumn, originalDataSource: any[]) => void;
|
|
4
4
|
export declare const getColumnDataIndex: (dataIndex: string | string[]) => string;
|
|
5
5
|
/**
|
|
6
6
|
* 查找最近的父级className
|