@steedos-widgets/amis-lib 0.0.7 → 0.0.9

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.
@@ -1,5 +1,7 @@
1
1
  export * from './lib/amis';
2
2
  export * from './lib/objects';
3
+ export * from './lib/objectsRelated';
4
+ export * from './lib/page_init';
3
5
  export * from './lib/apps';
4
6
  export * from './lib/buttons';
5
7
  export * from './lib/defaultsDeep';
@@ -8,6 +8,7 @@ export function getListViewButtons(uiSchema: any, ctx: any): any[];
8
8
  export function getObjectDetailButtons(uiSchema: any, ctx: any): any[];
9
9
  export function getObjectDetailMoreButtons(uiSchema: any, ctx: any): any[];
10
10
  export function getListViewItemButtons(uiSchema: any, ctx: any): Promise<any[]>;
11
+ export function getObjectRelatedListButtons(uiSchema: any, ctx: any): Promise<any[]>;
11
12
  export function getButton(objectName: any, buttonName: any, ctx: any): Promise<any>;
12
13
  export function execute(button: any, props: any): any;
13
14
  export function executeButton(button: any, props: any): any;
@@ -0,0 +1,281 @@
1
+ /**
2
+ * 列表视图顶部amisSchema
3
+ * @param {*} objectSchema 对象UISchema
4
+ * @returns amisSchema
5
+ */
6
+ export function getObjectListHeader(objectSchema: any, listViewName: any): Promise<{
7
+ type: string;
8
+ body: ({
9
+ type: string;
10
+ columns: ({
11
+ body: {
12
+ type: string;
13
+ columns: ({
14
+ body: {
15
+ type: string;
16
+ className: string;
17
+ tpl: string;
18
+ };
19
+ md: string;
20
+ className: string;
21
+ columnClassName: string;
22
+ valign?: undefined;
23
+ } | {
24
+ body: ({
25
+ type: string;
26
+ tpl: string;
27
+ inline: boolean;
28
+ wrapperComponent: string;
29
+ className: string;
30
+ style: {
31
+ fontFamily: string;
32
+ fontSize: number;
33
+ fontWeight: string;
34
+ };
35
+ label?: undefined;
36
+ rightIcon?: undefined;
37
+ hideCaret?: undefined;
38
+ btnClassName?: undefined;
39
+ buttons?: undefined;
40
+ } | {
41
+ type: string;
42
+ className: string;
43
+ label: string;
44
+ rightIcon: 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
+ } | {
72
+ type: string;
73
+ align: string;
74
+ columns: {
75
+ body: ({
76
+ type: string;
77
+ label: string;
78
+ icon: string;
79
+ actionType: string;
80
+ target: string;
81
+ className: string;
82
+ id?: undefined;
83
+ onEvent?: undefined;
84
+ } | {
85
+ type: string;
86
+ label: string;
87
+ icon: string;
88
+ actionType: string;
89
+ className: string;
90
+ id: string;
91
+ onEvent: {
92
+ click: {
93
+ actions: {
94
+ actionType: string;
95
+ script: string;
96
+ }[];
97
+ weight: number;
98
+ };
99
+ };
100
+ target?: undefined;
101
+ })[];
102
+ md: string;
103
+ }[];
104
+ })[];
105
+ size: string;
106
+ className: string;
107
+ }>;
108
+ /**
109
+ * 记录详细界面顶部头amisSchema,也是标题面板组件的amisSchema
110
+ * @param {*} objectSchema 对象UISchema
111
+ * @param {*} recordId 记录id
112
+ * @returns amisSchema
113
+ */
114
+ export function getObjectRecordDetailHeader(objectSchema: any, recordId: any): Promise<{
115
+ type: string;
116
+ bodyClassName: string;
117
+ name: string;
118
+ data: {
119
+ context: {
120
+ rootUrl: any;
121
+ tenantId: any;
122
+ authToken: any;
123
+ };
124
+ objectName: any;
125
+ _id: any;
126
+ recordPermissions: any;
127
+ uiSchema: any;
128
+ };
129
+ body: {
130
+ type: string;
131
+ body: {
132
+ type: string;
133
+ title: string;
134
+ body: any[];
135
+ header: {
136
+ type: string;
137
+ body: {
138
+ type: string;
139
+ columns: ({
140
+ body: {
141
+ type: string;
142
+ columns: ({
143
+ body: {
144
+ type: string;
145
+ className: string;
146
+ tpl: string;
147
+ };
148
+ md: string;
149
+ className: string;
150
+ columnClassName: string;
151
+ } | {
152
+ body: ({
153
+ type: string;
154
+ tpl: string;
155
+ inline: boolean;
156
+ wrapperComponent: string;
157
+ style: {
158
+ fontFamily: string;
159
+ fontSize: number;
160
+ fontWeight?: undefined;
161
+ textAlign?: undefined;
162
+ };
163
+ className: string;
164
+ } | {
165
+ type: string;
166
+ tpl: string;
167
+ inline: boolean;
168
+ wrapperComponent: string;
169
+ style: {
170
+ fontFamily: string;
171
+ fontSize: number;
172
+ fontWeight: string;
173
+ textAlign: string;
174
+ };
175
+ className: string;
176
+ })[];
177
+ md?: undefined;
178
+ className?: undefined;
179
+ columnClassName?: undefined;
180
+ })[];
181
+ }[];
182
+ md: string;
183
+ } | {
184
+ body: {
185
+ type: string;
186
+ name: any;
187
+ objectName: any;
188
+ visibleOn: any;
189
+ className: string;
190
+ }[];
191
+ md: string;
192
+ })[];
193
+ align: string;
194
+ }[];
195
+ size: string;
196
+ };
197
+ affixFooter: boolean;
198
+ headerClassName: string;
199
+ bodyClassName: string;
200
+ }[];
201
+ messages: {};
202
+ api: {
203
+ method: string;
204
+ url: string;
205
+ headers: {
206
+ Authorization: string;
207
+ };
208
+ data: {
209
+ query: string;
210
+ };
211
+ sendOn: string;
212
+ requestAdaptor: string;
213
+ adaptor: string;
214
+ };
215
+ }[];
216
+ }>;
217
+ /**
218
+ * 记录详细界面中相关表顶部头amisSchema
219
+ * @param {*} relatedObjectSchema 相关对象UISchema
220
+ * @returns amisSchema
221
+ */
222
+ export function getObjectRecordDetailRelatedListHeader(relatedObjectSchema: any): Promise<{
223
+ type: string;
224
+ body: {
225
+ type: string;
226
+ columns: ({
227
+ body: {
228
+ type: string;
229
+ columns: ({
230
+ body: {
231
+ type: string;
232
+ className: string;
233
+ tpl: string;
234
+ };
235
+ md: string;
236
+ className: string;
237
+ columnClassName: string;
238
+ valign?: undefined;
239
+ } | {
240
+ body: {
241
+ type: string;
242
+ tpl: string;
243
+ inline: boolean;
244
+ wrapperComponent: string;
245
+ className: string;
246
+ style: {
247
+ fontFamily: string;
248
+ fontSize: number;
249
+ fontWeight: string;
250
+ };
251
+ }[];
252
+ md: string;
253
+ valign: string;
254
+ columnClassName: string;
255
+ className?: undefined;
256
+ })[];
257
+ }[];
258
+ md: string;
259
+ } | {
260
+ body: {
261
+ type: string;
262
+ name: any;
263
+ objectName: any;
264
+ visibleOn: any;
265
+ className: string;
266
+ }[];
267
+ md: string;
268
+ })[];
269
+ align: string;
270
+ }[];
271
+ size: string;
272
+ className: string;
273
+ }>;
274
+ /**
275
+ * 点击记录详细界面相关表顶部标题进入的相关表页面的顶部amisSchema
276
+ * @param {*} objectSchema
277
+ * @param {*} recordId
278
+ * @param {*} relatedObjectName
279
+ * @returns amisSchema
280
+ */
281
+ export function getObjectRelatedListHeader(objectSchema: any, recordId: any, relatedObjectName: any): Promise<void>;
@@ -1,6 +1,7 @@
1
1
  export function getObjectList(objectSchema: any, fields: any, options: any): Promise<{
2
2
  type: string;
3
- bodyClassName: string;
3
+ className: string;
4
+ id: string;
4
5
  name: string;
5
6
  data: {
6
7
  context: {
@@ -8,101 +9,13 @@ export function getObjectList(objectSchema: any, fields: any, options: any): Pro
8
9
  tenantId: any;
9
10
  authToken: any;
10
11
  };
12
+ objectName: any;
13
+ _id: any;
14
+ recordPermissions: any;
15
+ uiSchema: any;
11
16
  };
12
17
  body: {};
13
18
  }>;
14
- export function getRecordDetailHeaderAmisSchema(objectSchema: any, recordId: any): Promise<{
15
- type: string;
16
- bodyClassName: string;
17
- name: string;
18
- data: {
19
- context: {
20
- rootUrl: any;
21
- tenantId: any;
22
- authToken: any;
23
- };
24
- };
25
- body: {
26
- type: string;
27
- body: {
28
- type: string;
29
- title: string;
30
- body: any[];
31
- header: {
32
- type: string;
33
- body: {
34
- type: string;
35
- columns: ({
36
- body: {
37
- type: string;
38
- columns: ({
39
- body: {
40
- type: string;
41
- className: string;
42
- tpl: string;
43
- };
44
- md: string;
45
- className: string;
46
- columnClassName: string;
47
- } | {
48
- body: ({
49
- type: string;
50
- tpl: string;
51
- inline: boolean;
52
- wrapperComponent: string;
53
- style: {
54
- fontFamily: string;
55
- fontSize: number;
56
- fontWeight?: undefined;
57
- textAlign?: undefined;
58
- };
59
- className: string;
60
- } | {
61
- type: string;
62
- tpl: string;
63
- inline: boolean;
64
- wrapperComponent: string;
65
- style: {
66
- fontFamily: string;
67
- fontSize: number;
68
- fontWeight: string;
69
- textAlign: string;
70
- };
71
- className: string;
72
- })[];
73
- md?: undefined;
74
- className?: undefined;
75
- columnClassName?: undefined;
76
- })[];
77
- }[];
78
- md: number;
79
- } | {
80
- body: any[];
81
- md?: undefined;
82
- })[];
83
- }[];
84
- size: string;
85
- };
86
- affixFooter: boolean;
87
- headerClassName: string;
88
- bodyClassName: string;
89
- }[];
90
- messages: {};
91
- api: {
92
- method: string;
93
- url: string;
94
- headers: {
95
- Authorization: string;
96
- };
97
- data: {
98
- query: string;
99
- };
100
- sendOn: string;
101
- requestAdaptor: string;
102
- adaptor: string;
103
- };
104
- }[];
105
- }>;
106
19
  export function getObjectForm(objectSchema: any, ctx: any): Promise<{
107
20
  type: string;
108
21
  className: string;
@@ -4,6 +4,7 @@ export function getNumberTpl(field: any): string;
4
4
  export function getTimeTpl(field: any): string;
5
5
  export function getDateTpl(field: any): string;
6
6
  export function getDateTimeTpl(field: any): string;
7
+ export function getUiFieldTpl(field: any): string;
7
8
  export function getRefObjectNameFieldName(field: any): Promise<any>;
8
9
  export function getSelectTpl(field: any): string;
9
10
  export function getNameTpl(field: any, ctx: any): string;
@@ -98,28 +98,31 @@ export function getViewSchema(objectName: any, recordId: any, ctx: any): Promise
98
98
  }>;
99
99
  export function getListSchema(appName: any, objectName: any, listViewName: any, ctx?: {}): Promise<{
100
100
  uiSchema: any;
101
+ isCustom?: undefined;
101
102
  amisSchema?: undefined;
103
+ } | {
104
+ uiSchema: any;
105
+ isCustom: boolean;
106
+ amisSchema: any;
102
107
  } | {
103
108
  uiSchema: any;
104
109
  amisSchema: {
105
110
  type: string;
106
- bodyClassName: string;
107
- name: string;
108
- data: {
109
- context: {
110
- rootUrl: any;
111
- tenantId: any;
112
- authToken: any;
113
- };
114
- };
115
- body: {};
111
+ objectApiName: any;
112
+ columns: any;
113
+ extraColumns: any;
114
+ filters: any;
115
+ sort: string;
116
+ ctx: {};
116
117
  };
118
+ isCustom?: undefined;
117
119
  }>;
118
120
  export function getTableSchema(appName: any, objectName: any, columns: any, ctx?: {}): Promise<{
119
121
  uiSchema: any;
120
122
  amisSchema: {
121
123
  type: string;
122
- bodyClassName: string;
124
+ className: string;
125
+ id: string;
123
126
  name: string;
124
127
  data: {
125
128
  context: {
@@ -127,6 +130,10 @@ export function getTableSchema(appName: any, objectName: any, columns: any, ctx?
127
130
  tenantId: any;
128
131
  authToken: any;
129
132
  };
133
+ objectName: any;
134
+ _id: any;
135
+ recordPermissions: any;
136
+ uiSchema: any;
130
137
  };
131
138
  body: {};
132
139
  };
@@ -143,6 +150,10 @@ export function getRecordDetailHeaderSchema(objectName: any, recordId: any): Pro
143
150
  tenantId: any;
144
151
  authToken: any;
145
152
  };
153
+ objectName: any;
154
+ _id: any;
155
+ recordPermissions: any;
156
+ uiSchema: any;
146
157
  };
147
158
  body: {
148
159
  type: string;
@@ -197,11 +208,18 @@ export function getRecordDetailHeaderSchema(objectName: any, recordId: any): Pro
197
208
  columnClassName?: undefined;
198
209
  })[];
199
210
  }[];
200
- md: number;
211
+ md: string;
201
212
  } | {
202
- body: any[];
203
- md?: undefined;
213
+ body: {
214
+ type: string;
215
+ name: any;
216
+ objectName: any;
217
+ visibleOn: any;
218
+ className: string;
219
+ }[];
220
+ md: string;
204
221
  })[];
222
+ align: string;
205
223
  }[];
206
224
  size: string;
207
225
  };
@@ -228,83 +246,18 @@ export function getRecordDetailHeaderSchema(objectName: any, recordId: any): Pro
228
246
  }>;
