@chaoswise/ui 3.0.7 → 3.0.8
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/CWMessage/index.js
CHANGED
|
@@ -107,6 +107,13 @@ function Message(props) {
|
|
|
107
107
|
_useState10 = _slicedToArray(_useState9, 2),
|
|
108
108
|
pageInfo = _useState10[0],
|
|
109
109
|
setPageInfo = _useState10[1];
|
|
110
|
+
var _notification$useNoti = _notification.useNotification({
|
|
111
|
+
top: headerHeight,
|
|
112
|
+
maxCount: mode === "windows" ? 1 : null
|
|
113
|
+
}),
|
|
114
|
+
_notification$useNoti2 = _slicedToArray(_notification$useNoti, 2),
|
|
115
|
+
api = _notification$useNoti2[0],
|
|
116
|
+
contextHolder = _notification$useNoti2[1];
|
|
110
117
|
// 初始化条件
|
|
111
118
|
var conditionsRef = useRef({
|
|
112
119
|
current: 1,
|
|
@@ -118,14 +125,6 @@ function Message(props) {
|
|
|
118
125
|
getMessageQuerySettings();
|
|
119
126
|
connectSocket();
|
|
120
127
|
}, []);
|
|
121
|
-
useEffect(function () {
|
|
122
|
-
_notification.destroy();
|
|
123
|
-
_notification.config({
|
|
124
|
-
top: headerHeight,
|
|
125
|
-
maxCount: mode === "windows" ? 1 : null,
|
|
126
|
-
prefixCls: "".concat(prefixCls, "-notification")
|
|
127
|
-
});
|
|
128
|
-
}, [mode]);
|
|
129
128
|
useEffect(function () {
|
|
130
129
|
setPageInfo(function (pre) {
|
|
131
130
|
return _objectSpread(_objectSpread({}, pre), {}, {
|
|
@@ -150,6 +149,9 @@ function Message(props) {
|
|
|
150
149
|
current: 1
|
|
151
150
|
});
|
|
152
151
|
});
|
|
152
|
+
conditionsRef.current = _objectSpread(_objectSpread({}, conditionsRef.current), {}, {
|
|
153
|
+
current: 1
|
|
154
|
+
});
|
|
153
155
|
};
|
|
154
156
|
var onClickBell = function onClickBell() {
|
|
155
157
|
setVisible(true);
|
|
@@ -172,7 +174,7 @@ function Message(props) {
|
|
|
172
174
|
if (res && res.status == "success") {
|
|
173
175
|
data = res.data;
|
|
174
176
|
_ref2 = data || {}, userMessageId = _ref2.userMessageId, title = _ref2.title, summary = _ref2.summary;
|
|
175
|
-
|
|
177
|
+
api.open(_objectSpread({
|
|
176
178
|
message: title,
|
|
177
179
|
description: summary,
|
|
178
180
|
onClick: function onClick() {
|
|
@@ -182,10 +184,9 @@ function Message(props) {
|
|
|
182
184
|
};
|
|
183
185
|
readInnerMessage(params);
|
|
184
186
|
onClickStrongMessageItem(data);
|
|
185
|
-
|
|
187
|
+
api.destroy(id);
|
|
186
188
|
},
|
|
187
189
|
duration: time,
|
|
188
|
-
prefixCls: "".concat(prefixCls, "-notification"),
|
|
189
190
|
className: "".concat(messagePrefixCls, "-notification-wrapper"),
|
|
190
191
|
key: id
|
|
191
192
|
}, restStrongMessageOption));
|
|
@@ -343,7 +344,7 @@ function Message(props) {
|
|
|
343
344
|
}();
|
|
344
345
|
return wrapCSSVar( /*#__PURE__*/React.createElement("div", {
|
|
345
346
|
className: classnames(hashId, cssVarCls, "".concat(messagePrefixCls, "-wrapper"))
|
|
346
|
-
}, /*#__PURE__*/React.createElement(_Badge, _extends({
|
|
347
|
+
}, contextHolder, /*#__PURE__*/React.createElement(_Badge, _extends({
|
|
347
348
|
count: messageTotal,
|
|
348
349
|
offset: [6, 5]
|
|
349
350
|
}, _badgeOption), /*#__PURE__*/React.createElement(CommonIcon, {
|
|
@@ -15,9 +15,21 @@ var genCustomCWMessageStyle = function genCustomCWMessageStyle(token) {
|
|
|
15
15
|
var drawerPrefix = "".concat(prefixCls, "-drawer");
|
|
16
16
|
var emptyPrefix = "".concat(prefixCls, "-empty");
|
|
17
17
|
var tabPrefix = "".concat(prefixCls, "-tabs");
|
|
18
|
-
return _defineProperty(_defineProperty(_defineProperty({}, "".concat(prefixCls, "-notification"), _defineProperty({}, "
|
|
18
|
+
return _defineProperty(_defineProperty(_defineProperty({}, "".concat(prefixCls, "-notification"), _defineProperty(_defineProperty({}, "&:has(".concat(messagePrefixCls, "-notification-wrapper)"), {
|
|
19
19
|
margin: "0"
|
|
20
|
-
})
|
|
20
|
+
}), "".concat(messagePrefixCls, "-notification-wrapper"), _defineProperty(_defineProperty({}, "".concat(prefixCls, "-notification-notice-message"), {
|
|
21
|
+
width: "100%",
|
|
22
|
+
textOverflow: "ellipsis",
|
|
23
|
+
overflow: "hidden",
|
|
24
|
+
whiteSpace: "nowrap"
|
|
25
|
+
}), "".concat(prefixCls, "-notification-notice-description"), {
|
|
26
|
+
textOverflow: "ellipsis",
|
|
27
|
+
overflow: "hidden",
|
|
28
|
+
display: "-webkit-box",
|
|
29
|
+
WebkitLineClamp: "2",
|
|
30
|
+
WebkitBoxOrient: "vertical",
|
|
31
|
+
whiteSpace: "pre-wrap"
|
|
32
|
+
}))), "".concat(messagePrefixCls, "-wrapper"), _defineProperty({
|
|
21
33
|
display: "inline-flex",
|
|
22
34
|
".business-message-icon": {
|
|
23
35
|
cursor: "pointer",
|
|
@@ -136,6 +148,6 @@ var genCustomCWMessageStyle = function genCustomCWMessageStyle(token) {
|
|
|
136
148
|
// ============================== Export ==============================
|
|
137
149
|
export default genStyleHooks("CWMessage", function (token) {
|
|
138
150
|
return [
|
|
139
|
-
//
|
|
151
|
+
//
|
|
140
152
|
genCustomCWMessageStyle(token)];
|
|
141
153
|
}, prepareComponentToken);
|
|
@@ -13,7 +13,8 @@ var genCustomTooltipTextStyle = function genCustomTooltipTextStyle(token) {
|
|
|
13
13
|
overflow: "hidden",
|
|
14
14
|
whiteSpace: "nowrap",
|
|
15
15
|
display: "inline-block",
|
|
16
|
-
verticalAlign: "top"
|
|
16
|
+
verticalAlign: "top",
|
|
17
|
+
fontSize: "inherit"
|
|
17
18
|
}, "".concat(toolTipTextPrefix, "-clone"), {
|
|
18
19
|
position: "absolute",
|
|
19
20
|
height: "0",
|