@mgdis/mg-components 5.5.0 → 5.7.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-5e7ede97.js} +120 -4
- package/dist/cjs/loader.cjs.js +4 -3
- package/dist/cjs/{mg-badge_30.cjs.entry.js → mg-action-more_31.cjs.entry.js} +1223 -547
- package/dist/cjs/mg-components.cjs.js +7 -3
- package/dist/collection/collection-manifest.json +6 -5
- 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 +4 -4
- package/dist/collection/components/atoms/mg-button/mg-button.css +9 -22
- package/dist/collection/components/atoms/mg-button/mg-button.js +1 -1
- package/dist/collection/components/atoms/mg-card/mg-card.css +13 -6
- package/dist/collection/components/atoms/mg-icon/mg-icon.conf.js +38 -28
- package/dist/collection/components/atoms/mg-icon/mg-icon.js +3 -3
- package/dist/collection/components/atoms/mg-tag/mg-tag.css +6 -6
- package/dist/collection/components/atoms/mg-tag/mg-tag.js +4 -4
- package/dist/collection/components/atoms/mg-tooltip/mg-tooltip.css +2 -0
- package/dist/collection/components/atoms/mg-tooltip/mg-tooltip.js +14 -17
- package/dist/collection/components/molecules/inputs/MgInput.js +6 -1
- package/dist/collection/components/molecules/inputs/mg-input-checkbox/mg-input-checkbox.css +4 -3
- package/dist/collection/components/molecules/inputs/mg-input-checkbox/mg-input-checkbox.js +3 -2
- package/dist/collection/components/molecules/inputs/mg-input-date/mg-input-date.css +7 -3
- package/dist/collection/components/molecules/inputs/mg-input-date/mg-input-date.js +5 -2
- package/dist/collection/components/molecules/inputs/mg-input-numeric/mg-input-numeric.css +7 -3
- package/dist/collection/components/molecules/inputs/mg-input-numeric/mg-input-numeric.js +1 -1
- package/dist/collection/components/molecules/inputs/mg-input-password/mg-input-password.css +7 -3
- package/dist/collection/components/molecules/inputs/mg-input-radio/mg-input-radio.css +4 -3
- package/dist/collection/components/molecules/inputs/mg-input-radio/mg-input-radio.js +2 -1
- package/dist/collection/components/molecules/inputs/mg-input-select/mg-input-select.css +7 -3
- package/dist/collection/components/molecules/inputs/mg-input-select/mg-input-select.js +8 -4
- package/dist/collection/components/molecules/inputs/mg-input-text/mg-input-text.css +7 -3
- package/dist/collection/components/molecules/inputs/mg-input-textarea/mg-input-textarea.css +7 -3
- package/dist/collection/components/molecules/inputs/mg-input-textarea/mg-input-textarea.js +1 -1
- package/dist/collection/components/molecules/inputs/mg-input-toggle/mg-input-toggle.css +4 -4
- 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 -19
- 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 +48 -21
- package/dist/collection/components/molecules/menu/mg-menu-item/mg-menu-item.js +139 -71
- package/dist/collection/components/molecules/mg-action-more/mg-action-more.conf.js +1 -0
- package/dist/collection/components/molecules/mg-action-more/mg-action-more.css +38 -0
- package/dist/collection/components/molecules/mg-action-more/mg-action-more.js +252 -0
- package/dist/collection/components/molecules/mg-form/mg-form.js +2 -2
- 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 +54 -13
- package/dist/collection/components/molecules/mg-modal/mg-modal.css +8 -1
- package/dist/collection/components/molecules/mg-pagination/mg-pagination.js +19 -1
- package/dist/collection/components/molecules/mg-panel/mg-panel.css +7 -0
- package/dist/collection/components/molecules/mg-panel/mg-panel.js +2 -2
- package/dist/collection/components/molecules/mg-popover/mg-popover.css +72 -15
- package/dist/collection/components/molecules/mg-popover/mg-popover.js +64 -7
- package/dist/collection/components/molecules/mg-skip-links/mg-skip-links.js +33 -1
- package/dist/collection/components/molecules/mg-tabs/mg-tabs.css +12 -7
- package/dist/collection/components/molecules/mg-tabs/mg-tabs.js +105 -57
- package/dist/collection/locales/en/messages.json +10 -1
- package/dist/collection/locales/fr/messages.json +10 -1
- package/dist/collection/locales/index.js +3 -26
- 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/mg-icon-animation.scss +6 -0
- package/dist/collection/styles/navigation-button.scss +77 -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 +151 -0
- package/dist/collection/utils/components.utils.js +52 -0
- package/dist/collection/utils/locale.utils.js +28 -6
- package/dist/collection/utils/unit.test.utils.js +65 -32
- package/dist/collection/variables.css +11 -10
- package/dist/components/MgInput.js +6 -1
- package/dist/components/components.utils.js +53 -1
- package/dist/components/index.d.ts +10 -0
- package/dist/components/index.js +2 -1
- package/dist/components/index2.js +79 -20
- package/dist/components/mg-action-more.d.ts +11 -0
- package/dist/components/mg-action-more.js +215 -0
- package/dist/components/mg-badge2.js +5 -5
- package/dist/components/mg-button2.js +2 -2
- package/dist/components/mg-card2.js +1 -1
- package/dist/components/mg-form.js +2 -2
- package/dist/components/mg-icon2.js +41 -31
- package/dist/components/mg-illustrated-message.js +4 -3
- package/dist/components/mg-input-checkbox.js +3 -3
- package/dist/components/mg-input-date.js +7 -5
- package/dist/components/mg-input-numeric.js +3 -4
- package/dist/components/mg-input-password.js +1 -1
- package/dist/components/mg-input-radio.js +2 -2
- package/dist/components/mg-input-select2.js +9 -5
- package/dist/components/mg-input-text2.js +1 -1
- package/dist/components/mg-input-textarea.js +2 -2
- package/dist/components/mg-input-toggle.js +1 -1
- package/dist/components/mg-menu-item.js +1 -253
- package/dist/components/mg-menu-item2.js +520 -0
- package/dist/components/mg-menu.js +1 -129
- package/dist/components/mg-menu2.js +247 -0
- package/dist/components/mg-message.js +55 -14
- package/dist/components/mg-modal.js +1 -1
- package/dist/components/mg-pagination.js +3 -1
- package/dist/components/mg-panel.js +3 -3
- package/dist/components/mg-popover.js +1 -190
- package/dist/components/mg-popover2.js +226 -0
- package/dist/components/mg-skip-links.js +16 -2
- package/dist/components/mg-tabs.js +104 -55
- package/dist/components/mg-tag.js +5 -5
- package/dist/components/mg-tooltip2.js +15 -18
- package/dist/esm/{index-78edde1d.js → index-03cceb11.js} +120 -5
- package/dist/esm/loader.js +4 -3
- package/dist/esm/{mg-badge_30.entry.js → mg-action-more_31.entry.js} +1223 -548
- package/dist/esm/mg-components.js +4 -3
- package/dist/esm/polyfills/css-shim.js +1 -1
- package/dist/mg-components/locales/en/messages.json +10 -1
- package/dist/mg-components/locales/fr/messages.json +10 -1
- package/dist/mg-components/mg-components.css +1 -1
- package/dist/mg-components/mg-components.esm.js +1 -1
- package/dist/mg-components/p-4cfd5423.entry.js +1 -0
- package/dist/mg-components/p-e126dd84.js +2 -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/mg-icon-animation.scss +6 -0
- package/dist/mg-components/styles/navigation-button.scss +77 -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 +11 -10
- 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-textarea/mg-input-textarea.d.ts +1 -1
- 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/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 +61 -15
- package/dist/types/components/molecules/mg-action-more/mg-action-more.conf.d.ts +42 -0
- package/dist/types/components/molecules/mg-action-more/mg-action-more.d.ts +81 -0
- package/dist/types/components/molecules/mg-message/mg-message.d.ts +21 -4
- package/dist/types/components/molecules/mg-pagination/mg-pagination.d.ts +4 -0
- package/dist/types/components/molecules/mg-popover/mg-popover.d.ts +13 -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 +98 -12
- package/dist/types/locales/index.d.ts +21 -10
- package/dist/types/stencil-public-runtime.d.ts +48 -3
- package/dist/types/utils/behaviors.utils.d.ts +77 -0
- package/dist/types/utils/components.utils.d.ts +14 -0
- package/dist/types/utils/locale.utils.d.ts +16 -3
- package/dist/types/utils/unit.test.utils.d.ts +68 -14
- package/loader/index.d.ts +9 -0
- package/package.json +28 -27
- package/readme.md +22 -31
- package/dist/.storybook/utils.js +0 -24
- package/dist/collection/components/atoms/mg-badge/doc/mg-badge.stories.js +0 -27
- package/dist/collection/components/atoms/mg-button/doc/mg-button.stories.js +0 -38
- package/dist/collection/components/atoms/mg-card/doc/mg-card.stories.js +0 -18
- package/dist/collection/components/atoms/mg-character-left/doc/mg-character-left.stories.js +0 -20
- package/dist/collection/components/atoms/mg-divider/doc/mg-divider.stories.js +0 -18
- package/dist/collection/components/atoms/mg-icon/doc/mg-icon.stories.js +0 -41
- package/dist/collection/components/atoms/mg-input-title/doc/mg-input-title.stories.js +0 -21
- package/dist/collection/components/atoms/mg-tag/doc/mg-tag.stories.js +0 -22
- package/dist/collection/components/atoms/mg-tooltip/doc/mg-tooltip.stories.js +0 -50
- package/dist/collection/components/molecules/inputs/mg-input-checkbox/doc/mg-input-checkbox.stories.js +0 -50
- package/dist/collection/components/molecules/inputs/mg-input-date/doc/mg-input-date.stories.js +0 -43
- package/dist/collection/components/molecules/inputs/mg-input-numeric/doc/mg-input-numeric.stories.js +0 -68
- package/dist/collection/components/molecules/inputs/mg-input-password/doc/mg-input-password.stories.js +0 -46
- package/dist/collection/components/molecules/inputs/mg-input-radio/doc/mg-input-radio.stories.js +0 -59
- package/dist/collection/components/molecules/inputs/mg-input-select/doc/mg-input-select.stories.js +0 -77
- package/dist/collection/components/molecules/inputs/mg-input-text/doc/mg-input-text.stories.js +0 -110
- package/dist/collection/components/molecules/inputs/mg-input-textarea/doc/mg-input-textarea.stories.js +0 -54
- package/dist/collection/components/molecules/inputs/mg-input-toggle/doc/mg-input-toggle.stories.js +0 -51
- package/dist/collection/components/molecules/menu/mg-menu/doc/mg-menu.stories.js +0 -87
- package/dist/collection/components/molecules/menu/mg-menu-item/doc/mg-menu-item.stories.js +0 -39
- package/dist/collection/components/molecules/mg-details/doc/mg-details.stories.js +0 -24
- package/dist/collection/components/molecules/mg-form/doc/mg-form.stories.js +0 -47
- package/dist/collection/components/molecules/mg-illustrated-message/doc/mg-illustrated-message.stories.js +0 -19
- package/dist/collection/components/molecules/mg-message/doc/mg-message.stories.js +0 -39
- package/dist/collection/components/molecules/mg-modal/doc/mg-modal.stories.js +0 -39
- package/dist/collection/components/molecules/mg-pagination/doc/mg-pagination.stories.js +0 -20
- package/dist/collection/components/molecules/mg-panel/doc/mg-panel.stories.js +0 -22
- package/dist/collection/components/molecules/mg-popover/doc/mg-popover.stories.js +0 -34
- package/dist/collection/components/molecules/mg-skip-links/doc/mg-skip-links.stories.js +0 -24
- package/dist/collection/components/molecules/mg-tabs/doc/mg-tabs.stories.js +0 -51
- package/dist/collection/stories/grids.stories.js +0 -7
- package/dist/collection/stories/helpers.stories.js +0 -23
- package/dist/collection/stories/icons.stories.js +0 -25
- package/dist/collection/stories/typography.stories.js +0 -24
- package/dist/components/locale.utils.js +0 -40
- package/dist/components/mg-menu.conf.js +0 -10
- package/dist/mg-components/p-125c54ca.js +0 -2
- package/dist/mg-components/p-4961c96c.entry.js +0 -1
- package/dist/types/components/atoms/mg-badge/doc/mg-badge.stories.d.ts +0 -13
- package/dist/types/components/atoms/mg-button/doc/mg-button.stories.d.ts +0 -16
- package/dist/types/components/atoms/mg-card/doc/mg-card.stories.d.ts +0 -6
- package/dist/types/components/atoms/mg-character-left/doc/mg-character-left.stories.d.ts +0 -6
- package/dist/types/components/atoms/mg-divider/doc/mg-divider.stories.d.ts +0 -6
- package/dist/types/components/atoms/mg-icon/doc/mg-icon.stories.d.ts +0 -26
- package/dist/types/components/atoms/mg-input-title/doc/mg-input-title.stories.d.ts +0 -6
- package/dist/types/components/atoms/mg-tag/doc/mg-tag.stories.d.ts +0 -6
- package/dist/types/components/atoms/mg-tooltip/doc/mg-tooltip.stories.d.ts +0 -18
- package/dist/types/components/molecules/inputs/mg-input-checkbox/doc/mg-input-checkbox.stories.d.ts +0 -11
- package/dist/types/components/molecules/inputs/mg-input-date/doc/mg-input-date.stories.d.ts +0 -12
- package/dist/types/components/molecules/inputs/mg-input-numeric/doc/mg-input-numeric.stories.d.ts +0 -32
- package/dist/types/components/molecules/inputs/mg-input-password/doc/mg-input-password.stories.d.ts +0 -22
- package/dist/types/components/molecules/inputs/mg-input-radio/doc/mg-input-radio.stories.d.ts +0 -20
- package/dist/types/components/molecules/inputs/mg-input-select/doc/mg-input-select.stories.d.ts +0 -34
- package/dist/types/components/molecules/inputs/mg-input-text/doc/mg-input-text.stories.d.ts +0 -39
- package/dist/types/components/molecules/inputs/mg-input-textarea/doc/mg-input-textarea.stories.d.ts +0 -19
- package/dist/types/components/molecules/inputs/mg-input-toggle/doc/mg-input-toggle.stories.d.ts +0 -12
- package/dist/types/components/molecules/menu/mg-menu/doc/mg-menu.stories.d.ts +0 -17
- package/dist/types/components/molecules/menu/mg-menu-item/doc/mg-menu-item.stories.d.ts +0 -12
- package/dist/types/components/molecules/mg-details/doc/mg-details.stories.d.ts +0 -11
- package/dist/types/components/molecules/mg-form/doc/mg-form.stories.d.ts +0 -11
- package/dist/types/components/molecules/mg-illustrated-message/doc/mg-illustrated-message.stories.d.ts +0 -6
- package/dist/types/components/molecules/mg-message/doc/mg-message.stories.d.ts +0 -26
- package/dist/types/components/molecules/mg-modal/doc/mg-modal.stories.d.ts +0 -13
- package/dist/types/components/molecules/mg-pagination/doc/mg-pagination.stories.d.ts +0 -11
- package/dist/types/components/molecules/mg-panel/doc/mg-panel.stories.d.ts +0 -11
- package/dist/types/components/molecules/mg-popover/doc/mg-popover.stories.d.ts +0 -22
- package/dist/types/components/molecules/mg-skip-links/doc/mg-skip-links.stories.d.ts +0 -11
- package/dist/types/components/molecules/mg-tabs/doc/mg-tabs.stories.d.ts +0 -20
- package/dist/types/home/runner/work/mg-components/mg-components/.stencil/.storybook/utils.d.ts +0 -1
- package/dist/types/stories/grids.stories.d.ts +0 -5
- package/dist/types/stories/helpers.stories.d.ts +0 -13
- package/dist/types/stories/icons.stories.d.ts +0 -13
- package/dist/types/stories/typography.stories.d.ts +0 -5
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
* It contains typing information for all components that exist in this project.
|
|
6
6
|
*/
|
|
7
7
|
import { HTMLStencilElement, JSXBase } from "./stencil-public-runtime";
|
|
8
|
+
import { MgActionMoreButtonType, MgActionMoreIconType, MgActionMoreItemType } from "./components/molecules/mg-action-more/mg-action-more.conf";
|
|
8
9
|
import { BadgeVariantType } from "./components/atoms/mg-badge/mg-badge.conf";
|
|
9
10
|
import { ButtonType, VariantType } from "./components/atoms/mg-button/mg-button.conf";
|
|
10
11
|
import { IconSizeType, IconVariantType } from "./components/atoms/mg-icon/mg-icon.conf";
|
|
@@ -13,13 +14,31 @@ import { Width } from "./components/molecules/inputs/MgInput.conf";
|
|
|
13
14
|
import { RadioOption } from "./components/molecules/inputs/mg-input-radio/mg-input-radio.conf";
|
|
14
15
|
import { SelectOption } from "./components/molecules/inputs/mg-input-select/mg-input-select.conf";
|
|
15
16
|
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 {
|
|
17
|
+
import { Direction, MenuSizeType, MoreItemType } from "./components/molecules/menu/mg-menu/mg-menu.conf";
|
|
18
|
+
import { Status } from "./components/molecules/menu/mg-menu-item/mg-menu-item.conf";
|
|
18
19
|
import { Placement } from "@popperjs/core";
|
|
19
20
|
import { SkipLink } from "./components/molecules/mg-skip-links/mg-skip-links.conf";
|
|
20
21
|
import { SizeType, TabItem } from "./components/molecules/mg-tabs/mg-tabs.conf";
|
|
21
22
|
import { TagVariantType } from "./components/atoms/mg-tag/mg-tag.conf";
|
|
22
23
|
export namespace Components {
|
|
24
|
+
interface MgActionMore {
|
|
25
|
+
/**
|
|
26
|
+
* Define button properties Default: {variant: 'flat', isIcon: true}.
|
|
27
|
+
*/
|
|
28
|
+
"button": MgActionMoreButtonType;
|
|
29
|
+
/**
|
|
30
|
+
* Define if chevron is display
|
|
31
|
+
*/
|
|
32
|
+
"displayChevron": boolean;
|
|
33
|
+
/**
|
|
34
|
+
* Define displaied icon Default: {icon: 'ellipsis'}
|
|
35
|
+
*/
|
|
36
|
+
"icon": MgActionMoreIconType;
|
|
37
|
+
/**
|
|
38
|
+
* Define the menu-items elements
|
|
39
|
+
*/
|
|
40
|
+
"items": MgActionMoreItemType[];
|
|
41
|
+
}
|
|
23
42
|
interface MgBadge {
|
|
24
43
|
/**
|
|
25
44
|
* Badge label. Include short description. Required for accessibility
|
|
@@ -874,6 +893,14 @@ export namespace Components {
|
|
|
874
893
|
* Menu label. Include short menu description. Required for accessibility
|
|
875
894
|
*/
|
|
876
895
|
"label": string;
|
|
896
|
+
/**
|
|
897
|
+
* Customize mg-menu "more element" Used with direction: 'vertical' to manage overflow
|
|
898
|
+
*/
|
|
899
|
+
"moreitem": MoreItemType;
|
|
900
|
+
/**
|
|
901
|
+
* Define mg-menu size Default: 'regular'
|
|
902
|
+
*/
|
|
903
|
+
"size": MenuSizeType;
|
|
877
904
|
}
|
|
878
905
|
interface MgMenuItem {
|
|
879
906
|
/**
|
|
@@ -881,13 +908,9 @@ export namespace Components {
|
|
|
881
908
|
*/
|
|
882
909
|
"expanded": boolean;
|
|
883
910
|
/**
|
|
884
|
-
* Define menu-item
|
|
911
|
+
* Define menu-item href when defined menu-item contain an anchor instead of button
|
|
885
912
|
*/
|
|
886
913
|
"href": string;
|
|
887
|
-
/**
|
|
888
|
-
* Define menu-item size. Default: "large".
|
|
889
|
-
*/
|
|
890
|
-
"size": MenuItemSizeType;
|
|
891
914
|
/**
|
|
892
915
|
* Define menu-item status. Default: "visible"
|
|
893
916
|
*/
|
|
@@ -938,6 +961,10 @@ export namespace Components {
|
|
|
938
961
|
* Component current page
|
|
939
962
|
*/
|
|
940
963
|
"currentPage": number;
|
|
964
|
+
/**
|
|
965
|
+
* Hide navigation label
|
|
966
|
+
*/
|
|
967
|
+
"hideNavigationLabels": boolean;
|
|
941
968
|
/**
|
|
942
969
|
* Identifier is used for the element ID (id is a reserved prop in Stencil.js) If not set, it will be created.
|
|
943
970
|
*/
|
|
@@ -982,6 +1009,10 @@ export namespace Components {
|
|
|
982
1009
|
"titlePatternErrorMessage": string;
|
|
983
1010
|
}
|
|
984
1011
|
interface MgPopover {
|
|
1012
|
+
/**
|
|
1013
|
+
* Hide popover arrow
|
|
1014
|
+
*/
|
|
1015
|
+
"arrowHide": boolean;
|
|
985
1016
|
/**
|
|
986
1017
|
* Define if popover has a cross button
|
|
987
1018
|
*/
|
|
@@ -1011,7 +1042,7 @@ export namespace Components {
|
|
|
1011
1042
|
}
|
|
1012
1043
|
interface MgTabs {
|
|
1013
1044
|
/**
|
|
1014
|
-
* Active tab number
|
|
1045
|
+
* Active tab number
|
|
1015
1046
|
*/
|
|
1016
1047
|
"activeTab": number;
|
|
1017
1048
|
/**
|
|
@@ -1112,6 +1143,10 @@ export interface MgInputToggleCustomEvent<T> extends CustomEvent<T> {
|
|
|
1112
1143
|
detail: T;
|
|
1113
1144
|
target: HTMLMgInputToggleElement;
|
|
1114
1145
|
}
|
|
1146
|
+
export interface MgMenuItemCustomEvent<T> extends CustomEvent<T> {
|
|
1147
|
+
detail: T;
|
|
1148
|
+
target: HTMLMgMenuItemElement;
|
|
1149
|
+
}
|
|
1115
1150
|
export interface MgMessageCustomEvent<T> extends CustomEvent<T> {
|
|
1116
1151
|
detail: T;
|
|
1117
1152
|
target: HTMLMgMessageElement;
|
|
@@ -1132,11 +1167,21 @@ export interface MgPopoverCustomEvent<T> extends CustomEvent<T> {
|
|
|
1132
1167
|
detail: T;
|
|
1133
1168
|
target: HTMLMgPopoverElement;
|
|
1134
1169
|
}
|
|
1170
|
+
export interface MgSkipLinksCustomEvent<T> extends CustomEvent<T> {
|
|
1171
|
+
detail: T;
|
|
1172
|
+
target: HTMLMgSkipLinksElement;
|
|
1173
|
+
}
|
|
1135
1174
|
export interface MgTabsCustomEvent<T> extends CustomEvent<T> {
|
|
1136
1175
|
detail: T;
|
|
1137
1176
|
target: HTMLMgTabsElement;
|
|
1138
1177
|
}
|
|
1139
1178
|
declare global {
|
|
1179
|
+
interface HTMLMgActionMoreElement extends Components.MgActionMore, HTMLStencilElement {
|
|
1180
|
+
}
|
|
1181
|
+
var HTMLMgActionMoreElement: {
|
|
1182
|
+
prototype: HTMLMgActionMoreElement;
|
|
1183
|
+
new (): HTMLMgActionMoreElement;
|
|
1184
|
+
};
|
|
1140
1185
|
interface HTMLMgBadgeElement extends Components.MgBadge, HTMLStencilElement {
|
|
1141
1186
|
}
|
|
1142
1187
|
var HTMLMgBadgeElement: {
|
|
@@ -1318,6 +1363,7 @@ declare global {
|
|
|
1318
1363
|
new (): HTMLMgTooltipElement;
|
|
1319
1364
|
};
|
|
1320
1365
|
interface HTMLElementTagNameMap {
|
|
1366
|
+
"mg-action-more": HTMLMgActionMoreElement;
|
|
1321
1367
|
"mg-badge": HTMLMgBadgeElement;
|
|
1322
1368
|
"mg-button": HTMLMgButtonElement;
|
|
1323
1369
|
"mg-card": HTMLMgCardElement;
|
|
@@ -1351,6 +1397,24 @@ declare global {
|
|
|
1351
1397
|
}
|
|
1352
1398
|
}
|
|
1353
1399
|
declare namespace LocalJSX {
|
|
1400
|
+
interface MgActionMore {
|
|
1401
|
+
/**
|
|
1402
|
+
* Define button properties Default: {variant: 'flat', isIcon: true}.
|
|
1403
|
+
*/
|
|
1404
|
+
"button"?: MgActionMoreButtonType;
|
|
1405
|
+
/**
|
|
1406
|
+
* Define if chevron is display
|
|
1407
|
+
*/
|
|
1408
|
+
"displayChevron"?: boolean;
|
|
1409
|
+
/**
|
|
1410
|
+
* Define displaied icon Default: {icon: 'ellipsis'}
|
|
1411
|
+
*/
|
|
1412
|
+
"icon"?: MgActionMoreIconType;
|
|
1413
|
+
/**
|
|
1414
|
+
* Define the menu-items elements
|
|
1415
|
+
*/
|
|
1416
|
+
"items": MgActionMoreItemType[];
|
|
1417
|
+
}
|
|
1354
1418
|
interface MgBadge {
|
|
1355
1419
|
/**
|
|
1356
1420
|
* Badge label. Include short description. Required for accessibility
|
|
@@ -2239,6 +2303,14 @@ declare namespace LocalJSX {
|
|
|
2239
2303
|
* Menu label. Include short menu description. Required for accessibility
|
|
2240
2304
|
*/
|
|
2241
2305
|
"label": string;
|
|
2306
|
+
/**
|
|
2307
|
+
* Customize mg-menu "more element" Used with direction: 'vertical' to manage overflow
|
|
2308
|
+
*/
|
|
2309
|
+
"moreitem"?: MoreItemType;
|
|
2310
|
+
/**
|
|
2311
|
+
* Define mg-menu size Default: 'regular'
|
|
2312
|
+
*/
|
|
2313
|
+
"size"?: MenuSizeType;
|
|
2242
2314
|
}
|
|
2243
2315
|
interface MgMenuItem {
|
|
2244
2316
|
/**
|
|
@@ -2246,13 +2318,13 @@ declare namespace LocalJSX {
|
|
|
2246
2318
|
*/
|
|
2247
2319
|
"expanded"?: boolean;
|
|
2248
2320
|
/**
|
|
2249
|
-
* Define menu-item
|
|
2321
|
+
* Define menu-item href when defined menu-item contain an anchor instead of button
|
|
2250
2322
|
*/
|
|
2251
2323
|
"href"?: string;
|
|
2252
2324
|
/**
|
|
2253
|
-
*
|
|
2325
|
+
* Emited event when status change
|
|
2254
2326
|
*/
|
|
2255
|
-
"
|
|
2327
|
+
"onStatus-change"?: (event: MgMenuItemCustomEvent<MgMenuItem['status']>) => void;
|
|
2256
2328
|
/**
|
|
2257
2329
|
* Define menu-item status. Default: "visible"
|
|
2258
2330
|
*/
|
|
@@ -2319,6 +2391,10 @@ declare namespace LocalJSX {
|
|
|
2319
2391
|
* Component current page
|
|
2320
2392
|
*/
|
|
2321
2393
|
"currentPage"?: number;
|
|
2394
|
+
/**
|
|
2395
|
+
* Hide navigation label
|
|
2396
|
+
*/
|
|
2397
|
+
"hideNavigationLabels"?: boolean;
|
|
2322
2398
|
/**
|
|
2323
2399
|
* Identifier is used for the element ID (id is a reserved prop in Stencil.js) If not set, it will be created.
|
|
2324
2400
|
*/
|
|
@@ -2375,6 +2451,10 @@ declare namespace LocalJSX {
|
|
|
2375
2451
|
"titlePatternErrorMessage"?: string;
|
|
2376
2452
|
}
|
|
2377
2453
|
interface MgPopover {
|
|
2454
|
+
/**
|
|
2455
|
+
* Hide popover arrow
|
|
2456
|
+
*/
|
|
2457
|
+
"arrowHide"?: boolean;
|
|
2378
2458
|
/**
|
|
2379
2459
|
* Define if popover has a cross button
|
|
2380
2460
|
*/
|
|
@@ -2405,10 +2485,14 @@ declare namespace LocalJSX {
|
|
|
2405
2485
|
* Skip links
|
|
2406
2486
|
*/
|
|
2407
2487
|
"links"?: SkipLink[];
|
|
2488
|
+
/**
|
|
2489
|
+
* Emited event when link is clicked
|
|
2490
|
+
*/
|
|
2491
|
+
"onGo-to-anchor"?: (event: MgSkipLinksCustomEvent<string>) => void;
|
|
2408
2492
|
}
|
|
2409
2493
|
interface MgTabs {
|
|
2410
2494
|
/**
|
|
2411
|
-
* Active tab number
|
|
2495
|
+
* Active tab number
|
|
2412
2496
|
*/
|
|
2413
2497
|
"activeTab"?: number;
|
|
2414
2498
|
/**
|
|
@@ -2469,6 +2553,7 @@ declare namespace LocalJSX {
|
|
|
2469
2553
|
"placement"?: Placement;
|
|
2470
2554
|
}
|
|
2471
2555
|
interface IntrinsicElements {
|
|
2556
|
+
"mg-action-more": MgActionMore;
|
|
2472
2557
|
"mg-badge": MgBadge;
|
|
2473
2558
|
"mg-button": MgButton;
|
|
2474
2559
|
"mg-card": MgCard;
|
|
@@ -2505,6 +2590,7 @@ export { LocalJSX as JSX };
|
|
|
2505
2590
|
declare module "@stencil/core" {
|
|
2506
2591
|
export namespace JSX {
|
|
2507
2592
|
interface IntrinsicElements {
|
|
2593
|
+
"mg-action-more": LocalJSX.MgActionMore & JSXBase.HTMLAttributes<HTMLMgActionMoreElement>;
|
|
2508
2594
|
"mg-badge": LocalJSX.MgBadge & JSXBase.HTMLAttributes<HTMLMgBadgeElement>;
|
|
2509
2595
|
"mg-button": LocalJSX.MgButton & JSXBase.HTMLAttributes<HTMLMgButtonElement>;
|
|
2510
2596
|
"mg-card": LocalJSX.MgCard & JSXBase.HTMLAttributes<HTMLMgCardElement>;
|
|
@@ -22,7 +22,9 @@ declare const messages: {
|
|
|
22
22
|
};
|
|
23
23
|
form: {
|
|
24
24
|
required: string;
|
|
25
|
+
requiredSingle: string;
|
|
25
26
|
allRequired: string;
|
|
27
|
+
allRequiredSingle: string;
|
|
26
28
|
};
|
|
27
29
|
message: {
|
|
28
30
|
closeButton: string;
|
|
@@ -51,6 +53,13 @@ declare const messages: {
|
|
|
51
53
|
next: string;
|
|
52
54
|
previous: string;
|
|
53
55
|
};
|
|
56
|
+
plusMenu: {
|
|
57
|
+
moreLabel: string;
|
|
58
|
+
badgeLabel: string;
|
|
59
|
+
};
|
|
60
|
+
actionMore: {
|
|
61
|
+
label: string;
|
|
62
|
+
};
|
|
54
63
|
};
|
|
55
64
|
fr: {
|
|
56
65
|
errors: {
|
|
@@ -62,13 +71,7 @@ declare const messages: {
|
|
|
62
71
|
minMax: string;
|
|
63
72
|
};
|
|
64
73
|
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
|
-
*/
|
|
74
|
+
min: string;
|
|
72
75
|
max: string;
|
|
73
76
|
minMax: string;
|
|
74
77
|
};
|
|
@@ -81,7 +84,9 @@ declare const messages: {
|
|
|
81
84
|
};
|
|
82
85
|
form: {
|
|
83
86
|
required: string;
|
|
87
|
+
requiredSingle: string;
|
|
84
88
|
allRequired: string;
|
|
89
|
+
allRequiredSingle: string;
|
|
85
90
|
};
|
|
86
91
|
message: {
|
|
87
92
|
closeButton: string;
|
|
@@ -110,17 +115,23 @@ declare const messages: {
|
|
|
110
115
|
next: string;
|
|
111
116
|
previous: string;
|
|
112
117
|
};
|
|
118
|
+
plusMenu: {
|
|
119
|
+
moreLabel: string;
|
|
120
|
+
badgeLabel: string;
|
|
121
|
+
};
|
|
122
|
+
actionMore: {
|
|
123
|
+
label: string;
|
|
124
|
+
};
|
|
113
125
|
};
|
|
114
126
|
};
|
|
115
127
|
/**
|
|
116
128
|
* Get Intl object
|
|
117
|
-
* We load the defined locale but for now we only support the first subtag for messages
|
|
118
129
|
*
|
|
119
130
|
* @param {HTMLElement} element element we need to get the language
|
|
120
|
-
* @returns {{ locale: string; messages: unknown }} messages object
|
|
131
|
+
* @returns {{ locale: string; messages: Record<string, unknown> }} messages object
|
|
121
132
|
*/
|
|
122
133
|
export declare const initLocales: (element: HTMLElement) => {
|
|
123
134
|
locale: string;
|
|
124
|
-
messages:
|
|
135
|
+
messages: Record<string, unknown>;
|
|
125
136
|
};
|
|
126
137
|
export {};
|
|
@@ -133,7 +133,7 @@ export interface ListenOptions {
|
|
|
133
133
|
*/
|
|
134
134
|
passive?: boolean;
|
|
135
135
|
}
|
|
136
|
-
export
|
|
136
|
+
export type ListenTargetOptions = 'body' | 'document' | 'window';
|
|
137
137
|
export interface StateDecorator {
|
|
138
138
|
(): PropertyDecorator;
|
|
139
139
|
}
|
|
@@ -214,8 +214,8 @@ export declare const State: StateDecorator;
|
|
|
214
214
|
* https://stenciljs.com/docs/reactive-data#watch-decorator
|
|
215
215
|
*/
|
|
216
216
|
export declare const Watch: WatchDecorator;
|
|
217
|
-
export
|
|
218
|
-
export
|
|
217
|
+
export type ResolutionHandler = (elm: HTMLElement) => string | undefined | null;
|
|
218
|
+
export type ErrorHandler = (err: any, element?: HTMLElement) => void;
|
|
219
219
|
/**
|
|
220
220
|
* `setMode()` is used for libraries which provide multiple "modes" for styles.
|
|
221
221
|
*/
|
|
@@ -257,6 +257,15 @@ export declare function getAssetPath(path: string): string;
|
|
|
257
257
|
* @returns the set path
|
|
258
258
|
*/
|
|
259
259
|
export declare function setAssetPath(path: string): string;
|
|
260
|
+
/**
|
|
261
|
+
* Used to specify a nonce value that corresponds with an application's
|
|
262
|
+
* [Content Security Policy (CSP)](https://developer.mozilla.org/en-US/docs/Web/HTTP/CSP).
|
|
263
|
+
* When set, the nonce will be added to all dynamically created script and style tags at runtime.
|
|
264
|
+
* Alternatively, the nonce value can be set on a `meta` tag in the DOM head
|
|
265
|
+
* (<meta name="csp-nonce" content="{ nonce value here }" />) and will result in the same behavior.
|
|
266
|
+
* @param nonce The value to be used for the nonce attribute.
|
|
267
|
+
*/
|
|
268
|
+
export declare function setNonce(nonce: string): void;
|
|
260
269
|
/**
|
|
261
270
|
* Retrieve a Stencil element for a given reference
|
|
262
271
|
* @param ref the ref to get the Stencil element for
|
|
@@ -433,8 +442,44 @@ interface HostAttributes {
|
|
|
433
442
|
ref?: (el: HTMLElement | null) => void;
|
|
434
443
|
[prop: string]: any;
|
|
435
444
|
}
|
|
445
|
+
/**
|
|
446
|
+
* Utilities for working with functional Stencil components. An object
|
|
447
|
+
* conforming to this interface is passed by the Stencil runtime as the third
|
|
448
|
+
* argument to a functional component, allowing component authors to work with
|
|
449
|
+
* features like children.
|
|
450
|
+
*
|
|
451
|
+
* The children of a functional component will be passed as the second
|
|
452
|
+
* argument, so a functional component which uses these utils to transform its
|
|
453
|
+
* children might look like the following:
|
|
454
|
+
*
|
|
455
|
+
* ```ts
|
|
456
|
+
* export const AddClass: FunctionalComponent = (_, children, utils) => (
|
|
457
|
+
* utils.map(children, child => ({
|
|
458
|
+
* ...child,
|
|
459
|
+
* vattrs: {
|
|
460
|
+
* ...child.vattrs,
|
|
461
|
+
* class: `${child.vattrs.class} add-class`
|
|
462
|
+
* }
|
|
463
|
+
* }))
|
|
464
|
+
* );
|
|
465
|
+
* ```
|
|
466
|
+
*
|
|
467
|
+
* For more see the Stencil documentation, here:
|
|
468
|
+
* https://stenciljs.com/docs/functional-components
|
|
469
|
+
*/
|
|
436
470
|
export interface FunctionalUtilities {
|
|
471
|
+
/**
|
|
472
|
+
* Utility for reading the children of a functional component at runtime.
|
|
473
|
+
* Since the Stencil runtime uses a different interface for children it is
|
|
474
|
+
* not recommendeded to read the children directly, and is preferable to use
|
|
475
|
+
* this utility to, for instance, perform a side effect for each child.
|
|
476
|
+
*/
|
|
437
477
|
forEach: (children: VNode[], cb: (vnode: ChildNode, index: number, array: ChildNode[]) => void) => void;
|
|
478
|
+
/**
|
|
479
|
+
* Utility for transforming the children of a functional component. Given an
|
|
480
|
+
* array of children and a callback this will return a list of the results of
|
|
481
|
+
* passing each child to the supplied callback.
|
|
482
|
+
*/
|
|
438
483
|
map: (children: VNode[], cb: (vnode: ChildNode, index: number, array: ChildNode[]) => ChildNode) => VNode[];
|
|
439
484
|
}
|
|
440
485
|
export interface FunctionalComponent<T = {}> {
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
export declare enum OverflowBehaviorElements {
|
|
2
|
+
MORE = "data-overflow-more",
|
|
3
|
+
BASE_INDEX = "data-overflow-base-index",
|
|
4
|
+
PROXY_INDEX = "data-overflow-proxy-index"
|
|
5
|
+
}
|
|
6
|
+
export declare class OverflowBehavior {
|
|
7
|
+
private element;
|
|
8
|
+
private render;
|
|
9
|
+
private resizeObserver;
|
|
10
|
+
private moreElement;
|
|
11
|
+
private children;
|
|
12
|
+
constructor(element: Element, render: () => HTMLElement);
|
|
13
|
+
/**********
|
|
14
|
+
* Public *
|
|
15
|
+
**********/
|
|
16
|
+
/**
|
|
17
|
+
* Disconnect ResizeObserver
|
|
18
|
+
*
|
|
19
|
+
* @returns {void}
|
|
20
|
+
*/
|
|
21
|
+
disconnect: () => void;
|
|
22
|
+
/************
|
|
23
|
+
* Internal *
|
|
24
|
+
************/
|
|
25
|
+
/**
|
|
26
|
+
* run overflow behavior
|
|
27
|
+
*
|
|
28
|
+
* @param {number} width width of the container
|
|
29
|
+
* @returns {void}
|
|
30
|
+
*/
|
|
31
|
+
private run;
|
|
32
|
+
/**
|
|
33
|
+
* Update displayed items in container from a given available space
|
|
34
|
+
*
|
|
35
|
+
* @param {number} availableWidth available width in container to display child items
|
|
36
|
+
* @returns {void}
|
|
37
|
+
*/
|
|
38
|
+
private updateDisplayedItems;
|
|
39
|
+
/**
|
|
40
|
+
* Utility method to know if item overflow partialy or totaly in the container
|
|
41
|
+
*
|
|
42
|
+
* @param {number} cumulateWidth previous sibling elements cumulate width + item width
|
|
43
|
+
* @param {HTMLElement} item item HTML element
|
|
44
|
+
* @param {number} availableWidth container available width
|
|
45
|
+
* @returns {boolean} truthy if element is overflow
|
|
46
|
+
*/
|
|
47
|
+
private isOverflowElement;
|
|
48
|
+
/**
|
|
49
|
+
* Utility method to know if a given element is the 'MORE' element
|
|
50
|
+
*
|
|
51
|
+
* @param {Element} element element to match with 'MORE' element
|
|
52
|
+
* @returns {boolean} truthy if element is the 'MORE' element
|
|
53
|
+
*/
|
|
54
|
+
private isMoreElement;
|
|
55
|
+
/**
|
|
56
|
+
* Toggle display item element
|
|
57
|
+
*
|
|
58
|
+
* @param {HTMLElement} item item to control
|
|
59
|
+
* @param {boolean} isHidden is item hidden
|
|
60
|
+
* @returns {void}
|
|
61
|
+
*/
|
|
62
|
+
private toggleItem;
|
|
63
|
+
/**
|
|
64
|
+
* Toggle element's hidde attribute
|
|
65
|
+
*
|
|
66
|
+
* @param {Element} element element to toggle
|
|
67
|
+
* @param {boolean} isHidden element is hidden
|
|
68
|
+
* @returns {void}
|
|
69
|
+
*/
|
|
70
|
+
private toggleElement;
|
|
71
|
+
/**
|
|
72
|
+
* Remove hidden attributes on all items
|
|
73
|
+
*
|
|
74
|
+
* @returns {void}
|
|
75
|
+
*/
|
|
76
|
+
private restoreItems;
|
|
77
|
+
}
|
|
@@ -60,3 +60,17 @@ export declare const isTagName: (element: Element, tagNames: string[]) => boolea
|
|
|
60
60
|
* Focusable elements query selector
|
|
61
61
|
*/
|
|
62
62
|
export declare const focusableElements = "a[href], button, input, textarea, select, details, [tabindex]:not([tabindex=\"-1\"]), [identifier]";
|
|
63
|
+
/**
|
|
64
|
+
*
|
|
65
|
+
* @param {Window} localWindow the window we are lookink for other windows
|
|
66
|
+
* @returns {Window[]} The list of windows found
|
|
67
|
+
*/
|
|
68
|
+
export declare const getWindows: (localWindow: Window) => Window[];
|
|
69
|
+
/**
|
|
70
|
+
* Get parent windows
|
|
71
|
+
*
|
|
72
|
+
* @param {Window} localWindow the window we are lookink for parents
|
|
73
|
+
* @param {Window[]} windows The list of allready found windows
|
|
74
|
+
* @returns {Window[]} The list of windows found
|
|
75
|
+
*/
|
|
76
|
+
export declare const getParentWindows: (localWindow: Window, windows?: Window[]) => Window[];
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* @param {string} currency currency to apply
|
|
7
7
|
* @returns {string} formatted currency
|
|
8
8
|
*/
|
|
9
|
-
export declare
|
|
9
|
+
export declare const localeCurrency: (number: number, locale: string, currency: string) => string;
|
|
10
10
|
/**
|
|
11
11
|
* Format number to locale
|
|
12
12
|
*
|
|
@@ -14,7 +14,7 @@ export declare function localeCurrency(number: number, locale: string, currency:
|
|
|
14
14
|
* @param {string} locale locale to apply
|
|
15
15
|
* @returns {string} formatted number
|
|
16
16
|
*/
|
|
17
|
-
export declare
|
|
17
|
+
export declare const localeNumber: (number: number, locale: string) => string;
|
|
18
18
|
/**
|
|
19
19
|
* Date RegExp
|
|
20
20
|
*/
|
|
@@ -26,4 +26,17 @@ export declare const dateRegExp: RegExp;
|
|
|
26
26
|
* @param {string} locale locale to apply
|
|
27
27
|
* @returns {string} formatted date
|
|
28
28
|
*/
|
|
29
|
-
export declare
|
|
29
|
+
export declare const localeDate: (date: string, locale: string) => string;
|
|
30
|
+
/**
|
|
31
|
+
* Get locale and messages
|
|
32
|
+
* We load the defined locale but for now we only support the first subtag for messages
|
|
33
|
+
*
|
|
34
|
+
* @param {HTMLElement} element element we need to get the language
|
|
35
|
+
* @param {unknown} messages messages to use
|
|
36
|
+
* @param {string} defaultLocale default messages locale
|
|
37
|
+
* @returns {{ locale: string; messages: Record<string, unknown> }} messages object
|
|
38
|
+
*/
|
|
39
|
+
export declare const getLocaleMessages: (element: HTMLElement, messages: unknown, defaultLocale: string) => {
|
|
40
|
+
locale: string;
|
|
41
|
+
messages: Record<string, unknown>;
|
|
42
|
+
};
|
|
@@ -10,11 +10,11 @@ export declare const cloneDeep: (obj: unknown) => unknown;
|
|
|
10
10
|
*
|
|
11
11
|
* @param mutationObserverMock - Parameter that is sent to the `Object.defineProperty`
|
|
12
12
|
* overwrite method. `jest.fn()` mock functions can be passed here if the goal is to not only
|
|
13
|
-
* mock the
|
|
13
|
+
* mock the mutation observer, but its methods.
|
|
14
14
|
* You can manually fire an intersection entry:
|
|
15
15
|
* @param {Function} mutationObserverMock.disconnect disconnect function
|
|
16
|
-
* @param {Function} mutationObserverMock.observe observe
|
|
17
|
-
* @param {Function} mutationObserverMock.takeRecords takeRecords
|
|
16
|
+
* @param {Function} mutationObserverMock.observe observe function
|
|
17
|
+
* @param {Function} mutationObserverMock.takeRecords takeRecords function
|
|
18
18
|
* @returns {MutationObserver} Mocked MutationObserver
|
|
19
19
|
* @example
|
|
20
20
|
* ```
|
|
@@ -28,15 +28,69 @@ export declare const cloneDeep: (obj: unknown) => unknown;
|
|
|
28
28
|
* fireMo([{ type: 'childList', addedNodes: [AMockElemenet, AnotherMockElemenet], target: yourMockElemenet }]);;
|
|
29
29
|
* ```
|
|
30
30
|
*/
|
|
31
|
-
|
|
32
|
-
disconnect:
|
|
33
|
-
observe:
|
|
34
|
-
takeRecords:
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
31
|
+
type SetupMutationObserverMockParams = {
|
|
32
|
+
disconnect: MutationObserver['disconnect'];
|
|
33
|
+
observe: MutationObserver['observe'];
|
|
34
|
+
takeRecords: MutationObserver['takeRecords'];
|
|
35
|
+
};
|
|
36
|
+
export declare const setupMutationObserverMock: ({ disconnect, observe, takeRecords }: SetupMutationObserverMockParams) => typeof MutationObserver;
|
|
37
|
+
/**
|
|
38
|
+
* Utility function that mocks the `ResizeObserver` API. Recommended to execute inside `beforeEach`.
|
|
39
|
+
*
|
|
40
|
+
* @param resizeObserverMock - Parameter that is sent to the `Object.defineProperty`
|
|
41
|
+
* overwrite method. `jest.fn()` mock functions can be passed here if the goal is to not only
|
|
42
|
+
* mock the resize observer, but its methods.
|
|
43
|
+
* You can manually fire an intersection entry:
|
|
44
|
+
* @param {Function} resizeObserverMock.disconnect disconnect function
|
|
45
|
+
* @param {Function} resizeObserverMock.observe observe function
|
|
46
|
+
* @returns {ResizeObserver} Mocked ResizeObserver
|
|
47
|
+
* @example
|
|
48
|
+
* ```
|
|
49
|
+
* let fireRo;
|
|
50
|
+
* setupResizeObserverMock({
|
|
51
|
+
* observe: function () {
|
|
52
|
+
* fireRo = this.cb;
|
|
53
|
+
* },
|
|
54
|
+
* });
|
|
55
|
+
* ...
|
|
56
|
+
* fireRo([{
|
|
57
|
+
* borderBoxSize: ResizeObserverSize[],
|
|
58
|
+
* contentBoxSize: ResizeObserverSize[],
|
|
59
|
+
* contentRect: DOMRectReadOnly,
|
|
60
|
+
* devicePixelContentBoxSize: ResizeObserverSize[],
|
|
61
|
+
* target: yourMockElemenet
|
|
62
|
+
* }]);;
|
|
63
|
+
* ```
|
|
64
|
+
*/
|
|
65
|
+
type setupResizeObserverMockParams = {
|
|
66
|
+
disconnect: ResizeObserver['disconnect'];
|
|
67
|
+
observe: ResizeObserver['observe'];
|
|
42
68
|
};
|
|
69
|
+
export declare const setupResizeObserverMock: ({ disconnect, observe }: setupResizeObserverMockParams) => typeof ResizeObserver;
|
|
70
|
+
/**
|
|
71
|
+
* force popover id when component use randomed identifier
|
|
72
|
+
*
|
|
73
|
+
* @param {Element} component element wich include mg-popover
|
|
74
|
+
* @param {string} id new fixed id
|
|
75
|
+
* @param {string} interactiveElement element where attribute 'aria-controls' is set
|
|
76
|
+
* @returns {void}
|
|
77
|
+
*/
|
|
78
|
+
export declare const forcePopoverId: (component: Element, id: string, interactiveElement?: string) => void;
|
|
79
|
+
/**
|
|
80
|
+
* fix popper console.error in test
|
|
81
|
+
* it is generated in @popperjs/core/dist/cjs/popper.js l.1859
|
|
82
|
+
* this is due to internal function isHTMLElement(), so we can not mock it directly.
|
|
83
|
+
* this function check if test DOM element mockHTMLElement instance is 'instanceof HTMLElement'
|
|
84
|
+
* so we only override the console.error side effect for this error
|
|
85
|
+
*
|
|
86
|
+
* @returns {void}
|
|
87
|
+
*/
|
|
88
|
+
export declare const mockConsoleError: () => void;
|
|
89
|
+
/**
|
|
90
|
+
* Add missing window.frames property to test context
|
|
91
|
+
* usefull for component with iframe listeners, ex: mg-popover
|
|
92
|
+
*
|
|
93
|
+
* @returns {void}
|
|
94
|
+
*/
|
|
95
|
+
export declare const mockWindowFrames: () => void;
|
|
96
|
+
export {};
|
package/loader/index.d.ts
CHANGED
|
@@ -10,3 +10,12 @@ export interface CustomElementsDefineOptions {
|
|
|
10
10
|
}
|
|
11
11
|
export declare function defineCustomElements(win?: Window, opts?: CustomElementsDefineOptions): Promise<void>;
|
|
12
12
|
export declare function applyPolyfills(): Promise<void>;
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Used to specify a nonce value that corresponds with an application's CSP.
|
|
16
|
+
* When set, the nonce will be added to all dynamically created script and style tags at runtime.
|
|
17
|
+
* Alternatively, the nonce value can be set on a meta tag in the DOM head
|
|
18
|
+
* (<meta name="csp-nonce" content="{ nonce value here }" />) which
|
|
19
|
+
* will result in the same behavior.
|
|
20
|
+
*/
|
|
21
|
+
export declare function setNonce(nonce: string): void;
|