@teamix/pro 1.1.4 → 1.1.8

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 (142) hide show
  1. package/README.md +97 -0
  2. package/dist/212.js +2 -2
  3. package/dist/pro.css +1 -1
  4. package/dist/pro.js +3147 -1872
  5. package/dist/pro.min.css +1 -1
  6. package/dist/pro.min.js +1 -1
  7. package/dist/pro.min.js.LICENSE.txt +1 -1
  8. package/es/actions/dialog-form.d.ts +3 -3
  9. package/es/actions/dialog-table.d.ts +6 -1
  10. package/es/actions/dialog-table.js +10 -1
  11. package/es/actions/drawer-table.d.ts +4 -0
  12. package/es/actions/drawer-table.js +7 -1
  13. package/es/actions/index.d.ts +6 -11
  14. package/es/actions/index.js +41 -21
  15. package/es/actions/index.scss +1 -1
  16. package/es/card/index.d.ts +17 -0
  17. package/es/form/Components/ProField/index.d.ts +8 -0
  18. package/es/form/ProForm/index.d.ts +2 -2
  19. package/es/form/ProForm/index.js +9 -2
  20. package/es/form/ProForm/index.scss +40 -7
  21. package/es/form/SchemaForm/adapterType.js +3 -3
  22. package/es/form/SchemaForm/index.d.ts +2 -2
  23. package/es/form/SchemaForm/index.js +9 -5
  24. package/es/form/SchemaForm/initializeArrayCards.js +10 -55
  25. package/es/form/SchemaForm/initializeArrayCollapse.js +10 -64
  26. package/es/form/SchemaForm/initializeArrayIcon.js +19 -7
  27. package/es/form/SchemaForm/initializeArrayItems.js +16 -75
  28. package/es/form/SchemaForm/initializeArrayTable.js +23 -33
  29. package/es/form/SchemaForm/initializeFormButton.js +35 -38
  30. package/es/form/SchemaForm/initializeFormGroup.d.ts +2 -2
  31. package/es/form/SchemaForm/initializeFormStep.d.ts +4 -2
  32. package/es/form/SchemaForm/initializeFormStep.js +21 -7
  33. package/es/form/SchemaForm/initializeFormTab.d.ts +2 -2
  34. package/es/form/SchemaForm/initializeProField.js +3 -3
  35. package/es/form/SchemaForm/reactions.d.ts +1 -1
  36. package/es/form/SchemaForm/reactions.js +2 -2
  37. package/es/form/index.d.ts +17 -9
  38. package/es/form/index.js +21 -9
  39. package/es/form/typing.d.ts +13 -22
  40. package/es/form/warning.js +2 -6
  41. package/es/index.d.ts +4 -3
  42. package/es/index.js +4 -3
  43. package/es/info/components/FormItem/index.js +4 -4
  44. package/es/info/components/FormItem/index.scss +11 -0
  45. package/es/info/components/InfoGroup/index.js +37 -6
  46. package/es/info/components/InfoGroup/index.scss +6 -0
  47. package/es/info/components/InfoValueItem/index.js +14 -2
  48. package/es/info/components/baseInfo/index.js +10 -9
  49. package/es/info/components/headerInfo/index.js +10 -9
  50. package/es/info/components/tableInfo/index.js +7 -4
  51. package/es/info/components/tableInfo/index.scss +1 -1
  52. package/es/info/index.d.ts +1 -0
  53. package/es/info/index.js +9 -7
  54. package/es/info/index.scss +4 -0
  55. package/es/info/typing.d.ts +17 -3
  56. package/es/info/utils/index.d.ts +11 -2
  57. package/es/info/utils/index.js +21 -0
  58. package/es/nocode/configurators/PageHeader.js +49 -43
  59. package/es/nocode/configurators/ProTable.js +12 -9
  60. package/es/nocode/configurators/common.d.ts +117 -105
  61. package/es/nocode/configurators/common.js +38 -34
  62. package/es/nocode/index.scss +1 -4
  63. package/es/page-header/index.d.ts +3 -0
  64. package/es/page-header/index.js +40 -13
  65. package/es/page-header/index.scss +6 -4
  66. package/es/table/components/Filter/index.js +8 -16
  67. package/es/table/components/Layout/index.js +2 -1
  68. package/es/table/components/Layout/index.scss +1 -1
  69. package/es/table/components/ToolBar/FilterColumnIcon.js +77 -17
  70. package/es/table/components/ToolBar/index.scss +10 -0
  71. package/es/table/index.d.ts +0 -1
  72. package/es/table/index.js +75 -56
  73. package/es/table/index.scss +0 -1
  74. package/es/table/typing.d.ts +3 -1
  75. package/lib/actions/dialog-form.d.ts +3 -3
  76. package/lib/actions/dialog-table.d.ts +6 -1
  77. package/lib/actions/dialog-table.js +20 -1
  78. package/lib/actions/drawer-table.d.ts +4 -0
  79. package/lib/actions/drawer-table.js +14 -1
  80. package/lib/actions/index.d.ts +6 -11
  81. package/lib/actions/index.js +44 -20
  82. package/lib/actions/index.scss +1 -1
  83. package/lib/card/index.d.ts +17 -0
  84. package/lib/form/Components/ProField/index.d.ts +8 -0
  85. package/lib/form/ProForm/index.d.ts +2 -2
  86. package/lib/form/ProForm/index.js +10 -2
  87. package/lib/form/ProForm/index.scss +40 -7
  88. package/lib/form/SchemaForm/adapterType.js +3 -3
  89. package/lib/form/SchemaForm/index.d.ts +2 -2
  90. package/lib/form/SchemaForm/index.js +10 -5
  91. package/lib/form/SchemaForm/initializeArrayCards.js +10 -54
  92. package/lib/form/SchemaForm/initializeArrayCollapse.js +10 -63
  93. package/lib/form/SchemaForm/initializeArrayIcon.js +19 -7
  94. package/lib/form/SchemaForm/initializeArrayItems.js +16 -74
  95. package/lib/form/SchemaForm/initializeArrayTable.js +23 -33
  96. package/lib/form/SchemaForm/initializeFormButton.js +35 -38
  97. package/lib/form/SchemaForm/initializeFormGroup.d.ts +2 -2
  98. package/lib/form/SchemaForm/initializeFormStep.d.ts +4 -2
  99. package/lib/form/SchemaForm/initializeFormStep.js +21 -7
  100. package/lib/form/SchemaForm/initializeFormTab.d.ts +2 -2
  101. package/lib/form/SchemaForm/initializeProField.js +3 -3
  102. package/lib/form/SchemaForm/reactions.d.ts +1 -1
  103. package/lib/form/SchemaForm/reactions.js +2 -2
  104. package/lib/form/index.d.ts +17 -9
  105. package/lib/form/index.js +81 -56
  106. package/lib/form/typing.d.ts +13 -22
  107. package/lib/form/warning.js +2 -6
  108. package/lib/index.d.ts +4 -3
  109. package/lib/index.js +16 -4
  110. package/lib/info/components/FormItem/index.js +4 -4
  111. package/lib/info/components/FormItem/index.scss +11 -0
  112. package/lib/info/components/InfoGroup/index.js +46 -6
  113. package/lib/info/components/InfoGroup/index.scss +6 -0
  114. package/lib/info/components/InfoValueItem/index.js +15 -3
  115. package/lib/info/components/baseInfo/index.js +10 -9
  116. package/lib/info/components/headerInfo/index.js +11 -10
  117. package/lib/info/components/tableInfo/index.js +7 -3
  118. package/lib/info/components/tableInfo/index.scss +1 -1
  119. package/lib/info/index.d.ts +1 -0
  120. package/lib/info/index.js +8 -6
  121. package/lib/info/index.scss +4 -0
  122. package/lib/info/typing.d.ts +17 -3
  123. package/lib/info/utils/index.d.ts +11 -2
  124. package/lib/info/utils/index.js +31 -0
  125. package/lib/nocode/configurators/PageHeader.js +49 -43
  126. package/lib/nocode/configurators/ProTable.js +12 -9
  127. package/lib/nocode/configurators/common.d.ts +117 -105
  128. package/lib/nocode/configurators/common.js +38 -34
  129. package/lib/nocode/index.scss +1 -4
  130. package/lib/page-header/index.d.ts +3 -0
  131. package/lib/page-header/index.js +42 -13
  132. package/lib/page-header/index.scss +6 -4
  133. package/lib/table/components/Filter/index.js +7 -15
  134. package/lib/table/components/Layout/index.js +2 -1
  135. package/lib/table/components/Layout/index.scss +1 -1
  136. package/lib/table/components/ToolBar/FilterColumnIcon.js +75 -16
  137. package/lib/table/components/ToolBar/index.scss +10 -0
  138. package/lib/table/index.d.ts +0 -1
  139. package/lib/table/index.js +76 -65
  140. package/lib/table/index.scss +0 -1
  141. package/lib/table/typing.d.ts +3 -1
  142. package/package.json +5 -5
