@unicom-cloud/ui 0.8.57 → 0.8.59
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/Affix.js +15 -15
- package/Alert.js +5 -5
- package/Anchor.js +1 -1
- package/AutoComplete.js +28 -28
- package/Avatar.js +11 -11
- package/BackTop.js +28 -28
- package/Badge.js +10 -10
- package/Breadcrumb.js +6 -6
- package/Button.js +11 -10
- package/Calendar.js +8 -8
- package/Card.js +3 -3
- package/Carousel.js +7 -7
- package/Cascader.js +1 -1
- package/Checkbox.js +1 -1
- package/Collapse.js +1 -1
- package/ColorPicker.js +582 -11
- package/Comment.js +7 -7
- package/ConfigProvider.js +2 -2
- package/Copy.js +6 -6
- package/DatePicker.js +14 -12
- package/Descriptions.js +3 -3
- package/Divider.js +3 -3
- package/Draggable.js +12 -12
- package/Drawer.js +1 -1
- package/Dropdown.js +5 -5
- package/Empty.js +3 -3
- package/Form.js +1410 -10
- package/Grid.js +14 -14
- package/Icon.js +2 -2
- package/IconHover.js +2 -2
- package/Image.js +1 -1
- package/Input.js +2 -2
- package/InputNumber.js +8 -8
- package/InputTag.js +1 -1
- package/Layout.js +8 -8
- package/Link.js +13 -13
- package/List.js +21 -21
- package/Mentions.js +30 -30
- package/Menu.js +1 -1
- package/Message.js +3 -3
- package/Modal.js +1 -1
- package/Notice.js +3 -3
- package/Notification.js +4 -4
- package/OverflowEllipsis.js +9 -9
- package/PageHeader.js +10 -10
- package/Pagination.js +1 -1
- package/Picker.js +1 -1
- package/Popconfirm.js +5 -5
- package/Popover.js +7 -7
- package/Portal.js +1 -1
- package/Progress.js +15 -15
- package/Radio.js +2 -2
- package/Rate.js +10 -10
- package/ResizeBox.js +10 -11
- package/Result.js +11 -11
- package/Select.js +1 -1
- package/SelectView.js +40 -41
- package/Skeleton.js +4 -4
- package/Slider.js +9 -9
- package/Space.js +12 -12
- package/SpeechSynthesis.js +1 -1
- package/Spin.js +11 -11
- package/Statistic.js +43 -43
- package/Steps.js +5 -5
- package/Switch.js +15 -16
- package/Table.js +17 -17
- package/Tabs.js +1 -1
- package/Tag.js +5 -5
- package/TimePicker.js +38 -38
- package/Timeline.js +1 -1
- package/Tooltip.js +9 -9
- package/Transfer.js +26 -26
- package/Tree.js +1 -1
- package/TreeSelect.js +1 -1
- package/Trigger.js +11 -11
- package/Typography.js +1 -1
- package/Upload.js +4 -1
- package/VerificationCode.js +1 -1
- package/Version.js +1 -1
- package/VirtualList.js +1 -1
- package/Watermark.js +1 -1
- package/chunk/{m_kOQCiU.js → -LZOUh53.js} +1 -1
- package/chunk/{CXNW5Y2a.js → -jdfq71f.js} +1 -1
- package/chunk/{CkAOsst1.js → 4-gvEY5y.js} +30 -30
- package/chunk/{DQXq1QT0.js → B0GOLsj_.js} +1 -1
- package/chunk/{BMvZCjSU.js → B16KHtX-.js} +16 -16
- package/chunk/{CggcswbO.js → B2vORJQ8.js} +19 -15
- package/chunk/{BCk8e9fj.js → B7Zsp3gO.js} +1 -1
- package/chunk/B8QV6E2b.js +34 -0
- package/chunk/{BeM2hfks.js → BBVjSFnw.js} +27 -23
- package/chunk/{1mEO29GP.js → BDjXkzNj.js} +1 -1
- package/chunk/{BuEC_zcc.js → BEDYCG-I.js} +31 -31
- package/chunk/{B45v5S9k.js → BHn4xgbv.js} +1 -1
- package/chunk/{CF3Telny.js → BJ_7JTqC.js} +3 -3
- package/chunk/{BM6dpkeM.js → BLSiP_gg.js} +1 -1
- package/chunk/{9Gh1afjL.js → BMJfSSLX.js} +1 -1
- package/chunk/{DBJ8d0o0.js → BNHrEI0Y.js} +31 -31
- package/chunk/{BP7xX86Q.js → BPZ-6HKJ.js} +131 -134
- package/chunk/{DxNRWF67.js → BVLwPZis.js} +11 -11
- package/chunk/{BpwDupra.js → BYhtrDV3.js} +9 -9
- package/chunk/{D6mVoX-C.js → B_nfMl0e.js} +1 -1
- package/chunk/{BWx1cVT_.js → BcS17Pzy.js} +1 -1
- package/chunk/Bdh4XVuf.js +1487 -0
- package/chunk/{BkHxm4sv.js → BdiEwtQO.js} +1 -1
- package/chunk/{DDda6s72.js → BjSHZA0m.js} +6 -6
- package/chunk/{C7Okdv4u.js → Bpug_KxP.js} +1 -1
- package/chunk/BzPkh4Zv.js +11 -0
- package/chunk/{CwXmtKib.js → C1D7T29r.js} +35 -35
- package/chunk/{DYZzQ2uT.js → C1u_ckwU.js} +1 -1
- package/chunk/C1xMmQIZ.js +468 -0
- package/chunk/C2lIz2F9.js +60 -0
- package/chunk/{Be7oeWU8.js → C43Hv2Bl.js} +1 -1
- package/chunk/{CR4u270n.js → C5AQWbC4.js} +79 -79
- package/chunk/{fqgc8r6C.js → C9vsih_D.js} +1 -1
- package/chunk/CANaGbGR.js +154 -0
- package/chunk/{BA02BFUV.js → CAfR2wLq.js} +1 -1
- package/chunk/{CcX2pBUh.js → CAfecMDF.js} +1 -1
- package/chunk/{BHK9zpXn.js → CKp4rZnD.js} +1 -1
- package/chunk/CTxjmYmx.js +19 -0
- package/chunk/{BqxwlITu.js → CV2Aqv9q.js} +1 -1
- package/chunk/{bsawGxt8.js → CYdarMv9.js} +1 -1
- package/chunk/{DafaH1Qt.js → C_S5Mdvd.js} +43 -44
- package/chunk/{DkIjpuBZ.js → Cbd50gx8.js} +11 -11
- package/chunk/{D5p8q9Pa.js → CbiWdbr_.js} +12 -12
- package/chunk/{cUuQh7L_.js → CmB-TL7C.js} +1 -1
- package/chunk/{BbYzi8M0.js → CuOl4X0X.js} +4 -4
- package/chunk/{BHLTzWzi.js → D-ER56Sf.js} +1 -1
- package/chunk/{BK1FKNAX.js → D-aYnb6u.js} +1 -1
- package/chunk/{DalIRWr7.js → D2HkyI6A.js} +9 -9
- package/chunk/D3NFxdmG.js +518 -0
- package/chunk/{C2fspJbE.js → D3xQFJcO.js} +1 -1
- package/chunk/{Lk60-jkf.js → DApXtulb.js} +4 -0
- package/chunk/{sl8s35SK.js → DJcEys80.js} +1 -1
- package/chunk/{B1S1OEw6.js → DLIm6rRJ.js} +1 -1
- package/chunk/{C95ipQ6b.js → DOWEHtqM.js} +1 -1
- package/chunk/{aM2ePYrq.js → DSGRHf-1.js} +132 -132
- package/chunk/{D9TqtOhq.js → DT37l12z.js} +1 -1
- package/chunk/{B6fn5y_s.js → DW-B7npC.js} +1 -1
- package/chunk/D_-UD4vO.js +119 -0
- package/chunk/{Dtnux4qL.js → D_MTFBb0.js} +1 -1
- package/chunk/{WkB0MERB.js → DhBo0pPJ.js} +27 -27
- package/chunk/DmUhn9ib.js +961 -0
- package/chunk/{Bny52uiG.js → DpfUGhi4.js} +10 -10
- package/chunk/{DhLbnw3R.js → Dx_5J4fO.js} +1 -1
- package/chunk/{B9PsJar0.js → Dy487FZ1.js} +1 -1
- package/chunk/{D6RTBH4C.js → IooeSKJJ.js} +10 -10
- package/chunk/Kbr6FzOG.js +745 -0
- package/chunk/{CwjaGytU.js → RMBPs_Ry.js} +32 -32
- package/chunk/Uz-rNulO.js +98 -0
- package/chunk/V6euPXVB.js +1025 -0
- package/chunk/{Bv8ZRDFt.js → YIlBPVAs.js} +14 -14
- package/chunk/{DPvnQJ-H.js → cDZI_t6o.js} +1 -1
- package/chunk/{C-w9pFY-.js → cZiP8FvM.js} +3 -3
- package/chunk/{DJmWXheU.js → eK7lxdak.js} +8 -8
- package/chunk/{Dg2DmtzA.js → gIbzjQ-X.js} +5 -6
- package/chunk/{CPl52AZh.js → sScV-J56.js} +1 -1
- package/chunk/{BbI3gqVr.js → wI2I1qb0.js} +1 -1
- package/hooks/index.js +32 -32
- package/hooks/use-verification-code.js +23 -22
- package/hooks/use-watermark.js +2 -1
- package/hooks/useComputedState.js +2 -1
- package/hooks/useCreate.js +2 -1
- package/hooks/useForceUpdate.js +2 -1
- package/hooks/useId.js +2 -1
- package/hooks/useInView.js +5 -4
- package/hooks/useIntersectionObserver.js +11 -11
- package/hooks/useIsFirstRender.js +2 -1
- package/hooks/useIsomorphicLayoutEffect.js +2 -1
- package/hooks/useKeyboardEvent.js +3 -2
- package/hooks/useMedia.js +2 -1
- package/hooks/useMergeProps.js +2 -1
- package/hooks/useMergeValue.js +4 -3
- package/hooks/useOverflowHidden.js +2 -1
- package/hooks/useOverrideRef.js +2 -1
- package/hooks/usePersistCallback.js +2 -1
- package/hooks/usePrevious.js +2 -1
- package/hooks/useRefs.js +2 -1
- package/hooks/useResizeObserver.js +2 -1
- package/hooks/useStateCallback.js +2 -1
- package/hooks/useStateWithPromise.js +2 -1
- package/hooks/useUpdateEffect.js +2 -1
- package/hooks/useWatch.js +3 -2
- package/hooks/useWindowSize.js +2 -1
- package/icons.js +35 -35
- package/index.js +484 -376
- package/locale/en-US.js +3 -11
- package/locale/tr-TR.js +3 -11
- package/package.json +1 -1
- package/style.css +1 -1
- package/types/anchor/Anchor.d.ts +1 -1
- package/types/button/index.d.ts +3 -2
- package/types/color-picker/hooks/useColorPicker.d.ts +1 -1
- package/types/color-picker/hooks/useControlBlock.d.ts +1 -1
- package/types/config-provider/interface.d.ts +1 -0
- package/types/date-picker/PickerRange.d.ts +1 -1
- package/types/hooks/use-verification-code/index.d.ts +2 -1
- package/types/hooks/use-watermark/index.d.ts +2 -1
- package/types/hooks/useComputedState.d.ts +2 -2
- package/types/hooks/useCreate.d.ts +2 -1
- package/types/hooks/useForceUpdate.d.ts +2 -1
- package/types/hooks/useId.d.ts +2 -1
- package/types/hooks/useInView.d.ts +1 -1
- package/types/hooks/useIntersectionObserver.d.ts +1 -1
- package/types/hooks/useIsFirstRender.d.ts +2 -1
- package/types/hooks/useIsomorphicLayoutEffect.d.ts +1 -1
- package/types/hooks/useKeyboardEvent.d.ts +2 -2
- package/types/hooks/useMedia.d.ts +1 -1
- package/types/hooks/useMergeProps.d.ts +2 -1
- package/types/hooks/useMergeValue.d.ts +2 -1
- package/types/hooks/useOverflowHidden.d.ts +2 -2
- package/types/hooks/useOverrideRef.d.ts +2 -1
- package/types/hooks/usePersistCallback.d.ts +2 -1
- package/types/hooks/usePrevious.d.ts +2 -1
- package/types/hooks/useRefs.d.ts +2 -1
- package/types/hooks/useResizeObserver.d.ts +2 -1
- package/types/hooks/useStateCallback.d.ts +1 -1
- package/types/hooks/useStateWithPromise.d.ts +1 -1
- package/types/hooks/useUpdateEffect.d.ts +2 -1
- package/types/hooks/useWatch.d.ts +2 -1
- package/types/hooks/useWindowSize.d.ts +1 -1
- package/types/image/interface.d.ts +1 -1
- package/types/index.d.ts +13 -22
- package/types/table/interface.d.ts +3 -1
- package/types/upload/Upload.d.ts +2 -1
- package/types/upload/index.d.ts +3 -1
- package/types/upload/request_.d.ts +3 -0
- package/types/utils/caseName.d.ts +2 -0
- package/types/utils/fileToURL.d.ts +2 -0
- package/types/utils/fillNBSP.d.ts +1 -1
- package/types/utils/index.d.ts +37 -0
- package/types/utils/is.d.ts +2 -2
- package/types/utils/lodash.d.ts +4 -0
- package/types/utils/scrollIntoView.d.ts +2 -1
- package/types/version/index.d.ts +1 -1
- package/utils/CSSTransition.js +1 -1
- package/utils/caseName.js +20 -0
- package/utils/className.js +1 -1
- package/utils/contextHolder.js +1 -1
- package/utils/fileToURL.js +4 -0
- package/utils/index.js +219 -0
- package/utils/is.js +95 -93
- package/utils/keyCode.js +10 -46
- package/utils/lodash.js +8 -0
- package/utils/mergedToString.js +11 -10
- package/utils/reactDOM.js +1 -1
- package/utils/saveAs.js +1 -1
- package/utils/scrollIntoView.js +8 -7
- package/chunk/5pZ3ayqs.js +0 -29
- package/chunk/Bl-ODC57.js +0 -945
- package/chunk/BlKc_pDZ.js +0 -678
- package/chunk/CiEln_Q1.js +0 -517
- package/chunk/CiZVOdJ3.js +0 -122
- package/chunk/DMWMrXg1.js +0 -964
- package/chunk/DUxWiN2U.js +0 -1465
- package/chunk/Dbk4DVhB.js +0 -855
- package/chunk/Do1aMgY3.js +0 -12
- package/chunk/HlP8inLK.js +0 -1796
- package/chunk/V_IcWDFx.js +0 -49
- /package/types/utils/{mergeProp.d.ts → mergeProps.d.ts} +0 -0
- /package/utils/{mergeProp.js → mergeProps.js} +0 -0
|
@@ -0,0 +1,1487 @@
|
|
|
1
|
+
var Ft = Object.defineProperty;
|
|
2
|
+
var Tt = (n, e, t) => e in n ? Ft(n, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : n[e] = t;
|
|
3
|
+
var g = (n, e, t) => Tt(n, typeof e != "symbol" ? e + "" : e, t);
|
|
4
|
+
import G, { forwardRef as pt, useContext as rt, createContext as qt, useRef as st, useImperativeHandle as xt, Component as Ot, createRef as jt, useEffect as D, useState as Lt } from "react";
|
|
5
|
+
import { jsx as d, jsxs as V } from "react/jsx-runtime";
|
|
6
|
+
import { f as Dt, g as _, I as it, e as Ut, b as Wt, a as zt, c as Bt, d as Vt } from "./BHn4xgbv.js";
|
|
7
|
+
import Gt from "lodash/isPlainObject";
|
|
8
|
+
import { useMergeProps as Ct } from "../hooks/useMergeProps.js";
|
|
9
|
+
import { _ as yt, P as vt } from "./BPZ-6HKJ.js";
|
|
10
|
+
import O from "lodash/isNumber";
|
|
11
|
+
import F from "lodash/isUndefined";
|
|
12
|
+
import { y as j } from "./BzPkh4Zv.js";
|
|
13
|
+
import Jt from "../locale/zh-CN.js";
|
|
14
|
+
import wt from "../NotificationBase.js";
|
|
15
|
+
import { render as $t } from "../utils/reactDOM.js";
|
|
16
|
+
import Kt from "lodash/isString";
|
|
17
|
+
import { createPortal as Qt } from "react-dom";
|
|
18
|
+
import Xt from "../utils/omit.js";
|
|
19
|
+
var Yt = Object.defineProperty, Zt = (n, e, t) => e in n ? Yt(n, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : n[e] = t, I = (n, e, t) => Zt(n, typeof e != "symbol" ? e + "" : e, t);
|
|
20
|
+
function w(n, e) {
|
|
21
|
+
_t(n) && (n = "100%");
|
|
22
|
+
const t = te(n);
|
|
23
|
+
return n = e === 360 ? n : Math.min(e, Math.max(0, parseFloat(n))), t && (n = parseInt(String(n * e), 10) / 100), Math.abs(n - e) < 1e-6 ? 1 : (e === 360 ? n = (n < 0 ? n % e + e : n % e) / parseFloat(String(e)) : n = n % e / parseFloat(String(e)), n);
|
|
24
|
+
}
|
|
25
|
+
function U(n) {
|
|
26
|
+
return Math.min(1, Math.max(0, n));
|
|
27
|
+
}
|
|
28
|
+
function _t(n) {
|
|
29
|
+
return typeof n == "string" && n.indexOf(".") !== -1 && parseFloat(n) === 1;
|
|
30
|
+
}
|
|
31
|
+
function te(n) {
|
|
32
|
+
return typeof n == "string" && n.indexOf("%") !== -1;
|
|
33
|
+
}
|
|
34
|
+
function Mt(n) {
|
|
35
|
+
return n = parseFloat(n), (isNaN(n) || n < 0 || n > 1) && (n = 1), n;
|
|
36
|
+
}
|
|
37
|
+
function W(n) {
|
|
38
|
+
return Number(n) <= 1 ? `${Number(n) * 100}%` : n;
|
|
39
|
+
}
|
|
40
|
+
function P(n) {
|
|
41
|
+
return n.length === 1 ? "0" + n : String(n);
|
|
42
|
+
}
|
|
43
|
+
function ee(n, e, t) {
|
|
44
|
+
return {
|
|
45
|
+
r: w(n, 255) * 255,
|
|
46
|
+
g: w(e, 255) * 255,
|
|
47
|
+
b: w(t, 255) * 255
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
function ot(n, e, t) {
|
|
51
|
+
n = w(n, 255), e = w(e, 255), t = w(t, 255);
|
|
52
|
+
const r = Math.max(n, e, t), s = Math.min(n, e, t);
|
|
53
|
+
let i = 0, o = 0;
|
|
54
|
+
const a = (r + s) / 2;
|
|
55
|
+
if (r === s)
|
|
56
|
+
o = 0, i = 0;
|
|
57
|
+
else {
|
|
58
|
+
const h = r - s;
|
|
59
|
+
switch (o = a > 0.5 ? h / (2 - r - s) : h / (r + s), r) {
|
|
60
|
+
case n:
|
|
61
|
+
i = (e - t) / h + (e < t ? 6 : 0);
|
|
62
|
+
break;
|
|
63
|
+
case e:
|
|
64
|
+
i = (t - n) / h + 2;
|
|
65
|
+
break;
|
|
66
|
+
case t:
|
|
67
|
+
i = (n - e) / h + 4;
|
|
68
|
+
break;
|
|
69
|
+
}
|
|
70
|
+
i /= 6;
|
|
71
|
+
}
|
|
72
|
+
return { h: i, s: o, l: a };
|
|
73
|
+
}
|
|
74
|
+
function Q(n, e, t) {
|
|
75
|
+
return t < 0 && (t += 1), t > 1 && (t -= 1), t < 1 / 6 ? n + (e - n) * (6 * t) : t < 1 / 2 ? e : t < 2 / 3 ? n + (e - n) * (2 / 3 - t) * 6 : n;
|
|
76
|
+
}
|
|
77
|
+
function ne(n, e, t) {
|
|
78
|
+
let r, s, i;
|
|
79
|
+
if (n = w(n, 360), e = w(e, 100), t = w(t, 100), e === 0)
|
|
80
|
+
s = t, i = t, r = t;
|
|
81
|
+
else {
|
|
82
|
+
const o = t < 0.5 ? t * (1 + e) : t + e - t * e, a = 2 * t - o;
|
|
83
|
+
r = Q(a, o, n + 1 / 3), s = Q(a, o, n), i = Q(a, o, n - 1 / 3);
|
|
84
|
+
}
|
|
85
|
+
return { r: r * 255, g: s * 255, b: i * 255 };
|
|
86
|
+
}
|
|
87
|
+
function X(n, e, t) {
|
|
88
|
+
n = w(n, 255), e = w(e, 255), t = w(t, 255);
|
|
89
|
+
const r = Math.max(n, e, t), s = Math.min(n, e, t);
|
|
90
|
+
let i = 0;
|
|
91
|
+
const o = r, a = r - s, h = r === 0 ? 0 : a / r;
|
|
92
|
+
if (r === s)
|
|
93
|
+
i = 0;
|
|
94
|
+
else {
|
|
95
|
+
switch (r) {
|
|
96
|
+
case n:
|
|
97
|
+
i = (e - t) / a + (e < t ? 6 : 0);
|
|
98
|
+
break;
|
|
99
|
+
case e:
|
|
100
|
+
i = (t - n) / a + 2;
|
|
101
|
+
break;
|
|
102
|
+
case t:
|
|
103
|
+
i = (n - e) / a + 4;
|
|
104
|
+
break;
|
|
105
|
+
}
|
|
106
|
+
i /= 6;
|
|
107
|
+
}
|
|
108
|
+
return { h: i, s: h, v: o };
|
|
109
|
+
}
|
|
110
|
+
function re(n, e, t) {
|
|
111
|
+
n = w(n, 360) * 6, e = w(e, 100), t = w(t, 100);
|
|
112
|
+
const r = Math.floor(n), s = n - r, i = t * (1 - e), o = t * (1 - s * e), a = t * (1 - (1 - s) * e), h = r % 6, l = [t, o, i, i, a, t][h], c = [a, t, t, o, i, i][h], u = [i, i, a, t, t, o][h];
|
|
113
|
+
return { r: l * 255, g: c * 255, b: u * 255 };
|
|
114
|
+
}
|
|
115
|
+
function at(n, e, t, r) {
|
|
116
|
+
const s = [
|
|
117
|
+
P(Math.round(n).toString(16)),
|
|
118
|
+
P(Math.round(e).toString(16)),
|
|
119
|
+
P(Math.round(t).toString(16))
|
|
120
|
+
];
|
|
121
|
+
return r && s[0].startsWith(s[0].charAt(1)) && s[1].startsWith(s[1].charAt(1)) && s[2].startsWith(s[2].charAt(1)) ? s[0].charAt(0) + s[1].charAt(0) + s[2].charAt(0) : s.join("");
|
|
122
|
+
}
|
|
123
|
+
function se(n, e, t, r, s) {
|
|
124
|
+
const i = [
|
|
125
|
+
P(Math.round(n).toString(16)),
|
|
126
|
+
P(Math.round(e).toString(16)),
|
|
127
|
+
P(Math.round(t).toString(16)),
|
|
128
|
+
P(kt(r))
|
|
129
|
+
];
|
|
130
|
+
return s && i[0].startsWith(i[0].charAt(1)) && i[1].startsWith(i[1].charAt(1)) && i[2].startsWith(i[2].charAt(1)) && i[3].startsWith(i[3].charAt(1)) ? i[0].charAt(0) + i[1].charAt(0) + i[2].charAt(0) + i[3].charAt(0) : i.join("");
|
|
131
|
+
}
|
|
132
|
+
function Le(n, e, t, r) {
|
|
133
|
+
return [
|
|
134
|
+
P(kt(r)),
|
|
135
|
+
P(Math.round(n).toString(16)),
|
|
136
|
+
P(Math.round(e).toString(16)),
|
|
137
|
+
P(Math.round(t).toString(16))
|
|
138
|
+
].join("");
|
|
139
|
+
}
|
|
140
|
+
function ie(n, e, t, r) {
|
|
141
|
+
const s = n / 100, i = e / 100, o = t / 100, a = r / 100, h = 255 * (1 - s) * (1 - a), l = 255 * (1 - i) * (1 - a), c = 255 * (1 - o) * (1 - a);
|
|
142
|
+
return { r: h, g: l, b: c };
|
|
143
|
+
}
|
|
144
|
+
function ct(n, e, t) {
|
|
145
|
+
let r = 1 - n / 255, s = 1 - e / 255, i = 1 - t / 255, o = Math.min(r, s, i);
|
|
146
|
+
return o === 1 ? (r = 0, s = 0, i = 0) : (r = (r - o) / (1 - o) * 100, s = (s - o) / (1 - o) * 100, i = (i - o) / (1 - o) * 100), o *= 100, {
|
|
147
|
+
c: Math.round(r),
|
|
148
|
+
m: Math.round(s),
|
|
149
|
+
y: Math.round(i),
|
|
150
|
+
k: Math.round(o)
|
|
151
|
+
};
|
|
152
|
+
}
|
|
153
|
+
function kt(n) {
|
|
154
|
+
return Math.round(parseFloat(n) * 255).toString(16);
|
|
155
|
+
}
|
|
156
|
+
function lt(n) {
|
|
157
|
+
return R(n) / 255;
|
|
158
|
+
}
|
|
159
|
+
function R(n) {
|
|
160
|
+
return parseInt(n, 16);
|
|
161
|
+
}
|
|
162
|
+
function oe(n) {
|
|
163
|
+
return {
|
|
164
|
+
r: n >> 16,
|
|
165
|
+
g: (n & 65280) >> 8,
|
|
166
|
+
b: n & 255
|
|
167
|
+
};
|
|
168
|
+
}
|
|
169
|
+
const tt = {
|
|
170
|
+
aliceblue: "#f0f8ff",
|
|
171
|
+
antiquewhite: "#faebd7",
|
|
172
|
+
aqua: "#00ffff",
|
|
173
|
+
aquamarine: "#7fffd4",
|
|
174
|
+
azure: "#f0ffff",
|
|
175
|
+
beige: "#f5f5dc",
|
|
176
|
+
bisque: "#ffe4c4",
|
|
177
|
+
black: "#000000",
|
|
178
|
+
blanchedalmond: "#ffebcd",
|
|
179
|
+
blue: "#0000ff",
|
|
180
|
+
blueviolet: "#8a2be2",
|
|
181
|
+
brown: "#a52a2a",
|
|
182
|
+
burlywood: "#deb887",
|
|
183
|
+
cadetblue: "#5f9ea0",
|
|
184
|
+
chartreuse: "#7fff00",
|
|
185
|
+
chocolate: "#d2691e",
|
|
186
|
+
coral: "#ff7f50",
|
|
187
|
+
cornflowerblue: "#6495ed",
|
|
188
|
+
cornsilk: "#fff8dc",
|
|
189
|
+
crimson: "#dc143c",
|
|
190
|
+
cyan: "#00ffff",
|
|
191
|
+
darkblue: "#00008b",
|
|
192
|
+
darkcyan: "#008b8b",
|
|
193
|
+
darkgoldenrod: "#b8860b",
|
|
194
|
+
darkgray: "#a9a9a9",
|
|
195
|
+
darkgreen: "#006400",
|
|
196
|
+
darkgrey: "#a9a9a9",
|
|
197
|
+
darkkhaki: "#bdb76b",
|
|
198
|
+
darkmagenta: "#8b008b",
|
|
199
|
+
darkolivegreen: "#556b2f",
|
|
200
|
+
darkorange: "#ff8c00",
|
|
201
|
+
darkorchid: "#9932cc",
|
|
202
|
+
darkred: "#8b0000",
|
|
203
|
+
darksalmon: "#e9967a",
|
|
204
|
+
darkseagreen: "#8fbc8f",
|
|
205
|
+
darkslateblue: "#483d8b",
|
|
206
|
+
darkslategray: "#2f4f4f",
|
|
207
|
+
darkslategrey: "#2f4f4f",
|
|
208
|
+
darkturquoise: "#00ced1",
|
|
209
|
+
darkviolet: "#9400d3",
|
|
210
|
+
deeppink: "#ff1493",
|
|
211
|
+
deepskyblue: "#00bfff",
|
|
212
|
+
dimgray: "#696969",
|
|
213
|
+
dimgrey: "#696969",
|
|
214
|
+
dodgerblue: "#1e90ff",
|
|
215
|
+
firebrick: "#b22222",
|
|
216
|
+
floralwhite: "#fffaf0",
|
|
217
|
+
forestgreen: "#228b22",
|
|
218
|
+
fuchsia: "#ff00ff",
|
|
219
|
+
gainsboro: "#dcdcdc",
|
|
220
|
+
ghostwhite: "#f8f8ff",
|
|
221
|
+
goldenrod: "#daa520",
|
|
222
|
+
gold: "#ffd700",
|
|
223
|
+
gray: "#808080",
|
|
224
|
+
green: "#008000",
|
|
225
|
+
greenyellow: "#adff2f",
|
|
226
|
+
grey: "#808080",
|
|
227
|
+
honeydew: "#f0fff0",
|
|
228
|
+
hotpink: "#ff69b4",
|
|
229
|
+
indianred: "#cd5c5c",
|
|
230
|
+
indigo: "#4b0082",
|
|
231
|
+
ivory: "#fffff0",
|
|
232
|
+
khaki: "#f0e68c",
|
|
233
|
+
lavenderblush: "#fff0f5",
|
|
234
|
+
lavender: "#e6e6fa",
|
|
235
|
+
lawngreen: "#7cfc00",
|
|
236
|
+
lemonchiffon: "#fffacd",
|
|
237
|
+
lightblue: "#add8e6",
|
|
238
|
+
lightcoral: "#f08080",
|
|
239
|
+
lightcyan: "#e0ffff",
|
|
240
|
+
lightgoldenrodyellow: "#fafad2",
|
|
241
|
+
lightgray: "#d3d3d3",
|
|
242
|
+
lightgreen: "#90ee90",
|
|
243
|
+
lightgrey: "#d3d3d3",
|
|
244
|
+
lightpink: "#ffb6c1",
|
|
245
|
+
lightsalmon: "#ffa07a",
|
|
246
|
+
lightseagreen: "#20b2aa",
|
|
247
|
+
lightskyblue: "#87cefa",
|
|
248
|
+
lightslategray: "#778899",
|
|
249
|
+
lightslategrey: "#778899",
|
|
250
|
+
lightsteelblue: "#b0c4de",
|
|
251
|
+
lightyellow: "#ffffe0",
|
|
252
|
+
lime: "#00ff00",
|
|
253
|
+
limegreen: "#32cd32",
|
|
254
|
+
linen: "#faf0e6",
|
|
255
|
+
magenta: "#ff00ff",
|
|
256
|
+
maroon: "#800000",
|
|
257
|
+
mediumaquamarine: "#66cdaa",
|
|
258
|
+
mediumblue: "#0000cd",
|
|
259
|
+
mediumorchid: "#ba55d3",
|
|
260
|
+
mediumpurple: "#9370db",
|
|
261
|
+
mediumseagreen: "#3cb371",
|
|
262
|
+
mediumslateblue: "#7b68ee",
|
|
263
|
+
mediumspringgreen: "#00fa9a",
|
|
264
|
+
mediumturquoise: "#48d1cc",
|
|
265
|
+
mediumvioletred: "#c71585",
|
|
266
|
+
midnightblue: "#191970",
|
|
267
|
+
mintcream: "#f5fffa",
|
|
268
|
+
mistyrose: "#ffe4e1",
|
|
269
|
+
moccasin: "#ffe4b5",
|
|
270
|
+
navajowhite: "#ffdead",
|
|
271
|
+
navy: "#000080",
|
|
272
|
+
oldlace: "#fdf5e6",
|
|
273
|
+
olive: "#808000",
|
|
274
|
+
olivedrab: "#6b8e23",
|
|
275
|
+
orange: "#ffa500",
|
|
276
|
+
orangered: "#ff4500",
|
|
277
|
+
orchid: "#da70d6",
|
|
278
|
+
palegoldenrod: "#eee8aa",
|
|
279
|
+
palegreen: "#98fb98",
|
|
280
|
+
paleturquoise: "#afeeee",
|
|
281
|
+
palevioletred: "#db7093",
|
|
282
|
+
papayawhip: "#ffefd5",
|
|
283
|
+
peachpuff: "#ffdab9",
|
|
284
|
+
peru: "#cd853f",
|
|
285
|
+
pink: "#ffc0cb",
|
|
286
|
+
plum: "#dda0dd",
|
|
287
|
+
powderblue: "#b0e0e6",
|
|
288
|
+
purple: "#800080",
|
|
289
|
+
rebeccapurple: "#663399",
|
|
290
|
+
red: "#ff0000",
|
|
291
|
+
rosybrown: "#bc8f8f",
|
|
292
|
+
royalblue: "#4169e1",
|
|
293
|
+
saddlebrown: "#8b4513",
|
|
294
|
+
salmon: "#fa8072",
|
|
295
|
+
sandybrown: "#f4a460",
|
|
296
|
+
seagreen: "#2e8b57",
|
|
297
|
+
seashell: "#fff5ee",
|
|
298
|
+
sienna: "#a0522d",
|
|
299
|
+
silver: "#c0c0c0",
|
|
300
|
+
skyblue: "#87ceeb",
|
|
301
|
+
slateblue: "#6a5acd",
|
|
302
|
+
slategray: "#708090",
|
|
303
|
+
slategrey: "#708090",
|
|
304
|
+
snow: "#fffafa",
|
|
305
|
+
springgreen: "#00ff7f",
|
|
306
|
+
steelblue: "#4682b4",
|
|
307
|
+
tan: "#d2b48c",
|
|
308
|
+
teal: "#008080",
|
|
309
|
+
thistle: "#d8bfd8",
|
|
310
|
+
tomato: "#ff6347",
|
|
311
|
+
turquoise: "#40e0d0",
|
|
312
|
+
violet: "#ee82ee",
|
|
313
|
+
wheat: "#f5deb3",
|
|
314
|
+
white: "#ffffff",
|
|
315
|
+
whitesmoke: "#f5f5f5",
|
|
316
|
+
yellow: "#ffff00",
|
|
317
|
+
yellowgreen: "#9acd32"
|
|
318
|
+
};
|
|
319
|
+
function ae(n) {
|
|
320
|
+
let e = { r: 0, g: 0, b: 0 }, t = 1, r = null, s = null, i = null, o = !1, a = !1;
|
|
321
|
+
return typeof n == "string" && (n = he(n)), typeof n == "object" && (k(n.r) && k(n.g) && k(n.b) ? (e = ee(n.r, n.g, n.b), o = !0, a = String(n.r).substr(-1) === "%" ? "prgb" : "rgb") : k(n.h) && k(n.s) && k(n.v) ? (r = W(n.s), s = W(n.v), e = re(n.h, r, s), o = !0, a = "hsv") : k(n.h) && k(n.s) && k(n.l) ? (r = W(n.s), i = W(n.l), e = ne(n.h, r, i), o = !0, a = "hsl") : k(n.c) && k(n.m) && k(n.y) && k(n.k) && (e = ie(n.c, n.m, n.y, n.k), o = !0, a = "cmyk"), Object.prototype.hasOwnProperty.call(n, "a") && (t = n.a)), t = Mt(t), {
|
|
322
|
+
ok: o,
|
|
323
|
+
format: n.format || a,
|
|
324
|
+
r: Math.min(255, Math.max(e.r, 0)),
|
|
325
|
+
g: Math.min(255, Math.max(e.g, 0)),
|
|
326
|
+
b: Math.min(255, Math.max(e.b, 0)),
|
|
327
|
+
a: t
|
|
328
|
+
};
|
|
329
|
+
}
|
|
330
|
+
const ce = "[-\\+]?\\d+%?", le = "[-\\+]?\\d*\\.\\d+%?", H = "(?:" + le + ")|(?:" + ce + ")", Y = "[\\s|\\(]+(" + H + ")[,|\\s]+(" + H + ")[,|\\s]+(" + H + ")\\s*\\)?", z = (
|
|
331
|
+
// eslint-disable-next-line prettier/prettier
|
|
332
|
+
"[\\s|\\(]+(" + H + ")[,|\\s]+(" + H + ")[,|\\s]+(" + H + ")[,|\\s]+(" + H + ")\\s*\\)?"
|
|
333
|
+
), E = {
|
|
334
|
+
CSS_UNIT: new RegExp(H),
|
|
335
|
+
rgb: new RegExp("rgb" + Y),
|
|
336
|
+
rgba: new RegExp("rgba" + z),
|
|
337
|
+
hsl: new RegExp("hsl" + Y),
|
|
338
|
+
hsla: new RegExp("hsla" + z),
|
|
339
|
+
hsv: new RegExp("hsv" + Y),
|
|
340
|
+
hsva: new RegExp("hsva" + z),
|
|
341
|
+
cmyk: new RegExp("cmyk" + z),
|
|
342
|
+
hex3: /^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,
|
|
343
|
+
hex6: /^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,
|
|
344
|
+
hex4: /^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,
|
|
345
|
+
hex8: /^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/
|
|
346
|
+
};
|
|
347
|
+
function he(n) {
|
|
348
|
+
if (n = n.trim().toLowerCase(), n.length === 0)
|
|
349
|
+
return !1;
|
|
350
|
+
let e = !1;
|
|
351
|
+
if (tt[n])
|
|
352
|
+
n = tt[n], e = !0;
|
|
353
|
+
else if (n === "transparent")
|
|
354
|
+
return { r: 0, g: 0, b: 0, a: 0, format: "name" };
|
|
355
|
+
let t = E.rgb.exec(n);
|
|
356
|
+
return t ? { r: t[1], g: t[2], b: t[3] } : (t = E.rgba.exec(n), t ? { r: t[1], g: t[2], b: t[3], a: t[4] } : (t = E.hsl.exec(n), t ? { h: t[1], s: t[2], l: t[3] } : (t = E.hsla.exec(n), t ? { h: t[1], s: t[2], l: t[3], a: t[4] } : (t = E.hsv.exec(n), t ? { h: t[1], s: t[2], v: t[3] } : (t = E.hsva.exec(n), t ? { h: t[1], s: t[2], v: t[3], a: t[4] } : (t = E.cmyk.exec(n), t ? {
|
|
357
|
+
c: t[1],
|
|
358
|
+
m: t[2],
|
|
359
|
+
y: t[3],
|
|
360
|
+
k: t[4]
|
|
361
|
+
} : (t = E.hex8.exec(n), t ? {
|
|
362
|
+
r: R(t[1]),
|
|
363
|
+
g: R(t[2]),
|
|
364
|
+
b: R(t[3]),
|
|
365
|
+
a: lt(t[4]),
|
|
366
|
+
format: e ? "name" : "hex8"
|
|
367
|
+
} : (t = E.hex6.exec(n), t ? {
|
|
368
|
+
r: R(t[1]),
|
|
369
|
+
g: R(t[2]),
|
|
370
|
+
b: R(t[3]),
|
|
371
|
+
format: e ? "name" : "hex"
|
|
372
|
+
} : (t = E.hex4.exec(n), t ? {
|
|
373
|
+
r: R(t[1] + t[1]),
|
|
374
|
+
g: R(t[2] + t[2]),
|
|
375
|
+
b: R(t[3] + t[3]),
|
|
376
|
+
a: lt(t[4] + t[4]),
|
|
377
|
+
format: e ? "name" : "hex8"
|
|
378
|
+
} : (t = E.hex3.exec(n), t ? {
|
|
379
|
+
r: R(t[1] + t[1]),
|
|
380
|
+
g: R(t[2] + t[2]),
|
|
381
|
+
b: R(t[3] + t[3]),
|
|
382
|
+
format: e ? "name" : "hex"
|
|
383
|
+
} : !1))))))))));
|
|
384
|
+
}
|
|
385
|
+
function k(n) {
|
|
386
|
+
return typeof n == "number" ? !Number.isNaN(n) : E.CSS_UNIT.test(n);
|
|
387
|
+
}
|
|
388
|
+
class C {
|
|
389
|
+
constructor(e = "", t = {}) {
|
|
390
|
+
if (I(this, "r"), I(this, "g"), I(this, "b"), I(this, "a"), I(this, "format"), I(this, "originalInput"), I(this, "isValid"), I(this, "gradientType"), I(this, "roundA"), e instanceof C)
|
|
391
|
+
return e;
|
|
392
|
+
typeof e == "number" && (e = oe(e)), this.originalInput = e;
|
|
393
|
+
const r = ae(e);
|
|
394
|
+
this.originalInput = e, this.r = r.r, this.g = r.g, this.b = r.b, this.a = r.a, this.roundA = Math.round(100 * this.a) / 100, this.format = t.format ?? r.format, this.gradientType = t.gradientType, this.r < 1 && (this.r = Math.round(this.r)), this.g < 1 && (this.g = Math.round(this.g)), this.b < 1 && (this.b = Math.round(this.b)), this.isValid = r.ok;
|
|
395
|
+
}
|
|
396
|
+
get ok() {
|
|
397
|
+
return this.isValid;
|
|
398
|
+
}
|
|
399
|
+
isDark() {
|
|
400
|
+
return this.getBrightness() < 128;
|
|
401
|
+
}
|
|
402
|
+
isLight() {
|
|
403
|
+
return !this.isDark();
|
|
404
|
+
}
|
|
405
|
+
/**
|
|
406
|
+
* Returns the perceived brightness of the color, from 0-255.
|
|
407
|
+
*/
|
|
408
|
+
getBrightness() {
|
|
409
|
+
const e = this.toRgb();
|
|
410
|
+
return (e.r * 299 + e.g * 587 + e.b * 114) / 1e3;
|
|
411
|
+
}
|
|
412
|
+
/**
|
|
413
|
+
* Returns the perceived luminance of a color, from 0-1.
|
|
414
|
+
*/
|
|
415
|
+
getLuminance() {
|
|
416
|
+
const e = this.toRgb();
|
|
417
|
+
let t, r, s;
|
|
418
|
+
const i = e.r / 255, o = e.g / 255, a = e.b / 255;
|
|
419
|
+
return i <= 0.03928 ? t = i / 12.92 : t = Math.pow((i + 0.055) / 1.055, 2.4), o <= 0.03928 ? r = o / 12.92 : r = Math.pow((o + 0.055) / 1.055, 2.4), a <= 0.03928 ? s = a / 12.92 : s = Math.pow((a + 0.055) / 1.055, 2.4), 0.2126 * t + 0.7152 * r + 0.0722 * s;
|
|
420
|
+
}
|
|
421
|
+
/**
|
|
422
|
+
* Returns the alpha value of a color, from 0-1.
|
|
423
|
+
*/
|
|
424
|
+
getAlpha() {
|
|
425
|
+
return this.a;
|
|
426
|
+
}
|
|
427
|
+
/**
|
|
428
|
+
* Sets the alpha value on the current color.
|
|
429
|
+
*
|
|
430
|
+
* @param alpha - The new alpha value. The accepted range is 0-1.
|
|
431
|
+
*/
|
|
432
|
+
setAlpha(e) {
|
|
433
|
+
return this.a = Mt(e), this.roundA = Math.round(100 * this.a) / 100, this;
|
|
434
|
+
}
|
|
435
|
+
/**
|
|
436
|
+
* Returns whether the color is monochrome.
|
|
437
|
+
*/
|
|
438
|
+
isMonochrome() {
|
|
439
|
+
const { s: e } = this.toHsl();
|
|
440
|
+
return e === 0;
|
|
441
|
+
}
|
|
442
|
+
/**
|
|
443
|
+
* Returns the object as a HSVA object.
|
|
444
|
+
*/
|
|
445
|
+
toHsv() {
|
|
446
|
+
const e = X(this.r, this.g, this.b);
|
|
447
|
+
return { h: e.h * 360, s: e.s, v: e.v, a: this.a };
|
|
448
|
+
}
|
|
449
|
+
toHsv_() {
|
|
450
|
+
const e = X(this.r, this.g, this.b);
|
|
451
|
+
return { h: e.h, s: e.s, v: e.v, a: this.a };
|
|
452
|
+
}
|
|
453
|
+
/**
|
|
454
|
+
* Returns the hsva values interpolated into a string with the following format:
|
|
455
|
+
* "hsva(xxx, xxx, xxx, xx)".
|
|
456
|
+
*/
|
|
457
|
+
toHsvString() {
|
|
458
|
+
const e = X(this.r, this.g, this.b), t = Math.round(e.h * 360), r = Math.round(e.s * 100), s = Math.round(e.v * 100);
|
|
459
|
+
return this.a === 1 ? `hsv(${t}, ${r}%, ${s}%)` : `hsva(${t}, ${r}%, ${s}%, ${this.roundA})`;
|
|
460
|
+
}
|
|
461
|
+
/**
|
|
462
|
+
* Returns the object as a HSLA object.
|
|
463
|
+
*/
|
|
464
|
+
toHsl() {
|
|
465
|
+
const e = ot(this.r, this.g, this.b);
|
|
466
|
+
return { h: e.h * 360, s: e.s, l: e.l, a: this.a };
|
|
467
|
+
}
|
|
468
|
+
/**
|
|
469
|
+
* Returns the hsla values interpolated into a string with the following format:
|
|
470
|
+
* "hsla(xxx, xxx, xxx, xx)".
|
|
471
|
+
*/
|
|
472
|
+
toHslString() {
|
|
473
|
+
const e = ot(this.r, this.g, this.b), t = Math.round(e.h * 360), r = Math.round(e.s * 100), s = Math.round(e.l * 100);
|
|
474
|
+
return this.a === 1 ? `hsl(${t}, ${r}%, ${s}%)` : `hsla(${t}, ${r}%, ${s}%, ${this.roundA})`;
|
|
475
|
+
}
|
|
476
|
+
/**
|
|
477
|
+
* Returns the hex value of the color.
|
|
478
|
+
* @param allow3Char will shorten hex value to 3 char if possible
|
|
479
|
+
*/
|
|
480
|
+
toHex(e = !1) {
|
|
481
|
+
return at(this.r, this.g, this.b, e);
|
|
482
|
+
}
|
|
483
|
+
/**
|
|
484
|
+
* Returns the hex value of the color -with a # prefixed.
|
|
485
|
+
* @param allow3Char will shorten hex value to 3 char if possible
|
|
486
|
+
*/
|
|
487
|
+
toHexString(e = !1) {
|
|
488
|
+
return `#${this.toHex(e)}`;
|
|
489
|
+
}
|
|
490
|
+
/**
|
|
491
|
+
* Returns the hex 8 value of the color.
|
|
492
|
+
* @param allow4Char will shorten hex value to 4 char if possible
|
|
493
|
+
*/
|
|
494
|
+
toHex8(e = !1) {
|
|
495
|
+
return se(this.r, this.g, this.b, this.a, e);
|
|
496
|
+
}
|
|
497
|
+
/**
|
|
498
|
+
* Returns the hex 8 value of the color -with a # prefixed.
|
|
499
|
+
* @param allow4Char will shorten hex value to 4 char if possible
|
|
500
|
+
*/
|
|
501
|
+
toHex8String(e = !1) {
|
|
502
|
+
return `#${this.toHex8(e)}`;
|
|
503
|
+
}
|
|
504
|
+
/**
|
|
505
|
+
* Returns the shorter hex value of the color depends on its alpha -with a # prefixed.
|
|
506
|
+
* @param allowShortChar will shorten hex value to 3 or 4 char if possible
|
|
507
|
+
*/
|
|
508
|
+
toHexShortString(e = !1) {
|
|
509
|
+
return this.a === 1 ? this.toHexString(e) : this.toHex8String(e);
|
|
510
|
+
}
|
|
511
|
+
/**
|
|
512
|
+
* Returns the object as a RGBA object.
|
|
513
|
+
*/
|
|
514
|
+
toRgb() {
|
|
515
|
+
return {
|
|
516
|
+
r: Math.round(this.r),
|
|
517
|
+
g: Math.round(this.g),
|
|
518
|
+
b: Math.round(this.b),
|
|
519
|
+
a: this.a
|
|
520
|
+
};
|
|
521
|
+
}
|
|
522
|
+
toRgbArray() {
|
|
523
|
+
const e = this.toRgb();
|
|
524
|
+
return [e.r, e.g, e.b];
|
|
525
|
+
}
|
|
526
|
+
toRgbArrayString() {
|
|
527
|
+
const e = this.toRgb();
|
|
528
|
+
return `${e.r},${e.g},${e.b}`;
|
|
529
|
+
}
|
|
530
|
+
/**
|
|
531
|
+
* Returns the RGBA values interpolated into a string with the following format:
|
|
532
|
+
* "RGBA(xxx, xxx, xxx, xx)".
|
|
533
|
+
*/
|
|
534
|
+
toRgbString() {
|
|
535
|
+
const e = Math.round(this.r), t = Math.round(this.g), r = Math.round(this.b);
|
|
536
|
+
return this.a === 1 ? `rgb(${e}, ${t}, ${r})` : `rgba(${e}, ${t}, ${r}, ${this.roundA})`;
|
|
537
|
+
}
|
|
538
|
+
/**
|
|
539
|
+
* Returns the object as a RGBA object.
|
|
540
|
+
*/
|
|
541
|
+
toPercentageRgb() {
|
|
542
|
+
const e = (t) => `${Math.round(w(t, 255) * 100)}%`;
|
|
543
|
+
return {
|
|
544
|
+
r: e(this.r),
|
|
545
|
+
g: e(this.g),
|
|
546
|
+
b: e(this.b),
|
|
547
|
+
a: this.a
|
|
548
|
+
};
|
|
549
|
+
}
|
|
550
|
+
/**
|
|
551
|
+
* Returns the RGBA relative values interpolated into a string
|
|
552
|
+
*/
|
|
553
|
+
toPercentageRgbString() {
|
|
554
|
+
const e = (t) => Math.round(w(t, 255) * 100);
|
|
555
|
+
return this.a === 1 ? `rgb(${e(this.r)}%, ${e(this.g)}%, ${e(this.b)}%)` : `rgba(${e(this.r)}%, ${e(this.g)}%, ${e(this.b)}%, ${this.roundA})`;
|
|
556
|
+
}
|
|
557
|
+
toCmyk() {
|
|
558
|
+
return {
|
|
559
|
+
...ct(this.r, this.g, this.b)
|
|
560
|
+
};
|
|
561
|
+
}
|
|
562
|
+
toCmykString() {
|
|
563
|
+
const { c: e, m: t, y: r, k: s } = ct(this.r, this.g, this.b);
|
|
564
|
+
return `cmyk(${e}, ${t}, ${r}, ${s})`;
|
|
565
|
+
}
|
|
566
|
+
/**
|
|
567
|
+
* The 'real' name of the color -if there is one.
|
|
568
|
+
*/
|
|
569
|
+
toName() {
|
|
570
|
+
if (this.a === 0)
|
|
571
|
+
return "transparent";
|
|
572
|
+
if (this.a < 1)
|
|
573
|
+
return !1;
|
|
574
|
+
const e = `#${at(this.r, this.g, this.b, !1)}`;
|
|
575
|
+
for (const [t, r] of Object.entries(tt))
|
|
576
|
+
if (e === r)
|
|
577
|
+
return t;
|
|
578
|
+
return !1;
|
|
579
|
+
}
|
|
580
|
+
toString(e) {
|
|
581
|
+
const t = !!e;
|
|
582
|
+
e = e ?? this.format;
|
|
583
|
+
let r = !1;
|
|
584
|
+
const s = this.a < 1 && this.a >= 0;
|
|
585
|
+
return !t && s && (e.startsWith("hex") || e === "name") ? e === "name" && this.a === 0 ? this.toName() : this.toRgbString() : (e === "rgb" && (r = this.toRgbString()), e === "prgb" && (r = this.toPercentageRgbString()), (e === "hex" || e === "hex6") && (r = this.toHexString()), e === "hex3" && (r = this.toHexString(!0)), e === "hex4" && (r = this.toHex8String(!0)), e === "hex8" && (r = this.toHex8String()), e === "name" && (r = this.toName()), e === "hsl" && (r = this.toHslString()), e === "hsv" && (r = this.toHsvString()), e === "cmyk" && (r = this.toCmykString()), r || this.toHexString());
|
|
586
|
+
}
|
|
587
|
+
toNumber() {
|
|
588
|
+
return (Math.round(this.r) << 16) + (Math.round(this.g) << 8) + Math.round(this.b);
|
|
589
|
+
}
|
|
590
|
+
clone() {
|
|
591
|
+
return new C(this.toString());
|
|
592
|
+
}
|
|
593
|
+
/**
|
|
594
|
+
* Lighten the color a given amount. Providing 100 will always return white.
|
|
595
|
+
* @param amount - valid between 1-100
|
|
596
|
+
*/
|
|
597
|
+
lighten(e = 10) {
|
|
598
|
+
const t = this.toHsl();
|
|
599
|
+
return t.l += e / 100, t.l = U(t.l), new C(t);
|
|
600
|
+
}
|
|
601
|
+
/**
|
|
602
|
+
* Brighten the color a given amount, from 0 to 100.
|
|
603
|
+
* @param amount - valid between 1-100
|
|
604
|
+
*/
|
|
605
|
+
brighten(e = 10) {
|
|
606
|
+
const t = this.toRgb();
|
|
607
|
+
return t.r = Math.max(
|
|
608
|
+
0,
|
|
609
|
+
Math.min(255, t.r - Math.round(255 * -(e / 100)))
|
|
610
|
+
), t.g = Math.max(
|
|
611
|
+
0,
|
|
612
|
+
Math.min(255, t.g - Math.round(255 * -(e / 100)))
|
|
613
|
+
), t.b = Math.max(
|
|
614
|
+
0,
|
|
615
|
+
Math.min(255, t.b - Math.round(255 * -(e / 100)))
|
|
616
|
+
), new C(t);
|
|
617
|
+
}
|
|
618
|
+
/**
|
|
619
|
+
* Darken the color a given amount, from 0 to 100.
|
|
620
|
+
* Providing 100 will always return black.
|
|
621
|
+
* @param amount - valid between 1-100
|
|
622
|
+
*/
|
|
623
|
+
darken(e = 10) {
|
|
624
|
+
const t = this.toHsl();
|
|
625
|
+
return t.l -= e / 100, t.l = U(t.l), new C(t);
|
|
626
|
+
}
|
|
627
|
+
/**
|
|
628
|
+
* Mix the color with pure white, from 0 to 100.
|
|
629
|
+
* Providing 0 will do nothing, providing 100 will always return white.
|
|
630
|
+
* @param amount - valid between 1-100
|
|
631
|
+
*/
|
|
632
|
+
tint(e = 10) {
|
|
633
|
+
return this.mix("white", e);
|
|
634
|
+
}
|
|
635
|
+
/**
|
|
636
|
+
* Mix the color with pure black, from 0 to 100.
|
|
637
|
+
* Providing 0 will do nothing, providing 100 will always return black.
|
|
638
|
+
* @param amount - valid between 1-100
|
|
639
|
+
*/
|
|
640
|
+
shade(e = 10) {
|
|
641
|
+
return this.mix("black", e);
|
|
642
|
+
}
|
|
643
|
+
/**
|
|
644
|
+
* Desaturate the color a given amount, from 0 to 100.
|
|
645
|
+
* Providing 100 will is the same as calling greyscale
|
|
646
|
+
* @param amount - valid between 1-100
|
|
647
|
+
*/
|
|
648
|
+
desaturate(e = 10) {
|
|
649
|
+
const t = this.toHsl();
|
|
650
|
+
return t.s -= e / 100, t.s = U(t.s), new C(t);
|
|
651
|
+
}
|
|
652
|
+
/**
|
|
653
|
+
* Saturate the color a given amount, from 0 to 100.
|
|
654
|
+
* @param amount - valid between 1-100
|
|
655
|
+
*/
|
|
656
|
+
saturate(e = 10) {
|
|
657
|
+
const t = this.toHsl();
|
|
658
|
+
return t.s += e / 100, t.s = U(t.s), new C(t);
|
|
659
|
+
}
|
|
660
|
+
/**
|
|
661
|
+
* Completely desaturates a color into greyscale.
|
|
662
|
+
* Same as calling `desaturate(100)`
|
|
663
|
+
*/
|
|
664
|
+
greyscale() {
|
|
665
|
+
return this.desaturate(100);
|
|
666
|
+
}
|
|
667
|
+
/**
|
|
668
|
+
* Spin takes a positive or negative amount within [-360, 360] indicating the change of hue.
|
|
669
|
+
* Values outside of this range will be wrapped into this range.
|
|
670
|
+
*/
|
|
671
|
+
spin(e) {
|
|
672
|
+
const t = this.toHsl(), r = (t.h + e) % 360;
|
|
673
|
+
return t.h = r < 0 ? 360 + r : r, new C(t);
|
|
674
|
+
}
|
|
675
|
+
/**
|
|
676
|
+
* Mix the current color a given amount with another color, from 0 to 100.
|
|
677
|
+
* 0 means no mixing (return current color).
|
|
678
|
+
*/
|
|
679
|
+
mix(e, t = 50) {
|
|
680
|
+
const r = this.toRgb(), s = new C(e).toRgb(), i = t / 100, o = {
|
|
681
|
+
r: (s.r - r.r) * i + r.r,
|
|
682
|
+
g: (s.g - r.g) * i + r.g,
|
|
683
|
+
b: (s.b - r.b) * i + r.b,
|
|
684
|
+
a: (s.a - r.a) * i + r.a
|
|
685
|
+
};
|
|
686
|
+
return new C(o);
|
|
687
|
+
}
|
|
688
|
+
analogous(e = 6, t = 30) {
|
|
689
|
+
const r = this.toHsl(), s = 360 / t, i = [this];
|
|
690
|
+
for (r.h = (r.h - (s * e >> 1) + 720) % 360; --e; )
|
|
691
|
+
r.h = (r.h + s) % 360, i.push(new C(r));
|
|
692
|
+
return i;
|
|
693
|
+
}
|
|
694
|
+
/**
|
|
695
|
+
* taken from https://github.com/infusion/jQuery-xcolor/blob/master/jquery.xcolor.js
|
|
696
|
+
*/
|
|
697
|
+
complement() {
|
|
698
|
+
const e = this.toHsl();
|
|
699
|
+
return e.h = (e.h + 180) % 360, new C(e);
|
|
700
|
+
}
|
|
701
|
+
monochromatic(e = 6) {
|
|
702
|
+
const t = this.toHsv(), { h: r } = t, { s } = t;
|
|
703
|
+
let { v: i } = t;
|
|
704
|
+
const o = [], a = 1 / e;
|
|
705
|
+
for (; e--; )
|
|
706
|
+
o.push(new C({ h: r, s, v: i })), i = (i + a) % 1;
|
|
707
|
+
return o;
|
|
708
|
+
}
|
|
709
|
+
splitcomplement() {
|
|
710
|
+
const e = this.toHsl(), { h: t } = e;
|
|
711
|
+
return [
|
|
712
|
+
this,
|
|
713
|
+
new C({ h: (t + 72) % 360, s: e.s, l: e.l }),
|
|
714
|
+
new C({ h: (t + 216) % 360, s: e.s, l: e.l })
|
|
715
|
+
];
|
|
716
|
+
}
|
|
717
|
+
/**
|
|
718
|
+
* Compute how the color would appear on a background
|
|
719
|
+
*/
|
|
720
|
+
onBackground(e) {
|
|
721
|
+
const t = this.toRgb(), r = new C(e).toRgb(), s = t.a + r.a * (1 - t.a);
|
|
722
|
+
return new C({
|
|
723
|
+
r: (t.r * t.a + r.r * r.a * (1 - t.a)) / s,
|
|
724
|
+
g: (t.g * t.a + r.g * r.a * (1 - t.a)) / s,
|
|
725
|
+
b: (t.b * t.a + r.b * r.a * (1 - t.a)) / s,
|
|
726
|
+
a: s
|
|
727
|
+
});
|
|
728
|
+
}
|
|
729
|
+
/**
|
|
730
|
+
* Alias for `polyad(3)`
|
|
731
|
+
*/
|
|
732
|
+
triad() {
|
|
733
|
+
return this.polyad(3);
|
|
734
|
+
}
|
|
735
|
+
/**
|
|
736
|
+
* Alias for `polyad(4)`
|
|
737
|
+
*/
|
|
738
|
+
tetrad() {
|
|
739
|
+
return this.polyad(4);
|
|
740
|
+
}
|
|
741
|
+
/**
|
|
742
|
+
* Get polyad colors, like (for 1, 2, 3, 4, 5, 6, 7, 8, etc...)
|
|
743
|
+
* monad, dyad, triad, tetrad, pentad, hexad, heptad, octad, etc...
|
|
744
|
+
*/
|
|
745
|
+
polyad(e) {
|
|
746
|
+
const t = this.toHsl(), { h: r } = t, s = [this], i = 360 / e;
|
|
747
|
+
for (let o = 1; o < e; o++)
|
|
748
|
+
s.push(
|
|
749
|
+
new C({ h: (r + o * i) % 360, s: t.s, l: t.l })
|
|
750
|
+
);
|
|
751
|
+
return s;
|
|
752
|
+
}
|
|
753
|
+
/**
|
|
754
|
+
* compare color vs current color
|
|
755
|
+
*/
|
|
756
|
+
equals(e) {
|
|
757
|
+
const t = new C(e);
|
|
758
|
+
return this.format === "cmyk" || t.format === "cmyk" ? this.toCmykString() === t.toCmykString() : this.toRgbString() === t.toRgbString();
|
|
759
|
+
}
|
|
760
|
+
}
|
|
761
|
+
function fe(n, e) {
|
|
762
|
+
const {
|
|
763
|
+
getPrefixCls: t,
|
|
764
|
+
locale: r,
|
|
765
|
+
componentConfig: s
|
|
766
|
+
} = rt(q), i = Ct(
|
|
767
|
+
n,
|
|
768
|
+
{},
|
|
769
|
+
s == null ? void 0 : s.Empty
|
|
770
|
+
), { style: o, className: a, description: h, icon: l, imgSrc: c, ...u } = i, m = t("empty"), p = j(m, a), b = r.Empty.noData, f = typeof h == "string" ? h : "empty";
|
|
771
|
+
return /* @__PURE__ */ d("div", { ref: e, className: p, style: o, ...u, children: /* @__PURE__ */ V("div", { className: `${m}-wrapper`, children: [
|
|
772
|
+
/* @__PURE__ */ d("div", { className: `${m}-image`, children: c ? /* @__PURE__ */ d("img", { alt: f, src: c }) : l || /* @__PURE__ */ d(Dt, {}) }),
|
|
773
|
+
/* @__PURE__ */ d("div", { className: `${m}-description`, children: h || b })
|
|
774
|
+
] }) });
|
|
775
|
+
}
|
|
776
|
+
const St = pt(fe);
|
|
777
|
+
St.displayName = "Empty";
|
|
778
|
+
const de = G.memo(St);
|
|
779
|
+
function ue(n) {
|
|
780
|
+
switch (n) {
|
|
781
|
+
default:
|
|
782
|
+
return /* @__PURE__ */ d(de, {});
|
|
783
|
+
}
|
|
784
|
+
}
|
|
785
|
+
const Rt = {
|
|
786
|
+
locale: Jt,
|
|
787
|
+
prefixCls: "pqb",
|
|
788
|
+
getPopupContainer: () => document.body,
|
|
789
|
+
size: "default",
|
|
790
|
+
renderEmpty: ue
|
|
791
|
+
}, q = qt({
|
|
792
|
+
getPrefixCls: (n, e) => `${e || "pqb"}-${n}`,
|
|
793
|
+
...Rt
|
|
794
|
+
});
|
|
795
|
+
function ge(n, e) {
|
|
796
|
+
const {
|
|
797
|
+
children: t,
|
|
798
|
+
className: r,
|
|
799
|
+
disabled: s,
|
|
800
|
+
prefix: i,
|
|
801
|
+
size: o = "default",
|
|
802
|
+
...a
|
|
803
|
+
} = n, { getPrefixCls: h } = rt(q), l = h("icon-hover"), c = st();
|
|
804
|
+
return xt(e, () => ({
|
|
805
|
+
getRootDOMNode: () => c.current
|
|
806
|
+
})), /* @__PURE__ */ d(
|
|
807
|
+
"span",
|
|
808
|
+
{
|
|
809
|
+
ref: c,
|
|
810
|
+
className: j(
|
|
811
|
+
l,
|
|
812
|
+
{
|
|
813
|
+
[`${i}-icon-hover`]: i,
|
|
814
|
+
[`${l}-size-${o}`]: o && o !== "default",
|
|
815
|
+
[`${l}-disabled`]: s
|
|
816
|
+
},
|
|
817
|
+
r
|
|
818
|
+
),
|
|
819
|
+
onClick: n.onClick,
|
|
820
|
+
...a,
|
|
821
|
+
children: t
|
|
822
|
+
}
|
|
823
|
+
);
|
|
824
|
+
}
|
|
825
|
+
const ht = G.forwardRef(ge);
|
|
826
|
+
class J extends Ot {
|
|
827
|
+
constructor(t) {
|
|
828
|
+
super(t);
|
|
829
|
+
g(this, "context");
|
|
830
|
+
g(this, "wrapper");
|
|
831
|
+
g(this, "timer");
|
|
832
|
+
g(this, "rootDOMRef");
|
|
833
|
+
g(this, "getRootDOMNode", () => this.rootDOMRef.current);
|
|
834
|
+
g(this, "startTimer", () => {
|
|
835
|
+
const { duration: t, onClose: r, id: s } = this.props;
|
|
836
|
+
t !== 0 && (this.timer = window.setTimeout(() => {
|
|
837
|
+
r == null || r(s), this.removeTimer();
|
|
838
|
+
}, t));
|
|
839
|
+
});
|
|
840
|
+
g(this, "removeTimer", () => {
|
|
841
|
+
this.timer && (window.clearTimeout(this.timer), this.timer = null);
|
|
842
|
+
});
|
|
843
|
+
g(this, "onClose", () => {
|
|
844
|
+
var t, r;
|
|
845
|
+
(r = (t = this.props).onClose) == null || r.call(t, this.props.id);
|
|
846
|
+
});
|
|
847
|
+
g(this, "renderIcon", () => {
|
|
848
|
+
const { showIcon: t, icon: r, type: s, prefixCls: i, iconPrefix: o } = this.props;
|
|
849
|
+
let a;
|
|
850
|
+
if (r)
|
|
851
|
+
a = r;
|
|
852
|
+
else if (t) {
|
|
853
|
+
switch (s) {
|
|
854
|
+
case "info":
|
|
855
|
+
a = /* @__PURE__ */ d(Vt, {});
|
|
856
|
+
break;
|
|
857
|
+
case "success":
|
|
858
|
+
a = /* @__PURE__ */ d(Bt, {});
|
|
859
|
+
break;
|
|
860
|
+
case "error":
|
|
861
|
+
a = /* @__PURE__ */ d(zt, {});
|
|
862
|
+
break;
|
|
863
|
+
case "warning":
|
|
864
|
+
a = /* @__PURE__ */ d(Wt, {});
|
|
865
|
+
break;
|
|
866
|
+
case "loading":
|
|
867
|
+
a = /* @__PURE__ */ d(Ut, {});
|
|
868
|
+
break;
|
|
869
|
+
}
|
|
870
|
+
a = /* @__PURE__ */ d(
|
|
871
|
+
_.Provider,
|
|
872
|
+
{
|
|
873
|
+
value: o ? { prefixCls: o } : {},
|
|
874
|
+
children: a
|
|
875
|
+
}
|
|
876
|
+
);
|
|
877
|
+
}
|
|
878
|
+
return /* @__PURE__ */ d("span", { className: `${i}-icon`, children: a });
|
|
879
|
+
});
|
|
880
|
+
g(this, "onMouseEnter", () => {
|
|
881
|
+
this.removeTimer();
|
|
882
|
+
});
|
|
883
|
+
g(this, "onMouseLeave", () => {
|
|
884
|
+
this.removeTimer(), this.startTimer();
|
|
885
|
+
});
|
|
886
|
+
this.rootDOMRef = jt();
|
|
887
|
+
}
|
|
888
|
+
componentDidMount() {
|
|
889
|
+
this.startTimer();
|
|
890
|
+
}
|
|
891
|
+
componentDidUpdate(t) {
|
|
892
|
+
(t.duration !== this.props.duration || this.props.update) && (this.removeTimer(), this.startTimer());
|
|
893
|
+
}
|
|
894
|
+
componentWillUnmount() {
|
|
895
|
+
this.removeTimer();
|
|
896
|
+
}
|
|
897
|
+
render() {
|
|
898
|
+
const {
|
|
899
|
+
title: t,
|
|
900
|
+
content: r,
|
|
901
|
+
showIcon: s,
|
|
902
|
+
className: i,
|
|
903
|
+
style: o,
|
|
904
|
+
type: a,
|
|
905
|
+
btn: h,
|
|
906
|
+
icon: l,
|
|
907
|
+
prefixCls: c,
|
|
908
|
+
closable: u,
|
|
909
|
+
noticeType: m,
|
|
910
|
+
iconPrefix: p,
|
|
911
|
+
rtl: b,
|
|
912
|
+
closeIcon: f,
|
|
913
|
+
classPrefixCls: x
|
|
914
|
+
} = this.props, y = j(
|
|
915
|
+
c,
|
|
916
|
+
`${c}-${a}`,
|
|
917
|
+
{
|
|
918
|
+
[`${c}-closable`]: u,
|
|
919
|
+
[`${c}-rtl`]: b
|
|
920
|
+
},
|
|
921
|
+
i
|
|
922
|
+
);
|
|
923
|
+
let $ = "closable" in this.props ? u : !0, v = s;
|
|
924
|
+
a === "normal" && !l && (v = !1);
|
|
925
|
+
const L = { ...this.context };
|
|
926
|
+
if (x && (L.prefixCls = x), m === "message")
|
|
927
|
+
return $ = u, /* @__PURE__ */ d(K, { ...L, children: /* @__PURE__ */ d(
|
|
928
|
+
"div",
|
|
929
|
+
{
|
|
930
|
+
style: { textAlign: "center" },
|
|
931
|
+
onMouseEnter: this.onMouseEnter,
|
|
932
|
+
onMouseLeave: this.onMouseLeave,
|
|
933
|
+
ref: this.rootDOMRef,
|
|
934
|
+
children: /* @__PURE__ */ V("div", { className: y, style: o, role: "alert", children: [
|
|
935
|
+
v && this.renderIcon(),
|
|
936
|
+
/* @__PURE__ */ d("span", { className: `${c}-content`, children: r }),
|
|
937
|
+
$ && (f !== void 0 ? /* @__PURE__ */ d(
|
|
938
|
+
"span",
|
|
939
|
+
{
|
|
940
|
+
onClick: this.onClose,
|
|
941
|
+
className: `${c}-close-btn`,
|
|
942
|
+
children: f
|
|
943
|
+
}
|
|
944
|
+
) : /* @__PURE__ */ d(
|
|
945
|
+
ht,
|
|
946
|
+
{
|
|
947
|
+
prefix: c,
|
|
948
|
+
className: `${c}-close-btn`,
|
|
949
|
+
onClick: this.onClose,
|
|
950
|
+
children: /* @__PURE__ */ d(it, {})
|
|
951
|
+
}
|
|
952
|
+
))
|
|
953
|
+
] })
|
|
954
|
+
}
|
|
955
|
+
) });
|
|
956
|
+
if (m === "notification")
|
|
957
|
+
return /* @__PURE__ */ d(K, { ...L, children: /* @__PURE__ */ d(
|
|
958
|
+
"div",
|
|
959
|
+
{
|
|
960
|
+
ref: this.rootDOMRef,
|
|
961
|
+
onMouseEnter: this.onMouseEnter,
|
|
962
|
+
onMouseLeave: this.onMouseLeave,
|
|
963
|
+
children: /* @__PURE__ */ V("div", { className: y, style: o, role: "alert", children: [
|
|
964
|
+
v && /* @__PURE__ */ d("div", { className: `${c}-left`, children: this.renderIcon() }),
|
|
965
|
+
/* @__PURE__ */ V("div", { className: `${c}-right`, children: [
|
|
966
|
+
t && /* @__PURE__ */ d("div", { className: `${c}-title`, children: t }),
|
|
967
|
+
/* @__PURE__ */ d("div", { className: `${c}-content`, children: r }),
|
|
968
|
+
h && /* @__PURE__ */ d("div", { className: `${c}-btn-wrapper`, children: h })
|
|
969
|
+
] }),
|
|
970
|
+
$ && (f !== void 0 ? /* @__PURE__ */ d(
|
|
971
|
+
"span",
|
|
972
|
+
{
|
|
973
|
+
onClick: this.onClose,
|
|
974
|
+
className: `${c}-close-btn`,
|
|
975
|
+
children: f
|
|
976
|
+
}
|
|
977
|
+
) : /* @__PURE__ */ d(
|
|
978
|
+
ht,
|
|
979
|
+
{
|
|
980
|
+
prefix: c,
|
|
981
|
+
className: `${c}-close-btn`,
|
|
982
|
+
onClick: this.onClose,
|
|
983
|
+
children: /* @__PURE__ */ d(
|
|
984
|
+
_.Provider,
|
|
985
|
+
{
|
|
986
|
+
value: p ? { prefixCls: p } : {},
|
|
987
|
+
children: /* @__PURE__ */ d(it, {})
|
|
988
|
+
}
|
|
989
|
+
)
|
|
990
|
+
}
|
|
991
|
+
))
|
|
992
|
+
] })
|
|
993
|
+
}
|
|
994
|
+
) });
|
|
995
|
+
}
|
|
996
|
+
}
|
|
997
|
+
g(J, "defaultProps", {
|
|
998
|
+
type: "info",
|
|
999
|
+
showIcon: !0,
|
|
1000
|
+
noticeType: "message",
|
|
1001
|
+
duration: 3e3
|
|
1002
|
+
}), g(J, "contextType", q);
|
|
1003
|
+
function me(n = {}) {
|
|
1004
|
+
const { maxCount: e, duration: t = 3e3, prefixCls: r } = n, s = st(), i = /* @__PURE__ */ d(Ht, { ref: s }), o = {};
|
|
1005
|
+
let a;
|
|
1006
|
+
function h(c) {
|
|
1007
|
+
let u, m;
|
|
1008
|
+
if (s.current) {
|
|
1009
|
+
const v = s.current.getContextConfig();
|
|
1010
|
+
m = v.rtl, u = v.prefixCls;
|
|
1011
|
+
}
|
|
1012
|
+
const p = r || u, b = {
|
|
1013
|
+
position: "top",
|
|
1014
|
+
duration: t,
|
|
1015
|
+
...c
|
|
1016
|
+
}, { position: f, transitionClassNames: x } = b;
|
|
1017
|
+
let y;
|
|
1018
|
+
if (o[f]) {
|
|
1019
|
+
const v = o[f].state.notices;
|
|
1020
|
+
v.length >= e ? (y = v[0].id, v.shift(), o[f].add({ ...b, id: y })) : y = o[f].add(b);
|
|
1021
|
+
} else
|
|
1022
|
+
a = /* @__PURE__ */ d(
|
|
1023
|
+
M,
|
|
1024
|
+
{
|
|
1025
|
+
transitionClassNames: x,
|
|
1026
|
+
ref: (v) => {
|
|
1027
|
+
o[f] = v, o[f] && (y = o[f].add(b));
|
|
1028
|
+
},
|
|
1029
|
+
prefixCls: p,
|
|
1030
|
+
rtl: m
|
|
1031
|
+
}
|
|
1032
|
+
), s.current.addInstance(a);
|
|
1033
|
+
return () => {
|
|
1034
|
+
o[f] && o[f].remove(y);
|
|
1035
|
+
};
|
|
1036
|
+
}
|
|
1037
|
+
const l = {};
|
|
1038
|
+
return ["info", "success", "warning", "error", "normal"].forEach((c) => {
|
|
1039
|
+
l[c] = (u) => {
|
|
1040
|
+
const m = Kt(u) ? { content: u } : u;
|
|
1041
|
+
return h({
|
|
1042
|
+
...m,
|
|
1043
|
+
type: c
|
|
1044
|
+
});
|
|
1045
|
+
};
|
|
1046
|
+
}), [l, i];
|
|
1047
|
+
}
|
|
1048
|
+
const be = [
|
|
1049
|
+
"info",
|
|
1050
|
+
"success",
|
|
1051
|
+
"error",
|
|
1052
|
+
"warning",
|
|
1053
|
+
"loading",
|
|
1054
|
+
"normal"
|
|
1055
|
+
];
|
|
1056
|
+
let A = {}, Nt, ft, Et, et, dt, ut;
|
|
1057
|
+
function At(n) {
|
|
1058
|
+
const e = {
|
|
1059
|
+
position: "top",
|
|
1060
|
+
duration: Et,
|
|
1061
|
+
...n
|
|
1062
|
+
}, { position: t, transitionClassNames: r, transitionTimeout: s } = e;
|
|
1063
|
+
let i;
|
|
1064
|
+
const { instance: o, pending: a } = A[t] || {};
|
|
1065
|
+
if (o || a) {
|
|
1066
|
+
const l = () => {
|
|
1067
|
+
const { instance: c } = A[t] || {}, u = c.state.notices, m = u.find((b) => b.id === n.id), p = {
|
|
1068
|
+
...e,
|
|
1069
|
+
update: m
|
|
1070
|
+
};
|
|
1071
|
+
u.length >= Nt ? m ? c.add({
|
|
1072
|
+
...p,
|
|
1073
|
+
id: m.id
|
|
1074
|
+
}) : (u.shift(), c.add(p)) : i = c.add(p);
|
|
1075
|
+
};
|
|
1076
|
+
o ? l() : a != null && a.then && a.then(() => {
|
|
1077
|
+
l(), A[t].pending = null;
|
|
1078
|
+
});
|
|
1079
|
+
} else {
|
|
1080
|
+
const l = document.createElement("div");
|
|
1081
|
+
(et || document.body).appendChild(l), A[t] = {}, A[t].pending = new Promise((c) => {
|
|
1082
|
+
$t(
|
|
1083
|
+
/* @__PURE__ */ d(
|
|
1084
|
+
M,
|
|
1085
|
+
{
|
|
1086
|
+
transitionClassNames: r,
|
|
1087
|
+
transitionTimeout: s,
|
|
1088
|
+
ref: (u) => {
|
|
1089
|
+
A[t] || (A[t] = {}), A[t].instance = u, i = u.add(e), c(null);
|
|
1090
|
+
}
|
|
1091
|
+
}
|
|
1092
|
+
),
|
|
1093
|
+
l
|
|
1094
|
+
);
|
|
1095
|
+
});
|
|
1096
|
+
}
|
|
1097
|
+
return () => {
|
|
1098
|
+
var l, c;
|
|
1099
|
+
(c = (l = A[t]) == null ? void 0 : l.instance) == null || c.remove(i);
|
|
1100
|
+
};
|
|
1101
|
+
}
|
|
1102
|
+
class M extends wt {
|
|
1103
|
+
constructor() {
|
|
1104
|
+
super(...arguments);
|
|
1105
|
+
g(this, "remove", (t) => {
|
|
1106
|
+
const r = this.state.notices.find((s) => s.id === t);
|
|
1107
|
+
r && this.update({
|
|
1108
|
+
...r,
|
|
1109
|
+
style: { ...r.style, opacity: 0 }
|
|
1110
|
+
}), setTimeout(() => {
|
|
1111
|
+
super.remove(t);
|
|
1112
|
+
}, 100);
|
|
1113
|
+
});
|
|
1114
|
+
}
|
|
1115
|
+
render() {
|
|
1116
|
+
const {
|
|
1117
|
+
transitionClassNames: t,
|
|
1118
|
+
transitionTimeout: r,
|
|
1119
|
+
prefixCls: s,
|
|
1120
|
+
rtl: i,
|
|
1121
|
+
closable: o
|
|
1122
|
+
} = this.props, { notices: a, position: h } = this.state, l = s || ft, c = F(i) ? dt : i, u = F(o) ? ut : o, m = l ? `${l}-message` : "pqb-message", p = {
|
|
1123
|
+
enter: O(r == null ? void 0 : r.enter) ? r == null ? void 0 : r.enter : 100,
|
|
1124
|
+
exit: O(r == null ? void 0 : r.exit) ? r == null ? void 0 : r.exit : 300
|
|
1125
|
+
}, b = j(
|
|
1126
|
+
`${m}-wrapper`,
|
|
1127
|
+
`${m}-wrapper-${h}`
|
|
1128
|
+
);
|
|
1129
|
+
return /* @__PURE__ */ d("div", { className: b, children: /* @__PURE__ */ d(yt, { component: null, children: a.map((f) => /* @__PURE__ */ d(
|
|
1130
|
+
vt,
|
|
1131
|
+
{
|
|
1132
|
+
timeout: p,
|
|
1133
|
+
classNames: t || "fadeMessage",
|
|
1134
|
+
onExit: (x) => {
|
|
1135
|
+
x && (x.style.height = `${x.scrollHeight}px`);
|
|
1136
|
+
},
|
|
1137
|
+
onExiting: (x) => {
|
|
1138
|
+
x && (x.style.height = 0);
|
|
1139
|
+
},
|
|
1140
|
+
onExited: (x) => {
|
|
1141
|
+
var y;
|
|
1142
|
+
x && (x.style.height = 0, (y = f.onClose) == null || y.call(f));
|
|
1143
|
+
},
|
|
1144
|
+
children: /* @__PURE__ */ d(
|
|
1145
|
+
J,
|
|
1146
|
+
{
|
|
1147
|
+
...f,
|
|
1148
|
+
prefixCls: m,
|
|
1149
|
+
classPrefixCls: l,
|
|
1150
|
+
iconPrefix: l,
|
|
1151
|
+
onClose: this.remove,
|
|
1152
|
+
noticeType: "message",
|
|
1153
|
+
rtl: c,
|
|
1154
|
+
...F(u) ? {} : { closable: u }
|
|
1155
|
+
}
|
|
1156
|
+
)
|
|
1157
|
+
},
|
|
1158
|
+
f.id
|
|
1159
|
+
)) }) });
|
|
1160
|
+
}
|
|
1161
|
+
}
|
|
1162
|
+
g(M, "useMessage"), g(M, "success"), g(M, "info"), g(M, "warning"), g(M, "error"), g(M, "loading"), g(M, "normal"), g(M, "config", (t = {}) => {
|
|
1163
|
+
var r;
|
|
1164
|
+
O(t.maxCount) && (Nt = t.maxCount), t.prefixCls && (ft = t.prefixCls), O(t.duration) && (Et = t.duration), typeof t.rtl == "boolean" && (dt = t.rtl), typeof t.closable == "boolean" && (ut = t.closable), ((r = t.getContainer) == null ? void 0 : r.call(t)) !== et && (et = t.getContainer(), Object.values(A).forEach(
|
|
1165
|
+
({ instance: s }) => s == null ? void 0 : s.clear()
|
|
1166
|
+
), A = {});
|
|
1167
|
+
}), g(M, "clear", () => {
|
|
1168
|
+
Object.values(A).forEach(({ instance: t }) => {
|
|
1169
|
+
t == null || t.clear();
|
|
1170
|
+
});
|
|
1171
|
+
}), g(M, "addInstance", At);
|
|
1172
|
+
be.forEach((n) => {
|
|
1173
|
+
M[n] = (e) => At({
|
|
1174
|
+
...typeof e == "string" ? { content: e } : e,
|
|
1175
|
+
type: n
|
|
1176
|
+
});
|
|
1177
|
+
});
|
|
1178
|
+
M.useMessage = me;
|
|
1179
|
+
let Pt = {};
|
|
1180
|
+
function pe(n) {
|
|
1181
|
+
Pt = {
|
|
1182
|
+
...n
|
|
1183
|
+
};
|
|
1184
|
+
}
|
|
1185
|
+
function De() {
|
|
1186
|
+
return Pt;
|
|
1187
|
+
}
|
|
1188
|
+
let nt = {
|
|
1189
|
+
simple: !0
|
|
1190
|
+
};
|
|
1191
|
+
const Ue = (n) => {
|
|
1192
|
+
nt = {
|
|
1193
|
+
...nt,
|
|
1194
|
+
...n
|
|
1195
|
+
};
|
|
1196
|
+
}, We = () => nt, ze = [], Be = [];
|
|
1197
|
+
function xe(n = {}) {
|
|
1198
|
+
const {
|
|
1199
|
+
maxCount: e,
|
|
1200
|
+
duration: t = 3e3,
|
|
1201
|
+
prefixCls: r,
|
|
1202
|
+
getContainer: s
|
|
1203
|
+
} = n, i = st(), o = /* @__PURE__ */ d(Ht, { ref: i }), a = {};
|
|
1204
|
+
let h;
|
|
1205
|
+
function l(u) {
|
|
1206
|
+
let m, p;
|
|
1207
|
+
if (i.current) {
|
|
1208
|
+
const $ = i.current.getContextConfig();
|
|
1209
|
+
p = $.rtl, m = $.prefixCls;
|
|
1210
|
+
}
|
|
1211
|
+
const b = r || m;
|
|
1212
|
+
let f = u.position;
|
|
1213
|
+
F(u.position) && (f = p ? "topLeft" : "topRight");
|
|
1214
|
+
const x = {
|
|
1215
|
+
duration: t,
|
|
1216
|
+
...u
|
|
1217
|
+
};
|
|
1218
|
+
let y;
|
|
1219
|
+
if (a[f]) {
|
|
1220
|
+
const $ = a[f].state.notices;
|
|
1221
|
+
$.length >= e ? (y = $[0].id, $.shift(), a[f].add({ ...x, id: y })) : y = a[f].add(x);
|
|
1222
|
+
} else
|
|
1223
|
+
h = /* @__PURE__ */ d(
|
|
1224
|
+
T,
|
|
1225
|
+
{
|
|
1226
|
+
ref: ($) => {
|
|
1227
|
+
a[f] = $, a[f] && (y = a[f].add(x));
|
|
1228
|
+
},
|
|
1229
|
+
prefixCls: b,
|
|
1230
|
+
rtl: p,
|
|
1231
|
+
getContainer: s
|
|
1232
|
+
}
|
|
1233
|
+
), i.current.addInstance(h);
|
|
1234
|
+
return a[f];
|
|
1235
|
+
}
|
|
1236
|
+
const c = {};
|
|
1237
|
+
return ["info", "success", "warning", "error", "normal"].forEach((u) => {
|
|
1238
|
+
c[u] = (m) => l({
|
|
1239
|
+
...m,
|
|
1240
|
+
type: u
|
|
1241
|
+
});
|
|
1242
|
+
}), [c, o];
|
|
1243
|
+
}
|
|
1244
|
+
const Ce = ["info", "success", "error", "warning", "normal"];
|
|
1245
|
+
let S = {}, gt, mt, bt, Z, B;
|
|
1246
|
+
const N = class N extends wt {
|
|
1247
|
+
constructor() {
|
|
1248
|
+
super(...arguments);
|
|
1249
|
+
g(this, "remove", (t) => {
|
|
1250
|
+
const r = this.state.notices.find((s) => s.id === t);
|
|
1251
|
+
r && this.update({
|
|
1252
|
+
...r,
|
|
1253
|
+
style: { ...r.style, opacity: 0 }
|
|
1254
|
+
}), setTimeout(() => {
|
|
1255
|
+
super.remove(t);
|
|
1256
|
+
}, 200);
|
|
1257
|
+
});
|
|
1258
|
+
}
|
|
1259
|
+
render() {
|
|
1260
|
+
const { notices: t } = this.state, { prefixCls: r, rtl: s, getContainer: i } = this.props;
|
|
1261
|
+
let o = this.state.position;
|
|
1262
|
+
const a = F(s) ? B : s;
|
|
1263
|
+
F(o) && (o = a ? "topLeft" : "topRight");
|
|
1264
|
+
const h = r || mt, l = h ? `${h}-notification` : "pqb-notification";
|
|
1265
|
+
let c;
|
|
1266
|
+
o === "topLeft" || o === "bottomLeft" ? c = "slideNoticeLeft" : c = "slideNoticeRight";
|
|
1267
|
+
const u = j(
|
|
1268
|
+
`${l}-wrapper`,
|
|
1269
|
+
`${l}-wrapper-${o}`,
|
|
1270
|
+
{ [`${l}-wrapper-rtl`]: B }
|
|
1271
|
+
), m = i == null ? void 0 : i(), p = /* @__PURE__ */ d("div", { className: u, children: /* @__PURE__ */ d(yt, { component: null, children: t.map((b) => /* @__PURE__ */ d(
|
|
1272
|
+
vt,
|
|
1273
|
+
{
|
|
1274
|
+
timeout: {
|
|
1275
|
+
enter: 400,
|
|
1276
|
+
exit: 300
|
|
1277
|
+
},
|
|
1278
|
+
classNames: c,
|
|
1279
|
+
onExit: (f) => {
|
|
1280
|
+
f && (f.style.height = `${f.scrollHeight}px`);
|
|
1281
|
+
},
|
|
1282
|
+
onExiting: (f) => {
|
|
1283
|
+
f && (f.style.height = 0);
|
|
1284
|
+
},
|
|
1285
|
+
onExited: (f) => {
|
|
1286
|
+
var x;
|
|
1287
|
+
f && (f.style.height = 0, (x = b.onClose) == null || x.call(b));
|
|
1288
|
+
},
|
|
1289
|
+
children: /* @__PURE__ */ d(
|
|
1290
|
+
J,
|
|
1291
|
+
{
|
|
1292
|
+
...b,
|
|
1293
|
+
onClose: this.remove,
|
|
1294
|
+
prefixCls: l,
|
|
1295
|
+
iconPrefix: h,
|
|
1296
|
+
classPrefixCls: h,
|
|
1297
|
+
noticeType: "notification",
|
|
1298
|
+
rtl: a
|
|
1299
|
+
}
|
|
1300
|
+
)
|
|
1301
|
+
},
|
|
1302
|
+
b.id
|
|
1303
|
+
)) }) });
|
|
1304
|
+
return m ? Qt(p, m) : p;
|
|
1305
|
+
}
|
|
1306
|
+
};
|
|
1307
|
+
g(N, "useNotification"), g(N, "success"), g(N, "info"), g(N, "warning"), g(N, "error"), g(N, "normal"), g(N, "config", (t = {}) => {
|
|
1308
|
+
var r;
|
|
1309
|
+
O(t.maxCount) && (gt = t.maxCount), t.prefixCls && (mt = t.prefixCls), O(t.duration) && (bt = t.duration), typeof t.rtl == "boolean" && (B = t.rtl), t.getContainer && ((r = t.getContainer) == null ? void 0 : r.call(t)) !== Z && (Z = t.getContainer(), Object.values(S).forEach(
|
|
1310
|
+
({ instance: s }) => s == null ? void 0 : s.clear()
|
|
1311
|
+
), S = {});
|
|
1312
|
+
}), g(N, "clear", () => {
|
|
1313
|
+
Object.values(S).forEach(({ instance: t }) => {
|
|
1314
|
+
t == null || t.clear();
|
|
1315
|
+
});
|
|
1316
|
+
}), g(N, "remove", (t) => {
|
|
1317
|
+
Object.values(S).forEach(({ instance: r }) => {
|
|
1318
|
+
r == null || r.remove(t);
|
|
1319
|
+
});
|
|
1320
|
+
}), g(N, "addInstance", (t) => {
|
|
1321
|
+
let r = t.position;
|
|
1322
|
+
F(t.position) && (r = B ? "topLeft" : "topRight");
|
|
1323
|
+
const s = {
|
|
1324
|
+
duration: bt,
|
|
1325
|
+
...t
|
|
1326
|
+
}, { instance: i, pending: o } = S[r] || {};
|
|
1327
|
+
if (i || o) {
|
|
1328
|
+
const h = () => {
|
|
1329
|
+
const { instance: l } = S[r] || {}, c = l.state.notices, u = c.find((p) => p.id === t.id), m = {
|
|
1330
|
+
...s,
|
|
1331
|
+
update: u
|
|
1332
|
+
};
|
|
1333
|
+
return c.length >= gt ? u ? l.add({
|
|
1334
|
+
...m,
|
|
1335
|
+
id: u.id
|
|
1336
|
+
}) : (c.shift(), l.add(m)) : l.add({ ...m }), l;
|
|
1337
|
+
};
|
|
1338
|
+
return i ? h() : o != null && o.then && o.then(() => {
|
|
1339
|
+
h(), S[r].pending = null;
|
|
1340
|
+
}), i;
|
|
1341
|
+
}
|
|
1342
|
+
const a = document.createElement("div");
|
|
1343
|
+
return (Z || document.body).appendChild(a), S[r] = {}, S[r].pending = new Promise((h) => {
|
|
1344
|
+
$t(
|
|
1345
|
+
/* @__PURE__ */ d(
|
|
1346
|
+
N,
|
|
1347
|
+
{
|
|
1348
|
+
ref: (l) => (S[r] || (S[r] = {}), S[r].instance = l, l.add(s), h(null), l)
|
|
1349
|
+
}
|
|
1350
|
+
),
|
|
1351
|
+
a
|
|
1352
|
+
);
|
|
1353
|
+
}), S[r].instance;
|
|
1354
|
+
});
|
|
1355
|
+
let T = N;
|
|
1356
|
+
Ce.forEach((n) => {
|
|
1357
|
+
T[n] = (e) => T.addInstance({
|
|
1358
|
+
...e,
|
|
1359
|
+
type: n
|
|
1360
|
+
});
|
|
1361
|
+
});
|
|
1362
|
+
T.useNotification = xe;
|
|
1363
|
+
const ye = {
|
|
1364
|
+
primaryColor: {
|
|
1365
|
+
default: "--pqbblue-6",
|
|
1366
|
+
hover: "--pqbblue-5",
|
|
1367
|
+
active: "--pqbblue-7"
|
|
1368
|
+
},
|
|
1369
|
+
successColor: {
|
|
1370
|
+
default: "--green-6",
|
|
1371
|
+
hover: "--green-5",
|
|
1372
|
+
active: "--green-7"
|
|
1373
|
+
},
|
|
1374
|
+
infoColor: {
|
|
1375
|
+
default: "--pqbblue-6",
|
|
1376
|
+
hover: "--pqbblue-5",
|
|
1377
|
+
active: "--pqbblue-7"
|
|
1378
|
+
},
|
|
1379
|
+
warningColor: {
|
|
1380
|
+
default: "--orangered-6",
|
|
1381
|
+
hover: "--orangered-5",
|
|
1382
|
+
active: "--orangered-7"
|
|
1383
|
+
},
|
|
1384
|
+
dangerColor: {
|
|
1385
|
+
default: "--red-6",
|
|
1386
|
+
hover: "--red-5",
|
|
1387
|
+
active: "--red-7"
|
|
1388
|
+
}
|
|
1389
|
+
}, ve = Rt, we = {};
|
|
1390
|
+
function K(n) {
|
|
1391
|
+
const e = Ct(
|
|
1392
|
+
n,
|
|
1393
|
+
ve,
|
|
1394
|
+
we
|
|
1395
|
+
), {
|
|
1396
|
+
theme: t,
|
|
1397
|
+
themeType: r,
|
|
1398
|
+
prefixCls: s,
|
|
1399
|
+
children: i,
|
|
1400
|
+
locale: o,
|
|
1401
|
+
rtl: a,
|
|
1402
|
+
effectGlobalNotice: h = !0,
|
|
1403
|
+
effectGlobalModal: l = !0
|
|
1404
|
+
} = e, c = window.document.body;
|
|
1405
|
+
D(() => {
|
|
1406
|
+
Gt(t) && Object.entries(ye).forEach(([b, f], x, y) => {
|
|
1407
|
+
let $ = t == null ? void 0 : t[b];
|
|
1408
|
+
if ($) {
|
|
1409
|
+
let v = new C($);
|
|
1410
|
+
c.style.setProperty(f.default, v.lighten(0).toRgbArrayString()), t != null && t[`${b}Hover`] || c.style.setProperty(f.hover, v.lighten(10).toRgbArrayString()), t != null && t[`${b}Active`] || c.style.setProperty(f.active, v.lighten(-10).toRgbArrayString());
|
|
1411
|
+
}
|
|
1412
|
+
});
|
|
1413
|
+
}, [t]), D(() => {
|
|
1414
|
+
r && (r === "dark" ? c.setAttribute("pqb-theme", "dark") : c.removeAttribute("pqb-theme"));
|
|
1415
|
+
}, [r]), D(() => {
|
|
1416
|
+
h && (M.config({ prefixCls: s, rtl: a }), T.config({ prefixCls: s, rtl: a }));
|
|
1417
|
+
}, [s, a, h]);
|
|
1418
|
+
function u(b, f) {
|
|
1419
|
+
return `${f || s}-${b}`;
|
|
1420
|
+
}
|
|
1421
|
+
const m = {
|
|
1422
|
+
...Xt(e, ["children"]),
|
|
1423
|
+
getPrefixCls: u
|
|
1424
|
+
};
|
|
1425
|
+
D(() => {
|
|
1426
|
+
l && pe({ locale: o, prefixCls: s, rtl: a });
|
|
1427
|
+
}, [o, s, a, l]);
|
|
1428
|
+
let p = i;
|
|
1429
|
+
return s && s !== "pqb" && (p = /* @__PURE__ */ d(_.Provider, { value: { prefixCls: s }, children: i })), /* @__PURE__ */ d(q.Provider, { value: m, children: p });
|
|
1430
|
+
}
|
|
1431
|
+
K.ConfigContext = q;
|
|
1432
|
+
K.displayName = "ConfigProvider";
|
|
1433
|
+
const Ve = q.Consumer;
|
|
1434
|
+
function It(n, e) {
|
|
1435
|
+
const t = rt(q), [r, s] = Lt([]);
|
|
1436
|
+
function i(h) {
|
|
1437
|
+
s((l) => [...l, h]);
|
|
1438
|
+
}
|
|
1439
|
+
function o(h) {
|
|
1440
|
+
s(
|
|
1441
|
+
(l) => l.filter((c) => h !== c)
|
|
1442
|
+
);
|
|
1443
|
+
}
|
|
1444
|
+
function a() {
|
|
1445
|
+
return t;
|
|
1446
|
+
}
|
|
1447
|
+
return xt(e, () => ({
|
|
1448
|
+
addInstance: i,
|
|
1449
|
+
removeInstance: o,
|
|
1450
|
+
getContextConfig: a
|
|
1451
|
+
})), G.Children.map(
|
|
1452
|
+
r,
|
|
1453
|
+
(h, l) => G.cloneElement(h, { key: l })
|
|
1454
|
+
);
|
|
1455
|
+
}
|
|
1456
|
+
It.displayName = "ContextHolderElement";
|
|
1457
|
+
const Ht = pt(It);
|
|
1458
|
+
export {
|
|
1459
|
+
ot as $,
|
|
1460
|
+
Ht as C,
|
|
1461
|
+
de as E,
|
|
1462
|
+
lt as F,
|
|
1463
|
+
re as G,
|
|
1464
|
+
at as H,
|
|
1465
|
+
ht as I,
|
|
1466
|
+
Le as J,
|
|
1467
|
+
M,
|
|
1468
|
+
kt as N,
|
|
1469
|
+
ee as O,
|
|
1470
|
+
se as T,
|
|
1471
|
+
oe as U,
|
|
1472
|
+
ne as W,
|
|
1473
|
+
K as a,
|
|
1474
|
+
Ve as b,
|
|
1475
|
+
ye as c,
|
|
1476
|
+
q as d,
|
|
1477
|
+
R as e,
|
|
1478
|
+
C as f,
|
|
1479
|
+
T as g,
|
|
1480
|
+
ze as h,
|
|
1481
|
+
De as i,
|
|
1482
|
+
We as j,
|
|
1483
|
+
Be as k,
|
|
1484
|
+
J as l,
|
|
1485
|
+
Ue as s,
|
|
1486
|
+
X as y
|
|
1487
|
+
};
|