@next-core/brick-kit 2.74.0 → 2.74.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +16 -87
- package/dist/index.bundle.js +359 -323
- package/dist/index.bundle.js.map +1 -1
- package/dist/index.esm.js +61 -23
- package/dist/index.esm.js.map +1 -1
- package/dist/types/core/Kernel.d.ts +6 -0
- package/dist/types/core/Kernel.d.ts.map +1 -1
- package/dist/types/core/Router.d.ts.map +1 -1
- package/package.json +11 -11
package/dist/index.bundle.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
(function (global, factory) {
|
|
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/defineProperty'), require('@babel/runtime/helpers/asyncToGenerator'), require('antd'), require('@next-core/brick-utils'), require('react'), require('@next-core/brick-http'), require('@ant-design/icons'), require('i18next'), require('lodash'), require('moment'), require('@next-core/pipes'), require('js-yaml'), require('@next-core/easyops-analytics'), require('
|
|
3
|
-
typeof define === 'function' && define.amd ? define(['exports', 'history', '@babel/runtime/helpers/objectSpread2', '@babel/runtime/helpers/objectWithoutProperties', '@babel/runtime/helpers/defineProperty', '@babel/runtime/helpers/asyncToGenerator', 'antd', '@next-core/brick-utils', 'react', '@next-core/brick-http', '@ant-design/icons', 'i18next', 'lodash', 'moment', '@next-core/pipes', 'js-yaml', '@next-core/easyops-analytics', '
|
|
4
|
-
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.BrickKit = {}, global.history$1, global._objectSpread, global._objectWithoutProperties, global._defineProperty$2, global._asyncToGenerator$4, global.antd, global.brickUtils, global.React, global.brickHttp, global.icons, global.i18next, global.lodash, global.moment, global.pipes, global.yaml, global.easyopsAnalytics, global.
|
|
5
|
-
}(this, (function (exports, history$1, _objectSpread, _objectWithoutProperties, _defineProperty$2, _asyncToGenerator$4, antd, brickUtils, React, brickHttp, icons, i18next, lodash, moment, pipes, yaml, easyopsAnalytics,
|
|
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/defineProperty'), require('@babel/runtime/helpers/asyncToGenerator'), require('antd'), require('@next-core/brick-utils'), require('react'), require('@next-core/brick-http'), require('@ant-design/icons'), require('i18next'), require('lodash'), require('moment'), require('@next-core/pipes'), require('js-yaml'), require('@next-core/easyops-analytics'), require('react-i18next'), require('@babel/runtime/helpers/esm/extends'), require('@next-core/illustrations'), require('@babel/runtime/helpers/decorate')) :
|
|
3
|
+
typeof define === 'function' && define.amd ? define(['exports', 'history', '@babel/runtime/helpers/objectSpread2', '@babel/runtime/helpers/objectWithoutProperties', '@babel/runtime/helpers/defineProperty', '@babel/runtime/helpers/asyncToGenerator', 'antd', '@next-core/brick-utils', 'react', '@next-core/brick-http', '@ant-design/icons', 'i18next', 'lodash', 'moment', '@next-core/pipes', 'js-yaml', '@next-core/easyops-analytics', '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._defineProperty$2, global._asyncToGenerator$4, global.antd, global.brickUtils, global.React, global.brickHttp, global.icons, global.i18next, global.lodash, global.moment, global.pipes, global.yaml, global.easyopsAnalytics, global.reactI18next, global._extends$2, global.illustrations, global._decorate));
|
|
5
|
+
})(this, (function (exports, history$1, _objectSpread, _objectWithoutProperties, _defineProperty$2, _asyncToGenerator$4, antd, brickUtils, React, brickHttp, icons, i18next, lodash, moment, pipes, yaml, easyopsAnalytics, 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
|
|
|
@@ -15,14 +15,12 @@
|
|
|
15
15
|
var d = Object.getOwnPropertyDescriptor(e, k);
|
|
16
16
|
Object.defineProperty(n, k, d.get ? d : {
|
|
17
17
|
enumerable: true,
|
|
18
|
-
get: function () {
|
|
19
|
-
return e[k];
|
|
20
|
-
}
|
|
18
|
+
get: function () { return e[k]; }
|
|
21
19
|
});
|
|
22
20
|
}
|
|
23
21
|
});
|
|
24
22
|
}
|
|
25
|
-
n[
|
|
23
|
+
n["default"] = e;
|
|
26
24
|
return Object.freeze(n);
|
|
27
25
|
}
|
|
28
26
|
|
|
@@ -36,15 +34,14 @@
|
|
|
36
34
|
var lodash__default = /*#__PURE__*/_interopDefaultLegacy(lodash);
|
|
37
35
|
var moment__default = /*#__PURE__*/_interopDefaultLegacy(moment);
|
|
38
36
|
var yaml__default = /*#__PURE__*/_interopDefaultLegacy(yaml);
|
|
39
|
-
var require$$0__default = /*#__PURE__*/_interopDefaultLegacy(require$$0);
|
|
40
37
|
var _extends__default = /*#__PURE__*/_interopDefaultLegacy(_extends$2);
|
|
41
38
|
var _decorate__default = /*#__PURE__*/_interopDefaultLegacy(_decorate);
|
|
42
39
|
|
|
43
40
|
class BaseBar {
|
|
44
41
|
constructor(kernel, mountPoint) {
|
|
45
|
-
_defineProperty__default[
|
|
42
|
+
_defineProperty__default["default"](this, "element", void 0);
|
|
46
43
|
|
|
47
|
-
_defineProperty__default[
|
|
44
|
+
_defineProperty__default["default"](this, "brick", void 0);
|
|
48
45
|
|
|
49
46
|
this.kernel = kernel;
|
|
50
47
|
this.mountPoint = mountPoint;
|
|
@@ -59,7 +56,7 @@
|
|
|
59
56
|
bootstrap(brick, options) {
|
|
60
57
|
var _this = this;
|
|
61
58
|
|
|
62
|
-
return _asyncToGenerator__default[
|
|
59
|
+
return _asyncToGenerator__default["default"](function* () {
|
|
63
60
|
// Ignore if the brick is not changed.
|
|
64
61
|
if (_this.brick === brick) {
|
|
65
62
|
return;
|
|
@@ -231,7 +228,7 @@
|
|
|
231
228
|
clear,
|
|
232
229
|
keepHash
|
|
233
230
|
} = options,
|
|
234
|
-
state = _objectWithoutProperties__default[
|
|
231
|
+
state = _objectWithoutProperties__default["default"](options, _excluded$3);
|
|
235
232
|
|
|
236
233
|
var urlSearchParams = new URLSearchParams(clear ? "" : browserHistory.location.search);
|
|
237
234
|
var params = {};
|
|
@@ -257,10 +254,10 @@
|
|
|
257
254
|
|
|
258
255
|
function updateAnchorFactory(method) {
|
|
259
256
|
return function updateAnchor(hash, state) {
|
|
260
|
-
browserHistory[method](_objectSpread__default[
|
|
257
|
+
browserHistory[method](_objectSpread__default["default"](_objectSpread__default["default"]({}, browserHistory.location), {}, {
|
|
261
258
|
key: undefined,
|
|
262
259
|
hash,
|
|
263
|
-
state: _objectSpread__default[
|
|
260
|
+
state: _objectSpread__default["default"]({
|
|
264
261
|
// The default notify is false
|
|
265
262
|
notify: false
|
|
266
263
|
}, state)
|
|
@@ -269,8 +266,8 @@
|
|
|
269
266
|
}
|
|
270
267
|
|
|
271
268
|
function reload() {
|
|
272
|
-
browserHistory.replace(_objectSpread__default[
|
|
273
|
-
state: _objectSpread__default[
|
|
269
|
+
browserHistory.replace(_objectSpread__default["default"](_objectSpread__default["default"]({}, browserHistory.location), {}, {
|
|
270
|
+
state: _objectSpread__default["default"](_objectSpread__default["default"]({}, browserHistory.location.state), {}, {
|
|
274
271
|
// Always notify
|
|
275
272
|
notify: true
|
|
276
273
|
})
|
|
@@ -355,7 +352,7 @@
|
|
|
355
352
|
}
|
|
356
353
|
|
|
357
354
|
if (error instanceof brickHttp.HttpFetchError) {
|
|
358
|
-
return i18next__default[
|
|
355
|
+
return i18next__default["default"].t("".concat(NS_BRICK_KIT, ":").concat(K.NETWORK_ERROR));
|
|
359
356
|
}
|
|
360
357
|
|
|
361
358
|
if (error instanceof brickHttp.HttpResponseError) {
|
|
@@ -386,15 +383,15 @@
|
|
|
386
383
|
}
|
|
387
384
|
|
|
388
385
|
unauthenticatedConfirmModal = antd.Modal.confirm({
|
|
389
|
-
icon: /*#__PURE__*/React__default[
|
|
390
|
-
content: /*#__PURE__*/React__default[
|
|
391
|
-
okText: i18next__default[
|
|
392
|
-
cancelText: i18next__default[
|
|
386
|
+
icon: /*#__PURE__*/React__default["default"].createElement(icons.ExclamationCircleOutlined, null),
|
|
387
|
+
content: /*#__PURE__*/React__default["default"].createElement(LoginTimeoutMessage, null),
|
|
388
|
+
okText: i18next__default["default"].t("".concat(NS_BRICK_KIT, ":").concat(K.MODAL_OK)),
|
|
389
|
+
cancelText: i18next__default["default"].t("".concat(NS_BRICK_KIT, ":").concat(K.MODAL_CANCEL)),
|
|
393
390
|
onOk: () => {
|
|
394
391
|
var ssoEnabled = getRuntime().getFeatureFlags()["sso-enabled"];
|
|
395
392
|
var history = getHistory();
|
|
396
393
|
history.push(ssoEnabled ? "/sso-auth/login" : "/auth/login", {
|
|
397
|
-
from: _objectSpread__default[
|
|
394
|
+
from: _objectSpread__default["default"](_objectSpread__default["default"]({}, history.location), {}, {
|
|
398
395
|
state: undefined
|
|
399
396
|
})
|
|
400
397
|
});
|
|
@@ -404,27 +401,27 @@
|
|
|
404
401
|
}
|
|
405
402
|
|
|
406
403
|
return antd.Modal.error({
|
|
407
|
-
title: i18next__default[
|
|
408
|
-
content: /*#__PURE__*/React__default[
|
|
404
|
+
title: i18next__default["default"].t("".concat(NS_BRICK_KIT, ":").concat(K.REQUEST_FAILED)),
|
|
405
|
+
content: /*#__PURE__*/React__default["default"].createElement("div", {
|
|
409
406
|
style: {
|
|
410
407
|
whiteSpace: "pre-wrap"
|
|
411
408
|
}
|
|
412
409
|
}, httpErrorToString(error)),
|
|
413
|
-
okText: i18next__default[
|
|
410
|
+
okText: i18next__default["default"].t("".concat(NS_BRICK_KIT, ":").concat(K.MODAL_OK))
|
|
414
411
|
});
|
|
415
412
|
}
|
|
416
413
|
function LoginTimeoutMessage() {
|
|
417
|
-
React__default[
|
|
414
|
+
React__default["default"].useEffect(() => {
|
|
418
415
|
// Unset confirm modal when it's destroyed.
|
|
419
416
|
return () => {
|
|
420
417
|
unauthenticatedConfirmModal = undefined;
|
|
421
418
|
};
|
|
422
419
|
}, []);
|
|
423
|
-
return /*#__PURE__*/React__default[
|
|
420
|
+
return /*#__PURE__*/React__default["default"].createElement("div", null, i18next__default["default"].t("".concat(NS_BRICK_KIT, ":").concat(K.LOGIN_TIMEOUT_MESSAGE)));
|
|
424
421
|
}
|
|
425
422
|
|
|
426
423
|
function supply(attemptToVisitGlobals, providedGlobalVariables) {
|
|
427
|
-
var globalVariables = _objectSpread__default[
|
|
424
|
+
var globalVariables = _objectSpread__default["default"]({}, providedGlobalVariables); // Allow limited browser builtin values.
|
|
428
425
|
|
|
429
426
|
|
|
430
427
|
globalVariables["undefined"] = undefined;
|
|
@@ -466,10 +463,10 @@
|
|
|
466
463
|
return delegateMethods(Object, ["entries", "fromEntries", "keys", "values"]);
|
|
467
464
|
|
|
468
465
|
case "_":
|
|
469
|
-
return Object.fromEntries(Object.entries(lodash__default[
|
|
466
|
+
return Object.fromEntries(Object.entries(lodash__default["default"]).filter(entry => !shouldOmitInLodash.has(entry[0])));
|
|
470
467
|
|
|
471
468
|
case "moment":
|
|
472
|
-
return Object.assign((...args) => moment__default[
|
|
469
|
+
return Object.assign((...args) => moment__default["default"](...args), Object.fromEntries(Object.entries(moment__default["default"]).filter(entry => !shouldOmitInMoment.has(entry[0]))));
|
|
473
470
|
|
|
474
471
|
case "PIPES":
|
|
475
472
|
return pipes.pipes;
|
|
@@ -1231,7 +1228,7 @@
|
|
|
1231
1228
|
function getNextDoTransformOptions(options, isArray, key) {
|
|
1232
1229
|
var _options$$$stateOfUse;
|
|
1233
1230
|
|
|
1234
|
-
return options ? _objectSpread__default[
|
|
1231
|
+
return options ? _objectSpread__default["default"](_objectSpread__default["default"]({}, options), {}, {
|
|
1235
1232
|
// Collect tracking context in first level only.
|
|
1236
1233
|
trackingContextList: undefined,
|
|
1237
1234
|
$$stateOfUseBrick: options.$$lazyForUseBrick ? getNextStateOfUseBrick((_options$$$stateOfUse = options.$$stateOfUseBrick) !== null && _options$$$stateOfUse !== void 0 ? _options$$$stateOfUse : StateOfUseBrick.INITIAL, isArray, key) : undefined
|
|
@@ -1364,7 +1361,7 @@
|
|
|
1364
1361
|
}
|
|
1365
1362
|
|
|
1366
1363
|
function _constructMenu() {
|
|
1367
|
-
_constructMenu = _asyncToGenerator__default[
|
|
1364
|
+
_constructMenu = _asyncToGenerator__default["default"](function* (menuBar, context, kernel) {
|
|
1368
1365
|
var hasSubMenu = !!menuBar.subMenuId;
|
|
1369
1366
|
|
|
1370
1367
|
if (menuBar.menuId) {
|
|
@@ -1394,7 +1391,7 @@
|
|
|
1394
1391
|
}
|
|
1395
1392
|
|
|
1396
1393
|
function _fetchMenuById() {
|
|
1397
|
-
_fetchMenuById = _asyncToGenerator__default[
|
|
1394
|
+
_fetchMenuById = _asyncToGenerator__default["default"](function* (menuId) {
|
|
1398
1395
|
if (menuCache.has(menuId)) {
|
|
1399
1396
|
return menuCache.get(menuId);
|
|
1400
1397
|
}
|
|
@@ -1472,7 +1469,7 @@
|
|
|
1472
1469
|
}
|
|
1473
1470
|
}
|
|
1474
1471
|
|
|
1475
|
-
return _objectSpread__default[
|
|
1472
|
+
return _objectSpread__default["default"](_objectSpread__default["default"]({}, mainMenu), {}, {
|
|
1476
1473
|
items: validMenuList.flatMap(menu => processGroupInject(menu.items, menu, injectWithMenus))
|
|
1477
1474
|
});
|
|
1478
1475
|
}
|
|
@@ -1488,7 +1485,7 @@
|
|
|
1488
1485
|
injectWithMenus.delete(item.groupId);
|
|
1489
1486
|
}
|
|
1490
1487
|
|
|
1491
|
-
return _objectSpread__default[
|
|
1488
|
+
return _objectSpread__default["default"](_objectSpread__default["default"]({}, item), {}, {
|
|
1492
1489
|
children: ((_processGroupInject = processGroupInject(item.children, menu, injectWithMenus)) !== null && _processGroupInject !== void 0 ? _processGroupInject : []).concat(foundInjectingMenus ? foundInjectingMenus.flatMap(injectingMenu => processGroupInject(injectingMenu.items, injectingMenu, injectWithMenus)) : []),
|
|
1493
1490
|
[symbolAppId]: menu.app[0].appId
|
|
1494
1491
|
});
|
|
@@ -1500,10 +1497,10 @@
|
|
|
1500
1497
|
}
|
|
1501
1498
|
|
|
1502
1499
|
function _loadDynamicMenuItems() {
|
|
1503
|
-
_loadDynamicMenuItems = _asyncToGenerator__default[
|
|
1500
|
+
_loadDynamicMenuItems = _asyncToGenerator__default["default"](function* (menu) {
|
|
1504
1501
|
if (menu.dynamicItems && menu.itemsResolve) {
|
|
1505
1502
|
var itemsConf = {};
|
|
1506
|
-
yield _internalApiGetResolver().resolveOne("reference", _objectSpread__default[
|
|
1503
|
+
yield _internalApiGetResolver().resolveOne("reference", _objectSpread__default["default"]({
|
|
1507
1504
|
transform: "items",
|
|
1508
1505
|
transformMapArray: false
|
|
1509
1506
|
}, menu.itemsResolve), itemsConf, null, _internalApiGetCurrentContext());
|
|
@@ -1518,15 +1515,15 @@
|
|
|
1518
1515
|
}
|
|
1519
1516
|
|
|
1520
1517
|
function _processMenu() {
|
|
1521
|
-
_processMenu = _asyncToGenerator__default[
|
|
1518
|
+
_processMenu = _asyncToGenerator__default["default"](function* (menuId, context, kernel, hasSubMenu) {
|
|
1522
1519
|
var _yield$fetchMenuById = yield fetchMenuById(menuId),
|
|
1523
1520
|
{
|
|
1524
1521
|
items,
|
|
1525
1522
|
app
|
|
1526
1523
|
} = _yield$fetchMenuById,
|
|
1527
|
-
restMenuData = _objectWithoutProperties__default[
|
|
1524
|
+
restMenuData = _objectWithoutProperties__default["default"](_yield$fetchMenuById, _excluded2$1);
|
|
1528
1525
|
|
|
1529
|
-
var menuData = _objectSpread__default[
|
|
1526
|
+
var menuData = _objectSpread__default["default"](_objectSpread__default["default"]({}, yield computeRealValueWithOverrideApp(restMenuData, app[0].appId, context, kernel)), {}, {
|
|
1530
1527
|
items: yield computeMenuItemsWithOverrideApp(items, context, kernel)
|
|
1531
1528
|
});
|
|
1532
1529
|
|
|
@@ -1561,13 +1558,13 @@
|
|
|
1561
1558
|
|
|
1562
1559
|
function computeMenuItemsWithOverrideApp(items, context, kernel) {
|
|
1563
1560
|
return Promise.all(items.map( /*#__PURE__*/function () {
|
|
1564
|
-
var _ref2 = _asyncToGenerator__default[
|
|
1561
|
+
var _ref2 = _asyncToGenerator__default["default"](function* (_ref) {
|
|
1565
1562
|
var {
|
|
1566
1563
|
children
|
|
1567
1564
|
} = _ref,
|
|
1568
|
-
rest = _objectWithoutProperties__default[
|
|
1565
|
+
rest = _objectWithoutProperties__default["default"](_ref, _excluded$2);
|
|
1569
1566
|
|
|
1570
|
-
return _objectSpread__default[
|
|
1567
|
+
return _objectSpread__default["default"](_objectSpread__default["default"]({}, yield computeRealValueWithOverrideApp(rest, rest[symbolAppId], context, kernel)), {}, {
|
|
1571
1568
|
children: children && (yield computeMenuItemsWithOverrideApp(children, context, kernel))
|
|
1572
1569
|
});
|
|
1573
1570
|
});
|
|
@@ -1583,7 +1580,7 @@
|
|
|
1583
1580
|
}
|
|
1584
1581
|
|
|
1585
1582
|
function _processMenuTitle() {
|
|
1586
|
-
_processMenuTitle = _asyncToGenerator__default[
|
|
1583
|
+
_processMenuTitle = _asyncToGenerator__default["default"](function* (menuData) {
|
|
1587
1584
|
if (menuData.title || !menuData.titleDataSource) {
|
|
1588
1585
|
return menuData.title;
|
|
1589
1586
|
}
|
|
@@ -1626,7 +1623,7 @@
|
|
|
1626
1623
|
}
|
|
1627
1624
|
|
|
1628
1625
|
function reorderMenuItems(menuData) {
|
|
1629
|
-
menuData.items = sortMenuItems(menuData.items).map(item => _objectSpread__default[
|
|
1626
|
+
menuData.items = sortMenuItems(menuData.items).map(item => _objectSpread__default["default"](_objectSpread__default["default"]({}, item), {}, {
|
|
1630
1627
|
children: sortMenuItems(item.children)
|
|
1631
1628
|
}));
|
|
1632
1629
|
}
|
|
@@ -1676,7 +1673,7 @@
|
|
|
1676
1673
|
}
|
|
1677
1674
|
|
|
1678
1675
|
function _computeRealValueWithOverrideApp() {
|
|
1679
|
-
_computeRealValueWithOverrideApp = _asyncToGenerator__default[
|
|
1676
|
+
_computeRealValueWithOverrideApp = _asyncToGenerator__default["default"](function* (data, overrideAppId, context, kernel) {
|
|
1680
1677
|
var newContext = context;
|
|
1681
1678
|
|
|
1682
1679
|
if (overrideAppId !== context.app.id && requireOverrideApp(data)) {
|
|
@@ -1684,7 +1681,7 @@
|
|
|
1684
1681
|
|
|
1685
1682
|
if (storyboard) {
|
|
1686
1683
|
yield kernel.fulfilStoryboard(storyboard);
|
|
1687
|
-
newContext = _objectSpread__default[
|
|
1684
|
+
newContext = _objectSpread__default["default"](_objectSpread__default["default"]({}, context), {}, {
|
|
1688
1685
|
overrideApp: storyboard.app
|
|
1689
1686
|
});
|
|
1690
1687
|
}
|
|
@@ -1699,7 +1696,7 @@
|
|
|
1699
1696
|
var requestsMap = new WeakMap();
|
|
1700
1697
|
function registerLazyBricks(bricks, factory) {
|
|
1701
1698
|
var factoryWrapper = /*#__PURE__*/function () {
|
|
1702
|
-
var _ref = _asyncToGenerator__default[
|
|
1699
|
+
var _ref = _asyncToGenerator__default["default"](function* () {
|
|
1703
1700
|
try {
|
|
1704
1701
|
window.dispatchEvent(new CustomEvent("request.start"));
|
|
1705
1702
|
yield factory();
|
|
@@ -1726,7 +1723,7 @@
|
|
|
1726
1723
|
}
|
|
1727
1724
|
|
|
1728
1725
|
function _loadLazyBricks() {
|
|
1729
|
-
_loadLazyBricks = _asyncToGenerator__default[
|
|
1726
|
+
_loadLazyBricks = _asyncToGenerator__default["default"](function* (bricks) {
|
|
1730
1727
|
var requests = new Set();
|
|
1731
1728
|
|
|
1732
1729
|
for (var brick of bricks) {
|
|
@@ -1783,7 +1780,7 @@
|
|
|
1783
1780
|
/* istanbul ignore next */
|
|
1784
1781
|
|
|
1785
1782
|
function _dev_only_getFakeKernel(overrides) {
|
|
1786
|
-
return _objectSpread__default[
|
|
1783
|
+
return _objectSpread__default["default"]({
|
|
1787
1784
|
bootstrapData: kernel.bootstrapData,
|
|
1788
1785
|
getFeatureFlags: kernel.getFeatureFlags.bind(kernel),
|
|
1789
1786
|
loadDynamicBricksInBrickConf: kernel.loadDynamicBricksInBrickConf.bind(kernel),
|
|
@@ -1792,23 +1789,23 @@
|
|
|
1792
1789
|
}
|
|
1793
1790
|
class Runtime {
|
|
1794
1791
|
constructor() {
|
|
1795
|
-
_defineProperty__default[
|
|
1792
|
+
_defineProperty__default["default"](this, "registerBrickTemplate", registerBrickTemplate);
|
|
1796
1793
|
|
|
1797
|
-
_defineProperty__default[
|
|
1794
|
+
_defineProperty__default["default"](this, "registerCustomTemplate", registerCustomTemplate);
|
|
1798
1795
|
|
|
1799
|
-
_defineProperty__default[
|
|
1796
|
+
_defineProperty__default["default"](this, "registerCustomProcessor", registerCustomProcessor);
|
|
1800
1797
|
|
|
1801
|
-
_defineProperty__default[
|
|
1798
|
+
_defineProperty__default["default"](this, "registerLazyBricks", registerLazyBricks);
|
|
1802
1799
|
|
|
1803
|
-
_defineProperty__default[
|
|
1800
|
+
_defineProperty__default["default"](this, "getBasePath", getBasePath);
|
|
1804
1801
|
|
|
1805
|
-
_defineProperty__default[
|
|
1802
|
+
_defineProperty__default["default"](this, "getCurrentTheme", getCurrentTheme);
|
|
1806
1803
|
|
|
1807
|
-
_defineProperty__default[
|
|
1804
|
+
_defineProperty__default["default"](this, "getCurrentMode", getCurrentMode);
|
|
1808
1805
|
}
|
|
1809
1806
|
|
|
1810
1807
|
bootstrap(mountPoints) {
|
|
1811
|
-
return _asyncToGenerator__default[
|
|
1808
|
+
return _asyncToGenerator__default["default"](function* () {
|
|
1812
1809
|
if (kernel !== undefined) {
|
|
1813
1810
|
throw new Error("Cannot bootstrap more than once.");
|
|
1814
1811
|
}
|
|
@@ -2211,7 +2208,7 @@
|
|
|
2211
2208
|
}
|
|
2212
2209
|
|
|
2213
2210
|
function _preCheckPermissions() {
|
|
2214
|
-
_preCheckPermissions = _asyncToGenerator__default[
|
|
2211
|
+
_preCheckPermissions = _asyncToGenerator__default["default"](function* (storyboard) {
|
|
2215
2212
|
var usedActions = brickUtils.scanPermissionActionsInStoryboard(storyboard);
|
|
2216
2213
|
yield validatePermissions(usedActions);
|
|
2217
2214
|
});
|
|
@@ -2229,7 +2226,7 @@
|
|
|
2229
2226
|
*/
|
|
2230
2227
|
|
|
2231
2228
|
function _validatePermissions() {
|
|
2232
|
-
_validatePermissions = _asyncToGenerator__default[
|
|
2229
|
+
_validatePermissions = _asyncToGenerator__default["default"](function* (usedActions) {
|
|
2233
2230
|
// Do not request known actions.
|
|
2234
2231
|
var actions = lodash.difference(usedActions, Array.from(permissionMap.keys()));
|
|
2235
2232
|
|
|
@@ -2303,7 +2300,7 @@
|
|
|
2303
2300
|
return;
|
|
2304
2301
|
}
|
|
2305
2302
|
|
|
2306
|
-
var language = (_i18next$language = i18next__default[
|
|
2303
|
+
var language = (_i18next$language = i18next__default["default"].language) !== null && _i18next$language !== void 0 ? _i18next$language : "zh-CN"; // First, make a perfect match.
|
|
2307
2304
|
|
|
2308
2305
|
if (brickUtils.hasOwnProperty(data, language)) {
|
|
2309
2306
|
return data[language];
|
|
@@ -2456,7 +2453,7 @@
|
|
|
2456
2453
|
if (typeof raw !== "string") {
|
|
2457
2454
|
// If the `raw` is not a string, it must be a pre-evaluated object.
|
|
2458
2455
|
// Then fulfil the context, and restore the original `raw`.
|
|
2459
|
-
runtimeContext = _objectSpread__default[
|
|
2456
|
+
runtimeContext = _objectSpread__default["default"](_objectSpread__default["default"]({}, raw[symbolForContext]), runtimeContext);
|
|
2460
2457
|
raw = raw[symbolForRaw];
|
|
2461
2458
|
} // A `SyntaxError` maybe thrown.
|
|
2462
2459
|
|
|
@@ -2591,7 +2588,7 @@
|
|
|
2591
2588
|
}
|
|
2592
2589
|
|
|
2593
2590
|
if (attemptToVisitGlobals.has("I18N")) {
|
|
2594
|
-
globalVariables.I18N = i18next__default[
|
|
2591
|
+
globalVariables.I18N = i18next__default["default"].getFixedT(null, "$app-".concat(app.id));
|
|
2595
2592
|
}
|
|
2596
2593
|
|
|
2597
2594
|
if (attemptToVisitGlobals.has("I18N_TEXT")) {
|
|
@@ -2792,20 +2789,20 @@
|
|
|
2792
2789
|
}
|
|
2793
2790
|
|
|
2794
2791
|
function getNextInternalOptions(internalOptions, isArray, key) {
|
|
2795
|
-
return internalOptions !== null && internalOptions !== void 0 && internalOptions.$$lazyForUseBrick ? _objectSpread__default[
|
|
2792
|
+
return internalOptions !== null && internalOptions !== void 0 && internalOptions.$$lazyForUseBrick ? _objectSpread__default["default"](_objectSpread__default["default"]({}, internalOptions), {}, {
|
|
2796
2793
|
$$stateOfUseBrick: getNextStateOfUseBrick(internalOptions.$$stateOfUseBrick, isArray, key)
|
|
2797
2794
|
}) : internalOptions;
|
|
2798
2795
|
}
|
|
2799
2796
|
|
|
2800
2797
|
class WebsocketMessageRequest {
|
|
2801
2798
|
constructor(event, topic) {
|
|
2802
|
-
_defineProperty__default[
|
|
2799
|
+
_defineProperty__default["default"](this, "topic", void 0);
|
|
2803
2800
|
|
|
2804
|
-
_defineProperty__default[
|
|
2801
|
+
_defineProperty__default["default"](this, "data", void 0);
|
|
2805
2802
|
|
|
2806
|
-
_defineProperty__default[
|
|
2803
|
+
_defineProperty__default["default"](this, "event", void 0);
|
|
2807
2804
|
|
|
2808
|
-
_defineProperty__default[
|
|
2805
|
+
_defineProperty__default["default"](this, "message", void 0);
|
|
2809
2806
|
|
|
2810
2807
|
this.event = event;
|
|
2811
2808
|
this.topic = JSON.stringify(topic);
|
|
@@ -2850,13 +2847,13 @@
|
|
|
2850
2847
|
|
|
2851
2848
|
class WebsocketMessageResponse {
|
|
2852
2849
|
constructor(response) {
|
|
2853
|
-
_defineProperty__default[
|
|
2850
|
+
_defineProperty__default["default"](this, "topic", void 0);
|
|
2854
2851
|
|
|
2855
|
-
_defineProperty__default[
|
|
2852
|
+
_defineProperty__default["default"](this, "data", void 0);
|
|
2856
2853
|
|
|
2857
|
-
_defineProperty__default[
|
|
2854
|
+
_defineProperty__default["default"](this, "event", void 0);
|
|
2858
2855
|
|
|
2859
|
-
_defineProperty__default[
|
|
2856
|
+
_defineProperty__default["default"](this, "message", void 0);
|
|
2860
2857
|
|
|
2861
2858
|
this.data = response;
|
|
2862
2859
|
this.message = JSON.parse(response);
|
|
@@ -2904,25 +2901,25 @@
|
|
|
2904
2901
|
|
|
2905
2902
|
class WebSocketService {
|
|
2906
2903
|
constructor(options) {
|
|
2907
|
-
_defineProperty__default[
|
|
2904
|
+
_defineProperty__default["default"](this, "retryCount", 0);
|
|
2908
2905
|
|
|
2909
|
-
_defineProperty__default[
|
|
2906
|
+
_defineProperty__default["default"](this, "ws", null);
|
|
2910
2907
|
|
|
2911
|
-
_defineProperty__default[
|
|
2908
|
+
_defineProperty__default["default"](this, "lockReconnect", false);
|
|
2912
2909
|
|
|
2913
|
-
_defineProperty__default[
|
|
2910
|
+
_defineProperty__default["default"](this, "options", void 0);
|
|
2914
2911
|
|
|
2915
|
-
_defineProperty__default[
|
|
2912
|
+
_defineProperty__default["default"](this, "messageQueue", new Set());
|
|
2916
2913
|
|
|
2917
|
-
_defineProperty__default[
|
|
2914
|
+
_defineProperty__default["default"](this, "state", "initial");
|
|
2918
2915
|
|
|
2919
|
-
_defineProperty__default[
|
|
2916
|
+
_defineProperty__default["default"](this, "defaultOptions", {
|
|
2920
2917
|
url: null,
|
|
2921
2918
|
reconnectTimeout: 1000,
|
|
2922
2919
|
retryLimit: 6
|
|
2923
2920
|
});
|
|
2924
2921
|
|
|
2925
|
-
this.options = _objectSpread__default[
|
|
2922
|
+
this.options = _objectSpread__default["default"](_objectSpread__default["default"]({}, this.defaultOptions), options);
|
|
2926
2923
|
this.createWebSocket();
|
|
2927
2924
|
}
|
|
2928
2925
|
|
|
@@ -3314,7 +3311,7 @@
|
|
|
3314
3311
|
};
|
|
3315
3312
|
|
|
3316
3313
|
try {
|
|
3317
|
-
path = require
|
|
3314
|
+
path = require('path');
|
|
3318
3315
|
} catch (er) {}
|
|
3319
3316
|
|
|
3320
3317
|
var GLOBSTAR = minimatch.GLOBSTAR = Minimatch.GLOBSTAR = {};
|
|
@@ -4219,15 +4216,15 @@
|
|
|
4219
4216
|
}
|
|
4220
4217
|
class MessageDispatcher {
|
|
4221
4218
|
constructor() {
|
|
4222
|
-
_defineProperty__default[
|
|
4219
|
+
_defineProperty__default["default"](this, "ws", void 0);
|
|
4223
4220
|
|
|
4224
|
-
_defineProperty__default[
|
|
4221
|
+
_defineProperty__default["default"](this, "context", void 0);
|
|
4225
4222
|
|
|
4226
|
-
_defineProperty__default[
|
|
4223
|
+
_defineProperty__default["default"](this, "messages", new Map());
|
|
4227
4224
|
|
|
4228
|
-
_defineProperty__default[
|
|
4225
|
+
_defineProperty__default["default"](this, "messageCallbackHandlers", new Map());
|
|
4229
4226
|
|
|
4230
|
-
_defineProperty__default[
|
|
4227
|
+
_defineProperty__default["default"](this, "channels", new Map());
|
|
4231
4228
|
}
|
|
4232
4229
|
|
|
4233
4230
|
create(brickAndMessages, context) {
|
|
@@ -4441,7 +4438,7 @@
|
|
|
4441
4438
|
}
|
|
4442
4439
|
|
|
4443
4440
|
function _poll() {
|
|
4444
|
-
_poll = _asyncToGenerator__default[
|
|
4441
|
+
_poll = _asyncToGenerator__default["default"](function* () {
|
|
4445
4442
|
timeoutIdList.delete(currentTimeoutId);
|
|
4446
4443
|
var shouldStop;
|
|
4447
4444
|
|
|
@@ -4524,7 +4521,7 @@
|
|
|
4524
4521
|
}
|
|
4525
4522
|
|
|
4526
4523
|
function _getArgsOfCustomApi() {
|
|
4527
|
-
_getArgsOfCustomApi = _asyncToGenerator__default[
|
|
4524
|
+
_getArgsOfCustomApi = _asyncToGenerator__default["default"](function* (provider, originalArgs) {
|
|
4528
4525
|
if (!isCustomApiProvider(provider)) {
|
|
4529
4526
|
return originalArgs;
|
|
4530
4527
|
}
|
|
@@ -4587,8 +4584,8 @@
|
|
|
4587
4584
|
function getApiProfileFromApiDefinition(provider, api) {
|
|
4588
4585
|
var _contract$endpoint, _contract$response;
|
|
4589
4586
|
|
|
4590
|
-
var contract = typeof api.contract === "string" ? yaml__default[
|
|
4591
|
-
schema: yaml__default[
|
|
4587
|
+
var contract = typeof api.contract === "string" ? yaml__default["default"].safeLoad(api.contract, {
|
|
4588
|
+
schema: yaml__default["default"].JSON_SCHEMA,
|
|
4592
4589
|
json: true
|
|
4593
4590
|
}) : api.contract;
|
|
4594
4591
|
var {
|
|
@@ -4628,7 +4625,7 @@
|
|
|
4628
4625
|
}
|
|
4629
4626
|
|
|
4630
4627
|
function _fetchFlowApiDefinition2() {
|
|
4631
|
-
_fetchFlowApiDefinition2 = _asyncToGenerator__default[
|
|
4628
|
+
_fetchFlowApiDefinition2 = _asyncToGenerator__default["default"](function* (provider) {
|
|
4632
4629
|
var [namespace, nameWithVersion] = provider.split("@");
|
|
4633
4630
|
var [name, version] = nameWithVersion.split(":");
|
|
4634
4631
|
var result = yield InstanceApi_postSearch("_INTERFACE_CONTRACT@EASYOPS", {
|
|
@@ -4751,7 +4748,7 @@
|
|
|
4751
4748
|
|
|
4752
4749
|
case "event.preventDefault":
|
|
4753
4750
|
return event => {
|
|
4754
|
-
if (!looseCheckIf(handler, _objectSpread__default[
|
|
4751
|
+
if (!looseCheckIf(handler, _objectSpread__default["default"](_objectSpread__default["default"]({}, context), {}, {
|
|
4755
4752
|
event
|
|
4756
4753
|
}))) {
|
|
4757
4754
|
return;
|
|
@@ -4774,7 +4771,7 @@
|
|
|
4774
4771
|
|
|
4775
4772
|
case "handleHttpError":
|
|
4776
4773
|
return event => {
|
|
4777
|
-
if (!looseCheckIf(handler, _objectSpread__default[
|
|
4774
|
+
if (!looseCheckIf(handler, _objectSpread__default["default"](_objectSpread__default["default"]({}, context), {}, {
|
|
4778
4775
|
event
|
|
4779
4776
|
}))) {
|
|
4780
4777
|
return;
|
|
@@ -4797,7 +4794,7 @@
|
|
|
4797
4794
|
case "theme.setDarkTheme":
|
|
4798
4795
|
case "theme.setLightTheme":
|
|
4799
4796
|
return event => {
|
|
4800
|
-
if (!looseCheckIf(handler, _objectSpread__default[
|
|
4797
|
+
if (!looseCheckIf(handler, _objectSpread__default["default"](_objectSpread__default["default"]({}, context), {}, {
|
|
4801
4798
|
event
|
|
4802
4799
|
}))) {
|
|
4803
4800
|
return;
|
|
@@ -4809,7 +4806,7 @@
|
|
|
4809
4806
|
case "mode.setDashboardMode":
|
|
4810
4807
|
case "mode.setDefaultMode":
|
|
4811
4808
|
return event => {
|
|
4812
|
-
if (!looseCheckIf(handler, _objectSpread__default[
|
|
4809
|
+
if (!looseCheckIf(handler, _objectSpread__default["default"](_objectSpread__default["default"]({}, context), {}, {
|
|
4813
4810
|
event
|
|
4814
4811
|
}))) {
|
|
4815
4812
|
return;
|
|
@@ -4820,7 +4817,7 @@
|
|
|
4820
4817
|
|
|
4821
4818
|
case "menu.clearMenuTitleCache":
|
|
4822
4819
|
return event => {
|
|
4823
|
-
if (!looseCheckIf(handler, _objectSpread__default[
|
|
4820
|
+
if (!looseCheckIf(handler, _objectSpread__default["default"](_objectSpread__default["default"]({}, context), {}, {
|
|
4824
4821
|
event
|
|
4825
4822
|
}))) {
|
|
4826
4823
|
return;
|
|
@@ -4831,7 +4828,7 @@
|
|
|
4831
4828
|
|
|
4832
4829
|
case "menu.clearMenuCache":
|
|
4833
4830
|
return event => {
|
|
4834
|
-
if (!looseCheckIf(handler, _objectSpread__default[
|
|
4831
|
+
if (!looseCheckIf(handler, _objectSpread__default["default"](_objectSpread__default["default"]({}, context), {}, {
|
|
4835
4832
|
event
|
|
4836
4833
|
}))) {
|
|
4837
4834
|
return;
|
|
@@ -4859,8 +4856,8 @@
|
|
|
4859
4856
|
|
|
4860
4857
|
function usingProviderFactory(handler, context, runtimeBrick) {
|
|
4861
4858
|
return /*#__PURE__*/function () {
|
|
4862
|
-
var _ref = _asyncToGenerator__default[
|
|
4863
|
-
if (!looseCheckIf(handler, _objectSpread__default[
|
|
4859
|
+
var _ref = _asyncToGenerator__default["default"](function* (event) {
|
|
4860
|
+
if (!looseCheckIf(handler, _objectSpread__default["default"](_objectSpread__default["default"]({}, context), {}, {
|
|
4864
4861
|
event
|
|
4865
4862
|
}))) {
|
|
4866
4863
|
return;
|
|
@@ -4884,7 +4881,7 @@
|
|
|
4884
4881
|
|
|
4885
4882
|
function builtinTplDispatchEventFactory(runtimeBrick, args, ifContainer, context) {
|
|
4886
4883
|
return function (event) {
|
|
4887
|
-
if (!looseCheckIf(ifContainer, _objectSpread__default[
|
|
4884
|
+
if (!looseCheckIf(ifContainer, _objectSpread__default["default"](_objectSpread__default["default"]({}, context), {}, {
|
|
4888
4885
|
event
|
|
4889
4886
|
}))) {
|
|
4890
4887
|
return;
|
|
@@ -4907,7 +4904,7 @@
|
|
|
4907
4904
|
return function (event) {
|
|
4908
4905
|
var _contextItem$eventTar;
|
|
4909
4906
|
|
|
4910
|
-
if (!looseCheckIf(ifContainer, _objectSpread__default[
|
|
4907
|
+
if (!looseCheckIf(ifContainer, _objectSpread__default["default"](_objectSpread__default["default"]({}, context), {}, {
|
|
4911
4908
|
event
|
|
4912
4909
|
}))) {
|
|
4913
4910
|
return;
|
|
@@ -4967,7 +4964,7 @@
|
|
|
4967
4964
|
|
|
4968
4965
|
function builtinLocationListenerFactory(method, args, ifContainer, context) {
|
|
4969
4966
|
return function (event) {
|
|
4970
|
-
if (!looseCheckIf(ifContainer, _objectSpread__default[
|
|
4967
|
+
if (!looseCheckIf(ifContainer, _objectSpread__default["default"](_objectSpread__default["default"]({}, context), {}, {
|
|
4971
4968
|
event
|
|
4972
4969
|
}))) {
|
|
4973
4970
|
return;
|
|
@@ -4984,7 +4981,7 @@
|
|
|
4984
4981
|
|
|
4985
4982
|
function builtinSegueListenerFactory(method, args, ifContainer, context) {
|
|
4986
4983
|
return function (event) {
|
|
4987
|
-
if (!looseCheckIf(ifContainer, _objectSpread__default[
|
|
4984
|
+
if (!looseCheckIf(ifContainer, _objectSpread__default["default"](_objectSpread__default["default"]({}, context), {}, {
|
|
4988
4985
|
event
|
|
4989
4986
|
}))) {
|
|
4990
4987
|
return;
|
|
@@ -5001,7 +4998,7 @@
|
|
|
5001
4998
|
|
|
5002
4999
|
function builtinAliasListenerFactory(method, args, ifContainer, context) {
|
|
5003
5000
|
return function (event) {
|
|
5004
|
-
if (!looseCheckIf(ifContainer, _objectSpread__default[
|
|
5001
|
+
if (!looseCheckIf(ifContainer, _objectSpread__default["default"](_objectSpread__default["default"]({}, context), {}, {
|
|
5005
5002
|
event
|
|
5006
5003
|
}))) {
|
|
5007
5004
|
return;
|
|
@@ -5017,7 +5014,7 @@
|
|
|
5017
5014
|
|
|
5018
5015
|
function builtinWebSocketListenerFactory(runtimeBrick, method, args, ifContainer, callback, context) {
|
|
5019
5016
|
return function (event) {
|
|
5020
|
-
if (!looseCheckIf(ifContainer, _objectSpread__default[
|
|
5017
|
+
if (!looseCheckIf(ifContainer, _objectSpread__default["default"](_objectSpread__default["default"]({}, context), {}, {
|
|
5021
5018
|
event
|
|
5022
5019
|
}))) {
|
|
5023
5020
|
return;
|
|
@@ -5031,7 +5028,7 @@
|
|
|
5031
5028
|
getMessageDispatcher()[method](channel, {
|
|
5032
5029
|
system,
|
|
5033
5030
|
topic
|
|
5034
|
-
}, _objectSpread__default[
|
|
5031
|
+
}, _objectSpread__default["default"](_objectSpread__default["default"]({}, callback), {}, {
|
|
5035
5032
|
runtimeBrick,
|
|
5036
5033
|
context
|
|
5037
5034
|
}));
|
|
@@ -5053,7 +5050,7 @@
|
|
|
5053
5050
|
};
|
|
5054
5051
|
|
|
5055
5052
|
return function (event) {
|
|
5056
|
-
if (!looseCheckIf(ifContainer, _objectSpread__default[
|
|
5053
|
+
if (!looseCheckIf(ifContainer, _objectSpread__default["default"](_objectSpread__default["default"]({}, context), {}, {
|
|
5057
5054
|
event
|
|
5058
5055
|
}))) {
|
|
5059
5056
|
return;
|
|
@@ -5066,7 +5063,7 @@
|
|
|
5066
5063
|
|
|
5067
5064
|
function builtinWindowListenerFactory(args, ifContainer, context) {
|
|
5068
5065
|
return function (event) {
|
|
5069
|
-
if (!looseCheckIf(ifContainer, _objectSpread__default[
|
|
5066
|
+
if (!looseCheckIf(ifContainer, _objectSpread__default["default"](_objectSpread__default["default"]({}, context), {}, {
|
|
5070
5067
|
event
|
|
5071
5068
|
}))) {
|
|
5072
5069
|
return;
|
|
@@ -5097,7 +5094,7 @@
|
|
|
5097
5094
|
|
|
5098
5095
|
function customListenerFactory(handler, ifContainer, context, runtimeBrick) {
|
|
5099
5096
|
return function (event) {
|
|
5100
|
-
if (!looseCheckIf(ifContainer, _objectSpread__default[
|
|
5097
|
+
if (!looseCheckIf(ifContainer, _objectSpread__default["default"](_objectSpread__default["default"]({}, context), {}, {
|
|
5101
5098
|
event
|
|
5102
5099
|
}))) {
|
|
5103
5100
|
return;
|
|
@@ -5140,7 +5137,7 @@
|
|
|
5140
5137
|
});
|
|
5141
5138
|
});
|
|
5142
5139
|
} else if (isSetPropsCustomHandler(handler)) {
|
|
5143
|
-
setProperties(targets, handler.properties, _objectSpread__default[
|
|
5140
|
+
setProperties(targets, handler.properties, _objectSpread__default["default"](_objectSpread__default["default"]({}, context), {}, {
|
|
5144
5141
|
event
|
|
5145
5142
|
}), handler.injectDeep !== false);
|
|
5146
5143
|
}
|
|
@@ -5152,7 +5149,7 @@
|
|
|
5152
5149
|
}
|
|
5153
5150
|
|
|
5154
5151
|
function _brickCallback() {
|
|
5155
|
-
_brickCallback = _asyncToGenerator__default[
|
|
5152
|
+
_brickCallback = _asyncToGenerator__default["default"](function* (target, handler, method, context, runtimeBrick, event, options) {
|
|
5156
5153
|
var _handler$callback, _poll;
|
|
5157
5154
|
|
|
5158
5155
|
if (typeof target[method] !== "function") {
|
|
@@ -5215,7 +5212,7 @@
|
|
|
5215
5212
|
var poll;
|
|
5216
5213
|
|
|
5217
5214
|
if (isUseProviderHandler(handler)) {
|
|
5218
|
-
poll = computeRealValue(handler.poll, _objectSpread__default[
|
|
5215
|
+
poll = computeRealValue(handler.poll, _objectSpread__default["default"](_objectSpread__default["default"]({}, context), {}, {
|
|
5219
5216
|
event
|
|
5220
5217
|
}), true);
|
|
5221
5218
|
}
|
|
@@ -5239,7 +5236,7 @@
|
|
|
5239
5236
|
|
|
5240
5237
|
function builtinHistoryListenerFactory(method, args, ifContainer, context) {
|
|
5241
5238
|
return function (event) {
|
|
5242
|
-
if (!looseCheckIf(ifContainer, _objectSpread__default[
|
|
5239
|
+
if (!looseCheckIf(ifContainer, _objectSpread__default["default"](_objectSpread__default["default"]({}, context), {}, {
|
|
5243
5240
|
event
|
|
5244
5241
|
}))) {
|
|
5245
5242
|
return;
|
|
@@ -5253,7 +5250,7 @@
|
|
|
5253
5250
|
|
|
5254
5251
|
function builtinHistoryWithoutArgsListenerFactory(method, ifContainer, context) {
|
|
5255
5252
|
return function (event) {
|
|
5256
|
-
if (!looseCheckIf(ifContainer, _objectSpread__default[
|
|
5253
|
+
if (!looseCheckIf(ifContainer, _objectSpread__default["default"](_objectSpread__default["default"]({}, context), {}, {
|
|
5257
5254
|
event
|
|
5258
5255
|
}))) {
|
|
5259
5256
|
return;
|
|
@@ -5265,7 +5262,7 @@
|
|
|
5265
5262
|
|
|
5266
5263
|
function builtinConsoleListenerFactory(method, args, ifContainer, context) {
|
|
5267
5264
|
return function (event) {
|
|
5268
|
-
if (!looseCheckIf(ifContainer, _objectSpread__default[
|
|
5265
|
+
if (!looseCheckIf(ifContainer, _objectSpread__default["default"](_objectSpread__default["default"]({}, context), {}, {
|
|
5269
5266
|
event
|
|
5270
5267
|
}))) {
|
|
5271
5268
|
return;
|
|
@@ -5280,7 +5277,7 @@
|
|
|
5280
5277
|
|
|
5281
5278
|
function builtinMessageListenerFactory(method, args, ifContainer, context) {
|
|
5282
5279
|
return function (event) {
|
|
5283
|
-
if (!looseCheckIf(ifContainer, _objectSpread__default[
|
|
5280
|
+
if (!looseCheckIf(ifContainer, _objectSpread__default["default"](_objectSpread__default["default"]({}, context), {}, {
|
|
5284
5281
|
event
|
|
5285
5282
|
}))) {
|
|
5286
5283
|
return;
|
|
@@ -5292,7 +5289,7 @@
|
|
|
5292
5289
|
|
|
5293
5290
|
function builtinWebStorageListenerFactory(storageType, method, args, ifContainer, context) {
|
|
5294
5291
|
return function (event) {
|
|
5295
|
-
if (!looseCheckIf(ifContainer, _objectSpread__default[
|
|
5292
|
+
if (!looseCheckIf(ifContainer, _objectSpread__default["default"](_objectSpread__default["default"]({}, context), {}, {
|
|
5296
5293
|
event
|
|
5297
5294
|
}))) {
|
|
5298
5295
|
return;
|
|
@@ -5312,16 +5309,16 @@
|
|
|
5312
5309
|
}
|
|
5313
5310
|
|
|
5314
5311
|
function argsFactory(args, context, event, options = {}) {
|
|
5315
|
-
return Array.isArray(args) ? computeRealValue(args, _objectSpread__default[
|
|
5312
|
+
return Array.isArray(args) ? computeRealValue(args, _objectSpread__default["default"](_objectSpread__default["default"]({}, context), {}, {
|
|
5316
5313
|
event
|
|
5317
5314
|
}), true) : options.useEventAsDefault ? [event] : options.useEventDetailAsDefault ? [event.detail] : [];
|
|
5318
5315
|
}
|
|
5319
5316
|
|
|
5320
5317
|
class BrickNode {
|
|
5321
5318
|
constructor(brick) {
|
|
5322
|
-
_defineProperty__default[
|
|
5319
|
+
_defineProperty__default["default"](this, "$$brick", void 0);
|
|
5323
5320
|
|
|
5324
|
-
_defineProperty__default[
|
|
5321
|
+
_defineProperty__default["default"](this, "children", []);
|
|
5325
5322
|
|
|
5326
5323
|
this.$$brick = brick;
|
|
5327
5324
|
}
|
|
@@ -5576,7 +5573,7 @@
|
|
|
5576
5573
|
*/
|
|
5577
5574
|
|
|
5578
5575
|
function getAuth() {
|
|
5579
|
-
return _objectSpread__default[
|
|
5576
|
+
return _objectSpread__default["default"]({}, auth);
|
|
5580
5577
|
}
|
|
5581
5578
|
/** @internal */
|
|
5582
5579
|
|
|
@@ -5616,13 +5613,13 @@
|
|
|
5616
5613
|
var ns = "$tmp-".concat(app.id); // Support any languages in `app.locales`.
|
|
5617
5614
|
|
|
5618
5615
|
Object.entries(app.locales).forEach(([lang, resources]) => {
|
|
5619
|
-
i18next__default[
|
|
5616
|
+
i18next__default["default"].addResourceBundle(lang, ns, resources);
|
|
5620
5617
|
}); // Use `app.name` as the fallback `app.localeName`.
|
|
5621
5618
|
|
|
5622
|
-
app.localeName = i18next__default[
|
|
5619
|
+
app.localeName = i18next__default["default"].getFixedT(null, ns)("name", app.name); // Remove the temporary i18n resource bundles.
|
|
5623
5620
|
|
|
5624
5621
|
Object.keys(app.locales).forEach(lang => {
|
|
5625
|
-
i18next__default[
|
|
5622
|
+
i18next__default["default"].removeResourceBundle(lang, ns);
|
|
5626
5623
|
});
|
|
5627
5624
|
})();
|
|
5628
5625
|
} else {
|
|
@@ -5645,7 +5642,7 @@
|
|
|
5645
5642
|
}
|
|
5646
5643
|
|
|
5647
5644
|
function _CustomApi() {
|
|
5648
|
-
_CustomApi = _asyncToGenerator__default[
|
|
5645
|
+
_CustomApi = _asyncToGenerator__default["default"](function* ({
|
|
5649
5646
|
url,
|
|
5650
5647
|
method = "GET",
|
|
5651
5648
|
responseWrapper = true
|
|
@@ -5653,7 +5650,7 @@
|
|
|
5653
5650
|
var isSimpleRequest = ["get", "delete", "head"].includes(method.toLowerCase());
|
|
5654
5651
|
|
|
5655
5652
|
if (isSimpleRequest) {
|
|
5656
|
-
var response = yield brickHttp.http.simpleRequest(method, url, _objectSpread__default[
|
|
5653
|
+
var response = yield brickHttp.http.simpleRequest(method, url, _objectSpread__default["default"]({
|
|
5657
5654
|
params: data
|
|
5658
5655
|
}, options));
|
|
5659
5656
|
return responseWrapper ? response.data : response;
|
|
@@ -5672,53 +5669,63 @@
|
|
|
5672
5669
|
|
|
5673
5670
|
class Kernel {
|
|
5674
5671
|
constructor() {
|
|
5675
|
-
_defineProperty__default[
|
|
5672
|
+
_defineProperty__default["default"](this, "mountPoints", void 0);
|
|
5673
|
+
|
|
5674
|
+
_defineProperty__default["default"](this, "bootstrapData", void 0);
|
|
5675
|
+
|
|
5676
|
+
_defineProperty__default["default"](this, "presetBricks", void 0);
|
|
5677
|
+
|
|
5678
|
+
_defineProperty__default["default"](this, "menuBar", void 0);
|
|
5679
|
+
|
|
5680
|
+
_defineProperty__default["default"](this, "appBar", void 0);
|
|
5676
5681
|
|
|
5677
|
-
_defineProperty__default[
|
|
5682
|
+
_defineProperty__default["default"](this, "loadingBar", void 0);
|
|
5678
5683
|
|
|
5679
|
-
_defineProperty__default[
|
|
5684
|
+
_defineProperty__default["default"](this, "navBar", void 0);
|
|
5680
5685
|
|
|
5681
|
-
_defineProperty__default[
|
|
5686
|
+
_defineProperty__default["default"](this, "sideBar", void 0);
|
|
5682
5687
|
|
|
5683
|
-
_defineProperty__default[
|
|
5688
|
+
_defineProperty__default["default"](this, "footer", void 0);
|
|
5684
5689
|
|
|
5685
|
-
_defineProperty__default[
|
|
5690
|
+
_defineProperty__default["default"](this, "breadcrumb", void 0);
|
|
5686
5691
|
|
|
5687
|
-
_defineProperty__default[
|
|
5692
|
+
_defineProperty__default["default"](this, "router", void 0);
|
|
5688
5693
|
|
|
5689
|
-
_defineProperty__default[
|
|
5694
|
+
_defineProperty__default["default"](this, "currentApp", void 0);
|
|
5690
5695
|
|
|
5691
|
-
_defineProperty__default[
|
|
5696
|
+
_defineProperty__default["default"](this, "previousApp", void 0);
|
|
5692
5697
|
|
|
5693
|
-
_defineProperty__default[
|
|
5698
|
+
_defineProperty__default["default"](this, "nextApp", void 0);
|
|
5694
5699
|
|
|
5695
|
-
_defineProperty__default[
|
|
5700
|
+
_defineProperty__default["default"](this, "currentUrl", void 0);
|
|
5696
5701
|
|
|
5697
|
-
_defineProperty__default[
|
|
5702
|
+
_defineProperty__default["default"](this, "workspaceStack", []);
|
|
5698
5703
|
|
|
5699
|
-
_defineProperty__default[
|
|
5704
|
+
_defineProperty__default["default"](this, "currentLayout", void 0);
|
|
5700
5705
|
|
|
5701
|
-
_defineProperty__default[
|
|
5706
|
+
_defineProperty__default["default"](this, "enableUiV8", false);
|
|
5702
5707
|
|
|
5703
|
-
_defineProperty__default[
|
|
5708
|
+
_defineProperty__default["default"](this, "allUserMapPromise", Promise.resolve(new Map()));
|
|
5704
5709
|
|
|
5705
|
-
_defineProperty__default[
|
|
5710
|
+
_defineProperty__default["default"](this, "allMagicBrickConfigMapPromise", Promise.resolve(new Map()));
|
|
5706
5711
|
|
|
5707
|
-
_defineProperty__default[
|
|
5712
|
+
_defineProperty__default["default"](this, "nextAppMeta", void 0);
|
|
5708
5713
|
|
|
5709
|
-
_defineProperty__default[
|
|
5714
|
+
_defineProperty__default["default"](this, "allRelatedAppsPromise", Promise.resolve([]));
|
|
5710
5715
|
|
|
5711
|
-
_defineProperty__default[
|
|
5716
|
+
_defineProperty__default["default"](this, "allMicroAppApiOrchestrationPromise", Promise.resolve(new Map()));
|
|
5712
5717
|
|
|
5713
|
-
_defineProperty__default[
|
|
5718
|
+
_defineProperty__default["default"](this, "providerRepository", new Map());
|
|
5714
5719
|
|
|
5715
|
-
_defineProperty__default[
|
|
5720
|
+
_defineProperty__default["default"](this, "loadUsersStarted", false);
|
|
5721
|
+
|
|
5722
|
+
_defineProperty__default["default"](this, "loadMagicBrickConfigStarted", false);
|
|
5716
5723
|
}
|
|
5717
5724
|
|
|
5718
5725
|
bootstrap(mountPoints) {
|
|
5719
5726
|
var _this = this;
|
|
5720
5727
|
|
|
5721
|
-
return _asyncToGenerator__default[
|
|
5728
|
+
return _asyncToGenerator__default["default"](function* () {
|
|
5722
5729
|
_this.mountPoints = mountPoints;
|
|
5723
5730
|
yield Promise.all([_this.loadCheckLogin(), _this.loadMicroApps()]);
|
|
5724
5731
|
|
|
@@ -5726,13 +5733,20 @@
|
|
|
5726
5733
|
throw new Error("No storyboard were found.");
|
|
5727
5734
|
}
|
|
5728
5735
|
|
|
5736
|
+
_this.setUiVersion();
|
|
5737
|
+
|
|
5729
5738
|
if (isLoggedIn()) {
|
|
5730
5739
|
_this.loadSharedData();
|
|
5731
5740
|
}
|
|
5732
5741
|
|
|
5733
5742
|
_this.menuBar = new MenuBar(_this, "menuBar");
|
|
5734
5743
|
_this.appBar = new AppBar(_this, "appBar");
|
|
5735
|
-
_this.loadingBar = new BaseBar(_this, "loadingBar");
|
|
5744
|
+
_this.loadingBar = new BaseBar(_this, "loadingBar"); // Todo(nlicro): 这里需要新写对应的NavBar...
|
|
5745
|
+
|
|
5746
|
+
_this.navBar = new BaseBar(_this, "navBar");
|
|
5747
|
+
_this.sideBar = new BaseBar(_this, "sideBar");
|
|
5748
|
+
_this.breadcrumb = new BaseBar(_this, "breadcrumb");
|
|
5749
|
+
_this.footer = new BaseBar(_this, "footer");
|
|
5736
5750
|
_this.router = new Router(_this);
|
|
5737
5751
|
yield _this.router.bootstrap();
|
|
5738
5752
|
|
|
@@ -5745,7 +5759,7 @@
|
|
|
5745
5759
|
layoutBootstrap(layout) {
|
|
5746
5760
|
var _this2 = this;
|
|
5747
5761
|
|
|
5748
|
-
return _asyncToGenerator__default[
|
|
5762
|
+
return _asyncToGenerator__default["default"](function* () {
|
|
5749
5763
|
var supportedLayouts = ["console", "business"];
|
|
5750
5764
|
|
|
5751
5765
|
if (!supportedLayouts.includes(layout)) {
|
|
@@ -5757,7 +5771,13 @@
|
|
|
5757
5771
|
loadingBar: "business-website.loading-bar",
|
|
5758
5772
|
pageNotFound: "business-website.page-not-found",
|
|
5759
5773
|
pageError: "business-website.page-error"
|
|
5760
|
-
} : _objectSpread__default[
|
|
5774
|
+
} : _objectSpread__default["default"](_objectSpread__default["default"]({}, _this2.enableUiV8 ? {
|
|
5775
|
+
loadingBar: _this2.bootstrapData.navbar.loadingBar,
|
|
5776
|
+
navBar: "frame-bricks.nav-bar",
|
|
5777
|
+
sideBar: "frame-bricks.side-bar",
|
|
5778
|
+
breadcrumb: null,
|
|
5779
|
+
footer: null
|
|
5780
|
+
} : _this2.bootstrapData.navbar), {}, {
|
|
5761
5781
|
pageNotFound: "basic-bricks.page-not-found",
|
|
5762
5782
|
pageError: "basic-bricks.page-error"
|
|
5763
5783
|
});
|
|
@@ -5772,7 +5792,7 @@
|
|
|
5772
5792
|
|
|
5773
5793
|
yield Promise.all([_this2.menuBar.bootstrap(_this2.presetBricks.menuBar, {
|
|
5774
5794
|
testid: "brick-next-menu-bar"
|
|
5775
|
-
}), _this2.appBar.bootstrap(_this2.presetBricks.appBar), _this2.loadingBar.bootstrap(_this2.presetBricks.loadingBar)]);
|
|
5795
|
+
}), _this2.appBar.bootstrap(_this2.presetBricks.appBar), _this2.navBar.bootstrap(_this2.presetBricks.navBar), _this2.sideBar.bootstrap(_this2.presetBricks.sideBar), _this2.footer.bootstrap(_this2.presetBricks.footer), _this2.breadcrumb.bootstrap(_this2.presetBricks.breadcrumb), _this2.loadingBar.bootstrap(_this2.presetBricks.loadingBar)]);
|
|
5776
5796
|
})();
|
|
5777
5797
|
}
|
|
5778
5798
|
|
|
@@ -5797,7 +5817,7 @@
|
|
|
5797
5817
|
}
|
|
5798
5818
|
|
|
5799
5819
|
loadCheckLogin() {
|
|
5800
|
-
return _asyncToGenerator__default[
|
|
5820
|
+
return _asyncToGenerator__default["default"](function* () {
|
|
5801
5821
|
var auth = yield checkLogin();
|
|
5802
5822
|
|
|
5803
5823
|
if (auth.loggedIn) {
|
|
@@ -5809,8 +5829,8 @@
|
|
|
5809
5829
|
loadMicroApps(params, interceptorParams) {
|
|
5810
5830
|
var _this3 = this;
|
|
5811
5831
|
|
|
5812
|
-
return _asyncToGenerator__default[
|
|
5813
|
-
var d = yield bootstrap(_objectSpread__default[
|
|
5832
|
+
return _asyncToGenerator__default["default"](function* () {
|
|
5833
|
+
var d = yield bootstrap(_objectSpread__default["default"]({
|
|
5814
5834
|
brief: true
|
|
5815
5835
|
}, params), {
|
|
5816
5836
|
interceptorParams
|
|
@@ -5820,7 +5840,7 @@
|
|
|
5820
5840
|
}, d); // Merge `app.defaultConfig` and `app.userConfig` to `app.config`.
|
|
5821
5841
|
|
|
5822
5842
|
processBootstrapResponse(bootstrapResponse);
|
|
5823
|
-
_this3.bootstrapData = _objectSpread__default[
|
|
5843
|
+
_this3.bootstrapData = _objectSpread__default["default"](_objectSpread__default["default"]({}, bootstrapResponse), {}, {
|
|
5824
5844
|
microApps: bootstrapResponse.storyboards.map(storyboard => storyboard.app).filter(Boolean)
|
|
5825
5845
|
});
|
|
5826
5846
|
})();
|
|
@@ -5829,7 +5849,7 @@
|
|
|
5829
5849
|
fulfilStoryboard(storyboard) {
|
|
5830
5850
|
var _this4 = this;
|
|
5831
5851
|
|
|
5832
|
-
return _asyncToGenerator__default[
|
|
5852
|
+
return _asyncToGenerator__default["default"](function* () {
|
|
5833
5853
|
if (storyboard.$$fulfilled) {
|
|
5834
5854
|
return;
|
|
5835
5855
|
}
|
|
@@ -5843,7 +5863,7 @@
|
|
|
5843
5863
|
}
|
|
5844
5864
|
|
|
5845
5865
|
doFulfilStoryboard(storyboard) {
|
|
5846
|
-
return _asyncToGenerator__default[
|
|
5866
|
+
return _asyncToGenerator__default["default"](function* () {
|
|
5847
5867
|
var {
|
|
5848
5868
|
routes,
|
|
5849
5869
|
meta
|
|
@@ -5860,7 +5880,7 @@
|
|
|
5860
5880
|
var i18nNamespace = "$app-".concat(storyboard.app.id); // Support any language in `meta.i18n`.
|
|
5861
5881
|
|
|
5862
5882
|
Object.entries(meta.i18n).forEach(([lang, resources]) => {
|
|
5863
|
-
i18next__default[
|
|
5883
|
+
i18next__default["default"].addResourceBundle(lang, i18nNamespace, resources);
|
|
5864
5884
|
});
|
|
5865
5885
|
}
|
|
5866
5886
|
})();
|
|
@@ -5869,7 +5889,7 @@
|
|
|
5869
5889
|
loadDepsOfStoryboard(storyboard) {
|
|
5870
5890
|
var _this5 = this;
|
|
5871
5891
|
|
|
5872
|
-
return _asyncToGenerator__default[
|
|
5892
|
+
return _asyncToGenerator__default["default"](function* () {
|
|
5873
5893
|
var {
|
|
5874
5894
|
brickPackages,
|
|
5875
5895
|
templatePackages
|
|
@@ -5946,7 +5966,7 @@
|
|
|
5946
5966
|
loadDynamicBricksInBrickConf(brickConf) {
|
|
5947
5967
|
var _this6 = this;
|
|
5948
5968
|
|
|
5949
|
-
return _asyncToGenerator__default[
|
|
5969
|
+
return _asyncToGenerator__default["default"](function* () {
|
|
5950
5970
|
// Notice: `brickConf` contains runtime data,
|
|
5951
5971
|
// which may contains recursive ref,
|
|
5952
5972
|
// which could cause stack overflow while traversing.
|
|
@@ -5959,7 +5979,7 @@
|
|
|
5959
5979
|
loadDynamicBricks(bricks, processors) {
|
|
5960
5980
|
var _this7 = this;
|
|
5961
5981
|
|
|
5962
|
-
return _asyncToGenerator__default[
|
|
5982
|
+
return _asyncToGenerator__default["default"](function* () {
|
|
5963
5983
|
var filteredBricks = bricks.filter( // Only try to load undefined custom elements.
|
|
5964
5984
|
item => !customElements.get(item)); // Try to load deps for dynamic added bricks.
|
|
5965
5985
|
|
|
@@ -5979,7 +5999,7 @@
|
|
|
5979
5999
|
loadEditorBricks(editorBricks) {
|
|
5980
6000
|
var _this8 = this;
|
|
5981
6001
|
|
|
5982
|
-
return _asyncToGenerator__default[
|
|
6002
|
+
return _asyncToGenerator__default["default"](function* () {
|
|
5983
6003
|
var {
|
|
5984
6004
|
dll,
|
|
5985
6005
|
deps
|
|
@@ -6050,7 +6070,7 @@
|
|
|
6050
6070
|
}
|
|
6051
6071
|
|
|
6052
6072
|
loadUsers() {
|
|
6053
|
-
return _asyncToGenerator__default[
|
|
6073
|
+
return _asyncToGenerator__default["default"](function* () {
|
|
6054
6074
|
var allUserMap = new Map();
|
|
6055
6075
|
|
|
6056
6076
|
try {
|
|
@@ -6089,13 +6109,13 @@
|
|
|
6089
6109
|
getMicroAppApiOrchestrationMapAsync() {
|
|
6090
6110
|
var _this9 = this;
|
|
6091
6111
|
|
|
6092
|
-
return _asyncToGenerator__default[
|
|
6112
|
+
return _asyncToGenerator__default["default"](function* () {
|
|
6093
6113
|
return yield _this9.allMicroAppApiOrchestrationPromise;
|
|
6094
6114
|
})();
|
|
6095
6115
|
}
|
|
6096
6116
|
|
|
6097
6117
|
loadMicroAppApiOrchestration(usedCustomApis) {
|
|
6098
|
-
return _asyncToGenerator__default[
|
|
6118
|
+
return _asyncToGenerator__default["default"](function* () {
|
|
6099
6119
|
var allMicroAppApiOrchestrationMap = new Map();
|
|
6100
6120
|
var legacyCustomApis = usedCustomApis.filter(item => !item.name.includes(":"));
|
|
6101
6121
|
|
|
@@ -6137,7 +6157,7 @@
|
|
|
6137
6157
|
}
|
|
6138
6158
|
|
|
6139
6159
|
loadMagicBrickConfig() {
|
|
6140
|
-
return _asyncToGenerator__default[
|
|
6160
|
+
return _asyncToGenerator__default["default"](function* () {
|
|
6141
6161
|
var allMagicBrickConfigMap = new Map();
|
|
6142
6162
|
|
|
6143
6163
|
try {
|
|
@@ -6167,7 +6187,7 @@
|
|
|
6167
6187
|
}
|
|
6168
6188
|
|
|
6169
6189
|
loadRelatedApps() {
|
|
6170
|
-
return _asyncToGenerator__default[
|
|
6190
|
+
return _asyncToGenerator__default["default"](function* () {
|
|
6171
6191
|
var relatedApps = [];
|
|
6172
6192
|
|
|
6173
6193
|
try {
|
|
@@ -6184,7 +6204,7 @@
|
|
|
6184
6204
|
getRelatedAppsAsync(appId) {
|
|
6185
6205
|
var _this10 = this;
|
|
6186
6206
|
|
|
6187
|
-
return _asyncToGenerator__default[
|
|
6207
|
+
return _asyncToGenerator__default["default"](function* () {
|
|
6188
6208
|
if (!appId) {
|
|
6189
6209
|
return [];
|
|
6190
6210
|
}
|
|
@@ -6203,7 +6223,7 @@
|
|
|
6203
6223
|
updateWorkspaceStack() {
|
|
6204
6224
|
var _this11 = this;
|
|
6205
6225
|
|
|
6206
|
-
return _asyncToGenerator__default[
|
|
6226
|
+
return _asyncToGenerator__default["default"](function* () {
|
|
6207
6227
|
if (_this11.currentApp && _this11.currentApp.id) {
|
|
6208
6228
|
var workspace = {
|
|
6209
6229
|
appId: _this11.currentApp.id,
|
|
@@ -6263,7 +6283,7 @@
|
|
|
6263
6283
|
getProviderBrick(provider) {
|
|
6264
6284
|
var _this12 = this;
|
|
6265
6285
|
|
|
6266
|
-
return _asyncToGenerator__default[
|
|
6286
|
+
return _asyncToGenerator__default["default"](function* () {
|
|
6267
6287
|
if (isCustomApiProvider(provider)) {
|
|
6268
6288
|
provider = CUSTOM_API_PROVIDER;
|
|
6269
6289
|
}
|
|
@@ -6290,6 +6310,16 @@
|
|
|
6290
6310
|
})();
|
|
6291
6311
|
}
|
|
6292
6312
|
|
|
6313
|
+
setUiVersion() {
|
|
6314
|
+
// get from localStorage fot test
|
|
6315
|
+
// this.enableUiV8 = this.getFeatureFlags()["ui-v8"];
|
|
6316
|
+
this.enableUiV8 = !!localStorage.getItem("test-ui-v8");
|
|
6317
|
+
|
|
6318
|
+
if (this.enableUiV8) {
|
|
6319
|
+
document.documentElement.dataset.ui = "v8";
|
|
6320
|
+
}
|
|
6321
|
+
}
|
|
6322
|
+
|
|
6293
6323
|
} // Since `@next-dll/editor-bricks-helper` depends on `@next-dll/react-dnd`,
|
|
6294
6324
|
// always load react-dnd before loading editor-bricks-helper.
|
|
6295
6325
|
|
|
@@ -6298,7 +6328,7 @@
|
|
|
6298
6328
|
}
|
|
6299
6329
|
|
|
6300
6330
|
function _loadScriptOfDll() {
|
|
6301
|
-
_loadScriptOfDll = _asyncToGenerator__default[
|
|
6331
|
+
_loadScriptOfDll = _asyncToGenerator__default["default"](function* (dlls) {
|
|
6302
6332
|
if (dlls.some(dll => dll.startsWith("dll-of-editor-bricks-helper."))) {
|
|
6303
6333
|
var dllPath = window.DLL_PATH || {};
|
|
6304
6334
|
yield brickUtils.loadScript(dllPath["react-dnd"]);
|
|
@@ -6411,12 +6441,12 @@
|
|
|
6411
6441
|
|
|
6412
6442
|
function getSubRoute(route) {
|
|
6413
6443
|
if (route.type === "routes") {
|
|
6414
|
-
return _objectSpread__default[
|
|
6444
|
+
return _objectSpread__default["default"](_objectSpread__default["default"]({}, route), {}, {
|
|
6415
6445
|
routes: getSubRoutes(route.routes)
|
|
6416
6446
|
});
|
|
6417
6447
|
}
|
|
6418
6448
|
|
|
6419
|
-
return _objectSpread__default[
|
|
6449
|
+
return _objectSpread__default["default"](_objectSpread__default["default"]({}, route), {}, {
|
|
6420
6450
|
bricks: getSubBricks(route.bricks)
|
|
6421
6451
|
});
|
|
6422
6452
|
}
|
|
@@ -6431,16 +6461,16 @@
|
|
|
6431
6461
|
|
|
6432
6462
|
function getSubBrick(brickConf) {
|
|
6433
6463
|
if (brickUtils.isObject(brickConf.slots)) {
|
|
6434
|
-
return _objectSpread__default[
|
|
6464
|
+
return _objectSpread__default["default"](_objectSpread__default["default"]({}, brickConf), {}, {
|
|
6435
6465
|
slots: Object.fromEntries(Object.entries(brickConf.slots).map(([slotId, slotConf]) => {
|
|
6436
6466
|
if (slotConf.type === "routes") {
|
|
6437
|
-
return [slotId, _objectSpread__default[
|
|
6467
|
+
return [slotId, _objectSpread__default["default"](_objectSpread__default["default"]({}, slotConf), {}, {
|
|
6438
6468
|
routes: getSubRoutes(slotConf.routes)
|
|
6439
6469
|
})];
|
|
6440
6470
|
}
|
|
6441
6471
|
/* istanbul ignore else: should never reach */
|
|
6442
6472
|
else if (slotConf.type === "bricks") {
|
|
6443
|
-
return [slotId, _objectSpread__default[
|
|
6473
|
+
return [slotId, _objectSpread__default["default"](_objectSpread__default["default"]({}, slotConf), {}, {
|
|
6444
6474
|
bricks: getSubBricks(slotConf.bricks)
|
|
6445
6475
|
})];
|
|
6446
6476
|
}
|
|
@@ -6455,7 +6485,7 @@
|
|
|
6455
6485
|
return brickConf;
|
|
6456
6486
|
}
|
|
6457
6487
|
|
|
6458
|
-
return _objectSpread__default[
|
|
6488
|
+
return _objectSpread__default["default"](_objectSpread__default["default"]({}, storyboard), {}, {
|
|
6459
6489
|
routes: getSubRoutes(storyboard.routes)
|
|
6460
6490
|
});
|
|
6461
6491
|
}
|
|
@@ -6591,7 +6621,7 @@
|
|
|
6591
6621
|
return proxies.reduce((acc, proxy) => {
|
|
6592
6622
|
switch (proxy.mergeMethod) {
|
|
6593
6623
|
case "extend":
|
|
6594
|
-
return _objectSpread__default[
|
|
6624
|
+
return _objectSpread__default["default"](_objectSpread__default["default"]({}, acc), object[proxy.$$reversedRef]);
|
|
6595
6625
|
// istanbul ignore next: should never reach
|
|
6596
6626
|
|
|
6597
6627
|
default:
|
|
@@ -6645,11 +6675,11 @@
|
|
|
6645
6675
|
properties: templateProperties,
|
|
6646
6676
|
slots: templateSlots
|
|
6647
6677
|
} = brickConf,
|
|
6648
|
-
restBrickConf = _objectWithoutProperties__default[
|
|
6678
|
+
restBrickConf = _objectWithoutProperties__default["default"](brickConf, _excluded$1);
|
|
6649
6679
|
|
|
6650
6680
|
var newBrickConf = restBrickConf; // Get a copy of proxy for each instance of custom template.
|
|
6651
6681
|
|
|
6652
|
-
var proxyCopy = _objectSpread__default[
|
|
6682
|
+
var proxyCopy = _objectSpread__default["default"]({}, proxy);
|
|
6653
6683
|
|
|
6654
6684
|
proxyBrick.proxy = proxyCopy;
|
|
6655
6685
|
proxyBrick.proxyRefs = new Map();
|
|
@@ -6674,8 +6704,8 @@
|
|
|
6674
6704
|
tplVariables[reversedRef] = templateProperties === null || templateProperties === void 0 ? void 0 : templateProperties[reversedRef];
|
|
6675
6705
|
} else {
|
|
6676
6706
|
// Variable property proxies have no refs.
|
|
6677
|
-
refPropertiesCopy[reversedRef] = _objectSpread__default[
|
|
6678
|
-
extraOneWayRefs: Array.isArray(conf.extraOneWayRefs) ? conf.extraOneWayRefs.map(extraConf => _objectSpread__default[
|
|
6707
|
+
refPropertiesCopy[reversedRef] = _objectSpread__default["default"](_objectSpread__default["default"]({}, conf), {}, {
|
|
6708
|
+
extraOneWayRefs: Array.isArray(conf.extraOneWayRefs) ? conf.extraOneWayRefs.map(extraConf => _objectSpread__default["default"]({}, extraConf)) : undefined
|
|
6679
6709
|
});
|
|
6680
6710
|
}
|
|
6681
6711
|
}
|
|
@@ -6696,7 +6726,7 @@
|
|
|
6696
6726
|
_conf.$$reversedRef = _reversedRef;
|
|
6697
6727
|
|
|
6698
6728
|
if (isMergeableProperty(_conf)) {
|
|
6699
|
-
collectMergeBases(_conf, reversedProxies.mergeBases, _objectSpread__default[
|
|
6729
|
+
collectMergeBases(_conf, reversedProxies.mergeBases, _objectSpread__default["default"](_objectSpread__default["default"]({}, context), {}, {
|
|
6700
6730
|
getTplVariables
|
|
6701
6731
|
}), refToBrickConf);
|
|
6702
6732
|
}
|
|
@@ -6766,7 +6796,7 @@
|
|
|
6766
6796
|
ref,
|
|
6767
6797
|
slots: slotsInTemplate
|
|
6768
6798
|
} = brickConfInTemplate,
|
|
6769
|
-
restBrickConfInTemplate = _objectWithoutProperties__default[
|
|
6799
|
+
restBrickConfInTemplate = _objectWithoutProperties__default["default"](brickConfInTemplate, _excluded2);
|
|
6770
6800
|
|
|
6771
6801
|
var {
|
|
6772
6802
|
reversedProxies,
|
|
@@ -6893,7 +6923,7 @@
|
|
|
6893
6923
|
}
|
|
6894
6924
|
}
|
|
6895
6925
|
|
|
6896
|
-
return _objectSpread__default[
|
|
6926
|
+
return _objectSpread__default["default"](_objectSpread__default["default"]({}, restBrickConfInTemplate), {}, {
|
|
6897
6927
|
slots,
|
|
6898
6928
|
[symbolForComputedPropsFromProxy]: computedPropsFromProxy,
|
|
6899
6929
|
[symbolForRefForProxy]: refForProxy,
|
|
@@ -7119,7 +7149,7 @@
|
|
|
7119
7149
|
return;
|
|
7120
7150
|
}
|
|
7121
7151
|
|
|
7122
|
-
customTemplateRegistry.set(tagName, _objectSpread__default[
|
|
7152
|
+
customTemplateRegistry.set(tagName, _objectSpread__default["default"](_objectSpread__default["default"]({}, tplConstructor), {}, {
|
|
7123
7153
|
name: tagName
|
|
7124
7154
|
})); // Collect defined properties of the template.
|
|
7125
7155
|
|
|
@@ -7157,11 +7187,11 @@
|
|
|
7157
7187
|
|
|
7158
7188
|
class CustomTemplateContext {
|
|
7159
7189
|
constructor() {
|
|
7160
|
-
_defineProperty__default[
|
|
7190
|
+
_defineProperty__default["default"](this, "contextMap", new Map());
|
|
7161
7191
|
|
|
7162
|
-
_defineProperty__default[
|
|
7192
|
+
_defineProperty__default["default"](this, "brickMap", new Map());
|
|
7163
7193
|
|
|
7164
|
-
_defineProperty__default[
|
|
7194
|
+
_defineProperty__default["default"](this, "propsMap", new Map());
|
|
7165
7195
|
}
|
|
7166
7196
|
|
|
7167
7197
|
createContext() {
|
|
@@ -7217,35 +7247,35 @@
|
|
|
7217
7247
|
|
|
7218
7248
|
class LocationContext {
|
|
7219
7249
|
constructor(kernel, location) {
|
|
7220
|
-
_defineProperty__default[
|
|
7250
|
+
_defineProperty__default["default"](this, "query", void 0);
|
|
7221
7251
|
|
|
7222
|
-
_defineProperty__default[
|
|
7252
|
+
_defineProperty__default["default"](this, "resolver", void 0);
|
|
7223
7253
|
|
|
7224
|
-
_defineProperty__default[
|
|
7254
|
+
_defineProperty__default["default"](this, "messageDispatcher", void 0);
|
|
7225
7255
|
|
|
7226
|
-
_defineProperty__default[
|
|
7256
|
+
_defineProperty__default["default"](this, "beforePageLoadHandlers", []);
|
|
7227
7257
|
|
|
7228
|
-
_defineProperty__default[
|
|
7258
|
+
_defineProperty__default["default"](this, "pageLoadHandlers", []);
|
|
7229
7259
|
|
|
7230
|
-
_defineProperty__default[
|
|
7260
|
+
_defineProperty__default["default"](this, "beforePageLeaveHandlers", []);
|
|
7231
7261
|
|
|
7232
|
-
_defineProperty__default[
|
|
7262
|
+
_defineProperty__default["default"](this, "pageLeaveHandlers", []);
|
|
7233
7263
|
|
|
7234
|
-
_defineProperty__default[
|
|
7264
|
+
_defineProperty__default["default"](this, "anchorLoadHandlers", []);
|
|
7235
7265
|
|
|
7236
|
-
_defineProperty__default[
|
|
7266
|
+
_defineProperty__default["default"](this, "anchorUnloadHandlers", []);
|
|
7237
7267
|
|
|
7238
|
-
_defineProperty__default[
|
|
7268
|
+
_defineProperty__default["default"](this, "messageCloseHandlers", []);
|
|
7239
7269
|
|
|
7240
|
-
_defineProperty__default[
|
|
7270
|
+
_defineProperty__default["default"](this, "messageHandlers", []);
|
|
7241
7271
|
|
|
7242
|
-
_defineProperty__default[
|
|
7272
|
+
_defineProperty__default["default"](this, "segues", {});
|
|
7243
7273
|
|
|
7244
|
-
_defineProperty__default[
|
|
7274
|
+
_defineProperty__default["default"](this, "currentMatch", void 0);
|
|
7245
7275
|
|
|
7246
|
-
_defineProperty__default[
|
|
7276
|
+
_defineProperty__default["default"](this, "storyboardContext", new Map());
|
|
7247
7277
|
|
|
7248
|
-
_defineProperty__default[
|
|
7278
|
+
_defineProperty__default["default"](this, "tplContext", new CustomTemplateContext());
|
|
7249
7279
|
|
|
7250
7280
|
this.kernel = kernel;
|
|
7251
7281
|
this.location = location;
|
|
@@ -7267,7 +7297,7 @@
|
|
|
7267
7297
|
match,
|
|
7268
7298
|
app: this.kernel.nextApp,
|
|
7269
7299
|
images: (_this$kernel$nextAppM = this.kernel.nextAppMeta) === null || _this$kernel$nextAppM === void 0 ? void 0 : _this$kernel$nextAppM.images,
|
|
7270
|
-
sys: _objectSpread__default[
|
|
7300
|
+
sys: _objectSpread__default["default"]({
|
|
7271
7301
|
org: auth.org,
|
|
7272
7302
|
username: auth.username,
|
|
7273
7303
|
userInstanceId: auth.userInstanceId,
|
|
@@ -7295,7 +7325,7 @@
|
|
|
7295
7325
|
defineStoryboardFreeContext(contextConfs, coreContext, brick) {
|
|
7296
7326
|
var _this = this;
|
|
7297
7327
|
|
|
7298
|
-
return _asyncToGenerator__default[
|
|
7328
|
+
return _asyncToGenerator__default["default"](function* () {
|
|
7299
7329
|
yield brickUtils.resolveContextConcurrently(contextConfs, contextConf => _this.resolveStoryboardContext(contextConf, coreContext, brick));
|
|
7300
7330
|
})();
|
|
7301
7331
|
}
|
|
@@ -7303,7 +7333,7 @@
|
|
|
7303
7333
|
resolveStoryboardContext(contextConf, coreContext, brick) {
|
|
7304
7334
|
var _this2 = this;
|
|
7305
7335
|
|
|
7306
|
-
return _asyncToGenerator__default[
|
|
7336
|
+
return _asyncToGenerator__default["default"](function* () {
|
|
7307
7337
|
if (contextConf.property) {
|
|
7308
7338
|
if (brick) {
|
|
7309
7339
|
_this2.setStoryboardContext(contextConf.name, {
|
|
@@ -7324,7 +7354,7 @@
|
|
|
7324
7354
|
if (looseCheckIf(contextConf.resolve, coreContext)) {
|
|
7325
7355
|
isResolve = true;
|
|
7326
7356
|
var valueConf = {};
|
|
7327
|
-
yield _this2.resolver.resolveOne("reference", _objectSpread__default[
|
|
7357
|
+
yield _this2.resolver.resolveOne("reference", _objectSpread__default["default"]({
|
|
7328
7358
|
transform: "value",
|
|
7329
7359
|
transformMapArray: false
|
|
7330
7360
|
}, contextConf.resolve), valueConf, null, coreContext);
|
|
@@ -7436,7 +7466,7 @@
|
|
|
7436
7466
|
mountRoutes(routes, slotId, mountRoutesResult) {
|
|
7437
7467
|
var _this3 = this;
|
|
7438
7468
|
|
|
7439
|
-
return _asyncToGenerator__default[
|
|
7469
|
+
return _asyncToGenerator__default["default"](function* () {
|
|
7440
7470
|
var matched = _this3.matchRoutes(routes, _this3.kernel.nextApp);
|
|
7441
7471
|
|
|
7442
7472
|
var redirect;
|
|
@@ -7519,7 +7549,7 @@
|
|
|
7519
7549
|
mountMenu(menuConf, match, mountRoutesResult) {
|
|
7520
7550
|
var _this4 = this;
|
|
7521
7551
|
|
|
7522
|
-
return _asyncToGenerator__default[
|
|
7552
|
+
return _asyncToGenerator__default["default"](function* () {
|
|
7523
7553
|
if (menuConf === false) {
|
|
7524
7554
|
// `route.menu` 设置为 `false` 表示不显示顶栏和侧栏。
|
|
7525
7555
|
mountRoutesResult.flags.barsHidden = true;
|
|
@@ -7561,7 +7591,7 @@
|
|
|
7561
7591
|
var injectDeep = menuConf.injectDeep;
|
|
7562
7592
|
|
|
7563
7593
|
if (menuConf.type === "resolve") {
|
|
7564
|
-
yield _this4.resolver.resolveOne("reference", _objectSpread__default[
|
|
7594
|
+
yield _this4.resolver.resolveOne("reference", _objectSpread__default["default"]({
|
|
7565
7595
|
transformMapArray: false
|
|
7566
7596
|
}, menuConf.resolve), menuConf, null, context);
|
|
7567
7597
|
injectDeep = false;
|
|
@@ -7607,10 +7637,10 @@
|
|
|
7607
7637
|
mountProviders(providers, match, slotId, mountRoutesResult) {
|
|
7608
7638
|
var _this5 = this;
|
|
7609
7639
|
|
|
7610
|
-
return _asyncToGenerator__default[
|
|
7640
|
+
return _asyncToGenerator__default["default"](function* () {
|
|
7611
7641
|
if (Array.isArray(providers)) {
|
|
7612
7642
|
for (var providerConf of providers) {
|
|
7613
|
-
yield _this5.mountBrick(_objectSpread__default[
|
|
7643
|
+
yield _this5.mountBrick(_objectSpread__default["default"](_objectSpread__default["default"]({}, typeof providerConf === "string" ? {
|
|
7614
7644
|
brick: providerConf
|
|
7615
7645
|
} : providerConf), {}, {
|
|
7616
7646
|
bg: true,
|
|
@@ -7624,7 +7654,7 @@
|
|
|
7624
7654
|
mountBricks(bricks, match, slotId, mountRoutesResult, tplStack) {
|
|
7625
7655
|
var _this6 = this;
|
|
7626
7656
|
|
|
7627
|
-
return _asyncToGenerator__default[
|
|
7657
|
+
return _asyncToGenerator__default["default"](function* () {
|
|
7628
7658
|
for (var brickConf of bricks) {
|
|
7629
7659
|
try {
|
|
7630
7660
|
yield _this6.mountBrick(brickConf, match, slotId, mountRoutesResult, tplStack === null || tplStack === void 0 ? void 0 : tplStack.slice());
|
|
@@ -7658,7 +7688,7 @@
|
|
|
7658
7688
|
checkResolvableIf(ifContainer, context) {
|
|
7659
7689
|
var _this7 = this;
|
|
7660
7690
|
|
|
7661
|
-
return _asyncToGenerator__default[
|
|
7691
|
+
return _asyncToGenerator__default["default"](function* () {
|
|
7662
7692
|
if (brickUtils.isObject(ifContainer.if)) {
|
|
7663
7693
|
var ifChecked = computeRealValue(ifContainer.if, context, true);
|
|
7664
7694
|
var ifConf = {};
|
|
@@ -7671,7 +7701,7 @@
|
|
|
7671
7701
|
}
|
|
7672
7702
|
|
|
7673
7703
|
preCheckPermissions(container, context) {
|
|
7674
|
-
return _asyncToGenerator__default[
|
|
7704
|
+
return _asyncToGenerator__default["default"](function* () {
|
|
7675
7705
|
if (isLoggedIn() && container.permissionsPreCheck && Array.isArray(container.permissionsPreCheck)) {
|
|
7676
7706
|
var usedActions = computeRealValue(container.permissionsPreCheck, context, true);
|
|
7677
7707
|
yield validatePermissions(usedActions);
|
|
@@ -7682,7 +7712,7 @@
|
|
|
7682
7712
|
mountBrick(brickConf, match, slotId, mountRoutesResult, tplStack = []) {
|
|
7683
7713
|
var _this8 = this;
|
|
7684
7714
|
|
|
7685
|
-
return _asyncToGenerator__default[
|
|
7715
|
+
return _asyncToGenerator__default["default"](function* () {
|
|
7686
7716
|
var _this8$kernel$nextApp;
|
|
7687
7717
|
|
|
7688
7718
|
var tplContextId = brickConf[symbolForTplContextId];
|
|
@@ -7757,7 +7787,7 @@
|
|
|
7757
7787
|
var expandedBrickConf = brickConf;
|
|
7758
7788
|
|
|
7759
7789
|
if (tplTagName) {
|
|
7760
|
-
expandedBrickConf = expandCustomTemplate(_objectSpread__default[
|
|
7790
|
+
expandedBrickConf = expandCustomTemplate(_objectSpread__default["default"](_objectSpread__default["default"]({}, brickConf), {}, {
|
|
7761
7791
|
brick: tplTagName,
|
|
7762
7792
|
// Properties are computed for custom templates.
|
|
7763
7793
|
properties: brick.properties
|
|
@@ -7831,7 +7861,7 @@
|
|
|
7831
7861
|
|
|
7832
7862
|
if (brickUtils.isObject(expandedBrickConf.slots)) {
|
|
7833
7863
|
for (var [_slotId, slotConf] of Object.entries(expandedBrickConf.slots)) {
|
|
7834
|
-
var slottedMountRoutesResult = _objectSpread__default[
|
|
7864
|
+
var slottedMountRoutesResult = _objectSpread__default["default"](_objectSpread__default["default"]({}, mountRoutesResult), {}, {
|
|
7835
7865
|
main: brick.children
|
|
7836
7866
|
});
|
|
7837
7867
|
|
|
@@ -8069,7 +8099,7 @@
|
|
|
8069
8099
|
// },
|
|
8070
8100
|
$refresh: {
|
|
8071
8101
|
value: function () {
|
|
8072
|
-
var _ref = _asyncToGenerator__default[
|
|
8102
|
+
var _ref = _asyncToGenerator__default["default"](function* ({
|
|
8073
8103
|
ignoreErrors,
|
|
8074
8104
|
throwErrors,
|
|
8075
8105
|
$$scheduled
|
|
@@ -8082,7 +8112,7 @@
|
|
|
8082
8112
|
|
|
8083
8113
|
try {
|
|
8084
8114
|
yield Promise.all(this.$$dependents.map( /*#__PURE__*/function () {
|
|
8085
|
-
var _ref2 = _asyncToGenerator__default[
|
|
8115
|
+
var _ref2 = _asyncToGenerator__default["default"](function* ({
|
|
8086
8116
|
brick,
|
|
8087
8117
|
method,
|
|
8088
8118
|
args,
|
|
@@ -8117,7 +8147,7 @@
|
|
|
8117
8147
|
}
|
|
8118
8148
|
|
|
8119
8149
|
function _fetchData() {
|
|
8120
|
-
_fetchData = _asyncToGenerator__default[
|
|
8150
|
+
_fetchData = _asyncToGenerator__default["default"](function* () {
|
|
8121
8151
|
var value = yield promise;
|
|
8122
8152
|
data = field === null || field === undefined ? value : lodash.get(value, field); // The fetched data and its inner objects should never be *injected* again.
|
|
8123
8153
|
|
|
@@ -8177,13 +8207,13 @@
|
|
|
8177
8207
|
|
|
8178
8208
|
class Resolver {
|
|
8179
8209
|
constructor(kernel) {
|
|
8180
|
-
_defineProperty__default[
|
|
8210
|
+
_defineProperty__default["default"](this, "cache", new Map());
|
|
8181
8211
|
|
|
8182
|
-
_defineProperty__default[
|
|
8212
|
+
_defineProperty__default["default"](this, "refreshQueue", new Map());
|
|
8183
8213
|
|
|
8184
|
-
_defineProperty__default[
|
|
8214
|
+
_defineProperty__default["default"](this, "definedResolves", new Map());
|
|
8185
8215
|
|
|
8186
|
-
_defineProperty__default[
|
|
8216
|
+
_defineProperty__default["default"](this, "active", true);
|
|
8187
8217
|
|
|
8188
8218
|
this.kernel = kernel;
|
|
8189
8219
|
}
|
|
@@ -8203,7 +8233,7 @@
|
|
|
8203
8233
|
defineResolves(resolves, context) {
|
|
8204
8234
|
if (Array.isArray(resolves)) {
|
|
8205
8235
|
for (var _resolveConf of resolves) {
|
|
8206
|
-
this.definedResolves.set(_resolveConf.id, _objectSpread__default[
|
|
8236
|
+
this.definedResolves.set(_resolveConf.id, _objectSpread__default["default"](_objectSpread__default["default"]({}, _resolveConf), {}, {
|
|
8207
8237
|
args: computeRealValue(_resolveConf.args, context, true)
|
|
8208
8238
|
}));
|
|
8209
8239
|
}
|
|
@@ -8213,7 +8243,7 @@
|
|
|
8213
8243
|
resolve(brickConf, brick, context) {
|
|
8214
8244
|
var _this = this;
|
|
8215
8245
|
|
|
8216
|
-
return _asyncToGenerator__default[
|
|
8246
|
+
return _asyncToGenerator__default["default"](function* () {
|
|
8217
8247
|
var _brickConf$lifeCycle$, _brickConf$lifeCycle;
|
|
8218
8248
|
|
|
8219
8249
|
var useResolves = ((_brickConf$lifeCycle$ = (_brickConf$lifeCycle = brickConf.lifeCycle) === null || _brickConf$lifeCycle === void 0 ? void 0 : _brickConf$lifeCycle.useResolves) !== null && _brickConf$lifeCycle$ !== void 0 ? _brickConf$lifeCycle$ : []).filter(r => {
|
|
@@ -8234,7 +8264,7 @@
|
|
|
8234
8264
|
resolveOne(type, resolveConf, conf, brick, context) {
|
|
8235
8265
|
var _this2 = this;
|
|
8236
8266
|
|
|
8237
|
-
return _asyncToGenerator__default[
|
|
8267
|
+
return _asyncToGenerator__default["default"](function* () {
|
|
8238
8268
|
var brickConf = conf;
|
|
8239
8269
|
var propsReference = conf;
|
|
8240
8270
|
var actualResolveConf;
|
|
@@ -8285,12 +8315,12 @@
|
|
|
8285
8315
|
makeProviderRefreshable(providerBrick);
|
|
8286
8316
|
|
|
8287
8317
|
if (providerBrick.interval && !_this2.refreshQueue.has(providerBrick)) {
|
|
8288
|
-
_this2.refreshQueue.set(providerBrick, _objectSpread__default[
|
|
8318
|
+
_this2.refreshQueue.set(providerBrick, _objectSpread__default["default"]({}, providerBrick.interval));
|
|
8289
8319
|
} // Currently we can't refresh dynamic templates.
|
|
8290
8320
|
|
|
8291
8321
|
|
|
8292
8322
|
if (type !== "reference" && !brickConf.template) {
|
|
8293
|
-
providerBrick.$$dependents.push(_objectSpread__default[
|
|
8323
|
+
providerBrick.$$dependents.push(_objectSpread__default["default"]({
|
|
8294
8324
|
brick,
|
|
8295
8325
|
method,
|
|
8296
8326
|
args,
|
|
@@ -8357,7 +8387,7 @@
|
|
|
8357
8387
|
}
|
|
8358
8388
|
|
|
8359
8389
|
function _fetchData() {
|
|
8360
|
-
_fetchData = _asyncToGenerator__default[
|
|
8390
|
+
_fetchData = _asyncToGenerator__default["default"](function* () {
|
|
8361
8391
|
var value = yield promise;
|
|
8362
8392
|
data = field === null || field === undefined ? value : lodash.get(value, field); // The fetched data and its inner objects should never be *injected* again.
|
|
8363
8393
|
|
|
@@ -8398,7 +8428,7 @@
|
|
|
8398
8428
|
|
|
8399
8429
|
var _loop = function (providerBrick, interval) {
|
|
8400
8430
|
var request = /*#__PURE__*/function () {
|
|
8401
|
-
var _ref = _asyncToGenerator__default[
|
|
8431
|
+
var _ref = _asyncToGenerator__default["default"](function* () {
|
|
8402
8432
|
yield providerBrick.$refresh({
|
|
8403
8433
|
ignoreErrors: interval.ignoreErrors,
|
|
8404
8434
|
throwErrors: true,
|
|
@@ -8439,7 +8469,7 @@
|
|
|
8439
8469
|
// Pass remaining arguments (including vendor specific ones) to parent constructor
|
|
8440
8470
|
super(rawError.message);
|
|
8441
8471
|
|
|
8442
|
-
_defineProperty__default[
|
|
8472
|
+
_defineProperty__default["default"](this, "rawError", void 0);
|
|
8443
8473
|
|
|
8444
8474
|
this.name = "ResolveRequestError"; // Maintains proper stack trace for where our error was thrown (only available on V8)
|
|
8445
8475
|
// istanbul ignore else
|
|
@@ -8459,21 +8489,21 @@
|
|
|
8459
8489
|
|
|
8460
8490
|
class Router {
|
|
8461
8491
|
constructor(kernel) {
|
|
8462
|
-
_defineProperty__default[
|
|
8492
|
+
_defineProperty__default["default"](this, "defaultCollapsed", false);
|
|
8463
8493
|
|
|
8464
|
-
_defineProperty__default[
|
|
8494
|
+
_defineProperty__default["default"](this, "locationContext", void 0);
|
|
8465
8495
|
|
|
8466
|
-
_defineProperty__default[
|
|
8496
|
+
_defineProperty__default["default"](this, "rendering", false);
|
|
8467
8497
|
|
|
8468
|
-
_defineProperty__default[
|
|
8498
|
+
_defineProperty__default["default"](this, "nextLocation", void 0);
|
|
8469
8499
|
|
|
8470
|
-
_defineProperty__default[
|
|
8500
|
+
_defineProperty__default["default"](this, "prevLocation", void 0);
|
|
8471
8501
|
|
|
8472
|
-
_defineProperty__default[
|
|
8502
|
+
_defineProperty__default["default"](this, "state", "initial");
|
|
8473
8503
|
|
|
8474
|
-
_defineProperty__default[
|
|
8504
|
+
_defineProperty__default["default"](this, "renderId", void 0);
|
|
8475
8505
|
|
|
8476
|
-
_defineProperty__default[
|
|
8506
|
+
_defineProperty__default["default"](this, "featureFlags", void 0);
|
|
8477
8507
|
|
|
8478
8508
|
this.kernel = kernel;
|
|
8479
8509
|
this.featureFlags = this.kernel.getFeatureFlags();
|
|
@@ -8530,14 +8560,14 @@
|
|
|
8530
8560
|
bootstrap() {
|
|
8531
8561
|
var _this = this;
|
|
8532
8562
|
|
|
8533
|
-
return _asyncToGenerator__default[
|
|
8563
|
+
return _asyncToGenerator__default["default"](function* () {
|
|
8534
8564
|
var history = getHistory();
|
|
8535
8565
|
_this.prevLocation = history.location;
|
|
8536
8566
|
|
|
8537
8567
|
_this.locationChangeNotify("", history.location.pathname);
|
|
8538
8568
|
|
|
8539
8569
|
history.listen( /*#__PURE__*/function () {
|
|
8540
|
-
var _ref = _asyncToGenerator__default[
|
|
8570
|
+
var _ref = _asyncToGenerator__default["default"](function* (location, action) {
|
|
8541
8571
|
var _this$prevLocation$st, _location$state;
|
|
8542
8572
|
|
|
8543
8573
|
var ignoreRendering = false;
|
|
@@ -8547,12 +8577,15 @@
|
|
|
8547
8577
|
}; // Omit the "key" when checking whether locations are equal in certain situations.
|
|
8548
8578
|
|
|
8549
8579
|
if ( // When current location is triggered by browser action of hash link.
|
|
8550
|
-
location.key === undefined ||
|
|
8580
|
+
location.key === undefined || // When current location is triggered by browser action of non-push-or-replace,
|
|
8581
|
+
// such as goBack or goForward,
|
|
8582
|
+
action === "POP" && ( // and the previous location was triggered by hash link,
|
|
8583
|
+
_this.prevLocation.key === undefined || // or the previous location specified notify false.
|
|
8551
8584
|
((_this$prevLocation$st = _this.prevLocation.state) === null || _this$prevLocation$st === void 0 ? void 0 : _this$prevLocation$st.notify) === false)) {
|
|
8552
8585
|
omittedLocationProps.key = null;
|
|
8553
8586
|
}
|
|
8554
8587
|
|
|
8555
|
-
if (history$1.locationsAreEqual(_objectSpread__default[
|
|
8588
|
+
if (history$1.locationsAreEqual(_objectSpread__default["default"](_objectSpread__default["default"]({}, _this.prevLocation), omittedLocationProps), _objectSpread__default["default"](_objectSpread__default["default"]({}, location), omittedLocationProps)) || action !== "POP" && ((_location$state = location.state) === null || _location$state === void 0 ? void 0 : _location$state.notify) === false) {
|
|
8556
8589
|
// Ignore rendering if location not changed except hash, state and optional key.
|
|
8557
8590
|
// Ignore rendering if notify is `false`.
|
|
8558
8591
|
ignoreRendering = true;
|
|
@@ -8596,7 +8629,7 @@
|
|
|
8596
8629
|
queuedRender(location) {
|
|
8597
8630
|
var _this2 = this;
|
|
8598
8631
|
|
|
8599
|
-
return _asyncToGenerator__default[
|
|
8632
|
+
return _asyncToGenerator__default["default"](function* () {
|
|
8600
8633
|
_this2.rendering = true;
|
|
8601
8634
|
|
|
8602
8635
|
try {
|
|
@@ -8616,7 +8649,7 @@
|
|
|
8616
8649
|
render(location) {
|
|
8617
8650
|
var _this3 = this;
|
|
8618
8651
|
|
|
8619
|
-
return _asyncToGenerator__default[
|
|
8652
|
+
return _asyncToGenerator__default["default"](function* () {
|
|
8620
8653
|
_this3.state = "initial";
|
|
8621
8654
|
_this3.renderId = lodash.uniqueId("render-id-");
|
|
8622
8655
|
resetAllInjected();
|
|
@@ -8783,30 +8816,33 @@
|
|
|
8783
8816
|
if (barsHidden || getRuntimeMisc().isInIframeOfLegacyConsole) {
|
|
8784
8817
|
_this3.kernel.toggleBars(false);
|
|
8785
8818
|
} else if (_this3.kernel.currentLayout === "console") {
|
|
8786
|
-
|
|
8819
|
+
/* istanbul ignore next */
|
|
8820
|
+
if (!_this3.kernel.enableUiV8) {
|
|
8821
|
+
var _menuBar$menu, _menuBar$menu2;
|
|
8787
8822
|
|
|
8788
|
-
|
|
8823
|
+
yield constructMenu(menuBar, _this3.locationContext.getCurrentContext(), _this3.kernel);
|
|
8789
8824
|
|
|
8790
|
-
|
|
8791
|
-
|
|
8825
|
+
if (shouldBeDefaultCollapsed((_menuBar$menu = menuBar.menu) === null || _menuBar$menu === void 0 ? void 0 : _menuBar$menu.defaultCollapsed, (_menuBar$menu2 = menuBar.menu) === null || _menuBar$menu2 === void 0 ? void 0 : _menuBar$menu2.defaultCollapsedBreakpoint)) {
|
|
8826
|
+
_this3.kernel.menuBar.collapse(true);
|
|
8792
8827
|
|
|
8793
|
-
|
|
8794
|
-
|
|
8795
|
-
|
|
8796
|
-
|
|
8828
|
+
_this3.defaultCollapsed = true;
|
|
8829
|
+
} else {
|
|
8830
|
+
if (_this3.defaultCollapsed) {
|
|
8831
|
+
_this3.kernel.menuBar.collapse(false);
|
|
8832
|
+
}
|
|
8833
|
+
|
|
8834
|
+
_this3.defaultCollapsed = false;
|
|
8797
8835
|
}
|
|
8798
8836
|
|
|
8799
|
-
|
|
8800
|
-
|
|
8837
|
+
if (actualLegacy === "iframe") {
|
|
8838
|
+
// Do not modify breadcrumb in iframe mode,
|
|
8839
|
+
// it will be *popped* from iframe automatically.
|
|
8840
|
+
delete appBar.breadcrumb;
|
|
8841
|
+
}
|
|
8801
8842
|
|
|
8802
|
-
|
|
8803
|
-
|
|
8804
|
-
// it will be *popped* from iframe automatically.
|
|
8805
|
-
delete appBar.breadcrumb;
|
|
8843
|
+
mountStaticNode(_this3.kernel.menuBar.element, menuBar);
|
|
8844
|
+
mountStaticNode(_this3.kernel.appBar.element, appBar);
|
|
8806
8845
|
}
|
|
8807
|
-
|
|
8808
|
-
mountStaticNode(_this3.kernel.menuBar.element, menuBar);
|
|
8809
|
-
mountStaticNode(_this3.kernel.appBar.element, appBar);
|
|
8810
8846
|
}
|
|
8811
8847
|
|
|
8812
8848
|
_this3.kernel.toggleLegacyIframe(actualLegacy === "iframe");
|
|
@@ -8983,12 +9019,12 @@
|
|
|
8983
9019
|
/** @internal */
|
|
8984
9020
|
|
|
8985
9021
|
var initI18n = () => {
|
|
8986
|
-
i18next__default[
|
|
8987
|
-
i18next__default[
|
|
9022
|
+
i18next__default["default"].addResourceBundle("en", NS_BRICK_KIT, en);
|
|
9023
|
+
i18next__default["default"].addResourceBundle("zh", NS_BRICK_KIT, zh);
|
|
8988
9024
|
};
|
|
8989
9025
|
|
|
8990
9026
|
// Ref https://reactjs.org/docs/error-boundaries.html
|
|
8991
|
-
class LegacyErrorBoundary extends React__default[
|
|
9027
|
+
class LegacyErrorBoundary extends React__default["default"].Component {
|
|
8992
9028
|
constructor(props) {
|
|
8993
9029
|
super(props);
|
|
8994
9030
|
this.state = {
|
|
@@ -9011,9 +9047,9 @@
|
|
|
9011
9047
|
render() {
|
|
9012
9048
|
if (this.state.error) {
|
|
9013
9049
|
// You can render any custom fallback UI
|
|
9014
|
-
return /*#__PURE__*/React__default[
|
|
9050
|
+
return /*#__PURE__*/React__default["default"].createElement("div", {
|
|
9015
9051
|
"data-testid": "error-boundary"
|
|
9016
|
-
}, /*#__PURE__*/React__default[
|
|
9052
|
+
}, /*#__PURE__*/React__default["default"].createElement("h3", null, this.props.t(K.SOMETHING_WENT_WRONG)), /*#__PURE__*/React__default["default"].createElement("p", null, httpErrorToString(this.state.error)));
|
|
9017
9053
|
}
|
|
9018
9054
|
|
|
9019
9055
|
return this.props.children;
|
|
@@ -9175,7 +9211,7 @@
|
|
|
9175
9211
|
}
|
|
9176
9212
|
|
|
9177
9213
|
warnNativeHtmlElementProperty(element.key);
|
|
9178
|
-
return _objectSpread__default[
|
|
9214
|
+
return _objectSpread__default["default"](_objectSpread__default["default"]({}, element), {}, {
|
|
9179
9215
|
finisher(Class) {
|
|
9180
9216
|
Class.createMethod(element.key);
|
|
9181
9217
|
}
|
|
@@ -9208,8 +9244,8 @@
|
|
|
9208
9244
|
/** @internal */
|
|
9209
9245
|
|
|
9210
9246
|
function useRecentApps() {
|
|
9211
|
-
var [recentApps, setRecentApps] = React__default[
|
|
9212
|
-
React__default[
|
|
9247
|
+
var [recentApps, setRecentApps] = React__default["default"].useState(getRuntime().getRecentApps());
|
|
9248
|
+
React__default["default"].useEffect(() => {
|
|
9213
9249
|
var listener = event => {
|
|
9214
9250
|
setRecentApps(event.detail);
|
|
9215
9251
|
};
|
|
@@ -9243,8 +9279,8 @@
|
|
|
9243
9279
|
|
|
9244
9280
|
function useLocation() {
|
|
9245
9281
|
var history = getHistory();
|
|
9246
|
-
var [location, setLocation] = React__default[
|
|
9247
|
-
React__default[
|
|
9282
|
+
var [location, setLocation] = React__default["default"].useState(history.location);
|
|
9283
|
+
React__default["default"].useEffect(() => {
|
|
9248
9284
|
var unlisten = history.listen(location => setLocation(location));
|
|
9249
9285
|
return unlisten;
|
|
9250
9286
|
}, [history]);
|
|
@@ -9305,7 +9341,7 @@
|
|
|
9305
9341
|
|
|
9306
9342
|
var properties = doTransform(data, cloneDeepWithInjectedMark(useBrick.properties) || {}, transformOption);
|
|
9307
9343
|
|
|
9308
|
-
var brick = _objectSpread__default[
|
|
9344
|
+
var brick = _objectSpread__default["default"](_objectSpread__default["default"]({}, useBrick), {}, {
|
|
9309
9345
|
type: useBrick.brick,
|
|
9310
9346
|
// Now transform data in properties too.
|
|
9311
9347
|
properties
|
|
@@ -9352,7 +9388,7 @@
|
|
|
9352
9388
|
};
|
|
9353
9389
|
};
|
|
9354
9390
|
|
|
9355
|
-
var _proxyBrick = _objectSpread__default[
|
|
9391
|
+
var _proxyBrick = _objectSpread__default["default"](_objectSpread__default["default"]({}, tplBrick), {}, {
|
|
9356
9392
|
element: brick.element
|
|
9357
9393
|
});
|
|
9358
9394
|
|
|
@@ -9364,7 +9400,7 @@
|
|
|
9364
9400
|
singleRefBrickProxyMap.set(brick.ref, {
|
|
9365
9401
|
brick: _proxyBrick
|
|
9366
9402
|
});
|
|
9367
|
-
handleProxyOfCustomTemplate(_objectSpread__default[
|
|
9403
|
+
handleProxyOfCustomTemplate(_objectSpread__default["default"](_objectSpread__default["default"]({}, tplBrick), {}, {
|
|
9368
9404
|
proxyRefs: singleRefBrickProxyMap,
|
|
9369
9405
|
proxy: getFilterProxy(tplBrick.proxy, brick.ref)
|
|
9370
9406
|
}));
|
|
@@ -9390,7 +9426,7 @@
|
|
|
9390
9426
|
* @param props - 属性。
|
|
9391
9427
|
*/
|
|
9392
9428
|
|
|
9393
|
-
var SingleBrickAsComponent = /*#__PURE__*/React__default[
|
|
9429
|
+
var SingleBrickAsComponent = /*#__PURE__*/React__default["default"].memo(function SingleBrickAsComponent({
|
|
9394
9430
|
useBrick,
|
|
9395
9431
|
data,
|
|
9396
9432
|
parentRefForUseBrickInPortal,
|
|
@@ -9401,7 +9437,7 @@
|
|
|
9401
9437
|
|
|
9402
9438
|
var template;
|
|
9403
9439
|
var brick;
|
|
9404
|
-
var isBrickAvailable = React__default[
|
|
9440
|
+
var isBrickAvailable = React__default["default"].useMemo(() => {
|
|
9405
9441
|
if (brickUtils.isObject(useBrick.if) && !isPreEvaluated(useBrick.if)) {
|
|
9406
9442
|
// eslint-disable-next-line
|
|
9407
9443
|
console.warn("Currently resolvable-if in `useBrick` is not supported.");
|
|
@@ -9413,7 +9449,7 @@
|
|
|
9413
9449
|
|
|
9414
9450
|
return true;
|
|
9415
9451
|
}, [useBrick, data]);
|
|
9416
|
-
var runtimeBrick = React__default[
|
|
9452
|
+
var runtimeBrick = React__default["default"].useMemo( /*#__PURE__*/_asyncToGenerator__default["default"](function* () {
|
|
9417
9453
|
if (!isBrickAvailable) {
|
|
9418
9454
|
return null;
|
|
9419
9455
|
} // If the router state is initial, ignore rendering the sub-brick.
|
|
@@ -9451,8 +9487,8 @@
|
|
|
9451
9487
|
|
|
9452
9488
|
return brick;
|
|
9453
9489
|
}), [useBrick, data, isBrickAvailable]);
|
|
9454
|
-
var innerRefCallback = React__default[
|
|
9455
|
-
var _ref2 = _asyncToGenerator__default[
|
|
9490
|
+
var innerRefCallback = React__default["default"].useCallback( /*#__PURE__*/function () {
|
|
9491
|
+
var _ref2 = _asyncToGenerator__default["default"](function* (element) {
|
|
9456
9492
|
immediatelyRefCallback === null || immediatelyRefCallback === void 0 ? void 0 : immediatelyRefCallback(element);
|
|
9457
9493
|
|
|
9458
9494
|
if (element) {
|
|
@@ -9506,24 +9542,24 @@
|
|
|
9506
9542
|
}
|
|
9507
9543
|
|
|
9508
9544
|
if (template) {
|
|
9509
|
-
return /*#__PURE__*/React__default[
|
|
9545
|
+
return /*#__PURE__*/React__default["default"].createElement(template.brick, {
|
|
9510
9546
|
ref: innerRefCallback
|
|
9511
9547
|
}, ...slotsToChildren(template.slots).map((item, index) => {
|
|
9512
|
-
return /*#__PURE__*/React__default[
|
|
9548
|
+
return /*#__PURE__*/React__default["default"].createElement(SingleBrickAsComponent, {
|
|
9513
9549
|
key: index,
|
|
9514
9550
|
useBrick: item,
|
|
9515
9551
|
data: brick.properties
|
|
9516
9552
|
});
|
|
9517
9553
|
}));
|
|
9518
9554
|
} else {
|
|
9519
|
-
return /*#__PURE__*/React__default[
|
|
9555
|
+
return /*#__PURE__*/React__default["default"].createElement(useBrick.brick, {
|
|
9520
9556
|
ref: innerRefCallback
|
|
9521
9557
|
}, ...slotsToChildren(useBrick.slots).map((item, index) => {
|
|
9522
9558
|
if (useBrick[symbolForTplContextId] && !item[symbolForTplContextId]) {
|
|
9523
9559
|
item[symbolForTplContextId] = useBrick[symbolForTplContextId];
|
|
9524
9560
|
}
|
|
9525
9561
|
|
|
9526
|
-
return /*#__PURE__*/React__default[
|
|
9562
|
+
return /*#__PURE__*/React__default["default"].createElement(SingleBrickAsComponent, {
|
|
9527
9563
|
key: index,
|
|
9528
9564
|
useBrick: item,
|
|
9529
9565
|
data: data
|
|
@@ -9557,7 +9593,7 @@
|
|
|
9557
9593
|
parentRefForUseBrickInPortal
|
|
9558
9594
|
}) {
|
|
9559
9595
|
if (Array.isArray(useBrick)) {
|
|
9560
|
-
return /*#__PURE__*/React__default[
|
|
9596
|
+
return /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, useBrick.map((item, index) => /*#__PURE__*/React__default["default"].createElement(SingleBrickAsComponent, {
|
|
9561
9597
|
key: index,
|
|
9562
9598
|
useBrick: item,
|
|
9563
9599
|
data: data,
|
|
@@ -9565,7 +9601,7 @@
|
|
|
9565
9601
|
})));
|
|
9566
9602
|
}
|
|
9567
9603
|
|
|
9568
|
-
return /*#__PURE__*/React__default[
|
|
9604
|
+
return /*#__PURE__*/React__default["default"].createElement(SingleBrickAsComponent, {
|
|
9569
9605
|
useBrick: useBrick,
|
|
9570
9606
|
data: data,
|
|
9571
9607
|
parentRefForUseBrickInPortal: parentRefForUseBrickInPortal
|
|
@@ -9577,8 +9613,8 @@
|
|
|
9577
9613
|
return [];
|
|
9578
9614
|
}
|
|
9579
9615
|
|
|
9580
|
-
return Object.entries(slots).flatMap(([slot, slotConf]) => Array.isArray(slotConf.bricks) ? slotConf.bricks.map(child => _objectSpread__default[
|
|
9581
|
-
properties: _objectSpread__default[
|
|
9616
|
+
return Object.entries(slots).flatMap(([slot, slotConf]) => Array.isArray(slotConf.bricks) ? slotConf.bricks.map(child => _objectSpread__default["default"](_objectSpread__default["default"]({}, child), {}, {
|
|
9617
|
+
properties: _objectSpread__default["default"](_objectSpread__default["default"]({}, child.properties), {}, {
|
|
9582
9618
|
slot
|
|
9583
9619
|
})
|
|
9584
9620
|
})) : []);
|
|
@@ -9595,7 +9631,7 @@
|
|
|
9595
9631
|
// eslint-disable-next-line react/display-name
|
|
9596
9632
|
|
|
9597
9633
|
|
|
9598
|
-
var ForwardRefSingleBrickAsComponent = /*#__PURE__*/React__default[
|
|
9634
|
+
var ForwardRefSingleBrickAsComponent = /*#__PURE__*/React__default["default"].memo( /*#__PURE__*/React.forwardRef(function LegacySingleBrickAsComponent({
|
|
9599
9635
|
useBrick,
|
|
9600
9636
|
data,
|
|
9601
9637
|
parentRefForUseBrickInPortal,
|
|
@@ -9607,7 +9643,7 @@
|
|
|
9607
9643
|
|
|
9608
9644
|
var template;
|
|
9609
9645
|
var brick;
|
|
9610
|
-
var isBrickAvailable = React__default[
|
|
9646
|
+
var isBrickAvailable = React__default["default"].useMemo(() => {
|
|
9611
9647
|
if (brickUtils.isObject(useBrick.if) && !isPreEvaluated(useBrick.if)) {
|
|
9612
9648
|
// eslint-disable-next-line
|
|
9613
9649
|
console.warn("Currently resolvable-if in `useBrick` is not supported.");
|
|
@@ -9624,7 +9660,7 @@
|
|
|
9624
9660
|
React.useImperativeHandle(ref, () => {
|
|
9625
9661
|
return brickRef.current;
|
|
9626
9662
|
});
|
|
9627
|
-
var runtimeBrick = React__default[
|
|
9663
|
+
var runtimeBrick = React__default["default"].useMemo( /*#__PURE__*/_asyncToGenerator__default["default"](function* () {
|
|
9628
9664
|
if (!isBrickAvailable) {
|
|
9629
9665
|
return null;
|
|
9630
9666
|
} // If the router state is initial, ignore rendering the sub-brick.
|
|
@@ -9664,8 +9700,8 @@
|
|
|
9664
9700
|
listenOnTrackingContext(brick, trackingContextList, runtimeContext);
|
|
9665
9701
|
return brick;
|
|
9666
9702
|
}), [useBrick, data, isBrickAvailable]);
|
|
9667
|
-
var innerRefCallback = React__default[
|
|
9668
|
-
var _ref4 = _asyncToGenerator__default[
|
|
9703
|
+
var innerRefCallback = React__default["default"].useCallback( /*#__PURE__*/function () {
|
|
9704
|
+
var _ref4 = _asyncToGenerator__default["default"](function* (element) {
|
|
9669
9705
|
brickRef.current = element;
|
|
9670
9706
|
|
|
9671
9707
|
if (element) {
|
|
@@ -9719,24 +9755,24 @@
|
|
|
9719
9755
|
}
|
|
9720
9756
|
|
|
9721
9757
|
if (template) {
|
|
9722
|
-
return /*#__PURE__*/React__default[
|
|
9758
|
+
return /*#__PURE__*/React__default["default"].createElement(template.brick, {
|
|
9723
9759
|
ref: innerRefCallback
|
|
9724
9760
|
}, ...slotsToChildren(template.slots).map((item, index) => {
|
|
9725
|
-
return /*#__PURE__*/React__default[
|
|
9761
|
+
return /*#__PURE__*/React__default["default"].createElement(SingleBrickAsComponent, {
|
|
9726
9762
|
key: index,
|
|
9727
9763
|
useBrick: item,
|
|
9728
9764
|
data: brick.properties
|
|
9729
9765
|
});
|
|
9730
9766
|
}));
|
|
9731
9767
|
} else {
|
|
9732
|
-
return /*#__PURE__*/React__default[
|
|
9768
|
+
return /*#__PURE__*/React__default["default"].createElement(useBrick.brick, {
|
|
9733
9769
|
ref: innerRefCallback
|
|
9734
9770
|
}, ...slotsToChildren(useBrick.slots).map((item, index) => {
|
|
9735
9771
|
if (useBrick[symbolForTplContextId] && !item[symbolForTplContextId]) {
|
|
9736
9772
|
item[symbolForTplContextId] = useBrick[symbolForTplContextId];
|
|
9737
9773
|
}
|
|
9738
9774
|
|
|
9739
|
-
return /*#__PURE__*/React__default[
|
|
9775
|
+
return /*#__PURE__*/React__default["default"].createElement(SingleBrickAsComponent, {
|
|
9740
9776
|
key: index,
|
|
9741
9777
|
useBrick: item,
|
|
9742
9778
|
data: data
|
|
@@ -9796,7 +9832,7 @@
|
|
|
9796
9832
|
var TimePicker$1 = locale$4;
|
|
9797
9833
|
|
|
9798
9834
|
var locale$3 = {
|
|
9799
|
-
lang: _extends__default[
|
|
9835
|
+
lang: _extends__default["default"]({
|
|
9800
9836
|
placeholder: '请选择日期',
|
|
9801
9837
|
yearPlaceholder: '请选择年份',
|
|
9802
9838
|
quarterPlaceholder: '请选择季度',
|
|
@@ -9807,7 +9843,7 @@
|
|
|
9807
9843
|
rangeMonthPlaceholder: ['开始月份', '结束月份'],
|
|
9808
9844
|
rangeWeekPlaceholder: ['开始周', '结束周']
|
|
9809
9845
|
}, locale$5),
|
|
9810
|
-
timePickerLocale: _extends__default[
|
|
9846
|
+
timePickerLocale: _extends__default["default"]({}, TimePicker$1)
|
|
9811
9847
|
}; // should add whitespace between char in Button
|
|
9812
9848
|
|
|
9813
9849
|
locale$3.lang.ok = '确 定'; // All settings at:
|
|
@@ -9993,7 +10029,7 @@
|
|
|
9993
10029
|
var TimePicker = locale$1;
|
|
9994
10030
|
|
|
9995
10031
|
var locale = {
|
|
9996
|
-
lang: _extends__default[
|
|
10032
|
+
lang: _extends__default["default"]({
|
|
9997
10033
|
placeholder: 'Select date',
|
|
9998
10034
|
yearPlaceholder: 'Select year',
|
|
9999
10035
|
quarterPlaceholder: 'Select quarter',
|
|
@@ -10004,7 +10040,7 @@
|
|
|
10004
10040
|
rangeMonthPlaceholder: ['Start month', 'End month'],
|
|
10005
10041
|
rangeWeekPlaceholder: ['Start week', 'End week']
|
|
10006
10042
|
}, locale$2),
|
|
10007
|
-
timePickerLocale: _extends__default[
|
|
10043
|
+
timePickerLocale: _extends__default["default"]({}, TimePicker)
|
|
10008
10044
|
}; // All settings at:
|
|
10009
10045
|
// https://github.com/ant-design/ant-design/blob/master/components/date-picker/locale/example.json
|
|
10010
10046
|
|
|
@@ -10224,8 +10260,8 @@
|
|
|
10224
10260
|
var background = (_props$background = props.background) !== null && _props$background !== void 0 ? _props$background : "white";
|
|
10225
10261
|
var emptyImage = background === "white" ? SvgEmptyGreyImage : SvgEmptyLightGreyImage;
|
|
10226
10262
|
var illustration = React.useMemo(() => props.illustration && illustrations.getIllustration(props.illustration), [props.illustration]);
|
|
10227
|
-
var image = props.illustration ? illustration : /*#__PURE__*/React__default[
|
|
10228
|
-
return /*#__PURE__*/React__default[
|
|
10263
|
+
var image = props.illustration ? illustration : /*#__PURE__*/React__default["default"].createElement(emptyImage);
|
|
10264
|
+
return /*#__PURE__*/React__default["default"].createElement(antd.Empty, {
|
|
10229
10265
|
image: image,
|
|
10230
10266
|
imageStyle: props.imageStyle,
|
|
10231
10267
|
description: props.description
|
|
@@ -10236,7 +10272,7 @@
|
|
|
10236
10272
|
*/
|
|
10237
10273
|
|
|
10238
10274
|
function renderEasyopsEmpty() {
|
|
10239
|
-
return /*#__PURE__*/React__default[
|
|
10275
|
+
return /*#__PURE__*/React__default["default"].createElement(EasyopsEmpty, null);
|
|
10240
10276
|
}
|
|
10241
10277
|
|
|
10242
10278
|
var FeatureFlagsContext = /*#__PURE__*/React.createContext(null);
|
|
@@ -10306,25 +10342,25 @@
|
|
|
10306
10342
|
|
|
10307
10343
|
function DisplayByFeatureFlags(props) {
|
|
10308
10344
|
var featureFlags = useFeatureFlags(props.name);
|
|
10309
|
-
return featureFlags.every(flag => !!flag) ? /*#__PURE__*/React__default[
|
|
10345
|
+
return featureFlags.every(flag => !!flag) ? /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, props.children) : props !== null && props !== void 0 && props.fallback ? /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, props === null || props === void 0 ? void 0 : props.fallback) : null;
|
|
10310
10346
|
}
|
|
10311
10347
|
|
|
10312
10348
|
/**
|
|
10313
10349
|
* 构件的 React 组件包装器,包含 ErrorBoundary, ConfigProvider, FeatureFlagsProvider。
|
|
10314
10350
|
*/
|
|
10315
10351
|
function BrickWrapper(props) {
|
|
10316
|
-
var locale = i18next__default[
|
|
10352
|
+
var locale = i18next__default["default"].language && i18next__default["default"].language.split("-")[0] === "en" ? defaultLocale : zhCN; // istanbul ignore next
|
|
10317
10353
|
|
|
10318
10354
|
var featureFlags = process.env.NODE_ENV === "test" ? {} : getRuntime().getFeatureFlags();
|
|
10319
|
-
return /*#__PURE__*/React__default[
|
|
10355
|
+
return /*#__PURE__*/React__default["default"].createElement(ErrorBoundary, null, /*#__PURE__*/React__default["default"].createElement(FeatureFlagsProvider, {
|
|
10320
10356
|
value: featureFlags
|
|
10321
|
-
}, /*#__PURE__*/React__default[
|
|
10357
|
+
}, /*#__PURE__*/React__default["default"].createElement(antd.ConfigProvider, {
|
|
10322
10358
|
locale: locale,
|
|
10323
10359
|
autoInsertSpaceInButton: false,
|
|
10324
10360
|
renderEmpty: () => {
|
|
10325
10361
|
var _props$wrapperConfig;
|
|
10326
10362
|
|
|
10327
|
-
return /*#__PURE__*/React__default[
|
|
10363
|
+
return /*#__PURE__*/React__default["default"].createElement(EasyopsEmpty, (_props$wrapperConfig = props.wrapperConfig) === null || _props$wrapperConfig === void 0 ? void 0 : _props$wrapperConfig.empty);
|
|
10328
10364
|
}
|
|
10329
10365
|
}, props.children)));
|
|
10330
10366
|
}
|
|
@@ -10430,7 +10466,7 @@
|
|
|
10430
10466
|
constructor(...args) {
|
|
10431
10467
|
super(...args);
|
|
10432
10468
|
|
|
10433
|
-
_defineProperty__default[
|
|
10469
|
+
_defineProperty__default["default"](this, "_hasRequestedRender", false);
|
|
10434
10470
|
}
|
|
10435
10471
|
|
|
10436
10472
|
/** @internal */
|
|
@@ -10618,7 +10654,7 @@
|
|
|
10618
10654
|
var {
|
|
10619
10655
|
type
|
|
10620
10656
|
} = options,
|
|
10621
|
-
eventInit = _objectWithoutProperties__default[
|
|
10657
|
+
eventInit = _objectWithoutProperties__default["default"](options, _excluded);
|
|
10622
10658
|
|
|
10623
10659
|
this.__dev_only_definedEvents.add(type); // Make event emitter readonly.
|
|
10624
10660
|
|
|
@@ -10626,7 +10662,7 @@
|
|
|
10626
10662
|
Object.defineProperty(this.prototype, name, {
|
|
10627
10663
|
get() {
|
|
10628
10664
|
return Object.freeze({
|
|
10629
|
-
emit: detail => this.dispatchEvent(new CustomEvent(type, _objectSpread__default[
|
|
10665
|
+
emit: detail => this.dispatchEvent(new CustomEvent(type, _objectSpread__default["default"](_objectSpread__default["default"]({}, eventInit), {}, {
|
|
10630
10666
|
detail
|
|
10631
10667
|
})))
|
|
10632
10668
|
});
|
|
@@ -10641,19 +10677,19 @@
|
|
|
10641
10677
|
|
|
10642
10678
|
}
|
|
10643
10679
|
|
|
10644
|
-
_defineProperty__default[
|
|
10680
|
+
_defineProperty__default["default"](UpdatingElement, "_observedAttributes", new Set());
|
|
10645
10681
|
|
|
10646
|
-
_defineProperty__default[
|
|
10682
|
+
_defineProperty__default["default"](UpdatingElement, "__dev_only_definedProperties", new Set());
|
|
10647
10683
|
|
|
10648
|
-
_defineProperty__default[
|
|
10684
|
+
_defineProperty__default["default"](UpdatingElement, "__dev_only_definedMethods", new Set());
|
|
10649
10685
|
|
|
10650
|
-
_defineProperty__default[
|
|
10686
|
+
_defineProperty__default["default"](UpdatingElement, "__dev_only_definedEvents", new Set());
|
|
10651
10687
|
|
|
10652
10688
|
/**
|
|
10653
10689
|
* 模态框类构件的抽象基类。
|
|
10654
10690
|
*/
|
|
10655
10691
|
|
|
10656
|
-
var ModalElement = _decorate__default[
|
|
10692
|
+
var ModalElement = _decorate__default["default"](null, function (_initialize, _UpdatingElement) {
|
|
10657
10693
|
class ModalElement extends _UpdatingElement {
|
|
10658
10694
|
constructor(...args) {
|
|
10659
10695
|
super(...args);
|
|
@@ -10759,5 +10795,5 @@
|
|
|
10759
10795
|
|
|
10760
10796
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
10761
10797
|
|
|
10762
|
-
}))
|
|
10798
|
+
}));
|
|
10763
10799
|
//# sourceMappingURL=index.bundle.js.map
|