@teamix/pro 1.1.36 → 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 (200) hide show
  1. package/README.md +14 -10
  2. package/dist/pro.css +1 -1
  3. package/dist/pro.js +2555 -3791
  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 +12 -0
  9. package/es/actions/dialog.js +104 -27
  10. package/es/actions/index.d.ts +54 -47
  11. package/es/actions/index.js +28 -22
  12. package/es/actions/index.scss +48 -2
  13. package/es/actions/link.js +4 -2
  14. package/es/actions/request.d.ts +1 -1
  15. package/es/actions/request.js +2 -2
  16. package/es/card/index.d.ts +17 -5
  17. package/es/card/index.js +16 -11
  18. package/es/form/Components/ProField/index.d.ts +1 -161
  19. package/es/form/Components/ProField/index.js +34 -40
  20. package/es/form/Filter/index.js +2 -2
  21. package/es/form/ProForm/index.d.ts +2 -2
  22. package/es/form/ProForm/index.js +1 -6
  23. package/es/form/ProForm/index.scss +19 -1
  24. package/es/form/ProForm/useFieldRequest.d.ts +5 -0
  25. package/es/form/ProForm/useFieldRequest.js +26 -0
  26. package/es/form/SchemaForm/adapterDecorator.js +2 -2
  27. package/es/form/SchemaForm/index.d.ts +2 -2
  28. package/es/form/SchemaForm/index.js +12 -21
  29. package/es/form/SchemaForm/initializeArrayCards.d.ts +2 -2
  30. package/es/form/SchemaForm/initializeArrayCollapse.d.ts +2 -2
  31. package/es/form/SchemaForm/initializeArrayItems.d.ts +2 -2
  32. package/es/form/SchemaForm/initializeArrayTable.d.ts +2 -2
  33. package/es/form/SchemaForm/initializeDataSource.d.ts +2 -2
  34. package/es/form/SchemaForm/initializeDataSource.js +2 -2
  35. package/es/form/SchemaForm/initializeFormButton.d.ts +2 -2
  36. package/es/form/SchemaForm/initializeFormCollapse.d.ts +2 -2
  37. package/es/form/SchemaForm/initializeFormGroup.d.ts +2 -2
  38. package/es/form/SchemaForm/initializeFormStep.d.ts +3 -3
  39. package/es/form/SchemaForm/initializeFormTab.d.ts +2 -2
  40. package/es/form/SchemaForm/initializeRequest.d.ts +2 -2
  41. package/es/form/SchemaForm/initializeRequest.js +2 -2
  42. package/es/form/SchemaForm/initializeRules.js +44 -16
  43. package/es/form/SchemaForm/reactions.d.ts +5 -5
  44. package/es/form/SchemaForm/reactions.js +20 -18
  45. package/es/form/fieldTypeMap.d.ts +4 -0
  46. package/es/form/fieldTypeMap.js +41 -0
  47. package/es/form/index.d.ts +92 -4
  48. package/es/form/index.js +18 -5
  49. package/es/form/schemaNameMap.js +3 -0
  50. package/es/form/typing.d.ts +49 -26
  51. package/es/form/utils.d.ts +3 -1
  52. package/es/form/utils.js +38 -1
  53. package/es/form/warning.d.ts +2 -2
  54. package/es/index.d.ts +1 -1
  55. package/es/index.js +1 -1
  56. package/es/info/components/InfoGroup/index.js +73 -15
  57. package/es/info/components/InfoGroup/index.scss +45 -3
  58. package/es/info/components/InfoValueItem/index.js +9 -4
  59. package/es/info/components/InfoValueItem/index.scss +5 -1
  60. package/es/info/components/ProInfoItem/index.js +3 -3
  61. package/es/info/components/ProInfoItem/index.scss +1 -0
  62. package/es/info/components/baseInfo/index.d.ts +2 -3
  63. package/es/info/components/baseInfo/index.js +29 -10
  64. package/es/info/components/headerInfo/index.d.ts +2 -3
  65. package/es/info/components/tableInfo/index.d.ts +2 -3
  66. package/es/info/components/tableInfo/index.js +2 -2
  67. package/es/info/index.js +75 -51
  68. package/es/info/typing.d.ts +54 -36
  69. package/es/info/utils/index.d.ts +2 -2
  70. package/es/info/utils/utils.d.ts +1 -1
  71. package/es/nocode/pages/renderer.js +2 -2
  72. package/es/page-header/index.d.ts +42 -25
  73. package/es/page-header/index.js +56 -32
  74. package/es/page-header/index.scss +2 -1
  75. package/es/table/components/EmptyContent/index.d.ts +2 -0
  76. package/es/table/components/EmptyContent/index.js +11 -0
  77. package/es/table/components/Filter/index.d.ts +2 -2
  78. package/es/table/components/Filter/index.js +23 -10
  79. package/es/table/components/Filter/index.scss +1 -1
  80. package/es/table/components/Layout/index.js +2 -2
  81. package/es/table/components/QuickAction/index.d.ts +2 -2
  82. package/es/table/components/QuickAction/index.js +3 -3
  83. package/es/table/components/ToolBar/Fullscreen.js +1 -0
  84. package/es/table/index.js +76 -14
  85. package/es/table/index.scss +4 -0
  86. package/es/table/typing.d.ts +29 -14
  87. package/es/table/utils/columnRender.d.ts +3 -3
  88. package/es/table/utils/columnRender.js +2 -2
  89. package/es/table/utils/genProColumnToColumn.d.ts +2 -2
  90. package/es/table/utils/genProColumnToColumn.js +1 -1
  91. package/es/table/utils/index.js +33 -11
  92. package/es/templates/List/index.d.ts +2 -2
  93. package/es/utils/message.d.ts +3 -0
  94. package/es/utils/message.js +19 -0
  95. package/lib/actions/dialog-form.d.ts +5 -5
  96. package/lib/actions/dialog-form.js +1 -5
  97. package/lib/actions/dialog.d.ts +12 -0
  98. package/lib/actions/dialog.js +108 -26
  99. package/lib/actions/index.d.ts +54 -47
  100. package/lib/actions/index.js +37 -30
  101. package/lib/actions/index.scss +48 -2
  102. package/lib/actions/link.js +5 -2
  103. package/lib/actions/request.d.ts +1 -1
  104. package/lib/actions/request.js +2 -2
  105. package/lib/card/index.d.ts +17 -5
  106. package/lib/card/index.js +18 -12
  107. package/lib/form/Components/ProField/index.d.ts +1 -161
  108. package/lib/form/Components/ProField/index.js +32 -38
  109. package/lib/form/Filter/index.js +2 -2
  110. package/lib/form/ProForm/index.d.ts +2 -2
  111. package/lib/form/ProForm/index.js +1 -7
  112. package/lib/form/ProForm/index.scss +19 -1
  113. package/lib/form/ProForm/useFieldRequest.d.ts +5 -0
  114. package/lib/form/ProForm/useFieldRequest.js +37 -0
  115. package/lib/form/SchemaForm/adapterDecorator.js +4 -2
  116. package/lib/form/SchemaForm/index.d.ts +2 -2
  117. package/lib/form/SchemaForm/index.js +11 -22
  118. package/lib/form/SchemaForm/initializeArrayCards.d.ts +2 -2
  119. package/lib/form/SchemaForm/initializeArrayCollapse.d.ts +2 -2
  120. package/lib/form/SchemaForm/initializeArrayItems.d.ts +2 -2
  121. package/lib/form/SchemaForm/initializeArrayTable.d.ts +2 -2
  122. package/lib/form/SchemaForm/initializeDataSource.d.ts +2 -2
  123. package/lib/form/SchemaForm/initializeDataSource.js +2 -2
  124. package/lib/form/SchemaForm/initializeFormButton.d.ts +2 -2
  125. package/lib/form/SchemaForm/initializeFormCollapse.d.ts +2 -2
  126. package/lib/form/SchemaForm/initializeFormGroup.d.ts +2 -2
  127. package/lib/form/SchemaForm/initializeFormStep.d.ts +3 -3
  128. package/lib/form/SchemaForm/initializeFormTab.d.ts +2 -2
  129. package/lib/form/SchemaForm/initializeRequest.d.ts +2 -2
  130. package/lib/form/SchemaForm/initializeRequest.js +1 -1
  131. package/lib/form/SchemaForm/initializeRules.js +41 -13
  132. package/lib/form/SchemaForm/reactions.d.ts +5 -5
  133. package/lib/form/SchemaForm/reactions.js +22 -20
  134. package/lib/form/fieldTypeMap.d.ts +4 -0
  135. package/lib/form/fieldTypeMap.js +48 -0
  136. package/lib/form/index.d.ts +92 -4
  137. package/lib/form/index.js +17 -31
  138. package/lib/form/schemaNameMap.js +3 -0
  139. package/lib/form/typing.d.ts +49 -26
  140. package/lib/form/utils.d.ts +3 -1
  141. package/lib/form/utils.js +43 -1
  142. package/lib/form/warning.d.ts +2 -2
  143. package/lib/index.d.ts +1 -1
  144. package/lib/index.js +1 -1
  145. package/lib/info/components/InfoGroup/index.js +76 -14
  146. package/lib/info/components/InfoGroup/index.scss +45 -3
  147. package/lib/info/components/InfoValueItem/index.js +8 -3
  148. package/lib/info/components/InfoValueItem/index.scss +5 -1
  149. package/lib/info/components/ProInfoItem/index.js +2 -2
  150. package/lib/info/components/ProInfoItem/index.scss +1 -0
  151. package/lib/info/components/baseInfo/index.d.ts +2 -3
  152. package/lib/info/components/baseInfo/index.js +29 -10
  153. package/lib/info/components/headerInfo/index.d.ts +2 -3
  154. package/lib/info/components/tableInfo/index.d.ts +2 -3
  155. package/lib/info/components/tableInfo/index.js +1 -1
  156. package/lib/info/index.js +73 -49
  157. package/lib/info/typing.d.ts +54 -36
  158. package/lib/info/utils/index.d.ts +2 -2
  159. package/lib/info/utils/utils.d.ts +1 -1
  160. package/lib/nocode/pages/renderer.js +1 -1
  161. package/lib/page-header/index.d.ts +42 -25
  162. package/lib/page-header/index.js +54 -30
  163. package/lib/page-header/index.scss +2 -1
  164. package/lib/table/components/EmptyContent/index.d.ts +2 -0
  165. package/lib/table/components/EmptyContent/index.js +25 -0
  166. package/lib/table/components/Filter/index.d.ts +2 -2
  167. package/lib/table/components/Filter/index.js +23 -10
  168. package/lib/table/components/Filter/index.scss +1 -1
  169. package/lib/table/components/Layout/index.js +1 -1
  170. package/lib/table/components/QuickAction/index.d.ts +2 -2
  171. package/lib/table/components/QuickAction/index.js +1 -1
  172. package/lib/table/components/ToolBar/Fullscreen.js +1 -0
  173. package/lib/table/index.js +77 -14
  174. package/lib/table/index.scss +4 -0
  175. package/lib/table/typing.d.ts +29 -14
  176. package/lib/table/utils/columnRender.d.ts +3 -3
  177. package/lib/table/utils/columnRender.js +1 -1
  178. package/lib/table/utils/genProColumnToColumn.d.ts +2 -2
  179. package/lib/table/utils/genProColumnToColumn.js +2 -2
  180. package/lib/table/utils/index.js +33 -11
  181. package/lib/templates/List/index.d.ts +2 -2
  182. package/lib/utils/message.d.ts +3 -0
  183. package/lib/utils/message.js +32 -0
  184. package/package.json +4 -4
  185. package/es/form/Components/Search/index.d.ts +0 -11
  186. package/es/form/Components/Search/index.js +0 -89
  187. package/es/form/SchemaForm/initializeArrayIcon.d.ts +0 -3
  188. package/es/form/SchemaForm/initializeArrayIcon.js +0 -62
  189. package/es/form/SchemaForm/initializeProField.d.ts +0 -5
  190. package/es/form/SchemaForm/initializeProField.js +0 -70
  191. package/es/info/utils/useInfoRequest.d.ts +0 -14
  192. package/es/info/utils/useInfoRequest.js +0 -76
  193. package/lib/form/Components/Search/index.d.ts +0 -11
  194. package/lib/form/Components/Search/index.js +0 -103
  195. package/lib/form/SchemaForm/initializeArrayIcon.d.ts +0 -3
  196. package/lib/form/SchemaForm/initializeArrayIcon.js +0 -73
  197. package/lib/form/SchemaForm/initializeProField.d.ts +0 -5
  198. package/lib/form/SchemaForm/initializeProField.js +0 -77
  199. package/lib/info/utils/useInfoRequest.d.ts +0 -14
  200. package/lib/info/utils/useInfoRequest.js +0 -85
