@teamix/pro 1.1.4 → 1.1.8
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 +97 -0
- package/dist/212.js +2 -2
- package/dist/pro.css +1 -1
- package/dist/pro.js +3147 -1872
- package/dist/pro.min.css +1 -1
- package/dist/pro.min.js +1 -1
- package/dist/pro.min.js.LICENSE.txt +1 -1
- package/es/actions/dialog-form.d.ts +3 -3
- package/es/actions/dialog-table.d.ts +6 -1
- package/es/actions/dialog-table.js +10 -1
- package/es/actions/drawer-table.d.ts +4 -0
- package/es/actions/drawer-table.js +7 -1
- package/es/actions/index.d.ts +6 -11
- package/es/actions/index.js +41 -21
- package/es/actions/index.scss +1 -1
- package/es/card/index.d.ts +17 -0
- package/es/form/Components/ProField/index.d.ts +8 -0
- package/es/form/ProForm/index.d.ts +2 -2
- package/es/form/ProForm/index.js +9 -2
- package/es/form/ProForm/index.scss +40 -7
- package/es/form/SchemaForm/adapterType.js +3 -3
- package/es/form/SchemaForm/index.d.ts +2 -2
- package/es/form/SchemaForm/index.js +9 -5
- package/es/form/SchemaForm/initializeArrayCards.js +10 -55
- package/es/form/SchemaForm/initializeArrayCollapse.js +10 -64
- package/es/form/SchemaForm/initializeArrayIcon.js +19 -7
- package/es/form/SchemaForm/initializeArrayItems.js +16 -75
- package/es/form/SchemaForm/initializeArrayTable.js +23 -33
- package/es/form/SchemaForm/initializeFormButton.js +35 -38
- package/es/form/SchemaForm/initializeFormGroup.d.ts +2 -2
- package/es/form/SchemaForm/initializeFormStep.d.ts +4 -2
- package/es/form/SchemaForm/initializeFormStep.js +21 -7
- package/es/form/SchemaForm/initializeFormTab.d.ts +2 -2
- package/es/form/SchemaForm/initializeProField.js +3 -3
- package/es/form/SchemaForm/reactions.d.ts +1 -1
- package/es/form/SchemaForm/reactions.js +2 -2
- package/es/form/index.d.ts +17 -9
- package/es/form/index.js +21 -9
- package/es/form/typing.d.ts +13 -22
- package/es/form/warning.js +2 -6
- package/es/index.d.ts +4 -3
- package/es/index.js +4 -3
- package/es/info/components/FormItem/index.js +4 -4
- package/es/info/components/FormItem/index.scss +11 -0
- package/es/info/components/InfoGroup/index.js +37 -6
- package/es/info/components/InfoGroup/index.scss +6 -0
- package/es/info/components/InfoValueItem/index.js +14 -2
- package/es/info/components/baseInfo/index.js +10 -9
- package/es/info/components/headerInfo/index.js +10 -9
- package/es/info/components/tableInfo/index.js +7 -4
- package/es/info/components/tableInfo/index.scss +1 -1
- package/es/info/index.d.ts +1 -0
- package/es/info/index.js +9 -7
- package/es/info/index.scss +4 -0
- package/es/info/typing.d.ts +17 -3
- package/es/info/utils/index.d.ts +11 -2
- package/es/info/utils/index.js +21 -0
- package/es/nocode/configurators/PageHeader.js +49 -43
- package/es/nocode/configurators/ProTable.js +12 -9
- package/es/nocode/configurators/common.d.ts +117 -105
- package/es/nocode/configurators/common.js +38 -34
- package/es/nocode/index.scss +1 -4
- package/es/page-header/index.d.ts +3 -0
- package/es/page-header/index.js +40 -13
- package/es/page-header/index.scss +6 -4
- package/es/table/components/Filter/index.js +8 -16
- package/es/table/components/Layout/index.js +2 -1
- package/es/table/components/Layout/index.scss +1 -1
- package/es/table/components/ToolBar/FilterColumnIcon.js +77 -17
- package/es/table/components/ToolBar/index.scss +10 -0
- package/es/table/index.d.ts +0 -1
- package/es/table/index.js +75 -56
- package/es/table/index.scss +0 -1
- package/es/table/typing.d.ts +3 -1
- package/lib/actions/dialog-form.d.ts +3 -3
- package/lib/actions/dialog-table.d.ts +6 -1
- package/lib/actions/dialog-table.js +20 -1
- package/lib/actions/drawer-table.d.ts +4 -0
- package/lib/actions/drawer-table.js +14 -1
- package/lib/actions/index.d.ts +6 -11
- package/lib/actions/index.js +44 -20
- package/lib/actions/index.scss +1 -1
- package/lib/card/index.d.ts +17 -0
- package/lib/form/Components/ProField/index.d.ts +8 -0
- package/lib/form/ProForm/index.d.ts +2 -2
- package/lib/form/ProForm/index.js +10 -2
- package/lib/form/ProForm/index.scss +40 -7
- package/lib/form/SchemaForm/adapterType.js +3 -3
- package/lib/form/SchemaForm/index.d.ts +2 -2
- package/lib/form/SchemaForm/index.js +10 -5
- package/lib/form/SchemaForm/initializeArrayCards.js +10 -54
- package/lib/form/SchemaForm/initializeArrayCollapse.js +10 -63
- package/lib/form/SchemaForm/initializeArrayIcon.js +19 -7
- package/lib/form/SchemaForm/initializeArrayItems.js +16 -74
- package/lib/form/SchemaForm/initializeArrayTable.js +23 -33
- package/lib/form/SchemaForm/initializeFormButton.js +35 -38
- package/lib/form/SchemaForm/initializeFormGroup.d.ts +2 -2
- package/lib/form/SchemaForm/initializeFormStep.d.ts +4 -2
- package/lib/form/SchemaForm/initializeFormStep.js +21 -7
- package/lib/form/SchemaForm/initializeFormTab.d.ts +2 -2
- package/lib/form/SchemaForm/initializeProField.js +3 -3
- package/lib/form/SchemaForm/reactions.d.ts +1 -1
- package/lib/form/SchemaForm/reactions.js +2 -2
- package/lib/form/index.d.ts +17 -9
- package/lib/form/index.js +81 -56
- package/lib/form/typing.d.ts +13 -22
- package/lib/form/warning.js +2 -6
- package/lib/index.d.ts +4 -3
- package/lib/index.js +16 -4
- package/lib/info/components/FormItem/index.js +4 -4
- package/lib/info/components/FormItem/index.scss +11 -0
- package/lib/info/components/InfoGroup/index.js +46 -6
- package/lib/info/components/InfoGroup/index.scss +6 -0
- package/lib/info/components/InfoValueItem/index.js +15 -3
- package/lib/info/components/baseInfo/index.js +10 -9
- package/lib/info/components/headerInfo/index.js +11 -10
- package/lib/info/components/tableInfo/index.js +7 -3
- package/lib/info/components/tableInfo/index.scss +1 -1
- package/lib/info/index.d.ts +1 -0
- package/lib/info/index.js +8 -6
- package/lib/info/index.scss +4 -0
- package/lib/info/typing.d.ts +17 -3
- package/lib/info/utils/index.d.ts +11 -2
- package/lib/info/utils/index.js +31 -0
- package/lib/nocode/configurators/PageHeader.js +49 -43
- package/lib/nocode/configurators/ProTable.js +12 -9
- package/lib/nocode/configurators/common.d.ts +117 -105
- package/lib/nocode/configurators/common.js +38 -34
- package/lib/nocode/index.scss +1 -4
- package/lib/page-header/index.d.ts +3 -0
- package/lib/page-header/index.js +42 -13
- package/lib/page-header/index.scss +6 -4
- package/lib/table/components/Filter/index.js +7 -15
- package/lib/table/components/Layout/index.js +2 -1
- package/lib/table/components/Layout/index.scss +1 -1
- package/lib/table/components/ToolBar/FilterColumnIcon.js +75 -16
- package/lib/table/components/ToolBar/index.scss +10 -0
- package/lib/table/index.d.ts +0 -1
- package/lib/table/index.js +76 -65
- package/lib/table/index.scss +0 -1
- package/lib/table/typing.d.ts +3 -1
- package/package.json +5 -5
package/es/info/utils/index.js
CHANGED
@@ -4,9 +4,30 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
|
|
4
4
|
|
5
5
|
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; }
|
6
6
|
|
7
|
+
import { getDeepValue } from '@teamix/utils';
|
8
|
+
import React from 'react';
|
7
9
|
export function useActionType(ref, action) {
|
8
10
|
// 合并自定义事件
|
9
11
|
var userAction = _objectSpread({}, action);
|
10
12
|
|
11
13
|
ref.current = userAction;
|
14
|
+
}
|
15
|
+
/** ProInfoGroupContext */
|
16
|
+
|
17
|
+
export var ProInfoGroupContext = /*#__PURE__*/React.createContext({});
|
18
|
+
/**
|
19
|
+
* 获取 dataIndex 值
|
20
|
+
* @param dataIndex
|
21
|
+
* @param dataSource
|
22
|
+
* @returns
|
23
|
+
*/
|
24
|
+
|
25
|
+
export function getDataIndexValue(dataIndex, dataSource) {
|
26
|
+
if (Array.isArray(dataIndex)) {
|
27
|
+
return dataIndex.map(function (item) {
|
28
|
+
return getDeepValue(item !== null && item !== void 0 ? item : '', dataSource);
|
29
|
+
});
|
30
|
+
}
|
31
|
+
|
32
|
+
return getDeepValue(dataIndex !== null && dataIndex !== void 0 ? dataIndex : '', dataSource);
|
12
33
|
}
|
@@ -103,34 +103,37 @@ var schema = [{
|
|
103
103
|
children: [{
|
104
104
|
name: 'tags',
|
105
105
|
component: 'ArrayTable',
|
106
|
-
items:
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
106
|
+
items: {
|
107
|
+
type: 'object',
|
108
|
+
children: [{
|
109
|
+
name: 'text',
|
110
|
+
title: '名称',
|
111
|
+
component: 'Input'
|
112
|
+
}, {
|
113
|
+
name: 'type',
|
114
|
+
title: '类型',
|
115
|
+
component: 'Select',
|
116
|
+
dataSource: [{
|
117
|
+
label: '普通',
|
118
|
+
value: 'normal'
|
119
|
+
}, {
|
120
|
+
label: '主要',
|
121
|
+
value: 'primary'
|
122
|
+
}]
|
123
|
+
}, {
|
124
|
+
name: 'color',
|
125
|
+
title: '颜色',
|
126
|
+
component: 'Input'
|
117
127
|
}, {
|
118
|
-
|
119
|
-
|
128
|
+
title: '操作',
|
129
|
+
component: 'ArrayTable.Remove',
|
130
|
+
decoratorProps: {
|
131
|
+
fixed: 'right',
|
132
|
+
width: 40
|
133
|
+
},
|
134
|
+
formItem: null
|
120
135
|
}]
|
121
|
-
},
|
122
|
-
name: 'color',
|
123
|
-
title: '颜色',
|
124
|
-
component: 'Input'
|
125
|
-
}, {
|
126
|
-
title: '操作',
|
127
|
-
component: 'ArrayTable.Remove',
|
128
|
-
decoratorProps: {
|
129
|
-
fixed: 'right',
|
130
|
-
width: 40
|
131
|
-
},
|
132
|
-
formItem: null
|
133
|
-
}],
|
136
|
+
},
|
134
137
|
children: [{
|
135
138
|
title: '添加标签'
|
136
139
|
}]
|
@@ -146,23 +149,26 @@ var schema = [{
|
|
146
149
|
children: [{
|
147
150
|
name: 'breadcrumb',
|
148
151
|
component: 'ArrayTable',
|
149
|
-
items:
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
152
|
+
items: {
|
153
|
+
type: 'object',
|
154
|
+
children: [{
|
155
|
+
name: 'text',
|
156
|
+
title: '名称',
|
157
|
+
component: 'Input'
|
158
|
+
}, {
|
159
|
+
name: 'link',
|
160
|
+
title: '链接',
|
161
|
+
component: 'Input'
|
162
|
+
}, {
|
163
|
+
title: '操作',
|
164
|
+
component: 'ArrayTable.Remove',
|
165
|
+
decoratorProps: {
|
166
|
+
fixed: 'right',
|
167
|
+
width: 40
|
168
|
+
},
|
169
|
+
formItem: null
|
170
|
+
}]
|
171
|
+
},
|
166
172
|
children: [{
|
167
173
|
title: '添加面包屑'
|
168
174
|
}]
|
@@ -133,16 +133,19 @@ var schema = [{
|
|
133
133
|
name: 'pageSizeList',
|
134
134
|
title: '分页大小列表',
|
135
135
|
component: 'ArrayItems',
|
136
|
-
|
137
|
-
|
136
|
+
items: {
|
137
|
+
component: 'FormFlex',
|
138
|
+
children: [{
|
139
|
+
component: 'ArrayItems.SortHandle'
|
140
|
+
}, {
|
141
|
+
component: 'NumberPicker',
|
142
|
+
decoratorProps: {
|
143
|
+
feedbackLayout: 'none'
|
144
|
+
}
|
145
|
+
}, {
|
146
|
+
component: 'ArrayItems.Remove'
|
147
|
+
}]
|
138
148
|
},
|
139
|
-
items: [{
|
140
|
-
component: 'ArrayItems.SortHandle'
|
141
|
-
}, {
|
142
|
-
component: 'NumberPicker'
|
143
|
-
}, {
|
144
|
-
component: 'ArrayItems.Remove'
|
145
|
-
}],
|
146
149
|
children: [{
|
147
150
|
title: '添加一条'
|
148
151
|
}],
|
@@ -4,53 +4,57 @@ export declare function array(title: string, name: string, fields: any[], main?:
|
|
4
4
|
name: string;
|
5
5
|
title: string | undefined;
|
6
6
|
component: string;
|
7
|
-
|
8
|
-
itemType: string;
|
9
|
-
};
|
10
|
-
items: ({
|
11
|
-
component: string;
|
12
|
-
children: {
|
13
|
-
component: string;
|
14
|
-
}[];
|
15
|
-
name?: undefined;
|
16
|
-
type?: undefined;
|
17
|
-
title?: undefined;
|
18
|
-
reactions?: undefined;
|
19
|
-
} | {
|
20
|
-
name: string;
|
21
|
-
component: string;
|
7
|
+
items: {
|
22
8
|
type: string;
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
9
|
+
decorator: string;
|
10
|
+
children: ({
|
11
|
+
component: string;
|
12
|
+
children: {
|
13
|
+
component: string;
|
14
|
+
}[];
|
15
|
+
name?: undefined;
|
16
|
+
type?: undefined;
|
17
|
+
title?: undefined;
|
18
|
+
reactions?: undefined;
|
19
|
+
} | {
|
33
20
|
name: string;
|
34
21
|
component: string;
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
22
|
+
type: string;
|
23
|
+
title: string;
|
24
|
+
reactions: {
|
25
|
+
dependencies: string[];
|
26
|
+
fulfill: {
|
27
|
+
schema: {
|
28
|
+
title: string;
|
29
|
+
};
|
30
|
+
};
|
41
31
|
};
|
42
|
-
children:
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
32
|
+
children: {
|
33
|
+
name: string;
|
34
|
+
component: string;
|
35
|
+
props: {
|
36
|
+
layout: string;
|
37
|
+
labelAlign: string;
|
38
|
+
colon: boolean;
|
39
|
+
labelCol: number;
|
40
|
+
wrapperCol: number;
|
41
|
+
};
|
42
|
+
children: any[];
|
43
|
+
}[];
|
44
|
+
} | {
|
45
|
+
component: string;
|
46
|
+
children?: undefined;
|
47
|
+
name?: undefined;
|
48
|
+
type?: undefined;
|
49
|
+
title?: undefined;
|
50
|
+
reactions?: undefined;
|
51
|
+
})[];
|
52
|
+
};
|
52
53
|
children: {
|
53
|
-
|
54
|
+
component: string;
|
55
|
+
props: {
|
56
|
+
title: string;
|
57
|
+
};
|
54
58
|
}[];
|
55
59
|
}[];
|
56
60
|
};
|
@@ -64,69 +68,10 @@ export declare function actions(props?: {
|
|
64
68
|
name: string;
|
65
69
|
title: string | undefined;
|
66
70
|
component: string;
|
67
|
-
|
68
|
-
itemType: string;
|
69
|
-
};
|
70
|
-
items: ({
|
71
|
-
component: string;
|
72
|
-
children: {
|
73
|
-
component: string;
|
74
|
-
}[];
|
75
|
-
name?: undefined;
|
76
|
-
type?: undefined;
|
77
|
-
title?: undefined;
|
78
|
-
reactions?: undefined;
|
79
|
-
} | {
|
80
|
-
name: string;
|
81
|
-
component: string;
|
71
|
+
items: {
|
82
72
|
type: string;
|
83
|
-
|
84
|
-
|
85
|
-
dependencies: string[];
|
86
|
-
fulfill: {
|
87
|
-
schema: {
|
88
|
-
title: string;
|
89
|
-
};
|
90
|
-
};
|
91
|
-
};
|
92
|
-
children: {
|
93
|
-
name: string;
|
94
|
-
component: string;
|
95
|
-
props: {
|
96
|
-
layout: string;
|
97
|
-
labelAlign: string;
|
98
|
-
colon: boolean;
|
99
|
-
labelCol: number;
|
100
|
-
wrapperCol: number;
|
101
|
-
};
|
102
|
-
children: any[];
|
103
|
-
}[];
|
104
|
-
} | {
|
105
|
-
component: string;
|
106
|
-
children?: undefined;
|
107
|
-
name?: undefined;
|
108
|
-
type?: undefined;
|
109
|
-
title?: undefined;
|
110
|
-
reactions?: undefined;
|
111
|
-
})[];
|
112
|
-
children: {
|
113
|
-
title: string;
|
114
|
-
}[];
|
115
|
-
}[];
|
116
|
-
};
|
117
|
-
export declare function filter(name: string): {
|
118
|
-
name: string;
|
119
|
-
type: string;
|
120
|
-
children: {
|
121
|
-
title: string;
|
122
|
-
children: {
|
123
|
-
name: string;
|
124
|
-
title: string | undefined;
|
125
|
-
component: string;
|
126
|
-
props: {
|
127
|
-
itemType: string;
|
128
|
-
};
|
129
|
-
items: ({
|
73
|
+
decorator: string;
|
74
|
+
children: ({
|
130
75
|
component: string;
|
131
76
|
children: {
|
132
77
|
component: string;
|
@@ -168,8 +113,75 @@ export declare function filter(name: string): {
|
|
168
113
|
title?: undefined;
|
169
114
|
reactions?: undefined;
|
170
115
|
})[];
|
171
|
-
|
116
|
+
};
|
117
|
+
children: {
|
118
|
+
component: string;
|
119
|
+
props: {
|
172
120
|
title: string;
|
121
|
+
};
|
122
|
+
}[];
|
123
|
+
}[];
|
124
|
+
};
|
125
|
+
export declare function filter(name: string): {
|
126
|
+
name: string;
|
127
|
+
type: string;
|
128
|
+
children: {
|
129
|
+
title: string;
|
130
|
+
children: {
|
131
|
+
name: string;
|
132
|
+
title: string | undefined;
|
133
|
+
component: string;
|
134
|
+
items: {
|
135
|
+
type: string;
|
136
|
+
decorator: string;
|
137
|
+
children: ({
|
138
|
+
component: string;
|
139
|
+
children: {
|
140
|
+
component: string;
|
141
|
+
}[];
|
142
|
+
name?: undefined;
|
143
|
+
type?: undefined;
|
144
|
+
title?: undefined;
|
145
|
+
reactions?: undefined;
|
146
|
+
} | {
|
147
|
+
name: string;
|
148
|
+
component: string;
|
149
|
+
type: string;
|
150
|
+
title: string;
|
151
|
+
reactions: {
|
152
|
+
dependencies: string[];
|
153
|
+
fulfill: {
|
154
|
+
schema: {
|
155
|
+
title: string;
|
156
|
+
};
|
157
|
+
};
|
158
|
+
};
|
159
|
+
children: {
|
160
|
+
name: string;
|
161
|
+
component: string;
|
162
|
+
props: {
|
163
|
+
layout: string;
|
164
|
+
labelAlign: string;
|
165
|
+
colon: boolean;
|
166
|
+
labelCol: number;
|
167
|
+
wrapperCol: number;
|
168
|
+
};
|
169
|
+
children: any[];
|
170
|
+
}[];
|
171
|
+
} | {
|
172
|
+
component: string;
|
173
|
+
children?: undefined;
|
174
|
+
name?: undefined;
|
175
|
+
type?: undefined;
|
176
|
+
title?: undefined;
|
177
|
+
reactions?: undefined;
|
178
|
+
})[];
|
179
|
+
};
|
180
|
+
children: {
|
181
|
+
component: string;
|
182
|
+
props: {
|
183
|
+
title: string;
|
184
|
+
};
|
173
185
|
}[];
|
174
186
|
}[];
|
175
187
|
}[];
|
@@ -5,46 +5,50 @@ export function array(title, name, fields, main, arrayTitle) {
|
|
5
5
|
name: name,
|
6
6
|
title: arrayTitle,
|
7
7
|
component: 'ArrayItems',
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
items: [{
|
12
|
-
component: 'FormFlex',
|
8
|
+
items: {
|
9
|
+
type: 'object',
|
10
|
+
decorator: 'ArrayItems.Item',
|
13
11
|
children: [{
|
14
|
-
component: '
|
12
|
+
component: 'FormFlex',
|
13
|
+
children: [{
|
14
|
+
component: 'ArrayItems.SortHandle'
|
15
|
+
}, {
|
16
|
+
component: 'ArrayItems.Index'
|
17
|
+
}]
|
15
18
|
}, {
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
schema: {
|
27
|
-
title: '{{$deps[0]}}'
|
19
|
+
name: 'drawer',
|
20
|
+
component: 'Editable.Drawer',
|
21
|
+
type: 'void',
|
22
|
+
title: '编辑详情',
|
23
|
+
reactions: {
|
24
|
+
dependencies: [".drawer.layout.".concat(main ? main : fields[0].name)],
|
25
|
+
fulfill: {
|
26
|
+
schema: {
|
27
|
+
title: '{{$deps[0]}}'
|
28
|
+
}
|
28
29
|
}
|
29
|
-
}
|
30
|
-
},
|
31
|
-
children: [{
|
32
|
-
name: 'layout',
|
33
|
-
component: 'FormLayout',
|
34
|
-
props: {
|
35
|
-
layout: 'vertical',
|
36
|
-
labelAlign: 'left',
|
37
|
-
colon: false,
|
38
|
-
labelCol: 24,
|
39
|
-
wrapperCol: 24
|
40
30
|
},
|
41
|
-
children:
|
31
|
+
children: [{
|
32
|
+
name: 'layout',
|
33
|
+
component: 'FormLayout',
|
34
|
+
props: {
|
35
|
+
layout: 'vertical',
|
36
|
+
labelAlign: 'left',
|
37
|
+
colon: false,
|
38
|
+
labelCol: 24,
|
39
|
+
wrapperCol: 24
|
40
|
+
},
|
41
|
+
children: fields
|
42
|
+
}]
|
43
|
+
}, {
|
44
|
+
component: 'ArrayItems.Remove'
|
42
45
|
}]
|
43
|
-
},
|
44
|
-
component: 'ArrayItems.Remove'
|
45
|
-
}],
|
46
|
+
},
|
46
47
|
children: [{
|
47
|
-
|
48
|
+
component: 'ArrayItems.Addition',
|
49
|
+
props: {
|
50
|
+
title: '添加一条'
|
51
|
+
}
|
48
52
|
}]
|
49
53
|
}]
|
50
54
|
};
|
package/es/nocode/index.scss
CHANGED
@@ -17,13 +17,10 @@
|
|
17
17
|
border: 1px solid var(--color-line1-1, #eaeaea);
|
18
18
|
|
19
19
|
&-component {
|
20
|
+
position: relative;
|
20
21
|
padding: 20px;
|
21
22
|
flex-grow: 1;
|
22
23
|
border-right: 1px solid var(--color-line1-1, #eaeaea);
|
23
|
-
|
24
|
-
&>.teamix-pro-page-container {
|
25
|
-
padding: 0;
|
26
|
-
}
|
27
24
|
}
|
28
25
|
|
29
26
|
&-configurator {
|
@@ -1,5 +1,6 @@
|
|
1
1
|
import React from 'react';
|
2
2
|
import { IActionButton } from '../actions';
|
3
|
+
import { ProInfoProps } from '../info';
|
3
4
|
import './index.scss';
|
4
5
|
export interface BreadcrumbItem {
|
5
6
|
link?: string;
|
@@ -35,8 +36,10 @@ export declare type PageHeaderProps = {
|
|
35
36
|
breadcrumb?: BreadcrumbItem[];
|
36
37
|
extra?: IActionButton[] | React.ReactNode;
|
37
38
|
operation?: IActionButton[] | React.ReactNode;
|
39
|
+
maxActions?: number;
|
38
40
|
tags?: TagItem[];
|
39
41
|
data?: DataItem[];
|
42
|
+
info?: ProInfoProps | React.ReactNode;
|
40
43
|
} & React.HTMLAttributes<HTMLElement>;
|
41
44
|
declare const PageHeader: React.FC<PageHeaderProps>;
|
42
45
|
export default PageHeader;
|
package/es/page-header/index.js
CHANGED
@@ -1,22 +1,24 @@
|
|
1
|
-
var _excluded = ["title", "description", "icon", "iconColor", "iconBackgroundType", "iconBackgroundColor", "goback", "operation", "extra", "image", "loading", "breadcrumb", "tags", "data", "children", "className", "style"];
|
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; }
|
1
|
+
var _excluded = ["title", "description", "icon", "iconColor", "iconBackgroundType", "iconBackgroundColor", "maxActions", "goback", "operation", "extra", "image", "loading", "breadcrumb", "tags", "data", "info", "children", "className", "style"];
|
6
2
|
|
7
3
|
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; }
|
8
4
|
|
9
5
|
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; }
|
10
6
|
|
7
|
+
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; }
|
8
|
+
|
9
|
+
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; }
|
10
|
+
|
11
11
|
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; }
|
12
12
|
|
13
13
|
import React from 'react';
|
14
|
+
import { useHistory } from 'react-router-dom';
|
14
15
|
import classnames from 'classnames';
|
15
16
|
import TeamixIcon from '@teamix/icon';
|
16
17
|
import { Breadcrumb, Tag } from '@alicloudfe/components';
|
17
18
|
import { baseClass } from '@teamix/utils';
|
18
19
|
import { ActionGroup } from '../actions';
|
19
20
|
import { BaseSkeleton } from '../skeleton';
|
21
|
+
import ProInfo from '../info';
|
20
22
|
import './index.scss';
|
21
23
|
var cls = baseClass('teamix-pro-page-header');
|
22
24
|
|
@@ -33,16 +35,22 @@ var renderNav = function renderNav(breadcrumbs) {
|
|
33
35
|
return null;
|
34
36
|
};
|
35
37
|
|
36
|
-
var renderExtra = function renderExtra(helps) {
|
38
|
+
var renderExtra = function renderExtra(helps, max) {
|
37
39
|
if (!helps) {
|
38
40
|
return null;
|
39
41
|
}
|
40
42
|
|
41
43
|
if (helps instanceof Array && helps.length) {
|
44
|
+
var actions = helps.map(function (item) {
|
45
|
+
return Object.assign({
|
46
|
+
type: 'normal'
|
47
|
+
}, item);
|
48
|
+
});
|
42
49
|
return /*#__PURE__*/React.createElement(ActionGroup, {
|
43
|
-
actions:
|
50
|
+
actions: actions,
|
44
51
|
type: "text",
|
45
|
-
divider: false
|
52
|
+
divider: false,
|
53
|
+
max: max
|
46
54
|
});
|
47
55
|
}
|
48
56
|
|
@@ -78,14 +86,15 @@ var isPresetColor = function isPresetColor(color) {
|
|
78
86
|
return PRESET_COLOR_REG.test(color);
|
79
87
|
};
|
80
88
|
|
81
|
-
var renderOperations = function renderOperations(operations) {
|
89
|
+
var renderOperations = function renderOperations(operations, max) {
|
82
90
|
if (!operations) {
|
83
91
|
return null;
|
84
92
|
}
|
85
93
|
|
86
94
|
if (operations instanceof Array && operations.length) {
|
87
95
|
return /*#__PURE__*/React.createElement(ActionGroup, {
|
88
|
-
actions: operations
|
96
|
+
actions: operations,
|
97
|
+
max: max
|
89
98
|
});
|
90
99
|
}
|
91
100
|
|
@@ -132,6 +141,18 @@ var renderData = function renderData(data) {
|
|
132
141
|
}));
|
133
142
|
};
|
134
143
|
|
144
|
+
var renderInfo = function renderInfo(info) {
|
145
|
+
// @ts-ignore
|
146
|
+
if (info === null || info === void 0 ? void 0 : info.columns) {
|
147
|
+
// @ts-ignore
|
148
|
+
return /*#__PURE__*/React.createElement(ProInfo, _objectSpread({
|
149
|
+
type: "header"
|
150
|
+
}, info));
|
151
|
+
}
|
152
|
+
|
153
|
+
return info;
|
154
|
+
};
|
155
|
+
|
135
156
|
var PageHeader = function PageHeader(props) {
|
136
157
|
var title = props.title,
|
137
158
|
description = props.description,
|
@@ -140,6 +161,8 @@ var PageHeader = function PageHeader(props) {
|
|
140
161
|
_props$iconBackground = props.iconBackgroundType,
|
141
162
|
iconBackgroundType = _props$iconBackground === void 0 ? 'square' : _props$iconBackground,
|
142
163
|
iconBackgroundColor = props.iconBackgroundColor,
|
164
|
+
_props$maxActions = props.maxActions,
|
165
|
+
maxActions = _props$maxActions === void 0 ? 4 : _props$maxActions,
|
143
166
|
goback = props.goback,
|
144
167
|
operation = props.operation,
|
145
168
|
extra = props.extra,
|
@@ -148,11 +171,13 @@ var PageHeader = function PageHeader(props) {
|
|
148
171
|
breadcrumb = props.breadcrumb,
|
149
172
|
tags = props.tags,
|
150
173
|
data = props.data,
|
174
|
+
info = props.info,
|
151
175
|
children = props.children,
|
152
176
|
className = props.className,
|
153
177
|
style = props.style,
|
154
178
|
others = _objectWithoutProperties(props, _excluded);
|
155
179
|
|
180
|
+
var history = useHistory();
|
156
181
|
var backgroundImage = image ? "url('".concat(image, "')") : undefined;
|
157
182
|
|
158
183
|
var showList = function showList(list) {
|
@@ -172,7 +197,7 @@ var PageHeader = function PageHeader(props) {
|
|
172
197
|
if (goback === true) {
|
173
198
|
history.go(-1);
|
174
199
|
} else if (typeof goback === 'string') {
|
175
|
-
|
200
|
+
history.push && history.push(goback);
|
176
201
|
}
|
177
202
|
};
|
178
203
|
|
@@ -200,7 +225,7 @@ var PageHeader = function PageHeader(props) {
|
|
200
225
|
className: cls('nav')
|
201
226
|
}, loading && /*#__PURE__*/React.createElement(BaseSkeleton.Header.Nav, null), !loading && renderNav(breadcrumb)), /*#__PURE__*/React.createElement("section", {
|
202
227
|
className: cls('extra')
|
203
|
-
}, !loading && renderExtra(extra))), (goback || icon || title !== undefined || description !== undefined || data || tags || operation) && /*#__PURE__*/React.createElement("section", {
|
228
|
+
}, !loading && renderExtra(extra, maxActions))), (goback || icon || title !== undefined || description !== undefined || data || tags || operation) && /*#__PURE__*/React.createElement("section", {
|
204
229
|
className: classnames(cls('section'), {
|
205
230
|
'with-description': description
|
206
231
|
})
|
@@ -216,7 +241,9 @@ var PageHeader = function PageHeader(props) {
|
|
216
241
|
className: cls('data')
|
217
242
|
}, renderData(data)), /*#__PURE__*/React.createElement("section", {
|
218
243
|
className: cls('operation')
|
219
|
-
}, !loading && renderOperations(operation)))),
|
244
|
+
}, !loading && renderOperations(operation, maxActions)))), info && !loading && /*#__PURE__*/React.createElement("section", {
|
245
|
+
className: classnames(cls('section'), cls('info'))
|
246
|
+
}, renderInfo(info)), children);
|
220
247
|
};
|
221
248
|
|
222
249
|
export default PageHeader;
|