nuance-ui 0.2.11 → 0.2.14

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 (51) hide show
  1. package/dist/module.json +1 -1
  2. package/dist/module.mjs +12 -0
  3. package/dist/runtime/components/app-shell/app-shell.d.vue.ts +8 -0
  4. package/dist/runtime/components/app-shell/app-shell.vue +9 -5
  5. package/dist/runtime/components/app-shell/app-shell.vue.d.ts +8 -0
  6. package/dist/runtime/components/checkbox/checkbox.vue +1 -1
  7. package/dist/runtime/components/input/number-input.vue +1 -1
  8. package/dist/runtime/components/input/text-input.vue +4 -1
  9. package/dist/runtime/components/textarea.d.vue.ts +5 -3
  10. package/dist/runtime/components/textarea.vue +27 -14
  11. package/dist/runtime/components/textarea.vue.d.ts +5 -3
  12. package/dist/runtime/form/checkbox-field.d.vue.ts +38 -0
  13. package/dist/runtime/form/checkbox-field.vue +68 -0
  14. package/dist/runtime/form/checkbox-field.vue.d.ts +38 -0
  15. package/dist/runtime/form/checkbox-group-field.d.vue.ts +35 -0
  16. package/dist/runtime/form/checkbox-group-field.vue +62 -0
  17. package/dist/runtime/form/checkbox-group-field.vue.d.ts +35 -0
  18. package/dist/runtime/form/date-field.d.vue.ts +45 -0
  19. package/dist/runtime/form/date-field.vue +88 -0
  20. package/dist/runtime/form/date-field.vue.d.ts +45 -0
  21. package/dist/runtime/form/date-time-field.d.vue.ts +37 -0
  22. package/dist/runtime/form/date-time-field.vue +76 -0
  23. package/dist/runtime/form/date-time-field.vue.d.ts +37 -0
  24. package/dist/runtime/form/email-field.d.vue.ts +37 -0
  25. package/dist/runtime/form/email-field.vue +76 -0
  26. package/dist/runtime/form/email-field.vue.d.ts +37 -0
  27. package/dist/runtime/form/number-field.d.vue.ts +37 -0
  28. package/dist/runtime/form/number-field.vue +79 -0
  29. package/dist/runtime/form/number-field.vue.d.ts +37 -0
  30. package/dist/runtime/form/password-field.d.vue.ts +37 -0
  31. package/dist/runtime/form/password-field.vue +76 -0
  32. package/dist/runtime/form/password-field.vue.d.ts +37 -0
  33. package/dist/runtime/form/select-field.d.vue.ts +50 -0
  34. package/dist/runtime/form/select-field.vue +86 -0
  35. package/dist/runtime/form/select-field.vue.d.ts +50 -0
  36. package/dist/runtime/form/switch-field.d.vue.ts +33 -0
  37. package/dist/runtime/form/switch-field.vue +66 -0
  38. package/dist/runtime/form/switch-field.vue.d.ts +33 -0
  39. package/dist/runtime/form/switch-group-field.d.vue.ts +35 -0
  40. package/dist/runtime/form/switch-group-field.vue +62 -0
  41. package/dist/runtime/form/switch-group-field.vue.d.ts +35 -0
  42. package/dist/runtime/form/text-field.d.vue.ts +37 -0
  43. package/dist/runtime/form/text-field.vue +76 -0
  44. package/dist/runtime/form/text-field.vue.d.ts +37 -0
  45. package/dist/runtime/form/textarea-field.d.vue.ts +37 -0
  46. package/dist/runtime/form/textarea-field.vue +75 -0
  47. package/dist/runtime/form/textarea-field.vue.d.ts +37 -0
  48. package/dist/runtime/form/time-field.d.vue.ts +37 -0
  49. package/dist/runtime/form/time-field.vue +84 -0
  50. package/dist/runtime/form/time-field.vue.d.ts +37 -0
  51. package/package.json +2 -1
