@etsoo/appscript 1.4.90 → 1.4.91

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.
package/README.md CHANGED
@@ -86,6 +86,12 @@ $ yarn add @etsoo/appscript
86
86
  #### RepeatOption.ts ####
87
87
  - RepeatOption - Repeat options
88
88
 
89
+ ### custom - Custom dynamic component rendering
90
+
91
+ #### CustomFieldData.ts ####
92
+ - CustomFieldSpace - Custom field space (12 columns)
93
+ - CustomFieldData - Custom field data
94
+
89
95
  ### def - Type definition
90
96
 
91
97
  #### ListItem.ts ####
@@ -0,0 +1,32 @@
1
+ import { CustomFieldData } from './CustomFieldData';
2
+ /**
3
+ * Custom field reference
4
+ * 自定义字段引用
5
+ */
6
+ export type CustomFieldRef = {
7
+ /**
8
+ * Get value
9
+ */
10
+ getValue(): unknown;
11
+ /**
12
+ * Set value
13
+ * @param value Value
14
+ */
15
+ setValue(value: unknown): void;
16
+ };
17
+ /**
18
+ * Custom field props
19
+ * 自定义字段属性
20
+ */
21
+ export type CustomFieldProps<D extends CustomFieldData> = {
22
+ field: D;
23
+ onChange: (name: string, value: unknown) => void;
24
+ defaultValue?: unknown;
25
+ };
26
+ /**
27
+ * Custom field interface
28
+ * 自定义字段接口
29
+ */
30
+ export interface ICustomField<D extends CustomFieldData, R> {
31
+ (props: CustomFieldProps<D>): R;
32
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,48 @@
1
+ import { IdType, ListType2 } from '@etsoo/shared';
2
+ /**
3
+ * Custom field space (12 columns)
4
+ * 自定义字段空间(12列)
5
+ */
6
+ export type CustomFieldSpace = 'quater' | 'half' | 'half1' | 'full' | 'five' | 'seven';
7
+ /**
8
+ * Custom field data
9
+ * 自定义字段数据
10
+ */
11
+ export type CustomFieldData = {
12
+ /**
13
+ * Type
14
+ */
15
+ type: string;
16
+ /**
17
+ * Field name
18
+ */
19
+ name?: string;
20
+ /**
21
+ * Options
22
+ */
23
+ options?: ListType2[];
24
+ /**
25
+ * Refs
26
+ */
27
+ refs?: [string, ...IdType[]];
28
+ /**
29
+ * Space
30
+ */
31
+ space?: CustomFieldSpace;
32
+ /**
33
+ * Grid item proerties
34
+ */
35
+ gridItemProps?: Record<string, any>;
36
+ /**
37
+ * Main slot properties
38
+ */
39
+ mainSlotProps?: Record<string, any>;
40
+ /**
41
+ * Label
42
+ */
43
+ label?: string;
44
+ /**
45
+ * Helper text
46
+ */
47
+ helperText?: string;
48
+ };
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -25,6 +25,8 @@ export * from './business/EntityStatus';
25
25
  export * from './business/ProductUnit';
26
26
  export * from './business/RepeatOption';
27
27
  export * from './business/ShoppingCart';
28
+ export * from './custom/CustomField';
29
+ export * from './custom/CustomFieldData';
28
30
  export * from './def/ListItem';
29
31
  export * from './erp/dto/AuditLineDto';
30
32
  export * from './erp/dto/CurrencyDto';
package/lib/cjs/index.js CHANGED
@@ -46,6 +46,9 @@ __exportStar(require("./business/EntityStatus"), exports);
46
46
  __exportStar(require("./business/ProductUnit"), exports);
47
47
  __exportStar(require("./business/RepeatOption"), exports);
48
48
  __exportStar(require("./business/ShoppingCart"), exports);
49
+ // custom
50
+ __exportStar(require("./custom/CustomField"), exports);
51
+ __exportStar(require("./custom/CustomFieldData"), exports);
49
52
  // def
50
53
  __exportStar(require("./def/ListItem"), exports);
51
54
  // erp dto
@@ -0,0 +1,32 @@
1
+ import { CustomFieldData } from './CustomFieldData';
2
+ /**
3
+ * Custom field reference
4
+ * 自定义字段引用
5
+ */
6
+ export type CustomFieldRef = {
7
+ /**
8
+ * Get value
9
+ */
10
+ getValue(): unknown;
11
+ /**
12
+ * Set value
13
+ * @param value Value
14
+ */
15
+ setValue(value: unknown): void;
16
+ };
17
+ /**
18
+ * Custom field props
19
+ * 自定义字段属性
20
+ */
21
+ export type CustomFieldProps<D extends CustomFieldData> = {
22
+ field: D;
23
+ onChange: (name: string, value: unknown) => void;
24
+ defaultValue?: unknown;
25
+ };
26
+ /**
27
+ * Custom field interface
28
+ * 自定义字段接口
29
+ */
30
+ export interface ICustomField<D extends CustomFieldData, R> {
31
+ (props: CustomFieldProps<D>): R;
32
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,48 @@
1
+ import { IdType, ListType2 } from '@etsoo/shared';
2
+ /**
3
+ * Custom field space (12 columns)
4
+ * 自定义字段空间(12列)
5
+ */
6
+ export type CustomFieldSpace = 'quater' | 'half' | 'half1' | 'full' | 'five' | 'seven';
7
+ /**
8
+ * Custom field data
9
+ * 自定义字段数据
10
+ */
11
+ export type CustomFieldData = {
12
+ /**
13
+ * Type
14
+ */
15
+ type: string;
16
+ /**
17
+ * Field name
18
+ */
19
+ name?: string;
20
+ /**
21
+ * Options
22
+ */
23
+ options?: ListType2[];
24
+ /**
25
+ * Refs
26
+ */
27
+ refs?: [string, ...IdType[]];
28
+ /**
29
+ * Space
30
+ */
31
+ space?: CustomFieldSpace;
32
+ /**
33
+ * Grid item proerties
34
+ */
35
+ gridItemProps?: Record<string, any>;
36
+ /**
37
+ * Main slot properties
38
+ */
39
+ mainSlotProps?: Record<string, any>;
40
+ /**
41
+ * Label
42
+ */
43
+ label?: string;
44
+ /**
45
+ * Helper text
46
+ */
47
+ helperText?: string;
48
+ };
@@ -0,0 +1 @@
1
+ export {};
@@ -25,6 +25,8 @@ export * from './business/EntityStatus';
25
25
  export * from './business/ProductUnit';
26
26
  export * from './business/RepeatOption';
27
27
  export * from './business/ShoppingCart';
28
+ export * from './custom/CustomField';
29
+ export * from './custom/CustomFieldData';
28
30
  export * from './def/ListItem';
29
31
  export * from './erp/dto/AuditLineDto';
30
32
  export * from './erp/dto/CurrencyDto';
package/lib/mjs/index.js CHANGED
@@ -29,6 +29,9 @@ export * from './business/EntityStatus';
29
29
  export * from './business/ProductUnit';
30
30
  export * from './business/RepeatOption';
31
31
  export * from './business/ShoppingCart';
32
+ // custom
33
+ export * from './custom/CustomField';
34
+ export * from './custom/CustomFieldData';
32
35
  // def
33
36
  export * from './def/ListItem';
34
37
  // erp dto
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@etsoo/appscript",
3
- "version": "1.4.90",
3
+ "version": "1.4.91",
4
4
  "description": "Applications shared TypeScript framework",
5
5
  "main": "lib/cjs/index.js",
6
6
  "module": "lib/mjs/index.js",
@@ -53,7 +53,7 @@
53
53
  "homepage": "https://github.com/ETSOO/AppScript#readme",
54
54
  "dependencies": {
55
55
  "@etsoo/notificationbase": "^1.1.42",
56
- "@etsoo/restclient": "^1.1.4",
56
+ "@etsoo/restclient": "^1.1.5",
57
57
  "@etsoo/shared": "^1.2.40",
58
58
  "crypto-js": "^4.2.0"
59
59
  },
@@ -67,7 +67,7 @@
67
67
  "@types/jest": "^29.5.12",
68
68
  "jest": "^29.7.0",
69
69
  "jest-environment-jsdom": "^29.7.0",
70
- "ts-jest": "^29.1.2",
70
+ "ts-jest": "^29.1.3",
71
71
  "typescript": "^5.4.5"
72
72
  }
73
73
  }
