@teamix/pro 1.1.39 → 1.1.40

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 (190) hide show
  1. package/README.md +14 -10
  2. package/dist/pro.css +1 -1
  3. package/dist/pro.js +2214 -4073
  4. package/dist/pro.min.css +1 -1
  5. package/dist/pro.min.js +1 -1
  6. package/es/actions/dialog-form.d.ts +5 -5
  7. package/es/actions/dialog-form.js +1 -5
  8. package/es/actions/dialog.d.ts +6 -3
  9. package/es/actions/dialog.js +12 -5
  10. package/es/actions/index.d.ts +54 -47
  11. package/es/actions/index.js +28 -22
  12. package/es/actions/index.scss +17 -2
  13. package/es/card/index.d.ts +17 -5
  14. package/es/card/index.js +16 -11
  15. package/es/form/Components/ProField/index.d.ts +1 -78
  16. package/es/form/Components/ProField/index.js +34 -40
  17. package/es/form/Filter/index.js +2 -2
  18. package/es/form/ProForm/index.d.ts +2 -2
  19. package/es/form/ProForm/index.js +1 -6
  20. package/es/form/ProForm/index.scss +19 -1
  21. package/es/form/ProForm/useFieldRequest.d.ts +5 -0
  22. package/es/form/ProForm/useFieldRequest.js +26 -0
  23. package/es/form/SchemaForm/adapterDecorator.js +2 -2
  24. package/es/form/SchemaForm/index.d.ts +2 -2
  25. package/es/form/SchemaForm/index.js +12 -21
  26. package/es/form/SchemaForm/initializeArrayCards.d.ts +2 -2
  27. package/es/form/SchemaForm/initializeArrayCollapse.d.ts +2 -2
  28. package/es/form/SchemaForm/initializeArrayItems.d.ts +2 -2
  29. package/es/form/SchemaForm/initializeArrayTable.d.ts +2 -2
  30. package/es/form/SchemaForm/initializeDataSource.d.ts +2 -2
  31. package/es/form/SchemaForm/initializeDataSource.js +2 -2
  32. package/es/form/SchemaForm/initializeFormButton.d.ts +2 -2
  33. package/es/form/SchemaForm/initializeFormCollapse.d.ts +2 -2
  34. package/es/form/SchemaForm/initializeFormGroup.d.ts +2 -2
  35. package/es/form/SchemaForm/initializeFormStep.d.ts +3 -3
  36. package/es/form/SchemaForm/initializeFormTab.d.ts +2 -2
  37. package/es/form/SchemaForm/initializeRequest.d.ts +2 -2
  38. package/es/form/SchemaForm/initializeRequest.js +2 -2
  39. package/es/form/SchemaForm/initializeRules.js +44 -16
  40. package/es/form/SchemaForm/reactions.d.ts +5 -5
  41. package/es/form/SchemaForm/reactions.js +20 -18
  42. package/es/form/fieldTypeMap.d.ts +4 -0
  43. package/es/form/fieldTypeMap.js +41 -0
  44. package/es/form/index.d.ts +92 -4
  45. package/es/form/index.js +18 -5
  46. package/es/form/schemaNameMap.js +3 -0
  47. package/es/form/typing.d.ts +44 -21
  48. package/es/form/utils.d.ts +3 -1
  49. package/es/form/utils.js +38 -1
  50. package/es/form/warning.d.ts +2 -2
  51. package/es/index.d.ts +1 -1
  52. package/es/index.js +1 -1
  53. package/es/info/components/InfoGroup/index.js +73 -15
  54. package/es/info/components/InfoGroup/index.scss +45 -3
  55. package/es/info/components/InfoValueItem/index.js +6 -4
  56. package/es/info/components/InfoValueItem/index.scss +5 -1
  57. package/es/info/components/ProInfoItem/index.js +3 -3
  58. package/es/info/components/ProInfoItem/index.scss +1 -0
  59. package/es/info/components/baseInfo/index.d.ts +2 -3
  60. package/es/info/components/headerInfo/index.d.ts +2 -3
  61. package/es/info/components/tableInfo/index.d.ts +2 -3
  62. package/es/info/components/tableInfo/index.js +2 -2
  63. package/es/info/index.js +52 -49
  64. package/es/info/typing.d.ts +52 -36
  65. package/es/info/utils/index.d.ts +2 -2
  66. package/es/info/utils/utils.d.ts +1 -1
  67. package/es/nocode/pages/renderer.js +2 -2
  68. package/es/page-header/index.d.ts +34 -21
  69. package/es/page-header/index.js +39 -30
  70. package/es/page-header/index.scss +2 -1
  71. package/es/table/components/EmptyContent/index.d.ts +2 -0
  72. package/es/table/components/EmptyContent/index.js +11 -0
  73. package/es/table/components/Filter/index.d.ts +2 -2
  74. package/es/table/components/Filter/index.js +16 -8
  75. package/es/table/components/Layout/index.js +2 -2
  76. package/es/table/components/QuickAction/index.d.ts +2 -2
  77. package/es/table/components/QuickAction/index.js +3 -3
  78. package/es/table/components/ToolBar/Fullscreen.js +1 -0
  79. package/es/table/index.js +76 -14
  80. package/es/table/index.scss +4 -0
  81. package/es/table/typing.d.ts +27 -14
  82. package/es/table/utils/columnRender.d.ts +3 -3
  83. package/es/table/utils/columnRender.js +2 -2
  84. package/es/table/utils/genProColumnToColumn.d.ts +2 -2
  85. package/es/table/utils/genProColumnToColumn.js +1 -1
  86. package/es/table/utils/index.js +33 -11
  87. package/es/templates/List/index.d.ts +2 -2
  88. package/es/utils/message.d.ts +3 -0
  89. package/es/utils/message.js +19 -0
  90. package/lib/actions/dialog-form.d.ts +5 -5
  91. package/lib/actions/dialog-form.js +1 -5
  92. package/lib/actions/dialog.d.ts +6 -3
  93. package/lib/actions/dialog.js +13 -5
  94. package/lib/actions/index.d.ts +54 -47
  95. package/lib/actions/index.js +37 -30
  96. package/lib/actions/index.scss +17 -2
  97. package/lib/card/index.d.ts +17 -5
  98. package/lib/card/index.js +18 -12
  99. package/lib/form/Components/ProField/index.d.ts +1 -78
  100. package/lib/form/Components/ProField/index.js +32 -38
  101. package/lib/form/Filter/index.js +2 -2
  102. package/lib/form/ProForm/index.d.ts +2 -2
  103. package/lib/form/ProForm/index.js +1 -7
  104. package/lib/form/ProForm/index.scss +19 -1
  105. package/lib/form/ProForm/useFieldRequest.d.ts +5 -0
  106. package/lib/form/ProForm/useFieldRequest.js +37 -0
  107. package/lib/form/SchemaForm/adapterDecorator.js +4 -2
  108. package/lib/form/SchemaForm/index.d.ts +2 -2
  109. package/lib/form/SchemaForm/index.js +11 -22
  110. package/lib/form/SchemaForm/initializeArrayCards.d.ts +2 -2
  111. package/lib/form/SchemaForm/initializeArrayCollapse.d.ts +2 -2
  112. package/lib/form/SchemaForm/initializeArrayItems.d.ts +2 -2
  113. package/lib/form/SchemaForm/initializeArrayTable.d.ts +2 -2
  114. package/lib/form/SchemaForm/initializeDataSource.d.ts +2 -2
  115. package/lib/form/SchemaForm/initializeDataSource.js +2 -2
  116. package/lib/form/SchemaForm/initializeFormButton.d.ts +2 -2
  117. package/lib/form/SchemaForm/initializeFormCollapse.d.ts +2 -2
  118. package/lib/form/SchemaForm/initializeFormGroup.d.ts +2 -2
  119. package/lib/form/SchemaForm/initializeFormStep.d.ts +3 -3
  120. package/lib/form/SchemaForm/initializeFormTab.d.ts +2 -2
  121. package/lib/form/SchemaForm/initializeRequest.d.ts +2 -2
  122. package/lib/form/SchemaForm/initializeRequest.js +1 -1
  123. package/lib/form/SchemaForm/initializeRules.js +41 -13
  124. package/lib/form/SchemaForm/reactions.d.ts +5 -5
  125. package/lib/form/SchemaForm/reactions.js +22 -20
  126. package/lib/form/fieldTypeMap.d.ts +4 -0
  127. package/lib/form/fieldTypeMap.js +48 -0
  128. package/lib/form/index.d.ts +92 -4
  129. package/lib/form/index.js +17 -31
  130. package/lib/form/schemaNameMap.js +3 -0
  131. package/lib/form/typing.d.ts +44 -21
  132. package/lib/form/utils.d.ts +3 -1
  133. package/lib/form/utils.js +43 -1
  134. package/lib/form/warning.d.ts +2 -2
  135. package/lib/index.d.ts +1 -1
  136. package/lib/index.js +1 -1
  137. package/lib/info/components/InfoGroup/index.js +76 -14
  138. package/lib/info/components/InfoGroup/index.scss +45 -3
  139. package/lib/info/components/InfoValueItem/index.js +5 -3
  140. package/lib/info/components/InfoValueItem/index.scss +5 -1
  141. package/lib/info/components/ProInfoItem/index.js +2 -2
  142. package/lib/info/components/ProInfoItem/index.scss +1 -0
  143. package/lib/info/components/baseInfo/index.d.ts +2 -3
  144. package/lib/info/components/headerInfo/index.d.ts +2 -3
  145. package/lib/info/components/tableInfo/index.d.ts +2 -3
  146. package/lib/info/components/tableInfo/index.js +1 -1
  147. package/lib/info/index.js +51 -48
  148. package/lib/info/typing.d.ts +52 -36
  149. package/lib/info/utils/index.d.ts +2 -2
  150. package/lib/info/utils/utils.d.ts +1 -1
  151. package/lib/nocode/pages/renderer.js +1 -1
  152. package/lib/page-header/index.d.ts +34 -21
  153. package/lib/page-header/index.js +37 -28
  154. package/lib/page-header/index.scss +2 -1
  155. package/lib/table/components/EmptyContent/index.d.ts +2 -0
  156. package/lib/table/components/EmptyContent/index.js +25 -0
  157. package/lib/table/components/Filter/index.d.ts +2 -2
  158. package/lib/table/components/Filter/index.js +16 -8
  159. package/lib/table/components/Layout/index.js +1 -1
  160. package/lib/table/components/QuickAction/index.d.ts +2 -2
  161. package/lib/table/components/QuickAction/index.js +1 -1
  162. package/lib/table/components/ToolBar/Fullscreen.js +1 -0
  163. package/lib/table/index.js +77 -14
  164. package/lib/table/index.scss +4 -0
  165. package/lib/table/typing.d.ts +27 -14
  166. package/lib/table/utils/columnRender.d.ts +3 -3
  167. package/lib/table/utils/columnRender.js +1 -1
  168. package/lib/table/utils/genProColumnToColumn.d.ts +2 -2
  169. package/lib/table/utils/genProColumnToColumn.js +2 -2
  170. package/lib/table/utils/index.js +33 -11
  171. package/lib/templates/List/index.d.ts +2 -2
  172. package/lib/utils/message.d.ts +3 -0
  173. package/lib/utils/message.js +32 -0
  174. package/package.json +4 -4
  175. package/es/form/Components/Search/index.d.ts +0 -11
  176. package/es/form/Components/Search/index.js +0 -89
  177. package/es/form/SchemaForm/initializeArrayIcon.d.ts +0 -3
  178. package/es/form/SchemaForm/initializeArrayIcon.js +0 -62
  179. package/es/form/SchemaForm/initializeProField.d.ts +0 -5
  180. package/es/form/SchemaForm/initializeProField.js +0 -70
  181. package/es/info/utils/useInfoRequest.d.ts +0 -14
  182. package/es/info/utils/useInfoRequest.js +0 -76
  183. package/lib/form/Components/Search/index.d.ts +0 -11
  184. package/lib/form/Components/Search/index.js +0 -103
  185. package/lib/form/SchemaForm/initializeArrayIcon.d.ts +0 -3
  186. package/lib/form/SchemaForm/initializeArrayIcon.js +0 -73
  187. package/lib/form/SchemaForm/initializeProField.d.ts +0 -5
  188. package/lib/form/SchemaForm/initializeProField.js +0 -77
  189. package/lib/info/utils/useInfoRequest.d.ts +0 -14
  190. package/lib/info/utils/useInfoRequest.js +0 -85
