@steedos-widgets/amis-lib 0.0.14 → 0.0.16
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/cjs/tsconfig.tsbuildinfo +1 -1
- package/dist/index.cjs.js +58 -47
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +61 -50
- package/dist/index.esm.js.map +1 -1
- package/dist/index.umd.js +60 -49
- package/dist/index.umd.js.map +1 -1
- package/dist/index.umd.min.js +60 -49
- package/dist/types/lib/converter/amis/fields_filter.d.ts +36 -2
- package/dist/types/lib/converter/amis/header.d.ts +92 -22
- package/dist/types/lib/objects.d.ts +51 -10
- package/dist/types/lib/objectsRelated.d.ts +1 -1
- package/dist/types/lib/page_init.d.ts +22 -22
- package/dist/types/schema/standard_new.amis.d.ts +3 -0
- package/dist/types/standard/button.d.ts +4 -0
- package/package.json +8 -7
|
@@ -45,6 +45,14 @@ export function getObjectFieldsFilterFormSchema(objectSchema: any, fields: any,
|
|
|
45
45
|
clearValueOnHidden: boolean;
|
|
46
46
|
fieldName: any;
|
|
47
47
|
})[];
|
|
48
|
+
onEvent: {
|
|
49
|
+
broadcastSearchableFieldsChange: {
|
|
50
|
+
actions: {
|
|
51
|
+
actionType: string;
|
|
52
|
+
script: string;
|
|
53
|
+
}[];
|
|
54
|
+
};
|
|
55
|
+
};
|
|
48
56
|
}>;
|
|
49
57
|
export function getObjectFieldsFilterBarSchema(objectSchema: any, fields: any, ctx: any): Promise<{
|
|
50
58
|
type: string;
|
|
@@ -89,6 +97,14 @@ export function getObjectFieldsFilterBarSchema(objectSchema: any, fields: any, c
|
|
|
89
97
|
clearValueOnHidden: boolean;
|
|
90
98
|
fieldName: any;
|
|
91
99
|
})[];
|
|
100
|
+
onEvent: {
|
|
101
|
+
broadcastSearchableFieldsChange: {
|
|
102
|
+
actions: {
|
|
103
|
+
actionType: string;
|
|
104
|
+
script: string;
|
|
105
|
+
}[];
|
|
106
|
+
};
|
|
107
|
+
};
|
|
92
108
|
}[];
|
|
93
109
|
size: string;
|
|
94
110
|
visibleOn: string;
|
|
@@ -187,13 +203,30 @@ export function getObjectFieldsFilterBarSchema(objectSchema: any, fields: any, c
|
|
|
187
203
|
actions: ({
|
|
188
204
|
actionType: string;
|
|
189
205
|
script: string;
|
|
190
|
-
|
|
206
|
+
eventName?: undefined;
|
|
191
207
|
args?: undefined;
|
|
208
|
+
data?: undefined;
|
|
209
|
+
componentId?: undefined;
|
|
210
|
+
} | {
|
|
211
|
+
actionType: string;
|
|
212
|
+
eventName: string;
|
|
213
|
+
args: {
|
|
214
|
+
eventName: string;
|
|
215
|
+
};
|
|
216
|
+
data: {
|
|
217
|
+
fields: string;
|
|
218
|
+
};
|
|
219
|
+
script?: undefined;
|
|
220
|
+
componentId?: undefined;
|
|
192
221
|
} | {
|
|
193
222
|
componentId: string;
|
|
194
|
-
args: {
|
|
223
|
+
args: {
|
|
224
|
+
eventName?: undefined;
|
|
225
|
+
};
|
|
195
226
|
actionType: string;
|
|
196
227
|
script?: undefined;
|
|
228
|
+
eventName?: undefined;
|
|
229
|
+
data?: undefined;
|
|
197
230
|
})[];
|
|
198
231
|
};
|
|
199
232
|
};
|
|
@@ -235,3 +268,4 @@ export function getObjectFieldsFilterBarSchema(objectSchema: any, fields: any, c
|
|
|
235
268
|
visibleOn: string;
|
|
236
269
|
className: string;
|
|
237
270
|
}>;
|
|
271
|
+
export function resetLocalListViewPropsWithSearchableFields(listViewId: any, searchableFields: any): void;
|
|
@@ -1,3 +1,74 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 列表视图顶部第一行amisSchema
|
|
3
|
+
* @param {*} objectSchema 对象UISchema
|
|
4
|
+
* @returns amisSchema
|
|
5
|
+
*/
|
|
6
|
+
export function getObjectListHeaderFirstLine(objectSchema: any, listViewName: any, ctx: any): {
|
|
7
|
+
type: string;
|
|
8
|
+
columns: ({
|
|
9
|
+
body: {
|
|
10
|
+
type: string;
|
|
11
|
+
columns: ({
|
|
12
|
+
body: {
|
|
13
|
+
type: string;
|
|
14
|
+
className: string;
|
|
15
|
+
tpl: string;
|
|
16
|
+
};
|
|
17
|
+
md: string;
|
|
18
|
+
className: string;
|
|
19
|
+
columnClassName: string;
|
|
20
|
+
valign?: undefined;
|
|
21
|
+
} | {
|
|
22
|
+
body: ({
|
|
23
|
+
type: string;
|
|
24
|
+
tpl: string;
|
|
25
|
+
inline: boolean;
|
|
26
|
+
wrapperComponent: string;
|
|
27
|
+
className: string;
|
|
28
|
+
style: {
|
|
29
|
+
fontFamily: string;
|
|
30
|
+
fontSize: number;
|
|
31
|
+
fontWeight: string;
|
|
32
|
+
};
|
|
33
|
+
label?: undefined;
|
|
34
|
+
rightIcon?: undefined;
|
|
35
|
+
size?: undefined;
|
|
36
|
+
hideCaret?: undefined;
|
|
37
|
+
btnClassName?: undefined;
|
|
38
|
+
buttons?: undefined;
|
|
39
|
+
} | {
|
|
40
|
+
type: string;
|
|
41
|
+
className: string;
|
|
42
|
+
label: string;
|
|
43
|
+
rightIcon: string;
|
|
44
|
+
size: string;
|
|
45
|
+
hideCaret: boolean;
|
|
46
|
+
btnClassName: string;
|
|
47
|
+
buttons: any[];
|
|
48
|
+
tpl?: undefined;
|
|
49
|
+
inline?: undefined;
|
|
50
|
+
wrapperComponent?: undefined;
|
|
51
|
+
style?: undefined;
|
|
52
|
+
})[];
|
|
53
|
+
md: string;
|
|
54
|
+
valign: string;
|
|
55
|
+
columnClassName: string;
|
|
56
|
+
className?: undefined;
|
|
57
|
+
})[];
|
|
58
|
+
}[];
|
|
59
|
+
md: string;
|
|
60
|
+
} | {
|
|
61
|
+
body: {
|
|
62
|
+
type: string;
|
|
63
|
+
name: any;
|
|
64
|
+
objectName: any;
|
|
65
|
+
visibleOn: any;
|
|
66
|
+
className: string;
|
|
67
|
+
}[];
|
|
68
|
+
md: string;
|
|
69
|
+
})[];
|
|
70
|
+
align: string;
|
|
71
|
+
};
|
|
1
72
|
/**
|
|
2
73
|
* 列表视图顶部amisSchema
|
|
3
74
|
* @param {*} objectSchema 对象UISchema
|
|
@@ -34,6 +105,7 @@ export function getObjectListHeader(objectSchema: any, listViewName: any, ctx: a
|
|
|
34
105
|
};
|
|
35
106
|
label?: undefined;
|
|
36
107
|
rightIcon?: undefined;
|
|
108
|
+
size?: undefined;
|
|
37
109
|
hideCaret?: undefined;
|
|
38
110
|
btnClassName?: undefined;
|
|
39
111
|
buttons?: undefined;
|
|
@@ -42,6 +114,7 @@ export function getObjectListHeader(objectSchema: any, listViewName: any, ctx: a
|
|
|
42
114
|
className: string;
|
|
43
115
|
label: string;
|
|
44
116
|
rightIcon: string;
|
|
117
|
+
size: string;
|
|
45
118
|
hideCaret: boolean;
|
|
46
119
|
btnClassName: string;
|
|
47
120
|
buttons: any[];
|
|
@@ -71,7 +144,23 @@ export function getObjectListHeader(objectSchema: any, listViewName: any, ctx: a
|
|
|
71
144
|
} | {
|
|
72
145
|
type: string;
|
|
73
146
|
align: string;
|
|
74
|
-
columns: {
|
|
147
|
+
columns: ({
|
|
148
|
+
body: {
|
|
149
|
+
type: string;
|
|
150
|
+
tpl: string;
|
|
151
|
+
visibleOn: string;
|
|
152
|
+
inline: boolean;
|
|
153
|
+
wrapperComponent: string;
|
|
154
|
+
className: string;
|
|
155
|
+
style: {
|
|
156
|
+
fontFamily: string;
|
|
157
|
+
fontSize: number;
|
|
158
|
+
};
|
|
159
|
+
id: string;
|
|
160
|
+
}[];
|
|
161
|
+
md: string;
|
|
162
|
+
valign: string;
|
|
163
|
+
} | {
|
|
75
164
|
body: ({
|
|
76
165
|
type: string;
|
|
77
166
|
label: string;
|
|
@@ -97,31 +186,12 @@ export function getObjectListHeader(objectSchema: any, listViewName: any, ctx: a
|
|
|
97
186
|
actionType: string;
|
|
98
187
|
target: string;
|
|
99
188
|
className: string;
|
|
100
|
-
id?: undefined;
|
|
101
|
-
onEvent?: undefined;
|
|
102
|
-
} | {
|
|
103
|
-
type: string;
|
|
104
|
-
label: string;
|
|
105
|
-
icon: string;
|
|
106
|
-
actionType: string;
|
|
107
|
-
className: string;
|
|
108
|
-
id: string;
|
|
109
|
-
onEvent: {
|
|
110
|
-
click: {
|
|
111
|
-
actions: {
|
|
112
|
-
actionType: string;
|
|
113
|
-
script: string;
|
|
114
|
-
}[];
|
|
115
|
-
weight: number;
|
|
116
|
-
};
|
|
117
|
-
};
|
|
118
|
-
target?: undefined;
|
|
119
189
|
})[];
|
|
120
190
|
md: string;
|
|
121
|
-
|
|
191
|
+
valign?: undefined;
|
|
192
|
+
})[];
|
|
122
193
|
className: string;
|
|
123
194
|
})[];
|
|
124
|
-
size: string;
|
|
125
195
|
className: string;
|
|
126
196
|
}[]>;
|
|
127
197
|
/**
|
|
@@ -22,16 +22,6 @@ export function getFormSchema(objectName: any, ctx: any): Promise<{
|
|
|
22
22
|
};
|
|
23
23
|
};
|
|
24
24
|
initApi: any;
|
|
25
|
-
/**
|
|
26
|
-
* localListViewProps规范来自crud请求api中api.data.$self参数值的。
|
|
27
|
-
* 比如:{"perPage":20,"page":1,"__searchable__name":"7","__searchable__between__n1__c":[null,null],"filter":[["name","contains","a"]]}
|
|
28
|
-
* __searchable__...:顶部放大镜搜索条件
|
|
29
|
-
* filter:右侧过滤器
|
|
30
|
-
* perPage:每页条数
|
|
31
|
-
* page:当前页码
|
|
32
|
-
* orderBy:排序字段
|
|
33
|
-
* orderDir:排序方向
|
|
34
|
-
*/
|
|
35
25
|
initFetch: any;
|
|
36
26
|
body: {}[];
|
|
37
27
|
};
|
|
@@ -261,6 +251,49 @@ export function getRecordDetailHeaderSchema(objectName: any, recordId: any): Pro
|
|
|
261
251
|
}[];
|
|
262
252
|
};
|
|
263
253
|
}>;
|
|
254
|
+
export function getRecordDetailSchema(objectName: any, appId: any): Promise<{
|
|
255
|
+
uiSchema: any;
|
|
256
|
+
amisSchema: {
|
|
257
|
+
type: string;
|
|
258
|
+
body: ({
|
|
259
|
+
type: string;
|
|
260
|
+
label: string;
|
|
261
|
+
objectApiName: string;
|
|
262
|
+
recordId: string;
|
|
263
|
+
id: string;
|
|
264
|
+
onEvent: {
|
|
265
|
+
recordLoaded: {
|
|
266
|
+
actions: {
|
|
267
|
+
actionType: string;
|
|
268
|
+
data: {
|
|
269
|
+
name: string;
|
|
270
|
+
};
|
|
271
|
+
}[];
|
|
272
|
+
};
|
|
273
|
+
};
|
|
274
|
+
tabs?: undefined;
|
|
275
|
+
} | {
|
|
276
|
+
type: string;
|
|
277
|
+
tabs: {
|
|
278
|
+
title: string;
|
|
279
|
+
body: {
|
|
280
|
+
type: string;
|
|
281
|
+
label: string;
|
|
282
|
+
objectApiName: string;
|
|
283
|
+
recordId: string;
|
|
284
|
+
id: string;
|
|
285
|
+
appId: any;
|
|
286
|
+
}[];
|
|
287
|
+
id: string;
|
|
288
|
+
}[];
|
|
289
|
+
id: string;
|
|
290
|
+
label?: undefined;
|
|
291
|
+
objectApiName?: undefined;
|
|
292
|
+
recordId?: undefined;
|
|
293
|
+
onEvent?: undefined;
|
|
294
|
+
})[];
|
|
295
|
+
};
|
|
296
|
+
}>;
|
|
264
297
|
export function getObjectRelatedList(appName: any, objectName: any, recordId: any, formFactor: any): Promise<({
|
|
265
298
|
masterObjectName: any;
|
|
266
299
|
object_name: any;
|
|
@@ -377,5 +410,13 @@ export function getSearchableFieldsFilterSchema(objectSchema: any, fields: any,
|
|
|
377
410
|
clearValueOnHidden: boolean;
|
|
378
411
|
fieldName: any;
|
|
379
412
|
})[];
|
|
413
|
+
onEvent: {
|
|
414
|
+
broadcastSearchableFieldsChange: {
|
|
415
|
+
actions: {
|
|
416
|
+
actionType: string;
|
|
417
|
+
script: string;
|
|
418
|
+
}[];
|
|
419
|
+
};
|
|
420
|
+
};
|
|
380
421
|
}>;
|
|
381
422
|
export function setUISchemaFunction(fun: any): void;
|
|
@@ -51,7 +51,7 @@ export function getAmisObjectRelatedList(appName: any, objectName: any, recordId
|
|
|
51
51
|
isCustom?: undefined;
|
|
52
52
|
};
|
|
53
53
|
})[]>;
|
|
54
|
-
export function getRecordDetailRelatedListSchema(objectName: any, recordId: any, relatedObjectName: any, relatedKey: any, top: any): Promise<{
|
|
54
|
+
export function getRecordDetailRelatedListSchema(objectName: any, recordId: any, relatedObjectName: any, relatedKey: any, top: any, hiddenEmptyTable: any, appId: any): Promise<{
|
|
55
55
|
uiSchema: any;
|
|
56
56
|
amisSchema: {
|
|
57
57
|
type: string;
|
|
@@ -64,6 +64,7 @@ export function getListPageInitSchema(objectApiName: any, formFactor: any, userS
|
|
|
64
64
|
};
|
|
65
65
|
label?: undefined;
|
|
66
66
|
rightIcon?: undefined;
|
|
67
|
+
size?: undefined;
|
|
67
68
|
hideCaret?: undefined;
|
|
68
69
|
btnClassName?: undefined;
|
|
69
70
|
buttons?: undefined;
|
|
@@ -72,6 +73,7 @@ export function getListPageInitSchema(objectApiName: any, formFactor: any, userS
|
|
|
72
73
|
className: string;
|
|
73
74
|
label: string;
|
|
74
75
|
rightIcon: string;
|
|
76
|
+
size: string;
|
|
75
77
|
hideCaret: boolean;
|
|
76
78
|
btnClassName: string;
|
|
77
79
|
buttons: any[];
|
|
@@ -101,7 +103,23 @@ export function getListPageInitSchema(objectApiName: any, formFactor: any, userS
|
|
|
101
103
|
} | {
|
|
102
104
|
type: string;
|
|
103
105
|
align: string;
|
|
104
|
-
columns: {
|
|
106
|
+
columns: ({
|
|
107
|
+
body: {
|
|
108
|
+
type: string;
|
|
109
|
+
tpl: string;
|
|
110
|
+
visibleOn: string;
|
|
111
|
+
inline: boolean;
|
|
112
|
+
wrapperComponent: string;
|
|
113
|
+
className: string;
|
|
114
|
+
style: {
|
|
115
|
+
fontFamily: string;
|
|
116
|
+
fontSize: number;
|
|
117
|
+
};
|
|
118
|
+
id: string;
|
|
119
|
+
}[];
|
|
120
|
+
md: string;
|
|
121
|
+
valign: string;
|
|
122
|
+
} | {
|
|
105
123
|
body: ({
|
|
106
124
|
type: string;
|
|
107
125
|
label: string;
|
|
@@ -127,33 +145,15 @@ export function getListPageInitSchema(objectApiName: any, formFactor: any, userS
|
|
|
127
145
|
actionType: string;
|
|
128
146
|
target: string;
|
|
129
147
|
className: string;
|
|
130
|
-
id?: undefined;
|
|
131
|
-
onEvent?: undefined;
|
|
132
|
-
} | {
|
|
133
|
-
type: string;
|
|
134
|
-
label: string;
|
|
135
|
-
icon: string;
|
|
136
|
-
actionType: string;
|
|
137
|
-
className: string;
|
|
138
|
-
id: string;
|
|
139
|
-
onEvent: {
|
|
140
|
-
click: {
|
|
141
|
-
actions: {
|
|
142
|
-
actionType: string;
|
|
143
|
-
script: string;
|
|
144
|
-
}[];
|
|
145
|
-
weight: number;
|
|
146
|
-
};
|
|
147
|
-
};
|
|
148
|
-
target?: undefined;
|
|
149
148
|
})[];
|
|
150
149
|
md: string;
|
|
151
|
-
|
|
150
|
+
valign?: undefined;
|
|
151
|
+
})[];
|
|
152
152
|
className: string;
|
|
153
153
|
})[];
|
|
154
|
-
size: string;
|
|
155
154
|
className: string;
|
|
156
155
|
}[];
|
|
156
|
+
className: string;
|
|
157
157
|
}[];
|
|
158
158
|
}>;
|
|
159
159
|
export function getRecordPageInitSchema(objectApiName: any): Promise<{
|
|
@@ -17,6 +17,9 @@ export namespace StandardButtons {
|
|
|
17
17
|
data: {
|
|
18
18
|
$master: string;
|
|
19
19
|
"&": string;
|
|
20
|
+
objectName: string;
|
|
21
|
+
context: string;
|
|
22
|
+
listViewId: string;
|
|
20
23
|
};
|
|
21
24
|
title: string;
|
|
22
25
|
bodyClassName: string;
|
|
@@ -146,6 +149,7 @@ export namespace StandardButtons {
|
|
|
146
149
|
}>;
|
|
147
150
|
function getStandardDeleteMany(uiSchema: any, ctx: any): Promise<{
|
|
148
151
|
type: string;
|
|
152
|
+
todo: () => void;
|
|
149
153
|
}>;
|
|
150
154
|
function getStandardImportData(uiSchema: any, ctx: any): Promise<{
|
|
151
155
|
type: string;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@steedos-widgets/amis-lib",
|
|
3
3
|
"private": false,
|
|
4
|
-
"version": "0.0.
|
|
4
|
+
"version": "0.0.16",
|
|
5
5
|
"unpkg": "./dist/index.umd.js",
|
|
6
6
|
"main": "./dist/index.cjs.js",
|
|
7
7
|
"module": "./dist/index.esm.js",
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
],
|
|
12
12
|
"scripts": {
|
|
13
13
|
"prebuild": "rimraf dist",
|
|
14
|
-
"
|
|
14
|
+
"watch": "rollup -c rollup.config.ts -w",
|
|
15
15
|
"build": "yarn build-types && yarn build-rollup",
|
|
16
16
|
"build-types": "tsc --emitDeclarationOnly --declaration --declarationDir dist/types",
|
|
17
17
|
"build-rollup": "rollup -c rollup.config.ts && yarn build-uglifyjs",
|
|
@@ -22,15 +22,18 @@
|
|
|
22
22
|
"access": "public"
|
|
23
23
|
},
|
|
24
24
|
"devDependencies": {
|
|
25
|
-
"uglify-js": "^3.17.0",
|
|
26
25
|
"@babel/core": "^7.18.13",
|
|
27
26
|
"@rollup/plugin-babel": "^5.3.1",
|
|
28
27
|
"@rollup/plugin-commonjs": "^22.0.0",
|
|
29
28
|
"@rollup/plugin-node-resolve": "^13.1.3",
|
|
29
|
+
"@rollup/plugin-typescript": "^8.4.0",
|
|
30
|
+
"@types/lodash": "^4.14.184",
|
|
30
31
|
"amis": "^2.1.1-beta.2",
|
|
32
|
+
"fast-glob": "^3.2.12",
|
|
31
33
|
"rimraf": "3.0.2",
|
|
32
34
|
"rollup": "^2.70.1",
|
|
33
35
|
"rollup-plugin-alias": "^2.2.0",
|
|
36
|
+
"rollup-plugin-commonjs": "^10.1.0",
|
|
34
37
|
"rollup-plugin-external-globals": "^0.6.1",
|
|
35
38
|
"rollup-plugin-json": "^4.0.0",
|
|
36
39
|
"rollup-plugin-node-builtins": "^2.1.2",
|
|
@@ -44,16 +47,14 @@
|
|
|
44
47
|
"rollup-plugin-sourcemaps": "^0.6.3",
|
|
45
48
|
"rollup-plugin-svg": "^2.0.0",
|
|
46
49
|
"rollup-plugin-tslib-resolve-id": "^0.0.0",
|
|
47
|
-
"@rollup/plugin-typescript": "^8.4.0",
|
|
48
|
-
"rollup-plugin-visualizer": "^5.8.0",
|
|
49
|
-
"rollup-plugin-commonjs": "^10.1.0",
|
|
50
50
|
"rollup-plugin-uglify": "^6.0.4",
|
|
51
|
+
"rollup-plugin-visualizer": "^5.8.0",
|
|
51
52
|
"ts-jest": "26.4.4",
|
|
52
53
|
"tslint": "^5.8.0",
|
|
53
54
|
"tslint-config-prettier": "^1.1.0",
|
|
54
55
|
"tslint-config-standard": "^7.0.0",
|
|
55
56
|
"typescript": "^4.6.2",
|
|
56
|
-
"
|
|
57
|
+
"uglify-js": "^3.17.0"
|
|
57
58
|
},
|
|
58
59
|
"dependencies": {
|
|
59
60
|
"lodash": "^4.17.21"
|