@sfxcode/nuxt-ui-formkit 1.2.5 → 1.2.7

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.
Files changed (50) hide show
  1. package/README.md +4 -1
  2. package/dist/module.json +1 -1
  3. package/dist/runtime/components/FUAutoForm.d.vue.ts +3 -3
  4. package/dist/runtime/components/FUAutoForm.vue +6 -3
  5. package/dist/runtime/components/FUAutoForm.vue.d.ts +3 -3
  6. package/dist/runtime/components/FUAutoFormOverlay.d.vue.ts +1 -1
  7. package/dist/runtime/components/FUAutoFormOverlay.vue.d.ts +1 -1
  8. package/dist/runtime/components/inputs/FUCheckbox.d.vue.ts +1 -0
  9. package/dist/runtime/components/inputs/FUCheckbox.vue +1 -0
  10. package/dist/runtime/components/inputs/FUCheckbox.vue.d.ts +1 -0
  11. package/dist/runtime/components/inputs/FUCheckboxGroup.vue +1 -1
  12. package/dist/runtime/components/inputs/FUFileUpload.vue +1 -1
  13. package/dist/runtime/components/inputs/FUInputMenu.d.vue.ts +1 -0
  14. package/dist/runtime/components/inputs/FUInputMenu.vue +1 -0
  15. package/dist/runtime/components/inputs/FUInputMenu.vue.d.ts +1 -0
  16. package/dist/runtime/components/inputs/FUInputRating.d.vue.ts +30 -0
  17. package/dist/runtime/components/inputs/FUInputRating.vue +48 -0
  18. package/dist/runtime/components/inputs/FUInputRating.vue.d.ts +30 -0
  19. package/dist/runtime/components/inputs/FUListbox.d.vue.ts +1 -0
  20. package/dist/runtime/components/inputs/FUListbox.vue +3 -0
  21. package/dist/runtime/components/inputs/FUListbox.vue.d.ts +1 -0
  22. package/dist/runtime/components/inputs/FUPinInput.d.vue.ts +1 -0
  23. package/dist/runtime/components/inputs/FUPinInput.vue +1 -0
  24. package/dist/runtime/components/inputs/FUPinInput.vue.d.ts +1 -0
  25. package/dist/runtime/components/inputs/FURadioGroup.vue +1 -1
  26. package/dist/runtime/components/inputs/FUSelect.d.vue.ts +1 -0
  27. package/dist/runtime/components/inputs/FUSelect.vue +1 -0
  28. package/dist/runtime/components/inputs/FUSelect.vue.d.ts +1 -0
  29. package/dist/runtime/components/inputs/FUSelectMenu.d.vue.ts +1 -0
  30. package/dist/runtime/components/inputs/FUSelectMenu.vue +1 -0
  31. package/dist/runtime/components/inputs/FUSelectMenu.vue.d.ts +1 -0
  32. package/dist/runtime/components/inputs/FUSlider.vue +1 -1
  33. package/dist/runtime/components/inputs/FUSwitch.d.vue.ts +1 -0
  34. package/dist/runtime/components/inputs/FUSwitch.vue +1 -0
  35. package/dist/runtime/components/inputs/FUSwitch.vue.d.ts +1 -0
  36. package/dist/runtime/components/inputs/FUTree.d.vue.ts +36 -0
  37. package/dist/runtime/components/inputs/FUTree.vue +52 -0
  38. package/dist/runtime/components/inputs/FUTree.vue.d.ts +36 -0
  39. package/dist/runtime/composables/useFormKitAutoForm.d.ts +2 -0
  40. package/dist/runtime/composables/useFormKitAutoForm.js +86 -1
  41. package/dist/runtime/formkit/definitions/index.d.ts +2 -0
  42. package/dist/runtime/formkit/definitions/index.js +3 -1
  43. package/dist/runtime/formkit/definitions/index.mjs +3 -1
  44. package/dist/runtime/formkit/definitions/input.d.ts +2 -0
  45. package/dist/runtime/formkit/definitions/input.js +17 -7
  46. package/dist/runtime/formkit/definitions/input.mjs +17 -7
  47. package/dist/runtime/formkit/definitions/multiStep.js +8 -4
  48. package/dist/runtime/formkit/definitions/multiStep.mjs +8 -4
  49. package/dist/runtime/formkit/index.d.ts +9 -1
  50. package/package.json +8 -8