package/lib/info/index.js CHANGED
@@ -41,7 +41,7 @@ Object.keys(_typing).forEach(function (key) {
41
41
  }
42
42
  });
43
43
  });
44
- var _excluded = ["type", "url", "method", "formatResult", "params", "actionRef", "header", "onError", "className", "style", "columns", "layout", "dataSource"];
44
+ var _excluded = ["type", "url", "method", "formatResult", "formatParams", "params", "actionRef", "header", "onSuccess", "onError", "beforeRequest", "extendParams", "className", "style", "columns", "layout", "dataSource", "loading", "extra"];
45
45
 
46
46
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
47
47
 
@@ -72,22 +72,30 @@ function _objectWithoutProperties(source, excluded) { if (source == null) return
72
72
  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; }
73
73
 
74
74
  var ProInfo = function ProInfo(props) {
75
+ var _ref;
76
+
75
77
  var _props$type = props.type,
76
78
  type = _props$type === void 0 ? 'base' : _props$type,
77
79
  url = props.url,
78
80
  _props$method = props.method,
79
81
  method = _props$method === void 0 ? 'post' : _props$method,
80
82
  formatResult = props.formatResult,
83
+ formatParams = props.formatParams,
81
84
  params = props.params,
82
85
  propsActionRef = props.actionRef,
83
86
  _props$header = props.header,
84
87
  header = _props$header === void 0 ? {} : _props$header,
85
- _onError = props.onError,
88
+ onSuccess = props.onSuccess,
89
+ onError = props.onError,
90
+ beforeRequest = props.beforeRequest,
91
+ extendParams = props.extendParams,
86
92
  className = props.className,
87
93
  style = props.style,
88
94
  columns = props.columns,
89
95
  layout = props.layout,
90
96
  dataSource = props.dataSource,
97
+ userLoading = props.loading,
98
+ extra = props.extra,
91
99
  others = _objectWithoutProperties(props, _excluded);
92
100
 
93
101
  var _useContext = (0, _react.useContext)(_utils.ProInfoGroupContext),
@@ -96,62 +104,59 @@ var ProInfo = function ProInfo(props) {
96
104
  contextParams = _useContext.params,
97
105
  contextFormatResult = _useContext.formatResult,
98
106
  contextVisible = _useContext.visible,
99
- contextSize = _useContext.size; // 获取容器宽度
107
+ contextSize = _useContext.size,
108
+ contextOnSuccess = _useContext.onSuccess,
109
+ contextOnError = _useContext.onError,
110
+ contextFormatParams = _useContext.formatParams,
111
+ contextBeforeRequest = _useContext.beforeRequest,
112
+ contextExtendParams = _useContext.extendParams; // 获取容器宽度
100
113
 
101
114
 
102
115
  var ref = (0, _react.useRef)();
103
- var size = contextVisible ? contextSize : (0, _hooks.useSize)(ref); // 请求数据
116
+ var size = contextVisible ? contextSize : (0, _hooks.useSize)(ref);
104
117
 
105
118
  var _useState = (0, _react.useState)(false),
106
119
  _useState2 = _slicedToArray(_useState, 2),
107
120
  loading = _useState2[0],
108
- setLoading = _useState2[1]; // 获取数据
121
+ setLoading = _useState2[1]; // 请求数据
109
122
 
110
123
 
111
- var getDataSource = function getDataSource(result) {
112
- if (formatResult) {
113
- if (typeof formatResult === 'function') {
114
- return formatResult === null || formatResult === void 0 ? void 0 : formatResult(result);
115
- } else if (formatResult) {
116
- return (0, _utils2.getDeepValue)(formatResult.data, result);
117
- } else {
118
- return result;
119
- }
120
- }
121
-
122
- return result;
123
- };
124
+ var _useState3 = (0, _react.useState)(),
125
+ _useState4 = _slicedToArray(_useState3, 2),
126
+ data = _useState4[0],
127
+ setData = _useState4[1];
124
128
 
125
129
  var requestDataKey = (contextMethod !== null && contextMethod !== void 0 ? contextMethod : method).toLowerCase() === 'get' ? 'params' : 'data';
130
+
131
+ var requestConfig = _defineProperty({
132
+ url: (_ref = contextUrl !== null && contextUrl !== void 0 ? contextUrl : url) !== null && _ref !== void 0 ? _ref : '',
133
+ method: contextMethod !== null && contextMethod !== void 0 ? contextMethod : method,
134
+ formatResult: contextFormatResult !== null && contextFormatResult !== void 0 ? contextFormatResult : formatResult,
135
+ onSuccess: contextOnSuccess !== null && contextOnSuccess !== void 0 ? contextOnSuccess : onSuccess,
136
+ onError: contextOnError !== null && contextOnError !== void 0 ? contextOnError : onError,
137
+ formatParams: contextFormatParams !== null && contextFormatParams !== void 0 ? contextFormatParams : formatParams,
138
+ beforeRequest: contextBeforeRequest !== null && contextBeforeRequest !== void 0 ? contextBeforeRequest : beforeRequest,
139
+ extendParams: contextExtendParams !== null && contextExtendParams !== void 0 ? contextExtendParams : extendParams
140
+ }, requestDataKey, contextParams !== null && contextParams !== void 0 ? contextParams : params);
141
+
126
142
  (0, _react.useEffect)(function () {
127
143
  if (url || contextUrl) {
128
144
  setLoading(false);
129
- getData.run({});
145
+ request();
130
146
  } else {
131
147
  setLoading(false);
132
148
  }
133
- }, []);
134
- var getData = (0, _utils2.useRequest)(function (params) {
135
- var _ref;
136
-
137
- return _defineProperty({
138
- url: (_ref = contextUrl !== null && contextUrl !== void 0 ? contextUrl : url) !== null && _ref !== void 0 ? _ref : '',
139
- method: contextMethod !== null && contextMethod !== void 0 ? contextMethod : method
140
- }, requestDataKey, contextParams !== null && contextParams !== void 0 ? contextParams : params);
141
- }, {
142
- // 使用 request 方法代替 fetch
143
- requestMethod: function requestMethod(params) {
144
- return (0, _utils2.request)(params);
145
- },
146
- manual: true,
147
- onSuccess: function onSuccess(result) {
148
- props.onSuccess && props.onSuccess(result);
149
- },
150
- onError: function onError(error) {
149
+ }, []); // 获取数据
150
+
151
+ var request = function request() {
152
+ setLoading(true);
153
+ (0, _utils2.doCommonRequest)(requestConfig).then(function (resp) {
154
+ setData(resp);
155
+ }).finally(function () {
151
156
  setLoading(false);
152
- _onError === null || _onError === void 0 ? void 0 : _onError(error);
153
- }
154
- });
157
+ });
158
+ };
159
+
155
160
  var actionRef = (0, _react.useRef)(); // 将 Actions 绑定到传入的 propsActionRef 中
