@sfxcode/formkit-primevue 2.4.18 → 2.4.19

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.
@@ -62,7 +62,8 @@ function handleSave() {
62
62
  }"
63
63
  @submit="handleSave"
64
64
  >
65
- <FormKitSchema :schema="formSchema" :data="formData" />
65
+ <FormKitSchema v-if="formSchema" :schema="formSchema" :data="formData" />
66
+ <slot />
66
67
  </FormKit>
67
68
  <FormKitDebug v-if="debugData" :data="formData" header="Data" />
68
69
  <FormKitDebug v-if="debugSchema" :data="formSchema" header="Schema" />
@@ -38,7 +38,8 @@ const formData = ref(props.data)
38
38
  :form-class="formClass"
39
39
  :actions="false"
40
40
  >
41
- <FormKitSchema :schema="formSchema" :data="formData" />
41
+ <FormKitSchema v-if="formSchema" :schema="formSchema" :data="formData" />
42
+ <slot />
42
43
  </FormKit>
43
44
  <FormKitDebug v-if="debugData" :data="formData" header="Data" />
44
45
  <FormKitDebug v-if="debugSchema" :data="formSchema" header="Schema" />
@@ -21,7 +21,7 @@ const props = defineProps({
21
21
  },
22
22
  })
23
23
 
24
- const { unstyled, isInvalid, handleInput, handleBlur } = useFormKitInput(props.context)
24
+ const { validSlotNames, unstyled, isInvalid, handleInput, handleBlur } = useFormKitInput(props.context)
25
25
 
26
26
  const suggestions = ref([])
27
27
 
@@ -53,6 +53,10 @@ function search(event: AutoCompleteCompleteEvent) {
53
53
  @complete="search"
54
54
  @change="handleInput"
55
55
  @blur="handleBlur"
56
- />
56
+ >
57
+ <template v-for="slotName in validSlotNames" :key="slotName" #[slotName]="slotProps">
58
+ <component :is="context?.slots[slotName]" v-bind="{ ...context, ...slotProps }" />
59
+ </template>
60
+ </AutoComplete>
57
61
  </div>
58
62
  </template>
@@ -25,7 +25,7 @@ const props = defineProps({
25
25
  },
26
26
  })
27
27
 
28
- const { unstyled, isInvalid, handleInput, handleBlur } = useFormKitInput(props.context)
28
+ const { validSlotNames, unstyled, isInvalid, handleInput, handleBlur } = useFormKitInput(props.context)
29
29
  </script>
30
30
 
31
31
  <template>