@@ -0,0 +1,76 @@
1
+ <script setup>
2
+ import { useField } from "vee-validate";
3
+ import PasswordInput from "../components/input/password-input.vue";
4
+ const {
5
+ name,
6
+ rules,
7
+ validateOn = "blur",
8
+ initialValue,
9
+ controlled = true,
10
+ ...props
11
+ } = defineProps({
12
+ name: { type: String, required: true },
13
+ rules: { type: [String, Object, Function, Array], required: false, skipCheck: true },
14
+ validateOn: { type: String, required: false },
15
+ initialValue: { type: String, required: false },
16
+ controlled: { type: Boolean, required: false },
17
+ multiline: { type: Boolean, required: false },
18
+ withAria: { type: Boolean, required: false },
19
+ classes: { type: Object, required: false },
20
+ icon: { type: String, required: false },
21
+ description: { type: String, required: false },
22
+ label: { type: String, required: false },
23
+ required: { type: Boolean, required: false },
24
+ id: { type: [String, null], required: false },
25
+ radius: { type: [String, Number, Object], required: false },
26
+ size: { type: [String, Object], required: false },
27
+ variant: { type: String, required: false },
28
+ resize: { type: void 0, required: false },
29
+ leftSectionPE: { type: void 0, required: false },
30
+ rightSectionPE: { type: void 0, required: false },
31
+ readonly: { type: Boolean, required: false },
32
+ disabled: { type: Boolean, required: false }
33
+ });
34
+ const {
35
+ value,
36
+ errorMessage,
37
+ handleBlur,
38
+ handleChange
39
+ } = useField(() => name, rules, {
40
+ validateOnValueUpdate: false,
41
+ validateOnMount: false,
42
+ initialValue,
43
+ controlled
44
+ });
45
+ </script>
46
+
47
+ <template>
48
+ <PasswordInput
49
+ v-bind='props'
50
+ :model-value='value'
51
+ :error='errorMessage'
52
+ :name
53
+ @update:model-value='handleChange($event, !!errorMessage)'
54
+ @blur='handleBlur($event, validateOn === "blur")'
55
+ >
56
+ <template v-if='$slots.leftSection' #leftSection>
57
+ <slot name='leftSection' />
58
+ </template>
59
+
60
+ <template v-if='$slots.rightSection' #rightSection>
61
+ <slot name='rightSection' />
62
+ </template>
63
+
64
+ <template v-if='$slots.label' #label>
65
+ <slot name='label' />
66
+ </template>
67
+
68
+ <template v-if='$slots.description' #description>
69
+ <slot name='description' />
70
+ </template>
71
+
72
+ <template v-if='$slots.error' #error>
73
+ <slot name='error' :error='errorMessage' />
74
+ </template>
75
+ </PasswordInput>
76
+ </template>
@@ -0,0 +1,37 @@
1
+ import type { RuleExpression } from 'vee-validate';
2
+ import type { TextInputProps } from '../components/input/text-input.vue.js';
3
+ export interface PasswordFieldProps extends Omit<TextInputProps, 'error'> {
4
+ /** Field name used by vee-validate */
5
+ name: string;
6
+ /** Validation rules, applied when `controlled: false` or as field-level override */
7
+ rules?: RuleExpression<string>;
8
+ /** When to trigger validation @default `'blur'` */
9
+ validateOn?: 'blur' | 'submit' | 'change';
10
+ /** Pre-fills the field value */
11
+ initialValue?: string;
12
+ /** If `false`, disconnects the field from the parent form context @default `true` */
13
+ controlled?: boolean;
14
+ }
15
+ declare var __VLS_12: {}, __VLS_15: {}, __VLS_18: {}, __VLS_21: {}, __VLS_24: {
16
+ error: string | undefined;
17
+ };
18
+ type __VLS_Slots = {} & {
19
+ leftSection?: (props: typeof __VLS_12) => any;
20
+ } & {
21
+ rightSection?: (props: typeof __VLS_15) => any;
22
+ } & {
23
+ label?: (props: typeof __VLS_18) => any;
24
+ } & {
25
+ description?: (props: typeof __VLS_21) => any;
26
+ } & {
27
+ error?: (props: typeof __VLS_24) => any;
28
+ };
29
+ declare const __VLS_base: import("vue").DefineComponent<PasswordFieldProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<PasswordFieldProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
30
+ declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
31
+ declare const _default: typeof __VLS_export;
32
+ export default _default;
33
+ type __VLS_WithSlots<T, S> = T & {
34
+ new (): {
35
+ $slots: S;
36
+ };
37
+ };
@@ -0,0 +1,50 @@
1
+ import type { RuleExpression } from 'vee-validate';
2
+ import type { ComboboxItemExt } from '../components/combobox/index.js';
3
+ import type { SelectProps } from '../components/select.vue.js';
4
+ export interface SelectFieldProps<Value extends string = string, Ext extends ComboboxItemExt = object> extends Omit<SelectProps<Value, Ext>, 'error'> {
5
+ /** Field name used by vee-validate */
6
+ name: string;
7
+ /** Validation rules, applied when `controlled: false` or as field-level override */
8
+ rules?: RuleExpression<string | string[] | null>;
9
+ /** When to trigger validation @default `'blur'` */
10
+ validateOn?: 'blur' | 'submit' | 'change';
11
+ /** Pre-fills the field value */
12
+ initialValue?: string | string[] | null;
13
+ /** If `false`, disconnects the field from the parent form context @default `true` */
14
+ controlled?: boolean;
15
+ }
16
+ declare const __VLS_export: <Value extends string = string, Ext extends ComboboxItemExt = object>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_exposed?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
17
+ props: import("vue").PublicProps & __VLS_PrettifyLocal<SelectFieldProps<Value, Ext>> & (typeof globalThis extends {
18
+ __VLS_PROPS_FALLBACK: infer P;
19
+ } ? P : {});
20
+ expose: (exposed: {}) => void;
21
+ attrs: any;
22
+ slots: {
23
+ leftSection?: (props: {}) => any;
24
+ } & {
25
+ rightSection?: (props: {}) => any;
26
+ } & {
27
+ label?: (props: {}) => any;
28
+ } & {
29
+ description?: (props: {}) => any;
30
+ } & {
31
+ error?: (props: {
32
+ error: string | undefined;
33
+ }) => any;
34
+ } & {
35
+ selection?: (props: {
36
+ value: string | string[] | null;
37
+ display: string;
38
+ }) => any;
39
+ };
40
+ emit: {};
41
+ }>) => import("vue").VNode & {
42
+ __ctx?: Awaited<typeof __VLS_setup>;
43
+ };
44
+ declare const _default: typeof __VLS_export;
45
+ export default _default;
46
+ type __VLS_PrettifyLocal<T> = (T extends any ? {
47
+ [K in keyof T]: T[K];
48
+ } : {
49
+ [K in keyof T as K]: T[K];
50
+ }) & {};
@@ -0,0 +1,86 @@
1
+ <script setup>
2
+ import { useField } from "vee-validate";
3
+ import Select from "../components/select.vue";
4
+ const {
5
+ name,
6
+ rules,
7
+ validateOn = "blur",
8
+ initialValue = null,
9
+ controlled = true,
10
+ ...props
11
+ } = defineProps({
12
+ name: { type: String, required: true },
13
+ rules: { type: [String, Object, Function, Array], required: false, skipCheck: true },
14
+ validateOn: { type: String, required: false },
15
+ initialValue: { type: [String, Array, null], required: false },
16
+ controlled: { type: Boolean, required: false },
17
+ options: { type: Array, required: true },
18
+ searchable: { type: Boolean, required: false },
19
+ multiple: { type: Boolean, required: false },
20
+ withCheckIcon: { type: Boolean, required: false },
21
+ iconPosition: { type: String, required: false },
22
+ nothingFoundMessage: { type: String, required: false },
23
+ allowDeselect: { type: Boolean, required: false },
24
+ closeOnSelect: { type: Boolean, required: false },
25
+ icon: { type: String, required: false },
26
+ limit: { type: Number, required: false },
27
+ autoComplete: { type: String, required: false },
28
+ withAria: { type: Boolean, required: false },
29
+ classes: { type: Object, required: false },
30
+ description: { type: String, required: false },
31
+ label: { type: String, required: false },
32
+ required: { type: Boolean, required: false },
33
+ radius: { type: [String, Number, Object], required: false },
34
+ size: { type: [String, Object], required: false },
35
+ variant: { type: String, required: false },
36
+ leftSectionPE: { type: void 0, required: false },
37
+ rightSectionPE: { type: void 0, required: false },
38
+ readonly: { type: Boolean, required: false },
39
+ disabled: { type: Boolean, required: false }
40
+ });
41
+ const {
42
+ value,
43
+ errorMessage,
44
+ handleBlur,
45
+ handleChange
46
+ } = useField(() => name, rules, {
47
+ validateOnValueUpdate: false,
48
+ validateOnMount: false,
49
+ initialValue,
50
+ controlled
51
+ });
52
+ </script>
53
+
54
+ <template>
55
+ <Select
56
+ v-bind='props'
57
+ :model-value='value'
58
+ :error='errorMessage'
59
+ @update:model-value='handleChange($event, !!errorMessage)'
60
+ @blur='handleBlur($event, validateOn === "blur")'
61
+ >
62
+ <template v-if='$slots.leftSection' #leftSection>
63
+ <slot name='leftSection' />
64
+ </template>
65
+
66
+ <template v-if='$slots.rightSection' #rightSection>
67
+ <slot name='rightSection' />
68
+ </template>
69
+
70
+ <template v-if='$slots.label' #label>
71
+ <slot name='label' />
72
+ </template>
73
+
74
+ <template v-if='$slots.description' #description>
75
+ <slot name='description' />
76
+ </template>
77
+
78
+ <template v-if='$slots.error' #error>
79
+ <slot name='error' :error='errorMessage' />
80
+ </template>
81
+
82
+ <template v-if='$slots.selection' #selection='slotProps'>
83
+ <slot name='selection' v-bind='slotProps' />
84
+ </template>
85
+ </Select>
86
+ </template>
@@ -0,0 +1,50 @@
1
+ import type { RuleExpression } from 'vee-validate';
2
+ import type { ComboboxItemExt } from '../components/combobox/index.js';
3
+ import type { SelectProps } from '../components/select.vue.js';
4
+ export interface SelectFieldProps<Value extends string = string, Ext extends ComboboxItemExt = object> extends Omit<SelectProps<Value, Ext>, 'error'> {
5
+ /** Field name used by vee-validate */
6
+ name: string;
7
+ /** Validation rules, applied when `controlled: false` or as field-level override */
8
+ rules?: RuleExpression<string | string[] | null>;
9
+ /** When to trigger validation @default `'blur'` */
10
+ validateOn?: 'blur' | 'submit' | 'change';
11
+ /** Pre-fills the field value */
12
+ initialValue?: string | string[] | null;
13
+ /** If `false`, disconnects the field from the parent form context @default `true` */
14
+ controlled?: boolean;
15
+ }
16
+ declare const __VLS_export: <Value extends string = string, Ext extends ComboboxItemExt = object>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_exposed?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
17
+ props: import("vue").PublicProps & __VLS_PrettifyLocal<SelectFieldProps<Value, Ext>> & (typeof globalThis extends {
18
+ __VLS_PROPS_FALLBACK: infer P;
19
+ } ? P : {});
20
+ expose: (exposed: {}) => void;
21
+ attrs: any;
22
+ slots: {
23
+ leftSection?: (props: {}) => any;
24
+ } & {
25
+ rightSection?: (props: {}) => any;
26
+ } & {
27
+ label?: (props: {}) => any;
28
+ } & {
29
+ description?: (props: {}) => any;
30
+ } & {
31
+ error?: (props: {
32
+ error: string | undefined;
33
+ }) => any;
34
+ } & {
35
+ selection?: (props: {
36
+ value: string | string[] | null;
37
+ display: string;
38
+ }) => any;
39
+ };
40
+ emit: {};
41
+ }>) => import("vue").VNode & {
42
+ __ctx?: Awaited<typeof __VLS_setup>;
43
+ };
44
+ declare const _default: typeof __VLS_export;
45
+ export default _default;
46
+ type __VLS_PrettifyLocal<T> = (T extends any ? {
47
+ [K in keyof T]: T[K];
48
+ } : {
49
+ [K in keyof T as K]: T[K];
50
+ }) & {};
@@ -0,0 +1,33 @@
1
+ import type { RuleExpression } from 'vee-validate';
2
+ import type { SwitchProps } from '../components/switch/switch.vue.js';
3
+ export interface SwitchFieldProps extends Omit<SwitchProps, 'error'> {
4
+ /** Field name used by vee-validate */
5
+ name: string;
6
+ /** Validation rules, applied when `controlled: false` or as field-level override */
7
+ rules?: RuleExpression<boolean>;
8
+ /** When to trigger validation @default `'change'` */
9
+ validateOn?: 'change' | 'submit';
10
+ /** Pre-fills the field value @default `false` */
11
+ initialValue?: boolean;
12
+ /** If `false`, disconnects the field from the parent form context @default `true` */
13
+ controlled?: boolean;
14
+ }
15
+ declare var __VLS_11: {}, __VLS_14: {}, __VLS_17: {
16
+ error: string | undefined;
17
+ };
18
+ type __VLS_Slots = {} & {
19
+ label?: (props: typeof __VLS_11) => any;
20
+ } & {
21
+ description?: (props: typeof __VLS_14) => any;
22
+ } & {
23
+ error?: (props: typeof __VLS_17) => any;
24
+ };
25
+ declare const __VLS_base: import("vue").DefineComponent<SwitchFieldProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<SwitchFieldProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
26
+ declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
27
+ declare const _default: typeof __VLS_export;
28
+ export default _default;
29
+ type __VLS_WithSlots<T, S> = T & {
30
+ new (): {
31
+ $slots: S;
32
+ };
33
+ };
@@ -0,0 +1,66 @@
1
+ <script setup>
2
+ import { useField } from "vee-validate";
3
+ import Switch from "../components/switch/switch.vue";
4
+ const {
5
+ name,
6
+ rules,
7
+ validateOn = "change",
8
+ initialValue = false,
9
+ controlled = true,
10
+ ...props
11
+ } = defineProps({
12
+ name: { type: String, required: true },
13
+ rules: { type: [String, Object, Function, Array], required: false, skipCheck: true },
14
+ validateOn: { type: String, required: false },
15
+ initialValue: { type: Boolean, required: false },
16
+ controlled: { type: Boolean, required: false },
17
+ id: { type: String, required: false },
18
+ value: { type: String, required: false },
19
+ offLabel: { type: String, required: false },
20
+ onLabel: { type: String, required: false },
21
+ color: { type: null, required: false },
22
+ size: { type: String, required: false },
23
+ radius: { type: [String, Number], required: false },
24
+ icon: { type: String, required: false },
25
+ withIndicator: { type: Boolean, required: false },
26
+ label: { type: String, required: false },
27
+ description: { type: String, required: false },
28
+ disabled: { type: Boolean, required: false, skipCheck: true },
29
+ labelPosition: { type: String, required: false },
30
+ bodyElement: { type: null, required: false },
31
+ labelElement: { type: null, required: false },
32
+ is: { type: null, required: false },
33
+ mod: { type: [Object, Array, null], required: false }
34
+ });
35
+ const {
36
+ value,
37
+ errorMessage,
38
+ handleChange
39
+ } = useField(() => name, rules, {
40
+ validateOnValueUpdate: false,
41
+ validateOnMount: false,
42
+ initialValue,
43
+ controlled
44
+ });
45
+ </script>
46
+
47
+ <template>
48
+ <Switch
49
+ v-bind='props'
50
+ :model-value='value'
51
+ :error='errorMessage'
52
+ @update:model-value='handleChange($event, validateOn === "change" || !!errorMessage)'
53
+ >
54
+ <template v-if='$slots.label' #label>
55
+ <slot name='label' />
56
+ </template>
57
+
58
+ <template v-if='$slots.description' #description>
59
+ <slot name='description' />
60
+ </template>
61
+
62
+ <template v-if='$slots.error' #error>
63
+ <slot name='error' :error='errorMessage' />
64
+ </template>
65
+ </Switch>
66
+ </template>
@@ -0,0 +1,33 @@
1
+ import type { RuleExpression } from 'vee-validate';
2
+ import type { SwitchProps } from '../components/switch/switch.vue.js';
3
+ export interface SwitchFieldProps extends Omit<SwitchProps, 'error'> {
4
+ /** Field name used by vee-validate */
5
+ name: string;
6
+ /** Validation rules, applied when `controlled: false` or as field-level override */
7
+ rules?: RuleExpression<boolean>;
8
+ /** When to trigger validation @default `'change'` */
9
+ validateOn?: 'change' | 'submit';
10
+ /** Pre-fills the field value @default `false` */
11
+ initialValue?: boolean;
12
+ /** If `false`, disconnects the field from the parent form context @default `true` */
13
+ controlled?: boolean;
14
+ }
15
+ declare var __VLS_11: {}, __VLS_14: {}, __VLS_17: {
16
+ error: string | undefined;
17
+ };
18
+ type __VLS_Slots = {} & {
19
+ label?: (props: typeof __VLS_11) => any;
20
+ } & {
21
+ description?: (props: typeof __VLS_14) => any;
22
+ } & {
23
+ error?: (props: typeof __VLS_17) => any;
24
+ };
25
+ declare const __VLS_base: import("vue").DefineComponent<SwitchFieldProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<SwitchFieldProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
26
+ declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
27
+ declare const _default: typeof __VLS_export;
28
+ export default _default;
29
+ type __VLS_WithSlots<T, S> = T & {
30
+ new (): {
31
+ $slots: S;
32
+ };
33
+ };
@@ -0,0 +1,35 @@
1
+ import type { RuleExpression } from 'vee-validate';
2
+ import type { SwitchGroupProps } from '../components/switch/switch-group.vue.js';
3
+ export interface SwitchGroupFieldProps extends Omit<SwitchGroupProps, 'error'> {
4
+ /** Field name used by vee-validate */
5
+ name: string;
6
+ /** Validation rules, applied when `controlled: false` or as field-level override */
7
+ rules?: RuleExpression<string[]>;
8
+ /** When to trigger validation @default `'change'` */
9
+ validateOn?: 'change' | 'submit';
10
+ /** Pre-fills the field value */
11
+ initialValue?: string[];
12
+ /** If `false`, disconnects the field from the parent form context @default `true` */
13
+ controlled?: boolean;
14
+ }
15
+ declare var __VLS_10: {}, __VLS_13: {}, __VLS_16: {}, __VLS_19: {
16
+ error: string | undefined;
17
+ };
18
+ type __VLS_Slots = {} & {
19
+ default?: (props: typeof __VLS_10) => any;
20
+ } & {
21
+ label?: (props: typeof __VLS_13) => any;
22
+ } & {
23
+ description?: (props: typeof __VLS_16) => any;
24
+ } & {
25
+ error?: (props: typeof __VLS_19) => any;
26
+ };
27
+ declare const __VLS_base: import("vue").DefineComponent<SwitchGroupFieldProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<SwitchGroupFieldProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
28
+ declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
29
+ declare const _default: typeof __VLS_export;
30
+ export default _default;
31
+ type __VLS_WithSlots<T, S> = T & {
32
+ new (): {
33
+ $slots: S;
34
+ };
35
+ };
@@ -0,0 +1,62 @@
1
+ <script setup>
2
+ import { useField } from "vee-validate";
3
+ import SwitchGroup from "../components/switch/switch-group.vue";
4
+ const {
5
+ name,
6
+ rules,
7
+ validateOn = "change",
8
+ initialValue,
9
+ controlled = true,
10
+ ...props
11
+ } = defineProps({
12
+ name: { type: String, required: true },
13
+ rules: { type: [String, Object, Function, Array], required: false, skipCheck: true },
14
+ validateOn: { type: String, required: false },
15
+ initialValue: { type: Array, required: false },
16
+ controlled: { type: Boolean, required: false },
17
+ size: { type: String, required: false },
18
+ readOnly: { type: Boolean, required: false },
19
+ disabled: { type: Boolean, required: false },
20
+ maxSelectedValues: { type: Number, required: false },
21
+ description: { type: String, required: false },
22
+ label: { type: String, required: false },
23
+ required: { type: Boolean, required: false },
24
+ radius: { type: [String, Number, Object], required: false },
25
+ variant: { type: String, required: false },
26
+ leftSectionPE: { type: void 0, required: false },
27
+ rightSectionPE: { type: void 0, required: false }
28
+ });
29
+ const {
30
+ value,
31
+ errorMessage,
32
+ handleChange
33
+ } = useField(() => name, rules, {
34
+ validateOnValueUpdate: false,
35
+ validateOnMount: false,
36
+ initialValue,
37
+ controlled
38
+ });
39
+ </script>
40
+
41
+ <template>
42
+ <SwitchGroup
43
+ v-bind='props'
44
+ :model-value='value ?? []'
45
+ :error='errorMessage'
46
+ @update:model-value='handleChange($event, validateOn === "change" || !!errorMessage)'
47
+ >
48
+ <slot />
49
+
50
+ <template v-if='$slots.label' #label>
51
+ <slot name='label' />
52
+ </template>
53
+
54
+ <template v-if='$slots.description' #description>
55
+ <slot name='description' />
56
+ </template>
57
+
58
+ <template v-if='$slots.error' #error>
59
+ <slot name='error' :error='errorMessage' />
60
+ </template>
61
+ </SwitchGroup>
62
+ </template>
@@ -0,0 +1,35 @@
1
+ import type { RuleExpression } from 'vee-validate';
2
+ import type { SwitchGroupProps } from '../components/switch/switch-group.vue.js';
3
+ export interface SwitchGroupFieldProps extends Omit<SwitchGroupProps, 'error'> {
4
+ /** Field name used by vee-validate */
5
+ name: string;
6
+ /** Validation rules, applied when `controlled: false` or as field-level override */
7
+ rules?: RuleExpression<string[]>;
8
+ /** When to trigger validation @default `'change'` */
9
+ validateOn?: 'change' | 'submit';
10
+ /** Pre-fills the field value */
11
+ initialValue?: string[];
12
+ /** If `false`, disconnects the field from the parent form context @default `true` */
13
+ controlled?: boolean;
14
+ }
15
+ declare var __VLS_10: {}, __VLS_13: {}, __VLS_16: {}, __VLS_19: {
16
+ error: string | undefined;
17
+ };
18
+ type __VLS_Slots = {} & {
19
+ default?: (props: typeof __VLS_10) => any;
20
+ } & {
21
+ label?: (props: typeof __VLS_13) => any;
22
+ } & {
23
+ description?: (props: typeof __VLS_16) => any;
24
+ } & {
25
+ error?: (props: typeof __VLS_19) => any;
26
+ };
27
+ declare const __VLS_base: import("vue").DefineComponent<SwitchGroupFieldProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<SwitchGroupFieldProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
28
+ declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
29
+ declare const _default: typeof __VLS_export;
30
+ export default _default;
31
+ type __VLS_WithSlots<T, S> = T & {
32
+ new (): {
33
+ $slots: S;
34
+ };
35
+ };
@@ -0,0 +1,37 @@
1
+ import type { RuleExpression } from 'vee-validate';
2
+ import type { TextInputProps } from '../components/input/text-input.vue.js';
3
+ export interface TextFieldProps extends Omit<TextInputProps, 'error'> {
4
+ /** Field name used by vee-validate */
5
+ name: string;
6
+ /** Validation rules, applied when `controlled: false` or as field-level override */
7
+ rules?: RuleExpression<string>;
8
+ /** When to trigger validation @default `'blur'` */
9
+ validateOn?: 'blur' | 'submit' | 'change';
10
+ /** Pre-fills the field value */
11
+ initialValue?: string;
12
+ /** If `false`, disconnects the field from the parent form context @default `true` */
13
+ controlled?: boolean;
14
+ }
15
+ declare var __VLS_12: {}, __VLS_15: {}, __VLS_18: {}, __VLS_21: {}, __VLS_24: {
16
+ error: string | undefined;
17
+ };
18
+ type __VLS_Slots = {} & {
19
+ leftSection?: (props: typeof __VLS_12) => any;
20
+ } & {
21
+ rightSection?: (props: typeof __VLS_15) => any;
22
+ } & {
23
+ label?: (props: typeof __VLS_18) => any;
24
+ } & {
25
+ description?: (props: typeof __VLS_21) => any;
26
+ } & {
27
+ error?: (props: typeof __VLS_24) => any;
28
+ };
29
+ declare const __VLS_base: import("vue").DefineComponent<TextFieldProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<TextFieldProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
30
+ declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
31
+ declare const _default: typeof __VLS_export;
32
+ export default _default;
33
+ type __VLS_WithSlots<T, S> = T & {
34
+ new (): {
35
+ $slots: S;
36
+ };
37
+ };