@avenirs-esr/avenirs-dsav 0.1.27 → 0.1.29
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/avenirs-dsav.css +1 -1
- package/dist/avenirs-dsav.es.js +2799 -2792
- package/dist/avenirs-dsav.umd.js +11 -11
- package/dist/components/interaction/buttons/AvButton/AvButton.stories.d.ts +2 -2
- package/dist/components/interaction/files/AvFileUpload/AvFileUpload.vue.d.ts +2 -12
- package/dist/components/interaction/selects/AvAutocomplete/AvAutocomplete.stories.d.ts +3 -0
- package/dist/components/interaction/selects/AvMultiselect/AvMultiselect.stories.d.ts +128 -0
- package/dist/components/interaction/selects/AvMultiselect/AvMultiselect.test.d.ts +1 -0
- package/dist/components/interaction/selects/AvMultiselect/AvMultiselect.vue.d.ts +86 -0
- package/dist/tests/utils.d.ts +3 -7
- package/dist/tokens/icons.d.ts +3 -0
- package/package.json +4 -1
|
@@ -33,13 +33,13 @@ import { type AvButtonProps } from '@/components/interaction/buttons/AvButton/Av
|
|
|
33
33
|
* <ul>
|
|
34
34
|
* <li>
|
|
35
35
|
* <span class="b2-regular">
|
|
36
|
-
* A label
|
|
36
|
+
* A label - mandatory, using the <code>label</code> prop, enables label display when <code>iconOnly</code> is <code>false</code>,
|
|
37
37
|
* also enables connection to <code>title</code> and <code>aria-label</code>;
|
|
38
38
|
* </span>
|
|
39
39
|
* </li>
|
|
40
40
|
* <li>
|
|
41
41
|
* <span class="b2-regular">
|
|
42
|
-
* An icon, which can be modified (see available icons)
|
|
42
|
+
* An icon, which can be modified (see available icons) - optional.
|
|
43
43
|
* </span>
|
|
44
44
|
* </li>
|
|
45
45
|
* </ul>
|
|
@@ -66,7 +66,7 @@ export interface AvFileUploadProps {
|
|
|
66
66
|
* delete button label
|
|
67
67
|
*
|
|
68
68
|
*/
|
|
69
|
-
deleteButtonLabel
|
|
69
|
+
deleteButtonLabel?: string;
|
|
70
70
|
/**
|
|
71
71
|
* Name of actual file.
|
|
72
72
|
*
|
|
@@ -112,17 +112,7 @@ declare const _default: __VLS_WithSlots<import("vue").DefineComponent<AvFileUplo
|
|
|
112
112
|
"onUpdate:validMessage"?: ((payload: string | null) => any) | undefined;
|
|
113
113
|
"onUpdate:error"?: ((payload: string | null) => any) | undefined;
|
|
114
114
|
onOnDropAcceptTypeError?: (() => any) | undefined;
|
|
115
|
-
}>, {
|
|
116
|
-
error: string;
|
|
117
|
-
id: string;
|
|
118
|
-
modelValue: File | null;
|
|
119
|
-
disabled: boolean;
|
|
120
|
-
validMessage: string;
|
|
121
|
-
ariaLabel: string;
|
|
122
|
-
accept: string | string[];
|
|
123
|
-
maxWidth: string;
|
|
124
|
-
enableMultiple: boolean;
|
|
125
|
-
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, __VLS_Slots>;
|
|
115
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, __VLS_Slots>;
|
|
126
116
|
export default _default;
|
|
127
117
|
type __VLS_WithSlots<T, S> = T & {
|
|
128
118
|
new (): {
|
|
@@ -503,10 +503,13 @@ export declare const WithCustomItemSlotExample: {
|
|
|
503
503
|
BRIEFCASE_VARIANT_OUTLINE: string;
|
|
504
504
|
CALENDAR_MONTH_OUTLINE: string;
|
|
505
505
|
CHART_TIMELINE_VARIANT_SHIMMER: string;
|
|
506
|
+
CHAT_ALERT: string;
|
|
506
507
|
CHAT_BUBBLE_OUTLINE: string;
|
|
507
508
|
CHECK: string;
|
|
508
509
|
CHECK_CIRCLE: string;
|
|
509
510
|
CHECK_CIRCLE_OUTLINE: string;
|
|
511
|
+
CHECKBOX_BLANK_OUTLINE: string;
|
|
512
|
+
CHECKBOX_MARKED: string;
|
|
510
513
|
CHEVRON_DOUBLE_LEFT: string;
|
|
511
514
|
CHEVRON_DOUBLE_RIGHT: string;
|
|
512
515
|
CLOSE_CIRCLE_OUTLINE: string;
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
import type { StoryFn } from '@storybook/vue3';
|
|
2
|
+
import { type AvMultiselectProps } from '@/components/interaction/selects/AvMultiselect/AvMultiselect.vue';
|
|
3
|
+
/**
|
|
4
|
+
* <h2 class="n2">✨ Introduction</h2>
|
|
5
|
+
*
|
|
6
|
+
* <p>
|
|
7
|
+
* <span class="b2-regular">
|
|
8
|
+
* The <code>AvMultiselect</code> is a Vue component enabling a user to select one or many items from a given list.
|
|
9
|
+
* </span>
|
|
10
|
+
* </p>
|
|
11
|
+
*
|
|
12
|
+
* <p>
|
|
13
|
+
* <span class="b2-regular">
|
|
14
|
+
* The drop-down list provides a list of options for the user to choose from.
|
|
15
|
+
* The user can filter this list and use a button to select/deselect all visible items.
|
|
16
|
+
* </span>
|
|
17
|
+
* </p>
|
|
18
|
+
*
|
|
19
|
+
* <h2 class="n2">🏗️ Structure</h2>
|
|
20
|
+
*
|
|
21
|
+
* <p><span class="b2-regular">The <code>AvMultiselect</code> consists of:</span></p>
|
|
22
|
+
* <ul>
|
|
23
|
+
* <li><span class="b2-regular">a <strong>label</strong> - Mandatory (<code>label</code> prop)</span></li>
|
|
24
|
+
* <li><span class="b2-regular">a <strong>description</strong> - Optional (<code>hint</code> prop or <code>hint</code> slot)</span></li>
|
|
25
|
+
* <li><span class="b2-regular">a <strong>list</strong> - Composed of a set of selectable options (mandatory, <code>options</code> prop)</span></li>
|
|
26
|
+
* </ul>
|
|
27
|
+
*
|
|
28
|
+
* <p><span class="b2-regular">Inside the list:</span></p>
|
|
29
|
+
* <ul>
|
|
30
|
+
* <li><span class="b2-regular">a <strong>"Select all" / "Deselect all" button</strong> - Optional (<code>selectAll</code> and <code>selectAllLabel</code> props)</span></li>
|
|
31
|
+
* <li><span class="b2-regular">an <strong>input field</strong> - Optional</span></li>
|
|
32
|
+
* <li><span class="b2-regular">a <strong>form section (fieldset)</strong> containing:</span>
|
|
33
|
+
* <ul>
|
|
34
|
+
* <li><span class="b2-regular">a <strong>legend</strong> - Optional, can be hidden (<code>legend</code> prop or <code>legend</code> slot)</span></li>
|
|
35
|
+
* <li><span class="b2-regular">a <strong>description of the group</strong> - Optional, can be hidden</span></li>
|
|
36
|
+
* <li><span class="b2-regular">a <strong>list of options</strong> - Mandatory (<code>options</code> prop)</span></li>
|
|
37
|
+
* </ul>
|
|
38
|
+
* </li>
|
|
39
|
+
* </ul>
|
|
40
|
+
*/
|
|
41
|
+
declare const meta: {
|
|
42
|
+
title: string;
|
|
43
|
+
component: import("vue").DefineComponent<AvMultiselectProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
|
|
44
|
+
"update:modelValue": (value: import("@/components/interaction/selects/AvMultiselect/AvMultiselect.vue").AvMultiselectOption[]) => any;
|
|
45
|
+
}, string, import("vue").PublicProps, Readonly<AvMultiselectProps> & Readonly<{
|
|
46
|
+
"onUpdate:modelValue"?: ((value: import("@/components/interaction/selects/AvMultiselect/AvMultiselect.vue").AvMultiselectOption[]) => any) | undefined;
|
|
47
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
48
|
+
tags: string[];
|
|
49
|
+
argTypes: {
|
|
50
|
+
disabled: {
|
|
51
|
+
control: string;
|
|
52
|
+
};
|
|
53
|
+
dense: {
|
|
54
|
+
control: string;
|
|
55
|
+
};
|
|
56
|
+
selectId: {
|
|
57
|
+
control: string;
|
|
58
|
+
};
|
|
59
|
+
name: {
|
|
60
|
+
control: string;
|
|
61
|
+
};
|
|
62
|
+
hint: {
|
|
63
|
+
control: string;
|
|
64
|
+
};
|
|
65
|
+
modelValue: {
|
|
66
|
+
type: {
|
|
67
|
+
name: string;
|
|
68
|
+
required: boolean;
|
|
69
|
+
};
|
|
70
|
+
control: boolean;
|
|
71
|
+
};
|
|
72
|
+
label: {
|
|
73
|
+
control: string;
|
|
74
|
+
};
|
|
75
|
+
options: {
|
|
76
|
+
type: {
|
|
77
|
+
name: string;
|
|
78
|
+
required: boolean;
|
|
79
|
+
};
|
|
80
|
+
control: boolean;
|
|
81
|
+
};
|
|
82
|
+
successMessage: {
|
|
83
|
+
control: string;
|
|
84
|
+
};
|
|
85
|
+
errorMessage: {
|
|
86
|
+
control: string;
|
|
87
|
+
};
|
|
88
|
+
defaultUnselectedText: {
|
|
89
|
+
control: string;
|
|
90
|
+
required: boolean;
|
|
91
|
+
};
|
|
92
|
+
selectAll: {
|
|
93
|
+
control: string;
|
|
94
|
+
};
|
|
95
|
+
search: {
|
|
96
|
+
control: string;
|
|
97
|
+
};
|
|
98
|
+
};
|
|
99
|
+
args: {
|
|
100
|
+
options: {
|
|
101
|
+
value: string;
|
|
102
|
+
label: string;
|
|
103
|
+
}[];
|
|
104
|
+
defaultUnselectedText: string;
|
|
105
|
+
required: boolean;
|
|
106
|
+
disabled: boolean;
|
|
107
|
+
selectId: string;
|
|
108
|
+
name: string;
|
|
109
|
+
hint: string;
|
|
110
|
+
modelValue: string[];
|
|
111
|
+
label: string;
|
|
112
|
+
successMessage: string;
|
|
113
|
+
errorMessage: string;
|
|
114
|
+
dense: boolean;
|
|
115
|
+
selectAll: boolean;
|
|
116
|
+
search: boolean;
|
|
117
|
+
};
|
|
118
|
+
parameters: {
|
|
119
|
+
docs: {
|
|
120
|
+
story: {
|
|
121
|
+
height: string;
|
|
122
|
+
};
|
|
123
|
+
};
|
|
124
|
+
};
|
|
125
|
+
};
|
|
126
|
+
export default meta;
|
|
127
|
+
export declare const Default: StoryFn<AvMultiselectProps>;
|
|
128
|
+
export declare const Dense: StoryFn<AvMultiselectProps>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* AvMultiselect option props.
|
|
3
|
+
*/
|
|
4
|
+
export interface AvMultiselectOption {
|
|
5
|
+
/**
|
|
6
|
+
* Displayed label of the option
|
|
7
|
+
*/
|
|
8
|
+
label: string;
|
|
9
|
+
/**
|
|
10
|
+
* Value of the option
|
|
11
|
+
*/
|
|
12
|
+
value: string | number;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* AvMultiselect component props.
|
|
16
|
+
*/
|
|
17
|
+
export interface AvMultiselectProps {
|
|
18
|
+
/**
|
|
19
|
+
* Indicated if the select is disabled.
|
|
20
|
+
*/
|
|
21
|
+
disabled?: boolean;
|
|
22
|
+
/**
|
|
23
|
+
* Unique id for the select. Used for the accessibility.
|
|
24
|
+
*/
|
|
25
|
+
selectId?: string;
|
|
26
|
+
/**
|
|
27
|
+
* Field name.
|
|
28
|
+
*/
|
|
29
|
+
name?: string;
|
|
30
|
+
/**
|
|
31
|
+
* Hint for guidance.
|
|
32
|
+
*/
|
|
33
|
+
hint?: string;
|
|
34
|
+
/**
|
|
35
|
+
* Selected option(s) value(s).
|
|
36
|
+
*/
|
|
37
|
+
modelValue: AvMultiselectOption[];
|
|
38
|
+
/**
|
|
39
|
+
* Select text label.
|
|
40
|
+
*/
|
|
41
|
+
label: string;
|
|
42
|
+
/**
|
|
43
|
+
* Selectable options.
|
|
44
|
+
*/
|
|
45
|
+
options?: AvMultiselectOption[];
|
|
46
|
+
/**
|
|
47
|
+
* If set, display a success message.
|
|
48
|
+
*/
|
|
49
|
+
successMessage?: string;
|
|
50
|
+
/**
|
|
51
|
+
* If set, display an error message.
|
|
52
|
+
*/
|
|
53
|
+
errorMessage?: string;
|
|
54
|
+
/**
|
|
55
|
+
* Placeholder text.
|
|
56
|
+
*/
|
|
57
|
+
defaultUnselectedText: string;
|
|
58
|
+
/**
|
|
59
|
+
* dense mode
|
|
60
|
+
*/
|
|
61
|
+
dense?: boolean;
|
|
62
|
+
/**
|
|
63
|
+
* Displayed text when options are selected.
|
|
64
|
+
*/
|
|
65
|
+
selectedText?: string;
|
|
66
|
+
/**
|
|
67
|
+
* Displays the select all items button
|
|
68
|
+
*/
|
|
69
|
+
selectAll?: boolean;
|
|
70
|
+
/**
|
|
71
|
+
* Update the select all items button label
|
|
72
|
+
* @default
|
|
73
|
+
* ["Tout sélectionner", "Tout désélectionner"]
|
|
74
|
+
*/
|
|
75
|
+
selectAllLabel?: [string, string];
|
|
76
|
+
/**
|
|
77
|
+
* Displays the search bar
|
|
78
|
+
*/
|
|
79
|
+
search?: boolean;
|
|
80
|
+
}
|
|
81
|
+
declare const _default: import("vue").DefineComponent<AvMultiselectProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
|
|
82
|
+
"update:modelValue": (value: AvMultiselectOption[]) => any;
|
|
83
|
+
}, string, import("vue").PublicProps, Readonly<AvMultiselectProps> & Readonly<{
|
|
84
|
+
"onUpdate:modelValue"?: ((value: AvMultiselectOption[]) => any) | undefined;
|
|
85
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
86
|
+
export default _default;
|
package/dist/tests/utils.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type ComponentMountingOptions } from '@vue/test-utils';
|
|
1
|
+
import { type ComponentMountingOptions, type VueWrapper } from '@vue/test-utils';
|
|
2
2
|
import { type Component } from 'vue';
|
|
3
3
|
/**
|
|
4
4
|
* Function allowing developpers to use a common BDD format for tests
|
|
@@ -24,11 +24,7 @@ declare function mountComposable<T>(fn: () => T): {
|
|
|
24
24
|
* @template T
|
|
25
25
|
* @param {Component} component - Vue component to mount.
|
|
26
26
|
* @param {ComponentMountingOptions<T>} [options] - Additional options for mounting the component.
|
|
27
|
-
* @returns {Promise<
|
|
27
|
+
* @returns {Promise<VueWrapper<InstanceType<any>>>} the function return any as type because ts type is too complicated.
|
|
28
28
|
*/
|
|
29
|
-
declare function mountWithRouter<T>(component: Component, options?: ComponentMountingOptions<T>): Promise<
|
|
30
|
-
data?(...args: any): infer D;
|
|
31
|
-
} ? D : {}) & import("vue-component-type-helpers").ComponentExposed<T>, import("vue").ComponentPublicInstance<import("vue-component-type-helpers").ComponentProps<T>, (T extends {
|
|
32
|
-
data?(...args: any): infer D;
|
|
33
|
-
} ? D : {}) & import("vue-component-type-helpers").ComponentExposed<T> & Omit<import("vue-component-type-helpers").ComponentProps<T>, keyof import("vue-component-type-helpers").ComponentProps<T>>>>>;
|
|
29
|
+
declare function mountWithRouter<T>(component: Component, options?: ComponentMountingOptions<T>): Promise<VueWrapper<InstanceType<any>>>;
|
|
34
30
|
export { mountComposable, mountWithRouter, };
|
package/dist/tokens/icons.d.ts
CHANGED
|
@@ -15,10 +15,13 @@ export declare const MDI_ICONS: {
|
|
|
15
15
|
BRIEFCASE_VARIANT_OUTLINE: string;
|
|
16
16
|
CALENDAR_MONTH_OUTLINE: string;
|
|
17
17
|
CHART_TIMELINE_VARIANT_SHIMMER: string;
|
|
18
|
+
CHAT_ALERT: string;
|
|
18
19
|
CHAT_BUBBLE_OUTLINE: string;
|
|
19
20
|
CHECK: string;
|
|
20
21
|
CHECK_CIRCLE: string;
|
|
21
22
|
CHECK_CIRCLE_OUTLINE: string;
|
|
23
|
+
CHECKBOX_BLANK_OUTLINE: string;
|
|
24
|
+
CHECKBOX_MARKED: string;
|
|
22
25
|
CHEVRON_DOUBLE_LEFT: string;
|
|
23
26
|
CHEVRON_DOUBLE_RIGHT: string;
|
|
24
27
|
CLOSE_CIRCLE_OUTLINE: string;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@avenirs-esr/avenirs-dsav",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.1.
|
|
4
|
+
"version": "0.1.29",
|
|
5
5
|
"main": "dist/avenirs-dsav.umd.js",
|
|
6
6
|
"module": "dist/avenirs-dsav.es.js",
|
|
7
7
|
"types": "dist/index.d.ts",
|
|
@@ -12,9 +12,11 @@
|
|
|
12
12
|
"scripts": {
|
|
13
13
|
"clean:dist": "rimraf dist",
|
|
14
14
|
"build-only": "vite build",
|
|
15
|
+
"build-only:watch": "vite build --watch",
|
|
15
16
|
"build-only:development": "vite build -m development",
|
|
16
17
|
"dev": "vite",
|
|
17
18
|
"build": "run-p type-check type-gen \"build-only {@}\" --",
|
|
19
|
+
"build:watch": "run-p type-check type-gen:watch \"build-only:watch {@}\" --",
|
|
18
20
|
"build:development": "run-p type-check type-gen \"build-only:development {@}\" --",
|
|
19
21
|
"format": "eslint . --fix",
|
|
20
22
|
"lint": "eslint .",
|
|
@@ -29,6 +31,7 @@
|
|
|
29
31
|
"test:watch": "vitest",
|
|
30
32
|
"type-check": "vue-tsc --build --force",
|
|
31
33
|
"type-gen": "vue-tsc -p tsconfig.app.json",
|
|
34
|
+
"type-gen:watch": "vue-tsc -p tsconfig.app.json --watch",
|
|
32
35
|
"prepare": "husky || true",
|
|
33
36
|
"commitlint": "commitlint --edit",
|
|
34
37
|
"lint-staged": "lint-staged",
|