@mgdis/mg-components 5.4.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-94497267.js → index-4dcc1812.js} +11 -1
- package/dist/cjs/loader.cjs.js +3 -3
- package/dist/cjs/{mg-badge_29.cjs.entry.js → mg-badge_30.cjs.entry.js} +1112 -859
- package/dist/cjs/mg-components.cjs.js +3 -3
- package/dist/collection/collection-manifest.json +5 -4
- package/dist/collection/components/atoms/mg-badge/doc/mg-badge.stories.js +0 -7
- 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 +7 -10
- package/dist/collection/components/atoms/mg-button/doc/mg-button.stories.js +0 -7
- package/dist/collection/components/atoms/mg-button/mg-button.conf.js +1 -1
- package/dist/collection/components/atoms/mg-button/mg-button.css +15 -1
- package/dist/collection/components/atoms/mg-button/mg-button.js +12 -29
- package/dist/collection/components/atoms/mg-card/mg-card.css +17 -5
- package/dist/collection/components/atoms/mg-character-left/mg-character-left.js +2 -3
- package/dist/collection/components/atoms/mg-divider/mg-divider.js +0 -6
- package/dist/collection/components/atoms/mg-icon/mg-icon.conf.js +13 -3
- package/dist/collection/components/atoms/mg-icon/mg-icon.js +5 -12
- package/dist/collection/components/atoms/mg-input-title/mg-input-title.js +4 -8
- package/dist/collection/components/atoms/mg-tag/doc/mg-tag.stories.js +1 -9
- package/dist/collection/components/atoms/mg-tag/mg-tag.css +58 -0
- package/dist/collection/components/atoms/mg-tag/mg-tag.js +61 -16
- package/dist/collection/components/atoms/mg-tooltip/mg-tooltip.css +2 -0
- package/dist/collection/components/atoms/mg-tooltip/mg-tooltip.js +9 -22
- package/dist/collection/components/molecules/inputs/mg-input-checkbox/mg-input-checkbox.js +17 -33
- 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 +21 -26
- package/dist/collection/components/molecules/inputs/mg-input-numeric/mg-input-numeric.css +3 -3
- package/dist/collection/components/molecules/inputs/mg-input-numeric/mg-input-numeric.js +24 -47
- package/dist/collection/components/molecules/inputs/mg-input-password/mg-input-password.css +3 -3
- package/dist/collection/components/molecules/inputs/mg-input-password/mg-input-password.js +17 -29
- package/dist/collection/components/molecules/inputs/mg-input-radio/mg-input-radio.js +18 -33
- 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 +30 -36
- package/dist/collection/components/molecules/inputs/mg-input-text/mg-input-text.css +3 -3
- package/dist/collection/components/molecules/inputs/mg-input-text/mg-input-text.js +23 -41
- package/dist/collection/components/molecules/inputs/mg-input-textarea/mg-input-textarea.css +3 -3
- package/dist/collection/components/molecules/inputs/mg-input-textarea/mg-input-textarea.js +23 -45
- package/dist/collection/components/molecules/inputs/mg-input-toggle/mg-input-toggle.js +16 -33
- 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 +145 -25
- package/dist/collection/components/molecules/menu/mg-menu-item/doc/mg-menu-item.stories.js +7 -5
- 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 +51 -21
- package/dist/collection/components/molecules/menu/mg-menu-item/mg-menu-item.js +129 -92
- package/dist/collection/components/molecules/mg-details/mg-details.js +4 -8
- package/dist/collection/components/molecules/mg-form/mg-form.js +8 -22
- package/dist/collection/components/molecules/mg-illustrated-message/mg-illustrated-message.css +2 -2
- package/dist/collection/components/molecules/mg-illustrated-message/mg-illustrated-message.js +4 -9
- package/dist/collection/components/molecules/mg-message/mg-message.css +20 -19
- package/dist/collection/components/molecules/mg-message/mg-message.js +55 -33
- package/dist/collection/components/molecules/mg-modal/mg-modal.css +20 -8
- package/dist/collection/components/molecules/mg-modal/mg-modal.js +8 -26
- package/dist/collection/components/molecules/mg-pagination/mg-pagination.js +4 -13
- package/dist/collection/components/molecules/mg-panel/mg-panel.css +17 -5
- package/dist/collection/components/molecules/mg-panel/mg-panel.js +11 -22
- package/dist/collection/components/molecules/mg-popover/mg-popover.css +82 -20
- package/dist/collection/components/molecules/mg-popover/mg-popover.js +54 -26
- package/dist/collection/components/molecules/mg-skip-links/doc/mg-skip-links.stories.js +24 -0
- package/dist/collection/components/molecules/mg-skip-links/mg-skip-links.conf.js +1 -0
- package/dist/collection/components/molecules/mg-skip-links/mg-skip-links.css +28 -0
- package/dist/collection/components/molecules/mg-skip-links/mg-skip-links.js +108 -0
- 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 +109 -75
- package/dist/collection/locales/en/messages.json +7 -0
- package/dist/collection/locales/fr/messages.json +7 -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/index.d.ts +1 -0
- package/dist/components/index.js +1 -0
- package/dist/components/index2.js +73 -18
- package/dist/components/mg-badge2.js +8 -11
- package/dist/components/mg-button2.js +13 -30
- package/dist/components/mg-card.js +1 -37
- package/dist/components/mg-card2.js +39 -0
- package/dist/components/mg-character-left2.js +2 -3
- package/dist/components/mg-details.js +4 -8
- package/dist/components/mg-divider.js +0 -6
- package/dist/components/mg-form.js +8 -22
- package/dist/components/mg-icon2.js +18 -15
- package/dist/components/mg-illustrated-message.js +5 -10
- package/dist/components/mg-input-checkbox.js +17 -33
- package/dist/components/mg-input-date.js +23 -29
- package/dist/components/mg-input-numeric.js +26 -50
- package/dist/components/mg-input-password.js +18 -30
- package/dist/components/mg-input-radio.js +18 -33
- package/dist/components/mg-input-select2.js +32 -38
- package/dist/components/mg-input-text2.js +24 -42
- package/dist/components/mg-input-textarea.js +24 -46
- package/dist/components/mg-input-title2.js +4 -8
- package/dist/components/mg-input-toggle.js +16 -33
- package/dist/components/mg-menu-item.js +1 -264
- package/dist/components/mg-menu-item2.js +517 -0
- package/dist/components/mg-menu.js +142 -28
- package/dist/components/mg-message.js +64 -36
- package/dist/components/mg-modal.js +18 -30
- package/dist/components/mg-pagination.js +4 -13
- package/dist/components/mg-panel.js +20 -25
- package/dist/components/mg-popover.js +1 -200
- package/dist/components/mg-popover2.js +212 -0
- package/dist/components/mg-skip-links.d.ts +11 -0
- package/dist/components/mg-skip-links.js +80 -0
- package/dist/components/mg-tabs.js +108 -73
- package/dist/components/mg-tag.js +35 -13
- package/dist/components/mg-tooltip2.js +10 -23
- package/dist/esm/{index-aad0184c.js → index-dc9a2348.js} +11 -1
- package/dist/esm/loader.js +3 -3
- package/dist/esm/{mg-badge_29.entry.js → mg-badge_30.entry.js} +1112 -860
- package/dist/esm/mg-components.js +3 -3
- package/dist/esm/polyfills/core-js.js +0 -0
- package/dist/esm/polyfills/css-shim.js +1 -1
- package/dist/esm/polyfills/dom.js +0 -0
- package/dist/esm/polyfills/es5-html-element.js +0 -0
- package/dist/esm/polyfills/index.js +0 -0
- package/dist/esm/polyfills/system.js +0 -0
- package/dist/mg-components/locales/en/messages.json +7 -0
- package/dist/mg-components/locales/fr/messages.json +7 -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-3899d5d2.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/doc/mg-badge.stories.d.ts +0 -11
- package/dist/types/components/atoms/mg-badge/mg-badge.conf.d.ts +2 -2
- package/dist/types/components/atoms/mg-badge/mg-badge.d.ts +1 -1
- package/dist/types/components/atoms/mg-button/doc/mg-button.stories.d.ts +0 -11
- package/dist/types/components/atoms/mg-button/mg-button.conf.d.ts +4 -4
- package/dist/types/components/atoms/mg-button/mg-button.d.ts +6 -6
- package/dist/types/components/atoms/mg-icon/mg-icon.conf.d.ts +2 -2
- package/dist/types/components/atoms/mg-tag/doc/mg-tag.stories.d.ts +0 -13
- package/dist/types/components/atoms/mg-tag/mg-tag.conf.d.ts +5 -1
- package/dist/types/components/atoms/mg-tag/mg-tag.d.ts +27 -6
- 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/doc/mg-menu-item.stories.d.ts +1 -0
- 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-form/mg-form.d.ts +1 -1
- package/dist/types/components/molecules/mg-message/mg-message.d.ts +22 -5
- package/dist/types/components/molecules/mg-modal/mg-modal.d.ts +1 -1
- package/dist/types/components/molecules/mg-popover/mg-popover.d.ts +12 -0
- package/dist/types/components/molecules/mg-skip-links/doc/mg-skip-links.stories.d.ts +11 -0
- package/dist/types/components/molecules/mg-skip-links/mg-skip-links.conf.d.ts +7 -0
- package/dist/types/components/molecules/mg-skip-links/mg-skip-links.d.ts +49 -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 +24 -14
- package/dist/types/components.d.ts +81 -18
- package/dist/types/locales/index.d.ts +16 -9
- package/dist/types/stencil-public-runtime.d.ts +44 -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 +78 -0
- package/package.json +51 -46
- package/readme.md +25 -14
- package/dist/components/locale.utils.js +0 -40
- package/dist/components/mg-menu.conf.js +0 -10
- package/dist/mg-components/p-059a9a59.entry.js +0 -1
package/dist/types/components/molecules/inputs/mg-input-checkbox/mg-input-checkbox.conf.d.ts
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* type CheckboxItem
|
|
3
3
|
* use to match checkbox attributes
|
|
4
4
|
*/
|
|
5
|
-
export
|
|
5
|
+
export type CheckboxItem = {
|
|
6
6
|
id: string;
|
|
7
7
|
title: string;
|
|
8
8
|
value: boolean | null;
|
|
@@ -12,7 +12,7 @@ export declare type CheckboxItem = {
|
|
|
12
12
|
* type CheckboxValue
|
|
13
13
|
* use to match returned value
|
|
14
14
|
*/
|
|
15
|
-
export
|
|
15
|
+
export type CheckboxValue = {
|
|
16
16
|
title: string;
|
|
17
17
|
value: boolean | null;
|
|
18
18
|
disabled?: boolean;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* type SelectOption
|
|
3
3
|
* use to match select>option attributes
|
|
4
4
|
*/
|
|
5
|
-
export
|
|
5
|
+
export type SelectOption = {
|
|
6
6
|
title: string;
|
|
7
7
|
value: unknown;
|
|
8
8
|
disabled?: boolean;
|
|
@@ -12,7 +12,7 @@ export declare type SelectOption = {
|
|
|
12
12
|
* type OptGroup
|
|
13
13
|
* use to match select>optgroup attributes
|
|
14
14
|
*/
|
|
15
|
-
export
|
|
15
|
+
export type OptGroup = {
|
|
16
16
|
group: string;
|
|
17
17
|
options: SelectOption[];
|
|
18
18
|
};
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { MgIcon } from '../../../atoms/mg-icon/mg-icon';
|
|
2
|
+
import { MgMenu } from './mg-menu';
|
|
1
3
|
/**
|
|
2
4
|
* Menu direction type
|
|
3
5
|
*/
|
|
@@ -5,3 +7,38 @@ export declare enum Direction {
|
|
|
5
7
|
VERTICAL = "vertical",
|
|
6
8
|
HORIZONTAL = "horizontal"
|
|
7
9
|
}
|
|
10
|
+
/**
|
|
11
|
+
* message type
|
|
12
|
+
*/
|
|
13
|
+
export type MessageType = {
|
|
14
|
+
moreLabel: string;
|
|
15
|
+
badgeLabel: string;
|
|
16
|
+
};
|
|
17
|
+
/**
|
|
18
|
+
* more item type
|
|
19
|
+
*/
|
|
20
|
+
export type MoreItemType = {
|
|
21
|
+
mgIcon?: {
|
|
22
|
+
icon: MgIcon['icon'];
|
|
23
|
+
};
|
|
24
|
+
slotLabel?: {
|
|
25
|
+
label?: string;
|
|
26
|
+
display?: boolean;
|
|
27
|
+
};
|
|
28
|
+
size?: MgMenu['size'];
|
|
29
|
+
};
|
|
30
|
+
/**
|
|
31
|
+
* More item type guard
|
|
32
|
+
*
|
|
33
|
+
* @param {unknown} element element to control
|
|
34
|
+
* @returns {boolean} truthy if element is more-item
|
|
35
|
+
*/
|
|
36
|
+
export declare const isMoreItem: (element: unknown) => element is MoreItemType;
|
|
37
|
+
/**
|
|
38
|
+
* List of all possibles sizes
|
|
39
|
+
*/
|
|
40
|
+
export declare const sizes: readonly ["regular", "medium", "large"];
|
|
41
|
+
/**
|
|
42
|
+
* item Size from sizes
|
|
43
|
+
*/
|
|
44
|
+
export type MenuSizeType = (typeof sizes)[number];
|
|
@@ -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
|
*
|
|
@@ -4,6 +4,7 @@ declare const _default: {
|
|
|
4
4
|
};
|
|
5
5
|
export default _default;
|
|
6
6
|
export declare const MgMenuItem: any;
|
|
7
|
+
export declare const MgMenuItemAsLink: any;
|
|
7
8
|
export declare const MgMenuItemWhitIcon: any;
|
|
8
9
|
export declare const MgMenuItemWhitBadge: any;
|
|
9
10
|
export declare const MgMenuItemWhitBadgeAndIcon: any;
|
|
@@ -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
|
*
|
|
@@ -4,9 +4,11 @@ export declare class MgMessage {
|
|
|
4
4
|
/************
|
|
5
5
|
* Internal *
|
|
6
6
|
************/
|
|
7
|
-
private classHide;
|
|
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
|
*/
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { EventEmitter } from '../../../stencil-public-runtime';
|
|
2
|
+
import { SkipLink } from './mg-skip-links.conf';
|
|
3
|
+
export declare class MgSkipLinks {
|
|
4
|
+
/************
|
|
5
|
+
* Internal *
|
|
6
|
+
************/
|
|
7
|
+
private messages;
|
|
8
|
+
/**************
|
|
9
|
+
* Decorators *
|
|
10
|
+
**************/
|
|
11
|
+
/**
|
|
12
|
+
* Get component DOM element
|
|
13
|
+
*/
|
|
14
|
+
element: HTMLMgSkipLinksElement;
|
|
15
|
+
/**
|
|
16
|
+
* Skip links
|
|
17
|
+
*/
|
|
18
|
+
links: SkipLink[];
|
|
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;
|
|
34
|
+
/*************
|
|
35
|
+
* Lifecycle *
|
|
36
|
+
*************/
|
|
37
|
+
/**
|
|
38
|
+
* Check if props are well configured on init
|
|
39
|
+
*
|
|
40
|
+
* @returns {void}
|
|
41
|
+
*/
|
|
42
|
+
componentWillLoad(): void;
|
|
43
|
+
/**
|
|
44
|
+
* Render
|
|
45
|
+
*
|
|
46
|
+
* @returns {HTMLElement} HTML Element
|
|
47
|
+
*/
|
|
48
|
+
render(): HTMLElement;
|
|
49
|
+
}
|
|
@@ -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];
|
|
@@ -5,9 +5,10 @@ export declare class MgTabs {
|
|
|
5
5
|
/************
|
|
6
6
|
* Internal *
|
|
7
7
|
************/
|
|
8
|
-
private tabPanel;
|
|
8
|
+
private readonly tabPanel;
|
|
9
|
+
private readonly buttonTabBaseClass;
|
|
10
|
+
private tabFocus;
|
|
9
11
|
private startIndex;
|
|
10
|
-
private buttonTabBaseClass;
|
|
11
12
|
/**************
|
|
12
13
|
* Decorators *
|
|
13
14
|
**************/
|
|
@@ -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
|
*
|