@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.
package/dist/index.esm.js CHANGED
@@ -3,7 +3,8 @@ import _objectSpread from '@babel/runtime/helpers/objectSpread2';
3
3
  import _objectWithoutProperties from '@babel/runtime/helpers/objectWithoutProperties';
4
4
  import _asyncToGenerator$4 from '@babel/runtime/helpers/asyncToGenerator';
5
5
  import _defineProperty$1 from '@babel/runtime/helpers/defineProperty';
6
- import React, { useState, useEffect, forwardRef, useRef, useImperativeHandle, useMemo, useContext, createContext } from 'react';
6
+ import * as React from 'react';
7
+ import React__default, { useState, useEffect, forwardRef, useRef, useImperativeHandle, useMemo, useContext, createContext } from 'react';
7
8
  import lodash, { set, get, difference, identity, cloneDeep, isNil, sortBy, merge, clamp, uniqueId, orderBy, omit, isEmpty } from 'lodash';
8
9
  import { toPath, computeRealRoutePath, hasOwnProperty, isObject, isEvaluable, transformAndInject, transform, trackContext, scanPermissionActionsInStoryboard, precookFunction, cook, shouldAllowRecursiveEvaluations, preevaluate, inject, deepFreeze, createProviderClass, scanRouteAliasInStoryboard, loadScript, getTemplateDepsOfStoryboard, getDllAndDepsOfStoryboard, asyncProcessStoryboard, prefetchScript, scanBricksInBrickConf, scanProcessorsInAny, getDllAndDepsByResource, resolveContextConcurrently, matchPath, asyncProcessBrick, restoreDynamicTemplates, mapCustomApisToNameAndNamespace, scanCustomApisInStoryboard } from '@next-core/brick-utils';
9
10
  import { http, HttpResponseError, HttpFetchError } from '@next-core/brick-http';
@@ -15,7 +16,7 @@ import yaml from 'js-yaml';
15
16
  import { Modal, message, Empty, ConfigProvider } from 'antd';
16
17
  import { ExclamationCircleOutlined } from '@ant-design/icons';
17
18
  import { withTranslation } from 'react-i18next';
18
- import _extends from '@babel/runtime/helpers/esm/extends';
19
+ import _extends$2 from '@babel/runtime/helpers/esm/extends';
19
20
  import { getIllustration } from '@next-core/illustrations';
20
21
  import _decorate from '@babel/runtime/helpers/decorate';
21
22
 
@@ -3199,8 +3200,8 @@ function handleHttpError(error) {
3199
3200
  }
3200
3201
 
