@aleph-alpha/ui-library 2.10.0 → 2.11.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/system/components/UiAutocomplete/UiAutocomplete.vue.d.ts +0 -1
- package/dist/system/components/UiAutocomplete/types.d.ts +0 -2
- package/dist/system/components/UiSelect/UiSelect.vue.d.ts +4 -5
- package/dist/system/components/UiSelect/UiSelectContent.vue.d.ts +0 -1
- package/dist/system/components/UiSelect/UiSelectItem.vue.d.ts +2 -9
- package/dist/system/components/UiSelect/UiSelectTrigger.vue.d.ts +0 -2
- package/dist/system/components/UiSelect/UiSelectValue.vue.d.ts +0 -3
- package/dist/system/components/UiSelect/types.d.ts +26 -6
- package/dist/system/lib.js +18370 -18530
- package/package.json +1 -1
- package/src/components/UiAutocomplete/UiAutocomplete.vue +9 -9
- package/src/components/UiAutocomplete/__tests__/UiAutocomplete.test.ts +76 -5
- package/src/components/UiAutocomplete/types.ts +0 -2
- package/src/components/UiSelect/UiSelect.stories.ts +4 -90
- package/src/components/UiSelect/UiSelect.vue +66 -144
- package/src/components/UiSelect/UiSelectContent.vue +10 -21
- package/src/components/UiSelect/UiSelectItem.vue +0 -82
- package/src/components/UiSelect/UiSelectTrigger.vue +1 -62
- package/src/components/UiSelect/UiSelectValue.vue +1 -47
- package/src/components/UiSelect/__tests__/UiSelect.test.ts +47 -98
- package/src/components/UiSelect/__tests__/UiSelectContent.test.ts +36 -3
- package/src/components/UiSelect/__tests__/UiSelectItem.test.ts +1 -1
- package/src/components/UiSelect/__tests__/UiSelectTrigger.test.ts +2 -2
- package/src/components/UiSelect/types.ts +29 -6
- package/dist/system/components/UiSelect/context.d.ts +0 -28
- package/src/components/UiSelect/context.ts +0 -42
|
@@ -61,7 +61,6 @@ declare const __VLS_component: import('vue').DefineComponent<UiAutocompleteProps
|
|
|
61
61
|
dir: "ltr" | "rtl";
|
|
62
62
|
modelValue: string | string[];
|
|
63
63
|
defaultValue: string | string[];
|
|
64
|
-
size: "default" | "sm";
|
|
65
64
|
multiple: boolean;
|
|
66
65
|
placeholder: string;
|
|
67
66
|
open: boolean;
|
|
@@ -48,8 +48,6 @@ export type UiAutocompleteProps = {
|
|
|
48
48
|
name?: string;
|
|
49
49
|
/** Reading direction. */
|
|
50
50
|
dir?: 'ltr' | 'rtl';
|
|
51
|
-
/** Trigger/input size. */
|
|
52
|
-
size?: 'default' | 'sm';
|
|
53
51
|
/** Text shown when filtering returns no options. */
|
|
54
52
|
emptyText?: string;
|
|
55
53
|
/** Optional leading icon name. */
|
|
@@ -3,23 +3,22 @@ declare function __VLS_template(): {
|
|
|
3
3
|
attrs: Partial<{}>;
|
|
4
4
|
slots: {
|
|
5
5
|
default?(_: {}): any;
|
|
6
|
-
default?(_: {}): any;
|
|
7
6
|
};
|
|
8
7
|
refs: {};
|
|
9
8
|
rootEl: any;
|
|
10
9
|
};
|
|
11
10
|
type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
|
|
12
11
|
declare const __VLS_component: import('vue').DefineComponent<UiSelectProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
13
|
-
"update:modelValue": (value:
|
|
12
|
+
"update:modelValue": (value: import('./types').UiSelectValue) => any;
|
|
14
13
|
"update:open": (value: boolean) => any;
|
|
15
14
|
}, string, import('vue').PublicProps, Readonly<UiSelectProps> & Readonly<{
|
|
16
|
-
"onUpdate:modelValue"?: ((value:
|
|
15
|
+
"onUpdate:modelValue"?: ((value: import('./types').UiSelectValue) => any) | undefined;
|
|
17
16
|
"onUpdate:open"?: ((value: boolean) => any) | undefined;
|
|
18
17
|
}>, {
|
|
19
18
|
disabled: boolean;
|
|
20
19
|
dir: "ltr" | "rtl";
|
|
21
|
-
modelValue:
|
|
22
|
-
defaultValue:
|
|
20
|
+
modelValue: import('./types').UiSelectValue;
|
|
21
|
+
defaultValue: import('./types').UiSelectValue;
|
|
23
22
|
multiple: boolean;
|
|
24
23
|
open: boolean;
|
|
25
24
|
defaultOpen: boolean;
|
|
@@ -3,24 +3,17 @@ declare function __VLS_template(): {
|
|
|
3
3
|
attrs: Partial<{}>;
|
|
4
4
|
slots: {
|
|
5
5
|
'right-icon'?(_: {}): any;
|
|
6
|
-
'right-icon'?(_: {}): any;
|
|
7
|
-
'indicator-icon'?(_: {}): any;
|
|
8
6
|
'indicator-icon'?(_: {}): any;
|
|
9
7
|
default?(_: {}): any;
|
|
10
|
-
default?(_: {}): any;
|
|
11
|
-
};
|
|
12
|
-
refs: {
|
|
13
|
-
labelEl: HTMLSpanElement;
|
|
14
8
|
};
|
|
9
|
+
refs: {};
|
|
15
10
|
rootEl: any;
|
|
16
11
|
};
|
|
17
12
|
type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
|
|
18
13
|
declare const __VLS_component: import('vue').DefineComponent<UiSelectItemProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<UiSelectItemProps> & Readonly<{}>, {
|
|
19
14
|
disabled: boolean;
|
|
20
15
|
textValue: string;
|
|
21
|
-
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {
|
|
22
|
-
labelEl: HTMLSpanElement;
|
|
23
|
-
}, any>;
|
|
16
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
24
17
|
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
25
18
|
export default _default;
|
|
26
19
|
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
@@ -3,7 +3,6 @@ declare function __VLS_template(): {
|
|
|
3
3
|
attrs: Partial<{}>;
|
|
4
4
|
slots: {
|
|
5
5
|
default?(_: {}): any;
|
|
6
|
-
default?(_: {}): any;
|
|
7
6
|
};
|
|
8
7
|
refs: {};
|
|
9
8
|
rootEl: any;
|
|
@@ -11,7 +10,6 @@ declare function __VLS_template(): {
|
|
|
11
10
|
type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
|
|
12
11
|
declare const __VLS_component: import('vue').DefineComponent<UiSelectTriggerProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<UiSelectTriggerProps> & Readonly<{}>, {
|
|
13
12
|
disabled: boolean;
|
|
14
|
-
size: "default" | "sm";
|
|
15
13
|
ariaLabel: string;
|
|
16
14
|
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
17
15
|
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
@@ -1,3 +1,23 @@
|
|
|
1
|
+
import { HTMLAttributes } from 'vue';
|
|
2
|
+
/**
|
|
3
|
+
* Selected value shape used by `UiSelect`.
|
|
4
|
+
*
|
|
5
|
+
* - Single-select mode uses a string value.
|
|
6
|
+
* - Multi-select mode uses an array of string values.
|
|
7
|
+
*
|
|
8
|
+
* This type represents an actual selection payload, so it intentionally does
|
|
9
|
+
* not include `undefined`. Optional props such as `modelValue` and
|
|
10
|
+
* `defaultValue` become `undefined` through the optional property itself.
|
|
11
|
+
*/
|
|
12
|
+
export type UiSelectValue = string | string[];
|
|
13
|
+
/**
|
|
14
|
+
* Optional selected value accepted by internal normalization helpers.
|
|
15
|
+
*
|
|
16
|
+
* Use this when code needs to handle the absence of a select value explicitly,
|
|
17
|
+
* for example while forwarding optional `modelValue` or `defaultValue` props
|
|
18
|
+
* to the underlying select primitive.
|
|
19
|
+
*/
|
|
20
|
+
export type UiSelectOptionalValue = UiSelectValue | undefined;
|
|
1
21
|
/**
|
|
2
22
|
* A dropdown select for choosing from a list of options. Use for
|
|
3
23
|
* form fields where users must pick one value from many.
|
|
@@ -12,9 +32,9 @@ export type UiSelectProps = {
|
|
|
12
32
|
* - In single-select (default): a `string`.
|
|
13
33
|
* - In multi-select (`multiple: true`): a `string[]`.
|
|
14
34
|
*/
|
|
15
|
-
modelValue?:
|
|
35
|
+
modelValue?: UiSelectValue;
|
|
16
36
|
/** The value when initially rendered (uncontrolled). Same shape as `modelValue`. */
|
|
17
|
-
defaultValue?:
|
|
37
|
+
defaultValue?: UiSelectValue;
|
|
18
38
|
/** Whether the select is open by default. */
|
|
19
39
|
defaultOpen?: boolean;
|
|
20
40
|
/** Controlled open state. */
|
|
@@ -39,7 +59,7 @@ export type UiSelectProps = {
|
|
|
39
59
|
/** Reading direction. */
|
|
40
60
|
dir?: 'ltr' | 'rtl';
|
|
41
61
|
/**
|
|
42
|
-
* When true, allows selecting multiple items. The
|
|
62
|
+
* When true, allows selecting multiple items. The dropdown stays open on
|
|
43
63
|
* click and the trigger renders the selected values as a comma-separated
|
|
44
64
|
* list. `modelValue` becomes a `string[]`.
|
|
45
65
|
*/
|
|
@@ -53,7 +73,7 @@ export type UiSelectEmits = {
|
|
|
53
73
|
* Emitted when the selected value changes.
|
|
54
74
|
* Payload is `string` in single-select and `string[]` in multi-select.
|
|
55
75
|
*/
|
|
56
|
-
'update:modelValue': [value:
|
|
76
|
+
'update:modelValue': [value: UiSelectValue];
|
|
57
77
|
/** Emitted when the open state changes. */
|
|
58
78
|
'update:open': [value: boolean];
|
|
59
79
|
};
|
|
@@ -65,13 +85,13 @@ export type UiSelectTriggerProps = {
|
|
|
65
85
|
ariaLabel?: string;
|
|
66
86
|
/** Whether the trigger is disabled. */
|
|
67
87
|
disabled?: boolean;
|
|
68
|
-
/** Size of the trigger. */
|
|
69
|
-
size?: 'default' | 'sm';
|
|
70
88
|
};
|
|
71
89
|
/**
|
|
72
90
|
* Props for the UiSelectContent component.
|
|
73
91
|
*/
|
|
74
92
|
export type UiSelectContentProps = {
|
|
93
|
+
/** Additional classes for the floating content. */
|
|
94
|
+
class?: HTMLAttributes['class'];
|
|
75
95
|
/** Preferred side of the trigger. */
|
|
76
96
|
side?: 'top' | 'right' | 'bottom' | 'left';
|
|
77
97
|
/** Distance from the trigger in pixels. */
|