@@ -0,0 +1,36 @@
1
+ import { CustomFieldData } from './CustomFieldData';
2
+
3
+ /**
4
+ * Custom field reference
5
+ * 自定义字段引用
6
+ */
7
+ export type CustomFieldRef = {
8
+ /**
9
+ * Get value
10
+ */
11
+ getValue(): unknown;
12
+
13
+ /**
14
+ * Set value
15
+ * @param value Value
16
+ */
17
+ setValue(value: unknown): void;
18
+ };
19
+
20
+ /**
21
+ * Custom field props
22
+ * 自定义字段属性
23
+ */
24
+ export type CustomFieldProps<D extends CustomFieldData> = {
25
+ field: D;
26
+ onChange: (name: string, value: unknown) => void;
27
+ defaultValue?: unknown;
28
+ };
29
+
30
+ /**
31
+ * Custom field interface
32
+ * 自定义字段接口
33
+ */
34
+ export interface ICustomField<D extends CustomFieldData, R> {
35
+ (props: CustomFieldProps<D>): R;
36
+ }
@@ -0,0 +1,64 @@
1
+ import { IdType, ListType2 } from '@etsoo/shared';
2
+
3
+ /**
4
+ * Custom field space (12 columns)
5
+ * 自定义字段空间(12列)
6
+ */
7
+ export type CustomFieldSpace =
8
+ | 'quater'
9
+ | 'half'
10
+ | 'half1'
11
+ | 'full'
12
+ | 'five'
13
+ | 'seven';
14
+
15
+ /**
16
+ * Custom field data
17
+ * 自定义字段数据
18
+ */
19
+ export type CustomFieldData = {
20
+ /**
21
+ * Type
22
+ */
23
+ type: string;
24
+
25
+ /**
26
+ * Field name
27
+ */
28
+ name?: string;
29
+
30
+ /**
31
+ * Options
32
+ */
33
+ options?: ListType2[];
34
+
35
+ /**
36
+ * Refs
37
+ */
38
+ refs?: [string, ...IdType[]];
39
+
40
+ /**
41
+ * Space
42
+ */
43
+ space?: CustomFieldSpace;
44
+
45
+ /**
46
+ * Grid item proerties
47
+ */
48
+ gridItemProps?: Record<string, any>;
49
+
50
+ /**
51
+ * Main slot properties
52
+ */
53
+ mainSlotProps?: Record<string, any>;
54
+
55
+ /**
56
+ * Label
57
+ */
58
+ label?: string;
59
+
60
+ /**
61
+ * Helper text
62
+ */
63
+ helperText?: string;
64
+ };
package/src/index.ts CHANGED
@@ -33,6 +33,10 @@ export * from './business/ProductUnit';
33
33
  export * from './business/RepeatOption';
34
34
  export * from './business/ShoppingCart';
35
35
 
36
+ // custom
37
+ export * from './custom/CustomField';
38
+ export * from './custom/CustomFieldData';
39
+
36
40
  // def
37
41
  export * from './def/ListItem';
38
42