@sfxcode/nuxt-ui-formkit 1.2.4 → 1.2.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.
Files changed (57) hide show
  1. package/dist/module.json +1 -1
  2. package/dist/runtime/components/FUAutoForm.d.vue.ts +7 -8
  3. package/dist/runtime/components/FUAutoForm.vue +1 -1
  4. package/dist/runtime/components/FUAutoForm.vue.d.ts +7 -8
  5. package/dist/runtime/components/FUAutoFormOverlay.d.vue.ts +1 -1
  6. package/dist/runtime/components/FUAutoFormOverlay.vue.d.ts +1 -1
  7. package/dist/runtime/components/FUDataEdit.d.vue.ts +7 -7
  8. package/dist/runtime/components/FUDataEdit.vue +1 -1
  9. package/dist/runtime/components/FUDataEdit.vue.d.ts +7 -7
  10. package/dist/runtime/components/FUDataView.d.vue.ts +7 -7
  11. package/dist/runtime/components/FUDataView.vue +1 -1
  12. package/dist/runtime/components/FUDataView.vue.d.ts +7 -7
  13. package/dist/runtime/components/inputs/FUCalendar.vue +2 -2
  14. package/dist/runtime/components/inputs/FUCheckbox.vue +2 -2
  15. package/dist/runtime/components/inputs/FUCheckboxGroup.vue +2 -1
  16. package/dist/runtime/components/inputs/FUColorPicker.vue +2 -2
  17. package/dist/runtime/components/inputs/FUEditor.vue +2 -2
  18. package/dist/runtime/components/inputs/FUFileUpload.vue +2 -2
  19. package/dist/runtime/components/inputs/FUInput.vue +2 -2
  20. package/dist/runtime/components/inputs/FUInputDate.vue +2 -2
  21. package/dist/runtime/components/inputs/FUInputMenu.vue +2 -2
  22. package/dist/runtime/components/inputs/FUInputNumber.vue +2 -2
  23. package/dist/runtime/components/inputs/FUInputTags.vue +2 -2
  24. package/dist/runtime/components/inputs/FUInputTime.vue +2 -2
  25. package/dist/runtime/components/inputs/FUListbox.vue +7 -6
  26. package/dist/runtime/components/inputs/FUPinInput.vue +2 -2
  27. package/dist/runtime/components/inputs/FURadioGroup.vue +2 -2
  28. package/dist/runtime/components/inputs/FUSelect.vue +2 -2
  29. package/dist/runtime/components/inputs/FUSelectMenu.vue +2 -2
  30. package/dist/runtime/components/inputs/FUSlider.vue +2 -2
  31. package/dist/runtime/components/inputs/FUSwitch.vue +2 -2
  32. package/dist/runtime/components/inputs/FUTextarea.vue +2 -2
  33. package/dist/runtime/components/output/FUOutputBoolean.d.vue.ts +2 -0
  34. package/dist/runtime/components/output/FUOutputBoolean.vue.d.ts +2 -0
  35. package/dist/runtime/components/output/FUOutputDate.d.vue.ts +2 -0
  36. package/dist/runtime/components/output/FUOutputDate.vue.d.ts +2 -0
  37. package/dist/runtime/components/output/FUOutputLink.d.vue.ts +2 -0
  38. package/dist/runtime/components/output/FUOutputLink.vue.d.ts +2 -0
  39. package/dist/runtime/components/output/FUOutputList.d.vue.ts +2 -0
  40. package/dist/runtime/components/output/FUOutputList.vue +2 -1
  41. package/dist/runtime/components/output/FUOutputList.vue.d.ts +2 -0
  42. package/dist/runtime/components/output/FUOutputNumber.d.vue.ts +2 -0
  43. package/dist/runtime/components/output/FUOutputNumber.vue.d.ts +2 -0
  44. package/dist/runtime/components/output/FUOutputText.d.vue.ts +2 -0
  45. package/dist/runtime/components/output/FUOutputText.vue.d.ts +2 -0
  46. package/dist/runtime/composables/useFormKitRepeater.js +5 -5
  47. package/dist/runtime/composables/useFormKitSchema.d.ts +7 -24
  48. package/dist/runtime/formkit/definitions/output.js +6 -6
  49. package/dist/runtime/formkit/definitions/output.mjs +6 -6
  50. package/dist/runtime/formkit/definitions/repeater.js +4 -0
  51. package/dist/runtime/formkit/definitions/repeater.mjs +4 -0
  52. package/dist/runtime/formkit/index.d.ts +6 -1
  53. package/dist/runtime/utils/useFormKitInput.d.ts +1 -0
  54. package/dist/runtime/utils/useFormKitInput.js +10 -2
  55. package/dist/runtime/utils/useFormKitOutput.d.ts +25 -0
  56. package/dist/runtime/utils/useFormKitOutput.js +21 -5
  57. package/package.json +6 -6
@@ -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
- return context.leadingIcon || context.leading && context.icon || null;
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
- return context.trailingIcon || context.trailing && context.icon || null;
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.4",
3
+ "version": "1.2.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",
@@ -97,12 +97,12 @@
97
97
  },
98
98
  "devDependencies": {
99
99
  "@codemirror/lang-json": "^6.0.2",
100
- "@codemirror/state": "^6.7.0",
100
+ "@codemirror/state": "^6.7.1",
101
101
  "@codemirror/theme-one-dark": "^6.1.3",
102
- "@codemirror/view": "^6.43.4",
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.88",
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.9",
125
+ "vitest": "^4.1.10",
126
126
  "vue": "^3.5.39",
127
127
  "vue-i18n": "^11.4.6",
128
- "vue-tsc": "^3.3.6",
128
+ "vue-tsc": "^3.3.7",
129
129
  "zod": "^4.4.3"
130
130
  },
131
131
  "packageManager": "pnpm@11.1.2+sha512.415a1cc25974731e75455c1468371be74c5aa5fb7621b50d4056d222451609f11412f23fd602e6169f1e060466641f798597e1be961a10688836a67b16569499"