@zat-design/sisyphus-react 3.2.2 → 3.3.0-beta.2
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 +82 -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 +34 -20
- 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/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 +22 -24
- 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/RenderFields.js +4 -5
- package/es/ProForm/style/index.less +46 -44
- 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 +11 -8
- 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 +5 -1
- 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 +32 -18
- 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/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 +22 -24
- 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/RenderFields.js +4 -5
- package/lib/ProForm/style/index.less +46 -44
- 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 +11 -8
- 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 +5 -1
- 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
|
@@ -1,24 +1,54 @@
|
|
|
1
1
|
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
2
2
|
import "antd/es/input/style";
|
|
3
3
|
import _Input from "antd/es/input";
|
|
4
|
-
import
|
|
4
|
+
import "antd/es/select/style";
|
|
5
|
+
import _Select from "antd/es/select";
|
|
6
|
+
import "antd/es/space/style";
|
|
7
|
+
import _Space from "antd/es/space";
|
|
8
|
+
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
9
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
10
|
+
import { useEffect } from 'react';
|
|
5
11
|
import classNames from 'classnames';
|
|
6
12
|
import { CloseOutlined } from '@ant-design/icons';
|
|
7
13
|
import { ReactSVG } from 'react-svg';
|
|
14
|
+
import { useSetState } from 'ahooks';
|
|
8
15
|
import locale, { formatMessage } from '../../locale';
|
|
9
16
|
import viewSvg from '../../assets/view.svg';
|
|
10
17
|
function Trigger(props) {
|
|
11
|
-
var _locale$
|
|
12
|
-
var
|
|
13
|
-
handleClick = props.handleClick,
|
|
14
|
-
handleClearAll = props.handleClearAll,
|
|
15
|
-
value = props.value,
|
|
16
|
-
checkAll = props.checkAll,
|
|
18
|
+
var _locale$ProTreeModal2, _locale$ProTreeModal3;
|
|
19
|
+
var value = props.value,
|
|
17
20
|
disabled = props.disabled,
|
|
18
21
|
isView = props.isView,
|
|
19
|
-
triggerStyle = props.triggerStyle
|
|
20
|
-
|
|
21
|
-
|
|
22
|
+
triggerStyle = props.triggerStyle,
|
|
23
|
+
appoint = props.appoint,
|
|
24
|
+
allValue = props.allValue,
|
|
25
|
+
checkAll = props.checkAll,
|
|
26
|
+
checkedValues = props.checkedValues,
|
|
27
|
+
handleClick = props.handleClick,
|
|
28
|
+
handleClearAll = props.handleClearAll,
|
|
29
|
+
appointChange = props.appointChange;
|
|
30
|
+
var _useSetState = useSetState({
|
|
31
|
+
mode: 'appoint'
|
|
32
|
+
}),
|
|
33
|
+
_useSetState2 = _slicedToArray(_useSetState, 2),
|
|
34
|
+
state = _useSetState2[0],
|
|
35
|
+
setState = _useSetState2[1];
|
|
36
|
+
useEffect(function () {
|
|
37
|
+
if (checkAll && appoint) {
|
|
38
|
+
setState({
|
|
39
|
+
mode: 'all'
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
}, [checkAll]);
|
|
43
|
+
var onIconClick = function onIconClick() {
|
|
44
|
+
if (appoint && state.mode === 'all') {
|
|
45
|
+
return;
|
|
46
|
+
}
|
|
47
|
+
handleClick();
|
|
48
|
+
};
|
|
49
|
+
if (isView) {
|
|
50
|
+
var _locale$ProTreeModal;
|
|
51
|
+
return _jsxs("div", {
|
|
22
52
|
className: "pro-tree-modal-isView",
|
|
23
53
|
children: [_jsx("div", {
|
|
24
54
|
children: checkedValues.length === 0 ? '-' : checkAll ? locale === null || locale === void 0 ? void 0 : locale.ProTreeModal.checkAll : formatMessage(locale === null || locale === void 0 ? void 0 : (_locale$ProTreeModal = locale.ProTreeModal) === null || _locale$ProTreeModal === void 0 ? void 0 : _locale$ProTreeModal.checkNumber, {
|
|
@@ -29,11 +59,44 @@ function Trigger(props) {
|
|
|
29
59
|
children: _jsx(ReactSVG, {
|
|
30
60
|
className: "viewSvg",
|
|
31
61
|
src: viewSvg,
|
|
32
|
-
onClick:
|
|
62
|
+
onClick: onIconClick
|
|
33
63
|
})
|
|
34
64
|
})]
|
|
35
|
-
})
|
|
36
|
-
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
var onAppointChange = function onAppointChange(value) {
|
|
68
|
+
setState({
|
|
69
|
+
mode: value
|
|
70
|
+
});
|
|
71
|
+
if (value === 'all') {
|
|
72
|
+
appointChange === null || appointChange === void 0 ? void 0 : appointChange(true);
|
|
73
|
+
} else {
|
|
74
|
+
appointChange === null || appointChange === void 0 ? void 0 : appointChange(false);
|
|
75
|
+
}
|
|
76
|
+
};
|
|
77
|
+
var TriggerComponent = function TriggerComponent(props) {
|
|
78
|
+
if (appoint) {
|
|
79
|
+
return _jsxs(_Space.Compact, {
|
|
80
|
+
block: true,
|
|
81
|
+
children: [_jsxs(_Select, {
|
|
82
|
+
defaultValue: "appoint",
|
|
83
|
+
value: state.mode,
|
|
84
|
+
onChange: onAppointChange,
|
|
85
|
+
children: [_jsx(_Select.Option, {
|
|
86
|
+
value: "all",
|
|
87
|
+
children: "\u5168\u90E8"
|
|
88
|
+
}), _jsx(_Select.Option, {
|
|
89
|
+
value: "appoint",
|
|
90
|
+
children: "\u6307\u5B9A"
|
|
91
|
+
})]
|
|
92
|
+
}), props.children]
|
|
93
|
+
});
|
|
94
|
+
}
|
|
95
|
+
return props.children;
|
|
96
|
+
};
|
|
97
|
+
return _jsx(TriggerComponent, {
|
|
98
|
+
children: _jsx(_Input, {
|
|
99
|
+
className: classNames(disabled ? 'trigger-no-hover' : '', appoint ? 'pro-tree-modal-input-appoint' : ''),
|
|
37
100
|
onClick: handleClick,
|
|
38
101
|
value: checkedValues.length === 0 ? null : checkAll ? locale === null || locale === void 0 ? void 0 : locale.ProTreeModal.checkAll : formatMessage(locale === null || locale === void 0 ? void 0 : (_locale$ProTreeModal2 = locale.ProTreeModal) === null || _locale$ProTreeModal2 === void 0 ? void 0 : _locale$ProTreeModal2.checkNumber, {
|
|
39
102
|
num: checkedValues.length
|
|
@@ -48,16 +111,13 @@ function Trigger(props) {
|
|
|
48
111
|
}), _jsx(ReactSVG, {
|
|
49
112
|
className: "viewSvg",
|
|
50
113
|
src: viewSvg,
|
|
51
|
-
onClick:
|
|
114
|
+
onClick: onIconClick
|
|
52
115
|
})]
|
|
53
116
|
}),
|
|
54
117
|
placeholder: locale === null || locale === void 0 ? void 0 : (_locale$ProTreeModal3 = locale.ProTreeModal) === null || _locale$ProTreeModal3 === void 0 ? void 0 : _locale$ProTreeModal3.select,
|
|
55
|
-
disabled: disabled,
|
|
118
|
+
disabled: disabled || appoint && value === allValue,
|
|
56
119
|
style: _objectSpread({}, triggerStyle)
|
|
57
|
-
})
|
|
58
|
-
type: "hidden",
|
|
59
|
-
value: value
|
|
60
|
-
})]
|
|
120
|
+
})
|
|
61
121
|
});
|
|
62
122
|
}
|
|
63
123
|
export default Trigger;
|
package/es/ProTreeModal/index.js
CHANGED
|
@@ -57,6 +57,7 @@ var ProTreeModal = function ProTreeModal(props) {
|
|
|
57
57
|
max = props.max,
|
|
58
58
|
draggable = props.draggable,
|
|
59
59
|
span = props.span,
|
|
60
|
+
appoint = props.appoint,
|
|
60
61
|
_props$fieldNames = props.fieldNames,
|
|
61
62
|
fieldNames = _props$fieldNames === void 0 ? {
|
|
62
63
|
label: 'label',
|
|
@@ -77,6 +78,7 @@ var ProTreeModal = function ProTreeModal(props) {
|
|
|
77
78
|
var _useSetState = useSetState({
|
|
78
79
|
open: false,
|
|
79
80
|
checkedValues: [],
|
|
81
|
+
beforeClearAllValues: [],
|
|
80
82
|
treeData: [],
|
|
81
83
|
treeViewData: [],
|
|
82
84
|
originalTreeData: [],
|
|
@@ -263,6 +265,7 @@ var ProTreeModal = function ProTreeModal(props) {
|
|
|
263
265
|
}) : [];
|
|
264
266
|
setState({
|
|
265
267
|
checkedValues: _checkedValues,
|
|
268
|
+
beforeClearAllValues: state.checkedValues,
|
|
266
269
|
treeViewData: [],
|
|
267
270
|
checkAll: false
|
|
268
271
|
});
|
|
@@ -271,9 +274,18 @@ var ProTreeModal = function ProTreeModal(props) {
|
|
|
271
274
|
* Drawer close
|
|
272
275
|
*/
|
|
273
276
|
var handleClose = function handleClose() {
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
+
var _state$beforeClearAll;
|
|
278
|
+
if ((_state$beforeClearAll = state.beforeClearAllValues) === null || _state$beforeClearAll === void 0 ? void 0 : _state$beforeClearAll.length) {
|
|
279
|
+
setState({
|
|
280
|
+
open: false,
|
|
281
|
+
checkedValues: state.beforeClearAllValues,
|
|
282
|
+
beforeClearAllValues: []
|
|
283
|
+
});
|
|
284
|
+
} else {
|
|
285
|
+
setState({
|
|
286
|
+
open: false
|
|
287
|
+
});
|
|
288
|
+
}
|
|
277
289
|
openChange === null || openChange === void 0 ? void 0 : openChange(false);
|
|
278
290
|
};
|
|
279
291
|
/**
|
|
@@ -458,6 +470,23 @@ var ProTreeModal = function ProTreeModal(props) {
|
|
|
458
470
|
});
|
|
459
471
|
}
|
|
460
472
|
};
|
|
473
|
+
/**
|
|
474
|
+
* 指定模式下的操作
|
|
475
|
+
* @param appoint
|
|
476
|
+
*/
|
|
477
|
+
var appointChange = function appointChange(appoint) {
|
|
478
|
+
if (appoint) {
|
|
479
|
+
onChange === null || onChange === void 0 ? void 0 : onChange(allValue);
|
|
480
|
+
setState({
|
|
481
|
+
checkAll: true
|
|
482
|
+
});
|
|
483
|
+
} else {
|
|
484
|
+
onChange === null || onChange === void 0 ? void 0 : onChange([]);
|
|
485
|
+
setState({
|
|
486
|
+
checkAll: false
|
|
487
|
+
});
|
|
488
|
+
}
|
|
489
|
+
};
|
|
461
490
|
/**
|
|
462
491
|
* Trigger the container opened by Drawer
|
|
463
492
|
* default example and you can customize trigger={<Button>打开</Button>}
|
|
@@ -473,12 +502,15 @@ var ProTreeModal = function ProTreeModal(props) {
|
|
|
473
502
|
return _jsx(Trigger, {
|
|
474
503
|
checkedValues: state.checkedValues,
|
|
475
504
|
value: value,
|
|
476
|
-
handleClick: handleClick,
|
|
477
|
-
handleClearAll: handleClearAll,
|
|
478
505
|
checkAll: state.checkAll,
|
|
479
506
|
triggerStyle: style,
|
|
480
507
|
disabled: disabled,
|
|
481
|
-
isView: isView
|
|
508
|
+
isView: isView,
|
|
509
|
+
appoint: appoint,
|
|
510
|
+
allValue: allValue,
|
|
511
|
+
handleClick: handleClick,
|
|
512
|
+
handleClearAll: handleClearAll,
|
|
513
|
+
appointChange: appointChange
|
|
482
514
|
});
|
|
483
515
|
}, [state.checkedValues, state.checkAll, style, disabled, isView]);
|
|
484
516
|
/**
|
|
@@ -21,6 +21,7 @@ export interface FieldNamesType {
|
|
|
21
21
|
value: string;
|
|
22
22
|
children?: string;
|
|
23
23
|
}
|
|
24
|
+
export type TreeModalMode = 'tree' | 'list' | 'Cascader' | 'Tree' | 'List';
|
|
24
25
|
export interface ProTreeModalProps {
|
|
25
26
|
/** value */
|
|
26
27
|
value?: AllValueType | string[];
|
|
@@ -30,8 +31,10 @@ export interface ProTreeModalProps {
|
|
|
30
31
|
open?: boolean;
|
|
31
32
|
/** 列表时候一行放几个 */
|
|
32
33
|
span?: number;
|
|
33
|
-
/** 展示类型、默认list
|
|
34
|
-
mode?:
|
|
34
|
+
/** 展示类型、默认list 列表展示形式、appoint 指定模式展示形式会不一样 */
|
|
35
|
+
mode?: TreeModalMode;
|
|
36
|
+
/** 是否开启指定模式 */
|
|
37
|
+
appoint?: boolean;
|
|
35
38
|
/** 开启后、提交给后端 [{ label:xx, value: ""}] 形式 */
|
|
36
39
|
labelInValue?: boolean;
|
|
37
40
|
/** 查看模式、同 disabled 一样 */
|
|
@@ -1,4 +1,7 @@
|
|
|
1
|
-
|
|
1
|
+
@root-entry-name: 'default';
|
|
2
|
+
@import (reference) '~antd/es/style/themes/index.less';
|
|
3
|
+
|
|
4
|
+
.pro-tree-modal-container .@{ant-prefix}-modal-content .@{ant-prefix}-modal-body {
|
|
2
5
|
max-height: 498px;
|
|
3
6
|
}
|
|
4
7
|
|
|
@@ -13,16 +16,16 @@
|
|
|
13
16
|
height : 482px;
|
|
14
17
|
margin-bottom : calc(var(--zaui-space-size-md; 16px) * var(--zaui-size; 1));
|
|
15
18
|
|
|
16
|
-
|
|
19
|
+
.@{ant-prefix}-tree-checkbox {
|
|
17
20
|
margin-top: 2px;
|
|
18
21
|
}
|
|
19
22
|
|
|
20
|
-
|
|
23
|
+
.@{ant-prefix}-tree-switcher {
|
|
21
24
|
width : 20px;
|
|
22
25
|
line-height: 20px;
|
|
23
26
|
}
|
|
24
27
|
|
|
25
|
-
|
|
28
|
+
.@{ant-prefix}-tree-treenode {
|
|
26
29
|
width : 100%;
|
|
27
30
|
padding : 0;
|
|
28
31
|
padding-bottom: var(--zaui-font-size-sm, 12px);
|
|
@@ -31,12 +34,12 @@
|
|
|
31
34
|
line-height : 20px;
|
|
32
35
|
}
|
|
33
36
|
|
|
34
|
-
|
|
37
|
+
.@{ant-prefix}-tree-node-content-wrapper {
|
|
35
38
|
min-height : 20px;
|
|
36
39
|
line-height: 20px;
|
|
37
40
|
}
|
|
38
41
|
|
|
39
|
-
|
|
42
|
+
.@{ant-prefix}-tree-node-content-wrapper {
|
|
40
43
|
width: 100%;
|
|
41
44
|
}
|
|
42
45
|
}
|
|
@@ -113,7 +116,7 @@
|
|
|
113
116
|
color: #616161;
|
|
114
117
|
}
|
|
115
118
|
|
|
116
|
-
|
|
119
|
+
.@{ant-prefix}-btn-link {
|
|
117
120
|
padding: 0;
|
|
118
121
|
}
|
|
119
122
|
}
|
|
@@ -223,7 +226,7 @@
|
|
|
223
226
|
margin-top: 0;
|
|
224
227
|
}
|
|
225
228
|
|
|
226
|
-
|
|
229
|
+
.@{ant-prefix}-tag {
|
|
227
230
|
display : flex;
|
|
228
231
|
align-items : center;
|
|
229
232
|
justify-content: space-between;
|
|
@@ -8,7 +8,7 @@ import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
|
8
8
|
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
9
9
|
import "antd/es/tree-select/style";
|
|
10
10
|
import _TreeSelect from "antd/es/tree-select";
|
|
11
|
-
var _excluded = ["disabled", "code", "dataSource", "defaultDisableValue", "onChange", "useRequest", "transformResponse", "fieldNames", "tooltip", "showSearch", "filterTreeNode", "treeNodeFilterProp", "
|
|
11
|
+
var _excluded = ["disabled", "code", "dataSource", "defaultDisableValue", "onChange", "useRequest", "transformResponse", "fieldNames", "tooltip", "showSearch", "filterTreeNode", "treeNodeFilterProp", "defaultExpandAll", "expandedKeys", "treeCheckable", "onSearch", "otherProps", "width", "dropdownStyle", "popupClassName", "style", "allowClear", "listHeight", "showCodeName", "className"],
|
|
12
12
|
_excluded2 = ["children"];
|
|
13
13
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
14
14
|
import { useDeepCompareEffect, useRequest as useRequestFunc, useSetState } from 'ahooks';
|
|
@@ -49,8 +49,9 @@ export var ProTreeSelect = function ProTreeSelect(props, ref) {
|
|
|
49
49
|
filterTreeNode = props.filterTreeNode,
|
|
50
50
|
_props$treeNodeFilter = props.treeNodeFilterProp,
|
|
51
51
|
treeNodeFilterProp = _props$treeNodeFilter === void 0 ? 'label' : _props$treeNodeFilter,
|
|
52
|
-
_props$
|
|
53
|
-
|
|
52
|
+
_props$defaultExpandA = props.defaultExpandAll,
|
|
53
|
+
defaultExpandAll = _props$defaultExpandA === void 0 ? true : _props$defaultExpandA,
|
|
54
|
+
expandedKeys = props.expandedKeys,
|
|
54
55
|
_props$treeCheckable = props.treeCheckable,
|
|
55
56
|
treeCheckable = _props$treeCheckable === void 0 ? true : _props$treeCheckable,
|
|
56
57
|
_onSearch = props.onSearch,
|
|
@@ -475,7 +476,8 @@ export var ProTreeSelect = function ProTreeSelect(props, ref) {
|
|
|
475
476
|
disabled: disabled,
|
|
476
477
|
showSearch: showSearch,
|
|
477
478
|
// filterTreeNode: filterTreeNodeEvent,
|
|
478
|
-
treeDefaultExpandAll:
|
|
479
|
+
treeDefaultExpandAll: defaultExpandAll,
|
|
480
|
+
treeExpandedKeys: expandedKeys,
|
|
479
481
|
treeCheckable: treeCheckable,
|
|
480
482
|
showCheckedStrategy: SHOW_PARENT,
|
|
481
483
|
value: value,
|
|
@@ -69,6 +69,8 @@ export interface PropTreeSelectProps extends Omit<TreeSelectProps, 'onSearch'> {
|
|
|
69
69
|
service: Service<any, any>;
|
|
70
70
|
options?: Options<any, any>;
|
|
71
71
|
};
|
|
72
|
+
defaultExpandAll?: boolean;
|
|
73
|
+
expandedKeys?: any[];
|
|
72
74
|
}
|
|
73
75
|
export interface ProSelectAction {
|
|
74
76
|
/** 获取发生请求的 useRequest 的 ref */
|
|
@@ -1,13 +1,16 @@
|
|
|
1
|
+
@root-entry-name: 'default';
|
|
2
|
+
@import (reference) '~antd/es/style/themes/index.less';
|
|
3
|
+
|
|
1
4
|
.pro-tree-select{
|
|
2
|
-
|
|
5
|
+
.@{ant-prefix}-select-selector{
|
|
3
6
|
// 单选树选择结果框里title不用待后缀
|
|
4
7
|
.check-mark-icon{
|
|
5
8
|
display: none;
|
|
6
9
|
}
|
|
7
10
|
}
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
+
.@{ant-prefix}-select.@{ant-prefix}-select-single.@{ant-prefix}-select-show-arrow:not(.@{ant-prefix}-select-show-search){
|
|
12
|
+
&.@{ant-prefix}-select-open{
|
|
13
|
+
.@{ant-prefix}-select-arrow{
|
|
11
14
|
transition: transform 300ms ease-in-out;
|
|
12
15
|
transform: rotate(180deg);
|
|
13
16
|
}
|
|
@@ -15,20 +18,20 @@
|
|
|
15
18
|
}
|
|
16
19
|
}
|
|
17
20
|
.pro-tree-select-drop-down-container{
|
|
18
|
-
|
|
21
|
+
&.@{ant-prefix}-select-dropdown{
|
|
19
22
|
.highlight-search-text{
|
|
20
23
|
color: @zaui-brand;
|
|
21
24
|
}
|
|
22
|
-
|
|
25
|
+
.@{ant-prefix}-select-tree-list-holder-inner{
|
|
23
26
|
position: relative!important;
|
|
24
27
|
}
|
|
25
|
-
|
|
28
|
+
&.@{ant-prefix}-tree-select-dropdown{
|
|
26
29
|
width: auto!important;
|
|
27
30
|
padding: 0px;
|
|
28
31
|
}
|
|
29
32
|
&.singal-tree,&.checkable-tree{
|
|
30
|
-
|
|
31
|
-
|
|
33
|
+
.@{ant-prefix}-select-tree{
|
|
34
|
+
.@{ant-prefix}-select-tree-treenode{
|
|
32
35
|
padding-top: var(--zaui-space-size-xs);
|
|
33
36
|
padding-bottom: var(--zaui-space-size-xs);
|
|
34
37
|
}
|
|
@@ -39,8 +42,8 @@
|
|
|
39
42
|
}
|
|
40
43
|
// 单选
|
|
41
44
|
&.signal-tree{
|
|
42
|
-
|
|
43
|
-
|
|
45
|
+
.@{ant-prefix}-select-tree{
|
|
46
|
+
.@{ant-prefix}-select-tree-treenode{
|
|
44
47
|
position: relative;
|
|
45
48
|
padding-right: 50px;
|
|
46
49
|
padding-left: 7px;
|
|
@@ -56,19 +59,19 @@
|
|
|
56
59
|
background-color: @zaui-brand;
|
|
57
60
|
opacity: 0.1;
|
|
58
61
|
}
|
|
59
|
-
|
|
62
|
+
&.@{ant-prefix}-select-tree-treenode-selected:after{
|
|
60
63
|
display: block;
|
|
61
64
|
}
|
|
62
65
|
}
|
|
63
|
-
|
|
66
|
+
.@{ant-prefix}-select-tree-node-content-wrapper{
|
|
64
67
|
background-color: transparent;
|
|
65
|
-
|
|
68
|
+
&.@{ant-prefix}-select-tree-node-selected{
|
|
66
69
|
.check-mark-icon{
|
|
67
70
|
display: block;
|
|
68
71
|
}
|
|
69
72
|
}
|
|
70
73
|
}
|
|
71
|
-
|
|
74
|
+
.@{ant-prefix}-select-tree-treenode:hover{
|
|
72
75
|
background-color: #f5f5f5;
|
|
73
76
|
}
|
|
74
77
|
.check-option-text{
|
|
@@ -84,20 +87,20 @@
|
|
|
84
87
|
}
|
|
85
88
|
// 复选
|
|
86
89
|
&.checkable-tree{
|
|
87
|
-
|
|
88
|
-
|
|
90
|
+
.@{ant-prefix}-select-tree{
|
|
91
|
+
.@{ant-prefix}-select-tree-treenode{
|
|
89
92
|
padding-left: 7px;
|
|
90
93
|
}
|
|
91
|
-
|
|
94
|
+
.@{ant-prefix}-select-tree-treenode:hover{
|
|
92
95
|
background-color: #f5f5f5;
|
|
93
96
|
}
|
|
94
|
-
|
|
97
|
+
.@{ant-prefix}-select-tree-node-content-wrapper{
|
|
95
98
|
padding-right: var(--zaui-space-size-md);
|
|
96
99
|
}
|
|
97
|
-
|
|
100
|
+
.@{ant-prefix}-select-tree-node-content-wrapper:hover{
|
|
98
101
|
background-color: transparent;
|
|
99
102
|
}
|
|
100
|
-
|
|
103
|
+
.@{ant-prefix}-select-tree-checkbox{
|
|
101
104
|
margin-top: var(--zaui-space-size-xs);
|
|
102
105
|
align-self: stretch;
|
|
103
106
|
}
|
|
@@ -105,7 +108,7 @@
|
|
|
105
108
|
}
|
|
106
109
|
// 数据小于10条
|
|
107
110
|
&.ten-count-tree-node{
|
|
108
|
-
|
|
111
|
+
.@{ant-prefix}-select-tree-switcher-noop{
|
|
109
112
|
width: var(--zaui-space-size-xs);
|
|
110
113
|
}
|
|
111
114
|
}
|
|
@@ -11,7 +11,7 @@ import { DraggableUploadListItem } from './DraggableUploadListItem';
|
|
|
11
11
|
import locale from '../../locale';
|
|
12
12
|
var Dragger = _Upload.Dragger;
|
|
13
13
|
var DragRender = function DragRender(props) {
|
|
14
|
-
var _locale$ProUpload3, _locale$ProUpload4, _locale$ProUpload5;
|
|
14
|
+
var _locale$ProUpload3, _locale$ProUpload4, _locale$ProUpload5, _locale$ProUpload6;
|
|
15
15
|
var isView = props.isView,
|
|
16
16
|
baseUploadProps = props.baseUploadProps,
|
|
17
17
|
disabled = props.disabled,
|
|
@@ -132,13 +132,16 @@ var DragRender = function DragRender(props) {
|
|
|
132
132
|
children: [_jsx("i", {
|
|
133
133
|
className: "icon-upload",
|
|
134
134
|
children: _jsx(CloudUploadOutlined, {})
|
|
135
|
-
}),
|
|
135
|
+
}), _jsxs("p", {
|
|
136
136
|
className: "dragger-txt",
|
|
137
|
-
children: locale === null || locale === void 0 ? void 0 : (_locale$ProUpload3 = locale.ProUpload) === null || _locale$ProUpload3 === void 0 ? void 0 : _locale$ProUpload3.draggerTips
|
|
137
|
+
children: [locale === null || locale === void 0 ? void 0 : (_locale$ProUpload3 = locale.ProUpload) === null || _locale$ProUpload3 === void 0 ? void 0 : _locale$ProUpload3.draggerTips, _jsxs("span", {
|
|
138
|
+
className: "click-txt",
|
|
139
|
+
children: [locale === null || locale === void 0 ? void 0 : (_locale$ProUpload4 = locale.ProUpload) === null || _locale$ProUpload4 === void 0 ? void 0 : _locale$ProUpload4.draggerBtnTxt, " "]
|
|
140
|
+
})]
|
|
138
141
|
})]
|
|
139
142
|
}), _jsxs("p", {
|
|
140
143
|
className: "file-ext",
|
|
141
|
-
children: [locale === null || locale === void 0 ? void 0 : (_locale$
|
|
144
|
+
children: [locale === null || locale === void 0 ? void 0 : (_locale$ProUpload5 = locale.ProUpload) === null || _locale$ProUpload5 === void 0 ? void 0 : _locale$ProUpload5.draggerFileExt, "\uFF1A", extExt.length > 0 ? extExt.join('、') : "".concat(locale === null || locale === void 0 ? void 0 : (_locale$ProUpload6 = locale.ProUpload) === null || _locale$ProUpload6 === void 0 ? void 0 : _locale$ProUpload6.draggerLimitless)]
|
|
142
145
|
})]
|
|
143
146
|
}), _jsx("div", {
|
|
144
147
|
className: "dragger-file-show",
|
|
@@ -17,7 +17,7 @@ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-run
|
|
|
17
17
|
* @Author: wangshengqiang
|
|
18
18
|
* @Date: 2023-07-27 20:13:07
|
|
19
19
|
* @LastEditors: wangshengqiang
|
|
20
|
-
* @LastEditTime: 2023-11-
|
|
20
|
+
* @LastEditTime: 2023-11-15 17:57:53
|
|
21
21
|
* @Description: 图片类型
|
|
22
22
|
*
|
|
23
23
|
*/
|
|
@@ -252,8 +252,12 @@ var ImageRender = function ImageRender(props) {
|
|
|
252
252
|
}), _jsx(_Modal, {
|
|
253
253
|
title: previewImg === null || previewImg === void 0 ? void 0 : previewImg.name,
|
|
254
254
|
width: "600",
|
|
255
|
+
style: {
|
|
256
|
+
width: '400px'
|
|
257
|
+
},
|
|
255
258
|
open: !!(previewImg === null || previewImg === void 0 ? void 0 : previewImg.url),
|
|
256
259
|
// showType="Modal"
|
|
260
|
+
wrapClassName: "proupload-modal-preview",
|
|
257
261
|
onCancel: handlePreviewCancel,
|
|
258
262
|
footer: false,
|
|
259
263
|
children: _jsx("img", {
|
package/es/ProUpload/index.js
CHANGED
|
@@ -8,7 +8,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
8
8
|
/*
|
|
9
9
|
* @Author: wangshengqiang
|
|
10
10
|
* @Date: 2023-02-03 14:18:59
|
|
11
|
-
* @LastEditTime: 2023-11-
|
|
11
|
+
* @LastEditTime: 2023-11-14 18:32:13
|
|
12
12
|
* @LastEditors: wangshengqiang
|
|
13
13
|
* @Description: 上传控件
|
|
14
14
|
*/
|
|
@@ -16,6 +16,7 @@ import React, { useEffect, useState, useImperativeHandle } from 'react';
|
|
|
16
16
|
import { isFunction } from 'lodash';
|
|
17
17
|
import { PointerSensor, useSensor } from '@dnd-kit/core';
|
|
18
18
|
import { arrayMove } from '@dnd-kit/sortable';
|
|
19
|
+
import { useProConfig } from '../ProConfigProvider';
|
|
19
20
|
import DragRender from './components/DragRender';
|
|
20
21
|
import ButtonRender from './components/ButtonRender';
|
|
21
22
|
import ImageRender from './components/ImageRender';
|
|
@@ -72,6 +73,9 @@ var ProUpload = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
72
73
|
distance: 10
|
|
73
74
|
}
|
|
74
75
|
});
|
|
76
|
+
var _ref = useProConfig('ProUpload') || {},
|
|
77
|
+
headers = _ref.headers;
|
|
78
|
+
residueProps.headers = _objectSpread(_objectSpread({}, headers), residueProps.headers);
|
|
75
79
|
var extExt = accept ? accept.split(',').map(function (i) {
|
|
76
80
|
return i.toLocaleUpperCase();
|
|
77
81
|
}) : [];
|
|
@@ -139,9 +143,9 @@ var ProUpload = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
139
143
|
* @description: 文件列表变化
|
|
140
144
|
* @return {*}
|
|
141
145
|
*/
|
|
142
|
-
var handleFileChange = function handleFileChange(
|
|
143
|
-
var file =
|
|
144
|
-
fileList =
|
|
146
|
+
var handleFileChange = function handleFileChange(_ref2) {
|
|
147
|
+
var file = _ref2.file,
|
|
148
|
+
fileList = _ref2.fileList;
|
|
145
149
|
if (!file.status && action && !ref) {
|
|
146
150
|
var nFileList = fileList.filter(function (f) {
|
|
147
151
|
return f.uid !== file.uid;
|
|
@@ -210,9 +214,9 @@ var ProUpload = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
210
214
|
}
|
|
211
215
|
return footerRender;
|
|
212
216
|
};
|
|
213
|
-
var onDragEnd = function onDragEnd(
|
|
214
|
-
var active =
|
|
215
|
-
over =
|
|
217
|
+
var onDragEnd = function onDragEnd(_ref3) {
|
|
218
|
+
var active = _ref3.active,
|
|
219
|
+
over = _ref3.over;
|
|
216
220
|
if (active.id !== (over === null || over === void 0 ? void 0 : over.id)) {
|
|
217
221
|
setFileList(function (prev) {
|
|
218
222
|
var activeIndex = prev.findIndex(function (i) {
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
@root-entry-name: 'default';
|
|
2
|
+
@import (reference) '~antd/es/style/themes/index.less';
|
|
3
|
+
|
|
1
4
|
.pro-upload {
|
|
2
5
|
// display: inline-flex;
|
|
3
6
|
|
|
@@ -8,7 +11,7 @@
|
|
|
8
11
|
border-radius: var(--zaui-border-radius, 4px);
|
|
9
12
|
padding : var(--zaui-space-size-sm, 8px);
|
|
10
13
|
|
|
11
|
-
|
|
14
|
+
.@{ant-prefix}-upload.@{ant-prefix}-upload-drag {
|
|
12
15
|
background-color: var(--zaui-base-bg, #fff);
|
|
13
16
|
}
|
|
14
17
|
|
|
@@ -158,8 +161,8 @@
|
|
|
158
161
|
position: relative;
|
|
159
162
|
display : inline-flex;
|
|
160
163
|
|
|
161
|
-
|
|
162
|
-
|
|
164
|
+
.@{ant-prefix}-upload-list-picture-card-container,
|
|
165
|
+
.@{ant-prefix}-upload-select-picture-card {
|
|
163
166
|
width : 126px;
|
|
164
167
|
height: 126px;
|
|
165
168
|
}
|
|
@@ -271,7 +274,7 @@
|
|
|
271
274
|
}
|
|
272
275
|
|
|
273
276
|
.pro-upload-image {
|
|
274
|
-
|
|
277
|
+
.@{ant-prefix}-space-item {
|
|
275
278
|
display: inline-flex;
|
|
276
279
|
}
|
|
277
280
|
|
|
@@ -319,3 +322,9 @@
|
|
|
319
322
|
align-items : center;
|
|
320
323
|
justify-content: center;
|
|
321
324
|
}
|
|
325
|
+
|
|
326
|
+
.proupload-modal-preview {
|
|
327
|
+
.ant-modal {
|
|
328
|
+
width: 600px;
|
|
329
|
+
}
|
|
330
|
+
}
|
package/es/ProViewer/index.js
CHANGED
|
@@ -8,10 +8,12 @@ import _Button from "antd/es/button";
|
|
|
8
8
|
import _regeneratorRuntime from "@babel/runtime/helpers/esm/regeneratorRuntime";
|
|
9
9
|
import _asyncToGenerator from "@babel/runtime/helpers/esm/asyncToGenerator";
|
|
10
10
|
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
11
|
+
var _locale$ProViewer;
|
|
11
12
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
12
13
|
/* eslint-disable jsx-a11y/iframe-has-title */
|
|
13
14
|
import { useSetState } from 'ahooks';
|
|
14
15
|
import React, { useEffect, useRef } from 'react';
|
|
16
|
+
import locale from '../locale';
|
|
15
17
|
// 用于解析word | excel
|
|
16
18
|
var officeApp = 'https://view.officeapps.live.com/op/view.aspx?src=';
|
|
17
19
|
// 文件MIME类型
|
|
@@ -199,7 +201,7 @@ ProViewer.defaultProps = {
|
|
|
199
201
|
width: '1200px',
|
|
200
202
|
height: '650px',
|
|
201
203
|
centered: true,
|
|
202
|
-
title:
|
|
204
|
+
title: locale === null || locale === void 0 ? void 0 : (_locale$ProViewer = locale.ProViewer) === null || _locale$ProViewer === void 0 ? void 0 : _locale$ProViewer.preview,
|
|
203
205
|
footer: null,
|
|
204
206
|
bodyStyle: {
|
|
205
207
|
padding: 0
|
|
@@ -1,7 +1,10 @@
|
|
|
1
|
+
@root-entry-name: 'default';
|
|
2
|
+
@import (reference) '~antd/es/style/themes/index.less';
|
|
3
|
+
|
|
1
4
|
.pro-viewer {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
+
.@{ant-prefix}-image {
|
|
6
|
+
.@{ant-prefix}-image-img,
|
|
7
|
+
.@{ant-prefix}-image-mask-info {
|
|
5
8
|
display: none;
|
|
6
9
|
}
|
|
7
10
|
}
|
package/es/locale/en_US.d.ts
CHANGED
|
@@ -101,6 +101,7 @@ declare const _default: {
|
|
|
101
101
|
ProModalSelect: {
|
|
102
102
|
checkMsg: string;
|
|
103
103
|
select: string;
|
|
104
|
+
total: string;
|
|
104
105
|
};
|
|
105
106
|
ProSelect: {
|
|
106
107
|
checkMsg: string;
|
|
@@ -148,5 +149,8 @@ declare const _default: {
|
|
|
148
149
|
tableStripe: string;
|
|
149
150
|
reset: string;
|
|
150
151
|
};
|
|
152
|
+
ProViewer: {
|
|
153
|
+
preview: string;
|
|
154
|
+
};
|
|
151
155
|
};
|
|
152
156
|
export default _default;
|