@gobolt/genesis 0.0.7 → 0.0.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +8 -2
- package/dist/AntdIcon-c395a1c4.js +204 -0
- package/dist/CheckOutlined-52d9ac25.js +29 -0
- package/dist/{CloseCircleFilled-ZIY-u-27.js → CloseCircleFilled-ddc51e7e.js} +11 -8
- package/dist/CloseOutlined-14b8bba1.js +16 -0
- package/dist/Compact-c39ed20d.js +179 -0
- package/dist/ContextIsolator-b09b2c52.js +20 -0
- package/dist/DownOutlined-64a4732a.js +206 -0
- package/dist/EllipsisOutlined-60122660.js +1115 -0
- package/dist/{ExclamationCircleFilled-BICVVQIg.js → ExclamationCircleFilled-23ef9812.js} +22 -16
- package/dist/InfoCircleFilled-c5f90c20.js +16 -0
- package/dist/Overflow-a570fa69.js +361 -0
- package/dist/RightOutlined-83515eb4.js +16 -0
- package/dist/SearchOutlined-a9014e08.js +16 -0
- package/dist/{TextArea-3MOYYuAQ.js → TextArea-20825221.js} +597 -582
- package/dist/{button-BNV2qdrP.js → button-fa1c119c.js} +287 -280
- package/dist/collapse-345bc884.js +20 -0
- package/dist/compact-item-b8f85aa6.js +75 -0
- package/dist/components/Badge/Badge.d.ts +6 -0
- package/dist/components/Badge/Badge.js +102 -0
- package/dist/components/Badge/__stories__/Badge.stories.d.ts +13 -0
- package/dist/components/Badge/__tests__/Badge.test.js +72 -0
- package/dist/components/Badge/icons/ASN.d.ts +2 -0
- package/dist/components/Badge/icons/ASN.js +23 -0
- package/dist/components/Badge/icons/Appointment.d.ts +2 -0
- package/dist/components/Badge/icons/Appointment.js +23 -0
- package/dist/components/Badge/icons/Inventory.d.ts +2 -0
- package/dist/components/Badge/icons/Inventory.js +23 -0
- package/dist/components/Badge/icons/Parcel.d.ts +2 -0
- package/dist/components/Badge/icons/Parcel.js +23 -0
- package/dist/components/Badge/icons/Product.d.ts +2 -0
- package/dist/components/Badge/icons/Product.js +23 -0
- package/dist/components/Badge/icons/Route.d.ts +2 -0
- package/dist/components/Badge/icons/Route.js +23 -0
- package/dist/components/Badge/icons/Shipment.d.ts +2 -0
- package/dist/components/Badge/icons/Shipment.js +23 -0
- package/dist/components/Badge/icons/ShoppingCart.d.ts +2 -0
- package/dist/components/Badge/icons/ShoppingCart.js +23 -0
- package/dist/components/Badge/icons/System.d.ts +2 -0
- package/dist/components/Badge/icons/System.js +23 -0
- package/dist/components/Badge/index.d.ts +2 -0
- package/dist/components/Badge/index.js +23 -0
- package/dist/components/Badge/styles.d.ts +3 -0
- package/dist/components/Badge/styles.js +35 -0
- package/dist/components/Breadcrumb/Breadcrumb.d.ts +8 -0
- package/dist/components/Breadcrumb/Breadcrumb.js +27 -0
- package/dist/components/Breadcrumb/Breadcrumb.types.d.ts +8 -0
- package/dist/components/Breadcrumb/Breadcrumb.types.js +1 -0
- package/dist/components/Breadcrumb/__stories__/Breadcrumb.stories.d.ts +10 -0
- package/dist/components/Breadcrumb/__tests__/Breadcrumb.test.js +70 -0
- package/dist/components/Breadcrumb/index.d.ts +3 -0
- package/dist/components/Breadcrumb/index.js +27 -0
- package/dist/components/Breadcrumb/styles.d.ts +23 -0
- package/dist/components/Breadcrumb/styles.js +2457 -0
- package/dist/components/Button/Button.js +42 -0
- package/dist/components/Button/__tests__/Button.test.js +61 -0
- package/dist/components/Button/index.js +22 -0
- package/dist/components/{atoms/button → Button}/styles.js +30 -19
- package/dist/components/{atoms/checkbox → Checkbox}/Checkbox.d.ts +2 -1
- package/dist/components/Checkbox/Checkbox.js +70 -0
- package/dist/components/Checkbox/__tests__/Checkbox.test.js +64 -0
- package/dist/components/Checkbox/index.js +49 -0
- package/dist/components/{atoms/checkbox → Checkbox}/styles.d.ts +1 -3
- package/dist/components/{atoms/checkbox → Checkbox}/styles.js +165 -157
- package/dist/components/ErrorBoundaryFallback/ErrorBoundaryFallback.js +72 -0
- package/dist/components/ErrorBoundaryFallback/index.js +51 -0
- package/dist/components/ErrorBoundaryFallback/styles.d.ts +3 -0
- package/dist/components/{molecules/error-boundary-fallback → ErrorBoundaryFallback}/styles.js +38 -34
- package/dist/components/{molecules/form → Form}/Form.d.ts +2 -4
- package/dist/components/Form/Form.js +49 -0
- package/dist/components/Form/__stories__/FormStory.js +130 -0
- package/dist/components/Form/index.js +48 -0
- package/dist/components/{atoms/input → Input}/Input.d.ts +1 -3
- package/dist/components/Input/Input.js +42 -0
- package/dist/components/{atoms/input → Input}/__stories__/Input.stories.d.ts +5 -1
- package/dist/components/Input/__tests__/Input.test.d.ts +1 -0
- package/dist/components/Input/__tests__/Input.test.js +69 -0
- package/dist/components/Input/index.js +31 -0
- package/dist/components/{atoms/input → Input}/styles.d.ts +2 -3
- package/dist/components/Input/styles.js +542 -0
- package/dist/components/Message/Message.d.ts +13 -0
- package/dist/components/Message/Message.js +105 -0
- package/dist/components/Message/__stories__/Message.stories.d.ts +15 -0
- package/dist/components/Message/__tests__/Message.test.d.ts +1 -0
- package/dist/components/Message/__tests__/Message.test.js +88 -0
- package/dist/components/Message/index.d.ts +2 -0
- package/dist/components/Message/index.js +50 -0
- package/dist/components/Message/styles.d.ts +5 -0
- package/dist/components/Message/styles.js +35 -0
- package/dist/components/Notification/Notification.d.ts +16 -0
- package/dist/components/Notification/Notification.js +1436 -0
- package/dist/components/Notification/__stories__/Notification.stories.d.ts +10 -0
- package/dist/components/Notification/__tests__/Notification.test.d.ts +1 -0
- package/dist/components/Notification/__tests__/Notification.test.js +76 -0
- package/dist/components/Notification/index.d.ts +2 -0
- package/dist/components/Notification/index.js +61 -0
- package/dist/components/Notification/styles.d.ts +6 -0
- package/dist/components/Notification/styles.js +49 -0
- package/dist/components/Radio/Radio.d.ts +14 -0
- package/dist/components/Radio/Radio.js +114 -0
- package/dist/components/Radio/RadioGroup.d.ts +12 -0
- package/dist/components/Radio/RadioGroup.js +86 -0
- package/dist/components/Radio/__stories__/RadioGroup.stories.d.ts +9 -0
- package/dist/components/Radio/__tests__/RadioGroup.test.d.ts +1 -0
- package/dist/components/Radio/__tests__/RadioGroup.test.js +85 -0
- package/dist/components/Radio/index.d.ts +2 -0
- package/dist/components/Radio/index.js +58 -0
- package/dist/components/Radio/states/RadioChecked.d.ts +2 -0
- package/dist/components/Radio/states/RadioChecked.js +18 -0
- package/dist/components/Radio/states/RadioCheckedDisabled.d.ts +2 -0
- package/dist/components/Radio/states/RadioCheckedDisabled.js +18 -0
- package/dist/components/Radio/states/RadioCheckedFocussed.d.ts +2 -0
- package/dist/components/Radio/states/RadioCheckedFocussed.js +30 -0
- package/dist/components/Radio/states/RadioCheckedHover.d.ts +2 -0
- package/dist/components/Radio/states/RadioCheckedHover.js +18 -0
- package/dist/components/Radio/states/RadioUnchecked.d.ts +2 -0
- package/dist/components/Radio/states/RadioUnchecked.js +15 -0
- package/dist/components/Radio/states/RadioUncheckedDisabled.d.ts +2 -0
- package/dist/components/Radio/states/RadioUncheckedDisabled.js +15 -0
- package/dist/components/Radio/states/RadioUncheckedFocussed.d.ts +2 -0
- package/dist/components/Radio/states/RadioUncheckedFocussed.js +29 -0
- package/dist/components/Radio/states/RadioUncheckedHover.d.ts +2 -0
- package/dist/components/Radio/states/RadioUncheckedHover.js +18 -0
- package/dist/components/{atoms/select → Select}/Select.d.ts +1 -1
- package/dist/components/Select/Select.js +48 -0
- package/dist/components/{atoms/select → Select}/__stories__/Select.stories.d.ts +3 -1
- package/dist/components/Select/__tests__/Select.test.d.ts +1 -0
- package/dist/components/Select/__tests__/Select.test.js +101 -0
- package/dist/components/Select/index.js +30 -0
- package/dist/components/{atoms/select → Select}/styles.d.ts +4 -1
- package/dist/components/Select/styles.js +3723 -0
- package/dist/components/Toast/Toast.d.ts +14 -0
- package/dist/components/Toast/Toast.js +48 -0
- package/dist/components/Toast/__stories__/Toast.stories.d.ts +15 -0
- package/dist/components/Toast/__tests__/Toast.test.d.ts +1 -0
- package/dist/components/Toast/__tests__/Toast.test.js +63 -0
- package/dist/components/Toast/index.d.ts +2 -0
- package/dist/components/Toast/index.js +48 -0
- package/dist/components/Toast/styles.d.ts +5 -0
- package/dist/components/Toast/styles.js +39 -0
- package/dist/components/{atoms/typography → Typography}/Typography.d.ts +2 -1
- package/dist/components/Typography/Typography.js +48 -0
- package/dist/components/Typography/__tests__/Typography.test.d.ts +1 -0
- package/dist/components/Typography/__tests__/Typography.test.js +60 -0
- package/dist/components/Typography/index.js +48 -0
- package/dist/components/Typography/styles.d.ts +7 -0
- package/dist/components/Typography/styles.js +55 -0
- package/dist/components/index.d.ts +18 -14
- package/dist/components/index.js +70 -14
- package/dist/constants/index.d.ts +104 -0
- package/dist/constants/index.js +41 -7
- package/dist/{context-CZsFJmh6.js → context-3b8a39af.js} +547 -536
- package/dist/genesis/GenesisThemeBreakdown.js +69 -22
- package/dist/genesis/GenesisThemeDemo.d.ts +0 -2
- package/dist/genesis/GenesisThemeDemo.js +53 -4
- package/dist/genesis/styles.d.ts +2 -6
- package/dist/genesis/styles.js +1144 -2210
- package/dist/index-0a886e53.js +100 -0
- package/dist/{index-SAAXFt-P.js → index-0b9ee239.js} +347 -338
- package/dist/index-1a33c134.js +1389 -0
- package/dist/index-4003d75b.js +3748 -0
- package/dist/{index-D1v_7IIx.js → index-501fc13d.js} +369 -343
- package/dist/index-89035ea5.js +3242 -0
- package/dist/{index-BQO27mgE.js → index-8c8d2d0c.js} +123 -122
- package/dist/{index-C7kFNqp2.js → index-e2b72ca8.js} +107 -102
- package/dist/index.d.ts +1 -0
- package/dist/index.js +77 -18
- package/dist/{isVisible-CNQjrJPN.js → isVisible-729780f5.js} +110 -82
- package/dist/{magic-string.es-BkUFmFT4.js → magic-string.es-b7491176.js} +103 -56
- package/dist/{SearchOutlined-DuzJkIiQ.js → pickAttrs-00ba4687.js} +16 -26
- package/dist/presets-83ccb923.js +787 -0
- package/dist/providers/GenesisProvider.d.ts +5 -0
- package/dist/providers/GenesisProvider.js +59 -5
- package/dist/providers/ThemeProvider.d.ts +2 -1
- package/dist/providers/ThemeProvider.js +16 -11
- package/dist/providers/ToastProvider.d.ts +6 -0
- package/dist/providers/ToastProvider.js +49 -0
- package/dist/providers/ToastWrapper.d.ts +7 -0
- package/dist/providers/ToastWrapper.js +56 -0
- package/dist/providers/__stories__/GenesisProvider.stories.d.ts +6 -0
- package/dist/providers/index.d.ts +3 -2
- package/dist/providers/index.js +51 -4
- package/dist/setup-aaca7b6f.js +21158 -0
- package/dist/{styled-components.browser.esm-CZ1XM4o4.js → styled-components.browser.esm-02f500bc.js} +134 -72
- package/dist/styles/design-tokens/border-tokens/BorderTokenList.js +54 -18
- package/dist/styles/design-tokens/sizing-tokens/SizingTokenList.js +51 -15
- package/dist/styles/design-tokens/variables.d.ts +7 -7
- package/dist/styles/design-tokens/variables.js +48 -48
- package/dist/styles/global-styles.js +4 -3
- package/dist/styles/theme/genesis-theme.d.ts +3 -0
- package/dist/styles/theme/genesis-theme.js +402 -263
- package/dist/styles/theme/global-styles.js +4 -3
- package/dist/styles/theme/index.js +5 -4
- package/dist/test/setup.js +46 -2
- package/dist/useVariants-a0d64298.js +30 -0
- package/dist/utils/isAllEnglishString.js +2 -1
- package/package.json +34 -28
- package/dist/AntdIcon-Bsnbyy6g.js +0 -200
- package/dist/CheckOutlined-DAynWe12.js +0 -527
- package/dist/Compact-CJBo3f0u.js +0 -185
- package/dist/ContextIsolator-CGkdKtc3.js +0 -20
- package/dist/Form-Cylpi4M4.js +0 -1815
- package/dist/Overflow-CP1M4Z0s.js +0 -369
- package/dist/compact-item-DH13cl8A.js +0 -61
- package/dist/components/atoms/button/Button.js +0 -27
- package/dist/components/atoms/button/index.js +0 -4
- package/dist/components/atoms/checkbox/Checkbox.js +0 -13
- package/dist/components/atoms/checkbox/__tests__/Checkbox.test.js +0 -18
- package/dist/components/atoms/checkbox/index.js +0 -4
- package/dist/components/atoms/index.d.ts +0 -1
- package/dist/components/atoms/index.js +0 -3
- package/dist/components/atoms/input/Input.js +0 -12
- package/dist/components/atoms/input/__tests__/Input.test.js +0 -28
- package/dist/components/atoms/input/index.js +0 -4
- package/dist/components/atoms/input/styles.js +0 -415
- package/dist/components/atoms/select/Select.js +0 -24
- package/dist/components/atoms/select/__tests__/Select.test.js +0 -10735
- package/dist/components/atoms/select/index.js +0 -4
- package/dist/components/atoms/select/styles.js +0 -3868
- package/dist/components/atoms/typography/Typography.js +0 -44
- package/dist/components/atoms/typography/__tests__/Typography.test.js +0 -16
- package/dist/components/atoms/typography/index.js +0 -4
- package/dist/components/atoms/typography/styles.d.ts +0 -11
- package/dist/components/atoms/typography/styles.js +0 -28
- package/dist/components/molecules/error-boundary-fallback/ErrorBoundaryFallback.js +0 -35
- package/dist/components/molecules/error-boundary-fallback/index.js +0 -4
- package/dist/components/molecules/error-boundary-fallback/styles.d.ts +0 -1
- package/dist/components/molecules/form/Form.js +0 -7
- package/dist/components/molecules/form/__stories__/FormStory.js +0 -90
- package/dist/components/molecules/form/index.js +0 -4
- package/dist/index-3MWkSVA1.js +0 -96
- package/dist/index-BPtFqhcp.js +0 -19110
- package/dist/index-BWys7dkb.js +0 -4462
- package/dist/index-VDH3iLaC.js +0 -884
- package/dist/setup-CMYVZCPF.js +0 -33883
- package/dist/useVariants-CEpw6Ww6.js +0 -29
- /package/dist/components/{atoms/checkbox/__tests__/Checkbox.test.d.ts → Badge/__tests__/Badge.test.d.ts} +0 -0
- /package/dist/components/{atoms/input/__tests__/Input.test.d.ts → Breadcrumb/__tests__/Breadcrumb.test.d.ts} +0 -0
- /package/dist/components/{atoms/button → Button}/Button.d.ts +0 -0
- /package/dist/components/{atoms/button → Button}/__stories__/Button.stories.d.ts +0 -0
- /package/dist/components/{atoms/select/__tests__/Select.test.d.ts → Button/__tests__/Button.test.d.ts} +0 -0
- /package/dist/components/{atoms/button → Button}/index.d.ts +0 -0
- /package/dist/components/{atoms/button → Button}/styles.d.ts +0 -0
- /package/dist/components/{atoms/checkbox → Checkbox}/__stories__/Checkbox.stories.d.ts +0 -0
- /package/dist/components/{atoms/typography/__tests__/Typography.test.d.ts → Checkbox/__tests__/Checkbox.test.d.ts} +0 -0
- /package/dist/components/{atoms/checkbox → Checkbox}/index.d.ts +0 -0
- /package/dist/components/{molecules/error-boundary-fallback → ErrorBoundaryFallback}/ErrorBoundaryFallback.d.ts +0 -0
- /package/dist/components/{molecules/error-boundary-fallback → ErrorBoundaryFallback}/__stories__/ErrorBoundaryFallback.stories.d.ts +0 -0
- /package/dist/components/{molecules/error-boundary-fallback → ErrorBoundaryFallback}/index.d.ts +0 -0
- /package/dist/components/{molecules/form → Form}/__stories__/Form.stories.d.ts +0 -0
- /package/dist/components/{molecules/form → Form}/__stories__/FormStory.d.ts +0 -0
- /package/dist/components/{molecules/form → Form}/index.d.ts +0 -0
- /package/dist/components/{atoms/input → Input}/index.d.ts +0 -0
- /package/dist/components/{atoms/select → Select}/index.d.ts +0 -0
- /package/dist/components/{atoms/typography → Typography}/__stories__/Typography.stories.d.ts +0 -0
- /package/dist/components/{atoms/typography → Typography}/index.d.ts +0 -0
- /package/dist/{presetColors-Cl8UP3Nw.js → presetColors-ccf8cb4c.js} +0 -0
- /package/dist/{reactNode-sKPeiqPL.js → reactNode-f4391605.js} +0 -0
|
@@ -1,28 +1,31 @@
|
|
|
1
1
|
import * as K from "react";
|
|
2
|
-
import s, { forwardRef as oe, useState as
|
|
3
|
-
import {
|
|
4
|
-
import { u as
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
|
|
2
|
+
import s, { forwardRef as oe, useState as $e, useRef as I, useEffect as k, useMemo as ee, useContext as he, Children as pr } from "react";
|
|
3
|
+
import { c as N, e as Ue, _ as w, F as Je, d as yr, f as q, h as Ee, a as be } from "./presets-83ccb923.js";
|
|
4
|
+
import { u as Sr, o as xr } from "./isVisible-729780f5.js";
|
|
5
|
+
import { C as Qe, B as $r, t as Ze, v as Er, A as Br, _ as Hr, e as Or, f as Ke, h as ke, b as er, m as ne, F as pe, g as Rr, p as te, G as Nr, H as Pr, I as Ir, D as jr, k as wr } from "./index-4003d75b.js";
|
|
6
|
+
import { W as Dr } from "./index-e2b72ca8.js";
|
|
7
|
+
import { b as Tr, a as Lr } from "./Compact-c39ed20d.js";
|
|
8
|
+
import { c as zr, i as Ar } from "./reactNode-f4391605.js";
|
|
9
|
+
import { P as rr } from "./presetColors-ccf8cb4c.js";
|
|
10
|
+
import { L as _r, g as Mr } from "./compact-item-b8f85aa6.js";
|
|
11
|
+
var Gr = globalThis && globalThis.__rest || function(e, r) {
|
|
11
12
|
var t = {};
|
|
12
|
-
for (var o in e)
|
|
13
|
-
|
|
14
|
-
|
|
13
|
+
for (var o in e)
|
|
14
|
+
Object.prototype.hasOwnProperty.call(e, o) && r.indexOf(o) < 0 && (t[o] = e[o]);
|
|
15
|
+
if (e != null && typeof Object.getOwnPropertySymbols == "function")
|
|
16
|
+
for (var n = 0, o = Object.getOwnPropertySymbols(e); n < o.length; n++)
|
|
17
|
+
r.indexOf(o[n]) < 0 && Object.prototype.propertyIsEnumerable.call(e, o[n]) && (t[o[n]] = e[o[n]]);
|
|
15
18
|
return t;
|
|
16
19
|
};
|
|
17
20
|
const tr = /* @__PURE__ */ K.createContext(void 0), Fr = (e) => {
|
|
18
21
|
const {
|
|
19
22
|
getPrefixCls: r,
|
|
20
23
|
direction: t
|
|
21
|
-
} = K.useContext(
|
|
24
|
+
} = K.useContext(Qe), {
|
|
22
25
|
prefixCls: o,
|
|
23
26
|
size: n,
|
|
24
27
|
className: a
|
|
25
|
-
} = e, l = Gr(e, ["prefixCls", "size", "className"]), i = r("btn-group", o), [, , c] =
|
|
28
|
+
} = e, l = Gr(e, ["prefixCls", "size", "className"]), i = r("btn-group", o), [, , c] = $r();
|
|
26
29
|
let u = "";
|
|
27
30
|
switch (n) {
|
|
28
31
|
case "large":
|
|
@@ -33,7 +36,7 @@ const tr = /* @__PURE__ */ K.createContext(void 0), Fr = (e) => {
|
|
|
33
36
|
break;
|
|
34
37
|
}
|
|
35
38
|
if (process.env.NODE_ENV !== "production") {
|
|
36
|
-
const g =
|
|
39
|
+
const g = Ze("Button.Group");
|
|
37
40
|
process.env.NODE_ENV !== "production" && g(!n || ["large", "small", "middle"].includes(n), "usage", "Invalid prop `size`.");
|
|
38
41
|
}
|
|
39
42
|
const d = N(i, {
|
|
@@ -45,22 +48,22 @@ const tr = /* @__PURE__ */ K.createContext(void 0), Fr = (e) => {
|
|
|
45
48
|
}, /* @__PURE__ */ K.createElement("div", Object.assign({}, l, {
|
|
46
49
|
className: d
|
|
47
50
|
})));
|
|
48
|
-
}, We = /^[\u4E00-\u9FA5]{2}$/,
|
|
49
|
-
function
|
|
51
|
+
}, Vr = Fr, We = /^[\u4E00-\u9FA5]{2}$/, Be = We.test.bind(We);
|
|
52
|
+
function Xe(e) {
|
|
50
53
|
return typeof e == "string";
|
|
51
54
|
}
|
|
52
55
|
function re(e) {
|
|
53
56
|
return e === "text" || e === "link";
|
|
54
57
|
}
|
|
55
|
-
function
|
|
58
|
+
function Wr(e, r) {
|
|
56
59
|
if (e == null)
|
|
57
60
|
return;
|
|
58
61
|
const t = r ? " " : "";
|
|
59
|
-
return typeof e != "string" && typeof e != "number" &&
|
|
62
|
+
return typeof e != "string" && typeof e != "number" && Xe(e.type) && Be(e.props.children) ? zr(e, {
|
|
60
63
|
children: e.props.children.split("").join(t)
|
|
61
|
-
}) :
|
|
64
|
+
}) : Xe(e) ? Be(e) ? /* @__PURE__ */ s.createElement("span", null, e.split("").join(t)) : /* @__PURE__ */ s.createElement("span", null, e) : Ar(e) ? /* @__PURE__ */ s.createElement("span", null, e) : e;
|
|
62
65
|
}
|
|
63
|
-
function
|
|
66
|
+
function Xr(e, r) {
|
|
64
67
|
let t = !1;
|
|
65
68
|
const o = [];
|
|
66
69
|
return s.Children.forEach(e, (n) => {
|
|
@@ -71,10 +74,10 @@ function Wr(e, r) {
|
|
|
71
74
|
} else
|
|
72
75
|
o.push(n);
|
|
73
76
|
t = l;
|
|
74
|
-
}), s.Children.map(o, (n) =>
|
|
77
|
+
}), s.Children.map(o, (n) => Wr(n, r));
|
|
75
78
|
}
|
|
76
|
-
["default", "primary", "danger"].concat(
|
|
77
|
-
const
|
|
79
|
+
["default", "primary", "danger"].concat(Er(rr));
|
|
80
|
+
const qr = /* @__PURE__ */ oe((e, r) => {
|
|
78
81
|
const {
|
|
79
82
|
className: t,
|
|
80
83
|
style: o,
|
|
@@ -86,30 +89,30 @@ const Be = /* @__PURE__ */ oe((e, r) => {
|
|
|
86
89
|
className: l,
|
|
87
90
|
style: o
|
|
88
91
|
}, n);
|
|
89
|
-
}),
|
|
92
|
+
}), He = qr, qe = /* @__PURE__ */ oe((e, r) => {
|
|
90
93
|
const {
|
|
91
94
|
prefixCls: t,
|
|
92
95
|
className: o,
|
|
93
96
|
style: n,
|
|
94
97
|
iconClassName: a
|
|
95
98
|
} = e, l = N(`${t}-loading-icon`, o);
|
|
96
|
-
return /* @__PURE__ */ s.createElement(
|
|
99
|
+
return /* @__PURE__ */ s.createElement(He, {
|
|
97
100
|
prefixCls: t,
|
|
98
101
|
className: l,
|
|
99
102
|
style: n,
|
|
100
103
|
ref: r
|
|
101
|
-
}, /* @__PURE__ */ s.createElement(
|
|
104
|
+
}, /* @__PURE__ */ s.createElement(_r, {
|
|
102
105
|
className: a
|
|
103
106
|
}));
|
|
104
|
-
}),
|
|
107
|
+
}), ye = () => ({
|
|
105
108
|
width: 0,
|
|
106
109
|
opacity: 0,
|
|
107
110
|
transform: "scale(0)"
|
|
108
|
-
}),
|
|
111
|
+
}), Se = (e) => ({
|
|
109
112
|
width: e.scrollWidth,
|
|
110
113
|
opacity: 1,
|
|
111
114
|
transform: "scale(1)"
|
|
112
|
-
}),
|
|
115
|
+
}), Yr = (e) => {
|
|
113
116
|
const {
|
|
114
117
|
prefixCls: r,
|
|
115
118
|
loading: t,
|
|
@@ -118,11 +121,11 @@ const Be = /* @__PURE__ */ oe((e, r) => {
|
|
|
118
121
|
style: a,
|
|
119
122
|
mount: l
|
|
120
123
|
} = e, i = !!t;
|
|
121
|
-
return o ? /* @__PURE__ */ s.createElement(
|
|
124
|
+
return o ? /* @__PURE__ */ s.createElement(qe, {
|
|
122
125
|
prefixCls: r,
|
|
123
126
|
className: n,
|
|
124
127
|
style: a
|
|
125
|
-
}) : /* @__PURE__ */ s.createElement(
|
|
128
|
+
}) : /* @__PURE__ */ s.createElement(Br, {
|
|
126
129
|
visible: i,
|
|
127
130
|
// Used for minus flex gap style only
|
|
128
131
|
motionName: `${r}-loading-icon-motion`,
|
|
@@ -130,26 +133,26 @@ const Be = /* @__PURE__ */ oe((e, r) => {
|
|
|
130
133
|
motionEnter: !l,
|
|
131
134
|
motionLeave: !l,
|
|
132
135
|
removeOnLeave: !0,
|
|
133
|
-
onAppearStart:
|
|
134
|
-
onAppearActive:
|
|
135
|
-
onEnterStart:
|
|
136
|
-
onEnterActive:
|
|
137
|
-
onLeaveStart:
|
|
138
|
-
onLeaveActive:
|
|
136
|
+
onAppearStart: ye,
|
|
137
|
+
onAppearActive: Se,
|
|
138
|
+
onEnterStart: ye,
|
|
139
|
+
onEnterActive: Se,
|
|
140
|
+
onLeaveStart: Se,
|
|
141
|
+
onLeaveActive: ye
|
|
139
142
|
}, (c, u) => {
|
|
140
143
|
let {
|
|
141
144
|
className: d,
|
|
142
145
|
style: g
|
|
143
146
|
} = c;
|
|
144
147
|
const h = Object.assign(Object.assign({}, a), g);
|
|
145
|
-
return /* @__PURE__ */ s.createElement(
|
|
148
|
+
return /* @__PURE__ */ s.createElement(qe, {
|
|
146
149
|
prefixCls: r,
|
|
147
150
|
className: N(n, d),
|
|
148
151
|
style: h,
|
|
149
152
|
ref: u
|
|
150
153
|
});
|
|
151
154
|
});
|
|
152
|
-
}, Ye = (e, r) => ({
|
|
155
|
+
}, Ur = Yr, Ye = (e, r) => ({
|
|
153
156
|
// Border
|
|
154
157
|
[`> span, > ${e}`]: {
|
|
155
158
|
"&:not(:last-child)": {
|
|
@@ -167,7 +170,7 @@ const Be = /* @__PURE__ */ oe((e, r) => {
|
|
|
167
170
|
}
|
|
168
171
|
}
|
|
169
172
|
}
|
|
170
|
-
}),
|
|
173
|
+
}), Jr = (e) => {
|
|
171
174
|
const {
|
|
172
175
|
componentCls: r,
|
|
173
176
|
fontSize: t,
|
|
@@ -215,60 +218,60 @@ const Be = /* @__PURE__ */ oe((e, r) => {
|
|
|
215
218
|
Ye(`${r}-danger`, a)
|
|
216
219
|
]
|
|
217
220
|
};
|
|
218
|
-
};
|
|
219
|
-
var
|
|
221
|
+
}, Qr = Jr;
|
|
222
|
+
var Zr = ["b"], Kr = ["v"], xe = function(r) {
|
|
220
223
|
return Math.round(Number(r || 0));
|
|
221
|
-
},
|
|
222
|
-
if (r instanceof
|
|
224
|
+
}, kr = function(r) {
|
|
225
|
+
if (r instanceof Je)
|
|
223
226
|
return r;
|
|
224
|
-
if (r &&
|
|
225
|
-
var t = r, o = t.b, n =
|
|
226
|
-
return
|
|
227
|
+
if (r && yr(r) === "object" && "h" in r && "b" in r) {
|
|
228
|
+
var t = r, o = t.b, n = Ue(t, Zr);
|
|
229
|
+
return w(w({}, n), {}, {
|
|
227
230
|
v: o
|
|
228
231
|
});
|
|
229
232
|
}
|
|
230
233
|
return typeof r == "string" && /hsb/.test(r) ? r.replace(/hsb/, "hsv") : r;
|
|
231
234
|
}, D = /* @__PURE__ */ function(e) {
|
|
232
|
-
|
|
233
|
-
var r =
|
|
235
|
+
Hr(t, e);
|
|
236
|
+
var r = Or(t);
|
|
234
237
|
function t(o) {
|
|
235
|
-
return
|
|
238
|
+
return Ke(this, t), r.call(this, kr(o));
|
|
236
239
|
}
|
|
237
|
-
return
|
|
240
|
+
return ke(t, [{
|
|
238
241
|
key: "toHsbString",
|
|
239
242
|
value: function() {
|
|
240
|
-
var n = this.toHsb(), a =
|
|
243
|
+
var n = this.toHsb(), a = xe(n.s * 100), l = xe(n.b * 100), i = xe(n.h), c = n.a, u = "hsb(".concat(i, ", ").concat(a, "%, ").concat(l, "%)"), d = "hsba(".concat(i, ", ").concat(a, "%, ").concat(l, "%, ").concat(c.toFixed(c === 0 ? 0 : 2), ")");
|
|
241
244
|
return c === 1 ? u : d;
|
|
242
245
|
}
|
|
243
246
|
}, {
|
|
244
247
|
key: "toHsb",
|
|
245
248
|
value: function() {
|
|
246
|
-
var n = this.toHsv(), a = n.v, l =
|
|
247
|
-
return
|
|
249
|
+
var n = this.toHsv(), a = n.v, l = Ue(n, Kr);
|
|
250
|
+
return w(w({}, l), {}, {
|
|
248
251
|
b: a,
|
|
249
252
|
a: this.a
|
|
250
253
|
});
|
|
251
254
|
}
|
|
252
255
|
}]), t;
|
|
253
|
-
}(
|
|
256
|
+
}(Je), et = "rc-color-picker", X = function(r) {
|
|
254
257
|
return r instanceof D ? r : new D(r);
|
|
255
|
-
},
|
|
256
|
-
var t = r.offset, o = r.targetRef, n = r.containerRef, a = r.color, l = r.type, i = n.current.getBoundingClientRect(), c = i.width, u = i.height, d = o.current.getBoundingClientRect(), g = d.width, h = d.height,
|
|
258
|
+
}, rt = X("#1677ff"), or = function(r) {
|
|
259
|
+
var t = r.offset, o = r.targetRef, n = r.containerRef, a = r.color, l = r.type, i = n.current.getBoundingClientRect(), c = i.width, u = i.height, d = o.current.getBoundingClientRect(), g = d.width, h = d.height, f = g / 2, v = h / 2, y = (t.x + f) / c, E = 1 - (t.y + v) / u, H = a.toHsb(), B = y, S = (t.x + f) / c * 360;
|
|
257
260
|
if (l)
|
|
258
261
|
switch (l) {
|
|
259
262
|
case "hue":
|
|
260
|
-
return
|
|
263
|
+
return X(w(w({}, H), {}, {
|
|
261
264
|
h: S <= 0 ? 0 : S
|
|
262
265
|
}));
|
|
263
266
|
case "alpha":
|
|
264
|
-
return
|
|
267
|
+
return X(w(w({}, H), {}, {
|
|
265
268
|
a: B <= 0 ? 0 : B
|
|
266
269
|
}));
|
|
267
270
|
}
|
|
268
|
-
return
|
|
271
|
+
return X({
|
|
269
272
|
h: H.h,
|
|
270
273
|
s: y <= 0 ? 0 : y,
|
|
271
|
-
b:
|
|
274
|
+
b: E >= 1 ? 1 : E,
|
|
272
275
|
a: H.a
|
|
273
276
|
});
|
|
274
277
|
}, nr = function(r, t) {
|
|
@@ -290,7 +293,7 @@ var Yr = ["b"], Ur = ["v"], Se = function(r) {
|
|
|
290
293
|
y: (1 - o.b) * 100
|
|
291
294
|
};
|
|
292
295
|
}
|
|
293
|
-
},
|
|
296
|
+
}, tt = function(r) {
|
|
294
297
|
var t = r.color, o = r.prefixCls, n = r.className, a = r.style, l = r.onClick, i = "".concat(o, "-color-block");
|
|
295
298
|
return /* @__PURE__ */ s.createElement("div", {
|
|
296
299
|
className: N(i, n),
|
|
@@ -303,7 +306,7 @@ var Yr = ["b"], Ur = ["v"], Se = function(r) {
|
|
|
303
306
|
}
|
|
304
307
|
}));
|
|
305
308
|
};
|
|
306
|
-
function
|
|
309
|
+
function ot(e) {
|
|
307
310
|
var r = "touches" in e ? e.touches[0] : e, t = document.documentElement.scrollLeft || document.body.scrollLeft || window.pageXOffset, o = document.documentElement.scrollTop || document.body.scrollTop || window.pageYOffset;
|
|
308
311
|
return {
|
|
309
312
|
pageX: r.pageX - t,
|
|
@@ -311,31 +314,31 @@ function kr(e) {
|
|
|
311
314
|
};
|
|
312
315
|
}
|
|
313
316
|
function ar(e) {
|
|
314
|
-
var r = e.targetRef, t = e.containerRef, o = e.direction, n = e.onDragChange, a = e.onDragChangeComplete, l = e.calculate, i = e.color, c = e.disabledDrag, u =
|
|
317
|
+
var r = e.targetRef, t = e.containerRef, o = e.direction, n = e.onDragChange, a = e.onDragChangeComplete, l = e.calculate, i = e.color, c = e.disabledDrag, u = $e({
|
|
315
318
|
x: 0,
|
|
316
319
|
y: 0
|
|
317
|
-
}), d =
|
|
320
|
+
}), d = q(u, 2), g = d[0], h = d[1], f = I(null), v = I(null);
|
|
318
321
|
k(function() {
|
|
319
322
|
h(l());
|
|
320
323
|
}, [i]), k(function() {
|
|
321
324
|
return function() {
|
|
322
|
-
document.removeEventListener("mousemove",
|
|
325
|
+
document.removeEventListener("mousemove", f.current), document.removeEventListener("mouseup", v.current), document.removeEventListener("touchmove", f.current), document.removeEventListener("touchend", v.current), f.current = null, v.current = null;
|
|
323
326
|
};
|
|
324
327
|
}, []);
|
|
325
|
-
var y = function(
|
|
326
|
-
var
|
|
328
|
+
var y = function(m) {
|
|
329
|
+
var C = ot(m), Y = C.pageX, U = C.pageY, O = t.current.getBoundingClientRect(), G = O.x, T = O.y, J = O.width, F = O.height, L = r.current.getBoundingClientRect(), z = L.width, R = L.height, V = z / 2, M = R / 2, P = Math.max(0, Math.min(Y - G, J)) - V, b = Math.max(0, Math.min(U - T, F)) - M, x = {
|
|
327
330
|
x: P,
|
|
328
|
-
y: o === "x" ? g.y :
|
|
331
|
+
y: o === "x" ? g.y : b
|
|
329
332
|
};
|
|
330
|
-
if (
|
|
333
|
+
if (z === 0 && R === 0 || z !== R)
|
|
331
334
|
return !1;
|
|
332
335
|
n == null || n(x);
|
|
333
|
-
},
|
|
334
|
-
|
|
335
|
-
}, H = function(
|
|
336
|
-
|
|
337
|
-
}, B = function(
|
|
338
|
-
document.removeEventListener("mousemove",
|
|
336
|
+
}, E = function(m) {
|
|
337
|
+
m.preventDefault(), y(m);
|
|
338
|
+
}, H = function(m) {
|
|
339
|
+
m.preventDefault(), document.removeEventListener("mousemove", f.current), document.removeEventListener("mouseup", v.current), document.removeEventListener("touchmove", f.current), document.removeEventListener("touchend", v.current), f.current = null, v.current = null, a == null || a();
|
|
340
|
+
}, B = function(m) {
|
|
341
|
+
document.removeEventListener("mousemove", f.current), document.removeEventListener("mouseup", v.current), !c && (y(m), document.addEventListener("mousemove", E), document.addEventListener("mouseup", H), document.addEventListener("touchmove", E), document.addEventListener("touchend", H), f.current = E, v.current = H);
|
|
339
342
|
};
|
|
340
343
|
return [g, B];
|
|
341
344
|
}
|
|
@@ -351,7 +354,7 @@ var lr = function(r) {
|
|
|
351
354
|
var t = r.children, o = r.style, n = r.prefixCls;
|
|
352
355
|
return /* @__PURE__ */ s.createElement("div", {
|
|
353
356
|
className: "".concat(n, "-palette"),
|
|
354
|
-
style:
|
|
357
|
+
style: w({
|
|
355
358
|
position: "relative"
|
|
356
359
|
}, o)
|
|
357
360
|
}, t);
|
|
@@ -367,15 +370,15 @@ var lr = function(r) {
|
|
|
367
370
|
transform: "translate(-50%, -50%)"
|
|
368
371
|
}
|
|
369
372
|
}, t);
|
|
370
|
-
}),
|
|
371
|
-
var t = r.color, o = r.onChange, n = r.prefixCls, a = r.onChangeComplete, l = r.disabled, i =
|
|
372
|
-
var
|
|
373
|
+
}), nt = function(r) {
|
|
374
|
+
var t = r.color, o = r.onChange, n = r.prefixCls, a = r.onChangeComplete, l = r.disabled, i = I(), c = I(), u = I(t), d = er(function(y) {
|
|
375
|
+
var E = or({
|
|
373
376
|
offset: y,
|
|
374
377
|
targetRef: c,
|
|
375
378
|
containerRef: i,
|
|
376
379
|
color: t
|
|
377
380
|
});
|
|
378
|
-
u.current =
|
|
381
|
+
u.current = E, o(E);
|
|
379
382
|
}), g = ar({
|
|
380
383
|
color: t,
|
|
381
384
|
containerRef: i,
|
|
@@ -388,17 +391,17 @@ var lr = function(r) {
|
|
|
388
391
|
return a == null ? void 0 : a(u.current);
|
|
389
392
|
},
|
|
390
393
|
disabledDrag: l
|
|
391
|
-
}), h =
|
|
394
|
+
}), h = q(g, 2), f = h[0], v = h[1];
|
|
392
395
|
return /* @__PURE__ */ s.createElement("div", {
|
|
393
396
|
ref: i,
|
|
394
397
|
className: "".concat(n, "-select"),
|
|
395
|
-
onMouseDown:
|
|
396
|
-
onTouchStart:
|
|
398
|
+
onMouseDown: v,
|
|
399
|
+
onTouchStart: v
|
|
397
400
|
}, /* @__PURE__ */ s.createElement(ir, {
|
|
398
401
|
prefixCls: n
|
|
399
402
|
}, /* @__PURE__ */ s.createElement(cr, {
|
|
400
|
-
x:
|
|
401
|
-
y:
|
|
403
|
+
x: f.x,
|
|
404
|
+
y: f.y,
|
|
402
405
|
ref: c
|
|
403
406
|
}, /* @__PURE__ */ s.createElement(lr, {
|
|
404
407
|
color: t.toRgbString(),
|
|
@@ -410,17 +413,17 @@ var lr = function(r) {
|
|
|
410
413
|
backgroundImage: "linear-gradient(0deg, #000, transparent),linear-gradient(90deg, #fff, hsla(0, 0%, 100%, 0))"
|
|
411
414
|
}
|
|
412
415
|
})));
|
|
413
|
-
},
|
|
414
|
-
var o =
|
|
416
|
+
}, at = function(r, t) {
|
|
417
|
+
var o = Sr(r, {
|
|
415
418
|
value: t
|
|
416
|
-
}), n =
|
|
417
|
-
return
|
|
419
|
+
}), n = q(o, 2), a = n[0], l = n[1], i = ee(function() {
|
|
420
|
+
return X(a);
|
|
418
421
|
}, [a]);
|
|
419
422
|
return [i, l];
|
|
420
|
-
},
|
|
423
|
+
}, lt = function(r) {
|
|
421
424
|
var t = r.colors, o = r.children, n = r.direction, a = n === void 0 ? "to right" : n, l = r.type, i = r.prefixCls, c = ee(function() {
|
|
422
425
|
return t.map(function(u, d) {
|
|
423
|
-
var g =
|
|
426
|
+
var g = X(u);
|
|
424
427
|
return l === "alpha" && d === t.length - 1 && (g = new D(g.setA(1))), g.toRgbString();
|
|
425
428
|
}).join(",");
|
|
426
429
|
}, [t, l]);
|
|
@@ -432,42 +435,42 @@ var lr = function(r) {
|
|
|
432
435
|
background: "linear-gradient(".concat(a, ", ").concat(c, ")")
|
|
433
436
|
}
|
|
434
437
|
}, o);
|
|
435
|
-
},
|
|
436
|
-
var t = r.prefixCls, o = r.colors, n = r.disabled, a = r.onChange, l = r.onChangeComplete, i = r.color, c = r.type, u =
|
|
437
|
-
return c === "hue" ?
|
|
438
|
-
},
|
|
439
|
-
var
|
|
440
|
-
offset:
|
|
438
|
+
}, it = function(r) {
|
|
439
|
+
var t = r.prefixCls, o = r.colors, n = r.disabled, a = r.onChange, l = r.onChangeComplete, i = r.color, c = r.type, u = I(), d = I(), g = I(i), h = function(C) {
|
|
440
|
+
return c === "hue" ? C.getHue() : C.a * 100;
|
|
441
|
+
}, f = er(function(m) {
|
|
442
|
+
var C = or({
|
|
443
|
+
offset: m,
|
|
441
444
|
targetRef: d,
|
|
442
445
|
containerRef: u,
|
|
443
446
|
color: i,
|
|
444
447
|
type: c
|
|
445
448
|
});
|
|
446
|
-
g.current =
|
|
447
|
-
}),
|
|
449
|
+
g.current = C, a(h(C));
|
|
450
|
+
}), v = ar({
|
|
448
451
|
color: i,
|
|
449
452
|
targetRef: d,
|
|
450
453
|
containerRef: u,
|
|
451
454
|
calculate: function() {
|
|
452
455
|
return nr(i, c);
|
|
453
456
|
},
|
|
454
|
-
onDragChange:
|
|
457
|
+
onDragChange: f,
|
|
455
458
|
onDragChangeComplete: function() {
|
|
456
459
|
l(h(g.current));
|
|
457
460
|
},
|
|
458
461
|
direction: "x",
|
|
459
462
|
disabledDrag: n
|
|
460
|
-
}), y =
|
|
463
|
+
}), y = q(v, 2), E = y[0], H = y[1], B = s.useMemo(function() {
|
|
461
464
|
if (c === "hue") {
|
|
462
|
-
var
|
|
463
|
-
|
|
464
|
-
var
|
|
465
|
-
return
|
|
465
|
+
var m = i.toHsb();
|
|
466
|
+
m.s = 1, m.b = 1, m.a = 1;
|
|
467
|
+
var C = new D(m);
|
|
468
|
+
return C;
|
|
466
469
|
}
|
|
467
470
|
return i;
|
|
468
471
|
}, [i, c]), S = s.useMemo(function() {
|
|
469
|
-
return o.map(function(
|
|
470
|
-
return "".concat(
|
|
472
|
+
return o.map(function(m) {
|
|
473
|
+
return "".concat(m.color, " ").concat(m.percent, "%");
|
|
471
474
|
});
|
|
472
475
|
}, [o]);
|
|
473
476
|
return /* @__PURE__ */ s.createElement("div", {
|
|
@@ -478,26 +481,26 @@ var lr = function(r) {
|
|
|
478
481
|
}, /* @__PURE__ */ s.createElement(ir, {
|
|
479
482
|
prefixCls: t
|
|
480
483
|
}, /* @__PURE__ */ s.createElement(cr, {
|
|
481
|
-
x:
|
|
482
|
-
y:
|
|
484
|
+
x: E.x,
|
|
485
|
+
y: E.y,
|
|
483
486
|
ref: d
|
|
484
487
|
}, /* @__PURE__ */ s.createElement(lr, {
|
|
485
488
|
size: "small",
|
|
486
489
|
color: B.toHexString(),
|
|
487
490
|
prefixCls: t
|
|
488
|
-
})), /* @__PURE__ */ s.createElement(
|
|
491
|
+
})), /* @__PURE__ */ s.createElement(lt, {
|
|
489
492
|
colors: S,
|
|
490
493
|
type: c,
|
|
491
494
|
prefixCls: t
|
|
492
495
|
})));
|
|
493
496
|
};
|
|
494
|
-
function
|
|
497
|
+
function ct(e) {
|
|
495
498
|
return K.useMemo(function() {
|
|
496
499
|
var r = e || {}, t = r.slider;
|
|
497
|
-
return [t ||
|
|
500
|
+
return [t || it];
|
|
498
501
|
}, [e]);
|
|
499
502
|
}
|
|
500
|
-
var
|
|
503
|
+
var st = [{
|
|
501
504
|
color: "rgb(255, 0, 0)",
|
|
502
505
|
percent: 0
|
|
503
506
|
}, {
|
|
@@ -518,34 +521,34 @@ var at = [{
|
|
|
518
521
|
}, {
|
|
519
522
|
color: "rgb(255, 0, 0)",
|
|
520
523
|
percent: 100
|
|
521
|
-
}],
|
|
522
|
-
var t = e.value, o = e.defaultValue, n = e.prefixCls, a = n === void 0 ?
|
|
523
|
-
return
|
|
524
|
-
}, [
|
|
525
|
-
t || Y(
|
|
526
|
-
}, G = function(
|
|
527
|
-
return new D(
|
|
528
|
-
}, T = function(
|
|
529
|
-
return new D(
|
|
530
|
-
},
|
|
531
|
-
O(G(
|
|
524
|
+
}], ut = /* @__PURE__ */ oe(function(e, r) {
|
|
525
|
+
var t = e.value, o = e.defaultValue, n = e.prefixCls, a = n === void 0 ? et : n, l = e.onChange, i = e.onChangeComplete, c = e.className, u = e.style, d = e.panelRender, g = e.disabledAlpha, h = g === void 0 ? !1 : g, f = e.disabled, v = f === void 0 ? !1 : f, y = e.components, E = ct(y), H = q(E, 1), B = H[0], S = at(o || rt, t), m = q(S, 2), C = m[0], Y = m[1], U = ee(function() {
|
|
526
|
+
return C.setA(1).toRgbString();
|
|
527
|
+
}, [C]), O = function(b, x) {
|
|
528
|
+
t || Y(b), l == null || l(b, x);
|
|
529
|
+
}, G = function(b) {
|
|
530
|
+
return new D(C.setHue(b));
|
|
531
|
+
}, T = function(b) {
|
|
532
|
+
return new D(C.setA(b / 100));
|
|
533
|
+
}, J = function(b) {
|
|
534
|
+
O(G(b), {
|
|
532
535
|
type: "hue",
|
|
533
|
-
value:
|
|
536
|
+
value: b
|
|
534
537
|
});
|
|
535
|
-
}, F = function(
|
|
536
|
-
O(T(
|
|
538
|
+
}, F = function(b) {
|
|
539
|
+
O(T(b), {
|
|
537
540
|
type: "alpha",
|
|
538
|
-
value:
|
|
541
|
+
value: b
|
|
539
542
|
});
|
|
540
|
-
},
|
|
541
|
-
i && i(G(
|
|
542
|
-
},
|
|
543
|
-
i && i(T(
|
|
544
|
-
}, R = N("".concat(a, "-panel"), c, Ee({}, "".concat(a, "-panel-disabled"),
|
|
543
|
+
}, L = function(b) {
|
|
544
|
+
i && i(G(b));
|
|
545
|
+
}, z = function(b) {
|
|
546
|
+
i && i(T(b));
|
|
547
|
+
}, R = N("".concat(a, "-panel"), c, Ee({}, "".concat(a, "-panel-disabled"), v)), V = {
|
|
545
548
|
prefixCls: a,
|
|
546
|
-
disabled:
|
|
547
|
-
color:
|
|
548
|
-
}, M = /* @__PURE__ */ s.createElement(s.Fragment, null, /* @__PURE__ */ s.createElement(
|
|
549
|
+
disabled: v,
|
|
550
|
+
color: C
|
|
551
|
+
}, M = /* @__PURE__ */ s.createElement(s.Fragment, null, /* @__PURE__ */ s.createElement(nt, be({
|
|
549
552
|
onChange: O
|
|
550
553
|
}, V, {
|
|
551
554
|
onChangeComplete: i
|
|
@@ -553,15 +556,15 @@ var at = [{
|
|
|
553
556
|
className: "".concat(a, "-slider-container")
|
|
554
557
|
}, /* @__PURE__ */ s.createElement("div", {
|
|
555
558
|
className: N("".concat(a, "-slider-group"), Ee({}, "".concat(a, "-slider-group-disabled-alpha"), h))
|
|
556
|
-
}, /* @__PURE__ */ s.createElement(B,
|
|
559
|
+
}, /* @__PURE__ */ s.createElement(B, be({}, V, {
|
|
557
560
|
type: "hue",
|
|
558
|
-
colors:
|
|
561
|
+
colors: st,
|
|
559
562
|
min: 0,
|
|
560
563
|
max: 359,
|
|
561
|
-
value:
|
|
562
|
-
onChange:
|
|
563
|
-
onChangeComplete:
|
|
564
|
-
})), !h && /* @__PURE__ */ s.createElement(B,
|
|
564
|
+
value: C.getHue(),
|
|
565
|
+
onChange: J,
|
|
566
|
+
onChangeComplete: L
|
|
567
|
+
})), !h && /* @__PURE__ */ s.createElement(B, be({}, V, {
|
|
565
568
|
type: "alpha",
|
|
566
569
|
colors: [{
|
|
567
570
|
percent: 0,
|
|
@@ -572,11 +575,11 @@ var at = [{
|
|
|
572
575
|
}],
|
|
573
576
|
min: 0,
|
|
574
577
|
max: 100,
|
|
575
|
-
value:
|
|
578
|
+
value: C.a * 100,
|
|
576
579
|
onChange: F,
|
|
577
|
-
onChangeComplete:
|
|
578
|
-
}))), /* @__PURE__ */ s.createElement(
|
|
579
|
-
color:
|
|
580
|
+
onChangeComplete: z
|
|
581
|
+
}))), /* @__PURE__ */ s.createElement(tt, {
|
|
582
|
+
color: C.toRgbString(),
|
|
580
583
|
prefixCls: a
|
|
581
584
|
})));
|
|
582
585
|
return /* @__PURE__ */ s.createElement("div", {
|
|
@@ -585,11 +588,11 @@ var at = [{
|
|
|
585
588
|
ref: r
|
|
586
589
|
}, typeof d == "function" ? d(M) : M);
|
|
587
590
|
});
|
|
588
|
-
process.env.NODE_ENV !== "production" && (
|
|
589
|
-
const
|
|
590
|
-
let
|
|
591
|
+
process.env.NODE_ENV !== "production" && (ut.displayName = "ColorPicker");
|
|
592
|
+
const dt = (e, r) => (e == null ? void 0 : e.replace(/[^\w/]/g, "").slice(0, r ? 8 : 6)) || "", gt = (e, r) => e ? dt(e, r) : "";
|
|
593
|
+
let mt = /* @__PURE__ */ function() {
|
|
591
594
|
function e(r) {
|
|
592
|
-
|
|
595
|
+
Ke(this, e);
|
|
593
596
|
var t;
|
|
594
597
|
if (this.cleared = !1, r instanceof e) {
|
|
595
598
|
this.metaColor = r.metaColor.clone(), this.colors = (t = r.colors) === null || t === void 0 ? void 0 : t.map((n) => ({
|
|
@@ -610,7 +613,7 @@ let st = /* @__PURE__ */ function() {
|
|
|
610
613
|
};
|
|
611
614
|
}), this.metaColor = new D(this.colors[0].color.metaColor)) : this.metaColor = new D(o ? "" : r), (!r || o && !this.colors) && (this.metaColor = this.metaColor.setA(0), this.cleared = !0);
|
|
612
615
|
}
|
|
613
|
-
return
|
|
616
|
+
return ke(e, [{
|
|
614
617
|
key: "toHsb",
|
|
615
618
|
value: function() {
|
|
616
619
|
return this.metaColor.toHsb();
|
|
@@ -623,7 +626,7 @@ let st = /* @__PURE__ */ function() {
|
|
|
623
626
|
}, {
|
|
624
627
|
key: "toHex",
|
|
625
628
|
value: function() {
|
|
626
|
-
return
|
|
629
|
+
return gt(this.toHexString(), this.metaColor.a < 1);
|
|
627
630
|
}
|
|
628
631
|
}, {
|
|
629
632
|
key: "toHexString",
|
|
@@ -671,7 +674,7 @@ let st = /* @__PURE__ */ function() {
|
|
|
671
674
|
}
|
|
672
675
|
}]);
|
|
673
676
|
}();
|
|
674
|
-
const
|
|
677
|
+
const ft = (e, r) => {
|
|
675
678
|
const {
|
|
676
679
|
r: t,
|
|
677
680
|
g: o,
|
|
@@ -691,7 +694,7 @@ const ut = (e, r) => {
|
|
|
691
694
|
});
|
|
692
695
|
}, ur = (e) => {
|
|
693
696
|
var r, t, o, n, a, l;
|
|
694
|
-
const i = (r = e.contentFontSize) !== null && r !== void 0 ? r : e.fontSize, c = (t = e.contentFontSizeSM) !== null && t !== void 0 ? t : e.fontSize, u = (o = e.contentFontSizeLG) !== null && o !== void 0 ? o : e.fontSizeLG, d = (n = e.contentLineHeight) !== null && n !== void 0 ? n :
|
|
697
|
+
const i = (r = e.contentFontSize) !== null && r !== void 0 ? r : e.fontSize, c = (t = e.contentFontSizeSM) !== null && t !== void 0 ? t : e.fontSize, u = (o = e.contentFontSizeLG) !== null && o !== void 0 ? o : e.fontSizeLG, d = (n = e.contentLineHeight) !== null && n !== void 0 ? n : pe(i), g = (a = e.contentLineHeightSM) !== null && a !== void 0 ? a : pe(c), h = (l = e.contentLineHeightLG) !== null && l !== void 0 ? l : pe(u), f = ft(new mt(e.colorBgSolid), "#fff") ? "#000" : "#fff";
|
|
695
698
|
return {
|
|
696
699
|
fontWeight: 400,
|
|
697
700
|
defaultShadow: `0 ${e.controlOutlineWidth}px 0 ${e.controlTmpOutline}`,
|
|
@@ -725,7 +728,7 @@ const ut = (e, r) => {
|
|
|
725
728
|
defaultActiveBg: e.colorBgContainer,
|
|
726
729
|
defaultActiveColor: e.colorPrimaryActive,
|
|
727
730
|
defaultActiveBorderColor: e.colorPrimaryActive,
|
|
728
|
-
solidTextColor:
|
|
731
|
+
solidTextColor: f,
|
|
729
732
|
contentFontSize: i,
|
|
730
733
|
contentFontSizeSM: c,
|
|
731
734
|
contentFontSizeLG: u,
|
|
@@ -736,7 +739,7 @@ const ut = (e, r) => {
|
|
|
736
739
|
paddingBlockSM: Math.max((e.controlHeightSM - c * g) / 2 - e.lineWidth, 0),
|
|
737
740
|
paddingBlockLG: Math.max((e.controlHeightLG - u * h) / 2 - e.lineWidth, 0)
|
|
738
741
|
};
|
|
739
|
-
},
|
|
742
|
+
}, vt = (e) => {
|
|
740
743
|
const {
|
|
741
744
|
componentCls: r,
|
|
742
745
|
iconCls: t,
|
|
@@ -770,11 +773,11 @@ const ut = (e, r) => {
|
|
|
770
773
|
pointerEvents: "none"
|
|
771
774
|
},
|
|
772
775
|
// https://github.com/ant-design/ant-design/issues/51380
|
|
773
|
-
[`${r}-icon > svg`]:
|
|
776
|
+
[`${r}-icon > svg`]: Nr(),
|
|
774
777
|
"> a": {
|
|
775
778
|
color: "currentColor"
|
|
776
779
|
},
|
|
777
|
-
"&:not(:disabled)":
|
|
780
|
+
"&:not(:disabled)": Pr(e),
|
|
778
781
|
[`&${r}-two-chinese-chars::first-letter`]: {
|
|
779
782
|
letterSpacing: "0.34em"
|
|
780
783
|
},
|
|
@@ -841,22 +844,22 @@ const ut = (e, r) => {
|
|
|
841
844
|
"&:hover": r,
|
|
842
845
|
"&:active": t
|
|
843
846
|
}
|
|
844
|
-
}),
|
|
847
|
+
}), Ct = (e) => ({
|
|
845
848
|
minWidth: e.controlHeight,
|
|
846
849
|
paddingInlineStart: 0,
|
|
847
850
|
paddingInlineEnd: 0,
|
|
848
851
|
borderRadius: "50%"
|
|
849
|
-
}),
|
|
852
|
+
}), ht = (e) => ({
|
|
850
853
|
borderRadius: e.controlHeight,
|
|
851
854
|
paddingInlineStart: e.calc(e.controlHeight).div(2).equal(),
|
|
852
855
|
paddingInlineEnd: e.calc(e.controlHeight).div(2).equal()
|
|
853
|
-
}),
|
|
856
|
+
}), bt = (e) => ({
|
|
854
857
|
cursor: "not-allowed",
|
|
855
858
|
borderColor: e.borderColorDisabled,
|
|
856
859
|
color: e.colorTextDisabled,
|
|
857
860
|
background: e.colorBgContainerDisabled,
|
|
858
861
|
boxShadow: "none"
|
|
859
|
-
}),
|
|
862
|
+
}), Oe = (e, r, t, o, n, a, l, i) => ({
|
|
860
863
|
[`&${e}-background-ghost`]: Object.assign(Object.assign({
|
|
861
864
|
color: t || void 0,
|
|
862
865
|
background: r,
|
|
@@ -873,15 +876,15 @@ const ut = (e, r) => {
|
|
|
873
876
|
borderColor: a || void 0
|
|
874
877
|
}
|
|
875
878
|
})
|
|
876
|
-
}),
|
|
877
|
-
[`&:disabled, &${e.componentCls}-disabled`]: Object.assign({},
|
|
878
|
-
}),
|
|
879
|
+
}), pt = (e) => ({
|
|
880
|
+
[`&:disabled, &${e.componentCls}-disabled`]: Object.assign({}, bt(e))
|
|
881
|
+
}), yt = (e) => ({
|
|
879
882
|
[`&:disabled, &${e.componentCls}-disabled`]: {
|
|
880
883
|
cursor: "not-allowed",
|
|
881
884
|
color: e.colorTextDisabled
|
|
882
885
|
}
|
|
883
886
|
}), ae = (e, r, t, o) => {
|
|
884
|
-
const a = o && ["link", "text"].includes(o) ?
|
|
887
|
+
const a = o && ["link", "text"].includes(o) ? yt : pt;
|
|
885
888
|
return Object.assign(Object.assign({}, a(e)), dr(e.componentCls, r, t));
|
|
886
889
|
}, le = (e, r, t, o, n) => ({
|
|
887
890
|
[`&${e.componentCls}-variant-solid`]: Object.assign({
|
|
@@ -907,7 +910,7 @@ const ut = (e, r) => {
|
|
|
907
910
|
color: r,
|
|
908
911
|
boxShadow: "none"
|
|
909
912
|
}, ae(e, o, n, t))
|
|
910
|
-
}),
|
|
913
|
+
}), St = (e) => {
|
|
911
914
|
const {
|
|
912
915
|
componentCls: r
|
|
913
916
|
} = e;
|
|
@@ -946,7 +949,7 @@ const ut = (e, r) => {
|
|
|
946
949
|
}))
|
|
947
950
|
});
|
|
948
951
|
}, {});
|
|
949
|
-
},
|
|
952
|
+
}, xt = (e) => Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({
|
|
950
953
|
color: e.defaultColor,
|
|
951
954
|
boxShadow: e.defaultShadow
|
|
952
955
|
}, le(e, e.solidTextColor, e.colorBgSolid, {
|
|
@@ -964,7 +967,7 @@ const ut = (e, r) => {
|
|
|
964
967
|
background: e.linkHoverBg
|
|
965
968
|
}, {
|
|
966
969
|
color: e.colorLinkActive
|
|
967
|
-
})),
|
|
970
|
+
})), Oe(e.componentCls, e.ghostBg, e.defaultGhostColor, e.defaultGhostBorderColor, e.colorTextDisabled, e.colorBorder)), $t = (e) => Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({
|
|
968
971
|
color: e.colorPrimary,
|
|
969
972
|
boxShadow: e.primaryShadow
|
|
970
973
|
}, ie(e, e.colorPrimary, e.colorBgContainer, {
|
|
@@ -985,13 +988,13 @@ const ut = (e, r) => {
|
|
|
985
988
|
}, {
|
|
986
989
|
color: e.colorPrimaryTextActive,
|
|
987
990
|
background: e.colorPrimaryBorder
|
|
988
|
-
})),
|
|
991
|
+
})), Oe(e.componentCls, e.ghostBg, e.colorPrimary, e.colorPrimary, e.colorTextDisabled, e.colorBorder, {
|
|
989
992
|
color: e.colorPrimaryHover,
|
|
990
993
|
borderColor: e.colorPrimaryHover
|
|
991
994
|
}, {
|
|
992
995
|
color: e.colorPrimaryActive,
|
|
993
996
|
borderColor: e.colorPrimaryActive
|
|
994
|
-
})),
|
|
997
|
+
})), Et = (e) => Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({
|
|
995
998
|
color: e.colorError,
|
|
996
999
|
boxShadow: e.dangerShadow
|
|
997
1000
|
}, le(e, e.dangerColor, e.colorError, {
|
|
@@ -1018,22 +1021,22 @@ const ut = (e, r) => {
|
|
|
1018
1021
|
color: e.colorErrorHover
|
|
1019
1022
|
}, {
|
|
1020
1023
|
color: e.colorErrorActive
|
|
1021
|
-
})),
|
|
1024
|
+
})), Oe(e.componentCls, e.ghostBg, e.colorError, e.colorError, e.colorTextDisabled, e.colorBorder, {
|
|
1022
1025
|
color: e.colorErrorHover,
|
|
1023
1026
|
borderColor: e.colorErrorHover
|
|
1024
1027
|
}, {
|
|
1025
1028
|
color: e.colorErrorActive,
|
|
1026
1029
|
borderColor: e.colorErrorActive
|
|
1027
|
-
})),
|
|
1030
|
+
})), Bt = (e) => {
|
|
1028
1031
|
const {
|
|
1029
1032
|
componentCls: r
|
|
1030
1033
|
} = e;
|
|
1031
1034
|
return Object.assign({
|
|
1032
|
-
[`${r}-color-default`]:
|
|
1033
|
-
[`${r}-color-primary`]:
|
|
1034
|
-
[`${r}-color-dangerous`]:
|
|
1035
|
-
},
|
|
1036
|
-
},
|
|
1035
|
+
[`${r}-color-default`]: xt(e),
|
|
1036
|
+
[`${r}-color-primary`]: $t(e),
|
|
1037
|
+
[`${r}-color-dangerous`]: Et(e)
|
|
1038
|
+
}, St(e));
|
|
1039
|
+
}, Ht = (e) => Object.assign(Object.assign(Object.assign(Object.assign({}, ie(e, e.defaultBorderColor, e.defaultBg, {
|
|
1037
1040
|
color: e.defaultHoverColor,
|
|
1038
1041
|
borderColor: e.defaultHoverBorderColor,
|
|
1039
1042
|
background: e.defaultHoverBg
|
|
@@ -1058,7 +1061,7 @@ const ut = (e, r) => {
|
|
|
1058
1061
|
background: e.linkHoverBg
|
|
1059
1062
|
}, {
|
|
1060
1063
|
color: e.colorLinkActive
|
|
1061
|
-
})),
|
|
1064
|
+
})), Re = function(e) {
|
|
1062
1065
|
let r = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : "";
|
|
1063
1066
|
const {
|
|
1064
1067
|
componentCls: t,
|
|
@@ -1087,18 +1090,18 @@ const ut = (e, r) => {
|
|
|
1087
1090
|
},
|
|
1088
1091
|
// Shape - patch prefixCls again to override solid border radius style
|
|
1089
1092
|
{
|
|
1090
|
-
[`${t}${t}-circle${r}`]:
|
|
1093
|
+
[`${t}${t}-circle${r}`]: Ct(e)
|
|
1091
1094
|
},
|
|
1092
1095
|
{
|
|
1093
|
-
[`${t}${t}-round${r}`]:
|
|
1096
|
+
[`${t}${t}-round${r}`]: ht(e)
|
|
1094
1097
|
}
|
|
1095
1098
|
];
|
|
1096
|
-
},
|
|
1099
|
+
}, Ot = (e) => {
|
|
1097
1100
|
const r = ne(e, {
|
|
1098
1101
|
fontSize: e.contentFontSize
|
|
1099
1102
|
});
|
|
1100
|
-
return
|
|
1101
|
-
},
|
|
1103
|
+
return Re(r, e.componentCls);
|
|
1104
|
+
}, Rt = (e) => {
|
|
1102
1105
|
const r = ne(e, {
|
|
1103
1106
|
controlHeight: e.controlHeightSM,
|
|
1104
1107
|
fontSize: e.contentFontSizeSM,
|
|
@@ -1108,8 +1111,8 @@ const ut = (e, r) => {
|
|
|
1108
1111
|
borderRadius: e.borderRadiusSM,
|
|
1109
1112
|
buttonIconOnlyFontSize: e.onlyIconSizeSM
|
|
1110
1113
|
});
|
|
1111
|
-
return
|
|
1112
|
-
},
|
|
1114
|
+
return Re(r, `${e.componentCls}-sm`);
|
|
1115
|
+
}, Nt = (e) => {
|
|
1113
1116
|
const r = ne(e, {
|
|
1114
1117
|
controlHeight: e.controlHeightLG,
|
|
1115
1118
|
fontSize: e.contentFontSizeLG,
|
|
@@ -1118,8 +1121,8 @@ const ut = (e, r) => {
|
|
|
1118
1121
|
borderRadius: e.borderRadiusLG,
|
|
1119
1122
|
buttonIconOnlyFontSize: e.onlyIconSizeLG
|
|
1120
1123
|
});
|
|
1121
|
-
return
|
|
1122
|
-
},
|
|
1124
|
+
return Re(r, `${e.componentCls}-lg`);
|
|
1125
|
+
}, Pt = (e) => {
|
|
1123
1126
|
const {
|
|
1124
1127
|
componentCls: r
|
|
1125
1128
|
} = e;
|
|
@@ -1130,23 +1133,23 @@ const ut = (e, r) => {
|
|
|
1130
1133
|
}
|
|
1131
1134
|
}
|
|
1132
1135
|
};
|
|
1133
|
-
},
|
|
1136
|
+
}, It = Rr("Button", (e) => {
|
|
1134
1137
|
const r = sr(e);
|
|
1135
1138
|
return [
|
|
1136
1139
|
// Shared
|
|
1137
|
-
|
|
1140
|
+
vt(r),
|
|
1138
1141
|
// Size
|
|
1139
|
-
|
|
1140
|
-
|
|
1141
|
-
|
|
1142
|
+
Ot(r),
|
|
1143
|
+
Rt(r),
|
|
1144
|
+
Nt(r),
|
|
1142
1145
|
// Block
|
|
1143
|
-
|
|
1146
|
+
Pt(r),
|
|
1144
1147
|
// Color
|
|
1145
|
-
|
|
1148
|
+
Bt(r),
|
|
1146
1149
|
// https://github.com/ant-design/ant-design/issues/50969
|
|
1147
|
-
|
|
1150
|
+
Ht(r),
|
|
1148
1151
|
// Button Group
|
|
1149
|
-
|
|
1152
|
+
Qr(r)
|
|
1150
1153
|
];
|
|
1151
1154
|
}, ur, {
|
|
1152
1155
|
unitless: {
|
|
@@ -1156,7 +1159,7 @@ const ut = (e, r) => {
|
|
|
1156
1159
|
contentLineHeightLG: !0
|
|
1157
1160
|
}
|
|
1158
1161
|
});
|
|
1159
|
-
function
|
|
1162
|
+
function jt(e, r) {
|
|
1160
1163
|
return {
|
|
1161
1164
|
// border collapse
|
|
1162
1165
|
[`&-item:not(${r}-last-item)`]: {
|
|
@@ -1172,7 +1175,7 @@ function Rt(e, r) {
|
|
|
1172
1175
|
}
|
|
1173
1176
|
};
|
|
1174
1177
|
}
|
|
1175
|
-
function
|
|
1178
|
+
function wt(e, r) {
|
|
1176
1179
|
return {
|
|
1177
1180
|
[`&-item:not(${r}-first-item):not(${r}-last-item)`]: {
|
|
1178
1181
|
borderRadius: 0
|
|
@@ -1191,21 +1194,22 @@ function Nt(e, r) {
|
|
|
1191
1194
|
}
|
|
1192
1195
|
};
|
|
1193
1196
|
}
|
|
1194
|
-
function
|
|
1197
|
+
function Dt(e) {
|
|
1195
1198
|
const r = `${e.componentCls}-compact-vertical`;
|
|
1196
1199
|
return {
|
|
1197
|
-
[r]: Object.assign(Object.assign({},
|
|
1200
|
+
[r]: Object.assign(Object.assign({}, jt(e, r)), wt(e.componentCls, r))
|
|
1198
1201
|
};
|
|
1199
1202
|
}
|
|
1200
|
-
const
|
|
1203
|
+
const Tt = (e) => {
|
|
1201
1204
|
const {
|
|
1202
1205
|
componentCls: r,
|
|
1203
1206
|
colorPrimaryHover: t,
|
|
1204
1207
|
lineWidth: o,
|
|
1205
1208
|
calc: n
|
|
1206
|
-
} = e, a = n(o).mul(-1).equal(), l = (i) =>
|
|
1207
|
-
|
|
1208
|
-
|
|
1209
|
+
} = e, a = n(o).mul(-1).equal(), l = (i) => {
|
|
1210
|
+
const c = `${r}-compact${i ? "-vertical" : ""}-item${r}-primary:not([disabled])`;
|
|
1211
|
+
return {
|
|
1212
|
+
[`${c} + ${c}::before`]: {
|
|
1209
1213
|
position: "absolute",
|
|
1210
1214
|
top: i ? a : 0,
|
|
1211
1215
|
insetInlineStart: i ? 0 : a,
|
|
@@ -1214,26 +1218,28 @@ const jt = (e) => {
|
|
|
1214
1218
|
width: i ? "100%" : o,
|
|
1215
1219
|
height: i ? o : "100%"
|
|
1216
1220
|
}
|
|
1217
|
-
}
|
|
1218
|
-
}
|
|
1221
|
+
};
|
|
1222
|
+
};
|
|
1219
1223
|
return Object.assign(Object.assign({}, l()), l(!0));
|
|
1220
|
-
},
|
|
1224
|
+
}, Lt = Ir(["Button", "compact"], (e) => {
|
|
1221
1225
|
const r = sr(e);
|
|
1222
1226
|
return [
|
|
1223
1227
|
// Space Compact
|
|
1224
1228
|
Mr(r),
|
|
1225
|
-
|
|
1226
|
-
|
|
1229
|
+
Dt(r),
|
|
1230
|
+
Tt(r)
|
|
1227
1231
|
];
|
|
1228
1232
|
}, ur);
|
|
1229
|
-
var
|
|
1233
|
+
var zt = globalThis && globalThis.__rest || function(e, r) {
|
|
1230
1234
|
var t = {};
|
|
1231
|
-
for (var o in e)
|
|
1232
|
-
|
|
1233
|
-
|
|
1235
|
+
for (var o in e)
|
|
1236
|
+
Object.prototype.hasOwnProperty.call(e, o) && r.indexOf(o) < 0 && (t[o] = e[o]);
|
|
1237
|
+
if (e != null && typeof Object.getOwnPropertySymbols == "function")
|
|
1238
|
+
for (var n = 0, o = Object.getOwnPropertySymbols(e); n < o.length; n++)
|
|
1239
|
+
r.indexOf(o[n]) < 0 && Object.prototype.propertyIsEnumerable.call(e, o[n]) && (t[o[n]] = e[o[n]]);
|
|
1234
1240
|
return t;
|
|
1235
1241
|
};
|
|
1236
|
-
function
|
|
1242
|
+
function At(e) {
|
|
1237
1243
|
if (typeof e == "object" && e) {
|
|
1238
1244
|
let r = e == null ? void 0 : e.delay;
|
|
1239
1245
|
return r = !Number.isNaN(r) && typeof r == "number" ? r : 0, {
|
|
@@ -1246,13 +1252,13 @@ function Dt(e) {
|
|
|
1246
1252
|
delay: 0
|
|
1247
1253
|
};
|
|
1248
1254
|
}
|
|
1249
|
-
const
|
|
1255
|
+
const _t = {
|
|
1250
1256
|
default: ["default", "outlined"],
|
|
1251
1257
|
primary: ["primary", "solid"],
|
|
1252
1258
|
dashed: ["default", "dashed"],
|
|
1253
1259
|
link: ["primary", "link"],
|
|
1254
1260
|
text: ["default", "text"]
|
|
1255
|
-
},
|
|
1261
|
+
}, Mt = /* @__PURE__ */ s.forwardRef((e, r) => {
|
|
1256
1262
|
var t, o, n, a;
|
|
1257
1263
|
const {
|
|
1258
1264
|
loading: l = !1,
|
|
@@ -1262,102 +1268,102 @@ const Tt = {
|
|
|
1262
1268
|
type: d,
|
|
1263
1269
|
danger: g = !1,
|
|
1264
1270
|
shape: h = "default",
|
|
1265
|
-
size:
|
|
1266
|
-
styles:
|
|
1271
|
+
size: f,
|
|
1272
|
+
styles: v,
|
|
1267
1273
|
disabled: y,
|
|
1268
|
-
className:
|
|
1274
|
+
className: E,
|
|
1269
1275
|
rootClassName: H,
|
|
1270
1276
|
children: B,
|
|
1271
1277
|
icon: S,
|
|
1272
|
-
iconPosition:
|
|
1273
|
-
ghost:
|
|
1278
|
+
iconPosition: m = "start",
|
|
1279
|
+
ghost: C = !1,
|
|
1274
1280
|
block: Y = !1,
|
|
1275
1281
|
// React does not recognize the `htmlType` prop on a DOM element. Here we pick it out of `rest`.
|
|
1276
1282
|
htmlType: U = "button",
|
|
1277
1283
|
classNames: O,
|
|
1278
1284
|
style: G = {},
|
|
1279
1285
|
autoInsertSpace: T,
|
|
1280
|
-
autoFocus:
|
|
1281
|
-
} = e, F =
|
|
1286
|
+
autoFocus: J
|
|
1287
|
+
} = e, F = zt(e, ["loading", "prefixCls", "color", "variant", "type", "danger", "shape", "size", "styles", "disabled", "className", "rootClassName", "children", "icon", "iconPosition", "ghost", "block", "htmlType", "classNames", "style", "autoInsertSpace", "autoFocus"]), L = d || "default", [z, R] = ee(() => {
|
|
1282
1288
|
if (c && u)
|
|
1283
1289
|
return [c, u];
|
|
1284
|
-
const
|
|
1285
|
-
return g ? ["danger",
|
|
1286
|
-
}, [d, c, u, g]), M =
|
|
1290
|
+
const $ = _t[L] || [];
|
|
1291
|
+
return g ? ["danger", $[1]] : $;
|
|
1292
|
+
}, [d, c, u, g]), M = z === "danger" ? "dangerous" : z, {
|
|
1287
1293
|
getPrefixCls: P,
|
|
1288
|
-
direction:
|
|
1294
|
+
direction: b,
|
|
1289
1295
|
button: x
|
|
1290
|
-
} =
|
|
1291
|
-
s.useEffect(() => (
|
|
1292
|
-
|
|
1296
|
+
} = he(Qe), de = (t = T ?? (x == null ? void 0 : x.autoInsertSpace)) !== null && t !== void 0 ? t : !0, p = P("btn", i), [Ne, gr, mr] = It(p), fr = he(jr), W = y ?? fr, vr = he(tr), Q = ee(() => At(l), [l]), [A, Pe] = $e(Q.loading), [ge, Ie] = $e(!1), Z = I(null), je = wr(r, Z), we = pr.count(B) === 1 && !S && !re(R), me = I(!0);
|
|
1297
|
+
s.useEffect(() => (me.current = !1, () => {
|
|
1298
|
+
me.current = !0;
|
|
1293
1299
|
}), []), k(() => {
|
|
1294
|
-
let
|
|
1295
|
-
|
|
1296
|
-
|
|
1297
|
-
},
|
|
1298
|
-
function
|
|
1299
|
-
|
|
1300
|
+
let $ = null;
|
|
1301
|
+
Q.delay > 0 ? $ = setTimeout(() => {
|
|
1302
|
+
$ = null, Pe(!0);
|
|
1303
|
+
}, Q.delay) : Pe(Q.loading);
|
|
1304
|
+
function j() {
|
|
1305
|
+
$ && (clearTimeout($), $ = null);
|
|
1300
1306
|
}
|
|
1301
|
-
return
|
|
1302
|
-
}, [
|
|
1303
|
-
if (!Z.current || !
|
|
1307
|
+
return j;
|
|
1308
|
+
}, [Q]), k(() => {
|
|
1309
|
+
if (!Z.current || !de)
|
|
1304
1310
|
return;
|
|
1305
|
-
const
|
|
1306
|
-
|
|
1311
|
+
const $ = Z.current.textContent || "";
|
|
1312
|
+
we && Be($) ? ge || Ie(!0) : ge && Ie(!1);
|
|
1307
1313
|
}), k(() => {
|
|
1308
|
-
|
|
1314
|
+
J && Z.current && Z.current.focus();
|
|
1309
1315
|
}, []);
|
|
1310
|
-
const De = s.useCallback((
|
|
1311
|
-
var
|
|
1316
|
+
const De = s.useCallback(($) => {
|
|
1317
|
+
var j;
|
|
1312
1318
|
if (A || W) {
|
|
1313
|
-
|
|
1319
|
+
$.preventDefault();
|
|
1314
1320
|
return;
|
|
1315
1321
|
}
|
|
1316
|
-
(
|
|
1322
|
+
(j = e.onClick) === null || j === void 0 || j.call(e, $);
|
|
1317
1323
|
}, [e.onClick, A, W]);
|
|
1318
1324
|
if (process.env.NODE_ENV !== "production") {
|
|
1319
|
-
const
|
|
1320
|
-
process.env.NODE_ENV !== "production" &&
|
|
1325
|
+
const $ = Ze("Button");
|
|
1326
|
+
process.env.NODE_ENV !== "production" && $(!(typeof S == "string" && S.length > 2), "breaking", `\`icon\` is using ReactNode instead of string naming in v4. Please check \`${S}\` at https://ant.design/components/icon`), process.env.NODE_ENV !== "production" && $(!(C && re(R)), "usage", "`link` or `text` button can't be a `ghost` button.");
|
|
1321
1327
|
}
|
|
1322
1328
|
const {
|
|
1323
|
-
compactSize:
|
|
1329
|
+
compactSize: Cr,
|
|
1324
1330
|
compactItemClassnames: Te
|
|
1325
|
-
} =
|
|
1331
|
+
} = Tr(p, b), hr = {
|
|
1326
1332
|
large: "lg",
|
|
1327
1333
|
small: "sm",
|
|
1328
1334
|
middle: void 0
|
|
1329
|
-
},
|
|
1330
|
-
var
|
|
1331
|
-
return (Ce = (
|
|
1332
|
-
}),
|
|
1335
|
+
}, Le = Lr(($) => {
|
|
1336
|
+
var j, Ce;
|
|
1337
|
+
return (Ce = (j = f ?? Cr) !== null && j !== void 0 ? j : vr) !== null && Ce !== void 0 ? Ce : $;
|
|
1338
|
+
}), ze = Le && (o = hr[Le]) !== null && o !== void 0 ? o : "", br = A ? "loading" : S, fe = xr(F, ["navigate"]), Ae = N(p, gr, mr, {
|
|
1333
1339
|
[`${p}-${h}`]: h !== "default" && h,
|
|
1334
1340
|
// line(253 - 254): Compatible with versions earlier than 5.21.0
|
|
1335
|
-
[`${p}-${
|
|
1341
|
+
[`${p}-${L}`]: L,
|
|
1336
1342
|
[`${p}-dangerous`]: g,
|
|
1337
1343
|
[`${p}-color-${M}`]: M,
|
|
1338
1344
|
[`${p}-variant-${R}`]: R,
|
|
1339
|
-
[`${p}-${
|
|
1340
|
-
[`${p}-icon-only`]: !B && B !== 0 && !!
|
|
1341
|
-
[`${p}-background-ghost`]:
|
|
1345
|
+
[`${p}-${ze}`]: ze,
|
|
1346
|
+
[`${p}-icon-only`]: !B && B !== 0 && !!br,
|
|
1347
|
+
[`${p}-background-ghost`]: C && !re(R),
|
|
1342
1348
|
[`${p}-loading`]: A,
|
|
1343
|
-
[`${p}-two-chinese-chars`]:
|
|
1349
|
+
[`${p}-two-chinese-chars`]: ge && de && !A,
|
|
1344
1350
|
[`${p}-block`]: Y,
|
|
1345
|
-
[`${p}-rtl`]:
|
|
1346
|
-
[`${p}-icon-end`]:
|
|
1347
|
-
}, Te,
|
|
1351
|
+
[`${p}-rtl`]: b === "rtl",
|
|
1352
|
+
[`${p}-icon-end`]: m === "end"
|
|
1353
|
+
}, Te, E, H, x == null ? void 0 : x.className), _e = Object.assign(Object.assign({}, x == null ? void 0 : x.style), G), Me = N(O == null ? void 0 : O.icon, (n = x == null ? void 0 : x.classNames) === null || n === void 0 ? void 0 : n.icon), Ge = Object.assign(Object.assign({}, (v == null ? void 0 : v.icon) || {}), ((a = x == null ? void 0 : x.styles) === null || a === void 0 ? void 0 : a.icon) || {}), Fe = S && !A ? /* @__PURE__ */ s.createElement(He, {
|
|
1348
1354
|
prefixCls: p,
|
|
1349
1355
|
className: Me,
|
|
1350
1356
|
style: Ge
|
|
1351
|
-
}, S) : typeof l == "object" && l.icon ? /* @__PURE__ */ s.createElement(
|
|
1357
|
+
}, S) : typeof l == "object" && l.icon ? /* @__PURE__ */ s.createElement(He, {
|
|
1352
1358
|
prefixCls: p,
|
|
1353
1359
|
className: Me,
|
|
1354
1360
|
style: Ge
|
|
1355
|
-
}, l.icon) : /* @__PURE__ */ s.createElement(
|
|
1361
|
+
}, l.icon) : /* @__PURE__ */ s.createElement(Ur, {
|
|
1356
1362
|
existIcon: !!S,
|
|
1357
1363
|
prefixCls: p,
|
|
1358
1364
|
loading: A,
|
|
1359
|
-
mount:
|
|
1360
|
-
}), Ve = B || B === 0 ?
|
|
1365
|
+
mount: me.current
|
|
1366
|
+
}), Ve = B || B === 0 ? Xr(B, we && de) : null;
|
|
1361
1367
|
if (fe.href !== void 0)
|
|
1362
1368
|
return Ne(/* @__PURE__ */ s.createElement("a", Object.assign({}, fe, {
|
|
1363
1369
|
className: N(Ae, {
|
|
@@ -1366,27 +1372,28 @@ const Tt = {
|
|
|
1366
1372
|
href: W ? void 0 : fe.href,
|
|
1367
1373
|
style: _e,
|
|
1368
1374
|
onClick: De,
|
|
1369
|
-
ref:
|
|
1375
|
+
ref: je,
|
|
1370
1376
|
tabIndex: W ? -1 : 0
|
|
1371
1377
|
}), Fe, Ve));
|
|
1372
|
-
let
|
|
1378
|
+
let ve = /* @__PURE__ */ s.createElement("button", Object.assign({}, F, {
|
|
1373
1379
|
type: U,
|
|
1374
1380
|
className: Ae,
|
|
1375
1381
|
style: _e,
|
|
1376
1382
|
onClick: De,
|
|
1377
1383
|
disabled: W,
|
|
1378
|
-
ref:
|
|
1379
|
-
}), Fe, Ve, Te && /* @__PURE__ */ s.createElement(
|
|
1384
|
+
ref: je
|
|
1385
|
+
}), Fe, Ve, Te && /* @__PURE__ */ s.createElement(Lt, {
|
|
1380
1386
|
prefixCls: p
|
|
1381
1387
|
}));
|
|
1382
|
-
return re(R) || (
|
|
1388
|
+
return re(R) || (ve = /* @__PURE__ */ s.createElement(Dr, {
|
|
1383
1389
|
component: "Button",
|
|
1384
1390
|
disabled: A
|
|
1385
|
-
},
|
|
1386
|
-
}),
|
|
1387
|
-
|
|
1388
|
-
|
|
1389
|
-
process.env.NODE_ENV !== "production" && (
|
|
1391
|
+
}, ve)), Ne(ve);
|
|
1392
|
+
}), ue = Mt;
|
|
1393
|
+
ue.Group = Vr;
|
|
1394
|
+
ue.__ANT_BUTTON = !0;
|
|
1395
|
+
process.env.NODE_ENV !== "production" && (ue.displayName = "Button");
|
|
1396
|
+
const Qt = ue;
|
|
1390
1397
|
export {
|
|
1391
|
-
|
|
1398
|
+
Qt as B
|
|
1392
1399
|
};
|