@mgdis/mg-components 5.10.0 → 5.11.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-9e1091ab.js → index-03d2557d.js} +3 -0
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/mg-action-more_31.cjs.entry.js +444 -455
- package/dist/cjs/mg-components.cjs.js +2 -2
- package/dist/cjs/mg-item-more.cjs.entry.js +20 -29
- package/dist/cjs/{mg-menu.conf-1942ac70.js → mg-menu.conf-05ec32a3.js} +30 -16
- package/dist/collection/components/atoms/mg-badge/mg-badge.js +8 -9
- package/dist/collection/components/atoms/mg-button/mg-button.js +16 -20
- package/dist/collection/components/atoms/mg-card/mg-card.css +2 -0
- package/dist/collection/components/atoms/mg-card/mg-card.js +10 -12
- package/dist/collection/components/atoms/mg-character-left/mg-character-left.js +1 -2
- package/dist/collection/components/atoms/mg-divider/mg-divider.js +1 -1
- package/dist/collection/components/atoms/mg-icon/mg-icon.js +17 -19
- package/dist/collection/components/atoms/mg-input-title/mg-input-title.js +1 -2
- package/dist/collection/components/atoms/mg-tag/mg-tag.js +11 -13
- package/dist/collection/components/atoms/mg-tooltip/mg-tooltip.js +20 -25
- package/dist/collection/components/molecules/inputs/MgInput.conf.js +4 -1
- package/dist/collection/components/molecules/inputs/MgInput.js +26 -18
- package/dist/collection/components/molecules/inputs/mg-input-checkbox/mg-input-checkbox.conf.js +4 -1
- package/dist/collection/components/molecules/inputs/mg-input-checkbox/mg-input-checkbox.css +18 -1
- package/dist/collection/components/molecules/inputs/mg-input-checkbox/mg-input-checkbox.js +126 -19
- package/dist/collection/components/molecules/inputs/mg-input-date/mg-input-date.css +1 -1
- package/dist/collection/components/molecules/inputs/mg-input-date/mg-input-date.js +7 -12
- package/dist/collection/components/molecules/inputs/mg-input-numeric/mg-input-numeric.css +1 -1
- package/dist/collection/components/molecules/inputs/mg-input-numeric/mg-input-numeric.js +14 -22
- package/dist/collection/components/molecules/inputs/mg-input-password/mg-input-password.css +1 -1
- package/dist/collection/components/molecules/inputs/mg-input-password/mg-input-password.js +6 -10
- package/dist/collection/components/molecules/inputs/mg-input-radio/mg-input-radio.css +1 -1
- package/dist/collection/components/molecules/inputs/mg-input-radio/mg-input-radio.js +10 -18
- package/dist/collection/components/molecules/inputs/mg-input-select/mg-input-select.css +1 -1
- package/dist/collection/components/molecules/inputs/mg-input-select/mg-input-select.js +21 -32
- package/dist/collection/components/molecules/inputs/mg-input-text/mg-input-text.css +1 -1
- package/dist/collection/components/molecules/inputs/mg-input-text/mg-input-text.js +16 -31
- package/dist/collection/components/molecules/inputs/mg-input-textarea/mg-input-textarea.css +1 -1
- package/dist/collection/components/molecules/inputs/mg-input-textarea/mg-input-textarea.js +13 -17
- package/dist/collection/components/molecules/inputs/mg-input-toggle/mg-input-toggle.css +1 -1
- package/dist/collection/components/molecules/inputs/mg-input-toggle/mg-input-toggle.js +17 -23
- package/dist/collection/components/molecules/menu/mg-menu/mg-menu.js +11 -18
- package/dist/collection/components/molecules/menu/mg-menu-item/mg-menu-item.js +20 -29
- package/dist/collection/components/molecules/mg-action-more/mg-action-more.js +11 -15
- package/dist/collection/components/molecules/mg-details/mg-details.js +1 -3
- package/dist/collection/components/molecules/mg-form/mg-form.js +8 -19
- package/dist/collection/components/molecules/mg-illustrated-message/mg-illustrated-message.js +1 -2
- package/dist/collection/components/molecules/mg-item-more/mg-item-more.js +4 -7
- package/dist/collection/components/molecules/mg-message/mg-message.css +1 -0
- package/dist/collection/components/molecules/mg-message/mg-message.js +11 -14
- package/dist/collection/components/molecules/mg-modal/mg-modal.css +1 -0
- package/dist/collection/components/molecules/mg-modal/mg-modal.js +7 -11
- package/dist/collection/components/molecules/mg-pagination/mg-pagination.js +11 -13
- package/dist/collection/components/molecules/mg-panel/mg-panel.css +1 -0
- package/dist/collection/components/molecules/mg-panel/mg-panel.js +6 -15
- package/dist/collection/components/molecules/mg-popover/mg-popover.css +2 -0
- package/dist/collection/components/molecules/mg-popover/mg-popover.js +16 -16
- package/dist/collection/components/molecules/mg-skip-links/mg-skip-links.js +2 -4
- package/dist/collection/components/molecules/mg-tabs/mg-tabs.js +20 -24
- 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 -2
- package/dist/collection/styles/reset-mg-card-slotted-variables.scss +1 -0
- package/dist/collection/utils/behaviors.utils.js +16 -22
- package/dist/collection/utils/components.utils.js +21 -23
- package/dist/collection/utils/locale.utils.js +14 -14
- package/dist/collection/utils/unit.test.utils.js +7 -10
- package/dist/components/MgInput.js +30 -18
- package/dist/components/components.utils.js +21 -23
- package/dist/components/index2.js +30 -16
- package/dist/components/mg-action-more.js +9 -13
- package/dist/components/mg-badge2.js +8 -9
- package/dist/components/mg-button2.js +16 -20
- package/dist/components/mg-card2.js +9 -11
- package/dist/components/mg-character-left2.js +1 -2
- package/dist/components/mg-details.js +1 -3
- package/dist/components/mg-divider.js +1 -1
- package/dist/components/mg-form.js +7 -15
- package/dist/components/mg-icon2.js +17 -19
- package/dist/components/mg-illustrated-message.js +1 -2
- package/dist/components/mg-input-checkbox.js +126 -21
- package/dist/components/mg-input-date.js +7 -9
- package/dist/components/mg-input-numeric.js +14 -19
- package/dist/components/mg-input-password.js +6 -7
- package/dist/components/mg-input-radio.js +10 -15
- package/dist/components/mg-input-select2.js +21 -29
- package/dist/components/mg-input-text2.js +15 -24
- package/dist/components/mg-input-textarea.js +13 -14
- package/dist/components/mg-input-title2.js +1 -2
- package/dist/components/mg-input-toggle.js +17 -20
- package/dist/components/mg-item-more.js +18 -27
- package/dist/components/mg-menu-item2.js +17 -26
- package/dist/components/mg-menu2.js +9 -16
- package/dist/components/mg-message.js +12 -15
- package/dist/components/mg-modal.js +8 -12
- package/dist/components/mg-pagination.js +11 -13
- package/dist/components/mg-panel.js +7 -16
- package/dist/components/mg-popover2.js +17 -17
- package/dist/components/mg-skip-links.js +2 -4
- package/dist/components/mg-tabs.js +20 -24
- package/dist/components/mg-tag.js +11 -13
- package/dist/components/mg-tooltip2.js +20 -25
- package/dist/esm/{index-3249671d.js → index-407d5211.js} +3 -0
- package/dist/esm/loader.js +3 -3
- package/dist/esm/mg-action-more_31.entry.js +444 -455
- package/dist/esm/mg-components.js +3 -3
- package/dist/esm/mg-item-more.entry.js +20 -29
- package/dist/esm/{mg-menu.conf-2cc1bb67.js → mg-menu.conf-c8aa56ce.js} +30 -16
- 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-3bf533f7.js +2 -0
- package/dist/mg-components/p-51c2def3.entry.js +1 -0
- package/dist/mg-components/p-b14be68b.js +1 -0
- package/dist/mg-components/{p-a56a3157.entry.js → p-d3ed97d3.entry.js} +1 -1
- package/dist/mg-components/styles/reset-mg-card-slotted-variables.scss +1 -0
- package/dist/types/components/atoms/mg-badge/mg-badge.d.ts +2 -3
- package/dist/types/components/atoms/mg-button/mg-button.d.ts +5 -9
- package/dist/types/components/atoms/mg-card/mg-card.d.ts +2 -6
- package/dist/types/components/atoms/mg-character-left/mg-character-left.d.ts +1 -2
- package/dist/types/components/atoms/mg-divider/mg-divider.d.ts +1 -1
- package/dist/types/components/atoms/mg-icon/mg-icon.d.ts +3 -5
- package/dist/types/components/atoms/mg-input-title/mg-input-title.d.ts +1 -2
- package/dist/types/components/atoms/mg-tag/mg-tag.d.ts +3 -5
- package/dist/types/components/atoms/mg-tooltip/mg-tooltip.d.ts +15 -21
- package/dist/types/components/molecules/inputs/MgInput.conf.d.ts +2 -1
- package/dist/types/components/molecules/inputs/MgInput.d.ts +5 -5
- package/dist/types/components/molecules/inputs/mg-input-checkbox/mg-input-checkbox.conf.d.ts +8 -0
- package/dist/types/components/molecules/inputs/mg-input-checkbox/mg-input-checkbox.d.ts +40 -7
- package/dist/types/components/molecules/inputs/mg-input-date/mg-input-date.d.ts +4 -6
- package/dist/types/components/molecules/inputs/mg-input-numeric/mg-input-numeric.d.ts +7 -14
- package/dist/types/components/molecules/inputs/mg-input-password/mg-input-password.d.ts +3 -4
- package/dist/types/components/molecules/inputs/mg-input-radio/mg-input-radio.d.ts +5 -10
- 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-select/mg-input-select.d.ts +9 -13
- package/dist/types/components/molecules/inputs/mg-input-text/mg-input-text.d.ts +3 -12
- package/dist/types/components/molecules/inputs/mg-input-textarea/mg-input-textarea.d.ts +4 -5
- package/dist/types/components/molecules/inputs/mg-input-toggle/mg-input-toggle.d.ts +2 -6
- package/dist/types/components/molecules/menu/mg-menu/mg-menu.d.ts +10 -18
- package/dist/types/components/molecules/menu/mg-menu-item/mg-menu-item.d.ts +21 -31
- package/dist/types/components/molecules/mg-action-more/mg-action-more.d.ts +3 -10
- package/dist/types/components/molecules/mg-details/mg-details.d.ts +1 -3
- package/dist/types/components/molecules/mg-form/mg-form.d.ts +3 -11
- package/dist/types/components/molecules/mg-illustrated-message/mg-illustrated-message.d.ts +1 -2
- package/dist/types/components/molecules/mg-item-more/mg-item-more.d.ts +2 -7
- package/dist/types/components/molecules/mg-message/mg-message.d.ts +4 -7
- package/dist/types/components/molecules/mg-modal/mg-modal.d.ts +3 -7
- package/dist/types/components/molecules/mg-pagination/mg-pagination.d.ts +5 -9
- package/dist/types/components/molecules/mg-panel/mg-panel.d.ts +4 -13
- package/dist/types/components/molecules/mg-popover/mg-popover.d.ts +7 -9
- package/dist/types/components/molecules/mg-skip-links/mg-skip-links.d.ts +2 -4
- package/dist/types/components/molecules/mg-tabs/mg-tabs.d.ts +15 -19
- package/dist/types/components.d.ts +31 -35
- package/dist/types/locales/index.d.ts +16 -2
- package/dist/types/utils/behaviors.utils.d.ts +14 -20
- package/dist/types/utils/components.utils.d.ts +18 -20
- package/dist/types/utils/locale.utils.d.ts +14 -14
- package/dist/types/utils/unit.test.utils.d.ts +11 -17
- package/package.json +4 -4
- package/dist/mg-components/p-73156ac9.js +0 -1
- package/dist/mg-components/p-8fbc0d87.js +0 -2
- package/dist/mg-components/p-eb32bb18.entry.js +0 -1
|
@@ -10,7 +10,7 @@ import { BadgeVariantType } from "./components/atoms/mg-badge/mg-badge.conf";
|
|
|
10
10
|
import { ButtonType, VariantType } from "./components/atoms/mg-button/mg-button.conf";
|
|
11
11
|
import { VariantStyleType, VariantType as VariantType1 } from "./components/atoms/mg-card/mg-card.conf";
|
|
12
12
|
import { IconSizeType, IconVariantStyleType, IconVariantType } from "./components/atoms/mg-icon/mg-icon.conf";
|
|
13
|
-
import { CheckboxValue } from "./components/molecules/inputs/mg-input-checkbox/mg-input-checkbox.conf";
|
|
13
|
+
import { CheckboxType, CheckboxValue } from "./components/molecules/inputs/mg-input-checkbox/mg-input-checkbox.conf";
|
|
14
14
|
import { Width } from "./components/molecules/inputs/MgInput.conf";
|
|
15
15
|
import { RadioOption } from "./components/molecules/inputs/mg-input-radio/mg-input-radio.conf";
|
|
16
16
|
import { SelectOption } from "./components/molecules/inputs/mg-input-select/mg-input-select.conf";
|
|
@@ -26,7 +26,7 @@ import { TagVariantType } from "./components/atoms/mg-tag/mg-tag.conf";
|
|
|
26
26
|
export namespace Components {
|
|
27
27
|
interface MgActionMore {
|
|
28
28
|
/**
|
|
29
|
-
* Define button properties
|
|
29
|
+
* Define button properties
|
|
30
30
|
*/
|
|
31
31
|
"button": MgActionMoreButtonType;
|
|
32
32
|
/**
|
|
@@ -34,7 +34,7 @@ export namespace Components {
|
|
|
34
34
|
*/
|
|
35
35
|
"displayChevron": boolean;
|
|
36
36
|
/**
|
|
37
|
-
* Define displaied icon
|
|
37
|
+
* Define displaied icon
|
|
38
38
|
*/
|
|
39
39
|
"icon": MgActionMoreIconType;
|
|
40
40
|
/**
|
|
@@ -100,11 +100,11 @@ export namespace Components {
|
|
|
100
100
|
}
|
|
101
101
|
interface MgCard {
|
|
102
102
|
/**
|
|
103
|
-
* Define variant prop
|
|
103
|
+
* Define variant prop
|
|
104
104
|
*/
|
|
105
105
|
"variant": undefined | VariantType1;
|
|
106
106
|
/**
|
|
107
|
-
* Define variantStyle prop
|
|
107
|
+
* Define variantStyle prop
|
|
108
108
|
*/
|
|
109
109
|
"variantStyle": undefined | VariantStyleType;
|
|
110
110
|
}
|
|
@@ -153,7 +153,6 @@ export namespace Components {
|
|
|
153
153
|
"disabled": boolean;
|
|
154
154
|
/**
|
|
155
155
|
* Public method to display errors
|
|
156
|
-
* @returns
|
|
157
156
|
*/
|
|
158
157
|
"displayError": () => Promise<void>;
|
|
159
158
|
/**
|
|
@@ -216,7 +215,6 @@ export namespace Components {
|
|
|
216
215
|
"disabled": boolean;
|
|
217
216
|
/**
|
|
218
217
|
* Public method to display errors
|
|
219
|
-
* @returns
|
|
220
218
|
*/
|
|
221
219
|
"displayError": () => Promise<void>;
|
|
222
220
|
/**
|
|
@@ -263,6 +261,10 @@ export namespace Components {
|
|
|
263
261
|
* Add a tooltip message next to the input
|
|
264
262
|
*/
|
|
265
263
|
"tooltip": string;
|
|
264
|
+
/**
|
|
265
|
+
* Define checkbox type
|
|
266
|
+
*/
|
|
267
|
+
"type": CheckboxType;
|
|
266
268
|
/**
|
|
267
269
|
* Define input valid state
|
|
268
270
|
*/
|
|
@@ -279,7 +281,6 @@ export namespace Components {
|
|
|
279
281
|
"disabled": boolean;
|
|
280
282
|
/**
|
|
281
283
|
* Public method to display errors
|
|
282
|
-
* @returns
|
|
283
284
|
*/
|
|
284
285
|
"displayError": () => Promise<void>;
|
|
285
286
|
/**
|
|
@@ -354,7 +355,6 @@ export namespace Components {
|
|
|
354
355
|
"disabled": boolean;
|
|
355
356
|
/**
|
|
356
357
|
* Public method to display errors
|
|
357
|
-
* @returns
|
|
358
358
|
*/
|
|
359
359
|
"displayError": () => Promise<void>;
|
|
360
360
|
/**
|
|
@@ -437,7 +437,6 @@ export namespace Components {
|
|
|
437
437
|
"disabled": boolean;
|
|
438
438
|
/**
|
|
439
439
|
* Public method to display errors
|
|
440
|
-
* @returns
|
|
441
440
|
*/
|
|
442
441
|
"displayError": () => Promise<void>;
|
|
443
442
|
/**
|
|
@@ -504,7 +503,6 @@ export namespace Components {
|
|
|
504
503
|
"disabled": boolean;
|
|
505
504
|
/**
|
|
506
505
|
* Public method to display errors
|
|
507
|
-
* @returns
|
|
508
506
|
*/
|
|
509
507
|
"displayError": () => Promise<void>;
|
|
510
508
|
/**
|
|
@@ -571,7 +569,6 @@ export namespace Components {
|
|
|
571
569
|
"disabled": boolean;
|
|
572
570
|
/**
|
|
573
571
|
* Public method to display errors
|
|
574
|
-
* @returns
|
|
575
572
|
*/
|
|
576
573
|
"displayError": () => Promise<void>;
|
|
577
574
|
/**
|
|
@@ -654,7 +651,6 @@ export namespace Components {
|
|
|
654
651
|
"displayCharacterLeft": boolean;
|
|
655
652
|
/**
|
|
656
653
|
* Public method to display errors
|
|
657
|
-
* @returns
|
|
658
654
|
*/
|
|
659
655
|
"displayError": () => Promise<void>;
|
|
660
656
|
/**
|
|
@@ -719,7 +715,6 @@ export namespace Components {
|
|
|
719
715
|
"required": boolean;
|
|
720
716
|
/**
|
|
721
717
|
* Public method to play input focus
|
|
722
|
-
* @returns
|
|
723
718
|
*/
|
|
724
719
|
"setFocus": () => Promise<void>;
|
|
725
720
|
/**
|
|
@@ -750,7 +745,6 @@ export namespace Components {
|
|
|
750
745
|
"displayCharacterLeft": boolean;
|
|
751
746
|
/**
|
|
752
747
|
* Public method to display errors
|
|
753
|
-
* @returns
|
|
754
748
|
*/
|
|
755
749
|
"displayError": () => Promise<void>;
|
|
756
750
|
/**
|
|
@@ -867,7 +861,6 @@ export namespace Components {
|
|
|
867
861
|
"isOnOff": boolean;
|
|
868
862
|
/**
|
|
869
863
|
* Items are the possible options to select
|
|
870
|
-
* @returns
|
|
871
864
|
*/
|
|
872
865
|
"items": string[] | ToggleValue[];
|
|
873
866
|
/**
|
|
@@ -901,7 +894,7 @@ export namespace Components {
|
|
|
901
894
|
}
|
|
902
895
|
interface MgItemMore {
|
|
903
896
|
/**
|
|
904
|
-
* Define icon
|
|
897
|
+
* Define icon
|
|
905
898
|
*/
|
|
906
899
|
"icon": IconType;
|
|
907
900
|
/**
|
|
@@ -909,13 +902,13 @@ export namespace Components {
|
|
|
909
902
|
*/
|
|
910
903
|
"size": SizeType;
|
|
911
904
|
/**
|
|
912
|
-
* Define slot label element
|
|
905
|
+
* Define slot label element
|
|
913
906
|
*/
|
|
914
907
|
"slotlabel": SlotLabelType;
|
|
915
908
|
}
|
|
916
909
|
interface MgMenu {
|
|
917
910
|
/**
|
|
918
|
-
* Component display direction.
|
|
911
|
+
* Component display direction.
|
|
919
912
|
*/
|
|
920
913
|
"direction": Direction;
|
|
921
914
|
/**
|
|
@@ -927,13 +920,13 @@ export namespace Components {
|
|
|
927
920
|
*/
|
|
928
921
|
"label": string;
|
|
929
922
|
/**
|
|
930
|
-
* Define mg-menu size
|
|
923
|
+
* Define mg-menu size
|
|
931
924
|
*/
|
|
932
925
|
"size": MenuSizeType;
|
|
933
926
|
}
|
|
934
927
|
interface MgMenuItem {
|
|
935
928
|
/**
|
|
936
|
-
* Define menu-item content expanded.
|
|
929
|
+
* Define menu-item content expanded.
|
|
937
930
|
*/
|
|
938
931
|
"expanded": boolean;
|
|
939
932
|
/**
|
|
@@ -941,11 +934,11 @@ export namespace Components {
|
|
|
941
934
|
*/
|
|
942
935
|
"href": string;
|
|
943
936
|
/**
|
|
944
|
-
* Identifier is used to control mg-popover
|
|
937
|
+
* Identifier is used to control mg-popover
|
|
945
938
|
*/
|
|
946
939
|
"identifier": string;
|
|
947
940
|
/**
|
|
948
|
-
* Define menu-item status.
|
|
941
|
+
* Define menu-item status.
|
|
949
942
|
*/
|
|
950
943
|
"status": Status;
|
|
951
944
|
}
|
|
@@ -1443,7 +1436,7 @@ declare global {
|
|
|
1443
1436
|
declare namespace LocalJSX {
|
|
1444
1437
|
interface MgActionMore {
|
|
1445
1438
|
/**
|
|
1446
|
-
* Define button properties
|
|
1439
|
+
* Define button properties
|
|
1447
1440
|
*/
|
|
1448
1441
|
"button"?: MgActionMoreButtonType;
|
|
1449
1442
|
/**
|
|
@@ -1451,7 +1444,7 @@ declare namespace LocalJSX {
|
|
|
1451
1444
|
*/
|
|
1452
1445
|
"displayChevron"?: boolean;
|
|
1453
1446
|
/**
|
|
1454
|
-
* Define displaied icon
|
|
1447
|
+
* Define displaied icon
|
|
1455
1448
|
*/
|
|
1456
1449
|
"icon"?: MgActionMoreIconType;
|
|
1457
1450
|
/**
|
|
@@ -1521,11 +1514,11 @@ declare namespace LocalJSX {
|
|
|
1521
1514
|
}
|
|
1522
1515
|
interface MgCard {
|
|
1523
1516
|
/**
|
|
1524
|
-
* Define variant prop
|
|
1517
|
+
* Define variant prop
|
|
1525
1518
|
*/
|
|
1526
1519
|
"variant"?: undefined | VariantType1;
|
|
1527
1520
|
/**
|
|
1528
|
-
* Define variantStyle prop
|
|
1521
|
+
* Define variantStyle prop
|
|
1529
1522
|
*/
|
|
1530
1523
|
"variantStyle"?: undefined | VariantStyleType;
|
|
1531
1524
|
}
|
|
@@ -1694,6 +1687,10 @@ declare namespace LocalJSX {
|
|
|
1694
1687
|
* Add a tooltip message next to the input
|
|
1695
1688
|
*/
|
|
1696
1689
|
"tooltip"?: string;
|
|
1690
|
+
/**
|
|
1691
|
+
* Define checkbox type
|
|
1692
|
+
*/
|
|
1693
|
+
"type"?: CheckboxType;
|
|
1697
1694
|
/**
|
|
1698
1695
|
* Define input valid state
|
|
1699
1696
|
*/
|
|
@@ -2314,7 +2311,6 @@ declare namespace LocalJSX {
|
|
|
2314
2311
|
"isOnOff"?: boolean;
|
|
2315
2312
|
/**
|
|
2316
2313
|
* Items are the possible options to select
|
|
2317
|
-
* @returns
|
|
2318
2314
|
*/
|
|
2319
2315
|
"items": string[] | ToggleValue[];
|
|
2320
2316
|
/**
|
|
@@ -2356,7 +2352,7 @@ declare namespace LocalJSX {
|
|
|
2356
2352
|
}
|
|
2357
2353
|
interface MgItemMore {
|
|
2358
2354
|
/**
|
|
2359
|
-
* Define icon
|
|
2355
|
+
* Define icon
|
|
2360
2356
|
*/
|
|
2361
2357
|
"icon"?: IconType;
|
|
2362
2358
|
/**
|
|
@@ -2364,13 +2360,13 @@ declare namespace LocalJSX {
|
|
|
2364
2360
|
*/
|
|
2365
2361
|
"size"?: SizeType;
|
|
2366
2362
|
/**
|
|
2367
|
-
* Define slot label element
|
|
2363
|
+
* Define slot label element
|
|
2368
2364
|
*/
|
|
2369
2365
|
"slotlabel"?: SlotLabelType;
|
|
2370
2366
|
}
|
|
2371
2367
|
interface MgMenu {
|
|
2372
2368
|
/**
|
|
2373
|
-
* Component display direction.
|
|
2369
|
+
* Component display direction.
|
|
2374
2370
|
*/
|
|
2375
2371
|
"direction"?: Direction;
|
|
2376
2372
|
/**
|
|
@@ -2382,13 +2378,13 @@ declare namespace LocalJSX {
|
|
|
2382
2378
|
*/
|
|
2383
2379
|
"label": string;
|
|
2384
2380
|
/**
|
|
2385
|
-
* Define mg-menu size
|
|
2381
|
+
* Define mg-menu size
|
|
2386
2382
|
*/
|
|
2387
2383
|
"size"?: MenuSizeType;
|
|
2388
2384
|
}
|
|
2389
2385
|
interface MgMenuItem {
|
|
2390
2386
|
/**
|
|
2391
|
-
* Define menu-item content expanded.
|
|
2387
|
+
* Define menu-item content expanded.
|
|
2392
2388
|
*/
|
|
2393
2389
|
"expanded"?: boolean;
|
|
2394
2390
|
/**
|
|
@@ -2396,7 +2392,7 @@ declare namespace LocalJSX {
|
|
|
2396
2392
|
*/
|
|
2397
2393
|
"href"?: string;
|
|
2398
2394
|
/**
|
|
2399
|
-
* Identifier is used to control mg-popover
|
|
2395
|
+
* Identifier is used to control mg-popover
|
|
2400
2396
|
*/
|
|
2401
2397
|
"identifier"?: string;
|
|
2402
2398
|
/**
|
|
@@ -2408,7 +2404,7 @@ declare namespace LocalJSX {
|
|
|
2408
2404
|
*/
|
|
2409
2405
|
"onStatus-change"?: (event: MgMenuItemCustomEvent<MgMenuItem['status']>) => void;
|
|
2410
2406
|
/**
|
|
2411
|
-
* Define menu-item status.
|
|
2407
|
+
* Define menu-item status.
|
|
2412
2408
|
*/
|
|
2413
2409
|
"status"?: Status;
|
|
2414
2410
|
}
|
|
@@ -19,6 +19,13 @@ declare const messages: {
|
|
|
19
19
|
select: {
|
|
20
20
|
placeholder: string;
|
|
21
21
|
};
|
|
22
|
+
checkbox: {
|
|
23
|
+
selectedValues: string;
|
|
24
|
+
selectedValue: string;
|
|
25
|
+
editButton: string;
|
|
26
|
+
selectButton: string;
|
|
27
|
+
showButton: string;
|
|
28
|
+
};
|
|
22
29
|
};
|
|
23
30
|
form: {
|
|
24
31
|
required: string;
|
|
@@ -81,6 +88,13 @@ declare const messages: {
|
|
|
81
88
|
select: {
|
|
82
89
|
placeholder: string;
|
|
83
90
|
};
|
|
91
|
+
checkbox: {
|
|
92
|
+
selectedValues: string;
|
|
93
|
+
selectedValue: string;
|
|
94
|
+
editButton: string;
|
|
95
|
+
selectButton: string;
|
|
96
|
+
showButton: string;
|
|
97
|
+
};
|
|
84
98
|
};
|
|
85
99
|
form: {
|
|
86
100
|
required: string;
|
|
@@ -126,8 +140,8 @@ declare const messages: {
|
|
|
126
140
|
};
|
|
127
141
|
/**
|
|
128
142
|
* Get Intl object
|
|
129
|
-
* @param
|
|
130
|
-
* @returns
|
|
143
|
+
* @param element - element we need to get the language
|
|
144
|
+
* @returns messages object
|
|
131
145
|
*/
|
|
132
146
|
export declare const initLocales: (element: HTMLElement) => {
|
|
133
147
|
locale: string;
|
|
@@ -15,7 +15,6 @@ export declare class OverflowBehavior {
|
|
|
15
15
|
**********/
|
|
16
16
|
/**
|
|
17
17
|
* Disconnect ResizeObserver
|
|
18
|
-
* @returns {void}
|
|
19
18
|
*/
|
|
20
19
|
disconnect: () => void;
|
|
21
20
|
/************
|
|
@@ -23,53 +22,48 @@ export declare class OverflowBehavior {
|
|
|
23
22
|
************/
|
|
24
23
|
/**
|
|
25
24
|
* run overflow behavior
|
|
26
|
-
* @param
|
|
27
|
-
* @returns {void}
|
|
25
|
+
* @param width - width of the container. Optional.
|
|
28
26
|
*/
|
|
29
27
|
private run;
|
|
30
28
|
/**
|
|
31
29
|
* Get interactive children filtred by authorized nodeName ['MG-MENU-ITEM', 'MG-BUTTON']
|
|
32
|
-
* @param
|
|
33
|
-
* @returns
|
|
30
|
+
* @param element - element to parse
|
|
31
|
+
* @returns children
|
|
34
32
|
*/
|
|
35
33
|
private getInteractiveItems;
|
|
36
34
|
/**
|
|
37
35
|
* Update displayed items in container from a given available space
|
|
38
|
-
* @param
|
|
39
|
-
* @returns {void}
|
|
36
|
+
* @param availableWidth - available width in container to display child items
|
|
40
37
|
*/
|
|
41
38
|
private updateDisplayedItems;
|
|
42
39
|
/**
|
|
43
40
|
* Utility method to know if item overflow partialy or totaly in the container
|
|
44
|
-
* @param
|
|
45
|
-
* @param
|
|
46
|
-
* @param
|
|
47
|
-
* @returns
|
|
41
|
+
* @param cumulateWidth - previous sibling elements cumulate width + item width
|
|
42
|
+
* @param item - item HTML element
|
|
43
|
+
* @param availableWidth - container available width
|
|
44
|
+
* @returns truthy if element is overflow
|
|
48
45
|
*/
|
|
49
46
|
private isOverflowElement;
|
|
50
47
|
/**
|
|
51
48
|
* Utility method to know if a given element is the 'MORE' element
|
|
52
|
-
* @param
|
|
53
|
-
* @returns
|
|
49
|
+
* @param element - element to match with 'MORE' element
|
|
50
|
+
* @returns truthy if element is the 'MORE' element
|
|
54
51
|
*/
|
|
55
52
|
private isMoreElement;
|
|
56
53
|
/**
|
|
57
54
|
* Toggle display item element
|
|
58
|
-
* @param
|
|
59
|
-
* @param
|
|
60
|
-
* @returns {void}
|
|
55
|
+
* @param item - item to control
|
|
56
|
+
* @param isHidden - is item hidden
|
|
61
57
|
*/
|
|
62
58
|
private toggleItem;
|
|
63
59
|
/**
|
|
64
60
|
* Toggle element's hidde attribute
|
|
65
|
-
* @param
|
|
66
|
-
* @param
|
|
67
|
-
* @returns {void}
|
|
61
|
+
* @param element - element to toggle
|
|
62
|
+
* @param isHidden - element is hidden
|
|
68
63
|
*/
|
|
69
64
|
private toggleElement;
|
|
70
65
|
/**
|
|
71
66
|
* Remove hidden attributes on all items
|
|
72
|
-
* @returns {void}
|
|
73
67
|
*/
|
|
74
68
|
private restoreItems;
|
|
75
69
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Create random ID
|
|
3
|
-
* @param
|
|
4
|
-
* @param
|
|
5
|
-
* @returns
|
|
3
|
+
* @param prefix - add prefix to created ID
|
|
4
|
+
* @param length - ID length
|
|
5
|
+
* @returns ID
|
|
6
6
|
*/
|
|
7
7
|
export declare const createID: (prefix?: string, length?: number) => string;
|
|
8
8
|
/**
|
|
@@ -14,39 +14,37 @@ export declare class ClassList {
|
|
|
14
14
|
constructor(classlist?: string[]);
|
|
15
15
|
/**
|
|
16
16
|
* Add class
|
|
17
|
-
* @param
|
|
18
|
-
* @returns {void}
|
|
17
|
+
* @param className - class name to add
|
|
19
18
|
*/
|
|
20
19
|
add: (className: string) => void;
|
|
21
20
|
/**
|
|
22
21
|
* Delete class
|
|
23
|
-
* @param
|
|
24
|
-
* @returns {void}
|
|
22
|
+
* @param className - class name to delete
|
|
25
23
|
*/
|
|
26
24
|
delete: (className: string) => void;
|
|
27
25
|
/**
|
|
28
26
|
* Check if class exist in list
|
|
29
|
-
* @param
|
|
30
|
-
* @returns
|
|
27
|
+
* @param className - class name to check
|
|
28
|
+
* @returns class name is in the list
|
|
31
29
|
*/
|
|
32
30
|
has: (className: string) => boolean;
|
|
33
31
|
/**
|
|
34
32
|
* Join classes seperated by spaces
|
|
35
|
-
* @returns
|
|
33
|
+
* @returns joined values
|
|
36
34
|
*/
|
|
37
35
|
join: () => string;
|
|
38
36
|
}
|
|
39
37
|
/**
|
|
40
38
|
* Check if all items are string
|
|
41
|
-
* @param
|
|
42
|
-
* @returns
|
|
39
|
+
* @param items - items to check
|
|
40
|
+
* @returns all items are string
|
|
43
41
|
*/
|
|
44
42
|
export declare const allItemsAreString: (items: unknown) => items is string[];
|
|
45
43
|
/**
|
|
46
44
|
* Check if element is a heading
|
|
47
|
-
* @param
|
|
48
|
-
* @param
|
|
49
|
-
* @returns
|
|
45
|
+
* @param element - slotted element
|
|
46
|
+
* @param tagNames - allowed tag names list
|
|
47
|
+
* @returns element is a heading
|
|
50
48
|
*/
|
|
51
49
|
export declare const isTagName: (element: Element, tagNames: string[]) => boolean;
|
|
52
50
|
/**
|
|
@@ -55,14 +53,14 @@ export declare const isTagName: (element: Element, tagNames: string[]) => boolea
|
|
|
55
53
|
export declare const focusableElements = "a[href], button, input, textarea, select, details, [tabindex]:not([tabindex=\"-1\"]), [identifier]";
|
|
56
54
|
/**
|
|
57
55
|
* Get windows
|
|
58
|
-
* @param
|
|
59
|
-
* @returns
|
|
56
|
+
* @param localWindow - the window we are lookink for other windows
|
|
57
|
+
* @returns The list of windows found
|
|
60
58
|
*/
|
|
61
59
|
export declare const getWindows: (localWindow: Window) => Window[];
|
|
62
60
|
/**
|
|
63
61
|
* Get parent windows
|
|
64
|
-
* @param
|
|
65
|
-
* @param
|
|
66
|
-
* @returns
|
|
62
|
+
* @param localWindow - the window we are lookink for parents
|
|
63
|
+
* @param windows - The list of allready found windows
|
|
64
|
+
* @returns The list of windows found
|
|
67
65
|
*/
|
|
68
66
|
export declare const getParentWindows: (localWindow: Window, windows?: Window[]) => Window[];
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Format number to the locale currency
|
|
3
|
-
* @param
|
|
4
|
-
* @param
|
|
5
|
-
* @param
|
|
6
|
-
* @returns
|
|
3
|
+
* @param number - number to format
|
|
4
|
+
* @param locale - locale to apply
|
|
5
|
+
* @param currency - currency to apply
|
|
6
|
+
* @returns formatted currency
|
|
7
7
|
*/
|
|
8
8
|
export declare const localeCurrency: (number: number, locale: string, currency: string) => string;
|
|
9
9
|
/**
|
|
10
10
|
* Format number to locale
|
|
11
|
-
* @param
|
|
12
|
-
* @param
|
|
13
|
-
* @returns
|
|
11
|
+
* @param number - number to format
|
|
12
|
+
* @param locale - locale to apply
|
|
13
|
+
* @returns formatted number
|
|
14
14
|
*/
|
|
15
15
|
export declare const localeNumber: (number: number, locale: string) => string;
|
|
16
16
|
/**
|
|
@@ -19,18 +19,18 @@ export declare const localeNumber: (number: number, locale: string) => string;
|
|
|
19
19
|
export declare const dateRegExp: RegExp;
|
|
20
20
|
/**
|
|
21
21
|
* Locale date format
|
|
22
|
-
* @param
|
|
23
|
-
* @param
|
|
24
|
-
* @returns
|
|
22
|
+
* @param date - date to format
|
|
23
|
+
* @param locale - locale to apply
|
|
24
|
+
* @returns formatted date
|
|
25
25
|
*/
|
|
26
26
|
export declare const localeDate: (date: string, locale: string) => string;
|
|
27
27
|
/**
|
|
28
28
|
* Get locale and messages
|
|
29
29
|
* We load the defined locale but for now we only support the first subtag for messages
|
|
30
|
-
* @param
|
|
31
|
-
* @param
|
|
32
|
-
* @param
|
|
33
|
-
* @returns
|
|
30
|
+
* @param element - element we need to get the language
|
|
31
|
+
* @param messages - messages to use
|
|
32
|
+
* @param defaultLocale - default messages locale
|
|
33
|
+
* @returns messages object
|
|
34
34
|
*/
|
|
35
35
|
export declare const getLocaleMessages: (element: HTMLElement, messages: unknown, defaultLocale: string) => {
|
|
36
36
|
locale: string;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { MockCustomEvent } from '@stencil/core/mock-doc';
|
|
2
2
|
/**
|
|
3
3
|
* Clone Deep function
|
|
4
|
-
* @param
|
|
5
|
-
* @returns
|
|
4
|
+
* @param obj - object to clone
|
|
5
|
+
* @returns cloned json
|
|
6
6
|
*/
|
|
7
7
|
export declare const cloneDeep: (obj: unknown) => unknown;
|
|
8
8
|
/**
|
|
@@ -11,10 +11,8 @@ export declare const cloneDeep: (obj: unknown) => unknown;
|
|
|
11
11
|
* overwrite method. `jest.fn()` mock functions can be passed here if the goal is to not only
|
|
12
12
|
* mock the mutation observer, but its methods.
|
|
13
13
|
* You can manually fire an intersection entry:
|
|
14
|
-
* @param
|
|
15
|
-
* @
|
|
16
|
-
* @param {Function} mutationObserverMock.takeRecords takeRecords function
|
|
17
|
-
* @returns {MutationObserver} Mocked MutationObserver
|
|
14
|
+
* @param mutationObserverMock - configuration object
|
|
15
|
+
* @returns Mocked MutationObserver
|
|
18
16
|
* @example
|
|
19
17
|
* ```
|
|
20
18
|
* let fireMo;
|
|
@@ -39,9 +37,8 @@ export declare const setupMutationObserverMock: ({ disconnect, observe, takeReco
|
|
|
39
37
|
* overwrite method. `jest.fn()` mock functions can be passed here if the goal is to not only
|
|
40
38
|
* mock the resize observer, but its methods.
|
|
41
39
|
* You can manually fire an intersection entry:
|
|
42
|
-
* @param
|
|
43
|
-
* @
|
|
44
|
-
* @returns {ResizeObserver} Mocked ResizeObserver
|
|
40
|
+
* @param resizeObserverMock - configuration object
|
|
41
|
+
* @returns Mocked ResizeObserver
|
|
45
42
|
* @example
|
|
46
43
|
* ```
|
|
47
44
|
* let fireRo;
|
|
@@ -67,34 +64,31 @@ type setupResizeObserverMockParams = {
|
|
|
67
64
|
export declare const setupResizeObserverMock: ({ disconnect, observe }: setupResizeObserverMockParams) => typeof ResizeObserver;
|
|
68
65
|
/**
|
|
69
66
|
* Utility function that mocks the `SubmitEvent` API. Recommended to execute inside `beforeEach`.
|
|
70
|
-
* @returns {void}
|
|
71
67
|
* @example
|
|
72
68
|
* ```
|
|
73
69
|
* setupSubmitEventMock();
|
|
74
70
|
* ```
|
|
71
|
+
* @returns custom event mock
|
|
75
72
|
*/
|
|
76
73
|
export declare const setupSubmitEventMock: () => typeof MockCustomEvent;
|
|
77
74
|
/**
|
|
78
75
|
* force popover id when component use randomed identifier
|
|
79
|
-
* @param
|
|
80
|
-
* @param
|
|
81
|
-
* @param
|
|
82
|
-
* @returns {void}
|
|
76
|
+
* @param component - element wich include mg-popover
|
|
77
|
+
* @param id - new fixed id
|
|
78
|
+
* @param interactiveElement - element where attribute 'aria-controls' is set
|
|
83
79
|
*/
|
|
84
80
|
export declare const forcePopoverId: (component: Element, id: string, interactiveElement?: string) => void;
|
|
85
81
|
/**
|
|
86
82
|
* fix popper console.error in test
|
|
87
|
-
* it is generated in
|
|
83
|
+
* it is generated in `@popperjs/core/dist/cjs/popper.js l.1859`
|
|
88
84
|
* this is due to internal function isHTMLElement(), so we can not mock it directly.
|
|
89
85
|
* this function check if test DOM element mockHTMLElement instance is 'instanceof HTMLElement'
|
|
90
86
|
* so we only override the console.error side effect for this error
|
|
91
|
-
* @returns {void}
|
|
92
87
|
*/
|
|
93
88
|
export declare const mockConsoleError: () => void;
|
|
94
89
|
/**
|
|
95
90
|
* Add missing window.frames property to test context
|
|
96
91
|
* usefull for component with iframe listeners, ex: mg-popover
|
|
97
|
-
* @returns {void}
|
|
98
92
|
*/
|
|
99
93
|
export declare const mockWindowFrames: () => void;
|
|
100
94
|
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mgdis/mg-components",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.11.0",
|
|
4
4
|
"description": "MG Components",
|
|
5
5
|
"main": "dist/index.cjs.js",
|
|
6
6
|
"module": "dist/index.js",
|
|
@@ -23,14 +23,14 @@
|
|
|
23
23
|
"outputName": "junit.xml"
|
|
24
24
|
},
|
|
25
25
|
"dependencies": {
|
|
26
|
-
"@popperjs/core": "^2.11.
|
|
26
|
+
"@popperjs/core": "^2.11.7",
|
|
27
27
|
"@stencil/core": "^2.22.1",
|
|
28
28
|
"normalize.css": "^8.0.1"
|
|
29
29
|
},
|
|
30
30
|
"devDependencies": {
|
|
31
31
|
"@babel/core": "^7.20.12",
|
|
32
32
|
"@babel/plugin-transform-react-jsx": "^7.20.13",
|
|
33
|
-
"@playwright/test": "^1.
|
|
33
|
+
"@playwright/test": "^1.34.3",
|
|
34
34
|
"@pxtrn/storybook-addon-docs-stencil": "^6.4.1",
|
|
35
35
|
"@stencil/sass": "^1.5.2",
|
|
36
36
|
"@storybook/addon-a11y": "^6.5.16",
|
|
@@ -80,7 +80,7 @@
|
|
|
80
80
|
"test": "TZ=UTC stencil test --spec --e2e",
|
|
81
81
|
"test:unit": "TZ=UTC stencil test --spec --collectCoverage",
|
|
82
82
|
"test:e2e": "stencil test --e2e",
|
|
83
|
-
"test:e2e:playwright": "pnpm dlx playwright test",
|
|
83
|
+
"test:e2e:playwright": "pnpm --package=@pnpm/@playwright/test dlx playwright test",
|
|
84
84
|
"test:watch": "stencil test --spec --e2e --watchAll",
|
|
85
85
|
"generate": "stencil generate",
|
|
86
86
|
"storybook": "NODE_OPTIONS=--openssl-legacy-provider start-storybook -p 6006",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
const e=(e,a,n)=>new Intl.NumberFormat(a,{style:"currency",currency:n}).format(e),a=(e,a)=>new Intl.NumberFormat(a).format(e),n=/^\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12]\d|3[01])$/,t=(e,a)=>"string"==typeof e&&""!==e&&n.test(e)?new Intl.DateTimeFormat(a).format(new Date(e)):"",r={en:{errors:{required:"This field is required.",date:{badInput:'The date format must be <span aria-hidden="true">mm/dd/yyyy</span><span class="sr-only">m m / d d / y y y y</span> and the date must be greater than {min}',min:"The date cannot be earlier than {min}",max:"The date cannot be later than {max}",minMax:"The date must be between {min} and {max}"},numeric:{min:"The value cannot be less than {min}",max:"The value cannot be greater than {max}",minMax:"The value must be between {min} et {max}"}},nbCharLeft:"{counter} characters left.",input:{select:{placeholder:"Select a value"}},form:{required:'Fields with a <strong class="is-asterisk">*</strong> are required',requiredSingle:'Field with a <strong class="is-asterisk">*</strong> is required',allRequired:"All fields are required",allRequiredSingle:"The field is required"},message:{closeButton:"Close message"},modal:{closeButton:"Close modal"},pagination:{label:"Pagination",page:"page",pages:"pages",nextPage:"Next page",previousPage:"Previous page",selectPage:"Select the page to display."},panel:{editLabel:"Edit section title."},skipLinks:{navLabel:"Quick access"},general:{confirm:"Confirm",cancel:"Cancel",close:"Close",next:"next",previous:"previous"},plusMenu:{moreLabel:"Additional menu",badgeLabel:"Include notification(s)"},actionMore:{label:"Actions"}},fr:{errors:{required:"Ce champ est obligatoire.",date:{badInput:'Le format de la date doit être du type <span aria-hidden="true">jj/mm/aaaa</span><span class="sr-only">j j / m m / a a a a</span> et la date supérieure au {min}',min:"La date ne peut pas être antérieure au {min}",max:"La date ne peut pas être postérieure au {max}",minMax:"La date doit être comprise entre le {min} et le {max}"},numeric:{min:"La valeur ne peut pas être inférieure à {min}",max:"La valeur ne peut pas être supérieure à {max}",minMax:"La valeur doit être comprise entre {min} et {max}"}},nbCharLeft:"{counter} caractères disponibles.",input:{select:{placeholder:"Sélectionnez une valeur"}},form:{required:'Les champs marqués d\'un <strong class="is-asterisk">*</strong> sont obligatoires',requiredSingle:'Le champ marqué d\'un <strong class="is-asterisk">*</strong> est obligatoire',allRequired:"Tous les champs sont obligatoires",allRequiredSingle:"Le champ est obligatoire"},message:{closeButton:"Fermer le message"},modal:{closeButton:"Fermer la modale"},pagination:{label:"Pagination",page:"page",pages:"pages",nextPage:"Page suivante",previousPage:"Page précédente",selectPage:"Sélectionner la page à afficher."},panel:{editLabel:"Modifier le titre de la section."},skipLinks:{navLabel:"Accès rapide"},general:{confirm:"Valider",cancel:"Annuler",close:"Fermer",next:"suivant",previous:"précédent"},plusMenu:{moreLabel:"Menu complémentaire",badgeLabel:"Notification(s) incluse(s)"},actionMore:{label:"Actions"}}},i=e=>((e,a)=>{const n=e.closest("[lang]"),t=Intl.NumberFormat.supportedLocalesOf(null==n?void 0:n.lang),r=t.length>0?t[0]:navigator.language||"en",i=r.split("-").shift();return{locale:r,messages:a[i]||a.en}})(e,r);var s;!function(e){e.VERTICAL="vertical",e.HORIZONTAL="horizontal"}(s||(s={}));const l=["regular","medium","large"];export{s as D,e as a,a as b,n as d,i,t as l,l as s}
|