@lingxiteam/assets 3.2.1 → 3.3.1-alpha.2

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 (71) 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 +64 -46
  7. package/es/error/errorDisplay/Web/defaultGlobalConfig.js +10 -2
  8. package/es/error/errorDisplay/const.js +29 -7
  9. package/es/rootConfig/mobile/MobileModal.d.ts +33 -0
  10. package/es/rootConfig/mobile/MobileModal.js +49 -4
  11. package/es/rootConfig/mobile/MobilePopover.d.ts +3 -0
  12. package/es/rootConfig/mobile/MobilePopover.js +4 -1
  13. package/es/rootConfig/mobile/page.d.ts +13 -0
  14. package/es/rootConfig/mobile/page.js +15 -2
  15. package/es/rootConfig/pc/Drawer.d.ts +9 -0
  16. package/es/rootConfig/pc/Drawer.js +10 -1
  17. package/es/rootConfig/pc/Modal.d.ts +3 -0
  18. package/es/rootConfig/pc/Modal.js +4 -1
  19. package/es/rootConfig/pc/Popover.d.ts +3 -0
  20. package/es/rootConfig/pc/Popover.js +4 -1
  21. package/es/rootConfig/pc/page.d.ts +3 -18
  22. package/es/rootConfig/pc/page.js +4 -14
  23. package/es/rootConfig/todoActionList.d.ts +408 -65
  24. package/es/rootConfig/todoActionList.js +517 -118
  25. package/es/rootConfig/todoOptionList.d.ts +13 -2
  26. package/es/rootConfig/todoOptionList.js +16 -7
  27. package/es/security/encipher/sign.js +4 -3
  28. package/es/security/fetch.js +7 -0
  29. package/es/theme/bin/default/theme.js +1 -1
  30. package/es/theme/bin/default/theme.less +1 -1
  31. package/es/theme/bin/default/theme.scss +1 -1
  32. package/es/theme/index.js +54 -0
  33. package/es/theme/src/default/index.js +1 -1
  34. package/es/utils/url.d.ts +1 -0
  35. package/es/utils/url.js +5 -0
  36. package/lib/error/errorDisplay/Mobile/Drawer/Drawer.js +9 -3
  37. package/lib/error/errorDisplay/Mobile/ErrorMsg/index.js +29 -26
  38. package/lib/error/errorDisplay/Mobile/Modal/Modal.js +5 -3
  39. package/lib/error/errorDisplay/Mobile/defaultGlobalConfig.js +9 -1
  40. package/lib/error/errorDisplay/Web/Drawer/Drawer.js +10 -4
  41. package/lib/error/errorDisplay/Web/ErrorMsg/index.js +64 -46
  42. package/lib/error/errorDisplay/Web/defaultGlobalConfig.js +10 -1
  43. package/lib/error/errorDisplay/const.js +33 -9
  44. package/lib/rootConfig/mobile/MobileModal.d.ts +33 -0
  45. package/lib/rootConfig/mobile/MobileModal.js +49 -4
  46. package/lib/rootConfig/mobile/MobilePopover.d.ts +3 -0
  47. package/lib/rootConfig/mobile/MobilePopover.js +4 -1
  48. package/lib/rootConfig/mobile/page.d.ts +13 -0
  49. package/lib/rootConfig/mobile/page.js +15 -2
  50. package/lib/rootConfig/pc/Drawer.d.ts +9 -0
  51. package/lib/rootConfig/pc/Drawer.js +10 -1
  52. package/lib/rootConfig/pc/Modal.d.ts +3 -0
  53. package/lib/rootConfig/pc/Modal.js +4 -1
  54. package/lib/rootConfig/pc/Popover.d.ts +3 -0
  55. package/lib/rootConfig/pc/Popover.js +4 -1
  56. package/lib/rootConfig/pc/page.d.ts +3 -18
  57. package/lib/rootConfig/pc/page.js +4 -14
  58. package/lib/rootConfig/todoActionList.d.ts +408 -65
  59. package/lib/rootConfig/todoActionList.js +517 -118
  60. package/lib/rootConfig/todoOptionList.d.ts +13 -2
  61. package/lib/rootConfig/todoOptionList.js +16 -7
  62. package/lib/security/encipher/sign.js +3 -2
  63. package/lib/security/fetch.js +7 -0
  64. package/lib/theme/bin/default/theme.js +1 -1
  65. package/lib/theme/bin/default/theme.less +1 -1
  66. package/lib/theme/bin/default/theme.scss +1 -1
  67. package/lib/theme/index.js +61 -0
  68. package/lib/theme/src/default/index.js +1 -1
  69. package/lib/utils/url.d.ts +1 -0
  70. package/lib/utils/url.js +7 -1
  71. 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,61 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+ var https = require('https');
8
+ var fs = require('fs');
9
+ var path = require('path');
10
+ var unzipper = require('unzipper');
11
+
12
+ // 下载远程zip文件到本地
13
+ function downloadRemoteZipFile(url, localFilePath) {
14
+ var file = fs.createWriteStream(localFilePath);
15
+ return new Promise(function (resolve, reject) {
16
+ https.get(url, function (response) {
17
+ response.pipe(file);
18
+ file.on('finish', function () {
19
+ file.close();
20
+ resolve();
21
+ });
22
+ file.on('error', function (error) {
23
+ fs.unlink(localFilePath, function () {
24
+ reject(error);
25
+ });
26
+ });
27
+ }).on('error', function (error) {
28
+ reject(error);
29
+ });
30
+ });
31
+ }
32
+
33
+ // 解压文件
34
+ function extractZip(zipFilePath, outputDirectory) {
35
+ fs.createReadStream(zipFilePath).pipe(unzipper.Extract({
36
+ path: outputDirectory
37
+ })).on('close', function () {
38
+ console.log('remote zip file extract success!');
39
+ fs.unlink(zipFilePath, function () {
40
+ console.log('remote zip file delete success!');
41
+ });
42
+ }).on('error', function (err) {
43
+ console.error('remote zip file extract error', err);
44
+ });
45
+ }
46
+
47
+ // 获取主题
48
+ var getTheme = function getTheme() {
49
+ // TODO 借用cdn.jsdelivr.net 平台存最新的变量文件
50
+ var remoteZipUrl = 'https://cdn.jsdelivr.net/npm/@lingxiteam/theme@latest/bin/default.zip';
51
+ var localFilePath = path.resolve(__dirname, './bin/default.zip');
52
+ var outputDirectory = path.resolve(__dirname, './bin');
53
+ downloadRemoteZipFile(remoteZipUrl, localFilePath).then(function () {
54
+ console.log('remote zip file download success!,beigin extract......');
55
+ extractZip(localFilePath, outputDirectory);
56
+ }).catch(function (error) {
57
+ console.error('emote zip file download error:', error);
58
+ });
59
+ };
60
+ var _default = getTheme;
61
+ 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.2",
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
  }