229
247
  export function getRecordDetailRelatedListSchema(objectName: any, recordId: any, relatedObjectName: any): Promise<{
230
248
  uiSchema: any;
231
- amisSchema: {
232
- type: string;
233
- className: string;
234
- name: string;
235
- api: any;
236
- data: {
237
- context: {
238
- rootUrl: any;
239
- tenantId: any;
240
- authToken: any;
241
- };
242
- };
243
- body: ({
244
- bulkActions: any[];
245
- headerToolbar: any[];
246
- columnsTogglable: boolean;
247
- source: string;
248
- className: string;
249
- } | {
250
- type: string;
251
- body: {
252
- type: string;
253
- columns: ({
254
- body: {
255
- type: string;
256
- columns: ({
257
- body: {
258
- type: string;
259
- className: string;
260
- tpl: string;
261
- };
262
- md: string;
263
- className: string;
264
- columnClassName: string;
265
- valign?: undefined;
266
- } | {
267
- body: {
268
- type: string;
269
- tpl: string;
270
- inline: boolean;
271
- wrapperComponent: string;
272
- className: string;
273
- style: {
274
- fontFamily: string;
275
- fontSize: number;
276
- fontWeight: string;
277
- };
278
- }[];
279
- md: string;
280
- valign: string;
281
- columnClassName: string;
282
- className?: undefined;
283
- })[];
284
- }[];
285
- md: number;
286
- } | {
287
- body: any[];
288
- md?: undefined;
289
- })[];
290
- }[];
291
- size: string;
292
- className: string;
293
- })[];
294
- };
249
+ amisSchema: any;
295
250
  }>;
