@teamix/pro 1.1.6 → 1.1.7

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 (59) hide show
  1. package/README.md +97 -0
  2. package/dist/pro.css +1 -1
  3. package/dist/pro.js +288 -385
  4. package/dist/pro.min.css +1 -1
  5. package/dist/pro.min.js +1 -1
  6. package/dist/pro.min.js.LICENSE.txt +1 -1
  7. package/es/form/ProForm/index.scss +7 -1
  8. package/es/form/SchemaForm/index.js +3 -2
  9. package/es/form/SchemaForm/initializeArrayCards.js +10 -55
  10. package/es/form/SchemaForm/initializeArrayCollapse.js +10 -64
  11. package/es/form/SchemaForm/initializeArrayIcon.js +13 -6
  12. package/es/form/SchemaForm/initializeArrayItems.js +16 -75
  13. package/es/form/SchemaForm/initializeArrayTable.js +23 -33
  14. package/es/form/typing.d.ts +2 -5
  15. package/es/index.d.ts +1 -1
  16. package/es/index.js +1 -1
  17. package/es/info/components/FormItem/index.js +4 -4
  18. package/es/info/components/FormItem/index.scss +11 -0
  19. package/es/info/components/InfoValueItem/index.js +12 -1
  20. package/es/info/components/baseInfo/index.js +3 -4
  21. package/es/info/components/headerInfo/index.js +3 -4
  22. package/es/info/components/tableInfo/index.js +4 -3
  23. package/es/info/components/tableInfo/index.scss +1 -1
  24. package/es/info/index.scss +4 -0
  25. package/es/info/typing.d.ts +1 -1
  26. package/es/info/utils/index.d.ts +8 -1
  27. package/es/info/utils/index.js +18 -1
  28. package/es/nocode/configurators/PageHeader.js +49 -43
  29. package/es/nocode/configurators/ProTable.js +12 -9
  30. package/es/nocode/configurators/common.d.ts +117 -105
  31. package/es/nocode/configurators/common.js +38 -34
  32. package/es/table/components/Filter/index.js +8 -16
  33. package/lib/form/ProForm/index.scss +7 -1
  34. package/lib/form/SchemaForm/index.js +3 -2
  35. package/lib/form/SchemaForm/initializeArrayCards.js +10 -54
  36. package/lib/form/SchemaForm/initializeArrayCollapse.js +10 -63
  37. package/lib/form/SchemaForm/initializeArrayIcon.js +13 -6
  38. package/lib/form/SchemaForm/initializeArrayItems.js +16 -74
  39. package/lib/form/SchemaForm/initializeArrayTable.js +23 -33
  40. package/lib/form/typing.d.ts +2 -5
  41. package/lib/index.d.ts +1 -1
  42. package/lib/index.js +1 -1
  43. package/lib/info/components/FormItem/index.js +4 -4
  44. package/lib/info/components/FormItem/index.scss +11 -0
  45. package/lib/info/components/InfoValueItem/index.js +12 -1
  46. package/lib/info/components/baseInfo/index.js +4 -6
  47. package/lib/info/components/headerInfo/index.js +6 -8
  48. package/lib/info/components/tableInfo/index.js +4 -2
  49. package/lib/info/components/tableInfo/index.scss +1 -1
  50. package/lib/info/index.scss +4 -0
  51. package/lib/info/typing.d.ts +1 -1
  52. package/lib/info/utils/index.d.ts +8 -1
  53. package/lib/info/utils/index.js +21 -1
  54. package/lib/nocode/configurators/PageHeader.js +49 -43
  55. package/lib/nocode/configurators/ProTable.js +12 -9
  56. package/lib/nocode/configurators/common.d.ts +117 -105
  57. package/lib/nocode/configurators/common.js +38 -34
  58. package/lib/table/components/Filter/index.js +7 -15
  59. package/package.json +2 -2
@@ -20,7 +20,7 @@ object-assign
20
20
 
21
21
  /*!
22
22
  * screenfull
23
- * v5.1.0 - 2020-12-24
23
+ * v5.2.0 - 2021-11-03
24
24
  * (c) Sindre Sorhus; MIT License
25
25
  */
26
26
 
