@chaoswise/business 0.0.18 → 1.0.1

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 (91) hide show
  1. package/config/babel/index.js +2 -29
  2. package/config/swc.js +5 -0
  3. package/lib/AggregateSearch/CLSPL/SPLStagy.js +17 -7
  4. package/lib/AggregateSearch/CLSPL/index.js +17 -5
  5. package/lib/AggregateSearch/components/CloseAllIcon/index.js +1 -1
  6. package/lib/AggregateSearch/components/DropDown/config.js +54 -0
  7. package/lib/AggregateSearch/components/DropDown/index.js +57 -76
  8. package/lib/AggregateSearch/components/DropDown/index.less +18 -17
  9. package/lib/AggregateSearch/components/SwitchBtn/index.js +9 -7
  10. package/lib/AggregateSearch/index.js +47 -37
  11. package/lib/AggregateSearch/index.less +2 -1
  12. package/lib/AggregateSearch/utils/index.js +1 -1
  13. package/lib/ContentEditableSearch/components/CloseAllIcon/index.js +13 -0
  14. package/lib/ContentEditableSearch/components/CloseAllIcon/index.less +11 -0
  15. package/lib/ContentEditableSearch/index.js +157 -0
  16. package/lib/ContentEditableSearch/index.less +65 -0
  17. package/lib/ContentEditableSearch/utils/index.js +98 -0
  18. package/lib/PropertyControlViewer/components/DoAppIcon/CustomIcon/index.js +1 -1
  19. package/lib/PropertyControlViewer/components/DoCiUnitBitmap.js +1 -1
  20. package/lib/PropertyControlViewer/components/DoCommon.js +20 -17
  21. package/lib/PropertyControlViewer/components/DoQuote/components/QuoteView.js +3 -3
  22. package/lib/PropertyControlViewer/components/DoSelect.js +1 -1
  23. package/lib/PropertyControlViewer/components/DoUser.js +15 -19
  24. package/lib/PropertyControlViewer/components/TagShowMoreList/index.js +8 -3
  25. package/lib/PropertyControlViewer/config/utils.js +58 -59
  26. package/lib/PropertyControlViewer/index.js +83 -15
  27. package/lib/PropertyControlViewer/index.less +1 -0
  28. package/lib/Watermark/index.js +35 -16
  29. package/lib/index.js +2 -1
  30. package/lib/locales/en_US.json +1 -0
  31. package/lib/locales/index.js +42 -0
  32. package/lib/locales/intl.js +75 -0
  33. package/lib/locales/withLocale.js +37 -0
  34. package/lib/locales/zh_CN.json +1 -0
  35. package/lib/locales/zh_TW.json +1 -0
  36. package/package.json +12 -7
  37. package/config/babel/antdComs.js +0 -51
  38. package/config/babel/formily.js +0 -22
  39. package/config/city/citys.js +0 -1964
  40. package/config/theme/CWTheme.js +0 -427
  41. package/config/theme/chart.dark.js +0 -394
  42. package/config/theme/chart.light.js +0 -3
  43. package/config/theme/common.less +0 -161
  44. package/config/theme/dark.js +0 -784
  45. package/config/theme/dark.less +0 -80
  46. package/config/theme/default.js +0 -717
  47. package/config/theme/default.less +0 -144
  48. package/config/theme/style/color/bezierEasing.less +0 -110
  49. package/config/theme/style/color/colorPalette.less +0 -85
  50. package/config/theme/style/color/colors.less +0 -162
  51. package/config/theme/style/color/tinyColor.less +0 -1184
  52. package/config/theme/style/compact.less +0 -4
  53. package/config/theme/style/components.less +0 -65
  54. package/config/theme/style/core/base.less +0 -10
  55. package/config/theme/style/core/global.less +0 -491
  56. package/config/theme/style/core/iconfont.less +0 -22
  57. package/config/theme/style/core/index.less +0 -5
  58. package/config/theme/style/core/motion/fade.less +0 -34
  59. package/config/theme/style/core/motion/move.less +0 -129
  60. package/config/theme/style/core/motion/other.less +0 -51
  61. package/config/theme/style/core/motion/slide.less +0 -129
  62. package/config/theme/style/core/motion/zoom.less +0 -179
  63. package/config/theme/style/core/motion.less +0 -22
  64. package/config/theme/style/css.js +0 -3
  65. package/config/theme/style/dark.less +0 -4
  66. package/config/theme/style/default.css +0 -1784
  67. package/config/theme/style/default.less +0 -4
  68. package/config/theme/style/index-pure.less +0 -2
  69. package/config/theme/style/index.css +0 -1784
  70. package/config/theme/style/index.d.ts +0 -1
  71. package/config/theme/style/index.js +0 -3
  72. package/config/theme/style/index.less +0 -3
  73. package/config/theme/style/mixins/box.less +0 -7
  74. package/config/theme/style/mixins/clearfix.less +0 -16
  75. package/config/theme/style/mixins/compatibility.less +0 -13
  76. package/config/theme/style/mixins/customize.less +0 -181
  77. package/config/theme/style/mixins/iconfont.less +0 -28
  78. package/config/theme/style/mixins/index.less +0 -14
  79. package/config/theme/style/mixins/modal-mask.less +0 -30
  80. package/config/theme/style/mixins/motion.less +0 -33
  81. package/config/theme/style/mixins/operation-unit.less +0 -16
  82. package/config/theme/style/mixins/reset.less +0 -11
  83. package/config/theme/style/mixins/rounded-arrow.less +0 -44
  84. package/config/theme/style/mixins/size.less +0 -10
  85. package/config/theme/style/mixins/typography.less +0 -58
  86. package/config/theme/style/themes/compact.less +0 -295
  87. package/config/theme/style/themes/dark.less +0 -457
  88. package/config/theme/style/themes/default.less +0 -1080
  89. package/config/theme/style/themes/index.less +0 -7
  90. package/config/theme/style/themes/variable.less +0 -1135
  91. package/config/theme/style/variable.less +0 -4
