@sfxcode/formkit-nuxt-ui 0.7.2
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/LICENSE +22 -0
- package/README.md +385 -0
- package/dist/module.d.mts +7 -0
- package/dist/module.json +12 -0
- package/dist/module.mjs +29 -0
- package/dist/runtime/components/FUDataDebug.d.vue.ts +43 -0
- package/dist/runtime/components/FUDataDebug.vue +30 -0
- package/dist/runtime/components/FUDataDebug.vue.d.ts +43 -0
- package/dist/runtime/components/FUDataEdit.d.vue.ts +180 -0
- package/dist/runtime/components/FUDataEdit.vue +141 -0
- package/dist/runtime/components/FUDataEdit.vue.d.ts +180 -0
- package/dist/runtime/components/FUDataView.d.vue.ts +73 -0
- package/dist/runtime/components/FUDataView.vue +49 -0
- package/dist/runtime/components/FUDataView.vue.d.ts +73 -0
- package/dist/runtime/components/inputs/FUCheckbox.d.vue.ts +27 -0
- package/dist/runtime/components/inputs/FUCheckbox.vue +33 -0
- package/dist/runtime/components/inputs/FUCheckbox.vue.d.ts +27 -0
- package/dist/runtime/components/inputs/FUCheckboxGroup.d.vue.ts +38 -0
- package/dist/runtime/components/inputs/FUCheckboxGroup.vue +34 -0
- package/dist/runtime/components/inputs/FUCheckboxGroup.vue.d.ts +38 -0
- package/dist/runtime/components/inputs/FUColorPicker.d.vue.ts +22 -0
- package/dist/runtime/components/inputs/FUColorPicker.vue +27 -0
- package/dist/runtime/components/inputs/FUColorPicker.vue.d.ts +22 -0
- package/dist/runtime/components/inputs/FUInput.d.vue.ts +44 -0
- package/dist/runtime/components/inputs/FUInput.vue +50 -0
- package/dist/runtime/components/inputs/FUInput.vue.d.ts +44 -0
- package/dist/runtime/components/inputs/FUInputDate.d.vue.ts +51 -0
- package/dist/runtime/components/inputs/FUInputDate.vue +52 -0
- package/dist/runtime/components/inputs/FUInputDate.vue.d.ts +51 -0
- package/dist/runtime/components/inputs/FUInputMenu.d.vue.ts +73 -0
- package/dist/runtime/components/inputs/FUInputMenu.vue +65 -0
- package/dist/runtime/components/inputs/FUInputMenu.vue.d.ts +73 -0
- package/dist/runtime/components/inputs/FUInputNumber.d.vue.ts +43 -0
- package/dist/runtime/components/inputs/FUInputNumber.vue +49 -0
- package/dist/runtime/components/inputs/FUInputNumber.vue.d.ts +43 -0
- package/dist/runtime/components/inputs/FUInputTags.d.vue.ts +47 -0
- package/dist/runtime/components/inputs/FUInputTags.vue +53 -0
- package/dist/runtime/components/inputs/FUInputTags.vue.d.ts +47 -0
- package/dist/runtime/components/inputs/FUInputTime.d.vue.ts +50 -0
- package/dist/runtime/components/inputs/FUInputTime.vue +50 -0
- package/dist/runtime/components/inputs/FUInputTime.vue.d.ts +50 -0
- package/dist/runtime/components/inputs/FUPinInput.d.vue.ts +30 -0
- package/dist/runtime/components/inputs/FUPinInput.vue +37 -0
- package/dist/runtime/components/inputs/FUPinInput.vue.d.ts +30 -0
- package/dist/runtime/components/inputs/FURadioGroup.d.vue.ts +37 -0
- package/dist/runtime/components/inputs/FURadioGroup.vue +35 -0
- package/dist/runtime/components/inputs/FURadioGroup.vue.d.ts +37 -0
- package/dist/runtime/components/inputs/FUSelect.d.vue.ts +48 -0
- package/dist/runtime/components/inputs/FUSelect.vue +51 -0
- package/dist/runtime/components/inputs/FUSelect.vue.d.ts +48 -0
- package/dist/runtime/components/inputs/FUSelectMenu.d.vue.ts +73 -0
- package/dist/runtime/components/inputs/FUSelectMenu.vue +62 -0
- package/dist/runtime/components/inputs/FUSelectMenu.vue.d.ts +73 -0
- package/dist/runtime/components/inputs/FUSlider.d.vue.ts +29 -0
- package/dist/runtime/components/inputs/FUSlider.vue +36 -0
- package/dist/runtime/components/inputs/FUSlider.vue.d.ts +29 -0
- package/dist/runtime/components/inputs/FUSwitch.d.vue.ts +28 -0
- package/dist/runtime/components/inputs/FUSwitch.vue +34 -0
- package/dist/runtime/components/inputs/FUSwitch.vue.d.ts +28 -0
- package/dist/runtime/components/inputs/FUTextarea.d.vue.ts +44 -0
- package/dist/runtime/components/inputs/FUTextarea.vue +50 -0
- package/dist/runtime/components/inputs/FUTextarea.vue.d.ts +44 -0
- package/dist/runtime/components/output/FUIcon.d.vue.ts +38 -0
- package/dist/runtime/components/output/FUIcon.vue +21 -0
- package/dist/runtime/components/output/FUIcon.vue.d.ts +38 -0
- package/dist/runtime/components/output/FUOutputBoolean.d.vue.ts +30 -0
- package/dist/runtime/components/output/FUOutputBoolean.vue +56 -0
- package/dist/runtime/components/output/FUOutputBoolean.vue.d.ts +30 -0
- package/dist/runtime/components/output/FUOutputDate.d.vue.ts +30 -0
- package/dist/runtime/components/output/FUOutputDate.vue +52 -0
- package/dist/runtime/components/output/FUOutputDate.vue.d.ts +30 -0
- package/dist/runtime/components/output/FUOutputLink.d.vue.ts +28 -0
- package/dist/runtime/components/output/FUOutputLink.vue +78 -0
- package/dist/runtime/components/output/FUOutputLink.vue.d.ts +28 -0
- package/dist/runtime/components/output/FUOutputList.d.vue.ts +29 -0
- package/dist/runtime/components/output/FUOutputList.vue +143 -0
- package/dist/runtime/components/output/FUOutputList.vue.d.ts +29 -0
- package/dist/runtime/components/output/FUOutputNumber.d.vue.ts +28 -0
- package/dist/runtime/components/output/FUOutputNumber.vue +52 -0
- package/dist/runtime/components/output/FUOutputNumber.vue.d.ts +28 -0
- package/dist/runtime/components/output/FUOutputText.d.vue.ts +26 -0
- package/dist/runtime/components/output/FUOutputText.vue +35 -0
- package/dist/runtime/components/output/FUOutputText.vue.d.ts +26 -0
- package/dist/runtime/composables/useFormKitRepeater.d.ts +5 -0
- package/dist/runtime/composables/useFormKitRepeater.js +54 -0
- package/dist/runtime/composables/useFormKitSchema.d.ts +26 -0
- package/dist/runtime/composables/useFormKitSchema.js +58 -0
- package/dist/runtime/definitions/index.d.ts +26 -0
- package/dist/runtime/definitions/index.js +28 -0
- package/dist/runtime/definitions/input.d.ts +17 -0
- package/dist/runtime/definitions/input.js +81 -0
- package/dist/runtime/definitions/output.d.ts +7 -0
- package/dist/runtime/definitions/output.js +31 -0
- package/dist/runtime/formkit.config.d.ts +3 -0
- package/dist/runtime/formkit.config.js +33 -0
- package/dist/runtime/plugin.d.ts +2 -0
- package/dist/runtime/plugin.js +5 -0
- package/dist/runtime/plugins/index.d.ts +3 -0
- package/dist/runtime/plugins/index.js +55 -0
- package/dist/runtime/server/tsconfig.json +3 -0
- package/dist/runtime/utils/useFormKitInput.d.ts +13 -0
- package/dist/runtime/utils/useFormKitInput.js +42 -0
- package/dist/runtime/utils/useFormKitOutput.d.ts +10 -0
- package/dist/runtime/utils/useFormKitOutput.js +73 -0
- package/dist/types.d.mts +3 -0
- package/package.json +91 -0
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import type { FormKitFrameworkContext } from '@formkit/core';
|
|
2
|
+
import type { PropType } from 'vue';
|
|
3
|
+
export interface FormKitPinInputProps {
|
|
4
|
+
color?: 'primary' | 'secondary' | 'success' | 'info' | 'warning' | 'error' | 'neutral';
|
|
5
|
+
variant?: 'outline' | 'soft' | 'subtle' | 'ghost' | 'none';
|
|
6
|
+
size?: 'xs' | 'sm' | 'md' | 'lg' | 'xl';
|
|
7
|
+
length?: string | number;
|
|
8
|
+
autofocus?: boolean;
|
|
9
|
+
autofocusDelay?: number;
|
|
10
|
+
highlight?: boolean;
|
|
11
|
+
fixed?: boolean;
|
|
12
|
+
defaultValue?: string[] | undefined;
|
|
13
|
+
mask?: boolean;
|
|
14
|
+
otp?: boolean;
|
|
15
|
+
placeholder?: string;
|
|
16
|
+
ui?: Record<string, unknown>;
|
|
17
|
+
}
|
|
18
|
+
declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
19
|
+
context: {
|
|
20
|
+
type: PropType<FormKitFrameworkContext & FormKitPinInputProps>;
|
|
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 & FormKitPinInputProps>;
|
|
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,37 @@
|
|
|
1
|
+
import type { FormKitFrameworkContext } from '@formkit/core';
|
|
2
|
+
import type { PropType } from 'vue';
|
|
3
|
+
export interface RadioOption {
|
|
4
|
+
value: string | number | boolean;
|
|
5
|
+
label?: string;
|
|
6
|
+
description?: string;
|
|
7
|
+
disabled?: boolean;
|
|
8
|
+
[key: string]: unknown;
|
|
9
|
+
}
|
|
10
|
+
export interface FormKitRadioGroupProps {
|
|
11
|
+
options?: RadioOption[];
|
|
12
|
+
legend?: string;
|
|
13
|
+
valueKey?: string;
|
|
14
|
+
labelKey?: string;
|
|
15
|
+
descriptionKey?: string;
|
|
16
|
+
size?: 'xs' | 'sm' | 'md' | 'lg' | 'xl';
|
|
17
|
+
variant?: 'table' | 'list' | 'card';
|
|
18
|
+
orientation?: 'horizontal' | 'vertical';
|
|
19
|
+
loop?: boolean;
|
|
20
|
+
name?: string;
|
|
21
|
+
color?: 'primary' | 'secondary' | 'success' | 'info' | 'warning' | 'error' | 'neutral';
|
|
22
|
+
indicator?: 'start' | 'end' | 'hidden';
|
|
23
|
+
ui?: Record<string, unknown>;
|
|
24
|
+
}
|
|
25
|
+
declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
26
|
+
context: {
|
|
27
|
+
type: PropType<FormKitFrameworkContext & FormKitRadioGroupProps>;
|
|
28
|
+
required: true;
|
|
29
|
+
};
|
|
30
|
+
}>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
31
|
+
context: {
|
|
32
|
+
type: PropType<FormKitFrameworkContext & FormKitRadioGroupProps>;
|
|
33
|
+
required: true;
|
|
34
|
+
};
|
|
35
|
+
}>> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
36
|
+
declare const _default: typeof __VLS_export;
|
|
37
|
+
export default _default;
|
|
@@ -0,0 +1,35 @@
|
|
|
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, styleClass, color, modelValue, items } = useFormKitInput(props.context);
|
|
10
|
+
</script>
|
|
11
|
+
|
|
12
|
+
<template>
|
|
13
|
+
<URadioGroup
|
|
14
|
+
:id="context.id"
|
|
15
|
+
v-model="modelValue"
|
|
16
|
+
v-bind="{ ...context?.attrs }"
|
|
17
|
+
:class="styleClass"
|
|
18
|
+
:disabled="!!context?.disabled"
|
|
19
|
+
:style="context?.attrs.style"
|
|
20
|
+
:color="color"
|
|
21
|
+
:size="context.size ?? 'md'"
|
|
22
|
+
:variant="context.variant ?? 'list'"
|
|
23
|
+
:orientation="context.orientation ?? 'vertical'"
|
|
24
|
+
:items="items"
|
|
25
|
+
:legend="context.legend"
|
|
26
|
+
:value-key="context.valueKey"
|
|
27
|
+
:label-key="context.labelKey"
|
|
28
|
+
:description-key="context.descriptionKey"
|
|
29
|
+
:loop="context.loop ?? false"
|
|
30
|
+
:name="context.name"
|
|
31
|
+
:ui="context.ui"
|
|
32
|
+
@change="handleChange"
|
|
33
|
+
@update:model-value="handleInput"
|
|
34
|
+
/>
|
|
35
|
+
</template>
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import type { FormKitFrameworkContext } from '@formkit/core';
|
|
2
|
+
import type { PropType } from 'vue';
|
|
3
|
+
export interface RadioOption {
|
|
4
|
+
value: string | number | boolean;
|
|
5
|
+
label?: string;
|
|
6
|
+
description?: string;
|
|
7
|
+
disabled?: boolean;
|
|
8
|
+
[key: string]: unknown;
|
|
9
|
+
}
|
|
10
|
+
export interface FormKitRadioGroupProps {
|
|
11
|
+
options?: RadioOption[];
|
|
12
|
+
legend?: string;
|
|
13
|
+
valueKey?: string;
|
|
14
|
+
labelKey?: string;
|
|
15
|
+
descriptionKey?: string;
|
|
16
|
+
size?: 'xs' | 'sm' | 'md' | 'lg' | 'xl';
|
|
17
|
+
variant?: 'table' | 'list' | 'card';
|
|
18
|
+
orientation?: 'horizontal' | 'vertical';
|
|
19
|
+
loop?: boolean;
|
|
20
|
+
name?: string;
|
|
21
|
+
color?: 'primary' | 'secondary' | 'success' | 'info' | 'warning' | 'error' | 'neutral';
|
|
22
|
+
indicator?: 'start' | 'end' | 'hidden';
|
|
23
|
+
ui?: Record<string, unknown>;
|
|
24
|
+
}
|
|
25
|
+
declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
26
|
+
context: {
|
|
27
|
+
type: PropType<FormKitFrameworkContext & FormKitRadioGroupProps>;
|
|
28
|
+
required: true;
|
|
29
|
+
};
|
|
30
|
+
}>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
31
|
+
context: {
|
|
32
|
+
type: PropType<FormKitFrameworkContext & FormKitRadioGroupProps>;
|
|
33
|
+
required: true;
|
|
34
|
+
};
|
|
35
|
+
}>> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
36
|
+
declare const _default: typeof __VLS_export;
|
|
37
|
+
export default _default;
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import type { FormKitFrameworkContext } from '@formkit/core';
|
|
2
|
+
import type { PropType } from 'vue';
|
|
3
|
+
import type { SelectMenuItem } from '#ui/components/SelectMenu.vue';
|
|
4
|
+
import type { AvatarProps } from '#ui/components/Avatar.vue';
|
|
5
|
+
export interface FormKitSelectProps {
|
|
6
|
+
options?: string[] | SelectMenuItem[] | SelectMenuItem[][];
|
|
7
|
+
placeholder?: string;
|
|
8
|
+
color?: 'primary' | 'secondary' | 'success' | 'info' | 'warning' | 'error' | 'neutral';
|
|
9
|
+
variant?: 'outline' | 'soft' | 'subtle' | 'ghost' | 'none';
|
|
10
|
+
size?: 'xs' | 'sm' | 'md' | 'lg' | 'xl';
|
|
11
|
+
selectedIcon?: string;
|
|
12
|
+
arrow?: boolean;
|
|
13
|
+
portal?: boolean;
|
|
14
|
+
valueKey?: string;
|
|
15
|
+
labelKey?: string;
|
|
16
|
+
descriptionKey?: string;
|
|
17
|
+
defaultValue?: unknown;
|
|
18
|
+
multiple?: boolean;
|
|
19
|
+
highlight?: boolean;
|
|
20
|
+
fixed?: boolean;
|
|
21
|
+
autofocus?: boolean;
|
|
22
|
+
autofocusDelay?: number;
|
|
23
|
+
open?: boolean;
|
|
24
|
+
defaultOpen?: boolean;
|
|
25
|
+
autocomplete?: string & {} | 'on' | 'off';
|
|
26
|
+
icon?: string;
|
|
27
|
+
avatar?: AvatarProps;
|
|
28
|
+
leading?: boolean;
|
|
29
|
+
leadingIcon?: string;
|
|
30
|
+
trailing?: boolean;
|
|
31
|
+
trailingIcon?: string;
|
|
32
|
+
loading?: boolean;
|
|
33
|
+
loadingIcon?: string;
|
|
34
|
+
ui?: Record<string, unknown>;
|
|
35
|
+
}
|
|
36
|
+
declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
37
|
+
context: {
|
|
38
|
+
type: PropType<FormKitFrameworkContext & FormKitSelectProps>;
|
|
39
|
+
required: true;
|
|
40
|
+
};
|
|
41
|
+
}>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
42
|
+
context: {
|
|
43
|
+
type: PropType<FormKitFrameworkContext & FormKitSelectProps>;
|
|
44
|
+
required: true;
|
|
45
|
+
};
|
|
46
|
+
}>> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
47
|
+
declare const _default: typeof __VLS_export;
|
|
48
|
+
export default _default;
|
|
@@ -0,0 +1,51 @@
|
|
|
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, isInvalid, color, styleClass, modelValue, items } = useFormKitInput(props.context);
|
|
10
|
+
</script>
|
|
11
|
+
|
|
12
|
+
<template>
|
|
13
|
+
<USelect
|
|
14
|
+
:id="context.id"
|
|
15
|
+
v-model="modelValue"
|
|
16
|
+
v-bind="{ ...context?.attrs }"
|
|
17
|
+
:class="styleClass"
|
|
18
|
+
:disabled="!!context?.disabled"
|
|
19
|
+
:style="context?.attrs.style"
|
|
20
|
+
:color="color"
|
|
21
|
+
:highlight="isInvalid || context.highlight"
|
|
22
|
+
:size="context.size ?? 'md'"
|
|
23
|
+
:variant="context.variant ?? 'outline'"
|
|
24
|
+
:items="items"
|
|
25
|
+
:placeholder="context.placeholder"
|
|
26
|
+
:selected-icon="context.selectedIcon"
|
|
27
|
+
:icon="context.icon"
|
|
28
|
+
:avatar="context.avatar"
|
|
29
|
+
:leading="context.leading"
|
|
30
|
+
:leading-icon="context.leadingIcon"
|
|
31
|
+
:trailing="context.trailing"
|
|
32
|
+
:trailing-icon="context.trailingIcon"
|
|
33
|
+
:loading="context.loading"
|
|
34
|
+
:loading-icon="context.loadingIcon"
|
|
35
|
+
:arrow="context.arrow"
|
|
36
|
+
:portal="context.portal"
|
|
37
|
+
:value-key="context.valueKey"
|
|
38
|
+
:label-key="context.labelKey"
|
|
39
|
+
:description-key="context.descriptionKey"
|
|
40
|
+
:default-value="context.defaultValue"
|
|
41
|
+
:multiple="context.multiple"
|
|
42
|
+
:autofocus="context.autofocus"
|
|
43
|
+
:autofocus-delay="context.autofocusDelay"
|
|
44
|
+
:open="context.open"
|
|
45
|
+
:default-open="context.defaultOpen"
|
|
46
|
+
:autocomplete="context.autocomplete"
|
|
47
|
+
:ui="context.ui"
|
|
48
|
+
@change="handleChange"
|
|
49
|
+
@update:model-value="handleInput"
|
|
50
|
+
/>
|
|
51
|
+
</template>
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import type { FormKitFrameworkContext } from '@formkit/core';
|
|
2
|
+
import type { PropType } from 'vue';
|
|
3
|
+
import type { SelectMenuItem } from '#ui/components/SelectMenu.vue';
|
|
4
|
+
import type { AvatarProps } from '#ui/components/Avatar.vue';
|
|
5
|
+
export interface FormKitSelectProps {
|
|
6
|
+
options?: string[] | SelectMenuItem[] | SelectMenuItem[][];
|
|
7
|
+
placeholder?: string;
|
|
8
|
+
color?: 'primary' | 'secondary' | 'success' | 'info' | 'warning' | 'error' | 'neutral';
|
|
9
|
+
variant?: 'outline' | 'soft' | 'subtle' | 'ghost' | 'none';
|
|
10
|
+
size?: 'xs' | 'sm' | 'md' | 'lg' | 'xl';
|
|
11
|
+
selectedIcon?: string;
|
|
12
|
+
arrow?: boolean;
|
|
13
|
+
portal?: boolean;
|
|
14
|
+
valueKey?: string;
|
|
15
|
+
labelKey?: string;
|
|
16
|
+
descriptionKey?: string;
|
|
17
|
+
defaultValue?: unknown;
|
|
18
|
+
multiple?: boolean;
|
|
19
|
+
highlight?: boolean;
|
|
20
|
+
fixed?: boolean;
|
|
21
|
+
autofocus?: boolean;
|
|
22
|
+
autofocusDelay?: number;
|
|
23
|
+
open?: boolean;
|
|
24
|
+
defaultOpen?: boolean;
|
|
25
|
+
autocomplete?: string & {} | 'on' | 'off';
|
|
26
|
+
icon?: string;
|
|
27
|
+
avatar?: AvatarProps;
|
|
28
|
+
leading?: boolean;
|
|
29
|
+
leadingIcon?: string;
|
|
30
|
+
trailing?: boolean;
|
|
31
|
+
trailingIcon?: string;
|
|
32
|
+
loading?: boolean;
|
|
33
|
+
loadingIcon?: string;
|
|
34
|
+
ui?: Record<string, unknown>;
|
|
35
|
+
}
|
|
36
|
+
declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
37
|
+
context: {
|
|
38
|
+
type: PropType<FormKitFrameworkContext & FormKitSelectProps>;
|
|
39
|
+
required: true;
|
|
40
|
+
};
|
|
41
|
+
}>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
42
|
+
context: {
|
|
43
|
+
type: PropType<FormKitFrameworkContext & FormKitSelectProps>;
|
|
44
|
+
required: true;
|
|
45
|
+
};
|
|
46
|
+
}>> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
47
|
+
declare const _default: typeof __VLS_export;
|
|
48
|
+
export default _default;
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import type { FormKitFrameworkContext } from '@formkit/core';
|
|
2
|
+
import type { PropType } from 'vue';
|
|
3
|
+
import type { AvatarProps } from '#ui/components/Avatar.vue';
|
|
4
|
+
export interface SelectMenuGroup {
|
|
5
|
+
label?: string;
|
|
6
|
+
items: SelectMenuItem[];
|
|
7
|
+
}
|
|
8
|
+
export interface SelectMenuItem {
|
|
9
|
+
label?: string;
|
|
10
|
+
value?: string | number | boolean;
|
|
11
|
+
icon?: string;
|
|
12
|
+
avatar?: {
|
|
13
|
+
src?: string;
|
|
14
|
+
alt?: string;
|
|
15
|
+
};
|
|
16
|
+
chip?: string | number;
|
|
17
|
+
disabled?: boolean;
|
|
18
|
+
[key: string]: unknown;
|
|
19
|
+
}
|
|
20
|
+
export interface FormKitSelectMenuProps {
|
|
21
|
+
options?: SelectMenuItem[] | SelectMenuGroup[];
|
|
22
|
+
placeholder?: string;
|
|
23
|
+
searchInput?: boolean;
|
|
24
|
+
color?: 'primary' | 'secondary' | 'success' | 'info' | 'warning' | 'error' | 'neutral';
|
|
25
|
+
variant?: 'outline' | 'soft' | 'subtle' | 'ghost' | 'none';
|
|
26
|
+
size?: 'xs' | 'sm' | 'md' | 'lg' | 'xl';
|
|
27
|
+
icon?: string;
|
|
28
|
+
avatar?: AvatarProps;
|
|
29
|
+
leading?: boolean;
|
|
30
|
+
leadingIcon?: string;
|
|
31
|
+
trailing?: boolean;
|
|
32
|
+
trailingIcon?: string;
|
|
33
|
+
loading?: boolean;
|
|
34
|
+
loadingIcon?: string;
|
|
35
|
+
selectedIcon?: string;
|
|
36
|
+
clear?: boolean;
|
|
37
|
+
arrow?: boolean;
|
|
38
|
+
portal?: boolean;
|
|
39
|
+
virtualize?: boolean;
|
|
40
|
+
valueKey?: string;
|
|
41
|
+
labelKey?: string;
|
|
42
|
+
descriptionKey?: string;
|
|
43
|
+
defaultValue?: unknown;
|
|
44
|
+
multiple?: boolean;
|
|
45
|
+
highlight?: boolean;
|
|
46
|
+
fixed?: boolean;
|
|
47
|
+
createItem?: boolean;
|
|
48
|
+
filterFields?: string[];
|
|
49
|
+
ignoreFilter?: boolean;
|
|
50
|
+
autofocus?: boolean;
|
|
51
|
+
autofocusDelay?: number;
|
|
52
|
+
open?: boolean;
|
|
53
|
+
defaultOpen?: boolean;
|
|
54
|
+
resetSearchTermOnBlur?: boolean;
|
|
55
|
+
resetSearchTermOnSelect?: boolean;
|
|
56
|
+
resetModelValueOnClear?: boolean;
|
|
57
|
+
highlightOnHover?: boolean;
|
|
58
|
+
searchTerm?: string;
|
|
59
|
+
ui?: Record<string, unknown>;
|
|
60
|
+
}
|
|
61
|
+
declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
62
|
+
context: {
|
|
63
|
+
type: PropType<FormKitFrameworkContext & FormKitSelectMenuProps>;
|
|
64
|
+
required: true;
|
|
65
|
+
};
|
|
66
|
+
}>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
67
|
+
context: {
|
|
68
|
+
type: PropType<FormKitFrameworkContext & FormKitSelectMenuProps>;
|
|
69
|
+
required: true;
|
|
70
|
+
};
|
|
71
|
+
}>> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
72
|
+
declare const _default: typeof __VLS_export;
|
|
73
|
+
export default _default;
|
|
@@ -0,0 +1,62 @@
|
|
|
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, isInvalid, styleClass, color, modelValue, items } = useFormKitInput(props.context);
|
|
10
|
+
</script>
|
|
11
|
+
|
|
12
|
+
<template>
|
|
13
|
+
<USelectMenu
|
|
14
|
+
:id="context.id"
|
|
15
|
+
v-model="modelValue"
|
|
16
|
+
v-bind="{ ...context?.attrs }"
|
|
17
|
+
:class="styleClass"
|
|
18
|
+
:disabled="!!context?.disabled"
|
|
19
|
+
:style="context?.attrs.style"
|
|
20
|
+
:color="color"
|
|
21
|
+
:highlight="isInvalid || context.highlight"
|
|
22
|
+
:size="context.size ?? 'md'"
|
|
23
|
+
:variant="context.variant ?? 'outline'"
|
|
24
|
+
:items="items"
|
|
25
|
+
:placeholder="context.placeholder"
|
|
26
|
+
:selected-icon="context.selectedIcon"
|
|
27
|
+
:icon="context.icon"
|
|
28
|
+
:avatar="context.avatar"
|
|
29
|
+
:leading="context.leading"
|
|
30
|
+
:leading-icon="context.leadingIcon"
|
|
31
|
+
:trailing="context.trailing"
|
|
32
|
+
:trailing-icon="context.trailingIcon"
|
|
33
|
+
:loading="context.loading"
|
|
34
|
+
:loading-icon="context.loadingIcon"
|
|
35
|
+
:search-input="context.searchInput"
|
|
36
|
+
:clear="context.clear"
|
|
37
|
+
:clear-icon="context.clearIcon"
|
|
38
|
+
:arrow="context.arrow"
|
|
39
|
+
:portal="context.portal"
|
|
40
|
+
:virtualize="context.virtualize"
|
|
41
|
+
:value-key="context.valueKey"
|
|
42
|
+
:label-key="context.labelKey"
|
|
43
|
+
:description-key="context.descriptionKey"
|
|
44
|
+
:default-value="context.defaultValue"
|
|
45
|
+
:multiple="context.multiple"
|
|
46
|
+
:create-item="context.createItem"
|
|
47
|
+
:filter-fields="context.filterFields"
|
|
48
|
+
:ignore-filter="context.ignoreFilter"
|
|
49
|
+
:autofocus="context.autofocus"
|
|
50
|
+
:autofocus-delay="context.autofocusDelay"
|
|
51
|
+
:open="context.open"
|
|
52
|
+
:default-open="context.defaultOpen"
|
|
53
|
+
:reset-search-term-on-blur="context.resetSearchTermOnBlur"
|
|
54
|
+
:reset-search-term-on-select="context.resetSearchTermOnSelect"
|
|
55
|
+
:reset-model-value-on-clear="context.resetModelValueOnClear"
|
|
56
|
+
:highlight-on-hover="context.highlightOnHover"
|
|
57
|
+
:search-term="context.searchTerm"
|
|
58
|
+
:ui="context.ui"
|
|
59
|
+
@change="handleChange"
|
|
60
|
+
@update:model-value="handleInput"
|
|
61
|
+
/>
|
|
62
|
+
</template>
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import type { FormKitFrameworkContext } from '@formkit/core';
|
|
2
|
+
import type { PropType } from 'vue';
|
|
3
|
+
import type { AvatarProps } from '#ui/components/Avatar.vue';
|
|
4
|
+
export interface SelectMenuGroup {
|
|
5
|
+
label?: string;
|
|
6
|
+
items: SelectMenuItem[];
|
|
7
|
+
}
|
|
8
|
+
export interface SelectMenuItem {
|
|
9
|
+
label?: string;
|
|
10
|
+
value?: string | number | boolean;
|
|
11
|
+
icon?: string;
|
|
12
|
+
avatar?: {
|
|
13
|
+
src?: string;
|
|
14
|
+
alt?: string;
|
|
15
|
+
};
|
|
16
|
+
chip?: string | number;
|
|
17
|
+
disabled?: boolean;
|
|
18
|
+
[key: string]: unknown;
|
|
19
|
+
}
|
|
20
|
+
export interface FormKitSelectMenuProps {
|
|
21
|
+
options?: SelectMenuItem[] | SelectMenuGroup[];
|
|
22
|
+
placeholder?: string;
|
|
23
|
+
searchInput?: boolean;
|
|
24
|
+
color?: 'primary' | 'secondary' | 'success' | 'info' | 'warning' | 'error' | 'neutral';
|
|
25
|
+
variant?: 'outline' | 'soft' | 'subtle' | 'ghost' | 'none';
|
|
26
|
+
size?: 'xs' | 'sm' | 'md' | 'lg' | 'xl';
|
|
27
|
+
icon?: string;
|
|
28
|
+
avatar?: AvatarProps;
|
|
29
|
+
leading?: boolean;
|
|
30
|
+
leadingIcon?: string;
|
|
31
|
+
trailing?: boolean;
|
|
32
|
+
trailingIcon?: string;
|
|
33
|
+
loading?: boolean;
|
|
34
|
+
loadingIcon?: string;
|
|
35
|
+
selectedIcon?: string;
|
|
36
|
+
clear?: boolean;
|
|
37
|
+
arrow?: boolean;
|
|
38
|
+
portal?: boolean;
|
|
39
|
+
virtualize?: boolean;
|
|
40
|
+
valueKey?: string;
|
|
41
|
+
labelKey?: string;
|
|
42
|
+
descriptionKey?: string;
|
|
43
|
+
defaultValue?: unknown;
|
|
44
|
+
multiple?: boolean;
|
|
45
|
+
highlight?: boolean;
|
|
46
|
+
fixed?: boolean;
|
|
47
|
+
createItem?: boolean;
|
|
48
|
+
filterFields?: string[];
|
|
49
|
+
ignoreFilter?: boolean;
|
|
50
|
+
autofocus?: boolean;
|
|
51
|
+
autofocusDelay?: number;
|
|
52
|
+
open?: boolean;
|
|
53
|
+
defaultOpen?: boolean;
|
|
54
|
+
resetSearchTermOnBlur?: boolean;
|
|
55
|
+
resetSearchTermOnSelect?: boolean;
|
|
56
|
+
resetModelValueOnClear?: boolean;
|
|
57
|
+
highlightOnHover?: boolean;
|
|
58
|
+
searchTerm?: string;
|
|
59
|
+
ui?: Record<string, unknown>;
|
|
60
|
+
}
|
|
61
|
+
declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
62
|
+
context: {
|
|
63
|
+
type: PropType<FormKitFrameworkContext & FormKitSelectMenuProps>;
|
|
64
|
+
required: true;
|
|
65
|
+
};
|
|
66
|
+
}>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
67
|
+
context: {
|
|
68
|
+
type: PropType<FormKitFrameworkContext & FormKitSelectMenuProps>;
|
|
69
|
+
required: true;
|
|
70
|
+
};
|
|
71
|
+
}>> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
72
|
+
declare const _default: typeof __VLS_export;
|
|
73
|
+
export default _default;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import type { FormKitFrameworkContext } from '@formkit/core';
|
|
2
|
+
import type { PropType } from 'vue';
|
|
3
|
+
export interface FormKitSliderProps {
|
|
4
|
+
color?: 'primary' | 'secondary' | 'success' | 'info' | 'warning' | 'error' | 'neutral';
|
|
5
|
+
size?: 'xs' | 'sm' | 'md' | 'lg' | 'xl';
|
|
6
|
+
orientation?: 'horizontal' | 'vertical';
|
|
7
|
+
tooltip?: boolean;
|
|
8
|
+
defaultValue?: number | number[];
|
|
9
|
+
name?: string;
|
|
10
|
+
inverted?: boolean;
|
|
11
|
+
min?: number;
|
|
12
|
+
max?: number;
|
|
13
|
+
step?: number;
|
|
14
|
+
minStepsBetweenThumbs?: number;
|
|
15
|
+
ui?: Record<string, unknown>;
|
|
16
|
+
}
|
|
17
|
+
declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
18
|
+
context: {
|
|
19
|
+
type: PropType<FormKitFrameworkContext & FormKitSliderProps>;
|
|
20
|
+
required: true;
|
|
21
|
+
};
|
|
22
|
+
}>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
23
|
+
context: {
|
|
24
|
+
type: PropType<FormKitFrameworkContext & FormKitSliderProps>;
|
|
25
|
+
required: true;
|
|
26
|
+
};
|
|
27
|
+
}>> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
28
|
+
declare const _default: typeof __VLS_export;
|
|
29
|
+
export default _default;
|
|
@@ -0,0 +1,36 @@
|
|
|
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, styleClass, color, modelValue } = useFormKitInput(props.context);
|
|
10
|
+
</script>
|
|
11
|
+
|
|
12
|
+
<template>
|
|
13
|
+
<USlider
|
|
14
|
+
:id="context.id"
|
|
15
|
+
v-model="modelValue"
|
|
16
|
+
v-bind="{ ...context?.attrs }"
|
|
17
|
+
:class="styleClass"
|
|
18
|
+
:disabled="!!context?.disabled"
|
|
19
|
+
:style="context?.attrs.style"
|
|
20
|
+
:color="color"
|
|
21
|
+
:size="context.size ?? 'md'"
|
|
22
|
+
:variant="context.variant ?? 'outline'"
|
|
23
|
+
:orientation="context.orientation ?? 'horizontal'"
|
|
24
|
+
:tooltip="context.tooltip"
|
|
25
|
+
:default-value="context.defaultValue"
|
|
26
|
+
:name="context.name"
|
|
27
|
+
:inverted="context.inverted"
|
|
28
|
+
:min="context.min"
|
|
29
|
+
:max="context.max"
|
|
30
|
+
:step="context.step"
|
|
31
|
+
:min-steps-between-thumbs="context.minStepsBetweenThumbs"
|
|
32
|
+
:ui="context.ui"
|
|
33
|
+
@change="handleChange"
|
|
34
|
+
@update:model-value="handleInput"
|
|
35
|
+
/>
|
|
36
|
+
</template>
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import type { FormKitFrameworkContext } from '@formkit/core';
|
|
2
|
+
import type { PropType } from 'vue';
|
|
3
|
+
export interface FormKitSliderProps {
|
|
4
|
+
color?: 'primary' | 'secondary' | 'success' | 'info' | 'warning' | 'error' | 'neutral';
|
|
5
|
+
size?: 'xs' | 'sm' | 'md' | 'lg' | 'xl';
|
|
6
|
+
orientation?: 'horizontal' | 'vertical';
|
|
7
|
+
tooltip?: boolean;
|
|
8
|
+
defaultValue?: number | number[];
|
|
9
|
+
name?: string;
|
|
10
|
+
inverted?: boolean;
|
|
11
|
+
min?: number;
|
|
12
|
+
max?: number;
|
|
13
|
+
step?: number;
|
|
14
|
+
minStepsBetweenThumbs?: number;
|
|
15
|
+
ui?: Record<string, unknown>;
|
|
16
|
+
}
|
|
17
|
+
declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
18
|
+
context: {
|
|
19
|
+
type: PropType<FormKitFrameworkContext & FormKitSliderProps>;
|
|
20
|
+
required: true;
|
|
21
|
+
};
|
|
22
|
+
}>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
23
|
+
context: {
|
|
24
|
+
type: PropType<FormKitFrameworkContext & FormKitSliderProps>;
|
|
25
|
+
required: true;
|
|
26
|
+
};
|
|
27
|
+
}>> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
28
|
+
declare const _default: typeof __VLS_export;
|
|
29
|
+
export default _default;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { FormKitFrameworkContext } from '@formkit/core';
|
|
2
|
+
import type { PropType } from 'vue';
|
|
3
|
+
export interface FormKitSwitchProps {
|
|
4
|
+
color?: 'primary' | 'secondary' | 'success' | 'info' | 'warning' | 'error' | 'neutral';
|
|
5
|
+
size?: 'xs' | 'sm' | 'md' | 'lg' | 'xl';
|
|
6
|
+
loading?: boolean;
|
|
7
|
+
loadingIcon?: string;
|
|
8
|
+
checkedIcon?: string;
|
|
9
|
+
uncheckedIcon?: string;
|
|
10
|
+
label?: string;
|
|
11
|
+
description?: string;
|
|
12
|
+
defaultValue?: boolean;
|
|
13
|
+
autofocus?: false | true | 'true' | 'false';
|
|
14
|
+
ui?: Record<string, unknown>;
|
|
15
|
+
}
|
|
16
|
+
declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
17
|
+
context: {
|
|
18
|
+
type: PropType<FormKitFrameworkContext & FormKitSwitchProps>;
|
|
19
|
+
required: true;
|
|
20
|
+
};
|
|
21
|
+
}>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
22
|
+
context: {
|
|
23
|
+
type: PropType<FormKitFrameworkContext & FormKitSwitchProps>;
|
|
24
|
+
required: true;
|
|
25
|
+
};
|
|
26
|
+
}>> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
27
|
+
declare const _default: typeof __VLS_export;
|
|
28
|
+
export default _default;
|
|
@@ -0,0 +1,34 @@
|
|
|
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, styleClass, color, modelValue } = useFormKitInput(props.context);
|
|
10
|
+
</script>
|
|
11
|
+
|
|
12
|
+
<template>
|
|
13
|
+
<USwitch
|
|
14
|
+
:id="context.id"
|
|
15
|
+
v-model="modelValue"
|
|
16
|
+
v-bind="{ ...context?.attrs }"
|
|
17
|
+
:class="styleClass"
|
|
18
|
+
:disabled="!!context?.disabled"
|
|
19
|
+
:style="context?.attrs.style"
|
|
20
|
+
:color="color"
|
|
21
|
+
:size="context.size ?? 'md'"
|
|
22
|
+
:loading="context.loading"
|
|
23
|
+
:loading-icon="context.loadingIcon"
|
|
24
|
+
:checked-icon="context.checkedIcon"
|
|
25
|
+
:unchecked-icon="context.uncheckedIcon"
|
|
26
|
+
:label="context.label"
|
|
27
|
+
:description="context.description"
|
|
28
|
+
:default-value="context.defaultValue"
|
|
29
|
+
:autofocus="context.autofocus"
|
|
30
|
+
:ui="context.ui"
|
|
31
|
+
@change="handleChange"
|
|
32
|
+
@update:model-value="handleInput"
|
|
33
|
+
/>
|
|
34
|
+
</template>
|