@@ -37,9 +37,13 @@ $form-item-cls: #{$css-prefix}formily-item;
37
37
  > .teamix-pro-field-checkbox,
38
38
  .teamix-pro-field-radio,
39
39
  .teamix-pro-field-switch,
40
- .teamix-pro-field-colorradio {
40
+ .teamix-pro-field-colorradio,
41
+ .#{$css-prefix}btn-text {
41
42
  line-height: var(--form-element-medium-height, 32px);
42
43
  }
44
+ > .#{$css-prefix}btn-text {
45
+ width: auto;
46
+ }
43
47
  }
44
48
  }
45
49
  }
@@ -93,9 +97,11 @@ $form-item-cls: #{$css-prefix}formily-item;
93
97
  .#{$form-item-cls}-control-content {
94
98
  .#{$form-item-cls}-addon-before {
95
99
  margin-right: 16px;
100
+ color: var(--color-text1-8, #848484);
96
101
  }
97
102
  .#{$form-item-cls}-addon-after {
98
103
  margin-left: 16px;
104
+ color: var(--color-text1-8, #848484);
99
105
  }
100
106
  }
101
107
  }
@@ -236,9 +236,10 @@ export default /*#__PURE__*/memo(function (_ref) {
236
236
 
237
237
  var recursiveProperties = (children === null || children === void 0 ? void 0 : children.length) ? {
238
238
  properties: formatSchema(children)
239
- } : {}; // 递归items(类似子组件)
239
+ } : {}; // 递归items(类似子组件,会先由各initialize方法格式化为固定形式,type不同不统一处理)
240
+ // 例如:[{ name: 'items', type: 'object', children: items }]
240
241
 
241
- var recursiveItems = items ? formatSchema(items) : {}; // 配置组件属性
242
+ var recursiveItems = items ? formatSchema([items]) : {}; // 配置组件属性
242
243
 
243
244
  schemaProperties[name] = _objectSpread(_objectSpread(_objectSpread(_objectSpread({}, otherProps), formatParam), recursiveProperties), recursiveItems);
244
245
  });
@@ -1,68 +1,23 @@
1
- var _excluded = ["props", "children", "items"],
2
- _excluded2 = ["itemType"];
3
-
4
- 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; }
5
-
6
- 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; }
7
-
8
1
  function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
9
2
 
10
3
  function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
11
4
 
12
5
  function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
13
6
 
