@sfxcode/formkit-nuxt-ui 0.7.3 → 0.7.4

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 CHANGED
@@ -4,7 +4,7 @@
4
4
  "compatibility": {
5
5
  "nuxt": ">=4.0.0"
6
6
  },
7
- "version": "0.7.3",
7
+ "version": "0.7.4",
8
8
  "builder": {
9
9
  "@nuxt/module-builder": "1.0.2",
10
10
  "unbuild": "3.6.1"
@@ -1,8 +1,8 @@
1
1
  import type { FormKitSchemaDefinition } from '@formkit/core';
2
2
  import type { PropType } from 'vue';
3
- declare var __VLS_6: {};
3
+ declare var __VLS_12: {};
4
4
  type __VLS_Slots = {} & {
5
- default?: (props: typeof __VLS_6) => any;
5
+ default?: (props: typeof __VLS_12) => any;
6
6
  };
7
7
  declare const __VLS_base: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
8
8
  data: {
@@ -30,11 +30,19 @@ if (props.data) {
30
30
  </script>
31
31
 
32
32
  <template>
33
- <FormKitSchema
34
- v-if="schema"
35
- :schema="schema"
36
- :data="formData"
37
- />
33
+ <FormKit
34
+ v-model="formData"
35
+ :actions="false"
36
+ :form-class="formClass"
37
+ type="form"
38
+ >
39
+ <FormKitSchema
40
+ v-if="schema"
41
+ :schema="schema"
42
+ :data="formData"
43
+ />
44
+ </FormKit>
45
+
38
46
  <slot />
39
47
  <FuDataDebug
40
48
  v-if="debugData"
@@ -1,8 +1,8 @@
1
1
  import type { FormKitSchemaDefinition } from '@formkit/core';
2
2
  import type { PropType } from 'vue';
3
- declare var __VLS_6: {};
3
+ declare var __VLS_12: {};
4
4
  type __VLS_Slots = {} & {
5
- default?: (props: typeof __VLS_6) => any;
5
+ default?: (props: typeof __VLS_12) => any;
6
6
  };
7
7
  declare const __VLS_base: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
8
8
  data: {
@@ -1,5 +1,5 @@
1
1
  export function addNuxtAsteriskPlugin(node) {
2
- if (!node.props.type.startsWith("nuxtUI") || node.props.type.startsWith("UFOutput"))
2
+ if (!node.props.type.startsWith("nuxtUI") || node.props.type.startsWith("FUOutput"))
3
3
  return;
4
4
  node.on("created", () => {
5
5
  if (node.props.definition?.schema) {
@@ -5,16 +5,16 @@ export function convertColorToHex(color) {
5
5
  if (trimmedColor.startsWith("#")) {
6
6
  return normalizeHex(trimmedColor);
7
7
  }
8
- if (trimmedColor.startsWith("rgb")) {
8
+ if (trimmedColor.toLowerCase().startsWith("rgb")) {
9
9
  return rgbToHex(trimmedColor);
10
10
  }
11
- if (trimmedColor.startsWith("hsl")) {
11
+ if (trimmedColor.toLowerCase().startsWith("hsl")) {
12
12
  return hslToHex(trimmedColor);
13
13
  }
14
- if (trimmedColor.startsWith("cmyk")) {
14
+ if (trimmedColor.toLowerCase().startsWith("cmyk")) {
15
15
  return cmykToHex(trimmedColor);
16
16
  }
17
- if (trimmedColor.startsWith("lab")) {
17
+ if (trimmedColor.toLowerCase().startsWith("lab")) {
18
18
  return labToHex(trimmedColor);
19
19
  }
20
20
  if (/^[\da-f]{3,8}$/i.test(trimmedColor)) {
@@ -23,7 +23,10 @@ export function convertColorToHex(color) {
23
23
  return "#000000";
24
24
  }
25
25
  function normalizeHex(hex) {
26
- const cleaned = hex.replace("#", "");
26
+ const cleaned = hex.replace("#", "").toLowerCase();
27
+ if (!/^[\da-f]+$/i.test(cleaned) || cleaned.length === 0) {
28
+ return "#000000";
29
+ }
27
30
  if (cleaned.length === 3) {
28
31
  return `#${cleaned[0]}${cleaned[0]}${cleaned[1]}${cleaned[1]}${cleaned[2]}${cleaned[2]}`;
29
32
  }
@@ -33,10 +36,16 @@ function normalizeHex(hex) {
33
36
  if (cleaned.length === 8) {
34
37
  return `#${cleaned.substring(0, 6)}`;
35
38
  }
36
- return `#${cleaned.substring(0, 6).padEnd(6, "0")}`;
39
+ if (cleaned.length === 6) {
40
+ return `#${cleaned}`;
41
+ }
42
+ if (cleaned.length < 6) {
43
+ return `#${cleaned.padEnd(6, "0")}`;
44
+ }
45
+ return `#${cleaned.substring(0, 6)}`;
37
46
  }
38
47
  function rgbToHex(rgb) {
39
- const match = rgb.match(/rgba?\((\d+),\s*(\d+),\s*(\d+)(?:,\s*[\d.]+)?\)/);
48
+ const match = rgb.match(/rgba?\((\d+),\s*(\d+),\s*(\d+)(?:,\s*[\d.]+)?\)/i);
40
49
  if (!match)
41
50
  return "#000000";
42
51
  const r = Number.parseInt(match[1], 10);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sfxcode/formkit-nuxt-ui",
3
- "version": "0.7.3",
3
+ "version": "0.7.4",
4
4
  "description": "FormKit integration for Nuxt UI - Seamlessly connect FormKit form handling with Nuxt UI components",
5
5
  "author": {
6
6
  "name": "Tom",