@mgdis/mg-components 5.1.0 → 5.3.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/cjs/loader.cjs.js +1 -1
- package/dist/cjs/{mg-badge_27.cjs.entry.js → mg-badge_29.cjs.entry.js} +730 -242
- package/dist/cjs/mg-components.cjs.js +1 -1
- package/dist/collection/collection-manifest.json +3 -1
- package/dist/collection/components/atoms/mg-badge/mg-badge.js +14 -19
- package/dist/collection/components/atoms/mg-button/mg-button.js +3 -3
- package/dist/collection/components/atoms/mg-icon/mg-icon.js +17 -7
- package/dist/collection/components/atoms/mg-tag/mg-tag.js +1 -1
- package/dist/collection/components/molecules/inputs/MgInput.js +3 -11
- package/dist/collection/components/molecules/inputs/mg-input-checkbox/mg-input-checkbox.js +41 -20
- package/dist/collection/components/molecules/inputs/mg-input-date/mg-input-date.js +50 -39
- package/dist/collection/components/molecules/inputs/mg-input-numeric/mg-input-numeric.css +25 -6
- package/dist/collection/components/molecules/inputs/mg-input-numeric/mg-input-numeric.js +42 -33
- package/dist/collection/components/molecules/inputs/mg-input-password/mg-input-password.css +25 -6
- package/dist/collection/components/molecules/inputs/mg-input-password/mg-input-password.js +36 -17
- package/dist/collection/components/molecules/inputs/mg-input-radio/mg-input-radio.js +35 -14
- package/dist/collection/components/molecules/inputs/mg-input-select/doc/mg-input-select.stories.js +2 -3
- package/dist/collection/components/molecules/inputs/mg-input-select/mg-input-select.css +28 -6
- package/dist/collection/components/molecules/inputs/mg-input-select/mg-input-select.js +36 -17
- package/dist/collection/components/molecules/inputs/mg-input-text/mg-input-text.css +25 -6
- package/dist/collection/components/molecules/inputs/mg-input-text/mg-input-text.js +38 -19
- package/dist/collection/components/molecules/inputs/mg-input-textarea/mg-input-textarea.css +25 -6
- package/dist/collection/components/molecules/inputs/mg-input-textarea/mg-input-textarea.js +37 -18
- package/dist/collection/components/molecules/inputs/mg-input-toggle/mg-input-toggle.js +1 -1
- package/dist/collection/components/molecules/menu/mg-menu/doc/mg-menu.stories.js +87 -0
- package/dist/collection/components/molecules/menu/mg-menu/mg-menu.conf.js +8 -0
- package/dist/collection/components/molecules/menu/mg-menu/mg-menu.css +10 -0
- package/dist/collection/components/molecules/menu/mg-menu/mg-menu.js +185 -0
- package/dist/collection/components/molecules/menu/mg-menu-item/doc/mg-menu-item.stories.js +32 -0
- package/dist/collection/components/molecules/menu/mg-menu-item/mg-menu-item.conf.js +22 -0
- package/dist/collection/components/molecules/menu/mg-menu-item/mg-menu-item.css +316 -0
- package/dist/collection/components/molecules/menu/mg-menu-item/mg-menu-item.js +324 -0
- package/dist/collection/components/molecules/mg-form/mg-form.js +73 -27
- package/dist/collection/components/molecules/mg-illustrated-message/doc/mg-illustrated-message.stories.js +6 -6
- package/dist/collection/components/molecules/mg-message/mg-message.js +1 -1
- package/dist/collection/components/molecules/mg-modal/mg-modal.js +0 -4
- package/dist/collection/components/molecules/mg-tabs/mg-tabs.conf.js +3 -0
- package/dist/collection/components/molecules/mg-tabs/mg-tabs.css +67 -17
- package/dist/collection/components/molecules/mg-tabs/mg-tabs.js +10 -4
- package/dist/collection/locales/index.js +3 -1
- package/dist/collection/utils/unit.test.utils.js +51 -0
- package/dist/collection/variables.css +29 -7
- package/dist/components/MgInput.js +4 -12
- package/dist/components/index.d.ts +2 -0
- package/dist/components/index.js +2 -0
- package/dist/components/index2.js +3 -1
- package/dist/components/mg-badge2.js +1 -1
- package/dist/components/mg-button2.js +3 -3
- package/dist/components/mg-form.js +67 -26
- package/dist/components/mg-input-checkbox.js +36 -21
- package/dist/components/mg-input-date.js +44 -39
- package/dist/components/mg-input-numeric.js +37 -34
- package/dist/components/mg-input-password.js +32 -19
- package/dist/components/mg-input-radio.js +30 -15
- package/dist/components/mg-input-select2.js +32 -19
- package/dist/components/mg-input-text2.js +34 -21
- package/dist/components/mg-input-textarea.js +32 -19
- package/dist/components/mg-input-toggle.js +1 -1
- package/dist/components/mg-menu-item.d.ts +11 -0
- package/dist/components/mg-menu-item.js +273 -0
- package/dist/components/mg-menu.conf.js +10 -0
- package/dist/components/mg-menu.d.ts +11 -0
- package/dist/components/mg-menu.js +149 -0
- package/dist/components/mg-message.js +1 -1
- package/dist/components/mg-modal.js +0 -4
- package/dist/components/mg-tabs.js +6 -2
- package/dist/components/mg-tag.js +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/esm/{mg-badge_27.entry.js → mg-badge_29.entry.js} +729 -243
- package/dist/esm/mg-components.js +1 -1
- package/dist/mg-components/mg-components.css +1 -1
- package/dist/mg-components/mg-components.esm.js +1 -1
- package/dist/mg-components/p-204af46f.entry.js +1 -0
- package/dist/mg-components/variables.css +29 -7
- package/dist/types/components/atoms/mg-badge/doc/mg-badge.stories.d.ts +2 -2
- package/dist/types/components/atoms/mg-badge/mg-badge.conf.d.ts +5 -5
- package/dist/types/components/atoms/mg-badge/mg-badge.d.ts +8 -8
- package/dist/types/components/atoms/mg-button/mg-button.d.ts +2 -2
- package/dist/types/components/atoms/mg-icon/doc/mg-icon.stories.d.ts +2 -2
- package/dist/types/components/atoms/mg-icon/mg-icon.conf.d.ts +10 -2
- package/dist/types/components/atoms/mg-icon/mg-icon.d.ts +7 -6
- package/dist/types/components/molecules/inputs/mg-input-checkbox/mg-input-checkbox.d.ts +10 -8
- package/dist/types/components/molecules/inputs/mg-input-date/mg-input-date.d.ts +3 -8
- package/dist/types/components/molecules/inputs/mg-input-numeric/mg-input-numeric.d.ts +3 -8
- package/dist/types/components/molecules/inputs/mg-input-password/mg-input-password.d.ts +4 -3
- package/dist/types/components/molecules/inputs/mg-input-radio/mg-input-radio.d.ts +4 -2
- package/dist/types/components/molecules/inputs/mg-input-select/mg-input-select.d.ts +4 -3
- package/dist/types/components/molecules/inputs/mg-input-text/mg-input-text.d.ts +5 -4
- package/dist/types/components/molecules/inputs/mg-input-textarea/mg-input-textarea.d.ts +4 -3
- package/dist/types/components/molecules/menu/mg-menu/doc/mg-menu.stories.d.ts +17 -0
- package/dist/types/components/molecules/menu/mg-menu/mg-menu.conf.d.ts +7 -0
- package/dist/types/components/molecules/menu/mg-menu/mg-menu.d.ts +69 -0
- package/dist/types/components/molecules/menu/mg-menu-item/doc/mg-menu-item.stories.d.ts +11 -0
- package/dist/types/components/molecules/menu/mg-menu-item/mg-menu-item.conf.d.ts +24 -0
- package/dist/types/components/molecules/menu/mg-menu-item/mg-menu-item.d.ts +119 -0
- package/dist/types/components/molecules/mg-form/mg-form.d.ts +21 -1
- package/dist/types/components/molecules/mg-message/mg-message.d.ts +3 -0
- package/dist/types/components/molecules/mg-modal/mg-modal.d.ts +3 -0
- package/dist/types/components/molecules/mg-tabs/doc/mg-tabs.stories.d.ts +1 -1
- package/dist/types/components/molecules/mg-tabs/mg-tabs.conf.d.ts +12 -4
- package/dist/types/components/molecules/mg-tabs/mg-tabs.d.ts +6 -6
- package/dist/types/components.d.ts +91 -14
- package/dist/types/locales/index.d.ts +7 -1
- package/dist/types/stories/icons.stories.d.ts +1 -1
- package/package.json +7 -8
- package/dist/collection/utils/test.utils.js +0 -38
- package/dist/mg-components/p-e131701a.entry.js +0 -1
- package/dist/types/utils/test.utils.d.ts +0 -17
|
@@ -20,6 +20,13 @@
|
|
|
20
20
|
https://jira.mgdis.fr/browse/PDA9-690
|
|
21
21
|
*/
|
|
22
22
|
|
|
23
|
+
/* App */
|
|
24
|
+
/* default color-info */
|
|
25
|
+
--mg-color-app-h: var(--color-info-h);
|
|
26
|
+
--mg-color-app-s: var(--color-info-s);
|
|
27
|
+
--mg-color-app-l: var(--color-info-l);
|
|
28
|
+
--mg-color-app-hsl: var(--mg-color-app-h), var(--mg-color-app-s), var(--mg-color-app-l);
|
|
29
|
+
|
|
23
30
|
/* Neutral */
|
|
24
31
|
/* #fefefe; */
|
|
25
32
|
/* rgb(254, 254, 254); */
|
|
@@ -77,15 +84,15 @@
|
|
|
77
84
|
--color-light: var(--color-light-h), var(--color-light-s), var(--color-light-l);
|
|
78
85
|
|
|
79
86
|
/* Primary */
|
|
80
|
-
--color-primary-h:
|
|
81
|
-
--color-primary-s:
|
|
82
|
-
--color-primary-l:
|
|
87
|
+
--color-primary-h: var(--color-dark-h);
|
|
88
|
+
--color-primary-s: var(--color-dark-s);
|
|
89
|
+
--color-primary-l: var(--color-dark-l);
|
|
83
90
|
--color-primary: hsl(var(--color-dark));
|
|
84
91
|
|
|
85
92
|
/* Secondary */
|
|
86
|
-
--color-secondary-h:
|
|
87
|
-
--color-secondary-s:
|
|
88
|
-
--color-secondary-l:
|
|
93
|
+
--color-secondary-h: var(--color-neutral-h);
|
|
94
|
+
--color-secondary-s: var(--color-neutral-s);
|
|
95
|
+
--color-secondary-l: var(--color-neutral-l);
|
|
89
96
|
--color-secondary: hsl(var(--color-neutral));
|
|
90
97
|
|
|
91
98
|
/* Shadow */
|
|
@@ -173,9 +180,10 @@
|
|
|
173
180
|
--mg-panel-box-shadow: var(--box-shadow);
|
|
174
181
|
--mg-panel-content-padding: 1.5rem;
|
|
175
182
|
|
|
176
|
-
|
|
183
|
+
/*
|
|
177
184
|
<mg-illustrated-message>
|
|
178
185
|
*/
|
|
186
|
+
|
|
179
187
|
--mg-illustrated-message-padding-vertical: 4rem;
|
|
180
188
|
|
|
181
189
|
/*
|
|
@@ -230,4 +238,18 @@
|
|
|
230
238
|
<mg-input-radio>
|
|
231
239
|
*/
|
|
232
240
|
--mg-input-check-size: 1.3rem;
|
|
241
|
+
|
|
242
|
+
/*
|
|
243
|
+
<mg-menu-item>
|
|
244
|
+
*/
|
|
245
|
+
--mg-menu-item-focused-background-color-hsl: var(--mg-color-app-hsl);
|
|
246
|
+
--mg-menu-item-border-color-active-hsl: var(--mg-color-app-hsl);
|
|
247
|
+
--mg-menu-item-color-active-hsl: var(--mg-color-app-hsl);
|
|
248
|
+
|
|
249
|
+
/*
|
|
250
|
+
<mg-tabs>
|
|
251
|
+
*/
|
|
252
|
+
--mg-tabs-focused-background-color-hsl: var(--mg-color-app-hsl);
|
|
253
|
+
--mg-tabs-border-color-active-hsl: var(--mg-color-app-hsl);
|
|
254
|
+
--mg-tabs-color-active-hsl: var(--mg-color-app-hsl);
|
|
233
255
|
}
|
|
@@ -3,13 +3,13 @@ declare const _default: {
|
|
|
3
3
|
title: string;
|
|
4
4
|
argTypes: {
|
|
5
5
|
variant: {
|
|
6
|
-
options:
|
|
6
|
+
options: readonly ["info", "primary", "secondary", "success", "warning", "danger"];
|
|
7
7
|
control: {
|
|
8
8
|
type: string;
|
|
9
9
|
};
|
|
10
10
|
table: {
|
|
11
11
|
defaultValue: {
|
|
12
|
-
summary:
|
|
12
|
+
summary: "info";
|
|
13
13
|
};
|
|
14
14
|
};
|
|
15
15
|
};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* List of all possibles variants
|
|
3
3
|
*/
|
|
4
|
-
export declare const variants:
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
4
|
+
export declare const variants: readonly ["info", "primary", "secondary", "success", "warning", "danger"];
|
|
5
|
+
/**
|
|
6
|
+
* Variant type from variants
|
|
7
|
+
*/
|
|
8
|
+
export declare type BadgeVariantType = typeof variants[number];
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { BadgeVariantType } from './mg-badge.conf';
|
|
2
2
|
import { ClassList } from '../../../utils/components.utils';
|
|
3
3
|
export declare class MgBadge {
|
|
4
4
|
/************
|
|
@@ -11,24 +11,24 @@ export declare class MgBadge {
|
|
|
11
11
|
/**
|
|
12
12
|
* Badge value
|
|
13
13
|
*/
|
|
14
|
-
value:
|
|
15
|
-
validateValue(newValue:
|
|
14
|
+
value: string | number;
|
|
15
|
+
validateValue(newValue: MgBadge['value']): void;
|
|
16
16
|
/**
|
|
17
17
|
* Badge label. Include short description.
|
|
18
18
|
* Required for accessibility
|
|
19
19
|
*/
|
|
20
|
-
label:
|
|
21
|
-
validateLabel(newValue:
|
|
20
|
+
label: string;
|
|
21
|
+
validateLabel(newValue: MgBadge['label']): void;
|
|
22
22
|
/**
|
|
23
23
|
* Define button variant
|
|
24
24
|
*/
|
|
25
|
-
variant
|
|
26
|
-
validateVariant(newValue:
|
|
25
|
+
variant?: BadgeVariantType;
|
|
26
|
+
validateVariant(newValue: MgBadge['variant'], oldValue?: MgBadge['variant']): void;
|
|
27
27
|
/**
|
|
28
28
|
* Define if button is using outline style
|
|
29
29
|
*/
|
|
30
30
|
outline: boolean;
|
|
31
|
-
validateOutline(newValue:
|
|
31
|
+
validateOutline(newValue: MgBadge['outline']): void;
|
|
32
32
|
/**
|
|
33
33
|
* Component classes
|
|
34
34
|
*/
|
|
@@ -77,14 +77,14 @@ export declare class MgButton {
|
|
|
77
77
|
*/
|
|
78
78
|
private handleClick;
|
|
79
79
|
/**
|
|
80
|
-
* Handle
|
|
80
|
+
* Handle onKeydown event
|
|
81
81
|
*
|
|
82
82
|
* @param {KeyboardEvent} event keyboard event
|
|
83
83
|
* @returns {void}
|
|
84
84
|
*/
|
|
85
85
|
private handleKeydown;
|
|
86
86
|
/**
|
|
87
|
-
* Handle
|
|
87
|
+
* Handle onKeyup event
|
|
88
88
|
*
|
|
89
89
|
* @param {KeyboardEvent} event keyboard event
|
|
90
90
|
* @returns {void}
|
|
@@ -9,13 +9,13 @@ declare const _default: {
|
|
|
9
9
|
};
|
|
10
10
|
};
|
|
11
11
|
size: {
|
|
12
|
-
options:
|
|
12
|
+
options: readonly ["small", "regular", "large", "extra-large"];
|
|
13
13
|
control: {
|
|
14
14
|
type: string;
|
|
15
15
|
};
|
|
16
16
|
};
|
|
17
17
|
variant: {
|
|
18
|
-
options:
|
|
18
|
+
options: ("info" | "success" | "warning" | "danger")[];
|
|
19
19
|
control: {
|
|
20
20
|
type: string;
|
|
21
21
|
};
|
|
@@ -5,8 +5,16 @@ export declare const icons: unknown;
|
|
|
5
5
|
/**
|
|
6
6
|
* List of all possibles sizes
|
|
7
7
|
*/
|
|
8
|
-
export declare const sizes:
|
|
8
|
+
export declare const sizes: readonly ["small", "regular", "large", "extra-large"];
|
|
9
|
+
/**
|
|
10
|
+
* Icon Size from sizes
|
|
11
|
+
*/
|
|
12
|
+
export declare type IconSizeType = typeof sizes[number];
|
|
9
13
|
/**
|
|
10
14
|
* List of all possibles variants
|
|
11
15
|
*/
|
|
12
|
-
export declare const variants:
|
|
16
|
+
export declare const variants: readonly ["success", "warning", "danger", "info"];
|
|
17
|
+
/**
|
|
18
|
+
* Variant type from variants
|
|
19
|
+
*/
|
|
20
|
+
export declare type IconVariantType = typeof variants[number];
|
|
@@ -1,26 +1,27 @@
|
|
|
1
|
+
import { IconVariantType, IconSizeType } from './mg-icon.conf';
|
|
1
2
|
import { ClassList } from '../../../utils/components.utils';
|
|
2
3
|
export declare class MgIcon {
|
|
3
4
|
/**
|
|
4
5
|
* Icon to display
|
|
5
6
|
*/
|
|
6
7
|
icon: string;
|
|
7
|
-
validateIcon(newValue:
|
|
8
|
+
validateIcon(newValue: MgIcon['icon'], oldValue?: MgIcon['icon']): void;
|
|
8
9
|
/**
|
|
9
10
|
* Define icon size
|
|
10
11
|
*/
|
|
11
|
-
size:
|
|
12
|
-
validateSize(newValue:
|
|
12
|
+
size: IconSizeType;
|
|
13
|
+
validateSize(newValue: MgIcon['size'], oldValue?: MgIcon['size']): void;
|
|
13
14
|
/**
|
|
14
15
|
* Define icon variant
|
|
15
16
|
* Add a background to the icon based on variant color
|
|
16
17
|
*/
|
|
17
|
-
variant
|
|
18
|
-
validateVariant(newValue:
|
|
18
|
+
variant?: IconVariantType;
|
|
19
|
+
validateVariant(newValue: MgIcon['variant'], oldValue?: MgIcon['variant']): void;
|
|
19
20
|
/**
|
|
20
21
|
* Make the icon spin
|
|
21
22
|
*/
|
|
22
23
|
spin: boolean;
|
|
23
|
-
handleSpin(newValue:
|
|
24
|
+
handleSpin(newValue: MgIcon['spin']): void;
|
|
24
25
|
/**
|
|
25
26
|
* Component classes
|
|
26
27
|
*/
|
|
@@ -7,6 +7,7 @@ export declare class MgInputCheckbox {
|
|
|
7
7
|
************/
|
|
8
8
|
private inputs;
|
|
9
9
|
private messages;
|
|
10
|
+
private hasDisplayedError;
|
|
10
11
|
/**************
|
|
11
12
|
* Decorators *
|
|
12
13
|
**************/
|
|
@@ -58,6 +59,7 @@ export declare class MgInputCheckbox {
|
|
|
58
59
|
* Define if input is disabled
|
|
59
60
|
*/
|
|
60
61
|
disabled: boolean;
|
|
62
|
+
handleValidityChange(newValue: boolean, _oldValue: boolean, prop: string): void;
|
|
61
63
|
/**
|
|
62
64
|
* Add a tooltip message next to the input
|
|
63
65
|
*/
|
|
@@ -110,20 +112,20 @@ export declare class MgInputCheckbox {
|
|
|
110
112
|
* Handle blur event
|
|
111
113
|
*/
|
|
112
114
|
private handleBlur;
|
|
113
|
-
/**
|
|
114
|
-
* Check if input is valid
|
|
115
|
-
*/
|
|
116
|
-
private checkValidity;
|
|
117
|
-
/**
|
|
118
|
-
* Check input errors
|
|
119
|
-
*/
|
|
120
|
-
private checkError;
|
|
121
115
|
/**
|
|
122
116
|
* get invalid element
|
|
123
117
|
*
|
|
124
118
|
* @returns {HTMLInputElement} element
|
|
125
119
|
*/
|
|
126
120
|
private getInvalidElement;
|
|
121
|
+
/**
|
|
122
|
+
* Check if input is valid
|
|
123
|
+
*/
|
|
124
|
+
private checkValidity;
|
|
125
|
+
/**
|
|
126
|
+
* Set input error message
|
|
127
|
+
*/
|
|
128
|
+
private setErrorMessage;
|
|
127
129
|
/*************
|
|
128
130
|
* Lifecycle *
|
|
129
131
|
*************/
|
|
@@ -7,7 +7,7 @@ export declare class MgInputDate {
|
|
|
7
7
|
private input;
|
|
8
8
|
private messages;
|
|
9
9
|
private locale;
|
|
10
|
-
private
|
|
10
|
+
private hasDisplayedError;
|
|
11
11
|
/**************
|
|
12
12
|
* Decorators *
|
|
13
13
|
**************/
|
|
@@ -53,6 +53,7 @@ export declare class MgInputDate {
|
|
|
53
53
|
* Define if input is disabled
|
|
54
54
|
*/
|
|
55
55
|
disabled: boolean;
|
|
56
|
+
handleValidityChange(newValue: boolean, _oldValue: boolean, prop: string): void;
|
|
56
57
|
/**
|
|
57
58
|
* Add a tooltip message next to the input
|
|
58
59
|
*/
|
|
@@ -120,18 +121,12 @@ export declare class MgInputDate {
|
|
|
120
121
|
* @returns {null | InputError} error code
|
|
121
122
|
*/
|
|
122
123
|
private getInputError;
|
|
123
|
-
/**
|
|
124
|
-
* Set error message
|
|
125
|
-
*
|
|
126
|
-
* @returns {void}
|
|
127
|
-
*/
|
|
128
|
-
private setErrorMessage;
|
|
129
124
|
/**
|
|
130
125
|
* Check input errors
|
|
131
126
|
*
|
|
132
127
|
* @returns {void}
|
|
133
128
|
*/
|
|
134
|
-
private
|
|
129
|
+
private setErrorMessage;
|
|
135
130
|
/*************
|
|
136
131
|
* Lifecycle *
|
|
137
132
|
*************/
|
|
@@ -11,7 +11,7 @@ export declare class MgInputNumeric {
|
|
|
11
11
|
private input;
|
|
12
12
|
private locale;
|
|
13
13
|
private messages;
|
|
14
|
-
private
|
|
14
|
+
private hasDisplayedError;
|
|
15
15
|
/**************
|
|
16
16
|
* Decorators *
|
|
17
17
|
**************/
|
|
@@ -62,6 +62,7 @@ export declare class MgInputNumeric {
|
|
|
62
62
|
* Define if input is disabled
|
|
63
63
|
*/
|
|
64
64
|
disabled: boolean;
|
|
65
|
+
handleValidityChange(newValue: boolean, _oldValue: boolean, prop: string): void;
|
|
65
66
|
/**
|
|
66
67
|
* Define input width
|
|
67
68
|
*/
|
|
@@ -169,17 +170,11 @@ export declare class MgInputNumeric {
|
|
|
169
170
|
*/
|
|
170
171
|
private checkValidity;
|
|
171
172
|
/**
|
|
172
|
-
* Set error message
|
|
173
|
+
* Set input error message
|
|
173
174
|
*
|
|
174
175
|
* @returns {void}
|
|
175
176
|
*/
|
|
176
177
|
private setErrorMessage;
|
|
177
|
-
/**
|
|
178
|
-
* Check input errors
|
|
179
|
-
*
|
|
180
|
-
* @returns {void}
|
|
181
|
-
*/
|
|
182
|
-
private checkError;
|
|
183
178
|
/**
|
|
184
179
|
* Get input error code
|
|
185
180
|
*
|
|
@@ -7,7 +7,7 @@ export declare class MgInputPassword {
|
|
|
7
7
|
************/
|
|
8
8
|
private input;
|
|
9
9
|
private messages;
|
|
10
|
-
private
|
|
10
|
+
private hasDisplayedError;
|
|
11
11
|
/**************
|
|
12
12
|
* Decorators *
|
|
13
13
|
**************/
|
|
@@ -58,6 +58,7 @@ export declare class MgInputPassword {
|
|
|
58
58
|
* Define if input is disabled
|
|
59
59
|
*/
|
|
60
60
|
disabled: boolean;
|
|
61
|
+
handleValidityChange(newValue: boolean, _oldValue: boolean, prop: string): void;
|
|
61
62
|
/**
|
|
62
63
|
* Define input width
|
|
63
64
|
*/
|
|
@@ -113,9 +114,9 @@ export declare class MgInputPassword {
|
|
|
113
114
|
*/
|
|
114
115
|
private checkValidity;
|
|
115
116
|
/**
|
|
116
|
-
*
|
|
117
|
+
* Set input error message
|
|
117
118
|
*/
|
|
118
|
-
private
|
|
119
|
+
private setErrorMessage;
|
|
119
120
|
/*************
|
|
120
121
|
* Lifecycle *
|
|
121
122
|
*************/
|
|
@@ -7,6 +7,7 @@ export declare class MgInputRadio {
|
|
|
7
7
|
************/
|
|
8
8
|
private inputs;
|
|
9
9
|
private messages;
|
|
10
|
+
private hasDisplayedError;
|
|
10
11
|
/**************
|
|
11
12
|
* Decorators *
|
|
12
13
|
**************/
|
|
@@ -62,6 +63,7 @@ export declare class MgInputRadio {
|
|
|
62
63
|
* Define if input is disabled
|
|
63
64
|
*/
|
|
64
65
|
disabled: boolean;
|
|
66
|
+
handleValidityChange(newValue: boolean, _oldValue: boolean, prop: string): void;
|
|
65
67
|
/**
|
|
66
68
|
* Add a tooltip message next to the input
|
|
67
69
|
*/
|
|
@@ -124,11 +126,11 @@ export declare class MgInputRadio {
|
|
|
124
126
|
*/
|
|
125
127
|
private checkValidity;
|
|
126
128
|
/**
|
|
127
|
-
*
|
|
129
|
+
* Set input error message
|
|
128
130
|
*
|
|
129
131
|
* @returns {void}
|
|
130
132
|
*/
|
|
131
|
-
private
|
|
133
|
+
private setErrorMessage;
|
|
132
134
|
/**
|
|
133
135
|
* get invalid element
|
|
134
136
|
*
|
|
@@ -8,7 +8,7 @@ export declare class MgInputSelect {
|
|
|
8
8
|
************/
|
|
9
9
|
private input;
|
|
10
10
|
private messages;
|
|
11
|
-
private
|
|
11
|
+
private hasDisplayedError;
|
|
12
12
|
/**************
|
|
13
13
|
* Decorators *
|
|
14
14
|
**************/
|
|
@@ -72,6 +72,7 @@ export declare class MgInputSelect {
|
|
|
72
72
|
* Define if input is disabled
|
|
73
73
|
*/
|
|
74
74
|
disabled: boolean;
|
|
75
|
+
handleValidityChange(newValue: boolean, _oldValue: boolean, prop: string): void;
|
|
75
76
|
/**
|
|
76
77
|
* Define input width
|
|
77
78
|
*/
|
|
@@ -139,9 +140,9 @@ export declare class MgInputSelect {
|
|
|
139
140
|
*/
|
|
140
141
|
private checkValidity;
|
|
141
142
|
/**
|
|
142
|
-
*
|
|
143
|
+
* Set input error message
|
|
143
144
|
*/
|
|
144
|
-
private
|
|
145
|
+
private setErrorMessage;
|
|
145
146
|
/*************
|
|
146
147
|
* Lifecycle *
|
|
147
148
|
*************/
|
|
@@ -11,7 +11,7 @@ export declare class MgInputText {
|
|
|
11
11
|
private characterLeftId;
|
|
12
12
|
private input;
|
|
13
13
|
private messages;
|
|
14
|
-
private
|
|
14
|
+
private hasDisplayedError;
|
|
15
15
|
/**************
|
|
16
16
|
* Decorators *
|
|
17
17
|
**************/
|
|
@@ -75,6 +75,7 @@ export declare class MgInputText {
|
|
|
75
75
|
* Define if input is disabled
|
|
76
76
|
*/
|
|
77
77
|
disabled: boolean;
|
|
78
|
+
handleValidityChange(newValue: boolean, _oldValue: boolean, prop: string): void;
|
|
78
79
|
/**
|
|
79
80
|
* Define input width
|
|
80
81
|
*/
|
|
@@ -160,13 +161,13 @@ export declare class MgInputText {
|
|
|
160
161
|
*/
|
|
161
162
|
private checkValidity;
|
|
162
163
|
/**
|
|
163
|
-
*
|
|
164
|
+
* Set input error message
|
|
164
165
|
*
|
|
165
166
|
* @returns {void}
|
|
166
167
|
*/
|
|
167
|
-
private
|
|
168
|
+
private setErrorMessage;
|
|
168
169
|
/**
|
|
169
|
-
* Validate
|
|
170
|
+
* Validate pattern configuration
|
|
170
171
|
*
|
|
171
172
|
* @returns {void}
|
|
172
173
|
*/
|
|
@@ -10,7 +10,7 @@ export declare class MgInputTextarea {
|
|
|
10
10
|
private characterLeftId;
|
|
11
11
|
private input;
|
|
12
12
|
private messages;
|
|
13
|
-
private
|
|
13
|
+
private hasDisplayedError;
|
|
14
14
|
/**************
|
|
15
15
|
* Decorators *
|
|
16
16
|
**************/
|
|
@@ -65,6 +65,7 @@ export declare class MgInputTextarea {
|
|
|
65
65
|
* Define if input is disabled
|
|
66
66
|
*/
|
|
67
67
|
disabled: boolean;
|
|
68
|
+
handleValidityChange(newValue: boolean, _oldValue: boolean, prop: string): void;
|
|
68
69
|
/**
|
|
69
70
|
* Define input width
|
|
70
71
|
*/
|
|
@@ -152,9 +153,9 @@ export declare class MgInputTextarea {
|
|
|
152
153
|
*/
|
|
153
154
|
private checkValidity;
|
|
154
155
|
/**
|
|
155
|
-
*
|
|
156
|
+
* Set input error message
|
|
156
157
|
*/
|
|
157
|
-
private
|
|
158
|
+
private setErrorMessage;
|
|
158
159
|
/**
|
|
159
160
|
* Validate pattern configuration
|
|
160
161
|
*/
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { Direction } from '../mg-menu.conf';
|
|
2
|
+
declare const _default: {
|
|
3
|
+
component: string;
|
|
4
|
+
title: string;
|
|
5
|
+
argTypes: {
|
|
6
|
+
direction: {
|
|
7
|
+
options: Direction[];
|
|
8
|
+
control: {
|
|
9
|
+
type: string;
|
|
10
|
+
};
|
|
11
|
+
};
|
|
12
|
+
};
|
|
13
|
+
};
|
|
14
|
+
export default _default;
|
|
15
|
+
export declare const MgMenuHorizontal: any;
|
|
16
|
+
export declare const MgMenuVertical: any;
|
|
17
|
+
export declare const MgMenuVerticalSmallContainer: any;
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { ClassList } from '../../../../utils/components.utils';
|
|
2
|
+
import { Direction } from './mg-menu.conf';
|
|
3
|
+
export declare class MgMenu {
|
|
4
|
+
/************
|
|
5
|
+
* Internal *
|
|
6
|
+
************/
|
|
7
|
+
private readonly name;
|
|
8
|
+
private menuItems;
|
|
9
|
+
private focusedMenuItem;
|
|
10
|
+
/**************
|
|
11
|
+
* Decorators *
|
|
12
|
+
**************/
|
|
13
|
+
/**
|
|
14
|
+
* Get component DOM element
|
|
15
|
+
*/
|
|
16
|
+
element: HTMLMgMenuElement;
|
|
17
|
+
/**
|
|
18
|
+
* Menu label. Include short menu description.
|
|
19
|
+
* Required for accessibility
|
|
20
|
+
*/
|
|
21
|
+
label: string;
|
|
22
|
+
validateLabel(newValue: MgMenu['label']): void;
|
|
23
|
+
/**
|
|
24
|
+
* Component display direction. Default: "horizontal"
|
|
25
|
+
*/
|
|
26
|
+
direction: Direction;
|
|
27
|
+
validateDirection(newValue: MgMenu['direction']): void;
|
|
28
|
+
/**
|
|
29
|
+
* is this menu a child menu. Used for conditional render.
|
|
30
|
+
*/
|
|
31
|
+
isChildMenu: boolean;
|
|
32
|
+
/**
|
|
33
|
+
* Component classes
|
|
34
|
+
*/
|
|
35
|
+
classList: ClassList;
|
|
36
|
+
/**
|
|
37
|
+
* Close matching menu-item
|
|
38
|
+
*
|
|
39
|
+
* @param {HTMLMgMenuItemElement} item menu-item to close
|
|
40
|
+
* @param {boolean} condition addionnal condition
|
|
41
|
+
* @returns {void}
|
|
42
|
+
*/
|
|
43
|
+
private closeMenuItem;
|
|
44
|
+
/**
|
|
45
|
+
* Store menu-items on component init and add listeners
|
|
46
|
+
*/
|
|
47
|
+
private initMenuItems;
|
|
48
|
+
/*************
|
|
49
|
+
* Lifecycle *
|
|
50
|
+
*************/
|
|
51
|
+
/**
|
|
52
|
+
* Validate props
|
|
53
|
+
*
|
|
54
|
+
* @returns {void}
|
|
55
|
+
*/
|
|
56
|
+
componentWillLoad(): void;
|
|
57
|
+
/**
|
|
58
|
+
* Check if component slots configuration
|
|
59
|
+
*
|
|
60
|
+
* @returns {ReturnType<typeof setTimeout>} timeout
|
|
61
|
+
*/
|
|
62
|
+
componentDidLoad(): ReturnType<typeof setTimeout>;
|
|
63
|
+
/**
|
|
64
|
+
* Render
|
|
65
|
+
*
|
|
66
|
+
* @returns {HTMLElement} HTML Element
|
|
67
|
+
*/
|
|
68
|
+
render(): HTMLElement;
|
|
69
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
declare const _default: {
|
|
2
|
+
component: string;
|
|
3
|
+
title: string;
|
|
4
|
+
};
|
|
5
|
+
export default _default;
|
|
6
|
+
export declare const MgMenuItem: any;
|
|
7
|
+
export declare const MgMenuItemWhitIcon: any;
|
|
8
|
+
export declare const MgMenuItemWhitBadge: any;
|
|
9
|
+
export declare const MgMenuItemWhitBadgeAndIcon: any;
|
|
10
|
+
export declare const MgMenuItemWhitMetadata: any;
|
|
11
|
+
export declare const MgMenuItemWhithSubmenu: any;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Available menu-item positions
|
|
3
|
+
*/
|
|
4
|
+
export declare enum ElementPosition {
|
|
5
|
+
FIRST = "first",
|
|
6
|
+
LAST = "last"
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* Available menu item status
|
|
10
|
+
*/
|
|
11
|
+
export declare enum Status {
|
|
12
|
+
VISIBLE = "visible",
|
|
13
|
+
HIDDEN = "hidden",
|
|
14
|
+
DISABLED = "disabled",
|
|
15
|
+
ACTIVE = "active"
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* List of all possibles sizes
|
|
19
|
+
*/
|
|
20
|
+
export declare const sizes: readonly ["regular", "medium", "large"];
|
|
21
|
+
/**
|
|
22
|
+
* item Size from sizes
|
|
23
|
+
*/
|
|
24
|
+
export declare type MenuItemSizeType = typeof sizes[number];
|