14
- var initializeChildren = function initializeChildren(item) {
15
- return item;
16
- };
7
+ var initializeItems = function initializeItems(items) {
8
+ if (items) {
9
+ return _objectSpread(_objectSpread({}, items), {}, {
10
+ name: 'items'
11
+ });
12
+ }
17
13
 
18
- var initializeAddition = function initializeAddition(item) {
19
- return _objectSpread(_objectSpread({}, item), {}, {
20
- component: 'ArrayCards.Addition'
21
- });
22
- };
23
-
24
- var initializeString = function initializeString(items) {
25
- return [{
26
- name: 'items',
27
- children: items.map(function (item) {
28
- return initializeChildren(item);
29
- })
30
- }];
31
- };
32
-
33
- var initializeObject = function initializeObject(items) {
34
- return [{
35
- name: 'items',
36
- type: 'object',
37
- children: items.map(function (item) {
38
- return initializeChildren(item);
39
- })
40
- }];
14
+ return items;
41
15
  };
42
16
 
43
17
  var initialize = function initialize(item) {
44
- var _item$props = item.props,
45
- props = _item$props === void 0 ? {} : _item$props,
46
- _item$children = item.children,
47
- children = _item$children === void 0 ? [] : _item$children,
48
- _item$items = item.items,
49
- items = _item$items === void 0 ? [] : _item$items,
50
- other = _objectWithoutProperties(item, _excluded);
51
-
52
- var _props$itemType = props.itemType,
53
- itemType = _props$itemType === void 0 ? 'string' : _props$itemType,
54
- otherProps = _objectWithoutProperties(props, _excluded2);
55
-
56
- var renderItemsMap = {
57
- string: initializeString(items),
58
- object: initializeObject(items)
59
- };
60
- return _objectSpread(_objectSpread({}, other), {}, {
61
- props: otherProps,
62
- children: children.map(function (item) {
63
- return initializeAddition(item);
64
- }),
65
- items: renderItemsMap[itemType]
18
+ var items = item.items;
19
+ return _objectSpread(_objectSpread({}, item), {}, {
20
+ items: items ? initializeItems(items) : {}
66
21
  });
67
22
  };
68
23
 
@@ -1,77 +1,23 @@
1
- var _excluded = ["props", "children", "items"],
2
- _excluded2 = ["itemType", "title"];
3
-
4
- 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; }
5
-
6
- 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; }
7
-
8
1
  function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
9
2
 
10
3
  function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
11
4
 
12
5
  function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
13
6
 
14
- var initializeChildren = function initializeChildren(item) {
15
- return item;
16
- };
7
+ var initializeItems = function initializeItems(items) {
8
+ if (items) {
9
+ return _objectSpread(_objectSpread({}, items), {}, {
10
+ name: 'items'
11
+ });
12
+ }
17
13
 
18
- var initializeAddition = function initializeAddition(item) {
19
- return _objectSpread(_objectSpread({}, item), {}, {
20
- component: 'ArrayCollapse.Addition'
21
- });
22
- };
23
-
24
- var initializeString = function initializeString(items, props) {
25
- return [{
26
- name: 'items',
27
- component: 'ArrayCollapse.CollapsePanel',
28
- props: props,
29
- children: items.map(function (item) {
30
- return initializeChildren(item);
31
- })
32
- }];
33
- };
34
-
35
- var initializeObject = function initializeObject(items, props) {
36
- return [{
37
- type: 'object',
38
- name: 'items',
39
- component: 'ArrayCollapse.CollapsePanel',
40
- props: props,
41
- children: items.map(function (item) {
42
- return initializeChildren(item);
43
- })
44
- }];
14
+ return items;
45
15
  };
46
16
 
47
17
  var initialize = function initialize(item) {
48
- var _item$props = item.props,
49
- props = _item$props === void 0 ? {} : _item$props,
50
- _item$children = item.children,
51
- children = _item$children === void 0 ? [] : _item$children,
52
- _item$items = item.items,
53
- items = _item$items === void 0 ? [] : _item$items,
54
- other = _objectWithoutProperties(item, _excluded);
55
-
56
- var _props$itemType = props.itemType,
57
- itemType = _props$itemType === void 0 ? 'string' : _props$itemType,
58
- title = props.title,
59
- otherProps = _objectWithoutProperties(props, _excluded2);
60
-
61
- var renderItemsMap = {
62
- string: initializeString(items, {
63
- title: title
64
- }),
65
- object: initializeObject(items, {
66
- title: title
67
- })
68
- };
69
- return _objectSpread(_objectSpread({}, other), {}, {
70
- props: otherProps,
71
- children: children.map(function (item) {
72
- return initializeAddition(item);
73
- }),
74
- items: renderItemsMap[itemType]
18
+ var items = item.items;
19
+ return _objectSpread(_objectSpread({}, item), {}, {
20
+ items: items ? initializeItems(items) : {}
75
21
  });
76
22
  };
77
23
 
@@ -1,4 +1,5 @@
1
- var _excluded = ["component", "props"];
1
+ var _excluded = ["component", "props"],
2
+ _excluded2 = ["icon"];
2
3
 
3
4
  function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
4
5
 
@@ -15,12 +16,18 @@ import TeamixIcon from '@teamix/icon';
15
16
 
16
17
  var initialize = function initialize(item) {
17
18
  var component = item.component,
18
- props = item.props,
19
+ _item$props = item.props,
20
+ props = _item$props === void 0 ? {} : _item$props,
19
21
  other = _objectWithoutProperties(item, _excluded);
20
22
 
23
+ var icon = props.icon,
24
+ otherProps = _objectWithoutProperties(props, _excluded2);
25
+
21
26
  var iconType = '';
22
27
 
23
- if (component) {
28
+ if (icon) {
29
+ iconType = icon;
30
+ } else if (component) {
24
31
  if (/Addition/.test(component)) {
25
32
  iconType = 'add-line';
26
33
  } else if (/Remove/.test(component)) {
@@ -38,12 +45,12 @@ var initialize = function initialize(item) {
38
45
  component: component,
39
46
  props: _objectSpread({
40
47
  icon: function icon(props) {
41
- return /*#__PURE__*/React.createElement(TeamixIcon, _objectSpread({
48
+ return /*#__PURE__*/React.createElement(TeamixIcon, _objectSpread(_objectSpread({}, props), {}, {
42
49
  type: iconType,
43
50
  size: "small"
44
- }, props));
51
+ }));
45
52
  }
46
- }, props)
53
+ }, otherProps)
47
54
  });
48
55
  };
49
56
 
@@ -1,96 +1,37 @@
1
- var _excluded = ["decoratorProps"],
2
- _excluded2 = ["props", "children", "items"];
3
-
4
1
  function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
5
2
 
6
3
  function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
7
4
 
8
5
  function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
9
6
 
10
- 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; }
7
+ var initializeItems = function initializeItems(items) {
8
+ if (items) {
9
+ return _objectSpread(_objectSpread({}, items), {}, {
10
+ name: 'items'
11
+ });
12
+ }
11
13
 
12
- 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; }
14
+ return items;
15
+ };
13
16
 
14
17
  var initializeChildren = function initializeChildren(item) {
15
- var decoratorProps = item.decoratorProps,
16
- otherProps = _objectWithoutProperties(item, _excluded);
17
-
18
- return _objectSpread({
18
+ var decoratorProps = item.decoratorProps;
19
+ return _objectSpread(_objectSpread({}, item), decoratorProps ? {
19
20
  decoratorProps: _objectSpread({
20
21
  feedbackLayout: 'none'
21
22
  }, decoratorProps)
22
- }, otherProps);
23
- };
24
-
25
- var initializeAddition = function initializeAddition(item) {
26
- return _objectSpread(_objectSpread({}, item), {}, {
27
- component: 'ArrayItems.Addition'
28
- });
29
- };
30
-
31
- var initializeString = function initializeString(items, props) {
32
- return [{
33
- name: 'items',
34
- component: 'FormFlex',
35
- props: props,
36
- decoratorProps: {
37
- feedbackLayout: 'none'
38
- },
39
- children: items.map(function (item) {
40
- return initializeChildren(item);
41
- })
42
- }];
43
- };
44
-
45
- var initializeObject = function initializeObject(items, props) {
46
- return [{
47
- name: 'items',
48
- type: 'object',
49
- children: [{
50
- component: 'FormFlex',
51
- props: props,
52
- children: items.map(function (item) {
53
- return initializeChildren(item);
54
- })
55
- }]
56
- }];
57
- };
58
-
59
- var initializeItems = function initializeItems(items, decoratorProps) {
60
- return [{
61
- name: 'items',
62
- type: 'object',
63
- decorator: 'ArrayItems.Item',
64
- decoratorProps: decoratorProps,
65
- children: items
66
- }];
23
+ } : {});
67
24
  };
68
25
 
69
26
  var initialize = function initialize(item) {
70
- var _item$props = item.props,
71
- props = _item$props === void 0 ? {} : _item$props,
72
- _item$children = item.children,
27
+ var _item$children = item.children,
73
28
  children = _item$children === void 0 ? [] : _item$children,
74
- _item$items = item.items,
75
- items = _item$items === void 0 ? [] : _item$items,
76
- otherProps = _objectWithoutProperties(item, _excluded2);
77
-
78
- var _props$itemType = props.itemType,
79
- itemType = _props$itemType === void 0 ? 'string' : _props$itemType,
80
- _props$itemTypeProps = props.itemTypeProps,
81
- itemTypeProps = _props$itemTypeProps === void 0 ? {} : _props$itemTypeProps;
82
- var renderItemsMap = {
83
- string: initializeString(items, itemTypeProps),
84
- object: initializeObject(items, itemTypeProps),
85
- card: initializeItems(items, {
86
- type: 'card'
87
- })
88
- };
89
- return _objectSpread(_objectSpread({}, otherProps), {}, {
29
+ items = item.items;
30
+ return _objectSpread(_objectSpread({}, item), {}, {
90
31
  children: children.map(function (item) {
91
- return initializeAddition(item);
32
+ return initializeChildren(item);
92
33
  }),
93
- items: renderItemsMap[itemType]
34
+ items: items ? initializeItems(items) : {}
94
35
  });
95
36
  };
96
37
 
@@ -1,9 +1,4 @@
1
- var _excluded = ["title", "decoratorProps"],
2
- _excluded2 = ["props", "children", "items"];
3
-
4
- 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; }
5
-
6
- 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; }
1
+ var _excluded = ["title", "decoratorProps"];
7
2
 
8
3
  function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
9
4
 
@@ -11,55 +6,50 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
11
6
 
12
7
  function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
13
8
 
14
- var initializeChildren = function initializeChildren(item) {
15
- return _objectSpread(_objectSpread({}, item), {}, {
16
- component: 'ArrayTable.Addition'
17
- });
18
- };
9
+ 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; }
10
+
11
+ 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; }
19
12
 
