@mgdis/mg-components 5.5.0 → 5.6.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/{index-c3450336.js → index-4dcc1812.js} +11 -1
- package/dist/cjs/loader.cjs.js +3 -3
- package/dist/cjs/mg-badge_30.cjs.entry.js +742 -244
- package/dist/cjs/mg-components.cjs.js +3 -3
- package/dist/collection/collection-manifest.json +4 -4
- package/dist/collection/components/atoms/mg-badge/mg-badge.conf.js +1 -1
- package/dist/collection/components/atoms/mg-badge/mg-badge.css +13 -0
- package/dist/collection/components/atoms/mg-badge/mg-badge.js +3 -3
- package/dist/collection/components/atoms/mg-button/mg-button.css +2 -1
- package/dist/collection/components/atoms/mg-card/mg-card.css +13 -6
- package/dist/collection/components/atoms/mg-icon/mg-icon.conf.js +13 -3
- package/dist/collection/components/atoms/mg-tag/mg-tag.css +6 -6
- package/dist/collection/components/atoms/mg-tag/mg-tag.js +3 -3
- package/dist/collection/components/atoms/mg-tooltip/mg-tooltip.css +2 -0
- package/dist/collection/components/atoms/mg-tooltip/mg-tooltip.js +3 -3
- package/dist/collection/components/molecules/inputs/mg-input-date/mg-input-date.css +3 -3
- package/dist/collection/components/molecules/inputs/mg-input-date/mg-input-date.js +4 -1
- package/dist/collection/components/molecules/inputs/mg-input-numeric/mg-input-numeric.css +3 -3
- package/dist/collection/components/molecules/inputs/mg-input-password/mg-input-password.css +3 -3
- package/dist/collection/components/molecules/inputs/mg-input-select/mg-input-select.css +3 -3
- package/dist/collection/components/molecules/inputs/mg-input-select/mg-input-select.js +7 -3
- package/dist/collection/components/molecules/inputs/mg-input-text/mg-input-text.css +3 -3
- package/dist/collection/components/molecules/inputs/mg-input-textarea/mg-input-textarea.css +3 -3
- package/dist/collection/components/molecules/menu/mg-menu/doc/mg-menu.stories.js +43 -11
- package/dist/collection/components/molecules/menu/mg-menu/mg-menu.conf.js +17 -0
- package/dist/collection/components/molecules/menu/mg-menu/mg-menu.css +27 -0
- package/dist/collection/components/molecules/menu/mg-menu/mg-menu.js +141 -18
- package/dist/collection/components/molecules/menu/mg-menu-item/doc/mg-menu-item.stories.js +5 -10
- package/dist/collection/components/molecules/menu/mg-menu-item/mg-menu-item.conf.js +0 -4
- package/dist/collection/components/molecules/menu/mg-menu-item/mg-menu-item.css +47 -21
- package/dist/collection/components/molecules/menu/mg-menu-item/mg-menu-item.js +118 -70
- package/dist/collection/components/molecules/mg-illustrated-message/mg-illustrated-message.js +4 -3
- package/dist/collection/components/molecules/mg-message/mg-message.css +7 -0
- package/dist/collection/components/molecules/mg-message/mg-message.js +53 -12
- package/dist/collection/components/molecules/mg-modal/mg-modal.css +8 -1
- package/dist/collection/components/molecules/mg-panel/mg-panel.css +7 -0
- package/dist/collection/components/molecules/mg-popover/mg-popover.css +72 -14
- package/dist/collection/components/molecules/mg-popover/mg-popover.js +48 -4
- package/dist/collection/components/molecules/mg-skip-links/doc/mg-skip-links.stories.js +1 -1
- package/dist/collection/components/molecules/mg-skip-links/mg-skip-links.js +32 -1
- package/dist/collection/components/molecules/mg-tabs/doc/mg-tabs.stories.js +5 -3
- package/dist/collection/components/molecules/mg-tabs/mg-tabs.css +11 -7
- package/dist/collection/components/molecules/mg-tabs/mg-tabs.js +101 -54
- package/dist/collection/locales/en/messages.json +4 -0
- package/dist/collection/locales/fr/messages.json +4 -0
- package/dist/collection/locales/index.js +2 -25
- package/dist/collection/styles/a11y.scss +32 -0
- package/dist/collection/styles/components.scss +3 -0
- package/dist/collection/styles/fonts.scss +21 -0
- package/dist/collection/styles/form.scss +3 -0
- package/dist/collection/styles/global.scss +87 -0
- package/dist/collection/styles/layout.scss +29 -0
- package/dist/collection/styles/main.scss +23 -0
- package/dist/collection/styles/navigation-button.scss +76 -0
- package/dist/collection/styles/reset-mg-card-slotted-variables.scss +9 -0
- package/dist/collection/styles/typography.scss +75 -0
- package/dist/collection/styles/utilities.scss +21 -0
- package/dist/collection/utils/behaviors.utils.js +169 -0
- package/dist/collection/utils/components.utils.js +50 -0
- package/dist/collection/utils/locale.utils.js +22 -0
- package/dist/collection/utils/unit.test.utils.js +37 -32
- package/dist/collection/variables.css +9 -9
- package/dist/components/components.utils.js +51 -1
- package/dist/components/index2.js +65 -18
- package/dist/components/mg-badge2.js +4 -4
- package/dist/components/mg-button2.js +1 -1
- package/dist/components/mg-card2.js +1 -1
- package/dist/components/mg-icon2.js +13 -3
- package/dist/components/mg-illustrated-message.js +4 -3
- package/dist/components/mg-input-date.js +6 -4
- package/dist/components/mg-input-numeric.js +2 -3
- package/dist/components/mg-input-password.js +1 -1
- package/dist/components/mg-input-select2.js +8 -4
- package/dist/components/mg-input-text2.js +1 -1
- package/dist/components/mg-input-textarea.js +1 -1
- package/dist/components/mg-menu-item.js +1 -253
- package/dist/components/mg-menu-item2.js +517 -0
- package/dist/components/mg-menu.js +138 -21
- package/dist/components/mg-message.js +54 -13
- package/dist/components/mg-modal.js +1 -1
- package/dist/components/mg-panel.js +1 -1
- package/dist/components/mg-popover.js +1 -190
- package/dist/components/mg-popover2.js +212 -0
- package/dist/components/mg-skip-links.js +16 -2
- package/dist/components/mg-tabs.js +100 -52
- package/dist/components/mg-tag.js +4 -4
- package/dist/components/mg-tooltip2.js +4 -4
- package/dist/esm/{index-78edde1d.js → index-dc9a2348.js} +11 -1
- package/dist/esm/loader.js +3 -3
- package/dist/esm/mg-badge_30.entry.js +742 -244
- package/dist/esm/mg-components.js +3 -3
- package/dist/esm/polyfills/css-shim.js +1 -1
- package/dist/mg-components/locales/en/messages.json +4 -0
- package/dist/mg-components/locales/fr/messages.json +4 -0
- package/dist/mg-components/mg-components.css +1 -1
- package/dist/mg-components/mg-components.esm.js +1 -1
- package/dist/mg-components/{p-125c54ca.js → p-182bd802.js} +2 -2
- package/dist/mg-components/p-f7da9dd2.entry.js +1 -0
- package/dist/mg-components/styles/a11y.scss +32 -0
- package/dist/mg-components/styles/components.scss +3 -0
- package/dist/mg-components/styles/fonts.scss +21 -0
- package/dist/mg-components/styles/form.scss +3 -0
- package/dist/mg-components/styles/global.scss +87 -0
- package/dist/mg-components/styles/layout.scss +29 -0
- package/dist/mg-components/styles/main.scss +23 -0
- package/dist/mg-components/styles/navigation-button.scss +76 -0
- package/dist/mg-components/styles/reset-mg-card-slotted-variables.scss +9 -0
- package/dist/mg-components/styles/typography.scss +75 -0
- package/dist/mg-components/styles/utilities.scss +21 -0
- package/dist/mg-components/variables.css +9 -9
- package/dist/types/components/atoms/mg-badge/mg-badge.conf.d.ts +2 -2
- package/dist/types/components/atoms/mg-button/mg-button.conf.d.ts +2 -2
- package/dist/types/components/atoms/mg-icon/mg-icon.conf.d.ts +2 -2
- package/dist/types/components/atoms/mg-tag/mg-tag.conf.d.ts +1 -1
- package/dist/types/components/molecules/inputs/MgInput.conf.d.ts +2 -2
- package/dist/types/components/molecules/inputs/mg-input-checkbox/mg-input-checkbox.conf.d.ts +2 -2
- package/dist/types/components/molecules/inputs/mg-input-radio/mg-input-radio.conf.d.ts +1 -1
- package/dist/types/components/molecules/inputs/mg-input-select/mg-input-select.conf.d.ts +2 -2
- package/dist/types/components/molecules/inputs/mg-input-toggle/mg-input-toggle.conf.d.ts +1 -1
- package/dist/types/components/molecules/menu/mg-menu/doc/mg-menu.stories.d.ts +5 -0
- package/dist/types/components/molecules/menu/mg-menu/mg-menu.conf.d.ts +37 -0
- package/dist/types/components/molecules/menu/mg-menu/mg-menu.d.ts +51 -3
- package/dist/types/components/molecules/menu/mg-menu-item/mg-menu-item.conf.d.ts +0 -8
- package/dist/types/components/molecules/menu/mg-menu-item/mg-menu-item.d.ts +55 -15
- package/dist/types/components/molecules/mg-message/mg-message.d.ts +21 -4
- package/dist/types/components/molecules/mg-popover/mg-popover.d.ts +12 -0
- package/dist/types/components/molecules/mg-skip-links/mg-skip-links.conf.d.ts +1 -1
- package/dist/types/components/molecules/mg-skip-links/mg-skip-links.d.ts +15 -0
- package/dist/types/components/molecules/mg-tabs/mg-tabs.conf.d.ts +5 -3
- package/dist/types/components/molecules/mg-tabs/mg-tabs.d.ts +22 -12
- package/dist/types/components.d.ts +44 -12
- package/dist/types/locales/index.d.ts +10 -9
- package/dist/types/stencil-public-runtime.d.ts +39 -3
- package/dist/types/utils/behaviors.utils.d.ts +83 -0
- package/dist/types/utils/components.utils.d.ts +14 -0
- package/dist/types/utils/locale.utils.d.ts +13 -0
- package/dist/types/utils/unit.test.utils.d.ts +50 -14
- package/package.json +26 -26
- package/readme.md +22 -13
- package/dist/components/locale.utils.js +0 -40
- package/dist/components/mg-menu.conf.js +0 -10
- package/dist/mg-components/p-4961c96c.entry.js +0 -1
|
@@ -1,11 +1,13 @@
|
|
|
1
|
-
import { Direction } from './mg-menu.conf';
|
|
1
|
+
import { Direction, MenuSizeType, MoreItemType } from './mg-menu.conf';
|
|
2
2
|
export declare class MgMenu {
|
|
3
3
|
/************
|
|
4
4
|
* Internal *
|
|
5
5
|
************/
|
|
6
6
|
private readonly name;
|
|
7
|
+
private messages;
|
|
7
8
|
private menuItems;
|
|
8
9
|
private focusedMenuItem;
|
|
10
|
+
private overflowBehavior;
|
|
9
11
|
/**************
|
|
10
12
|
* Decorators *
|
|
11
13
|
**************/
|
|
@@ -24,22 +26,50 @@ export declare class MgMenu {
|
|
|
24
26
|
*/
|
|
25
27
|
direction: Direction;
|
|
26
28
|
validateDirection(newValue: MgMenu['direction']): void;
|
|
29
|
+
/**
|
|
30
|
+
* Customize mg-menu "more element"
|
|
31
|
+
* Used with direction: 'vertical' to manage overflow
|
|
32
|
+
*/
|
|
33
|
+
moreitem: MoreItemType;
|
|
34
|
+
validateMoreItem(newValue: MgMenu['moreitem']): void;
|
|
35
|
+
/**
|
|
36
|
+
* Define mg-menu size
|
|
37
|
+
* Default: 'regular'
|
|
38
|
+
*/
|
|
39
|
+
size: MenuSizeType;
|
|
40
|
+
validateSize(newValue: MgMenu['size']): void;
|
|
27
41
|
/**
|
|
28
42
|
* is this menu a child menu. Used for conditional render.
|
|
29
43
|
*/
|
|
30
44
|
isChildMenu: boolean;
|
|
45
|
+
/**
|
|
46
|
+
* Define if component manage child overflow
|
|
47
|
+
* Default: false
|
|
48
|
+
*/
|
|
49
|
+
hasOverflow: boolean;
|
|
31
50
|
/**
|
|
32
51
|
* Close matching menu-item
|
|
33
52
|
*
|
|
34
|
-
* @param {
|
|
53
|
+
* @param {HTMLElement} item menu-item to close
|
|
35
54
|
* @param {boolean} condition addionnal condition
|
|
36
55
|
* @returns {void}
|
|
37
56
|
*/
|
|
38
57
|
private closeMenuItem;
|
|
58
|
+
/*************
|
|
59
|
+
* Methods *
|
|
60
|
+
*************/
|
|
39
61
|
/**
|
|
40
62
|
* Store menu-items on component init and add listeners
|
|
63
|
+
*
|
|
64
|
+
* @returns {void}
|
|
41
65
|
*/
|
|
42
|
-
private
|
|
66
|
+
private initMenuItemsListeners;
|
|
67
|
+
/**
|
|
68
|
+
* render mg-menu-more
|
|
69
|
+
*
|
|
70
|
+
* @returns {HTMLElement} formated mg-menu-item element
|
|
71
|
+
*/
|
|
72
|
+
private renderMgMenuMore;
|
|
43
73
|
/*************
|
|
44
74
|
* Lifecycle *
|
|
45
75
|
*************/
|
|
@@ -55,6 +85,24 @@ export declare class MgMenu {
|
|
|
55
85
|
* @returns {ReturnType<typeof setTimeout>} timeout
|
|
56
86
|
*/
|
|
57
87
|
componentDidLoad(): ReturnType<typeof setTimeout>;
|
|
88
|
+
/**
|
|
89
|
+
* Check add listeners to childs
|
|
90
|
+
*
|
|
91
|
+
* @returns {void}
|
|
92
|
+
*/
|
|
93
|
+
componentDidRender(): void;
|
|
94
|
+
/**
|
|
95
|
+
* Disconnect overflow ResizeObserver
|
|
96
|
+
*
|
|
97
|
+
* @returns {void} run overflow resize obeserver disconnexion
|
|
98
|
+
*/
|
|
99
|
+
disconnectedCallback(): void;
|
|
100
|
+
/**
|
|
101
|
+
* Render mg-menu-item more element for overflow behavior
|
|
102
|
+
*
|
|
103
|
+
* @returns {HTMLElement} rendered mg-menu-item more element
|
|
104
|
+
*/
|
|
105
|
+
private renderMgMenuItemMore;
|
|
58
106
|
/**
|
|
59
107
|
* Render
|
|
60
108
|
*
|
|
@@ -14,11 +14,3 @@ export declare enum Status {
|
|
|
14
14
|
DISABLED = "disabled",
|
|
15
15
|
ACTIVE = "active"
|
|
16
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];
|
|
@@ -1,12 +1,15 @@
|
|
|
1
|
+
import { EventEmitter } from '../../../../stencil-public-runtime';
|
|
1
2
|
import { ClassList } from '../../../../utils/components.utils';
|
|
2
3
|
import { MgMenu } from '../mg-menu/mg-menu';
|
|
3
|
-
import {
|
|
4
|
+
import { MenuSizeType } from '../mg-menu/mg-menu.conf';
|
|
5
|
+
import { Status } from './mg-menu-item.conf';
|
|
4
6
|
export declare class MgMenuItem {
|
|
5
7
|
/************
|
|
6
8
|
* Internal *
|
|
7
9
|
************/
|
|
8
10
|
private readonly name;
|
|
9
11
|
private readonly navigationButton;
|
|
12
|
+
private badgeLabel;
|
|
10
13
|
/**************
|
|
11
14
|
* Decorators *
|
|
12
15
|
**************/
|
|
@@ -18,7 +21,7 @@ export declare class MgMenuItem {
|
|
|
18
21
|
* Props *
|
|
19
22
|
************/
|
|
20
23
|
/**
|
|
21
|
-
* Define menu-item
|
|
24
|
+
* Define menu-item href
|
|
22
25
|
* when defined menu-item contain an anchor instead of button
|
|
23
26
|
*/
|
|
24
27
|
href: string;
|
|
@@ -27,19 +30,26 @@ export declare class MgMenuItem {
|
|
|
27
30
|
*/
|
|
28
31
|
status: Status;
|
|
29
32
|
validateStatus(newValue: MgMenuItem['status'], oldValue?: MgMenuItem['status']): void;
|
|
30
|
-
/**
|
|
31
|
-
* Define menu-item size. Default: "large".
|
|
32
|
-
*/
|
|
33
|
-
size: MenuItemSizeType;
|
|
34
|
-
validateSize(newValue: MgMenuItem['size'], oldValue?: MgMenuItem['size']): void;
|
|
35
33
|
/**
|
|
36
34
|
* Define menu-item content expanded. Default: false.
|
|
37
35
|
*/
|
|
38
36
|
expanded: boolean;
|
|
39
37
|
validateExpanded(newValue: MgMenuItem['expanded']): void;
|
|
40
|
-
|
|
38
|
+
/**********
|
|
39
|
+
* Events *
|
|
40
|
+
*********/
|
|
41
|
+
/**
|
|
42
|
+
* Emited event when status change
|
|
43
|
+
*/
|
|
44
|
+
statusChange: EventEmitter<MgMenuItem['status']>;
|
|
45
|
+
/**********
|
|
41
46
|
* States *
|
|
42
|
-
|
|
47
|
+
*********/
|
|
48
|
+
/**
|
|
49
|
+
* Define menu-item size. Default: "regular".
|
|
50
|
+
*/
|
|
51
|
+
size: MenuSizeType;
|
|
52
|
+
validateSize(newValue: MgMenuItem['size'], oldValue?: MgMenuItem['size']): void;
|
|
43
53
|
/**
|
|
44
54
|
* Component button classes
|
|
45
55
|
*/
|
|
@@ -57,9 +67,13 @@ export declare class MgMenuItem {
|
|
|
57
67
|
*/
|
|
58
68
|
hasChildren: boolean;
|
|
59
69
|
validateHasChildren(newValue: boolean): void;
|
|
60
|
-
|
|
70
|
+
/**
|
|
71
|
+
* Does component should display notification badge.
|
|
72
|
+
*/
|
|
73
|
+
displayNotificationBadge: boolean;
|
|
74
|
+
/***********
|
|
61
75
|
* Methods *
|
|
62
|
-
|
|
76
|
+
**********/
|
|
63
77
|
/**
|
|
64
78
|
* Toggle expanded prop value
|
|
65
79
|
*
|
|
@@ -67,20 +81,20 @@ export declare class MgMenuItem {
|
|
|
67
81
|
*/
|
|
68
82
|
private toggleExpanded;
|
|
69
83
|
/**
|
|
70
|
-
* Does an
|
|
84
|
+
* Does an Element have given Status
|
|
71
85
|
*
|
|
72
|
-
* @param {
|
|
86
|
+
* @param {Element} element to parse
|
|
73
87
|
* @param {MgMenuItem['status']} status to check
|
|
74
88
|
* @returns {boolean} true if element with status is found
|
|
75
89
|
*/
|
|
76
|
-
private
|
|
90
|
+
private hasStatus;
|
|
77
91
|
/**
|
|
78
92
|
* Is component contextual direction match the given direction
|
|
79
93
|
*
|
|
80
94
|
* @param {MgMenuItem['direction']} direction in parent menu
|
|
81
95
|
* @returns {boolean} true is direction match the direction propertie
|
|
82
96
|
*/
|
|
83
|
-
private
|
|
97
|
+
private isDirection;
|
|
84
98
|
/************
|
|
85
99
|
* Handlers *
|
|
86
100
|
************/
|
|
@@ -91,6 +105,20 @@ export declare class MgMenuItem {
|
|
|
91
105
|
* @returns {void}
|
|
92
106
|
*/
|
|
93
107
|
private handleElementCLick;
|
|
108
|
+
/**
|
|
109
|
+
* Handle popover element display-change event
|
|
110
|
+
*
|
|
111
|
+
* @param {CustomEvent} event popover display event
|
|
112
|
+
* @returns {void}
|
|
113
|
+
*/
|
|
114
|
+
private handlePopoverDisplay;
|
|
115
|
+
/**
|
|
116
|
+
* Update displayNotificationBadge
|
|
117
|
+
* current component notification badge have priority over the slot badge when submenu contain badge
|
|
118
|
+
*
|
|
119
|
+
* @returns {void} update displayNotificationBadge value
|
|
120
|
+
*/
|
|
121
|
+
private updateDisplayNotificationBadge;
|
|
94
122
|
/*************
|
|
95
123
|
* Lifecycle *
|
|
96
124
|
*************/
|
|
@@ -106,6 +134,18 @@ export declare class MgMenuItem {
|
|
|
106
134
|
* @returns {ReturnType<typeof setTimeout>} timeout
|
|
107
135
|
*/
|
|
108
136
|
componentDidLoad(): ReturnType<typeof setTimeout>;
|
|
137
|
+
/**
|
|
138
|
+
* Render ineractive element
|
|
139
|
+
*
|
|
140
|
+
* @returns {HTMLElement} HTML Element
|
|
141
|
+
*/
|
|
142
|
+
private renderInteractiveElement;
|
|
143
|
+
/**
|
|
144
|
+
* Render slot
|
|
145
|
+
*
|
|
146
|
+
* @returns {HTMLElement} HTML Element
|
|
147
|
+
*/
|
|
148
|
+
private renderSlot;
|
|
109
149
|
/**
|
|
110
150
|
* Render
|
|
111
151
|
*
|
|
@@ -7,6 +7,8 @@ export declare class MgMessage {
|
|
|
7
7
|
private readonly classHide;
|
|
8
8
|
private closeButtonId;
|
|
9
9
|
private storedTimer;
|
|
10
|
+
private isFocused;
|
|
11
|
+
private isHovered;
|
|
10
12
|
private messages;
|
|
11
13
|
/**************
|
|
12
14
|
* Decorators *
|
|
@@ -59,13 +61,28 @@ export declare class MgMessage {
|
|
|
59
61
|
*/
|
|
60
62
|
componentHide: EventEmitter<string>;
|
|
61
63
|
/**
|
|
62
|
-
*
|
|
64
|
+
* Set timer
|
|
65
|
+
*
|
|
66
|
+
* @returns {void}
|
|
63
67
|
*/
|
|
64
|
-
private
|
|
68
|
+
private setTimer;
|
|
65
69
|
/**
|
|
66
|
-
*
|
|
70
|
+
* Clear timer
|
|
71
|
+
*
|
|
72
|
+
* @returns {void}
|
|
67
73
|
*/
|
|
68
|
-
private
|
|
74
|
+
private clearTimer;
|
|
75
|
+
/**
|
|
76
|
+
* Event to add on element
|
|
77
|
+
*
|
|
78
|
+
* @param {MouseEvent | FocusEvent} event event
|
|
79
|
+
* @returns {void}
|
|
80
|
+
*/
|
|
81
|
+
private timerEvents;
|
|
82
|
+
/**
|
|
83
|
+
* Handle close button
|
|
84
|
+
*/
|
|
85
|
+
private handleClose;
|
|
69
86
|
/**
|
|
70
87
|
* Get icon corresponding to variant
|
|
71
88
|
*
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { EventEmitter } from '../../../stencil-public-runtime';
|
|
2
2
|
import { Placement } from '@popperjs/core';
|
|
3
|
+
import { ClassList } from '../../../utils/components.utils';
|
|
3
4
|
export declare class MgPopover {
|
|
4
5
|
/************
|
|
5
6
|
* Internal *
|
|
@@ -7,7 +8,9 @@ export declare class MgPopover {
|
|
|
7
8
|
private popper;
|
|
8
9
|
private popover;
|
|
9
10
|
private closeButtonId;
|
|
11
|
+
private windows;
|
|
10
12
|
private messages;
|
|
13
|
+
private readonly classArrowHide;
|
|
11
14
|
/**************
|
|
12
15
|
* Decorators *
|
|
13
16
|
**************/
|
|
@@ -24,6 +27,11 @@ export declare class MgPopover {
|
|
|
24
27
|
* Popover placement
|
|
25
28
|
*/
|
|
26
29
|
placement: Placement;
|
|
30
|
+
/**
|
|
31
|
+
* Hide popover arrow
|
|
32
|
+
*/
|
|
33
|
+
arrowHide: boolean;
|
|
34
|
+
validateArrowHide(newValue: MgPopover['arrowHide']): void;
|
|
27
35
|
/**
|
|
28
36
|
* Define if popover has a cross button
|
|
29
37
|
*/
|
|
@@ -37,6 +45,10 @@ export declare class MgPopover {
|
|
|
37
45
|
* Disable popover
|
|
38
46
|
*/
|
|
39
47
|
disabled: boolean;
|
|
48
|
+
/**
|
|
49
|
+
* Component classes
|
|
50
|
+
*/
|
|
51
|
+
classList: ClassList;
|
|
40
52
|
/**
|
|
41
53
|
* Emited event when display value change
|
|
42
54
|
*/
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { EventEmitter } from '../../../stencil-public-runtime';
|
|
1
2
|
import { SkipLink } from './mg-skip-links.conf';
|
|
2
3
|
export declare class MgSkipLinks {
|
|
3
4
|
/************
|
|
@@ -16,6 +17,20 @@ export declare class MgSkipLinks {
|
|
|
16
17
|
*/
|
|
17
18
|
links: SkipLink[];
|
|
18
19
|
validateLinks(links: SkipLink[]): void;
|
|
20
|
+
/**
|
|
21
|
+
* Emited event when link is clicked
|
|
22
|
+
*/
|
|
23
|
+
goToAnchor: EventEmitter<string>;
|
|
24
|
+
/***********
|
|
25
|
+
* Methods *
|
|
26
|
+
**********/
|
|
27
|
+
/**
|
|
28
|
+
* Handle link click and emit go-to-anchor event
|
|
29
|
+
*
|
|
30
|
+
* @param {MouseEvent} event mouse event
|
|
31
|
+
* @returns {void}
|
|
32
|
+
*/
|
|
33
|
+
private handleLinkCLick;
|
|
19
34
|
/*************
|
|
20
35
|
* Lifecycle *
|
|
21
36
|
*************/
|
|
@@ -13,10 +13,12 @@ export declare enum Status {
|
|
|
13
13
|
* type TabItem
|
|
14
14
|
* use to match tabs items
|
|
15
15
|
*/
|
|
16
|
-
export
|
|
16
|
+
export type TabItem = {
|
|
17
17
|
label: string;
|
|
18
18
|
icon?: MgIcon['icon'];
|
|
19
|
-
badge?: Pick<MgBadge, 'value' | 'variant' | 'label'
|
|
19
|
+
badge?: Pick<MgBadge, 'value' | 'variant' | 'label'> & {
|
|
20
|
+
role: 'notification' | 'information';
|
|
21
|
+
};
|
|
20
22
|
status: Status;
|
|
21
23
|
};
|
|
22
24
|
/**
|
|
@@ -26,4 +28,4 @@ export declare const sizes: readonly ["regular", "large"];
|
|
|
26
28
|
/**
|
|
27
29
|
* Variant type from variants
|
|
28
30
|
*/
|
|
29
|
-
export
|
|
31
|
+
export type SizeType = (typeof sizes)[number];
|
|
@@ -7,6 +7,7 @@ export declare class MgTabs {
|
|
|
7
7
|
************/
|
|
8
8
|
private readonly tabPanel;
|
|
9
9
|
private readonly buttonTabBaseClass;
|
|
10
|
+
private tabFocus;
|
|
10
11
|
private startIndex;
|
|
11
12
|
/**************
|
|
12
13
|
* Decorators *
|
|
@@ -39,7 +40,6 @@ export declare class MgTabs {
|
|
|
39
40
|
validateItems(newValue: MgTabs['items']): void;
|
|
40
41
|
/**
|
|
41
42
|
* Active tab number
|
|
42
|
-
* default: first is 1
|
|
43
43
|
*/
|
|
44
44
|
activeTab: number;
|
|
45
45
|
validateActiveTab(newValue: MgTabs['activeTab']): void;
|
|
@@ -55,13 +55,6 @@ export declare class MgTabs {
|
|
|
55
55
|
* Emited event when active tab change
|
|
56
56
|
*/
|
|
57
57
|
activeTabChange: EventEmitter<number>;
|
|
58
|
-
/**
|
|
59
|
-
* Method to set active tab
|
|
60
|
-
*
|
|
61
|
-
* @param {number} tabKey item tab key to set to ACTIVE status
|
|
62
|
-
* @returns {void}
|
|
63
|
-
*/
|
|
64
|
-
private setActiveTab;
|
|
65
58
|
/**
|
|
66
59
|
* Method to know if given tab has the given status
|
|
67
60
|
*
|
|
@@ -69,7 +62,7 @@ export declare class MgTabs {
|
|
|
69
62
|
* @param {Status} status status to valide
|
|
70
63
|
* @returns {boolean} status comparaison
|
|
71
64
|
*/
|
|
72
|
-
private
|
|
65
|
+
private tabHasStatus;
|
|
73
66
|
/**
|
|
74
67
|
* Method to get element id from index
|
|
75
68
|
*
|
|
@@ -79,12 +72,18 @@ export declare class MgTabs {
|
|
|
79
72
|
*/
|
|
80
73
|
private getElementId;
|
|
81
74
|
/**
|
|
82
|
-
* Method to get tab index
|
|
75
|
+
* Method to get tab item index
|
|
83
76
|
*
|
|
84
77
|
* @param {number} index to get
|
|
85
78
|
* @returns {number} index
|
|
86
79
|
*/
|
|
87
|
-
private
|
|
80
|
+
private getTabItemIndex;
|
|
81
|
+
/**
|
|
82
|
+
* Method to get the active-tab value
|
|
83
|
+
*
|
|
84
|
+
* @returns {number} of the active-tab
|
|
85
|
+
*/
|
|
86
|
+
private getActiveTab;
|
|
88
87
|
/**
|
|
89
88
|
* Handle click events on tabs
|
|
90
89
|
*
|
|
@@ -95,7 +94,6 @@ export declare class MgTabs {
|
|
|
95
94
|
* get navigation button class from given status
|
|
96
95
|
*
|
|
97
96
|
* @param {Status} status button tab status
|
|
98
|
-
* @param {boolean} isSelector set if we need a CSS selector with the dot '.' at the begin. default value = false.
|
|
99
97
|
* @returns {string} button class/selector variant
|
|
100
98
|
*/
|
|
101
99
|
private getNavigationButtonClass;
|
|
@@ -106,6 +104,12 @@ export declare class MgTabs {
|
|
|
106
104
|
* @returns {void}
|
|
107
105
|
*/
|
|
108
106
|
private handleKeydown;
|
|
107
|
+
/**
|
|
108
|
+
* Method to reset focus behavior
|
|
109
|
+
*
|
|
110
|
+
* @returns {void}
|
|
111
|
+
*/
|
|
112
|
+
private resetFocus;
|
|
109
113
|
/**
|
|
110
114
|
* Validate slots setting
|
|
111
115
|
*/
|
|
@@ -119,6 +123,12 @@ export declare class MgTabs {
|
|
|
119
123
|
* @returns {void}
|
|
120
124
|
*/
|
|
121
125
|
componentWillLoad(): void;
|
|
126
|
+
/**
|
|
127
|
+
* add listners
|
|
128
|
+
*
|
|
129
|
+
* @returns {void}
|
|
130
|
+
*/
|
|
131
|
+
componentDidLoad(): void;
|
|
122
132
|
/**
|
|
123
133
|
* Render
|
|
124
134
|
*
|
|
@@ -13,8 +13,8 @@ import { Width } from "./components/molecules/inputs/MgInput.conf";
|
|
|
13
13
|
import { RadioOption } from "./components/molecules/inputs/mg-input-radio/mg-input-radio.conf";
|
|
14
14
|
import { SelectOption } from "./components/molecules/inputs/mg-input-select/mg-input-select.conf";
|
|
15
15
|
import { ToggleValue } from "./components/molecules/inputs/mg-input-toggle/mg-input-toggle.conf";
|
|
16
|
-
import { Direction } from "./components/molecules/menu/mg-menu/mg-menu.conf";
|
|
17
|
-
import {
|
|
16
|
+
import { Direction, MenuSizeType, MoreItemType } from "./components/molecules/menu/mg-menu/mg-menu.conf";
|
|
17
|
+
import { Status } from "./components/molecules/menu/mg-menu-item/mg-menu-item.conf";
|
|
18
18
|
import { Placement } from "@popperjs/core";
|
|
19
19
|
import { SkipLink } from "./components/molecules/mg-skip-links/mg-skip-links.conf";
|
|
20
20
|
import { SizeType, TabItem } from "./components/molecules/mg-tabs/mg-tabs.conf";
|
|
@@ -874,6 +874,14 @@ export namespace Components {
|
|
|
874
874
|
* Menu label. Include short menu description. Required for accessibility
|
|
875
875
|
*/
|
|
876
876
|
"label": string;
|
|
877
|
+
/**
|
|
878
|
+
* Customize mg-menu "more element" Used with direction: 'vertical' to manage overflow
|
|
879
|
+
*/
|
|
880
|
+
"moreitem": MoreItemType;
|
|
881
|
+
/**
|
|
882
|
+
* Define mg-menu size Default: 'regular'
|
|
883
|
+
*/
|
|
884
|
+
"size": MenuSizeType;
|
|
877
885
|
}
|
|
878
886
|
interface MgMenuItem {
|
|
879
887
|
/**
|
|
@@ -881,13 +889,9 @@ export namespace Components {
|
|
|
881
889
|
*/
|
|
882
890
|
"expanded": boolean;
|
|
883
891
|
/**
|
|
884
|
-
* Define menu-item
|
|
892
|
+
* Define menu-item href when defined menu-item contain an anchor instead of button
|
|
885
893
|
*/
|
|
886
894
|
"href": string;
|
|
887
|
-
/**
|
|
888
|
-
* Define menu-item size. Default: "large".
|
|
889
|
-
*/
|
|
890
|
-
"size": MenuItemSizeType;
|
|
891
895
|
/**
|
|
892
896
|
* Define menu-item status. Default: "visible"
|
|
893
897
|
*/
|
|
@@ -982,6 +986,10 @@ export namespace Components {
|
|
|
982
986
|
"titlePatternErrorMessage": string;
|
|
983
987
|
}
|
|
984
988
|
interface MgPopover {
|
|
989
|
+
/**
|
|
990
|
+
* Hide popover arrow
|
|
991
|
+
*/
|
|
992
|
+
"arrowHide": boolean;
|
|
985
993
|
/**
|
|
986
994
|
* Define if popover has a cross button
|
|
987
995
|
*/
|
|
@@ -1011,7 +1019,7 @@ export namespace Components {
|
|
|
1011
1019
|
}
|
|
1012
1020
|
interface MgTabs {
|
|
1013
1021
|
/**
|
|
1014
|
-
* Active tab number
|
|
1022
|
+
* Active tab number
|
|
1015
1023
|
*/
|
|
1016
1024
|
"activeTab": number;
|
|
1017
1025
|
/**
|
|
@@ -1112,6 +1120,10 @@ export interface MgInputToggleCustomEvent<T> extends CustomEvent<T> {
|
|
|
1112
1120
|
detail: T;
|
|
1113
1121
|
target: HTMLMgInputToggleElement;
|
|
1114
1122
|
}
|
|
1123
|
+
export interface MgMenuItemCustomEvent<T> extends CustomEvent<T> {
|
|
1124
|
+
detail: T;
|
|
1125
|
+
target: HTMLMgMenuItemElement;
|
|
1126
|
+
}
|
|
1115
1127
|
export interface MgMessageCustomEvent<T> extends CustomEvent<T> {
|
|
1116
1128
|
detail: T;
|
|
1117
1129
|
target: HTMLMgMessageElement;
|
|
@@ -1132,6 +1144,10 @@ export interface MgPopoverCustomEvent<T> extends CustomEvent<T> {
|
|
|
1132
1144
|
detail: T;
|
|
1133
1145
|
target: HTMLMgPopoverElement;
|
|
1134
1146
|
}
|
|
1147
|
+
export interface MgSkipLinksCustomEvent<T> extends CustomEvent<T> {
|
|
1148
|
+
detail: T;
|
|
1149
|
+
target: HTMLMgSkipLinksElement;
|
|
1150
|
+
}
|
|
1135
1151
|
export interface MgTabsCustomEvent<T> extends CustomEvent<T> {
|
|
1136
1152
|
detail: T;
|
|
1137
1153
|
target: HTMLMgTabsElement;
|
|
@@ -2239,6 +2255,14 @@ declare namespace LocalJSX {
|
|
|
2239
2255
|
* Menu label. Include short menu description. Required for accessibility
|
|
2240
2256
|
*/
|
|
2241
2257
|
"label": string;
|
|
2258
|
+
/**
|
|
2259
|
+
* Customize mg-menu "more element" Used with direction: 'vertical' to manage overflow
|
|
2260
|
+
*/
|
|
2261
|
+
"moreitem"?: MoreItemType;
|
|
2262
|
+
/**
|
|
2263
|
+
* Define mg-menu size Default: 'regular'
|
|
2264
|
+
*/
|
|
2265
|
+
"size"?: MenuSizeType;
|
|
2242
2266
|
}
|
|
2243
2267
|
interface MgMenuItem {
|
|
2244
2268
|
/**
|
|
@@ -2246,13 +2270,13 @@ declare namespace LocalJSX {
|
|
|
2246
2270
|
*/
|
|
2247
2271
|
"expanded"?: boolean;
|
|
2248
2272
|
/**
|
|
2249
|
-
* Define menu-item
|
|
2273
|
+
* Define menu-item href when defined menu-item contain an anchor instead of button
|
|
2250
2274
|
*/
|
|
2251
2275
|
"href"?: string;
|
|
2252
2276
|
/**
|
|
2253
|
-
*
|
|
2277
|
+
* Emited event when status change
|
|
2254
2278
|
*/
|
|
2255
|
-
"
|
|
2279
|
+
"onStatus-change"?: (event: MgMenuItemCustomEvent<MgMenuItem['status']>) => void;
|
|
2256
2280
|
/**
|
|
2257
2281
|
* Define menu-item status. Default: "visible"
|
|
2258
2282
|
*/
|
|
@@ -2375,6 +2399,10 @@ declare namespace LocalJSX {
|
|
|
2375
2399
|
"titlePatternErrorMessage"?: string;
|
|
2376
2400
|
}
|
|
2377
2401
|
interface MgPopover {
|
|
2402
|
+
/**
|
|
2403
|
+
* Hide popover arrow
|
|
2404
|
+
*/
|
|
2405
|
+
"arrowHide"?: boolean;
|
|
2378
2406
|
/**
|
|
2379
2407
|
* Define if popover has a cross button
|
|
2380
2408
|
*/
|
|
@@ -2405,10 +2433,14 @@ declare namespace LocalJSX {
|
|
|
2405
2433
|
* Skip links
|
|
2406
2434
|
*/
|
|
2407
2435
|
"links"?: SkipLink[];
|
|
2436
|
+
/**
|
|
2437
|
+
* Emited event when link is clicked
|
|
2438
|
+
*/
|
|
2439
|
+
"onGo-to-anchor"?: (event: MgSkipLinksCustomEvent<string>) => void;
|
|
2408
2440
|
}
|
|
2409
2441
|
interface MgTabs {
|
|
2410
2442
|
/**
|
|
2411
|
-
* Active tab number
|
|
2443
|
+
* Active tab number
|
|
2412
2444
|
*/
|
|
2413
2445
|
"activeTab"?: number;
|
|
2414
2446
|
/**
|
|
@@ -51,6 +51,10 @@ declare const messages: {
|
|
|
51
51
|
next: string;
|
|
52
52
|
previous: string;
|
|
53
53
|
};
|
|
54
|
+
plusMenu: {
|
|
55
|
+
moreLabel: string;
|
|
56
|
+
badgeLabel: string;
|
|
57
|
+
};
|
|
54
58
|
};
|
|
55
59
|
fr: {
|
|
56
60
|
errors: {
|
|
@@ -62,13 +66,7 @@ declare const messages: {
|
|
|
62
66
|
minMax: string;
|
|
63
67
|
};
|
|
64
68
|
numeric: {
|
|
65
|
-
min: string;
|
|
66
|
-
* Get Intl object
|
|
67
|
-
* We load the defined locale but for now we only support the first subtag for messages
|
|
68
|
-
*
|
|
69
|
-
* @param {HTMLElement} element element we need to get the language
|
|
70
|
-
* @returns {{ locale: string; messages: unknown }} messages object
|
|
71
|
-
*/
|
|
69
|
+
min: string;
|
|
72
70
|
max: string;
|
|
73
71
|
minMax: string;
|
|
74
72
|
};
|
|
@@ -110,17 +108,20 @@ declare const messages: {
|
|
|
110
108
|
next: string;
|
|
111
109
|
previous: string;
|
|
112
110
|
};
|
|
111
|
+
plusMenu: {
|
|
112
|
+
moreLabel: string;
|
|
113
|
+
badgeLabel: string;
|
|
114
|
+
};
|
|
113
115
|
};
|
|
114
116
|
};
|
|
115
117
|
/**
|
|
116
118
|
* Get Intl object
|
|
117
|
-
* We load the defined locale but for now we only support the first subtag for messages
|
|
118
119
|
*
|
|
119
120
|
* @param {HTMLElement} element element we need to get the language
|
|
120
121
|
* @returns {{ locale: string; messages: unknown }} messages object
|
|
121
122
|
*/
|
|
122
123
|
export declare const initLocales: (element: HTMLElement) => {
|
|
123
124
|
locale: string;
|
|
124
|
-
messages:
|
|
125
|
+
messages: unknown;
|
|
125
126
|
};
|
|
126
127
|
export {};
|