@sfxcode/nuxt-ui-formkit 0.9.1 → 0.10.0
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 +5 -1
- package/dist/module.json +1 -1
- package/dist/runtime/components/inputs/FUListbox.d.vue.ts +63 -0
- package/dist/runtime/components/inputs/FUListbox.vue +230 -0
- package/dist/runtime/components/inputs/FUListbox.vue.d.ts +63 -0
- 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 +5 -0
- package/dist/runtime/formkit/definitions/input.mjs +5 -0
- package/dist/runtime/formkit/index.d.ts +5 -1
- package/dist/runtime/plugin.d.ts +1 -1
- package/dist/runtime/utils/useFormKitInput.d.ts +1 -1
- package/package.json +5 -5
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
|
-
✨ **
|
|
21
|
+
✨ **17 Input Components** - Complete set of FormKit-wrapped Nuxt UI input components
|
|
22
22
|
- `nuxtUICheckbox` - Single checkbox with label and description
|
|
23
23
|
- `nuxtUICheckboxGroup` - Multiple checkbox selection
|
|
24
24
|
- `nuxtUIColorPicker` - Color selection with multiple formats
|
|
@@ -28,6 +28,7 @@ FormKit Nuxt UI bridges the gap between [FormKit](https://formkit.com/)'s powerf
|
|
|
28
28
|
- `nuxtUIInputNumber` - Number input with increment/decrement buttons
|
|
29
29
|
- `nuxtUIInputTags` - Tag input with custom delimiters
|
|
30
30
|
- `nuxtUIInputTime` - Time picker with 12/24-hour format
|
|
31
|
+
- `nuxtUIListbox` - Listbox for single/multiple selection with filtering
|
|
31
32
|
- `nuxtUIPinInput` - PIN/OTP entry component
|
|
32
33
|
- `nuxtUIRadioGroup` - Radio button group for single selection
|
|
33
34
|
- `nuxtUISelect` - Select dropdown with search
|
|
@@ -289,6 +290,7 @@ The playground includes comprehensive examples for all components:
|
|
|
289
290
|
- [InputNumber](./playground/app/pages/components/input/input-number.vue)
|
|
290
291
|
- [InputTags](./playground/app/pages/components/input/input-tags.vue)
|
|
291
292
|
- [InputTime](./playground/app/pages/components/input/input-time.vue)
|
|
293
|
+
- [Listbox](./playground/app/pages/components/input/listbox.vue)
|
|
292
294
|
- [PinInput](./playground/app/pages/components/input/pin-input.vue)
|
|
293
295
|
- [RadioGroup](./playground/app/pages/components/input/radio-group.vue)
|
|
294
296
|
- [Select](./playground/app/pages/components/input/select.vue)
|
|
@@ -375,6 +377,7 @@ export default defineFormKitConfig({
|
|
|
375
377
|
import {
|
|
376
378
|
nuxtUICheckboxDefinition,
|
|
377
379
|
nuxtUIInputDefinition,
|
|
380
|
+
nuxtUIListboxDefinition,
|
|
378
381
|
nuxtUISelectDefinition
|
|
379
382
|
} from '@sfxcode/nuxt-ui-formkit/definitions'
|
|
380
383
|
|
|
@@ -382,6 +385,7 @@ export default defineFormKitConfig({
|
|
|
382
385
|
inputs: {
|
|
383
386
|
nuxtUICheckbox: nuxtUICheckboxDefinition,
|
|
384
387
|
nuxtUIInput: nuxtUIInputDefinition,
|
|
388
|
+
nuxtUIListbox: nuxtUIListboxDefinition,
|
|
385
389
|
nuxtUISelect: nuxtUISelectDefinition,
|
|
386
390
|
},
|
|
387
391
|
})
|
package/dist/module.json
CHANGED
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import type { FormKitFrameworkContext } from '@formkit/core';
|
|
2
|
+
import { type PropType } from 'vue';
|
|
3
|
+
export interface ListboxItem {
|
|
4
|
+
label?: string;
|
|
5
|
+
description?: string;
|
|
6
|
+
icon?: string;
|
|
7
|
+
avatar?: Record<string, unknown>;
|
|
8
|
+
chip?: string | number | Record<string, unknown>;
|
|
9
|
+
type?: 'label' | 'separator' | 'item';
|
|
10
|
+
disabled?: boolean;
|
|
11
|
+
onSelect?: (event: Event) => void;
|
|
12
|
+
class?: unknown;
|
|
13
|
+
ui?: Record<string, unknown>;
|
|
14
|
+
[key: string]: unknown;
|
|
15
|
+
}
|
|
16
|
+
export interface FormKitListboxProps {
|
|
17
|
+
options?: string[] | ListboxItem[] | ListboxItem[][];
|
|
18
|
+
as?: string;
|
|
19
|
+
size?: 'xs' | 'sm' | 'md' | 'lg' | 'xl';
|
|
20
|
+
by?: string | ((a: unknown, b: unknown) => boolean);
|
|
21
|
+
displayMode?: 'single' | 'transfer';
|
|
22
|
+
transferLeftHeaderText?: string;
|
|
23
|
+
transferRightHeaderText?: string;
|
|
24
|
+
transferHeaderClass?: string;
|
|
25
|
+
transferAll?: boolean;
|
|
26
|
+
orientation?: 'horizontal' | 'vertical';
|
|
27
|
+
selectionBehavior?: 'toggle' | 'replace';
|
|
28
|
+
disabled?: boolean;
|
|
29
|
+
defaultValue?: unknown;
|
|
30
|
+
multiple?: boolean;
|
|
31
|
+
valueKey?: string;
|
|
32
|
+
labelKey?: string;
|
|
33
|
+
descriptionKey?: string;
|
|
34
|
+
loading?: boolean;
|
|
35
|
+
loadingIcon?: string;
|
|
36
|
+
filter?: boolean | Record<string, unknown>;
|
|
37
|
+
filterFields?: string[];
|
|
38
|
+
ignoreFilter?: boolean;
|
|
39
|
+
selectedIcon?: string;
|
|
40
|
+
virtualize?: boolean | {
|
|
41
|
+
overscan?: number;
|
|
42
|
+
estimateSize?: number | ((index: number) => number);
|
|
43
|
+
};
|
|
44
|
+
highlight?: boolean;
|
|
45
|
+
highlightOnHover?: boolean;
|
|
46
|
+
autofocus?: boolean;
|
|
47
|
+
autofocusDelay?: number;
|
|
48
|
+
searchTerm?: string;
|
|
49
|
+
ui?: Record<string, unknown>;
|
|
50
|
+
}
|
|
51
|
+
declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
52
|
+
context: {
|
|
53
|
+
type: PropType<FormKitFrameworkContext & FormKitListboxProps>;
|
|
54
|
+
required: true;
|
|
55
|
+
};
|
|
56
|
+
}>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
57
|
+
context: {
|
|
58
|
+
type: PropType<FormKitFrameworkContext & FormKitListboxProps>;
|
|
59
|
+
required: true;
|
|
60
|
+
};
|
|
61
|
+
}>> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
62
|
+
declare const _default: typeof __VLS_export;
|
|
63
|
+
export default _default;
|
|
@@ -0,0 +1,230 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import { computed } from "vue";
|
|
3
|
+
import { useFormKitInput } from "../../utils/useFormKitInput";
|
|
4
|
+
const props = defineProps({
|
|
5
|
+
context: {
|
|
6
|
+
type: Object,
|
|
7
|
+
required: true
|
|
8
|
+
}
|
|
9
|
+
});
|
|
10
|
+
const { handleInput, handleChange, isInvalid, styleClass, modelValue, items, validSlotNames } = useFormKitInput(props.context);
|
|
11
|
+
const targetItems = ref(modelValue.value || []);
|
|
12
|
+
const sourceSelection = ref([]);
|
|
13
|
+
const targetSelection = ref([]);
|
|
14
|
+
const transferHeaderClass = computed(() => {
|
|
15
|
+
const baseClass = "text-sm font-medium text-highlighted";
|
|
16
|
+
return props.context.transferHeaderClass ? props.context.transferHeaderClass : baseClass;
|
|
17
|
+
});
|
|
18
|
+
const sourceItems = computed(() => {
|
|
19
|
+
const valueKey = props.context?.valueKey || "value";
|
|
20
|
+
return items.value.filter((item) => !targetItems.value.some((t) => t[valueKey] === item[valueKey]));
|
|
21
|
+
});
|
|
22
|
+
function transferSelected() {
|
|
23
|
+
targetItems.value = [...targetItems.value, ...sourceSelection.value];
|
|
24
|
+
sourceSelection.value = [];
|
|
25
|
+
}
|
|
26
|
+
function transferAll() {
|
|
27
|
+
targetItems.value = [...targetItems.value, ...sourceItems.value];
|
|
28
|
+
sourceSelection.value = [];
|
|
29
|
+
}
|
|
30
|
+
function removeSelected() {
|
|
31
|
+
const valueKey = props.context?.valueKey || "value";
|
|
32
|
+
targetItems.value = targetItems.value.filter((item) => !targetSelection.value.some((t) => t[valueKey] === item[valueKey]));
|
|
33
|
+
targetSelection.value = [];
|
|
34
|
+
}
|
|
35
|
+
function removeAll() {
|
|
36
|
+
targetItems.value = [];
|
|
37
|
+
targetSelection.value = [];
|
|
38
|
+
}
|
|
39
|
+
watch(targetItems, (newVal) => {
|
|
40
|
+
modelValue.value = newVal;
|
|
41
|
+
});
|
|
42
|
+
</script>
|
|
43
|
+
|
|
44
|
+
<template>
|
|
45
|
+
<UListbox
|
|
46
|
+
v-if="!context.displayMode || context.displayMode === 'single'"
|
|
47
|
+
:id="context.id"
|
|
48
|
+
v-model="modelValue"
|
|
49
|
+
v-bind="{ ...context?.attrs }"
|
|
50
|
+
:class="styleClass"
|
|
51
|
+
:style="context?.attrs.style"
|
|
52
|
+
:as="context.as"
|
|
53
|
+
:size="context.size ?? 'md'"
|
|
54
|
+
:items="items"
|
|
55
|
+
:by="context.by"
|
|
56
|
+
:orientation="context.orientation"
|
|
57
|
+
:selection-behavior="context.selectionBehavior"
|
|
58
|
+
:disabled="!!context?.disabled"
|
|
59
|
+
:default-value="context.defaultValue"
|
|
60
|
+
:multiple="context.multiple"
|
|
61
|
+
:value-key="context.valueKey"
|
|
62
|
+
:label-key="context.labelKey"
|
|
63
|
+
:description-key="context.descriptionKey"
|
|
64
|
+
:loading="context.loading"
|
|
65
|
+
:loading-icon="context.loadingIcon"
|
|
66
|
+
:filter="context.filter"
|
|
67
|
+
:filter-fields="context.filterFields"
|
|
68
|
+
:ignore-filter="context.ignoreFilter"
|
|
69
|
+
:selected-icon="context.selectedIcon"
|
|
70
|
+
:virtualize="context.virtualize"
|
|
71
|
+
:highlight="!!(isInvalid || context.highlight)"
|
|
72
|
+
:highlight-on-hover="context.highlightOnHover"
|
|
73
|
+
:autofocus="context.autofocus"
|
|
74
|
+
:autofocus-delay="context.autofocusDelay"
|
|
75
|
+
:search-term="context.searchTerm"
|
|
76
|
+
:ui="context.ui"
|
|
77
|
+
@change="handleChange"
|
|
78
|
+
@update:model-value="handleInput"
|
|
79
|
+
>
|
|
80
|
+
<template
|
|
81
|
+
v-for="slotName in validSlotNames"
|
|
82
|
+
:key="slotName"
|
|
83
|
+
#[slotName]="slotProps"
|
|
84
|
+
>
|
|
85
|
+
<component
|
|
86
|
+
:is="context?.slots[slotName]"
|
|
87
|
+
v-bind="{ ...context, ...slotProps }"
|
|
88
|
+
/>
|
|
89
|
+
</template>
|
|
90
|
+
</UListbox>
|
|
91
|
+
<div
|
|
92
|
+
v-if="context.displayMode === 'transfer'"
|
|
93
|
+
class="flex items-stretch gap-4 w-full"
|
|
94
|
+
>
|
|
95
|
+
<div class="flex flex-col flex-1 gap-1">
|
|
96
|
+
<span
|
|
97
|
+
v-if="context.transferLeftHeaderText"
|
|
98
|
+
:class="transferHeaderClass"
|
|
99
|
+
>{{ context.transferLeftHeaderText }}</span>
|
|
100
|
+
<UListbox
|
|
101
|
+
:id="context.id + '-transfer-left'"
|
|
102
|
+
v-model="sourceSelection"
|
|
103
|
+
v-bind="{ ...context?.attrs }"
|
|
104
|
+
:class="styleClass"
|
|
105
|
+
:style="context?.attrs.style"
|
|
106
|
+
:as="context.as"
|
|
107
|
+
:size="context.size ?? 'md'"
|
|
108
|
+
:items="sourceItems"
|
|
109
|
+
:by="context.by"
|
|
110
|
+
:orientation="context.orientation"
|
|
111
|
+
:selection-behavior="context.selectionBehavior"
|
|
112
|
+
:disabled="!!context?.disabled"
|
|
113
|
+
:default-value="context.defaultValue"
|
|
114
|
+
:multiple="true"
|
|
115
|
+
:value-key="context.valueKey"
|
|
116
|
+
:label-key="context.labelKey"
|
|
117
|
+
:description-key="context.descriptionKey"
|
|
118
|
+
:loading="context.loading"
|
|
119
|
+
:loading-icon="context.loadingIcon"
|
|
120
|
+
:filter="context.filter"
|
|
121
|
+
:filter-fields="context.filterFields"
|
|
122
|
+
:ignore-filter="context.ignoreFilter"
|
|
123
|
+
:selected-icon="context.selectedIcon"
|
|
124
|
+
:virtualize="context.virtualize"
|
|
125
|
+
:highlight="!!(isInvalid || context.highlight)"
|
|
126
|
+
:highlight-on-hover="context.highlightOnHover"
|
|
127
|
+
:autofocus="context.autofocus"
|
|
128
|
+
:autofocus-delay="context.autofocusDelay"
|
|
129
|
+
:search-term="context.searchTerm"
|
|
130
|
+
:ui="context.ui"
|
|
131
|
+
@change="handleChange"
|
|
132
|
+
@update:model-value="handleInput"
|
|
133
|
+
>
|
|
134
|
+
<template
|
|
135
|
+
v-for="slotName in validSlotNames"
|
|
136
|
+
:key="slotName"
|
|
137
|
+
#[slotName]="slotProps"
|
|
138
|
+
>
|
|
139
|
+
<component
|
|
140
|
+
:is="context?.slots[slotName]"
|
|
141
|
+
v-bind="{ ...context, ...slotProps }"
|
|
142
|
+
/>
|
|
143
|
+
</template>
|
|
144
|
+
</UListbox>
|
|
145
|
+
</div>
|
|
146
|
+
<div class="flex flex-col items-center justify-center gap-1">
|
|
147
|
+
<UButton
|
|
148
|
+
icon="i-lucide-chevron-right"
|
|
149
|
+
color="neutral"
|
|
150
|
+
variant="outline"
|
|
151
|
+
:disabled="sourceSelection.length === 0"
|
|
152
|
+
@click="transferSelected"
|
|
153
|
+
/>
|
|
154
|
+
<UButton
|
|
155
|
+
v-if="context.transferAll"
|
|
156
|
+
icon="i-lucide-chevrons-right"
|
|
157
|
+
color="neutral"
|
|
158
|
+
variant="outline"
|
|
159
|
+
:disabled="sourceItems.length === 0"
|
|
160
|
+
@click="transferAll"
|
|
161
|
+
/>
|
|
162
|
+
<UButton
|
|
163
|
+
icon="i-lucide-chevron-left"
|
|
164
|
+
color="neutral"
|
|
165
|
+
variant="outline"
|
|
166
|
+
:disabled="!targetSelection.length"
|
|
167
|
+
@click="removeSelected"
|
|
168
|
+
/>
|
|
169
|
+
<UButton
|
|
170
|
+
v-if="context.transferAll"
|
|
171
|
+
icon="i-lucide-chevrons-left"
|
|
172
|
+
color="neutral"
|
|
173
|
+
variant="outline"
|
|
174
|
+
:disabled="targetItems.length === 0"
|
|
175
|
+
@click="removeAll"
|
|
176
|
+
/>
|
|
177
|
+
</div>
|
|
178
|
+
<div class="flex flex-col flex-1 gap-1">
|
|
179
|
+
<span
|
|
180
|
+
v-if="context.transferRightHeaderText"
|
|
181
|
+
:class="transferHeaderClass"
|
|
182
|
+
>{{ context.transferRightHeaderText }}</span>
|
|
183
|
+
<UListbox
|
|
184
|
+
:id="context.id + '-transfer-right'"
|
|
185
|
+
v-model="targetSelection"
|
|
186
|
+
v-bind="{ ...context?.attrs }"
|
|
187
|
+
:class="styleClass"
|
|
188
|
+
:style="context?.attrs.style"
|
|
189
|
+
:as="context.as"
|
|
190
|
+
:size="context.size ?? 'md'"
|
|
191
|
+
:items="targetItems"
|
|
192
|
+
:by="context.by"
|
|
193
|
+
:orientation="context.orientation"
|
|
194
|
+
:selection-behavior="context.selectionBehavior"
|
|
195
|
+
:disabled="!!context?.disabled"
|
|
196
|
+
:default-value="context.defaultValue"
|
|
197
|
+
:multiple="true"
|
|
198
|
+
:value-key="context.valueKey"
|
|
199
|
+
:label-key="context.labelKey"
|
|
200
|
+
:description-key="context.descriptionKey"
|
|
201
|
+
:loading="context.loading"
|
|
202
|
+
:loading-icon="context.loadingIcon"
|
|
203
|
+
:filter="context.filter"
|
|
204
|
+
:filter-fields="context.filterFields"
|
|
205
|
+
:ignore-filter="context.ignoreFilter"
|
|
206
|
+
:selected-icon="context.selectedIcon"
|
|
207
|
+
:virtualize="context.virtualize"
|
|
208
|
+
:highlight="!!(isInvalid || context.highlight)"
|
|
209
|
+
:highlight-on-hover="context.highlightOnHover"
|
|
210
|
+
:autofocus="context.autofocus"
|
|
211
|
+
:autofocus-delay="context.autofocusDelay"
|
|
212
|
+
:search-term="context.searchTerm"
|
|
213
|
+
:ui="context.ui"
|
|
214
|
+
@change="handleChange"
|
|
215
|
+
@update:model-value="handleInput"
|
|
216
|
+
>
|
|
217
|
+
<template
|
|
218
|
+
v-for="slotName in validSlotNames"
|
|
219
|
+
:key="slotName"
|
|
220
|
+
#[slotName]="slotProps"
|
|
221
|
+
>
|
|
222
|
+
<component
|
|
223
|
+
:is="context?.slots[slotName]"
|
|
224
|
+
v-bind="{ ...context, ...slotProps }"
|
|
225
|
+
/>
|
|
226
|
+
</template>
|
|
227
|
+
</UListbox>
|
|
228
|
+
</div>
|
|
229
|
+
</div>
|
|
230
|
+
</template>
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import type { FormKitFrameworkContext } from '@formkit/core';
|
|
2
|
+
import { type PropType } from 'vue';
|
|
3
|
+
export interface ListboxItem {
|
|
4
|
+
label?: string;
|
|
5
|
+
description?: string;
|
|
6
|
+
icon?: string;
|
|
7
|
+
avatar?: Record<string, unknown>;
|
|
8
|
+
chip?: string | number | Record<string, unknown>;
|
|
9
|
+
type?: 'label' | 'separator' | 'item';
|
|
10
|
+
disabled?: boolean;
|
|
11
|
+
onSelect?: (event: Event) => void;
|
|
12
|
+
class?: unknown;
|
|
13
|
+
ui?: Record<string, unknown>;
|
|
14
|
+
[key: string]: unknown;
|
|
15
|
+
}
|
|
16
|
+
export interface FormKitListboxProps {
|
|
17
|
+
options?: string[] | ListboxItem[] | ListboxItem[][];
|
|
18
|
+
as?: string;
|
|
19
|
+
size?: 'xs' | 'sm' | 'md' | 'lg' | 'xl';
|
|
20
|
+
by?: string | ((a: unknown, b: unknown) => boolean);
|
|
21
|
+
displayMode?: 'single' | 'transfer';
|
|
22
|
+
transferLeftHeaderText?: string;
|
|
23
|
+
transferRightHeaderText?: string;
|
|
24
|
+
transferHeaderClass?: string;
|
|
25
|
+
transferAll?: boolean;
|
|
26
|
+
orientation?: 'horizontal' | 'vertical';
|
|
27
|
+
selectionBehavior?: 'toggle' | 'replace';
|
|
28
|
+
disabled?: boolean;
|
|
29
|
+
defaultValue?: unknown;
|
|
30
|
+
multiple?: boolean;
|
|
31
|
+
valueKey?: string;
|
|
32
|
+
labelKey?: string;
|
|
33
|
+
descriptionKey?: string;
|
|
34
|
+
loading?: boolean;
|
|
35
|
+
loadingIcon?: string;
|
|
36
|
+
filter?: boolean | Record<string, unknown>;
|
|
37
|
+
filterFields?: string[];
|
|
38
|
+
ignoreFilter?: boolean;
|
|
39
|
+
selectedIcon?: string;
|
|
40
|
+
virtualize?: boolean | {
|
|
41
|
+
overscan?: number;
|
|
42
|
+
estimateSize?: number | ((index: number) => number);
|
|
43
|
+
};
|
|
44
|
+
highlight?: boolean;
|
|
45
|
+
highlightOnHover?: boolean;
|
|
46
|
+
autofocus?: boolean;
|
|
47
|
+
autofocusDelay?: number;
|
|
48
|
+
searchTerm?: string;
|
|
49
|
+
ui?: Record<string, unknown>;
|
|
50
|
+
}
|
|
51
|
+
declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
52
|
+
context: {
|
|
53
|
+
type: PropType<FormKitFrameworkContext & FormKitListboxProps>;
|
|
54
|
+
required: true;
|
|
55
|
+
};
|
|
56
|
+
}>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
57
|
+
context: {
|
|
58
|
+
type: PropType<FormKitFrameworkContext & FormKitListboxProps>;
|
|
59
|
+
required: true;
|
|
60
|
+
};
|
|
61
|
+
}>> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
62
|
+
declare const _default: typeof __VLS_export;
|
|
63
|
+
export default _default;
|
|
@@ -10,6 +10,7 @@ export declare const nuxtUIInputs: {
|
|
|
10
10
|
nuxtUIInputNumber: import("@formkit/core").FormKitTypeDefinition;
|
|
11
11
|
nuxtUIInputTags: import("@formkit/core").FormKitTypeDefinition;
|
|
12
12
|
nuxtUIInputTime: import("@formkit/core").FormKitTypeDefinition;
|
|
13
|
+
nuxtUIListbox: import("@formkit/core").FormKitTypeDefinition;
|
|
13
14
|
nuxtUIPinInput: import("@formkit/core").FormKitTypeDefinition;
|
|
14
15
|
nuxtUIRadioGroup: import("@formkit/core").FormKitTypeDefinition;
|
|
15
16
|
nuxtUISelect: import("@formkit/core").FormKitTypeDefinition;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { nuxtUICheckboxDefinition, nuxtUICheckboxGroupDefinition, nuxtUIColorPickerDefinition, nuxtUIInputDateDefinition, nuxtUIInputDefinition, nuxtUIInputMenuDefinition, nuxtUIInputNumberDefinition, nuxtUIInputTagsDefinition, nuxtUIInputTimeDefinition, nuxtUIPinInputDefinition, nuxtUIRadioGroupDefinition, nuxtUISelectDefinition, nuxtUISelectMenuDefinition, nuxtUISliderDefinition, nuxtUISwitchDefinition, nuxtUITextareaDefinition } from "./input.js";
|
|
1
|
+
import { nuxtUICheckboxDefinition, nuxtUICheckboxGroupDefinition, nuxtUIColorPickerDefinition, nuxtUIInputDateDefinition, nuxtUIInputDefinition, nuxtUIInputMenuDefinition, nuxtUIInputNumberDefinition, nuxtUIInputTagsDefinition, nuxtUIInputTimeDefinition, nuxtUIListboxDefinition, nuxtUIPinInputDefinition, nuxtUIRadioGroupDefinition, nuxtUISelectDefinition, nuxtUISelectMenuDefinition, nuxtUISliderDefinition, nuxtUISwitchDefinition, nuxtUITextareaDefinition } from "./input.js";
|
|
2
2
|
import { nuxtUIOutputBooleanDefinition, nuxtUIOutputDateDefinition, nuxtUIOutputLinkDefinition, nuxtUIOutputListDefinition, nuxtUIOutputNumberDefinition, nuxtUIOutputTextDefinition } from "./output.js";
|
|
3
3
|
export * from "./input.js";
|
|
4
4
|
export * from "./output.js";
|
|
@@ -12,6 +12,7 @@ export const nuxtUIInputs = {
|
|
|
12
12
|
nuxtUIInputNumber: nuxtUIInputNumberDefinition,
|
|
13
13
|
nuxtUIInputTags: nuxtUIInputTagsDefinition,
|
|
14
14
|
nuxtUIInputTime: nuxtUIInputTimeDefinition,
|
|
15
|
+
nuxtUIListbox: nuxtUIListboxDefinition,
|
|
15
16
|
nuxtUIPinInput: nuxtUIPinInputDefinition,
|
|
16
17
|
nuxtUIRadioGroup: nuxtUIRadioGroupDefinition,
|
|
17
18
|
nuxtUISelect: nuxtUISelectDefinition,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { nuxtUICheckboxDefinition, nuxtUICheckboxGroupDefinition, nuxtUIColorPickerDefinition, nuxtUIInputDateDefinition, nuxtUIInputDefinition, nuxtUIInputMenuDefinition, nuxtUIInputNumberDefinition, nuxtUIInputTagsDefinition, nuxtUIInputTimeDefinition, nuxtUIPinInputDefinition, nuxtUIRadioGroupDefinition, nuxtUISelectDefinition, nuxtUISelectMenuDefinition, nuxtUISliderDefinition, nuxtUISwitchDefinition, nuxtUITextareaDefinition } from "./input.mjs";
|
|
1
|
+
import { nuxtUICheckboxDefinition, nuxtUICheckboxGroupDefinition, nuxtUIColorPickerDefinition, nuxtUIInputDateDefinition, nuxtUIInputDefinition, nuxtUIInputMenuDefinition, nuxtUIInputNumberDefinition, nuxtUIInputTagsDefinition, nuxtUIInputTimeDefinition, nuxtUIListboxDefinition, nuxtUIPinInputDefinition, nuxtUIRadioGroupDefinition, nuxtUISelectDefinition, nuxtUISelectMenuDefinition, nuxtUISliderDefinition, nuxtUISwitchDefinition, nuxtUITextareaDefinition } from "./input.mjs";
|
|
2
2
|
import { nuxtUIOutputBooleanDefinition, nuxtUIOutputDateDefinition, nuxtUIOutputLinkDefinition, nuxtUIOutputListDefinition, nuxtUIOutputNumberDefinition, nuxtUIOutputTextDefinition } from "./output.mjs";
|
|
3
3
|
export * from "./input.mjs";
|
|
4
4
|
export * from "./output.mjs";
|
|
@@ -12,6 +12,7 @@ export const nuxtUIInputs = {
|
|
|
12
12
|
nuxtUIInputNumber: nuxtUIInputNumberDefinition,
|
|
13
13
|
nuxtUIInputTags: nuxtUIInputTagsDefinition,
|
|
14
14
|
nuxtUIInputTime: nuxtUIInputTimeDefinition,
|
|
15
|
+
nuxtUIListbox: nuxtUIListboxDefinition,
|
|
15
16
|
nuxtUIPinInput: nuxtUIPinInputDefinition,
|
|
16
17
|
nuxtUIRadioGroup: nuxtUIRadioGroupDefinition,
|
|
17
18
|
nuxtUISelect: nuxtUISelectDefinition,
|
|
@@ -8,6 +8,7 @@ export declare const nuxtUIInputMenuDefinition: FormKitTypeDefinition;
|
|
|
8
8
|
export declare const nuxtUIInputNumberDefinition: FormKitTypeDefinition;
|
|
9
9
|
export declare const nuxtUIInputTagsDefinition: FormKitTypeDefinition;
|
|
10
10
|
export declare const nuxtUIInputTimeDefinition: FormKitTypeDefinition;
|
|
11
|
+
export declare const nuxtUIListboxDefinition: FormKitTypeDefinition;
|
|
11
12
|
export declare const nuxtUIPinInputDefinition: FormKitTypeDefinition;
|
|
12
13
|
export declare const nuxtUIRadioGroupDefinition: FormKitTypeDefinition;
|
|
13
14
|
export declare const nuxtUISelectDefinition: FormKitTypeDefinition;
|
|
@@ -8,6 +8,7 @@ import FUInputMenu from "../../../runtime/components/inputs/FUInputMenu.vue";
|
|
|
8
8
|
import FUInputNumber from "../../../runtime/components/inputs/FUInputNumber.vue";
|
|
9
9
|
import FUInputTags from "../../../runtime/components/inputs/FUInputTags.vue";
|
|
10
10
|
import FUInputTime from "../../../runtime/components/inputs/FUInputTime.vue";
|
|
11
|
+
import FUListbox from "../../../runtime/components/inputs/FUListbox.vue";
|
|
11
12
|
import FUPinInput from "../../../runtime/components/inputs/FUPinInput.vue";
|
|
12
13
|
import FURadioGroup from "../../../runtime/components/inputs/FURadioGroup.vue";
|
|
13
14
|
import FUSelect from "../../../runtime/components/inputs/FUSelect.vue";
|
|
@@ -51,6 +52,10 @@ export const nuxtUIInputTimeDefinition = createInput(FUInputTime, {
|
|
|
51
52
|
props: ["color", "variant", "size", "highlight", "fixed", "autofocus", "autofocusDelay", "defaultValue", "placeholder", "defaultPlaceholder", "hourCycle", "step", "stepSnapping", "granularity", "hideTimeZone", "maxValue", "minValue", "icon", "avatar", "leading", "leadingIcon", "trailing", "trailingIcon", "loading", "loadingIcon", "ui"],
|
|
52
53
|
family: "NuxtUIInput"
|
|
53
54
|
});
|
|
55
|
+
export const nuxtUIListboxDefinition = createInput(FUListbox, {
|
|
56
|
+
props: ["options", "as", "size", "by", "orientation", "selectionBehavior", "disabled", "defaultValue", "multiple", "valueKey", "labelKey", "descriptionKey", "loading", "loadingIcon", "filter", "filterFields", "ignoreFilter", "selectedIcon", "virtualize", "highlight", "highlightOnHover", "autofocus", "autofocusDelay", "searchTerm", "ui", "displayMode", "transferLeftHeaderText", "transferRightHeaderText", "transferAll", "transferHeaderClass"],
|
|
57
|
+
family: "NuxtUIInput"
|
|
58
|
+
});
|
|
54
59
|
export const nuxtUIPinInputDefinition = createInput(FUPinInput, {
|
|
55
60
|
props: ["color", "variant", "size", "length", "autofocus", "autofocusDelay", "highlight", "fixed", "defaultValue", "mask", "otp", "placeholder", "ui"],
|
|
56
61
|
family: "NuxtUIInput"
|
|
@@ -8,6 +8,7 @@ import FUInputMenu from "../../../runtime/components/inputs/FUInputMenu.vue";
|
|
|
8
8
|
import FUInputNumber from "../../../runtime/components/inputs/FUInputNumber.vue";
|
|
9
9
|
import FUInputTags from "../../../runtime/components/inputs/FUInputTags.vue";
|
|
10
10
|
import FUInputTime from "../../../runtime/components/inputs/FUInputTime.vue";
|
|
11
|
+
import FUListbox from "../../../runtime/components/inputs/FUListbox.vue";
|
|
11
12
|
import FUPinInput from "../../../runtime/components/inputs/FUPinInput.vue";
|
|
12
13
|
import FURadioGroup from "../../../runtime/components/inputs/FURadioGroup.vue";
|
|
13
14
|
import FUSelect from "../../../runtime/components/inputs/FUSelect.vue";
|
|
@@ -51,6 +52,10 @@ export const nuxtUIInputTimeDefinition = createInput(FUInputTime, {
|
|
|
51
52
|
props: ["color", "variant", "size", "highlight", "fixed", "autofocus", "autofocusDelay", "defaultValue", "placeholder", "defaultPlaceholder", "hourCycle", "step", "stepSnapping", "granularity", "hideTimeZone", "maxValue", "minValue", "icon", "avatar", "leading", "leadingIcon", "trailing", "trailingIcon", "loading", "loadingIcon", "ui"],
|
|
52
53
|
family: "NuxtUIInput"
|
|
53
54
|
});
|
|
55
|
+
export const nuxtUIListboxDefinition = createInput(FUListbox, {
|
|
56
|
+
props: ["options", "as", "size", "by", "orientation", "selectionBehavior", "disabled", "defaultValue", "multiple", "valueKey", "labelKey", "descriptionKey", "loading", "loadingIcon", "filter", "filterFields", "ignoreFilter", "selectedIcon", "virtualize", "highlight", "highlightOnHover", "autofocus", "autofocusDelay", "searchTerm", "ui", "displayMode", "transferLeftHeaderText", "transferRightHeaderText", "transferAll", "transferHeaderClass"],
|
|
57
|
+
family: "NuxtUIInput"
|
|
58
|
+
});
|
|
54
59
|
export const nuxtUIPinInputDefinition = createInput(FUPinInput, {
|
|
55
60
|
props: ["color", "variant", "size", "length", "autofocus", "autofocusDelay", "highlight", "fixed", "defaultValue", "mask", "otp", "placeholder", "ui"],
|
|
56
61
|
family: "NuxtUIInput"
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { FormKitBaseSlots, FormKitInputs } from '@formkit/inputs';
|
|
2
|
-
import type { CheckboxSlots, CheckboxGroupSlots, RadioGroupSlots, InputSlots, TextareaSlots, SelectSlots, SelectMenuSlots, InputDateSlots, InputMenuSlots, InputNumberSlots, InputTagsSlots, InputTimeSlots, SwitchSlots } from '@nuxt/ui';
|
|
2
|
+
import type { CheckboxSlots, CheckboxGroupSlots, RadioGroupSlots, InputSlots, TextareaSlots, SelectSlots, SelectMenuSlots, InputDateSlots, InputMenuSlots, InputNumberSlots, InputTagsSlots, InputTimeSlots, ListboxSlots, SwitchSlots } from '@nuxt/ui';
|
|
3
3
|
export * from './definitions/index.js';
|
|
4
4
|
export * from './plugins/index.js';
|
|
5
5
|
/**
|
|
@@ -35,6 +35,9 @@ declare module '@formkit/inputs' {
|
|
|
35
35
|
nuxtUIInputTime: {
|
|
36
36
|
type: 'nuxtUIInputTime';
|
|
37
37
|
};
|
|
38
|
+
nuxtUIListbox: {
|
|
39
|
+
type: 'nuxtUIListbox';
|
|
40
|
+
};
|
|
38
41
|
nuxtUIPinInput: {
|
|
39
42
|
type: 'nuxtUIPinInput';
|
|
40
43
|
};
|
|
@@ -84,6 +87,7 @@ declare module '@formkit/inputs' {
|
|
|
84
87
|
nuxtUIInputNumber: MergeSlots<FormKitBaseSlots<Props>, InputNumberSlots>;
|
|
85
88
|
nuxtUIInputTags: MergeSlots<FormKitBaseSlots<Props>, InputTagsSlots>;
|
|
86
89
|
nuxtUIInputTime: MergeSlots<FormKitBaseSlots<Props>, InputTimeSlots>;
|
|
90
|
+
nuxtUIListbox: MergeSlots<FormKitBaseSlots<Props>, ListboxSlots>;
|
|
87
91
|
nuxtUIRadioGroup: MergeSlots<FormKitBaseSlots<Props>, RadioGroupSlots>;
|
|
88
92
|
nuxtUISelect: MergeSlots<FormKitBaseSlots<Props>, SelectSlots>;
|
|
89
93
|
nuxtUISelectMenu: MergeSlots<FormKitBaseSlots<Props>, SelectMenuSlots>;
|
package/dist/runtime/plugin.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const _default:
|
|
1
|
+
declare const _default: import("#app").Plugin<Record<string, unknown>> & import("#app").ObjectPlugin<Record<string, unknown>>;
|
|
2
2
|
export default _default;
|
|
@@ -3,7 +3,7 @@ export declare function useFormKitInput(context: FormKitFrameworkContext): {
|
|
|
3
3
|
isInvalid: import("vue").ComputedRef<boolean>;
|
|
4
4
|
validSlotNames: import("vue").ComputedRef<string[]>;
|
|
5
5
|
styleClass: import("vue").ComputedRef<string>;
|
|
6
|
-
color: import("vue").ComputedRef<"primary" | "secondary" | "success" | "info" | "warning" | "
|
|
6
|
+
color: import("vue").ComputedRef<"error" | "primary" | "secondary" | "success" | "info" | "warning" | "neutral">;
|
|
7
7
|
handleBlur: (event: FocusEvent) => void;
|
|
8
8
|
handleChange: (_: unknown) => void;
|
|
9
9
|
handleInput: (_: unknown) => void;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sfxcode/nuxt-ui-formkit",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.10.0",
|
|
4
4
|
"description": "FormKit integration for Nuxt UI - Seamlessly connect FormKit form handling with Nuxt UI components",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "Tom",
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
"design-system",
|
|
35
35
|
"form-builder"
|
|
36
36
|
],
|
|
37
|
-
"packageManager": "pnpm@10.33.
|
|
37
|
+
"packageManager": "pnpm@10.33.2+sha512.a90faf6feeab71ad6c6e57f94e0fe1a12f5dcc22cd754db40ae9593eb6a3e0b6b12e3540218bb37ae083404b1f2ce6db2a4121e979829b4aff94b99f49da1cf8",
|
|
38
38
|
"type": "module",
|
|
39
39
|
"exports": {
|
|
40
40
|
".": {
|
|
@@ -79,7 +79,7 @@
|
|
|
79
79
|
"dev": "npm run dev:prepare && nuxi dev playground",
|
|
80
80
|
"dev:build": "nuxi build playground",
|
|
81
81
|
"dev:prepare": "nuxt-module-build build --stub && nuxt-module-build prepare && nuxi prepare playground",
|
|
82
|
-
"release": "npm run lint && npm run test && npm run prepack && changelogen --
|
|
82
|
+
"release": "npm run lint && npm run test && npm run prepack && changelogen --major --release && npm publish --access=public && git push --follow-tags",
|
|
83
83
|
"lint": "eslint .",
|
|
84
84
|
"test": "vitest run",
|
|
85
85
|
"test:watch": "vitest watch",
|
|
@@ -89,11 +89,11 @@
|
|
|
89
89
|
"@formkit/addons": "^2.0.0",
|
|
90
90
|
"@formkit/nuxt": "^2.0.0",
|
|
91
91
|
"@nuxt/kit": "^4.4.2",
|
|
92
|
-
"@nuxt/ui": "^4.
|
|
92
|
+
"@nuxt/ui": "^4.7.0"
|
|
93
93
|
},
|
|
94
94
|
"devDependencies": {
|
|
95
95
|
"@iconify-json/heroicons": "^1.2.3",
|
|
96
|
-
"@iconify-json/lucide": "^1.2.
|
|
96
|
+
"@iconify-json/lucide": "^1.2.103",
|
|
97
97
|
"@iconify-json/simple-icons": "^1.2.79",
|
|
98
98
|
"@nuxt/devtools": "4.0.0-alpha.4",
|
|
99
99
|
"@nuxt/eslint-config": "^1.15.2",
|