@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
|
@@ -13,10 +13,12 @@ import { Width } from "./components/molecules/inputs/MgInput.conf";
|
|
|
13
13
|
import { RadioOption } from "./components/molecules/inputs/mg-input-radio/mg-input-radio.conf";
|
|
14
14
|
import { SelectOption } from "./components/molecules/inputs/mg-input-select/mg-input-select.conf";
|
|
15
15
|
import { ToggleValue } from "./components/molecules/inputs/mg-input-toggle/mg-input-toggle.conf";
|
|
16
|
-
import { Direction } from "./components/molecules/menu/mg-menu/mg-menu.conf";
|
|
17
|
-
import {
|
|
16
|
+
import { Direction, MenuSizeType, MoreItemType } from "./components/molecules/menu/mg-menu/mg-menu.conf";
|
|
17
|
+
import { Status } from "./components/molecules/menu/mg-menu-item/mg-menu-item.conf";
|
|
18
18
|
import { Placement } from "@popperjs/core";
|
|
19
|
+
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
|
/**
|
|
@@ -872,6 +874,14 @@ export namespace Components {
|
|
|
872
874
|
* Menu label. Include short menu description. Required for accessibility
|
|
873
875
|
*/
|
|
874
876
|
"label": string;
|
|
877
|
+
/**
|
|
878
|
+
* Customize mg-menu "more element" Used with direction: 'vertical' to manage overflow
|
|
879
|
+
*/
|
|
880
|
+
"moreitem": MoreItemType;
|
|
881
|
+
/**
|
|
882
|
+
* Define mg-menu size Default: 'regular'
|
|
883
|
+
*/
|
|
884
|
+
"size": MenuSizeType;
|
|
875
885
|
}
|
|
876
886
|
interface MgMenuItem {
|
|
877
887
|
/**
|
|
@@ -879,13 +889,9 @@ export namespace Components {
|
|
|
879
889
|
*/
|
|
880
890
|
"expanded": boolean;
|
|
881
891
|
/**
|
|
882
|
-
* Define menu-item
|
|
892
|
+
* Define menu-item href when defined menu-item contain an anchor instead of button
|
|
883
893
|
*/
|
|
884
894
|
"href": string;
|
|
885
|
-
/**
|
|
886
|
-
* Define menu-item size. Default: "large".
|
|
887
|
-
*/
|
|
888
|
-
"size": MenuItemSizeType;
|
|
889
895
|
/**
|
|
890
896
|
* Define menu-item status. Default: "visible"
|
|
891
897
|
*/
|
|
@@ -980,6 +986,10 @@ export namespace Components {
|
|
|
980
986
|
"titlePatternErrorMessage": string;
|
|
981
987
|
}
|
|
982
988
|
interface MgPopover {
|
|
989
|
+
/**
|
|
990
|
+
* Hide popover arrow
|
|
991
|
+
*/
|
|
992
|
+
"arrowHide": boolean;
|
|
983
993
|
/**
|
|
984
994
|
* Define if popover has a cross button
|
|
985
995
|
*/
|
|
@@ -1001,9 +1011,15 @@ export namespace Components {
|
|
|
1001
1011
|
*/
|
|
1002
1012
|
"placement": Placement;
|
|
1003
1013
|
}
|
|
1014
|
+
interface MgSkipLinks {
|
|
1015
|
+
/**
|
|
1016
|
+
* Skip links
|
|
1017
|
+
*/
|
|
1018
|
+
"links": SkipLink[];
|
|
1019
|
+
}
|
|
1004
1020
|
interface MgTabs {
|
|
1005
1021
|
/**
|
|
1006
|
-
* Active tab number
|
|
1022
|
+
* Active tab number
|
|
1007
1023
|
*/
|
|
1008
1024
|
"activeTab": number;
|
|
1009
1025
|
/**
|
|
@@ -1025,13 +1041,17 @@ export namespace Components {
|
|
|
1025
1041
|
}
|
|
1026
1042
|
interface MgTag {
|
|
1027
1043
|
/**
|
|
1028
|
-
* Define if
|
|
1044
|
+
* Define if tag is using outline style
|
|
1029
1045
|
*/
|
|
1030
1046
|
"outline": boolean;
|
|
1031
1047
|
/**
|
|
1032
|
-
* Define
|
|
1048
|
+
* Define if tag is using soft style
|
|
1033
1049
|
*/
|
|
1034
|
-
"
|
|
1050
|
+
"soft": boolean;
|
|
1051
|
+
/**
|
|
1052
|
+
* Define tag variant
|
|
1053
|
+
*/
|
|
1054
|
+
"variant": TagVariantType;
|
|
1035
1055
|
}
|
|
1036
1056
|
interface MgTooltip {
|
|
1037
1057
|
/**
|
|
@@ -1100,6 +1120,10 @@ export interface MgInputToggleCustomEvent<T> extends CustomEvent<T> {
|
|
|
1100
1120
|
detail: T;
|
|
1101
1121
|
target: HTMLMgInputToggleElement;
|
|
1102
1122
|
}
|
|
1123
|
+
export interface MgMenuItemCustomEvent<T> extends CustomEvent<T> {
|
|
1124
|
+
detail: T;
|
|
1125
|
+
target: HTMLMgMenuItemElement;
|
|
1126
|
+
}
|
|
1103
1127
|
export interface MgMessageCustomEvent<T> extends CustomEvent<T> {
|
|
1104
1128
|
detail: T;
|
|
1105
1129
|
target: HTMLMgMessageElement;
|
|
@@ -1120,6 +1144,10 @@ export interface MgPopoverCustomEvent<T> extends CustomEvent<T> {
|
|
|
1120
1144
|
detail: T;
|
|
1121
1145
|
target: HTMLMgPopoverElement;
|
|
1122
1146
|
}
|
|
1147
|
+
export interface MgSkipLinksCustomEvent<T> extends CustomEvent<T> {
|
|
1148
|
+
detail: T;
|
|
1149
|
+
target: HTMLMgSkipLinksElement;
|
|
1150
|
+
}
|
|
1123
1151
|
export interface MgTabsCustomEvent<T> extends CustomEvent<T> {
|
|
1124
1152
|
detail: T;
|
|
1125
1153
|
target: HTMLMgTabsElement;
|
|
@@ -1281,6 +1309,12 @@ declare global {
|
|
|
1281
1309
|
prototype: HTMLMgPopoverElement;
|
|
1282
1310
|
new (): HTMLMgPopoverElement;
|
|
1283
1311
|
};
|
|
1312
|
+
interface HTMLMgSkipLinksElement extends Components.MgSkipLinks, HTMLStencilElement {
|
|
1313
|
+
}
|
|
1314
|
+
var HTMLMgSkipLinksElement: {
|
|
1315
|
+
prototype: HTMLMgSkipLinksElement;
|
|
1316
|
+
new (): HTMLMgSkipLinksElement;
|
|
1317
|
+
};
|
|
1284
1318
|
interface HTMLMgTabsElement extends Components.MgTabs, HTMLStencilElement {
|
|
1285
1319
|
}
|
|
1286
1320
|
var HTMLMgTabsElement: {
|
|
@@ -1326,6 +1360,7 @@ declare global {
|
|
|
1326
1360
|
"mg-pagination": HTMLMgPaginationElement;
|
|
1327
1361
|
"mg-panel": HTMLMgPanelElement;
|
|
1328
1362
|
"mg-popover": HTMLMgPopoverElement;
|
|
1363
|
+
"mg-skip-links": HTMLMgSkipLinksElement;
|
|
1329
1364
|
"mg-tabs": HTMLMgTabsElement;
|
|
1330
1365
|
"mg-tag": HTMLMgTagElement;
|
|
1331
1366
|
"mg-tooltip": HTMLMgTooltipElement;
|
|
@@ -2220,6 +2255,14 @@ declare namespace LocalJSX {
|
|
|
2220
2255
|
* Menu label. Include short menu description. Required for accessibility
|
|
2221
2256
|
*/
|
|
2222
2257
|
"label": string;
|
|
2258
|
+
/**
|
|
2259
|
+
* Customize mg-menu "more element" Used with direction: 'vertical' to manage overflow
|
|
2260
|
+
*/
|
|
2261
|
+
"moreitem"?: MoreItemType;
|
|
2262
|
+
/**
|
|
2263
|
+
* Define mg-menu size Default: 'regular'
|
|
2264
|
+
*/
|
|
2265
|
+
"size"?: MenuSizeType;
|
|
2223
2266
|
}
|
|
2224
2267
|
interface MgMenuItem {
|
|
2225
2268
|
/**
|
|
@@ -2227,13 +2270,13 @@ declare namespace LocalJSX {
|
|
|
2227
2270
|
*/
|
|
2228
2271
|
"expanded"?: boolean;
|
|
2229
2272
|
/**
|
|
2230
|
-
* Define menu-item
|
|
2273
|
+
* Define menu-item href when defined menu-item contain an anchor instead of button
|
|
2231
2274
|
*/
|
|
2232
2275
|
"href"?: string;
|
|
2233
2276
|
/**
|
|
2234
|
-
*
|
|
2277
|
+
* Emited event when status change
|
|
2235
2278
|
*/
|
|
2236
|
-
"
|
|
2279
|
+
"onStatus-change"?: (event: MgMenuItemCustomEvent<MgMenuItem['status']>) => void;
|
|
2237
2280
|
/**
|
|
2238
2281
|
* Define menu-item status. Default: "visible"
|
|
2239
2282
|
*/
|
|
@@ -2356,6 +2399,10 @@ declare namespace LocalJSX {
|
|
|
2356
2399
|
"titlePatternErrorMessage"?: string;
|
|
2357
2400
|
}
|
|
2358
2401
|
interface MgPopover {
|
|
2402
|
+
/**
|
|
2403
|
+
* Hide popover arrow
|
|
2404
|
+
*/
|
|
2405
|
+
"arrowHide"?: boolean;
|
|
2359
2406
|
/**
|
|
2360
2407
|
* Define if popover has a cross button
|
|
2361
2408
|
*/
|
|
@@ -2381,9 +2428,19 @@ declare namespace LocalJSX {
|
|
|
2381
2428
|
*/
|
|
2382
2429
|
"placement"?: Placement;
|
|
2383
2430
|
}
|
|
2431
|
+
interface MgSkipLinks {
|
|
2432
|
+
/**
|
|
2433
|
+
* Skip links
|
|
2434
|
+
*/
|
|
2435
|
+
"links"?: SkipLink[];
|
|
2436
|
+
/**
|
|
2437
|
+
* Emited event when link is clicked
|
|
2438
|
+
*/
|
|
2439
|
+
"onGo-to-anchor"?: (event: MgSkipLinksCustomEvent<string>) => void;
|
|
2440
|
+
}
|
|
2384
2441
|
interface MgTabs {
|
|
2385
2442
|
/**
|
|
2386
|
-
* Active tab number
|
|
2443
|
+
* Active tab number
|
|
2387
2444
|
*/
|
|
2388
2445
|
"activeTab"?: number;
|
|
2389
2446
|
/**
|
|
@@ -2409,13 +2466,17 @@ declare namespace LocalJSX {
|
|
|
2409
2466
|
}
|
|
2410
2467
|
interface MgTag {
|
|
2411
2468
|
/**
|
|
2412
|
-
* Define if
|
|
2469
|
+
* Define if tag is using outline style
|
|
2413
2470
|
*/
|
|
2414
2471
|
"outline"?: boolean;
|
|
2415
2472
|
/**
|
|
2416
|
-
* Define
|
|
2473
|
+
* Define if tag is using soft style
|
|
2417
2474
|
*/
|
|
2418
|
-
"
|
|
2475
|
+
"soft"?: boolean;
|
|
2476
|
+
/**
|
|
2477
|
+
* Define tag variant
|
|
2478
|
+
*/
|
|
2479
|
+
"variant"?: TagVariantType;
|
|
2419
2480
|
}
|
|
2420
2481
|
interface MgTooltip {
|
|
2421
2482
|
/**
|
|
@@ -2466,6 +2527,7 @@ declare namespace LocalJSX {
|
|
|
2466
2527
|
"mg-pagination": MgPagination;
|
|
2467
2528
|
"mg-panel": MgPanel;
|
|
2468
2529
|
"mg-popover": MgPopover;
|
|
2530
|
+
"mg-skip-links": MgSkipLinks;
|
|
2469
2531
|
"mg-tabs": MgTabs;
|
|
2470
2532
|
"mg-tag": MgTag;
|
|
2471
2533
|
"mg-tooltip": MgTooltip;
|
|
@@ -2501,6 +2563,7 @@ declare module "@stencil/core" {
|
|
|
2501
2563
|
"mg-pagination": LocalJSX.MgPagination & JSXBase.HTMLAttributes<HTMLMgPaginationElement>;
|
|
2502
2564
|
"mg-panel": LocalJSX.MgPanel & JSXBase.HTMLAttributes<HTMLMgPanelElement>;
|
|
2503
2565
|
"mg-popover": LocalJSX.MgPopover & JSXBase.HTMLAttributes<HTMLMgPopoverElement>;
|
|
2566
|
+
"mg-skip-links": LocalJSX.MgSkipLinks & JSXBase.HTMLAttributes<HTMLMgSkipLinksElement>;
|
|
2504
2567
|
"mg-tabs": LocalJSX.MgTabs & JSXBase.HTMLAttributes<HTMLMgTabsElement>;
|
|
2505
2568
|
"mg-tag": LocalJSX.MgTag & JSXBase.HTMLAttributes<HTMLMgTagElement>;
|
|
2506
2569
|
"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;
|
|
@@ -48,6 +51,10 @@ declare const messages: {
|
|
|
48
51
|
next: string;
|
|
49
52
|
previous: string;
|
|
50
53
|
};
|
|
54
|
+
plusMenu: {
|
|
55
|
+
moreLabel: string;
|
|
56
|
+
badgeLabel: string;
|
|
57
|
+
};
|
|
51
58
|
};
|
|
52
59
|
fr: {
|
|
53
60
|
errors: {
|
|
@@ -59,13 +66,7 @@ declare const messages: {
|
|
|
59
66
|
minMax: string;
|
|
60
67
|
};
|
|
61
68
|
numeric: {
|
|
62
|
-
min: string;
|
|
63
|
-
* Get Intl object
|
|
64
|
-
* We load the defined locale but for now we only support the first subtag for messages
|
|
65
|
-
*
|
|
66
|
-
* @param {HTMLElement} element element we need to get the language
|
|
67
|
-
* @returns {{ locale: string; messages: unknown }} messages object
|
|
68
|
-
*/
|
|
69
|
+
min: string;
|
|
69
70
|
max: string;
|
|
70
71
|
minMax: string;
|
|
71
72
|
};
|
|
@@ -97,6 +98,9 @@ declare const messages: {
|
|
|
97
98
|
panel: {
|
|
98
99
|
editLabel: string;
|
|
99
100
|
};
|
|
101
|
+
skipLinks: {
|
|
102
|
+
navLabel: string;
|
|
103
|
+
};
|
|
100
104
|
general: {
|
|
101
105
|
confirm: string;
|
|
102
106
|
cancel: string;
|
|
@@ -104,17 +108,20 @@ declare const messages: {
|
|
|
104
108
|
next: string;
|
|
105
109
|
previous: string;
|
|
106
110
|
};
|
|
111
|
+
plusMenu: {
|
|
112
|
+
moreLabel: string;
|
|
113
|
+
badgeLabel: string;
|
|
114
|
+
};
|
|
107
115
|
};
|
|
108
116
|
};
|
|
109
117
|
/**
|
|
110
118
|
* Get Intl object
|
|
111
|
-
* We load the defined locale but for now we only support the first subtag for messages
|
|
112
119
|
*
|
|
113
120
|
* @param {HTMLElement} element element we need to get the language
|
|
114
121
|
* @returns {{ locale: string; messages: unknown }} messages object
|
|
115
122
|
*/
|
|
116
123
|
export declare const initLocales: (element: HTMLElement) => {
|
|
117
124
|
locale: string;
|
|
118
|
-
messages:
|
|
125
|
+
messages: unknown;
|
|
119
126
|
};
|
|
120
127
|
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
|
*/
|
|
@@ -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 {
|
|
@@ -428,8 +433,44 @@ interface HostAttributes {
|
|
|
428
433
|
ref?: (el: HTMLElement | null) => void;
|
|
429
434
|
[prop: string]: any;
|
|
430
435
|
}
|
|
436
|
+
/**
|
|
437
|
+
* Utilities for working with functional Stencil components. An object
|
|
438
|
+
* conforming to this interface is passed by the Stencil runtime as the third
|
|
439
|
+
* argument to a functional component, allowing component authors to work with
|
|
440
|
+
* features like children.
|
|
441
|
+
*
|
|
442
|
+
* The children of a functional component will be passed as the second
|
|
443
|
+
* argument, so a functional component which uses these utils to transform its
|
|
444
|
+
* children might look like the following:
|
|
445
|
+
*
|
|
446
|
+
* ```ts
|
|
447
|
+
* export const AddClass: FunctionalComponent = (_, children, utils) => (
|
|
448
|
+
* utils.map(children, child => ({
|
|
449
|
+
* ...child,
|
|
450
|
+
* vattrs: {
|
|
451
|
+
* ...child.vattrs,
|
|
452
|
+
* class: `${child.vattrs.class} add-class`
|
|
453
|
+
* }
|
|
454
|
+
* }))
|
|
455
|
+
* );
|
|
456
|
+
* ```
|
|
457
|
+
*
|
|
458
|
+
* For more see the Stencil documentation, here:
|
|
459
|
+
* https://stenciljs.com/docs/functional-components
|
|
460
|
+
*/
|
|
431
461
|
export interface FunctionalUtilities {
|
|
462
|
+
/**
|
|
463
|
+
* Utility for reading the children of a functional component at runtime.
|
|
464
|
+
* Since the Stencil runtime uses a different interface for children it is
|
|
465
|
+
* not recommendeded to read the children directly, and is preferable to use
|
|
466
|
+
* this utility to, for instance, perform a side effect for each child.
|
|
467
|
+
*/
|
|
432
468
|
forEach: (children: VNode[], cb: (vnode: ChildNode, index: number, array: ChildNode[]) => void) => void;
|
|
469
|
+
/**
|
|
470
|
+
* Utility for transforming the children of a functional component. Given an
|
|
471
|
+
* array of children and a callback this will return a list of the results of
|
|
472
|
+
* passing each child to the supplied callback.
|
|
473
|
+
*/
|
|
433
474
|
map: (children: VNode[], cb: (vnode: ChildNode, index: number, array: ChildNode[]) => ChildNode) => VNode[];
|
|
434
475
|
}
|
|
435
476
|
export interface FunctionalComponent<T = {}> {
|
|
@@ -0,0 +1,83 @@
|
|
|
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
|
+
* Update more element status if active child
|
|
24
|
+
*
|
|
25
|
+
* @returns {void}
|
|
26
|
+
*/
|
|
27
|
+
updateActiveStatus: () => void;
|
|
28
|
+
/************
|
|
29
|
+
* Internal *
|
|
30
|
+
************/
|
|
31
|
+
/**
|
|
32
|
+
* run overflow behavior
|
|
33
|
+
*
|
|
34
|
+
* @param {number} width width of the container
|
|
35
|
+
* @returns {void}
|
|
36
|
+
*/
|
|
37
|
+
private run;
|
|
38
|
+
/**
|
|
39
|
+
* Update displayed items in container from a given available space
|
|
40
|
+
*
|
|
41
|
+
* @param {number} availableWidth available width in container to display child items
|
|
42
|
+
* @returns {void}
|
|
43
|
+
*/
|
|
44
|
+
private updateDisplayedItems;
|
|
45
|
+
/**
|
|
46
|
+
* Utility method to know if item overflow partialy or totaly in the container
|
|
47
|
+
*
|
|
48
|
+
* @param {number} cumulateWidth previous sibling elements cumulate width + item width
|
|
49
|
+
* @param {HTMLElement} item item HTML element
|
|
50
|
+
* @param {number} availableWidth container available width
|
|
51
|
+
* @returns {boolean} truthy if element is overflow
|
|
52
|
+
*/
|
|
53
|
+
private isOverflowElement;
|
|
54
|
+
/**
|
|
55
|
+
* Utility method to know if a given element is the 'MORE' element
|
|
56
|
+
*
|
|
57
|
+
* @param {Element} element element to match with 'MORE' element
|
|
58
|
+
* @returns {boolean} truthy if element is the 'MORE' element
|
|
59
|
+
*/
|
|
60
|
+
private isMoreElement;
|
|
61
|
+
/**
|
|
62
|
+
* Toggle display item element
|
|
63
|
+
*
|
|
64
|
+
* @param {HTMLElement} item item to control
|
|
65
|
+
* @param {boolean} isHidden is item hidden
|
|
66
|
+
* @returns {void}
|
|
67
|
+
*/
|
|
68
|
+
private toggleItem;
|
|
69
|
+
/**
|
|
70
|
+
* Toggle element's hidde attribute
|
|
71
|
+
*
|
|
72
|
+
* @param {Element} element element to toggle
|
|
73
|
+
* @param {boolean} isHidden element is hidden
|
|
74
|
+
* @returns {void}
|
|
75
|
+
*/
|
|
76
|
+
private toggleElement;
|
|
77
|
+
/**
|
|
78
|
+
* Remove hidden attributes on all items
|
|
79
|
+
*
|
|
80
|
+
* @returns {void}
|
|
81
|
+
*/
|
|
82
|
+
private restoreItems;
|
|
83
|
+
}
|
|
@@ -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[];
|
|
@@ -27,3 +27,16 @@ export declare const dateRegExp: RegExp;
|
|
|
27
27
|
* @returns {string} formatted date
|
|
28
28
|
*/
|
|
29
29
|
export declare function 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: unknown }} messages object
|
|
38
|
+
*/
|
|
39
|
+
export declare const getLocaleMessages: (element: HTMLElement, messages: unknown, defaultLocale: string) => {
|
|
40
|
+
locale: string;
|
|
41
|
+
messages: unknown;
|
|
42
|
+
};
|
|
@@ -0,0 +1,78 @@
|
|
|
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 mutation 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 function
|
|
17
|
+
* @param {Function} mutationObserverMock.takeRecords takeRecords function
|
|
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
|
+
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'];
|
|
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} item element wich include mg-popover
|
|
74
|
+
* @param {string} id new fixed id
|
|
75
|
+
* @returns {void}
|
|
76
|
+
*/
|
|
77
|
+
export declare const forcePopoverId: (item: Element, id: string) => void;
|
|
78
|
+
export {};
|