@@ -1,14 +1,32 @@
1
1
  .teamix-pro-info-group {
2
2
  &-item {
3
+
3
4
  margin-top: 16px;
4
- border-bottom: 1px solid var(--color-line1-1, #eaeaea);
5
- margin-bottom: 16px;
5
+ margin-bottom: 0;
6
6
 
7
7
  .teamix-pro-info {
8
- padding-bottom: 8px;
8
+ padding-bottom: 0;
9
+
10
+ .teamix-pro-card-content {
11
+ padding-bottom: calc(var(--card-body-padding-bottom, 16px) - 8px)
12
+ }
13
+
14
+ .compacted {
15
+ margin-bottom: -8px;
16
+ }
17
+ }
18
+
19
+ &-divider {
20
+ border-bottom: 1px solid var(--color-line1-1, #eaeaea);
21
+ margin-bottom: 16px;
22
+ .teamix-pro-info {
23
+ padding-bottom: 16px;
24
+ }
9
25
  }
10
26
 
11
27
  }
28
+
29
+
12
30
  .teamix-pro-info-group-item:last-child {
13
31
  border-bottom: 0;
14
32
  margin-bottom: 0;
@@ -19,4 +37,28 @@
19
37
  .teamix-pro-info-group-item:first-child {
20
38
  margin-top: 0;
21
39
  }
40
+
41
+ &.blue {
42
+ background-color: var(--color-notice-1);
43
+ }
44
+
45
+ &.orange {
46
+ background-color: var(--color-warning-1);
47
+ }
48
+
49
+ &.yellow {
50
+ background-color: var(--color-help-1);
51
+ }
52
+
53
+ &.red {
54
+ background-color: var(--color-error-1);
55
+ }
56
+
57
+ &.green {
58
+ background-color: var(--color-success-1);
59
+ }
60
+
61
+ &.grey {
62
+ background-color: var(--color-fill1-2);
63
+ }
22
64
  }
@@ -38,7 +38,7 @@ import React, { useMemo, useState } from 'react';
38
38
  import './index.scss';
39
39
  import ProForm, { createForm, formilyReactive } from '../../../form';
40
40
  import { Message } from '@alicloudfe/components';
41
- import { ActionGroup } from '../../../actions';
41
+ import { ProActionGroup } from '../../../actions';
42
42
  var cls = baseClass('teamix-pro-info');
43
43
  var toJS = formilyReactive.toJS;
44
44
 
@@ -70,7 +70,9 @@ var InfoValueItem = function InfoValueItem(props) {
70
70
  var _processRenderFunctio;
71
71
 
72
72
  if (typeof render === 'function') {
73
- return render;
73
+ return function () {
74
+ render(value, record);
75
+ };
74
76
  }
75
77
 
76
78
  var newRender = processBuriedPoint((_processRenderFunctio = processRenderFunction(render !== null && render !== void 0 ? render : {}, value, record)) !== null && _processRenderFunctio !== void 0 ? _processRenderFunctio : {}, value, record);
@@ -126,7 +128,7 @@ var InfoValueItem = function InfoValueItem(props) {
126
128
 
127
129
  var renderAction = function renderAction() {
128
130
  if (actions) {
129
- return /*#__PURE__*/React.createElement(ActionGroup, {
131
+ return /*#__PURE__*/React.createElement(ProActionGroup, {
130
132
  actions: actions,
131
133
  type: "text",
132
134
  style: {
@@ -306,7 +308,7 @@ var InfoValueItem = function InfoValueItem(props) {
306
308
  }
307
309
 
308
310
  return /*#__PURE__*/React.createElement("div", {
309
- className: cls()
311
+ className: cls('item-value')
310
312
  }, /*#__PURE__*/React.createElement(ProField, _objectSpread({
311
313
  type: type,
312
314
  value: value,
@@ -17,5 +17,9 @@
17
17
  }
18
18
  }
19
19
  .teamix-pro-info {
20
- display: flex;
20
+ &-item-value {
21
+ display: flex;
22
+ align-items: center;
23
+ }
24
+
21
25
  }
@@ -1,5 +1,5 @@
1
1
  import { Grid } from '@alicloudfe/components';
2
- import { BaseSkeleton } from '../../..';
2
+ import { ProSkeletonRaw } from '../../..';
3
3
  import { baseClass, Ellipsis, LabelIconTip } from '@teamix/utils';
4
4
  import React from 'react';
5
5
  import './index.scss';
@@ -35,7 +35,7 @@ var ProInfoItem = function ProInfoItem(prop) {
35
35
  className: cls('value')
36
36
  }, loading && /*#__PURE__*/React.createElement("div", {
37
37
  className: cls('base-skeleton-box')
38
- }, /*#__PURE__*/React.createElement(BaseSkeleton.Info, null)), !loading && /*#__PURE__*/React.createElement("div", null, value))));
38
+ }, /*#__PURE__*/React.createElement(ProSkeletonRaw.Info.Item, null)), !loading && /*#__PURE__*/React.createElement("div", null, value))));
39
39
  }
40
40
 
41
41
  if (headerInfoLayout) {
@@ -56,7 +56,7 @@ var ProInfoItem = function ProInfoItem(prop) {
56
56
  }
57
57
  }, loading && /*#__PURE__*/React.createElement("div", {
58
58
  className: cls('base-skeleton-box')
59
- }, /*#__PURE__*/React.createElement(BaseSkeleton.Info, null)), !loading && /*#__PURE__*/React.createElement(React.Fragment, null, value))));
59
+ }, /*#__PURE__*/React.createElement(ProSkeletonRaw.Info.Item, null)), !loading && /*#__PURE__*/React.createElement(React.Fragment, null, value))));
60
60
  }