20
13
  var initializeColumn = function initializeColumn(item) {
21
14
  var title = item.title,
22
15
  decoratorProps = item.decoratorProps,
23
- otherProps = _objectWithoutProperties(item, _excluded);
16
+ children = _objectWithoutProperties(item, _excluded);
24
17
 
25
- return _objectSpread(_objectSpread({}, otherProps), {}, {
18
+ return {
26
19
  component: 'ArrayTable.Column',
27
20
  props: _objectSpread(_objectSpread({}, decoratorProps), {}, {
28
21
  title: title
29
22
  }),
30
- children: [_objectSpread({}, otherProps)]
31
- });
23
+ children: [_objectSpread({}, children)]
24
+ };
32
25
  };
33
26
 
34
27
  var initializeItems = function initializeItems(items) {
35
- return [{
36
- name: 'items',
37
- type: 'object',
38
- children: items.map(function (item) {
39
- return initializeColumn(item);
40
- })
41
- }];
28
+ if (items) {
29
+ var _items$children;
30
+
31
+ return _objectSpread(_objectSpread({}, items), {}, {
32
+ name: 'items',
33
+ children: (_items$children = items.children) === null || _items$children === void 0 ? void 0 : _items$children.map(function (item) {
34
+ return initializeColumn(item);
35
+ })
36
+ });
37
+ }
38
+
39
+ return items;
42
40
  };
