@next-core/brick-kit 2.99.0 → 2.101.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,21 +1,40 @@
1
1
  (function (global, factory) {
2
2
  typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('history'), require('@babel/runtime/helpers/objectSpread2'), require('@babel/runtime/helpers/objectWithoutProperties'), require('@babel/runtime/helpers/asyncToGenerator'), require('@babel/runtime/helpers/defineProperty'), require('react'), require('lodash'), require('@next-core/brick-utils'), require('@next-core/brick-http'), require('moment'), require('@next-core/pipes'), require('i18next'), require('@next-core/easyops-analytics'), require('js-yaml'), require('antd'), require('@ant-design/icons'), require('react-i18next'), require('@babel/runtime/helpers/esm/extends'), require('@next-core/illustrations'), require('@babel/runtime/helpers/decorate')) :
3
3
  typeof define === 'function' && define.amd ? define(['exports', 'history', '@babel/runtime/helpers/objectSpread2', '@babel/runtime/helpers/objectWithoutProperties', '@babel/runtime/helpers/asyncToGenerator', '@babel/runtime/helpers/defineProperty', 'react', 'lodash', '@next-core/brick-utils', '@next-core/brick-http', 'moment', '@next-core/pipes', 'i18next', '@next-core/easyops-analytics', 'js-yaml', 'antd', '@ant-design/icons', 'react-i18next', '@babel/runtime/helpers/esm/extends', '@next-core/illustrations', '@babel/runtime/helpers/decorate'], factory) :
4
- (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.BrickKit = {}, global.history$1, global._objectSpread, global._objectWithoutProperties, global._asyncToGenerator$4, global._defineProperty$1, global.React, global.lodash, global.brickUtils, global.brickHttp, global.moment, global.pipes, global.i18next, global.easyopsAnalytics, global.yaml, global.antd, global.icons, global.reactI18next, global._extends, global.illustrations, global._decorate));
5
- })(this, (function (exports, history$1, _objectSpread, _objectWithoutProperties, _asyncToGenerator$4, _defineProperty$1, React, lodash, brickUtils, brickHttp, moment, pipes, i18next, easyopsAnalytics, yaml, antd, icons, reactI18next, _extends, illustrations, _decorate) { 'use strict';
4
+ (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.BrickKit = {}, global.history$1, global._objectSpread, global._objectWithoutProperties, global._asyncToGenerator$4, global._defineProperty$1, global.React, global.lodash, global.brickUtils, global.brickHttp, global.moment, global.pipes, global.i18next, global.easyopsAnalytics, global.yaml, global.antd, global.icons, global.reactI18next, global._extends$2, global.illustrations, global._decorate));
5
+ })(this, (function (exports, history$1, _objectSpread, _objectWithoutProperties, _asyncToGenerator$4, _defineProperty$1, React, lodash, brickUtils, brickHttp, moment, pipes, i18next, easyopsAnalytics, yaml, antd, icons, reactI18next, _extends$2, illustrations, _decorate) { 'use strict';
6
6
 
7
7
  function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
8
8
 
9
+ function _interopNamespace(e) {
10
+ if (e && e.__esModule) return e;
11
+ var n = Object.create(null);
12
+ if (e) {
13
+ Object.keys(e).forEach(function (k) {
14
+ if (k !== 'default') {
15
+ var d = Object.getOwnPropertyDescriptor(e, k);
16
+ Object.defineProperty(n, k, d.get ? d : {
17
+ enumerable: true,
18
+ get: function () { return e[k]; }
19
+ });
20
+ }
21
+ });
22
+ }
23
+ n["default"] = e;
24
+ return Object.freeze(n);
25
+ }
26
+
9
27
  var _objectSpread__default = /*#__PURE__*/_interopDefaultLegacy(_objectSpread);
10
28
  var _objectWithoutProperties__default = /*#__PURE__*/_interopDefaultLegacy(_objectWithoutProperties);
11
29
  var _asyncToGenerator__default = /*#__PURE__*/_interopDefaultLegacy(_asyncToGenerator$4);
12
30
  var _defineProperty__default = /*#__PURE__*/_interopDefaultLegacy(_defineProperty$1);
13
31
  var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
32
+ var React__namespace = /*#__PURE__*/_interopNamespace(React);
14
33
  var lodash__default = /*#__PURE__*/_interopDefaultLegacy(lodash);
15
34
  var moment__default = /*#__PURE__*/_interopDefaultLegacy(moment);
16
35
  var i18next__default = /*#__PURE__*/_interopDefaultLegacy(i18next);
17
36
  var yaml__default = /*#__PURE__*/_interopDefaultLegacy(yaml);
18
- var _extends__default = /*#__PURE__*/_interopDefaultLegacy(_extends);
37
+ var _extends__default = /*#__PURE__*/_interopDefaultLegacy(_extends$2);
19
38
  var _decorate__default = /*#__PURE__*/_interopDefaultLegacy(_decorate);
20
39
 
21
40
  class BaseBar {
@@ -6189,6 +6208,892 @@
6189
6208
  return _standaloneBootstrap.apply(this, arguments);
6190
6209
  }
6191
6210
 
6211
+ /**
6212
+ * Take input from [0, n] and return it as [0, 1]
6213
+ * @hidden
6214
+ */
6215
+ function bound01(n, max) {
6216
+ if (isOnePointZero(n)) {
6217
+ n = '100%';
6218
+ }
6219
+ var isPercent = isPercentage(n);
6220
+ n = max === 360 ? n : Math.min(max, Math.max(0, parseFloat(n)));
6221
+ // Automatically convert percentage into number
6222
+ if (isPercent) {
6223
+ n = parseInt(String(n * max), 10) / 100;
6224
+ }
6225
+ // Handle floating point rounding errors
6226
+ if (Math.abs(n - max) < 0.000001) {
6227
+ return 1;
6228
+ }
6229
+ // Convert into [0, 1] range if it isn't already
6230
+ if (max === 360) {
6231
+ // If n is a hue given in degrees,
6232
+ // wrap around out-of-range values into [0, 360] range
6233
+ // then convert into [0, 1].
6234
+ n = (n < 0 ? (n % max) + max : n % max) / parseFloat(String(max));
6235
+ }
6236
+ else {
6237
+ // If n not a hue given in degrees
6238
+ // Convert into [0, 1] range if it isn't already.
6239
+ n = (n % max) / parseFloat(String(max));
6240
+ }
6241
+ return n;
6242
+ }
6243
+ /**
6244
+ * Need to handle 1.0 as 100%, since once it is a number, there is no difference between it and 1
6245
+ * <http://stackoverflow.com/questions/7422072/javascript-how-to-detect-number-as-a-decimal-including-1-0>
6246
+ * @hidden
6247
+ */
6248
+ function isOnePointZero(n) {
6249
+ return typeof n === 'string' && n.indexOf('.') !== -1 && parseFloat(n) === 1;
6250
+ }
6251
+ /**
6252
+ * Check to see if string passed in is a percentage
6253
+ * @hidden
6254
+ */
6255
+ function isPercentage(n) {
6256
+ return typeof n === 'string' && n.indexOf('%') !== -1;
6257
+ }
6258
+ /**
6259
+ * Return a valid alpha value [0,1] with all invalid values being set to 1
6260
+ * @hidden
6261
+ */
6262
+ function boundAlpha(a) {
6263
+ a = parseFloat(a);
6264
+ if (isNaN(a) || a < 0 || a > 1) {
6265
+ a = 1;
6266
+ }
6267
+ return a;
6268
+ }
6269
+ /**
6270
+ * Replace a decimal with it's percentage value
6271
+ * @hidden
6272
+ */
6273
+ function convertToPercentage(n) {
6274
+ if (n <= 1) {
6275
+ return Number(n) * 100 + "%";
6276
+ }
6277
+ return n;
6278
+ }
6279
+ /**
6280
+ * Force a hex value to have 2 characters
6281
+ * @hidden
6282
+ */
6283
+ function pad2(c) {
6284
+ return c.length === 1 ? '0' + c : String(c);
6285
+ }
6286
+
6287
+ // `rgbToHsl`, `rgbToHsv`, `hslToRgb`, `hsvToRgb` modified from:
6288
+ // <http://mjijackson.com/2008/02/rgb-to-hsl-and-rgb-to-hsv-color-model-conversion-algorithms-in-javascript>
6289
+ /**
6290
+ * Handle bounds / percentage checking to conform to CSS color spec
6291
+ * <http://www.w3.org/TR/css3-color/>
6292
+ * *Assumes:* r, g, b in [0, 255] or [0, 1]
6293
+ * *Returns:* { r, g, b } in [0, 255]
6294
+ */
6295
+ function rgbToRgb(r, g, b) {
6296
+ return {
6297
+ r: bound01(r, 255) * 255,
6298
+ g: bound01(g, 255) * 255,
6299
+ b: bound01(b, 255) * 255,
6300
+ };
6301
+ }
6302
+ function hue2rgb(p, q, t) {
6303
+ if (t < 0) {
6304
+ t += 1;
6305
+ }
6306
+ if (t > 1) {
6307
+ t -= 1;
6308
+ }
6309
+ if (t < 1 / 6) {
6310
+ return p + (q - p) * (6 * t);
6311
+ }
6312
+ if (t < 1 / 2) {
6313
+ return q;
6314
+ }
6315
+ if (t < 2 / 3) {
6316
+ return p + (q - p) * (2 / 3 - t) * 6;
6317
+ }
6318
+ return p;
6319
+ }
6320
+ /**
6321
+ * Converts an HSL color value to RGB.
6322
+ *
6323
+ * *Assumes:* h is contained in [0, 1] or [0, 360] and s and l are contained [0, 1] or [0, 100]
6324
+ * *Returns:* { r, g, b } in the set [0, 255]
6325
+ */
6326
+ function hslToRgb(h, s, l) {
6327
+ var r;
6328
+ var g;
6329
+ var b;
6330
+ h = bound01(h, 360);
6331
+ s = bound01(s, 100);
6332
+ l = bound01(l, 100);
6333
+ if (s === 0) {
6334
+ // achromatic
6335
+ g = l;
6336
+ b = l;
6337
+ r = l;
6338
+ }
6339
+ else {
6340
+ var q = l < 0.5 ? l * (1 + s) : l + s - l * s;
6341
+ var p = 2 * l - q;
6342
+ r = hue2rgb(p, q, h + 1 / 3);
6343
+ g = hue2rgb(p, q, h);
6344
+ b = hue2rgb(p, q, h - 1 / 3);
6345
+ }
6346
+ return { r: r * 255, g: g * 255, b: b * 255 };
6347
+ }
6348
+ /**
6349
+ * Converts an RGB color value to HSV
6350
+ *
6351
+ * *Assumes:* r, g, and b are contained in the set [0, 255] or [0, 1]
6352
+ * *Returns:* { h, s, v } in [0,1]
6353
+ */
6354
+ function rgbToHsv(r, g, b) {
6355
+ r = bound01(r, 255);
6356
+ g = bound01(g, 255);
6357
+ b = bound01(b, 255);
6358
+ var max = Math.max(r, g, b);
6359
+ var min = Math.min(r, g, b);
6360
+ var h = 0;
6361
+ var v = max;
6362
+ var d = max - min;
6363
+ var s = max === 0 ? 0 : d / max;
6364
+ if (max === min) {
6365
+ h = 0; // achromatic
6366
+ }
6367
+ else {
6368
+ switch (max) {
6369
+ case r:
6370
+ h = (g - b) / d + (g < b ? 6 : 0);
6371
+ break;
6372
+ case g:
6373
+ h = (b - r) / d + 2;
6374
+ break;
6375
+ case b:
6376
+ h = (r - g) / d + 4;
6377
+ break;
6378
+ }
6379
+ h /= 6;
6380
+ }
6381
+ return { h: h, s: s, v: v };
6382
+ }
6383
+ /**
6384
+ * Converts an HSV color value to RGB.
6385
+ *
6386
+ * *Assumes:* h is contained in [0, 1] or [0, 360] and s and v are contained in [0, 1] or [0, 100]
6387
+ * *Returns:* { r, g, b } in the set [0, 255]
6388
+ */
6389
+ function hsvToRgb(h, s, v) {
6390
+ h = bound01(h, 360) * 6;
6391
+ s = bound01(s, 100);
6392
+ v = bound01(v, 100);
6393
+ var i = Math.floor(h);
6394
+ var f = h - i;
6395
+ var p = v * (1 - s);
6396
+ var q = v * (1 - f * s);
6397
+ var t = v * (1 - (1 - f) * s);
6398
+ var mod = i % 6;
6399
+ var r = [v, q, p, p, t, v][mod];
6400
+ var g = [t, v, v, q, p, p][mod];
6401
+ var b = [p, p, t, v, v, q][mod];
6402
+ return { r: r * 255, g: g * 255, b: b * 255 };
6403
+ }
6404
+ /**
6405
+ * Converts an RGB color to hex
6406
+ *
6407
+ * Assumes r, g, and b are contained in the set [0, 255]
6408
+ * Returns a 3 or 6 character hex
6409
+ */
6410
+ function rgbToHex(r, g, b, allow3Char) {
6411
+ var hex = [
6412
+ pad2(Math.round(r).toString(16)),
6413
+ pad2(Math.round(g).toString(16)),
6414
+ pad2(Math.round(b).toString(16)),
6415
+ ];
6416
+ // Return a 3 character hex if possible
6417
+ if (allow3Char &&
6418
+ hex[0].startsWith(hex[0].charAt(1)) &&
6419
+ hex[1].startsWith(hex[1].charAt(1)) &&
6420
+ hex[2].startsWith(hex[2].charAt(1))) {
6421
+ return hex[0].charAt(0) + hex[1].charAt(0) + hex[2].charAt(0);
6422
+ }
6423
+ return hex.join('');
6424
+ }
6425
+ /** Converts a hex value to a decimal */
6426
+ function convertHexToDecimal(h) {
6427
+ return parseIntFromHex(h) / 255;
6428
+ }
6429
+ /** Parse a base-16 hex value into a base-10 integer */
6430
+ function parseIntFromHex(val) {
6431
+ return parseInt(val, 16);
6432
+ }
6433
+
6434
+ // https://github.com/bahamas10/css-color-names/blob/master/css-color-names.json
6435
+ /**
6436
+ * @hidden
6437
+ */
6438
+ var names = {
6439
+ aliceblue: '#f0f8ff',
6440
+ antiquewhite: '#faebd7',
6441
+ aqua: '#00ffff',
6442
+ aquamarine: '#7fffd4',
6443
+ azure: '#f0ffff',
6444
+ beige: '#f5f5dc',
6445
+ bisque: '#ffe4c4',
6446
+ black: '#000000',
6447
+ blanchedalmond: '#ffebcd',
6448
+ blue: '#0000ff',
6449
+ blueviolet: '#8a2be2',
6450
+ brown: '#a52a2a',
6451
+ burlywood: '#deb887',
6452
+ cadetblue: '#5f9ea0',
6453
+ chartreuse: '#7fff00',
6454
+ chocolate: '#d2691e',
6455
+ coral: '#ff7f50',
6456
+ cornflowerblue: '#6495ed',
6457
+ cornsilk: '#fff8dc',
6458
+ crimson: '#dc143c',
6459
+ cyan: '#00ffff',
6460
+ darkblue: '#00008b',
6461
+ darkcyan: '#008b8b',
6462
+ darkgoldenrod: '#b8860b',
6463
+ darkgray: '#a9a9a9',
6464
+ darkgreen: '#006400',
6465
+ darkgrey: '#a9a9a9',
6466
+ darkkhaki: '#bdb76b',
6467
+ darkmagenta: '#8b008b',
6468
+ darkolivegreen: '#556b2f',
6469
+ darkorange: '#ff8c00',
6470
+ darkorchid: '#9932cc',
6471
+ darkred: '#8b0000',
6472
+ darksalmon: '#e9967a',
6473
+ darkseagreen: '#8fbc8f',
6474
+ darkslateblue: '#483d8b',
6475
+ darkslategray: '#2f4f4f',
6476
+ darkslategrey: '#2f4f4f',
6477
+ darkturquoise: '#00ced1',
6478
+ darkviolet: '#9400d3',
6479
+ deeppink: '#ff1493',
6480
+ deepskyblue: '#00bfff',
6481
+ dimgray: '#696969',
6482
+ dimgrey: '#696969',
6483
+ dodgerblue: '#1e90ff',
6484
+ firebrick: '#b22222',
6485
+ floralwhite: '#fffaf0',
6486
+ forestgreen: '#228b22',
6487
+ fuchsia: '#ff00ff',
6488
+ gainsboro: '#dcdcdc',
6489
+ ghostwhite: '#f8f8ff',
6490
+ goldenrod: '#daa520',
6491
+ gold: '#ffd700',
6492
+ gray: '#808080',
6493
+ green: '#008000',
6494
+ greenyellow: '#adff2f',
6495
+ grey: '#808080',
6496
+ honeydew: '#f0fff0',
6497
+ hotpink: '#ff69b4',
6498
+ indianred: '#cd5c5c',
6499
+ indigo: '#4b0082',
6500
+ ivory: '#fffff0',
6501
+ khaki: '#f0e68c',
6502
+ lavenderblush: '#fff0f5',
6503
+ lavender: '#e6e6fa',
6504
+ lawngreen: '#7cfc00',
6505
+ lemonchiffon: '#fffacd',
6506
+ lightblue: '#add8e6',
6507
+ lightcoral: '#f08080',
6508
+ lightcyan: '#e0ffff',
6509
+ lightgoldenrodyellow: '#fafad2',
6510
+ lightgray: '#d3d3d3',
6511
+ lightgreen: '#90ee90',
6512
+ lightgrey: '#d3d3d3',
6513
+ lightpink: '#ffb6c1',
6514
+ lightsalmon: '#ffa07a',
6515
+ lightseagreen: '#20b2aa',
6516
+ lightskyblue: '#87cefa',
6517
+ lightslategray: '#778899',
6518
+ lightslategrey: '#778899',
6519
+ lightsteelblue: '#b0c4de',
6520
+ lightyellow: '#ffffe0',
6521
+ lime: '#00ff00',
6522
+ limegreen: '#32cd32',
6523
+ linen: '#faf0e6',
6524
+ magenta: '#ff00ff',
6525
+ maroon: '#800000',
6526
+ mediumaquamarine: '#66cdaa',
6527
+ mediumblue: '#0000cd',
6528
+ mediumorchid: '#ba55d3',
6529
+ mediumpurple: '#9370db',
6530
+ mediumseagreen: '#3cb371',
6531
+ mediumslateblue: '#7b68ee',
6532
+ mediumspringgreen: '#00fa9a',
6533
+ mediumturquoise: '#48d1cc',
6534
+ mediumvioletred: '#c71585',
6535
+ midnightblue: '#191970',
6536
+ mintcream: '#f5fffa',
6537
+ mistyrose: '#ffe4e1',
6538
+ moccasin: '#ffe4b5',
6539
+ navajowhite: '#ffdead',
6540
+ navy: '#000080',
6541
+ oldlace: '#fdf5e6',
6542
+ olive: '#808000',
6543
+ olivedrab: '#6b8e23',
6544
+ orange: '#ffa500',
6545
+ orangered: '#ff4500',
6546
+ orchid: '#da70d6',
6547
+ palegoldenrod: '#eee8aa',
6548
+ palegreen: '#98fb98',
6549
+ paleturquoise: '#afeeee',
6550
+ palevioletred: '#db7093',
6551
+ papayawhip: '#ffefd5',
6552
+ peachpuff: '#ffdab9',
6553
+ peru: '#cd853f',
6554
+ pink: '#ffc0cb',
6555
+ plum: '#dda0dd',
6556
+ powderblue: '#b0e0e6',
6557
+ purple: '#800080',
6558
+ rebeccapurple: '#663399',
6559
+ red: '#ff0000',
6560
+ rosybrown: '#bc8f8f',
6561
+ royalblue: '#4169e1',
6562
+ saddlebrown: '#8b4513',
6563
+ salmon: '#fa8072',
6564
+ sandybrown: '#f4a460',
6565
+ seagreen: '#2e8b57',
6566
+ seashell: '#fff5ee',
6567
+ sienna: '#a0522d',
6568
+ silver: '#c0c0c0',
6569
+ skyblue: '#87ceeb',
6570
+ slateblue: '#6a5acd',
6571
+ slategray: '#708090',
6572
+ slategrey: '#708090',
6573
+ snow: '#fffafa',
6574
+ springgreen: '#00ff7f',
6575
+ steelblue: '#4682b4',
6576
+ tan: '#d2b48c',
6577
+ teal: '#008080',
6578
+ thistle: '#d8bfd8',
6579
+ tomato: '#ff6347',
6580
+ turquoise: '#40e0d0',
6581
+ violet: '#ee82ee',
6582
+ wheat: '#f5deb3',
6583
+ white: '#ffffff',
6584
+ whitesmoke: '#f5f5f5',
6585
+ yellow: '#ffff00',
6586
+ yellowgreen: '#9acd32',
6587
+ };
6588
+
6589
+ /**
6590
+ * Given a string or object, convert that input to RGB
6591
+ *
6592
+ * Possible string inputs:
6593
+ * ```
6594
+ * "red"
6595
+ * "#f00" or "f00"
6596
+ * "#ff0000" or "ff0000"
6597
+ * "#ff000000" or "ff000000"
6598
+ * "rgb 255 0 0" or "rgb (255, 0, 0)"
6599
+ * "rgb 1.0 0 0" or "rgb (1, 0, 0)"
6600
+ * "rgba (255, 0, 0, 1)" or "rgba 255, 0, 0, 1"
6601
+ * "rgba (1.0, 0, 0, 1)" or "rgba 1.0, 0, 0, 1"
6602
+ * "hsl(0, 100%, 50%)" or "hsl 0 100% 50%"
6603
+ * "hsla(0, 100%, 50%, 1)" or "hsla 0 100% 50%, 1"
6604
+ * "hsv(0, 100%, 100%)" or "hsv 0 100% 100%"
6605
+ * ```
6606
+ */
6607
+ function inputToRGB(color) {
6608
+ var rgb = { r: 0, g: 0, b: 0 };
6609
+ var a = 1;
6610
+ var s = null;
6611
+ var v = null;
6612
+ var l = null;
6613
+ var ok = false;
6614
+ var format = false;
6615
+ if (typeof color === 'string') {
6616
+ color = stringInputToObject(color);
6617
+ }
6618
+ if (typeof color === 'object') {
6619
+ if (isValidCSSUnit(color.r) && isValidCSSUnit(color.g) && isValidCSSUnit(color.b)) {
6620
+ rgb = rgbToRgb(color.r, color.g, color.b);
6621
+ ok = true;
6622
+ format = String(color.r).substr(-1) === '%' ? 'prgb' : 'rgb';
6623
+ }
6624
+ else if (isValidCSSUnit(color.h) && isValidCSSUnit(color.s) && isValidCSSUnit(color.v)) {
6625
+ s = convertToPercentage(color.s);
6626
+ v = convertToPercentage(color.v);
6627
+ rgb = hsvToRgb(color.h, s, v);
6628
+ ok = true;
6629
+ format = 'hsv';
6630
+ }
6631
+ else if (isValidCSSUnit(color.h) && isValidCSSUnit(color.s) && isValidCSSUnit(color.l)) {
6632
+ s = convertToPercentage(color.s);
6633
+ l = convertToPercentage(color.l);
6634
+ rgb = hslToRgb(color.h, s, l);
6635
+ ok = true;
6636
+ format = 'hsl';
6637
+ }
6638
+ if (Object.prototype.hasOwnProperty.call(color, 'a')) {
6639
+ a = color.a;
6640
+ }
6641
+ }
6642
+ a = boundAlpha(a);
6643
+ return {
6644
+ ok: ok,
6645
+ format: color.format || format,
6646
+ r: Math.min(255, Math.max(rgb.r, 0)),
6647
+ g: Math.min(255, Math.max(rgb.g, 0)),
6648
+ b: Math.min(255, Math.max(rgb.b, 0)),
6649
+ a: a,
6650
+ };
6651
+ }
6652
+ // <http://www.w3.org/TR/css3-values/#integers>
6653
+ var CSS_INTEGER = '[-\\+]?\\d+%?';
6654
+ // <http://www.w3.org/TR/css3-values/#number-value>
6655
+ var CSS_NUMBER = '[-\\+]?\\d*\\.\\d+%?';
6656
+ // Allow positive/negative integer/number. Don't capture the either/or, just the entire outcome.
6657
+ var CSS_UNIT = "(?:" + CSS_NUMBER + ")|(?:" + CSS_INTEGER + ")";
6658
+ // Actual matching.
6659
+ // Parentheses and commas are optional, but not required.
6660
+ // Whitespace can take the place of commas or opening paren
6661
+ var PERMISSIVE_MATCH3 = "[\\s|\\(]+(" + CSS_UNIT + ")[,|\\s]+(" + CSS_UNIT + ")[,|\\s]+(" + CSS_UNIT + ")\\s*\\)?";
6662
+ var PERMISSIVE_MATCH4 = "[\\s|\\(]+(" + CSS_UNIT + ")[,|\\s]+(" + CSS_UNIT + ")[,|\\s]+(" + CSS_UNIT + ")[,|\\s]+(" + CSS_UNIT + ")\\s*\\)?";
6663
+ var matchers = {
6664
+ CSS_UNIT: new RegExp(CSS_UNIT),
6665
+ rgb: new RegExp('rgb' + PERMISSIVE_MATCH3),
6666
+ rgba: new RegExp('rgba' + PERMISSIVE_MATCH4),
6667
+ hsl: new RegExp('hsl' + PERMISSIVE_MATCH3),
6668
+ hsla: new RegExp('hsla' + PERMISSIVE_MATCH4),
6669
+ hsv: new RegExp('hsv' + PERMISSIVE_MATCH3),
6670
+ hsva: new RegExp('hsva' + PERMISSIVE_MATCH4),
6671
+ hex3: /^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,
6672
+ hex6: /^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,
6673
+ hex4: /^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,
6674
+ hex8: /^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,
6675
+ };
6676
+ /**
6677
+ * Permissive string parsing. Take in a number of formats, and output an object
6678
+ * based on detected format. Returns `{ r, g, b }` or `{ h, s, l }` or `{ h, s, v}`
6679
+ */
6680
+ function stringInputToObject(color) {
6681
+ color = color.trim().toLowerCase();
6682
+ if (color.length === 0) {
6683
+ return false;
6684
+ }
6685
+ var named = false;
6686
+ if (names[color]) {
6687
+ color = names[color];
6688
+ named = true;
6689
+ }
6690
+ else if (color === 'transparent') {
6691
+ return { r: 0, g: 0, b: 0, a: 0, format: 'name' };
6692
+ }
6693
+ // Try to match string input using regular expressions.
6694
+ // Keep most of the number bounding out of this function - don't worry about [0,1] or [0,100] or [0,360]
6695
+ // Just return an object and let the conversion functions handle that.
6696
+ // This way the result will be the same whether the tinycolor is initialized with string or object.
6697
+ var match = matchers.rgb.exec(color);
6698
+ if (match) {
6699
+ return { r: match[1], g: match[2], b: match[3] };
6700
+ }
6701
+ match = matchers.rgba.exec(color);
6702
+ if (match) {
6703
+ return { r: match[1], g: match[2], b: match[3], a: match[4] };
6704
+ }
6705
+ match = matchers.hsl.exec(color);
6706
+ if (match) {
6707
+ return { h: match[1], s: match[2], l: match[3] };
6708
+ }
6709
+ match = matchers.hsla.exec(color);
6710
+ if (match) {
6711
+ return { h: match[1], s: match[2], l: match[3], a: match[4] };
6712
+ }
6713
+ match = matchers.hsv.exec(color);
6714
+ if (match) {
6715
+ return { h: match[1], s: match[2], v: match[3] };
6716
+ }
6717
+ match = matchers.hsva.exec(color);
6718
+ if (match) {
6719
+ return { h: match[1], s: match[2], v: match[3], a: match[4] };
6720
+ }
6721
+ match = matchers.hex8.exec(color);
6722
+ if (match) {
6723
+ return {
6724
+ r: parseIntFromHex(match[1]),
6725
+ g: parseIntFromHex(match[2]),
6726
+ b: parseIntFromHex(match[3]),
6727
+ a: convertHexToDecimal(match[4]),
6728
+ format: named ? 'name' : 'hex8',
6729
+ };
6730
+ }
6731
+ match = matchers.hex6.exec(color);
6732
+ if (match) {
6733
+ return {
6734
+ r: parseIntFromHex(match[1]),
6735
+ g: parseIntFromHex(match[2]),
6736
+ b: parseIntFromHex(match[3]),
6737
+ format: named ? 'name' : 'hex',
6738
+ };
6739
+ }
6740
+ match = matchers.hex4.exec(color);
6741
+ if (match) {
6742
+ return {
6743
+ r: parseIntFromHex(match[1] + match[1]),
6744
+ g: parseIntFromHex(match[2] + match[2]),
6745
+ b: parseIntFromHex(match[3] + match[3]),
6746
+ a: convertHexToDecimal(match[4] + match[4]),
6747
+ format: named ? 'name' : 'hex8',
6748
+ };
6749
+ }
6750
+ match = matchers.hex3.exec(color);
6751
+ if (match) {
6752
+ return {
6753
+ r: parseIntFromHex(match[1] + match[1]),
6754
+ g: parseIntFromHex(match[2] + match[2]),
6755
+ b: parseIntFromHex(match[3] + match[3]),
6756
+ format: named ? 'name' : 'hex',
6757
+ };
6758
+ }
6759
+ return false;
6760
+ }
6761
+ /**
6762
+ * Check to see if it looks like a CSS unit
6763
+ * (see `matchers` above for definition).
6764
+ */
6765
+ function isValidCSSUnit(color) {
6766
+ return Boolean(matchers.CSS_UNIT.exec(String(color)));
6767
+ }
6768
+
6769
+ var hueStep = 2; // 色相阶梯
6770
+
6771
+ var saturationStep = 0.16; // 饱和度阶梯,浅色部分
6772
+
6773
+ var saturationStep2 = 0.05; // 饱和度阶梯,深色部分
6774
+
6775
+ var brightnessStep1 = 0.05; // 亮度阶梯,浅色部分
6776
+
6777
+ var brightnessStep2 = 0.15; // 亮度阶梯,深色部分
6778
+
6779
+ var lightColorCount = 5; // 浅色数量,主色上
6780
+
6781
+ var darkColorCount = 4; // 深色数量,主色下
6782
+ // 暗色主题颜色映射关系表
6783
+
6784
+ var darkColorMap = [{
6785
+ index: 7,
6786
+ opacity: 0.15
6787
+ }, {
6788
+ index: 6,
6789
+ opacity: 0.25
6790
+ }, {
6791
+ index: 5,
6792
+ opacity: 0.3
6793
+ }, {
6794
+ index: 5,
6795
+ opacity: 0.45
6796
+ }, {
6797
+ index: 5,
6798
+ opacity: 0.65
6799
+ }, {
6800
+ index: 5,
6801
+ opacity: 0.85
6802
+ }, {
6803
+ index: 4,
6804
+ opacity: 0.9
6805
+ }, {
6806
+ index: 3,
6807
+ opacity: 0.95
6808
+ }, {
6809
+ index: 2,
6810
+ opacity: 0.97
6811
+ }, {
6812
+ index: 1,
6813
+ opacity: 0.98
6814
+ }]; // Wrapper function ported from TinyColor.prototype.toHsv
6815
+ // Keep it here because of `hsv.h * 360`
6816
+
6817
+ function toHsv(_ref) {
6818
+ var r = _ref.r,
6819
+ g = _ref.g,
6820
+ b = _ref.b;
6821
+ var hsv = rgbToHsv(r, g, b);
6822
+ return {
6823
+ h: hsv.h * 360,
6824
+ s: hsv.s,
6825
+ v: hsv.v
6826
+ };
6827
+ } // Wrapper function ported from TinyColor.prototype.toHexString
6828
+ // Keep it here because of the prefix `#`
6829
+
6830
+
6831
+ function toHex(_ref2) {
6832
+ var r = _ref2.r,
6833
+ g = _ref2.g,
6834
+ b = _ref2.b;
6835
+ return "#".concat(rgbToHex(r, g, b, false));
6836
+ } // Wrapper function ported from TinyColor.prototype.mix, not treeshakable.
6837
+ // Amount in range [0, 1]
6838
+ // Assume color1 & color2 has no alpha, since the following src code did so.
6839
+
6840
+
6841
+ function mix(rgb1, rgb2, amount) {
6842
+ var p = amount / 100;
6843
+ var rgb = {
6844
+ r: (rgb2.r - rgb1.r) * p + rgb1.r,
6845
+ g: (rgb2.g - rgb1.g) * p + rgb1.g,
6846
+ b: (rgb2.b - rgb1.b) * p + rgb1.b
6847
+ };
6848
+ return rgb;
6849
+ }
6850
+
6851
+ function getHue(hsv, i, light) {
6852
+ var hue; // 根据色相不同,色相转向不同
6853
+
6854
+ if (Math.round(hsv.h) >= 60 && Math.round(hsv.h) <= 240) {
6855
+ hue = light ? Math.round(hsv.h) - hueStep * i : Math.round(hsv.h) + hueStep * i;
6856
+ } else {
6857
+ hue = light ? Math.round(hsv.h) + hueStep * i : Math.round(hsv.h) - hueStep * i;
6858
+ }
6859
+
6860
+ if (hue < 0) {
6861
+ hue += 360;
6862
+ } else if (hue >= 360) {
6863
+ hue -= 360;
6864
+ }
6865
+
6866
+ return hue;
6867
+ }
6868
+
6869
+ function getSaturation(hsv, i, light) {
6870
+ // grey color don't change saturation
6871
+ if (hsv.h === 0 && hsv.s === 0) {
6872
+ return hsv.s;
6873
+ }
6874
+
6875
+ var saturation;
6876
+
6877
+ if (light) {
6878
+ saturation = hsv.s - saturationStep * i;
6879
+ } else if (i === darkColorCount) {
6880
+ saturation = hsv.s + saturationStep;
6881
+ } else {
6882
+ saturation = hsv.s + saturationStep2 * i;
6883
+ } // 边界值修正
6884
+
6885
+
6886
+ if (saturation > 1) {
6887
+ saturation = 1;
6888
+ } // 第一格的 s 限制在 0.06-0.1 之间
6889
+
6890
+
6891
+ if (light && i === lightColorCount && saturation > 0.1) {
6892
+ saturation = 0.1;
6893
+ }
6894
+
6895
+ if (saturation < 0.06) {
6896
+ saturation = 0.06;
6897
+ }
6898
+
6899
+ return Number(saturation.toFixed(2));
6900
+ }
6901
+
6902
+ function getValue(hsv, i, light) {
6903
+ var value;
6904
+
6905
+ if (light) {
6906
+ value = hsv.v + brightnessStep1 * i;
6907
+ } else {
6908
+ value = hsv.v - brightnessStep2 * i;
6909
+ }
6910
+
6911
+ if (value > 1) {
6912
+ value = 1;
6913
+ }
6914
+
6915
+ return Number(value.toFixed(2));
6916
+ }
6917
+
6918
+ function generate(color) {
6919
+ var opts = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
6920
+ var patterns = [];
6921
+ var pColor = inputToRGB(color);
6922
+
6923
+ for (var i = lightColorCount; i > 0; i -= 1) {
6924
+ var hsv = toHsv(pColor);
6925
+ var colorString = toHex(inputToRGB({
6926
+ h: getHue(hsv, i, true),
6927
+ s: getSaturation(hsv, i, true),
6928
+ v: getValue(hsv, i, true)
6929
+ }));
6930
+ patterns.push(colorString);
6931
+ }
6932
+
6933
+ patterns.push(toHex(pColor));
6934
+
6935
+ for (var _i = 1; _i <= darkColorCount; _i += 1) {
6936
+ var _hsv = toHsv(pColor);
6937
+
6938
+ var _colorString = toHex(inputToRGB({
6939
+ h: getHue(_hsv, _i),
6940
+ s: getSaturation(_hsv, _i),
6941
+ v: getValue(_hsv, _i)
6942
+ }));
6943
+
6944
+ patterns.push(_colorString);
6945
+ } // dark theme patterns
6946
+
6947
+
6948
+ if (opts.theme === 'dark') {
6949
+ return darkColorMap.map(function (_ref3) {
6950
+ var index = _ref3.index,
6951
+ opacity = _ref3.opacity;
6952
+ var darkColorString = toHex(mix(inputToRGB(opts.backgroundColor || '#141414'), inputToRGB(patterns[index]), opacity * 100));
6953
+ return darkColorString;
6954
+ });
6955
+ }
6956
+
6957
+ return patterns;
6958
+ }
6959
+
6960
+ var presetPrimaryColors = {
6961
+ red: '#F5222D',
6962
+ volcano: '#FA541C',
6963
+ orange: '#FA8C16',
6964
+ gold: '#FAAD14',
6965
+ yellow: '#FADB14',
6966
+ lime: '#A0D911',
6967
+ green: '#52C41A',
6968
+ cyan: '#13C2C2',
6969
+ blue: '#1890FF',
6970
+ geekblue: '#2F54EB',
6971
+ purple: '#722ED1',
6972
+ magenta: '#EB2F96',
6973
+ grey: '#666666'
6974
+ };
6975
+ var presetPalettes = {};
6976
+ var presetDarkPalettes = {};
6977
+ Object.keys(presetPrimaryColors).forEach(function (key) {
6978
+ presetPalettes[key] = generate(presetPrimaryColors[key]);
6979
+ presetPalettes[key].primary = presetPalettes[key][5]; // dark presetPalettes
6980
+
6981
+ presetDarkPalettes[key] = generate(presetPrimaryColors[key], {
6982
+ theme: 'dark',
6983
+ backgroundColor: '#141414'
6984
+ });
6985
+ presetDarkPalettes[key].primary = presetDarkPalettes[key][5];
6986
+ });
6987
+ presetPalettes.red;
6988
+ presetPalettes.volcano;
6989
+ presetPalettes.gold;
6990
+ presetPalettes.orange;
6991
+ presetPalettes.yellow;
6992
+ presetPalettes.lime;
6993
+ presetPalettes.green;
6994
+ presetPalettes.cyan;
6995
+ presetPalettes.blue;
6996
+ presetPalettes.geekblue;
6997
+ presetPalettes.purple;
6998
+ presetPalettes.magenta;
6999
+ presetPalettes.grey;
7000
+
7001
+ function getStyleByBaseColors(theme, baseColors, backgroundColor) {
7002
+ return (theme === "dark" ? getDarkStyle : getLightStyle)(getCssVariableDefinitionsByPalettes(generatePalettes(baseColors, theme, backgroundColor)));
7003
+ }
7004
+ function getStyleByBrandColor(theme, brandColor) {
7005
+ return (theme === "dark" ? getDarkStyle : getLightStyle)(getCssVariableDefinitionsByBrand(brandColor));
7006
+ }
7007
+ function getStyleByVariables(theme, variables) {
7008
+ return (theme === "dark" ? getDarkStyle : getLightStyle)(getCssVariableDefinitionsByVariables(variables));
7009
+ }
7010
+
7011
+ function getLightStyle(cssVariableDefinitions) {
7012
+ return ":root,\n[data-override-theme=\"light\"] {\n".concat(cssVariableDefinitions, "}");
7013
+ }
7014
+
7015
+ function getDarkStyle(cssVariableDefinitions) {
7016
+ return "html[data-theme=\"dark-v2\"],\n[data-override-theme=\"dark-v2\"] {\n".concat(cssVariableDefinitions, "}");
7017
+ }
7018
+
7019
+ function getCssVariableDefinitionsByPalettes(palettes) {
7020
+ return Object.entries(palettes).flatMap(_ref => {
7021
+ var [colorName, palette] = _ref;
7022
+ ensureBaseColorName(colorName);
7023
+ return palette.map((color, index) => " --palette-".concat(colorName, "-").concat(index + 1, ": ").concat(color, ";")) // Concat an empty string to make a double-line-break for each group of color name.
7024
+ .concat("");
7025
+ }).join("\n");
7026
+ }
7027
+
7028
+ function generatePalettes(baseColors, theme, backgroundColor) {
7029
+ return Object.fromEntries(Object.entries(baseColors).map(_ref2 => {
7030
+ var [colorName, baseColor] = _ref2;
7031
+ return [colorName, generate(baseColor, theme === "dark" ? {
7032
+ theme,
7033
+ backgroundColor
7034
+ } : undefined)];
7035
+ }));
7036
+ }
7037
+
7038
+ function getCssVariableDefinitionsByBrand(color) {
7039
+ if (typeof color === "string") {
7040
+ return " --color-brand: ".concat(color, ";\n");
7041
+ }
7042
+
7043
+ return [" --color-brand: ".concat(color.default, ";"), " --color-brand-hover: ".concat(color.hover, ";"), " --color-brand-active: ".concat(color.active, ";"), ""].join("\n");
7044
+ }
7045
+
7046
+ function getCssVariableDefinitionsByVariables(variables) {
7047
+ return Object.entries(variables).map(_ref3 => {
7048
+ var [name, color] = _ref3;
7049
+ ensureCssVariableName(name);
7050
+ return " ".concat(name, ": ").concat(color, ";");
7051
+ }).concat("").join("\n");
7052
+ }
7053
+
7054
+ function ensureCssVariableName(name) {
7055
+ if (!/^--[a-z][a-z0-9]*(?:-[a-z0-9]+)*$/.test(name)) {
7056
+ throw new Error("Invalid css variable name: ".concat(JSON.stringify(name)));
7057
+ }
7058
+ }
7059
+
7060
+ function ensureBaseColorName(name) {
7061
+ if (!/^[a-z0-9]+(?:-[a-z0-9]+)*$/.test(name)) {
7062
+ throw new Error("Invalid base color name: ".concat(JSON.stringify(name)));
7063
+ }
7064
+ }
7065
+
7066
+ function applyColorTheme(options) {
7067
+ var style = [];
7068
+ var themes = ["light", "dark"];
7069
+ themes.forEach(theme => {
7070
+ if (options[theme]) {
7071
+ switch (options.type) {
7072
+ case "brandColor":
7073
+ style.push(getStyleByBrandColor(theme, options[theme]));
7074
+ break;
7075
+
7076
+ case "baseColors":
7077
+ style.push(getStyleByBaseColors(theme, options[theme], options.backgroundColor));
7078
+ break;
7079
+
7080
+ case "variables":
7081
+ style.push(getStyleByVariables(theme, options[theme]));
7082
+ break;
7083
+ }
7084
+ }
7085
+ });
7086
+
7087
+ if (style.length > 0) {
7088
+ var element = document.createElement("style");
7089
+ element.textContent = style.join("\n\n");
7090
+ document.head.appendChild(element);
7091
+ return () => {
7092
+ element.remove();
7093
+ };
7094
+ }
7095
+ }
7096
+
6192
7097
  class Kernel {
6193
7098
  constructor() {
6194
7099
  _defineProperty__default["default"](this, "mountPoints", void 0);
@@ -6238,6 +7143,8 @@
6238
7143
  var _this = this;
6239
7144
 
6240
7145
  return _asyncToGenerator__default["default"](function* () {
7146
+ var _this$bootstrapData$s, _this$bootstrapData$s2;
7147
+
6241
7148
  _this.mountPoints = mountPoints;
6242
7149
  yield Promise.all([_this.loadCheckLogin(), _this.loadMicroApps()]);
6243
7150
 
@@ -6245,6 +7152,8 @@
6245
7152
  throw new Error("No storyboard were found.");
6246
7153
  }
6247
7154
 
7155
+ generateColorTheme((_this$bootstrapData$s = _this.bootstrapData.settings) === null || _this$bootstrapData$s === void 0 ? void 0 : (_this$bootstrapData$s2 = _this$bootstrapData$s.misc) === null || _this$bootstrapData$s2 === void 0 ? void 0 : _this$bootstrapData$s2.theme);
7156
+
6248
7157
  if (isLoggedIn()) {
6249
7158
  _this.loadSharedData();
6250
7159
  }
@@ -6799,9 +7708,9 @@
6799
7708
  }
6800
7709
 
6801
7710
  getFeatureFlags() {
6802
- var _this$bootstrapData, _this$bootstrapData$s;
7711
+ var _this$bootstrapData, _this$bootstrapData$s3;
6803
7712
 
6804
- return Object.assign({}, (_this$bootstrapData = this.bootstrapData) === null || _this$bootstrapData === void 0 ? void 0 : (_this$bootstrapData$s = _this$bootstrapData.settings) === null || _this$bootstrapData$s === void 0 ? void 0 : _this$bootstrapData$s.featureFlags);
7713
+ return Object.assign({}, (_this$bootstrapData = this.bootstrapData) === null || _this$bootstrapData === void 0 ? void 0 : (_this$bootstrapData$s3 = _this$bootstrapData.settings) === null || _this$bootstrapData$s3 === void 0 ? void 0 : _this$bootstrapData$s3.featureFlags);
6805
7714
  }
6806
7715
 
6807
7716
  getStandaloneMenus(menuId) {
@@ -6870,6 +7779,24 @@
6870
7779
  return brickUtils.loadScript(src, window.PUBLIC_ROOT);
6871
7780
  }
6872
7781
 
7782
+ function generateColorTheme(theme) {
7783
+ if (!theme) {
7784
+ return;
7785
+ } else if (theme.brandColor) {
7786
+ applyColorTheme(_objectSpread__default["default"]({
7787
+ type: "brandColor"
7788
+ }, theme.brandColor));
7789
+ } else if (theme.baseColors) {
7790
+ applyColorTheme(_objectSpread__default["default"]({
7791
+ type: "baseColors"
7792
+ }, theme.baseColors));
7793
+ } else if (theme.variables) {
7794
+ applyColorTheme(_objectSpread__default["default"]({
7795
+ type: "variables"
7796
+ }, theme.variables));
7797
+ }
7798
+ }
7799
+
6873
7800
  /*! (c) Andrea Giammarchi - ISC */
6874
7801
  var self = {};
6875
7802
 
@@ -9184,15 +10111,25 @@
9184
10111
 
9185
10112
  if (useMocks) mocks = _objectSpread__default["default"](_objectSpread__default["default"]({}, useMocks), {}, {
9186
10113
  mockList: (_useMocks$mockList = useMocks.mockList) === null || _useMocks$mockList === void 0 ? void 0 : _useMocks$mockList.map(item => _objectSpread__default["default"](_objectSpread__default["default"]({}, item), {}, {
9187
- uri: item.uri.replace(/(easyops\.api\.)(.+)(@\d+\.\d+\.\d+(?=\/))(.+)/, (_match, p1, p2, _p3, p4) => {
9188
- return "(".concat(p1, ")?").concat(p2, "(@\\d+\\.\\d+\\.\\d+)?").concat(p4, "$");
9189
- }).replace(/:\w+/g, "[\\w|-]+")
10114
+ uri: item.uri.replace(/(easyops\.api\.)(.+?)\/(.+)/, (_match, p1, p2, p3) => {
10115
+ return "(".concat(p1, ")?").concat(p2, "(@\\d+\\.\\d+\\.\\d+)?/").concat(p3, "$");
10116
+ }).replace(/:\w+/g, "([^/]+)")
9190
10117
  }))
9191
10118
  });
9192
10119
  }
9193
- var getMockId = requestUrl => {
9194
- if (mocks.mockList.find(item => new RegExp(item.uri).test(requestUrl))) return mocks.mockId;
9195
- return undefined;
10120
+ var getMockInfo = requestUrl => {
10121
+ var item = mocks.mockList.find(item => new RegExp(item.uri).test(requestUrl));
10122
+
10123
+ if (item) {
10124
+ return {
10125
+ url: requestUrl.replace(/(api\/gateway\/.+?)(@\d+\.\d+\.\d+)?\/(.+)/, (_match, p1, _p2, p3) => {
10126
+ return "".concat(p1, "/").concat(p3);
10127
+ }).replace(/(api\/gateway)/, "api/gateway/mock_server.proxy.".concat(mocks.mockId)),
10128
+ mockId: mocks.mockId
10129
+ };
10130
+ }
10131
+
10132
+ return;
9196
10133
  };
9197
10134
 
9198
10135
  class Router {
@@ -9574,7 +10511,10 @@
9574
10511
  portal.length > 0 && mountTree(portal, mountPoints.portal);
9575
10512
  afterMountTree(mountPoints.main);
9576
10513
  afterMountTree(mountPoints.portal);
9577
- afterMountTree(mountPoints.bg);
10514
+ afterMountTree(mountPoints.bg); // Scroll to top after each rendering.
10515
+ // See https://github.com/ReactTraining/react-router/blob/master/packages/react-router-dom/docs/guides/scroll-restoration.md
10516
+
10517
+ window.scrollTo(0, 0);
9578
10518
 
9579
10519
  if (!failed) {
9580
10520
  _this3.locationContext.handlePageLoad();
@@ -9584,11 +10524,8 @@
9584
10524
  _this3.locationContext.resolver.scheduleRefreshing();
9585
10525
 
9586
10526
  _this3.locationContext.handleMessage();
9587
- } // Scroll to top after each rendering.
9588
- // See https://github.com/ReactTraining/react-router/blob/master/packages/react-router-dom/docs/guides/scroll-restoration.md
9589
-
10527
+ }
9590
10528
 
9591
- window.scrollTo(0, 0);
9592
10529
  pageTracker === null || pageTracker === void 0 ? void 0 : pageTracker(locationContext.getCurrentMatch().path); // analytics page_view event
9593
10530
 
9594
10531
  easyopsAnalytics.userAnalytics.event("page_view", _objectSpread__default["default"]({
@@ -10886,9 +11823,289 @@
10886
11823
  };
10887
11824
  var defaultLocale = localeValues;
10888
11825
 
10889
- var emptyImage = "empty-image.8e18d87fea570ef0.png";
11826
+ function _extends$1() { _extends$1 = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$1.apply(this, arguments); }
11827
+
11828
+ var _ref$1 = /*#__PURE__*/React__namespace.createElement("defs", null, /*#__PURE__*/React__namespace.createElement("linearGradient", {
11829
+ x1: "5.718%",
11830
+ y1: "4.311%",
11831
+ x2: "83.05%",
11832
+ y2: "88.915%",
11833
+ id: "empty-image_svg__a"
11834
+ }, /*#__PURE__*/React__namespace.createElement("stop", {
11835
+ stopColor: "#D4D8E4",
11836
+ offset: "0%"
11837
+ }), /*#__PURE__*/React__namespace.createElement("stop", {
11838
+ stopColor: "#A9B0C4",
11839
+ offset: "100%"
11840
+ })), /*#__PURE__*/React__namespace.createElement("linearGradient", {
11841
+ x1: "0%",
11842
+ y1: "11.08%",
11843
+ x2: "80.548%",
11844
+ y2: "107.704%",
11845
+ id: "empty-image_svg__d"
11846
+ }, /*#__PURE__*/React__namespace.createElement("stop", {
11847
+ stopColor: "#C2C7DA",
11848
+ offset: "0%"
11849
+ }), /*#__PURE__*/React__namespace.createElement("stop", {
11850
+ stopColor: "#8F96B3",
11851
+ offset: "100%"
11852
+ })), /*#__PURE__*/React__namespace.createElement("path", {
11853
+ d: "M23.672 23.607h2.492a4 4 0 0 1 4 4v2.491a4 4 0 0 1-4 4h-2.492a4 4 0 0 1-4-4v-2.491a4 4 0 0 1 4-4z",
11854
+ id: "empty-image_svg__c"
11855
+ }), /*#__PURE__*/React__namespace.createElement("filter", {
11856
+ x: "-57.2%",
11857
+ y: "-47.7%",
11858
+ width: "233.4%",
11859
+ height: "233.4%",
11860
+ filterUnits: "objectBoundingBox",
11861
+ id: "empty-image_svg__b"
11862
+ }, /*#__PURE__*/React__namespace.createElement("feOffset", {
11863
+ dx: 1,
11864
+ dy: 2,
11865
+ in: "SourceAlpha",
11866
+ result: "shadowOffsetOuter1"
11867
+ }), /*#__PURE__*/React__namespace.createElement("feGaussianBlur", {
11868
+ stdDeviation: 2,
11869
+ in: "shadowOffsetOuter1",
11870
+ result: "shadowBlurOuter1"
11871
+ }), /*#__PURE__*/React__namespace.createElement("feComposite", {
11872
+ in: "shadowBlurOuter1",
11873
+ in2: "SourceAlpha",
11874
+ operator: "out",
11875
+ result: "shadowBlurOuter1"
11876
+ }), /*#__PURE__*/React__namespace.createElement("feColorMatrix", {
11877
+ values: "0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.22 0",
11878
+ in: "shadowBlurOuter1"
11879
+ })), /*#__PURE__*/React__namespace.createElement("linearGradient", {
11880
+ x1: "41.823%",
11881
+ y1: "24.795%",
11882
+ x2: "8.813%",
11883
+ y2: "86.427%",
11884
+ id: "empty-image_svg__g"
11885
+ }, /*#__PURE__*/React__namespace.createElement("stop", {
11886
+ stopColor: "#CCD0DD",
11887
+ offset: "0%"
11888
+ }), /*#__PURE__*/React__namespace.createElement("stop", {
11889
+ stopColor: "#9DA3B9",
11890
+ offset: "100%"
11891
+ })), /*#__PURE__*/React__namespace.createElement("path", {
11892
+ d: "M37.311 12.459a4 4 0 0 1 4 4v3.419l-7.418-7.419h3.418z",
11893
+ id: "empty-image_svg__f"
11894
+ }), /*#__PURE__*/React__namespace.createElement("filter", {
11895
+ x: "-94.4%",
11896
+ y: "-121.3%",
11897
+ width: "288.7%",
11898
+ height: "288.7%",
11899
+ filterUnits: "objectBoundingBox",
11900
+ id: "empty-image_svg__e"
11901
+ }, /*#__PURE__*/React__namespace.createElement("feOffset", {
11902
+ dy: -2,
11903
+ in: "SourceAlpha",
11904
+ result: "shadowOffsetOuter1"
11905
+ }), /*#__PURE__*/React__namespace.createElement("feGaussianBlur", {
11906
+ stdDeviation: 2,
11907
+ in: "shadowOffsetOuter1",
11908
+ result: "shadowBlurOuter1"
11909
+ }), /*#__PURE__*/React__namespace.createElement("feColorMatrix", {
11910
+ values: "0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.25 0",
11911
+ in: "shadowBlurOuter1"
11912
+ })));
11913
+
11914
+ var _ref2$1 = /*#__PURE__*/React__namespace.createElement("g", {
11915
+ fill: "none",
11916
+ fillRule: "evenodd"
11917
+ }, /*#__PURE__*/React__namespace.createElement("path", {
11918
+ d: "M39.682 33.967H10.81a2.8 2.8 0 0 0-1.94.782l-5.197 4.999v6.98a5.6 5.6 0 0 0 5.6 5.6H41.22a5.6 5.6 0 0 0 5.6-5.6v-6.98l-5.196-4.999a2.8 2.8 0 0 0-1.942-.782z",
11919
+ fill: "#A6AAC3"
11920
+ }), /*#__PURE__*/React__namespace.createElement("path", {
11921
+ d: "M33.893 12.459l7.418 7.419v22.568a2.8 2.8 0 0 1-2.8 2.8h-26.53a2.8 2.8 0 0 1-2.8-2.8V18.459a6 6 0 0 1 6-6h18.712z",
11922
+ fill: "url(#empty-image_svg__a)"
11923
+ }), /*#__PURE__*/React__namespace.createElement("g", null, /*#__PURE__*/React__namespace.createElement("use", {
11924
+ fill: "#000",
11925
+ filter: "url(#empty-image_svg__b)",
11926
+ xlinkHref: "#empty-image_svg__c"
11927
+ }), /*#__PURE__*/React__namespace.createElement("path", {
11928
+ stroke: "#FFF",
11929
+ d: "M26.164 24.107c.966 0 1.841.391 2.475 1.025a3.489 3.489 0 0 1 1.025 2.475h0v2.491c0 .967-.392 1.842-1.025 2.475a3.489 3.489 0 0 1-2.475 1.025h0-2.492a3.489 3.489 0 0 1-2.475-1.025 3.489 3.489 0 0 1-1.025-2.475h0v-2.491c0-.967.392-1.842 1.025-2.475a3.489 3.489 0 0 1 2.475-1.025h0z",
11930
+ strokeLinejoin: "square",
11931
+ fill: "url(#empty-image_svg__d)"
11932
+ })), /*#__PURE__*/React__namespace.createElement("g", {
11933
+ transform: "rotate(180 37.602 16.168)"
11934
+ }, /*#__PURE__*/React__namespace.createElement("use", {
11935
+ fill: "#000",
11936
+ filter: "url(#empty-image_svg__e)",
11937
+ xlinkHref: "#empty-image_svg__f"
11938
+ }), /*#__PURE__*/React__namespace.createElement("use", {
11939
+ fill: "url(#empty-image_svg__g)",
11940
+ xlinkHref: "#empty-image_svg__f"
11941
+ })), /*#__PURE__*/React__namespace.createElement("path", {
11942
+ d: "M54.164 27.541c.253 0 .459.205.459.459v.918h.918a.459.459 0 1 1 0 .918h-.918v.918a.459.459 0 0 1-.918 0v-.918h-.918a.459.459 0 0 1 0-.918h.918V28c0-.254.205-.459.459-.459zM1.377 20.197c.19 0 .344.154.344.344v.574h.574a.459.459 0 1 1 0 .918h-.574v.574a.344.344 0 0 1-.688 0l-.001-.574H.459a.459.459 0 0 1 0-.918h.573v-.574c0-.19.155-.344.345-.344z",
11943
+ fill: "#D6D8E4",
11944
+ opacity: 0.3
11945
+ }), /*#__PURE__*/React__namespace.createElement("path", {
11946
+ d: "M24.787 43.53h.014c7.087.143 9.817-3.834 12.785-4.046l.19-.008h9.044v10.052a2.8 2.8 0 0 1-2.63 2.795l-.17.005H6.472l-.17-.005a2.8 2.8 0 0 1-2.63-2.795V39.475h8.126l.144-.004c2.485.004 5.214 3.898 12.83 4.06l.015-.002z",
11947
+ fill: "#D6D8E4"
11948
+ }), /*#__PURE__*/React__namespace.createElement("path", {
11949
+ d: "M13.77 2.2s2.308-.555 2.962-2.2c.943 1.35 1.429 1.933 2.547 2.189-1.522.453-2.183.963-2.704 2.401-.598-1.695-1.142-1.914-2.805-2.39",
11950
+ fill: "#D6D8E4",
11951
+ opacity: 0.5
11952
+ }), /*#__PURE__*/React__namespace.createElement("path", {
11953
+ d: "M41.311 6.64S47.464 5.194 49.21.917c2.514 3.508 3.81 5.025 6.791 5.691-4.059 1.18-5.822 2.503-7.21 6.243-1.594-4.406-3.045-4.976-7.479-6.213",
11954
+ fill: "#D6D8E4",
11955
+ opacity: 0.8
11956
+ }));
10890
11957
 
10891
- var bigEmptyImage = "big-empty-image.397ff6359f4066d8.png";
11958
+ function SvgEmptyImage(props) {
11959
+ return /*#__PURE__*/React__namespace.createElement("svg", _extends$1({
11960
+ width: 56,
11961
+ height: 53,
11962
+ viewBox: "0 0 56 53",
11963
+ xmlns: "http://www.w3.org/2000/svg",
11964
+ xmlnsXlink: "http://www.w3.org/1999/xlink"
11965
+ }, props), _ref$1, _ref2$1);
11966
+ }
11967
+
11968
+ function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
11969
+
11970
+ var _ref = /*#__PURE__*/React__namespace.createElement("defs", null, /*#__PURE__*/React__namespace.createElement("linearGradient", {
11971
+ x1: "5.718%",
11972
+ y1: "4.311%",
11973
+ x2: "83.05%",
11974
+ y2: "88.915%",
11975
+ id: "big-empty-image_svg__a"
11976
+ }, /*#__PURE__*/React__namespace.createElement("stop", {
11977
+ stopColor: "#D4D8E4",
11978
+ offset: "0%"
11979
+ }), /*#__PURE__*/React__namespace.createElement("stop", {
11980
+ stopColor: "#A9B0C4",
11981
+ offset: "100%"
11982
+ })), /*#__PURE__*/React__namespace.createElement("linearGradient", {
11983
+ x1: "0%",
11984
+ y1: "11.08%",
11985
+ x2: "80.548%",
11986
+ y2: "107.704%",
11987
+ id: "big-empty-image_svg__d"
11988
+ }, /*#__PURE__*/React__namespace.createElement("stop", {
11989
+ stopColor: "#C2C7DA",
11990
+ offset: "0%"
11991
+ }), /*#__PURE__*/React__namespace.createElement("stop", {
11992
+ stopColor: "#8F96B3",
11993
+ offset: "100%"
11994
+ })), /*#__PURE__*/React__namespace.createElement("path", {
11995
+ d: "M34 36h8a4 4 0 0 1 4 4v8a4 4 0 0 1-4 4h-8a4 4 0 0 1-4-4v-8a4 4 0 0 1 4-4z",
11996
+ id: "big-empty-image_svg__c"
11997
+ }), /*#__PURE__*/React__namespace.createElement("filter", {
11998
+ x: "-37.5%",
11999
+ y: "-31.3%",
12000
+ width: "187.5%",
12001
+ height: "187.5%",
12002
+ filterUnits: "objectBoundingBox",
12003
+ id: "big-empty-image_svg__b"
12004
+ }, /*#__PURE__*/React__namespace.createElement("feOffset", {
12005
+ dx: 1,
12006
+ dy: 2,
12007
+ in: "SourceAlpha",
12008
+ result: "shadowOffsetOuter1"
12009
+ }), /*#__PURE__*/React__namespace.createElement("feGaussianBlur", {
12010
+ stdDeviation: 2,
12011
+ in: "shadowOffsetOuter1",
12012
+ result: "shadowBlurOuter1"
12013
+ }), /*#__PURE__*/React__namespace.createElement("feComposite", {
12014
+ in: "shadowBlurOuter1",
12015
+ in2: "SourceAlpha",
12016
+ operator: "out",
12017
+ result: "shadowBlurOuter1"
12018
+ }), /*#__PURE__*/React__namespace.createElement("feColorMatrix", {
12019
+ values: "0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.22 0",
12020
+ in: "shadowBlurOuter1"
12021
+ })), /*#__PURE__*/React__namespace.createElement("linearGradient", {
12022
+ x1: "41.823%",
12023
+ y1: "24.795%",
12024
+ x2: "8.813%",
12025
+ y2: "86.427%",
12026
+ id: "big-empty-image_svg__g"
12027
+ }, /*#__PURE__*/React__namespace.createElement("stop", {
12028
+ stopColor: "#CCD0DD",
12029
+ offset: "0%"
12030
+ }), /*#__PURE__*/React__namespace.createElement("stop", {
12031
+ stopColor: "#9DA3B9",
12032
+ offset: "100%"
12033
+ })), /*#__PURE__*/React__namespace.createElement("path", {
12034
+ d: "M59 19a4 4 0 0 1 4 4v7.314L51.686 19H59z",
12035
+ id: "big-empty-image_svg__f"
12036
+ }), /*#__PURE__*/React__namespace.createElement("filter", {
12037
+ x: "-61.9%",
12038
+ y: "-79.5%",
12039
+ width: "223.7%",
12040
+ height: "223.7%",
12041
+ filterUnits: "objectBoundingBox",
12042
+ id: "big-empty-image_svg__e"
12043
+ }, /*#__PURE__*/React__namespace.createElement("feOffset", {
12044
+ dy: -2,
12045
+ in: "SourceAlpha",
12046
+ result: "shadowOffsetOuter1"
12047
+ }), /*#__PURE__*/React__namespace.createElement("feGaussianBlur", {
12048
+ stdDeviation: 2,
12049
+ in: "shadowOffsetOuter1",
12050
+ result: "shadowBlurOuter1"
12051
+ }), /*#__PURE__*/React__namespace.createElement("feColorMatrix", {
12052
+ values: "0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.25 0",
12053
+ in: "shadowBlurOuter1"
12054
+ })));
12055
+
12056
+ var _ref2 = /*#__PURE__*/React__namespace.createElement("g", {
12057
+ fill: "none",
12058
+ fillRule: "evenodd"
12059
+ }, /*#__PURE__*/React__namespace.createElement("path", {
12060
+ d: "M61.108 51.8H15.892a2.8 2.8 0 0 0-1.941.782L5.6 60.615V74.2a5.6 5.6 0 0 0 5.6 5.6h54.6a5.6 5.6 0 0 0 5.6-5.6V60.615l-8.35-8.033a2.8 2.8 0 0 0-1.942-.782z",
12061
+ fill: "#A6AAC3"
12062
+ }), /*#__PURE__*/React__namespace.createElement("path", {
12063
+ d: "M51.686 19L63 30.314V66.2a2.8 2.8 0 0 1-2.8 2.8H16.8a2.8 2.8 0 0 1-2.8-2.8V25a6 6 0 0 1 6-6h31.686z",
12064
+ fill: "url(#big-empty-image_svg__a)"
12065
+ }), /*#__PURE__*/React__namespace.createElement("g", null, /*#__PURE__*/React__namespace.createElement("use", {
12066
+ fill: "#000",
12067
+ filter: "url(#big-empty-image_svg__b)",
12068
+ xlinkHref: "#big-empty-image_svg__c"
12069
+ }), /*#__PURE__*/React__namespace.createElement("path", {
12070
+ stroke: "#FFF",
12071
+ d: "M42 36.5c.966 0 1.841.392 2.475 1.025A3.489 3.489 0 0 1 45.5 40h0v8c0 .966-.392 1.841-1.025 2.475A3.489 3.489 0 0 1 42 51.5h0-8a3.489 3.489 0 0 1-2.475-1.025A3.489 3.489 0 0 1 30.5 48h0v-8c0-.966.392-1.841 1.025-2.475A3.489 3.489 0 0 1 34 36.5h0z",
12072
+ strokeLinejoin: "square",
12073
+ fill: "url(#big-empty-image_svg__d)"
12074
+ })), /*#__PURE__*/React__namespace.createElement("g", {
12075
+ transform: "rotate(180 57.343 24.657)"
12076
+ }, /*#__PURE__*/React__namespace.createElement("use", {
12077
+ fill: "#000",
12078
+ filter: "url(#big-empty-image_svg__e)",
12079
+ xlinkHref: "#big-empty-image_svg__f"
12080
+ }), /*#__PURE__*/React__namespace.createElement("use", {
12081
+ fill: "url(#big-empty-image_svg__g)",
12082
+ xlinkHref: "#big-empty-image_svg__f"
12083
+ })), /*#__PURE__*/React__namespace.createElement("path", {
12084
+ d: "M82.6 42a.7.7 0 0 1 .7.7v1.399l1.4.001a.7.7 0 0 1 0 1.4l-1.4-.001V46.9a.7.7 0 0 1-1.4 0v-1.401l-1.4.001a.7.7 0 0 1 0-1.4l1.4-.001V42.7a.7.7 0 0 1 .7-.7zM2.1 30.8c.29 0 .525.235.525.525l-.001.874.876.001a.7.7 0 0 1 0 1.4h-.876l.001.875a.525.525 0 1 1-1.05 0l-.001-.875H.7a.7.7 0 0 1 0-1.4l.874-.001.001-.874c0-.29.235-.525.525-.525z",
12085
+ fill: "#D6D8E4",
12086
+ opacity: 0.3
12087
+ }), /*#__PURE__*/React__namespace.createElement("path", {
12088
+ d: "M8.4 79.8l-.17-.005A2.8 2.8 0 0 1 5.6 77V60.2h12.393l.175-.006c3.802-.04 7.95 5.943 19.61 6.19l.022-.002.022.002c10.856.218 15.009-5.902 19.558-6.175l.227-.009H71.4V77a2.8 2.8 0 0 1-2.63 2.795l-.17.005H8.4z",
12089
+ fill: "#D6D8E4"
12090
+ }), /*#__PURE__*/React__namespace.createElement("path", {
12091
+ d: "M21 3.356S24.518 2.509 25.516 0c1.438 2.057 2.18 2.947 3.884 3.338-2.321.692-3.33 1.468-4.123 3.662-.912-2.584-1.741-2.919-4.277-3.644",
12092
+ fill: "#D6D8E4",
12093
+ opacity: 0.5
12094
+ }), /*#__PURE__*/React__namespace.createElement("path", {
12095
+ d: "M63 10.125S72.382 7.923 75.044 1.4c3.834 5.35 5.81 7.663 10.356 8.68-6.19 1.797-8.878 3.816-10.995 9.52-2.43-6.72-4.643-7.59-11.405-9.475",
12096
+ fill: "#D6D8E4",
12097
+ opacity: 0.8
12098
+ }));
12099
+
12100
+ function SvgBigEmptyImage(props) {
12101
+ return /*#__PURE__*/React__namespace.createElement("svg", _extends({
12102
+ width: 86,
12103
+ height: 80,
12104
+ viewBox: "0 0 86 80",
12105
+ xmlns: "http://www.w3.org/2000/svg",
12106
+ xmlnsXlink: "http://www.w3.org/1999/xlink"
12107
+ }, props), _ref, _ref2);
12108
+ }
10892
12109
 
10893
12110
  /**
10894
12111
  * 用于展示空数据的 React 组件。
@@ -10898,29 +12115,25 @@
10898
12115
 
10899
12116
  var illustration = React.useMemo(() => props.illustration && illustrations.getIllustration(props.illustration), [props.illustration]);
10900
12117
 
10901
- var _emptyImage = props.useBigEmptyImage ? bigEmptyImage : emptyImage;
12118
+ var _emptyImage = props.useBigEmptyImage ? SvgBigEmptyImage : SvgEmptyImage;
10902
12119
 
10903
- var image = props.illustration ? illustration : getImageUrl(_emptyImage);
12120
+ var image = props.illustration ? illustration : /*#__PURE__*/React__default["default"].createElement(_emptyImage);
10904
12121
  var imageStyle = (_props$imageStyle = props.imageStyle) !== null && _props$imageStyle !== void 0 ? _props$imageStyle : props.useBigEmptyImage ? undefined : {
10905
12122
  height: "60px"
10906
12123
  };
10907
12124
  return /*#__PURE__*/React__default["default"].createElement(antd.Empty, {
10908
12125
  image: image,
10909
12126
  imageStyle: imageStyle,
10910
- description: props.description
12127
+ description: props.description,
12128
+ style: {
12129
+ color: "var(--text-color-secondary)"
12130
+ }
10911
12131
  });
10912
12132
  }
10913
-
10914
- function getImageUrl(url) {
10915
- var _window$CORE_ROOT;
10916
-
10917
- return "".concat((_window$CORE_ROOT = window.CORE_ROOT) !== null && _window$CORE_ROOT !== void 0 ? _window$CORE_ROOT : "", "assets/").concat(url);
10918
- }
10919
12133
  /**
10920
12134
  * 调用后获得一个默认的展示空数据的 React 组件。
10921
12135
  */
10922
12136
 
10923
-
10924
12137
  function renderEasyopsEmpty() {
10925
12138
  return /*#__PURE__*/React__default["default"].createElement(EasyopsEmpty, null);
10926
12139
  }
@@ -11418,7 +12631,7 @@
11418
12631
  exports.event = event;
11419
12632
  exports.getAuth = getAuth;
11420
12633
  exports.getHistory = getHistory;
11421
- exports.getMockId = getMockId;
12634
+ exports.getMockInfo = getMockInfo;
11422
12635
  exports.getRuntime = getRuntime;
11423
12636
  exports.handleHttpError = handleHttpError;
11424
12637
  exports.httpErrorToString = httpErrorToString;