nuance-ui 0.2.11 → 0.2.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/module.json +1 -1
- package/dist/module.mjs +12 -0
- package/dist/runtime/components/input/number-input.vue +1 -1
- package/dist/runtime/components/input/text-input.vue +4 -1
- package/dist/runtime/components/textarea.d.vue.ts +5 -3
- package/dist/runtime/components/textarea.vue +27 -14
- package/dist/runtime/components/textarea.vue.d.ts +5 -3
- package/dist/runtime/form/date-field.d.vue.ts +45 -0
- package/dist/runtime/form/date-field.vue +88 -0
- package/dist/runtime/form/date-field.vue.d.ts +45 -0
- package/dist/runtime/form/date-time-field.d.vue.ts +37 -0
- package/dist/runtime/form/date-time-field.vue +76 -0
- package/dist/runtime/form/date-time-field.vue.d.ts +37 -0
- package/dist/runtime/form/email-field.d.vue.ts +37 -0
- package/dist/runtime/form/email-field.vue +76 -0
- package/dist/runtime/form/email-field.vue.d.ts +37 -0
- package/dist/runtime/form/number-field.d.vue.ts +37 -0
- package/dist/runtime/form/number-field.vue +79 -0
- package/dist/runtime/form/number-field.vue.d.ts +37 -0
- package/dist/runtime/form/password-field.d.vue.ts +37 -0
- package/dist/runtime/form/password-field.vue +76 -0
- package/dist/runtime/form/password-field.vue.d.ts +37 -0
- package/dist/runtime/form/select-field.d.vue.ts +50 -0
- package/dist/runtime/form/select-field.vue +86 -0
- package/dist/runtime/form/select-field.vue.d.ts +50 -0
- package/dist/runtime/form/text-field.d.vue.ts +37 -0
- package/dist/runtime/form/text-field.vue +76 -0
- package/dist/runtime/form/text-field.vue.d.ts +37 -0
- package/dist/runtime/form/textarea-field.d.vue.ts +37 -0
- package/dist/runtime/form/textarea-field.vue +75 -0
- package/dist/runtime/form/textarea-field.vue.d.ts +37 -0
- package/dist/runtime/form/time-field.d.vue.ts +37 -0
- package/dist/runtime/form/time-field.vue +84 -0
- package/dist/runtime/form/time-field.vue.d.ts +37 -0
- package/package.json +11 -2
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import type { RuleExpression } from 'vee-validate';
|
|
2
|
+
import type { NumberInputProps } from '../components/input/number-input.vue.js';
|
|
3
|
+
export interface NumberFieldProps extends Omit<NumberInputProps, '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<number>;
|
|
8
|
+
/** When to trigger validation @default `'blur'` */
|
|
9
|
+
validateOn?: 'blur' | 'submit' | 'change';
|
|
10
|
+
/** Pre-fills the field value */
|
|
11
|
+
initialValue?: number;
|
|
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<NumberFieldProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<NumberFieldProps> & 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,79 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import { useField } from "vee-validate";
|
|
3
|
+
import NumberInput from "../components/input/number-input.vue";
|
|
4
|
+
const {
|
|
5
|
+
name,
|
|
6
|
+
rules,
|
|
7
|
+
validateOn = "blur",
|
|
8
|
+
initialValue,
|
|
9
|
+
controlled = true,
|
|
10
|
+
min = Number.MIN_SAFE_INTEGER,
|
|
11
|
+
max = Number.MAX_SAFE_INTEGER,
|
|
12
|
+
...props
|
|
13
|
+
} = defineProps({
|
|
14
|
+
name: { type: String, required: true },
|
|
15
|
+
rules: { type: [String, Object, Function, Array], required: false, skipCheck: true },
|
|
16
|
+
validateOn: { type: String, required: false },
|
|
17
|
+
initialValue: { type: Number, required: false },
|
|
18
|
+
controlled: { type: Boolean, required: false },
|
|
19
|
+
min: { type: Number, required: false },
|
|
20
|
+
max: { type: Number, required: false },
|
|
21
|
+
step: { type: Number, required: false },
|
|
22
|
+
hideControls: { type: Boolean, required: false },
|
|
23
|
+
icon: { type: String, required: false },
|
|
24
|
+
readonly: { type: Boolean, required: false },
|
|
25
|
+
disabled: { type: Boolean, required: false },
|
|
26
|
+
description: { type: String, required: false },
|
|
27
|
+
label: { type: String, required: false },
|
|
28
|
+
required: { type: Boolean, required: false },
|
|
29
|
+
radius: { type: [String, Number, Object], required: false },
|
|
30
|
+
size: { type: [String, Object], required: false },
|
|
31
|
+
variant: { type: String, required: false },
|
|
32
|
+
leftSectionPE: { type: void 0, required: false },
|
|
33
|
+
rightSectionPE: { type: void 0, required: false }
|
|
34
|
+
});
|
|
35
|
+
const {
|
|
36
|
+
value,
|
|
37
|
+
errorMessage,
|
|
38
|
+
handleBlur,
|
|
39
|
+
handleChange
|
|
40
|
+
} = useField(() => name, rules, {
|
|
41
|
+
validateOnValueUpdate: false,
|
|
42
|
+
validateOnMount: false,
|
|
43
|
+
initialValue,
|
|
44
|
+
controlled
|
|
45
|
+
});
|
|
46
|
+
</script>
|
|
47
|
+
|
|
48
|
+
<template>
|
|
49
|
+
<NumberInput
|
|
50
|
+
v-bind='props'
|
|
51
|
+
:model-value='value'
|
|
52
|
+
:error='errorMessage'
|
|
53
|
+
:name
|
|
54
|
+
:min
|
|
55
|
+
:max
|
|
56
|
+
@update:model-value='handleChange($event, !!errorMessage)'
|
|
57
|
+
@blur='handleBlur($event, validateOn === "blur")'
|
|
58
|
+
>
|
|
59
|
+
<template v-if='$slots.leftSection' #leftSection>
|
|
60
|
+
<slot name='leftSection' />
|
|
61
|
+
</template>
|
|
62
|
+
|
|
63
|
+
<template v-if='$slots.rightSection' #rightSection>
|
|
64
|
+
<slot name='rightSection' />
|
|
65
|
+
</template>
|
|
66
|
+
|
|
67
|
+
<template v-if='$slots.label' #label>
|
|
68
|
+
<slot name='label' />
|
|
69
|
+
</template>
|
|
70
|
+
|
|
71
|
+
<template v-if='$slots.description' #description>
|
|
72
|
+
<slot name='description' />
|
|
73
|
+
</template>
|
|
74
|
+
|
|
75
|
+
<template v-if='$slots.error' #error>
|
|
76
|
+
<slot name='error' :error='errorMessage' />
|
|
77
|
+
</template>
|
|
78
|
+
</NumberInput>
|
|
79
|
+
</template>
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import type { RuleExpression } from 'vee-validate';
|
|
2
|
+
import type { NumberInputProps } from '../components/input/number-input.vue.js';
|
|
3
|
+
export interface NumberFieldProps extends Omit<NumberInputProps, '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<number>;
|
|
8
|
+
/** When to trigger validation @default `'blur'` */
|
|
9
|
+
validateOn?: 'blur' | 'submit' | 'change';
|
|
10
|
+
/** Pre-fills the field value */
|
|
11
|
+
initialValue?: number;
|
|
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<NumberFieldProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<NumberFieldProps> & 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,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,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,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
|
+
};
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import { useField } from "vee-validate";
|
|
3
|
+
import TextInput from "../components/input/text-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
|
+
<TextInput
|
|
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
|
+
</TextInput>
|
|
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 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
|
+
};
|