sti-antd-package 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/Button/Component.d.ts +4 -0
- package/dist/components/Button/Group/Add/Component.d.ts +3 -0
- package/dist/components/Button/Group/Add/index.d.ts +2 -0
- package/dist/components/Button/Group/Add/types.d.ts +9 -0
- package/dist/components/Button/Group/Edit/Component.d.ts +4 -0
- package/dist/components/Button/Group/Edit/index.d.ts +2 -0
- package/dist/components/Button/Group/Edit/types.d.ts +12 -0
- package/dist/components/Button/index.d.ts +2 -0
- package/dist/components/Button/types.d.ts +26 -0
- package/dist/components/Card/Component.d.ts +4 -0
- package/dist/components/Card/index.d.ts +2 -0
- package/dist/components/Card/types.d.ts +9 -0
- package/dist/components/index.d.ts +8 -0
- package/dist/constants/formColLayout.d.ts +31 -0
- package/dist/constants/index.d.ts +2 -0
- package/dist/helpers/colLayout.d.ts +11 -0
- package/dist/helpers/index.d.ts +1 -0
- package/dist/index.d.ts +108 -0
- package/dist/index.esm.js +2313 -0
- package/dist/index.js +2338 -0
- package/package.json +143 -0
- package/readme.md +7 -0
package/dist/index.js
ADDED
|
@@ -0,0 +1,2338 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var React = require('react');
|
|
4
|
+
var antd = require('antd');
|
|
5
|
+
|
|
6
|
+
function _interopNamespaceDefault(e) {
|
|
7
|
+
var n = Object.create(null);
|
|
8
|
+
if (e) {
|
|
9
|
+
Object.keys(e).forEach(function (k) {
|
|
10
|
+
if (k !== 'default') {
|
|
11
|
+
var d = Object.getOwnPropertyDescriptor(e, k);
|
|
12
|
+
Object.defineProperty(n, k, d.get ? d : {
|
|
13
|
+
enumerable: true,
|
|
14
|
+
get: function () { return e[k]; }
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
n.default = e;
|
|
20
|
+
return Object.freeze(n);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
var React__namespace = /*#__PURE__*/_interopNamespaceDefault(React);
|
|
24
|
+
|
|
25
|
+
function getDefaultExportFromCjs (x) {
|
|
26
|
+
return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
var jsxRuntime = {exports: {}};
|
|
30
|
+
|
|
31
|
+
var reactJsxRuntime_production = {};
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* @license React
|
|
35
|
+
* react-jsx-runtime.production.js
|
|
36
|
+
*
|
|
37
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
38
|
+
*
|
|
39
|
+
* This source code is licensed under the MIT license found in the
|
|
40
|
+
* LICENSE file in the root directory of this source tree.
|
|
41
|
+
*/
|
|
42
|
+
|
|
43
|
+
var hasRequiredReactJsxRuntime_production;
|
|
44
|
+
|
|
45
|
+
function requireReactJsxRuntime_production () {
|
|
46
|
+
if (hasRequiredReactJsxRuntime_production) return reactJsxRuntime_production;
|
|
47
|
+
hasRequiredReactJsxRuntime_production = 1;
|
|
48
|
+
var REACT_ELEMENT_TYPE = Symbol.for("react.transitional.element"),
|
|
49
|
+
REACT_FRAGMENT_TYPE = Symbol.for("react.fragment");
|
|
50
|
+
function jsxProd(type, config, maybeKey) {
|
|
51
|
+
var key = null;
|
|
52
|
+
void 0 !== maybeKey && (key = "" + maybeKey);
|
|
53
|
+
void 0 !== config.key && (key = "" + config.key);
|
|
54
|
+
if ("key" in config) {
|
|
55
|
+
maybeKey = {};
|
|
56
|
+
for (var propName in config)
|
|
57
|
+
"key" !== propName && (maybeKey[propName] = config[propName]);
|
|
58
|
+
} else maybeKey = config;
|
|
59
|
+
config = maybeKey.ref;
|
|
60
|
+
return {
|
|
61
|
+
$$typeof: REACT_ELEMENT_TYPE,
|
|
62
|
+
type: type,
|
|
63
|
+
key: key,
|
|
64
|
+
ref: void 0 !== config ? config : null,
|
|
65
|
+
props: maybeKey
|
|
66
|
+
};
|
|
67
|
+
}
|
|
68
|
+
reactJsxRuntime_production.Fragment = REACT_FRAGMENT_TYPE;
|
|
69
|
+
reactJsxRuntime_production.jsx = jsxProd;
|
|
70
|
+
reactJsxRuntime_production.jsxs = jsxProd;
|
|
71
|
+
return reactJsxRuntime_production;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
var reactJsxRuntime_development = {};
|
|
75
|
+
|
|
76
|
+
/**
|
|
77
|
+
* @license React
|
|
78
|
+
* react-jsx-runtime.development.js
|
|
79
|
+
*
|
|
80
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
81
|
+
*
|
|
82
|
+
* This source code is licensed under the MIT license found in the
|
|
83
|
+
* LICENSE file in the root directory of this source tree.
|
|
84
|
+
*/
|
|
85
|
+
|
|
86
|
+
var hasRequiredReactJsxRuntime_development;
|
|
87
|
+
|
|
88
|
+
function requireReactJsxRuntime_development () {
|
|
89
|
+
if (hasRequiredReactJsxRuntime_development) return reactJsxRuntime_development;
|
|
90
|
+
hasRequiredReactJsxRuntime_development = 1;
|
|
91
|
+
"production" !== process.env.NODE_ENV &&
|
|
92
|
+
(function () {
|
|
93
|
+
function getComponentNameFromType(type) {
|
|
94
|
+
if (null == type) return null;
|
|
95
|
+
if ("function" === typeof type)
|
|
96
|
+
return type.$$typeof === REACT_CLIENT_REFERENCE$2
|
|
97
|
+
? null
|
|
98
|
+
: type.displayName || type.name || null;
|
|
99
|
+
if ("string" === typeof type) return type;
|
|
100
|
+
switch (type) {
|
|
101
|
+
case REACT_FRAGMENT_TYPE:
|
|
102
|
+
return "Fragment";
|
|
103
|
+
case REACT_PORTAL_TYPE:
|
|
104
|
+
return "Portal";
|
|
105
|
+
case REACT_PROFILER_TYPE:
|
|
106
|
+
return "Profiler";
|
|
107
|
+
case REACT_STRICT_MODE_TYPE:
|
|
108
|
+
return "StrictMode";
|
|
109
|
+
case REACT_SUSPENSE_TYPE:
|
|
110
|
+
return "Suspense";
|
|
111
|
+
case REACT_SUSPENSE_LIST_TYPE:
|
|
112
|
+
return "SuspenseList";
|
|
113
|
+
}
|
|
114
|
+
if ("object" === typeof type)
|
|
115
|
+
switch (
|
|
116
|
+
("number" === typeof type.tag &&
|
|
117
|
+
console.error(
|
|
118
|
+
"Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."
|
|
119
|
+
),
|
|
120
|
+
type.$$typeof)
|
|
121
|
+
) {
|
|
122
|
+
case REACT_CONTEXT_TYPE:
|
|
123
|
+
return (type.displayName || "Context") + ".Provider";
|
|
124
|
+
case REACT_CONSUMER_TYPE:
|
|
125
|
+
return (type._context.displayName || "Context") + ".Consumer";
|
|
126
|
+
case REACT_FORWARD_REF_TYPE:
|
|
127
|
+
var innerType = type.render;
|
|
128
|
+
type = type.displayName;
|
|
129
|
+
type ||
|
|
130
|
+
((type = innerType.displayName || innerType.name || ""),
|
|
131
|
+
(type = "" !== type ? "ForwardRef(" + type + ")" : "ForwardRef"));
|
|
132
|
+
return type;
|
|
133
|
+
case REACT_MEMO_TYPE:
|
|
134
|
+
return (
|
|
135
|
+
(innerType = type.displayName || null),
|
|
136
|
+
null !== innerType
|
|
137
|
+
? innerType
|
|
138
|
+
: getComponentNameFromType(type.type) || "Memo"
|
|
139
|
+
);
|
|
140
|
+
case REACT_LAZY_TYPE:
|
|
141
|
+
innerType = type._payload;
|
|
142
|
+
type = type._init;
|
|
143
|
+
try {
|
|
144
|
+
return getComponentNameFromType(type(innerType));
|
|
145
|
+
} catch (x) {}
|
|
146
|
+
}
|
|
147
|
+
return null;
|
|
148
|
+
}
|
|
149
|
+
function testStringCoercion(value) {
|
|
150
|
+
return "" + value;
|
|
151
|
+
}
|
|
152
|
+
function checkKeyStringCoercion(value) {
|
|
153
|
+
try {
|
|
154
|
+
testStringCoercion(value);
|
|
155
|
+
var JSCompiler_inline_result = !1;
|
|
156
|
+
} catch (e) {
|
|
157
|
+
JSCompiler_inline_result = true;
|
|
158
|
+
}
|
|
159
|
+
if (JSCompiler_inline_result) {
|
|
160
|
+
JSCompiler_inline_result = console;
|
|
161
|
+
var JSCompiler_temp_const = JSCompiler_inline_result.error;
|
|
162
|
+
var JSCompiler_inline_result$jscomp$0 =
|
|
163
|
+
("function" === typeof Symbol &&
|
|
164
|
+
Symbol.toStringTag &&
|
|
165
|
+
value[Symbol.toStringTag]) ||
|
|
166
|
+
value.constructor.name ||
|
|
167
|
+
"Object";
|
|
168
|
+
JSCompiler_temp_const.call(
|
|
169
|
+
JSCompiler_inline_result,
|
|
170
|
+
"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",
|
|
171
|
+
JSCompiler_inline_result$jscomp$0
|
|
172
|
+
);
|
|
173
|
+
return testStringCoercion(value);
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
function disabledLog() {}
|
|
177
|
+
function disableLogs() {
|
|
178
|
+
if (0 === disabledDepth) {
|
|
179
|
+
prevLog = console.log;
|
|
180
|
+
prevInfo = console.info;
|
|
181
|
+
prevWarn = console.warn;
|
|
182
|
+
prevError = console.error;
|
|
183
|
+
prevGroup = console.group;
|
|
184
|
+
prevGroupCollapsed = console.groupCollapsed;
|
|
185
|
+
prevGroupEnd = console.groupEnd;
|
|
186
|
+
var props = {
|
|
187
|
+
configurable: true,
|
|
188
|
+
enumerable: true,
|
|
189
|
+
value: disabledLog,
|
|
190
|
+
writable: true
|
|
191
|
+
};
|
|
192
|
+
Object.defineProperties(console, {
|
|
193
|
+
info: props,
|
|
194
|
+
log: props,
|
|
195
|
+
warn: props,
|
|
196
|
+
error: props,
|
|
197
|
+
group: props,
|
|
198
|
+
groupCollapsed: props,
|
|
199
|
+
groupEnd: props
|
|
200
|
+
});
|
|
201
|
+
}
|
|
202
|
+
disabledDepth++;
|
|
203
|
+
}
|
|
204
|
+
function reenableLogs() {
|
|
205
|
+
disabledDepth--;
|
|
206
|
+
if (0 === disabledDepth) {
|
|
207
|
+
var props = { configurable: true, enumerable: true, writable: true };
|
|
208
|
+
Object.defineProperties(console, {
|
|
209
|
+
log: assign({}, props, { value: prevLog }),
|
|
210
|
+
info: assign({}, props, { value: prevInfo }),
|
|
211
|
+
warn: assign({}, props, { value: prevWarn }),
|
|
212
|
+
error: assign({}, props, { value: prevError }),
|
|
213
|
+
group: assign({}, props, { value: prevGroup }),
|
|
214
|
+
groupCollapsed: assign({}, props, { value: prevGroupCollapsed }),
|
|
215
|
+
groupEnd: assign({}, props, { value: prevGroupEnd })
|
|
216
|
+
});
|
|
217
|
+
}
|
|
218
|
+
0 > disabledDepth &&
|
|
219
|
+
console.error(
|
|
220
|
+
"disabledDepth fell below zero. This is a bug in React. Please file an issue."
|
|
221
|
+
);
|
|
222
|
+
}
|
|
223
|
+
function describeBuiltInComponentFrame(name) {
|
|
224
|
+
if (void 0 === prefix)
|
|
225
|
+
try {
|
|
226
|
+
throw Error();
|
|
227
|
+
} catch (x) {
|
|
228
|
+
var match = x.stack.trim().match(/\n( *(at )?)/);
|
|
229
|
+
prefix = (match && match[1]) || "";
|
|
230
|
+
suffix =
|
|
231
|
+
-1 < x.stack.indexOf("\n at")
|
|
232
|
+
? " (<anonymous>)"
|
|
233
|
+
: -1 < x.stack.indexOf("@")
|
|
234
|
+
? "@unknown:0:0"
|
|
235
|
+
: "";
|
|
236
|
+
}
|
|
237
|
+
return "\n" + prefix + name + suffix;
|
|
238
|
+
}
|
|
239
|
+
function describeNativeComponentFrame(fn, construct) {
|
|
240
|
+
if (!fn || reentry) return "";
|
|
241
|
+
var frame = componentFrameCache.get(fn);
|
|
242
|
+
if (void 0 !== frame) return frame;
|
|
243
|
+
reentry = true;
|
|
244
|
+
frame = Error.prepareStackTrace;
|
|
245
|
+
Error.prepareStackTrace = void 0;
|
|
246
|
+
var previousDispatcher = null;
|
|
247
|
+
previousDispatcher = ReactSharedInternals.H;
|
|
248
|
+
ReactSharedInternals.H = null;
|
|
249
|
+
disableLogs();
|
|
250
|
+
try {
|
|
251
|
+
var RunInRootFrame = {
|
|
252
|
+
DetermineComponentFrameRoot: function () {
|
|
253
|
+
try {
|
|
254
|
+
if (construct) {
|
|
255
|
+
var Fake = function () {
|
|
256
|
+
throw Error();
|
|
257
|
+
};
|
|
258
|
+
Object.defineProperty(Fake.prototype, "props", {
|
|
259
|
+
set: function () {
|
|
260
|
+
throw Error();
|
|
261
|
+
}
|
|
262
|
+
});
|
|
263
|
+
if ("object" === typeof Reflect && Reflect.construct) {
|
|
264
|
+
try {
|
|
265
|
+
Reflect.construct(Fake, []);
|
|
266
|
+
} catch (x) {
|
|
267
|
+
var control = x;
|
|
268
|
+
}
|
|
269
|
+
Reflect.construct(fn, [], Fake);
|
|
270
|
+
} else {
|
|
271
|
+
try {
|
|
272
|
+
Fake.call();
|
|
273
|
+
} catch (x$0) {
|
|
274
|
+
control = x$0;
|
|
275
|
+
}
|
|
276
|
+
fn.call(Fake.prototype);
|
|
277
|
+
}
|
|
278
|
+
} else {
|
|
279
|
+
try {
|
|
280
|
+
throw Error();
|
|
281
|
+
} catch (x$1) {
|
|
282
|
+
control = x$1;
|
|
283
|
+
}
|
|
284
|
+
(Fake = fn()) &&
|
|
285
|
+
"function" === typeof Fake.catch &&
|
|
286
|
+
Fake.catch(function () {});
|
|
287
|
+
}
|
|
288
|
+
} catch (sample) {
|
|
289
|
+
if (sample && control && "string" === typeof sample.stack)
|
|
290
|
+
return [sample.stack, control.stack];
|
|
291
|
+
}
|
|
292
|
+
return [null, null];
|
|
293
|
+
}
|
|
294
|
+
};
|
|
295
|
+
RunInRootFrame.DetermineComponentFrameRoot.displayName =
|
|
296
|
+
"DetermineComponentFrameRoot";
|
|
297
|
+
var namePropDescriptor = Object.getOwnPropertyDescriptor(
|
|
298
|
+
RunInRootFrame.DetermineComponentFrameRoot,
|
|
299
|
+
"name"
|
|
300
|
+
);
|
|
301
|
+
namePropDescriptor &&
|
|
302
|
+
namePropDescriptor.configurable &&
|
|
303
|
+
Object.defineProperty(
|
|
304
|
+
RunInRootFrame.DetermineComponentFrameRoot,
|
|
305
|
+
"name",
|
|
306
|
+
{ value: "DetermineComponentFrameRoot" }
|
|
307
|
+
);
|
|
308
|
+
var _RunInRootFrame$Deter =
|
|
309
|
+
RunInRootFrame.DetermineComponentFrameRoot(),
|
|
310
|
+
sampleStack = _RunInRootFrame$Deter[0],
|
|
311
|
+
controlStack = _RunInRootFrame$Deter[1];
|
|
312
|
+
if (sampleStack && controlStack) {
|
|
313
|
+
var sampleLines = sampleStack.split("\n"),
|
|
314
|
+
controlLines = controlStack.split("\n");
|
|
315
|
+
for (
|
|
316
|
+
_RunInRootFrame$Deter = namePropDescriptor = 0;
|
|
317
|
+
namePropDescriptor < sampleLines.length &&
|
|
318
|
+
!sampleLines[namePropDescriptor].includes(
|
|
319
|
+
"DetermineComponentFrameRoot"
|
|
320
|
+
);
|
|
321
|
+
|
|
322
|
+
)
|
|
323
|
+
namePropDescriptor++;
|
|
324
|
+
for (
|
|
325
|
+
;
|
|
326
|
+
_RunInRootFrame$Deter < controlLines.length &&
|
|
327
|
+
!controlLines[_RunInRootFrame$Deter].includes(
|
|
328
|
+
"DetermineComponentFrameRoot"
|
|
329
|
+
);
|
|
330
|
+
|
|
331
|
+
)
|
|
332
|
+
_RunInRootFrame$Deter++;
|
|
333
|
+
if (
|
|
334
|
+
namePropDescriptor === sampleLines.length ||
|
|
335
|
+
_RunInRootFrame$Deter === controlLines.length
|
|
336
|
+
)
|
|
337
|
+
for (
|
|
338
|
+
namePropDescriptor = sampleLines.length - 1,
|
|
339
|
+
_RunInRootFrame$Deter = controlLines.length - 1;
|
|
340
|
+
1 <= namePropDescriptor &&
|
|
341
|
+
0 <= _RunInRootFrame$Deter &&
|
|
342
|
+
sampleLines[namePropDescriptor] !==
|
|
343
|
+
controlLines[_RunInRootFrame$Deter];
|
|
344
|
+
|
|
345
|
+
)
|
|
346
|
+
_RunInRootFrame$Deter--;
|
|
347
|
+
for (
|
|
348
|
+
;
|
|
349
|
+
1 <= namePropDescriptor && 0 <= _RunInRootFrame$Deter;
|
|
350
|
+
namePropDescriptor--, _RunInRootFrame$Deter--
|
|
351
|
+
)
|
|
352
|
+
if (
|
|
353
|
+
sampleLines[namePropDescriptor] !==
|
|
354
|
+
controlLines[_RunInRootFrame$Deter]
|
|
355
|
+
) {
|
|
356
|
+
if (1 !== namePropDescriptor || 1 !== _RunInRootFrame$Deter) {
|
|
357
|
+
do
|
|
358
|
+
if (
|
|
359
|
+
(namePropDescriptor--,
|
|
360
|
+
_RunInRootFrame$Deter--,
|
|
361
|
+
0 > _RunInRootFrame$Deter ||
|
|
362
|
+
sampleLines[namePropDescriptor] !==
|
|
363
|
+
controlLines[_RunInRootFrame$Deter])
|
|
364
|
+
) {
|
|
365
|
+
var _frame =
|
|
366
|
+
"\n" +
|
|
367
|
+
sampleLines[namePropDescriptor].replace(
|
|
368
|
+
" at new ",
|
|
369
|
+
" at "
|
|
370
|
+
);
|
|
371
|
+
fn.displayName &&
|
|
372
|
+
_frame.includes("<anonymous>") &&
|
|
373
|
+
(_frame = _frame.replace("<anonymous>", fn.displayName));
|
|
374
|
+
"function" === typeof fn &&
|
|
375
|
+
componentFrameCache.set(fn, _frame);
|
|
376
|
+
return _frame;
|
|
377
|
+
}
|
|
378
|
+
while (1 <= namePropDescriptor && 0 <= _RunInRootFrame$Deter);
|
|
379
|
+
}
|
|
380
|
+
break;
|
|
381
|
+
}
|
|
382
|
+
}
|
|
383
|
+
} finally {
|
|
384
|
+
(reentry = false),
|
|
385
|
+
(ReactSharedInternals.H = previousDispatcher),
|
|
386
|
+
reenableLogs(),
|
|
387
|
+
(Error.prepareStackTrace = frame);
|
|
388
|
+
}
|
|
389
|
+
sampleLines = (sampleLines = fn ? fn.displayName || fn.name : "")
|
|
390
|
+
? describeBuiltInComponentFrame(sampleLines)
|
|
391
|
+
: "";
|
|
392
|
+
"function" === typeof fn && componentFrameCache.set(fn, sampleLines);
|
|
393
|
+
return sampleLines;
|
|
394
|
+
}
|
|
395
|
+
function describeUnknownElementTypeFrameInDEV(type) {
|
|
396
|
+
if (null == type) return "";
|
|
397
|
+
if ("function" === typeof type) {
|
|
398
|
+
var prototype = type.prototype;
|
|
399
|
+
return describeNativeComponentFrame(
|
|
400
|
+
type,
|
|
401
|
+
!(!prototype || !prototype.isReactComponent)
|
|
402
|
+
);
|
|
403
|
+
}
|
|
404
|
+
if ("string" === typeof type) return describeBuiltInComponentFrame(type);
|
|
405
|
+
switch (type) {
|
|
406
|
+
case REACT_SUSPENSE_TYPE:
|
|
407
|
+
return describeBuiltInComponentFrame("Suspense");
|
|
408
|
+
case REACT_SUSPENSE_LIST_TYPE:
|
|
409
|
+
return describeBuiltInComponentFrame("SuspenseList");
|
|
410
|
+
}
|
|
411
|
+
if ("object" === typeof type)
|
|
412
|
+
switch (type.$$typeof) {
|
|
413
|
+
case REACT_FORWARD_REF_TYPE:
|
|
414
|
+
return (type = describeNativeComponentFrame(type.render, false)), type;
|
|
415
|
+
case REACT_MEMO_TYPE:
|
|
416
|
+
return describeUnknownElementTypeFrameInDEV(type.type);
|
|
417
|
+
case REACT_LAZY_TYPE:
|
|
418
|
+
prototype = type._payload;
|
|
419
|
+
type = type._init;
|
|
420
|
+
try {
|
|
421
|
+
return describeUnknownElementTypeFrameInDEV(type(prototype));
|
|
422
|
+
} catch (x) {}
|
|
423
|
+
}
|
|
424
|
+
return "";
|
|
425
|
+
}
|
|
426
|
+
function getOwner() {
|
|
427
|
+
var dispatcher = ReactSharedInternals.A;
|
|
428
|
+
return null === dispatcher ? null : dispatcher.getOwner();
|
|
429
|
+
}
|
|
430
|
+
function hasValidKey(config) {
|
|
431
|
+
if (hasOwnProperty.call(config, "key")) {
|
|
432
|
+
var getter = Object.getOwnPropertyDescriptor(config, "key").get;
|
|
433
|
+
if (getter && getter.isReactWarning) return false;
|
|
434
|
+
}
|
|
435
|
+
return void 0 !== config.key;
|
|
436
|
+
}
|
|
437
|
+
function defineKeyPropWarningGetter(props, displayName) {
|
|
438
|
+
function warnAboutAccessingKey() {
|
|
439
|
+
specialPropKeyWarningShown ||
|
|
440
|
+
((specialPropKeyWarningShown = true),
|
|
441
|
+
console.error(
|
|
442
|
+
"%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",
|
|
443
|
+
displayName
|
|
444
|
+
));
|
|
445
|
+
}
|
|
446
|
+
warnAboutAccessingKey.isReactWarning = true;
|
|
447
|
+
Object.defineProperty(props, "key", {
|
|
448
|
+
get: warnAboutAccessingKey,
|
|
449
|
+
configurable: true
|
|
450
|
+
});
|
|
451
|
+
}
|
|
452
|
+
function elementRefGetterWithDeprecationWarning() {
|
|
453
|
+
var componentName = getComponentNameFromType(this.type);
|
|
454
|
+
didWarnAboutElementRef[componentName] ||
|
|
455
|
+
((didWarnAboutElementRef[componentName] = true),
|
|
456
|
+
console.error(
|
|
457
|
+
"Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release."
|
|
458
|
+
));
|
|
459
|
+
componentName = this.props.ref;
|
|
460
|
+
return void 0 !== componentName ? componentName : null;
|
|
461
|
+
}
|
|
462
|
+
function ReactElement(type, key, self, source, owner, props) {
|
|
463
|
+
self = props.ref;
|
|
464
|
+
type = {
|
|
465
|
+
$$typeof: REACT_ELEMENT_TYPE,
|
|
466
|
+
type: type,
|
|
467
|
+
key: key,
|
|
468
|
+
props: props,
|
|
469
|
+
_owner: owner
|
|
470
|
+
};
|
|
471
|
+
null !== (void 0 !== self ? self : null)
|
|
472
|
+
? Object.defineProperty(type, "ref", {
|
|
473
|
+
enumerable: false,
|
|
474
|
+
get: elementRefGetterWithDeprecationWarning
|
|
475
|
+
})
|
|
476
|
+
: Object.defineProperty(type, "ref", { enumerable: false, value: null });
|
|
477
|
+
type._store = {};
|
|
478
|
+
Object.defineProperty(type._store, "validated", {
|
|
479
|
+
configurable: false,
|
|
480
|
+
enumerable: false,
|
|
481
|
+
writable: true,
|
|
482
|
+
value: 0
|
|
483
|
+
});
|
|
484
|
+
Object.defineProperty(type, "_debugInfo", {
|
|
485
|
+
configurable: false,
|
|
486
|
+
enumerable: false,
|
|
487
|
+
writable: true,
|
|
488
|
+
value: null
|
|
489
|
+
});
|
|
490
|
+
Object.freeze && (Object.freeze(type.props), Object.freeze(type));
|
|
491
|
+
return type;
|
|
492
|
+
}
|
|
493
|
+
function jsxDEVImpl(
|
|
494
|
+
type,
|
|
495
|
+
config,
|
|
496
|
+
maybeKey,
|
|
497
|
+
isStaticChildren,
|
|
498
|
+
source,
|
|
499
|
+
self
|
|
500
|
+
) {
|
|
501
|
+
if (
|
|
502
|
+
"string" === typeof type ||
|
|
503
|
+
"function" === typeof type ||
|
|
504
|
+
type === REACT_FRAGMENT_TYPE ||
|
|
505
|
+
type === REACT_PROFILER_TYPE ||
|
|
506
|
+
type === REACT_STRICT_MODE_TYPE ||
|
|
507
|
+
type === REACT_SUSPENSE_TYPE ||
|
|
508
|
+
type === REACT_SUSPENSE_LIST_TYPE ||
|
|
509
|
+
type === REACT_OFFSCREEN_TYPE ||
|
|
510
|
+
("object" === typeof type &&
|
|
511
|
+
null !== type &&
|
|
512
|
+
(type.$$typeof === REACT_LAZY_TYPE ||
|
|
513
|
+
type.$$typeof === REACT_MEMO_TYPE ||
|
|
514
|
+
type.$$typeof === REACT_CONTEXT_TYPE ||
|
|
515
|
+
type.$$typeof === REACT_CONSUMER_TYPE ||
|
|
516
|
+
type.$$typeof === REACT_FORWARD_REF_TYPE ||
|
|
517
|
+
type.$$typeof === REACT_CLIENT_REFERENCE$1 ||
|
|
518
|
+
void 0 !== type.getModuleId))
|
|
519
|
+
) {
|
|
520
|
+
var children = config.children;
|
|
521
|
+
if (void 0 !== children)
|
|
522
|
+
if (isStaticChildren)
|
|
523
|
+
if (isArrayImpl(children)) {
|
|
524
|
+
for (
|
|
525
|
+
isStaticChildren = 0;
|
|
526
|
+
isStaticChildren < children.length;
|
|
527
|
+
isStaticChildren++
|
|
528
|
+
)
|
|
529
|
+
validateChildKeys(children[isStaticChildren], type);
|
|
530
|
+
Object.freeze && Object.freeze(children);
|
|
531
|
+
} else
|
|
532
|
+
console.error(
|
|
533
|
+
"React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead."
|
|
534
|
+
);
|
|
535
|
+
else validateChildKeys(children, type);
|
|
536
|
+
} else {
|
|
537
|
+
children = "";
|
|
538
|
+
if (
|
|
539
|
+
void 0 === type ||
|
|
540
|
+
("object" === typeof type &&
|
|
541
|
+
null !== type &&
|
|
542
|
+
0 === Object.keys(type).length)
|
|
543
|
+
)
|
|
544
|
+
children +=
|
|
545
|
+
" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.";
|
|
546
|
+
null === type
|
|
547
|
+
? (isStaticChildren = "null")
|
|
548
|
+
: isArrayImpl(type)
|
|
549
|
+
? (isStaticChildren = "array")
|
|
550
|
+
: void 0 !== type && type.$$typeof === REACT_ELEMENT_TYPE
|
|
551
|
+
? ((isStaticChildren =
|
|
552
|
+
"<" +
|
|
553
|
+
(getComponentNameFromType(type.type) || "Unknown") +
|
|
554
|
+
" />"),
|
|
555
|
+
(children =
|
|
556
|
+
" Did you accidentally export a JSX literal instead of a component?"))
|
|
557
|
+
: (isStaticChildren = typeof type);
|
|
558
|
+
console.error(
|
|
559
|
+
"React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",
|
|
560
|
+
isStaticChildren,
|
|
561
|
+
children
|
|
562
|
+
);
|
|
563
|
+
}
|
|
564
|
+
if (hasOwnProperty.call(config, "key")) {
|
|
565
|
+
children = getComponentNameFromType(type);
|
|
566
|
+
var keys = Object.keys(config).filter(function (k) {
|
|
567
|
+
return "key" !== k;
|
|
568
|
+
});
|
|
569
|
+
isStaticChildren =
|
|
570
|
+
0 < keys.length
|
|
571
|
+
? "{key: someKey, " + keys.join(": ..., ") + ": ...}"
|
|
572
|
+
: "{key: someKey}";
|
|
573
|
+
didWarnAboutKeySpread[children + isStaticChildren] ||
|
|
574
|
+
((keys =
|
|
575
|
+
0 < keys.length ? "{" + keys.join(": ..., ") + ": ...}" : "{}"),
|
|
576
|
+
console.error(
|
|
577
|
+
'A props object containing a "key" prop is being spread into JSX:\n let props = %s;\n <%s {...props} />\nReact keys must be passed directly to JSX without using spread:\n let props = %s;\n <%s key={someKey} {...props} />',
|
|
578
|
+
isStaticChildren,
|
|
579
|
+
children,
|
|
580
|
+
keys,
|
|
581
|
+
children
|
|
582
|
+
),
|
|
583
|
+
(didWarnAboutKeySpread[children + isStaticChildren] = true));
|
|
584
|
+
}
|
|
585
|
+
children = null;
|
|
586
|
+
void 0 !== maybeKey &&
|
|
587
|
+
(checkKeyStringCoercion(maybeKey), (children = "" + maybeKey));
|
|
588
|
+
hasValidKey(config) &&
|
|
589
|
+
(checkKeyStringCoercion(config.key), (children = "" + config.key));
|
|
590
|
+
if ("key" in config) {
|
|
591
|
+
maybeKey = {};
|
|
592
|
+
for (var propName in config)
|
|
593
|
+
"key" !== propName && (maybeKey[propName] = config[propName]);
|
|
594
|
+
} else maybeKey = config;
|
|
595
|
+
children &&
|
|
596
|
+
defineKeyPropWarningGetter(
|
|
597
|
+
maybeKey,
|
|
598
|
+
"function" === typeof type
|
|
599
|
+
? type.displayName || type.name || "Unknown"
|
|
600
|
+
: type
|
|
601
|
+
);
|
|
602
|
+
return ReactElement(type, children, self, source, getOwner(), maybeKey);
|
|
603
|
+
}
|
|
604
|
+
function validateChildKeys(node, parentType) {
|
|
605
|
+
if (
|
|
606
|
+
"object" === typeof node &&
|
|
607
|
+
node &&
|
|
608
|
+
node.$$typeof !== REACT_CLIENT_REFERENCE
|
|
609
|
+
)
|
|
610
|
+
if (isArrayImpl(node))
|
|
611
|
+
for (var i = 0; i < node.length; i++) {
|
|
612
|
+
var child = node[i];
|
|
613
|
+
isValidElement(child) && validateExplicitKey(child, parentType);
|
|
614
|
+
}
|
|
615
|
+
else if (isValidElement(node))
|
|
616
|
+
node._store && (node._store.validated = 1);
|
|
617
|
+
else if (
|
|
618
|
+
(null === node || "object" !== typeof node
|
|
619
|
+
? (i = null)
|
|
620
|
+
: ((i =
|
|
621
|
+
(MAYBE_ITERATOR_SYMBOL && node[MAYBE_ITERATOR_SYMBOL]) ||
|
|
622
|
+
node["@@iterator"]),
|
|
623
|
+
(i = "function" === typeof i ? i : null)),
|
|
624
|
+
"function" === typeof i &&
|
|
625
|
+
i !== node.entries &&
|
|
626
|
+
((i = i.call(node)), i !== node))
|
|
627
|
+
)
|
|
628
|
+
for (; !(node = i.next()).done; )
|
|
629
|
+
isValidElement(node.value) &&
|
|
630
|
+
validateExplicitKey(node.value, parentType);
|
|
631
|
+
}
|
|
632
|
+
function isValidElement(object) {
|
|
633
|
+
return (
|
|
634
|
+
"object" === typeof object &&
|
|
635
|
+
null !== object &&
|
|
636
|
+
object.$$typeof === REACT_ELEMENT_TYPE
|
|
637
|
+
);
|
|
638
|
+
}
|
|
639
|
+
function validateExplicitKey(element, parentType) {
|
|
640
|
+
if (
|
|
641
|
+
element._store &&
|
|
642
|
+
!element._store.validated &&
|
|
643
|
+
null == element.key &&
|
|
644
|
+
((element._store.validated = 1),
|
|
645
|
+
(parentType = getCurrentComponentErrorInfo(parentType)),
|
|
646
|
+
!ownerHasKeyUseWarning[parentType])
|
|
647
|
+
) {
|
|
648
|
+
ownerHasKeyUseWarning[parentType] = true;
|
|
649
|
+
var childOwner = "";
|
|
650
|
+
element &&
|
|
651
|
+
null != element._owner &&
|
|
652
|
+
element._owner !== getOwner() &&
|
|
653
|
+
((childOwner = null),
|
|
654
|
+
"number" === typeof element._owner.tag
|
|
655
|
+
? (childOwner = getComponentNameFromType(element._owner.type))
|
|
656
|
+
: "string" === typeof element._owner.name &&
|
|
657
|
+
(childOwner = element._owner.name),
|
|
658
|
+
(childOwner = " It was passed a child from " + childOwner + "."));
|
|
659
|
+
var prevGetCurrentStack = ReactSharedInternals.getCurrentStack;
|
|
660
|
+
ReactSharedInternals.getCurrentStack = function () {
|
|
661
|
+
var stack = describeUnknownElementTypeFrameInDEV(element.type);
|
|
662
|
+
prevGetCurrentStack && (stack += prevGetCurrentStack() || "");
|
|
663
|
+
return stack;
|
|
664
|
+
};
|
|
665
|
+
console.error(
|
|
666
|
+
'Each child in a list should have a unique "key" prop.%s%s See https://react.dev/link/warning-keys for more information.',
|
|
667
|
+
parentType,
|
|
668
|
+
childOwner
|
|
669
|
+
);
|
|
670
|
+
ReactSharedInternals.getCurrentStack = prevGetCurrentStack;
|
|
671
|
+
}
|
|
672
|
+
}
|
|
673
|
+
function getCurrentComponentErrorInfo(parentType) {
|
|
674
|
+
var info = "",
|
|
675
|
+
owner = getOwner();
|
|
676
|
+
owner &&
|
|
677
|
+
(owner = getComponentNameFromType(owner.type)) &&
|
|
678
|
+
(info = "\n\nCheck the render method of `" + owner + "`.");
|
|
679
|
+
info ||
|
|
680
|
+
((parentType = getComponentNameFromType(parentType)) &&
|
|
681
|
+
(info =
|
|
682
|
+
"\n\nCheck the top-level render call using <" + parentType + ">."));
|
|
683
|
+
return info;
|
|
684
|
+
}
|
|
685
|
+
var React$1 = React,
|
|
686
|
+
REACT_ELEMENT_TYPE = Symbol.for("react.transitional.element"),
|
|
687
|
+
REACT_PORTAL_TYPE = Symbol.for("react.portal"),
|
|
688
|
+
REACT_FRAGMENT_TYPE = Symbol.for("react.fragment"),
|
|
689
|
+
REACT_STRICT_MODE_TYPE = Symbol.for("react.strict_mode"),
|
|
690
|
+
REACT_PROFILER_TYPE = Symbol.for("react.profiler");
|
|
691
|
+
var REACT_CONSUMER_TYPE = Symbol.for("react.consumer"),
|
|
692
|
+
REACT_CONTEXT_TYPE = Symbol.for("react.context"),
|
|
693
|
+
REACT_FORWARD_REF_TYPE = Symbol.for("react.forward_ref"),
|
|
694
|
+
REACT_SUSPENSE_TYPE = Symbol.for("react.suspense"),
|
|
695
|
+
REACT_SUSPENSE_LIST_TYPE = Symbol.for("react.suspense_list"),
|
|
696
|
+
REACT_MEMO_TYPE = Symbol.for("react.memo"),
|
|
697
|
+
REACT_LAZY_TYPE = Symbol.for("react.lazy"),
|
|
698
|
+
REACT_OFFSCREEN_TYPE = Symbol.for("react.offscreen"),
|
|
699
|
+
MAYBE_ITERATOR_SYMBOL = Symbol.iterator,
|
|
700
|
+
REACT_CLIENT_REFERENCE$2 = Symbol.for("react.client.reference"),
|
|
701
|
+
ReactSharedInternals =
|
|
702
|
+
React$1.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,
|
|
703
|
+
hasOwnProperty = Object.prototype.hasOwnProperty,
|
|
704
|
+
assign = Object.assign,
|
|
705
|
+
REACT_CLIENT_REFERENCE$1 = Symbol.for("react.client.reference"),
|
|
706
|
+
isArrayImpl = Array.isArray,
|
|
707
|
+
disabledDepth = 0,
|
|
708
|
+
prevLog,
|
|
709
|
+
prevInfo,
|
|
710
|
+
prevWarn,
|
|
711
|
+
prevError,
|
|
712
|
+
prevGroup,
|
|
713
|
+
prevGroupCollapsed,
|
|
714
|
+
prevGroupEnd;
|
|
715
|
+
disabledLog.__reactDisabledLog = true;
|
|
716
|
+
var prefix,
|
|
717
|
+
suffix,
|
|
718
|
+
reentry = false;
|
|
719
|
+
var componentFrameCache = new (
|
|
720
|
+
"function" === typeof WeakMap ? WeakMap : Map
|
|
721
|
+
)();
|
|
722
|
+
var REACT_CLIENT_REFERENCE = Symbol.for("react.client.reference"),
|
|
723
|
+
specialPropKeyWarningShown;
|
|
724
|
+
var didWarnAboutElementRef = {};
|
|
725
|
+
var didWarnAboutKeySpread = {},
|
|
726
|
+
ownerHasKeyUseWarning = {};
|
|
727
|
+
reactJsxRuntime_development.Fragment = REACT_FRAGMENT_TYPE;
|
|
728
|
+
reactJsxRuntime_development.jsx = function (type, config, maybeKey, source, self) {
|
|
729
|
+
return jsxDEVImpl(type, config, maybeKey, false, source, self);
|
|
730
|
+
};
|
|
731
|
+
reactJsxRuntime_development.jsxs = function (type, config, maybeKey, source, self) {
|
|
732
|
+
return jsxDEVImpl(type, config, maybeKey, true, source, self);
|
|
733
|
+
};
|
|
734
|
+
})();
|
|
735
|
+
return reactJsxRuntime_development;
|
|
736
|
+
}
|
|
737
|
+
|
|
738
|
+
var hasRequiredJsxRuntime;
|
|
739
|
+
|
|
740
|
+
function requireJsxRuntime () {
|
|
741
|
+
if (hasRequiredJsxRuntime) return jsxRuntime.exports;
|
|
742
|
+
hasRequiredJsxRuntime = 1;
|
|
743
|
+
|
|
744
|
+
if (process.env.NODE_ENV === 'production') {
|
|
745
|
+
jsxRuntime.exports = requireReactJsxRuntime_production();
|
|
746
|
+
} else {
|
|
747
|
+
jsxRuntime.exports = requireReactJsxRuntime_development();
|
|
748
|
+
}
|
|
749
|
+
return jsxRuntime.exports;
|
|
750
|
+
}
|
|
751
|
+
|
|
752
|
+
var jsxRuntimeExports = requireJsxRuntime();
|
|
753
|
+
|
|
754
|
+
const ButtonComponent = ({ tooltip, icon, href, htmlType, shape, size, type, color, className, disabled, loading, onClick, style, children, ref, }) => {
|
|
755
|
+
const [loadingButton, setLoadingButton] = React.useState(false);
|
|
756
|
+
const classButton = [];
|
|
757
|
+
className && classButton.push(...className);
|
|
758
|
+
React.useImperativeHandle(ref, () => ({
|
|
759
|
+
setLoading: setLoadingButton,
|
|
760
|
+
}));
|
|
761
|
+
const button = (jsxRuntimeExports.jsx(antd.Button, { icon: icon, href: href, htmlType: htmlType, shape: shape, size: size, type: type, className: classButton.join(' '), disabled: disabled, loading: loading || loadingButton, onClick: onClick, style: style, children: children }));
|
|
762
|
+
const buttonTooltip = (jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, { children: tooltip
|
|
763
|
+
? (jsxRuntimeExports.jsx(antd.Tooltip, { arrow: true, title: tooltip.title, placement: tooltip.placement, children: button }))
|
|
764
|
+
: button }));
|
|
765
|
+
const getPrimaryColor = () => {
|
|
766
|
+
switch (color) {
|
|
767
|
+
case 'success':
|
|
768
|
+
return '28a745';
|
|
769
|
+
case 'danger':
|
|
770
|
+
return 'dc3545';
|
|
771
|
+
default:
|
|
772
|
+
return '0000ff';
|
|
773
|
+
}
|
|
774
|
+
};
|
|
775
|
+
return color ? (jsxRuntimeExports.jsx(antd.ConfigProvider, { theme: {
|
|
776
|
+
token: {
|
|
777
|
+
colorPrimary: `#${getPrimaryColor()}`,
|
|
778
|
+
},
|
|
779
|
+
}, children: buttonTooltip })) : buttonTooltip;
|
|
780
|
+
};
|
|
781
|
+
|
|
782
|
+
var colLayout = ({ labelCol, wrapperCol }) => {
|
|
783
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
|
|
784
|
+
const colLayout = {};
|
|
785
|
+
const labelOffset = (offset) => {
|
|
786
|
+
if (offset === 24)
|
|
787
|
+
return undefined;
|
|
788
|
+
return offset;
|
|
789
|
+
};
|
|
790
|
+
if ((labelCol === null || labelCol === void 0 ? void 0 : labelCol.xs) || (wrapperCol === null || wrapperCol === void 0 ? void 0 : wrapperCol.xs)) {
|
|
791
|
+
colLayout.xs = {
|
|
792
|
+
offset: labelOffset((_a = labelCol === null || labelCol === void 0 ? void 0 : labelCol.xs) === null || _a === void 0 ? void 0 : _a.span),
|
|
793
|
+
span: (_b = wrapperCol === null || wrapperCol === void 0 ? void 0 : wrapperCol.xs) === null || _b === void 0 ? void 0 : _b.span,
|
|
794
|
+
};
|
|
795
|
+
}
|
|
796
|
+
if ((labelCol === null || labelCol === void 0 ? void 0 : labelCol.sm) || (wrapperCol === null || wrapperCol === void 0 ? void 0 : wrapperCol.sm)) {
|
|
797
|
+
colLayout.sm = {
|
|
798
|
+
offset: labelOffset((_c = labelCol === null || labelCol === void 0 ? void 0 : labelCol.sm) === null || _c === void 0 ? void 0 : _c.span),
|
|
799
|
+
span: (_d = wrapperCol === null || wrapperCol === void 0 ? void 0 : wrapperCol.sm) === null || _d === void 0 ? void 0 : _d.span,
|
|
800
|
+
};
|
|
801
|
+
}
|
|
802
|
+
if ((labelCol === null || labelCol === void 0 ? void 0 : labelCol.md) || (wrapperCol === null || wrapperCol === void 0 ? void 0 : wrapperCol.md)) {
|
|
803
|
+
colLayout.md = {
|
|
804
|
+
offset: labelOffset((_e = labelCol === null || labelCol === void 0 ? void 0 : labelCol.md) === null || _e === void 0 ? void 0 : _e.span),
|
|
805
|
+
span: (_f = wrapperCol === null || wrapperCol === void 0 ? void 0 : wrapperCol.md) === null || _f === void 0 ? void 0 : _f.span,
|
|
806
|
+
};
|
|
807
|
+
}
|
|
808
|
+
if ((labelCol === null || labelCol === void 0 ? void 0 : labelCol.lg) || (wrapperCol === null || wrapperCol === void 0 ? void 0 : wrapperCol.lg)) {
|
|
809
|
+
colLayout.lg = {
|
|
810
|
+
offset: labelOffset((_g = labelCol === null || labelCol === void 0 ? void 0 : labelCol.lg) === null || _g === void 0 ? void 0 : _g.span),
|
|
811
|
+
span: (_h = wrapperCol === null || wrapperCol === void 0 ? void 0 : wrapperCol.lg) === null || _h === void 0 ? void 0 : _h.span,
|
|
812
|
+
};
|
|
813
|
+
}
|
|
814
|
+
if ((labelCol === null || labelCol === void 0 ? void 0 : labelCol.xl) || (wrapperCol === null || wrapperCol === void 0 ? void 0 : wrapperCol.xl)) {
|
|
815
|
+
colLayout.xl = {
|
|
816
|
+
offset: labelOffset((_j = labelCol === null || labelCol === void 0 ? void 0 : labelCol.xl) === null || _j === void 0 ? void 0 : _j.span),
|
|
817
|
+
span: (_k = wrapperCol === null || wrapperCol === void 0 ? void 0 : wrapperCol.xl) === null || _k === void 0 ? void 0 : _k.span,
|
|
818
|
+
};
|
|
819
|
+
}
|
|
820
|
+
if ((labelCol === null || labelCol === void 0 ? void 0 : labelCol.xxl) || (wrapperCol === null || wrapperCol === void 0 ? void 0 : wrapperCol.xxl)) {
|
|
821
|
+
colLayout.xxl = {
|
|
822
|
+
offset: labelOffset((_l = labelCol === null || labelCol === void 0 ? void 0 : labelCol.xxl) === null || _l === void 0 ? void 0 : _l.span),
|
|
823
|
+
span: (_m = wrapperCol === null || wrapperCol === void 0 ? void 0 : wrapperCol.xxl) === null || _m === void 0 ? void 0 : _m.span,
|
|
824
|
+
};
|
|
825
|
+
}
|
|
826
|
+
return colLayout;
|
|
827
|
+
};
|
|
828
|
+
|
|
829
|
+
function styleInject(css, ref) {
|
|
830
|
+
if ( ref === void 0 ) ref = {};
|
|
831
|
+
var insertAt = ref.insertAt;
|
|
832
|
+
|
|
833
|
+
if (typeof document === 'undefined') { return; }
|
|
834
|
+
|
|
835
|
+
var head = document.head || document.getElementsByTagName('head')[0];
|
|
836
|
+
var style = document.createElement('style');
|
|
837
|
+
style.type = 'text/css';
|
|
838
|
+
|
|
839
|
+
if (insertAt === 'top') {
|
|
840
|
+
if (head.firstChild) {
|
|
841
|
+
head.insertBefore(style, head.firstChild);
|
|
842
|
+
} else {
|
|
843
|
+
head.appendChild(style);
|
|
844
|
+
}
|
|
845
|
+
} else {
|
|
846
|
+
head.appendChild(style);
|
|
847
|
+
}
|
|
848
|
+
|
|
849
|
+
if (style.styleSheet) {
|
|
850
|
+
style.styleSheet.cssText = css;
|
|
851
|
+
} else {
|
|
852
|
+
style.appendChild(document.createTextNode(css));
|
|
853
|
+
}
|
|
854
|
+
}
|
|
855
|
+
|
|
856
|
+
var css_248z = ".style-module_button-save__CGfus {\r\n background-color: var(--color-primary-a0);\r\n}\r\n\r\n@keyframes style-module_zoom-in__HJzbj {\r\n from {\r\n width: 0;\r\n opacity: 0;\r\n }\r\n\r\n to {\r\n display: inline-flex;\r\n transform: scaleX(100%) scaleY(100%);\r\n opacity: 1;\r\n }\r\n}\r\n\r\n@keyframes style-module_zoom-out__PqWZu {\r\n from {\r\n display: inline-flex;\r\n }\r\n\r\n to {\r\n transform: scaleX(0) scaleY(0);\r\n width: 0;\r\n opacity: 0;\r\n }\r\n}\r\n\r\ndiv.style-module_button-group__m4a-F.style-module_button-group-add__J3FOg>button:nth-child(-n + 1) {\r\n margin-right: .5rem;\r\n}\r\n\r\ndiv.style-module_button-group__m4a-F.style-module_button-group-edit__-ZIEQ>button:nth-child(-n + 2) {\r\n margin-right: .5rem;\r\n}\r\n\r\ndiv.style-module_button-group__m4a-F>button {\r\n animation: style-module_zoom-in__HJzbj .5s;\r\n}\r\n\r\n.style-module_button-group__m4a-F .style-module_display-none__y57XG {\r\n animation: style-module_zoom-out__PqWZu .5s;\r\n display: none;\r\n}";
|
|
857
|
+
var styleButton = {"button-group":"style-module_button-group__m4a-F","button-group-add":"style-module_button-group-add__J3FOg","button-group-edit":"style-module_button-group-edit__-ZIEQ","display-none":"style-module_display-none__y57XG"};
|
|
858
|
+
styleInject(css_248z);
|
|
859
|
+
|
|
860
|
+
var IconContext = /*#__PURE__*/React.createContext({});
|
|
861
|
+
|
|
862
|
+
function _extends() {
|
|
863
|
+
return _extends = Object.assign ? Object.assign.bind() : function (n) {
|
|
864
|
+
for (var e = 1; e < arguments.length; e++) {
|
|
865
|
+
var t = arguments[e];
|
|
866
|
+
for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]);
|
|
867
|
+
}
|
|
868
|
+
return n;
|
|
869
|
+
}, _extends.apply(null, arguments);
|
|
870
|
+
}
|
|
871
|
+
|
|
872
|
+
function _arrayWithHoles(r) {
|
|
873
|
+
if (Array.isArray(r)) return r;
|
|
874
|
+
}
|
|
875
|
+
|
|
876
|
+
function _iterableToArrayLimit(r, l) {
|
|
877
|
+
var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
|
|
878
|
+
if (null != t) {
|
|
879
|
+
var e,
|
|
880
|
+
n,
|
|
881
|
+
i,
|
|
882
|
+
u,
|
|
883
|
+
a = [],
|
|
884
|
+
f = true,
|
|
885
|
+
o = false;
|
|
886
|
+
try {
|
|
887
|
+
if (i = (t = t.call(r)).next, 0 === l) ; else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0);
|
|
888
|
+
} catch (r) {
|
|
889
|
+
o = true, n = r;
|
|
890
|
+
} finally {
|
|
891
|
+
try {
|
|
892
|
+
if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return;
|
|
893
|
+
} finally {
|
|
894
|
+
if (o) throw n;
|
|
895
|
+
}
|
|
896
|
+
}
|
|
897
|
+
return a;
|
|
898
|
+
}
|
|
899
|
+
}
|
|
900
|
+
|
|
901
|
+
function _arrayLikeToArray(r, a) {
|
|
902
|
+
(null == a || a > r.length) && (a = r.length);
|
|
903
|
+
for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e];
|
|
904
|
+
return n;
|
|
905
|
+
}
|
|
906
|
+
|
|
907
|
+
function _unsupportedIterableToArray(r, a) {
|
|
908
|
+
if (r) {
|
|
909
|
+
if ("string" == typeof r) return _arrayLikeToArray(r, a);
|
|
910
|
+
var t = {}.toString.call(r).slice(8, -1);
|
|
911
|
+
return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0;
|
|
912
|
+
}
|
|
913
|
+
}
|
|
914
|
+
|
|
915
|
+
function _nonIterableRest() {
|
|
916
|
+
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
917
|
+
}
|
|
918
|
+
|
|
919
|
+
function _slicedToArray(r, e) {
|
|
920
|
+
return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest();
|
|
921
|
+
}
|
|
922
|
+
|
|
923
|
+
function _typeof(o) {
|
|
924
|
+
"@babel/helpers - typeof";
|
|
925
|
+
|
|
926
|
+
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) {
|
|
927
|
+
return typeof o;
|
|
928
|
+
} : function (o) {
|
|
929
|
+
return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
|
|
930
|
+
}, _typeof(o);
|
|
931
|
+
}
|
|
932
|
+
|
|
933
|
+
function toPrimitive(t, r) {
|
|
934
|
+
if ("object" != _typeof(t) || !t) return t;
|
|
935
|
+
var e = t[Symbol.toPrimitive];
|
|
936
|
+
if (void 0 !== e) {
|
|
937
|
+
var i = e.call(t, r);
|
|
938
|
+
if ("object" != _typeof(i)) return i;
|
|
939
|
+
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
940
|
+
}
|
|
941
|
+
return ("string" === r ? String : Number)(t);
|
|
942
|
+
}
|
|
943
|
+
|
|
944
|
+
function toPropertyKey(t) {
|
|
945
|
+
var i = toPrimitive(t, "string");
|
|
946
|
+
return "symbol" == _typeof(i) ? i : i + "";
|
|
947
|
+
}
|
|
948
|
+
|
|
949
|
+
function _defineProperty(e, r, t) {
|
|
950
|
+
return (r = toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
|
|
951
|
+
value: t,
|
|
952
|
+
enumerable: true,
|
|
953
|
+
configurable: true,
|
|
954
|
+
writable: true
|
|
955
|
+
}) : e[r] = t, e;
|
|
956
|
+
}
|
|
957
|
+
|
|
958
|
+
function _objectWithoutPropertiesLoose(r, e) {
|
|
959
|
+
if (null == r) return {};
|
|
960
|
+
var t = {};
|
|
961
|
+
for (var n in r) if ({}.hasOwnProperty.call(r, n)) {
|
|
962
|
+
if (-1 !== e.indexOf(n)) continue;
|
|
963
|
+
t[n] = r[n];
|
|
964
|
+
}
|
|
965
|
+
return t;
|
|
966
|
+
}
|
|
967
|
+
|
|
968
|
+
function _objectWithoutProperties(e, t) {
|
|
969
|
+
if (null == e) return {};
|
|
970
|
+
var o,
|
|
971
|
+
r,
|
|
972
|
+
i = _objectWithoutPropertiesLoose(e, t);
|
|
973
|
+
if (Object.getOwnPropertySymbols) {
|
|
974
|
+
var n = Object.getOwnPropertySymbols(e);
|
|
975
|
+
for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]);
|
|
976
|
+
}
|
|
977
|
+
return i;
|
|
978
|
+
}
|
|
979
|
+
|
|
980
|
+
var classnames = {exports: {}};
|
|
981
|
+
|
|
982
|
+
/*!
|
|
983
|
+
Copyright (c) 2018 Jed Watson.
|
|
984
|
+
Licensed under the MIT License (MIT), see
|
|
985
|
+
http://jedwatson.github.io/classnames
|
|
986
|
+
*/
|
|
987
|
+
|
|
988
|
+
var hasRequiredClassnames;
|
|
989
|
+
|
|
990
|
+
function requireClassnames () {
|
|
991
|
+
if (hasRequiredClassnames) return classnames.exports;
|
|
992
|
+
hasRequiredClassnames = 1;
|
|
993
|
+
(function (module) {
|
|
994
|
+
/* global define */
|
|
995
|
+
|
|
996
|
+
(function () {
|
|
997
|
+
|
|
998
|
+
var hasOwn = {}.hasOwnProperty;
|
|
999
|
+
|
|
1000
|
+
function classNames () {
|
|
1001
|
+
var classes = '';
|
|
1002
|
+
|
|
1003
|
+
for (var i = 0; i < arguments.length; i++) {
|
|
1004
|
+
var arg = arguments[i];
|
|
1005
|
+
if (arg) {
|
|
1006
|
+
classes = appendClass(classes, parseValue(arg));
|
|
1007
|
+
}
|
|
1008
|
+
}
|
|
1009
|
+
|
|
1010
|
+
return classes;
|
|
1011
|
+
}
|
|
1012
|
+
|
|
1013
|
+
function parseValue (arg) {
|
|
1014
|
+
if (typeof arg === 'string' || typeof arg === 'number') {
|
|
1015
|
+
return arg;
|
|
1016
|
+
}
|
|
1017
|
+
|
|
1018
|
+
if (typeof arg !== 'object') {
|
|
1019
|
+
return '';
|
|
1020
|
+
}
|
|
1021
|
+
|
|
1022
|
+
if (Array.isArray(arg)) {
|
|
1023
|
+
return classNames.apply(null, arg);
|
|
1024
|
+
}
|
|
1025
|
+
|
|
1026
|
+
if (arg.toString !== Object.prototype.toString && !arg.toString.toString().includes('[native code]')) {
|
|
1027
|
+
return arg.toString();
|
|
1028
|
+
}
|
|
1029
|
+
|
|
1030
|
+
var classes = '';
|
|
1031
|
+
|
|
1032
|
+
for (var key in arg) {
|
|
1033
|
+
if (hasOwn.call(arg, key) && arg[key]) {
|
|
1034
|
+
classes = appendClass(classes, key);
|
|
1035
|
+
}
|
|
1036
|
+
}
|
|
1037
|
+
|
|
1038
|
+
return classes;
|
|
1039
|
+
}
|
|
1040
|
+
|
|
1041
|
+
function appendClass (value, newClass) {
|
|
1042
|
+
if (!newClass) {
|
|
1043
|
+
return value;
|
|
1044
|
+
}
|
|
1045
|
+
|
|
1046
|
+
if (value) {
|
|
1047
|
+
return value + ' ' + newClass;
|
|
1048
|
+
}
|
|
1049
|
+
|
|
1050
|
+
return value + newClass;
|
|
1051
|
+
}
|
|
1052
|
+
|
|
1053
|
+
if (module.exports) {
|
|
1054
|
+
classNames.default = classNames;
|
|
1055
|
+
module.exports = classNames;
|
|
1056
|
+
} else {
|
|
1057
|
+
window.classNames = classNames;
|
|
1058
|
+
}
|
|
1059
|
+
}());
|
|
1060
|
+
} (classnames));
|
|
1061
|
+
return classnames.exports;
|
|
1062
|
+
}
|
|
1063
|
+
|
|
1064
|
+
var classnamesExports = requireClassnames();
|
|
1065
|
+
var classNames = /*@__PURE__*/getDefaultExportFromCjs(classnamesExports);
|
|
1066
|
+
|
|
1067
|
+
const round = Math.round;
|
|
1068
|
+
|
|
1069
|
+
/**
|
|
1070
|
+
* Support format, alpha unit will check the % mark:
|
|
1071
|
+
* - rgba(102, 204, 255, .5) -> [102, 204, 255, 0.5]
|
|
1072
|
+
* - rgb(102 204 255 / .5) -> [102, 204, 255, 0.5]
|
|
1073
|
+
* - rgb(100%, 50%, 0% / 50%) -> [255, 128, 0, 0.5]
|
|
1074
|
+
* - hsl(270, 60, 40, .5) -> [270, 60, 40, 0.5]
|
|
1075
|
+
* - hsl(270deg 60% 40% / 50%) -> [270, 60, 40, 0.5]
|
|
1076
|
+
*
|
|
1077
|
+
* When `base` is provided, the percentage value will be divided by `base`.
|
|
1078
|
+
*/
|
|
1079
|
+
function splitColorStr(str, parseNum) {
|
|
1080
|
+
const match = str
|
|
1081
|
+
// Remove str before `(`
|
|
1082
|
+
.replace(/^[^(]*\((.*)/, '$1')
|
|
1083
|
+
// Remove str after `)`
|
|
1084
|
+
.replace(/\).*/, '').match(/\d*\.?\d+%?/g) || [];
|
|
1085
|
+
const numList = match.map(item => parseFloat(item));
|
|
1086
|
+
for (let i = 0; i < 3; i += 1) {
|
|
1087
|
+
numList[i] = parseNum(numList[i] || 0, match[i] || '', i);
|
|
1088
|
+
}
|
|
1089
|
+
|
|
1090
|
+
// For alpha. 50% should be 0.5
|
|
1091
|
+
if (match[3]) {
|
|
1092
|
+
numList[3] = match[3].includes('%') ? numList[3] / 100 : numList[3];
|
|
1093
|
+
} else {
|
|
1094
|
+
// By default, alpha is 1
|
|
1095
|
+
numList[3] = 1;
|
|
1096
|
+
}
|
|
1097
|
+
return numList;
|
|
1098
|
+
}
|
|
1099
|
+
const parseHSVorHSL = (num, _, index) => index === 0 ? num : num / 100;
|
|
1100
|
+
|
|
1101
|
+
/** round and limit number to integer between 0-255 */
|
|
1102
|
+
function limitRange(value, max) {
|
|
1103
|
+
const mergedMax = max || 255;
|
|
1104
|
+
if (value > mergedMax) {
|
|
1105
|
+
return mergedMax;
|
|
1106
|
+
}
|
|
1107
|
+
if (value < 0) {
|
|
1108
|
+
return 0;
|
|
1109
|
+
}
|
|
1110
|
+
return value;
|
|
1111
|
+
}
|
|
1112
|
+
class FastColor {
|
|
1113
|
+
constructor(input) {
|
|
1114
|
+
/**
|
|
1115
|
+
* All FastColor objects are valid. So isValid is always true. This property is kept to be compatible with TinyColor.
|
|
1116
|
+
*/
|
|
1117
|
+
_defineProperty(this, "isValid", true);
|
|
1118
|
+
/**
|
|
1119
|
+
* Red, R in RGB
|
|
1120
|
+
*/
|
|
1121
|
+
_defineProperty(this, "r", 0);
|
|
1122
|
+
/**
|
|
1123
|
+
* Green, G in RGB
|
|
1124
|
+
*/
|
|
1125
|
+
_defineProperty(this, "g", 0);
|
|
1126
|
+
/**
|
|
1127
|
+
* Blue, B in RGB
|
|
1128
|
+
*/
|
|
1129
|
+
_defineProperty(this, "b", 0);
|
|
1130
|
+
/**
|
|
1131
|
+
* Alpha/Opacity, A in RGBA/HSLA
|
|
1132
|
+
*/
|
|
1133
|
+
_defineProperty(this, "a", 1);
|
|
1134
|
+
// HSV privates
|
|
1135
|
+
_defineProperty(this, "_h", void 0);
|
|
1136
|
+
_defineProperty(this, "_s", void 0);
|
|
1137
|
+
_defineProperty(this, "_l", void 0);
|
|
1138
|
+
_defineProperty(this, "_v", void 0);
|
|
1139
|
+
// intermediate variables to calculate HSL/HSV
|
|
1140
|
+
_defineProperty(this, "_max", void 0);
|
|
1141
|
+
_defineProperty(this, "_min", void 0);
|
|
1142
|
+
_defineProperty(this, "_brightness", void 0);
|
|
1143
|
+
/**
|
|
1144
|
+
* Always check 3 char in the object to determine the format.
|
|
1145
|
+
* We not use function in check to save bundle size.
|
|
1146
|
+
* e.g. 'rgb' -> { r: 0, g: 0, b: 0 }.
|
|
1147
|
+
*/
|
|
1148
|
+
function matchFormat(str) {
|
|
1149
|
+
return str[0] in input && str[1] in input && str[2] in input;
|
|
1150
|
+
}
|
|
1151
|
+
if (!input) ; else if (typeof input === 'string') {
|
|
1152
|
+
const trimStr = input.trim();
|
|
1153
|
+
function matchPrefix(prefix) {
|
|
1154
|
+
return trimStr.startsWith(prefix);
|
|
1155
|
+
}
|
|
1156
|
+
if (/^#?[A-F\d]{3,8}$/i.test(trimStr)) {
|
|
1157
|
+
this.fromHexString(trimStr);
|
|
1158
|
+
} else if (matchPrefix('rgb')) {
|
|
1159
|
+
this.fromRgbString(trimStr);
|
|
1160
|
+
} else if (matchPrefix('hsl')) {
|
|
1161
|
+
this.fromHslString(trimStr);
|
|
1162
|
+
} else if (matchPrefix('hsv') || matchPrefix('hsb')) {
|
|
1163
|
+
this.fromHsvString(trimStr);
|
|
1164
|
+
}
|
|
1165
|
+
} else if (input instanceof FastColor) {
|
|
1166
|
+
this.r = input.r;
|
|
1167
|
+
this.g = input.g;
|
|
1168
|
+
this.b = input.b;
|
|
1169
|
+
this.a = input.a;
|
|
1170
|
+
this._h = input._h;
|
|
1171
|
+
this._s = input._s;
|
|
1172
|
+
this._l = input._l;
|
|
1173
|
+
this._v = input._v;
|
|
1174
|
+
} else if (matchFormat('rgb')) {
|
|
1175
|
+
this.r = limitRange(input.r);
|
|
1176
|
+
this.g = limitRange(input.g);
|
|
1177
|
+
this.b = limitRange(input.b);
|
|
1178
|
+
this.a = typeof input.a === 'number' ? limitRange(input.a, 1) : 1;
|
|
1179
|
+
} else if (matchFormat('hsl')) {
|
|
1180
|
+
this.fromHsl(input);
|
|
1181
|
+
} else if (matchFormat('hsv')) {
|
|
1182
|
+
this.fromHsv(input);
|
|
1183
|
+
} else {
|
|
1184
|
+
throw new Error('@ant-design/fast-color: unsupported input ' + JSON.stringify(input));
|
|
1185
|
+
}
|
|
1186
|
+
}
|
|
1187
|
+
|
|
1188
|
+
// ======================= Setter =======================
|
|
1189
|
+
|
|
1190
|
+
setR(value) {
|
|
1191
|
+
return this._sc('r', value);
|
|
1192
|
+
}
|
|
1193
|
+
setG(value) {
|
|
1194
|
+
return this._sc('g', value);
|
|
1195
|
+
}
|
|
1196
|
+
setB(value) {
|
|
1197
|
+
return this._sc('b', value);
|
|
1198
|
+
}
|
|
1199
|
+
setA(value) {
|
|
1200
|
+
return this._sc('a', value, 1);
|
|
1201
|
+
}
|
|
1202
|
+
setHue(value) {
|
|
1203
|
+
const hsv = this.toHsv();
|
|
1204
|
+
hsv.h = value;
|
|
1205
|
+
return this._c(hsv);
|
|
1206
|
+
}
|
|
1207
|
+
|
|
1208
|
+
// ======================= Getter =======================
|
|
1209
|
+
/**
|
|
1210
|
+
* Returns the perceived luminance of a color, from 0-1.
|
|
1211
|
+
* @see http://www.w3.org/TR/2008/REC-WCAG20-20081211/#relativeluminancedef
|
|
1212
|
+
*/
|
|
1213
|
+
getLuminance() {
|
|
1214
|
+
function adjustGamma(raw) {
|
|
1215
|
+
const val = raw / 255;
|
|
1216
|
+
return val <= 0.03928 ? val / 12.92 : Math.pow((val + 0.055) / 1.055, 2.4);
|
|
1217
|
+
}
|
|
1218
|
+
const R = adjustGamma(this.r);
|
|
1219
|
+
const G = adjustGamma(this.g);
|
|
1220
|
+
const B = adjustGamma(this.b);
|
|
1221
|
+
return 0.2126 * R + 0.7152 * G + 0.0722 * B;
|
|
1222
|
+
}
|
|
1223
|
+
getHue() {
|
|
1224
|
+
if (typeof this._h === 'undefined') {
|
|
1225
|
+
const delta = this.getMax() - this.getMin();
|
|
1226
|
+
if (delta === 0) {
|
|
1227
|
+
this._h = 0;
|
|
1228
|
+
} else {
|
|
1229
|
+
this._h = round(60 * (this.r === this.getMax() ? (this.g - this.b) / delta + (this.g < this.b ? 6 : 0) : this.g === this.getMax() ? (this.b - this.r) / delta + 2 : (this.r - this.g) / delta + 4));
|
|
1230
|
+
}
|
|
1231
|
+
}
|
|
1232
|
+
return this._h;
|
|
1233
|
+
}
|
|
1234
|
+
getSaturation() {
|
|
1235
|
+
if (typeof this._s === 'undefined') {
|
|
1236
|
+
const delta = this.getMax() - this.getMin();
|
|
1237
|
+
if (delta === 0) {
|
|
1238
|
+
this._s = 0;
|
|
1239
|
+
} else {
|
|
1240
|
+
this._s = delta / this.getMax();
|
|
1241
|
+
}
|
|
1242
|
+
}
|
|
1243
|
+
return this._s;
|
|
1244
|
+
}
|
|
1245
|
+
getLightness() {
|
|
1246
|
+
if (typeof this._l === 'undefined') {
|
|
1247
|
+
this._l = (this.getMax() + this.getMin()) / 510;
|
|
1248
|
+
}
|
|
1249
|
+
return this._l;
|
|
1250
|
+
}
|
|
1251
|
+
getValue() {
|
|
1252
|
+
if (typeof this._v === 'undefined') {
|
|
1253
|
+
this._v = this.getMax() / 255;
|
|
1254
|
+
}
|
|
1255
|
+
return this._v;
|
|
1256
|
+
}
|
|
1257
|
+
|
|
1258
|
+
/**
|
|
1259
|
+
* Returns the perceived brightness of the color, from 0-255.
|
|
1260
|
+
* Note: this is not the b of HSB
|
|
1261
|
+
* @see http://www.w3.org/TR/AERT#color-contrast
|
|
1262
|
+
*/
|
|
1263
|
+
getBrightness() {
|
|
1264
|
+
if (typeof this._brightness === 'undefined') {
|
|
1265
|
+
this._brightness = (this.r * 299 + this.g * 587 + this.b * 114) / 1000;
|
|
1266
|
+
}
|
|
1267
|
+
return this._brightness;
|
|
1268
|
+
}
|
|
1269
|
+
|
|
1270
|
+
// ======================== Func ========================
|
|
1271
|
+
|
|
1272
|
+
darken(amount = 10) {
|
|
1273
|
+
const h = this.getHue();
|
|
1274
|
+
const s = this.getSaturation();
|
|
1275
|
+
let l = this.getLightness() - amount / 100;
|
|
1276
|
+
if (l < 0) {
|
|
1277
|
+
l = 0;
|
|
1278
|
+
}
|
|
1279
|
+
return this._c({
|
|
1280
|
+
h,
|
|
1281
|
+
s,
|
|
1282
|
+
l,
|
|
1283
|
+
a: this.a
|
|
1284
|
+
});
|
|
1285
|
+
}
|
|
1286
|
+
lighten(amount = 10) {
|
|
1287
|
+
const h = this.getHue();
|
|
1288
|
+
const s = this.getSaturation();
|
|
1289
|
+
let l = this.getLightness() + amount / 100;
|
|
1290
|
+
if (l > 1) {
|
|
1291
|
+
l = 1;
|
|
1292
|
+
}
|
|
1293
|
+
return this._c({
|
|
1294
|
+
h,
|
|
1295
|
+
s,
|
|
1296
|
+
l,
|
|
1297
|
+
a: this.a
|
|
1298
|
+
});
|
|
1299
|
+
}
|
|
1300
|
+
|
|
1301
|
+
/**
|
|
1302
|
+
* Mix the current color a given amount with another color, from 0 to 100.
|
|
1303
|
+
* 0 means no mixing (return current color).
|
|
1304
|
+
*/
|
|
1305
|
+
mix(input, amount = 50) {
|
|
1306
|
+
const color = this._c(input);
|
|
1307
|
+
const p = amount / 100;
|
|
1308
|
+
const calc = key => (color[key] - this[key]) * p + this[key];
|
|
1309
|
+
const rgba = {
|
|
1310
|
+
r: round(calc('r')),
|
|
1311
|
+
g: round(calc('g')),
|
|
1312
|
+
b: round(calc('b')),
|
|
1313
|
+
a: round(calc('a') * 100) / 100
|
|
1314
|
+
};
|
|
1315
|
+
return this._c(rgba);
|
|
1316
|
+
}
|
|
1317
|
+
|
|
1318
|
+
/**
|
|
1319
|
+
* Mix the color with pure white, from 0 to 100.
|
|
1320
|
+
* Providing 0 will do nothing, providing 100 will always return white.
|
|
1321
|
+
*/
|
|
1322
|
+
tint(amount = 10) {
|
|
1323
|
+
return this.mix({
|
|
1324
|
+
r: 255,
|
|
1325
|
+
g: 255,
|
|
1326
|
+
b: 255,
|
|
1327
|
+
a: 1
|
|
1328
|
+
}, amount);
|
|
1329
|
+
}
|
|
1330
|
+
|
|
1331
|
+
/**
|
|
1332
|
+
* Mix the color with pure black, from 0 to 100.
|
|
1333
|
+
* Providing 0 will do nothing, providing 100 will always return black.
|
|
1334
|
+
*/
|
|
1335
|
+
shade(amount = 10) {
|
|
1336
|
+
return this.mix({
|
|
1337
|
+
r: 0,
|
|
1338
|
+
g: 0,
|
|
1339
|
+
b: 0,
|
|
1340
|
+
a: 1
|
|
1341
|
+
}, amount);
|
|
1342
|
+
}
|
|
1343
|
+
onBackground(background) {
|
|
1344
|
+
const bg = this._c(background);
|
|
1345
|
+
const alpha = this.a + bg.a * (1 - this.a);
|
|
1346
|
+
const calc = key => {
|
|
1347
|
+
return round((this[key] * this.a + bg[key] * bg.a * (1 - this.a)) / alpha);
|
|
1348
|
+
};
|
|
1349
|
+
return this._c({
|
|
1350
|
+
r: calc('r'),
|
|
1351
|
+
g: calc('g'),
|
|
1352
|
+
b: calc('b'),
|
|
1353
|
+
a: alpha
|
|
1354
|
+
});
|
|
1355
|
+
}
|
|
1356
|
+
|
|
1357
|
+
// ======================= Status =======================
|
|
1358
|
+
isDark() {
|
|
1359
|
+
return this.getBrightness() < 128;
|
|
1360
|
+
}
|
|
1361
|
+
isLight() {
|
|
1362
|
+
return this.getBrightness() >= 128;
|
|
1363
|
+
}
|
|
1364
|
+
|
|
1365
|
+
// ======================== MISC ========================
|
|
1366
|
+
equals(other) {
|
|
1367
|
+
return this.r === other.r && this.g === other.g && this.b === other.b && this.a === other.a;
|
|
1368
|
+
}
|
|
1369
|
+
clone() {
|
|
1370
|
+
return this._c(this);
|
|
1371
|
+
}
|
|
1372
|
+
|
|
1373
|
+
// ======================= Format =======================
|
|
1374
|
+
toHexString() {
|
|
1375
|
+
let hex = '#';
|
|
1376
|
+
const rHex = (this.r || 0).toString(16);
|
|
1377
|
+
hex += rHex.length === 2 ? rHex : '0' + rHex;
|
|
1378
|
+
const gHex = (this.g || 0).toString(16);
|
|
1379
|
+
hex += gHex.length === 2 ? gHex : '0' + gHex;
|
|
1380
|
+
const bHex = (this.b || 0).toString(16);
|
|
1381
|
+
hex += bHex.length === 2 ? bHex : '0' + bHex;
|
|
1382
|
+
if (typeof this.a === 'number' && this.a >= 0 && this.a < 1) {
|
|
1383
|
+
const aHex = round(this.a * 255).toString(16);
|
|
1384
|
+
hex += aHex.length === 2 ? aHex : '0' + aHex;
|
|
1385
|
+
}
|
|
1386
|
+
return hex;
|
|
1387
|
+
}
|
|
1388
|
+
|
|
1389
|
+
/** CSS support color pattern */
|
|
1390
|
+
toHsl() {
|
|
1391
|
+
return {
|
|
1392
|
+
h: this.getHue(),
|
|
1393
|
+
s: this.getSaturation(),
|
|
1394
|
+
l: this.getLightness(),
|
|
1395
|
+
a: this.a
|
|
1396
|
+
};
|
|
1397
|
+
}
|
|
1398
|
+
|
|
1399
|
+
/** CSS support color pattern */
|
|
1400
|
+
toHslString() {
|
|
1401
|
+
const h = this.getHue();
|
|
1402
|
+
const s = round(this.getSaturation() * 100);
|
|
1403
|
+
const l = round(this.getLightness() * 100);
|
|
1404
|
+
return this.a !== 1 ? `hsla(${h},${s}%,${l}%,${this.a})` : `hsl(${h},${s}%,${l}%)`;
|
|
1405
|
+
}
|
|
1406
|
+
|
|
1407
|
+
/** Same as toHsb */
|
|
1408
|
+
toHsv() {
|
|
1409
|
+
return {
|
|
1410
|
+
h: this.getHue(),
|
|
1411
|
+
s: this.getSaturation(),
|
|
1412
|
+
v: this.getValue(),
|
|
1413
|
+
a: this.a
|
|
1414
|
+
};
|
|
1415
|
+
}
|
|
1416
|
+
toRgb() {
|
|
1417
|
+
return {
|
|
1418
|
+
r: this.r,
|
|
1419
|
+
g: this.g,
|
|
1420
|
+
b: this.b,
|
|
1421
|
+
a: this.a
|
|
1422
|
+
};
|
|
1423
|
+
}
|
|
1424
|
+
toRgbString() {
|
|
1425
|
+
return this.a !== 1 ? `rgba(${this.r},${this.g},${this.b},${this.a})` : `rgb(${this.r},${this.g},${this.b})`;
|
|
1426
|
+
}
|
|
1427
|
+
toString() {
|
|
1428
|
+
return this.toRgbString();
|
|
1429
|
+
}
|
|
1430
|
+
|
|
1431
|
+
// ====================== Privates ======================
|
|
1432
|
+
/** Return a new FastColor object with one channel changed */
|
|
1433
|
+
_sc(rgb, value, max) {
|
|
1434
|
+
const clone = this.clone();
|
|
1435
|
+
clone[rgb] = limitRange(value, max);
|
|
1436
|
+
return clone;
|
|
1437
|
+
}
|
|
1438
|
+
_c(input) {
|
|
1439
|
+
return new this.constructor(input);
|
|
1440
|
+
}
|
|
1441
|
+
getMax() {
|
|
1442
|
+
if (typeof this._max === 'undefined') {
|
|
1443
|
+
this._max = Math.max(this.r, this.g, this.b);
|
|
1444
|
+
}
|
|
1445
|
+
return this._max;
|
|
1446
|
+
}
|
|
1447
|
+
getMin() {
|
|
1448
|
+
if (typeof this._min === 'undefined') {
|
|
1449
|
+
this._min = Math.min(this.r, this.g, this.b);
|
|
1450
|
+
}
|
|
1451
|
+
return this._min;
|
|
1452
|
+
}
|
|
1453
|
+
fromHexString(trimStr) {
|
|
1454
|
+
const withoutPrefix = trimStr.replace('#', '');
|
|
1455
|
+
function connectNum(index1, index2) {
|
|
1456
|
+
return parseInt(withoutPrefix[index1] + withoutPrefix[index2 || index1], 16);
|
|
1457
|
+
}
|
|
1458
|
+
if (withoutPrefix.length < 6) {
|
|
1459
|
+
// #rgb or #rgba
|
|
1460
|
+
this.r = connectNum(0);
|
|
1461
|
+
this.g = connectNum(1);
|
|
1462
|
+
this.b = connectNum(2);
|
|
1463
|
+
this.a = withoutPrefix[3] ? connectNum(3) / 255 : 1;
|
|
1464
|
+
} else {
|
|
1465
|
+
// #rrggbb or #rrggbbaa
|
|
1466
|
+
this.r = connectNum(0, 1);
|
|
1467
|
+
this.g = connectNum(2, 3);
|
|
1468
|
+
this.b = connectNum(4, 5);
|
|
1469
|
+
this.a = withoutPrefix[6] ? connectNum(6, 7) / 255 : 1;
|
|
1470
|
+
}
|
|
1471
|
+
}
|
|
1472
|
+
fromHsl({
|
|
1473
|
+
h,
|
|
1474
|
+
s,
|
|
1475
|
+
l,
|
|
1476
|
+
a
|
|
1477
|
+
}) {
|
|
1478
|
+
this._h = h % 360;
|
|
1479
|
+
this._s = s;
|
|
1480
|
+
this._l = l;
|
|
1481
|
+
this.a = typeof a === 'number' ? a : 1;
|
|
1482
|
+
if (s <= 0) {
|
|
1483
|
+
const rgb = round(l * 255);
|
|
1484
|
+
this.r = rgb;
|
|
1485
|
+
this.g = rgb;
|
|
1486
|
+
this.b = rgb;
|
|
1487
|
+
}
|
|
1488
|
+
let r = 0,
|
|
1489
|
+
g = 0,
|
|
1490
|
+
b = 0;
|
|
1491
|
+
const huePrime = h / 60;
|
|
1492
|
+
const chroma = (1 - Math.abs(2 * l - 1)) * s;
|
|
1493
|
+
const secondComponent = chroma * (1 - Math.abs(huePrime % 2 - 1));
|
|
1494
|
+
if (huePrime >= 0 && huePrime < 1) {
|
|
1495
|
+
r = chroma;
|
|
1496
|
+
g = secondComponent;
|
|
1497
|
+
} else if (huePrime >= 1 && huePrime < 2) {
|
|
1498
|
+
r = secondComponent;
|
|
1499
|
+
g = chroma;
|
|
1500
|
+
} else if (huePrime >= 2 && huePrime < 3) {
|
|
1501
|
+
g = chroma;
|
|
1502
|
+
b = secondComponent;
|
|
1503
|
+
} else if (huePrime >= 3 && huePrime < 4) {
|
|
1504
|
+
g = secondComponent;
|
|
1505
|
+
b = chroma;
|
|
1506
|
+
} else if (huePrime >= 4 && huePrime < 5) {
|
|
1507
|
+
r = secondComponent;
|
|
1508
|
+
b = chroma;
|
|
1509
|
+
} else if (huePrime >= 5 && huePrime < 6) {
|
|
1510
|
+
r = chroma;
|
|
1511
|
+
b = secondComponent;
|
|
1512
|
+
}
|
|
1513
|
+
const lightnessModification = l - chroma / 2;
|
|
1514
|
+
this.r = round((r + lightnessModification) * 255);
|
|
1515
|
+
this.g = round((g + lightnessModification) * 255);
|
|
1516
|
+
this.b = round((b + lightnessModification) * 255);
|
|
1517
|
+
}
|
|
1518
|
+
fromHsv({
|
|
1519
|
+
h,
|
|
1520
|
+
s,
|
|
1521
|
+
v,
|
|
1522
|
+
a
|
|
1523
|
+
}) {
|
|
1524
|
+
this._h = h % 360;
|
|
1525
|
+
this._s = s;
|
|
1526
|
+
this._v = v;
|
|
1527
|
+
this.a = typeof a === 'number' ? a : 1;
|
|
1528
|
+
const vv = round(v * 255);
|
|
1529
|
+
this.r = vv;
|
|
1530
|
+
this.g = vv;
|
|
1531
|
+
this.b = vv;
|
|
1532
|
+
if (s <= 0) {
|
|
1533
|
+
return;
|
|
1534
|
+
}
|
|
1535
|
+
const hh = h / 60;
|
|
1536
|
+
const i = Math.floor(hh);
|
|
1537
|
+
const ff = hh - i;
|
|
1538
|
+
const p = round(v * (1.0 - s) * 255);
|
|
1539
|
+
const q = round(v * (1.0 - s * ff) * 255);
|
|
1540
|
+
const t = round(v * (1.0 - s * (1.0 - ff)) * 255);
|
|
1541
|
+
switch (i) {
|
|
1542
|
+
case 0:
|
|
1543
|
+
this.g = t;
|
|
1544
|
+
this.b = p;
|
|
1545
|
+
break;
|
|
1546
|
+
case 1:
|
|
1547
|
+
this.r = q;
|
|
1548
|
+
this.b = p;
|
|
1549
|
+
break;
|
|
1550
|
+
case 2:
|
|
1551
|
+
this.r = p;
|
|
1552
|
+
this.b = t;
|
|
1553
|
+
break;
|
|
1554
|
+
case 3:
|
|
1555
|
+
this.r = p;
|
|
1556
|
+
this.g = q;
|
|
1557
|
+
break;
|
|
1558
|
+
case 4:
|
|
1559
|
+
this.r = t;
|
|
1560
|
+
this.g = p;
|
|
1561
|
+
break;
|
|
1562
|
+
case 5:
|
|
1563
|
+
default:
|
|
1564
|
+
this.g = p;
|
|
1565
|
+
this.b = q;
|
|
1566
|
+
break;
|
|
1567
|
+
}
|
|
1568
|
+
}
|
|
1569
|
+
fromHsvString(trimStr) {
|
|
1570
|
+
const cells = splitColorStr(trimStr, parseHSVorHSL);
|
|
1571
|
+
this.fromHsv({
|
|
1572
|
+
h: cells[0],
|
|
1573
|
+
s: cells[1],
|
|
1574
|
+
v: cells[2],
|
|
1575
|
+
a: cells[3]
|
|
1576
|
+
});
|
|
1577
|
+
}
|
|
1578
|
+
fromHslString(trimStr) {
|
|
1579
|
+
const cells = splitColorStr(trimStr, parseHSVorHSL);
|
|
1580
|
+
this.fromHsl({
|
|
1581
|
+
h: cells[0],
|
|
1582
|
+
s: cells[1],
|
|
1583
|
+
l: cells[2],
|
|
1584
|
+
a: cells[3]
|
|
1585
|
+
});
|
|
1586
|
+
}
|
|
1587
|
+
fromRgbString(trimStr) {
|
|
1588
|
+
const cells = splitColorStr(trimStr, (num, txt) =>
|
|
1589
|
+
// Convert percentage to number. e.g. 50% -> 128
|
|
1590
|
+
txt.includes('%') ? round(num / 100 * 255) : num);
|
|
1591
|
+
this.r = cells[0];
|
|
1592
|
+
this.g = cells[1];
|
|
1593
|
+
this.b = cells[2];
|
|
1594
|
+
this.a = cells[3];
|
|
1595
|
+
}
|
|
1596
|
+
}
|
|
1597
|
+
|
|
1598
|
+
var hueStep = 2; // 色相阶梯
|
|
1599
|
+
var saturationStep = 0.16; // 饱和度阶梯,浅色部分
|
|
1600
|
+
var saturationStep2 = 0.05; // 饱和度阶梯,深色部分
|
|
1601
|
+
var brightnessStep1 = 0.05; // 亮度阶梯,浅色部分
|
|
1602
|
+
var brightnessStep2 = 0.15; // 亮度阶梯,深色部分
|
|
1603
|
+
var lightColorCount = 5; // 浅色数量,主色上
|
|
1604
|
+
var darkColorCount = 4; // 深色数量,主色下
|
|
1605
|
+
|
|
1606
|
+
// 暗色主题颜色映射关系表
|
|
1607
|
+
var darkColorMap = [{
|
|
1608
|
+
index: 7,
|
|
1609
|
+
amount: 15
|
|
1610
|
+
}, {
|
|
1611
|
+
index: 6,
|
|
1612
|
+
amount: 25
|
|
1613
|
+
}, {
|
|
1614
|
+
index: 5,
|
|
1615
|
+
amount: 30
|
|
1616
|
+
}, {
|
|
1617
|
+
index: 5,
|
|
1618
|
+
amount: 45
|
|
1619
|
+
}, {
|
|
1620
|
+
index: 5,
|
|
1621
|
+
amount: 65
|
|
1622
|
+
}, {
|
|
1623
|
+
index: 5,
|
|
1624
|
+
amount: 85
|
|
1625
|
+
}, {
|
|
1626
|
+
index: 4,
|
|
1627
|
+
amount: 90
|
|
1628
|
+
}, {
|
|
1629
|
+
index: 3,
|
|
1630
|
+
amount: 95
|
|
1631
|
+
}, {
|
|
1632
|
+
index: 2,
|
|
1633
|
+
amount: 97
|
|
1634
|
+
}, {
|
|
1635
|
+
index: 1,
|
|
1636
|
+
amount: 98
|
|
1637
|
+
}];
|
|
1638
|
+
function getHue(hsv, i, light) {
|
|
1639
|
+
var hue;
|
|
1640
|
+
// 根据色相不同,色相转向不同
|
|
1641
|
+
if (Math.round(hsv.h) >= 60 && Math.round(hsv.h) <= 240) {
|
|
1642
|
+
hue = light ? Math.round(hsv.h) - hueStep * i : Math.round(hsv.h) + hueStep * i;
|
|
1643
|
+
} else {
|
|
1644
|
+
hue = light ? Math.round(hsv.h) + hueStep * i : Math.round(hsv.h) - hueStep * i;
|
|
1645
|
+
}
|
|
1646
|
+
if (hue < 0) {
|
|
1647
|
+
hue += 360;
|
|
1648
|
+
} else if (hue >= 360) {
|
|
1649
|
+
hue -= 360;
|
|
1650
|
+
}
|
|
1651
|
+
return hue;
|
|
1652
|
+
}
|
|
1653
|
+
function getSaturation(hsv, i, light) {
|
|
1654
|
+
// grey color don't change saturation
|
|
1655
|
+
if (hsv.h === 0 && hsv.s === 0) {
|
|
1656
|
+
return hsv.s;
|
|
1657
|
+
}
|
|
1658
|
+
var saturation;
|
|
1659
|
+
if (light) {
|
|
1660
|
+
saturation = hsv.s - saturationStep * i;
|
|
1661
|
+
} else if (i === darkColorCount) {
|
|
1662
|
+
saturation = hsv.s + saturationStep;
|
|
1663
|
+
} else {
|
|
1664
|
+
saturation = hsv.s + saturationStep2 * i;
|
|
1665
|
+
}
|
|
1666
|
+
// 边界值修正
|
|
1667
|
+
if (saturation > 1) {
|
|
1668
|
+
saturation = 1;
|
|
1669
|
+
}
|
|
1670
|
+
// 第一格的 s 限制在 0.06-0.1 之间
|
|
1671
|
+
if (light && i === lightColorCount && saturation > 0.1) {
|
|
1672
|
+
saturation = 0.1;
|
|
1673
|
+
}
|
|
1674
|
+
if (saturation < 0.06) {
|
|
1675
|
+
saturation = 0.06;
|
|
1676
|
+
}
|
|
1677
|
+
return Math.round(saturation * 100) / 100;
|
|
1678
|
+
}
|
|
1679
|
+
function getValue(hsv, i, light) {
|
|
1680
|
+
var value;
|
|
1681
|
+
if (light) {
|
|
1682
|
+
value = hsv.v + brightnessStep1 * i;
|
|
1683
|
+
} else {
|
|
1684
|
+
value = hsv.v - brightnessStep2 * i;
|
|
1685
|
+
}
|
|
1686
|
+
// Clamp value between 0 and 1
|
|
1687
|
+
value = Math.max(0, Math.min(1, value));
|
|
1688
|
+
return Math.round(value * 100) / 100;
|
|
1689
|
+
}
|
|
1690
|
+
function generate$1(color) {
|
|
1691
|
+
var opts = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
1692
|
+
var patterns = [];
|
|
1693
|
+
var pColor = new FastColor(color);
|
|
1694
|
+
var hsv = pColor.toHsv();
|
|
1695
|
+
for (var i = lightColorCount; i > 0; i -= 1) {
|
|
1696
|
+
var c = new FastColor({
|
|
1697
|
+
h: getHue(hsv, i, true),
|
|
1698
|
+
s: getSaturation(hsv, i, true),
|
|
1699
|
+
v: getValue(hsv, i, true)
|
|
1700
|
+
});
|
|
1701
|
+
patterns.push(c);
|
|
1702
|
+
}
|
|
1703
|
+
patterns.push(pColor);
|
|
1704
|
+
for (var _i = 1; _i <= darkColorCount; _i += 1) {
|
|
1705
|
+
var _c = new FastColor({
|
|
1706
|
+
h: getHue(hsv, _i),
|
|
1707
|
+
s: getSaturation(hsv, _i),
|
|
1708
|
+
v: getValue(hsv, _i)
|
|
1709
|
+
});
|
|
1710
|
+
patterns.push(_c);
|
|
1711
|
+
}
|
|
1712
|
+
|
|
1713
|
+
// dark theme patterns
|
|
1714
|
+
if (opts.theme === 'dark') {
|
|
1715
|
+
return darkColorMap.map(function (_ref) {
|
|
1716
|
+
var index = _ref.index,
|
|
1717
|
+
amount = _ref.amount;
|
|
1718
|
+
return new FastColor(opts.backgroundColor || '#141414').mix(patterns[index], amount).toHexString();
|
|
1719
|
+
});
|
|
1720
|
+
}
|
|
1721
|
+
return patterns.map(function (c) {
|
|
1722
|
+
return c.toHexString();
|
|
1723
|
+
});
|
|
1724
|
+
}
|
|
1725
|
+
|
|
1726
|
+
// Generated by script. Do NOT modify!
|
|
1727
|
+
|
|
1728
|
+
var blue = ["#e6f4ff", "#bae0ff", "#91caff", "#69b1ff", "#4096ff", "#1677ff", "#0958d9", "#003eb3", "#002c8c", "#001d66"];
|
|
1729
|
+
blue.primary = blue[5];
|
|
1730
|
+
|
|
1731
|
+
function ownKeys(e, r) {
|
|
1732
|
+
var t = Object.keys(e);
|
|
1733
|
+
if (Object.getOwnPropertySymbols) {
|
|
1734
|
+
var o = Object.getOwnPropertySymbols(e);
|
|
1735
|
+
r && (o = o.filter(function (r) {
|
|
1736
|
+
return Object.getOwnPropertyDescriptor(e, r).enumerable;
|
|
1737
|
+
})), t.push.apply(t, o);
|
|
1738
|
+
}
|
|
1739
|
+
return t;
|
|
1740
|
+
}
|
|
1741
|
+
function _objectSpread2(e) {
|
|
1742
|
+
for (var r = 1; r < arguments.length; r++) {
|
|
1743
|
+
var t = null != arguments[r] ? arguments[r] : {};
|
|
1744
|
+
r % 2 ? ownKeys(Object(t), true).forEach(function (r) {
|
|
1745
|
+
_defineProperty(e, r, t[r]);
|
|
1746
|
+
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) {
|
|
1747
|
+
Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r));
|
|
1748
|
+
});
|
|
1749
|
+
}
|
|
1750
|
+
return e;
|
|
1751
|
+
}
|
|
1752
|
+
|
|
1753
|
+
function canUseDom() {
|
|
1754
|
+
return !!(typeof window !== 'undefined' && window.document && window.document.createElement);
|
|
1755
|
+
}
|
|
1756
|
+
|
|
1757
|
+
function contains(root, n) {
|
|
1758
|
+
if (!root) {
|
|
1759
|
+
return false;
|
|
1760
|
+
}
|
|
1761
|
+
|
|
1762
|
+
// Use native if support
|
|
1763
|
+
if (root.contains) {
|
|
1764
|
+
return root.contains(n);
|
|
1765
|
+
}
|
|
1766
|
+
|
|
1767
|
+
// `document.contains` not support with IE11
|
|
1768
|
+
var node = n;
|
|
1769
|
+
while (node) {
|
|
1770
|
+
if (node === root) {
|
|
1771
|
+
return true;
|
|
1772
|
+
}
|
|
1773
|
+
node = node.parentNode;
|
|
1774
|
+
}
|
|
1775
|
+
return false;
|
|
1776
|
+
}
|
|
1777
|
+
|
|
1778
|
+
var APPEND_ORDER = 'data-rc-order';
|
|
1779
|
+
var APPEND_PRIORITY = 'data-rc-priority';
|
|
1780
|
+
var MARK_KEY = "rc-util-key";
|
|
1781
|
+
var containerCache = new Map();
|
|
1782
|
+
function getMark() {
|
|
1783
|
+
var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
|
|
1784
|
+
mark = _ref.mark;
|
|
1785
|
+
if (mark) {
|
|
1786
|
+
return mark.startsWith('data-') ? mark : "data-".concat(mark);
|
|
1787
|
+
}
|
|
1788
|
+
return MARK_KEY;
|
|
1789
|
+
}
|
|
1790
|
+
function getContainer(option) {
|
|
1791
|
+
if (option.attachTo) {
|
|
1792
|
+
return option.attachTo;
|
|
1793
|
+
}
|
|
1794
|
+
var head = document.querySelector('head');
|
|
1795
|
+
return head || document.body;
|
|
1796
|
+
}
|
|
1797
|
+
function getOrder(prepend) {
|
|
1798
|
+
if (prepend === 'queue') {
|
|
1799
|
+
return 'prependQueue';
|
|
1800
|
+
}
|
|
1801
|
+
return prepend ? 'prepend' : 'append';
|
|
1802
|
+
}
|
|
1803
|
+
|
|
1804
|
+
/**
|
|
1805
|
+
* Find style which inject by rc-util
|
|
1806
|
+
*/
|
|
1807
|
+
function findStyles(container) {
|
|
1808
|
+
return Array.from((containerCache.get(container) || container).children).filter(function (node) {
|
|
1809
|
+
return node.tagName === 'STYLE';
|
|
1810
|
+
});
|
|
1811
|
+
}
|
|
1812
|
+
function injectCSS(css) {
|
|
1813
|
+
var option = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
1814
|
+
if (!canUseDom()) {
|
|
1815
|
+
return null;
|
|
1816
|
+
}
|
|
1817
|
+
var csp = option.csp,
|
|
1818
|
+
prepend = option.prepend,
|
|
1819
|
+
_option$priority = option.priority,
|
|
1820
|
+
priority = _option$priority === void 0 ? 0 : _option$priority;
|
|
1821
|
+
var mergedOrder = getOrder(prepend);
|
|
1822
|
+
var isPrependQueue = mergedOrder === 'prependQueue';
|
|
1823
|
+
var styleNode = document.createElement('style');
|
|
1824
|
+
styleNode.setAttribute(APPEND_ORDER, mergedOrder);
|
|
1825
|
+
if (isPrependQueue && priority) {
|
|
1826
|
+
styleNode.setAttribute(APPEND_PRIORITY, "".concat(priority));
|
|
1827
|
+
}
|
|
1828
|
+
if (csp !== null && csp !== void 0 && csp.nonce) {
|
|
1829
|
+
styleNode.nonce = csp === null || csp === void 0 ? void 0 : csp.nonce;
|
|
1830
|
+
}
|
|
1831
|
+
styleNode.innerHTML = css;
|
|
1832
|
+
var container = getContainer(option);
|
|
1833
|
+
var firstChild = container.firstChild;
|
|
1834
|
+
if (prepend) {
|
|
1835
|
+
// If is queue `prepend`, it will prepend first style and then append rest style
|
|
1836
|
+
if (isPrependQueue) {
|
|
1837
|
+
var existStyle = (option.styles || findStyles(container)).filter(function (node) {
|
|
1838
|
+
// Ignore style which not injected by rc-util with prepend
|
|
1839
|
+
if (!['prepend', 'prependQueue'].includes(node.getAttribute(APPEND_ORDER))) {
|
|
1840
|
+
return false;
|
|
1841
|
+
}
|
|
1842
|
+
|
|
1843
|
+
// Ignore style which priority less then new style
|
|
1844
|
+
var nodePriority = Number(node.getAttribute(APPEND_PRIORITY) || 0);
|
|
1845
|
+
return priority >= nodePriority;
|
|
1846
|
+
});
|
|
1847
|
+
if (existStyle.length) {
|
|
1848
|
+
container.insertBefore(styleNode, existStyle[existStyle.length - 1].nextSibling);
|
|
1849
|
+
return styleNode;
|
|
1850
|
+
}
|
|
1851
|
+
}
|
|
1852
|
+
|
|
1853
|
+
// Use `insertBefore` as `prepend`
|
|
1854
|
+
container.insertBefore(styleNode, firstChild);
|
|
1855
|
+
} else {
|
|
1856
|
+
container.appendChild(styleNode);
|
|
1857
|
+
}
|
|
1858
|
+
return styleNode;
|
|
1859
|
+
}
|
|
1860
|
+
function findExistNode(key) {
|
|
1861
|
+
var option = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
1862
|
+
var container = getContainer(option);
|
|
1863
|
+
return (option.styles || findStyles(container)).find(function (node) {
|
|
1864
|
+
return node.getAttribute(getMark(option)) === key;
|
|
1865
|
+
});
|
|
1866
|
+
}
|
|
1867
|
+
|
|
1868
|
+
/**
|
|
1869
|
+
* qiankun will inject `appendChild` to insert into other
|
|
1870
|
+
*/
|
|
1871
|
+
function syncRealContainer(container, option) {
|
|
1872
|
+
var cachedRealContainer = containerCache.get(container);
|
|
1873
|
+
|
|
1874
|
+
// Find real container when not cached or cached container removed
|
|
1875
|
+
if (!cachedRealContainer || !contains(document, cachedRealContainer)) {
|
|
1876
|
+
var placeholderStyle = injectCSS('', option);
|
|
1877
|
+
var parentNode = placeholderStyle.parentNode;
|
|
1878
|
+
containerCache.set(container, parentNode);
|
|
1879
|
+
container.removeChild(placeholderStyle);
|
|
1880
|
+
}
|
|
1881
|
+
}
|
|
1882
|
+
function updateCSS(css, key) {
|
|
1883
|
+
var originOption = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
1884
|
+
var container = getContainer(originOption);
|
|
1885
|
+
var styles = findStyles(container);
|
|
1886
|
+
var option = _objectSpread2(_objectSpread2({}, originOption), {}, {
|
|
1887
|
+
styles: styles
|
|
1888
|
+
});
|
|
1889
|
+
|
|
1890
|
+
// Sync real parent
|
|
1891
|
+
syncRealContainer(container, option);
|
|
1892
|
+
var existNode = findExistNode(key, option);
|
|
1893
|
+
if (existNode) {
|
|
1894
|
+
var _option$csp, _option$csp2;
|
|
1895
|
+
if ((_option$csp = option.csp) !== null && _option$csp !== void 0 && _option$csp.nonce && existNode.nonce !== ((_option$csp2 = option.csp) === null || _option$csp2 === void 0 ? void 0 : _option$csp2.nonce)) {
|
|
1896
|
+
var _option$csp3;
|
|
1897
|
+
existNode.nonce = (_option$csp3 = option.csp) === null || _option$csp3 === void 0 ? void 0 : _option$csp3.nonce;
|
|
1898
|
+
}
|
|
1899
|
+
if (existNode.innerHTML !== css) {
|
|
1900
|
+
existNode.innerHTML = css;
|
|
1901
|
+
}
|
|
1902
|
+
return existNode;
|
|
1903
|
+
}
|
|
1904
|
+
var newNode = injectCSS(css, option);
|
|
1905
|
+
newNode.setAttribute(getMark(option), key);
|
|
1906
|
+
return newNode;
|
|
1907
|
+
}
|
|
1908
|
+
|
|
1909
|
+
function getRoot(ele) {
|
|
1910
|
+
var _ele$getRootNode;
|
|
1911
|
+
return ele === null || ele === void 0 || (_ele$getRootNode = ele.getRootNode) === null || _ele$getRootNode === void 0 ? void 0 : _ele$getRootNode.call(ele);
|
|
1912
|
+
}
|
|
1913
|
+
|
|
1914
|
+
/**
|
|
1915
|
+
* Check if is in shadowRoot
|
|
1916
|
+
*/
|
|
1917
|
+
function inShadow(ele) {
|
|
1918
|
+
return getRoot(ele) instanceof ShadowRoot;
|
|
1919
|
+
}
|
|
1920
|
+
|
|
1921
|
+
/**
|
|
1922
|
+
* Return shadowRoot if possible
|
|
1923
|
+
*/
|
|
1924
|
+
function getShadowRoot(ele) {
|
|
1925
|
+
return inShadow(ele) ? getRoot(ele) : null;
|
|
1926
|
+
}
|
|
1927
|
+
|
|
1928
|
+
/* eslint-disable no-console */
|
|
1929
|
+
var warned = {};
|
|
1930
|
+
var preWarningFns = [];
|
|
1931
|
+
|
|
1932
|
+
/**
|
|
1933
|
+
* Pre warning enable you to parse content before console.error.
|
|
1934
|
+
* Modify to null will prevent warning.
|
|
1935
|
+
*/
|
|
1936
|
+
var preMessage = function preMessage(fn) {
|
|
1937
|
+
preWarningFns.push(fn);
|
|
1938
|
+
};
|
|
1939
|
+
|
|
1940
|
+
/**
|
|
1941
|
+
* Warning if condition not match.
|
|
1942
|
+
* @param valid Condition
|
|
1943
|
+
* @param message Warning message
|
|
1944
|
+
* @example
|
|
1945
|
+
* ```js
|
|
1946
|
+
* warning(false, 'some error'); // print some error
|
|
1947
|
+
* warning(true, 'some error'); // print nothing
|
|
1948
|
+
* warning(1 === 2, 'some error'); // print some error
|
|
1949
|
+
* ```
|
|
1950
|
+
*/
|
|
1951
|
+
function warning$1(valid, message) {
|
|
1952
|
+
if (process.env.NODE_ENV !== 'production' && !valid && console !== undefined) {
|
|
1953
|
+
var finalMessage = preWarningFns.reduce(function (msg, preMessageFn) {
|
|
1954
|
+
return preMessageFn(msg !== null && msg !== void 0 ? msg : '', 'warning');
|
|
1955
|
+
}, message);
|
|
1956
|
+
if (finalMessage) {
|
|
1957
|
+
console.error("Warning: ".concat(finalMessage));
|
|
1958
|
+
}
|
|
1959
|
+
}
|
|
1960
|
+
}
|
|
1961
|
+
|
|
1962
|
+
/** @see Similar to {@link warning} */
|
|
1963
|
+
function note(valid, message) {
|
|
1964
|
+
if (process.env.NODE_ENV !== 'production' && !valid && console !== undefined) {
|
|
1965
|
+
var finalMessage = preWarningFns.reduce(function (msg, preMessageFn) {
|
|
1966
|
+
return preMessageFn(msg !== null && msg !== void 0 ? msg : '', 'note');
|
|
1967
|
+
}, message);
|
|
1968
|
+
if (finalMessage) {
|
|
1969
|
+
console.warn("Note: ".concat(finalMessage));
|
|
1970
|
+
}
|
|
1971
|
+
}
|
|
1972
|
+
}
|
|
1973
|
+
function resetWarned() {
|
|
1974
|
+
warned = {};
|
|
1975
|
+
}
|
|
1976
|
+
function call(method, valid, message) {
|
|
1977
|
+
if (!valid && !warned[message]) {
|
|
1978
|
+
method(false, message);
|
|
1979
|
+
warned[message] = true;
|
|
1980
|
+
}
|
|
1981
|
+
}
|
|
1982
|
+
|
|
1983
|
+
/** @see Same as {@link warning}, but only warn once for the same message */
|
|
1984
|
+
function warningOnce(valid, message) {
|
|
1985
|
+
call(warning$1, valid, message);
|
|
1986
|
+
}
|
|
1987
|
+
|
|
1988
|
+
/** @see Same as {@link warning}, but only warn once for the same message */
|
|
1989
|
+
function noteOnce(valid, message) {
|
|
1990
|
+
call(note, valid, message);
|
|
1991
|
+
}
|
|
1992
|
+
warningOnce.preMessage = preMessage;
|
|
1993
|
+
warningOnce.resetWarned = resetWarned;
|
|
1994
|
+
warningOnce.noteOnce = noteOnce;
|
|
1995
|
+
|
|
1996
|
+
function camelCase(input) {
|
|
1997
|
+
return input.replace(/-(.)/g, function (match, g) {
|
|
1998
|
+
return g.toUpperCase();
|
|
1999
|
+
});
|
|
2000
|
+
}
|
|
2001
|
+
function warning(valid, message) {
|
|
2002
|
+
warningOnce(valid, "[@ant-design/icons] ".concat(message));
|
|
2003
|
+
}
|
|
2004
|
+
function isIconDefinition(target) {
|
|
2005
|
+
return _typeof(target) === 'object' && typeof target.name === 'string' && typeof target.theme === 'string' && (_typeof(target.icon) === 'object' || typeof target.icon === 'function');
|
|
2006
|
+
}
|
|
2007
|
+
function normalizeAttrs() {
|
|
2008
|
+
var attrs = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
2009
|
+
return Object.keys(attrs).reduce(function (acc, key) {
|
|
2010
|
+
var val = attrs[key];
|
|
2011
|
+
switch (key) {
|
|
2012
|
+
case 'class':
|
|
2013
|
+
acc.className = val;
|
|
2014
|
+
delete acc.class;
|
|
2015
|
+
break;
|
|
2016
|
+
default:
|
|
2017
|
+
delete acc[key];
|
|
2018
|
+
acc[camelCase(key)] = val;
|
|
2019
|
+
}
|
|
2020
|
+
return acc;
|
|
2021
|
+
}, {});
|
|
2022
|
+
}
|
|
2023
|
+
function generate(node, key, rootProps) {
|
|
2024
|
+
if (!rootProps) {
|
|
2025
|
+
return /*#__PURE__*/React.createElement(node.tag, _objectSpread2({
|
|
2026
|
+
key: key
|
|
2027
|
+
}, normalizeAttrs(node.attrs)), (node.children || []).map(function (child, index) {
|
|
2028
|
+
return generate(child, "".concat(key, "-").concat(node.tag, "-").concat(index));
|
|
2029
|
+
}));
|
|
2030
|
+
}
|
|
2031
|
+
return /*#__PURE__*/React.createElement(node.tag, _objectSpread2(_objectSpread2({
|
|
2032
|
+
key: key
|
|
2033
|
+
}, normalizeAttrs(node.attrs)), rootProps), (node.children || []).map(function (child, index) {
|
|
2034
|
+
return generate(child, "".concat(key, "-").concat(node.tag, "-").concat(index));
|
|
2035
|
+
}));
|
|
2036
|
+
}
|
|
2037
|
+
function getSecondaryColor(primaryColor) {
|
|
2038
|
+
// choose the second color
|
|
2039
|
+
return generate$1(primaryColor)[0];
|
|
2040
|
+
}
|
|
2041
|
+
function normalizeTwoToneColors(twoToneColor) {
|
|
2042
|
+
if (!twoToneColor) {
|
|
2043
|
+
return [];
|
|
2044
|
+
}
|
|
2045
|
+
return Array.isArray(twoToneColor) ? twoToneColor : [twoToneColor];
|
|
2046
|
+
}
|
|
2047
|
+
var iconStyles = "\n.anticon {\n display: inline-flex;\n align-items: center;\n color: inherit;\n font-style: normal;\n line-height: 0;\n text-align: center;\n text-transform: none;\n vertical-align: -0.125em;\n text-rendering: optimizeLegibility;\n -webkit-font-smoothing: antialiased;\n -moz-osx-font-smoothing: grayscale;\n}\n\n.anticon > * {\n line-height: 1;\n}\n\n.anticon svg {\n display: inline-block;\n}\n\n.anticon::before {\n display: none;\n}\n\n.anticon .anticon-icon {\n display: block;\n}\n\n.anticon[tabindex] {\n cursor: pointer;\n}\n\n.anticon-spin::before,\n.anticon-spin {\n display: inline-block;\n -webkit-animation: loadingCircle 1s infinite linear;\n animation: loadingCircle 1s infinite linear;\n}\n\n@-webkit-keyframes loadingCircle {\n 100% {\n -webkit-transform: rotate(360deg);\n transform: rotate(360deg);\n }\n}\n\n@keyframes loadingCircle {\n 100% {\n -webkit-transform: rotate(360deg);\n transform: rotate(360deg);\n }\n}\n";
|
|
2048
|
+
var useInsertStyles = function useInsertStyles(eleRef) {
|
|
2049
|
+
var _useContext = React.useContext(IconContext),
|
|
2050
|
+
csp = _useContext.csp,
|
|
2051
|
+
prefixCls = _useContext.prefixCls,
|
|
2052
|
+
layer = _useContext.layer;
|
|
2053
|
+
var mergedStyleStr = iconStyles;
|
|
2054
|
+
if (prefixCls) {
|
|
2055
|
+
mergedStyleStr = mergedStyleStr.replace(/anticon/g, prefixCls);
|
|
2056
|
+
}
|
|
2057
|
+
if (layer) {
|
|
2058
|
+
mergedStyleStr = "@layer ".concat(layer, " {\n").concat(mergedStyleStr, "\n}");
|
|
2059
|
+
}
|
|
2060
|
+
React.useEffect(function () {
|
|
2061
|
+
var ele = eleRef.current;
|
|
2062
|
+
var shadowRoot = getShadowRoot(ele);
|
|
2063
|
+
updateCSS(mergedStyleStr, '@ant-design-icons', {
|
|
2064
|
+
prepend: !layer,
|
|
2065
|
+
csp: csp,
|
|
2066
|
+
attachTo: shadowRoot
|
|
2067
|
+
});
|
|
2068
|
+
}, []);
|
|
2069
|
+
};
|
|
2070
|
+
|
|
2071
|
+
var _excluded$1 = ["icon", "className", "onClick", "style", "primaryColor", "secondaryColor"];
|
|
2072
|
+
var twoToneColorPalette = {
|
|
2073
|
+
primaryColor: '#333',
|
|
2074
|
+
secondaryColor: '#E6E6E6',
|
|
2075
|
+
calculated: false
|
|
2076
|
+
};
|
|
2077
|
+
function setTwoToneColors(_ref) {
|
|
2078
|
+
var primaryColor = _ref.primaryColor,
|
|
2079
|
+
secondaryColor = _ref.secondaryColor;
|
|
2080
|
+
twoToneColorPalette.primaryColor = primaryColor;
|
|
2081
|
+
twoToneColorPalette.secondaryColor = secondaryColor || getSecondaryColor(primaryColor);
|
|
2082
|
+
twoToneColorPalette.calculated = !!secondaryColor;
|
|
2083
|
+
}
|
|
2084
|
+
function getTwoToneColors() {
|
|
2085
|
+
return _objectSpread2({}, twoToneColorPalette);
|
|
2086
|
+
}
|
|
2087
|
+
var IconBase = function IconBase(props) {
|
|
2088
|
+
var icon = props.icon,
|
|
2089
|
+
className = props.className,
|
|
2090
|
+
onClick = props.onClick,
|
|
2091
|
+
style = props.style,
|
|
2092
|
+
primaryColor = props.primaryColor,
|
|
2093
|
+
secondaryColor = props.secondaryColor,
|
|
2094
|
+
restProps = _objectWithoutProperties(props, _excluded$1);
|
|
2095
|
+
var svgRef = React__namespace.useRef();
|
|
2096
|
+
var colors = twoToneColorPalette;
|
|
2097
|
+
if (primaryColor) {
|
|
2098
|
+
colors = {
|
|
2099
|
+
primaryColor: primaryColor,
|
|
2100
|
+
secondaryColor: secondaryColor || getSecondaryColor(primaryColor)
|
|
2101
|
+
};
|
|
2102
|
+
}
|
|
2103
|
+
useInsertStyles(svgRef);
|
|
2104
|
+
warning(isIconDefinition(icon), "icon should be icon definiton, but got ".concat(icon));
|
|
2105
|
+
if (!isIconDefinition(icon)) {
|
|
2106
|
+
return null;
|
|
2107
|
+
}
|
|
2108
|
+
var target = icon;
|
|
2109
|
+
if (target && typeof target.icon === 'function') {
|
|
2110
|
+
target = _objectSpread2(_objectSpread2({}, target), {}, {
|
|
2111
|
+
icon: target.icon(colors.primaryColor, colors.secondaryColor)
|
|
2112
|
+
});
|
|
2113
|
+
}
|
|
2114
|
+
return generate(target.icon, "svg-".concat(target.name), _objectSpread2(_objectSpread2({
|
|
2115
|
+
className: className,
|
|
2116
|
+
onClick: onClick,
|
|
2117
|
+
style: style,
|
|
2118
|
+
'data-icon': target.name,
|
|
2119
|
+
width: '1em',
|
|
2120
|
+
height: '1em',
|
|
2121
|
+
fill: 'currentColor',
|
|
2122
|
+
'aria-hidden': 'true'
|
|
2123
|
+
}, restProps), {}, {
|
|
2124
|
+
ref: svgRef
|
|
2125
|
+
}));
|
|
2126
|
+
};
|
|
2127
|
+
IconBase.displayName = 'IconReact';
|
|
2128
|
+
IconBase.getTwoToneColors = getTwoToneColors;
|
|
2129
|
+
IconBase.setTwoToneColors = setTwoToneColors;
|
|
2130
|
+
|
|
2131
|
+
function setTwoToneColor(twoToneColor) {
|
|
2132
|
+
var _normalizeTwoToneColo = normalizeTwoToneColors(twoToneColor),
|
|
2133
|
+
_normalizeTwoToneColo2 = _slicedToArray(_normalizeTwoToneColo, 2),
|
|
2134
|
+
primaryColor = _normalizeTwoToneColo2[0],
|
|
2135
|
+
secondaryColor = _normalizeTwoToneColo2[1];
|
|
2136
|
+
return IconBase.setTwoToneColors({
|
|
2137
|
+
primaryColor: primaryColor,
|
|
2138
|
+
secondaryColor: secondaryColor
|
|
2139
|
+
});
|
|
2140
|
+
}
|
|
2141
|
+
function getTwoToneColor() {
|
|
2142
|
+
var colors = IconBase.getTwoToneColors();
|
|
2143
|
+
if (!colors.calculated) {
|
|
2144
|
+
return colors.primaryColor;
|
|
2145
|
+
}
|
|
2146
|
+
return [colors.primaryColor, colors.secondaryColor];
|
|
2147
|
+
}
|
|
2148
|
+
|
|
2149
|
+
var _excluded = ["className", "icon", "spin", "rotate", "tabIndex", "onClick", "twoToneColor"];
|
|
2150
|
+
// Initial setting
|
|
2151
|
+
// should move it to antd main repo?
|
|
2152
|
+
setTwoToneColor(blue.primary);
|
|
2153
|
+
|
|
2154
|
+
// https://github.com/DefinitelyTyped/DefinitelyTyped/issues/34757#issuecomment-488848720
|
|
2155
|
+
|
|
2156
|
+
var Icon = /*#__PURE__*/React__namespace.forwardRef(function (props, ref) {
|
|
2157
|
+
var className = props.className,
|
|
2158
|
+
icon = props.icon,
|
|
2159
|
+
spin = props.spin,
|
|
2160
|
+
rotate = props.rotate,
|
|
2161
|
+
tabIndex = props.tabIndex,
|
|
2162
|
+
onClick = props.onClick,
|
|
2163
|
+
twoToneColor = props.twoToneColor,
|
|
2164
|
+
restProps = _objectWithoutProperties(props, _excluded);
|
|
2165
|
+
var _React$useContext = React__namespace.useContext(IconContext),
|
|
2166
|
+
_React$useContext$pre = _React$useContext.prefixCls,
|
|
2167
|
+
prefixCls = _React$useContext$pre === void 0 ? 'anticon' : _React$useContext$pre,
|
|
2168
|
+
rootClassName = _React$useContext.rootClassName;
|
|
2169
|
+
var classString = classNames(rootClassName, prefixCls, _defineProperty(_defineProperty({}, "".concat(prefixCls, "-").concat(icon.name), !!icon.name), "".concat(prefixCls, "-spin"), !!spin || icon.name === 'loading'), className);
|
|
2170
|
+
var iconTabIndex = tabIndex;
|
|
2171
|
+
if (iconTabIndex === undefined && onClick) {
|
|
2172
|
+
iconTabIndex = -1;
|
|
2173
|
+
}
|
|
2174
|
+
var svgStyle = rotate ? {
|
|
2175
|
+
msTransform: "rotate(".concat(rotate, "deg)"),
|
|
2176
|
+
transform: "rotate(".concat(rotate, "deg)")
|
|
2177
|
+
} : undefined;
|
|
2178
|
+
var _normalizeTwoToneColo = normalizeTwoToneColors(twoToneColor),
|
|
2179
|
+
_normalizeTwoToneColo2 = _slicedToArray(_normalizeTwoToneColo, 2),
|
|
2180
|
+
primaryColor = _normalizeTwoToneColo2[0],
|
|
2181
|
+
secondaryColor = _normalizeTwoToneColo2[1];
|
|
2182
|
+
return /*#__PURE__*/React__namespace.createElement("span", _extends({
|
|
2183
|
+
role: "img",
|
|
2184
|
+
"aria-label": icon.name
|
|
2185
|
+
}, restProps, {
|
|
2186
|
+
ref: ref,
|
|
2187
|
+
tabIndex: iconTabIndex,
|
|
2188
|
+
onClick: onClick,
|
|
2189
|
+
className: classString
|
|
2190
|
+
}), /*#__PURE__*/React__namespace.createElement(IconBase, {
|
|
2191
|
+
icon: icon,
|
|
2192
|
+
primaryColor: primaryColor,
|
|
2193
|
+
secondaryColor: secondaryColor,
|
|
2194
|
+
style: svgStyle
|
|
2195
|
+
}));
|
|
2196
|
+
});
|
|
2197
|
+
Icon.displayName = 'AntdIcon';
|
|
2198
|
+
Icon.getTwoToneColor = getTwoToneColor;
|
|
2199
|
+
Icon.setTwoToneColor = setTwoToneColor;
|
|
2200
|
+
|
|
2201
|
+
// This icon file is generated automatically.
|
|
2202
|
+
var ArrowLeftOutlined$1 = { "icon": { "tag": "svg", "attrs": { "viewBox": "64 64 896 896", "focusable": "false" }, "children": [{ "tag": "path", "attrs": { "d": "M872 474H286.9l350.2-304c5.6-4.9 2.2-14-5.2-14h-88.5c-3.9 0-7.6 1.4-10.5 3.9L155 487.8a31.96 31.96 0 000 48.3L535.1 866c1.5 1.3 3.3 2 5.2 2h91.5c7.4 0 10.8-9.2 5.2-14L286.9 550H872c4.4 0 8-3.6 8-8v-60c0-4.4-3.6-8-8-8z" } }] }, "name": "arrow-left", "theme": "outlined" };
|
|
2203
|
+
|
|
2204
|
+
var ArrowLeftOutlined = function ArrowLeftOutlined(props, ref) {
|
|
2205
|
+
return /*#__PURE__*/React__namespace.createElement(Icon, _extends({}, props, {
|
|
2206
|
+
ref: ref,
|
|
2207
|
+
icon: ArrowLeftOutlined$1
|
|
2208
|
+
}));
|
|
2209
|
+
};
|
|
2210
|
+
|
|
2211
|
+
/** */
|
|
2212
|
+
var RefIcon$3 = /*#__PURE__*/React__namespace.forwardRef(ArrowLeftOutlined);
|
|
2213
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
2214
|
+
RefIcon$3.displayName = 'ArrowLeftOutlined';
|
|
2215
|
+
}
|
|
2216
|
+
|
|
2217
|
+
// This icon file is generated automatically.
|
|
2218
|
+
var CloseCircleOutlined$1 = { "icon": { "tag": "svg", "attrs": { "fill-rule": "evenodd", "viewBox": "64 64 896 896", "focusable": "false" }, "children": [{ "tag": "path", "attrs": { "d": "M512 64c247.4 0 448 200.6 448 448S759.4 960 512 960 64 759.4 64 512 264.6 64 512 64zm0 76c-205.4 0-372 166.6-372 372s166.6 372 372 372 372-166.6 372-372-166.6-372-372-372zm128.01 198.83c.03 0 .05.01.09.06l45.02 45.01a.2.2 0 01.05.09.12.12 0 010 .07c0 .02-.01.04-.05.08L557.25 512l127.87 127.86a.27.27 0 01.05.06v.02a.12.12 0 010 .07c0 .03-.01.05-.05.09l-45.02 45.02a.2.2 0 01-.09.05.12.12 0 01-.07 0c-.02 0-.04-.01-.08-.05L512 557.25 384.14 685.12c-.04.04-.06.05-.08.05a.12.12 0 01-.07 0c-.03 0-.05-.01-.09-.05l-45.02-45.02a.2.2 0 01-.05-.09.12.12 0 010-.07c0-.02.01-.04.06-.08L466.75 512 338.88 384.14a.27.27 0 01-.05-.06l-.01-.02a.12.12 0 010-.07c0-.03.01-.05.05-.09l45.02-45.02a.2.2 0 01.09-.05.12.12 0 01.07 0c.02 0 .04.01.08.06L512 466.75l127.86-127.86c.04-.05.06-.06.08-.06a.12.12 0 01.07 0z" } }] }, "name": "close-circle", "theme": "outlined" };
|
|
2219
|
+
|
|
2220
|
+
var CloseCircleOutlined = function CloseCircleOutlined(props, ref) {
|
|
2221
|
+
return /*#__PURE__*/React__namespace.createElement(Icon, _extends({}, props, {
|
|
2222
|
+
ref: ref,
|
|
2223
|
+
icon: CloseCircleOutlined$1
|
|
2224
|
+
}));
|
|
2225
|
+
};
|
|
2226
|
+
|
|
2227
|
+
/** */
|
|
2228
|
+
var RefIcon$2 = /*#__PURE__*/React__namespace.forwardRef(CloseCircleOutlined);
|
|
2229
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
2230
|
+
RefIcon$2.displayName = 'CloseCircleOutlined';
|
|
2231
|
+
}
|
|
2232
|
+
|
|
2233
|
+
// This icon file is generated automatically.
|
|
2234
|
+
var EditOutlined$1 = { "icon": { "tag": "svg", "attrs": { "viewBox": "64 64 896 896", "focusable": "false" }, "children": [{ "tag": "path", "attrs": { "d": "M257.7 752c2 0 4-.2 6-.5L431.9 722c2-.4 3.9-1.3 5.3-2.8l423.9-423.9a9.96 9.96 0 000-14.1L694.9 114.9c-1.9-1.9-4.4-2.9-7.1-2.9s-5.2 1-7.1 2.9L256.8 538.8c-1.5 1.5-2.4 3.3-2.8 5.3l-29.5 168.2a33.5 33.5 0 009.4 29.8c6.6 6.4 14.9 9.9 23.8 9.9zm67.4-174.4L687.8 215l73.3 73.3-362.7 362.6-88.9 15.7 15.6-89zM880 836H144c-17.7 0-32 14.3-32 32v36c0 4.4 3.6 8 8 8h784c4.4 0 8-3.6 8-8v-36c0-17.7-14.3-32-32-32z" } }] }, "name": "edit", "theme": "outlined" };
|
|
2235
|
+
|
|
2236
|
+
var EditOutlined = function EditOutlined(props, ref) {
|
|
2237
|
+
return /*#__PURE__*/React__namespace.createElement(Icon, _extends({}, props, {
|
|
2238
|
+
ref: ref,
|
|
2239
|
+
icon: EditOutlined$1
|
|
2240
|
+
}));
|
|
2241
|
+
};
|
|
2242
|
+
|
|
2243
|
+
/** */
|
|
2244
|
+
var RefIcon$1 = /*#__PURE__*/React__namespace.forwardRef(EditOutlined);
|
|
2245
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
2246
|
+
RefIcon$1.displayName = 'EditOutlined';
|
|
2247
|
+
}
|
|
2248
|
+
|
|
2249
|
+
// This icon file is generated automatically.
|
|
2250
|
+
var SaveOutlined$1 = { "icon": { "tag": "svg", "attrs": { "viewBox": "64 64 896 896", "focusable": "false" }, "children": [{ "tag": "path", "attrs": { "d": "M893.3 293.3L730.7 130.7c-7.5-7.5-16.7-13-26.7-16V112H144c-17.7 0-32 14.3-32 32v736c0 17.7 14.3 32 32 32h736c17.7 0 32-14.3 32-32V338.5c0-17-6.7-33.2-18.7-45.2zM384 184h256v104H384V184zm456 656H184V184h136v136c0 17.7 14.3 32 32 32h320c17.7 0 32-14.3 32-32V205.8l136 136V840zM512 442c-79.5 0-144 64.5-144 144s64.5 144 144 144 144-64.5 144-144-64.5-144-144-144zm0 224c-44.2 0-80-35.8-80-80s35.8-80 80-80 80 35.8 80 80-35.8 80-80 80z" } }] }, "name": "save", "theme": "outlined" };
|
|
2251
|
+
|
|
2252
|
+
var SaveOutlined = function SaveOutlined(props, ref) {
|
|
2253
|
+
return /*#__PURE__*/React__namespace.createElement(Icon, _extends({}, props, {
|
|
2254
|
+
ref: ref,
|
|
2255
|
+
icon: SaveOutlined$1
|
|
2256
|
+
}));
|
|
2257
|
+
};
|
|
2258
|
+
|
|
2259
|
+
/** */
|
|
2260
|
+
var RefIcon = /*#__PURE__*/React__namespace.forwardRef(SaveOutlined);
|
|
2261
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
2262
|
+
RefIcon.displayName = 'SaveOutlined';
|
|
2263
|
+
}
|
|
2264
|
+
|
|
2265
|
+
const ButtonGroupAddComponent = ({ formColLayout, disabled, loading, onBack, onSave, }) => {
|
|
2266
|
+
const saveMethod = onSave
|
|
2267
|
+
? { onClick: onSave }
|
|
2268
|
+
: { htmlType: 'submit' };
|
|
2269
|
+
const col = React.useMemo(() => {
|
|
2270
|
+
return formColLayout ? colLayout(formColLayout) : undefined;
|
|
2271
|
+
}, [formColLayout]);
|
|
2272
|
+
const buttonGroup = (jsxRuntimeExports.jsxs("div", { className: [
|
|
2273
|
+
styleButton['button-group'],
|
|
2274
|
+
styleButton['button-group-add'],
|
|
2275
|
+
].join(' '), children: [jsxRuntimeExports.jsx(ButtonComponent, { tooltip: { title: 'Back' }, icon: jsxRuntimeExports.jsx(RefIcon$3, {}), className: !onBack ? [styleButton['display-none']] : undefined, disabled: disabled, onClick: onBack }), jsxRuntimeExports.jsx(ButtonComponent, Object.assign({ tooltip: { title: 'Save' }, icon: jsxRuntimeExports.jsx(RefIcon, {}), type: "primary", disabled: disabled, loading: loading }, saveMethod))] }));
|
|
2276
|
+
return col ? (jsxRuntimeExports.jsx(antd.Row, { children: jsxRuntimeExports.jsx(antd.Col, Object.assign({}, col, { children: buttonGroup })) })) : buttonGroup;
|
|
2277
|
+
};
|
|
2278
|
+
|
|
2279
|
+
const ButtonGroupEditComponent = ({ formColLayout, disabled, loading, allowEdit = true, editing, setEditing, onBack, onSave, }) => {
|
|
2280
|
+
const saveMethod = onSave
|
|
2281
|
+
? { onClick: onSave }
|
|
2282
|
+
: { htmlType: 'submit' };
|
|
2283
|
+
const col = React.useMemo(() => {
|
|
2284
|
+
return formColLayout ? colLayout(formColLayout) : undefined;
|
|
2285
|
+
}, [formColLayout]);
|
|
2286
|
+
const buttonGroup = (jsxRuntimeExports.jsxs("div", { className: [
|
|
2287
|
+
styleButton['button-group'],
|
|
2288
|
+
styleButton['button-group-edit'],
|
|
2289
|
+
].join(' '), children: [jsxRuntimeExports.jsx(ButtonComponent, { tooltip: { title: 'Back' }, icon: jsxRuntimeExports.jsx(RefIcon$3, {}), className: !onBack ? [styleButton['display-none']] : undefined, disabled: disabled, onClick: onBack }), jsxRuntimeExports.jsx(ButtonComponent, { tooltip: { title: 'Cancel' }, icon: jsxRuntimeExports.jsx(RefIcon$2, {}), className: !editing ? [styleButton['display-none']] : undefined, disabled: disabled, onClick: () => setEditing === null || setEditing === void 0 ? void 0 : setEditing(false) }), jsxRuntimeExports.jsx(ButtonComponent, Object.assign({ tooltip: { title: 'Save' }, icon: jsxRuntimeExports.jsx(RefIcon, {}), type: "primary", className: !editing ? [styleButton['display-none']] : undefined, disabled: disabled, loading: loading }, saveMethod)), jsxRuntimeExports.jsx(ButtonComponent, { tooltip: { title: 'Edit' }, icon: jsxRuntimeExports.jsx(RefIcon$1, {}), className: allowEdit && !editing ? undefined : [styleButton['display-none']], disabled: disabled, onClick: () => setEditing === null || setEditing === void 0 ? void 0 : setEditing(true) })] }));
|
|
2290
|
+
return col ? (jsxRuntimeExports.jsx(antd.Row, { children: jsxRuntimeExports.jsx(antd.Col, Object.assign({}, col, { children: buttonGroup })) })) : buttonGroup;
|
|
2291
|
+
};
|
|
2292
|
+
|
|
2293
|
+
const CardComponent = ({ title, onClick, className, classNames, style, children, }) => {
|
|
2294
|
+
return (jsxRuntimeExports.jsx(antd.Card, { title: title, onClick: onClick, className: className, classNames: classNames, style: style, children: children }));
|
|
2295
|
+
};
|
|
2296
|
+
|
|
2297
|
+
var formColLayout = {
|
|
2298
|
+
default: {
|
|
2299
|
+
labelCol: {
|
|
2300
|
+
xs: { span: 24 },
|
|
2301
|
+
sm: { span: 6 },
|
|
2302
|
+
md: { span: 6 },
|
|
2303
|
+
},
|
|
2304
|
+
wrapperCol: {
|
|
2305
|
+
xs: { span: 24 },
|
|
2306
|
+
sm: { span: 16 },
|
|
2307
|
+
md: { span: 12 },
|
|
2308
|
+
},
|
|
2309
|
+
},
|
|
2310
|
+
col12: {
|
|
2311
|
+
labelCol: {
|
|
2312
|
+
xs: { span: 24 },
|
|
2313
|
+
sm: { span: 6 },
|
|
2314
|
+
md: { span: 10 },
|
|
2315
|
+
},
|
|
2316
|
+
wrapperCol: {
|
|
2317
|
+
xs: { span: 24 },
|
|
2318
|
+
sm: { span: 16 },
|
|
2319
|
+
md: { span: 14 },
|
|
2320
|
+
},
|
|
2321
|
+
},
|
|
2322
|
+
nolabel: {
|
|
2323
|
+
labelCol: {
|
|
2324
|
+
xs: { span: 0 },
|
|
2325
|
+
},
|
|
2326
|
+
wrapperCol: {
|
|
2327
|
+
xs: { span: 24 },
|
|
2328
|
+
},
|
|
2329
|
+
},
|
|
2330
|
+
notInline: {},
|
|
2331
|
+
};
|
|
2332
|
+
|
|
2333
|
+
exports.ButtonComponent = ButtonComponent;
|
|
2334
|
+
exports.ButtonGroupAddComponent = ButtonGroupAddComponent;
|
|
2335
|
+
exports.ButtonGroupEditComponent = ButtonGroupEditComponent;
|
|
2336
|
+
exports.CardComponent = CardComponent;
|
|
2337
|
+
exports.colLayout = colLayout;
|
|
2338
|
+
exports.formColLayout = formColLayout;
|