@teamix/pro 1.1.37 → 1.2.0
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.
- package/README.md +14 -10
- package/dist/pro.css +1 -1
- package/dist/pro.js +2486 -3754
- package/dist/pro.min.css +1 -1
- package/dist/pro.min.js +1 -1
- package/es/actions/dialog-form.d.ts +5 -5
- package/es/actions/dialog-form.js +1 -5
- package/es/actions/dialog.d.ts +12 -0
- package/es/actions/dialog.js +104 -27
- package/es/actions/index.d.ts +54 -47
- package/es/actions/index.js +28 -22
- package/es/actions/index.scss +48 -2
- package/es/actions/request.d.ts +1 -1
- package/es/actions/request.js +2 -2
- package/es/card/index.d.ts +17 -5
- package/es/card/index.js +16 -11
- package/es/form/Components/ProField/index.d.ts +1 -161
- package/es/form/Components/ProField/index.js +34 -40
- package/es/form/Filter/index.js +2 -2
- package/es/form/ProForm/index.d.ts +2 -2
- package/es/form/ProForm/index.js +1 -6
- package/es/form/ProForm/index.scss +19 -1
- package/es/form/ProForm/useFieldRequest.d.ts +5 -0
- package/es/form/ProForm/useFieldRequest.js +26 -0
- package/es/form/SchemaForm/adapterDecorator.js +2 -2
- package/es/form/SchemaForm/index.d.ts +2 -2
- package/es/form/SchemaForm/index.js +12 -21
- package/es/form/SchemaForm/initializeArrayCards.d.ts +2 -2
- package/es/form/SchemaForm/initializeArrayCollapse.d.ts +2 -2
- package/es/form/SchemaForm/initializeArrayItems.d.ts +2 -2
- package/es/form/SchemaForm/initializeArrayTable.d.ts +2 -2
- package/es/form/SchemaForm/initializeDataSource.d.ts +2 -2
- package/es/form/SchemaForm/initializeDataSource.js +2 -2
- package/es/form/SchemaForm/initializeFormButton.d.ts +2 -2
- package/es/form/SchemaForm/initializeFormCollapse.d.ts +2 -2
- package/es/form/SchemaForm/initializeFormGroup.d.ts +2 -2
- package/es/form/SchemaForm/initializeFormStep.d.ts +3 -3
- package/es/form/SchemaForm/initializeFormTab.d.ts +2 -2
- package/es/form/SchemaForm/initializeRequest.d.ts +2 -2
- package/es/form/SchemaForm/initializeRequest.js +2 -2
- package/es/form/SchemaForm/initializeRules.js +44 -16
- package/es/form/SchemaForm/reactions.d.ts +5 -5
- package/es/form/SchemaForm/reactions.js +20 -18
- package/es/form/fieldTypeMap.d.ts +4 -0
- package/es/form/fieldTypeMap.js +41 -0
- package/es/form/index.d.ts +92 -4
- package/es/form/index.js +18 -5
- package/es/form/schemaNameMap.js +3 -0
- package/es/form/typing.d.ts +49 -26
- package/es/form/utils.d.ts +3 -1
- package/es/form/utils.js +38 -1
- package/es/form/warning.d.ts +2 -2
- package/es/index.d.ts +1 -1
- package/es/index.js +1 -1
- package/es/info/components/InfoGroup/index.js +73 -15
- package/es/info/components/InfoGroup/index.scss +45 -3
- package/es/info/components/InfoValueItem/index.js +9 -4
- package/es/info/components/InfoValueItem/index.scss +5 -1
- package/es/info/components/ProInfoItem/index.js +3 -3
- package/es/info/components/ProInfoItem/index.scss +1 -0
- package/es/info/components/baseInfo/index.d.ts +2 -3
- package/es/info/components/baseInfo/index.js +29 -10
- package/es/info/components/headerInfo/index.d.ts +2 -3
- package/es/info/components/tableInfo/index.d.ts +2 -3
- package/es/info/components/tableInfo/index.js +2 -2
- package/es/info/index.js +75 -51
- package/es/info/typing.d.ts +54 -36
- package/es/info/utils/index.d.ts +2 -2
- package/es/info/utils/utils.d.ts +1 -1
- package/es/nocode/pages/renderer.js +2 -2
- package/es/page-header/index.d.ts +34 -21
- package/es/page-header/index.js +39 -30
- package/es/page-header/index.scss +2 -1
- package/es/table/components/EmptyContent/index.d.ts +2 -0
- package/es/table/components/EmptyContent/index.js +11 -0
- package/es/table/components/Filter/index.d.ts +2 -2
- package/es/table/components/Filter/index.js +23 -10
- package/es/table/components/Filter/index.scss +1 -1
- package/es/table/components/Layout/index.js +2 -2
- package/es/table/components/QuickAction/index.d.ts +2 -2
- package/es/table/components/QuickAction/index.js +3 -3
- package/es/table/components/ToolBar/Fullscreen.js +1 -0
- package/es/table/index.js +76 -14
- package/es/table/index.scss +4 -0
- package/es/table/typing.d.ts +29 -14
- package/es/table/utils/columnRender.d.ts +3 -3
- package/es/table/utils/columnRender.js +2 -2
- package/es/table/utils/genProColumnToColumn.d.ts +2 -2
- package/es/table/utils/genProColumnToColumn.js +1 -1
- package/es/table/utils/index.js +33 -11
- package/es/templates/List/index.d.ts +2 -2
- package/es/utils/message.d.ts +3 -0
- package/es/utils/message.js +19 -0
- package/lib/actions/dialog-form.d.ts +5 -5
- package/lib/actions/dialog-form.js +1 -5
- package/lib/actions/dialog.d.ts +12 -0
- package/lib/actions/dialog.js +108 -26
- package/lib/actions/index.d.ts +54 -47
- package/lib/actions/index.js +37 -30
- package/lib/actions/index.scss +48 -2
- package/lib/actions/request.d.ts +1 -1
- package/lib/actions/request.js +2 -2
- package/lib/card/index.d.ts +17 -5
- package/lib/card/index.js +18 -12
- package/lib/form/Components/ProField/index.d.ts +1 -161
- package/lib/form/Components/ProField/index.js +32 -38
- package/lib/form/Filter/index.js +2 -2
- package/lib/form/ProForm/index.d.ts +2 -2
- package/lib/form/ProForm/index.js +1 -7
- package/lib/form/ProForm/index.scss +19 -1
- package/lib/form/ProForm/useFieldRequest.d.ts +5 -0
- package/lib/form/ProForm/useFieldRequest.js +37 -0
- package/lib/form/SchemaForm/adapterDecorator.js +4 -2
- package/lib/form/SchemaForm/index.d.ts +2 -2
- package/lib/form/SchemaForm/index.js +11 -22
- package/lib/form/SchemaForm/initializeArrayCards.d.ts +2 -2
- package/lib/form/SchemaForm/initializeArrayCollapse.d.ts +2 -2
- package/lib/form/SchemaForm/initializeArrayItems.d.ts +2 -2
- package/lib/form/SchemaForm/initializeArrayTable.d.ts +2 -2
- package/lib/form/SchemaForm/initializeDataSource.d.ts +2 -2
- package/lib/form/SchemaForm/initializeDataSource.js +2 -2
- package/lib/form/SchemaForm/initializeFormButton.d.ts +2 -2
- package/lib/form/SchemaForm/initializeFormCollapse.d.ts +2 -2
- package/lib/form/SchemaForm/initializeFormGroup.d.ts +2 -2
- package/lib/form/SchemaForm/initializeFormStep.d.ts +3 -3
- package/lib/form/SchemaForm/initializeFormTab.d.ts +2 -2
- package/lib/form/SchemaForm/initializeRequest.d.ts +2 -2
- package/lib/form/SchemaForm/initializeRequest.js +1 -1
- package/lib/form/SchemaForm/initializeRules.js +41 -13
- package/lib/form/SchemaForm/reactions.d.ts +5 -5
- package/lib/form/SchemaForm/reactions.js +22 -20
- package/lib/form/fieldTypeMap.d.ts +4 -0
- package/lib/form/fieldTypeMap.js +48 -0
- package/lib/form/index.d.ts +92 -4
- package/lib/form/index.js +17 -31
- package/lib/form/schemaNameMap.js +3 -0
- package/lib/form/typing.d.ts +49 -26
- package/lib/form/utils.d.ts +3 -1
- package/lib/form/utils.js +43 -1
- package/lib/form/warning.d.ts +2 -2
- package/lib/index.d.ts +1 -1
- package/lib/index.js +1 -1
- package/lib/info/components/InfoGroup/index.js +76 -14
- package/lib/info/components/InfoGroup/index.scss +45 -3
- package/lib/info/components/InfoValueItem/index.js +8 -3
- package/lib/info/components/InfoValueItem/index.scss +5 -1
- package/lib/info/components/ProInfoItem/index.js +2 -2
- package/lib/info/components/ProInfoItem/index.scss +1 -0
- package/lib/info/components/baseInfo/index.d.ts +2 -3
- package/lib/info/components/baseInfo/index.js +29 -10
- package/lib/info/components/headerInfo/index.d.ts +2 -3
- package/lib/info/components/tableInfo/index.d.ts +2 -3
- package/lib/info/components/tableInfo/index.js +1 -1
- package/lib/info/index.js +73 -49
- package/lib/info/typing.d.ts +54 -36
- package/lib/info/utils/index.d.ts +2 -2
- package/lib/info/utils/utils.d.ts +1 -1
- package/lib/nocode/pages/renderer.js +1 -1
- package/lib/page-header/index.d.ts +34 -21
- package/lib/page-header/index.js +37 -28
- package/lib/page-header/index.scss +2 -1
- package/lib/table/components/EmptyContent/index.d.ts +2 -0
- package/lib/table/components/EmptyContent/index.js +25 -0
- package/lib/table/components/Filter/index.d.ts +2 -2
- package/lib/table/components/Filter/index.js +23 -10
- package/lib/table/components/Filter/index.scss +1 -1
- package/lib/table/components/Layout/index.js +1 -1
- package/lib/table/components/QuickAction/index.d.ts +2 -2
- package/lib/table/components/QuickAction/index.js +1 -1
- package/lib/table/components/ToolBar/Fullscreen.js +1 -0
- package/lib/table/index.js +77 -14
- package/lib/table/index.scss +4 -0
- package/lib/table/typing.d.ts +29 -14
- package/lib/table/utils/columnRender.d.ts +3 -3
- package/lib/table/utils/columnRender.js +1 -1
- package/lib/table/utils/genProColumnToColumn.d.ts +2 -2
- package/lib/table/utils/genProColumnToColumn.js +2 -2
- package/lib/table/utils/index.js +33 -11
- package/lib/templates/List/index.d.ts +2 -2
- package/lib/utils/message.d.ts +3 -0
- package/lib/utils/message.js +32 -0
- package/package.json +4 -4
- package/es/form/Components/Search/index.d.ts +0 -11
- package/es/form/Components/Search/index.js +0 -89
- package/es/form/SchemaForm/initializeArrayIcon.d.ts +0 -3
- package/es/form/SchemaForm/initializeArrayIcon.js +0 -62
- package/es/form/SchemaForm/initializeProField.d.ts +0 -5
- package/es/form/SchemaForm/initializeProField.js +0 -70
- package/es/info/utils/useInfoRequest.d.ts +0 -14
- package/es/info/utils/useInfoRequest.js +0 -76
- package/lib/form/Components/Search/index.d.ts +0 -11
- package/lib/form/Components/Search/index.js +0 -103
- package/lib/form/SchemaForm/initializeArrayIcon.d.ts +0 -3
- package/lib/form/SchemaForm/initializeArrayIcon.js +0 -73
- package/lib/form/SchemaForm/initializeProField.d.ts +0 -5
- package/lib/form/SchemaForm/initializeProField.js +0 -77
- package/lib/info/utils/useInfoRequest.d.ts +0 -14
- package/lib/info/utils/useInfoRequest.js +0 -85
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"];
|
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
|
|
@@ -22,35 +22,43 @@ function _objectWithoutProperties(source, excluded) { if (source == null) return
|
|
22
22
|
|
23
23
|
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; }
|
24
24
|
|
25
|
-
import React, { useContext, useEffect, useRef, useState } from 'react';
|
25
|
+
import React, { isValidElement, useContext, useEffect, useRef, useState } from 'react';
|
26
26
|
import ProTableInfo from './components/tableInfo';
|
27
27
|
import ProHeaderInfo from './components/headerInfo';
|
28
28
|
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 {
|
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
|
-
|
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,
|
52
58
|
layout = props.layout,
|
53
59
|
dataSource = props.dataSource,
|
60
|
+
userLoading = props.loading,
|
61
|
+
extra = props.extra,
|
54
62
|
others = _objectWithoutProperties(props, _excluded);
|
55
63
|
|
56
64
|
var _useContext = useContext(ProInfoGroupContext),
|
@@ -59,62 +67,59 @@ var ProInfo = function ProInfo(props) {
|
|
59
67
|
contextParams = _useContext.params,
|
60
68
|
contextFormatResult = _useContext.formatResult,
|
61
69
|
contextVisible = _useContext.visible,
|
62
|
-
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; // 获取容器宽度
|
63
76
|
|
64
77
|
|
65
78
|
var ref = useRef();
|
66
|
-
var size = contextVisible ? contextSize : useSize(ref);
|
79
|
+
var size = contextVisible ? contextSize : useSize(ref);
|
67
80
|
|
68
81
|
var _useState = useState(false),
|
69
82
|
_useState2 = _slicedToArray(_useState, 2),
|
70
83
|
loading = _useState2[0],
|
71
|
-
setLoading = _useState2[1]; //
|
84
|
+
setLoading = _useState2[1]; // 请求数据
|
72
85
|
|
73
86
|
|
74
|
-
var
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
} else if (formatResult) {
|
79
|
-
return getDeepValue(formatResult.data, result);
|
80
|
-
} else {
|
81
|
-
return result;
|
82
|
-
}
|
83
|
-
}
|
84
|
-
|
85
|
-
return result;
|
86
|
-
};
|
87
|
+
var _useState3 = useState(),
|
88
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
89
|
+
data = _useState4[0],
|
90
|
+
setData = _useState4[1];
|
87
91
|
|
88
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
|
+
|
89
105
|
useEffect(function () {
|
90
106
|
if (url || contextUrl) {
|
91
107
|
setLoading(false);
|
92
|
-
|
108
|
+
request();
|
93
109
|
} else {
|
94
110
|
setLoading(false);
|
95
111
|
}
|
96
|
-
}, []);
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
}, requestDataKey, contextParams !== null && contextParams !== void 0 ? contextParams : params);
|
104
|
-
}, {
|
105
|
-
// 使用 request 方法代替 fetch
|
106
|
-
requestMethod: function requestMethod(params) {
|
107
|
-
return utilResquest(params);
|
108
|
-
},
|
109
|
-
manual: true,
|
110
|
-
onSuccess: function onSuccess(result) {
|
111
|
-
props.onSuccess && props.onSuccess(result);
|
112
|
-
},
|
113
|
-
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 () {
|
114
119
|
setLoading(false);
|
115
|
-
|
116
|
-
|
117
|
-
|
120
|
+
});
|
121
|
+
};
|
122
|
+
|
118
123
|
var actionRef = useRef(); // 将 Actions 绑定到传入的 propsActionRef 中
|
119
124
|
|
120
125
|
if (propsActionRef) {
|
@@ -124,39 +129,58 @@ var ProInfo = function ProInfo(props) {
|
|
124
129
|
|
125
130
|
useActionType(actionRef, {
|
126
131
|
refresh: function refresh() {
|
127
|
-
|
132
|
+
request();
|
128
133
|
}
|
129
134
|
});
|
135
|
+
|
136
|
+
var getExtra = function getExtra() {
|
137
|
+
if (!extra) {
|
138
|
+
return undefined;
|
139
|
+
}
|
140
|
+
|
141
|
+
if ( /*#__PURE__*/isValidElement(extra)) {
|
142
|
+
return extra;
|
143
|
+
}
|
144
|
+
|
145
|
+
return _objectSpread(_objectSpread({}, extra), {}, {
|
146
|
+
context: {
|
147
|
+
record: dataSource !== null && dataSource !== void 0 ? dataSource : data
|
148
|
+
}
|
149
|
+
});
|
150
|
+
};
|
151
|
+
|
130
152
|
return /*#__PURE__*/React.createElement("div", {
|
131
153
|
ref: ref,
|
132
154
|
className: "teamix-pro-info ".concat(className !== null && className !== void 0 ? className : ''),
|
133
155
|
style: style
|
134
|
-
}, /*#__PURE__*/React.createElement(ProCard, _objectSpread(_objectSpread({
|
156
|
+
}, /*#__PURE__*/React.createElement(ProCard, _objectSpread(_objectSpread(_objectSpread({
|
135
157
|
compacted: true,
|
136
158
|
hoveredShadow: false,
|
137
159
|
bordered: false,
|
138
160
|
backgroundColor: "transparent"
|
139
|
-
}, header), others),
|
161
|
+
}, header), others), {}, {
|
162
|
+
extra: getExtra()
|
163
|
+
}), type === 'table' && /*#__PURE__*/React.createElement(ProTableInfo, {
|
140
164
|
dataSource: dataSource,
|
141
165
|
columns: columns,
|
142
|
-
loading:
|
143
|
-
result:
|
166
|
+
loading: userLoading || loading,
|
167
|
+
result: data,
|
144
168
|
actionRef: actionRef,
|
145
169
|
layout: layout
|
146
170
|
}), type === 'header' && /*#__PURE__*/React.createElement(ProHeaderInfo, {
|
147
171
|
dataSource: dataSource,
|
148
172
|
columns: columns,
|
149
173
|
header: header,
|
150
|
-
loading:
|
151
|
-
result:
|
174
|
+
loading: userLoading || loading,
|
175
|
+
result: data,
|
152
176
|
actionRef: actionRef,
|
153
177
|
layout: layout,
|
154
178
|
size: size
|
155
179
|
}), type === 'base' && /*#__PURE__*/React.createElement(ProBaseInfo, {
|
156
180
|
dataSource: dataSource,
|
157
181
|
columns: columns,
|
158
|
-
loading:
|
159
|
-
result:
|
182
|
+
loading: userLoading || loading,
|
183
|
+
result: data,
|
160
184
|
actionRef: actionRef,
|
161
185
|
layout: layout,
|
162
186
|
size: size
|
package/es/info/typing.d.ts
CHANGED
@@ -1,18 +1,16 @@
|
|
1
|
-
import {
|
2
|
-
import { ActionGroupProps,
|
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 {
|
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
|
9
|
+
declare type FieldRenderProps = keyof ProFieldRenderProps;
|
9
10
|
declare type ProInfoCellRender = {
|
10
|
-
[key in FieldRenderProps]?:
|
11
|
+
[key in FieldRenderProps]?: ProFieldRenderProps[key] | ProInfoCellFunProp;
|
11
12
|
} | ((...other: any) => React.ReactNode);
|
12
|
-
|
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?:
|
44
|
-
|
45
|
-
|
46
|
-
|
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?:
|
64
|
+
valueType?: ProFieldType;
|
57
65
|
/** 渲染单元格内容字段 */
|
58
66
|
render?: ProInfoCellRender;
|
59
67
|
/** 枚举值 */
|
60
|
-
dataSource?:
|
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?:
|
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?:
|
107
|
+
baseInfoLayout?: ProBaseInfoLayoutProps;
|
100
108
|
/** 头部详情布局值 */
|
101
|
-
headerInfoLayout?:
|
109
|
+
headerInfoLayout?: ProHeaderInfoLayoutProps;
|
102
110
|
/** loading 状态 */
|
103
111
|
loading?: boolean;
|
104
|
-
} & Pick<
|
112
|
+
} & Pick<ProInfoColumnsProps, 'tooltip' | 'tooltipIcon'>;
|
105
113
|
/** header info 定义 */
|
106
114
|
export declare type IProHeaderInfo = {
|
107
115
|
/** 布局值 */
|
108
|
-
layout?:
|
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 |
|
127
|
+
layout?: TableInfoLayoutProps | ProHeaderInfoLayoutProps | ProBaseInfoLayoutProps;
|
119
128
|
/** 类型 */
|
120
129
|
type?: 'base' | 'header' | 'table';
|
121
|
-
} &
|
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
|
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
|
-
|
142
|
-
|
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:
|
161
|
+
infoItem: ProInfoColumnsProps;
|
145
162
|
record: any;
|
146
163
|
actionRef?: React.MutableRefObject<ProInfoActionType | undefined>;
|
147
164
|
render?: ProInfoCellRender;
|
148
|
-
dataSource?:
|
149
|
-
} & Omit<
|
150
|
-
export declare type ProInfoHeaderProps =
|
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 {};
|
package/es/info/utils/index.d.ts
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
import React from 'react';
|
2
|
-
import { ProInfoActionType, ProInfoGroupContextProps,
|
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:
|
12
|
+
export declare function getDataIndexValue(dataIndex: ProInfoColumnsProps['dataIndex'], dataSource: object): any;
|
package/es/info/utils/utils.d.ts
CHANGED
@@ -1 +1 @@
|
|
1
|
-
export declare function getLayout(width: number): "
|
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 {
|
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(
|
52
|
+
content: /*#__PURE__*/React.createElement(ProSkeletonRaw.Content, null)
|
53
53
|
}, props));
|
54
54
|
};
|
55
55
|
|
@@ -1,19 +1,16 @@
|
|
1
1
|
import React from 'react';
|
2
2
|
import { TagProps, CloseableProps } from '@alicloudfe/components/types/tag';
|
3
|
-
import {
|
3
|
+
import { ItemProps } from '@alicloudfe/components/types/breadcrumb';
|
4
|
+
import { ProActionGroupProps } from '../actions';
|
4
5
|
import { ProInfoProps } from '../info';
|
5
6
|
import './index.scss';
|
6
|
-
export interface
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
link?: string;
|
12
|
-
icon?: string;
|
13
|
-
text: string;
|
14
|
-
onClick?: (e?: React.MouseEvent<Element, MouseEvent>) => void;
|
7
|
+
export interface ProPageHeaderBreadcrumbItem extends ItemProps {
|
8
|
+
/**
|
9
|
+
* @deprecated 建议使用 children 代替
|
10
|
+
*/
|
11
|
+
text?: string;
|
15
12
|
}
|
16
|
-
export declare type
|
13
|
+
export declare type ProPageHeaderTagItem = (TagProps | (CloseableProps & {
|
17
14
|
closable: true;
|
18
15
|
})) & {
|
19
16
|
/**
|
@@ -22,12 +19,12 @@ export declare type TagItem = (TagProps | (CloseableProps & {
|
|
22
19
|
text?: string;
|
23
20
|
};
|
24
21
|
declare type Color = 'blue' | 'green' | 'orange' | 'red' | 'yellow' | string;
|
25
|
-
export
|
22
|
+
export declare type ProPageHeaderDataItem = {
|
26
23
|
title: string;
|
27
24
|
num: number;
|
28
25
|
color?: Color;
|
29
|
-
}
|
30
|
-
export declare type
|
26
|
+
} & React.HTMLAttributes<HTMLElement>;
|
27
|
+
export declare type ProPageHeaderProps = {
|
31
28
|
title?: React.ReactNode;
|
32
29
|
description?: React.ReactNode;
|
33
30
|
icon?: string;
|
@@ -37,12 +34,28 @@ export declare type PageHeaderProps = {
|
|
37
34
|
goback?: string | boolean;
|
38
35
|
image?: string;
|
39
36
|
loading?: boolean;
|
40
|
-
breadcrumb?:
|
41
|
-
extra?:
|
42
|
-
operation?:
|
43
|
-
tags?:
|
44
|
-
data?:
|
37
|
+
breadcrumb?: ProPageHeaderBreadcrumbItem[];
|
38
|
+
extra?: ProActionGroupProps | React.ReactNode;
|
39
|
+
operation?: ProActionGroupProps | React.ReactNode;
|
40
|
+
tags?: ProPageHeaderTagItem[];
|
41
|
+
data?: ProPageHeaderDataItem[];
|
45
42
|
info?: ProInfoProps | React.ReactNode;
|
46
43
|
} & Omit<React.HTMLAttributes<HTMLElement>, 'title'>;
|
47
|
-
declare const
|
48
|
-
export default
|
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;
|