@@ -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,6 @@
1
- var _excluded = ["component", "props"];
1
+ var _excluded = ["component", "props"],
2
+ _excluded2 = ["icon"],
3
+ _excluded3 = ["text", "type"];
2
4
 
3
5
  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
6
 
@@ -15,12 +17,18 @@ import TeamixIcon from '@teamix/icon';
15
17
 
16
18
  var initialize = function initialize(item) {
17
19
  var component = item.component,
18
- props = item.props,
20
+ _item$props = item.props,
21
+ props = _item$props === void 0 ? {} : _item$props,
19
22
  other = _objectWithoutProperties(item, _excluded);
20
23
 
24
+ var icon = props.icon,
25
+ otherProps = _objectWithoutProperties(props, _excluded2);
26
+
21
27
  var iconType = '';
22
28
 
23
- if (component) {
29
+ if (icon) {
30
+ iconType = icon;
31
+ } else if (component) {
24
32
  if (/Addition/.test(component)) {
25
33
  iconType = 'add-line';
26
34
  } else if (/Remove/.test(component)) {
@@ -37,13 +45,17 @@ var initialize = function initialize(item) {
37
45
  return _objectSpread(_objectSpread({}, other), {}, {
38
46
  component: component,
39
47
  props: _objectSpread({
40
- icon: function icon(props) {
41
- return /*#__PURE__*/React.createElement(TeamixIcon, _objectSpread({
48
+ icon: function icon(_ref) {
49
+ var text = _ref.text,
50
+ type = _ref.type,
51
+ props = _objectWithoutProperties(_ref, _excluded3);
52
+
53
+ return /*#__PURE__*/React.createElement(TeamixIcon, _objectSpread(_objectSpread({}, props), {}, {
42
54
  type: iconType,
43
55
  size: "small"
44
- }, props));
56
+ }));
45
57
  }
46
- }, props)
58
+ }, otherProps)
47
59
  });
48
60
  };
49
61
 
@@ -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
 
@@ -1,5 +1,8 @@
1
- var _excluded = ["component", "props"],
2
- _excluded2 = ["props", "component"];
1
+ var _excluded = ["sticky"];
2
+
3
+ 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; }
4
+
5
+ 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; }
3
6
 
4
7
  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
8
 
@@ -7,10 +10,6 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
7
10
 
8
11
  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
12
 
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; }
11
-
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; }
13
-
14
13
  var buttonTextMap = {
15
14
  Submit: '提交',
16
15
  Reset: '重置'
@@ -18,58 +17,56 @@ var buttonTextMap = {
18
17
 
19
18
  var initializeButton = function initializeButton(item) {
20
19
  var component = item.component,
21
- props = item.props,
22
- otherProps = _objectWithoutProperties(item, _excluded);
23
-
24
- return _objectSpread({
20
+ _item$props = item.props,
21
+ props = _item$props === void 0 ? {} : _item$props;
22
+ return _objectSpread(_objectSpread({}, item), {}, {
25
23
  component: component,
26
24
  props: _objectSpread({
27
25
  children: buttonTextMap[component]
28
26
  }, props)
29
- }, otherProps);
27
+ });
30
28
  };
31
29
 
32
30
  var initialize = function initialize(item) {
33
- var _item$props = item.props,
34
- props = _item$props === void 0 ? {} : _item$props,
35
- component = item.component,
36
- otherProps = _objectWithoutProperties(item, _excluded2);
31
+ var component = item.component,
32
+ _item$props2 = item.props,
33
+ props = _item$props2 === void 0 ? {} : _item$props2,
34
+ _item$decoratorProps = item.decoratorProps,
35
+ decoratorProps = _item$decoratorProps === void 0 ? {} : _item$decoratorProps;
37
36
 
38
37
  var sticky = props.sticky,
39
- align = props.align,
40
- gutter = props.gutter;
41
- var alignProps = align ? {
42
- align: align
43
- } : {};
44
- var gutterProps = gutter ? {
45
- gutter: gutter
46
- } : {};
38
+ otherProps = _objectWithoutProperties(props, _excluded); // 单个按钮
39
+
47
40
 
48
41
  if (component && ['Submit', 'Reset'].includes(component)) {
49
42
  return initializeButton(item);
50
43
  }
51
44
 
52
- var decoratorTemp = {
53
- title: ' ',
45
+ var commonMode = _objectSpread(_objectSpread({
46
+ title: ' '
47
+ }, item), {}, {
48
+ component: component,
49
+ props: otherProps,
54
50
  decorator: 'FormButtonGroup.FormItem',
55
- decoratorProps: {
51
+ decoratorProps: _objectSpread({
56
52
  inset: false
57
- },
58
- props: _objectSpread(_objectSpread({}, alignProps), gutterProps)
59
- };
53
+ }, decoratorProps)
54
+ }); // 吸底模式
55
+
60
56
 
61
57
  if (sticky) {
62
- decoratorTemp = {
63
- title: '',
64
- decorator: 'FormButtonGroup.Sticky',
65
- decoratorProps: _objectSpread({}, alignProps),
66
- props: _objectSpread({}, gutterProps)
58
+ return {
59
+ component: 'Affix',
60
+ props: {
61
+ offsetBottom: 0,
62
+ className: 'teamix-pro-form-button-affix'
63
+ },
64
+ children: [commonMode]
67
65
  };
68
- }
66
+ } // 普通模式
67
+
69
68
 
70
- return _objectSpread(_objectSpread({
71
- component: component
72
- }, decoratorTemp), otherProps);
69
+ return commonMode;
73
70
  };
74
71
 
75
72
  export default initialize;
@@ -1,3 +1,3 @@
1
- import type { ISchemaProItem } from '../typing';
2
- declare const initialize: (item: ISchemaProItem) => ISchemaProItem;
1
+ import type { IFormSchemaItem } from '../typing';
2
+ declare const initialize: (item: IFormSchemaItem) => IFormSchemaItem;
3
3
  export default initialize;
@@ -1,3 +1,5 @@
1
- import type { ISchemaProItem } from '../typing';
2
- declare const initialize: (item: ISchemaProItem) => ISchemaProItem;
1
+ import type { IFormSchemaItem } from '../typing';
2
+ declare const initialize: (item: IFormSchemaItem & {
3
+ col?: number;
4
+ }) => IFormSchemaItem;
3
5
  export default initialize;
@@ -1,5 +1,5 @@
1
1
  var _excluded = ["props", "children", "title"],
2
- _excluded2 = ["props", "children"];
2
+ _excluded2 = ["col", "style"];
3
3
 
4
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; }
5
5
 
@@ -11,6 +11,13 @@ function _objectWithoutProperties(source, excluded) { if (source == null) return
11
11
 
12
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; }
13
13
 
14
+ var getWidth = function getWidth(col, length) {
15
+ var newCol = col !== null && col !== void 0 ? col : (length + 1) * 4;
16
+ newCol = newCol > 24 ? 24 : newCol;
17
+ var width = 100 / 24 * newCol;
18
+ return "".concat(width, "%");
19
+ };
20
+
14
21
  var initializeStepPane = function initializeStepPane(item) {
15
22
  var _item$props = item.props,
16
23
  props = _item$props === void 0 ? {} : _item$props,
@@ -32,17 +39,24 @@ var initialize = function initialize(item) {
32
39
  var _item$props2 = item.props,
33
40
  props = _item$props2 === void 0 ? {} : _item$props2,
34
41
  _item$children2 = item.children,
35
- children = _item$children2 === void 0 ? [] : _item$children2,
36
- otherProps = _objectWithoutProperties(item, _excluded2);
42
+ children = _item$children2 === void 0 ? [] : _item$children2;
37
43
 
38
- return _objectSpread({
44
+ var col = props.col,
45
+ style = props.style,
46
+ otherProps = _objectWithoutProperties(props, _excluded2);
47
+
48
+ var width = getWidth(col, children.length);
49
+ return _objectSpread(_objectSpread({}, item), {}, {
39
50
  props: _objectSpread({
40
- labelPlacement: 'hoz'
41
- }, props),
51
+ labelPlacement: 'hoz',
52
+ style: _objectSpread({
53
+ width: width
54
+ }, style)
55
+ }, otherProps),
42
56
  children: children.map(function (item) {
43
57
  return initializeStepPane(item);
44
58
  })
45
- }, otherProps);
59
+ });
46
60
  };