43
41
 
44
42
  var initialize = function initialize(item) {
45
43
  var _item$props = item.props,
46
44
  props = _item$props === void 0 ? {} : _item$props,
47
- _item$children = item.children,
48
- children = _item$children === void 0 ? [] : _item$children,
49
- _item$items = item.items,
50
- items = _item$items === void 0 ? [] : _item$items,
51
- otherProps = _objectWithoutProperties(item, _excluded2);
52
-
53
- return _objectSpread(_objectSpread({}, otherProps), {}, {
45
+ items = item.items;
46
+ return _objectSpread(_objectSpread({}, item), {}, {
54
47
  props: _objectSpread({
55
48
  pagination: {
56
49
  pageSize: 10
57
50
  }
58
51
  }, props),
59
- children: children.map(function (item) {
60
- return initializeChildren(item);
61
- }),
62
- items: initializeItems(items)
52
+ items: items ? initializeItems(items) : {}
63
53
  });
64
54
  };
65
55
 
@@ -28,7 +28,7 @@ export interface IFormSchemaItem {
28
28
  dataSource?: any[];
29
29
  reactions?: any;
30
30
  rules?: any;
31
- items?: IFormSchemaItem[];
31
+ items?: IFormSchemaItem;
32
32
  children?: IFormSchemaItem[];
33
33
  content?: any;
34
34
  tooltip?: string;
@@ -44,11 +44,8 @@ export interface IFormSchemaItem {
44
44
  request?: IRequestConfig;
45
45
  }
46
46
  export declare type IFormSchema = IFormSchemaItem[];
47
- export interface IInitialize {
48
- (items: IFormSchemaItem[], props?: any): IFormSchemaItem[];
49
- }
50
47
  export interface IInitializeItem {
51
- (items: IFormSchemaItem, props?: any): IFormSchemaItem;
48
+ (item: IFormSchemaItem, props?: any): IFormSchemaItem;
52
49
  }
53
50
  export interface IFormProps extends IFormLayoutProps {
54
51
  form?: FormType | false;
package/es/index.d.ts CHANGED
@@ -20,5 +20,5 @@ export * from './page-container';
20
20
  export * from './page-header';
21
21
  export * from './skeleton';
22
22
  export * from './table';
23
- declare const version = "1.1.5";
23
+ declare const version = "1.1.6";
24
24
  export { version, ProAction, ProCard, ProField, ProForm, ProInfo, ProPageContainer, ProPageHeader, ProSkeleton, ProTable, hooks, nocode, templates, utils, };
package/es/index.js CHANGED
@@ -24,6 +24,6 @@ export * from './page-container';
24
24
  export * from './page-header';
25
25
  export * from './skeleton';
26
26
  export * from './table';
27
- var version = '1.1.5';
27
+ var version = '1.1.6';
28
28
  export { version, ProAction, ProCard, ProField, ProForm, ProInfo, // ProLayout,
29
29
  ProPageContainer, ProPageHeader, ProSkeleton, ProTable, hooks, nocode, templates, utils };
@@ -32,9 +32,7 @@ var FormItem = function FormItem(prop) {
32
32
  span: wrapperCol.span,
33
33
  className: cls('value')
34
34
  }, loading && /*#__PURE__*/React.createElement("div", {
35
- style: {
36
- width: '100%'
37
- }
35
+ className: cls('base-skeleton-box')
38
36
  }, /*#__PURE__*/React.createElement(BaseSkeleton.Info, null)), !loading && /*#__PURE__*/React.createElement("div", null, value))));
39
37
  }