package/README.md CHANGED
@@ -18,7 +18,7 @@ FormKit Nuxt UI bridges the gap between [FormKit](https://formkit.com/)'s powerf
18
18
 
19
19
  ## Features
20
20
 
21
- ✨ **20 Input Components** - Complete set of FormKit-wrapped Nuxt UI input components
21
+ ✨ **22 Input Components** - Complete set of FormKit-wrapped Nuxt UI input components
22
22
  - `nuxtUICalendar` - Bare date-grid picker with range/multiple selection
23
23
  - `nuxtUICheckbox` - Single checkbox with label and description
24
24
  - `nuxtUICheckboxGroup` - Multiple checkbox selection
@@ -29,6 +29,7 @@ FormKit Nuxt UI bridges the gap between [FormKit](https://formkit.com/)'s powerf
29
29
  - `nuxtUIInputDate` - Date and time picker with range support
30
30
  - `nuxtUIInputMenu` - Dropdown menu with searchable options
31
31
  - `nuxtUIInputNumber` - Number input with increment/decrement buttons
32
+ - `nuxtUIInputRating` - Star-based rating input for numeric values
32
33
  - `nuxtUIInputTags` - Tag input with custom delimiters
33
34
  - `nuxtUIInputTime` - Time picker with 12/24-hour format
34
35
  - `nuxtUIListbox` - Listbox for single/multiple selection with filtering (for use with transfer mode lucide icons must be installed additionally)
@@ -39,6 +40,7 @@ FormKit Nuxt UI bridges the gap between [FormKit](https://formkit.com/)'s powerf
39
40
  - `nuxtUISlider` - Range slider for numeric values
40
41
  - `nuxtUISwitch` - Toggle switch for boolean states
41
42
  - `nuxtUITextarea` - Multi-line text input with autoresize
43
+ - `nuxtUITree` - Hierarchical selection input (categories, org charts, file trees)
42
44
 
43
45
  🔁 **Repeater Component** - Dynamic repeatable form sections
44
46
  - `nuxtUIRepeater` - Create dynamic lists with add, remove, clone, and reorder functionality
@@ -314,6 +316,7 @@ The playground includes comprehensive examples for all components:
314
316
  - [InputDate](./playground/app/pages/components/input/input-date.vue)
315
317
  - [InputMenu](./playground/app/pages/components/input/input-menu.vue)
316
318
  - [InputNumber](./playground/app/pages/components/input/input-number.vue)
319
+ - [InputRating](./playground/app/pages/components/input/input-rating.vue)
317
320
  - [InputTags](./playground/app/pages/components/input/input-tags.vue)
318
321
  - [InputTime](./playground/app/pages/components/input/input-time.vue)
319
322
  - [Listbox](./playground/app/pages/components/input/listbox.vue)
package/dist/module.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "compatibility": {
5
5
  "nuxt": ">=4.0.0"
6
6
  },
7
- "version": "1.2.5",
7
+ "version": "1.2.7",
8
8
  "builder": {
9
9
  "@nuxt/module-builder": "1.0.2",
10
10
  "unbuild": "3.6.1"
@@ -6,7 +6,7 @@ type __VLS_Slots = {} & {
6
6
  };
7
7
  declare const __VLS_base: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
8
8
  data: {
9
- type: PropType<Record<string, unknown>>;
9
+ type: PropType<Record<string, unknown> | Record<string, unknown>[]>;
10
10
  default: null;
11
11
  };
12
12
  overrides: {
@@ -28,7 +28,7 @@ declare const __VLS_base: import("vue").DefineComponent<import("vue").ExtractPro
28
28
  "update:modelValue": (value: Record<string, unknown> | undefined) => any;
29
29
  }, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
30
30
  data: {
31
- type: PropType<Record<string, unknown>>;
31
+ type: PropType<Record<string, unknown> | Record<string, unknown>[]>;
32
32
  default: null;
33
33
  };
34
34
  overrides: {
@@ -49,7 +49,7 @@ declare const __VLS_base: import("vue").DefineComponent<import("vue").ExtractPro
49
49
  }>> & Readonly<{
50
50
  "onUpdate:modelValue"?: ((value: Record<string, unknown> | undefined) => any) | undefined;
51
51
  }>, {
52
- data: Record<string, unknown>;
52
+ data: Record<string, unknown> | Record<string, unknown>[];
53
53
  overrides: AutoFormOverrides;
54
54
  valibotSchema: ValibotLikeSchema;
55
55
  zodSchema: ZodLikeSchema;
@@ -1,11 +1,11 @@
1
1
  <script setup>
2
2
  import { ref, watch } from "vue";
3
- import { inferFormSchema, inferFormSchemaFromValibot, inferFormSchemaFromZod } from "../composables/useFormKitAutoForm";
3
+ import { inferFormSchema, inferFormSchemaFromSamples, inferFormSchemaFromValibot, inferFormSchemaFromZod } from "../composables/useFormKitAutoForm";
4
4
  import FUDataEdit from "./FUDataEdit.vue";
5
5
  defineOptions({ inheritAttrs: false });
6
6
  const props = defineProps({
7
7
  data: {
8
- type: Object,
8
+ type: [Object, Array],
9
9
  default: null
10
10
  },
11
11
  overrides: {
@@ -22,7 +22,7 @@ const props = defineProps({
22
22
  }
23
23
  });
24
24
  const formData = defineModel({ type: Object });
25
- if (!formData.value && props.data) {
25
+ if (!formData.value && props.data && !Array.isArray(props.data)) {
26
26
  formData.value = props.data;
27
27
  }
28
28
  function buildSchema(data) {
@@ -32,6 +32,9 @@ function buildSchema(data) {
32
32
  if (props.zodSchema) {
33
33
  return inferFormSchemaFromZod(props.zodSchema, props.overrides);
34
34
  }
35
+ if (Array.isArray(data)) {
36
+ return inferFormSchemaFromSamples(data, props.overrides);
37
+ }
35
38
  return inferFormSchema(data ?? formData.value ?? {}, props.overrides);
36
39
  }
37
40
  const formSchema = ref(buildSchema(props.data));
@@ -6,7 +6,7 @@ type __VLS_Slots = {} & {
6
6
  };
7
7
  declare const __VLS_base: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
8
8
  data: {
9
- type: PropType<Record<string, unknown>>;
9
+ type: PropType<Record<string, unknown> | Record<string, unknown>[]>;
10
10
  default: null;
11
11
  };
12
12
  overrides: {
@@ -28,7 +28,7 @@ declare const __VLS_base: import("vue").DefineComponent<import("vue").ExtractPro
28
28
  "update:modelValue": (value: Record<string, unknown> | undefined) => any;
29
29
  }, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
30
30
  data: {
31
- type: PropType<Record<string, unknown>>;
31
+ type: PropType<Record<string, unknown> | Record<string, unknown>[]>;
32
32
  default: null;
33
33
  };
34
34
  overrides: {
@@ -49,7 +49,7 @@ declare const __VLS_base: import("vue").DefineComponent<import("vue").ExtractPro
49
49
  }>> & Readonly<{
50
50
  "onUpdate:modelValue"?: ((value: Record<string, unknown> | undefined) => any) | undefined;
51
51
  }>, {
52
- data: Record<string, unknown>;
52
+ data: Record<string, unknown> | Record<string, unknown>[];
53
53
  overrides: AutoFormOverrides;
54
54
  valibotSchema: ValibotLikeSchema;
55
55
  zodSchema: ZodLikeSchema;
@@ -73,10 +73,10 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
73
73
  }>, {
74
74
  data: Record<string, any>;
75
75
  title: string;
76
- as: "modal" | "slideover";
77
76
  overrides: AutoFormOverrides;
78
77
  valibotSchema: ValibotLikeSchema;
79
78
  zodSchema: ZodLikeSchema;
79
+ as: "modal" | "slideover";
80
80
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
81
81
  declare const _default: typeof __VLS_export;
82
82
  export default _default;
@@ -73,10 +73,10 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
73
73
  }>, {
74
74
  data: Record<string, any>;
75
75
  title: string;
76
- as: "modal" | "slideover";
77
76
  overrides: AutoFormOverrides;
78
77
  valibotSchema: ValibotLikeSchema;
79
78
  zodSchema: ZodLikeSchema;
79
+ as: "modal" | "slideover";
80
80
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
81
81
  declare const _default: typeof __VLS_export;
82
82
  export default _default;
@@ -12,6 +12,7 @@ export interface FormKitCheckboxProps {
12
12
  trueValue?: unknown;
13
13
  falseValue?: unknown;
14
14
  autofocus?: false | true | 'true' | 'false';
15
+ name?: string;
15
16
  ui?: Record<string, unknown>;
16
17
  }
17
18
  declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
@@ -13,6 +13,7 @@ const { handleInput, handleChange, handleBlur, styleClass, modelValue, color, va
13
13
  <UCheckbox
14
14
  :id="context.id"
15
15
  v-model="modelValue"
16
+ :name="context.node.name"
16
17
  v-bind="{ ...context?.attrs }"
17
18
  :class="styleClass"
18
19
  :disabled="!!context?.disabled"
@@ -12,6 +12,7 @@ export interface FormKitCheckboxProps {
12
12
  trueValue?: unknown;
13
13
  falseValue?: unknown;
14
14
  autofocus?: false | true | 'true' | 'false';
15
+ name?: string;
15
16
  ui?: Record<string, unknown>;
16
17
  }
17
18
  declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
@@ -30,7 +30,7 @@ const handleContainerBlur = createContainerBlurHandler(props.context);
30
30
  :label-key="context.labelKey"
31
31
  :description-key="context.descriptionKey"
32
32
  :loop="context.loop ?? false"
33
- :name="context.name"
33
+ :name="context.node.name"
34
34
  :ui="ui"
35
35
  @change="handleChange"
36
36
  @update:model-value="handleInput"
@@ -37,7 +37,7 @@ const { handleInput, handleChange, handleBlur, isInvalid, styleClass, color, mod
37
37
  :file-delete="context.fileDelete"
38
38
  :file-delete-icon="context.fileDeleteIcon"
39
39
  :preview="context.preview"
40
- :name="context.name"
40
+ :name="context.node.name"
41
41
  :ui="ui"
42
42
  @change="handleChange"
43
43
  @update:model-value="handleInput"
@@ -60,6 +60,7 @@ export interface FormKitInputMenuProps {
60
60
  list?: string;
61
61
  autocomplete?: string & {} | 'on' | 'off';
62
62
  searchTerm?: string;
63
+ name?: string;
63
64
  ui?: Record<string, unknown>;
64
65
  }
65
66
  declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
@@ -13,6 +13,7 @@ const { handleInput, handleChange, handleBlur, isInvalid, styleClass, color, mod
13
13
  <UInputMenu
14
14
  :id="context.id"
15
15
  v-model="modelValue"
16
+ :name="context.node.name"
16
17
  v-bind="{ ...context?.attrs }"
17
18
  :class="styleClass"
18
19
  :disabled="!!context?.disabled"
@@ -60,6 +60,7 @@ export interface FormKitInputMenuProps {
60
60
  list?: string;
61
61
  autocomplete?: string & {} | 'on' | 'off';
62
62
  searchTerm?: string;
63
+ name?: string;
63
64
  ui?: Record<string, unknown>;
64
65
  }
65
66
  declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
@@ -0,0 +1,30 @@
1
+ import type { FormKitFrameworkContext } from '@formkit/core';
2
+ import type { PropType } from 'vue';
3
+ export interface FormKitInputRatingProps {
4
+ color?: 'primary' | 'secondary' | 'success' | 'info' | 'warning' | 'error' | 'neutral';
5
+ size?: 'xs' | 'sm' | 'md' | 'lg' | 'xl';
6
+ orientation?: 'horizontal' | 'vertical';
7
+ icon?: string;
8
+ emptyIcon?: string;
9
+ readonly?: boolean;
10
+ clearable?: boolean;
11
+ hoverable?: boolean;
12
+ length?: number;
13
+ step?: number;
14
+ defaultValue?: number;
15
+ name?: string;
16
+ ui?: Record<string, unknown>;
17
+ }
18
+ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
19
+ context: {
20
+ type: PropType<FormKitFrameworkContext & FormKitInputRatingProps>;
21
+ required: true;
22
+ };
23
+ }>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
24
+ context: {
25
+ type: PropType<FormKitFrameworkContext & FormKitInputRatingProps>;
26
+ required: true;
27
+ };
28
+ }>> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
29
+ declare const _default: typeof __VLS_export;
30
+ export default _default;
@@ -0,0 +1,48 @@
1
+ <script setup>
2
+ import { useFormKitInput } from "../../utils/useFormKitInput";
3
+ const props = defineProps({
4
+ context: {
5
+ type: Object,
6
+ required: true
7
+ }
8
+ });
9
+ const { handleInput, handleChange, handleBlur, styleClass, color, modelValue, validSlotNames, ui } = useFormKitInput(props.context);
10
+ </script>
11
+
12
+ <template>
13
+ <UInputRating
14
+ :id="context.id"
15
+ v-model="modelValue"
16
+ :name="context.node.name"
17
+ v-bind="{ ...context?.attrs }"
18
+ :class="styleClass"
19
+ :disabled="!!context?.disabled"
20
+ :style="context?.attrs.style"
21
+ :color="color"
22
+ :size="context.size ?? 'md'"
23
+ :orientation="context.orientation ?? 'horizontal'"
24
+ :icon="context.icon"
25
+ :empty-icon="context.emptyIcon"
26
+ :readonly="context.readonly"
27
+ :clearable="context.clearable"
28
+ :hoverable="context.hoverable"
29
+ :length="context.length ?? 5"
30
+ :step="context.step"
31
+ :default-value="context.defaultValue"
32
+ :ui="ui"
33
+ @change="handleChange"
34
+ @update:model-value="handleInput"
35
+ @blur="handleBlur"
36
+ >
37
+ <template
38
+ v-for="slotName in validSlotNames"
39
+ :key="slotName"
40
+ #[slotName]="slotProps"
41
+ >
42
+ <component
43
+ :is="context?.slots[slotName]"
44
+ v-bind="{ ...context, ...slotProps }"
45
+ />
46
+ </template>
47
+ </UInputRating>
48
+ </template>
@@ -0,0 +1,30 @@
1
+ import type { FormKitFrameworkContext } from '@formkit/core';
2
+ import type { PropType } from 'vue';
3
+ export interface FormKitInputRatingProps {
4
+ color?: 'primary' | 'secondary' | 'success' | 'info' | 'warning' | 'error' | 'neutral';
5
+ size?: 'xs' | 'sm' | 'md' | 'lg' | 'xl';
6
+ orientation?: 'horizontal' | 'vertical';
7
+ icon?: string;
8
+ emptyIcon?: string;
9
+ readonly?: boolean;
10
+ clearable?: boolean;
11
+ hoverable?: boolean;
12
+ length?: number;
13
+ step?: number;
14
+ defaultValue?: number;
15
+ name?: string;
16
+ ui?: Record<string, unknown>;
17
+ }
18
+ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
19
+ context: {
20
+ type: PropType<FormKitFrameworkContext & FormKitInputRatingProps>;
21
+ required: true;
22
+ };
23
+ }>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
24
+ context: {
25
+ type: PropType<FormKitFrameworkContext & FormKitInputRatingProps>;
26
+ required: true;
27
+ };
28
+ }>> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
29
+ declare const _default: typeof __VLS_export;
30
+ export default _default;
@@ -49,6 +49,7 @@ export interface FormKitListboxProps {
49
49
  autofocus?: boolean;
50
50
  autofocusDelay?: number;
51
51
  searchTerm?: string;
52
+ name?: string;
52
53
  ui?: Record<string, unknown>;
53
54
  }
54
55
  declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
@@ -212,6 +212,7 @@ watch(targetItems, (newVal) => {
212
212
  v-if="!context.displayMode || context.displayMode === 'single'"
213
213
  :id="context.id"
214
214
  v-model="modelValue"
215
+ :name="context.node.name"
215
216
  v-bind="{ ...context?.attrs }"
216
217
  :class="styleClass"
217
218
  :style="context?.attrs.style"
@@ -278,6 +279,7 @@ watch(targetItems, (newVal) => {
278
279
  <UListbox
279
280
  :id="context.id + '-transfer-left'"
280
281
  v-model="sourceSelection"
282
+ :name="context.node.name + '-transfer-left'"
281
283
  v-bind="{ ...context?.attrs }"
282
284
  :class="styleClass"
283
285
  :style="context?.attrs.style"
@@ -380,6 +382,7 @@ watch(targetItems, (newVal) => {
380
382
  <UListbox
381
383
  :id="context.id + '-transfer-right'"
382
384
  v-model="targetSelection"
385
+ :name="context.node.name + '-transfer-right'"
383
386
  v-bind="{ ...context?.attrs }"
384
387
  :class="styleClass"
385
388
  :style="context?.attrs.style"
@@ -49,6 +49,7 @@ export interface FormKitListboxProps {
49
49
  autofocus?: boolean;
50
50
  autofocusDelay?: number;
51
51
  searchTerm?: string;
52
+ name?: string;
52
53
  ui?: Record<string, unknown>;
53
54
  }
54
55
  declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
@@ -15,6 +15,7 @@ export interface FormKitPinInputProps {
15
15
  separator?: number | number[];
16
16
  type?: 'text' | 'number';
17
17
  placeholder?: string;
18
+ name?: string;
18
19
  ui?: Record<string, unknown>;
19
20
  }
20
21
  declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
@@ -18,6 +18,7 @@ function handlePinBlur(event) {
18
18
  <UPinInput
19
19
  :id="context.id"
20
20
  v-model="modelValue"
21
+ :name="context.node.name"
21
22
  v-bind="{ ...context?.attrs }"
22
23
  :default-value="context.defaultValue"
23
24
  :class="styleClass"
@@ -15,6 +15,7 @@ export interface FormKitPinInputProps {
15
15
  separator?: number | number[];
16
16
  type?: 'text' | 'number';
17
17
  placeholder?: string;
18
+ name?: string;
18
19
  ui?: Record<string, unknown>;
19
20
  }
20
21
  declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
@@ -29,7 +29,7 @@ const handleContainerBlur = createContainerBlurHandler(props.context);
29
29
  :label-key="context.labelKey"
30
30
  :description-key="context.descriptionKey"
31
31
  :loop="context.loop ?? false"
32
- :name="context.name"
32
+ :name="context.node.name"
33
33
  :ui="ui"
34
34
  @change="handleChange"
35
35
  @update:model-value="handleInput"
@@ -32,6 +32,7 @@ export interface FormKitSelectProps {
32
32
  trailingIcon?: string;
33
33
  loading?: boolean;
34
34
  loadingIcon?: string;
35
+ name?: string;
35
36
  ui?: Record<string, unknown>;
36
37
  }
37
38
  declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
@@ -13,6 +13,7 @@ const { handleInput, handleChange, isInvalid, color, styleClass, modelValue, ite
13
13
  <USelect
14
14
  :id="context.id"
15
15
  v-model="modelValue"
16
+ :name="context.node.name"
16
17
  v-bind="{ ...context?.attrs }"
17
18
  :class="styleClass"
18
19
  :disabled="!!context?.disabled"
@@ -32,6 +32,7 @@ export interface FormKitSelectProps {
32
32
  trailingIcon?: string;
33
33
  loading?: boolean;
34
34
  loadingIcon?: string;
35
+ name?: string;
35
36
  ui?: Record<string, unknown>;
36
37
  }
37
38
  declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
@@ -58,6 +58,7 @@ export interface FormKitSelectMenuProps {
58
58
  resetModelValueOnClear?: boolean;
59
59
  highlightOnHover?: boolean;
60
60
  searchTerm?: string;
61
+ name?: string;
61
62
  ui?: Record<string, unknown>;
62
63
  }
63
64
  declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
@@ -13,6 +13,7 @@ const { handleInput, handleChange, isInvalid, styleClass, color, modelValue, ite
13
13
  <USelectMenu
14
14
  :id="context.id"
15
15
  v-model="modelValue"
16
+ :name="context.node.name"
16
17
  v-bind="{ ...context?.attrs }"
17
18
  :class="styleClass"
18
19
  :disabled="!!context?.disabled"
@@ -58,6 +58,7 @@ export interface FormKitSelectMenuProps {
58
58
  resetModelValueOnClear?: boolean;
59
59
  highlightOnHover?: boolean;
60
60
  searchTerm?: string;
61
+ name?: string;
61
62
  ui?: Record<string, unknown>;
62
63
  }
63
64
  declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
@@ -23,7 +23,7 @@ const { handleInput, handleChange, styleClass, color, modelValue, ui } = useForm
23
23
  :orientation="context.orientation ?? 'horizontal'"
24
24
  :tooltip="context.tooltip"
25
25
  :default-value="context.defaultValue"
26
- :name="context.name"
26
+ :name="context.node.name"
27
27
  :inverted="context.inverted"
28
28
  :min="context.min"
29
29
  :max="context.max"
@@ -13,6 +13,7 @@ export interface FormKitSwitchProps {
13
13
  trueValue?: unknown;
14
14
  falseValue?: unknown;
15
15
  autofocus?: false | true | 'true' | 'false';
16
+ name?: string;
16
17
  ui?: Record<string, unknown>;
17
18
  }
18
19
  declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
@@ -13,6 +13,7 @@ const { handleInput, handleChange, handleBlur, styleClass, color, modelValue, va
13
13
  <USwitch
14
14
  :id="context.id"
15
15
  v-model="modelValue"
16
+ :name="context.node.name"
16
17
  v-bind="{ ...context?.attrs }"
17
18
  :class="styleClass"
18
19
  :disabled="!!context?.disabled"
@@ -13,6 +13,7 @@ export interface FormKitSwitchProps {
13
13
  trueValue?: unknown;
14
14
  falseValue?: unknown;
15
15
  autofocus?: false | true | 'true' | 'false';
16
+ name?: string;
16
17
  ui?: Record<string, unknown>;
17
18
  }
18
19
  declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
@@ -0,0 +1,36 @@
1
+ import type { FormKitFrameworkContext } from '@formkit/core';
2
+ import type { PropType } from 'vue';
3
+ export interface FormKitTreeProps {
4
+ color?: 'primary' | 'secondary' | 'success' | 'info' | 'warning' | 'error' | 'neutral';
5
+ size?: 'xs' | 'sm' | 'md' | 'lg' | 'xl';
6
+ disabled?: boolean;
7
+ multiple?: boolean;
8
+ nested?: boolean;
9
+ virtualize?: boolean | {
10
+ overscan?: number;
11
+ estimateSize?: number | ((index: number) => number);
12
+ };
13
+ labelKey?: string;
14
+ trailingIcon?: string;
15
+ expandedIcon?: string;
16
+ collapsedIcon?: string;
17
+ expanded?: string[];
18
+ defaultExpanded?: string[];
19
+ selectionBehavior?: 'toggle' | 'replace';
20
+ propagateSelect?: boolean;
21
+ bubbleSelect?: boolean;
22
+ ui?: Record<string, unknown>;
23
+ }
24
+ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
25
+ context: {
26
+ type: PropType<FormKitFrameworkContext & FormKitTreeProps>;
27
+ required: true;
28
+ };
29
+ }>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
30
+ context: {
31
+ type: PropType<FormKitFrameworkContext & FormKitTreeProps>;
32
+ required: true;
33
+ };
34
+ }>> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
35
+ declare const _default: typeof __VLS_export;
36
+ export default _default;
@@ -0,0 +1,52 @@
1
+ <script setup>
2
+ import { useFormKitInput } from "../../utils/useFormKitInput";
3
+ import { createContainerBlurHandler } from "../../utils/useFormKitContainerBlur";
4
+ const props = defineProps({
5
+ context: {
6
+ type: Object,
7
+ required: true
8
+ }
9
+ });
10
+ const { handleInput, styleClass, color, modelValue, items, validSlotNames, ui } = useFormKitInput(props.context);
11
+ const handleContainerBlur = createContainerBlurHandler(props.context);
12
+ </script>
13
+
14
+ <template>
15
+ <UTree
16
+ :id="context.id"
17
+ v-model="modelValue"
18
+ v-bind="{ ...context?.attrs }"
19
+ :class="styleClass"
20
+ :style="context?.attrs.style"
21
+ :color="color"
22
+ :size="context.size ?? 'md'"
23
+ :items="items"
24
+ :disabled="!!context?.disabled"
25
+ :multiple="context.multiple"
26
+ :nested="context.nested ?? true"
27
+ :virtualize="context.virtualize"
28
+ :label-key="context.labelKey"
29
+ :trailing-icon="context.trailingIcon"
30
+ :expanded-icon="context.expandedIcon"
31
+ :collapsed-icon="context.collapsedIcon"
32
+ :expanded="context.expanded"
33
+ :default-expanded="context.defaultExpanded"
34
+ :selection-behavior="context.selectionBehavior"
35
+ :propagate-select="context.propagateSelect"
36
+ :bubble-select="context.bubbleSelect"
37
+ :ui="ui"
38
+ @update:model-value="handleInput"
39
+ @focusout="handleContainerBlur"
40
+ >
41
+ <template
42
+ v-for="slotName in validSlotNames"
43
+ :key="slotName"
44
+ #[slotName]="slotProps"
45
+ >
46
+ <component
47
+ :is="context?.slots[slotName]"
48
+ v-bind="{ ...context, ...slotProps }"
49
+ />
50
+ </template>
51
+ </UTree>
52
+ </template>
@@ -0,0 +1,36 @@
1
+ import type { FormKitFrameworkContext } from '@formkit/core';
2
+ import type { PropType } from 'vue';
3
+ export interface FormKitTreeProps {
4
+ color?: 'primary' | 'secondary' | 'success' | 'info' | 'warning' | 'error' | 'neutral';
5
+ size?: 'xs' | 'sm' | 'md' | 'lg' | 'xl';
6
+ disabled?: boolean;
7
+ multiple?: boolean;
8
+ nested?: boolean;
9
+ virtualize?: boolean | {
10
+ overscan?: number;
11
+ estimateSize?: number | ((index: number) => number);
12
+ };
13
+ labelKey?: string;
14
+ trailingIcon?: string;
15
+ expandedIcon?: string;
16
+ collapsedIcon?: string;
17
+ expanded?: string[];
18
+ defaultExpanded?: string[];
19
+ selectionBehavior?: 'toggle' | 'replace';
20
+ propagateSelect?: boolean;
21
+ bubbleSelect?: boolean;
22
+ ui?: Record<string, unknown>;
23
+ }
24
+ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
25
+ context: {
26
+ type: PropType<FormKitFrameworkContext & FormKitTreeProps>;
27
+ required: true;
28
+ };
29
+ }>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
30
+ context: {
31
+ type: PropType<FormKitFrameworkContext & FormKitTreeProps>;
32
+ required: true;
33
+ };
34
+ }>> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
35
+ declare const _default: typeof __VLS_export;
36
+ export default _default;