@notificationapi/react 0.0.31 → 0.0.32
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/dist/assets/AntdIcon.js +4 -4
- package/dist/assets/Notification.js +3094 -2713
- package/dist/assets/PurePanel.js +2 -2
- package/dist/assets/RightOutlined.js +1 -1
- package/dist/assets/button.js +1394 -577
- package/dist/assets/channelUtils.js +1 -1
- package/dist/assets/colors.js +14798 -14301
- package/dist/assets/index.js +156 -158
- package/dist/assets/index2.js +212 -221
- package/dist/assets/index3.js +8307 -724
- package/dist/assets/pickAttrs.js +1 -1
- package/dist/assets/presets.js +810 -0
- package/dist/components/Notifications/Inbox.js +3520 -3323
- package/dist/components/Notifications/InboxHeader.d.ts +1 -2
- package/dist/components/Notifications/InboxHeader.js +2 -2
- package/dist/components/Notifications/Notification.js +1 -1
- package/dist/components/Notifications/NotificationFeed.js +1 -2
- package/dist/components/Preferences/NotificationPreferencesInline.d.ts +1 -2
- package/dist/components/Preferences/NotificationPreferencesPopup.d.ts +1 -2
- package/dist/components/Preferences/NotificationPreferencesPopup.js +1423 -857
- package/dist/components/Preferences/PreferenceInput.d.ts +1 -1
- package/dist/components/Preferences/PreferenceInput.js +843 -812
- package/dist/components/Preferences/Preferences.d.ts +1 -2
- package/dist/components/Preferences/Preferences.js +331 -328
- package/dist/components/Preferences/channelUtils.js +1 -1
- package/dist/components/Provider/index.js +8 -16
- package/package.json +5 -5
- package/dist/assets/index4.js +0 -8408
|
@@ -1,256 +1,258 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { NotificationAPIContext as
|
|
3
|
-
import * as
|
|
4
|
-
import
|
|
5
|
-
import { PreferenceInput as
|
|
6
|
-
import { R as
|
|
7
|
-
import { e as
|
|
8
|
-
import { d as
|
|
9
|
-
import { K as
|
|
10
|
-
import { p as
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
"&-active": {
|
|
17
|
-
transition: `height ${e.motionDurationMid} ${e.motionEaseInOut},
|
|
18
|
-
opacity ${e.motionDurationMid} ${e.motionEaseInOut} !important`
|
|
19
|
-
}
|
|
20
|
-
},
|
|
21
|
-
[`${e.antCls}-motion-collapse`]: {
|
|
22
|
-
overflow: "hidden",
|
|
23
|
-
transition: `height ${e.motionDurationMid} ${e.motionEaseInOut},
|
|
24
|
-
opacity ${e.motionDurationMid} ${e.motionEaseInOut} !important`
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
});
|
|
28
|
-
var Z = /* @__PURE__ */ b.forwardRef(function(e, n) {
|
|
29
|
-
var t = e.prefixCls, o = e.forceRender, i = e.className, c = e.style, f = e.children, r = e.isActive, s = e.role, a = b.useState(r || o), v = F(a, 2), d = v[0], m = v[1];
|
|
30
|
-
return b.useEffect(function() {
|
|
31
|
-
(o || r) && m(!0);
|
|
32
|
-
}, [o, r]), d ? /* @__PURE__ */ b.createElement("div", {
|
|
1
|
+
import { jsxs as re, Fragment as V, jsx as z } from "react/jsx-runtime";
|
|
2
|
+
import { NotificationAPIContext as le } from "../Provider/index.js";
|
|
3
|
+
import * as M from "react";
|
|
4
|
+
import h, { useContext as se } from "react";
|
|
5
|
+
import { PreferenceInput as W } from "./PreferenceInput.js";
|
|
6
|
+
import { R as ce } from "../../assets/RightOutlined.js";
|
|
7
|
+
import { e as J, c as D, f as K, d as Q, a as T, w as de, b as ue } from "../../assets/presets.js";
|
|
8
|
+
import { d as fe, _ as me, e as Y, a as Z, g as ve, m as pe, u as _, r as ge, f as Ce, c as X } from "../../assets/colors.js";
|
|
9
|
+
import { K as q, t as ee, u as be, e as ye, f as he, o as F } from "../../assets/index3.js";
|
|
10
|
+
import { p as xe } from "../../assets/pickAttrs.js";
|
|
11
|
+
var ne = /* @__PURE__ */ h.forwardRef(function(e, n) {
|
|
12
|
+
var a = e.prefixCls, t = e.forceRender, o = e.className, c = e.style, v = e.children, l = e.isActive, u = e.role, i = e.classNames, C = e.styles, f = h.useState(l || t), d = J(f, 2), r = d[0], g = d[1];
|
|
13
|
+
return h.useEffect(function() {
|
|
14
|
+
(t || l) && g(!0);
|
|
15
|
+
}, [t, l]), r ? /* @__PURE__ */ h.createElement("div", {
|
|
33
16
|
ref: n,
|
|
34
|
-
className: D("".concat(
|
|
17
|
+
className: D("".concat(a, "-content"), K(K({}, "".concat(a, "-content-active"), l), "".concat(a, "-content-inactive"), !l), o),
|
|
35
18
|
style: c,
|
|
36
|
-
role:
|
|
37
|
-
}, /* @__PURE__ */
|
|
38
|
-
className: "".concat(
|
|
39
|
-
|
|
19
|
+
role: u
|
|
20
|
+
}, /* @__PURE__ */ h.createElement("div", {
|
|
21
|
+
className: D("".concat(a, "-content-box"), i == null ? void 0 : i.body),
|
|
22
|
+
style: C == null ? void 0 : C.body
|
|
23
|
+
}, v)) : null;
|
|
40
24
|
});
|
|
41
|
-
|
|
42
|
-
var
|
|
43
|
-
var
|
|
44
|
-
|
|
45
|
-
},
|
|
46
|
-
(
|
|
47
|
-
},
|
|
25
|
+
ne.displayName = "PanelContent";
|
|
26
|
+
var Ie = ["showArrow", "headerClass", "isActive", "onItemClick", "forceRender", "className", "classNames", "styles", "prefixCls", "collapsible", "accordion", "panelKey", "extra", "header", "expandIcon", "openMotion", "destroyInactivePanel", "children"], ae = /* @__PURE__ */ h.forwardRef(function(e, n) {
|
|
27
|
+
var a = e.showArrow, t = a === void 0 ? !0 : a, o = e.headerClass, c = e.isActive, v = e.onItemClick, l = e.forceRender, u = e.className, i = e.classNames, C = i === void 0 ? {} : i, f = e.styles, d = f === void 0 ? {} : f, r = e.prefixCls, g = e.collapsible, x = e.accordion, s = e.panelKey, b = e.extra, $ = e.header, N = e.expandIcon, p = e.openMotion, S = e.destroyInactivePanel, y = e.children, E = Q(e, Ie), P = g === "disabled", w = g === "header", A = g === "icon", m = b != null && typeof b != "boolean", I = function() {
|
|
28
|
+
v == null || v(s);
|
|
29
|
+
}, O = function(B) {
|
|
30
|
+
(B.key === "Enter" || B.keyCode === q.ENTER || B.which === q.ENTER) && I();
|
|
31
|
+
}, R = typeof N == "function" ? N(e) : /* @__PURE__ */ h.createElement("i", {
|
|
48
32
|
className: "arrow"
|
|
49
33
|
});
|
|
50
|
-
|
|
51
|
-
className: "".concat(
|
|
52
|
-
onClick: ["header", "icon"].includes(
|
|
53
|
-
},
|
|
54
|
-
var
|
|
55
|
-
className:
|
|
34
|
+
R && (R = /* @__PURE__ */ h.createElement("div", {
|
|
35
|
+
className: "".concat(r, "-expand-icon"),
|
|
36
|
+
onClick: ["header", "icon"].includes(g) ? I : void 0
|
|
37
|
+
}, R));
|
|
38
|
+
var H = D(K(K(K({}, "".concat(r, "-item"), !0), "".concat(r, "-item-active"), c), "".concat(r, "-item-disabled"), P), u), G = D(o, K(K(K({}, "".concat(r, "-header"), !0), "".concat(r, "-header-collapsible-only"), w), "".concat(r, "-icon-collapsible-only"), A), C.header), k = {
|
|
39
|
+
className: G,
|
|
56
40
|
"aria-expanded": c,
|
|
57
|
-
"aria-disabled":
|
|
58
|
-
onKeyDown:
|
|
41
|
+
"aria-disabled": P,
|
|
42
|
+
onKeyDown: O,
|
|
43
|
+
style: d.header
|
|
59
44
|
};
|
|
60
|
-
return !
|
|
45
|
+
return !w && !A && (k.onClick = I, k.role = x ? "tab" : "button", k.tabIndex = P ? -1 : 0), /* @__PURE__ */ h.createElement("div", T({}, E, {
|
|
61
46
|
ref: n,
|
|
62
|
-
className:
|
|
63
|
-
}), /* @__PURE__ */
|
|
64
|
-
className: "".concat(
|
|
65
|
-
onClick:
|
|
66
|
-
},
|
|
67
|
-
className: "".concat(
|
|
68
|
-
},
|
|
47
|
+
className: H
|
|
48
|
+
}), /* @__PURE__ */ h.createElement("div", k, t && R, /* @__PURE__ */ h.createElement("span", {
|
|
49
|
+
className: "".concat(r, "-header-text"),
|
|
50
|
+
onClick: g === "header" ? I : void 0
|
|
51
|
+
}, $), m && /* @__PURE__ */ h.createElement("div", {
|
|
52
|
+
className: "".concat(r, "-extra")
|
|
53
|
+
}, b)), /* @__PURE__ */ h.createElement(fe, T({
|
|
69
54
|
visible: c,
|
|
70
|
-
leavedClassName: "".concat(
|
|
71
|
-
},
|
|
72
|
-
forceRender:
|
|
73
|
-
removeOnLeave:
|
|
74
|
-
}), function(
|
|
75
|
-
var
|
|
76
|
-
return /* @__PURE__ */
|
|
77
|
-
ref:
|
|
78
|
-
prefixCls:
|
|
79
|
-
className:
|
|
80
|
-
|
|
55
|
+
leavedClassName: "".concat(r, "-content-hidden")
|
|
56
|
+
}, p, {
|
|
57
|
+
forceRender: l,
|
|
58
|
+
removeOnLeave: S
|
|
59
|
+
}), function(j, B) {
|
|
60
|
+
var oe = j.className, ie = j.style;
|
|
61
|
+
return /* @__PURE__ */ h.createElement(ne, {
|
|
62
|
+
ref: B,
|
|
63
|
+
prefixCls: r,
|
|
64
|
+
className: oe,
|
|
65
|
+
classNames: C,
|
|
66
|
+
style: ie,
|
|
67
|
+
styles: d,
|
|
81
68
|
isActive: c,
|
|
82
|
-
forceRender:
|
|
83
|
-
role:
|
|
84
|
-
},
|
|
69
|
+
forceRender: l,
|
|
70
|
+
role: x ? "tabpanel" : void 0
|
|
71
|
+
}, y);
|
|
85
72
|
}));
|
|
86
|
-
}),
|
|
87
|
-
var
|
|
88
|
-
return n.map(function(
|
|
89
|
-
var
|
|
90
|
-
|
|
91
|
-
},
|
|
92
|
-
return
|
|
93
|
-
prefixCls:
|
|
94
|
-
key:
|
|
95
|
-
panelKey:
|
|
96
|
-
isActive:
|
|
97
|
-
accordion:
|
|
98
|
-
openMotion:
|
|
99
|
-
expandIcon:
|
|
100
|
-
header:
|
|
101
|
-
collapsible:
|
|
73
|
+
}), $e = ["children", "label", "key", "collapsible", "onItemClick", "destroyInactivePanel"], Ne = function(n, a) {
|
|
74
|
+
var t = a.prefixCls, o = a.accordion, c = a.collapsible, v = a.destroyInactivePanel, l = a.onItemClick, u = a.activeKey, i = a.openMotion, C = a.expandIcon;
|
|
75
|
+
return n.map(function(f, d) {
|
|
76
|
+
var r = f.children, g = f.label, x = f.key, s = f.collapsible, b = f.onItemClick, $ = f.destroyInactivePanel, N = Q(f, $e), p = String(x ?? d), S = s ?? c, y = $ ?? v, E = function(A) {
|
|
77
|
+
S !== "disabled" && (l(A), b == null || b(A));
|
|
78
|
+
}, P = !1;
|
|
79
|
+
return o ? P = u[0] === p : P = u.indexOf(p) > -1, /* @__PURE__ */ h.createElement(ae, T({}, N, {
|
|
80
|
+
prefixCls: t,
|
|
81
|
+
key: p,
|
|
82
|
+
panelKey: p,
|
|
83
|
+
isActive: P,
|
|
84
|
+
accordion: o,
|
|
85
|
+
openMotion: i,
|
|
86
|
+
expandIcon: C,
|
|
87
|
+
header: g,
|
|
88
|
+
collapsible: S,
|
|
102
89
|
onItemClick: E,
|
|
103
|
-
destroyInactivePanel:
|
|
104
|
-
}),
|
|
90
|
+
destroyInactivePanel: y
|
|
91
|
+
}), r);
|
|
105
92
|
});
|
|
106
|
-
},
|
|
107
|
-
if (!n)
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
openMotion: v,
|
|
93
|
+
}, Pe = function(n, a, t) {
|
|
94
|
+
if (!n) return null;
|
|
95
|
+
var o = t.prefixCls, c = t.accordion, v = t.collapsible, l = t.destroyInactivePanel, u = t.onItemClick, i = t.activeKey, C = t.openMotion, f = t.expandIcon, d = n.key || String(a), r = n.props, g = r.header, x = r.headerClass, s = r.destroyInactivePanel, b = r.collapsible, $ = r.onItemClick, N = !1;
|
|
96
|
+
c ? N = i[0] === d : N = i.indexOf(d) > -1;
|
|
97
|
+
var p = b ?? v, S = function(P) {
|
|
98
|
+
p !== "disabled" && (u(P), $ == null || $(P));
|
|
99
|
+
}, y = {
|
|
100
|
+
key: d,
|
|
101
|
+
panelKey: d,
|
|
102
|
+
header: g,
|
|
103
|
+
headerClass: x,
|
|
104
|
+
isActive: N,
|
|
105
|
+
prefixCls: o,
|
|
106
|
+
destroyInactivePanel: s ?? l,
|
|
107
|
+
openMotion: C,
|
|
122
108
|
accordion: c,
|
|
123
109
|
children: n.props.children,
|
|
124
|
-
onItemClick:
|
|
125
|
-
expandIcon:
|
|
126
|
-
collapsible:
|
|
110
|
+
onItemClick: S,
|
|
111
|
+
expandIcon: f,
|
|
112
|
+
collapsible: p
|
|
127
113
|
};
|
|
128
|
-
return typeof n.type == "string" ? n : (Object.keys(
|
|
129
|
-
typeof
|
|
130
|
-
}), /* @__PURE__ */
|
|
114
|
+
return typeof n.type == "string" ? n : (Object.keys(y).forEach(function(E) {
|
|
115
|
+
typeof y[E] > "u" && delete y[E];
|
|
116
|
+
}), /* @__PURE__ */ h.cloneElement(n, y));
|
|
131
117
|
};
|
|
132
|
-
function
|
|
133
|
-
return Array.isArray(e) ?
|
|
134
|
-
return
|
|
118
|
+
function we(e, n, a) {
|
|
119
|
+
return Array.isArray(e) ? Ne(e, a) : ee(n).map(function(t, o) {
|
|
120
|
+
return Pe(t, o, a);
|
|
135
121
|
});
|
|
136
122
|
}
|
|
137
|
-
function
|
|
123
|
+
function Se(e) {
|
|
138
124
|
var n = e;
|
|
139
125
|
if (!Array.isArray(n)) {
|
|
140
|
-
var
|
|
141
|
-
n =
|
|
126
|
+
var a = ue(n);
|
|
127
|
+
n = a === "number" || a === "string" ? [n] : [];
|
|
142
128
|
}
|
|
143
|
-
return n.map(function(
|
|
144
|
-
return String(
|
|
129
|
+
return n.map(function(t) {
|
|
130
|
+
return String(t);
|
|
145
131
|
});
|
|
146
132
|
}
|
|
147
|
-
var
|
|
148
|
-
var
|
|
149
|
-
value:
|
|
150
|
-
onChange: function(
|
|
151
|
-
return
|
|
133
|
+
var Ee = /* @__PURE__ */ h.forwardRef(function(e, n) {
|
|
134
|
+
var a = e.prefixCls, t = a === void 0 ? "rc-collapse" : a, o = e.destroyInactivePanel, c = o === void 0 ? !1 : o, v = e.style, l = e.accordion, u = e.className, i = e.children, C = e.collapsible, f = e.openMotion, d = e.expandIcon, r = e.activeKey, g = e.defaultActiveKey, x = e.onChange, s = e.items, b = D(t, u), $ = be([], {
|
|
135
|
+
value: r,
|
|
136
|
+
onChange: function(w) {
|
|
137
|
+
return x == null ? void 0 : x(w);
|
|
152
138
|
},
|
|
153
|
-
defaultValue:
|
|
154
|
-
postState:
|
|
155
|
-
}),
|
|
156
|
-
return
|
|
157
|
-
if (
|
|
158
|
-
return
|
|
159
|
-
var A =
|
|
160
|
-
return
|
|
161
|
-
return
|
|
162
|
-
}) : [].concat(
|
|
139
|
+
defaultValue: g,
|
|
140
|
+
postState: Se
|
|
141
|
+
}), N = J($, 2), p = N[0], S = N[1], y = function(w) {
|
|
142
|
+
return S(function() {
|
|
143
|
+
if (l)
|
|
144
|
+
return p[0] === w ? [] : [w];
|
|
145
|
+
var A = p.indexOf(w), m = A > -1;
|
|
146
|
+
return m ? p.filter(function(I) {
|
|
147
|
+
return I !== w;
|
|
148
|
+
}) : [].concat(me(p), [w]);
|
|
163
149
|
});
|
|
164
150
|
};
|
|
165
|
-
|
|
166
|
-
var E =
|
|
167
|
-
prefixCls:
|
|
168
|
-
accordion:
|
|
169
|
-
openMotion:
|
|
170
|
-
expandIcon:
|
|
171
|
-
collapsible:
|
|
151
|
+
de(!i, "[rc-collapse] `children` will be removed in next major version. Please use `items` instead.");
|
|
152
|
+
var E = we(s, i, {
|
|
153
|
+
prefixCls: t,
|
|
154
|
+
accordion: l,
|
|
155
|
+
openMotion: f,
|
|
156
|
+
expandIcon: d,
|
|
157
|
+
collapsible: C,
|
|
172
158
|
destroyInactivePanel: c,
|
|
173
|
-
onItemClick:
|
|
174
|
-
activeKey:
|
|
159
|
+
onItemClick: y,
|
|
160
|
+
activeKey: p
|
|
175
161
|
});
|
|
176
|
-
return /* @__PURE__ */
|
|
162
|
+
return /* @__PURE__ */ h.createElement("div", T({
|
|
177
163
|
ref: n,
|
|
178
|
-
className:
|
|
179
|
-
style:
|
|
180
|
-
role:
|
|
181
|
-
},
|
|
164
|
+
className: b,
|
|
165
|
+
style: v,
|
|
166
|
+
role: l ? "tablist" : void 0
|
|
167
|
+
}, xe(e, {
|
|
182
168
|
aria: !0,
|
|
183
169
|
data: !0
|
|
184
170
|
})), E);
|
|
185
171
|
});
|
|
186
|
-
const
|
|
172
|
+
const L = Object.assign(Ee, {
|
|
187
173
|
/**
|
|
188
174
|
* @deprecated use `items` instead, will be removed in `v4.0.0`
|
|
189
175
|
*/
|
|
190
|
-
Panel:
|
|
176
|
+
Panel: ae
|
|
191
177
|
});
|
|
192
|
-
|
|
193
|
-
const
|
|
194
|
-
process.env.NODE_ENV !== "production" &&
|
|
178
|
+
L.Panel;
|
|
179
|
+
const Ae = /* @__PURE__ */ M.forwardRef((e, n) => {
|
|
180
|
+
process.env.NODE_ENV !== "production" && Y("Collapse.Panel").deprecated(!("disabled" in e), "disabled", 'collapsible="disabled"');
|
|
195
181
|
const {
|
|
196
|
-
getPrefixCls:
|
|
197
|
-
} =
|
|
198
|
-
prefixCls:
|
|
199
|
-
className:
|
|
182
|
+
getPrefixCls: a
|
|
183
|
+
} = M.useContext(Z), {
|
|
184
|
+
prefixCls: t,
|
|
185
|
+
className: o,
|
|
200
186
|
showArrow: c = !0
|
|
201
|
-
} = e,
|
|
202
|
-
[`${
|
|
203
|
-
},
|
|
204
|
-
return /* @__PURE__ */
|
|
187
|
+
} = e, v = a("collapse", t), l = D({
|
|
188
|
+
[`${v}-no-arrow`]: !c
|
|
189
|
+
}, o);
|
|
190
|
+
return /* @__PURE__ */ M.createElement(L.Panel, Object.assign({
|
|
205
191
|
ref: n
|
|
206
192
|
}, e, {
|
|
207
|
-
prefixCls:
|
|
208
|
-
className:
|
|
193
|
+
prefixCls: v,
|
|
194
|
+
className: l
|
|
209
195
|
}));
|
|
210
|
-
}),
|
|
196
|
+
}), Me = (e) => ({
|
|
197
|
+
[e.componentCls]: {
|
|
198
|
+
// For common/openAnimation
|
|
199
|
+
[`${e.antCls}-motion-collapse-legacy`]: {
|
|
200
|
+
overflow: "hidden",
|
|
201
|
+
"&-active": {
|
|
202
|
+
transition: `height ${e.motionDurationMid} ${e.motionEaseInOut},
|
|
203
|
+
opacity ${e.motionDurationMid} ${e.motionEaseInOut} !important`
|
|
204
|
+
}
|
|
205
|
+
},
|
|
206
|
+
[`${e.antCls}-motion-collapse`]: {
|
|
207
|
+
overflow: "hidden",
|
|
208
|
+
transition: `height ${e.motionDurationMid} ${e.motionEaseInOut},
|
|
209
|
+
opacity ${e.motionDurationMid} ${e.motionEaseInOut} !important`
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
}), Oe = (e) => {
|
|
211
213
|
const {
|
|
212
214
|
componentCls: n,
|
|
213
|
-
contentBg:
|
|
214
|
-
padding:
|
|
215
|
-
headerBg:
|
|
215
|
+
contentBg: a,
|
|
216
|
+
padding: t,
|
|
217
|
+
headerBg: o,
|
|
216
218
|
headerPadding: c,
|
|
217
|
-
collapseHeaderPaddingSM:
|
|
218
|
-
collapseHeaderPaddingLG:
|
|
219
|
-
collapsePanelBorderRadius:
|
|
220
|
-
lineWidth:
|
|
221
|
-
lineType:
|
|
222
|
-
colorBorder:
|
|
223
|
-
colorText:
|
|
224
|
-
colorTextHeading:
|
|
225
|
-
colorTextDisabled:
|
|
226
|
-
fontSizeLG:
|
|
227
|
-
lineHeight:
|
|
228
|
-
lineHeightLG:
|
|
229
|
-
marginSM:
|
|
230
|
-
paddingSM:
|
|
231
|
-
paddingLG:
|
|
232
|
-
paddingXS:
|
|
233
|
-
motionDurationSlow:
|
|
219
|
+
collapseHeaderPaddingSM: v,
|
|
220
|
+
collapseHeaderPaddingLG: l,
|
|
221
|
+
collapsePanelBorderRadius: u,
|
|
222
|
+
lineWidth: i,
|
|
223
|
+
lineType: C,
|
|
224
|
+
colorBorder: f,
|
|
225
|
+
colorText: d,
|
|
226
|
+
colorTextHeading: r,
|
|
227
|
+
colorTextDisabled: g,
|
|
228
|
+
fontSizeLG: x,
|
|
229
|
+
lineHeight: s,
|
|
230
|
+
lineHeightLG: b,
|
|
231
|
+
marginSM: $,
|
|
232
|
+
paddingSM: N,
|
|
233
|
+
paddingLG: p,
|
|
234
|
+
paddingXS: S,
|
|
235
|
+
motionDurationSlow: y,
|
|
234
236
|
fontSizeIcon: E,
|
|
235
|
-
contentPadding:
|
|
236
|
-
fontHeight:
|
|
237
|
+
contentPadding: P,
|
|
238
|
+
fontHeight: w,
|
|
237
239
|
fontHeightLG: A
|
|
238
|
-
} = e,
|
|
240
|
+
} = e, m = `${_(i)} ${C} ${f}`;
|
|
239
241
|
return {
|
|
240
|
-
[n]: Object.assign(Object.assign({},
|
|
241
|
-
backgroundColor:
|
|
242
|
-
border:
|
|
243
|
-
borderRadius:
|
|
242
|
+
[n]: Object.assign(Object.assign({}, ge(e)), {
|
|
243
|
+
backgroundColor: o,
|
|
244
|
+
border: m,
|
|
245
|
+
borderRadius: u,
|
|
244
246
|
"&-rtl": {
|
|
245
247
|
direction: "rtl"
|
|
246
248
|
},
|
|
247
249
|
[`& > ${n}-item`]: {
|
|
248
|
-
borderBottom:
|
|
250
|
+
borderBottom: m,
|
|
249
251
|
"&:last-child": {
|
|
250
252
|
[`
|
|
251
253
|
&,
|
|
252
254
|
& > ${n}-header`]: {
|
|
253
|
-
borderRadius: `0 0 ${
|
|
255
|
+
borderRadius: `0 0 ${_(u)} ${_(u)}`
|
|
254
256
|
}
|
|
255
257
|
},
|
|
256
258
|
[`> ${n}-header`]: {
|
|
@@ -260,10 +262,10 @@ const Se = /* @__PURE__ */ O.forwardRef((e, n) => {
|
|
|
260
262
|
flexWrap: "nowrap",
|
|
261
263
|
alignItems: "flex-start",
|
|
262
264
|
padding: c,
|
|
263
|
-
color:
|
|
264
|
-
lineHeight:
|
|
265
|
+
color: r,
|
|
266
|
+
lineHeight: s,
|
|
265
267
|
cursor: "pointer",
|
|
266
|
-
transition: `all ${
|
|
268
|
+
transition: `all ${y}, visibility 0s`,
|
|
267
269
|
[`> ${n}-header-text`]: {
|
|
268
270
|
flex: "auto"
|
|
269
271
|
},
|
|
@@ -272,18 +274,18 @@ const Se = /* @__PURE__ */ O.forwardRef((e, n) => {
|
|
|
272
274
|
},
|
|
273
275
|
// >>>>> Arrow
|
|
274
276
|
[`${n}-expand-icon`]: {
|
|
275
|
-
height:
|
|
277
|
+
height: w,
|
|
276
278
|
display: "flex",
|
|
277
279
|
alignItems: "center",
|
|
278
|
-
paddingInlineEnd:
|
|
280
|
+
paddingInlineEnd: $
|
|
279
281
|
},
|
|
280
|
-
[`${n}-arrow`]: Object.assign(Object.assign({},
|
|
282
|
+
[`${n}-arrow`]: Object.assign(Object.assign({}, Ce()), {
|
|
281
283
|
fontSize: E,
|
|
282
284
|
// when `transform: rotate()` is applied to icon's root element
|
|
283
|
-
transition: `transform ${
|
|
285
|
+
transition: `transform ${y}`,
|
|
284
286
|
// when `transform: rotate()` is applied to icon's child element
|
|
285
287
|
svg: {
|
|
286
|
-
transition: `transform ${
|
|
288
|
+
transition: `transform ${y}`
|
|
287
289
|
}
|
|
288
290
|
}),
|
|
289
291
|
// >>>>> Text
|
|
@@ -299,11 +301,11 @@ const Se = /* @__PURE__ */ O.forwardRef((e, n) => {
|
|
|
299
301
|
}
|
|
300
302
|
},
|
|
301
303
|
[`${n}-content`]: {
|
|
302
|
-
color:
|
|
303
|
-
backgroundColor:
|
|
304
|
-
borderTop:
|
|
304
|
+
color: d,
|
|
305
|
+
backgroundColor: a,
|
|
306
|
+
borderTop: m,
|
|
305
307
|
[`& > ${n}-content-box`]: {
|
|
306
|
-
padding:
|
|
308
|
+
padding: P
|
|
307
309
|
},
|
|
308
310
|
"&-hidden": {
|
|
309
311
|
display: "none"
|
|
@@ -312,45 +314,45 @@ const Se = /* @__PURE__ */ O.forwardRef((e, n) => {
|
|
|
312
314
|
"&-small": {
|
|
313
315
|
[`> ${n}-item`]: {
|
|
314
316
|
[`> ${n}-header`]: {
|
|
315
|
-
padding:
|
|
316
|
-
paddingInlineStart:
|
|
317
|
+
padding: v,
|
|
318
|
+
paddingInlineStart: S,
|
|
317
319
|
[`> ${n}-expand-icon`]: {
|
|
318
320
|
// Arrow offset
|
|
319
|
-
marginInlineStart: e.calc(
|
|
321
|
+
marginInlineStart: e.calc(N).sub(S).equal()
|
|
320
322
|
}
|
|
321
323
|
},
|
|
322
324
|
[`> ${n}-content > ${n}-content-box`]: {
|
|
323
|
-
padding:
|
|
325
|
+
padding: N
|
|
324
326
|
}
|
|
325
327
|
}
|
|
326
328
|
},
|
|
327
329
|
"&-large": {
|
|
328
330
|
[`> ${n}-item`]: {
|
|
329
|
-
fontSize:
|
|
330
|
-
lineHeight:
|
|
331
|
+
fontSize: x,
|
|
332
|
+
lineHeight: b,
|
|
331
333
|
[`> ${n}-header`]: {
|
|
332
|
-
padding:
|
|
333
|
-
paddingInlineStart:
|
|
334
|
+
padding: l,
|
|
335
|
+
paddingInlineStart: t,
|
|
334
336
|
[`> ${n}-expand-icon`]: {
|
|
335
337
|
height: A,
|
|
336
338
|
// Arrow offset
|
|
337
|
-
marginInlineStart: e.calc(
|
|
339
|
+
marginInlineStart: e.calc(p).sub(t).equal()
|
|
338
340
|
}
|
|
339
341
|
},
|
|
340
342
|
[`> ${n}-content > ${n}-content-box`]: {
|
|
341
|
-
padding:
|
|
343
|
+
padding: p
|
|
342
344
|
}
|
|
343
345
|
}
|
|
344
346
|
},
|
|
345
347
|
[`${n}-item:last-child`]: {
|
|
346
348
|
borderBottom: 0,
|
|
347
349
|
[`> ${n}-content`]: {
|
|
348
|
-
borderRadius: `0 0 ${
|
|
350
|
+
borderRadius: `0 0 ${_(u)} ${_(u)}`
|
|
349
351
|
}
|
|
350
352
|
},
|
|
351
353
|
[`& ${n}-item-disabled > ${n}-header`]: {
|
|
352
354
|
"\n &,\n & > .arrow\n ": {
|
|
353
|
-
color:
|
|
355
|
+
color: g,
|
|
354
356
|
cursor: "not-allowed"
|
|
355
357
|
}
|
|
356
358
|
},
|
|
@@ -361,37 +363,37 @@ const Se = /* @__PURE__ */ O.forwardRef((e, n) => {
|
|
|
361
363
|
[`${n}-expand-icon`]: {
|
|
362
364
|
order: 1,
|
|
363
365
|
paddingInlineEnd: 0,
|
|
364
|
-
paddingInlineStart:
|
|
366
|
+
paddingInlineStart: $
|
|
365
367
|
}
|
|
366
368
|
}
|
|
367
369
|
}
|
|
368
370
|
}
|
|
369
371
|
})
|
|
370
372
|
};
|
|
371
|
-
},
|
|
373
|
+
}, _e = (e) => {
|
|
372
374
|
const {
|
|
373
375
|
componentCls: n
|
|
374
|
-
} = e,
|
|
376
|
+
} = e, a = `> ${n}-item > ${n}-header ${n}-arrow`;
|
|
375
377
|
return {
|
|
376
378
|
[`${n}-rtl`]: {
|
|
377
|
-
[
|
|
379
|
+
[a]: {
|
|
378
380
|
transform: "rotate(180deg)"
|
|
379
381
|
}
|
|
380
382
|
}
|
|
381
383
|
};
|
|
382
|
-
},
|
|
384
|
+
}, Re = (e) => {
|
|
383
385
|
const {
|
|
384
386
|
componentCls: n,
|
|
385
|
-
headerBg:
|
|
386
|
-
paddingXXS:
|
|
387
|
-
colorBorder:
|
|
387
|
+
headerBg: a,
|
|
388
|
+
paddingXXS: t,
|
|
389
|
+
colorBorder: o
|
|
388
390
|
} = e;
|
|
389
391
|
return {
|
|
390
392
|
[`${n}-borderless`]: {
|
|
391
|
-
backgroundColor:
|
|
393
|
+
backgroundColor: a,
|
|
392
394
|
border: 0,
|
|
393
395
|
[`> ${n}-item`]: {
|
|
394
|
-
borderBottom: `1px solid ${
|
|
396
|
+
borderBottom: `1px solid ${o}`
|
|
395
397
|
},
|
|
396
398
|
[`
|
|
397
399
|
> ${n}-item:last-child,
|
|
@@ -407,14 +409,14 @@ const Se = /* @__PURE__ */ O.forwardRef((e, n) => {
|
|
|
407
409
|
borderTop: 0
|
|
408
410
|
},
|
|
409
411
|
[`> ${n}-item > ${n}-content > ${n}-content-box`]: {
|
|
410
|
-
paddingTop:
|
|
412
|
+
paddingTop: t
|
|
411
413
|
}
|
|
412
414
|
}
|
|
413
415
|
};
|
|
414
|
-
},
|
|
416
|
+
}, ke = (e) => {
|
|
415
417
|
const {
|
|
416
418
|
componentCls: n,
|
|
417
|
-
paddingSM:
|
|
419
|
+
paddingSM: a
|
|
418
420
|
} = e;
|
|
419
421
|
return {
|
|
420
422
|
[`${n}-ghost`]: {
|
|
@@ -426,156 +428,157 @@ const Se = /* @__PURE__ */ O.forwardRef((e, n) => {
|
|
|
426
428
|
backgroundColor: "transparent",
|
|
427
429
|
border: 0,
|
|
428
430
|
[`> ${n}-content-box`]: {
|
|
429
|
-
paddingBlock:
|
|
431
|
+
paddingBlock: a
|
|
430
432
|
}
|
|
431
433
|
}
|
|
432
434
|
}
|
|
433
435
|
}
|
|
434
436
|
};
|
|
435
|
-
},
|
|
437
|
+
}, Ke = (e) => ({
|
|
436
438
|
headerPadding: `${e.paddingSM}px ${e.padding}px`,
|
|
437
439
|
headerBg: e.colorFillAlter,
|
|
438
440
|
contentPadding: `${e.padding}px 16px`,
|
|
439
441
|
// Fixed Value
|
|
440
442
|
contentBg: e.colorBgContainer
|
|
441
|
-
}),
|
|
442
|
-
const n =
|
|
443
|
-
collapseHeaderPaddingSM: `${
|
|
444
|
-
collapseHeaderPaddingLG: `${
|
|
443
|
+
}), De = ve("Collapse", (e) => {
|
|
444
|
+
const n = pe(e, {
|
|
445
|
+
collapseHeaderPaddingSM: `${_(e.paddingXS)} ${_(e.paddingSM)}`,
|
|
446
|
+
collapseHeaderPaddingLG: `${_(e.padding)} ${_(e.paddingLG)}`,
|
|
445
447
|
collapsePanelBorderRadius: e.borderRadiusLG
|
|
446
448
|
});
|
|
447
|
-
return [
|
|
448
|
-
},
|
|
449
|
+
return [Oe(n), Re(n), ke(n), _e(n), Me(n)];
|
|
450
|
+
}, Ke), te = /* @__PURE__ */ M.forwardRef((e, n) => {
|
|
449
451
|
const {
|
|
450
|
-
getPrefixCls:
|
|
451
|
-
direction:
|
|
452
|
-
collapse:
|
|
453
|
-
} =
|
|
452
|
+
getPrefixCls: a,
|
|
453
|
+
direction: t,
|
|
454
|
+
collapse: o
|
|
455
|
+
} = M.useContext(Z), {
|
|
454
456
|
prefixCls: c,
|
|
455
|
-
className:
|
|
456
|
-
rootClassName:
|
|
457
|
-
style:
|
|
458
|
-
bordered:
|
|
459
|
-
ghost:
|
|
460
|
-
size:
|
|
461
|
-
expandIconPosition:
|
|
462
|
-
children:
|
|
463
|
-
expandIcon:
|
|
464
|
-
} = e,
|
|
465
|
-
var
|
|
466
|
-
return (
|
|
467
|
-
}),
|
|
457
|
+
className: v,
|
|
458
|
+
rootClassName: l,
|
|
459
|
+
style: u,
|
|
460
|
+
bordered: i = !0,
|
|
461
|
+
ghost: C,
|
|
462
|
+
size: f,
|
|
463
|
+
expandIconPosition: d = "start",
|
|
464
|
+
children: r,
|
|
465
|
+
expandIcon: g
|
|
466
|
+
} = e, x = ye((m) => {
|
|
467
|
+
var I;
|
|
468
|
+
return (I = f ?? m) !== null && I !== void 0 ? I : "middle";
|
|
469
|
+
}), s = a("collapse", c), b = a(), [$, N, p] = De(s);
|
|
468
470
|
if (process.env.NODE_ENV !== "production") {
|
|
469
|
-
const
|
|
470
|
-
process.env.NODE_ENV !== "production" &&
|
|
471
|
+
const m = Y("Collapse");
|
|
472
|
+
process.env.NODE_ENV !== "production" && m(d !== "left" && d !== "right", "deprecated", "`expandIconPosition` with `left` or `right` is deprecated. Please use `start` or `end` instead.");
|
|
471
473
|
}
|
|
472
|
-
const
|
|
473
|
-
let
|
|
474
|
-
const
|
|
475
|
-
rotate:
|
|
474
|
+
const S = M.useMemo(() => d === "left" ? "start" : d === "right" ? "end" : d, [d]), y = g ?? (o == null ? void 0 : o.expandIcon), E = M.useCallback(function() {
|
|
475
|
+
let m = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
476
|
+
const I = typeof y == "function" ? y(m) : /* @__PURE__ */ M.createElement(ce, {
|
|
477
|
+
rotate: m.isActive ? 90 : void 0,
|
|
478
|
+
"aria-label": m.isActive ? "expanded" : "collapsed"
|
|
476
479
|
});
|
|
477
|
-
return
|
|
478
|
-
var
|
|
480
|
+
return X(I, () => {
|
|
481
|
+
var O;
|
|
479
482
|
return {
|
|
480
|
-
className: D((
|
|
483
|
+
className: D((O = I == null ? void 0 : I.props) === null || O === void 0 ? void 0 : O.className, `${s}-arrow`)
|
|
481
484
|
};
|
|
482
485
|
});
|
|
483
|
-
}, [
|
|
484
|
-
[`${
|
|
485
|
-
[`${
|
|
486
|
-
[`${
|
|
487
|
-
[`${
|
|
488
|
-
},
|
|
486
|
+
}, [y, s]), P = D(`${s}-icon-position-${S}`, {
|
|
487
|
+
[`${s}-borderless`]: !i,
|
|
488
|
+
[`${s}-rtl`]: t === "rtl",
|
|
489
|
+
[`${s}-ghost`]: !!C,
|
|
490
|
+
[`${s}-${x}`]: x !== "middle"
|
|
491
|
+
}, o == null ? void 0 : o.className, v, l, N, p), w = Object.assign(Object.assign({}, he(b)), {
|
|
489
492
|
motionAppear: !1,
|
|
490
|
-
leavedClassName: `${
|
|
491
|
-
}), A =
|
|
492
|
-
var
|
|
493
|
-
if (!((
|
|
494
|
-
const
|
|
495
|
-
disabled:
|
|
496
|
-
collapsible:
|
|
497
|
-
} =
|
|
498
|
-
key:
|
|
499
|
-
collapsible:
|
|
493
|
+
leavedClassName: `${s}-content-hidden`
|
|
494
|
+
}), A = M.useMemo(() => r ? ee(r).map((m, I) => {
|
|
495
|
+
var O, R;
|
|
496
|
+
if (!((O = m.props) === null || O === void 0) && O.disabled) {
|
|
497
|
+
const H = (R = m.key) !== null && R !== void 0 ? R : String(I), {
|
|
498
|
+
disabled: G,
|
|
499
|
+
collapsible: k
|
|
500
|
+
} = m.props, j = Object.assign(Object.assign({}, F(m.props, ["disabled"])), {
|
|
501
|
+
key: H,
|
|
502
|
+
collapsible: k ?? (G ? "disabled" : void 0)
|
|
500
503
|
});
|
|
501
|
-
return
|
|
504
|
+
return X(m, j);
|
|
502
505
|
}
|
|
503
|
-
return
|
|
504
|
-
}) : null, [
|
|
505
|
-
return
|
|
506
|
+
return m;
|
|
507
|
+
}) : null, [r]);
|
|
508
|
+
return $(
|
|
506
509
|
// @ts-ignore
|
|
507
|
-
/* @__PURE__ */
|
|
510
|
+
/* @__PURE__ */ M.createElement(L, Object.assign({
|
|
508
511
|
ref: n,
|
|
509
|
-
openMotion:
|
|
510
|
-
},
|
|
512
|
+
openMotion: w
|
|
513
|
+
}, F(e, ["rootClassName"]), {
|
|
511
514
|
expandIcon: E,
|
|
512
|
-
prefixCls:
|
|
513
|
-
className:
|
|
514
|
-
style: Object.assign(Object.assign({},
|
|
515
|
+
prefixCls: s,
|
|
516
|
+
className: P,
|
|
517
|
+
style: Object.assign(Object.assign({}, o == null ? void 0 : o.style), u)
|
|
515
518
|
}), A)
|
|
516
519
|
);
|
|
517
520
|
});
|
|
518
|
-
process.env.NODE_ENV !== "production" && (
|
|
519
|
-
const
|
|
520
|
-
Panel:
|
|
521
|
+
process.env.NODE_ENV !== "production" && (te.displayName = "Collapse");
|
|
522
|
+
const U = Object.assign(te, {
|
|
523
|
+
Panel: Ae
|
|
521
524
|
});
|
|
522
|
-
function
|
|
523
|
-
const e =
|
|
525
|
+
function Xe() {
|
|
526
|
+
const e = se(le);
|
|
524
527
|
if (!e || !e.preferences)
|
|
525
528
|
return null;
|
|
526
|
-
const n = e.preferences.notifications.sort((
|
|
527
|
-
var
|
|
528
|
-
const
|
|
529
|
-
(
|
|
530
|
-
),
|
|
531
|
-
(
|
|
532
|
-
), c = (
|
|
533
|
-
(
|
|
534
|
-
(
|
|
529
|
+
const n = e.preferences.notifications.sort((a, t) => a.title.localeCompare(t.title)).map((a) => {
|
|
530
|
+
var v, l, u;
|
|
531
|
+
const t = (v = e.preferences) == null ? void 0 : v.preferences.filter(
|
|
532
|
+
(i) => i.notificationId === a.notificationId && !i.subNotificationId
|
|
533
|
+
), o = (l = e.preferences) == null ? void 0 : l.preferences.filter(
|
|
534
|
+
(i) => i.notificationId === a.notificationId && i.subNotificationId
|
|
535
|
+
), c = (u = e.preferences) == null ? void 0 : u.subNotifications.filter(
|
|
536
|
+
(i) => o == null ? void 0 : o.find(
|
|
537
|
+
(C) => C.subNotificationId === i.subNotificationId
|
|
535
538
|
)
|
|
536
539
|
);
|
|
537
540
|
return {
|
|
538
|
-
label:
|
|
539
|
-
key:
|
|
540
|
-
children: /* @__PURE__ */
|
|
541
|
-
/* @__PURE__ */
|
|
542
|
-
|
|
541
|
+
label: a.title,
|
|
542
|
+
key: a.notificationId,
|
|
543
|
+
children: /* @__PURE__ */ re(V, { children: [
|
|
544
|
+
/* @__PURE__ */ z(
|
|
545
|
+
W,
|
|
543
546
|
{
|
|
544
|
-
notification:
|
|
545
|
-
preferences:
|
|
547
|
+
notification: a,
|
|
548
|
+
preferences: t || [],
|
|
546
549
|
updateDelivery: e.updateDelivery
|
|
547
550
|
},
|
|
548
|
-
|
|
551
|
+
a.notificationId
|
|
549
552
|
),
|
|
550
|
-
c == null ? void 0 : c.map((
|
|
551
|
-
|
|
553
|
+
c == null ? void 0 : c.map((i) => /* @__PURE__ */ z(
|
|
554
|
+
U,
|
|
552
555
|
{
|
|
553
556
|
bordered: !1,
|
|
554
557
|
items: [
|
|
555
558
|
{
|
|
556
|
-
label:
|
|
557
|
-
key:
|
|
558
|
-
children: /* @__PURE__ */
|
|
559
|
-
|
|
559
|
+
label: i.title,
|
|
560
|
+
key: i.subNotificationId,
|
|
561
|
+
children: /* @__PURE__ */ z(
|
|
562
|
+
W,
|
|
560
563
|
{
|
|
561
|
-
notification:
|
|
562
|
-
preferences:
|
|
564
|
+
notification: a,
|
|
565
|
+
preferences: o || [],
|
|
563
566
|
updateDelivery: e.updateDelivery,
|
|
564
|
-
subNotificationId:
|
|
567
|
+
subNotificationId: i.subNotificationId
|
|
565
568
|
},
|
|
566
|
-
|
|
569
|
+
i.subNotificationId
|
|
567
570
|
)
|
|
568
571
|
}
|
|
569
572
|
],
|
|
570
573
|
defaultActiveKey: []
|
|
571
574
|
},
|
|
572
|
-
|
|
575
|
+
i.subNotificationId
|
|
573
576
|
))
|
|
574
577
|
] })
|
|
575
578
|
};
|
|
576
579
|
});
|
|
577
|
-
return /* @__PURE__ */
|
|
580
|
+
return /* @__PURE__ */ z(V, { children: /* @__PURE__ */ z(U, { items: n, defaultActiveKey: [] }) });
|
|
578
581
|
}
|
|
579
582
|
export {
|
|
580
|
-
|
|
583
|
+
Xe as Preferences
|
|
581
584
|
};
|