@steedos-widgets/amis-lib 1.0.26 → 1.0.29

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,15 @@
1
+ export declare const getDefaultRenderData: () => {
2
+ context: {
3
+ rootUrl: any;
4
+ userId: any;
5
+ tenantId: any;
6
+ authToken: any;
7
+ user: {};
8
+ };
9
+ global: {
10
+ userId: any;
11
+ spaceId: any;
12
+ user: {};
13
+ now: Date;
14
+ };
15
+ };
@@ -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" | "markdown" | "checkbox";
9
+ export function getAmisFieldType(sField: any): "url" | "date" | "datetime" | "number" | "select" | "image" | "password" | "text" | "picker" | "table" | "email" | "html" | "markdown" | "textarea" | "checkbox";
10
10
  export function getObjectFieldSubFields(mainField: any, fields: any): any;
11
11
  export function getGridFieldSubFields(mainField: any, fields: any): any;
12
12
  /**
@@ -16,23 +16,7 @@ export function getGridFieldSubFields(mainField: any, fields: any): any;
16
16
  */
17
17
  export function getPermissionFields(object: any, userSession: any): any[];
18
18
  export function getSelectFieldOptions(field: any): any[];
19
- export function convertSFieldToAmisField(field: any, readonly: any, ctx: any): Promise<{
20
- type: any;
21
- tpl: string;
22
- multiple: boolean;
23
- extractValue: boolean;
24
- className: any;
25
- quickEdit: boolean;
26
- visibleOn: string;
27
- }>;
28
- export function getFieldSearchable(perField: any, permissionFields: any, ctx: any): Promise<{
29
- type: any;
30
- tpl: string;
31
- multiple: boolean;
32
- extractValue: boolean;
33
- className: any;
34
- quickEdit: boolean;
35
- visibleOn: string;
36
- }>;
19
+ export function convertSFieldToAmisField(field: any, readonly: any, ctx: any): Promise<any>;
20
+ export function getFieldSearchable(perField: any, permissionFields: any, ctx: any): Promise<any>;
37
21
  export const OMIT_FIELDS: string[];
38
22
  export { getAmisStaticFieldType } from "./type";
@@ -2,13 +2,5 @@ export function getSections(permissionFields: any, mergedSchema: any, ctx: any):
2
2
  type: string;
3
3
  title: any;
4
4
  collapsable: boolean;
5
- body: {
6
- type: any;
7
- tpl: string;
8
- multiple: boolean;
9
- extractValue: boolean;
10
- className: any;
11
- quickEdit: boolean;
12
- visibleOn: string;
13
- }[];
5
+ body: any[];
14
6
  }[]>;
@@ -14,15 +14,7 @@ export function getObjectFieldsFilterButtonSchema(objectSchema: any): Promise<{
14
14
  };
15
15
  };
16
16
  }>;