40
38
 
@@ -54,7 +52,9 @@ var FormItem = function FormItem(prop) {
54
52
  style: {
55
53
  marginLeft: labelGutter
56
54
  }
57
- }, loading && /*#__PURE__*/React.createElement(BaseSkeleton.Info, null), !loading && /*#__PURE__*/React.createElement(React.Fragment, null, value))));
55
+ }, loading && /*#__PURE__*/React.createElement("div", {
56
+ className: cls('base-skeleton-box')
57
+ }, /*#__PURE__*/React.createElement(BaseSkeleton.Info, null)), !loading && /*#__PURE__*/React.createElement(React.Fragment, null, value))));
58
58
  }
59
59
 
60
60
  return /*#__PURE__*/React.createElement(React.Fragment, null);
@@ -31,6 +31,7 @@ $item-padding-bottom: 8px;
31
31
  font-size: $text-size;
32
32
  display: unset;
33
33
  width: 100%;
34
+ padding-right: 20px;
34
35
  }
35
36
 
36
37
  .teamix-pro-field-info-form-item-header-label {
@@ -47,3 +48,13 @@ $item-padding-bottom: 8px;
47
48
  display: inline-block;
48
49
  width: 100%;
49
50
  }
51
+
52
+ .teamix-pro-field-info-form-item-base-skeleton-box {
53
+ width: 100%;
54
+ height: 100%;
55
+ display: flex;
56
+ align-items: center;
57
+ span {
58
+ width: 100%
59
+ }
60
+ }
@@ -55,7 +55,18 @@ var InfoValueItem = function InfoValueItem(props) {
55
55
  _infoItem$successMess = infoItem.successMessage,
56
56
  successMessage = _infoItem$successMess === void 0 ? 'success' : _infoItem$successMess,
57
57
  actions = infoItem.actions,
58
- extra = infoItem.extra; // 浮层的显隐状态
58
+ extra = infoItem.extra; // 由info接管field中的value。重新实现
59
+ // let fieldRender = render;
60
+ // let newValue = value;
61
+ // if (render && typeof render !== 'function') {
62
+ // const { value, ...others } = render;
63
+ // fieldRender = others;
64
+ // if (value) {
65
+ // newValue = getTargetValue(`${value}`, { ...record, record });
66
+ // console.log("newValue", newValue);
67
+ // }
68
+ // }
69
+ // 浮层的显隐状态
59
70
 
60
71
  var _useState = useState(false),
61
72
  _useState2 = _slicedToArray(_useState, 2),
@@ -11,10 +11,9 @@ import FormItem from '../FormItem';
11
11
  import './index.scss';
12
12
  import { useSize } from '@teamix/hooks';
13
13
  import { getLayout } from '../../utils/utils';
14
- import { getTargetValue } from '@teamix/utils';
15
14
  import defaultLayoutMap from '../../utils/layout';
16
15
  import InfoValueItem from '../InfoValueItem';
17
- import { ProInfoGroupContext } from '../../utils';
16
+ import { getDataIndexValue, ProInfoGroupContext } from '../../utils';
18
17
  var Row = Grid.Row,
19
18
  Col = Grid.Col;
20
19
 
@@ -34,7 +33,7 @@ var ProBaseInfo = function ProBaseInfo(props) {
34
33
 
35
34
  var renderContent = function renderContent() {
36
35
  return columns.map(function (item, index) {
37
- var _item$title, _item$valueType, _item$dataIndex;
36
+ var _item$title, _item$valueType;
38
37
 
39
38
  var span = item.colSpan ? defaultLayout.span * item.colSpan : defaultLayout.span;
40
39
  return /*#__PURE__*/React.createElement(Col, {
@@ -45,7 +44,7 @@ var ProBaseInfo = function ProBaseInfo(props) {
45
44
  loading: loading,
46
45
  value: /*#__PURE__*/React.createElement(InfoValueItem, {
47
46
  type: (_item$valueType = item === null || item === void 0 ? void 0 : item.valueType) !== null && _item$valueType !== void 0 ? _item$valueType : 'text',
48
- value: getTargetValue("{{".concat((_item$dataIndex = item === null || item === void 0 ? void 0 : item.dataIndex) !== null && _item$dataIndex !== void 0 ? _item$dataIndex : '', "}}"), dataSource !== null && dataSource !== void 0 ? dataSource : result),
47
+ value: getDataIndexValue(item.dataIndex, dataSource !== null && dataSource !== void 0 ? dataSource : result),
49
48
  render: item.render,
50
49
  dataSource: item.dataSource,
51
50
  infoItem: item,
@@ -6,7 +6,6 @@ function _defineProperty(obj, key, value) { if (key in obj) { Object.definePrope
6
6
 
7
7
  import { Grid } from '@alicloudfe/components';
8
8
  import ProCard from '../../../card';
9
- import { getTargetValue } from '@teamix/utils';
10
9
  import React, { useContext, useRef } from 'react';
11
10
  import FormItem from '../FormItem';
12
11
  import './index.scss';
@@ -14,7 +13,7 @@ import defaultLayoutMap from '../../utils/layout';
14
13
  import { useSize } from '@teamix/hooks';
15
14
  import { getLayout } from '../../utils/utils';
16
15
  import InfoValueItem from '../InfoValueItem';
17
- import { ProInfoGroupContext } from '../../utils';
16
+ import { getDataIndexValue, ProInfoGroupContext } from '../../utils';
18
17
  var Row = Grid.Row,
19
18
  Col = Grid.Col;
20
19
 
@@ -35,7 +34,7 @@ var ProHeaderInfo = function ProHeaderInfo(props) {
35
34
 
36
35
  var renderContent = function renderContent() {
37
36
  return columns.map(function (item, index) {
38
- var _item$title, _item$valueType, _item$dataIndex;
37
+ var _item$title, _item$valueType;
39
38
 
40
39
  var span = 24;
41
40
 
@@ -57,7 +56,7 @@ var ProHeaderInfo = function ProHeaderInfo(props) {
57
56
  loading: loading,
58
57
  value: /*#__PURE__*/React.createElement(InfoValueItem, {
59
58
  type: (_item$valueType = item === null || item === void 0 ? void 0 : item.valueType) !== null && _item$valueType !== void 0 ? _item$valueType : 'text',
60
- value: getTargetValue("{{".concat((_item$dataIndex = item === null || item === void 0 ? void 0 : item.dataIndex) !== null && _item$dataIndex !== void 0 ? _item$dataIndex : '', "}}"), dataSource !== null && dataSource !== void 0 ? dataSource : result),
59
+ value: getDataIndexValue(item.dataIndex, dataSource !== null && dataSource !== void 0 ? dataSource : result),
61
60
  render: item.render,
62
61
  dataSource: item.dataSource,
63
62
  infoItem: item,