@sfxcode/nuxt-ui-formkit 1.2.4 → 1.2.6
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 +2 -1
- package/dist/module.json +1 -1
- package/dist/runtime/components/FUAutoForm.d.vue.ts +7 -8
- package/dist/runtime/components/FUAutoForm.vue +7 -4
- package/dist/runtime/components/FUAutoForm.vue.d.ts +7 -8
- package/dist/runtime/components/FUAutoFormOverlay.d.vue.ts +1 -1
- package/dist/runtime/components/FUAutoFormOverlay.vue.d.ts +1 -1
- package/dist/runtime/components/FUDataEdit.d.vue.ts +7 -7
- package/dist/runtime/components/FUDataEdit.vue +1 -1
- package/dist/runtime/components/FUDataEdit.vue.d.ts +7 -7
- package/dist/runtime/components/FUDataView.d.vue.ts +7 -7
- package/dist/runtime/components/FUDataView.vue +1 -1
- package/dist/runtime/components/FUDataView.vue.d.ts +7 -7
- package/dist/runtime/components/inputs/FUCalendar.vue +2 -2
- package/dist/runtime/components/inputs/FUCheckbox.d.vue.ts +1 -0
- package/dist/runtime/components/inputs/FUCheckbox.vue +3 -2
- package/dist/runtime/components/inputs/FUCheckbox.vue.d.ts +1 -0
- package/dist/runtime/components/inputs/FUCheckboxGroup.vue +3 -2
- package/dist/runtime/components/inputs/FUColorPicker.vue +2 -2
- package/dist/runtime/components/inputs/FUEditor.vue +2 -2
- package/dist/runtime/components/inputs/FUFileUpload.vue +3 -3
- package/dist/runtime/components/inputs/FUInput.vue +2 -2
- package/dist/runtime/components/inputs/FUInputDate.vue +2 -2
- package/dist/runtime/components/inputs/FUInputMenu.d.vue.ts +1 -0
- package/dist/runtime/components/inputs/FUInputMenu.vue +3 -2
- package/dist/runtime/components/inputs/FUInputMenu.vue.d.ts +1 -0
- package/dist/runtime/components/inputs/FUInputNumber.vue +2 -2
- package/dist/runtime/components/inputs/FUInputTags.vue +2 -2
- package/dist/runtime/components/inputs/FUInputTime.vue +2 -2
- package/dist/runtime/components/inputs/FUListbox.d.vue.ts +1 -0
- package/dist/runtime/components/inputs/FUListbox.vue +10 -6
- package/dist/runtime/components/inputs/FUListbox.vue.d.ts +1 -0
- package/dist/runtime/components/inputs/FUPinInput.d.vue.ts +1 -0
- package/dist/runtime/components/inputs/FUPinInput.vue +3 -2
- package/dist/runtime/components/inputs/FUPinInput.vue.d.ts +1 -0
- package/dist/runtime/components/inputs/FURadioGroup.vue +3 -3
- package/dist/runtime/components/inputs/FUSelect.d.vue.ts +1 -0
- package/dist/runtime/components/inputs/FUSelect.vue +3 -2
- package/dist/runtime/components/inputs/FUSelect.vue.d.ts +1 -0
- package/dist/runtime/components/inputs/FUSelectMenu.d.vue.ts +1 -0
- package/dist/runtime/components/inputs/FUSelectMenu.vue +3 -2
- package/dist/runtime/components/inputs/FUSelectMenu.vue.d.ts +1 -0
- package/dist/runtime/components/inputs/FUSlider.vue +3 -3
- package/dist/runtime/components/inputs/FUSwitch.d.vue.ts +1 -0
- package/dist/runtime/components/inputs/FUSwitch.vue +3 -2
- package/dist/runtime/components/inputs/FUSwitch.vue.d.ts +1 -0
- package/dist/runtime/components/inputs/FUTextarea.vue +2 -2
- package/dist/runtime/components/inputs/FUTree.d.vue.ts +36 -0
- package/dist/runtime/components/inputs/FUTree.vue +52 -0
- package/dist/runtime/components/inputs/FUTree.vue.d.ts +36 -0
- package/dist/runtime/components/output/FUOutputBoolean.d.vue.ts +2 -0
- package/dist/runtime/components/output/FUOutputBoolean.vue.d.ts +2 -0
- package/dist/runtime/components/output/FUOutputDate.d.vue.ts +2 -0
- package/dist/runtime/components/output/FUOutputDate.vue.d.ts +2 -0
- package/dist/runtime/components/output/FUOutputLink.d.vue.ts +2 -0
- package/dist/runtime/components/output/FUOutputLink.vue.d.ts +2 -0
- package/dist/runtime/components/output/FUOutputList.d.vue.ts +2 -0
- package/dist/runtime/components/output/FUOutputList.vue +2 -1
- package/dist/runtime/components/output/FUOutputList.vue.d.ts +2 -0
- package/dist/runtime/components/output/FUOutputNumber.d.vue.ts +2 -0
- package/dist/runtime/components/output/FUOutputNumber.vue.d.ts +2 -0
- package/dist/runtime/components/output/FUOutputText.d.vue.ts +2 -0
- package/dist/runtime/components/output/FUOutputText.vue.d.ts +2 -0
- package/dist/runtime/composables/useFormKitAutoForm.d.ts +2 -0
- package/dist/runtime/composables/useFormKitAutoForm.js +86 -1
- package/dist/runtime/composables/useFormKitRepeater.js +5 -5
- package/dist/runtime/composables/useFormKitSchema.d.ts +7 -24
- package/dist/runtime/formkit/definitions/index.d.ts +1 -0
- package/dist/runtime/formkit/definitions/index.js +2 -1
- package/dist/runtime/formkit/definitions/index.mjs +2 -1
- package/dist/runtime/formkit/definitions/input.d.ts +1 -0
- package/dist/runtime/formkit/definitions/input.js +12 -7
- package/dist/runtime/formkit/definitions/input.mjs +12 -7
- package/dist/runtime/formkit/definitions/multiStep.js +8 -4
- package/dist/runtime/formkit/definitions/multiStep.mjs +8 -4
- package/dist/runtime/formkit/definitions/output.js +6 -6
- package/dist/runtime/formkit/definitions/output.mjs +6 -6
- package/dist/runtime/formkit/definitions/repeater.js +4 -0
- package/dist/runtime/formkit/definitions/repeater.mjs +4 -0
- package/dist/runtime/formkit/index.d.ts +10 -1
- package/dist/runtime/utils/useFormKitInput.d.ts +1 -0
- package/dist/runtime/utils/useFormKitInput.js +10 -2
- package/dist/runtime/utils/useFormKitOutput.d.ts +25 -0
- package/dist/runtime/utils/useFormKitOutput.js +21 -5
- package/package.json +6 -6
|
@@ -42,6 +42,10 @@ export const nuxtUIRepeaterDefinition = createInput(
|
|
|
42
42
|
addListGroup([
|
|
43
43
|
addElement("div", [
|
|
44
44
|
addDragHandle("$internalDragHandleClass", "$dragHandleIconName", "$renderDragHandle"),
|
|
45
|
+
// A bare `{ children }` node (no `$el`/`$cmp`/`$formkit` discriminant)
|
|
46
|
+
// is not representable by `FormKitSchemaNode`'s own type, but
|
|
47
|
+
// FormKit's schema compiler accepts it at runtime as a slot
|
|
48
|
+
// passthrough - cast rather than widen the shared `FormKitSchemaNode` type.
|
|
45
49
|
{ children: "$slots.default" },
|
|
46
50
|
addButtonGroup("$buttonGroupClass", "$buttonGroupItemClass", "$buttonSize", "$renderButtons")
|
|
47
51
|
], {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { FormKitMultiStepSlots, FormKitStepSlots } from '@formkit/addons';
|
|
2
2
|
import type { FormKitBaseSlots, FormKitInputs } from '@formkit/inputs';
|
|
3
|
-
import type { CalendarSlots, CheckboxSlots, CheckboxGroupSlots, EditorSlots, FileUploadSlots, RadioGroupSlots, InputSlots, TextareaSlots, SelectSlots, SelectMenuSlots, InputDateSlots, InputMenuSlots, InputNumberSlots, InputTagsSlots, InputTimeSlots, ListboxSlots, SwitchSlots } from '@nuxt/ui';
|
|
3
|
+
import type { CalendarSlots, CheckboxSlots, CheckboxGroupSlots, EditorSlots, FileUploadSlots, RadioGroupSlots, InputSlots, TextareaSlots, SelectSlots, SelectMenuSlots, InputDateSlots, InputMenuSlots, InputNumberSlots, InputTagsSlots, InputTimeSlots, ListboxSlots, PinInputSlots, SwitchSlots, TreeSlots } from '@nuxt/ui';
|
|
4
4
|
export * from './createNuxtUiFormkitConfig.js';
|
|
5
5
|
export * from './definitions/index.js';
|
|
6
6
|
export * from './plugins/index.js';
|
|
@@ -58,6 +58,9 @@ declare module '@formkit/inputs' {
|
|
|
58
58
|
nuxtUIRadioGroup: {
|
|
59
59
|
type: 'nuxtUIRadioGroup';
|
|
60
60
|
};
|
|
61
|
+
nuxtUIRepeater: {
|
|
62
|
+
type: 'nuxtUIRepeater';
|
|
63
|
+
};
|
|
61
64
|
nuxtUISelect: {
|
|
62
65
|
type: 'nuxtUISelect';
|
|
63
66
|
};
|
|
@@ -76,6 +79,9 @@ declare module '@formkit/inputs' {
|
|
|
76
79
|
nuxtUITextarea: {
|
|
77
80
|
type: 'nuxtUITextarea';
|
|
78
81
|
};
|
|
82
|
+
nuxtUITree: {
|
|
83
|
+
type: 'nuxtUITree';
|
|
84
|
+
};
|
|
79
85
|
nuxtUIOutputText: {
|
|
80
86
|
type: 'nuxtUIOutputText';
|
|
81
87
|
};
|
|
@@ -109,11 +115,14 @@ declare module '@formkit/inputs' {
|
|
|
109
115
|
nuxtUIInputTime: MergeSlots<FormKitBaseSlots<Props>, InputTimeSlots>;
|
|
110
116
|
nuxtUIListbox: MergeSlots<FormKitBaseSlots<Props>, ListboxSlots>;
|
|
111
117
|
nuxtUIMultiStep: MergeSlots<FormKitBaseSlots<Props>, FormKitMultiStepSlots<Props>>;
|
|
118
|
+
nuxtUIPinInput: MergeSlots<FormKitBaseSlots<Props>, PinInputSlots>;
|
|
112
119
|
nuxtUIRadioGroup: MergeSlots<FormKitBaseSlots<Props>, RadioGroupSlots>;
|
|
120
|
+
nuxtUIRepeater: FormKitBaseSlots<Props>;
|
|
113
121
|
nuxtUISelect: MergeSlots<FormKitBaseSlots<Props>, SelectSlots>;
|
|
114
122
|
nuxtUISelectMenu: MergeSlots<FormKitBaseSlots<Props>, SelectMenuSlots>;
|
|
115
123
|
nuxtUIStep: MergeSlots<FormKitBaseSlots<Props>, FormKitStepSlots<Props>>;
|
|
116
124
|
nuxtUISwitch: MergeSlots<FormKitBaseSlots<Props>, SwitchSlots>;
|
|
117
125
|
nuxtUITextarea: MergeSlots<FormKitBaseSlots<Props>, TextareaSlots>;
|
|
126
|
+
nuxtUITree: MergeSlots<FormKitBaseSlots<Props>, TreeSlots>;
|
|
118
127
|
}
|
|
119
128
|
}
|
|
@@ -1,5 +1,13 @@
|
|
|
1
|
-
import { computed } from "vue";
|
|
1
|
+
import { computed, onBeforeUnmount, ref } from "vue";
|
|
2
2
|
export function useFormKitInput(context) {
|
|
3
|
+
const ui = ref(context?.node?.props?.ui);
|
|
4
|
+
const uiReceipt = context?.node?.on?.("prop:ui", ({ payload }) => {
|
|
5
|
+
ui.value = payload;
|
|
6
|
+
});
|
|
7
|
+
onBeforeUnmount(() => {
|
|
8
|
+
if (uiReceipt !== void 0)
|
|
9
|
+
context?.node?.off?.(uiReceipt);
|
|
10
|
+
});
|
|
3
11
|
const isInvalid = computed(() => {
|
|
4
12
|
return context?.state?.validationVisible && !context?.state?.valid;
|
|
5
13
|
});
|
|
@@ -38,5 +46,5 @@ export function useFormKitInput(context) {
|
|
|
38
46
|
}
|
|
39
47
|
return [];
|
|
40
48
|
});
|
|
41
|
-
return { isInvalid, validSlotNames, styleClass, color, handleBlur, handleChange, handleInput, handleSelect, modelValue, items };
|
|
49
|
+
return { isInvalid, validSlotNames, styleClass, color, handleBlur, handleChange, handleInput, handleSelect, modelValue, items, ui };
|
|
42
50
|
}
|
|
@@ -1,4 +1,12 @@
|
|
|
1
1
|
import type { FormKitFrameworkContext } from '@formkit/core';
|
|
2
|
+
export interface FormKitOutputUi {
|
|
3
|
+
/** Merged into `containerClass` - Output components have no themeable Nuxt UI root to forward to. */
|
|
4
|
+
root?: string;
|
|
5
|
+
/** Merged into `iconClass`, applied to every `FUIcon` an Output component renders. */
|
|
6
|
+
icon?: string;
|
|
7
|
+
/** Forwarded unmodified to `UBadge`'s own `:ui` prop (`FUOutputList`'s badge display mode only). */
|
|
8
|
+
badge?: Record<string, unknown>;
|
|
9
|
+
}
|
|
2
10
|
export declare function useFormKitOutput(context: FormKitFrameworkContext): {
|
|
3
11
|
colorClass: import("vue").ComputedRef<string>;
|
|
4
12
|
sizeClass: import("vue").ComputedRef<string>;
|
|
@@ -7,4 +15,21 @@ export declare function useFormKitOutput(context: FormKitFrameworkContext): {
|
|
|
7
15
|
iconClass: import("vue").ComputedRef<string>;
|
|
8
16
|
leadingIconName: import("vue").ComputedRef<string | null>;
|
|
9
17
|
trailingIconName: import("vue").ComputedRef<string | null>;
|
|
18
|
+
ui: import("vue").Ref<{
|
|
19
|
+
root?: string
|
|
20
|
+
/** Merged into `iconClass`, applied to every `FUIcon` an Output component renders. */
|
|
21
|
+
| undefined;
|
|
22
|
+
icon?: string
|
|
23
|
+
/** Forwarded unmodified to `UBadge`'s own `:ui` prop (`FUOutputList`'s badge display mode only). */
|
|
24
|
+
| undefined;
|
|
25
|
+
badge?: Record<string, unknown> | undefined;
|
|
26
|
+
} | undefined, FormKitOutputUi | {
|
|
27
|
+
root?: string
|
|
28
|
+
/** Merged into `iconClass`, applied to every `FUIcon` an Output component renders. */
|
|
29
|
+
| undefined;
|
|
30
|
+
icon?: string
|
|
31
|
+
/** Forwarded unmodified to `UBadge`'s own `:ui` prop (`FUOutputList`'s badge display mode only). */
|
|
32
|
+
| undefined;
|
|
33
|
+
badge?: Record<string, unknown> | undefined;
|
|
34
|
+
} | undefined>;
|
|
10
35
|
};
|
|
@@ -1,5 +1,13 @@
|
|
|
1
|
-
import { computed } from "vue";
|
|
1
|
+
import { computed, onBeforeUnmount, ref } from "vue";
|
|
2
2
|
export function useFormKitOutput(context) {
|
|
3
|
+
const ui = ref(context?.node?.props?.ui);
|
|
4
|
+
const uiReceipt = context?.node?.on?.("prop:ui", ({ payload }) => {
|
|
5
|
+
ui.value = payload;
|
|
6
|
+
});
|
|
7
|
+
onBeforeUnmount(() => {
|
|
8
|
+
if (uiReceipt !== void 0)
|
|
9
|
+
context?.node?.off?.(uiReceipt);
|
|
10
|
+
});
|
|
3
11
|
const colorClass = computed(() => {
|
|
4
12
|
const color = context.color ?? "neutral";
|
|
5
13
|
const colorMap = {
|
|
@@ -41,6 +49,7 @@ export function useFormKitOutput(context) {
|
|
|
41
49
|
colorClass.value,
|
|
42
50
|
sizeClass.value,
|
|
43
51
|
variantClass.value,
|
|
52
|
+
ui.value?.root,
|
|
44
53
|
context?.attrs?.class
|
|
45
54
|
].filter(Boolean).join(" ");
|
|
46
55
|
});
|
|
@@ -53,13 +62,19 @@ export function useFormKitOutput(context) {
|
|
|
53
62
|
lg: "h-6 w-6",
|
|
54
63
|
xl: "h-7 w-7"
|
|
55
64
|
};
|
|
56
|
-
return iconSizeMap[size] || iconSizeMap.md;
|
|
65
|
+
return [iconSizeMap[size] || iconSizeMap.md, ui.value?.icon].filter(Boolean).join(" ");
|
|
57
66
|
});
|
|
58
67
|
const leadingIconName = computed(() => {
|
|
59
|
-
|
|
68
|
+
const leadingIcon = context.leadingIcon;
|
|
69
|
+
const leading = context.leading;
|
|
70
|
+
const icon = context.icon;
|
|
71
|
+
return leadingIcon || leading && icon || null;
|
|
60
72
|
});
|
|
61
73
|
const trailingIconName = computed(() => {
|
|
62
|
-
|
|
74
|
+
const trailingIcon = context.trailingIcon;
|
|
75
|
+
const trailing = context.trailing;
|
|
76
|
+
const icon = context.icon;
|
|
77
|
+
return trailingIcon || trailing && icon || null;
|
|
63
78
|
});
|
|
64
79
|
return {
|
|
65
80
|
colorClass,
|
|
@@ -68,6 +83,7 @@ export function useFormKitOutput(context) {
|
|
|
68
83
|
containerClass,
|
|
69
84
|
iconClass,
|
|
70
85
|
leadingIconName,
|
|
71
|
-
trailingIconName
|
|
86
|
+
trailingIconName,
|
|
87
|
+
ui
|
|
72
88
|
};
|
|
73
89
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sfxcode/nuxt-ui-formkit",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.6",
|
|
4
4
|
"description": "FormKit integration for Nuxt UI - Seamlessly connect FormKit form handling with Nuxt UI components",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "Tom",
|
|
@@ -97,12 +97,12 @@
|
|
|
97
97
|
},
|
|
98
98
|
"devDependencies": {
|
|
99
99
|
"@codemirror/lang-json": "^6.0.2",
|
|
100
|
-
"@codemirror/state": "^6.7.
|
|
100
|
+
"@codemirror/state": "^6.7.1",
|
|
101
101
|
"@codemirror/theme-one-dark": "^6.1.3",
|
|
102
|
-
"@codemirror/view": "^6.43.
|
|
102
|
+
"@codemirror/view": "^6.43.6",
|
|
103
103
|
"@iconify-json/heroicons": "^1.2.3",
|
|
104
104
|
"@iconify-json/lucide": "^1.2.116",
|
|
105
|
-
"@iconify-json/simple-icons": "^1.2.
|
|
105
|
+
"@iconify-json/simple-icons": "^1.2.89",
|
|
106
106
|
"@nuxt/devtools": "4.0.0-alpha.7",
|
|
107
107
|
"@nuxt/eslint-config": "^1.16.0",
|
|
108
108
|
"@nuxt/module-builder": "^1.0.2",
|
|
@@ -122,10 +122,10 @@
|
|
|
122
122
|
"unbuild": "^3.6.1",
|
|
123
123
|
"valibot": "^1.4.2",
|
|
124
124
|
"vitepress": "2.0.0-alpha.17",
|
|
125
|
-
"vitest": "^4.1.
|
|
125
|
+
"vitest": "^4.1.10",
|
|
126
126
|
"vue": "^3.5.39",
|
|
127
127
|
"vue-i18n": "^11.4.6",
|
|
128
|
-
"vue-tsc": "^3.3.
|
|
128
|
+
"vue-tsc": "^3.3.7",
|
|
129
129
|
"zod": "^4.4.3"
|
|
130
130
|
},
|
|
131
131
|
"packageManager": "pnpm@11.1.2+sha512.415a1cc25974731e75455c1468371be74c5aa5fb7621b50d4056d222451609f11412f23fd602e6169f1e060466641f798597e1be961a10688836a67b16569499"
|