@ghentcdh/json-forms-vue 0.0.2-22
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 +44 -0
- package/demo/owner.d.ts +55 -0
- package/form-with-actions.component.vue.d.ts +18 -0
- package/form-with-table.component.vue.d.ts +25 -0
- package/form.component.vue.d.ts +36 -0
- package/form.store.d.ts +11 -0
- package/index.css +1597 -0
- package/index.d.ts +10 -0
- package/index.js +9610 -0
- package/index.mjs +9610 -0
- package/modal/form-modal.props.d.ts +15 -0
- package/modal/form-modal.service.d.ts +10 -0
- package/modal/form-modal.vue.d.ts +32 -0
- package/modal/index.d.ts +3 -0
- package/package.json +19 -0
- package/renderes/array/ArrayRenderer.vue.d.ts +186 -0
- package/renderes/array/FixedArrayRenderer.vue.d.ts +127 -0
- package/renderes/array/index.d.ts +1 -0
- package/renderes/array/map-array-actions.d.ts +9 -0
- package/renderes/controls/BooleanControlRenderer.vue.d.ts +112 -0
- package/renderes/controls/IntegerControlRenderer.vue.d.ts +113 -0
- package/renderes/controls/MarkdownControlRenderer.vue.d.ts +111 -0
- package/renderes/controls/NumberControlRenderer.vue.d.ts +113 -0
- package/renderes/controls/StringControlRenderer.vue.d.ts +112 -0
- package/renderes/controls/TextAreaControlRenderer.vue.d.ts +110 -0
- package/renderes/controls/autocomplete/AutocompleteControlRenderer.vue.d.ts +99 -0
- package/renderes/controls/index.d.ts +7 -0
- package/renderes/index.d.ts +3 -0
- package/renderes/layouts/index.d.ts +1 -0
- package/renderes/tester.d.ts +7 -0
- package/repository/crud.repository.d.ts +36 -0
- package/repository/index.d.ts +1 -0
- package/standalone/emits.d.ts +5 -0
- package/standalone/properties.d.ts +2 -0
- package/state/form.state.d.ts +12 -0
- package/table/filter/table-filter.vue.d.ts +13 -0
- package/table/index.d.ts +1 -0
- package/table/table.component.vue.d.ts +18 -0
- package/table/table.store.d.ts +24 -0
- package/utils/style.d.ts +4 -0
- package/utils/vanillaControl.d.ts +13 -0
package/README.md
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
# Vue json-forms frontend
|
|
2
|
+
|
|
3
|
+
A json-forms library for Vue.js that allows you to create forms based on a JSON schema and a UI schema.
|
|
4
|
+
|
|
5
|
+
It uses the components inside `@ghentcdh/ui` for styling
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
## Install the library
|
|
9
|
+
|
|
10
|
+
```ssh
|
|
11
|
+
pnpm add @ghentcdh/json-forms-vue
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
# Add the styling to your project
|
|
15
|
+
|
|
16
|
+
## Install the libraries
|
|
17
|
+
|
|
18
|
+
```ssh
|
|
19
|
+
pnpm add @ghentcdh/auth/vue @ghentcdh/auth/backend
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
## Add the styling
|
|
23
|
+
|
|
24
|
+
Add the styling to your project by importing the css file in your main.js or App.vue file:
|
|
25
|
+
|
|
26
|
+
```scss
|
|
27
|
+
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
## Show the form
|
|
31
|
+
|
|
32
|
+
A json form can be shown using the `FormComponent` component. The component requires a schema and a ui schema to be passed as props, and it uses the `v-model` directive to bind the form data.
|
|
33
|
+
|
|
34
|
+
```vue
|
|
35
|
+
import {FormComponent} from '@ghentcdh/json-forms-vue';
|
|
36
|
+
|
|
37
|
+
<div>
|
|
38
|
+
<FormComponent
|
|
39
|
+
:schema="schema"
|
|
40
|
+
:uischema="uischema"
|
|
41
|
+
v-model="formData" />
|
|
42
|
+
<pre>{{formData}}</pre>
|
|
43
|
+
</div>
|
|
44
|
+
```
|
package/demo/owner.d.ts
ADDED
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
export declare const OwnerWithRelationsFormDetail: {
|
|
2
|
+
type: string;
|
|
3
|
+
properties: {
|
|
4
|
+
id: {
|
|
5
|
+
type: string;
|
|
6
|
+
};
|
|
7
|
+
createdAt: {
|
|
8
|
+
type: string;
|
|
9
|
+
format: string;
|
|
10
|
+
};
|
|
11
|
+
name: {
|
|
12
|
+
type: string;
|
|
13
|
+
};
|
|
14
|
+
firstname: {
|
|
15
|
+
type: string;
|
|
16
|
+
};
|
|
17
|
+
age: {
|
|
18
|
+
type: string;
|
|
19
|
+
};
|
|
20
|
+
total: {
|
|
21
|
+
type: string;
|
|
22
|
+
};
|
|
23
|
+
boolean: {
|
|
24
|
+
type: string;
|
|
25
|
+
};
|
|
26
|
+
comment: {
|
|
27
|
+
type: string;
|
|
28
|
+
};
|
|
29
|
+
autocomplete: {
|
|
30
|
+
type: string;
|
|
31
|
+
};
|
|
32
|
+
emails: {
|
|
33
|
+
type: string;
|
|
34
|
+
items: {
|
|
35
|
+
type: string;
|
|
36
|
+
properties: {
|
|
37
|
+
id: {
|
|
38
|
+
type: string;
|
|
39
|
+
};
|
|
40
|
+
createdAt: {
|
|
41
|
+
type: string;
|
|
42
|
+
format: string;
|
|
43
|
+
};
|
|
44
|
+
email: {
|
|
45
|
+
type: string;
|
|
46
|
+
};
|
|
47
|
+
};
|
|
48
|
+
required: string[];
|
|
49
|
+
additionalProperties: boolean;
|
|
50
|
+
};
|
|
51
|
+
};
|
|
52
|
+
};
|
|
53
|
+
required: string[];
|
|
54
|
+
additionalProperties: boolean;
|
|
55
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { FormSchemaModel } from '../../core/src/index.ts';
|
|
2
|
+
type __VLS_Props = {
|
|
3
|
+
id: string;
|
|
4
|
+
createTitle: string;
|
|
5
|
+
updateTitle?: string;
|
|
6
|
+
formSchema: FormSchemaModel;
|
|
7
|
+
};
|
|
8
|
+
type __VLS_PublicProps = {
|
|
9
|
+
modelValue?: any;
|
|
10
|
+
} & __VLS_Props;
|
|
11
|
+
declare const _default: import('vue').DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
12
|
+
success: (...args: any[]) => void;
|
|
13
|
+
"update:modelValue": (value: any) => void;
|
|
14
|
+
}, string, import('vue').PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
15
|
+
onSuccess?: ((...args: any[]) => any) | undefined;
|
|
16
|
+
"onUpdate:modelValue"?: ((value: any) => any) | undefined;
|
|
17
|
+
}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLDivElement>;
|
|
18
|
+
export default _default;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { FormSchemaModel } from '../../core/src/index.ts';
|
|
2
|
+
import { TableAction } from '../../../ui/src/index.ts';
|
|
3
|
+
import { FormEventListener } from './state/form.state';
|
|
4
|
+
type Data = {
|
|
5
|
+
[key: string]: any;
|
|
6
|
+
};
|
|
7
|
+
type __VLS_Props = {
|
|
8
|
+
id: string;
|
|
9
|
+
tableTitle: string;
|
|
10
|
+
createTitle: string;
|
|
11
|
+
updateTitle?: string;
|
|
12
|
+
dataUri?: string;
|
|
13
|
+
tableActions?: TableAction[];
|
|
14
|
+
formSchema: FormSchemaModel;
|
|
15
|
+
initialData?: Data;
|
|
16
|
+
eventListener?: FormEventListener;
|
|
17
|
+
};
|
|
18
|
+
declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
19
|
+
editData: (args_0: Data) => any;
|
|
20
|
+
}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
21
|
+
onEditData?: ((args_0: Data) => any) | undefined;
|
|
22
|
+
}>, {
|
|
23
|
+
initialData: Data;
|
|
24
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
25
|
+
export default _default;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { JsonFormsRendererRegistryEntry } from '@jsonforms/core';
|
|
2
|
+
import { FormEventListener } from './state/form.state';
|
|
3
|
+
type Data = {
|
|
4
|
+
[key: string]: any;
|
|
5
|
+
};
|
|
6
|
+
export type SubmitFormEvent = {
|
|
7
|
+
data: Data;
|
|
8
|
+
valid: boolean;
|
|
9
|
+
};
|
|
10
|
+
type __VLS_Props = {
|
|
11
|
+
id: string;
|
|
12
|
+
schema: any;
|
|
13
|
+
uischema: any;
|
|
14
|
+
renderers?: JsonFormsRendererRegistryEntry[];
|
|
15
|
+
eventListener?: FormEventListener;
|
|
16
|
+
disabled?: boolean;
|
|
17
|
+
};
|
|
18
|
+
type __VLS_PublicProps = {
|
|
19
|
+
modelValue?: any;
|
|
20
|
+
} & __VLS_Props;
|
|
21
|
+
declare const _default: import('vue').DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
22
|
+
valid: (...args: any[]) => void;
|
|
23
|
+
change: (...args: any[]) => void;
|
|
24
|
+
submit: (...args: any[]) => void;
|
|
25
|
+
"update:modelValue": (value: any) => void;
|
|
26
|
+
}, string, import('vue').PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
27
|
+
onValid?: ((...args: any[]) => any) | undefined;
|
|
28
|
+
onChange?: ((...args: any[]) => any) | undefined;
|
|
29
|
+
onSubmit?: ((...args: any[]) => any) | undefined;
|
|
30
|
+
"onUpdate:modelValue"?: ((value: any) => any) | undefined;
|
|
31
|
+
}>, {
|
|
32
|
+
disabled: boolean;
|
|
33
|
+
renderers: JsonFormsRendererRegistryEntry[];
|
|
34
|
+
eventListener: FormEventListener;
|
|
35
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLFormElement>;
|
|
36
|
+
export default _default;
|
package/form.store.d.ts
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { FormSchemaModel } from '../../core/src/index.ts';
|
|
2
|
+
export declare class FormStore {
|
|
3
|
+
private readonly schema;
|
|
4
|
+
private httpRequest;
|
|
5
|
+
constructor(schema: FormSchemaModel);
|
|
6
|
+
private get uri();
|
|
7
|
+
delete<T>(data: T & {
|
|
8
|
+
id?: string;
|
|
9
|
+
}): Promise<void>;
|
|
10
|
+
save<T>(id: string | null, data: T): Promise<void>;
|
|
11
|
+
}
|