@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.
@@ -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
- _notification.open(_objectSpread({
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
- _notification.close(id);
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({}, "".concat(prefixCls, "-notification:has(").concat(messagePrefixCls, "-notification-wrapper)"), {
18
+ return _defineProperty(_defineProperty(_defineProperty({}, "".concat(prefixCls, "-notification"), _defineProperty(_defineProperty({}, "&:has(".concat(messagePrefixCls, "-notification-wrapper)"), {
19
19
  margin: "0"
20
- })), "".concat(messagePrefixCls, "-wrapper"), _defineProperty({
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);
@@ -159,6 +159,9 @@ export default {
159
159
  lineHeight: 1.5714285,
160
160
  fontSize: 14
161
161
  },
162
+ Notification: {
163
+ zIndexPopup: 950
164
+ },
162
165
  // Empty: {
163
166
  // // 组件内部需要调整符合UI规范的样式
164
167
  // // 1.空状态默认图标替换
@@ -10,6 +10,9 @@ export default {
10
10
  // 自定义分割线颜色
11
11
  topNavMenuBg: "#FAFBFE" // 自定义头部下拉导航背景色
12
12
  },
13
+ Notification: {
14
+ zIndexPopup: 950 // 不要删除
15
+ },
13
16
  Button: {
14
17
  btnMainPadding: "0 23px" // 主操作按钮padding
15
18
  },
@@ -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",
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@chaoswise/ui",
3
3
  "packageName": "chaoswiseUI",
4
- "version": "3.0.7",
4
+ "version": "3.0.8",
5
5
  "description": "公共UI库",
6
6
  "keywords": [
7
7
  "ui",