@mgdis/mg-components 5.6.0 → 5.8.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-4dcc1812.js → index-5e7ede97.js} +109 -3
- package/dist/cjs/loader.cjs.js +4 -3
- package/dist/cjs/{mg-badge_30.cjs.entry.js → mg-action-more_31.cjs.entry.js} +490 -661
- package/dist/cjs/mg-components.cjs.js +7 -3
- package/dist/cjs/mg-item-more.cjs.entry.js +273 -0
- package/dist/cjs/mg-menu.conf-9afe6571.js +242 -0
- package/dist/collection/collection-manifest.json +7 -5
- package/dist/collection/components/atoms/mg-badge/mg-badge.js +1 -1
- package/dist/collection/components/atoms/mg-button/mg-button.css +7 -21
- package/dist/collection/components/atoms/mg-button/mg-button.js +25 -1
- package/dist/collection/components/atoms/mg-icon/mg-icon.conf.js +35 -27
- package/dist/collection/components/atoms/mg-icon/mg-icon.js +3 -3
- package/dist/collection/components/atoms/mg-tag/mg-tag.js +1 -1
- package/dist/collection/components/atoms/mg-tooltip/mg-tooltip.js +18 -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 +4 -0
- package/dist/collection/components/molecules/inputs/mg-input-date/mg-input-date.js +1 -1
- package/dist/collection/components/molecules/inputs/mg-input-numeric/mg-input-numeric.css +4 -0
- 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 +4 -0
- 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 +4 -0
- package/dist/collection/components/molecules/inputs/mg-input-select/mg-input-select.js +1 -1
- package/dist/collection/components/molecules/inputs/mg-input-text/mg-input-text.css +4 -0
- package/dist/collection/components/molecules/inputs/mg-input-textarea/mg-input-textarea.css +4 -0
- 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 +0 -13
- package/dist/collection/components/molecules/menu/mg-menu/mg-menu.js +41 -70
- package/dist/collection/components/molecules/menu/mg-menu-item/mg-menu-item.css +5 -4
- package/dist/collection/components/molecules/menu/mg-menu-item/mg-menu-item.js +160 -61
- 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-item-more/mg-item-more.conf.js +1 -0
- package/dist/collection/components/molecules/mg-item-more/mg-item-more.css +30 -0
- package/dist/collection/components/molecules/mg-item-more/mg-item-more.js +200 -0
- package/dist/collection/components/molecules/mg-message/mg-message.js +1 -1
- package/dist/collection/components/molecules/mg-pagination/mg-pagination.js +19 -1
- package/dist/collection/components/molecules/mg-panel/mg-panel.js +2 -2
- package/dist/collection/components/molecules/mg-popover/mg-popover.css +0 -1
- package/dist/collection/components/molecules/mg-popover/mg-popover.js +17 -4
- package/dist/collection/components/molecules/mg-skip-links/mg-skip-links.js +2 -1
- package/dist/collection/components/molecules/mg-tabs/mg-tabs.css +2 -3
- package/dist/collection/components/molecules/mg-tabs/mg-tabs.js +9 -8
- package/dist/collection/locales/en/messages.json +6 -1
- package/dist/collection/locales/fr/messages.json +6 -1
- package/dist/collection/locales/index.js +1 -1
- package/dist/collection/styles/mg-icon-animation.scss +6 -0
- package/dist/collection/styles/navigation-button.scss +3 -2
- package/dist/collection/utils/behaviors.utils.js +38 -52
- package/dist/collection/utils/components.utils.js +3 -1
- package/dist/collection/utils/locale.utils.js +9 -9
- package/dist/collection/utils/unit.test.utils.js +32 -4
- package/dist/collection/variables.css +2 -1
- package/dist/components/MgInput.js +6 -1
- package/dist/components/components.utils.js +3 -1
- package/dist/components/index.d.ts +11 -0
- package/dist/components/index.js +3 -1
- package/dist/components/index2.js +26 -14
- package/dist/components/mg-action-more.d.ts +11 -0
- package/dist/components/mg-action-more.js +216 -0
- package/dist/components/mg-badge2.js +1 -1
- package/dist/components/mg-button2.js +6 -3
- package/dist/components/mg-form.js +2 -2
- package/dist/components/mg-icon2.js +38 -30
- package/dist/components/mg-input-checkbox.js +3 -3
- package/dist/components/mg-input-date.js +2 -2
- package/dist/components/mg-input-numeric.js +2 -2
- 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 +2 -2
- 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-item-more.d.ts +11 -0
- package/dist/components/mg-item-more.js +336 -0
- package/dist/components/mg-menu-item2.js +137 -250
- package/dist/components/mg-menu.conf.js +14 -0
- package/dist/components/mg-menu.js +1 -246
- package/dist/components/mg-menu2.js +180 -0
- package/dist/components/mg-message.js +1 -1
- package/dist/components/mg-pagination.js +3 -1
- package/dist/components/mg-panel.js +2 -2
- package/dist/components/mg-popover2.js +17 -3
- package/dist/components/mg-skip-links.js +1 -1
- package/dist/components/mg-tabs.js +10 -9
- package/dist/components/mg-tag.js +1 -1
- package/dist/components/mg-tooltip2.js +18 -17
- package/dist/esm/{index-dc9a2348.js → index-03cceb11.js} +109 -4
- package/dist/esm/loader.js +4 -3
- package/dist/esm/{mg-badge_30.entry.js → mg-action-more_31.entry.js} +464 -636
- package/dist/esm/mg-components.js +4 -3
- package/dist/esm/mg-item-more.entry.js +269 -0
- package/dist/esm/mg-menu.conf-881fbd82.js +235 -0
- package/dist/mg-components/locales/en/messages.json +6 -1
- package/dist/mg-components/locales/fr/messages.json +6 -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-1221773c.entry.js +1 -0
- package/dist/mg-components/p-367f92d2.js +1 -0
- package/dist/mg-components/p-6aeded97.entry.js +1 -0
- package/dist/mg-components/p-e126dd84.js +2 -0
- package/dist/mg-components/styles/mg-icon-animation.scss +6 -0
- package/dist/mg-components/styles/navigation-button.scss +3 -2
- package/dist/mg-components/variables.css +2 -1
- package/dist/types/components/atoms/mg-button/mg-button.d.ts +5 -0
- package/dist/types/components/molecules/inputs/mg-input-textarea/mg-input-textarea.d.ts +1 -1
- package/dist/types/components/molecules/menu/mg-menu/mg-menu.conf.d.ts +3 -27
- package/dist/types/components/molecules/menu/mg-menu/mg-menu.d.ts +9 -27
- package/dist/types/components/molecules/menu/mg-menu-item/mg-menu-item.conf.d.ts +5 -0
- package/dist/types/components/molecules/menu/mg-menu-item/mg-menu-item.d.ts +66 -11
- 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-item-more/mg-item-more.conf.d.ts +26 -0
- package/dist/types/components/molecules/mg-item-more/mg-item-more.d.ts +74 -0
- package/dist/types/components/molecules/mg-pagination/mg-pagination.d.ts +4 -0
- package/dist/types/components/molecules/mg-popover/mg-popover.d.ts +2 -1
- package/dist/types/components.d.ts +120 -12
- package/dist/types/locales/index.d.ts +12 -2
- package/dist/types/stencil-public-runtime.d.ts +9 -0
- package/dist/types/utils/behaviors.utils.d.ts +12 -11
- package/dist/types/utils/locale.utils.d.ts +5 -5
- package/dist/types/utils/unit.test.utils.d.ts +20 -2
- package/loader/index.d.ts +9 -0
- package/package.json +17 -16
- package/readme.md +0 -18
- 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 -119
- package/dist/collection/components/molecules/menu/mg-menu-item/doc/mg-menu-item.stories.js +0 -34
- 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 -53
- 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/mg-components/p-182bd802.js +0 -2
- package/dist/mg-components/p-f7da9dd2.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 -22
- 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,32 @@ 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 {
|
|
17
|
+
import { IconType, SizeType, SlotLabelType } from "./components/molecules/mg-item-more/mg-item-more.conf";
|
|
18
|
+
import { Direction, ItemMoreType, MenuSizeType } from "./components/molecules/menu/mg-menu/mg-menu.conf";
|
|
17
19
|
import { Status } from "./components/molecules/menu/mg-menu-item/mg-menu-item.conf";
|
|
18
20
|
import { Placement } from "@popperjs/core";
|
|
19
21
|
import { SkipLink } from "./components/molecules/mg-skip-links/mg-skip-links.conf";
|
|
20
|
-
import { SizeType, TabItem } from "./components/molecules/mg-tabs/mg-tabs.conf";
|
|
22
|
+
import { SizeType as SizeType1, TabItem } from "./components/molecules/mg-tabs/mg-tabs.conf";
|
|
21
23
|
import { TagVariantType } from "./components/atoms/mg-tag/mg-tag.conf";
|
|
22
24
|
export namespace Components {
|
|
25
|
+
interface MgActionMore {
|
|
26
|
+
/**
|
|
27
|
+
* Define button properties Default: {variant: 'flat', isIcon: true}.
|
|
28
|
+
*/
|
|
29
|
+
"button": MgActionMoreButtonType;
|
|
30
|
+
/**
|
|
31
|
+
* Define if chevron is display
|
|
32
|
+
*/
|
|
33
|
+
"displayChevron": boolean;
|
|
34
|
+
/**
|
|
35
|
+
* Define displaied icon Default: {icon: 'ellipsis'}
|
|
36
|
+
*/
|
|
37
|
+
"icon": MgActionMoreIconType;
|
|
38
|
+
/**
|
|
39
|
+
* Define the menu-items elements
|
|
40
|
+
*/
|
|
41
|
+
"items": MgActionMoreItemType[];
|
|
42
|
+
}
|
|
23
43
|
interface MgBadge {
|
|
24
44
|
/**
|
|
25
45
|
* Badge label. Include short description. Required for accessibility
|
|
@@ -865,19 +885,33 @@ export namespace Components {
|
|
|
865
885
|
*/
|
|
866
886
|
"value": any;
|
|
867
887
|
}
|
|
888
|
+
interface MgItemMore {
|
|
889
|
+
/**
|
|
890
|
+
* Define icon Default: {icon: 'ellipsis-vertical'}
|
|
891
|
+
*/
|
|
892
|
+
"icon": IconType;
|
|
893
|
+
/**
|
|
894
|
+
* Define component child menu size.
|
|
895
|
+
*/
|
|
896
|
+
"size": SizeType;
|
|
897
|
+
/**
|
|
898
|
+
* Define slot label element Default: {display: false}
|
|
899
|
+
*/
|
|
900
|
+
"slotlabel": SlotLabelType;
|
|
901
|
+
}
|
|
868
902
|
interface MgMenu {
|
|
869
903
|
/**
|
|
870
904
|
* Component display direction. Default: "horizontal"
|
|
871
905
|
*/
|
|
872
906
|
"direction": Direction;
|
|
873
907
|
/**
|
|
874
|
-
*
|
|
908
|
+
* Customize "mg-item-more" element Used with direction: 'vertical' to manage overflow
|
|
875
909
|
*/
|
|
876
|
-
"
|
|
910
|
+
"itemMore": ItemMoreType;
|
|
877
911
|
/**
|
|
878
|
-
*
|
|
912
|
+
* Menu label. Include short menu description. Required for accessibility
|
|
879
913
|
*/
|
|
880
|
-
"
|
|
914
|
+
"label": string;
|
|
881
915
|
/**
|
|
882
916
|
* Define mg-menu size Default: 'regular'
|
|
883
917
|
*/
|
|
@@ -892,6 +926,10 @@ export namespace Components {
|
|
|
892
926
|
* Define menu-item href when defined menu-item contain an anchor instead of button
|
|
893
927
|
*/
|
|
894
928
|
"href": string;
|
|
929
|
+
/**
|
|
930
|
+
* Identifier is used to control mg-popover Default: createID('mg-menu-item');
|
|
931
|
+
*/
|
|
932
|
+
"identifier": string;
|
|
895
933
|
/**
|
|
896
934
|
* Define menu-item status. Default: "visible"
|
|
897
935
|
*/
|
|
@@ -942,6 +980,10 @@ export namespace Components {
|
|
|
942
980
|
* Component current page
|
|
943
981
|
*/
|
|
944
982
|
"currentPage": number;
|
|
983
|
+
/**
|
|
984
|
+
* Hide navigation label
|
|
985
|
+
*/
|
|
986
|
+
"hideNavigationLabels": boolean;
|
|
945
987
|
/**
|
|
946
988
|
* Identifier is used for the element ID (id is a reserved prop in Stencil.js) If not set, it will be created.
|
|
947
989
|
*/
|
|
@@ -1037,7 +1079,7 @@ export namespace Components {
|
|
|
1037
1079
|
/**
|
|
1038
1080
|
* Define tabs size
|
|
1039
1081
|
*/
|
|
1040
|
-
"size":
|
|
1082
|
+
"size": SizeType1;
|
|
1041
1083
|
}
|
|
1042
1084
|
interface MgTag {
|
|
1043
1085
|
/**
|
|
@@ -1076,6 +1118,10 @@ export namespace Components {
|
|
|
1076
1118
|
"placement": Placement;
|
|
1077
1119
|
}
|
|
1078
1120
|
}
|
|
1121
|
+
export interface MgButtonCustomEvent<T> extends CustomEvent<T> {
|
|
1122
|
+
detail: T;
|
|
1123
|
+
target: HTMLMgButtonElement;
|
|
1124
|
+
}
|
|
1079
1125
|
export interface MgDetailsCustomEvent<T> extends CustomEvent<T> {
|
|
1080
1126
|
detail: T;
|
|
1081
1127
|
target: HTMLMgDetailsElement;
|
|
@@ -1153,6 +1199,12 @@ export interface MgTabsCustomEvent<T> extends CustomEvent<T> {
|
|
|
1153
1199
|
target: HTMLMgTabsElement;
|
|
1154
1200
|
}
|
|
1155
1201
|
declare global {
|
|
1202
|
+
interface HTMLMgActionMoreElement extends Components.MgActionMore, HTMLStencilElement {
|
|
1203
|
+
}
|
|
1204
|
+
var HTMLMgActionMoreElement: {
|
|
1205
|
+
prototype: HTMLMgActionMoreElement;
|
|
1206
|
+
new (): HTMLMgActionMoreElement;
|
|
1207
|
+
};
|
|
1156
1208
|
interface HTMLMgBadgeElement extends Components.MgBadge, HTMLStencilElement {
|
|
1157
1209
|
}
|
|
1158
1210
|
var HTMLMgBadgeElement: {
|
|
@@ -1267,6 +1319,12 @@ declare global {
|
|
|
1267
1319
|
prototype: HTMLMgInputToggleElement;
|
|
1268
1320
|
new (): HTMLMgInputToggleElement;
|
|
1269
1321
|
};
|
|
1322
|
+
interface HTMLMgItemMoreElement extends Components.MgItemMore, HTMLStencilElement {
|
|
1323
|
+
}
|
|
1324
|
+
var HTMLMgItemMoreElement: {
|
|
1325
|
+
prototype: HTMLMgItemMoreElement;
|
|
1326
|
+
new (): HTMLMgItemMoreElement;
|
|
1327
|
+
};
|
|
1270
1328
|
interface HTMLMgMenuElement extends Components.MgMenu, HTMLStencilElement {
|
|
1271
1329
|
}
|
|
1272
1330
|
var HTMLMgMenuElement: {
|
|
@@ -1334,6 +1392,7 @@ declare global {
|
|
|
1334
1392
|
new (): HTMLMgTooltipElement;
|
|
1335
1393
|
};
|
|
1336
1394
|
interface HTMLElementTagNameMap {
|
|
1395
|
+
"mg-action-more": HTMLMgActionMoreElement;
|
|
1337
1396
|
"mg-badge": HTMLMgBadgeElement;
|
|
1338
1397
|
"mg-button": HTMLMgButtonElement;
|
|
1339
1398
|
"mg-card": HTMLMgCardElement;
|
|
@@ -1353,6 +1412,7 @@ declare global {
|
|
|
1353
1412
|
"mg-input-textarea": HTMLMgInputTextareaElement;
|
|
1354
1413
|
"mg-input-title": HTMLMgInputTitleElement;
|
|
1355
1414
|
"mg-input-toggle": HTMLMgInputToggleElement;
|
|
1415
|
+
"mg-item-more": HTMLMgItemMoreElement;
|
|
1356
1416
|
"mg-menu": HTMLMgMenuElement;
|
|
1357
1417
|
"mg-menu-item": HTMLMgMenuItemElement;
|
|
1358
1418
|
"mg-message": HTMLMgMessageElement;
|
|
@@ -1367,6 +1427,24 @@ declare global {
|
|
|
1367
1427
|
}
|
|
1368
1428
|
}
|
|
1369
1429
|
declare namespace LocalJSX {
|
|
1430
|
+
interface MgActionMore {
|
|
1431
|
+
/**
|
|
1432
|
+
* Define button properties Default: {variant: 'flat', isIcon: true}.
|
|
1433
|
+
*/
|
|
1434
|
+
"button"?: MgActionMoreButtonType;
|
|
1435
|
+
/**
|
|
1436
|
+
* Define if chevron is display
|
|
1437
|
+
*/
|
|
1438
|
+
"displayChevron"?: boolean;
|
|
1439
|
+
/**
|
|
1440
|
+
* Define displaied icon Default: {icon: 'ellipsis'}
|
|
1441
|
+
*/
|
|
1442
|
+
"icon"?: MgActionMoreIconType;
|
|
1443
|
+
/**
|
|
1444
|
+
* Define the menu-items elements
|
|
1445
|
+
*/
|
|
1446
|
+
"items": MgActionMoreItemType[];
|
|
1447
|
+
}
|
|
1370
1448
|
interface MgBadge {
|
|
1371
1449
|
/**
|
|
1372
1450
|
* Badge label. Include short description. Required for accessibility
|
|
@@ -1414,6 +1492,10 @@ declare namespace LocalJSX {
|
|
|
1414
1492
|
* aria-label In case button text is not explicit enough
|
|
1415
1493
|
*/
|
|
1416
1494
|
"label"?: string;
|
|
1495
|
+
/**
|
|
1496
|
+
* Emmited event when disabled change
|
|
1497
|
+
*/
|
|
1498
|
+
"onDisabled-change"?: (event: MgButtonCustomEvent<MgButton['disabled']>) => void;
|
|
1417
1499
|
/**
|
|
1418
1500
|
* Define button type
|
|
1419
1501
|
*/
|
|
@@ -2246,19 +2328,33 @@ declare namespace LocalJSX {
|
|
|
2246
2328
|
*/
|
|
2247
2329
|
"value"?: any;
|
|
2248
2330
|
}
|
|
2331
|
+
interface MgItemMore {
|
|
2332
|
+
/**
|
|
2333
|
+
* Define icon Default: {icon: 'ellipsis-vertical'}
|
|
2334
|
+
*/
|
|
2335
|
+
"icon"?: IconType;
|
|
2336
|
+
/**
|
|
2337
|
+
* Define component child menu size.
|
|
2338
|
+
*/
|
|
2339
|
+
"size"?: SizeType;
|
|
2340
|
+
/**
|
|
2341
|
+
* Define slot label element Default: {display: false}
|
|
2342
|
+
*/
|
|
2343
|
+
"slotlabel"?: SlotLabelType;
|
|
2344
|
+
}
|
|
2249
2345
|
interface MgMenu {
|
|
2250
2346
|
/**
|
|
2251
2347
|
* Component display direction. Default: "horizontal"
|
|
2252
2348
|
*/
|
|
2253
2349
|
"direction"?: Direction;
|
|
2254
2350
|
/**
|
|
2255
|
-
*
|
|
2351
|
+
* Customize "mg-item-more" element Used with direction: 'vertical' to manage overflow
|
|
2256
2352
|
*/
|
|
2257
|
-
"
|
|
2353
|
+
"itemMore"?: ItemMoreType;
|
|
2258
2354
|
/**
|
|
2259
|
-
*
|
|
2355
|
+
* Menu label. Include short menu description. Required for accessibility
|
|
2260
2356
|
*/
|
|
2261
|
-
"
|
|
2357
|
+
"label": string;
|
|
2262
2358
|
/**
|
|
2263
2359
|
* Define mg-menu size Default: 'regular'
|
|
2264
2360
|
*/
|
|
@@ -2273,6 +2369,10 @@ declare namespace LocalJSX {
|
|
|
2273
2369
|
* Define menu-item href when defined menu-item contain an anchor instead of button
|
|
2274
2370
|
*/
|
|
2275
2371
|
"href"?: string;
|
|
2372
|
+
/**
|
|
2373
|
+
* Identifier is used to control mg-popover Default: createID('mg-menu-item');
|
|
2374
|
+
*/
|
|
2375
|
+
"identifier"?: string;
|
|
2276
2376
|
/**
|
|
2277
2377
|
* Emited event when status change
|
|
2278
2378
|
*/
|
|
@@ -2343,6 +2443,10 @@ declare namespace LocalJSX {
|
|
|
2343
2443
|
* Component current page
|
|
2344
2444
|
*/
|
|
2345
2445
|
"currentPage"?: number;
|
|
2446
|
+
/**
|
|
2447
|
+
* Hide navigation label
|
|
2448
|
+
*/
|
|
2449
|
+
"hideNavigationLabels"?: boolean;
|
|
2346
2450
|
/**
|
|
2347
2451
|
* Identifier is used for the element ID (id is a reserved prop in Stencil.js) If not set, it will be created.
|
|
2348
2452
|
*/
|
|
@@ -2462,7 +2566,7 @@ declare namespace LocalJSX {
|
|
|
2462
2566
|
/**
|
|
2463
2567
|
* Define tabs size
|
|
2464
2568
|
*/
|
|
2465
|
-
"size"?:
|
|
2569
|
+
"size"?: SizeType1;
|
|
2466
2570
|
}
|
|
2467
2571
|
interface MgTag {
|
|
2468
2572
|
/**
|
|
@@ -2501,6 +2605,7 @@ declare namespace LocalJSX {
|
|
|
2501
2605
|
"placement"?: Placement;
|
|
2502
2606
|
}
|
|
2503
2607
|
interface IntrinsicElements {
|
|
2608
|
+
"mg-action-more": MgActionMore;
|
|
2504
2609
|
"mg-badge": MgBadge;
|
|
2505
2610
|
"mg-button": MgButton;
|
|
2506
2611
|
"mg-card": MgCard;
|
|
@@ -2520,6 +2625,7 @@ declare namespace LocalJSX {
|
|
|
2520
2625
|
"mg-input-textarea": MgInputTextarea;
|
|
2521
2626
|
"mg-input-title": MgInputTitle;
|
|
2522
2627
|
"mg-input-toggle": MgInputToggle;
|
|
2628
|
+
"mg-item-more": MgItemMore;
|
|
2523
2629
|
"mg-menu": MgMenu;
|
|
2524
2630
|
"mg-menu-item": MgMenuItem;
|
|
2525
2631
|
"mg-message": MgMessage;
|
|
@@ -2537,6 +2643,7 @@ export { LocalJSX as JSX };
|
|
|
2537
2643
|
declare module "@stencil/core" {
|
|
2538
2644
|
export namespace JSX {
|
|
2539
2645
|
interface IntrinsicElements {
|
|
2646
|
+
"mg-action-more": LocalJSX.MgActionMore & JSXBase.HTMLAttributes<HTMLMgActionMoreElement>;
|
|
2540
2647
|
"mg-badge": LocalJSX.MgBadge & JSXBase.HTMLAttributes<HTMLMgBadgeElement>;
|
|
2541
2648
|
"mg-button": LocalJSX.MgButton & JSXBase.HTMLAttributes<HTMLMgButtonElement>;
|
|
2542
2649
|
"mg-card": LocalJSX.MgCard & JSXBase.HTMLAttributes<HTMLMgCardElement>;
|
|
@@ -2556,6 +2663,7 @@ declare module "@stencil/core" {
|
|
|
2556
2663
|
"mg-input-textarea": LocalJSX.MgInputTextarea & JSXBase.HTMLAttributes<HTMLMgInputTextareaElement>;
|
|
2557
2664
|
"mg-input-title": LocalJSX.MgInputTitle & JSXBase.HTMLAttributes<HTMLMgInputTitleElement>;
|
|
2558
2665
|
"mg-input-toggle": LocalJSX.MgInputToggle & JSXBase.HTMLAttributes<HTMLMgInputToggleElement>;
|
|
2666
|
+
"mg-item-more": LocalJSX.MgItemMore & JSXBase.HTMLAttributes<HTMLMgItemMoreElement>;
|
|
2559
2667
|
"mg-menu": LocalJSX.MgMenu & JSXBase.HTMLAttributes<HTMLMgMenuElement>;
|
|
2560
2668
|
"mg-menu-item": LocalJSX.MgMenuItem & JSXBase.HTMLAttributes<HTMLMgMenuItemElement>;
|
|
2561
2669
|
"mg-message": LocalJSX.MgMessage & JSXBase.HTMLAttributes<HTMLMgMessageElement>;
|
|
@@ -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;
|
|
@@ -55,6 +57,9 @@ declare const messages: {
|
|
|
55
57
|
moreLabel: string;
|
|
56
58
|
badgeLabel: string;
|
|
57
59
|
};
|
|
60
|
+
actionMore: {
|
|
61
|
+
label: string;
|
|
62
|
+
};
|
|
58
63
|
};
|
|
59
64
|
fr: {
|
|
60
65
|
errors: {
|
|
@@ -79,7 +84,9 @@ declare const messages: {
|
|
|
79
84
|
};
|
|
80
85
|
form: {
|
|
81
86
|
required: string;
|
|
87
|
+
requiredSingle: string;
|
|
82
88
|
allRequired: string;
|
|
89
|
+
allRequiredSingle: string;
|
|
83
90
|
};
|
|
84
91
|
message: {
|
|
85
92
|
closeButton: string;
|
|
@@ -112,16 +119,19 @@ declare const messages: {
|
|
|
112
119
|
moreLabel: string;
|
|
113
120
|
badgeLabel: string;
|
|
114
121
|
};
|
|
122
|
+
actionMore: {
|
|
123
|
+
label: string;
|
|
124
|
+
};
|
|
115
125
|
};
|
|
116
126
|
};
|
|
117
127
|
/**
|
|
118
128
|
* Get Intl object
|
|
119
129
|
*
|
|
120
130
|
* @param {HTMLElement} element element we need to get the language
|
|
121
|
-
* @returns {{ locale: string; messages: unknown }} messages object
|
|
131
|
+
* @returns {{ locale: string; messages: Record<string, unknown> }} messages object
|
|
122
132
|
*/
|
|
123
133
|
export declare const initLocales: (element: HTMLElement) => {
|
|
124
134
|
locale: string;
|
|
125
|
-
messages: unknown
|
|
135
|
+
messages: Record<string, unknown>;
|
|
126
136
|
};
|
|
127
137
|
export {};
|
|
@@ -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
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
export declare enum OverflowBehaviorElements {
|
|
2
|
-
MORE = "data-overflow-more",
|
|
3
2
|
BASE_INDEX = "data-overflow-base-index",
|
|
4
3
|
PROXY_INDEX = "data-overflow-proxy-index"
|
|
5
4
|
}
|
|
6
5
|
export declare class OverflowBehavior {
|
|
7
6
|
private element;
|
|
8
7
|
private render;
|
|
9
|
-
private
|
|
10
|
-
private
|
|
11
|
-
private
|
|
8
|
+
private _resizeObserver;
|
|
9
|
+
private _moreElement;
|
|
10
|
+
private _baseChildren;
|
|
11
|
+
private _proxyChildren;
|
|
12
12
|
constructor(element: Element, render: () => HTMLElement);
|
|
13
13
|
/**********
|
|
14
14
|
* Public *
|
|
@@ -19,22 +19,23 @@ export declare class OverflowBehavior {
|
|
|
19
19
|
* @returns {void}
|
|
20
20
|
*/
|
|
21
21
|
disconnect: () => void;
|
|
22
|
-
/**
|
|
23
|
-
* Update more element status if active child
|
|
24
|
-
*
|
|
25
|
-
* @returns {void}
|
|
26
|
-
*/
|
|
27
|
-
updateActiveStatus: () => void;
|
|
28
22
|
/************
|
|
29
23
|
* Internal *
|
|
30
24
|
************/
|
|
31
25
|
/**
|
|
32
26
|
* run overflow behavior
|
|
33
27
|
*
|
|
34
|
-
* @param {number} width width of the container
|
|
28
|
+
* @param {number} width width of the container. Optional.
|
|
35
29
|
* @returns {void}
|
|
36
30
|
*/
|
|
37
31
|
private run;
|
|
32
|
+
/**
|
|
33
|
+
* Get interactive children filtred by authorized nodeName ['MG-MENU-ITEM', 'MG-BUTTON']
|
|
34
|
+
*
|
|
35
|
+
* @param {Element} element element to parse
|
|
36
|
+
* @returns {Element[]} children
|
|
37
|
+
*/
|
|
38
|
+
private getInteractiveItems;
|
|
38
39
|
/**
|
|
39
40
|
* Update displayed items in container from a given available space
|
|
40
41
|
*
|
|
@@ -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,7 +26,7 @@ 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
30
|
/**
|
|
31
31
|
* Get locale and messages
|
|
32
32
|
* We load the defined locale but for now we only support the first subtag for messages
|
|
@@ -34,9 +34,9 @@ export declare function localeDate(date: string, locale: string): string;
|
|
|
34
34
|
* @param {HTMLElement} element element we need to get the language
|
|
35
35
|
* @param {unknown} messages messages to use
|
|
36
36
|
* @param {string} defaultLocale default messages locale
|
|
37
|
-
* @returns {{ locale: string; messages: unknown }} messages object
|
|
37
|
+
* @returns {{ locale: string; messages: Record<string, unknown> }} messages object
|
|
38
38
|
*/
|
|
39
39
|
export declare const getLocaleMessages: (element: HTMLElement, messages: unknown, defaultLocale: string) => {
|
|
40
40
|
locale: string;
|
|
41
|
-
messages: unknown
|
|
41
|
+
messages: Record<string, unknown>;
|
|
42
42
|
};
|
|
@@ -70,9 +70,27 @@ export declare const setupResizeObserverMock: ({ disconnect, observe }: setupRes
|
|
|
70
70
|
/**
|
|
71
71
|
* force popover id when component use randomed identifier
|
|
72
72
|
*
|
|
73
|
-
* @param {Element}
|
|
73
|
+
* @param {Element} component element wich include mg-popover
|
|
74
74
|
* @param {string} id new fixed id
|
|
75
|
+
* @param {string} interactiveElement element where attribute 'aria-controls' is set
|
|
75
76
|
* @returns {void}
|
|
76
77
|
*/
|
|
77
|
-
export declare const forcePopoverId: (
|
|
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;
|
|
78
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;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mgdis/mg-components",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.8.0",
|
|
4
4
|
"description": "MG Components",
|
|
5
5
|
"packageManager": "pnpm@7.17.1",
|
|
6
6
|
"engineStrict": true,
|
|
@@ -29,49 +29,50 @@
|
|
|
29
29
|
},
|
|
30
30
|
"dependencies": {
|
|
31
31
|
"@popperjs/core": "^2.11.6",
|
|
32
|
-
"@stencil/core": "^2.
|
|
32
|
+
"@stencil/core": "^2.22.1",
|
|
33
33
|
"normalize.css": "^8.0.1"
|
|
34
34
|
},
|
|
35
35
|
"devDependencies": {
|
|
36
36
|
"@babel/core": "^7.20.12",
|
|
37
|
-
"@babel/plugin-transform-react-jsx": "^7.20.
|
|
37
|
+
"@babel/plugin-transform-react-jsx": "^7.20.13",
|
|
38
38
|
"@pxtrn/storybook-addon-docs-stencil": "^6.4.1",
|
|
39
39
|
"@stencil/eslint-plugin": "^0.4.0",
|
|
40
40
|
"@stencil/sass": "^1.5.2",
|
|
41
|
-
"@storybook/addon-a11y": "^6.5.
|
|
42
|
-
"@storybook/addon-actions": "^6.5.
|
|
43
|
-
"@storybook/addon-docs": "^6.5.
|
|
44
|
-
"@storybook/addon-essentials": "^6.5.
|
|
45
|
-
"@storybook/addon-links": "^6.5.
|
|
46
|
-
"@storybook/html": "^6.5.
|
|
41
|
+
"@storybook/addon-a11y": "^6.5.16",
|
|
42
|
+
"@storybook/addon-actions": "^6.5.16",
|
|
43
|
+
"@storybook/addon-docs": "^6.5.16",
|
|
44
|
+
"@storybook/addon-essentials": "^6.5.16",
|
|
45
|
+
"@storybook/addon-links": "^6.5.16",
|
|
46
|
+
"@storybook/html": "^6.5.16",
|
|
47
47
|
"@storybook/preset-scss": "^1.0.3",
|
|
48
48
|
"@types/jest": "^26.0.24",
|
|
49
49
|
"@types/jest-image-snapshot": "^4.3.2",
|
|
50
|
+
"@types/node": "^18.14.0",
|
|
50
51
|
"@typescript-eslint/eslint-plugin": "^4.33.0",
|
|
51
52
|
"@typescript-eslint/parser": "^4.33.0",
|
|
52
53
|
"babel-loader": "^8.3.0",
|
|
53
54
|
"babel-plugin-jsx-pragmatic": "^1.0.2",
|
|
54
|
-
"chromatic": "^6.
|
|
55
|
+
"chromatic": "^6.15.0",
|
|
55
56
|
"css-loader": "^5.2.7",
|
|
56
57
|
"eslint": "^7.32.0",
|
|
57
58
|
"eslint-plugin-jsdoc": "^38.1.6",
|
|
58
59
|
"eslint-plugin-jsx-a11y": "^6.7.1",
|
|
59
|
-
"eslint-plugin-react": "^7.32.
|
|
60
|
+
"eslint-plugin-react": "^7.32.2",
|
|
60
61
|
"eslint-plugin-storybook": "^0.6.10",
|
|
61
62
|
"husky": "^7.0.4",
|
|
62
63
|
"jest": "^26.6.3",
|
|
63
64
|
"jest-cli": "^26.6.3",
|
|
64
65
|
"jest-image-snapshot": "^4.5.1",
|
|
65
66
|
"jest-junit": "^13.2.0",
|
|
66
|
-
"jsx-dom": "^8.0.
|
|
67
|
+
"jsx-dom": "^8.0.4",
|
|
67
68
|
"npm-run-all": "^4.1.5",
|
|
68
|
-
"prettier": "^2.8.
|
|
69
|
+
"prettier": "^2.8.3",
|
|
69
70
|
"puppeteer": "^13.7.0",
|
|
70
|
-
"sass": "^1.
|
|
71
|
+
"sass": "^1.58.0",
|
|
71
72
|
"sass-loader": "^10.4.1",
|
|
72
73
|
"style-loader": "^2.0.0",
|
|
73
74
|
"ts-node": "^10.9.1",
|
|
74
|
-
"turbo": "^1.
|
|
75
|
+
"turbo": "^1.8.1",
|
|
75
76
|
"typescript": "~4.4.4"
|
|
76
77
|
},
|
|
77
78
|
"license": "BSD-3-Clause",
|
|
@@ -85,7 +86,7 @@
|
|
|
85
86
|
"lint:prettier": "prettier --check **/*.{ts,tsx,scss,html,mdx,json}",
|
|
86
87
|
"lint:prettier:fix": "prettier --write **/*.{ts,tsx,scss,html,mdx,json}",
|
|
87
88
|
"test": "TZ=UTC stencil test --spec --e2e",
|
|
88
|
-
"test:unit": "TZ=UTC stencil test --spec",
|
|
89
|
+
"test:unit": "TZ=UTC stencil test --spec --collectCoverage --reporters=\"default\" --reporters=\"jest-junit\"",
|
|
89
90
|
"test:e2e": "stencil test --e2e",
|
|
90
91
|
"test.watch": "stencil test --spec --e2e --watchAll",
|
|
91
92
|
"generate": "stencil generate",
|
package/readme.md
CHANGED
|
@@ -102,24 +102,6 @@ When a selector contains too many declaration it is recommended to organize them
|
|
|
102
102
|
}
|
|
103
103
|
```
|
|
104
104
|
|
|
105
|
-
### Accessibility
|
|
106
|
-
|
|
107
|
-
A good pratice is to manage hover, focus and active state at the same place.
|
|
108
|
-
|
|
109
|
-
```SCSS
|
|
110
|
-
/* SCSS */
|
|
111
|
-
button {
|
|
112
|
-
&:hover, &:focus, &:active {
|
|
113
|
-
text-decoration: underline;
|
|
114
|
-
}
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
/* CSS */
|
|
118
|
-
button:hover, button:focus, button:active {
|
|
119
|
-
text-decoration: underline;
|
|
120
|
-
}
|
|
121
|
-
```
|
|
122
|
-
|
|
123
105
|
## Storybook
|
|
124
106
|
|
|
125
107
|
The plugin [storybook-addon-docs-stencil
|
package/dist/.storybook/utils.js
DELETED
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
export const filterArgs = (args, defaultValues) => {
|
|
2
|
-
const filteredArgs = {};
|
|
3
|
-
for (const k in args) {
|
|
4
|
-
if (!k.startsWith('slot')) {
|
|
5
|
-
const arg = args[k];
|
|
6
|
-
// Change camelCase k to kebab-case
|
|
7
|
-
const key = k.replace(/([a-z])([A-Z])/g, '$1-$2').toLowerCase();
|
|
8
|
-
// Change value to boolean true value, will be replace during render
|
|
9
|
-
if (typeof arg === 'boolean' && arg === true) {
|
|
10
|
-
filteredArgs[key] = 'mg__storybook__boolean-true';
|
|
11
|
-
}
|
|
12
|
-
// Do not add args if is default value
|
|
13
|
-
else if (!defaultValues || !Object.keys(defaultValues).includes(k) || defaultValues[k] !== arg) {
|
|
14
|
-
filteredArgs[key] = arg;
|
|
15
|
-
}
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
// Add comment when args contain object, will be replace during render
|
|
19
|
-
const argsObjects = Object.entries(args).filter(arg => typeof arg[1] === 'object');
|
|
20
|
-
if (argsObjects.length > 0) {
|
|
21
|
-
filteredArgs['mg__storybook__comment'] = `/!\\ Object props are not rendered in the code example: ${argsObjects.map(([a]) => a).join(', ')}.`;
|
|
22
|
-
}
|
|
23
|
-
return filteredArgs;
|
|
24
|
-
};
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import { h } from '@stencil/core';
|
|
2
|
-
import { filterArgs } from '../../../../../.storybook/utils';
|
|
3
|
-
import { variants } from '../mg-badge.conf';
|
|
4
|
-
export default {
|
|
5
|
-
component: 'mg-badge',
|
|
6
|
-
title: 'Atoms/mg-badge',
|
|
7
|
-
argTypes: {
|
|
8
|
-
value: {
|
|
9
|
-
control: { type: 'text' },
|
|
10
|
-
},
|
|
11
|
-
},
|
|
12
|
-
};
|
|
13
|
-
/**
|
|
14
|
-
* Template
|
|
15
|
-
*
|
|
16
|
-
* @param {any} args component arguments
|
|
17
|
-
* @returns {HTMLElement} HTMLElement
|
|
18
|
-
*/
|
|
19
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
20
|
-
const Template = (args) => h("mg-badge", Object.assign({}, filterArgs(args, { variant: variants[0] })));
|
|
21
|
-
export const MgBadge = Template.bind({});
|
|
22
|
-
MgBadge.args = {
|
|
23
|
-
value: '99',
|
|
24
|
-
label: 'unread messages',
|
|
25
|
-
variant: variants[0],
|
|
26
|
-
outline: false,
|
|
27
|
-
};
|