@@ -1,7 +1,7 @@
1
- import _List from "@chaoswise/ui/lib/Antd/List";
1
+ import _List from "@chaoswise/ui/lib/List";
2
2
  import _Tooltip from "@chaoswise/ui/lib/Tooltip";
3
- import _Avatar from "@chaoswise/ui/lib/Antd/Avatar";
4
- import _Card from "@chaoswise/ui/lib/Antd/Card";
3
+ import _Avatar from "@chaoswise/ui/lib/Avatar";
4
+ import _Card from "@chaoswise/ui/lib/Card";
5
5
  import React from 'react';
6
6
  import DoAppIcon from '../../DoAppIcon';
7
7
  import '../../../assets/index.less';
@@ -1,4 +1,4 @@
1
- import _Popover from "@chaoswise/ui/lib/Antd/Popover";
1
+ import _Popover from "@chaoswise/ui/lib/Popover";
2
2
  import _Tooltip from "@chaoswise/ui/lib/Tooltip";
3
3
  function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
4
4
  function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
@@ -1,10 +1,9 @@
1
1
  import _Tooltip from "@chaoswise/ui/lib/Tooltip";
2
- import _Avatar from "@chaoswise/ui/lib/Antd/Avatar";
3
- import _ConfigProvider from "@chaoswise/ui/lib/ConfigProvider";
2
+ import _Avatar from "@chaoswise/ui/lib/Avatar";
4
3
  import React, { Fragment } from 'react';
5
4
  import '../assets/index.less';
6
5
  import TagShowMoreList from './TagShowMoreList';
