zova-cli-set-front 1.2.58 → 1.2.60
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.
|
@@ -30,17 +30,20 @@ export function schemaRenderField<K extends keyof IResourceFormFieldRecord, T ex
|
|
|
30
30
|
};
|
|
31
31
|
}
|
|
32
32
|
|
|
33
|
-
export function schemaRenderFieldJsx<T extends z.ZodType>(
|
|
33
|
+
export function schemaRenderFieldJsx<T extends z.ZodType>(
|
|
34
|
+
renderComponentJsx: TypeRenderComponentJsx,
|
|
35
|
+
scene?: TypeFormSchemaScene,
|
|
36
|
+
) {
|
|
34
37
|
return function (schema: T): T {
|
|
35
38
|
const options = { render: renderComponentJsx };
|
|
36
39
|
return _generalSchemaRest(schema, options, scene ?? 'form'); //diff from table
|
|
37
40
|
};
|
|
38
41
|
}
|
|
39
42
|
|
|
40
|
-
export function schemaRenderCell<
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
) {
|
|
43
|
+
export function schemaRenderCell<
|
|
44
|
+
K extends keyof (IResourceTableCellRecord & IResourceTableActionRowRecord),
|
|
45
|
+
T extends z.ZodType,
|
|
46
|
+
>(render: K, options?: (IResourceTableCellRecord & IResourceTableActionRowRecord)[K]) {
|
|
44
47
|
return function (schema: T): T {
|
|
45
48
|
const options2 = options !== undefined ? { render, columnProps: options } : { render };
|
|
46
49
|
return _generalSchemaRest(schema, options2, 'table');
|
|
@@ -52,7 +55,10 @@ export function schemaRenderCellJsx<T extends z.ZodType>(
|
|
|
52
55
|
options?: Pick<IResourceTableActionRowOptionsBase, 'permission'>,
|
|
53
56
|
) {
|
|
54
57
|
return function (schema: T): T {
|
|
55
|
-
const options2 =
|
|
58
|
+
const options2 =
|
|
59
|
+
options !== undefined
|
|
60
|
+
? { render: renderComponentJsx, columnProps: options }
|
|
61
|
+
: { render: renderComponentJsx };
|
|
56
62
|
return _generalSchemaRest(schema, options2, 'table');
|
|
57
63
|
};
|
|
58
64
|
}
|
|
@@ -62,7 +68,10 @@ export function schemaRenderTableActionRow<K extends keyof IResourceTableActionR
|
|
|
62
68
|
options?: IResourceTableActionRowRecord[K],
|
|
63
69
|
): IResourceRenderTableActionRowOptionsAction {
|
|
64
70
|
const pos = render.toString().indexOf(':action');
|
|
65
|
-
const name =
|
|
71
|
+
const name =
|
|
72
|
+
pos > -1
|
|
73
|
+
? _toLowerCaseFirstChar(render.toString().substring(pos + ':action'.length))
|
|
74
|
+
: undefined;
|
|
66
75
|
return { $$typeof: 'zova-jsx:actionRow', name, render, options };
|
|
67
76
|
}
|
|
68
77
|
|
|
@@ -78,7 +87,10 @@ export function schemaRenderFormActionRow<K extends keyof IResourceFormActionRow
|
|
|
78
87
|
options?: IResourceFormActionRowRecord[K],
|
|
79
88
|
): IResourceRenderFormActionRowOptionsAction {
|
|
80
89
|
const pos = render.toString().indexOf(':action');
|
|
81
|
-
const name =
|
|
90
|
+
const name =
|
|
91
|
+
pos > -1
|
|
92
|
+
? _toLowerCaseFirstChar(render.toString().substring(pos + ':action'.length))
|
|
93
|
+
: undefined;
|
|
82
94
|
return { $$typeof: 'zova-jsx:actionRow', name, render, options };
|
|
83
95
|
}
|
|
84
96
|
|
|
@@ -94,7 +106,10 @@ export function schemaRenderTableActionBulk<K extends keyof IResourceTableAction
|
|
|
94
106
|
options?: IResourceTableActionBulkRecord[K],
|
|
95
107
|
): IResourceRenderTableActionBulkOptionsAction {
|
|
96
108
|
const pos = render.toString().indexOf(':action');
|
|
97
|
-
const name =
|
|
109
|
+
const name =
|
|
110
|
+
pos > -1
|
|
111
|
+
? _toLowerCaseFirstChar(render.toString().substring(pos + ':action'.length))
|
|
112
|
+
: undefined;
|
|
98
113
|
return { $$typeof: 'zova-jsx:actionBulk', name, render, options };
|
|
99
114
|
}
|
|
100
115
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "zova-cli-set-front",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.60",
|
|
4
4
|
"gitHead": "6f675a8cc46d596142c591c28a40cc4d82fcc6cc",
|
|
5
5
|
"description": "zova cli-set-front",
|
|
6
6
|
"keywords": [
|
|
@@ -58,7 +58,7 @@
|
|
|
58
58
|
"vite": "^8.0.2",
|
|
59
59
|
"yaml": "^2.8.3",
|
|
60
60
|
"zova-openapi": "^1.1.11",
|
|
61
|
-
"zova-vite": "^1.1.
|
|
61
|
+
"zova-vite": "^1.1.29"
|
|
62
62
|
},
|
|
63
63
|
"scripts": {
|
|
64
64
|
"clean": "rimraf dist dist-cli tsconfig.build.tsbuildinfo tsconfig.cli.tsbuildinfo",
|