@steedos-widgets/amis-lib 0.0.1

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.
Files changed (34) hide show
  1. package/README.md +23 -0
  2. package/dist/amis-lib.umd.js +314 -0
  3. package/dist/amis-lib.umd.min.js +314 -0
  4. package/dist/cjs/tsconfig.tsbuildinfo +1 -0
  5. package/dist/index.cjs.js +315 -0
  6. package/dist/index.cjs.js.map +1 -0
  7. package/dist/index.d.ts +9 -0
  8. package/dist/index.esm.js +315 -0
  9. package/dist/index.esm.js.map +1 -0
  10. package/dist/types/config/index.d.ts +8 -0
  11. package/dist/types/index.d.ts +9 -0
  12. package/dist/types/lib/amis.d.ts +9 -0
  13. package/dist/types/lib/apps.d.ts +2 -0
  14. package/dist/types/lib/buttons.d.ts +11 -0
  15. package/dist/types/lib/converter/amis/api.d.ts +54 -0
  16. package/dist/types/lib/converter/amis/fields/index.d.ts +54 -0
  17. package/dist/types/lib/converter/amis/fields/list.d.ts +43 -0
  18. package/dist/types/lib/converter/amis/fields/lookup.d.ts +185 -0
  19. package/dist/types/lib/converter/amis/fields/sections.d.ts +22 -0
  20. package/dist/types/lib/converter/amis/fields/table.d.ts +34 -0
  21. package/dist/types/lib/converter/amis/form.d.ts +22 -0
  22. package/dist/types/lib/converter/amis/graphql.d.ts +22 -0
  23. package/dist/types/lib/converter/amis/index.d.ts +320 -0
  24. package/dist/types/lib/converter/amis/tpl.d.ts +11 -0
  25. package/dist/types/lib/converter/amis/util.d.ts +1 -0
  26. package/dist/types/lib/expression.d.ts +2 -0
  27. package/dist/types/lib/notification.d.ts +2 -0
  28. package/dist/types/lib/objects.d.ts +709 -0
  29. package/dist/types/lib/page.d.ts +1 -0
  30. package/dist/types/lib/public.env.d.ts +4 -0
  31. package/dist/types/lib/record.d.ts +3 -0
  32. package/dist/types/lib/router.d.ts +52 -0
  33. package/dist/types/lib/steedos.client.d.ts +13 -0
  34. package/package.json +62 -0
