@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/form/utils.js
CHANGED
@@ -24,6 +24,7 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
|
|
24
24
|
|
25
25
|
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
26
26
|
|
27
|
+
import { isVoidField } from '@formily/core';
|
27
28
|
import { useFormLayout, useFormShallowLayout } from '@teamix/formily';
|
28
29
|
import { isArr, isObj, getValueByValue } from '@teamix/utils';
|
29
30
|
import schemaNameMap from './schemaNameMap';
|
@@ -76,6 +77,42 @@ var mapStatus = function mapStatus(props, field) {
|
|
76
77
|
});
|
77
78
|
};
|
78
79
|
|
80
|
+
var patchDataSource = function patchDataSource() {
|
81
|
+
var dataSource = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
82
|
+
|
83
|
+
var removeEmptyChildren = function removeEmptyChildren(data) {
|
84
|
+
var result = _objectSpread({}, data);
|
85
|
+
|
86
|
+
if (!result.children || result.children.length === 0) {
|
87
|
+
delete result.children;
|
88
|
+
} else {
|
89
|
+
result.children = result.children.map(removeEmptyChildren);
|
90
|
+
}
|
91
|
+
|
92
|
+
return result;
|
93
|
+
};
|
94
|
+
|
95
|
+
return dataSource.map(removeEmptyChildren);
|
96
|
+
};
|
97
|
+
|
98
|
+
var mapDataSource = function mapDataSource(props, field) {
|
99
|
+
var _props$dataSource;
|
100
|
+
|
101
|
+
if (isVoidField(field)) {
|
102
|
+
return props;
|
103
|
+
}
|
104
|
+
|
105
|
+
return _objectSpread(_objectSpread({}, props), {}, {
|
106
|
+
dataSource: patchDataSource((_props$dataSource = props.dataSource) !== null && _props$dataSource !== void 0 ? _props$dataSource : field === null || field === void 0 ? void 0 : field.dataSource)
|
107
|
+
});
|
108
|
+
};
|
109
|
+
|
110
|
+
var mapMode = function mapMode(props, field) {
|
111
|
+
return _objectSpread(_objectSpread({}, props), {}, {
|
112
|
+
mode: (field === null || field === void 0 ? void 0 : field.readPretty) ? 'read' : 'edit'
|
113
|
+
});
|
114
|
+
};
|
115
|
+
|
79
116
|
var getRandomName = function getRandomName() {
|
80
117
|
var prefix = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'name';
|
81
118
|
return "".concat(prefix, "_").concat(Math.floor(Math.random() * Math.pow(10, 18)));
|
@@ -131,4 +168,4 @@ var mergeArrayValue = function mergeArrayValue(arr, v) {
|
|
131
168
|
return [].concat(_toConsumableArray(arr), [v]);
|
132
169
|
};
|
133
170
|
|
134
|
-
export {
|
171
|
+
export { mapSize, mapStatus, mapDataSource, mapMode, mergeArrayValue, getRandomName, mapSchemaName };
|
package/es/form/warning.d.ts
CHANGED
@@ -1,3 +1,3 @@
|
|
1
|
-
import type {
|
2
|
-
declare const warning:
|
1
|
+
import type { ProFormInitializeItem } from './typing';
|
2
|
+
declare const warning: ProFormInitializeItem;
|
3
3
|
export default warning;
|
package/es/index.d.ts
CHANGED
@@ -21,5 +21,5 @@ export * from './page-container';
|
|
21
21
|
export * from './page-header';
|
22
22
|
export * from './skeleton';
|
23
23
|
export * from './table';
|
24
|
-
declare const version = "1.1.
|
24
|
+
declare const version = "1.1.39";
|
25
25
|
export { version, ProAction, ProCard, ProField, ProForm, ProInfo, ProPageContainer, ProPageHeader, ProSkeleton, ProTable, hooks, nocode, templates, utils, };
|
package/es/index.js
CHANGED
@@ -25,6 +25,6 @@ export * from './page-container';
|
|
25
25
|
export * from './page-header';
|
26
26
|
export * from './skeleton';
|
27
27
|
export * from './table';
|
28
|
-
var version = '1.1.
|
28
|
+
var version = '1.1.39';
|
29
29
|
export { version, ProAction, ProCard, ProField, ProForm, ProInfo, // ProLayout,
|
30
30
|
ProPageContainer, ProPageHeader, ProSkeleton, ProTable, hooks, nocode, templates, utils };
|
@@ -1,35 +1,93 @@
|
|
1
|
-
|
1
|
+
var _excluded = ["children", "url", "method", "params", "formatResult", "onSuccess", "onError", "formatParams", "beforeRequest", "extendParams", "className", "compacted", "divider", "style", "backgroundColor"];
|
2
|
+
|
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
|
+
|
5
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
6
|
+
|
7
|
+
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
8
|
+
|
9
|
+
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
10
|
+
|
11
|
+
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
12
|
+
|
13
|
+
import React, { isValidElement, useRef } from 'react';
|
2
14
|
import { ProInfoGroupContext } from '../../utils';
|
3
15
|
import { useSize } from '@teamix/hooks';
|
4
16
|
import './index.scss';
|
17
|
+
import cls from 'classnames';
|
18
|
+
import ProInfo from '../..';
|
5
19
|
|
6
20
|
var ProInfoGroup = function ProInfoGroup(props) {
|
7
21
|
var children = props.children,
|
8
22
|
url = props.url,
|
9
23
|
method = props.method,
|
10
24
|
params = props.params,
|
11
|
-
formatResult = props.formatResult
|
25
|
+
formatResult = props.formatResult,
|
26
|
+
onSuccess = props.onSuccess,
|
27
|
+
onError = props.onError,
|
28
|
+
formatParams = props.formatParams,
|
29
|
+
beforeRequest = props.beforeRequest,
|
30
|
+
extendParams = props.extendParams,
|
31
|
+
_props$className = props.className,
|
32
|
+
className = _props$className === void 0 ? '' : _props$className,
|
33
|
+
_props$compacted = props.compacted,
|
34
|
+
compacted = _props$compacted === void 0 ? true : _props$compacted,
|
35
|
+
_props$divider = props.divider,
|
36
|
+
divider = _props$divider === void 0 ? true : _props$divider,
|
37
|
+
style = props.style,
|
38
|
+
_props$backgroundColo = props.backgroundColor,
|
39
|
+
backgroundColor = _props$backgroundColo === void 0 ? '' : _props$backgroundColo,
|
40
|
+
others = _objectWithoutProperties(props, _excluded);
|
41
|
+
|
12
42
|
var ref = useRef();
|
13
43
|
var size = useSize(ref);
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
formatResult: formatResult
|
44
|
+
var infoType = 'infoDom';
|
45
|
+
|
46
|
+
if (Array.isArray(children)) {
|
47
|
+
if ( /*#__PURE__*/isValidElement(children === null || children === void 0 ? void 0 : children[0])) {
|
48
|
+
infoType = 'infoDomGroup';
|
49
|
+
} else {
|
50
|
+
infoType = 'infoPropsGroup';
|
22
51
|
}
|
52
|
+
}
|
53
|
+
|
54
|
+
var providerValue = {
|
55
|
+
visible: true,
|
56
|
+
size: size,
|
57
|
+
url: url,
|
58
|
+
method: method,
|
59
|
+
params: params,
|
60
|
+
formatResult: formatResult,
|
61
|
+
onSuccess: onSuccess,
|
62
|
+
onError: onError,
|
63
|
+
formatParams: formatParams,
|
64
|
+
beforeRequest: beforeRequest,
|
65
|
+
extendParams: extendParams
|
66
|
+
};
|
67
|
+
var proInfoClassName = cls({
|
68
|
+
'teamix-pro-info-group-item': true,
|
69
|
+
'teamix-pro-info-group-item-divider': divider
|
70
|
+
});
|
71
|
+
return /*#__PURE__*/React.createElement(ProInfoGroupContext.Provider, {
|
72
|
+
value: providerValue
|
23
73
|
}, /*#__PURE__*/React.createElement("div", {
|
24
|
-
className: "teamix-pro-info-group",
|
74
|
+
className: "teamix-pro-info-group ".concat(backgroundColor, " ").concat(className),
|
75
|
+
style: style,
|
25
76
|
ref: ref
|
26
|
-
},
|
77
|
+
}, infoType === 'infoDomGroup' && (children === null || children === void 0 ? void 0 : children.map(function (item, index) {
|
27
78
|
return /*#__PURE__*/React.createElement("div", {
|
28
|
-
className:
|
79
|
+
className: proInfoClassName,
|
29
80
|
key: index
|
30
81
|
}, item);
|
31
|
-
})),
|
32
|
-
|
82
|
+
})), infoType === 'infoPropsGroup' && (children === null || children === void 0 ? void 0 : children.map(function (item, index) {
|
83
|
+
return /*#__PURE__*/React.createElement("div", {
|
84
|
+
className: proInfoClassName,
|
85
|
+
key: index
|
86
|
+
}, /*#__PURE__*/React.createElement(ProInfo, _objectSpread({
|
87
|
+
compacted: compacted
|
88
|
+
}, item)));
|
89
|
+
})), infoType === 'infoDom' && /*#__PURE__*/React.createElement("div", {
|
90
|
+
className: proInfoClassName
|
33
91
|
}, children)));
|
34
92
|
};
|
35
93
|
|
@@ -1,14 +1,32 @@
|
|
1
1
|
.teamix-pro-info-group {
|
2
2
|
&-item {
|
3
|
+
|
3
4
|
margin-top: 16px;
|
4
|
-
|
5
|
-
margin-bottom: 16px;
|
5
|
+
margin-bottom: 0;
|
6
6
|
|
7
7
|
.teamix-pro-info {
|
8
|
-
padding-bottom:
|
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 {
|
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
|
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,11 +128,14 @@ var InfoValueItem = function InfoValueItem(props) {
|
|
126
128
|
|
127
129
|
var renderAction = function renderAction() {
|
128
130
|
if (actions) {
|
129
|
-
return /*#__PURE__*/React.createElement(
|
131
|
+
return /*#__PURE__*/React.createElement(ProActionGroup, {
|
130
132
|
actions: actions,
|
131
133
|
type: "text",
|
132
134
|
style: {
|
133
135
|
marginLeft: '8px'
|
136
|
+
},
|
137
|
+
context: {
|
138
|
+
record: record
|
134
139
|
}
|
135
140
|
});
|
136
141
|
}
|
@@ -303,7 +308,7 @@ var InfoValueItem = function InfoValueItem(props) {
|
|
303
308
|
}
|
304
309
|
|
305
310
|
return /*#__PURE__*/React.createElement("div", {
|
306
|
-
className: cls()
|
311
|
+
className: cls('item-value')
|
307
312
|
}, /*#__PURE__*/React.createElement(ProField, _objectSpread({
|
308
313
|
type: type,
|
309
314
|
value: value,
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import { Grid } from '@alicloudfe/components';
|
2
|
-
import {
|
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(
|
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(
|
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);
|
@@ -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
|
-
|
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>;
|
@@ -19,28 +19,47 @@ var ProBaseInfo = function ProBaseInfo(props) {
|
|
19
19
|
actionRef = props.actionRef,
|
20
20
|
layout = props.layout,
|
21
21
|
size = props.size;
|
22
|
-
var defaultLayout = defaultLayoutMap[getLayout((_size$width = size === null || size === void 0 ? void 0 : size.width) !== null && _size$width !== void 0 ? _size$width : 0)]; //
|
22
|
+
var defaultLayout = defaultLayoutMap[getLayout((_size$width = size === null || size === void 0 ? void 0 : size.width) !== null && _size$width !== void 0 ? _size$width : 0)]; // 获取列内的布局参数
|
23
|
+
|
24
|
+
var getFormItemLayout = function getFormItemLayout(colspan) {
|
25
|
+
var formItemLayout = JSON.parse(JSON.stringify(defaultLayout.formItemLayout)); // 自定义布局
|
23
26
|
|
24
|
-
var getFormItemLayout = function getFormItemLayout() {
|
25
27
|
if (layout) {
|
26
28
|
var _layout$labelCol, _layout$wrapperCol;
|
27
29
|
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
30
|
+
var labelCol = (_layout$labelCol = layout === null || layout === void 0 ? void 0 : layout.labelCol) !== null && _layout$labelCol !== void 0 ? _layout$labelCol : defaultLayout.formItemLayout.labelCol;
|
31
|
+
var wrapperCol = (_layout$wrapperCol = layout === null || layout === void 0 ? void 0 : layout.wrapperCol) !== null && _layout$wrapperCol !== void 0 ? _layout$wrapperCol : defaultLayout.formItemLayout.wrapperCol;
|
32
|
+
formItemLayout.labelCol = labelCol;
|
33
|
+
formItemLayout.wrapperCol = wrapperCol;
|
34
|
+
}
|
35
|
+
|
36
|
+
var newLabelSpan = formItemLayout.labelCol.span;
|
37
|
+
var newWrapperSpan = formItemLayout.wrapperCol.span; // 计算合并列情况。label与wrapper需要重新计算
|
38
|
+
|
39
|
+
if (colspan) {
|
40
|
+
newLabelSpan = newLabelSpan / colspan;
|
41
|
+
newWrapperSpan = newWrapperSpan + (formItemLayout.labelCol.span - newLabelSpan);
|
32
42
|
}
|
33
43
|
|
34
|
-
|
44
|
+
var newFormItemLayout = {
|
45
|
+
labelCol: {
|
46
|
+
span: newLabelSpan
|
47
|
+
},
|
48
|
+
wrapperCol: {
|
49
|
+
span: newWrapperSpan
|
50
|
+
}
|
51
|
+
};
|
52
|
+
return Object.assign(formItemLayout, newFormItemLayout);
|
35
53
|
};
|
36
54
|
|
37
55
|
var renderContent = function renderContent() {
|
38
56
|
return columns.map(function (item, index) {
|
39
|
-
var _layout$span, _item$title, _item$valueType, _ref;
|
57
|
+
var _layout$span, _layout$span2, _item$title, _item$valueType, _ref, _item$colSpan;
|
40
58
|
|
41
59
|
var span = item.colSpan ? defaultLayout.span * item.colSpan : defaultLayout.span;
|
60
|
+
var layoutSpan = item.colSpan ? ((_layout$span = layout === null || layout === void 0 ? void 0 : layout.span) !== null && _layout$span !== void 0 ? _layout$span : span) * item.colSpan : (_layout$span2 = layout === null || layout === void 0 ? void 0 : layout.span) !== null && _layout$span2 !== void 0 ? _layout$span2 : span;
|
42
61
|
return /*#__PURE__*/React.createElement(Col, {
|
43
|
-
span:
|
62
|
+
span: layoutSpan,
|
44
63
|
key: index
|
45
64
|
}, /*#__PURE__*/React.createElement(ProInfoItem, {
|
46
65
|
label: (_item$title = item === null || item === void 0 ? void 0 : item.title) !== null && _item$title !== void 0 ? _item$title : '',
|
@@ -54,7 +73,7 @@ var ProBaseInfo = function ProBaseInfo(props) {
|
|
54
73
|
record: dataSource !== null && dataSource !== void 0 ? dataSource : result,
|
55
74
|
actionRef: actionRef
|
56
75
|
}),
|
57
|
-
baseInfoLayout: getFormItemLayout(),
|
76
|
+
baseInfoLayout: getFormItemLayout((_item$colSpan = item === null || item === void 0 ? void 0 : item.colSpan) !== null && _item$colSpan !== void 0 ? _item$colSpan : 0),
|
58
77
|
tooltip: item.tooltip,
|
59
78
|
tooltipIcon: item.tooltipIcon
|
60
79
|
}));
|
@@ -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 &
|
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
|
-
|
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 {
|
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(
|
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'] = {
|