@hkyhy/marsun-components-core 0.1.138 → 0.1.140
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 +1 -0
- package/dist/components/Iam/client.d.ts +3 -0
- package/dist/components/Iam/index.d.ts +1 -1
- package/dist/components/Iam/pages/IamUsersPage.d.ts +15 -1
- package/dist/components/Iam/pages/IamUsersPage.js +171 -162
- package/dist/components/Iam/pages/IamUsersPage.js.map +1 -1
- package/dist/components/Table/Table.d.ts +2 -2
- package/dist/components/Table/Table.js +75 -72
- package/dist/components/Table/Table.js.map +1 -1
- package/dist/components/Table/columnConfigUtils.d.ts +8 -0
- package/dist/components/Table/columnConfigUtils.js +130 -113
- package/dist/components/Table/columnConfigUtils.js.map +1 -1
- package/dist/components/Table/index.d.ts +1 -1
- package/dist/components/Tools/ActionTracking/CreateAction/CreateActionForm.d.ts +2 -0
- package/dist/components/Tools/ActionTracking/CreateAction/CreateActionForm.js +97 -83
- package/dist/components/Tools/ActionTracking/CreateAction/CreateActionForm.js.map +1 -1
- package/dist/components/Tools/ActionTracking/CreateAction/CreateActionModal.d.ts +2 -0
- package/dist/components/Tools/ActionTracking/CreateAction/CreateActionModal.js +111 -106
- package/dist/components/Tools/ActionTracking/CreateAction/CreateActionModal.js.map +1 -1
- package/dist/components/Tools/ActionTracking/CreateAction/types.d.ts +4 -0
- package/dist/components/Tools/Inbox/InboxBell/InboxBell.js +168 -155
- package/dist/components/Tools/Inbox/InboxBell/InboxBell.js.map +1 -1
- package/dist/components/Tools/Inbox/InboxBell/inboxItemActions.js +60 -46
- package/dist/components/Tools/Inbox/InboxBell/inboxItemActions.js.map +1 -1
- package/dist/components/Tools/Inbox/InboxBell/style.module.scss.js +68 -60
- package/dist/components/Tools/Inbox/InboxBell/style.module.scss.js.map +1 -1
- package/dist/index.js +478 -477
- package/dist/marsun-components-core.css +1 -1
- package/dist/styles/global.css +1 -1
- package/package.json +1 -1
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import { jsxs as d, jsx as a } from "react/jsx-runtime";
|
|
2
|
-
import { notification as Ue, Badge as Fe, Button as
|
|
3
|
-
import
|
|
4
|
-
import { forwardRef as Ge, useState as f, useRef as
|
|
2
|
+
import { notification as Ue, Badge as Fe, Button as D, Drawer as ze, Space as Ee, Checkbox as oe, message as $ } from "antd";
|
|
3
|
+
import P from "classnames";
|
|
4
|
+
import { forwardRef as Ge, useState as f, useRef as T, useMemo as Se, useCallback as N, useImperativeHandle as $e, useEffect as b } from "react";
|
|
5
5
|
import { createPortal as Ke } from "react-dom";
|
|
6
6
|
import { sanitizeInboxHtml as je } from "../sanitizeInboxHtml.js";
|
|
7
7
|
import { INBOX_BADGE_REFRESH_EVENT as Le } from "../requestInboxBadgeRefresh.js";
|
|
8
8
|
import { emphasizeQuoted as le } from "./emphasizeQuoted.js";
|
|
9
9
|
import { filterInboxActionsForHost as Ve, resolveInboxItemActions as We, isInboxButtonDriven as Qe } from "./inboxItemActions.js";
|
|
10
|
-
import { inboxSceneLabel as
|
|
10
|
+
import { inboxSceneLabel as Dt, isTerminalActionStatus as Mt, normalizeInboxActions as Ot, resolveInboxSceneKey as It } from "./inboxItemActions.js";
|
|
11
11
|
import { loadInboxToastPrefs as Xe, shouldToastForMessageType as Ye, saveInboxToastPrefs as Je } from "./toastPrefs.js";
|
|
12
12
|
import { DEFAULT_INBOX_TOAST_PREFS as Ut } from "./toastPrefs.js";
|
|
13
|
-
import
|
|
13
|
+
import n from "./style.module.scss.js";
|
|
14
14
|
import { Bell as qe } from "../../../Icons/Bell.js";
|
|
15
|
-
import se, { SEMANTIC_COLORS as
|
|
15
|
+
import se, { SEMANTIC_COLORS as M } from "../../../Tag/SemanticTag.js";
|
|
16
16
|
import Ze from "../../../StateBar/StateBar.js";
|
|
17
17
|
import et from "../../../SegmentedRadio/SegmentedRadio.js";
|
|
18
18
|
import tt from "../../../Layout/PageSpin/index.js";
|
|
@@ -28,51 +28,51 @@ const at = 6e3, ot = [
|
|
|
28
28
|
action: "行动",
|
|
29
29
|
remind: "提醒"
|
|
30
30
|
}, st = 300, it = 1500, ct = 72;
|
|
31
|
-
function
|
|
31
|
+
function Ce(u) {
|
|
32
32
|
const o = String(u || "").trim().toLowerCase();
|
|
33
33
|
return o ? lt[o] || o : "";
|
|
34
34
|
}
|
|
35
|
-
function
|
|
35
|
+
function ke(u) {
|
|
36
36
|
const o = String(u || "").trim().toLowerCase();
|
|
37
|
-
return o === "alert" ?
|
|
37
|
+
return o === "alert" ? M.DANGER : o === "action" ? M.PRIMARY : o === "remind" ? M.WARNING : M.DEFAULT;
|
|
38
38
|
}
|
|
39
39
|
function dt(u) {
|
|
40
40
|
return [u.factory, u.variety, u.metric].map((o) => String(o || "").trim()).filter(Boolean).join(" · ");
|
|
41
41
|
}
|
|
42
42
|
function ut(u) {
|
|
43
|
-
return String(u || "").trim() ||
|
|
43
|
+
return String(u || "").trim() || M.DEFAULT;
|
|
44
44
|
}
|
|
45
45
|
function mt(u) {
|
|
46
46
|
try {
|
|
47
47
|
const o = JSON.parse(u);
|
|
48
48
|
if (!o || typeof o != "object") return null;
|
|
49
|
-
const O = String(o.messageType || o.message_type || "").trim(),
|
|
50
|
-
return !O && !
|
|
49
|
+
const O = String(o.messageType || o.message_type || "").trim(), x = String(o.title || "").trim(), A = String(o.summary || "").trim();
|
|
50
|
+
return !O && !x && !A ? null : {
|
|
51
51
|
messageType: O || void 0,
|
|
52
|
-
title:
|
|
53
|
-
summary:
|
|
52
|
+
title: x || void 0,
|
|
53
|
+
summary: A || void 0
|
|
54
54
|
};
|
|
55
55
|
} catch {
|
|
56
56
|
return null;
|
|
57
57
|
}
|
|
58
58
|
}
|
|
59
|
-
const
|
|
59
|
+
const Pt = Ge(function({
|
|
60
60
|
fetchInbox: o,
|
|
61
61
|
markRead: O,
|
|
62
|
-
markAllRead:
|
|
63
|
-
onNavigate:
|
|
62
|
+
markAllRead: x,
|
|
63
|
+
onNavigate: A,
|
|
64
64
|
pollMs: K = 0,
|
|
65
65
|
locationKey: ie,
|
|
66
66
|
pageSize: E = 20,
|
|
67
|
-
className:
|
|
68
|
-
title:
|
|
67
|
+
className: xe,
|
|
68
|
+
title: Be = "站内信",
|
|
69
69
|
streamPath: j = "/api/v1/msg-center/inbox/stream",
|
|
70
70
|
getAccessToken: V,
|
|
71
71
|
onItemAction: ce
|
|
72
|
-
},
|
|
73
|
-
const [W,
|
|
74
|
-
|
|
75
|
-
const ee =
|
|
72
|
+
}, Re) {
|
|
73
|
+
const [W, B] = f(!1), [de, ue] = f(!1), [Q, me] = f(""), [I, H] = f([]), [S, U] = f(0), [fe, X] = f({}), [Y, Pe] = f(""), [F, Ae] = f("all"), [_, _e] = f(() => Xe()), [De, pe] = f(!1), [J, ye] = f(!1), [p, q] = f(null), L = T(null), C = T(null), Z = T(null), y = T(null), ge = T(!1), ve = T(_);
|
|
74
|
+
ve.current = _;
|
|
75
|
+
const ee = T(1), te = T(!1), R = T(!1), z = Se(
|
|
76
76
|
() => ({
|
|
77
77
|
messageType: Y || void 0,
|
|
78
78
|
unreadOnly: F === "unread" || void 0,
|
|
@@ -80,78 +80,78 @@ const Rt = Ge(function({
|
|
|
80
80
|
}),
|
|
81
81
|
[Y, F]
|
|
82
82
|
), G = N(async () => {
|
|
83
|
-
ue(!0), me(""), ee.current = 1,
|
|
83
|
+
ue(!0), me(""), ee.current = 1, R.current = !1;
|
|
84
84
|
try {
|
|
85
85
|
const e = await o({
|
|
86
86
|
currentPage: 1,
|
|
87
87
|
pageSize: E,
|
|
88
88
|
...z
|
|
89
|
-
}), t = (e == null ? void 0 : e.pageData) || [],
|
|
90
|
-
H(t),
|
|
89
|
+
}), t = (e == null ? void 0 : e.pageData) || [], r = typeof (e == null ? void 0 : e.total) == "number" ? e.total : t.length;
|
|
90
|
+
H(t), R.current = t.length > 0 && t.length < r, U(typeof (e == null ? void 0 : e.unreadTotal) == "number" ? e.unreadTotal : 0), X((e == null ? void 0 : e.unreadByMessageType) || {});
|
|
91
91
|
} catch (e) {
|
|
92
|
-
H([]),
|
|
92
|
+
H([]), R.current = !1, me(e instanceof Error ? e.message : String(e));
|
|
93
93
|
} finally {
|
|
94
94
|
ue(!1);
|
|
95
95
|
}
|
|
96
|
-
}, [o, E, z]),
|
|
97
|
-
if (!(te.current || !
|
|
96
|
+
}, [o, E, z]), he = N(async () => {
|
|
97
|
+
if (!(te.current || !R.current)) {
|
|
98
98
|
te.current = !0, pe(!0);
|
|
99
99
|
try {
|
|
100
100
|
const e = ee.current + 1, t = await o({
|
|
101
101
|
currentPage: e,
|
|
102
102
|
pageSize: E,
|
|
103
103
|
...z
|
|
104
|
-
}),
|
|
104
|
+
}), r = (t == null ? void 0 : t.pageData) || [], l = typeof (t == null ? void 0 : t.total) == "number" ? t.total : 0;
|
|
105
105
|
H((i) => {
|
|
106
|
-
const s = new Set(i.map((
|
|
107
|
-
return
|
|
108
|
-
}),
|
|
106
|
+
const s = new Set(i.map((g) => g.id)), m = r.filter((g) => (g == null ? void 0 : g.id) && !s.has(g.id)), h = m.length ? [...i, ...m] : i;
|
|
107
|
+
return R.current = m.length > 0 && (l > 0 ? h.length < l : m.length >= E), h;
|
|
108
|
+
}), r.length && (ee.current = e), typeof (t == null ? void 0 : t.unreadTotal) == "number" && U(t.unreadTotal), t != null && t.unreadByMessageType && X(t.unreadByMessageType);
|
|
109
109
|
} catch {
|
|
110
|
-
|
|
110
|
+
R.current = !1;
|
|
111
111
|
} finally {
|
|
112
112
|
te.current = !1, pe(!1);
|
|
113
113
|
}
|
|
114
114
|
}
|
|
115
|
-
}, [o, E, z]),
|
|
115
|
+
}, [o, E, z]), Me = N(
|
|
116
116
|
(e) => {
|
|
117
117
|
const t = e.currentTarget;
|
|
118
|
-
t.scrollHeight - t.scrollTop - t.clientHeight <= ct &&
|
|
118
|
+
t.scrollHeight - t.scrollTop - t.clientHeight <= ct && he();
|
|
119
119
|
},
|
|
120
|
-
[
|
|
121
|
-
),
|
|
120
|
+
[he]
|
|
121
|
+
), v = N(async () => {
|
|
122
122
|
try {
|
|
123
123
|
const e = await o({ currentPage: 1, pageSize: E });
|
|
124
124
|
U(typeof (e == null ? void 0 : e.unreadTotal) == "number" ? e.unreadTotal : 0), X((e == null ? void 0 : e.unreadByMessageType) || {});
|
|
125
125
|
} catch {
|
|
126
126
|
}
|
|
127
127
|
}, [o, E]), ne = N(() => {
|
|
128
|
-
|
|
128
|
+
y.current != null && (window.clearTimeout(y.current), y.current = null), q(null);
|
|
129
129
|
}, []), Te = N(() => {
|
|
130
|
-
ne(),
|
|
130
|
+
ne(), B(!0);
|
|
131
131
|
}, [ne]), be = N(() => {
|
|
132
132
|
const e = Z.current;
|
|
133
|
-
if (Z.current = null, !e || !Ye(
|
|
134
|
-
|
|
133
|
+
if (Z.current = null, !e || !Ye(ve.current, e.messageType)) return;
|
|
134
|
+
y.current != null && (window.clearTimeout(y.current), y.current = null);
|
|
135
135
|
const t = `inbox-badge-${e.messageType || "msg"}-${Date.now()}`;
|
|
136
136
|
q({
|
|
137
137
|
key: t,
|
|
138
138
|
title: e.title || "新站内信",
|
|
139
139
|
summary: e.summary || "",
|
|
140
140
|
messageType: e.messageType
|
|
141
|
-
}),
|
|
142
|
-
|
|
141
|
+
}), y.current = window.setTimeout(() => {
|
|
142
|
+
y.current = null, q(null);
|
|
143
143
|
}, at);
|
|
144
144
|
}, []), w = N(
|
|
145
145
|
(e) => {
|
|
146
|
-
e && (Z.current = e, be()),
|
|
147
|
-
|
|
146
|
+
e && (Z.current = e, be()), C.current != null && window.clearTimeout(C.current), C.current = window.setTimeout(() => {
|
|
147
|
+
C.current = null, v();
|
|
148
148
|
}, it);
|
|
149
149
|
},
|
|
150
|
-
[
|
|
150
|
+
[v, be]
|
|
151
151
|
);
|
|
152
|
-
$e(
|
|
153
|
-
|
|
154
|
-
}, [
|
|
152
|
+
$e(Re, () => ({ refreshBadge: v }), [v]), b(() => {
|
|
153
|
+
v();
|
|
154
|
+
}, [v]), b(() => {
|
|
155
155
|
if (ie !== void 0) {
|
|
156
156
|
if (!ge.current) {
|
|
157
157
|
ge.current = !0;
|
|
@@ -159,13 +159,13 @@ const Rt = Ge(function({
|
|
|
159
159
|
}
|
|
160
160
|
w();
|
|
161
161
|
}
|
|
162
|
-
}, [ie, w]),
|
|
162
|
+
}, [ie, w]), b(() => {
|
|
163
163
|
if (K <= 0) return;
|
|
164
164
|
const e = window.setInterval(() => {
|
|
165
|
-
|
|
165
|
+
v();
|
|
166
166
|
}, K);
|
|
167
167
|
return () => window.clearInterval(e);
|
|
168
|
-
}, [K,
|
|
168
|
+
}, [K, v]), b(() => {
|
|
169
169
|
const e = () => {
|
|
170
170
|
L.current != null && window.clearTimeout(L.current), L.current = window.setTimeout(() => {
|
|
171
171
|
L.current = null, w();
|
|
@@ -176,22 +176,22 @@ const Rt = Ge(function({
|
|
|
176
176
|
return window.addEventListener("focus", e), document.addEventListener("visibilitychange", t), () => {
|
|
177
177
|
window.removeEventListener("focus", e), document.removeEventListener("visibilitychange", t), L.current != null && (window.clearTimeout(L.current), L.current = null);
|
|
178
178
|
};
|
|
179
|
-
}, [w]),
|
|
179
|
+
}, [w]), b(() => {
|
|
180
180
|
const e = (t) => {
|
|
181
|
-
const
|
|
182
|
-
w((
|
|
181
|
+
const r = t.detail;
|
|
182
|
+
w((r == null ? void 0 : r.preview) || void 0);
|
|
183
183
|
};
|
|
184
184
|
return window.addEventListener(Le, e), () => window.removeEventListener(Le, e);
|
|
185
|
-
}, [w]),
|
|
185
|
+
}, [w]), b(() => {
|
|
186
186
|
Ue.destroy();
|
|
187
|
-
}, []),
|
|
188
|
-
|
|
189
|
-
}, []),
|
|
187
|
+
}, []), b(() => () => {
|
|
188
|
+
C.current != null && (window.clearTimeout(C.current), C.current = null), y.current != null && (window.clearTimeout(y.current), y.current = null);
|
|
189
|
+
}, []), b(() => {
|
|
190
190
|
if (j === !1 || typeof V != "function" || typeof window > "u" || typeof EventSource > "u") return;
|
|
191
191
|
const e = String(j || "/api/v1/msg-center/inbox/stream").trim();
|
|
192
|
-
let t = !1,
|
|
192
|
+
let t = !1, r = null, l = null, i = 0;
|
|
193
193
|
const s = (c) => {
|
|
194
|
-
const
|
|
194
|
+
const k = c, He = typeof (k == null ? void 0 : k.data) == "string" ? mt(k.data) : null;
|
|
195
195
|
w(He);
|
|
196
196
|
}, m = () => {
|
|
197
197
|
l != null && (window.clearTimeout(l), l = null);
|
|
@@ -199,34 +199,34 @@ const Rt = Ge(function({
|
|
|
199
199
|
if (t || l != null) return;
|
|
200
200
|
const c = Math.min(3e4, 1e3 * 2 ** Math.min(i, 5));
|
|
201
201
|
i += 1, l = window.setTimeout(() => {
|
|
202
|
-
l = null,
|
|
202
|
+
l = null, g();
|
|
203
203
|
}, c);
|
|
204
|
-
},
|
|
204
|
+
}, g = () => {
|
|
205
205
|
if (t) return;
|
|
206
206
|
const c = String(V() || "").trim();
|
|
207
207
|
if (!c) {
|
|
208
208
|
h();
|
|
209
209
|
return;
|
|
210
210
|
}
|
|
211
|
-
|
|
212
|
-
const
|
|
213
|
-
|
|
211
|
+
r && (r.removeEventListener("badge", s), r.removeEventListener("inbox", s), r.close(), r = null);
|
|
212
|
+
const k = new URL(e, window.location.origin);
|
|
213
|
+
k.searchParams.set("access_token", c);
|
|
214
214
|
try {
|
|
215
|
-
|
|
215
|
+
r = new EventSource(k.toString());
|
|
216
216
|
} catch {
|
|
217
217
|
h();
|
|
218
218
|
return;
|
|
219
219
|
}
|
|
220
|
-
|
|
220
|
+
r.addEventListener("badge", s), r.addEventListener("inbox", s), r.onopen = () => {
|
|
221
221
|
i = 0;
|
|
222
|
-
},
|
|
223
|
-
t || (
|
|
222
|
+
}, r.onerror = () => {
|
|
223
|
+
t || (r == null || r.close(), r = null, h());
|
|
224
224
|
};
|
|
225
225
|
};
|
|
226
|
-
return
|
|
227
|
-
t = !0, m(),
|
|
226
|
+
return g(), () => {
|
|
227
|
+
t = !0, m(), r && (r.removeEventListener("badge", s), r.removeEventListener("inbox", s), r.close(), r = null);
|
|
228
228
|
};
|
|
229
|
-
}, [j, V, w]),
|
|
229
|
+
}, [j, V, w]), b(() => {
|
|
230
230
|
W && G();
|
|
231
231
|
}, [W, G]);
|
|
232
232
|
const Oe = Se(
|
|
@@ -239,8 +239,8 @@ const Rt = Ge(function({
|
|
|
239
239
|
}),
|
|
240
240
|
[fe, S]
|
|
241
241
|
), re = (e, t) => {
|
|
242
|
-
|
|
243
|
-
const l = { ...
|
|
242
|
+
_e((r) => {
|
|
243
|
+
const l = { ...r, [e]: t };
|
|
244
244
|
return Je(l), l;
|
|
245
245
|
});
|
|
246
246
|
}, ae = async (e, t) => {
|
|
@@ -251,55 +251,61 @@ const Rt = Ge(function({
|
|
|
251
251
|
$.error(l instanceof Error ? l.message : "标记已读失败");
|
|
252
252
|
return;
|
|
253
253
|
}
|
|
254
|
-
const
|
|
255
|
-
if (
|
|
256
|
-
if (
|
|
257
|
-
|
|
254
|
+
const r = String(e.href || "").trim();
|
|
255
|
+
if (r) {
|
|
256
|
+
if (A) {
|
|
257
|
+
A(r, e), B(!1);
|
|
258
258
|
return;
|
|
259
259
|
}
|
|
260
|
-
|
|
260
|
+
r.startsWith("http://") || r.startsWith("https://") ? window.open(r, "_blank", "noopener,noreferrer") : window.location.assign(r), B(!1);
|
|
261
261
|
}
|
|
262
262
|
}, we = async (e, t) => {
|
|
263
263
|
if (!t.disabled) {
|
|
264
264
|
if (ce) {
|
|
265
265
|
try {
|
|
266
|
-
await ce(t.kind, e),
|
|
267
|
-
} catch (
|
|
268
|
-
$.error(
|
|
266
|
+
await ce(t.kind, e), B(!1), G(), v();
|
|
267
|
+
} catch (r) {
|
|
268
|
+
$.error(r instanceof Error ? r.message : "操作失败");
|
|
269
269
|
}
|
|
270
270
|
return;
|
|
271
271
|
}
|
|
272
272
|
await ae(e);
|
|
273
273
|
}
|
|
274
274
|
}, Ie = async () => {
|
|
275
|
-
if (!(!
|
|
275
|
+
if (!(!x || S <= 0 || J)) {
|
|
276
276
|
ye(!0);
|
|
277
277
|
try {
|
|
278
|
-
const e = await
|
|
279
|
-
$.success(typeof t == "number" ? `已清空 ${t} 条未读` : "已清空未读"), await G(), await
|
|
278
|
+
const e = await x(), t = typeof (e == null ? void 0 : e.updated) == "number" ? e.updated : void 0;
|
|
279
|
+
$.success(typeof t == "number" ? `已清空 ${t} 条未读` : "已清空未读"), await G(), await v();
|
|
280
280
|
} catch (e) {
|
|
281
281
|
$.error(e instanceof Error ? e.message : "清空未读失败");
|
|
282
282
|
} finally {
|
|
283
283
|
ye(!1);
|
|
284
284
|
}
|
|
285
285
|
}
|
|
286
|
-
}, Ne =
|
|
287
|
-
return /* @__PURE__ */ d("div", { className:
|
|
286
|
+
}, Ne = p ? Ce(p.messageType) : "";
|
|
287
|
+
return /* @__PURE__ */ d("div", { className: P(n.bellWrap, xe), children: [
|
|
288
288
|
/* @__PURE__ */ a(Fe, { count: S, size: "small", overflowCount: 99, offset: [-4, 4], children: /* @__PURE__ */ a(
|
|
289
|
-
|
|
289
|
+
D,
|
|
290
290
|
{
|
|
291
291
|
type: "text",
|
|
292
|
-
className:
|
|
292
|
+
className: n.bellBtn,
|
|
293
293
|
icon: /* @__PURE__ */ a(qe, { size: 16, "aria-hidden": !0 }),
|
|
294
294
|
"aria-label": S > 0 ? `站内信,${S} 条未读` : "站内信",
|
|
295
|
-
onClick: () =>
|
|
295
|
+
onClick: () => B(!0)
|
|
296
296
|
}
|
|
297
297
|
) }),
|
|
298
|
-
|
|
299
|
-
/* @__PURE__ */ a("div", { className:
|
|
298
|
+
p && typeof document < "u" ? Ke(
|
|
299
|
+
/* @__PURE__ */ a("div", { className: n.toastHost, "data-testid": "inbox-live-toast-host", children: /* @__PURE__ */ d(
|
|
300
300
|
"div",
|
|
301
301
|
{
|
|
302
|
-
className:
|
|
302
|
+
className: P(
|
|
303
|
+
"marsun-inbox-toast",
|
|
304
|
+
n.toastNotice,
|
|
305
|
+
p.messageType === "alert" && n.accentAlert,
|
|
306
|
+
p.messageType === "action" && n.accentAction,
|
|
307
|
+
p.messageType === "remind" && n.accentRemind
|
|
308
|
+
),
|
|
303
309
|
role: "alert",
|
|
304
310
|
"data-testid": "inbox-live-toast",
|
|
305
311
|
onClick: Te,
|
|
@@ -308,7 +314,7 @@ const Rt = Ge(function({
|
|
|
308
314
|
"button",
|
|
309
315
|
{
|
|
310
316
|
type: "button",
|
|
311
|
-
className:
|
|
317
|
+
className: n.toastClose,
|
|
312
318
|
"aria-label": "关闭",
|
|
313
319
|
onClick: (e) => {
|
|
314
320
|
e.stopPropagation(), ne();
|
|
@@ -316,21 +322,21 @@ const Rt = Ge(function({
|
|
|
316
322
|
children: "×"
|
|
317
323
|
}
|
|
318
324
|
),
|
|
319
|
-
/* @__PURE__ */ d("div", { className:
|
|
320
|
-
/* @__PURE__ */ a("span", { className:
|
|
325
|
+
/* @__PURE__ */ d("div", { className: n.toastHead, children: [
|
|
326
|
+
/* @__PURE__ */ a("span", { className: n.toastTitle, children: le(p.title) }),
|
|
321
327
|
Ne ? /* @__PURE__ */ a(
|
|
322
328
|
se,
|
|
323
329
|
{
|
|
324
|
-
color:
|
|
325
|
-
className:
|
|
330
|
+
color: ke(p.messageType),
|
|
331
|
+
className: n.typeTag,
|
|
326
332
|
children: Ne
|
|
327
333
|
}
|
|
328
334
|
) : null
|
|
329
335
|
] }),
|
|
330
|
-
/* @__PURE__ */ d("div", { className:
|
|
331
|
-
|
|
332
|
-
/* @__PURE__ */ a("div", { className:
|
|
333
|
-
|
|
336
|
+
/* @__PURE__ */ d("div", { className: n.toastBody, children: [
|
|
337
|
+
p.summary ? /* @__PURE__ */ a("div", { className: n.toastDesc, children: le(p.summary) }) : null,
|
|
338
|
+
/* @__PURE__ */ a("div", { className: n.toastActions, children: /* @__PURE__ */ a(
|
|
339
|
+
D,
|
|
334
340
|
{
|
|
335
341
|
type: "primary",
|
|
336
342
|
size: "small",
|
|
@@ -343,19 +349,19 @@ const Rt = Ge(function({
|
|
|
343
349
|
] })
|
|
344
350
|
]
|
|
345
351
|
},
|
|
346
|
-
|
|
352
|
+
p.key
|
|
347
353
|
) }),
|
|
348
354
|
document.body
|
|
349
355
|
) : null,
|
|
350
356
|
/* @__PURE__ */ d(
|
|
351
357
|
ze,
|
|
352
358
|
{
|
|
353
|
-
title:
|
|
359
|
+
title: Be,
|
|
354
360
|
open: W,
|
|
355
|
-
onClose: () =>
|
|
361
|
+
onClose: () => B(!1),
|
|
356
362
|
size: 420,
|
|
357
363
|
destroyOnClose: !1,
|
|
358
|
-
className:
|
|
364
|
+
className: n.drawer,
|
|
359
365
|
styles: {
|
|
360
366
|
header: { padding: "12px 16px" },
|
|
361
367
|
body: { padding: "12px 16px" }
|
|
@@ -364,21 +370,21 @@ const Rt = Ge(function({
|
|
|
364
370
|
/* @__PURE__ */ a(
|
|
365
371
|
Ze,
|
|
366
372
|
{
|
|
367
|
-
className:
|
|
373
|
+
className: n.typeTabs,
|
|
368
374
|
size: "small",
|
|
369
375
|
activeKey: Y || "all",
|
|
370
|
-
onChange: (e) =>
|
|
376
|
+
onChange: (e) => Pe(e === "all" ? "" : e),
|
|
371
377
|
stateOption: Oe,
|
|
372
378
|
isInner: !0
|
|
373
379
|
}
|
|
374
380
|
),
|
|
375
|
-
/* @__PURE__ */ d("div", { className:
|
|
381
|
+
/* @__PURE__ */ d("div", { className: n.filterRow, children: [
|
|
376
382
|
/* @__PURE__ */ a(
|
|
377
383
|
et,
|
|
378
384
|
{
|
|
379
385
|
size: "small",
|
|
380
386
|
value: F,
|
|
381
|
-
onChange: (e) =>
|
|
387
|
+
onChange: (e) => Ae(e),
|
|
382
388
|
options: [
|
|
383
389
|
{ value: "all", label: "全部" },
|
|
384
390
|
{ value: "unread", label: "未读" },
|
|
@@ -386,12 +392,12 @@ const Rt = Ge(function({
|
|
|
386
392
|
]
|
|
387
393
|
}
|
|
388
394
|
),
|
|
389
|
-
|
|
390
|
-
|
|
395
|
+
x ? /* @__PURE__ */ a(
|
|
396
|
+
D,
|
|
391
397
|
{
|
|
392
398
|
type: "link",
|
|
393
399
|
size: "small",
|
|
394
|
-
className:
|
|
400
|
+
className: n.clearUnreadBtn,
|
|
395
401
|
"data-testid": "inbox-clear-unread",
|
|
396
402
|
loading: J,
|
|
397
403
|
disabled: S <= 0 || J,
|
|
@@ -400,14 +406,14 @@ const Rt = Ge(function({
|
|
|
400
406
|
}
|
|
401
407
|
) : null
|
|
402
408
|
] }),
|
|
403
|
-
/* @__PURE__ */ d("div", { className:
|
|
404
|
-
/* @__PURE__ */ a("div", { className:
|
|
405
|
-
/* @__PURE__ */ a("p", { className:
|
|
409
|
+
/* @__PURE__ */ d("div", { className: n.toastPrefs, "data-testid": "inbox-toast-prefs", children: [
|
|
410
|
+
/* @__PURE__ */ a("div", { className: n.toastPrefsTitle, children: "消息提示" }),
|
|
411
|
+
/* @__PURE__ */ a("p", { className: n.toastPrefsHint, children: "本机浏览器偏好,非租户策略" }),
|
|
406
412
|
/* @__PURE__ */ d(Ee, { size: 12, wrap: !0, children: [
|
|
407
413
|
/* @__PURE__ */ a(
|
|
408
414
|
oe,
|
|
409
415
|
{
|
|
410
|
-
checked:
|
|
416
|
+
checked: _.alert,
|
|
411
417
|
onChange: (e) => re("alert", e.target.checked),
|
|
412
418
|
children: "预警弹出"
|
|
413
419
|
}
|
|
@@ -415,7 +421,7 @@ const Rt = Ge(function({
|
|
|
415
421
|
/* @__PURE__ */ a(
|
|
416
422
|
oe,
|
|
417
423
|
{
|
|
418
|
-
checked:
|
|
424
|
+
checked: _.action,
|
|
419
425
|
onChange: (e) => re("action", e.target.checked),
|
|
420
426
|
children: "行动弹出"
|
|
421
427
|
}
|
|
@@ -423,34 +429,40 @@ const Rt = Ge(function({
|
|
|
423
429
|
/* @__PURE__ */ a(
|
|
424
430
|
oe,
|
|
425
431
|
{
|
|
426
|
-
checked:
|
|
432
|
+
checked: _.remind,
|
|
427
433
|
onChange: (e) => re("remind", e.target.checked),
|
|
428
434
|
children: "提醒弹出"
|
|
429
435
|
}
|
|
430
436
|
)
|
|
431
437
|
] })
|
|
432
438
|
] }),
|
|
433
|
-
Q ? /* @__PURE__ */ a("p", { className:
|
|
434
|
-
/* @__PURE__ */ a("div", { className:
|
|
439
|
+
Q ? /* @__PURE__ */ a("p", { className: n.error, children: Q }) : null,
|
|
440
|
+
/* @__PURE__ */ a("div", { className: P("inbox-bell-list-pane", n.listPane), children: /* @__PURE__ */ a(tt, { spinning: de && I.length === 0, children: !de && !Q && I.length === 0 ? /* @__PURE__ */ a(nt, { description: "暂无站内信" }) : I.length === 0 ? null : /* @__PURE__ */ d(
|
|
435
441
|
rt,
|
|
436
442
|
{
|
|
437
|
-
wrapperClassName:
|
|
438
|
-
className:
|
|
443
|
+
wrapperClassName: P("inbox-bell-list-scroll", n.listScroll),
|
|
444
|
+
className: n.listViewport,
|
|
439
445
|
"data-testid": "inbox-bell-list-scroll",
|
|
440
|
-
onScroll:
|
|
446
|
+
onScroll: Me,
|
|
441
447
|
children: [
|
|
442
|
-
/* @__PURE__ */ a("ul", { className:
|
|
443
|
-
const t =
|
|
448
|
+
/* @__PURE__ */ a("ul", { className: n.list, children: I.map((e) => {
|
|
449
|
+
const t = Ce(e.messageType), r = String(e.levelLabel || e.level || "").trim(), l = !!r, i = je(e.bodyHtml), s = Ve(
|
|
444
450
|
We(e)
|
|
445
|
-
), m = Qe(e), h = dt(e),
|
|
451
|
+
), m = Qe(e), h = dt(e), g = !!s.primary;
|
|
446
452
|
return /* @__PURE__ */ a("li", { children: /* @__PURE__ */ d(
|
|
447
453
|
"div",
|
|
448
454
|
{
|
|
449
|
-
className:
|
|
450
|
-
|
|
451
|
-
!e.read &&
|
|
452
|
-
m &&
|
|
455
|
+
className: P(
|
|
456
|
+
n.item,
|
|
457
|
+
!e.read && n.itemUnread,
|
|
458
|
+
m && n.itemStatic,
|
|
459
|
+
e.messageType === "alert" && n.accentAlert,
|
|
460
|
+
e.messageType === "action" && n.accentAction,
|
|
461
|
+
e.messageType === "remind" && n.accentRemind
|
|
453
462
|
),
|
|
463
|
+
style: e.levelColor ? {
|
|
464
|
+
"--inbox-accent": e.levelColor
|
|
465
|
+
} : void 0,
|
|
454
466
|
role: m ? void 0 : "button",
|
|
455
467
|
tabIndex: m ? void 0 : 0,
|
|
456
468
|
onClick: m ? void 0 : () => void ae(e),
|
|
@@ -458,46 +470,47 @@ const Rt = Ge(function({
|
|
|
458
470
|
(c.key === "Enter" || c.key === " ") && (c.preventDefault(), ae(e));
|
|
459
471
|
},
|
|
460
472
|
children: [
|
|
461
|
-
/* @__PURE__ */
|
|
462
|
-
|
|
463
|
-
|
|
473
|
+
/* @__PURE__ */ a("div", { className: n.itemRibbon, "aria-hidden": !0 }),
|
|
474
|
+
/* @__PURE__ */ d("div", { className: n.itemHeader, children: [
|
|
475
|
+
/* @__PURE__ */ d("span", { className: n.itemHeaderLeft, children: [
|
|
464
476
|
t ? /* @__PURE__ */ a(
|
|
465
477
|
se,
|
|
466
478
|
{
|
|
467
|
-
color:
|
|
468
|
-
className:
|
|
479
|
+
color: ke(e.messageType),
|
|
480
|
+
className: n.typeTag,
|
|
469
481
|
children: t
|
|
470
482
|
}
|
|
471
|
-
) : null
|
|
483
|
+
) : null,
|
|
484
|
+
/* @__PURE__ */ a("span", { className: n.itemTitle, title: e.title || "(无标题)", children: e.title || "(无标题)" })
|
|
472
485
|
] }),
|
|
473
|
-
/* @__PURE__ */ a("span", { className:
|
|
486
|
+
/* @__PURE__ */ a("span", { className: n.itemTime, children: e.createdAt || "" })
|
|
474
487
|
] }),
|
|
475
|
-
/* @__PURE__ */ a("div", { className:
|
|
488
|
+
/* @__PURE__ */ a("div", { className: n.itemBody, children: i ? /* @__PURE__ */ a(
|
|
476
489
|
"div",
|
|
477
490
|
{
|
|
478
|
-
className:
|
|
491
|
+
className: n.itemBodyHtml,
|
|
479
492
|
dangerouslySetInnerHTML: { __html: i }
|
|
480
493
|
}
|
|
481
|
-
) : e.summary ? /* @__PURE__ */ a("span", { className:
|
|
482
|
-
h ? /* @__PURE__ */ a("span", { className:
|
|
483
|
-
l ? /* @__PURE__ */ a("div", { className:
|
|
494
|
+
) : e.summary ? /* @__PURE__ */ a("span", { className: n.itemSummary, children: le(e.summary) }) : null }),
|
|
495
|
+
h ? /* @__PURE__ */ a("span", { className: n.itemMeta, children: h }) : null,
|
|
496
|
+
l ? /* @__PURE__ */ a("div", { className: n.itemFooterTags, children: /* @__PURE__ */ a(
|
|
484
497
|
se,
|
|
485
498
|
{
|
|
486
499
|
color: ut(e.levelColor),
|
|
487
500
|
selected: !0,
|
|
488
|
-
className:
|
|
489
|
-
children:
|
|
501
|
+
className: n.typeTag,
|
|
502
|
+
children: r
|
|
490
503
|
}
|
|
491
504
|
) }) : null,
|
|
492
|
-
|
|
505
|
+
g && s.primary ? /* @__PURE__ */ a(
|
|
493
506
|
"div",
|
|
494
507
|
{
|
|
495
|
-
className:
|
|
508
|
+
className: n.itemActions,
|
|
496
509
|
onClick: (c) => c.stopPropagation(),
|
|
497
510
|
onKeyDown: (c) => c.stopPropagation(),
|
|
498
511
|
children: /* @__PURE__ */ d(Ee, { size: 8, wrap: !0, children: [
|
|
499
512
|
/* @__PURE__ */ a(
|
|
500
|
-
|
|
513
|
+
D,
|
|
501
514
|
{
|
|
502
515
|
size: "small",
|
|
503
516
|
type: "primary",
|
|
@@ -506,7 +519,7 @@ const Rt = Ge(function({
|
|
|
506
519
|
}
|
|
507
520
|
),
|
|
508
521
|
s.secondary ? /* @__PURE__ */ a(
|
|
509
|
-
|
|
522
|
+
D,
|
|
510
523
|
{
|
|
511
524
|
size: "small",
|
|
512
525
|
type: "link",
|
|
@@ -521,7 +534,7 @@ const Rt = Ge(function({
|
|
|
521
534
|
}
|
|
522
535
|
) }, e.id);
|
|
523
536
|
}) }),
|
|
524
|
-
|
|
537
|
+
De ? /* @__PURE__ */ a("p", { className: P("inbox-bell-list-footer", n.listFooter), children: "加载中…" }) : null
|
|
525
538
|
]
|
|
526
539
|
}
|
|
527
540
|
) }) })
|
|
@@ -532,11 +545,11 @@ const Rt = Ge(function({
|
|
|
532
545
|
});
|
|
533
546
|
export {
|
|
534
547
|
Ut as DEFAULT_INBOX_TOAST_PREFS,
|
|
535
|
-
|
|
548
|
+
Pt as default,
|
|
536
549
|
Ve as filterInboxActionsForHost,
|
|
537
|
-
|
|
550
|
+
Dt as inboxSceneLabel,
|
|
538
551
|
Qe as isInboxButtonDriven,
|
|
539
|
-
|
|
552
|
+
Mt as isTerminalActionStatus,
|
|
540
553
|
Xe as loadInboxToastPrefs,
|
|
541
554
|
Ot as normalizeInboxActions,
|
|
542
555
|
We as resolveInboxItemActions,
|