61
61
 
62
62
  return /*#__PURE__*/React.createElement(React.Fragment, null);
@@ -47,6 +47,7 @@ $item-padding-bottom: 8px;
47
47
  font-size: $header-text-size;
48
48
  display: inline-block;
49
49
  width: 100%;
50
+ padding-right: 20px;
50
51
  }
51
52
 
52
53
  .teamix-pro-field-info-form-item-base-skeleton-box {
@@ -1,8 +1,7 @@
1
1
  import React from 'react';
2
- import { ProInfoBaseProps, ProInfoTransparentBase } from '../../typing';
2
+ import { ProInfoBaseProps, ProInfoTransparentBase, ProInfoTransRequestResult } from '../../typing';
3
3
  import './index.scss';
4
- import { IUseInfoRequestResult } from '../../utils/useInfoRequest';
5
- declare type ProBaseInfoProps = ProInfoBaseProps & IUseInfoRequestResult & ProInfoTransparentBase & {
4
+ declare type ProBaseInfoProps = ProInfoBaseProps & ProInfoTransRequestResult & ProInfoTransparentBase & {
6
5
  size?: any;
7
6
  };
8
7
  declare const ProBaseInfo: React.FC<ProBaseInfoProps>;
@@ -1,8 +1,7 @@
1
1
  import React from 'react';
2
- import { IProHeaderInfo, ProInfoTransparentBase } from '../../typing';
3
- import { IUseInfoRequestResult } from '../../utils/useInfoRequest';
2
+ import { IProHeaderInfo, ProInfoTransparentBase, ProInfoTransRequestResult } from '../../typing';
4
3
  import './index.scss';
5
- declare type ProHeaderInfoProps = IProHeaderInfo & IUseInfoRequestResult & ProInfoTransparentBase & {
4
+ declare type ProHeaderInfoProps = IProHeaderInfo & ProInfoTransRequestResult & ProInfoTransparentBase & {
6
5
  size?: any;
7
6
  };
8
7
  declare const ProHeaderInfo: React.FC<ProHeaderInfoProps>;
@@ -1,8 +1,7 @@
1
1
  import React from 'react';
2
2
  import './index.scss';
3
- import { IProTableInfo, ProInfoTransparentBase } from '../../typing';
3
+ import { IProTableInfo, ProInfoTransparentBase, ProInfoTransRequestResult } from '../../typing';
4
4
  import './index.scss';
5
- import { IUseInfoRequestResult } from '../../utils/useInfoRequest';
6
- declare type ProTableInfoProps = IProTableInfo & IUseInfoRequestResult & ProInfoTransparentBase;
5
+ declare type ProTableInfoProps = IProTableInfo & ProInfoTransRequestResult & ProInfoTransparentBase;
7
6
  declare const ProTableInfo: React.FC<ProTableInfoProps>;
8
7
  export default ProTableInfo;
@@ -22,7 +22,7 @@ import { Table } from '@alicloudfe/components';
22
22
  import './index.scss';
23
23
  import { LabelIconTip } from '@teamix/utils';
24
24
  import InfoValueItem from '../InfoValueItem';
25
- import { BaseSkeleton } from '../../..';
25
+ import { ProSkeletonRaw } from '../../..';
26
26
  import { getDataIndexValue } from '../../utils';
27
27
 
28
28
  var ProTableInfo = function ProTableInfo(props) {
@@ -108,7 +108,7 @@ var ProTableInfo = function ProTableInfo(props) {
108
108
  label: (_item$title = item === null || item === void 0 ? void 0 : item.title) !== null && _item$title !== void 0 ? _item$title : '',
109
109
  tooltip: item.tooltip,
110
110
  icon: item.tooltipIcon
111
- })), _defineProperty(_data, "value_".concat(index), /*#__PURE__*/React.createElement(React.Fragment, null, loading && /*#__PURE__*/React.createElement(BaseSkeleton.Info, null), !loading && getInfoValueItem(item))), _data);
111
+ })), _defineProperty(_data, "value_".concat(index), /*#__PURE__*/React.createElement(React.Fragment, null, loading && /*#__PURE__*/React.createElement(ProSkeletonRaw.Info.Item, null), !loading && getInfoValueItem(item))), _data);
112
112
 
