@next-core/brick-kit 2.123.3 → 2.123.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.esm.js CHANGED
@@ -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';
1
4
  import _asyncToGenerator$4 from '@babel/runtime/helpers/asyncToGenerator';
2
5
  import _defineProperty$1 from '@babel/runtime/helpers/defineProperty';
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';
6
+ import React, { useState, useEffect, useRef, forwardRef, useImperativeHandle, useMemo, useContext, createContext, useReducer, useCallback } from 'react';
7
+ import { JsonStorage, toPath, computeRealRoutePath, hasOwnProperty, isObject, isEvaluable, transformAndInject, transform, trackContext, trackState, scanPermissionActionsInStoryboard, precookFunction, cook, resolveContextConcurrently, syncResolveContextConcurrently, shouldAllowRecursiveEvaluations, preevaluate, inject, deepFreeze, createProviderClass, getTemplateDepsOfStoryboard, getDllAndDepsOfStoryboard, asyncProcessStoryboard, getDllAndDepsByResource, scanRouteAliasInStoryboard, prefetchScript, scanBricksInBrickConf, scanProcessorsInAny, loadScript, matchPath, scanAppGetMenuInAny, asyncProcessBrick, restoreDynamicTemplates, scanStoryboard, mapCustomApisToNameAndNamespace } from '@next-core/brick-utils';
8
+ import _, { set, get, difference, identity, uniqueId, cloneDeep, clamp, isNil, sortBy, merge, isEmpty, isObject as isObject$1, pick, orderBy, omit, findLastIndex, noop, isString } from 'lodash';
7
9
  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';
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, scanStoryboard, mapCustomApisToNameAndNamespace } from '@next-core/brick-utils';
13
- import _, { set, get, difference, identity, uniqueId, cloneDeep, clamp, isNil, sortBy, merge, isEmpty, pick, orderBy, omit, findLastIndex, noop, isObject as isObject$1, isString } from 'lodash';
14
10
  import moment from 'moment';
15
11
  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';
@@ -1209,6 +1209,7 @@ var locale$7 = {
1209
1209
  [K.LOGIN_TIMEOUT_MESSAGE]: "You haven't logged in or your login session has expired. Login right now?",
1210
1210
  [K.NETWORK_ERROR]: "Network error, please check your network."
1211
1211
  };
1212
+ var en = locale$7;
1212
1213
 
1213
1214
  var locale$6 = {
1214
1215
  [K.REQUEST_FAILED]: "请求失败",
@@ -1218,12 +1219,13 @@ var locale$6 = {
1218
1219
  [K.LOGIN_TIMEOUT_MESSAGE]: "您还未登录或登录信息已过期,现在重新登录?",
1219
1220
  [K.NETWORK_ERROR]: "网络错误,请检查您的网络连接。"
1220
1221
  };
1222
+ var zh = locale$6;
1221
1223
 
1222
1224
  /** @internal */
1223
1225
 
1224
1226
  var initI18n = () => {
1225
- i18next.addResourceBundle("en", NS_BRICK_KIT, locale$7);
1226
- i18next.addResourceBundle("zh", NS_BRICK_KIT, locale$6);
1227
+ i18next.addResourceBundle("en", NS_BRICK_KIT, en);
1228
+ i18next.addResourceBundle("zh", NS_BRICK_KIT, zh);
1227
1229
  };
1228
1230
  /** @internal */
1229
1231
 
@@ -6972,19 +6974,29 @@ function hasFileType(request) {
6972
6974
  return flag;
6973
6975
  }
6974
6976
  function transformFormData(data) {
6977
+ if (data instanceof FormData) {
6978
+ return data;
6979
+ }
6980
+
6975
6981
  var formData = new FormData();
6976
6982
 
6977
- for (var [key, value] of Object.entries(data)) {
6983
+ var _loop = function (key, value) {
6978
6984
  if (Array.isArray(value)) {
6979
- (function () {
6980
- var k = "".concat(key, "[]");
6981
- value.forEach(v => {
6982
- formData.append(k, v);
6983
- });
6984
- })();
6985
+ value.forEach(v => {
6986
+ formData.append(key, v);
6987
+ });
6988
+ } else if (isObject$1(value) && !(value instanceof Blob) && !(value instanceof Date)) {
6989
+ Object.entries(value).forEach(_ref => {
6990
+ var [k, v] = _ref;
6991
+ formData.append("".concat(key, "[").concat(k, "]"), v);
6992
+ });
6985
6993
  } else {
6986
6994
  formData.append(key, value);
6987
6995
  }
6996
+ };
6997
+
6998
+ for (var [key, value] of Object.entries(data)) {
6999
+ _loop(key, value);
6988
7000
  }
6989
7001
 
6990
7002
  return formData;
@@ -6994,14 +7006,14 @@ function CustomApi(_x) {
6994
7006
  }
6995
7007
 
6996
7008
  function _CustomApi() {
6997
- _CustomApi = _asyncToGenerator$4(function* (_ref) {
7009
+ _CustomApi = _asyncToGenerator$4(function* (_ref2) {
6998
7010
  var {
6999
7011
  url,
7000
7012
  method = "GET",
7001
7013
  responseWrapper = true,
7002
7014
  ext_fields = [],
7003
7015
  request
7004
- } = _ref;
7016
+ } = _ref2;
7005
7017
  var isSimpleRequest = ["get", "delete", "head"].includes(method.toLowerCase());
7006
7018
  var response;
7007
7019
 
@@ -7887,19 +7899,6 @@ Object.keys(presetPrimaryColors).forEach(function (key) {
7887
7899
  });
7888
7900
  presetDarkPalettes[key].primary = presetDarkPalettes[key][5];
7889
7901
  });
7890
- presetPalettes.red;
7891
- presetPalettes.volcano;
7892
- presetPalettes.gold;
7893
- presetPalettes.orange;
7894
- presetPalettes.yellow;
7895
- presetPalettes.lime;
7896
- presetPalettes.green;
7897
- presetPalettes.cyan;
7898
- presetPalettes.blue;
7899
- presetPalettes.geekblue;
7900
- presetPalettes.purple;
7901
- presetPalettes.magenta;
7902
- presetPalettes.grey;
7903
7902
 
7904
7903
  function getStyleByBaseColors(theme, baseColors, backgroundColor) {
7905
7904
  return (theme === "dark" ? getDarkStyle : getLightStyle)("".concat(getCssVariableDefinitionsByPalettes(generatePalettes(baseColors, theme, backgroundColor), theme), "\n").concat(getMigratedCssVariableDefinitions(theme, baseColors, backgroundColor)));