@@ -52,6 +52,10 @@ const { unstyled, isInvalid, handleInput, handleBlur } = useFormKitInput(props.c
52
52
  :unstyled="unstyled"
53
53
  @change="handleInput"
54
54
  @blur="handleBlur"
55
- />
55
+ >
56
+ <template v-for="slotName in validSlotNames" :key="slotName" #[slotName]="slotProps">
57
+ <component :is="context?.slots[slotName]" v-bind="{ ...context, ...slotProps }" />
58
+ </template>
59
+ </CascadeSelect>
56
60
  </div>
57
61
  </template>
@@ -25,7 +25,7 @@ const props = defineProps({
25
25
 
26
26
  const { hasPrefix, hasSuffix, generateId } = useFormKitSection(props.context)
27
27
 
28
- const { unstyled, isInvalid, handleInput, handleBlur } = useFormKitInput(props.context)
28
+ const { validSlotNames, unstyled, isInvalid, handleInput, handleBlur } = useFormKitInput(props.context)
29
29
 
30
30
  const generatedId = generateId()
31
31
  </script>
@@ -57,7 +57,11 @@ const generatedId = generateId()
57
57
  :unstyled="unstyled"
58
58
  @change="handleInput"
59
59
  @blur="handleBlur"
60
- />
60
+ >
61
+ <template v-for="slotName in validSlotNames" :key="slotName" #[slotName]="slotProps">
62
+ <component :is="context?.slots[slotName]" v-bind="{ ...context, ...slotProps }" />
63
+ </template>
64
+ </Checkbox>
61
65
  <label v-if="hasSuffix" :for="generatedId" class="formkit-suffix">
62
66
  {{ context?.suffix }}
63
67
  </label>
@@ -59,7 +59,7 @@ const props = defineProps({
59
59
  },
60
60
  })
61
61
 
62
- const { unstyled, isInvalid, handleInput, handleSelect } = useFormKitInput(props.context)
62
+ const { validSlotNames, unstyled, isInvalid, handleInput, handleSelect } = useFormKitInput(props.context)
63
63
 
64
64
  function handleBlur(e: DatePickerBlurEvent) {
65
65
  props.context?.handlers.blur(e.originalEvent)
@@ -132,6 +132,10 @@ function handleClearClick() {
132
132
  @input="handleInput"
133
133
  @blur="handleBlur"
134
134
  @clear-click="handleClearClick"
135
- />
135
+ >
136
+ <template v-for="slotName in validSlotNames" :key="slotName" #[slotName]="slotProps">
137
+ <component :is="context?.slots[slotName]" v-bind="{ ...context, ...slotProps }" />
138
+ </template>
139
+ </DatePicker>
136
140
  </div>
137
141
  </template>
@@ -34,7 +34,7 @@ const props = defineProps({
34
34
  },
35
35
  })
36
36
 
37
- const { unstyled, isInvalid } = useFormKitInput(props.context)
37
+ const { validSlotNames, unstyled, isInvalid } = useFormKitInput(props.context)
38
38
 
39
39
  function handleBlur(e: InputNumberBlurEvent) {
40
40
  props.context?.handlers.blur(e.originalEvent)
@@ -99,6 +99,10 @@ watch(
99
99
  :unstyled="unstyled"
100
100
  @input="handleInput"
101
101
  @blur="handleBlur"
102
- />
102
+ >
103
+ <template v-for="slotName in validSlotNames" :key="slotName" #[slotName]="slotProps">
104
+ <component :is="context?.slots[slotName]" v-bind="{ ...context, ...slotProps }" />
105
+ </template>
106
+ </InputNumber>
103
107
  </div>
104
108
  </template>
@@ -23,7 +23,7 @@ const props = defineProps({
23
23
  },
24
24
  })
25
25
 
26
- const { unstyled, isInvalid, handleBlur, handleInput } = useFormKitInput(props.context)
26
+ const { validSlotNames, unstyled, isInvalid, handleBlur, handleInput } = useFormKitInput(props.context)
27
27
  </script>
28
28
 
29
29
  <template>
@@ -49,6 +49,10 @@ const { unstyled, isInvalid, handleBlur, handleInput } = useFormKitInput(props.c
49
49
  :unstyled="unstyled"
50
50
  @change="handleInput"
51
51
  @blur="handleBlur"
52
- />
52
+ >
53
+ <template v-for="slotName in validSlotNames" :key="slotName" #[slotName]="slotProps">
54
+ <component :is="context?.slots[slotName]" v-bind="{ ...context, ...slotProps }" />
55
+ </template>
56
+ </InputOtp>
53
57
  </div>
54
58
  </template>
@@ -30,7 +30,7 @@ const props = defineProps({
30
30
  },
31
31
  })
32
32
 
33
- const { unstyled, isInvalid, handleInput, handleBlur } = useFormKitInput(props.context)
33
+ const { validSlotNames, unstyled, isInvalid, handleInput, handleBlur } = useFormKitInput(props.context)
34
34
  </script>
35
35
 
36
36
  <template>
@@ -63,6 +63,10 @@ const { unstyled, isInvalid, handleInput, handleBlur } = useFormKitInput(props.c
63
63
  :unstyled="unstyled"
64
64
  @change="handleInput"
65
65
  @blur="handleBlur"
66
- />
66
+ >
67
+ <template v-for="slotName in validSlotNames" :key="slotName" #[slotName]="slotProps">
68
+ <component :is="context?.slots[slotName]" v-bind="{ ...context, ...slotProps }" />
69
+ </template>
70
+ </Listbox>
67
71
  </div>
68
72
  </template>
@@ -51,7 +51,7 @@ const props = defineProps({
51
51
  },
52
52
  })
53
53
 
54
- const { unstyled, isInvalid, handleBlur, handleChange } = useFormKitInput(props.context)
54
+ const { validSlotNames, unstyled, isInvalid, handleBlur, handleChange } = useFormKitInput(props.context)
55
55
  </script>
56
56
 
57
57
  <template>
@@ -105,6 +105,10 @@ const { unstyled, isInvalid, handleBlur, handleChange } = useFormKitInput(props.
105
105
  :unstyled="unstyled"
106
106
  @change="handleChange"
107
107
  @blur="handleBlur"
108
- />
108
+ >
109
+ <template v-for="slotName in validSlotNames" :key="slotName" #[slotName]="slotProps">
110
+ <component :is="context?.slots[slotName]" v-bind="{ ...context, ...slotProps }" />
111
+ </template>
112
+ </MultiSelect>
109
113
  </div>
110
114
  </template>
@@ -30,7 +30,7 @@ const props = defineProps({
30
30
  },
31
31
  })
32
32
 
33
- const { unstyled, isInvalid, handleInput, handleBlur } = useFormKitInput(props.context)
33
+ const { validSlotNames, unstyled, isInvalid, handleInput, handleBlur } = useFormKitInput(props.context)
34
34
  </script>
35
35
 
36
36
  <template>
@@ -63,6 +63,10 @@ const { unstyled, isInvalid, handleInput, handleBlur } = useFormKitInput(props.c
63
63
  :unstyled="unstyled"
64
64
  @input="handleInput"
65
65
  @blur="handleBlur"
66
- />
66
+ >
67
+ <template v-for="slotName in validSlotNames" :key="slotName" #[slotName]="slotProps">
68
+ <component :is="context?.slots[slotName]" v-bind="{ ...context, ...slotProps }" />
69
+ </template>
70
+ </Password>
67
71
  </div>
68
72
  </template>
@@ -22,7 +22,7 @@ const props = defineProps({
22
22
  },
23
23
  })
24
24
 
25
- const { unstyled, isInvalid, handleInput, handleBlur } = useFormKitInput(props.context)
25
+ const { validSlotNames, unstyled, isInvalid, handleInput, handleBlur } = useFormKitInput(props.context)
26
26
  </script>
27
27
 
28
28
  <template>
@@ -47,6 +47,10 @@ const { unstyled, isInvalid, handleInput, handleBlur } = useFormKitInput(props.c
47
47
  :unstyled="unstyled"
48
48
  @change="handleInput"
49
49
  @blur="handleBlur"
50
- />
50
+ >
51
+ <template v-for="slotName in validSlotNames" :key="slotName" #[slotName]="slotProps">
52
+ <component :is="context?.slots[slotName]" v-bind="{ ...context, ...slotProps }" />
53
+ </template>
54
+ </Rating>
51
55
  </div>
52
56
  </template>
@@ -47,7 +47,7 @@ const props = defineProps({
47
47
  },
48
48
  })
49
49
 
50
- const { unstyled, isInvalid, handleInput, handleBlur } = useFormKitInput(props.context)
50
+ const { validSlotNames, unstyled, isInvalid, handleInput, handleBlur } = useFormKitInput(props.context)
51
51
  </script>
52
52
 
53
53
  <template>
@@ -102,6 +102,10 @@ const { unstyled, isInvalid, handleInput, handleBlur } = useFormKitInput(props.c
102
102
  :unstyled="unstyled"
103
103
  @change="handleInput"
104
104
  @blur="handleBlur"
105
- />
105
+ >
106
+ <template v-for="slotName in validSlotNames" :key="slotName" #[slotName]="slotProps">
107
+ <component :is="context?.slots[slotName]" v-bind="{ ...context, ...slotProps }" />
108
+ </template>
109
+ </Select>
106
110
  </div>
107
111
  </template>
@@ -25,7 +25,7 @@ const props = defineProps({
25
25
  },
26
26
  })
27
27
 
28
- const { unstyled, isInvalid, handleChange, handleBlur } = useFormKitInput(props.context)
28
+ const { validSlotNames, unstyled, isInvalid, handleChange, handleBlur } = useFormKitInput(props.context)
29
29
  </script>
30
30
 
31
31
  <template>
@@ -53,6 +53,10 @@ const { unstyled, isInvalid, handleChange, handleBlur } = useFormKitInput(props.
53
53
  :unstyled="unstyled"
54
54
  @change="handleChange"
55
55
  @blur="handleBlur"
56
- />
56
+ >
57
+ <template v-for="slotName in validSlotNames" :key="slotName" #[slotName]="slotProps">
58
+ <component :is="context?.slots[slotName]" v-bind="{ ...context, ...slotProps }" />
59
+ </template>
60
+ </SelectButton>
57
61
  </div>
58
62
  </template>
@@ -24,7 +24,7 @@ const props = defineProps({
24
24
  },
25
25
  })
26
26
 
27
- const { unstyled, isInvalid, handleChange, handleBlur } = useFormKitInput(props.context)
27
+ const { validSlotNames, unstyled, isInvalid, handleChange, handleBlur } = useFormKitInput(props.context)
28
28
  </script>
29
29
 
30
30
  <template>
@@ -51,6 +51,10 @@ const { unstyled, isInvalid, handleChange, handleBlur } = useFormKitInput(props.
51
51
  :unstyled="unstyled"
52
52
  @change="handleChange"
53
53
  @blur="handleBlur"
54
- />
54
+ >
55
+ <template v-for="slotName in validSlotNames" :key="slotName" #[slotName]="slotProps">
56
+ <component :is="context?.slots[slotName]" v-bind="{ ...context, ...slotProps }" />
57
+ </template>
58
+ </ToggleButton>
55
59
  </div>
56
60
  </template>
@@ -29,7 +29,7 @@ const props = defineProps({
29
29
  },
30
30
  })
31
31
 
32
- const { unstyled, isInvalid, handleInput, handleBlur } = useFormKitInput(props.context)
32
+ const { validSlotNames, unstyled, isInvalid, handleInput, handleBlur } = useFormKitInput(props.context)
33
33
  </script>
34
34
 
35
35
  <template>
@@ -61,6 +61,10 @@ const { unstyled, isInvalid, handleInput, handleBlur } = useFormKitInput(props.c
61
61
  :unstyled="unstyled"
62
62
  @change="handleInput"
63
63
  @blur="handleBlur"
64
- />
64
+ >
65
+ <template v-for="slotName in validSlotNames" :key="slotName" #[slotName]="slotProps">
66
+ <component :is="context?.slots[slotName]" v-bind="{ ...context, ...slotProps }" />
67
+ </template>
68
+ </TreeSelect>
65
69
  </div>
66
70
  </template>
@@ -1,5 +1,6 @@
1
1
  export declare function useFormKitInput(context: any): {
2
2
  isInvalid: import("vue").ComputedRef<any>;
3
+ validSlotNames: import("vue").ComputedRef<string[]>;
3
4
  styleClass: import("vue").ComputedRef<any>;
4
5
  unstyled: import("vue").ComputedRef<any>;
5
6
  handleBlur: (event: Event) => void;
@@ -24,6 +24,8 @@ function useFormKitInput(context) {
24
24
  const unstyled = (0, _vue.computed)(() => {
25
25
  return context?.unstyled ?? isGlobalUnstyledMode();
26
26
  });
27
+ const formKitCreateInputSlots = /* @__PURE__ */new Set(["label", "help", "messages", "message", "input"]);
28
+ const validSlotNames = (0, _vue.computed)(() => Object.keys(context?.slots).filter(slotName => !formKitCreateInputSlots.has(slotName)));
27
29
  function handleBlur(event) {
28
30
  context?.handlers.blur(event);
29
31
  }
@@ -38,6 +40,7 @@ function useFormKitInput(context) {
38
40
  }
39
41
  return {
40
42
  isInvalid,
43
+ validSlotNames,
41
44
  styleClass,
42
45
  unstyled,
43
46
  handleBlur,
@@ -19,6 +19,10 @@ export function useFormKitInput(context) {
19
19
  const unstyled = computed(() => {
20
20
  return context?.unstyled ?? isGlobalUnstyledMode();
21
21
  });
22
+ const formKitCreateInputSlots = /* @__PURE__ */ new Set(["label", "help", "messages", "message", "input"]);
23
+ const validSlotNames = computed(
24
+ () => Object.keys(context?.slots).filter((slotName) => !formKitCreateInputSlots.has(slotName))
25
+ );
22
26
  function handleBlur(event) {
23
27
  context?.handlers.blur(event);
24
28
  }
@@ -31,5 +35,5 @@ export function useFormKitInput(context) {
31
35
  function handleSelect(e) {
32
36
  context?.node.input(e);
33
37
  }
34
- return { isInvalid, styleClass, unstyled, handleBlur, handleChange, handleInput, handleSelect };
38
+ return { isInvalid, validSlotNames, styleClass, unstyled, handleBlur, handleChange, handleInput, handleSelect };
35
39
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@sfxcode/formkit-primevue",
3
3
  "type": "module",
4
- "version": "2.4.18",
4
+ "version": "2.4.19",
5
5
  "packageManager": "pnpm@9.11.0+sha256.1c0e33f70e5df9eede84a357bdfa0b1f9dba6e58194628d48a1055756f553754",
6
6
  "author": {
7
7
  "name": "Tom",
@@ -93,21 +93,22 @@
93
93
  "@formkit/vue": "^1.6.7",
94
94
  "primeicons": "^7.0.0",
95
95
  "primevue": "4.0.7",
96
+ "quill": "^2.0.2",
96
97
  "uuid": "^10.0.0",
97
- "vue-i18n": "9.14.0"
98
+ "vue-i18n": "10.0.3"
98
99
  },
99
100
  "devDependencies": {
100
- "@antfu/eslint-config": "3.6.2",
101
+ "@antfu/eslint-config": "3.7.3",
101
102
  "@formkit/core": "^1.6.7",
102
103
  "@primevue/themes": "4.0.7",
103
- "@types/node": "^22.7.3",
104
- "@unocss/preset-icons": "^0.62.4",
105
- "@unocss/preset-uno": "^0.62.4",
104
+ "@types/node": "^22.7.4",
105
+ "@unocss/preset-icons": "^0.63.0",
106
+ "@unocss/preset-uno": "^0.63.0",
106
107
  "@vitejs/plugin-vue": "^5.1.4",
107
108
  "@vitest/coverage-v8": "^2.1.1",
108
109
  "@vitest/ui": "^2.1.1",
109
- "@vue/compiler-sfc": "^3.5.9",
110
- "@vue/server-renderer": "^3.5.9",
110
+ "@vue/compiler-sfc": "^3.5.10",
111
+ "@vue/server-renderer": "^3.5.10",
111
112
  "@vue/test-utils": "^2.4.6",
112
113
  "@vue/tsconfig": "^0.5.1",
113
114
  "@vuedx/typecheck": "~0.7.6",
@@ -119,25 +120,25 @@
119
120
  "consola": "^3.2.3",
120
121
  "eslint": "^9.11.1",
121
122
  "happy-dom": "^15.7.4",
122
- "json-editor-vue": "^0.16.0",
123
+ "json-editor-vue": "^0.17.0",
123
124
  "mkdist": "^1.5.9",
124
125
  "quill": "^2.0.2",
125
126
  "sass": "1.78.0",
126
127
  "tslib": "^2.7.0",
127
128
  "typescript": "^5.6.2",
128
129
  "unbuild": "3.0.0-rc.8",
129
- "unocss": "^0.62.4",
130
+ "unocss": "^0.63.0",
130
131
  "unplugin-auto-import": "^0.18.3",
131
132
  "unplugin-vue-components": "^0.27.4",
132
- "vanilla-jsoneditor": "^0.23.8",
133
+ "vanilla-jsoneditor": "^1.0.4",
133
134
  "vite": "^5.4.8",
134
- "vite-plugin-dts": "4.2.1",
135
+ "vite-plugin-dts": "4.2.2",
135
136
  "vite-plugin-eslint": "^1.8.1",
136
137
  "vite-plugin-pages": "^0.32.3",
137
138
  "vite-ssg": "^0.23.8",
138
139
  "vitepress": "^1.3.4",
139
140
  "vitest": "^2.1.1",
140
- "vue": "^3.5.9",
141
+ "vue": "^3.5.10",
141
142
  "vue-demi": "^0.14.10",
142
143
  "vue-router": "^4.4.5",
143
144
  "vue-tsc": "^2.1.6"