@ederzeel/nuxt-schema-form-nightly 0.1.0-29257619.56503a4 → 0.1.0-29323954.0b153f2
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/module.d.mts +2 -1
- package/dist/module.json +1 -1
- package/dist/runtime/components/Array.d.vue.ts +23 -0
- package/dist/runtime/components/Array.vue +33 -42
- package/dist/runtime/components/Array.vue.d.ts +23 -0
- package/dist/runtime/components/Component.d.vue.ts +43 -0
- package/dist/runtime/components/Component.vue +85 -98
- package/dist/runtime/components/Component.vue.d.ts +43 -0
- package/dist/runtime/components/Date.d.vue.ts +17 -0
- package/dist/runtime/components/Date.vue +20 -24
- package/dist/runtime/components/Date.vue.d.ts +17 -0
- package/dist/runtime/components/Form.d.vue.ts +31 -0
- package/dist/runtime/components/Form.vue +32 -45
- package/dist/runtime/components/Form.vue.d.ts +31 -0
- package/dist/runtime/components/InputField.d.vue.ts +18 -0
- package/dist/runtime/components/InputField.vue +10 -11
- package/dist/runtime/components/InputField.vue.d.ts +18 -0
- package/dist/runtime/components/InputNumber.d.vue.ts +20 -0
- package/dist/runtime/components/InputNumber.vue +14 -15
- package/dist/runtime/components/InputNumber.vue.d.ts +20 -0
- package/dist/runtime/components/MultiSelect.d.vue.ts +29 -0
- package/dist/runtime/components/MultiSelect.vue +21 -28
- package/dist/runtime/components/MultiSelect.vue.d.ts +29 -0
- package/dist/runtime/components/Object.d.vue.ts +17 -0
- package/dist/runtime/components/Object.vue +18 -23
- package/dist/runtime/components/Object.vue.d.ts +17 -0
- package/dist/runtime/components/Row.d.vue.ts +16 -0
- package/dist/runtime/components/Row.vue +17 -22
- package/dist/runtime/components/Row.vue.d.ts +16 -0
- package/dist/runtime/components/Select.d.vue.ts +20 -0
- package/dist/runtime/components/Select.vue +14 -17
- package/dist/runtime/components/Select.vue.d.ts +20 -0
- package/dist/runtime/components/Slider.d.vue.ts +20 -0
- package/dist/runtime/components/Slider.vue +12 -13
- package/dist/runtime/components/Slider.vue.d.ts +20 -0
- package/dist/runtime/components/Textarea.d.vue.ts +17 -0
- package/dist/runtime/components/Textarea.vue +9 -10
- package/dist/runtime/components/Textarea.vue.d.ts +17 -0
- package/dist/runtime/components/Toggle.d.vue.ts +17 -0
- package/dist/runtime/components/Toggle.vue +9 -10
- package/dist/runtime/components/Toggle.vue.d.ts +17 -0
- package/dist/runtime/components/array/ArrayObject.d.vue.ts +21 -0
- package/dist/runtime/components/array/ArrayObject.vue +134 -170
- package/dist/runtime/components/array/ArrayObject.vue.d.ts +21 -0
- package/dist/types.d.mts +3 -1
- package/package.json +33 -33
- package/dist/module.cjs +0 -5
- package/dist/module.d.ts +0 -13
- package/dist/types.d.ts +0 -1
package/dist/module.d.mts
CHANGED
package/dist/module.json
CHANGED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { TableColumn } from '@nuxt/ui';
|
|
2
|
+
import type { PropertiesType } from '../types/index.js';
|
|
3
|
+
type __VLS_Props = {
|
|
4
|
+
id: string;
|
|
5
|
+
title?: string;
|
|
6
|
+
description?: string;
|
|
7
|
+
jsonSchemaPath: string;
|
|
8
|
+
items: PropertiesType & {
|
|
9
|
+
required?: string[];
|
|
10
|
+
};
|
|
11
|
+
isRequired: boolean;
|
|
12
|
+
minItems?: number;
|
|
13
|
+
maxItems?: number;
|
|
14
|
+
edit?: boolean;
|
|
15
|
+
columns?: TableColumn<{}>[];
|
|
16
|
+
editInline?: boolean;
|
|
17
|
+
modelValue: unknown[];
|
|
18
|
+
required?: string[];
|
|
19
|
+
setHidden?: (value: boolean) => void;
|
|
20
|
+
};
|
|
21
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, any, string, import("vue").PublicProps, any, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
22
|
+
declare const _default: typeof __VLS_export;
|
|
23
|
+
export default _default;
|
|
@@ -1,56 +1,47 @@
|
|
|
1
|
-
<script
|
|
2
|
-
import { h } from
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
setHidden?: (value: boolean) => void
|
|
23
|
-
}>()
|
|
24
|
-
|
|
25
|
-
const emit = defineEmits(['update:modelValue', 'submit'])
|
|
26
|
-
|
|
1
|
+
<script setup>
|
|
2
|
+
import { h } from "vue";
|
|
3
|
+
import SObject from "./array/ArrayObject.vue";
|
|
4
|
+
import SMultiSelect from "./MultiSelect.vue";
|
|
5
|
+
const props = defineProps({
|
|
6
|
+
id: { type: String, required: true },
|
|
7
|
+
title: { type: String, required: false },
|
|
8
|
+
description: { type: String, required: false },
|
|
9
|
+
jsonSchemaPath: { type: String, required: true },
|
|
10
|
+
items: { type: Object, required: true },
|
|
11
|
+
isRequired: { type: Boolean, required: true },
|
|
12
|
+
minItems: { type: Number, required: false },
|
|
13
|
+
maxItems: { type: Number, required: false },
|
|
14
|
+
edit: { type: Boolean, required: false },
|
|
15
|
+
columns: { type: Array, required: false },
|
|
16
|
+
editInline: { type: Boolean, required: false },
|
|
17
|
+
modelValue: { type: Array, required: true },
|
|
18
|
+
required: { type: Array, required: false },
|
|
19
|
+
setHidden: { type: Function, required: false }
|
|
20
|
+
});
|
|
21
|
+
const emit = defineEmits(["update:modelValue", "submit"]);
|
|
27
22
|
const Renderer = () => {
|
|
28
|
-
if (props.items.type ===
|
|
23
|
+
if (props.items.type === "object") {
|
|
29
24
|
return h(SObject, {
|
|
30
25
|
...props,
|
|
31
26
|
required: props.items.required,
|
|
32
27
|
isRequired: props.isRequired,
|
|
33
|
-
modelValue: props.modelValue
|
|
34
|
-
|
|
35
|
-
emit(
|
|
28
|
+
modelValue: props.modelValue,
|
|
29
|
+
"onUpdate:modelValue": (v) => {
|
|
30
|
+
emit("update:modelValue", v);
|
|
36
31
|
}
|
|
37
|
-
})
|
|
38
|
-
} else if (props.items.type ===
|
|
32
|
+
});
|
|
33
|
+
} else if (props.items.type === "string" && props.items.enum) {
|
|
39
34
|
return h(SMultiSelect, {
|
|
40
35
|
...props,
|
|
41
|
-
items: props.items
|
|
42
|
-
id: string
|
|
43
|
-
enum: string[]
|
|
44
|
-
enum_titles?: string[]
|
|
45
|
-
},
|
|
36
|
+
items: props.items,
|
|
46
37
|
isRequired: props.isRequired,
|
|
47
|
-
modelValue: props.modelValue
|
|
48
|
-
|
|
49
|
-
emit(
|
|
38
|
+
modelValue: props.modelValue,
|
|
39
|
+
"onUpdate:modelValue": (v) => {
|
|
40
|
+
emit("update:modelValue", v);
|
|
50
41
|
}
|
|
51
|
-
})
|
|
42
|
+
});
|
|
52
43
|
}
|
|
53
|
-
}
|
|
44
|
+
};
|
|
54
45
|
</script>
|
|
55
46
|
|
|
56
47
|
<template>
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { TableColumn } from '@nuxt/ui';
|
|
2
|
+
import type { PropertiesType } from '../types/index.js';
|
|
3
|
+
type __VLS_Props = {
|
|
4
|
+
id: string;
|
|
5
|
+
title?: string;
|
|
6
|
+
description?: string;
|
|
7
|
+
jsonSchemaPath: string;
|
|
8
|
+
items: PropertiesType & {
|
|
9
|
+
required?: string[];
|
|
10
|
+
};
|
|
11
|
+
isRequired: boolean;
|
|
12
|
+
minItems?: number;
|
|
13
|
+
maxItems?: number;
|
|
14
|
+
edit?: boolean;
|
|
15
|
+
columns?: TableColumn<{}>[];
|
|
16
|
+
editInline?: boolean;
|
|
17
|
+
modelValue: unknown[];
|
|
18
|
+
required?: string[];
|
|
19
|
+
setHidden?: (value: boolean) => void;
|
|
20
|
+
};
|
|
21
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, any, string, import("vue").PublicProps, any, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
22
|
+
declare const _default: typeof __VLS_export;
|
|
23
|
+
export default _default;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import type { PropertiesType } from '../types/index.js';
|
|
2
|
+
import type { TableColumn } from '@nuxt/ui';
|
|
3
|
+
type Properties = {
|
|
4
|
+
properties?: {
|
|
5
|
+
[key: string]: unknown;
|
|
6
|
+
};
|
|
7
|
+
};
|
|
8
|
+
export type SComponentProps = {
|
|
9
|
+
id?: string;
|
|
10
|
+
title?: string;
|
|
11
|
+
renderer?: string;
|
|
12
|
+
type?: string | unknown[];
|
|
13
|
+
properties?: Properties;
|
|
14
|
+
enum?: string[];
|
|
15
|
+
enum_titles?: string[];
|
|
16
|
+
format?: string;
|
|
17
|
+
description?: string;
|
|
18
|
+
placeholder?: string;
|
|
19
|
+
jsonSchemaPath?: string;
|
|
20
|
+
required?: string[];
|
|
21
|
+
isRequired: boolean;
|
|
22
|
+
items?: PropertiesType;
|
|
23
|
+
edit?: boolean;
|
|
24
|
+
minItems?: number;
|
|
25
|
+
maxItems?: number;
|
|
26
|
+
minimum?: number;
|
|
27
|
+
maximum?: number;
|
|
28
|
+
editInline?: boolean;
|
|
29
|
+
columns?: TableColumn<{}>[];
|
|
30
|
+
validateFields?: (fields: string[]) => Promise<boolean>;
|
|
31
|
+
setHidden?: (value: boolean) => void;
|
|
32
|
+
};
|
|
33
|
+
type __VLS_Props = SComponentProps;
|
|
34
|
+
type __VLS_ModelProps = {
|
|
35
|
+
modelValue: unknown;
|
|
36
|
+
};
|
|
37
|
+
type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
|
|
38
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{}>, {
|
|
39
|
+
id: string;
|
|
40
|
+
jsonSchemaPath: string;
|
|
41
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
42
|
+
declare const _default: typeof __VLS_export;
|
|
43
|
+
export default _default;
|
|
@@ -1,58 +1,47 @@
|
|
|
1
|
-
<script
|
|
2
|
-
import { h, resolveComponent } from
|
|
3
|
-
import SObject from
|
|
4
|
-
import SDate from
|
|
5
|
-
import SToggle from
|
|
6
|
-
import SArray from
|
|
7
|
-
import SInputNumber from
|
|
8
|
-
import SInputField from
|
|
9
|
-
import SSelect from
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
type
|
|
14
|
-
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
type
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
required
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
editInline?: boolean
|
|
38
|
-
columns?: TableColumn<{}>[]
|
|
39
|
-
validateFields?: (fields: string[]) => Promise<boolean>
|
|
40
|
-
setHidden?: (value: boolean) => void
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
const props = withDefaults(defineProps<SComponentProps>(), { id: '', jsonSchemaPath: '' })
|
|
44
|
-
const value = defineModel<unknown>({ required: true })
|
|
45
|
-
const emit = defineEmits(['submit'])
|
|
46
|
-
|
|
1
|
+
<script setup>
|
|
2
|
+
import { h, resolveComponent } from "vue";
|
|
3
|
+
import SObject from "./Object.vue";
|
|
4
|
+
import SDate from "./Date.vue";
|
|
5
|
+
import SToggle from "./Toggle.vue";
|
|
6
|
+
import SArray from "./Array.vue";
|
|
7
|
+
import SInputNumber from "./InputNumber.vue";
|
|
8
|
+
import SInputField from "./InputField.vue";
|
|
9
|
+
import SSelect from "./Select.vue";
|
|
10
|
+
const props = defineProps({
|
|
11
|
+
id: { type: String, required: false, default: "" },
|
|
12
|
+
title: { type: String, required: false },
|
|
13
|
+
renderer: { type: String, required: false },
|
|
14
|
+
type: { type: [String, Array], required: false },
|
|
15
|
+
properties: { type: Object, required: false },
|
|
16
|
+
enum: { type: Array, required: false },
|
|
17
|
+
enum_titles: { type: Array, required: false },
|
|
18
|
+
format: { type: String, required: false },
|
|
19
|
+
description: { type: String, required: false },
|
|
20
|
+
placeholder: { type: String, required: false },
|
|
21
|
+
jsonSchemaPath: { type: String, required: false, default: "" },
|
|
22
|
+
required: { type: Array, required: false },
|
|
23
|
+
isRequired: { type: Boolean, required: true },
|
|
24
|
+
items: { type: Object, required: false },
|
|
25
|
+
edit: { type: Boolean, required: false },
|
|
26
|
+
minItems: { type: Number, required: false },
|
|
27
|
+
maxItems: { type: Number, required: false },
|
|
28
|
+
minimum: { type: Number, required: false },
|
|
29
|
+
maximum: { type: Number, required: false },
|
|
30
|
+
editInline: { type: Boolean, required: false },
|
|
31
|
+
columns: { type: Array, required: false },
|
|
32
|
+
validateFields: { type: Function, required: false },
|
|
33
|
+
setHidden: { type: Function, required: false }
|
|
34
|
+
});
|
|
35
|
+
const value = defineModel({ type: null, ...{ required: true } });
|
|
36
|
+
const emit = defineEmits(["submit"]);
|
|
47
37
|
const onSubmit = () => {
|
|
48
|
-
emit(
|
|
49
|
-
}
|
|
50
|
-
|
|
38
|
+
emit("submit");
|
|
39
|
+
};
|
|
51
40
|
const Render = () => {
|
|
52
|
-
const { type: t, renderer, format } = props
|
|
53
|
-
const type = Array.isArray(t) ? t[0] : t
|
|
54
|
-
if (type == null ||
|
|
55
|
-
return
|
|
41
|
+
const { type: t, renderer, format } = props;
|
|
42
|
+
const type = Array.isArray(t) ? t[0] : t;
|
|
43
|
+
if (type == null || renderer != null && renderer === "none") {
|
|
44
|
+
return void 0;
|
|
56
45
|
} else if (renderer) {
|
|
57
46
|
return h(resolveComponent(renderer), {
|
|
58
47
|
...props,
|
|
@@ -60,13 +49,13 @@ const Render = () => {
|
|
|
60
49
|
onSubmit,
|
|
61
50
|
// is: typeof renderer === 'string' ? renderer : undefined,
|
|
62
51
|
modelValue: value.value,
|
|
63
|
-
|
|
64
|
-
value.value = v
|
|
52
|
+
"onUpdate:modelValue": (v) => {
|
|
53
|
+
value.value = v;
|
|
65
54
|
}
|
|
66
|
-
})
|
|
67
|
-
} else if (type ===
|
|
68
|
-
const { enum: eenum } = props
|
|
69
|
-
if (format ===
|
|
55
|
+
});
|
|
56
|
+
} else if (type === "string") {
|
|
57
|
+
const { enum: eenum } = props;
|
|
58
|
+
if (format === "full-date") {
|
|
70
59
|
return h(SDate, {
|
|
71
60
|
id: props.id,
|
|
72
61
|
title: props.title,
|
|
@@ -74,11 +63,11 @@ const Render = () => {
|
|
|
74
63
|
type: props.type,
|
|
75
64
|
isRequired: props.isRequired,
|
|
76
65
|
jsonSchemaPath: `${props.jsonSchemaPath}.${props.id}`,
|
|
77
|
-
modelValue: value.value
|
|
78
|
-
|
|
79
|
-
value.value = v
|
|
66
|
+
modelValue: value.value,
|
|
67
|
+
"onUpdate:modelValue": (v) => {
|
|
68
|
+
value.value = v;
|
|
80
69
|
}
|
|
81
|
-
})
|
|
70
|
+
});
|
|
82
71
|
} else if (eenum) {
|
|
83
72
|
return h(SSelect, {
|
|
84
73
|
id: props.id,
|
|
@@ -88,11 +77,11 @@ const Render = () => {
|
|
|
88
77
|
enum_titles: props.enum_titles,
|
|
89
78
|
isRequired: props.isRequired,
|
|
90
79
|
jsonSchemaPath: `${props.jsonSchemaPath}.${props.id}`,
|
|
91
|
-
modelValue: value.value
|
|
92
|
-
|
|
93
|
-
value.value = v
|
|
80
|
+
modelValue: value.value,
|
|
81
|
+
"onUpdate:modelValue": (v) => {
|
|
82
|
+
value.value = v;
|
|
94
83
|
}
|
|
95
|
-
})
|
|
84
|
+
});
|
|
96
85
|
} else {
|
|
97
86
|
return h(SInputField, {
|
|
98
87
|
id: props.id,
|
|
@@ -101,13 +90,13 @@ const Render = () => {
|
|
|
101
90
|
isRequired: props.isRequired,
|
|
102
91
|
type,
|
|
103
92
|
jsonSchemaPath: `${props.jsonSchemaPath}.${props.id}`,
|
|
104
|
-
modelValue: value.value
|
|
105
|
-
|
|
106
|
-
value.value = v
|
|
93
|
+
modelValue: value.value,
|
|
94
|
+
"onUpdate:modelValue": (v) => {
|
|
95
|
+
value.value = v;
|
|
107
96
|
}
|
|
108
|
-
})
|
|
97
|
+
});
|
|
109
98
|
}
|
|
110
|
-
} else if (type ===
|
|
99
|
+
} else if (type === "number" || type === "integer") {
|
|
111
100
|
return h(SInputNumber, {
|
|
112
101
|
id: props.id,
|
|
113
102
|
title: props.title,
|
|
@@ -115,27 +104,26 @@ const Render = () => {
|
|
|
115
104
|
type,
|
|
116
105
|
isRequired: props.isRequired,
|
|
117
106
|
jsonSchemaPath: `${props.jsonSchemaPath}.${props.id}`,
|
|
118
|
-
modelValue: value.value
|
|
119
|
-
|
|
120
|
-
value.value = v
|
|
107
|
+
modelValue: value.value,
|
|
108
|
+
"onUpdate:modelValue": (v) => {
|
|
109
|
+
value.value = v;
|
|
121
110
|
}
|
|
122
|
-
})
|
|
123
|
-
} else if (type ===
|
|
111
|
+
});
|
|
112
|
+
} else if (type === "boolean") {
|
|
124
113
|
return h(SToggle, {
|
|
125
114
|
id: props.id,
|
|
126
115
|
title: props.title,
|
|
127
116
|
description: props.description,
|
|
128
117
|
isRequired: props.isRequired,
|
|
129
118
|
jsonSchemaPath: `${props.jsonSchemaPath}.${props.id}`,
|
|
130
|
-
modelValue: value.value
|
|
131
|
-
|
|
132
|
-
value.value = v
|
|
119
|
+
modelValue: value.value,
|
|
120
|
+
"onUpdate:modelValue": (v) => {
|
|
121
|
+
value.value = v;
|
|
133
122
|
}
|
|
134
|
-
})
|
|
135
|
-
} else if (type ===
|
|
136
|
-
if (!props.properties) throw new Error(
|
|
137
|
-
if (!props.required) throw new Error(
|
|
138
|
-
|
|
123
|
+
});
|
|
124
|
+
} else if (type === "object") {
|
|
125
|
+
if (!props.properties) throw new Error("object is missing properties");
|
|
126
|
+
if (!props.required) throw new Error("object is missing required");
|
|
139
127
|
return h(SObject, {
|
|
140
128
|
id: props.id,
|
|
141
129
|
title: props.title,
|
|
@@ -146,14 +134,13 @@ const Render = () => {
|
|
|
146
134
|
jsonSchemaPath: `${props.jsonSchemaPath}.${props.id}`,
|
|
147
135
|
onSubmit,
|
|
148
136
|
setHidden: props.setHidden,
|
|
149
|
-
modelValue: value.value
|
|
150
|
-
|
|
151
|
-
value.value = v
|
|
137
|
+
modelValue: value.value,
|
|
138
|
+
"onUpdate:modelValue": (v) => {
|
|
139
|
+
value.value = v;
|
|
152
140
|
}
|
|
153
|
-
})
|
|
154
|
-
} else if (type ===
|
|
155
|
-
if (!props.items) throw new Error(
|
|
156
|
-
|
|
141
|
+
});
|
|
142
|
+
} else if (type === "array") {
|
|
143
|
+
if (!props.items) throw new Error("array has no items");
|
|
157
144
|
return h(SArray, {
|
|
158
145
|
id: props.id,
|
|
159
146
|
title: props.title,
|
|
@@ -168,14 +155,14 @@ const Render = () => {
|
|
|
168
155
|
jsonSchemaPath: `${props.jsonSchemaPath}.${props.id}`,
|
|
169
156
|
onSubmit,
|
|
170
157
|
setHidden: props.setHidden,
|
|
171
|
-
modelValue: value.value
|
|
172
|
-
|
|
173
|
-
value.value = v
|
|
158
|
+
modelValue: value.value,
|
|
159
|
+
"onUpdate:modelValue": (v) => {
|
|
160
|
+
value.value = v;
|
|
174
161
|
}
|
|
175
|
-
})
|
|
162
|
+
});
|
|
176
163
|
}
|
|
177
|
-
return
|
|
178
|
-
}
|
|
164
|
+
return void 0;
|
|
165
|
+
};
|
|
179
166
|
</script>
|
|
180
167
|
|
|
181
168
|
<template>
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import type { PropertiesType } from '../types/index.js';
|
|
2
|
+
import type { TableColumn } from '@nuxt/ui';
|
|
3
|
+
type Properties = {
|
|
4
|
+
properties?: {
|
|
5
|
+
[key: string]: unknown;
|
|
6
|
+
};
|
|
7
|
+
};
|
|
8
|
+
export type SComponentProps = {
|
|
9
|
+
id?: string;
|
|
10
|
+
title?: string;
|
|
11
|
+
renderer?: string;
|
|
12
|
+
type?: string | unknown[];
|
|
13
|
+
properties?: Properties;
|
|
14
|
+
enum?: string[];
|
|
15
|
+
enum_titles?: string[];
|
|
16
|
+
format?: string;
|
|
17
|
+
description?: string;
|
|
18
|
+
placeholder?: string;
|
|
19
|
+
jsonSchemaPath?: string;
|
|
20
|
+
required?: string[];
|
|
21
|
+
isRequired: boolean;
|
|
22
|
+
items?: PropertiesType;
|
|
23
|
+
edit?: boolean;
|
|
24
|
+
minItems?: number;
|
|
25
|
+
maxItems?: number;
|
|
26
|
+
minimum?: number;
|
|
27
|
+
maximum?: number;
|
|
28
|
+
editInline?: boolean;
|
|
29
|
+
columns?: TableColumn<{}>[];
|
|
30
|
+
validateFields?: (fields: string[]) => Promise<boolean>;
|
|
31
|
+
setHidden?: (value: boolean) => void;
|
|
32
|
+
};
|
|
33
|
+
type __VLS_Props = SComponentProps;
|
|
34
|
+
type __VLS_ModelProps = {
|
|
35
|
+
modelValue: unknown;
|
|
36
|
+
};
|
|
37
|
+
type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
|
|
38
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{}>, {
|
|
39
|
+
id: string;
|
|
40
|
+
jsonSchemaPath: string;
|
|
41
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
42
|
+
declare const _default: typeof __VLS_export;
|
|
43
|
+
export default _default;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
type __VLS_Props = {
|
|
2
|
+
id: string;
|
|
3
|
+
title?: string;
|
|
4
|
+
description?: string;
|
|
5
|
+
isRequired: boolean;
|
|
6
|
+
};
|
|
7
|
+
type __VLS_ModelProps = {
|
|
8
|
+
modelValue: string;
|
|
9
|
+
};
|
|
10
|
+
type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
|
|
11
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
12
|
+
"update:modelValue": (value: string) => any;
|
|
13
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
14
|
+
"onUpdate:modelValue"?: ((value: string) => any) | undefined;
|
|
15
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
16
|
+
declare const _default: typeof __VLS_export;
|
|
17
|
+
export default _default;
|
|
@@ -1,41 +1,37 @@
|
|
|
1
|
-
<script
|
|
2
|
-
import { ref, watch } from
|
|
3
|
-
import { CalendarDate, DateFormatter, getLocalTimeZone } from
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
const
|
|
13
|
-
|
|
14
|
-
const value = defineModel<string>({ required: true, default: new Date().toISOString() })
|
|
15
|
-
const valueDate = new Date(value.value)
|
|
16
|
-
const date = ref(new CalendarDate(valueDate.getFullYear(), valueDate.getMonth() + 1, valueDate.getDate()))
|
|
17
|
-
|
|
1
|
+
<script setup>
|
|
2
|
+
import { ref, watch } from "vue";
|
|
3
|
+
import { CalendarDate, DateFormatter, getLocalTimeZone } from "@internationalized/date";
|
|
4
|
+
const props = defineProps({
|
|
5
|
+
id: { type: String, required: true },
|
|
6
|
+
title: { type: String, required: false },
|
|
7
|
+
description: { type: String, required: false },
|
|
8
|
+
isRequired: { type: Boolean, required: true }
|
|
9
|
+
});
|
|
10
|
+
const df = new DateFormatter("nl-NL", { dateStyle: "medium" });
|
|
11
|
+
const value = defineModel({ type: String, ...{ required: true, default: (/* @__PURE__ */ new Date()).toISOString() } });
|
|
12
|
+
const valueDate = new Date(value.value);
|
|
13
|
+
const date = ref(new CalendarDate(valueDate.getFullYear(), valueDate.getMonth() + 1, valueDate.getDate()));
|
|
18
14
|
watch(date, () => {
|
|
19
|
-
value.value = date.value.toDate(getLocalTimeZone()).toISOString()
|
|
20
|
-
})
|
|
21
|
-
const open = ref(false)
|
|
15
|
+
value.value = date.value.toDate(getLocalTimeZone()).toISOString();
|
|
16
|
+
});
|
|
17
|
+
const open = ref(false);
|
|
22
18
|
</script>
|
|
23
19
|
|
|
24
20
|
<template>
|
|
25
21
|
<div>
|
|
26
22
|
<UFormField
|
|
27
23
|
:label="props.title || id"
|
|
28
|
-
:hint="!props.isRequired ? 'optional' :
|
|
24
|
+
:hint="!props.isRequired ? 'optional' : void 0"
|
|
29
25
|
:description="props.description"
|
|
30
26
|
:name="props.id"
|
|
31
27
|
>
|
|
32
28
|
<UPopover v-model:open="open">
|
|
33
|
-
<UButton color="neutral" variant="subtle" icon="i-lucide-calendar" class="w-full" @click="() =>
|
|
34
|
-
{{ value ? df.format(date.toDate(getLocalTimeZone())) :
|
|
29
|
+
<UButton color="neutral" variant="subtle" icon="i-lucide-calendar" class="w-full" @click="() => open = true">
|
|
30
|
+
{{ value ? df.format(date.toDate(getLocalTimeZone())) : "Select a date" }}
|
|
35
31
|
</UButton>
|
|
36
32
|
|
|
37
33
|
<template #content>
|
|
38
|
-
<UCalendar v-model="date" class="p-2" @update:modelValue="() =>
|
|
34
|
+
<UCalendar v-model="date" class="p-2" @update:modelValue="() => open = false" />
|
|
39
35
|
</template>
|
|
40
36
|
</UPopover>
|
|
41
37
|
</UFormField>
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
type __VLS_Props = {
|
|
2
|
+
id: string;
|
|
3
|
+
title?: string;
|
|
4
|
+
description?: string;
|
|
5
|
+
isRequired: boolean;
|
|
6
|
+
};
|
|
7
|
+
type __VLS_ModelProps = {
|
|
8
|
+
modelValue: string;
|
|
9
|
+
};
|
|
10
|
+
type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
|
|
11
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
12
|
+
"update:modelValue": (value: string) => any;
|
|
13
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
14
|
+
"onUpdate:modelValue"?: ((value: string) => any) | undefined;
|
|
15
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
16
|
+
declare const _default: typeof __VLS_export;
|
|
17
|
+
export default _default;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import type { JsonSchema } from 'json-schema-library';
|
|
2
|
+
import type { Config } from 'json-schema-yup-transformer';
|
|
3
|
+
import type { CustomValidation } from '#schema-form-types';
|
|
4
|
+
type __VLS_Props = {
|
|
5
|
+
schema: JsonSchema;
|
|
6
|
+
options?: {
|
|
7
|
+
customValidation?: CustomValidation[];
|
|
8
|
+
jsonSchemaYupTransfromer?: Config;
|
|
9
|
+
};
|
|
10
|
+
};
|
|
11
|
+
type __VLS_ModelProps = {
|
|
12
|
+
modelValue: Record<string, unknown>;
|
|
13
|
+
};
|
|
14
|
+
type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
|
|
15
|
+
declare var __VLS_18: {}, __VLS_20: {};
|
|
16
|
+
type __VLS_Slots = {} & {
|
|
17
|
+
default?: (props: typeof __VLS_18) => any;
|
|
18
|
+
} & {
|
|
19
|
+
submit?: (props: typeof __VLS_20) => any;
|
|
20
|
+
};
|
|
21
|
+
declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {
|
|
22
|
+
submit: () => void;
|
|
23
|
+
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
24
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
25
|
+
declare const _default: typeof __VLS_export;
|
|
26
|
+
export default _default;
|
|
27
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
28
|
+
new (): {
|
|
29
|
+
$slots: S;
|
|
30
|
+
};
|
|
31
|
+
};
|