156
161
 
157
162
  if (propsActionRef) {
@@ -161,39 +166,58 @@ var ProInfo = function ProInfo(props) {
161
166
 
162
167
  (0, _utils.useActionType)(actionRef, {
163
168
  refresh: function refresh() {
164
- getData.run({});
169
+ request();
165
170
  }
166
171
  });
172
+
173
+ var getExtra = function getExtra() {
174
+ if (!extra) {
175
+ return undefined;
176
+ }
177
+
178
+ if ( /*#__PURE__*/(0, _react.isValidElement)(extra)) {
179
+ return extra;
180
+ }
181
+
182
+ return _objectSpread(_objectSpread({}, extra), {}, {
183
+ context: {
184
+ record: dataSource !== null && dataSource !== void 0 ? dataSource : data
185
+ }
186
+ });
187
+ };
188
+
167
189
  return /*#__PURE__*/_react.default.createElement("div", {
168
190
  ref: ref,
169
191
  className: "teamix-pro-info ".concat(className !== null && className !== void 0 ? className : ''),
170
192
  style: style
171
- }, /*#__PURE__*/_react.default.createElement(_.ProCard, _objectSpread(_objectSpread({
193
+ }, /*#__PURE__*/_react.default.createElement(_.ProCard, _objectSpread(_objectSpread(_objectSpread({
172
194
  compacted: true,
173
195
  hoveredShadow: false,
174
196
  bordered: false,
175
197
  backgroundColor: "transparent"
176
- }, header), others), type === 'table' && /*#__PURE__*/_react.default.createElement(_tableInfo.default, {
198
+ }, header), others), {}, {
199
+ extra: getExtra()
200
+ }), type === 'table' && /*#__PURE__*/_react.default.createElement(_tableInfo.default, {
177
201
  dataSource: dataSource,
178
202
  columns: columns,
179
- loading: loading || getData.loading,
180
- result: getDataSource(getData.data),
203
+ loading: userLoading || loading,
204
+ result: data,
181
205
  actionRef: actionRef,
182
206
  layout: layout
183
207
  }), type === 'header' && /*#__PURE__*/_react.default.createElement(_headerInfo.default, {
184
208
  dataSource: dataSource,
185
209
  columns: columns,
186
210
  header: header,
187
- loading: loading || getData.loading,
188
- result: getDataSource(getData.data),
211
+ loading: userLoading || loading,
212
+ result: data,
189
213
  actionRef: actionRef,
190
214
  layout: layout,
191
215
  size: size
192
216
  }), type === 'base' && /*#__PURE__*/_react.default.createElement(_baseInfo.default, {
193
217
  dataSource: dataSource,
194
218
  columns: columns,
195
- loading: loading || getData.loading,
196
- result: getDataSource(getData.data),
219
+ loading: userLoading || loading,
220
+ result: data,
197
221
  actionRef: actionRef,
198
222
  layout: layout,
199
223
  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,10 +45,13 @@ export declare type ProInfoBaseProps = {
40
45
  [key: string]: any;
41
46
  };
42
47
  /** 布局值 */
43
- layout?: BaseInfoLayoutProps;
44
- } & ProInfoHeaderProps;
45
- /** ProInfoItemProps info 单元格 定义 */
46
- export interface ProInfoItemProps {
48
+ layout?: ProBaseInfoLayoutProps;
49
+ /** 加载动画 */
50
+ loading?: boolean;
51
+ } & ProInfoHeaderProps & ProInfoRequestProps;
52
+ /** ProInfoColumnsProps info 单元格 定义 */
53
+ export declare type ProInfoItemProps = ProInfoColumnsProps;
54
+ export interface ProInfoColumnsProps {
47
55
  /** 标题 */
48
56
  title: string;
49
57
  /** 列表项展示的Tooltip */
@@ -53,11 +61,11 @@ export interface ProInfoItemProps {
53
61
  */
54
62
  tooltipIcon?: React.ReactNode;
55
63
  /** 对应 ProField 里面的 type */
56
- valueType?: IProFieldType;
64
+ valueType?: ProFieldType;
57
65
  /** 渲染单元格内容字段 */
58
66
  render?: ProInfoCellRender;
59
67
  /** 枚举值 */
60
- dataSource?: IProFieldOptionItem[] | ProInfoCellFunProp;
68
+ dataSource?: ProFieldDataSourceItem[] | ProInfoCellFunProp;
61
69
  /** 表头的筛选菜单项,当值为 true 时,自动使用 dataSource 生成 */
62
70
  filters?: boolean;
63
71
  /** 操作组配置 */
@@ -81,7 +89,7 @@ export interface ProInfoItemProps {
81
89
  /** 编辑请求成功提示文案 */
82
90
  successMessage?: string;
83
91
  /** 列 actions 配置 */
84
- actions?: IActionButton[];
92
+ actions?: ProActionButtonProps[];
85
93
  /** 追加在列后 */
86
94
  extra?: React.ReactNode;
87
95
  }
@@ -96,31 +104,33 @@ export declare type IProProInfoItem = {
96
104
  /** 值 */
97
105
  value: React.ReactNode;
98
106
  /** 基础详情布局值 */
99
- baseInfoLayout?: BaseInfoLayoutProps;
107
+ baseInfoLayout?: ProBaseInfoLayoutProps;
100
108
  /** 头部详情布局值 */
101
- headerInfoLayout?: HeaderInfoLayoutProps;
109
+ headerInfoLayout?: ProHeaderInfoLayoutProps;
102
110
  /** loading 状态 */
103
111
  loading?: boolean;
104
- } & Pick<ProInfoItemProps, 'tooltip' | 'tooltipIcon'>;
112
+ } & Pick<ProInfoColumnsProps, 'tooltip' | 'tooltipIcon'>;
105
113
  /** header info 定义 */
106
114
  export declare type IProHeaderInfo = {
107
115
  /** 布局值 */
108
- layout?: HeaderInfoLayoutProps;
116
+ layout?: ProHeaderInfoLayoutProps;
109
117
  } & Omit<ProInfoBaseProps, 'layout'>;
110
118
  /** table info 定义 */
111
119
  export declare type IProTableInfo = {
112
120
  /** 布局值 */
113
121
  layout?: TableInfoLayoutProps;
114
122
  } & Omit<ProInfoBaseProps, 'layout'>;
123
+ declare type ProInfoBasePropsOmitLayout = Omit<ProInfoBaseProps, 'layout'>;
115
124
  /** ProInfo */
116
125
  export declare type ProInfoProps = {
117
126
  /** 布局值 */
118
- layout?: TableInfoLayoutProps | HeaderInfoLayoutProps | BaseInfoLayoutProps;
127
+ layout?: TableInfoLayoutProps | ProHeaderInfoLayoutProps | ProBaseInfoLayoutProps;
119
128
  /** 类型 */
120
129
  type?: 'base' | 'header' | 'table';
121
- } & Omit<ProInfoBaseProps, 'layout'> & ProInfoTransparentBase;
130
+ } & ProInfoBasePropsOmitLayout & ProInfoTransparentBase;
122
131
  export declare type IProHeaderInfoItem = {};
123
- export declare type BaseInfoLayoutProps = {
132
+ export declare type BaseInfoLayoutProps = ProBaseInfoLayoutProps;
133
+ export declare type ProBaseInfoLayoutProps = {
124
134
  span?: number;
125
135
  labelCol?: {
126
136
  span: number;
@@ -129,7 +139,8 @@ export declare type BaseInfoLayoutProps = {
129
139
  span: number;
130
140
  };
131
141
  };
132
- export declare type HeaderInfoLayoutProps = {
142
+ export declare type headerInfoLayout = ProHeaderInfoLayoutProps;
143
+ export declare type ProHeaderInfoLayoutProps = {
133
144
  /** label 间隔 */
134
145
  labelGutter?: number | string;
135
146
  /** 列数 宽度 */
@@ -137,31 +148,33 @@ export declare type HeaderInfoLayoutProps = {
137
148
  };
138
149
  /** infoGroup */
139
150
  export declare type ProInfoGroupProps = {
140
- children?: React.ReactNode[] | React.ReactNode;
141
- } & Pick<ProInfoBaseProps, 'params' | 'method' | 'url' | 'onSuccess' | 'onError' | 'formatResult'>;
142
- 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;
143
160
  export declare type InfoValueItemProps = {
144
- infoItem: ProInfoItemProps;
161
+ infoItem: ProInfoColumnsProps;
145
162
  record: any;
146
163
  actionRef?: React.MutableRefObject<ProInfoActionType | undefined>;
147
164
  render?: ProInfoCellRender;
148
- dataSource?: IProFieldOptionItem[] | ProInfoCellFunProp;
149
- } & Omit<IProFieldProps, 'render' | 'dataSource'>;
150
- export declare type ProInfoHeaderProps = CardProps;
165
+ dataSource?: ProFieldDataSourceItem[] | ProInfoCellFunProp;
166
+ } & Omit<ProFieldProps, 'render' | 'dataSource'>;
167
+ export declare type ProInfoHeaderProps = Omit<ProCardProps, 'loading'>;
151
168
  /** ProInfoGroupContextProps */
152
169
  export declare type ProInfoGroupContextProps = {
153
170
  /** 因为其他数据都为异步。visible 只用作标识 */
154
171
  visible?: boolean;
155
172
  layout?: ProInfoBaseProps['layout'];
156
- url?: ProInfoBaseProps['url'];
157
- params?: ProInfoBaseProps['params'];
158
- method?: ProInfoBaseProps['method'];
159
- formatResult?: ProInfoBaseProps['formatResult'];
160
173
  size?: {
161
174
  width?: number;
162
175
  height?: number;
163
176
  };
164
- };
177
+ } & ProInfoRequestProps;
165
178
  /** 基本透传类型 */
166
179
  export declare type ProInfoTransparentBase = {
167
180
  /**
@@ -181,4 +194,9 @@ export declare type ProInfoTransparentBase = {
181
194
  /** style */
182
195
  style?: React.CSSProperties;
183
196
  };
197
+ export declare type ProInfoTransRequestResult = {
198
+ loading: boolean;
199
+ result: any;
200
+ refresh?: () => void;
201
+ };
184
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";
@@ -66,7 +66,7 @@ var Loading = function Loading(props) {
66
66
  title: "",
67
67
  breadcrumb: []
68
68
  }),
69
- content: /*#__PURE__*/_react.default.createElement(_skeleton.BaseSkeleton.Content, null)
69
+ content: /*#__PURE__*/_react.default.createElement(_skeleton.ProSkeletonRaw.Content, null)
70
70
  }, props));
71
71
  };
72
72
 
@@ -1,29 +1,30 @@
1
1
  import React from 'react';
2
- import { ActionGroupProps } from '../actions';
2
+ import { TagProps, CloseableProps } from '@alicloudfe/components/types/tag';
3
+ import { ItemProps } from '@alicloudfe/components/types/breadcrumb';
4
+ import { ProActionGroupProps } from '../actions';
3
5
  import { ProInfoProps } from '../info';
4
6
  import './index.scss';
5
- export interface BreadcrumbItem {
6
- link?: string;
7
- text: string;
8
- }
9
- export interface LinkItem {
10
- link?: string;
11
- icon?: string;
12
- text: string;
13
- onClick?: (e?: React.MouseEvent<Element, MouseEvent>) => void;
14
- }
15
- export interface TagItem {
16
- type?: 'normal' | 'primary';
17
- color?: string;
18
- text: string;
7
+ export interface ProPageHeaderBreadcrumbItem extends ItemProps {
8
+ /**
9
+ * @deprecated 建议使用 children 代替
10
+ */
11
+ text?: string;
19
12
  }
13
+ export declare type ProPageHeaderTagItem = (TagProps | (CloseableProps & {
14
+ closable: true;
15
+ })) & {
16
+ /**
17
+ * @deprecated 建议使用 children 代替
18
+ */
19
+ text?: string;
20
+ };
20
21
  declare type Color = 'blue' | 'green' | 'orange' | 'red' | 'yellow' | string;
21
- export interface DataItem {
22
+ export declare type ProPageHeaderDataItem = {
22
23
  title: string;
23
24
  num: number;
24
25
  color?: Color;
25
- }
26
- export declare type PageHeaderProps = {
26
+ } & React.HTMLAttributes<HTMLElement>;
27
+ export declare type ProPageHeaderProps = {
27
28
  title?: React.ReactNode;
28
29
  description?: React.ReactNode;
29
30
  icon?: string;
@@ -33,12 +34,28 @@ export declare type PageHeaderProps = {
33
34
  goback?: string | boolean;
34
35
  image?: string;
35
36
  loading?: boolean;
36
- breadcrumb?: BreadcrumbItem[];
37
- extra?: ActionGroupProps | React.ReactNode;
38
- operation?: ActionGroupProps | React.ReactNode;
39
- tags?: TagItem[];
40
- data?: DataItem[];
37
+ breadcrumb?: ProPageHeaderBreadcrumbItem[];
38
+ extra?: ProActionGroupProps | React.ReactNode;
39
+ operation?: ProActionGroupProps | React.ReactNode;
40
+ tags?: ProPageHeaderTagItem[];
41
+ data?: ProPageHeaderDataItem[];
41
42
  info?: ProInfoProps | React.ReactNode;
42
43
  } & Omit<React.HTMLAttributes<HTMLElement>, 'title'>;
43
- declare const PageHeader: React.FC<PageHeaderProps>;
44
- export default PageHeader;
44
+ declare const ProPageHeader: React.FC<ProPageHeaderProps>;
45
+ export default ProPageHeader;
46
+ /**
47
+ * @deprecated 建议使用 ProPageHeaderBreadcrumbItem 代替
48
+ */
49
+ export declare type BreadcrumbItem = ProPageHeaderBreadcrumbItem;
50
+ /**
51
+ * @deprecated 建议使用 ProPageHeaderTagItem 代替
52
+ */
53
+ export declare type TagItem = ProPageHeaderTagItem;
54
+ /**
55
+ * @deprecated 建议使用 ProPageHeaderDataItem 代替
56
+ */
57
+ export declare type DataItem = ProPageHeaderDataItem;
58
+ /**
59
+ * @deprecated 建议使用 ProPageHeaderProps 代替
60
+ */
61
+ export declare type PageHeaderProps = ProPageHeaderProps;