296
- export function getObjectRelatedList(appName: any, objectName: any, recordId: any, formFactor: any): Promise<{
251
+ export function getObjectRelatedList(appName: any, objectName: any, recordId: any, formFactor: any): Promise<({
297
252
  masterObjectName: any;
298
253
  object_name: any;
299
254
  foreign_key: any;
300
255
  schema: {
301
- uiSchema: any;
302
- amisSchema?: undefined;
303
- } | {
304
256
  uiSchema: any;
305
257
  amisSchema: {
306
258
  type: string;
307
- bodyClassName: string;
259
+ className: string;
260
+ id: string;
308
261
  name: string;
309
262
  data: {
310
263
  context: {
@@ -312,11 +265,40 @@ export function getObjectRelatedList(appName: any, objectName: any, recordId: an
312
265
  tenantId: any;
313
266
  authToken: any;
314
267
  };
268
+ objectName: any;
269
+ _id: any;
270
+ recordPermissions: any;
271
+ uiSchema: any;
315
272
  };
316
273
  body: {};
317
274
  };
318
275
  };
319
- }[]>;
276
+ } | {
277
+ masterObjectName: any;
278
+ object_name: any;
279
+ foreign_key: any;
280
+ schema: {
281
+ uiSchema: any;
282
+ isCustom?: undefined;
283
+ amisSchema?: undefined;
284
+ } | {
285
+ uiSchema: any;
286
+ isCustom: boolean;
287
+ amisSchema: any;
288
+ } | {
289
+ uiSchema: any;
290
+ amisSchema: {
291
+ type: string;
292
+ objectApiName: any;
293
+ columns: any;
294
+ extraColumns: any;
295
+ filters: any;
296
+ sort: string;
297
+ ctx: {};
298
+ };
299
+ isCustom?: undefined;
300
+ };
301
+ })[]>;
320
302
  export function getObjectRelated({ appName, masterObjectName, objectName, relatedFieldName, recordId, formFactor }: {
321
303
  appName: any;
322
304
  masterObjectName: any;
@@ -330,22 +312,24 @@ export function getObjectRelated({ appName, masterObjectName, objectName, relate
330
312
  foreign_key: any;
331
313
  schema: {
332
314
  uiSchema: any;
315
+ isCustom?: undefined;
333
316
  amisSchema?: undefined;
317
+ } | {
318
+ uiSchema: any;
319
+ isCustom: boolean;
320
+ amisSchema: any;
334
321
  } | {
335
322
  uiSchema: any;
336
323
  amisSchema: {
337
324
  type: string;
338
- bodyClassName: string;
339
- name: string;
340
- data: {
341
- context: {
342
- rootUrl: any;
343
- tenantId: any;
344
- authToken: any;
345
- };
346
- };
347
- body: {};
325
+ objectApiName: any;
326
+ columns: any;
327
+ extraColumns: any;
328
+ filters: any;
329
+ sort: string;
330
+ ctx: {};
348
331
  };
332
+ isCustom?: undefined;
349
333
  };
350
334
  record: any;
351
335
  masterObjectUISchema: any;