113
113
  if (item.colSpan) {
114
114
  data['formatter'] = {
package/es/info/index.js CHANGED
@@ -1,4 +1,4 @@
1
- var _excluded = ["type", "url", "method", "formatResult", "params", "actionRef", "header", "onError", "className", "style", "columns", "layout", "dataSource", "loading", "extra"];
1
+ var _excluded = ["type", "url", "method", "formatResult", "formatParams", "params", "actionRef", "header", "onSuccess", "onError", "beforeRequest", "extendParams", "className", "style", "columns", "layout", "dataSource", "loading", "extra"];
2
2
 
3
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; }
4
4
 
@@ -29,23 +29,29 @@ import ProBaseInfo from './components/baseInfo';
29
29
  import ProInfoGroup from './components/InfoGroup';
30
30
  import './index.scss';
31
31
  import { ProInfoGroupContext, useActionType } from './utils';
32
- import { getDeepValue, request as utilResquest, useRequest } from '@teamix/utils';
32
+ import { doCommonRequest } from '@teamix/utils';
33
33
  import { useSize } from '@teamix/hooks';
34
34
  import { ProCard } from '..';
35
35
  export * from './typing';
36
36
 
37
37
  var ProInfo = function ProInfo(props) {
38
+ var _ref;
39
+
38
40
  var _props$type = props.type,
39
41
  type = _props$type === void 0 ? 'base' : _props$type,
40
42
  url = props.url,
41
43
  _props$method = props.method,
42
44
  method = _props$method === void 0 ? 'post' : _props$method,
43
45
  formatResult = props.formatResult,
46
+ formatParams = props.formatParams,
44
47
  params = props.params,
45
48
  propsActionRef = props.actionRef,
46
49
  _props$header = props.header,
47
50
  header = _props$header === void 0 ? {} : _props$header,
48
- _onError = props.onError,
51
+ onSuccess = props.onSuccess,
52
+ onError = props.onError,
53
+ beforeRequest = props.beforeRequest,
54
+ extendParams = props.extendParams,
49
55
  className = props.className,
50
56
  style = props.style,
51
57
  columns = props.columns,
@@ -61,62 +67,59 @@ var ProInfo = function ProInfo(props) {
61
67
  contextParams = _useContext.params,
62
68
  contextFormatResult = _useContext.formatResult,
63
69
  contextVisible = _useContext.visible,
64
- contextSize = _useContext.size; // 获取容器宽度
70
+ contextSize = _useContext.size,
71
+ contextOnSuccess = _useContext.onSuccess,
72
+ contextOnError = _useContext.onError,
73
+ contextFormatParams = _useContext.formatParams,
74
+ contextBeforeRequest = _useContext.beforeRequest,
75
+ contextExtendParams = _useContext.extendParams; // 获取容器宽度
65
76
 
66
77
 
67
78
  var ref = useRef();
68
- var size = contextVisible ? contextSize : useSize(ref); // 请求数据
79
+ var size = contextVisible ? contextSize : useSize(ref);
69
80
 
70
81
  var _useState = useState(false),
71
82
  _useState2 = _slicedToArray(_useState, 2),
72
83
  loading = _useState2[0],
73
- setLoading = _useState2[1]; // 获取数据
84
+ setLoading = _useState2[1]; // 请求数据
74
85
 
75
86
 
76
- var getDataSource = function getDataSource(result) {
77
- if (formatResult) {
78
- if (typeof formatResult === 'function') {
79
- return formatResult === null || formatResult === void 0 ? void 0 : formatResult(result);
80
- } else if (formatResult) {
81
- return getDeepValue(formatResult.data, result);
82
- } else {
83
- return result;
84
- }
85
- }
86
-
87
- return result;
88
- };
87
+ var _useState3 = useState(),
88
+ _useState4 = _slicedToArray(_useState3, 2),
89
+ data = _useState4[0],
90
+ setData = _useState4[1];
89
91
 
90
92
  var requestDataKey = (contextMethod !== null && contextMethod !== void 0 ? contextMethod : method).toLowerCase() === 'get' ? 'params' : 'data';
93
+
94
+ var requestConfig = _defineProperty({
95
+ url: (_ref = contextUrl !== null && contextUrl !== void 0 ? contextUrl : url) !== null && _ref !== void 0 ? _ref : '',
96
+ method: contextMethod !== null && contextMethod !== void 0 ? contextMethod : method,
97
+ formatResult: contextFormatResult !== null && contextFormatResult !== void 0 ? contextFormatResult : formatResult,
98
+ onSuccess: contextOnSuccess !== null && contextOnSuccess !== void 0 ? contextOnSuccess : onSuccess,
99
+ onError: contextOnError !== null && contextOnError !== void 0 ? contextOnError : onError,
100
+ formatParams: contextFormatParams !== null && contextFormatParams !== void 0 ? contextFormatParams : formatParams,
101
+ beforeRequest: contextBeforeRequest !== null && contextBeforeRequest !== void 0 ? contextBeforeRequest : beforeRequest,
102
+ extendParams: contextExtendParams !== null && contextExtendParams !== void 0 ? contextExtendParams : extendParams
103
+ }, requestDataKey, contextParams !== null && contextParams !== void 0 ? contextParams : params);
104
+
91
105
  useEffect(function () {
92
106
  if (url || contextUrl) {
93
107
  setLoading(false);
94
- getData.run({});
108
+ request();
95
109
  } else {
96
110
  setLoading(false);
97
111
  }
98
- }, []);
99
- var getData = useRequest(function (params) {
100
- var _ref;
101
-
102
- return _defineProperty({
103
- url: (_ref = contextUrl !== null && contextUrl !== void 0 ? contextUrl : url) !== null && _ref !== void 0 ? _ref : '',
104
- method: contextMethod !== null && contextMethod !== void 0 ? contextMethod : method
105
- }, requestDataKey, contextParams !== null && contextParams !== void 0 ? contextParams : params);
106
- }, {
107
- // 使用 request 方法代替 fetch
108
- requestMethod: function requestMethod(params) {
109
- return utilResquest(params);
110
- },
111
- manual: true,
112
- onSuccess: function onSuccess(result) {
113
- props.onSuccess && props.onSuccess(result);
114
- },
115
- onError: function onError(error) {
112
+ }, []); // 获取数据
113
+
114
+ var request = function request() {
115
+ setLoading(true);
116
+ doCommonRequest(requestConfig).then(function (resp) {
117
+ setData(resp);
118
+ }).finally(function () {
116
119
  setLoading(false);
117
- _onError === null || _onError === void 0 ? void 0 : _onError(error);
118
- }
119
- });
120
+ });
121
+ };
122
+
120
123
  var actionRef = useRef(); // 将 Actions 绑定到传入的 propsActionRef 中
121
124
 
122
125
  if (propsActionRef) {
@@ -126,7 +129,7 @@ var ProInfo = function ProInfo(props) {
126
129
 
127
130
  useActionType(actionRef, {
128
131
  refresh: function refresh() {
129
- getData.run({});
132
+ request();
130
133
  }
131
134
  });
132
135
 
@@ -141,7 +144,7 @@ var ProInfo = function ProInfo(props) {
141
144
 
142
145
  return _objectSpread(_objectSpread({}, extra), {}, {
143
146
  context: {
144
- record: dataSource !== null && dataSource !== void 0 ? dataSource : getDataSource(getData.data)
147
+ record: dataSource !== null && dataSource !== void 0 ? dataSource : data
145
148
  }
146
149
  });
147
150
  };
@@ -160,24 +163,24 @@ var ProInfo = function ProInfo(props) {
160
163
  }), type === 'table' && /*#__PURE__*/React.createElement(ProTableInfo, {
161
164
  dataSource: dataSource,
162
165
  columns: columns,
163
- loading: userLoading || loading || getData.loading,
164
- result: getDataSource(getData.data),
166
+ loading: userLoading || loading,
167
+ result: data,
165
168
  actionRef: actionRef,
166
169
  layout: layout
167
170
  }), type === 'header' && /*#__PURE__*/React.createElement(ProHeaderInfo, {
168
171
  dataSource: dataSource,
169
172
  columns: columns,
170
173
  header: header,
171
- loading: userLoading || loading || getData.loading,
172
- result: getDataSource(getData.data),
174
+ loading: userLoading || loading,
175
+ result: data,
173
176
  actionRef: actionRef,
174
177
  layout: layout,
175
178
  size: size
176
179
  }), type === 'base' && /*#__PURE__*/React.createElement(ProBaseInfo, {
177
180
  dataSource: dataSource,
178
181
  columns: columns,
179
- loading: userLoading || loading || getData.loading,
180
- result: getDataSource(getData.data),
182
+ loading: userLoading || loading,
183
+ result: data,
181
184
  actionRef: actionRef,
182
185
  layout: layout,
183
186
  size: size
@@ -1,18 +1,16 @@
1
- import { IProFieldFormatterProps, IProFieldOptionItem, IProFieldProps, IProFieldType } from '../field';
2
- import { ActionGroupProps, IActionButton } from '../actions';
1
+ import { ProFieldRenderProps, ProFieldDataSourceItem, ProFieldProps, ProFieldType } from '../field';
2
+ import { ActionGroupProps, ProActionButtonProps } from '../actions';
3
3
  import { Method } from 'axios';
4
4
  import React from 'react';
5
- import { CardProps } from '../card';
5
+ import { CommonRequestConfig } from '@teamix/utils';
6
+ import { ProCardProps } from '../card';
6
7
  /** 列record函数 */
7
8
  declare type ProInfoCellFunProp = (value: any, record: any) => any;
8
- declare type FieldRenderProps = keyof IProFieldFormatterProps;
9
+ declare type FieldRenderProps = keyof ProFieldRenderProps;
9
10
  declare type ProInfoCellRender = {
10
- [key in FieldRenderProps]?: IProFieldFormatterProps[key] | ProInfoCellFunProp;
11
+ [key in FieldRenderProps]?: ProFieldRenderProps[key] | ProInfoCellFunProp;
11
12
  } | ((...other: any) => React.ReactNode);
12
- /** ProInfoBaseProps info 基础定义 */
13
- export declare type ProInfoBaseProps = {
14
- /** ProColums 定义,取代 Table 的 columns */
15
- columns: ProInfoItemProps[];
13
+ export declare type PropInfoRequestProps = {
16
14
  /** 请求地址 */
17
15
  url?: string;
18
16
  /** 请求方法 */
@@ -31,6 +29,13 @@ export declare type ProInfoBaseProps = {
31
29
  onSuccess?: (res: any) => void;
32
30
  /** 内部请求失败时的回调 */
33
31
  onError?: (error: Error) => void;
32
+ };
33
+ export interface ProInfoRequestProps extends Partial<CommonRequestConfig> {
34
+ }
35
+ /** ProInfoBaseProps info 基础定义 */
36
+ export declare type ProInfoBaseProps = {
37
+ /** ProColums 定义,取代 Table 的 columns */
38
+ columns: ProInfoColumnsProps[];
34
39
  /** ProInfo action 的引用,便于手动触发一些方法 */
35
40
  actionRef?: React.MutableRefObject<ProInfoActionType | undefined>;
36
41
  /** 标题区 推荐将header中的内容平铺到ProCard中。即将不支持此写法 */
@@ -40,12 +45,13 @@ export declare type ProInfoBaseProps = {
40
45
  [key: string]: any;
41
46
  };
42
47
  /** 布局值 */
43
- layout?: BaseInfoLayoutProps;
48
+ layout?: ProBaseInfoLayoutProps;
44
49
  /** 加载动画 */
45
50
  loading?: boolean;
46
- } & ProInfoHeaderProps;
47
- /** ProInfoItemProps info 单元格 定义 */
48
- export interface ProInfoItemProps {
51
+ } & ProInfoHeaderProps & ProInfoRequestProps;
52
+ /** ProInfoColumnsProps info 单元格 定义 */
53
+ export declare type ProInfoItemProps = ProInfoColumnsProps;
54
+ export interface ProInfoColumnsProps {
49
55
  /** 标题 */
50
56
  title: string;
51
57
  /** 列表项展示的Tooltip */
@@ -55,11 +61,11 @@ export interface ProInfoItemProps {
55
61
  */
56
62
  tooltipIcon?: React.ReactNode;
57
63
  /** 对应 ProField 里面的 type */
58
- valueType?: IProFieldType;
64
+ valueType?: ProFieldType;
59
65
  /** 渲染单元格内容字段 */
60
66
  render?: ProInfoCellRender;
61
67
  /** 枚举值 */
62
- dataSource?: IProFieldOptionItem[] | ProInfoCellFunProp;
68
+ dataSource?: ProFieldDataSourceItem[] | ProInfoCellFunProp;
63
69
  /** 表头的筛选菜单项,当值为 true 时,自动使用 dataSource 生成 */
64
70
  filters?: boolean;
65
71
  /** 操作组配置 */
@@ -83,7 +89,7 @@ export interface ProInfoItemProps {
83
89
  /** 编辑请求成功提示文案 */
84
90
  successMessage?: string;
85
91
  /** 列 actions 配置 */
86
- actions?: IActionButton[];
92
+ actions?: ProActionButtonProps[];
87
93
  /** 追加在列后 */
88
94
  extra?: React.ReactNode;
89
95
  }
@@ -98,31 +104,33 @@ export declare type IProProInfoItem = {
98
104
  /** 值 */
99
105
  value: React.ReactNode;
100
106
  /** 基础详情布局值 */
101
- baseInfoLayout?: BaseInfoLayoutProps;
107
+ baseInfoLayout?: ProBaseInfoLayoutProps;
102
108
  /** 头部详情布局值 */
103
- headerInfoLayout?: HeaderInfoLayoutProps;
109
+ headerInfoLayout?: ProHeaderInfoLayoutProps;
104
110
  /** loading 状态 */
105
111
  loading?: boolean;
106
- } & Pick<ProInfoItemProps, 'tooltip' | 'tooltipIcon'>;
112
+ } & Pick<ProInfoColumnsProps, 'tooltip' | 'tooltipIcon'>;
107
113
  /** header info 定义 */
108
114
  export declare type IProHeaderInfo = {
109
115
  /** 布局值 */
110
- layout?: HeaderInfoLayoutProps;
116
+ layout?: ProHeaderInfoLayoutProps;
111
117
  } & Omit<ProInfoBaseProps, 'layout'>;
112
118
  /** table info 定义 */
113
119
  export declare type IProTableInfo = {
114
120
  /** 布局值 */
115
121
  layout?: TableInfoLayoutProps;
116
122
  } & Omit<ProInfoBaseProps, 'layout'>;
123
+ declare type ProInfoBasePropsOmitLayout = Omit<ProInfoBaseProps, 'layout'>;
117
124
  /** ProInfo */
118
125
  export declare type ProInfoProps = {
119
126
  /** 布局值 */
120
- layout?: TableInfoLayoutProps | HeaderInfoLayoutProps | BaseInfoLayoutProps;
127
+ layout?: TableInfoLayoutProps | ProHeaderInfoLayoutProps | ProBaseInfoLayoutProps;
121
128
  /** 类型 */
122
129
  type?: 'base' | 'header' | 'table';
123
- } & Omit<ProInfoBaseProps, 'layout'> & ProInfoTransparentBase;
130
+ } & ProInfoBasePropsOmitLayout & ProInfoTransparentBase;
124
131
  export declare type IProHeaderInfoItem = {};
125
- export declare type BaseInfoLayoutProps = {
132
+ export declare type BaseInfoLayoutProps = ProBaseInfoLayoutProps;
133
+ export declare type ProBaseInfoLayoutProps = {
126
134
  span?: number;
127
135
  labelCol?: {
128
136
  span: number;
@@ -131,7 +139,8 @@ export declare type BaseInfoLayoutProps = {
131
139
  span: number;
132
140
  };
133
141
  };
134
- export declare type HeaderInfoLayoutProps = {
142
+ export declare type headerInfoLayout = ProHeaderInfoLayoutProps;
143
+ export declare type ProHeaderInfoLayoutProps = {
135
144
  /** label 间隔 */
136
145
  labelGutter?: number | string;
137
146
  /** 列数 宽度 */
@@ -139,31 +148,33 @@ export declare type HeaderInfoLayoutProps = {
139
148
  };
140
149
  /** infoGroup */
141
150
  export declare type ProInfoGroupProps = {
142
- children?: React.ReactNode[] | React.ReactNode;
143
- } & Pick<ProInfoBaseProps, 'params' | 'method' | 'url' | 'onSuccess' | 'onError' | 'formatResult'>;
144
- export declare type TableInfoLayoutProps = {} & HeaderInfoLayoutProps;
151
+ children?: React.ReactNode[] | React.ReactNode | ProInfoBaseProps[];
152
+ /** 是否有有分割线 */
153
+ divider?: boolean;
154
+ /** 是否是紧凑模式 */
155
+ compacted?: ProCardProps['compacted'];
156
+ /** 背景颜色 */
157
+ backgroundColor?: ProCardProps['backgroundColor'];
158
+ } & ProInfoRequestProps & React.HTMLAttributes<HTMLElement>;
159
+ export declare type TableInfoLayoutProps = {} & ProHeaderInfoLayoutProps;
145
160
  export declare type InfoValueItemProps = {
146
- infoItem: ProInfoItemProps;
161
+ infoItem: ProInfoColumnsProps;
147
162
  record: any;
148
163
  actionRef?: React.MutableRefObject<ProInfoActionType | undefined>;
149
164
  render?: ProInfoCellRender;
150
- dataSource?: IProFieldOptionItem[] | ProInfoCellFunProp;
151
- } & Omit<IProFieldProps, 'render' | 'dataSource'>;
152
- export declare type ProInfoHeaderProps = Omit<CardProps, 'loading'>;
165
+ dataSource?: ProFieldDataSourceItem[] | ProInfoCellFunProp;
166
+ } & Omit<ProFieldProps, 'render' | 'dataSource'>;
167
+ export declare type ProInfoHeaderProps = Omit<ProCardProps, 'loading'>;
153
168
  /** ProInfoGroupContextProps */
154
169
  export declare type ProInfoGroupContextProps = {
155
170
  /** 因为其他数据都为异步。visible 只用作标识 */
156
171
  visible?: boolean;
157
172
  layout?: ProInfoBaseProps['layout'];
158
- url?: ProInfoBaseProps['url'];
159
- params?: ProInfoBaseProps['params'];
160
- method?: ProInfoBaseProps['method'];
161
- formatResult?: ProInfoBaseProps['formatResult'];
162
173
  size?: {
163
174
  width?: number;
164
175
  height?: number;
165
176
  };
166
- };
177
+ } & ProInfoRequestProps;
167
178
  /** 基本透传类型 */
168
179
  export declare type ProInfoTransparentBase = {
169
180
  /**
@@ -183,4 +194,9 @@ export declare type ProInfoTransparentBase = {
183
194
  /** style */
184
195
  style?: React.CSSProperties;
185
196
  };
197
+ export declare type ProInfoTransRequestResult = {
198
+ loading: boolean;
199
+ result: any;
200
+ refresh?: () => void;
201
+ };
186
202
  export {};
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import { ProInfoActionType, ProInfoGroupContextProps, ProInfoItemProps } from '../typing';
2
+ import { ProInfoActionType, ProInfoGroupContextProps, ProInfoColumnsProps } from '../typing';
3
3
  export declare function useActionType<T>(ref: React.MutableRefObject<ProInfoActionType | undefined>, action: ProInfoActionType): void;
4
4
  /** ProInfoGroupContext */
5
5
  export declare const ProInfoGroupContext: React.Context<ProInfoGroupContextProps>;
@@ -9,4 +9,4 @@ export declare const ProInfoGroupContext: React.Context<ProInfoGroupContextProps
9
9
  * @param dataSource
10
10
  * @returns
11
11
  */
12
- export declare function getDataIndexValue(dataIndex: ProInfoItemProps['dataIndex'], dataSource: object): any;
12
+ export declare function getDataIndexValue(dataIndex: ProInfoColumnsProps['dataIndex'], dataSource: object): any;
@@ -1 +1 @@
1
- export declare function getLayout(width: number): "l" | "xs" | "xl" | "s" | "m";
1
+ export declare function getLayout(width: number): "xs" | "xl" | "l" | "s" | "m";
@@ -37,7 +37,7 @@ import Helmet from 'react-helmet';
37
37
  import SVG from '@teamix/svg';
38
38
  import PageContainer from '../../page-container';
39
39
  import PageHeader from '../../page-header';
40
- import { BaseSkeleton } from '../../skeleton';
40
+ import { ProSkeletonRaw } from '../../skeleton';
41
41
  import { baseClass } from '@teamix/utils';
42
42
  import { PageMap } from '.';
43
43
  var cls = baseClass('teamix-nocode');
@@ -49,7 +49,7 @@ var Loading = function Loading(props) {
49
49
  title: "",
50
50
  breadcrumb: []
51
51
  }),
52
- content: /*#__PURE__*/React.createElement(BaseSkeleton.Content, null)
52
+ content: /*#__PURE__*/React.createElement(ProSkeletonRaw.Content, null)
53
53
  }, props));
54
54
  };
55
55