7
- import { getLocale } from "../../locale";
6
+ import { useIntl } from '../../locales';
8
7
  var DoUser = function DoUser(_ref) {
9
8
  var data = _ref.data;
10
9
  var belongComponentType = data.belongComponentType,
@@ -12,26 +11,23 @@ var DoUser = function DoUser(_ref) {
12
11
  tooltipContent = data.tooltipContent,
13
12
  list = data.list,
14
13
  componentType = data.componentType;
15
- var _ConfigProvider$useLo = _ConfigProvider.useLocale(),
16
- _ConfigProvider$useLo2 = _ConfigProvider$useLo.locale,
17
- locale = _ConfigProvider$useLo2 === void 0 ? "zh" : _ConfigProvider$useLo2;
18
- var localeObj = getLocale(locale);
14
+ var intl = useIntl();
19
15
  var userTooltip = {
20
- userName: localeObj.name + ":",
21
- userAlias: localeObj.userName + ":",
22
- department: localeObj.department + ":",
23
- email: localeObj.emil + ":",
24
- mobile: localeObj.mobile + ":"
16
+ userName: intl.get('5b412c79-b099-47cd-8745-21264d9212c4').d('姓名') + ':',
17
+ userAlias: intl.get('43395ce9-35f2-4a6d-9e84-8c277369157b').d('用户名') + ':',
18
+ department: intl.get('3190d9a0-41bf-42b3-adf9-9d22a337f65d').d('部门') + ':',
19
+ email: intl.get('e28ef3cf-569c-49f8-99b3-533e5013cb9d').d('邮箱') + ':',
20
+ mobile: intl.get('905a2fe5-4c8a-467e-813a-963fdb268b10').d('手机') + ':'
25
21
  };
26
22
  var userGroupTooltip = {
27
- groupName: localeObj.groupName + ":",
28
- groupDetails: localeObj.groupDetails + ":"
23
+ groupName: intl.get('bc71d288-1654-454d-8639-5ed225d8d6f6').d('用户组') + ':',
24
+ groupDetails: intl.get('e94234be-e478-4314-bc85-572cc285f5f9').d('描述') + ':'
29
25
  };
30
- tooltipContent = componentType === "USER_GROUP" ? userGroupTooltip : userTooltip;
31
- var gridShare = belongComponentType === "TABLE" ? '100%' : fieldWidth == 'WHOLE_LINE' ? '25%' : '50%';
26
+ tooltipContent = componentType === 'USER_GROUP' ? userGroupTooltip : userTooltip;
27
+ var gridShare = belongComponentType === 'TABLE' ? '100%' : fieldWidth == 'WHOLE_LINE' ? '25%' : '50%';
32
28
  var tooltipContentFuc = function tooltipContentFuc(item) {
33
29
  return Object.keys(tooltipContent).map(function (key) {
34
- return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("span", null, tooltipContent[key], " ", item[key] || "", " "), /*#__PURE__*/React.createElement("br", null));
30
+ return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("span", null, tooltipContent[key], " ", item[key] || '', ' '), /*#__PURE__*/React.createElement("br", null));
35
31
  });
36
32
  };
37
33
  var nameKey = componentType === "USER_GROUP" ? 'groupName' : 'userAlias';
@@ -57,9 +53,9 @@ var DoUser = function DoUser(_ref) {
57
53
  }, /*#__PURE__*/React.createElement(_Avatar, {
58
54
  className: 'ci-detail-avatar',
59
55
  size: "small"
60
- }, (_ref2 = item.userAlias || item.name) === null || _ref2 === void 0 ? void 0 : _ref2.substring(0, 1)), /*#__PURE__*/React.createElement("div", {
56
+ }, (_ref2 = item.userAlias ? "".concat(item.userName, "(").concat(item.userAlias, ")") : item.name) === null || _ref2 === void 0 ? void 0 : _ref2.substring(0, 1)), /*#__PURE__*/React.createElement("div", {
61
57
  className: 'ci-detail-user-name'
62
- }, item.userAlias || item.name)));
58
+ }, item.userAlias ? "".concat(item.userName, "(").concat(item.userAlias, ")") : item.name)));
63
59
  })));
