@next-core/brick-kit 2.118.4 → 2.118.7
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 +57 -244
- package/dist/index.bundle.js +28 -32
- package/dist/index.bundle.js.map +1 -1
- package/dist/index.esm.js +30 -34
- package/dist/index.esm.js.map +1 -1
- package/dist/types/core/MockRegistry.d.ts +1 -1
- package/dist/types/core/MockRegistry.d.ts.map +1 -1
- package/package.json +10 -10
package/dist/index.esm.js
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import { parsePath, createBrowserHistory, locationsAreEqual, createPath } from 'history';
|
|
2
|
-
import _objectSpread from '@babel/runtime/helpers/objectSpread2';
|
|
3
|
-
import _objectWithoutProperties from '@babel/runtime/helpers/objectWithoutProperties';
|
|
4
1
|
import _asyncToGenerator$4 from '@babel/runtime/helpers/asyncToGenerator';
|
|
5
2
|
import _defineProperty$1 from '@babel/runtime/helpers/defineProperty';
|
|
6
|
-
import
|
|
3
|
+
import _objectSpread from '@babel/runtime/helpers/objectSpread2';
|
|
4
|
+
import { Modal, message, Empty, ConfigProvider } from 'antd';
|
|
5
|
+
import { userAnalytics, apiAnalyzer } from '@next-core/easyops-analytics';
|
|
6
|
+
import React, { useState, useEffect, useRef, forwardRef, useImperativeHandle, useMemo, createContext, useContext, useReducer, useCallback } from 'react';
|
|
7
|
+
import { http, HttpResponseError, HttpFetchError } from '@next-core/brick-http';
|
|
8
|
+
import { ExclamationCircleOutlined } from '@ant-design/icons';
|
|
9
|
+
import i18next, { getFixedT } from 'i18next';
|
|
10
|
+
import { parsePath, createBrowserHistory, locationsAreEqual, createPath } from 'history';
|
|
11
|
+
import _objectWithoutProperties from '@babel/runtime/helpers/objectWithoutProperties';
|
|
7
12
|
import { JsonStorage, toPath, computeRealRoutePath, hasOwnProperty, isObject, isEvaluable, transformAndInject, transform, trackContext, trackState, scanPermissionActionsInStoryboard, precookFunction, cook, resolveContextConcurrently, syncResolveContextConcurrently, shouldAllowRecursiveEvaluations, preevaluate, inject, deepFreeze, createProviderClass, loadScript, getTemplateDepsOfStoryboard, getDllAndDepsOfStoryboard, asyncProcessStoryboard, getDllAndDepsByResource, scanRouteAliasInStoryboard, prefetchScript, scanBricksInBrickConf, scanProcessorsInAny, matchPath, scanAppGetMenuInAny, asyncProcessBrick, restoreDynamicTemplates, mapCustomApisToNameAndNamespace, scanCustomApisInStoryboard } from '@next-core/brick-utils';
|
|
8
13
|
import lodash, { set, get, difference, identity, uniqueId, cloneDeep, clamp, isNil, sortBy, merge, pick, orderBy, omit, findLastIndex, noop, isObject as isObject$1, isString } from 'lodash';
|
|
9
|
-
import { http, HttpResponseError, HttpFetchError } from '@next-core/brick-http';
|
|
10
14
|
import moment from 'moment';
|
|
11
15
|
import { pipes } from '@next-core/pipes';
|
|
12
|
-
import i18next, { getFixedT } from 'i18next';
|
|
13
|
-
import { userAnalytics, apiAnalyzer } from '@next-core/easyops-analytics';
|
|
14
|
-
import { Modal, message, Empty, ConfigProvider } from 'antd';
|
|
15
|
-
import { ExclamationCircleOutlined } from '@ant-design/icons';
|
|
16
16
|
import yaml from 'js-yaml';
|
|
17
17
|
import { withTranslation } from 'react-i18next';
|
|
18
18
|
import _extends from '@babel/runtime/helpers/esm/extends';
|
|
@@ -1224,7 +1224,6 @@ var locale$7 = {
|
|
|
1224
1224
|
[K.LOGIN_TIMEOUT_MESSAGE]: "You haven't logged in or your login session has expired. Login right now?",
|
|
1225
1225
|
[K.NETWORK_ERROR]: "Network error, please check your network."
|
|
1226
1226
|
};
|
|
1227
|
-
var en = locale$7;
|
|
1228
1227
|
|
|
1229
1228
|
var locale$6 = {
|
|
1230
1229
|
[K.REQUEST_FAILED]: "请求失败",
|
|
@@ -1234,13 +1233,12 @@ var locale$6 = {
|
|
|
1234
1233
|
[K.LOGIN_TIMEOUT_MESSAGE]: "您还未登录或登录信息已过期,现在重新登录?",
|
|
1235
1234
|
[K.NETWORK_ERROR]: "网络错误,请检查您的网络连接。"
|
|
1236
1235
|
};
|
|
1237
|
-
var zh = locale$6;
|
|
1238
1236
|
|
|
1239
1237
|
/** @internal */
|
|
1240
1238
|
|
|
1241
1239
|
var initI18n = () => {
|
|
1242
|
-
i18next.addResourceBundle("en", NS_BRICK_KIT,
|
|
1243
|
-
i18next.addResourceBundle("zh", NS_BRICK_KIT,
|
|
1240
|
+
i18next.addResourceBundle("en", NS_BRICK_KIT, locale$7);
|
|
1241
|
+
i18next.addResourceBundle("zh", NS_BRICK_KIT, locale$6);
|
|
1244
1242
|
};
|
|
1245
1243
|
/** @internal */
|
|
1246
1244
|
|
|
@@ -5804,8 +5802,16 @@ function registerMock(useMocks) {
|
|
|
5804
5802
|
function getMockList() {
|
|
5805
5803
|
return mocks.mockList;
|
|
5806
5804
|
}
|
|
5807
|
-
var getMockInfo = requestUrl => {
|
|
5808
|
-
var
|
|
5805
|
+
var getMockInfo = (requestUrl, method) => {
|
|
5806
|
+
var transformGetMethod = method => {
|
|
5807
|
+
if (method.toUpperCase() === "LIST") {
|
|
5808
|
+
return "GET";
|
|
5809
|
+
}
|
|
5810
|
+
|
|
5811
|
+
return method === null || method === void 0 ? void 0 : method.toUpperCase();
|
|
5812
|
+
};
|
|
5813
|
+
|
|
5814
|
+
var item = mocks.mockList.find(item => new RegExp(item.uri).test(requestUrl) && transformGetMethod(item.method) === (method === null || method === void 0 ? void 0 : method.toUpperCase()));
|
|
5809
5815
|
|
|
5810
5816
|
if (item) {
|
|
5811
5817
|
return {
|
|
@@ -12030,7 +12036,6 @@ var locale$4 = {
|
|
|
12030
12036
|
placeholder: '请选择时间',
|
|
12031
12037
|
rangePlaceholder: ['开始时间', '结束时间']
|
|
12032
12038
|
};
|
|
12033
|
-
var TimePicker$1 = locale$4;
|
|
12034
12039
|
|
|
12035
12040
|
var locale$3 = {
|
|
12036
12041
|
lang: _extends({
|
|
@@ -12044,22 +12049,19 @@ var locale$3 = {
|
|
|
12044
12049
|
rangeMonthPlaceholder: ['开始月份', '结束月份'],
|
|
12045
12050
|
rangeWeekPlaceholder: ['开始周', '结束周']
|
|
12046
12051
|
}, locale$5),
|
|
12047
|
-
timePickerLocale: _extends({},
|
|
12052
|
+
timePickerLocale: _extends({}, locale$4)
|
|
12048
12053
|
}; // should add whitespace between char in Button
|
|
12049
12054
|
|
|
12050
12055
|
locale$3.lang.ok = '确 定'; // All settings at:
|
|
12051
|
-
// https://github.com/ant-design/ant-design/blob/master/components/date-picker/locale/example.json
|
|
12052
|
-
|
|
12053
|
-
var DatePicker$1 = locale$3;
|
|
12054
12056
|
|
|
12055
12057
|
/* eslint-disable no-template-curly-in-string */
|
|
12056
12058
|
var typeTemplate$1 = '${label}不是一个有效的${type}';
|
|
12057
12059
|
var localeValues$1 = {
|
|
12058
12060
|
locale: 'zh-cn',
|
|
12059
12061
|
Pagination: Pagination$1,
|
|
12060
|
-
DatePicker:
|
|
12061
|
-
TimePicker:
|
|
12062
|
-
Calendar:
|
|
12062
|
+
DatePicker: locale$3,
|
|
12063
|
+
TimePicker: locale$4,
|
|
12064
|
+
Calendar: locale$3,
|
|
12063
12065
|
// locales for all components
|
|
12064
12066
|
global: {
|
|
12065
12067
|
placeholder: '请选择'
|
|
@@ -12176,7 +12178,6 @@ var localeValues$1 = {
|
|
|
12176
12178
|
preview: '预览'
|
|
12177
12179
|
}
|
|
12178
12180
|
};
|
|
12179
|
-
var zhCN = localeValues$1;
|
|
12180
12181
|
|
|
12181
12182
|
var Pagination = {
|
|
12182
12183
|
// Options.jsx
|
|
@@ -12227,7 +12228,6 @@ var locale$1 = {
|
|
|
12227
12228
|
placeholder: 'Select time',
|
|
12228
12229
|
rangePlaceholder: ['Start time', 'End time']
|
|
12229
12230
|
};
|
|
12230
|
-
var TimePicker = locale$1;
|
|
12231
12231
|
|
|
12232
12232
|
var locale = {
|
|
12233
12233
|
lang: _extends({
|
|
@@ -12241,20 +12241,17 @@ var locale = {
|
|
|
12241
12241
|
rangeMonthPlaceholder: ['Start month', 'End month'],
|
|
12242
12242
|
rangeWeekPlaceholder: ['Start week', 'End week']
|
|
12243
12243
|
}, locale$2),
|
|
12244
|
-
timePickerLocale: _extends({},
|
|
12244
|
+
timePickerLocale: _extends({}, locale$1)
|
|
12245
12245
|
}; // All settings at:
|
|
12246
|
-
// https://github.com/ant-design/ant-design/blob/master/components/date-picker/locale/example.json
|
|
12247
|
-
|
|
12248
|
-
var DatePicker = locale;
|
|
12249
12246
|
|
|
12250
12247
|
/* eslint-disable no-template-curly-in-string */
|
|
12251
12248
|
var typeTemplate = '${label} is not a valid ${type}';
|
|
12252
12249
|
var localeValues = {
|
|
12253
12250
|
locale: 'en',
|
|
12254
12251
|
Pagination: Pagination,
|
|
12255
|
-
DatePicker:
|
|
12256
|
-
TimePicker:
|
|
12257
|
-
Calendar:
|
|
12252
|
+
DatePicker: locale,
|
|
12253
|
+
TimePicker: locale$1,
|
|
12254
|
+
Calendar: locale,
|
|
12258
12255
|
global: {
|
|
12259
12256
|
placeholder: 'Please select'
|
|
12260
12257
|
},
|
|
@@ -12372,7 +12369,6 @@ var localeValues = {
|
|
|
12372
12369
|
preview: 'Preview'
|
|
12373
12370
|
}
|
|
12374
12371
|
};
|
|
12375
|
-
var defaultLocale = localeValues;
|
|
12376
12372
|
|
|
12377
12373
|
/* eslint-disable react/jsx-key */
|
|
12378
12374
|
function EmptySvg(props) {
|
|
@@ -13087,7 +13083,7 @@ function DisplayByFeatureFlags(props) {
|
|
|
13087
13083
|
* 构件的 React 组件包装器,包含 ErrorBoundary, ConfigProvider, FeatureFlagsProvider。
|
|
13088
13084
|
*/
|
|
13089
13085
|
function BrickWrapper(props) {
|
|
13090
|
-
var locale = i18next.language && i18next.language.split("-")[0] === "en" ?
|
|
13086
|
+
var locale = i18next.language && i18next.language.split("-")[0] === "en" ? localeValues : localeValues$1; // istanbul ignore next
|
|
13091
13087
|
|
|
13092
13088
|
var featureFlags = process.env.NODE_ENV === "test" ? {} : getRuntime().getFeatureFlags();
|
|
13093
13089
|
return /*#__PURE__*/React.createElement(ErrorBoundary, null, /*#__PURE__*/React.createElement(FeatureFlagsProvider, {
|