@@ -0,0 +1,185 @@
1
+ export function lookupToAmisPicker(field: any, readonly: any, ctx: any): Promise<{
2
+ type: any;
3
+ labelField: any;
4
+ valueField: any;
5
+ modalMode: string;
6
+ source: {
7
+ method: string;
8
+ url: string;
9
+ data: {
10
+ orderBy: string;
11
+ orderDir: string;
12
+ pageNo: string;
13
+ pageSize: string;
14
+ query: string;
15
+ };
16
+ headers: {
17
+ Authorization: string;
18
+ };
19
+ };
20
+ size: string;
21
+ pickerSchema: {
22
+ mode: string;
23
+ name: string;
24
+ draggable: boolean;
25
+ headerToolbar: string[];
26
+ defaultParams: {
27
+ perPage: any;
28
+ };
29
+ columns: {
30
+ name: string;
31
+ type: string;
32
+ width: number;
33
+ placeholder: string;
34
+ }[];
35
+ syncLocation: boolean;
36
+ keepItemSelectionOnPageChange: boolean;
37
+ checkOnItemClick: boolean;
38
+ labelTpl: string;
39
+ autoFillHeight: boolean;
40
+ } | {
41
+ mode: string;
42
+ name: string;
43
+ draggable: boolean;
44
+ headerToolbar: string[];
45
+ defaultParams: {
46
+ perPage: any;
47
+ };
48
+ syncLocation: boolean;
49
+ keepItemSelectionOnPageChange: boolean;
50
+ checkOnItemClick: boolean;
51
+ labelTpl: string;
52
+ listItem: {
53
+ body: any[];
54
+ actions: {
55
+ icon: string;
56
+ label: string;
57
+ type: string;
58
+ actionType: string;
59
+ link: string;
60
+ }[];
61
+ };
62
+ };
63
+ joinValues: boolean;
64
+ extractValue: boolean;
65
+ }>;
66
+ export function lookupToAmisSelect(field: any, readonly: any, ctx: any): Promise<{
67
+ type: any;
68
+ joinValues: boolean;
69
+ extractValue: boolean;
70
+ labelField: any;
71
+ valueField: any;
72
+ autoComplete: {
73
+ method: string;
74
+ url: string;
75
+ data: {
76
+ orderBy: string;
77
+ orderDir: string;
78
+ pageNo: string;
79
+ pageSize: string;
80
+ query: string;
81
+ };
82
+ headers: {
83
+ Authorization: string;
84
+ };
85
+ } | {
86
+ method: string;
87
+ url: string;
88
+ data: {
89
+ query: string;
90
+ $: string;
91
+ };
92
+ };
93
+ }>;
94
+ export function lookupToAmis(field: any, readonly: any, ctx: any): Promise<{
95
+ type: any;
96
+ labelField: any;
97
+ valueField: any;
98
+ modalMode: string;
99
+ source: {
100
+ method: string;
101
+ url: string;
102
+ data: {
103
+ orderBy: string;
104
+ orderDir: string;
105
+ pageNo: string;
106
+ pageSize: string;
107
+ query: string;
108
+ };
109
+ headers: {
110
+ Authorization: string;
111
+ };
112
+ };
113
+ size: string;
114
+ pickerSchema: {
115
+ mode: string;
116
+ name: string;
117
+ draggable: boolean;
118
+ headerToolbar: string[];
119
+ defaultParams: {
120
+ perPage: any;
121
+ };
122
+ columns: {
123
+ name: string;
124
+ type: string;
125
+ width: number;
126
+ placeholder: string;
127
+ }[];
128
+ syncLocation: boolean;
129
+ keepItemSelectionOnPageChange: boolean;
130
+ checkOnItemClick: boolean;
131
+ labelTpl: string;
132
+ autoFillHeight: boolean;
133
+ } | {
134
+ mode: string;
135
+ name: string;
136
+ draggable: boolean;
137
+ headerToolbar: string[];
138
+ defaultParams: {
139
+ perPage: any;
140
+ };
141
+ syncLocation: boolean;
142
+ keepItemSelectionOnPageChange: boolean;
143
+ checkOnItemClick: boolean;
144
+ labelTpl: string;
145
+ listItem: {
146
+ body: any[];
147
+ actions: {
148
+ icon: string;
149
+ label: string;
150
+ type: string;
151
+ actionType: string;
152
+ link: string;
153
+ }[];
154
+ };
155
+ };
156
+ joinValues: boolean;
157
+ extractValue: boolean;
158
+ } | {
159
+ type: any;
160
+ joinValues: boolean;
161
+ extractValue: boolean;
162
+ labelField: any;
163
+ valueField: any;
164
+ autoComplete: {
165
+ method: string;
166
+ url: string;
167
+ data: {
168
+ orderBy: string;
169
+ orderDir: string;
170
+ pageNo: string;
171
+ pageSize: string;
172
+ query: string;
173
+ };
174
+ headers: {
175
+ Authorization: string;
176
+ };
177
+ } | {
178
+ method: string;
179
+ url: string;
180
+ data: {
181
+ query: string;
182
+ $: string;
183
+ };
184
+ };
185
+ }>;
@@ -0,0 +1,22 @@
1
+ export function getSections(permissionFields: any, mergedSchema: any, ctx: any): Promise<{
2
+ type: string;
3
+ title: any;
4
+ collapsable: boolean;
5
+ body: ({
6
+ name: any;
7
+ label: any;
8
+ labelRemark: any;
9
+ required: any;
10
+ } & {
11
+ type: any;
12
+ tpl: string;
13
+ value: string | number | boolean;
14
+ multiple: boolean;
15
+ extractValue: boolean;
16
+ joinValues: boolean;
17
+ className: any;
18
+ labelClassName: string;
19
+ quickEdit: boolean;
20
+ visibleOn: string;
21
+ })[];
22
+ }[]>;
@@ -0,0 +1,34 @@
1
+ export function getTableSchema(fields: any, options: any): {
2
+ mode: string;
3
+ name: string;
4
+ draggable: boolean;
5
+ headerToolbar: string[];
6
+ defaultParams: {
7
+ perPage: any;
8
+ };
9
+ columns: {
10
+ name: string;
11
+ type: string;
12
+ width: number;
13
+ placeholder: string;
14
+ }[];
15
+ syncLocation: boolean;
16
+ keepItemSelectionOnPageChange: boolean;
17
+ checkOnItemClick: boolean;
18
+ labelTpl: string;
19
+ autoFillHeight: boolean;
20
+ };
21
+ export function getTableApi(mainObject: any, fields: any, options: any): Promise<{
22
+ method: string;
23
+ url: string;
24
+ data: {
25
+ orderBy: string;
26
+ orderDir: string;
27
+ pageNo: string;
28
+ pageSize: string;
29
+ query: string;
30
+ };
31
+ headers: {
32
+ Authorization: string;
33
+ };
34
+ }>;
@@ -0,0 +1,22 @@
1
+ export function getFormBody(permissionFields: any, objectConfig: any, ctx: any): Promise<{
2
+ type: string;
3
+ title: any;
4
+ collapsable: boolean;
5
+ body: ({
6
+ name: any;
7
+ label: any;
8
+ labelRemark: any;
9
+ required: any;
10
+ } & {
11
+ type: any;
12
+ tpl: string;
13
+ value: string | number | boolean;
14
+ multiple: boolean;
15
+ extractValue: boolean;
16
+ joinValues: boolean;
17
+ className: any;
18
+ labelClassName: string;
19
+ quickEdit: boolean;
20
+ visibleOn: string;
21
+ })[];
22
+ }[]>;
@@ -0,0 +1,22 @@
1
+ export function getFieldsTemplate(fields: any, expand: any): Promise<string>;
2
+ export function getFindOneQuery(object: any, recordId: any, fields: any, options: any): Promise<{
3
+ query: string;
4
+ }>;
5
+ export function getSaveQuery(object: any, recordId: any, fields: any, options: any): {
6
+ objectName: string;
7
+ $: string;
8
+ recordId: string;
9
+ modalName: string;
10
+ };
11
+ export function getScriptForRemoveUrlPrefixForImgFields(fields: any): string;
12
+ export function getScriptForSimplifiedValueForFileFields(fields: any): string;
13
+ export function getSaveDataTpl(fields: any): string;
14
+ export function getSaveRequestAdaptor(fields: any): string;
15
+ export function getFindQuery(object: any, recordId: any, fields: any, options: any): Promise<{
16
+ orderBy: string;
17
+ orderDir: string;
18
+ pageNo: string;
19
+ pageSize: string;
20
+ query: string;
21
+ }>;
22
+ export function getApi(isMobile: any): string;
@@ -0,0 +1,320 @@
1
+ export function getObjectList(objectSchema: any, fields: any, options: any): Promise<{
2
+ type: string;
3
+ bodyClassName: string;
4
+ name: string;
5
+ data: {
6
+ context: {
7
+ rootUrl: any;
8
+ tenantId: any;
9
+ authToken: any;
10
+ };
11
+ };
12
+ body: ({
13
+ mode: string;
14
+ name: string;
15
+ draggable: boolean;
16
+ headerToolbar: string[];
17
+ defaultParams: {
18
+ perPage: any;
19
+ };
20
+ syncLocation: boolean;
21
+ keepItemSelectionOnPageChange: boolean;
22
+ checkOnItemClick: boolean;
23
+ labelTpl: string;
24
+ card: {
25
+ type: string;
26
+ header: {
27
+ title: string;
28
+ };
29
+ body: any[];
30
+ };
31
+ } & {
32
+ type: string;
33
+ primaryField: string;
34
+ id: string;
35
+ name: string;
36
+ keepItemSelectionOnPageChange: boolean;
37
+ api: {
38
+ method: string;
39
+ url: string;
40
+ data: {
41
+ orderBy: string;
42
+ orderDir: string;
43
+ pageNo: string;
44
+ pageSize: string;
45
+ query: string;
46
+ };
47
+ headers: {
48
+ Authorization: string;
49
+ };
50
+ };
51
+ } & {
52
+ toolbar: any[];
53
+ footerToolbar: string[];
54
+ headerToolbar: (string | {
55
+ type: string;
56
+ align: string;
57
+ name?: undefined;
58
+ placeholder?: undefined;
59
+ mini?: undefined;
60
+ } | {
61
+ type: string;
62
+ align: string;
63
+ name: string;
64
+ placeholder: string;
65
+ mini: boolean;
66
+ })[];
67
+ bulkActions: {
68
+ type: string;
69
+ level: string;
70
+ label: string;
71
+ actionType: string;
72
+ confirmText: string;
73
+ id: string;
74
+ api: {
75
+ method: string;
76
+ url: string;
77
+ requestAdaptor: string;
78
+ data: {
79
+ ids: string;
80
+ };
81
+ headers: {
82
+ Authorization: string;
83
+ };
84
+ };
85
+ }[];
86
+ bodyClassName: string;
87
+ }) | ({
88
+ mode: string;
89
+ name: string;
90
+ draggable: boolean;
91
+ headerToolbar: string[];
92
+ defaultParams: {
93
+ perPage: any;
94
+ };
95
+ columns: {
96
+ name: string;
97
+ type: string;
98
+ width: number;
99
+ placeholder: string;
100
+ }[];
101
+ syncLocation: boolean;
102
+ keepItemSelectionOnPageChange: boolean;
103
+ checkOnItemClick: boolean;
104
+ labelTpl: string;
105
+ autoFillHeight: boolean;
106
+ } & {
107
+ type: string;
108
+ primaryField: string;
109
+ id: string;
110
+ name: string;
111
+ keepItemSelectionOnPageChange: boolean;
112
+ api: {
113
+ method: string;
114
+ url: string;
115
+ data: {
116
+ orderBy: string;
117
+ orderDir: string;
118
+ pageNo: string;
119
+ pageSize: string;
120
+ query: string;
121
+ };
122
+ headers: {
123
+ Authorization: string;
124
+ };
125
+ };
126
+ } & {
127
+ toolbar: any[];
128
+ footerToolbar: string[];
129
+ headerToolbar: (string | {
130
+ type: string;
131
+ align: string;
132
+ name?: undefined;
133
+ placeholder?: undefined;
134
+ mini?: undefined;
135
+ } | {
136
+ type: string;
137
+ align: string;
138
+ name: string;
139
+ placeholder: string;
140
+ mini: boolean;
141
+ })[];
142
+ bulkActions: {
143
+ type: string;
144
+ level: string;
145
+ label: string;
146
+ actionType: string;
147
+ confirmText: string;
148
+ id: string;
149
+ api: {
150
+ method: string;
151
+ url: string;
152
+ requestAdaptor: string;
153
+ data: {
154
+ ids: string;
155
+ };
156
+ headers: {
157
+ Authorization: string;
158
+ };
159
+ };
160
+ }[];
161
+ bodyClassName: string;
162
+ });
163
+ }>;
164
+ export function getObjectForm(objectSchema: any, ctx: any): Promise<{
165
+ type: string;
166
+ bodyClassName: string;
167
+ regions: string[];
168
+ name: string;
169
+ data: {
170
+ global: {
171
+ mode: any;
172
+ user: {};
173
+ spaceId: any;
174
+ userId: any;
175
+ };
176
+ recordId: any;
177
+ objectName: any;
178
+ context: {
179
+ rootUrl: any;
180
+ tenantId: any;
181
+ authToken: any;
182
+ };
183
+ };
184
+ initApi: any;
185
+ initFetch: any;
186
+ body: {
187
+ type: string;
188
+ mode: string;
189
+ persistData: boolean;
190
+ promptPageLeave: boolean;
191
+ name: string;
192
+ debug: boolean;
193
+ title: string;
194
+ submitText: string;
195
+ api: {
196
+ method: string;
197
+ url: string;
198
+ data: {
199
+ objectName: string;
200
+ $: string;
201
+ recordId: string;
202
+ modalName: string;
203
+ };
204
+ requestAdaptor: string;
205
+ responseData: {
206
+ recordId: string;
207
+ };
208
+ adaptor: string;
209
+ headers: {
210
+ Authorization: string;
211
+ };
212
+ };
213
+ initApi: {
214
+ method: string;
215
+ url: string;
216
+ sendOn: string;
217
+ cache: number;
218
+ adaptor: string;
219
+ data: {
220
+ query: string;
221
+ };
222
+ headers: {
223
+ Authorization: string;
224
+ };
225
+ };
226
+ initFetch: boolean;
227
+ body: {
228
+ type: string;
229
+ title: any;
230
+ collapsable: boolean;
231
+ body: ({
232
+ name: any;
233
+ label: any;
234
+ labelRemark: any;
235
+ required: any;
236
+ } & {
237
+ type: any;
238
+ tpl: string;
239
+ value: string | number | boolean;
240
+ multiple: boolean;
241
+ extractValue: boolean;
242
+ joinValues: boolean;
243
+ className: any;
244
+ labelClassName: string;
245
+ quickEdit: boolean;
246
+ visibleOn: string;
247
+ })[];
248
+ }[];
249
+ panelClassName: string;
250
+ bodyClassName: string;
251
+ className: string;
252
+ }[];
253
+ }>;
254
+ export function getObjectDetail(objectSchema: any, recordId: any, ctx: any): Promise<{
255
+ type: string;
256
+ name: string;
257
+ id: string;
258
+ data: {
259
+ global: {
260
+ mode: any;
261
+ user: {};
262
+ spaceId: any;
263
+ userId: any;
264
+ };
265
+ context: {
266
+ rootUrl: any;
267
+ tenantId: any;
268
+ authToken: any;
269
+ };
270
+ };
271
+ api: {
272
+ method: string;
273
+ url: string;
274
+ cache: number;
275
+ adaptor: string;
276
+ data: {
277
+ query: string;
278
+ };
279
+ headers: {
280
+ Authorization: string;
281
+ };
282
+ };
283
+ body: {
284
+ type: string;
285
+ mode: string;
286
+ persistData: boolean;
287
+ promptPageLeave: boolean;
288
+ name: string;
289
+ debug: boolean;
290
+ title: string;
291
+ data: {
292
+ formData: string;
293
+ };
294
+ wrapWithPanel: boolean;
295
+ body: {
296
+ type: string;
297
+ title: any;
298
+ collapsable: boolean;
299
+ body: ({
300
+ name: any;
301
+ label: any;
302
+ labelRemark: any;
303
+ required: any;
304
+ } & {
305
+ type: any;
306
+ tpl: string;
307
+ value: string | number | boolean;
308
+ multiple: boolean;
309
+ extractValue: boolean;
310
+ joinValues: boolean;
311
+ className: any;
312
+ labelClassName: string;
313
+ quickEdit: boolean;
314
+ visibleOn: string;
315
+ })[];
316
+ }[];
317
+ className: string;
318
+ actions: any[];
319
+ }[];
320
+ }>;
@@ -0,0 +1,11 @@
1
+ export function getCreatedInfoTpl(formFactor: any): string;
2
+ export function getModifiedInfoTpl(formFactor: any): string;
3
+ export function getDateTpl(field: any): string;
4
+ export function getDateTimeTpl(field: any): string;
5
+ export function getRefObjectNameFieldName(field: any): string;
6
+ export function getSelectTpl(field: any): string;
7
+ export function getNameTpl(field: any, ctx: any): string;
8
+ export function getLookupTpl(field: any, ctx: any): string;
9
+ export function getSwitchTpl(field: any): string;
10
+ export function getPasswordTpl(field: any): string;
11
+ export function getFieldTpl(field: any, options: any): string;
@@ -0,0 +1 @@
1
+ export function getSvgUrl(source: any, name: any): string;
@@ -0,0 +1,2 @@
1
+ export function isExpression(func: any): boolean;
2
+ export function parseSingleExpression(func: any, formData: any, dataPath: any, global: any, userSession?: {}): any;
@@ -0,0 +1,2 @@
1
+ export function getNotifications(): Promise<any>;
2
+ export function markReadAll(): Promise<any>;