@steedos-widgets/amis-lib 1.0.14 → 1.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.
@@ -0,0 +1,33 @@
1
+ export function getMarkdownFieldSchema(field: any, readonly: any, ctx: any): {
2
+ type: string;
3
+ name: any;
4
+ options: {
5
+ linkify: boolean;
6
+ html: boolean;
7
+ breaks: boolean;
8
+ };
9
+ body?: undefined;
10
+ } | {
11
+ type: string;
12
+ body: ({
13
+ type: string;
14
+ name: any;
15
+ language: string;
16
+ options?: undefined;
17
+ } | {
18
+ type: string;
19
+ name: any;
20
+ options: {
21
+ linkify: boolean;
22
+ html: boolean;
23
+ breaks: boolean;
24
+ };
25
+ language?: undefined;
26
+ })[];
27
+ name?: undefined;
28
+ options?: undefined;
29
+ };
30
+ export function getHtmlFieldSchema(field: any, readonly: any, ctx: any): {
31
+ type: string;
32
+ name: any;
33
+ };
@@ -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" | "picker" | "table" | "email" | "html" | "checkbox";
9
+ export function getAmisFieldType(sField: any): "url" | "date" | "datetime" | "number" | "select" | "image" | "password" | "text" | "textarea" | "picker" | "table" | "markdown" | "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
  /**
@@ -17,42 +17,24 @@ export function getGridFieldSubFields(mainField: any, fields: any): any;
17
17
  export function getPermissionFields(object: any, userSession: any): any[];
18
18
  export function getSelectFieldOptions(field: any): any[];
19
19
  export function convertSFieldToAmisField(field: any, readonly: any, ctx: any): Promise<{
20
- name: any;
21
- label: any;
22
- labelRemark: any;
23
- required: any;
24
- } & {
25
20
  type: any;
26
21
  tpl: string;
27
22
  value: string | number | boolean;
28
23
  multiple: boolean;
29
24
  extractValue: boolean;
30
25
  className: any;
31
- labelClassName: string;
32
26
  quickEdit: boolean;
33
27
  visibleOn: string;
34
- } & {
35
- clearValueOnHidden: boolean;
36
- fieldName: any;
37
28
  }>;
38
29
  export function getFieldSearchable(perField: any, permissionFields: any, ctx: any): Promise<{
39
- name: any;
40
- label: any;
41
- labelRemark: any;
42
- required: any;
43
- } & {
44
30
  type: any;
45
31
  tpl: string;
46
32
  value: string | number | boolean;
47
33
  multiple: boolean;
48
34
  extractValue: boolean;
49
35
  className: any;
50
- labelClassName: string;
51
36
  quickEdit: boolean;
52
37
  visibleOn: string;
53
- } & {
54
- clearValueOnHidden: boolean;
55
- fieldName: any;
56
38
  }>;
57
39
  export const OMIT_FIELDS: string[];
58
40
  export { getAmisStaticFieldType } from "./type";
@@ -76,6 +76,27 @@ export function lookupToAmisSelect(field: any, readonly: any, ctx: any): Promise
76
76
  type: any;
77
77
  joinValues: boolean;
78
78
  extractValue: boolean;
79
+ source: {
80
+ method: string;
81
+ url: string;
82
+ data: {
83
+ orderBy: string;
84
+ orderDir: string;
85
+ pageNo: string;
86
+ pageSize: string;
87
+ query: string;
88
+ };
89
+ headers: {
90
+ Authorization: string;
91
+ };
92
+ } | {
93
+ method: string;
94
+ url: string;
95
+ data: {
96
+ query: string;
97
+ $: string;
98
+ };
99
+ };
79
100
  autoComplete: {
80
101
  method: string;
81
102
  url: string;
@@ -97,6 +118,7 @@ export function lookupToAmisSelect(field: any, readonly: any, ctx: any): Promise
97
118
  $: string;
98
119
  };
99
120
  };
121
+ searchable: boolean;
100
122
  }>;
101
123
  export function lookupToAmis(field: any, readonly: any, ctx: any): Promise<{}>;
102
124
  export function lookupToAmisSelectUser(field: any, readonly: any, ctx: any): Promise<{}>;
@@ -2,23 +2,14 @@ export function getSections(permissionFields: any, mergedSchema: any, ctx: any):
2
2
  type: string;
3
3
  title: any;
4
4
  collapsable: boolean;
5
- body: ({
6
- name: any;
7
- label: any;
8
- labelRemark: any;
9
- required: any;
10
- } & {
5
+ body: {
11
6
  type: any;
12
7
  tpl: string;
13
8
  value: string | number | boolean;
14
9
  multiple: boolean;
15
10
  extractValue: boolean;
16
11
  className: any;
17
- labelClassName: string;
18
12
  quickEdit: boolean;
19
13
  visibleOn: string;
20
- } & {
21
- clearValueOnHidden: boolean;
22
- fieldName: any;
23
- })[];
14
+ }[];
24
15
  }[]>;
@@ -19,6 +19,13 @@ export function getTableSchema(fields: any, options: any): Promise<{
19
19
  labelTpl: string;
20
20
  autoFillHeight: boolean;
21
21
  }>;
22
+ /**
23
+ *
24
+ * @param {*} mainObject
25
+ * @param {*} fields
26
+ * @param {*} options = {globalFilter: 相关字表过滤条件, filter: listview 过滤条件, ...}
27
+ * @returns
28
+ */
22
29
  export function getTableApi(mainObject: any, fields: any, options: any): Promise<{
23
30
  method: string;
24
31
  url: string;
@@ -23,36 +23,20 @@ export function getObjectFieldsFilterFormSchema(objectSchema: any, fields: any,
23
23
  wrapWithPanel: boolean;
24
24
  className: string;
25
25
  data: any;
26
- body: ({
27
- name: any;
28
- label: any;
29
- labelRemark: any;
30
- required: any;
31
- } & {
26
+ body: {
32
27
  type: any;
33
28
  tpl: string;
34
29
  value: string | number | boolean;
35
30
  multiple: boolean;
36
31
  extractValue: boolean;
37
32
  className: any;
38
- labelClassName: string;
39
33
  quickEdit: boolean;
40
34
  visibleOn: string;
41
- } & {
42
- clearValueOnHidden: boolean;
43
- fieldName: any;
44
- })[];
45
- onEvent: {
46
- broadcastSearchableFieldsChange: {
47
- actions: {
48
- actionType: string;
49
- script: string;
50
- }[];
51
- };
52
- };
35
+ }[];
53
36
  }>;
54
37
  export function getObjectFieldsFilterBarSchema(objectSchema: any, fields: any, ctx: any): Promise<{
55
38
  type: string;
39
+ name: string;
56
40
  data: {};
57
41
  id: string;
58
42
  dataProvider: {
@@ -73,33 +57,16 @@ export function getObjectFieldsFilterBarSchema(objectSchema: any, fields: any, c
73
57
  wrapWithPanel: boolean;
74
58
  className: string;
75
59
  data: any;
76
- body: ({
77
- name: any;
78
- label: any;
79
- labelRemark: any;
80
- required: any;
81
- } & {
60
+ body: {
82
61
  type: any;
83
62
  tpl: string;
84
63
  value: string | number | boolean;
85
64
  multiple: boolean;
86
65
  extractValue: boolean;
87
66
  className: any;
88
- labelClassName: string;
89
67
  quickEdit: boolean;
90
68
  visibleOn: string;
91
- } & {
92
- clearValueOnHidden: boolean;
93
- fieldName: any;
94
- })[];
95
- onEvent: {
96
- broadcastSearchableFieldsChange: {
97
- actions: {
98
- actionType: string;
99
- script: string;
100
- }[];
101
- };
102
- };
69
+ }[];
103
70
  }[];
104
71
  size: string;
105
72
  visibleOn: string;
@@ -198,30 +165,13 @@ export function getObjectFieldsFilterBarSchema(objectSchema: any, fields: any, c
198
165
  actions: ({
199
166
  actionType: string;
200
167
  script: string;
201
- eventName?: undefined;
202
- args?: undefined;
203
- data?: undefined;
204
- componentId?: undefined;
205
- } | {
206
- actionType: string;
207
- eventName: string;
208
- args: {
209
- eventName: string;
210
- };
211
- data: {
212
- fields: string;
213
- };
214
- script?: undefined;
215
168
  componentId?: undefined;
169
+ args?: undefined;
216
170
  } | {
217
171
  componentId: string;
218
- args: {
219
- eventName?: undefined;
220
- };
172
+ args: {};
221
173
  actionType: string;
222
174
  script?: undefined;
223
- eventName?: undefined;
224
- data?: undefined;
225
175
  })[];
226
176
  };
227
177
  };
@@ -2,23 +2,14 @@ export function getFormBody(permissionFields: any, objectConfig: any, ctx: any):
2
2
  type: string;
3
3
  title: any;
4
4
  collapsable: boolean;
5
- body: ({
6
- name: any;
7
- label: any;
8
- labelRemark: any;
9
- required: any;
10
- } & {
5
+ body: {
11
6
  type: any;
12
7
  tpl: string;
13
8
  value: string | number | boolean;
14
9
  multiple: boolean;
15
10
  extractValue: boolean;
16
11
  className: any;
17
- labelClassName: string;
18
12
  quickEdit: boolean;
19
13
  visibleOn: string;
20
- } & {
21
- clearValueOnHidden: boolean;
22
- fieldName: any;
23
- })[];
14
+ }[];
24
15
  }[]>;
@@ -133,13 +133,9 @@ export function getObjectListHeaderSecordLine(objectSchema: any, listViewName: a
133
133
  */
134
134
  export function getObjectListHeaderFieldsFilterBar(objectSchema: any, listViewName: any, ctx: any): Promise<{
135
135
  type: string;
136
+ name: string;
136
137
  data: {};
137
138
  id: string;
138
- /**
139
- * 列表视图顶部amisSchema
140
- * @param {*} objectSchema 对象UISchema
141
- * @returns amisSchema
142
- */
143
139
  dataProvider: {
144
140
  inited: string;
145
141
  };
@@ -158,33 +154,16 @@ export function getObjectListHeaderFieldsFilterBar(objectSchema: any, listViewNa
158
154
  wrapWithPanel: boolean;
159
155
  className: string;
160
156
  data: any;
161
- body: ({
162
- name: any;
163
- label: any;
164
- labelRemark: any;
165
- required: any;
166
- } & {
157
+ body: {
167
158
  type: any;
168
159
  tpl: string;
169
160
  value: string | number | boolean;
170
161
  multiple: boolean;
171
162
  extractValue: boolean;
172
163
  className: any;
173
- labelClassName: string;
174
164
  quickEdit: boolean;
175
165
  visibleOn: string;
176
- } & {
177
- clearValueOnHidden: boolean;
178
- fieldName: any;
179
- })[];
180
- onEvent: {
181
- broadcastSearchableFieldsChange: {
182
- actions: {
183
- actionType: string;
184
- script: string;
185
- }[];
186
- };
187
- };
166
+ }[];
188
167
  }[];
189
168
  size: string;
190
169
  visibleOn: string;
@@ -283,30 +262,13 @@ export function getObjectListHeaderFieldsFilterBar(objectSchema: any, listViewNa
283
262
  actions: ({
284
263
  actionType: string;
285
264
  script: string;
286
- eventName?: undefined;
287
- args?: undefined;
288
- data?: undefined;
289
- componentId?: undefined;
290
- } | {
291
- actionType: string;
292
- eventName: string;
293
- args: {
294
- eventName: string;
295
- };
296
- data: {
297
- fields: string;
298
- };
299
- script?: undefined;
300
265
  componentId?: undefined;
266
+ args?: undefined;
301
267
  } | {
302
268
  componentId: string;
303
- args: {
304
- eventName?: undefined;
305
- };
269
+ args: {};
306
270
  actionType: string;
307
271
  script?: undefined;
308
- eventName?: undefined;
309
- data?: undefined;
310
272
  })[];
311
273
  };
312
274
  };
@@ -504,7 +466,7 @@ export function getObjectRecordDetailHeader(objectSchema: any, recordId: any, op
504
466
  * @param {*} relatedObjectSchema 相关对象UISchema
505
467
  * @returns amisSchema
506
468
  */
507
- export function getObjectRecordDetailRelatedListHeader(relatedObjectSchema: any): Promise<{
469
+ export function getObjectRecordDetailRelatedListHeader(relatedObjectSchema: any, relatedLabel: any): Promise<{
508
470
  type: string;
509
471
  body: {
510
472
  type: string;
@@ -80,25 +80,16 @@ export function getObjectDetail(objectSchema: any, recordId: any, ctx: any): Pro
80
80
  type: string;
81
81
  title: any;
82
82
  collapsable: boolean;
83
- body: ({
84
- name: any;
85
- label: any;
86
- labelRemark: any;
87
- required: any;
88
- } & {
83
+ body: {
89
84
  type: any;
90
85
  tpl: string;
91
86
  value: string | number | boolean;
92
87
  multiple: boolean;
93
88
  extractValue: boolean;
94
89
  className: any;
95
- labelClassName: string;
96
90
  quickEdit: boolean;
97
91
  visibleOn: string;
98
- } & {
99
- clearValueOnHidden: boolean;
100
- fieldName: any;
101
- })[];
92
+ }[];
102
93
  }[];
103
94
  className: string;
104
95
  actions: any[];
@@ -1,8 +1,16 @@
1
1
  export function getObjectHeaderToolbar(mainObject: any, formFactor: any): (string | {
2
2
  type: string;
3
- tpl: string;
3
+ className: string;
4
+ tpl?: undefined;
4
5
  align?: undefined;
6
+ label?: undefined;
7
+ icon?: undefined;
8
+ onEvent?: undefined;
9
+ } | {
10
+ type: string;
11
+ tpl: string;
5
12
  className?: undefined;
13
+ align?: undefined;
6
14
  label?: undefined;
7
15
  icon?: undefined;
8
16
  onEvent?: undefined;
@@ -39,6 +47,7 @@ export function getObjectFilter(objectSchema: any, fields: any, options: any): P
39
47
  wrapWithPanel: boolean;
40
48
  body: {
41
49
  type: string;
50
+ name: string;
42
51
  data: {};
43
52
  id: string;
44
53
  dataProvider: {
@@ -59,33 +68,16 @@ export function getObjectFilter(objectSchema: any, fields: any, options: any): P
59
68
  wrapWithPanel: boolean;
60
69
  className: string;
61
70
  data: any;
62
- body: ({
63
- name: any;
64
- label: any;
65
- labelRemark: any;
66
- required: any;
67
- } & {
71
+ body: {
68
72
  type: any;
69
73
  tpl: string;
70
74
  value: string | number | boolean;
71
75
  multiple: boolean;
72
76
  extractValue: boolean;
73
77
  className: any;
74
- labelClassName: string;
75
78
  quickEdit: boolean;
76
79
  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
- };
80
+ }[];
89
81
  }[];
90
82
  size: string;
91
83
  visibleOn: string;
@@ -184,30 +176,13 @@ export function getObjectFilter(objectSchema: any, fields: any, options: any): P
184
176
  actions: ({
185
177
  actionType: string;
186
178
  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
179
  componentId?: undefined;
180
+ args?: undefined;
202
181
  } | {
203
182
  componentId: string;
204
- args: {
205
- eventName?: undefined;
206
- };
183
+ args: {};
207
184
  actionType: string;
208
185
  script?: undefined;
209
- eventName?: undefined;
210
- data?: undefined;
211
186
  })[];
212
187
  };
213
188
  };
@@ -1,5 +1,6 @@
1
1
  export function getListViewColumns(listView: any, formFactor: any): any;
2
2
  export function getListViewSort(listView: any): string;
3
+ export function getListViewFilter(listView: any): any;
3
4
  export function getUISchema(objectName: any, force: any): Promise<any>;
4
5
  export function getField(objectName: any, fieldName: any): Promise<any>;
5
6
  export function getFormSchema(objectName: any, ctx: any): Promise<{
@@ -74,25 +75,16 @@ export function getViewSchema(objectName: any, recordId: any, ctx: any): Promise
74
75
  type: string;
75
76
  title: any;
76
77
  collapsable: boolean;
77
- body: ({
78
- name: any;
79
- label: any;
80
- labelRemark: any;
81
- required: any;
82
- } & {
78
+ body: {
83
79
  type: any;
84
80
  tpl: string;
85
81
  value: string | number | boolean;
86
82
  multiple: boolean;
87
83
  extractValue: boolean;
88
84
  className: any;
89
- labelClassName: string;
90
85
  quickEdit: boolean;
91
86
  visibleOn: string;
92
- } & {
93
- clearValueOnHidden: boolean;
94
- fieldName: any;
95
- })[];
87
+ }[];
96
88
  }[];
97
89
  className: string;
98
90
  actions: any[];
@@ -149,6 +141,7 @@ export function getListSchema(appName: any, objectName: any, listViewName: any,
149
141
  columns: any;
150
142
  extraColumns: any;
151
143
  filters: any;
144
+ filtersFunction: any;
152
145
  sort: string;
153
146
  ctx: {};
154
147
  };
@@ -267,7 +260,16 @@ export function getCalendarSchema(appName: any, objectName: any, calendarOptions
267
260
  objectName: string;
268
261
  $: {};
269
262
  $self: string;
270
- };
263
+ }; /**
264
+ * localListViewProps规范来自crud请求api中api.data.$self参数值的。
265
+ * 比如:{"perPage":20,"page":1,"__searchable__name":"7","__searchable__between__n1__c":[null,null],"filter":[["name","contains","a"]]}
266
+ * __searchable__...:顶部放大镜搜索条件
267
+ * filter:右侧过滤器
268
+ * perPage:每页条数
269
+ * page:当前页码
270
+ * orderBy:排序字段
271
+ * orderDir:排序方向
272
+ */
271
273
  requestAdaptor: string;
272
274
  adaptor: string;
273
275
  headers: {
@@ -426,6 +428,7 @@ export function getObjectRelatedList(appName: any, objectName: any, recordId: an
426
428
  masterObjectName: any;
427
429
  object_name: any;
428
430
  foreign_key: any;
431
+ label: any;
429
432
  schema: {
430
433
  uiSchema: any;
431
434
  amisSchema: {
@@ -471,12 +474,14 @@ export function getObjectRelatedList(appName: any, objectName: any, recordId: an
471
474
  columns: any;
472
475
  extraColumns: any;
473
476
  filters: any;
477
+ filtersFunction: any;
474
478
  sort: string;
475
479
  ctx: {};
476
480
  };
477
481
  isCustomAmisSchema?: undefined;
478
482
  isCalendar?: undefined;
479
483
  };
484
+ label?: undefined;
480
485
  })[]>;
481
486
  export function getObjectRelated({ appName, masterObjectName, objectName, relatedFieldName, recordId, formFactor }: {
482
487
  appName: any;
@@ -512,6 +517,7 @@ export function getObjectRelated({ appName, masterObjectName, objectName, relate
512
517
  columns: any;
513
518
  extraColumns: any;
514
519
  filters: any;
520
+ filtersFunction: any;
515
521
  sort: string;
516
522
  ctx: {};
517
523
  };
@@ -530,32 +536,15 @@ export function getSearchableFieldsFilterSchema(objectSchema: any, fields: any,
530
536
  wrapWithPanel: boolean;
531
537
  className: string;
532
538
  data: any;
533
- body: ({
534
- name: any;
535
- label: any;
536
- labelRemark: any;
537
- required: any;
538
- } & {
539
+ body: {
539
540
  type: any;
540
541
  tpl: string;
541
542
  value: string | number | boolean;
542
543
  multiple: boolean;
543
544
  extractValue: boolean;
544
545
  className: any;
545
- labelClassName: string;
546
546
  quickEdit: boolean;
547
547
  visibleOn: string;
548
- } & {
549
- clearValueOnHidden: boolean;
550
- fieldName: any;
551
- })[];
552
- onEvent: {
553
- broadcastSearchableFieldsChange: {
554
- actions: {
555
- actionType: string;
556
- script: string;
557
- }[];
558
- };
559
- };
548
+ }[];
560
549
  }>;
561
550
  export function setUISchemaFunction(fun: any): void;
@@ -47,6 +47,7 @@ export function getAmisObjectRelatedList(appName: any, objectName: any, recordId
47
47
  columns: any;
48
48
  extraColumns: any;
49
49
  filters: any;
50
+ filtersFunction: any;
50
51
  sort: string;
51
52
  ctx: {};
52
53
  };
@@ -54,7 +55,7 @@ export function getAmisObjectRelatedList(appName: any, objectName: any, recordId
54
55
  isCalendar?: undefined;
55
56
  };
56
57
  })[]>;
57
- export function getRecordDetailRelatedListSchema(objectName: any, recordId: any, relatedObjectName: any, relatedKey: any, top: any, perPage: any, hiddenEmptyTable: any, appId: any): Promise<{
58
+ export function getRecordDetailRelatedListSchema(objectName: any, recordId: any, relatedObjectName: any, relatedKey: any, top: any, perPage: any, hiddenEmptyTable: any, appId: any, relatedLabel: any): Promise<{
58
59
  uiSchema: any;
59
60
  amisSchema: {
60
61
  type: string;
@@ -6,6 +6,7 @@ export function getImageSrc(fileId: any): string;
6
6
  export function getTenantId(): any;
7
7
  export function getAuthToken(): any;
8
8
  export function getAuthorization(): string;
9
+ export function getUserId(): any;
9
10
  export function absoluteUrl(url: any): string;
10
11
  export function getRootUrl(defaultRootUrl: any): any;
11
12
  export function setRootUrl(rootUrl: any): void;
@@ -9,6 +9,10 @@ export function getSchema(uiSchema: any): {
9
9
  actions: {
10
10
  actionType: string;
11
11
  dialog: {
12
+ data: {
13
+ "&": string;
14
+ object_name: string;
15
+ };
12
16
  type: string;
13
17
  title: string;
14
18
  body: {