@next-core/brick-kit 2.123.5 → 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
@@ -5,7 +5,7 @@ import _asyncToGenerator$4 from '@babel/runtime/helpers/asyncToGenerator';
5
5
  import _defineProperty$1 from '@babel/runtime/helpers/defineProperty';
6
6
  import React, { useState, useEffect, useRef, forwardRef, useImperativeHandle, useMemo, useContext, createContext, useReducer, useCallback } from 'react';
7
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, pick, orderBy, omit, findLastIndex, noop, isObject as isObject$1, isString } from 'lodash';
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';
9
9
  import { http, HttpResponseError, HttpFetchError } from '@next-core/brick-http';
10
10
  import moment from 'moment';
11
11
  import { pipes } from '@next-core/pipes';
@@ -6974,19 +6974,29 @@ function hasFileType(request) {
6974
6974
  return flag;
6975
6975
  }
6976
6976
  function transformFormData(data) {
6977
+ if (data instanceof FormData) {
6978
+ return data;
6979
+ }
6980
+
6977
6981
  var formData = new FormData();
6978
6982
 
6979
- for (var [key, value] of Object.entries(data)) {
6983
+ var _loop = function (key, value) {
6980
6984
  if (Array.isArray(value)) {
6981
- (function () {
6982
- var k = "".concat(key, "[]");
6983
- value.forEach(v => {
6984
- formData.append(k, v);
6985
- });
6986
- })();
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
+ });
6987
6993
  } else {
6988
6994
  formData.append(key, value);
6989
6995
  }
6996
+ };
6997
+
6998
+ for (var [key, value] of Object.entries(data)) {
6999
+ _loop(key, value);
6990
7000
  }
6991
7001
 
6992
7002
  return formData;
@@ -6996,14 +7006,14 @@ function CustomApi(_x) {
6996
7006
  }
6997
7007
 
6998
7008
  function _CustomApi() {
6999
- _CustomApi = _asyncToGenerator$4(function* (_ref) {
7009
+ _CustomApi = _asyncToGenerator$4(function* (_ref2) {
7000
7010
  var {
7001
7011
  url,
7002
7012
  method = "GET",
7003
7013
  responseWrapper = true,
7004
7014
  ext_fields = [],
7005
7015
  request
7006
- } = _ref;
7016
+ } = _ref2;
7007
7017
  var isSimpleRequest = ["get", "delete", "head"].includes(method.toLowerCase());
7008
7018
  var response;
7009
7019