64
60
  };
65
61
  export default DoUser;
@@ -1,6 +1,6 @@
1
- import _Popover from "@chaoswise/ui/lib/Antd/Popover";
1
+ import _Popover from "@chaoswise/ui/lib/Popover";
2
2
  import _Tooltip from "@chaoswise/ui/lib/Tooltip";
3
- import _Avatar from "@chaoswise/ui/lib/Antd/Avatar";
3
+ import _Avatar from "@chaoswise/ui/lib/Avatar";
4
4
  function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
5
5
  function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
6
6
  function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
@@ -55,7 +55,12 @@ var TagShowMoreList = function TagShowMoreList(props) {
55
55
  var classNameDiv = _className || 'wrapper-inner';
56
56
  return tags.map(function (item, index) {
57
57
  var _String;
58
- var _name = item[nameKey] || (item === null || item === void 0 ? void 0 : item.ciName) || (item === null || item === void 0 ? void 0 : item.id);
58
+ var _name = '';
59
+ if (nameKey == 'userAlias') {
60
+ _name = item.userAlias ? "".concat(item === null || item === void 0 ? void 0 : item.userName, "(").concat(item === null || item === void 0 ? void 0 : item.userAlias, ")") : item === null || item === void 0 ? void 0 : item.id;
61
+ } else {
62
+ _name = item[nameKey] || (item === null || item === void 0 ? void 0 : item.ciName) || (item === null || item === void 0 ? void 0 : item.id);
63
+ }
59
64
  return /*#__PURE__*/React.createElement(_Tooltip, {
60
65
  title: tooltipContentFuc ? tooltipContentFuc(item) : _name,
61
66
  key: index,
@@ -7,7 +7,7 @@ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e
7
7
  import moment from 'moment';
8
8
  import React from 'react';
9
9
  import { ATTR_DES_ENUM, DATE_FORMATE_ENUM } from './constants';
10
- import { intl } from '@chaoswise/intl';
10
+ import intl from '../../locales';
11
11
 
12
12
  //根据属性类型获取对应的组件
13
13
  export var getDescriptionComp = function getDescriptionComp(type) {
@@ -92,48 +92,48 @@ export var guidFunc = function guidFunc() {
92
92
  export var judgmentTypeFunc = function judgmentTypeFunc(type, value) {
93
93
  var judgmentType = true; // 判断返回的value类型
94
94
  switch (type) {
95
- case "INPUT":
95
+ case 'INPUT':
96
96
  break;
97
- case "SELECT":
97
+ case 'SELECT':
98
98
  break;
99
- case "TEXTAREA":
99
+ case 'TEXTAREA':
100
100
  break;
101
- case "NUMBER":
101
+ case 'NUMBER':
102
102
  break;
103
- case "UID":
103
+ case 'UID':
104
104
  break;
105
- case "AUTO_CALCULATE":
105
+ case 'AUTO_CALCULATE':
106
106
  break;
107
- case "DATE":
108
- judgmentType = typeof value === "string" || typeof value === "number";
107
+ case 'DATE':
108
+ judgmentType = typeof value === 'string' || typeof value === 'number';
109
109
  break;
110
- case "RADIO":
111
- judgmentType = typeof value === "string";
110
+ case 'RADIO':
111
+ judgmentType = typeof value === 'string';
112
112
  break;
113
- case "CHECKBOX":
113
+ case 'CHECKBOX':
114
114
  break;
115
- case "NUMBER_RANGE":
115
+ case 'NUMBER_RANGE':
116
116
  break;
117
- case "RACK_UNIT":
117
+ case 'RACK_UNIT':
118
118
  break;
119
- case "USER":
119
+ case 'USER':
120
120
  break;
121
- case "USER_GROUP":
121
+ case 'USER_GROUP':
122
122
  break;
123
- case "QUOTE":
123
+ case 'QUOTE':
124
124
  break;
125
- case "IMAGE":
125
+ case 'IMAGE':
126
126
  break;
127
- case "FILE":
127
+ case 'FILE':
128
128
  break;
129
- case "TABLE":
129
+ case 'TABLE':
130
130
  judgmentType = Array.isArray(value) && (value === null || value === void 0 ? void 0 : value.length) > 0;
131
131
  break;
132
- case "SWITCH":
133
- judgmentType = typeof value === "boolean" || typeof value === "string";
132
+ case 'SWITCH':
133
+ judgmentType = typeof value === 'boolean' || typeof value === 'string';
134
134
  break;
135
- case "UNIT_BITMAP":
136
- judgmentType = Object.prototype.toString.call(value) === "[object Object]";
135
+ case 'UNIT_BITMAP':
136
+ judgmentType = Object.prototype.toString.call(value) === '[object Object]';
137
137
  break;
138
138
  default:
139
139
  judgmentType = true;
@@ -160,28 +160,28 @@ export var getDataFunc = function getDataFunc(value, item, rest) {
160
160
  var data = {};
161
161
  try {
162
162
  switch (componentType) {
163
- case "INPUT":
164
- case "TEXTAREA":
163
+ case 'INPUT':
164
+ case 'TEXTAREA':
165
165
  data = {
166
166
  paragraphEllipsis: paragraphEllipsis || {
167
167
  rows: 5,
168
168
  expandable: true
169
169
  },
170
170
  list: [{
171
- value: unit ? value + " " + unit : value
171
+ value: unit ? value + ' ' + unit : value
172
172
  }]
173
173
  };
174
174
  break;
175
- case "NUMBER":
176
- case "UID":
177
- case "AUTO_CALCULATE":
175
+ case 'NUMBER':
176
+ case 'UID':
177
+ case 'AUTO_CALCULATE':
178
178
  data = {
179
179
  list: [{
180
- value: !(value === undefined || value === null || value === '') ? unit ? value + " " + unit : value : '-'
180
+ value: !(value === undefined || value === null || value === '') ? unit ? value + ' ' + unit : value : '-'
181
181
  }]
182
182
  };
183
183
  break;
184
- case "RADIO":
184
+ case 'RADIO':
185
185
  data = {
186
186
  tagCount: 1,
187
187
  list: (enumList || []).filter(function (i) {
@@ -195,9 +195,9 @@ export var getDataFunc = function getDataFunc(value, item, rest) {
195
195
  })
196
196
  };
197
197
  break;
198
- case "SELECT":
198
+ case 'SELECT':
199
199
  data = {
200
- tagCount: belongComponentType === "TABLE" ? 1 : tagCount ? tagCount : 10000,
200
+ tagCount: belongComponentType === 'TABLE' ? 1 : tagCount ? tagCount : 10000,
201
201
  list: (enumList || []).filter(function (i) {
202
202
  return value === null || value === void 0 ? void 0 : value.includes(i === null || i === void 0 ? void 0 : i.itemCode);
203
203
  }).map(function (m) {
@@ -209,7 +209,7 @@ export var getDataFunc = function getDataFunc(value, item, rest) {
209
209
  })
210
210
  };
211
211
  break;
212
- case "CHECKBOX":
212
+ case 'CHECKBOX':
213
213
  data = {
214
214
  tagCount: tagCount || 10000,
215
215
  list: (enumList || []).filter(function (i) {
@@ -223,29 +223,29 @@ export var getDataFunc = function getDataFunc(value, item, rest) {
223
223
  })
224
224
  };
225
225
  break;
226
- case "SWITCH":
226
+ case 'SWITCH':
227
227
  var _value = String(value).toLowerCase();
228
228
  data = {
229
229
  list: [{
230
- value: _value == "true" || _value === "1" ? onValue : offValue
230
+ value: _value == 'true' || _value === '1' ? onValue : offValue
231
231
  }]
232
232
  };
233
233
  break;
234
- case "NUMBER_RANGE":
234
+ case 'NUMBER_RANGE':
235
235
  data = {
236
236
  list: [{
237
- value: value ? unit ? (value === null || value === void 0 ? void 0 : value.join(" - ")) + ' ' + unit : value === null || value === void 0 ? void 0 : value.join(" - ") : '-'
237
+ value: value ? unit ? (value === null || value === void 0 ? void 0 : value.join(' - ')) + ' ' + unit : value === null || value === void 0 ? void 0 : value.join(' - ') : '-'
238
238
  }]
239
239
  };
240
240
  break;
241
- case "RACK_UNIT":
241
+ case 'RACK_UNIT':
242
242
  data = {
243
243
  list: [{
244
- value: (value === null || value === void 0 ? void 0 : value.join(" - ")) || []
244
+ value: (value === null || value === void 0 ? void 0 : value.join(' - ')) || []
245
245
  }]
246
246
  };
247
247
  break;
248
- case "DATE":
248
+ case 'DATE':
249
249
  var dataFormatString = DATE_FORMATE_ENUM[dateFormat] || 'YYYY-MM-DD HH:mm:ss';
250
250
  data = {
251
251
  list: [{
@@ -253,13 +253,13 @@ export var getDataFunc = function getDataFunc(value, item, rest) {
253
253
  }]
254
254
  };
255
255
  break;
256
- case "USER":
256
+ case 'USER':
257
257
  var userTooltip = {
258
- userName: "姓名:",
259
- userAlias: "用户名:",
260
- department: "部门:",
261
- email: "邮箱:",
262
- mobile: "手机:"
258
+ userName: intl.get('cfbba0e5-b133-4bd7-9b8c-3c92368fe049').d('姓名:'),
259
+ userAlias: intl.get('b59f74be-dff0-4e3e-92db-354b475c3efd').d('用户名:'),
260
+ department: intl.get('79279aa4-ad27-4082-8093-06122d68c611').d('部门:'),
261
+ email: intl.get('88d7ad39-7f49-459f-a1fd-48dd4c0ff9d5').d('邮箱:'),
262
+ mobile: intl.get('db3f4bef-089e-4144-861d-29f79fa4cd38').d('手机:')
263
263
  };
264
264
  data = {
265
265
  fieldWidth: fieldWidth,
@@ -267,17 +267,16 @@ export var getDataFunc = function getDataFunc(value, item, rest) {
267
267
  belongComponentType: belongComponentType,
268
268
  componentType: componentType,
269
269
  list: (value ? Array.isArray(value) ? value : [value] : []).map(function (i) {
270
- console.log(i, 'oooo');
271
270
  i.id = i === null || i === void 0 ? void 0 : i.userId;
272
271
  i.name = i === null || i === void 0 ? void 0 : i.userName;
273
272
  return i;
274
273
  })
275
274
  };
276
275
  break;
277
- case "USER_GROUP":
276
+ case 'USER_GROUP':
278
277
  var userGroupTooltip = {
279
- groupName: "用户组:",
280
- groupDetails: "描述:"
278
+ groupName: intl.get('0ee18787-448b-4f7b-a3f2-5067a38c9a26').d('用户组:'),
279
+ groupDetails: intl.get('f307bd91-6737-4667-9e89-daec35b21198').d('描述:')
281
280
  };
282
281
  data = {
283
282
  fieldWidth: fieldWidth,
@@ -291,7 +290,7 @@ export var getDataFunc = function getDataFunc(value, item, rest) {
291
290
  })
292
291
  };
293
292
  break;
294
- case "QUOTE":
293
+ case 'QUOTE':
295
294
  data = {
296
295
  fieldWidth: fieldWidth,
297
296
  attrSource: rest === null || rest === void 0 ? void 0 : rest.attrSource,
@@ -299,9 +298,9 @@ export var getDataFunc = function getDataFunc(value, item, rest) {
299
298
  list: value || []
300
299
  };
301
300
  break;
302
- case "IMAGE":
301
+ case 'IMAGE':
303
302
  data = {
304
- type: "image",
303
+ type: 'image',
305
304
  list: (value || []).map(function (i) {
306
305
  return {
307
306
  uid: i.id,
@@ -312,9 +311,9 @@ export var getDataFunc = function getDataFunc(value, item, rest) {
312
311
  })
313
312
  };
314
313
  break;
315
- case "FILE":
314
+ case 'FILE':
316
315
  data = {
317
- type: "file",
316
+ type: 'file',
318
317
  list: (value || []).map(function (i) {
319
318
  return {
320
319
  uid: i.id,
@@ -325,13 +324,13 @@ export var getDataFunc = function getDataFunc(value, item, rest) {
325
324
  })
326
325
  };
327
326
  break;
328
- case "UNIT_BITMAP":
327
+ case 'UNIT_BITMAP':
329
328
  data = {
330
329
  list: (value === null || value === void 0 ? void 0 : value.units) || [],
331
330
  handleClickChange: handleClickChange
332
331
  };
333
332
  break;
334
- case "TABLE":
333
+ case 'TABLE':
335
334
  data = {
336
335
  properties: properties,
337
336
  handleClickChange: handleClickChange,
@@ -1,31 +1,62 @@
1
+ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
1
2
  import _Tooltip from "@chaoswise/ui/lib/Tooltip";
2
3
  import _Form from "@chaoswise/ui/lib/Form";
3
4
  import _Collapse from "@chaoswise/ui/lib/Collapse";
4
- var _excluded = ["schemaData", "detailContent"],
5
- _excluded2 = ["item", "detailContent"];
5
+ var _excluded = ["schemaData", "detailContent", "filterAttrs"],
6
+ _excluded2 = ["properties", "attrID"],
7
+ _excluded3 = ["item", "detailContent"];
6
8
  function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
9
+ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
10
+ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
11
+ 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; }
12
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
13
+ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
7
14
  function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
8
15
  function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
9
- import { intl } from '@chaoswise/intl';
10
16
  import React, { useState, useEffect, useMemo, memo } from 'react';
11
- import { getDescriptionComp, getDataFunc, judgmentTypeFunc } from "./config/utils";
17
+ import { getDescriptionComp, getDataFunc, judgmentTypeFunc } from './config/utils';
18
+ import { useIntl } from '../locales';
12
19
  import './index.less';
20
+ import PropTypes from "prop-types";
13
21
  var Panel = _Collapse.Panel;
14
22
  var compositeAttr = {
15
- "UNIT_RANGE": 1,
16
- "UNIT_SELECT": 1
23
+ UNIT_RANGE: 1,
24
+ UNIT_SELECT: 1
17
25
  };
18
26
  var setWidthClassName = {
19
- "TABLE": 1
27
+ TABLE: 1
20
28
  };
21
29
  var PropertyControlViewer = function PropertyControlViewer(_ref) {
22
30
  var schemaData = _ref.schemaData,
23
31
  detailContent = _ref.detailContent,
32
+ filterAttrs = _ref.filterAttrs,
24
33
  rest = _objectWithoutProperties(_ref, _excluded);
34
+ var intl = useIntl();
35
+ var _schemaData = useMemo(function () {
36
+ if (!filterAttrs || filterAttrs.length == 0) {
37
+ return schemaData;
38
+ }
39
+ var filteredData = schemaData.map(function (_ref2) {
40
+ var properties = _ref2.properties,
41
+ attrID = _ref2.attrID,
42
+ rest = _objectWithoutProperties(_ref2, _excluded2);
43
+ return _objectSpread(_objectSpread({}, rest), {}, {
44
+ attrID: attrID,
45
+ properties: properties.filter(function (property) {
46
+ return !filterAttrs.some(function (_ref3) {
47
+ var attrGroupId = _ref3.attrGroupId,
48
+ conditionAttrID = _ref3.attrID;
49
+ return attrID === attrGroupId && property.attrID === conditionAttrID;
50
+ });
51
+ })
52
+ });
53
+ });
54
+ return filteredData;
55
+ }, [schemaData]);
25
56
  var comList = useMemo(function () {
26
- if (schemaData && schemaData.length > 0) {
27
- return schemaData.map(function (i, index) {
28
- if (i.componentType === "ATTRIBUTE_GROUP") {
57
+ if (_schemaData && _schemaData.length > 0) {
58
+ return _schemaData.map(function (i, index) {
59
+ if (i.componentType === 'ATTRIBUTE_GROUP') {
29
60
  return /*#__PURE__*/React.createElement(_Collapse, {
30
61
  key: i.attrID,
31
62
  style: {
@@ -70,7 +101,7 @@ var PropertyControlViewer = function PropertyControlViewer(_ref) {
70
101
  } else {
71
102
  return null;
72
103
  }
73
- }, [schemaData]);
104
+ }, [_schemaData]);
74
105
  return /*#__PURE__*/React.createElement(_Form, {
75
106
  style: {
76
107
  minHeight: '100%'
@@ -80,11 +111,11 @@ var PropertyControlViewer = function PropertyControlViewer(_ref) {
80
111
  className: "form-properties-box form-properties-view-box"
81
112
  }, comList));
82
113
  };
83
- var AttrFormItem = /*#__PURE__*/memo(function (_ref2) {
114
+ var AttrFormItem = /*#__PURE__*/memo(function (_ref4) {
84
115
  var _detailContent$conten;
85
- var item = _ref2.item,
86
- detailContent = _ref2.detailContent,
87
- rest = _objectWithoutProperties(_ref2, _excluded2);
116
+ var item = _ref4.item,
117
+ detailContent = _ref4.detailContent,
118
+ rest = _objectWithoutProperties(_ref4, _excluded3);
88
119
  var attrID = item.attrID,
89
120
  attrName = item.attrName,
90
121
  componentType = item.componentType,
@@ -124,4 +155,41 @@ var AttrFormItem = /*#__PURE__*/memo(function (_ref2) {
124
155
  data: data
125
156
  })))));
126
157
  });
158
+ PropertyControlViewer.propTypes = {
159
+ /**
160
+ * 模型属性数据
161
+ */
162
+ schemaData: PropTypes.array.isRequired,
163
+ /**
164
+ * 配置项数据
165
+ */
166
+ detailContent: PropTypes.object.isRequired,
167
+ /**
168
+ * 需要过滤隐藏的属性
169
+ */
170
+ filterAttrs: PropTypes.arrayOf(PropTypes.shape({
171
+ "attrGroupId": PropTypes.string,
172
+ "attrID": PropTypes.string
173
+ })),
174
+ /**
175
+ * 属性类型为input和textarea自动溢出省略,为对象时可设置省略行数与是否可展开等
176
+ */
177
+ paragraphEllipsis: PropTypes.oneOf([PropTypes["boolean"], PropTypes.object]),
178
+ /**
179
+ * 属性类型为select和checkbox, 可设置显示的数量
180
+ */
181
+ tagCount: PropTypes.number,
182
+ /**
183
+ * 属性类型为quote的点击事件
184
+ */
185
+ handleClickChange: PropTypes.func,
186
+ /**
187
+ * 属性类型为user,鼠标悬浮显示的tooltip字段
188
+ */
189
+ userTooltipContent: PropTypes.object,
190
+ /**
191
+ * 属性类型为userGroup, 鼠标悬浮显示的tooltip字段
192
+ */
193
+ userGroupTooltipContent: PropTypes.object
194
+ };
127
195
  export default PropertyControlViewer;
@@ -23,6 +23,7 @@
23
23
  }
24
24
 
25
25
  .view_table {
26
+ margin-bottom: 24px;
26
27
  .@{ant-prefix}-form-item-control-wrapper {
27
28
  width: calc(100% - 110px);
28
29
  }