@jsonschema-editor/vue 0.1.0
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/LICENSE +21 -0
- package/README.md +61 -0
- package/dist/index.d.ts +389 -0
- package/dist/jsonschema-editor-vue.js +4039 -0
- package/dist/style.css +1 -0
- package/package.json +66 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 JSON Schema Editor Contributors
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
# @jsonschema-editor/vue
|
|
2
|
+
|
|
3
|
+
JSON-Schema-Form-Editor und ausfüllbares Formular für **Vue 3**.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install @jsonschema-editor/vue vue
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
Peer Dependency: `vue@^3.5.0`
|
|
12
|
+
|
|
13
|
+
Die Pakete `@jsonschema-editor/json-schema` und `@jsonschema-editor/ui-schema` werden als Abhängigkeiten mitinstalliert.
|
|
14
|
+
|
|
15
|
+
## Styles
|
|
16
|
+
|
|
17
|
+
```ts
|
|
18
|
+
import "@jsonschema-editor/vue/style.css";
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
## Schnellstart
|
|
22
|
+
|
|
23
|
+
```ts
|
|
24
|
+
import { createApp } from "vue";
|
|
25
|
+
import { install, JsonSchemaFormEditor } from "@jsonschema-editor/vue";
|
|
26
|
+
import "@jsonschema-editor/vue/style.css";
|
|
27
|
+
|
|
28
|
+
const app = createApp({ components: { JsonSchemaFormEditor } });
|
|
29
|
+
install(app);
|
|
30
|
+
app.mount("#app");
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
```vue
|
|
34
|
+
<template>
|
|
35
|
+
<JsonSchemaFormEditor
|
|
36
|
+
:schema="schemaJson"
|
|
37
|
+
:ui-schema="uiSchemaJson"
|
|
38
|
+
v-model="data"
|
|
39
|
+
/>
|
|
40
|
+
</template>
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
## Exporte
|
|
44
|
+
|
|
45
|
+
- `JsonSchemaForm` – ausfüllbares Formular
|
|
46
|
+
- `JsonSchemaFormEditor` – visueller Schema-/UI-Editor
|
|
47
|
+
- `ControlField`, `UiElementRenderer` – Bausteine für eigene Layouts
|
|
48
|
+
- Composables und Registries für Erweiterungen
|
|
49
|
+
- Re-Exporte aus `@jsonschema-editor/json-schema` (`SchemaDocument`, `documentFromJSON`, …)
|
|
50
|
+
|
|
51
|
+
## Entwicklung
|
|
52
|
+
|
|
53
|
+
```bash
|
|
54
|
+
pnpm install
|
|
55
|
+
pnpm run build
|
|
56
|
+
pnpm run typecheck
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
## Lizenz
|
|
60
|
+
|
|
61
|
+
MIT – siehe [LICENSE](../LICENSE) im Repository-Root.
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,389 @@
|
|
|
1
|
+
import { App } from 'vue';
|
|
2
|
+
import { buildDefRef } from '@jsonschema-editor/json-schema';
|
|
3
|
+
import { Component } from 'vue';
|
|
4
|
+
import { ComponentOptionsMixin } from 'vue';
|
|
5
|
+
import { ComponentProvideOptions } from 'vue';
|
|
6
|
+
import { ComputedRef } from 'vue';
|
|
7
|
+
import { Control } from '@jsonschema-editor/ui-schema';
|
|
8
|
+
import { DefineComponent } from 'vue';
|
|
9
|
+
import { documentFromJSON } from '@jsonschema-editor/json-schema';
|
|
10
|
+
import { Group } from '@jsonschema-editor/ui-schema';
|
|
11
|
+
import { HorizontalLayout } from '@jsonschema-editor/ui-schema';
|
|
12
|
+
import { InjectionKey } from 'vue';
|
|
13
|
+
import { JsonSchemaAttributeRegistry } from '@jsonschema-editor/json-schema';
|
|
14
|
+
import { Label } from '@jsonschema-editor/ui-schema';
|
|
15
|
+
import { parseDefRef } from '@jsonschema-editor/json-schema';
|
|
16
|
+
import { PublicProps } from 'vue';
|
|
17
|
+
import { Ref } from 'vue';
|
|
18
|
+
import { SchemaDocument } from '@jsonschema-editor/json-schema';
|
|
19
|
+
import { SchemaNode } from '@jsonschema-editor/json-schema';
|
|
20
|
+
import { ShallowRef } from 'vue';
|
|
21
|
+
import { UiElement } from '@jsonschema-editor/ui-schema';
|
|
22
|
+
import { UiSchema } from '@jsonschema-editor/ui-schema/bridge';
|
|
23
|
+
import { UiSchemaAttributeRegistry } from '@jsonschema-editor/ui-schema';
|
|
24
|
+
import { VerticalLayout } from '@jsonschema-editor/ui-schema';
|
|
25
|
+
import { WritableComputedRef } from 'vue';
|
|
26
|
+
|
|
27
|
+
declare type __VLS_Props = {
|
|
28
|
+
schema: SchemaDocument;
|
|
29
|
+
uiSchema: UiSchema;
|
|
30
|
+
readonly?: boolean;
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
declare type __VLS_Props_2 = {
|
|
34
|
+
schema: SchemaDocument;
|
|
35
|
+
uiSchema: UiSchema;
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
declare type __VLS_Props_3 = {
|
|
39
|
+
schema: SchemaNode;
|
|
40
|
+
scope: string;
|
|
41
|
+
label?: string;
|
|
42
|
+
readonly?: boolean;
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
declare type __VLS_Props_4 = {
|
|
46
|
+
element: UiElement;
|
|
47
|
+
schema: SchemaNode;
|
|
48
|
+
document?: SchemaDocument;
|
|
49
|
+
readonly?: boolean;
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
declare type __VLS_PublicProps = {
|
|
53
|
+
modelValue: Record<string, unknown>;
|
|
54
|
+
} & __VLS_Props;
|
|
55
|
+
|
|
56
|
+
declare type __VLS_PublicProps_2 = {
|
|
57
|
+
modelValue: Record<string, unknown>;
|
|
58
|
+
} & __VLS_Props_3;
|
|
59
|
+
|
|
60
|
+
declare type __VLS_PublicProps_3 = {
|
|
61
|
+
modelValue: Record<string, unknown>;
|
|
62
|
+
} & __VLS_Props_4;
|
|
63
|
+
|
|
64
|
+
export declare interface AttributeControlContext<TNode = unknown> {
|
|
65
|
+
node: TNode;
|
|
66
|
+
attributeName: string;
|
|
67
|
+
label: string;
|
|
68
|
+
value: unknown;
|
|
69
|
+
readonly?: boolean;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
export declare interface AttributeControlRegistration<TNode = unknown> {
|
|
73
|
+
id?: string;
|
|
74
|
+
matcher: AttributeMatcher<TNode>;
|
|
75
|
+
component: Component;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
/**
|
|
79
|
+
* Registry für Editor-Controls pro Schema-/UI-Attribut.
|
|
80
|
+
* Erweiterbar per Name, valueType oder eigener match-Funktion.
|
|
81
|
+
*/
|
|
82
|
+
export declare class AttributeControlRegistry<TNode = unknown> {
|
|
83
|
+
private registrations;
|
|
84
|
+
private defaultComponent;
|
|
85
|
+
register(registration: AttributeControlRegistration<TNode>): this;
|
|
86
|
+
registerName(name: string, component: Component, priority?: number, id?: string): this;
|
|
87
|
+
registerNames(names: readonly string[], component: Component, priority?: number, id?: string): this;
|
|
88
|
+
registerValueType(valueType: AttributeValueType, component: Component, priority?: number, id?: string): this;
|
|
89
|
+
registerMatch(match: (context: AttributeControlContext<TNode>) => boolean, component: Component, priority?: number, id?: string): this;
|
|
90
|
+
setDefault(component: Component): this;
|
|
91
|
+
unregister(id: string): boolean;
|
|
92
|
+
resolve(context: AttributeControlContext<TNode>): Component | null;
|
|
93
|
+
private matches;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
export declare interface AttributeMatcher<TNode = unknown> {
|
|
97
|
+
priority?: number;
|
|
98
|
+
/** Exakter Attributname. */
|
|
99
|
+
name?: string;
|
|
100
|
+
/** Mehrere Attributnamen. */
|
|
101
|
+
names?: readonly string[];
|
|
102
|
+
/** Erwarteter Werttyp (Heuristik). */
|
|
103
|
+
valueType?: AttributeValueType;
|
|
104
|
+
/** Freie Logik – z. B. Custom-Attribute aus JsonSchemaAttributeRegistry. */
|
|
105
|
+
match?: (context: AttributeControlContext<TNode>) => boolean;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
export declare type AttributeValueType = "string" | "number" | "boolean" | "array" | "unknown";
|
|
109
|
+
|
|
110
|
+
export { buildDefRef }
|
|
111
|
+
|
|
112
|
+
export declare const ControlField: DefineComponent<__VLS_PublicProps_2, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
|
|
113
|
+
"update:modelValue": (value: Record<string, unknown>) => any;
|
|
114
|
+
}, string, PublicProps, Readonly<__VLS_PublicProps_2> & Readonly<{
|
|
115
|
+
"onUpdate:modelValue"?: ((value: Record<string, unknown>) => any) | undefined;
|
|
116
|
+
}>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {}, any>;
|
|
117
|
+
|
|
118
|
+
declare const _default: {
|
|
119
|
+
install: typeof install;
|
|
120
|
+
};
|
|
121
|
+
export default _default;
|
|
122
|
+
|
|
123
|
+
export { documentFromJSON }
|
|
124
|
+
|
|
125
|
+
export declare const EDITOR_CONTEXT_KEY: InjectionKey<EditorContext>;
|
|
126
|
+
|
|
127
|
+
export declare const EDITOR_TABS: ({
|
|
128
|
+
id: "schema";
|
|
129
|
+
label: string;
|
|
130
|
+
description: string;
|
|
131
|
+
} | {
|
|
132
|
+
id: "ui";
|
|
133
|
+
label: string;
|
|
134
|
+
description: string;
|
|
135
|
+
})[];
|
|
136
|
+
|
|
137
|
+
export declare type EditorAttributeRenderer = Component<EditorAttributeRendererProps & {
|
|
138
|
+
modelValue?: unknown;
|
|
139
|
+
}>;
|
|
140
|
+
|
|
141
|
+
export declare interface EditorAttributeRendererProps {
|
|
142
|
+
schema: SchemaNode;
|
|
143
|
+
attributeName: string;
|
|
144
|
+
label: string;
|
|
145
|
+
readonly?: boolean;
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
export declare interface EditorContext {
|
|
149
|
+
document: Ref<SchemaDocument>;
|
|
150
|
+
schema: Ref<SchemaNode>;
|
|
151
|
+
uiSchema: Ref<UiSchema>;
|
|
152
|
+
updateDocument: (next: SchemaDocument) => void;
|
|
153
|
+
updateSchema: (next: SchemaDocument) => void;
|
|
154
|
+
updateUiSchema: (next: UiSchema, manual?: boolean) => void;
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
export declare type EditorKindRenderer = Component<EditorKindRendererProps>;
|
|
158
|
+
|
|
159
|
+
export declare interface EditorKindRendererProps {
|
|
160
|
+
schema: SchemaNode;
|
|
161
|
+
propertyName?: string;
|
|
162
|
+
readonly?: boolean;
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
export declare type EditorTab = "schema" | "ui";
|
|
166
|
+
|
|
167
|
+
export declare type FormFieldRenderer = Component<FormFieldRendererProps & {
|
|
168
|
+
modelValue?: unknown;
|
|
169
|
+
}>;
|
|
170
|
+
|
|
171
|
+
export declare interface FormFieldRendererProps {
|
|
172
|
+
schema: SchemaNode;
|
|
173
|
+
scope: string;
|
|
174
|
+
label?: string;
|
|
175
|
+
readonly?: boolean;
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
export declare const globalRendererRegistry: RendererRegistry;
|
|
179
|
+
|
|
180
|
+
/** Attribut-Control im Schema-Editor. */
|
|
181
|
+
export declare const globalSchemaAttributeControlRegistry: AttributeControlRegistry<SchemaNode>;
|
|
182
|
+
|
|
183
|
+
/** Editor-Panel pro JSON-Schema-Knoten (Struktur-Editor). */
|
|
184
|
+
export declare const globalSchemaEditorTypeRegistry: TypeControlRegistry<SchemaNode>;
|
|
185
|
+
|
|
186
|
+
/** Formularfeld pro JSON-Schema-Knoten (Ausfüll-Modus). */
|
|
187
|
+
export declare const globalSchemaFormTypeRegistry: TypeControlRegistry<SchemaNode>;
|
|
188
|
+
|
|
189
|
+
/** Attribut-Control im UI-Schema-Editor. */
|
|
190
|
+
export declare const globalUiAttributeControlRegistry: AttributeControlRegistry<UiElement>;
|
|
191
|
+
|
|
192
|
+
/** Editor-Panel pro UI-Schema-Element. */
|
|
193
|
+
export declare const globalUiEditorTypeRegistry: TypeControlRegistry<UiElement>;
|
|
194
|
+
|
|
195
|
+
/** Formular-Renderer pro UI-Schema-Element. */
|
|
196
|
+
export declare const globalUiFormTypeRegistry: TypeControlRegistry<UiElement>;
|
|
197
|
+
|
|
198
|
+
export declare function inferValueType(value: unknown): AttributeValueType;
|
|
199
|
+
|
|
200
|
+
export declare function install(app: App): void;
|
|
201
|
+
|
|
202
|
+
export declare function isControl(element: UiElement): element is Control;
|
|
203
|
+
|
|
204
|
+
export declare function isGroup(element: UiElement): element is Group;
|
|
205
|
+
|
|
206
|
+
export declare function isHorizontalLayout(element: UiElement): element is HorizontalLayout;
|
|
207
|
+
|
|
208
|
+
export declare function isLabel(element: UiElement): element is Label;
|
|
209
|
+
|
|
210
|
+
export declare function isVerticalLayout(element: UiElement): element is VerticalLayout;
|
|
211
|
+
|
|
212
|
+
export declare const JSON_SCHEMA_ATTRIBUTE_REGISTRY_KEY: InjectionKey<JsonSchemaAttributeRegistry>;
|
|
213
|
+
|
|
214
|
+
export declare const JsonSchemaForm: DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
|
|
215
|
+
"update:modelValue": (value: Record<string, unknown>) => any;
|
|
216
|
+
}, string, PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
217
|
+
"onUpdate:modelValue"?: ((value: Record<string, unknown>) => any) | undefined;
|
|
218
|
+
}>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {}, HTMLFormElement>;
|
|
219
|
+
|
|
220
|
+
export declare const JsonSchemaFormEditor: DefineComponent<__VLS_Props_2, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
|
|
221
|
+
"update:schema": (schema: SchemaDocument) => any;
|
|
222
|
+
"update:uiSchema": (uiSchema: UiSchema) => any;
|
|
223
|
+
}, string, PublicProps, Readonly<__VLS_Props_2> & Readonly<{
|
|
224
|
+
"onUpdate:schema"?: ((schema: SchemaDocument) => any) | undefined;
|
|
225
|
+
"onUpdate:uiSchema"?: ((uiSchema: UiSchema) => any) | undefined;
|
|
226
|
+
}>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {}, HTMLDivElement>;
|
|
227
|
+
|
|
228
|
+
export { parseDefRef }
|
|
229
|
+
|
|
230
|
+
export declare function registerDefaultControls(): void;
|
|
231
|
+
|
|
232
|
+
export declare const RENDERER_REGISTRY_KEY: InjectionKey<RendererRegistry>;
|
|
233
|
+
|
|
234
|
+
/**
|
|
235
|
+
* Abwärtskompatibel: delegiert an die neuen Type-/Attribute-Control-Registries.
|
|
236
|
+
* Bevorzugt direkt `TypeControlRegistry` / `AttributeControlRegistry` nutzen.
|
|
237
|
+
*/
|
|
238
|
+
export declare class RendererRegistry {
|
|
239
|
+
private readonly schemaFormTypes;
|
|
240
|
+
private readonly schemaEditorTypes;
|
|
241
|
+
private readonly schemaAttributes;
|
|
242
|
+
constructor(schemaFormTypes?: TypeControlRegistry<SchemaNode>, schemaEditorTypes?: TypeControlRegistry<SchemaNode>, schemaAttributes?: AttributeControlRegistry<SchemaNode>);
|
|
243
|
+
registerFormKind(kind: string, renderer: FormFieldRenderer): this;
|
|
244
|
+
registerFormAttribute(name: string, renderer: FormFieldRenderer): this;
|
|
245
|
+
registerEditorKind(kind: string, renderer: EditorKindRenderer): this;
|
|
246
|
+
registerEditorAttribute(name: string, renderer: EditorAttributeRenderer): this;
|
|
247
|
+
registerFormInstanceOf(ctor: abstract new (...args: never[]) => SchemaNode, renderer: FormFieldRenderer, priority?: number): this;
|
|
248
|
+
registerFormMatch(match: (schema: SchemaNode) => boolean, renderer: FormFieldRenderer, priority?: number): this;
|
|
249
|
+
setDefaultFormRenderer(renderer: FormFieldRenderer): this;
|
|
250
|
+
setDefaultEditorKindRenderer(renderer: EditorKindRenderer): this;
|
|
251
|
+
setDefaultEditorAttributeRenderer(renderer: EditorAttributeRenderer): this;
|
|
252
|
+
resolveFormRenderer(schema: SchemaNode, attributeName?: string): FormFieldRenderer | null;
|
|
253
|
+
resolveEditorKindRenderer(schema: SchemaNode): EditorKindRenderer | null;
|
|
254
|
+
resolveEditorAttributeRenderer(attributeName: string): EditorAttributeRenderer | null;
|
|
255
|
+
/** Direkter Zugriff auf die Typ-Registry (Formular). */
|
|
256
|
+
get schemaFormTypeRegistry(): TypeControlRegistry<SchemaNode>;
|
|
257
|
+
/** Direkter Zugriff auf die Typ-Registry (Editor). */
|
|
258
|
+
get schemaEditorTypeRegistry(): TypeControlRegistry<SchemaNode>;
|
|
259
|
+
/** Direkter Zugriff auf die Attribut-Registry (Schema). */
|
|
260
|
+
get schemaAttributeControlRegistry(): AttributeControlRegistry<SchemaNode>;
|
|
261
|
+
/** UI-Formular-Typen. */
|
|
262
|
+
get uiFormTypeRegistry(): TypeControlRegistry<UiElement>;
|
|
263
|
+
/** UI-Editor-Typen. */
|
|
264
|
+
get uiEditorTypeRegistry(): TypeControlRegistry<UiElement>;
|
|
265
|
+
/** UI-Attribut-Controls. */
|
|
266
|
+
get uiAttributeControlRegistry(): AttributeControlRegistry<UiElement>;
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
export declare const SCHEMA_ATTRIBUTE_CONTROL_REGISTRY_KEY: InjectionKey<AttributeControlRegistry<SchemaNode>>;
|
|
270
|
+
|
|
271
|
+
export declare const SCHEMA_EDITOR_TYPE_REGISTRY_KEY: InjectionKey<TypeControlRegistry<SchemaNode>>;
|
|
272
|
+
|
|
273
|
+
export declare const SCHEMA_FORM_TYPE_REGISTRY_KEY: InjectionKey<TypeControlRegistry<SchemaNode>>;
|
|
274
|
+
|
|
275
|
+
export { SchemaDocument }
|
|
276
|
+
|
|
277
|
+
export declare interface SchemaFormEditorEmits {
|
|
278
|
+
(event: "update:schema", schema: SchemaDocument): void;
|
|
279
|
+
(event: "update:uiSchema", uiSchema: UiSchema): void;
|
|
280
|
+
}
|
|
281
|
+
|
|
282
|
+
declare type SchemaPath = string[];
|
|
283
|
+
|
|
284
|
+
export declare interface TypeControlRegistration<T> {
|
|
285
|
+
id?: string;
|
|
286
|
+
matcher: TypeMatcher<T>;
|
|
287
|
+
component: Component;
|
|
288
|
+
}
|
|
289
|
+
|
|
290
|
+
/**
|
|
291
|
+
* Registry für Vue-Controls pro Typ.
|
|
292
|
+
* Erweiterbar per instanceof, kind/elementKind oder eigener match-Funktion.
|
|
293
|
+
*/
|
|
294
|
+
export declare class TypeControlRegistry<T> {
|
|
295
|
+
private registrations;
|
|
296
|
+
private defaultComponent;
|
|
297
|
+
register(registration: TypeControlRegistration<T>): this;
|
|
298
|
+
registerInstanceOf<C extends T>(ctor: abstract new (...args: never[]) => C, component: Component, options?: {
|
|
299
|
+
priority?: number;
|
|
300
|
+
id?: string;
|
|
301
|
+
}): this;
|
|
302
|
+
registerKind(kind: string, component: Component, priority?: number, id?: string): this;
|
|
303
|
+
registerElementKind(elementKind: string, component: Component, priority?: number, id?: string): this;
|
|
304
|
+
registerMatch(match: (value: T, context?: unknown) => boolean, component: Component, priority?: number, id?: string): this;
|
|
305
|
+
setDefault(component: Component): this;
|
|
306
|
+
unregister(id: string): boolean;
|
|
307
|
+
list(): readonly TypeControlRegistration<T>[];
|
|
308
|
+
resolve(value: T, context?: unknown): Component | null;
|
|
309
|
+
private matches;
|
|
310
|
+
}
|
|
311
|
+
|
|
312
|
+
export declare interface TypeMatcher<T> {
|
|
313
|
+
/** Höhere Priorität gewinnt bei mehreren Treffern. */
|
|
314
|
+
priority?: number;
|
|
315
|
+
/** Treffer per `value instanceof Konstruktor`. */
|
|
316
|
+
instanceOf?: abstract new (...args: never[]) => T;
|
|
317
|
+
/** Treffer per `(value as { kind }).kind`. */
|
|
318
|
+
kind?: string;
|
|
319
|
+
/** Treffer per `(value as { elementKind }).elementKind`. */
|
|
320
|
+
elementKind?: string;
|
|
321
|
+
/** Freie Logik – kann allein oder zusätzlich zu instanceOf/kind stehen. */
|
|
322
|
+
match?: (value: T, context?: unknown) => boolean;
|
|
323
|
+
}
|
|
324
|
+
|
|
325
|
+
export declare const UI_ATTRIBUTE_CONTROL_REGISTRY_KEY: InjectionKey<AttributeControlRegistry<UiElement>>;
|
|
326
|
+
|
|
327
|
+
export declare const UI_EDITOR_TYPE_REGISTRY_KEY: InjectionKey<TypeControlRegistry<UiElement>>;
|
|
328
|
+
|
|
329
|
+
export declare const UI_FORM_TYPE_REGISTRY_KEY: InjectionKey<TypeControlRegistry<UiElement>>;
|
|
330
|
+
|
|
331
|
+
export declare const UI_SCHEMA_ATTRIBUTE_REGISTRY_KEY: InjectionKey<UiSchemaAttributeRegistry>;
|
|
332
|
+
|
|
333
|
+
export declare const UiElementRenderer: DefineComponent<__VLS_PublicProps_3, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
|
|
334
|
+
"update:modelValue": (value: Record<string, unknown>) => any;
|
|
335
|
+
}, string, PublicProps, Readonly<__VLS_PublicProps_3> & Readonly<{
|
|
336
|
+
"onUpdate:modelValue"?: ((value: Record<string, unknown>) => any) | undefined;
|
|
337
|
+
}>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {}, any>;
|
|
338
|
+
|
|
339
|
+
declare type UiPath = number[];
|
|
340
|
+
|
|
341
|
+
export declare function useEditorContext(): EditorContext;
|
|
342
|
+
|
|
343
|
+
export declare function useFormFieldLabel(rootSchema: Ref<SchemaNode>, scope: string, label: Ref<string | undefined> | undefined, fieldSchema: Ref<SchemaNode | undefined>): {
|
|
344
|
+
resolvedSchema: ComputedRef<SchemaNode>;
|
|
345
|
+
displayLabel: ComputedRef<string>;
|
|
346
|
+
description: ComputedRef<string | undefined>;
|
|
347
|
+
};
|
|
348
|
+
|
|
349
|
+
export declare function useJsonSchemaAttributeRegistry(): JsonSchemaAttributeRegistry;
|
|
350
|
+
|
|
351
|
+
export declare function useRendererRegistry(): RendererRegistry;
|
|
352
|
+
|
|
353
|
+
export declare function useSchemaAttributeControlRegistry(): AttributeControlRegistry<SchemaNode>;
|
|
354
|
+
|
|
355
|
+
export declare function useSchemaEditorTypeRegistry(): TypeControlRegistry<SchemaNode>;
|
|
356
|
+
|
|
357
|
+
export declare function useSchemaFormEditorState(schema: Ref<SchemaDocument>, uiSchema: Ref<UiSchema>, emit: SchemaFormEditorEmits): {
|
|
358
|
+
editorTab: Ref<EditorTab, EditorTab>;
|
|
359
|
+
selectedSchemaPath: Ref<string[], string[] | SchemaPath>;
|
|
360
|
+
selectedUiPath: Ref<number[], number[] | UiPath>;
|
|
361
|
+
uiManualEdit: Ref<boolean, boolean>;
|
|
362
|
+
showAdvancedJson: Ref<boolean, boolean>;
|
|
363
|
+
documentRef: ShallowRef<SchemaDocument, SchemaDocument>;
|
|
364
|
+
uiSchemaRef: ShallowRef<UiSchema, UiSchema>;
|
|
365
|
+
uiRoot: ComputedRef<UiElement>;
|
|
366
|
+
updateDocument: (next: SchemaDocument) => void;
|
|
367
|
+
updateUiRoot: (next: UiElement) => void;
|
|
368
|
+
regenerateUiFromSchema: () => void;
|
|
369
|
+
schemaJson: WritableComputedRef<string, string>;
|
|
370
|
+
uiSchemaJson: WritableComputedRef<string, string>;
|
|
371
|
+
};
|
|
372
|
+
|
|
373
|
+
export declare function useSchemaFormTypeRegistry(): TypeControlRegistry<SchemaNode>;
|
|
374
|
+
|
|
375
|
+
export declare function useScopedField(rootSchema: Ref<SchemaNode>, rootData: Ref<Record<string, unknown>>, scope: string, document?: Ref<SchemaDocument | undefined>): {
|
|
376
|
+
path: ComputedRef<string[]>;
|
|
377
|
+
fieldSchema: ComputedRef<SchemaNode | undefined>;
|
|
378
|
+
value: WritableComputedRef<unknown, unknown>;
|
|
379
|
+
};
|
|
380
|
+
|
|
381
|
+
export declare function useUiAttributeControlRegistry(): AttributeControlRegistry<UiElement>;
|
|
382
|
+
|
|
383
|
+
export declare function useUiEditorTypeRegistry(): TypeControlRegistry<UiElement>;
|
|
384
|
+
|
|
385
|
+
export declare function useUiFormTypeRegistry(): TypeControlRegistry<UiElement>;
|
|
386
|
+
|
|
387
|
+
export declare function useUiSchemaAttributeRegistry(): UiSchemaAttributeRegistry;
|
|
388
|
+
|
|
389
|
+
export { }
|