@next-core/brick-kit 2.73.2 → 2.75.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 +32 -68
- package/dist/index.bundle.js +375 -328
- package/dist/index.bundle.js.map +1 -1
- package/dist/index.esm.js +78 -29
- package/dist/index.esm.js.map +1 -1
- package/dist/types/BrickAsComponent.d.ts.map +1 -1
- package/dist/types/checkIf.d.ts +1 -0
- package/dist/types/checkIf.d.ts.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/LocationContext.d.ts +2 -2
- package/dist/types/core/LocationContext.d.ts.map +1 -1
- package/dist/types/core/Router.d.ts.map +1 -1
- package/dist/types/internal/menu.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,11 +1361,20 @@
|
|
|
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) {
|
|
1371
|
-
|
|
1368
|
+
var _menuBar$menu;
|
|
1369
|
+
|
|
1370
|
+
var defaultCollapsed = (_menuBar$menu = menuBar.menu) === null || _menuBar$menu === void 0 ? void 0 : _menuBar$menu.defaultCollapsed;
|
|
1371
|
+
var menu = yield processMenu(menuBar.menuId, context, kernel, hasSubMenu);
|
|
1372
|
+
|
|
1373
|
+
if (!lodash.isNil(defaultCollapsed)) {
|
|
1374
|
+
menu.defaultCollapsed = defaultCollapsed;
|
|
1375
|
+
}
|
|
1376
|
+
|
|
1377
|
+
menuBar.menu = menu;
|
|
1372
1378
|
}
|
|
1373
1379
|
|
|
1374
1380
|
if (hasSubMenu) {
|
|
@@ -1385,7 +1391,7 @@
|
|
|
1385
1391
|
}
|
|
1386
1392
|
|
|
1387
1393
|
function _fetchMenuById() {
|
|
1388
|
-
_fetchMenuById = _asyncToGenerator__default[
|
|
1394
|
+
_fetchMenuById = _asyncToGenerator__default["default"](function* (menuId) {
|
|
1389
1395
|
if (menuCache.has(menuId)) {
|
|
1390
1396
|
return menuCache.get(menuId);
|
|
1391
1397
|
}
|
|
@@ -1463,7 +1469,7 @@
|
|
|
1463
1469
|
}
|
|
1464
1470
|
}
|
|
1465
1471
|
|
|
1466
|
-
return _objectSpread__default[
|
|
1472
|
+
return _objectSpread__default["default"](_objectSpread__default["default"]({}, mainMenu), {}, {
|
|
1467
1473
|
items: validMenuList.flatMap(menu => processGroupInject(menu.items, menu, injectWithMenus))
|
|
1468
1474
|
});
|
|
1469
1475
|
}
|
|
@@ -1479,7 +1485,7 @@
|
|
|
1479
1485
|
injectWithMenus.delete(item.groupId);
|
|
1480
1486
|
}
|
|
1481
1487
|
|
|
1482
|
-
return _objectSpread__default[
|
|
1488
|
+
return _objectSpread__default["default"](_objectSpread__default["default"]({}, item), {}, {
|
|
1483
1489
|
children: ((_processGroupInject = processGroupInject(item.children, menu, injectWithMenus)) !== null && _processGroupInject !== void 0 ? _processGroupInject : []).concat(foundInjectingMenus ? foundInjectingMenus.flatMap(injectingMenu => processGroupInject(injectingMenu.items, injectingMenu, injectWithMenus)) : []),
|
|
1484
1490
|
[symbolAppId]: menu.app[0].appId
|
|
1485
1491
|
});
|
|
@@ -1491,10 +1497,10 @@
|
|
|
1491
1497
|
}
|
|
1492
1498
|
|
|
1493
1499
|
function _loadDynamicMenuItems() {
|
|
1494
|
-
_loadDynamicMenuItems = _asyncToGenerator__default[
|
|
1500
|
+
_loadDynamicMenuItems = _asyncToGenerator__default["default"](function* (menu) {
|
|
1495
1501
|
if (menu.dynamicItems && menu.itemsResolve) {
|
|
1496
1502
|
var itemsConf = {};
|
|
1497
|
-
yield _internalApiGetResolver().resolveOne("reference", _objectSpread__default[
|
|
1503
|
+
yield _internalApiGetResolver().resolveOne("reference", _objectSpread__default["default"]({
|
|
1498
1504
|
transform: "items",
|
|
1499
1505
|
transformMapArray: false
|
|
1500
1506
|
}, menu.itemsResolve), itemsConf, null, _internalApiGetCurrentContext());
|
|
@@ -1509,15 +1515,15 @@
|
|
|
1509
1515
|
}
|
|
1510
1516
|
|
|
1511
1517
|
function _processMenu() {
|
|
1512
|
-
_processMenu = _asyncToGenerator__default[
|
|
1518
|
+
_processMenu = _asyncToGenerator__default["default"](function* (menuId, context, kernel, hasSubMenu) {
|
|
1513
1519
|
var _yield$fetchMenuById = yield fetchMenuById(menuId),
|
|
1514
1520
|
{
|
|
1515
1521
|
items,
|
|
1516
1522
|
app
|
|
1517
1523
|
} = _yield$fetchMenuById,
|
|
1518
|
-
restMenuData = _objectWithoutProperties__default[
|
|
1524
|
+
restMenuData = _objectWithoutProperties__default["default"](_yield$fetchMenuById, _excluded2$1);
|
|
1519
1525
|
|
|
1520
|
-
var menuData = _objectSpread__default[
|
|
1526
|
+
var menuData = _objectSpread__default["default"](_objectSpread__default["default"]({}, yield computeRealValueWithOverrideApp(restMenuData, app[0].appId, context, kernel)), {}, {
|
|
1521
1527
|
items: yield computeMenuItemsWithOverrideApp(items, context, kernel)
|
|
1522
1528
|
});
|
|
1523
1529
|
|
|
@@ -1552,13 +1558,13 @@
|
|
|
1552
1558
|
|
|
1553
1559
|
function computeMenuItemsWithOverrideApp(items, context, kernel) {
|
|
1554
1560
|
return Promise.all(items.map( /*#__PURE__*/function () {
|
|
1555
|
-
var _ref2 = _asyncToGenerator__default[
|
|
1561
|
+
var _ref2 = _asyncToGenerator__default["default"](function* (_ref) {
|
|
1556
1562
|
var {
|
|
1557
1563
|
children
|
|
1558
1564
|
} = _ref,
|
|
1559
|
-
rest = _objectWithoutProperties__default[
|
|
1565
|
+
rest = _objectWithoutProperties__default["default"](_ref, _excluded$2);
|
|
1560
1566
|
|
|
1561
|
-
return _objectSpread__default[
|
|
1567
|
+
return _objectSpread__default["default"](_objectSpread__default["default"]({}, yield computeRealValueWithOverrideApp(rest, rest[symbolAppId], context, kernel)), {}, {
|
|
1562
1568
|
children: children && (yield computeMenuItemsWithOverrideApp(children, context, kernel))
|
|
1563
1569
|
});
|
|
1564
1570
|
});
|
|
@@ -1574,7 +1580,7 @@
|
|
|
1574
1580
|
}
|
|
1575
1581
|
|
|
1576
1582
|
function _processMenuTitle() {
|
|
1577
|
-
_processMenuTitle = _asyncToGenerator__default[
|
|
1583
|
+
_processMenuTitle = _asyncToGenerator__default["default"](function* (menuData) {
|
|
1578
1584
|
if (menuData.title || !menuData.titleDataSource) {
|
|
1579
1585
|
return menuData.title;
|
|
1580
1586
|
}
|
|
@@ -1617,7 +1623,7 @@
|
|
|
1617
1623
|
}
|
|
1618
1624
|
|
|
1619
1625
|
function reorderMenuItems(menuData) {
|
|
1620
|
-
menuData.items = sortMenuItems(menuData.items).map(item => _objectSpread__default[
|
|
1626
|
+
menuData.items = sortMenuItems(menuData.items).map(item => _objectSpread__default["default"](_objectSpread__default["default"]({}, item), {}, {
|
|
1621
1627
|
children: sortMenuItems(item.children)
|
|
1622
1628
|
}));
|
|
1623
1629
|
}
|
|
@@ -1667,7 +1673,7 @@
|
|
|
1667
1673
|
}
|
|
1668
1674
|
|
|
1669
1675
|
function _computeRealValueWithOverrideApp() {
|
|
1670
|
-
_computeRealValueWithOverrideApp = _asyncToGenerator__default[
|
|
1676
|
+
_computeRealValueWithOverrideApp = _asyncToGenerator__default["default"](function* (data, overrideAppId, context, kernel) {
|
|
1671
1677
|
var newContext = context;
|
|
1672
1678
|
|
|
1673
1679
|
if (overrideAppId !== context.app.id && requireOverrideApp(data)) {
|
|
@@ -1675,7 +1681,7 @@
|
|
|
1675
1681
|
|
|
1676
1682
|
if (storyboard) {
|
|
1677
1683
|
yield kernel.fulfilStoryboard(storyboard);
|
|
1678
|
-
newContext = _objectSpread__default[
|
|
1684
|
+
newContext = _objectSpread__default["default"](_objectSpread__default["default"]({}, context), {}, {
|
|
1679
1685
|
overrideApp: storyboard.app
|
|
1680
1686
|
});
|
|
1681
1687
|
}
|
|
@@ -1690,7 +1696,7 @@
|
|
|
1690
1696
|
var requestsMap = new WeakMap();
|
|
1691
1697
|
function registerLazyBricks(bricks, factory) {
|
|
1692
1698
|
var factoryWrapper = /*#__PURE__*/function () {
|
|
1693
|
-
var _ref = _asyncToGenerator__default[
|
|
1699
|
+
var _ref = _asyncToGenerator__default["default"](function* () {
|
|
1694
1700
|
try {
|
|
1695
1701
|
window.dispatchEvent(new CustomEvent("request.start"));
|
|
1696
1702
|
yield factory();
|
|
@@ -1717,7 +1723,7 @@
|
|
|
1717
1723
|
}
|
|
1718
1724
|
|
|
1719
1725
|
function _loadLazyBricks() {
|
|
1720
|
-
_loadLazyBricks = _asyncToGenerator__default[
|
|
1726
|
+
_loadLazyBricks = _asyncToGenerator__default["default"](function* (bricks) {
|
|
1721
1727
|
var requests = new Set();
|
|
1722
1728
|
|
|
1723
1729
|
for (var brick of bricks) {
|
|
@@ -1774,7 +1780,7 @@
|
|
|
1774
1780
|
/* istanbul ignore next */
|
|
1775
1781
|
|
|
1776
1782
|
function _dev_only_getFakeKernel(overrides) {
|
|
1777
|
-
return _objectSpread__default[
|
|
1783
|
+
return _objectSpread__default["default"]({
|
|
1778
1784
|
bootstrapData: kernel.bootstrapData,
|
|
1779
1785
|
getFeatureFlags: kernel.getFeatureFlags.bind(kernel),
|
|
1780
1786
|
loadDynamicBricksInBrickConf: kernel.loadDynamicBricksInBrickConf.bind(kernel),
|
|
@@ -1783,23 +1789,23 @@
|
|
|
1783
1789
|
}
|
|
1784
1790
|
class Runtime {
|
|
1785
1791
|
constructor() {
|
|
1786
|
-
_defineProperty__default[
|
|
1792
|
+
_defineProperty__default["default"](this, "registerBrickTemplate", registerBrickTemplate);
|
|
1787
1793
|
|
|
1788
|
-
_defineProperty__default[
|
|
1794
|
+
_defineProperty__default["default"](this, "registerCustomTemplate", registerCustomTemplate);
|
|
1789
1795
|
|
|
1790
|
-
_defineProperty__default[
|
|
1796
|
+
_defineProperty__default["default"](this, "registerCustomProcessor", registerCustomProcessor);
|
|
1791
1797
|
|
|
1792
|
-
_defineProperty__default[
|
|
1798
|
+
_defineProperty__default["default"](this, "registerLazyBricks", registerLazyBricks);
|
|
1793
1799
|
|
|
1794
|
-
_defineProperty__default[
|
|
1800
|
+
_defineProperty__default["default"](this, "getBasePath", getBasePath);
|
|
1795
1801
|
|
|
1796
|
-
_defineProperty__default[
|
|
1802
|
+
_defineProperty__default["default"](this, "getCurrentTheme", getCurrentTheme);
|
|
1797
1803
|
|
|
1798
|
-
_defineProperty__default[
|
|
1804
|
+
_defineProperty__default["default"](this, "getCurrentMode", getCurrentMode);
|
|
1799
1805
|
}
|
|
1800
1806
|
|
|
1801
1807
|
bootstrap(mountPoints) {
|
|
1802
|
-
return _asyncToGenerator__default[
|
|
1808
|
+
return _asyncToGenerator__default["default"](function* () {
|
|
1803
1809
|
if (kernel !== undefined) {
|
|
1804
1810
|
throw new Error("Cannot bootstrap more than once.");
|
|
1805
1811
|
}
|
|
@@ -2202,7 +2208,7 @@
|
|
|
2202
2208
|
}
|
|
2203
2209
|
|
|
2204
2210
|
function _preCheckPermissions() {
|
|
2205
|
-
_preCheckPermissions = _asyncToGenerator__default[
|
|
2211
|
+
_preCheckPermissions = _asyncToGenerator__default["default"](function* (storyboard) {
|
|
2206
2212
|
var usedActions = brickUtils.scanPermissionActionsInStoryboard(storyboard);
|
|
2207
2213
|
yield validatePermissions(usedActions);
|
|
2208
2214
|
});
|
|
@@ -2220,7 +2226,7 @@
|
|
|
2220
2226
|
*/
|
|
2221
2227
|
|
|
2222
2228
|
function _validatePermissions() {
|
|
2223
|
-
_validatePermissions = _asyncToGenerator__default[
|
|
2229
|
+
_validatePermissions = _asyncToGenerator__default["default"](function* (usedActions) {
|
|
2224
2230
|
// Do not request known actions.
|
|
2225
2231
|
var actions = lodash.difference(usedActions, Array.from(permissionMap.keys()));
|
|
2226
2232
|
|
|
@@ -2294,7 +2300,7 @@
|
|
|
2294
2300
|
return;
|
|
2295
2301
|
}
|
|
2296
2302
|
|
|
2297
|
-
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.
|
|
2298
2304
|
|
|
2299
2305
|
if (brickUtils.hasOwnProperty(data, language)) {
|
|
2300
2306
|
return data[language];
|
|
@@ -2447,7 +2453,7 @@
|
|
|
2447
2453
|
if (typeof raw !== "string") {
|
|
2448
2454
|
// If the `raw` is not a string, it must be a pre-evaluated object.
|
|
2449
2455
|
// Then fulfil the context, and restore the original `raw`.
|
|
2450
|
-
runtimeContext = _objectSpread__default[
|
|
2456
|
+
runtimeContext = _objectSpread__default["default"](_objectSpread__default["default"]({}, raw[symbolForContext]), runtimeContext);
|
|
2451
2457
|
raw = raw[symbolForRaw];
|
|
2452
2458
|
} // A `SyntaxError` maybe thrown.
|
|
2453
2459
|
|
|
@@ -2582,7 +2588,7 @@
|
|
|
2582
2588
|
}
|
|
2583
2589
|
|
|
2584
2590
|
if (attemptToVisitGlobals.has("I18N")) {
|
|
2585
|
-
globalVariables.I18N = i18next__default[
|
|
2591
|
+
globalVariables.I18N = i18next__default["default"].getFixedT(null, "$app-".concat(app.id));
|
|
2586
2592
|
}
|
|
2587
2593
|
|
|
2588
2594
|
if (attemptToVisitGlobals.has("I18N_TEXT")) {
|
|
@@ -2783,20 +2789,20 @@
|
|
|
2783
2789
|
}
|
|
2784
2790
|
|
|
2785
2791
|
function getNextInternalOptions(internalOptions, isArray, key) {
|
|
2786
|
-
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), {}, {
|
|
2787
2793
|
$$stateOfUseBrick: getNextStateOfUseBrick(internalOptions.$$stateOfUseBrick, isArray, key)
|
|
2788
2794
|
}) : internalOptions;
|
|
2789
2795
|
}
|
|
2790
2796
|
|
|
2791
2797
|
class WebsocketMessageRequest {
|
|
2792
2798
|
constructor(event, topic) {
|
|
2793
|
-
_defineProperty__default[
|
|
2799
|
+
_defineProperty__default["default"](this, "topic", void 0);
|
|
2794
2800
|
|
|
2795
|
-
_defineProperty__default[
|
|
2801
|
+
_defineProperty__default["default"](this, "data", void 0);
|
|
2796
2802
|
|
|
2797
|
-
_defineProperty__default[
|
|
2803
|
+
_defineProperty__default["default"](this, "event", void 0);
|
|
2798
2804
|
|
|
2799
|
-
_defineProperty__default[
|
|
2805
|
+
_defineProperty__default["default"](this, "message", void 0);
|
|
2800
2806
|
|
|
2801
2807
|
this.event = event;
|
|
2802
2808
|
this.topic = JSON.stringify(topic);
|
|
@@ -2841,13 +2847,13 @@
|
|
|
2841
2847
|
|
|
2842
2848
|
class WebsocketMessageResponse {
|
|
2843
2849
|
constructor(response) {
|
|
2844
|
-
_defineProperty__default[
|
|
2850
|
+
_defineProperty__default["default"](this, "topic", void 0);
|
|
2845
2851
|
|
|
2846
|
-
_defineProperty__default[
|
|
2852
|
+
_defineProperty__default["default"](this, "data", void 0);
|
|
2847
2853
|
|
|
2848
|
-
_defineProperty__default[
|
|
2854
|
+
_defineProperty__default["default"](this, "event", void 0);
|
|
2849
2855
|
|
|
2850
|
-
_defineProperty__default[
|
|
2856
|
+
_defineProperty__default["default"](this, "message", void 0);
|
|
2851
2857
|
|
|
2852
2858
|
this.data = response;
|
|
2853
2859
|
this.message = JSON.parse(response);
|
|
@@ -2895,25 +2901,25 @@
|
|
|
2895
2901
|
|
|
2896
2902
|
class WebSocketService {
|
|
2897
2903
|
constructor(options) {
|
|
2898
|
-
_defineProperty__default[
|
|
2904
|
+
_defineProperty__default["default"](this, "retryCount", 0);
|
|
2899
2905
|
|
|
2900
|
-
_defineProperty__default[
|
|
2906
|
+
_defineProperty__default["default"](this, "ws", null);
|
|
2901
2907
|
|
|
2902
|
-
_defineProperty__default[
|
|
2908
|
+
_defineProperty__default["default"](this, "lockReconnect", false);
|
|
2903
2909
|
|
|
2904
|
-
_defineProperty__default[
|
|
2910
|
+
_defineProperty__default["default"](this, "options", void 0);
|
|
2905
2911
|
|
|
2906
|
-
_defineProperty__default[
|
|
2912
|
+
_defineProperty__default["default"](this, "messageQueue", new Set());
|
|
2907
2913
|
|
|
2908
|
-
_defineProperty__default[
|
|
2914
|
+
_defineProperty__default["default"](this, "state", "initial");
|
|
2909
2915
|
|
|
2910
|
-
_defineProperty__default[
|
|
2916
|
+
_defineProperty__default["default"](this, "defaultOptions", {
|
|
2911
2917
|
url: null,
|
|
2912
2918
|
reconnectTimeout: 1000,
|
|
2913
2919
|
retryLimit: 6
|
|
2914
2920
|
});
|
|
2915
2921
|
|
|
2916
|
-
this.options = _objectSpread__default[
|
|
2922
|
+
this.options = _objectSpread__default["default"](_objectSpread__default["default"]({}, this.defaultOptions), options);
|
|
2917
2923
|
this.createWebSocket();
|
|
2918
2924
|
}
|
|
2919
2925
|
|
|
@@ -3305,7 +3311,7 @@
|
|
|
3305
3311
|
};
|
|
3306
3312
|
|
|
3307
3313
|
try {
|
|
3308
|
-
path = require
|
|
3314
|
+
path = require('path');
|
|
3309
3315
|
} catch (er) {}
|
|
3310
3316
|
|
|
3311
3317
|
var GLOBSTAR = minimatch.GLOBSTAR = Minimatch.GLOBSTAR = {};
|
|
@@ -4210,15 +4216,15 @@
|
|
|
4210
4216
|
}
|
|
4211
4217
|
class MessageDispatcher {
|
|
4212
4218
|
constructor() {
|
|
4213
|
-
_defineProperty__default[
|
|
4219
|
+
_defineProperty__default["default"](this, "ws", void 0);
|
|
4214
4220
|
|
|
4215
|
-
_defineProperty__default[
|
|
4221
|
+
_defineProperty__default["default"](this, "context", void 0);
|
|
4216
4222
|
|
|
4217
|
-
_defineProperty__default[
|
|
4223
|
+
_defineProperty__default["default"](this, "messages", new Map());
|
|
4218
4224
|
|
|
4219
|
-
_defineProperty__default[
|
|
4225
|
+
_defineProperty__default["default"](this, "messageCallbackHandlers", new Map());
|
|
4220
4226
|
|
|
4221
|
-
_defineProperty__default[
|
|
4227
|
+
_defineProperty__default["default"](this, "channels", new Map());
|
|
4222
4228
|
}
|
|
4223
4229
|
|
|
4224
4230
|
create(brickAndMessages, context) {
|
|
@@ -4432,7 +4438,7 @@
|
|
|
4432
4438
|
}
|
|
4433
4439
|
|
|
4434
4440
|
function _poll() {
|
|
4435
|
-
_poll = _asyncToGenerator__default[
|
|
4441
|
+
_poll = _asyncToGenerator__default["default"](function* () {
|
|
4436
4442
|
timeoutIdList.delete(currentTimeoutId);
|
|
4437
4443
|
var shouldStop;
|
|
4438
4444
|
|
|
@@ -4515,7 +4521,7 @@
|
|
|
4515
4521
|
}
|
|
4516
4522
|
|
|
4517
4523
|
function _getArgsOfCustomApi() {
|
|
4518
|
-
_getArgsOfCustomApi = _asyncToGenerator__default[
|
|
4524
|
+
_getArgsOfCustomApi = _asyncToGenerator__default["default"](function* (provider, originalArgs) {
|
|
4519
4525
|
if (!isCustomApiProvider(provider)) {
|
|
4520
4526
|
return originalArgs;
|
|
4521
4527
|
}
|
|
@@ -4578,8 +4584,8 @@
|
|
|
4578
4584
|
function getApiProfileFromApiDefinition(provider, api) {
|
|
4579
4585
|
var _contract$endpoint, _contract$response;
|
|
4580
4586
|
|
|
4581
|
-
var contract = typeof api.contract === "string" ? yaml__default[
|
|
4582
|
-
schema: yaml__default[
|
|
4587
|
+
var contract = typeof api.contract === "string" ? yaml__default["default"].safeLoad(api.contract, {
|
|
4588
|
+
schema: yaml__default["default"].JSON_SCHEMA,
|
|
4583
4589
|
json: true
|
|
4584
4590
|
}) : api.contract;
|
|
4585
4591
|
var {
|
|
@@ -4619,7 +4625,7 @@
|
|
|
4619
4625
|
}
|
|
4620
4626
|
|
|
4621
4627
|
function _fetchFlowApiDefinition2() {
|
|
4622
|
-
_fetchFlowApiDefinition2 = _asyncToGenerator__default[
|
|
4628
|
+
_fetchFlowApiDefinition2 = _asyncToGenerator__default["default"](function* (provider) {
|
|
4623
4629
|
var [namespace, nameWithVersion] = provider.split("@");
|
|
4624
4630
|
var [name, version] = nameWithVersion.split(":");
|
|
4625
4631
|
var result = yield InstanceApi_postSearch("_INTERFACE_CONTRACT@EASYOPS", {
|
|
@@ -4742,7 +4748,7 @@
|
|
|
4742
4748
|
|
|
4743
4749
|
case "event.preventDefault":
|
|
4744
4750
|
return event => {
|
|
4745
|
-
if (!looseCheckIf(handler, _objectSpread__default[
|
|
4751
|
+
if (!looseCheckIf(handler, _objectSpread__default["default"](_objectSpread__default["default"]({}, context), {}, {
|
|
4746
4752
|
event
|
|
4747
4753
|
}))) {
|
|
4748
4754
|
return;
|
|
@@ -4765,7 +4771,7 @@
|
|
|
4765
4771
|
|
|
4766
4772
|
case "handleHttpError":
|
|
4767
4773
|
return event => {
|
|
4768
|
-
if (!looseCheckIf(handler, _objectSpread__default[
|
|
4774
|
+
if (!looseCheckIf(handler, _objectSpread__default["default"](_objectSpread__default["default"]({}, context), {}, {
|
|
4769
4775
|
event
|
|
4770
4776
|
}))) {
|
|
4771
4777
|
return;
|
|
@@ -4788,7 +4794,7 @@
|
|
|
4788
4794
|
case "theme.setDarkTheme":
|
|
4789
4795
|
case "theme.setLightTheme":
|
|
4790
4796
|
return event => {
|
|
4791
|
-
if (!looseCheckIf(handler, _objectSpread__default[
|
|
4797
|
+
if (!looseCheckIf(handler, _objectSpread__default["default"](_objectSpread__default["default"]({}, context), {}, {
|
|
4792
4798
|
event
|
|
4793
4799
|
}))) {
|
|
4794
4800
|
return;
|
|
@@ -4800,7 +4806,7 @@
|
|
|
4800
4806
|
case "mode.setDashboardMode":
|
|
4801
4807
|
case "mode.setDefaultMode":
|
|
4802
4808
|
return event => {
|
|
4803
|
-
if (!looseCheckIf(handler, _objectSpread__default[
|
|
4809
|
+
if (!looseCheckIf(handler, _objectSpread__default["default"](_objectSpread__default["default"]({}, context), {}, {
|
|
4804
4810
|
event
|
|
4805
4811
|
}))) {
|
|
4806
4812
|
return;
|
|
@@ -4811,7 +4817,7 @@
|
|
|
4811
4817
|
|
|
4812
4818
|
case "menu.clearMenuTitleCache":
|
|
4813
4819
|
return event => {
|
|
4814
|
-
if (!looseCheckIf(handler, _objectSpread__default[
|
|
4820
|
+
if (!looseCheckIf(handler, _objectSpread__default["default"](_objectSpread__default["default"]({}, context), {}, {
|
|
4815
4821
|
event
|
|
4816
4822
|
}))) {
|
|
4817
4823
|
return;
|
|
@@ -4822,7 +4828,7 @@
|
|
|
4822
4828
|
|
|
4823
4829
|
case "menu.clearMenuCache":
|
|
4824
4830
|
return event => {
|
|
4825
|
-
if (!looseCheckIf(handler, _objectSpread__default[
|
|
4831
|
+
if (!looseCheckIf(handler, _objectSpread__default["default"](_objectSpread__default["default"]({}, context), {}, {
|
|
4826
4832
|
event
|
|
4827
4833
|
}))) {
|
|
4828
4834
|
return;
|
|
@@ -4850,8 +4856,8 @@
|
|
|
4850
4856
|
|
|
4851
4857
|
function usingProviderFactory(handler, context, runtimeBrick) {
|
|
4852
4858
|
return /*#__PURE__*/function () {
|
|
4853
|
-
var _ref = _asyncToGenerator__default[
|
|
4854
|
-
if (!looseCheckIf(handler, _objectSpread__default[
|
|
4859
|
+
var _ref = _asyncToGenerator__default["default"](function* (event) {
|
|
4860
|
+
if (!looseCheckIf(handler, _objectSpread__default["default"](_objectSpread__default["default"]({}, context), {}, {
|
|
4855
4861
|
event
|
|
4856
4862
|
}))) {
|
|
4857
4863
|
return;
|
|
@@ -4875,7 +4881,7 @@
|
|
|
4875
4881
|
|
|
4876
4882
|
function builtinTplDispatchEventFactory(runtimeBrick, args, ifContainer, context) {
|
|
4877
4883
|
return function (event) {
|
|
4878
|
-
if (!looseCheckIf(ifContainer, _objectSpread__default[
|
|
4884
|
+
if (!looseCheckIf(ifContainer, _objectSpread__default["default"](_objectSpread__default["default"]({}, context), {}, {
|
|
4879
4885
|
event
|
|
4880
4886
|
}))) {
|
|
4881
4887
|
return;
|
|
@@ -4898,7 +4904,7 @@
|
|
|
4898
4904
|
return function (event) {
|
|
4899
4905
|
var _contextItem$eventTar;
|
|
4900
4906
|
|
|
4901
|
-
if (!looseCheckIf(ifContainer, _objectSpread__default[
|
|
4907
|
+
if (!looseCheckIf(ifContainer, _objectSpread__default["default"](_objectSpread__default["default"]({}, context), {}, {
|
|
4902
4908
|
event
|
|
4903
4909
|
}))) {
|
|
4904
4910
|
return;
|
|
@@ -4958,7 +4964,7 @@
|
|
|
4958
4964
|
|
|
4959
4965
|
function builtinLocationListenerFactory(method, args, ifContainer, context) {
|
|
4960
4966
|
return function (event) {
|
|
4961
|
-
if (!looseCheckIf(ifContainer, _objectSpread__default[
|
|
4967
|
+
if (!looseCheckIf(ifContainer, _objectSpread__default["default"](_objectSpread__default["default"]({}, context), {}, {
|
|
4962
4968
|
event
|
|
4963
4969
|
}))) {
|
|
4964
4970
|
return;
|
|
@@ -4975,7 +4981,7 @@
|
|
|
4975
4981
|
|
|
4976
4982
|
function builtinSegueListenerFactory(method, args, ifContainer, context) {
|
|
4977
4983
|
return function (event) {
|
|
4978
|
-
if (!looseCheckIf(ifContainer, _objectSpread__default[
|
|
4984
|
+
if (!looseCheckIf(ifContainer, _objectSpread__default["default"](_objectSpread__default["default"]({}, context), {}, {
|
|
4979
4985
|
event
|
|
4980
4986
|
}))) {
|
|
4981
4987
|
return;
|
|
@@ -4992,7 +4998,7 @@
|
|
|
4992
4998
|
|
|
4993
4999
|
function builtinAliasListenerFactory(method, args, ifContainer, context) {
|
|
4994
5000
|
return function (event) {
|
|
4995
|
-
if (!looseCheckIf(ifContainer, _objectSpread__default[
|
|
5001
|
+
if (!looseCheckIf(ifContainer, _objectSpread__default["default"](_objectSpread__default["default"]({}, context), {}, {
|
|
4996
5002
|
event
|
|
4997
5003
|
}))) {
|
|
4998
5004
|
return;
|
|
@@ -5008,7 +5014,7 @@
|
|
|
5008
5014
|
|
|
5009
5015
|
function builtinWebSocketListenerFactory(runtimeBrick, method, args, ifContainer, callback, context) {
|
|
5010
5016
|
return function (event) {
|
|
5011
|
-
if (!looseCheckIf(ifContainer, _objectSpread__default[
|
|
5017
|
+
if (!looseCheckIf(ifContainer, _objectSpread__default["default"](_objectSpread__default["default"]({}, context), {}, {
|
|
5012
5018
|
event
|
|
5013
5019
|
}))) {
|
|
5014
5020
|
return;
|
|
@@ -5022,7 +5028,7 @@
|
|
|
5022
5028
|
getMessageDispatcher()[method](channel, {
|
|
5023
5029
|
system,
|
|
5024
5030
|
topic
|
|
5025
|
-
}, _objectSpread__default[
|
|
5031
|
+
}, _objectSpread__default["default"](_objectSpread__default["default"]({}, callback), {}, {
|
|
5026
5032
|
runtimeBrick,
|
|
5027
5033
|
context
|
|
5028
5034
|
}));
|
|
@@ -5044,7 +5050,7 @@
|
|
|
5044
5050
|
};
|
|
5045
5051
|
|
|
5046
5052
|
return function (event) {
|
|
5047
|
-
if (!looseCheckIf(ifContainer, _objectSpread__default[
|
|
5053
|
+
if (!looseCheckIf(ifContainer, _objectSpread__default["default"](_objectSpread__default["default"]({}, context), {}, {
|
|
5048
5054
|
event
|
|
5049
5055
|
}))) {
|
|
5050
5056
|
return;
|
|
@@ -5057,14 +5063,14 @@
|
|
|
5057
5063
|
|
|
5058
5064
|
function builtinWindowListenerFactory(args, ifContainer, context) {
|
|
5059
5065
|
return function (event) {
|
|
5060
|
-
if (!looseCheckIf(ifContainer, _objectSpread__default[
|
|
5066
|
+
if (!looseCheckIf(ifContainer, _objectSpread__default["default"](_objectSpread__default["default"]({}, context), {}, {
|
|
5061
5067
|
event
|
|
5062
5068
|
}))) {
|
|
5063
5069
|
return;
|
|
5064
5070
|
}
|
|
5065
5071
|
|
|
5066
|
-
var [url, target] = argsFactory(args, context, event);
|
|
5067
|
-
window.open(url, target || "_self");
|
|
5072
|
+
var [url, target, features] = argsFactory(args, context, event);
|
|
5073
|
+
window.open(url, target || "_self", features);
|
|
5068
5074
|
};
|
|
5069
5075
|
}
|
|
5070
5076
|
|
|
@@ -5088,7 +5094,7 @@
|
|
|
5088
5094
|
|
|
5089
5095
|
function customListenerFactory(handler, ifContainer, context, runtimeBrick) {
|
|
5090
5096
|
return function (event) {
|
|
5091
|
-
if (!looseCheckIf(ifContainer, _objectSpread__default[
|
|
5097
|
+
if (!looseCheckIf(ifContainer, _objectSpread__default["default"](_objectSpread__default["default"]({}, context), {}, {
|
|
5092
5098
|
event
|
|
5093
5099
|
}))) {
|
|
5094
5100
|
return;
|
|
@@ -5131,7 +5137,7 @@
|
|
|
5131
5137
|
});
|
|
5132
5138
|
});
|
|
5133
5139
|
} else if (isSetPropsCustomHandler(handler)) {
|
|
5134
|
-
setProperties(targets, handler.properties, _objectSpread__default[
|
|
5140
|
+
setProperties(targets, handler.properties, _objectSpread__default["default"](_objectSpread__default["default"]({}, context), {}, {
|
|
5135
5141
|
event
|
|
5136
5142
|
}), handler.injectDeep !== false);
|
|
5137
5143
|
}
|
|
@@ -5143,7 +5149,7 @@
|
|
|
5143
5149
|
}
|
|
5144
5150
|
|
|
5145
5151
|
function _brickCallback() {
|
|
5146
|
-
_brickCallback = _asyncToGenerator__default[
|
|
5152
|
+
_brickCallback = _asyncToGenerator__default["default"](function* (target, handler, method, context, runtimeBrick, event, options) {
|
|
5147
5153
|
var _handler$callback, _poll;
|
|
5148
5154
|
|
|
5149
5155
|
if (typeof target[method] !== "function") {
|
|
@@ -5206,7 +5212,7 @@
|
|
|
5206
5212
|
var poll;
|
|
5207
5213
|
|
|
5208
5214
|
if (isUseProviderHandler(handler)) {
|
|
5209
|
-
poll = computeRealValue(handler.poll, _objectSpread__default[
|
|
5215
|
+
poll = computeRealValue(handler.poll, _objectSpread__default["default"](_objectSpread__default["default"]({}, context), {}, {
|
|
5210
5216
|
event
|
|
5211
5217
|
}), true);
|
|
5212
5218
|
}
|
|
@@ -5230,7 +5236,7 @@
|
|
|
5230
5236
|
|
|
5231
5237
|
function builtinHistoryListenerFactory(method, args, ifContainer, context) {
|
|
5232
5238
|
return function (event) {
|
|
5233
|
-
if (!looseCheckIf(ifContainer, _objectSpread__default[
|
|
5239
|
+
if (!looseCheckIf(ifContainer, _objectSpread__default["default"](_objectSpread__default["default"]({}, context), {}, {
|
|
5234
5240
|
event
|
|
5235
5241
|
}))) {
|
|
5236
5242
|
return;
|
|
@@ -5244,7 +5250,7 @@
|
|
|
5244
5250
|
|
|
5245
5251
|
function builtinHistoryWithoutArgsListenerFactory(method, ifContainer, context) {
|
|
5246
5252
|
return function (event) {
|
|
5247
|
-
if (!looseCheckIf(ifContainer, _objectSpread__default[
|
|
5253
|
+
if (!looseCheckIf(ifContainer, _objectSpread__default["default"](_objectSpread__default["default"]({}, context), {}, {
|
|
5248
5254
|
event
|
|
5249
5255
|
}))) {
|
|
5250
5256
|
return;
|
|
@@ -5256,7 +5262,7 @@
|
|
|
5256
5262
|
|
|
5257
5263
|
function builtinConsoleListenerFactory(method, args, ifContainer, context) {
|
|
5258
5264
|
return function (event) {
|
|
5259
|
-
if (!looseCheckIf(ifContainer, _objectSpread__default[
|
|
5265
|
+
if (!looseCheckIf(ifContainer, _objectSpread__default["default"](_objectSpread__default["default"]({}, context), {}, {
|
|
5260
5266
|
event
|
|
5261
5267
|
}))) {
|
|
5262
5268
|
return;
|
|
@@ -5271,7 +5277,7 @@
|
|
|
5271
5277
|
|
|
5272
5278
|
function builtinMessageListenerFactory(method, args, ifContainer, context) {
|
|
5273
5279
|
return function (event) {
|
|
5274
|
-
if (!looseCheckIf(ifContainer, _objectSpread__default[
|
|
5280
|
+
if (!looseCheckIf(ifContainer, _objectSpread__default["default"](_objectSpread__default["default"]({}, context), {}, {
|
|
5275
5281
|
event
|
|
5276
5282
|
}))) {
|
|
5277
5283
|
return;
|
|
@@ -5283,7 +5289,7 @@
|
|
|
5283
5289
|
|
|
5284
5290
|
function builtinWebStorageListenerFactory(storageType, method, args, ifContainer, context) {
|
|
5285
5291
|
return function (event) {
|
|
5286
|
-
if (!looseCheckIf(ifContainer, _objectSpread__default[
|
|
5292
|
+
if (!looseCheckIf(ifContainer, _objectSpread__default["default"](_objectSpread__default["default"]({}, context), {}, {
|
|
5287
5293
|
event
|
|
5288
5294
|
}))) {
|
|
5289
5295
|
return;
|
|
@@ -5303,16 +5309,16 @@
|
|
|
5303
5309
|
}
|
|
5304
5310
|
|
|
5305
5311
|
function argsFactory(args, context, event, options = {}) {
|
|
5306
|
-
return Array.isArray(args) ? computeRealValue(args, _objectSpread__default[
|
|
5312
|
+
return Array.isArray(args) ? computeRealValue(args, _objectSpread__default["default"](_objectSpread__default["default"]({}, context), {}, {
|
|
5307
5313
|
event
|
|
5308
5314
|
}), true) : options.useEventAsDefault ? [event] : options.useEventDetailAsDefault ? [event.detail] : [];
|
|
5309
5315
|
}
|
|
5310
5316
|
|
|
5311
5317
|
class BrickNode {
|
|
5312
5318
|
constructor(brick) {
|
|
5313
|
-
_defineProperty__default[
|
|
5319
|
+
_defineProperty__default["default"](this, "$$brick", void 0);
|
|
5314
5320
|
|
|
5315
|
-
_defineProperty__default[
|
|
5321
|
+
_defineProperty__default["default"](this, "children", []);
|
|
5316
5322
|
|
|
5317
5323
|
this.$$brick = brick;
|
|
5318
5324
|
}
|
|
@@ -5567,7 +5573,7 @@
|
|
|
5567
5573
|
*/
|
|
5568
5574
|
|
|
5569
5575
|
function getAuth() {
|
|
5570
|
-
return _objectSpread__default[
|
|
5576
|
+
return _objectSpread__default["default"]({}, auth);
|
|
5571
5577
|
}
|
|
5572
5578
|
/** @internal */
|
|
5573
5579
|
|
|
@@ -5607,13 +5613,13 @@
|
|
|
5607
5613
|
var ns = "$tmp-".concat(app.id); // Support any languages in `app.locales`.
|
|
5608
5614
|
|
|
5609
5615
|
Object.entries(app.locales).forEach(([lang, resources]) => {
|
|
5610
|
-
i18next__default[
|
|
5616
|
+
i18next__default["default"].addResourceBundle(lang, ns, resources);
|
|
5611
5617
|
}); // Use `app.name` as the fallback `app.localeName`.
|
|
5612
5618
|
|
|
5613
|
-
app.localeName = i18next__default[
|
|
5619
|
+
app.localeName = i18next__default["default"].getFixedT(null, ns)("name", app.name); // Remove the temporary i18n resource bundles.
|
|
5614
5620
|
|
|
5615
5621
|
Object.keys(app.locales).forEach(lang => {
|
|
5616
|
-
i18next__default[
|
|
5622
|
+
i18next__default["default"].removeResourceBundle(lang, ns);
|
|
5617
5623
|
});
|
|
5618
5624
|
})();
|
|
5619
5625
|
} else {
|
|
@@ -5636,7 +5642,7 @@
|
|
|
5636
5642
|
}
|
|
5637
5643
|
|
|
5638
5644
|
function _CustomApi() {
|
|
5639
|
-
_CustomApi = _asyncToGenerator__default[
|
|
5645
|
+
_CustomApi = _asyncToGenerator__default["default"](function* ({
|
|
5640
5646
|
url,
|
|
5641
5647
|
method = "GET",
|
|
5642
5648
|
responseWrapper = true
|
|
@@ -5644,7 +5650,7 @@
|
|
|
5644
5650
|
var isSimpleRequest = ["get", "delete", "head"].includes(method.toLowerCase());
|
|
5645
5651
|
|
|
5646
5652
|
if (isSimpleRequest) {
|
|
5647
|
-
var response = yield brickHttp.http.simpleRequest(method, url, _objectSpread__default[
|
|
5653
|
+
var response = yield brickHttp.http.simpleRequest(method, url, _objectSpread__default["default"]({
|
|
5648
5654
|
params: data
|
|
5649
5655
|
}, options));
|
|
5650
5656
|
return responseWrapper ? response.data : response;
|
|
@@ -5663,53 +5669,63 @@
|
|
|
5663
5669
|
|
|
5664
5670
|
class Kernel {
|
|
5665
5671
|
constructor() {
|
|
5666
|
-
_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);
|
|
5667
5677
|
|
|
5668
|
-
_defineProperty__default[
|
|
5678
|
+
_defineProperty__default["default"](this, "menuBar", void 0);
|
|
5669
5679
|
|
|
5670
|
-
_defineProperty__default[
|
|
5680
|
+
_defineProperty__default["default"](this, "appBar", void 0);
|
|
5671
5681
|
|
|
5672
|
-
_defineProperty__default[
|
|
5682
|
+
_defineProperty__default["default"](this, "loadingBar", void 0);
|
|
5673
5683
|
|
|
5674
|
-
_defineProperty__default[
|
|
5684
|
+
_defineProperty__default["default"](this, "navBar", void 0);
|
|
5675
5685
|
|
|
5676
|
-
_defineProperty__default[
|
|
5686
|
+
_defineProperty__default["default"](this, "sideBar", void 0);
|
|
5677
5687
|
|
|
5678
|
-
_defineProperty__default[
|
|
5688
|
+
_defineProperty__default["default"](this, "footer", void 0);
|
|
5679
5689
|
|
|
5680
|
-
_defineProperty__default[
|
|
5690
|
+
_defineProperty__default["default"](this, "breadcrumb", void 0);
|
|
5681
5691
|
|
|
5682
|
-
_defineProperty__default[
|
|
5692
|
+
_defineProperty__default["default"](this, "router", void 0);
|
|
5683
5693
|
|
|
5684
|
-
_defineProperty__default[
|
|
5694
|
+
_defineProperty__default["default"](this, "currentApp", void 0);
|
|
5685
5695
|
|
|
5686
|
-
_defineProperty__default[
|
|
5696
|
+
_defineProperty__default["default"](this, "previousApp", void 0);
|
|
5687
5697
|
|
|
5688
|
-
_defineProperty__default[
|
|
5698
|
+
_defineProperty__default["default"](this, "nextApp", void 0);
|
|
5689
5699
|
|
|
5690
|
-
_defineProperty__default[
|
|
5700
|
+
_defineProperty__default["default"](this, "currentUrl", void 0);
|
|
5691
5701
|
|
|
5692
|
-
_defineProperty__default[
|
|
5702
|
+
_defineProperty__default["default"](this, "workspaceStack", []);
|
|
5693
5703
|
|
|
5694
|
-
_defineProperty__default[
|
|
5704
|
+
_defineProperty__default["default"](this, "currentLayout", void 0);
|
|
5695
5705
|
|
|
5696
|
-
_defineProperty__default[
|
|
5706
|
+
_defineProperty__default["default"](this, "enableUiV8", false);
|
|
5697
5707
|
|
|
5698
|
-
_defineProperty__default[
|
|
5708
|
+
_defineProperty__default["default"](this, "allUserMapPromise", Promise.resolve(new Map()));
|
|
5699
5709
|
|
|
5700
|
-
_defineProperty__default[
|
|
5710
|
+
_defineProperty__default["default"](this, "allMagicBrickConfigMapPromise", Promise.resolve(new Map()));
|
|
5701
5711
|
|
|
5702
|
-
_defineProperty__default[
|
|
5712
|
+
_defineProperty__default["default"](this, "nextAppMeta", void 0);
|
|
5703
5713
|
|
|
5704
|
-
_defineProperty__default[
|
|
5714
|
+
_defineProperty__default["default"](this, "allRelatedAppsPromise", Promise.resolve([]));
|
|
5705
5715
|
|
|
5706
|
-
_defineProperty__default[
|
|
5716
|
+
_defineProperty__default["default"](this, "allMicroAppApiOrchestrationPromise", Promise.resolve(new Map()));
|
|
5717
|
+
|
|
5718
|
+
_defineProperty__default["default"](this, "providerRepository", new Map());
|
|
5719
|
+
|
|
5720
|
+
_defineProperty__default["default"](this, "loadUsersStarted", false);
|
|
5721
|
+
|
|
5722
|
+
_defineProperty__default["default"](this, "loadMagicBrickConfigStarted", false);
|
|
5707
5723
|
}
|
|
5708
5724
|
|
|
5709
5725
|
bootstrap(mountPoints) {
|
|
5710
5726
|
var _this = this;
|
|
5711
5727
|
|
|
5712
|
-
return _asyncToGenerator__default[
|
|
5728
|
+
return _asyncToGenerator__default["default"](function* () {
|
|
5713
5729
|
_this.mountPoints = mountPoints;
|
|
5714
5730
|
yield Promise.all([_this.loadCheckLogin(), _this.loadMicroApps()]);
|
|
5715
5731
|
|
|
@@ -5717,13 +5733,20 @@
|
|
|
5717
5733
|
throw new Error("No storyboard were found.");
|
|
5718
5734
|
}
|
|
5719
5735
|
|
|
5736
|
+
_this.setUiVersion();
|
|
5737
|
+
|
|
5720
5738
|
if (isLoggedIn()) {
|
|
5721
5739
|
_this.loadSharedData();
|
|
5722
5740
|
}
|
|
5723
5741
|
|
|
5724
5742
|
_this.menuBar = new MenuBar(_this, "menuBar");
|
|
5725
5743
|
_this.appBar = new AppBar(_this, "appBar");
|
|
5726
|
-
_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");
|
|
5727
5750
|
_this.router = new Router(_this);
|
|
5728
5751
|
yield _this.router.bootstrap();
|
|
5729
5752
|
|
|
@@ -5736,7 +5759,7 @@
|
|
|
5736
5759
|
layoutBootstrap(layout) {
|
|
5737
5760
|
var _this2 = this;
|
|
5738
5761
|
|
|
5739
|
-
return _asyncToGenerator__default[
|
|
5762
|
+
return _asyncToGenerator__default["default"](function* () {
|
|
5740
5763
|
var supportedLayouts = ["console", "business"];
|
|
5741
5764
|
|
|
5742
5765
|
if (!supportedLayouts.includes(layout)) {
|
|
@@ -5748,7 +5771,13 @@
|
|
|
5748
5771
|
loadingBar: "business-website.loading-bar",
|
|
5749
5772
|
pageNotFound: "business-website.page-not-found",
|
|
5750
5773
|
pageError: "business-website.page-error"
|
|
5751
|
-
} : _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), {}, {
|
|
5752
5781
|
pageNotFound: "basic-bricks.page-not-found",
|
|
5753
5782
|
pageError: "basic-bricks.page-error"
|
|
5754
5783
|
});
|
|
@@ -5763,7 +5792,7 @@
|
|
|
5763
5792
|
|
|
5764
5793
|
yield Promise.all([_this2.menuBar.bootstrap(_this2.presetBricks.menuBar, {
|
|
5765
5794
|
testid: "brick-next-menu-bar"
|
|
5766
|
-
}), _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)]);
|
|
5767
5796
|
})();
|
|
5768
5797
|
}
|
|
5769
5798
|
|
|
@@ -5788,7 +5817,7 @@
|
|
|
5788
5817
|
}
|
|
5789
5818
|
|
|
5790
5819
|
loadCheckLogin() {
|
|
5791
|
-
return _asyncToGenerator__default[
|
|
5820
|
+
return _asyncToGenerator__default["default"](function* () {
|
|
5792
5821
|
var auth = yield checkLogin();
|
|
5793
5822
|
|
|
5794
5823
|
if (auth.loggedIn) {
|
|
@@ -5800,8 +5829,8 @@
|
|
|
5800
5829
|
loadMicroApps(params, interceptorParams) {
|
|
5801
5830
|
var _this3 = this;
|
|
5802
5831
|
|
|
5803
|
-
return _asyncToGenerator__default[
|
|
5804
|
-
var d = yield bootstrap(_objectSpread__default[
|
|
5832
|
+
return _asyncToGenerator__default["default"](function* () {
|
|
5833
|
+
var d = yield bootstrap(_objectSpread__default["default"]({
|
|
5805
5834
|
brief: true
|
|
5806
5835
|
}, params), {
|
|
5807
5836
|
interceptorParams
|
|
@@ -5811,7 +5840,7 @@
|
|
|
5811
5840
|
}, d); // Merge `app.defaultConfig` and `app.userConfig` to `app.config`.
|
|
5812
5841
|
|
|
5813
5842
|
processBootstrapResponse(bootstrapResponse);
|
|
5814
|
-
_this3.bootstrapData = _objectSpread__default[
|
|
5843
|
+
_this3.bootstrapData = _objectSpread__default["default"](_objectSpread__default["default"]({}, bootstrapResponse), {}, {
|
|
5815
5844
|
microApps: bootstrapResponse.storyboards.map(storyboard => storyboard.app).filter(Boolean)
|
|
5816
5845
|
});
|
|
5817
5846
|
})();
|
|
@@ -5820,7 +5849,7 @@
|
|
|
5820
5849
|
fulfilStoryboard(storyboard) {
|
|
5821
5850
|
var _this4 = this;
|
|
5822
5851
|
|
|
5823
|
-
return _asyncToGenerator__default[
|
|
5852
|
+
return _asyncToGenerator__default["default"](function* () {
|
|
5824
5853
|
if (storyboard.$$fulfilled) {
|
|
5825
5854
|
return;
|
|
5826
5855
|
}
|
|
@@ -5834,7 +5863,7 @@
|
|
|
5834
5863
|
}
|
|
5835
5864
|
|
|
5836
5865
|
doFulfilStoryboard(storyboard) {
|
|
5837
|
-
return _asyncToGenerator__default[
|
|
5866
|
+
return _asyncToGenerator__default["default"](function* () {
|
|
5838
5867
|
var {
|
|
5839
5868
|
routes,
|
|
5840
5869
|
meta
|
|
@@ -5851,7 +5880,7 @@
|
|
|
5851
5880
|
var i18nNamespace = "$app-".concat(storyboard.app.id); // Support any language in `meta.i18n`.
|
|
5852
5881
|
|
|
5853
5882
|
Object.entries(meta.i18n).forEach(([lang, resources]) => {
|
|
5854
|
-
i18next__default[
|
|
5883
|
+
i18next__default["default"].addResourceBundle(lang, i18nNamespace, resources);
|
|
5855
5884
|
});
|
|
5856
5885
|
}
|
|
5857
5886
|
})();
|
|
@@ -5860,7 +5889,7 @@
|
|
|
5860
5889
|
loadDepsOfStoryboard(storyboard) {
|
|
5861
5890
|
var _this5 = this;
|
|
5862
5891
|
|
|
5863
|
-
return _asyncToGenerator__default[
|
|
5892
|
+
return _asyncToGenerator__default["default"](function* () {
|
|
5864
5893
|
var {
|
|
5865
5894
|
brickPackages,
|
|
5866
5895
|
templatePackages
|
|
@@ -5937,7 +5966,7 @@
|
|
|
5937
5966
|
loadDynamicBricksInBrickConf(brickConf) {
|
|
5938
5967
|
var _this6 = this;
|
|
5939
5968
|
|
|
5940
|
-
return _asyncToGenerator__default[
|
|
5969
|
+
return _asyncToGenerator__default["default"](function* () {
|
|
5941
5970
|
// Notice: `brickConf` contains runtime data,
|
|
5942
5971
|
// which may contains recursive ref,
|
|
5943
5972
|
// which could cause stack overflow while traversing.
|
|
@@ -5950,7 +5979,7 @@
|
|
|
5950
5979
|
loadDynamicBricks(bricks, processors) {
|
|
5951
5980
|
var _this7 = this;
|
|
5952
5981
|
|
|
5953
|
-
return _asyncToGenerator__default[
|
|
5982
|
+
return _asyncToGenerator__default["default"](function* () {
|
|
5954
5983
|
var filteredBricks = bricks.filter( // Only try to load undefined custom elements.
|
|
5955
5984
|
item => !customElements.get(item)); // Try to load deps for dynamic added bricks.
|
|
5956
5985
|
|
|
@@ -5970,7 +5999,7 @@
|
|
|
5970
5999
|
loadEditorBricks(editorBricks) {
|
|
5971
6000
|
var _this8 = this;
|
|
5972
6001
|
|
|
5973
|
-
return _asyncToGenerator__default[
|
|
6002
|
+
return _asyncToGenerator__default["default"](function* () {
|
|
5974
6003
|
var {
|
|
5975
6004
|
dll,
|
|
5976
6005
|
deps
|
|
@@ -6041,7 +6070,7 @@
|
|
|
6041
6070
|
}
|
|
6042
6071
|
|
|
6043
6072
|
loadUsers() {
|
|
6044
|
-
return _asyncToGenerator__default[
|
|
6073
|
+
return _asyncToGenerator__default["default"](function* () {
|
|
6045
6074
|
var allUserMap = new Map();
|
|
6046
6075
|
|
|
6047
6076
|
try {
|
|
@@ -6080,13 +6109,13 @@
|
|
|
6080
6109
|
getMicroAppApiOrchestrationMapAsync() {
|
|
6081
6110
|
var _this9 = this;
|
|
6082
6111
|
|
|
6083
|
-
return _asyncToGenerator__default[
|
|
6112
|
+
return _asyncToGenerator__default["default"](function* () {
|
|
6084
6113
|
return yield _this9.allMicroAppApiOrchestrationPromise;
|
|
6085
6114
|
})();
|
|
6086
6115
|
}
|
|
6087
6116
|
|
|
6088
6117
|
loadMicroAppApiOrchestration(usedCustomApis) {
|
|
6089
|
-
return _asyncToGenerator__default[
|
|
6118
|
+
return _asyncToGenerator__default["default"](function* () {
|
|
6090
6119
|
var allMicroAppApiOrchestrationMap = new Map();
|
|
6091
6120
|
var legacyCustomApis = usedCustomApis.filter(item => !item.name.includes(":"));
|
|
6092
6121
|
|
|
@@ -6128,7 +6157,7 @@
|
|
|
6128
6157
|
}
|
|
6129
6158
|
|
|
6130
6159
|
loadMagicBrickConfig() {
|
|
6131
|
-
return _asyncToGenerator__default[
|
|
6160
|
+
return _asyncToGenerator__default["default"](function* () {
|
|
6132
6161
|
var allMagicBrickConfigMap = new Map();
|
|
6133
6162
|
|
|
6134
6163
|
try {
|
|
@@ -6158,7 +6187,7 @@
|
|
|
6158
6187
|
}
|
|
6159
6188
|
|
|
6160
6189
|
loadRelatedApps() {
|
|
6161
|
-
return _asyncToGenerator__default[
|
|
6190
|
+
return _asyncToGenerator__default["default"](function* () {
|
|
6162
6191
|
var relatedApps = [];
|
|
6163
6192
|
|
|
6164
6193
|
try {
|
|
@@ -6175,7 +6204,7 @@
|
|
|
6175
6204
|
getRelatedAppsAsync(appId) {
|
|
6176
6205
|
var _this10 = this;
|
|
6177
6206
|
|
|
6178
|
-
return _asyncToGenerator__default[
|
|
6207
|
+
return _asyncToGenerator__default["default"](function* () {
|
|
6179
6208
|
if (!appId) {
|
|
6180
6209
|
return [];
|
|
6181
6210
|
}
|
|
@@ -6194,7 +6223,7 @@
|
|
|
6194
6223
|
updateWorkspaceStack() {
|
|
6195
6224
|
var _this11 = this;
|
|
6196
6225
|
|
|
6197
|
-
return _asyncToGenerator__default[
|
|
6226
|
+
return _asyncToGenerator__default["default"](function* () {
|
|
6198
6227
|
if (_this11.currentApp && _this11.currentApp.id) {
|
|
6199
6228
|
var workspace = {
|
|
6200
6229
|
appId: _this11.currentApp.id,
|
|
@@ -6254,7 +6283,7 @@
|
|
|
6254
6283
|
getProviderBrick(provider) {
|
|
6255
6284
|
var _this12 = this;
|
|
6256
6285
|
|
|
6257
|
-
return _asyncToGenerator__default[
|
|
6286
|
+
return _asyncToGenerator__default["default"](function* () {
|
|
6258
6287
|
if (isCustomApiProvider(provider)) {
|
|
6259
6288
|
provider = CUSTOM_API_PROVIDER;
|
|
6260
6289
|
}
|
|
@@ -6281,6 +6310,16 @@
|
|
|
6281
6310
|
})();
|
|
6282
6311
|
}
|
|
6283
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
|
+
|
|
6284
6323
|
} // Since `@next-dll/editor-bricks-helper` depends on `@next-dll/react-dnd`,
|
|
6285
6324
|
// always load react-dnd before loading editor-bricks-helper.
|
|
6286
6325
|
|
|
@@ -6289,7 +6328,7 @@
|
|
|
6289
6328
|
}
|
|
6290
6329
|
|
|
6291
6330
|
function _loadScriptOfDll() {
|
|
6292
|
-
_loadScriptOfDll = _asyncToGenerator__default[
|
|
6331
|
+
_loadScriptOfDll = _asyncToGenerator__default["default"](function* (dlls) {
|
|
6293
6332
|
if (dlls.some(dll => dll.startsWith("dll-of-editor-bricks-helper."))) {
|
|
6294
6333
|
var dllPath = window.DLL_PATH || {};
|
|
6295
6334
|
yield brickUtils.loadScript(dllPath["react-dnd"]);
|
|
@@ -6402,12 +6441,12 @@
|
|
|
6402
6441
|
|
|
6403
6442
|
function getSubRoute(route) {
|
|
6404
6443
|
if (route.type === "routes") {
|
|
6405
|
-
return _objectSpread__default[
|
|
6444
|
+
return _objectSpread__default["default"](_objectSpread__default["default"]({}, route), {}, {
|
|
6406
6445
|
routes: getSubRoutes(route.routes)
|
|
6407
6446
|
});
|
|
6408
6447
|
}
|
|
6409
6448
|
|
|
6410
|
-
return _objectSpread__default[
|
|
6449
|
+
return _objectSpread__default["default"](_objectSpread__default["default"]({}, route), {}, {
|
|
6411
6450
|
bricks: getSubBricks(route.bricks)
|
|
6412
6451
|
});
|
|
6413
6452
|
}
|
|
@@ -6422,16 +6461,16 @@
|
|
|
6422
6461
|
|
|
6423
6462
|
function getSubBrick(brickConf) {
|
|
6424
6463
|
if (brickUtils.isObject(brickConf.slots)) {
|
|
6425
|
-
return _objectSpread__default[
|
|
6464
|
+
return _objectSpread__default["default"](_objectSpread__default["default"]({}, brickConf), {}, {
|
|
6426
6465
|
slots: Object.fromEntries(Object.entries(brickConf.slots).map(([slotId, slotConf]) => {
|
|
6427
6466
|
if (slotConf.type === "routes") {
|
|
6428
|
-
return [slotId, _objectSpread__default[
|
|
6467
|
+
return [slotId, _objectSpread__default["default"](_objectSpread__default["default"]({}, slotConf), {}, {
|
|
6429
6468
|
routes: getSubRoutes(slotConf.routes)
|
|
6430
6469
|
})];
|
|
6431
6470
|
}
|
|
6432
6471
|
/* istanbul ignore else: should never reach */
|
|
6433
6472
|
else if (slotConf.type === "bricks") {
|
|
6434
|
-
return [slotId, _objectSpread__default[
|
|
6473
|
+
return [slotId, _objectSpread__default["default"](_objectSpread__default["default"]({}, slotConf), {}, {
|
|
6435
6474
|
bricks: getSubBricks(slotConf.bricks)
|
|
6436
6475
|
})];
|
|
6437
6476
|
}
|
|
@@ -6446,7 +6485,7 @@
|
|
|
6446
6485
|
return brickConf;
|
|
6447
6486
|
}
|
|
6448
6487
|
|
|
6449
|
-
return _objectSpread__default[
|
|
6488
|
+
return _objectSpread__default["default"](_objectSpread__default["default"]({}, storyboard), {}, {
|
|
6450
6489
|
routes: getSubRoutes(storyboard.routes)
|
|
6451
6490
|
});
|
|
6452
6491
|
}
|
|
@@ -6582,7 +6621,7 @@
|
|
|
6582
6621
|
return proxies.reduce((acc, proxy) => {
|
|
6583
6622
|
switch (proxy.mergeMethod) {
|
|
6584
6623
|
case "extend":
|
|
6585
|
-
return _objectSpread__default[
|
|
6624
|
+
return _objectSpread__default["default"](_objectSpread__default["default"]({}, acc), object[proxy.$$reversedRef]);
|
|
6586
6625
|
// istanbul ignore next: should never reach
|
|
6587
6626
|
|
|
6588
6627
|
default:
|
|
@@ -6636,11 +6675,11 @@
|
|
|
6636
6675
|
properties: templateProperties,
|
|
6637
6676
|
slots: templateSlots
|
|
6638
6677
|
} = brickConf,
|
|
6639
|
-
restBrickConf = _objectWithoutProperties__default[
|
|
6678
|
+
restBrickConf = _objectWithoutProperties__default["default"](brickConf, _excluded$1);
|
|
6640
6679
|
|
|
6641
6680
|
var newBrickConf = restBrickConf; // Get a copy of proxy for each instance of custom template.
|
|
6642
6681
|
|
|
6643
|
-
var proxyCopy = _objectSpread__default[
|
|
6682
|
+
var proxyCopy = _objectSpread__default["default"]({}, proxy);
|
|
6644
6683
|
|
|
6645
6684
|
proxyBrick.proxy = proxyCopy;
|
|
6646
6685
|
proxyBrick.proxyRefs = new Map();
|
|
@@ -6665,8 +6704,8 @@
|
|
|
6665
6704
|
tplVariables[reversedRef] = templateProperties === null || templateProperties === void 0 ? void 0 : templateProperties[reversedRef];
|
|
6666
6705
|
} else {
|
|
6667
6706
|
// Variable property proxies have no refs.
|
|
6668
|
-
refPropertiesCopy[reversedRef] = _objectSpread__default[
|
|
6669
|
-
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
|
|
6670
6709
|
});
|
|
6671
6710
|
}
|
|
6672
6711
|
}
|
|
@@ -6687,7 +6726,7 @@
|
|
|
6687
6726
|
_conf.$$reversedRef = _reversedRef;
|
|
6688
6727
|
|
|
6689
6728
|
if (isMergeableProperty(_conf)) {
|
|
6690
|
-
collectMergeBases(_conf, reversedProxies.mergeBases, _objectSpread__default[
|
|
6729
|
+
collectMergeBases(_conf, reversedProxies.mergeBases, _objectSpread__default["default"](_objectSpread__default["default"]({}, context), {}, {
|
|
6691
6730
|
getTplVariables
|
|
6692
6731
|
}), refToBrickConf);
|
|
6693
6732
|
}
|
|
@@ -6757,7 +6796,7 @@
|
|
|
6757
6796
|
ref,
|
|
6758
6797
|
slots: slotsInTemplate
|
|
6759
6798
|
} = brickConfInTemplate,
|
|
6760
|
-
restBrickConfInTemplate = _objectWithoutProperties__default[
|
|
6799
|
+
restBrickConfInTemplate = _objectWithoutProperties__default["default"](brickConfInTemplate, _excluded2);
|
|
6761
6800
|
|
|
6762
6801
|
var {
|
|
6763
6802
|
reversedProxies,
|
|
@@ -6884,7 +6923,7 @@
|
|
|
6884
6923
|
}
|
|
6885
6924
|
}
|
|
6886
6925
|
|
|
6887
|
-
return _objectSpread__default[
|
|
6926
|
+
return _objectSpread__default["default"](_objectSpread__default["default"]({}, restBrickConfInTemplate), {}, {
|
|
6888
6927
|
slots,
|
|
6889
6928
|
[symbolForComputedPropsFromProxy]: computedPropsFromProxy,
|
|
6890
6929
|
[symbolForRefForProxy]: refForProxy,
|
|
@@ -7110,7 +7149,7 @@
|
|
|
7110
7149
|
return;
|
|
7111
7150
|
}
|
|
7112
7151
|
|
|
7113
|
-
customTemplateRegistry.set(tagName, _objectSpread__default[
|
|
7152
|
+
customTemplateRegistry.set(tagName, _objectSpread__default["default"](_objectSpread__default["default"]({}, tplConstructor), {}, {
|
|
7114
7153
|
name: tagName
|
|
7115
7154
|
})); // Collect defined properties of the template.
|
|
7116
7155
|
|
|
@@ -7148,11 +7187,11 @@
|
|
|
7148
7187
|
|
|
7149
7188
|
class CustomTemplateContext {
|
|
7150
7189
|
constructor() {
|
|
7151
|
-
_defineProperty__default[
|
|
7190
|
+
_defineProperty__default["default"](this, "contextMap", new Map());
|
|
7152
7191
|
|
|
7153
|
-
_defineProperty__default[
|
|
7192
|
+
_defineProperty__default["default"](this, "brickMap", new Map());
|
|
7154
7193
|
|
|
7155
|
-
_defineProperty__default[
|
|
7194
|
+
_defineProperty__default["default"](this, "propsMap", new Map());
|
|
7156
7195
|
}
|
|
7157
7196
|
|
|
7158
7197
|
createContext() {
|
|
@@ -7208,35 +7247,35 @@
|
|
|
7208
7247
|
|
|
7209
7248
|
class LocationContext {
|
|
7210
7249
|
constructor(kernel, location) {
|
|
7211
|
-
_defineProperty__default[
|
|
7250
|
+
_defineProperty__default["default"](this, "query", void 0);
|
|
7212
7251
|
|
|
7213
|
-
_defineProperty__default[
|
|
7252
|
+
_defineProperty__default["default"](this, "resolver", void 0);
|
|
7214
7253
|
|
|
7215
|
-
_defineProperty__default[
|
|
7254
|
+
_defineProperty__default["default"](this, "messageDispatcher", void 0);
|
|
7216
7255
|
|
|
7217
|
-
_defineProperty__default[
|
|
7256
|
+
_defineProperty__default["default"](this, "beforePageLoadHandlers", []);
|
|
7218
7257
|
|
|
7219
|
-
_defineProperty__default[
|
|
7258
|
+
_defineProperty__default["default"](this, "pageLoadHandlers", []);
|
|
7220
7259
|
|
|
7221
|
-
_defineProperty__default[
|
|
7260
|
+
_defineProperty__default["default"](this, "beforePageLeaveHandlers", []);
|
|
7222
7261
|
|
|
7223
|
-
_defineProperty__default[
|
|
7262
|
+
_defineProperty__default["default"](this, "pageLeaveHandlers", []);
|
|
7224
7263
|
|
|
7225
|
-
_defineProperty__default[
|
|
7264
|
+
_defineProperty__default["default"](this, "anchorLoadHandlers", []);
|
|
7226
7265
|
|
|
7227
|
-
_defineProperty__default[
|
|
7266
|
+
_defineProperty__default["default"](this, "anchorUnloadHandlers", []);
|
|
7228
7267
|
|
|
7229
|
-
_defineProperty__default[
|
|
7268
|
+
_defineProperty__default["default"](this, "messageCloseHandlers", []);
|
|
7230
7269
|
|
|
7231
|
-
_defineProperty__default[
|
|
7270
|
+
_defineProperty__default["default"](this, "messageHandlers", []);
|
|
7232
7271
|
|
|
7233
|
-
_defineProperty__default[
|
|
7272
|
+
_defineProperty__default["default"](this, "segues", {});
|
|
7234
7273
|
|
|
7235
|
-
_defineProperty__default[
|
|
7274
|
+
_defineProperty__default["default"](this, "currentMatch", void 0);
|
|
7236
7275
|
|
|
7237
|
-
_defineProperty__default[
|
|
7276
|
+
_defineProperty__default["default"](this, "storyboardContext", new Map());
|
|
7238
7277
|
|
|
7239
|
-
_defineProperty__default[
|
|
7278
|
+
_defineProperty__default["default"](this, "tplContext", new CustomTemplateContext());
|
|
7240
7279
|
|
|
7241
7280
|
this.kernel = kernel;
|
|
7242
7281
|
this.location = location;
|
|
@@ -7258,7 +7297,7 @@
|
|
|
7258
7297
|
match,
|
|
7259
7298
|
app: this.kernel.nextApp,
|
|
7260
7299
|
images: (_this$kernel$nextAppM = this.kernel.nextAppMeta) === null || _this$kernel$nextAppM === void 0 ? void 0 : _this$kernel$nextAppM.images,
|
|
7261
|
-
sys: _objectSpread__default[
|
|
7300
|
+
sys: _objectSpread__default["default"]({
|
|
7262
7301
|
org: auth.org,
|
|
7263
7302
|
username: auth.username,
|
|
7264
7303
|
userInstanceId: auth.userInstanceId,
|
|
@@ -7286,7 +7325,7 @@
|
|
|
7286
7325
|
defineStoryboardFreeContext(contextConfs, coreContext, brick) {
|
|
7287
7326
|
var _this = this;
|
|
7288
7327
|
|
|
7289
|
-
return _asyncToGenerator__default[
|
|
7328
|
+
return _asyncToGenerator__default["default"](function* () {
|
|
7290
7329
|
yield brickUtils.resolveContextConcurrently(contextConfs, contextConf => _this.resolveStoryboardContext(contextConf, coreContext, brick));
|
|
7291
7330
|
})();
|
|
7292
7331
|
}
|
|
@@ -7294,7 +7333,7 @@
|
|
|
7294
7333
|
resolveStoryboardContext(contextConf, coreContext, brick) {
|
|
7295
7334
|
var _this2 = this;
|
|
7296
7335
|
|
|
7297
|
-
return _asyncToGenerator__default[
|
|
7336
|
+
return _asyncToGenerator__default["default"](function* () {
|
|
7298
7337
|
if (contextConf.property) {
|
|
7299
7338
|
if (brick) {
|
|
7300
7339
|
_this2.setStoryboardContext(contextConf.name, {
|
|
@@ -7315,7 +7354,7 @@
|
|
|
7315
7354
|
if (looseCheckIf(contextConf.resolve, coreContext)) {
|
|
7316
7355
|
isResolve = true;
|
|
7317
7356
|
var valueConf = {};
|
|
7318
|
-
yield _this2.resolver.resolveOne("reference", _objectSpread__default[
|
|
7357
|
+
yield _this2.resolver.resolveOne("reference", _objectSpread__default["default"]({
|
|
7319
7358
|
transform: "value",
|
|
7320
7359
|
transformMapArray: false
|
|
7321
7360
|
}, contextConf.resolve), valueConf, null, coreContext);
|
|
@@ -7427,7 +7466,7 @@
|
|
|
7427
7466
|
mountRoutes(routes, slotId, mountRoutesResult) {
|
|
7428
7467
|
var _this3 = this;
|
|
7429
7468
|
|
|
7430
|
-
return _asyncToGenerator__default[
|
|
7469
|
+
return _asyncToGenerator__default["default"](function* () {
|
|
7431
7470
|
var matched = _this3.matchRoutes(routes, _this3.kernel.nextApp);
|
|
7432
7471
|
|
|
7433
7472
|
var redirect;
|
|
@@ -7510,7 +7549,7 @@
|
|
|
7510
7549
|
mountMenu(menuConf, match, mountRoutesResult) {
|
|
7511
7550
|
var _this4 = this;
|
|
7512
7551
|
|
|
7513
|
-
return _asyncToGenerator__default[
|
|
7552
|
+
return _asyncToGenerator__default["default"](function* () {
|
|
7514
7553
|
if (menuConf === false) {
|
|
7515
7554
|
// `route.menu` 设置为 `false` 表示不显示顶栏和侧栏。
|
|
7516
7555
|
mountRoutesResult.flags.barsHidden = true;
|
|
@@ -7552,7 +7591,7 @@
|
|
|
7552
7591
|
var injectDeep = menuConf.injectDeep;
|
|
7553
7592
|
|
|
7554
7593
|
if (menuConf.type === "resolve") {
|
|
7555
|
-
yield _this4.resolver.resolveOne("reference", _objectSpread__default[
|
|
7594
|
+
yield _this4.resolver.resolveOne("reference", _objectSpread__default["default"]({
|
|
7556
7595
|
transformMapArray: false
|
|
7557
7596
|
}, menuConf.resolve), menuConf, null, context);
|
|
7558
7597
|
injectDeep = false;
|
|
@@ -7571,7 +7610,7 @@
|
|
|
7571
7610
|
|
|
7572
7611
|
if (menuId) {
|
|
7573
7612
|
mountRoutesResult.menuBar.menuId = menuId;
|
|
7574
|
-
mountRoutesResult.menuBar.menu =
|
|
7613
|
+
mountRoutesResult.menuBar.menu = sidebarMenu;
|
|
7575
7614
|
} else if (sidebarMenu) {
|
|
7576
7615
|
mountRoutesResult.menuBar.menu = sidebarMenu;
|
|
7577
7616
|
mountRoutesResult.menuBar.menuId = null;
|
|
@@ -7598,10 +7637,10 @@
|
|
|
7598
7637
|
mountProviders(providers, match, slotId, mountRoutesResult) {
|
|
7599
7638
|
var _this5 = this;
|
|
7600
7639
|
|
|
7601
|
-
return _asyncToGenerator__default[
|
|
7640
|
+
return _asyncToGenerator__default["default"](function* () {
|
|
7602
7641
|
if (Array.isArray(providers)) {
|
|
7603
7642
|
for (var providerConf of providers) {
|
|
7604
|
-
yield _this5.mountBrick(_objectSpread__default[
|
|
7643
|
+
yield _this5.mountBrick(_objectSpread__default["default"](_objectSpread__default["default"]({}, typeof providerConf === "string" ? {
|
|
7605
7644
|
brick: providerConf
|
|
7606
7645
|
} : providerConf), {}, {
|
|
7607
7646
|
bg: true,
|
|
@@ -7615,7 +7654,7 @@
|
|
|
7615
7654
|
mountBricks(bricks, match, slotId, mountRoutesResult, tplStack) {
|
|
7616
7655
|
var _this6 = this;
|
|
7617
7656
|
|
|
7618
|
-
return _asyncToGenerator__default[
|
|
7657
|
+
return _asyncToGenerator__default["default"](function* () {
|
|
7619
7658
|
for (var brickConf of bricks) {
|
|
7620
7659
|
try {
|
|
7621
7660
|
yield _this6.mountBrick(brickConf, match, slotId, mountRoutesResult, tplStack === null || tplStack === void 0 ? void 0 : tplStack.slice());
|
|
@@ -7649,7 +7688,7 @@
|
|
|
7649
7688
|
checkResolvableIf(ifContainer, context) {
|
|
7650
7689
|
var _this7 = this;
|
|
7651
7690
|
|
|
7652
|
-
return _asyncToGenerator__default[
|
|
7691
|
+
return _asyncToGenerator__default["default"](function* () {
|
|
7653
7692
|
if (brickUtils.isObject(ifContainer.if)) {
|
|
7654
7693
|
var ifChecked = computeRealValue(ifContainer.if, context, true);
|
|
7655
7694
|
var ifConf = {};
|
|
@@ -7662,7 +7701,7 @@
|
|
|
7662
7701
|
}
|
|
7663
7702
|
|
|
7664
7703
|
preCheckPermissions(container, context) {
|
|
7665
|
-
return _asyncToGenerator__default[
|
|
7704
|
+
return _asyncToGenerator__default["default"](function* () {
|
|
7666
7705
|
if (isLoggedIn() && container.permissionsPreCheck && Array.isArray(container.permissionsPreCheck)) {
|
|
7667
7706
|
var usedActions = computeRealValue(container.permissionsPreCheck, context, true);
|
|
7668
7707
|
yield validatePermissions(usedActions);
|
|
@@ -7673,7 +7712,7 @@
|
|
|
7673
7712
|
mountBrick(brickConf, match, slotId, mountRoutesResult, tplStack = []) {
|
|
7674
7713
|
var _this8 = this;
|
|
7675
7714
|
|
|
7676
|
-
return _asyncToGenerator__default[
|
|
7715
|
+
return _asyncToGenerator__default["default"](function* () {
|
|
7677
7716
|
var _this8$kernel$nextApp;
|
|
7678
7717
|
|
|
7679
7718
|
var tplContextId = brickConf[symbolForTplContextId];
|
|
@@ -7748,7 +7787,7 @@
|
|
|
7748
7787
|
var expandedBrickConf = brickConf;
|
|
7749
7788
|
|
|
7750
7789
|
if (tplTagName) {
|
|
7751
|
-
expandedBrickConf = expandCustomTemplate(_objectSpread__default[
|
|
7790
|
+
expandedBrickConf = expandCustomTemplate(_objectSpread__default["default"](_objectSpread__default["default"]({}, brickConf), {}, {
|
|
7752
7791
|
brick: tplTagName,
|
|
7753
7792
|
// Properties are computed for custom templates.
|
|
7754
7793
|
properties: brick.properties
|
|
@@ -7822,7 +7861,7 @@
|
|
|
7822
7861
|
|
|
7823
7862
|
if (brickUtils.isObject(expandedBrickConf.slots)) {
|
|
7824
7863
|
for (var [_slotId, slotConf] of Object.entries(expandedBrickConf.slots)) {
|
|
7825
|
-
var slottedMountRoutesResult = _objectSpread__default[
|
|
7864
|
+
var slottedMountRoutesResult = _objectSpread__default["default"](_objectSpread__default["default"]({}, mountRoutesResult), {}, {
|
|
7826
7865
|
main: brick.children
|
|
7827
7866
|
});
|
|
7828
7867
|
|
|
@@ -8060,7 +8099,7 @@
|
|
|
8060
8099
|
// },
|
|
8061
8100
|
$refresh: {
|
|
8062
8101
|
value: function () {
|
|
8063
|
-
var _ref = _asyncToGenerator__default[
|
|
8102
|
+
var _ref = _asyncToGenerator__default["default"](function* ({
|
|
8064
8103
|
ignoreErrors,
|
|
8065
8104
|
throwErrors,
|
|
8066
8105
|
$$scheduled
|
|
@@ -8073,7 +8112,7 @@
|
|
|
8073
8112
|
|
|
8074
8113
|
try {
|
|
8075
8114
|
yield Promise.all(this.$$dependents.map( /*#__PURE__*/function () {
|
|
8076
|
-
var _ref2 = _asyncToGenerator__default[
|
|
8115
|
+
var _ref2 = _asyncToGenerator__default["default"](function* ({
|
|
8077
8116
|
brick,
|
|
8078
8117
|
method,
|
|
8079
8118
|
args,
|
|
@@ -8108,7 +8147,7 @@
|
|
|
8108
8147
|
}
|
|
8109
8148
|
|
|
8110
8149
|
function _fetchData() {
|
|
8111
|
-
_fetchData = _asyncToGenerator__default[
|
|
8150
|
+
_fetchData = _asyncToGenerator__default["default"](function* () {
|
|
8112
8151
|
var value = yield promise;
|
|
8113
8152
|
data = field === null || field === undefined ? value : lodash.get(value, field); // The fetched data and its inner objects should never be *injected* again.
|
|
8114
8153
|
|
|
@@ -8168,13 +8207,13 @@
|
|
|
8168
8207
|
|
|
8169
8208
|
class Resolver {
|
|
8170
8209
|
constructor(kernel) {
|
|
8171
|
-
_defineProperty__default[
|
|
8210
|
+
_defineProperty__default["default"](this, "cache", new Map());
|
|
8172
8211
|
|
|
8173
|
-
_defineProperty__default[
|
|
8212
|
+
_defineProperty__default["default"](this, "refreshQueue", new Map());
|
|
8174
8213
|
|
|
8175
|
-
_defineProperty__default[
|
|
8214
|
+
_defineProperty__default["default"](this, "definedResolves", new Map());
|
|
8176
8215
|
|
|
8177
|
-
_defineProperty__default[
|
|
8216
|
+
_defineProperty__default["default"](this, "active", true);
|
|
8178
8217
|
|
|
8179
8218
|
this.kernel = kernel;
|
|
8180
8219
|
}
|
|
@@ -8194,7 +8233,7 @@
|
|
|
8194
8233
|
defineResolves(resolves, context) {
|
|
8195
8234
|
if (Array.isArray(resolves)) {
|
|
8196
8235
|
for (var _resolveConf of resolves) {
|
|
8197
|
-
this.definedResolves.set(_resolveConf.id, _objectSpread__default[
|
|
8236
|
+
this.definedResolves.set(_resolveConf.id, _objectSpread__default["default"](_objectSpread__default["default"]({}, _resolveConf), {}, {
|
|
8198
8237
|
args: computeRealValue(_resolveConf.args, context, true)
|
|
8199
8238
|
}));
|
|
8200
8239
|
}
|
|
@@ -8204,7 +8243,7 @@
|
|
|
8204
8243
|
resolve(brickConf, brick, context) {
|
|
8205
8244
|
var _this = this;
|
|
8206
8245
|
|
|
8207
|
-
return _asyncToGenerator__default[
|
|
8246
|
+
return _asyncToGenerator__default["default"](function* () {
|
|
8208
8247
|
var _brickConf$lifeCycle$, _brickConf$lifeCycle;
|
|
8209
8248
|
|
|
8210
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 => {
|
|
@@ -8225,7 +8264,7 @@
|
|
|
8225
8264
|
resolveOne(type, resolveConf, conf, brick, context) {
|
|
8226
8265
|
var _this2 = this;
|
|
8227
8266
|
|
|
8228
|
-
return _asyncToGenerator__default[
|
|
8267
|
+
return _asyncToGenerator__default["default"](function* () {
|
|
8229
8268
|
var brickConf = conf;
|
|
8230
8269
|
var propsReference = conf;
|
|
8231
8270
|
var actualResolveConf;
|
|
@@ -8276,12 +8315,12 @@
|
|
|
8276
8315
|
makeProviderRefreshable(providerBrick);
|
|
8277
8316
|
|
|
8278
8317
|
if (providerBrick.interval && !_this2.refreshQueue.has(providerBrick)) {
|
|
8279
|
-
_this2.refreshQueue.set(providerBrick, _objectSpread__default[
|
|
8318
|
+
_this2.refreshQueue.set(providerBrick, _objectSpread__default["default"]({}, providerBrick.interval));
|
|
8280
8319
|
} // Currently we can't refresh dynamic templates.
|
|
8281
8320
|
|
|
8282
8321
|
|
|
8283
8322
|
if (type !== "reference" && !brickConf.template) {
|
|
8284
|
-
providerBrick.$$dependents.push(_objectSpread__default[
|
|
8323
|
+
providerBrick.$$dependents.push(_objectSpread__default["default"]({
|
|
8285
8324
|
brick,
|
|
8286
8325
|
method,
|
|
8287
8326
|
args,
|
|
@@ -8348,7 +8387,7 @@
|
|
|
8348
8387
|
}
|
|
8349
8388
|
|
|
8350
8389
|
function _fetchData() {
|
|
8351
|
-
_fetchData = _asyncToGenerator__default[
|
|
8390
|
+
_fetchData = _asyncToGenerator__default["default"](function* () {
|
|
8352
8391
|
var value = yield promise;
|
|
8353
8392
|
data = field === null || field === undefined ? value : lodash.get(value, field); // The fetched data and its inner objects should never be *injected* again.
|
|
8354
8393
|
|
|
@@ -8389,7 +8428,7 @@
|
|
|
8389
8428
|
|
|
8390
8429
|
var _loop = function (providerBrick, interval) {
|
|
8391
8430
|
var request = /*#__PURE__*/function () {
|
|
8392
|
-
var _ref = _asyncToGenerator__default[
|
|
8431
|
+
var _ref = _asyncToGenerator__default["default"](function* () {
|
|
8393
8432
|
yield providerBrick.$refresh({
|
|
8394
8433
|
ignoreErrors: interval.ignoreErrors,
|
|
8395
8434
|
throwErrors: true,
|
|
@@ -8430,7 +8469,7 @@
|
|
|
8430
8469
|
// Pass remaining arguments (including vendor specific ones) to parent constructor
|
|
8431
8470
|
super(rawError.message);
|
|
8432
8471
|
|
|
8433
|
-
_defineProperty__default[
|
|
8472
|
+
_defineProperty__default["default"](this, "rawError", void 0);
|
|
8434
8473
|
|
|
8435
8474
|
this.name = "ResolveRequestError"; // Maintains proper stack trace for where our error was thrown (only available on V8)
|
|
8436
8475
|
// istanbul ignore else
|
|
@@ -8450,21 +8489,21 @@
|
|
|
8450
8489
|
|
|
8451
8490
|
class Router {
|
|
8452
8491
|
constructor(kernel) {
|
|
8453
|
-
_defineProperty__default[
|
|
8492
|
+
_defineProperty__default["default"](this, "defaultCollapsed", false);
|
|
8454
8493
|
|
|
8455
|
-
_defineProperty__default[
|
|
8494
|
+
_defineProperty__default["default"](this, "locationContext", void 0);
|
|
8456
8495
|
|
|
8457
|
-
_defineProperty__default[
|
|
8496
|
+
_defineProperty__default["default"](this, "rendering", false);
|
|
8458
8497
|
|
|
8459
|
-
_defineProperty__default[
|
|
8498
|
+
_defineProperty__default["default"](this, "nextLocation", void 0);
|
|
8460
8499
|
|
|
8461
|
-
_defineProperty__default[
|
|
8500
|
+
_defineProperty__default["default"](this, "prevLocation", void 0);
|
|
8462
8501
|
|
|
8463
|
-
_defineProperty__default[
|
|
8502
|
+
_defineProperty__default["default"](this, "state", "initial");
|
|
8464
8503
|
|
|
8465
|
-
_defineProperty__default[
|
|
8504
|
+
_defineProperty__default["default"](this, "renderId", void 0);
|
|
8466
8505
|
|
|
8467
|
-
_defineProperty__default[
|
|
8506
|
+
_defineProperty__default["default"](this, "featureFlags", void 0);
|
|
8468
8507
|
|
|
8469
8508
|
this.kernel = kernel;
|
|
8470
8509
|
this.featureFlags = this.kernel.getFeatureFlags();
|
|
@@ -8521,14 +8560,14 @@
|
|
|
8521
8560
|
bootstrap() {
|
|
8522
8561
|
var _this = this;
|
|
8523
8562
|
|
|
8524
|
-
return _asyncToGenerator__default[
|
|
8563
|
+
return _asyncToGenerator__default["default"](function* () {
|
|
8525
8564
|
var history = getHistory();
|
|
8526
8565
|
_this.prevLocation = history.location;
|
|
8527
8566
|
|
|
8528
8567
|
_this.locationChangeNotify("", history.location.pathname);
|
|
8529
8568
|
|
|
8530
8569
|
history.listen( /*#__PURE__*/function () {
|
|
8531
|
-
var _ref = _asyncToGenerator__default[
|
|
8570
|
+
var _ref = _asyncToGenerator__default["default"](function* (location, action) {
|
|
8532
8571
|
var _this$prevLocation$st, _location$state;
|
|
8533
8572
|
|
|
8534
8573
|
var ignoreRendering = false;
|
|
@@ -8538,12 +8577,15 @@
|
|
|
8538
8577
|
}; // Omit the "key" when checking whether locations are equal in certain situations.
|
|
8539
8578
|
|
|
8540
8579
|
if ( // When current location is triggered by browser action of hash link.
|
|
8541
|
-
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.
|
|
8542
8584
|
((_this$prevLocation$st = _this.prevLocation.state) === null || _this$prevLocation$st === void 0 ? void 0 : _this$prevLocation$st.notify) === false)) {
|
|
8543
8585
|
omittedLocationProps.key = null;
|
|
8544
8586
|
}
|
|
8545
8587
|
|
|
8546
|
-
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) {
|
|
8547
8589
|
// Ignore rendering if location not changed except hash, state and optional key.
|
|
8548
8590
|
// Ignore rendering if notify is `false`.
|
|
8549
8591
|
ignoreRendering = true;
|
|
@@ -8587,7 +8629,7 @@
|
|
|
8587
8629
|
queuedRender(location) {
|
|
8588
8630
|
var _this2 = this;
|
|
8589
8631
|
|
|
8590
|
-
return _asyncToGenerator__default[
|
|
8632
|
+
return _asyncToGenerator__default["default"](function* () {
|
|
8591
8633
|
_this2.rendering = true;
|
|
8592
8634
|
|
|
8593
8635
|
try {
|
|
@@ -8607,7 +8649,7 @@
|
|
|
8607
8649
|
render(location) {
|
|
8608
8650
|
var _this3 = this;
|
|
8609
8651
|
|
|
8610
|
-
return _asyncToGenerator__default[
|
|
8652
|
+
return _asyncToGenerator__default["default"](function* () {
|
|
8611
8653
|
_this3.state = "initial";
|
|
8612
8654
|
_this3.renderId = lodash.uniqueId("render-id-");
|
|
8613
8655
|
resetAllInjected();
|
|
@@ -8774,30 +8816,33 @@
|
|
|
8774
8816
|
if (barsHidden || getRuntimeMisc().isInIframeOfLegacyConsole) {
|
|
8775
8817
|
_this3.kernel.toggleBars(false);
|
|
8776
8818
|
} else if (_this3.kernel.currentLayout === "console") {
|
|
8777
|
-
|
|
8819
|
+
/* istanbul ignore next */
|
|
8820
|
+
if (!_this3.kernel.enableUiV8) {
|
|
8821
|
+
var _menuBar$menu, _menuBar$menu2;
|
|
8778
8822
|
|
|
8779
|
-
|
|
8823
|
+
yield constructMenu(menuBar, _this3.locationContext.getCurrentContext(), _this3.kernel);
|
|
8780
8824
|
|
|
8781
|
-
|
|
8782
|
-
|
|
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);
|
|
8783
8827
|
|
|
8784
|
-
|
|
8785
|
-
|
|
8786
|
-
|
|
8787
|
-
|
|
8828
|
+
_this3.defaultCollapsed = true;
|
|
8829
|
+
} else {
|
|
8830
|
+
if (_this3.defaultCollapsed) {
|
|
8831
|
+
_this3.kernel.menuBar.collapse(false);
|
|
8832
|
+
}
|
|
8833
|
+
|
|
8834
|
+
_this3.defaultCollapsed = false;
|
|
8788
8835
|
}
|
|
8789
8836
|
|
|
8790
|
-
|
|
8791
|
-
|
|
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
|
+
}
|
|
8792
8842
|
|
|
8793
|
-
|
|
8794
|
-
|
|
8795
|
-
// it will be *popped* from iframe automatically.
|
|
8796
|
-
delete appBar.breadcrumb;
|
|
8843
|
+
mountStaticNode(_this3.kernel.menuBar.element, menuBar);
|
|
8844
|
+
mountStaticNode(_this3.kernel.appBar.element, appBar);
|
|
8797
8845
|
}
|
|
8798
|
-
|
|
8799
|
-
mountStaticNode(_this3.kernel.menuBar.element, menuBar);
|
|
8800
|
-
mountStaticNode(_this3.kernel.appBar.element, appBar);
|
|
8801
8846
|
}
|
|
8802
8847
|
|
|
8803
8848
|
_this3.kernel.toggleLegacyIframe(actualLegacy === "iframe");
|
|
@@ -8974,12 +9019,12 @@
|
|
|
8974
9019
|
/** @internal */
|
|
8975
9020
|
|
|
8976
9021
|
var initI18n = () => {
|
|
8977
|
-
i18next__default[
|
|
8978
|
-
i18next__default[
|
|
9022
|
+
i18next__default["default"].addResourceBundle("en", NS_BRICK_KIT, en);
|
|
9023
|
+
i18next__default["default"].addResourceBundle("zh", NS_BRICK_KIT, zh);
|
|
8979
9024
|
};
|
|
8980
9025
|
|
|
8981
9026
|
// Ref https://reactjs.org/docs/error-boundaries.html
|
|
8982
|
-
class LegacyErrorBoundary extends React__default[
|
|
9027
|
+
class LegacyErrorBoundary extends React__default["default"].Component {
|
|
8983
9028
|
constructor(props) {
|
|
8984
9029
|
super(props);
|
|
8985
9030
|
this.state = {
|
|
@@ -9002,9 +9047,9 @@
|
|
|
9002
9047
|
render() {
|
|
9003
9048
|
if (this.state.error) {
|
|
9004
9049
|
// You can render any custom fallback UI
|
|
9005
|
-
return /*#__PURE__*/React__default[
|
|
9050
|
+
return /*#__PURE__*/React__default["default"].createElement("div", {
|
|
9006
9051
|
"data-testid": "error-boundary"
|
|
9007
|
-
}, /*#__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)));
|
|
9008
9053
|
}
|
|
9009
9054
|
|
|
9010
9055
|
return this.props.children;
|
|
@@ -9166,7 +9211,7 @@
|
|
|
9166
9211
|
}
|
|
9167
9212
|
|
|
9168
9213
|
warnNativeHtmlElementProperty(element.key);
|
|
9169
|
-
return _objectSpread__default[
|
|
9214
|
+
return _objectSpread__default["default"](_objectSpread__default["default"]({}, element), {}, {
|
|
9170
9215
|
finisher(Class) {
|
|
9171
9216
|
Class.createMethod(element.key);
|
|
9172
9217
|
}
|
|
@@ -9199,8 +9244,8 @@
|
|
|
9199
9244
|
/** @internal */
|
|
9200
9245
|
|
|
9201
9246
|
function useRecentApps() {
|
|
9202
|
-
var [recentApps, setRecentApps] = React__default[
|
|
9203
|
-
React__default[
|
|
9247
|
+
var [recentApps, setRecentApps] = React__default["default"].useState(getRuntime().getRecentApps());
|
|
9248
|
+
React__default["default"].useEffect(() => {
|
|
9204
9249
|
var listener = event => {
|
|
9205
9250
|
setRecentApps(event.detail);
|
|
9206
9251
|
};
|
|
@@ -9234,8 +9279,8 @@
|
|
|
9234
9279
|
|
|
9235
9280
|
function useLocation() {
|
|
9236
9281
|
var history = getHistory();
|
|
9237
|
-
var [location, setLocation] = React__default[
|
|
9238
|
-
React__default[
|
|
9282
|
+
var [location, setLocation] = React__default["default"].useState(history.location);
|
|
9283
|
+
React__default["default"].useEffect(() => {
|
|
9239
9284
|
var unlisten = history.listen(location => setLocation(location));
|
|
9240
9285
|
return unlisten;
|
|
9241
9286
|
}, [history]);
|
|
@@ -9296,7 +9341,7 @@
|
|
|
9296
9341
|
|
|
9297
9342
|
var properties = doTransform(data, cloneDeepWithInjectedMark(useBrick.properties) || {}, transformOption);
|
|
9298
9343
|
|
|
9299
|
-
var brick = _objectSpread__default[
|
|
9344
|
+
var brick = _objectSpread__default["default"](_objectSpread__default["default"]({}, useBrick), {}, {
|
|
9300
9345
|
type: useBrick.brick,
|
|
9301
9346
|
// Now transform data in properties too.
|
|
9302
9347
|
properties
|
|
@@ -9343,7 +9388,7 @@
|
|
|
9343
9388
|
};
|
|
9344
9389
|
};
|
|
9345
9390
|
|
|
9346
|
-
var _proxyBrick = _objectSpread__default[
|
|
9391
|
+
var _proxyBrick = _objectSpread__default["default"](_objectSpread__default["default"]({}, tplBrick), {}, {
|
|
9347
9392
|
element: brick.element
|
|
9348
9393
|
});
|
|
9349
9394
|
|
|
@@ -9355,7 +9400,7 @@
|
|
|
9355
9400
|
singleRefBrickProxyMap.set(brick.ref, {
|
|
9356
9401
|
brick: _proxyBrick
|
|
9357
9402
|
});
|
|
9358
|
-
handleProxyOfCustomTemplate(_objectSpread__default[
|
|
9403
|
+
handleProxyOfCustomTemplate(_objectSpread__default["default"](_objectSpread__default["default"]({}, tplBrick), {}, {
|
|
9359
9404
|
proxyRefs: singleRefBrickProxyMap,
|
|
9360
9405
|
proxy: getFilterProxy(tplBrick.proxy, brick.ref)
|
|
9361
9406
|
}));
|
|
@@ -9381,7 +9426,7 @@
|
|
|
9381
9426
|
* @param props - 属性。
|
|
9382
9427
|
*/
|
|
9383
9428
|
|
|
9384
|
-
var SingleBrickAsComponent = /*#__PURE__*/React__default[
|
|
9429
|
+
var SingleBrickAsComponent = /*#__PURE__*/React__default["default"].memo(function SingleBrickAsComponent({
|
|
9385
9430
|
useBrick,
|
|
9386
9431
|
data,
|
|
9387
9432
|
parentRefForUseBrickInPortal,
|
|
@@ -9392,19 +9437,21 @@
|
|
|
9392
9437
|
|
|
9393
9438
|
var template;
|
|
9394
9439
|
var brick;
|
|
9395
|
-
var isBrickAvailable = React__default[
|
|
9440
|
+
var isBrickAvailable = React__default["default"].useMemo(() => {
|
|
9396
9441
|
if (brickUtils.isObject(useBrick.if) && !isPreEvaluated(useBrick.if)) {
|
|
9397
9442
|
// eslint-disable-next-line
|
|
9398
9443
|
console.warn("Currently resolvable-if in `useBrick` is not supported.");
|
|
9399
9444
|
} else if (!looseCheckIfByTransform(useBrick, data, {
|
|
9400
|
-
allowInject: true
|
|
9445
|
+
allowInject: true,
|
|
9446
|
+
// useBrick 中嵌套custom-template的情况下, 会存在丢失getTplVariables的情况, 因此需要在此进行补充
|
|
9447
|
+
getTplVariables: () => tplContext.getContext(useBrick[symbolForTplContextId])
|
|
9401
9448
|
})) {
|
|
9402
9449
|
return false;
|
|
9403
9450
|
}
|
|
9404
9451
|
|
|
9405
9452
|
return true;
|
|
9406
9453
|
}, [useBrick, data]);
|
|
9407
|
-
var runtimeBrick = React__default[
|
|
9454
|
+
var runtimeBrick = React__default["default"].useMemo( /*#__PURE__*/_asyncToGenerator__default["default"](function* () {
|
|
9408
9455
|
if (!isBrickAvailable) {
|
|
9409
9456
|
return null;
|
|
9410
9457
|
} // If the router state is initial, ignore rendering the sub-brick.
|
|
@@ -9442,8 +9489,8 @@
|
|
|
9442
9489
|
|
|
9443
9490
|
return brick;
|
|
9444
9491
|
}), [useBrick, data, isBrickAvailable]);
|
|
9445
|
-
var innerRefCallback = React__default[
|
|
9446
|
-
var _ref2 = _asyncToGenerator__default[
|
|
9492
|
+
var innerRefCallback = React__default["default"].useCallback( /*#__PURE__*/function () {
|
|
9493
|
+
var _ref2 = _asyncToGenerator__default["default"](function* (element) {
|
|
9447
9494
|
immediatelyRefCallback === null || immediatelyRefCallback === void 0 ? void 0 : immediatelyRefCallback(element);
|
|
9448
9495
|
|
|
9449
9496
|
if (element) {
|
|
@@ -9497,24 +9544,24 @@
|
|
|
9497
9544
|
}
|
|
9498
9545
|
|
|
9499
9546
|
if (template) {
|
|
9500
|
-
return /*#__PURE__*/React__default[
|
|
9547
|
+
return /*#__PURE__*/React__default["default"].createElement(template.brick, {
|
|
9501
9548
|
ref: innerRefCallback
|
|
9502
9549
|
}, ...slotsToChildren(template.slots).map((item, index) => {
|
|
9503
|
-
return /*#__PURE__*/React__default[
|
|
9550
|
+
return /*#__PURE__*/React__default["default"].createElement(SingleBrickAsComponent, {
|
|
9504
9551
|
key: index,
|
|
9505
9552
|
useBrick: item,
|
|
9506
9553
|
data: brick.properties
|
|
9507
9554
|
});
|
|
9508
9555
|
}));
|
|
9509
9556
|
} else {
|
|
9510
|
-
return /*#__PURE__*/React__default[
|
|
9557
|
+
return /*#__PURE__*/React__default["default"].createElement(useBrick.brick, {
|
|
9511
9558
|
ref: innerRefCallback
|
|
9512
9559
|
}, ...slotsToChildren(useBrick.slots).map((item, index) => {
|
|
9513
9560
|
if (useBrick[symbolForTplContextId] && !item[symbolForTplContextId]) {
|
|
9514
9561
|
item[symbolForTplContextId] = useBrick[symbolForTplContextId];
|
|
9515
9562
|
}
|
|
9516
9563
|
|
|
9517
|
-
return /*#__PURE__*/React__default[
|
|
9564
|
+
return /*#__PURE__*/React__default["default"].createElement(SingleBrickAsComponent, {
|
|
9518
9565
|
key: index,
|
|
9519
9566
|
useBrick: item,
|
|
9520
9567
|
data: data
|
|
@@ -9548,7 +9595,7 @@
|
|
|
9548
9595
|
parentRefForUseBrickInPortal
|
|
9549
9596
|
}) {
|
|
9550
9597
|
if (Array.isArray(useBrick)) {
|
|
9551
|
-
return /*#__PURE__*/React__default[
|
|
9598
|
+
return /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, useBrick.map((item, index) => /*#__PURE__*/React__default["default"].createElement(SingleBrickAsComponent, {
|
|
9552
9599
|
key: index,
|
|
9553
9600
|
useBrick: item,
|
|
9554
9601
|
data: data,
|
|
@@ -9556,7 +9603,7 @@
|
|
|
9556
9603
|
})));
|
|
9557
9604
|
}
|
|
9558
9605
|
|
|
9559
|
-
return /*#__PURE__*/React__default[
|
|
9606
|
+
return /*#__PURE__*/React__default["default"].createElement(SingleBrickAsComponent, {
|
|
9560
9607
|
useBrick: useBrick,
|
|
9561
9608
|
data: data,
|
|
9562
9609
|
parentRefForUseBrickInPortal: parentRefForUseBrickInPortal
|
|
@@ -9568,8 +9615,8 @@
|
|
|
9568
9615
|
return [];
|
|
9569
9616
|
}
|
|
9570
9617
|
|
|
9571
|
-
return Object.entries(slots).flatMap(([slot, slotConf]) => Array.isArray(slotConf.bricks) ? slotConf.bricks.map(child => _objectSpread__default[
|
|
9572
|
-
properties: _objectSpread__default[
|
|
9618
|
+
return Object.entries(slots).flatMap(([slot, slotConf]) => Array.isArray(slotConf.bricks) ? slotConf.bricks.map(child => _objectSpread__default["default"](_objectSpread__default["default"]({}, child), {}, {
|
|
9619
|
+
properties: _objectSpread__default["default"](_objectSpread__default["default"]({}, child.properties), {}, {
|
|
9573
9620
|
slot
|
|
9574
9621
|
})
|
|
9575
9622
|
})) : []);
|
|
@@ -9586,7 +9633,7 @@
|
|
|
9586
9633
|
// eslint-disable-next-line react/display-name
|
|
9587
9634
|
|
|
9588
9635
|
|
|
9589
|
-
var ForwardRefSingleBrickAsComponent = /*#__PURE__*/React__default[
|
|
9636
|
+
var ForwardRefSingleBrickAsComponent = /*#__PURE__*/React__default["default"].memo( /*#__PURE__*/React.forwardRef(function LegacySingleBrickAsComponent({
|
|
9590
9637
|
useBrick,
|
|
9591
9638
|
data,
|
|
9592
9639
|
parentRefForUseBrickInPortal,
|
|
@@ -9598,7 +9645,7 @@
|
|
|
9598
9645
|
|
|
9599
9646
|
var template;
|
|
9600
9647
|
var brick;
|
|
9601
|
-
var isBrickAvailable = React__default[
|
|
9648
|
+
var isBrickAvailable = React__default["default"].useMemo(() => {
|
|
9602
9649
|
if (brickUtils.isObject(useBrick.if) && !isPreEvaluated(useBrick.if)) {
|
|
9603
9650
|
// eslint-disable-next-line
|
|
9604
9651
|
console.warn("Currently resolvable-if in `useBrick` is not supported.");
|
|
@@ -9615,7 +9662,7 @@
|
|
|
9615
9662
|
React.useImperativeHandle(ref, () => {
|
|
9616
9663
|
return brickRef.current;
|
|
9617
9664
|
});
|
|
9618
|
-
var runtimeBrick = React__default[
|
|
9665
|
+
var runtimeBrick = React__default["default"].useMemo( /*#__PURE__*/_asyncToGenerator__default["default"](function* () {
|
|
9619
9666
|
if (!isBrickAvailable) {
|
|
9620
9667
|
return null;
|
|
9621
9668
|
} // If the router state is initial, ignore rendering the sub-brick.
|
|
@@ -9655,8 +9702,8 @@
|
|
|
9655
9702
|
listenOnTrackingContext(brick, trackingContextList, runtimeContext);
|
|
9656
9703
|
return brick;
|
|
9657
9704
|
}), [useBrick, data, isBrickAvailable]);
|
|
9658
|
-
var innerRefCallback = React__default[
|
|
9659
|
-
var _ref4 = _asyncToGenerator__default[
|
|
9705
|
+
var innerRefCallback = React__default["default"].useCallback( /*#__PURE__*/function () {
|
|
9706
|
+
var _ref4 = _asyncToGenerator__default["default"](function* (element) {
|
|
9660
9707
|
brickRef.current = element;
|
|
9661
9708
|
|
|
9662
9709
|
if (element) {
|
|
@@ -9710,24 +9757,24 @@
|
|
|
9710
9757
|
}
|
|
9711
9758
|
|
|
9712
9759
|
if (template) {
|
|
9713
|
-
return /*#__PURE__*/React__default[
|
|
9760
|
+
return /*#__PURE__*/React__default["default"].createElement(template.brick, {
|
|
9714
9761
|
ref: innerRefCallback
|
|
9715
9762
|
}, ...slotsToChildren(template.slots).map((item, index) => {
|
|
9716
|
-
return /*#__PURE__*/React__default[
|
|
9763
|
+
return /*#__PURE__*/React__default["default"].createElement(SingleBrickAsComponent, {
|
|
9717
9764
|
key: index,
|
|
9718
9765
|
useBrick: item,
|
|
9719
9766
|
data: brick.properties
|
|
9720
9767
|
});
|
|
9721
9768
|
}));
|
|
9722
9769
|
} else {
|
|
9723
|
-
return /*#__PURE__*/React__default[
|
|
9770
|
+
return /*#__PURE__*/React__default["default"].createElement(useBrick.brick, {
|
|
9724
9771
|
ref: innerRefCallback
|
|
9725
9772
|
}, ...slotsToChildren(useBrick.slots).map((item, index) => {
|
|
9726
9773
|
if (useBrick[symbolForTplContextId] && !item[symbolForTplContextId]) {
|
|
9727
9774
|
item[symbolForTplContextId] = useBrick[symbolForTplContextId];
|
|
9728
9775
|
}
|
|
9729
9776
|
|
|
9730
|
-
return /*#__PURE__*/React__default[
|
|
9777
|
+
return /*#__PURE__*/React__default["default"].createElement(SingleBrickAsComponent, {
|
|
9731
9778
|
key: index,
|
|
9732
9779
|
useBrick: item,
|
|
9733
9780
|
data: data
|
|
@@ -9787,7 +9834,7 @@
|
|
|
9787
9834
|
var TimePicker$1 = locale$4;
|
|
9788
9835
|
|
|
9789
9836
|
var locale$3 = {
|
|
9790
|
-
lang: _extends__default[
|
|
9837
|
+
lang: _extends__default["default"]({
|
|
9791
9838
|
placeholder: '请选择日期',
|
|
9792
9839
|
yearPlaceholder: '请选择年份',
|
|
9793
9840
|
quarterPlaceholder: '请选择季度',
|
|
@@ -9798,7 +9845,7 @@
|
|
|
9798
9845
|
rangeMonthPlaceholder: ['开始月份', '结束月份'],
|
|
9799
9846
|
rangeWeekPlaceholder: ['开始周', '结束周']
|
|
9800
9847
|
}, locale$5),
|
|
9801
|
-
timePickerLocale: _extends__default[
|
|
9848
|
+
timePickerLocale: _extends__default["default"]({}, TimePicker$1)
|
|
9802
9849
|
}; // should add whitespace between char in Button
|
|
9803
9850
|
|
|
9804
9851
|
locale$3.lang.ok = '确 定'; // All settings at:
|
|
@@ -9984,7 +10031,7 @@
|
|
|
9984
10031
|
var TimePicker = locale$1;
|
|
9985
10032
|
|
|
9986
10033
|
var locale = {
|
|
9987
|
-
lang: _extends__default[
|
|
10034
|
+
lang: _extends__default["default"]({
|
|
9988
10035
|
placeholder: 'Select date',
|
|
9989
10036
|
yearPlaceholder: 'Select year',
|
|
9990
10037
|
quarterPlaceholder: 'Select quarter',
|
|
@@ -9995,7 +10042,7 @@
|
|
|
9995
10042
|
rangeMonthPlaceholder: ['Start month', 'End month'],
|
|
9996
10043
|
rangeWeekPlaceholder: ['Start week', 'End week']
|
|
9997
10044
|
}, locale$2),
|
|
9998
|
-
timePickerLocale: _extends__default[
|
|
10045
|
+
timePickerLocale: _extends__default["default"]({}, TimePicker)
|
|
9999
10046
|
}; // All settings at:
|
|
10000
10047
|
// https://github.com/ant-design/ant-design/blob/master/components/date-picker/locale/example.json
|
|
10001
10048
|
|
|
@@ -10215,8 +10262,8 @@
|
|
|
10215
10262
|
var background = (_props$background = props.background) !== null && _props$background !== void 0 ? _props$background : "white";
|
|
10216
10263
|
var emptyImage = background === "white" ? SvgEmptyGreyImage : SvgEmptyLightGreyImage;
|
|
10217
10264
|
var illustration = React.useMemo(() => props.illustration && illustrations.getIllustration(props.illustration), [props.illustration]);
|
|
10218
|
-
var image = props.illustration ? illustration : /*#__PURE__*/React__default[
|
|
10219
|
-
return /*#__PURE__*/React__default[
|
|
10265
|
+
var image = props.illustration ? illustration : /*#__PURE__*/React__default["default"].createElement(emptyImage);
|
|
10266
|
+
return /*#__PURE__*/React__default["default"].createElement(antd.Empty, {
|
|
10220
10267
|
image: image,
|
|
10221
10268
|
imageStyle: props.imageStyle,
|
|
10222
10269
|
description: props.description
|
|
@@ -10227,7 +10274,7 @@
|
|
|
10227
10274
|
*/
|
|
10228
10275
|
|
|
10229
10276
|
function renderEasyopsEmpty() {
|
|
10230
|
-
return /*#__PURE__*/React__default[
|
|
10277
|
+
return /*#__PURE__*/React__default["default"].createElement(EasyopsEmpty, null);
|
|
10231
10278
|
}
|
|
10232
10279
|
|
|
10233
10280
|
var FeatureFlagsContext = /*#__PURE__*/React.createContext(null);
|
|
@@ -10297,25 +10344,25 @@
|
|
|
10297
10344
|
|
|
10298
10345
|
function DisplayByFeatureFlags(props) {
|
|
10299
10346
|
var featureFlags = useFeatureFlags(props.name);
|
|
10300
|
-
return featureFlags.every(flag => !!flag) ? /*#__PURE__*/React__default[
|
|
10347
|
+
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;
|
|
10301
10348
|
}
|
|
10302
10349
|
|
|
10303
10350
|
/**
|
|
10304
10351
|
* 构件的 React 组件包装器,包含 ErrorBoundary, ConfigProvider, FeatureFlagsProvider。
|
|
10305
10352
|
*/
|
|
10306
10353
|
function BrickWrapper(props) {
|
|
10307
|
-
var locale = i18next__default[
|
|
10354
|
+
var locale = i18next__default["default"].language && i18next__default["default"].language.split("-")[0] === "en" ? defaultLocale : zhCN; // istanbul ignore next
|
|
10308
10355
|
|
|
10309
10356
|
var featureFlags = process.env.NODE_ENV === "test" ? {} : getRuntime().getFeatureFlags();
|
|
10310
|
-
return /*#__PURE__*/React__default[
|
|
10357
|
+
return /*#__PURE__*/React__default["default"].createElement(ErrorBoundary, null, /*#__PURE__*/React__default["default"].createElement(FeatureFlagsProvider, {
|
|
10311
10358
|
value: featureFlags
|
|
10312
|
-
}, /*#__PURE__*/React__default[
|
|
10359
|
+
}, /*#__PURE__*/React__default["default"].createElement(antd.ConfigProvider, {
|
|
10313
10360
|
locale: locale,
|
|
10314
10361
|
autoInsertSpaceInButton: false,
|
|
10315
10362
|
renderEmpty: () => {
|
|
10316
10363
|
var _props$wrapperConfig;
|
|
10317
10364
|
|
|
10318
|
-
return /*#__PURE__*/React__default[
|
|
10365
|
+
return /*#__PURE__*/React__default["default"].createElement(EasyopsEmpty, (_props$wrapperConfig = props.wrapperConfig) === null || _props$wrapperConfig === void 0 ? void 0 : _props$wrapperConfig.empty);
|
|
10319
10366
|
}
|
|
10320
10367
|
}, props.children)));
|
|
10321
10368
|
}
|
|
@@ -10421,7 +10468,7 @@
|
|
|
10421
10468
|
constructor(...args) {
|
|
10422
10469
|
super(...args);
|
|
10423
10470
|
|
|
10424
|
-
_defineProperty__default[
|
|
10471
|
+
_defineProperty__default["default"](this, "_hasRequestedRender", false);
|
|
10425
10472
|
}
|
|
10426
10473
|
|
|
10427
10474
|
/** @internal */
|
|
@@ -10609,7 +10656,7 @@
|
|
|
10609
10656
|
var {
|
|
10610
10657
|
type
|
|
10611
10658
|
} = options,
|
|
10612
|
-
eventInit = _objectWithoutProperties__default[
|
|
10659
|
+
eventInit = _objectWithoutProperties__default["default"](options, _excluded);
|
|
10613
10660
|
|
|
10614
10661
|
this.__dev_only_definedEvents.add(type); // Make event emitter readonly.
|
|
10615
10662
|
|
|
@@ -10617,7 +10664,7 @@
|
|
|
10617
10664
|
Object.defineProperty(this.prototype, name, {
|
|
10618
10665
|
get() {
|
|
10619
10666
|
return Object.freeze({
|
|
10620
|
-
emit: detail => this.dispatchEvent(new CustomEvent(type, _objectSpread__default[
|
|
10667
|
+
emit: detail => this.dispatchEvent(new CustomEvent(type, _objectSpread__default["default"](_objectSpread__default["default"]({}, eventInit), {}, {
|
|
10621
10668
|
detail
|
|
10622
10669
|
})))
|
|
10623
10670
|
});
|
|
@@ -10632,19 +10679,19 @@
|
|
|
10632
10679
|
|
|
10633
10680
|
}
|
|
10634
10681
|
|
|
10635
|
-
_defineProperty__default[
|
|
10682
|
+
_defineProperty__default["default"](UpdatingElement, "_observedAttributes", new Set());
|
|
10636
10683
|
|
|
10637
|
-
_defineProperty__default[
|
|
10684
|
+
_defineProperty__default["default"](UpdatingElement, "__dev_only_definedProperties", new Set());
|
|
10638
10685
|
|
|
10639
|
-
_defineProperty__default[
|
|
10686
|
+
_defineProperty__default["default"](UpdatingElement, "__dev_only_definedMethods", new Set());
|
|
10640
10687
|
|
|
10641
|
-
_defineProperty__default[
|
|
10688
|
+
_defineProperty__default["default"](UpdatingElement, "__dev_only_definedEvents", new Set());
|
|
10642
10689
|
|
|
10643
10690
|
/**
|
|
10644
10691
|
* 模态框类构件的抽象基类。
|
|
10645
10692
|
*/
|
|
10646
10693
|
|
|
10647
|
-
var ModalElement = _decorate__default[
|
|
10694
|
+
var ModalElement = _decorate__default["default"](null, function (_initialize, _UpdatingElement) {
|
|
10648
10695
|
class ModalElement extends _UpdatingElement {
|
|
10649
10696
|
constructor(...args) {
|
|
10650
10697
|
super(...args);
|
|
@@ -10750,5 +10797,5 @@
|
|
|
10750
10797
|
|
|
10751
10798
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
10752
10799
|
|
|
10753
|
-
}))
|
|
10800
|
+
}));
|
|
10754
10801
|
//# sourceMappingURL=index.bundle.js.map
|