@mgdis/mg-components 5.3.0 → 5.5.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-c3450336.js} +0 -0
- package/dist/cjs/loader.cjs.js +3 -3
- package/dist/cjs/{mg-badge_29.cjs.entry.js → mg-badge_30.cjs.entry.js} +517 -715
- package/dist/cjs/mg-components.cjs.js +3 -3
- package/dist/collection/collection-manifest.json +3 -2
- package/dist/collection/components/atoms/mg-badge/doc/mg-badge.stories.js +0 -7
- package/dist/collection/components/atoms/mg-badge/mg-badge.css +6 -0
- package/dist/collection/components/atoms/mg-badge/mg-badge.js +5 -8
- 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 +19 -1
- package/dist/collection/components/atoms/mg-button/mg-button.js +13 -30
- package/dist/collection/components/atoms/mg-card/mg-card.css +6 -1
- 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 +20 -4
- package/dist/collection/components/atoms/mg-icon/mg-icon.css +27 -0
- package/dist/collection/components/atoms/mg-icon/mg-icon.js +7 -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 +60 -15
- package/dist/collection/components/atoms/mg-tooltip/mg-tooltip.js +97 -68
- package/dist/collection/components/molecules/inputs/mg-input-checkbox/mg-input-checkbox.css +7 -0
- 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 +7 -0
- package/dist/collection/components/molecules/inputs/mg-input-date/mg-input-date.js +17 -25
- package/dist/collection/components/molecules/inputs/mg-input-numeric/mg-input-numeric.css +6 -0
- 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 +7 -0
- 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.css +7 -0
- 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 +6 -0
- package/dist/collection/components/molecules/inputs/mg-input-select/mg-input-select.js +23 -33
- package/dist/collection/components/molecules/inputs/mg-input-text/mg-input-text.css +6 -0
- 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 +6 -0
- 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.css +6 -0
- package/dist/collection/components/molecules/inputs/mg-input-toggle/mg-input-toggle.js +16 -33
- package/dist/collection/components/molecules/menu/mg-menu/mg-menu.css +1 -1
- package/dist/collection/components/molecules/menu/mg-menu/mg-menu.js +8 -23
- package/dist/collection/components/molecules/menu/mg-menu-item/doc/mg-menu-item.stories.js +8 -1
- package/dist/collection/components/molecules/menu/mg-menu-item/mg-menu-item.css +55 -24
- package/dist/collection/components/molecules/menu/mg-menu-item/mg-menu-item.js +18 -33
- package/dist/collection/components/molecules/mg-details/mg-details.css +6 -0
- package/dist/collection/components/molecules/mg-details/mg-details.js +4 -8
- package/dist/collection/components/molecules/mg-form/mg-form.js +9 -23
- 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 +0 -6
- package/dist/collection/components/molecules/mg-message/mg-message.css +13 -19
- package/dist/collection/components/molecules/mg-message/mg-message.js +8 -27
- package/dist/collection/components/molecules/mg-modal/mg-modal.css +12 -7
- package/dist/collection/components/molecules/mg-modal/mg-modal.js +8 -26
- package/dist/collection/components/molecules/mg-pagination/mg-pagination.css +6 -0
- package/dist/collection/components/molecules/mg-pagination/mg-pagination.js +4 -13
- package/dist/collection/components/molecules/mg-panel/mg-panel.css +10 -5
- package/dist/collection/components/molecules/mg-panel/mg-panel.js +11 -22
- package/dist/collection/components/molecules/mg-popover/mg-popover.css +13 -9
- package/dist/collection/components/molecules/mg-popover/mg-popover.js +7 -23
- 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 +77 -0
- package/dist/collection/components/molecules/mg-tabs/mg-tabs.js +10 -23
- package/dist/collection/locales/en/messages.json +3 -0
- package/dist/collection/locales/fr/messages.json +3 -0
- package/dist/components/index.d.ts +1 -0
- package/dist/components/index.js +1 -0
- package/dist/components/index2.js +8 -0
- package/dist/components/mg-badge2.js +6 -9
- package/dist/components/mg-button2.js +14 -31
- 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 +5 -9
- package/dist/components/mg-divider.js +0 -6
- package/dist/components/mg-form.js +9 -23
- package/dist/components/mg-icon2.js +28 -17
- package/dist/components/mg-illustrated-message.js +1 -7
- package/dist/components/mg-input-checkbox.js +18 -34
- package/dist/components/mg-input-date.js +18 -26
- package/dist/components/mg-input-numeric.js +25 -48
- package/dist/components/mg-input-password.js +18 -30
- package/dist/components/mg-input-radio.js +19 -34
- package/dist/components/mg-input-select2.js +25 -35
- 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 +17 -34
- package/dist/components/mg-menu-item.js +18 -33
- package/dist/components/mg-menu.js +9 -24
- package/dist/components/mg-message.js +17 -30
- package/dist/components/mg-modal.js +18 -30
- package/dist/components/mg-pagination.js +5 -14
- package/dist/components/mg-panel.js +20 -25
- package/dist/components/mg-popover.js +16 -26
- package/dist/components/mg-skip-links.d.ts +11 -0
- package/dist/components/mg-skip-links.js +66 -0
- package/dist/components/mg-tabs.js +10 -23
- package/dist/components/mg-tag.js +34 -12
- package/dist/components/mg-tooltip2.js +97 -68
- package/dist/esm/{index-aad0184c.js → index-78edde1d.js} +0 -0
- package/dist/esm/loader.js +3 -3
- package/dist/esm/{mg-badge_29.entry.js → mg-badge_30.entry.js} +517 -716
- package/dist/esm/mg-components.js +3 -3
- package/dist/esm/polyfills/core-js.js +0 -0
- 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 +3 -0
- package/dist/mg-components/locales/fr/messages.json +3 -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-125c54ca.js} +0 -0
- package/dist/mg-components/p-4961c96c.entry.js +1 -0
- package/dist/types/components/atoms/mg-badge/doc/mg-badge.stories.d.ts +0 -11
- 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 +2 -2
- package/dist/types/components/atoms/mg-button/mg-button.d.ts +6 -6
- 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/atoms/mg-tooltip/mg-tooltip.d.ts +15 -0
- package/dist/types/components/molecules/menu/mg-menu/mg-menu.d.ts +0 -5
- 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.d.ts +0 -4
- package/dist/types/components/molecules/mg-form/mg-form.d.ts +1 -1
- package/dist/types/components/molecules/mg-message/mg-message.d.ts +1 -1
- package/dist/types/components/molecules/mg-modal/mg-modal.d.ts +1 -1
- 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 +34 -0
- package/dist/types/components/molecules/mg-tabs/mg-tabs.d.ts +2 -2
- package/dist/types/components.d.ts +37 -6
- package/dist/types/locales/index.d.ts +6 -0
- package/dist/types/stencil-public-runtime.d.ts +5 -0
- package/dist/types/utils/unit.test.utils.d.ts +42 -0
- package/package.json +36 -31
- package/readme.md +3 -1
- package/dist/mg-components/p-204af46f.entry.js +0 -1
|
@@ -2,17 +2,6 @@ declare const _default: {
|
|
|
2
2
|
component: string;
|
|
3
3
|
title: string;
|
|
4
4
|
argTypes: {
|
|
5
|
-
variant: {
|
|
6
|
-
options: readonly ["info", "primary", "secondary", "success", "warning", "danger"];
|
|
7
|
-
control: {
|
|
8
|
-
type: string;
|
|
9
|
-
};
|
|
10
|
-
table: {
|
|
11
|
-
defaultValue: {
|
|
12
|
-
summary: "info";
|
|
13
|
-
};
|
|
14
|
-
};
|
|
15
|
-
};
|
|
16
5
|
value: {
|
|
17
6
|
control: {
|
|
18
7
|
type: string;
|
|
@@ -2,17 +2,6 @@ declare const _default: {
|
|
|
2
2
|
component: string;
|
|
3
3
|
title: string;
|
|
4
4
|
argTypes: {
|
|
5
|
-
variant: {
|
|
6
|
-
options: readonly ["primary", "secondary", "danger", "danger-alt", "info", "flat", "success"];
|
|
7
|
-
control: {
|
|
8
|
-
type: string;
|
|
9
|
-
};
|
|
10
|
-
table: {
|
|
11
|
-
defaultValue: {
|
|
12
|
-
summary: "primary";
|
|
13
|
-
};
|
|
14
|
-
};
|
|
15
|
-
};
|
|
16
5
|
type: {
|
|
17
6
|
options: ("button" | "submit" | "reset")[];
|
|
18
7
|
control: {
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* List of all possibles variants
|
|
3
3
|
*/
|
|
4
|
-
export declare const variants: readonly ["primary", "secondary", "danger", "danger-alt", "info", "flat", "success"];
|
|
4
|
+
export declare const variants: readonly ["primary", "secondary", "danger", "danger-alt", "info", "flat", "success", "link"];
|
|
5
5
|
/**
|
|
6
|
-
*
|
|
6
|
+
* VariantType type from button variants
|
|
7
7
|
*/
|
|
8
8
|
export declare type VariantType = typeof variants[number];
|
|
9
9
|
/**
|
|
@@ -5,9 +5,9 @@ export declare class MgButton {
|
|
|
5
5
|
* Internal *
|
|
6
6
|
************/
|
|
7
7
|
private onClickElementFn;
|
|
8
|
-
private classDisabled;
|
|
9
|
-
private classLoading;
|
|
10
|
-
private classFullWidth;
|
|
8
|
+
private readonly classDisabled;
|
|
9
|
+
private readonly classLoading;
|
|
10
|
+
private readonly classFullWidth;
|
|
11
11
|
/**************
|
|
12
12
|
* Decorators *
|
|
13
13
|
**************/
|
|
@@ -37,7 +37,7 @@ export declare class MgButton {
|
|
|
37
37
|
* Set button to full-width
|
|
38
38
|
*/
|
|
39
39
|
fullWidth: boolean;
|
|
40
|
-
validateFullWidth(newValue:
|
|
40
|
+
validateFullWidth(newValue: MgButton['fullWidth']): void;
|
|
41
41
|
/**
|
|
42
42
|
* Define form id to attach button with.
|
|
43
43
|
* If this attribute is not set, the <button> is associated with its ancestor <form> element.
|
|
@@ -47,7 +47,7 @@ export declare class MgButton {
|
|
|
47
47
|
* Disable button
|
|
48
48
|
*/
|
|
49
49
|
disabled: boolean;
|
|
50
|
-
disabledHandler(isDisabled:
|
|
50
|
+
disabledHandler(isDisabled: MgButton['disabled']): void;
|
|
51
51
|
/**
|
|
52
52
|
* Define if button is round.
|
|
53
53
|
* Used for icon button.
|
|
@@ -64,7 +64,7 @@ export declare class MgButton {
|
|
|
64
64
|
* It's required to reset to false when action/promise in parent is done to stop the loading state
|
|
65
65
|
*/
|
|
66
66
|
loading: boolean;
|
|
67
|
-
loadingHandler(newValue:
|
|
67
|
+
loadingHandler(newValue: MgButton['loading']): void;
|
|
68
68
|
/**
|
|
69
69
|
* Component classes
|
|
70
70
|
*/
|
|
@@ -1,19 +1,6 @@
|
|
|
1
1
|
declare const _default: {
|
|
2
2
|
component: string;
|
|
3
3
|
title: string;
|
|
4
|
-
argTypes: {
|
|
5
|
-
variant: {
|
|
6
|
-
options: string[];
|
|
7
|
-
control: {
|
|
8
|
-
type: string;
|
|
9
|
-
};
|
|
10
|
-
table: {
|
|
11
|
-
defaultValue: {
|
|
12
|
-
summary: string;
|
|
13
|
-
};
|
|
14
|
-
};
|
|
15
|
-
};
|
|
16
|
-
};
|
|
17
4
|
};
|
|
18
5
|
export default _default;
|
|
19
6
|
export declare const MgTag: any;
|
|
@@ -1,4 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* List of all possibles variants
|
|
3
3
|
*/
|
|
4
|
-
export declare const variants:
|
|
4
|
+
export declare const variants: readonly ["primary", "secondary", "success", "warning", "danger", "info"];
|
|
5
|
+
/**
|
|
6
|
+
* TagVariantType type from tag variants
|
|
7
|
+
*/
|
|
8
|
+
export declare type TagVariantType = typeof variants[number];
|
|
@@ -1,26 +1,47 @@
|
|
|
1
|
+
import { TagVariantType } from './mg-tag.conf';
|
|
1
2
|
import { ClassList } from '../../../utils/components.utils';
|
|
2
3
|
export declare class MgTag {
|
|
3
4
|
/************
|
|
4
5
|
* Internal *
|
|
5
6
|
************/
|
|
6
|
-
private classOutline;
|
|
7
|
+
private readonly classOutline;
|
|
8
|
+
private readonly classSoft;
|
|
7
9
|
/**************
|
|
8
10
|
* Decorators *
|
|
9
11
|
**************/
|
|
10
12
|
/**
|
|
11
|
-
*
|
|
13
|
+
* Get component DOM element
|
|
12
14
|
*/
|
|
13
|
-
|
|
14
|
-
validateVariant(newValue: string, oldValue?: string): void;
|
|
15
|
+
element: HTMLMgTagElement;
|
|
15
16
|
/**
|
|
16
|
-
* Define
|
|
17
|
+
* Define tag variant
|
|
18
|
+
*/
|
|
19
|
+
variant: TagVariantType;
|
|
20
|
+
validateVariant(newValue: MgTag['variant'], oldValue?: MgTag['variant']): void;
|
|
21
|
+
/**
|
|
22
|
+
* Define if tag is using outline style
|
|
17
23
|
*/
|
|
18
24
|
outline: boolean;
|
|
19
|
-
validateOutline(newValue:
|
|
25
|
+
validateOutline(newValue: MgTag['outline']): void;
|
|
26
|
+
/**
|
|
27
|
+
* Define if tag is using soft style
|
|
28
|
+
*/
|
|
29
|
+
soft: boolean;
|
|
30
|
+
validateSoft(newValue: MgTag['soft']): void;
|
|
20
31
|
/**
|
|
21
32
|
* Component classes
|
|
22
33
|
*/
|
|
23
34
|
classList: ClassList;
|
|
35
|
+
/*************
|
|
36
|
+
* Methods *
|
|
37
|
+
*************/
|
|
38
|
+
/**
|
|
39
|
+
* Validate the given textContent
|
|
40
|
+
*
|
|
41
|
+
* @param {string} textContent html element textContent property
|
|
42
|
+
* @returns {void}
|
|
43
|
+
*/
|
|
44
|
+
private validateTextContent;
|
|
24
45
|
/*************
|
|
25
46
|
* Lifecycle *
|
|
26
47
|
*************/
|
|
@@ -5,6 +5,7 @@ export declare class MgTooltip {
|
|
|
5
5
|
************/
|
|
6
6
|
private popper;
|
|
7
7
|
private tooltip;
|
|
8
|
+
private tooltipedElement;
|
|
8
9
|
private guard;
|
|
9
10
|
/**************
|
|
10
11
|
* Decorators *
|
|
@@ -71,6 +72,20 @@ export declare class MgTooltip {
|
|
|
71
72
|
* @returns {void}
|
|
72
73
|
*/
|
|
73
74
|
private resetGuard;
|
|
75
|
+
/**
|
|
76
|
+
* Update slot content when it is a mg-button
|
|
77
|
+
*
|
|
78
|
+
* @param {HTMLMgButtonElement} mgButton slotted mg-button
|
|
79
|
+
* @returns {void}
|
|
80
|
+
*/
|
|
81
|
+
private setMgButtonWrapper;
|
|
82
|
+
/**
|
|
83
|
+
* Init tooltip
|
|
84
|
+
*
|
|
85
|
+
* @param {HTMLElement} slotElement slotted element
|
|
86
|
+
* @param {HTMLElement} interactiveElement interactive element
|
|
87
|
+
*/
|
|
88
|
+
private initTooltip;
|
|
74
89
|
/*************
|
|
75
90
|
* Lifecycle *
|
|
76
91
|
*************/
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { ClassList } from '../../../../utils/components.utils';
|
|
2
1
|
import { Direction } from './mg-menu.conf';
|
|
3
2
|
export declare class MgMenu {
|
|
4
3
|
/************
|
|
@@ -29,10 +28,6 @@ export declare class MgMenu {
|
|
|
29
28
|
* is this menu a child menu. Used for conditional render.
|
|
30
29
|
*/
|
|
31
30
|
isChildMenu: boolean;
|
|
32
|
-
/**
|
|
33
|
-
* Component classes
|
|
34
|
-
*/
|
|
35
|
-
classList: ClassList;
|
|
36
31
|
/**
|
|
37
32
|
* Close matching menu-item
|
|
38
33
|
*
|
|
@@ -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;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { SkipLink } from './mg-skip-links.conf';
|
|
2
|
+
export declare class MgSkipLinks {
|
|
3
|
+
/************
|
|
4
|
+
* Internal *
|
|
5
|
+
************/
|
|
6
|
+
private messages;
|
|
7
|
+
/**************
|
|
8
|
+
* Decorators *
|
|
9
|
+
**************/
|
|
10
|
+
/**
|
|
11
|
+
* Get component DOM element
|
|
12
|
+
*/
|
|
13
|
+
element: HTMLMgSkipLinksElement;
|
|
14
|
+
/**
|
|
15
|
+
* Skip links
|
|
16
|
+
*/
|
|
17
|
+
links: SkipLink[];
|
|
18
|
+
validateLinks(links: SkipLink[]): void;
|
|
19
|
+
/*************
|
|
20
|
+
* Lifecycle *
|
|
21
|
+
*************/
|
|
22
|
+
/**
|
|
23
|
+
* Check if props are well configured on init
|
|
24
|
+
*
|
|
25
|
+
* @returns {void}
|
|
26
|
+
*/
|
|
27
|
+
componentWillLoad(): void;
|
|
28
|
+
/**
|
|
29
|
+
* Render
|
|
30
|
+
*
|
|
31
|
+
* @returns {HTMLElement} HTML Element
|
|
32
|
+
*/
|
|
33
|
+
render(): HTMLElement;
|
|
34
|
+
}
|
|
@@ -5,9 +5,9 @@ export declare class MgTabs {
|
|
|
5
5
|
/************
|
|
6
6
|
* Internal *
|
|
7
7
|
************/
|
|
8
|
-
private tabPanel;
|
|
8
|
+
private readonly tabPanel;
|
|
9
|
+
private readonly buttonTabBaseClass;
|
|
9
10
|
private startIndex;
|
|
10
|
-
private buttonTabBaseClass;
|
|
11
11
|
/**************
|
|
12
12
|
* Decorators *
|
|
13
13
|
**************/
|
|
@@ -16,7 +16,9 @@ import { ToggleValue } from "./components/molecules/inputs/mg-input-toggle/mg-in
|
|
|
16
16
|
import { Direction } from "./components/molecules/menu/mg-menu/mg-menu.conf";
|
|
17
17
|
import { MenuItemSizeType, Status } from "./components/molecules/menu/mg-menu-item/mg-menu-item.conf";
|
|
18
18
|
import { Placement } from "@popperjs/core";
|
|
19
|
+
import { SkipLink } from "./components/molecules/mg-skip-links/mg-skip-links.conf";
|
|
19
20
|
import { SizeType, TabItem } from "./components/molecules/mg-tabs/mg-tabs.conf";
|
|
21
|
+
import { TagVariantType } from "./components/atoms/mg-tag/mg-tag.conf";
|
|
20
22
|
export namespace Components {
|
|
21
23
|
interface MgBadge {
|
|
22
24
|
/**
|
|
@@ -1001,6 +1003,12 @@ export namespace Components {
|
|
|
1001
1003
|
*/
|
|
1002
1004
|
"placement": Placement;
|
|
1003
1005
|
}
|
|
1006
|
+
interface MgSkipLinks {
|
|
1007
|
+
/**
|
|
1008
|
+
* Skip links
|
|
1009
|
+
*/
|
|
1010
|
+
"links": SkipLink[];
|
|
1011
|
+
}
|
|
1004
1012
|
interface MgTabs {
|
|
1005
1013
|
/**
|
|
1006
1014
|
* Active tab number default: first is 1
|
|
@@ -1025,13 +1033,17 @@ export namespace Components {
|
|
|
1025
1033
|
}
|
|
1026
1034
|
interface MgTag {
|
|
1027
1035
|
/**
|
|
1028
|
-
* Define if
|
|
1036
|
+
* Define if tag is using outline style
|
|
1029
1037
|
*/
|
|
1030
1038
|
"outline": boolean;
|
|
1031
1039
|
/**
|
|
1032
|
-
* Define
|
|
1040
|
+
* Define if tag is using soft style
|
|
1033
1041
|
*/
|
|
1034
|
-
"
|
|
1042
|
+
"soft": boolean;
|
|
1043
|
+
/**
|
|
1044
|
+
* Define tag variant
|
|
1045
|
+
*/
|
|
1046
|
+
"variant": TagVariantType;
|
|
1035
1047
|
}
|
|
1036
1048
|
interface MgTooltip {
|
|
1037
1049
|
/**
|
|
@@ -1281,6 +1293,12 @@ declare global {
|
|
|
1281
1293
|
prototype: HTMLMgPopoverElement;
|
|
1282
1294
|
new (): HTMLMgPopoverElement;
|
|
1283
1295
|
};
|
|
1296
|
+
interface HTMLMgSkipLinksElement extends Components.MgSkipLinks, HTMLStencilElement {
|
|
1297
|
+
}
|
|
1298
|
+
var HTMLMgSkipLinksElement: {
|
|
1299
|
+
prototype: HTMLMgSkipLinksElement;
|
|
1300
|
+
new (): HTMLMgSkipLinksElement;
|
|
1301
|
+
};
|
|
1284
1302
|
interface HTMLMgTabsElement extends Components.MgTabs, HTMLStencilElement {
|
|
1285
1303
|
}
|
|
1286
1304
|
var HTMLMgTabsElement: {
|
|
@@ -1326,6 +1344,7 @@ declare global {
|
|
|
1326
1344
|
"mg-pagination": HTMLMgPaginationElement;
|
|
1327
1345
|
"mg-panel": HTMLMgPanelElement;
|
|
1328
1346
|
"mg-popover": HTMLMgPopoverElement;
|
|
1347
|
+
"mg-skip-links": HTMLMgSkipLinksElement;
|
|
1329
1348
|
"mg-tabs": HTMLMgTabsElement;
|
|
1330
1349
|
"mg-tag": HTMLMgTagElement;
|
|
1331
1350
|
"mg-tooltip": HTMLMgTooltipElement;
|
|
@@ -2381,6 +2400,12 @@ declare namespace LocalJSX {
|
|
|
2381
2400
|
*/
|
|
2382
2401
|
"placement"?: Placement;
|
|
2383
2402
|
}
|
|
2403
|
+
interface MgSkipLinks {
|
|
2404
|
+
/**
|
|
2405
|
+
* Skip links
|
|
2406
|
+
*/
|
|
2407
|
+
"links"?: SkipLink[];
|
|
2408
|
+
}
|
|
2384
2409
|
interface MgTabs {
|
|
2385
2410
|
/**
|
|
2386
2411
|
* Active tab number default: first is 1
|
|
@@ -2409,13 +2434,17 @@ declare namespace LocalJSX {
|
|
|
2409
2434
|
}
|
|
2410
2435
|
interface MgTag {
|
|
2411
2436
|
/**
|
|
2412
|
-
* Define if
|
|
2437
|
+
* Define if tag is using outline style
|
|
2413
2438
|
*/
|
|
2414
2439
|
"outline"?: boolean;
|
|
2415
2440
|
/**
|
|
2416
|
-
* Define
|
|
2441
|
+
* Define if tag is using soft style
|
|
2417
2442
|
*/
|
|
2418
|
-
"
|
|
2443
|
+
"soft"?: boolean;
|
|
2444
|
+
/**
|
|
2445
|
+
* Define tag variant
|
|
2446
|
+
*/
|
|
2447
|
+
"variant"?: TagVariantType;
|
|
2419
2448
|
}
|
|
2420
2449
|
interface MgTooltip {
|
|
2421
2450
|
/**
|
|
@@ -2466,6 +2495,7 @@ declare namespace LocalJSX {
|
|
|
2466
2495
|
"mg-pagination": MgPagination;
|
|
2467
2496
|
"mg-panel": MgPanel;
|
|
2468
2497
|
"mg-popover": MgPopover;
|
|
2498
|
+
"mg-skip-links": MgSkipLinks;
|
|
2469
2499
|
"mg-tabs": MgTabs;
|
|
2470
2500
|
"mg-tag": MgTag;
|
|
2471
2501
|
"mg-tooltip": MgTooltip;
|
|
@@ -2501,6 +2531,7 @@ declare module "@stencil/core" {
|
|
|
2501
2531
|
"mg-pagination": LocalJSX.MgPagination & JSXBase.HTMLAttributes<HTMLMgPaginationElement>;
|
|
2502
2532
|
"mg-panel": LocalJSX.MgPanel & JSXBase.HTMLAttributes<HTMLMgPanelElement>;
|
|
2503
2533
|
"mg-popover": LocalJSX.MgPopover & JSXBase.HTMLAttributes<HTMLMgPopoverElement>;
|
|
2534
|
+
"mg-skip-links": LocalJSX.MgSkipLinks & JSXBase.HTMLAttributes<HTMLMgSkipLinksElement>;
|
|
2504
2535
|
"mg-tabs": LocalJSX.MgTabs & JSXBase.HTMLAttributes<HTMLMgTabsElement>;
|
|
2505
2536
|
"mg-tag": LocalJSX.MgTag & JSXBase.HTMLAttributes<HTMLMgTagElement>;
|
|
2506
2537
|
"mg-tooltip": LocalJSX.MgTooltip & JSXBase.HTMLAttributes<HTMLMgTooltipElement>;
|
|
@@ -41,6 +41,9 @@ declare const messages: {
|
|
|
41
41
|
panel: {
|
|
42
42
|
editLabel: string;
|
|
43
43
|
};
|
|
44
|
+
skipLinks: {
|
|
45
|
+
navLabel: string;
|
|
46
|
+
};
|
|
44
47
|
general: {
|
|
45
48
|
confirm: string;
|
|
46
49
|
cancel: string;
|
|
@@ -97,6 +100,9 @@ declare const messages: {
|
|
|
97
100
|
panel: {
|
|
98
101
|
editLabel: string;
|
|
99
102
|
};
|
|
103
|
+
skipLinks: {
|
|
104
|
+
navLabel: string;
|
|
105
|
+
};
|
|
100
106
|
general: {
|
|
101
107
|
confirm: string;
|
|
102
108
|
cancel: string;
|
|
@@ -223,6 +223,7 @@ export declare const setMode: (handler: ResolutionHandler) => void;
|
|
|
223
223
|
/**
|
|
224
224
|
* `getMode()` is used for libraries which provide multiple "modes" for styles.
|
|
225
225
|
* @param ref a reference to the node to get styles for
|
|
226
|
+
* @returns the current mode or undefined, if not found
|
|
226
227
|
*/
|
|
227
228
|
export declare function getMode<T = string | undefined>(ref: any): T;
|
|
228
229
|
export declare function setPlatformHelpers(helpers: {
|
|
@@ -237,6 +238,7 @@ export declare function setPlatformHelpers(helpers: {
|
|
|
237
238
|
* if the path needs to be customized.
|
|
238
239
|
* @param path the path to use in calculating the asset path. this value will be
|
|
239
240
|
* used in conjunction with the base asset path
|
|
241
|
+
* @returns the base path
|
|
240
242
|
*/
|
|
241
243
|
export declare function getAssetPath(path: string): string;
|
|
242
244
|
/**
|
|
@@ -252,11 +254,13 @@ export declare function getAssetPath(path: string): string;
|
|
|
252
254
|
* bundling, and where your assets can be loaded from. Additionally custom bundling
|
|
253
255
|
* will have to ensure the static assets are copied to its build directory.
|
|
254
256
|
* @param path the asset path to set
|
|
257
|
+
* @returns the set path
|
|
255
258
|
*/
|
|
256
259
|
export declare function setAssetPath(path: string): string;
|
|
257
260
|
/**
|
|
258
261
|
* Retrieve a Stencil element for a given reference
|
|
259
262
|
* @param ref the ref to get the Stencil element for
|
|
263
|
+
* @returns a reference to the element
|
|
260
264
|
*/
|
|
261
265
|
export declare function getElement(ref: any): HTMLStencilElement;
|
|
262
266
|
/**
|
|
@@ -269,6 +273,7 @@ export declare function getElement(ref: any): HTMLStencilElement;
|
|
|
269
273
|
export declare function forceUpdate(ref: any): void;
|
|
270
274
|
/**
|
|
271
275
|
* getRenderingRef
|
|
276
|
+
* @returns the rendering ref
|
|
272
277
|
*/
|
|
273
278
|
export declare function getRenderingRef(): any;
|
|
274
279
|
export interface HTMLStencilElement extends HTMLElement {
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Clone Deep function
|
|
3
|
+
*
|
|
4
|
+
* @param {unknown} obj object to clone
|
|
5
|
+
* @returns {unknown} cloned json
|
|
6
|
+
*/
|
|
7
|
+
export declare const cloneDeep: (obj: unknown) => unknown;
|
|
8
|
+
/**
|
|
9
|
+
* Utility function that mocks the `MutationObserver` API. Recommended to execute inside `beforeEach`.
|
|
10
|
+
*
|
|
11
|
+
* @param mutationObserverMock - Parameter that is sent to the `Object.defineProperty`
|
|
12
|
+
* overwrite method. `jest.fn()` mock functions can be passed here if the goal is to not only
|
|
13
|
+
* mock the resize observer, but its methods.
|
|
14
|
+
* You can manually fire an intersection entry:
|
|
15
|
+
* @param {Function} mutationObserverMock.disconnect disconnect function
|
|
16
|
+
* @param {Function} mutationObserverMock.observe observe fnuction
|
|
17
|
+
* @param {Function} mutationObserverMock.takeRecords takeRecords fnuction
|
|
18
|
+
* @returns {MutationObserver} Mocked MutationObserver
|
|
19
|
+
* @example
|
|
20
|
+
* ```
|
|
21
|
+
* let fireMo;
|
|
22
|
+
* setupMutationObserverMock({
|
|
23
|
+
* observe: function () {
|
|
24
|
+
* fireMo = this.cb;
|
|
25
|
+
* },
|
|
26
|
+
* });
|
|
27
|
+
* ...
|
|
28
|
+
* fireMo([{ type: 'childList', addedNodes: [AMockElemenet, AnotherMockElemenet], target: yourMockElemenet }]);;
|
|
29
|
+
* ```
|
|
30
|
+
*/
|
|
31
|
+
export declare const setupMutationObserverMock: ({ disconnect, observe, takeRecords }: {
|
|
32
|
+
disconnect: any;
|
|
33
|
+
observe: any;
|
|
34
|
+
takeRecords: any;
|
|
35
|
+
}) => {
|
|
36
|
+
new (fn: any): {
|
|
37
|
+
disconnect: () => void;
|
|
38
|
+
observe: (target: Node, options?: MutationObserverInit) => void;
|
|
39
|
+
takeRecords: () => MutationRecord[];
|
|
40
|
+
cb: () => unknown;
|
|
41
|
+
};
|
|
42
|
+
};
|
package/package.json
CHANGED
|
@@ -1,7 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mgdis/mg-components",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.5.0",
|
|
4
4
|
"description": "MG Components",
|
|
5
|
+
"packageManager": "pnpm@7.17.1",
|
|
6
|
+
"engineStrict": true,
|
|
7
|
+
"engines": {
|
|
8
|
+
"pnpm": ">=7"
|
|
9
|
+
},
|
|
5
10
|
"main": "dist/index.cjs.js",
|
|
6
11
|
"module": "dist/index.js",
|
|
7
12
|
"es2015": "dist/esm/index.mjs",
|
|
@@ -18,45 +23,27 @@
|
|
|
18
23
|
"Simon Duhem <duhem-s@mgdis.fr>",
|
|
19
24
|
"Nicolas Jouanno <jouanno-n@mgdis.fr>"
|
|
20
25
|
],
|
|
21
|
-
"scripts": {
|
|
22
|
-
"build": "stencil build --docs",
|
|
23
|
-
"start": "stencil build --dev --watch --serve",
|
|
24
|
-
"lint": "run-s lint:es lint:prettier",
|
|
25
|
-
"lint:fix": "run-s lint:es:fix lint:prettier:fix",
|
|
26
|
-
"lint:es": "eslint src/**/*.{ts,tsx,js}",
|
|
27
|
-
"lint:es:fix": "eslint src/**/*.{ts,tsx} --fix",
|
|
28
|
-
"lint:prettier": "prettier --check **/*.{ts,tsx,scss,html,mdx,json}",
|
|
29
|
-
"lint:prettier:fix": "prettier --write **/*.{ts,tsx,scss,html,mdx,json}",
|
|
30
|
-
"test": "TZ=UTC stencil test --spec --e2e",
|
|
31
|
-
"test:unit": "TZ=UTC stencil test --spec",
|
|
32
|
-
"test:e2e": "stencil test --e2e",
|
|
33
|
-
"test.watch": "stencil test --spec --e2e --watchAll",
|
|
34
|
-
"generate": "stencil generate",
|
|
35
|
-
"storybook": "start-storybook -p 6006",
|
|
36
|
-
"storybook:build": "build-storybook",
|
|
37
|
-
"prepare": "husky install"
|
|
38
|
-
},
|
|
39
26
|
"jest-junit": {
|
|
40
27
|
"outputDirectory": "coverage",
|
|
41
28
|
"outputName": "junit.xml"
|
|
42
29
|
},
|
|
43
30
|
"dependencies": {
|
|
44
31
|
"@popperjs/core": "^2.11.2",
|
|
45
|
-
"@stencil/core": "^2.
|
|
32
|
+
"@stencil/core": "^2.20.0",
|
|
46
33
|
"normalize.css": "^8.0.1"
|
|
47
34
|
},
|
|
48
35
|
"devDependencies": {
|
|
49
|
-
"@babel/core": "^7.
|
|
36
|
+
"@babel/core": "^7.20.5",
|
|
50
37
|
"@babel/plugin-transform-react-jsx": "^7.14.9",
|
|
51
38
|
"@pxtrn/storybook-addon-docs-stencil": "^6.4.1",
|
|
52
39
|
"@stencil/eslint-plugin": "^0.4.0",
|
|
53
40
|
"@stencil/sass": "^1.5.2",
|
|
54
|
-
"@storybook/addon-a11y": "^6.5.
|
|
55
|
-
"@storybook/addon-actions": "^6.5.
|
|
56
|
-
"@storybook/addon-docs": "^6.5.
|
|
57
|
-
"@storybook/addon-essentials": "^6.5.
|
|
58
|
-
"@storybook/addon-links": "^6.5.
|
|
59
|
-
"@storybook/html": "^6.5.
|
|
41
|
+
"@storybook/addon-a11y": "^6.5.14",
|
|
42
|
+
"@storybook/addon-actions": "^6.5.14",
|
|
43
|
+
"@storybook/addon-docs": "^6.5.14",
|
|
44
|
+
"@storybook/addon-essentials": "^6.5.14",
|
|
45
|
+
"@storybook/addon-links": "^6.5.14",
|
|
46
|
+
"@storybook/html": "^6.5.14",
|
|
60
47
|
"@storybook/preset-scss": "^1.0.3",
|
|
61
48
|
"@types/jest": "^26.0.24",
|
|
62
49
|
"@types/jest-image-snapshot": "^4.3.1",
|
|
@@ -70,7 +57,7 @@
|
|
|
70
57
|
"eslint-plugin-jsdoc": "^38.0.6",
|
|
71
58
|
"eslint-plugin-jsx-a11y": "^6.6.1",
|
|
72
59
|
"eslint-plugin-react": "^7.26.1",
|
|
73
|
-
"eslint-plugin-storybook": "^0.6.
|
|
60
|
+
"eslint-plugin-storybook": "^0.6.8",
|
|
74
61
|
"husky": "^7.0.4",
|
|
75
62
|
"jest": "^26.6.3",
|
|
76
63
|
"jest-cli": "^26.6.3",
|
|
@@ -84,7 +71,25 @@
|
|
|
84
71
|
"sass-loader": "^10.2.0",
|
|
85
72
|
"style-loader": "^2.0.0",
|
|
86
73
|
"ts-node": "^10.7.0",
|
|
87
|
-
"
|
|
74
|
+
"turbo": "^1.6.3",
|
|
75
|
+
"typescript": "~4.4.4"
|
|
88
76
|
},
|
|
89
|
-
"license": "BSD-3-Clause"
|
|
90
|
-
|
|
77
|
+
"license": "BSD-3-Clause",
|
|
78
|
+
"scripts": {
|
|
79
|
+
"build": "stencil build --docs",
|
|
80
|
+
"start": "stencil build --dev --watch --serve",
|
|
81
|
+
"lint": "run-s lint:es lint:prettier",
|
|
82
|
+
"lint:fix": "run-s lint:es:fix lint:prettier:fix",
|
|
83
|
+
"lint:es": "eslint src/**/*.{ts,tsx}",
|
|
84
|
+
"lint:es:fix": "eslint src/**/*.{ts,tsx} --fix",
|
|
85
|
+
"lint:prettier": "prettier --check **/*.{ts,tsx,scss,html,mdx,json}",
|
|
86
|
+
"lint:prettier:fix": "prettier --write **/*.{ts,tsx,scss,html,mdx,json}",
|
|
87
|
+
"test": "TZ=UTC stencil test --spec --e2e",
|
|
88
|
+
"test:unit": "TZ=UTC stencil test --spec",
|
|
89
|
+
"test:e2e": "stencil test --e2e",
|
|
90
|
+
"test.watch": "stencil test --spec --e2e --watchAll",
|
|
91
|
+
"generate": "stencil generate",
|
|
92
|
+
"storybook": "NODE_OPTIONS=--openssl-legacy-provider start-storybook -p 6006",
|
|
93
|
+
"storybook:build": "NODE_OPTIONS=--openssl-legacy-provider build-storybook"
|
|
94
|
+
}
|
|
95
|
+
}
|