@lingxiteam/assets 3.2.1 → 3.3.1-alpha.10

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.
Files changed (73) hide show
  1. package/es/error/errorDisplay/Mobile/Drawer/Drawer.js +9 -3
  2. package/es/error/errorDisplay/Mobile/ErrorMsg/index.js +29 -26
  3. package/es/error/errorDisplay/Mobile/Modal/Modal.js +5 -3
  4. package/es/error/errorDisplay/Mobile/defaultGlobalConfig.js +9 -1
  5. package/es/error/errorDisplay/Web/Drawer/Drawer.js +10 -4
  6. package/es/error/errorDisplay/Web/ErrorMsg/index.js +67 -48
  7. package/es/error/errorDisplay/Web/Notification/Notification.less +21 -3
  8. package/es/error/errorDisplay/Web/defaultGlobalConfig.js +11 -3
  9. package/es/error/errorDisplay/const.js +29 -7
  10. package/es/rootConfig/mobile/MobileModal.d.ts +33 -0
  11. package/es/rootConfig/mobile/MobileModal.js +49 -4
  12. package/es/rootConfig/mobile/MobilePopover.d.ts +3 -0
  13. package/es/rootConfig/mobile/MobilePopover.js +4 -1
  14. package/es/rootConfig/mobile/page.d.ts +13 -0
  15. package/es/rootConfig/mobile/page.js +15 -2
  16. package/es/rootConfig/pc/Drawer.d.ts +9 -0
  17. package/es/rootConfig/pc/Drawer.js +10 -1
  18. package/es/rootConfig/pc/Modal.d.ts +3 -0
  19. package/es/rootConfig/pc/Modal.js +4 -1
  20. package/es/rootConfig/pc/Popover.d.ts +3 -0
  21. package/es/rootConfig/pc/Popover.js +4 -1
  22. package/es/rootConfig/pc/page.d.ts +3 -18
  23. package/es/rootConfig/pc/page.js +4 -14
  24. package/es/rootConfig/todoActionList.d.ts +429 -65
  25. package/es/rootConfig/todoActionList.js +563 -143
  26. package/es/rootConfig/todoOptionList.d.ts +13 -2
  27. package/es/rootConfig/todoOptionList.js +16 -7
  28. package/es/security/encipher/sign.js +4 -3
  29. package/es/security/fetch.js +7 -0
  30. package/es/theme/bin/default/theme.js +1 -1
  31. package/es/theme/bin/default/theme.less +1 -1
  32. package/es/theme/bin/default/theme.scss +1 -1
  33. package/es/theme/index.js +77 -0
  34. package/es/theme/src/default/index.js +1 -1
  35. package/es/utils/url.d.ts +1 -0
  36. package/es/utils/url.js +5 -0
  37. package/lib/error/errorDisplay/Mobile/Drawer/Drawer.js +9 -3
  38. package/lib/error/errorDisplay/Mobile/ErrorMsg/index.js +29 -26
  39. package/lib/error/errorDisplay/Mobile/Modal/Modal.js +5 -3
  40. package/lib/error/errorDisplay/Mobile/defaultGlobalConfig.js +9 -1
  41. package/lib/error/errorDisplay/Web/Drawer/Drawer.js +10 -4
  42. package/lib/error/errorDisplay/Web/ErrorMsg/index.js +67 -48
  43. package/lib/error/errorDisplay/Web/Notification/Notification.less +21 -3
  44. package/lib/error/errorDisplay/Web/defaultGlobalConfig.js +11 -2
  45. package/lib/error/errorDisplay/const.js +33 -9
  46. package/lib/rootConfig/mobile/MobileModal.d.ts +33 -0
  47. package/lib/rootConfig/mobile/MobileModal.js +49 -4
  48. package/lib/rootConfig/mobile/MobilePopover.d.ts +3 -0
  49. package/lib/rootConfig/mobile/MobilePopover.js +4 -1
  50. package/lib/rootConfig/mobile/page.d.ts +13 -0
  51. package/lib/rootConfig/mobile/page.js +15 -2
  52. package/lib/rootConfig/pc/Drawer.d.ts +9 -0
  53. package/lib/rootConfig/pc/Drawer.js +10 -1
  54. package/lib/rootConfig/pc/Modal.d.ts +3 -0
  55. package/lib/rootConfig/pc/Modal.js +4 -1
  56. package/lib/rootConfig/pc/Popover.d.ts +3 -0
  57. package/lib/rootConfig/pc/Popover.js +4 -1
  58. package/lib/rootConfig/pc/page.d.ts +3 -18
  59. package/lib/rootConfig/pc/page.js +4 -14
  60. package/lib/rootConfig/todoActionList.d.ts +429 -65
  61. package/lib/rootConfig/todoActionList.js +563 -143
  62. package/lib/rootConfig/todoOptionList.d.ts +13 -2
  63. package/lib/rootConfig/todoOptionList.js +16 -7
  64. package/lib/security/encipher/sign.js +3 -2
  65. package/lib/security/fetch.js +7 -0
  66. package/lib/theme/bin/default/theme.js +1 -1
  67. package/lib/theme/bin/default/theme.less +1 -1
  68. package/lib/theme/bin/default/theme.scss +1 -1
  69. package/lib/theme/index.js +84 -0
  70. package/lib/theme/src/default/index.js +1 -1
  71. package/lib/utils/url.d.ts +1 -0
  72. package/lib/utils/url.js +7 -1
  73. package/package.json +4 -3
