@steedos-widgets/amis-lib 1.0.12 → 1.0.14

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.
@@ -12,6 +12,7 @@ export * from './lib/public.env';
12
12
  export * from './lib/record';
13
13
  export * from './lib/space_users';
14
14
  export * from './lib/steedos.client.js';
15
+ export * as Field from './lib/converter/amis/fields/index';
15
16
  export * from './lib/converter/amis/fields/lookup';
16
17
  export * from './lib/converter/amis/fields/user';
17
18
  export * from './lib/converter/amis/filters';
@@ -27,9 +27,9 @@ export function getSaveApi(object: any, recordId: any, fields: any, options: any
27
27
  method: string;
28
28
  url: string;
29
29
  data: {
30
- objectName: string;
30
+ objectName: any;
31
31
  $: string;
32
- recordId: string;
32
+ recordId: any;
33
33
  modalName: string;
34
34
  };
35
35
  requestAdaptor: string;
@@ -6,7 +6,7 @@ export function getBaseFields(readonly: any): {
6
6
  className: string;
7
7
  tpl: string;
8
8
  }[];
9
- export function getAmisFieldType(sField: any): "url" | "date" | "datetime" | "number" | "select" | "image" | "password" | "text" | "textarea" | "table" | "email" | "html" | "picker" | "checkbox";
9
+ export function getAmisFieldType(sField: any): "url" | "date" | "datetime" | "number" | "select" | "image" | "password" | "text" | "textarea" | "picker" | "table" | "email" | "html" | "checkbox";
10
10
  export function getObjectFieldSubFields(mainField: any, fields: any): any;
11
11
  export function getGridFieldSubFields(mainField: any, fields: any): any;
12
12
  /**
@@ -51,8 +51,9 @@ export function lookupToAmisPicker(field: any, readonly: any, ctx: any): Promise
51
51
  } | {
52
52
  mode: string;
53
53
  name: string;
54
+ headerToolbarClassName: string;
55
+ className: string;
54
56
  draggable: boolean;
55
- headerToolbar: string[];
56
57
  defaultParams: {
57
58
  perPage: any;
58
59
  };
@@ -1,8 +1,9 @@
1
1
  export function getTableSchema(fields: any, options: any): Promise<{
2
2
  mode: string;
3
3
  name: string;
4
+ headerToolbarClassName: string;
5
+ className: string;
4
6
  draggable: boolean;
5
- headerToolbar: string[];
6
7
  defaultParams: {
7
8
  perPage: any;
8
9
  };
@@ -53,9 +53,7 @@ export function getObjectFieldsFilterFormSchema(objectSchema: any, fields: any,
53
53
  }>;
54
54
  export function getObjectFieldsFilterBarSchema(objectSchema: any, fields: any, ctx: any): Promise<{
55
55
  type: string;
56
- data: {
57
- listViewId: string;
58
- };
56
+ data: {};
59
57
  id: string;
60
58
  dataProvider: {
61
59
  inited: string;
@@ -237,6 +235,9 @@ export function getObjectFieldsFilterBarSchema(objectSchema: any, fields: any, c
237
235
  "&": string;
238
236
  objectName: string;
239
237
  listName: string;
238
+ listViewId: string;
239
+ uiSchema: string;
240
+ isLookup: string;
240
241
  context: string;
241
242
  fields: string;
242
243
  };
@@ -264,17 +265,4 @@ export function getObjectFieldsFilterBarSchema(objectSchema: any, fields: any, c
264
265
  visibleOn: string;
265
266
  };
266
267
  className: string;
267
- onEvent: {
268
- broadcast_toggle_fields_filter: {
269
- actions: {
270
- actionType: string;
271
- args: {
272
- value: {
273
- showFieldsFilter: string;
274
- };
275
- };
276
- }[];
277
- };
278
- };
279
268
  }>;
280
- export function resetLocalListViewPropsWithSearchableFields(listViewId: any, searchableFields: any): void;
@@ -4,9 +4,9 @@ export function getFindOneQuery(object: any, recordId: any, fields: any, options
4
4
  query: string;
5
5
  }>;
6
6
  export function getSaveQuery(object: any, recordId: any, fields: any, options: any): {
7
- objectName: string;
7
+ objectName: any;
8
8
  $: string;
9
- recordId: string;
9
+ recordId: any;
10
10
  modalName: string;
11
11
  };
12
12
  export function getScriptForReadonlyFields(fields: any): string;
@@ -99,6 +99,11 @@ export function getObjectListHeaderSecordLine(objectSchema: any, listViewName: a
99
99
  icon: string;
100
100
  className: string;
101
101
  onEvent: {
102
+ /**
103
+ * 列表视图顶部第一行amisSchema
104
+ * @param {*} objectSchema 对象UISchema
105
+ * @returns amisSchema
106
+ */
102
107
  click: {
103
108
  actions: {
104
109
  actionType: string;
@@ -128,10 +133,13 @@ export function getObjectListHeaderSecordLine(objectSchema: any, listViewName: a
128
133
  */
129
134
  export function getObjectListHeaderFieldsFilterBar(objectSchema: any, listViewName: any, ctx: any): Promise<{
130
135
  type: string;
131
- data: {
132
- listViewId: string;
133
- };
136
+ data: {};
134
137
  id: string;
138
+ /**
139
+ * 列表视图顶部amisSchema
140
+ * @param {*} objectSchema 对象UISchema
141
+ * @returns amisSchema
142
+ */
135
143
  dataProvider: {
136
144
  inited: string;
137
145
  };
@@ -312,6 +320,9 @@ export function getObjectListHeaderFieldsFilterBar(objectSchema: any, listViewNa
312
320
  "&": string;
313
321
  objectName: string;
314
322
  listName: string;
323
+ listViewId: string;
324
+ uiSchema: string;
325
+ isLookup: string;
315
326
  context: string;
316
327
  fields: string;
317
328
  };
@@ -339,18 +350,6 @@ export function getObjectListHeaderFieldsFilterBar(objectSchema: any, listViewNa
339
350
  visibleOn: string;
340
351
  };
341
352
  className: string;
342
- onEvent: {
343
- broadcast_toggle_fields_filter: {
344
- actions: {
345
- actionType: string;
346
- args: {
347
- value: {
348
- showFieldsFilter: string;
349
- };
350
- };
351
- }[];
352
- };
353
- };
354
353
  }>;
355
354
  /**
356
355
  * 列表视图顶部amisSchema
@@ -359,7 +358,7 @@ export function getObjectListHeaderFieldsFilterBar(objectSchema: any, listViewNa
359
358
  */
360
359
  export function getObjectListHeader(objectSchema: any, listViewName: any, ctx: any): Promise<{
361
360
  type: string;
362
- body: ({
361
+ body: {
363
362
  type: string;
364
363
  columns: ({
365
364
  body: {
@@ -424,71 +423,22 @@ export function getObjectListHeader(objectSchema: any, listViewName: any, ctx: a
424
423
  valign: string;
425
424
  })[];
426
425
  className: string;
427
- } | {
428
- type: string;
429
- columns: ({
430
- body: {
431
- type: string;
432
- tpl: string;
433
- visibleOn: string;
434
- inline: boolean;
435
- wrapperComponent: string;
436
- className: string;
437
- style: {
438
- fontFamily: string;
439
- fontSize: number;
440
- };
441
- id: string;
442
- }[];
443
- md: string;
444
- columnClassName: string;
445
- } | {
446
- body: ({
447
- type: string;
448
- label: string;
449
- icon: string;
450
- className: string;
451
- onEvent: {
452
- click: {
453
- actions: {
454
- actionType: string;
455
- args: {
456
- eventName: string;
457
- };
458
- }[];
459
- };
460
- };
461
- } | {
462
- type: string;
463
- label: string;
464
- icon: string;
465
- actionType: string;
466
- target: string;
467
- className: string;
468
- })[];
469
- md: string;
470
- columnClassName?: undefined;
471
- })[];
472
- className: string;
473
- })[];
426
+ }[];
474
427
  className: string;
475
428
  }[]>;
476
429
  /**
477
430
  * 记录详细界面顶部头amisSchema,也是标题面板组件的amisSchema
478
431
  * @param {*} objectSchema 对象UISchema
479
432
  * @param {*} recordId 记录id
433
+ * @param {*} optioins: {showRecordTitle: true}
480
434
  * @returns amisSchema
481
435
  */
482
- export function getObjectRecordDetailHeader(objectSchema: any, recordId: any): Promise<{
436
+ export function getObjectRecordDetailHeader(objectSchema: any, recordId: any, options: any): Promise<{
483
437
  type: string;
484
438
  bodyClassName: string;
485
439
  name: string;
486
440
  data: {
487
- context: {
488
- rootUrl: any;
489
- tenantId: any;
490
- authToken: any;
491
- };
441
+ "&": string;
492
442
  objectName: any;
493
443
  _id: any;
494
444
  recordPermissions: any;
@@ -496,11 +446,6 @@ export function getObjectRecordDetailHeader(objectSchema: any, recordId: any): P
496
446
  };
497
447
  body: {
498
448
  type: string;
499
- data: {
500
- "&": string;
501
- record: string;
502
- recordLoaded: string;
503
- };
504
449
  body: {
505
450
  type: string;
506
451
  className: string;
@@ -0,0 +1,255 @@
1
+ export function getObjectHeaderToolbar(mainObject: any, formFactor: any): (string | {
2
+ type: string;
3
+ tpl: string;
4
+ align?: undefined;
5
+ className?: undefined;
6
+ label?: undefined;
7
+ icon?: undefined;
8
+ onEvent?: undefined;
9
+ } | {
10
+ type: string;
11
+ align: string;
12
+ className: string;
13
+ tpl?: undefined;
14
+ label?: undefined;
15
+ icon?: undefined;
16
+ onEvent?: undefined;
17
+ } | {
18
+ label: string;
19
+ icon: string;
20
+ type: string;
21
+ align: string;
22
+ className: string;
23
+ onEvent: {
24
+ click: {
25
+ actions: {
26
+ actionType: string;
27
+ script: string;
28
+ }[];
29
+ };
30
+ };
31
+ tpl?: undefined;
32
+ })[];
33
+ export function getObjectFooterToolbar(): string[];
34
+ export function getObjectFilter(objectSchema: any, fields: any, options: any): Promise<{
35
+ title: string;
36
+ submitText: string;
37
+ className: string;
38
+ mode: string;
39
+ wrapWithPanel: boolean;
40
+ body: {
41
+ type: string;
42
+ data: {};
43
+ id: string;
44
+ dataProvider: {
45
+ inited: string;
46
+ };
47
+ body: {
48
+ type: string;
49
+ body: {
50
+ type: string;
51
+ body: ({
52
+ type: string;
53
+ body: {
54
+ title: string;
55
+ type: string;
56
+ name: string;
57
+ id: string;
58
+ mode: string;
59
+ wrapWithPanel: boolean;
60
+ className: string;
61
+ data: any;
62
+ body: ({
63
+ name: any;
64
+ label: any;
65
+ labelRemark: any;
66
+ required: any;
67
+ } & {
68
+ type: any;
69
+ tpl: string;
70
+ value: string | number | boolean;
71
+ multiple: boolean;
72
+ extractValue: boolean;
73
+ className: any;
74
+ labelClassName: string;
75
+ quickEdit: boolean;
76
+ visibleOn: string;
77
+ } & {
78
+ clearValueOnHidden: boolean;
79
+ fieldName: any;
80
+ })[];
81
+ onEvent: {
82
+ broadcastSearchableFieldsChange: {
83
+ actions: {
84
+ actionType: string;
85
+ script: string;
86
+ }[];
87
+ };
88
+ };
89
+ }[];
90
+ size: string;
91
+ visibleOn: string;
92
+ className: string;
93
+ } | {
94
+ type: string;
95
+ body: {
96
+ type: string;
97
+ body: ({
98
+ type: string;
99
+ label: string;
100
+ icon: string;
101
+ visibleOn: string;
102
+ onEvent: {
103
+ click: {
104
+ actions: {
105
+ actionType: string;
106
+ script: string;
107
+ }[];
108
+ };
109
+ };
110
+ id?: undefined;
111
+ level?: undefined;
112
+ } | {
113
+ type: string;
114
+ label: string;
115
+ onEvent: {
116
+ click: {
117
+ actions: {
118
+ actionType: string;
119
+ dialog: {
120
+ type: string;
121
+ size: string;
122
+ title: string;
123
+ body: {
124
+ type: string;
125
+ title: string;
126
+ body: {
127
+ label: string;
128
+ type: string;
129
+ name: string;
130
+ id: string;
131
+ source: {
132
+ method: string;
133
+ url: string;
134
+ dataType: string;
135
+ headers: {
136
+ Authorization: string;
137
+ };
138
+ data: any;
139
+ requestAdaptor: string;
140
+ adaptor: string;
141
+ };
142
+ options: any[];
143
+ required: boolean;
144
+ placeholder: string;
145
+ className: string;
146
+ checkAll: boolean;
147
+ searchable: boolean;
148
+ sortable: boolean;
149
+ joinValues: boolean;
150
+ extractValue: boolean;
151
+ multiple: boolean;
152
+ }[];
153
+ id: string;
154
+ mode: string;
155
+ persistData: boolean;
156
+ promptPageLeave: boolean;
157
+ name: string;
158
+ debug: boolean;
159
+ actions: any[];
160
+ panelClassName: string;
161
+ bodyClassName: string;
162
+ className: string;
163
+ }[];
164
+ id: string;
165
+ actions: ({
166
+ type: string;
167
+ label: string;
168
+ onEvent: {
169
+ click: {
170
+ actions: {
171
+ componentId: string;
172
+ args: {};
173
+ actionType: string;
174
+ }[];
175
+ };
176
+ };
177
+ id: string;
178
+ level?: undefined;
179
+ } | {
180
+ type: string;
181
+ label: string;
182
+ onEvent: {
183
+ click: {
184
+ actions: ({
185
+ actionType: string;
186
+ script: string;
187
+ eventName?: undefined;
188
+ args?: undefined;
189
+ data?: undefined;
190
+ componentId?: undefined;
191
+ } | {
192
+ actionType: string;
193
+ eventName: string;
194
+ args: {
195
+ eventName: string;
196
+ };
197
+ data: {
198
+ fields: string;
199
+ };
200
+ script?: undefined;
201
+ componentId?: undefined;
202
+ } | {
203
+ componentId: string;
204
+ args: {
205
+ eventName?: undefined;
206
+ };
207
+ actionType: string;
208
+ script?: undefined;
209
+ eventName?: undefined;
210
+ data?: undefined;
211
+ })[];
212
+ };
213
+ };
214
+ id: string;
215
+ level: string;
216
+ })[];
217
+ closeOnEsc: boolean;
218
+ closeOnOutside: boolean;
219
+ showCloseButton: boolean;
220
+ data: {
221
+ "&": string;
222
+ objectName: string;
223
+ listName: string;
224
+ listViewId: string;
225
+ uiSchema: string;
226
+ isLookup: string;
227
+ context: string;
228
+ fields: string;
229
+ };
230
+ };
231
+ }[];
232
+ };
233
+ };
234
+ id: string;
235
+ level: string;
236
+ icon?: undefined;
237
+ visibleOn?: undefined;
238
+ })[];
239
+ size: string;
240
+ className: string;
241
+ };
242
+ size: string;
243
+ className: string;
244
+ visibleOn?: undefined;
245
+ })[];
246
+ size: string;
247
+ className: string;
248
+ };
249
+ size: string;
250
+ className: string;
251
+ visibleOn: string;
252
+ };
253
+ className: string;
254
+ }[];
255
+ }>;
@@ -305,18 +305,14 @@ export function getCalendarSchema(appName: any, objectName: any, calendarOptions
305
305
  };
306
306
  };
307
307
  }>;
308
- export function getRecordDetailHeaderSchema(objectName: any, recordId: any): Promise<{
308
+ export function getRecordDetailHeaderSchema(objectName: any, recordId: any, options: any): Promise<{
309
309
  uiSchema: any;
310
310
  amisSchema: {
311
311
  type: string;
312
312
  bodyClassName: string;
313
313
  name: string;
314
314
  data: {
315
- context: {
316
- rootUrl: any;
317
- tenantId: any;
318
- authToken: any;
319
- };
315
+ "&": string;
320
316
  objectName: any;
321
317
  _id: any;
322
318
  recordPermissions: any;
@@ -324,11 +320,6 @@ export function getRecordDetailHeaderSchema(objectName: any, recordId: any): Pro
324
320
  };
325
321
  body: {
326
322
  type: string;
327
- data: {
328
- "&": string;
329
- record: string;
330
- recordLoaded: string;
331
- };
332
323
  body: {
333
324
  type: string;
334
325
  className: string;
@@ -395,22 +386,14 @@ export function getRecordDetailSchema(objectName: any, appId: any): Promise<{
395
386
  id: string;
396
387
  onEvent: {
397
388
  recordLoaded: {
398
- actions: ({
389
+ actions: {
399
390
  actionType: string;
400
391
  data: {
401
392
  name: string;
393
+ record: string;
394
+ recordLoaded: boolean;
402
395
  };
403
- args?: undefined;
404
- } | {
405
- actionType: string;
406
- args: {
407
- value: {
408
- record: string;
409
- recordLoaded: boolean;
410
- };
411
- };
412
- data?: undefined;
413
- })[];
396
+ }[];
414
397
  };
415
398
  };
416
399
  className?: undefined;
@@ -47,12 +47,23 @@ export function getRecordPageInitSchema(objectApiName: any): Promise<{
47
47
  recordId: string;
48
48
  onEvent: {
49
49
  recordLoaded: {
50
- actions: {
50
+ actions: ({
51
+ actionType: string;
52
+ args: {
53
+ value: {
54
+ recordLoaded: boolean;
55
+ };
56
+ };
57
+ data?: undefined;
58
+ } | {
51
59
  actionType: string;
52
60
  data: {
53
61
  name: string;
62
+ record: string;
63
+ recordLoaded: boolean;
54
64
  };
55
- }[];
65
+ args?: undefined;
66
+ })[];
56
67
  };
57
68
  };
58
69
  }[];
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@steedos-widgets/amis-lib",
3
3
  "private": false,
4
- "version": "1.0.12",
4
+ "version": "1.0.14",
5
5
  "unpkg": "./dist/index.umd.js",
6
6
  "main": "./dist/index.cjs.js",
7
7
  "module": "./dist/index.esm.js",
@@ -58,5 +58,5 @@
58
58
  "dependencies": {
59
59
  "lodash": "^4.17.21"
60
60
  },
61
- "gitHead": "74590cccd4cad3a13c0a87256980bb00f95dadad"
61
+ "gitHead": "ad673af04db47a605a672cfd5601fd96d74c6142"
62
62
  }