vona-module-a-openapi 5.0.62 → 5.0.63
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/dist/index.js +10 -8
- package/dist/service/openapi.d.ts +1 -0
- package/dist/types/actions.d.ts +1 -0
- package/dist/types/rest.d.ts +38 -8
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -183,20 +183,22 @@ let ServiceOpenapi = class ServiceOpenapi extends BeanBase {
|
|
|
183
183
|
}
|
|
184
184
|
}
|
|
185
185
|
_translateJsxRenders(obj) {
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
obj
|
|
186
|
+
this._translateJsxRendersInner(obj.rest);
|
|
187
|
+
this._translateJsxRendersInner(obj.rest?.table);
|
|
188
|
+
this._translateJsxRendersInner(obj.rest?.form);
|
|
189
|
+
}
|
|
190
|
+
_translateJsxRendersInner(obj) {
|
|
191
|
+
if (!obj) return;
|
|
192
|
+
for (const key in obj) {
|
|
193
|
+
obj[key] = this._translateJsxRender(obj[key]);
|
|
194
194
|
}
|
|
195
195
|
}
|
|
196
196
|
_translateJsxRender(component) {
|
|
197
|
+
if (typeof component !== 'object' || !component.$$typeof) return component;
|
|
197
198
|
if (component[symbolJsxRenderTranslated] === true) return component;
|
|
198
199
|
const componentNew = {};
|
|
199
200
|
componentNew[symbolJsxRenderTranslated] = true;
|
|
201
|
+
componentNew.$$typeof = 'zova-jsx';
|
|
200
202
|
componentNew.type = typeof component.type === 'function' ? component.type() : component.type;
|
|
201
203
|
componentNew.key = component.key;
|
|
202
204
|
componentNew.props = {
|
|
@@ -10,6 +10,7 @@ export declare class ServiceOpenapi extends BeanBase {
|
|
|
10
10
|
private _translateSchema;
|
|
11
11
|
private _translateErrorMessages;
|
|
12
12
|
private _translateJsxRenders;
|
|
13
|
+
private _translateJsxRendersInner;
|
|
13
14
|
private _translateJsxRender;
|
|
14
15
|
collectRegistry(): OpenAPIRegistry;
|
|
15
16
|
collectController(registry: OpenAPIRegistry, moduleName: string, controller: Constructable, actionKey?: string): void;
|
package/dist/types/actions.d.ts
CHANGED
|
@@ -9,6 +9,7 @@ export interface TypeResourceActionRowRecord {
|
|
|
9
9
|
view: IResourceActionRowOptions;
|
|
10
10
|
update: IResourceActionRowOptions;
|
|
11
11
|
delete: IResourceActionRowOptions;
|
|
12
|
+
operations: IResourceActionRowOptions;
|
|
12
13
|
}
|
|
13
14
|
export type TypeResourceActionRowRecordRender = {
|
|
14
15
|
[key in keyof TypeResourceActionRowRecord as `action${Capitalize<key>}`]: TypeResourceActionRowRecord[key];
|
package/dist/types/rest.d.ts
CHANGED
|
@@ -8,16 +8,32 @@ import type { ISchemaObjectExtensionFieldCaptcha } from './captcha.ts';
|
|
|
8
8
|
import type { IComponentRecord } from './component.ts';
|
|
9
9
|
import 'openapi3-ts/oas30';
|
|
10
10
|
import 'openapi3-ts/oas31';
|
|
11
|
-
export
|
|
12
|
-
|
|
11
|
+
export type HTMLInputElementType = 'text' | 'password' | 'number' | 'file' | 'hidden' | 'tel' | 'email';
|
|
12
|
+
export interface ISchemaObjectExtensionFieldRestProps {
|
|
13
13
|
currency?: CurrencyOptions | boolean;
|
|
14
14
|
visible?: boolean;
|
|
15
15
|
order?: number;
|
|
16
|
-
label?: string;
|
|
17
|
-
class?: any;
|
|
18
16
|
classContainer?: any;
|
|
19
|
-
|
|
20
|
-
|
|
17
|
+
label?: string | false;
|
|
18
|
+
inline?: boolean;
|
|
19
|
+
bordered?: boolean;
|
|
20
|
+
floating?: boolean;
|
|
21
|
+
iconPrefix?: string;
|
|
22
|
+
iconSuffix?: string;
|
|
23
|
+
header?: TypeRenderComponentJsx | string;
|
|
24
|
+
footer?: TypeRenderComponentJsx | string;
|
|
25
|
+
class?: any;
|
|
26
|
+
placeholder?: string;
|
|
27
|
+
readonly?: boolean;
|
|
28
|
+
inputType?: HTMLInputElementType;
|
|
29
|
+
}
|
|
30
|
+
export interface ISchemaObjectExtensionFieldRest extends ISchemaObjectExtensionFieldRestProps {
|
|
31
|
+
render?: TypeRenderComponentPreset;
|
|
32
|
+
table?: ISchemaObjectExtensionFieldRestScene;
|
|
33
|
+
form?: ISchemaObjectExtensionFieldRestScene;
|
|
34
|
+
}
|
|
35
|
+
export interface ISchemaObjectExtensionFieldRestScene extends ISchemaObjectExtensionFieldRestProps {
|
|
36
|
+
render?: TypeRenderComponent;
|
|
21
37
|
}
|
|
22
38
|
export interface ISchemaObjectExtensionField {
|
|
23
39
|
rest?: ISchemaObjectExtensionFieldRest;
|
|
@@ -31,8 +47,22 @@ declare module 'openapi3-ts/oas31' {
|
|
|
31
47
|
interface SchemaObject extends ISchemaObjectExtensionField {
|
|
32
48
|
}
|
|
33
49
|
}
|
|
34
|
-
export
|
|
35
|
-
|
|
50
|
+
export interface TypeRenderComponentJsxProps {
|
|
51
|
+
'children': TypeRenderComponentJsx | TypeRenderComponentJsx[];
|
|
52
|
+
'v-if'?: string | boolean;
|
|
53
|
+
'v-for'?: string | any[];
|
|
54
|
+
'v-each'?: string;
|
|
55
|
+
'v-slot'?: string;
|
|
56
|
+
'v-slot-scope'?: string;
|
|
57
|
+
}
|
|
58
|
+
export interface TypeRenderComponentJsx {
|
|
59
|
+
type: string;
|
|
60
|
+
key?: string | null;
|
|
61
|
+
props?: TypeRenderComponentJsxProps;
|
|
62
|
+
}
|
|
63
|
+
export type TypeRenderComponentPreset = keyof TypeResourceActionRowRecordRender | 'text' | 'textarea' | 'select' | 'checkbox' | 'radio' | 'switch' | 'image' | 'file' | 'color' | 'password' | 'email' | 'url';
|
|
64
|
+
export type TypeRenderComponent = TypeRenderComponentPreset | TypeRenderComponentJsx;
|
|
65
|
+
export type TypeRenderComponentProvider = (keyof IComponentRecord) | 'input' | 'textarea' | 'select';
|
|
36
66
|
export type TypeSchemaScene = 'table' | 'form';
|
|
37
67
|
export type TypeOpenapiMetadata<T extends z.ZodType = z.ZodType> = Omit<Partial<ZodOpenAPIMetadata<z.input<T>>>, 'title' | 'description'> & {
|
|
38
68
|
title?: string | ILocaleMagic;
|