zova-cli-set-front 1.2.78 → 1.2.80
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/cli/templates/create/component/boilerplateBlockPage/controller.tsx_ +6 -2
- package/cli/templates/create/component/boilerplateBlockPageEntry/controller.tsx_ +6 -2
- package/cli/templates/create/component/boilerplateFormActionRow/controller.tsx_ +6 -2
- package/cli/templates/create/component/boilerplateFormField/controller.tsx_ +2 -1
- package/cli/templates/create/component/boilerplateTableActionBulk/controller.tsx_ +6 -2
- package/cli/templates/rest/component.ts +25 -2
- package/cli/templates/rest/render.ts +4 -0
- package/package.json +2 -2
|
@@ -1,6 +1,10 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { IComponentOptions } from 'zova';
|
|
2
|
+
import type {
|
|
3
|
+
IResourceBlockOptionsBase,
|
|
4
|
+
IJsxRenderContextPage,
|
|
5
|
+
} from 'zova-module-a-openapi';
|
|
2
6
|
|
|
3
|
-
import { BeanControllerBase,
|
|
7
|
+
import { BeanControllerBase, Use } from 'zova';
|
|
4
8
|
import { Controller } from 'zova-module-a-bean';
|
|
5
9
|
|
|
6
10
|
declare module 'zova-module-a-openapi' {
|
|
@@ -1,6 +1,10 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { IComponentOptions } from 'zova';
|
|
2
|
+
import type {
|
|
3
|
+
IResourceBlockOptionsBase,
|
|
4
|
+
IJsxRenderContextPageEntry,
|
|
5
|
+
} from 'zova-module-a-openapi';
|
|
2
6
|
|
|
3
|
-
import { BeanControllerBase,
|
|
7
|
+
import { BeanControllerBase, Use } from 'zova';
|
|
4
8
|
import { Controller } from 'zova-module-a-bean';
|
|
5
9
|
|
|
6
10
|
declare module 'zova-module-a-openapi' {
|
|
@@ -1,6 +1,10 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { IComponentOptions } from 'zova';
|
|
2
|
+
import type {
|
|
3
|
+
IJsxRenderContextPageEntry,
|
|
4
|
+
IResourceFormActionRowOptionsBase,
|
|
5
|
+
} from 'zova-module-a-openapi';
|
|
2
6
|
|
|
3
|
-
import { BeanControllerBase,
|
|
7
|
+
import { BeanControllerBase, Use } from 'zova';
|
|
4
8
|
import { Controller } from 'zova-module-a-bean';
|
|
5
9
|
|
|
6
10
|
declare module 'zova-module-a-openapi' {
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import type { IComponentOptions } from 'zova';
|
|
2
|
+
import type { IFormFieldComponentOptions } from 'zova-module-a-form';
|
|
2
3
|
import type { IResourceFormFieldOptionsBase } from 'zova-module-a-openapi';
|
|
3
4
|
|
|
4
5
|
import { BeanControllerBase } from 'zova';
|
|
5
6
|
import { Controller } from 'zova-module-a-bean';
|
|
6
|
-
import { ZFormField
|
|
7
|
+
import { ZFormField } from 'zova-module-a-form';
|
|
7
8
|
|
|
8
9
|
declare module 'zova-module-a-openapi' {
|
|
9
10
|
export interface IResourceFormFieldRecord {
|
|
@@ -1,6 +1,10 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { IComponentOptions } from 'zova';
|
|
2
|
+
import type {
|
|
3
|
+
IJsxRenderContextPage,
|
|
4
|
+
IResourceTableActionBulkOptionsBase,
|
|
5
|
+
} from 'zova-module-a-openapi';
|
|
2
6
|
|
|
3
|
-
import { BeanControllerBase,
|
|
7
|
+
import { BeanControllerBase, Use } from 'zova';
|
|
4
8
|
import { Controller } from 'zova-module-a-bean';
|
|
5
9
|
|
|
6
10
|
declare module 'zova-module-a-openapi' {
|
|
@@ -4,17 +4,21 @@ import type {
|
|
|
4
4
|
IResourceFormFieldRecord,
|
|
5
5
|
IResourceTableCellRecord,
|
|
6
6
|
IResourceTableActionRowRecord,
|
|
7
|
+
IResourceDetailsActionRowRecord,
|
|
7
8
|
IResourceFormActionRowRecord,
|
|
8
9
|
IResourceTableActionBulkRecord,
|
|
10
|
+
IResourceDetailsActionBulkRecord,
|
|
9
11
|
IResourceBlockRecord,
|
|
10
12
|
TypeFormSchemaScene,
|
|
11
13
|
IResourceRenderTableActionRowOptionsAction,
|
|
12
14
|
IResourceRenderFormActionRowOptionsAction,
|
|
13
15
|
IResourceRenderTableActionBulkOptionsAction,
|
|
16
|
+
IResourceRenderDetailsActionBulkOptionsAction,
|
|
14
17
|
IResourceRenderBlockOptionsBlock,
|
|
15
18
|
IResourceTableActionRowOptionsBase,
|
|
16
19
|
IResourceFormActionRowOptionsBase,
|
|
17
20
|
IResourceTableActionBulkOptionsBase,
|
|
21
|
+
IResourceDetailsActionBulkOptionsBase,
|
|
18
22
|
} from 'zova-module-a-openapi';
|
|
19
23
|
|
|
20
24
|
import { _generalSchemaRest, _toLowerCaseFirstChar } from './inner.ts';
|
|
@@ -41,9 +45,9 @@ export function schemaRenderFieldJsx<T extends z.ZodType>(
|
|
|
41
45
|
}
|
|
42
46
|
|
|
43
47
|
export function schemaRenderCell<
|
|
44
|
-
K extends keyof (IResourceTableCellRecord & IResourceTableActionRowRecord),
|
|
48
|
+
K extends keyof (IResourceTableCellRecord & IResourceTableActionRowRecord & IResourceDetailsActionRowRecord),
|
|
45
49
|
T extends z.ZodType,
|
|
46
|
-
>(render: K, options?: (IResourceTableCellRecord & IResourceTableActionRowRecord)[K]) {
|
|
50
|
+
>(render: K, options?: (IResourceTableCellRecord & IResourceTableActionRowRecord & IResourceDetailsActionRowRecord)[K]) {
|
|
47
51
|
return function (schema: T): T {
|
|
48
52
|
const options2 = options !== undefined ? { render, columnProps: options } : { render };
|
|
49
53
|
return _generalSchemaRest(schema, options2, 'table');
|
|
@@ -120,6 +124,25 @@ export function schemaRenderTableActionBulkJsx(
|
|
|
120
124
|
return { render: renderComponentJsx, options };
|
|
121
125
|
}
|
|
122
126
|
|
|
127
|
+
export function schemaRenderDetailsActionBulk<K extends keyof IResourceDetailsActionBulkRecord>(
|
|
128
|
+
render: K,
|
|
129
|
+
options?: IResourceDetailsActionBulkRecord[K],
|
|
130
|
+
): IResourceRenderDetailsActionBulkOptionsAction {
|
|
131
|
+
const pos = render.toString().indexOf(':action');
|
|
132
|
+
const name =
|
|
133
|
+
pos > -1
|
|
134
|
+
? _toLowerCaseFirstChar(render.toString().substring(pos + ':action'.length))
|
|
135
|
+
: undefined;
|
|
136
|
+
return { $$typeof: 'zova-jsx:actionBulk', name, render, options };
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
export function schemaRenderDetailsActionBulkJsx(
|
|
140
|
+
renderComponentJsx: TypeRenderComponentJsx,
|
|
141
|
+
options?: Pick<IResourceDetailsActionBulkOptionsBase, 'permission'>,
|
|
142
|
+
) {
|
|
143
|
+
return { render: renderComponentJsx, options };
|
|
144
|
+
}
|
|
145
|
+
|
|
123
146
|
export function schemaRenderBlock<K extends keyof IResourceBlockRecord>(
|
|
124
147
|
render: K,
|
|
125
148
|
options?: IResourceBlockRecord[K],
|
|
@@ -3,6 +3,8 @@ import {
|
|
|
3
3
|
schemaRenderBlockJsx,
|
|
4
4
|
schemaRenderCell,
|
|
5
5
|
schemaRenderCellJsx,
|
|
6
|
+
schemaRenderDetailsActionBulk,
|
|
7
|
+
schemaRenderDetailsActionBulkJsx,
|
|
6
8
|
schemaRenderField,
|
|
7
9
|
schemaRenderFieldJsx,
|
|
8
10
|
schemaRenderFormActionRow,
|
|
@@ -40,6 +42,8 @@ export const ZovaRender = {
|
|
|
40
42
|
formActionRowJsx: schemaRenderFormActionRowJsx,
|
|
41
43
|
tableActionBulk: schemaRenderTableActionBulk,
|
|
42
44
|
tableActionBulkJsx: schemaRenderTableActionBulkJsx,
|
|
45
|
+
detailsActionBulk: schemaRenderDetailsActionBulk,
|
|
46
|
+
detailsActionBulkJsx: schemaRenderDetailsActionBulkJsx,
|
|
43
47
|
block: schemaRenderBlock,
|
|
44
48
|
blockJsx: schemaRenderBlockJsx,
|
|
45
49
|
};
|
package/package.json
CHANGED