3201
3202
  unauthenticatedConfirmModal = Modal.confirm({
3202
- icon: /*#__PURE__*/React.createElement(ExclamationCircleOutlined, null),
3203
- content: /*#__PURE__*/React.createElement(LoginTimeoutMessage, null),
3203
+ icon: /*#__PURE__*/React__default.createElement(ExclamationCircleOutlined, null),
3204
+ content: /*#__PURE__*/React__default.createElement(LoginTimeoutMessage, null),
3204
3205
  okText: i18next.t("".concat(NS_BRICK_KIT, ":").concat(K.MODAL_OK)),
3205
3206
  cancelText: i18next.t("".concat(NS_BRICK_KIT, ":").concat(K.MODAL_CANCEL)),
3206
3207
  onOk: () => {
@@ -3218,7 +3219,7 @@ function handleHttpError(error) {
3218
3219
 
3219
3220
  return Modal.error({
3220
3221
  title: i18next.t("".concat(NS_BRICK_KIT, ":").concat(K.REQUEST_FAILED)),
3221
- content: /*#__PURE__*/React.createElement("div", {
3222
+ content: /*#__PURE__*/React__default.createElement("div", {
3222
3223
  style: {
3223
3224
  whiteSpace: "pre-wrap"
3224
3225
  }
@@ -3227,13 +3228,13 @@ function handleHttpError(error) {
3227
3228
  });
3228
3229
  }
3229
3230
  function LoginTimeoutMessage() {
3230
- React.useEffect(() => {
3231
+ React__default.useEffect(() => {
3231
3232
  // Unset confirm modal when it's destroyed.
3232
3233
  return () => {
3233
3234
  unauthenticatedConfirmModal = undefined;
3234
3235
  };
3235
3236
  }, []);
3236
- return /*#__PURE__*/React.createElement("div", null, i18next.t("".concat(NS_BRICK_KIT, ":").concat(K.LOGIN_TIMEOUT_MESSAGE)));
3237
+ return /*#__PURE__*/React__default.createElement("div", null, i18next.t("".concat(NS_BRICK_KIT, ":").concat(K.LOGIN_TIMEOUT_MESSAGE)));
3237
3238
  }
3238
3239
 
3239
3240
  class WebsocketMessageRequest {
@@ -6190,6 +6191,892 @@ function _standaloneBootstrap() {
6190
6191
  return _standaloneBootstrap.apply(this, arguments);
6191
6192
  }
6192
6193
 
6194
+ /**
6195
+ * Take input from [0, n] and return it as [0, 1]
6196
+ * @hidden
6197
+ */
6198
+ function bound01(n, max) {
6199
+ if (isOnePointZero(n)) {
6200
+ n = '100%';
6201
+ }
6202
+ var isPercent = isPercentage(n);
6203
+ n = max === 360 ? n : Math.min(max, Math.max(0, parseFloat(n)));
6204
+ // Automatically convert percentage into number
6205
+ if (isPercent) {
6206
+ n = parseInt(String(n * max), 10) / 100;
6207
+ }
6208
+ // Handle floating point rounding errors
6209
+ if (Math.abs(n - max) < 0.000001) {
6210
+ return 1;
6211
+ }
6212
+ // Convert into [0, 1] range if it isn't already
6213
+ if (max === 360) {
6214
+ // If n is a hue given in degrees,
6215
+ // wrap around out-of-range values into [0, 360] range
6216
+ // then convert into [0, 1].
6217
+ n = (n < 0 ? (n % max) + max : n % max) / parseFloat(String(max));
6218
+ }
6219
+ else {
6220
+ // If n not a hue given in degrees
6221
+ // Convert into [0, 1] range if it isn't already.
6222
+ n = (n % max) / parseFloat(String(max));
6223
+ }
6224
+ return n;
6225
+ }
6226
+ /**
6227
+ * Need to handle 1.0 as 100%, since once it is a number, there is no difference between it and 1
6228
+ * <http://stackoverflow.com/questions/7422072/javascript-how-to-detect-number-as-a-decimal-including-1-0>
6229
+ * @hidden
6230
+ */
6231
+ function isOnePointZero(n) {
6232
+ return typeof n === 'string' && n.indexOf('.') !== -1 && parseFloat(n) === 1;
6233
+ }
6234
+ /**
6235
+ * Check to see if string passed in is a percentage
6236
+ * @hidden
6237
+ */
6238
+ function isPercentage(n) {
6239
+ return typeof n === 'string' && n.indexOf('%') !== -1;
6240
+ }
6241
+ /**
6242
+ * Return a valid alpha value [0,1] with all invalid values being set to 1
6243
+ * @hidden
6244
+ */
6245
+ function boundAlpha(a) {
6246
+ a = parseFloat(a);
6247
+ if (isNaN(a) || a < 0 || a > 1) {
6248
+ a = 1;
6249
+ }
6250
+ return a;
6251
+ }
6252
+ /**
6253
+ * Replace a decimal with it's percentage value
6254
+ * @hidden
6255
+ */
6256
+ function convertToPercentage(n) {
6257
+ if (n <= 1) {
6258
+ return Number(n) * 100 + "%";
6259
+ }
6260
+ return n;
6261
+ }
6262
+ /**
6263
+ * Force a hex value to have 2 characters
6264
+ * @hidden
6265
+ */
6266
+ function pad2(c) {
6267
+ return c.length === 1 ? '0' + c : String(c);
6268
+ }
6269
+
6270
+ // `rgbToHsl`, `rgbToHsv`, `hslToRgb`, `hsvToRgb` modified from:
6271
+ // <http://mjijackson.com/2008/02/rgb-to-hsl-and-rgb-to-hsv-color-model-conversion-algorithms-in-javascript>
6272
+ /**
6273
+ * Handle bounds / percentage checking to conform to CSS color spec
6274
+ * <http://www.w3.org/TR/css3-color/>
6275
+ * *Assumes:* r, g, b in [0, 255] or [0, 1]
6276
+ * *Returns:* { r, g, b } in [0, 255]
6277
+ */
6278
+ function rgbToRgb(r, g, b) {
6279
+ return {
6280
+ r: bound01(r, 255) * 255,
6281
+ g: bound01(g, 255) * 255,
6282
+ b: bound01(b, 255) * 255,
6283
+ };
6284
+ }
6285
+ function hue2rgb(p, q, t) {
6286
+ if (t < 0) {
6287
+ t += 1;
6288
+ }
6289
+ if (t > 1) {
6290
+ t -= 1;
6291
+ }
6292
+ if (t < 1 / 6) {
6293
+ return p + (q - p) * (6 * t);
6294
+ }
6295
+ if (t < 1 / 2) {
6296
+ return q;
6297
+ }
6298
+ if (t < 2 / 3) {
6299
+ return p + (q - p) * (2 / 3 - t) * 6;
6300
+ }
6301
+ return p;
6302
+ }
6303
+ /**
6304
+ * Converts an HSL color value to RGB.
6305
+ *
6306
+ * *Assumes:* h is contained in [0, 1] or [0, 360] and s and l are contained [0, 1] or [0, 100]
6307
+ * *Returns:* { r, g, b } in the set [0, 255]
6308
+ */
6309
+ function hslToRgb(h, s, l) {
6310
+ var r;
6311
+ var g;
6312
+ var b;
6313
+ h = bound01(h, 360);
6314
+ s = bound01(s, 100);
6315
+ l = bound01(l, 100);
6316
+ if (s === 0) {
6317
+ // achromatic
6318
+ g = l;
6319
+ b = l;
6320
+ r = l;
6321
+ }
6322
+ else {
6323
+ var q = l < 0.5 ? l * (1 + s) : l + s - l * s;
6324
+ var p = 2 * l - q;
6325
+ r = hue2rgb(p, q, h + 1 / 3);
6326
+ g = hue2rgb(p, q, h);
6327
+ b = hue2rgb(p, q, h - 1 / 3);
6328
+ }
6329
+ return { r: r * 255, g: g * 255, b: b * 255 };
6330
+ }
6331
+ /**
6332
+ * Converts an RGB color value to HSV
6333
+ *
6334
+ * *Assumes:* r, g, and b are contained in the set [0, 255] or [0, 1]
6335
+ * *Returns:* { h, s, v } in [0,1]
6336
+ */
6337
+ function rgbToHsv(r, g, b) {
6338
+ r = bound01(r, 255);
6339
+ g = bound01(g, 255);
6340
+ b = bound01(b, 255);
6341
+ var max = Math.max(r, g, b);
6342
+ var min = Math.min(r, g, b);
6343
+ var h = 0;
6344
+ var v = max;
6345
+ var d = max - min;
6346
+ var s = max === 0 ? 0 : d / max;
6347
+ if (max === min) {
6348
+ h = 0; // achromatic
6349
+ }
6350
+ else {
6351
+ switch (max) {
6352
+ case r:
6353
+ h = (g - b) / d + (g < b ? 6 : 0);
6354
+ break;
6355
+ case g:
6356
+ h = (b - r) / d + 2;
6357
+ break;
6358
+ case b:
6359
+ h = (r - g) / d + 4;
6360
+ break;
6361
+ }
6362
+ h /= 6;
6363
+ }
6364
+ return { h: h, s: s, v: v };
6365
+ }
6366
+ /**
6367
+ * Converts an HSV color value to RGB.
6368
+ *
6369
+ * *Assumes:* h is contained in [0, 1] or [0, 360] and s and v are contained in [0, 1] or [0, 100]
6370
+ * *Returns:* { r, g, b } in the set [0, 255]
6371
+ */
6372
+ function hsvToRgb(h, s, v) {
6373
+ h = bound01(h, 360) * 6;
6374
+ s = bound01(s, 100);
6375
+ v = bound01(v, 100);
6376
+ var i = Math.floor(h);
6377
+ var f = h - i;
6378
+ var p = v * (1 - s);
6379
+ var q = v * (1 - f * s);
6380
+ var t = v * (1 - (1 - f) * s);
6381
+ var mod = i % 6;
6382
+ var r = [v, q, p, p, t, v][mod];
6383
+ var g = [t, v, v, q, p, p][mod];
6384
+ var b = [p, p, t, v, v, q][mod];
6385
+ return { r: r * 255, g: g * 255, b: b * 255 };
6386
+ }
6387
+ /**
6388
+ * Converts an RGB color to hex
6389
+ *
6390
+ * Assumes r, g, and b are contained in the set [0, 255]
6391
+ * Returns a 3 or 6 character hex
6392
+ */
6393
+ function rgbToHex(r, g, b, allow3Char) {
6394
+ var hex = [
6395
+ pad2(Math.round(r).toString(16)),
6396
+ pad2(Math.round(g).toString(16)),
6397
+ pad2(Math.round(b).toString(16)),
6398
+ ];
6399
+ // Return a 3 character hex if possible
6400
+ if (allow3Char &&
6401
+ hex[0].startsWith(hex[0].charAt(1)) &&
6402
+ hex[1].startsWith(hex[1].charAt(1)) &&
6403
+ hex[2].startsWith(hex[2].charAt(1))) {
6404
+ return hex[0].charAt(0) + hex[1].charAt(0) + hex[2].charAt(0);
6405
+ }
6406
+ return hex.join('');
6407
+ }
6408
+ /** Converts a hex value to a decimal */
6409
+ function convertHexToDecimal(h) {
6410
+ return parseIntFromHex(h) / 255;
6411
+ }
6412
+ /** Parse a base-16 hex value into a base-10 integer */
6413
+ function parseIntFromHex(val) {
6414
+ return parseInt(val, 16);
6415
+ }
6416
+
6417
+ // https://github.com/bahamas10/css-color-names/blob/master/css-color-names.json
6418
+ /**
6419
+ * @hidden
6420
+ */
6421
+ var names = {
6422
+ aliceblue: '#f0f8ff',
6423
+ antiquewhite: '#faebd7',
6424
+ aqua: '#00ffff',
6425
+ aquamarine: '#7fffd4',
6426
+ azure: '#f0ffff',
6427
+ beige: '#f5f5dc',
6428
+ bisque: '#ffe4c4',
6429
+ black: '#000000',
6430
+ blanchedalmond: '#ffebcd',
6431
+ blue: '#0000ff',
6432
+ blueviolet: '#8a2be2',
6433
+ brown: '#a52a2a',
6434
+ burlywood: '#deb887',
6435
+ cadetblue: '#5f9ea0',
6436
+ chartreuse: '#7fff00',
6437
+ chocolate: '#d2691e',
6438
+ coral: '#ff7f50',
6439
+ cornflowerblue: '#6495ed',
6440
+ cornsilk: '#fff8dc',
6441
+ crimson: '#dc143c',
6442
+ cyan: '#00ffff',
6443
+ darkblue: '#00008b',
6444
+ darkcyan: '#008b8b',
6445
+ darkgoldenrod: '#b8860b',
6446
+ darkgray: '#a9a9a9',
6447
+ darkgreen: '#006400',
6448
+ darkgrey: '#a9a9a9',
6449
+ darkkhaki: '#bdb76b',
6450
+ darkmagenta: '#8b008b',
6451
+ darkolivegreen: '#556b2f',
6452
+ darkorange: '#ff8c00',
6453
+ darkorchid: '#9932cc',
6454
+ darkred: '#8b0000',
6455
+ darksalmon: '#e9967a',
6456
+ darkseagreen: '#8fbc8f',
6457
+ darkslateblue: '#483d8b',
6458
+ darkslategray: '#2f4f4f',
6459
+ darkslategrey: '#2f4f4f',
6460
+ darkturquoise: '#00ced1',
6461
+ darkviolet: '#9400d3',
6462
+ deeppink: '#ff1493',
6463
+ deepskyblue: '#00bfff',
6464
+ dimgray: '#696969',
6465
+ dimgrey: '#696969',
6466
+ dodgerblue: '#1e90ff',
6467
+ firebrick: '#b22222',
6468
+ floralwhite: '#fffaf0',
6469
+ forestgreen: '#228b22',
6470
+ fuchsia: '#ff00ff',
6471
+ gainsboro: '#dcdcdc',
6472
+ ghostwhite: '#f8f8ff',
6473
+ goldenrod: '#daa520',
6474
+ gold: '#ffd700',
6475
+ gray: '#808080',
6476
+ green: '#008000',
6477
+ greenyellow: '#adff2f',
6478
+ grey: '#808080',
6479
+ honeydew: '#f0fff0',
6480
+ hotpink: '#ff69b4',
6481
+ indianred: '#cd5c5c',
6482
+ indigo: '#4b0082',
6483
+ ivory: '#fffff0',
6484
+ khaki: '#f0e68c',
6485
+ lavenderblush: '#fff0f5',
6486
+ lavender: '#e6e6fa',
6487
+ lawngreen: '#7cfc00',
6488
+ lemonchiffon: '#fffacd',
6489
+ lightblue: '#add8e6',
6490
+ lightcoral: '#f08080',
6491
+ lightcyan: '#e0ffff',
6492
+ lightgoldenrodyellow: '#fafad2',
6493
+ lightgray: '#d3d3d3',
6494
+ lightgreen: '#90ee90',
6495
+ lightgrey: '#d3d3d3',
6496
+ lightpink: '#ffb6c1',
6497
+ lightsalmon: '#ffa07a',
6498
+ lightseagreen: '#20b2aa',
6499
+ lightskyblue: '#87cefa',
6500
+ lightslategray: '#778899',
6501
+ lightslategrey: '#778899',
6502
+ lightsteelblue: '#b0c4de',
6503
+ lightyellow: '#ffffe0',
6504
+ lime: '#00ff00',
6505
+ limegreen: '#32cd32',
6506
+ linen: '#faf0e6',
6507
+ magenta: '#ff00ff',
6508
+ maroon: '#800000',
6509
+ mediumaquamarine: '#66cdaa',
6510
+ mediumblue: '#0000cd',
6511
+ mediumorchid: '#ba55d3',
6512
+ mediumpurple: '#9370db',
6513
+ mediumseagreen: '#3cb371',
6514
+ mediumslateblue: '#7b68ee',
6515
+ mediumspringgreen: '#00fa9a',
6516
+ mediumturquoise: '#48d1cc',
6517
+ mediumvioletred: '#c71585',
6518
+ midnightblue: '#191970',
6519
+ mintcream: '#f5fffa',
6520
+ mistyrose: '#ffe4e1',
6521
+ moccasin: '#ffe4b5',
6522
+ navajowhite: '#ffdead',
6523
+ navy: '#000080',
6524
+ oldlace: '#fdf5e6',
6525
+ olive: '#808000',
6526
+ olivedrab: '#6b8e23',
6527
+ orange: '#ffa500',
6528
+ orangered: '#ff4500',
6529
+ orchid: '#da70d6',
6530
+ palegoldenrod: '#eee8aa',
6531
+ palegreen: '#98fb98',
6532
+ paleturquoise: '#afeeee',
6533
+ palevioletred: '#db7093',
6534
+ papayawhip: '#ffefd5',
6535
+ peachpuff: '#ffdab9',
6536
+ peru: '#cd853f',
6537
+ pink: '#ffc0cb',
6538
+ plum: '#dda0dd',
6539
+ powderblue: '#b0e0e6',
6540
+ purple: '#800080',
6541
+ rebeccapurple: '#663399',
6542
+ red: '#ff0000',
6543
+ rosybrown: '#bc8f8f',
6544
+ royalblue: '#4169e1',
6545
+ saddlebrown: '#8b4513',
6546
+ salmon: '#fa8072',
6547
+ sandybrown: '#f4a460',
6548
+ seagreen: '#2e8b57',
6549
+ seashell: '#fff5ee',
6550
+ sienna: '#a0522d',
6551
+ silver: '#c0c0c0',
6552
+ skyblue: '#87ceeb',
6553
+ slateblue: '#6a5acd',
6554
+ slategray: '#708090',
6555
+ slategrey: '#708090',
6556
+ snow: '#fffafa',
6557
+ springgreen: '#00ff7f',
6558
+ steelblue: '#4682b4',
6559
+ tan: '#d2b48c',
6560
+ teal: '#008080',
6561
+ thistle: '#d8bfd8',
6562
+ tomato: '#ff6347',
6563
+ turquoise: '#40e0d0',
6564
+ violet: '#ee82ee',
6565
+ wheat: '#f5deb3',
6566
+ white: '#ffffff',
6567
+ whitesmoke: '#f5f5f5',
6568
+ yellow: '#ffff00',
6569
+ yellowgreen: '#9acd32',
6570
+ };
6571
+
6572
+ /**
6573
+ * Given a string or object, convert that input to RGB
6574
+ *
6575
+ * Possible string inputs:
6576
+ * ```
6577
+ * "red"
6578
+ * "#f00" or "f00"
6579
+ * "#ff0000" or "ff0000"
6580
+ * "#ff000000" or "ff000000"
6581
+ * "rgb 255 0 0" or "rgb (255, 0, 0)"
6582
+ * "rgb 1.0 0 0" or "rgb (1, 0, 0)"
6583
+ * "rgba (255, 0, 0, 1)" or "rgba 255, 0, 0, 1"
6584
+ * "rgba (1.0, 0, 0, 1)" or "rgba 1.0, 0, 0, 1"
6585
+ * "hsl(0, 100%, 50%)" or "hsl 0 100% 50%"
6586
+ * "hsla(0, 100%, 50%, 1)" or "hsla 0 100% 50%, 1"
6587
+ * "hsv(0, 100%, 100%)" or "hsv 0 100% 100%"
6588
+ * ```
6589
+ */
6590
+ function inputToRGB(color) {
6591
+ var rgb = { r: 0, g: 0, b: 0 };
6592
+ var a = 1;
6593
+ var s = null;
6594
+ var v = null;
6595
+ var l = null;
6596
+ var ok = false;
6597
+ var format = false;
6598
+ if (typeof color === 'string') {
6599
+ color = stringInputToObject(color);
6600
+ }
6601
+ if (typeof color === 'object') {
6602
+ if (isValidCSSUnit(color.r) && isValidCSSUnit(color.g) && isValidCSSUnit(color.b)) {
6603
+ rgb = rgbToRgb(color.r, color.g, color.b);
6604
+ ok = true;
6605
+ format = String(color.r).substr(-1) === '%' ? 'prgb' : 'rgb';
6606
+ }
6607
+ else if (isValidCSSUnit(color.h) && isValidCSSUnit(color.s) && isValidCSSUnit(color.v)) {
6608
+ s = convertToPercentage(color.s);
6609
+ v = convertToPercentage(color.v);
6610
+ rgb = hsvToRgb(color.h, s, v);
6611
+ ok = true;
6612
+ format = 'hsv';
6613
+ }
6614
+ else if (isValidCSSUnit(color.h) && isValidCSSUnit(color.s) && isValidCSSUnit(color.l)) {
6615
+ s = convertToPercentage(color.s);
6616
+ l = convertToPercentage(color.l);
6617
+ rgb = hslToRgb(color.h, s, l);
6618
+ ok = true;
6619
+ format = 'hsl';
6620
+ }
6621
+ if (Object.prototype.hasOwnProperty.call(color, 'a')) {
6622
+ a = color.a;
6623
+ }
6624
+ }
6625
+ a = boundAlpha(a);
6626
+ return {
6627
+ ok: ok,
6628
+ format: color.format || format,
6629
+ r: Math.min(255, Math.max(rgb.r, 0)),
6630
+ g: Math.min(255, Math.max(rgb.g, 0)),
6631
+ b: Math.min(255, Math.max(rgb.b, 0)),
6632
+ a: a,
6633
+ };
6634
+ }
6635
+ // <http://www.w3.org/TR/css3-values/#integers>
6636
+ var CSS_INTEGER = '[-\\+]?\\d+%?';
6637
+ // <http://www.w3.org/TR/css3-values/#number-value>
6638
+ var CSS_NUMBER = '[-\\+]?\\d*\\.\\d+%?';
6639
+ // Allow positive/negative integer/number. Don't capture the either/or, just the entire outcome.
6640
+ var CSS_UNIT = "(?:" + CSS_NUMBER + ")|(?:" + CSS_INTEGER + ")";
6641
+ // Actual matching.
6642
+ // Parentheses and commas are optional, but not required.
6643
+ // Whitespace can take the place of commas or opening paren
6644
+ var PERMISSIVE_MATCH3 = "[\\s|\\(]+(" + CSS_UNIT + ")[,|\\s]+(" + CSS_UNIT + ")[,|\\s]+(" + CSS_UNIT + ")\\s*\\)?";
6645
+ var PERMISSIVE_MATCH4 = "[\\s|\\(]+(" + CSS_UNIT + ")[,|\\s]+(" + CSS_UNIT + ")[,|\\s]+(" + CSS_UNIT + ")[,|\\s]+(" + CSS_UNIT + ")\\s*\\)?";
6646
+ var matchers = {
6647
+ CSS_UNIT: new RegExp(CSS_UNIT),
6648
+ rgb: new RegExp('rgb' + PERMISSIVE_MATCH3),
6649
+ rgba: new RegExp('rgba' + PERMISSIVE_MATCH4),
6650
+ hsl: new RegExp('hsl' + PERMISSIVE_MATCH3),
6651
+ hsla: new RegExp('hsla' + PERMISSIVE_MATCH4),
6652
+ hsv: new RegExp('hsv' + PERMISSIVE_MATCH3),
6653
+ hsva: new RegExp('hsva' + PERMISSIVE_MATCH4),
6654
+ hex3: /^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,
6655
+ hex6: /^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,
6656
+ hex4: /^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,
6657
+ hex8: /^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,
6658
+ };
6659
+ /**
6660
+ * Permissive string parsing. Take in a number of formats, and output an object
6661
+ * based on detected format. Returns `{ r, g, b }` or `{ h, s, l }` or `{ h, s, v}`
6662
+ */
6663
+ function stringInputToObject(color) {
6664
+ color = color.trim().toLowerCase();
6665
+ if (color.length === 0) {
6666
+ return false;
6667
+ }
6668
+ var named = false;
6669
+ if (names[color]) {
6670
+ color = names[color];
6671
+ named = true;
6672
+ }
6673
+ else if (color === 'transparent') {
6674
+ return { r: 0, g: 0, b: 0, a: 0, format: 'name' };
6675
+ }
6676
+ // Try to match string input using regular expressions.
6677
+ // Keep most of the number bounding out of this function - don't worry about [0,1] or [0,100] or [0,360]
6678
+ // Just return an object and let the conversion functions handle that.
6679
+ // This way the result will be the same whether the tinycolor is initialized with string or object.
6680
+ var match = matchers.rgb.exec(color);
6681
+ if (match) {
6682
+ return { r: match[1], g: match[2], b: match[3] };
6683
+ }
6684
+ match = matchers.rgba.exec(color);
6685
+ if (match) {
6686
+ return { r: match[1], g: match[2], b: match[3], a: match[4] };
6687
+ }
6688
+ match = matchers.hsl.exec(color);
6689
+ if (match) {
6690
+ return { h: match[1], s: match[2], l: match[3] };
6691
+ }
6692
+ match = matchers.hsla.exec(color);
6693
+ if (match) {
6694
+ return { h: match[1], s: match[2], l: match[3], a: match[4] };
6695
+ }
6696
+ match = matchers.hsv.exec(color);
6697
+ if (match) {
6698
+ return { h: match[1], s: match[2], v: match[3] };
6699
+ }
6700
+ match = matchers.hsva.exec(color);
6701
+ if (match) {
6702
+ return { h: match[1], s: match[2], v: match[3], a: match[4] };
6703
+ }
6704
+ match = matchers.hex8.exec(color);
6705
+ if (match) {
6706
+ return {
6707
+ r: parseIntFromHex(match[1]),
6708
+ g: parseIntFromHex(match[2]),
6709
+ b: parseIntFromHex(match[3]),
6710
+ a: convertHexToDecimal(match[4]),
6711
+ format: named ? 'name' : 'hex8',
6712
+ };
6713
+ }
6714
+ match = matchers.hex6.exec(color);
6715
+ if (match) {
6716
+ return {
6717
+ r: parseIntFromHex(match[1]),
6718
+ g: parseIntFromHex(match[2]),
6719
+ b: parseIntFromHex(match[3]),
6720
+ format: named ? 'name' : 'hex',
6721
+ };
6722
+ }
6723
+ match = matchers.hex4.exec(color);
6724
+ if (match) {
6725
+ return {
6726
+ r: parseIntFromHex(match[1] + match[1]),
6727
+ g: parseIntFromHex(match[2] + match[2]),
6728
+ b: parseIntFromHex(match[3] + match[3]),
6729
+ a: convertHexToDecimal(match[4] + match[4]),
6730
+ format: named ? 'name' : 'hex8',
6731
+ };
6732
+ }
6733
+ match = matchers.hex3.exec(color);
6734
+ if (match) {
6735
+ return {
6736
+ r: parseIntFromHex(match[1] + match[1]),
6737
+ g: parseIntFromHex(match[2] + match[2]),
6738
+ b: parseIntFromHex(match[3] + match[3]),
6739
+ format: named ? 'name' : 'hex',
6740
+ };
6741
+ }
6742
+ return false;
6743
+ }
6744
+ /**
6745
+ * Check to see if it looks like a CSS unit
6746
+ * (see `matchers` above for definition).
6747
+ */
6748
+ function isValidCSSUnit(color) {
6749
+ return Boolean(matchers.CSS_UNIT.exec(String(color)));
6750
+ }
6751
+
6752
+ var hueStep = 2; // 色相阶梯
6753
+
6754
+ var saturationStep = 0.16; // 饱和度阶梯,浅色部分
6755
+
6756
+ var saturationStep2 = 0.05; // 饱和度阶梯,深色部分
6757
+
6758
+ var brightnessStep1 = 0.05; // 亮度阶梯,浅色部分
6759
+
6760
+ var brightnessStep2 = 0.15; // 亮度阶梯,深色部分
6761
+
6762
+ var lightColorCount = 5; // 浅色数量,主色上
6763
+
6764
+ var darkColorCount = 4; // 深色数量,主色下
6765
+ // 暗色主题颜色映射关系表
6766
+
6767
+ var darkColorMap = [{
6768
+ index: 7,
6769
+ opacity: 0.15
6770
+ }, {
6771
+ index: 6,
6772
+ opacity: 0.25
6773
+ }, {
6774
+ index: 5,
6775
+ opacity: 0.3
6776
+ }, {
6777
+ index: 5,
6778
+ opacity: 0.45
6779
+ }, {
6780
+ index: 5,
6781
+ opacity: 0.65
6782
+ }, {
6783
+ index: 5,
6784
+ opacity: 0.85
6785
+ }, {
6786
+ index: 4,
6787
+ opacity: 0.9
6788
+ }, {
6789
+ index: 3,
6790
+ opacity: 0.95
6791
+ }, {
6792
+ index: 2,
6793
+ opacity: 0.97
6794
+ }, {
6795
+ index: 1,
6796
+ opacity: 0.98
6797
+ }]; // Wrapper function ported from TinyColor.prototype.toHsv
6798
+ // Keep it here because of `hsv.h * 360`
6799
+
6800
+ function toHsv(_ref) {
6801
+ var r = _ref.r,
6802
+ g = _ref.g,
6803
+ b = _ref.b;
6804
+ var hsv = rgbToHsv(r, g, b);
6805
+ return {
6806
+ h: hsv.h * 360,
6807
+ s: hsv.s,
6808
+ v: hsv.v
6809
+ };
6810
+ } // Wrapper function ported from TinyColor.prototype.toHexString
6811
+ // Keep it here because of the prefix `#`
6812
+
6813
+
6814
+ function toHex(_ref2) {
6815
+ var r = _ref2.r,
6816
+ g = _ref2.g,
6817
+ b = _ref2.b;
6818
+ return "#".concat(rgbToHex(r, g, b, false));
6819
+ } // Wrapper function ported from TinyColor.prototype.mix, not treeshakable.
6820
+ // Amount in range [0, 1]
6821
+ // Assume color1 & color2 has no alpha, since the following src code did so.
6822
+
6823
+
6824
+ function mix(rgb1, rgb2, amount) {
6825
+ var p = amount / 100;
6826
+ var rgb = {
6827
+ r: (rgb2.r - rgb1.r) * p + rgb1.r,
6828
+ g: (rgb2.g - rgb1.g) * p + rgb1.g,
6829
+ b: (rgb2.b - rgb1.b) * p + rgb1.b
6830
+ };
6831
+ return rgb;
6832
+ }
6833
+
6834
+ function getHue(hsv, i, light) {
6835
+ var hue; // 根据色相不同,色相转向不同
6836
+
6837
+ if (Math.round(hsv.h) >= 60 && Math.round(hsv.h) <= 240) {
6838
+ hue = light ? Math.round(hsv.h) - hueStep * i : Math.round(hsv.h) + hueStep * i;
6839
+ } else {
6840
+ hue = light ? Math.round(hsv.h) + hueStep * i : Math.round(hsv.h) - hueStep * i;
6841
+ }
6842
+
6843
+ if (hue < 0) {
6844
+ hue += 360;
6845
+ } else if (hue >= 360) {
6846
+ hue -= 360;
6847
+ }
6848
+
6849
+ return hue;
6850
+ }
6851
+
6852
+ function getSaturation(hsv, i, light) {
6853
+ // grey color don't change saturation
6854
+ if (hsv.h === 0 && hsv.s === 0) {
6855
+ return hsv.s;
6856
+ }
6857
+
6858
+ var saturation;
6859
+
6860
+ if (light) {
6861
+ saturation = hsv.s - saturationStep * i;
6862
+ } else if (i === darkColorCount) {
6863
+ saturation = hsv.s + saturationStep;
6864
+ } else {
6865
+ saturation = hsv.s + saturationStep2 * i;
6866
+ } // 边界值修正
6867
+
6868
+
6869
+ if (saturation > 1) {
6870
+ saturation = 1;
6871
+ } // 第一格的 s 限制在 0.06-0.1 之间
6872
+
6873
+
6874
+ if (light && i === lightColorCount && saturation > 0.1) {
6875
+ saturation = 0.1;
6876
+ }
6877
+
6878
+ if (saturation < 0.06) {
6879
+ saturation = 0.06;
6880
+ }
6881
+
6882
+ return Number(saturation.toFixed(2));
6883
+ }
6884
+
6885
+ function getValue(hsv, i, light) {
6886
+ var value;
6887
+
6888
+ if (light) {
6889
+ value = hsv.v + brightnessStep1 * i;
6890
+ } else {
6891
+ value = hsv.v - brightnessStep2 * i;
6892
+ }
6893
+
6894
+ if (value > 1) {
6895
+ value = 1;
6896
+ }
6897
+
6898
+ return Number(value.toFixed(2));
6899
+ }
6900
+
6901
+ function generate(color) {
6902
+ var opts = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
6903
+ var patterns = [];
6904
+ var pColor = inputToRGB(color);
6905
+
6906
+ for (var i = lightColorCount; i > 0; i -= 1) {
6907
+ var hsv = toHsv(pColor);
6908
+ var colorString = toHex(inputToRGB({
6909
+ h: getHue(hsv, i, true),
6910
+ s: getSaturation(hsv, i, true),
6911
+ v: getValue(hsv, i, true)
6912
+ }));
6913
+ patterns.push(colorString);
6914
+ }
6915
+
6916
+ patterns.push(toHex(pColor));
6917
+
6918
+ for (var _i = 1; _i <= darkColorCount; _i += 1) {
6919
+ var _hsv = toHsv(pColor);
6920
+
6921
+ var _colorString = toHex(inputToRGB({
6922
+ h: getHue(_hsv, _i),
6923
+ s: getSaturation(_hsv, _i),
6924
+ v: getValue(_hsv, _i)
6925
+ }));
6926
+
6927
+ patterns.push(_colorString);
6928
+ } // dark theme patterns
6929
+
6930
+
6931
+ if (opts.theme === 'dark') {
6932
+ return darkColorMap.map(function (_ref3) {
6933
+ var index = _ref3.index,
6934
+ opacity = _ref3.opacity;
6935
+ var darkColorString = toHex(mix(inputToRGB(opts.backgroundColor || '#141414'), inputToRGB(patterns[index]), opacity * 100));
6936
+ return darkColorString;
6937
+ });
6938
+ }
6939
+
6940
+ return patterns;
6941
+ }
6942
+
6943
+ var presetPrimaryColors = {
6944
+ red: '#F5222D',
6945
+ volcano: '#FA541C',
6946
+ orange: '#FA8C16',
6947
+ gold: '#FAAD14',
6948
+ yellow: '#FADB14',
6949
+ lime: '#A0D911',
6950
+ green: '#52C41A',
6951
+ cyan: '#13C2C2',
6952
+ blue: '#1890FF',
6953
+ geekblue: '#2F54EB',
6954
+ purple: '#722ED1',
6955
+ magenta: '#EB2F96',
6956
+ grey: '#666666'
6957
+ };
6958
+ var presetPalettes = {};
6959
+ var presetDarkPalettes = {};
6960
+ Object.keys(presetPrimaryColors).forEach(function (key) {
6961
+ presetPalettes[key] = generate(presetPrimaryColors[key]);
6962
+ presetPalettes[key].primary = presetPalettes[key][5]; // dark presetPalettes
6963
+
6964
+ presetDarkPalettes[key] = generate(presetPrimaryColors[key], {
6965
+ theme: 'dark',
6966
+ backgroundColor: '#141414'
6967
+ });
6968
+ presetDarkPalettes[key].primary = presetDarkPalettes[key][5];
6969
+ });
6970
+ presetPalettes.red;
6971
+ presetPalettes.volcano;
6972
+ presetPalettes.gold;
6973
+ presetPalettes.orange;
6974
+ presetPalettes.yellow;
6975
+ presetPalettes.lime;
6976
+ presetPalettes.green;
6977
+ presetPalettes.cyan;
6978
+ presetPalettes.blue;
6979
+ presetPalettes.geekblue;
6980
+ presetPalettes.purple;
6981
+ presetPalettes.magenta;
6982
+ presetPalettes.grey;
6983
+
6984
+ function getStyleByBaseColors(theme, baseColors, backgroundColor) {
6985
+ return (theme === "dark" ? getDarkStyle : getLightStyle)(getCssVariableDefinitionsByPalettes(generatePalettes(baseColors, theme, backgroundColor)));
6986
+ }
6987
+ function getStyleByBrandColor(theme, brandColor) {
6988
+ return (theme === "dark" ? getDarkStyle : getLightStyle)(getCssVariableDefinitionsByBrand(brandColor));
6989
+ }
6990
+ function getStyleByVariables(theme, variables) {
6991
+ return (theme === "dark" ? getDarkStyle : getLightStyle)(getCssVariableDefinitionsByVariables(variables));
6992
+ }
6993
+
6994
+ function getLightStyle(cssVariableDefinitions) {
6995
+ return ":root,\n[data-override-theme=\"light\"] {\n".concat(cssVariableDefinitions, "}");
6996
+ }
6997
+
6998
+ function getDarkStyle(cssVariableDefinitions) {
6999
+ return "html[data-theme=\"dark-v2\"],\n[data-override-theme=\"dark-v2\"] {\n".concat(cssVariableDefinitions, "}");
7000
+ }
7001
+
7002
+ function getCssVariableDefinitionsByPalettes(palettes) {
7003
+ return Object.entries(palettes).flatMap(_ref => {
7004
+ var [colorName, palette] = _ref;
7005
+ ensureBaseColorName(colorName);
7006
+ 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.
7007
+ .concat("");
7008
+ }).join("\n");
7009
+ }
7010
+
7011
+ function generatePalettes(baseColors, theme, backgroundColor) {
7012
+ return Object.fromEntries(Object.entries(baseColors).map(_ref2 => {
7013
+ var [colorName, baseColor] = _ref2;
7014
+ return [colorName, generate(baseColor, theme === "dark" ? {
7015
+ theme,
7016
+ backgroundColor
7017
+ } : undefined)];
7018
+ }));
7019
+ }
7020
+
7021
+ function getCssVariableDefinitionsByBrand(color) {
7022
+ if (typeof color === "string") {
7023
+ return " --color-brand: ".concat(color, ";\n");
7024
+ }
7025
+
7026
+ return [" --color-brand: ".concat(color.default, ";"), " --color-brand-hover: ".concat(color.hover, ";"), " --color-brand-active: ".concat(color.active, ";"), ""].join("\n");
7027
+ }
7028
+
7029
+ function getCssVariableDefinitionsByVariables(variables) {
7030
+ return Object.entries(variables).map(_ref3 => {
7031
+ var [name, color] = _ref3;
7032
+ ensureCssVariableName(name);
7033
+ return " ".concat(name, ": ").concat(color, ";");
7034
+ }).concat("").join("\n");
7035
+ }
7036
+
7037
+ function ensureCssVariableName(name) {
7038
+ if (!/^--[a-z][a-z0-9]*(?:-[a-z0-9]+)*$/.test(name)) {
7039
+ throw new Error("Invalid css variable name: ".concat(JSON.stringify(name)));
7040
+ }
7041
+ }
7042
+
7043
+ function ensureBaseColorName(name) {
7044
+ if (!/^[a-z0-9]+(?:-[a-z0-9]+)*$/.test(name)) {
7045
+ throw new Error("Invalid base color name: ".concat(JSON.stringify(name)));
7046
+ }
7047
+ }
7048
+
7049
+ function applyColorTheme(options) {
7050
+ var style = [];
7051
+ var themes = ["light", "dark"];
7052
+ themes.forEach(theme => {
7053
+ if (options[theme]) {
7054
+ switch (options.type) {
7055
+ case "brandColor":
7056
+ style.push(getStyleByBrandColor(theme, options[theme]));
7057
+ break;
7058
+
7059
+ case "baseColors":
7060
+ style.push(getStyleByBaseColors(theme, options[theme], options.backgroundColor));
7061
+ break;
7062
+
7063
+ case "variables":
7064
+ style.push(getStyleByVariables(theme, options[theme]));
7065
+ break;
7066
+ }
7067
+ }
7068
+ });
7069
+
7070
+ if (style.length > 0) {
7071
+ var element = document.createElement("style");
7072
+ element.textContent = style.join("\n\n");
7073
+ document.head.appendChild(element);
7074
+ return () => {
7075
+ element.remove();
7076
+ };
7077
+ }
7078
+ }
7079
+
6193
7080
  class Kernel {
6194
7081
  constructor() {
6195
7082
  _defineProperty$1(this, "mountPoints", void 0);
@@ -6239,6 +7126,8 @@ class Kernel {
6239
7126
  var _this = this;
6240
7127
 
6241
7128
  return _asyncToGenerator$4(function* () {
7129
+ var _this$bootstrapData$s, _this$bootstrapData$s2;
7130
+
6242
7131
  _this.mountPoints = mountPoints;
6243
7132
  yield Promise.all([_this.loadCheckLogin(), _this.loadMicroApps()]);
6244
7133
 
@@ -6246,6 +7135,8 @@ class Kernel {
6246
7135
  throw new Error("No storyboard were found.");
6247
7136
  }
6248
7137
 
7138
+ 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);
7139
+
6249
7140
  if (isLoggedIn()) {
6250
7141
  _this.loadSharedData();
6251
7142
  }
@@ -6800,9 +7691,9 @@ class Kernel {
6800
7691
  }
6801
7692
 
6802
7693
  getFeatureFlags() {
6803
- var _this$bootstrapData, _this$bootstrapData$s;
7694
+ var _this$bootstrapData, _this$bootstrapData$s3;
6804
7695
 
6805
- 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);
7696
+ 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);
6806
7697
  }
6807
7698
 
6808
7699
  getStandaloneMenus(menuId) {
@@ -6871,6 +7762,24 @@ function loadScriptOfBricksOrTemplates(src) {
6871
7762
  return loadScript(src, window.PUBLIC_ROOT);
6872
7763
  }
6873
7764
 
7765
+ function generateColorTheme(theme) {
7766
+ if (!theme) {
7767
+ return;
7768
+ } else if (theme.brandColor) {
7769
+ applyColorTheme(_objectSpread({
7770
+ type: "brandColor"
7771
+ }, theme.brandColor));
7772
+ } else if (theme.baseColors) {
7773
+ applyColorTheme(_objectSpread({
7774
+ type: "baseColors"
7775
+ }, theme.baseColors));
7776
+ } else if (theme.variables) {
7777
+ applyColorTheme(_objectSpread({
7778
+ type: "variables"
7779
+ }, theme.variables));
7780
+ }
7781
+ }
7782
+
6874
7783
  /*! (c) Andrea Giammarchi - ISC */
6875
7784
  var self = {};
6876
7785
 
@@ -9185,15 +10094,25 @@ function registerMock(useMocks) {
9185
10094
 
9186
10095
  if (useMocks) mocks = _objectSpread(_objectSpread({}, useMocks), {}, {
9187
10096
  mockList: (_useMocks$mockList = useMocks.mockList) === null || _useMocks$mockList === void 0 ? void 0 : _useMocks$mockList.map(item => _objectSpread(_objectSpread({}, item), {}, {
9188
- uri: item.uri.replace(/(easyops\.api\.)(.+)(@\d+\.\d+\.\d+(?=\/))(.+)/, (_match, p1, p2, _p3, p4) => {
9189
- return "(".concat(p1, ")?").concat(p2, "(@\\d+\\.\\d+\\.\\d+)?").concat(p4, "$");
9190
- }).replace(/:\w+/g, "[\\w|-]+")
10097
+ uri: item.uri.replace(/(easyops\.api\.)(.+?)\/(.+)/, (_match, p1, p2, p3) => {
10098
+ return "(".concat(p1, ")?").concat(p2, "(@\\d+\\.\\d+\\.\\d+)?/").concat(p3, "$");
10099
+ }).replace(/:\w+/g, "([^/]+)")
9191
10100
  }))
9192
10101
  });
9193
10102
  }
9194
- var getMockId = requestUrl => {
9195
- if (mocks.mockList.find(item => new RegExp(item.uri).test(requestUrl))) return mocks.mockId;
9196
- return undefined;
10103
+ var getMockInfo = requestUrl => {
10104
+ var item = mocks.mockList.find(item => new RegExp(item.uri).test(requestUrl));
10105
+
10106
+ if (item) {
10107
+ return {
10108
+ url: requestUrl.replace(/(api\/gateway\/.+?)(@\d+\.\d+\.\d+)?\/(.+)/, (_match, p1, _p2, p3) => {
10109
+ return "".concat(p1, "/").concat(p3);
10110
+ }).replace(/(api\/gateway)/, "api/gateway/mock_server.proxy.".concat(mocks.mockId)),
10111
+ mockId: mocks.mockId
10112
+ };
10113
+ }
10114
+
10115
+ return;
9197
10116
  };
9198
10117
 
9199
10118
  class Router {
@@ -9575,7 +10494,10 @@ class Router {
9575
10494
  portal.length > 0 && mountTree(portal, mountPoints.portal);
9576
10495
  afterMountTree(mountPoints.main);
9577
10496
  afterMountTree(mountPoints.portal);
9578
- afterMountTree(mountPoints.bg);
10497
+ afterMountTree(mountPoints.bg); // Scroll to top after each rendering.
10498
+ // See https://github.com/ReactTraining/react-router/blob/master/packages/react-router-dom/docs/guides/scroll-restoration.md
10499
+
10500
+ window.scrollTo(0, 0);
9579
10501
 
9580
10502
  if (!failed) {
9581
10503
  _this3.locationContext.handlePageLoad();
@@ -9585,11 +10507,8 @@ class Router {
9585
10507
  _this3.locationContext.resolver.scheduleRefreshing();
9586
10508
 
9587
10509
  _this3.locationContext.handleMessage();
9588
- } // Scroll to top after each rendering.
9589
- // See https://github.com/ReactTraining/react-router/blob/master/packages/react-router-dom/docs/guides/scroll-restoration.md
9590
-
10510
+ }
9591
10511
 
9592
- window.scrollTo(0, 0);
9593
10512
  pageTracker === null || pageTracker === void 0 ? void 0 : pageTracker(locationContext.getCurrentMatch().path); // analytics page_view event
9594
10513
 
9595
10514
  userAnalytics.event("page_view", _objectSpread({
@@ -9721,7 +10640,7 @@ function getRuntime() {
9721
10640
  }
9722
10641
 
9723
10642
  // Ref https://reactjs.org/docs/error-boundaries.html
9724
- class LegacyErrorBoundary extends React.Component {
10643
+ class LegacyErrorBoundary extends React__default.Component {
9725
10644
  constructor(props) {
9726
10645
  super(props);
9727
10646
  this.state = {
@@ -9744,9 +10663,9 @@ class LegacyErrorBoundary extends React.Component {
9744
10663
  render() {
9745
10664
  if (this.state.error) {
9746
10665
  // You can render any custom fallback UI
9747
- return /*#__PURE__*/React.createElement("div", {
10666
+ return /*#__PURE__*/React__default.createElement("div", {
9748
10667
  "data-testid": "error-boundary"
9749
- }, /*#__PURE__*/React.createElement("h3", null, this.props.t(K.SOMETHING_WENT_WRONG)), /*#__PURE__*/React.createElement("p", null, httpErrorToString(this.state.error)));
10668
+ }, /*#__PURE__*/React__default.createElement("h3", null, this.props.t(K.SOMETHING_WENT_WRONG)), /*#__PURE__*/React__default.createElement("p", null, httpErrorToString(this.state.error)));
9750
10669
  }
9751
10670
 
9752
10671
  return this.props.children;
@@ -9941,8 +10860,8 @@ function useApplyPageTitle(pageTitle) {
9941
10860
  /** @internal */
9942
10861
 
9943
10862
  function useRecentApps() {
9944
- var [recentApps, setRecentApps] = React.useState(getRuntime().getRecentApps());
9945
- React.useEffect(() => {
10863
+ var [recentApps, setRecentApps] = React__default.useState(getRuntime().getRecentApps());
10864
+ React__default.useEffect(() => {
9946
10865
  var listener = event => {
9947
10866
  setRecentApps(event.detail);
9948
10867
  };
@@ -9976,8 +10895,8 @@ function useCurrentApp() {
9976
10895
 
9977
10896
  function useLocation() {
9978
10897
  var history = getHistory();
9979
- var [location, setLocation] = React.useState(history.location);
9980
- React.useEffect(() => {
10898
+ var [location, setLocation] = React__default.useState(history.location);
10899
+ React__default.useEffect(() => {
9981
10900
  var unlisten = history.listen(location => setLocation(location));
9982
10901
  return unlisten;
9983
10902
  }, [history]);
@@ -10128,7 +11047,7 @@ var handleProxyOfParentTemplate = (brick, tplContextId, tplContext) => {
10128
11047
  * @param props - 属性。
10129
11048
  */
10130
11049
 
10131
- var SingleBrickAsComponent = /*#__PURE__*/React.memo(function SingleBrickAsComponent(_ref2) {
11050
+ var SingleBrickAsComponent = /*#__PURE__*/React__default.memo(function SingleBrickAsComponent(_ref2) {
10132
11051
  var {
10133
11052
  useBrick,
10134
11053
  data,
@@ -10141,7 +11060,7 @@ var SingleBrickAsComponent = /*#__PURE__*/React.memo(function SingleBrickAsCompo
10141
11060
 
10142
11061
  var template;
10143
11062
  var brick;
10144
- var isBrickAvailable = React.useMemo(() => {
11063
+ var isBrickAvailable = React__default.useMemo(() => {
10145
11064
  if (isObject(useBrick.if) && !isPreEvaluated(useBrick.if)) {
10146
11065
  // eslint-disable-next-line
10147
11066
  console.warn("Currently resolvable-if in `useBrick` is not supported.");
@@ -10155,7 +11074,7 @@ var SingleBrickAsComponent = /*#__PURE__*/React.memo(function SingleBrickAsCompo
10155
11074
 
10156
11075
  return true;
10157
11076
  }, [useBrick, data]);
10158
- var runtimeBrick = React.useMemo( /*#__PURE__*/_asyncToGenerator$4(function* () {
11077
+ var runtimeBrick = React__default.useMemo( /*#__PURE__*/_asyncToGenerator$4(function* () {
10159
11078
  if (!isBrickAvailable) {
10160
11079
  return null;
10161
11080
  } // If the router state is initial, ignore rendering the sub-brick.
@@ -10194,7 +11113,7 @@ var SingleBrickAsComponent = /*#__PURE__*/React.memo(function SingleBrickAsCompo
10194
11113
 
10195
11114
  return brick;
10196
11115
  }), [useBrick, data, isBrickAvailable]);
10197
- var innerRefCallback = React.useCallback( /*#__PURE__*/function () {
11116
+ var innerRefCallback = React__default.useCallback( /*#__PURE__*/function () {
10198
11117
  var _ref5 = _asyncToGenerator$4(function* (element) {
10199
11118
  immediatelyRefCallback === null || immediatelyRefCallback === void 0 ? void 0 : immediatelyRefCallback(element);
10200
11119
 
@@ -10249,24 +11168,24 @@ var SingleBrickAsComponent = /*#__PURE__*/React.memo(function SingleBrickAsCompo
10249
11168
  }
10250
11169
 
10251
11170
  if (template) {
10252
- return /*#__PURE__*/React.createElement(template.brick, {
11171
+ return /*#__PURE__*/React__default.createElement(template.brick, {
10253
11172
  ref: innerRefCallback
10254
11173
  }, ...slotsToChildren(template.slots).map((item, index) => {
10255
- return /*#__PURE__*/React.createElement(SingleBrickAsComponent, {
11174
+ return /*#__PURE__*/React__default.createElement(SingleBrickAsComponent, {
10256
11175
  key: index,
10257
11176
  useBrick: item,
10258
11177
  data: data
10259
11178
  });
10260
11179
  }));
10261
11180
  } else {
10262
- return /*#__PURE__*/React.createElement(useBrick.brick, {
11181
+ return /*#__PURE__*/React__default.createElement(useBrick.brick, {
10263
11182
  ref: innerRefCallback
10264
11183
  }, ...slotsToChildren(useBrick.slots).map((item, index) => {
10265
11184
  if (useBrick[symbolForTplContextId] && !item[symbolForTplContextId]) {
10266
11185
  item[symbolForTplContextId] = useBrick[symbolForTplContextId];
10267
11186
  }
10268
11187
 
10269
- return /*#__PURE__*/React.createElement(SingleBrickAsComponent, {
11188
+ return /*#__PURE__*/React__default.createElement(SingleBrickAsComponent, {
10270
11189
  key: index,
10271
11190
  useBrick: item,
10272
11191
  data: data
@@ -10302,7 +11221,7 @@ function BrickAsComponent(_ref6) {
10302
11221
  } = _ref6;
10303
11222
 
10304
11223
  if (Array.isArray(useBrick)) {
10305
- return /*#__PURE__*/React.createElement(React.Fragment, null, useBrick.map((item, index) => /*#__PURE__*/React.createElement(SingleBrickAsComponent, {
11224
+ return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, useBrick.map((item, index) => /*#__PURE__*/React__default.createElement(SingleBrickAsComponent, {
10306
11225
  key: index,
10307
11226
  useBrick: item,
10308
11227
  data: data,
@@ -10310,7 +11229,7 @@ function BrickAsComponent(_ref6) {
10310
11229
  })));
10311
11230
  }
10312
11231
 
10313
- return /*#__PURE__*/React.createElement(SingleBrickAsComponent, {
11232
+ return /*#__PURE__*/React__default.createElement(SingleBrickAsComponent, {
10314
11233
  useBrick: useBrick,
10315
11234
  data: data,
10316
11235
  parentRefForUseBrickInPortal: parentRefForUseBrickInPortal
@@ -10343,7 +11262,7 @@ function transformEvents(data, events) {
10343
11262
  // eslint-disable-next-line react/display-name
10344
11263
 
10345
11264
 
10346
- var ForwardRefSingleBrickAsComponent = /*#__PURE__*/React.memo( /*#__PURE__*/forwardRef(function LegacySingleBrickAsComponent(_ref8, ref) {
11265
+ var ForwardRefSingleBrickAsComponent = /*#__PURE__*/React__default.memo( /*#__PURE__*/forwardRef(function LegacySingleBrickAsComponent(_ref8, ref) {
10347
11266
  var {
10348
11267
  useBrick,
10349
11268
  data,
@@ -10356,7 +11275,7 @@ var ForwardRefSingleBrickAsComponent = /*#__PURE__*/React.memo( /*#__PURE__*/for
10356
11275
 
10357
11276
  var template;
10358
11277
  var brick;
10359
- var isBrickAvailable = React.useMemo(() => {
11278
+ var isBrickAvailable = React__default.useMemo(() => {
10360
11279
  if (isObject(useBrick.if) && !isPreEvaluated(useBrick.if)) {
10361
11280
  // eslint-disable-next-line
10362
11281
  console.warn("Currently resolvable-if in `useBrick` is not supported.");
@@ -10373,7 +11292,7 @@ var ForwardRefSingleBrickAsComponent = /*#__PURE__*/React.memo( /*#__PURE__*/for
10373
11292
  useImperativeHandle(ref, () => {
10374
11293
  return brickRef.current;
10375
11294
  });
10376
- var runtimeBrick = React.useMemo( /*#__PURE__*/_asyncToGenerator$4(function* () {
11295
+ var runtimeBrick = React__default.useMemo( /*#__PURE__*/_asyncToGenerator$4(function* () {
10377
11296
  if (!isBrickAvailable) {
10378
11297
  return null;
10379
11298
  } // If the router state is initial, ignore rendering the sub-brick.
@@ -10414,7 +11333,7 @@ var ForwardRefSingleBrickAsComponent = /*#__PURE__*/React.memo( /*#__PURE__*/for
10414
11333
  listenOnTrackingContext(brick, trackingContextList, runtimeContext);
10415
11334
  return brick;
10416
11335
  }), [useBrick, data, isBrickAvailable]);
10417
- var innerRefCallback = React.useCallback( /*#__PURE__*/function () {
11336
+ var innerRefCallback = React__default.useCallback( /*#__PURE__*/function () {
10418
11337
  var _ref11 = _asyncToGenerator$4(function* (element) {
10419
11338
  brickRef.current = element;
10420
11339
 
@@ -10469,24 +11388,24 @@ var ForwardRefSingleBrickAsComponent = /*#__PURE__*/React.memo( /*#__PURE__*/for
10469
11388
  }
10470
11389
 
10471
11390
  if (template) {
10472
- return /*#__PURE__*/React.createElement(template.brick, {
11391
+ return /*#__PURE__*/React__default.createElement(template.brick, {
10473
11392
  ref: innerRefCallback
10474
11393
  }, ...slotsToChildren(template.slots).map((item, index) => {
10475
- return /*#__PURE__*/React.createElement(SingleBrickAsComponent, {
11394
+ return /*#__PURE__*/React__default.createElement(SingleBrickAsComponent, {
10476
11395
  key: index,
10477
11396
  useBrick: item,
10478
11397
  data: data
10479
11398
  });
10480
11399
  }));
10481
11400
  } else {
10482
- return /*#__PURE__*/React.createElement(useBrick.brick, {
11401
+ return /*#__PURE__*/React__default.createElement(useBrick.brick, {
10483
11402
  ref: innerRefCallback
10484
11403
  }, ...slotsToChildren(useBrick.slots).map((item, index) => {
10485
11404
  if (useBrick[symbolForTplContextId] && !item[symbolForTplContextId]) {
10486
11405
  item[symbolForTplContextId] = useBrick[symbolForTplContextId];
10487
11406
  }
10488
11407
 
10489
- return /*#__PURE__*/React.createElement(SingleBrickAsComponent, {
11408
+ return /*#__PURE__*/React__default.createElement(SingleBrickAsComponent, {
10490
11409
  key: index,
10491
11410
  useBrick: item,
10492
11411
  data: data
@@ -10546,7 +11465,7 @@ var locale$4 = {
10546
11465
  var TimePicker$1 = locale$4;
10547
11466
 
10548
11467
  var locale$3 = {
10549
- lang: _extends({
11468
+ lang: _extends$2({
10550
11469
  placeholder: '请选择日期',
10551
11470
  yearPlaceholder: '请选择年份',
10552
11471
  quarterPlaceholder: '请选择季度',
@@ -10557,7 +11476,7 @@ var locale$3 = {
10557
11476
  rangeMonthPlaceholder: ['开始月份', '结束月份'],
10558
11477
  rangeWeekPlaceholder: ['开始周', '结束周']
10559
11478
  }, locale$5),
10560
- timePickerLocale: _extends({}, TimePicker$1)
11479
+ timePickerLocale: _extends$2({}, TimePicker$1)
10561
11480
  }; // should add whitespace between char in Button
10562
11481
 
10563
11482
  locale$3.lang.ok = '确 定'; // All settings at:
@@ -10743,7 +11662,7 @@ var locale$1 = {
10743
11662
  var TimePicker = locale$1;
10744
11663
 
10745
11664
  var locale = {
10746
- lang: _extends({
11665
+ lang: _extends$2({
10747
11666
  placeholder: 'Select date',
10748
11667
  yearPlaceholder: 'Select year',
10749
11668
  quarterPlaceholder: 'Select quarter',
@@ -10754,7 +11673,7 @@ var locale = {
10754
11673
  rangeMonthPlaceholder: ['Start month', 'End month'],
10755
11674
  rangeWeekPlaceholder: ['Start week', 'End week']
10756
11675
  }, locale$2),
10757
- timePickerLocale: _extends({}, TimePicker)
11676
+ timePickerLocale: _extends$2({}, TimePicker)
10758
11677
  }; // All settings at:
10759
11678
  // https://github.com/ant-design/ant-design/blob/master/components/date-picker/locale/example.json
10760
11679
 
@@ -10887,9 +11806,289 @@ var localeValues = {
10887
11806
  };
10888
11807
  var defaultLocale = localeValues;
10889
11808
 
10890
- var emptyImage = "empty-image.8e18d87fea570ef0.png";
11809
+ 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); }
11810
+
11811
+ var _ref$1 = /*#__PURE__*/React.createElement("defs", null, /*#__PURE__*/React.createElement("linearGradient", {
11812
+ x1: "5.718%",
11813
+ y1: "4.311%",
11814
+ x2: "83.05%",
11815
+ y2: "88.915%",
11816
+ id: "empty-image_svg__a"
11817
+ }, /*#__PURE__*/React.createElement("stop", {
11818
+ stopColor: "#D4D8E4",
11819
+ offset: "0%"
11820
+ }), /*#__PURE__*/React.createElement("stop", {
11821
+ stopColor: "#A9B0C4",
11822
+ offset: "100%"
11823
+ })), /*#__PURE__*/React.createElement("linearGradient", {
11824
+ x1: "0%",
11825
+ y1: "11.08%",
11826
+ x2: "80.548%",
11827
+ y2: "107.704%",
11828
+ id: "empty-image_svg__d"
11829
+ }, /*#__PURE__*/React.createElement("stop", {
11830
+ stopColor: "#C2C7DA",
11831
+ offset: "0%"
11832
+ }), /*#__PURE__*/React.createElement("stop", {
11833
+ stopColor: "#8F96B3",
11834
+ offset: "100%"
11835
+ })), /*#__PURE__*/React.createElement("path", {
11836
+ 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",
11837
+ id: "empty-image_svg__c"
11838
+ }), /*#__PURE__*/React.createElement("filter", {
11839
+ x: "-57.2%",
11840
+ y: "-47.7%",
11841
+ width: "233.4%",
11842
+ height: "233.4%",
11843
+ filterUnits: "objectBoundingBox",
11844
+ id: "empty-image_svg__b"
11845
+ }, /*#__PURE__*/React.createElement("feOffset", {
11846
+ dx: 1,
11847
+ dy: 2,
11848
+ in: "SourceAlpha",
11849
+ result: "shadowOffsetOuter1"
11850
+ }), /*#__PURE__*/React.createElement("feGaussianBlur", {
11851
+ stdDeviation: 2,
11852
+ in: "shadowOffsetOuter1",
11853
+ result: "shadowBlurOuter1"
11854
+ }), /*#__PURE__*/React.createElement("feComposite", {
11855
+ in: "shadowBlurOuter1",
11856
+ in2: "SourceAlpha",
11857
+ operator: "out",
11858
+ result: "shadowBlurOuter1"
11859
+ }), /*#__PURE__*/React.createElement("feColorMatrix", {
11860
+ values: "0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.22 0",
11861
+ in: "shadowBlurOuter1"
11862
+ })), /*#__PURE__*/React.createElement("linearGradient", {
11863
+ x1: "41.823%",
11864
+ y1: "24.795%",
11865
+ x2: "8.813%",
11866
+ y2: "86.427%",
11867
+ id: "empty-image_svg__g"
11868
+ }, /*#__PURE__*/React.createElement("stop", {
11869
+ stopColor: "#CCD0DD",
11870
+ offset: "0%"
11871
+ }), /*#__PURE__*/React.createElement("stop", {
11872
+ stopColor: "#9DA3B9",
11873
+ offset: "100%"
11874
+ })), /*#__PURE__*/React.createElement("path", {
11875
+ d: "M37.311 12.459a4 4 0 0 1 4 4v3.419l-7.418-7.419h3.418z",
11876
+ id: "empty-image_svg__f"
11877
+ }), /*#__PURE__*/React.createElement("filter", {
11878
+ x: "-94.4%",
11879
+ y: "-121.3%",
11880
+ width: "288.7%",
11881
+ height: "288.7%",
11882
+ filterUnits: "objectBoundingBox",
11883
+ id: "empty-image_svg__e"
11884
+ }, /*#__PURE__*/React.createElement("feOffset", {
11885
+ dy: -2,
11886
+ in: "SourceAlpha",
11887
+ result: "shadowOffsetOuter1"
11888
+ }), /*#__PURE__*/React.createElement("feGaussianBlur", {
11889
+ stdDeviation: 2,
11890
+ in: "shadowOffsetOuter1",
11891
+ result: "shadowBlurOuter1"
11892
+ }), /*#__PURE__*/React.createElement("feColorMatrix", {
11893
+ values: "0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.25 0",
11894
+ in: "shadowBlurOuter1"
11895
+ })));
11896
+
11897
+ var _ref2$1 = /*#__PURE__*/React.createElement("g", {
11898
+ fill: "none",
11899
+ fillRule: "evenodd"
11900
+ }, /*#__PURE__*/React.createElement("path", {
11901
+ 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",
11902
+ fill: "#A6AAC3"
11903
+ }), /*#__PURE__*/React.createElement("path", {
11904
+ 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",
11905
+ fill: "url(#empty-image_svg__a)"
11906
+ }), /*#__PURE__*/React.createElement("g", null, /*#__PURE__*/React.createElement("use", {
11907
+ fill: "#000",
11908
+ filter: "url(#empty-image_svg__b)",
11909
+ xlinkHref: "#empty-image_svg__c"
11910
+ }), /*#__PURE__*/React.createElement("path", {
11911
+ stroke: "#FFF",
11912
+ 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",
11913
+ strokeLinejoin: "square",
11914
+ fill: "url(#empty-image_svg__d)"
11915
+ })), /*#__PURE__*/React.createElement("g", {
11916
+ transform: "rotate(180 37.602 16.168)"
11917
+ }, /*#__PURE__*/React.createElement("use", {
11918
+ fill: "#000",
11919
+ filter: "url(#empty-image_svg__e)",
11920
+ xlinkHref: "#empty-image_svg__f"
11921
+ }), /*#__PURE__*/React.createElement("use", {
11922
+ fill: "url(#empty-image_svg__g)",
11923
+ xlinkHref: "#empty-image_svg__f"
11924
+ })), /*#__PURE__*/React.createElement("path", {
11925
+ 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",
11926
+ fill: "#D6D8E4",
11927
+ opacity: 0.3
11928
+ }), /*#__PURE__*/React.createElement("path", {
11929
+ 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",
11930
+ fill: "#D6D8E4"
11931
+ }), /*#__PURE__*/React.createElement("path", {
11932
+ 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",
11933
+ fill: "#D6D8E4",
11934
+ opacity: 0.5
11935
+ }), /*#__PURE__*/React.createElement("path", {
11936
+ 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",
11937
+ fill: "#D6D8E4",
11938
+ opacity: 0.8
11939
+ }));
11940
+
11941
+ function SvgEmptyImage(props) {
11942
+ return /*#__PURE__*/React.createElement("svg", _extends$1({
11943
+ width: 56,
11944
+ height: 53,
11945
+ viewBox: "0 0 56 53",
11946
+ xmlns: "http://www.w3.org/2000/svg",
11947
+ xmlnsXlink: "http://www.w3.org/1999/xlink"
11948
+ }, props), _ref$1, _ref2$1);
11949
+ }
11950
+
11951
+ 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); }
11952
+
11953
+ var _ref = /*#__PURE__*/React.createElement("defs", null, /*#__PURE__*/React.createElement("linearGradient", {
11954
+ x1: "5.718%",
11955
+ y1: "4.311%",
11956
+ x2: "83.05%",
11957
+ y2: "88.915%",
11958
+ id: "big-empty-image_svg__a"
11959
+ }, /*#__PURE__*/React.createElement("stop", {
11960
+ stopColor: "#D4D8E4",
11961
+ offset: "0%"
11962
+ }), /*#__PURE__*/React.createElement("stop", {
11963
+ stopColor: "#A9B0C4",
11964
+ offset: "100%"
11965
+ })), /*#__PURE__*/React.createElement("linearGradient", {
11966
+ x1: "0%",
11967
+ y1: "11.08%",
11968
+ x2: "80.548%",
11969
+ y2: "107.704%",
11970
+ id: "big-empty-image_svg__d"
11971
+ }, /*#__PURE__*/React.createElement("stop", {
11972
+ stopColor: "#C2C7DA",
11973
+ offset: "0%"
11974
+ }), /*#__PURE__*/React.createElement("stop", {
11975
+ stopColor: "#8F96B3",
11976
+ offset: "100%"
11977
+ })), /*#__PURE__*/React.createElement("path", {
11978
+ 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",
11979
+ id: "big-empty-image_svg__c"
11980
+ }), /*#__PURE__*/React.createElement("filter", {
11981
+ x: "-37.5%",
11982
+ y: "-31.3%",
11983
+ width: "187.5%",
11984
+ height: "187.5%",
11985
+ filterUnits: "objectBoundingBox",
11986
+ id: "big-empty-image_svg__b"
11987
+ }, /*#__PURE__*/React.createElement("feOffset", {
11988
+ dx: 1,
11989
+ dy: 2,
11990
+ in: "SourceAlpha",
11991
+ result: "shadowOffsetOuter1"
11992
+ }), /*#__PURE__*/React.createElement("feGaussianBlur", {
11993
+ stdDeviation: 2,
11994
+ in: "shadowOffsetOuter1",
11995
+ result: "shadowBlurOuter1"
11996
+ }), /*#__PURE__*/React.createElement("feComposite", {
11997
+ in: "shadowBlurOuter1",
11998
+ in2: "SourceAlpha",
11999
+ operator: "out",
12000
+ result: "shadowBlurOuter1"
12001
+ }), /*#__PURE__*/React.createElement("feColorMatrix", {
12002
+ values: "0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.22 0",
12003
+ in: "shadowBlurOuter1"
12004
+ })), /*#__PURE__*/React.createElement("linearGradient", {
12005
+ x1: "41.823%",
12006
+ y1: "24.795%",
12007
+ x2: "8.813%",
12008
+ y2: "86.427%",
12009
+ id: "big-empty-image_svg__g"
12010
+ }, /*#__PURE__*/React.createElement("stop", {
12011
+ stopColor: "#CCD0DD",
12012
+ offset: "0%"
12013
+ }), /*#__PURE__*/React.createElement("stop", {
12014
+ stopColor: "#9DA3B9",
12015
+ offset: "100%"
12016
+ })), /*#__PURE__*/React.createElement("path", {
12017
+ d: "M59 19a4 4 0 0 1 4 4v7.314L51.686 19H59z",
12018
+ id: "big-empty-image_svg__f"
12019
+ }), /*#__PURE__*/React.createElement("filter", {
12020
+ x: "-61.9%",
12021
+ y: "-79.5%",
12022
+ width: "223.7%",
12023
+ height: "223.7%",
12024
+ filterUnits: "objectBoundingBox",
12025
+ id: "big-empty-image_svg__e"
12026
+ }, /*#__PURE__*/React.createElement("feOffset", {
12027
+ dy: -2,
12028
+ in: "SourceAlpha",
12029
+ result: "shadowOffsetOuter1"
12030
+ }), /*#__PURE__*/React.createElement("feGaussianBlur", {
12031
+ stdDeviation: 2,
12032
+ in: "shadowOffsetOuter1",
12033
+ result: "shadowBlurOuter1"
12034
+ }), /*#__PURE__*/React.createElement("feColorMatrix", {
12035
+ values: "0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.25 0",
12036
+ in: "shadowBlurOuter1"
12037
+ })));
12038
+
12039
+ var _ref2 = /*#__PURE__*/React.createElement("g", {
12040
+ fill: "none",
12041
+ fillRule: "evenodd"
12042
+ }, /*#__PURE__*/React.createElement("path", {
12043
+ 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",
12044
+ fill: "#A6AAC3"
12045
+ }), /*#__PURE__*/React.createElement("path", {
12046
+ 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",
12047
+ fill: "url(#big-empty-image_svg__a)"
12048
+ }), /*#__PURE__*/React.createElement("g", null, /*#__PURE__*/React.createElement("use", {
12049
+ fill: "#000",
12050
+ filter: "url(#big-empty-image_svg__b)",
12051
+ xlinkHref: "#big-empty-image_svg__c"
12052
+ }), /*#__PURE__*/React.createElement("path", {
12053
+ stroke: "#FFF",
12054
+ 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",
12055
+ strokeLinejoin: "square",
12056
+ fill: "url(#big-empty-image_svg__d)"
12057
+ })), /*#__PURE__*/React.createElement("g", {
12058
+ transform: "rotate(180 57.343 24.657)"
12059
+ }, /*#__PURE__*/React.createElement("use", {
12060
+ fill: "#000",
12061
+ filter: "url(#big-empty-image_svg__e)",
12062
+ xlinkHref: "#big-empty-image_svg__f"
12063
+ }), /*#__PURE__*/React.createElement("use", {
12064
+ fill: "url(#big-empty-image_svg__g)",
12065
+ xlinkHref: "#big-empty-image_svg__f"
12066
+ })), /*#__PURE__*/React.createElement("path", {
12067
+ 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",
12068
+ fill: "#D6D8E4",
12069
+ opacity: 0.3
12070
+ }), /*#__PURE__*/React.createElement("path", {
12071
+ 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",
12072
+ fill: "#D6D8E4"
12073
+ }), /*#__PURE__*/React.createElement("path", {
12074
+ 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",
12075
+ fill: "#D6D8E4",
12076
+ opacity: 0.5
12077
+ }), /*#__PURE__*/React.createElement("path", {
12078
+ 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",
12079
+ fill: "#D6D8E4",
12080
+ opacity: 0.8
12081
+ }));
10891
12082
 
10892
- var bigEmptyImage = "big-empty-image.397ff6359f4066d8.png";
12083
+ function SvgBigEmptyImage(props) {
12084
+ return /*#__PURE__*/React.createElement("svg", _extends({
12085
+ width: 86,
12086
+ height: 80,
12087
+ viewBox: "0 0 86 80",
12088
+ xmlns: "http://www.w3.org/2000/svg",
12089
+ xmlnsXlink: "http://www.w3.org/1999/xlink"
12090
+ }, props), _ref, _ref2);
12091
+ }
10893
12092
 
10894
12093
  /**
10895
12094
  * 用于展示空数据的 React 组件。
@@ -10899,31 +12098,27 @@ function EasyopsEmpty(props) {
10899
12098
 
10900
12099
  var illustration = useMemo(() => props.illustration && getIllustration(props.illustration), [props.illustration]);
10901
12100
 
10902
- var _emptyImage = props.useBigEmptyImage ? bigEmptyImage : emptyImage;
12101
+ var _emptyImage = props.useBigEmptyImage ? SvgBigEmptyImage : SvgEmptyImage;
10903
12102
 
10904
- var image = props.illustration ? illustration : getImageUrl(_emptyImage);
12103
+ var image = props.illustration ? illustration : /*#__PURE__*/React__default.createElement(_emptyImage);
10905
12104
  var imageStyle = (_props$imageStyle = props.imageStyle) !== null && _props$imageStyle !== void 0 ? _props$imageStyle : props.useBigEmptyImage ? undefined : {
10906
12105
  height: "60px"
10907
12106
  };
10908
- return /*#__PURE__*/React.createElement(Empty, {
12107
+ return /*#__PURE__*/React__default.createElement(Empty, {
10909
12108
  image: image,
10910
12109
  imageStyle: imageStyle,
10911
- description: props.description
12110
+ description: props.description,
12111
+ style: {
12112
+ color: "var(--text-color-secondary)"
12113
+ }
10912
12114
  });
10913
12115
  }
10914
-
10915
- function getImageUrl(url) {
10916
- var _window$CORE_ROOT;
10917
-
10918
- return "".concat((_window$CORE_ROOT = window.CORE_ROOT) !== null && _window$CORE_ROOT !== void 0 ? _window$CORE_ROOT : "", "assets/").concat(url);
10919
- }
10920
12116
  /**
10921
12117
  * 调用后获得一个默认的展示空数据的 React 组件。
10922
12118
  */
10923
12119
 
10924
-
10925
12120
  function renderEasyopsEmpty() {
10926
- return /*#__PURE__*/React.createElement(EasyopsEmpty, null);
12121
+ return /*#__PURE__*/React__default.createElement(EasyopsEmpty, null);
10927
12122
  }
10928
12123
 
10929
12124
  var FeatureFlagsContext = /*#__PURE__*/createContext(null);
@@ -10993,7 +12188,7 @@ function useFeatureFlags(name) {
10993
12188
 
10994
12189
  function DisplayByFeatureFlags(props) {
10995
12190
  var featureFlags = useFeatureFlags(props.name);
10996
- return featureFlags.every(flag => !!flag) ? /*#__PURE__*/React.createElement(React.Fragment, null, props.children) : props !== null && props !== void 0 && props.fallback ? /*#__PURE__*/React.createElement(React.Fragment, null, props === null || props === void 0 ? void 0 : props.fallback) : null;
12191
+ return featureFlags.every(flag => !!flag) ? /*#__PURE__*/React__default.createElement(React__default.Fragment, null, props.children) : props !== null && props !== void 0 && props.fallback ? /*#__PURE__*/React__default.createElement(React__default.Fragment, null, props === null || props === void 0 ? void 0 : props.fallback) : null;
10997
12192
  }
10998
12193
 
10999
12194
  /**
@@ -11003,15 +12198,15 @@ function BrickWrapper(props) {
11003
12198
  var locale = i18next.language && i18next.language.split("-")[0] === "en" ? defaultLocale : zhCN; // istanbul ignore next
11004
12199
 
11005
12200
  var featureFlags = process.env.NODE_ENV === "test" ? {} : getRuntime().getFeatureFlags();
11006
- return /*#__PURE__*/React.createElement(ErrorBoundary, null, /*#__PURE__*/React.createElement(FeatureFlagsProvider, {
12201
+ return /*#__PURE__*/React__default.createElement(ErrorBoundary, null, /*#__PURE__*/React__default.createElement(FeatureFlagsProvider, {
11007
12202
  value: featureFlags
11008
- }, /*#__PURE__*/React.createElement(ConfigProvider, {
12203
+ }, /*#__PURE__*/React__default.createElement(ConfigProvider, {
11009
12204
  locale: locale,
11010
12205
  autoInsertSpaceInButton: false,
11011
12206
  renderEmpty: () => {
11012
12207
  var _props$wrapperConfig;
11013
12208
 
11014
- return /*#__PURE__*/React.createElement(EasyopsEmpty, (_props$wrapperConfig = props.wrapperConfig) === null || _props$wrapperConfig === void 0 ? void 0 : _props$wrapperConfig.empty);
12209
+ return /*#__PURE__*/React__default.createElement(EasyopsEmpty, (_props$wrapperConfig = props.wrapperConfig) === null || _props$wrapperConfig === void 0 ? void 0 : _props$wrapperConfig.empty);
11015
12210
  }
11016
12211
  }, props.children)));
11017
12212
  }
@@ -11398,5 +12593,5 @@ var ModalElement = _decorate(null, function (_initialize, _UpdatingElement) {
11398
12593
  };
11399
12594
  }, UpdatingElement);
11400
12595
 
11401
- export { BrickAsComponent, BrickWrapper, DisplayByFeatureFlags, EasyopsEmpty, ErrorBoundary, FeatureFlagsProvider, ForwardRefSingleBrickAsComponent, ModalElement, SingleBrickAsComponent, StoryboardFunctionRegistryFactory, UpdatingElement, authenticate, checkIf, checkIfByTransform, createHistory, createRuntime, developHelper, doTransform, event, getAuth, getHistory, getMockId, getRuntime, handleHttpError, httpErrorToString, i18nText, initI18n, isLoggedIn, logout, looseCheckIf, looseCheckIfByTransform, looseCheckIfOfComputed, method, preprocessTransformProperties, property, reTransformForDevtools, renderEasyopsEmpty, transformElementProperties, transformIntermediateData, transformProperties, useApplyPageTitle, useCurrentApp, useCurrentMode, useCurrentTheme, useFeatureFlags, useLocation, useRecentApps };
12596
+ export { BrickAsComponent, BrickWrapper, DisplayByFeatureFlags, EasyopsEmpty, ErrorBoundary, FeatureFlagsProvider, ForwardRefSingleBrickAsComponent, ModalElement, SingleBrickAsComponent, StoryboardFunctionRegistryFactory, UpdatingElement, authenticate, checkIf, checkIfByTransform, createHistory, createRuntime, developHelper, doTransform, event, getAuth, getHistory, getMockInfo, getRuntime, handleHttpError, httpErrorToString, i18nText, initI18n, isLoggedIn, logout, looseCheckIf, looseCheckIfByTransform, looseCheckIfOfComputed, method, preprocessTransformProperties, property, reTransformForDevtools, renderEasyopsEmpty, transformElementProperties, transformIntermediateData, transformProperties, useApplyPageTitle, useCurrentApp, useCurrentMode, useCurrentTheme, useFeatureFlags, useLocation, useRecentApps };
11402
12597
  //# sourceMappingURL=index.esm.js.map