47
61
 
48
62
  export default initialize;
@@ -1,3 +1,3 @@
1
- import type { ISchemaProItem } from '../typing';
2
- declare const initialize: (item: ISchemaProItem) => ISchemaProItem;
1
+ import type { IFormSchemaItem } from '../typing';
2
+ declare const initialize: (item: IFormSchemaItem) => IFormSchemaItem;
3
3
  export default initialize;
@@ -34,7 +34,7 @@ var proFieldTypeMap = {
34
34
  YearPicker: 'dateYear',
35
35
  QuarterPicker: 'dateQuarter',
36
36
  DateRangePicker: 'dateRange',
37
- // TimeRangePicker: 'timeRange',
37
+ TimeRangePicker: 'timeRange',
38
38
  DateTimeRangePicker: 'dateTimeRange',
39
39
  WeekRangePicker: 'dateWeekRange',
40
40
  MonthRangePicker: 'dateMonthRange',
@@ -43,10 +43,10 @@ var proFieldTypeMap = {
43
43
  Transfer: 'transfer',
44
44
  ColorPicker: 'color',
45
45
  ColorRadio: 'colorRadio',
46
- ColorSwatches: 'colorSwatches',
47
- ColorTwitter: 'colorTwitter',
48
46
  IconPicker: 'icon',
49
47
  JsonInput: 'json',
48
+ TagPicker: 'tagFilter',
49
+ Range: 'range',
50
50
  Search: 'search' // Upload: 'upload',
51
51
 
52
52
  };
@@ -1,4 +1,4 @@
1
- import type { IRequestConfig } from '../';
1
+ import type { IRequestConfig } from '../typing';
2
2
  declare const useRequest: (requestConfig: IRequestConfig) => (field: any) => Promise<any>;
3
3
  declare const useAsyncDataSource: (services: any) => (field: any) => void;
4
4
  export { useRequest, useAsyncDataSource };
@@ -7,7 +7,7 @@ var useRequest = function useRequest(requestConfig) {
7
7
  params = requestConfig.params,
8
8
  data = requestConfig.data,
9
9
  when = requestConfig.when,
10
- formatter = requestConfig.formatter,
10
+ formatResult = requestConfig.formatResult,
11
11
  onSuccess = requestConfig.onSuccess,
12
12
  onError = requestConfig.onError;
13
13
  var whenResult = isFn(when) ? when(field) : {};
@@ -27,7 +27,7 @@ var useRequest = function useRequest(requestConfig) {
27
27
  data: newData !== null && newData !== void 0 ? newData : data
28
28
  }).then(function (data) {
29
29
  // 默认按request返回res.data.data处理
30
- var dataSource = formatter ? formatter(data, {
30
+ var dataSource = formatResult ? formatResult(data, {
31
31
  paramMap: paramMap,
32
32
  listToTree: listToTree
33
33
  }) : data;
@@ -1,20 +1,28 @@
1
1
  /**
2
- * 导出全部 @teamix/formily 方法,支持完全自主定义表单
2
+ * 导出ProForm的TS
3
+ */
4
+ export * from './typing';
5
+ /**
6
+ * 使用别名导出formily相关内容
3
7
  */
4
8
  export * as formilyCore from '@formily/core';
5
9
  export * as formilyReact from '@formily/react';
6
- export * from '@teamix/formily';
7
- export * from './Filter';
8
- export * from './typing';
10
+ export * as formilyReactive from '@formily/reactive';
11
+ export * as formilyTeamix from '@teamix/formily';
9
12
  /**
10
- * 导出常用方法等
13
+ * 导出常用formily内容,需谨慎限制
11
14
  */
12
15
  import { createForm, registerValidateRules as registerRules, registerValidateFormats as registerFormats, registerValidateLocale, setValidateLanguage } from '@formily/core';
13
- import { createSchemaField, Field, FormConsumer } from '@formily/react';
14
- import { toJS } from '@formily/reactive';
15
- export { createForm, registerRules, registerFormats, registerValidateLocale, setValidateLanguage, Field, createSchemaField, FormConsumer, toJS, };
16
+ import { FormConsumer } from '@formily/react';
17
+ import { FormDialog, FormDrawer, FormStep, FormTab, FormCollapse } from '@teamix/formily';
18
+ export { createForm, FormConsumer, FormDialog, FormDrawer, FormStep, FormTab, FormCollapse, registerRules, registerFormats, registerValidateLocale, setValidateLanguage, };
19
+ /**
20
+ * 导出 Filter 组件
21
+ */
22
+ import { AdvancedFilter, SimpleFilter, QueryFilter } from './Filter';
23
+ export { AdvancedFilter, SimpleFilter, QueryFilter };
16
24
  /**
17
- * 导出封装的 ProForm 组件,支持快速搭建表单
25
+ * 导出 ProForm 组件,支持快速搭建表单
18
26
  */
19
27
  import ProForm from './ProForm';
20
28
  export default ProForm;