@sfxcode/nuxt-ui-formkit 1.0.3 → 1.0.5
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.json +1 -1
- package/dist/runtime/components/FUDataEdit.d.vue.ts +4 -12
- package/dist/runtime/components/FUDataEdit.vue +11 -3
- package/dist/runtime/components/FUDataEdit.vue.d.ts +4 -12
- package/dist/runtime/components/FUDataView.d.vue.ts +4 -8
- package/dist/runtime/components/FUDataView.vue +11 -1
- package/dist/runtime/components/FUDataView.vue.d.ts +4 -8
- package/package.json +26 -16
package/dist/module.json
CHANGED
|
@@ -73,13 +73,9 @@ declare const __VLS_base: import("vue").DefineComponent<import("vue").ExtractPro
|
|
|
73
73
|
type: BooleanConstructor;
|
|
74
74
|
default: boolean;
|
|
75
75
|
};
|
|
76
|
-
modelValue:
|
|
77
|
-
type: PropType<object>;
|
|
78
|
-
};
|
|
76
|
+
modelValue: FormKitSchemaDefinition;
|
|
79
77
|
}>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
80
|
-
|
|
81
|
-
dataSaved: (...args: any[]) => void;
|
|
82
|
-
"update:modelValue": (value: object | undefined) => void;
|
|
78
|
+
"update:modelValue": (value: any) => any;
|
|
83
79
|
}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
84
80
|
id: {
|
|
85
81
|
type: StringConstructor;
|
|
@@ -145,13 +141,9 @@ declare const __VLS_base: import("vue").DefineComponent<import("vue").ExtractPro
|
|
|
145
141
|
type: BooleanConstructor;
|
|
146
142
|
default: boolean;
|
|
147
143
|
};
|
|
148
|
-
modelValue:
|
|
149
|
-
type: PropType<object>;
|
|
150
|
-
};
|
|
144
|
+
modelValue: FormKitSchemaDefinition;
|
|
151
145
|
}>> & Readonly<{
|
|
152
|
-
|
|
153
|
-
onDataSaved?: ((...args: any[]) => any) | undefined;
|
|
154
|
-
"onUpdate:modelValue"?: ((value: object | undefined) => any) | undefined;
|
|
146
|
+
"onUpdate:modelValue"?: ((value: any) => any) | undefined;
|
|
155
147
|
}>, {
|
|
156
148
|
data: Record<string, any>;
|
|
157
149
|
id: string;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<script setup>
|
|
2
2
|
import { reset } from "@formkit/core";
|
|
3
3
|
import { FormKit, FormKitMessages, FormKitSchema } from "@formkit/vue";
|
|
4
|
-
import { ref } from "vue";
|
|
4
|
+
import { ref, watch } from "vue";
|
|
5
5
|
import FUDataDebug from "./FUDataDebug.vue";
|
|
6
6
|
const props = defineProps({
|
|
7
7
|
id: {
|
|
@@ -70,11 +70,19 @@ const props = defineProps({
|
|
|
70
70
|
}
|
|
71
71
|
});
|
|
72
72
|
const emit = defineEmits(["dataSaved", "onReset"]);
|
|
73
|
-
const
|
|
73
|
+
const formSchema = ref(props.schema);
|
|
74
|
+
const formData = defineModel({ type: null });
|
|
75
|
+
watch(() => props.schema, (newSchema) => {
|
|
76
|
+
formSchema.value = newSchema;
|
|
77
|
+
}, { deep: true });
|
|
78
|
+
watch(() => props.data, (newData) => {
|
|
79
|
+
if (newData && newData !== formData.value) {
|
|
80
|
+
formData.value = newData;
|
|
81
|
+
}
|
|
82
|
+
}, { deep: true });
|
|
74
83
|
if (props.data) {
|
|
75
84
|
formData.value = props.data;
|
|
76
85
|
}
|
|
77
|
-
const formSchema = ref(props.schema);
|
|
78
86
|
function handleSave() {
|
|
79
87
|
emit("dataSaved", formData.value);
|
|
80
88
|
}
|
|
@@ -73,13 +73,9 @@ declare const __VLS_base: import("vue").DefineComponent<import("vue").ExtractPro
|
|
|
73
73
|
type: BooleanConstructor;
|
|
74
74
|
default: boolean;
|
|
75
75
|
};
|
|
76
|
-
modelValue:
|
|
77
|
-
type: PropType<object>;
|
|
78
|
-
};
|
|
76
|
+
modelValue: FormKitSchemaDefinition;
|
|
79
77
|
}>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
80
|
-
|
|
81
|
-
dataSaved: (...args: any[]) => void;
|
|
82
|
-
"update:modelValue": (value: object | undefined) => void;
|
|
78
|
+
"update:modelValue": (value: any) => any;
|
|
83
79
|
}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
84
80
|
id: {
|
|
85
81
|
type: StringConstructor;
|
|
@@ -145,13 +141,9 @@ declare const __VLS_base: import("vue").DefineComponent<import("vue").ExtractPro
|
|
|
145
141
|
type: BooleanConstructor;
|
|
146
142
|
default: boolean;
|
|
147
143
|
};
|
|
148
|
-
modelValue:
|
|
149
|
-
type: PropType<object>;
|
|
150
|
-
};
|
|
144
|
+
modelValue: FormKitSchemaDefinition;
|
|
151
145
|
}>> & Readonly<{
|
|
152
|
-
|
|
153
|
-
onDataSaved?: ((...args: any[]) => any) | undefined;
|
|
154
|
-
"onUpdate:modelValue"?: ((value: object | undefined) => any) | undefined;
|
|
146
|
+
"onUpdate:modelValue"?: ((value: any) => any) | undefined;
|
|
155
147
|
}>, {
|
|
156
148
|
data: Record<string, any>;
|
|
157
149
|
id: string;
|
|
@@ -25,11 +25,9 @@ declare const __VLS_base: import("vue").DefineComponent<import("vue").ExtractPro
|
|
|
25
25
|
type: BooleanConstructor;
|
|
26
26
|
default: boolean;
|
|
27
27
|
};
|
|
28
|
-
modelValue:
|
|
29
|
-
type: PropType<Record<string, unknown>>;
|
|
30
|
-
};
|
|
28
|
+
modelValue: FormKitSchemaDefinition;
|
|
31
29
|
}>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
32
|
-
"update:modelValue": (value:
|
|
30
|
+
"update:modelValue": (value: any) => any;
|
|
33
31
|
}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
34
32
|
data: {
|
|
35
33
|
type: ObjectConstructor;
|
|
@@ -51,11 +49,9 @@ declare const __VLS_base: import("vue").DefineComponent<import("vue").ExtractPro
|
|
|
51
49
|
type: BooleanConstructor;
|
|
52
50
|
default: boolean;
|
|
53
51
|
};
|
|
54
|
-
modelValue:
|
|
55
|
-
type: PropType<Record<string, unknown>>;
|
|
56
|
-
};
|
|
52
|
+
modelValue: FormKitSchemaDefinition;
|
|
57
53
|
}>> & Readonly<{
|
|
58
|
-
"onUpdate:modelValue"?: ((value:
|
|
54
|
+
"onUpdate:modelValue"?: ((value: any) => any) | undefined;
|
|
59
55
|
}>, {
|
|
60
56
|
data: Record<string, any>;
|
|
61
57
|
schema: FormKitSchemaDefinition;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
<script setup>
|
|
2
2
|
import { FormKitSchema } from "@formkit/vue";
|
|
3
3
|
import FuDataDebug from "./FUDataDebug.vue";
|
|
4
|
+
import { ref, watch } from "vue";
|
|
4
5
|
const props = defineProps({
|
|
5
6
|
data: {
|
|
6
7
|
type: Object,
|
|
@@ -23,7 +24,16 @@ const props = defineProps({
|
|
|
23
24
|
default: false
|
|
24
25
|
}
|
|
25
26
|
});
|
|
26
|
-
const
|
|
27
|
+
const formSchema = ref(props.schema);
|
|
28
|
+
const formData = defineModel({ type: null });
|
|
29
|
+
watch(() => props.schema, (newSchema) => {
|
|
30
|
+
formSchema.value = newSchema;
|
|
31
|
+
}, { deep: true });
|
|
32
|
+
watch(() => props.data, (newData) => {
|
|
33
|
+
if (newData && newData !== formData.value) {
|
|
34
|
+
formData.value = newData;
|
|
35
|
+
}
|
|
36
|
+
}, { deep: true });
|
|
27
37
|
if (props.data) {
|
|
28
38
|
formData.value = props.data;
|
|
29
39
|
}
|
|
@@ -25,11 +25,9 @@ declare const __VLS_base: import("vue").DefineComponent<import("vue").ExtractPro
|
|
|
25
25
|
type: BooleanConstructor;
|
|
26
26
|
default: boolean;
|
|
27
27
|
};
|
|
28
|
-
modelValue:
|
|
29
|
-
type: PropType<Record<string, unknown>>;
|
|
30
|
-
};
|
|
28
|
+
modelValue: FormKitSchemaDefinition;
|
|
31
29
|
}>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
32
|
-
"update:modelValue": (value:
|
|
30
|
+
"update:modelValue": (value: any) => any;
|
|
33
31
|
}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
34
32
|
data: {
|
|
35
33
|
type: ObjectConstructor;
|
|
@@ -51,11 +49,9 @@ declare const __VLS_base: import("vue").DefineComponent<import("vue").ExtractPro
|
|
|
51
49
|
type: BooleanConstructor;
|
|
52
50
|
default: boolean;
|
|
53
51
|
};
|
|
54
|
-
modelValue:
|
|
55
|
-
type: PropType<Record<string, unknown>>;
|
|
56
|
-
};
|
|
52
|
+
modelValue: FormKitSchemaDefinition;
|
|
57
53
|
}>> & Readonly<{
|
|
58
|
-
"onUpdate:modelValue"?: ((value:
|
|
54
|
+
"onUpdate:modelValue"?: ((value: any) => any) | undefined;
|
|
59
55
|
}>, {
|
|
60
56
|
data: Record<string, any>;
|
|
61
57
|
schema: FormKitSchemaDefinition;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sfxcode/nuxt-ui-formkit",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.5",
|
|
4
4
|
"description": "FormKit integration for Nuxt UI - Seamlessly connect FormKit form handling with Nuxt UI components",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "Tom",
|
|
@@ -34,7 +34,6 @@
|
|
|
34
34
|
"design-system",
|
|
35
35
|
"form-builder"
|
|
36
36
|
],
|
|
37
|
-
"packageManager": "pnpm@11.0.9+sha512.34ce82e6780233cf9cad8685029a8f81d2e06196c5a9bad98879f7424940c6817c4e4524fb7d38b8553ceed48b9758b8ebaf1abd3600c232c4c8cf7366086f38",
|
|
38
37
|
"type": "module",
|
|
39
38
|
"exports": {
|
|
40
39
|
".": {
|
|
@@ -83,35 +82,46 @@
|
|
|
83
82
|
"lint": "eslint .",
|
|
84
83
|
"test": "vitest run",
|
|
85
84
|
"test:watch": "vitest watch",
|
|
86
|
-
"test:types": "vue-tsc --noEmit && cd playground && vue-tsc --noEmit"
|
|
85
|
+
"test:types": "vue-tsc --noEmit && cd playground && vue-tsc --noEmit",
|
|
86
|
+
"docs:dev": "vitepress dev docs",
|
|
87
|
+
"docs:build": "vitepress build docs",
|
|
88
|
+
"docs:preview": "vitepress preview docs"
|
|
87
89
|
},
|
|
88
90
|
"dependencies": {
|
|
89
91
|
"@formkit/addons": "^2.0.0",
|
|
90
92
|
"@formkit/nuxt": "^2.0.0",
|
|
91
|
-
"@nuxt/kit": "^4.4.
|
|
92
|
-
"@nuxt/ui": "^4.
|
|
93
|
+
"@nuxt/kit": "^4.4.7",
|
|
94
|
+
"@nuxt/ui": "^4.8.2",
|
|
95
|
+
"@vue/compiler-dom": "^3.5.35"
|
|
93
96
|
},
|
|
94
97
|
"devDependencies": {
|
|
95
98
|
"@iconify-json/heroicons": "^1.2.3",
|
|
96
|
-
"@iconify-json/lucide": "^1.2.
|
|
97
|
-
"@iconify-json/simple-icons": "^1.2.
|
|
98
|
-
"@nuxt/devtools": "4.0.0-alpha.
|
|
99
|
+
"@iconify-json/lucide": "^1.2.111",
|
|
100
|
+
"@iconify-json/simple-icons": "^1.2.85",
|
|
101
|
+
"@nuxt/devtools": "4.0.0-alpha.7",
|
|
99
102
|
"@nuxt/eslint-config": "^1.15.2",
|
|
100
103
|
"@nuxt/module-builder": "^1.0.2",
|
|
101
|
-
"@nuxt/schema": "^4.4.
|
|
104
|
+
"@nuxt/schema": "^4.4.7",
|
|
102
105
|
"@nuxt/test-utils": "^4.0.3",
|
|
103
106
|
"@types/node": "latest",
|
|
104
107
|
"@vitejs/plugin-vue": "^6.0.7",
|
|
105
108
|
"changelogen": "^0.6.2",
|
|
106
|
-
"eslint": "^10.
|
|
109
|
+
"eslint": "^10.4.1",
|
|
107
110
|
"jsdom": "^29.1.1",
|
|
108
111
|
"mkdist": "^2.4.1",
|
|
109
|
-
"nuxt": "^4.4.
|
|
110
|
-
"sass-embedded": "^1.
|
|
112
|
+
"nuxt": "^4.4.7",
|
|
113
|
+
"sass-embedded": "^1.100.0",
|
|
111
114
|
"typescript": "~6.0.3",
|
|
112
115
|
"unbuild": "^3.6.1",
|
|
113
|
-
"
|
|
114
|
-
"
|
|
115
|
-
"vue
|
|
116
|
-
|
|
116
|
+
"vitepress": "2.0.0-alpha.17",
|
|
117
|
+
"vitest": "^4.1.8",
|
|
118
|
+
"vue": "^3.5.35",
|
|
119
|
+
"vue-tsc": "^3.3.3",
|
|
120
|
+
"@codemirror/lang-json": "^6.0.2",
|
|
121
|
+
"@codemirror/state": "^6.6.0",
|
|
122
|
+
"@codemirror/theme-one-dark": "^6.1.3",
|
|
123
|
+
"@codemirror/view": "^6.43.0",
|
|
124
|
+
"codemirror": "^6.0.2"
|
|
125
|
+
},
|
|
126
|
+
"packageManager": "pnpm@11.1.2+sha512.415a1cc25974731e75455c1468371be74c5aa5fb7621b50d4056d222451609f11412f23fd602e6169f1e060466641f798597e1be961a10688836a67b16569499"
|
|
117
127
|
}
|