@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
package/dist/assets/index2.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as l from "react";
|
|
2
2
|
import { useMemo as et, useRef as X } from "react";
|
|
3
|
-
import { c as
|
|
4
|
-
import { g as nt, K as z, b as rt, r as it, u as
|
|
3
|
+
import { c as x } from "./presets.js";
|
|
4
|
+
import { g as nt, K as z, b as rt, r as it, u as E, m as Ot, a as K, i as st, c as at, d as xt } from "./colors.js";
|
|
5
5
|
const wt = new z("antStatusProcessing", {
|
|
6
6
|
"0%": {
|
|
7
7
|
transform: "scale(0.8)",
|
|
@@ -11,7 +11,7 @@ const wt = new z("antStatusProcessing", {
|
|
|
11
11
|
transform: "scale(2.4)",
|
|
12
12
|
opacity: 0
|
|
13
13
|
}
|
|
14
|
-
}),
|
|
14
|
+
}), Et = new z("antZoomBadgeIn", {
|
|
15
15
|
"0%": {
|
|
16
16
|
transform: "scale(0) translate(50%, -50%)",
|
|
17
17
|
opacity: 0
|
|
@@ -19,7 +19,7 @@ const wt = new z("antStatusProcessing", {
|
|
|
19
19
|
"100%": {
|
|
20
20
|
transform: "scale(1) translate(50%, -50%)"
|
|
21
21
|
}
|
|
22
|
-
}),
|
|
22
|
+
}), jt = new z("antZoomBadgeOut", {
|
|
23
23
|
"0%": {
|
|
24
24
|
transform: "scale(1) translate(50%, -50%)"
|
|
25
25
|
},
|
|
@@ -57,28 +57,27 @@ const wt = new z("antStatusProcessing", {
|
|
|
57
57
|
iconCls: i,
|
|
58
58
|
antCls: n,
|
|
59
59
|
badgeShadowSize: o,
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
textFontSizeSM: h,
|
|
60
|
+
textFontSize: d,
|
|
61
|
+
textFontSizeSM: s,
|
|
63
62
|
statusSize: y,
|
|
64
|
-
dotSize:
|
|
65
|
-
textFontWeight:
|
|
66
|
-
indicatorHeight:
|
|
67
|
-
indicatorHeightSM:
|
|
68
|
-
marginXS:
|
|
69
|
-
calc:
|
|
70
|
-
} = t, u = `${n}-scroll-number`,
|
|
63
|
+
dotSize: v,
|
|
64
|
+
textFontWeight: C,
|
|
65
|
+
indicatorHeight: c,
|
|
66
|
+
indicatorHeightSM: a,
|
|
67
|
+
marginXS: m,
|
|
68
|
+
calc: b
|
|
69
|
+
} = t, u = `${n}-scroll-number`, S = rt(t, ($, g) => {
|
|
71
70
|
let {
|
|
72
|
-
darkColor:
|
|
73
|
-
} =
|
|
71
|
+
darkColor: f
|
|
72
|
+
} = g;
|
|
74
73
|
return {
|
|
75
|
-
[`&${e} ${e}-color-${
|
|
76
|
-
background:
|
|
74
|
+
[`&${e} ${e}-color-${$}`]: {
|
|
75
|
+
background: f,
|
|
77
76
|
[`&:not(${e}-count)`]: {
|
|
78
|
-
color:
|
|
77
|
+
color: f
|
|
79
78
|
},
|
|
80
79
|
"a:hover &": {
|
|
81
|
-
background:
|
|
80
|
+
background: f
|
|
82
81
|
}
|
|
83
82
|
}
|
|
84
83
|
};
|
|
@@ -93,17 +92,17 @@ const wt = new z("antStatusProcessing", {
|
|
|
93
92
|
display: "inline-flex",
|
|
94
93
|
justifyContent: "center",
|
|
95
94
|
zIndex: t.indicatorZIndex,
|
|
96
|
-
minWidth:
|
|
97
|
-
height:
|
|
95
|
+
minWidth: c,
|
|
96
|
+
height: c,
|
|
98
97
|
color: t.badgeTextColor,
|
|
99
|
-
fontWeight:
|
|
100
|
-
fontSize:
|
|
101
|
-
lineHeight:
|
|
98
|
+
fontWeight: C,
|
|
99
|
+
fontSize: d,
|
|
100
|
+
lineHeight: E(c),
|
|
102
101
|
whiteSpace: "nowrap",
|
|
103
102
|
textAlign: "center",
|
|
104
103
|
background: t.badgeColor,
|
|
105
|
-
borderRadius:
|
|
106
|
-
boxShadow: `0 0 0 ${
|
|
104
|
+
borderRadius: b(c).div(2).equal(),
|
|
105
|
+
boxShadow: `0 0 0 ${E(o)} ${t.badgeShadowColor}`,
|
|
107
106
|
transition: `background ${t.motionDurationMid}`,
|
|
108
107
|
a: {
|
|
109
108
|
color: t.badgeTextColor
|
|
@@ -116,29 +115,26 @@ const wt = new z("antStatusProcessing", {
|
|
|
116
115
|
}
|
|
117
116
|
},
|
|
118
117
|
[`${e}-count-sm`]: {
|
|
119
|
-
minWidth:
|
|
120
|
-
height:
|
|
121
|
-
fontSize:
|
|
122
|
-
lineHeight:
|
|
123
|
-
borderRadius:
|
|
118
|
+
minWidth: a,
|
|
119
|
+
height: a,
|
|
120
|
+
fontSize: s,
|
|
121
|
+
lineHeight: E(a),
|
|
122
|
+
borderRadius: b(a).div(2).equal()
|
|
124
123
|
},
|
|
125
124
|
[`${e}-multiple-words`]: {
|
|
126
|
-
padding: `0 ${
|
|
125
|
+
padding: `0 ${E(t.paddingXS)}`,
|
|
127
126
|
bdi: {
|
|
128
127
|
unicodeBidi: "plaintext"
|
|
129
128
|
}
|
|
130
129
|
},
|
|
131
130
|
[`${e}-dot`]: {
|
|
132
131
|
zIndex: t.indicatorZIndex,
|
|
133
|
-
width:
|
|
134
|
-
minWidth:
|
|
135
|
-
height:
|
|
132
|
+
width: v,
|
|
133
|
+
minWidth: v,
|
|
134
|
+
height: v,
|
|
136
135
|
background: t.badgeColor,
|
|
137
136
|
borderRadius: "100%",
|
|
138
|
-
boxShadow: `0 0 0 ${
|
|
139
|
-
},
|
|
140
|
-
[`${e}-dot${u}`]: {
|
|
141
|
-
transition: `background ${d}`
|
|
137
|
+
boxShadow: `0 0 0 ${E(o)} ${t.badgeShadowColor}`
|
|
142
138
|
},
|
|
143
139
|
[`${e}-count, ${e}-dot, ${u}-custom-component`]: {
|
|
144
140
|
position: "absolute",
|
|
@@ -173,6 +169,7 @@ const wt = new z("antStatusProcessing", {
|
|
|
173
169
|
overflow: "visible",
|
|
174
170
|
color: t.colorInfo,
|
|
175
171
|
backgroundColor: t.colorInfo,
|
|
172
|
+
borderColor: "currentcolor",
|
|
176
173
|
"&::after": {
|
|
177
174
|
position: "absolute",
|
|
178
175
|
top: 0,
|
|
@@ -200,20 +197,20 @@ const wt = new z("antStatusProcessing", {
|
|
|
200
197
|
backgroundColor: t.colorWarning
|
|
201
198
|
},
|
|
202
199
|
[`${e}-status-text`]: {
|
|
203
|
-
marginInlineStart:
|
|
200
|
+
marginInlineStart: m,
|
|
204
201
|
color: t.colorText,
|
|
205
202
|
fontSize: t.fontSize
|
|
206
203
|
}
|
|
207
204
|
}
|
|
208
|
-
}),
|
|
205
|
+
}), S), {
|
|
209
206
|
[`${e}-zoom-appear, ${e}-zoom-enter`]: {
|
|
210
|
-
animationName:
|
|
207
|
+
animationName: Et,
|
|
211
208
|
animationDuration: t.motionDurationSlow,
|
|
212
209
|
animationTimingFunction: t.motionEaseOutBack,
|
|
213
210
|
animationFillMode: "both"
|
|
214
211
|
},
|
|
215
212
|
[`${e}-zoom-leave`]: {
|
|
216
|
-
animationName:
|
|
213
|
+
animationName: jt,
|
|
217
214
|
animationDuration: t.motionDurationSlow,
|
|
218
215
|
animationTimingFunction: t.motionEaseOutBack,
|
|
219
216
|
animationFillMode: "both"
|
|
@@ -242,17 +239,18 @@ const wt = new z("antStatusProcessing", {
|
|
|
242
239
|
transformOrigin: "50% 50%"
|
|
243
240
|
}
|
|
244
241
|
},
|
|
245
|
-
[
|
|
242
|
+
[u]: {
|
|
246
243
|
overflow: "hidden",
|
|
244
|
+
transition: `all ${t.motionDurationMid} ${t.motionEaseOutBack}`,
|
|
247
245
|
[`${u}-only`]: {
|
|
248
246
|
position: "relative",
|
|
249
247
|
display: "inline-block",
|
|
250
|
-
height:
|
|
248
|
+
height: c,
|
|
251
249
|
transition: `all ${t.motionDurationSlow} ${t.motionEaseOutBack}`,
|
|
252
250
|
WebkitTransformStyle: "preserve-3d",
|
|
253
251
|
WebkitBackfaceVisibility: "hidden",
|
|
254
252
|
[`> p${u}-only-unit`]: {
|
|
255
|
-
height:
|
|
253
|
+
height: c,
|
|
256
254
|
margin: 0,
|
|
257
255
|
WebkitTransformStyle: "preserve-3d",
|
|
258
256
|
WebkitBackfaceVisibility: "hidden"
|
|
@@ -277,13 +275,13 @@ const wt = new z("antStatusProcessing", {
|
|
|
277
275
|
lineWidth: i,
|
|
278
276
|
marginXS: n,
|
|
279
277
|
colorBorderBg: o
|
|
280
|
-
} = t, d = e,
|
|
278
|
+
} = t, d = e, s = i, y = t.colorBgContainer, v = t.colorError, C = t.colorErrorHover;
|
|
281
279
|
return Ot(t, {
|
|
282
280
|
badgeFontHeight: d,
|
|
283
|
-
badgeShadowSize:
|
|
284
|
-
badgeTextColor:
|
|
285
|
-
badgeColor:
|
|
286
|
-
badgeColorHover:
|
|
281
|
+
badgeShadowSize: s,
|
|
282
|
+
badgeTextColor: y,
|
|
283
|
+
badgeColor: v,
|
|
284
|
+
badgeColorHover: C,
|
|
287
285
|
badgeShadowColor: o,
|
|
288
286
|
badgeProcessingDuration: "1.2s",
|
|
289
287
|
badgeRibbonOffset: n,
|
|
@@ -318,58 +316,58 @@ const wt = new z("antStatusProcessing", {
|
|
|
318
316
|
marginXS: n,
|
|
319
317
|
badgeRibbonOffset: o,
|
|
320
318
|
calc: d
|
|
321
|
-
} = t,
|
|
319
|
+
} = t, s = `${e}-ribbon`, y = `${e}-ribbon-wrapper`, v = rt(t, (C, c) => {
|
|
322
320
|
let {
|
|
323
|
-
darkColor:
|
|
324
|
-
} =
|
|
321
|
+
darkColor: a
|
|
322
|
+
} = c;
|
|
325
323
|
return {
|
|
326
|
-
[`&${
|
|
327
|
-
background:
|
|
328
|
-
color:
|
|
324
|
+
[`&${s}-color-${C}`]: {
|
|
325
|
+
background: a,
|
|
326
|
+
color: a
|
|
329
327
|
}
|
|
330
328
|
};
|
|
331
329
|
});
|
|
332
330
|
return {
|
|
333
|
-
[
|
|
331
|
+
[y]: {
|
|
334
332
|
position: "relative"
|
|
335
333
|
},
|
|
336
|
-
[
|
|
334
|
+
[s]: Object.assign(Object.assign(Object.assign(Object.assign({}, it(t)), {
|
|
337
335
|
position: "absolute",
|
|
338
336
|
top: n,
|
|
339
|
-
padding: `0 ${
|
|
337
|
+
padding: `0 ${E(t.paddingXS)}`,
|
|
340
338
|
color: t.colorPrimary,
|
|
341
|
-
lineHeight:
|
|
339
|
+
lineHeight: E(i),
|
|
342
340
|
whiteSpace: "nowrap",
|
|
343
341
|
backgroundColor: t.colorPrimary,
|
|
344
342
|
borderRadius: t.borderRadiusSM,
|
|
345
|
-
[`${
|
|
343
|
+
[`${s}-text`]: {
|
|
346
344
|
color: t.colorTextLightSolid
|
|
347
345
|
},
|
|
348
|
-
[`${
|
|
346
|
+
[`${s}-corner`]: {
|
|
349
347
|
position: "absolute",
|
|
350
348
|
top: "100%",
|
|
351
349
|
width: o,
|
|
352
350
|
height: o,
|
|
353
351
|
color: "currentcolor",
|
|
354
|
-
border: `${
|
|
352
|
+
border: `${E(d(o).div(2).equal())} solid`,
|
|
355
353
|
transform: t.badgeRibbonCornerTransform,
|
|
356
354
|
transformOrigin: "top",
|
|
357
355
|
filter: t.badgeRibbonCornerFilter
|
|
358
356
|
}
|
|
359
|
-
}),
|
|
360
|
-
[`&${
|
|
357
|
+
}), v), {
|
|
358
|
+
[`&${s}-placement-end`]: {
|
|
361
359
|
insetInlineEnd: d(o).mul(-1).equal(),
|
|
362
360
|
borderEndEndRadius: 0,
|
|
363
|
-
[`${
|
|
361
|
+
[`${s}-corner`]: {
|
|
364
362
|
insetInlineEnd: 0,
|
|
365
363
|
borderInlineEndColor: "transparent",
|
|
366
364
|
borderBlockEndColor: "transparent"
|
|
367
365
|
}
|
|
368
366
|
},
|
|
369
|
-
[`&${
|
|
367
|
+
[`&${s}-placement-start`]: {
|
|
370
368
|
insetInlineStart: d(o).mul(-1).equal(),
|
|
371
369
|
borderEndStartRadius: 0,
|
|
372
|
-
[`${
|
|
370
|
+
[`${s}-corner`]: {
|
|
373
371
|
insetInlineStart: 0,
|
|
374
372
|
borderBlockEndColor: "transparent",
|
|
375
373
|
borderInlineStartColor: "transparent"
|
|
@@ -391,110 +389,105 @@ const wt = new z("antStatusProcessing", {
|
|
|
391
389
|
style: n,
|
|
392
390
|
color: o,
|
|
393
391
|
children: d,
|
|
394
|
-
text:
|
|
395
|
-
placement:
|
|
396
|
-
rootClassName:
|
|
392
|
+
text: s,
|
|
393
|
+
placement: y = "end",
|
|
394
|
+
rootClassName: v
|
|
397
395
|
} = t, {
|
|
398
|
-
getPrefixCls:
|
|
399
|
-
direction:
|
|
400
|
-
} = l.useContext(K),
|
|
401
|
-
[`${
|
|
402
|
-
[`${
|
|
403
|
-
}, e),
|
|
404
|
-
return o &&
|
|
405
|
-
className:
|
|
396
|
+
getPrefixCls: C,
|
|
397
|
+
direction: c
|
|
398
|
+
} = l.useContext(K), a = C("ribbon", i), m = `${a}-wrapper`, [b, u, S] = Dt(a, m), $ = st(o, !1), g = x(a, `${a}-placement-${y}`, {
|
|
399
|
+
[`${a}-rtl`]: c === "rtl",
|
|
400
|
+
[`${a}-color-${o}`]: $
|
|
401
|
+
}, e), f = {}, w = {};
|
|
402
|
+
return o && !$ && (f.background = o, w.color = o), b(/* @__PURE__ */ l.createElement("div", {
|
|
403
|
+
className: x(m, v, u, S)
|
|
406
404
|
}, d, /* @__PURE__ */ l.createElement("div", {
|
|
407
|
-
className:
|
|
408
|
-
style: Object.assign(Object.assign({},
|
|
405
|
+
className: x(g, u),
|
|
406
|
+
style: Object.assign(Object.assign({}, f), n)
|
|
409
407
|
}, /* @__PURE__ */ l.createElement("span", {
|
|
410
|
-
className: `${
|
|
411
|
-
},
|
|
412
|
-
className: `${
|
|
413
|
-
style:
|
|
408
|
+
className: `${a}-text`
|
|
409
|
+
}, s), /* @__PURE__ */ l.createElement("div", {
|
|
410
|
+
className: `${a}-corner`,
|
|
411
|
+
style: w
|
|
414
412
|
}))));
|
|
415
413
|
};
|
|
416
414
|
process.env.NODE_ENV !== "production" && (dt.displayName = "Ribbon");
|
|
417
|
-
|
|
418
|
-
|
|
415
|
+
const ot = (t) => {
|
|
416
|
+
const {
|
|
419
417
|
prefixCls: e,
|
|
420
418
|
value: i,
|
|
421
419
|
current: n,
|
|
422
420
|
offset: o = 0
|
|
423
|
-
} = t
|
|
421
|
+
} = t;
|
|
422
|
+
let d;
|
|
424
423
|
return o && (d = {
|
|
425
424
|
position: "absolute",
|
|
426
425
|
top: `${o}00%`,
|
|
427
426
|
left: 0
|
|
428
427
|
}), /* @__PURE__ */ l.createElement("span", {
|
|
429
428
|
style: d,
|
|
430
|
-
className:
|
|
429
|
+
className: x(`${e}-only-unit`, {
|
|
431
430
|
current: n
|
|
432
431
|
})
|
|
433
432
|
}, i);
|
|
434
|
-
}
|
|
433
|
+
};
|
|
435
434
|
function Wt(t, e, i) {
|
|
436
435
|
let n = t, o = 0;
|
|
437
436
|
for (; (n + 10) % 10 !== e; )
|
|
438
437
|
n += i, o += i;
|
|
439
438
|
return o;
|
|
440
439
|
}
|
|
441
|
-
|
|
440
|
+
const Ft = (t) => {
|
|
442
441
|
const {
|
|
443
442
|
prefixCls: e,
|
|
444
443
|
count: i,
|
|
445
444
|
value: n
|
|
446
|
-
} = t, o = Number(n), d = Math.abs(i), [
|
|
447
|
-
|
|
445
|
+
} = t, o = Number(n), d = Math.abs(i), [s, y] = l.useState(o), [v, C] = l.useState(d), c = () => {
|
|
446
|
+
y(o), C(d);
|
|
448
447
|
};
|
|
449
448
|
l.useEffect(() => {
|
|
450
|
-
const
|
|
451
|
-
|
|
452
|
-
}, 1e3);
|
|
453
|
-
return () => {
|
|
454
|
-
clearTimeout(f);
|
|
455
|
-
};
|
|
449
|
+
const b = setTimeout(c, 1e3);
|
|
450
|
+
return () => clearTimeout(b);
|
|
456
451
|
}, [o]);
|
|
457
|
-
let
|
|
458
|
-
if (
|
|
459
|
-
|
|
452
|
+
let a, m;
|
|
453
|
+
if (s === o || Number.isNaN(o) || Number.isNaN(s))
|
|
454
|
+
a = [/* @__PURE__ */ l.createElement(ot, Object.assign({}, t, {
|
|
460
455
|
key: o,
|
|
461
456
|
current: !0
|
|
462
|
-
}))],
|
|
457
|
+
}))], m = {
|
|
463
458
|
transition: "none"
|
|
464
459
|
};
|
|
465
460
|
else {
|
|
466
|
-
|
|
467
|
-
const
|
|
468
|
-
for (let
|
|
469
|
-
|
|
470
|
-
const
|
|
471
|
-
|
|
472
|
-
const
|
|
461
|
+
a = [];
|
|
462
|
+
const b = o + 10, u = [];
|
|
463
|
+
for (let g = o; g <= b; g += 1)
|
|
464
|
+
u.push(g);
|
|
465
|
+
const S = u.findIndex((g) => g % 10 === s);
|
|
466
|
+
a = u.map((g, f) => {
|
|
467
|
+
const w = g % 10;
|
|
473
468
|
return /* @__PURE__ */ l.createElement(ot, Object.assign({}, t, {
|
|
474
|
-
key:
|
|
475
|
-
value:
|
|
476
|
-
offset:
|
|
477
|
-
current:
|
|
469
|
+
key: g,
|
|
470
|
+
value: w,
|
|
471
|
+
offset: f - S,
|
|
472
|
+
current: f === S
|
|
478
473
|
}));
|
|
479
474
|
});
|
|
480
|
-
const
|
|
481
|
-
|
|
482
|
-
transform: `translateY(${-Wt(
|
|
475
|
+
const $ = v < d ? 1 : -1;
|
|
476
|
+
m = {
|
|
477
|
+
transform: `translateY(${-Wt(s, o, $)}00%)`
|
|
483
478
|
};
|
|
484
479
|
}
|
|
485
480
|
return /* @__PURE__ */ l.createElement("span", {
|
|
486
481
|
className: `${e}-only`,
|
|
487
|
-
style:
|
|
488
|
-
onTransitionEnd:
|
|
489
|
-
},
|
|
490
|
-
}
|
|
482
|
+
style: m,
|
|
483
|
+
onTransitionEnd: c
|
|
484
|
+
}, a);
|
|
485
|
+
};
|
|
491
486
|
var Ht = function(t, e) {
|
|
492
487
|
var i = {};
|
|
493
|
-
for (var n in t)
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
for (var o = 0, n = Object.getOwnPropertySymbols(t); o < n.length; o++)
|
|
497
|
-
e.indexOf(n[o]) < 0 && Object.prototype.propertyIsEnumerable.call(t, n[o]) && (i[n[o]] = t[n[o]]);
|
|
488
|
+
for (var n in t) Object.prototype.hasOwnProperty.call(t, n) && e.indexOf(n) < 0 && (i[n] = t[n]);
|
|
489
|
+
if (t != null && typeof Object.getOwnPropertySymbols == "function") for (var o = 0, n = Object.getOwnPropertySymbols(t); o < n.length; o++)
|
|
490
|
+
e.indexOf(n[o]) < 0 && Object.prototype.propertyIsEnumerable.call(t, n[o]) && (i[n[o]] = t[n[o]]);
|
|
498
491
|
return i;
|
|
499
492
|
};
|
|
500
493
|
const _t = /* @__PURE__ */ l.forwardRef((t, e) => {
|
|
@@ -503,151 +496,149 @@ const _t = /* @__PURE__ */ l.forwardRef((t, e) => {
|
|
|
503
496
|
count: n,
|
|
504
497
|
className: o,
|
|
505
498
|
motionClassName: d,
|
|
506
|
-
style:
|
|
507
|
-
title:
|
|
508
|
-
show:
|
|
509
|
-
component:
|
|
510
|
-
children:
|
|
511
|
-
} = t,
|
|
512
|
-
getPrefixCls:
|
|
513
|
-
} = l.useContext(K),
|
|
514
|
-
"data-show":
|
|
515
|
-
style:
|
|
516
|
-
className:
|
|
517
|
-
title:
|
|
499
|
+
style: s,
|
|
500
|
+
title: y,
|
|
501
|
+
show: v,
|
|
502
|
+
component: C = "sup",
|
|
503
|
+
children: c
|
|
504
|
+
} = t, a = Ht(t, ["prefixCls", "count", "className", "motionClassName", "style", "title", "show", "component", "children"]), {
|
|
505
|
+
getPrefixCls: m
|
|
506
|
+
} = l.useContext(K), b = m("scroll-number", i), u = Object.assign(Object.assign({}, a), {
|
|
507
|
+
"data-show": v,
|
|
508
|
+
style: s,
|
|
509
|
+
className: x(b, o, d),
|
|
510
|
+
title: y
|
|
518
511
|
});
|
|
519
|
-
let
|
|
512
|
+
let S = n;
|
|
520
513
|
if (n && Number(n) % 1 === 0) {
|
|
521
|
-
const
|
|
522
|
-
|
|
523
|
-
prefixCls:
|
|
514
|
+
const $ = String(n).split("");
|
|
515
|
+
S = /* @__PURE__ */ l.createElement("bdi", null, $.map((g, f) => /* @__PURE__ */ l.createElement(Ft, {
|
|
516
|
+
prefixCls: b,
|
|
524
517
|
count: Number(n),
|
|
525
|
-
value:
|
|
518
|
+
value: g,
|
|
526
519
|
// eslint-disable-next-line react/no-array-index-key
|
|
527
|
-
key:
|
|
520
|
+
key: $.length - f
|
|
528
521
|
})));
|
|
529
522
|
}
|
|
530
|
-
return
|
|
531
|
-
boxShadow: `0 0 0 1px ${
|
|
532
|
-
})),
|
|
533
|
-
className:
|
|
534
|
-
})) : /* @__PURE__ */ l.createElement(
|
|
523
|
+
return s != null && s.borderColor && (u.style = Object.assign(Object.assign({}, s), {
|
|
524
|
+
boxShadow: `0 0 0 1px ${s.borderColor} inset`
|
|
525
|
+
})), c ? at(c, ($) => ({
|
|
526
|
+
className: x(`${b}-custom-component`, $ == null ? void 0 : $.className, d)
|
|
527
|
+
})) : /* @__PURE__ */ l.createElement(C, Object.assign({}, u, {
|
|
535
528
|
ref: e
|
|
536
|
-
}),
|
|
529
|
+
}), S);
|
|
537
530
|
});
|
|
538
|
-
var
|
|
531
|
+
var Mt = function(t, e) {
|
|
539
532
|
var i = {};
|
|
540
|
-
for (var n in t)
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
for (var o = 0, n = Object.getOwnPropertySymbols(t); o < n.length; o++)
|
|
544
|
-
e.indexOf(n[o]) < 0 && Object.prototype.propertyIsEnumerable.call(t, n[o]) && (i[n[o]] = t[n[o]]);
|
|
533
|
+
for (var n in t) Object.prototype.hasOwnProperty.call(t, n) && e.indexOf(n) < 0 && (i[n] = t[n]);
|
|
534
|
+
if (t != null && typeof Object.getOwnPropertySymbols == "function") for (var o = 0, n = Object.getOwnPropertySymbols(t); o < n.length; o++)
|
|
535
|
+
e.indexOf(n[o]) < 0 && Object.prototype.propertyIsEnumerable.call(t, n[o]) && (i[n[o]] = t[n[o]]);
|
|
545
536
|
return i;
|
|
546
537
|
};
|
|
547
|
-
const
|
|
548
|
-
var i, n, o, d,
|
|
538
|
+
const Zt = /* @__PURE__ */ l.forwardRef((t, e) => {
|
|
539
|
+
var i, n, o, d, s;
|
|
549
540
|
const {
|
|
550
|
-
prefixCls:
|
|
551
|
-
scrollNumberPrefixCls:
|
|
552
|
-
children:
|
|
553
|
-
status:
|
|
554
|
-
text:
|
|
555
|
-
color:
|
|
556
|
-
count:
|
|
557
|
-
overflowCount:
|
|
558
|
-
dot:
|
|
559
|
-
size:
|
|
560
|
-
title:
|
|
561
|
-
offset:
|
|
562
|
-
style:
|
|
541
|
+
prefixCls: y,
|
|
542
|
+
scrollNumberPrefixCls: v,
|
|
543
|
+
children: C,
|
|
544
|
+
status: c,
|
|
545
|
+
text: a,
|
|
546
|
+
color: m,
|
|
547
|
+
count: b = null,
|
|
548
|
+
overflowCount: u = 99,
|
|
549
|
+
dot: S = !1,
|
|
550
|
+
size: $ = "default",
|
|
551
|
+
title: g,
|
|
552
|
+
offset: f,
|
|
553
|
+
style: w,
|
|
563
554
|
className: mt,
|
|
564
555
|
rootClassName: bt,
|
|
565
|
-
classNames:
|
|
566
|
-
styles:
|
|
556
|
+
classNames: O,
|
|
557
|
+
styles: h,
|
|
567
558
|
showZero: F = !1
|
|
568
|
-
} = t, U =
|
|
559
|
+
} = t, U = Mt(t, ["prefixCls", "scrollNumberPrefixCls", "children", "status", "text", "color", "count", "overflowCount", "dot", "size", "title", "offset", "style", "className", "rootClassName", "classNames", "styles", "showZero"]), {
|
|
569
560
|
getPrefixCls: Y,
|
|
570
561
|
direction: H,
|
|
571
562
|
badge: r
|
|
572
|
-
} = l.useContext(K), p = Y("badge",
|
|
573
|
-
P || (
|
|
574
|
-
const I =
|
|
575
|
-
P || (
|
|
576
|
-
const
|
|
577
|
-
P || (
|
|
563
|
+
} = l.useContext(K), p = Y("badge", y), [G, gt, ft] = Tt(p), _ = b > u ? `${u}+` : b, T = _ === "0" || _ === 0, pt = b === null || T && !F, M = (c != null || m != null) && pt, B = S && !T, j = B ? "" : _, P = et(() => (j == null || j === "" || T && !F) && !B, [j, T, F, B]), J = X(b);
|
|
564
|
+
P || (J.current = b);
|
|
565
|
+
const I = J.current, Q = X(j);
|
|
566
|
+
P || (Q.current = j);
|
|
567
|
+
const Z = Q.current, k = X(B);
|
|
568
|
+
P || (k.current = B);
|
|
578
569
|
const R = et(() => {
|
|
579
|
-
if (
|
|
580
|
-
return Object.assign(Object.assign({}, r == null ? void 0 : r.style),
|
|
581
|
-
const
|
|
582
|
-
marginTop:
|
|
570
|
+
if (!f)
|
|
571
|
+
return Object.assign(Object.assign({}, r == null ? void 0 : r.style), w);
|
|
572
|
+
const N = {
|
|
573
|
+
marginTop: f[1]
|
|
583
574
|
};
|
|
584
|
-
return H === "rtl" ?
|
|
585
|
-
}, [H,
|
|
575
|
+
return H === "rtl" ? N.left = parseInt(f[0], 10) : N.right = -parseInt(f[0], 10), Object.assign(Object.assign(Object.assign({}, N), r == null ? void 0 : r.style), w);
|
|
576
|
+
}, [H, f, w, r == null ? void 0 : r.style]), vt = g ?? (typeof I == "string" || typeof I == "number" ? I : void 0), Ct = P || !a ? null : /* @__PURE__ */ l.createElement("span", {
|
|
586
577
|
className: `${p}-status-text`
|
|
587
|
-
},
|
|
588
|
-
style: Object.assign(Object.assign({}, R),
|
|
589
|
-
})), D = st(
|
|
590
|
-
[`${p}-status-dot`]:
|
|
591
|
-
[`${p}-status-${
|
|
592
|
-
[`${p}-color-${
|
|
578
|
+
}, a), $t = !I || typeof I != "object" ? void 0 : at(I, (N) => ({
|
|
579
|
+
style: Object.assign(Object.assign({}, R), N.style)
|
|
580
|
+
})), D = st(m, !1), yt = x(O == null ? void 0 : O.indicator, (i = r == null ? void 0 : r.classNames) === null || i === void 0 ? void 0 : i.indicator, {
|
|
581
|
+
[`${p}-status-dot`]: M,
|
|
582
|
+
[`${p}-status-${c}`]: !!c,
|
|
583
|
+
[`${p}-color-${m}`]: D
|
|
593
584
|
}), V = {};
|
|
594
|
-
|
|
595
|
-
const tt =
|
|
596
|
-
[`${p}-status`]:
|
|
597
|
-
[`${p}-not-a-wrapper`]: !
|
|
585
|
+
m && !D && (V.color = m, V.background = m);
|
|
586
|
+
const tt = x(p, {
|
|
587
|
+
[`${p}-status`]: M,
|
|
588
|
+
[`${p}-not-a-wrapper`]: !C,
|
|
598
589
|
[`${p}-rtl`]: H === "rtl"
|
|
599
|
-
}, mt, bt, r == null ? void 0 : r.className, (n = r == null ? void 0 : r.classNames) === null || n === void 0 ? void 0 : n.root,
|
|
600
|
-
if (!
|
|
601
|
-
const
|
|
602
|
-
return
|
|
590
|
+
}, mt, bt, r == null ? void 0 : r.className, (n = r == null ? void 0 : r.classNames) === null || n === void 0 ? void 0 : n.root, O == null ? void 0 : O.root, gt, ft);
|
|
591
|
+
if (!C && M) {
|
|
592
|
+
const N = R.color;
|
|
593
|
+
return G(/* @__PURE__ */ l.createElement("span", Object.assign({}, U, {
|
|
603
594
|
className: tt,
|
|
604
|
-
style: Object.assign(Object.assign(Object.assign({},
|
|
595
|
+
style: Object.assign(Object.assign(Object.assign({}, h == null ? void 0 : h.root), (o = r == null ? void 0 : r.styles) === null || o === void 0 ? void 0 : o.root), R)
|
|
605
596
|
}), /* @__PURE__ */ l.createElement("span", {
|
|
606
597
|
className: yt,
|
|
607
|
-
style: Object.assign(Object.assign(Object.assign({},
|
|
608
|
-
}),
|
|
598
|
+
style: Object.assign(Object.assign(Object.assign({}, h == null ? void 0 : h.indicator), (d = r == null ? void 0 : r.styles) === null || d === void 0 ? void 0 : d.indicator), V)
|
|
599
|
+
}), a && /* @__PURE__ */ l.createElement("span", {
|
|
609
600
|
style: {
|
|
610
|
-
color:
|
|
601
|
+
color: N
|
|
611
602
|
},
|
|
612
603
|
className: `${p}-status-text`
|
|
613
|
-
},
|
|
604
|
+
}, a)));
|
|
614
605
|
}
|
|
615
|
-
return
|
|
606
|
+
return G(/* @__PURE__ */ l.createElement("span", Object.assign({
|
|
616
607
|
ref: e
|
|
617
608
|
}, U, {
|
|
618
609
|
className: tt,
|
|
619
|
-
style: Object.assign(Object.assign({}, (
|
|
620
|
-
}),
|
|
610
|
+
style: Object.assign(Object.assign({}, (s = r == null ? void 0 : r.styles) === null || s === void 0 ? void 0 : s.root), h == null ? void 0 : h.root)
|
|
611
|
+
}), C, /* @__PURE__ */ l.createElement(xt, {
|
|
621
612
|
visible: !P,
|
|
622
613
|
motionName: `${p}-zoom`,
|
|
623
614
|
motionAppear: !1,
|
|
624
615
|
motionDeadline: 1e3
|
|
625
|
-
}, (
|
|
616
|
+
}, (N) => {
|
|
626
617
|
let {
|
|
627
618
|
className: ht
|
|
628
|
-
} =
|
|
619
|
+
} = N;
|
|
629
620
|
var A, q;
|
|
630
|
-
const St = Y("scroll-number",
|
|
621
|
+
const St = Y("scroll-number", v), L = k.current, Nt = x(O == null ? void 0 : O.indicator, (A = r == null ? void 0 : r.classNames) === null || A === void 0 ? void 0 : A.indicator, {
|
|
631
622
|
[`${p}-dot`]: L,
|
|
632
623
|
[`${p}-count`]: !L,
|
|
633
|
-
[`${p}-count-sm`]:
|
|
634
|
-
[`${p}-multiple-words`]: !L &&
|
|
635
|
-
[`${p}-status-${
|
|
636
|
-
[`${p}-color-${
|
|
624
|
+
[`${p}-count-sm`]: $ === "small",
|
|
625
|
+
[`${p}-multiple-words`]: !L && Z && Z.toString().length > 1,
|
|
626
|
+
[`${p}-status-${c}`]: !!c,
|
|
627
|
+
[`${p}-color-${m}`]: D
|
|
637
628
|
});
|
|
638
|
-
let W = Object.assign(Object.assign(Object.assign({},
|
|
639
|
-
return
|
|
629
|
+
let W = Object.assign(Object.assign(Object.assign({}, h == null ? void 0 : h.indicator), (q = r == null ? void 0 : r.styles) === null || q === void 0 ? void 0 : q.indicator), R);
|
|
630
|
+
return m && !D && (W = W || {}, W.background = m), /* @__PURE__ */ l.createElement(_t, {
|
|
640
631
|
prefixCls: St,
|
|
641
632
|
show: !P,
|
|
642
633
|
motionClassName: ht,
|
|
643
634
|
className: Nt,
|
|
644
|
-
count:
|
|
635
|
+
count: Z,
|
|
645
636
|
title: vt,
|
|
646
637
|
style: W,
|
|
647
638
|
key: "scrollNumber"
|
|
648
639
|
}, $t);
|
|
649
640
|
}), Ct));
|
|
650
|
-
}), ut =
|
|
641
|
+
}), ut = Zt;
|
|
651
642
|
ut.Ribbon = dt;
|
|
652
643
|
process.env.NODE_ENV !== "production" && (ut.displayName = "Badge");
|
|
653
644
|
export {
|