@@ -953,9 +953,20 @@ declare const todoOptionList: {
953
953
  isRequired: boolean;
954
954
  valuePropName: string;
955
955
  options: {
956
- fileUpload: boolean;
957
956
  refreshKey: string[];
958
- serviceTabs: string[];
957
+ serviceTabs: ({
958
+ key: string;
959
+ description: string;
960
+ filterParams: {
961
+ fileInputEnabled: string;
962
+ };
963
+ fileUpload?: undefined;
964
+ } | {
965
+ key: string;
966
+ fileUpload: boolean;
967
+ description: string;
968
+ filterParams?: undefined;
969
+ })[];
959
970
  };
960
971
  };
961
972
  };
@@ -596,7 +596,7 @@ var todoOptionList = {
596
596
  inlineeditrow: {
597
597
  key: 'inlineeditrow',
598
598
  label: '指定行id',
599
- type: 'SelectParams'
599
+ type: 'SetExpression'
600
600
  },
601
601
  stateval: {
602
602
  key: 'stateval',
@@ -779,7 +779,7 @@ var todoOptionList = {
779
779
  flowWorkOrderId: {
780
780
  key: 'workOrderId',
781
781
  label: '业务工单 ID',
782
- type: 'SelectParams'
782
+ type: 'SetExpression'
783
783
  },
784
784
  // 这里三个字段没设置type。经协商(gy)为无用类型,先注释
785
785
  // 流程页面按钮动作服务响应数据
@@ -1028,13 +1028,13 @@ var todoOptionList = {
1028
1028
  busiObjectFilterParams: {
1029
1029
  key: 'busiObjectFilterParams',
1030
1030
  label: '查询条件',
1031
- type: 'SelectParams'
1031
+ type: 'SetExpression'
1032
1032
  },
1033
1033
  filterParams: {
1034
1034
  // 入参
1035
1035
  key: 'filterParams',
1036
1036
  label: '查询条件',
1037
- type: 'SelectParams'
1037
+ type: 'SetExpression'
1038
1038
  },
1039
1039
  busiObjectFields: {
1040
1040
  key: 'busiObjectFields',
@@ -1133,9 +1133,18 @@ var todoOptionList = {
1133
1133
  isRequired: true,
1134
1134
  valuePropName: 'custUrl',
1135
1135
  options: {
1136
- fileUpload: true,
1137
1136
  refreshKey: ['objectFields'],
1138
- serviceTabs: [SERVICE_KEY.STD, SERVICE_KEY.INNER]
1137
+ serviceTabs: [{
1138
+ key: SERVICE_KEY.STD,
1139
+ description: '此处仅展示开启文件入参的编排服务,服务入参需包含impFile(文件类型)字段用于接收文件和param(对象类型,非必须)字段接收自定义参数',
1140
+ filterParams: {
1141
+ fileInputEnabled: 'T'
1142
+ }
1143
+ }, {
1144
+ key: SERVICE_KEY.INNER,
1145
+ fileUpload: true,
1146
+ description: '此处仅展示开启上传控件中使用的请求层服务,服务入参需包含impFile(文件类型)字段用于接收文件和param(对象类型,非必须)字段接收自定义参数'
1147
+ }]
1139
1148
  }
1140
1149
  }
1141
1150
  },
@@ -1429,7 +1438,7 @@ var todoOptionList = {
1429
1438
  // 入参
1430
1439
  key: 'filterParams',
1431
1440
  label: '查询条件',
1432
- type: 'SelectParams'
1441
+ type: 'SetExpression'
1433
1442
  }, {
1434
1443
  key: 'objectFields',
1435
1444
  label: '导出字段',
@@ -37,7 +37,7 @@ var SIGN_KEY = process.env.LING_XI_HTTP_SIGN_KEY || 'zrT5bi2escXilaH1fs653uZiH9R
37
37
  // 由于X-B 的规则可能被业务网关使用,并往请求头增加内容,导致前后端加密不一致
38
38
  // 2022.08.09 使用以下3个固定值 + X-LX-*匹配 方式
39
39
  var hKeys = ['X-B-AUTH', 'X-B-TARGET-ID', 'APP-ID'];
40
- var userKeyInCookie = process.env.LING_XI_USER_KEY_IN_COOKIE || 'X-LX-N-ID';
40
+ var userKeyInCookie = window.lxDataSaltCode || process.env.LING_XI_USER_KEY_IN_COOKIE || 'X-LX-N-ID';
41
41
  // 配置指定接口前缀,2023-03-16规则调整,不需要使用
42
42
  // const apiPrefix =
43
43
  // process.env.LING_XI_HTTP_SIGN_API_PERFIX ||
@@ -82,7 +82,8 @@ var createHttpSignStr = function createHttpSignStr(url, options) {
82
82
  // 获取参数3: 请求参数
83
83
  var params = '';
84
84
  if (method.toLowerCase() === 'get') {
85
- params = urlSearch;
85
+ // 为保证与后端值一致此处需要将数据进行解码
86
+ params = (0, _url.decodeQueryString)(urlSearch);
86
87
  } else {
87
88
  params = _typeof(body) === 'object' ? JSON.stringify(body) : body;
88
89
  }
@@ -116,11 +116,18 @@ function encrypted(url, opts, type) {
116
116
  // });
117
117
  // }
118
118
  var fetch = function fetch(url) {
119
+ var _opts$headers;
119
120
  var fetchOptions = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
120
121
  var config = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
121
122
  var opts = _objectSpread({}, fetchOptions);
122
123
  var optSecurityHeaderKey = (opts.headers || {})[_const.securityHeaderKey];
123
124
  var isDebug = (config === null || config === void 0 ? void 0 : config.debug) || window.lxDebug || !!window.localStorage.getItem('lxDebug') || true;
125
+ // 如果在headers 传入disabledSignKey标识 标识不启用加密
126
+ if ((opts === null || opts === void 0 ? void 0 : (_opts$headers = opts.headers) === null || _opts$headers === void 0 ? void 0 : _opts$headers.disabledSignKey) === true) {
127
+ var _opts$headers2;
128
+ opts === null || opts === void 0 ? true : (_opts$headers2 = opts.headers) === null || _opts$headers2 === void 0 ? true : delete _opts$headers2.disabledSignKey;
129
+ return originFetch(url, opts);
130
+ }
124
131
  // ------ 参数签名(默认) ------
125
132
  if (
126
133
  // 配置开启加密
@@ -317,7 +317,7 @@ var theme = {
317
317
  'margin-xs': '8px',
318
318
  'margin-xxs': '4px',
319
319
  'margin-xxxs': '2px',
320
- 'page-space': '0 40px 16px 40px',
320
+ 'page-space': '0px',
321
321
  'box-padding-base': '20px',
322
322
  'box-padding-sm': '12px',
323
323
  'size-xs': '16px',
@@ -314,7 +314,7 @@
314
314
  @margin-xs: 8px;
315
315
  @margin-xxs: 4px;
316
316
  @margin-xxxs: 2px;
317
- @page-space: 0 40px 16px 40px;
317
+ @page-space: 0px;
318
318
  @box-padding-base: 20px;
319
319
  @box-padding-sm: 12px;
320
320
  @size-xs: 16px;
@@ -314,7 +314,7 @@ $margin-sm: 12px;
314
314
  $margin-xs: 8px;
315
315
  $margin-xxs: 4px;
316
316
  $margin-xxxs: 2px;
317
- $page-space: 0 40px 16px 40px;
317
+ $page-space: 0px;
318
318
  $box-padding-base: 20px;
319
319
  $box-padding-sm: 12px;
320
320
  $size-xs: 16px;
@@ -0,0 +1,84 @@
1
+ "use strict";
2
+
3
+ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
4
+ Object.defineProperty(exports, "__esModule", {
5
+ value: true
6
+ });
7
+ exports.default = void 0;
8
+ function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return exports; }; var exports = {}, Op = Object.prototype, hasOwn = Op.hasOwnProperty, defineProperty = Object.defineProperty || function (obj, key, desc) { obj[key] = desc.value; }, $Symbol = "function" == typeof Symbol ? Symbol : {}, iteratorSymbol = $Symbol.iterator || "@@iterator", asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator", toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag"; function define(obj, key, value) { return Object.defineProperty(obj, key, { value: value, enumerable: !0, configurable: !0, writable: !0 }), obj[key]; } try { define({}, ""); } catch (err) { define = function define(obj, key, value) { return obj[key] = value; }; } function wrap(innerFn, outerFn, self, tryLocsList) { var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator, generator = Object.create(protoGenerator.prototype), context = new Context(tryLocsList || []); return defineProperty(generator, "_invoke", { value: makeInvokeMethod(innerFn, self, context) }), generator; } function tryCatch(fn, obj, arg) { try { return { type: "normal", arg: fn.call(obj, arg) }; } catch (err) { return { type: "throw", arg: err }; } } exports.wrap = wrap; var ContinueSentinel = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var IteratorPrototype = {}; define(IteratorPrototype, iteratorSymbol, function () { return this; }); var getProto = Object.getPrototypeOf, NativeIteratorPrototype = getProto && getProto(getProto(values([]))); NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype); var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype); function defineIteratorMethods(prototype) { ["next", "throw", "return"].forEach(function (method) { define(prototype, method, function (arg) { return this._invoke(method, arg); }); }); } function AsyncIterator(generator, PromiseImpl) { function invoke(method, arg, resolve, reject) { var record = tryCatch(generator[method], generator, arg); if ("throw" !== record.type) { var result = record.arg, value = result.value; return value && "object" == _typeof(value) && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) { invoke("next", value, resolve, reject); }, function (err) { invoke("throw", err, resolve, reject); }) : PromiseImpl.resolve(value).then(function (unwrapped) { result.value = unwrapped, resolve(result); }, function (error) { return invoke("throw", error, resolve, reject); }); } reject(record.arg); } var previousPromise; defineProperty(this, "_invoke", { value: function value(method, arg) { function callInvokeWithMethodAndArg() { return new PromiseImpl(function (resolve, reject) { invoke(method, arg, resolve, reject); }); } return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(innerFn, self, context) { var state = "suspendedStart"; return function (method, arg) { if ("executing" === state) throw new Error("Generator is already running"); if ("completed" === state) { if ("throw" === method) throw arg; return doneResult(); } for (context.method = method, context.arg = arg;;) { var delegate = context.delegate; if (delegate) { var delegateResult = maybeInvokeDelegate(delegate, context); if (delegateResult) { if (delegateResult === ContinueSentinel) continue; return delegateResult; } } if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) { if ("suspendedStart" === state) throw state = "completed", context.arg; context.dispatchException(context.arg); } else "return" === context.method && context.abrupt("return", context.arg); state = "executing"; var record = tryCatch(innerFn, self, context); if ("normal" === record.type) { if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue; return { value: record.arg, done: context.done }; } "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg); } }; } function maybeInvokeDelegate(delegate, context) { var methodName = context.method, method = delegate.iterator[methodName]; if (undefined === method) return context.delegate = null, "throw" === methodName && delegate.iterator.return && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method) || "return" !== methodName && (context.method = "throw", context.arg = new TypeError("The iterator does not provide a '" + methodName + "' method")), ContinueSentinel; var record = tryCatch(method, delegate.iterator, context.arg); if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel; var info = record.arg; return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel); } function pushTryEntry(locs) { var entry = { tryLoc: locs[0] }; 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry); } function resetTryEntry(entry) { var record = entry.completion || {}; record.type = "normal", delete record.arg, entry.completion = record; } function Context(tryLocsList) { this.tryEntries = [{ tryLoc: "root" }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0); } function values(iterable) { if (iterable) { var iteratorMethod = iterable[iteratorSymbol]; if (iteratorMethod) return iteratorMethod.call(iterable); if ("function" == typeof iterable.next) return iterable; if (!isNaN(iterable.length)) { var i = -1, next = function next() { for (; ++i < iterable.length;) { if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next; } return next.value = undefined, next.done = !0, next; }; return next.next = next; } } return { next: doneResult }; } function doneResult() { return { value: undefined, done: !0 }; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, defineProperty(Gp, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), defineProperty(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) { var ctor = "function" == typeof genFun && genFun.constructor; return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name)); }, exports.mark = function (genFun) { return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun; }, exports.awrap = function (arg) { return { __await: arg }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () { return this; }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) { void 0 === PromiseImpl && (PromiseImpl = Promise); var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl); return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) { return result.done ? result.value : iter.next(); }); }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () { return this; }), define(Gp, "toString", function () { return "[object Generator]"; }), exports.keys = function (val) { var object = Object(val), keys = []; for (var key in object) { keys.push(key); } return keys.reverse(), function next() { for (; keys.length;) { var key = keys.pop(); if (key in object) return next.value = key, next.done = !1, next; } return next.done = !0, next; }; }, exports.values = values, Context.prototype = { constructor: Context, reset: function reset(skipTempReset) { if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) { "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined); } }, stop: function stop() { this.done = !0; var rootRecord = this.tryEntries[0].completion; if ("throw" === rootRecord.type) throw rootRecord.arg; return this.rval; }, dispatchException: function dispatchException(exception) { if (this.done) throw exception; var context = this; function handle(loc, caught) { return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught; } for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i], record = entry.completion; if ("root" === entry.tryLoc) return handle("end"); if (entry.tryLoc <= this.prev) { var hasCatch = hasOwn.call(entry, "catchLoc"), hasFinally = hasOwn.call(entry, "finallyLoc"); if (hasCatch && hasFinally) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } else if (hasCatch) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); } else { if (!hasFinally) throw new Error("try statement without catch or finally"); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } } } }, abrupt: function abrupt(type, arg) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) { var finallyEntry = entry; break; } } finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null); var record = finallyEntry ? finallyEntry.completion : {}; return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record); }, complete: function complete(record, afterLoc) { if ("throw" === record.type) throw record.arg; return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel; }, finish: function finish(finallyLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel; } }, catch: function _catch(tryLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc === tryLoc) { var record = entry.completion; if ("throw" === record.type) { var thrown = record.arg; resetTryEntry(entry); } return thrown; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(iterable, resultName, nextLoc) { return this.delegate = { iterator: values(iterable), resultName: resultName, nextLoc: nextLoc }, "next" === this.method && (this.arg = undefined), ContinueSentinel; } }, exports; }
9
+ function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
10
+ function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
11
+ /* eslint-disable no-console */
12
+ var fetch = require('node-fetch');
13
+ var fs = require('fs');
14
+ var path = require('path');
15
+ var unzipper = require('unzipper');
16
+ var localFilePath = path.resolve(__dirname, './bin/default.zip');
17
+ var outputDirectory = path.resolve(__dirname, './bin');
18
+
19
+ // 解压文件
20
+ var extractZip = function extractZip() {
21
+ fs.createReadStream(localFilePath).pipe(unzipper.Extract({
22
+ path: outputDirectory
23
+ })).on('close', function () {
24
+ console.log('remote zip file extract success!');
25
+ }).on('error', function (err) {
26
+ console.error('remote zip file extract error', err);
27
+ });
28
+ };
29
+
30
+ // 获取主题
31
+ // const getThemeFromNpm = async () => {
32
+ // const domains = ['fastly.jsdelivr.net', 'cdn.jsdelivr.net', 'gcore.jsdelivr.net', 'jsdelivr.codeqihan.com'];
33
+
34
+ // let downRes = false;
35
+
36
+ // let i = 0;
37
+ // while (!downRes && i < 4) {
38
+ // // eslint-disable-next-line no-await-in-loop
39
+ // downRes = await downloadRemoteZipFile(`https://${domains[i]}/npm/@lingxiteam/theme@latest/bin/default.zip`);
40
+ // console.log(`remote zip file download success!from ${domains[i]}.....`);
41
+ // i += 1;
42
+ // }
43
+
44
+ // if (downRes) {
45
+ // extractZip();
46
+ // }
47
+
48
+ // return downRes;
49
+ // };
50
+
51
+ var getThemeFromPlat = /*#__PURE__*/function () {
52
+ var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
53
+ var res, dest;
54
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
55
+ while (1) {
56
+ switch (_context.prev = _context.next) {
57
+ case 0:
58
+ _context.next = 2;
59
+ return fetch('http://172.21.72.205:18008/api/getLastPackageTheme?PROJECT_ID=lingxi');
60
+ case 2:
61
+ res = _context.sent;
62
+ dest = fs.createWriteStream(localFilePath);
63
+ res.body.pipe(dest).on('close', function () {
64
+ console.log('fetch zip file success!');
65
+ extractZip();
66
+ }).on('error', function (err) {
67
+ console.error('fetch zip file error', err);
68
+ });
69
+ case 5:
70
+ case "end":
71
+ return _context.stop();
72
+ }
73
+ }
74
+ }, _callee);
75
+ }));
76
+ return function getThemeFromPlat() {
77
+ return _ref.apply(this, arguments);
78
+ };
79
+ }();
80
+ var getTheme = function getTheme() {
81
+ getThemeFromPlat();
82
+ };
83
+ var _default = getTheme;
84
+ exports.default = _default;
@@ -159,7 +159,7 @@ var margins = {
159
159
 
160
160
  // 页面间距
161
161
  var pageSpaces = {
162
- 'page-space': '0 40px 16px 40px'
162
+ 'page-space': '0px'
163
163
  };
164
164
 
165
165
  // 盒子区块间距
@@ -1,4 +1,5 @@
1
1
  export declare const obj2QueryString: (params: any) => string;
2
+ export declare const decodeQueryString: (queryStr: string) => string;
2
3
  export declare const getSearchObj: (url?: string) => {};
3
4
  /**
4
5
  * 解析路径地址表达式
package/lib/utils/url.js CHANGED
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.parseUrlExpression = exports.obj2QueryString = exports.getSearchObj = void 0;
6
+ exports.parseUrlExpression = exports.obj2QueryString = exports.getSearchObj = exports.decodeQueryString = void 0;
7
7
  function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
8
8
  function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
9
9
  function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
@@ -23,6 +23,12 @@ var obj2QueryString = function obj2QueryString(params) {
23
23
  return queryString;
24
24
  };
25
25
  exports.obj2QueryString = obj2QueryString;
26
+ var decodeQueryString = function decodeQueryString(queryStr) {
27
+ return queryStr === null || queryStr === void 0 ? void 0 : queryStr.replace(/[^&=]+/g, function (mat) {
28
+ return decodeURIComponent(mat);
29
+ });
30
+ };
31
+ exports.decodeQueryString = decodeQueryString;
26
32
  var getSearchObj = function getSearchObj() {
27
33
  var url = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : window.location.href;
28
34
  var urlArr = url.split('?');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lingxiteam/assets",
3
- "version": "3.2.1",
3
+ "version": "3.3.1-alpha.10",
4
4
  "description": "灵犀低代码平台移动端 - 工具类",
5
5
  "main": "lib/index.js",
6
6
  "module": "es/index.js",
@@ -37,8 +37,9 @@
37
37
  },
38
38
  "gitHead": "bcd338198e2c14459538542d10600ab03abc92f2",
39
39
  "dependencies": {
40
- "crypto-js": "^4.1.1",
40
+ "crypto-js": "^4.2.0",
41
41
  "jsencrypt": "^3.1.0",
42
- "tinycolor2": "^1.6.0"
42
+ "tinycolor2": "^1.6.0",
43
+ "unzipper": "^0.10.14"
43
44
  }
44
45
  }