@chaoswise/ui 3.1.0 → 3.1.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/lib/Antd5/app/style/index.js +2 -1
- package/lib/Antd5/breadcrumb/style/index.js +1 -1
- package/lib/Antd5/checkbox/Checkbox.js +33 -5
- package/lib/Antd5/checkbox/Group.js +7 -2
- package/lib/Antd5/checkbox/assets/duigou1.js +29 -0
- package/lib/Antd5/checkbox/assets/duigou2.js +29 -0
- package/lib/Antd5/checkbox/style/index.js +106 -3
- package/lib/Antd5/message/PurePanel.js +40 -22
- package/lib/Antd5/message/assets/Close.js +22 -0
- package/lib/Antd5/message/style/index.js +47 -8
- package/lib/Antd5/message/useMessage.js +15 -3
- package/lib/Antd5/radio/radio.js +4 -10
- package/lib/Antd5/radio/style/index.js +65 -80
- package/lib/Antd5/upload/Upload.js +83 -55
- package/lib/Antd5/upload/UploadList/ListItem.js +9 -15
- package/lib/Antd5/upload/UploadList/index.js +47 -33
- package/lib/Antd5/upload/style/dragger.js +26 -5
- package/lib/Antd5/upload/style/list.js +7 -2
- package/lib/AppHolder/index.js +2 -1
- package/lib/ConfigProvider/ConfigProvider.js +2 -0
- package/lib/ConfigProvider/theme/default.js +9 -2
- package/lib/Header/UserSetting/TenantTree.js +0 -1
- package/lib/Pagination/index.style.js +1 -1
- package/lib/SiderMenu/index.style.js +4 -2
- package/lib/Slider/index.style.js +2 -1
- package/package.json +1 -1
|
@@ -22,7 +22,6 @@ import PaperClipOutlined from '@ant-design/icons/PaperClipOutlined';
|
|
|
22
22
|
import PictureTwoTone from '@ant-design/icons/PictureTwoTone';
|
|
23
23
|
import classNames from 'classnames';
|
|
24
24
|
import CSSMotion, { CSSMotionList } from 'rc-motion';
|
|
25
|
-
import omit from 'rc-util/lib/omit';
|
|
26
25
|
import useForceUpdate from '../../_util/hooks/useForceUpdate';
|
|
27
26
|
import initCollapseMotion from '../../_util/motion';
|
|
28
27
|
import { cloneElement } from '../../_util/reactNode';
|
|
@@ -54,7 +53,6 @@ var InternalUploadList = function InternalUploadList(props, ref) {
|
|
|
54
53
|
removeIcon = props.removeIcon,
|
|
55
54
|
previewIcon = props.previewIcon,
|
|
56
55
|
downloadIcon = props.downloadIcon,
|
|
57
|
-
extra = props.extra,
|
|
58
56
|
_props$progress = props.progress,
|
|
59
57
|
progress = _props$progress === void 0 ? {
|
|
60
58
|
size: [-1, 2],
|
|
@@ -70,22 +68,22 @@ var InternalUploadList = function InternalUploadList(props, ref) {
|
|
|
70
68
|
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
71
69
|
motionAppear = _React$useState2[0],
|
|
72
70
|
setMotionAppear = _React$useState2[1];
|
|
73
|
-
var isPictureCardOrCirle = ['picture-card', 'picture-circle'].includes(listType);
|
|
74
71
|
// ============================= Effect =============================
|
|
75
72
|
React.useEffect(function () {
|
|
76
|
-
if (
|
|
73
|
+
if (listType !== 'picture' && listType !== 'picture-card' && listType !== 'picture-circle') {
|
|
77
74
|
return;
|
|
78
75
|
}
|
|
79
76
|
(items || []).forEach(function (file) {
|
|
80
|
-
if (!(file.originFileObj instanceof File || file.originFileObj
|
|
77
|
+
if (typeof document === 'undefined' || typeof window === 'undefined' || !window.FileReader || !window.File || !(file.originFileObj instanceof File || file.originFileObj) || file.thumbUrl !== undefined) {
|
|
81
78
|
return;
|
|
82
79
|
}
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
80
|
+
if (previewFile) {
|
|
81
|
+
previewFile(file.originFileObj).then(function (previewDataUrl) {
|
|
82
|
+
// Need append '' to avoid dead loop
|
|
83
|
+
file.thumbUrl = previewDataUrl || '';
|
|
84
|
+
forceUpdate();
|
|
85
|
+
});
|
|
86
|
+
}
|
|
89
87
|
});
|
|
90
88
|
}, [listType, items, previewFile]);
|
|
91
89
|
React.useEffect(function () {
|
|
@@ -114,12 +112,14 @@ var InternalUploadList = function InternalUploadList(props, ref) {
|
|
|
114
112
|
return iconRender(file, listType);
|
|
115
113
|
}
|
|
116
114
|
var isLoading = file.status === 'uploading';
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
115
|
+
var fileIcon = isImgUrl && isImgUrl(file) ? _jsx(PictureTwoTone, {}) : _jsx(FileTwoTone, {});
|
|
116
|
+
var icon = isLoading ? _jsx(LoadingOutlined, {}) : _jsx(PaperClipOutlined, {});
|
|
117
|
+
if (listType === 'picture') {
|
|
118
|
+
icon = isLoading ? _jsx(LoadingOutlined, {}) : fileIcon;
|
|
119
|
+
} else if (listType === 'picture-card' || listType === 'picture-circle') {
|
|
120
|
+
icon = isLoading ? locale.uploading : fileIcon;
|
|
121
121
|
}
|
|
122
|
-
return
|
|
122
|
+
return icon;
|
|
123
123
|
};
|
|
124
124
|
var actionIconRender = function actionIconRender(customIcon, callback, prefixCls, title, acceptUploadDisabled) {
|
|
125
125
|
var btnProps = {
|
|
@@ -138,11 +138,15 @@ var InternalUploadList = function InternalUploadList(props, ref) {
|
|
|
138
138
|
if (acceptUploadDisabled) {
|
|
139
139
|
btnProps.disabled = disabled;
|
|
140
140
|
}
|
|
141
|
-
|
|
142
|
-
|
|
141
|
+
if (/*#__PURE__*/React.isValidElement(customIcon)) {
|
|
142
|
+
var btnIcon = cloneElement(customIcon, _objectSpread(_objectSpread({}, customIcon.props), {}, {
|
|
143
143
|
onClick: function onClick() {}
|
|
144
|
-
}))
|
|
145
|
-
|
|
144
|
+
}));
|
|
145
|
+
return _jsx(Button, _objectSpread(_objectSpread({}, btnProps), {}, {
|
|
146
|
+
icon: btnIcon
|
|
147
|
+
}));
|
|
148
|
+
}
|
|
149
|
+
return _jsx(Button, _objectSpread(_objectSpread({}, btnProps), {}, {
|
|
146
150
|
children: _jsx("span", {
|
|
147
151
|
children: customIcon
|
|
148
152
|
})
|
|
@@ -162,20 +166,31 @@ var InternalUploadList = function InternalUploadList(props, ref) {
|
|
|
162
166
|
var prefixCls = getPrefixCls('upload', customizePrefixCls);
|
|
163
167
|
var rootPrefixCls = getPrefixCls();
|
|
164
168
|
var listClassNames = classNames("".concat(prefixCls, "-list"), "".concat(prefixCls, "-list-").concat(listType));
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
+
// >>> Motion config
|
|
170
|
+
var motionKeyList = _toConsumableArray(items.map(function (file) {
|
|
171
|
+
return {
|
|
172
|
+
key: file.uid,
|
|
173
|
+
file: file
|
|
174
|
+
};
|
|
175
|
+
}));
|
|
176
|
+
var animationDirection = listType === 'picture-card' || listType === 'picture-circle' ? 'animate-inline' : 'animate';
|
|
177
|
+
// const transitionName = list.length === 0 ? '' : `${prefixCls}-${animationDirection}`;
|
|
178
|
+
var motionConfig = {
|
|
169
179
|
motionDeadline: 2000,
|
|
170
|
-
motionName: "".concat(prefixCls, "-").concat(
|
|
171
|
-
keys:
|
|
172
|
-
return {
|
|
173
|
-
key: file.uid,
|
|
174
|
-
file: file
|
|
175
|
-
};
|
|
176
|
-
})),
|
|
180
|
+
motionName: "".concat(prefixCls, "-").concat(animationDirection),
|
|
181
|
+
keys: motionKeyList,
|
|
177
182
|
motionAppear: motionAppear
|
|
178
|
-
}
|
|
183
|
+
};
|
|
184
|
+
var listItemMotion = React.useMemo(function () {
|
|
185
|
+
var motion = _objectSpread({}, initCollapseMotion(rootPrefixCls));
|
|
186
|
+
delete motion.onAppearEnd;
|
|
187
|
+
delete motion.onEnterEnd;
|
|
188
|
+
delete motion.onLeaveEnd;
|
|
189
|
+
return motion;
|
|
190
|
+
}, [rootPrefixCls]);
|
|
191
|
+
if (listType !== 'picture-card' && listType !== 'picture-circle') {
|
|
192
|
+
motionConfig = _objectSpread(_objectSpread({}, listItemMotion), motionConfig);
|
|
193
|
+
}
|
|
179
194
|
return _jsxs("div", {
|
|
180
195
|
className: listClassNames,
|
|
181
196
|
children: [_jsx(CSSMotionList, _objectSpread(_objectSpread({}, motionConfig), {}, {
|
|
@@ -201,7 +216,6 @@ var InternalUploadList = function InternalUploadList(props, ref) {
|
|
|
201
216
|
removeIcon: removeIcon,
|
|
202
217
|
previewIcon: previewIcon,
|
|
203
218
|
downloadIcon: downloadIcon,
|
|
204
|
-
extra: extra,
|
|
205
219
|
iconRender: internalIconRender,
|
|
206
220
|
actionIconRender: actionIconRender,
|
|
207
221
|
itemRender: itemRender,
|
|
@@ -17,7 +17,7 @@ var genDraggerStyle = function genDraggerStyle(token) {
|
|
|
17
17
|
cursor: 'pointer',
|
|
18
18
|
transition: "border-color ".concat(token.motionDurationSlow)
|
|
19
19
|
}, componentCls, {
|
|
20
|
-
padding: token.padding
|
|
20
|
+
// padding: token.padding, // 删除符合UI规范
|
|
21
21
|
}), "".concat(componentCls, "-btn"), {
|
|
22
22
|
display: 'table',
|
|
23
23
|
width: '100%',
|
|
@@ -27,10 +27,23 @@ var genDraggerStyle = function genDraggerStyle(token) {
|
|
|
27
27
|
'&:focus-visible': {
|
|
28
28
|
outline: "".concat(unit(token.lineWidthFocus), " solid ").concat(token.colorPrimaryBorder)
|
|
29
29
|
}
|
|
30
|
-
}), "".concat(componentCls, "-drag-container"), {
|
|
30
|
+
}), "".concat(componentCls, "-drag-container"), _defineProperty({
|
|
31
31
|
display: 'table-cell',
|
|
32
32
|
verticalAlign: 'middle'
|
|
33
|
-
}
|
|
33
|
+
}, "".concat(componentCls, "-drag-wrapper"), _defineProperty(_defineProperty(_defineProperty({
|
|
34
|
+
padding: "39px 0"
|
|
35
|
+
}, "".concat(componentCls, "-drag-icon-wrapper"), _defineProperty({
|
|
36
|
+
marginBottom: "8px"
|
|
37
|
+
}, iconCls, {
|
|
38
|
+
color: token.colorPrimaryHover,
|
|
39
|
+
fontSize: "48px"
|
|
40
|
+
})), "".concat(componentCls, "-drag-text"), {
|
|
41
|
+
lineHeight: "20px"
|
|
42
|
+
}), "".concat(componentCls, "-drag-desc"), {
|
|
43
|
+
color: token.colorTextTertiary,
|
|
44
|
+
marginTop: "8px",
|
|
45
|
+
lineHeight: "20px"
|
|
46
|
+
}))), "\n &:not(".concat(componentCls, "-disabled):hover,\n &-hover:not(").concat(componentCls, "-disabled)\n "), {
|
|
34
47
|
borderColor: token.colorPrimaryHover
|
|
35
48
|
}), "p".concat(componentCls, "-drag-icon"), _defineProperty({
|
|
36
49
|
marginBottom: token.margin
|
|
@@ -44,8 +57,16 @@ var genDraggerStyle = function genDraggerStyle(token) {
|
|
|
44
57
|
}), "p".concat(componentCls, "-hint"), {
|
|
45
58
|
color: token.colorTextDescription,
|
|
46
59
|
fontSize: token.fontSize
|
|
47
|
-
}), "&".concat(componentCls, "-disabled"), _defineProperty(
|
|
60
|
+
}), "&".concat(componentCls, "-disabled"), _defineProperty(_defineProperty({
|
|
61
|
+
background: token.colorBgContainerDisabled
|
|
62
|
+
}, "p".concat(componentCls, "-drag-icon ").concat(iconCls, ",\n p").concat(componentCls, "-text,\n p").concat(componentCls, "-hint,\n "), {
|
|
63
|
+
color: token.colorTextDisabled
|
|
64
|
+
}), "".concat(componentCls, "-drag-wrapper"), _defineProperty(_defineProperty(_defineProperty({}, "".concat(componentCls, "-drag-icon-wrapper"), _defineProperty({}, iconCls, {
|
|
65
|
+
color: token.colorTextDisabled
|
|
66
|
+
})), "".concat(componentCls, "-drag-text"), {
|
|
67
|
+
color: token.colorTextDisabled
|
|
68
|
+
}), "".concat(componentCls, "-drag-desc"), {
|
|
48
69
|
color: token.colorTextDisabled
|
|
49
|
-
}))));
|
|
70
|
+
})))));
|
|
50
71
|
};
|
|
51
72
|
export default genDraggerStyle;
|
|
@@ -8,6 +8,7 @@ import { unit } from '@ant-design/cssinjs';
|
|
|
8
8
|
import { clearFix, textEllipsis } from '../../style';
|
|
9
9
|
var genListStyle = function genListStyle(token) {
|
|
10
10
|
var componentCls = token.componentCls,
|
|
11
|
+
antCls = token.antCls,
|
|
11
12
|
iconCls = token.iconCls,
|
|
12
13
|
fontSize = token.fontSize,
|
|
13
14
|
lineHeight = token.lineHeight,
|
|
@@ -15,6 +16,7 @@ var genListStyle = function genListStyle(token) {
|
|
|
15
16
|
var itemCls = "".concat(componentCls, "-list-item");
|
|
16
17
|
var actionsCls = "".concat(itemCls, "-actions");
|
|
17
18
|
var actionCls = "".concat(itemCls, "-action");
|
|
19
|
+
var listItemHeightSM = token.fontHeightSM;
|
|
18
20
|
return _defineProperty({}, "".concat(componentCls, "-wrapper"), _defineProperty({}, "".concat(componentCls, "-list"), _objectSpread(_objectSpread({}, clearFix()), {}, _defineProperty(_defineProperty(_defineProperty(_defineProperty({
|
|
19
21
|
lineHeight: token.lineHeight
|
|
20
22
|
}, itemCls, _defineProperty(_defineProperty(_defineProperty(_defineProperty({
|
|
@@ -25,7 +27,6 @@ var genListStyle = function genListStyle(token) {
|
|
|
25
27
|
display: 'flex',
|
|
26
28
|
alignItems: 'center',
|
|
27
29
|
transition: "background-color ".concat(token.motionDurationSlow),
|
|
28
|
-
borderRadius: token.borderRadiusSM,
|
|
29
30
|
'&:hover': {
|
|
30
31
|
backgroundColor: token.controlItemBgHover
|
|
31
32
|
}
|
|
@@ -34,7 +35,7 @@ var genListStyle = function genListStyle(token) {
|
|
|
34
35
|
lineHeight: lineHeight,
|
|
35
36
|
flex: 'auto',
|
|
36
37
|
transition: "all ".concat(token.motionDurationSlow)
|
|
37
|
-
})), actionsCls, _defineProperty(_defineProperty(_defineProperty({
|
|
38
|
+
})), actionsCls, _defineProperty(_defineProperty(_defineProperty(_defineProperty({
|
|
38
39
|
whiteSpace: 'nowrap'
|
|
39
40
|
}, actionCls, {
|
|
40
41
|
opacity: 0
|
|
@@ -43,6 +44,10 @@ var genListStyle = function genListStyle(token) {
|
|
|
43
44
|
transition: "all ".concat(token.motionDurationSlow)
|
|
44
45
|
}), "\n ".concat(actionCls, ":focus-visible,\n &.picture ").concat(actionCls, "\n "), {
|
|
45
46
|
opacity: 1
|
|
47
|
+
}), "".concat(actionCls).concat(antCls, "-btn"), {
|
|
48
|
+
height: listItemHeightSM,
|
|
49
|
+
border: 0,
|
|
50
|
+
lineHeight: 1
|
|
46
51
|
})), "".concat(componentCls, "-icon ").concat(iconCls), {
|
|
47
52
|
color: token.colorTextDescription,
|
|
48
53
|
fontSize: fontSize
|
package/lib/AppHolder/index.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import _App from "@chaoswise/ui/lib/App";
|
|
2
|
+
import { memo } from "react";
|
|
2
3
|
var message;
|
|
3
4
|
var notification;
|
|
4
5
|
var modal;
|
|
@@ -9,7 +10,7 @@ var AppHolder = function AppHolder() {
|
|
|
9
10
|
notification = staticFunction.notification;
|
|
10
11
|
return null;
|
|
11
12
|
};
|
|
12
|
-
export default AppHolder;
|
|
13
|
+
export default /*#__PURE__*/memo(AppHolder);
|
|
13
14
|
// 这里的问题是 AppHolder 组件在首次定义的时候,message、modal 和 notification 还没有被赋值。当你在其他地方尝试访问 AppHolder.message 时,这些属性是 undefined 的。
|
|
14
15
|
// AppHolder.message = message;
|
|
15
16
|
// AppHolder.modal = modal;
|
|
@@ -25,6 +25,8 @@ import intlContext from "./intlContext";
|
|
|
25
25
|
import { getDateLocal } from "./generate/dayjs";
|
|
26
26
|
import { legacyLogicalPropertiesTransformer, StyleProvider } from "@ant-design/cssinjs";
|
|
27
27
|
var Provider = intlContext.Provider;
|
|
28
|
+
// 导出intlContext与低版本ui组件同步,@chaoswise/business需要用到
|
|
29
|
+
export { intlContext };
|
|
28
30
|
var CWConfigProvider = function CWConfigProvider(_ref) {
|
|
29
31
|
var defaultLocale = _ref.defaultLocale,
|
|
30
32
|
theme = _ref.theme,
|
|
@@ -16,7 +16,9 @@ export var defaultComponentToken = {
|
|
|
16
16
|
headerColor: ["colorWhite"]
|
|
17
17
|
},
|
|
18
18
|
Breadcrumb: {
|
|
19
|
-
colorBgTextHover:
|
|
19
|
+
colorBgTextHover: "transparent",
|
|
20
|
+
// token变量 fff
|
|
21
|
+
linkHoverColor: ["colorPrimaryHover"]
|
|
20
22
|
},
|
|
21
23
|
Tooltip: {
|
|
22
24
|
colorBgSpotlight: ["colorWhite"],
|
|
@@ -33,7 +35,9 @@ export var defaultComponentToken = {
|
|
|
33
35
|
trackBgDisabled: "rgb(217, 217, 217)"
|
|
34
36
|
},
|
|
35
37
|
Select: {
|
|
36
|
-
|
|
38
|
+
optionSelectedBg: ["colorPrimaryBg"],
|
|
39
|
+
optionActiveBg: ["colorPrimaryBg"],
|
|
40
|
+
optionSelectedColor: ["colorPrimary"]
|
|
37
41
|
},
|
|
38
42
|
Tag: {
|
|
39
43
|
colorBorder: "rgba(0,0,0,0.09)"
|
|
@@ -67,6 +71,9 @@ export var defaultComponentToken = {
|
|
|
67
71
|
itemSelectedBg: "#F6F7F8",
|
|
68
72
|
subMenuItemBg: "transparent",
|
|
69
73
|
itemBg: ["colorWhite"]
|
|
74
|
+
},
|
|
75
|
+
DatePicker: {
|
|
76
|
+
cellHoverBg: ["colorPrimaryBg"]
|
|
70
77
|
}
|
|
71
78
|
};
|
|
72
79
|
|
|
@@ -108,7 +108,7 @@ var genCustomCWPaginationStyle = function genCustomCWPaginationStyle(token) {
|
|
|
108
108
|
backgroundColor: token.colorPrimary,
|
|
109
109
|
fontWeight: "500",
|
|
110
110
|
a: {
|
|
111
|
-
color: token.
|
|
111
|
+
color: token.colorWhite
|
|
112
112
|
}
|
|
113
113
|
}), "".concat(paginationPrefix, "-jump-wrapper"), _defineProperty({
|
|
114
114
|
display: "inline-block",
|
|
@@ -7,7 +7,7 @@ var genCustomSiderMenuStyle = function genCustomSiderMenuStyle(token) {
|
|
|
7
7
|
var prefixCls = token.antCls,
|
|
8
8
|
iconCls = token.iconCls;
|
|
9
9
|
var SiderMenuPrefix = "".concat(prefixCls, "-sider-menu");
|
|
10
|
-
return _defineProperty(_defineProperty({}, "".concat(SiderMenuPrefix, "-goup-label"), {
|
|
10
|
+
return _defineProperty(_defineProperty(_defineProperty({}, "".concat(SiderMenuPrefix, "-goup-label"), {
|
|
11
11
|
borderBottom: "1px solid rgb(246, 247, 248)",
|
|
12
12
|
width: "calc(100% + 14px)",
|
|
13
13
|
marginLeft: "-7px",
|
|
@@ -29,7 +29,9 @@ var genCustomSiderMenuStyle = function genCustomSiderMenuStyle(token) {
|
|
|
29
29
|
color: token.colorPrimary
|
|
30
30
|
}, iconCls, {
|
|
31
31
|
transform: "rotate(180deg)"
|
|
32
|
-
})))
|
|
32
|
+
}))), "".concat(SiderMenuPrefix, "-cw-menu-box-collapsed"), _defineProperty({}, "".concat(SiderMenuPrefix, "-expand-arrow"), {
|
|
33
|
+
display: "none"
|
|
34
|
+
}));
|
|
33
35
|
};
|
|
34
36
|
// ============================== Export ==============================
|
|
35
37
|
export default genStyleHooks("SiderMenu", function (token) {
|
|
@@ -51,7 +51,8 @@ var genCustomCWSliderStyle = function genCustomCWSliderStyle(token) {
|
|
|
51
51
|
backgroundSize: "contain",
|
|
52
52
|
boxShadow: "none !important",
|
|
53
53
|
borderRadius: "0",
|
|
54
|
-
position: "static"
|
|
54
|
+
position: "static",
|
|
55
|
+
outline: "none"
|
|
55
56
|
}
|
|
56
57
|
}, "&".concat(prefixCls, "-tooltip-open"), {
|
|
57
58
|
background: token.colorPrimaryHover,
|