@signalplus/params-about 0.1.2 → 0.1.3
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/index.d.ts +1 -0
- package/lib/css/Expiries.scss +3 -3
- package/lib/css/index.css +1 -1
- package/lib/es/index.js +9 -4
- package/lib/umd/index.js +4861 -0
- package/package.json +1 -1
package/lib/umd/index.js
ADDED
|
@@ -0,0 +1,4861 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Bundle of @signalplus/params-about
|
|
3
|
+
* Generated: 2022-04-07
|
|
4
|
+
* Version: 0.1.2
|
|
5
|
+
* License: MIT
|
|
6
|
+
* Author: 2631541504@qq.com
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
(function (global, factory) {
|
|
10
|
+
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('react'), require('antd'), require('react-dom')) :
|
|
11
|
+
typeof define === 'function' && define.amd ? define(['exports', 'react', 'antd', 'react-dom'], factory) :
|
|
12
|
+
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.ParamsAbout = {}, global.React, global.antd, global.ReactDOM));
|
|
13
|
+
})(this, (function (exports, React, antd, ReactDOM) { 'use strict';
|
|
14
|
+
|
|
15
|
+
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
16
|
+
|
|
17
|
+
function _interopNamespace(e) {
|
|
18
|
+
if (e && e.__esModule) return e;
|
|
19
|
+
var n = Object.create(null);
|
|
20
|
+
if (e) {
|
|
21
|
+
Object.keys(e).forEach(function (k) {
|
|
22
|
+
if (k !== 'default') {
|
|
23
|
+
var d = Object.getOwnPropertyDescriptor(e, k);
|
|
24
|
+
Object.defineProperty(n, k, d.get ? d : {
|
|
25
|
+
enumerable: true,
|
|
26
|
+
get: function () { return e[k]; }
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
n["default"] = e;
|
|
32
|
+
return Object.freeze(n);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
36
|
+
var React__namespace = /*#__PURE__*/_interopNamespace(React);
|
|
37
|
+
var ReactDOM__default = /*#__PURE__*/_interopDefaultLegacy(ReactDOM);
|
|
38
|
+
|
|
39
|
+
function _defineProperty$2(obj, key, value) {
|
|
40
|
+
if (key in obj) {
|
|
41
|
+
Object.defineProperty(obj, key, {
|
|
42
|
+
value: value,
|
|
43
|
+
enumerable: true,
|
|
44
|
+
configurable: true,
|
|
45
|
+
writable: true
|
|
46
|
+
});
|
|
47
|
+
} else {
|
|
48
|
+
obj[key] = value;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
return obj;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
function ownKeys$2(object, enumerableOnly) {
|
|
55
|
+
var keys = Object.keys(object);
|
|
56
|
+
|
|
57
|
+
if (Object.getOwnPropertySymbols) {
|
|
58
|
+
var symbols = Object.getOwnPropertySymbols(object);
|
|
59
|
+
if (enumerableOnly) symbols = symbols.filter(function (sym) {
|
|
60
|
+
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
|
|
61
|
+
});
|
|
62
|
+
keys.push.apply(keys, symbols);
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
return keys;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
function _objectSpread2$2(target) {
|
|
69
|
+
for (var i = 1; i < arguments.length; i++) {
|
|
70
|
+
var source = arguments[i] != null ? arguments[i] : {};
|
|
71
|
+
|
|
72
|
+
if (i % 2) {
|
|
73
|
+
ownKeys$2(Object(source), true).forEach(function (key) {
|
|
74
|
+
_defineProperty$2(target, key, source[key]);
|
|
75
|
+
});
|
|
76
|
+
} else if (Object.getOwnPropertyDescriptors) {
|
|
77
|
+
Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
|
|
78
|
+
} else {
|
|
79
|
+
ownKeys$2(Object(source)).forEach(function (key) {
|
|
80
|
+
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
81
|
+
});
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
return target;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
function _classCallCheck$1(instance, Constructor) {
|
|
89
|
+
if (!(instance instanceof Constructor)) {
|
|
90
|
+
throw new TypeError("Cannot call a class as a function");
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
function _defineProperties$1(target, props) {
|
|
95
|
+
for (var i = 0; i < props.length; i++) {
|
|
96
|
+
var descriptor = props[i];
|
|
97
|
+
descriptor.enumerable = descriptor.enumerable || false;
|
|
98
|
+
descriptor.configurable = true;
|
|
99
|
+
if ("value" in descriptor) descriptor.writable = true;
|
|
100
|
+
Object.defineProperty(target, descriptor.key, descriptor);
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
function _createClass$1(Constructor, protoProps, staticProps) {
|
|
105
|
+
if (protoProps) _defineProperties$1(Constructor.prototype, protoProps);
|
|
106
|
+
if (staticProps) _defineProperties$1(Constructor, staticProps);
|
|
107
|
+
return Constructor;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
function _assertThisInitialized(self) {
|
|
111
|
+
if (self === void 0) {
|
|
112
|
+
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
return self;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
function _setPrototypeOf(o, p) {
|
|
119
|
+
_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {
|
|
120
|
+
o.__proto__ = p;
|
|
121
|
+
return o;
|
|
122
|
+
};
|
|
123
|
+
|
|
124
|
+
return _setPrototypeOf(o, p);
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
function _inherits(subClass, superClass) {
|
|
128
|
+
if (typeof superClass !== "function" && superClass !== null) {
|
|
129
|
+
throw new TypeError("Super expression must either be null or a function");
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
subClass.prototype = Object.create(superClass && superClass.prototype, {
|
|
133
|
+
constructor: {
|
|
134
|
+
value: subClass,
|
|
135
|
+
writable: true,
|
|
136
|
+
configurable: true
|
|
137
|
+
}
|
|
138
|
+
});
|
|
139
|
+
if (superClass) _setPrototypeOf(subClass, superClass);
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
function _getPrototypeOf(o) {
|
|
143
|
+
_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) {
|
|
144
|
+
return o.__proto__ || Object.getPrototypeOf(o);
|
|
145
|
+
};
|
|
146
|
+
return _getPrototypeOf(o);
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
function _isNativeReflectConstruct() {
|
|
150
|
+
if (typeof Reflect === "undefined" || !Reflect.construct) return false;
|
|
151
|
+
if (Reflect.construct.sham) return false;
|
|
152
|
+
if (typeof Proxy === "function") return true;
|
|
153
|
+
|
|
154
|
+
try {
|
|
155
|
+
Date.prototype.toString.call(Reflect.construct(Date, [], function () {}));
|
|
156
|
+
return true;
|
|
157
|
+
} catch (e) {
|
|
158
|
+
return false;
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
function _typeof$1(obj) {
|
|
163
|
+
"@babel/helpers - typeof";
|
|
164
|
+
|
|
165
|
+
if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
|
|
166
|
+
_typeof$1 = function _typeof(obj) {
|
|
167
|
+
return typeof obj;
|
|
168
|
+
};
|
|
169
|
+
} else {
|
|
170
|
+
_typeof$1 = function _typeof(obj) {
|
|
171
|
+
return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
|
|
172
|
+
};
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
return _typeof$1(obj);
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
function _possibleConstructorReturn(self, call) {
|
|
179
|
+
if (call && (_typeof$1(call) === "object" || typeof call === "function")) {
|
|
180
|
+
return call;
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
return _assertThisInitialized(self);
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
function _createSuper(Derived) {
|
|
187
|
+
return function () {
|
|
188
|
+
var Super = _getPrototypeOf(Derived),
|
|
189
|
+
result;
|
|
190
|
+
|
|
191
|
+
if (_isNativeReflectConstruct()) {
|
|
192
|
+
var NewTarget = _getPrototypeOf(this).constructor;
|
|
193
|
+
result = Reflect.construct(Super, arguments, NewTarget);
|
|
194
|
+
} else {
|
|
195
|
+
result = Super.apply(this, arguments);
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
return _possibleConstructorReturn(this, result);
|
|
199
|
+
};
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
exports.ParamType = void 0;
|
|
203
|
+
|
|
204
|
+
(function (ParamType) {
|
|
205
|
+
ParamType[ParamType["ParamGroup"] = -1] = "ParamGroup";
|
|
206
|
+
ParamType[ParamType["Number"] = 1] = "Number";
|
|
207
|
+
ParamType[ParamType["Percentage"] = 2] = "Percentage";
|
|
208
|
+
ParamType[ParamType["Bool"] = 3] = "Bool";
|
|
209
|
+
ParamType[ParamType["NumberRange"] = 4] = "NumberRange";
|
|
210
|
+
ParamType[ParamType["PercentageRange"] = 5] = "PercentageRange";
|
|
211
|
+
ParamType[ParamType["ExpiryLimit"] = 6] = "ExpiryLimit";
|
|
212
|
+
ParamType[ParamType["Expiry"] = 7] = "Expiry";
|
|
213
|
+
ParamType[ParamType["Phone"] = 8] = "Phone";
|
|
214
|
+
})(exports.ParamType || (exports.ParamType = {}));
|
|
215
|
+
|
|
216
|
+
function _arrayWithHoles$1(arr) {
|
|
217
|
+
if (Array.isArray(arr)) return arr;
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
function _iterableToArrayLimit$1(arr, i) {
|
|
221
|
+
if (typeof Symbol === "undefined" || !(Symbol.iterator in Object(arr))) return;
|
|
222
|
+
var _arr = [];
|
|
223
|
+
var _n = true;
|
|
224
|
+
var _d = false;
|
|
225
|
+
var _e = undefined;
|
|
226
|
+
|
|
227
|
+
try {
|
|
228
|
+
for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) {
|
|
229
|
+
_arr.push(_s.value);
|
|
230
|
+
|
|
231
|
+
if (i && _arr.length === i) break;
|
|
232
|
+
}
|
|
233
|
+
} catch (err) {
|
|
234
|
+
_d = true;
|
|
235
|
+
_e = err;
|
|
236
|
+
} finally {
|
|
237
|
+
try {
|
|
238
|
+
if (!_n && _i["return"] != null) _i["return"]();
|
|
239
|
+
} finally {
|
|
240
|
+
if (_d) throw _e;
|
|
241
|
+
}
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
return _arr;
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
function _arrayLikeToArray$1(arr, len) {
|
|
248
|
+
if (len == null || len > arr.length) len = arr.length;
|
|
249
|
+
|
|
250
|
+
for (var i = 0, arr2 = new Array(len); i < len; i++) {
|
|
251
|
+
arr2[i] = arr[i];
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
return arr2;
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
function _unsupportedIterableToArray$1(o, minLen) {
|
|
258
|
+
if (!o) return;
|
|
259
|
+
if (typeof o === "string") return _arrayLikeToArray$1(o, minLen);
|
|
260
|
+
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
261
|
+
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
262
|
+
if (n === "Map" || n === "Set") return Array.from(n);
|
|
263
|
+
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray$1(o, minLen);
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
function _nonIterableRest$1() {
|
|
267
|
+
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
function _slicedToArray$1(arr, i) {
|
|
271
|
+
return _arrayWithHoles$1(arr) || _iterableToArrayLimit$1(arr, i) || _unsupportedIterableToArray$1(arr, i) || _nonIterableRest$1();
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
|
|
275
|
+
|
|
276
|
+
function createCommonjsModule(fn, module) {
|
|
277
|
+
return module = { exports: {} }, fn(module, module.exports), module.exports;
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
var classnames = createCommonjsModule(function (module) {
|
|
281
|
+
/*!
|
|
282
|
+
Copyright (c) 2018 Jed Watson.
|
|
283
|
+
Licensed under the MIT License (MIT), see
|
|
284
|
+
http://jedwatson.github.io/classnames
|
|
285
|
+
*/
|
|
286
|
+
|
|
287
|
+
/* global define */
|
|
288
|
+
(function () {
|
|
289
|
+
|
|
290
|
+
var hasOwn = {}.hasOwnProperty;
|
|
291
|
+
|
|
292
|
+
function classNames() {
|
|
293
|
+
var classes = [];
|
|
294
|
+
|
|
295
|
+
for (var i = 0; i < arguments.length; i++) {
|
|
296
|
+
var arg = arguments[i];
|
|
297
|
+
if (!arg) continue;
|
|
298
|
+
var argType = typeof arg;
|
|
299
|
+
|
|
300
|
+
if (argType === 'string' || argType === 'number') {
|
|
301
|
+
classes.push(arg);
|
|
302
|
+
} else if (Array.isArray(arg)) {
|
|
303
|
+
if (arg.length) {
|
|
304
|
+
var inner = classNames.apply(null, arg);
|
|
305
|
+
|
|
306
|
+
if (inner) {
|
|
307
|
+
classes.push(inner);
|
|
308
|
+
}
|
|
309
|
+
}
|
|
310
|
+
} else if (argType === 'object') {
|
|
311
|
+
if (arg.toString === Object.prototype.toString) {
|
|
312
|
+
for (var key in arg) {
|
|
313
|
+
if (hasOwn.call(arg, key) && arg[key]) {
|
|
314
|
+
classes.push(key);
|
|
315
|
+
}
|
|
316
|
+
}
|
|
317
|
+
} else {
|
|
318
|
+
classes.push(arg.toString());
|
|
319
|
+
}
|
|
320
|
+
}
|
|
321
|
+
}
|
|
322
|
+
|
|
323
|
+
return classes.join(' ');
|
|
324
|
+
}
|
|
325
|
+
|
|
326
|
+
if (module.exports) {
|
|
327
|
+
classNames.default = classNames;
|
|
328
|
+
module.exports = classNames;
|
|
329
|
+
} else {
|
|
330
|
+
window.classNames = classNames;
|
|
331
|
+
}
|
|
332
|
+
})();
|
|
333
|
+
});
|
|
334
|
+
|
|
335
|
+
var dayjs_min = createCommonjsModule(function (module, exports) {
|
|
336
|
+
!function (t, e) {
|
|
337
|
+
module.exports = e() ;
|
|
338
|
+
}(commonjsGlobal, function () {
|
|
339
|
+
|
|
340
|
+
var t = 1e3,
|
|
341
|
+
e = 6e4,
|
|
342
|
+
n = 36e5,
|
|
343
|
+
r = "millisecond",
|
|
344
|
+
i = "second",
|
|
345
|
+
s = "minute",
|
|
346
|
+
u = "hour",
|
|
347
|
+
a = "day",
|
|
348
|
+
o = "week",
|
|
349
|
+
f = "month",
|
|
350
|
+
h = "quarter",
|
|
351
|
+
c = "year",
|
|
352
|
+
d = "date",
|
|
353
|
+
$ = "Invalid Date",
|
|
354
|
+
l = /^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,
|
|
355
|
+
y = /\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,
|
|
356
|
+
M = {
|
|
357
|
+
name: "en",
|
|
358
|
+
weekdays: "Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),
|
|
359
|
+
months: "January_February_March_April_May_June_July_August_September_October_November_December".split("_")
|
|
360
|
+
},
|
|
361
|
+
m = function (t, e, n) {
|
|
362
|
+
var r = String(t);
|
|
363
|
+
return !r || r.length >= e ? t : "" + Array(e + 1 - r.length).join(n) + t;
|
|
364
|
+
},
|
|
365
|
+
g = {
|
|
366
|
+
s: m,
|
|
367
|
+
z: function (t) {
|
|
368
|
+
var e = -t.utcOffset(),
|
|
369
|
+
n = Math.abs(e),
|
|
370
|
+
r = Math.floor(n / 60),
|
|
371
|
+
i = n % 60;
|
|
372
|
+
return (e <= 0 ? "+" : "-") + m(r, 2, "0") + ":" + m(i, 2, "0");
|
|
373
|
+
},
|
|
374
|
+
m: function t(e, n) {
|
|
375
|
+
if (e.date() < n.date()) return -t(n, e);
|
|
376
|
+
var r = 12 * (n.year() - e.year()) + (n.month() - e.month()),
|
|
377
|
+
i = e.clone().add(r, f),
|
|
378
|
+
s = n - i < 0,
|
|
379
|
+
u = e.clone().add(r + (s ? -1 : 1), f);
|
|
380
|
+
return +(-(r + (n - i) / (s ? i - u : u - i)) || 0);
|
|
381
|
+
},
|
|
382
|
+
a: function (t) {
|
|
383
|
+
return t < 0 ? Math.ceil(t) || 0 : Math.floor(t);
|
|
384
|
+
},
|
|
385
|
+
p: function (t) {
|
|
386
|
+
return {
|
|
387
|
+
M: f,
|
|
388
|
+
y: c,
|
|
389
|
+
w: o,
|
|
390
|
+
d: a,
|
|
391
|
+
D: d,
|
|
392
|
+
h: u,
|
|
393
|
+
m: s,
|
|
394
|
+
s: i,
|
|
395
|
+
ms: r,
|
|
396
|
+
Q: h
|
|
397
|
+
}[t] || String(t || "").toLowerCase().replace(/s$/, "");
|
|
398
|
+
},
|
|
399
|
+
u: function (t) {
|
|
400
|
+
return void 0 === t;
|
|
401
|
+
}
|
|
402
|
+
},
|
|
403
|
+
v = "en",
|
|
404
|
+
D = {};
|
|
405
|
+
|
|
406
|
+
D[v] = M;
|
|
407
|
+
|
|
408
|
+
var p = function (t) {
|
|
409
|
+
return t instanceof _;
|
|
410
|
+
},
|
|
411
|
+
S = function t(e, n, r) {
|
|
412
|
+
var i;
|
|
413
|
+
if (!e) return v;
|
|
414
|
+
|
|
415
|
+
if ("string" == typeof e) {
|
|
416
|
+
var s = e.toLowerCase();
|
|
417
|
+
D[s] && (i = s), n && (D[s] = n, i = s);
|
|
418
|
+
var u = e.split("-");
|
|
419
|
+
if (!i && u.length > 1) return t(u[0]);
|
|
420
|
+
} else {
|
|
421
|
+
var a = e.name;
|
|
422
|
+
D[a] = e, i = a;
|
|
423
|
+
}
|
|
424
|
+
|
|
425
|
+
return !r && i && (v = i), i || !r && v;
|
|
426
|
+
},
|
|
427
|
+
w = function (t, e) {
|
|
428
|
+
if (p(t)) return t.clone();
|
|
429
|
+
var n = "object" == typeof e ? e : {};
|
|
430
|
+
return n.date = t, n.args = arguments, new _(n);
|
|
431
|
+
},
|
|
432
|
+
O = g;
|
|
433
|
+
|
|
434
|
+
O.l = S, O.i = p, O.w = function (t, e) {
|
|
435
|
+
return w(t, {
|
|
436
|
+
locale: e.$L,
|
|
437
|
+
utc: e.$u,
|
|
438
|
+
x: e.$x,
|
|
439
|
+
$offset: e.$offset
|
|
440
|
+
});
|
|
441
|
+
};
|
|
442
|
+
|
|
443
|
+
var _ = function () {
|
|
444
|
+
function M(t) {
|
|
445
|
+
this.$L = S(t.locale, null, !0), this.parse(t);
|
|
446
|
+
}
|
|
447
|
+
|
|
448
|
+
var m = M.prototype;
|
|
449
|
+
return m.parse = function (t) {
|
|
450
|
+
this.$d = function (t) {
|
|
451
|
+
var e = t.date,
|
|
452
|
+
n = t.utc;
|
|
453
|
+
if (null === e) return new Date(NaN);
|
|
454
|
+
if (O.u(e)) return new Date();
|
|
455
|
+
if (e instanceof Date) return new Date(e);
|
|
456
|
+
|
|
457
|
+
if ("string" == typeof e && !/Z$/i.test(e)) {
|
|
458
|
+
var r = e.match(l);
|
|
459
|
+
|
|
460
|
+
if (r) {
|
|
461
|
+
var i = r[2] - 1 || 0,
|
|
462
|
+
s = (r[7] || "0").substring(0, 3);
|
|
463
|
+
return n ? new Date(Date.UTC(r[1], i, r[3] || 1, r[4] || 0, r[5] || 0, r[6] || 0, s)) : new Date(r[1], i, r[3] || 1, r[4] || 0, r[5] || 0, r[6] || 0, s);
|
|
464
|
+
}
|
|
465
|
+
}
|
|
466
|
+
|
|
467
|
+
return new Date(e);
|
|
468
|
+
}(t), this.$x = t.x || {}, this.init();
|
|
469
|
+
}, m.init = function () {
|
|
470
|
+
var t = this.$d;
|
|
471
|
+
this.$y = t.getFullYear(), this.$M = t.getMonth(), this.$D = t.getDate(), this.$W = t.getDay(), this.$H = t.getHours(), this.$m = t.getMinutes(), this.$s = t.getSeconds(), this.$ms = t.getMilliseconds();
|
|
472
|
+
}, m.$utils = function () {
|
|
473
|
+
return O;
|
|
474
|
+
}, m.isValid = function () {
|
|
475
|
+
return !(this.$d.toString() === $);
|
|
476
|
+
}, m.isSame = function (t, e) {
|
|
477
|
+
var n = w(t);
|
|
478
|
+
return this.startOf(e) <= n && n <= this.endOf(e);
|
|
479
|
+
}, m.isAfter = function (t, e) {
|
|
480
|
+
return w(t) < this.startOf(e);
|
|
481
|
+
}, m.isBefore = function (t, e) {
|
|
482
|
+
return this.endOf(e) < w(t);
|
|
483
|
+
}, m.$g = function (t, e, n) {
|
|
484
|
+
return O.u(t) ? this[e] : this.set(n, t);
|
|
485
|
+
}, m.unix = function () {
|
|
486
|
+
return Math.floor(this.valueOf() / 1e3);
|
|
487
|
+
}, m.valueOf = function () {
|
|
488
|
+
return this.$d.getTime();
|
|
489
|
+
}, m.startOf = function (t, e) {
|
|
490
|
+
var n = this,
|
|
491
|
+
r = !!O.u(e) || e,
|
|
492
|
+
h = O.p(t),
|
|
493
|
+
$ = function (t, e) {
|
|
494
|
+
var i = O.w(n.$u ? Date.UTC(n.$y, e, t) : new Date(n.$y, e, t), n);
|
|
495
|
+
return r ? i : i.endOf(a);
|
|
496
|
+
},
|
|
497
|
+
l = function (t, e) {
|
|
498
|
+
return O.w(n.toDate()[t].apply(n.toDate("s"), (r ? [0, 0, 0, 0] : [23, 59, 59, 999]).slice(e)), n);
|
|
499
|
+
},
|
|
500
|
+
y = this.$W,
|
|
501
|
+
M = this.$M,
|
|
502
|
+
m = this.$D,
|
|
503
|
+
g = "set" + (this.$u ? "UTC" : "");
|
|
504
|
+
|
|
505
|
+
switch (h) {
|
|
506
|
+
case c:
|
|
507
|
+
return r ? $(1, 0) : $(31, 11);
|
|
508
|
+
|
|
509
|
+
case f:
|
|
510
|
+
return r ? $(1, M) : $(0, M + 1);
|
|
511
|
+
|
|
512
|
+
case o:
|
|
513
|
+
var v = this.$locale().weekStart || 0,
|
|
514
|
+
D = (y < v ? y + 7 : y) - v;
|
|
515
|
+
return $(r ? m - D : m + (6 - D), M);
|
|
516
|
+
|
|
517
|
+
case a:
|
|
518
|
+
case d:
|
|
519
|
+
return l(g + "Hours", 0);
|
|
520
|
+
|
|
521
|
+
case u:
|
|
522
|
+
return l(g + "Minutes", 1);
|
|
523
|
+
|
|
524
|
+
case s:
|
|
525
|
+
return l(g + "Seconds", 2);
|
|
526
|
+
|
|
527
|
+
case i:
|
|
528
|
+
return l(g + "Milliseconds", 3);
|
|
529
|
+
|
|
530
|
+
default:
|
|
531
|
+
return this.clone();
|
|
532
|
+
}
|
|
533
|
+
}, m.endOf = function (t) {
|
|
534
|
+
return this.startOf(t, !1);
|
|
535
|
+
}, m.$set = function (t, e) {
|
|
536
|
+
var n,
|
|
537
|
+
o = O.p(t),
|
|
538
|
+
h = "set" + (this.$u ? "UTC" : ""),
|
|
539
|
+
$ = (n = {}, n[a] = h + "Date", n[d] = h + "Date", n[f] = h + "Month", n[c] = h + "FullYear", n[u] = h + "Hours", n[s] = h + "Minutes", n[i] = h + "Seconds", n[r] = h + "Milliseconds", n)[o],
|
|
540
|
+
l = o === a ? this.$D + (e - this.$W) : e;
|
|
541
|
+
|
|
542
|
+
if (o === f || o === c) {
|
|
543
|
+
var y = this.clone().set(d, 1);
|
|
544
|
+
y.$d[$](l), y.init(), this.$d = y.set(d, Math.min(this.$D, y.daysInMonth())).$d;
|
|
545
|
+
} else $ && this.$d[$](l);
|
|
546
|
+
|
|
547
|
+
return this.init(), this;
|
|
548
|
+
}, m.set = function (t, e) {
|
|
549
|
+
return this.clone().$set(t, e);
|
|
550
|
+
}, m.get = function (t) {
|
|
551
|
+
return this[O.p(t)]();
|
|
552
|
+
}, m.add = function (r, h) {
|
|
553
|
+
var d,
|
|
554
|
+
$ = this;
|
|
555
|
+
r = Number(r);
|
|
556
|
+
|
|
557
|
+
var l = O.p(h),
|
|
558
|
+
y = function (t) {
|
|
559
|
+
var e = w($);
|
|
560
|
+
return O.w(e.date(e.date() + Math.round(t * r)), $);
|
|
561
|
+
};
|
|
562
|
+
|
|
563
|
+
if (l === f) return this.set(f, this.$M + r);
|
|
564
|
+
if (l === c) return this.set(c, this.$y + r);
|
|
565
|
+
if (l === a) return y(1);
|
|
566
|
+
if (l === o) return y(7);
|
|
567
|
+
var M = (d = {}, d[s] = e, d[u] = n, d[i] = t, d)[l] || 1,
|
|
568
|
+
m = this.$d.getTime() + r * M;
|
|
569
|
+
return O.w(m, this);
|
|
570
|
+
}, m.subtract = function (t, e) {
|
|
571
|
+
return this.add(-1 * t, e);
|
|
572
|
+
}, m.format = function (t) {
|
|
573
|
+
var e = this,
|
|
574
|
+
n = this.$locale();
|
|
575
|
+
if (!this.isValid()) return n.invalidDate || $;
|
|
576
|
+
|
|
577
|
+
var r = t || "YYYY-MM-DDTHH:mm:ssZ",
|
|
578
|
+
i = O.z(this),
|
|
579
|
+
s = this.$H,
|
|
580
|
+
u = this.$m,
|
|
581
|
+
a = this.$M,
|
|
582
|
+
o = n.weekdays,
|
|
583
|
+
f = n.months,
|
|
584
|
+
h = function (t, n, i, s) {
|
|
585
|
+
return t && (t[n] || t(e, r)) || i[n].substr(0, s);
|
|
586
|
+
},
|
|
587
|
+
c = function (t) {
|
|
588
|
+
return O.s(s % 12 || 12, t, "0");
|
|
589
|
+
},
|
|
590
|
+
d = n.meridiem || function (t, e, n) {
|
|
591
|
+
var r = t < 12 ? "AM" : "PM";
|
|
592
|
+
return n ? r.toLowerCase() : r;
|
|
593
|
+
},
|
|
594
|
+
l = {
|
|
595
|
+
YY: String(this.$y).slice(-2),
|
|
596
|
+
YYYY: this.$y,
|
|
597
|
+
M: a + 1,
|
|
598
|
+
MM: O.s(a + 1, 2, "0"),
|
|
599
|
+
MMM: h(n.monthsShort, a, f, 3),
|
|
600
|
+
MMMM: h(f, a),
|
|
601
|
+
D: this.$D,
|
|
602
|
+
DD: O.s(this.$D, 2, "0"),
|
|
603
|
+
d: String(this.$W),
|
|
604
|
+
dd: h(n.weekdaysMin, this.$W, o, 2),
|
|
605
|
+
ddd: h(n.weekdaysShort, this.$W, o, 3),
|
|
606
|
+
dddd: o[this.$W],
|
|
607
|
+
H: String(s),
|
|
608
|
+
HH: O.s(s, 2, "0"),
|
|
609
|
+
h: c(1),
|
|
610
|
+
hh: c(2),
|
|
611
|
+
a: d(s, u, !0),
|
|
612
|
+
A: d(s, u, !1),
|
|
613
|
+
m: String(u),
|
|
614
|
+
mm: O.s(u, 2, "0"),
|
|
615
|
+
s: String(this.$s),
|
|
616
|
+
ss: O.s(this.$s, 2, "0"),
|
|
617
|
+
SSS: O.s(this.$ms, 3, "0"),
|
|
618
|
+
Z: i
|
|
619
|
+
};
|
|
620
|
+
|
|
621
|
+
return r.replace(y, function (t, e) {
|
|
622
|
+
return e || l[t] || i.replace(":", "");
|
|
623
|
+
});
|
|
624
|
+
}, m.utcOffset = function () {
|
|
625
|
+
return 15 * -Math.round(this.$d.getTimezoneOffset() / 15);
|
|
626
|
+
}, m.diff = function (r, d, $) {
|
|
627
|
+
var l,
|
|
628
|
+
y = O.p(d),
|
|
629
|
+
M = w(r),
|
|
630
|
+
m = (M.utcOffset() - this.utcOffset()) * e,
|
|
631
|
+
g = this - M,
|
|
632
|
+
v = O.m(this, M);
|
|
633
|
+
return v = (l = {}, l[c] = v / 12, l[f] = v, l[h] = v / 3, l[o] = (g - m) / 6048e5, l[a] = (g - m) / 864e5, l[u] = g / n, l[s] = g / e, l[i] = g / t, l)[y] || g, $ ? v : O.a(v);
|
|
634
|
+
}, m.daysInMonth = function () {
|
|
635
|
+
return this.endOf(f).$D;
|
|
636
|
+
}, m.$locale = function () {
|
|
637
|
+
return D[this.$L];
|
|
638
|
+
}, m.locale = function (t, e) {
|
|
639
|
+
if (!t) return this.$L;
|
|
640
|
+
var n = this.clone(),
|
|
641
|
+
r = S(t, e, !0);
|
|
642
|
+
return r && (n.$L = r), n;
|
|
643
|
+
}, m.clone = function () {
|
|
644
|
+
return O.w(this.$d, this);
|
|
645
|
+
}, m.toDate = function () {
|
|
646
|
+
return new Date(this.valueOf());
|
|
647
|
+
}, m.toJSON = function () {
|
|
648
|
+
return this.isValid() ? this.toISOString() : null;
|
|
649
|
+
}, m.toISOString = function () {
|
|
650
|
+
return this.$d.toISOString();
|
|
651
|
+
}, m.toString = function () {
|
|
652
|
+
return this.$d.toUTCString();
|
|
653
|
+
}, M;
|
|
654
|
+
}(),
|
|
655
|
+
b = _.prototype;
|
|
656
|
+
|
|
657
|
+
return w.prototype = b, [["$ms", r], ["$s", i], ["$m", s], ["$H", u], ["$W", a], ["$M", f], ["$y", c], ["$D", d]].forEach(function (t) {
|
|
658
|
+
b[t[1]] = function (e) {
|
|
659
|
+
return this.$g(e, t[0], t[1]);
|
|
660
|
+
};
|
|
661
|
+
}), w.extend = function (t, e) {
|
|
662
|
+
return t.$i || (t(e, _, w), t.$i = !0), w;
|
|
663
|
+
}, w.locale = S, w.isDayjs = p, w.unix = function (t) {
|
|
664
|
+
return w(1e3 * t);
|
|
665
|
+
}, w.en = D[v], w.Ls = D, w.p = {}, w;
|
|
666
|
+
});
|
|
667
|
+
});
|
|
668
|
+
|
|
669
|
+
var utc = createCommonjsModule(function (module, exports) {
|
|
670
|
+
!function (t, i) {
|
|
671
|
+
module.exports = i() ;
|
|
672
|
+
}(commonjsGlobal, function () {
|
|
673
|
+
|
|
674
|
+
var t = "minute",
|
|
675
|
+
i = /[+-]\d\d(?::?\d\d)?/g,
|
|
676
|
+
e = /([+-]|\d\d)/g;
|
|
677
|
+
return function (s, f, n) {
|
|
678
|
+
var u = f.prototype;
|
|
679
|
+
n.utc = function (t) {
|
|
680
|
+
var i = {
|
|
681
|
+
date: t,
|
|
682
|
+
utc: !0,
|
|
683
|
+
args: arguments
|
|
684
|
+
};
|
|
685
|
+
return new f(i);
|
|
686
|
+
}, u.utc = function (i) {
|
|
687
|
+
var e = n(this.toDate(), {
|
|
688
|
+
locale: this.$L,
|
|
689
|
+
utc: !0
|
|
690
|
+
});
|
|
691
|
+
return i ? e.add(this.utcOffset(), t) : e;
|
|
692
|
+
}, u.local = function () {
|
|
693
|
+
return n(this.toDate(), {
|
|
694
|
+
locale: this.$L,
|
|
695
|
+
utc: !1
|
|
696
|
+
});
|
|
697
|
+
};
|
|
698
|
+
var o = u.parse;
|
|
699
|
+
|
|
700
|
+
u.parse = function (t) {
|
|
701
|
+
t.utc && (this.$u = !0), this.$utils().u(t.$offset) || (this.$offset = t.$offset), o.call(this, t);
|
|
702
|
+
};
|
|
703
|
+
|
|
704
|
+
var r = u.init;
|
|
705
|
+
|
|
706
|
+
u.init = function () {
|
|
707
|
+
if (this.$u) {
|
|
708
|
+
var t = this.$d;
|
|
709
|
+
this.$y = t.getUTCFullYear(), this.$M = t.getUTCMonth(), this.$D = t.getUTCDate(), this.$W = t.getUTCDay(), this.$H = t.getUTCHours(), this.$m = t.getUTCMinutes(), this.$s = t.getUTCSeconds(), this.$ms = t.getUTCMilliseconds();
|
|
710
|
+
} else r.call(this);
|
|
711
|
+
};
|
|
712
|
+
|
|
713
|
+
var a = u.utcOffset;
|
|
714
|
+
|
|
715
|
+
u.utcOffset = function (s, f) {
|
|
716
|
+
var n = this.$utils().u;
|
|
717
|
+
if (n(s)) return this.$u ? 0 : n(this.$offset) ? a.call(this) : this.$offset;
|
|
718
|
+
if ("string" == typeof s && (s = function (t) {
|
|
719
|
+
void 0 === t && (t = "");
|
|
720
|
+
var s = t.match(i);
|
|
721
|
+
if (!s) return null;
|
|
722
|
+
var f = ("" + s[0]).match(e) || ["-", 0, 0],
|
|
723
|
+
n = f[0],
|
|
724
|
+
u = 60 * +f[1] + +f[2];
|
|
725
|
+
return 0 === u ? 0 : "+" === n ? u : -u;
|
|
726
|
+
}(s), null === s)) return this;
|
|
727
|
+
var u = Math.abs(s) <= 16 ? 60 * s : s,
|
|
728
|
+
o = this;
|
|
729
|
+
if (f) return o.$offset = u, o.$u = 0 === s, o;
|
|
730
|
+
|
|
731
|
+
if (0 !== s) {
|
|
732
|
+
var r = this.$u ? this.toDate().getTimezoneOffset() : -1 * this.utcOffset();
|
|
733
|
+
(o = this.local().add(u + r, t)).$offset = u, o.$x.$localOffset = r;
|
|
734
|
+
} else o = this.utc();
|
|
735
|
+
|
|
736
|
+
return o;
|
|
737
|
+
};
|
|
738
|
+
|
|
739
|
+
var h = u.format;
|
|
740
|
+
u.format = function (t) {
|
|
741
|
+
var i = t || (this.$u ? "YYYY-MM-DDTHH:mm:ss[Z]" : "");
|
|
742
|
+
return h.call(this, i);
|
|
743
|
+
}, u.valueOf = function () {
|
|
744
|
+
var t = this.$utils().u(this.$offset) ? 0 : this.$offset + (this.$x.$localOffset || new Date().getTimezoneOffset());
|
|
745
|
+
return this.$d.valueOf() - 6e4 * t;
|
|
746
|
+
}, u.isUTC = function () {
|
|
747
|
+
return !!this.$u;
|
|
748
|
+
}, u.toISOString = function () {
|
|
749
|
+
return this.toDate().toISOString();
|
|
750
|
+
}, u.toString = function () {
|
|
751
|
+
return this.toDate().toUTCString();
|
|
752
|
+
};
|
|
753
|
+
var l = u.toDate;
|
|
754
|
+
|
|
755
|
+
u.toDate = function (t) {
|
|
756
|
+
return "s" === t && this.$offset ? n(this.format("YYYY-MM-DD HH:mm:ss:SSS")).toDate() : l.call(this);
|
|
757
|
+
};
|
|
758
|
+
|
|
759
|
+
var c = u.diff;
|
|
760
|
+
|
|
761
|
+
u.diff = function (t, i, e) {
|
|
762
|
+
if (t && this.$u === t.$u) return c.call(this, t, i, e);
|
|
763
|
+
var s = this.local(),
|
|
764
|
+
f = n(t).local();
|
|
765
|
+
return c.call(s, f, i, e);
|
|
766
|
+
};
|
|
767
|
+
};
|
|
768
|
+
});
|
|
769
|
+
});
|
|
770
|
+
|
|
771
|
+
dayjs_min.extend(utc);
|
|
772
|
+
function formatNum(val) {
|
|
773
|
+
var num = parseFloat(val);
|
|
774
|
+
return isNaN(num) ? undefined : num;
|
|
775
|
+
}
|
|
776
|
+
function isNullLike(val) {
|
|
777
|
+
return val === undefined || val === null;
|
|
778
|
+
}
|
|
779
|
+
function emptyValidator(val, enableEmpty) {
|
|
780
|
+
return !enableEmpty && (isNullLike(val) || val instanceof Array && !val.length || typeof val === 'string' && !val) ? 'Should not be empty' : '';
|
|
781
|
+
}
|
|
782
|
+
function numRangeValidator(val, enableEmpty) {
|
|
783
|
+
var error = emptyValidator(val === null || val === void 0 ? void 0 : val.min, enableEmpty);
|
|
784
|
+
|
|
785
|
+
if (error) {
|
|
786
|
+
// return { min: error }
|
|
787
|
+
return "Min: ".concat(error);
|
|
788
|
+
}
|
|
789
|
+
|
|
790
|
+
error = emptyValidator(val === null || val === void 0 ? void 0 : val.max, enableEmpty);
|
|
791
|
+
|
|
792
|
+
if (error) {
|
|
793
|
+
// return { max: error }
|
|
794
|
+
return "Max: ".concat(error);
|
|
795
|
+
}
|
|
796
|
+
|
|
797
|
+
return val.min > val.max ? 'Max should bigger than Min' : '';
|
|
798
|
+
}
|
|
799
|
+
function expiryValidator(val, enableEmpty) {
|
|
800
|
+
var error = emptyValidator(val, enableEmpty);
|
|
801
|
+
if (error) return error;
|
|
802
|
+
var $val = dayjs_min(val, 'DDMMMYY').format('DDMMMYY').toUpperCase();
|
|
803
|
+
if ($val !== val) return 'Out of format';
|
|
804
|
+
return '';
|
|
805
|
+
}
|
|
806
|
+
function expiriesValidator(val) {
|
|
807
|
+
for (var i = 0; i < val.length; i++) {
|
|
808
|
+
var error = expiryValidator(val[i]);
|
|
809
|
+
|
|
810
|
+
if (error) {
|
|
811
|
+
// return { [i]: error }
|
|
812
|
+
return "The ".concat(i + 1, "th item: ").concat(error);
|
|
813
|
+
}
|
|
814
|
+
}
|
|
815
|
+
|
|
816
|
+
return '';
|
|
817
|
+
}
|
|
818
|
+
function keyValidator(val) {
|
|
819
|
+
var error = emptyValidator(val);
|
|
820
|
+
if (error) return error;
|
|
821
|
+
return /^[_.a-zA-Z0-9]+$/.test(val) ? '' : 'Out of format: should be a combination of the following chars `_.0-9a-zA-Z`';
|
|
822
|
+
}
|
|
823
|
+
function isExpired(val) {
|
|
824
|
+
if (!val) return false;
|
|
825
|
+
var now = dayjs_min();
|
|
826
|
+
var expireTime = dayjs_min.utc("".concat(val, " 8:00"), 'DDMMMYY 8:00');
|
|
827
|
+
return now >= expireTime;
|
|
828
|
+
}
|
|
829
|
+
function validatorCvt(validator, form) {
|
|
830
|
+
return function (_, val) {
|
|
831
|
+
var $form = form === null || form === void 0 ? void 0 : form();
|
|
832
|
+
var error = validator(val, $form === null || $form === void 0 ? void 0 : $form.getFieldsValue());
|
|
833
|
+
if (!error) return Promise.resolve();
|
|
834
|
+
|
|
835
|
+
var traverse = function traverse(obj) {
|
|
836
|
+
if (typeof obj === 'string' && obj) return Promise.reject(new Error(obj));
|
|
837
|
+
|
|
838
|
+
if (obj && _typeof$1(obj) === 'object') {
|
|
839
|
+
for (var key in obj) {
|
|
840
|
+
var res = traverse(obj[key]);
|
|
841
|
+
if (res) return res;
|
|
842
|
+
}
|
|
843
|
+
}
|
|
844
|
+
};
|
|
845
|
+
|
|
846
|
+
return traverse(error) || Promise.resolve();
|
|
847
|
+
};
|
|
848
|
+
}
|
|
849
|
+
|
|
850
|
+
var Bool = /*#__PURE__*/function (_PureComponent) {
|
|
851
|
+
_inherits(Bool, _PureComponent);
|
|
852
|
+
|
|
853
|
+
var _super = _createSuper(Bool);
|
|
854
|
+
|
|
855
|
+
function Bool() {
|
|
856
|
+
var _this;
|
|
857
|
+
|
|
858
|
+
_classCallCheck$1(this, Bool);
|
|
859
|
+
|
|
860
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
861
|
+
args[_key] = arguments[_key];
|
|
862
|
+
}
|
|
863
|
+
|
|
864
|
+
_this = _super.call.apply(_super, [this].concat(args));
|
|
865
|
+
|
|
866
|
+
_defineProperty$2(_assertThisInitialized(_this), "options", [{
|
|
867
|
+
label: 'TRUE',
|
|
868
|
+
value: true
|
|
869
|
+
}, {
|
|
870
|
+
label: 'FALSE',
|
|
871
|
+
value: false
|
|
872
|
+
}]);
|
|
873
|
+
|
|
874
|
+
_defineProperty$2(_assertThisInitialized(_this), "RadioChecked", /*#__PURE__*/React__default["default"].createElement("svg", {
|
|
875
|
+
width: "16",
|
|
876
|
+
height: "17",
|
|
877
|
+
viewBox: "0 0 16 17",
|
|
878
|
+
fill: "none",
|
|
879
|
+
xmlns: "http://www.w3.org/2000/svg"
|
|
880
|
+
}, /*#__PURE__*/React__default["default"].createElement("g", {
|
|
881
|
+
clipPath: "url(#clip0_0_7934)"
|
|
882
|
+
}, /*#__PURE__*/React__default["default"].createElement("circle", {
|
|
883
|
+
cx: "8",
|
|
884
|
+
cy: "8.5",
|
|
885
|
+
r: "7.5",
|
|
886
|
+
fill: "none",
|
|
887
|
+
stroke: "currentColor"
|
|
888
|
+
}), /*#__PURE__*/React__default["default"].createElement("circle", {
|
|
889
|
+
cx: "8",
|
|
890
|
+
cy: "8.5",
|
|
891
|
+
r: "4",
|
|
892
|
+
fill: "currentColor"
|
|
893
|
+
})), /*#__PURE__*/React__default["default"].createElement("defs", null, /*#__PURE__*/React__default["default"].createElement("clipPath", {
|
|
894
|
+
id: "clip0_0_7934"
|
|
895
|
+
}, /*#__PURE__*/React__default["default"].createElement("rect", {
|
|
896
|
+
width: "16",
|
|
897
|
+
height: "16",
|
|
898
|
+
fill: "white",
|
|
899
|
+
transform: "translate(0 0.5)"
|
|
900
|
+
})))));
|
|
901
|
+
|
|
902
|
+
_defineProperty$2(_assertThisInitialized(_this), "RadioUnchecked", /*#__PURE__*/React__default["default"].createElement("svg", {
|
|
903
|
+
width: "16",
|
|
904
|
+
height: "17",
|
|
905
|
+
viewBox: "0 0 16 17",
|
|
906
|
+
fill: "none",
|
|
907
|
+
xmlns: "http://www.w3.org/2000/svg"
|
|
908
|
+
}, /*#__PURE__*/React__default["default"].createElement("circle", {
|
|
909
|
+
cx: "8",
|
|
910
|
+
cy: "8.5",
|
|
911
|
+
r: "7.5",
|
|
912
|
+
fill: "none",
|
|
913
|
+
stroke: "currentColor"
|
|
914
|
+
})));
|
|
915
|
+
|
|
916
|
+
_defineProperty$2(_assertThisInitialized(_this), "onChange", function (val) {
|
|
917
|
+
var _this$props$onChange, _this$props, _this$props$onBlur, _this$props2;
|
|
918
|
+
|
|
919
|
+
(_this$props$onChange = (_this$props = _this.props).onChange) === null || _this$props$onChange === void 0 ? void 0 : _this$props$onChange.call(_this$props, val);
|
|
920
|
+
(_this$props$onBlur = (_this$props2 = _this.props).onBlur) === null || _this$props$onBlur === void 0 ? void 0 : _this$props$onBlur.call(_this$props2);
|
|
921
|
+
});
|
|
922
|
+
|
|
923
|
+
return _this;
|
|
924
|
+
}
|
|
925
|
+
|
|
926
|
+
_createClass$1(Bool, [{
|
|
927
|
+
key: "render",
|
|
928
|
+
value: function render() {
|
|
929
|
+
var _this2 = this;
|
|
930
|
+
|
|
931
|
+
return /*#__PURE__*/React__default["default"].createElement("div", {
|
|
932
|
+
className: classnames('param-bool', {
|
|
933
|
+
readonly: this.props.readonly
|
|
934
|
+
}, this.props.className),
|
|
935
|
+
style: this.props.style
|
|
936
|
+
}, this.props.readonly ? /*#__PURE__*/React__default["default"].createElement("span", {
|
|
937
|
+
className: "param-bool-val"
|
|
938
|
+
}, !isNullLike(this.props.value) ? String(this.props.value).toUpperCase() : '-') : this.options.map(function (it) {
|
|
939
|
+
var active = it.value === _this2.props.value;
|
|
940
|
+
return /*#__PURE__*/React__default["default"].createElement("div", {
|
|
941
|
+
key: String(it.value),
|
|
942
|
+
className: classnames('param-bool-option', {
|
|
943
|
+
active: active
|
|
944
|
+
}),
|
|
945
|
+
onClick: _this2.onChange.bind(null, it.value)
|
|
946
|
+
}, active ? _this2.RadioChecked : _this2.RadioUnchecked, it.label);
|
|
947
|
+
}));
|
|
948
|
+
}
|
|
949
|
+
}]);
|
|
950
|
+
|
|
951
|
+
return Bool;
|
|
952
|
+
}(React.PureComponent);
|
|
953
|
+
|
|
954
|
+
/*
|
|
955
|
+
* big.js v6.1.1
|
|
956
|
+
* A small, fast, easy-to-use library for arbitrary-precision decimal arithmetic.
|
|
957
|
+
* Copyright (c) 2021 Michael Mclaughlin
|
|
958
|
+
* https://github.com/MikeMcl/big.js/LICENCE.md
|
|
959
|
+
*/
|
|
960
|
+
|
|
961
|
+
/************************************** EDITABLE DEFAULTS *****************************************/
|
|
962
|
+
// The default values below must be integers within the stated ranges.
|
|
963
|
+
|
|
964
|
+
/*
|
|
965
|
+
* The maximum number of decimal places (DP) of the results of operations involving division:
|
|
966
|
+
* div and sqrt, and pow with negative exponents.
|
|
967
|
+
*/
|
|
968
|
+
var DP = 20,
|
|
969
|
+
// 0 to MAX_DP
|
|
970
|
+
|
|
971
|
+
/*
|
|
972
|
+
* The rounding mode (RM) used when rounding to the above decimal places.
|
|
973
|
+
*
|
|
974
|
+
* 0 Towards zero (i.e. truncate, no rounding). (ROUND_DOWN)
|
|
975
|
+
* 1 To nearest neighbour. If equidistant, round up. (ROUND_HALF_UP)
|
|
976
|
+
* 2 To nearest neighbour. If equidistant, to even. (ROUND_HALF_EVEN)
|
|
977
|
+
* 3 Away from zero. (ROUND_UP)
|
|
978
|
+
*/
|
|
979
|
+
RM = 1,
|
|
980
|
+
// 0, 1, 2 or 3
|
|
981
|
+
// The maximum value of DP and Big.DP.
|
|
982
|
+
MAX_DP = 1E6,
|
|
983
|
+
// 0 to 1000000
|
|
984
|
+
// The maximum magnitude of the exponent argument to the pow method.
|
|
985
|
+
MAX_POWER = 1E6,
|
|
986
|
+
// 1 to 1000000
|
|
987
|
+
|
|
988
|
+
/*
|
|
989
|
+
* The negative exponent (NE) at and beneath which toString returns exponential notation.
|
|
990
|
+
* (JavaScript numbers: -7)
|
|
991
|
+
* -1000000 is the minimum recommended exponent value of a Big.
|
|
992
|
+
*/
|
|
993
|
+
NE = -7,
|
|
994
|
+
// 0 to -1000000
|
|
995
|
+
|
|
996
|
+
/*
|
|
997
|
+
* The positive exponent (PE) at and above which toString returns exponential notation.
|
|
998
|
+
* (JavaScript numbers: 21)
|
|
999
|
+
* 1000000 is the maximum recommended exponent value of a Big, but this limit is not enforced.
|
|
1000
|
+
*/
|
|
1001
|
+
PE = 21,
|
|
1002
|
+
// 0 to 1000000
|
|
1003
|
+
|
|
1004
|
+
/*
|
|
1005
|
+
* When true, an error will be thrown if a primitive number is passed to the Big constructor,
|
|
1006
|
+
* or if valueOf is called, or if toNumber is called on a Big which cannot be converted to a
|
|
1007
|
+
* primitive number without a loss of precision.
|
|
1008
|
+
*/
|
|
1009
|
+
STRICT = false,
|
|
1010
|
+
// true or false
|
|
1011
|
+
|
|
1012
|
+
/**************************************************************************************************/
|
|
1013
|
+
// Error messages.
|
|
1014
|
+
NAME = '[big.js] ',
|
|
1015
|
+
INVALID = NAME + 'Invalid ',
|
|
1016
|
+
INVALID_DP = INVALID + 'decimal places',
|
|
1017
|
+
INVALID_RM = INVALID + 'rounding mode',
|
|
1018
|
+
DIV_BY_ZERO = NAME + 'Division by zero',
|
|
1019
|
+
// The shared prototype object.
|
|
1020
|
+
P = {},
|
|
1021
|
+
UNDEFINED = void 0,
|
|
1022
|
+
NUMERIC = /^-?(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i;
|
|
1023
|
+
/*
|
|
1024
|
+
* Create and return a Big constructor.
|
|
1025
|
+
*/
|
|
1026
|
+
|
|
1027
|
+
function _Big_() {
|
|
1028
|
+
/*
|
|
1029
|
+
* The Big constructor and exported function.
|
|
1030
|
+
* Create and return a new instance of a Big number object.
|
|
1031
|
+
*
|
|
1032
|
+
* n {number|string|Big} A numeric value.
|
|
1033
|
+
*/
|
|
1034
|
+
function Big(n) {
|
|
1035
|
+
var x = this; // Enable constructor usage without new.
|
|
1036
|
+
|
|
1037
|
+
if (!(x instanceof Big)) return n === UNDEFINED ? _Big_() : new Big(n); // Duplicate.
|
|
1038
|
+
|
|
1039
|
+
if (n instanceof Big) {
|
|
1040
|
+
x.s = n.s;
|
|
1041
|
+
x.e = n.e;
|
|
1042
|
+
x.c = n.c.slice();
|
|
1043
|
+
} else {
|
|
1044
|
+
if (typeof n !== 'string') {
|
|
1045
|
+
if (Big.strict === true) {
|
|
1046
|
+
throw TypeError(INVALID + 'number');
|
|
1047
|
+
} // Minus zero?
|
|
1048
|
+
|
|
1049
|
+
|
|
1050
|
+
n = n === 0 && 1 / n < 0 ? '-0' : String(n);
|
|
1051
|
+
}
|
|
1052
|
+
|
|
1053
|
+
parse(x, n);
|
|
1054
|
+
} // Retain a reference to this Big constructor.
|
|
1055
|
+
// Shadow Big.prototype.constructor which points to Object.
|
|
1056
|
+
|
|
1057
|
+
|
|
1058
|
+
x.constructor = Big;
|
|
1059
|
+
}
|
|
1060
|
+
|
|
1061
|
+
Big.prototype = P;
|
|
1062
|
+
Big.DP = DP;
|
|
1063
|
+
Big.RM = RM;
|
|
1064
|
+
Big.NE = NE;
|
|
1065
|
+
Big.PE = PE;
|
|
1066
|
+
Big.strict = STRICT;
|
|
1067
|
+
Big.roundDown = 0;
|
|
1068
|
+
Big.roundHalfUp = 1;
|
|
1069
|
+
Big.roundHalfEven = 2;
|
|
1070
|
+
Big.roundUp = 3;
|
|
1071
|
+
return Big;
|
|
1072
|
+
}
|
|
1073
|
+
/*
|
|
1074
|
+
* Parse the number or string value passed to a Big constructor.
|
|
1075
|
+
*
|
|
1076
|
+
* x {Big} A Big number instance.
|
|
1077
|
+
* n {number|string} A numeric value.
|
|
1078
|
+
*/
|
|
1079
|
+
|
|
1080
|
+
|
|
1081
|
+
function parse(x, n) {
|
|
1082
|
+
var e, i, nl;
|
|
1083
|
+
|
|
1084
|
+
if (!NUMERIC.test(n)) {
|
|
1085
|
+
throw Error(INVALID + 'number');
|
|
1086
|
+
} // Determine sign.
|
|
1087
|
+
|
|
1088
|
+
|
|
1089
|
+
x.s = n.charAt(0) == '-' ? (n = n.slice(1), -1) : 1; // Decimal point?
|
|
1090
|
+
|
|
1091
|
+
if ((e = n.indexOf('.')) > -1) n = n.replace('.', ''); // Exponential form?
|
|
1092
|
+
|
|
1093
|
+
if ((i = n.search(/e/i)) > 0) {
|
|
1094
|
+
// Determine exponent.
|
|
1095
|
+
if (e < 0) e = i;
|
|
1096
|
+
e += +n.slice(i + 1);
|
|
1097
|
+
n = n.substring(0, i);
|
|
1098
|
+
} else if (e < 0) {
|
|
1099
|
+
// Integer.
|
|
1100
|
+
e = n.length;
|
|
1101
|
+
}
|
|
1102
|
+
|
|
1103
|
+
nl = n.length; // Determine leading zeros.
|
|
1104
|
+
|
|
1105
|
+
for (i = 0; i < nl && n.charAt(i) == '0';) ++i;
|
|
1106
|
+
|
|
1107
|
+
if (i == nl) {
|
|
1108
|
+
// Zero.
|
|
1109
|
+
x.c = [x.e = 0];
|
|
1110
|
+
} else {
|
|
1111
|
+
// Determine trailing zeros.
|
|
1112
|
+
for (; nl > 0 && n.charAt(--nl) == '0';);
|
|
1113
|
+
|
|
1114
|
+
x.e = e - i - 1;
|
|
1115
|
+
x.c = []; // Convert string to array of digits without leading/trailing zeros.
|
|
1116
|
+
|
|
1117
|
+
for (e = 0; i <= nl;) x.c[e++] = +n.charAt(i++);
|
|
1118
|
+
}
|
|
1119
|
+
|
|
1120
|
+
return x;
|
|
1121
|
+
}
|
|
1122
|
+
/*
|
|
1123
|
+
* Round Big x to a maximum of sd significant digits using rounding mode rm.
|
|
1124
|
+
*
|
|
1125
|
+
* x {Big} The Big to round.
|
|
1126
|
+
* sd {number} Significant digits: integer, 0 to MAX_DP inclusive.
|
|
1127
|
+
* rm {number} Rounding mode: 0 (down), 1 (half-up), 2 (half-even) or 3 (up).
|
|
1128
|
+
* [more] {boolean} Whether the result of division was truncated.
|
|
1129
|
+
*/
|
|
1130
|
+
|
|
1131
|
+
|
|
1132
|
+
function round(x, sd, rm, more) {
|
|
1133
|
+
var xc = x.c;
|
|
1134
|
+
if (rm === UNDEFINED) rm = x.constructor.RM;
|
|
1135
|
+
|
|
1136
|
+
if (rm !== 0 && rm !== 1 && rm !== 2 && rm !== 3) {
|
|
1137
|
+
throw Error(INVALID_RM);
|
|
1138
|
+
}
|
|
1139
|
+
|
|
1140
|
+
if (sd < 1) {
|
|
1141
|
+
more = rm === 3 && (more || !!xc[0]) || sd === 0 && (rm === 1 && xc[0] >= 5 || rm === 2 && (xc[0] > 5 || xc[0] === 5 && (more || xc[1] !== UNDEFINED)));
|
|
1142
|
+
xc.length = 1;
|
|
1143
|
+
|
|
1144
|
+
if (more) {
|
|
1145
|
+
// 1, 0.1, 0.01, 0.001, 0.0001 etc.
|
|
1146
|
+
x.e = x.e - sd + 1;
|
|
1147
|
+
xc[0] = 1;
|
|
1148
|
+
} else {
|
|
1149
|
+
// Zero.
|
|
1150
|
+
xc[0] = x.e = 0;
|
|
1151
|
+
}
|
|
1152
|
+
} else if (sd < xc.length) {
|
|
1153
|
+
// xc[sd] is the digit after the digit that may be rounded up.
|
|
1154
|
+
more = rm === 1 && xc[sd] >= 5 || rm === 2 && (xc[sd] > 5 || xc[sd] === 5 && (more || xc[sd + 1] !== UNDEFINED || xc[sd - 1] & 1)) || rm === 3 && (more || !!xc[0]); // Remove any digits after the required precision.
|
|
1155
|
+
|
|
1156
|
+
xc.length = sd--; // Round up?
|
|
1157
|
+
|
|
1158
|
+
if (more) {
|
|
1159
|
+
// Rounding up may mean the previous digit has to be rounded up.
|
|
1160
|
+
for (; ++xc[sd] > 9;) {
|
|
1161
|
+
xc[sd] = 0;
|
|
1162
|
+
|
|
1163
|
+
if (!sd--) {
|
|
1164
|
+
++x.e;
|
|
1165
|
+
xc.unshift(1);
|
|
1166
|
+
}
|
|
1167
|
+
}
|
|
1168
|
+
} // Remove trailing zeros.
|
|
1169
|
+
|
|
1170
|
+
|
|
1171
|
+
for (sd = xc.length; !xc[--sd];) xc.pop();
|
|
1172
|
+
}
|
|
1173
|
+
|
|
1174
|
+
return x;
|
|
1175
|
+
}
|
|
1176
|
+
/*
|
|
1177
|
+
* Return a string representing the value of Big x in normal or exponential notation.
|
|
1178
|
+
* Handles P.toExponential, P.toFixed, P.toJSON, P.toPrecision, P.toString and P.valueOf.
|
|
1179
|
+
*/
|
|
1180
|
+
|
|
1181
|
+
|
|
1182
|
+
function stringify(x, doExponential, isNonzero) {
|
|
1183
|
+
var e = x.e,
|
|
1184
|
+
s = x.c.join(''),
|
|
1185
|
+
n = s.length; // Exponential notation?
|
|
1186
|
+
|
|
1187
|
+
if (doExponential) {
|
|
1188
|
+
s = s.charAt(0) + (n > 1 ? '.' + s.slice(1) : '') + (e < 0 ? 'e' : 'e+') + e; // Normal notation.
|
|
1189
|
+
} else if (e < 0) {
|
|
1190
|
+
for (; ++e;) s = '0' + s;
|
|
1191
|
+
|
|
1192
|
+
s = '0.' + s;
|
|
1193
|
+
} else if (e > 0) {
|
|
1194
|
+
if (++e > n) {
|
|
1195
|
+
for (e -= n; e--;) s += '0';
|
|
1196
|
+
} else if (e < n) {
|
|
1197
|
+
s = s.slice(0, e) + '.' + s.slice(e);
|
|
1198
|
+
}
|
|
1199
|
+
} else if (n > 1) {
|
|
1200
|
+
s = s.charAt(0) + '.' + s.slice(1);
|
|
1201
|
+
}
|
|
1202
|
+
|
|
1203
|
+
return x.s < 0 && isNonzero ? '-' + s : s;
|
|
1204
|
+
} // Prototype/instance methods
|
|
1205
|
+
|
|
1206
|
+
/*
|
|
1207
|
+
* Return a new Big whose value is the absolute value of this Big.
|
|
1208
|
+
*/
|
|
1209
|
+
|
|
1210
|
+
|
|
1211
|
+
P.abs = function () {
|
|
1212
|
+
var x = new this.constructor(this);
|
|
1213
|
+
x.s = 1;
|
|
1214
|
+
return x;
|
|
1215
|
+
};
|
|
1216
|
+
/*
|
|
1217
|
+
* Return 1 if the value of this Big is greater than the value of Big y,
|
|
1218
|
+
* -1 if the value of this Big is less than the value of Big y, or
|
|
1219
|
+
* 0 if they have the same value.
|
|
1220
|
+
*/
|
|
1221
|
+
|
|
1222
|
+
|
|
1223
|
+
P.cmp = function (y) {
|
|
1224
|
+
var isneg,
|
|
1225
|
+
x = this,
|
|
1226
|
+
xc = x.c,
|
|
1227
|
+
yc = (y = new x.constructor(y)).c,
|
|
1228
|
+
i = x.s,
|
|
1229
|
+
j = y.s,
|
|
1230
|
+
k = x.e,
|
|
1231
|
+
l = y.e; // Either zero?
|
|
1232
|
+
|
|
1233
|
+
if (!xc[0] || !yc[0]) return !xc[0] ? !yc[0] ? 0 : -j : i; // Signs differ?
|
|
1234
|
+
|
|
1235
|
+
if (i != j) return i;
|
|
1236
|
+
isneg = i < 0; // Compare exponents.
|
|
1237
|
+
|
|
1238
|
+
if (k != l) return k > l ^ isneg ? 1 : -1;
|
|
1239
|
+
j = (k = xc.length) < (l = yc.length) ? k : l; // Compare digit by digit.
|
|
1240
|
+
|
|
1241
|
+
for (i = -1; ++i < j;) {
|
|
1242
|
+
if (xc[i] != yc[i]) return xc[i] > yc[i] ^ isneg ? 1 : -1;
|
|
1243
|
+
} // Compare lengths.
|
|
1244
|
+
|
|
1245
|
+
|
|
1246
|
+
return k == l ? 0 : k > l ^ isneg ? 1 : -1;
|
|
1247
|
+
};
|
|
1248
|
+
/*
|
|
1249
|
+
* Return a new Big whose value is the value of this Big divided by the value of Big y, rounded,
|
|
1250
|
+
* if necessary, to a maximum of Big.DP decimal places using rounding mode Big.RM.
|
|
1251
|
+
*/
|
|
1252
|
+
|
|
1253
|
+
|
|
1254
|
+
P.div = function (y) {
|
|
1255
|
+
var x = this,
|
|
1256
|
+
Big = x.constructor,
|
|
1257
|
+
a = x.c,
|
|
1258
|
+
// dividend
|
|
1259
|
+
b = (y = new Big(y)).c,
|
|
1260
|
+
// divisor
|
|
1261
|
+
k = x.s == y.s ? 1 : -1,
|
|
1262
|
+
dp = Big.DP;
|
|
1263
|
+
|
|
1264
|
+
if (dp !== ~~dp || dp < 0 || dp > MAX_DP) {
|
|
1265
|
+
throw Error(INVALID_DP);
|
|
1266
|
+
} // Divisor is zero?
|
|
1267
|
+
|
|
1268
|
+
|
|
1269
|
+
if (!b[0]) {
|
|
1270
|
+
throw Error(DIV_BY_ZERO);
|
|
1271
|
+
} // Dividend is 0? Return +-0.
|
|
1272
|
+
|
|
1273
|
+
|
|
1274
|
+
if (!a[0]) {
|
|
1275
|
+
y.s = k;
|
|
1276
|
+
y.c = [y.e = 0];
|
|
1277
|
+
return y;
|
|
1278
|
+
}
|
|
1279
|
+
|
|
1280
|
+
var bl,
|
|
1281
|
+
bt,
|
|
1282
|
+
n,
|
|
1283
|
+
cmp,
|
|
1284
|
+
ri,
|
|
1285
|
+
bz = b.slice(),
|
|
1286
|
+
ai = bl = b.length,
|
|
1287
|
+
al = a.length,
|
|
1288
|
+
r = a.slice(0, bl),
|
|
1289
|
+
// remainder
|
|
1290
|
+
rl = r.length,
|
|
1291
|
+
q = y,
|
|
1292
|
+
// quotient
|
|
1293
|
+
qc = q.c = [],
|
|
1294
|
+
qi = 0,
|
|
1295
|
+
p = dp + (q.e = x.e - y.e) + 1; // precision of the result
|
|
1296
|
+
|
|
1297
|
+
q.s = k;
|
|
1298
|
+
k = p < 0 ? 0 : p; // Create version of divisor with leading zero.
|
|
1299
|
+
|
|
1300
|
+
bz.unshift(0); // Add zeros to make remainder as long as divisor.
|
|
1301
|
+
|
|
1302
|
+
for (; rl++ < bl;) r.push(0);
|
|
1303
|
+
|
|
1304
|
+
do {
|
|
1305
|
+
// n is how many times the divisor goes into current remainder.
|
|
1306
|
+
for (n = 0; n < 10; n++) {
|
|
1307
|
+
// Compare divisor and remainder.
|
|
1308
|
+
if (bl != (rl = r.length)) {
|
|
1309
|
+
cmp = bl > rl ? 1 : -1;
|
|
1310
|
+
} else {
|
|
1311
|
+
for (ri = -1, cmp = 0; ++ri < bl;) {
|
|
1312
|
+
if (b[ri] != r[ri]) {
|
|
1313
|
+
cmp = b[ri] > r[ri] ? 1 : -1;
|
|
1314
|
+
break;
|
|
1315
|
+
}
|
|
1316
|
+
}
|
|
1317
|
+
} // If divisor < remainder, subtract divisor from remainder.
|
|
1318
|
+
|
|
1319
|
+
|
|
1320
|
+
if (cmp < 0) {
|
|
1321
|
+
// Remainder can't be more than 1 digit longer than divisor.
|
|
1322
|
+
// Equalise lengths using divisor with extra leading zero?
|
|
1323
|
+
for (bt = rl == bl ? b : bz; rl;) {
|
|
1324
|
+
if (r[--rl] < bt[rl]) {
|
|
1325
|
+
ri = rl;
|
|
1326
|
+
|
|
1327
|
+
for (; ri && !r[--ri];) r[ri] = 9;
|
|
1328
|
+
|
|
1329
|
+
--r[ri];
|
|
1330
|
+
r[rl] += 10;
|
|
1331
|
+
}
|
|
1332
|
+
|
|
1333
|
+
r[rl] -= bt[rl];
|
|
1334
|
+
}
|
|
1335
|
+
|
|
1336
|
+
for (; !r[0];) r.shift();
|
|
1337
|
+
} else {
|
|
1338
|
+
break;
|
|
1339
|
+
}
|
|
1340
|
+
} // Add the digit n to the result array.
|
|
1341
|
+
|
|
1342
|
+
|
|
1343
|
+
qc[qi++] = cmp ? n : ++n; // Update the remainder.
|
|
1344
|
+
|
|
1345
|
+
if (r[0] && cmp) r[rl] = a[ai] || 0;else r = [a[ai]];
|
|
1346
|
+
} while ((ai++ < al || r[0] !== UNDEFINED) && k--); // Leading zero? Do not remove if result is simply zero (qi == 1).
|
|
1347
|
+
|
|
1348
|
+
|
|
1349
|
+
if (!qc[0] && qi != 1) {
|
|
1350
|
+
// There can't be more than one zero.
|
|
1351
|
+
qc.shift();
|
|
1352
|
+
q.e--;
|
|
1353
|
+
p--;
|
|
1354
|
+
} // Round?
|
|
1355
|
+
|
|
1356
|
+
|
|
1357
|
+
if (qi > p) round(q, p, Big.RM, r[0] !== UNDEFINED);
|
|
1358
|
+
return q;
|
|
1359
|
+
};
|
|
1360
|
+
/*
|
|
1361
|
+
* Return true if the value of this Big is equal to the value of Big y, otherwise return false.
|
|
1362
|
+
*/
|
|
1363
|
+
|
|
1364
|
+
|
|
1365
|
+
P.eq = function (y) {
|
|
1366
|
+
return this.cmp(y) === 0;
|
|
1367
|
+
};
|
|
1368
|
+
/*
|
|
1369
|
+
* Return true if the value of this Big is greater than the value of Big y, otherwise return
|
|
1370
|
+
* false.
|
|
1371
|
+
*/
|
|
1372
|
+
|
|
1373
|
+
|
|
1374
|
+
P.gt = function (y) {
|
|
1375
|
+
return this.cmp(y) > 0;
|
|
1376
|
+
};
|
|
1377
|
+
/*
|
|
1378
|
+
* Return true if the value of this Big is greater than or equal to the value of Big y, otherwise
|
|
1379
|
+
* return false.
|
|
1380
|
+
*/
|
|
1381
|
+
|
|
1382
|
+
|
|
1383
|
+
P.gte = function (y) {
|
|
1384
|
+
return this.cmp(y) > -1;
|
|
1385
|
+
};
|
|
1386
|
+
/*
|
|
1387
|
+
* Return true if the value of this Big is less than the value of Big y, otherwise return false.
|
|
1388
|
+
*/
|
|
1389
|
+
|
|
1390
|
+
|
|
1391
|
+
P.lt = function (y) {
|
|
1392
|
+
return this.cmp(y) < 0;
|
|
1393
|
+
};
|
|
1394
|
+
/*
|
|
1395
|
+
* Return true if the value of this Big is less than or equal to the value of Big y, otherwise
|
|
1396
|
+
* return false.
|
|
1397
|
+
*/
|
|
1398
|
+
|
|
1399
|
+
|
|
1400
|
+
P.lte = function (y) {
|
|
1401
|
+
return this.cmp(y) < 1;
|
|
1402
|
+
};
|
|
1403
|
+
/*
|
|
1404
|
+
* Return a new Big whose value is the value of this Big minus the value of Big y.
|
|
1405
|
+
*/
|
|
1406
|
+
|
|
1407
|
+
|
|
1408
|
+
P.minus = P.sub = function (y) {
|
|
1409
|
+
var i,
|
|
1410
|
+
j,
|
|
1411
|
+
t,
|
|
1412
|
+
xlty,
|
|
1413
|
+
x = this,
|
|
1414
|
+
Big = x.constructor,
|
|
1415
|
+
a = x.s,
|
|
1416
|
+
b = (y = new Big(y)).s; // Signs differ?
|
|
1417
|
+
|
|
1418
|
+
if (a != b) {
|
|
1419
|
+
y.s = -b;
|
|
1420
|
+
return x.plus(y);
|
|
1421
|
+
}
|
|
1422
|
+
|
|
1423
|
+
var xc = x.c.slice(),
|
|
1424
|
+
xe = x.e,
|
|
1425
|
+
yc = y.c,
|
|
1426
|
+
ye = y.e; // Either zero?
|
|
1427
|
+
|
|
1428
|
+
if (!xc[0] || !yc[0]) {
|
|
1429
|
+
if (yc[0]) {
|
|
1430
|
+
y.s = -b;
|
|
1431
|
+
} else if (xc[0]) {
|
|
1432
|
+
y = new Big(x);
|
|
1433
|
+
} else {
|
|
1434
|
+
y.s = 1;
|
|
1435
|
+
}
|
|
1436
|
+
|
|
1437
|
+
return y;
|
|
1438
|
+
} // Determine which is the bigger number. Prepend zeros to equalise exponents.
|
|
1439
|
+
|
|
1440
|
+
|
|
1441
|
+
if (a = xe - ye) {
|
|
1442
|
+
if (xlty = a < 0) {
|
|
1443
|
+
a = -a;
|
|
1444
|
+
t = xc;
|
|
1445
|
+
} else {
|
|
1446
|
+
ye = xe;
|
|
1447
|
+
t = yc;
|
|
1448
|
+
}
|
|
1449
|
+
|
|
1450
|
+
t.reverse();
|
|
1451
|
+
|
|
1452
|
+
for (b = a; b--;) t.push(0);
|
|
1453
|
+
|
|
1454
|
+
t.reverse();
|
|
1455
|
+
} else {
|
|
1456
|
+
// Exponents equal. Check digit by digit.
|
|
1457
|
+
j = ((xlty = xc.length < yc.length) ? xc : yc).length;
|
|
1458
|
+
|
|
1459
|
+
for (a = b = 0; b < j; b++) {
|
|
1460
|
+
if (xc[b] != yc[b]) {
|
|
1461
|
+
xlty = xc[b] < yc[b];
|
|
1462
|
+
break;
|
|
1463
|
+
}
|
|
1464
|
+
}
|
|
1465
|
+
} // x < y? Point xc to the array of the bigger number.
|
|
1466
|
+
|
|
1467
|
+
|
|
1468
|
+
if (xlty) {
|
|
1469
|
+
t = xc;
|
|
1470
|
+
xc = yc;
|
|
1471
|
+
yc = t;
|
|
1472
|
+
y.s = -y.s;
|
|
1473
|
+
}
|
|
1474
|
+
/*
|
|
1475
|
+
* Append zeros to xc if shorter. No need to add zeros to yc if shorter as subtraction only
|
|
1476
|
+
* needs to start at yc.length.
|
|
1477
|
+
*/
|
|
1478
|
+
|
|
1479
|
+
|
|
1480
|
+
if ((b = (j = yc.length) - (i = xc.length)) > 0) for (; b--;) xc[i++] = 0; // Subtract yc from xc.
|
|
1481
|
+
|
|
1482
|
+
for (b = i; j > a;) {
|
|
1483
|
+
if (xc[--j] < yc[j]) {
|
|
1484
|
+
for (i = j; i && !xc[--i];) xc[i] = 9;
|
|
1485
|
+
|
|
1486
|
+
--xc[i];
|
|
1487
|
+
xc[j] += 10;
|
|
1488
|
+
}
|
|
1489
|
+
|
|
1490
|
+
xc[j] -= yc[j];
|
|
1491
|
+
} // Remove trailing zeros.
|
|
1492
|
+
|
|
1493
|
+
|
|
1494
|
+
for (; xc[--b] === 0;) xc.pop(); // Remove leading zeros and adjust exponent accordingly.
|
|
1495
|
+
|
|
1496
|
+
|
|
1497
|
+
for (; xc[0] === 0;) {
|
|
1498
|
+
xc.shift();
|
|
1499
|
+
--ye;
|
|
1500
|
+
}
|
|
1501
|
+
|
|
1502
|
+
if (!xc[0]) {
|
|
1503
|
+
// n - n = +0
|
|
1504
|
+
y.s = 1; // Result must be zero.
|
|
1505
|
+
|
|
1506
|
+
xc = [ye = 0];
|
|
1507
|
+
}
|
|
1508
|
+
|
|
1509
|
+
y.c = xc;
|
|
1510
|
+
y.e = ye;
|
|
1511
|
+
return y;
|
|
1512
|
+
};
|
|
1513
|
+
/*
|
|
1514
|
+
* Return a new Big whose value is the value of this Big modulo the value of Big y.
|
|
1515
|
+
*/
|
|
1516
|
+
|
|
1517
|
+
|
|
1518
|
+
P.mod = function (y) {
|
|
1519
|
+
var ygtx,
|
|
1520
|
+
x = this,
|
|
1521
|
+
Big = x.constructor,
|
|
1522
|
+
a = x.s,
|
|
1523
|
+
b = (y = new Big(y)).s;
|
|
1524
|
+
|
|
1525
|
+
if (!y.c[0]) {
|
|
1526
|
+
throw Error(DIV_BY_ZERO);
|
|
1527
|
+
}
|
|
1528
|
+
|
|
1529
|
+
x.s = y.s = 1;
|
|
1530
|
+
ygtx = y.cmp(x) == 1;
|
|
1531
|
+
x.s = a;
|
|
1532
|
+
y.s = b;
|
|
1533
|
+
if (ygtx) return new Big(x);
|
|
1534
|
+
a = Big.DP;
|
|
1535
|
+
b = Big.RM;
|
|
1536
|
+
Big.DP = Big.RM = 0;
|
|
1537
|
+
x = x.div(y);
|
|
1538
|
+
Big.DP = a;
|
|
1539
|
+
Big.RM = b;
|
|
1540
|
+
return this.minus(x.times(y));
|
|
1541
|
+
};
|
|
1542
|
+
/*
|
|
1543
|
+
* Return a new Big whose value is the value of this Big plus the value of Big y.
|
|
1544
|
+
*/
|
|
1545
|
+
|
|
1546
|
+
|
|
1547
|
+
P.plus = P.add = function (y) {
|
|
1548
|
+
var e,
|
|
1549
|
+
k,
|
|
1550
|
+
t,
|
|
1551
|
+
x = this,
|
|
1552
|
+
Big = x.constructor;
|
|
1553
|
+
y = new Big(y); // Signs differ?
|
|
1554
|
+
|
|
1555
|
+
if (x.s != y.s) {
|
|
1556
|
+
y.s = -y.s;
|
|
1557
|
+
return x.minus(y);
|
|
1558
|
+
}
|
|
1559
|
+
|
|
1560
|
+
var xe = x.e,
|
|
1561
|
+
xc = x.c,
|
|
1562
|
+
ye = y.e,
|
|
1563
|
+
yc = y.c; // Either zero?
|
|
1564
|
+
|
|
1565
|
+
if (!xc[0] || !yc[0]) {
|
|
1566
|
+
if (!yc[0]) {
|
|
1567
|
+
if (xc[0]) {
|
|
1568
|
+
y = new Big(x);
|
|
1569
|
+
} else {
|
|
1570
|
+
y.s = x.s;
|
|
1571
|
+
}
|
|
1572
|
+
}
|
|
1573
|
+
|
|
1574
|
+
return y;
|
|
1575
|
+
}
|
|
1576
|
+
|
|
1577
|
+
xc = xc.slice(); // Prepend zeros to equalise exponents.
|
|
1578
|
+
// Note: reverse faster than unshifts.
|
|
1579
|
+
|
|
1580
|
+
if (e = xe - ye) {
|
|
1581
|
+
if (e > 0) {
|
|
1582
|
+
ye = xe;
|
|
1583
|
+
t = yc;
|
|
1584
|
+
} else {
|
|
1585
|
+
e = -e;
|
|
1586
|
+
t = xc;
|
|
1587
|
+
}
|
|
1588
|
+
|
|
1589
|
+
t.reverse();
|
|
1590
|
+
|
|
1591
|
+
for (; e--;) t.push(0);
|
|
1592
|
+
|
|
1593
|
+
t.reverse();
|
|
1594
|
+
} // Point xc to the longer array.
|
|
1595
|
+
|
|
1596
|
+
|
|
1597
|
+
if (xc.length - yc.length < 0) {
|
|
1598
|
+
t = yc;
|
|
1599
|
+
yc = xc;
|
|
1600
|
+
xc = t;
|
|
1601
|
+
}
|
|
1602
|
+
|
|
1603
|
+
e = yc.length; // Only start adding at yc.length - 1 as the further digits of xc can be left as they are.
|
|
1604
|
+
|
|
1605
|
+
for (k = 0; e; xc[e] %= 10) k = (xc[--e] = xc[e] + yc[e] + k) / 10 | 0; // No need to check for zero, as +x + +y != 0 && -x + -y != 0
|
|
1606
|
+
|
|
1607
|
+
|
|
1608
|
+
if (k) {
|
|
1609
|
+
xc.unshift(k);
|
|
1610
|
+
++ye;
|
|
1611
|
+
} // Remove trailing zeros.
|
|
1612
|
+
|
|
1613
|
+
|
|
1614
|
+
for (e = xc.length; xc[--e] === 0;) xc.pop();
|
|
1615
|
+
|
|
1616
|
+
y.c = xc;
|
|
1617
|
+
y.e = ye;
|
|
1618
|
+
return y;
|
|
1619
|
+
};
|
|
1620
|
+
/*
|
|
1621
|
+
* Return a Big whose value is the value of this Big raised to the power n.
|
|
1622
|
+
* If n is negative, round to a maximum of Big.DP decimal places using rounding
|
|
1623
|
+
* mode Big.RM.
|
|
1624
|
+
*
|
|
1625
|
+
* n {number} Integer, -MAX_POWER to MAX_POWER inclusive.
|
|
1626
|
+
*/
|
|
1627
|
+
|
|
1628
|
+
|
|
1629
|
+
P.pow = function (n) {
|
|
1630
|
+
var x = this,
|
|
1631
|
+
one = new x.constructor('1'),
|
|
1632
|
+
y = one,
|
|
1633
|
+
isneg = n < 0;
|
|
1634
|
+
|
|
1635
|
+
if (n !== ~~n || n < -MAX_POWER || n > MAX_POWER) {
|
|
1636
|
+
throw Error(INVALID + 'exponent');
|
|
1637
|
+
}
|
|
1638
|
+
|
|
1639
|
+
if (isneg) n = -n;
|
|
1640
|
+
|
|
1641
|
+
for (;;) {
|
|
1642
|
+
if (n & 1) y = y.times(x);
|
|
1643
|
+
n >>= 1;
|
|
1644
|
+
if (!n) break;
|
|
1645
|
+
x = x.times(x);
|
|
1646
|
+
}
|
|
1647
|
+
|
|
1648
|
+
return isneg ? one.div(y) : y;
|
|
1649
|
+
};
|
|
1650
|
+
/*
|
|
1651
|
+
* Return a new Big whose value is the value of this Big rounded to a maximum precision of sd
|
|
1652
|
+
* significant digits using rounding mode rm, or Big.RM if rm is not specified.
|
|
1653
|
+
*
|
|
1654
|
+
* sd {number} Significant digits: integer, 1 to MAX_DP inclusive.
|
|
1655
|
+
* rm? {number} Rounding mode: 0 (down), 1 (half-up), 2 (half-even) or 3 (up).
|
|
1656
|
+
*/
|
|
1657
|
+
|
|
1658
|
+
|
|
1659
|
+
P.prec = function (sd, rm) {
|
|
1660
|
+
if (sd !== ~~sd || sd < 1 || sd > MAX_DP) {
|
|
1661
|
+
throw Error(INVALID + 'precision');
|
|
1662
|
+
}
|
|
1663
|
+
|
|
1664
|
+
return round(new this.constructor(this), sd, rm);
|
|
1665
|
+
};
|
|
1666
|
+
/*
|
|
1667
|
+
* Return a new Big whose value is the value of this Big rounded to a maximum of dp decimal places
|
|
1668
|
+
* using rounding mode rm, or Big.RM if rm is not specified.
|
|
1669
|
+
* If dp is negative, round to an integer which is a multiple of 10**-dp.
|
|
1670
|
+
* If dp is not specified, round to 0 decimal places.
|
|
1671
|
+
*
|
|
1672
|
+
* dp? {number} Integer, -MAX_DP to MAX_DP inclusive.
|
|
1673
|
+
* rm? {number} Rounding mode: 0 (down), 1 (half-up), 2 (half-even) or 3 (up).
|
|
1674
|
+
*/
|
|
1675
|
+
|
|
1676
|
+
|
|
1677
|
+
P.round = function (dp, rm) {
|
|
1678
|
+
if (dp === UNDEFINED) dp = 0;else if (dp !== ~~dp || dp < -MAX_DP || dp > MAX_DP) {
|
|
1679
|
+
throw Error(INVALID_DP);
|
|
1680
|
+
}
|
|
1681
|
+
return round(new this.constructor(this), dp + this.e + 1, rm);
|
|
1682
|
+
};
|
|
1683
|
+
/*
|
|
1684
|
+
* Return a new Big whose value is the square root of the value of this Big, rounded, if
|
|
1685
|
+
* necessary, to a maximum of Big.DP decimal places using rounding mode Big.RM.
|
|
1686
|
+
*/
|
|
1687
|
+
|
|
1688
|
+
|
|
1689
|
+
P.sqrt = function () {
|
|
1690
|
+
var r,
|
|
1691
|
+
c,
|
|
1692
|
+
t,
|
|
1693
|
+
x = this,
|
|
1694
|
+
Big = x.constructor,
|
|
1695
|
+
s = x.s,
|
|
1696
|
+
e = x.e,
|
|
1697
|
+
half = new Big('0.5'); // Zero?
|
|
1698
|
+
|
|
1699
|
+
if (!x.c[0]) return new Big(x); // Negative?
|
|
1700
|
+
|
|
1701
|
+
if (s < 0) {
|
|
1702
|
+
throw Error(NAME + 'No square root');
|
|
1703
|
+
} // Estimate.
|
|
1704
|
+
|
|
1705
|
+
|
|
1706
|
+
s = Math.sqrt(x + ''); // Math.sqrt underflow/overflow?
|
|
1707
|
+
// Re-estimate: pass x coefficient to Math.sqrt as integer, then adjust the result exponent.
|
|
1708
|
+
|
|
1709
|
+
if (s === 0 || s === 1 / 0) {
|
|
1710
|
+
c = x.c.join('');
|
|
1711
|
+
if (!(c.length + e & 1)) c += '0';
|
|
1712
|
+
s = Math.sqrt(c);
|
|
1713
|
+
e = ((e + 1) / 2 | 0) - (e < 0 || e & 1);
|
|
1714
|
+
r = new Big((s == 1 / 0 ? '5e' : (s = s.toExponential()).slice(0, s.indexOf('e') + 1)) + e);
|
|
1715
|
+
} else {
|
|
1716
|
+
r = new Big(s + '');
|
|
1717
|
+
}
|
|
1718
|
+
|
|
1719
|
+
e = r.e + (Big.DP += 4); // Newton-Raphson iteration.
|
|
1720
|
+
|
|
1721
|
+
do {
|
|
1722
|
+
t = r;
|
|
1723
|
+
r = half.times(t.plus(x.div(t)));
|
|
1724
|
+
} while (t.c.slice(0, e).join('') !== r.c.slice(0, e).join(''));
|
|
1725
|
+
|
|
1726
|
+
return round(r, (Big.DP -= 4) + r.e + 1, Big.RM);
|
|
1727
|
+
};
|
|
1728
|
+
/*
|
|
1729
|
+
* Return a new Big whose value is the value of this Big times the value of Big y.
|
|
1730
|
+
*/
|
|
1731
|
+
|
|
1732
|
+
|
|
1733
|
+
P.times = P.mul = function (y) {
|
|
1734
|
+
var c,
|
|
1735
|
+
x = this,
|
|
1736
|
+
Big = x.constructor,
|
|
1737
|
+
xc = x.c,
|
|
1738
|
+
yc = (y = new Big(y)).c,
|
|
1739
|
+
a = xc.length,
|
|
1740
|
+
b = yc.length,
|
|
1741
|
+
i = x.e,
|
|
1742
|
+
j = y.e; // Determine sign of result.
|
|
1743
|
+
|
|
1744
|
+
y.s = x.s == y.s ? 1 : -1; // Return signed 0 if either 0.
|
|
1745
|
+
|
|
1746
|
+
if (!xc[0] || !yc[0]) {
|
|
1747
|
+
y.c = [y.e = 0];
|
|
1748
|
+
return y;
|
|
1749
|
+
} // Initialise exponent of result as x.e + y.e.
|
|
1750
|
+
|
|
1751
|
+
|
|
1752
|
+
y.e = i + j; // If array xc has fewer digits than yc, swap xc and yc, and lengths.
|
|
1753
|
+
|
|
1754
|
+
if (a < b) {
|
|
1755
|
+
c = xc;
|
|
1756
|
+
xc = yc;
|
|
1757
|
+
yc = c;
|
|
1758
|
+
j = a;
|
|
1759
|
+
a = b;
|
|
1760
|
+
b = j;
|
|
1761
|
+
} // Initialise coefficient array of result with zeros.
|
|
1762
|
+
|
|
1763
|
+
|
|
1764
|
+
for (c = new Array(j = a + b); j--;) c[j] = 0; // Multiply.
|
|
1765
|
+
// i is initially xc.length.
|
|
1766
|
+
|
|
1767
|
+
|
|
1768
|
+
for (i = b; i--;) {
|
|
1769
|
+
b = 0; // a is yc.length.
|
|
1770
|
+
|
|
1771
|
+
for (j = a + i; j > i;) {
|
|
1772
|
+
// Current sum of products at this digit position, plus carry.
|
|
1773
|
+
b = c[j] + yc[i] * xc[j - i - 1] + b;
|
|
1774
|
+
c[j--] = b % 10; // carry
|
|
1775
|
+
|
|
1776
|
+
b = b / 10 | 0;
|
|
1777
|
+
}
|
|
1778
|
+
|
|
1779
|
+
c[j] = b;
|
|
1780
|
+
} // Increment result exponent if there is a final carry, otherwise remove leading zero.
|
|
1781
|
+
|
|
1782
|
+
|
|
1783
|
+
if (b) ++y.e;else c.shift(); // Remove trailing zeros.
|
|
1784
|
+
|
|
1785
|
+
for (i = c.length; !c[--i];) c.pop();
|
|
1786
|
+
|
|
1787
|
+
y.c = c;
|
|
1788
|
+
return y;
|
|
1789
|
+
};
|
|
1790
|
+
/*
|
|
1791
|
+
* Return a string representing the value of this Big in exponential notation rounded to dp fixed
|
|
1792
|
+
* decimal places using rounding mode rm, or Big.RM if rm is not specified.
|
|
1793
|
+
*
|
|
1794
|
+
* dp? {number} Decimal places: integer, 0 to MAX_DP inclusive.
|
|
1795
|
+
* rm? {number} Rounding mode: 0 (down), 1 (half-up), 2 (half-even) or 3 (up).
|
|
1796
|
+
*/
|
|
1797
|
+
|
|
1798
|
+
|
|
1799
|
+
P.toExponential = function (dp, rm) {
|
|
1800
|
+
var x = this,
|
|
1801
|
+
n = x.c[0];
|
|
1802
|
+
|
|
1803
|
+
if (dp !== UNDEFINED) {
|
|
1804
|
+
if (dp !== ~~dp || dp < 0 || dp > MAX_DP) {
|
|
1805
|
+
throw Error(INVALID_DP);
|
|
1806
|
+
}
|
|
1807
|
+
|
|
1808
|
+
x = round(new x.constructor(x), ++dp, rm);
|
|
1809
|
+
|
|
1810
|
+
for (; x.c.length < dp;) x.c.push(0);
|
|
1811
|
+
}
|
|
1812
|
+
|
|
1813
|
+
return stringify(x, true, !!n);
|
|
1814
|
+
};
|
|
1815
|
+
/*
|
|
1816
|
+
* Return a string representing the value of this Big in normal notation rounded to dp fixed
|
|
1817
|
+
* decimal places using rounding mode rm, or Big.RM if rm is not specified.
|
|
1818
|
+
*
|
|
1819
|
+
* dp? {number} Decimal places: integer, 0 to MAX_DP inclusive.
|
|
1820
|
+
* rm? {number} Rounding mode: 0 (down), 1 (half-up), 2 (half-even) or 3 (up).
|
|
1821
|
+
*
|
|
1822
|
+
* (-0).toFixed(0) is '0', but (-0.1).toFixed(0) is '-0'.
|
|
1823
|
+
* (-0).toFixed(1) is '0.0', but (-0.01).toFixed(1) is '-0.0'.
|
|
1824
|
+
*/
|
|
1825
|
+
|
|
1826
|
+
|
|
1827
|
+
P.toFixed = function (dp, rm) {
|
|
1828
|
+
var x = this,
|
|
1829
|
+
n = x.c[0];
|
|
1830
|
+
|
|
1831
|
+
if (dp !== UNDEFINED) {
|
|
1832
|
+
if (dp !== ~~dp || dp < 0 || dp > MAX_DP) {
|
|
1833
|
+
throw Error(INVALID_DP);
|
|
1834
|
+
}
|
|
1835
|
+
|
|
1836
|
+
x = round(new x.constructor(x), dp + x.e + 1, rm); // x.e may have changed if the value is rounded up.
|
|
1837
|
+
|
|
1838
|
+
for (dp = dp + x.e + 1; x.c.length < dp;) x.c.push(0);
|
|
1839
|
+
}
|
|
1840
|
+
|
|
1841
|
+
return stringify(x, false, !!n);
|
|
1842
|
+
};
|
|
1843
|
+
/*
|
|
1844
|
+
* Return a string representing the value of this Big.
|
|
1845
|
+
* Return exponential notation if this Big has a positive exponent equal to or greater than
|
|
1846
|
+
* Big.PE, or a negative exponent equal to or less than Big.NE.
|
|
1847
|
+
* Omit the sign for negative zero.
|
|
1848
|
+
*/
|
|
1849
|
+
|
|
1850
|
+
|
|
1851
|
+
P.toJSON = P.toString = function () {
|
|
1852
|
+
var x = this,
|
|
1853
|
+
Big = x.constructor;
|
|
1854
|
+
return stringify(x, x.e <= Big.NE || x.e >= Big.PE, !!x.c[0]);
|
|
1855
|
+
};
|
|
1856
|
+
/*
|
|
1857
|
+
* Return the value of this Big as a primitve number.
|
|
1858
|
+
*/
|
|
1859
|
+
|
|
1860
|
+
|
|
1861
|
+
P.toNumber = function () {
|
|
1862
|
+
var n = Number(stringify(this, true, true));
|
|
1863
|
+
|
|
1864
|
+
if (this.constructor.strict === true && !this.eq(n.toString())) {
|
|
1865
|
+
throw Error(NAME + 'Imprecise conversion');
|
|
1866
|
+
}
|
|
1867
|
+
|
|
1868
|
+
return n;
|
|
1869
|
+
};
|
|
1870
|
+
/*
|
|
1871
|
+
* Return a string representing the value of this Big rounded to sd significant digits using
|
|
1872
|
+
* rounding mode rm, or Big.RM if rm is not specified.
|
|
1873
|
+
* Use exponential notation if sd is less than the number of digits necessary to represent
|
|
1874
|
+
* the integer part of the value in normal notation.
|
|
1875
|
+
*
|
|
1876
|
+
* sd {number} Significant digits: integer, 1 to MAX_DP inclusive.
|
|
1877
|
+
* rm? {number} Rounding mode: 0 (down), 1 (half-up), 2 (half-even) or 3 (up).
|
|
1878
|
+
*/
|
|
1879
|
+
|
|
1880
|
+
|
|
1881
|
+
P.toPrecision = function (sd, rm) {
|
|
1882
|
+
var x = this,
|
|
1883
|
+
Big = x.constructor,
|
|
1884
|
+
n = x.c[0];
|
|
1885
|
+
|
|
1886
|
+
if (sd !== UNDEFINED) {
|
|
1887
|
+
if (sd !== ~~sd || sd < 1 || sd > MAX_DP) {
|
|
1888
|
+
throw Error(INVALID + 'precision');
|
|
1889
|
+
}
|
|
1890
|
+
|
|
1891
|
+
x = round(new Big(x), sd, rm);
|
|
1892
|
+
|
|
1893
|
+
for (; x.c.length < sd;) x.c.push(0);
|
|
1894
|
+
}
|
|
1895
|
+
|
|
1896
|
+
return stringify(x, sd <= x.e || x.e <= Big.NE || x.e >= Big.PE, !!n);
|
|
1897
|
+
};
|
|
1898
|
+
/*
|
|
1899
|
+
* Return a string representing the value of this Big.
|
|
1900
|
+
* Return exponential notation if this Big has a positive exponent equal to or greater than
|
|
1901
|
+
* Big.PE, or a negative exponent equal to or less than Big.NE.
|
|
1902
|
+
* Include the sign for negative zero.
|
|
1903
|
+
*/
|
|
1904
|
+
|
|
1905
|
+
|
|
1906
|
+
P.valueOf = function () {
|
|
1907
|
+
var x = this,
|
|
1908
|
+
Big = x.constructor;
|
|
1909
|
+
|
|
1910
|
+
if (Big.strict === true) {
|
|
1911
|
+
throw Error(NAME + 'valueOf disallowed');
|
|
1912
|
+
}
|
|
1913
|
+
|
|
1914
|
+
return stringify(x, x.e <= Big.NE || x.e >= Big.PE, true);
|
|
1915
|
+
}; // Export
|
|
1916
|
+
|
|
1917
|
+
|
|
1918
|
+
var Big = _Big_(); /// <reference types="https://raw.githubusercontent.com/DefinitelyTyped/DefinitelyTyped/master/types/big.js/index.d.ts" />
|
|
1919
|
+
|
|
1920
|
+
var NumCvt = /*#__PURE__*/function () {
|
|
1921
|
+
function NumCvt() {
|
|
1922
|
+
_classCallCheck$1(this, NumCvt);
|
|
1923
|
+
}
|
|
1924
|
+
|
|
1925
|
+
_createClass$1(NumCvt, null, [{
|
|
1926
|
+
key: "show",
|
|
1927
|
+
value: function show(val, isPercentage) {
|
|
1928
|
+
if (val && isPercentage) return Big(val).times(100).valueOf();
|
|
1929
|
+
return String(val !== null && val !== void 0 ? val : '');
|
|
1930
|
+
}
|
|
1931
|
+
}, {
|
|
1932
|
+
key: "emit",
|
|
1933
|
+
value: function emit(val, isPercentage) {
|
|
1934
|
+
if (!val) return undefined;
|
|
1935
|
+
if (!isPercentage) return +val;
|
|
1936
|
+
return +Big(val).div(100);
|
|
1937
|
+
}
|
|
1938
|
+
}]);
|
|
1939
|
+
|
|
1940
|
+
return NumCvt;
|
|
1941
|
+
}();
|
|
1942
|
+
|
|
1943
|
+
function initState(props) {
|
|
1944
|
+
return {
|
|
1945
|
+
preProps: props,
|
|
1946
|
+
tempValue: NumCvt.show(props.value, props.isPercentage)
|
|
1947
|
+
};
|
|
1948
|
+
}
|
|
1949
|
+
|
|
1950
|
+
var Num = /*#__PURE__*/function (_PureComponent) {
|
|
1951
|
+
_inherits(Num, _PureComponent);
|
|
1952
|
+
|
|
1953
|
+
var _super = _createSuper(Num);
|
|
1954
|
+
|
|
1955
|
+
function Num() {
|
|
1956
|
+
var _this;
|
|
1957
|
+
|
|
1958
|
+
_classCallCheck$1(this, Num);
|
|
1959
|
+
|
|
1960
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
1961
|
+
args[_key] = arguments[_key];
|
|
1962
|
+
}
|
|
1963
|
+
|
|
1964
|
+
_this = _super.call.apply(_super, [this].concat(args));
|
|
1965
|
+
|
|
1966
|
+
_defineProperty$2(_assertThisInitialized(_this), "state", initState(_this.props));
|
|
1967
|
+
|
|
1968
|
+
_defineProperty$2(_assertThisInitialized(_this), "onChange", function (e) {
|
|
1969
|
+
var $value = e.target.value;
|
|
1970
|
+
var $val = $value.replace(/^(-?\d+(\.\d*)?|-?\d*).*$/, '$1');
|
|
1971
|
+
if ($val !== $value) e.target.value = $val;
|
|
1972
|
+
var value = NumCvt.emit($val, _this.props.isPercentage);
|
|
1973
|
+
|
|
1974
|
+
_this.setState(function (pre) {
|
|
1975
|
+
return _objectSpread2$2(_objectSpread2$2({}, pre), {}, {
|
|
1976
|
+
tempValue: e.target.value
|
|
1977
|
+
});
|
|
1978
|
+
}, function () {
|
|
1979
|
+
var _this$props$onChange, _this$props;
|
|
1980
|
+
|
|
1981
|
+
if (value !== _this.props.value) (_this$props$onChange = (_this$props = _this.props).onChange) === null || _this$props$onChange === void 0 ? void 0 : _this$props$onChange.call(_this$props, value);
|
|
1982
|
+
});
|
|
1983
|
+
});
|
|
1984
|
+
|
|
1985
|
+
return _this;
|
|
1986
|
+
}
|
|
1987
|
+
|
|
1988
|
+
_createClass$1(Num, [{
|
|
1989
|
+
key: "render",
|
|
1990
|
+
value: function render() {
|
|
1991
|
+
var _this$state$tempValue;
|
|
1992
|
+
|
|
1993
|
+
return /*#__PURE__*/React__default["default"].createElement("div", {
|
|
1994
|
+
className: classnames('param-number', {
|
|
1995
|
+
readonly: this.props.readonly
|
|
1996
|
+
}, this.props.className),
|
|
1997
|
+
style: this.props.style
|
|
1998
|
+
}, this.props.readonly ? /*#__PURE__*/React__default["default"].createElement("span", {
|
|
1999
|
+
className: "param-number-val"
|
|
2000
|
+
}, (_this$state$tempValue = this.state.tempValue) !== null && _this$state$tempValue !== void 0 ? _this$state$tempValue : '-') : /*#__PURE__*/React__default["default"].createElement("input", {
|
|
2001
|
+
className: "param-number-val",
|
|
2002
|
+
type: "text",
|
|
2003
|
+
placeholder: this.props.placeholder || 'Value',
|
|
2004
|
+
value: this.state.tempValue || '',
|
|
2005
|
+
onChange: this.onChange,
|
|
2006
|
+
onBlur: this.props.onBlur
|
|
2007
|
+
}), this.props.isPercentage && /*#__PURE__*/React__default["default"].createElement("span", {
|
|
2008
|
+
className: "param-number-suffix"
|
|
2009
|
+
}, "%"));
|
|
2010
|
+
}
|
|
2011
|
+
}], [{
|
|
2012
|
+
key: "getDerivedStateFromProps",
|
|
2013
|
+
value: function getDerivedStateFromProps(props, state) {
|
|
2014
|
+
if (props.value !== state.preProps.value && parseFloat(state.tempValue) !== props.value) {
|
|
2015
|
+
state.tempValue = NumCvt.show(props.value, props.isPercentage);
|
|
2016
|
+
}
|
|
2017
|
+
|
|
2018
|
+
return _objectSpread2$2(_objectSpread2$2({}, state), {}, {
|
|
2019
|
+
preProps: props
|
|
2020
|
+
});
|
|
2021
|
+
}
|
|
2022
|
+
}]);
|
|
2023
|
+
|
|
2024
|
+
return Num;
|
|
2025
|
+
}(React.PureComponent);
|
|
2026
|
+
|
|
2027
|
+
var NumRange = /*#__PURE__*/function (_PureComponent) {
|
|
2028
|
+
_inherits(NumRange, _PureComponent);
|
|
2029
|
+
|
|
2030
|
+
var _super = _createSuper(NumRange);
|
|
2031
|
+
|
|
2032
|
+
function NumRange() {
|
|
2033
|
+
var _this;
|
|
2034
|
+
|
|
2035
|
+
_classCallCheck$1(this, NumRange);
|
|
2036
|
+
|
|
2037
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
2038
|
+
args[_key] = arguments[_key];
|
|
2039
|
+
}
|
|
2040
|
+
|
|
2041
|
+
_this = _super.call.apply(_super, [this].concat(args));
|
|
2042
|
+
|
|
2043
|
+
_defineProperty$2(_assertThisInitialized(_this), "onChange", function (key, val) {
|
|
2044
|
+
var _this$props$onChange, _this$props;
|
|
2045
|
+
|
|
2046
|
+
var value = _objectSpread2$2({}, _this.props.value);
|
|
2047
|
+
|
|
2048
|
+
value[key] = val;
|
|
2049
|
+
(_this$props$onChange = (_this$props = _this.props).onChange) === null || _this$props$onChange === void 0 ? void 0 : _this$props$onChange.call(_this$props, value);
|
|
2050
|
+
});
|
|
2051
|
+
|
|
2052
|
+
return _this;
|
|
2053
|
+
}
|
|
2054
|
+
|
|
2055
|
+
_createClass$1(NumRange, [{
|
|
2056
|
+
key: "render",
|
|
2057
|
+
value: function render() {
|
|
2058
|
+
var _this$props$value, _this$props$value2;
|
|
2059
|
+
|
|
2060
|
+
return /*#__PURE__*/React__default["default"].createElement("div", {
|
|
2061
|
+
className: classnames('param-number-range', {
|
|
2062
|
+
readonly: this.props.readonly
|
|
2063
|
+
}, this.props.className),
|
|
2064
|
+
style: this.props.style
|
|
2065
|
+
}, /*#__PURE__*/React__default["default"].createElement("span", {
|
|
2066
|
+
className: "param-number-range-prefix"
|
|
2067
|
+
}, "Min"), /*#__PURE__*/React__default["default"].createElement(Num, {
|
|
2068
|
+
placeholder: 'Min',
|
|
2069
|
+
value: (_this$props$value = this.props.value) === null || _this$props$value === void 0 ? void 0 : _this$props$value.min,
|
|
2070
|
+
onChange: this.onChange.bind(null, 'min'),
|
|
2071
|
+
isPercentage: this.props.isPercentage,
|
|
2072
|
+
readonly: this.props.readonly,
|
|
2073
|
+
onBlur: this.props.onBlur
|
|
2074
|
+
}), /*#__PURE__*/React__default["default"].createElement("span", {
|
|
2075
|
+
className: "param-number-range-sep"
|
|
2076
|
+
}, this.props.readonly ? ',' : '-'), /*#__PURE__*/React__default["default"].createElement("span", {
|
|
2077
|
+
className: "param-number-range-prefix"
|
|
2078
|
+
}, "Max"), /*#__PURE__*/React__default["default"].createElement(Num, {
|
|
2079
|
+
placeholder: 'Max',
|
|
2080
|
+
value: (_this$props$value2 = this.props.value) === null || _this$props$value2 === void 0 ? void 0 : _this$props$value2.max,
|
|
2081
|
+
onChange: this.onChange.bind(null, 'max'),
|
|
2082
|
+
isPercentage: this.props.isPercentage,
|
|
2083
|
+
readonly: this.props.readonly,
|
|
2084
|
+
onBlur: this.props.onBlur
|
|
2085
|
+
}));
|
|
2086
|
+
}
|
|
2087
|
+
}]);
|
|
2088
|
+
|
|
2089
|
+
return NumRange;
|
|
2090
|
+
}(React.PureComponent);
|
|
2091
|
+
|
|
2092
|
+
function _arrayWithoutHoles(arr) {
|
|
2093
|
+
if (Array.isArray(arr)) return _arrayLikeToArray$1(arr);
|
|
2094
|
+
}
|
|
2095
|
+
|
|
2096
|
+
function _iterableToArray(iter) {
|
|
2097
|
+
if (typeof Symbol !== "undefined" && Symbol.iterator in Object(iter)) return Array.from(iter);
|
|
2098
|
+
}
|
|
2099
|
+
|
|
2100
|
+
function _nonIterableSpread() {
|
|
2101
|
+
throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
2102
|
+
}
|
|
2103
|
+
|
|
2104
|
+
function _toConsumableArray(arr) {
|
|
2105
|
+
return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray$1(arr) || _nonIterableSpread();
|
|
2106
|
+
}
|
|
2107
|
+
|
|
2108
|
+
var IconContext = /*#__PURE__*/React.createContext({});
|
|
2109
|
+
|
|
2110
|
+
function _defineProperty$1(obj, key, value) {
|
|
2111
|
+
if (key in obj) {
|
|
2112
|
+
Object.defineProperty(obj, key, {
|
|
2113
|
+
value: value,
|
|
2114
|
+
enumerable: true,
|
|
2115
|
+
configurable: true,
|
|
2116
|
+
writable: true
|
|
2117
|
+
});
|
|
2118
|
+
} else {
|
|
2119
|
+
obj[key] = value;
|
|
2120
|
+
}
|
|
2121
|
+
|
|
2122
|
+
return obj;
|
|
2123
|
+
}
|
|
2124
|
+
|
|
2125
|
+
function ownKeys$1(object, enumerableOnly) {
|
|
2126
|
+
var keys = Object.keys(object);
|
|
2127
|
+
|
|
2128
|
+
if (Object.getOwnPropertySymbols) {
|
|
2129
|
+
var symbols = Object.getOwnPropertySymbols(object);
|
|
2130
|
+
enumerableOnly && (symbols = symbols.filter(function (sym) {
|
|
2131
|
+
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
|
|
2132
|
+
})), keys.push.apply(keys, symbols);
|
|
2133
|
+
}
|
|
2134
|
+
|
|
2135
|
+
return keys;
|
|
2136
|
+
}
|
|
2137
|
+
|
|
2138
|
+
function _objectSpread2$1(target) {
|
|
2139
|
+
for (var i = 1; i < arguments.length; i++) {
|
|
2140
|
+
var source = null != arguments[i] ? arguments[i] : {};
|
|
2141
|
+
i % 2 ? ownKeys$1(Object(source), !0).forEach(function (key) {
|
|
2142
|
+
_defineProperty$1(target, key, source[key]);
|
|
2143
|
+
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$1(Object(source)).forEach(function (key) {
|
|
2144
|
+
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
2145
|
+
});
|
|
2146
|
+
}
|
|
2147
|
+
|
|
2148
|
+
return target;
|
|
2149
|
+
}
|
|
2150
|
+
|
|
2151
|
+
function _arrayWithHoles(arr) {
|
|
2152
|
+
if (Array.isArray(arr)) return arr;
|
|
2153
|
+
}
|
|
2154
|
+
|
|
2155
|
+
function _iterableToArrayLimit(arr, i) {
|
|
2156
|
+
var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
|
|
2157
|
+
|
|
2158
|
+
if (_i == null) return;
|
|
2159
|
+
var _arr = [];
|
|
2160
|
+
var _n = true;
|
|
2161
|
+
var _d = false;
|
|
2162
|
+
|
|
2163
|
+
var _s, _e;
|
|
2164
|
+
|
|
2165
|
+
try {
|
|
2166
|
+
for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) {
|
|
2167
|
+
_arr.push(_s.value);
|
|
2168
|
+
|
|
2169
|
+
if (i && _arr.length === i) break;
|
|
2170
|
+
}
|
|
2171
|
+
} catch (err) {
|
|
2172
|
+
_d = true;
|
|
2173
|
+
_e = err;
|
|
2174
|
+
} finally {
|
|
2175
|
+
try {
|
|
2176
|
+
if (!_n && _i["return"] != null) _i["return"]();
|
|
2177
|
+
} finally {
|
|
2178
|
+
if (_d) throw _e;
|
|
2179
|
+
}
|
|
2180
|
+
}
|
|
2181
|
+
|
|
2182
|
+
return _arr;
|
|
2183
|
+
}
|
|
2184
|
+
|
|
2185
|
+
function _arrayLikeToArray(arr, len) {
|
|
2186
|
+
if (len == null || len > arr.length) len = arr.length;
|
|
2187
|
+
|
|
2188
|
+
for (var i = 0, arr2 = new Array(len); i < len; i++) {
|
|
2189
|
+
arr2[i] = arr[i];
|
|
2190
|
+
}
|
|
2191
|
+
|
|
2192
|
+
return arr2;
|
|
2193
|
+
}
|
|
2194
|
+
|
|
2195
|
+
function _unsupportedIterableToArray(o, minLen) {
|
|
2196
|
+
if (!o) return;
|
|
2197
|
+
if (typeof o === "string") return _arrayLikeToArray(o, minLen);
|
|
2198
|
+
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
2199
|
+
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
2200
|
+
if (n === "Map" || n === "Set") return Array.from(o);
|
|
2201
|
+
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
|
|
2202
|
+
}
|
|
2203
|
+
|
|
2204
|
+
function _nonIterableRest() {
|
|
2205
|
+
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
2206
|
+
}
|
|
2207
|
+
|
|
2208
|
+
function _slicedToArray(arr, i) {
|
|
2209
|
+
return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();
|
|
2210
|
+
}
|
|
2211
|
+
|
|
2212
|
+
function _objectWithoutPropertiesLoose(source, excluded) {
|
|
2213
|
+
if (source == null) return {};
|
|
2214
|
+
var target = {};
|
|
2215
|
+
var sourceKeys = Object.keys(source);
|
|
2216
|
+
var key, i;
|
|
2217
|
+
|
|
2218
|
+
for (i = 0; i < sourceKeys.length; i++) {
|
|
2219
|
+
key = sourceKeys[i];
|
|
2220
|
+
if (excluded.indexOf(key) >= 0) continue;
|
|
2221
|
+
target[key] = source[key];
|
|
2222
|
+
}
|
|
2223
|
+
|
|
2224
|
+
return target;
|
|
2225
|
+
}
|
|
2226
|
+
|
|
2227
|
+
function _objectWithoutProperties(source, excluded) {
|
|
2228
|
+
if (source == null) return {};
|
|
2229
|
+
var target = _objectWithoutPropertiesLoose(source, excluded);
|
|
2230
|
+
var key, i;
|
|
2231
|
+
|
|
2232
|
+
if (Object.getOwnPropertySymbols) {
|
|
2233
|
+
var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
|
|
2234
|
+
|
|
2235
|
+
for (i = 0; i < sourceSymbolKeys.length; i++) {
|
|
2236
|
+
key = sourceSymbolKeys[i];
|
|
2237
|
+
if (excluded.indexOf(key) >= 0) continue;
|
|
2238
|
+
if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
|
|
2239
|
+
target[key] = source[key];
|
|
2240
|
+
}
|
|
2241
|
+
}
|
|
2242
|
+
|
|
2243
|
+
return target;
|
|
2244
|
+
}
|
|
2245
|
+
|
|
2246
|
+
function _typeof(obj) {
|
|
2247
|
+
"@babel/helpers - typeof";
|
|
2248
|
+
|
|
2249
|
+
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) {
|
|
2250
|
+
return typeof obj;
|
|
2251
|
+
} : function (obj) {
|
|
2252
|
+
return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
|
|
2253
|
+
}, _typeof(obj);
|
|
2254
|
+
}
|
|
2255
|
+
|
|
2256
|
+
/**
|
|
2257
|
+
* Take input from [0, n] and return it as [0, 1]
|
|
2258
|
+
* @hidden
|
|
2259
|
+
*/
|
|
2260
|
+
function bound01(n, max) {
|
|
2261
|
+
if (isOnePointZero(n)) {
|
|
2262
|
+
n = '100%';
|
|
2263
|
+
}
|
|
2264
|
+
|
|
2265
|
+
var isPercent = isPercentage(n);
|
|
2266
|
+
n = max === 360 ? n : Math.min(max, Math.max(0, parseFloat(n))); // Automatically convert percentage into number
|
|
2267
|
+
|
|
2268
|
+
if (isPercent) {
|
|
2269
|
+
n = parseInt(String(n * max), 10) / 100;
|
|
2270
|
+
} // Handle floating point rounding errors
|
|
2271
|
+
|
|
2272
|
+
|
|
2273
|
+
if (Math.abs(n - max) < 0.000001) {
|
|
2274
|
+
return 1;
|
|
2275
|
+
} // Convert into [0, 1] range if it isn't already
|
|
2276
|
+
|
|
2277
|
+
|
|
2278
|
+
if (max === 360) {
|
|
2279
|
+
// If n is a hue given in degrees,
|
|
2280
|
+
// wrap around out-of-range values into [0, 360] range
|
|
2281
|
+
// then convert into [0, 1].
|
|
2282
|
+
n = (n < 0 ? n % max + max : n % max) / parseFloat(String(max));
|
|
2283
|
+
} else {
|
|
2284
|
+
// If n not a hue given in degrees
|
|
2285
|
+
// Convert into [0, 1] range if it isn't already.
|
|
2286
|
+
n = n % max / parseFloat(String(max));
|
|
2287
|
+
}
|
|
2288
|
+
|
|
2289
|
+
return n;
|
|
2290
|
+
}
|
|
2291
|
+
/**
|
|
2292
|
+
* Need to handle 1.0 as 100%, since once it is a number, there is no difference between it and 1
|
|
2293
|
+
* <http://stackoverflow.com/questions/7422072/javascript-how-to-detect-number-as-a-decimal-including-1-0>
|
|
2294
|
+
* @hidden
|
|
2295
|
+
*/
|
|
2296
|
+
|
|
2297
|
+
function isOnePointZero(n) {
|
|
2298
|
+
return typeof n === 'string' && n.indexOf('.') !== -1 && parseFloat(n) === 1;
|
|
2299
|
+
}
|
|
2300
|
+
/**
|
|
2301
|
+
* Check to see if string passed in is a percentage
|
|
2302
|
+
* @hidden
|
|
2303
|
+
*/
|
|
2304
|
+
|
|
2305
|
+
function isPercentage(n) {
|
|
2306
|
+
return typeof n === 'string' && n.indexOf('%') !== -1;
|
|
2307
|
+
}
|
|
2308
|
+
/**
|
|
2309
|
+
* Return a valid alpha value [0,1] with all invalid values being set to 1
|
|
2310
|
+
* @hidden
|
|
2311
|
+
*/
|
|
2312
|
+
|
|
2313
|
+
function boundAlpha(a) {
|
|
2314
|
+
a = parseFloat(a);
|
|
2315
|
+
|
|
2316
|
+
if (isNaN(a) || a < 0 || a > 1) {
|
|
2317
|
+
a = 1;
|
|
2318
|
+
}
|
|
2319
|
+
|
|
2320
|
+
return a;
|
|
2321
|
+
}
|
|
2322
|
+
/**
|
|
2323
|
+
* Replace a decimal with it's percentage value
|
|
2324
|
+
* @hidden
|
|
2325
|
+
*/
|
|
2326
|
+
|
|
2327
|
+
function convertToPercentage(n) {
|
|
2328
|
+
if (n <= 1) {
|
|
2329
|
+
return Number(n) * 100 + "%";
|
|
2330
|
+
}
|
|
2331
|
+
|
|
2332
|
+
return n;
|
|
2333
|
+
}
|
|
2334
|
+
/**
|
|
2335
|
+
* Force a hex value to have 2 characters
|
|
2336
|
+
* @hidden
|
|
2337
|
+
*/
|
|
2338
|
+
|
|
2339
|
+
function pad2(c) {
|
|
2340
|
+
return c.length === 1 ? '0' + c : String(c);
|
|
2341
|
+
}
|
|
2342
|
+
|
|
2343
|
+
// <http://mjijackson.com/2008/02/rgb-to-hsl-and-rgb-to-hsv-color-model-conversion-algorithms-in-javascript>
|
|
2344
|
+
|
|
2345
|
+
/**
|
|
2346
|
+
* Handle bounds / percentage checking to conform to CSS color spec
|
|
2347
|
+
* <http://www.w3.org/TR/css3-color/>
|
|
2348
|
+
* *Assumes:* r, g, b in [0, 255] or [0, 1]
|
|
2349
|
+
* *Returns:* { r, g, b } in [0, 255]
|
|
2350
|
+
*/
|
|
2351
|
+
|
|
2352
|
+
function rgbToRgb(r, g, b) {
|
|
2353
|
+
return {
|
|
2354
|
+
r: bound01(r, 255) * 255,
|
|
2355
|
+
g: bound01(g, 255) * 255,
|
|
2356
|
+
b: bound01(b, 255) * 255
|
|
2357
|
+
};
|
|
2358
|
+
}
|
|
2359
|
+
|
|
2360
|
+
function hue2rgb(p, q, t) {
|
|
2361
|
+
if (t < 0) {
|
|
2362
|
+
t += 1;
|
|
2363
|
+
}
|
|
2364
|
+
|
|
2365
|
+
if (t > 1) {
|
|
2366
|
+
t -= 1;
|
|
2367
|
+
}
|
|
2368
|
+
|
|
2369
|
+
if (t < 1 / 6) {
|
|
2370
|
+
return p + (q - p) * (6 * t);
|
|
2371
|
+
}
|
|
2372
|
+
|
|
2373
|
+
if (t < 1 / 2) {
|
|
2374
|
+
return q;
|
|
2375
|
+
}
|
|
2376
|
+
|
|
2377
|
+
if (t < 2 / 3) {
|
|
2378
|
+
return p + (q - p) * (2 / 3 - t) * 6;
|
|
2379
|
+
}
|
|
2380
|
+
|
|
2381
|
+
return p;
|
|
2382
|
+
}
|
|
2383
|
+
/**
|
|
2384
|
+
* Converts an HSL color value to RGB.
|
|
2385
|
+
*
|
|
2386
|
+
* *Assumes:* h is contained in [0, 1] or [0, 360] and s and l are contained [0, 1] or [0, 100]
|
|
2387
|
+
* *Returns:* { r, g, b } in the set [0, 255]
|
|
2388
|
+
*/
|
|
2389
|
+
|
|
2390
|
+
|
|
2391
|
+
function hslToRgb(h, s, l) {
|
|
2392
|
+
var r;
|
|
2393
|
+
var g;
|
|
2394
|
+
var b;
|
|
2395
|
+
h = bound01(h, 360);
|
|
2396
|
+
s = bound01(s, 100);
|
|
2397
|
+
l = bound01(l, 100);
|
|
2398
|
+
|
|
2399
|
+
if (s === 0) {
|
|
2400
|
+
// achromatic
|
|
2401
|
+
g = l;
|
|
2402
|
+
b = l;
|
|
2403
|
+
r = l;
|
|
2404
|
+
} else {
|
|
2405
|
+
var q = l < 0.5 ? l * (1 + s) : l + s - l * s;
|
|
2406
|
+
var p = 2 * l - q;
|
|
2407
|
+
r = hue2rgb(p, q, h + 1 / 3);
|
|
2408
|
+
g = hue2rgb(p, q, h);
|
|
2409
|
+
b = hue2rgb(p, q, h - 1 / 3);
|
|
2410
|
+
}
|
|
2411
|
+
|
|
2412
|
+
return {
|
|
2413
|
+
r: r * 255,
|
|
2414
|
+
g: g * 255,
|
|
2415
|
+
b: b * 255
|
|
2416
|
+
};
|
|
2417
|
+
}
|
|
2418
|
+
/**
|
|
2419
|
+
* Converts an RGB color value to HSV
|
|
2420
|
+
*
|
|
2421
|
+
* *Assumes:* r, g, and b are contained in the set [0, 255] or [0, 1]
|
|
2422
|
+
* *Returns:* { h, s, v } in [0,1]
|
|
2423
|
+
*/
|
|
2424
|
+
|
|
2425
|
+
function rgbToHsv(r, g, b) {
|
|
2426
|
+
r = bound01(r, 255);
|
|
2427
|
+
g = bound01(g, 255);
|
|
2428
|
+
b = bound01(b, 255);
|
|
2429
|
+
var max = Math.max(r, g, b);
|
|
2430
|
+
var min = Math.min(r, g, b);
|
|
2431
|
+
var h = 0;
|
|
2432
|
+
var v = max;
|
|
2433
|
+
var d = max - min;
|
|
2434
|
+
var s = max === 0 ? 0 : d / max;
|
|
2435
|
+
|
|
2436
|
+
if (max === min) {
|
|
2437
|
+
h = 0; // achromatic
|
|
2438
|
+
} else {
|
|
2439
|
+
switch (max) {
|
|
2440
|
+
case r:
|
|
2441
|
+
h = (g - b) / d + (g < b ? 6 : 0);
|
|
2442
|
+
break;
|
|
2443
|
+
|
|
2444
|
+
case g:
|
|
2445
|
+
h = (b - r) / d + 2;
|
|
2446
|
+
break;
|
|
2447
|
+
|
|
2448
|
+
case b:
|
|
2449
|
+
h = (r - g) / d + 4;
|
|
2450
|
+
break;
|
|
2451
|
+
}
|
|
2452
|
+
|
|
2453
|
+
h /= 6;
|
|
2454
|
+
}
|
|
2455
|
+
|
|
2456
|
+
return {
|
|
2457
|
+
h: h,
|
|
2458
|
+
s: s,
|
|
2459
|
+
v: v
|
|
2460
|
+
};
|
|
2461
|
+
}
|
|
2462
|
+
/**
|
|
2463
|
+
* Converts an HSV color value to RGB.
|
|
2464
|
+
*
|
|
2465
|
+
* *Assumes:* h is contained in [0, 1] or [0, 360] and s and v are contained in [0, 1] or [0, 100]
|
|
2466
|
+
* *Returns:* { r, g, b } in the set [0, 255]
|
|
2467
|
+
*/
|
|
2468
|
+
|
|
2469
|
+
function hsvToRgb(h, s, v) {
|
|
2470
|
+
h = bound01(h, 360) * 6;
|
|
2471
|
+
s = bound01(s, 100);
|
|
2472
|
+
v = bound01(v, 100);
|
|
2473
|
+
var i = Math.floor(h);
|
|
2474
|
+
var f = h - i;
|
|
2475
|
+
var p = v * (1 - s);
|
|
2476
|
+
var q = v * (1 - f * s);
|
|
2477
|
+
var t = v * (1 - (1 - f) * s);
|
|
2478
|
+
var mod = i % 6;
|
|
2479
|
+
var r = [v, q, p, p, t, v][mod];
|
|
2480
|
+
var g = [t, v, v, q, p, p][mod];
|
|
2481
|
+
var b = [p, p, t, v, v, q][mod];
|
|
2482
|
+
return {
|
|
2483
|
+
r: r * 255,
|
|
2484
|
+
g: g * 255,
|
|
2485
|
+
b: b * 255
|
|
2486
|
+
};
|
|
2487
|
+
}
|
|
2488
|
+
/**
|
|
2489
|
+
* Converts an RGB color to hex
|
|
2490
|
+
*
|
|
2491
|
+
* Assumes r, g, and b are contained in the set [0, 255]
|
|
2492
|
+
* Returns a 3 or 6 character hex
|
|
2493
|
+
*/
|
|
2494
|
+
|
|
2495
|
+
function rgbToHex(r, g, b, allow3Char) {
|
|
2496
|
+
var hex = [pad2(Math.round(r).toString(16)), pad2(Math.round(g).toString(16)), pad2(Math.round(b).toString(16))]; // Return a 3 character hex if possible
|
|
2497
|
+
|
|
2498
|
+
if (allow3Char && hex[0].startsWith(hex[0].charAt(1)) && hex[1].startsWith(hex[1].charAt(1)) && hex[2].startsWith(hex[2].charAt(1))) {
|
|
2499
|
+
return hex[0].charAt(0) + hex[1].charAt(0) + hex[2].charAt(0);
|
|
2500
|
+
}
|
|
2501
|
+
|
|
2502
|
+
return hex.join('');
|
|
2503
|
+
}
|
|
2504
|
+
/** Converts a hex value to a decimal */
|
|
2505
|
+
|
|
2506
|
+
function convertHexToDecimal(h) {
|
|
2507
|
+
return parseIntFromHex(h) / 255;
|
|
2508
|
+
}
|
|
2509
|
+
/** Parse a base-16 hex value into a base-10 integer */
|
|
2510
|
+
|
|
2511
|
+
function parseIntFromHex(val) {
|
|
2512
|
+
return parseInt(val, 16);
|
|
2513
|
+
}
|
|
2514
|
+
|
|
2515
|
+
// https://github.com/bahamas10/css-color-names/blob/master/css-color-names.json
|
|
2516
|
+
|
|
2517
|
+
/**
|
|
2518
|
+
* @hidden
|
|
2519
|
+
*/
|
|
2520
|
+
var names = {
|
|
2521
|
+
aliceblue: '#f0f8ff',
|
|
2522
|
+
antiquewhite: '#faebd7',
|
|
2523
|
+
aqua: '#00ffff',
|
|
2524
|
+
aquamarine: '#7fffd4',
|
|
2525
|
+
azure: '#f0ffff',
|
|
2526
|
+
beige: '#f5f5dc',
|
|
2527
|
+
bisque: '#ffe4c4',
|
|
2528
|
+
black: '#000000',
|
|
2529
|
+
blanchedalmond: '#ffebcd',
|
|
2530
|
+
blue: '#0000ff',
|
|
2531
|
+
blueviolet: '#8a2be2',
|
|
2532
|
+
brown: '#a52a2a',
|
|
2533
|
+
burlywood: '#deb887',
|
|
2534
|
+
cadetblue: '#5f9ea0',
|
|
2535
|
+
chartreuse: '#7fff00',
|
|
2536
|
+
chocolate: '#d2691e',
|
|
2537
|
+
coral: '#ff7f50',
|
|
2538
|
+
cornflowerblue: '#6495ed',
|
|
2539
|
+
cornsilk: '#fff8dc',
|
|
2540
|
+
crimson: '#dc143c',
|
|
2541
|
+
cyan: '#00ffff',
|
|
2542
|
+
darkblue: '#00008b',
|
|
2543
|
+
darkcyan: '#008b8b',
|
|
2544
|
+
darkgoldenrod: '#b8860b',
|
|
2545
|
+
darkgray: '#a9a9a9',
|
|
2546
|
+
darkgreen: '#006400',
|
|
2547
|
+
darkgrey: '#a9a9a9',
|
|
2548
|
+
darkkhaki: '#bdb76b',
|
|
2549
|
+
darkmagenta: '#8b008b',
|
|
2550
|
+
darkolivegreen: '#556b2f',
|
|
2551
|
+
darkorange: '#ff8c00',
|
|
2552
|
+
darkorchid: '#9932cc',
|
|
2553
|
+
darkred: '#8b0000',
|
|
2554
|
+
darksalmon: '#e9967a',
|
|
2555
|
+
darkseagreen: '#8fbc8f',
|
|
2556
|
+
darkslateblue: '#483d8b',
|
|
2557
|
+
darkslategray: '#2f4f4f',
|
|
2558
|
+
darkslategrey: '#2f4f4f',
|
|
2559
|
+
darkturquoise: '#00ced1',
|
|
2560
|
+
darkviolet: '#9400d3',
|
|
2561
|
+
deeppink: '#ff1493',
|
|
2562
|
+
deepskyblue: '#00bfff',
|
|
2563
|
+
dimgray: '#696969',
|
|
2564
|
+
dimgrey: '#696969',
|
|
2565
|
+
dodgerblue: '#1e90ff',
|
|
2566
|
+
firebrick: '#b22222',
|
|
2567
|
+
floralwhite: '#fffaf0',
|
|
2568
|
+
forestgreen: '#228b22',
|
|
2569
|
+
fuchsia: '#ff00ff',
|
|
2570
|
+
gainsboro: '#dcdcdc',
|
|
2571
|
+
ghostwhite: '#f8f8ff',
|
|
2572
|
+
goldenrod: '#daa520',
|
|
2573
|
+
gold: '#ffd700',
|
|
2574
|
+
gray: '#808080',
|
|
2575
|
+
green: '#008000',
|
|
2576
|
+
greenyellow: '#adff2f',
|
|
2577
|
+
grey: '#808080',
|
|
2578
|
+
honeydew: '#f0fff0',
|
|
2579
|
+
hotpink: '#ff69b4',
|
|
2580
|
+
indianred: '#cd5c5c',
|
|
2581
|
+
indigo: '#4b0082',
|
|
2582
|
+
ivory: '#fffff0',
|
|
2583
|
+
khaki: '#f0e68c',
|
|
2584
|
+
lavenderblush: '#fff0f5',
|
|
2585
|
+
lavender: '#e6e6fa',
|
|
2586
|
+
lawngreen: '#7cfc00',
|
|
2587
|
+
lemonchiffon: '#fffacd',
|
|
2588
|
+
lightblue: '#add8e6',
|
|
2589
|
+
lightcoral: '#f08080',
|
|
2590
|
+
lightcyan: '#e0ffff',
|
|
2591
|
+
lightgoldenrodyellow: '#fafad2',
|
|
2592
|
+
lightgray: '#d3d3d3',
|
|
2593
|
+
lightgreen: '#90ee90',
|
|
2594
|
+
lightgrey: '#d3d3d3',
|
|
2595
|
+
lightpink: '#ffb6c1',
|
|
2596
|
+
lightsalmon: '#ffa07a',
|
|
2597
|
+
lightseagreen: '#20b2aa',
|
|
2598
|
+
lightskyblue: '#87cefa',
|
|
2599
|
+
lightslategray: '#778899',
|
|
2600
|
+
lightslategrey: '#778899',
|
|
2601
|
+
lightsteelblue: '#b0c4de',
|
|
2602
|
+
lightyellow: '#ffffe0',
|
|
2603
|
+
lime: '#00ff00',
|
|
2604
|
+
limegreen: '#32cd32',
|
|
2605
|
+
linen: '#faf0e6',
|
|
2606
|
+
magenta: '#ff00ff',
|
|
2607
|
+
maroon: '#800000',
|
|
2608
|
+
mediumaquamarine: '#66cdaa',
|
|
2609
|
+
mediumblue: '#0000cd',
|
|
2610
|
+
mediumorchid: '#ba55d3',
|
|
2611
|
+
mediumpurple: '#9370db',
|
|
2612
|
+
mediumseagreen: '#3cb371',
|
|
2613
|
+
mediumslateblue: '#7b68ee',
|
|
2614
|
+
mediumspringgreen: '#00fa9a',
|
|
2615
|
+
mediumturquoise: '#48d1cc',
|
|
2616
|
+
mediumvioletred: '#c71585',
|
|
2617
|
+
midnightblue: '#191970',
|
|
2618
|
+
mintcream: '#f5fffa',
|
|
2619
|
+
mistyrose: '#ffe4e1',
|
|
2620
|
+
moccasin: '#ffe4b5',
|
|
2621
|
+
navajowhite: '#ffdead',
|
|
2622
|
+
navy: '#000080',
|
|
2623
|
+
oldlace: '#fdf5e6',
|
|
2624
|
+
olive: '#808000',
|
|
2625
|
+
olivedrab: '#6b8e23',
|
|
2626
|
+
orange: '#ffa500',
|
|
2627
|
+
orangered: '#ff4500',
|
|
2628
|
+
orchid: '#da70d6',
|
|
2629
|
+
palegoldenrod: '#eee8aa',
|
|
2630
|
+
palegreen: '#98fb98',
|
|
2631
|
+
paleturquoise: '#afeeee',
|
|
2632
|
+
palevioletred: '#db7093',
|
|
2633
|
+
papayawhip: '#ffefd5',
|
|
2634
|
+
peachpuff: '#ffdab9',
|
|
2635
|
+
peru: '#cd853f',
|
|
2636
|
+
pink: '#ffc0cb',
|
|
2637
|
+
plum: '#dda0dd',
|
|
2638
|
+
powderblue: '#b0e0e6',
|
|
2639
|
+
purple: '#800080',
|
|
2640
|
+
rebeccapurple: '#663399',
|
|
2641
|
+
red: '#ff0000',
|
|
2642
|
+
rosybrown: '#bc8f8f',
|
|
2643
|
+
royalblue: '#4169e1',
|
|
2644
|
+
saddlebrown: '#8b4513',
|
|
2645
|
+
salmon: '#fa8072',
|
|
2646
|
+
sandybrown: '#f4a460',
|
|
2647
|
+
seagreen: '#2e8b57',
|
|
2648
|
+
seashell: '#fff5ee',
|
|
2649
|
+
sienna: '#a0522d',
|
|
2650
|
+
silver: '#c0c0c0',
|
|
2651
|
+
skyblue: '#87ceeb',
|
|
2652
|
+
slateblue: '#6a5acd',
|
|
2653
|
+
slategray: '#708090',
|
|
2654
|
+
slategrey: '#708090',
|
|
2655
|
+
snow: '#fffafa',
|
|
2656
|
+
springgreen: '#00ff7f',
|
|
2657
|
+
steelblue: '#4682b4',
|
|
2658
|
+
tan: '#d2b48c',
|
|
2659
|
+
teal: '#008080',
|
|
2660
|
+
thistle: '#d8bfd8',
|
|
2661
|
+
tomato: '#ff6347',
|
|
2662
|
+
turquoise: '#40e0d0',
|
|
2663
|
+
violet: '#ee82ee',
|
|
2664
|
+
wheat: '#f5deb3',
|
|
2665
|
+
white: '#ffffff',
|
|
2666
|
+
whitesmoke: '#f5f5f5',
|
|
2667
|
+
yellow: '#ffff00',
|
|
2668
|
+
yellowgreen: '#9acd32'
|
|
2669
|
+
};
|
|
2670
|
+
|
|
2671
|
+
/**
|
|
2672
|
+
* Given a string or object, convert that input to RGB
|
|
2673
|
+
*
|
|
2674
|
+
* Possible string inputs:
|
|
2675
|
+
* ```
|
|
2676
|
+
* "red"
|
|
2677
|
+
* "#f00" or "f00"
|
|
2678
|
+
* "#ff0000" or "ff0000"
|
|
2679
|
+
* "#ff000000" or "ff000000"
|
|
2680
|
+
* "rgb 255 0 0" or "rgb (255, 0, 0)"
|
|
2681
|
+
* "rgb 1.0 0 0" or "rgb (1, 0, 0)"
|
|
2682
|
+
* "rgba (255, 0, 0, 1)" or "rgba 255, 0, 0, 1"
|
|
2683
|
+
* "rgba (1.0, 0, 0, 1)" or "rgba 1.0, 0, 0, 1"
|
|
2684
|
+
* "hsl(0, 100%, 50%)" or "hsl 0 100% 50%"
|
|
2685
|
+
* "hsla(0, 100%, 50%, 1)" or "hsla 0 100% 50%, 1"
|
|
2686
|
+
* "hsv(0, 100%, 100%)" or "hsv 0 100% 100%"
|
|
2687
|
+
* ```
|
|
2688
|
+
*/
|
|
2689
|
+
|
|
2690
|
+
function inputToRGB(color) {
|
|
2691
|
+
var rgb = {
|
|
2692
|
+
r: 0,
|
|
2693
|
+
g: 0,
|
|
2694
|
+
b: 0
|
|
2695
|
+
};
|
|
2696
|
+
var a = 1;
|
|
2697
|
+
var s = null;
|
|
2698
|
+
var v = null;
|
|
2699
|
+
var l = null;
|
|
2700
|
+
var ok = false;
|
|
2701
|
+
var format = false;
|
|
2702
|
+
|
|
2703
|
+
if (typeof color === 'string') {
|
|
2704
|
+
color = stringInputToObject(color);
|
|
2705
|
+
}
|
|
2706
|
+
|
|
2707
|
+
if (typeof color === 'object') {
|
|
2708
|
+
if (isValidCSSUnit(color.r) && isValidCSSUnit(color.g) && isValidCSSUnit(color.b)) {
|
|
2709
|
+
rgb = rgbToRgb(color.r, color.g, color.b);
|
|
2710
|
+
ok = true;
|
|
2711
|
+
format = String(color.r).substr(-1) === '%' ? 'prgb' : 'rgb';
|
|
2712
|
+
} else if (isValidCSSUnit(color.h) && isValidCSSUnit(color.s) && isValidCSSUnit(color.v)) {
|
|
2713
|
+
s = convertToPercentage(color.s);
|
|
2714
|
+
v = convertToPercentage(color.v);
|
|
2715
|
+
rgb = hsvToRgb(color.h, s, v);
|
|
2716
|
+
ok = true;
|
|
2717
|
+
format = 'hsv';
|
|
2718
|
+
} else if (isValidCSSUnit(color.h) && isValidCSSUnit(color.s) && isValidCSSUnit(color.l)) {
|
|
2719
|
+
s = convertToPercentage(color.s);
|
|
2720
|
+
l = convertToPercentage(color.l);
|
|
2721
|
+
rgb = hslToRgb(color.h, s, l);
|
|
2722
|
+
ok = true;
|
|
2723
|
+
format = 'hsl';
|
|
2724
|
+
}
|
|
2725
|
+
|
|
2726
|
+
if (Object.prototype.hasOwnProperty.call(color, 'a')) {
|
|
2727
|
+
a = color.a;
|
|
2728
|
+
}
|
|
2729
|
+
}
|
|
2730
|
+
|
|
2731
|
+
a = boundAlpha(a);
|
|
2732
|
+
return {
|
|
2733
|
+
ok: ok,
|
|
2734
|
+
format: color.format || format,
|
|
2735
|
+
r: Math.min(255, Math.max(rgb.r, 0)),
|
|
2736
|
+
g: Math.min(255, Math.max(rgb.g, 0)),
|
|
2737
|
+
b: Math.min(255, Math.max(rgb.b, 0)),
|
|
2738
|
+
a: a
|
|
2739
|
+
};
|
|
2740
|
+
} // <http://www.w3.org/TR/css3-values/#integers>
|
|
2741
|
+
|
|
2742
|
+
var CSS_INTEGER = '[-\\+]?\\d+%?'; // <http://www.w3.org/TR/css3-values/#number-value>
|
|
2743
|
+
|
|
2744
|
+
var CSS_NUMBER = '[-\\+]?\\d*\\.\\d+%?'; // Allow positive/negative integer/number. Don't capture the either/or, just the entire outcome.
|
|
2745
|
+
|
|
2746
|
+
var CSS_UNIT = "(?:" + CSS_NUMBER + ")|(?:" + CSS_INTEGER + ")"; // Actual matching.
|
|
2747
|
+
// Parentheses and commas are optional, but not required.
|
|
2748
|
+
// Whitespace can take the place of commas or opening paren
|
|
2749
|
+
|
|
2750
|
+
var PERMISSIVE_MATCH3 = "[\\s|\\(]+(" + CSS_UNIT + ")[,|\\s]+(" + CSS_UNIT + ")[,|\\s]+(" + CSS_UNIT + ")\\s*\\)?";
|
|
2751
|
+
var PERMISSIVE_MATCH4 = "[\\s|\\(]+(" + CSS_UNIT + ")[,|\\s]+(" + CSS_UNIT + ")[,|\\s]+(" + CSS_UNIT + ")[,|\\s]+(" + CSS_UNIT + ")\\s*\\)?";
|
|
2752
|
+
var matchers = {
|
|
2753
|
+
CSS_UNIT: new RegExp(CSS_UNIT),
|
|
2754
|
+
rgb: new RegExp('rgb' + PERMISSIVE_MATCH3),
|
|
2755
|
+
rgba: new RegExp('rgba' + PERMISSIVE_MATCH4),
|
|
2756
|
+
hsl: new RegExp('hsl' + PERMISSIVE_MATCH3),
|
|
2757
|
+
hsla: new RegExp('hsla' + PERMISSIVE_MATCH4),
|
|
2758
|
+
hsv: new RegExp('hsv' + PERMISSIVE_MATCH3),
|
|
2759
|
+
hsva: new RegExp('hsva' + PERMISSIVE_MATCH4),
|
|
2760
|
+
hex3: /^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,
|
|
2761
|
+
hex6: /^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,
|
|
2762
|
+
hex4: /^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,
|
|
2763
|
+
hex8: /^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/
|
|
2764
|
+
};
|
|
2765
|
+
/**
|
|
2766
|
+
* Permissive string parsing. Take in a number of formats, and output an object
|
|
2767
|
+
* based on detected format. Returns `{ r, g, b }` or `{ h, s, l }` or `{ h, s, v}`
|
|
2768
|
+
*/
|
|
2769
|
+
|
|
2770
|
+
function stringInputToObject(color) {
|
|
2771
|
+
color = color.trim().toLowerCase();
|
|
2772
|
+
|
|
2773
|
+
if (color.length === 0) {
|
|
2774
|
+
return false;
|
|
2775
|
+
}
|
|
2776
|
+
|
|
2777
|
+
var named = false;
|
|
2778
|
+
|
|
2779
|
+
if (names[color]) {
|
|
2780
|
+
color = names[color];
|
|
2781
|
+
named = true;
|
|
2782
|
+
} else if (color === 'transparent') {
|
|
2783
|
+
return {
|
|
2784
|
+
r: 0,
|
|
2785
|
+
g: 0,
|
|
2786
|
+
b: 0,
|
|
2787
|
+
a: 0,
|
|
2788
|
+
format: 'name'
|
|
2789
|
+
};
|
|
2790
|
+
} // Try to match string input using regular expressions.
|
|
2791
|
+
// Keep most of the number bounding out of this function - don't worry about [0,1] or [0,100] or [0,360]
|
|
2792
|
+
// Just return an object and let the conversion functions handle that.
|
|
2793
|
+
// This way the result will be the same whether the tinycolor is initialized with string or object.
|
|
2794
|
+
|
|
2795
|
+
|
|
2796
|
+
var match = matchers.rgb.exec(color);
|
|
2797
|
+
|
|
2798
|
+
if (match) {
|
|
2799
|
+
return {
|
|
2800
|
+
r: match[1],
|
|
2801
|
+
g: match[2],
|
|
2802
|
+
b: match[3]
|
|
2803
|
+
};
|
|
2804
|
+
}
|
|
2805
|
+
|
|
2806
|
+
match = matchers.rgba.exec(color);
|
|
2807
|
+
|
|
2808
|
+
if (match) {
|
|
2809
|
+
return {
|
|
2810
|
+
r: match[1],
|
|
2811
|
+
g: match[2],
|
|
2812
|
+
b: match[3],
|
|
2813
|
+
a: match[4]
|
|
2814
|
+
};
|
|
2815
|
+
}
|
|
2816
|
+
|
|
2817
|
+
match = matchers.hsl.exec(color);
|
|
2818
|
+
|
|
2819
|
+
if (match) {
|
|
2820
|
+
return {
|
|
2821
|
+
h: match[1],
|
|
2822
|
+
s: match[2],
|
|
2823
|
+
l: match[3]
|
|
2824
|
+
};
|
|
2825
|
+
}
|
|
2826
|
+
|
|
2827
|
+
match = matchers.hsla.exec(color);
|
|
2828
|
+
|
|
2829
|
+
if (match) {
|
|
2830
|
+
return {
|
|
2831
|
+
h: match[1],
|
|
2832
|
+
s: match[2],
|
|
2833
|
+
l: match[3],
|
|
2834
|
+
a: match[4]
|
|
2835
|
+
};
|
|
2836
|
+
}
|
|
2837
|
+
|
|
2838
|
+
match = matchers.hsv.exec(color);
|
|
2839
|
+
|
|
2840
|
+
if (match) {
|
|
2841
|
+
return {
|
|
2842
|
+
h: match[1],
|
|
2843
|
+
s: match[2],
|
|
2844
|
+
v: match[3]
|
|
2845
|
+
};
|
|
2846
|
+
}
|
|
2847
|
+
|
|
2848
|
+
match = matchers.hsva.exec(color);
|
|
2849
|
+
|
|
2850
|
+
if (match) {
|
|
2851
|
+
return {
|
|
2852
|
+
h: match[1],
|
|
2853
|
+
s: match[2],
|
|
2854
|
+
v: match[3],
|
|
2855
|
+
a: match[4]
|
|
2856
|
+
};
|
|
2857
|
+
}
|
|
2858
|
+
|
|
2859
|
+
match = matchers.hex8.exec(color);
|
|
2860
|
+
|
|
2861
|
+
if (match) {
|
|
2862
|
+
return {
|
|
2863
|
+
r: parseIntFromHex(match[1]),
|
|
2864
|
+
g: parseIntFromHex(match[2]),
|
|
2865
|
+
b: parseIntFromHex(match[3]),
|
|
2866
|
+
a: convertHexToDecimal(match[4]),
|
|
2867
|
+
format: named ? 'name' : 'hex8'
|
|
2868
|
+
};
|
|
2869
|
+
}
|
|
2870
|
+
|
|
2871
|
+
match = matchers.hex6.exec(color);
|
|
2872
|
+
|
|
2873
|
+
if (match) {
|
|
2874
|
+
return {
|
|
2875
|
+
r: parseIntFromHex(match[1]),
|
|
2876
|
+
g: parseIntFromHex(match[2]),
|
|
2877
|
+
b: parseIntFromHex(match[3]),
|
|
2878
|
+
format: named ? 'name' : 'hex'
|
|
2879
|
+
};
|
|
2880
|
+
}
|
|
2881
|
+
|
|
2882
|
+
match = matchers.hex4.exec(color);
|
|
2883
|
+
|
|
2884
|
+
if (match) {
|
|
2885
|
+
return {
|
|
2886
|
+
r: parseIntFromHex(match[1] + match[1]),
|
|
2887
|
+
g: parseIntFromHex(match[2] + match[2]),
|
|
2888
|
+
b: parseIntFromHex(match[3] + match[3]),
|
|
2889
|
+
a: convertHexToDecimal(match[4] + match[4]),
|
|
2890
|
+
format: named ? 'name' : 'hex8'
|
|
2891
|
+
};
|
|
2892
|
+
}
|
|
2893
|
+
|
|
2894
|
+
match = matchers.hex3.exec(color);
|
|
2895
|
+
|
|
2896
|
+
if (match) {
|
|
2897
|
+
return {
|
|
2898
|
+
r: parseIntFromHex(match[1] + match[1]),
|
|
2899
|
+
g: parseIntFromHex(match[2] + match[2]),
|
|
2900
|
+
b: parseIntFromHex(match[3] + match[3]),
|
|
2901
|
+
format: named ? 'name' : 'hex'
|
|
2902
|
+
};
|
|
2903
|
+
}
|
|
2904
|
+
|
|
2905
|
+
return false;
|
|
2906
|
+
}
|
|
2907
|
+
/**
|
|
2908
|
+
* Check to see if it looks like a CSS unit
|
|
2909
|
+
* (see `matchers` above for definition).
|
|
2910
|
+
*/
|
|
2911
|
+
|
|
2912
|
+
function isValidCSSUnit(color) {
|
|
2913
|
+
return Boolean(matchers.CSS_UNIT.exec(String(color)));
|
|
2914
|
+
}
|
|
2915
|
+
|
|
2916
|
+
var hueStep = 2; // 色相阶梯
|
|
2917
|
+
|
|
2918
|
+
var saturationStep = 0.16; // 饱和度阶梯,浅色部分
|
|
2919
|
+
|
|
2920
|
+
var saturationStep2 = 0.05; // 饱和度阶梯,深色部分
|
|
2921
|
+
|
|
2922
|
+
var brightnessStep1 = 0.05; // 亮度阶梯,浅色部分
|
|
2923
|
+
|
|
2924
|
+
var brightnessStep2 = 0.15; // 亮度阶梯,深色部分
|
|
2925
|
+
|
|
2926
|
+
var lightColorCount = 5; // 浅色数量,主色上
|
|
2927
|
+
|
|
2928
|
+
var darkColorCount = 4; // 深色数量,主色下
|
|
2929
|
+
// 暗色主题颜色映射关系表
|
|
2930
|
+
|
|
2931
|
+
var darkColorMap = [{
|
|
2932
|
+
index: 7,
|
|
2933
|
+
opacity: 0.15
|
|
2934
|
+
}, {
|
|
2935
|
+
index: 6,
|
|
2936
|
+
opacity: 0.25
|
|
2937
|
+
}, {
|
|
2938
|
+
index: 5,
|
|
2939
|
+
opacity: 0.3
|
|
2940
|
+
}, {
|
|
2941
|
+
index: 5,
|
|
2942
|
+
opacity: 0.45
|
|
2943
|
+
}, {
|
|
2944
|
+
index: 5,
|
|
2945
|
+
opacity: 0.65
|
|
2946
|
+
}, {
|
|
2947
|
+
index: 5,
|
|
2948
|
+
opacity: 0.85
|
|
2949
|
+
}, {
|
|
2950
|
+
index: 4,
|
|
2951
|
+
opacity: 0.9
|
|
2952
|
+
}, {
|
|
2953
|
+
index: 3,
|
|
2954
|
+
opacity: 0.95
|
|
2955
|
+
}, {
|
|
2956
|
+
index: 2,
|
|
2957
|
+
opacity: 0.97
|
|
2958
|
+
}, {
|
|
2959
|
+
index: 1,
|
|
2960
|
+
opacity: 0.98
|
|
2961
|
+
}]; // Wrapper function ported from TinyColor.prototype.toHsv
|
|
2962
|
+
// Keep it here because of `hsv.h * 360`
|
|
2963
|
+
|
|
2964
|
+
function toHsv(_ref) {
|
|
2965
|
+
var r = _ref.r,
|
|
2966
|
+
g = _ref.g,
|
|
2967
|
+
b = _ref.b;
|
|
2968
|
+
var hsv = rgbToHsv(r, g, b);
|
|
2969
|
+
return {
|
|
2970
|
+
h: hsv.h * 360,
|
|
2971
|
+
s: hsv.s,
|
|
2972
|
+
v: hsv.v
|
|
2973
|
+
};
|
|
2974
|
+
} // Wrapper function ported from TinyColor.prototype.toHexString
|
|
2975
|
+
// Keep it here because of the prefix `#`
|
|
2976
|
+
|
|
2977
|
+
|
|
2978
|
+
function toHex(_ref2) {
|
|
2979
|
+
var r = _ref2.r,
|
|
2980
|
+
g = _ref2.g,
|
|
2981
|
+
b = _ref2.b;
|
|
2982
|
+
return "#".concat(rgbToHex(r, g, b, false));
|
|
2983
|
+
} // Wrapper function ported from TinyColor.prototype.mix, not treeshakable.
|
|
2984
|
+
// Amount in range [0, 1]
|
|
2985
|
+
// Assume color1 & color2 has no alpha, since the following src code did so.
|
|
2986
|
+
|
|
2987
|
+
|
|
2988
|
+
function mix(rgb1, rgb2, amount) {
|
|
2989
|
+
var p = amount / 100;
|
|
2990
|
+
var rgb = {
|
|
2991
|
+
r: (rgb2.r - rgb1.r) * p + rgb1.r,
|
|
2992
|
+
g: (rgb2.g - rgb1.g) * p + rgb1.g,
|
|
2993
|
+
b: (rgb2.b - rgb1.b) * p + rgb1.b
|
|
2994
|
+
};
|
|
2995
|
+
return rgb;
|
|
2996
|
+
}
|
|
2997
|
+
|
|
2998
|
+
function getHue(hsv, i, light) {
|
|
2999
|
+
var hue; // 根据色相不同,色相转向不同
|
|
3000
|
+
|
|
3001
|
+
if (Math.round(hsv.h) >= 60 && Math.round(hsv.h) <= 240) {
|
|
3002
|
+
hue = light ? Math.round(hsv.h) - hueStep * i : Math.round(hsv.h) + hueStep * i;
|
|
3003
|
+
} else {
|
|
3004
|
+
hue = light ? Math.round(hsv.h) + hueStep * i : Math.round(hsv.h) - hueStep * i;
|
|
3005
|
+
}
|
|
3006
|
+
|
|
3007
|
+
if (hue < 0) {
|
|
3008
|
+
hue += 360;
|
|
3009
|
+
} else if (hue >= 360) {
|
|
3010
|
+
hue -= 360;
|
|
3011
|
+
}
|
|
3012
|
+
|
|
3013
|
+
return hue;
|
|
3014
|
+
}
|
|
3015
|
+
|
|
3016
|
+
function getSaturation(hsv, i, light) {
|
|
3017
|
+
// grey color don't change saturation
|
|
3018
|
+
if (hsv.h === 0 && hsv.s === 0) {
|
|
3019
|
+
return hsv.s;
|
|
3020
|
+
}
|
|
3021
|
+
|
|
3022
|
+
var saturation;
|
|
3023
|
+
|
|
3024
|
+
if (light) {
|
|
3025
|
+
saturation = hsv.s - saturationStep * i;
|
|
3026
|
+
} else if (i === darkColorCount) {
|
|
3027
|
+
saturation = hsv.s + saturationStep;
|
|
3028
|
+
} else {
|
|
3029
|
+
saturation = hsv.s + saturationStep2 * i;
|
|
3030
|
+
} // 边界值修正
|
|
3031
|
+
|
|
3032
|
+
|
|
3033
|
+
if (saturation > 1) {
|
|
3034
|
+
saturation = 1;
|
|
3035
|
+
} // 第一格的 s 限制在 0.06-0.1 之间
|
|
3036
|
+
|
|
3037
|
+
|
|
3038
|
+
if (light && i === lightColorCount && saturation > 0.1) {
|
|
3039
|
+
saturation = 0.1;
|
|
3040
|
+
}
|
|
3041
|
+
|
|
3042
|
+
if (saturation < 0.06) {
|
|
3043
|
+
saturation = 0.06;
|
|
3044
|
+
}
|
|
3045
|
+
|
|
3046
|
+
return Number(saturation.toFixed(2));
|
|
3047
|
+
}
|
|
3048
|
+
|
|
3049
|
+
function getValue(hsv, i, light) {
|
|
3050
|
+
var value;
|
|
3051
|
+
|
|
3052
|
+
if (light) {
|
|
3053
|
+
value = hsv.v + brightnessStep1 * i;
|
|
3054
|
+
} else {
|
|
3055
|
+
value = hsv.v - brightnessStep2 * i;
|
|
3056
|
+
}
|
|
3057
|
+
|
|
3058
|
+
if (value > 1) {
|
|
3059
|
+
value = 1;
|
|
3060
|
+
}
|
|
3061
|
+
|
|
3062
|
+
return Number(value.toFixed(2));
|
|
3063
|
+
}
|
|
3064
|
+
|
|
3065
|
+
function generate$1(color) {
|
|
3066
|
+
var opts = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
3067
|
+
var patterns = [];
|
|
3068
|
+
var pColor = inputToRGB(color);
|
|
3069
|
+
|
|
3070
|
+
for (var i = lightColorCount; i > 0; i -= 1) {
|
|
3071
|
+
var hsv = toHsv(pColor);
|
|
3072
|
+
var colorString = toHex(inputToRGB({
|
|
3073
|
+
h: getHue(hsv, i, true),
|
|
3074
|
+
s: getSaturation(hsv, i, true),
|
|
3075
|
+
v: getValue(hsv, i, true)
|
|
3076
|
+
}));
|
|
3077
|
+
patterns.push(colorString);
|
|
3078
|
+
}
|
|
3079
|
+
|
|
3080
|
+
patterns.push(toHex(pColor));
|
|
3081
|
+
|
|
3082
|
+
for (var _i = 1; _i <= darkColorCount; _i += 1) {
|
|
3083
|
+
var _hsv = toHsv(pColor);
|
|
3084
|
+
|
|
3085
|
+
var _colorString = toHex(inputToRGB({
|
|
3086
|
+
h: getHue(_hsv, _i),
|
|
3087
|
+
s: getSaturation(_hsv, _i),
|
|
3088
|
+
v: getValue(_hsv, _i)
|
|
3089
|
+
}));
|
|
3090
|
+
|
|
3091
|
+
patterns.push(_colorString);
|
|
3092
|
+
} // dark theme patterns
|
|
3093
|
+
|
|
3094
|
+
|
|
3095
|
+
if (opts.theme === 'dark') {
|
|
3096
|
+
return darkColorMap.map(function (_ref3) {
|
|
3097
|
+
var index = _ref3.index,
|
|
3098
|
+
opacity = _ref3.opacity;
|
|
3099
|
+
var darkColorString = toHex(mix(inputToRGB(opts.backgroundColor || '#141414'), inputToRGB(patterns[index]), opacity * 100));
|
|
3100
|
+
return darkColorString;
|
|
3101
|
+
});
|
|
3102
|
+
}
|
|
3103
|
+
|
|
3104
|
+
return patterns;
|
|
3105
|
+
}
|
|
3106
|
+
|
|
3107
|
+
var presetPrimaryColors = {
|
|
3108
|
+
red: '#F5222D',
|
|
3109
|
+
volcano: '#FA541C',
|
|
3110
|
+
orange: '#FA8C16',
|
|
3111
|
+
gold: '#FAAD14',
|
|
3112
|
+
yellow: '#FADB14',
|
|
3113
|
+
lime: '#A0D911',
|
|
3114
|
+
green: '#52C41A',
|
|
3115
|
+
cyan: '#13C2C2',
|
|
3116
|
+
blue: '#1890FF',
|
|
3117
|
+
geekblue: '#2F54EB',
|
|
3118
|
+
purple: '#722ED1',
|
|
3119
|
+
magenta: '#EB2F96',
|
|
3120
|
+
grey: '#666666'
|
|
3121
|
+
};
|
|
3122
|
+
var presetPalettes = {};
|
|
3123
|
+
var presetDarkPalettes = {};
|
|
3124
|
+
Object.keys(presetPrimaryColors).forEach(function (key) {
|
|
3125
|
+
presetPalettes[key] = generate$1(presetPrimaryColors[key]);
|
|
3126
|
+
presetPalettes[key].primary = presetPalettes[key][5]; // dark presetPalettes
|
|
3127
|
+
|
|
3128
|
+
presetDarkPalettes[key] = generate$1(presetPrimaryColors[key], {
|
|
3129
|
+
theme: 'dark',
|
|
3130
|
+
backgroundColor: '#141414'
|
|
3131
|
+
});
|
|
3132
|
+
presetDarkPalettes[key].primary = presetDarkPalettes[key][5];
|
|
3133
|
+
});
|
|
3134
|
+
presetPalettes.red;
|
|
3135
|
+
presetPalettes.volcano;
|
|
3136
|
+
presetPalettes.gold;
|
|
3137
|
+
presetPalettes.orange;
|
|
3138
|
+
presetPalettes.yellow;
|
|
3139
|
+
presetPalettes.lime;
|
|
3140
|
+
presetPalettes.green;
|
|
3141
|
+
presetPalettes.cyan;
|
|
3142
|
+
presetPalettes.blue;
|
|
3143
|
+
presetPalettes.geekblue;
|
|
3144
|
+
presetPalettes.purple;
|
|
3145
|
+
presetPalettes.magenta;
|
|
3146
|
+
presetPalettes.grey;
|
|
3147
|
+
|
|
3148
|
+
/* eslint-disable no-console */
|
|
3149
|
+
var warned = {};
|
|
3150
|
+
function warning$1(valid, message) {
|
|
3151
|
+
}
|
|
3152
|
+
function call(method, valid, message) {
|
|
3153
|
+
if (!valid && !warned[message]) {
|
|
3154
|
+
method(false, message);
|
|
3155
|
+
warned[message] = true;
|
|
3156
|
+
}
|
|
3157
|
+
}
|
|
3158
|
+
function warningOnce(valid, message) {
|
|
3159
|
+
call(warning$1, valid, message);
|
|
3160
|
+
}
|
|
3161
|
+
/* eslint-enable */
|
|
3162
|
+
|
|
3163
|
+
function canUseDom() {
|
|
3164
|
+
return !!(typeof window !== 'undefined' && window.document && window.document.createElement);
|
|
3165
|
+
}
|
|
3166
|
+
|
|
3167
|
+
var MARK_KEY = "rc-util-key";
|
|
3168
|
+
|
|
3169
|
+
function getMark() {
|
|
3170
|
+
var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
|
|
3171
|
+
mark = _ref.mark;
|
|
3172
|
+
|
|
3173
|
+
if (mark) {
|
|
3174
|
+
return mark.startsWith('data-') ? mark : "data-".concat(mark);
|
|
3175
|
+
}
|
|
3176
|
+
|
|
3177
|
+
return MARK_KEY;
|
|
3178
|
+
}
|
|
3179
|
+
|
|
3180
|
+
function getContainer(option) {
|
|
3181
|
+
if (option.attachTo) {
|
|
3182
|
+
return option.attachTo;
|
|
3183
|
+
}
|
|
3184
|
+
|
|
3185
|
+
var head = document.querySelector('head');
|
|
3186
|
+
return head || document.body;
|
|
3187
|
+
}
|
|
3188
|
+
|
|
3189
|
+
function injectCSS(css) {
|
|
3190
|
+
var _option$csp;
|
|
3191
|
+
|
|
3192
|
+
var option = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
3193
|
+
|
|
3194
|
+
if (!canUseDom()) {
|
|
3195
|
+
return null;
|
|
3196
|
+
}
|
|
3197
|
+
|
|
3198
|
+
var styleNode = document.createElement('style');
|
|
3199
|
+
|
|
3200
|
+
if ((_option$csp = option.csp) === null || _option$csp === void 0 ? void 0 : _option$csp.nonce) {
|
|
3201
|
+
var _option$csp2;
|
|
3202
|
+
|
|
3203
|
+
styleNode.nonce = (_option$csp2 = option.csp) === null || _option$csp2 === void 0 ? void 0 : _option$csp2.nonce;
|
|
3204
|
+
}
|
|
3205
|
+
|
|
3206
|
+
styleNode.innerHTML = css;
|
|
3207
|
+
var container = getContainer(option);
|
|
3208
|
+
var firstChild = container.firstChild;
|
|
3209
|
+
|
|
3210
|
+
if (option.prepend && container.prepend) {
|
|
3211
|
+
// Use `prepend` first
|
|
3212
|
+
container.prepend(styleNode);
|
|
3213
|
+
} else if (option.prepend && firstChild) {
|
|
3214
|
+
// Fallback to `insertBefore` like IE not support `prepend`
|
|
3215
|
+
container.insertBefore(styleNode, firstChild);
|
|
3216
|
+
} else {
|
|
3217
|
+
container.appendChild(styleNode);
|
|
3218
|
+
}
|
|
3219
|
+
|
|
3220
|
+
return styleNode;
|
|
3221
|
+
}
|
|
3222
|
+
var containerCache = new Map();
|
|
3223
|
+
|
|
3224
|
+
function findExistNode(key) {
|
|
3225
|
+
var option = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
3226
|
+
var container = getContainer(option);
|
|
3227
|
+
return Array.from(containerCache.get(container).children).find(function (node) {
|
|
3228
|
+
return node.tagName === 'STYLE' && node.getAttribute(getMark(option)) === key;
|
|
3229
|
+
});
|
|
3230
|
+
}
|
|
3231
|
+
function updateCSS(css, key) {
|
|
3232
|
+
var option = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
3233
|
+
var container = getContainer(option); // Get real parent
|
|
3234
|
+
|
|
3235
|
+
if (!containerCache.has(container)) {
|
|
3236
|
+
var placeholderStyle = injectCSS('', option);
|
|
3237
|
+
var parentNode = placeholderStyle.parentNode;
|
|
3238
|
+
containerCache.set(container, parentNode);
|
|
3239
|
+
parentNode.removeChild(placeholderStyle);
|
|
3240
|
+
}
|
|
3241
|
+
|
|
3242
|
+
var existNode = findExistNode(key, option);
|
|
3243
|
+
|
|
3244
|
+
if (existNode) {
|
|
3245
|
+
var _option$csp3, _option$csp4;
|
|
3246
|
+
|
|
3247
|
+
if (((_option$csp3 = option.csp) === null || _option$csp3 === void 0 ? void 0 : _option$csp3.nonce) && existNode.nonce !== ((_option$csp4 = option.csp) === null || _option$csp4 === void 0 ? void 0 : _option$csp4.nonce)) {
|
|
3248
|
+
var _option$csp5;
|
|
3249
|
+
|
|
3250
|
+
existNode.nonce = (_option$csp5 = option.csp) === null || _option$csp5 === void 0 ? void 0 : _option$csp5.nonce;
|
|
3251
|
+
}
|
|
3252
|
+
|
|
3253
|
+
if (existNode.innerHTML !== css) {
|
|
3254
|
+
existNode.innerHTML = css;
|
|
3255
|
+
}
|
|
3256
|
+
|
|
3257
|
+
return existNode;
|
|
3258
|
+
}
|
|
3259
|
+
|
|
3260
|
+
var newNode = injectCSS(css, option);
|
|
3261
|
+
newNode.setAttribute(getMark(option), key);
|
|
3262
|
+
return newNode;
|
|
3263
|
+
}
|
|
3264
|
+
|
|
3265
|
+
function warning(valid, message) {
|
|
3266
|
+
warningOnce(valid, "[@ant-design/icons] ".concat(message));
|
|
3267
|
+
}
|
|
3268
|
+
function isIconDefinition(target) {
|
|
3269
|
+
return _typeof(target) === 'object' && typeof target.name === 'string' && typeof target.theme === 'string' && (_typeof(target.icon) === 'object' || typeof target.icon === 'function');
|
|
3270
|
+
}
|
|
3271
|
+
function normalizeAttrs() {
|
|
3272
|
+
var attrs = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
3273
|
+
return Object.keys(attrs).reduce(function (acc, key) {
|
|
3274
|
+
var val = attrs[key];
|
|
3275
|
+
|
|
3276
|
+
switch (key) {
|
|
3277
|
+
case 'class':
|
|
3278
|
+
acc.className = val;
|
|
3279
|
+
delete acc.class;
|
|
3280
|
+
break;
|
|
3281
|
+
|
|
3282
|
+
default:
|
|
3283
|
+
acc[key] = val;
|
|
3284
|
+
}
|
|
3285
|
+
|
|
3286
|
+
return acc;
|
|
3287
|
+
}, {});
|
|
3288
|
+
}
|
|
3289
|
+
function generate(node, key, rootProps) {
|
|
3290
|
+
if (!rootProps) {
|
|
3291
|
+
return /*#__PURE__*/React__default["default"].createElement(node.tag, _objectSpread2$1({
|
|
3292
|
+
key: key
|
|
3293
|
+
}, normalizeAttrs(node.attrs)), (node.children || []).map(function (child, index) {
|
|
3294
|
+
return generate(child, "".concat(key, "-").concat(node.tag, "-").concat(index));
|
|
3295
|
+
}));
|
|
3296
|
+
}
|
|
3297
|
+
|
|
3298
|
+
return /*#__PURE__*/React__default["default"].createElement(node.tag, _objectSpread2$1(_objectSpread2$1({
|
|
3299
|
+
key: key
|
|
3300
|
+
}, normalizeAttrs(node.attrs)), rootProps), (node.children || []).map(function (child, index) {
|
|
3301
|
+
return generate(child, "".concat(key, "-").concat(node.tag, "-").concat(index));
|
|
3302
|
+
}));
|
|
3303
|
+
}
|
|
3304
|
+
function getSecondaryColor(primaryColor) {
|
|
3305
|
+
// choose the second color
|
|
3306
|
+
return generate$1(primaryColor)[0];
|
|
3307
|
+
}
|
|
3308
|
+
function normalizeTwoToneColors(twoToneColor) {
|
|
3309
|
+
if (!twoToneColor) {
|
|
3310
|
+
return [];
|
|
3311
|
+
}
|
|
3312
|
+
|
|
3313
|
+
return Array.isArray(twoToneColor) ? twoToneColor : [twoToneColor];
|
|
3314
|
+
} // These props make sure that the SVG behaviours like general text.
|
|
3315
|
+
// Reference: https://blog.prototypr.io/align-svg-icons-to-text-and-say-goodbye-to-font-icons-d44b3d7b26b4
|
|
3316
|
+
|
|
3317
|
+
var svgBaseProps = {
|
|
3318
|
+
width: '1em',
|
|
3319
|
+
height: '1em',
|
|
3320
|
+
fill: 'currentColor',
|
|
3321
|
+
'aria-hidden': 'true',
|
|
3322
|
+
focusable: 'false'
|
|
3323
|
+
};
|
|
3324
|
+
var iconStyles = "\n.anticon {\n display: inline-block;\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";
|
|
3325
|
+
var useInsertStyles = function useInsertStyles() {
|
|
3326
|
+
var styleStr = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : iconStyles;
|
|
3327
|
+
|
|
3328
|
+
var _useContext = React.useContext(IconContext),
|
|
3329
|
+
csp = _useContext.csp;
|
|
3330
|
+
|
|
3331
|
+
React.useEffect(function () {
|
|
3332
|
+
updateCSS(styleStr, '@ant-design-icons', {
|
|
3333
|
+
prepend: true,
|
|
3334
|
+
csp: csp
|
|
3335
|
+
});
|
|
3336
|
+
}, []);
|
|
3337
|
+
};
|
|
3338
|
+
|
|
3339
|
+
var _excluded$2 = ["icon", "className", "onClick", "style", "primaryColor", "secondaryColor"];
|
|
3340
|
+
var twoToneColorPalette = {
|
|
3341
|
+
primaryColor: '#333',
|
|
3342
|
+
secondaryColor: '#E6E6E6',
|
|
3343
|
+
calculated: false
|
|
3344
|
+
};
|
|
3345
|
+
|
|
3346
|
+
function setTwoToneColors(_ref) {
|
|
3347
|
+
var primaryColor = _ref.primaryColor,
|
|
3348
|
+
secondaryColor = _ref.secondaryColor;
|
|
3349
|
+
twoToneColorPalette.primaryColor = primaryColor;
|
|
3350
|
+
twoToneColorPalette.secondaryColor = secondaryColor || getSecondaryColor(primaryColor);
|
|
3351
|
+
twoToneColorPalette.calculated = !!secondaryColor;
|
|
3352
|
+
}
|
|
3353
|
+
|
|
3354
|
+
function getTwoToneColors() {
|
|
3355
|
+
return _objectSpread2$1({}, twoToneColorPalette);
|
|
3356
|
+
}
|
|
3357
|
+
|
|
3358
|
+
var IconBase = function IconBase(props) {
|
|
3359
|
+
var icon = props.icon,
|
|
3360
|
+
className = props.className,
|
|
3361
|
+
onClick = props.onClick,
|
|
3362
|
+
style = props.style,
|
|
3363
|
+
primaryColor = props.primaryColor,
|
|
3364
|
+
secondaryColor = props.secondaryColor,
|
|
3365
|
+
restProps = _objectWithoutProperties(props, _excluded$2);
|
|
3366
|
+
|
|
3367
|
+
var colors = twoToneColorPalette;
|
|
3368
|
+
|
|
3369
|
+
if (primaryColor) {
|
|
3370
|
+
colors = {
|
|
3371
|
+
primaryColor: primaryColor,
|
|
3372
|
+
secondaryColor: secondaryColor || getSecondaryColor(primaryColor)
|
|
3373
|
+
};
|
|
3374
|
+
}
|
|
3375
|
+
|
|
3376
|
+
useInsertStyles();
|
|
3377
|
+
warning(isIconDefinition(icon), "icon should be icon definiton, but got ".concat(icon));
|
|
3378
|
+
|
|
3379
|
+
if (!isIconDefinition(icon)) {
|
|
3380
|
+
return null;
|
|
3381
|
+
}
|
|
3382
|
+
|
|
3383
|
+
var target = icon;
|
|
3384
|
+
|
|
3385
|
+
if (target && typeof target.icon === 'function') {
|
|
3386
|
+
target = _objectSpread2$1(_objectSpread2$1({}, target), {}, {
|
|
3387
|
+
icon: target.icon(colors.primaryColor, colors.secondaryColor)
|
|
3388
|
+
});
|
|
3389
|
+
}
|
|
3390
|
+
|
|
3391
|
+
return generate(target.icon, "svg-".concat(target.name), _objectSpread2$1({
|
|
3392
|
+
className: className,
|
|
3393
|
+
onClick: onClick,
|
|
3394
|
+
style: style,
|
|
3395
|
+
'data-icon': target.name,
|
|
3396
|
+
width: '1em',
|
|
3397
|
+
height: '1em',
|
|
3398
|
+
fill: 'currentColor',
|
|
3399
|
+
'aria-hidden': 'true'
|
|
3400
|
+
}, restProps));
|
|
3401
|
+
};
|
|
3402
|
+
|
|
3403
|
+
IconBase.displayName = 'IconReact';
|
|
3404
|
+
IconBase.getTwoToneColors = getTwoToneColors;
|
|
3405
|
+
IconBase.setTwoToneColors = setTwoToneColors;
|
|
3406
|
+
|
|
3407
|
+
function setTwoToneColor(twoToneColor) {
|
|
3408
|
+
var _normalizeTwoToneColo = normalizeTwoToneColors(twoToneColor),
|
|
3409
|
+
_normalizeTwoToneColo2 = _slicedToArray(_normalizeTwoToneColo, 2),
|
|
3410
|
+
primaryColor = _normalizeTwoToneColo2[0],
|
|
3411
|
+
secondaryColor = _normalizeTwoToneColo2[1];
|
|
3412
|
+
|
|
3413
|
+
return IconBase.setTwoToneColors({
|
|
3414
|
+
primaryColor: primaryColor,
|
|
3415
|
+
secondaryColor: secondaryColor
|
|
3416
|
+
});
|
|
3417
|
+
}
|
|
3418
|
+
function getTwoToneColor() {
|
|
3419
|
+
var colors = IconBase.getTwoToneColors();
|
|
3420
|
+
|
|
3421
|
+
if (!colors.calculated) {
|
|
3422
|
+
return colors.primaryColor;
|
|
3423
|
+
}
|
|
3424
|
+
|
|
3425
|
+
return [colors.primaryColor, colors.secondaryColor];
|
|
3426
|
+
}
|
|
3427
|
+
|
|
3428
|
+
var _excluded$1 = ["className", "icon", "spin", "rotate", "tabIndex", "onClick", "twoToneColor"];
|
|
3429
|
+
// should move it to antd main repo?
|
|
3430
|
+
|
|
3431
|
+
setTwoToneColor('#1890ff');
|
|
3432
|
+
var Icon$1 = /*#__PURE__*/React__namespace.forwardRef(function (props, ref) {
|
|
3433
|
+
var _classNames;
|
|
3434
|
+
|
|
3435
|
+
var className = props.className,
|
|
3436
|
+
icon = props.icon,
|
|
3437
|
+
spin = props.spin,
|
|
3438
|
+
rotate = props.rotate,
|
|
3439
|
+
tabIndex = props.tabIndex,
|
|
3440
|
+
onClick = props.onClick,
|
|
3441
|
+
twoToneColor = props.twoToneColor,
|
|
3442
|
+
restProps = _objectWithoutProperties(props, _excluded$1);
|
|
3443
|
+
|
|
3444
|
+
var _React$useContext = React__namespace.useContext(IconContext),
|
|
3445
|
+
_React$useContext$pre = _React$useContext.prefixCls,
|
|
3446
|
+
prefixCls = _React$useContext$pre === void 0 ? 'anticon' : _React$useContext$pre;
|
|
3447
|
+
|
|
3448
|
+
var classString = classnames(prefixCls, (_classNames = {}, _defineProperty$1(_classNames, "".concat(prefixCls, "-").concat(icon.name), !!icon.name), _defineProperty$1(_classNames, "".concat(prefixCls, "-spin"), !!spin || icon.name === 'loading'), _classNames), className);
|
|
3449
|
+
var iconTabIndex = tabIndex;
|
|
3450
|
+
|
|
3451
|
+
if (iconTabIndex === undefined && onClick) {
|
|
3452
|
+
iconTabIndex = -1;
|
|
3453
|
+
}
|
|
3454
|
+
|
|
3455
|
+
var svgStyle = rotate ? {
|
|
3456
|
+
msTransform: "rotate(".concat(rotate, "deg)"),
|
|
3457
|
+
transform: "rotate(".concat(rotate, "deg)")
|
|
3458
|
+
} : undefined;
|
|
3459
|
+
|
|
3460
|
+
var _normalizeTwoToneColo = normalizeTwoToneColors(twoToneColor),
|
|
3461
|
+
_normalizeTwoToneColo2 = _slicedToArray(_normalizeTwoToneColo, 2),
|
|
3462
|
+
primaryColor = _normalizeTwoToneColo2[0],
|
|
3463
|
+
secondaryColor = _normalizeTwoToneColo2[1];
|
|
3464
|
+
|
|
3465
|
+
return /*#__PURE__*/React__namespace.createElement("span", _objectSpread2$1(_objectSpread2$1({
|
|
3466
|
+
role: "img",
|
|
3467
|
+
"aria-label": icon.name
|
|
3468
|
+
}, restProps), {}, {
|
|
3469
|
+
ref: ref,
|
|
3470
|
+
tabIndex: iconTabIndex,
|
|
3471
|
+
onClick: onClick,
|
|
3472
|
+
className: classString
|
|
3473
|
+
}), /*#__PURE__*/React__namespace.createElement(IconBase, {
|
|
3474
|
+
icon: icon,
|
|
3475
|
+
primaryColor: primaryColor,
|
|
3476
|
+
secondaryColor: secondaryColor,
|
|
3477
|
+
style: svgStyle
|
|
3478
|
+
}));
|
|
3479
|
+
});
|
|
3480
|
+
Icon$1.displayName = 'AntdIcon';
|
|
3481
|
+
Icon$1.getTwoToneColor = getTwoToneColor;
|
|
3482
|
+
Icon$1.setTwoToneColor = setTwoToneColor;
|
|
3483
|
+
|
|
3484
|
+
// This icon file is generated automatically.
|
|
3485
|
+
var CheckOutlined$2 = {
|
|
3486
|
+
"icon": {
|
|
3487
|
+
"tag": "svg",
|
|
3488
|
+
"attrs": {
|
|
3489
|
+
"viewBox": "64 64 896 896",
|
|
3490
|
+
"focusable": "false"
|
|
3491
|
+
},
|
|
3492
|
+
"children": [{
|
|
3493
|
+
"tag": "path",
|
|
3494
|
+
"attrs": {
|
|
3495
|
+
"d": "M912 190h-69.9c-9.8 0-19.1 4.5-25.1 12.2L404.7 724.5 207 474a32 32 0 00-25.1-12.2H112c-6.7 0-10.4 7.7-6.3 12.9l273.9 347c12.8 16.2 37.4 16.2 50.3 0l488.4-618.9c4.1-5.1.4-12.8-6.3-12.8z"
|
|
3496
|
+
}
|
|
3497
|
+
}]
|
|
3498
|
+
},
|
|
3499
|
+
"name": "check",
|
|
3500
|
+
"theme": "outlined"
|
|
3501
|
+
};
|
|
3502
|
+
|
|
3503
|
+
var CheckOutlined = function CheckOutlined(props, ref) {
|
|
3504
|
+
return /*#__PURE__*/React__namespace.createElement(Icon$1, _objectSpread2$1(_objectSpread2$1({}, props), {}, {
|
|
3505
|
+
ref: ref,
|
|
3506
|
+
icon: CheckOutlined$2
|
|
3507
|
+
}));
|
|
3508
|
+
};
|
|
3509
|
+
|
|
3510
|
+
CheckOutlined.displayName = 'CheckOutlined';
|
|
3511
|
+
var CheckOutlined$1 = /*#__PURE__*/React__namespace.forwardRef(CheckOutlined);
|
|
3512
|
+
|
|
3513
|
+
// This icon file is generated automatically.
|
|
3514
|
+
var CloseOutlined$2 = {
|
|
3515
|
+
"icon": {
|
|
3516
|
+
"tag": "svg",
|
|
3517
|
+
"attrs": {
|
|
3518
|
+
"viewBox": "64 64 896 896",
|
|
3519
|
+
"focusable": "false"
|
|
3520
|
+
},
|
|
3521
|
+
"children": [{
|
|
3522
|
+
"tag": "path",
|
|
3523
|
+
"attrs": {
|
|
3524
|
+
"d": "M563.8 512l262.5-312.9c4.4-5.2.7-13.1-6.1-13.1h-79.8c-4.7 0-9.2 2.1-12.3 5.7L511.6 449.8 295.1 191.7c-3-3.6-7.5-5.7-12.3-5.7H203c-6.8 0-10.5 7.9-6.1 13.1L459.4 512 196.9 824.9A7.95 7.95 0 00203 838h79.8c4.7 0 9.2-2.1 12.3-5.7l216.5-258.1 216.5 258.1c3 3.6 7.5 5.7 12.3 5.7h79.8c6.8 0 10.5-7.9 6.1-13.1L563.8 512z"
|
|
3525
|
+
}
|
|
3526
|
+
}]
|
|
3527
|
+
},
|
|
3528
|
+
"name": "close",
|
|
3529
|
+
"theme": "outlined"
|
|
3530
|
+
};
|
|
3531
|
+
|
|
3532
|
+
var CloseOutlined = function CloseOutlined(props, ref) {
|
|
3533
|
+
return /*#__PURE__*/React__namespace.createElement(Icon$1, _objectSpread2$1(_objectSpread2$1({}, props), {}, {
|
|
3534
|
+
ref: ref,
|
|
3535
|
+
icon: CloseOutlined$2
|
|
3536
|
+
}));
|
|
3537
|
+
};
|
|
3538
|
+
|
|
3539
|
+
CloseOutlined.displayName = 'CloseOutlined';
|
|
3540
|
+
var CloseOutlined$1 = /*#__PURE__*/React__namespace.forwardRef(CloseOutlined);
|
|
3541
|
+
|
|
3542
|
+
// This icon file is generated automatically.
|
|
3543
|
+
var DeleteOutlined$2 = {
|
|
3544
|
+
"icon": {
|
|
3545
|
+
"tag": "svg",
|
|
3546
|
+
"attrs": {
|
|
3547
|
+
"viewBox": "64 64 896 896",
|
|
3548
|
+
"focusable": "false"
|
|
3549
|
+
},
|
|
3550
|
+
"children": [{
|
|
3551
|
+
"tag": "path",
|
|
3552
|
+
"attrs": {
|
|
3553
|
+
"d": "M360 184h-8c4.4 0 8-3.6 8-8v8h304v-8c0 4.4 3.6 8 8 8h-8v72h72v-80c0-35.3-28.7-64-64-64H352c-35.3 0-64 28.7-64 64v80h72v-72zm504 72H160c-17.7 0-32 14.3-32 32v32c0 4.4 3.6 8 8 8h60.4l24.7 523c1.6 34.1 29.8 61 63.9 61h454c34.2 0 62.3-26.8 63.9-61l24.7-523H888c4.4 0 8-3.6 8-8v-32c0-17.7-14.3-32-32-32zM731.3 840H292.7l-24.2-512h487l-24.2 512z"
|
|
3554
|
+
}
|
|
3555
|
+
}]
|
|
3556
|
+
},
|
|
3557
|
+
"name": "delete",
|
|
3558
|
+
"theme": "outlined"
|
|
3559
|
+
};
|
|
3560
|
+
|
|
3561
|
+
var DeleteOutlined = function DeleteOutlined(props, ref) {
|
|
3562
|
+
return /*#__PURE__*/React__namespace.createElement(Icon$1, _objectSpread2$1(_objectSpread2$1({}, props), {}, {
|
|
3563
|
+
ref: ref,
|
|
3564
|
+
icon: DeleteOutlined$2
|
|
3565
|
+
}));
|
|
3566
|
+
};
|
|
3567
|
+
|
|
3568
|
+
DeleteOutlined.displayName = 'DeleteOutlined';
|
|
3569
|
+
var DeleteOutlined$1 = /*#__PURE__*/React__namespace.forwardRef(DeleteOutlined);
|
|
3570
|
+
|
|
3571
|
+
// This icon file is generated automatically.
|
|
3572
|
+
var DownOutlined$2 = {
|
|
3573
|
+
"icon": {
|
|
3574
|
+
"tag": "svg",
|
|
3575
|
+
"attrs": {
|
|
3576
|
+
"viewBox": "64 64 896 896",
|
|
3577
|
+
"focusable": "false"
|
|
3578
|
+
},
|
|
3579
|
+
"children": [{
|
|
3580
|
+
"tag": "path",
|
|
3581
|
+
"attrs": {
|
|
3582
|
+
"d": "M884 256h-75c-5.1 0-9.9 2.5-12.9 6.6L512 654.2 227.9 262.6c-3-4.1-7.8-6.6-12.9-6.6h-75c-6.5 0-10.3 7.4-6.5 12.7l352.6 486.1c12.8 17.6 39 17.6 51.7 0l352.6-486.1c3.9-5.3.1-12.7-6.4-12.7z"
|
|
3583
|
+
}
|
|
3584
|
+
}]
|
|
3585
|
+
},
|
|
3586
|
+
"name": "down",
|
|
3587
|
+
"theme": "outlined"
|
|
3588
|
+
};
|
|
3589
|
+
|
|
3590
|
+
var DownOutlined = function DownOutlined(props, ref) {
|
|
3591
|
+
return /*#__PURE__*/React__namespace.createElement(Icon$1, _objectSpread2$1(_objectSpread2$1({}, props), {}, {
|
|
3592
|
+
ref: ref,
|
|
3593
|
+
icon: DownOutlined$2
|
|
3594
|
+
}));
|
|
3595
|
+
};
|
|
3596
|
+
|
|
3597
|
+
DownOutlined.displayName = 'DownOutlined';
|
|
3598
|
+
var DownOutlined$1 = /*#__PURE__*/React__namespace.forwardRef(DownOutlined);
|
|
3599
|
+
|
|
3600
|
+
// This icon file is generated automatically.
|
|
3601
|
+
var PlusOutlined$2 = {
|
|
3602
|
+
"icon": {
|
|
3603
|
+
"tag": "svg",
|
|
3604
|
+
"attrs": {
|
|
3605
|
+
"viewBox": "64 64 896 896",
|
|
3606
|
+
"focusable": "false"
|
|
3607
|
+
},
|
|
3608
|
+
"children": [{
|
|
3609
|
+
"tag": "defs",
|
|
3610
|
+
"attrs": {},
|
|
3611
|
+
"children": [{
|
|
3612
|
+
"tag": "style",
|
|
3613
|
+
"attrs": {}
|
|
3614
|
+
}]
|
|
3615
|
+
}, {
|
|
3616
|
+
"tag": "path",
|
|
3617
|
+
"attrs": {
|
|
3618
|
+
"d": "M482 152h60q8 0 8 8v704q0 8-8 8h-60q-8 0-8-8V160q0-8 8-8z"
|
|
3619
|
+
}
|
|
3620
|
+
}, {
|
|
3621
|
+
"tag": "path",
|
|
3622
|
+
"attrs": {
|
|
3623
|
+
"d": "M176 474h672q8 0 8 8v60q0 8-8 8H176q-8 0-8-8v-60q0-8 8-8z"
|
|
3624
|
+
}
|
|
3625
|
+
}]
|
|
3626
|
+
},
|
|
3627
|
+
"name": "plus",
|
|
3628
|
+
"theme": "outlined"
|
|
3629
|
+
};
|
|
3630
|
+
|
|
3631
|
+
var PlusOutlined = function PlusOutlined(props, ref) {
|
|
3632
|
+
return /*#__PURE__*/React__namespace.createElement(Icon$1, _objectSpread2$1(_objectSpread2$1({}, props), {}, {
|
|
3633
|
+
ref: ref,
|
|
3634
|
+
icon: PlusOutlined$2
|
|
3635
|
+
}));
|
|
3636
|
+
};
|
|
3637
|
+
|
|
3638
|
+
PlusOutlined.displayName = 'PlusOutlined';
|
|
3639
|
+
var PlusOutlined$1 = /*#__PURE__*/React__namespace.forwardRef(PlusOutlined);
|
|
3640
|
+
|
|
3641
|
+
var _excluded = ["className", "component", "viewBox", "spin", "rotate", "tabIndex", "onClick", "children"];
|
|
3642
|
+
var Icon = /*#__PURE__*/React__namespace.forwardRef(function (props, ref) {
|
|
3643
|
+
var className = props.className,
|
|
3644
|
+
Component = props.component,
|
|
3645
|
+
viewBox = props.viewBox,
|
|
3646
|
+
spin = props.spin,
|
|
3647
|
+
rotate = props.rotate,
|
|
3648
|
+
tabIndex = props.tabIndex,
|
|
3649
|
+
onClick = props.onClick,
|
|
3650
|
+
children = props.children,
|
|
3651
|
+
restProps = _objectWithoutProperties(props, _excluded);
|
|
3652
|
+
|
|
3653
|
+
warning(Boolean(Component || children), 'Should have `component` prop or `children`.');
|
|
3654
|
+
useInsertStyles();
|
|
3655
|
+
|
|
3656
|
+
var _React$useContext = React__namespace.useContext(IconContext),
|
|
3657
|
+
_React$useContext$pre = _React$useContext.prefixCls,
|
|
3658
|
+
prefixCls = _React$useContext$pre === void 0 ? 'anticon' : _React$useContext$pre;
|
|
3659
|
+
|
|
3660
|
+
var classString = classnames(prefixCls, className);
|
|
3661
|
+
var svgClassString = classnames(_defineProperty$1({}, "".concat(prefixCls, "-spin"), !!spin));
|
|
3662
|
+
var svgStyle = rotate ? {
|
|
3663
|
+
msTransform: "rotate(".concat(rotate, "deg)"),
|
|
3664
|
+
transform: "rotate(".concat(rotate, "deg)")
|
|
3665
|
+
} : undefined;
|
|
3666
|
+
|
|
3667
|
+
var innerSvgProps = _objectSpread2$1(_objectSpread2$1({}, svgBaseProps), {}, {
|
|
3668
|
+
className: svgClassString,
|
|
3669
|
+
style: svgStyle,
|
|
3670
|
+
viewBox: viewBox
|
|
3671
|
+
});
|
|
3672
|
+
|
|
3673
|
+
if (!viewBox) {
|
|
3674
|
+
delete innerSvgProps.viewBox;
|
|
3675
|
+
} // component > children
|
|
3676
|
+
|
|
3677
|
+
|
|
3678
|
+
var renderInnerNode = function renderInnerNode() {
|
|
3679
|
+
if (Component) {
|
|
3680
|
+
return /*#__PURE__*/React__namespace.createElement(Component, _objectSpread2$1({}, innerSvgProps), children);
|
|
3681
|
+
}
|
|
3682
|
+
|
|
3683
|
+
if (children) {
|
|
3684
|
+
warning(Boolean(viewBox) || React__namespace.Children.count(children) === 1 && /*#__PURE__*/React__namespace.isValidElement(children) && React__namespace.Children.only(children).type === 'use', 'Make sure that you provide correct `viewBox`' + ' prop (default `0 0 1024 1024`) to the icon.');
|
|
3685
|
+
return /*#__PURE__*/React__namespace.createElement("svg", _objectSpread2$1(_objectSpread2$1({}, innerSvgProps), {}, {
|
|
3686
|
+
viewBox: viewBox
|
|
3687
|
+
}), children);
|
|
3688
|
+
}
|
|
3689
|
+
|
|
3690
|
+
return null;
|
|
3691
|
+
};
|
|
3692
|
+
|
|
3693
|
+
var iconTabIndex = tabIndex;
|
|
3694
|
+
|
|
3695
|
+
if (iconTabIndex === undefined && onClick) {
|
|
3696
|
+
iconTabIndex = -1;
|
|
3697
|
+
}
|
|
3698
|
+
|
|
3699
|
+
return /*#__PURE__*/React__namespace.createElement("span", _objectSpread2$1(_objectSpread2$1({
|
|
3700
|
+
role: "img"
|
|
3701
|
+
}, restProps), {}, {
|
|
3702
|
+
ref: ref,
|
|
3703
|
+
tabIndex: iconTabIndex,
|
|
3704
|
+
onClick: onClick,
|
|
3705
|
+
className: classString
|
|
3706
|
+
}), renderInnerNode());
|
|
3707
|
+
});
|
|
3708
|
+
Icon.displayName = 'AntdIcon';
|
|
3709
|
+
|
|
3710
|
+
IconContext.Provider;
|
|
3711
|
+
|
|
3712
|
+
var TextArray = /*#__PURE__*/function (_PureComponent) {
|
|
3713
|
+
_inherits(TextArray, _PureComponent);
|
|
3714
|
+
|
|
3715
|
+
var _super = _createSuper(TextArray);
|
|
3716
|
+
|
|
3717
|
+
function TextArray() {
|
|
3718
|
+
var _this;
|
|
3719
|
+
|
|
3720
|
+
_classCallCheck$1(this, TextArray);
|
|
3721
|
+
|
|
3722
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
3723
|
+
args[_key] = arguments[_key];
|
|
3724
|
+
}
|
|
3725
|
+
|
|
3726
|
+
_this = _super.call.apply(_super, [this].concat(args));
|
|
3727
|
+
|
|
3728
|
+
_defineProperty$2(_assertThisInitialized(_this), "value", []);
|
|
3729
|
+
|
|
3730
|
+
_defineProperty$2(_assertThisInitialized(_this), "onChange", function (i, e) {
|
|
3731
|
+
var _this$props$onChange, _this$props;
|
|
3732
|
+
|
|
3733
|
+
var val = e.target.value;
|
|
3734
|
+
|
|
3735
|
+
var value = _toConsumableArray(_this.value);
|
|
3736
|
+
|
|
3737
|
+
value[i] = val;
|
|
3738
|
+
(_this$props$onChange = (_this$props = _this.props).onChange) === null || _this$props$onChange === void 0 ? void 0 : _this$props$onChange.call(_this$props, value);
|
|
3739
|
+
});
|
|
3740
|
+
|
|
3741
|
+
_defineProperty$2(_assertThisInitialized(_this), "onAdd", function (i) {
|
|
3742
|
+
var _this$props$onChange2, _this$props2;
|
|
3743
|
+
|
|
3744
|
+
var value = _toConsumableArray(_this.value);
|
|
3745
|
+
|
|
3746
|
+
value.splice(i + 1, 0, '');
|
|
3747
|
+
(_this$props$onChange2 = (_this$props2 = _this.props).onChange) === null || _this$props$onChange2 === void 0 ? void 0 : _this$props$onChange2.call(_this$props2, value);
|
|
3748
|
+
});
|
|
3749
|
+
|
|
3750
|
+
_defineProperty$2(_assertThisInitialized(_this), "onDel", function (i) {
|
|
3751
|
+
var _this$props$onChange3, _this$props3;
|
|
3752
|
+
|
|
3753
|
+
var value = _toConsumableArray(_this.value);
|
|
3754
|
+
|
|
3755
|
+
value.splice(i, 1);
|
|
3756
|
+
(_this$props$onChange3 = (_this$props3 = _this.props).onChange) === null || _this$props$onChange3 === void 0 ? void 0 : _this$props$onChange3.call(_this$props3, value);
|
|
3757
|
+
});
|
|
3758
|
+
|
|
3759
|
+
return _this;
|
|
3760
|
+
}
|
|
3761
|
+
|
|
3762
|
+
_createClass$1(TextArray, [{
|
|
3763
|
+
key: "render",
|
|
3764
|
+
value: function render() {
|
|
3765
|
+
var _this2 = this;
|
|
3766
|
+
|
|
3767
|
+
this.value = this.props.value || [];
|
|
3768
|
+
if (!this.value.length) this.value.push('');
|
|
3769
|
+
return /*#__PURE__*/React__default["default"].createElement("div", {
|
|
3770
|
+
className: classnames('param-text-array', {
|
|
3771
|
+
readonly: this.props.readonly
|
|
3772
|
+
}, this.props.className),
|
|
3773
|
+
style: this.props.style
|
|
3774
|
+
}, this.props.readonly ? /*#__PURE__*/React__default["default"].createElement("span", {
|
|
3775
|
+
className: "param-text-array-val"
|
|
3776
|
+
}, this.value.filter(Boolean).join(', ') || '-') : this.value.map(function (it, i) {
|
|
3777
|
+
return /*#__PURE__*/React__default["default"].createElement("div", {
|
|
3778
|
+
className: "param-arr-item",
|
|
3779
|
+
key: i
|
|
3780
|
+
}, /*#__PURE__*/React__default["default"].createElement("input", {
|
|
3781
|
+
type: "text",
|
|
3782
|
+
placeholder: "Phone",
|
|
3783
|
+
value: it,
|
|
3784
|
+
onChange: _this2.onChange.bind(null, i),
|
|
3785
|
+
onBlur: _this2.props.onBlur
|
|
3786
|
+
}), /*#__PURE__*/React__default["default"].createElement("div", {
|
|
3787
|
+
className: "param-arr-ops"
|
|
3788
|
+
}, /*#__PURE__*/React__default["default"].createElement(PlusOutlined$1, {
|
|
3789
|
+
className: "param-arr-ops-add",
|
|
3790
|
+
onClick: _this2.onAdd.bind(null, i)
|
|
3791
|
+
}), /*#__PURE__*/React__default["default"].createElement(DeleteOutlined$1, {
|
|
3792
|
+
className: "param-arr-ops-del",
|
|
3793
|
+
onClick: _this2.onDel.bind(null, i)
|
|
3794
|
+
})));
|
|
3795
|
+
}));
|
|
3796
|
+
}
|
|
3797
|
+
}]);
|
|
3798
|
+
|
|
3799
|
+
return TextArray;
|
|
3800
|
+
}(React.PureComponent);
|
|
3801
|
+
|
|
3802
|
+
var Expiries = /*#__PURE__*/function (_PureComponent) {
|
|
3803
|
+
_inherits(Expiries, _PureComponent);
|
|
3804
|
+
|
|
3805
|
+
var _super = _createSuper(Expiries);
|
|
3806
|
+
|
|
3807
|
+
function Expiries() {
|
|
3808
|
+
var _this;
|
|
3809
|
+
|
|
3810
|
+
_classCallCheck$1(this, Expiries);
|
|
3811
|
+
|
|
3812
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
3813
|
+
args[_key] = arguments[_key];
|
|
3814
|
+
}
|
|
3815
|
+
|
|
3816
|
+
_this = _super.call.apply(_super, [this].concat(args));
|
|
3817
|
+
|
|
3818
|
+
_defineProperty$2(_assertThisInitialized(_this), "state", {
|
|
3819
|
+
visible: false
|
|
3820
|
+
});
|
|
3821
|
+
|
|
3822
|
+
_defineProperty$2(_assertThisInitialized(_this), "handleVisibleChange", function (visible) {
|
|
3823
|
+
return _this.setState({
|
|
3824
|
+
visible: visible
|
|
3825
|
+
});
|
|
3826
|
+
});
|
|
3827
|
+
|
|
3828
|
+
_defineProperty$2(_assertThisInitialized(_this), "onChange", function (val) {
|
|
3829
|
+
var _this$props$onChange, _this$props, _this$props$onBlur, _this$props2;
|
|
3830
|
+
|
|
3831
|
+
var value = _toConsumableArray(_this.props.value || []);
|
|
3832
|
+
|
|
3833
|
+
if (_this.props.multiple !== false) {
|
|
3834
|
+
var index = value.findIndex(function (it) {
|
|
3835
|
+
return it === val;
|
|
3836
|
+
});
|
|
3837
|
+
if (index > -1) value.splice(index, 1);else value.push(val);
|
|
3838
|
+
} else {
|
|
3839
|
+
value = [val];
|
|
3840
|
+
}
|
|
3841
|
+
|
|
3842
|
+
(_this$props$onChange = (_this$props = _this.props).onChange) === null || _this$props$onChange === void 0 ? void 0 : _this$props$onChange.call(_this$props, value);
|
|
3843
|
+
(_this$props$onBlur = (_this$props2 = _this.props).onBlur) === null || _this$props$onBlur === void 0 ? void 0 : _this$props$onBlur.call(_this$props2);
|
|
3844
|
+
if (_this.props.multiple === false) _this.handleVisibleChange(false);
|
|
3845
|
+
});
|
|
3846
|
+
|
|
3847
|
+
return _this;
|
|
3848
|
+
}
|
|
3849
|
+
|
|
3850
|
+
_createClass$1(Expiries, [{
|
|
3851
|
+
key: "renderValue",
|
|
3852
|
+
value: function renderValue() {
|
|
3853
|
+
var _this$props$value,
|
|
3854
|
+
_this2 = this;
|
|
3855
|
+
|
|
3856
|
+
var value = (_this$props$value = this.props.value) === null || _this$props$value === void 0 ? void 0 : _this$props$value.filter(function (it) {
|
|
3857
|
+
return it && !isExpired(it);
|
|
3858
|
+
});
|
|
3859
|
+
|
|
3860
|
+
if (this.props.readonly) {
|
|
3861
|
+
return /*#__PURE__*/React__default["default"].createElement("span", {
|
|
3862
|
+
className: "param-expiries-val"
|
|
3863
|
+
}, (value === null || value === void 0 ? void 0 : value.join(', ')) || '-');
|
|
3864
|
+
}
|
|
3865
|
+
|
|
3866
|
+
var placeholder = /*#__PURE__*/React__default["default"].createElement("span", {
|
|
3867
|
+
className: "param-expiries-placeholder"
|
|
3868
|
+
}, "Choose an expiry");
|
|
3869
|
+
|
|
3870
|
+
if (this.props.multiple === false) {
|
|
3871
|
+
var _this$props$value2;
|
|
3872
|
+
|
|
3873
|
+
var _val = (_this$props$value2 = this.props.value) === null || _this$props$value2 === void 0 ? void 0 : _this$props$value2[0];
|
|
3874
|
+
|
|
3875
|
+
return !_val || isExpired(_val) ? placeholder : /*#__PURE__*/React__default["default"].createElement("span", {
|
|
3876
|
+
className: "param-expiries-val"
|
|
3877
|
+
}, _val);
|
|
3878
|
+
}
|
|
3879
|
+
|
|
3880
|
+
if (!(value === null || value === void 0 ? void 0 : value.length)) return placeholder;
|
|
3881
|
+
return value.map(function (it) {
|
|
3882
|
+
return /*#__PURE__*/React__default["default"].createElement("span", {
|
|
3883
|
+
className: "param-expiries-multi-val",
|
|
3884
|
+
key: it,
|
|
3885
|
+
onClick: function onClick(e) {
|
|
3886
|
+
return e.stopPropagation();
|
|
3887
|
+
}
|
|
3888
|
+
}, it, /*#__PURE__*/React__default["default"].createElement(CloseOutlined$1, {
|
|
3889
|
+
onClick: _this2.onChange.bind(null, it)
|
|
3890
|
+
}));
|
|
3891
|
+
});
|
|
3892
|
+
}
|
|
3893
|
+
}, {
|
|
3894
|
+
key: "render",
|
|
3895
|
+
value: function render() {
|
|
3896
|
+
var _this$props$options,
|
|
3897
|
+
_this3 = this;
|
|
3898
|
+
|
|
3899
|
+
return /*#__PURE__*/React__default["default"].createElement(antd.Popover, {
|
|
3900
|
+
overlayClassName: "param-expiries-popover",
|
|
3901
|
+
trigger: 'click',
|
|
3902
|
+
placement: 'bottomLeft',
|
|
3903
|
+
visible: !this.props.readonly && this.state.visible,
|
|
3904
|
+
onVisibleChange: this.handleVisibleChange,
|
|
3905
|
+
content: (_this$props$options = this.props.options) === null || _this$props$options === void 0 ? void 0 : _this$props$options.map(function (it) {
|
|
3906
|
+
var _this3$props$value, _this3$props$calcDisa, _this3$props, _this3$onChange;
|
|
3907
|
+
|
|
3908
|
+
var checked = (_this3$props$value = _this3.props.value) === null || _this3$props$value === void 0 ? void 0 : _this3$props$value.includes(it);
|
|
3909
|
+
var disabled = (_this3$props$calcDisa = (_this3$props = _this3.props).calcDisabled) === null || _this3$props$calcDisa === void 0 ? void 0 : _this3$props$calcDisa.call(_this3$props, it);
|
|
3910
|
+
return /*#__PURE__*/React__default["default"].createElement("div", {
|
|
3911
|
+
className: classnames('param-expiries-option', {
|
|
3912
|
+
'param-expiries-option-checked': checked,
|
|
3913
|
+
'param-expiries-option-disabled': disabled
|
|
3914
|
+
}),
|
|
3915
|
+
key: it,
|
|
3916
|
+
onClick: disabled ? undefined : (_this3$onChange = _this3.onChange) === null || _this3$onChange === void 0 ? void 0 : _this3$onChange.bind(null, it)
|
|
3917
|
+
}, it, checked && /*#__PURE__*/React__default["default"].createElement(CheckOutlined$1, null));
|
|
3918
|
+
})
|
|
3919
|
+
}, /*#__PURE__*/React__default["default"].createElement("div", {
|
|
3920
|
+
className: classnames('param-expiries', {
|
|
3921
|
+
readonly: this.props.readonly,
|
|
3922
|
+
multiple: this.props.multiple !== false
|
|
3923
|
+
}, this.props.className),
|
|
3924
|
+
style: this.props.style
|
|
3925
|
+
}, this.renderValue(), !this.props.readonly && this.props.options && /*#__PURE__*/React__default["default"].createElement(DownOutlined$1, {
|
|
3926
|
+
className: "param-expiries-arrow"
|
|
3927
|
+
})));
|
|
3928
|
+
}
|
|
3929
|
+
}]);
|
|
3930
|
+
|
|
3931
|
+
return Expiries;
|
|
3932
|
+
}(React.PureComponent);
|
|
3933
|
+
|
|
3934
|
+
var ExpiriesLimit = /*#__PURE__*/function (_PureComponent) {
|
|
3935
|
+
_inherits(ExpiriesLimit, _PureComponent);
|
|
3936
|
+
|
|
3937
|
+
var _super = _createSuper(ExpiriesLimit);
|
|
3938
|
+
|
|
3939
|
+
function ExpiriesLimit() {
|
|
3940
|
+
var _this;
|
|
3941
|
+
|
|
3942
|
+
_classCallCheck$1(this, ExpiriesLimit);
|
|
3943
|
+
|
|
3944
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
3945
|
+
args[_key] = arguments[_key];
|
|
3946
|
+
}
|
|
3947
|
+
|
|
3948
|
+
_this = _super.call.apply(_super, [this].concat(args));
|
|
3949
|
+
|
|
3950
|
+
_defineProperty$2(_assertThisInitialized(_this), "value", []);
|
|
3951
|
+
|
|
3952
|
+
_defineProperty$2(_assertThisInitialized(_this), "onChange", function (i, val, key) {
|
|
3953
|
+
var _this$props$onChange, _this$props;
|
|
3954
|
+
|
|
3955
|
+
var value = _toConsumableArray(_this.value);
|
|
3956
|
+
|
|
3957
|
+
if (!value[i]) value[i] = {
|
|
3958
|
+
expiry: ''
|
|
3959
|
+
};
|
|
3960
|
+
if (key) value[i][key] = val;else value[i] = _objectSpread2$2(_objectSpread2$2({}, value[i]), val);
|
|
3961
|
+
(_this$props$onChange = (_this$props = _this.props).onChange) === null || _this$props$onChange === void 0 ? void 0 : _this$props$onChange.call(_this$props, value);
|
|
3962
|
+
});
|
|
3963
|
+
|
|
3964
|
+
_defineProperty$2(_assertThisInitialized(_this), "onAdd", function (i) {
|
|
3965
|
+
var _this$props$onChange2, _this$props2, _this$props$onBlur, _this$props3;
|
|
3966
|
+
|
|
3967
|
+
var value = _toConsumableArray(_this.value);
|
|
3968
|
+
|
|
3969
|
+
value.splice(i + 1, 0, {
|
|
3970
|
+
expiry: ''
|
|
3971
|
+
});
|
|
3972
|
+
(_this$props$onChange2 = (_this$props2 = _this.props).onChange) === null || _this$props$onChange2 === void 0 ? void 0 : _this$props$onChange2.call(_this$props2, value);
|
|
3973
|
+
(_this$props$onBlur = (_this$props3 = _this.props).onBlur) === null || _this$props$onBlur === void 0 ? void 0 : _this$props$onBlur.call(_this$props3);
|
|
3974
|
+
});
|
|
3975
|
+
|
|
3976
|
+
_defineProperty$2(_assertThisInitialized(_this), "onDel", function (i) {
|
|
3977
|
+
var _this$props$onChange3, _this$props4, _this$props$onBlur2, _this$props5;
|
|
3978
|
+
|
|
3979
|
+
var value = _toConsumableArray(_this.value);
|
|
3980
|
+
|
|
3981
|
+
value.splice(i, 1);
|
|
3982
|
+
(_this$props$onChange3 = (_this$props4 = _this.props).onChange) === null || _this$props$onChange3 === void 0 ? void 0 : _this$props$onChange3.call(_this$props4, value);
|
|
3983
|
+
(_this$props$onBlur2 = (_this$props5 = _this.props).onBlur) === null || _this$props$onBlur2 === void 0 ? void 0 : _this$props$onBlur2.call(_this$props5);
|
|
3984
|
+
});
|
|
3985
|
+
|
|
3986
|
+
return _this;
|
|
3987
|
+
}
|
|
3988
|
+
|
|
3989
|
+
_createClass$1(ExpiriesLimit, [{
|
|
3990
|
+
key: "render",
|
|
3991
|
+
value: function render() {
|
|
3992
|
+
var _this$props$value,
|
|
3993
|
+
_this$props$value2,
|
|
3994
|
+
_this2 = this;
|
|
3995
|
+
|
|
3996
|
+
this.value = ((_this$props$value = this.props.value) === null || _this$props$value === void 0 ? void 0 : _this$props$value.filter(function (it) {
|
|
3997
|
+
return !isExpired(it.expiry);
|
|
3998
|
+
})) || [];
|
|
3999
|
+
if (!this.value.length) this.value.push({
|
|
4000
|
+
expiry: ''
|
|
4001
|
+
});
|
|
4002
|
+
return /*#__PURE__*/React__default["default"].createElement("div", {
|
|
4003
|
+
className: classnames('param-expiries-limit', {
|
|
4004
|
+
readonly: this.props.readonly
|
|
4005
|
+
}, this.props.className),
|
|
4006
|
+
style: this.props.style
|
|
4007
|
+
}, this.props.readonly ? ((_this$props$value2 = this.props.value) === null || _this$props$value2 === void 0 ? void 0 : _this$props$value2.length) ? this.value.filter(function (it) {
|
|
4008
|
+
return it.expiry;
|
|
4009
|
+
}).map(function (it, i) {
|
|
4010
|
+
return /*#__PURE__*/React__default["default"].createElement("span", {
|
|
4011
|
+
className: "param-expiries-limit-val",
|
|
4012
|
+
key: i
|
|
4013
|
+
}, it.expiry, /*#__PURE__*/React__default["default"].createElement("span", {
|
|
4014
|
+
className: "param-expiries-limit-val-sep"
|
|
4015
|
+
}, "/"), it.minAumPercentage && it.maxAumPercentage ? "(".concat(NumCvt.show(it.minAumPercentage, true), "%, ").concat(NumCvt.show(it.maxAumPercentage, true), "%)") : '-', /*#__PURE__*/React__default["default"].createElement("span", {
|
|
4016
|
+
className: "param-expiries-limit-val-sep"
|
|
4017
|
+
}, "/"), it.minAbs && it.maxAbs ? "(".concat(it.minAbs, ", ").concat(it.maxAbs, ")") : '-');
|
|
4018
|
+
}) : '-' : /*#__PURE__*/React__default["default"].createElement("div", {
|
|
4019
|
+
className: "param-expiries-limit-inputs"
|
|
4020
|
+
}, /*#__PURE__*/React__default["default"].createElement("div", {
|
|
4021
|
+
className: "param-expiries readonly"
|
|
4022
|
+
}, /*#__PURE__*/React__default["default"].createElement("span", {
|
|
4023
|
+
className: "param-expiries-val"
|
|
4024
|
+
}, "Expiry")), /*#__PURE__*/React__default["default"].createElement("div", {
|
|
4025
|
+
className: "param-number-range readonly"
|
|
4026
|
+
}, "Limit(% of AUM)"), /*#__PURE__*/React__default["default"].createElement("div", {
|
|
4027
|
+
className: "param-number-range readonly"
|
|
4028
|
+
}, "Limit(ABS)"), /*#__PURE__*/React__default["default"].createElement("div", {
|
|
4029
|
+
className: "param-arr-ops readonly"
|
|
4030
|
+
}), this.value.map(function (it, i) {
|
|
4031
|
+
return /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, {
|
|
4032
|
+
key: i
|
|
4033
|
+
}, /*#__PURE__*/React__default["default"].createElement(Expiries, {
|
|
4034
|
+
multiple: false,
|
|
4035
|
+
options: _this2.props.options,
|
|
4036
|
+
value: [it.expiry],
|
|
4037
|
+
onChange: function onChange(val) {
|
|
4038
|
+
return _this2.onChange(i, val[0], 'expiry');
|
|
4039
|
+
},
|
|
4040
|
+
calcDisabled: function calcDisabled(expiry) {
|
|
4041
|
+
return _this2.value.some(function (item) {
|
|
4042
|
+
return item !== it && item.expiry === expiry;
|
|
4043
|
+
});
|
|
4044
|
+
},
|
|
4045
|
+
onBlur: _this2.props.onBlur
|
|
4046
|
+
}), /*#__PURE__*/React__default["default"].createElement(NumRange, {
|
|
4047
|
+
value: {
|
|
4048
|
+
min: it.minAumPercentage,
|
|
4049
|
+
max: it.maxAumPercentage
|
|
4050
|
+
},
|
|
4051
|
+
onChange: function onChange(val) {
|
|
4052
|
+
return _this2.onChange(i, {
|
|
4053
|
+
minAumPercentage: val === null || val === void 0 ? void 0 : val.min,
|
|
4054
|
+
maxAumPercentage: val === null || val === void 0 ? void 0 : val.max
|
|
4055
|
+
});
|
|
4056
|
+
},
|
|
4057
|
+
isPercentage: true,
|
|
4058
|
+
onBlur: _this2.props.onBlur
|
|
4059
|
+
}), /*#__PURE__*/React__default["default"].createElement(NumRange, {
|
|
4060
|
+
value: {
|
|
4061
|
+
min: it.minAbs,
|
|
4062
|
+
max: it.maxAbs
|
|
4063
|
+
},
|
|
4064
|
+
onChange: function onChange(val) {
|
|
4065
|
+
return _this2.onChange(i, {
|
|
4066
|
+
minAbs: val === null || val === void 0 ? void 0 : val.min,
|
|
4067
|
+
maxAbs: val === null || val === void 0 ? void 0 : val.max
|
|
4068
|
+
});
|
|
4069
|
+
},
|
|
4070
|
+
onBlur: _this2.props.onBlur
|
|
4071
|
+
}), /*#__PURE__*/React__default["default"].createElement("div", {
|
|
4072
|
+
className: "param-arr-ops"
|
|
4073
|
+
}, /*#__PURE__*/React__default["default"].createElement(PlusOutlined$1, {
|
|
4074
|
+
className: "param-arr-ops-add",
|
|
4075
|
+
onClick: _this2.onAdd.bind(null, i)
|
|
4076
|
+
}), /*#__PURE__*/React__default["default"].createElement(DeleteOutlined$1, {
|
|
4077
|
+
className: "param-arr-ops-del",
|
|
4078
|
+
onClick: _this2.onDel.bind(null, i)
|
|
4079
|
+
})));
|
|
4080
|
+
})));
|
|
4081
|
+
}
|
|
4082
|
+
}]);
|
|
4083
|
+
|
|
4084
|
+
return ExpiriesLimit;
|
|
4085
|
+
}(React.PureComponent);
|
|
4086
|
+
|
|
4087
|
+
var _ParamTypeConfig;
|
|
4088
|
+
var ParamTypeConfig = (_ParamTypeConfig = {}, _defineProperty$2(_ParamTypeConfig, exports.ParamType.ParamGroup, {
|
|
4089
|
+
name: '参数组',
|
|
4090
|
+
Comp: function Comp() {
|
|
4091
|
+
return /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null);
|
|
4092
|
+
}
|
|
4093
|
+
}), _defineProperty$2(_ParamTypeConfig, exports.ParamType.Number, {
|
|
4094
|
+
name: '普通数值',
|
|
4095
|
+
key: 'number',
|
|
4096
|
+
Comp: Num,
|
|
4097
|
+
validator: emptyValidator
|
|
4098
|
+
}), _defineProperty$2(_ParamTypeConfig, exports.ParamType.Percentage, {
|
|
4099
|
+
name: '百分比数值',
|
|
4100
|
+
key: 'number',
|
|
4101
|
+
Comp: function Comp(props) {
|
|
4102
|
+
return /*#__PURE__*/React__default["default"].createElement(Num, Object.assign({}, props, {
|
|
4103
|
+
isPercentage: true
|
|
4104
|
+
}));
|
|
4105
|
+
},
|
|
4106
|
+
validator: emptyValidator
|
|
4107
|
+
}), _defineProperty$2(_ParamTypeConfig, exports.ParamType.Bool, {
|
|
4108
|
+
name: 'TRUE/FALSE',
|
|
4109
|
+
key: 'bool',
|
|
4110
|
+
Comp: Bool,
|
|
4111
|
+
validator: emptyValidator
|
|
4112
|
+
}), _defineProperty$2(_ParamTypeConfig, exports.ParamType.NumberRange, {
|
|
4113
|
+
name: '数值范围',
|
|
4114
|
+
key: 'range',
|
|
4115
|
+
Comp: NumRange,
|
|
4116
|
+
validator: numRangeValidator
|
|
4117
|
+
}), _defineProperty$2(_ParamTypeConfig, exports.ParamType.PercentageRange, {
|
|
4118
|
+
name: '百分比范围',
|
|
4119
|
+
key: 'range',
|
|
4120
|
+
Comp: function Comp(props) {
|
|
4121
|
+
return /*#__PURE__*/React__default["default"].createElement(NumRange, Object.assign({}, props, {
|
|
4122
|
+
isPercentage: true
|
|
4123
|
+
}));
|
|
4124
|
+
},
|
|
4125
|
+
validator: numRangeValidator
|
|
4126
|
+
}), _defineProperty$2(_ParamTypeConfig, exports.ParamType.ExpiryLimit, {
|
|
4127
|
+
name: '到期日 Limit',
|
|
4128
|
+
key: 'expiryLimitList',
|
|
4129
|
+
Comp: ExpiriesLimit,
|
|
4130
|
+
validator: function validator($val) {
|
|
4131
|
+
for (var i = 0; i < $val.length; i++) {
|
|
4132
|
+
var val = $val[i];
|
|
4133
|
+
var error = expiryValidator(val === null || val === void 0 ? void 0 : val.expiry);
|
|
4134
|
+
|
|
4135
|
+
if (error) {
|
|
4136
|
+
// return { [i]: { expire: error } }
|
|
4137
|
+
return "Expiry field of the ".concat(i + 1, "th item: ").concat(error);
|
|
4138
|
+
}
|
|
4139
|
+
|
|
4140
|
+
if (isNullLike(val === null || val === void 0 ? void 0 : val.minAumPercentage) && isNullLike(val === null || val === void 0 ? void 0 : val.maxAumPercentage) && isNullLike(val === null || val === void 0 ? void 0 : val.minAbs) && isNullLike(val === null || val === void 0 ? void 0 : val.maxAbs)) {
|
|
4141
|
+
// return {
|
|
4142
|
+
// [i]: 'at least one parameter must be specified between AUM and ABS',
|
|
4143
|
+
// }
|
|
4144
|
+
return "The ".concat(i + 1, "th item: at least one parameter must be specified between AUM and ABS");
|
|
4145
|
+
}
|
|
4146
|
+
|
|
4147
|
+
if (val.minAbs > val.maxAbs) // return { [i]: { minAbs: 'Min ABS should smaller than Max ABS' } }
|
|
4148
|
+
return "The ".concat(i + 1, "th item: Min ABS should smaller than Max ABS");
|
|
4149
|
+
|
|
4150
|
+
if (val.minAumPercentage > val.maxAumPercentage) {
|
|
4151
|
+
// return {
|
|
4152
|
+
// [i]: { minAumPercentage: 'Min AUM should smaller than Max AUM' },
|
|
4153
|
+
// }
|
|
4154
|
+
return "The ".concat(i + 1, "th item: Min AUM should smaller than Max AUM");
|
|
4155
|
+
}
|
|
4156
|
+
}
|
|
4157
|
+
|
|
4158
|
+
return '';
|
|
4159
|
+
}
|
|
4160
|
+
}), _defineProperty$2(_ParamTypeConfig, exports.ParamType.Expiry, {
|
|
4161
|
+
name: '到期日',
|
|
4162
|
+
key: 'list',
|
|
4163
|
+
Comp: Expiries,
|
|
4164
|
+
validator: expiriesValidator
|
|
4165
|
+
}), _defineProperty$2(_ParamTypeConfig, exports.ParamType.Phone, {
|
|
4166
|
+
name: '联系人电话',
|
|
4167
|
+
key: 'list',
|
|
4168
|
+
Comp: TextArray
|
|
4169
|
+
}), _ParamTypeConfig);
|
|
4170
|
+
function paramValidator(val, values) {
|
|
4171
|
+
var _config$validator;
|
|
4172
|
+
|
|
4173
|
+
var config = ParamTypeConfig[values.valueType];
|
|
4174
|
+
console.log();
|
|
4175
|
+
if (!config) return '';
|
|
4176
|
+
var value = config.key ? val === null || val === void 0 ? void 0 : val[config.key] : val;
|
|
4177
|
+
return ((_config$validator = config.validator) === null || _config$validator === void 0 ? void 0 : _config$validator.call(config, value)) || '';
|
|
4178
|
+
}
|
|
4179
|
+
var ParamTypeOptions = Object.entries(ParamTypeConfig).map(function (_ref) {
|
|
4180
|
+
var _ref2 = _slicedToArray$1(_ref, 2),
|
|
4181
|
+
value = _ref2[0],
|
|
4182
|
+
config = _ref2[1];
|
|
4183
|
+
|
|
4184
|
+
return _objectSpread2$2(_objectSpread2$2({}, config), {}, {
|
|
4185
|
+
value: value,
|
|
4186
|
+
label: config.name
|
|
4187
|
+
});
|
|
4188
|
+
});
|
|
4189
|
+
|
|
4190
|
+
var ParamRenderer = /*#__PURE__*/function (_PureComponent) {
|
|
4191
|
+
_inherits(ParamRenderer, _PureComponent);
|
|
4192
|
+
|
|
4193
|
+
var _super = _createSuper(ParamRenderer);
|
|
4194
|
+
|
|
4195
|
+
function ParamRenderer() {
|
|
4196
|
+
var _this;
|
|
4197
|
+
|
|
4198
|
+
_classCallCheck$1(this, ParamRenderer);
|
|
4199
|
+
|
|
4200
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
4201
|
+
args[_key] = arguments[_key];
|
|
4202
|
+
}
|
|
4203
|
+
|
|
4204
|
+
_this = _super.call.apply(_super, [this].concat(args));
|
|
4205
|
+
|
|
4206
|
+
_defineProperty$2(_assertThisInitialized(_this), "onChange", function (val) {
|
|
4207
|
+
var _this$props$onChange, _this$props;
|
|
4208
|
+
|
|
4209
|
+
var value = _this.typeConfig.key ? _objectSpread2$2(_objectSpread2$2({}, _this.props.value), {}, _defineProperty$2({}, _this.typeConfig.key, val)) : val;
|
|
4210
|
+
(_this$props$onChange = (_this$props = _this.props).onChange) === null || _this$props$onChange === void 0 ? void 0 : _this$props$onChange.call(_this$props, value);
|
|
4211
|
+
});
|
|
4212
|
+
|
|
4213
|
+
return _this;
|
|
4214
|
+
}
|
|
4215
|
+
|
|
4216
|
+
_createClass$1(ParamRenderer, [{
|
|
4217
|
+
key: "typeConfig",
|
|
4218
|
+
get: function get() {
|
|
4219
|
+
return ParamTypeConfig[this.props.valueType] || ParamTypeConfig[exports.ParamType.Number];
|
|
4220
|
+
}
|
|
4221
|
+
}, {
|
|
4222
|
+
key: "value",
|
|
4223
|
+
get: function get() {
|
|
4224
|
+
var _this$props$value;
|
|
4225
|
+
|
|
4226
|
+
return this.typeConfig.key ? (_this$props$value = this.props.value) === null || _this$props$value === void 0 ? void 0 : _this$props$value[this.typeConfig.key] : this.props.value;
|
|
4227
|
+
}
|
|
4228
|
+
}, {
|
|
4229
|
+
key: "render",
|
|
4230
|
+
value: function render() {
|
|
4231
|
+
var Comp = this.typeConfig.Comp;
|
|
4232
|
+
return /*#__PURE__*/React__default["default"].createElement(Comp, Object.assign({}, this.props, {
|
|
4233
|
+
value: this.value,
|
|
4234
|
+
onChange: this.onChange,
|
|
4235
|
+
className: classnames('param-renderer', this.props.className)
|
|
4236
|
+
}));
|
|
4237
|
+
}
|
|
4238
|
+
}]);
|
|
4239
|
+
|
|
4240
|
+
return ParamRenderer;
|
|
4241
|
+
}(React.PureComponent);
|
|
4242
|
+
|
|
4243
|
+
function ParentSelector(props) {
|
|
4244
|
+
var value = React.useMemo(function () {
|
|
4245
|
+
var _props$parentOptions;
|
|
4246
|
+
|
|
4247
|
+
var $value = [];
|
|
4248
|
+
|
|
4249
|
+
var find = function find(item) {
|
|
4250
|
+
var _item$children;
|
|
4251
|
+
|
|
4252
|
+
var index = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
|
|
4253
|
+
$value[index] = item.value;
|
|
4254
|
+
$value.length = index + 1;
|
|
4255
|
+
if (String(item.value) === String(props.value)) return true;
|
|
4256
|
+
return Boolean((_item$children = item.children) === null || _item$children === void 0 ? void 0 : _item$children.some(function (it) {
|
|
4257
|
+
return find(it, index + 1);
|
|
4258
|
+
}));
|
|
4259
|
+
};
|
|
4260
|
+
|
|
4261
|
+
var matched = props.value && ((_props$parentOptions = props.parentOptions) === null || _props$parentOptions === void 0 ? void 0 : _props$parentOptions.some(function (it) {
|
|
4262
|
+
return find(it);
|
|
4263
|
+
}));
|
|
4264
|
+
if (!matched) return [];
|
|
4265
|
+
return $value;
|
|
4266
|
+
}, [props.parentOptions, props.value]);
|
|
4267
|
+
return /*#__PURE__*/React__default["default"].createElement(antd.Cascader, Object.assign({}, props, {
|
|
4268
|
+
disabled: props.readonly,
|
|
4269
|
+
placeholder: '请选择',
|
|
4270
|
+
options: props.parentOptions,
|
|
4271
|
+
className: classnames('param-parent-selector', {
|
|
4272
|
+
readonly: props.readonly
|
|
4273
|
+
}, props.className),
|
|
4274
|
+
value: value,
|
|
4275
|
+
onChange: function onChange(val) {
|
|
4276
|
+
var _props$onChange;
|
|
4277
|
+
|
|
4278
|
+
return (_props$onChange = props.onChange) === null || _props$onChange === void 0 ? void 0 : _props$onChange.call(props, val.pop());
|
|
4279
|
+
}
|
|
4280
|
+
}));
|
|
4281
|
+
}
|
|
4282
|
+
|
|
4283
|
+
/**
|
|
4284
|
+
* Bundle of react-global-comp
|
|
4285
|
+
* Generated: 2022-04-07
|
|
4286
|
+
* Version: 2.0.4
|
|
4287
|
+
* License: MIT
|
|
4288
|
+
* Author: 2631541504@qq.com
|
|
4289
|
+
*/
|
|
4290
|
+
|
|
4291
|
+
function _defineProperty(obj, key, value) {
|
|
4292
|
+
if (key in obj) {
|
|
4293
|
+
Object.defineProperty(obj, key, {
|
|
4294
|
+
value: value,
|
|
4295
|
+
enumerable: true,
|
|
4296
|
+
configurable: true,
|
|
4297
|
+
writable: true
|
|
4298
|
+
});
|
|
4299
|
+
} else {
|
|
4300
|
+
obj[key] = value;
|
|
4301
|
+
}
|
|
4302
|
+
|
|
4303
|
+
return obj;
|
|
4304
|
+
}
|
|
4305
|
+
|
|
4306
|
+
function ownKeys(object, enumerableOnly) {
|
|
4307
|
+
var keys = Object.keys(object);
|
|
4308
|
+
|
|
4309
|
+
if (Object.getOwnPropertySymbols) {
|
|
4310
|
+
var symbols = Object.getOwnPropertySymbols(object);
|
|
4311
|
+
if (enumerableOnly) symbols = symbols.filter(function (sym) {
|
|
4312
|
+
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
|
|
4313
|
+
});
|
|
4314
|
+
keys.push.apply(keys, symbols);
|
|
4315
|
+
}
|
|
4316
|
+
|
|
4317
|
+
return keys;
|
|
4318
|
+
}
|
|
4319
|
+
|
|
4320
|
+
function _objectSpread2(target) {
|
|
4321
|
+
for (var i = 1; i < arguments.length; i++) {
|
|
4322
|
+
var source = arguments[i] != null ? arguments[i] : {};
|
|
4323
|
+
|
|
4324
|
+
if (i % 2) {
|
|
4325
|
+
ownKeys(Object(source), true).forEach(function (key) {
|
|
4326
|
+
_defineProperty(target, key, source[key]);
|
|
4327
|
+
});
|
|
4328
|
+
} else if (Object.getOwnPropertyDescriptors) {
|
|
4329
|
+
Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
|
|
4330
|
+
} else {
|
|
4331
|
+
ownKeys(Object(source)).forEach(function (key) {
|
|
4332
|
+
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
4333
|
+
});
|
|
4334
|
+
}
|
|
4335
|
+
}
|
|
4336
|
+
|
|
4337
|
+
return target;
|
|
4338
|
+
}
|
|
4339
|
+
|
|
4340
|
+
function _classCallCheck(instance, Constructor) {
|
|
4341
|
+
if (!(instance instanceof Constructor)) {
|
|
4342
|
+
throw new TypeError("Cannot call a class as a function");
|
|
4343
|
+
}
|
|
4344
|
+
}
|
|
4345
|
+
|
|
4346
|
+
function _defineProperties(target, props) {
|
|
4347
|
+
for (var i = 0; i < props.length; i++) {
|
|
4348
|
+
var descriptor = props[i];
|
|
4349
|
+
descriptor.enumerable = descriptor.enumerable || false;
|
|
4350
|
+
descriptor.configurable = true;
|
|
4351
|
+
if ("value" in descriptor) descriptor.writable = true;
|
|
4352
|
+
Object.defineProperty(target, descriptor.key, descriptor);
|
|
4353
|
+
}
|
|
4354
|
+
}
|
|
4355
|
+
|
|
4356
|
+
function _createClass(Constructor, protoProps, staticProps) {
|
|
4357
|
+
if (protoProps) _defineProperties(Constructor.prototype, protoProps);
|
|
4358
|
+
if (staticProps) _defineProperties(Constructor, staticProps);
|
|
4359
|
+
return Constructor;
|
|
4360
|
+
}
|
|
4361
|
+
|
|
4362
|
+
var ReactGlobalComp = /*#__PURE__*/function () {
|
|
4363
|
+
function ReactGlobalComp(id, comp) {
|
|
4364
|
+
_classCallCheck(this, ReactGlobalComp);
|
|
4365
|
+
|
|
4366
|
+
_defineProperty(this, "id", void 0);
|
|
4367
|
+
|
|
4368
|
+
_defineProperty(this, "comp", void 0);
|
|
4369
|
+
|
|
4370
|
+
_defineProperty(this, "preProps", void 0);
|
|
4371
|
+
|
|
4372
|
+
_defineProperty(this, "ref", void 0);
|
|
4373
|
+
|
|
4374
|
+
this.id = id;
|
|
4375
|
+
this.comp = comp;
|
|
4376
|
+
}
|
|
4377
|
+
|
|
4378
|
+
_createClass(ReactGlobalComp, [{
|
|
4379
|
+
key: "render",
|
|
4380
|
+
value: function render(props) {
|
|
4381
|
+
var _this = this;
|
|
4382
|
+
|
|
4383
|
+
return new Promise(function (res) {
|
|
4384
|
+
var dom = document.getElementById(_this.id);
|
|
4385
|
+
|
|
4386
|
+
if (!dom) {
|
|
4387
|
+
dom = document.createElement('div');
|
|
4388
|
+
dom.id = _this.id;
|
|
4389
|
+
document.body.appendChild(dom);
|
|
4390
|
+
}
|
|
4391
|
+
|
|
4392
|
+
var $props = _objectSpread2(_objectSpread2({}, _this.preProps), props);
|
|
4393
|
+
|
|
4394
|
+
ReactDOM__default["default"].render(React__default["default"].createElement(_this.comp, _objectSpread2(_objectSpread2({}, $props), {}, {
|
|
4395
|
+
ref: function ref(el) {
|
|
4396
|
+
_this.ref = el;
|
|
4397
|
+
if (typeof $props.ref === 'function') $props.ref(el);else if ($props.ref) $props.ref.current = el;
|
|
4398
|
+
}
|
|
4399
|
+
})), dom, res);
|
|
4400
|
+
});
|
|
4401
|
+
}
|
|
4402
|
+
}]);
|
|
4403
|
+
|
|
4404
|
+
return ReactGlobalComp;
|
|
4405
|
+
}();
|
|
4406
|
+
|
|
4407
|
+
var ParamForm = /*#__PURE__*/function (_PureComponent) {
|
|
4408
|
+
_inherits(ParamForm, _PureComponent);
|
|
4409
|
+
|
|
4410
|
+
var _super = _createSuper(ParamForm);
|
|
4411
|
+
|
|
4412
|
+
function ParamForm() {
|
|
4413
|
+
var _this;
|
|
4414
|
+
|
|
4415
|
+
_classCallCheck$1(this, ParamForm);
|
|
4416
|
+
|
|
4417
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
4418
|
+
args[_key] = arguments[_key];
|
|
4419
|
+
}
|
|
4420
|
+
|
|
4421
|
+
_this = _super.call.apply(_super, [this].concat(args));
|
|
4422
|
+
|
|
4423
|
+
_defineProperty$2(_assertThisInitialized(_this), "ref", React__default["default"].createRef());
|
|
4424
|
+
|
|
4425
|
+
_defineProperty$2(_assertThisInitialized(_this), "formItems", [{
|
|
4426
|
+
label: '所属分组',
|
|
4427
|
+
name: 'parentId',
|
|
4428
|
+
Comp: ParentSelector,
|
|
4429
|
+
required: true,
|
|
4430
|
+
validator: validatorCvt(function (val) {
|
|
4431
|
+
return emptyValidator(val);
|
|
4432
|
+
})
|
|
4433
|
+
}, {
|
|
4434
|
+
label: '参数 Key',
|
|
4435
|
+
name: 'key',
|
|
4436
|
+
Comp: function Comp(props) {
|
|
4437
|
+
return /*#__PURE__*/React__default["default"].createElement(antd.Input, Object.assign({
|
|
4438
|
+
placeholder: '请输入'
|
|
4439
|
+
}, props));
|
|
4440
|
+
},
|
|
4441
|
+
required: true,
|
|
4442
|
+
validator: validatorCvt(keyValidator)
|
|
4443
|
+
}, {
|
|
4444
|
+
label: '参数名称',
|
|
4445
|
+
name: 'name',
|
|
4446
|
+
Comp: function Comp(props) {
|
|
4447
|
+
return /*#__PURE__*/React__default["default"].createElement(antd.Input, Object.assign({
|
|
4448
|
+
placeholder: '请输入'
|
|
4449
|
+
}, props));
|
|
4450
|
+
}
|
|
4451
|
+
}, {
|
|
4452
|
+
label: '参数类型',
|
|
4453
|
+
name: 'valueType',
|
|
4454
|
+
Comp: function Comp(props) {
|
|
4455
|
+
return /*#__PURE__*/React__default["default"].createElement(antd.Select, Object.assign({
|
|
4456
|
+
placeholder: '请选择'
|
|
4457
|
+
}, props, {
|
|
4458
|
+
options: undefined
|
|
4459
|
+
}), ParamTypeOptions.map(function (it) {
|
|
4460
|
+
return /*#__PURE__*/React__default["default"].createElement(antd.Select.Option, {
|
|
4461
|
+
key: it.value,
|
|
4462
|
+
value: it.value
|
|
4463
|
+
}, it.label);
|
|
4464
|
+
}));
|
|
4465
|
+
},
|
|
4466
|
+
required: true,
|
|
4467
|
+
validator: validatorCvt(function (val) {
|
|
4468
|
+
return emptyValidator(val);
|
|
4469
|
+
})
|
|
4470
|
+
}, {
|
|
4471
|
+
label: '默认值',
|
|
4472
|
+
name: 'defaultValue',
|
|
4473
|
+
Comp: ParamRenderer,
|
|
4474
|
+
validator: validatorCvt(paramValidator, function () {
|
|
4475
|
+
return _this.ref.current;
|
|
4476
|
+
})
|
|
4477
|
+
}, {
|
|
4478
|
+
label: '参数说明',
|
|
4479
|
+
name: 'description',
|
|
4480
|
+
Comp: function Comp(props) {
|
|
4481
|
+
return /*#__PURE__*/React__default["default"].createElement(antd.Input.TextArea, Object.assign({
|
|
4482
|
+
placeholder: '请输入'
|
|
4483
|
+
}, props));
|
|
4484
|
+
}
|
|
4485
|
+
}]);
|
|
4486
|
+
|
|
4487
|
+
_defineProperty$2(_assertThisInitialized(_this), "onChange", function (changed, data) {
|
|
4488
|
+
var _this$props$onChange, _this$props;
|
|
4489
|
+
|
|
4490
|
+
(_this$props$onChange = (_this$props = _this.props).onChange) === null || _this$props$onChange === void 0 ? void 0 : _this$props$onChange.call(_this$props, data);
|
|
4491
|
+
if ('valueType' in changed) _this.forceUpdate();
|
|
4492
|
+
});
|
|
4493
|
+
|
|
4494
|
+
return _this;
|
|
4495
|
+
}
|
|
4496
|
+
|
|
4497
|
+
_createClass$1(ParamForm, [{
|
|
4498
|
+
key: "render",
|
|
4499
|
+
value: function render() {
|
|
4500
|
+
var _this2 = this;
|
|
4501
|
+
|
|
4502
|
+
return /*#__PURE__*/React__default["default"].createElement(antd.Form, {
|
|
4503
|
+
className: "param-form",
|
|
4504
|
+
ref: this.ref,
|
|
4505
|
+
key: JSON.stringify(this.props.initialValues),
|
|
4506
|
+
initialValues: this.props.initialValues,
|
|
4507
|
+
onFinish: this.props.onSubmit,
|
|
4508
|
+
onValuesChange: this.onChange
|
|
4509
|
+
}, this.formItems.map(function (it) {
|
|
4510
|
+
var _this2$ref$current;
|
|
4511
|
+
|
|
4512
|
+
return /*#__PURE__*/React__default["default"].createElement(antd.Form.Item, {
|
|
4513
|
+
key: it.name,
|
|
4514
|
+
label: it.label,
|
|
4515
|
+
name: it.name,
|
|
4516
|
+
required: it.required,
|
|
4517
|
+
requiredMark: true,
|
|
4518
|
+
rules: [{
|
|
4519
|
+
validator: it.validator || function () {
|
|
4520
|
+
return Promise.resolve();
|
|
4521
|
+
}
|
|
4522
|
+
}],
|
|
4523
|
+
validateTrigger: 'onBlur'
|
|
4524
|
+
}, /*#__PURE__*/React__default["default"].createElement(it.Comp, {
|
|
4525
|
+
parentOptions: _this2.props.parentOptions,
|
|
4526
|
+
options: _this2.props.expiriesOptions,
|
|
4527
|
+
valueType: (_this2$ref$current = _this2.ref.current) === null || _this2$ref$current === void 0 ? void 0 : _this2$ref$current.getFieldValue('valueType')
|
|
4528
|
+
}));
|
|
4529
|
+
}), this.props.onSubmit && /*#__PURE__*/React__default["default"].createElement(antd.Button, {
|
|
4530
|
+
type: "primary",
|
|
4531
|
+
htmlType: "submit"
|
|
4532
|
+
}, "\u63D0\u4EA4"));
|
|
4533
|
+
}
|
|
4534
|
+
}]);
|
|
4535
|
+
|
|
4536
|
+
return ParamForm;
|
|
4537
|
+
}(React.PureComponent);
|
|
4538
|
+
|
|
4539
|
+
var ParamFormModalEl = /*#__PURE__*/function (_PureComponent2) {
|
|
4540
|
+
_inherits(ParamFormModalEl, _PureComponent2);
|
|
4541
|
+
|
|
4542
|
+
var _super2 = _createSuper(ParamFormModalEl);
|
|
4543
|
+
|
|
4544
|
+
function ParamFormModalEl() {
|
|
4545
|
+
var _this3;
|
|
4546
|
+
|
|
4547
|
+
_classCallCheck$1(this, ParamFormModalEl);
|
|
4548
|
+
|
|
4549
|
+
for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
|
|
4550
|
+
args[_key2] = arguments[_key2];
|
|
4551
|
+
}
|
|
4552
|
+
|
|
4553
|
+
_this3 = _super2.call.apply(_super2, [this].concat(args));
|
|
4554
|
+
|
|
4555
|
+
_defineProperty$2(_assertThisInitialized(_this3), "ref", React__default["default"].createRef());
|
|
4556
|
+
|
|
4557
|
+
_defineProperty$2(_assertThisInitialized(_this3), "state", {
|
|
4558
|
+
visible: false
|
|
4559
|
+
});
|
|
4560
|
+
|
|
4561
|
+
_defineProperty$2(_assertThisInitialized(_this3), "onShow", function () {
|
|
4562
|
+
return _this3.setState({
|
|
4563
|
+
visible: true
|
|
4564
|
+
});
|
|
4565
|
+
});
|
|
4566
|
+
|
|
4567
|
+
_defineProperty$2(_assertThisInitialized(_this3), "onHide", function () {
|
|
4568
|
+
return _this3.setState({
|
|
4569
|
+
visible: false
|
|
4570
|
+
});
|
|
4571
|
+
});
|
|
4572
|
+
|
|
4573
|
+
_defineProperty$2(_assertThisInitialized(_this3), "onSubmit", function () {
|
|
4574
|
+
var form = _this3.ref.current.ref.current;
|
|
4575
|
+
return form.validateFields().then(function () {
|
|
4576
|
+
return _this3.props.onSubmit(form.getFieldsValue());
|
|
4577
|
+
}).then(_this3.onHide);
|
|
4578
|
+
});
|
|
4579
|
+
|
|
4580
|
+
return _this3;
|
|
4581
|
+
}
|
|
4582
|
+
|
|
4583
|
+
_createClass$1(ParamFormModalEl, [{
|
|
4584
|
+
key: "render",
|
|
4585
|
+
value: function render() {
|
|
4586
|
+
var _this$props$initialVa;
|
|
4587
|
+
|
|
4588
|
+
return /*#__PURE__*/React__default["default"].createElement(antd.Modal, {
|
|
4589
|
+
key: String(this.state.visible),
|
|
4590
|
+
width: 640,
|
|
4591
|
+
closable: false,
|
|
4592
|
+
title: !((_this$props$initialVa = this.props.initialValues) === null || _this$props$initialVa === void 0 ? void 0 : _this$props$initialVa.paramId) ? '新增参数' : '修改参数',
|
|
4593
|
+
visible: this.state.visible,
|
|
4594
|
+
footer: /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, /*#__PURE__*/React__default["default"].createElement(antd.Button, {
|
|
4595
|
+
onClick: this.onHide
|
|
4596
|
+
}, "\u53D6\u6D88"), /*#__PURE__*/React__default["default"].createElement(antd.Button, {
|
|
4597
|
+
type: "primary",
|
|
4598
|
+
onClick: this.onSubmit
|
|
4599
|
+
}, "\u786E\u8BA4"))
|
|
4600
|
+
}, /*#__PURE__*/React__default["default"].createElement(ParamForm, Object.assign({}, this.props, {
|
|
4601
|
+
ref: this.ref,
|
|
4602
|
+
onSubmit: undefined
|
|
4603
|
+
})));
|
|
4604
|
+
}
|
|
4605
|
+
}]);
|
|
4606
|
+
|
|
4607
|
+
return ParamFormModalEl;
|
|
4608
|
+
}(React.PureComponent);
|
|
4609
|
+
|
|
4610
|
+
var ParamFormModal = /*#__PURE__*/function () {
|
|
4611
|
+
function ParamFormModal() {
|
|
4612
|
+
_classCallCheck$1(this, ParamFormModal);
|
|
4613
|
+
}
|
|
4614
|
+
|
|
4615
|
+
_createClass$1(ParamFormModal, null, [{
|
|
4616
|
+
key: "show",
|
|
4617
|
+
value: function show(props) {
|
|
4618
|
+
return ParamFormModal.el.render(props).then(function () {
|
|
4619
|
+
ParamFormModal.el.ref.onShow();
|
|
4620
|
+
});
|
|
4621
|
+
}
|
|
4622
|
+
}, {
|
|
4623
|
+
key: "hide",
|
|
4624
|
+
value: function hide() {
|
|
4625
|
+
return ParamFormModal.el.render().then(function () {
|
|
4626
|
+
ParamFormModal.el.ref.onHide();
|
|
4627
|
+
});
|
|
4628
|
+
}
|
|
4629
|
+
}]);
|
|
4630
|
+
|
|
4631
|
+
return ParamFormModal;
|
|
4632
|
+
}();
|
|
4633
|
+
|
|
4634
|
+
_defineProperty$2(ParamFormModal, "el", new ReactGlobalComp('param-form-modal', ParamFormModalEl));
|
|
4635
|
+
|
|
4636
|
+
var ParamValueEditor = /*#__PURE__*/function (_PureComponent) {
|
|
4637
|
+
_inherits(ParamValueEditor, _PureComponent);
|
|
4638
|
+
|
|
4639
|
+
var _super = _createSuper(ParamValueEditor);
|
|
4640
|
+
|
|
4641
|
+
function ParamValueEditor() {
|
|
4642
|
+
var _this;
|
|
4643
|
+
|
|
4644
|
+
_classCallCheck$1(this, ParamValueEditor);
|
|
4645
|
+
|
|
4646
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
4647
|
+
args[_key] = arguments[_key];
|
|
4648
|
+
}
|
|
4649
|
+
|
|
4650
|
+
_this = _super.call.apply(_super, [this].concat(args));
|
|
4651
|
+
|
|
4652
|
+
_defineProperty$2(_assertThisInitialized(_this), "ref", React__default["default"].createRef());
|
|
4653
|
+
|
|
4654
|
+
_defineProperty$2(_assertThisInitialized(_this), "formItems", [{
|
|
4655
|
+
label: 'Parameter',
|
|
4656
|
+
name: 'paramId',
|
|
4657
|
+
Comp: function Comp(props) {
|
|
4658
|
+
return /*#__PURE__*/React__default["default"].createElement(ParentSelector, Object.assign({}, props, {
|
|
4659
|
+
readonly: true
|
|
4660
|
+
}));
|
|
4661
|
+
}
|
|
4662
|
+
}, {
|
|
4663
|
+
label: 'Description',
|
|
4664
|
+
name: 'description',
|
|
4665
|
+
Comp: function Comp(props) {
|
|
4666
|
+
return /*#__PURE__*/React__default["default"].createElement("span", {
|
|
4667
|
+
className: "param-value-editor-desc",
|
|
4668
|
+
style: {
|
|
4669
|
+
lineHeight: '20px',
|
|
4670
|
+
padding: '10px 0'
|
|
4671
|
+
}
|
|
4672
|
+
}, props.value || '-');
|
|
4673
|
+
}
|
|
4674
|
+
}, {
|
|
4675
|
+
label: 'Value before',
|
|
4676
|
+
name: 'valueBefore',
|
|
4677
|
+
Comp: function Comp(props) {
|
|
4678
|
+
return /*#__PURE__*/React__default["default"].createElement(ParamRenderer, Object.assign({}, props, {
|
|
4679
|
+
readonly: true
|
|
4680
|
+
}));
|
|
4681
|
+
}
|
|
4682
|
+
}, {
|
|
4683
|
+
label: 'Value after',
|
|
4684
|
+
name: 'value',
|
|
4685
|
+
Comp: ParamRenderer,
|
|
4686
|
+
required: true,
|
|
4687
|
+
validator: validatorCvt(function (val) {
|
|
4688
|
+
return paramValidator(val, {
|
|
4689
|
+
valueType: _this.props.valueType
|
|
4690
|
+
});
|
|
4691
|
+
})
|
|
4692
|
+
}]);
|
|
4693
|
+
|
|
4694
|
+
_defineProperty$2(_assertThisInitialized(_this), "onChange", function (changed, data) {
|
|
4695
|
+
var _this$props$onChange, _this$props;
|
|
4696
|
+
|
|
4697
|
+
(_this$props$onChange = (_this$props = _this.props).onChange) === null || _this$props$onChange === void 0 ? void 0 : _this$props$onChange.call(_this$props, data);
|
|
4698
|
+
});
|
|
4699
|
+
|
|
4700
|
+
return _this;
|
|
4701
|
+
}
|
|
4702
|
+
|
|
4703
|
+
_createClass$1(ParamValueEditor, [{
|
|
4704
|
+
key: "componentDidMount",
|
|
4705
|
+
value: function componentDidMount() {
|
|
4706
|
+
console.log(1111, 'mounted');
|
|
4707
|
+
}
|
|
4708
|
+
}, {
|
|
4709
|
+
key: "render",
|
|
4710
|
+
value: function render() {
|
|
4711
|
+
var _this2 = this;
|
|
4712
|
+
|
|
4713
|
+
return /*#__PURE__*/React__default["default"].createElement(antd.Form, {
|
|
4714
|
+
className: "param-value-editor",
|
|
4715
|
+
ref: this.ref,
|
|
4716
|
+
key: this.props.valueType,
|
|
4717
|
+
initialValues: this.props.initialValues,
|
|
4718
|
+
onFinish: this.props.onSubmit,
|
|
4719
|
+
onValuesChange: this.onChange
|
|
4720
|
+
}, this.formItems.map(function (it) {
|
|
4721
|
+
return /*#__PURE__*/React__default["default"].createElement(antd.Form.Item, {
|
|
4722
|
+
key: it.name,
|
|
4723
|
+
label: it.label,
|
|
4724
|
+
name: it.name,
|
|
4725
|
+
required: it.required,
|
|
4726
|
+
requiredMark: true,
|
|
4727
|
+
rules: [{
|
|
4728
|
+
validator: it.validator || function () {
|
|
4729
|
+
return Promise.resolve();
|
|
4730
|
+
}
|
|
4731
|
+
}],
|
|
4732
|
+
validateTrigger: 'onBlur'
|
|
4733
|
+
}, /*#__PURE__*/React__default["default"].createElement(it.Comp, {
|
|
4734
|
+
parentOptions: _this2.props.allParams,
|
|
4735
|
+
valueType: _this2.props.valueType
|
|
4736
|
+
}));
|
|
4737
|
+
}), this.props.onSubmit && /*#__PURE__*/React__default["default"].createElement(antd.Button, {
|
|
4738
|
+
type: "primary",
|
|
4739
|
+
htmlType: "submit"
|
|
4740
|
+
}, "\u63D0\u4EA4"));
|
|
4741
|
+
}
|
|
4742
|
+
}]);
|
|
4743
|
+
|
|
4744
|
+
return ParamValueEditor;
|
|
4745
|
+
}(React.PureComponent);
|
|
4746
|
+
var ParamValueEditorModalEl = /*#__PURE__*/function (_PureComponent2) {
|
|
4747
|
+
_inherits(ParamValueEditorModalEl, _PureComponent2);
|
|
4748
|
+
|
|
4749
|
+
var _super2 = _createSuper(ParamValueEditorModalEl);
|
|
4750
|
+
|
|
4751
|
+
function ParamValueEditorModalEl() {
|
|
4752
|
+
var _this3;
|
|
4753
|
+
|
|
4754
|
+
_classCallCheck$1(this, ParamValueEditorModalEl);
|
|
4755
|
+
|
|
4756
|
+
for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
|
|
4757
|
+
args[_key2] = arguments[_key2];
|
|
4758
|
+
}
|
|
4759
|
+
|
|
4760
|
+
_this3 = _super2.call.apply(_super2, [this].concat(args));
|
|
4761
|
+
|
|
4762
|
+
_defineProperty$2(_assertThisInitialized(_this3), "ref", React__default["default"].createRef());
|
|
4763
|
+
|
|
4764
|
+
_defineProperty$2(_assertThisInitialized(_this3), "state", {
|
|
4765
|
+
visible: false
|
|
4766
|
+
});
|
|
4767
|
+
|
|
4768
|
+
_defineProperty$2(_assertThisInitialized(_this3), "onShow", function () {
|
|
4769
|
+
return _this3.setState({
|
|
4770
|
+
visible: true
|
|
4771
|
+
});
|
|
4772
|
+
});
|
|
4773
|
+
|
|
4774
|
+
_defineProperty$2(_assertThisInitialized(_this3), "onHide", function () {
|
|
4775
|
+
return _this3.setState({
|
|
4776
|
+
visible: false
|
|
4777
|
+
});
|
|
4778
|
+
});
|
|
4779
|
+
|
|
4780
|
+
_defineProperty$2(_assertThisInitialized(_this3), "onSubmit", function () {
|
|
4781
|
+
var form = _this3.ref.current.ref.current;
|
|
4782
|
+
return form.validateFields().then(function () {
|
|
4783
|
+
return _this3.props.onSubmit(form.getFieldsValue());
|
|
4784
|
+
}).then(_this3.onHide);
|
|
4785
|
+
});
|
|
4786
|
+
|
|
4787
|
+
return _this3;
|
|
4788
|
+
}
|
|
4789
|
+
|
|
4790
|
+
_createClass$1(ParamValueEditorModalEl, [{
|
|
4791
|
+
key: "render",
|
|
4792
|
+
value: function render() {
|
|
4793
|
+
return /*#__PURE__*/React__default["default"].createElement(antd.Modal, {
|
|
4794
|
+
key: String(this.state.visible),
|
|
4795
|
+
width: 640,
|
|
4796
|
+
title: 'Edit Value',
|
|
4797
|
+
closable: false,
|
|
4798
|
+
visible: this.state.visible,
|
|
4799
|
+
footer: /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, /*#__PURE__*/React__default["default"].createElement(antd.Button, {
|
|
4800
|
+
onClick: this.onHide
|
|
4801
|
+
}, "Cancel"), /*#__PURE__*/React__default["default"].createElement(antd.Button, {
|
|
4802
|
+
type: "primary",
|
|
4803
|
+
onClick: this.onSubmit
|
|
4804
|
+
}, "Submit"))
|
|
4805
|
+
}, /*#__PURE__*/React__default["default"].createElement(ParamValueEditor, Object.assign({}, this.props, {
|
|
4806
|
+
ref: this.ref,
|
|
4807
|
+
onSubmit: undefined
|
|
4808
|
+
})));
|
|
4809
|
+
}
|
|
4810
|
+
}]);
|
|
4811
|
+
|
|
4812
|
+
return ParamValueEditorModalEl;
|
|
4813
|
+
}(React.PureComponent);
|
|
4814
|
+
var ParamValueEditorModal = /*#__PURE__*/function () {
|
|
4815
|
+
function ParamValueEditorModal() {
|
|
4816
|
+
_classCallCheck$1(this, ParamValueEditorModal);
|
|
4817
|
+
}
|
|
4818
|
+
|
|
4819
|
+
_createClass$1(ParamValueEditorModal, null, [{
|
|
4820
|
+
key: "show",
|
|
4821
|
+
value: function show(props) {
|
|
4822
|
+
return ParamValueEditorModal.el.render(props).then(function () {
|
|
4823
|
+
ParamValueEditorModal.el.ref.onShow();
|
|
4824
|
+
});
|
|
4825
|
+
}
|
|
4826
|
+
}, {
|
|
4827
|
+
key: "hide",
|
|
4828
|
+
value: function hide() {
|
|
4829
|
+
return ParamValueEditorModal.el.render().then(function () {
|
|
4830
|
+
ParamValueEditorModal.el.ref.onHide();
|
|
4831
|
+
});
|
|
4832
|
+
}
|
|
4833
|
+
}]);
|
|
4834
|
+
|
|
4835
|
+
return ParamValueEditorModal;
|
|
4836
|
+
}();
|
|
4837
|
+
|
|
4838
|
+
_defineProperty$2(ParamValueEditorModal, "el", new ReactGlobalComp('param-value-editor-modal', ParamValueEditorModalEl));
|
|
4839
|
+
|
|
4840
|
+
exports.ParamForm = ParamForm;
|
|
4841
|
+
exports.ParamFormModal = ParamFormModal;
|
|
4842
|
+
exports.ParamRenderer = ParamRenderer;
|
|
4843
|
+
exports.ParamTypeConfig = ParamTypeConfig;
|
|
4844
|
+
exports.ParamTypeOptions = ParamTypeOptions;
|
|
4845
|
+
exports.ParamValueEditor = ParamValueEditor;
|
|
4846
|
+
exports.ParamValueEditorModal = ParamValueEditorModal;
|
|
4847
|
+
exports.ParamValueEditorModalEl = ParamValueEditorModalEl;
|
|
4848
|
+
exports.emptyValidator = emptyValidator;
|
|
4849
|
+
exports.expiriesValidator = expiriesValidator;
|
|
4850
|
+
exports.expiryValidator = expiryValidator;
|
|
4851
|
+
exports.formatNum = formatNum;
|
|
4852
|
+
exports.isExpired = isExpired;
|
|
4853
|
+
exports.isNullLike = isNullLike;
|
|
4854
|
+
exports.keyValidator = keyValidator;
|
|
4855
|
+
exports.numRangeValidator = numRangeValidator;
|
|
4856
|
+
exports.paramValidator = paramValidator;
|
|
4857
|
+
exports.validatorCvt = validatorCvt;
|
|
4858
|
+
|
|
4859
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4860
|
+
|
|
4861
|
+
}));
|