@teamix/pro 1.1.34 → 1.1.38
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/dist/pro.css +1 -1
- package/dist/pro.js +1069 -334
- package/dist/pro.min.css +1 -1
- package/dist/pro.min.js +1 -1
- package/es/actions/dialog-form.d.ts +8 -1
- package/es/actions/dialog-form.js +32 -15
- package/es/actions/dialog-info.d.ts +9 -0
- package/es/actions/dialog-info.js +23 -0
- package/es/actions/dialog.d.ts +11 -0
- package/es/actions/dialog.js +105 -28
- package/es/actions/drawer-info.d.ts +6 -0
- package/es/actions/drawer-info.js +7 -0
- package/es/actions/index.d.ts +11 -5
- package/es/actions/index.js +28 -12
- package/es/actions/index.scss +39 -0
- package/es/actions/link.js +4 -12
- package/es/actions/request.d.ts +1 -1
- package/es/actions/request.js +2 -2
- package/es/form/Components/ProField/index.d.ts +1 -84
- package/es/form/SchemaForm/reactions.js +4 -2
- package/es/form/typing.d.ts +5 -5
- package/es/index.d.ts +1 -1
- package/es/index.js +1 -1
- package/es/info/components/{headerInfo → HeaderInfo}/index.d.ts +3 -1
- package/es/info/components/HeaderInfo/index.js +68 -0
- package/es/info/components/{headerInfo → HeaderInfo}/index.scss +0 -0
- package/es/info/components/InfoValueItem/index.js +111 -26
- package/es/info/components/{tableInfo → TableInfo}/index.d.ts +0 -0
- package/es/info/components/{tableInfo → TableInfo}/index.js +4 -21
- package/es/info/components/{tableInfo → TableInfo}/index.scss +0 -0
- package/es/info/components/baseInfo/index.d.ts +3 -1
- package/es/info/components/baseInfo/index.js +34 -42
- package/es/info/index.js +69 -26
- package/es/info/index.scss +0 -4
- package/es/info/typing.d.ts +17 -6
- package/es/page-header/index.d.ts +9 -5
- package/es/page-header/index.js +22 -7
- package/es/table/components/Filter/index.js +7 -2
- package/es/table/components/Filter/index.scss +1 -1
- package/es/table/typing.d.ts +2 -0
- package/lib/actions/dialog-form.d.ts +8 -1
- package/lib/actions/dialog-form.js +32 -15
- package/lib/actions/dialog-info.d.ts +9 -0
- package/lib/actions/dialog-info.js +37 -0
- package/lib/actions/dialog.d.ts +11 -0
- package/lib/actions/dialog.js +108 -27
- package/lib/actions/drawer-info.d.ts +6 -0
- package/lib/actions/drawer-info.js +18 -0
- package/lib/actions/index.d.ts +11 -5
- package/lib/actions/index.js +30 -12
- package/lib/actions/index.scss +39 -0
- package/lib/actions/link.js +5 -12
- package/lib/actions/request.d.ts +1 -1
- package/lib/actions/request.js +2 -2
- package/lib/form/Components/ProField/index.d.ts +1 -84
- package/lib/form/SchemaForm/reactions.js +4 -2
- package/lib/form/typing.d.ts +5 -5
- package/lib/index.d.ts +1 -1
- package/lib/index.js +1 -1
- package/lib/info/components/{headerInfo → HeaderInfo}/index.d.ts +3 -1
- package/lib/info/components/HeaderInfo/index.js +87 -0
- package/lib/info/components/{headerInfo → HeaderInfo}/index.scss +0 -0
- package/lib/info/components/InfoValueItem/index.js +110 -25
- package/lib/info/components/{tableInfo → TableInfo}/index.d.ts +0 -0
- package/lib/info/components/{tableInfo → TableInfo}/index.js +4 -22
- package/lib/info/components/{tableInfo → TableInfo}/index.scss +0 -0
- package/lib/info/components/baseInfo/index.d.ts +3 -1
- package/lib/info/components/baseInfo/index.js +33 -49
- package/lib/info/index.js +70 -25
- package/lib/info/index.scss +0 -4
- package/lib/info/typing.d.ts +17 -6
- package/lib/page-header/index.d.ts +9 -5
- package/lib/page-header/index.js +22 -7
- package/lib/table/components/Filter/index.js +7 -2
- package/lib/table/components/Filter/index.scss +1 -1
- package/lib/table/typing.d.ts +2 -0
- package/package.json +1 -1
- package/es/info/components/headerInfo/index.js +0 -99
- package/lib/info/components/headerInfo/index.js +0 -126
@@ -1,162 +1,79 @@
|
|
1
1
|
import React from 'react';
|
2
2
|
declare const _default: React.ForwardRefExoticComponent<(Partial<import("@teamix/pro-field/lib/components/FieldText").IProFieldText & {
|
3
3
|
type: "text";
|
4
|
-
} & {
|
5
|
-
children?: React.ReactNode;
|
6
4
|
}> | Partial<import("@teamix/pro-field/lib/components/FieldTextArea").IProFieldTextArea & {
|
7
5
|
type: "textarea";
|
8
|
-
} & {
|
9
|
-
children?: React.ReactNode;
|
10
6
|
}> | Partial<import("@teamix/pro-field/lib/components/FieldMoney").IProFieldMoney & {
|
11
7
|
type: "money";
|
12
|
-
} & {
|
13
|
-
children?: React.ReactNode;
|
14
8
|
}> | Partial<import("@teamix/pro-field/lib/components/FieldCheckBox").IProFieldCheckBox & {
|
15
9
|
type: "checkbox";
|
16
|
-
} & {
|
17
|
-
children?: React.ReactNode;
|
18
10
|
}> | Partial<import("@teamix/pro-field/lib/components/FieldRadio").IProFieldRadio & {
|
19
11
|
type: "radio";
|
20
|
-
} & {
|
21
|
-
children?: React.ReactNode;
|
22
12
|
}> | Partial<import("@teamix/pro-field/lib/components/FieldSelect").IProFieldSelect & {
|
23
13
|
type: "select";
|
24
|
-
} & {
|
25
|
-
children?: React.ReactNode;
|
26
14
|
}> | Partial<import("@teamix/pro-field/lib/components/FieldMultipleSelect").IProFieldMultipleSelect & {
|
27
15
|
type: "multipleSelect";
|
28
|
-
} & {
|
29
|
-
children?: React.ReactNode;
|
30
16
|
}> | Partial<import("@teamix/pro-field/lib/components/FieldDate").IProFieldDate & {
|
31
17
|
type: "date";
|
32
|
-
} & {
|
33
|
-
children?: React.ReactNode;
|
34
18
|
}> | Partial<import("@teamix/pro-field/lib/components/FieldDate").IProFieldDateWeek & {
|
35
19
|
type: "dateWeek";
|
36
|
-
} & {
|
37
|
-
children?: React.ReactNode;
|
38
20
|
}> | Partial<import("@teamix/pro-field/lib/components/FieldDate").IProFieldDateMonth & {
|
39
21
|
type: "dateMonth";
|
40
|
-
} & {
|
41
|
-
children?: React.ReactNode;
|
42
22
|
}> | Partial<import("@teamix/pro-field/lib/components/FieldDate").IProFieldDateYear & {
|
43
23
|
type: "dateYear";
|
44
|
-
} & {
|
45
|
-
children?: React.ReactNode;
|
46
24
|
}> | Partial<import("@teamix/pro-field/lib/components/FieldDate").IProFieldDateQuarter & {
|
47
25
|
type: "dateQuarter";
|
48
|
-
} & {
|
49
|
-
children?: React.ReactNode;
|
50
26
|
}> | Partial<import("@teamix/pro-field/lib/components/FieldDate").IProFieldDateRange & {
|
51
27
|
type: "dateRange";
|
52
|
-
} & {
|
53
|
-
children?: React.ReactNode;
|
54
28
|
}> | Partial<import("@teamix/pro-field/lib/components/FieldDate").IProFieldDateWeekRange & {
|
55
29
|
type: "dateWeekRange";
|
56
|
-
} & {
|
57
|
-
children?: React.ReactNode;
|
58
30
|
}> | Partial<import("@teamix/pro-field/lib/components/FieldDate").IProFieldDateMonthRange & {
|
59
31
|
type: "dateMonthRange";
|
60
|
-
} & {
|
61
|
-
children?: React.ReactNode;
|
62
32
|
}> | Partial<import("@teamix/pro-field/lib/components/FieldDate").IProFieldDateYearRange & {
|
63
33
|
type: "dateYearRange";
|
64
|
-
} & {
|
65
|
-
children?: React.ReactNode;
|
66
34
|
}> | Partial<import("@teamix/pro-field/lib/components/FieldDate").IProFieldDateQuarterRange & {
|
67
35
|
type: "dateQuarterRange";
|
68
|
-
} & {
|
69
|
-
children?: React.ReactNode;
|
70
36
|
}> | Partial<import("@teamix/pro-field/lib/components/FieldDate").IProFieldDateTime & {
|
71
37
|
type: "dateTime";
|
72
|
-
} & {
|
73
|
-
children?: React.ReactNode;
|
74
38
|
}> | Partial<import("@teamix/pro-field/lib/components/FieldDate").IProFieldDateTimeRange & {
|
75
39
|
type: "dateTimeRange";
|
76
|
-
} & {
|
77
|
-
children?: React.ReactNode;
|
78
40
|
}> | Partial<import("@teamix/pro-field/lib/components/FieldDate").IProFieldTime & {
|
79
41
|
type: "time";
|
80
|
-
} & {
|
81
|
-
children?: React.ReactNode;
|
82
42
|
}> | Partial<import("@teamix/pro-field/lib/components/FieldDate").IProFieldTimeRange & {
|
83
43
|
type: "timeRange";
|
84
|
-
} & {
|
85
|
-
children?: React.ReactNode;
|
86
44
|
}> | Partial<import("@teamix/pro-field/lib/components/FieldNumber").IProFieldNumber & {
|
87
45
|
type: "number";
|
88
|
-
} & {
|
89
|
-
children?: React.ReactNode;
|
90
46
|
}> | Partial<import("@teamix/pro-field/lib/components/FieldPercent").IProFieldPercent & {
|
91
47
|
type: "percent";
|
92
|
-
} & {
|
93
|
-
children?: React.ReactNode;
|
94
48
|
}> | Partial<import("@teamix/pro-field/lib/components/FieldCascader").IProFieldCascader & {
|
95
49
|
type: "cascader";
|
96
|
-
} & {
|
97
|
-
children?: React.ReactNode;
|
98
50
|
}> | Partial<import("@teamix/pro-field/lib/components/FieldCascader").IProFieldMultipleCascader & {
|
99
51
|
type: "multipleCascader";
|
100
|
-
} & {
|
101
|
-
children?: React.ReactNode;
|
102
52
|
}> | Partial<import("@teamix/pro-field/lib/components/FieldCascader").IProFieldArbitraryCascader & {
|
103
53
|
type: "arbitraryCascader";
|
104
|
-
} & {
|
105
|
-
children?: React.ReactNode;
|
106
54
|
}> | Partial<import("@teamix/pro-field/lib/components/FieldSwitch").IProFieldSwitch & {
|
107
55
|
type: "switch";
|
108
|
-
} & {
|
109
|
-
children?: React.ReactNode;
|
110
56
|
}> | Partial<import("@teamix/pro-field/lib/components/FieldColor").IProFieldColor & {
|
111
57
|
type: "color" | "colorSwatches" | "colorRadio" | "colorTwitter";
|
112
|
-
} & {
|
113
|
-
children?: React.ReactNode;
|
114
58
|
}> | Partial<import("@teamix/pro-field/lib/components/FieldIcon").IProFieldIcon & {
|
115
59
|
type: "icon";
|
116
|
-
} & {
|
117
|
-
children?: React.ReactNode;
|
118
60
|
}> | Partial<import("@teamix/pro-field/lib/components/FieldTreeSelect").IProFieldTreeSelect & {
|
119
61
|
type: "treeSelect";
|
120
|
-
} & {
|
121
|
-
children?: React.ReactNode;
|
122
62
|
}> | Partial<import("@teamix/pro-field/lib/components/FieldJson").IProFieldJson & {
|
123
63
|
type: "json";
|
124
|
-
} & {
|
125
|
-
children?: React.ReactNode;
|
126
64
|
}> | Partial<import("@teamix/pro-field/lib/components/FieldTransfer").IProFieldTransfer & {
|
127
65
|
type: "transfer";
|
128
|
-
} & {
|
129
|
-
children?: React.ReactNode;
|
130
66
|
}> | Partial<import("@teamix/pro-field/lib/components/FieldRange").IProFieldRange & {
|
131
67
|
type: "range";
|
132
|
-
} & {
|
133
|
-
children?: React.ReactNode;
|
134
68
|
}> | Partial<import("@teamix/pro-field/lib/components/FieldPassword").IProFieldPassword & {
|
135
69
|
type: "password";
|
136
|
-
} & {
|
137
|
-
children?: React.ReactNode;
|
138
70
|
}> | Partial<import("@teamix/pro-field/lib/components/FieldSearch").IProFieldSearch & {
|
139
71
|
type: "search";
|
140
|
-
} & {
|
141
|
-
children?: React.ReactNode;
|
142
72
|
}> | Partial<import("@teamix/pro-field/lib/components/FieldTagFilter").IProFieldTagFilter & {
|
143
73
|
type: "tagFilter";
|
144
|
-
} & {
|
145
|
-
children?: React.ReactNode;
|
146
74
|
}> | Partial<import("@teamix/pro-field/lib/components/FieldTagFilter").IProFieldMultipleTagFilter & {
|
147
75
|
type: "multipleTagPicker";
|
148
|
-
} & {
|
149
|
-
children?: React.ReactNode;
|
150
76
|
}> | Partial<import("@teamix/pro-field/lib/components/FieldMenuSelect").IProFieldMenuSelect & {
|
151
77
|
type: "menuSelect";
|
152
|
-
} &
|
153
|
-
children?: React.ReactNode;
|
154
|
-
}> | Pick<Partial<{
|
155
|
-
[key: string]: any;
|
156
|
-
type: string;
|
157
|
-
value?: any;
|
158
|
-
initValue?: any;
|
159
|
-
} & import("@teamix/pro-field").IProBaseField & {
|
160
|
-
children?: React.ReactNode;
|
161
|
-
}>, string | number>) & React.RefAttributes<unknown>>;
|
78
|
+
}> | Pick<Partial<import("@teamix/pro-field").IProFieldCustom>, keyof import("@teamix/pro-field").IProFieldCustom>) & React.RefAttributes<unknown>>;
|
162
79
|
export default _default;
|
@@ -8,6 +8,8 @@ import { isFn, doCommonRequest } from '@teamix/utils'; // 配置请求
|
|
8
8
|
|
9
9
|
var useRequest = function useRequest(requestConfig) {
|
10
10
|
return function (field) {
|
11
|
+
var _field$form;
|
12
|
+
|
11
13
|
var beforeRequest = requestConfig.beforeRequest,
|
12
14
|
onSuccess = requestConfig.onSuccess;
|
13
15
|
var beforeRequestResult = isFn(beforeRequest) ? beforeRequest(field) : {};
|
@@ -21,8 +23,8 @@ var useRequest = function useRequest(requestConfig) {
|
|
21
23
|
} : onSuccess
|
22
24
|
}), {
|
23
25
|
$self: field,
|
24
|
-
$form: field.form,
|
25
|
-
$values: field.form.values
|
26
|
+
$form: field === null || field === void 0 ? void 0 : field.form,
|
27
|
+
$values: field === null || field === void 0 ? void 0 : (_field$form = field.form) === null || _field$form === void 0 ? void 0 : _field$form.values
|
26
28
|
});
|
27
29
|
};
|
28
30
|
}; // 配置校验
|
package/es/form/typing.d.ts
CHANGED
@@ -33,11 +33,11 @@ export interface IFormSchemaItem {
|
|
33
33
|
tooltip?: string;
|
34
34
|
required?: boolean;
|
35
35
|
display?: FieldDisplayTypes;
|
36
|
-
visible?: boolean;
|
37
|
-
hidden?: boolean;
|
38
|
-
disabled?: boolean;
|
39
|
-
readOnly?: boolean;
|
40
|
-
readPretty?: boolean;
|
36
|
+
visible?: boolean | string;
|
37
|
+
hidden?: boolean | string;
|
38
|
+
disabled?: boolean | string;
|
39
|
+
readOnly?: boolean | string;
|
40
|
+
readPretty?: boolean | string;
|
41
41
|
pattern?: FieldPatternTypes;
|
42
42
|
default?: any;
|
43
43
|
request?: IRequestConfig;
|
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.37";
|
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.37';
|
29
29
|
export { version, ProAction, ProCard, ProField, ProForm, ProInfo, // ProLayout,
|
30
30
|
ProPageContainer, ProPageHeader, ProSkeleton, ProTable, hooks, nocode, templates, utils };
|
@@ -2,6 +2,8 @@ import React from 'react';
|
|
2
2
|
import { IProHeaderInfo, ProInfoTransparentBase } from '../../typing';
|
3
3
|
import { IUseInfoRequestResult } from '../../utils/useInfoRequest';
|
4
4
|
import './index.scss';
|
5
|
-
declare type ProHeaderInfoProps = IProHeaderInfo & IUseInfoRequestResult & ProInfoTransparentBase
|
5
|
+
declare type ProHeaderInfoProps = IProHeaderInfo & IUseInfoRequestResult & ProInfoTransparentBase & {
|
6
|
+
size?: any;
|
7
|
+
};
|
6
8
|
declare const ProHeaderInfo: React.FC<ProHeaderInfoProps>;
|
7
9
|
export default ProHeaderInfo;
|
@@ -0,0 +1,68 @@
|
|
1
|
+
import { Grid } from '@alicloudfe/components';
|
2
|
+
import React from 'react';
|
3
|
+
import ProInfoItem from '../ProInfoItem';
|
4
|
+
import './index.scss';
|
5
|
+
import defaultLayoutMap from '../../utils/layout';
|
6
|
+
import { getLayout } from '../../utils/utils';
|
7
|
+
import InfoValueItem from '../InfoValueItem';
|
8
|
+
import { getDataIndexValue } from '../../utils';
|
9
|
+
var Row = Grid.Row,
|
10
|
+
Col = Grid.Col;
|
11
|
+
|
12
|
+
var ProHeaderInfo = function ProHeaderInfo(props) {
|
13
|
+
var _size$width;
|
14
|
+
|
15
|
+
var columns = props.columns,
|
16
|
+
dataSource = props.dataSource,
|
17
|
+
layout = props.layout,
|
18
|
+
loading = props.loading,
|
19
|
+
result = props.result,
|
20
|
+
actionRef = props.actionRef,
|
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)];
|
23
|
+
|
24
|
+
var renderContent = function renderContent() {
|
25
|
+
return columns.map(function (item, index) {
|
26
|
+
var _item$title, _item$valueType;
|
27
|
+
|
28
|
+
var span = 24;
|
29
|
+
|
30
|
+
if (layout === null || layout === void 0 ? void 0 : layout.colNum) {
|
31
|
+
var _item$colSpan;
|
32
|
+
|
33
|
+
span = 24 / (layout === null || layout === void 0 ? void 0 : layout.colNum) * ((_item$colSpan = item === null || item === void 0 ? void 0 : item.colSpan) !== null && _item$colSpan !== void 0 ? _item$colSpan : 1);
|
34
|
+
} else {
|
35
|
+
var _item$colSpan2;
|
36
|
+
|
37
|
+
span = defaultLayout.span * ((_item$colSpan2 = item === null || item === void 0 ? void 0 : item.colSpan) !== null && _item$colSpan2 !== void 0 ? _item$colSpan2 : 1);
|
38
|
+
}
|
39
|
+
|
40
|
+
return /*#__PURE__*/React.createElement(Col, {
|
41
|
+
span: span,
|
42
|
+
key: index
|
43
|
+
}, /*#__PURE__*/React.createElement(ProInfoItem, {
|
44
|
+
label: (_item$title = item === null || item === void 0 ? void 0 : item.title) !== null && _item$title !== void 0 ? _item$title : '',
|
45
|
+
loading: loading,
|
46
|
+
value: /*#__PURE__*/React.createElement(InfoValueItem, {
|
47
|
+
type: (_item$valueType = item === null || item === void 0 ? void 0 : item.valueType) !== null && _item$valueType !== void 0 ? _item$valueType : 'text',
|
48
|
+
value: getDataIndexValue(item.dataIndex, dataSource !== null && dataSource !== void 0 ? dataSource : result),
|
49
|
+
render: item.render,
|
50
|
+
dataSource: item.dataSource,
|
51
|
+
infoItem: item,
|
52
|
+
record: dataSource !== null && dataSource !== void 0 ? dataSource : result,
|
53
|
+
actionRef: actionRef
|
54
|
+
}),
|
55
|
+
headerInfoLayout: layout !== null && layout !== void 0 ? layout : defaultLayout,
|
56
|
+
tooltip: item.tooltip,
|
57
|
+
tooltipIcon: item.tooltipIcon
|
58
|
+
}));
|
59
|
+
});
|
60
|
+
};
|
61
|
+
|
62
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, (size === null || size === void 0 ? void 0 : size.width) && /*#__PURE__*/React.createElement(Row, {
|
63
|
+
wrap: true,
|
64
|
+
className: "teamix-pro-info-content-row"
|
65
|
+
}, renderContent()));
|
66
|
+
};
|
67
|
+
|
68
|
+
export default ProHeaderInfo;
|
File without changes
|
@@ -1,4 +1,18 @@
|
|
1
|
-
var _excluded = ["type", "value", "render", "infoItem", "record", "actionRef"];
|
1
|
+
var _excluded = ["type", "value", "render", "infoItem", "record", "actionRef", "dataSource"];
|
2
|
+
|
3
|
+
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
4
|
+
|
5
|
+
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
6
|
+
|
7
|
+
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
8
|
+
|
9
|
+
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
10
|
+
|
11
|
+
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; }
|
12
|
+
|
13
|
+
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; }
|
14
|
+
|
15
|
+
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; }
|
2
16
|
|
3
17
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
4
18
|
|
@@ -12,19 +26,13 @@ function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Sy
|
|
12
26
|
|
13
27
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
14
28
|
|
15
|
-
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; }
|
16
|
-
|
17
|
-
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; }
|
18
|
-
|
19
|
-
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; }
|
20
|
-
|
21
29
|
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; }
|
22
30
|
|
23
31
|
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
32
|
|
25
33
|
import TeamixIcon from '@teamix/icon';
|
26
34
|
import ProField from '../../../field';
|
27
|
-
import { baseClass, request } from '@teamix/utils';
|
35
|
+
import { baseClass, getTargetValue, request } from '@teamix/utils';
|
28
36
|
import PopConfirm from '@teamix/pop-confirm';
|
29
37
|
import React, { useMemo, useState } from 'react';
|
30
38
|
import './index.scss';
|
@@ -42,6 +50,7 @@ var InfoValueItem = function InfoValueItem(props) {
|
|
42
50
|
infoItem = props.infoItem,
|
43
51
|
record = props.record,
|
44
52
|
actionRef = props.actionRef,
|
53
|
+
dataSource = props.dataSource,
|
45
54
|
others = _objectWithoutProperties(props, _excluded);
|
46
55
|
|
47
56
|
var dataIndex = infoItem.dataIndex,
|
@@ -55,28 +64,41 @@ var InfoValueItem = function InfoValueItem(props) {
|
|
55
64
|
_infoItem$successMess = infoItem.successMessage,
|
56
65
|
successMessage = _infoItem$successMess === void 0 ? 'success' : _infoItem$successMess,
|
57
66
|
actions = infoItem.actions,
|
58
|
-
extra = infoItem.extra; //
|
59
|
-
// let fieldRender = render;
|
60
|
-
// let newValue = value;
|
61
|
-
// if (render && typeof render !== 'function') {
|
62
|
-
// const { value, ...others } = render;
|
63
|
-
// fieldRender = others;
|
64
|
-
// if (value) {
|
65
|
-
// newValue = getTargetValue(`${value}`, { ...record, record });
|
66
|
-
// console.log("newValue", newValue);
|
67
|
-
// }
|
68
|
-
// }
|
69
|
-
// 获取render
|
67
|
+
extra = infoItem.extra; // 获取处理过的 render
|
70
68
|
|
71
69
|
var getRender = function getRender() {
|
70
|
+
var _processRenderFunctio;
|
71
|
+
|
72
72
|
if (typeof render === 'function') {
|
73
73
|
return render;
|
74
74
|
}
|
75
75
|
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
76
|
+
var newRender = processBuriedPoint((_processRenderFunctio = processRenderFunction(render !== null && render !== void 0 ? render : {}, value, record)) !== null && _processRenderFunctio !== void 0 ? _processRenderFunctio : {}, value, record);
|
77
|
+
return newRender;
|
78
|
+
}; // 获取处理过的 dataSource
|
79
|
+
|
80
|
+
|
81
|
+
var getDataSource = function getDataSource() {
|
82
|
+
var newDataSource = null;
|
83
|
+
|
84
|
+
if (typeof dataSource === 'function') {
|
85
|
+
newDataSource = dataSource === null || dataSource === void 0 ? void 0 : dataSource(value, record);
|
86
|
+
} else {
|
87
|
+
newDataSource = (dataSource !== null && dataSource !== void 0 ? dataSource : []).map(function (item) {
|
88
|
+
return Object.fromEntries(Object.entries(item).map(function (_ref) {
|
89
|
+
var _ref2 = _slicedToArray(_ref, 2),
|
90
|
+
k = _ref2[0],
|
91
|
+
v = _ref2[1];
|
92
|
+
|
93
|
+
return [k, getTargetValue(v, _objectSpread(_objectSpread({}, record), {}, {
|
94
|
+
record: record,
|
95
|
+
value: value
|
96
|
+
}))];
|
97
|
+
}));
|
98
|
+
});
|
99
|
+
}
|
100
|
+
|
101
|
+
return newDataSource;
|
80
102
|
}; // 浮层的显隐状态
|
81
103
|
|
82
104
|
|
@@ -109,12 +131,73 @@ var InfoValueItem = function InfoValueItem(props) {
|
|
109
131
|
type: "text",
|
110
132
|
style: {
|
111
133
|
marginLeft: '8px'
|
134
|
+
},
|
135
|
+
context: {
|
136
|
+
record: record
|
112
137
|
}
|
113
138
|
});
|
114
139
|
}
|
115
140
|
|
116
141
|
return /*#__PURE__*/React.createElement(React.Fragment, null);
|
117
142
|
};
|
143
|
+
/**
|
144
|
+
* 处理 render 配置项是函数的情况
|
145
|
+
* @param render ProFieldRender
|
146
|
+
* @param value table cell value
|
147
|
+
* @param record table cell record
|
148
|
+
* @returns
|
149
|
+
*/
|
150
|
+
|
151
|
+
|
152
|
+
var processRenderFunction = function processRenderFunction(render, value, record) {
|
153
|
+
var external = ['linkOnClick', 'link', 'value'];
|
154
|
+
return Object.fromEntries(Object.entries(render).map(function (_ref3) {
|
155
|
+
var _ref4 = _slicedToArray(_ref3, 2),
|
156
|
+
k = _ref4[0],
|
157
|
+
v = _ref4[1];
|
158
|
+
|
159
|
+
if (typeof v === 'function') {
|
160
|
+
var _v;
|
161
|
+
|
162
|
+
if (external.includes(k)) {
|
163
|
+
return [k, function () {
|
164
|
+
for (var _len = arguments.length, others = new Array(_len), _key = 0; _key < _len; _key++) {
|
165
|
+
others[_key] = arguments[_key];
|
166
|
+
}
|
167
|
+
|
168
|
+
return v === null || v === void 0 ? void 0 : v.apply(void 0, [value, record].concat(others));
|
169
|
+
}];
|
170
|
+
}
|
171
|
+
|
172
|
+
return [k, (_v = v === null || v === void 0 ? void 0 : v(value, record)) !== null && _v !== void 0 ? _v : ''];
|
173
|
+
}
|
174
|
+
|
175
|
+
return [k, v];
|
176
|
+
}));
|
177
|
+
};
|
178
|
+
/**
|
179
|
+
* 处理 render 数据,取出 {{xxx}} 匹配值
|
180
|
+
* @param render ProFieldRender
|
181
|
+
* @param record table cell record
|
182
|
+
* @returns
|
183
|
+
*/
|
184
|
+
|
185
|
+
|
186
|
+
var processBuriedPoint = function processBuriedPoint(render, value, record) {
|
187
|
+
return Object.fromEntries([// 默认 ellipsis、descriptionEllipsis 为 true
|
188
|
+
// emptyText 默认为 '-'
|
189
|
+
['ellipsis', true], ['descriptionEllipsis', true], ['emptyText', '-']].concat(_toConsumableArray(Object.entries(render).map(function (_ref5) {
|
190
|
+
var _ref6 = _slicedToArray(_ref5, 2),
|
191
|
+
k = _ref6[0],
|
192
|
+
v = _ref6[1];
|
193
|
+
|
194
|
+
return [k, getTargetValue(v, _objectSpread(_objectSpread({}, record), {}, {
|
195
|
+
record: record,
|
196
|
+
value: value
|
197
|
+
}))];
|
198
|
+
}))));
|
199
|
+
}; // 重写编辑逻辑替代field原有逻辑
|
200
|
+
|
118
201
|
|
119
202
|
if (isEdit) {
|
120
203
|
// 渲染表单
|
@@ -195,7 +278,8 @@ var InfoValueItem = function InfoValueItem(props) {
|
|
195
278
|
}, /*#__PURE__*/React.createElement(ProField, _objectSpread({
|
196
279
|
type: type,
|
197
280
|
value: value,
|
198
|
-
render: getRender()
|
281
|
+
render: getRender(),
|
282
|
+
dataSource: getDataSource()
|
199
283
|
}, others)), /*#__PURE__*/React.createElement(PopConfirm, {
|
200
284
|
visible: popConfirmVisible,
|
201
285
|
content: renderContent(),
|
@@ -226,7 +310,8 @@ var InfoValueItem = function InfoValueItem(props) {
|
|
226
310
|
}, /*#__PURE__*/React.createElement(ProField, _objectSpread({
|
227
311
|
type: type,
|
228
312
|
value: value,
|
229
|
-
render: getRender()
|
313
|
+
render: getRender(),
|
314
|
+
dataSource: getDataSource()
|
230
315
|
}, others)), renderAction(), extra && extra);
|
231
316
|
};
|
232
317
|
|
File without changes
|
@@ -1,5 +1,3 @@
|
|
1
|
-
var _excluded = ["header", "columns", "dataSource", "layout", "loading", "result", "actionRef", "className"];
|
2
|
-
|
3
1
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
|
4
2
|
|
5
3
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
@@ -18,32 +16,23 @@ function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToAr
|
|
18
16
|
|
19
17
|
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
20
18
|
|
21
|
-
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; }
|
22
|
-
|
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
|
-
|
25
19
|
import React, { useMemo } from 'react';
|
26
20
|
import './index.scss';
|
27
21
|
import { Table } from '@alicloudfe/components';
|
28
22
|
import './index.scss';
|
29
|
-
import ProCard from '../../../card';
|
30
23
|
import { LabelIconTip } from '@teamix/utils';
|
31
24
|
import InfoValueItem from '../InfoValueItem';
|
32
25
|
import { BaseSkeleton } from '../../..';
|
33
26
|
import { getDataIndexValue } from '../../utils';
|
34
27
|
|
35
28
|
var ProTableInfo = function ProTableInfo(props) {
|
36
|
-
var
|
37
|
-
columns = props.columns,
|
29
|
+
var columns = props.columns,
|
38
30
|
dataSource = props.dataSource,
|
39
31
|
_props$layout = props.layout,
|
40
32
|
layout = _props$layout === void 0 ? {} : _props$layout,
|
41
33
|
loading = props.loading,
|
42
34
|
result = props.result,
|
43
|
-
actionRef = props.actionRef
|
44
|
-
className = props.className,
|
45
|
-
others = _objectWithoutProperties(props, _excluded);
|
46
|
-
|
35
|
+
actionRef = props.actionRef;
|
47
36
|
var _layout$colNum = layout.colNum,
|
48
37
|
colNum = _layout$colNum === void 0 ? 2 : _layout$colNum,
|
49
38
|
_layout$labelGutter = layout.labelGutter,
|
@@ -173,20 +162,14 @@ var ProTableInfo = function ProTableInfo(props) {
|
|
173
162
|
}
|
174
163
|
};
|
175
164
|
|
176
|
-
return /*#__PURE__*/React.createElement(
|
177
|
-
className: "teamix-pro-info ".concat(className)
|
178
|
-
}, others), /*#__PURE__*/React.createElement(ProCard, _objectSpread({
|
179
|
-
compacted: true,
|
180
|
-
hoveredShadow: false,
|
181
|
-
bordered: false
|
182
|
-
}, header), /*#__PURE__*/React.createElement(Table.StickyLock, {
|
165
|
+
return /*#__PURE__*/React.createElement(Table.StickyLock, {
|
183
166
|
className: "teamix-pro-info-table",
|
184
167
|
cellProps: setCellProps,
|
185
168
|
columns: newColumns(),
|
186
169
|
hasHeader: false,
|
187
170
|
hasBorder: true,
|
188
171
|
dataSource: newDataSource
|
189
|
-
})
|
172
|
+
});
|
190
173
|
};
|
191
174
|
|
192
175
|
export default ProTableInfo;
|
File without changes
|
@@ -2,6 +2,8 @@ import React from 'react';
|
|
2
2
|
import { ProInfoBaseProps, ProInfoTransparentBase } from '../../typing';
|
3
3
|
import './index.scss';
|
4
4
|
import { IUseInfoRequestResult } from '../../utils/useInfoRequest';
|
5
|
-
declare type ProBaseInfoProps = ProInfoBaseProps & IUseInfoRequestResult & ProInfoTransparentBase
|
5
|
+
declare type ProBaseInfoProps = ProInfoBaseProps & IUseInfoRequestResult & ProInfoTransparentBase & {
|
6
|
+
size?: any;
|
7
|
+
};
|
6
8
|
declare const ProBaseInfo: React.FC<ProBaseInfoProps>;
|
7
9
|
export default ProBaseInfo;
|