17
- export function getObjectFieldsFilterFormSchema(objectSchema: any, fields: any, ctx: any): Promise<{
18
- type: any;
19
- tpl: string;
20
- multiple: boolean;
21
- extractValue: boolean;
22
- className: any;
23
- quickEdit: boolean;
24
- visibleOn: string;
25
- }[] | {
17
+ export function getObjectFieldsFilterFormSchema(objectSchema: any, fields: any, ctx: any): Promise<any[] | {
26
18
  title: string;
27
19
  type: string;
28
20
  name: string;
@@ -47,15 +39,7 @@ export function getObjectFieldsFilterBarSchema(objectSchema: any, fields: any, c
47
39
  type: string;
48
40
  body: ({
49
41
  type: string;
50
- body: ({
51
- type: any;
52
- tpl: string;
53
- multiple: boolean;
54
- extractValue: boolean;
55
- className: any;
56
- quickEdit: boolean;
57
- visibleOn: string;
58
- }[] | {
42
+ body: (any[] | {
59
43
  title: string;
60
44
  type: string;
61
45
  name: string;
@@ -2,13 +2,5 @@ export function getFormBody(permissionFields: any, objectConfig: any, ctx: any):
2
2
  type: string;
3
3
  title: any;
4
4
  collapsable: boolean;
5
- body: {
6
- type: any;
7
- tpl: string;
8
- multiple: boolean;
9
- extractValue: boolean;
10
- className: any;
11
- quickEdit: boolean;
12
- visibleOn: string;
13
- }[];
5
+ body: any[];
14
6
  }[]>;
@@ -25,7 +25,11 @@ export function getObjectListHeaderFirstLine(objectSchema: any, listViewName: an
25
25
  inline: boolean;
26
26
  wrapperComponent: string;
27
27
  className: string;
28
- label?: undefined;
28
+ label?: undefined; /**
29
+ * 记录详细界面中相关表顶部头amisSchema
30
+ * @param {*} relatedObjectSchema 相关对象UISchema
31
+ * @returns amisSchema
32
+ */
29
33
  rightIcon?: undefined;
30
34
  size?: undefined;
31
35
  hideCaret?: undefined;
@@ -145,15 +149,7 @@ export function getObjectListHeaderFieldsFilterBar(objectSchema: any, listViewNa
145
149
  type: string;
146
150
  body: ({
147
151
  type: string;
148
- body: ({
149
- type: any;
150
- tpl: string;
151
- multiple: boolean;
152
- extractValue: boolean;
153
- className: any;
154
- quickEdit: boolean;
155
- visibleOn: string;
156
- }[] | {
152
+ body: (any[] | {
157
153
  title: string;
158
154
  type: string;
159
155
  name: string;
@@ -341,7 +337,11 @@ export function getObjectListHeader(objectSchema: any, listViewName: any, ctx: a
341
337
  inline: boolean;
342
338
  wrapperComponent: string;
343
339
  className: string;
344
- label?: undefined;
340
+ label?: undefined; /**
341
+ * 记录详细界面中相关表顶部头amisSchema
342
+ * @param {*} relatedObjectSchema 相关对象UISchema
343
+ * @returns amisSchema
344
+ */
345
345
  rightIcon?: undefined;
346
346
  size?: undefined;
347
347
  hideCaret?: undefined;
@@ -408,6 +408,7 @@ export function getObjectRecordDetailHeader(objectSchema: any, recordId: any, op
408
408
  };
409
409
  body: {
410
410
  type: string;
411
+ id: string;
411
412
  data: {
412
413
  "&": string;
413
414
  objectName: any;
@@ -68,34 +68,48 @@ export function getObjectDetail(objectSchema: any, recordId: any, ctx: any): Pro
68
68
  };
69
69
  body: {
70
70
  type: string;
71
- mode: any;
72
- labelAlign: any;
73
- persistData: boolean;
74
- promptPageLeave: boolean;
75
- name: string;
76
- debug: boolean;
77
- title: string;
78
- data: {
79
- formData: string;
80
- };
81
- wrapWithPanel: boolean;
71
+ hiddenOn: string;
72
+ className: string;
82
73
  body: {
83
74
  type: string;
84
- title: any;
85
- collapsable: boolean;
75
+ mode: any;
76
+ labelAlign: any;
77
+ persistData: boolean;
78
+ promptPageLeave: boolean;
79
+ name: string;
80
+ debug: boolean;
81
+ title: string;
82
+ data: {
83
+ formData: string;
84
+ };
85
+ wrapWithPanel: boolean;
86
86
  body: {
87
- type: any;
88
- tpl: string;
89
- multiple: boolean;
90
- extractValue: boolean;
91
- className: any;
92
- quickEdit: boolean;
93
- visibleOn: string;
87
+ type: string;
88
+ title: any;
89
+ collapsable: boolean;
90
+ body: any[];
94
91
  }[];
95
- }[];
96
- className: string;
97
- actions: any[];
98
- hiddenOn: string;
92
+ className: string;
93
+ actions: any[];
94
+ onEvent: {
95
+ [x: string]: {
96
+ actions: ({
97
+ actionType: string;
98
+ componentId: string;
99
+ expression: string;
100
+ args?: undefined;
101
+ } | {
102
+ args: {
103
+ url: string;
104
+ blank: boolean;
105
+ };
106
+ actionType: string;
107
+ expression: string;
108
+ componentId?: undefined;
109
+ })[];
110
+ };
111
+ };
112
+ };
99
113
  }[];
100
114
  onEvent: {
101
115
  fetchInited: {
@@ -83,15 +83,7 @@ export function getObjectFilter(objectSchema: any, fields: any, options: any): P
83
83
  type: string;
84
84
  body: ({
85
85
  type: string;
86
- body: ({
87
- type: any;
88
- tpl: string;
89
- multiple: boolean;
90
- extractValue: boolean;
91
- className: any;
92
- quickEdit: boolean;
93
- visibleOn: string;
94
- }[] | {
86
+ body: (any[] | {
95
87
  title: string;
96
88
  type: string;
97
89
  name: string;
@@ -64,34 +64,48 @@ export function getViewSchema(objectName: any, recordId: any, ctx: any): Promise
64
64
  };
65
65
  body: {
66
66
  type: string;
67
- mode: any;
68
- labelAlign: any;
69
- persistData: boolean;
70
- promptPageLeave: boolean;
71
- name: string;
72
- debug: boolean;
73
- title: string;
74
- data: {
75
- formData: string;
76
- };
77
- wrapWithPanel: boolean;
67
+ hiddenOn: string;
68
+ className: string;
78
69
  body: {
79
70
  type: string;
80
- title: any;
81
- collapsable: boolean;
71
+ mode: any;
72
+ labelAlign: any;
73
+ persistData: boolean;
74
+ promptPageLeave: boolean;
75
+ name: string;
76
+ debug: boolean;
77
+ title: string;
78
+ data: {
79
+ formData: string;
80
+ };
81
+ wrapWithPanel: boolean;
82
82
  body: {
83
- type: any;
84
- tpl: string;
85
- multiple: boolean;
86
- extractValue: boolean;
87
- className: any;
88
- quickEdit: boolean;
89
- visibleOn: string;
83
+ type: string;
84
+ title: any;
85
+ collapsable: boolean;
86
+ body: any[];
90
87
  }[];
91
- }[];
92
- className: string;
93
- actions: any[];
94
- hiddenOn: string;
88
+ className: string;
89
+ actions: any[];
90
+ onEvent: {
91
+ [x: string]: {
92
+ actions: ({
93
+ actionType: string;
94
+ componentId: string;
95
+ expression: string;
96
+ args?: undefined;
97
+ } | {
98
+ args: {
99
+ url: string;
100
+ blank: boolean;
101
+ };
102
+ actionType: string;
103
+ expression: string;
104
+ componentId?: undefined;
105
+ })[];
106
+ };
107
+ };
108
+ };
95
109
  }[];
96
110
  onEvent: {
97
111
  fetchInited: {
@@ -319,6 +333,7 @@ export function getRecordDetailHeaderSchema(objectName: any, recordId: any, opti
319
333
  };
320
334
  body: {
321
335
  type: string;
336
+ id: string;
322
337
  data: {
323
338
  "&": string;
324
339
  objectName: any;
@@ -376,7 +391,7 @@ export function getRecordDetailHeaderSchema(objectName: any, recordId: any, opti
376
391
  className: string;
377
392
  };
378
393
  }>;
379
- export function getRecordDetailSchema(objectName: any, appId: any): Promise<{
394
+ export function getRecordDetailSchema(objectName: any, appId: any, props?: {}): Promise<{
380
395
  uiSchema: any;
381
396
  amisSchema: {
382
397
  type: string;
@@ -405,17 +420,27 @@ export function getRecordDetailSchema(objectName: any, appId: any): Promise<{
405
420
  id: string;
406
421
  onEvent: {
407
422
  recordLoaded: {
408
- actions: {
423
+ actions: ({
409
424
  actionType: string;
410
425
  data: {
411
426
  name: string;
412
427
  record: string;
413
428
  recordLoaded: boolean;
414
429
  };
415
- }[];
430
+ componentId?: undefined;
431
+ } | {
432
+ actionType: string;
433
+ componentId: string;
434
+ data: {
435
+ name: string;
436
+ record: string;
437
+ recordLoaded: boolean;
438
+ };
439
+ })[];
416
440
  };
417
441
  };
418
442
  })[];
443
+ onEvent: any;
419
444
  };
420
445
  }>;
421
446
  export function getObjectRelated({ appName, masterObjectName, objectName, relatedFieldName, recordId, formFactor }: {
@@ -464,15 +489,7 @@ export function getObjectRelated({ appName, masterObjectName, objectName, relate
464
489
  record: any;
465
490
  masterObjectUISchema: any;
466
491
  }>;
467
- export function getSearchableFieldsFilterSchema(objectSchema: any, fields: any, ctx: any): Promise<{
468
- type: any;
469
- tpl: string;
470
- multiple: boolean;
471
- extractValue: boolean;
472
- className: any;
473
- quickEdit: boolean;
474
- visibleOn: string;
475
- }[] | {
492
+ export function getSearchableFieldsFilterSchema(objectSchema: any, fields: any, ctx: any): Promise<any[] | {
476
493
  title: string;
477
494
  type: string;
478
495
  name: string;
@@ -1,8 +1,8 @@
1
1
  export function getPage({ type, pageId, appId, objectName, recordId, formFactor }: {
2
2
  type: any;
3
- pageId: any;
3
+ pageId?: string;
4
4
  appId: any;
5
5
  objectName?: string;
6
- recordId: any;
6
+ recordId?: string;
7
7
  formFactor?: string;
8
8
  }): Promise<any>;
@@ -27,27 +27,21 @@ export function getSchema(uiSchema: any): {
27
27
  success: string;
28
28
  failed: string;
29
29
  };
30
- url?: undefined;
31
- blank?: undefined;
30
+ eventName?: undefined;
32
31
  };
33
32
  actionType: string;
34
- componentId?: undefined;
35
- expression?: undefined;
33
+ data?: undefined;
36
34
  } | {
37
- componentId: string;
35
+ actionType: string;
38
36
  args: {
39
- url: string;
40
- blank: boolean;
37
+ eventName: string;
41
38
  api?: undefined;
42
39
  messages?: undefined;
43
40
  };
44
- actionType: string;
45
- expression: string;
46
- } | {
47
- componentId: string;
48
- actionType: string;
49
- expression: string;
50
- args?: undefined;
41
+ data: {
42
+ objectName: string;
43
+ __deletedRecord: boolean;
44
+ };
51
45
  })[];
52
46
  };
53
47
  };
@@ -7,14 +7,48 @@ export function getSchema(uiSchema: any, ctx: any): Promise<{
7
7
  level: string;
8
8
  onEvent: {
9
9
  click: {
10
+ weight: number;
10
11
  actions: {
11
12
  actionType: string;
12
- script: string;
13
+ dialog: {
14
+ type: string;
15
+ data: {
16
+ $master: string;
17
+ defaultData: string;
18
+ appId: string;
19
+ objectName: string;
20
+ context: string;
21
+ global: string;
22
+ listViewId: string;
23
+ uiSchema: string;
24
+ isLookup: string;
25
+ listName: string;
26
+ };
27
+ title: string;
28
+ body: {
29
+ type: string;
30
+ id: string;
31
+ messages: {};
32
+ schemaApi: {
33
+ data: {
34
+ isLookup: string;
35
+ };
36
+ url: string;
37
+ method: string;
38
+ messages: {};
39
+ requestAdaptor: string;
40
+ adaptor: string;
41
+ };
42
+ }[];
43
+ showCloseButton: boolean;
44
+ id: string;
45
+ closeOnEsc: boolean;
46
+ closeOnOutside: boolean;
47
+ size: string;
48
+ };
13
49
  }[];
14
- weight: number;
15
50
  };
16
51
  };
17
- className: string;
18
52
  }[];
19
53
  regions: string[];
20
54
  className: string;
@@ -10,14 +10,48 @@ export namespace StandardButtons {
10
10
  level: string;
11
11
  onEvent: {
12
12
  click: {
13
+ weight: number;
13
14
  actions: {
14
15
  actionType: string;
15
- script: string;
16
+ dialog: {
17
+ type: string;
18
+ data: {
19
+ $master: string;
20
+ defaultData: string;
21
+ appId: string;
22
+ objectName: string;
23
+ context: string;
24
+ global: string;
25
+ listViewId: string;
26
+ uiSchema: string;
27
+ isLookup: string;
28
+ listName: string;
29
+ };
30
+ title: string;
31
+ body: {
32
+ type: string;
33
+ id: string;
34
+ messages: {};
35
+ schemaApi: {
36
+ data: {
37
+ isLookup: string;
38
+ };
39
+ url: string;
40
+ method: string;
41
+ messages: {};
42
+ requestAdaptor: string;
43
+ adaptor: string;
44
+ };
45
+ }[];
46
+ showCloseButton: boolean;
47
+ id: string;
48
+ closeOnEsc: boolean;
49
+ closeOnOutside: boolean;
50
+ size: string;
51
+ };
16
52
  }[];
17
- weight: number;
18
53
  };
19
54
  };
20
- className: string;
21
55
  }[];
22
56
  regions: string[];
23
57
  className: string;
@@ -95,27 +129,21 @@ export namespace StandardButtons {
95
129
  success: string;
96
130
  failed: string;
97
131
  };
98
- url?: undefined;
99
- blank?: undefined;
132
+ eventName?: undefined;
100
133
  };
101
134
  actionType: string;
102
- componentId?: undefined;
103
- expression?: undefined;
135
+ data?: undefined;
104
136
  } | {
105
- componentId: string;
137
+ actionType: string;
106
138
  args: {
107
- url: string;
108
- blank: boolean;
139
+ eventName: string;
109
140
  api?: undefined;
110
141
  messages?: undefined;
111
142
  };
112
- actionType: string;
113
- expression: string;
114
- } | {
115
- componentId: string;
116
- actionType: string;
117
- expression: string;
118
- args?: undefined;
143
+ data: {
144
+ objectName: string;
145
+ __deletedRecord: boolean;
146
+ };
119
147
  })[];
120
148
  };
121
149
  };
@@ -0,0 +1,14 @@
1
+ export declare function createObject(superProps?: {
2
+ [propName: string]: any;
3
+ }, props?: {
4
+ [propName: string]: any;
5
+ }, properties?: any): object;
6
+ export declare function cloneObject(target: any, persistOwnProps?: boolean): any;
7
+ export declare function extendObject(target: any, src?: any, persistOwnProps?: boolean): any;
8
+ export declare function isObject(obj: any): boolean;
9
+ export declare function setVariable(data: {
10
+ [propName: string]: any;
11
+ }, key: string, value: any, convertKeyToPath?: boolean): void;
12
+ export declare function deleteVariable(data: {
13
+ [propName: string]: any;
14
+ }, key: string): void;
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.26",
4
+ "version": "1.0.29",
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": "c1d5bdb9aeb629b518845d35a06836eefaa4cffe"
61
+ "gitHead": "dc0d23189fc89b7a957b98bb44946a51974929b9"
62
62
  }