col-browser 2.0.0 → 2.1.0
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 +17 -0
- package/es/bibtex.js +8 -0
- package/es/bibtex.js.map +1 -0
- package/es/chunks/AntdIcon-B1nMlqyh.js +984 -0
- package/es/chunks/AntdIcon-B1nMlqyh.js.map +1 -0
- package/es/chunks/BibTex-BqzD3qLB.js +13 -0
- package/es/chunks/BibTex-BqzD3qLB.js.map +1 -0
- package/es/chunks/DatasetCitation-bkPmDDYB.js +119 -0
- package/es/chunks/DatasetCitation-bkPmDDYB.js.map +1 -0
- package/es/chunks/DatasetlogoWithFallback-CbP7vRs_.js +823 -0
- package/es/chunks/DatasetlogoWithFallback-CbP7vRs_.js.map +1 -0
- package/es/chunks/Distributions-DDYEbGhW.js +1110 -0
- package/es/chunks/Distributions-DDYEbGhW.js.map +1 -0
- package/es/chunks/ErrorMsg-K8k5PPTp.js +26 -0
- package/es/chunks/ErrorMsg-K8k5PPTp.js.map +1 -0
- package/es/chunks/LinkOutlined-2IkQWTV7.js +22 -0
- package/es/chunks/LinkOutlined-2IkQWTV7.js.map +1 -0
- package/es/chunks/MergedDataBadge-DsTsn5Xu.js +134 -0
- package/es/chunks/MergedDataBadge-DsTsn5Xu.js.map +1 -0
- package/es/chunks/MetricsPresentation-U_CO8JoH.js +66 -0
- package/es/chunks/MetricsPresentation-U_CO8JoH.js.map +1 -0
- package/es/chunks/TaxonBreakdown-BshFaQql.js +205 -0
- package/es/chunks/TaxonBreakdown-BshFaQql.js.map +1 -0
- package/es/chunks/config-BPRXv9x8.js +31 -0
- package/es/chunks/config-BPRXv9x8.js.map +1 -0
- package/es/chunks/dataset-DvQG4NjA.js +30 -0
- package/es/chunks/dataset-DvQG4NjA.js.map +1 -0
- package/es/chunks/enumeration-yDQXSZsf.js +12 -0
- package/es/chunks/enumeration-yDQXSZsf.js.map +1 -0
- package/es/chunks/index-CNK3JADR.js +95 -0
- package/es/chunks/index-CNK3JADR.js.map +1 -0
- package/es/chunks/jsx-runtime-BzflLqGi.js +283 -0
- package/es/chunks/jsx-runtime-BzflLqGi.js.map +1 -0
- package/es/chunks/router-CssZk5qZ.js +109 -0
- package/es/chunks/router-CssZk5qZ.js.map +1 -0
- package/es/chunks/sector-BnVzMnMO.js +9 -0
- package/es/chunks/sector-BnVzMnMO.js.map +1 -0
- package/es/chunks/withDatasetKey-BgMY05XE.js +48 -0
- package/es/chunks/withDatasetKey-BgMY05XE.js.map +1 -0
- package/es/col-browser.css +1 -1
- package/es/index.js +18 -7964
- package/es/index.js.map +1 -1
- package/es/routing.js +5 -0
- package/es/routing.js.map +1 -0
- package/es/search.js +803 -0
- package/es/search.js.map +1 -0
- package/es/sourceDataset.js +453 -0
- package/es/sourceDataset.js.map +1 -0
- package/es/sourceDatasetList.js +366 -0
- package/es/sourceDatasetList.js.map +1 -0
- package/es/taxon.js +1643 -0
- package/es/taxon.js.map +1 -0
- package/es/taxonBreakdown.js +42 -0
- package/es/taxonBreakdown.js.map +1 -0
- package/es/taxonDistribution.js +48 -0
- package/es/taxonDistribution.js.map +1 -0
- package/es/tree.js +821 -0
- package/es/tree.js.map +1 -0
- package/package.json +51 -9
- package/types/bibtex.d.ts +1 -0
- package/types/index.d.ts +158 -0
- package/types/routing.d.ts +1 -0
- package/types/search.d.ts +1 -0
- package/types/sourceDataset.d.ts +1 -0
- package/types/sourceDatasetList.d.ts +1 -0
- package/types/taxon.d.ts +1 -0
- package/types/taxonBreakdown.d.ts +1 -0
- package/types/taxonDistribution.d.ts +1 -0
- package/types/tree.d.ts +1 -0
- package/umd/col-browser.js +20478 -27048
- package/umd/col-browser.js.map +1 -1
- package/umd/col-browser.min.js +5 -13
- package/umd/col-browser.min.js.map +1 -1
|
@@ -0,0 +1,984 @@
|
|
|
1
|
+
var rt = Object.defineProperty;
|
|
2
|
+
var it = (n, t, e) => t in n ? rt(n, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : n[t] = e;
|
|
3
|
+
var f = (n, t, e) => it(n, typeof t != "symbol" ? t + "" : t, e);
|
|
4
|
+
import * as _ from "react";
|
|
5
|
+
import R, { createContext as st, useContext as ot, useEffect as at } from "react";
|
|
6
|
+
const D = /* @__PURE__ */ st({});
|
|
7
|
+
function W(n) {
|
|
8
|
+
var t, e, r = "";
|
|
9
|
+
if (typeof n == "string" || typeof n == "number") r += n;
|
|
10
|
+
else if (typeof n == "object") if (Array.isArray(n)) {
|
|
11
|
+
var i = n.length;
|
|
12
|
+
for (t = 0; t < i; t++) n[t] && (e = W(n[t])) && (r && (r += " "), r += e);
|
|
13
|
+
} else for (e in n) n[e] && (r && (r += " "), r += e);
|
|
14
|
+
return r;
|
|
15
|
+
}
|
|
16
|
+
function lt() {
|
|
17
|
+
for (var n, t, e = 0, r = "", i = arguments.length; e < i; e++) (n = arguments[e]) && (t = W(n)) && (r && (r += " "), r += t);
|
|
18
|
+
return r;
|
|
19
|
+
}
|
|
20
|
+
const ct = {
|
|
21
|
+
aliceblue: "9ehhb",
|
|
22
|
+
antiquewhite: "9sgk7",
|
|
23
|
+
aqua: "1ekf",
|
|
24
|
+
aquamarine: "4zsno",
|
|
25
|
+
azure: "9eiv3",
|
|
26
|
+
beige: "9lhp8",
|
|
27
|
+
bisque: "9zg04",
|
|
28
|
+
black: "0",
|
|
29
|
+
blanchedalmond: "9zhe5",
|
|
30
|
+
blue: "73",
|
|
31
|
+
blueviolet: "5e31e",
|
|
32
|
+
brown: "6g016",
|
|
33
|
+
burlywood: "8ouiv",
|
|
34
|
+
cadetblue: "3qba8",
|
|
35
|
+
chartreuse: "4zshs",
|
|
36
|
+
chocolate: "87k0u",
|
|
37
|
+
coral: "9yvyo",
|
|
38
|
+
cornflowerblue: "3xael",
|
|
39
|
+
cornsilk: "9zjz0",
|
|
40
|
+
crimson: "8l4xo",
|
|
41
|
+
cyan: "1ekf",
|
|
42
|
+
darkblue: "3v",
|
|
43
|
+
darkcyan: "rkb",
|
|
44
|
+
darkgoldenrod: "776yz",
|
|
45
|
+
darkgray: "6mbhl",
|
|
46
|
+
darkgreen: "jr4",
|
|
47
|
+
darkgrey: "6mbhl",
|
|
48
|
+
darkkhaki: "7ehkb",
|
|
49
|
+
darkmagenta: "5f91n",
|
|
50
|
+
darkolivegreen: "3bzfz",
|
|
51
|
+
darkorange: "9yygw",
|
|
52
|
+
darkorchid: "5z6x8",
|
|
53
|
+
darkred: "5f8xs",
|
|
54
|
+
darksalmon: "9441m",
|
|
55
|
+
darkseagreen: "5lwgf",
|
|
56
|
+
darkslateblue: "2th1n",
|
|
57
|
+
darkslategray: "1ugcv",
|
|
58
|
+
darkslategrey: "1ugcv",
|
|
59
|
+
darkturquoise: "14up",
|
|
60
|
+
darkviolet: "5rw7n",
|
|
61
|
+
deeppink: "9yavn",
|
|
62
|
+
deepskyblue: "11xb",
|
|
63
|
+
dimgray: "442g9",
|
|
64
|
+
dimgrey: "442g9",
|
|
65
|
+
dodgerblue: "16xof",
|
|
66
|
+
firebrick: "6y7tu",
|
|
67
|
+
floralwhite: "9zkds",
|
|
68
|
+
forestgreen: "1cisi",
|
|
69
|
+
fuchsia: "9y70f",
|
|
70
|
+
gainsboro: "8m8kc",
|
|
71
|
+
ghostwhite: "9pq0v",
|
|
72
|
+
goldenrod: "8j4f4",
|
|
73
|
+
gold: "9zda8",
|
|
74
|
+
gray: "50i2o",
|
|
75
|
+
green: "pa8",
|
|
76
|
+
greenyellow: "6senj",
|
|
77
|
+
grey: "50i2o",
|
|
78
|
+
honeydew: "9eiuo",
|
|
79
|
+
hotpink: "9yrp0",
|
|
80
|
+
indianred: "80gnw",
|
|
81
|
+
indigo: "2xcoy",
|
|
82
|
+
ivory: "9zldc",
|
|
83
|
+
khaki: "9edu4",
|
|
84
|
+
lavenderblush: "9ziet",
|
|
85
|
+
lavender: "90c8q",
|
|
86
|
+
lawngreen: "4vk74",
|
|
87
|
+
lemonchiffon: "9zkct",
|
|
88
|
+
lightblue: "6s73a",
|
|
89
|
+
lightcoral: "9dtog",
|
|
90
|
+
lightcyan: "8s1rz",
|
|
91
|
+
lightgoldenrodyellow: "9sjiq",
|
|
92
|
+
lightgray: "89jo3",
|
|
93
|
+
lightgreen: "5nkwg",
|
|
94
|
+
lightgrey: "89jo3",
|
|
95
|
+
lightpink: "9z6wx",
|
|
96
|
+
lightsalmon: "9z2ii",
|
|
97
|
+
lightseagreen: "19xgq",
|
|
98
|
+
lightskyblue: "5arju",
|
|
99
|
+
lightslategray: "4nwk9",
|
|
100
|
+
lightslategrey: "4nwk9",
|
|
101
|
+
lightsteelblue: "6wau6",
|
|
102
|
+
lightyellow: "9zlcw",
|
|
103
|
+
lime: "1edc",
|
|
104
|
+
limegreen: "1zcxe",
|
|
105
|
+
linen: "9shk6",
|
|
106
|
+
magenta: "9y70f",
|
|
107
|
+
maroon: "4zsow",
|
|
108
|
+
mediumaquamarine: "40eju",
|
|
109
|
+
mediumblue: "5p",
|
|
110
|
+
mediumorchid: "79qkz",
|
|
111
|
+
mediumpurple: "5r3rv",
|
|
112
|
+
mediumseagreen: "2d9ip",
|
|
113
|
+
mediumslateblue: "4tcku",
|
|
114
|
+
mediumspringgreen: "1di2",
|
|
115
|
+
mediumturquoise: "2uabw",
|
|
116
|
+
mediumvioletred: "7rn9h",
|
|
117
|
+
midnightblue: "z980",
|
|
118
|
+
mintcream: "9ljp6",
|
|
119
|
+
mistyrose: "9zg0x",
|
|
120
|
+
moccasin: "9zfzp",
|
|
121
|
+
navajowhite: "9zest",
|
|
122
|
+
navy: "3k",
|
|
123
|
+
oldlace: "9wq92",
|
|
124
|
+
olive: "50hz4",
|
|
125
|
+
olivedrab: "472ub",
|
|
126
|
+
orange: "9z3eo",
|
|
127
|
+
orangered: "9ykg0",
|
|
128
|
+
orchid: "8iu3a",
|
|
129
|
+
palegoldenrod: "9bl4a",
|
|
130
|
+
palegreen: "5yw0o",
|
|
131
|
+
paleturquoise: "6v4ku",
|
|
132
|
+
palevioletred: "8k8lv",
|
|
133
|
+
papayawhip: "9zi6t",
|
|
134
|
+
peachpuff: "9ze0p",
|
|
135
|
+
peru: "80oqn",
|
|
136
|
+
pink: "9z8wb",
|
|
137
|
+
plum: "8nba5",
|
|
138
|
+
powderblue: "6wgdi",
|
|
139
|
+
purple: "4zssg",
|
|
140
|
+
rebeccapurple: "3zk49",
|
|
141
|
+
red: "9y6tc",
|
|
142
|
+
rosybrown: "7cv4f",
|
|
143
|
+
royalblue: "2jvtt",
|
|
144
|
+
saddlebrown: "5fmkz",
|
|
145
|
+
salmon: "9rvci",
|
|
146
|
+
sandybrown: "9jn1c",
|
|
147
|
+
seagreen: "1tdnb",
|
|
148
|
+
seashell: "9zje6",
|
|
149
|
+
sienna: "6973h",
|
|
150
|
+
silver: "7ir40",
|
|
151
|
+
skyblue: "5arjf",
|
|
152
|
+
slateblue: "45e4t",
|
|
153
|
+
slategray: "4e100",
|
|
154
|
+
slategrey: "4e100",
|
|
155
|
+
snow: "9zke2",
|
|
156
|
+
springgreen: "1egv",
|
|
157
|
+
steelblue: "2r1kk",
|
|
158
|
+
tan: "87yx8",
|
|
159
|
+
teal: "pds",
|
|
160
|
+
thistle: "8ggk8",
|
|
161
|
+
tomato: "9yqfb",
|
|
162
|
+
turquoise: "2j4r4",
|
|
163
|
+
violet: "9b10u",
|
|
164
|
+
wheat: "9ld4j",
|
|
165
|
+
white: "9zldr",
|
|
166
|
+
whitesmoke: "9lhpx",
|
|
167
|
+
yellow: "9zl6o",
|
|
168
|
+
yellowgreen: "61fzm"
|
|
169
|
+
}, u = Math.round;
|
|
170
|
+
function S(n, t) {
|
|
171
|
+
const e = n.replace(/^[^(]*\((.*)/, "$1").replace(/\).*/, "").match(/\d*\.?\d+%?/g) || [], r = e.map((i) => parseFloat(i));
|
|
172
|
+
for (let i = 0; i < 3; i += 1)
|
|
173
|
+
r[i] = t(r[i] || 0, e[i] || "", i);
|
|
174
|
+
return e[3] ? r[3] = e[3].includes("%") ? r[3] / 100 : r[3] : r[3] = 1, r;
|
|
175
|
+
}
|
|
176
|
+
const E = (n, t, e) => e === 0 ? n : n / 100;
|
|
177
|
+
function y(n, t) {
|
|
178
|
+
const e = t || 255;
|
|
179
|
+
return n > e ? e : n < 0 ? 0 : n;
|
|
180
|
+
}
|
|
181
|
+
class b {
|
|
182
|
+
constructor(t) {
|
|
183
|
+
/**
|
|
184
|
+
* All FastColor objects are valid. So isValid is always true. This property is kept to be compatible with TinyColor.
|
|
185
|
+
*/
|
|
186
|
+
f(this, "isValid", !0);
|
|
187
|
+
/**
|
|
188
|
+
* Red, R in RGB
|
|
189
|
+
*/
|
|
190
|
+
f(this, "r", 0);
|
|
191
|
+
/**
|
|
192
|
+
* Green, G in RGB
|
|
193
|
+
*/
|
|
194
|
+
f(this, "g", 0);
|
|
195
|
+
/**
|
|
196
|
+
* Blue, B in RGB
|
|
197
|
+
*/
|
|
198
|
+
f(this, "b", 0);
|
|
199
|
+
/**
|
|
200
|
+
* Alpha/Opacity, A in RGBA/HSLA
|
|
201
|
+
*/
|
|
202
|
+
f(this, "a", 1);
|
|
203
|
+
// HSV privates
|
|
204
|
+
f(this, "_h");
|
|
205
|
+
f(this, "_hsl_s");
|
|
206
|
+
f(this, "_hsv_s");
|
|
207
|
+
f(this, "_l");
|
|
208
|
+
f(this, "_v");
|
|
209
|
+
// intermediate variables to calculate HSL/HSV
|
|
210
|
+
f(this, "_max");
|
|
211
|
+
f(this, "_min");
|
|
212
|
+
f(this, "_brightness");
|
|
213
|
+
function e(r) {
|
|
214
|
+
return r[0] in t && r[1] in t && r[2] in t;
|
|
215
|
+
}
|
|
216
|
+
if (t) if (typeof t == "string") {
|
|
217
|
+
let i = function(s) {
|
|
218
|
+
return r.startsWith(s);
|
|
219
|
+
};
|
|
220
|
+
const r = t.trim();
|
|
221
|
+
if (/^#?[A-F\d]{3,8}$/i.test(r))
|
|
222
|
+
this.fromHexString(r);
|
|
223
|
+
else if (i("rgb"))
|
|
224
|
+
this.fromRgbString(r);
|
|
225
|
+
else if (i("hsl"))
|
|
226
|
+
this.fromHslString(r);
|
|
227
|
+
else if (i("hsv") || i("hsb"))
|
|
228
|
+
this.fromHsvString(r);
|
|
229
|
+
else {
|
|
230
|
+
const s = ct[r.toLowerCase()];
|
|
231
|
+
s && this.fromHexString(
|
|
232
|
+
// Convert 36 hex to 16 hex
|
|
233
|
+
parseInt(s, 36).toString(16).padStart(6, "0")
|
|
234
|
+
);
|
|
235
|
+
}
|
|
236
|
+
} else if (t instanceof b)
|
|
237
|
+
this.r = t.r, this.g = t.g, this.b = t.b, this.a = t.a, this._h = t._h, this._hsl_s = t._hsl_s, this._hsv_s = t._hsv_s, this._l = t._l, this._v = t._v;
|
|
238
|
+
else if (e("rgb"))
|
|
239
|
+
this.r = y(t.r), this.g = y(t.g), this.b = y(t.b), this.a = typeof t.a == "number" ? y(t.a, 1) : 1;
|
|
240
|
+
else if (e("hsl"))
|
|
241
|
+
this.fromHsl(t);
|
|
242
|
+
else if (e("hsv"))
|
|
243
|
+
this.fromHsv(t);
|
|
244
|
+
else
|
|
245
|
+
throw new Error("@ant-design/fast-color: unsupported input " + JSON.stringify(t));
|
|
246
|
+
}
|
|
247
|
+
// ======================= Setter =======================
|
|
248
|
+
setR(t) {
|
|
249
|
+
return this._sc("r", t);
|
|
250
|
+
}
|
|
251
|
+
setG(t) {
|
|
252
|
+
return this._sc("g", t);
|
|
253
|
+
}
|
|
254
|
+
setB(t) {
|
|
255
|
+
return this._sc("b", t);
|
|
256
|
+
}
|
|
257
|
+
setA(t) {
|
|
258
|
+
return this._sc("a", t, 1);
|
|
259
|
+
}
|
|
260
|
+
setHue(t) {
|
|
261
|
+
const e = this.toHsv();
|
|
262
|
+
return e.h = t, this._c(e);
|
|
263
|
+
}
|
|
264
|
+
// ======================= Getter =======================
|
|
265
|
+
/**
|
|
266
|
+
* Returns the perceived luminance of a color, from 0-1.
|
|
267
|
+
* @see http://www.w3.org/TR/2008/REC-WCAG20-20081211/#relativeluminancedef
|
|
268
|
+
*/
|
|
269
|
+
getLuminance() {
|
|
270
|
+
function t(s) {
|
|
271
|
+
const o = s / 255;
|
|
272
|
+
return o <= 0.03928 ? o / 12.92 : Math.pow((o + 0.055) / 1.055, 2.4);
|
|
273
|
+
}
|
|
274
|
+
const e = t(this.r), r = t(this.g), i = t(this.b);
|
|
275
|
+
return 0.2126 * e + 0.7152 * r + 0.0722 * i;
|
|
276
|
+
}
|
|
277
|
+
getHue() {
|
|
278
|
+
if (typeof this._h > "u") {
|
|
279
|
+
const t = this.getMax() - this.getMin();
|
|
280
|
+
t === 0 ? this._h = 0 : this._h = u(60 * (this.r === this.getMax() ? (this.g - this.b) / t + (this.g < this.b ? 6 : 0) : this.g === this.getMax() ? (this.b - this.r) / t + 2 : (this.r - this.g) / t + 4));
|
|
281
|
+
}
|
|
282
|
+
return this._h;
|
|
283
|
+
}
|
|
284
|
+
/**
|
|
285
|
+
* @deprecated should use getHSVSaturation or getHSLSaturation instead
|
|
286
|
+
*/
|
|
287
|
+
getSaturation() {
|
|
288
|
+
return this.getHSVSaturation();
|
|
289
|
+
}
|
|
290
|
+
getHSVSaturation() {
|
|
291
|
+
if (typeof this._hsv_s > "u") {
|
|
292
|
+
const t = this.getMax() - this.getMin();
|
|
293
|
+
t === 0 ? this._hsv_s = 0 : this._hsv_s = t / this.getMax();
|
|
294
|
+
}
|
|
295
|
+
return this._hsv_s;
|
|
296
|
+
}
|
|
297
|
+
getHSLSaturation() {
|
|
298
|
+
if (typeof this._hsl_s > "u") {
|
|
299
|
+
const t = this.getMax() - this.getMin();
|
|
300
|
+
if (t === 0)
|
|
301
|
+
this._hsl_s = 0;
|
|
302
|
+
else {
|
|
303
|
+
const e = this.getLightness();
|
|
304
|
+
this._hsl_s = t / 255 / (1 - Math.abs(2 * e - 1));
|
|
305
|
+
}
|
|
306
|
+
}
|
|
307
|
+
return this._hsl_s;
|
|
308
|
+
}
|
|
309
|
+
getLightness() {
|
|
310
|
+
return typeof this._l > "u" && (this._l = (this.getMax() + this.getMin()) / 510), this._l;
|
|
311
|
+
}
|
|
312
|
+
getValue() {
|
|
313
|
+
return typeof this._v > "u" && (this._v = this.getMax() / 255), this._v;
|
|
314
|
+
}
|
|
315
|
+
/**
|
|
316
|
+
* Returns the perceived brightness of the color, from 0-255.
|
|
317
|
+
* Note: this is not the b of HSB
|
|
318
|
+
* @see http://www.w3.org/TR/AERT#color-contrast
|
|
319
|
+
*/
|
|
320
|
+
getBrightness() {
|
|
321
|
+
return typeof this._brightness > "u" && (this._brightness = (this.r * 299 + this.g * 587 + this.b * 114) / 1e3), this._brightness;
|
|
322
|
+
}
|
|
323
|
+
// ======================== Func ========================
|
|
324
|
+
darken(t = 10) {
|
|
325
|
+
const e = this.getHue(), r = this.getSaturation();
|
|
326
|
+
let i = this.getLightness() - t / 100;
|
|
327
|
+
return i < 0 && (i = 0), this._c({
|
|
328
|
+
h: e,
|
|
329
|
+
s: r,
|
|
330
|
+
l: i,
|
|
331
|
+
a: this.a
|
|
332
|
+
});
|
|
333
|
+
}
|
|
334
|
+
lighten(t = 10) {
|
|
335
|
+
const e = this.getHue(), r = this.getSaturation();
|
|
336
|
+
let i = this.getLightness() + t / 100;
|
|
337
|
+
return i > 1 && (i = 1), this._c({
|
|
338
|
+
h: e,
|
|
339
|
+
s: r,
|
|
340
|
+
l: i,
|
|
341
|
+
a: this.a
|
|
342
|
+
});
|
|
343
|
+
}
|
|
344
|
+
/**
|
|
345
|
+
* Mix the current color a given amount with another color, from 0 to 100.
|
|
346
|
+
* 0 means no mixing (return current color).
|
|
347
|
+
*/
|
|
348
|
+
mix(t, e = 50) {
|
|
349
|
+
const r = this._c(t), i = e / 100, s = (l) => (r[l] - this[l]) * i + this[l], o = {
|
|
350
|
+
r: u(s("r")),
|
|
351
|
+
g: u(s("g")),
|
|
352
|
+
b: u(s("b")),
|
|
353
|
+
a: u(s("a") * 100) / 100
|
|
354
|
+
};
|
|
355
|
+
return this._c(o);
|
|
356
|
+
}
|
|
357
|
+
/**
|
|
358
|
+
* Mix the color with pure white, from 0 to 100.
|
|
359
|
+
* Providing 0 will do nothing, providing 100 will always return white.
|
|
360
|
+
*/
|
|
361
|
+
tint(t = 10) {
|
|
362
|
+
return this.mix({
|
|
363
|
+
r: 255,
|
|
364
|
+
g: 255,
|
|
365
|
+
b: 255,
|
|
366
|
+
a: 1
|
|
367
|
+
}, t);
|
|
368
|
+
}
|
|
369
|
+
/**
|
|
370
|
+
* Mix the color with pure black, from 0 to 100.
|
|
371
|
+
* Providing 0 will do nothing, providing 100 will always return black.
|
|
372
|
+
*/
|
|
373
|
+
shade(t = 10) {
|
|
374
|
+
return this.mix({
|
|
375
|
+
r: 0,
|
|
376
|
+
g: 0,
|
|
377
|
+
b: 0,
|
|
378
|
+
a: 1
|
|
379
|
+
}, t);
|
|
380
|
+
}
|
|
381
|
+
onBackground(t) {
|
|
382
|
+
const e = this._c(t), r = this.a + e.a * (1 - this.a), i = (s) => u((this[s] * this.a + e[s] * e.a * (1 - this.a)) / r);
|
|
383
|
+
return this._c({
|
|
384
|
+
r: i("r"),
|
|
385
|
+
g: i("g"),
|
|
386
|
+
b: i("b"),
|
|
387
|
+
a: r
|
|
388
|
+
});
|
|
389
|
+
}
|
|
390
|
+
// ======================= Status =======================
|
|
391
|
+
isDark() {
|
|
392
|
+
return this.getBrightness() < 128;
|
|
393
|
+
}
|
|
394
|
+
isLight() {
|
|
395
|
+
return this.getBrightness() >= 128;
|
|
396
|
+
}
|
|
397
|
+
// ======================== MISC ========================
|
|
398
|
+
equals(t) {
|
|
399
|
+
return this.r === t.r && this.g === t.g && this.b === t.b && this.a === t.a;
|
|
400
|
+
}
|
|
401
|
+
clone() {
|
|
402
|
+
return this._c(this);
|
|
403
|
+
}
|
|
404
|
+
// ======================= Format =======================
|
|
405
|
+
toHexString() {
|
|
406
|
+
let t = "#";
|
|
407
|
+
const e = (this.r || 0).toString(16);
|
|
408
|
+
t += e.length === 2 ? e : "0" + e;
|
|
409
|
+
const r = (this.g || 0).toString(16);
|
|
410
|
+
t += r.length === 2 ? r : "0" + r;
|
|
411
|
+
const i = (this.b || 0).toString(16);
|
|
412
|
+
if (t += i.length === 2 ? i : "0" + i, typeof this.a == "number" && this.a >= 0 && this.a < 1) {
|
|
413
|
+
const s = u(this.a * 255).toString(16);
|
|
414
|
+
t += s.length === 2 ? s : "0" + s;
|
|
415
|
+
}
|
|
416
|
+
return t;
|
|
417
|
+
}
|
|
418
|
+
/** CSS support color pattern */
|
|
419
|
+
toHsl() {
|
|
420
|
+
return {
|
|
421
|
+
h: this.getHue(),
|
|
422
|
+
s: this.getHSLSaturation(),
|
|
423
|
+
l: this.getLightness(),
|
|
424
|
+
a: this.a
|
|
425
|
+
};
|
|
426
|
+
}
|
|
427
|
+
/** CSS support color pattern */
|
|
428
|
+
toHslString() {
|
|
429
|
+
const t = this.getHue(), e = u(this.getHSLSaturation() * 100), r = u(this.getLightness() * 100);
|
|
430
|
+
return this.a !== 1 ? `hsla(${t},${e}%,${r}%,${this.a})` : `hsl(${t},${e}%,${r}%)`;
|
|
431
|
+
}
|
|
432
|
+
/** Same as toHsb */
|
|
433
|
+
toHsv() {
|
|
434
|
+
return {
|
|
435
|
+
h: this.getHue(),
|
|
436
|
+
s: this.getHSVSaturation(),
|
|
437
|
+
v: this.getValue(),
|
|
438
|
+
a: this.a
|
|
439
|
+
};
|
|
440
|
+
}
|
|
441
|
+
toRgb() {
|
|
442
|
+
return {
|
|
443
|
+
r: this.r,
|
|
444
|
+
g: this.g,
|
|
445
|
+
b: this.b,
|
|
446
|
+
a: this.a
|
|
447
|
+
};
|
|
448
|
+
}
|
|
449
|
+
toRgbString() {
|
|
450
|
+
return this.a !== 1 ? `rgba(${this.r},${this.g},${this.b},${this.a})` : `rgb(${this.r},${this.g},${this.b})`;
|
|
451
|
+
}
|
|
452
|
+
toString() {
|
|
453
|
+
return this.toRgbString();
|
|
454
|
+
}
|
|
455
|
+
// ====================== Privates ======================
|
|
456
|
+
/** Return a new FastColor object with one channel changed */
|
|
457
|
+
_sc(t, e, r) {
|
|
458
|
+
const i = this.clone();
|
|
459
|
+
return i[t] = y(e, r), i;
|
|
460
|
+
}
|
|
461
|
+
_c(t) {
|
|
462
|
+
return new this.constructor(t);
|
|
463
|
+
}
|
|
464
|
+
getMax() {
|
|
465
|
+
return typeof this._max > "u" && (this._max = Math.max(this.r, this.g, this.b)), this._max;
|
|
466
|
+
}
|
|
467
|
+
getMin() {
|
|
468
|
+
return typeof this._min > "u" && (this._min = Math.min(this.r, this.g, this.b)), this._min;
|
|
469
|
+
}
|
|
470
|
+
fromHexString(t) {
|
|
471
|
+
const e = t.replace("#", "");
|
|
472
|
+
function r(i, s) {
|
|
473
|
+
return parseInt(e[i] + e[s || i], 16);
|
|
474
|
+
}
|
|
475
|
+
e.length < 6 ? (this.r = r(0), this.g = r(1), this.b = r(2), this.a = e[3] ? r(3) / 255 : 1) : (this.r = r(0, 1), this.g = r(2, 3), this.b = r(4, 5), this.a = e[6] ? r(6, 7) / 255 : 1);
|
|
476
|
+
}
|
|
477
|
+
fromHsl({
|
|
478
|
+
h: t,
|
|
479
|
+
s: e,
|
|
480
|
+
l: r,
|
|
481
|
+
a: i
|
|
482
|
+
}) {
|
|
483
|
+
const s = (t % 360 + 360) % 360;
|
|
484
|
+
if (this._h = s, this._hsl_s = e, this._l = r, this.a = typeof i == "number" ? i : 1, e <= 0) {
|
|
485
|
+
const m = u(r * 255);
|
|
486
|
+
this.r = m, this.g = m, this.b = m;
|
|
487
|
+
return;
|
|
488
|
+
}
|
|
489
|
+
let o = 0, l = 0, h = 0;
|
|
490
|
+
const c = s / 60, a = (1 - Math.abs(2 * r - 1)) * e, g = a * (1 - Math.abs(c % 2 - 1));
|
|
491
|
+
c >= 0 && c < 1 ? (o = a, l = g) : c >= 1 && c < 2 ? (o = g, l = a) : c >= 2 && c < 3 ? (l = a, h = g) : c >= 3 && c < 4 ? (l = g, h = a) : c >= 4 && c < 5 ? (o = g, h = a) : c >= 5 && c < 6 && (o = a, h = g);
|
|
492
|
+
const d = r - a / 2;
|
|
493
|
+
this.r = u((o + d) * 255), this.g = u((l + d) * 255), this.b = u((h + d) * 255);
|
|
494
|
+
}
|
|
495
|
+
fromHsv({
|
|
496
|
+
h: t,
|
|
497
|
+
s: e,
|
|
498
|
+
v: r,
|
|
499
|
+
a: i
|
|
500
|
+
}) {
|
|
501
|
+
const s = (t % 360 + 360) % 360;
|
|
502
|
+
this._h = s, this._hsv_s = e, this._v = r, this.a = typeof i == "number" ? i : 1;
|
|
503
|
+
const o = u(r * 255);
|
|
504
|
+
if (this.r = o, this.g = o, this.b = o, e <= 0)
|
|
505
|
+
return;
|
|
506
|
+
const l = s / 60, h = Math.floor(l), c = l - h, a = u(r * (1 - e) * 255), g = u(r * (1 - e * c) * 255), d = u(r * (1 - e * (1 - c)) * 255);
|
|
507
|
+
switch (h) {
|
|
508
|
+
case 0:
|
|
509
|
+
this.g = d, this.b = a;
|
|
510
|
+
break;
|
|
511
|
+
case 1:
|
|
512
|
+
this.r = g, this.b = a;
|
|
513
|
+
break;
|
|
514
|
+
case 2:
|
|
515
|
+
this.r = a, this.b = d;
|
|
516
|
+
break;
|
|
517
|
+
case 3:
|
|
518
|
+
this.r = a, this.g = g;
|
|
519
|
+
break;
|
|
520
|
+
case 4:
|
|
521
|
+
this.r = d, this.g = a;
|
|
522
|
+
break;
|
|
523
|
+
case 5:
|
|
524
|
+
default:
|
|
525
|
+
this.g = a, this.b = g;
|
|
526
|
+
break;
|
|
527
|
+
}
|
|
528
|
+
}
|
|
529
|
+
fromHsvString(t) {
|
|
530
|
+
const e = S(t, E);
|
|
531
|
+
this.fromHsv({
|
|
532
|
+
h: e[0],
|
|
533
|
+
s: e[1],
|
|
534
|
+
v: e[2],
|
|
535
|
+
a: e[3]
|
|
536
|
+
});
|
|
537
|
+
}
|
|
538
|
+
fromHslString(t) {
|
|
539
|
+
const e = S(t, E);
|
|
540
|
+
this.fromHsl({
|
|
541
|
+
h: e[0],
|
|
542
|
+
s: e[1],
|
|
543
|
+
l: e[2],
|
|
544
|
+
a: e[3]
|
|
545
|
+
});
|
|
546
|
+
}
|
|
547
|
+
fromRgbString(t) {
|
|
548
|
+
const e = S(t, (r, i) => (
|
|
549
|
+
// Convert percentage to number. e.g. 50% -> 128
|
|
550
|
+
i.includes("%") ? u(r / 100 * 255) : r
|
|
551
|
+
));
|
|
552
|
+
this.r = e[0], this.g = e[1], this.b = e[2], this.a = e[3];
|
|
553
|
+
}
|
|
554
|
+
}
|
|
555
|
+
const x = 2, q = 0.16, ht = 0.05, ut = 0.05, gt = 0.15, F = 5, Q = 4, ft = [{
|
|
556
|
+
index: 7,
|
|
557
|
+
amount: 15
|
|
558
|
+
}, {
|
|
559
|
+
index: 6,
|
|
560
|
+
amount: 25
|
|
561
|
+
}, {
|
|
562
|
+
index: 5,
|
|
563
|
+
amount: 30
|
|
564
|
+
}, {
|
|
565
|
+
index: 5,
|
|
566
|
+
amount: 45
|
|
567
|
+
}, {
|
|
568
|
+
index: 5,
|
|
569
|
+
amount: 65
|
|
570
|
+
}, {
|
|
571
|
+
index: 5,
|
|
572
|
+
amount: 85
|
|
573
|
+
}, {
|
|
574
|
+
index: 4,
|
|
575
|
+
amount: 90
|
|
576
|
+
}, {
|
|
577
|
+
index: 3,
|
|
578
|
+
amount: 95
|
|
579
|
+
}, {
|
|
580
|
+
index: 2,
|
|
581
|
+
amount: 97
|
|
582
|
+
}, {
|
|
583
|
+
index: 1,
|
|
584
|
+
amount: 98
|
|
585
|
+
}];
|
|
586
|
+
function L(n, t, e) {
|
|
587
|
+
let r;
|
|
588
|
+
return Math.round(n.h) >= 60 && Math.round(n.h) <= 240 ? r = e ? Math.round(n.h) - x * t : Math.round(n.h) + x * t : r = e ? Math.round(n.h) + x * t : Math.round(n.h) - x * t, r < 0 ? r += 360 : r >= 360 && (r -= 360), r;
|
|
589
|
+
}
|
|
590
|
+
function A(n, t, e) {
|
|
591
|
+
if (n.h === 0 && n.s === 0)
|
|
592
|
+
return n.s;
|
|
593
|
+
let r;
|
|
594
|
+
return e ? r = n.s - q * t : t === Q ? r = n.s + q : r = n.s + ht * t, r > 1 && (r = 1), e && t === F && r > 0.1 && (r = 0.1), r < 0.06 && (r = 0.06), Math.round(r * 100) / 100;
|
|
595
|
+
}
|
|
596
|
+
function I(n, t, e) {
|
|
597
|
+
let r;
|
|
598
|
+
return e ? r = n.v + ut * t : r = n.v - gt * t, r = Math.max(0, Math.min(1, r)), Math.round(r * 100) / 100;
|
|
599
|
+
}
|
|
600
|
+
function dt(n, t = {}) {
|
|
601
|
+
const e = [], r = new b(n), i = r.toHsv();
|
|
602
|
+
for (let s = F; s > 0; s -= 1) {
|
|
603
|
+
const o = new b({
|
|
604
|
+
h: L(i, s, !0),
|
|
605
|
+
s: A(i, s, !0),
|
|
606
|
+
v: I(i, s, !0)
|
|
607
|
+
});
|
|
608
|
+
e.push(o);
|
|
609
|
+
}
|
|
610
|
+
e.push(r);
|
|
611
|
+
for (let s = 1; s <= Q; s += 1) {
|
|
612
|
+
const o = new b({
|
|
613
|
+
h: L(i, s),
|
|
614
|
+
s: A(i, s),
|
|
615
|
+
v: I(i, s)
|
|
616
|
+
});
|
|
617
|
+
e.push(o);
|
|
618
|
+
}
|
|
619
|
+
return t.theme === "dark" ? ft.map(({
|
|
620
|
+
index: s,
|
|
621
|
+
amount: o
|
|
622
|
+
}) => new b(t.backgroundColor || "#141414").mix(e[s], o).toHexString()) : e.map((s) => s.toHexString());
|
|
623
|
+
}
|
|
624
|
+
const v = ["#e6f4ff", "#bae0ff", "#91caff", "#69b1ff", "#4096ff", "#1677ff", "#0958d9", "#003eb3", "#002c8c", "#001d66"];
|
|
625
|
+
v.primary = v[5];
|
|
626
|
+
function mt() {
|
|
627
|
+
return !!(typeof window < "u" && window.document && window.document.createElement);
|
|
628
|
+
}
|
|
629
|
+
function bt(n, t) {
|
|
630
|
+
if (!n)
|
|
631
|
+
return !1;
|
|
632
|
+
if (n.contains)
|
|
633
|
+
return n.contains(t);
|
|
634
|
+
let e = t;
|
|
635
|
+
for (; e; ) {
|
|
636
|
+
if (e === n)
|
|
637
|
+
return !0;
|
|
638
|
+
e = e.parentNode;
|
|
639
|
+
}
|
|
640
|
+
return !1;
|
|
641
|
+
}
|
|
642
|
+
const O = "data-rc-order", P = "data-rc-priority", pt = "rc-util-key", C = /* @__PURE__ */ new Map();
|
|
643
|
+
function G({
|
|
644
|
+
mark: n
|
|
645
|
+
} = {}) {
|
|
646
|
+
return n ? n.startsWith("data-") ? n : `data-${n}` : pt;
|
|
647
|
+
}
|
|
648
|
+
function $(n) {
|
|
649
|
+
return n.attachTo ? n.attachTo : document.querySelector("head") || document.body;
|
|
650
|
+
}
|
|
651
|
+
function yt(n) {
|
|
652
|
+
return n === "queue" ? "prependQueue" : n ? "prepend" : "append";
|
|
653
|
+
}
|
|
654
|
+
function T(n) {
|
|
655
|
+
return Array.from((C.get(n) || n).children).filter((t) => t.tagName === "STYLE");
|
|
656
|
+
}
|
|
657
|
+
function Y(n, t = {}) {
|
|
658
|
+
if (!mt())
|
|
659
|
+
return null;
|
|
660
|
+
const {
|
|
661
|
+
csp: e,
|
|
662
|
+
prepend: r,
|
|
663
|
+
priority: i = 0
|
|
664
|
+
} = t, s = yt(r), o = s === "prependQueue", l = document.createElement("style");
|
|
665
|
+
l.setAttribute(O, s), o && i && l.setAttribute(P, `${i}`), e != null && e.nonce && (l.nonce = e == null ? void 0 : e.nonce), l.innerHTML = n;
|
|
666
|
+
const h = $(t), {
|
|
667
|
+
firstChild: c
|
|
668
|
+
} = h;
|
|
669
|
+
if (r) {
|
|
670
|
+
if (o) {
|
|
671
|
+
const a = (t.styles || T(h)).filter((g) => {
|
|
672
|
+
if (!["prepend", "prependQueue"].includes(g.getAttribute(O)))
|
|
673
|
+
return !1;
|
|
674
|
+
const d = Number(g.getAttribute(P) || 0);
|
|
675
|
+
return i >= d;
|
|
676
|
+
});
|
|
677
|
+
if (a.length)
|
|
678
|
+
return h.insertBefore(l, a[a.length - 1].nextSibling), l;
|
|
679
|
+
}
|
|
680
|
+
h.insertBefore(l, c);
|
|
681
|
+
} else
|
|
682
|
+
h.appendChild(l);
|
|
683
|
+
return l;
|
|
684
|
+
}
|
|
685
|
+
function _t(n, t = {}) {
|
|
686
|
+
let {
|
|
687
|
+
styles: e
|
|
688
|
+
} = t;
|
|
689
|
+
return e || (e = T($(t))), e.find((r) => r.getAttribute(G(t)) === n);
|
|
690
|
+
}
|
|
691
|
+
function wt(n, t) {
|
|
692
|
+
const e = C.get(n);
|
|
693
|
+
if (!e || !bt(document, e)) {
|
|
694
|
+
const r = Y("", t), {
|
|
695
|
+
parentNode: i
|
|
696
|
+
} = r;
|
|
697
|
+
C.set(n, i), n.removeChild(r);
|
|
698
|
+
}
|
|
699
|
+
}
|
|
700
|
+
function xt(n, t, e = {}) {
|
|
701
|
+
var h, c, a;
|
|
702
|
+
const r = $(e), i = T(r), s = {
|
|
703
|
+
...e,
|
|
704
|
+
styles: i
|
|
705
|
+
};
|
|
706
|
+
wt(r, s);
|
|
707
|
+
const o = _t(t, s);
|
|
708
|
+
if (o)
|
|
709
|
+
return (h = s.csp) != null && h.nonce && o.nonce !== ((c = s.csp) == null ? void 0 : c.nonce) && (o.nonce = (a = s.csp) == null ? void 0 : a.nonce), o.innerHTML !== n && (o.innerHTML = n), o;
|
|
710
|
+
const l = Y(n, s);
|
|
711
|
+
return l.setAttribute(G(s), t), l;
|
|
712
|
+
}
|
|
713
|
+
function K(n) {
|
|
714
|
+
var t;
|
|
715
|
+
return (t = n == null ? void 0 : n.getRootNode) == null ? void 0 : t.call(n);
|
|
716
|
+
}
|
|
717
|
+
function kt(n) {
|
|
718
|
+
return K(n) instanceof ShadowRoot;
|
|
719
|
+
}
|
|
720
|
+
function St(n) {
|
|
721
|
+
return kt(n) ? K(n) : null;
|
|
722
|
+
}
|
|
723
|
+
let z = {};
|
|
724
|
+
const N = [], vt = (n) => {
|
|
725
|
+
N.push(n);
|
|
726
|
+
};
|
|
727
|
+
function Ct(n, t) {
|
|
728
|
+
if (process.env.NODE_ENV !== "production" && !n && console !== void 0) {
|
|
729
|
+
const e = N.reduce((r, i) => i(r ?? "", "warning"), t);
|
|
730
|
+
e && console.error(`Warning: ${e}`);
|
|
731
|
+
}
|
|
732
|
+
}
|
|
733
|
+
function zt(n, t) {
|
|
734
|
+
if (process.env.NODE_ENV !== "production" && !n && console !== void 0) {
|
|
735
|
+
const e = N.reduce((r, i) => i(r ?? "", "note"), t);
|
|
736
|
+
e && console.warn(`Note: ${e}`);
|
|
737
|
+
}
|
|
738
|
+
}
|
|
739
|
+
function Mt() {
|
|
740
|
+
z = {};
|
|
741
|
+
}
|
|
742
|
+
function U(n, t, e) {
|
|
743
|
+
!t && !z[e] && (n(!1, e), z[e] = !0);
|
|
744
|
+
}
|
|
745
|
+
function k(n, t) {
|
|
746
|
+
U(Ct, n, t);
|
|
747
|
+
}
|
|
748
|
+
function Ht(n, t) {
|
|
749
|
+
U(zt, n, t);
|
|
750
|
+
}
|
|
751
|
+
k.preMessage = vt;
|
|
752
|
+
k.resetWarned = Mt;
|
|
753
|
+
k.noteOnce = Ht;
|
|
754
|
+
function $t(n) {
|
|
755
|
+
return n.replace(/-(.)/g, (t, e) => e.toUpperCase());
|
|
756
|
+
}
|
|
757
|
+
function Tt(n, t) {
|
|
758
|
+
k(n, `[@ant-design/icons] ${t}`);
|
|
759
|
+
}
|
|
760
|
+
function V(n) {
|
|
761
|
+
return typeof n == "object" && typeof n.name == "string" && typeof n.theme == "string" && (typeof n.icon == "object" || typeof n.icon == "function");
|
|
762
|
+
}
|
|
763
|
+
function B(n = {}) {
|
|
764
|
+
return Object.keys(n).reduce((t, e) => {
|
|
765
|
+
const r = n[e];
|
|
766
|
+
switch (e) {
|
|
767
|
+
case "class":
|
|
768
|
+
t.className = r, delete t.class;
|
|
769
|
+
break;
|
|
770
|
+
default:
|
|
771
|
+
delete t[e], t[$t(e)] = r;
|
|
772
|
+
}
|
|
773
|
+
return t;
|
|
774
|
+
}, {});
|
|
775
|
+
}
|
|
776
|
+
function M(n, t, e) {
|
|
777
|
+
return e ? /* @__PURE__ */ R.createElement(n.tag, {
|
|
778
|
+
key: t,
|
|
779
|
+
...B(n.attrs),
|
|
780
|
+
...e
|
|
781
|
+
}, (n.children || []).map((r, i) => M(r, `${t}-${n.tag}-${i}`))) : /* @__PURE__ */ R.createElement(n.tag, {
|
|
782
|
+
key: t,
|
|
783
|
+
...B(n.attrs)
|
|
784
|
+
}, (n.children || []).map((r, i) => M(r, `${t}-${n.tag}-${i}`)));
|
|
785
|
+
}
|
|
786
|
+
function J(n) {
|
|
787
|
+
return dt(n)[0];
|
|
788
|
+
}
|
|
789
|
+
function X(n) {
|
|
790
|
+
return n ? Array.isArray(n) ? n : [n] : [];
|
|
791
|
+
}
|
|
792
|
+
const Nt = `
|
|
793
|
+
.anticon {
|
|
794
|
+
display: inline-flex;
|
|
795
|
+
align-items: center;
|
|
796
|
+
color: inherit;
|
|
797
|
+
font-style: normal;
|
|
798
|
+
line-height: 0;
|
|
799
|
+
text-align: center;
|
|
800
|
+
text-transform: none;
|
|
801
|
+
vertical-align: -0.125em;
|
|
802
|
+
text-rendering: optimizeLegibility;
|
|
803
|
+
-webkit-font-smoothing: antialiased;
|
|
804
|
+
-moz-osx-font-smoothing: grayscale;
|
|
805
|
+
}
|
|
806
|
+
|
|
807
|
+
.anticon > * {
|
|
808
|
+
line-height: 1;
|
|
809
|
+
}
|
|
810
|
+
|
|
811
|
+
.anticon svg {
|
|
812
|
+
display: inline-block;
|
|
813
|
+
vertical-align: inherit;
|
|
814
|
+
}
|
|
815
|
+
|
|
816
|
+
.anticon::before {
|
|
817
|
+
display: none;
|
|
818
|
+
}
|
|
819
|
+
|
|
820
|
+
.anticon .anticon-icon {
|
|
821
|
+
display: block;
|
|
822
|
+
}
|
|
823
|
+
|
|
824
|
+
.anticon[tabindex] {
|
|
825
|
+
cursor: pointer;
|
|
826
|
+
}
|
|
827
|
+
|
|
828
|
+
.anticon-spin {
|
|
829
|
+
-webkit-animation: loadingCircle 1s infinite linear;
|
|
830
|
+
animation: loadingCircle 1s infinite linear;
|
|
831
|
+
}
|
|
832
|
+
|
|
833
|
+
@-webkit-keyframes loadingCircle {
|
|
834
|
+
100% {
|
|
835
|
+
-webkit-transform: rotate(360deg);
|
|
836
|
+
transform: rotate(360deg);
|
|
837
|
+
}
|
|
838
|
+
}
|
|
839
|
+
|
|
840
|
+
@keyframes loadingCircle {
|
|
841
|
+
100% {
|
|
842
|
+
-webkit-transform: rotate(360deg);
|
|
843
|
+
transform: rotate(360deg);
|
|
844
|
+
}
|
|
845
|
+
}
|
|
846
|
+
`, jt = (n) => {
|
|
847
|
+
const {
|
|
848
|
+
csp: t,
|
|
849
|
+
prefixCls: e,
|
|
850
|
+
layer: r
|
|
851
|
+
} = ot(D);
|
|
852
|
+
let i = Nt;
|
|
853
|
+
e && (i = i.replace(/anticon/g, e)), r && (i = `@layer ${r} {
|
|
854
|
+
${i}
|
|
855
|
+
}`), at(() => {
|
|
856
|
+
const s = n.current, o = St(s);
|
|
857
|
+
xt(i, "@ant-design-icons", {
|
|
858
|
+
prepend: !r,
|
|
859
|
+
csp: t,
|
|
860
|
+
attachTo: o
|
|
861
|
+
});
|
|
862
|
+
}, []);
|
|
863
|
+
}, w = {
|
|
864
|
+
primaryColor: "#333",
|
|
865
|
+
secondaryColor: "#E6E6E6",
|
|
866
|
+
calculated: !1
|
|
867
|
+
};
|
|
868
|
+
function Rt({
|
|
869
|
+
primaryColor: n,
|
|
870
|
+
secondaryColor: t
|
|
871
|
+
}) {
|
|
872
|
+
w.primaryColor = n, w.secondaryColor = t || J(n), w.calculated = !!t;
|
|
873
|
+
}
|
|
874
|
+
function Et() {
|
|
875
|
+
return {
|
|
876
|
+
...w
|
|
877
|
+
};
|
|
878
|
+
}
|
|
879
|
+
const p = (n) => {
|
|
880
|
+
const {
|
|
881
|
+
icon: t,
|
|
882
|
+
className: e,
|
|
883
|
+
onClick: r,
|
|
884
|
+
style: i,
|
|
885
|
+
primaryColor: s,
|
|
886
|
+
secondaryColor: o,
|
|
887
|
+
...l
|
|
888
|
+
} = n, h = _.useRef(null);
|
|
889
|
+
let c = w;
|
|
890
|
+
if (s && (c = {
|
|
891
|
+
primaryColor: s,
|
|
892
|
+
secondaryColor: o || J(s)
|
|
893
|
+
}), jt(h), Tt(V(t), `icon should be icon definiton, but got ${t}`), !V(t))
|
|
894
|
+
return null;
|
|
895
|
+
let a = t;
|
|
896
|
+
return a && typeof a.icon == "function" && (a = {
|
|
897
|
+
...a,
|
|
898
|
+
icon: a.icon(c.primaryColor, c.secondaryColor)
|
|
899
|
+
}), M(a.icon, `svg-${a.name}`, {
|
|
900
|
+
className: e,
|
|
901
|
+
onClick: r,
|
|
902
|
+
style: i,
|
|
903
|
+
"data-icon": a.name,
|
|
904
|
+
width: "1em",
|
|
905
|
+
height: "1em",
|
|
906
|
+
fill: "currentColor",
|
|
907
|
+
"aria-hidden": "true",
|
|
908
|
+
...l,
|
|
909
|
+
ref: h
|
|
910
|
+
});
|
|
911
|
+
};
|
|
912
|
+
p.displayName = "IconReact";
|
|
913
|
+
p.getTwoToneColors = Et;
|
|
914
|
+
p.setTwoToneColors = Rt;
|
|
915
|
+
function Z(n) {
|
|
916
|
+
const [t, e] = X(n);
|
|
917
|
+
return p.setTwoToneColors({
|
|
918
|
+
primaryColor: t,
|
|
919
|
+
secondaryColor: e
|
|
920
|
+
});
|
|
921
|
+
}
|
|
922
|
+
function qt() {
|
|
923
|
+
const n = p.getTwoToneColors();
|
|
924
|
+
return n.calculated ? [n.primaryColor, n.secondaryColor] : n.primaryColor;
|
|
925
|
+
}
|
|
926
|
+
function H() {
|
|
927
|
+
return H = Object.assign ? Object.assign.bind() : function(n) {
|
|
928
|
+
for (var t = 1; t < arguments.length; t++) {
|
|
929
|
+
var e = arguments[t];
|
|
930
|
+
for (var r in e)
|
|
931
|
+
Object.prototype.hasOwnProperty.call(e, r) && (n[r] = e[r]);
|
|
932
|
+
}
|
|
933
|
+
return n;
|
|
934
|
+
}, H.apply(this, arguments);
|
|
935
|
+
}
|
|
936
|
+
Z(v.primary);
|
|
937
|
+
const j = /* @__PURE__ */ _.forwardRef((n, t) => {
|
|
938
|
+
const {
|
|
939
|
+
// affect outter <i>...</i>
|
|
940
|
+
className: e,
|
|
941
|
+
// affect inner <svg>...</svg>
|
|
942
|
+
icon: r,
|
|
943
|
+
spin: i,
|
|
944
|
+
rotate: s,
|
|
945
|
+
tabIndex: o,
|
|
946
|
+
onClick: l,
|
|
947
|
+
// other
|
|
948
|
+
twoToneColor: h,
|
|
949
|
+
...c
|
|
950
|
+
} = n, {
|
|
951
|
+
prefixCls: a = "anticon",
|
|
952
|
+
rootClassName: g
|
|
953
|
+
} = _.useContext(D), d = lt(g, a, {
|
|
954
|
+
[`${a}-${r.name}`]: !!r.name,
|
|
955
|
+
[`${a}-spin`]: !!i || r.name === "loading"
|
|
956
|
+
}, e);
|
|
957
|
+
let m = o;
|
|
958
|
+
m === void 0 && l && (m = -1);
|
|
959
|
+
const tt = s ? {
|
|
960
|
+
msTransform: `rotate(${s}deg)`,
|
|
961
|
+
transform: `rotate(${s}deg)`
|
|
962
|
+
} : void 0, [et, nt] = X(h);
|
|
963
|
+
return /* @__PURE__ */ _.createElement("span", H({
|
|
964
|
+
role: "img",
|
|
965
|
+
"aria-label": r.name
|
|
966
|
+
}, c, {
|
|
967
|
+
ref: t,
|
|
968
|
+
tabIndex: m,
|
|
969
|
+
onClick: l,
|
|
970
|
+
className: d
|
|
971
|
+
}), /* @__PURE__ */ _.createElement(p, {
|
|
972
|
+
icon: r,
|
|
973
|
+
primaryColor: et,
|
|
974
|
+
secondaryColor: nt,
|
|
975
|
+
style: tt
|
|
976
|
+
}));
|
|
977
|
+
});
|
|
978
|
+
j.getTwoToneColor = qt;
|
|
979
|
+
j.setTwoToneColor = Z;
|
|
980
|
+
process.env.NODE_ENV !== "production" && (j.displayName = "AntdIcon");
|
|
981
|
+
export {
|
|
982
|
+
j as I
|
|
983
|
+
};
|
|
984
|
+
//# sourceMappingURL=AntdIcon-B1nMlqyh.js.map
|